@widgentic/designer 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -0
- package/dist/action-designer.d.ts +8 -0
- package/dist/action-designer.d.ts.map +1 -1
- package/dist/action-designer.js +2 -1
- package/dist/action-designer.js.map +1 -1
- package/dist/browser/widgentic-designer.js +82 -98
- package/dist/browser/widgentic-designer.js.map +4 -4
- package/dist/chrome-defaults.d.ts +67 -0
- package/dist/chrome-defaults.d.ts.map +1 -0
- package/dist/chrome-defaults.js +102 -0
- package/dist/chrome-defaults.js.map +1 -0
- package/dist/dom.d.ts +12 -6
- package/dist/dom.d.ts.map +1 -1
- package/dist/dom.js +104 -85
- package/dist/dom.js.map +1 -1
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +18 -10
- package/dist/element.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/schema-designer.d.ts +8 -0
- package/dist/schema-designer.d.ts.map +1 -1
- package/dist/schema-designer.js +3 -2
- package/dist/schema-designer.js.map +1 -1
- package/dist/shell.d.ts +8 -0
- package/dist/shell.d.ts.map +1 -1
- package/dist/shell.js +2 -1
- package/dist/shell.js.map +1 -1
- package/dist/theme-designer.d.ts +8 -0
- package/dist/theme-designer.d.ts.map +1 -1
- package/dist/theme-designer.js +2 -1
- package/dist/theme-designer.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chrome tokens and the palettes painted through them.
|
|
3
|
+
*
|
|
4
|
+
* `CHROME_DEFAULTS` is not a description of the defaults — it IS them: the
|
|
5
|
+
* injected stylesheet's token blocks are generated from this object, so a host
|
|
6
|
+
* that paints its own surfaces from the export cannot drift from the
|
|
7
|
+
* designers. There is deliberately no second palette to fall back to: a host
|
|
8
|
+
* that wants a different look passes its own values through `chrome`, and
|
|
9
|
+
* `chromeCss` renders whatever palette it hands back.
|
|
10
|
+
*
|
|
11
|
+
* Colours and shape carry the product's identity. Typography does not: a
|
|
12
|
+
* library must never default to a webfont it cannot serve, so `font`,
|
|
13
|
+
* `font-mono` and the three sizes stay system values in both palettes and a
|
|
14
|
+
* host with its own typeface passes it through `chrome`.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* The chrome tokens — every `--wgd-<token>` the stylesheet paints with.
|
|
18
|
+
* Colours (18) differ between the schemes; typography, shape and shadow are
|
|
19
|
+
* declared per scheme too so each palette stands alone. Public API: a rename
|
|
20
|
+
* is a spec change.
|
|
21
|
+
*/
|
|
22
|
+
export declare const CHROME_TOKENS: readonly ["bg", "panel", "border", "line", "text", "muted", "accent", "accent-bg", "accent-line", "danger", "danger-bg", "danger-line", "hover", "hl-key", "hl-str", "hl-num", "hl-bool", "hl-punct", "font", "font-mono", "font-size", "font-size-sm", "font-size-xs", "radius-sm", "radius", "radius-lg", "gap", "shadow"];
|
|
23
|
+
export type ChromeToken = (typeof CHROME_TOKENS)[number];
|
|
24
|
+
/** A host's partial chrome: token → CSS value (`var()` references welcome). */
|
|
25
|
+
export type ChromeOptions = Partial<Record<ChromeToken, string>>;
|
|
26
|
+
/** Every token valued — what a palette is. */
|
|
27
|
+
export type ChromeScheme = Record<ChromeToken, string>;
|
|
28
|
+
/** A complete palette: both schemes, every token. */
|
|
29
|
+
export interface ChromePalette {
|
|
30
|
+
light: ChromeScheme;
|
|
31
|
+
dark: ChromeScheme;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The widgentic palette — what the designers render with when a host passes
|
|
35
|
+
* no `chrome`, and what a host paints its own page with to match them.
|
|
36
|
+
*
|
|
37
|
+
* Every colour sits on the logo mark's own hue (197.6deg, from `#40a0c8`).
|
|
38
|
+
* Surfaces, text and accents come from the product's existing palette;
|
|
39
|
+
* `border`, `accent-line` and `danger-line` are DERIVED, not chosen: each is
|
|
40
|
+
* the lightest value on that hue which still clears 3:1 against the surface
|
|
41
|
+
* it sits on, because those edges are what identifies a control, a focused tag
|
|
42
|
+
* and a banner. Minimum weight that complies, so nothing is heavier than
|
|
43
|
+
* accessibility requires. See chrome-contrast.test.ts for the gate.
|
|
44
|
+
*/
|
|
45
|
+
export declare const CHROME_DEFAULTS: ChromePalette;
|
|
46
|
+
export interface ChromeCssOptions {
|
|
47
|
+
/** Custom-property prefix, dashes included. Default `--wgd`. */
|
|
48
|
+
prefix?: string;
|
|
49
|
+
/** Selector the light block is written under. Default `:root`. */
|
|
50
|
+
selector?: string;
|
|
51
|
+
/** Selector for the dark block inside `prefers-color-scheme: dark`; defaults to `selector`. */
|
|
52
|
+
darkMediaSelector?: string;
|
|
53
|
+
/** Optional selector for an unconditional dark block — an explicit host toggle. */
|
|
54
|
+
darkSelector?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Render a palette as CSS declaration blocks — the light values under
|
|
58
|
+
* `selector`, the dark values under `prefers-color-scheme: dark`, and
|
|
59
|
+
* optionally under an explicit selector a host toggles. Every token is
|
|
60
|
+
* declared in every block, so nothing falls back to a browser value.
|
|
61
|
+
*
|
|
62
|
+
* A string builder, deliberately: no injection, no runtime, no dependency.
|
|
63
|
+
* The designers' own stylesheet is built with it, and so is a host page that
|
|
64
|
+
* wants its surfaces to match them.
|
|
65
|
+
*/
|
|
66
|
+
export declare function chromeCss(palette: ChromePalette, options?: ChromeCssOptions): string;
|
|
67
|
+
//# sourceMappingURL=chrome-defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chrome-defaults.d.ts","sourceRoot":"","sources":["../src/chrome-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YACxB,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAChD,QAAQ,EAAE,WAAW,EAAE,aAAa,EACpC,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAC7C,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EACnD,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAChE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,CAC3C,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,+EAA+E;AAC/E,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;AAEjE,8CAA8C;AAC9C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AAEvD,qDAAqD;AACrD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,YAAY,CAAC;CACpB;AAWD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,EAAE,aAyB7B,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+FAA+F;IAC/F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAMD;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,GAAE,gBAAqB,GAAG,MAAM,CAYxF"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chrome tokens and the palettes painted through them.
|
|
3
|
+
*
|
|
4
|
+
* `CHROME_DEFAULTS` is not a description of the defaults — it IS them: the
|
|
5
|
+
* injected stylesheet's token blocks are generated from this object, so a host
|
|
6
|
+
* that paints its own surfaces from the export cannot drift from the
|
|
7
|
+
* designers. There is deliberately no second palette to fall back to: a host
|
|
8
|
+
* that wants a different look passes its own values through `chrome`, and
|
|
9
|
+
* `chromeCss` renders whatever palette it hands back.
|
|
10
|
+
*
|
|
11
|
+
* Colours and shape carry the product's identity. Typography does not: a
|
|
12
|
+
* library must never default to a webfont it cannot serve, so `font`,
|
|
13
|
+
* `font-mono` and the three sizes stay system values in both palettes and a
|
|
14
|
+
* host with its own typeface passes it through `chrome`.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* The chrome tokens — every `--wgd-<token>` the stylesheet paints with.
|
|
18
|
+
* Colours (18) differ between the schemes; typography, shape and shadow are
|
|
19
|
+
* declared per scheme too so each palette stands alone. Public API: a rename
|
|
20
|
+
* is a spec change.
|
|
21
|
+
*/
|
|
22
|
+
export const CHROME_TOKENS = [
|
|
23
|
+
"bg", "panel", "border", "line", "text", "muted",
|
|
24
|
+
"accent", "accent-bg", "accent-line",
|
|
25
|
+
"danger", "danger-bg", "danger-line", "hover",
|
|
26
|
+
"hl-key", "hl-str", "hl-num", "hl-bool", "hl-punct",
|
|
27
|
+
"font", "font-mono", "font-size", "font-size-sm", "font-size-xs",
|
|
28
|
+
"radius-sm", "radius", "radius-lg", "gap", "shadow"
|
|
29
|
+
];
|
|
30
|
+
/** Shared by both palettes: see the module header on why typography is not branded. */
|
|
31
|
+
const TYPOGRAPHY = {
|
|
32
|
+
font: "system-ui, sans-serif",
|
|
33
|
+
"font-mono": "ui-monospace, monospace",
|
|
34
|
+
"font-size": "13px",
|
|
35
|
+
"font-size-sm": "12px",
|
|
36
|
+
"font-size-xs": "11px"
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The widgentic palette — what the designers render with when a host passes
|
|
40
|
+
* no `chrome`, and what a host paints its own page with to match them.
|
|
41
|
+
*
|
|
42
|
+
* Every colour sits on the logo mark's own hue (197.6deg, from `#40a0c8`).
|
|
43
|
+
* Surfaces, text and accents come from the product's existing palette;
|
|
44
|
+
* `border`, `accent-line` and `danger-line` are DERIVED, not chosen: each is
|
|
45
|
+
* the lightest value on that hue which still clears 3:1 against the surface
|
|
46
|
+
* it sits on, because those edges are what identifies a control, a focused tag
|
|
47
|
+
* and a banner. Minimum weight that complies, so nothing is heavier than
|
|
48
|
+
* accessibility requires. See chrome-contrast.test.ts for the gate.
|
|
49
|
+
*/
|
|
50
|
+
export const CHROME_DEFAULTS = {
|
|
51
|
+
light: {
|
|
52
|
+
bg: "#f6fafc", panel: "#ffffff", border: "#6e95a6",
|
|
53
|
+
line: "#e4ecf2", text: "#0b1b26", muted: "#56707f",
|
|
54
|
+
accent: "#1e6f92", "accent-bg": "#e3f1f7", "accent-line": "#4b91ae",
|
|
55
|
+
danger: "#b42318", "danger-bg": "#fdf2f2", "danger-line": "#c97572",
|
|
56
|
+
hover: "#eef5f9",
|
|
57
|
+
"hl-key": "#1e6f92", "hl-str": "#2e7d5b", "hl-num": "#96620f",
|
|
58
|
+
"hl-bool": "#7a4fbf", "hl-punct": "#56707f",
|
|
59
|
+
...TYPOGRAPHY,
|
|
60
|
+
"radius-sm": "4px", radius: "6px", "radius-lg": "8px", gap: "16px",
|
|
61
|
+
shadow: "0 8px 24px -12px rgba(11, 27, 38, 0.35)"
|
|
62
|
+
},
|
|
63
|
+
dark: {
|
|
64
|
+
bg: "#0b141b", panel: "#10202a", border: "#437082",
|
|
65
|
+
line: "#1b2f3d", text: "#e6f0f5", muted: "#93a9b6",
|
|
66
|
+
accent: "#8acbe6", "accent-bg": "#14303d", "accent-line": "#3e7e98",
|
|
67
|
+
danger: "#f0a3a3", "danger-bg": "#2a1a1c", "danger-line": "#a3524f",
|
|
68
|
+
hover: "#152a36",
|
|
69
|
+
"hl-key": "#8acbe6", "hl-str": "#6cc79a", "hl-num": "#e0b25a",
|
|
70
|
+
"hl-bool": "#bb9af7", "hl-punct": "#93a9b6",
|
|
71
|
+
...TYPOGRAPHY,
|
|
72
|
+
"radius-sm": "4px", radius: "6px", "radius-lg": "8px", gap: "16px",
|
|
73
|
+
shadow: "0 8px 24px -12px rgba(0, 0, 0, 0.7)"
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
function declarations(scheme, prefix, indent) {
|
|
77
|
+
return CHROME_TOKENS.map((token) => `${indent}${prefix}-${token}: ${scheme[token]};`).join("\n");
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Render a palette as CSS declaration blocks — the light values under
|
|
81
|
+
* `selector`, the dark values under `prefers-color-scheme: dark`, and
|
|
82
|
+
* optionally under an explicit selector a host toggles. Every token is
|
|
83
|
+
* declared in every block, so nothing falls back to a browser value.
|
|
84
|
+
*
|
|
85
|
+
* A string builder, deliberately: no injection, no runtime, no dependency.
|
|
86
|
+
* The designers' own stylesheet is built with it, and so is a host page that
|
|
87
|
+
* wants its surfaces to match them.
|
|
88
|
+
*/
|
|
89
|
+
export function chromeCss(palette, options = {}) {
|
|
90
|
+
const prefix = options.prefix ?? "--wgd";
|
|
91
|
+
const selector = options.selector ?? ":root";
|
|
92
|
+
const darkMediaSelector = options.darkMediaSelector ?? selector;
|
|
93
|
+
const blocks = [
|
|
94
|
+
`${selector} {\n${declarations(palette.light, prefix, " ")}\n}`,
|
|
95
|
+
`@media (prefers-color-scheme: dark) {\n ${darkMediaSelector} {\n${declarations(palette.dark, prefix, " ")}\n }\n}`
|
|
96
|
+
];
|
|
97
|
+
if (options.darkSelector !== undefined) {
|
|
98
|
+
blocks.push(`${options.darkSelector} {\n${declarations(palette.dark, prefix, " ")}\n}`);
|
|
99
|
+
}
|
|
100
|
+
return blocks.join("\n");
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=chrome-defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chrome-defaults.js","sourceRoot":"","sources":["../src/chrome-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;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MAAM,EAAE,IAAI,CAAC,KAAK;QAChE,4CAA4C,iBAAiB,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,UAAU;KACzH,CAAC;IACF,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACvC,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,YAAY,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
package/dist/dom.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Tiny DOM helpers for the designer chrome — the same hand-rolled
|
|
3
|
-
* discipline as the rest of the project, sized for form-heavy panels.
|
|
4
|
-
* Designer chrome classes are prefixed `wgd-` (widget content inside the
|
|
5
|
-
* preview keeps the normal `wg-` classes).
|
|
6
|
-
*/
|
|
1
|
+
import type { ChromeOptions } from "./chrome-defaults.js";
|
|
7
2
|
export type Child = Node | string;
|
|
8
3
|
/** The first `<selector>` under `parent`, which the caller's own markup guarantees exists. */
|
|
9
4
|
export declare function requireChild<K extends keyof HTMLElementTagNameMap>(parent: ParentNode, selector: K): HTMLElementTagNameMap[K];
|
|
@@ -32,6 +27,17 @@ export declare function fitSelect(select: HTMLSelectElement): void;
|
|
|
32
27
|
export declare function menuButton(label: string, title: string, options: string[], onPick: (option: string) => void): HTMLElement;
|
|
33
28
|
/** Inline diagnostic line (empty text removes it from the flow). */
|
|
34
29
|
export declare function diagnosticLine(text: string | undefined): HTMLElement;
|
|
30
|
+
export { CHROME_TOKENS } from "./chrome-defaults.js";
|
|
31
|
+
export type { ChromeOptions, ChromeToken } from "./chrome-defaults.js";
|
|
32
|
+
/**
|
|
33
|
+
* Apply a host's chrome on a designer root as inline custom properties —
|
|
34
|
+
* the style attribute outranks every rule in the injected stylesheet, so
|
|
35
|
+
* the host's values win over the light/dark defaults. Unknown tokens,
|
|
36
|
+
* non-string values and CSS-wide keywords are ignored at the door.
|
|
37
|
+
*/
|
|
38
|
+
export declare function applyChrome(root: HTMLElement, chrome: ChromeOptions | undefined): void;
|
|
39
|
+
/** The element form of the option: a `chrome` attribute holding JSON; anything else → nothing. */
|
|
40
|
+
export declare function parseChromeAttribute(value: string | null): ChromeOptions | undefined;
|
|
35
41
|
/** Designer chrome stylesheet — injected once per document. */
|
|
36
42
|
export declare function injectDesignerStyles(doc: Document): void;
|
|
37
43
|
//# sourceMappingURL=dom.d.ts.map
|
package/dist/dom.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../src/dom.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../src/dom.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,MAAM,KAAK,GAAG,IAAI,GAAG,MAAM,CAAC;AAElC,8FAA8F;AAC9F,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,qBAAqB,EAChE,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,CAAC,GACV,qBAAqB,CAAC,CAAC,CAAC,CAI1B;AAED,wBAAgB,CAAC,CAAC,CAAC,SAAS,MAAM,qBAAqB,EACrD,GAAG,EAAE,CAAC,EACN,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,QAAQ,CAAC,EAAE,KAAK,EAAE,GACjB,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAC5B,wBAAgB,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,EAAE,KAAK,EAAE,GAAG,WAAW,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}
|
package/dist/dom.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Designer chrome classes are prefixed `wgd-` (widget content inside the
|
|
5
5
|
* preview keeps the normal `wg-` classes).
|
|
6
6
|
*/
|
|
7
|
+
import { CHROME_DEFAULTS, CHROME_TOKENS, chromeCss } from "./chrome-defaults.js";
|
|
7
8
|
/** The first `<selector>` under `parent`, which the caller's own markup guarantees exists. */
|
|
8
9
|
export function requireChild(parent, selector) {
|
|
9
10
|
const found = parent.querySelector(selector);
|
|
@@ -127,6 +128,46 @@ export function diagnosticLine(text) {
|
|
|
127
128
|
el.setAttribute("hidden", "");
|
|
128
129
|
return el;
|
|
129
130
|
}
|
|
131
|
+
// The token list and the palettes live in chrome-defaults.ts, which the
|
|
132
|
+
// stylesheet below is generated from; re-exported here so the modules that
|
|
133
|
+
// already import chrome types from this one keep working.
|
|
134
|
+
export { CHROME_TOKENS } from "./chrome-defaults.js";
|
|
135
|
+
const CHROME_TOKEN_SET = new Set(CHROME_TOKENS);
|
|
136
|
+
// On a custom property a CSS-wide keyword acts on the property itself (it
|
|
137
|
+
// inherits/resets the TOKEN, not the consumer), so it never expresses what
|
|
138
|
+
// a host means by it; hosts pass `var(--their-token, fallback)` instead.
|
|
139
|
+
const CSS_WIDE_KEYWORD = /^(inherit|initial|unset|revert|revert-layer)$/i;
|
|
140
|
+
/**
|
|
141
|
+
* Apply a host's chrome on a designer root as inline custom properties —
|
|
142
|
+
* the style attribute outranks every rule in the injected stylesheet, so
|
|
143
|
+
* the host's values win over the light/dark defaults. Unknown tokens,
|
|
144
|
+
* non-string values and CSS-wide keywords are ignored at the door.
|
|
145
|
+
*/
|
|
146
|
+
export function applyChrome(root, chrome) {
|
|
147
|
+
if (chrome === undefined)
|
|
148
|
+
return;
|
|
149
|
+
for (const [token, value] of Object.entries(chrome)) {
|
|
150
|
+
if (!CHROME_TOKEN_SET.has(token))
|
|
151
|
+
continue;
|
|
152
|
+
if (typeof value !== "string" || CSS_WIDE_KEYWORD.test(value.trim()))
|
|
153
|
+
continue;
|
|
154
|
+
root.style.setProperty(`--wgd-${token}`, value);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/** The element form of the option: a `chrome` attribute holding JSON; anything else → nothing. */
|
|
158
|
+
export function parseChromeAttribute(value) {
|
|
159
|
+
if (value === null)
|
|
160
|
+
return undefined;
|
|
161
|
+
try {
|
|
162
|
+
const parsed = JSON.parse(value);
|
|
163
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
|
|
164
|
+
return undefined;
|
|
165
|
+
return parsed;
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
130
171
|
const STYLE_MARKER = "data-widgentic-designer";
|
|
131
172
|
/** Designer chrome stylesheet — injected once per document. */
|
|
132
173
|
export function injectDesignerStyles(doc) {
|
|
@@ -135,38 +176,16 @@ export function injectDesignerStyles(doc) {
|
|
|
135
176
|
const style = doc.createElement("style");
|
|
136
177
|
style.setAttribute(STYLE_MARKER, "chrome");
|
|
137
178
|
style.textContent = `
|
|
138
|
-
/* Chrome
|
|
179
|
+
/* Chrome tokens (CHROME_TOKENS), generated from CHROME_DEFAULTS so the
|
|
180
|
+
exported palette IS the applied one. A host overrides any of them through
|
|
181
|
+
options.chrome (inline on the root, which outranks these rules). Widget
|
|
139
182
|
content inside the preview keeps its own --wg-* theme tokens. */
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
--wgd-hl-key: #0b5fa5; --wgd-hl-str: #0a7a3d; --wgd-hl-num: #b45309;
|
|
147
|
-
--wgd-hl-bool: #7c3aed; --wgd-hl-punct: #7a8494;
|
|
148
|
-
}
|
|
149
|
-
@media (prefers-color-scheme: dark) {
|
|
150
|
-
.wgd-root:not([data-wgd-theme="light"]) {
|
|
151
|
-
--wgd-bg: #0f131c; --wgd-panel: #161b26; --wgd-border: #2a3140;
|
|
152
|
-
--wgd-line: #232a37; --wgd-text: #e5e9f0; --wgd-muted: #96a0b5;
|
|
153
|
-
--wgd-accent: #7aa2f7; --wgd-accent-bg: #1c2740; --wgd-accent-line: #35507f;
|
|
154
|
-
--wgd-danger: #f0a3a3; --wgd-danger-bg: #2a1a1c; --wgd-danger-line: #5c2b2b;
|
|
155
|
-
--wgd-hover: #1e2532;
|
|
156
|
-
--wgd-hl-key: #7aa2f7; --wgd-hl-str: #9ece6a; --wgd-hl-num: #ff9e64;
|
|
157
|
-
--wgd-hl-bool: #bb9af7; --wgd-hl-punct: #8b94a7;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
.wgd-root[data-wgd-theme="dark"] {
|
|
161
|
-
--wgd-bg: #0f131c; --wgd-panel: #161b26; --wgd-border: #2a3140;
|
|
162
|
-
--wgd-line: #232a37; --wgd-text: #e5e9f0; --wgd-muted: #96a0b5;
|
|
163
|
-
--wgd-accent: #7aa2f7; --wgd-accent-bg: #1c2740; --wgd-accent-line: #35507f;
|
|
164
|
-
--wgd-danger: #f0a3a3; --wgd-danger-bg: #2a1a1c; --wgd-danger-line: #5c2b2b;
|
|
165
|
-
--wgd-hover: #1e2532;
|
|
166
|
-
--wgd-hl-key: #7aa2f7; --wgd-hl-str: #9ece6a; --wgd-hl-num: #ff9e64;
|
|
167
|
-
--wgd-hl-bool: #bb9af7; --wgd-hl-punct: #8b94a7;
|
|
168
|
-
}
|
|
169
|
-
.wgd-root { display: flex; gap: 16px; font-family: system-ui, sans-serif; font-size: 13px; align-items: flex-start; color: var(--wgd-text); background: var(--wgd-bg); }
|
|
183
|
+
${chromeCss(CHROME_DEFAULTS, {
|
|
184
|
+
selector: ".wgd-root",
|
|
185
|
+
darkMediaSelector: '.wgd-root:not([data-wgd-theme="light"])',
|
|
186
|
+
darkSelector: '.wgd-root[data-wgd-theme="dark"]'
|
|
187
|
+
})}
|
|
188
|
+
.wgd-root { display: flex; gap: var(--wgd-gap); font-family: var(--wgd-font); font-size: var(--wgd-font-size); align-items: flex-start; color: var(--wgd-text); background: var(--wgd-bg); }
|
|
170
189
|
/* Any chrome class that sets display would silently defeat the hidden
|
|
171
190
|
attribute (learned live twice: the add menu, then the styles tree as a
|
|
172
191
|
tab pane). hidden always wins — scoped to the designer's own tree. */
|
|
@@ -178,7 +197,7 @@ export function injectDesignerStyles(doc) {
|
|
|
178
197
|
.wgd-readonly .wgd-section-body[inert] { opacity: 0.75; }
|
|
179
198
|
/* Empty preview state — shown only when there has never been a valid
|
|
180
199
|
render to freeze on; a blank pane is the one state the contract bans. */
|
|
181
|
-
.wgd-preview-empty { color: var(--wgd-muted); font-style: italic; font-size:
|
|
200
|
+
.wgd-preview-empty { color: var(--wgd-muted); font-style: italic; font-size: var(--wgd-font-size-sm); }
|
|
182
201
|
.wgd-readonly [inert] .wgd-input,
|
|
183
202
|
.wgd-readonly [inert] .wgd-select,
|
|
184
203
|
.wgd-readonly [inert] .wgd-textarea,
|
|
@@ -194,62 +213,62 @@ export function injectDesignerStyles(doc) {
|
|
|
194
213
|
.wgd-panels { flex: 1 1 460px; min-width: 340px; display: flex; flex-direction: column; gap: 8px; }
|
|
195
214
|
.wgd-side { flex: 1 1 420px; min-width: 320px; display: flex; flex-direction: column; gap: 8px; position: sticky; top: 8px; }
|
|
196
215
|
.wgd-preview-pane { display: flex; flex-direction: column; gap: 8px; }
|
|
197
|
-
.wgd-section { border: 1px solid var(--wgd-border); border-radius:
|
|
216
|
+
.wgd-section { border: 1px solid var(--wgd-border); border-radius: var(--wgd-radius-lg); padding: 6px 10px; background: var(--wgd-panel); }
|
|
198
217
|
.wgd-section-title { cursor: pointer; font-weight: 600; }
|
|
199
218
|
.wgd-section-body { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
|
|
200
219
|
.wgd-field { display: flex; flex-direction: column; gap: 2px; }
|
|
201
|
-
.wgd-field-label { color: var(--wgd-muted); font-size:
|
|
202
|
-
.wgd-input, .wgd-textarea, .wgd-select { font: inherit; padding: 4px 6px; border: 1px solid var(--wgd-border); border-radius:
|
|
220
|
+
.wgd-field-label { color: var(--wgd-muted); font-size: var(--wgd-font-size-sm); }
|
|
221
|
+
.wgd-input, .wgd-textarea, .wgd-select { font: inherit; padding: 4px 6px; border: 1px solid var(--wgd-border); border-radius: var(--wgd-radius); background: var(--wgd-bg); color: var(--wgd-text); }
|
|
203
222
|
/* Textareas fill their panel regardless of the intrinsic cols width. */
|
|
204
|
-
.wgd-textarea { font-family:
|
|
205
|
-
.wgd-preview .wg-designer-action { position: relative; outline: 1px dashed var(--wgd-muted
|
|
206
|
-
.wgd-preview .wg-designer-action::after { content: "⚡ action"; position: absolute; top: -0.9em; right: 0; font:
|
|
207
|
-
.wgd-binding { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px; border: 1px dashed var(--wgd-border
|
|
208
|
-
.wgd-binding-field { min-width: 8ch; font-family:
|
|
223
|
+
.wgd-textarea { font-family: var(--wgd-font-mono); white-space: pre; width: 100%; box-sizing: border-box; min-width: 0; resize: vertical; }
|
|
224
|
+
.wgd-preview .wg-designer-action { position: relative; outline: 1px dashed var(--wgd-muted); outline-offset: 2px; }
|
|
225
|
+
.wgd-preview .wg-designer-action::after { content: "⚡ action"; position: absolute; top: -0.9em; right: 0; font: calc(var(--wgd-font-size-xs) - 1px) var(--wgd-font); color: var(--wgd-muted); background: var(--wgd-panel); padding: 0 4px; border-radius: var(--wgd-radius-sm); pointer-events: none; }
|
|
226
|
+
.wgd-binding { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px; border: 1px dashed var(--wgd-border); border-radius: var(--wgd-radius); margin: 4px 0; }
|
|
227
|
+
.wgd-binding-field { min-width: 8ch; font-family: var(--wgd-font-mono); font-size: var(--wgd-font-size-sm); }
|
|
209
228
|
.wgd-action-definition { display: flex; flex-direction: column; gap: 6px; }
|
|
210
229
|
.wgd-action-schema { display: flex; flex-direction: column; gap: 4px; padding: 4px 0; }
|
|
211
|
-
.wgd-test-output { font:
|
|
212
|
-
.wgd-diagnostic { color: var(--wgd-danger); font-size:
|
|
213
|
-
.wgd-banner { border: 1px solid var(--wgd-danger-line); background: var(--wgd-danger-bg); color: var(--wgd-danger); border-radius:
|
|
230
|
+
.wgd-test-output { font: var(--wgd-font-size-sm) var(--wgd-font-mono); white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow: auto; margin: 6px 0 0; }
|
|
231
|
+
.wgd-diagnostic { color: var(--wgd-danger); font-size: var(--wgd-font-size-sm); white-space: pre-wrap; }
|
|
232
|
+
.wgd-banner { border: 1px solid var(--wgd-danger-line); background: var(--wgd-danger-bg); color: var(--wgd-danger); border-radius: var(--wgd-radius-lg); padding: 8px 10px; margin-bottom: 8px; }
|
|
214
233
|
/* The preview is the WIDGET's surface, not chrome: it establishes the
|
|
215
234
|
--wg-* context (like composePage does for page output) so widget content
|
|
216
235
|
— including custom kinds the base stylesheet doesn't color — never
|
|
217
236
|
inherits the designer's own text/background. */
|
|
218
|
-
.wgd-preview { border: 1px dashed var(--wgd-border); border-radius:
|
|
237
|
+
.wgd-preview { border: 1px dashed var(--wgd-border); border-radius: var(--wgd-radius-lg); padding: 16px; background: var(--wg-bg); color: var(--wg-fg); }
|
|
219
238
|
.wgd-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
|
|
220
|
-
.wgd-button { font: inherit; padding: 4px 10px; border: 1px solid var(--wgd-border); border-radius:
|
|
239
|
+
.wgd-button { font: inherit; padding: 4px 10px; border: 1px solid var(--wgd-border); border-radius: var(--wgd-radius); background: var(--wgd-bg); color: var(--wgd-text); cursor: pointer; }
|
|
221
240
|
.wgd-button:hover { background: var(--wgd-hover); }
|
|
222
241
|
.wgd-tab-active { background: var(--wgd-accent-bg); border-color: var(--wgd-accent); }
|
|
223
242
|
/* Shared tree/editor chrome (JSON tree, schema builder/form, template tree) */
|
|
224
243
|
.wgd-jt-children, .wgd-children { margin-left: 10px; padding-left: 10px; border-left: 2px solid var(--wgd-line); display: flex; flex-direction: column; gap: 4px; }
|
|
225
244
|
.wgd-jt-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
|
|
226
245
|
.wgd-jt-entry { padding: 2px 0; }
|
|
227
|
-
.wgd-jt-key { font-family:
|
|
246
|
+
.wgd-jt-key { font-family: var(--wgd-font-mono); color: var(--wgd-muted); min-width: 2ch; }
|
|
228
247
|
.wgd-jt-keyinput, .wgd-jt-type { max-width: 12ch; }
|
|
229
|
-
.wgd-jt-summary { cursor: pointer; color: var(--wgd-muted); font-size:
|
|
230
|
-
.wgd-sf-object { border: 1px solid var(--wgd-line); border-radius:
|
|
248
|
+
.wgd-jt-summary { cursor: pointer; color: var(--wgd-muted); font-size: var(--wgd-font-size-sm); }
|
|
249
|
+
.wgd-sf-object { border: 1px solid var(--wgd-line); border-radius: var(--wgd-radius-lg); padding: 6px 10px; margin: 4px 0; }
|
|
231
250
|
/* Schema builder: property name + type + required on one row. */
|
|
232
251
|
.wgd-sb-node { margin-left: 8px; padding: 1px 0 1px 8px; border-left: 2px solid var(--wgd-line); }
|
|
233
252
|
.wgd-sb-row { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; padding: 1px 0; }
|
|
234
253
|
.wgd-sb-constraints { padding-left: 12px; }
|
|
235
|
-
.wgd-sb-label { color: var(--wgd-muted); font-size:
|
|
236
|
-
.wgd-sb-prop { flex: 1 1 auto; min-width: 6ch; font-family:
|
|
237
|
-
.wgd-sb-type { flex: 0 0 auto; max-width: 11ch; font-size:
|
|
238
|
-
.wgd-sb-req { display: flex; gap: 2px; align-items: center; color: var(--wgd-muted); font-size:
|
|
239
|
-
.wgd-sb-constraint { flex: 1 1 auto; min-width: 6ch; font-size:
|
|
254
|
+
.wgd-sb-label { color: var(--wgd-muted); font-size: var(--wgd-font-size-xs); flex: 0 0 auto; }
|
|
255
|
+
.wgd-sb-prop { flex: 1 1 auto; min-width: 6ch; font-family: var(--wgd-font-mono); }
|
|
256
|
+
.wgd-sb-type { flex: 0 0 auto; max-width: 11ch; font-size: var(--wgd-font-size-sm); }
|
|
257
|
+
.wgd-sb-req { display: flex; gap: 2px; align-items: center; color: var(--wgd-muted); font-size: var(--wgd-font-size-xs); flex: 0 0 auto; }
|
|
258
|
+
.wgd-sb-constraint { flex: 1 1 auto; min-width: 6ch; font-size: var(--wgd-font-size-sm); }
|
|
240
259
|
.wgd-sb-root { padding: 2px 0 2px 8px; border-left: 2px solid transparent; }
|
|
241
260
|
/* Schema builder: the template tree's flat discipline — chrome on
|
|
242
261
|
hover/focus only, removal revealed by the row, fitted type selects. */
|
|
243
|
-
.wgd-schemabuilder .wgd-input, .wgd-schemabuilder .wgd-select { padding: 1px 4px; font-size:
|
|
262
|
+
.wgd-schemabuilder .wgd-input, .wgd-schemabuilder .wgd-select { padding: 1px 4px; font-size: var(--wgd-font-size-sm); border-color: transparent; background: transparent; }
|
|
244
263
|
.wgd-schemabuilder .wgd-input:hover, .wgd-schemabuilder .wgd-select:hover,
|
|
245
264
|
.wgd-schemabuilder .wgd-input:focus, .wgd-schemabuilder .wgd-select:focus { border-color: var(--wgd-border); background: var(--wgd-bg); }
|
|
246
265
|
.wgd-schemabuilder .wgd-sb-type { flex: 0 0 auto; box-sizing: border-box; max-width: none; color: var(--wgd-accent); }
|
|
247
|
-
.wgd-schemabuilder .wgd-sb-prop { font-size:
|
|
248
|
-
.wgd-sb-row { border-radius:
|
|
266
|
+
.wgd-schemabuilder .wgd-sb-prop { font-size: var(--wgd-font-size-sm); color: var(--wgd-hl-key); }
|
|
267
|
+
.wgd-sb-row { border-radius: var(--wgd-radius-sm); }
|
|
249
268
|
.wgd-sb-row:hover { background: var(--wgd-hover); }
|
|
250
269
|
.wgd-sb-row > .wgd-icon { visibility: hidden; }
|
|
251
270
|
.wgd-sb-row:hover > .wgd-icon, .wgd-sb-row:focus-within > .wgd-icon { visibility: visible; }
|
|
252
|
-
.wgd-schemabuilder .wgd-button { font-size:
|
|
271
|
+
.wgd-schemabuilder .wgd-button { font-size: var(--wgd-font-size-xs); padding: 0 6px; border-color: transparent; color: var(--wgd-accent); background: none; }
|
|
253
272
|
.wgd-schemabuilder .wgd-button:hover { border-color: var(--wgd-border); background: var(--wgd-hover); }
|
|
254
273
|
.wgd-remove { color: var(--wgd-danger); }
|
|
255
274
|
/* Breathing room between a tab strip and its active pane. */
|
|
@@ -258,18 +277,18 @@ export function injectDesignerStyles(doc) {
|
|
|
258
277
|
Controls stay flat (chrome appears on hover/focus) so a deep template
|
|
259
278
|
reads like the JSON it projects, not like a form. */
|
|
260
279
|
.wgd-node { padding: 0 0 0 4px; }
|
|
261
|
-
.wgd-node-row { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; padding: 1px 0; border-radius:
|
|
280
|
+
.wgd-node-row { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; padding: 1px 0; border-radius: var(--wgd-radius-sm); }
|
|
262
281
|
.wgd-node-row:hover { background: var(--wgd-hover); }
|
|
263
|
-
.wgd-node-badge { font-family:
|
|
282
|
+
.wgd-node-badge { font-family: var(--wgd-font-mono); font-size: var(--wgd-font-size-xs); color: var(--wgd-accent); background: var(--wgd-accent-bg); border-radius: var(--wgd-radius-sm); padding: 0 5px; flex: 0 0 auto; }
|
|
264
283
|
.wgd-node-icons { display: flex; gap: 2px; margin-left: auto; flex: 0 0 auto; visibility: hidden; }
|
|
265
284
|
.wgd-node-row:hover > .wgd-node-icons, .wgd-node-row:focus-within > .wgd-node-icons { visibility: visible; }
|
|
266
285
|
.wgd-node-value { flex: 1 1 auto; min-width: 4ch; }
|
|
267
|
-
.wgd-icon { font: inherit; font-size:
|
|
286
|
+
.wgd-icon { font: inherit; font-size: var(--wgd-font-size-xs); line-height: 1.4; padding: 0 5px; border: 1px solid var(--wgd-border); border-radius: var(--wgd-radius-sm); background: var(--wgd-bg); cursor: pointer; color: var(--wgd-muted); }
|
|
268
287
|
.wgd-icon:hover { background: var(--wgd-hover); }
|
|
269
288
|
/* Compact controls: inside tree nodes, and wherever a section opts in with
|
|
270
289
|
.wgd-compact (the Load action editor mirrors an element's binding editor). */
|
|
271
290
|
.wgd-node .wgd-input, .wgd-node .wgd-select,
|
|
272
|
-
.wgd-compact .wgd-input, .wgd-compact .wgd-select { padding: 1px 4px; font-size:
|
|
291
|
+
.wgd-compact .wgd-input, .wgd-compact .wgd-select { padding: 1px 4px; font-size: var(--wgd-font-size-sm); border-color: transparent; background: transparent; }
|
|
273
292
|
.wgd-node .wgd-input:hover, .wgd-node .wgd-select:hover, .wgd-compact .wgd-input:hover, .wgd-compact .wgd-select:hover,
|
|
274
293
|
.wgd-node .wgd-input:focus, .wgd-node .wgd-select:focus, .wgd-compact .wgd-input:focus, .wgd-compact .wgd-select:focus { border-color: var(--wgd-border); background: var(--wgd-bg); }
|
|
275
294
|
.wgd-compact .wgd-binding { border: none; padding: 0; }
|
|
@@ -279,82 +298,82 @@ export function injectDesignerStyles(doc) {
|
|
|
279
298
|
@keyframes wgd-spin { to { transform: rotate(360deg); } }
|
|
280
299
|
.wgd-tagwrap, .wgd-pathwrap { display: contents; }
|
|
281
300
|
/* Collapse chevron: every tree row reserves the column so values align. */
|
|
282
|
-
.wgd-chevron { flex: 0 0 auto; width: 16px; padding: 0; border: none; background: none; color: var(--wgd-muted); font-size:
|
|
301
|
+
.wgd-chevron { flex: 0 0 auto; width: 16px; padding: 0; border: none; background: none; color: var(--wgd-muted); font-size: calc(var(--wgd-font-size-xs) - 1px); cursor: pointer; }
|
|
283
302
|
.wgd-chevron-none { visibility: hidden; }
|
|
284
|
-
.wgd-node-summary { color: var(--wgd-muted); font-size:
|
|
303
|
+
.wgd-node-summary { color: var(--wgd-muted); font-size: var(--wgd-font-size-xs); flex: 0 0 auto; }
|
|
285
304
|
/* Attrs vs children: attributes group under a dotted muted rail with
|
|
286
305
|
key-colored names; children keep the solid accent rail. */
|
|
287
306
|
.wgd-attrs { margin-left: 14px; padding-left: 8px; border-left: 2px dotted var(--wgd-border); display: flex; flex-direction: column; gap: 1px; }
|
|
288
307
|
.wgd-attr-row { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; padding: 0; }
|
|
289
308
|
.wgd-attr-row > .wgd-icon { visibility: hidden; }
|
|
290
309
|
.wgd-attr-row:hover > .wgd-icon, .wgd-attr-row:focus-within > .wgd-icon { visibility: visible; }
|
|
291
|
-
.wgd-attr-name { font-family:
|
|
292
|
-
.wgd-attr-prefix { flex: 0 1 auto; min-width: 6ch; max-width: 10ch; font-family:
|
|
310
|
+
.wgd-attr-name { font-family: var(--wgd-font-mono); color: var(--wgd-hl-key); flex: 0 1 auto; min-width: 5ch; }
|
|
311
|
+
.wgd-attr-prefix { flex: 0 1 auto; min-width: 6ch; max-width: 10ch; font-family: var(--wgd-font-mono); color: var(--wgd-hl-str); }
|
|
293
312
|
.wgd-attr { display: flex; flex-direction: column; gap: 1px; }
|
|
294
313
|
/* Transform block under a bind attr: one more dotted level in. */
|
|
295
314
|
.wgd-attr-map { margin-left: 24px; padding-left: 8px; border-left: 2px dotted var(--wgd-border); display: flex; flex-direction: column; gap: 1px; }
|
|
296
315
|
.wgd-attr-map-default { flex: 1 1 auto; min-width: 8ch; }
|
|
297
|
-
.wgd-attr-mode { flex: 0 0 auto; color: var(--wgd-muted); font-size:
|
|
316
|
+
.wgd-attr-mode { flex: 0 0 auto; color: var(--wgd-muted); font-size: var(--wgd-font-size-xs); }
|
|
298
317
|
.wgd-children { margin-left: 14px; padding-left: 8px; border-left: 2px solid var(--wgd-accent-line); gap: 1px; }
|
|
299
318
|
.wgd-slot { display: flex; flex-direction: column; gap: 1px; }
|
|
300
|
-
.wgd-slot-label { color: var(--wgd-muted); font-size:
|
|
319
|
+
.wgd-slot-label { color: var(--wgd-muted); font-size: var(--wgd-font-size-xs); font-style: italic; padding-left: 4px; }
|
|
301
320
|
/* Add menu: one toggle, options in a popover. */
|
|
302
321
|
.wgd-menuwrap { position: relative; display: inline-flex; }
|
|
303
322
|
.wgd-menu-toggle { color: var(--wgd-accent); }
|
|
304
|
-
.wgd-menu { position: absolute; top: 100%; left: 0; z-index: 10; min-width: 9ch; display: flex; flex-direction: column; background: var(--wgd-panel); border: 1px solid var(--wgd-border); border-radius:
|
|
323
|
+
.wgd-menu { position: absolute; top: 100%; left: 0; z-index: 10; min-width: 9ch; display: flex; flex-direction: column; background: var(--wgd-panel); border: 1px solid var(--wgd-border); border-radius: var(--wgd-radius); box-shadow: var(--wgd-shadow); padding: 2px; }
|
|
305
324
|
/* An OPEN menu must not inherit the icons' hover-gated visibility:
|
|
306
325
|
visibility (unlike display) lets a child re-assert visible. */
|
|
307
326
|
.wgd-menu:not([hidden]) { visibility: visible; }
|
|
308
327
|
.wgd-menuwrap:has(> .wgd-menu:not([hidden])) { visibility: visible; }
|
|
309
328
|
/* Menus in the right-aligned icons area hang leftward, not off-panel. */
|
|
310
329
|
.wgd-node-icons .wgd-menu { left: auto; right: 0; }
|
|
311
|
-
.wgd-menu-item { font: inherit; font-size:
|
|
330
|
+
.wgd-menu-item { font: inherit; font-size: var(--wgd-font-size-sm); text-align: left; padding: 3px 8px; border: none; border-radius: var(--wgd-radius-sm); background: none; color: var(--wgd-text); cursor: pointer; white-space: nowrap; }
|
|
312
331
|
.wgd-menu-item:hover { background: var(--wgd-accent-bg); color: var(--wgd-accent); }
|
|
313
332
|
/* Styles tree: selector rows with declaration rows — the same flat
|
|
314
333
|
template-tree discipline (flat inputs, hover-revealed icons). */
|
|
315
334
|
.wgd-styles { display: flex; flex-direction: column; gap: 2px; }
|
|
316
|
-
.wgd-st-row { display: flex; gap: 4px; align-items: center; border-radius:
|
|
335
|
+
.wgd-st-row { display: flex; gap: 4px; align-items: center; border-radius: var(--wgd-radius-sm); }
|
|
317
336
|
.wgd-st-row:hover { background: var(--wgd-hover); }
|
|
318
337
|
.wgd-st-row:hover > .wgd-node-icons, .wgd-st-row:focus-within > .wgd-node-icons { visibility: visible; }
|
|
319
|
-
.wgd-styles .wgd-input { padding: 1px 4px; font-size:
|
|
338
|
+
.wgd-styles .wgd-input { padding: 1px 4px; font-size: var(--wgd-font-size-sm); font-family: var(--wgd-font-mono); border-color: transparent; background: transparent; }
|
|
320
339
|
.wgd-styles .wgd-input:hover, .wgd-styles .wgd-input:focus { border-color: var(--wgd-border); background: var(--wgd-bg); }
|
|
321
340
|
.wgd-st-selector { flex: 1 1 auto; min-width: 8ch; color: var(--wgd-accent); }
|
|
322
341
|
.wgd-st-decls { margin-left: 14px; padding-left: 8px; border-left: 2px dotted var(--wgd-border); display: flex; flex-direction: column; gap: 1px; }
|
|
323
|
-
.wgd-st-decl { display: flex; gap: 2px; align-items: center; border-radius:
|
|
342
|
+
.wgd-st-decl { display: flex; gap: 2px; align-items: center; border-radius: var(--wgd-radius-sm); }
|
|
324
343
|
.wgd-st-decl:hover { background: var(--wgd-hover); }
|
|
325
344
|
.wgd-st-decl > .wgd-icon { visibility: hidden; }
|
|
326
345
|
.wgd-st-decl:hover > .wgd-icon, .wgd-st-decl:focus-within > .wgd-icon { visibility: visible; }
|
|
327
346
|
.wgd-st-prop { flex: 0 1 auto; min-width: 8ch; color: var(--wgd-hl-key); }
|
|
328
347
|
.wgd-st-value { flex: 1 1 auto; min-width: 8ch; }
|
|
329
348
|
.wgd-st-colon { color: var(--wgd-muted); flex: 0 0 auto; }
|
|
330
|
-
.wgd-st-add { font-size:
|
|
349
|
+
.wgd-st-add { font-size: var(--wgd-font-size-xs); padding: 0 6px; border-color: transparent; color: var(--wgd-accent); background: none; }
|
|
331
350
|
.wgd-st-add:hover { border-color: var(--wgd-border); background: var(--wgd-hover); }
|
|
332
351
|
/* Import and export stack as sibling sections with the column's rhythm. */
|
|
333
352
|
.wgd-io { display: flex; flex-direction: column; gap: 8px; }
|
|
334
353
|
/* Flat string→string record rows (hints): mono keys, prose values. */
|
|
335
354
|
.wgd-record { display: flex; flex-direction: column; gap: 1px; }
|
|
336
|
-
.wgd-rec-row { display: flex; gap: 2px; align-items: center; border-radius:
|
|
355
|
+
.wgd-rec-row { display: flex; gap: 2px; align-items: center; border-radius: var(--wgd-radius-sm); }
|
|
337
356
|
.wgd-rec-row:hover { background: var(--wgd-hover); }
|
|
338
357
|
.wgd-rec-row > .wgd-icon { visibility: hidden; }
|
|
339
358
|
.wgd-rec-row:hover > .wgd-icon, .wgd-rec-row:focus-within > .wgd-icon { visibility: visible; }
|
|
340
|
-
.wgd-record .wgd-input { padding: 1px 4px; font-size:
|
|
359
|
+
.wgd-record .wgd-input { padding: 1px 4px; font-size: var(--wgd-font-size-sm); border-color: transparent; background: transparent; }
|
|
341
360
|
.wgd-record .wgd-input:hover, .wgd-record .wgd-input:focus { border-color: var(--wgd-border); background: var(--wgd-bg); }
|
|
342
|
-
.wgd-rec-key { flex: 0 1 auto; min-width: 8ch; font-family:
|
|
361
|
+
.wgd-rec-key { flex: 0 1 auto; min-width: 8ch; font-family: var(--wgd-font-mono); color: var(--wgd-hl-key); }
|
|
343
362
|
.wgd-rec-value { flex: 1 1 auto; min-width: 8ch; }
|
|
344
363
|
/* The tag select IS the element node's label: flat, accent, monospace.
|
|
345
364
|
Tag and path selects are width-fitted to their SELECTED value by the
|
|
346
365
|
panel (fitSelect), so carets hug the text — no flex stretching here. */
|
|
347
|
-
.wgd-node .wgd-tag { flex: 0 0 auto; font-family:
|
|
366
|
+
.wgd-node .wgd-tag { flex: 0 0 auto; font-family: var(--wgd-font-mono); font-size: var(--wgd-font-size-xs); color: var(--wgd-accent); background: var(--wgd-accent-bg); border: 1px solid transparent; border-radius: var(--wgd-radius-sm); padding: 0 4px; }
|
|
348
367
|
.wgd-node .wgd-tag:hover, .wgd-node .wgd-tag:focus { border-color: var(--wgd-accent-line); }
|
|
349
|
-
.wgd-node .wgd-path { flex: 0 1 auto; min-width: 6ch; max-width: 100%; font-family:
|
|
368
|
+
.wgd-node .wgd-path { flex: 0 1 auto; min-width: 6ch; max-width: 100%; font-family: var(--wgd-font-mono); }
|
|
350
369
|
.wgd-node .wgd-select { box-sizing: border-box; }
|
|
351
370
|
/* Theme panel: swatch beside each color token. */
|
|
352
371
|
/* Syntax coloring: <pre> layer behind a transparent-text textarea. Every
|
|
353
372
|
metric here must mirror .wgd-textarea or the glyphs drift apart. */
|
|
354
373
|
.wgd-hlwrap { position: relative; }
|
|
355
374
|
.wgd-hl, .wgd-hl-input {
|
|
356
|
-
font-family:
|
|
357
|
-
padding: 4px 6px; border: 1px solid transparent; border-radius:
|
|
375
|
+
font-family: var(--wgd-font-mono); font-size: var(--wgd-font-size); line-height: 1.45;
|
|
376
|
+
padding: 4px 6px; border: 1px solid transparent; border-radius: var(--wgd-radius);
|
|
358
377
|
box-sizing: border-box; white-space: pre; tab-size: 2; letter-spacing: normal;
|
|
359
378
|
}
|
|
360
379
|
.wgd-hl {
|
|
@@ -371,14 +390,14 @@ textarea.wgd-hl-input {
|
|
|
371
390
|
.wgd-hl-n { color: var(--wgd-hl-num); }
|
|
372
391
|
.wgd-hl-b { color: var(--wgd-hl-bool); }
|
|
373
392
|
.wgd-hl-p { color: var(--wgd-hl-punct); }
|
|
374
|
-
.wgd-swatch { flex: 0 0 auto; width: 26px; height: 22px; padding: 0; border: 1px solid var(--wgd-border); border-radius:
|
|
393
|
+
.wgd-swatch { flex: 0 0 auto; width: 26px; height: 22px; padding: 0; border: 1px solid var(--wgd-border); border-radius: var(--wgd-radius); background: none; cursor: pointer; }
|
|
375
394
|
.wgd-token-row { display: flex; gap: 6px; align-items: center; }
|
|
376
|
-
.wgd-token-row .wgd-input { flex: 1 1 auto; min-width: 6ch; font-family:
|
|
395
|
+
.wgd-token-row .wgd-input { flex: 1 1 auto; min-width: 6ch; font-family: var(--wgd-font-mono); font-size: var(--wgd-font-size-sm); }
|
|
377
396
|
.wgd-token-ref { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; margin-top: 4px; }
|
|
378
|
-
.wgd-token-ref-row { display: flex; gap: 6px; align-items: center; font-size:
|
|
379
|
-
.wgd-token-ref-swatch { flex: 0 0 auto; width: 14px; height: 14px; border: 1px solid var(--wgd-border); border-radius:
|
|
397
|
+
.wgd-token-ref-row { display: flex; gap: 6px; align-items: center; font-size: var(--wgd-font-size-xs); }
|
|
398
|
+
.wgd-token-ref-swatch { flex: 0 0 auto; width: 14px; height: 14px; border: 1px solid var(--wgd-border); border-radius: var(--wgd-radius-sm); }
|
|
380
399
|
.wgd-token-ref-noswatch { border-style: dashed; opacity: 0.35; }
|
|
381
|
-
.wgd-token-ref-name { font-family:
|
|
400
|
+
.wgd-token-ref-name { font-family: var(--wgd-font-mono); color: var(--wgd-accent); }
|
|
382
401
|
.wgd-token-ref-value { color: var(--wgd-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
383
402
|
.wgd-token-ref-details summary { cursor: pointer; }
|
|
384
403
|
`;
|
package/dist/dom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.js","sourceRoot":"","sources":["../src/dom.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"dom.js","sourceRoot":"","sources":["../src/dom.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAKjF,8FAA8F;AAC9F,MAAM,UAAU,YAAY,CAC1B,MAAkB,EAClB,QAAW;IAEX,MAAM,KAAK,GAAG,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC7C,IAAI,KAAK,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,QAAQ,YAAY,CAAC,CAAC;IAC3F,OAAO,KAAK,CAAC;AACf,CAAC;AAQD,MAAM,UAAU,CAAC,CAAC,GAAW,EAAE,KAA8B,EAAE,QAAkB;IAC/E,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC5C,IAAI,KAAK,EAAE,CAAC;QACV,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,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IAC3C,KAAK,CAAC,WAAW,GAAG;;;;;EAKpB,SAAS,CAAC,eAAe,EAAE;QAC3B,QAAQ,EAAE,WAAW;QACrB,iBAAiB,EAAE,yCAAyC;QAC5D,YAAY,EAAE,kCAAkC;KACjD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwND,CAAC;IACA,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}
|
package/dist/element.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAChD,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAC5D,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAC9D,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,MAAoB,GAAG,IAAI,CAkCzE;AAED,2DAA2D;AAC3D,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,MAA0B,GAAG,IAAI,CA8BpF;AAED,4DAA4D;AAC5D,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,MAA2B,GAAG,IAAI,CA8BtF;AAED,4DAA4D;AAC5D,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,MAA2B,GAAG,IAAI,CA8BtF"}
|