@rijkshuisstijl-community/web-components-stencil 1.0.0-alpha.2 → 1.0.0-alpha.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/dist/cjs/{index-97a16ac9.js → index-6abd9e3a.js} +123 -26
  2. package/dist/cjs/index-6abd9e3a.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/rhc-icon-arrow-right.cjs.entry.js +1 -1
  5. package/dist/cjs/rhc-icon-calendar.cjs.entry.js +1 -1
  6. package/dist/cjs/rhc-icon-error.cjs.entry.js +1 -1
  7. package/dist/cjs/rhc-icon-info_2.cjs.entry.js +1 -1
  8. package/dist/cjs/rhc-icon-success.cjs.entry.js +1 -1
  9. package/dist/cjs/rhc-icon-warning.cjs.entry.js +1 -1
  10. package/dist/cjs/rhc.cjs.js +2 -2
  11. package/dist/cjs/rhc.cjs.js.map +1 -1
  12. package/dist/collection/collection-manifest.json +2 -2
  13. package/dist/esm/{index-c2d82fd1.js → index-a0c70ca0.js} +123 -26
  14. package/dist/esm/index-a0c70ca0.js.map +1 -0
  15. package/dist/esm/loader.js +2 -2
  16. package/dist/esm/rhc-icon-arrow-right.entry.js +1 -1
  17. package/dist/esm/rhc-icon-calendar.entry.js +1 -1
  18. package/dist/esm/rhc-icon-error.entry.js +1 -1
  19. package/dist/esm/rhc-icon-info_2.entry.js +1 -1
  20. package/dist/esm/rhc-icon-success.entry.js +1 -1
  21. package/dist/esm/rhc-icon-warning.entry.js +1 -1
  22. package/dist/esm/rhc.js +3 -3
  23. package/dist/esm/rhc.js.map +1 -1
  24. package/dist/rhc/{p-bab6df1d.entry.js → p-11cacb44.entry.js} +2 -2
  25. package/dist/rhc/{p-569d82ec.entry.js → p-6ff329f1.entry.js} +2 -2
  26. package/dist/rhc/p-74d5e7fb.js +3 -0
  27. package/dist/rhc/p-74d5e7fb.js.map +1 -0
  28. package/dist/rhc/{p-1849850a.entry.js → p-80f1e438.entry.js} +2 -2
  29. package/dist/rhc/{p-4378bb06.entry.js → p-c053a5fc.entry.js} +2 -2
  30. package/dist/rhc/{p-3c963064.entry.js → p-d056e80b.entry.js} +2 -2
  31. package/dist/rhc/{p-1ddc5ba6.entry.js → p-e7742379.entry.js} +2 -2
  32. package/dist/rhc/rhc.esm.js +1 -1
  33. package/dist/rhc/rhc.esm.js.map +1 -1
  34. package/dist/types/stencil-public-runtime.d.ts +24 -3
  35. package/package.json +8 -8
  36. package/dist/cjs/index-97a16ac9.js.map +0 -1
  37. package/dist/esm/index-c2d82fd1.js.map +0 -1
  38. package/dist/rhc/p-1f328841.js +0 -3
  39. package/dist/rhc/p-1f328841.js.map +0 -1
  40. /package/dist/rhc/{p-bab6df1d.entry.js.map → p-11cacb44.entry.js.map} +0 -0
  41. /package/dist/rhc/{p-569d82ec.entry.js.map → p-6ff329f1.entry.js.map} +0 -0
  42. /package/dist/rhc/{p-1849850a.entry.js.map → p-80f1e438.entry.js.map} +0 -0
  43. /package/dist/rhc/{p-4378bb06.entry.js.map → p-c053a5fc.entry.js.map} +0 -0
  44. /package/dist/rhc/{p-3c963064.entry.js.map → p-d056e80b.entry.js.map} +0 -0
  45. /package/dist/rhc/{p-1ddc5ba6.entry.js.map → p-e7742379.entry.js.map} +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-97a16ac9.js');
5
+ const index = require('./index-6abd9e3a.js');
6
6
 
7
7
  const IconSuccess = class {
8
8
  constructor(hostRef) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-97a16ac9.js');
5
+ const index = require('./index-6abd9e3a.js');
6
6
 
7
7
  const IconWarning = class {
8
8
  constructor(hostRef) {
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-97a16ac9.js');
5
+ const index = require('./index-6abd9e3a.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Browser v4.1.0 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.7.2 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchBrowser = () => {
11
11
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('rhc.cjs.js', document.baseURI).href));
@@ -1 +1 @@
1
- {"file":"rhc.cjs.js","mappings":";;;;;;AAAA;AACA;AACA;AAGA,MAAM,YAAY,GAAG,MAAM;AAyB3B,IAAI,MAAM,UAAU,GAAG,qMAAe,CAAC;AACvC,IAAI,MAAM,IAAI,GAAiE,EAAE,CAAC;AAClF,IAAI,IAAI,UAAU,KAAK,EAAE,EAAE;AAC3B,QAAQ,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC;AAC1D,KAAK;AACL,IAAI,OAAOA,oBAAc,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;;AChCD,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI;AAE/B,EAAE,OAAOC,mBAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC,CAAC;;;;","names":["promiseResolve","bootstrapLazy"],"sources":["../../node_modules/.pnpm/@stencil+core@4.1.0/node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.1.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n if (BUILD.profile && !performance.mark) {\n // not all browsers support performance.mark/measure (Safari 10)\n // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,\n // simply stub the implementations out.\n // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)\n // @ts-ignore\n performance.mark = performance.measure = () => {\n /*noop*/\n };\n performance.getEntriesByName = () => [];\n }\n // @ts-ignore\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"version":3}
1
+ {"file":"rhc.cjs.js","mappings":";;;;;;AAAA;AACA;AACA;AAGA,MAAM,YAAY,GAAG,MAAM;AAa3B,IAAI,MAAM,UAAU,GAAG,qMAAe,CAAC;AACvC,IAAI,MAAM,IAAI,GAAiE,EAAE,CAAC;AAClF,IAAI,IAAI,UAAU,KAAK,EAAE,EAAE;AAC3B,QAAQ,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC;AAC1D,KAAK;AACL,IAAI,OAAOA,oBAAc,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;;ACpBD,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI;AAE/B,EAAE,OAAOC,mBAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC,CAAC;;;;","names":["promiseResolve","bootstrapLazy"],"sources":["../../node_modules/.pnpm/@stencil+core@4.7.2/node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.7.2 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"version":3}
@@ -10,8 +10,8 @@
10
10
  ],
11
11
  "compiler": {
12
12
  "name": "@stencil/core",
13
- "version": "4.1.0",
14
- "typescriptVersion": "5.0.4"
13
+ "version": "4.7.2",
14
+ "typescriptVersion": "5.2.2"
15
15
  },
16
16
  "collections": [],
17
17
  "bundles": []
@@ -27,6 +27,13 @@ const uniqueTime = (key, measureText) => {
27
27
  }
28
28
  };
29
29
  const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
30
+ /**
31
+ * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
32
+ *
33
+ * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
34
+ * support as of Stencil v4.
35
+ */
36
+ const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
30
37
  const XLINK_NS = 'http://www.w3.org/1999/xlink';
31
38
  /**
32
39
  * Default style mode id
@@ -105,6 +112,7 @@ const h = (nodeName, vnodeData, ...children) => {
105
112
  };
106
113
  walk(children);
107
114
  if (vnodeData) {
115
+ // normalize class / className attributes
108
116
  {
109
117
  const classData = vnodeData.className || vnodeData.class;
110
118
  if (classData) {
@@ -246,6 +254,10 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
246
254
  }
247
255
  styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
248
256
  }
257
+ // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
258
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
259
+ styleElm.innerHTML += SLOT_FB_CSS;
260
+ }
249
261
  if (appliedStyles) {
250
262
  appliedStyles.add(scopeId);
251
263
  }
@@ -953,6 +965,10 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
953
965
  */
954
966
  const callRender = (hostRef, instance, elm, isInitialLoad) => {
955
967
  try {
968
+ /**
969
+ * minification optimization: `allRenderFn` is `true` if all components have a `render`
970
+ * method, so we can call the method immediately. If not, check before calling it.
971
+ */
956
972
  instance = instance.render() ;
957
973
  {
958
974
  hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
@@ -1061,6 +1077,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1061
1077
  * @returns a reference to the same constructor passed in (but now mutated)
1062
1078
  */
1063
1079
  const proxyComponent = (Cstr, cmpMeta, flags) => {
1080
+ var _a;
1064
1081
  if (cmpMeta.$members$) {
1065
1082
  // It's better to have a const than two Object.entries()
1066
1083
  const members = Object.entries(cmpMeta.$members$);
@@ -1085,7 +1102,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1085
1102
  });
1086
1103
  if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1087
1104
  const attrNameToPropName = new Map();
1088
- prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1105
+ prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1089
1106
  plt.jmp(() => {
1090
1107
  const propName = attrNameToPropName.get(attrName);
1091
1108
  // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
@@ -1108,12 +1125,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1108
1125
  // customElements.define('my-component', MyComponent);
1109
1126
  // </script>
1110
1127
  // ```
1111
- // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
1128
+ // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
1112
1129
  // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1113
1130
  // to the value that was set inline i.e. "some-value" from above example. When
1114
- // the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
1131
+ // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
1115
1132
  //
1116
- // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
1133
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
1117
1134
  // by connectedCallback as this attributeChangedCallback will not fire.
1118
1135
  //
1119
1136
  // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
@@ -1133,23 +1150,62 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1133
1150
  // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1134
1151
  return;
1135
1152
  }
1153
+ else if (propName == null) {
1154
+ // At this point we should know this is not a "member", so we can treat it like watching an attribute
1155
+ // on a vanilla web component
1156
+ const hostRef = getHostRef(this);
1157
+ const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
1158
+ // We only want to trigger the callback(s) if:
1159
+ // 1. The instance is ready
1160
+ // 2. The watchers are ready
1161
+ // 3. The value has changed
1162
+ if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1163
+ flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1164
+ newValue !== oldValue) {
1165
+ const instance = hostRef.$lazyInstance$ ;
1166
+ const entry = cmpMeta.$watchers$[attrName];
1167
+ entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1168
+ if (instance[callbackName] != null) {
1169
+ instance[callbackName].call(instance, newValue, oldValue, attrName);
1170
+ }
1171
+ });
1172
+ }
1173
+ return;
1174
+ }
1136
1175
  this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1137
1176
  });
1138
1177
  };
1139
- // create an array of attributes to observe
1140
- // and also create a map of html attribute name to js property name
1141
- Cstr.observedAttributes = members
1142
- .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
1143
- .map(([propName, m]) => {
1144
- const attrName = m[1] || propName;
1145
- attrNameToPropName.set(attrName, propName);
1146
- return attrName;
1147
- });
1178
+ // Create an array of attributes to observe
1179
+ // This list in comprised of all strings used within a `@Watch()` decorator
1180
+ // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
1181
+ // As such, there is no way to guarantee type-safety here that a user hasn't entered
1182
+ // an invalid attribute.
1183
+ Cstr.observedAttributes = Array.from(new Set([
1184
+ ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
1185
+ ...members
1186
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1187
+ .map(([propName, m]) => {
1188
+ const attrName = m[1] || propName;
1189
+ attrNameToPropName.set(attrName, propName);
1190
+ return attrName;
1191
+ }),
1192
+ ]));
1148
1193
  }
1149
1194
  }
1150
1195
  return Cstr;
1151
1196
  };
1152
- const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1197
+ /**
1198
+ * Initialize a Stencil component given a reference to its host element, its
1199
+ * runtime bookkeeping data structure, runtime metadata about the component,
1200
+ * and (optionally) an HMR version ID.
1201
+ *
1202
+ * @param elm a host element
1203
+ * @param hostRef the element's runtime bookkeeping object
1204
+ * @param cmpMeta runtime metadata for the Stencil component
1205
+ * @param hmrVersionId an (optional) HMR version ID
1206
+ */
1207
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1208
+ let Cstr;
1153
1209
  // initializeComponent
1154
1210
  if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1155
1211
  // Let the runtime know that the component has been initialized
@@ -1287,12 +1343,13 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1287
1343
  const customElements = win.customElements;
1288
1344
  const head = doc.head;
1289
1345
  const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1290
- const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1346
+ const dataStyles = /*@__PURE__*/ doc.createElement('style');
1291
1347
  const deferredConnectedCallbacks = [];
1292
1348
  let appLoadFallback;
1293
1349
  let isBootstrapping = true;
1294
1350
  Object.assign(plt, options);
1295
1351
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1352
+ let hasSlotRelocation = false;
1296
1353
  lazyBundles.map((lazyBundle) => {
1297
1354
  lazyBundle[1].map((compactMeta) => {
1298
1355
  const cmpMeta = {
@@ -1301,6 +1358,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1301
1358
  $members$: compactMeta[2],
1302
1359
  $listeners$: compactMeta[3],
1303
1360
  };
1361
+ // Check if we are using slots outside the shadow DOM in this component.
1362
+ // We'll use this information later to add styles for `slot-fb` elements
1363
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
1364
+ hasSlotRelocation = true;
1365
+ }
1304
1366
  {
1305
1367
  cmpMeta.$members$ = compactMeta[2];
1306
1368
  }
@@ -1351,15 +1413,23 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1351
1413
  }
1352
1414
  });
1353
1415
  });
1416
+ // Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
1417
+ if (hasSlotRelocation) {
1418
+ dataStyles.innerHTML += SLOT_FB_CSS;
1419
+ }
1420
+ // Add hydration styles
1354
1421
  {
1355
- visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1356
- visibilityStyle.setAttribute('data-styles', '');
1422
+ dataStyles.innerHTML += cmpTags + HYDRATED_CSS;
1423
+ }
1424
+ // If we have styles, add them to the DOM
1425
+ if (dataStyles.innerHTML.length) {
1426
+ dataStyles.setAttribute('data-styles', '');
1427
+ head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
1357
1428
  // Apply CSP nonce to the style tag if it exists
1358
1429
  const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1359
1430
  if (nonce != null) {
1360
- visibilityStyle.setAttribute('nonce', nonce);
1431
+ dataStyles.setAttribute('nonce', nonce);
1361
1432
  }
1362
- head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1363
1433
  }
1364
1434
  // Process deferred connectedCallbacks now all components have been registered
1365
1435
  isBootstrapping = false;
@@ -1381,22 +1451,49 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1381
1451
  * @returns void
1382
1452
  */
1383
1453
  const setNonce = (nonce) => (plt.$nonce$ = nonce);
1454
+ /**
1455
+ * A WeakMap mapping runtime component references to their corresponding host reference
1456
+ * instances.
1457
+ */
1384
1458
  const hostRefs = /*@__PURE__*/ new WeakMap();
1459
+ /**
1460
+ * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
1461
+ *
1462
+ * @param ref the runtime ref of interest
1463
+ * @returns the Host reference (if found) or undefined
1464
+ */
1385
1465
  const getHostRef = (ref) => hostRefs.get(ref);
1466
+ /**
1467
+ * Register a lazy instance with the {@link hostRefs} object so it's
1468
+ * corresponding {@link d.HostRef} can be retrieved later.
1469
+ *
1470
+ * @param lazyInstance the lazy instance of interest
1471
+ * @param hostRef that instances `HostRef` object
1472
+ * @returns a reference to the host ref WeakMap
1473
+ */
1386
1474
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1387
- const registerHost = (elm, cmpMeta) => {
1475
+ /**
1476
+ * Register a host element for a Stencil component, setting up various metadata
1477
+ * and callbacks based on {@link BUILD} flags as well as the component's runtime
1478
+ * metadata.
1479
+ *
1480
+ * @param hostElement the host element to register
1481
+ * @param cmpMeta runtime metadata for that component
1482
+ * @returns a reference to the host ref WeakMap
1483
+ */
1484
+ const registerHost = (hostElement, cmpMeta) => {
1388
1485
  const hostRef = {
1389
1486
  $flags$: 0,
1390
- $hostElement$: elm,
1487
+ $hostElement$: hostElement,
1391
1488
  $cmpMeta$: cmpMeta,
1392
1489
  $instanceValues$: new Map(),
1393
1490
  };
1394
1491
  {
1395
1492
  hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
1396
- elm['s-p'] = [];
1397
- elm['s-rc'] = [];
1493
+ hostElement['s-p'] = [];
1494
+ hostElement['s-rc'] = [];
1398
1495
  }
1399
- return hostRefs.set(elm, hostRef);
1496
+ return hostRefs.set(hostElement, hostRef);
1400
1497
  };
1401
1498
  const isMemberInElement = (elm, memberName) => memberName in elm;
1402
1499
  const consoleError = (e, el) => (0, console.error)(e, el);
@@ -1517,9 +1614,9 @@ const flush = () => {
1517
1614
  }
1518
1615
  }
1519
1616
  };
1520
- const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1617
+ const nextTick = (cb) => promiseResolve().then(cb);
1521
1618
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1522
1619
 
1523
1620
  export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };
1524
1621
 
1525
- //# sourceMappingURL=index-c2d82fd1.js.map
1622
+ //# sourceMappingURL=index-a0c70ca0.js.map