@almadar/ui 6.58.0 → 6.61.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/BehaviorValueFrame-3ORZHPWQ.css +1252 -0
- package/dist/BehaviorValueFrame-QTD7BWOI.js +18 -0
- package/dist/{Canvas3DHost-BTvRPfsr.d.ts → Canvas3DHost-CNjANoaU.d.ts} +1 -1
- package/dist/{GameAudioProvider-kXbonWTv.d.ts → GameAudioProvider-Dv_L-PHt.d.ts} +1 -1
- package/dist/TraitValueFrame-2WMYJOA5.css +1252 -0
- package/dist/TraitValueFrame-WOXNLLMM.js +17 -0
- package/dist/Typography-BY4A2NBY.js +5 -0
- package/dist/{UISlotRenderer-N5DFYE6K.js → UISlotRenderer-EEOXSJCI.js} +10 -8
- package/dist/avl/index.cjs +31960 -27831
- package/dist/avl/index.d.ts +36 -13
- package/dist/avl/index.js +331 -6147
- package/dist/{avl-3d-context-BpBKZIbc.d.ts → avl-3d-context-Dxun3-ri.d.ts} +2 -0
- package/dist/{chunk-I2ZNE5TD.js → chunk-6PV4LASE.js} +9495 -639
- package/dist/{chunk-723MJUU3.js → chunk-6ZCU3BQN.js} +1 -1
- package/dist/{chunk-GZGDBS4S.js → chunk-7NIU5GDC.js} +2 -2
- package/dist/{chunk-YYYHH5BA.js → chunk-CB64IOYD.js} +0 -4
- package/dist/{chunk-MZIDOJMD.js → chunk-EIIQGOZW.js} +2 -1
- package/dist/chunk-F7NZ3KZQ.js +434 -0
- package/dist/{chunk-LZRW6GXG.js → chunk-FYX64CDL.js} +0 -2
- package/dist/{chunk-4ZGXIW3B.js → chunk-KZRAMPM6.js} +1 -1
- package/dist/{chunk-VHTJRS2N.js → chunk-L3MTZ3RH.js} +7 -0
- package/dist/chunk-LUREMDI3.js +49 -0
- package/dist/{chunk-HA7CJWQX.js → chunk-MGN6B6OQ.js} +1477 -1177
- package/dist/{chunk-Q47ZN2DW.js → chunk-N23SVGTH.js} +83 -1
- package/dist/{chunk-KJGVLXEN.js → chunk-N4IJS5DD.js} +50 -116
- package/dist/{chunk-I5QOYW2Z.js → chunk-UTSDPJUP.js} +205 -2
- package/dist/{chunk-V3FGTQUE.js → chunk-ZR45FGW3.js} +7 -1
- package/dist/{cn-DIql5232.d.ts → cn-CDIhHCUC.d.ts} +40 -16
- package/dist/components/index.cjs +14455 -4099
- package/dist/components/index.d.ts +165 -177
- package/dist/components/index.js +14 -15
- package/dist/context/index.cjs +16 -1
- package/dist/context/index.js +4 -2
- package/dist/hooks/index.cjs +79 -6
- package/dist/hooks/index.d.ts +43 -2
- package/dist/hooks/index.js +6 -7
- package/dist/lib/drawable/three/index.cjs +350 -26
- package/dist/lib/drawable/three/index.d.ts +5 -5
- package/dist/lib/drawable/three/index.js +28 -7
- package/dist/lib/index.cjs +90 -4
- package/dist/lib/index.d.ts +3 -3
- package/dist/lib/index.js +74 -6
- package/dist/locales/index.cjs +0 -6
- package/dist/locales/index.js +2 -2
- package/dist/{paintDispatch-BN8Vbzgs.d.ts → paintDispatch-Cp1_S93j.d.ts} +30 -2
- package/dist/providers/index.cjs +13853 -1075
- package/dist/providers/index.d.ts +38 -6
- package/dist/providers/index.js +40 -30
- package/dist/runtime/index.cjs +28369 -18287
- package/dist/runtime/index.d.ts +65 -3
- package/dist/runtime/index.js +13 -379
- package/dist/ssr/index.cjs +508 -133
- package/dist/ssr/index.d.cts +56 -4
- package/dist/ssr/index.d.ts +56 -4
- package/dist/ssr/index.js +446 -71
- package/dist/{verificationRegistry-CK76GUfH.d.ts → verificationRegistry-B5aGl7WF.d.ts} +3 -2
- package/locales/ar.json +0 -2
- package/locales/en.json +0 -2
- package/locales/sl.json +0 -2
- package/package.json +7 -7
- package/tailwind-preset.cjs +78 -8
- package/themes/_contract.md +6 -0
- package/themes/_fonts.css +4 -4
- package/themes/_foundation.css +11 -0
- package/themes/_presets.css +2 -0
- package/themes/almadar-website.css +10 -0
- package/themes/almadar.css +10 -0
- package/themes/atelier.css +10 -0
- package/themes/bauhaus.css +10 -0
- package/themes/bloomberg-dense.css +10 -0
- package/themes/clay.css +10 -0
- package/themes/corporate.css +10 -0
- package/themes/gazette.css +10 -0
- package/themes/glass.css +10 -0
- package/themes/kflow.css +5 -0
- package/themes/kiosk.css +10 -0
- package/themes/linear-clean.css +10 -0
- package/themes/material.css +10 -0
- package/themes/minimalist.css +10 -0
- package/themes/nata.css +304 -0
- package/themes/neon.css +10 -0
- package/themes/notion-editorial.css +10 -0
- package/themes/orb.css +10 -0
- package/themes/prism.css +10 -0
- package/themes/rawi.css +304 -0
- package/themes/retro.css +10 -0
- package/themes/risograph.css +10 -0
- package/themes/scandi.css +10 -0
- package/themes/solarpunk.css +10 -0
- package/themes/terminal.css +138 -128
- package/dist/Typography-LZTP72Y4.js +0 -5
- package/dist/chunk-D2E44ODB.js +0 -350
- package/dist/chunk-HB3D3HUJ.js +0 -2265
- package/dist/chunk-N7JIG57B.js +0 -138
|
@@ -2332,6 +2332,25 @@ function useCanvasTheme(scopeRef) {
|
|
|
2332
2332
|
}, [appliedTheme, scopeKey, scopeRef]);
|
|
2333
2333
|
return state;
|
|
2334
2334
|
}
|
|
2335
|
+
function useOnScreen(ref, margin = "200px") {
|
|
2336
|
+
const [intersecting, setIntersecting] = React3.useState(true);
|
|
2337
|
+
const [pageVisible, setPageVisible] = React3.useState(true);
|
|
2338
|
+
React3.useEffect(() => {
|
|
2339
|
+
const el = ref.current;
|
|
2340
|
+
if (!el || typeof IntersectionObserver === "undefined") return;
|
|
2341
|
+
const observer = new IntersectionObserver(([entry]) => setIntersecting(entry.isIntersecting), { rootMargin: margin });
|
|
2342
|
+
observer.observe(el);
|
|
2343
|
+
return () => observer.disconnect();
|
|
2344
|
+
}, [ref, margin]);
|
|
2345
|
+
React3.useEffect(() => {
|
|
2346
|
+
if (typeof document === "undefined") return;
|
|
2347
|
+
const update = () => setPageVisible(document.visibilityState !== "hidden");
|
|
2348
|
+
update();
|
|
2349
|
+
document.addEventListener("visibilitychange", update);
|
|
2350
|
+
return () => document.removeEventListener("visibilitychange", update);
|
|
2351
|
+
}, []);
|
|
2352
|
+
return intersecting && pageVisible;
|
|
2353
|
+
}
|
|
2335
2354
|
|
|
2336
2355
|
// lib/drawable/themeDrawables.ts
|
|
2337
2356
|
function opt(value, resolve) {
|
|
@@ -2540,6 +2559,7 @@ var Canvas3DHost = React3.forwardRef(
|
|
|
2540
2559
|
moveEvent
|
|
2541
2560
|
}, ref) => {
|
|
2542
2561
|
const containerRef = React3.useRef(null);
|
|
2562
|
+
const onScreen = useOnScreen(containerRef);
|
|
2543
2563
|
const controlsRef = React3.useRef(null);
|
|
2544
2564
|
const [internalError, setInternalError] = React3.useState(null);
|
|
2545
2565
|
const eventBus = useEventBus();
|
|
@@ -2845,6 +2865,7 @@ var Canvas3DHost = React3.forwardRef(
|
|
|
2845
2865
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2846
2866
|
fiber.Canvas,
|
|
2847
2867
|
{
|
|
2868
|
+
frameloop: onScreen ? "always" : "never",
|
|
2848
2869
|
shadows,
|
|
2849
2870
|
flat: lighting?.toneMapping === "none",
|
|
2850
2871
|
gl: { preserveDrawingBuffer: true },
|
|
@@ -4177,6 +4198,44 @@ var SpatialHashGrid = class {
|
|
|
4177
4198
|
};
|
|
4178
4199
|
}
|
|
4179
4200
|
};
|
|
4201
|
+
|
|
4202
|
+
// lib/bandShapes.ts
|
|
4203
|
+
var shape = (d) => `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'><path d='${d}'/></svg>")`;
|
|
4204
|
+
var BAND_SHAPES = {
|
|
4205
|
+
wave: shape("M0 60 C240 100 480 100 720 60 C960 20 1200 20 1440 60 V100 H0 Z"),
|
|
4206
|
+
arc: shape("M0 100 Q720 0 1440 100 Z"),
|
|
4207
|
+
tilt: shape("M0 100 L1440 0 V100 Z"),
|
|
4208
|
+
step: shape("M0 100 V75 H360 V50 H720 V25 H1080 V0 H1440 V100 Z"),
|
|
4209
|
+
scallop: shape("M0 100 V40 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 V100 Z")
|
|
4210
|
+
};
|
|
4211
|
+
var BAND_EDGE_HEIGHT = "clamp(24px, 6vw, 96px)";
|
|
4212
|
+
var BAND_ACCENT_FALLBACK = "linear-gradient(180deg, color-mix(in oklab, var(--color-primary) 12%, var(--color-background)), var(--color-background))";
|
|
4213
|
+
var BAND_EDGE_FILL = {
|
|
4214
|
+
background: "var(--surface-page-image, none), var(--color-background)",
|
|
4215
|
+
muted: "var(--color-muted)",
|
|
4216
|
+
surface: "var(--color-card)",
|
|
4217
|
+
gradient: `var(--surface-accent-image, ${BAND_ACCENT_FALLBACK}), var(--color-muted)`,
|
|
4218
|
+
inverse: "var(--color-foreground)"
|
|
4219
|
+
};
|
|
4220
|
+
function bandEdgeMask(edge) {
|
|
4221
|
+
return edge === "curve" ? "var(--surface-edge-mask, none)" : BAND_SHAPES[edge];
|
|
4222
|
+
}
|
|
4223
|
+
function bandEdgeHeight(edge) {
|
|
4224
|
+
return edge === "curve" ? `var(--surface-edge-height, ${BAND_EDGE_HEIGHT})` : BAND_EDGE_HEIGHT;
|
|
4225
|
+
}
|
|
4226
|
+
function bandEdgeLayerStyle(edge, side, flip, color) {
|
|
4227
|
+
const mask = bandEdgeMask(edge);
|
|
4228
|
+
const turn = side === "top" ? flip ? "scaleY(-1)" : "rotate(180deg)" : flip ? "scaleX(-1)" : void 0;
|
|
4229
|
+
const style = { height: bandEdgeHeight(edge), background: BAND_EDGE_FILL[color], maskImage: mask, WebkitMaskImage: mask, transform: turn };
|
|
4230
|
+
if (color === "background") {
|
|
4231
|
+
style.backgroundSize = "var(--surface-page-image-size, auto), auto";
|
|
4232
|
+
style.backgroundAttachment = "fixed";
|
|
4233
|
+
}
|
|
4234
|
+
return style;
|
|
4235
|
+
}
|
|
4236
|
+
function bandPadding(basePad, edge) {
|
|
4237
|
+
return edge === "none" ? void 0 : `calc(${basePad} + ${bandEdgeHeight(edge)})`;
|
|
4238
|
+
}
|
|
4180
4239
|
function useTapReveal(options = {}) {
|
|
4181
4240
|
const { onReveal, onDismiss, refs, enabled = true } = options;
|
|
4182
4241
|
const [revealed, setRevealed] = React3.useState(false);
|
|
@@ -4245,7 +4304,237 @@ function pressableProps(onPress, options = {}) {
|
|
|
4245
4304
|
};
|
|
4246
4305
|
}
|
|
4247
4306
|
|
|
4248
|
-
//
|
|
4307
|
+
// lib/domPassthrough.ts
|
|
4308
|
+
var GLOBAL_ATTRIBUTES = /* @__PURE__ */ new Set(["role", "id", "lang", "dir", "tabIndex"]);
|
|
4309
|
+
function domPassthrough(props) {
|
|
4310
|
+
const out = {};
|
|
4311
|
+
for (const [key, value] of Object.entries(props)) {
|
|
4312
|
+
if (key.startsWith("aria-") || key.startsWith("data-") || GLOBAL_ATTRIBUTES.has(key)) {
|
|
4313
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === void 0) {
|
|
4314
|
+
out[key] = value;
|
|
4315
|
+
}
|
|
4316
|
+
}
|
|
4317
|
+
}
|
|
4318
|
+
return out;
|
|
4319
|
+
}
|
|
4320
|
+
var motionEnabledCache = null;
|
|
4321
|
+
function isMotionEnabled() {
|
|
4322
|
+
if (typeof document === "undefined") return true;
|
|
4323
|
+
if (motionEnabledCache !== null) return motionEnabledCache;
|
|
4324
|
+
const v = getComputedStyle(document.documentElement).getPropertyValue("--motion-enable").trim().toLowerCase();
|
|
4325
|
+
motionEnabledCache = v !== "off";
|
|
4326
|
+
return motionEnabledCache;
|
|
4327
|
+
}
|
|
4328
|
+
|
|
4329
|
+
// lib/motion-tokens.ts
|
|
4330
|
+
function cssTimeMs(value) {
|
|
4331
|
+
const v = value.trim();
|
|
4332
|
+
if (v.endsWith("ms")) return Number.parseFloat(v);
|
|
4333
|
+
if (v.endsWith("s")) return Number.parseFloat(v) * 1e3;
|
|
4334
|
+
return Number.NaN;
|
|
4335
|
+
}
|
|
4336
|
+
function tokenAt(el, name) {
|
|
4337
|
+
for (let at = el; at !== null; at = at.parentElement) {
|
|
4338
|
+
const value = getComputedStyle(at).getPropertyValue(name).trim();
|
|
4339
|
+
if (value !== "") return value;
|
|
4340
|
+
}
|
|
4341
|
+
return "";
|
|
4342
|
+
}
|
|
4343
|
+
function motionTiming(durationToken, easingToken, scope) {
|
|
4344
|
+
const duration = cssTimeMs(tokenAt(scope ?? document.documentElement, durationToken));
|
|
4345
|
+
const easing = tokenAt(scope ?? document.documentElement, easingToken);
|
|
4346
|
+
const reduced = typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
4347
|
+
if (!isMotionEnabled() || reduced || !Number.isFinite(duration) || easing === "") return void 0;
|
|
4348
|
+
return { duration, easing };
|
|
4349
|
+
}
|
|
4350
|
+
function layoutScale(el) {
|
|
4351
|
+
const layoutWidth = el instanceof HTMLElement ? el.offsetWidth : 0;
|
|
4352
|
+
const screenWidth = el.getBoundingClientRect().width;
|
|
4353
|
+
return layoutWidth > 0 && screenWidth > 0 ? screenWidth / layoutWidth : 1;
|
|
4354
|
+
}
|
|
4355
|
+
|
|
4356
|
+
// lib/animate-changes.ts
|
|
4357
|
+
function ownMotion(el) {
|
|
4358
|
+
return el.closest("[data-item-move]") !== null || /\balmadar-enter-/.test(el.getAttribute("class") ?? "");
|
|
4359
|
+
}
|
|
4360
|
+
function boxesOf(el) {
|
|
4361
|
+
return getComputedStyle(el).display === "contents" ? boxedChildren(el) : [el];
|
|
4362
|
+
}
|
|
4363
|
+
function boxedChildren(el) {
|
|
4364
|
+
return [...el.children].flatMap(boxesOf);
|
|
4365
|
+
}
|
|
4366
|
+
var GHOST_STYLE = ["font", "letterSpacing", "lineHeight", "color", "textAlign", "whiteSpace", "textTransform"];
|
|
4367
|
+
function roll(el, oldText, timing) {
|
|
4368
|
+
const box = el.getBoundingClientRect();
|
|
4369
|
+
const scale2 = layoutScale(el);
|
|
4370
|
+
const computed = getComputedStyle(el);
|
|
4371
|
+
const holder = document.createElement("span");
|
|
4372
|
+
holder.setAttribute("aria-hidden", "true");
|
|
4373
|
+
Object.assign(holder.style, {
|
|
4374
|
+
position: "fixed",
|
|
4375
|
+
left: `${box.left}px`,
|
|
4376
|
+
top: `${box.top}px`,
|
|
4377
|
+
width: `${box.width / scale2}px`,
|
|
4378
|
+
height: `${box.height / scale2}px`,
|
|
4379
|
+
transform: scale2 === 1 ? "" : `scale(${scale2})`,
|
|
4380
|
+
transformOrigin: "top left",
|
|
4381
|
+
pointerEvents: "none",
|
|
4382
|
+
zIndex: "2147483647"
|
|
4383
|
+
});
|
|
4384
|
+
const ghost = document.createElement("span");
|
|
4385
|
+
ghost.setAttribute("data-change-ghost", "");
|
|
4386
|
+
ghost.setAttribute("aria-hidden", "true");
|
|
4387
|
+
ghost.textContent = oldText;
|
|
4388
|
+
for (const prop of GHOST_STYLE) ghost.style[prop] = computed[prop];
|
|
4389
|
+
Object.assign(ghost.style, { display: "block", width: "100%", height: "100%", overflow: "visible" });
|
|
4390
|
+
holder.appendChild(ghost);
|
|
4391
|
+
document.body.appendChild(holder);
|
|
4392
|
+
const out = ghost.animate(
|
|
4393
|
+
[{ opacity: 1, transform: "none" }, { opacity: 0, transform: "translateY(-40%)", offset: 0.5 }, { opacity: 0, transform: "translateY(-40%)" }],
|
|
4394
|
+
timing
|
|
4395
|
+
);
|
|
4396
|
+
if (out === void 0) holder.remove();
|
|
4397
|
+
else {
|
|
4398
|
+
out.addEventListener("finish", () => holder.remove());
|
|
4399
|
+
out.addEventListener("cancel", () => holder.remove());
|
|
4400
|
+
}
|
|
4401
|
+
el.animate(
|
|
4402
|
+
[{ opacity: 0, transform: "translateY(40%)" }, { opacity: 0, transform: "translateY(40%)", offset: 0.4 }, { opacity: 1, transform: "none" }],
|
|
4403
|
+
timing
|
|
4404
|
+
);
|
|
4405
|
+
}
|
|
4406
|
+
var textOnly = (el) => el instanceof HTMLElement && el.childNodes.length > 0 && [...el.childNodes].every((n) => n.nodeType === Node.TEXT_NODE);
|
|
4407
|
+
function settle(root, added, changed) {
|
|
4408
|
+
const timing = motionTiming("--duration-normal", "--easing-emphasized", root);
|
|
4409
|
+
if (timing === void 0) return;
|
|
4410
|
+
for (const el of added) {
|
|
4411
|
+
if (ownMotion(el) || el.parentElement !== null && [...added].some((other) => other !== el && other.contains(el))) continue;
|
|
4412
|
+
for (const box of boxesOf(el)) {
|
|
4413
|
+
if (ownMotion(box)) continue;
|
|
4414
|
+
box.animate([{ opacity: 0, transform: "translateY(6px)" }, { opacity: 1, transform: "none" }], timing);
|
|
4415
|
+
}
|
|
4416
|
+
}
|
|
4417
|
+
for (const [el, oldText] of changed) {
|
|
4418
|
+
if (ownMotion(el) || [...added].some((a) => a.contains(el))) continue;
|
|
4419
|
+
if (oldText !== void 0 && oldText !== el.textContent && textOnly(el)) roll(el, oldText, timing);
|
|
4420
|
+
else el.animate([{ opacity: 0.25 }, { opacity: 1 }], timing);
|
|
4421
|
+
}
|
|
4422
|
+
}
|
|
4423
|
+
function blocks(root) {
|
|
4424
|
+
const seen = /* @__PURE__ */ new Set();
|
|
4425
|
+
for (const wrapper of root.querySelectorAll("[data-pattern]")) {
|
|
4426
|
+
for (const box of boxesOf(wrapper)) if (!ownMotion(box)) seen.add(box);
|
|
4427
|
+
}
|
|
4428
|
+
return [...seen];
|
|
4429
|
+
}
|
|
4430
|
+
function glidePushed(root, places) {
|
|
4431
|
+
const timing = motionTiming("--duration-normal", "--easing-emphasized", root);
|
|
4432
|
+
const origin = root.getBoundingClientRect();
|
|
4433
|
+
const applied = /* @__PURE__ */ new Map();
|
|
4434
|
+
const present = /* @__PURE__ */ new Set();
|
|
4435
|
+
for (const el of blocks(root)) {
|
|
4436
|
+
present.add(el);
|
|
4437
|
+
if ((el.getAnimations?.() ?? []).length > 0) {
|
|
4438
|
+
places.delete(el);
|
|
4439
|
+
continue;
|
|
4440
|
+
}
|
|
4441
|
+
const box = el.getBoundingClientRect();
|
|
4442
|
+
const now = { x: box.left - origin.left, y: box.top - origin.top };
|
|
4443
|
+
const was = places.get(el);
|
|
4444
|
+
places.set(el, now);
|
|
4445
|
+
if (was === void 0 || timing === void 0) continue;
|
|
4446
|
+
let inherited = { x: 0, y: 0 };
|
|
4447
|
+
for (let up = el.parentElement; up !== null && up !== root; up = up.parentElement) {
|
|
4448
|
+
const a = applied.get(up);
|
|
4449
|
+
if (a !== void 0) {
|
|
4450
|
+
inherited = a;
|
|
4451
|
+
break;
|
|
4452
|
+
}
|
|
4453
|
+
}
|
|
4454
|
+
const dx = was.x - now.x - inherited.x;
|
|
4455
|
+
const dy = was.y - now.y - inherited.y;
|
|
4456
|
+
if (Math.abs(dx) < 0.5 && Math.abs(dy) < 0.5) {
|
|
4457
|
+
if (inherited.x !== 0 || inherited.y !== 0) applied.set(el, inherited);
|
|
4458
|
+
continue;
|
|
4459
|
+
}
|
|
4460
|
+
const scale2 = layoutScale(el);
|
|
4461
|
+
el.animate([{ transform: `translate(${dx / scale2}px, ${dy / scale2}px)` }, { transform: "none" }], { ...timing, composite: "add" });
|
|
4462
|
+
applied.set(el, { x: inherited.x + dx, y: inherited.y + dy });
|
|
4463
|
+
}
|
|
4464
|
+
for (const el of places.keys()) if (!present.has(el)) places.delete(el);
|
|
4465
|
+
}
|
|
4466
|
+
function easeHeight(root) {
|
|
4467
|
+
if (typeof ResizeObserver === "undefined") return () => void 0;
|
|
4468
|
+
let rest;
|
|
4469
|
+
let glide;
|
|
4470
|
+
const sizes = new ResizeObserver(() => {
|
|
4471
|
+
const scale2 = layoutScale(root);
|
|
4472
|
+
const shown = root.getBoundingClientRect().height / scale2;
|
|
4473
|
+
const gliding = glide !== void 0 && glide.playState === "running";
|
|
4474
|
+
glide?.cancel();
|
|
4475
|
+
glide = void 0;
|
|
4476
|
+
const height = root.getBoundingClientRect().height / scale2;
|
|
4477
|
+
const from = gliding ? shown : rest;
|
|
4478
|
+
rest = height;
|
|
4479
|
+
const timing = motionTiming("--duration-normal", "--easing-emphasized", root);
|
|
4480
|
+
if (from === void 0 || timing === void 0 || Math.abs(from - height) < 1) return;
|
|
4481
|
+
glide = root.animate(
|
|
4482
|
+
[{ height: `${from}px`, overflow: "clip" }, { height: `${height}px`, overflow: "clip" }],
|
|
4483
|
+
timing
|
|
4484
|
+
) ?? void 0;
|
|
4485
|
+
});
|
|
4486
|
+
let watched = [];
|
|
4487
|
+
const watch = () => {
|
|
4488
|
+
const next = boxedChildren(root);
|
|
4489
|
+
if (next.length === watched.length && next.every((el, i) => el === watched[i])) return;
|
|
4490
|
+
watched = next;
|
|
4491
|
+
sizes.disconnect();
|
|
4492
|
+
for (const el of next) sizes.observe(el);
|
|
4493
|
+
};
|
|
4494
|
+
watch();
|
|
4495
|
+
const children = new MutationObserver(watch);
|
|
4496
|
+
children.observe(root, { childList: true, subtree: true });
|
|
4497
|
+
return () => {
|
|
4498
|
+
children.disconnect();
|
|
4499
|
+
sizes.disconnect();
|
|
4500
|
+
};
|
|
4501
|
+
}
|
|
4502
|
+
function useAnimateChanges(ref, enabled) {
|
|
4503
|
+
React3.useEffect(() => {
|
|
4504
|
+
const root = ref.current;
|
|
4505
|
+
if (!enabled || root === null) return;
|
|
4506
|
+
return easeHeight(root);
|
|
4507
|
+
}, [ref, enabled]);
|
|
4508
|
+
React3.useEffect(() => {
|
|
4509
|
+
const root = ref.current;
|
|
4510
|
+
if (!enabled || root === null || typeof MutationObserver === "undefined") return;
|
|
4511
|
+
const observer = new MutationObserver((records) => {
|
|
4512
|
+
const added = /* @__PURE__ */ new Set();
|
|
4513
|
+
const changed = /* @__PURE__ */ new Map();
|
|
4514
|
+
for (const record of records) {
|
|
4515
|
+
if (record.type === "childList") {
|
|
4516
|
+
for (const node of record.addedNodes) {
|
|
4517
|
+
if (node instanceof Element) added.add(node);
|
|
4518
|
+
else if (node.nodeType === Node.TEXT_NODE && node.parentElement !== null && changed.get(node.parentElement) === void 0) {
|
|
4519
|
+
const removed = [...record.removedNodes].filter((n) => n.nodeType === Node.TEXT_NODE);
|
|
4520
|
+
changed.set(node.parentElement, removed.length > 0 ? removed.map((n) => n.textContent ?? "").join("") : void 0);
|
|
4521
|
+
}
|
|
4522
|
+
}
|
|
4523
|
+
} else if (record.type === "characterData") {
|
|
4524
|
+
const el = record.target.parentElement;
|
|
4525
|
+
if (el === null || changed.get(el) !== void 0) continue;
|
|
4526
|
+
changed.set(el, [...el.childNodes].map((n) => n === record.target ? record.oldValue ?? "" : n.textContent ?? "").join(""));
|
|
4527
|
+
}
|
|
4528
|
+
}
|
|
4529
|
+
glidePushed(root, places);
|
|
4530
|
+
settle(root, added, changed);
|
|
4531
|
+
});
|
|
4532
|
+
const places = /* @__PURE__ */ new Map();
|
|
4533
|
+
glidePushed(root, places);
|
|
4534
|
+
observer.observe(root, { subtree: true, childList: true, characterData: true, characterDataOldValue: true });
|
|
4535
|
+
return () => observer.disconnect();
|
|
4536
|
+
}, [ref, enabled]);
|
|
4537
|
+
}
|
|
4249
4538
|
var paddingStyles = {
|
|
4250
4539
|
none: "p-0",
|
|
4251
4540
|
xs: "p-1",
|
|
@@ -4310,7 +4599,18 @@ var bgStyles = {
|
|
|
4310
4599
|
muted: "bg-muted text-foreground",
|
|
4311
4600
|
accent: "bg-accent text-accent-foreground",
|
|
4312
4601
|
surface: "bg-card",
|
|
4313
|
-
overlay: "bg-card/80 backdrop-blur-sm"
|
|
4602
|
+
overlay: "bg-card/80 backdrop-blur-sm",
|
|
4603
|
+
gradient: "band-gradient",
|
|
4604
|
+
inverse: "band-inverse"
|
|
4605
|
+
};
|
|
4606
|
+
var paddingRem = {
|
|
4607
|
+
none: "0rem",
|
|
4608
|
+
xs: "0.25rem",
|
|
4609
|
+
sm: "0.5rem",
|
|
4610
|
+
md: "1rem",
|
|
4611
|
+
lg: "1.5rem",
|
|
4612
|
+
xl: "2rem",
|
|
4613
|
+
"2xl": "3rem"
|
|
4314
4614
|
};
|
|
4315
4615
|
var roundedStyles = {
|
|
4316
4616
|
none: "rounded-none",
|
|
@@ -4373,6 +4673,13 @@ var Box = React3__default.default.forwardRef(
|
|
|
4373
4673
|
hoverEvent,
|
|
4374
4674
|
tapReveal = true,
|
|
4375
4675
|
maxWidth,
|
|
4676
|
+
edgeTop = "none",
|
|
4677
|
+
edgeBottom = "none",
|
|
4678
|
+
edgeColor = "background",
|
|
4679
|
+
edgeFlip = false,
|
|
4680
|
+
texture = false,
|
|
4681
|
+
animateChanges = false,
|
|
4682
|
+
backdrop,
|
|
4376
4683
|
onClick,
|
|
4377
4684
|
onMouseEnter,
|
|
4378
4685
|
onMouseLeave,
|
|
@@ -4380,6 +4687,13 @@ var Box = React3__default.default.forwardRef(
|
|
|
4380
4687
|
...rest
|
|
4381
4688
|
}, ref) => {
|
|
4382
4689
|
const eventBus = useEventBus();
|
|
4690
|
+
const ownRef = React3.useRef(null);
|
|
4691
|
+
useAnimateChanges(ownRef, animateChanges);
|
|
4692
|
+
const setRef = React3.useCallback((node) => {
|
|
4693
|
+
ownRef.current = node;
|
|
4694
|
+
if (typeof ref === "function") ref(node);
|
|
4695
|
+
else if (ref !== null) ref.current = node;
|
|
4696
|
+
}, [ref]);
|
|
4383
4697
|
const { override: themeOverride } = context.useThemeScope();
|
|
4384
4698
|
const declaredTheme = rest["data-theme"];
|
|
4385
4699
|
const dataTheme = declaredTheme !== void 0 && themeOverride ? themeOverride : declaredTheme;
|
|
@@ -4415,12 +4729,25 @@ var Box = React3__default.default.forwardRef(
|
|
|
4415
4729
|
if (hoverEvent && tapReveal) triggerProps.onPointerDown(e);
|
|
4416
4730
|
onPointerDown?.(e);
|
|
4417
4731
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
4732
|
+
const isBand = backdrop != null || texture || edgeTop !== "none" || edgeBottom !== "none";
|
|
4733
|
+
const padKey = paddingY ?? padding;
|
|
4734
|
+
const bandStyle = {};
|
|
4735
|
+
const padTop = padKey ? bandPadding(paddingRem[padKey], edgeTop) : void 0;
|
|
4736
|
+
const padBottom = padKey ? bandPadding(paddingRem[padKey], edgeBottom) : void 0;
|
|
4737
|
+
if (padTop) bandStyle.paddingTop = padTop;
|
|
4738
|
+
if (padBottom) bandStyle.paddingBottom = padBottom;
|
|
4739
|
+
const bandLayers = isBand ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4740
|
+
backdrop != null && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", "data-band-layer": "", "aria-hidden": true, className: "band-backdrop", children: backdrop }),
|
|
4741
|
+
texture && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", "data-band-layer": "", "aria-hidden": true, className: "band-texture" }),
|
|
4742
|
+
edgeTop !== "none" && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", "data-band-layer": "", "aria-hidden": true, className: "band-edge band-edge-top", style: bandEdgeLayerStyle(edgeTop, "top", edgeFlip, edgeColor) }),
|
|
4743
|
+
edgeBottom !== "none" && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", "data-band-layer": "", "aria-hidden": true, className: "band-edge band-edge-bottom", style: bandEdgeLayerStyle(edgeBottom, "bottom", edgeFlip, edgeColor) })
|
|
4744
|
+
] }) : null;
|
|
4418
4745
|
const isClickable = action || onClick;
|
|
4419
4746
|
const actionControl = action && rest.role === void 0 && rest.tabIndex === void 0 ? pressableProps(handleClick) : {};
|
|
4420
4747
|
return React3__default.default.createElement(
|
|
4421
4748
|
Component2,
|
|
4422
4749
|
{
|
|
4423
|
-
ref,
|
|
4750
|
+
ref: setRef,
|
|
4424
4751
|
className: cn(
|
|
4425
4752
|
padding && paddingStyles[padding],
|
|
4426
4753
|
paddingX && paddingXStyles[paddingX],
|
|
@@ -4438,6 +4765,7 @@ var Box = React3__default.default.forwardRef(
|
|
|
4438
4765
|
overflow && overflowStyles[overflow],
|
|
4439
4766
|
position && positionStyles[position],
|
|
4440
4767
|
isClickable && "cursor-pointer",
|
|
4768
|
+
isBand && "band",
|
|
4441
4769
|
className
|
|
4442
4770
|
),
|
|
4443
4771
|
onClick: isClickable ? handleClick : void 0,
|
|
@@ -4445,11 +4773,15 @@ var Box = React3__default.default.forwardRef(
|
|
|
4445
4773
|
onMouseEnter: hoverEvent || onMouseEnter ? handleMouseEnter : void 0,
|
|
4446
4774
|
onMouseLeave: hoverEvent || onMouseLeave ? handleMouseLeave : void 0,
|
|
4447
4775
|
onPointerDown: hoverEvent && tapReveal || onPointerDown ? handlePointerDown : void 0,
|
|
4448
|
-
style: maxWidth ? { maxWidth, ...rest.style } : rest.style,
|
|
4776
|
+
style: maxWidth || isBand ? { ...maxWidth ? { maxWidth } : {}, ...bandStyle, ...rest.style } : rest.style,
|
|
4449
4777
|
...rest,
|
|
4450
|
-
"data-theme": dataTheme
|
|
4778
|
+
"data-theme": dataTheme,
|
|
4779
|
+
"data-motion": animateChanges ? "presentation" : void 0
|
|
4451
4780
|
},
|
|
4452
|
-
children
|
|
4781
|
+
isBand ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4782
|
+
bandLayers,
|
|
4783
|
+
children
|
|
4784
|
+
] }) : children
|
|
4453
4785
|
);
|
|
4454
4786
|
}
|
|
4455
4787
|
);
|
|
@@ -4591,7 +4923,6 @@ var en_default = {
|
|
|
4591
4923
|
"aria.upvote": "Upvote",
|
|
4592
4924
|
"aria.downvote": "Downvote",
|
|
4593
4925
|
"aria.qrScanner": "QR scanner",
|
|
4594
|
-
"aria.mockScanDev": "Mock scan (dev)",
|
|
4595
4926
|
"aria.openMenu": "Open menu",
|
|
4596
4927
|
"aria.closeMenu": "Close menu",
|
|
4597
4928
|
"aria.openSidebar": "Open sidebar",
|
|
@@ -4789,7 +5120,6 @@ var en_default = {
|
|
|
4789
5120
|
"qrScanner.pauseScanning": "Pause scanning",
|
|
4790
5121
|
"qrScanner.switchToFrontCamera": "Switch to front camera",
|
|
4791
5122
|
"qrScanner.switchToRearCamera": "Switch to rear camera",
|
|
4792
|
-
"qrScanner.mockScan": "Mock Scan",
|
|
4793
5123
|
"docSearch.placeholder": "Search documentation...",
|
|
4794
5124
|
"stateMachine.loading": "Loading state machine\u2026",
|
|
4795
5125
|
"stateMachine.noStateMachine": "No state machine to visualize",
|
|
@@ -5773,20 +6103,6 @@ function formatValue(value, format, fmt = {}) {
|
|
|
5773
6103
|
|
|
5774
6104
|
// lib/inlineText.ts
|
|
5775
6105
|
var INLINE_TEXT_ATTR = "data-inline-text";
|
|
5776
|
-
|
|
5777
|
-
// lib/domPassthrough.ts
|
|
5778
|
-
var GLOBAL_ATTRIBUTES = /* @__PURE__ */ new Set(["role", "id", "lang", "dir", "tabIndex"]);
|
|
5779
|
-
function domPassthrough(props) {
|
|
5780
|
-
const out = {};
|
|
5781
|
-
for (const [key, value] of Object.entries(props)) {
|
|
5782
|
-
if (key.startsWith("aria-") || key.startsWith("data-") || GLOBAL_ATTRIBUTES.has(key)) {
|
|
5783
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === void 0) {
|
|
5784
|
-
out[key] = value;
|
|
5785
|
-
}
|
|
5786
|
-
}
|
|
5787
|
-
}
|
|
5788
|
-
return out;
|
|
5789
|
-
}
|
|
5790
6106
|
var variantStyles = {
|
|
5791
6107
|
h1: "text-4xl heading-voice text-foreground",
|
|
5792
6108
|
h2: "text-3xl heading-voice text-foreground",
|
|
@@ -6502,17 +6818,20 @@ var EFFECT_OPERATOR_CATEGORY = {
|
|
|
6502
6818
|
"workspace/write-schema": "system",
|
|
6503
6819
|
"workspace/write-plan": "system",
|
|
6504
6820
|
"workspace/archive-orbital": "system",
|
|
6505
|
-
"
|
|
6821
|
+
"behavior/catalog": "system",
|
|
6822
|
+
"behavior/describe": "system",
|
|
6823
|
+
"behavior/source": "system",
|
|
6824
|
+
"program/read": "system",
|
|
6825
|
+
"program/print": "system",
|
|
6826
|
+
"program/eval": "system",
|
|
6827
|
+
"program/compose": "system"
|
|
6506
6828
|
};
|
|
6507
6829
|
var EFFECT_FAMILY_CATEGORY = {
|
|
6508
6830
|
agent: "system",
|
|
6509
6831
|
os: "system",
|
|
6510
6832
|
browser: "system",
|
|
6511
6833
|
llm: "system",
|
|
6512
|
-
behavior: "system",
|
|
6513
|
-
validate: "control",
|
|
6514
6834
|
session: "system",
|
|
6515
|
-
compose: "system",
|
|
6516
6835
|
trace: "control",
|
|
6517
6836
|
memory: "data",
|
|
6518
6837
|
application: "system"
|
|
@@ -6532,7 +6851,12 @@ function effectCategoryOf(head) {
|
|
|
6532
6851
|
}
|
|
6533
6852
|
return null;
|
|
6534
6853
|
}
|
|
6854
|
+
var PENDING_STD_CATEGORY_COLORS = {
|
|
6855
|
+
"std-behavior-value": avlBlend("var(--color-accent)", 40, "var(--color-success)"),
|
|
6856
|
+
"std-program": avlBlend("var(--color-accent)", 60, "var(--color-info)")
|
|
6857
|
+
};
|
|
6535
6858
|
var OPERATOR_CATEGORY_COLORS = {
|
|
6859
|
+
...PENDING_STD_CATEGORY_COLORS,
|
|
6536
6860
|
"arithmetic": "var(--color-primary)",
|
|
6537
6861
|
"comparison": "var(--color-warning)",
|
|
6538
6862
|
"logic": "var(--color-accent)",
|
|
@@ -1,14 +1,14 @@
|
|
|
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-CNjANoaU.js';
|
|
2
|
+
export { c as Canvas3DHost, d as Canvas3DHostHandle, e as Canvas3DHostProps, c as GameCanvas3D, U as UnitAnimationState } from '../../../Canvas3DHost-CNjANoaU.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';
|
|
6
6
|
import { JsonObject, EventEmit, OrbitalSchema } from '@almadar/core';
|
|
7
7
|
import { Z as ZoomLevel } from '../../../avl-zoom-state-CKMVuBFg.js';
|
|
8
|
-
import { b as Avl3DModelOverrides } from '../../../avl-3d-context-
|
|
9
|
-
export { d as AVL_3D_COLORS, A as Avl3DConfig, a as Avl3DContext, C as CAMERA_POSITIONS, P as Position3D, e as arcCurve3D, f as fibonacciSpherePositions, g as goldenSpiralPositions, o as orbitRingPositions, s as selfLoopCurve3D, t as treeLayout3D, u as useAvl3DConfig } from '../../../avl-3d-context-
|
|
8
|
+
import { b as Avl3DModelOverrides } from '../../../avl-3d-context-Dxun3-ri.js';
|
|
9
|
+
export { d as AVL_3D_COLORS, A as Avl3DConfig, a as Avl3DContext, C as CAMERA_POSITIONS, P as Position3D, e as arcCurve3D, f as fibonacciSpherePositions, g as goldenSpiralPositions, o as orbitRingPositions, s as selfLoopCurve3D, t as treeLayout3D, u as useAvl3DConfig } from '../../../avl-3d-context-Dxun3-ri.js';
|
|
10
10
|
import { A as ApplicationLevelData, b as OrbitalLevelData, T as TraitLevelData, c as TransitionLevelData } from '../../../avl-schema-parser-CH1QoZw1.js';
|
|
11
|
-
import '../../../paintDispatch-
|
|
11
|
+
import '../../../paintDispatch-Cp1_S93j.js';
|
|
12
12
|
import 'lucide-react';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { goldenSpiralPositions, forceDirectedPositions, Avl3DOrbitalNode, Avl3DCrossWire, Avl3DEntityCore, fibonacciSpherePositions, Avl3DLabel, Avl3DStateNode, Avl3DTransitionArc, Avl3DExprTree, AVL_3D_COLORS, zoomReducer, initialZoomState, CAMERA_POSITIONS, getBreadcrumbs, Avl3DTooltip } from '../../../chunk-
|
|
2
|
-
export { AVL_3D_COLORS, CAMERA_POSITIONS, arcCurve3D, fibonacciSpherePositions, goldenSpiralPositions, orbitRingPositions, selfLoopCurve3D, treeLayout3D } from '../../../chunk-
|
|
3
|
-
import { useCanvasTheme, withSeries, resolveDrawableColors, markColor, applySceneMaterials, collectDrawnItems, buildHitIndex, withPreviewPosition, isValidScenePos, isAnimatedShape, applyShapeAnimation, expandFxLayer, isAnimatedGroup, applyMeshAnimation, spriteAssetState, SPRITE_FALLBACK_FILL, isAnimatedMesh, clampSegments, isAtlasAsset, getAtlas, subRectFor, polyhedronBounds, AVL_INK, parseTransitionLevel, parseTraitLevel, parseOrbitalLevel, parseApplicationLevel, Box, HStack, pressableProps, resolveThemeColor } from '../../../chunk-
|
|
4
|
-
import { Typography } from '../../../chunk-
|
|
1
|
+
import { goldenSpiralPositions, forceDirectedPositions, Avl3DOrbitalNode, Avl3DCrossWire, Avl3DEntityCore, fibonacciSpherePositions, Avl3DLabel, Avl3DStateNode, Avl3DTransitionArc, Avl3DExprTree, AVL_3D_COLORS, zoomReducer, initialZoomState, CAMERA_POSITIONS, getBreadcrumbs, Avl3DTooltip } from '../../../chunk-7NIU5GDC.js';
|
|
2
|
+
export { AVL_3D_COLORS, CAMERA_POSITIONS, arcCurve3D, fibonacciSpherePositions, goldenSpiralPositions, orbitRingPositions, selfLoopCurve3D, treeLayout3D } from '../../../chunk-7NIU5GDC.js';
|
|
3
|
+
import { useCanvasTheme, withSeries, resolveDrawableColors, markColor, applySceneMaterials, collectDrawnItems, buildHitIndex, withPreviewPosition, isValidScenePos, isAnimatedShape, applyShapeAnimation, expandFxLayer, isAnimatedGroup, applyMeshAnimation, spriteAssetState, SPRITE_FALLBACK_FILL, isAnimatedMesh, clampSegments, isAtlasAsset, getAtlas, subRectFor, polyhedronBounds, AVL_INK, parseTransitionLevel, parseTraitLevel, parseOrbitalLevel, parseApplicationLevel, Box, HStack, pressableProps, resolveThemeColor } from '../../../chunk-MGN6B6OQ.js';
|
|
4
|
+
import { Typography } from '../../../chunk-KZRAMPM6.js';
|
|
5
5
|
import '../../../chunk-XJTHMW4G.js';
|
|
6
6
|
import { useEventBus, useEmitEvent } from '../../../chunk-CHNC4UYE.js';
|
|
7
|
-
import { keyMapCode, resolveKeyMapEvent } from '../../../chunk-
|
|
7
|
+
import { keyMapCode, resolveKeyMapEvent } from '../../../chunk-N23SVGTH.js';
|
|
8
8
|
import { cn } from '../../../chunk-64WACXM7.js';
|
|
9
|
-
import '../../../chunk-
|
|
10
|
-
import '../../../chunk-
|
|
9
|
+
import '../../../chunk-6ZCU3BQN.js';
|
|
10
|
+
import '../../../chunk-FYX64CDL.js';
|
|
11
11
|
import { __publicField } from '../../../chunk-QPXIAUJD.js';
|
|
12
12
|
import React3, { createContext, forwardRef, useRef, useState, useMemo, useEffect, useCallback, useImperativeHandle, Component, useContext, useReducer, useLayoutEffect } from 'react';
|
|
13
13
|
import { useTranslate } from '@almadar/ui/hooks';
|
|
@@ -1274,6 +1274,25 @@ function FxLayer3D({
|
|
|
1274
1274
|
const children = expandFxLayer(node, epochNow, "3d", void 0, void 0);
|
|
1275
1275
|
return /* @__PURE__ */ jsx(Fragment, { children: children.map((c, i) => /* @__PURE__ */ jsx(Drawable3D, { node: c, projector, groupOpacity }, i)) });
|
|
1276
1276
|
}
|
|
1277
|
+
function useOnScreen(ref, margin = "200px") {
|
|
1278
|
+
const [intersecting, setIntersecting] = useState(true);
|
|
1279
|
+
const [pageVisible, setPageVisible] = useState(true);
|
|
1280
|
+
useEffect(() => {
|
|
1281
|
+
const el = ref.current;
|
|
1282
|
+
if (!el || typeof IntersectionObserver === "undefined") return;
|
|
1283
|
+
const observer = new IntersectionObserver(([entry]) => setIntersecting(entry.isIntersecting), { rootMargin: margin });
|
|
1284
|
+
observer.observe(el);
|
|
1285
|
+
return () => observer.disconnect();
|
|
1286
|
+
}, [ref, margin]);
|
|
1287
|
+
useEffect(() => {
|
|
1288
|
+
if (typeof document === "undefined") return;
|
|
1289
|
+
const update = () => setPageVisible(document.visibilityState !== "hidden");
|
|
1290
|
+
update();
|
|
1291
|
+
document.addEventListener("visibilitychange", update);
|
|
1292
|
+
return () => document.removeEventListener("visibilitychange", update);
|
|
1293
|
+
}, []);
|
|
1294
|
+
return intersecting && pageVisible;
|
|
1295
|
+
}
|
|
1277
1296
|
var DEFAULT_GRID_CONFIG = {
|
|
1278
1297
|
cellSize: 1};
|
|
1279
1298
|
var EDIT_SELECTION_RADIUS = 0.6;
|
|
@@ -1350,6 +1369,7 @@ var Canvas3DHost = forwardRef(
|
|
|
1350
1369
|
moveEvent
|
|
1351
1370
|
}, ref) => {
|
|
1352
1371
|
const containerRef = useRef(null);
|
|
1372
|
+
const onScreen = useOnScreen(containerRef);
|
|
1353
1373
|
const controlsRef = useRef(null);
|
|
1354
1374
|
const [internalError, setInternalError] = useState(null);
|
|
1355
1375
|
const eventBus = useEventBus();
|
|
@@ -1655,6 +1675,7 @@ var Canvas3DHost = forwardRef(
|
|
|
1655
1675
|
children: /* @__PURE__ */ jsxs(
|
|
1656
1676
|
Canvas,
|
|
1657
1677
|
{
|
|
1678
|
+
frameloop: onScreen ? "always" : "never",
|
|
1658
1679
|
shadows,
|
|
1659
1680
|
flat: lighting?.toneMapping === "none",
|
|
1660
1681
|
gl: { preserveDrawingBuffer: true },
|