{"_id":"@dylandepass/franklin-web-library","_rev":"1-633a1200e06013ed4bd8d71c5d8e65e7","name":"@dylandepass/franklin-web-library","dist-tags":{"latest":"1.13.3"},"versions":{"1.13.2":{"name":"@dylandepass/franklin-web-library","version":"1.13.2","description":"Franklin Web Library","main":"src/index.js","type":"module","bin":{"franklin-web-library":"bin/cli.js"},"scripts":{"test":" c8 mocha","test-ci":"c8 mocha && codecov","lint":"eslint .","docs":"npx jsdoc2md -c .jsdoc.json --files 'src/*.js'  > docs/API.md","semantic-release":"semantic-release","commit":"git-cz","prepare":"husky install","build":"rollup --config --environment NODE_ENV:development","build:production":"rollup --config --environment NODE_ENV:production"},"repository":{"type":"git","url":"git+https://github.com/dylandepass/franklin-web-library.git"},"author":"","license":"Apache-2.0","bugs":{"url":"https://github.com/dylandepass/franklin-web-library/issues"},"homepage":"https://github.com/dylandepass/franklin-web-library#readme","mocha":{"require":"test/setup-env.js","recursive":"true","reporter":"mocha-multi-reporters","reporter-options":"configFile=.mocha-multi.json"},"devDependencies":{"@adobe/eslint-config-helix":"1.3.2","@semantic-release/changelog":"6.0.1","@semantic-release/git":"10.0.1","@semantic-release/npm":"9.0.0","c8":"7.11.0","codecov":"3.8.3","commitizen":"4.2.4","cz-conventional-changelog":"3.3.0","eslint":"8.10.0","eslint-plugin-header":"3.1.1","eslint-plugin-import":"2.25.4","husky":"7.0.4","jsdoc-to-markdown":"7.1.1","junit-report-builder":"3.0.0","lint-staged":"12.3.4","mocha":"9.2.1","mocha-multi-reporters":"1.5.1","rollup":"2.70.1","rollup-plugin-terser":"7.0.2","semantic-release":"19.0.2"},"lint-staged":{"*.js":"eslint","*.cjs":"eslint"},"publishConfig":{"access":"public"},"config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"}},"gitHead":"6cdebbcde25066b312a6a7dab056d63fa3e6d2b2","_id":"@dylandepass/franklin-web-library@1.13.2","_nodeVersion":"14.20.0","_npmVersion":"8.6.0","dist":{"integrity":"sha512-42qzzA+N8AMguLW22pFkwHsPqlRZsVzAJTM6jSZy87DpOVYI+oD3eFbCGiSEqrCZIbLX5mji/ulUZzMWXVR0Nw==","shasum":"54f0968e7ae7fc627e6d64a69fd43d337f547642","tarball":"https://registry.npmjs.org/@dylandepass/franklin-web-library/-/franklin-web-library-1.13.2.tgz","fileCount":32,"unpackedSize":217255,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDPS2GUdkunlQNvjxHE+q0Ok8JMJy+n61PDmkirmCX0uAiEA3cIEGNG1GZnM791BBIwZ99AQQF6K0qM7m2yqWoueTDI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLG0IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFuRAAmKvqtGKuUoTQEenkhCNHyyAwimEymQejzHhUQyuuaGosGJhI\r\nRjjOpG3C73x55m32kqOXZ8qk3SFQa7/C2FMc1aCCo0e6XTPFwapcLFuum3Nc\r\n+RzH3MMzb0vrWAFSKGwG/rgbXFrgbl/n4KTt9IXtVshiDmGt1mMEj3Y4X3ae\r\nK6VTFj32S3p46VB5BR1LZGCFexduRh+S5e2boeG23xzY/9GwxYLo+UYMPIaZ\r\nehJydii3UNss0vANCDOnpa688Xt+gzSQsAMeiqWystPRgfn/jkHTjBES+oFa\r\nBazWC/hft3OJsjY2N8q+v32WBqFvK+Tnq9H6fGohnsnaIHG1r7ELdN3cvCME\r\nDcm6h7H4+mm4uI1FWk/qdSZOzinmsbMKdP5zTZO9Xkiz7P1TEhUL6sKGx4Xs\r\nNSlOkzHPqKM3RvYynCSN2FMdJf3rLxKoEyccTUGNDtLymLhX4Dro2l7cOep7\r\nHDvIEdN/0vLreKoc4dFiVl0MT8EA5Bz1IPdsNmRQvLZHurx+IEdTphJh1yAF\r\nJvE/nNTli1Y6mPrCjM5Bbff2uZJMo3UdmSg1hAJqZLuO6c3PbRKTXrWXbDC9\r\neGLAijse6OsqlspNV0biazQ3dsibDp1AOWC4oFwmAykfaUHH2Ef/JqsFL81a\r\nuok6K+eoDaKAQnNoHJT1eLQJvLc8yyPbVyM=\r\n=GKDx\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dylandepass","email":"dylandepass@gmail.com"},"directories":{},"maintainers":[{"name":"dylandepass","email":"dylandepass@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/franklin-web-library_1.13.2_1663855880413_0.6311668959052654"},"_hasShrinkwrap":false},"1.13.3":{"name":"@dylandepass/franklin-web-library","version":"1.13.3","description":"Franklin Web Library","main":"src/index.js","type":"module","bin":{"franklin-web-library":"bin/cli.js"},"scripts":{"test":" c8 mocha","test-ci":"c8 mocha && codecov","lint":"eslint .","docs":"npx jsdoc2md -c .jsdoc.json --files 'src/*.js'  > docs/API.md","semantic-release":"semantic-release","commit":"git-cz","prepare":"husky install","build":"rollup --config --environment NODE_ENV:development","build:production":"rollup --config --environment NODE_ENV:production"},"repository":{"type":"git","url":"git+https://github.com/dylandepass/franklin-web-library.git"},"author":"","license":"Apache-2.0","bugs":{"url":"https://github.com/dylandepass/franklin-web-library/issues"},"homepage":"https://github.com/dylandepass/franklin-web-library#readme","mocha":{"require":"test/setup-env.js","recursive":"true","reporter":"mocha-multi-reporters","reporter-options":"configFile=.mocha-multi.json"},"devDependencies":{"@adobe/eslint-config-helix":"1.3.2","@semantic-release/changelog":"6.0.1","@semantic-release/git":"10.0.1","@semantic-release/npm":"9.0.0","c8":"7.11.0","codecov":"3.8.3","commitizen":"4.2.4","cz-conventional-changelog":"3.3.0","eslint":"8.10.0","eslint-plugin-header":"3.1.1","eslint-plugin-import":"2.25.4","husky":"7.0.4","jsdoc-to-markdown":"7.1.1","junit-report-builder":"3.0.0","lint-staged":"12.3.4","mocha":"9.2.1","mocha-multi-reporters":"1.5.1","rollup":"2.70.1","rollup-plugin-terser":"7.0.2","semantic-release":"19.0.2"},"lint-staged":{"*.js":"eslint","*.cjs":"eslint"},"publishConfig":{"access":"public"},"config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"}},"gitHead":"de87d2f65b6ff3d07a23543ed7de099534cdc52a","_id":"@dylandepass/franklin-web-library@1.13.3","_nodeVersion":"14.20.0","_npmVersion":"8.6.0","dist":{"integrity":"sha512-EAvY54qOiV1TQXAeQ383gLHvdSGWgrDVYX+PwGCtmvLdZSsfoha72m+qqL5X2OMRJQjQ+O+aT+9vyyIxFx6BJg==","shasum":"959cfb7765a5b1dc133643c94ea92c9287d6b686","tarball":"https://registry.npmjs.org/@dylandepass/franklin-web-library/-/franklin-web-library-1.13.3.tgz","fileCount":32,"unpackedSize":217866,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCHH7z3xx5i4rWMDCLKP763tHXa3E0djI188LAR9zHFQIgMVYBMJCkJEs0lm5DV4QgeSKbRk1E3XQLAbfvWX2sj7A="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLMCwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZsQ/5AZ5+yWUIb/V3mdb+I1vcjB3BqvfoTwOTi5v9wwFV2J/ECU+N\r\nkADG+uzg2SWFiDQ+eyLGG3NOAs87RG6EEDRfplgixl45mFmDwk5X1mogr+Fb\r\nb4iK3Nkff9m+CfEmzN1G7KuiqfvlbD/+UIyUrB17C1qZYbeX/AdDVWdnvJdU\r\nunJuFAsD/kAeJdKUCO1P5SFqbpaXmLgdq+I3ecM+a+dHuLcitL6kfTyeCmgv\r\n1Cjnl/f1uRXMLoB2wXDpGAAWUWOBFJd1MZszeBy+hlPRfaIbm5mDz34eDCUN\r\novqj2AtURMt9IaP1gsmdCUbkGamx+xn3rRcrUtCdlLKN6bZTdKJ/vxp1Ueie\r\nQoYdDaLa0P4UZOzKTCVi67c8VrB6IaTGN2WOz3g197kfQJnWG8nTDu9NmG5R\r\nb/vz9KeZ8y+reU9v+KVXLz2rVGmPvOlvMHVkGOwMKXQKKtdO2gaHZbvyX3wU\r\noAyKJqsrIB1xzRq25sN2unmPd6LCdxoO0GkvkBFDNFqHTAU2MOwjz9zdYDBh\r\nw47emPHVbQEZ5HL6KZ+uOv2me7f5ifw+Udrp2A6pNoO464ubbotcIYvegYAt\r\nuDF3RXz6RRMN8+v8zl/4CbY3gXynR2F2m7fYkf41iBDdf/R+hiQbJTA2Q9wX\r\npiS+jyQW+u2O9t6DGdGtnBq5efYvgYPdJeY=\r\n=KO9k\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dylandepass","email":"dylandepass@gmail.com"},"directories":{},"maintainers":[{"name":"dylandepass","email":"dylandepass@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/franklin-web-library_1.13.3_1663877295932_0.1383510535850736"},"_hasShrinkwrap":false}},"time":{"created":"2022-09-22T14:11:20.360Z","1.13.2":"2022-09-22T14:11:20.695Z","modified":"2022-09-22T20:08:16.182Z","1.13.3":"2022-09-22T20:08:16.112Z"},"maintainers":[{"name":"dylandepass","email":"dylandepass@gmail.com"}],"description":"Franklin Web Library","homepage":"https://github.com/dylandepass/franklin-web-library#readme","repository":{"type":"git","url":"git+https://github.com/dylandepass/franklin-web-library.git"},"bugs":{"url":"https://github.com/dylandepass/franklin-web-library/issues"},"license":"Apache-2.0","readme":"# Franklin Web Library\n\n> Set of reusable classes and functions for rendering Franklin pages\n\n## Status\n[![codecov](https://img.shields.io/codecov/c/github/dylandepass/franklin-web-library.svg)](https://codecov.io/gh/dylandepass/franklin-web-library)\n[![CircleCI](https://img.shields.io/circleci/project/github/dylandepass/franklin-web-library.svg)](https://circleci.com/gh/dylandepass/franklin-web-library)\n[![GitHub license](https://img.shields.io/github/license/dylandepass/franklin-web-library.svg)](https://github.com/dylandepass/franklin-web-library/blob/master/LICENSE.txt)\n[![GitHub issues](https://img.shields.io/github/issues/dylandepass/franklin-web-library.svg)](https://github.com/dylandepass/franklin-web-library/issues)\n[![LGTM Code Quality Grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/dylandepass/franklin-web-library.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/dylandepass/franklin-web-library)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n## Installation\n\nCan be added to a franklin project either with by downloading the bundles directly from the releases page on github, using a cloud bundler like skypack or using npm (requires a build step).\n\n### NPM\n```bash\n$ npm install @dylandepass/franklin-web-library\n```\n\nAfter installing, the library bundle can be added to `scripts/` using the CLI:\n```bash\n$ npx franklin-web-library install\n```\n\n> For more updating, removing, and options, see [CLI](#cli)\n\n\n### Github Release\nDownload the required bundles from the [releases page](https://github.com/dylandepass/franklin-web-library/releases).\n\n### Skypack Release\n[Franklin Web Framework ESM](https://cdn.skypack.dev/@dylandepass/franklin-web-library@latest/dist/franklin-web-library.esm.js)\n\n[Franklin Web Framework ESM (Minified)](https://cdn.skypack.dev/@dylandepass/franklin-web-library@latest/dist/franklin-web-library.esm.min.js)\n\n[Franklin Web Forms ESM](https://cdn.skypack.dev/@dylandepass/franklin-web-library@latest/dist/franklin-web-forms.esm.js)\n\n[Franklin Web Forms ESM (Minified)](https://cdn.skypack.dev/@dylandepass/franklin-web-library@latest/dist/franklin-web-forms.esm.min.js)\n\n## What's included?\n\nThe two scripts included are `franklin-web-framework` and `franklin-web-forms`.\n\n### franklin-web-framework\nIncludes a helper class that abstracts the decoration and loading of a franklin page. This class provides various hooks and overrides for customizating the franklin decoration and loading process.\n\n#### Usage\n\n```js\n\nimport { Franklin } from 'https://cdn.skypack.dev/@dylandepass/franklin-web-library@latest/dist/franklin-web-library.esm.min.js';\n\nFranklin.init({\n  rumEnabled: true,\n  rumGeneration: 'project-1',\n  productionDomains: ['acme.com'],\n  lcpBlocks: ['hero'],\n})\n  .withLoadEager(loadEager)\n  .withBuildAutoBlocks((main) => {\n    try {\n      buildHeroBlock(main);\n    } catch (error) {\n      // eslint-disable-next-line no-console\n      console.error('Auto Blocking failed', error);\n    }\n  })\n  .decorate();\n```\n\n##### Builder Options\nBuilder configuration options \n\n| Name        | Description                                             | Example                        | Default           |\n|-------------|---------------------------------------------------------|--------------------------------|-------------------|\n| rumEnabled       | Enable RUM collection?   | true                   | false                       |\n| rumGeneration       | RUM generation id   |  'project-1'                  | undefined                       |\n| productionDomains       | A list of productions domains.  | ['acme.com']                   | []                       |\n| lcpBlocks       | List of blocks classes to treat as LCP   | ['hero']                   | []                       |\n| autoAppear       | Should we set the appear class on the body after LCP load? If false then client must add the appear class (`document.querySelector('body').classList.add('appear');`)   | true                   | true                       |\n| blocksSelector       | The CSS selector used to query blocks   | ':scope > div > div'                   | 'div.section > div > div'                       |\n| lazyStyles       | Should lazy styles be loaded (`/styles/lazy-styles.css`)   | true                    | false                       |\n| favIcon       | Path to favIcon, supports both `.icon` and `.svg`   | `/styles/icon.ico`                    | `/styles/icon.svg`                       |\n| iconsPath       | Path to icons folder   | `/somepath`                    | `/icons`                       |\n| enableBlockLoader       | Should the block loader run? In some cases we don't want it to (i.e storybook)   | false                  | true                      |\n| loadHeader       | Should the header be loaded   | false                   | true                  |\n| loadFooter       | Should the footer be loaded   | false                   | true                       |\n\n#### Lifecycle hooks\nThese lifecycle hooks can be used to tie custom logic into the page loading flow.\n\n| Hooks        | Description                                                                                                 | \n|-------------|-------------------------------------------------------------------------------------------------------------|\n| `withLoadEager` | Called just after main is decorated and LCP is loaded |\n| `withDecorateMain` | Called after block decoration and before waitForLCP. |\n| `withLoadLazy` | Called just after all blocks have been loaded (js/css) |\n| `withLoadDelayed` | Called after the page load lifecycle has completed |\n\n#### Decoration/Loading overrides\nIf you need to customize the page decoration the following overrides are available.\n\n| Hooks        | Description                                                                                                 | \n|-------------|-------------------------------------------------------------------------------------------------------------|\n| `withBuildAutoBlocks` | Add any logic required to build auto blocks here |\n| `withDecorateSections` | Overrides the default decorate sections logic |\n| `withDecorateBlock` | Overrides the default decorate block logic |\n| `withLoadHeader` | Overrides the default load header logic |\n| `withLoadFooter` | Overrides the default load footer logic |\n| `withDecorateIcons` | Overrides the default decorate icons logic |\n| `withDecorateButtons` | Overrides the default decorate buttons logic |\n\nFor example, if you want a different decoration for your buttons you can use `withDecorateButtons` to override the default behaviour.\n\n```js\nimport { Franklin } from 'https://cdn.skypack.dev/@dylandepass/franklin-web-library@latest/dist/franklin-web-library.esm.min.js';\n\nFranklin.init({\n  ...\n})\n  ...\n  .withDecorateButtons((main) => {\n    // custom button decoration code\n  })\n  .decorate();\n```\n\n\nSee the [API documentation](docs/API.md).\n\n### franklin-web-forms\n\n> This is a pre-alpha and and mainly just an experiment.. Not meant for production use\n\nCreates an HTML form based on a form definiton defined in a sheet. The form definition should be contained in the `franklin-default` sheet. No assumptions are made on the styling of the form as is left up to the developer to style the form markup.\n\n```js\nimport { createForm } from 'franklin-web-framework.esm.min.js';\n\nexport default async function decorate(block) {\n  const form = block.querySelector('a[href$=\".json\"]');\n  if (form) {\n    form.replaceWith(await createForm(form.href));\n  }\n}\n```\n\n#### Supported form field definitions\n\n| Name        | Description                                                                                                 | Example                                                                                     |\n|-------------|-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|\n| Field       | The name of the field, will be set in the class name.                                                       | customerName                                                                                |\n| Label       | The field label                                                                                             | Customer Name                                                                               |\n| Placeholder | Placeholder text for the field                                                                              | Acme corp                                                                                   |\n| Type        | The field type. Currently supports `text-field`, `heading`, `select`, `text-area`                           | text-area                                                                                   |\n| Format      | The [input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types) of the field. | password                                                                                    |\n| Mandatory   | Is this a required field?                                                                                   | x                                                                                           |\n| Options     | If field type is `select`, options are set here                                                             | Don't know, Yes, No                                                                         |\n| Rules       | Basic rules enginem, currently only supports `visible`                                                      | `{\"type\": \"visible\", \"condition\": {\"key\": \"cms\", \"operator\": \"eq\",  \"value\": \"AEM Sites\"}}` |\n| Extra       | Redirect path after submission                                                                              | `/thank-you`                                                                                |\n\n## CLI\n\n### Examples\n\nUpdate/reinstall (overwrites existing file):\n```bash\n$ npx franklin-web-library install --force\n```\n\nRemove without installing:\n```bash\n$ npx franklin-web-library uninstall\n```\n\nInstall to a different path (must be inside current working directory):\n```bash\n$ npx franklin-web-library install --dir=./libs\n```\n\n### Install Options\n| Option | Shorthand | Description | Default |\n| ------ | --------- | ----------- | ------- |\n| `--dir` | `-d` | Install directory | `-d=./scripts` |\n| `--force` | `-f` | Force overwrite existing, upgrade by deleting existing library at path. | |\n| `--minify` | `-m` | Install minified library | |\n\n\n## Development\n\nNew release are built automatically with every commit to main.\n\n### Build\n\n```bash\n$ npm install\n```\n\n### Test\n\n```bash\n$ npm test\n```\n\n### Lint\n\n```bash\n$ npm run lint\n```\n","readmeFilename":"README.md"}