{"_id":"@dblechoc/scoped-registry-mixin","_rev":"1-68ebae84b2d4d88e631fdc56cd947a3a","name":"@dblechoc/scoped-registry-mixin","dist-tags":{"latest":"1.0.0-pre.1"},"versions":{"1.0.0-pre.1":{"name":"@dblechoc/scoped-registry-mixin","version":"1.0.0-pre.1","description":"A mixin for using speculative \"scoped CustomElementRegistry\" with LitElement.","license":"BSD-3-Clause","homepage":"https://lit-element.polymer-project.org/","repository":{"type":"git","url":"git+https://github.com/polymer/lit-html.git","directory":"packages/labs/scoped-registry-mixin"},"type":"module","main":"scoped-registry-mixin.js","module":"scoped-registry-mixin.js","typings":"scoped-registry-mixin.d.ts","directories":{"test":"test"},"exports":{".":{"development":"./development/scoped-registry-mixin.js","default":"./scoped-registry-mixin.js"}},"scripts":{"build":"npm run clean && npm run build:ts --build && rollup -c","build:watch":"rollup -c --watch","build:ts":"tsc --build && treemirror development . '**/*.d.ts{,.map}'","build:ts:watch":"tsc --build --watch","clean":"rm -rf {scoped-registry-mixin}.{js,js.map,d.ts} development/ test/ *.tsbuildinfo","dev":"scripts/dev.sh","test":"npm run test:dev && npm run test:prod","test:dev":"cd ../../tests && npx wtr '../labs/scoped-registry-mixin/development/**/*_test.js'","test:prod":"TEST_PROD_BUILD=true npm run test:dev","test:watch":"npm run test:dev -- --watch","checksize":"rollup -c --environment=CHECKSIZE","regen-package-lock":"rm -rf node_modules package-lock.json; npm install"},"author":{"name":"The Polymer Authors"},"dependencies":{"lit":"^2.0.0-pre.2"},"devDependencies":{"@esm-bundle/chai":"^4.1.5","@types/chai":"^4.0.1","@types/mocha":"^8.0.3","@types/trusted-types":"^1.0.1","@web/test-runner-mocha":"^0.3.5","@webcomponents/scoped-custom-element-registry":"^0.0.1","chokidar-cli":"^2.1.0","concurrently":"^5.3.0","mocha":"^8.1.3","rollup":"^2.28.2","typescript":"^4.1.3","internal-scripts":"^1.0.0"},"publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/polymer/lit-html/issues"},"_id":"@dblechoc/scoped-registry-mixin@1.0.0-pre.1","_nodeVersion":"14.15.1","_npmVersion":"7.8.0","dist":{"integrity":"sha512-LyhuxdN+X0nBgqajg1I0QZk8hluPko/XvLjqoAD7+cbdbgM7DG06ObAbNcjpWe11qHqxgGIhNBtWPgesavDbHw==","shasum":"05d7307c0b1e75f2475daa8e64b1b31c3e8afd7d","tarball":"https://registry.npmjs.org/@dblechoc/scoped-registry-mixin/-/scoped-registry-mixin-1.0.0-pre.1.tgz","fileCount":13,"unpackedSize":20408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJganM/CRA9TVsSAnZWagAAa0MQAIqcnCT/gszhYEUUPTr+\nf56CHmDBzbqh6d2sMAIecOtsW6mnAQt+fXXu5Ax/fSf/0A+DGXe3enfMP+d7\nu2GjcJ8ZQO7Odj1ahzzLS/cfsST+4Goi1sj+AhKggZjGA1lC8cb9JC7waHiA\nkOH5EoyGaUSv4FG+nFMxP8X/e+IsNxTA2P8/PATiBXIV7QYzSeNsQpB35yiw\nbsOZ2iZ5Z2hdSexTp6Nk51QJVZlUZnUjG2XhVb7LhF0TIy4nVzcXMmv0cWou\ntPZqBy1+ZWVTKbNhqWRPvspmTtXdKEhP9xMorfIkgByquKV9K5knZKK3MLMT\nDFJ4hQBZYVsf33/FZafkqGTDoJm4xHQcHc3vmF5XKGdmz+s1DsKCwz65I8PJ\nQHDBKpAxiSU3gCiPa8ya5vSCUgHoX6xCH5QrQItbDJwcd+utv9aH00Ylf+sn\nCKrPYYN4UJOA2ywLgDdWV3newXzlnHz4mX/Gyy/dZW4Bj5AhbkCkD+7EYcdc\nGYY6l9g6Av1cRilkp1f9u/GuZxPkI7b4ykTkt8o8Os+yf0OQkEUiJ3I2LGb8\ncmJ52s/h8aBsR6x5weJbROkIOrm1wIJw5NQuWHlfnjMmnxwBaqnTc/10CZ2A\nzURYVaR2XOqNQLQQ2egaLUEFPIPTpBvgWNaTl0VR4SrSUfWiHVtEsRStc3z3\nTaPk\r\n=3qRm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA5U8uX7/kLevaKZLhhC0r2sSXdu/ZeaRwXmyG1zC3O1AiEAj6UKvnKHS81qtlTASLqeS8iRAg7Srf7bboKd/IvHNEA="}]},"_npmUser":{"name":"dblechoc","email":"sync@me.com"},"maintainers":[{"name":"dblechoc","email":"sync@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scoped-registry-mixin_1.0.0-pre.1_1617589055394_0.8741823241921769"},"_hasShrinkwrap":false}},"time":{"created":"2021-04-05T02:17:35.348Z","1.0.0-pre.1":"2021-04-05T02:17:35.551Z","modified":"2022-04-05T03:17:45.905Z"},"maintainers":[{"name":"dblechoc","email":"sync@me.com"}],"description":"A mixin for using speculative \"scoped CustomElementRegistry\" with LitElement.","homepage":"https://lit-element.polymer-project.org/","repository":{"type":"git","url":"git+https://github.com/polymer/lit-html.git","directory":"packages/labs/scoped-registry-mixin"},"author":{"name":"The Polymer Authors"},"bugs":{"url":"https://github.com/polymer/lit-html/issues"},"license":"BSD-3-Clause","readme":"# @lit-labs/scoped-registry-mixin\n\n`ScopedRegistryHost` mixin for `LitElement` that integrates with the speculative [Scoped CustomElementRegistry polyfill](https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry).\n\n🚨 **Warning: Scoped Custom Element Registries is a proposed browser API. It has not been finalized nor shipped in any browser.** This mixin is provided to evaluate the proposal and facilitate feedback. **Use this feature, and the polyfill in production code at your own risk.**\n\n## Overview\n\nThe [Scoped Custom Element Registries](https://github.com/WICG/webcomponents/blob/gh-pages/proposals/Scoped-Custom-Element-Registries.md) WICG proposal introduces new APIs for scoping custom element definitions to shadow roots, such that the mapping of tag names to custom element class doesn't rely on a single global registry.\n\nWhen new elements are created within a shadow root with a scoped custom element registry, the browser will use the scoped registry rather than the global registry to look up custom element definitions. When using a scoped element registry, all used custom element elements must be defined within that scope.\n\n`ScopedRegistryHost` adds the following features to LitElement:\n\n1. Automatically creates a scoped CustomElementRegistry for the class\n2. Provides sugar for defining custom elements in the scoped registry\n3. Passes the registry to `attachShadow()` to enable scoping\n4. Passes the shadow root to lit-html to create DOM within the scope\n\nA speculative [Scoped CustomElementRegistry polyfill](https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry) is being developed. Because the proposal is not implemented natively, `ScopedRegistryHost` requires the polyfill.\n\n## Usage\n\nThe mixin adds a declarative `static elementDefinitions` property for declaring the custom elements to be scoped locally to its Shadow DOM.\n\nBasic usage is as follows:\n\n```js\nimport {LitElement, html} from 'lit';\nimport {ScopedRegistryHost} from '@lit-labs/scoped-registry-mixin';\n\nimport {SimpleGreeting} from './simple-greeting.js';\n\nclass ScopedComponent extends ScopedRegistryHost(LitElement) {\n  // Elements here will be registered against the tag names provided only\n  // in the shadow root for this element\n  static elementDefinitions = {\n    'simple-greeting': SimpleGreeting,\n  };\n\n  render() {\n    return html` <simple-greeting\n      id=\"greeting\"\n      name=\"scoped world\"\n    ></simple-greeting>`;\n  }\n}\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING.md](../../../CONTRIBUTING.md).\n","readmeFilename":"README.md"}