@almadar/ui 6.54.0 → 6.56.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/dist/{AwaitingSkeletonContext-Bh399p1x.d.ts → AwaitingSkeletonContext-DPgW__WV.d.ts} +3 -1
- package/dist/{Canvas3DHost-B-y2TNij.d.ts → Canvas3DHost-DfAhg6EH.d.ts} +2 -0
- package/dist/Typography-7PDT62PG.js +5 -0
- package/dist/{UISlotRenderer-QUEG6WFM.js → UISlotRenderer-QTHFT6Z4.js} +6 -6
- package/dist/avl/index.cjs +3385 -1883
- package/dist/avl/index.js +45 -737
- package/dist/{chunk-ERXIHZW3.js → chunk-D2E44ODB.js} +29 -15
- package/dist/{chunk-FJDS4SVD.js → chunk-F4ZTPKZL.js} +3 -3
- package/dist/{chunk-U3CGKPOK.js → chunk-FQM37C56.js} +136 -107
- package/dist/{chunk-4UP6BZ4R.js → chunk-HCSJHRC4.js} +1 -1
- package/dist/{chunk-N2V4LHFQ.js → chunk-HRCR53OW.js} +10 -1
- package/dist/{chunk-O7OLVVBR.js → chunk-Q47ZN2DW.js} +24 -22
- package/dist/{chunk-4HC5HRHB.js → chunk-QGH4NAQO.js} +2 -2
- package/dist/{chunk-MCKFWPT2.js → chunk-RNY5LJXJ.js} +1 -1
- package/dist/{chunk-Z7JWXIRE.js → chunk-SGJHVPHC.js} +2 -2
- package/dist/{chunk-6O37FCX4.js → chunk-V3FGTQUE.js} +37 -2
- package/dist/{chunk-U2FGMHQP.js → chunk-XZKGRSIO.js} +3334 -1796
- package/dist/{chunk-Z5IYJU44.js → chunk-Y53Q55H5.js} +521 -24
- package/dist/components/index.cjs +5194 -3008
- package/dist/components/index.d.ts +117 -52
- package/dist/components/index.js +13 -13
- package/dist/context/index.cjs +36 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.js +1 -1
- package/dist/design-classes/index.cjs +29 -15
- package/dist/design-classes/index.d.cts +1 -0
- package/dist/design-classes/index.d.ts +1 -0
- package/dist/design-classes/index.js +29 -15
- package/dist/hooks/index.cjs +10 -1
- package/dist/hooks/index.js +3 -3
- package/dist/lib/drawable/three/index.cjs +442 -82
- package/dist/lib/drawable/three/index.d.ts +2 -2
- package/dist/lib/drawable/three/index.js +28 -24
- package/dist/lib/index.cjs +52 -3
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +4 -4
- package/dist/locales/index.cjs +30 -3
- package/dist/locales/index.js +21 -3
- package/dist/providers/index.cjs +5330 -3091
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.js +12 -9
- package/dist/runtime/index.cjs +5400 -3182
- package/dist/runtime/index.d.ts +7 -3
- package/dist/runtime/index.js +8 -8
- package/dist/ssr/index.cjs +24 -8
- package/dist/ssr/index.js +24 -8
- package/dist/{themeTokens-Ccu7EmGY.d.ts → themeTokens-D6MFwKrC.d.ts} +6 -2
- package/locales/ar.json +10 -1
- package/locales/en.json +10 -1
- package/locales/sl.json +10 -1
- package/package.json +6 -6
- package/scripts/theme-contrast-audit.mjs +20 -1
- package/tailwind-preset.cjs +3 -0
- package/themes/_base.css +61 -0
- package/themes/_contract.md +37 -0
- package/themes/almadar-heritage.css +82 -0
- package/themes/almadar-website.css +82 -0
- package/themes/almadar.css +82 -0
- package/themes/aqua.css +82 -0
- package/themes/arabesque.css +82 -0
- package/themes/art-deco.css +82 -0
- package/themes/art-nouveau.css +82 -0
- package/themes/atelier.css +82 -0
- package/themes/bauhaus.css +82 -0
- package/themes/bloomberg-dense.css +83 -1
- package/themes/blueprint.css +84 -0
- package/themes/clay.css +82 -0
- package/themes/comic.css +82 -0
- package/themes/constructivist.css +82 -0
- package/themes/corporate.css +82 -0
- package/themes/cyberpunk.css +82 -0
- package/themes/frutiger-aero.css +83 -0
- package/themes/game-adventure.css +15 -0
- package/themes/game-rpg.css +16 -0
- package/themes/game-sci-fi.css +15 -0
- package/themes/game-ui-pack.css +15 -0
- package/themes/gazette.css +82 -0
- package/themes/glass.css +82 -0
- package/themes/gothic.css +82 -0
- package/themes/ink-wash.css +82 -0
- package/themes/kawaii.css +82 -0
- package/themes/kiosk.css +82 -0
- package/themes/linear-clean.css +82 -0
- package/themes/luxury.css +82 -0
- package/themes/mac-classic.css +90 -8
- package/themes/material.css +82 -0
- package/themes/memphis.css +82 -0
- package/themes/mid-century.css +82 -0
- package/themes/minimalist.css +82 -0
- package/themes/mudcloth.css +82 -0
- package/themes/neon.css +83 -0
- package/themes/neumorphic.css +82 -0
- package/themes/newsprint.css +82 -0
- package/themes/notion-editorial.css +82 -0
- package/themes/orb.css +82 -0
- package/themes/pixel.css +82 -0
- package/themes/prism.css +82 -0
- package/themes/retro.css +83 -0
- package/themes/risograph.css +82 -0
- package/themes/scandi.css +82 -0
- package/themes/sketch.css +82 -0
- package/themes/solarpunk.css +82 -0
- package/themes/steampunk.css +82 -0
- package/themes/swiss.css +82 -0
- package/themes/terminal.css +84 -1
- package/themes/trait-wars.css +82 -0
- package/themes/ukiyo-e.css +82 -0
- package/themes/vaporwave.css +82 -0
- package/themes/victorian.css +82 -0
- package/themes/wabi-sabi.css +82 -0
- package/themes/win95.css +84 -0
- package/themes/wireframe.css +82 -0
- package/themes/zine.css +82 -0
- package/dist/Typography-CFI7JUVE.js +0 -5
|
@@ -12,13 +12,13 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
12
12
|
var postprocessing = require('@react-three/postprocessing');
|
|
13
13
|
var GLTFLoader_js = require('three/examples/jsm/loaders/GLTFLoader.js');
|
|
14
14
|
var SkeletonUtils_js = require('three/examples/jsm/utils/SkeletonUtils.js');
|
|
15
|
+
var context = require('@almadar/ui/context');
|
|
16
|
+
var core = require('@almadar/core');
|
|
15
17
|
var clsx = require('clsx');
|
|
16
18
|
var tailwindMerge = require('tailwind-merge');
|
|
17
19
|
var OrbitControls_js = require('three/examples/jsm/controls/OrbitControls.js');
|
|
18
20
|
var OBJLoader_js = require('three/examples/jsm/loaders/OBJLoader.js');
|
|
19
|
-
var context = require('@almadar/ui/context');
|
|
20
21
|
require('@almadar/core/patterns');
|
|
21
|
-
var core = require('@almadar/core');
|
|
22
22
|
var runtime = require('@almadar/runtime');
|
|
23
23
|
var registry = require('@almadar/std/registry');
|
|
24
24
|
|
|
@@ -2046,13 +2046,392 @@ function FxLayer3D({
|
|
|
2046
2046
|
const children = expandFxLayer(node, epochNow, "3d");
|
|
2047
2047
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: children.map((c, i) => /* @__PURE__ */ jsxRuntime.jsx(Drawable3D, { node: c, projector, groupOpacity }, i)) });
|
|
2048
2048
|
}
|
|
2049
|
+
var log4 = logger.createLogger("almadar:ui:theme-color");
|
|
2050
|
+
function channel(value, unitScale) {
|
|
2051
|
+
return Math.round(Math.min(255, Math.max(0, Number(value) * unitScale)));
|
|
2052
|
+
}
|
|
2053
|
+
function make(r, g, b, a) {
|
|
2054
|
+
return { r, g, b, a, css: `rgb(${r}, ${g}, ${b})` };
|
|
2055
|
+
}
|
|
2056
|
+
function gamma(linear) {
|
|
2057
|
+
const c = Math.min(1, Math.max(0, linear));
|
|
2058
|
+
return Math.round(255 * (c <= 31308e-7 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055));
|
|
2059
|
+
}
|
|
2060
|
+
function fromOklab(L, a, b, alpha) {
|
|
2061
|
+
const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3;
|
|
2062
|
+
const m = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3;
|
|
2063
|
+
const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3;
|
|
2064
|
+
return make(
|
|
2065
|
+
gamma(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),
|
|
2066
|
+
gamma(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),
|
|
2067
|
+
gamma(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s),
|
|
2068
|
+
alpha
|
|
2069
|
+
);
|
|
2070
|
+
}
|
|
2071
|
+
function component(raw, percentOf) {
|
|
2072
|
+
if (raw === "none") return 0;
|
|
2073
|
+
return raw.endsWith("%") ? Number(raw.slice(0, -1)) / 100 * percentOf : Number(raw);
|
|
2074
|
+
}
|
|
2075
|
+
var NUM = "(none|-?[\\d.]+(?:e-?\\d+)?%?)";
|
|
2076
|
+
var OKLCH = new RegExp(`^oklch\\(\\s*${NUM}\\s+${NUM}\\s+${NUM}(?:deg)?\\s*(?:\\/\\s*${NUM}\\s*)?\\)$`, "i");
|
|
2077
|
+
var OKLAB = new RegExp(`^oklab\\(\\s*${NUM}\\s+${NUM}\\s+${NUM}\\s*(?:\\/\\s*${NUM}\\s*)?\\)$`, "i");
|
|
2078
|
+
function parseComputedColor(value) {
|
|
2079
|
+
const v = value.trim();
|
|
2080
|
+
const lch = OKLCH.exec(v);
|
|
2081
|
+
if (lch) {
|
|
2082
|
+
const hue = component(lch[3], 360) * Math.PI / 180;
|
|
2083
|
+
const chroma = component(lch[2], 0.4);
|
|
2084
|
+
return fromOklab(component(lch[1], 1), chroma * Math.cos(hue), chroma * Math.sin(hue), lch[4] === void 0 ? 1 : component(lch[4], 1));
|
|
2085
|
+
}
|
|
2086
|
+
const lab = OKLAB.exec(v);
|
|
2087
|
+
if (lab) {
|
|
2088
|
+
return fromOklab(component(lab[1], 1), component(lab[2], 0.4), component(lab[3], 0.4), lab[4] === void 0 ? 1 : component(lab[4], 1));
|
|
2089
|
+
}
|
|
2090
|
+
const hex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(v);
|
|
2091
|
+
if (hex) {
|
|
2092
|
+
const h = hex[1].length === 3 ? hex[1].split("").map((c) => c + c).join("") : hex[1];
|
|
2093
|
+
return make(parseInt(h.slice(0, 2), 16), parseInt(h.slice(2, 4), 16), parseInt(h.slice(4, 6), 16), 1);
|
|
2094
|
+
}
|
|
2095
|
+
const rgb = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)\s*(?:[,/]\s*([\d.]+)\s*)?\)$/i.exec(v);
|
|
2096
|
+
if (rgb) {
|
|
2097
|
+
return make(channel(rgb[1], 1), channel(rgb[2], 1), channel(rgb[3], 1), rgb[4] === void 0 ? 1 : Number(rgb[4]));
|
|
2098
|
+
}
|
|
2099
|
+
const srgb = /^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)\s*(?:\/\s*([\d.]+)\s*)?\)$/i.exec(v);
|
|
2100
|
+
if (srgb) {
|
|
2101
|
+
return make(channel(srgb[1], 255), channel(srgb[2], 255), channel(srgb[3], 255), srgb[4] === void 0 ? 1 : Number(srgb[4]));
|
|
2102
|
+
}
|
|
2103
|
+
return null;
|
|
2104
|
+
}
|
|
2105
|
+
var SENTINEL = "rgb(1, 2, 3)";
|
|
2106
|
+
function getComputedSentinel(doc) {
|
|
2107
|
+
const s = doc.createElement("span");
|
|
2108
|
+
s.style.display = "none";
|
|
2109
|
+
s.style.color = SENTINEL;
|
|
2110
|
+
doc.body.appendChild(s);
|
|
2111
|
+
const c = getComputedStyle(s).color;
|
|
2112
|
+
doc.body.removeChild(s);
|
|
2113
|
+
return c;
|
|
2114
|
+
}
|
|
2115
|
+
function resolveThemeColor(value, scope) {
|
|
2116
|
+
const doc = scope.ownerDocument;
|
|
2117
|
+
const wrapper = doc.createElement("span");
|
|
2118
|
+
wrapper.style.display = "none";
|
|
2119
|
+
wrapper.style.color = SENTINEL;
|
|
2120
|
+
const probe = doc.createElement("span");
|
|
2121
|
+
probe.style.color = value;
|
|
2122
|
+
wrapper.appendChild(probe);
|
|
2123
|
+
scope.appendChild(wrapper);
|
|
2124
|
+
const computed = probe.style.color === "" ? "" : getComputedStyle(probe).color;
|
|
2125
|
+
scope.removeChild(wrapper);
|
|
2126
|
+
const parsed = computed === getComputedSentinel(doc) ? null : parseComputedColor(computed);
|
|
2127
|
+
if (!parsed) log4.error("unresolvable-theme-color", { value, computed });
|
|
2128
|
+
return parsed;
|
|
2129
|
+
}
|
|
2049
2130
|
|
|
2050
|
-
// lib/
|
|
2051
|
-
var
|
|
2052
|
-
|
|
2053
|
-
|
|
2131
|
+
// lib/canvasTheme.ts
|
|
2132
|
+
var log5 = logger.createLogger("almadar:ui:canvas-theme");
|
|
2133
|
+
var toneVar = (tone) => `--color-${core.DIAGRAM_TONE_COLOR_KEYS[tone]}`;
|
|
2134
|
+
var SERIES_TONES = ["series-1", "series-2", "series-3", "series-4", "series-5", "series-6", "series-7", "series-8"];
|
|
2135
|
+
var TONE_SET = new Set(core.DIAGRAM_TONES);
|
|
2136
|
+
function isDiagramTone(value) {
|
|
2137
|
+
return TONE_SET.has(value);
|
|
2138
|
+
}
|
|
2139
|
+
function colorCss(c) {
|
|
2140
|
+
return c.a >= 1 ? c.css : `rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`;
|
|
2141
|
+
}
|
|
2142
|
+
function oneOf(value, allowed, fallback, name) {
|
|
2143
|
+
const hit = allowed.find((a) => a === value);
|
|
2144
|
+
if (hit !== void 0) return hit;
|
|
2145
|
+
if (value !== "") log5.warn("invalid-theme-keyword", { var: name, value, allowed });
|
|
2146
|
+
return fallback;
|
|
2147
|
+
}
|
|
2148
|
+
var PLAIN_LENGTH = /^(-?[\d.]+)(px)?$/;
|
|
2149
|
+
var ScopeReader = class {
|
|
2150
|
+
constructor(scope) {
|
|
2151
|
+
__publicField(this, "scope", scope);
|
|
2152
|
+
__publicField(this, "style");
|
|
2153
|
+
__publicField(this, "probe");
|
|
2154
|
+
this.style = getComputedStyle(scope);
|
|
2155
|
+
const doc = scope.ownerDocument;
|
|
2156
|
+
this.probe = doc.createElement("span");
|
|
2157
|
+
this.probe.style.position = "absolute";
|
|
2158
|
+
this.probe.style.visibility = "hidden";
|
|
2159
|
+
this.probe.style.pointerEvents = "none";
|
|
2160
|
+
scope.appendChild(this.probe);
|
|
2161
|
+
}
|
|
2162
|
+
dispose() {
|
|
2163
|
+
this.probe.remove();
|
|
2164
|
+
}
|
|
2165
|
+
raw(name) {
|
|
2166
|
+
return this.style.getPropertyValue(name).trim();
|
|
2167
|
+
}
|
|
2168
|
+
/** A length var in px: a plain value parses directly, a derived one (`calc`, `var`) through the probe. */
|
|
2169
|
+
length(name, fallback) {
|
|
2170
|
+
const raw = this.raw(name);
|
|
2171
|
+
const plain = PLAIN_LENGTH.exec(raw);
|
|
2172
|
+
if (plain) return Number(plain[1]);
|
|
2173
|
+
if (raw === "") return fallback;
|
|
2174
|
+
this.probe.style.width = `var(${name})`;
|
|
2175
|
+
const computed = PLAIN_LENGTH.exec(getComputedStyle(this.probe).width.trim());
|
|
2176
|
+
this.probe.style.width = "";
|
|
2177
|
+
if (computed) return Number(computed[1]);
|
|
2178
|
+
log5.warn("unresolvable-theme-length", { var: name, raw });
|
|
2179
|
+
return fallback;
|
|
2180
|
+
}
|
|
2181
|
+
number(name, fallback) {
|
|
2182
|
+
const raw = this.raw(name);
|
|
2183
|
+
if (raw === "") return fallback;
|
|
2184
|
+
const n = Number(raw);
|
|
2185
|
+
if (Number.isFinite(n)) return n;
|
|
2186
|
+
log5.warn("unresolvable-theme-number", { var: name, raw });
|
|
2187
|
+
return fallback;
|
|
2188
|
+
}
|
|
2189
|
+
/** A duration var in ms (`250ms`, `0.25s`, or a `var()` alias resolved through the probe). */
|
|
2190
|
+
durationMs(name, fallback) {
|
|
2191
|
+
const parse = (v) => {
|
|
2192
|
+
const m = /^([\d.]+)(ms|s)$/.exec(v.trim());
|
|
2193
|
+
return m ? Number(m[1]) * (m[2] === "s" ? 1e3 : 1) : null;
|
|
2194
|
+
};
|
|
2195
|
+
const raw = this.raw(name);
|
|
2196
|
+
const direct = parse(raw);
|
|
2197
|
+
if (direct !== null) return direct;
|
|
2198
|
+
if (raw === "") return fallback;
|
|
2199
|
+
this.probe.style.transitionDuration = `var(${name})`;
|
|
2200
|
+
const computed = parse(getComputedStyle(this.probe).transitionDuration.split(",")[0] ?? "");
|
|
2201
|
+
this.probe.style.transitionDuration = "";
|
|
2202
|
+
return computed ?? fallback;
|
|
2203
|
+
}
|
|
2204
|
+
color(name) {
|
|
2205
|
+
const raw = this.raw(name);
|
|
2206
|
+
return parseComputedColor(raw) ?? resolveThemeColor(`var(${name})`, this.scope);
|
|
2207
|
+
}
|
|
2208
|
+
shadow(name) {
|
|
2209
|
+
const raw = this.raw(name);
|
|
2210
|
+
if (raw === "" || raw === "none") return null;
|
|
2211
|
+
this.probe.style.boxShadow = `var(${name})`;
|
|
2212
|
+
const computed = getComputedStyle(this.probe).boxShadow.trim() || raw;
|
|
2213
|
+
this.probe.style.boxShadow = "";
|
|
2214
|
+
const colorMatch = /(rgba?\([^)]*\)|#[0-9a-f]{3,8}|oklch\([^)]*\))/i.exec(computed);
|
|
2215
|
+
const lengths = computed.replace(colorMatch?.[0] ?? "", "").trim().split(/\s+/).map((t) => PLAIN_LENGTH.exec(t)).filter((m) => m !== null).map((m) => Number(m[1]));
|
|
2216
|
+
if (lengths.length < 2) return null;
|
|
2217
|
+
const color = colorMatch ? parseComputedColor(colorMatch[0]) : null;
|
|
2218
|
+
return { offsetX: lengths[0], offsetY: lengths[1], blur: lengths[2] ?? 0, color: color ? colorCss(color) : "rgba(0, 0, 0, 0.25)" };
|
|
2219
|
+
}
|
|
2220
|
+
family(name, fallback) {
|
|
2221
|
+
return this.raw(name) || fallback;
|
|
2222
|
+
}
|
|
2054
2223
|
};
|
|
2055
|
-
|
|
2224
|
+
function dashList(raw, fallback) {
|
|
2225
|
+
if (raw === "") return fallback;
|
|
2226
|
+
const parts = raw.split(/[\s,]+/).map(Number);
|
|
2227
|
+
return parts.every((n) => Number.isFinite(n) && n >= 0) ? parts : fallback;
|
|
2228
|
+
}
|
|
2229
|
+
function prefersReducedMotion(scope) {
|
|
2230
|
+
const view = scope.ownerDocument.defaultView;
|
|
2231
|
+
return typeof view?.matchMedia === "function" && view.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2232
|
+
}
|
|
2233
|
+
function resolveCanvasTheme(scope) {
|
|
2234
|
+
const r = new ScopeReader(scope);
|
|
2235
|
+
try {
|
|
2236
|
+
const tones = {};
|
|
2237
|
+
for (const tone of core.DIAGRAM_TONES) {
|
|
2238
|
+
const c = r.color(toneVar(tone));
|
|
2239
|
+
tones[tone] = c ? colorCss(c) : "currentColor";
|
|
2240
|
+
}
|
|
2241
|
+
const ground = r.color("--surface-diagram");
|
|
2242
|
+
const text = {};
|
|
2243
|
+
const TEXT_FALLBACK = { xs: 12, sm: 14, base: 16, lg: 18, xl: 20, "2xl": 24 };
|
|
2244
|
+
for (const size of core.DIAGRAM_TEXT_SIZES) text[size] = r.length(`--text-${size}`, TEXT_FALLBACK[size]);
|
|
2245
|
+
const body = r.family("--font-family-body", r.family("--font-family", "system-ui, sans-serif"));
|
|
2246
|
+
return {
|
|
2247
|
+
ground: ground ? colorCss(ground) : "transparent",
|
|
2248
|
+
tones,
|
|
2249
|
+
series: SERIES_TONES.map((t) => tones[t]),
|
|
2250
|
+
strokes: {
|
|
2251
|
+
thin: r.length("--diagram-stroke-thin", 1),
|
|
2252
|
+
normal: r.length("--diagram-stroke-normal", 1.5),
|
|
2253
|
+
bold: r.length("--diagram-stroke-bold", 3)
|
|
2254
|
+
},
|
|
2255
|
+
lineCap: oneOf(r.raw("--diagram-line-cap"), ["butt", "round", "square"], "round", "--diagram-line-cap"),
|
|
2256
|
+
lineJoin: oneOf(r.raw("--diagram-line-join"), ["miter", "round", "bevel"], "round", "--diagram-line-join"),
|
|
2257
|
+
dash: dashList(r.raw("--diagram-dash"), [6, 4]),
|
|
2258
|
+
dot: dashList(r.raw("--diagram-dot"), [1, 4]),
|
|
2259
|
+
fillStyle: oneOf(r.raw("--diagram-fill-style"), ["solid", "tint", "outline", "hatch"], "tint", "--diagram-fill-style"),
|
|
2260
|
+
fillOpacity: r.number("--diagram-fill-opacity", 0.18),
|
|
2261
|
+
roughness: r.number("--diagram-roughness", 0),
|
|
2262
|
+
glow: r.number("--diagram-glow", 0),
|
|
2263
|
+
shadow: r.shadow("--diagram-shadow"),
|
|
2264
|
+
marker: oneOf(r.raw("--diagram-marker"), ["triangle", "open", "line", "dot"], "triangle", "--diagram-marker"),
|
|
2265
|
+
faces: {
|
|
2266
|
+
body,
|
|
2267
|
+
display: r.family("--font-family-display", body),
|
|
2268
|
+
mono: r.family("--font-family-mono", "ui-monospace, monospace")
|
|
2269
|
+
},
|
|
2270
|
+
label: {
|
|
2271
|
+
font: oneOf(r.raw("--diagram-label-font"), ["body", "display", "mono"], "body", "--diagram-label-font"),
|
|
2272
|
+
size: oneOf(r.raw("--diagram-label-size"), core.DIAGRAM_TEXT_SIZES, "sm", "--diagram-label-size"),
|
|
2273
|
+
weight: r.raw("--diagram-label-weight") || "500",
|
|
2274
|
+
uppercase: oneOf(r.raw("--diagram-label-case"), ["none", "uppercase"], "none", "--diagram-label-case") === "uppercase"
|
|
2275
|
+
},
|
|
2276
|
+
text,
|
|
2277
|
+
corner: r.length("--diagram-corner", 4),
|
|
2278
|
+
motion: {
|
|
2279
|
+
enabled: r.raw("--motion-enable") !== "off" && !prefersReducedMotion(scope),
|
|
2280
|
+
fastMs: r.durationMs("--duration-fast", 150),
|
|
2281
|
+
normalMs: r.durationMs("--duration-normal", 250),
|
|
2282
|
+
slowMs: r.durationMs("--duration-slow", 400),
|
|
2283
|
+
easing: r.raw("--easing-standard") || "ease"
|
|
2284
|
+
},
|
|
2285
|
+
scene: {
|
|
2286
|
+
roughness: r.number("--material-roughness", 0.6),
|
|
2287
|
+
metalness: r.number("--material-metalness", 0),
|
|
2288
|
+
flat: r.number("--material-flat", 0) >= 1,
|
|
2289
|
+
outline: r.number("--material-outline", 0),
|
|
2290
|
+
ambient: r.number("--light-ambient", 0.55),
|
|
2291
|
+
key: r.number("--light-key", 1),
|
|
2292
|
+
keyColor: (() => {
|
|
2293
|
+
const c = r.color("--light-key-color");
|
|
2294
|
+
return c ? colorCss(c) : "#ffffff";
|
|
2295
|
+
})(),
|
|
2296
|
+
fog: r.number("--scene-fog", 0)
|
|
2297
|
+
}
|
|
2298
|
+
};
|
|
2299
|
+
} finally {
|
|
2300
|
+
r.dispose();
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
function withSeries(theme, series, scope) {
|
|
2304
|
+
if (!theme || !series || series.length === 0 || !scope) return theme;
|
|
2305
|
+
const colors = series.map((c, i) => markColor(theme, c, scope, SERIES_TONES[i % SERIES_TONES.length]));
|
|
2306
|
+
const tones = { ...theme.tones };
|
|
2307
|
+
SERIES_TONES.forEach((tone, i) => {
|
|
2308
|
+
tones[tone] = colors[i % colors.length];
|
|
2309
|
+
});
|
|
2310
|
+
return { ...theme, tones, series: SERIES_TONES.map((t) => tones[t]) };
|
|
2311
|
+
}
|
|
2312
|
+
function markColor(theme, value, scope, fallback) {
|
|
2313
|
+
if (value === void 0 || value === "") return theme.tones[fallback];
|
|
2314
|
+
if (isDiagramTone(value)) return theme.tones[value];
|
|
2315
|
+
if (value.startsWith("var(") || value.startsWith("color-mix(")) {
|
|
2316
|
+
const resolved = resolveThemeColor(value, scope);
|
|
2317
|
+
return resolved ? colorCss(resolved) : theme.tones[fallback];
|
|
2318
|
+
}
|
|
2319
|
+
return value;
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
// hooks/useCanvasTheme.ts
|
|
2323
|
+
function useCanvasTheme(scopeRef) {
|
|
2324
|
+
const { appliedTheme } = context.useTheme();
|
|
2325
|
+
const scopeKey = JSON.stringify(context.useThemeScope());
|
|
2326
|
+
const [state, setState] = React3.useState({ theme: null, version: 0 });
|
|
2327
|
+
React3.useLayoutEffect(() => {
|
|
2328
|
+
const scope = scopeRef.current;
|
|
2329
|
+
if (!scope) return;
|
|
2330
|
+
const theme = resolveCanvasTheme(scope);
|
|
2331
|
+
setState((prev) => ({ theme, version: prev.version + 1 }));
|
|
2332
|
+
}, [appliedTheme, scopeKey, scopeRef]);
|
|
2333
|
+
return state;
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
// lib/drawable/themeDrawables.ts
|
|
2337
|
+
function opt(value, resolve) {
|
|
2338
|
+
return value === void 0 ? void 0 : resolve(value);
|
|
2339
|
+
}
|
|
2340
|
+
function themeShape(node, resolve) {
|
|
2341
|
+
return {
|
|
2342
|
+
...node,
|
|
2343
|
+
...node.fill !== void 0 ? { fill: resolve(node.fill) } : {},
|
|
2344
|
+
...node.stroke !== void 0 ? { stroke: resolve(node.stroke) } : {},
|
|
2345
|
+
...node.gradient ? { gradient: { ...node.gradient, stops: node.gradient.stops.map((s) => ({ ...s, color: resolve(s.color) })) } } : {},
|
|
2346
|
+
...node.fillPattern?.color !== void 0 ? { fillPattern: { ...node.fillPattern, color: resolve(node.fillPattern.color) } } : {},
|
|
2347
|
+
...node.shadow ? { shadow: { ...node.shadow, color: resolve(node.shadow.color) } } : {},
|
|
2348
|
+
...node.animation ? {
|
|
2349
|
+
animation: {
|
|
2350
|
+
...node.animation,
|
|
2351
|
+
keyframes: node.animation.keyframes.map((k) => ({
|
|
2352
|
+
...k,
|
|
2353
|
+
...k.fill !== void 0 ? { fill: resolve(k.fill) } : {},
|
|
2354
|
+
...k.stroke !== void 0 ? { stroke: resolve(k.stroke) } : {}
|
|
2355
|
+
}))
|
|
2356
|
+
}
|
|
2357
|
+
} : {}
|
|
2358
|
+
};
|
|
2359
|
+
}
|
|
2360
|
+
function themeText(node, resolve) {
|
|
2361
|
+
return { ...node, color: resolve(node.color) };
|
|
2362
|
+
}
|
|
2363
|
+
function themeMaterial(material, resolve) {
|
|
2364
|
+
if (!material) return material;
|
|
2365
|
+
return {
|
|
2366
|
+
...material,
|
|
2367
|
+
...material.color !== void 0 ? { color: resolve(material.color) } : {},
|
|
2368
|
+
...material.emissive !== void 0 ? { emissive: resolve(material.emissive) } : {}
|
|
2369
|
+
};
|
|
2370
|
+
}
|
|
2371
|
+
function resolveDrawableColors(nodes, resolve) {
|
|
2372
|
+
return nodes.map((node) => {
|
|
2373
|
+
switch (node.type) {
|
|
2374
|
+
case "draw-shape":
|
|
2375
|
+
return themeShape(node, resolve);
|
|
2376
|
+
case "draw-text":
|
|
2377
|
+
return themeText(node, resolve);
|
|
2378
|
+
case "draw-group":
|
|
2379
|
+
return { ...node, items: resolveDrawableColors(node.items, resolve) };
|
|
2380
|
+
case "draw-shape-layer":
|
|
2381
|
+
return { ...node, items: node.items.map((item) => themeShape(item, resolve)) };
|
|
2382
|
+
case "draw-text-layer":
|
|
2383
|
+
return { ...node, items: node.items.map((item) => themeText(item, resolve)) };
|
|
2384
|
+
case "draw-fx-layer":
|
|
2385
|
+
return {
|
|
2386
|
+
...node,
|
|
2387
|
+
...node.textColor !== void 0 ? { textColor: resolve(node.textColor) } : {},
|
|
2388
|
+
...node.presets ? {
|
|
2389
|
+
presets: node.presets.map((p) => ({
|
|
2390
|
+
...p,
|
|
2391
|
+
...p.color !== void 0 ? { color: resolve(p.color) } : {},
|
|
2392
|
+
...p.color2 !== void 0 ? { color2: resolve(p.color2) } : {}
|
|
2393
|
+
}))
|
|
2394
|
+
} : {}
|
|
2395
|
+
};
|
|
2396
|
+
case "draw-mesh":
|
|
2397
|
+
return {
|
|
2398
|
+
...node,
|
|
2399
|
+
material: themeMaterial(node.material, resolve),
|
|
2400
|
+
...node.outline ? { outline: { ...node.outline, ...node.outline.color !== void 0 ? { color: resolve(node.outline.color) } : {} } } : {},
|
|
2401
|
+
...node.animation ? {
|
|
2402
|
+
animation: {
|
|
2403
|
+
...node.animation,
|
|
2404
|
+
keyframes: node.animation.keyframes.map((k) => ({
|
|
2405
|
+
...k,
|
|
2406
|
+
...k.color !== void 0 ? { color: resolve(k.color) } : {},
|
|
2407
|
+
...k.emissive !== void 0 ? { emissive: opt(k.emissive, resolve) } : {}
|
|
2408
|
+
}))
|
|
2409
|
+
}
|
|
2410
|
+
} : {}
|
|
2411
|
+
};
|
|
2412
|
+
default:
|
|
2413
|
+
return node;
|
|
2414
|
+
}
|
|
2415
|
+
});
|
|
2416
|
+
}
|
|
2417
|
+
function applySceneMaterials(nodes, theme) {
|
|
2418
|
+
return nodes.map((node) => {
|
|
2419
|
+
if (node.type === "draw-group") return { ...node, items: applySceneMaterials(node.items, theme) };
|
|
2420
|
+
if (node.type !== "draw-mesh") return node;
|
|
2421
|
+
const m = node.material ?? {};
|
|
2422
|
+
const pbr = (m.kind ?? "standard") === "standard" || m.kind === "physical";
|
|
2423
|
+
return {
|
|
2424
|
+
...node,
|
|
2425
|
+
material: {
|
|
2426
|
+
...m,
|
|
2427
|
+
...pbr && m.roughness === void 0 ? { roughness: theme.scene.roughness } : {},
|
|
2428
|
+
...pbr && m.metalness === void 0 ? { metalness: theme.scene.metalness } : {},
|
|
2429
|
+
...m.flatShading === void 0 && theme.scene.flat ? { flatShading: true } : {}
|
|
2430
|
+
},
|
|
2431
|
+
...node.outline === void 0 && theme.scene.outline > 0 ? { outline: { color: theme.tones.ink, width: theme.scene.outline * 0.02 } } : {}
|
|
2432
|
+
};
|
|
2433
|
+
});
|
|
2434
|
+
}
|
|
2056
2435
|
|
|
2057
2436
|
// lib/theme-scale.ts
|
|
2058
2437
|
var THEME_SCALE_KEYS = {
|
|
@@ -2087,7 +2466,6 @@ function cn(...inputs) {
|
|
|
2087
2466
|
}
|
|
2088
2467
|
var DEFAULT_GRID_CONFIG = {
|
|
2089
2468
|
cellSize: 1};
|
|
2090
|
-
var EDIT_SELECTION_COLOR = "#3b82f6";
|
|
2091
2469
|
var EDIT_SELECTION_RADIUS = 0.6;
|
|
2092
2470
|
function CameraPose({
|
|
2093
2471
|
position,
|
|
@@ -2128,7 +2506,8 @@ var Canvas3DHost = React3.forwardRef(
|
|
|
2128
2506
|
orientation = "standard",
|
|
2129
2507
|
overlay = "default",
|
|
2130
2508
|
shadows = true,
|
|
2131
|
-
backgroundColor
|
|
2509
|
+
backgroundColor,
|
|
2510
|
+
series,
|
|
2132
2511
|
className,
|
|
2133
2512
|
isLoading: externalLoading,
|
|
2134
2513
|
error: externalError,
|
|
@@ -2167,7 +2546,18 @@ var Canvas3DHost = React3.forwardRef(
|
|
|
2167
2546
|
const { t } = hooks.useTranslate();
|
|
2168
2547
|
const loadingMessage = loadingMessageProp ?? t("canvas3d.loadingScene");
|
|
2169
2548
|
const keysRef = React3.useRef(/* @__PURE__ */ new Set());
|
|
2170
|
-
const
|
|
2549
|
+
const { theme: baseCanvasTheme } = useCanvasTheme(containerRef);
|
|
2550
|
+
const seriesKey = series ? series.join("|") : "";
|
|
2551
|
+
const canvasTheme = React3.useMemo(() => withSeries(baseCanvasTheme, series, containerRef.current), [baseCanvasTheme, seriesKey]);
|
|
2552
|
+
const allDrawables = React3.useMemo(() => {
|
|
2553
|
+
const raw = drawables ?? [];
|
|
2554
|
+
const scope = containerRef.current;
|
|
2555
|
+
if (!canvasTheme || !scope) return raw;
|
|
2556
|
+
const resolved = resolveDrawableColors(raw, (c) => markColor(canvasTheme, c, scope, "ink"));
|
|
2557
|
+
return applySceneMaterials(resolved, canvasTheme);
|
|
2558
|
+
}, [drawables, canvasTheme]);
|
|
2559
|
+
const ground = backgroundColor ?? canvasTheme?.ground ?? "transparent";
|
|
2560
|
+
const selectionColor = canvasTheme?.tones.highlight ?? "currentColor";
|
|
2171
2561
|
React3.useEffect(() => {
|
|
2172
2562
|
if (!keyMap && !keyUpMap) return;
|
|
2173
2563
|
const down = (e) => {
|
|
@@ -2464,7 +2854,7 @@ var Canvas3DHost = React3.forwardRef(
|
|
|
2464
2854
|
near: 0.1,
|
|
2465
2855
|
far: 1e3
|
|
2466
2856
|
},
|
|
2467
|
-
style: { background:
|
|
2857
|
+
style: { background: ground, position: "absolute", inset: 0 },
|
|
2468
2858
|
onClick: (e) => {
|
|
2469
2859
|
if (e.target === e.currentTarget) {
|
|
2470
2860
|
eventHandlers.handleCanvasClick(e);
|
|
@@ -2484,10 +2874,10 @@ var Canvas3DHost = React3.forwardRef(
|
|
|
2484
2874
|
shadowCameraSize: 5,
|
|
2485
2875
|
shadowCameraNear: 0.5,
|
|
2486
2876
|
shadowCameraFar: 500,
|
|
2487
|
-
ambientIntensity: lighting?.ambient?.intensity,
|
|
2877
|
+
ambientIntensity: lighting?.ambient?.intensity ?? canvasTheme?.scene.ambient,
|
|
2488
2878
|
ambientColor: lighting?.ambient?.color,
|
|
2489
|
-
directionalIntensity: lighting?.directional?.intensity,
|
|
2490
|
-
directionalColor: lighting?.directional?.color,
|
|
2879
|
+
directionalIntensity: lighting?.directional?.intensity ?? canvasTheme?.scene.key,
|
|
2880
|
+
directionalColor: lighting?.directional?.color ?? canvasTheme?.scene.keyColor,
|
|
2491
2881
|
directionalPosition: lighting?.directional?.position,
|
|
2492
2882
|
hemisphereIntensity: lighting?.hemisphere?.intensity,
|
|
2493
2883
|
hemisphereColor: lighting?.hemisphere?.color,
|
|
@@ -2510,10 +2900,10 @@ var Canvas3DHost = React3.forwardRef(
|
|
|
2510
2900
|
],
|
|
2511
2901
|
cellSize: 1,
|
|
2512
2902
|
cellThickness: 1,
|
|
2513
|
-
cellColor:
|
|
2903
|
+
cellColor: canvasTheme?.tones.grid ?? "currentColor",
|
|
2514
2904
|
sectionSize: 5,
|
|
2515
2905
|
sectionThickness: 1.5,
|
|
2516
|
-
sectionColor:
|
|
2906
|
+
sectionColor: canvasTheme?.tones.axis ?? "currentColor",
|
|
2517
2907
|
fadeDistance: 50,
|
|
2518
2908
|
fadeStrength: 1
|
|
2519
2909
|
}
|
|
@@ -2534,7 +2924,7 @@ var Canvas3DHost = React3.forwardRef(
|
|
|
2534
2924
|
shape: "ellipse",
|
|
2535
2925
|
position: selectionPos,
|
|
2536
2926
|
radiusX: EDIT_SELECTION_RADIUS,
|
|
2537
|
-
stroke:
|
|
2927
|
+
stroke: selectionColor
|
|
2538
2928
|
},
|
|
2539
2929
|
projector: drawableProjector
|
|
2540
2930
|
}
|
|
@@ -4255,6 +4645,7 @@ var en_default = {
|
|
|
4255
4645
|
"template.ourTeam": "Our Team",
|
|
4256
4646
|
"template.caseStudies": "Case Studies",
|
|
4257
4647
|
"versionDiff.compare": "Compare",
|
|
4648
|
+
"versionDiff.changes": "Changes",
|
|
4258
4649
|
"versionDiff.to": "to",
|
|
4259
4650
|
"versionDiff.beforeRevision": "Before revision",
|
|
4260
4651
|
"versionDiff.afterRevision": "After revision",
|
|
@@ -4981,6 +5372,7 @@ var en_default = {
|
|
|
4981
5372
|
"gridPicker.moreRefine": "+{{count}} more \u2014 refine your search",
|
|
4982
5373
|
"graphCanvas.noNodes": "No nodes to display.",
|
|
4983
5374
|
"codeBlock.noCode": "No code to display.",
|
|
5375
|
+
"codeBlock.region": "Code",
|
|
4984
5376
|
"fab.action": "Action",
|
|
4985
5377
|
"fab.closeActions": "Close actions",
|
|
4986
5378
|
"fab.openActions": "Open actions",
|
|
@@ -5297,7 +5689,14 @@ var en_default = {
|
|
|
5297
5689
|
"agentActivity.earlierConversations": "Earlier conversations ({{count}})",
|
|
5298
5690
|
"agentActivity.earlierActivity": "Earlier activity",
|
|
5299
5691
|
"tabs.scrollStart": "Scroll tabs back",
|
|
5300
|
-
"tabs.scrollEnd": "Scroll tabs forward"
|
|
5692
|
+
"tabs.scrollEnd": "Scroll tabs forward",
|
|
5693
|
+
"agentChat.workedThrough": "Worked through {{count}} steps",
|
|
5694
|
+
"agentChat.newMessages": "New messages",
|
|
5695
|
+
"agentChat.copy": "Copy reply",
|
|
5696
|
+
"agentChat.copied": "Copied",
|
|
5697
|
+
"agentChat.today": "Today",
|
|
5698
|
+
"agentChat.yesterday": "Yesterday",
|
|
5699
|
+
"agentChat.emptyDescription": "Ask in your own words \u2014 the assistant can look things up and make changes for you."
|
|
5301
5700
|
};
|
|
5302
5701
|
|
|
5303
5702
|
// lib/format.ts
|
|
@@ -5589,30 +5988,40 @@ function instanceOf(orbital, orbitalId, ref) {
|
|
|
5589
5988
|
if (typeof ref === "object" && ref._resolved) return { ...at, name: ref.name ?? ref._resolved.name, trait: ref._resolved };
|
|
5590
5989
|
return null;
|
|
5591
5990
|
}
|
|
5991
|
+
var wiresBySchema = /* @__PURE__ */ new WeakMap();
|
|
5592
5992
|
function traitEventWires(schema) {
|
|
5993
|
+
const cached = wiresBySchema.get(schema);
|
|
5994
|
+
if (cached) return cached;
|
|
5593
5995
|
const instances = (schema.orbitals ?? []).flatMap(
|
|
5594
5996
|
(o) => (o.traits ?? []).map((ref) => instanceOf(o.name, o.id, ref)).filter((i) => i !== null)
|
|
5595
5997
|
);
|
|
5998
|
+
const listensByEvent = /* @__PURE__ */ new Map();
|
|
5999
|
+
for (const listener of instances) {
|
|
6000
|
+
for (const listen of listener.trait.listens ?? []) {
|
|
6001
|
+
const { bareEvent, matcher } = runtime.parseListenSource(listen, listener.orbital);
|
|
6002
|
+
const bucket = listensByEvent.get(bareEvent);
|
|
6003
|
+
if (bucket) bucket.push({ listener, matcher });
|
|
6004
|
+
else listensByEvent.set(bareEvent, [{ listener, matcher }]);
|
|
6005
|
+
}
|
|
6006
|
+
}
|
|
5596
6007
|
const wires = [];
|
|
5597
6008
|
for (const emitter of instances) {
|
|
6009
|
+
const source = { orbital: emitter.orbital, trait: emitter.name, ...emitter.orbitalId ? { orbitalId: emitter.orbitalId } : {}, ...emitter.trait.id ? { traitId: emitter.trait.id } : {} };
|
|
5598
6010
|
for (const emit of emitter.trait.emits ?? []) {
|
|
5599
|
-
for (const listener of
|
|
6011
|
+
for (const { listener, matcher } of listensByEvent.get(emit.event) ?? []) {
|
|
5600
6012
|
if (listener.orbital === emitter.orbital && listener.name === emitter.name) continue;
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
listenerTrait: listener.name,
|
|
5610
|
-
event: emit.event
|
|
5611
|
-
});
|
|
5612
|
-
}
|
|
6013
|
+
if (!matcher(source)) continue;
|
|
6014
|
+
wires.push({
|
|
6015
|
+
emitterOrbital: emitter.orbital,
|
|
6016
|
+
emitterTrait: emitter.name,
|
|
6017
|
+
listenerOrbital: listener.orbital,
|
|
6018
|
+
listenerTrait: listener.name,
|
|
6019
|
+
event: emit.event
|
|
6020
|
+
});
|
|
5613
6021
|
}
|
|
5614
6022
|
}
|
|
5615
6023
|
}
|
|
6024
|
+
wiresBySchema.set(schema, wires);
|
|
5616
6025
|
return wires;
|
|
5617
6026
|
}
|
|
5618
6027
|
|
|
@@ -5994,55 +6403,6 @@ function getBreadcrumbs(state) {
|
|
|
5994
6403
|
}
|
|
5995
6404
|
return crumbs;
|
|
5996
6405
|
}
|
|
5997
|
-
var log4 = logger.createLogger("almadar:ui:theme-color");
|
|
5998
|
-
function channel(value, unitScale) {
|
|
5999
|
-
return Math.round(Math.min(255, Math.max(0, Number(value) * unitScale)));
|
|
6000
|
-
}
|
|
6001
|
-
function make(r, g, b, a) {
|
|
6002
|
-
return { r, g, b, a, css: `rgb(${r}, ${g}, ${b})` };
|
|
6003
|
-
}
|
|
6004
|
-
function parseComputedColor(value) {
|
|
6005
|
-
const v = value.trim();
|
|
6006
|
-
const hex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(v);
|
|
6007
|
-
if (hex) {
|
|
6008
|
-
const h = hex[1].length === 3 ? hex[1].split("").map((c) => c + c).join("") : hex[1];
|
|
6009
|
-
return make(parseInt(h.slice(0, 2), 16), parseInt(h.slice(2, 4), 16), parseInt(h.slice(4, 6), 16), 1);
|
|
6010
|
-
}
|
|
6011
|
-
const rgb = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)\s*(?:[,/]\s*([\d.]+)\s*)?\)$/i.exec(v);
|
|
6012
|
-
if (rgb) {
|
|
6013
|
-
return make(channel(rgb[1], 1), channel(rgb[2], 1), channel(rgb[3], 1), rgb[4] === void 0 ? 1 : Number(rgb[4]));
|
|
6014
|
-
}
|
|
6015
|
-
const srgb = /^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)\s*(?:\/\s*([\d.]+)\s*)?\)$/i.exec(v);
|
|
6016
|
-
if (srgb) {
|
|
6017
|
-
return make(channel(srgb[1], 255), channel(srgb[2], 255), channel(srgb[3], 255), srgb[4] === void 0 ? 1 : Number(srgb[4]));
|
|
6018
|
-
}
|
|
6019
|
-
return null;
|
|
6020
|
-
}
|
|
6021
|
-
var SENTINEL = "rgb(1, 2, 3)";
|
|
6022
|
-
function getComputedSentinel(doc) {
|
|
6023
|
-
const s = doc.createElement("span");
|
|
6024
|
-
s.style.display = "none";
|
|
6025
|
-
s.style.color = SENTINEL;
|
|
6026
|
-
doc.body.appendChild(s);
|
|
6027
|
-
const c = getComputedStyle(s).color;
|
|
6028
|
-
doc.body.removeChild(s);
|
|
6029
|
-
return c;
|
|
6030
|
-
}
|
|
6031
|
-
function resolveThemeColor(value, scope) {
|
|
6032
|
-
const doc = scope.ownerDocument;
|
|
6033
|
-
const wrapper = doc.createElement("span");
|
|
6034
|
-
wrapper.style.display = "none";
|
|
6035
|
-
wrapper.style.color = SENTINEL;
|
|
6036
|
-
const probe = doc.createElement("span");
|
|
6037
|
-
probe.style.color = value;
|
|
6038
|
-
wrapper.appendChild(probe);
|
|
6039
|
-
scope.appendChild(wrapper);
|
|
6040
|
-
const computed = probe.style.color === "" ? "" : getComputedStyle(probe).color;
|
|
6041
|
-
scope.removeChild(wrapper);
|
|
6042
|
-
const parsed = computed === getComputedSentinel(doc) ? null : parseComputedColor(computed);
|
|
6043
|
-
if (!parsed) log4.error("unresolvable-theme-color", { value, computed });
|
|
6044
|
-
return parsed;
|
|
6045
|
-
}
|
|
6046
6406
|
|
|
6047
6407
|
// lib/avl-theme.ts
|
|
6048
6408
|
function avlTint(token, percent) {
|
|
@@ -7978,7 +8338,7 @@ function useThemeColors(values, scopeRef) {
|
|
|
7978
8338
|
}, [appliedTheme, scopeKey, valuesKey, scopeRef]);
|
|
7979
8339
|
return resolved;
|
|
7980
8340
|
}
|
|
7981
|
-
var
|
|
8341
|
+
var log6 = logger.createLogger("almadar:ui:avl-3d-viewer");
|
|
7982
8342
|
function CameraController({ targetPosition, targetLookAt, animated }) {
|
|
7983
8343
|
const { camera } = fiber.useThree();
|
|
7984
8344
|
const targetPosVec = React3.useRef(new THREE5__namespace.Vector3(...targetPosition));
|
|
@@ -8046,7 +8406,7 @@ var Avl3DViewer = ({
|
|
|
8046
8406
|
for (const key of Object.keys(AVL_3D_COLORS)) {
|
|
8047
8407
|
const resolved = resolvedColors[key];
|
|
8048
8408
|
if (!resolved) {
|
|
8049
|
-
|
|
8409
|
+
log6.error("avl-3d-palette-key-unresolved", { key, value: AVL_3D_COLORS[key] });
|
|
8050
8410
|
return null;
|
|
8051
8411
|
}
|
|
8052
8412
|
out[key] = resolved.css;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CanvasPointLightConfig, I as IsometricTile, a as IsometricUnit, b as IsometricFeature } from '../../../Canvas3DHost-
|
|
2
|
-
export { c as Canvas3DHost, d as Canvas3DHostHandle, e as Canvas3DHostProps, c as GameCanvas3D, U as UnitAnimationState } from '../../../Canvas3DHost-
|
|
1
|
+
import { C as CanvasPointLightConfig, I as IsometricTile, a as IsometricUnit, b as IsometricFeature } from '../../../Canvas3DHost-DfAhg6EH.js';
|
|
2
|
+
export { c as Canvas3DHost, d as Canvas3DHostHandle, e as Canvas3DHostProps, c as GameCanvas3D, U as UnitAnimationState } from '../../../Canvas3DHost-DfAhg6EH.js';
|
|
3
3
|
import React__default, { Component, ReactNode, ErrorInfo } from 'react';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
|