@almadar/ui 5.140.0 → 5.142.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/avl/index.cjs +1380 -1226
- package/dist/avl/index.js +409 -255
- package/dist/{avl-schema-parser-B8Onmfsu.d.cts → avl-schema-parser-DAs12kxP.d.ts} +229 -2
- package/dist/{avl-schema-parser-B8Onmfsu.d.ts → avl-schema-parser-wOkfbwAh.d.cts} +229 -2
- package/dist/{cn-Do5Ra3l3.d.ts → cn-BDwC4QpH.d.ts} +1 -1
- package/dist/{cn-DkGYzPOg.d.cts → cn-rwc3svaX.d.cts} +1 -1
- package/dist/components/index.cjs +1364 -1210
- package/dist/components/index.d.cts +13 -6
- package/dist/components/index.d.ts +13 -6
- package/dist/components/index.js +400 -246
- package/dist/lib/drawable/three/index.cjs +542 -154
- package/dist/lib/drawable/three/index.d.cts +14 -171
- package/dist/lib/drawable/three/index.d.ts +14 -171
- package/dist/lib/drawable/three/index.js +518 -130
- package/dist/lib/index.d.cts +2 -2
- package/dist/lib/index.d.ts +2 -2
- package/dist/{paintDispatch-B5pPeSEp.d.cts → paintDispatch-BQn5Lyx1.d.cts} +160 -3
- package/dist/{paintDispatch-B5pPeSEp.d.ts → paintDispatch-BQn5Lyx1.d.ts} +160 -3
- package/dist/providers/index.cjs +1263 -1109
- package/dist/providers/index.js +384 -230
- package/dist/runtime/index.cjs +1241 -1087
- package/dist/runtime/index.js +389 -235
- package/package.json +4 -4
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as React77 from 'react';
|
|
3
|
+
import React77__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, useState, useLayoutEffect, Suspense, useSyncExternalStore, lazy, useId } from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
import { EventBusContext, useTraitScopeChain, useCurrentPagePath, useGameAudioContextOptional, useEntitySchemaOptional, useEntityBindingSnapshot, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
@@ -262,7 +262,7 @@ var init_SvgFlow = __esm({
|
|
|
262
262
|
width = 100,
|
|
263
263
|
height = 100
|
|
264
264
|
}) => {
|
|
265
|
-
const markerId =
|
|
265
|
+
const markerId = React77__default.useMemo(() => {
|
|
266
266
|
flowIdCounter += 1;
|
|
267
267
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
268
268
|
}, []);
|
|
@@ -855,7 +855,7 @@ var init_SvgRing = __esm({
|
|
|
855
855
|
width = 100,
|
|
856
856
|
height = 100
|
|
857
857
|
}) => {
|
|
858
|
-
const gradientId =
|
|
858
|
+
const gradientId = React77__default.useMemo(() => {
|
|
859
859
|
ringIdCounter += 1;
|
|
860
860
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
861
861
|
}, []);
|
|
@@ -1397,7 +1397,7 @@ var init_Icon = __esm({
|
|
|
1397
1397
|
const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
|
|
1398
1398
|
const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
|
|
1399
1399
|
const family = useIconFamily();
|
|
1400
|
-
const RenderedComponent =
|
|
1400
|
+
const RenderedComponent = React77__default.useMemo(() => {
|
|
1401
1401
|
if (directIcon) return null;
|
|
1402
1402
|
return effectiveName ? resolveIconForFamily(effectiveName) : null;
|
|
1403
1403
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1521,7 +1521,7 @@ var init_atlasSlice = __esm({
|
|
|
1521
1521
|
}
|
|
1522
1522
|
});
|
|
1523
1523
|
function useAtlasSliceDataUrl(asset) {
|
|
1524
|
-
const [, bump] =
|
|
1524
|
+
const [, bump] = React77.useReducer((x) => x + 1, 0);
|
|
1525
1525
|
if (!isAtlasAsset(asset)) return void 0;
|
|
1526
1526
|
const key = `${asset.atlas}#${asset.sprite}`;
|
|
1527
1527
|
const cached = sliceDataUrlCache.get(key);
|
|
@@ -1584,13 +1584,13 @@ function AtlasImage({
|
|
|
1584
1584
|
style,
|
|
1585
1585
|
"aria-hidden": ariaHidden
|
|
1586
1586
|
}) {
|
|
1587
|
-
const [, bump] =
|
|
1588
|
-
const canvasRef =
|
|
1587
|
+
const [, bump] = React77.useReducer((x) => x + 1, 0);
|
|
1588
|
+
const canvasRef = React77.useRef(null);
|
|
1589
1589
|
const sliced = isAtlasAsset(asset);
|
|
1590
1590
|
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
1591
1591
|
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
1592
1592
|
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
1593
|
-
|
|
1593
|
+
React77.useEffect(() => {
|
|
1594
1594
|
const canvas = canvasRef.current;
|
|
1595
1595
|
if (!canvas || !img || !rect) return;
|
|
1596
1596
|
canvas.width = rect.sw;
|
|
@@ -1666,7 +1666,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1666
1666
|
const IconComp = value;
|
|
1667
1667
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1668
1668
|
}
|
|
1669
|
-
if (
|
|
1669
|
+
if (React77__default.isValidElement(value)) {
|
|
1670
1670
|
return value;
|
|
1671
1671
|
}
|
|
1672
1672
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1743,7 +1743,7 @@ var init_Button = __esm({
|
|
|
1743
1743
|
md: "h-icon-default w-icon-default",
|
|
1744
1744
|
lg: "h-icon-default w-icon-default"
|
|
1745
1745
|
};
|
|
1746
|
-
Button =
|
|
1746
|
+
Button = React77__default.forwardRef(
|
|
1747
1747
|
({
|
|
1748
1748
|
className,
|
|
1749
1749
|
variant = "primary",
|
|
@@ -1815,7 +1815,7 @@ var init_Input = __esm({
|
|
|
1815
1815
|
init_cn();
|
|
1816
1816
|
init_Icon();
|
|
1817
1817
|
init_useEventBus();
|
|
1818
|
-
Input =
|
|
1818
|
+
Input = React77__default.forwardRef(
|
|
1819
1819
|
({
|
|
1820
1820
|
className,
|
|
1821
1821
|
inputType,
|
|
@@ -1839,9 +1839,9 @@ var init_Input = __esm({
|
|
|
1839
1839
|
const eventBus = useEventBus();
|
|
1840
1840
|
const type = inputType || htmlType || "text";
|
|
1841
1841
|
const isDeclarative = typeof onChange === "string";
|
|
1842
|
-
const [localValue, setLocalValue] =
|
|
1843
|
-
const pendingEchoRef =
|
|
1844
|
-
|
|
1842
|
+
const [localValue, setLocalValue] = React77__default.useState(value);
|
|
1843
|
+
const pendingEchoRef = React77__default.useRef(/* @__PURE__ */ new Set());
|
|
1844
|
+
React77__default.useEffect(() => {
|
|
1845
1845
|
if (!isDeclarative) return;
|
|
1846
1846
|
const incoming = value == null ? "" : String(value);
|
|
1847
1847
|
if (pendingEchoRef.current.has(incoming)) {
|
|
@@ -2001,7 +2001,7 @@ var Label;
|
|
|
2001
2001
|
var init_Label = __esm({
|
|
2002
2002
|
"components/core/atoms/Label.tsx"() {
|
|
2003
2003
|
init_cn();
|
|
2004
|
-
Label =
|
|
2004
|
+
Label = React77__default.forwardRef(
|
|
2005
2005
|
({ className, required, children, ...props }, ref) => {
|
|
2006
2006
|
return /* @__PURE__ */ jsxs(
|
|
2007
2007
|
"label",
|
|
@@ -2028,7 +2028,7 @@ var init_Textarea = __esm({
|
|
|
2028
2028
|
"components/core/atoms/Textarea.tsx"() {
|
|
2029
2029
|
init_cn();
|
|
2030
2030
|
init_useEventBus();
|
|
2031
|
-
Textarea =
|
|
2031
|
+
Textarea = React77__default.forwardRef(
|
|
2032
2032
|
({ className, error, onChange, ...props }, ref) => {
|
|
2033
2033
|
const eventBus = useEventBus();
|
|
2034
2034
|
const handleChange = (e) => {
|
|
@@ -2267,7 +2267,7 @@ var init_Select = __esm({
|
|
|
2267
2267
|
init_cn();
|
|
2268
2268
|
init_Icon();
|
|
2269
2269
|
init_useEventBus();
|
|
2270
|
-
Select =
|
|
2270
|
+
Select = React77__default.forwardRef(
|
|
2271
2271
|
(props, _ref) => {
|
|
2272
2272
|
const { multiple, searchable, clearable } = props;
|
|
2273
2273
|
if (multiple || searchable || clearable) {
|
|
@@ -2284,7 +2284,7 @@ var init_Checkbox = __esm({
|
|
|
2284
2284
|
"components/core/atoms/Checkbox.tsx"() {
|
|
2285
2285
|
init_cn();
|
|
2286
2286
|
init_useEventBus();
|
|
2287
|
-
Checkbox =
|
|
2287
|
+
Checkbox = React77__default.forwardRef(
|
|
2288
2288
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
2289
2289
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
2290
2290
|
const eventBus = useEventBus();
|
|
@@ -2338,7 +2338,7 @@ var init_Spinner = __esm({
|
|
|
2338
2338
|
md: "h-6 w-6",
|
|
2339
2339
|
lg: "h-8 w-8"
|
|
2340
2340
|
};
|
|
2341
|
-
Spinner =
|
|
2341
|
+
Spinner = React77__default.forwardRef(
|
|
2342
2342
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
2343
2343
|
if (overlay) {
|
|
2344
2344
|
return /* @__PURE__ */ jsx(
|
|
@@ -2428,7 +2428,7 @@ var init_Card = __esm({
|
|
|
2428
2428
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
2429
2429
|
"tile-image-first": "p-0 overflow-hidden"
|
|
2430
2430
|
};
|
|
2431
|
-
Card =
|
|
2431
|
+
Card = React77__default.forwardRef(
|
|
2432
2432
|
({
|
|
2433
2433
|
className,
|
|
2434
2434
|
variant = "bordered",
|
|
@@ -2477,9 +2477,9 @@ var init_Card = __esm({
|
|
|
2477
2477
|
}
|
|
2478
2478
|
);
|
|
2479
2479
|
Card.displayName = "Card";
|
|
2480
|
-
CardHeader =
|
|
2480
|
+
CardHeader = React77__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
2481
2481
|
CardHeader.displayName = "CardHeader";
|
|
2482
|
-
CardTitle =
|
|
2482
|
+
CardTitle = React77__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2483
2483
|
"h3",
|
|
2484
2484
|
{
|
|
2485
2485
|
ref,
|
|
@@ -2492,11 +2492,11 @@ var init_Card = __esm({
|
|
|
2492
2492
|
}
|
|
2493
2493
|
));
|
|
2494
2494
|
CardTitle.displayName = "CardTitle";
|
|
2495
|
-
CardContent =
|
|
2495
|
+
CardContent = React77__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
2496
2496
|
CardContent.displayName = "CardContent";
|
|
2497
2497
|
CardBody = CardContent;
|
|
2498
2498
|
CardBody.displayName = "CardBody";
|
|
2499
|
-
CardFooter =
|
|
2499
|
+
CardFooter = React77__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2500
2500
|
"div",
|
|
2501
2501
|
{
|
|
2502
2502
|
ref,
|
|
@@ -2550,7 +2550,7 @@ var init_Badge = __esm({
|
|
|
2550
2550
|
md: "px-2.5 py-1 text-sm",
|
|
2551
2551
|
lg: "px-3 py-1.5 text-base"
|
|
2552
2552
|
};
|
|
2553
|
-
Badge =
|
|
2553
|
+
Badge = React77__default.forwardRef(
|
|
2554
2554
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2555
2555
|
const iconSizes3 = {
|
|
2556
2556
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2678,7 +2678,7 @@ var init_FilterPill = __esm({
|
|
|
2678
2678
|
md: "w-3.5 h-3.5",
|
|
2679
2679
|
lg: "w-4 h-4"
|
|
2680
2680
|
};
|
|
2681
|
-
FilterPill =
|
|
2681
|
+
FilterPill = React77__default.forwardRef(
|
|
2682
2682
|
({
|
|
2683
2683
|
className,
|
|
2684
2684
|
variant = "default",
|
|
@@ -2807,8 +2807,8 @@ var init_Avatar = __esm({
|
|
|
2807
2807
|
actionPayload
|
|
2808
2808
|
}) => {
|
|
2809
2809
|
const eventBus = useEventBus();
|
|
2810
|
-
const [imgFailed, setImgFailed] =
|
|
2811
|
-
|
|
2810
|
+
const [imgFailed, setImgFailed] = React77__default.useState(false);
|
|
2811
|
+
React77__default.useEffect(() => {
|
|
2812
2812
|
setImgFailed(false);
|
|
2813
2813
|
}, [src]);
|
|
2814
2814
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -3060,7 +3060,7 @@ var init_Box = __esm({
|
|
|
3060
3060
|
fixed: "fixed",
|
|
3061
3061
|
sticky: "sticky"
|
|
3062
3062
|
};
|
|
3063
|
-
Box =
|
|
3063
|
+
Box = React77__default.forwardRef(
|
|
3064
3064
|
({
|
|
3065
3065
|
padding,
|
|
3066
3066
|
paddingX,
|
|
@@ -3125,7 +3125,7 @@ var init_Box = __esm({
|
|
|
3125
3125
|
onPointerDown?.(e);
|
|
3126
3126
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
3127
3127
|
const isClickable = action || onClick;
|
|
3128
|
-
return
|
|
3128
|
+
return React77__default.createElement(
|
|
3129
3129
|
Component,
|
|
3130
3130
|
{
|
|
3131
3131
|
ref,
|
|
@@ -3179,7 +3179,7 @@ var init_Center = __esm({
|
|
|
3179
3179
|
as: Component = "div"
|
|
3180
3180
|
}) => {
|
|
3181
3181
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
3182
|
-
return
|
|
3182
|
+
return React77__default.createElement(Component, {
|
|
3183
3183
|
className: cn(
|
|
3184
3184
|
inline ? "inline-flex" : "flex",
|
|
3185
3185
|
horizontal && "justify-center",
|
|
@@ -3447,7 +3447,7 @@ var init_Radio = __esm({
|
|
|
3447
3447
|
md: "w-2.5 h-2.5",
|
|
3448
3448
|
lg: "w-3 h-3"
|
|
3449
3449
|
};
|
|
3450
|
-
Radio =
|
|
3450
|
+
Radio = React77__default.forwardRef(
|
|
3451
3451
|
({
|
|
3452
3452
|
label,
|
|
3453
3453
|
helperText,
|
|
@@ -3464,12 +3464,12 @@ var init_Radio = __esm({
|
|
|
3464
3464
|
onChange,
|
|
3465
3465
|
...props
|
|
3466
3466
|
}, ref) => {
|
|
3467
|
-
const reactId =
|
|
3467
|
+
const reactId = React77__default.useId();
|
|
3468
3468
|
const baseId = id || `radio-${reactId}`;
|
|
3469
3469
|
const hasError = !!error;
|
|
3470
3470
|
const eventBus = useEventBus();
|
|
3471
|
-
const [selected, setSelected] =
|
|
3472
|
-
|
|
3471
|
+
const [selected, setSelected] = React77__default.useState(value);
|
|
3472
|
+
React77__default.useEffect(() => {
|
|
3473
3473
|
if (value !== void 0) setSelected(value);
|
|
3474
3474
|
}, [value]);
|
|
3475
3475
|
const pick = (next, e) => {
|
|
@@ -3651,7 +3651,7 @@ var init_Switch = __esm({
|
|
|
3651
3651
|
"components/core/atoms/Switch.tsx"() {
|
|
3652
3652
|
"use client";
|
|
3653
3653
|
init_cn();
|
|
3654
|
-
Switch =
|
|
3654
|
+
Switch = React77.forwardRef(
|
|
3655
3655
|
({
|
|
3656
3656
|
checked,
|
|
3657
3657
|
defaultChecked = false,
|
|
@@ -3662,10 +3662,10 @@ var init_Switch = __esm({
|
|
|
3662
3662
|
name,
|
|
3663
3663
|
className
|
|
3664
3664
|
}, ref) => {
|
|
3665
|
-
const [isChecked, setIsChecked] =
|
|
3665
|
+
const [isChecked, setIsChecked] = React77.useState(
|
|
3666
3666
|
checked !== void 0 ? checked : defaultChecked
|
|
3667
3667
|
);
|
|
3668
|
-
|
|
3668
|
+
React77.useEffect(() => {
|
|
3669
3669
|
if (checked !== void 0) {
|
|
3670
3670
|
setIsChecked(checked);
|
|
3671
3671
|
}
|
|
@@ -3828,7 +3828,7 @@ var init_Stack = __esm({
|
|
|
3828
3828
|
};
|
|
3829
3829
|
const isHorizontal = direction === "horizontal";
|
|
3830
3830
|
const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
|
|
3831
|
-
return
|
|
3831
|
+
return React77__default.createElement(
|
|
3832
3832
|
Component,
|
|
3833
3833
|
{
|
|
3834
3834
|
className: cn(
|
|
@@ -4117,7 +4117,7 @@ var init_Typography = __esm({
|
|
|
4117
4117
|
if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
|
|
4118
4118
|
body = formatValue(body, format);
|
|
4119
4119
|
}
|
|
4120
|
-
return
|
|
4120
|
+
return React77__default.createElement(
|
|
4121
4121
|
Component,
|
|
4122
4122
|
{
|
|
4123
4123
|
id,
|
|
@@ -4351,7 +4351,7 @@ var Dialog;
|
|
|
4351
4351
|
var init_Dialog = __esm({
|
|
4352
4352
|
"components/core/atoms/Dialog.tsx"() {
|
|
4353
4353
|
init_cn();
|
|
4354
|
-
Dialog =
|
|
4354
|
+
Dialog = React77__default.forwardRef(
|
|
4355
4355
|
({
|
|
4356
4356
|
role = "dialog",
|
|
4357
4357
|
"aria-modal": ariaModal = true,
|
|
@@ -4377,7 +4377,7 @@ var Aside;
|
|
|
4377
4377
|
var init_Aside = __esm({
|
|
4378
4378
|
"components/core/atoms/Aside.tsx"() {
|
|
4379
4379
|
init_cn();
|
|
4380
|
-
Aside =
|
|
4380
|
+
Aside = React77__default.forwardRef(
|
|
4381
4381
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
4382
4382
|
);
|
|
4383
4383
|
Aside.displayName = "Aside";
|
|
@@ -4456,9 +4456,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4456
4456
|
className
|
|
4457
4457
|
}) => {
|
|
4458
4458
|
const { t } = useTranslate();
|
|
4459
|
-
const [isVisible, setIsVisible] =
|
|
4460
|
-
const timeoutRef =
|
|
4461
|
-
const triggerRef =
|
|
4459
|
+
const [isVisible, setIsVisible] = React77__default.useState(false);
|
|
4460
|
+
const timeoutRef = React77__default.useRef(null);
|
|
4461
|
+
const triggerRef = React77__default.useRef(null);
|
|
4462
4462
|
const handleMouseEnter = () => {
|
|
4463
4463
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4464
4464
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -4469,7 +4469,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4469
4469
|
};
|
|
4470
4470
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
4471
4471
|
const open = isVisible || revealed;
|
|
4472
|
-
|
|
4472
|
+
React77__default.useEffect(() => {
|
|
4473
4473
|
return () => {
|
|
4474
4474
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4475
4475
|
};
|
|
@@ -4679,7 +4679,7 @@ var init_StatusDot = __esm({
|
|
|
4679
4679
|
md: "w-2.5 h-2.5",
|
|
4680
4680
|
lg: "w-3 h-3"
|
|
4681
4681
|
};
|
|
4682
|
-
StatusDot =
|
|
4682
|
+
StatusDot = React77__default.forwardRef(
|
|
4683
4683
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
4684
4684
|
return /* @__PURE__ */ jsx(
|
|
4685
4685
|
"span",
|
|
@@ -4733,7 +4733,7 @@ var init_TrendIndicator = __esm({
|
|
|
4733
4733
|
down: "trending-down",
|
|
4734
4734
|
flat: "arrow-right"
|
|
4735
4735
|
};
|
|
4736
|
-
TrendIndicator =
|
|
4736
|
+
TrendIndicator = React77__default.forwardRef(
|
|
4737
4737
|
({
|
|
4738
4738
|
className,
|
|
4739
4739
|
value,
|
|
@@ -4802,7 +4802,7 @@ var init_RangeSlider = __esm({
|
|
|
4802
4802
|
md: "w-4 h-4",
|
|
4803
4803
|
lg: "w-5 h-5"
|
|
4804
4804
|
};
|
|
4805
|
-
RangeSlider =
|
|
4805
|
+
RangeSlider = React77__default.forwardRef(
|
|
4806
4806
|
({
|
|
4807
4807
|
className,
|
|
4808
4808
|
min = 0,
|
|
@@ -5413,7 +5413,7 @@ var init_ContentSection = __esm({
|
|
|
5413
5413
|
md: "py-16",
|
|
5414
5414
|
lg: "py-24"
|
|
5415
5415
|
};
|
|
5416
|
-
ContentSection =
|
|
5416
|
+
ContentSection = React77__default.forwardRef(
|
|
5417
5417
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
5418
5418
|
return /* @__PURE__ */ jsx(
|
|
5419
5419
|
Box,
|
|
@@ -5947,7 +5947,7 @@ var init_AnimatedReveal = __esm({
|
|
|
5947
5947
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
5948
5948
|
"none": {}
|
|
5949
5949
|
};
|
|
5950
|
-
AnimatedReveal =
|
|
5950
|
+
AnimatedReveal = React77__default.forwardRef(
|
|
5951
5951
|
({
|
|
5952
5952
|
trigger = "scroll",
|
|
5953
5953
|
animation = "fade-up",
|
|
@@ -6107,7 +6107,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6107
6107
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6108
6108
|
"use client";
|
|
6109
6109
|
init_cn();
|
|
6110
|
-
AnimatedGraphic =
|
|
6110
|
+
AnimatedGraphic = React77__default.forwardRef(
|
|
6111
6111
|
({
|
|
6112
6112
|
src,
|
|
6113
6113
|
svgContent,
|
|
@@ -6130,7 +6130,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6130
6130
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6131
6131
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6132
6132
|
const prevAnimateRef = useRef(animate);
|
|
6133
|
-
const setRef =
|
|
6133
|
+
const setRef = React77__default.useCallback(
|
|
6134
6134
|
(node) => {
|
|
6135
6135
|
containerRef.current = node;
|
|
6136
6136
|
if (typeof ref === "function") ref(node);
|
|
@@ -6231,7 +6231,7 @@ function resolveMarkerExpression(expression, entity, config, state) {
|
|
|
6231
6231
|
function isPlainObject(value) {
|
|
6232
6232
|
if (value === null || value === void 0 || typeof value !== "object") return false;
|
|
6233
6233
|
if (Array.isArray(value)) return false;
|
|
6234
|
-
if (
|
|
6234
|
+
if (React77__default.isValidElement(value)) return false;
|
|
6235
6235
|
if (value instanceof Date) return false;
|
|
6236
6236
|
if (typeof value === "function") return false;
|
|
6237
6237
|
return true;
|
|
@@ -6875,7 +6875,7 @@ var init_ErrorBoundary = __esm({
|
|
|
6875
6875
|
}
|
|
6876
6876
|
);
|
|
6877
6877
|
};
|
|
6878
|
-
ErrorBoundary = class extends
|
|
6878
|
+
ErrorBoundary = class extends React77__default.Component {
|
|
6879
6879
|
constructor(props) {
|
|
6880
6880
|
super(props);
|
|
6881
6881
|
__publicField(this, "reset", () => {
|
|
@@ -7158,7 +7158,7 @@ var init_Container = __esm({
|
|
|
7158
7158
|
as: Component = "div"
|
|
7159
7159
|
}) => {
|
|
7160
7160
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
7161
|
-
return
|
|
7161
|
+
return React77__default.createElement(
|
|
7162
7162
|
Component,
|
|
7163
7163
|
{
|
|
7164
7164
|
className: cn(
|
|
@@ -10522,7 +10522,7 @@ var init_CodeBlock = __esm({
|
|
|
10522
10522
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
10523
10523
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
10524
10524
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
10525
|
-
CodeBlock =
|
|
10525
|
+
CodeBlock = React77__default.memo(
|
|
10526
10526
|
({
|
|
10527
10527
|
code: rawCode,
|
|
10528
10528
|
language = "text",
|
|
@@ -11110,7 +11110,7 @@ var init_MarkdownContent = __esm({
|
|
|
11110
11110
|
init_Box();
|
|
11111
11111
|
init_CodeBlock();
|
|
11112
11112
|
init_cn();
|
|
11113
|
-
MarkdownContent =
|
|
11113
|
+
MarkdownContent = React77__default.memo(
|
|
11114
11114
|
({ content, direction = "ltr", className }) => {
|
|
11115
11115
|
const { t: _t } = useTranslate();
|
|
11116
11116
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -12437,7 +12437,7 @@ var init_StateMachineView = __esm({
|
|
|
12437
12437
|
style: { top: title ? 30 : 0 },
|
|
12438
12438
|
children: [
|
|
12439
12439
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
12440
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
12440
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React77__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
12441
12441
|
StateNode,
|
|
12442
12442
|
{
|
|
12443
12443
|
state,
|
|
@@ -15002,6 +15002,12 @@ var init_CalendarGrid = __esm({
|
|
|
15002
15002
|
CalendarGrid.displayName = "CalendarGrid";
|
|
15003
15003
|
}
|
|
15004
15004
|
});
|
|
15005
|
+
var DrawableRegistryContext;
|
|
15006
|
+
var init_registry = __esm({
|
|
15007
|
+
"lib/drawable/registry.ts"() {
|
|
15008
|
+
DrawableRegistryContext = createContext(null);
|
|
15009
|
+
}
|
|
15010
|
+
});
|
|
15005
15011
|
function MiniMap({
|
|
15006
15012
|
tiles = DEFAULT_TILES,
|
|
15007
15013
|
units = DEFAULT_UNITS,
|
|
@@ -15014,8 +15020,8 @@ function MiniMap({
|
|
|
15014
15020
|
tileAssets,
|
|
15015
15021
|
unitAssets
|
|
15016
15022
|
}) {
|
|
15017
|
-
const canvasRef =
|
|
15018
|
-
const imgCacheRef =
|
|
15023
|
+
const canvasRef = React77.useRef(null);
|
|
15024
|
+
const imgCacheRef = React77.useRef(/* @__PURE__ */ new Map());
|
|
15019
15025
|
function loadImg(url) {
|
|
15020
15026
|
const cached = imgCacheRef.current.get(url);
|
|
15021
15027
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -15031,7 +15037,7 @@ function MiniMap({
|
|
|
15031
15037
|
imgCacheRef.current.set(url, img);
|
|
15032
15038
|
return null;
|
|
15033
15039
|
}
|
|
15034
|
-
|
|
15040
|
+
React77.useEffect(() => {
|
|
15035
15041
|
const canvas = canvasRef.current;
|
|
15036
15042
|
if (!canvas) return;
|
|
15037
15043
|
const ctx = canvas.getContext("2d");
|
|
@@ -15622,9 +15628,26 @@ var init_imageCache = __esm({
|
|
|
15622
15628
|
});
|
|
15623
15629
|
|
|
15624
15630
|
// lib/webPainter2d.ts
|
|
15631
|
+
function makeNoiseTile(alpha, color) {
|
|
15632
|
+
const tile = document.createElement("canvas");
|
|
15633
|
+
tile.width = NOISE_CELLS;
|
|
15634
|
+
tile.height = NOISE_CELLS;
|
|
15635
|
+
const t = tile.getContext("2d");
|
|
15636
|
+
if (t) {
|
|
15637
|
+
t.fillStyle = color;
|
|
15638
|
+
for (let y = 0; y < NOISE_CELLS; y++) {
|
|
15639
|
+
for (let x = 0; x < NOISE_CELLS; x++) {
|
|
15640
|
+
t.globalAlpha = noiseHash(x, y) * alpha;
|
|
15641
|
+
t.fillRect(x, y, 1, 1);
|
|
15642
|
+
}
|
|
15643
|
+
}
|
|
15644
|
+
}
|
|
15645
|
+
return tile;
|
|
15646
|
+
}
|
|
15625
15647
|
function createWebPainter(ctx, onAssetLoad) {
|
|
15626
15648
|
let vw = 0;
|
|
15627
15649
|
let vh = 0;
|
|
15650
|
+
const patternCache = /* @__PURE__ */ new Map();
|
|
15628
15651
|
const tracePoly = (points, closed) => {
|
|
15629
15652
|
if (points.length === 0) return;
|
|
15630
15653
|
ctx.beginPath();
|
|
@@ -15632,9 +15655,28 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
15632
15655
|
for (let i = 1; i < points.length; i++) ctx.lineTo(points[i].x, points[i].y);
|
|
15633
15656
|
if (closed) ctx.closePath();
|
|
15634
15657
|
};
|
|
15658
|
+
const toCanvasPattern = (style) => {
|
|
15659
|
+
const key = JSON.stringify(style);
|
|
15660
|
+
let pattern = patternCache.get(key);
|
|
15661
|
+
if (pattern === void 0) {
|
|
15662
|
+
if (style.kind === "noise") {
|
|
15663
|
+
pattern = ctx.createPattern(makeNoiseTile(style.alpha ?? 0.12, style.color ?? "#000000"), "repeat");
|
|
15664
|
+
} else {
|
|
15665
|
+
const img = getOrLoadImage(style.url, onAssetLoad);
|
|
15666
|
+
if (!img) return "rgba(0,0,0,0)";
|
|
15667
|
+
pattern = ctx.createPattern(img, "repeat");
|
|
15668
|
+
}
|
|
15669
|
+
if (pattern && style.scale !== void 0 && style.scale !== 1) {
|
|
15670
|
+
pattern.setTransform(new DOMMatrix().scale(style.scale));
|
|
15671
|
+
}
|
|
15672
|
+
patternCache.set(key, pattern);
|
|
15673
|
+
}
|
|
15674
|
+
return pattern ?? "rgba(0,0,0,0)";
|
|
15675
|
+
};
|
|
15635
15676
|
const toCanvasStyle = (style) => {
|
|
15636
15677
|
if (typeof style === "string") return style;
|
|
15637
|
-
|
|
15678
|
+
if (style.kind === "noise" || style.kind === "image") return toCanvasPattern(style);
|
|
15679
|
+
const g = style.kind === "linear" ? ctx.createLinearGradient(style.x1, style.y1, style.x2, style.y2) : style.kind === "conic" ? ctx.createConicGradient(style.angle, style.cx, style.cy) : ctx.createRadialGradient(style.cx, style.cy, 0, style.cx, style.cy, style.r);
|
|
15638
15680
|
for (const stop of style.stops) g.addColorStop(stop.offset, stop.color);
|
|
15639
15681
|
return g;
|
|
15640
15682
|
};
|
|
@@ -15669,6 +15711,19 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
15669
15711
|
ctx.shadowColor = shadow ? shadow.color : "transparent";
|
|
15670
15712
|
ctx.shadowBlur = shadow ? shadow.blur : 0;
|
|
15671
15713
|
},
|
|
15714
|
+
setBlend(mode) {
|
|
15715
|
+
ctx.globalCompositeOperation = mode ?? "source-over";
|
|
15716
|
+
},
|
|
15717
|
+
setLineDash(pattern, offset = 0) {
|
|
15718
|
+
ctx.setLineDash(pattern ? [...pattern] : []);
|
|
15719
|
+
ctx.lineDashOffset = offset;
|
|
15720
|
+
},
|
|
15721
|
+
setBlur(px) {
|
|
15722
|
+
ctx.filter = px && px > 0 ? `blur(${px}px)` : "none";
|
|
15723
|
+
},
|
|
15724
|
+
clipPath(d) {
|
|
15725
|
+
ctx.clip(new Path2D(d));
|
|
15726
|
+
},
|
|
15672
15727
|
resolveTexture(url) {
|
|
15673
15728
|
const img = getOrLoadImage(url, onAssetLoad);
|
|
15674
15729
|
if (!img) return null;
|
|
@@ -15744,13 +15799,18 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
15744
15799
|
}
|
|
15745
15800
|
};
|
|
15746
15801
|
}
|
|
15747
|
-
var handleByImage, imageByHandle;
|
|
15802
|
+
var handleByImage, imageByHandle, noiseHash, NOISE_CELLS;
|
|
15748
15803
|
var init_webPainter2d = __esm({
|
|
15749
15804
|
"lib/webPainter2d.ts"() {
|
|
15750
15805
|
"use client";
|
|
15751
15806
|
init_imageCache();
|
|
15752
15807
|
handleByImage = /* @__PURE__ */ new WeakMap();
|
|
15753
15808
|
imageByHandle = /* @__PURE__ */ new WeakMap();
|
|
15809
|
+
noiseHash = (x, y) => {
|
|
15810
|
+
const s = Math.sin(x * 12.9898 + y * 78.233) * 43758.5453;
|
|
15811
|
+
return s - Math.floor(s);
|
|
15812
|
+
};
|
|
15813
|
+
NOISE_CELLS = 32;
|
|
15754
15814
|
}
|
|
15755
15815
|
});
|
|
15756
15816
|
|
|
@@ -15962,12 +16022,6 @@ var init_DrawSprite = __esm({
|
|
|
15962
16022
|
};
|
|
15963
16023
|
}
|
|
15964
16024
|
});
|
|
15965
|
-
var DrawableRegistryContext;
|
|
15966
|
-
var init_registry = __esm({
|
|
15967
|
-
"lib/drawable/registry.ts"() {
|
|
15968
|
-
DrawableRegistryContext = createContext(null);
|
|
15969
|
-
}
|
|
15970
|
-
});
|
|
15971
16025
|
function isAnimatedShape(node) {
|
|
15972
16026
|
return Boolean(node.animation && node.animation.durationMs > 0 && node.animation.keyframes.length > 0);
|
|
15973
16027
|
}
|
|
@@ -16037,6 +16091,16 @@ function gradientStyle(g, ox, oy, scale) {
|
|
|
16037
16091
|
stops: g.stops
|
|
16038
16092
|
};
|
|
16039
16093
|
}
|
|
16094
|
+
if (g.kind === "conic") {
|
|
16095
|
+
if (!g.center) return void 0;
|
|
16096
|
+
return {
|
|
16097
|
+
kind: "conic",
|
|
16098
|
+
cx: ox + g.center.x * scale,
|
|
16099
|
+
cy: oy + g.center.y * scale,
|
|
16100
|
+
angle: g.angle ?? 0,
|
|
16101
|
+
stops: g.stops
|
|
16102
|
+
};
|
|
16103
|
+
}
|
|
16040
16104
|
if (!g.center || g.radius === void 0) return void 0;
|
|
16041
16105
|
return {
|
|
16042
16106
|
kind: "radial",
|
|
@@ -16046,6 +16110,13 @@ function gradientStyle(g, ox, oy, scale) {
|
|
|
16046
16110
|
stops: g.stops
|
|
16047
16111
|
};
|
|
16048
16112
|
}
|
|
16113
|
+
function patternStyle(p, unit) {
|
|
16114
|
+
if (p.kind === "image") {
|
|
16115
|
+
if (!p.url) return void 0;
|
|
16116
|
+
return { kind: "image", url: p.url, scale: (p.scale ?? 1) / unit };
|
|
16117
|
+
}
|
|
16118
|
+
return { kind: "noise", scale: (p.scale ?? 2) / unit, alpha: p.alpha, color: p.color };
|
|
16119
|
+
}
|
|
16049
16120
|
function DrawShape(props) {
|
|
16050
16121
|
const register = useContext(DrawableRegistryContext);
|
|
16051
16122
|
if (register) {
|
|
@@ -16074,7 +16145,9 @@ var init_DrawShape = __esm({
|
|
|
16074
16145
|
"radiusY",
|
|
16075
16146
|
"width",
|
|
16076
16147
|
"height",
|
|
16077
|
-
"strokeWidth"
|
|
16148
|
+
"strokeWidth",
|
|
16149
|
+
"strokeDashOffset",
|
|
16150
|
+
"blur"
|
|
16078
16151
|
];
|
|
16079
16152
|
lerp = (a, b, k) => a + (b - a) * k;
|
|
16080
16153
|
paintShape = (painter, rawNode, dctx) => {
|
|
@@ -16084,6 +16157,16 @@ var init_DrawShape = __esm({
|
|
|
16084
16157
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
16085
16158
|
const origin = dctx.projector.project(node.position);
|
|
16086
16159
|
const tileWidth = dctx.projector.tileWidth;
|
|
16160
|
+
const groupScale = dctx.groupScale ?? 1;
|
|
16161
|
+
const strokePx = (node.strokeWidth ?? 1) / groupScale;
|
|
16162
|
+
if (node.blendMode) painter.setBlend(node.blendMode);
|
|
16163
|
+
if (node.strokeDash && node.strokeDash.length > 0) {
|
|
16164
|
+
painter.setLineDash(
|
|
16165
|
+
node.strokeDash.map((v) => v / groupScale),
|
|
16166
|
+
(node.strokeDashOffset ?? 0) / groupScale
|
|
16167
|
+
);
|
|
16168
|
+
}
|
|
16169
|
+
if (node.blur !== void 0 && node.blur > 0) painter.setBlur(node.blur / groupScale);
|
|
16087
16170
|
if (node.rotate) {
|
|
16088
16171
|
const pivot = node.pivot ?? { x: 0.5, y: 0.5 };
|
|
16089
16172
|
const px = origin.x + pivot.x * tileWidth;
|
|
@@ -16092,15 +16175,18 @@ var init_DrawShape = __esm({
|
|
|
16092
16175
|
painter.rotate(node.rotate);
|
|
16093
16176
|
painter.translate(-px, -py);
|
|
16094
16177
|
}
|
|
16095
|
-
if (node.shadow) painter.setShadow({ color: node.shadow.color, blur: node.shadow.blur * tileWidth });
|
|
16178
|
+
if (node.shadow) painter.setShadow({ color: node.shadow.color, blur: node.shadow.blur * tileWidth * groupScale });
|
|
16096
16179
|
const fill = node.fill === "none" ? void 0 : node.fill;
|
|
16097
16180
|
const stroke = node.stroke === "none" ? void 0 : node.stroke;
|
|
16098
16181
|
const pxFill = node.gradient ? gradientStyle(node.gradient, origin.x, origin.y, tileWidth) ?? fill : fill;
|
|
16182
|
+
const pxStroke = node.strokeGradient ? gradientStyle(node.strokeGradient, origin.x, origin.y, tileWidth) ?? stroke : stroke;
|
|
16183
|
+
const patFill = node.fillPattern ? patternStyle(node.fillPattern, groupScale) : void 0;
|
|
16099
16184
|
switch (node.shape) {
|
|
16100
16185
|
case "cell": {
|
|
16101
16186
|
const pts = dctx.projector.cellPath(node.position);
|
|
16102
16187
|
if (pxFill) painter.fillPoly(pts, pxFill);
|
|
16103
|
-
if (
|
|
16188
|
+
if (patFill) painter.fillPoly(pts, patFill);
|
|
16189
|
+
if (pxStroke) painter.strokePoly(pts, pxStroke, strokePx, true);
|
|
16104
16190
|
break;
|
|
16105
16191
|
}
|
|
16106
16192
|
case "rect": {
|
|
@@ -16111,7 +16197,8 @@ var init_DrawShape = __esm({
|
|
|
16111
16197
|
const w = (node.width ?? 0) * tw;
|
|
16112
16198
|
const h = (node.height ?? 0) * tw;
|
|
16113
16199
|
if (pxFill) painter.fillRect(x, y, w, h, pxFill);
|
|
16114
|
-
if (
|
|
16200
|
+
if (patFill) painter.fillRect(x, y, w, h, patFill);
|
|
16201
|
+
if (pxStroke) painter.strokeRect(x, y, w, h, pxStroke, strokePx);
|
|
16115
16202
|
break;
|
|
16116
16203
|
}
|
|
16117
16204
|
case "ellipse": {
|
|
@@ -16122,7 +16209,8 @@ var init_DrawShape = __esm({
|
|
|
16122
16209
|
const rx = (node.radiusX ?? 0) * tw;
|
|
16123
16210
|
const ry = (node.radiusY ?? rx) * tw;
|
|
16124
16211
|
if (pxFill) painter.fillEllipse(cx, cy, rx, ry, pxFill);
|
|
16125
|
-
if (
|
|
16212
|
+
if (patFill) painter.fillEllipse(cx, cy, rx, ry, patFill);
|
|
16213
|
+
if (pxStroke) painter.strokeEllipse(cx, cy, rx, ry, pxStroke, strokePx);
|
|
16126
16214
|
break;
|
|
16127
16215
|
}
|
|
16128
16216
|
case "poly": {
|
|
@@ -16131,16 +16219,27 @@ var init_DrawShape = __esm({
|
|
|
16131
16219
|
y: origin.y + ((node.offsetY ?? 0) + pt.y) * tileWidth
|
|
16132
16220
|
}));
|
|
16133
16221
|
if (pxFill) painter.fillPoly(pts, pxFill);
|
|
16134
|
-
if (
|
|
16222
|
+
if (patFill) painter.fillPoly(pts, patFill);
|
|
16223
|
+
if (pxStroke) painter.strokePoly(pts, pxStroke, strokePx, true);
|
|
16135
16224
|
break;
|
|
16136
16225
|
}
|
|
16137
16226
|
case "path": {
|
|
16138
16227
|
if (!node.d) break;
|
|
16139
16228
|
painter.translate(origin.x + (node.offsetX ?? 0) * tileWidth, origin.y + (node.offsetY ?? 0) * tileWidth);
|
|
16140
16229
|
painter.scale(tileWidth, tileWidth);
|
|
16230
|
+
if (node.strokeDash && node.strokeDash.length > 0) {
|
|
16231
|
+
painter.setLineDash(
|
|
16232
|
+
node.strokeDash.map((v) => v / (groupScale * tileWidth)),
|
|
16233
|
+
(node.strokeDashOffset ?? 0) / (groupScale * tileWidth)
|
|
16234
|
+
);
|
|
16235
|
+
}
|
|
16236
|
+
if (node.blur !== void 0 && node.blur > 0) painter.setBlur(node.blur / (groupScale * tileWidth));
|
|
16141
16237
|
const localFill = node.gradient ? gradientStyle(node.gradient, 0, 0, 1) ?? fill : fill;
|
|
16238
|
+
const localStroke = node.strokeGradient ? gradientStyle(node.strokeGradient, 0, 0, 1) ?? stroke : stroke;
|
|
16239
|
+
const localPat = node.fillPattern ? patternStyle(node.fillPattern, groupScale * tileWidth) : void 0;
|
|
16142
16240
|
if (localFill) painter.fillPath(node.d, localFill);
|
|
16143
|
-
if (
|
|
16241
|
+
if (localPat) painter.fillPath(node.d, localPat);
|
|
16242
|
+
if (localStroke) painter.strokePath(node.d, localStroke, strokePx / tileWidth);
|
|
16144
16243
|
break;
|
|
16145
16244
|
}
|
|
16146
16245
|
}
|
|
@@ -16221,8 +16320,6 @@ var init_DrawTextLayer = __esm({
|
|
|
16221
16320
|
};
|
|
16222
16321
|
}
|
|
16223
16322
|
});
|
|
16224
|
-
|
|
16225
|
-
// lib/drawable/paintDispatch.ts
|
|
16226
16323
|
function paintDrawable(painter, node, dctx) {
|
|
16227
16324
|
switch (node.type) {
|
|
16228
16325
|
case "draw-sprite":
|
|
@@ -16243,10 +16340,20 @@ function paintDrawable(painter, node, dctx) {
|
|
|
16243
16340
|
if (node.scale !== void 0) painter.scale(node.scale, node.scale);
|
|
16244
16341
|
if (node.rotate !== void 0) painter.rotate(node.rotate);
|
|
16245
16342
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
16246
|
-
|
|
16343
|
+
if (node.clip) {
|
|
16344
|
+
const tw = dctx.projector.tileWidth;
|
|
16345
|
+
painter.scale(tw, tw);
|
|
16346
|
+
painter.clipPath(node.clip);
|
|
16347
|
+
painter.scale(1 / tw, 1 / tw);
|
|
16348
|
+
}
|
|
16349
|
+
const childCtx = node.scale !== void 0 && node.scale !== 1 ? { ...dctx, groupScale: (dctx.groupScale ?? 1) * node.scale } : dctx;
|
|
16350
|
+
for (const item of node.items) paintDrawable(painter, item, childCtx);
|
|
16247
16351
|
painter.restore();
|
|
16248
16352
|
break;
|
|
16249
16353
|
}
|
|
16354
|
+
case "draw-mesh":
|
|
16355
|
+
warnUnsupported2d("draw-mesh");
|
|
16356
|
+
break;
|
|
16250
16357
|
case "draw-sprite-layer":
|
|
16251
16358
|
paintSpriteLayer(painter, node, dctx);
|
|
16252
16359
|
break;
|
|
@@ -16258,6 +16365,7 @@ function paintDrawable(painter, node, dctx) {
|
|
|
16258
16365
|
break;
|
|
16259
16366
|
}
|
|
16260
16367
|
}
|
|
16368
|
+
var paint2dLog, warnedUnsupported2d, warnUnsupported2d;
|
|
16261
16369
|
var init_paintDispatch = __esm({
|
|
16262
16370
|
"lib/drawable/paintDispatch.ts"() {
|
|
16263
16371
|
init_contract();
|
|
@@ -16267,6 +16375,13 @@ var init_paintDispatch = __esm({
|
|
|
16267
16375
|
init_DrawSpriteLayer();
|
|
16268
16376
|
init_DrawShapeLayer();
|
|
16269
16377
|
init_DrawTextLayer();
|
|
16378
|
+
paint2dLog = createLogger("almadar:ui:drawable-2d");
|
|
16379
|
+
warnedUnsupported2d = /* @__PURE__ */ new Set();
|
|
16380
|
+
warnUnsupported2d = (kind) => {
|
|
16381
|
+
if (warnedUnsupported2d.has(kind)) return;
|
|
16382
|
+
warnedUnsupported2d.add(kind);
|
|
16383
|
+
paint2dLog.warn("unsupported drawable kind on the 2D painter \u2014 skipped", { kind });
|
|
16384
|
+
};
|
|
16270
16385
|
}
|
|
16271
16386
|
});
|
|
16272
16387
|
|
|
@@ -16281,6 +16396,7 @@ function collectDrawnItems(nodes) {
|
|
|
16281
16396
|
case "draw-shape":
|
|
16282
16397
|
case "draw-text":
|
|
16283
16398
|
case "draw-group":
|
|
16399
|
+
case "draw-mesh":
|
|
16284
16400
|
if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id });
|
|
16285
16401
|
break;
|
|
16286
16402
|
case "draw-sprite-layer":
|
|
@@ -16351,7 +16467,7 @@ function Canvas2D({
|
|
|
16351
16467
|
const registerChildDrawable = useCallback((node) => {
|
|
16352
16468
|
childDrawablesRef.current.push(node);
|
|
16353
16469
|
}, []);
|
|
16354
|
-
const hasJsxChildren =
|
|
16470
|
+
const hasJsxChildren = React77.Children.count(children) > 0;
|
|
16355
16471
|
function isDrawableLayer(node) {
|
|
16356
16472
|
return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
|
|
16357
16473
|
}
|
|
@@ -16880,6 +16996,8 @@ function Canvas({
|
|
|
16880
16996
|
showCoordinates,
|
|
16881
16997
|
showTileInfo,
|
|
16882
16998
|
fogOfWar,
|
|
16999
|
+
lighting,
|
|
17000
|
+
post,
|
|
16883
17001
|
tileClickEvent,
|
|
16884
17002
|
unitClickEvent,
|
|
16885
17003
|
tileHoverEvent,
|
|
@@ -16891,13 +17009,29 @@ function Canvas({
|
|
|
16891
17009
|
}) {
|
|
16892
17010
|
canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
|
|
16893
17011
|
const zoom = camera?.zoom;
|
|
17012
|
+
const childDrawablesRef = useRef([]);
|
|
17013
|
+
if (mode === "3d") childDrawablesRef.current = [];
|
|
17014
|
+
const registerChildDrawable = useCallback((node) => {
|
|
17015
|
+
childDrawablesRef.current.push(node);
|
|
17016
|
+
}, []);
|
|
17017
|
+
const [childDrawables, setChildDrawables] = useState([]);
|
|
17018
|
+
useEffect(() => {
|
|
17019
|
+
if (mode !== "3d") return;
|
|
17020
|
+
const next = childDrawablesRef.current;
|
|
17021
|
+
canvasLog.debug("children:adopt", { registered: next.length, adopted: childDrawables.length });
|
|
17022
|
+
if (next.length === 0 && React77.Children.count(children) > 0) return;
|
|
17023
|
+
setChildDrawables(
|
|
17024
|
+
(prev) => prev.length === next.length && JSON.stringify(prev) === JSON.stringify(next) ? prev : [...next]
|
|
17025
|
+
);
|
|
17026
|
+
});
|
|
16894
17027
|
if (mode === "3d") {
|
|
16895
17028
|
const props3d = {
|
|
16896
17029
|
className,
|
|
16897
|
-
drawables,
|
|
17030
|
+
drawables: [...drawables ?? [], ...childDrawables],
|
|
16898
17031
|
isLoading,
|
|
16899
17032
|
cameraMode: to3DCameraMode(camera?.mode),
|
|
16900
17033
|
...zoom !== void 0 ? { scale: zoom } : {},
|
|
17034
|
+
...camera?.fov !== void 0 ? { fov: camera.fov } : {},
|
|
16901
17035
|
...camera?.target !== void 0 ? { followTarget: camera.target } : {},
|
|
16902
17036
|
unitScale,
|
|
16903
17037
|
backgroundColor,
|
|
@@ -16909,6 +17043,8 @@ function Canvas({
|
|
|
16909
17043
|
showCoordinates,
|
|
16910
17044
|
showTileInfo,
|
|
16911
17045
|
fogOfWar,
|
|
17046
|
+
lighting,
|
|
17047
|
+
post,
|
|
16912
17048
|
tileClickEvent,
|
|
16913
17049
|
unitClickEvent,
|
|
16914
17050
|
tileHoverEvent,
|
|
@@ -16917,7 +17053,10 @@ function Canvas({
|
|
|
16917
17053
|
keyMap,
|
|
16918
17054
|
keyUpMap
|
|
16919
17055
|
};
|
|
16920
|
-
return /* @__PURE__ */
|
|
17056
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17057
|
+
/* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Canvas3DHost, { ...props3d }) }),
|
|
17058
|
+
React77.Children.count(children) > 0 && /* @__PURE__ */ jsx(DrawableRegistryContext.Provider, { value: registerChildDrawable, children: /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children }) })
|
|
17059
|
+
] });
|
|
16921
17060
|
}
|
|
16922
17061
|
return /* @__PURE__ */ jsx(
|
|
16923
17062
|
Canvas2D,
|
|
@@ -16949,6 +17088,7 @@ var Canvas3DHost, canvasLog;
|
|
|
16949
17088
|
var init_Canvas = __esm({
|
|
16950
17089
|
"components/game/molecules/Canvas.tsx"() {
|
|
16951
17090
|
"use client";
|
|
17091
|
+
init_registry();
|
|
16952
17092
|
init_Canvas2D();
|
|
16953
17093
|
Canvas3DHost = lazy(
|
|
16954
17094
|
() => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.Canvas3DHost }))
|
|
@@ -19224,9 +19364,9 @@ function ControlButton({
|
|
|
19224
19364
|
className
|
|
19225
19365
|
}) {
|
|
19226
19366
|
const eventBus = useEventBus();
|
|
19227
|
-
const [isPressed, setIsPressed] =
|
|
19367
|
+
const [isPressed, setIsPressed] = React77.useState(false);
|
|
19228
19368
|
const actualPressed = pressed ?? isPressed;
|
|
19229
|
-
const handlePointerDown =
|
|
19369
|
+
const handlePointerDown = React77.useCallback(
|
|
19230
19370
|
(e) => {
|
|
19231
19371
|
e.preventDefault();
|
|
19232
19372
|
if (disabled) return;
|
|
@@ -19236,7 +19376,7 @@ function ControlButton({
|
|
|
19236
19376
|
},
|
|
19237
19377
|
[disabled, pressEvent, eventBus, onPress]
|
|
19238
19378
|
);
|
|
19239
|
-
const handlePointerUp =
|
|
19379
|
+
const handlePointerUp = React77.useCallback(
|
|
19240
19380
|
(e) => {
|
|
19241
19381
|
e.preventDefault();
|
|
19242
19382
|
if (disabled) return;
|
|
@@ -19246,7 +19386,7 @@ function ControlButton({
|
|
|
19246
19386
|
},
|
|
19247
19387
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
19248
19388
|
);
|
|
19249
|
-
const handlePointerLeave =
|
|
19389
|
+
const handlePointerLeave = React77.useCallback(
|
|
19250
19390
|
(e) => {
|
|
19251
19391
|
if (isPressed) {
|
|
19252
19392
|
setIsPressed(false);
|
|
@@ -19334,8 +19474,8 @@ function ControlGrid({
|
|
|
19334
19474
|
className
|
|
19335
19475
|
}) {
|
|
19336
19476
|
const eventBus = useEventBus();
|
|
19337
|
-
const [active, setActive] =
|
|
19338
|
-
const handlePress =
|
|
19477
|
+
const [active, setActive] = React77.useState(/* @__PURE__ */ new Set());
|
|
19478
|
+
const handlePress = React77.useCallback(
|
|
19339
19479
|
(id) => {
|
|
19340
19480
|
setActive((prev) => new Set(prev).add(id));
|
|
19341
19481
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -19349,7 +19489,7 @@ function ControlGrid({
|
|
|
19349
19489
|
},
|
|
19350
19490
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
19351
19491
|
);
|
|
19352
|
-
const handleRelease =
|
|
19492
|
+
const handleRelease = React77.useCallback(
|
|
19353
19493
|
(id) => {
|
|
19354
19494
|
setActive((prev) => {
|
|
19355
19495
|
const next = new Set(prev);
|
|
@@ -20587,8 +20727,8 @@ var init_Menu = __esm({
|
|
|
20587
20727
|
"bottom-end": "bottom-start"
|
|
20588
20728
|
};
|
|
20589
20729
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
20590
|
-
const triggerChild =
|
|
20591
|
-
const triggerElement =
|
|
20730
|
+
const triggerChild = React77__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
20731
|
+
const triggerElement = React77__default.cloneElement(
|
|
20592
20732
|
triggerChild,
|
|
20593
20733
|
{
|
|
20594
20734
|
ref: triggerRef,
|
|
@@ -20683,14 +20823,14 @@ function useDataDnd(args) {
|
|
|
20683
20823
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
20684
20824
|
const enabled = isZone || Boolean(dndRoot);
|
|
20685
20825
|
const eventBus = useEventBus();
|
|
20686
|
-
const parentRoot =
|
|
20826
|
+
const parentRoot = React77__default.useContext(RootCtx);
|
|
20687
20827
|
const isRoot = enabled && parentRoot === null;
|
|
20688
|
-
const zoneId =
|
|
20828
|
+
const zoneId = React77__default.useId();
|
|
20689
20829
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
20690
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
20691
|
-
const optimisticOrdersRef =
|
|
20830
|
+
const [optimisticOrders, setOptimisticOrders] = React77__default.useState(() => /* @__PURE__ */ new Map());
|
|
20831
|
+
const optimisticOrdersRef = React77__default.useRef(optimisticOrders);
|
|
20692
20832
|
optimisticOrdersRef.current = optimisticOrders;
|
|
20693
|
-
const clearOptimisticOrder =
|
|
20833
|
+
const clearOptimisticOrder = React77__default.useCallback((group) => {
|
|
20694
20834
|
setOptimisticOrders((prev) => {
|
|
20695
20835
|
if (!prev.has(group)) return prev;
|
|
20696
20836
|
const next = new Map(prev);
|
|
@@ -20715,7 +20855,7 @@ function useDataDnd(args) {
|
|
|
20715
20855
|
const raw = it[dndItemIdField];
|
|
20716
20856
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
20717
20857
|
}).join("|");
|
|
20718
|
-
const itemIds =
|
|
20858
|
+
const itemIds = React77__default.useMemo(
|
|
20719
20859
|
() => orderedItems.map((it, idx) => {
|
|
20720
20860
|
const raw = it[dndItemIdField];
|
|
20721
20861
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -20726,7 +20866,7 @@ function useDataDnd(args) {
|
|
|
20726
20866
|
const raw = it[dndItemIdField];
|
|
20727
20867
|
return raw != null ? String(raw) : `__${idx}`;
|
|
20728
20868
|
}).join("|");
|
|
20729
|
-
|
|
20869
|
+
React77__default.useEffect(() => {
|
|
20730
20870
|
const root = isRoot ? null : parentRoot;
|
|
20731
20871
|
if (root) {
|
|
20732
20872
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -20734,20 +20874,20 @@ function useDataDnd(args) {
|
|
|
20734
20874
|
clearOptimisticOrder(ownGroup);
|
|
20735
20875
|
}
|
|
20736
20876
|
}, [itemsContentSig, ownGroup]);
|
|
20737
|
-
const zonesRef =
|
|
20738
|
-
const registerZone =
|
|
20877
|
+
const zonesRef = React77__default.useRef(/* @__PURE__ */ new Map());
|
|
20878
|
+
const registerZone = React77__default.useCallback((zoneId2, meta2) => {
|
|
20739
20879
|
zonesRef.current.set(zoneId2, meta2);
|
|
20740
20880
|
}, []);
|
|
20741
|
-
const unregisterZone =
|
|
20881
|
+
const unregisterZone = React77__default.useCallback((zoneId2) => {
|
|
20742
20882
|
zonesRef.current.delete(zoneId2);
|
|
20743
20883
|
}, []);
|
|
20744
|
-
const [activeDrag, setActiveDrag] =
|
|
20745
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
20746
|
-
const meta =
|
|
20884
|
+
const [activeDrag, setActiveDrag] = React77__default.useState(null);
|
|
20885
|
+
const [overZoneGroup, setOverZoneGroup] = React77__default.useState(null);
|
|
20886
|
+
const meta = React77__default.useMemo(
|
|
20747
20887
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
20748
20888
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
20749
20889
|
);
|
|
20750
|
-
|
|
20890
|
+
React77__default.useEffect(() => {
|
|
20751
20891
|
const target = isRoot ? null : parentRoot;
|
|
20752
20892
|
if (!target) {
|
|
20753
20893
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -20766,7 +20906,7 @@ function useDataDnd(args) {
|
|
|
20766
20906
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
20767
20907
|
const sensors = useAlmadarDndSensors(true);
|
|
20768
20908
|
const collisionDetection = almadarDndCollisionDetection;
|
|
20769
|
-
const findZoneByItem =
|
|
20909
|
+
const findZoneByItem = React77__default.useCallback(
|
|
20770
20910
|
(id) => {
|
|
20771
20911
|
for (const z of zonesRef.current.values()) {
|
|
20772
20912
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -20775,7 +20915,7 @@ function useDataDnd(args) {
|
|
|
20775
20915
|
},
|
|
20776
20916
|
[]
|
|
20777
20917
|
);
|
|
20778
|
-
|
|
20918
|
+
React77__default.useCallback(
|
|
20779
20919
|
(group) => {
|
|
20780
20920
|
for (const z of zonesRef.current.values()) {
|
|
20781
20921
|
if (z.group === group) return z;
|
|
@@ -20784,7 +20924,7 @@ function useDataDnd(args) {
|
|
|
20784
20924
|
},
|
|
20785
20925
|
[]
|
|
20786
20926
|
);
|
|
20787
|
-
const handleDragEnd =
|
|
20927
|
+
const handleDragEnd = React77__default.useCallback(
|
|
20788
20928
|
(event) => {
|
|
20789
20929
|
const { active, over } = event;
|
|
20790
20930
|
const activeIdStr = String(active.id);
|
|
@@ -20875,8 +21015,8 @@ function useDataDnd(args) {
|
|
|
20875
21015
|
},
|
|
20876
21016
|
[eventBus]
|
|
20877
21017
|
);
|
|
20878
|
-
const sortableData =
|
|
20879
|
-
const SortableItem =
|
|
21018
|
+
const sortableData = React77__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
21019
|
+
const SortableItem = React77__default.useCallback(
|
|
20880
21020
|
({ id, children }) => {
|
|
20881
21021
|
const {
|
|
20882
21022
|
attributes,
|
|
@@ -20916,7 +21056,7 @@ function useDataDnd(args) {
|
|
|
20916
21056
|
id: droppableId,
|
|
20917
21057
|
data: sortableData
|
|
20918
21058
|
});
|
|
20919
|
-
const ctx =
|
|
21059
|
+
const ctx = React77__default.useContext(RootCtx);
|
|
20920
21060
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
20921
21061
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
20922
21062
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -20931,7 +21071,7 @@ function useDataDnd(args) {
|
|
|
20931
21071
|
showForeignPlaceholder,
|
|
20932
21072
|
ctxAvailable: ctx != null
|
|
20933
21073
|
});
|
|
20934
|
-
|
|
21074
|
+
React77__default.useEffect(() => {
|
|
20935
21075
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
20936
21076
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
20937
21077
|
return /* @__PURE__ */ jsx(
|
|
@@ -20945,11 +21085,11 @@ function useDataDnd(args) {
|
|
|
20945
21085
|
}
|
|
20946
21086
|
);
|
|
20947
21087
|
};
|
|
20948
|
-
const rootContextValue =
|
|
21088
|
+
const rootContextValue = React77__default.useMemo(
|
|
20949
21089
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
20950
21090
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
20951
21091
|
);
|
|
20952
|
-
const handleDragStart =
|
|
21092
|
+
const handleDragStart = React77__default.useCallback((event) => {
|
|
20953
21093
|
const sourceZone = findZoneByItem(event.active.id);
|
|
20954
21094
|
const rect = event.active.rect.current.initial;
|
|
20955
21095
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -20968,7 +21108,7 @@ function useDataDnd(args) {
|
|
|
20968
21108
|
isRoot
|
|
20969
21109
|
});
|
|
20970
21110
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
20971
|
-
const handleDragOver =
|
|
21111
|
+
const handleDragOver = React77__default.useCallback((event) => {
|
|
20972
21112
|
const { active, over } = event;
|
|
20973
21113
|
const overData = over?.data?.current;
|
|
20974
21114
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -21038,7 +21178,7 @@ function useDataDnd(args) {
|
|
|
21038
21178
|
return next;
|
|
21039
21179
|
});
|
|
21040
21180
|
}, []);
|
|
21041
|
-
const handleDragCancel =
|
|
21181
|
+
const handleDragCancel = React77__default.useCallback((event) => {
|
|
21042
21182
|
setActiveDrag(null);
|
|
21043
21183
|
setOverZoneGroup(null);
|
|
21044
21184
|
dndLog.warn("dragCancel", {
|
|
@@ -21046,12 +21186,12 @@ function useDataDnd(args) {
|
|
|
21046
21186
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
21047
21187
|
});
|
|
21048
21188
|
}, []);
|
|
21049
|
-
const handleDragEndWithCleanup =
|
|
21189
|
+
const handleDragEndWithCleanup = React77__default.useCallback((event) => {
|
|
21050
21190
|
handleDragEnd(event);
|
|
21051
21191
|
setActiveDrag(null);
|
|
21052
21192
|
setOverZoneGroup(null);
|
|
21053
21193
|
}, [handleDragEnd]);
|
|
21054
|
-
const wrapContainer =
|
|
21194
|
+
const wrapContainer = React77__default.useCallback(
|
|
21055
21195
|
(children) => {
|
|
21056
21196
|
if (!enabled) return children;
|
|
21057
21197
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -21105,7 +21245,7 @@ var init_useDataDnd = __esm({
|
|
|
21105
21245
|
init_useAlmadarDndCollision();
|
|
21106
21246
|
init_Box();
|
|
21107
21247
|
dndLog = createLogger("almadar:ui:dnd");
|
|
21108
|
-
RootCtx =
|
|
21248
|
+
RootCtx = React77__default.createContext(null);
|
|
21109
21249
|
}
|
|
21110
21250
|
});
|
|
21111
21251
|
function renderIconInput(icon, props) {
|
|
@@ -21647,7 +21787,7 @@ function DataList({
|
|
|
21647
21787
|
}) {
|
|
21648
21788
|
const eventBus = useEventBus();
|
|
21649
21789
|
const { t } = useTranslate();
|
|
21650
|
-
const [visibleCount, setVisibleCount] =
|
|
21790
|
+
const [visibleCount, setVisibleCount] = React77__default.useState(pageSize || Infinity);
|
|
21651
21791
|
const fieldDefs = fields ?? columns ?? [];
|
|
21652
21792
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
21653
21793
|
const dnd = useDataDnd({
|
|
@@ -21663,14 +21803,14 @@ function DataList({
|
|
|
21663
21803
|
dndRoot
|
|
21664
21804
|
});
|
|
21665
21805
|
const orderedData = dnd.orderedItems;
|
|
21666
|
-
const allData =
|
|
21806
|
+
const allData = React77__default.useMemo(
|
|
21667
21807
|
() => sortRows(orderedData, sortBy, sortDirection),
|
|
21668
21808
|
[orderedData, sortBy, sortDirection]
|
|
21669
21809
|
);
|
|
21670
21810
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
21671
21811
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
21672
21812
|
const hasRenderProp = typeof children === "function";
|
|
21673
|
-
|
|
21813
|
+
React77__default.useEffect(() => {
|
|
21674
21814
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
21675
21815
|
const childrenTypeOf = typeof children;
|
|
21676
21816
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -21785,7 +21925,7 @@ function DataList({
|
|
|
21785
21925
|
return v === void 0 || v === null || v === "" ? raw : String(v);
|
|
21786
21926
|
};
|
|
21787
21927
|
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
|
|
21788
|
-
groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
21928
|
+
groups2.map((group, gi) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
|
|
21789
21929
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
21790
21930
|
group.items.map((itemData, index) => {
|
|
21791
21931
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -21984,7 +22124,7 @@ function DataList({
|
|
|
21984
22124
|
className
|
|
21985
22125
|
),
|
|
21986
22126
|
children: [
|
|
21987
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
22127
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
|
|
21988
22128
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
21989
22129
|
group.items.map(
|
|
21990
22130
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -22093,8 +22233,8 @@ function ScalarControl({
|
|
|
22093
22233
|
}
|
|
22094
22234
|
const numeric = typeof value === "number";
|
|
22095
22235
|
const initial = value === null ? "" : String(value);
|
|
22096
|
-
const [draft, setDraft] =
|
|
22097
|
-
|
|
22236
|
+
const [draft, setDraft] = React77__default.useState(initial);
|
|
22237
|
+
React77__default.useEffect(() => setDraft(initial), [initial]);
|
|
22098
22238
|
const commit = () => {
|
|
22099
22239
|
if (numeric) {
|
|
22100
22240
|
const n = draft.trim() === "" ? 0 : Number(draft);
|
|
@@ -22162,8 +22302,8 @@ function Row({
|
|
|
22162
22302
|
onRemove,
|
|
22163
22303
|
readonly
|
|
22164
22304
|
}) {
|
|
22165
|
-
const [keyDraft, setKeyDraft] =
|
|
22166
|
-
|
|
22305
|
+
const [keyDraft, setKeyDraft] = React77__default.useState(rowKey);
|
|
22306
|
+
React77__default.useEffect(() => setKeyDraft(rowKey), [rowKey]);
|
|
22167
22307
|
const container = isObj(value) || isArr(value);
|
|
22168
22308
|
return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "group w-max min-w-full", children: [
|
|
22169
22309
|
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", className: "py-0.5 w-max", children: [
|
|
@@ -22206,7 +22346,7 @@ function ContainerNode({
|
|
|
22206
22346
|
depth,
|
|
22207
22347
|
readonly
|
|
22208
22348
|
}) {
|
|
22209
|
-
const [open, setOpen] =
|
|
22349
|
+
const [open, setOpen] = React77__default.useState(depth < 2);
|
|
22210
22350
|
const array = isArr(value);
|
|
22211
22351
|
const entries = array ? value.map((v, i) => [String(i), v]) : Object.entries(value);
|
|
22212
22352
|
const setObjValue = (key, next) => {
|
|
@@ -22348,7 +22488,7 @@ var init_FormSection = __esm({
|
|
|
22348
22488
|
columns = 1,
|
|
22349
22489
|
className
|
|
22350
22490
|
}) => {
|
|
22351
|
-
const [collapsed, setCollapsed] =
|
|
22491
|
+
const [collapsed, setCollapsed] = React77__default.useState(defaultCollapsed);
|
|
22352
22492
|
const { t } = useTranslate();
|
|
22353
22493
|
const eventBus = useEventBus();
|
|
22354
22494
|
const gridClass = {
|
|
@@ -22356,7 +22496,7 @@ var init_FormSection = __esm({
|
|
|
22356
22496
|
2: "grid-cols-1 md:grid-cols-2",
|
|
22357
22497
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
22358
22498
|
}[columns];
|
|
22359
|
-
|
|
22499
|
+
React77__default.useCallback(() => {
|
|
22360
22500
|
if (collapsible) {
|
|
22361
22501
|
setCollapsed((prev) => !prev);
|
|
22362
22502
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -22764,8 +22904,8 @@ function TextLikeControl({
|
|
|
22764
22904
|
onCommit
|
|
22765
22905
|
}) {
|
|
22766
22906
|
const initial = value === void 0 || value === null ? "" : String(value);
|
|
22767
|
-
const [draft, setDraft] =
|
|
22768
|
-
|
|
22907
|
+
const [draft, setDraft] = React77__default.useState(initial);
|
|
22908
|
+
React77__default.useEffect(() => setDraft(initial), [initial]);
|
|
22769
22909
|
const commit = () => {
|
|
22770
22910
|
if (numeric) {
|
|
22771
22911
|
const n = draft.trim() === "" ? 0 : Number(draft);
|
|
@@ -22950,14 +23090,14 @@ var init_NodeSlotEditor = __esm({
|
|
|
22950
23090
|
isObj2 = (v) => v !== null && v !== void 0 && typeof v === "object" && !Array.isArray(v);
|
|
22951
23091
|
NodeSlotEditor = ({ value, onChange, className }) => {
|
|
22952
23092
|
const { type, props, wasArray } = normalize(value);
|
|
22953
|
-
const patterns =
|
|
23093
|
+
const patterns = React77__default.useMemo(() => {
|
|
22954
23094
|
try {
|
|
22955
23095
|
return [...getKnownPatterns()].sort();
|
|
22956
23096
|
} catch {
|
|
22957
23097
|
return [];
|
|
22958
23098
|
}
|
|
22959
23099
|
}, []);
|
|
22960
|
-
const options =
|
|
23100
|
+
const options = React77__default.useMemo(
|
|
22961
23101
|
() => [{ value: "", label: "\u2014 none \u2014" }, ...patterns.map((p) => ({ value: p, label: p }))],
|
|
22962
23102
|
[patterns]
|
|
22963
23103
|
);
|
|
@@ -22969,7 +23109,7 @@ var init_NodeSlotEditor = __esm({
|
|
|
22969
23109
|
const pattern = { type: nextType, ...nextProps };
|
|
22970
23110
|
onChange(wasArray || value === void 0 ? [pattern] : pattern);
|
|
22971
23111
|
};
|
|
22972
|
-
const schemaEntries =
|
|
23112
|
+
const schemaEntries = React77__default.useMemo(() => {
|
|
22973
23113
|
if (!type) return [];
|
|
22974
23114
|
const def = getPatternDefinition(type);
|
|
22975
23115
|
if (!def?.propsSchema) return [];
|
|
@@ -23790,7 +23930,7 @@ var init_Flex = __esm({
|
|
|
23790
23930
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
23791
23931
|
}
|
|
23792
23932
|
}
|
|
23793
|
-
return
|
|
23933
|
+
return React77__default.createElement(Component, {
|
|
23794
23934
|
className: cn(
|
|
23795
23935
|
inline ? "inline-flex" : "flex",
|
|
23796
23936
|
directionStyles[direction],
|
|
@@ -23909,7 +24049,7 @@ var init_Grid = __esm({
|
|
|
23909
24049
|
as: Component = "div"
|
|
23910
24050
|
}) => {
|
|
23911
24051
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
23912
|
-
return
|
|
24052
|
+
return React77__default.createElement(
|
|
23913
24053
|
Component,
|
|
23914
24054
|
{
|
|
23915
24055
|
className: cn(
|
|
@@ -24141,9 +24281,9 @@ var init_Popover = __esm({
|
|
|
24141
24281
|
onMouseLeave: handleClose,
|
|
24142
24282
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
24143
24283
|
};
|
|
24144
|
-
const childElement =
|
|
24284
|
+
const childElement = React77__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
24145
24285
|
const childPointerDown = childElement.props.onPointerDown;
|
|
24146
|
-
const triggerElement =
|
|
24286
|
+
const triggerElement = React77__default.cloneElement(
|
|
24147
24287
|
childElement,
|
|
24148
24288
|
{
|
|
24149
24289
|
ref: triggerRef,
|
|
@@ -25002,9 +25142,9 @@ var init_Tooltip = __esm({
|
|
|
25002
25142
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
25003
25143
|
};
|
|
25004
25144
|
}, []);
|
|
25005
|
-
const triggerElement =
|
|
25145
|
+
const triggerElement = React77__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
25006
25146
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
25007
|
-
const trigger =
|
|
25147
|
+
const trigger = React77__default.cloneElement(triggerElement, {
|
|
25008
25148
|
ref: triggerRef,
|
|
25009
25149
|
onMouseEnter: handleMouseEnter,
|
|
25010
25150
|
onMouseLeave: handleMouseLeave,
|
|
@@ -25094,7 +25234,7 @@ var init_WizardProgress = __esm({
|
|
|
25094
25234
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
25095
25235
|
const isActive = index === currentStep;
|
|
25096
25236
|
const isCompleted = index < currentStep;
|
|
25097
|
-
return /* @__PURE__ */ jsxs(
|
|
25237
|
+
return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
|
|
25098
25238
|
/* @__PURE__ */ jsx(
|
|
25099
25239
|
"button",
|
|
25100
25240
|
{
|
|
@@ -26905,7 +27045,7 @@ function GameMenu({
|
|
|
26905
27045
|
}) {
|
|
26906
27046
|
const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
|
|
26907
27047
|
const eventBus = useEventBus();
|
|
26908
|
-
const handleOptionClick =
|
|
27048
|
+
const handleOptionClick = React77.useCallback(
|
|
26909
27049
|
(option) => {
|
|
26910
27050
|
if (option.event) {
|
|
26911
27051
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -27141,7 +27281,7 @@ function StateGraph({
|
|
|
27141
27281
|
}) {
|
|
27142
27282
|
const eventBus = useEventBus();
|
|
27143
27283
|
const nodes = states ?? [];
|
|
27144
|
-
const positions =
|
|
27284
|
+
const positions = React77.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
27145
27285
|
return /* @__PURE__ */ jsxs(
|
|
27146
27286
|
Box,
|
|
27147
27287
|
{
|
|
@@ -27678,7 +27818,7 @@ function LinearView({
|
|
|
27678
27818
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
27679
27819
|
const isDone = i < currentIdx;
|
|
27680
27820
|
const isCurrent = i === currentIdx;
|
|
27681
|
-
return /* @__PURE__ */ jsxs(
|
|
27821
|
+
return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
|
|
27682
27822
|
i > 0 && /* @__PURE__ */ jsx(
|
|
27683
27823
|
Typography,
|
|
27684
27824
|
{
|
|
@@ -28311,7 +28451,7 @@ function SequenceBar({
|
|
|
28311
28451
|
else onSlotRemove?.(index);
|
|
28312
28452
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
28313
28453
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
28314
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
28454
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
|
|
28315
28455
|
i > 0 && /* @__PURE__ */ jsx(
|
|
28316
28456
|
Typography,
|
|
28317
28457
|
{
|
|
@@ -29291,13 +29431,13 @@ var init_MapView = __esm({
|
|
|
29291
29431
|
shadowSize: [41, 41]
|
|
29292
29432
|
});
|
|
29293
29433
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
29294
|
-
const { useEffect:
|
|
29434
|
+
const { useEffect: useEffect66, useRef: useRef64, useCallback: useCallback107, useState: useState104 } = React77__default;
|
|
29295
29435
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
29296
29436
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
29297
29437
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
29298
29438
|
const map = useMap();
|
|
29299
|
-
const prevRef =
|
|
29300
|
-
|
|
29439
|
+
const prevRef = useRef64({ centerLat, centerLng, zoom });
|
|
29440
|
+
useEffect66(() => {
|
|
29301
29441
|
const prev = prevRef.current;
|
|
29302
29442
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
29303
29443
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -29308,7 +29448,7 @@ var init_MapView = __esm({
|
|
|
29308
29448
|
}
|
|
29309
29449
|
function MapClickHandler({ onMapClick }) {
|
|
29310
29450
|
const map = useMap();
|
|
29311
|
-
|
|
29451
|
+
useEffect66(() => {
|
|
29312
29452
|
if (!onMapClick) return;
|
|
29313
29453
|
const handler = (e) => {
|
|
29314
29454
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -29336,8 +29476,8 @@ var init_MapView = __esm({
|
|
|
29336
29476
|
showAttribution = true
|
|
29337
29477
|
}) {
|
|
29338
29478
|
const eventBus = useEventBus2();
|
|
29339
|
-
const [clickedPosition, setClickedPosition] =
|
|
29340
|
-
const handleMapClick =
|
|
29479
|
+
const [clickedPosition, setClickedPosition] = useState104(null);
|
|
29480
|
+
const handleMapClick = useCallback107((lat, lng) => {
|
|
29341
29481
|
if (showClickedPin) {
|
|
29342
29482
|
setClickedPosition({ lat, lng });
|
|
29343
29483
|
}
|
|
@@ -29346,7 +29486,7 @@ var init_MapView = __esm({
|
|
|
29346
29486
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
29347
29487
|
}
|
|
29348
29488
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
29349
|
-
const handleMarkerClick =
|
|
29489
|
+
const handleMarkerClick = useCallback107((marker) => {
|
|
29350
29490
|
onMarkerClick?.(marker);
|
|
29351
29491
|
if (markerClickEvent) {
|
|
29352
29492
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -30209,8 +30349,8 @@ function TableView({
|
|
|
30209
30349
|
}) {
|
|
30210
30350
|
const eventBus = useEventBus();
|
|
30211
30351
|
const { t } = useTranslate();
|
|
30212
|
-
const [visibleCount, setVisibleCount] =
|
|
30213
|
-
const [localSelected, setLocalSelected] =
|
|
30352
|
+
const [visibleCount, setVisibleCount] = React77__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
30353
|
+
const [localSelected, setLocalSelected] = React77__default.useState(/* @__PURE__ */ new Set());
|
|
30214
30354
|
const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
|
|
30215
30355
|
const actionDefs = Array.isArray(itemActions) ? itemActions : [];
|
|
30216
30356
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
@@ -30232,7 +30372,7 @@ function TableView({
|
|
|
30232
30372
|
const hasRenderProp = typeof children === "function";
|
|
30233
30373
|
const idField = dndItemIdField ?? "id";
|
|
30234
30374
|
const isCoarsePointer = useMediaQuery("(pointer: coarse)");
|
|
30235
|
-
|
|
30375
|
+
React77__default.useEffect(() => {
|
|
30236
30376
|
tableViewLog.debug("render", {
|
|
30237
30377
|
rowCount: data.length,
|
|
30238
30378
|
colCount: colDefs.length,
|
|
@@ -30289,7 +30429,7 @@ function TableView({
|
|
|
30289
30429
|
};
|
|
30290
30430
|
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
30291
30431
|
};
|
|
30292
|
-
const colFloors =
|
|
30432
|
+
const colFloors = React77__default.useMemo(
|
|
30293
30433
|
() => colDefs.map((col) => {
|
|
30294
30434
|
const longest = data.reduce((widest, row) => {
|
|
30295
30435
|
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
@@ -30451,12 +30591,12 @@ function TableView({
|
|
|
30451
30591
|
]
|
|
30452
30592
|
}
|
|
30453
30593
|
);
|
|
30454
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
30594
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React77__default.Fragment, { children: rowInner }, id);
|
|
30455
30595
|
};
|
|
30456
30596
|
const items = Array.from(data);
|
|
30457
30597
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
30458
30598
|
let runningIndex = 0;
|
|
30459
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
30599
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
|
|
30460
30600
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
30461
30601
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
30462
30602
|
] }, gi)) });
|
|
@@ -31819,7 +31959,7 @@ var init_StepFlow = __esm({
|
|
|
31819
31959
|
className
|
|
31820
31960
|
}) => {
|
|
31821
31961
|
if (orientation === "vertical") {
|
|
31822
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
31962
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React77__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
31823
31963
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
31824
31964
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
31825
31965
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -31830,7 +31970,7 @@ var init_StepFlow = __esm({
|
|
|
31830
31970
|
] })
|
|
31831
31971
|
] }) }, index)) });
|
|
31832
31972
|
}
|
|
31833
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(
|
|
31973
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
|
|
31834
31974
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
31835
31975
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
31836
31976
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -32820,7 +32960,7 @@ var init_LikertScale = __esm({
|
|
|
32820
32960
|
md: "text-base",
|
|
32821
32961
|
lg: "text-lg"
|
|
32822
32962
|
};
|
|
32823
|
-
LikertScale =
|
|
32963
|
+
LikertScale = React77__default.forwardRef(
|
|
32824
32964
|
({
|
|
32825
32965
|
question,
|
|
32826
32966
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -32832,7 +32972,7 @@ var init_LikertScale = __esm({
|
|
|
32832
32972
|
variant = "radios",
|
|
32833
32973
|
className
|
|
32834
32974
|
}, ref) => {
|
|
32835
|
-
const groupId =
|
|
32975
|
+
const groupId = React77__default.useId();
|
|
32836
32976
|
const eventBus = useEventBus();
|
|
32837
32977
|
const handleSelect = useCallback(
|
|
32838
32978
|
(next) => {
|
|
@@ -35121,7 +35261,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
35121
35261
|
"aria-label": t("aria.breadcrumb"),
|
|
35122
35262
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
35123
35263
|
const isLast = idx === items.length - 1;
|
|
35124
|
-
return /* @__PURE__ */ jsxs(
|
|
35264
|
+
return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
|
|
35125
35265
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
35126
35266
|
Icon,
|
|
35127
35267
|
{
|
|
@@ -35990,7 +36130,7 @@ var init_MiniStateMachine = __esm({
|
|
|
35990
36130
|
const x = 2 + i * (NODE_W + GAP2 + ARROW_W + GAP2);
|
|
35991
36131
|
const tc = transitionCounts[s.name] ?? 0;
|
|
35992
36132
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
35993
|
-
return /* @__PURE__ */ jsxs(
|
|
36133
|
+
return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
|
|
35994
36134
|
/* @__PURE__ */ jsx(
|
|
35995
36135
|
AvlState,
|
|
35996
36136
|
{
|
|
@@ -36194,7 +36334,7 @@ var init_PageHeader = __esm({
|
|
|
36194
36334
|
info: "bg-info/10 text-info"
|
|
36195
36335
|
};
|
|
36196
36336
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
36197
|
-
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(
|
|
36337
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
|
|
36198
36338
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
36199
36339
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
36200
36340
|
"a",
|
|
@@ -36552,7 +36692,7 @@ var init_Section = __esm({
|
|
|
36552
36692
|
as: Component = "section"
|
|
36553
36693
|
}) => {
|
|
36554
36694
|
const hasHeader = title || description || action;
|
|
36555
|
-
return
|
|
36695
|
+
return React77__default.createElement(
|
|
36556
36696
|
Component,
|
|
36557
36697
|
{
|
|
36558
36698
|
className: cn(
|
|
@@ -36926,7 +37066,7 @@ var init_WizardContainer = __esm({
|
|
|
36926
37066
|
const isCompleted = index < currentStep;
|
|
36927
37067
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
36928
37068
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
36929
|
-
return /* @__PURE__ */ jsxs(
|
|
37069
|
+
return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
|
|
36930
37070
|
/* @__PURE__ */ jsx(
|
|
36931
37071
|
Button,
|
|
36932
37072
|
{
|
|
@@ -38713,7 +38853,7 @@ var init_ImportPreviewTree = __esm({
|
|
|
38713
38853
|
const renderUnit = (unit, childrenByParent, depth) => {
|
|
38714
38854
|
const summary = fieldSummary(unit);
|
|
38715
38855
|
const children = childrenByParent.get(unit.ref) ?? [];
|
|
38716
|
-
return /* @__PURE__ */ jsxs(
|
|
38856
|
+
return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
|
|
38717
38857
|
/* @__PURE__ */ jsxs(
|
|
38718
38858
|
Box,
|
|
38719
38859
|
{
|
|
@@ -38810,7 +38950,7 @@ var init_ImportProgress = __esm({
|
|
|
38810
38950
|
PIPELINE.map((key, index) => {
|
|
38811
38951
|
const isComplete = index < currentIndex;
|
|
38812
38952
|
const isActive = index === currentIndex;
|
|
38813
|
-
return /* @__PURE__ */ jsxs(
|
|
38953
|
+
return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
|
|
38814
38954
|
index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
|
|
38815
38955
|
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
|
|
38816
38956
|
/* @__PURE__ */ jsx(
|
|
@@ -40134,18 +40274,30 @@ var init_DetailPanel = __esm({
|
|
|
40134
40274
|
DetailPanel.displayName = "DetailPanel";
|
|
40135
40275
|
}
|
|
40136
40276
|
});
|
|
40137
|
-
|
|
40138
|
-
|
|
40139
|
-
|
|
40277
|
+
function DrawGroup(props) {
|
|
40278
|
+
const register = useContext(DrawableRegistryContext);
|
|
40279
|
+
if (register) register({ ...props, type: "draw-group" });
|
|
40140
40280
|
return null;
|
|
40141
40281
|
}
|
|
40142
40282
|
var init_DrawGroup = __esm({
|
|
40143
40283
|
"components/game/atoms/DrawGroup.tsx"() {
|
|
40144
40284
|
"use client";
|
|
40285
|
+
init_registry();
|
|
40286
|
+
}
|
|
40287
|
+
});
|
|
40288
|
+
function DrawMesh(props) {
|
|
40289
|
+
const register = useContext(DrawableRegistryContext);
|
|
40290
|
+
if (register) register({ ...props, type: "draw-mesh" });
|
|
40291
|
+
return null;
|
|
40292
|
+
}
|
|
40293
|
+
var init_DrawMesh = __esm({
|
|
40294
|
+
"components/game/atoms/DrawMesh.tsx"() {
|
|
40295
|
+
"use client";
|
|
40296
|
+
init_registry();
|
|
40145
40297
|
}
|
|
40146
40298
|
});
|
|
40147
40299
|
function extractTitle(children) {
|
|
40148
|
-
if (!
|
|
40300
|
+
if (!React77__default.isValidElement(children)) return void 0;
|
|
40149
40301
|
const props = children.props;
|
|
40150
40302
|
if (typeof props.title === "string") {
|
|
40151
40303
|
return props.title;
|
|
@@ -40495,12 +40647,12 @@ var init_Form = __esm({
|
|
|
40495
40647
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
40496
40648
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
40497
40649
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
40498
|
-
const normalizedInitialData =
|
|
40650
|
+
const normalizedInitialData = React77__default.useMemo(() => {
|
|
40499
40651
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
40500
40652
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
40501
40653
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
40502
40654
|
}, [entity, initialData]);
|
|
40503
|
-
const entityDerivedFields =
|
|
40655
|
+
const entityDerivedFields = React77__default.useMemo(() => {
|
|
40504
40656
|
if (fields && fields.length > 0) return void 0;
|
|
40505
40657
|
if (!resolvedEntity) return void 0;
|
|
40506
40658
|
return resolvedEntity.fields.map(
|
|
@@ -40521,16 +40673,16 @@ var init_Form = __esm({
|
|
|
40521
40673
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
40522
40674
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
40523
40675
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
40524
|
-
const [formData, setFormData] =
|
|
40676
|
+
const [formData, setFormData] = React77__default.useState(
|
|
40525
40677
|
normalizedInitialData
|
|
40526
40678
|
);
|
|
40527
|
-
const [collapsedSections, setCollapsedSections] =
|
|
40679
|
+
const [collapsedSections, setCollapsedSections] = React77__default.useState(
|
|
40528
40680
|
/* @__PURE__ */ new Set()
|
|
40529
40681
|
);
|
|
40530
|
-
const [submitError, setSubmitError] =
|
|
40531
|
-
const formRef =
|
|
40682
|
+
const [submitError, setSubmitError] = React77__default.useState(null);
|
|
40683
|
+
const formRef = React77__default.useRef(null);
|
|
40532
40684
|
const formMode = props.mode;
|
|
40533
|
-
const mountedRef =
|
|
40685
|
+
const mountedRef = React77__default.useRef(false);
|
|
40534
40686
|
if (!mountedRef.current) {
|
|
40535
40687
|
mountedRef.current = true;
|
|
40536
40688
|
debug("forms", "mount", {
|
|
@@ -40543,7 +40695,7 @@ var init_Form = __esm({
|
|
|
40543
40695
|
});
|
|
40544
40696
|
}
|
|
40545
40697
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
40546
|
-
const evalContext =
|
|
40698
|
+
const evalContext = React77__default.useMemo(
|
|
40547
40699
|
() => ({
|
|
40548
40700
|
formValues: formData,
|
|
40549
40701
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -40552,7 +40704,7 @@ var init_Form = __esm({
|
|
|
40552
40704
|
}),
|
|
40553
40705
|
[formData, externalContext]
|
|
40554
40706
|
);
|
|
40555
|
-
|
|
40707
|
+
React77__default.useEffect(() => {
|
|
40556
40708
|
debug("forms", "initialData-sync", {
|
|
40557
40709
|
mode: formMode,
|
|
40558
40710
|
normalizedInitialData,
|
|
@@ -40563,7 +40715,7 @@ var init_Form = __esm({
|
|
|
40563
40715
|
setFormData(normalizedInitialData);
|
|
40564
40716
|
}
|
|
40565
40717
|
}, [normalizedInitialData]);
|
|
40566
|
-
const processCalculations =
|
|
40718
|
+
const processCalculations = React77__default.useCallback(
|
|
40567
40719
|
(changedFieldId, newFormData) => {
|
|
40568
40720
|
if (!hiddenCalculations.length) return;
|
|
40569
40721
|
const context = {
|
|
@@ -40588,7 +40740,7 @@ var init_Form = __esm({
|
|
|
40588
40740
|
},
|
|
40589
40741
|
[hiddenCalculations, externalContext, eventBus]
|
|
40590
40742
|
);
|
|
40591
|
-
const checkViolations =
|
|
40743
|
+
const checkViolations = React77__default.useCallback(
|
|
40592
40744
|
(changedFieldId, newFormData) => {
|
|
40593
40745
|
if (!violationTriggers.length) return;
|
|
40594
40746
|
const context = {
|
|
@@ -40626,7 +40778,7 @@ var init_Form = __esm({
|
|
|
40626
40778
|
processCalculations(name, newFormData);
|
|
40627
40779
|
checkViolations(name, newFormData);
|
|
40628
40780
|
};
|
|
40629
|
-
const isFieldVisible =
|
|
40781
|
+
const isFieldVisible = React77__default.useCallback(
|
|
40630
40782
|
(fieldName) => {
|
|
40631
40783
|
const condition = conditionalFields[fieldName];
|
|
40632
40784
|
if (!condition) return true;
|
|
@@ -40634,7 +40786,7 @@ var init_Form = __esm({
|
|
|
40634
40786
|
},
|
|
40635
40787
|
[conditionalFields, evalContext]
|
|
40636
40788
|
);
|
|
40637
|
-
const isSectionVisible =
|
|
40789
|
+
const isSectionVisible = React77__default.useCallback(
|
|
40638
40790
|
(section) => {
|
|
40639
40791
|
if (!section.condition) return true;
|
|
40640
40792
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -40710,7 +40862,7 @@ var init_Form = __esm({
|
|
|
40710
40862
|
eventBus.emit(`UI:${onCancel}`);
|
|
40711
40863
|
}
|
|
40712
40864
|
};
|
|
40713
|
-
const renderField =
|
|
40865
|
+
const renderField = React77__default.useCallback(
|
|
40714
40866
|
(field) => {
|
|
40715
40867
|
const fieldName = field.name || field.field;
|
|
40716
40868
|
if (!fieldName) return null;
|
|
@@ -40731,7 +40883,7 @@ var init_Form = __esm({
|
|
|
40731
40883
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
40732
40884
|
);
|
|
40733
40885
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
40734
|
-
const normalizedFields =
|
|
40886
|
+
const normalizedFields = React77__default.useMemo(() => {
|
|
40735
40887
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
40736
40888
|
return effectiveFields.map((field) => {
|
|
40737
40889
|
if (typeof field === "string") {
|
|
@@ -40755,7 +40907,7 @@ var init_Form = __esm({
|
|
|
40755
40907
|
return field;
|
|
40756
40908
|
});
|
|
40757
40909
|
}, [effectiveFields, resolvedEntity]);
|
|
40758
|
-
const schemaFields =
|
|
40910
|
+
const schemaFields = React77__default.useMemo(() => {
|
|
40759
40911
|
if (normalizedFields.length === 0) return null;
|
|
40760
40912
|
if (isDebugEnabled()) {
|
|
40761
40913
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -40765,7 +40917,7 @@ var init_Form = __esm({
|
|
|
40765
40917
|
}
|
|
40766
40918
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
40767
40919
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
40768
|
-
const sectionElements =
|
|
40920
|
+
const sectionElements = React77__default.useMemo(() => {
|
|
40769
40921
|
if (!sections || sections.length === 0) return null;
|
|
40770
40922
|
return sections.map((section) => {
|
|
40771
40923
|
if (!isSectionVisible(section)) {
|
|
@@ -41491,7 +41643,7 @@ var init_List = __esm({
|
|
|
41491
41643
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
41492
41644
|
return [];
|
|
41493
41645
|
}, [entity]);
|
|
41494
|
-
const getItemActions =
|
|
41646
|
+
const getItemActions = React77__default.useCallback(
|
|
41495
41647
|
(item) => {
|
|
41496
41648
|
if (!itemActions) return [];
|
|
41497
41649
|
if (typeof itemActions === "function") {
|
|
@@ -41972,7 +42124,7 @@ var init_MediaGallery = __esm({
|
|
|
41972
42124
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
41973
42125
|
);
|
|
41974
42126
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
41975
|
-
const items =
|
|
42127
|
+
const items = React77__default.useMemo(() => {
|
|
41976
42128
|
if (propItems && propItems.length > 0) return propItems;
|
|
41977
42129
|
if (entityData.length === 0) return [];
|
|
41978
42130
|
return entityData.map((record, idx) => {
|
|
@@ -42137,7 +42289,7 @@ var init_MediaGallery = __esm({
|
|
|
42137
42289
|
}
|
|
42138
42290
|
});
|
|
42139
42291
|
function extractTitle2(children) {
|
|
42140
|
-
if (!
|
|
42292
|
+
if (!React77__default.isValidElement(children)) return void 0;
|
|
42141
42293
|
const props = children.props;
|
|
42142
42294
|
if (typeof props.title === "string") {
|
|
42143
42295
|
return props.title;
|
|
@@ -42392,7 +42544,7 @@ var init_debugRegistry = __esm({
|
|
|
42392
42544
|
}
|
|
42393
42545
|
});
|
|
42394
42546
|
function useDebugData() {
|
|
42395
|
-
const [data, setData] =
|
|
42547
|
+
const [data, setData] = React77.useState(() => ({
|
|
42396
42548
|
traits: [],
|
|
42397
42549
|
ticks: [],
|
|
42398
42550
|
guards: [],
|
|
@@ -42406,7 +42558,7 @@ function useDebugData() {
|
|
|
42406
42558
|
},
|
|
42407
42559
|
lastUpdate: Date.now()
|
|
42408
42560
|
}));
|
|
42409
|
-
|
|
42561
|
+
React77.useEffect(() => {
|
|
42410
42562
|
const updateData = () => {
|
|
42411
42563
|
setData({
|
|
42412
42564
|
traits: getAllTraits(),
|
|
@@ -42515,12 +42667,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
42515
42667
|
return positions;
|
|
42516
42668
|
}
|
|
42517
42669
|
function WalkMinimap() {
|
|
42518
|
-
const [walkStep, setWalkStep] =
|
|
42519
|
-
const [traits2, setTraits] =
|
|
42520
|
-
const [coveredEdges, setCoveredEdges] =
|
|
42521
|
-
const [completedTraits, setCompletedTraits] =
|
|
42522
|
-
const prevTraitRef =
|
|
42523
|
-
|
|
42670
|
+
const [walkStep, setWalkStep] = React77.useState(null);
|
|
42671
|
+
const [traits2, setTraits] = React77.useState([]);
|
|
42672
|
+
const [coveredEdges, setCoveredEdges] = React77.useState([]);
|
|
42673
|
+
const [completedTraits, setCompletedTraits] = React77.useState(/* @__PURE__ */ new Set());
|
|
42674
|
+
const prevTraitRef = React77.useRef(null);
|
|
42675
|
+
React77.useEffect(() => {
|
|
42524
42676
|
const interval = setInterval(() => {
|
|
42525
42677
|
const w = window;
|
|
42526
42678
|
const step = w.__orbitalWalkStep;
|
|
@@ -42956,15 +43108,15 @@ var init_EntitiesTab = __esm({
|
|
|
42956
43108
|
});
|
|
42957
43109
|
function EventFlowTab({ events: events2 }) {
|
|
42958
43110
|
const { t } = useTranslate();
|
|
42959
|
-
const [filter, setFilter] =
|
|
42960
|
-
const containerRef =
|
|
42961
|
-
const [autoScroll, setAutoScroll] =
|
|
42962
|
-
|
|
43111
|
+
const [filter, setFilter] = React77.useState("all");
|
|
43112
|
+
const containerRef = React77.useRef(null);
|
|
43113
|
+
const [autoScroll, setAutoScroll] = React77.useState(true);
|
|
43114
|
+
React77.useEffect(() => {
|
|
42963
43115
|
if (autoScroll && containerRef.current) {
|
|
42964
43116
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42965
43117
|
}
|
|
42966
43118
|
}, [events2.length, autoScroll]);
|
|
42967
|
-
const filteredEvents =
|
|
43119
|
+
const filteredEvents = React77.useMemo(() => {
|
|
42968
43120
|
if (filter === "all") return events2;
|
|
42969
43121
|
return events2.filter((e) => e.type === filter);
|
|
42970
43122
|
}, [events2, filter]);
|
|
@@ -43080,7 +43232,7 @@ var init_EventFlowTab = __esm({
|
|
|
43080
43232
|
});
|
|
43081
43233
|
function GuardsPanel({ guards }) {
|
|
43082
43234
|
const { t } = useTranslate();
|
|
43083
|
-
const [filter, setFilter] =
|
|
43235
|
+
const [filter, setFilter] = React77.useState("all");
|
|
43084
43236
|
if (guards.length === 0) {
|
|
43085
43237
|
return /* @__PURE__ */ jsx(
|
|
43086
43238
|
EmptyState,
|
|
@@ -43093,7 +43245,7 @@ function GuardsPanel({ guards }) {
|
|
|
43093
43245
|
}
|
|
43094
43246
|
const passedCount = guards.filter((g) => g.result).length;
|
|
43095
43247
|
const failedCount = guards.length - passedCount;
|
|
43096
|
-
const filteredGuards =
|
|
43248
|
+
const filteredGuards = React77.useMemo(() => {
|
|
43097
43249
|
if (filter === "all") return guards;
|
|
43098
43250
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
43099
43251
|
return guards.filter((g) => !g.result);
|
|
@@ -43256,10 +43408,10 @@ function EffectBadge({ effect }) {
|
|
|
43256
43408
|
}
|
|
43257
43409
|
function TransitionTimeline({ transitions }) {
|
|
43258
43410
|
const { t } = useTranslate();
|
|
43259
|
-
const containerRef =
|
|
43260
|
-
const [autoScroll, setAutoScroll] =
|
|
43261
|
-
const [expandedId, setExpandedId] =
|
|
43262
|
-
|
|
43411
|
+
const containerRef = React77.useRef(null);
|
|
43412
|
+
const [autoScroll, setAutoScroll] = React77.useState(true);
|
|
43413
|
+
const [expandedId, setExpandedId] = React77.useState(null);
|
|
43414
|
+
React77.useEffect(() => {
|
|
43263
43415
|
if (autoScroll && containerRef.current) {
|
|
43264
43416
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
43265
43417
|
}
|
|
@@ -43539,9 +43691,9 @@ function getAllEvents(traits2) {
|
|
|
43539
43691
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
43540
43692
|
const eventBus = useEventBus();
|
|
43541
43693
|
const { t } = useTranslate();
|
|
43542
|
-
const [log19, setLog] =
|
|
43543
|
-
const prevStatesRef =
|
|
43544
|
-
|
|
43694
|
+
const [log19, setLog] = React77.useState([]);
|
|
43695
|
+
const prevStatesRef = React77.useRef(/* @__PURE__ */ new Map());
|
|
43696
|
+
React77.useEffect(() => {
|
|
43545
43697
|
for (const trait of traits2) {
|
|
43546
43698
|
const prev = prevStatesRef.current.get(trait.id);
|
|
43547
43699
|
if (prev && prev !== trait.currentState) {
|
|
@@ -43710,10 +43862,10 @@ function VerifyModePanel({
|
|
|
43710
43862
|
localCount
|
|
43711
43863
|
}) {
|
|
43712
43864
|
const { t } = useTranslate();
|
|
43713
|
-
const [expanded, setExpanded] =
|
|
43714
|
-
const scrollRef =
|
|
43715
|
-
const prevCountRef =
|
|
43716
|
-
|
|
43865
|
+
const [expanded, setExpanded] = React77.useState(true);
|
|
43866
|
+
const scrollRef = React77.useRef(null);
|
|
43867
|
+
const prevCountRef = React77.useRef(0);
|
|
43868
|
+
React77.useEffect(() => {
|
|
43717
43869
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
43718
43870
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
43719
43871
|
}
|
|
@@ -43770,10 +43922,10 @@ function RuntimeDebugger({
|
|
|
43770
43922
|
schema
|
|
43771
43923
|
}) {
|
|
43772
43924
|
const { t } = useTranslate();
|
|
43773
|
-
const [isCollapsed, setIsCollapsed] =
|
|
43774
|
-
const [isVisible, setIsVisible] =
|
|
43925
|
+
const [isCollapsed, setIsCollapsed] = React77.useState(mode === "verify" ? true : defaultCollapsed);
|
|
43926
|
+
const [isVisible, setIsVisible] = React77.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
43775
43927
|
const debugData = useDebugData();
|
|
43776
|
-
|
|
43928
|
+
React77.useEffect(() => {
|
|
43777
43929
|
if (mode === "inline") return;
|
|
43778
43930
|
return onDebugToggle((enabled) => {
|
|
43779
43931
|
setIsVisible(enabled);
|
|
@@ -43782,7 +43934,7 @@ function RuntimeDebugger({
|
|
|
43782
43934
|
}
|
|
43783
43935
|
});
|
|
43784
43936
|
}, [mode]);
|
|
43785
|
-
|
|
43937
|
+
React77.useEffect(() => {
|
|
43786
43938
|
if (mode === "inline") return;
|
|
43787
43939
|
const handleKeyDown = (e) => {
|
|
43788
43940
|
if (e.key === "`" && isVisible) {
|
|
@@ -44302,7 +44454,7 @@ var init_StatCard = __esm({
|
|
|
44302
44454
|
const labelToUse = propLabel ?? propTitle;
|
|
44303
44455
|
const eventBus = useEventBus();
|
|
44304
44456
|
const { t } = useTranslate();
|
|
44305
|
-
const handleActionClick =
|
|
44457
|
+
const handleActionClick = React77__default.useCallback(() => {
|
|
44306
44458
|
if (action?.event) {
|
|
44307
44459
|
eventBus.emit(`UI:${action.event}`, {});
|
|
44308
44460
|
}
|
|
@@ -44313,7 +44465,7 @@ var init_StatCard = __esm({
|
|
|
44313
44465
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
44314
44466
|
const isLoading = externalLoading ?? false;
|
|
44315
44467
|
const error = externalError;
|
|
44316
|
-
const computeMetricValue =
|
|
44468
|
+
const computeMetricValue = React77__default.useCallback(
|
|
44317
44469
|
(metric, items) => {
|
|
44318
44470
|
if (metric.value !== void 0) {
|
|
44319
44471
|
return metric.value;
|
|
@@ -44352,7 +44504,7 @@ var init_StatCard = __esm({
|
|
|
44352
44504
|
},
|
|
44353
44505
|
[]
|
|
44354
44506
|
);
|
|
44355
|
-
const schemaStats =
|
|
44507
|
+
const schemaStats = React77__default.useMemo(() => {
|
|
44356
44508
|
if (!metrics || metrics.length === 0) return null;
|
|
44357
44509
|
return metrics.map((metric) => ({
|
|
44358
44510
|
label: metric.label,
|
|
@@ -44360,7 +44512,7 @@ var init_StatCard = __esm({
|
|
|
44360
44512
|
format: metric.format
|
|
44361
44513
|
}));
|
|
44362
44514
|
}, [metrics, data, computeMetricValue]);
|
|
44363
|
-
const calculatedTrend =
|
|
44515
|
+
const calculatedTrend = React77__default.useMemo(() => {
|
|
44364
44516
|
if (manualTrend !== void 0) return manualTrend;
|
|
44365
44517
|
if (previousValue === void 0 || currentValue2 === void 0)
|
|
44366
44518
|
return void 0;
|
|
@@ -45000,8 +45152,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
45000
45152
|
] });
|
|
45001
45153
|
};
|
|
45002
45154
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
45003
|
-
const endRef =
|
|
45004
|
-
|
|
45155
|
+
const endRef = React77__default.useRef(null);
|
|
45156
|
+
React77__default.useEffect(() => {
|
|
45005
45157
|
if (!autoScroll) return;
|
|
45006
45158
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
45007
45159
|
}, [activities.length, autoScroll]);
|
|
@@ -45095,7 +45247,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
45095
45247
|
};
|
|
45096
45248
|
SubagentRichCard = ({ subagent }) => {
|
|
45097
45249
|
const { t } = useTranslate();
|
|
45098
|
-
const activities =
|
|
45250
|
+
const activities = React77__default.useMemo(
|
|
45099
45251
|
() => subagentMessagesToActivities(subagent.messages),
|
|
45100
45252
|
[subagent.messages]
|
|
45101
45253
|
);
|
|
@@ -45172,8 +45324,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
45172
45324
|
] });
|
|
45173
45325
|
};
|
|
45174
45326
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
45175
|
-
const endRef =
|
|
45176
|
-
|
|
45327
|
+
const endRef = React77__default.useRef(null);
|
|
45328
|
+
React77__default.useEffect(() => {
|
|
45177
45329
|
if (!autoScroll) return;
|
|
45178
45330
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
45179
45331
|
}, [messages.length, autoScroll]);
|
|
@@ -45608,7 +45760,7 @@ var init_Timeline = __esm({
|
|
|
45608
45760
|
}) => {
|
|
45609
45761
|
const { t } = useTranslate();
|
|
45610
45762
|
const entityData = entity ?? [];
|
|
45611
|
-
const items =
|
|
45763
|
+
const items = React77__default.useMemo(() => {
|
|
45612
45764
|
if (propItems) return propItems;
|
|
45613
45765
|
if (entityData.length === 0) return [];
|
|
45614
45766
|
return entityData.map((record, idx) => {
|
|
@@ -45710,7 +45862,7 @@ var init_Timeline = __esm({
|
|
|
45710
45862
|
}
|
|
45711
45863
|
});
|
|
45712
45864
|
function extractToastProps(children) {
|
|
45713
|
-
if (!
|
|
45865
|
+
if (!React77__default.isValidElement(children)) {
|
|
45714
45866
|
if (typeof children === "string") {
|
|
45715
45867
|
return { message: children };
|
|
45716
45868
|
}
|
|
@@ -45752,7 +45904,7 @@ var init_ToastSlot = __esm({
|
|
|
45752
45904
|
eventBus.emit(`${prefix}CLOSE`);
|
|
45753
45905
|
};
|
|
45754
45906
|
if (!isVisible) return null;
|
|
45755
|
-
const isCustomContent =
|
|
45907
|
+
const isCustomContent = React77__default.isValidElement(children) && !message;
|
|
45756
45908
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
45757
45909
|
Toast,
|
|
45758
45910
|
{
|
|
@@ -45848,6 +46000,7 @@ var init_component_registry_generated = __esm({
|
|
|
45848
46000
|
init_DocTOC();
|
|
45849
46001
|
init_DocumentViewer();
|
|
45850
46002
|
init_DrawGroup();
|
|
46003
|
+
init_DrawMesh();
|
|
45851
46004
|
init_DrawShape();
|
|
45852
46005
|
init_DrawShapeLayer();
|
|
45853
46006
|
init_DrawSprite();
|
|
@@ -46116,6 +46269,7 @@ var init_component_registry_generated = __esm({
|
|
|
46116
46269
|
"DocTOC": DocTOC,
|
|
46117
46270
|
"DocumentViewer": DocumentViewer,
|
|
46118
46271
|
"DrawGroup": DrawGroup,
|
|
46272
|
+
"DrawMesh": DrawMesh,
|
|
46119
46273
|
"DrawShape": DrawShape,
|
|
46120
46274
|
"DrawShapeLayer": DrawShapeLayer,
|
|
46121
46275
|
"DrawSprite": DrawSprite,
|
|
@@ -46325,7 +46479,7 @@ function SuspenseConfigProvider({
|
|
|
46325
46479
|
config,
|
|
46326
46480
|
children
|
|
46327
46481
|
}) {
|
|
46328
|
-
return
|
|
46482
|
+
return React77__default.createElement(
|
|
46329
46483
|
SuspenseConfigContext.Provider,
|
|
46330
46484
|
{ value: config },
|
|
46331
46485
|
children
|
|
@@ -46367,7 +46521,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
46367
46521
|
}
|
|
46368
46522
|
return { name: field, label: humanizeFieldName(field) };
|
|
46369
46523
|
}
|
|
46370
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
46524
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React77__default.isValidElement(field) && !(field instanceof Date)) {
|
|
46371
46525
|
const obj = field;
|
|
46372
46526
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
46373
46527
|
if (!fieldName) return field;
|
|
@@ -46839,7 +46993,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
46839
46993
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
46840
46994
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
46841
46995
|
}
|
|
46842
|
-
return /* @__PURE__ */ jsx(
|
|
46996
|
+
return /* @__PURE__ */ jsx(React77__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
46843
46997
|
}
|
|
46844
46998
|
if (!child || typeof child !== "object") return null;
|
|
46845
46999
|
const childId = `${parentId}-${index}`;
|
|
@@ -46896,14 +47050,14 @@ function isPatternConfig(value) {
|
|
|
46896
47050
|
if (value === null || value === void 0) return false;
|
|
46897
47051
|
if (typeof value !== "object") return false;
|
|
46898
47052
|
if (Array.isArray(value)) return false;
|
|
46899
|
-
if (
|
|
47053
|
+
if (React77__default.isValidElement(value)) return false;
|
|
46900
47054
|
if (value instanceof Date) return false;
|
|
46901
47055
|
if (typeof value === "function") return false;
|
|
46902
47056
|
const record = value;
|
|
46903
47057
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
46904
47058
|
}
|
|
46905
47059
|
function isPlainConfigObject(value) {
|
|
46906
|
-
if (
|
|
47060
|
+
if (React77__default.isValidElement(value)) return false;
|
|
46907
47061
|
if (value instanceof Date) return false;
|
|
46908
47062
|
const proto = Object.getPrototypeOf(value);
|
|
46909
47063
|
return proto === Object.prototype || proto === null;
|
|
@@ -47044,7 +47198,7 @@ function SlotContentRenderer({
|
|
|
47044
47198
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
47045
47199
|
const slotVal = restProps[slotKey];
|
|
47046
47200
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
47047
|
-
if (
|
|
47201
|
+
if (React77__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
47048
47202
|
const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
|
|
47049
47203
|
if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
47050
47204
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
@@ -47098,7 +47252,7 @@ function SlotContentRenderer({
|
|
|
47098
47252
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
47099
47253
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
47100
47254
|
const sample = resolvedItems[0];
|
|
47101
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
47255
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React77__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
47102
47256
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
47103
47257
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
47104
47258
|
}
|