@pine-ds/icons 7.4.2-dev.2 → 7.4.2-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/pds-icon.js +2 -3
- package/components/pds-icon.js.map +1 -1
- package/dist/cheatsheet.html +3 -3
- package/dist/cjs/{index-7f71a223.js → index-4513af51.js} +163 -127
- package/dist/cjs/index-4513af51.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pds-icon.cjs.entry.js +4 -5
- package/dist/cjs/pds-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-icons.cjs.js +2 -2
- package/dist/cjs/pds-icons.cjs.js.map +1 -1
- package/dist/cjs/{utils-89306ddd.js → utils-4a964891.js} +2 -2
- package/dist/cjs/{utils-89306ddd.js.map → utils-4a964891.js.map} +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/pds-icon/pds-icon.js +2 -3
- package/dist/collection/components/pds-icon/pds-icon.js.map +1 -1
- package/dist/docs.json +3 -3
- package/dist/esm/{index-c769669c.js → index-6000a95d.js} +163 -127
- package/dist/esm/index-6000a95d.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/pds-icon.entry.js +4 -5
- package/dist/esm/pds-icon.entry.js.map +1 -1
- package/dist/esm/pds-icons.js +3 -3
- package/dist/esm/pds-icons.js.map +1 -1
- package/dist/esm/{utils-cae6cf8b.js → utils-40080bc9.js} +2 -2
- package/dist/esm/{utils-cae6cf8b.js.map → utils-40080bc9.js.map} +1 -1
- package/dist/loader/index.d.ts +3 -0
- package/dist/pds-icons/index.esm.js +1 -1
- package/dist/pds-icons/{p-72a65a5e.js → p-39904cba.js} +2 -2
- package/dist/pds-icons/p-aa154542.js +3 -0
- package/dist/pds-icons/p-aa154542.js.map +1 -0
- package/dist/pds-icons/p-daeec840.entry.js +2 -0
- package/dist/pds-icons/p-daeec840.entry.js.map +1 -0
- package/dist/pds-icons/pds-icons.esm.js +1 -1
- package/dist/pds-icons/pds-icons.esm.js.map +1 -1
- package/dist/pds-icons.json +1 -1
- package/dist/pds-icons.symbols.svg +1 -1
- package/dist/types/stencil-public-runtime.d.ts +0 -2
- package/icons/index.d.ts +1 -1
- package/icons/index.js +1 -1
- package/icons/index.mjs +1 -1
- package/icons/package.json +1 -1
- package/package.json +2 -2
- package/dist/cjs/index-7f71a223.js.map +0 -1
- package/dist/collection/components/pds-icon/test/pds-icon.e2e.js +0 -10
- package/dist/collection/components/pds-icon/test/pds-icon.e2e.js.map +0 -1
- package/dist/collection/components/pds-icon/test/pds-icon.spec.js +0 -108
- package/dist/collection/components/pds-icon/test/pds-icon.spec.js.map +0 -1
- package/dist/esm/index-c769669c.js.map +0 -1
- package/dist/pds-icons/p-7b1f3985.entry.js +0 -2
- package/dist/pds-icons/p-7b1f3985.entry.js.map +0 -1
- package/dist/pds-icons/p-964f6f9a.js +0 -3
- package/dist/pds-icons/p-964f6f9a.js.map +0 -1
- /package/dist/pds-icons/{p-72a65a5e.js.map → p-39904cba.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"utils-
|
|
1
|
+
{"file":"utils-4a964891.js","mappings":";;;;AAEA,IAAI,uBAAuB,GAAG,KAAK,CAAC;AAQpC;;;;;;;;;AASO,MAAM,YAAY,GAAG,CAAC,IAAY;;IACvC,MAAM,iBAAiB,GAAG,MAAA,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAkB,4BAA4B,CAAC,0CAAE,OAAO,CAAC,aAAa,CAAC;;IAG5H,MAAM,eAAe,GAAG,MAAM,CAAC,mBAAmB,CAAC;;IAGnD,MAAM,YAAY,GAAG,6DAA6D,CAAC;IAEnF,MAAM,aAAa,GAA0C,iBAAiB,IAAI,eAAe,IAAI,YAAY,IAAI,GAAG,CAAA;;IAGxH,IAAK,aAAa,CAAC,UAAU,CAAC,+BAA+B,CAAC,IAAI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AED,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE3B,IAAG,GAAG,EAAE;YACN,OAAO,GAAG,CAAC;SACZ;KACF;IAED,OAAO,IAAI,CAAC;AACd,EAAE;AAGK,MAAM,KAAK,GAAG,CAAC,GAAW,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;MAC/D,KAAK,GAAG,CAAC,GAAQ,KAAoB,OAAO,GAAG,KAAK,SAAS;AACnE,MAAM,OAAO,GAAG,CAAC,GAAW,KAAK,GAAG,CAAC,WAAW,EAAE,CAAC;AAE1D;;;;;;;;;;MAUc,iBAAiB,GAAG,CAAC,EAAe,EAAE,aAAuB,EAAE;IAC3E,MAAM,eAAe,GAAyB,EAAE,CAAC;IAEjD,UAAU,CAAC,OAAO,CAAC,IAAI;QACrB,IAAI,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;YACzB,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACpC,IAAI,KAAK,KAAK,IAAI,EAAE;gBAClB,eAAe,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;aAC/C;YACD,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;SAC1B;KACF,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC;AACzB;;;;;;;;","names":[],"sources":["src/components/pds-icon/assetPath.ts","src/components/pds-icon/utils.ts"],"sourcesContent":["import { Build } from '@stencil/core';\n\nlet missingAssetPathWarning = false;\n\ndeclare global {\n interface Window {\n __PINE_ASSET_PATH__?: string\n }\n}\n\n/**\n *\n * Reads the component asset path config from meta tag or a global variable.\n * This is a temporary workaround until these issues have been addressed:\n *\n * https://github.com/ionic-team/stencil/issues/2826/\n * https://github.com/ionic-team/stencil/issues/3470\n * https://github.com/ionic-team/stencil-ds-output-targets/issues/186\n */\nexport const getAssetPath = (path: string) => {\n const metaPineAssetPath = document.head.querySelector<HTMLMetaElement>('meta[data-pine-asset-path]')?.dataset.pineAssetPath;\n\n // Get the asset path from the window object if available\n const windowAssetPath = window.__PINE_ASSET_PATH__;\n\n // Set the CDN Asset path using the latest version\n const cdnAssetPath = 'https://cdn.jsdelivr.net/npm/@pine-ds/icons/dist/pds-icons/';\n\n const assetBasePath = Build.isTesting ? '/dist/pds-icons' : metaPineAssetPath || windowAssetPath || cdnAssetPath || '/'\n\n // Display a warning if the assets are fetched from the CDN.\n if ( assetBasePath.startsWith('https://cdn.jsdelivr.net/npm/') && !missingAssetPathWarning ) {\n missingAssetPathWarning = true;\n console.warn(`\n Fetching Pine asssets from jsDelivr CDN.\\n\\n It's recommended that you bundle Pine Assets with your application and setting the path accordingly.\\n\\nFor more information you read the documentation: \\nhttps://pine-design-system.netlify.app/?path=/docs/resources-assets--docs\n `)\n }\n\n let assetPath = path;\n\n if ( path.startsWith ('./') ) {\n assetPath = path.substring(2);\n }\n\n if ( !assetBasePath.endsWith('/') ) {\n assetPath = '/' + assetPath;\n }\n\n return assetBasePath + assetPath;\n}\n\n\nexport {};\n","import { getAssetPath } from './assetPath';\n\nimport { PdsIcon } from './pds-icon';\n\nlet CACHED_MAP: Map<string, string>;\n\nexport const addIcons = (icons: { [name: string]: string; }) => {\n const map = getIconMap();\n Object.keys(icons).forEach(name => map.set(name, icons[name]));\n}\n\nexport const getIconMap = (): Map<string, string> => {\n if (typeof window === 'undefined') {\n return new Map();\n } else {\n if (!CACHED_MAP) {\n const win = window as any; // eslint-disable-line @typescript-eslint/no-explicit-any\n win.PdsIcons = win.PdsIcons || {};\n CACHED_MAP = win.PdsIcons.map = win.PdsIcons.map || new Map();\n }\n\n return CACHED_MAP;\n }\n}\n\nexport const getName = (\n iconName: string | undefined,\n icon: string | undefined\n ) => {\n\n if(!iconName && icon && !isSrc(icon)) {\n iconName = icon;\n }\n\n if (isStr(iconName)) {\n iconName = toLower(iconName);\n }\n\n if (!isStr(iconName) || iconName.trim() === '') {\n return null;\n }\n\n const invalidChars = iconName.replace(/[a-z]|-|\\d/gi,'');\n if (invalidChars != '') { return null; }\n\n return iconName;\n}\n\nconst getNamedUrl = (iconName: string) => {\n const url = getIconMap().get(iconName);\n if (url) {\n return url;\n }\n\n return getAssetPath(`svg/${iconName}.svg`);\n};\n\nexport const getSrc = (src: string | undefined) => {\n if (isStr(src)) {\n src = src.trim();\n\n if (isSrc(src)) {\n return src;\n }\n }\n\n return null;\n}\n\nexport const getUrl = (pdsIcon: PdsIcon) => {\n let url = getSrc(pdsIcon.src);\n if (url) {\n return url;\n }\n\n url = getName(pdsIcon.name, pdsIcon.icon);\n if (url) {\n return getNamedUrl(url);\n }\n\n if (pdsIcon.icon) {\n url = getSrc(pdsIcon.icon);\n\n if(url) {\n return url;\n }\n }\n\n return null;\n};\n\n\nexport const isSrc = (str: string) => str.length > 0 && /(\\/|\\.)/.test(str);\nexport const isStr = (val: any): val is string => typeof val === 'string'; // eslint-disable-line @typescript-eslint/no-explicit-any\nexport const toLower = (val: string) => val.toLowerCase();\n\n/**\n * Elements inside of web components sometimes need to inherit global attributes\n * set on the host. For example, the inner input in `ion-input` should inherit\n * the `title` attribute that developers set directly on `ion-input`. This\n * helper function should be called in componentWillLoad and assigned to a variable\n * that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\n export const inheritAttributes = (el: HTMLElement, attributes: string[] = []) => {\n const attributeObject: { [k: string]: any } = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n attributes.forEach(attr => {\n if (el.hasAttribute(attr)) {\n const value = el.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = el.getAttribute(attr);\n }\n el.removeAttribute(attr);\n }\n });\n\n return attributeObject;\n}\n"],"version":3}
|
|
@@ -42,8 +42,7 @@ export class PdsIcon {
|
|
|
42
42
|
setCSSVariables() {
|
|
43
43
|
this.el.style.setProperty(`--dimension-icon-height`, this.iconSize());
|
|
44
44
|
this.el.style.setProperty(`--dimension-icon-width`, this.iconSize());
|
|
45
|
-
|
|
46
|
-
this.el.style.setProperty(`--color-icon-fill`, this.color === undefined ? 'currentColor' : this.color);
|
|
45
|
+
this.el.style.setProperty(`--color-icon-fill`, typeof this.color !== 'undefined' ? this.color : 'currentColor');
|
|
47
46
|
}
|
|
48
47
|
connectedCallback() {
|
|
49
48
|
this.waitUntilVisible(this.el, '50px', () => {
|
|
@@ -79,7 +78,7 @@ export class PdsIcon {
|
|
|
79
78
|
}
|
|
80
79
|
render() {
|
|
81
80
|
const { ariaLabel, inheritedAttributes } = this;
|
|
82
|
-
return (h(Host, Object.assign({ key: '
|
|
81
|
+
return (h(Host, Object.assign({ key: '4bbc232e2530d43e8b5afefb754486d94ea6538b', "aria-label": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, alt: "", role: "img", class: Object.assign({}, createColorClasses(this.color)) }, inheritedAttributes), Build.isBrowser && this.svgContent ? (h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (h("div", { class: "icon-inner" }))));
|
|
83
82
|
}
|
|
84
83
|
/*****
|
|
85
84
|
* Private Methods
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-icon.js","sourceRoot":"","sources":["../../../src/components/pds-icon/pds-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAQ7D,MAAM,OAAO,OAAO;;QAEV,wBAAmB,GAAyB,EAAE,CAAC,CAAC,yDAAyD;
|
|
1
|
+
{"version":3,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C,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC;oBAC3B,EAAE,CAAC,UAAU,EAAE,CAAC;oBAChB,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC;oBACpB,EAAE,EAAE,CAAC;gBACP,CAAC;YACH,CAAC,EACD,EAAE,UAAU,EAAE,CACf,CAAC,CAAC;YAEH,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,+CAA+C;YAC/C,qCAAqC;YACrC,EAAE,EAAE,CAAC;QACP,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOF;AAED,MAAM,kBAAkB,GAAG,CAAC,KAAyB,EAAE,EAAE;IACvD,OAAO,KAAK;QACX,CAAC,CAAC;YACE,WAAW,EAAE,IAAI;YACjB,CAAC,aAAa,KAAK,EAAE,CAAC,EAAE,IAAI;SAC7B;QACH,CAAC,CAAC,IAAI,CAAC;AACT,CAAC,CAAC","sourcesContent":["import { Build, Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { getSvgContent, pdsIconContent } from './request';\nimport { getName, getUrl, inheritAttributes } from './utils';\n\n@Component({\n tag: 'pds-icon',\n assetsDirs: ['svg'],\n styleUrl: 'pds-icon.scss',\n shadow: true,\n})\nexport class PdsIcon {\n private io?: IntersectionObserver;\n private inheritedAttributes: { [k: string]: any } = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n @Element() el!: HTMLPdsIconElement;\n\n @State() private ariaLabel?: string;\n @State() private isVisible = false;\n @State() private svgContent?: string;\n\n /**\n *\n * The color of the icon\n *\n */\n @Prop() color?: string;\n\n /**\n * This a combination of both `name` and `src`. If a `src` url is detected\n * it will set the `src` property. Otherwise it assumes it's a built-in named\n * SVG and set the `name` property.\n */\n @Prop() icon?: any;\n\n /**\n * The name of the icon to use from\n * the built-in set.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * The size of the icon. This can be\n * 'small', 'regular', 'medium', large, or a\n * custom value (40px, 1rem, etc)\n *\n */\n @Prop({ reflect: true }) size?:\n | 'small' // 12px\n | 'regular' // 16px\n | 'medium' // 20px\n | 'large' // 24px\n | 'auto'\n | string = 'regular'\n\n /**\n *\n * Specifies the exact `src` of an SVG file to use.\n */\n @Prop() src?: string;\n\n private iconSize() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sizes: { [key: string]: any } = {\n small: '12px',\n regular: '16px',\n medium: '20px',\n large: '24px',\n }\n\n if (sizes[this.size]) {\n return sizes[this.size];\n } else {\n return this.size;\n }\n }\n\n componentDidLoad() {\n this.setCSSVariables();\n }\n\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);\n this.setCSSVariables();\n }\n\n setCSSVariables() {\n this.el.style.setProperty(`--dimension-icon-height`, this.iconSize());\n this.el.style.setProperty(`--dimension-icon-width`, this.iconSize());\n this.el.style.setProperty(`--color-icon-fill`, typeof this.color !== 'undefined' ? this.color : 'currentColor');\n }\n\n connectedCallback() {\n this.waitUntilVisible(this.el, '50px', () => {\n this.isVisible = true;\n this.loadIcon();\n })\n }\n\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n\n @Watch('size')\n @Watch('color')\n updateStyles() {\n this.setCSSVariables();\n }\n\n @Watch('name')\n @Watch('src')\n @Watch('icon')\n loadIcon() {\n if (Build.isBrowser && this.isVisible) {\n const url = getUrl(this);\n if (url) {\n if (pdsIconContent.has(url)) {\n this.svgContent = pdsIconContent.get(url);\n } else {\n getSvgContent(url).then(() => (this.svgContent = pdsIconContent.get(url)));\n }\n }\n }\n\n const label = getName(this.name, this.icon);\n\n if (label) {\n this.ariaLabel = label.replace(/\\-/g, ' ');\n }\n }\n\n render() {\n const { ariaLabel, inheritedAttributes } = this;\n\n return (\n\n <Host\n aria-label={ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null }\n alt=\"\"\n role=\"img\"\n class={{\n ...createColorClasses(this.color),\n }}\n {...inheritedAttributes}\n >\n {Build.isBrowser && this.svgContent ? (\n <div class=\"icon-inner\" innerHTML={this.svgContent}></div>\n ) : (\n <div class=\"icon-inner\"></div>\n )}\n </Host>\n )\n }\n\n /*****\n * Private Methods\n ****/\n\n private waitUntilVisible(el: HTMLElement, rootMargin: string, cb: () => void) {\n if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {\n const io = (this.io = new (window).IntersectionObserver(\n (data: IntersectionObserverEntry[]) => {\n if (data[0].isIntersecting) {\n io.disconnect();\n this.io = undefined;\n cb();\n }\n },\n { rootMargin },\n ));\n\n io.observe(el);\n } else {\n // browser doesn't support IntersectionObserver\n // so just fallback to always show it\n cb();\n }\n }\n\n private hasAriaHidden = () => {\n const { el } = this;\n\n return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';\n }\n}\n\nconst createColorClasses = (color: string | undefined) => {\n return color\n ? {\n 'pds-color': true,\n [`pds-color-${color}`]: true,\n }\n : null;\n };\n"]}
|
package/dist/docs.json
CHANGED
|
@@ -2,13 +2,120 @@ const NAMESPACE = 'pds-icons';
|
|
|
2
2
|
const BUILD = /* pds-icons */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.20.0 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __export = (target, all) => {
|
|
9
9
|
for (var name in all)
|
|
10
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
11
|
};
|
|
12
|
+
var hostRefs = /* @__PURE__ */ new WeakMap();
|
|
13
|
+
var getHostRef = (ref) => hostRefs.get(ref);
|
|
14
|
+
var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
15
|
+
var registerHost = (hostElement, cmpMeta) => {
|
|
16
|
+
const hostRef = {
|
|
17
|
+
$flags$: 0,
|
|
18
|
+
$hostElement$: hostElement,
|
|
19
|
+
$cmpMeta$: cmpMeta,
|
|
20
|
+
$instanceValues$: /* @__PURE__ */ new Map()
|
|
21
|
+
};
|
|
22
|
+
{
|
|
23
|
+
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
|
|
24
|
+
hostElement["s-p"] = [];
|
|
25
|
+
hostElement["s-rc"] = [];
|
|
26
|
+
}
|
|
27
|
+
return hostRefs.set(hostElement, hostRef);
|
|
28
|
+
};
|
|
29
|
+
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
30
|
+
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
31
|
+
|
|
32
|
+
// src/client/client-load-module.ts
|
|
33
|
+
var cmpModules = /* @__PURE__ */ new Map();
|
|
34
|
+
var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
35
|
+
const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
|
|
36
|
+
const bundleId = cmpMeta.$lazyBundleId$;
|
|
37
|
+
if (!bundleId) {
|
|
38
|
+
return void 0;
|
|
39
|
+
}
|
|
40
|
+
const module = cmpModules.get(bundleId) ;
|
|
41
|
+
if (module) {
|
|
42
|
+
return module[exportName];
|
|
43
|
+
}
|
|
44
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
45
|
+
return import(
|
|
46
|
+
/* @vite-ignore */
|
|
47
|
+
/* webpackInclude: /\.entry\.js$/ */
|
|
48
|
+
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
49
|
+
/* webpackMode: "lazy" */
|
|
50
|
+
`./${bundleId}.entry.js${""}`
|
|
51
|
+
).then((importedModule) => {
|
|
52
|
+
{
|
|
53
|
+
cmpModules.set(bundleId, importedModule);
|
|
54
|
+
}
|
|
55
|
+
return importedModule[exportName];
|
|
56
|
+
}, consoleError);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// src/client/client-style.ts
|
|
60
|
+
var styles = /* @__PURE__ */ new Map();
|
|
61
|
+
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
62
|
+
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
63
|
+
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
64
|
+
var win = typeof window !== "undefined" ? window : {};
|
|
65
|
+
var doc = win.document || { head: {} };
|
|
66
|
+
var plt = {
|
|
67
|
+
$flags$: 0,
|
|
68
|
+
$resourcesUrl$: "",
|
|
69
|
+
jmp: (h2) => h2(),
|
|
70
|
+
raf: (h2) => requestAnimationFrame(h2),
|
|
71
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
72
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
73
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
74
|
+
};
|
|
75
|
+
var promiseResolve = (v) => Promise.resolve(v);
|
|
76
|
+
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
77
|
+
try {
|
|
78
|
+
new CSSStyleSheet();
|
|
79
|
+
return typeof new CSSStyleSheet().replaceSync === "function";
|
|
80
|
+
} catch (e) {
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
})() ;
|
|
84
|
+
var queuePending = false;
|
|
85
|
+
var queueDomReads = [];
|
|
86
|
+
var queueDomWrites = [];
|
|
87
|
+
var queueTask = (queue, write) => (cb) => {
|
|
88
|
+
queue.push(cb);
|
|
89
|
+
if (!queuePending) {
|
|
90
|
+
queuePending = true;
|
|
91
|
+
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
92
|
+
nextTick(flush);
|
|
93
|
+
} else {
|
|
94
|
+
plt.raf(flush);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
var consume = (queue) => {
|
|
99
|
+
for (let i2 = 0; i2 < queue.length; i2++) {
|
|
100
|
+
try {
|
|
101
|
+
queue[i2](performance.now());
|
|
102
|
+
} catch (e) {
|
|
103
|
+
consoleError(e);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
queue.length = 0;
|
|
107
|
+
};
|
|
108
|
+
var flush = () => {
|
|
109
|
+
consume(queueDomReads);
|
|
110
|
+
{
|
|
111
|
+
consume(queueDomWrites);
|
|
112
|
+
if (queuePending = queueDomReads.length > 0) {
|
|
113
|
+
plt.raf(flush);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
var nextTick = (cb) => promiseResolve().then(cb);
|
|
118
|
+
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
12
119
|
|
|
13
120
|
// src/utils/constants.ts
|
|
14
121
|
var EMPTY_OBJ = {};
|
|
@@ -88,9 +195,6 @@ var uniqueTime = (key, measureText) => {
|
|
|
88
195
|
};
|
|
89
196
|
}
|
|
90
197
|
};
|
|
91
|
-
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
92
|
-
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
93
|
-
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
94
198
|
var h = (nodeName, vnodeData, ...children) => {
|
|
95
199
|
let child = null;
|
|
96
200
|
let key = null;
|
|
@@ -206,7 +310,18 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
206
310
|
if (nonce != null) {
|
|
207
311
|
styleElm.setAttribute("nonce", nonce);
|
|
208
312
|
}
|
|
209
|
-
|
|
313
|
+
const injectStyle = (
|
|
314
|
+
/**
|
|
315
|
+
* we render a scoped component
|
|
316
|
+
*/
|
|
317
|
+
!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) || /**
|
|
318
|
+
* we are using shadow dom and render the style tag within the shadowRoot
|
|
319
|
+
*/
|
|
320
|
+
cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD"
|
|
321
|
+
);
|
|
322
|
+
if (injectStyle) {
|
|
323
|
+
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
|
|
324
|
+
}
|
|
210
325
|
}
|
|
211
326
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
212
327
|
styleElm.innerHTML += SLOT_FB_CSS;
|
|
@@ -229,7 +344,7 @@ var attachStyles = (hostRef) => {
|
|
|
229
344
|
const scopeId2 = addStyle(
|
|
230
345
|
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
231
346
|
cmpMeta);
|
|
232
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
347
|
+
if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
233
348
|
elm["s-sc"] = scopeId2;
|
|
234
349
|
elm.classList.add(scopeId2 + "-h");
|
|
235
350
|
}
|
|
@@ -366,6 +481,7 @@ function sortedAttrNames(attrNames) {
|
|
|
366
481
|
// src/runtime/vdom/vdom-render.ts
|
|
367
482
|
var scopeId;
|
|
368
483
|
var hostTagName;
|
|
484
|
+
var useNativeShadowDom = false;
|
|
369
485
|
var isSvgMode = false;
|
|
370
486
|
var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
371
487
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
@@ -376,12 +492,14 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
376
492
|
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
377
493
|
} else {
|
|
378
494
|
elm = newVNode2.$elm$ = doc.createElement(
|
|
379
|
-
newVNode2.$tag$
|
|
495
|
+
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
380
496
|
);
|
|
381
497
|
{
|
|
382
498
|
updateElement(null, newVNode2, isSvgMode);
|
|
383
499
|
}
|
|
384
|
-
|
|
500
|
+
const rootNode = elm.getRootNode();
|
|
501
|
+
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
502
|
+
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
385
503
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
386
504
|
}
|
|
387
505
|
if (newVNode2.$children$) {
|
|
@@ -535,7 +653,10 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
535
653
|
elm.textContent = "";
|
|
536
654
|
}
|
|
537
655
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
538
|
-
} else if (
|
|
656
|
+
} else if (
|
|
657
|
+
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
658
|
+
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
659
|
+
) {
|
|
539
660
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
540
661
|
}
|
|
541
662
|
} else if (oldVNode.$text$ !== text) {
|
|
@@ -578,6 +699,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
578
699
|
{
|
|
579
700
|
scopeId = hostElm["s-sc"];
|
|
580
701
|
}
|
|
702
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
581
703
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
582
704
|
};
|
|
583
705
|
|
|
@@ -617,7 +739,10 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
617
739
|
endSchedule();
|
|
618
740
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
619
741
|
};
|
|
620
|
-
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn)
|
|
742
|
+
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
|
|
743
|
+
console.error(err2);
|
|
744
|
+
fn();
|
|
745
|
+
}) : fn();
|
|
621
746
|
var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
|
|
622
747
|
var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
623
748
|
var _a;
|
|
@@ -766,13 +891,13 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
766
891
|
|
|
767
892
|
// src/runtime/proxy-component.ts
|
|
768
893
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
769
|
-
var _a;
|
|
894
|
+
var _a, _b;
|
|
770
895
|
const prototype = Cstr.prototype;
|
|
771
|
-
if (cmpMeta.$members$) {
|
|
772
|
-
if (Cstr.watchers) {
|
|
896
|
+
if (cmpMeta.$members$ || (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
897
|
+
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
773
898
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
774
899
|
}
|
|
775
|
-
const members = Object.entries(cmpMeta.$members$);
|
|
900
|
+
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
776
901
|
members.map(([memberName, [memberFlags]]) => {
|
|
777
902
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
778
903
|
Object.defineProperty(prototype, memberName, {
|
|
@@ -796,7 +921,8 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
796
921
|
if (this.hasOwnProperty(propName)) {
|
|
797
922
|
newValue = this[propName];
|
|
798
923
|
delete this[propName];
|
|
799
|
-
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" &&
|
|
924
|
+
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
925
|
+
this[propName] == newValue) {
|
|
800
926
|
return;
|
|
801
927
|
} else if (propName == null) {
|
|
802
928
|
const hostRef = getHostRef(this);
|
|
@@ -817,7 +943,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
817
943
|
};
|
|
818
944
|
Cstr.observedAttributes = Array.from(
|
|
819
945
|
/* @__PURE__ */ new Set([
|
|
820
|
-
...Object.keys((
|
|
946
|
+
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
|
|
821
947
|
...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
|
|
822
948
|
var _a2;
|
|
823
949
|
const attrName = m[1] || propName;
|
|
@@ -882,7 +1008,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
882
1008
|
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
883
1009
|
}
|
|
884
1010
|
if (Cstr && Cstr.style) {
|
|
885
|
-
let style
|
|
1011
|
+
let style;
|
|
1012
|
+
if (typeof Cstr.style === "string") {
|
|
1013
|
+
style = Cstr.style;
|
|
1014
|
+
}
|
|
886
1015
|
const scopeId2 = getScopeId(cmpMeta);
|
|
887
1016
|
if (!styles.has(scopeId2)) {
|
|
888
1017
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
@@ -1002,17 +1131,30 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1002
1131
|
// StencilLazyHost
|
|
1003
1132
|
constructor(self) {
|
|
1004
1133
|
super(self);
|
|
1134
|
+
this.hasRegisteredEventListeners = false;
|
|
1005
1135
|
self = this;
|
|
1006
1136
|
registerHost(self, cmpMeta);
|
|
1007
1137
|
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1008
1138
|
{
|
|
1009
|
-
{
|
|
1010
|
-
|
|
1139
|
+
if (!self.shadowRoot) {
|
|
1140
|
+
{
|
|
1141
|
+
self.attachShadow({ mode: "open" });
|
|
1142
|
+
}
|
|
1143
|
+
} else {
|
|
1144
|
+
if (self.shadowRoot.mode !== "open") {
|
|
1145
|
+
throw new Error(
|
|
1146
|
+
`Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${self.shadowRoot.mode} but Stencil only supports open shadow roots.`
|
|
1147
|
+
);
|
|
1148
|
+
}
|
|
1011
1149
|
}
|
|
1012
1150
|
}
|
|
1013
1151
|
}
|
|
1014
1152
|
}
|
|
1015
1153
|
connectedCallback() {
|
|
1154
|
+
getHostRef(this);
|
|
1155
|
+
if (!this.hasRegisteredEventListeners) {
|
|
1156
|
+
this.hasRegisteredEventListeners = true;
|
|
1157
|
+
}
|
|
1016
1158
|
if (appLoadFallback) {
|
|
1017
1159
|
clearTimeout(appLoadFallback);
|
|
1018
1160
|
appLoadFallback = null;
|
|
@@ -1045,7 +1187,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1045
1187
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
1046
1188
|
}
|
|
1047
1189
|
{
|
|
1048
|
-
dataStyles.textContent += cmpTags + HYDRATED_CSS;
|
|
1190
|
+
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
1049
1191
|
}
|
|
1050
1192
|
if (dataStyles.innerHTML.length) {
|
|
1051
1193
|
dataStyles.setAttribute("data-styles", "");
|
|
@@ -1070,112 +1212,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1070
1212
|
// src/runtime/nonce.ts
|
|
1071
1213
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1072
1214
|
|
|
1073
|
-
// src/client/client-host-ref.ts
|
|
1074
|
-
var hostRefs = /* @__PURE__ */ new WeakMap();
|
|
1075
|
-
var getHostRef = (ref) => hostRefs.get(ref);
|
|
1076
|
-
var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
1077
|
-
var registerHost = (hostElement, cmpMeta) => {
|
|
1078
|
-
const hostRef = {
|
|
1079
|
-
$flags$: 0,
|
|
1080
|
-
$hostElement$: hostElement,
|
|
1081
|
-
$cmpMeta$: cmpMeta,
|
|
1082
|
-
$instanceValues$: /* @__PURE__ */ new Map()
|
|
1083
|
-
};
|
|
1084
|
-
{
|
|
1085
|
-
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
|
|
1086
|
-
hostElement["s-p"] = [];
|
|
1087
|
-
hostElement["s-rc"] = [];
|
|
1088
|
-
}
|
|
1089
|
-
return hostRefs.set(hostElement, hostRef);
|
|
1090
|
-
};
|
|
1091
|
-
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
1092
|
-
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
1093
|
-
|
|
1094
|
-
// src/client/client-load-module.ts
|
|
1095
|
-
var cmpModules = /* @__PURE__ */ new Map();
|
|
1096
|
-
var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
1097
|
-
const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
|
|
1098
|
-
const bundleId = cmpMeta.$lazyBundleId$;
|
|
1099
|
-
if (!bundleId) {
|
|
1100
|
-
return void 0;
|
|
1101
|
-
}
|
|
1102
|
-
const module = cmpModules.get(bundleId) ;
|
|
1103
|
-
if (module) {
|
|
1104
|
-
return module[exportName];
|
|
1105
|
-
}
|
|
1106
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
1107
|
-
return import(
|
|
1108
|
-
/* @vite-ignore */
|
|
1109
|
-
/* webpackInclude: /\.entry\.js$/ */
|
|
1110
|
-
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
1111
|
-
/* webpackMode: "lazy" */
|
|
1112
|
-
`./${bundleId}.entry.js${""}`
|
|
1113
|
-
).then((importedModule) => {
|
|
1114
|
-
{
|
|
1115
|
-
cmpModules.set(bundleId, importedModule);
|
|
1116
|
-
}
|
|
1117
|
-
return importedModule[exportName];
|
|
1118
|
-
}, consoleError);
|
|
1119
|
-
};
|
|
1120
|
-
|
|
1121
|
-
// src/client/client-style.ts
|
|
1122
|
-
var styles = /* @__PURE__ */ new Map();
|
|
1123
|
-
var win = typeof window !== "undefined" ? window : {};
|
|
1124
|
-
var doc = win.document || { head: {} };
|
|
1125
|
-
var plt = {
|
|
1126
|
-
$flags$: 0,
|
|
1127
|
-
$resourcesUrl$: "",
|
|
1128
|
-
jmp: (h2) => h2(),
|
|
1129
|
-
raf: (h2) => requestAnimationFrame(h2),
|
|
1130
|
-
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
1131
|
-
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
1132
|
-
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
1133
|
-
};
|
|
1134
|
-
var promiseResolve = (v) => Promise.resolve(v);
|
|
1135
|
-
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
1136
|
-
try {
|
|
1137
|
-
new CSSStyleSheet();
|
|
1138
|
-
return typeof new CSSStyleSheet().replaceSync === "function";
|
|
1139
|
-
} catch (e) {
|
|
1140
|
-
}
|
|
1141
|
-
return false;
|
|
1142
|
-
})() ;
|
|
1143
|
-
var queuePending = false;
|
|
1144
|
-
var queueDomReads = [];
|
|
1145
|
-
var queueDomWrites = [];
|
|
1146
|
-
var queueTask = (queue, write) => (cb) => {
|
|
1147
|
-
queue.push(cb);
|
|
1148
|
-
if (!queuePending) {
|
|
1149
|
-
queuePending = true;
|
|
1150
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
1151
|
-
nextTick(flush);
|
|
1152
|
-
} else {
|
|
1153
|
-
plt.raf(flush);
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
};
|
|
1157
|
-
var consume = (queue) => {
|
|
1158
|
-
for (let i2 = 0; i2 < queue.length; i2++) {
|
|
1159
|
-
try {
|
|
1160
|
-
queue[i2](performance.now());
|
|
1161
|
-
} catch (e) {
|
|
1162
|
-
consoleError(e);
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
queue.length = 0;
|
|
1166
|
-
};
|
|
1167
|
-
var flush = () => {
|
|
1168
|
-
consume(queueDomReads);
|
|
1169
|
-
{
|
|
1170
|
-
consume(queueDomWrites);
|
|
1171
|
-
if (queuePending = queueDomReads.length > 0) {
|
|
1172
|
-
plt.raf(flush);
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
1175
|
-
};
|
|
1176
|
-
var nextTick = (cb) => promiseResolve().then(cb);
|
|
1177
|
-
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
1178
|
-
|
|
1179
1215
|
export { Host as H, bootstrapLazy as b, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
1180
1216
|
|
|
1181
|
-
//# sourceMappingURL=index-
|
|
1217
|
+
//# sourceMappingURL=index-6000a95d.js.map
|