skeleton-webcomponent-loader 2.1.1 → 3.0.0

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.
Files changed (58) hide show
  1. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  2. package/dist/cjs/index-BKUCi6S8.js +1522 -0
  3. package/dist/cjs/loader.cjs.js +7 -29
  4. package/dist/cjs/nb-skeleton.cjs.entry.js +168 -114
  5. package/dist/cjs/skeleton-webcomponent.cjs.js +17 -15
  6. package/dist/collection/collection-manifest.json +4 -3
  7. package/dist/collection/components/skeleton/skeleton.js +460 -304
  8. package/dist/{custom-elements → components}/index.d.ts +13 -23
  9. package/dist/components/index.js +1 -0
  10. package/dist/components/nb-skeleton.d.ts +11 -0
  11. package/dist/components/nb-skeleton.js +1 -0
  12. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  13. package/dist/esm/index-D_NQrSVN.js +1515 -0
  14. package/dist/esm/loader.js +7 -27
  15. package/dist/esm/nb-skeleton.entry.js +168 -112
  16. package/dist/esm/skeleton-webcomponent.js +15 -15
  17. package/dist/esm-es5/app-globals-DQuL1Twl.js +1 -0
  18. package/dist/esm-es5/index-D_NQrSVN.js +2 -0
  19. package/dist/esm-es5/loader.js +1 -1
  20. package/dist/esm-es5/nb-skeleton.entry.js +1 -1
  21. package/dist/esm-es5/skeleton-webcomponent.js +1 -1
  22. package/dist/skeleton-webcomponent/p-0ab2f3bc.system.entry.js +1 -0
  23. package/dist/skeleton-webcomponent/p-BbPAtVJG.system.js +1 -0
  24. package/dist/skeleton-webcomponent/p-CEkATbjM.system.js +2 -0
  25. package/dist/skeleton-webcomponent/p-DQuL1Twl.js +1 -0
  26. package/dist/skeleton-webcomponent/p-D_NQrSVN.js +2 -0
  27. package/dist/skeleton-webcomponent/p-DikQ2aXB.system.js +1 -0
  28. package/dist/skeleton-webcomponent/p-e5fc5295.entry.js +1 -0
  29. package/dist/skeleton-webcomponent/skeleton-webcomponent.esm.js +1 -1
  30. package/dist/skeleton-webcomponent/skeleton-webcomponent.js +14 -19
  31. package/dist/types/components/skeleton/skeleton.d.ts +101 -67
  32. package/dist/types/components.d.ts +75 -2
  33. package/dist/types/stencil-public-runtime.d.ts +335 -40
  34. package/loader/cdn.js +1 -2
  35. package/loader/index.cjs.js +1 -2
  36. package/loader/index.d.ts +13 -1
  37. package/loader/index.es2017.js +1 -2
  38. package/loader/index.js +1 -2
  39. package/package.json +5 -6
  40. package/readme.md +0 -1
  41. package/CHANGELOG.md +0 -26
  42. package/dist/cjs/css-shim-b3e497ca.js +0 -6
  43. package/dist/cjs/index-b5d2dca0.js +0 -1156
  44. package/dist/custom-elements/index.js +0 -142
  45. package/dist/esm/css-shim-2f04a37a.js +0 -4
  46. package/dist/esm/index-63fd3905.js +0 -1128
  47. package/dist/esm/polyfills/css-shim.js +0 -1
  48. package/dist/esm-es5/css-shim-2f04a37a.js +0 -1
  49. package/dist/esm-es5/index-63fd3905.js +0 -1
  50. package/dist/skeleton-webcomponent/p-12077897.js +0 -1
  51. package/dist/skeleton-webcomponent/p-16aec442.system.js +0 -1
  52. package/dist/skeleton-webcomponent/p-63ed3b45.entry.js +0 -1
  53. package/dist/skeleton-webcomponent/p-7e96e5d4.js +0 -1
  54. package/dist/skeleton-webcomponent/p-8bef7229.system.js +0 -1
  55. package/dist/skeleton-webcomponent/p-dc1bf577.system.entry.js +0 -1
  56. package/dist/skeleton-webcomponent/p-f59432d4.system.js +0 -1
  57. package/loader/package.json +0 -10
  58. /package/dist/skeleton-webcomponent/{p-50ea2036.system.js → p-YWpyar7R.system.js} +0 -0
@@ -1,24 +1,8 @@
1
- /* SkeletonWebcomponent custom elements bundle */
2
-
3
- import type { Components, JSX } from "../types/components";
4
-
5
- interface NbSkeleton extends Components.NbSkeleton, HTMLElement {}
6
- export const NbSkeleton: {
7
- prototype: NbSkeleton;
8
- new (): NbSkeleton;
9
- };
10
-
11
1
  /**
12
- * Utility to define all custom elements within this package using the tag name provided in the component's source.
13
- * When defining each custom element, it will also check it's safe to define by:
14
- *
15
- * 1. Ensuring the "customElements" registry is available in the global context (window).
16
- * 2. The component tag name is not already defined.
17
- *
18
- * Use the standard [customElements.define()](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define)
19
- * method instead to define custom elements individually, or to provide a different tag name.
2
+ * Get the base path to where the assets can be found. Use "setAssetPath(path)"
3
+ * if the path needs to be customized.
20
4
  */
21
- export declare const defineCustomElements: (opts?: any) => void;
5
+ export declare const getAssetPath: (path: string) => string;
22
6
 
23
7
  /**
24
8
  * Used to manually set the base path where assets can be found.
@@ -27,19 +11,25 @@ export declare const defineCustomElements: (opts?: any) => void;
27
11
  * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
28
12
  * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
29
13
  * But do note that this configuration depends on how your script is bundled, or lack of
30
- * bunding, and where your assets can be loaded from. Additionally custom bundling
14
+ * bundling, and where your assets can be loaded from. Additionally custom bundling
31
15
  * will have to ensure the static assets are copied to its build directory.
32
16
  */
33
17
  export declare const setAssetPath: (path: string) => void;
34
18
 
19
+ /**
20
+ * Used to specify a nonce value that corresponds with an application's CSP.
21
+ * When set, the nonce will be added to all dynamically created script and style tags at runtime.
22
+ * Alternatively, the nonce value can be set on a meta tag in the DOM head
23
+ * (<meta name="csp-nonce" content="{ nonce value here }" />) which
24
+ * will result in the same behavior.
25
+ */
26
+ export declare const setNonce: (nonce: string) => void
27
+
35
28
  export interface SetPlatformOptions {
36
29
  raf?: (c: FrameRequestCallback) => number;
37
30
  ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
38
31
  rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
39
- ce?: (eventName: string, opts?: any) => CustomEvent;
40
32
  }
41
33
  export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
42
34
 
43
- export type { Components, JSX };
44
-
45
35
  export * from '../types';
@@ -0,0 +1 @@
1
+ export{getAssetPath,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface NbSkeleton extends Components.NbSkeleton, HTMLElement {}
4
+ export const NbSkeleton: {
5
+ prototype: NbSkeleton;
6
+ new (): NbSkeleton;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1 @@
1
+ import{proxyCustomElement as e,HTMLElement as t,h as s,Host as i,transformTag as r}from"@stencil/core/internal/client";const o=["progress","progress-dark","pulse","false"],n=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.count=1,this.label="Loading...",this.as="div",this.asChild=!1,this.variant="text",this.width=null,this.height=null,this.marginBottom=null,this.animation="progress",this.customStyles={},this.showWarnings=!0,this.items=[],this.parsedCustomStyles={}}componentWillLoad(){this.init()}componentWillUpdate(){this.init()}init(){if(this.items.length=this.count,this.items.fill(1),this.parsedCustomStyles={},o.includes(this.animation)||(this.showWarnings&&console.warn(`\`Skeleton\` need to receive 'animation' as: ${o.join(", ")}. Forcing default to "progress".`),this.animation="progress"),this.customStyles&&"string"==typeof this.customStyles)try{const e=JSON.parse(this.customStyles);e&&"object"==typeof e&&(this.parsedCustomStyles=e)}catch(e){this.showWarnings&&console.warn("can't parse styles",this.customStyles)}else this.customStyles&&"object"==typeof this.customStyles&&(this.parsedCustomStyles=this.customStyles)}get style(){let e={width:null,height:null,marginBottom:null};this.width&&(e.width=this.width),this.height&&(e.height=this.height),this.marginBottom&&(e.marginBottom=this.marginBottom);const t=this.parsedCustomStyles;return Object.assign(Object.assign({},e),t)}resolveWrapperTag(){const e=(this.as||"").trim().toLowerCase();return/^[a-z][a-z0-9-]*$/.test(e)?e:(this.showWarnings&&console.warn('`Skeleton` `as` prop must be a valid html tag name. Falling back to "div".'),"div")}get ariaProps(){return{"aria-busy":"true","aria-label":this.label,"aria-valuemin":"0","aria-valuemax":"100","aria-valuetext":this.label,role:"progressbar"}}renderRows(){return this.items.map(((e,t)=>s("span",{key:t,class:{circle:"circle"===this.variant,rect:"rect"===this.variant,progress:"progress"===this.animation,"progress-dark":"progress-dark"===this.animation,pulse:"pulse"===this.animation,skeleton:!0},"aria-hidden":"true",style:this.style})))}render(){if(this.asChild)return s(i,Object.assign({},this.ariaProps),this.renderRows());const e=this.resolveWrapperTag();return s(i,null,s(e,Object.assign({},this.ariaProps),this.renderRows()))}static get style(){return".skeleton{-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;overflow:hidden;position:relative;background:var(--skeleton-background, #eff1f6) no-repeat;border-radius:var(--skeleton-border-radius, 4px);width:var(--skeleton-width, 100%);height:var(--skeleton-height, 20px);display:inline-block;margin-bottom:var(--skeleton-margin-bottom, 10px);will-change:transform}.skeleton:after,.skeleton:before{-webkit-box-sizing:border-box;box-sizing:border-box}.skeleton.circle{width:var(--skeleton-width, 40px);height:var(--skeleton-height, 40px);margin-bottom:var(--skeleton-margin-bottom, 5px);border-radius:var(--skeleton-border-radius, 50%)}.skeleton.rect{border-radius:var(--skeleton-border-radius, 0px)}.skeleton.progress,.skeleton.progress-dark{-webkit-animation:progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;animation:progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;background-size:200px 100%}.skeleton.progress{background-image:-webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), color-stop(rgba(255, 255, 255, 0.6)), to(rgba(255, 255, 255, 0)));background-image:linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0))}.skeleton.progress-dark{background-image:-webkit-gradient(linear, left top, right top, from(transparent), color-stop(rgba(0, 0, 0, 0.2)), to(transparent));background-image:linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2), transparent)}.skeleton.pulse{-webkit-animation:pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;animation:pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;-webkit-animation-delay:0.5s;animation-delay:0.5s}@media (prefers-reduced-motion: reduce){.skeleton.pulse,.skeleton.progress-dark,.skeleton.progress{-webkit-animation:none;animation:none}.skeleton.progress,.skeleton.progress-dark{background-image:none}}@-webkit-keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@-webkit-keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}"}},[1,"nb-skeleton",{count:[2],label:[1],as:[1],asChild:[4,"as-child"],variant:[1],width:[1],height:[1],marginBottom:[1,"margin-bottom"],animation:[1],customStyles:[1,"custom-styles"],showWarnings:[4,"show-warnings"]}]),a=n,l=function(){"undefined"!=typeof customElements&&["nb-skeleton"].forEach((e=>{"nb-skeleton"===e&&(customElements.get(r(e))||customElements.define(r(e),n))}))};export{a as NbSkeleton,l as defineCustomElement}
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };