@pure-ds/core 0.7.38 → 0.7.40
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/custom-elements.json +77 -4
- package/dist/types/public/assets/pds/components/pds-icon.d.ts.map +1 -1
- package/dist/types/public/assets/pds/components/pds-locale.d.ts +10 -0
- package/dist/types/public/assets/pds/components/pds-locale.d.ts.map +1 -0
- package/dist/types/public/assets/pds/components/pds-omnibox.d.ts.map +1 -1
- package/dist/types/src/js/pds-autocomplete.d.ts +1 -1
- package/package.json +1 -1
- package/public/assets/js/app.js +1 -1
- package/public/assets/js/pds-autocomplete.js +4 -4
- package/public/assets/pds/components/pds-icon.js +9 -1
- package/public/assets/pds/components/pds-live-edit.js +10 -458
- package/public/assets/pds/components/pds-locale.js +1132 -0
- package/public/assets/pds/components/pds-omnibox.js +88 -8
- package/public/assets/pds/core/pds-autocomplete.js +4 -4
- package/public/assets/pds/vscode-custom-data.json +10 -0
- package/src/js/pds.js +2 -2
package/custom-elements.json
CHANGED
|
@@ -1405,7 +1405,6 @@
|
|
|
1405
1405
|
"type": {
|
|
1406
1406
|
"text": "string"
|
|
1407
1407
|
},
|
|
1408
|
-
"default": "\"Submit\"",
|
|
1409
1408
|
"attribute": "submit-label"
|
|
1410
1409
|
},
|
|
1411
1410
|
{
|
|
@@ -1415,7 +1414,6 @@
|
|
|
1415
1414
|
"type": {
|
|
1416
1415
|
"text": "string"
|
|
1417
1416
|
},
|
|
1418
|
-
"default": "\"Reset\"",
|
|
1419
1417
|
"attribute": "reset-label"
|
|
1420
1418
|
},
|
|
1421
1419
|
{
|
|
@@ -1543,7 +1541,6 @@
|
|
|
1543
1541
|
"type": {
|
|
1544
1542
|
"text": "string"
|
|
1545
1543
|
},
|
|
1546
|
-
"default": "\"Submit\"",
|
|
1547
1544
|
"fieldName": "submitLabel"
|
|
1548
1545
|
},
|
|
1549
1546
|
{
|
|
@@ -1551,7 +1548,6 @@
|
|
|
1551
1548
|
"type": {
|
|
1552
1549
|
"text": "string"
|
|
1553
1550
|
},
|
|
1554
|
-
"default": "\"Reset\"",
|
|
1555
1551
|
"fieldName": "resetLabel"
|
|
1556
1552
|
},
|
|
1557
1553
|
{
|
|
@@ -2812,6 +2808,83 @@
|
|
|
2812
2808
|
}
|
|
2813
2809
|
]
|
|
2814
2810
|
},
|
|
2811
|
+
{
|
|
2812
|
+
"kind": "javascript-module",
|
|
2813
|
+
"path": "public/assets/pds/components/pds-locale.js",
|
|
2814
|
+
"declarations": [
|
|
2815
|
+
{
|
|
2816
|
+
"kind": "class",
|
|
2817
|
+
"description": "Locale switcher component.\r\n\r\nThe component only persists canonical 5-letter locale tags (`xx-YY`),\r\nfor example `en-US` and `nl-NL`.",
|
|
2818
|
+
"name": "PdsLocale",
|
|
2819
|
+
"members": [
|
|
2820
|
+
{
|
|
2821
|
+
"kind": "method",
|
|
2822
|
+
"name": "whenReady",
|
|
2823
|
+
"description": "Resolves once the first availability check is complete.",
|
|
2824
|
+
"return": {
|
|
2825
|
+
"type": {
|
|
2826
|
+
"text": "Promise<boolean>"
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
},
|
|
2830
|
+
{
|
|
2831
|
+
"kind": "field",
|
|
2832
|
+
"name": "available",
|
|
2833
|
+
"description": "Whether locale switching is currently available.",
|
|
2834
|
+
"return": {
|
|
2835
|
+
"type": {
|
|
2836
|
+
"text": "boolean"
|
|
2837
|
+
}
|
|
2838
|
+
},
|
|
2839
|
+
"readonly": true
|
|
2840
|
+
},
|
|
2841
|
+
{
|
|
2842
|
+
"kind": "method",
|
|
2843
|
+
"name": "refresh",
|
|
2844
|
+
"description": "Re-detect available locales and re-render.",
|
|
2845
|
+
"return": {
|
|
2846
|
+
"type": {
|
|
2847
|
+
"text": "Promise<boolean>"
|
|
2848
|
+
}
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
],
|
|
2852
|
+
"events": [
|
|
2853
|
+
{
|
|
2854
|
+
"name": "pds-locale:ready",
|
|
2855
|
+
"type": {
|
|
2856
|
+
"text": "CustomEvent"
|
|
2857
|
+
},
|
|
2858
|
+
"description": "Emitted after locale availability is resolved."
|
|
2859
|
+
}
|
|
2860
|
+
],
|
|
2861
|
+
"attributes": [
|
|
2862
|
+
{
|
|
2863
|
+
"type": {
|
|
2864
|
+
"text": "string"
|
|
2865
|
+
},
|
|
2866
|
+
"description": "Accessible label for the locale radio group.",
|
|
2867
|
+
"name": "data-label"
|
|
2868
|
+
}
|
|
2869
|
+
],
|
|
2870
|
+
"superclass": {
|
|
2871
|
+
"name": "HTMLElement"
|
|
2872
|
+
},
|
|
2873
|
+
"tagName": "pds-locale",
|
|
2874
|
+
"customElement": true
|
|
2875
|
+
}
|
|
2876
|
+
],
|
|
2877
|
+
"exports": [
|
|
2878
|
+
{
|
|
2879
|
+
"kind": "custom-element-definition",
|
|
2880
|
+
"name": "pds-locale",
|
|
2881
|
+
"declaration": {
|
|
2882
|
+
"name": "PdsLocale",
|
|
2883
|
+
"module": "public/assets/pds/components/pds-locale.js"
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
]
|
|
2887
|
+
},
|
|
2815
2888
|
{
|
|
2816
2889
|
"kind": "javascript-module",
|
|
2817
2890
|
"path": "public/assets/pds/components/pds-omnibox.js",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-icon.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-icon.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;IACE,oCAAkF;IAClF,sDAAwC;IAGxC;;;;;;;;;;MAkBE;IAEF,qCAAkC;IAClC,oCAAiC;IAGjC,wCAAqC;IAErC,2CAAwC;IAExC,yCAA2C;IAE3C,2BAA6B;IAE7B,4CAA8B;IAO9B,oDA4CC;
|
|
1
|
+
{"version":3,"file":"pds-icon.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-icon.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;IACE,oCAAkF;IAClF,sDAAwC;IAGxC;;;;;;;;;;MAkBE;IAEF,qCAAkC;IAClC,oCAAiC;IAGjC,wCAAqC;IAErC,2CAAwC;IAExC,yCAA2C;IAE3C,2BAA6B;IAE7B,4CAA8B;IAO9B,oDA4CC;IAkeD;;;;OAIG;IACH,mCAWC;IAED;;;;OAIG;IACH,6CAOC;IAED;;;OAGG;IACH,qCAYC;IAED;;;;;OAKG;IACH,yCAOC;IAED;;;;;;OAMG;IACH,uCAEC;IAED;;;;;;OAMG;IACH,kCAUC;IAED;;;;OAIG;IACH,qCAOC;IAED;;;;OAIG;IACH,mCAHW,MAAM,kBACJ,OAAO,CAAC,OAAO,CAAC,CAgH5B;IAED,wDA8EC;IACD,+BAMC;IApxBC,kBAAwB;IACxB,kBAAwB;IACxB,mBAAsB;IACtB,iBAAuB;IACvB,wBAA2B;IAC3B,kBAAoB;IACpB,mBAAqB;IACrB,mBAAqB;IACrB,yBAA2B;IAC3B,yBAA2B;IAG7B,0BAIC;IAED,6BAGC;IAED,wEAmBC;IAED,eA6QC;IA0JD;;;;;OAKG;IACH,0BAFa,OAAO,CAInB;;CA0TF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pds-locale.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-locale.js"],"names":[],"mappings":";;;;;;;YAyec,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-omnibox.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-omnibox.js"],"names":[],"mappings":"AAuCA;IACE,+BAA6B;IAE7B,0CAUC;
|
|
1
|
+
{"version":3,"file":"pds-omnibox.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-omnibox.js"],"names":[],"mappings":"AAuCA;IACE,+BAA6B;IAE7B,0CAUC;IAyBD,0BAaC;IAED,6BAqBC;IAED,wEAGC;IAMD,yBAEC;IAND,oBAEC;IAUD,wBAGC;IAPD,mBAEC;IAWD,4BAGC;IAPD,uBAEC;IAWD,sBAIC;IARD,iBAEC;IAYD,6BAGC;IAPD,wBAEC;IAWD,6BAGC;IAPD,wBAEC;IAWD,gCAGC;IAPD,2BAEC;IAWD,wBAGC;IAPD,mBAEC;IAOD,+BAA2B;IAE3B,0CAGC;IAED,0BAEC;IAED,2CAEC;IAED,qBAEC;IAED,sBAEC;;CA64BF;;;;;cAhmCa,CAAC,OAAO,CAAC,KAAQ,KAAK,OAAO;;;;eAC7B,CAAC,OAAO,CAAC,KAAQ,KAAK,OAAO,CAAC,KAAK,KAAQ,CAAC,GAAC,KAAK,KAAQ;;;;aAC1D,CAAC,IAAI,CAAC,KAAQ,KAAK,GAAG;;;;sBACtB,OAAO;;;;gBACP,MAAM;;;;;;mBAKN,OAAO;;;;eACP,MAAM;;;;kBACN,CAAC,IAAI,CAAC,KAAQ,KAAK,CAAC,MAAM,GAAC,IAAI,CAAC;;;;sBAChC,OAAO"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { AutoComplete };
|
|
2
2
|
//# sourceMappingURL=pds-autocomplete.d.ts.map
|
package/package.json
CHANGED
package/public/assets/js/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var rt=Object.defineProperty;var it=(e,t)=>{for(var n in t)rt(e,n,{get:t[n],enumerable:!0})};var ae=class extends EventTarget{constructor(){super(),this.mode=null,this.compiled=null,this.log=()=>{},this.logHandler=null}},je="__PURE_DS_PDS_SINGLETON__",ce=typeof globalThis<"u"?globalThis:window,ie=ce?.[je],o=ie&&typeof ie.addEventListener=="function"?ie:new ae;ce&&(ce[je]=o);typeof o.log!="function"&&(o.log=(e="log",t,...n)=>{if(typeof console>"u")return;let s=typeof console[e]=="function"?console[e].bind(console):typeof console.log=="function"?console.log.bind(console):null;s&&(n.length>0?s(t,...n):s(t))});typeof o.logHandler!="function"&&(o.logHandler=null);var le=class{constructor(){this._mode="static",this._staticPaths={tokens:"/assets/pds/styles/pds-tokens.css.js",primitives:"/assets/pds/styles/pds-primitives.css.js",components:"/assets/pds/styles/pds-components.css.js",utilities:"/assets/pds/styles/pds-utilities.css.js",styles:"/assets/pds/styles/pds-styles.css.js"}}setLiveMode(){this._mode="live"}setStaticMode(t={}){this._mode="static",this._staticPaths={...this._staticPaths,...t}}async getStylesheet(t){if(this._mode==="live")return null;try{return(await import(this._staticPaths[t]))[t]}catch(n){o.log("error",`Registry: failed to load static ${t}:`,n),o.log("error",`Registry: looking for ${this._staticPaths[t]}`),o.log("error","Registry: make sure you've run 'npm run pds:build' and configured PDS.start() with the correct static.root path");let s=new CSSStyleSheet;return s.replaceSync("/* Failed to load "+t+" */"),s}}get mode(){return this._mode}get isLive(){return this._mode==="live"}},z=new le;async function Ae(e,t=[],n=null){try{let s=n?.primitivesStylesheet?n.primitivesStylesheet:await z.getStylesheet("primitives");e.adoptedStyleSheets=[s,...t]}catch(s){let a=e.host?.tagName?.toLowerCase()||"unknown";o.log("error",`Adopter: <${a}> failed to adopt primitives:`,s),e.adoptedStyleSheets=t}}async function Pe(e,t=["primitives"],n=[],s=null){let a=Array.isArray(n)?n.filter(Boolean):[];if(a.length){let l=(Array.isArray(e.adoptedStyleSheets)?e.adoptedStyleSheets:[]).filter(y=>!a.includes(y));e.adoptedStyleSheets=[...l,...a]}try{let l=(await Promise.all(t.map(async y=>{if(s)switch(y){case"tokens":return s.tokensStylesheet;case"primitives":return s.primitivesStylesheet;case"components":return s.componentsStylesheet;case"utilities":return s.utilitiesStylesheet;default:break}return z.getStylesheet(y)}))).filter(y=>y!==null);e.adoptedStyleSheets=[...l,...a]}catch(r){let l=e.host?.tagName?.toLowerCase()||"unknown";o.log("error",`Adopter: <${l}> failed to adopt layers:`,r),e.adoptedStyleSheets=a}}function ke(e){let t=new CSSStyleSheet;return t.replaceSync(e),t}var xe={FontWeights:{light:300,normal:400,medium:500,semibold:600,bold:700},LineHeights:{tight:1.25,normal:1.5,relaxed:1.75},BorderWidths:{hairline:.5,thin:1,medium:2,thick:3},RadiusSizes:{none:0,small:4,medium:8,large:16,xlarge:24,xxlarge:32},ShadowDepths:{none:"none",light:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",medium:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",deep:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",extreme:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},TransitionSpeeds:{fast:150,normal:250,slow:350},AnimationEasings:{linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},TouchTargetSizes:{compact:36,standard:44,comfortable:48,spacious:56},LinkStyles:{inline:"inline",block:"block",button:"button"},FocusStyles:{ring:"ring",outline:"outline",border:"border",glow:"glow"},TabSizes:{compact:2,standard:4,wide:8},SelectIcons:{chevron:"chevron",arrow:"arrow",caret:"caret",none:"none"},IconSizes:{xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64,"3xl":96}};var ue={};it(ue,{deepMerge:()=>Re,fragmentFromTemplateLike:()=>at,isObject:()=>B,parseHTML:()=>de});function B(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Re(e,t){let n={...e};return B(e)&&B(t)&&Object.keys(t).forEach(s=>{B(t[s])?s in e?n[s]=Re(e[s],t[s]):Object.assign(n,{[s]:t[s]}):Object.assign(n,{[s]:t[s]})}),n}function at(e){let t=Array.isArray(e?.strings)?e.strings:[],n=Array.isArray(e?.values)?e.values:[],s=new Set,a=[],r=/(\s)(\.[\w-]+)=\s*$/;for(let i=0;i<t.length;i+=1){let w=t[i]??"",m=w.match(r);if(m&&i<n.length){let S=m[2].slice(1),v=`pds-val-${i}`;w=w.replace(r,`$1data-pds-prop="${S}:${v}"`),s.add(i)}a.push(w),i<n.length&&!s.has(i)&&a.push(`<!--pds-val-${i}-->`)}let l=document.createElement("template");l.innerHTML=a.join("");let y=(i,w)=>{let m=i.parentNode;if(!m)return;if(w==null){m.removeChild(i);return}let _=S=>{if(S!=null){if(S instanceof Node){m.insertBefore(S,i);return}if(Array.isArray(S)){S.forEach(v=>_(v));return}m.insertBefore(document.createTextNode(String(S)),i)}};_(w),m.removeChild(i)},g=document.createTreeWalker(l.content,NodeFilter.SHOW_COMMENT),d=[];for(;g.nextNode();){let i=g.currentNode;i?.nodeValue?.startsWith("pds-val-")&&d.push(i)}return d.forEach(i=>{let w=Number(i.nodeValue.replace("pds-val-",""));y(i,n[w])}),l.content.querySelectorAll("*").forEach(i=>{let w=i.getAttribute("data-pds-prop");if(!w)return;let[m,_]=w.split(":"),S=Number(String(_).replace("pds-val-",""));m&&Number.isInteger(S)&&(i[m]=n[S]),i.removeAttribute("data-pds-prop")}),l.content}function de(e){return new DOMParser().parseFromString(e,"text/html").body.childNodes}var ze="pds",ct=/^([a-z][a-z0-9+\-.]*:)?\/\//i,De=/^[a-z]:/i;function N(e=""){return e.endsWith("/")?e:`${e}/`}function lt(e="",t=ze){let n=e.replace(/\/+$/,"");return new RegExp(`(?:^|/)${t}$`,"i").test(n)?n:`${n}/${t}`}function dt(e){return e.replace(/^\.\/+/,"")}function ut(e){return De.test(e)?e.replace(De,"").replace(/^\/+/,""):e}function pt(e){return e.startsWith("public/")?e.substring(7):e}function K(e,t={}){let n=t.segment||ze,s=t.defaultRoot||`/assets/${n}/`,a=e?.public&&e.public?.root||e?.static&&e.static?.root||null;if(!a||typeof a!="string")return N(s);let r=a.trim();return r?(r=r.replace(/\\/g,"/"),r=lt(r,n),r=N(r),ct.test(r)?r:(r=dt(r),r=ut(r),r.startsWith("/")||(r=pt(r),r.startsWith("/")||(r=`/${r}`),r=r.replace(/\/+/g,(l,y)=>y===0?l:"/")),N(r))):N(s)}async function ft(...e){let t={};e.length&&typeof e[e.length-1]=="object"&&(t=e.pop()||{});let n=e,{baseURL:s,mapper:a=d=>`${d}.js`,onError:r=(d,c)=>console.error(`[defineWebComponents] ${d}:`,c)}=t,l=s?new URL(s,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),y=d=>d.toLowerCase().replace(/(^|-)([a-z])/g,(c,i,w)=>w.toUpperCase()),g=async d=>{try{if(customElements.get(d))return{tag:d,status:"already-defined"};let c=a(d),w=await import(c instanceof URL?c.href:new URL(c,l).href),m=w?.default??w?.[y(d)];if(!m){if(customElements.get(d))return{tag:d,status:"self-defined"};throw new Error(`No export found for ${d}. Expected default export or named export "${y(d)}".`)}return customElements.get(d)?{tag:d,status:"race-already-defined"}:(customElements.define(d,m),{tag:d,status:"defined"})}catch(c){throw r(d,c),c}};return Promise.all(n.map(g))}var G=class{constructor(t={}){let{baseURL:n,mapper:s,onError:a,predicate:r=()=>!0,attributeModule:l="data-module",root:y=document,scanExisting:g=!0,debounceMs:d=16,observeShadows:c=!0,enhancers:i=[],patchAttachShadow:w=!0}=t,m=new Set,_=new Set,S=new Set,v=new Map,P=new WeakMap,E=new WeakMap,h=0,b=!1,k=null,H=u=>{if(!u||!i.length)return;let f=E.get(u);f||(f=new Set,E.set(u,f));for(let p of i)if(!(!p.selector||!p.run)&&!f.has(p.selector))try{u.matches&&u.matches(p.selector)&&(p.run(u),f.add(p.selector))}catch(j){console.warn(`[AutoDefiner] Error applying enhancer for selector "${p.selector}":`,j)}},M=(u,f)=>{if(!b&&!(!u||!u.includes("-"))&&!customElements.get(u)&&!_.has(u)&&!S.has(u)){if(f&&f.getAttribute){let p=f.getAttribute(l);p&&!v.has(u)&&v.set(u,p)}m.add(u),ot()}},ot=()=>{h||(h=setTimeout(_e,d))},R=u=>{if(u){if(u.nodeType===1){let f=u,p=f.tagName?.toLowerCase();p&&p.includes("-")&&!customElements.get(p)&&r(p,f)&&M(p,f),H(f),c&&f.shadowRoot&&re(f.shadowRoot)}u.querySelectorAll&&u.querySelectorAll("*").forEach(f=>{let p=f.tagName?.toLowerCase();p&&p.includes("-")&&!customElements.get(p)&&r(p,f)&&M(p,f),H(f),c&&f.shadowRoot&&re(f.shadowRoot)})}},re=u=>{if(!u||P.has(u))return;R(u);let f=new MutationObserver(p=>{for(let j of p)j.addedNodes?.forEach(D=>{R(D)}),j.type==="attributes"&&j.target&&R(j.target)});f.observe(u,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[l,...i.map(p=>p.selector).filter(p=>p.startsWith("data-"))]}),P.set(u,f)};async function _e(){if(clearTimeout(h),h=0,!m.size)return;let u=Array.from(m);m.clear(),u.forEach(f=>_.add(f));try{let f=p=>v.get(p)??(s?s(p):`${p}.js`);await ft(...u,{baseURL:n,mapper:f,onError:(p,j)=>{S.add(p),a?.(p,j)}})}catch{}finally{u.forEach(f=>_.delete(f))}}let Ee=y===document?document.documentElement:y,ve=new MutationObserver(u=>{for(let f of u)f.addedNodes?.forEach(p=>{R(p)}),f.type==="attributes"&&f.target&&R(f.target)});if(ve.observe(Ee,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[l,...i.map(u=>u.selector).filter(u=>u.startsWith("data-"))]}),c&&w&&Element.prototype.attachShadow){let u=Element.prototype.attachShadow;Element.prototype.attachShadow=function(p){let j=u.call(this,p);if(p&&p.mode==="open"){re(j);let D=this.tagName?.toLowerCase();D&&D.includes("-")&&!customElements.get(D)&&M(D,this)}return j},k=()=>Element.prototype.attachShadow=u}return g&&R(Ee),{stop(){b=!0,ve.disconnect(),k&&k(),h&&(clearTimeout(h),h=0),P.forEach(u=>u.disconnect())},flush:_e}}static async define(...t){let n={};t.length&&typeof t[t.length-1]=="object"&&(n=t.pop()||{});let s=t,{baseURL:a,mapper:r=c=>`${c}.js`,onError:l=(c,i)=>console.error(`[defineWebComponents] ${c}:`,i)}=n,y=a?new URL(a,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),g=c=>c.toLowerCase().replace(/(^|-)([a-z])/g,(i,w,m)=>m.toUpperCase()),d=async c=>{try{if(customElements.get(c))return{tag:c,status:"already-defined"};let i=r(c),m=await import(i instanceof URL?i.href:new URL(i,y).href),_=m?.default??m?.[g(c)];if(!_){if(customElements.get(c))return{tag:c,status:"self-defined"};throw new Error(`No export found for ${c}. Expected default export or named export "${g(c)}".`)}return customElements.get(c)?{tag:c,status:"race-already-defined"}:(customElements.define(c,_),{tag:c,status:"defined"})}catch(i){throw l(c,i),i}};return Promise.all(s.map(d))}};var mt=/^[a-z][a-z0-9+\-.]*:\/\//i,O=(()=>{try{return import.meta.url}catch{return}})(),q=e=>typeof e=="string"&&e.length&&!e.endsWith("/")?`${e}/`:e;function V(e,t={}){if(!e||mt.test(e))return e;let{preferModule:n=!0}=t,s=()=>{if(!O)return null;try{return new URL(e,O).href}catch{return null}},a=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(e,window.location.origin).href}catch{return null}};return(n?s()||a():a()||s())||e}var Te=(()=>{if(O)try{let e=new URL(O);if(/\/public\/assets\/js\//.test(e.pathname))return new URL("../pds/",O).href}catch{return}})(),Ce=!1;function Ue(e){Ce||typeof document>"u"||(Ce=!0,e.addEventListener("pds:ready",t=>{let n=t.detail?.mode;n&&document.documentElement.classList.add(`pds-${n}`,"pds-ready")}))}function Me({manageTheme:e,themeStorageKey:t,applyResolvedTheme:n,setupSystemListenerIfNeeded:s}){let a="light",r=null;if(e&&typeof window<"u"){try{r=localStorage.getItem(t)||null}catch{r=null}try{n?.(r),s?.(r)}catch{}r?r==="system"?a=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a=r:a=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:a,storedTheme:r}}function J(e,{resolvePublicAssetURL:t}){let n=!!(e?.public?.root||e?.static?.root),s=t(e);return!n&&Te&&(s=Te),q(V(s))}async function Ne(e,{baseEnhancers:t=[]}={}){let{autoDefineBaseURL:n="/auto-define/",autoDefinePreload:s=[],autoDefineMapper:a=null,enhancers:r=[],autoDefineOverrides:l=null,autoDefinePreferModule:y=!0}=e,g=(()=>{let c=new Map;return(t||[]).forEach(i=>c.set(i.selector,i)),(r||[]).forEach(i=>c.set(i.selector,i)),Array.from(c.values())})(),d=null;if(typeof window<"u"&&typeof document<"u"){let c=G,i=h=>{switch(h){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${h}.js`}},{mapper:w,enhancers:m,..._}=l&&typeof l=="object"?l:{},S=m?Array.isArray(m)?m:typeof m=="object"?Object.values(m):[]:[],v=(()=>{let h=new Map;return(g||[]).forEach(b=>{b?.selector&&h.set(b.selector,b)}),(S||[]).forEach(b=>{if(!b?.selector)return;let k=h.get(b.selector)||null;h.set(b.selector,{...k||{},...b,run:typeof b?.run=="function"?b.run:k?.run})}),Array.from(h.values())})(),E={baseURL:n&&q(V(n,{preferModule:y})),predefine:s,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:v,onError:(h,b)=>{if(typeof h=="string"&&h.startsWith("pds-")){let H=["pds-form","pds-drawer"].includes(h),M=b?.message?.includes("#pds/lit")||b?.message?.includes("Failed to resolve module specifier");H&&M?o.log("error",`\u274C PDS component <${h}> requires Lit but #pds/lit is not in import map.
|
|
2
|
-
See: https://github.com/Pure-Web-Foundation/pure-ds/blob/main/readme.md#lit-components-not-working`):o.log("warn",`\u26A0\uFE0F PDS component <${h}> not found. Assets may not be installed.`)}else o.log("error",`\u274C Auto-define error for <${h}>:`,b)},..._,mapper:h=>{if(customElements.get(h))return null;if(typeof a=="function")try{let b=a(h);return b===void 0?i(h):b}catch(b){return o.log("warn","Custom autoDefine.mapper error; falling back to default:",b?.message||b),i(h)}return i(h)}};d=new c(E),s.length>0&&typeof c.define=="function"&&await c.define(...s,{baseURL:n,mapper:E.mapper,onError:E.onError})}return{autoDefiner:d,mergedEnhancers:g}}var pe=["light","dark"],fe=new Set(pe);function ht(e){let n=(Array.isArray(e?.themes)?e.themes.map(s=>String(s).toLowerCase()):pe).filter(s=>fe.has(s));return n.length?n:pe}function me(e,{preferDocument:t=!0}={}){let n=String(e||"").toLowerCase();if(fe.has(n))return n;if(t&&typeof document<"u"){let s=document.documentElement?.getAttribute("data-theme");if(fe.has(s))return s}return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Oe(e,t){let n=me(t);return ht(e).includes(n)}var yt=new Set(["log","warn","error","debug","info"]),gt="__PURE_DS_PDS_SINGLETON__",he=null,ye=null;function Ie(){try{let t=(typeof globalThis<"u"?globalThis:window)?.[gt];if(t&&typeof t=="object")return t}catch{return null}return null}function bt(e){return!e||typeof e!="object"?null:{mode:e.mode==="live"||e.mode==="static"?e.mode:null,debug:e.debug===!0,thisArg:e.thisArg}}function wt(e){if(typeof e!="string")return"log";let t=e.toLowerCase();return yt.has(t)?t:"log"}function St(){if(typeof ye=="function")try{let t=bt(ye());if(t)return t}catch{}let e=Ie();if(e){let t=e?.mode||e?.compiled?.mode||(e?.registry?.isLive?"live":"static"),n=(e?.debug||e?.currentConfig?.debug||e?.currentConfig?.design?.debug||e?.compiled?.debug||e?.compiled?.design?.debug||!1)===!0;return{mode:t,debug:n,thisArg:e}}return{mode:null,debug:!1}}function Lt(){if(typeof he=="function")try{let t=he();if(typeof t=="function")return t}catch{}let e=Ie();return typeof e?.logHandler=="function"?e.logHandler:null}function $e(e,t,...n){if(typeof console>"u")return;let s=typeof console[e]=="function"?console[e].bind(console):typeof console.log=="function"?console.log.bind(console):null;s&&(n.length>0?s(t,...n):s(t))}function _t(e,t){let n=t?.debug===!0;return!(t?.mode==="static"&&!n||!n&&e!=="error"&&e!=="warn")}function Fe({getLogger:e,getContext:t}={}){he=typeof e=="function"?e:null,ye=typeof t=="function"?t:null}function We(e="log",t,...n){let s=wt(e),a=St(),r=Lt();if(r)try{r.call(a?.thisArg,s,t,...n);return}catch(l){$e("error","Custom log handler failed:",l)}_t(s,a)&&$e(s,t,...n)}typeof o.initializing!="boolean"&&(o.initializing=!1);"currentPreset"in o||(o.currentPreset=null);typeof o.debug!="boolean"&&(o.debug=!1);"currentConfig"in o||(o.currentConfig=null);"compiled"in o||(o.compiled=null);typeof o.logHandler!="function"&&(o.logHandler=null);"mode"in o||(o.mode=null);var Q=null,Y=null,Z=null,X=null,ee=null,te=null,Be="__pdsLocalizationRuntime";function T(){if(te)return te;let e=o?.[Be];return e&&typeof e=="object"?(te=e,e):null}function Et(e){let t=e&&typeof e=="object"?e:null;te=t,o[Be]=t}Fe({getLogger:()=>typeof o.logHandler=="function"?o.logHandler:null,getContext:()=>{let e=o?.mode||o?.compiled?.mode||(o?.registry?.isLive?"live":"static"),t=(o?.debug||o?.currentConfig?.debug||o?.currentConfig?.design?.debug||o?.compiled?.debug||o?.compiled?.design?.debug||!1)===!0;return{mode:e,debug:t,thisArg:o}}});o.log=(e="log",t,...n)=>{We(e,t,...n)};var L={locale:"en",messages:{},hasProvider:!1},ne=new Set;function Ke(e){return!!e&&typeof e!="string"&&typeof e=="object"&&"strTag"in e}function Ge(e=[]){let t="";for(let n=0;n<=e.length-1;n+=1)t+=e[n],n<e.length-1&&(t+=`{${n}}`);return t}function vt(e,t){return String(e).replace(/\{(\d+)\}/g,(n,s)=>t(Number(s)))}function jt(e){if(!e||typeof e!="object")return{};let t={};for(let[n,s]of Object.entries(e)){if(typeof s=="string"){t[n]=s;continue}s&&typeof s=="object"&&typeof s.content=="string"&&(t[n]=s.content)}return t}function At(e,...t){return{strTag:!0,strings:Array.from(e||[]),values:t,raw:Array.from(e?.raw||[])}}function Pt(e){if(!e)return"";if(Ke(e)){let n=Ge(e.strings||[]),s=L.messages[n]||n;return vt(s,a=>e.values?.[a])}let t=String(e);return L.messages[t]||t}function kt(e){if(!e)return;let t=Ke(e)?Ge(e.strings||[]):String(e);typeof t=="string"&&t.length>0&&ne.add(t)}function qe(e){if(!e||typeof e.msg!="function"||ne.size===0)return;let t=Array.from(ne);ne.clear();for(let n of t)try{e.msg(n)}catch{}}async function I(){let e=T();return e||(ee||(ee=import(F("pds-localization.js")).then(n=>{if(typeof n?.msg!="function"||typeof n?.str!="function"||typeof n?.configureLocalization!="function"||typeof n?.loadLocale!="function"||typeof n?.setLocale!="function"||typeof n?.getLocalizationState!="function")throw new Error("Failed to load localization runtime exports");return Et(n),qe(n),n}).catch(n=>{throw ee=null,n})),ee)}var C=(e,t={})=>{let n=T();return typeof n?.msg=="function"?n.msg(e,t):(kt(e),Pt(e,t))},oe=(e,...t)=>{let n=T();return typeof n?.str=="function"?n.str(e,...t):At(e,...t)},se=(e=null)=>{let t=T();if(typeof t?.configureLocalization=="function")return t.configureLocalization(e);if(!e||typeof e!="object")return L.locale="en",L.messages={},L.hasProvider=!1,{locale:L.locale,messages:{...L.messages},hasProvider:L.hasProvider};typeof e.locale=="string"&&e.locale.trim()&&(L.locale=e.locale.trim()),Object.prototype.hasOwnProperty.call(e,"messages")&&(L.messages=jt(e.messages));let n=!!(e.provider||e.translate||e.loadLocale||e.setLocale);return L.hasProvider=n,n&&I().then(s=>{s.configureLocalization(e),qe(s)}).catch(()=>{}),{locale:L.locale,messages:{...L.messages},hasProvider:L.hasProvider}},Ve=async e=>(await I()).loadLocale(e),Je=async(e,t={})=>(await I()).setLocale(e,t),Qe=()=>{let e=T();return typeof e?.getLocalizationState=="function"?e.getLocalizationState():{locale:L.locale,messages:{...L.messages},hasProvider:L.hasProvider}},Ye=(e={})=>{let t=T();if(typeof t?.createJSONLocalization=="function")return t.createJSONLocalization(e);let n=typeof e?.locale=="string"&&e.locale.trim()?e.locale.trim().toLowerCase():"en",s=Array.isArray(e?.locales)?e.locales.map(g=>String(g||"").trim().toLowerCase()).filter(Boolean):[],a=Array.from(new Set([n,...s])),r=null,l=async()=>(r||(r=I().then(g=>typeof g?.createJSONLocalization=="function"?g.createJSONLocalization(e):null).catch(()=>null)),r),y=async(g="loadLocale")=>{let d=await l();if(!d||typeof d!="object")return null;let c=d.provider;if(!c||typeof c!="object")return null;let i=c[g];return typeof i=="function"?i:g==="setLocale"&&typeof c.loadLocale=="function"?c.loadLocale:null};return{locale:n,locales:[...a],provider:{locales:[...a],async loadLocale(g={}){let d=await y("loadLocale");return typeof d!="function"?{}:d(g)},async setLocale(g={}){let d=await y("setLocale");return typeof d!="function"?{}:d(g)}}}};function F(e,t){return t&&typeof t=="string"?t:`${J(o.currentConfig||{},{resolvePublicAssetURL:K})}core/${e}`}async function xt(){return Array.isArray(o.defaultEnhancers)&&o.defaultEnhancers.length>0?o.defaultEnhancers:(X||(X=import(F("pds-enhancers.js",o.currentConfig?.enhancersURL)).then(t=>{let n=Array.isArray(t?.defaultPDSEnhancers)?t.defaultPDSEnhancers:[];return o.defaultEnhancers=n,n}).catch(t=>{throw X=null,t})),X)}async function Rt(){return typeof o.ask=="function"&&o.ask!==Ze?o.ask:(Y||(Y=import(F("pds-ask.js",o.currentConfig?.askURL)).then(t=>{let n=t?.ask;if(typeof n!="function")throw new Error("Failed to load ask helper");return o.ask=n,n}).catch(t=>{throw Y=null,t})),Y)}async function W(){return typeof o.toast=="function"&&o.toast!==U?o.toast:(Z||(Z=import(F("pds-toast.js",o.currentConfig?.toastURL)).then(t=>{let n=t?.toast;if(typeof n!="function")throw new Error("Failed to load toast helper");return o.toast=n,n}).catch(t=>{throw Z=null,t})),Z)}async function Ze(...e){return(await Rt())(...e)}async function U(...e){return(await W())(...e)}U.success=async(...e)=>(await W()).success(...e);U.error=async(...e)=>(await W()).error(...e);U.warning=async(...e)=>(await W()).warning(...e);U.info=async(...e)=>(await W()).info(...e);var He=function(e="log",t,...n){o.log(e,t,...n)};function be(e){if(e==null)return e;if(typeof e=="function")return;if(typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>be(n)).filter(n=>n!==void 0);let t={};for(let[n,s]of Object.entries(e)){let a=be(s);a!==void 0&&(t[n]=a)}return t}function Xe(e,t=new WeakSet){if(!e||typeof e!="object"||t.has(e))return e;t.add(e),Object.freeze(e);for(let n of Object.keys(e))Xe(e[n],t);return e}function we(e){return e==null||typeof e!="object"?e:Xe(structuredClone(be(e)))}async function Dt(e,t={}){if(t?.runtimeConfig===!1||typeof fetch!="function")return null;let n=t?.runtimeConfigURL||`${e}pds-runtime-config.json`;try{let s=await fetch(n,{cache:"no-store"});return s.ok?await s.json():null}catch{return null}}o.registry=z;o.enums=xe;o.adoptLayers=Pe;o.adoptPrimitives=Ae;o.parse=de;o.createStylesheet=ke;o.isLiveMode=()=>z.isLive;o.ask=Ze;o.toast=U;o.common=ue;o.msg=C;o.str=oe;o.configureLocalization=se;o.loadLocale=Ve;o.setLocale=Je;o.getLocalizationState=Qe;o.createJSONLocalization=Ye;o.i18n={msg:C,str:oe,configure:se,loadLocale:Ve,setLocale:Je,getState:Qe,createJSONLocalization:Ye};o.AutoComplete=null;o.loadAutoComplete=async()=>{if(o.AutoComplete&&typeof o.AutoComplete.connect=="function")return o.AutoComplete;let e=F("pds-autocomplete.js",o.currentConfig?.autoCompleteURL);return Q||(Q=import(e).then(t=>{let n=t?.AutoComplete||t?.default?.AutoComplete||t?.default||null;if(!n)throw new Error("AutoComplete export not found in module");return o.AutoComplete=n,n}).catch(t=>{throw Q=null,t})),Q};function et(e){let t=typeof CustomEvent=="function";try{let n=t?new CustomEvent("pds:ready",{detail:e}):new Event("pds:ready");o.dispatchEvent(n)}catch{}if(typeof document<"u")if(t){let n={detail:e,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:ready",n))}catch{}try{document.dispatchEvent(new CustomEvent("pds-ready",n))}catch{}}else{try{document.dispatchEvent(new Event("pds:ready"))}catch{}try{document.dispatchEvent(new Event("pds-ready"))}catch{}}}function tt(e={}){let t=typeof CustomEvent=="function",n={at:Date.now(),...e};try{let s=t?new CustomEvent("pds:config-changed",{detail:n}):new Event("pds:config-changed");o.dispatchEvent(s)}catch{}if(typeof document<"u")if(t){let s={detail:n,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:config-changed",s))}catch{}}else try{document.dispatchEvent(new Event("pds:config-changed"))}catch{}}var ge="pure-ds-theme",x=null,$=null;function Se(e){try{if(typeof document>"u")return;let t="light";e?e==="system"?t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t=e:t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",t)}catch{}}function Le(e){try{if(x&&$){try{typeof x.removeEventListener=="function"?x.removeEventListener("change",$):typeof x.removeListener=="function"&&x.removeListener($)}catch{}x=null,$=null}if(e==="system"&&typeof window<"u"&&window.matchMedia){let t=window.matchMedia("(prefers-color-scheme: dark)"),n=s=>{let a=s?.matches===void 0?t.matches:s.matches;try{let r=a?"dark":"light";document.documentElement.setAttribute("data-theme",r),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"system"}}))}catch{}};x=t,$=n,typeof t.addEventListener=="function"?t.addEventListener("change",n):typeof t.addListener=="function"&&t.addListener(n)}}catch{}}var zt=Object.getOwnPropertyDescriptor(o,"theme");zt||Object.defineProperty(o,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(ge)||null}catch{return null}},set(e){try{if(typeof window>"u")return;let t=o.currentConfig?.design||null,n=me(e);if(t&&!Oe(t,n)){let s=t?.name||o.currentPreset?.name||o.currentConfig?.preset||"current preset";o.log("warn",`PDS theme "${n}" not supported by preset "${s}".`),o.dispatchEvent(new CustomEvent("pds:theme:blocked",{detail:{theme:e,resolvedTheme:n,preset:s}}));return}e==null?localStorage.removeItem(ge):localStorage.setItem(ge,e),Se(e),Le(e),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:e,source:"api"}}))}catch{}}});o.defaultEnhancers=[];async function Tt(e){o.initializing=!0;try{let t=e&&e.mode||"live",{mode:n,...s}=e||{};o.mode=t,o.logHandler=typeof s?.log=="function"?s.log:null,o.currentConfig=we(s);let a=s&&typeof s.localization=="object"&&s.localization?s.localization:null;a?(await I(),se(a)):se(null);let r;if(t==="static")r=await Ct(s);else{let y=J(s,{resolvePublicAssetURL:K}),g=s?.managerURL||s?.public?.managerURL||s?.manager?.url||new URL("core/pds-manager.js",y).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:d}=await import(g);r=await d(o,s,{emitReady:et,emitConfigChanged:tt,applyResolvedTheme:Se,setupSystemListenerIfNeeded:Le})}o.compiled=we(r?.config||null);let l=o?.compiled?.design?.icons?.externalPath||"/assets/img/icons/";return o.log("info",`startup ready; external icon path: ${l}`),r}finally{o.initializing=!1}}o.start=Tt;async function Ct(e){if(!e||typeof e!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let t=e.applyGlobalStyles??!0,n=e.manageTheme??!0,s=e.themeStorageKey??"pure-ds-theme",a=e.staticPaths??{},r=J(e,{resolvePublicAssetURL:K}),l=e&&e.autoDefine||null,y;l&&l.baseURL?y=q(V(l.baseURL,{preferModule:!1})):y=`${r}components/`;let g=l&&Array.isArray(l.predefine)&&l.predefine||[],d=l&&typeof l.mapper=="function"&&l.mapper||null;try{Ue(o);let{resolvedTheme:c}=Me({manageTheme:n,themeStorageKey:s,applyResolvedTheme:Se,setupSystemListenerIfNeeded:Le}),i=await Dt(r,e),w=Array.isArray(e?.enhancers)?e.enhancers:e?.enhancers&&typeof e.enhancers=="object"?Object.values(e.enhancers):[],m=i?.config?{...i.config,...e,design:e?.design||i.config.design,preset:e?.preset||i.config.preset}:{...e},_={tokens:`${r}styles/pds-tokens.css.js`,primitives:`${r}styles/pds-primitives.css.js`,components:`${r}styles/pds-components.css.js`,utilities:`${r}styles/pds-utilities.css.js`,styles:`${r}styles/pds-styles.css.js`},S=i?.paths||{};if(a={..._,...S,...a},o.registry.setStaticMode(a),t&&typeof document<"u")try{let E=await o.registry.getStylesheet("styles");if(E){E._pds=!0;let h=(document.adoptedStyleSheets||[]).filter(b=>b._pds!==!0);document.adoptedStyleSheets=[...h,E],tt({mode:"static",source:"static:styles-applied"})}}catch(E){He.call(o,"warn","Failed to apply static styles:",E)}let v=null,P=[];try{let E=await xt(),h=await Ne({autoDefineBaseURL:y,autoDefinePreload:g,autoDefineMapper:d,enhancers:w,autoDefineOverrides:l||null,autoDefinePreferModule:!(l&&l.baseURL)},{baseEnhancers:E});v=h.autoDefiner,P=h.mergedEnhancers||[]}catch(E){He.call(o,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",E)}return o.compiled=we({mode:"static",...m,theme:c,enhancers:P}),et({mode:"static",config:m,theme:c,autoDefiner:v}),{config:m,theme:c,autoDefiner:v}}catch(c){throw o.dispatchEvent(new CustomEvent("pds:error",{detail:{error:c}})),c}}var Ut=o.createJSONLocalization({locale:"en-US",locales:["en-US","nl-NL"],aliases:{en:["en-US"],nl:["nl-NL"]},basePath:"/assets/locales"}),nt={mode:"live",liveEdit:!0,preset:"default",localization:Ut,autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(e,t,...n){(this?.mode||this?.compiled?.mode||"live")!=="static"&&(typeof console[e]=="function"?console[e]:console.log)(`[PDS] ${t}`,...n)}};var A={name:"@pure-ds/core",shortname:"pds",version:"0.7.38",description:"Why develop a Design System when you can generate one?",repository:{type:"git",url:"git+https://github.com/Pure-Web-Foundation/pure-ds.git"},bugs:{url:"https://github.com/Pure-Web-Foundation/pure-ds/issues"},homepage:"https://puredesignsystem.z6.web.core.windows.net/",keywords:["design-system","css","web-components","lit","constructable-stylesheets","tokens","utilities","a11y"],type:"module",main:"./public/assets/pds/core.js",module:"./public/assets/pds/core.js",types:"./dist/types/pds.d.ts",bin:{"pds-build":"packages/pds-cli/bin/pds-static.js","pds-sync-assets":"packages/pds-cli/bin/sync-assets.js","pds-build-icons":"packages/pds-cli/bin/pds-build-icons.js","pds-import":"packages/pds-cli/bin/pds-import.js","pds-setup-copilot":"packages/pds-cli/bin/pds-setup-copilot.js","pds-setup-mcp":"packages/pds-cli/bin/pds-setup-mcp.js","pds-init-config":"packages/pds-cli/bin/pds-init-config.js","pds-bootstrap":"packages/pds-cli/bin/pds-bootstrap.js","pds-mcp-server":"packages/pds-cli/bin/pds-mcp-server.js","pds-mcp-health":"packages/pds-cli/bin/pds-mcp-health.js","pds-mcp-eval":"packages/pds-cli/bin/pds-mcp-eval.js"},exports:{".":{types:"./src/js/pds.d.ts",import:"./public/assets/pds/core.js"},"./localization":{types:"./dist/types/src/js/pds-localization.d.ts",import:"./public/assets/pds/core/pds-localization.js"},"./lit":{types:"./dist/types/src/js/lit.d.ts",import:"./public/assets/pds/external/lit.js"},"./pds-core":"./src/js/pds.js","./auto-define/*":"./public/auto-define/*"},files:[".github/copilot-instructions.md",".cursorrules","dist/types/","public/assets/js/","public/assets/pds/components/","public/assets/pds/templates/","public/assets/pds/core.js","public/assets/pds/core/","public/assets/pds/external/","public/assets/pds/vscode-custom-data.json","public/assets/pds/pds.css-data.json","public/assets/pds/pds-css-complete.json","public/auto-define/","public/pds/components/","public/assets/pds/icons/pds-icons.svg","packages/pds-cli/bin/","packages/pds-cli/lib/","src/js/pds.d.ts","src/js/pds.js","src/js/pds-singleton.js","src/js/common/","src/js/pds-live-manager/","src/js/pds-core/","custom-elements.json","custom-elements-manifest.config.js","pds.html-data.json","pds.css-data.json","LOCALIZATION.md","readme.md","INTELLISENSE.md","CSS-INTELLISENSE-LIMITATION.md","CSS-INTELLISENSE-QUICK-REF.md"],scripts:{test:'echo "Error: no test specified" && exit 1',dev:"node esbuild-dev.js",prebuild:"npm run types",build:"node esbuild-build.js",types:"tsc -p tsconfig.json && node scripts/sync-types.mjs",postinstall:"node packages/pds-cli/bin/postinstall.mjs","prepds:build":"npm run types","pds:build":"node packages/pds-cli/bin/pds-static.js","pds:build-icons":"node packages/pds-cli/bin/pds-build-icons.js","pds:bootstrap":"node packages/pds-cli/bin/pds-bootstrap.js","pds:manifest":"node packages/pds-cli/bin/generate-manifest.js","pds:css-data":"node packages/pds-cli/bin/generate-css-data.js","pds:import":"node packages/pds-cli/bin/pds-import.js","pds:dx":"node packages/pds-cli/bin/pds-dx.js","pds:mcp:server":"node packages/pds-cli/bin/pds-mcp-server.js","pds:mcp:health":"node packages/pds-cli/bin/pds-mcp-health.js","pds:mcp:eval":"node packages/pds-cli/bin/pds-mcp-eval.js","storybook:generate":"cd packages/pds-storybook && npm run generate-stories","storybook:dev":"cd packages/pds-storybook && npm run storybook:dev","storybook:build":"cd packages/pds-storybook && npm run storybook:build"},author:"Marc van Neerven",license:"ISC",engines:{node:">=18"},publishConfig:{access:"public"},devDependencies:{"@custom-elements-manifest/analyzer":"^0.9.9","@types/node":"^22.10.2",esbuild:"^0.19.0","fs-extra":"^11.1.1",typescript:"^5.6.3"},dependencies:{lit:"^3.3.2","pure-web":"1.1.32"},customElements:"custom-elements.json"};await o.start(nt);document.documentElement.lang="en";var st=typeof A.repository=="string"?A.repository:A.repository?.url,Nt=st?st.replace(/^git\+/,"").replace(/\.git$/,""):"",hn=A.homepage||Nt,yn=A.bugs?.url||"";document.body.innerHTML=`
|
|
2
|
+
See: https://github.com/Pure-Web-Foundation/pure-ds/blob/main/readme.md#lit-components-not-working`):o.log("warn",`\u26A0\uFE0F PDS component <${h}> not found. Assets may not be installed.`)}else o.log("error",`\u274C Auto-define error for <${h}>:`,b)},..._,mapper:h=>{if(customElements.get(h))return null;if(typeof a=="function")try{let b=a(h);return b===void 0?i(h):b}catch(b){return o.log("warn","Custom autoDefine.mapper error; falling back to default:",b?.message||b),i(h)}return i(h)}};d=new c(E),s.length>0&&typeof c.define=="function"&&await c.define(...s,{baseURL:n,mapper:E.mapper,onError:E.onError})}return{autoDefiner:d,mergedEnhancers:g}}var pe=["light","dark"],fe=new Set(pe);function ht(e){let n=(Array.isArray(e?.themes)?e.themes.map(s=>String(s).toLowerCase()):pe).filter(s=>fe.has(s));return n.length?n:pe}function me(e,{preferDocument:t=!0}={}){let n=String(e||"").toLowerCase();if(fe.has(n))return n;if(t&&typeof document<"u"){let s=document.documentElement?.getAttribute("data-theme");if(fe.has(s))return s}return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Oe(e,t){let n=me(t);return ht(e).includes(n)}var yt=new Set(["log","warn","error","debug","info"]),gt="__PURE_DS_PDS_SINGLETON__",he=null,ye=null;function Ie(){try{let t=(typeof globalThis<"u"?globalThis:window)?.[gt];if(t&&typeof t=="object")return t}catch{return null}return null}function bt(e){return!e||typeof e!="object"?null:{mode:e.mode==="live"||e.mode==="static"?e.mode:null,debug:e.debug===!0,thisArg:e.thisArg}}function wt(e){if(typeof e!="string")return"log";let t=e.toLowerCase();return yt.has(t)?t:"log"}function St(){if(typeof ye=="function")try{let t=bt(ye());if(t)return t}catch{}let e=Ie();if(e){let t=e?.mode||e?.compiled?.mode||(e?.registry?.isLive?"live":"static"),n=(e?.debug||e?.currentConfig?.debug||e?.currentConfig?.design?.debug||e?.compiled?.debug||e?.compiled?.design?.debug||!1)===!0;return{mode:t,debug:n,thisArg:e}}return{mode:null,debug:!1}}function Lt(){if(typeof he=="function")try{let t=he();if(typeof t=="function")return t}catch{}let e=Ie();return typeof e?.logHandler=="function"?e.logHandler:null}function $e(e,t,...n){if(typeof console>"u")return;let s=typeof console[e]=="function"?console[e].bind(console):typeof console.log=="function"?console.log.bind(console):null;s&&(n.length>0?s(t,...n):s(t))}function _t(e,t){let n=t?.debug===!0;return!(t?.mode==="static"&&!n||!n&&e!=="error"&&e!=="warn")}function Fe({getLogger:e,getContext:t}={}){he=typeof e=="function"?e:null,ye=typeof t=="function"?t:null}function We(e="log",t,...n){let s=wt(e),a=St(),r=Lt();if(r)try{r.call(a?.thisArg,s,t,...n);return}catch(l){$e("error","Custom log handler failed:",l)}_t(s,a)&&$e(s,t,...n)}typeof o.initializing!="boolean"&&(o.initializing=!1);"currentPreset"in o||(o.currentPreset=null);typeof o.debug!="boolean"&&(o.debug=!1);"currentConfig"in o||(o.currentConfig=null);"compiled"in o||(o.compiled=null);typeof o.logHandler!="function"&&(o.logHandler=null);"mode"in o||(o.mode=null);var Q=null,Y=null,Z=null,X=null,ee=null,te=null,Be="__pdsLocalizationRuntime";function T(){if(te)return te;let e=o?.[Be];return e&&typeof e=="object"?(te=e,e):null}function Et(e){let t=e&&typeof e=="object"?e:null;te=t,o[Be]=t}Fe({getLogger:()=>typeof o.logHandler=="function"?o.logHandler:null,getContext:()=>{let e=o?.mode||o?.compiled?.mode||(o?.registry?.isLive?"live":"static"),t=(o?.debug||o?.currentConfig?.debug||o?.currentConfig?.design?.debug||o?.compiled?.debug||o?.compiled?.design?.debug||!1)===!0;return{mode:e,debug:t,thisArg:o}}});o.log=(e="log",t,...n)=>{We(e,t,...n)};var L={locale:"en",messages:{},hasProvider:!1},ne=new Set;function Ke(e){return!!e&&typeof e!="string"&&typeof e=="object"&&"strTag"in e}function Ge(e=[]){let t="";for(let n=0;n<=e.length-1;n+=1)t+=e[n],n<e.length-1&&(t+=`{${n}}`);return t}function vt(e,t){return String(e).replace(/\{(\d+)\}/g,(n,s)=>t(Number(s)))}function jt(e){if(!e||typeof e!="object")return{};let t={};for(let[n,s]of Object.entries(e)){if(typeof s=="string"){t[n]=s;continue}s&&typeof s=="object"&&typeof s.content=="string"&&(t[n]=s.content)}return t}function At(e,...t){return{strTag:!0,strings:Array.from(e||[]),values:t,raw:Array.from(e?.raw||[])}}function Pt(e){if(!e)return"";if(Ke(e)){let n=Ge(e.strings||[]),s=L.messages[n]||n;return vt(s,a=>e.values?.[a])}let t=String(e);return L.messages[t]||t}function kt(e){if(!e)return;let t=Ke(e)?Ge(e.strings||[]):String(e);typeof t=="string"&&t.length>0&&ne.add(t)}function qe(e){if(!e||typeof e.msg!="function"||ne.size===0)return;let t=Array.from(ne);ne.clear();for(let n of t)try{e.msg(n)}catch{}}async function I(){let e=T();return e||(ee||(ee=import(F("pds-localization.js")).then(n=>{if(typeof n?.msg!="function"||typeof n?.str!="function"||typeof n?.configureLocalization!="function"||typeof n?.loadLocale!="function"||typeof n?.setLocale!="function"||typeof n?.getLocalizationState!="function")throw new Error("Failed to load localization runtime exports");return Et(n),qe(n),n}).catch(n=>{throw ee=null,n})),ee)}var C=(e,t={})=>{let n=T();return typeof n?.msg=="function"?n.msg(e,t):(kt(e),Pt(e,t))},oe=(e,...t)=>{let n=T();return typeof n?.str=="function"?n.str(e,...t):At(e,...t)},se=(e=null)=>{let t=T();if(typeof t?.configureLocalization=="function")return t.configureLocalization(e);if(!e||typeof e!="object")return L.locale="en",L.messages={},L.hasProvider=!1,{locale:L.locale,messages:{...L.messages},hasProvider:L.hasProvider};typeof e.locale=="string"&&e.locale.trim()&&(L.locale=e.locale.trim()),Object.prototype.hasOwnProperty.call(e,"messages")&&(L.messages=jt(e.messages));let n=!!(e.provider||e.translate||e.loadLocale||e.setLocale);return L.hasProvider=n,n&&I().then(s=>{s.configureLocalization(e),qe(s)}).catch(()=>{}),{locale:L.locale,messages:{...L.messages},hasProvider:L.hasProvider}},Ve=async e=>(await I()).loadLocale(e),Je=async(e,t={})=>(await I()).setLocale(e,t),Qe=()=>{let e=T();return typeof e?.getLocalizationState=="function"?e.getLocalizationState():{locale:L.locale,messages:{...L.messages},hasProvider:L.hasProvider}},Ye=(e={})=>{let t=T();if(typeof t?.createJSONLocalization=="function")return t.createJSONLocalization(e);let n=typeof e?.locale=="string"&&e.locale.trim()?e.locale.trim().toLowerCase():"en",s=Array.isArray(e?.locales)?e.locales.map(g=>String(g||"").trim().toLowerCase()).filter(Boolean):[],a=Array.from(new Set([n,...s])),r=null,l=async()=>(r||(r=I().then(g=>typeof g?.createJSONLocalization=="function"?g.createJSONLocalization(e):null).catch(()=>null)),r),y=async(g="loadLocale")=>{let d=await l();if(!d||typeof d!="object")return null;let c=d.provider;if(!c||typeof c!="object")return null;let i=c[g];return typeof i=="function"?i:g==="setLocale"&&typeof c.loadLocale=="function"?c.loadLocale:null};return{locale:n,locales:[...a],provider:{locales:[...a],async loadLocale(g={}){let d=await y("loadLocale");return typeof d!="function"?{}:d(g)},async setLocale(g={}){let d=await y("setLocale");return typeof d!="function"?{}:d(g)}}}};function F(e,t){return t&&typeof t=="string"?t:`${J(o.currentConfig||{},{resolvePublicAssetURL:K})}core/${e}`}async function xt(){return Array.isArray(o.defaultEnhancers)&&o.defaultEnhancers.length>0?o.defaultEnhancers:(X||(X=import(F("pds-enhancers.js",o.currentConfig?.enhancersURL)).then(t=>{let n=Array.isArray(t?.defaultPDSEnhancers)?t.defaultPDSEnhancers:[];return o.defaultEnhancers=n,n}).catch(t=>{throw X=null,t})),X)}async function Rt(){return typeof o.ask=="function"&&o.ask!==Ze?o.ask:(Y||(Y=import(F("pds-ask.js",o.currentConfig?.askURL)).then(t=>{let n=t?.ask;if(typeof n!="function")throw new Error("Failed to load ask helper");return o.ask=n,n}).catch(t=>{throw Y=null,t})),Y)}async function W(){return typeof o.toast=="function"&&o.toast!==U?o.toast:(Z||(Z=import(F("pds-toast.js",o.currentConfig?.toastURL)).then(t=>{let n=t?.toast;if(typeof n!="function")throw new Error("Failed to load toast helper");return o.toast=n,n}).catch(t=>{throw Z=null,t})),Z)}async function Ze(...e){return(await Rt())(...e)}async function U(...e){return(await W())(...e)}U.success=async(...e)=>(await W()).success(...e);U.error=async(...e)=>(await W()).error(...e);U.warning=async(...e)=>(await W()).warning(...e);U.info=async(...e)=>(await W()).info(...e);var He=function(e="log",t,...n){o.log(e,t,...n)};function be(e){if(e==null)return e;if(typeof e=="function")return;if(typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>be(n)).filter(n=>n!==void 0);let t={};for(let[n,s]of Object.entries(e)){let a=be(s);a!==void 0&&(t[n]=a)}return t}function Xe(e,t=new WeakSet){if(!e||typeof e!="object"||t.has(e))return e;t.add(e),Object.freeze(e);for(let n of Object.keys(e))Xe(e[n],t);return e}function we(e){return e==null||typeof e!="object"?e:Xe(structuredClone(be(e)))}async function Dt(e,t={}){if(t?.runtimeConfig===!1||typeof fetch!="function")return null;let n=t?.runtimeConfigURL||`${e}pds-runtime-config.json`;try{let s=await fetch(n,{cache:"no-store"});return s.ok?await s.json():null}catch{return null}}o.registry=z;o.enums=xe;o.adoptLayers=Pe;o.adoptPrimitives=Ae;o.parse=de;o.createStylesheet=ke;o.isLiveMode=()=>z.isLive;o.ask=Ze;o.toast=U;o.common=ue;o.msg=C;o.str=oe;o.configureLocalization=se;o.loadLocale=Ve;o.setLocale=Je;o.getLocalizationState=Qe;o.createJSONLocalization=Ye;o.i18n={msg:C,str:oe,configure:se,loadLocale:Ve,setLocale:Je,getState:Qe,createJSONLocalization:Ye};o.AutoComplete=null;o.loadAutoComplete=async()=>{if(o.AutoComplete&&typeof o.AutoComplete.connect=="function")return o.AutoComplete;let e=F("pds-autocomplete.js",o.currentConfig?.autoCompleteURL);return Q||(Q=import(e).then(t=>{let n=t?.AutoComplete||t?.default?.AutoComplete||t?.default||null;if(!n)throw new Error("AutoComplete export not found in module");return o.AutoComplete=n,n}).catch(t=>{throw Q=null,t})),Q};function et(e){let t=typeof CustomEvent=="function";try{let n=t?new CustomEvent("pds:ready",{detail:e}):new Event("pds:ready");o.dispatchEvent(n)}catch{}if(typeof document<"u")if(t){let n={detail:e,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:ready",n))}catch{}try{document.dispatchEvent(new CustomEvent("pds-ready",n))}catch{}}else{try{document.dispatchEvent(new Event("pds:ready"))}catch{}try{document.dispatchEvent(new Event("pds-ready"))}catch{}}}function tt(e={}){let t=typeof CustomEvent=="function",n={at:Date.now(),...e};try{let s=t?new CustomEvent("pds:config-changed",{detail:n}):new Event("pds:config-changed");o.dispatchEvent(s)}catch{}if(typeof document<"u")if(t){let s={detail:n,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:config-changed",s))}catch{}}else try{document.dispatchEvent(new Event("pds:config-changed"))}catch{}}var ge="pure-ds-theme",x=null,$=null;function Se(e){try{if(typeof document>"u")return;let t="light";e?e==="system"?t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t=e:t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",t)}catch{}}function Le(e){try{if(x&&$){try{typeof x.removeEventListener=="function"?x.removeEventListener("change",$):typeof x.removeListener=="function"&&x.removeListener($)}catch{}x=null,$=null}if(e==="system"&&typeof window<"u"&&window.matchMedia){let t=window.matchMedia("(prefers-color-scheme: dark)"),n=s=>{let a=s?.matches===void 0?t.matches:s.matches;try{let r=a?"dark":"light";document.documentElement.setAttribute("data-theme",r),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"system"}}))}catch{}};x=t,$=n,typeof t.addEventListener=="function"?t.addEventListener("change",n):typeof t.addListener=="function"&&t.addListener(n)}}catch{}}var zt=Object.getOwnPropertyDescriptor(o,"theme");zt||Object.defineProperty(o,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(ge)||null}catch{return null}},set(e){try{if(typeof window>"u")return;let t=o.currentConfig?.design||null,n=me(e);if(t&&!Oe(t,n)){let s=t?.name||o.currentPreset?.name||o.currentConfig?.preset||"current preset";o.log("warn",`PDS theme "${n}" not supported by preset "${s}".`),o.dispatchEvent(new CustomEvent("pds:theme:blocked",{detail:{theme:e,resolvedTheme:n,preset:s}}));return}e==null?localStorage.removeItem(ge):localStorage.setItem(ge,e),Se(e),Le(e),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:e,source:"api"}}))}catch{}}});o.defaultEnhancers=[];async function Tt(e){o.initializing=!0;try{let t=e&&e.mode||"live",{mode:n,...s}=e||{};o.mode=t,o.logHandler=typeof s?.log=="function"?s.log:null,o.currentConfig=we(s);let a=s&&typeof s.localization=="object"&&s.localization?s.localization:null;a?(await I(),se(a)):se(null);let r;if(t==="static")r=await Ct(s);else{let y=J(s,{resolvePublicAssetURL:K}),g=s?.managerURL||s?.public?.managerURL||s?.manager?.url||new URL("core/pds-manager.js",y).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:d}=await import(g);r=await d(o,s,{emitReady:et,emitConfigChanged:tt,applyResolvedTheme:Se,setupSystemListenerIfNeeded:Le})}o.compiled=we(r?.config||null);let l=o?.compiled?.design?.icons?.externalPath||"/assets/img/icons/";return o.log("info",`startup ready; external icon path: ${l}`),r}finally{o.initializing=!1}}o.start=Tt;async function Ct(e){if(!e||typeof e!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let t=e.applyGlobalStyles??!0,n=e.manageTheme??!0,s=e.themeStorageKey??"pure-ds-theme",a=e.staticPaths??{},r=J(e,{resolvePublicAssetURL:K}),l=e&&e.autoDefine||null,y;l&&l.baseURL?y=q(V(l.baseURL,{preferModule:!1})):y=`${r}components/`;let g=l&&Array.isArray(l.predefine)&&l.predefine||[],d=l&&typeof l.mapper=="function"&&l.mapper||null;try{Ue(o);let{resolvedTheme:c}=Me({manageTheme:n,themeStorageKey:s,applyResolvedTheme:Se,setupSystemListenerIfNeeded:Le}),i=await Dt(r,e),w=Array.isArray(e?.enhancers)?e.enhancers:e?.enhancers&&typeof e.enhancers=="object"?Object.values(e.enhancers):[],m=i?.config?{...i.config,...e,design:e?.design||i.config.design,preset:e?.preset||i.config.preset}:{...e},_={tokens:`${r}styles/pds-tokens.css.js`,primitives:`${r}styles/pds-primitives.css.js`,components:`${r}styles/pds-components.css.js`,utilities:`${r}styles/pds-utilities.css.js`,styles:`${r}styles/pds-styles.css.js`},S=i?.paths||{};if(a={..._,...S,...a},o.registry.setStaticMode(a),t&&typeof document<"u")try{let E=await o.registry.getStylesheet("styles");if(E){E._pds=!0;let h=(document.adoptedStyleSheets||[]).filter(b=>b._pds!==!0);document.adoptedStyleSheets=[...h,E],tt({mode:"static",source:"static:styles-applied"})}}catch(E){He.call(o,"warn","Failed to apply static styles:",E)}let v=null,P=[];try{let E=await xt(),h=await Ne({autoDefineBaseURL:y,autoDefinePreload:g,autoDefineMapper:d,enhancers:w,autoDefineOverrides:l||null,autoDefinePreferModule:!(l&&l.baseURL)},{baseEnhancers:E});v=h.autoDefiner,P=h.mergedEnhancers||[]}catch(E){He.call(o,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",E)}return o.compiled=we({mode:"static",...m,theme:c,enhancers:P}),et({mode:"static",config:m,theme:c,autoDefiner:v}),{config:m,theme:c,autoDefiner:v}}catch(c){throw o.dispatchEvent(new CustomEvent("pds:error",{detail:{error:c}})),c}}var Ut=o.createJSONLocalization({locale:"en-US",locales:["en-US","nl-NL"],aliases:{en:["en-US"],nl:["nl-NL"]},basePath:"/assets/locales"}),nt={mode:"live",liveEdit:!0,preset:"default",localization:Ut,autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(e,t,...n){(this?.mode||this?.compiled?.mode||"live")!=="static"&&(typeof console[e]=="function"?console[e]:console.log)(`[PDS] ${t}`,...n)}};var A={name:"@pure-ds/core",shortname:"pds",version:"0.7.40",description:"Why develop a Design System when you can generate one?",repository:{type:"git",url:"git+https://github.com/Pure-Web-Foundation/pure-ds.git"},bugs:{url:"https://github.com/Pure-Web-Foundation/pure-ds/issues"},homepage:"https://puredesignsystem.z6.web.core.windows.net/",keywords:["design-system","css","web-components","lit","constructable-stylesheets","tokens","utilities","a11y"],type:"module",main:"./public/assets/pds/core.js",module:"./public/assets/pds/core.js",types:"./dist/types/pds.d.ts",bin:{"pds-build":"packages/pds-cli/bin/pds-static.js","pds-sync-assets":"packages/pds-cli/bin/sync-assets.js","pds-build-icons":"packages/pds-cli/bin/pds-build-icons.js","pds-import":"packages/pds-cli/bin/pds-import.js","pds-setup-copilot":"packages/pds-cli/bin/pds-setup-copilot.js","pds-setup-mcp":"packages/pds-cli/bin/pds-setup-mcp.js","pds-init-config":"packages/pds-cli/bin/pds-init-config.js","pds-bootstrap":"packages/pds-cli/bin/pds-bootstrap.js","pds-mcp-server":"packages/pds-cli/bin/pds-mcp-server.js","pds-mcp-health":"packages/pds-cli/bin/pds-mcp-health.js","pds-mcp-eval":"packages/pds-cli/bin/pds-mcp-eval.js"},exports:{".":{types:"./src/js/pds.d.ts",import:"./public/assets/pds/core.js"},"./localization":{types:"./dist/types/src/js/pds-localization.d.ts",import:"./public/assets/pds/core/pds-localization.js"},"./lit":{types:"./dist/types/src/js/lit.d.ts",import:"./public/assets/pds/external/lit.js"},"./pds-core":"./src/js/pds.js","./auto-define/*":"./public/auto-define/*"},files:[".github/copilot-instructions.md",".cursorrules","dist/types/","public/assets/js/","public/assets/pds/components/","public/assets/pds/templates/","public/assets/pds/core.js","public/assets/pds/core/","public/assets/pds/external/","public/assets/pds/vscode-custom-data.json","public/assets/pds/pds.css-data.json","public/assets/pds/pds-css-complete.json","public/auto-define/","public/pds/components/","public/assets/pds/icons/pds-icons.svg","packages/pds-cli/bin/","packages/pds-cli/lib/","src/js/pds.d.ts","src/js/pds.js","src/js/pds-singleton.js","src/js/common/","src/js/pds-live-manager/","src/js/pds-core/","custom-elements.json","custom-elements-manifest.config.js","pds.html-data.json","pds.css-data.json","LOCALIZATION.md","readme.md","INTELLISENSE.md","CSS-INTELLISENSE-LIMITATION.md","CSS-INTELLISENSE-QUICK-REF.md"],scripts:{test:'echo "Error: no test specified" && exit 1',dev:"node esbuild-dev.js",prebuild:"npm run types",build:"node esbuild-build.js",types:"tsc -p tsconfig.json && node scripts/sync-types.mjs",postinstall:"node packages/pds-cli/bin/postinstall.mjs","prepds:build":"npm run types","pds:build":"node packages/pds-cli/bin/pds-static.js","pds:build-icons":"node packages/pds-cli/bin/pds-build-icons.js","pds:bootstrap":"node packages/pds-cli/bin/pds-bootstrap.js","pds:manifest":"node packages/pds-cli/bin/generate-manifest.js","pds:css-data":"node packages/pds-cli/bin/generate-css-data.js","pds:import":"node packages/pds-cli/bin/pds-import.js","pds:dx":"node packages/pds-cli/bin/pds-dx.js","pds:mcp:server":"node packages/pds-cli/bin/pds-mcp-server.js","pds:mcp:health":"node packages/pds-cli/bin/pds-mcp-health.js","pds:mcp:eval":"node packages/pds-cli/bin/pds-mcp-eval.js","storybook:generate":"cd packages/pds-storybook && npm run generate-stories","storybook:dev":"cd packages/pds-storybook && npm run storybook:dev","storybook:build":"cd packages/pds-storybook && npm run storybook:build"},author:"Marc van Neerven",license:"ISC",engines:{node:">=18"},publishConfig:{access:"public"},devDependencies:{"@custom-elements-manifest/analyzer":"^0.9.9","@types/node":"^22.10.2",esbuild:"^0.19.0","fs-extra":"^11.1.1",typescript:"^5.6.3"},dependencies:{lit:"^3.3.2","pure-web":"1.1.32"},customElements:"custom-elements.json"};await o.start(nt);document.documentElement.lang="en";var st=typeof A.repository=="string"?A.repository:A.repository?.url,Nt=st?st.replace(/^git\+/,"").replace(/\.git$/,""):"",hn=A.homepage||Nt,yn=A.bugs?.url||"";document.body.innerHTML=`
|
|
3
3
|
<div class="container text-center">
|
|
4
4
|
<img src="/assets/img/pds-logo.svg" alt="PDS Logo" title="${C("PDS Logo")}" width="64" height="64" />
|
|
5
5
|
<header class="container section">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
function
|
|
2
|
-
`)!==-1||
|
|
3
|
-
<div title="${n.tooltip||""}" data-index="${s}" class="${`${
|
|
1
|
+
function w(c){return new DOMParser().parseFromString(c,"text/html").body.childNodes}function v(c,t=100){let e;return function(...i){let r=()=>{clearTimeout(e),c(...i)};clearTimeout(e),e=setTimeout(r,t)}}function m(c){setTimeout(c,0)}function I(c){try{if(typeof c!="string"||c.indexOf(`
|
|
2
|
+
`)!==-1||c.indexOf(" ")!==-1||c.startsWith("#/"))return!1;let t=new URL(c,window.location.origin);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function A(c,t,e){let s=window.screen.width/2-t/2,i=window.screen.height/2-e/2;return window.open(c,"",`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=${t}, height=${e}, top=${i}, left=${s}`)}var y={result:"ac-suggestion",item:"ac-itm"},p=class c extends EventTarget{constructor(t,e,s){super(),this.settings={emptyResultsText:"",...s},this.container=t,this.input=e,this.input.setAttribute("autocomplete","off"),this.categories=s.categories||{},this.caches=new Map,m(this.attach.bind(this))}static connect(t,e){let s=t.target;if(!s._autoComplete){if(!e?.categories)throw Error("Missing autocomplete settings");s._autoComplete=new c(s.parentNode,s,e),t.type==="focus"&&setTimeout(()=>{s._autoComplete.focusHandler(t)},100)}return s._autoComplete}on(t,e){return this.input.addEventListener(t,e),this}attach(){this.resultsDiv=document.createElement("div"),this.resultsDiv.title="",this.resultsDiv.classList.add(y.result),this.container.offsetWidth>100&&(this.resultsDiv.style.width=this.container.offsetWidth),this.resultsDiv.addEventListener("mousedown",this.resultClick.bind(this)),this.container.classList.add("ac-container"),this.input.classList.add("ac-input");let t=getComputedStyle(this.input);this.container.style.setProperty("--ac-bg-default",t.backgroundColor),this.container.style.setProperty("--ac-color-default",t.color);let e=getComputedStyle(this.input).accentColor;e!=="auto"&&this.container.style.setProperty("--ac-accent-color",e),(this.container?.shadowRoot??this.container).appendChild(this.resultsDiv),this.controller().clear("attach"),this.on("input",v(this.inputHandler.bind(this),this.settings.throttleInputMs??300)).on("focus",this.focusHandler.bind(this)).on("focusout",this.blurHandler.bind(this)).on("keyup",this.keyUpHandler.bind(this)).on("keydown",this.keyDownHandler.bind(this))}controller(){let t=this.internalController();return typeof this.settings.controller=="function"&&(t=this.settings.controller(this)??t),t}internalController(){return{show:this.show.bind(this),hide:this.hide.bind(this),clear:this.clear.bind(this),empty:()=>{}}}moveResult(t){this.controller().show();let e=this.acItems.length;this.rowIndex=this.rowIndex+t,this.rowIndex<=0?this.rowIndex=0:this.rowIndex>e-1&&(this.rowIndex=0);for(let i of this.acItems)i.classList.remove("selected");let s=this.getSelectedDiv();s?(s.classList.add("selected"),s.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})):this.focusHandler({target:this.input})}getSelectedDiv(){return this.resultsDiv.querySelector(`div:nth-child(${this.rowIndex+1})`)}selectResult(t){if(t=t||this.getSelectedDiv(),t){let e=parseInt(t.getAttribute("data-index"));this.resultClicked=!0;let s=this.results[e],i=this.categories[s.category]??{};i.action=i.action??this.setText.bind(this),i.newTab&&(this.tabWindow=A("about:blank"));let r={...s,search:this.input.value};t.classList.add("ac-active"),setTimeout(()=>{this.controller().hide("result-selected"),r.action?r.action(r):(i.action(r),i.newTab&&(r.url?this.tabWindow.location.href=r.url:this.tabWindow.close()));var n=new Event("change",{bubbles:!0});this.input.dispatchEvent(n),this.controller().clear("result-selected");let u=new Event("result-selected");u.detail=r,this.input.dispatchEvent(u)},0)}}setText(t){let e=!1;this.input?(this.input.value=t.text,e=!0):this.container?.autoCompleteInput?(this.container.autoCompleteInput.value=t.text,e=!0):"value"in this.container&&(this.container.value=t.text,e=!0),e&&this.input&&this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.controller().hide("settext")}resultClick(t){this.selectResult(t.target.closest(`.${y.item}`))}blurHandler(){setTimeout(()=>{this.resultClicked||this.controller().clear("blurred"),this.resultClicked=!1},100)}clear(){this.settings.debug||this.resultsDiv&&(this.resultsDiv.innerHTML="",this.controller().hide("clear"),this.cacheTmr&&clearTimeout(this.cacheTmr),this.cacheTmr=setTimeout(()=>{this.caches.clear()},60*1e3*5))}show(){if(!this.resultsDiv.classList.contains("ac-active")){let t=this.getViewBounds();this.resultsDiv.style.position="absolute",t.rect.width>100&&(this.resultsDiv.style.width=`${t.rect.width}px`),this.settings.direction=this.settings.direction??t.suggestedDirection,this.resultsDiv.setAttribute("data-direction",this.settings.direction),this.settings.direction==="up"?(this.resultsDiv.style.top="unset",this.resultsDiv.style.bottom=`${t.rect.height+20}px`,this.rowIndex=this.acItems.length):(this.resultsDiv.style.bottom="unset",this.resultsDiv.style.top=`${t.rect.height}px`,this.rowIndex=-1),this.resultsDiv.style.maxWidth="unset",this.resultsDiv.classList.toggle("ac-active",!0)}}getViewBounds(){let t=this.input.getBoundingClientRect();return{rect:t,suggestedDirection:t.top+t.height+500>window.innerHeight?"up":"down"}}hide(){this.resultsDiv.classList.toggle("ac-active",!1)}empty(){this.resultsDiv.innerHTML=`<div class="ac-empty">${this.settings.emptyResultsText}</div>`,this.controller().show()}inputHandler(t){this.cacheTmr&&clearTimeout(this.cacheTmr);let e={search:t.target.value,categories:this.categories};this.container.classList.add("search-running"),this.getItems(e,t).then(s=>{this.controller().clear("new-results"),this.resultsHandler(s,e),this.container.classList.remove("search-running")})}keyDownHandler(t){switch(t.key){case"Enter":t.stopPropagation(),t.preventDefault();break;case"ArrowDown":m(this.moveResult(1));break;case"ArrowUp":m(this.moveResult(-1));break}}keyUpHandler(t){switch(t.key){case"Escape":this.controller().hide("escape");break;case"Enter":this.getSelectedDiv()&&(this.container.preventEnter=!0,t.stopPropagation(),t.preventDefault(),this.selectResult(),setTimeout(()=>{this.container.preventEnter=!1},10));break;default:break}}focusHandler(t){this.controller().clear("focus");let e=t.target.value;this.suggest(e,t)}suggest(t,e){this.input.focus();let s={suggest:!0,search:t||"",categories:this.categories};this.getItems(s,e).then(i=>{this.input.dispatchEvent(new CustomEvent("show-results",{detail:{results:i}})),this.resultsHandler(i,s)})}sort(t,e){return t.sort((s,i)=>{let r=e.categories[s.category],n=e.categories[i.category],u=typeof r.sortIndex=="function"?r.sortIndex(e):r.sortIndex??0;return(typeof n.sortIndex=="function"?n.sortIndex(e):n.sortIndex??0)>u?1:-1})}resultsHandler(t,e){this.results=t,this.rowIndex=-1;let s=0,i=(r,n)=>`
|
|
3
|
+
<div title="${n.tooltip||""}" data-index="${s}" class="${`${y.item} cat-${n.category} ${n.class??""}`.trim()}"${n.style?` style="${n.style}"`:""}>
|
|
4
4
|
${this.handleImageOrIcon(n)}
|
|
5
5
|
<span class="text">${this.formatResultItem(n,e,r)}</span>
|
|
6
6
|
${this.settings.hideCategory?"":`<span class="category">${n.category||""}</span>`}
|
|
7
|
-
</div>`;t.forEach(r=>{let n=e.categories[r.category]||{};r.element?this.resultsDiv.appendChild(r.element):(r=typeof r=="string"?{text:r}:r,this.resultsDiv.appendChild(
|
|
7
|
+
</div>`;t.forEach(r=>{let n=e.categories[r.category]||{};r.element?this.resultsDiv.appendChild(r.element):(r=typeof r=="string"?{text:r}:r,this.resultsDiv.appendChild(w(i(n,r))[0])),s++}),t.length?(this.acItems=this.resultsDiv.querySelectorAll(".ac-itm"),this.controller().show()):e.search.length&&this.controller().empty()}handleImageOrIcon(t){return t.image?`<img src="${t.image}"/>`:typeof this.settings.iconHandler=="function"?this.settings.iconHandler(t):`<svg-icon icon="${t.icon}"></svg-icon>`}formatResultItem(t,e,s){let i=typeof t=="string"?{text:t}:t,r=i.text;return e.search&&(r=r.replace("%search%",e.search),i.description=i.description?.replace("%search%",e.search)),r=this.highlight(r,e.search),i.description&&(r=`<div>${r}</div><small>${i.description}</small>`),s.format&&(r=s.format({item:i,result:r,options:e})),r}highlight(t,e){var s=new RegExp("("+e+")","gi");return t.replace(s,'<span class="txt-hl">$1</span>')}async getItems(t,e){this.aborter&&this.aborter.abort();let s=this.caches.get(t.search);if(s)return s;let i=this.settings.map,r=l=>(typeof l=="string"&&(l={text:l}),l),n=l=>i?l.map(h=>({text:h[i]})):l.map(h=>r(h)),u=l=>(this.settings.max&&this.settings.max>0&&(l.length=this.settings.max),l);return this.aborter=new AbortController,this.aborterSignal=this.aborter.signal,new Promise(l=>{let h=o=>{o=this.sort(o,t),this.settings.cache!==!1&&this.caches.set(t.search,o),l(o)};if(I(this.items)){if(this.settings.minlength>0&&(!t.search||t.search.length<this.settings.minlength)){h([]);return}let o=this.formatSearch(this.items,t);fetch(o).then(a=>{if(a.status===200){a.json().then(d=>{d=n(d),h(u(d.filter(g=>this.isMatch(t,g))))});return}throw Error(`HTTP error ${a.status} - ${o}`)})}else if(Array.isArray(this.items)){let o=!0;this.items=this.items.map(a=>typeof a=="string"?{text:a}:(o=!1,a)),o&&this.container.classList.add("simple"),h(u(n(this.items)))}else if(typeof this.items=="function")t.control=this.container,Promise.resolve(this.items(t,e)).then(a=>{a=a.map(d=>r(d)),a=n(a),h(a)});else return h(Promise.resolve(this.items.apply(this,t)))})}async items(t){let e=[];t.results=[],t.signal=this.aborterSignal;for(var s in t.categories){let i=t.categories[s];if(i.trigger=i.trigger??(()=>!0),t.results=e,i.trigger(t)){let r=[];try{r=await i.getItems(t)}catch(n){console.warn(`Error loading items for omniBox category '${s}'.`,n)}e=e.concat(r.map(n=>(n.category=s,n)))}}return e}formatSearch(t,e){return t.indexOf("%search%")?t.replace("%search%",e.search||""):t+"?"+this.createQueryParam(e)}createQueryParam(t){let e=t.suggest?"&suggest=true":"";return`q=${t.text}${e}`}isMatch(t,e){return e.text?.indexOf("%search%")>=0?!0:t.search?e.text?.toLowerCase().indexOf(t.search.toLowerCase())>=0:t.suggest}static textFilter(t,e){return function(s){if(!t.search)return!0;if(s.hidden)return!1;let r=(e?s[e]:s).match(new RegExp(t.search,"gi"));if(r)return r;if(s.config?.tags)return s.config.tags.some(n=>n.match(new RegExp(t.search,"gi")))}}};var b=p?.prototype?.selectResult;typeof b=="function"&&p?.prototype?.__pdsSelectedItemPatched!==!0&&(p.prototype.selectResult=function(t){let e=t||this.getSelectedDiv?.();if(!e)return b.call(this,t);let s=e.getAttribute?.("data-index")??"",i=Number.parseInt(s,10),r=Number.isInteger(i)?this.results?.[i]:null,n=r&&this.categories?this.categories[r.category]:null,u=[],l=(o,a)=>{if(!o||typeof o[a]!="function")return;let d=o[a],g=!1,x=()=>{g||(o[a]=d,g=!0)};o[a]=function(f={},...C){try{return f&&typeof f=="object"&&!("selectedItem"in f)&&(f.selectedItem=e),d.call(this,f,...C)}finally{x()}},u.push(x)};l(r,"action"),l(n,"action");let h=b.call(this,e);return setTimeout(()=>{for(let o of u)o()},1e3),h},p.prototype.__pdsSelectedItemPatched=!0);export{p as AutoComplete};
|
|
@@ -162,7 +162,8 @@ export class SvgIcon extends HTMLElement {
|
|
|
162
162
|
const attrIcon = this.getAttribute('icon') || 'missing';
|
|
163
163
|
const icon = this._morphing ? (this._currentIcon || attrIcon) : attrIcon;
|
|
164
164
|
const sizeAttr = this.getAttribute('size') || '24';
|
|
165
|
-
const
|
|
165
|
+
const colorAttr = this.getAttribute('color');
|
|
166
|
+
const color = colorAttr || 'currentColor';
|
|
166
167
|
const label = this.getAttribute('label');
|
|
167
168
|
const spriteOverride = this.getAttribute('sprite');
|
|
168
169
|
const rotate = this.getAttribute('rotate') || '0';
|
|
@@ -379,6 +380,13 @@ export class SvgIcon extends HTMLElement {
|
|
|
379
380
|
return;
|
|
380
381
|
}
|
|
381
382
|
|
|
383
|
+
// Keep host color in sync for external SVGs that rely on fill="currentColor".
|
|
384
|
+
if (colorAttr) {
|
|
385
|
+
this.style.setProperty('color', colorAttr);
|
|
386
|
+
} else {
|
|
387
|
+
this.style.removeProperty('color');
|
|
388
|
+
}
|
|
389
|
+
|
|
382
390
|
this._stackEl.setAttribute('class', `icon-stack${morphClass ? ` ${morphClass}` : ''}`);
|
|
383
391
|
this._stackEl.style.width = `${size}px`;
|
|
384
392
|
this._stackEl.style.height = `${size}px`;
|