dishui 0.0.48 → 0.0.49

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.
@@ -3,15 +3,16 @@
3
3
  * `var(--color-base-100)` that may use `oklch(...)`) into a concrete sRGB color
4
4
  * for the WebGL canvas.
5
5
  *
6
- * PixiJS needs a numeric/hex color and cannot read CSS variables. We resolve in
7
- * two steps:
8
- * 1. A hidden probe element inherits the themed scope; setting its `color` to
9
- * the requested value and reading `getComputedStyle().color` resolves the
10
- * CSS variable. Note modern browsers return this in the value's ORIGINAL
11
- * color space (e.g. `oklch(...)`), NOT `rgb(...)`.
12
- * 2. Rasterize that resolved string onto a 1x1 canvas and read the pixel back,
13
- * which always yields concrete sRGB bytes regardless of the source color
14
- * space. This is what keeps the Flow canvas in sync with any DishUI theme.
6
+ * PixiJS needs a numeric/hex color and cannot read CSS variables. Resolution:
7
+ * 1. A hidden probe element inherits the themed scope. Its `color` is set to
8
+ * `color-mix(in srgb, <value> 100%, transparent)`, which forces the
9
+ * browser to convert the color into the sRGB space at computed-value
10
+ * time. `getComputedStyle` then serializes it as a plain `rgb(...)` or
11
+ * `color(srgb ...)` string.
12
+ * 2. That string is parsed directly (no canvas). Canvas rasterization is
13
+ * only a last resort: some engines silently reject CSS Color 4 functions
14
+ * (`oklch()`, `lab()`, `color()`) in `fillStyle`, which previously turned
15
+ * every probed theme color black.
15
16
  */
16
17
  /** Resolve a CSS color to a 0xRRGGBB number (for PixiJS). */
17
18
  export declare function cssColorToNumber(host: HTMLElement | null, cssValue: string, fallback: number): number;
@@ -1,12 +1,12 @@
1
- var o = null;
2
- function m() {
3
- if (o) return o;
1
+ var l = null;
2
+ function d() {
3
+ if (l) return l;
4
4
  if (typeof document > "u") return null;
5
5
  const e = document.createElement("canvas");
6
- return e.width = 1, e.height = 1, o = e.getContext("2d", { willReadFrequently: !0 }), o;
6
+ return e.width = 1, e.height = 1, l = e.getContext("2d", { willReadFrequently: !0 }), l;
7
7
  }
8
8
  function v(e) {
9
- const r = m();
9
+ const r = d();
10
10
  if (!r) return null;
11
11
  try {
12
12
  r.clearRect(0, 0, 1, 1), r.fillStyle = "#000000", r.fillStyle = e, r.fillRect(0, 0, 1, 1);
@@ -20,34 +20,56 @@ function v(e) {
20
20
  return null;
21
21
  }
22
22
  }
23
- function c(e, r) {
23
+ function o(e) {
24
+ return Math.max(0, Math.min(255, Math.round(e)));
25
+ }
26
+ function h(e) {
27
+ const r = /^rgba?\(\s*([\d.eE+-]+)[\s,]+([\d.eE+-]+)[\s,]+([\d.eE+-]+)/.exec(e);
28
+ if (r) return [
29
+ o(+r[1]),
30
+ o(+r[2]),
31
+ o(+r[3])
32
+ ];
33
+ const t = /^color\(\s*srgb\s+([\d.eE+-]+)\s+([\d.eE+-]+)\s+([\d.eE+-]+)/i.exec(e);
34
+ return t ? [
35
+ o(+t[1] * 255),
36
+ o(+t[2] * 255),
37
+ o(+t[3] * 255)
38
+ ] : null;
39
+ }
40
+ var p = typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("color", "color-mix(in srgb, red, blue)");
41
+ function i(e, r) {
24
42
  if (typeof document > "u") return null;
25
43
  try {
26
44
  const t = document.createElement("span");
27
- t.style.position = "absolute", t.style.width = "0", t.style.height = "0", t.style.overflow = "hidden", t.style.pointerEvents = "none", t.style.color = r, (e ?? document.body).appendChild(t);
28
- const n = getComputedStyle(t).color;
29
- return t.remove(), v(n);
45
+ t.style.position = "absolute", t.style.width = "0", t.style.height = "0", t.style.overflow = "hidden", t.style.pointerEvents = "none", (e ?? document.body).appendChild(t);
46
+ const n = /^var\(\s*(--[\w-]+)\s*\)$/.exec(r);
47
+ if (n && !getComputedStyle(t).getPropertyValue(n[1]).trim())
48
+ return t.remove(), null;
49
+ t.style.color = p ? `color-mix(in srgb, ${r} 100%, transparent)` : r;
50
+ const a = getComputedStyle(t).color;
51
+ return t.remove(), h(a) ?? v(a);
30
52
  } catch {
31
53
  return null;
32
54
  }
33
55
  }
34
- function s(e, r, t) {
35
- const n = c(e, r);
56
+ function u(e, r, t) {
57
+ const n = i(e, r);
36
58
  return n ? n[0] << 16 | n[1] << 8 | n[2] : t;
37
59
  }
38
- function a(e, r, t) {
39
- const n = c(e, r);
40
- return n ? "#" + n.map((b) => b.toString(16).padStart(2, "0")).join("") : t;
60
+ function s(e, r, t) {
61
+ const n = i(e, r);
62
+ return n ? "#" + n.map((a) => a.toString(16).padStart(2, "0")).join("") : t;
41
63
  }
42
- function h(e) {
64
+ function g(e) {
43
65
  return {
44
- background: s(e, "var(--color-base-200)", 16316922),
45
- gridDot: s(e, "var(--color-base-content)", 13751771),
46
- nodeFill: a(e, "var(--color-base-100)", "#ffffff"),
47
- nodeText: a(e, "var(--color-base-content)", "#111827")
66
+ background: u(e, "var(--color-base-200)", 16316922),
67
+ gridDot: u(e, "var(--color-base-content)", 13751771),
68
+ nodeFill: s(e, "var(--color-base-100)", "#ffffff"),
69
+ nodeText: s(e, "var(--color-base-content)", "#111827")
48
70
  };
49
71
  }
50
- var d = "theme:", l = [
72
+ var y = "theme:", c = [
51
73
  {
52
74
  token: "theme:base-100",
53
75
  cssVar: "var(--color-base-100)",
@@ -108,16 +130,16 @@ var d = "theme:", l = [
108
130
  cssVar: "var(--color-error)",
109
131
  label: "Error"
110
132
  }
111
- ], u = new Map(l.map((e) => [e.token, e.cssVar])), p = new Map(l.map((e) => [e.token, e.label])), y = {
133
+ ], f = new Map(c.map((e) => [e.token, e.cssVar])), C = new Map(c.map((e) => [e.token, e.label])), S = {
112
134
  fill: "theme:base-100",
113
135
  stroke: "theme:base-content",
114
136
  text: "theme:base-content",
115
137
  line: "theme:base-content"
116
138
  };
117
- function g(e) {
118
- return u.get(e);
139
+ function E(e) {
140
+ return f.get(e);
119
141
  }
120
- var C = [
142
+ var T = [
121
143
  {
122
144
  value: "#000000",
123
145
  label: "黑"
@@ -159,32 +181,32 @@ var C = [
159
181
  label: "粉"
160
182
  }
161
183
  ];
162
- function i(e) {
184
+ function b(e) {
163
185
  return typeof e == "string" && e.startsWith("theme:");
164
186
  }
165
- var f = /* @__PURE__ */ new Map();
166
- function T(e) {
167
- for (const { token: r, cssVar: t } of l) f.set(r, a(e, t, "#000000"));
187
+ var m = /* @__PURE__ */ new Map();
188
+ function k(e) {
189
+ for (const { token: r, cssVar: t } of c) m.set(r, s(e, t, "#000000"));
168
190
  }
169
- function k(e, r = "#000000") {
170
- return e ? i(e) ? f.get(e) ?? r : e : r;
191
+ function O(e, r = "#000000") {
192
+ return e ? b(e) ? m.get(e) ?? r : e : r;
171
193
  }
172
- function E(e, r = "#000000") {
173
- return e ? i(e) ? u.get(e) ?? r : e : r;
194
+ function V(e, r = "#000000") {
195
+ return e ? b(e) ? f.get(e) ?? r : e : r;
174
196
  }
175
197
  export {
176
- C as COMMON_COLORS,
177
- d as THEME_COLOR_PREFIX,
178
- l as THEME_COLOR_TOKENS,
179
- y as THEME_SYNC_TOKEN,
180
- a as cssColorToHexString,
181
- s as cssColorToNumber,
182
- i as isThemeToken,
183
- T as refreshThemePalette,
184
- h as resolveFlowThemeColors,
185
- k as resolveThemeColor,
186
- E as resolveThemeColorCss,
187
- g as themeTokenCssVar
198
+ T as COMMON_COLORS,
199
+ y as THEME_COLOR_PREFIX,
200
+ c as THEME_COLOR_TOKENS,
201
+ S as THEME_SYNC_TOKEN,
202
+ s as cssColorToHexString,
203
+ u as cssColorToNumber,
204
+ b as isThemeToken,
205
+ k as refreshThemePalette,
206
+ g as resolveFlowThemeColors,
207
+ O as resolveThemeColor,
208
+ V as resolveThemeColorCss,
209
+ E as themeTokenCssVar
188
210
  };
189
211
 
190
212
  //# sourceMappingURL=themeColor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"themeColor.js","names":[],"sources":["../../../../../src/components/pro/Flow/utils/themeColor.ts"],"sourcesContent":["/**\n * Resolve a CSS color value (including theme custom properties like\n * `var(--color-base-100)` that may use `oklch(...)`) into a concrete sRGB color\n * for the WebGL canvas.\n *\n * PixiJS needs a numeric/hex color and cannot read CSS variables. We resolve in\n * two steps:\n * 1. A hidden probe element inherits the themed scope; setting its `color` to\n * the requested value and reading `getComputedStyle().color` resolves the\n * CSS variable. Note modern browsers return this in the value's ORIGINAL\n * color space (e.g. `oklch(...)`), NOT `rgb(...)`.\n * 2. Rasterize that resolved string onto a 1x1 canvas and read the pixel back,\n * which always yields concrete sRGB bytes regardless of the source color\n * space. This is what keeps the Flow canvas in sync with any DishUI theme.\n */\n\nlet _rasterCtx: CanvasRenderingContext2D | null = null;\nfunction getRasterCtx(): CanvasRenderingContext2D | null {\n if (_rasterCtx) return _rasterCtx;\n if (typeof document === 'undefined') return null;\n const canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n _rasterCtx = canvas.getContext('2d', { willReadFrequently: true });\n return _rasterCtx;\n}\n\n/** Rasterize any CSS color string to concrete sRGB bytes. */\nfunction rasterizeColor(cssColor: string): [number, number, number] | null {\n const ctx = getRasterCtx();\n if (!ctx) return null;\n try {\n ctx.clearRect(0, 0, 1, 1);\n ctx.fillStyle = '#000000';\n ctx.fillStyle = cssColor; // ignored if the browser can't parse it\n ctx.fillRect(0, 0, 1, 1);\n const { data } = ctx.getImageData(0, 0, 1, 1);\n return [data[0], data[1], data[2]];\n } catch {\n return null;\n }\n}\n\nfunction parseRgb(host: HTMLElement | null, cssValue: string): [number, number, number] | null {\n if (typeof document === 'undefined') return null;\n try {\n const probe = document.createElement('span');\n // Keep out of layout without `display:none` so `color` still resolves.\n probe.style.position = 'absolute';\n probe.style.width = '0';\n probe.style.height = '0';\n probe.style.overflow = 'hidden';\n probe.style.pointerEvents = 'none';\n probe.style.color = cssValue;\n (host ?? document.body).appendChild(probe);\n const resolved = getComputedStyle(probe).color;\n probe.remove();\n // `resolved` may be `oklch(...)`, `color(...)`, `rgb(...)`, etc. Rasterize\n // it to get concrete sRGB bytes rather than guessing at the components.\n return rasterizeColor(resolved);\n } catch {\n return null;\n }\n}\n\n/** Resolve a CSS color to a 0xRRGGBB number (for PixiJS). */\nexport function cssColorToNumber(host: HTMLElement | null, cssValue: string, fallback: number): number {\n const rgb = parseRgb(host, cssValue);\n if (!rgb) return fallback;\n return (rgb[0] << 16) | (rgb[1] << 8) | rgb[2];\n}\n\n/** Resolve a CSS color to a `#rrggbb` string (for persisted node data). */\nexport function cssColorToHexString(host: HTMLElement | null, cssValue: string, fallback: string): string {\n const rgb = parseRgb(host, cssValue);\n if (!rgb) return fallback;\n return '#' + rgb.map((c) => c.toString(16).padStart(2, '0')).join('');\n}\n\n/**\n * The colors the Flow canvas derives from the active theme:\n * - `background`: the canvas backdrop, follows the theme's muted background.\n * - `gridDot`: grid dots, derived from the theme foreground color.\n * - `nodeFill`: default fill for new shapes, follows the theme base background.\n */\nexport interface FlowThemeColors {\n background: number;\n gridDot: number;\n nodeFill: string;\n nodeText: string;\n}\n\nexport function resolveFlowThemeColors(host: HTMLElement | null): FlowThemeColors {\n return {\n background: cssColorToNumber(host, 'var(--color-base-200)', 0xf8f9fa),\n gridDot: cssColorToNumber(host, 'var(--color-base-content)', 0xd1d5db),\n nodeFill: cssColorToHexString(host, 'var(--color-base-100)', '#ffffff'),\n nodeText: cssColorToHexString(host, 'var(--color-base-content)', '#111827'),\n };\n}\n\n/* ============================================================================\n * Theme color tokens\n *\n * Node/edge colors may be stored either as a literal color (`#rrggbb`,\n * `transparent`, …) or as a THEME TOKEN of the form `theme:<name>` (e.g.\n * `theme:base-100`). Theme tokens are resolved to the live theme color at\n * render time, so shapes that use them re-color automatically whenever the\n * DishUI theme changes. These tokens are the default colors for new shapes.\n * ========================================================================== */\n\nexport const THEME_COLOR_PREFIX = 'theme:';\n\n/** A selectable theme color, shown as a swatch in the inspector. */\nexport interface ThemeColorToken {\n /** Stored value, e.g. `theme:base-100`. */\n token: string;\n /** CSS custom property backing the token. */\n cssVar: string;\n /** Short label for the inspector tooltip. */\n label: string;\n}\n\n/** The theme colors offered as presets/defaults for Flow color fields. */\nexport const THEME_COLOR_TOKENS: ThemeColorToken[] = [\n { token: 'theme:base-100', cssVar: 'var(--color-base-100)', label: 'Base 100' },\n { token: 'theme:base-200', cssVar: 'var(--color-base-200)', label: 'Base 200' },\n { token: 'theme:base-300', cssVar: 'var(--color-base-300)', label: 'Base 300' },\n { token: 'theme:base-content', cssVar: 'var(--color-base-content)', label: 'Base Content' },\n { token: 'theme:primary', cssVar: 'var(--color-primary)', label: 'Primary' },\n { token: 'theme:secondary', cssVar: 'var(--color-secondary)', label: 'Secondary' },\n { token: 'theme:accent', cssVar: 'var(--color-accent)', label: 'Accent' },\n { token: 'theme:neutral', cssVar: 'var(--color-neutral)', label: 'Neutral' },\n { token: 'theme:info', cssVar: 'var(--color-info)', label: 'Info' },\n { token: 'theme:success', cssVar: 'var(--color-success)', label: 'Success' },\n { token: 'theme:warning', cssVar: 'var(--color-warning)', label: 'Warning' },\n { token: 'theme:error', cssVar: 'var(--color-error)', label: 'Error' },\n];\n\nconst TOKEN_TO_CSSVAR = new Map(THEME_COLOR_TOKENS.map((t) => [t.token, t.cssVar]));\nconst TOKEN_TO_LABEL = new Map(THEME_COLOR_TOKENS.map((t) => [t.token, t.label]));\n\n/**\n * The \"follow theme\" default token for each color field type. Each field syncs\n * to a theme role so shapes stay legible against the canvas:\n * - `fill` -> theme background (base-100)\n * - `stroke` -> theme font color (base-content) — a visible outline\n * - `text` -> theme font color (base-content)\n * - `line` -> theme font color (base-content) — lines/edges\n */\nexport type ThemeColorFieldKind = 'fill' | 'stroke' | 'text' | 'line';\n\nexport const THEME_SYNC_TOKEN: Record<ThemeColorFieldKind, string> = {\n fill: 'theme:base-100',\n stroke: 'theme:base-content',\n text: 'theme:base-content',\n line: 'theme:base-content',\n};\n\n/** The CSS var backing a given theme token (for live-updating DOM swatches). */\nexport function themeTokenCssVar(token: string): string | undefined {\n return TOKEN_TO_CSSVAR.get(token);\n}\n\n/** Human label for a theme token (for tooltips). */\nexport function themeTokenLabel(token: string): string | undefined {\n return TOKEN_TO_LABEL.get(token);\n}\n\n/**\n * Common named colors offered after the theme-sync swatch: a compact rainbow\n * plus black/white. Order follows 黑白赤橙黄绿青蓝紫粉 (black, white, red,\n * orange, yellow, green, cyan, blue, purple, pink).\n */\nexport interface NamedColor {\n value: string;\n /** Chinese label shown on hover. */\n label: string;\n}\n\nexport const COMMON_COLORS: NamedColor[] = [\n { value: '#000000', label: '黑' },\n { value: '#ffffff', label: '白' },\n { value: '#ef4444', label: '赤' },\n { value: '#f97316', label: '橙' },\n { value: '#eab308', label: '黄' },\n { value: '#22c55e', label: '绿' },\n { value: '#06b6d4', label: '青' },\n { value: '#3b82f6', label: '蓝' },\n { value: '#8b5cf6', label: '紫' },\n { value: '#ec4899', label: '粉' },\n];\n\n/** True when `value` is a `theme:*` token. */\nexport function isThemeToken(value: string | undefined | null): value is string {\n return typeof value === 'string' && value.startsWith(THEME_COLOR_PREFIX);\n}\n\n// Module-level cache of the currently resolved token -> `#rrggbb` mapping. The\n// render loop resolves tokens against this cache (cheap, synchronous) instead\n// of probing the DOM every frame. `refreshThemePalette` rebuilds it whenever\n// the theme changes.\nconst _palette = new Map<string, string>();\n\n/**\n * Re-resolve every theme token against the given host's themed scope and cache\n * the results. Call on init and whenever the active theme changes.\n */\nexport function refreshThemePalette(host: HTMLElement | null): void {\n for (const { token, cssVar } of THEME_COLOR_TOKENS) {\n _palette.set(token, cssColorToHexString(host, cssVar, '#000000'));\n }\n}\n\n/**\n * Resolve a stored color value to a concrete `#rrggbb`/literal color. Theme\n * tokens are looked up in the cached palette; anything else is returned as-is.\n */\nexport function resolveThemeColor(value: string | undefined | null, fallback = '#000000'): string {\n if (!value) return fallback;\n if (isThemeToken(value)) return _palette.get(value) ?? fallback;\n return value;\n}\n\n/**\n * Resolve a stored color to a value usable directly in the DOM. Theme tokens\n * map to their CSS variable so the browser tracks theme changes natively.\n */\nexport function resolveThemeColorCss(value: string | undefined | null, fallback = '#000000'): string {\n if (!value) return fallback;\n if (isThemeToken(value)) return TOKEN_TO_CSSVAR.get(value) ?? fall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AAA,EAAI;AAAA,EAC/B;AAAA,IAAE,OAAO;AAAA,IAAW,OAAO;AAAA,EAAI;AACjC;AAGA,SAAgB,EAAa,GAAmD;AAC9E,SAAO,OAAO,KAAU,YAAY,EAAM,WAAA,QAA6B;AACzE;AAMA,IAAM,IAAW,oBAAI,IAAoB;AAMzC,SAAgB,EAAoB,GAAgC;AAClE,aAAW,EAAE,OAAA,GAAO,QAAA,EAAA,KAAY,EAC9B,CAAA,EAAS,IAAI,GAAO,EAAoB,GAAM,GAAQ,SAAS,CAAC;AAEpE;AAMA,SAAgB,EAAkB,GAAkC,IAAW,WAAmB;AAChG,SAAK,IACD,EAAa,CAAK,IAAU,EAAS,IAAI,CAAK,KAAK,IAChD,IAFY;AAGrB;AAMA,SAAgB,EAAqB,GAAkC,IAAW,WAAmB;AACnG,SAAK,IACD,EAAa,CAAK,IAAU,EAAgB,IAAI,CAAK,KAAK,IACvD,IAFY;AAGrB"}
1
+ {"version":3,"file":"themeColor.js","names":[],"sources":["../../../../../src/components/pro/Flow/utils/themeColor.ts"],"sourcesContent":["/**\n * Resolve a CSS color value (including theme custom properties like\n * `var(--color-base-100)` that may use `oklch(...)`) into a concrete sRGB color\n * for the WebGL canvas.\n *\n * PixiJS needs a numeric/hex color and cannot read CSS variables. Resolution:\n * 1. A hidden probe element inherits the themed scope. Its `color` is set to\n * `color-mix(in srgb, <value> 100%, transparent)`, which forces the\n * browser to convert the color into the sRGB space at computed-value\n * time. `getComputedStyle` then serializes it as a plain `rgb(...)` or\n * `color(srgb ...)` string.\n * 2. That string is parsed directly (no canvas). Canvas rasterization is\n * only a last resort: some engines silently reject CSS Color 4 functions\n * (`oklch()`, `lab()`, `color()`) in `fillStyle`, which previously turned\n * every probed theme color black.\n */\n\nlet _rasterCtx: CanvasRenderingContext2D | null = null;\nfunction getRasterCtx(): CanvasRenderingContext2D | null {\n if (_rasterCtx) return _rasterCtx;\n if (typeof document === 'undefined') return null;\n const canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n _rasterCtx = canvas.getContext('2d', { willReadFrequently: true });\n return _rasterCtx;\n}\n\n/** Rasterize any CSS color string to concrete sRGB bytes. */\nfunction rasterizeColor(cssColor: string): [number, number, number] | null {\n const ctx = getRasterCtx();\n if (!ctx) return null;\n try {\n ctx.clearRect(0, 0, 1, 1);\n ctx.fillStyle = '#000000';\n ctx.fillStyle = cssColor; // ignored if the browser can't parse it\n ctx.fillRect(0, 0, 1, 1);\n const { data } = ctx.getImageData(0, 0, 1, 1);\n return [data[0], data[1], data[2]];\n } catch {\n return null;\n }\n}\n\nfunction byte(v: number): number {\n return Math.max(0, Math.min(255, Math.round(v)));\n}\n\n/**\n * Parse the sRGB strings a browser serializes a computed color to when the\n * color was forced into the sRGB space: `rgb(...)` / `rgba(...)` (0-255\n * channels) or `color(srgb r g b / a)` (0-1 float channels).\n */\nfunction parseSrgbString(value: string): [number, number, number] | null {\n const rgb = /^rgba?\\(\\s*([\\d.eE+-]+)[\\s,]+([\\d.eE+-]+)[\\s,]+([\\d.eE+-]+)/.exec(value);\n if (rgb) return [byte(+rgb[1]), byte(+rgb[2]), byte(+rgb[3])];\n const fn = /^color\\(\\s*srgb\\s+([\\d.eE+-]+)\\s+([\\d.eE+-]+)\\s+([\\d.eE+-]+)/i.exec(value);\n if (fn) return [byte(+fn[1] * 255), byte(+fn[2] * 255), byte(+fn[3] * 255)];\n return null;\n}\n\n/** Whether the browser computes color-mix() (used to force sRGB output). */\nconst SUPPORTS_COLOR_MIX =\n typeof CSS !== 'undefined' &&\n typeof CSS.supports === 'function' &&\n CSS.supports('color', 'color-mix(in srgb, red, blue)');\n\nfunction parseRgb(host: HTMLElement | null, cssValue: string): [number, number, number] | null {\n if (typeof document === 'undefined') return null;\n try {\n const probe = document.createElement('span');\n // Keep out of layout without `display:none` so `color` still resolves.\n probe.style.position = 'absolute';\n probe.style.width = '0';\n probe.style.height = '0';\n probe.style.overflow = 'hidden';\n probe.style.pointerEvents = 'none';\n (host ?? document.body).appendChild(probe);\n // Bail out when the requested custom property is undefined in this scope:\n // var() would invalidate the declaration and the probe would report its\n // inherited text color instead of the theme color.\n const varMatch = /^var\\(\\s*(--[\\w-]+)\\s*\\)$/.exec(cssValue);\n if (varMatch && !getComputedStyle(probe).getPropertyValue(varMatch[1]).trim()) {\n probe.remove();\n return null;\n }\n // Force the resolved color into the sRGB space at computed-value time, so\n // the serialized result is a plain rgb()/color(srgb) string we can parse\n // ourselves. Do NOT rasterize oklch()/lab() via canvas fillStyle here:\n // some engines (e.g. WebKit) silently reject CSS Color 4 functions in\n // canvas, which used to turn every probed theme color black.\n probe.style.color = SUPPORTS_COLOR_MIX\n ? `color-mix(in srgb, ${cssValue} 100%, transparent)`\n : cssValue;\n const resolved = getComputedStyle(probe).color;\n probe.remove();\n return parseSrgbString(resolved) ?? rasterizeColor(resolved);\n } catch {\n return null;\n }\n}\n\n/** Resolve a CSS color to a 0xRRGGBB number (for PixiJS). */\nexport function cssColorToNumber(host: HTMLElement | null, cssValue: string, fallback: number): number {\n const rgb = parseRgb(host, cssValue);\n if (!rgb) return fallback;\n return (rgb[0] << 16) | (rgb[1] << 8) | rgb[2];\n}\n\n/** Resolve a CSS color to a `#rrggbb` string (for persisted node data). */\nexport function cssColorToHexString(host: HTMLElement | null, cssValue: string, fallback: string): string {\n const rgb = parseRgb(host, cssValue);\n if (!rgb) return fallback;\n return '#' + rgb.map((c) => c.toString(16).padStart(2, '0')).join('');\n}\n\n/**\n * The colors the Flow canvas derives from the active theme:\n * - `background`: the canvas backdrop, follows the theme's muted background.\n * - `gridDot`: grid dots, derived from the theme foreground color.\n * - `nodeFill`: default fill for new shapes, follows the theme base background.\n */\nexport interface FlowThemeColors {\n background: number;\n gridDot: number;\n nodeFill: string;\n nodeText: string;\n}\n\nexport function resolveFlowThemeColors(host: HTMLElement | null): FlowThemeColors {\n return {\n background: cssColorToNumber(host, 'var(--color-base-200)', 0xf8f9fa),\n gridDot: cssColorToNumber(host, 'var(--color-base-content)', 0xd1d5db),\n nodeFill: cssColorToHexString(host, 'var(--color-base-100)', '#ffffff'),\n nodeText: cssColorToHexString(host, 'var(--color-base-content)', '#111827'),\n };\n}\n\n/* ============================================================================\n * Theme color tokens\n *\n * Node/edge colors may be stored either as a literal color (`#rrggbb`,\n * `transparent`, …) or as a THEME TOKEN of the form `theme:<name>` (e.g.\n * `theme:base-100`). Theme tokens are resolved to the live theme color at\n * render time, so shapes that use them re-color automatically whenever the\n * DishUI theme changes. These tokens are the default colors for new shapes.\n * ========================================================================== */\n\nexport const THEME_COLOR_PREFIX = 'theme:';\n\n/** A selectable theme color, shown as a swatch in the inspector. */\nexport interface ThemeColorToken {\n /** Stored value, e.g. `theme:base-100`. */\n token: string;\n /** CSS custom property backing the token. */\n cssVar: string;\n /** Short label for the inspector tooltip. */\n label: string;\n}\n\n/** The theme colors offered as presets/defaults for Flow color fields. */\nexport const THEME_COLOR_TOKENS: ThemeColorToken[] = [\n { token: 'theme:base-100', cssVar: 'var(--color-base-100)', label: 'Base 100' },\n { token: 'theme:base-200', cssVar: 'var(--color-base-200)', label: 'Base 200' },\n { token: 'theme:base-300', cssVar: 'var(--color-base-300)', label: 'Base 300' },\n { token: 'theme:base-content', cssVar: 'var(--color-base-content)', label: 'Base Content' },\n { token: 'theme:primary', cssVar: 'var(--color-primary)', label: 'Primary' },\n { token: 'theme:secondary', cssVar: 'var(--color-secondary)', label: 'Secondary' },\n { token: 'theme:accent', cssVar: 'var(--color-accent)', label: 'Accent' },\n { token: 'theme:neutral', cssVar: 'var(--color-neutral)', label: 'Neutral' },\n { token: 'theme:info', cssVar: 'var(--color-info)', label: 'Info' },\n { token: 'theme:success', cssVar: 'var(--color-success)', label: 'Success' },\n { token: 'theme:warning', cssVar: 'var(--color-warning)', label: 'Warning' },\n { token: 'theme:error', cssVar: 'var(--color-error)', label: 'Error' },\n];\n\nconst TOKEN_TO_CSSVAR = new Map(THEME_COLOR_TOKENS.map((t) => [t.token, t.cssVar]));\nconst TOKEN_TO_LABEL = new Map(THEME_COLOR_TOKENS.map((t) => [t.token, t.label]));\n\n/**\n * The \"follow theme\" default token for each color field type. Each field syncs\n * to a theme role so shapes stay legible against the canvas:\n * - `fill` -> theme background (base-100)\n * - `stroke` -> theme font color (base-content) — a visible outline\n * - `text` -> theme font color (base-content)\n * - `line` -> theme font color (base-content) — lines/edges\n */\nexport type ThemeColorFieldKind = 'fill' | 'stroke' | 'text' | 'line';\n\nexport const THEME_SYNC_TOKEN: Record<ThemeColorFieldKind, string> = {\n fill: 'theme:base-100',\n stroke: 'theme:base-content',\n text: 'theme:base-content',\n line: 'theme:base-content',\n};\n\n/** The CSS var backing a given theme token (for live-updating DOM swatches). */\nexport function themeTokenCssVar(token: string): string | undefined {\n return TOKEN_TO_CSSVAR.get(token);\n}\n\n/** Human label for a theme token (for tooltips). */\nexport function themeTokenLabel(token: string): string | undefined {\n return TOKEN_TO_LABEL.get(token);\n}\n\n/**\n * Common named colors offered after the theme-sync swatch: a compact rainbow\n * plus black/white. Order follows 黑白赤橙黄绿青蓝紫粉 (black, white, red,\n * orange, yellow, green, cyan, blue, purple, pink).\n */\nexport interface NamedColor {\n value: string;\n /** Chinese label shown on hover. */\n label: string;\n}\n\nexport const COMMON_COLORS: NamedColor[] = [\n { value: '#000000', label: '黑' },\n { value: '#ffffff', label: '白' },\n { value: '#ef4444', label: '赤' },\n { value: '#f97316', label: '橙' },\n { value: '#eab308', label: '黄' },\n { value: '#22c55e', label: '绿' },\n { value: '#06b6d4', label: '青' },\n { value: '#3b82f6', label: '蓝' },\n { value: '#8b5cf6', label: '紫' },\n { value: '#ec4899', label: '粉' },\n];\n\n/** True when `value` is a `theme:*` token. */\nexport function isThemeToken(value: string | undefined | null): value is string {\n return typeof value === 'string' && value.startsWith(THEME_COLOR_PREFIX);\n}\n\n// Module-level cache of the currently resolved token -> `#rrggbb` mapping. The\n// render loop resolves tokens against this cache (cheap, synchronous) instead\n// of probing the DOM every frame. `refreshThemePalette` rebuilds it whenever\n// the theme changes.\nconst _palette = new Map<string, string>();\n\n/**\n * Re-resolve every theme token against the given host's themed scope and cache\n * the results. Call on init and whenever the active theme changes.\n */\nexport function refreshThemePalette(host: HTMLElement | null): void {\n for (const { token, cssVar } of THEME_COLOR_TOKENS) {\n _palette.set(token, cssColorToHexString(host, cssVar, '#000000'));\n }\n}\n\n/**\n * Resolve a stored color value to a concrete `#rrggbb`/literal color. Theme\n * tokens are looked up in the cached palette; anything else is returned as-is.\n */\nexport function resolveThemeColor(value: string | undefined | null, fallback = '#000000'): string {\n if (!value) return fallback;\n if (isThemeToken(value)) return _palette.get(value) ?? fallback;\n return value;\n}\n\n/**\n * Resolve a stored color to a value usable directly in the DOM. Theme tokens\n * map to their CSS variable so the browser tracks theme changes natively.\n */\nexport function resolveThemeColorCss(value: string | undefined | null, fallback = '#000000'): string {\n if (!value) return fallback;\n if (isThemeToken(value)) return TOKEN_TO_CSSVAR.get(value) ?? fallback;\n return value;\n}\n"],"mappings":"AAiBA,IAAI,IAA8C;AAClD,SAAS,IAAgD;AACvD,MAAI,EAAY,QAAO;AACvB,MAAI,OAAO,WAAa,IAAa,QAAO;AAC5C,QAAM,IAAS,SAAS,cAAc,QAAQ;AAC9C,SAAA,EAAO,QAAQ,GACf,EAAO,SAAS,GAChB,IAAa,EAAO,WAAW,MAAM,EAAE,oBAAoB,GAAK,CAAC,GAC1D;AACT;AAGA,SAAS,EAAe,GAAmD;AACzE,QAAM,IAAM,EAAa;AACzB,MAAI,CAAC,EAAK,QAAO;AACjB,MAAI;AACF,IAAA,EAAI,UAAU,GAAG,GAAG,GAAG,CAAC,GACxB,EAAI,YAAY,WAChB,EAAI,YAAY,GAChB,EAAI,SAAS,GAAG,GAAG,GAAG,CAAC;AACvB,UAAM,EAAE,MAAA,EAAA,IAAS,EAAI,aAAa,GAAG,GAAG,GAAG,CAAC;AAC5C,WAAO;AAAA,MAAC,EAAK,CAAA;AAAA,MAAI,EAAK,CAAA;AAAA,MAAI,EAAK,CAAA;AAAA,I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;AAAA,IAAW,OAAO;AAAA,EAAI;AAAA,EAC/B;AAAA,IAAE,OAAO;AAAA,IAAW,OAAO;AAAA,EAAI;AAAA,EAC/B;AAAA,IAAE,OAAO;AAAA,IAAW,OAAO;AAAA,EAAI;AAAA,EAC/B;AAAA,IAAE,OAAO;AAAA,IAAW,OAAO;AAAA,EAAI;AAAA,EAC/B;AAAA,IAAE,OAAO;AAAA,IAAW,OAAO;AAAA,EAAI;AACjC;AAGA,SAAgB,EAAa,GAAmD;AAC9E,SAAO,OAAO,KAAU,YAAY,EAAM,WAAA,QAA6B;AACzE;AAMA,IAAM,IAAW,oBAAI,IAAoB;AAMzC,SAAgB,EAAoB,GAAgC;AAClE,aAAW,EAAE,OAAA,GAAO,QAAA,EAAA,KAAY,EAC9B,CAAA,EAAS,IAAI,GAAO,EAAoB,GAAM,GAAQ,SAAS,CAAC;AAEpE;AAMA,SAAgB,EAAkB,GAAkC,IAAW,WAAmB;AAChG,SAAK,IACD,EAAa,CAAK,IAAU,EAAS,IAAI,CAAK,KAAK,IAChD,IAFY;AAGrB;AAMA,SAAgB,EAAqB,GAAkC,IAAW,WAAmB;AACnG,SAAK,IACD,EAAa,CAAK,IAAU,EAAgB,IAAI,CAAK,KAAK,IACvD,IAFY;AAGrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dishui",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "description": "New Components UI Framework with AI Powered",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",