@pure-ds/core 0.5.41 → 0.5.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/types/pds.d.ts +4 -0
  2. package/dist/types/public/assets/js/lit-lazy-props.d.ts +5 -0
  3. package/dist/types/public/assets/js/lit-lazy-props.d.ts.map +1 -0
  4. package/dist/types/public/assets/js/lit-msg.d.ts +2 -0
  5. package/dist/types/public/assets/js/lit-msg.d.ts.map +1 -0
  6. package/dist/types/public/assets/js/pds-manager.d.ts.map +1 -1
  7. package/dist/types/public/assets/js/pds.d.ts.map +1 -1
  8. package/dist/types/src/js/common/common.d.ts +6 -0
  9. package/dist/types/src/js/common/common.d.ts.map +1 -1
  10. package/dist/types/src/js/lit-lazy-props.d.ts +21 -0
  11. package/dist/types/src/js/lit-lazy-props.d.ts.map +1 -0
  12. package/dist/types/src/js/lit-msg.d.ts +2 -0
  13. package/dist/types/src/js/lit-msg.d.ts.map +1 -0
  14. package/dist/types/src/js/lit.d.ts +2 -20
  15. package/dist/types/src/js/lit.d.ts.map +1 -1
  16. package/dist/types/src/js/pds.d.ts +33 -0
  17. package/dist/types/src/js/pds.d.ts.map +1 -1
  18. package/package.json +1 -1
  19. package/packages/pds-cli/bin/templates/bootstrap/esbuild-dev.cjs +9 -0
  20. package/packages/pds-cli/bin/templates/bootstrap/esbuild-dev.mjs +11 -0
  21. package/public/assets/js/app.js +12 -12
  22. package/public/assets/js/lit-lazy-props.js +47 -0
  23. package/public/assets/js/lit-msg.js +1 -0
  24. package/public/assets/js/lit.js +3 -3
  25. package/public/assets/js/pds-manager.js +4 -4
  26. package/public/assets/js/pds.js +6 -6
  27. package/public/assets/pds/external/lit-lazy-props.js +47 -0
  28. package/public/assets/pds/external/lit-msg.js +1 -0
  29. package/public/assets/pds/external/lit.js +3 -3
  30. package/readme.md +51 -2
  31. package/src/js/pds.d.ts +4 -0
  32. package/src/js/pds.js +22 -0
@@ -159,6 +159,9 @@ export interface PDSEventMap {
159
159
  export class PDS extends EventTarget {
160
160
  // Static surface
161
161
  static registry: PDSRegistry;
162
+ static initializing?: boolean;
163
+ static currentPreset?: string | null;
164
+ static debug?: boolean;
162
165
  static applyStyles?: (generator?: Generator) => void;
163
166
  static adoptLayers: (shadowRoot: ShadowRoot, layers?: string[], additionalSheets?: CSSStyleSheet[]) => Promise<void>;
164
167
  static adoptPrimitives: (shadowRoot: ShadowRoot, additionalSheets?: CSSStyleSheet[]) => Promise<void>;
@@ -173,6 +176,7 @@ export class PDS extends EventTarget {
173
176
  static ontology?: any;
174
177
  static enums?: Record<string, any>;
175
178
  static common?: Record<string, any>;
179
+ static parse?: (html: string) => Element[];
176
180
  static query?: (question: string) => Promise<any[]>;
177
181
  static AutoComplete?: any;
178
182
  static loadAutoComplete?: () => Promise<any>;
@@ -0,0 +1,5 @@
1
+ export function lazyProps(...e5: any[]): {
2
+ _$litDirective$: any;
3
+ values: any[];
4
+ };
5
+ //# sourceMappingURL=lit-lazy-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lit-lazy-props.d.ts","sourceRoot":"","sources":["../../../../../public/assets/js/lit-lazy-props.js"],"names":[],"mappings":"AA8jBiB;;;EAAgD"}
@@ -0,0 +1,2 @@
1
+ export function msg(template: any, options?: {}): any;
2
+ //# sourceMappingURL=lit-msg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lit-msg.d.ts","sourceRoot":"","sources":["../../../../../public/assets/js/lit-msg.js"],"names":[],"mappings":"AAgCA,sDAIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pds-manager.d.ts","sourceRoot":"","sources":["../../../../../public/assets/js/pds-manager.js"],"names":[],"mappings":"AA0pSA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAw/GH;;;WAGG;;;;;;QAurBH;;WAEG;;;;;;;;QAoFH;;;;;;WAMG;;;;;;QAsKH;;;WAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA26CJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../../../../../public/assets/js/pds.js"],"names":[],"mappings":"AAqoEA;;;;EAAwB;AAiGxB,mDAiBC;AACD,4DAqCC"}
1
+ {"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../../../../../public/assets/js/pds.js"],"names":[],"mappings":"AA0oEA;;;;EAAwB;AAkGxB,mDAiBC;AACD,4DAqCC"}
@@ -1,5 +1,11 @@
1
1
  export function isObject(item: any): boolean;
2
2
  export function deepMerge(target: any, source: any): any;
3
+ /**
4
+ * Parse a HTML string into DOM nodes.
5
+ * @param {string} html
6
+ * @returns {Element[]}
7
+ */
8
+ export function parseHTML(html: string): Element[];
3
9
  /**
4
10
  * Build a DocumentFragment from a template-like object (strings + values)
5
11
  * @param {{strings: string[], values: unknown[]}} templateLike
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/js/common/common.js"],"names":[],"mappings":"AAAA,6CAEC;AAED,yDAeG;AAEH;;;;GAIG;AACH,uDAHW;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,OAAO,EAAE,CAAA;CAAC,GACpC,gBAAgB,CAwF5B"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/js/common/common.js"],"names":[],"mappings":"AAAA,6CAEC;AAED,yDAeG;AAEH;;;;GAIG;AACH,gCAHW,MAAM,GACJ,OAAO,EAAE,CAMrB;AAED;;;;GAIG;AACH,uDAHW;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,OAAO,EAAE,CAAA;CAAC,GACpC,gBAAgB,CAwF5B"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Applies properties to an element after it's defined (for lazy-loaded components)
3
+ * @param {Object} props - Properties to set on the element
4
+ * @returns {import('lit/directive.js').DirectiveResult}
5
+ */
6
+ export const lazyProps: (_props?: any) => import("lit-html/directive.js").DirectiveResult<typeof LazyPropsDirective>;
7
+ /**
8
+ * Directive that waits for a custom element to be defined before setting properties
9
+ * Useful for lazy-loaded web components
10
+ *
11
+ * @example
12
+ * html`<pds-fab ${lazyProps({ satellites: [...], open: true })}></pds-fab>`
13
+ */
14
+ declare class LazyPropsDirective extends Directive {
15
+ render(_props: any): symbol;
16
+ update(part: any, [props]: [any]): symbol;
17
+ #private;
18
+ }
19
+ import { Directive } from "lit/directive.js";
20
+ export {};
21
+ //# sourceMappingURL=lit-lazy-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lit-lazy-props.d.ts","sourceRoot":"","sources":["../../../../src/js/lit-lazy-props.js"],"names":[],"mappings":"AAgDA;;;;GAIG;AACH,qHAAuD;AAlDvD;;;;;;GAMG;AACH;IAIE,4BAEC;IAED,0CAaC;;CAeF;0BA7CoC,kBAAkB"}
@@ -0,0 +1,2 @@
1
+ export { msg } from "./common/msg.js";
2
+ //# sourceMappingURL=lit-msg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lit-msg.d.ts","sourceRoot":"","sources":["../../../../src/js/lit-msg.js"],"names":[],"mappings":""}
@@ -14,30 +14,12 @@ export { ifDefined } from "lit/directives/if-defined.js";
14
14
  export { until } from "lit/directives/until.js";
15
15
  export { unsafeHTML } from "lit/directives/unsafe-html.js";
16
16
  export { unsafeSVG } from "lit/directives/unsafe-svg.js";
17
- export { msg } from "./common/msg.js";
18
- /**
19
- * Applies properties to an element after it's defined (for lazy-loaded components)
20
- * @param {Object} props - Properties to set on the element
21
- * @returns {import('lit/directive.js').DirectiveResult}
22
- */
23
- export const lazyProps: (_props?: any) => import("lit-html/directive.js").DirectiveResult<typeof LazyPropsDirective>;
17
+ export { msg } from "./lit-msg.js";
18
+ export { lazyProps } from "./lit-lazy-props.js";
24
19
  import { LitElement } from "lit";
25
20
  import { nothing } from "lit";
26
21
  import { svg } from "lit";
27
22
  import { render } from "lit";
28
- /**
29
- * Directive that waits for a custom element to be defined before setting properties
30
- * Useful for lazy-loaded web components
31
- *
32
- * @example
33
- * html`<pds-fab ${lazyProps({ satellites: [...], open: true })}></pds-fab>`
34
- */
35
- declare class LazyPropsDirective extends Directive {
36
- render(_props: any): symbol;
37
- update(part: any, [props]: [any]): symbol;
38
- #private;
39
- }
40
- import { Directive } from "lit/directive.js";
41
23
  export { LitElement, nothing, svg, render };
42
24
  export { ref, createRef } from "lit/directives/ref.js";
43
25
  export { html as staticHtml, unsafeStatic } from "lit/static-html.js";
@@ -1 +1 @@
1
- {"version":3,"file":"lit.d.ts","sourceRoot":"","sources":["../../../../src/js/lit.js"],"names":[],"mappings":"AAiFA;;;GAGG;AACH,0DAMC;AAtFD,0CAA0C;AAC1C,mBADW,cAAc,OAAO,EAAE,IAAI,CACV;AAE5B,yCAAyC;AACzC,kBADW,cAAc,OAAO,EAAE,GAAG,CACX;;;;;;;;;AAiE1B;;;;GAIG;AACH,qHAAuD;2BA9E0B,KAAK;wBAAL,KAAK;oBAAL,KAAK;uBAAL,KAAK;AA4BtF;;;;;;GAMG;AACH;IAIE,4BAEC;IAED,0CAaC;;CAeF;0BA7CoC,kBAAkB"}
1
+ {"version":3,"file":"lit.d.ts","sourceRoot":"","sources":["../../../../src/js/lit.js"],"names":[],"mappings":"AA4BA;;;GAGG;AACH,0DAMC;AAjCD,0CAA0C;AAC1C,mBADW,cAAc,OAAO,EAAE,IAAI,CACV;AAE5B,yCAAyC;AACzC,kBADW,cAAc,OAAO,EAAE,GAAG,CACX;;;;;;;;;;2BARuD,KAAK;wBAAL,KAAK;oBAAL,KAAK;uBAAL,KAAK"}
@@ -25,6 +25,18 @@ export type PDSAPI = {
25
25
  * - Singleton runtime registry for live/static mode
26
26
  */
27
27
  registry: import("./pds-core/pds-registry.js").PDSRegistry;
28
+ /**
29
+ * - Internal init guard (set while PDS.start is running)
30
+ */
31
+ initializing: boolean;
32
+ /**
33
+ * - Current preset id/name (legacy; may be null)
34
+ */
35
+ currentPreset: string | null;
36
+ /**
37
+ * - Enable verbose runtime logging
38
+ */
39
+ debug: boolean;
28
40
  /**
29
41
  * - Apply generated styles to the document (live-only)
30
42
  */
@@ -66,12 +78,33 @@ export const PDS: PDSAPI & PDSBase;
66
78
  *
67
79
  * @typedef {Object} PDSAPI
68
80
  * @property {import("./pds-core/pds-registry.js").PDSRegistry} registry - Singleton runtime registry for live/static mode
81
+ * @property {boolean} initializing - Internal init guard (set while PDS.start is running)
82
+ * @property {string|null} currentPreset - Current preset id/name (legacy; may be null)
83
+ * @property {boolean} debug - Enable verbose runtime logging
69
84
  * @property {(generator?: import("./pds-core/pds-generator.js").Generator) => void} applyStyles - Apply generated styles to the document (live-only)
70
85
  * @property {(shadowRoot: ShadowRoot, layers?: string[], additionalSheets?: CSSStyleSheet[]) => Promise<void>} adoptLayers - Adopt multiple layers into a ShadowRoot. May log errors and fallback to additionalSheets when static imports fail.
71
86
  * @property {(shadowRoot: ShadowRoot, additionalSheets?: CSSStyleSheet[]) => Promise<void>} adoptPrimitives - Adopt primitives layer into a ShadowRoot. Designed as a convenience for components.
72
87
  * @property {(css:string) => CSSStyleSheet} createStylesheet - Create a constructable stylesheet from CSS text. @throws {DOMException} on invalid CSS in some browsers.
73
88
  * @property {() => boolean} isLiveMode - Returns true when running in live/designer-backed mode
74
89
  * @property {() => Promise<typeof import("./pds-core/pds-generator.js").Generator>} getGenerator - Live-only accessor for the Generator class
90
+ * @property {(question: string) => Promise<any[]>} query - Live-only query interface
91
+ * @property {(message: string, options?: any) => Promise<any>} ask - Modal dialog helper (static + live)
92
+ * @property {(message: string, options?: any) => Promise<string>} toast - Toast helper (static + live)
93
+ * @property {Record<string, any>} common - Common utilities namespace (static + live)
94
+ * @property {(html: string) => Element[]} parse - HTML string parser (static + live)
95
+ * @property {any} AutoComplete - Lazy-loaded autocomplete class (null until loaded)
96
+ * @property {() => Promise<any>} loadAutoComplete - Lazy-load the autocomplete package
97
+ * @property {Record<string, any>} enums - Enum values (static + live)
98
+ * @property {any} ontology - Design system ontology (live-only)
99
+ * @property {Record<string, any>} presets - Preset metadata (live-only)
100
+ * @property {Array<{selector: string, description?: string, demoHtml?: string}>} enhancerMetadata - Enhancer metadata (live-only)
101
+ * @property {Array<any>} defaultEnhancers - Default enhancer definitions (static + live)
102
+ * @property {(el: Element) => ComponentDef | null} findComponentForElement - Ontology lookup helper (live-only)
103
+ * @property {() => void} preloadCritical - Emit critical CSS into <style> (live-only)
104
+ * @property {any} currentConfig - Frozen configuration snapshot after start (static + live)
105
+ * @property {any} compiled - Compiled design system state (live-only)
106
+ * @property {string|null} theme - Theme preference getter/setter (static + live, browser only)
107
+ * @property {(config?: object) => Promise<any>} start - Unified entry point for live/static init
75
108
  */
76
109
  /**
77
110
  * Workspace for the Pure Design System runtime API
@@ -1 +1 @@
1
- {"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../../../../src/js/pds.js"],"names":[],"mappings":"AAkMA,mDAsBC;AAGD,4DAuCC;;;;;;;;;;;;;;;;;;;;;;;;;cA3Oa,OAAO,4BAA4B,EAAE,WAAW;;;;iBAChD,CAAC,SAAS,CAAC,EAAE,OAAO,6BAA6B,EAAE,SAAS,KAAK,IAAI;;;;iBACrE,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,gBAAgB,CAAC,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC;;;;qBAChG,CAAC,UAAU,EAAE,UAAU,EAAE,gBAAgB,CAAC,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC;;;;sBAC7E,CAAC,GAAG,EAAC,MAAM,KAAK,aAAa;;AAW3C,+BAA+B;AAC/B,kBADW,MAAM,GAAG,OAAO,CACD;AArC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;GAIG;AACH;CAAoC"}
1
+ {"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../../../../src/js/pds.js"],"names":[],"mappings":"AAwNA,mDAsBC;AAGD,4DAuCC;;;;;;;;;;;;;;;;;;;;;;;;;cAjQa,OAAO,4BAA4B,EAAE,WAAW;;;;kBAChD,OAAO;;;;mBACP,MAAM,GAAC,IAAI;;;;WACX,OAAO;;;;iBACP,CAAC,SAAS,CAAC,EAAE,OAAO,6BAA6B,EAAE,SAAS,KAAK,IAAI;;;;iBACrE,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,gBAAgB,CAAC,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC;;;;qBAChG,CAAC,UAAU,EAAE,UAAU,EAAE,gBAAgB,CAAC,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC;;;;sBAC7E,CAAC,GAAG,EAAC,MAAM,KAAK,aAAa;;AA6B3C,+BAA+B;AAC/B,kBADW,MAAM,GAAG,OAAO,CACD;AA1D1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH;;;;GAIG;AACH;CAAoC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pure-ds/core",
3
3
  "shortname": "pds",
4
- "version": "0.5.41",
4
+ "version": "0.5.43",
5
5
  "description": "Pure Design System - Why develop a Design System when you can generate one?",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,5 +1,6 @@
1
1
  const esbuild = require("esbuild");
2
2
  const http = require("http");
3
+ const path = require("node:path");
3
4
 
4
5
  const reloadPort = 4174;
5
6
  const reloadClients = new Set();
@@ -51,12 +52,20 @@ function liveReloadPlugin() {
51
52
  };
52
53
  }
53
54
 
55
+ const pdsLitPath = path.join(
56
+ __dirname,
57
+ "node_modules/@pure-ds/core/public/assets/pds/external/lit.js"
58
+ );
59
+
54
60
  async function start() {
55
61
  startReloadServer();
56
62
  const ctx = await esbuild.context({
57
63
  entryPoints: ["src/js/app.js"],
58
64
  outdir: "public/assets/js",
59
65
  bundle: true,
66
+ alias: {
67
+ "#pds/lit": pdsLitPath,
68
+ },
60
69
  format: "esm",
61
70
  sourcemap: true,
62
71
  publicPath: "/assets/js",
@@ -1,5 +1,7 @@
1
1
  import esbuild from "esbuild";
2
2
  import http from "http";
3
+ import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
3
5
 
4
6
  const reloadPort = 4174;
5
7
  const reloadClients = new Set();
@@ -51,12 +53,21 @@ function liveReloadPlugin() {
51
53
  };
52
54
  }
53
55
 
56
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
57
+ const pdsLitPath = path.join(
58
+ __dirname,
59
+ "node_modules/@pure-ds/core/public/assets/pds/external/lit.js"
60
+ );
61
+
54
62
  startReloadServer();
55
63
 
56
64
  const ctx = await esbuild.context({
57
65
  entryPoints: ["src/js/app.js"],
58
66
  outdir: "public/assets/js",
59
67
  bundle: true,
68
+ alias: {
69
+ "#pds/lit": pdsLitPath,
70
+ },
60
71
  format: "esm",
61
72
  sourcemap: true,
62
73
  publicPath: "/assets/js",