weg-shared-layout 0.0.6 → 0.0.9
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/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/index-CmiaQ_Dj.js +1612 -0
- package/dist/{weg-shared-layout/utils-DhW431pq.js → cjs/index.cjs.js} +3 -4
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/my-component.cjs.entry.js +33 -0
- package/dist/cjs/weg-footer.cjs.entry.js +169 -0
- package/dist/cjs/weg-shared-layout.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +14 -0
- package/dist/collection/components/my-component/my-component.cmp.test.js +27 -0
- package/dist/collection/components/my-component/my-component.css +3 -0
- package/dist/collection/components/my-component/my-component.js +95 -0
- package/dist/collection/components/weg-footer/icons/instagram.svg +5 -0
- package/dist/collection/components/weg-footer/icons/linkedin.svg +3 -0
- package/dist/collection/components/weg-footer/icons/tiktok.svg +3 -0
- package/dist/collection/components/weg-footer/icons/youtube.svg +4 -0
- package/dist/collection/components/weg-footer/weg-footer.css +141 -0
- package/dist/collection/components/weg-footer/weg-footer.js +204 -0
- package/dist/collection/index.js +10 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/collection/utils/utils.unit.test.js +16 -0
- package/dist/components/index.js +1 -0
- package/dist/components/my-component.js +1 -0
- package/dist/components/p-BTQYW5OR.js +1 -0
- package/dist/components/weg-footer.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/index-QiJxC4Ow.js +1606 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/loader.js +11 -0
- package/dist/{weg-shared-layout → esm}/my-component.entry.js +2 -5
- package/dist/{weg-shared-layout → esm}/weg-footer.entry.js +1 -4
- package/dist/esm/weg-shared-layout.js +21 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/weg-shared-layout/index.esm.js +1 -14
- package/dist/weg-shared-layout/p-87522053.entry.js +1 -0
- package/dist/weg-shared-layout/p-DQuL1Twl.js +1 -0
- package/dist/weg-shared-layout/p-QiJxC4Ow.js +2 -0
- package/dist/weg-shared-layout/p-d1addb13.entry.js +1 -0
- package/dist/weg-shared-layout/weg-shared-layout.esm.js +1 -50
- package/docs/angular.md +93 -0
- package/docs/publishing.md +48 -0
- package/docs/react.md +36 -0
- package/docs/vanilla.md +18 -0
- package/package.json +11 -8
- package/readme.md +15 -125
- package/dist/weg-shared-layout/index-C8BdwtPR.js +0 -4625
- package/dist/weg-shared-layout/index-C8BdwtPR.js.map +0 -1
- package/dist/weg-shared-layout/index.esm.js.map +0 -1
- package/dist/weg-shared-layout/my-component.entry.js.map +0 -1
- package/dist/weg-shared-layout/utils-DhW431pq.js.map +0 -1
- package/dist/weg-shared-layout/weg-footer.entry.js.map +0 -1
- package/dist/weg-shared-layout/weg-shared-layout.esm.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { b as bootstrapLazy } from './index-QiJxC4Ow.js';
|
|
2
|
+
export { s as setNonce } from './index-QiJxC4Ow.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
4
|
+
|
|
5
|
+
const defineCustomElements = async (win, options) => {
|
|
6
|
+
if (typeof window === 'undefined') return undefined;
|
|
7
|
+
await globalScripts();
|
|
8
|
+
return bootstrapLazy([["my-component",[[513,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["weg-footer",[[513,"weg-footer",{"data":[1],"resolved":[32]},null,{"data":[{"watchData":0}]}]]]], options);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { defineCustomElements };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
2
|
-
import {
|
|
1
|
+
import { r as registerInstance, h } from './index-QiJxC4Ow.js';
|
|
2
|
+
import { format } from './index.js';
|
|
3
3
|
|
|
4
4
|
const myComponentCss = () => `:host{display:block}`;
|
|
5
5
|
|
|
@@ -29,6 +29,3 @@ const MyComponent = class {
|
|
|
29
29
|
MyComponent.style = myComponentCss();
|
|
30
30
|
|
|
31
31
|
export { MyComponent as my_component };
|
|
32
|
-
//# sourceMappingURL=my-component.entry.esm.js.map
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=my-component.entry.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as registerInstance, h } from './index-QiJxC4Ow.js';
|
|
2
2
|
|
|
3
3
|
const wegFooterCss = () => `:host{display:block}.footer{background:#030712;color:#ffffff;padding:28px 32px;font-family:ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";font-weight:300}.container{max-width:1024px;margin:0 auto;display:flex;flex-direction:column;align-items:center;gap:20px}@media (min-width: 768px){.footer{padding:44px 56px}.container{gap:36px}}.social{display:flex;align-items:center;justify-content:center;gap:16px}@media (min-width: 768px){.social{gap:28px}}.social__link{width:48px;height:48px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:transparent;color:inherit;text-decoration:none;transition:opacity 150ms ease;outline:none}.social__link:hover{opacity:0.9}.social__link:focus-visible{outline:2px solid rgba(255, 255, 255, 0.9);outline-offset:4px}.social__icon{display:inline-flex;width:48px;height:48px}.footer-link{color:#ffffff;text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px;outline:none}.footer-link:hover{text-decoration-thickness:2px}.footer-link:focus-visible{outline:2px solid rgba(255, 255, 255, 0.9);outline-offset:4px}.legal{width:100%;max-width:860px;text-align:center;font-size:16px;line-height:24px}@media (min-width: 768px){.legal{font-size:18px;line-height:28px}}.legal__p{margin:0}.standard{width:100%;display:flex;flex-direction:column;align-items:center;gap:36px;text-align:center;font-size:16px;line-height:24px}@media (min-width: 768px){.standard{font-size:18px;line-height:28px}}.standard__links{display:flex;flex-direction:column;align-items:center;gap:16px}@media (min-width: 768px){.standard__links{flex-direction:row;flex-wrap:wrap;justify-content:center;gap:36px}}`;
|
|
4
4
|
|
|
@@ -165,6 +165,3 @@ const WegFooter = class {
|
|
|
165
165
|
WegFooter.style = wegFooterCss();
|
|
166
166
|
|
|
167
167
|
export { WegFooter as weg_footer };
|
|
168
|
-
//# sourceMappingURL=weg-footer.entry.esm.js.map
|
|
169
|
-
|
|
170
|
-
//# sourceMappingURL=weg-footer.entry.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-QiJxC4Ow.js';
|
|
2
|
+
export { s as setNonce } from './index-QiJxC4Ow.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v4.43.4 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
var patchBrowser = () => {
|
|
10
|
+
const importMeta = import.meta.url;
|
|
11
|
+
const opts = {};
|
|
12
|
+
if (importMeta !== "") {
|
|
13
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
14
|
+
}
|
|
15
|
+
return promiseResolve(opts);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
patchBrowser().then(async (options) => {
|
|
19
|
+
await globalScripts();
|
|
20
|
+
return bootstrapLazy([["my-component",[[513,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["weg-footer",[[513,"weg-footer",{"data":[1],"resolved":[32]},null,{"data":[{"watchData":0}]}]]]], options);
|
|
21
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./cjs/index.cjs.js');
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './esm/index.js';
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview entry point for your component library
|
|
5
|
-
*
|
|
6
|
-
* This is the entry point for your component library. Use this file to export utilities,
|
|
7
|
-
* constants or data structure that accompany your components.
|
|
8
|
-
*
|
|
9
|
-
* DO NOT use this file to export your components. Instead, use the recommended approaches
|
|
10
|
-
* to consume components of this package as outlined in the `README.md`.
|
|
11
|
-
*/
|
|
12
|
-
//# sourceMappingURL=index.esm.js.map
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=index.esm.js.map
|
|
1
|
+
function n(n,r,t){return(n||"")+(r?` ${r}`:"")+(t?` ${t}`:"")}export{n as format}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as e}from"./p-QiJxC4Ow.js";const i={social:[],standardLinks:[],credits:"",copyright:""};function n(t){return/^https?:\/\//.test(t)}function a(t){return"string"==typeof t&&t.trim().length>0}function o(t){if(!Array.isArray(t))return[];const e=[];for(const n of t){if(!n||"object"!=typeof n)continue;const t=n.platform,o=n.href;("LinkedIn"===(i=t)||"Instagram"===i||"TikTok"===i||"YouTube"===i)&&a(o)&&e.push({platform:t,href:o.trim()})}var i;return e}function r(t){if(!Array.isArray(t))return[];const e=[];for(const i of t){if(!i||"object"!=typeof i)continue;const t=i.label,n=i.href;a(t)&&a(n)&&e.push({label:t.trim(),href:n.trim()})}return e}function l({platform:t}){const i={viewBox:"0 0 48 48",width:48,height:48,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"};switch(t){case"LinkedIn":return e("svg",{...i},e("path",{d:"M24 0C37.2548 0 48 10.7452 48 24C48 37.2548 37.2548 48 24 48C10.7452 48 0 37.2548 0 24C0 10.7452 10.7452 0 24 0ZM12.9082 33.4736H17.5889V19.4111H12.9082V33.4736ZM29.0791 19.0811C26.5942 19.0811 25.4815 20.4458 24.8604 21.4033V19.4111H20.1797C20.2412 20.7279 20.1799 33.4203 20.1797 33.4736H24.8604V25.6201C24.8604 25.1998 24.8909 24.7804 25.0146 24.4795C25.3529 23.6399 26.1231 22.7705 27.416 22.7705C29.1103 22.7705 29.7881 24.0605 29.7881 25.9502V33.4736H34.4678V25.4102C34.4677 21.0909 32.1589 19.0811 29.0791 19.0811ZM15.2793 12.6318C13.6783 12.6319 12.6319 13.6818 12.6318 15.0605C12.6318 16.4108 13.6474 17.4912 15.2188 17.4912H15.249C16.8807 17.491 17.8965 16.4107 17.8965 15.0605C17.866 13.6818 16.8804 12.6318 15.2793 12.6318Z",fill:"white"}));case"Instagram":return e("svg",{...i},e("path",{d:"M24 0C37.2548 0 48 10.7452 48 24C48 37.2548 37.2548 48 24 48C10.7452 48 0 37.2548 0 24C0 10.7452 10.7452 0 24 0ZM23.999 11.2002C20.5245 11.2002 20.0877 11.2152 18.7227 11.2773C17.3602 11.3398 16.43 11.5556 15.6162 11.8721C14.7744 12.199 14.06 12.636 13.3486 13.3477C12.6366 14.0591 12.1991 14.7736 11.8711 15.6152C11.5538 16.4293 11.3377 17.3597 11.2764 18.7217C11.2153 20.087 11.2002 20.5238 11.2002 24C11.2002 27.476 11.2155 27.9113 11.2773 29.2764C11.34 30.639 11.5558 31.5699 11.8721 32.3838C12.1993 33.2255 12.636 33.94 13.3477 34.6514C14.0589 35.3634 14.7739 35.801 15.6152 36.1279C16.4295 36.4444 17.3596 36.6602 18.7217 36.7227C20.087 36.7848 20.5233 36.7998 23.999 36.7998C27.4756 36.7998 27.911 36.7848 29.2764 36.7227C30.639 36.6602 31.5704 36.4445 32.3848 36.1279C33.2261 35.801 33.9394 35.3631 34.6504 34.6514C35.3624 33.9399 35.7999 33.2254 36.1279 32.3838C36.4426 31.5697 36.6586 30.6393 36.7227 29.2773C36.784 27.912 36.7998 27.4763 36.7998 24C36.7998 20.5242 36.784 20.0876 36.7227 18.7227C36.6587 17.36 36.4426 16.4291 36.1279 15.6152C35.7999 14.7734 35.3623 14.0591 34.6504 13.3477C33.9385 12.6358 33.2264 12.1987 32.3838 11.8721C31.5678 11.5555 30.6371 11.3397 29.2744 11.2773C27.9093 11.2152 27.4745 11.2002 23.999 11.2002Z",fill:"white"}),e("path",{d:"M22.8525 13.5068C23.1933 13.5063 23.5739 13.5068 24.001 13.5068C27.4186 13.5068 27.8242 13.5197 29.1738 13.5811C30.4214 13.6381 31.0986 13.8463 31.5498 14.0215C32.1471 14.2535 32.5737 14.5305 33.0215 14.9785C33.4695 15.4265 33.746 15.8538 33.9785 16.4512C34.1537 16.9018 34.3631 17.5792 34.4199 18.8271C34.4812 20.1763 34.4941 20.5822 34.4941 23.998C34.4941 27.4134 34.4812 27.819 34.4199 29.168C34.3629 30.4158 34.1537 31.0933 33.9785 31.5439C33.7466 32.1412 33.4693 32.567 33.0215 33.0146C32.5735 33.4627 32.1474 33.7397 31.5498 33.9717C31.0992 34.1477 30.4216 34.356 29.1738 34.4131C27.8245 34.4744 27.4186 34.4883 24.001 34.4883C20.5835 34.4883 20.1783 34.4744 18.8291 34.4131C17.5811 34.3555 16.9036 34.1469 16.4521 33.9717C15.8549 33.7397 15.4284 33.4625 14.9805 33.0146C14.5325 32.5666 14.255 32.1406 14.0225 31.543C13.8473 31.0923 13.6378 30.4148 13.5811 29.167C13.5197 27.8179 13.5078 27.4121 13.5078 23.9941C13.5078 20.5762 13.5197 20.1726 13.5811 18.8232C13.6381 17.5755 13.8473 16.8984 14.0225 16.4473C14.2545 15.8499 14.5325 15.4236 14.9805 14.9756C15.4285 14.5276 15.8549 14.2501 16.4521 14.0176C16.9034 13.8416 17.5811 13.6335 18.8291 13.5762C20.0097 13.5228 20.4674 13.5066 22.8525 13.5039V13.5068ZM24.001 17.4268C20.371 17.427 17.4277 20.3709 17.4277 24.001C17.4279 27.6309 20.3711 30.5721 24.001 30.5723C27.631 30.5723 30.573 27.631 30.5732 24.001C30.5732 20.3708 27.6311 17.4268 24.001 17.4268ZM30.834 15.6318C29.9861 15.632 29.2979 16.3198 29.2979 17.168C29.2979 18.0159 29.9861 18.704 30.834 18.7041C31.682 18.7041 32.3701 18.016 32.3701 17.168C32.37 16.32 31.6819 15.6318 30.834 15.6318Z",fill:"white"}),e("path",{d:"M24.0011 19.7334C26.3574 19.7334 28.2678 21.6436 28.2678 24.0001C28.2678 26.3564 26.3574 28.2668 24.0011 28.2668C21.6445 28.2668 19.7344 26.3564 19.7344 24.0001C19.7344 21.6436 21.6445 19.7334 24.0011 19.7334Z",fill:"white"}));case"TikTok":return e("svg",{...i},e("path",{d:"M24 0C37.2548 0 48 10.7452 48 24C48 37.2548 37.2548 48 24 48C10.7452 48 0 37.2548 0 24C0 10.7452 10.7452 0 24 0ZM25.0273 28.3477C25.0273 30.2955 23.4721 31.8955 21.5361 31.8955C19.6003 31.8954 18.0449 30.2955 18.0449 28.3477C18.045 26.4347 19.5659 24.8693 21.4326 24.7998V20.6953C17.3188 20.7648 14.0001 24.1391 14 28.3477C14 32.5912 17.3883 36 21.5713 36C25.754 35.9998 29.1416 32.5562 29.1416 28.3477V19.9648C30.6627 21.0779 32.5295 21.7396 34.5 21.7744V17.6699C31.4579 17.5656 29.0723 15.0609 29.0723 12H25.0273V28.3477Z",fill:"white"}));case"YouTube":return e("svg",{...i},e("path",{d:"M24 0C37.2548 0 48 10.7452 48 24C48 37.2548 37.2548 48 24 48C10.7452 48 0 37.2548 0 24C0 10.7452 10.7452 0 24 0ZM24 15.2002C24 15.2002 15.9944 15.1997 13.998 15.749C12.8966 16.0513 12.0288 16.9423 11.7344 18.0732C11.1996 20.1231 11.2002 24.4004 11.2002 24.4004C11.2002 24.4472 11.2026 28.6878 11.7344 30.7266C12.0288 31.8575 12.8966 32.7483 13.998 33.0508C15.9944 33.6 24 33.5996 24 33.5996C24 33.5996 32.0057 33.6 34.002 33.0508C35.1033 32.7483 35.9703 31.8575 36.2646 30.7266C36.7966 28.6879 36.7998 24.4472 36.7998 24.4004C36.7998 24.4004 36.7996 20.1231 36.2646 18.0732C35.9703 16.9424 35.1033 16.0513 34.002 15.749C32.0057 15.1997 24 15.2002 24 15.2002Z",fill:"white"}),e("path",{d:"M21.6016 28.7998V20.7998L28.0016 24.8L21.6016 28.7998Z",fill:"white"}))}}const s=class{constructor(e){t(this,e)}data;resolved=i;resolve(){this.resolved=null!=this.data?function(t){const e=t&&"object"==typeof t?t:{},i=e.footer&&"object"==typeof e.footer?e.footer:{};return{social:o(i?.social),standardLinks:r(i?.standardLinks),credits:a(i?.credits)?i.credits.trim():"",copyright:a(i?.copyright)?i.copyright.trim():""}}(function(t){if("string"!=typeof t)return t;const e=t.trim();if(e)try{return JSON.parse(e)}catch{return}}(this.data)):i}componentWillLoad(){this.resolve()}watchData(){this.resolve()}renderLegalText(){const{credits:t,copyright:i}=this.resolved;return t||i?e("div",{class:"legal"},t?e("p",{class:"legal__p"},t):null,t&&i?e("p",{class:"legal__p"},String.fromCharCode(8203)):null,i?e("p",{class:"legal__p"},i):null):null}renderSocialLinks(){const t=this.resolved.social;return 0===t.length?null:e("div",{class:"social"},t.map((t=>e("a",{class:"social__link",href:t.href,"aria-label":t.platform,target:n(t.href)?"_blank":void 0,rel:n(t.href)?"noreferrer noopener":void 0},e("span",{class:"social__icon","aria-hidden":"true"},e(l,{platform:t.platform}))))))}renderStandardLinks(){const t=this.resolved.standardLinks;return 0===t.length?null:e("div",{class:"standard__links"},t.map((t=>e("a",{class:"footer-link",href:t.href},t.label))))}render(){return e("footer",{key:"b5440fe948f8a4207b20d8e380ab50f559890440",class:"footer"},e("div",{key:"2f4757c3a52203a89b53fa358513d832f153bfa2",class:"container"},this.renderSocialLinks(),e("div",{key:"4ee53f39a16dab3739c70dadcaadb15602f08ce9",class:"standard"},this.renderStandardLinks(),this.renderLegalText())))}static get watchers(){return{data:[{watchData:0}]}}};s.style=':host{display:block}.footer{background:#030712;color:#ffffff;padding:28px 32px;font-family:ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";font-weight:300}.container{max-width:1024px;margin:0 auto;display:flex;flex-direction:column;align-items:center;gap:20px}@media (min-width: 768px){.footer{padding:44px 56px}.container{gap:36px}}.social{display:flex;align-items:center;justify-content:center;gap:16px}@media (min-width: 768px){.social{gap:28px}}.social__link{width:48px;height:48px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:transparent;color:inherit;text-decoration:none;transition:opacity 150ms ease;outline:none}.social__link:hover{opacity:0.9}.social__link:focus-visible{outline:2px solid rgba(255, 255, 255, 0.9);outline-offset:4px}.social__icon{display:inline-flex;width:48px;height:48px}.footer-link{color:#ffffff;text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px;outline:none}.footer-link:hover{text-decoration-thickness:2px}.footer-link:focus-visible{outline:2px solid rgba(255, 255, 255, 0.9);outline-offset:4px}.legal{width:100%;max-width:860px;text-align:center;font-size:16px;line-height:24px}@media (min-width: 768px){.legal{font-size:18px;line-height:28px}}.legal__p{margin:0}.standard{width:100%;display:flex;flex-direction:column;align-items:center;gap:36px;text-align:center;font-size:16px;line-height:24px}@media (min-width: 768px){.standard{font-size:18px;line-height:28px}}.standard__links{display:flex;flex-direction:column;align-items:center;gap:16px}@media (min-width: 768px){.standard__links{flex-direction:row;flex-wrap:wrap;justify-content:center;gap:36px}}';export{s as weg_footer}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=()=>{};export{o as g}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function t(t,e,n){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,e);if(o&&(!n||o.get))return o;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var o;Object.entries(null!=(o=n.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=e[o],i=t(Object.getPrototypeOf(e),o,!0)||Object.getOwnPropertyDescriptor(e,o);i&&Object.defineProperty(e,o,{get(){return i.get.call(this)},set(t){i.set.call(this,t)},configurable:!0,enumerable:!0}),n.l.has(o)?e[o]=n.l.get(o):void 0!==l&&(e[o]=l)}}))},o=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},l=(t,e)=>{e&&(t.__stencil__getHostRef=()=>e,e.i=t,512&e.o.u&&n(t,e))},i=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),r=new Map,c=new Map,u="http://www.w3.org/1999/xlink",f="undefined"!=typeof window?window:{},a={u:0,h:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},d=t=>Promise.resolve(t),h=(()=>{try{return!!f.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),p=!!h&&(()=>!!f.document&&Object.getOwnPropertyDescriptor(f.document.adoptedStyleSheets,"length").writable)(),m=!1,v=[],y=[],b=(t,e)=>n=>{t.push(n),m||(m=!0,e&&4&a.u?g($):a.raf($))},w=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},$=()=>{w(v),w(y),(m=v.length>0)&&a.raf($)},g=t=>d().then(t),j=b(y,!0);function O(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(p?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}function S(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}var k,E=new WeakMap,M=t=>"sc-"+t.p,C=t=>"object"==(t=typeof t)||"function"===t,x=(t,e,...n)=>{let o=null,l=null,i=!1,s=!1;const r=[],c=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof t&&!C(o))&&(o+=""),i&&s?r[r.length-1].m+=o:r.push(i?L(null,o):o),s=i)};if(c(n),e){e.key&&(l=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}if("function"==typeof t)return t(null===e?{}:e,r,D);const u=L(t,null);return u.v=e,r.length>0&&(u.$=r),u.j=l,u},L=(t,e)=>({u:0,O:t,m:null!=e?e:null,S:null,$:null,v:null,j:null}),R={},D={forEach:(t,e)=>t.map(P).forEach(e),map:(t,e)=>t.map(P).map(e).map(T)},P=t=>({vattrs:t.v,vchildren:t.$,vkey:t.j,vname:t.k,vtag:t.O,vtext:t.m}),T=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),x(t.vtag,e,...t.vchildren||[])}const e=L(t.vtag,t.vtext);return e.v=t.vattrs,e.$=t.vchildren,e.j=t.vkey,e.k=t.vname,e},A=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const o of e){if(n)break;for(const e of t[o])if("string"==typeof e){n=!0;break}}if(!n)return t;const o={};for(const n of e)o[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return o},H=(t,e)=>null==t||C(t)?t:1&e?t+"":t,N=(t,e,n,l,s,r)=>{if(n===l)return;let c=i(t,e),d=e.toLowerCase();if("class"===e){const e=t.classList,o=W(n);let i=W(l);e.remove(...o.filter((t=>t&&!i.includes(t)))),e.add(...i.filter((t=>t&&!o.includes(t))))}else if("style"===e){for(const e in n)l&&null!=l[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in l)n&&l[e]===n[e]||(e.includes("-")?t.style.setProperty(e,l[e]):t.style[e]=l[e])}else if("key"===e);else if("ref"===e)l&&X(l,t);else if(c||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let i;{const e=o(t);if(e&&e.o&&e.o.t){const t=e.o.t[n];t&&t[1]&&(i=t[1])}}return i||(i=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==l||!1===l?!1===l&&""!==t.getAttribute(i)||t.removeAttribute(i):t.setAttribute(i,!0===l?"":l))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=l}catch(t){}return}{const o=C(l);if((c||o&&null!==l)&&!s)try{if(t.tagName.includes("-"))t[e]!==l&&(t[e]=l);else{const o=null==l?"":l;"list"===e?c=!1:null!=n&&t[e]===o||("function"==typeof t.__lookupSetter__(e)?t[e]=o:t.setAttribute(e,o))}}catch(t){}let i=!1;d!==(d=d.replace(/^xlink\:?/,""))&&(e=d,i=!0),null==l||!1===l?!1===l&&""!==t.getAttribute(e)||(i?t.removeAttributeNS(u,e):t.removeAttribute(e)):(!c||4&r||s)&&!o&&1===t.nodeType&&(l=!0===l?"":l,i?t.setAttributeNS(u,e,l):t.setAttribute(e,l))}}else if(e="-"===e[2]?e.slice(3):i(f,d)?d.slice(2):d[2]+e.slice(3),n||l){const o=e.endsWith(z);e=e.replace(V,""),n&&a.rel(t,e,n,o),l&&a.ael(t,e,l,o)}},U=/\s/,W=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(U):[]),z="Capture",V=RegExp(z+"$"),q=(t,e,n)=>{const o=11===e.S.nodeType&&e.S.host?e.S.host:e.S,l=t&&t.v||{},i=e.v||{};for(const t of F(Object.keys(l)))t in i||N(o,t,l[t],void 0,n,e.u);for(const t of F(Object.keys(i)))N(o,t,l[t],i[t],n,e.u)};function F(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var G=!1,Y=[],Z=[],_=(t,e,n)=>{const o=e.$[n];let l,i,s=0;if(null!=o.m)l=o.S=f.document.createTextNode(o.m);else{if(G||(G="svg"===o.O),!f.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.S=f.document.createElementNS(G?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.O),G&&"foreignObject"===o.O&&(G=!1),q(null,o,G),o.$){const e="template"===o.O?l.content:l;for(s=0;s<o.$.length;++s)i=_(t,o,s),i&&e.appendChild(i)}"svg"===o.O?G=!1:"foreignObject"===l.tagName&&(G=!0)}return l["s-hn"]=k,l},B=(t,e,n,o,l,i)=>{let s,r=t;for(r.shadowRoot&&r.tagName===k&&(r=r.shadowRoot),"template"===n.O&&(r=r.content);l<=i;++l)o[l]&&(s=_(null,n,l),s&&(o[l].S=s,tt(r,s,e)))},I=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.S;Q(e),t&&t.remove()}}},J=(t,e,n=!1)=>t.O===e.O&&(n?(n&&!t.j&&e.j&&(t.j=e.j),!0):t.j===e.j),K=(t,e,n=!1)=>{const o=e.S=t.S,l=t.$,i=e.$,s=e.O,r=e.m;null==r?(q(t,e,G="svg"===s||"foreignObject"!==s&&G),null!==l&&null!==i?((t,e,n,o,l=!1)=>{let i,s,r=0,c=0,u=0,f=0,a=e.length-1,d=e[0],h=e[a],p=o.length-1,m=o[0],v=o[p];const y="template"===n.O?t.content:t;for(;r<=a&&c<=p;)if(null==d)d=e[++r];else if(null==h)h=e[--a];else if(null==m)m=o[++c];else if(null==v)v=o[--p];else if(J(d,m,l))K(d,m,l),d=e[++r],m=o[++c];else if(J(h,v,l))K(h,v,l),h=e[--a],v=o[--p];else if(J(d,v,l))K(d,v,l),tt(y,d.S,h.S.nextSibling),d=e[++r],v=o[--p];else if(J(h,m,l))K(h,m,l),tt(y,h.S,d.S),h=e[--a],m=o[++c];else{for(u=-1,f=r;f<=a;++f)if(e[f]&&null!==e[f].j&&e[f].j===m.j){u=f;break}u>=0?(s=e[u],s.O!==m.O?i=_(e&&e[c],n,u):(K(s,m,l),e[u]=void 0,i=s.S),m=o[++c]):(i=_(e&&e[c],n,c),m=o[++c]),i&&tt(d.S.parentNode,i,d.S)}r>a?B(t,null==o[p+1]?null:o[p+1].S,n,o,c,p):c>p&&I(e,r,a)})(o,l,e,i,n):null!==i?(null!==t.m&&(o.textContent=""),B(o,null,e,i,0,i.length-1)):!n&&null!==l&&I(l,0,l.length-1),G&&"svg"===s&&(G=!1)):t.m!==r&&(o.data=r)},Q=t=>{t.v&&t.v.ref&&Y.push((()=>t.v.ref(null))),t.$&&t.$.map(Q)},X=(t,e)=>{Z.push((()=>t(e)))},tt=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),et=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.M=()=>{e["s-p"].splice(n-1,1),o()})))}},nt=(t,e)=>{if(t.u|=16,4&t.u)return void(t.u|=512);et(t,t.C);const n=()=>ot(t,e);if(!e)return j(n);queueMicrotask((()=>{n()}))},ot=(t,e)=>{const n=t.$hostElement$,o=t.i;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return e?(t.L.length&&t.L.forEach((t=>t(n))),l=ft(o,"componentWillLoad",void 0,n)):l=ft(o,"componentWillUpdate",void 0,n),l=lt(l,(()=>ft(o,"componentWillRender",void 0,n))),lt(l,(()=>st(t,o,e)))},lt=(t,e)=>it(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),it=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,st=async(t,e,n)=>{var o;const l=t.$hostElement$,i=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.u,l=((t,e)=>{var n,o,l;const i=M(e),s=c.get(i);if(!f.document)return i;if(t=11===t.nodeType?t:f.document,s)if("string"==typeof s){let l,r=E.get(t=t.head||t);if(r||E.set(t,r=new Set),!r.has(i)){l=f.document.createElement("style"),l.textContent=s;const c=null!=(n=a.R)?n:S(f.document);if(null!=c&&l.setAttribute("nonce",c),!(1&e.u))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(h){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(s),p?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=s+e.textContent:t.prepend(l)}else t.append(l);1&e.u&&t.insertBefore(l,null),4&e.u&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),r&&r.add(i)}}else{let e=E.get(t);if(e||E.set(t,e=new Set),!e.has(i)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(s.constructor===n.CSSStyleSheet)o=s;else{o=new n.CSSStyleSheet;for(let t=0;t<s.cssRules.length;t++)o.insertRule(s.cssRules[t].cssText,t)}p?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(i)}}return i})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);rt(t,e,l,n),i&&(i.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>ct(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.u|=4,e.length=0)}},rt=(t,e,n,o)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.D||L(null,null),i=(t=>t&&t.O===R)(e)?e:x(null,null,e);if(k=o.tagName,n&&i.v)for(const t of Object.keys(i.v))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.v[t]=o[t]);i.O=null,i.u|=4,t.D=i,i.S=l.S=o.shadowRoot||o,K(l,i,n),Y.forEach((t=>t())),Y.length=0,Z.forEach((t=>t())),Z.length=0})(t,e,o)}catch(e){s(e,t.$hostElement$)}return null},ct=t=>{const e=t.$hostElement$,n=t.i,o=t.C;ft(n,"componentDidRender",void 0,e),64&t.u?ft(n,"componentDidUpdate",void 0,e):(t.u|=64,at(e),ft(n,"componentDidLoad",void 0,e),t.P(e),o||ut()),t.M&&(t.M(),t.M=void 0),512&t.u&&g((()=>nt(t,!1))),t.u&=-517},ut=()=>{g((()=>(t=>{const e=a.ce("appload",{detail:{namespace:"weg-shared-layout"}});return t.dispatchEvent(e),e})(f)))},ft=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t,o)}},at=t=>t.classList.add("hydrated"),dt=(t,e,n,l)=>{const i=o(t);if(!i)return;if(!i)throw Error(`Couldn't find host element for "${l.p}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const r=i.$hostElement$,c=i.l.get(e),u=i.u,f=i.i;if(n=H(n,l.t[e][0]),!(8&u&&void 0!==c||n===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.l.set(e,n),l.T){const t=l.T[e];t&&t.map((t=>{try{const[[o,l]]=Object.entries(t);(128&u||1&l)&&(f?f[o](n,c,e):i.L.push((()=>{i.i[o](n,c,e)})))}catch(t){s(t,r)}}))}if(2&u){if(f.componentShouldUpdate&&!1===f.componentShouldUpdate(n,c,e)&&!(16&u))return;16&u||nt(i,!1)}}},ht=(e,n,l)=>{var i,s;const r=e.prototype;{e.watchers&&!n.T&&(n.T=A(e.watchers)),e.deserializers&&!n.A&&(n.A=e.deserializers),e.serializers&&!n.H&&(n.H=e.serializers);const c=Object.entries(null!=(i=n.t)?i:{});if(c.map((([e,[i]])=>{if(31&i||2&l&&32&i){const{get:s,set:c}=t(r,e)||{};s&&(n.t[e][0]|=2048),c&&(n.t[e][0]|=4096),(1&l||!s)&&Object.defineProperty(r,e,{get(){{if(!(2048&n.t[e][0]))return((t,e)=>o(this).l.get(e))(0,e);const t=o(this),l=t?t.i:r;if(!l)return;return l[e]}},configurable:!0,enumerable:!0}),Object.defineProperty(r,e,{set(t){const s=o(this);if(s){if(c)return void 0===(32&i?this[e]:s.$hostElement$[e])&&s.l.get(e)&&(t=s.l.get(e)),c.call(this,H(t,i)),void dt(this,e,t=32&i?this[e]:s.$hostElement$[e],n);{if(!(1&l&&4096&n.t[e][0]))return dt(this,e,t,n),void(1&l&&!s.i&&s.L.push((()=>{4096&n.t[e][0]&&s.i[e]!==s.l.get(e)&&(s.i[e]=t)})));const o=()=>{const o=s.i[e];!s.l.get(e)&&o&&s.l.set(e,o),s.i[e]=H(t,i),dt(this,e,s.i[e],n)};s.i?o():s.L.push((()=>{o()}))}}}})}})),1&l){const t=new Map;r.attributeChangedCallback=function(e,l,i){a.jmp((()=>{var s;const u=t.get(e),f=o(this);if(this.hasOwnProperty(u)&&(i=this[u],delete this[u]),r.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==i)return;if(null==u){const t=null==f?void 0:f.u;if(f&&t&&!(8&t)&&i!==l){const o=f.i,r=null==(s=n.T)?void 0:s[e];null==r||r.forEach((n=>{const[[s,r]]=Object.entries(n);null!=o[s]&&(128&t||1&r)&&o[s].call(o,i,l,e)}))}return}const a=c.find((([t])=>t===u)),d=a&&4&a[1][0],h=d&&null===i&&void 0===this[u];d&&(i=null!==i&&"false"!==i);const p=Object.getOwnPropertyDescriptor(r,u);h||i==this[u]||p.get&&!p.set||(this[u]=i)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.T)?s:{}),...c.filter((([t,e])=>31&e[0])).map((([e,n])=>{const o=n[1]||e;return t.set(o,e),o}))]))}}return e},pt=(t,e)=>{ft(t,"connectedCallback",void 0,e)},mt=(t,e)=>{ft(t,"disconnectedCallback",void 0,e||t)},vt=(t,e={})=>{var n;if(!f.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const l=[],i=e.exclude||[],u=f.customElements,d=f.document.head,p=d.querySelector("meta[charset]"),m=f.document.createElement("style"),v=[];let y,b=!0;if(Object.assign(a,e),a.h=new URL(e.resourcesUrl||"./",f.document.baseURI).href,t.map((t=>{t[1].map((e=>{var n,f;const d={u:e[0],p:e[1],t:e[2],N:e[3]};d.t=e[2],d.T=A(e[4]),d.H=null!=(n=e[5])?n:{},d.A=null!=(f=e[6])?f:{};const p=d.p,m=class extends HTMLElement{"s-p";"s-rc";hasRegisteredEventListeners=!1;constructor(t){if(super(t),((t,e)=>{const n={u:0,$hostElement$:t,o:e,l:new Map,U:new Map};n.W=new Promise((t=>n.P=t)),t["s-p"]=[],t["s-rc"]=[],n.L=[];const o=n;t.__stencil__getHostRef=()=>o})(t=this,d),1&d.u)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${d.p}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else O.call(t,d)}connectedCallback(){o(this)&&(this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),y&&(clearTimeout(y),y=null),b?v.push(this):a.jmp((()=>(t=>{if(!(1&a.u)){const e=o(t);if(!e)return;const n=e.o,l=()=>{};if(1&e.u)(null==e?void 0:e.i)?pt(e.i,t):(null==e?void 0:e.W)&&e.W.then((()=>pt(e.i,t)));else{e.u|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){et(e,e.C=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;try{if(!(32&e.u)){if(e.u|=32,n.V){const l=((t,e)=>{const n=t.p.replace(/-/g,"_"),o=t.V;if(!o)return;const l=r.get(o);return l?l[n]:import(`./${o}.entry.js`).then((t=>(r.set(o,t),t[n])),(t=>{s(t,e.$hostElement$)}))
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,e);if(l&&"then"in l){const t=()=>{};o=await l,t()}else o=l;if(!o)throw Error(`Constructor for "${n.p}#${e.q}" was not found`);o.isProxied||(n.T=A(o.watchers),n.H=o.serializers,n.A=o.deserializers,ht(o,n,2),o.isProxied=!0);const i=()=>{};e.u|=8;try{new o(e)}catch(e){s(e,t)}e.u&=-9,e.u|=128,i(),pt(e.i,t)}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.u|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=M(n);if(!c.has(e)){const o=()=>{};((t,e,n)=>{let o=c.get(t);h&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,c.set(t,o)})(e,t,!!(1&n.u)),o()}}}const l=e.C,i=()=>nt(e,!0);l&&l["s-rc"]?l["s-rc"].push(i):i()}catch(n){s(n,t),e.M&&(e.M(),e.M=void 0),e.P&&e.P(t)}})(t,e,n)}l()}})(this))))}disconnectedCallback(){a.jmp((()=>(async t=>{if(!(1&a.u)){const e=o(t);(null==e?void 0:e.i)?mt(e.i,t):(null==e?void 0:e.W)&&e.W.then((()=>mt(e.i,t)))}E.has(t)&&E.delete(t),t.shadowRoot&&E.has(t.shadowRoot)&&E.delete(t.shadowRoot)})(this))),a.raf((()=>{var t;const e=o(this);if(!e)return;const n=v.findIndex((t=>t===this));n>-1&&v.splice(n,1),(null==(t=null==e?void 0:e.D)?void 0:t.S)instanceof Node&&!e.D.S.isConnected&&delete e.D.S}))}componentOnReady(){var t;return null==(t=o(this))?void 0:t.W}};d.V=t[0],i.includes(p)||u.get(p)||(l.push(p),u.define(p,ht(m,d,1)))}))})),l.length>0&&(m.textContent+=l.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",m.innerHTML.length)){m.setAttribute("data-styles","");const t=null!=(n=a.R)?n:S(f.document);null!=t&&m.setAttribute("nonce",t),d.insertBefore(m,p?p.nextSibling:d.firstChild)}b=!1,v.length?v.map((t=>t.connectedCallback())):a.jmp((()=>y=setTimeout(ut,30)))},yt=t=>a.R=t;export{vt as b,x as h,d as p,l as r,yt as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as s}from"./p-QiJxC4Ow.js";import{format as r}from"./index.esm.js";const o=class{constructor(s){t(this,s)}first;middle;last;getText(){return r(this.first,this.middle,this.last)}render(){return s("div",{key:"5452c3b9c97f8879dbc26b788d1fa79409846ff0"},"Hello, world! I'm ",this.getText())}};o.style=":host{display:block}";export{o as my_component}
|
|
@@ -1,50 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { s as setNonce } from './index-C8BdwtPR.js';
|
|
3
|
-
|
|
4
|
-
/*
|
|
5
|
-
Stencil Client Patch Browser v4.43.4 | MIT Licensed | https://stenciljs.com
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
var patchBrowser = () => {
|
|
9
|
-
if (BUILD.isDev && !BUILD.isTesting) {
|
|
10
|
-
consoleDevInfo("Running in development mode.");
|
|
11
|
-
}
|
|
12
|
-
if (BUILD.cloneNodeFix) {
|
|
13
|
-
patchCloneNodeFix(H.prototype);
|
|
14
|
-
}
|
|
15
|
-
const scriptElm = BUILD.scriptDataOpts ? win.document && Array.from(win.document.querySelectorAll("script")).find(
|
|
16
|
-
(s) => new RegExp(`/${NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) || s.getAttribute("data-stencil-namespace") === NAMESPACE
|
|
17
|
-
) : null;
|
|
18
|
-
const importMeta = import.meta.url;
|
|
19
|
-
const opts = BUILD.scriptDataOpts ? (scriptElm || {})["data-opts"] || {} : {};
|
|
20
|
-
if (importMeta !== "") {
|
|
21
|
-
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
22
|
-
}
|
|
23
|
-
return promiseResolve(opts);
|
|
24
|
-
};
|
|
25
|
-
var patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
26
|
-
const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;
|
|
27
|
-
HTMLElementPrototype.cloneNode = function(deep) {
|
|
28
|
-
if (this.nodeName === "TEMPLATE") {
|
|
29
|
-
return nativeCloneNodeFn.call(this, deep);
|
|
30
|
-
}
|
|
31
|
-
const clonedNode = nativeCloneNodeFn.call(this, false);
|
|
32
|
-
const srcChildNodes = this.childNodes;
|
|
33
|
-
if (deep) {
|
|
34
|
-
for (let i = 0; i < srcChildNodes.length; i++) {
|
|
35
|
-
if (srcChildNodes[i].nodeType !== 2) {
|
|
36
|
-
clonedNode.appendChild(srcChildNodes[i].cloneNode(true));
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return clonedNode;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
patchBrowser().then(async (options) => {
|
|
45
|
-
await globalScripts();
|
|
46
|
-
return bootstrapLazy([["my-component",[[513,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["weg-footer",[[513,"weg-footer",{"data":[1],"resolved":[32]},null,{"data":[{"watchData":0}]}]]]], options);
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=weg-shared-layout.esm.js.map
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=weg-shared-layout.esm.js.map
|
|
1
|
+
import{p as a,b as t}from"./p-QiJxC4Ow.js";export{s as setNonce}from"./p-QiJxC4Ow.js";import{g as o}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),a(o)})().then((async a=>(await o(),t([["p-d1addb13",[[513,"my-component",{first:[1],middle:[1],last:[1]}]]],["p-87522053",[[513,"weg-footer",{data:[1],resolved:[32]},null,{data:[{watchData:0}]}]]]],a))));
|
package/docs/angular.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Angular
|
|
2
|
+
|
|
3
|
+
Assumes Angular 17+ with **standalone** components (default for `ng new`).
|
|
4
|
+
|
|
5
|
+
## 1. Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i weg-shared-layout
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 2. Register custom elements (once, before bootstrap)
|
|
12
|
+
|
|
13
|
+
In `src/main.ts`, call `defineCustomElements()` **before** `bootstrapApplication` so the browser recognises `<weg-footer>`.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { bootstrapApplication } from '@angular/platform-browser';
|
|
17
|
+
import { defineCustomElements } from 'weg-shared-layout/loader';
|
|
18
|
+
|
|
19
|
+
import { appConfig } from './app/app.config';
|
|
20
|
+
import { App } from './app/app';
|
|
21
|
+
|
|
22
|
+
defineCustomElements();
|
|
23
|
+
|
|
24
|
+
bootstrapApplication(App, appConfig).catch((err) => console.error(err));
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If `defineCustomElements` is async in your Stencil build, `await` it (or chain `.then()`) before bootstrapping so the custom element is defined before the first render.
|
|
28
|
+
|
|
29
|
+
## 3. Allow custom elements in templates
|
|
30
|
+
|
|
31
|
+
Add `schemas: [CUSTOM_ELEMENTS_SCHEMA]` to every `@Component` whose template uses `<weg-footer>` (it does not cascade from the root through `router-outlet` children).
|
|
32
|
+
|
|
33
|
+
## 4. Pass data with property binding
|
|
34
|
+
|
|
35
|
+
Use **`[data]="..."`** so Angular sets the element’s JavaScript `data` property (Stencil `@Prop()`), not an HTML attribute.
|
|
36
|
+
|
|
37
|
+
Example with the bundled sample payload:
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
// src/app/app.ts
|
|
41
|
+
import { Component, CUSTOM_ELEMENTS_SCHEMA, signal } from '@angular/core';
|
|
42
|
+
import { RouterOutlet } from '@angular/router';
|
|
43
|
+
import layoutFixture from 'weg-shared-layout/dummy-data.json';
|
|
44
|
+
|
|
45
|
+
@Component({
|
|
46
|
+
selector: 'app-root',
|
|
47
|
+
imports: [RouterOutlet],
|
|
48
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
49
|
+
templateUrl: './app.html',
|
|
50
|
+
styleUrl: './app.css',
|
|
51
|
+
})
|
|
52
|
+
export class App {
|
|
53
|
+
protected readonly layoutData = signal(layoutFixture);
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```html
|
|
58
|
+
<!-- src/app/app.html -->
|
|
59
|
+
<router-outlet />
|
|
60
|
+
<weg-footer [data]="layoutData()"></weg-footer>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Enable `resolveJsonModule` in the TypeScript config used by the app (e.g. `tsconfig.app.json`) if you import `dummy-data.json`.
|
|
64
|
+
|
|
65
|
+
In production, replace `layoutFixture` with data from your own services; keep the same object shape as `dummy-data.json`.
|
|
66
|
+
|
|
67
|
+
### Alternative: register only `<weg-footer>`
|
|
68
|
+
|
|
69
|
+
To avoid the full lazy bundle (e.g. simpler bundling with some dev servers), you can side-effect import the custom-elements bundle instead of the loader:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
import 'weg-shared-layout/weg-footer';
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then bootstrap as usual (no `defineCustomElements()` call required for that tag).
|
|
76
|
+
|
|
77
|
+
## Troubleshooting
|
|
78
|
+
|
|
79
|
+
| Symptom | Cause / fix |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| `'weg-footer' is not a known element` | Add `schemas: [CUSTOM_ELEMENTS_SCHEMA]` on the component whose template contains `<weg-footer>`. |
|
|
82
|
+
| Footer missing or empty box | `defineCustomElements()` not called before bootstrap (or footer bundle not imported), or `data` not set / wrong shape — compare with `dummy-data.json`. |
|
|
83
|
+
| SSR: `document is not defined` | Guard `defineCustomElements()` with `typeof window !== 'undefined'` or `isPlatformBrowser`. |
|
|
84
|
+
|
|
85
|
+
## TypeScript typings
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
/// <reference types="weg-shared-layout/dist/types/components" />
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Legacy `NgModule`
|
|
92
|
+
|
|
93
|
+
Add `CUSTOM_ELEMENTS_SCHEMA` once on the module that declares components using `<weg-footer>`. `defineCustomElements()` in `main.ts` is still required when using the loader.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Publishing to npm
|
|
2
|
+
|
|
3
|
+
## `npm publish` does not run your build by default
|
|
4
|
+
|
|
5
|
+
Publishing packs **whatever is already on disk** under the paths listed in [`package.json` `files`](../package.json) (for this package: `dist/`, `loader/`, and `dummy-data.json`). It does **not** automatically run `npm run build` unless a lifecycle script does.
|
|
6
|
+
|
|
7
|
+
If you publish with an empty, missing, or half-built `dist/`, consumers get a broken tarball (missing `dist/esm/loader.js`, missing `dist/components/*.js`, etc.).
|
|
8
|
+
|
|
9
|
+
## What this repo does
|
|
10
|
+
|
|
11
|
+
The **`prepack`** script runs **`npm run build`** before every:
|
|
12
|
+
|
|
13
|
+
- `npm pack`
|
|
14
|
+
- `npm publish` (which packs first)
|
|
15
|
+
|
|
16
|
+
So the Stencil output and generated `loader/` are always fresh in the tarball.
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
"scripts": {
|
|
20
|
+
"prepack": "npm run build",
|
|
21
|
+
"build": "stencil build"
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Release checklist
|
|
26
|
+
|
|
27
|
+
1. Bump **`version`** in `package.json`.
|
|
28
|
+
2. From the package root:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm run build
|
|
32
|
+
npm test
|
|
33
|
+
npm pack --dry-run
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Inspect the dry-run file list and spot-check for `dist/esm/loader.js`, `dist/components/weg-footer.js`, and `loader/index.js`.
|
|
37
|
+
|
|
38
|
+
3. Publish (runs `prepack` → build again):
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm publish
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Use `npm publish --dry-run` if you want to exercise the full pack pipeline without uploading.
|
|
45
|
+
|
|
46
|
+
## CI
|
|
47
|
+
|
|
48
|
+
If you publish from CI, run **`npm run build`** (or rely on **`npm publish`**, which triggers **`prepack`**) in the same job before `npm publish`, and ensure **devDependencies** (e.g. `@stencil/core`) are installed so `stencil build` succeeds.
|
package/docs/react.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# React
|
|
2
|
+
|
|
3
|
+
## Register custom elements
|
|
4
|
+
|
|
5
|
+
Run once (for example in `main.tsx` / your app entry):
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { defineCustomElements } from 'weg-shared-layout/loader';
|
|
9
|
+
|
|
10
|
+
defineCustomElements();
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Pass layout data
|
|
14
|
+
|
|
15
|
+
Import the fixture (or your own object with the same shape) and pass it on **`data`**:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import 'weg-shared-layout/weg-footer';
|
|
19
|
+
import layout from 'weg-shared-layout/dummy-data.json';
|
|
20
|
+
|
|
21
|
+
export function SiteFooter() {
|
|
22
|
+
return <weg-footer data={layout} />;
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Use **React 19 or newer** so `data={...}` is applied as the custom element’s **`data` property** (object), not a string attribute.
|
|
27
|
+
|
|
28
|
+
**Next.js App Router:** keep registration and this JSX in a **Client Component** (`"use client"`).
|
|
29
|
+
|
|
30
|
+
## TypeScript
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
/// <reference types="weg-shared-layout/dist/types/components" />
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Enable `resolveJsonModule` in `tsconfig.json` if you import `dummy-data.json`.
|
package/docs/vanilla.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Plain HTML / vanilla JS
|
|
2
|
+
|
|
3
|
+
With a bundler that resolves `node_modules` imports:
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<weg-footer id="footer"></weg-footer>
|
|
7
|
+
<script type="module">
|
|
8
|
+
import { defineCustomElements } from 'weg-shared-layout/loader';
|
|
9
|
+
import layout from 'weg-shared-layout/dummy-data.json';
|
|
10
|
+
|
|
11
|
+
defineCustomElements();
|
|
12
|
+
document.getElementById('footer').data = layout;
|
|
13
|
+
</script>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Otherwise, copy `dummy-data.json` to your static assets, `fetch` it, parse JSON, then assign **`element.data`**.
|
|
17
|
+
|
|
18
|
+
You can also pass a JSON string on the **`data` attribute**; the component parses it the same way as an object `data` property.
|
package/package.json
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weg-shared-layout",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Shared layout Web Components built with Stencil",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
|
-
"types": "dist/components
|
|
7
|
+
"types": "dist/types/components.d.ts",
|
|
8
8
|
"collection": "dist/collection/collection-manifest.json",
|
|
9
9
|
"collection:main": "dist/collection/index.js",
|
|
10
10
|
"unpkg": "dist/weg-shared-layout/weg-shared-layout.esm.js",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"types": "./dist/types/components.d.ts",
|
|
13
14
|
"import": "./dist/weg-shared-layout/weg-shared-layout.esm.js",
|
|
14
15
|
"require": "./dist/weg-shared-layout/weg-shared-layout.cjs.js"
|
|
15
16
|
},
|
|
16
17
|
"./my-component": {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
18
|
+
"types": "./dist/components/my-component.d.ts",
|
|
19
|
+
"import": "./dist/components/my-component.js"
|
|
19
20
|
},
|
|
20
21
|
"./weg-footer": {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
22
|
+
"types": "./dist/components/weg-footer.d.ts",
|
|
23
|
+
"import": "./dist/components/weg-footer.js"
|
|
23
24
|
},
|
|
24
25
|
"./loader": {
|
|
26
|
+
"types": "./loader/index.d.ts",
|
|
25
27
|
"import": "./loader/index.js",
|
|
26
|
-
"require": "./loader/index.cjs"
|
|
27
|
-
"types": "./loader/index.d.ts"
|
|
28
|
+
"require": "./loader/index.cjs.js"
|
|
28
29
|
},
|
|
29
30
|
"./dummy-data.json": "./src/assets/dummy-data.json"
|
|
30
31
|
},
|
|
@@ -38,10 +39,12 @@
|
|
|
38
39
|
"homepage": "https://github.com/jobsac/weg-shared-layout#readme",
|
|
39
40
|
"files": [
|
|
40
41
|
"dist/",
|
|
42
|
+
"docs/",
|
|
41
43
|
"loader/",
|
|
42
44
|
"src/assets/dummy-data.json"
|
|
43
45
|
],
|
|
44
46
|
"scripts": {
|
|
47
|
+
"prepack": "npm run build",
|
|
45
48
|
"build": "stencil build",
|
|
46
49
|
"start": "stencil build --dev --watch --serve",
|
|
47
50
|
"test": "stencil-test --prod",
|
package/readme.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> Shared layout Web Components (Stencil).
|
|
6
6
|
|
|
7
|
-
Install
|
|
7
|
+
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npm i weg-shared-layout
|
|
@@ -12,137 +12,27 @@ npm i weg-shared-layout
|
|
|
12
12
|
|
|
13
13
|
## How it works
|
|
14
14
|
|
|
15
|
-
`<weg-footer>` is a **presentational** Web Component: it does **not** fetch data. Your app
|
|
15
|
+
`<weg-footer>` is a **presentational** Web Component: it does **not** fetch data. Your app supplies an object on the element’s **`data` property** (Stencil `@Prop()`), not a string HTML attribute (unless you pass JSON as a string — see [Vanilla / HTML](./docs/vanilla.md)).
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
You **can** load that object however you normally fetch JSON in your stack (`fetch`, your data layer, server components, etc.). For example, [https://weg-payload-test.vercel.app/api/layout](https://weg-payload-test.vercel.app/api/layout) returns the same shape as **`dummy-data.json`**; pass the response into `data` on `<weg-footer>` (or your framework wrapper) like any other prop.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
- **In this repo:** [`src/assets/dummy-data.json`](src/assets/dummy-data.json)
|
|
21
|
-
|
|
22
|
-
Use that JSON as fixture data to see the footer working, or as a reference for your own API responses. Only `social.platform` values `LinkedIn`, `Instagram`, `TikTok`, and `YouTube` render an icon; items with missing or invalid fields are dropped.
|
|
23
|
-
|
|
24
|
-
## Using in Angular
|
|
25
|
-
|
|
26
|
-
Assumes Angular 17+ with **standalone** components (default for `ng new`).
|
|
27
|
-
|
|
28
|
-
### 1. Install
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npm i weg-shared-layout
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### 2. Register custom elements (once, before bootstrap)
|
|
35
|
-
|
|
36
|
-
In `src/main.ts`, call `defineCustomElements()` **before** `bootstrapApplication` so the browser recognises `<weg-footer>`.
|
|
37
|
-
|
|
38
|
-
```ts
|
|
39
|
-
import { bootstrapApplication } from '@angular/platform-browser';
|
|
40
|
-
import { defineCustomElements } from 'weg-shared-layout/loader';
|
|
41
|
-
|
|
42
|
-
import { appConfig } from './app/app.config';
|
|
43
|
-
import { App } from './app/app';
|
|
44
|
-
|
|
45
|
-
defineCustomElements();
|
|
46
|
-
|
|
47
|
-
bootstrapApplication(App, appConfig).catch((err) => console.error(err));
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### 3. Allow custom elements in templates
|
|
51
|
-
|
|
52
|
-
Add `schemas: [CUSTOM_ELEMENTS_SCHEMA]` to every `@Component` whose template uses `<weg-footer>` (it does not cascade from the root through `router-outlet` children).
|
|
53
|
-
|
|
54
|
-
### 4. Pass data with property binding
|
|
55
|
-
|
|
56
|
-
Use **`[data]="..."`** so Angular sets the element’s JavaScript `data` property (Stencil `@Prop()`), not an HTML attribute.
|
|
57
|
-
|
|
58
|
-
Example with the bundled sample payload:
|
|
59
|
-
|
|
60
|
-
```ts
|
|
61
|
-
// src/app/app.ts
|
|
62
|
-
import { Component, CUSTOM_ELEMENTS_SCHEMA, signal } from '@angular/core';
|
|
63
|
-
import { RouterOutlet } from '@angular/router';
|
|
64
|
-
import layoutFixture from 'weg-shared-layout/dummy-data.json';
|
|
65
|
-
|
|
66
|
-
@Component({
|
|
67
|
-
selector: 'app-root',
|
|
68
|
-
imports: [RouterOutlet],
|
|
69
|
-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
70
|
-
templateUrl: './app.html',
|
|
71
|
-
styleUrl: './app.css',
|
|
72
|
-
})
|
|
73
|
-
export class App {
|
|
74
|
-
protected readonly layoutData = signal(layoutFixture);
|
|
75
|
-
}
|
|
76
|
-
```
|
|
19
|
+
The payload shape matches **`dummy-data.json`**:
|
|
77
20
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<router-outlet />
|
|
81
|
-
<weg-footer [data]="layoutData()"></weg-footer>
|
|
82
|
-
```
|
|
21
|
+
- **From npm:** `import layout from 'weg-shared-layout/dummy-data.json'` (enable `resolveJsonModule` in TypeScript if needed).
|
|
22
|
+
- **In this repo:** [`src/assets/dummy-data.json`](src/assets/dummy-data.json)
|
|
83
23
|
|
|
84
|
-
|
|
24
|
+
Only `social.platform` values `LinkedIn`, `Instagram`, `TikTok`, and `YouTube` render an icon; items with missing or invalid fields are dropped.
|
|
85
25
|
|
|
86
|
-
|
|
26
|
+
## Framework guides
|
|
87
27
|
|
|
88
|
-
|
|
|
28
|
+
| Guide | Doc |
|
|
89
29
|
| --- | --- |
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
94
|
-
### TypeScript typings
|
|
95
|
-
|
|
96
|
-
```ts
|
|
97
|
-
/// <reference types="weg-shared-layout/dist/types/components" />
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Legacy `NgModule`
|
|
101
|
-
|
|
102
|
-
Add `CUSTOM_ELEMENTS_SCHEMA` once on the module that declares components using `<weg-footer>`. `defineCustomElements()` in `main.ts` is still required.
|
|
103
|
-
|
|
104
|
-
## Using in React
|
|
105
|
-
|
|
106
|
-
Register the element once (for example in `main.tsx` / your app entry):
|
|
107
|
-
|
|
108
|
-
```ts
|
|
109
|
-
import { defineCustomElements } from 'weg-shared-layout/loader';
|
|
110
|
-
|
|
111
|
-
defineCustomElements();
|
|
112
|
-
```
|
|
30
|
+
| Angular | [docs/angular.md](./docs/angular.md) |
|
|
31
|
+
| React | [docs/react.md](./docs/react.md) |
|
|
32
|
+
| Plain HTML / vanilla JS | [docs/vanilla.md](./docs/vanilla.md) |
|
|
113
33
|
|
|
114
|
-
|
|
34
|
+
## Publishing (maintainers)
|
|
115
35
|
|
|
116
|
-
|
|
117
|
-
import 'weg-shared-layout/weg-footer';
|
|
118
|
-
import layout from 'weg-shared-layout/dummy-data.json';
|
|
119
|
-
|
|
120
|
-
export function SiteFooter() {
|
|
121
|
-
return <weg-footer data={layout} />;
|
|
122
|
-
}
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Use **React 19 or newer** so `data={...}` is applied as the custom element’s **`data` property** (object), not a string attribute. Register the elements in a **Client Component** only (`"use client"` in the Next.js App Router).
|
|
126
|
-
|
|
127
|
-
### React TypeScript
|
|
128
|
-
|
|
129
|
-
```ts
|
|
130
|
-
/// <reference types="weg-shared-layout/dist/types/components" />
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
## Plain HTML / vanilla JS
|
|
134
|
-
|
|
135
|
-
With a bundler that resolves `node_modules` imports:
|
|
136
|
-
|
|
137
|
-
```html
|
|
138
|
-
<weg-footer id="footer"></weg-footer>
|
|
139
|
-
<script type="module">
|
|
140
|
-
import { defineCustomElements } from 'weg-shared-layout/loader';
|
|
141
|
-
import layout from 'weg-shared-layout/dummy-data.json';
|
|
142
|
-
|
|
143
|
-
defineCustomElements();
|
|
144
|
-
document.getElementById('footer').data = layout;
|
|
145
|
-
</script>
|
|
146
|
-
```
|
|
36
|
+
**`npm publish` does not run `npm run build` by itself** — it packs what is on disk. This package uses a **`prepack`** script so a full Stencil build runs before every `npm pack` / `npm publish`, avoiding incomplete tarballs.
|
|
147
37
|
|
|
148
|
-
|
|
38
|
+
Details, checklist, and CI notes: **[docs/publishing.md](./docs/publishing.md)**.
|