@pure-ds/core 0.5.49 → 0.5.51

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.
@@ -1,5 +1,5 @@
1
- export { ct as startLive };
2
- declare function ct(n: any, t: any, { emitReady: e, applyResolvedTheme: r, setupSystemListenerIfNeeded: a }: {
1
+ export { st as startLive };
2
+ declare function st(n: any, t: any, { emitReady: e, applyResolvedTheme: r, setupSystemListenerIfNeeded: a }: {
3
3
  emitReady: any;
4
4
  applyResolvedTheme: any;
5
5
  setupSystemListenerIfNeeded: any;
@@ -1,9 +1,9 @@
1
- declare var g: {
1
+ declare var b: {
2
2
  addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void;
3
3
  dispatchEvent(event: Event): boolean;
4
4
  removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;
5
5
  };
6
+ declare function Rt(e: any): void;
6
7
  declare function $t(e: any): void;
7
- declare function Tt(e: any): void;
8
- export { g as PDS, $t as applyResolvedTheme, Tt as setupSystemListenerIfNeeded };
8
+ export { b as PDS, Rt as applyResolvedTheme, $t as setupSystemListenerIfNeeded };
9
9
  //# sourceMappingURL=pds.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../../../../../public/assets/js/pds.js"],"names":[],"mappings":"AA+BisB;;;;EAAQ;AAAslD,kCAAiX;AAAA,kCAAupB"}
1
+ {"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../../../../../public/assets/js/pds.js"],"names":[],"mappings":"AA+BisB;;;;EAAQ;AAA4kD,kCAAiX;AAAA,kCAAupB"}
@@ -1,11 +1,5 @@
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[];
9
3
  /**
10
4
  * Build a DocumentFragment from a template-like object (strings + values)
11
5
  * @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,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"}
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"}
@@ -14,12 +14,30 @@ 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 "./lit-msg.js";
18
- export { lazyProps } from "./lit-lazy-props.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>;
19
24
  import { LitElement } from "lit";
20
25
  import { nothing } from "lit";
21
26
  import { svg } from "lit";
22
27
  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";
23
41
  export { LitElement, nothing, svg, render };
24
42
  export { ref, createRef } from "lit/directives/ref.js";
25
43
  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":"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"}
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"}
@@ -25,18 +25,6 @@ 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;
40
28
  /**
41
29
  * - Apply generated styles to the document (live-only)
42
30
  */
@@ -78,33 +66,12 @@ export const PDS: PDSAPI & PDSBase;
78
66
  *
79
67
  * @typedef {Object} PDSAPI
80
68
  * @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
84
69
  * @property {(generator?: import("./pds-core/pds-generator.js").Generator) => void} applyStyles - Apply generated styles to the document (live-only)
85
70
  * @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.
86
71
  * @property {(shadowRoot: ShadowRoot, additionalSheets?: CSSStyleSheet[]) => Promise<void>} adoptPrimitives - Adopt primitives layer into a ShadowRoot. Designed as a convenience for components.
87
72
  * @property {(css:string) => CSSStyleSheet} createStylesheet - Create a constructable stylesheet from CSS text. @throws {DOMException} on invalid CSS in some browsers.
88
73
  * @property {() => boolean} isLiveMode - Returns true when running in live/designer-backed mode
89
74
  * @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
108
75
  */
109
76
  /**
110
77
  * 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":"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"}
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"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pure-ds/core",
3
3
  "shortname": "pds",
4
- "version": "0.5.49",
4
+ "version": "0.5.51",
5
5
  "description": "Pure Design System - Why develop a Design System when you can generate one?",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,85 +1,76 @@
1
- const esbuild = require("esbuild");
2
- const http = require("http");
3
- const path = require("node:path");
4
-
5
- const reloadPort = 4174;
6
- const reloadClients = new Set();
7
-
8
- function startReloadServer() {
9
- const server = http.createServer((req, res) => {
10
- if (req.url !== "/events") {
11
- res.writeHead(404);
12
- res.end();
13
- return;
14
- }
15
-
16
- res.writeHead(200, {
17
- "Content-Type": "text/event-stream",
18
- "Cache-Control": "no-cache",
19
- Connection: "keep-alive",
20
- "Access-Control-Allow-Origin": "*",
21
- });
22
-
23
- res.write("retry: 1000\n\n");
24
- reloadClients.add(res);
25
-
26
- req.on("close", () => {
27
- reloadClients.delete(res);
28
- });
29
- });
30
-
31
- server.listen(reloadPort, () => {
32
- console.log("Live reload listening on http://localhost:" + reloadPort + "/events");
33
- });
34
- }
35
-
36
- function notifyReload() {
37
- for (const client of reloadClients) {
38
- client.write("data: reload\n\n");
39
- }
40
- }
41
-
42
- function liveReloadPlugin() {
43
- return {
44
- name: "live-reload",
45
- setup(build) {
46
- build.onEnd((result) => {
47
- if (!result.errors.length) {
48
- notifyReload();
49
- }
50
- });
51
- },
52
- };
53
- }
54
-
55
- const pdsLitPath = path.join(
56
- __dirname,
57
- "node_modules/@pure-ds/core/public/assets/pds/external/lit.js"
58
- );
59
-
60
- async function start() {
61
- startReloadServer();
62
- const ctx = await esbuild.context({
63
- entryPoints: ["src/js/app.js"],
64
- outdir: "public/assets/js",
65
- bundle: true,
66
- alias: {
67
- "#pds/lit": pdsLitPath,
68
- },
69
- format: "esm",
70
- sourcemap: true,
71
- publicPath: "/assets/js",
72
- external: ["/assets/my/*"],
73
- logLevel: "info",
74
- plugins: [liveReloadPlugin()],
75
- });
76
-
77
- await ctx.watch();
78
- const { host, port } = await ctx.serve({ servedir: "public", port: 4173 });
79
- console.log("Dev server running at http://" + host + ":" + port);
80
- }
81
-
82
- start().catch((err) => {
83
- console.error(err);
84
- process.exit(1);
85
- });
1
+ const esbuild = require("esbuild");
2
+ const http = require("http");
3
+
4
+ const reloadPort = 4174;
5
+ const reloadClients = new Set();
6
+
7
+ function startReloadServer() {
8
+ const server = http.createServer((req, res) => {
9
+ if (req.url !== "/events") {
10
+ res.writeHead(404);
11
+ res.end();
12
+ return;
13
+ }
14
+
15
+ res.writeHead(200, {
16
+ "Content-Type": "text/event-stream",
17
+ "Cache-Control": "no-cache",
18
+ Connection: "keep-alive",
19
+ "Access-Control-Allow-Origin": "*",
20
+ });
21
+
22
+ res.write("retry: 1000\n\n");
23
+ reloadClients.add(res);
24
+
25
+ req.on("close", () => {
26
+ reloadClients.delete(res);
27
+ });
28
+ });
29
+
30
+ server.listen(reloadPort, () => {
31
+ console.log("Live reload listening on http://localhost:" + reloadPort + "/events");
32
+ });
33
+ }
34
+
35
+ function notifyReload() {
36
+ for (const client of reloadClients) {
37
+ client.write("data: reload\n\n");
38
+ }
39
+ }
40
+
41
+ function liveReloadPlugin() {
42
+ return {
43
+ name: "live-reload",
44
+ setup(build) {
45
+ build.onEnd((result) => {
46
+ if (!result.errors.length) {
47
+ notifyReload();
48
+ }
49
+ });
50
+ },
51
+ };
52
+ }
53
+
54
+ async function start() {
55
+ startReloadServer();
56
+ const ctx = await esbuild.context({
57
+ entryPoints: ["src/js/app.js"],
58
+ outdir: "public/assets/js",
59
+ bundle: true,
60
+ format: "esm",
61
+ sourcemap: true,
62
+ publicPath: "/assets/js",
63
+ external: ["/assets/my/*"],
64
+ logLevel: "info",
65
+ plugins: [liveReloadPlugin()],
66
+ });
67
+
68
+ await ctx.watch();
69
+ const { host, port } = await ctx.serve({ servedir: "public", port: 4173 });
70
+ console.log("Dev server running at http://" + host + ":" + port);
71
+ }
72
+
73
+ start().catch((err) => {
74
+ console.error(err);
75
+ process.exit(1);
76
+ });
@@ -1,80 +1,69 @@
1
- import esbuild from "esbuild";
2
- import http from "http";
3
- import path from "node:path";
4
- import { fileURLToPath } from "node:url";
5
-
6
- const reloadPort = 4174;
7
- const reloadClients = new Set();
8
-
9
- function startReloadServer() {
10
- const server = http.createServer((req, res) => {
11
- if (req.url !== "/events") {
12
- res.writeHead(404);
13
- res.end();
14
- return;
15
- }
16
-
17
- res.writeHead(200, {
18
- "Content-Type": "text/event-stream",
19
- "Cache-Control": "no-cache",
20
- Connection: "keep-alive",
21
- "Access-Control-Allow-Origin": "*",
22
- });
23
-
24
- res.write("retry: 1000\n\n");
25
- reloadClients.add(res);
26
-
27
- req.on("close", () => {
28
- reloadClients.delete(res);
29
- });
30
- });
31
-
32
- server.listen(reloadPort, () => {
33
- console.log("Live reload listening on http://localhost:" + reloadPort + "/events");
34
- });
35
- }
36
-
37
- function notifyReload() {
38
- for (const client of reloadClients) {
39
- client.write("data: reload\n\n");
40
- }
41
- }
42
-
43
- function liveReloadPlugin() {
44
- return {
45
- name: "live-reload",
46
- setup(build) {
47
- build.onEnd((result) => {
48
- if (!result.errors.length) {
49
- notifyReload();
50
- }
51
- });
52
- },
53
- };
54
- }
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
-
62
- startReloadServer();
63
-
64
- const ctx = await esbuild.context({
65
- entryPoints: ["src/js/app.js"],
66
- outdir: "public/assets/js",
67
- bundle: true,
68
- alias: {
69
- "#pds/lit": pdsLitPath,
70
- },
71
- format: "esm",
72
- sourcemap: true,
73
- publicPath: "/assets/js",
74
- external: ["/assets/my/*"],
75
- logLevel: "info",
76
- plugins: [liveReloadPlugin()],
77
- });
78
-
79
- await ctx.watch();
80
- const { host, port } = await ctx.serve({ servedir: "public", port: 4173 });
1
+ import esbuild from "esbuild";
2
+ import http from "http";
3
+
4
+ const reloadPort = 4174;
5
+ const reloadClients = new Set();
6
+
7
+ function startReloadServer() {
8
+ const server = http.createServer((req, res) => {
9
+ if (req.url !== "/events") {
10
+ res.writeHead(404);
11
+ res.end();
12
+ return;
13
+ }
14
+
15
+ res.writeHead(200, {
16
+ "Content-Type": "text/event-stream",
17
+ "Cache-Control": "no-cache",
18
+ Connection: "keep-alive",
19
+ "Access-Control-Allow-Origin": "*",
20
+ });
21
+
22
+ res.write("retry: 1000\n\n");
23
+ reloadClients.add(res);
24
+
25
+ req.on("close", () => {
26
+ reloadClients.delete(res);
27
+ });
28
+ });
29
+
30
+ server.listen(reloadPort, () => {
31
+ console.log("Live reload listening on http://localhost:" + reloadPort + "/events");
32
+ });
33
+ }
34
+
35
+ function notifyReload() {
36
+ for (const client of reloadClients) {
37
+ client.write("data: reload\n\n");
38
+ }
39
+ }
40
+
41
+ function liveReloadPlugin() {
42
+ return {
43
+ name: "live-reload",
44
+ setup(build) {
45
+ build.onEnd((result) => {
46
+ if (!result.errors.length) {
47
+ notifyReload();
48
+ }
49
+ });
50
+ },
51
+ };
52
+ }
53
+
54
+ startReloadServer();
55
+
56
+ const ctx = await esbuild.context({
57
+ entryPoints: ["src/js/app.js"],
58
+ outdir: "public/assets/js",
59
+ bundle: true,
60
+ format: "esm",
61
+ sourcemap: true,
62
+ publicPath: "/assets/js",
63
+ external: ["/assets/my/*"],
64
+ logLevel: "info",
65
+ plugins: [liveReloadPlugin()],
66
+ });
67
+
68
+ await ctx.watch();
69
+ const { host, port } = await ctx.serve({ servedir: "public", port: 4173 });