@almadar/ui 5.138.0 → 5.140.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 +1472 -1262
- package/dist/avl/index.js +509 -299
- package/dist/{cn-CL0kdshO.d.cts → cn-DkGYzPOg.d.cts} +1 -1
- package/dist/{cn-CCaph5o9.d.ts → cn-Do5Ra3l3.d.ts} +1 -1
- package/dist/components/index.cjs +1451 -1241
- package/dist/components/index.d.cts +12 -5
- package/dist/components/index.d.ts +12 -5
- package/dist/components/index.js +494 -284
- package/dist/lib/drawable/three/index.cjs +6 -0
- package/dist/lib/drawable/three/index.d.cts +1 -1
- package/dist/lib/drawable/three/index.d.ts +1 -1
- package/dist/lib/drawable/three/index.js +6 -0
- package/dist/lib/index.d.cts +2 -2
- package/dist/lib/index.d.ts +2 -2
- package/dist/{paintDispatch-DXygiK7M.d.cts → paintDispatch-B5pPeSEp.d.cts} +74 -1
- package/dist/{paintDispatch-DXygiK7M.d.ts → paintDispatch-B5pPeSEp.d.ts} +74 -1
- package/dist/providers/index.cjs +1355 -1145
- package/dist/providers/index.js +484 -274
- package/dist/runtime/index.cjs +1333 -1123
- package/dist/runtime/index.js +489 -279
- 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 React76 from 'react';
|
|
3
|
+
import React76__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 = React76__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 = React76__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 = React76__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] = React76.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] = React76.useReducer((x) => x + 1, 0);
|
|
1588
|
+
const canvasRef = React76.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
|
+
React76.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 (React76__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 = React76__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 = React76__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] = React76__default.useState(value);
|
|
1843
|
+
const pendingEchoRef = React76__default.useRef(/* @__PURE__ */ new Set());
|
|
1844
|
+
React76__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 = React76__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 = React76__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 = React76__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 = React76__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 = React76__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 = React76__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 = React76__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
2481
2481
|
CardHeader.displayName = "CardHeader";
|
|
2482
|
-
CardTitle =
|
|
2482
|
+
CardTitle = React76__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 = React76__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 = React76__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 = React76__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 = React76__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] = React76__default.useState(false);
|
|
2811
|
+
React76__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 = React76__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 React76__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 React76__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 = React76__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 = React76__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] = React76__default.useState(value);
|
|
3472
|
+
React76__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 = React76.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] = React76.useState(
|
|
3666
3666
|
checked !== void 0 ? checked : defaultChecked
|
|
3667
3667
|
);
|
|
3668
|
-
|
|
3668
|
+
React76.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 React76__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 React76__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 = React76__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 = React76__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] = React76__default.useState(false);
|
|
4460
|
+
const timeoutRef = React76__default.useRef(null);
|
|
4461
|
+
const triggerRef = React76__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
|
+
React76__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 = React76__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 = React76__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 = React76__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 = React76__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 = React76__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 = React76__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 = React76__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 (React76__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 React76__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 React76__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 = React76__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 = React76__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(React76__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
12441
12441
|
StateNode,
|
|
12442
12442
|
{
|
|
12443
12443
|
state,
|
|
@@ -15014,8 +15014,8 @@ function MiniMap({
|
|
|
15014
15014
|
tileAssets,
|
|
15015
15015
|
unitAssets
|
|
15016
15016
|
}) {
|
|
15017
|
-
const canvasRef =
|
|
15018
|
-
const imgCacheRef =
|
|
15017
|
+
const canvasRef = React76.useRef(null);
|
|
15018
|
+
const imgCacheRef = React76.useRef(/* @__PURE__ */ new Map());
|
|
15019
15019
|
function loadImg(url) {
|
|
15020
15020
|
const cached = imgCacheRef.current.get(url);
|
|
15021
15021
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -15031,7 +15031,7 @@ function MiniMap({
|
|
|
15031
15031
|
imgCacheRef.current.set(url, img);
|
|
15032
15032
|
return null;
|
|
15033
15033
|
}
|
|
15034
|
-
|
|
15034
|
+
React76.useEffect(() => {
|
|
15035
15035
|
const canvas = canvasRef.current;
|
|
15036
15036
|
if (!canvas) return;
|
|
15037
15037
|
const ctx = canvas.getContext("2d");
|
|
@@ -15632,6 +15632,12 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
15632
15632
|
for (let i = 1; i < points.length; i++) ctx.lineTo(points[i].x, points[i].y);
|
|
15633
15633
|
if (closed) ctx.closePath();
|
|
15634
15634
|
};
|
|
15635
|
+
const toCanvasStyle = (style) => {
|
|
15636
|
+
if (typeof style === "string") return style;
|
|
15637
|
+
const g = style.kind === "linear" ? ctx.createLinearGradient(style.x1, style.y1, style.x2, style.y2) : ctx.createRadialGradient(style.cx, style.cy, 0, style.cx, style.cy, style.r);
|
|
15638
|
+
for (const stop of style.stops) g.addColorStop(stop.offset, stop.color);
|
|
15639
|
+
return g;
|
|
15640
|
+
};
|
|
15635
15641
|
return {
|
|
15636
15642
|
setViewport(width, height, dpr) {
|
|
15637
15643
|
vw = width;
|
|
@@ -15685,47 +15691,47 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
15685
15691
|
ctx.drawImage(img, dest.x, dest.y, dw, dh);
|
|
15686
15692
|
}
|
|
15687
15693
|
},
|
|
15688
|
-
fillRect(x, y, w, h,
|
|
15689
|
-
ctx.fillStyle =
|
|
15694
|
+
fillRect(x, y, w, h, style) {
|
|
15695
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
15690
15696
|
ctx.fillRect(x, y, w, h);
|
|
15691
15697
|
},
|
|
15692
|
-
strokeRect(x, y, w, h,
|
|
15693
|
-
ctx.strokeStyle =
|
|
15698
|
+
strokeRect(x, y, w, h, style, lineWidth = 1) {
|
|
15699
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
15694
15700
|
ctx.lineWidth = lineWidth;
|
|
15695
15701
|
ctx.strokeRect(x, y, w, h);
|
|
15696
15702
|
},
|
|
15697
|
-
fillPoly(points,
|
|
15703
|
+
fillPoly(points, style) {
|
|
15698
15704
|
if (points.length === 0) return;
|
|
15699
15705
|
tracePoly(points, true);
|
|
15700
|
-
ctx.fillStyle =
|
|
15706
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
15701
15707
|
ctx.fill();
|
|
15702
15708
|
},
|
|
15703
|
-
strokePoly(points,
|
|
15709
|
+
strokePoly(points, style, lineWidth = 1, closed = false) {
|
|
15704
15710
|
if (points.length === 0) return;
|
|
15705
15711
|
tracePoly(points, closed);
|
|
15706
|
-
ctx.strokeStyle =
|
|
15712
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
15707
15713
|
ctx.lineWidth = lineWidth;
|
|
15708
15714
|
ctx.stroke();
|
|
15709
15715
|
},
|
|
15710
|
-
fillEllipse(cx, cy, rx, ry,
|
|
15716
|
+
fillEllipse(cx, cy, rx, ry, style) {
|
|
15711
15717
|
ctx.beginPath();
|
|
15712
15718
|
ctx.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2);
|
|
15713
|
-
ctx.fillStyle =
|
|
15719
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
15714
15720
|
ctx.fill();
|
|
15715
15721
|
},
|
|
15716
|
-
strokeEllipse(cx, cy, rx, ry,
|
|
15722
|
+
strokeEllipse(cx, cy, rx, ry, style, lineWidth = 1) {
|
|
15717
15723
|
ctx.beginPath();
|
|
15718
15724
|
ctx.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2);
|
|
15719
|
-
ctx.strokeStyle =
|
|
15725
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
15720
15726
|
ctx.lineWidth = lineWidth;
|
|
15721
15727
|
ctx.stroke();
|
|
15722
15728
|
},
|
|
15723
|
-
fillPath(d,
|
|
15724
|
-
ctx.fillStyle =
|
|
15729
|
+
fillPath(d, style) {
|
|
15730
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
15725
15731
|
ctx.fill(new Path2D(d));
|
|
15726
15732
|
},
|
|
15727
|
-
strokePath(d,
|
|
15728
|
-
ctx.strokeStyle =
|
|
15733
|
+
strokePath(d, style, lineWidth = 1) {
|
|
15734
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
15729
15735
|
ctx.lineWidth = lineWidth;
|
|
15730
15736
|
ctx.stroke(new Path2D(d));
|
|
15731
15737
|
},
|
|
@@ -15861,6 +15867,21 @@ var init_projector = __esm({
|
|
|
15861
15867
|
function isValidScenePos(pos) {
|
|
15862
15868
|
return Number.isFinite(pos?.x) && Number.isFinite(pos?.y);
|
|
15863
15869
|
}
|
|
15870
|
+
function spriteRect(projector, node, natural) {
|
|
15871
|
+
const tw = projector.tileWidth;
|
|
15872
|
+
const fallbackW = projector.worldPixelDirect ? natural?.w ?? 0 : tw;
|
|
15873
|
+
const fallbackH = projector.worldPixelDirect ? natural?.h ?? 0 : tw;
|
|
15874
|
+
const w = node.width !== void 0 ? node.width * tw : fallbackW;
|
|
15875
|
+
const h = node.height !== void 0 ? node.height * tw : fallbackH;
|
|
15876
|
+
const anchor = node.anchor ?? "top-left";
|
|
15877
|
+
const p = projector.anchorPoint(node.position, anchor);
|
|
15878
|
+
return {
|
|
15879
|
+
x: anchor === "top-left" ? p.x : p.x - w / 2,
|
|
15880
|
+
y: anchor === "ground" ? p.y - h : anchor === "center" ? p.y - h / 2 : p.y,
|
|
15881
|
+
w,
|
|
15882
|
+
h
|
|
15883
|
+
};
|
|
15884
|
+
}
|
|
15864
15885
|
var init_contract = __esm({
|
|
15865
15886
|
"lib/drawable/contract.ts"() {
|
|
15866
15887
|
}
|
|
@@ -15875,16 +15896,11 @@ function paintFallbackSquare(painter, node, dctx, reason) {
|
|
|
15875
15896
|
warnMissingOnce(reason, node);
|
|
15876
15897
|
const tw = dctx.projector.tileWidth;
|
|
15877
15898
|
const natural = dctx.projector.worldPixelDirect ? FALLBACK_WORLD_PX : tw;
|
|
15878
|
-
const
|
|
15879
|
-
const h = node.height !== void 0 ? node.height * tw : natural;
|
|
15880
|
-
const anchor = node.anchor ?? "top-left";
|
|
15881
|
-
const p = dctx.projector.anchorPoint(node.position, anchor);
|
|
15882
|
-
const dx = anchor === "top-left" ? p.x : p.x - w / 2;
|
|
15883
|
-
const dy = anchor === "ground" ? p.y - h : anchor === "center" ? p.y - h / 2 : p.y;
|
|
15899
|
+
const rect = spriteRect(dctx.projector, node, { w: natural, h: natural });
|
|
15884
15900
|
painter.save();
|
|
15885
15901
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
15886
|
-
painter.fillRect(
|
|
15887
|
-
painter.strokeRect(
|
|
15902
|
+
painter.fillRect(rect.x, rect.y, rect.w, rect.h, "#9b8f7f");
|
|
15903
|
+
painter.strokeRect(rect.x, rect.y, rect.w, rect.h, "#5e564b", Math.max(1, tw / 32));
|
|
15888
15904
|
painter.restore();
|
|
15889
15905
|
}
|
|
15890
15906
|
function DrawSprite(_props) {
|
|
@@ -15921,15 +15937,10 @@ var init_DrawSprite = __esm({
|
|
|
15921
15937
|
}
|
|
15922
15938
|
src = { x: r.sx, y: r.sy, w: r.sw, h: r.sh };
|
|
15923
15939
|
}
|
|
15924
|
-
const
|
|
15925
|
-
const
|
|
15926
|
-
const
|
|
15927
|
-
const
|
|
15928
|
-
const h = node.height !== void 0 ? node.height * tw : fallbackH;
|
|
15929
|
-
const anchor = node.anchor ?? "top-left";
|
|
15930
|
-
const p = dctx.projector.anchorPoint(node.position, anchor);
|
|
15931
|
-
const dx = anchor === "top-left" ? p.x : p.x - w / 2;
|
|
15932
|
-
const dy = anchor === "ground" ? p.y - h : anchor === "center" ? p.y - h / 2 : p.y;
|
|
15940
|
+
const rect = spriteRect(dctx.projector, node, src ? { w: src.w, h: src.h } : { w: tex.width, h: tex.height });
|
|
15941
|
+
const { w, h } = rect;
|
|
15942
|
+
const dx = rect.x;
|
|
15943
|
+
const dy = rect.y;
|
|
15933
15944
|
painter.save();
|
|
15934
15945
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
15935
15946
|
if (node.shadow) painter.setShadow(node.shadow);
|
|
@@ -15951,25 +15962,145 @@ var init_DrawSprite = __esm({
|
|
|
15951
15962
|
};
|
|
15952
15963
|
}
|
|
15953
15964
|
});
|
|
15954
|
-
|
|
15955
|
-
|
|
15956
|
-
|
|
15965
|
+
var DrawableRegistryContext;
|
|
15966
|
+
var init_registry = __esm({
|
|
15967
|
+
"lib/drawable/registry.ts"() {
|
|
15968
|
+
DrawableRegistryContext = createContext(null);
|
|
15969
|
+
}
|
|
15970
|
+
});
|
|
15971
|
+
function isAnimatedShape(node) {
|
|
15972
|
+
return Boolean(node.animation && node.animation.durationMs > 0 && node.animation.keyframes.length > 0);
|
|
15973
|
+
}
|
|
15974
|
+
function applyShapeAnimation(node, timeMs) {
|
|
15975
|
+
const anim = node.animation;
|
|
15976
|
+
if (!anim || !(anim.durationMs > 0) || anim.keyframes.length === 0) return node;
|
|
15977
|
+
const frames = [...anim.keyframes].sort((a, b) => a.at - b.at);
|
|
15978
|
+
const cycle = timeMs / anim.durationMs;
|
|
15979
|
+
const t = anim.loop === false ? Math.min(cycle, 1) : cycle - Math.floor(cycle);
|
|
15980
|
+
const out = { ...node };
|
|
15981
|
+
const trackValue = (key) => {
|
|
15982
|
+
const defined = frames.filter((f3) => f3[key] !== void 0);
|
|
15983
|
+
if (defined.length === 0) return void 0;
|
|
15984
|
+
let prev;
|
|
15985
|
+
let next;
|
|
15986
|
+
for (const f3 of defined) {
|
|
15987
|
+
if (f3.at <= t) prev = f3;
|
|
15988
|
+
else if (!next) next = f3;
|
|
15989
|
+
}
|
|
15990
|
+
if (!prev) return defined[0][key];
|
|
15991
|
+
if (!next) return prev[key];
|
|
15992
|
+
const span = next.at - prev.at;
|
|
15993
|
+
const k = span > 0 ? (t - prev.at) / span : 1;
|
|
15994
|
+
const a = prev[key];
|
|
15995
|
+
const b = next[key];
|
|
15996
|
+
if (typeof a === "number" && typeof b === "number") return lerp(a, b, k);
|
|
15997
|
+
return a;
|
|
15998
|
+
};
|
|
15999
|
+
for (const key of NUMERIC_TRACKS) {
|
|
16000
|
+
const v = trackValue(key);
|
|
16001
|
+
if (v !== void 0) out[key] = v;
|
|
16002
|
+
}
|
|
16003
|
+
const fill = trackValue("fill");
|
|
16004
|
+
if (fill !== void 0) out.fill = fill;
|
|
16005
|
+
const stroke = trackValue("stroke");
|
|
16006
|
+
if (stroke !== void 0) out.stroke = stroke;
|
|
16007
|
+
const shadowFrames = frames.filter((f3) => f3.shadow !== void 0);
|
|
16008
|
+
if (shadowFrames.length > 0) {
|
|
16009
|
+
const sh = trackValue("shadow");
|
|
16010
|
+
if (sh !== void 0) {
|
|
16011
|
+
let prevSh;
|
|
16012
|
+
let nextSh;
|
|
16013
|
+
for (const f3 of shadowFrames) {
|
|
16014
|
+
if (f3.at <= t) prevSh = f3;
|
|
16015
|
+
else if (!nextSh) nextSh = f3;
|
|
16016
|
+
}
|
|
16017
|
+
if (prevSh?.shadow && nextSh?.shadow) {
|
|
16018
|
+
const span = nextSh.at - prevSh.at;
|
|
16019
|
+
const k = span > 0 ? (t - prevSh.at) / span : 1;
|
|
16020
|
+
out.shadow = { color: prevSh.shadow.color, blur: lerp(prevSh.shadow.blur, nextSh.shadow.blur, k) };
|
|
16021
|
+
} else {
|
|
16022
|
+
out.shadow = sh;
|
|
16023
|
+
}
|
|
16024
|
+
}
|
|
16025
|
+
}
|
|
16026
|
+
return out;
|
|
16027
|
+
}
|
|
16028
|
+
function gradientStyle(g, ox, oy, scale) {
|
|
16029
|
+
if (g.kind === "linear") {
|
|
16030
|
+
if (!g.from || !g.to) return void 0;
|
|
16031
|
+
return {
|
|
16032
|
+
kind: "linear",
|
|
16033
|
+
x1: ox + g.from.x * scale,
|
|
16034
|
+
y1: oy + g.from.y * scale,
|
|
16035
|
+
x2: ox + g.to.x * scale,
|
|
16036
|
+
y2: oy + g.to.y * scale,
|
|
16037
|
+
stops: g.stops
|
|
16038
|
+
};
|
|
16039
|
+
}
|
|
16040
|
+
if (!g.center || g.radius === void 0) return void 0;
|
|
16041
|
+
return {
|
|
16042
|
+
kind: "radial",
|
|
16043
|
+
cx: ox + g.center.x * scale,
|
|
16044
|
+
cy: oy + g.center.y * scale,
|
|
16045
|
+
r: g.radius * scale,
|
|
16046
|
+
stops: g.stops
|
|
16047
|
+
};
|
|
16048
|
+
}
|
|
16049
|
+
function DrawShape(props) {
|
|
16050
|
+
const register = useContext(DrawableRegistryContext);
|
|
16051
|
+
if (register) {
|
|
16052
|
+
const { opacity, ...rest } = props;
|
|
16053
|
+
const node = {
|
|
16054
|
+
...rest,
|
|
16055
|
+
type: "draw-shape",
|
|
16056
|
+
...opacity !== void 0 && opacity > 0 ? { opacity } : {}
|
|
16057
|
+
};
|
|
16058
|
+
register(node);
|
|
16059
|
+
}
|
|
15957
16060
|
return null;
|
|
15958
16061
|
}
|
|
15959
|
-
var paintShape;
|
|
16062
|
+
var NUMERIC_TRACKS, lerp, paintShape;
|
|
15960
16063
|
var init_DrawShape = __esm({
|
|
15961
16064
|
"components/game/atoms/DrawShape.tsx"() {
|
|
15962
16065
|
"use client";
|
|
15963
16066
|
init_contract();
|
|
15964
|
-
|
|
16067
|
+
init_registry();
|
|
16068
|
+
NUMERIC_TRACKS = [
|
|
16069
|
+
"offsetX",
|
|
16070
|
+
"offsetY",
|
|
16071
|
+
"rotate",
|
|
16072
|
+
"opacity",
|
|
16073
|
+
"radiusX",
|
|
16074
|
+
"radiusY",
|
|
16075
|
+
"width",
|
|
16076
|
+
"height",
|
|
16077
|
+
"strokeWidth"
|
|
16078
|
+
];
|
|
16079
|
+
lerp = (a, b, k) => a + (b - a) * k;
|
|
16080
|
+
paintShape = (painter, rawNode, dctx) => {
|
|
16081
|
+
const node = dctx.time > 0 ? applyShapeAnimation(rawNode, dctx.time) : rawNode;
|
|
15965
16082
|
if (!isValidScenePos(node.position)) return;
|
|
15966
16083
|
painter.save();
|
|
15967
16084
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
16085
|
+
const origin = dctx.projector.project(node.position);
|
|
16086
|
+
const tileWidth = dctx.projector.tileWidth;
|
|
16087
|
+
if (node.rotate) {
|
|
16088
|
+
const pivot = node.pivot ?? { x: 0.5, y: 0.5 };
|
|
16089
|
+
const px = origin.x + pivot.x * tileWidth;
|
|
16090
|
+
const py = origin.y + pivot.y * tileWidth;
|
|
16091
|
+
painter.translate(px, py);
|
|
16092
|
+
painter.rotate(node.rotate);
|
|
16093
|
+
painter.translate(-px, -py);
|
|
16094
|
+
}
|
|
16095
|
+
if (node.shadow) painter.setShadow({ color: node.shadow.color, blur: node.shadow.blur * tileWidth });
|
|
16096
|
+
const fill = node.fill === "none" ? void 0 : node.fill;
|
|
16097
|
+
const stroke = node.stroke === "none" ? void 0 : node.stroke;
|
|
16098
|
+
const pxFill = node.gradient ? gradientStyle(node.gradient, origin.x, origin.y, tileWidth) ?? fill : fill;
|
|
15968
16099
|
switch (node.shape) {
|
|
15969
16100
|
case "cell": {
|
|
15970
16101
|
const pts = dctx.projector.cellPath(node.position);
|
|
15971
|
-
if (
|
|
15972
|
-
if (
|
|
16102
|
+
if (pxFill) painter.fillPoly(pts, pxFill);
|
|
16103
|
+
if (stroke) painter.strokePoly(pts, stroke, node.strokeWidth ?? 1, true);
|
|
15973
16104
|
break;
|
|
15974
16105
|
}
|
|
15975
16106
|
case "rect": {
|
|
@@ -15979,8 +16110,8 @@ var init_DrawShape = __esm({
|
|
|
15979
16110
|
const y = p.y + (node.offsetY ?? 0) * tw;
|
|
15980
16111
|
const w = (node.width ?? 0) * tw;
|
|
15981
16112
|
const h = (node.height ?? 0) * tw;
|
|
15982
|
-
if (
|
|
15983
|
-
if (
|
|
16113
|
+
if (pxFill) painter.fillRect(x, y, w, h, pxFill);
|
|
16114
|
+
if (stroke) painter.strokeRect(x, y, w, h, stroke, node.strokeWidth ?? 1);
|
|
15984
16115
|
break;
|
|
15985
16116
|
}
|
|
15986
16117
|
case "ellipse": {
|
|
@@ -15990,26 +16121,26 @@ var init_DrawShape = __esm({
|
|
|
15990
16121
|
const cy = p.y + (node.offsetY ?? 0) * tw;
|
|
15991
16122
|
const rx = (node.radiusX ?? 0) * tw;
|
|
15992
16123
|
const ry = (node.radiusY ?? rx) * tw;
|
|
15993
|
-
if (
|
|
15994
|
-
if (
|
|
16124
|
+
if (pxFill) painter.fillEllipse(cx, cy, rx, ry, pxFill);
|
|
16125
|
+
if (stroke) painter.strokeEllipse(cx, cy, rx, ry, stroke, node.strokeWidth ?? 1);
|
|
15995
16126
|
break;
|
|
15996
16127
|
}
|
|
15997
16128
|
case "poly": {
|
|
15998
|
-
const
|
|
15999
|
-
|
|
16000
|
-
|
|
16001
|
-
|
|
16002
|
-
if (
|
|
16129
|
+
const pts = (node.points ?? []).map((pt) => ({
|
|
16130
|
+
x: origin.x + ((node.offsetX ?? 0) + pt.x) * tileWidth,
|
|
16131
|
+
y: origin.y + ((node.offsetY ?? 0) + pt.y) * tileWidth
|
|
16132
|
+
}));
|
|
16133
|
+
if (pxFill) painter.fillPoly(pts, pxFill);
|
|
16134
|
+
if (stroke) painter.strokePoly(pts, stroke, node.strokeWidth ?? 1, true);
|
|
16003
16135
|
break;
|
|
16004
16136
|
}
|
|
16005
16137
|
case "path": {
|
|
16006
16138
|
if (!node.d) break;
|
|
16007
|
-
|
|
16008
|
-
|
|
16009
|
-
|
|
16010
|
-
painter.
|
|
16011
|
-
if (
|
|
16012
|
-
if (node.stroke) painter.strokePath(node.d, node.stroke, (node.strokeWidth ?? 1) / tw);
|
|
16139
|
+
painter.translate(origin.x + (node.offsetX ?? 0) * tileWidth, origin.y + (node.offsetY ?? 0) * tileWidth);
|
|
16140
|
+
painter.scale(tileWidth, tileWidth);
|
|
16141
|
+
const localFill = node.gradient ? gradientStyle(node.gradient, 0, 0, 1) ?? fill : fill;
|
|
16142
|
+
if (localFill) painter.fillPath(node.d, localFill);
|
|
16143
|
+
if (stroke) painter.strokePath(node.d, stroke, (node.strokeWidth ?? 1) / tileWidth);
|
|
16013
16144
|
break;
|
|
16014
16145
|
}
|
|
16015
16146
|
}
|
|
@@ -16145,12 +16276,18 @@ function collectDrawnItems(nodes) {
|
|
|
16145
16276
|
for (const n of nodes) {
|
|
16146
16277
|
switch (n.type) {
|
|
16147
16278
|
case "draw-sprite":
|
|
16279
|
+
if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id, anchor: n.anchor, width: n.width, height: n.height });
|
|
16280
|
+
break;
|
|
16148
16281
|
case "draw-shape":
|
|
16149
16282
|
case "draw-text":
|
|
16150
16283
|
case "draw-group":
|
|
16151
16284
|
if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id });
|
|
16152
16285
|
break;
|
|
16153
16286
|
case "draw-sprite-layer":
|
|
16287
|
+
for (const it of n.items) {
|
|
16288
|
+
if (isValidScenePos(it.position)) out.push({ pos: it.position, id: it.id, anchor: it.anchor, width: it.width, height: it.height });
|
|
16289
|
+
}
|
|
16290
|
+
break;
|
|
16154
16291
|
case "draw-shape-layer":
|
|
16155
16292
|
case "draw-text-layer":
|
|
16156
16293
|
for (const it of n.items) {
|
|
@@ -16168,6 +16305,15 @@ function buildHitIndex(items) {
|
|
|
16168
16305
|
}
|
|
16169
16306
|
return m;
|
|
16170
16307
|
}
|
|
16308
|
+
function hitTestSprites(items, projector, point) {
|
|
16309
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
16310
|
+
const it = items[i];
|
|
16311
|
+
if (it.id === void 0) continue;
|
|
16312
|
+
const r = spriteRect(projector, { position: it.pos, anchor: it.anchor, width: it.width, height: it.height });
|
|
16313
|
+
if (point.x >= r.x && point.x <= r.x + r.w && point.y >= r.y && point.y <= r.y + r.h) return it.id;
|
|
16314
|
+
}
|
|
16315
|
+
return void 0;
|
|
16316
|
+
}
|
|
16171
16317
|
var init_hitTest = __esm({
|
|
16172
16318
|
"lib/drawable/hitTest.ts"() {
|
|
16173
16319
|
init_contract();
|
|
@@ -16196,9 +16342,16 @@ function Canvas2D({
|
|
|
16196
16342
|
showMinimap = true,
|
|
16197
16343
|
followTarget,
|
|
16198
16344
|
cameraPos,
|
|
16199
|
-
bgColor
|
|
16345
|
+
bgColor,
|
|
16346
|
+
children
|
|
16200
16347
|
}) {
|
|
16201
16348
|
const instanceId = useMemo(() => Math.random().toString(36).slice(2, 8), []);
|
|
16349
|
+
const childDrawablesRef = useRef([]);
|
|
16350
|
+
childDrawablesRef.current = [];
|
|
16351
|
+
const registerChildDrawable = useCallback((node) => {
|
|
16352
|
+
childDrawablesRef.current.push(node);
|
|
16353
|
+
}, []);
|
|
16354
|
+
const hasJsxChildren = React76.Children.count(children) > 0;
|
|
16202
16355
|
function isDrawableLayer(node) {
|
|
16203
16356
|
return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
|
|
16204
16357
|
}
|
|
@@ -16347,11 +16500,24 @@ function Canvas2D({
|
|
|
16347
16500
|
}, [showMinimap, scenePositions]);
|
|
16348
16501
|
const miniMapWidth = gridExtent.width || 10;
|
|
16349
16502
|
const miniMapHeight = gridExtent.height || 10;
|
|
16350
|
-
const
|
|
16503
|
+
const drawableIsAnimated = (node) => {
|
|
16504
|
+
if (node.type === "draw-shape") return isAnimatedShape(node);
|
|
16505
|
+
if (node.type === "draw-group") return Array.isArray(node.items) && node.items.some(drawableIsAnimated);
|
|
16506
|
+
if (node.type === "draw-shape-layer") return Array.isArray(node.items) && node.items.some(isAnimatedShape);
|
|
16507
|
+
return false;
|
|
16508
|
+
};
|
|
16509
|
+
const animRafRef = useRef(0);
|
|
16510
|
+
const drawTimeRef = useRef(() => void 0);
|
|
16511
|
+
const draw = useCallback((timeMs = 0) => {
|
|
16351
16512
|
const canvas = canvasRef.current;
|
|
16352
16513
|
if (!canvas) return;
|
|
16353
16514
|
const ctx = canvas.getContext("2d");
|
|
16354
16515
|
if (!ctx) return;
|
|
16516
|
+
const scheduleAnimation = (nodes) => {
|
|
16517
|
+
if (!nodes.some(drawableIsAnimated)) return;
|
|
16518
|
+
cancelAnimationFrame(animRafRef.current);
|
|
16519
|
+
animRafRef.current = requestAnimationFrame(() => drawTimeRef.current(performance.now()));
|
|
16520
|
+
};
|
|
16355
16521
|
const dpr = window.devicePixelRatio || 1;
|
|
16356
16522
|
canvas.width = viewportSize.width * dpr;
|
|
16357
16523
|
canvas.height = viewportSize.height * dpr;
|
|
@@ -16381,7 +16547,29 @@ function Canvas2D({
|
|
|
16381
16547
|
ctx.fillStyle = bgColor ?? BACKGROUND_FALLBACK_COLOR;
|
|
16382
16548
|
ctx.fillRect(0, 0, viewportSize.width, viewportSize.height);
|
|
16383
16549
|
}
|
|
16384
|
-
if (!drawables || drawables.length === 0)
|
|
16550
|
+
if (!drawables || drawables.length === 0) {
|
|
16551
|
+
const childDrawables = childDrawablesRef.current;
|
|
16552
|
+
if (childDrawables.length === 0) return;
|
|
16553
|
+
const cam0 = cameraRef.current;
|
|
16554
|
+
if (camera !== "follow" && dragDistance() === 0) {
|
|
16555
|
+
const focus = cameraPos ?? defaultGridFocus;
|
|
16556
|
+
if (focus) {
|
|
16557
|
+
const p = projector.anchorPoint(focus, "center");
|
|
16558
|
+
cam0.x = p.x - viewportSize.width / 2;
|
|
16559
|
+
cam0.y = p.y - viewportSize.height / 2;
|
|
16560
|
+
}
|
|
16561
|
+
}
|
|
16562
|
+
const painter0 = createWebPainter(ctx, bumpAtlas);
|
|
16563
|
+
painter0.save();
|
|
16564
|
+
painter0.translate(viewportSize.width / 2, viewportSize.height / 2);
|
|
16565
|
+
painter0.scale(cam0.zoom, cam0.zoom);
|
|
16566
|
+
painter0.translate(-viewportSize.width / 2 - cam0.x, -viewportSize.height / 2 - cam0.y);
|
|
16567
|
+
const dctx0 = { projector, time: timeMs, invalidate: bumpAtlas };
|
|
16568
|
+
for (const node of childDrawables) paintDrawable(painter0, node, dctx0);
|
|
16569
|
+
painter0.restore();
|
|
16570
|
+
scheduleAnimation(childDrawables);
|
|
16571
|
+
return;
|
|
16572
|
+
}
|
|
16385
16573
|
const cam = cameraRef.current;
|
|
16386
16574
|
if (camera !== "follow" && dragDistance() === 0) {
|
|
16387
16575
|
const focus = cameraPos ?? defaultGridFocus;
|
|
@@ -16399,10 +16587,15 @@ function Canvas2D({
|
|
|
16399
16587
|
painter.translate(viewportSize.width / 2, viewportSize.height / 2);
|
|
16400
16588
|
painter.scale(cam.zoom, cam.zoom);
|
|
16401
16589
|
painter.translate(-viewportSize.width / 2 - cam.x, -viewportSize.height / 2 - cam.y);
|
|
16402
|
-
const dctx = { projector, time:
|
|
16590
|
+
const dctx = { projector, time: timeMs, invalidate: bumpAtlas };
|
|
16403
16591
|
for (const node of drawables) paintDrawable(painter, node, dctx);
|
|
16404
16592
|
painter.restore();
|
|
16593
|
+
scheduleAnimation(drawables);
|
|
16405
16594
|
}, [viewportSize, backgroundImage, bgColor, drawables, projector, cameraRef, bumpAtlas, getImage, cameraPos, defaultGridFocus, camera, dragDistance]);
|
|
16595
|
+
useEffect(() => {
|
|
16596
|
+
drawTimeRef.current = draw;
|
|
16597
|
+
}, [draw]);
|
|
16598
|
+
useEffect(() => () => cancelAnimationFrame(animRafRef.current), []);
|
|
16406
16599
|
useEffect(() => {
|
|
16407
16600
|
if (camera !== "follow" || !followTarget) return;
|
|
16408
16601
|
const p = projector.anchorPoint(followTarget, "center");
|
|
@@ -16465,6 +16658,11 @@ function Canvas2D({
|
|
|
16465
16658
|
if (dragDistance() > 5) return;
|
|
16466
16659
|
if (!canvasRef.current || !tileClickEvent && !unitClickEvent) return;
|
|
16467
16660
|
const world = screenToWorld(e.clientX, e.clientY, canvasRef.current, viewportSize);
|
|
16661
|
+
const spriteHit = unitClickEvent ? hitTestSprites(drawnItems, projector, world) : void 0;
|
|
16662
|
+
if (spriteHit !== void 0 && unitClickEvent) {
|
|
16663
|
+
eventBus.emit(`UI:${unitClickEvent}`, { unitId: spriteHit });
|
|
16664
|
+
return;
|
|
16665
|
+
}
|
|
16468
16666
|
const adjustedX = world.x - scaledTileWidth / 2;
|
|
16469
16667
|
const adjustedY = squareGrid ? world.y - scaledTileWidth / 2 : world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
16470
16668
|
const isoPos = unproject(adjustedX, adjustedY);
|
|
@@ -16474,7 +16672,7 @@ function Canvas2D({
|
|
|
16474
16672
|
} else if (tileClickEvent) {
|
|
16475
16673
|
eventBus.emit(`UI:${tileClickEvent}`, { x: isoPos.x, y: isoPos.y });
|
|
16476
16674
|
}
|
|
16477
|
-
}, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, hitIndex, tileClickEvent, unitClickEvent, eventBus]);
|
|
16675
|
+
}, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, hitIndex, drawnItems, projector, tileClickEvent, unitClickEvent, eventBus]);
|
|
16478
16676
|
const handleCanvasPointerLeave = useCallback(() => {
|
|
16479
16677
|
handleMouseLeave();
|
|
16480
16678
|
if (tileLeaveEvent) eventBus.emit(`UI:${tileLeaveEvent}`, {});
|
|
@@ -16544,7 +16742,7 @@ function Canvas2D({
|
|
|
16544
16742
|
/* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-muted-foreground", children: t("canvas.loadingMessage") || "Loading\u2026" })
|
|
16545
16743
|
] }) });
|
|
16546
16744
|
}
|
|
16547
|
-
if (!drawables || drawables.length === 0) {
|
|
16745
|
+
if ((!drawables || drawables.length === 0) && !hasJsxChildren) {
|
|
16548
16746
|
return /* @__PURE__ */ jsx(
|
|
16549
16747
|
Box,
|
|
16550
16748
|
{
|
|
@@ -16558,7 +16756,7 @@ function Canvas2D({
|
|
|
16558
16756
|
}
|
|
16559
16757
|
);
|
|
16560
16758
|
}
|
|
16561
|
-
return /* @__PURE__ */ jsxs(
|
|
16759
|
+
return /* @__PURE__ */ jsx(DrawableRegistryContext.Provider, { value: registerChildDrawable, children: /* @__PURE__ */ jsxs(
|
|
16562
16760
|
Box,
|
|
16563
16761
|
{
|
|
16564
16762
|
ref: containerRef,
|
|
@@ -16619,10 +16817,11 @@ function Canvas2D({
|
|
|
16619
16817
|
mapWidth: miniMapWidth,
|
|
16620
16818
|
mapHeight: miniMapHeight
|
|
16621
16819
|
}
|
|
16622
|
-
) })
|
|
16820
|
+
) }),
|
|
16821
|
+
hasJsxChildren && /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children })
|
|
16623
16822
|
]
|
|
16624
16823
|
}
|
|
16625
|
-
);
|
|
16824
|
+
) });
|
|
16626
16825
|
}
|
|
16627
16826
|
var canvas2DLog;
|
|
16628
16827
|
var init_Canvas2D = __esm({
|
|
@@ -16644,6 +16843,8 @@ var init_Canvas2D = __esm({
|
|
|
16644
16843
|
init_webPainter2d();
|
|
16645
16844
|
init_projector();
|
|
16646
16845
|
init_paintDispatch();
|
|
16846
|
+
init_DrawShape();
|
|
16847
|
+
init_registry();
|
|
16647
16848
|
init_hitTest();
|
|
16648
16849
|
init_isometric();
|
|
16649
16850
|
canvas2DLog = createLogger("almadar:ui:game-canvas");
|
|
@@ -16685,7 +16886,8 @@ function Canvas({
|
|
|
16685
16886
|
tileLeaveEvent,
|
|
16686
16887
|
featureClickEvent,
|
|
16687
16888
|
keyMap,
|
|
16688
|
-
keyUpMap
|
|
16889
|
+
keyUpMap,
|
|
16890
|
+
children
|
|
16689
16891
|
}) {
|
|
16690
16892
|
canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
|
|
16691
16893
|
const zoom = camera?.zoom;
|
|
@@ -16738,7 +16940,8 @@ function Canvas({
|
|
|
16738
16940
|
tileHoverEvent,
|
|
16739
16941
|
tileLeaveEvent,
|
|
16740
16942
|
keyMap,
|
|
16741
|
-
keyUpMap
|
|
16943
|
+
keyUpMap,
|
|
16944
|
+
...children !== void 0 ? { children } : {}
|
|
16742
16945
|
}
|
|
16743
16946
|
);
|
|
16744
16947
|
}
|
|
@@ -19021,9 +19224,9 @@ function ControlButton({
|
|
|
19021
19224
|
className
|
|
19022
19225
|
}) {
|
|
19023
19226
|
const eventBus = useEventBus();
|
|
19024
|
-
const [isPressed, setIsPressed] =
|
|
19227
|
+
const [isPressed, setIsPressed] = React76.useState(false);
|
|
19025
19228
|
const actualPressed = pressed ?? isPressed;
|
|
19026
|
-
const handlePointerDown =
|
|
19229
|
+
const handlePointerDown = React76.useCallback(
|
|
19027
19230
|
(e) => {
|
|
19028
19231
|
e.preventDefault();
|
|
19029
19232
|
if (disabled) return;
|
|
@@ -19033,7 +19236,7 @@ function ControlButton({
|
|
|
19033
19236
|
},
|
|
19034
19237
|
[disabled, pressEvent, eventBus, onPress]
|
|
19035
19238
|
);
|
|
19036
|
-
const handlePointerUp =
|
|
19239
|
+
const handlePointerUp = React76.useCallback(
|
|
19037
19240
|
(e) => {
|
|
19038
19241
|
e.preventDefault();
|
|
19039
19242
|
if (disabled) return;
|
|
@@ -19043,7 +19246,7 @@ function ControlButton({
|
|
|
19043
19246
|
},
|
|
19044
19247
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
19045
19248
|
);
|
|
19046
|
-
const handlePointerLeave =
|
|
19249
|
+
const handlePointerLeave = React76.useCallback(
|
|
19047
19250
|
(e) => {
|
|
19048
19251
|
if (isPressed) {
|
|
19049
19252
|
setIsPressed(false);
|
|
@@ -19131,8 +19334,8 @@ function ControlGrid({
|
|
|
19131
19334
|
className
|
|
19132
19335
|
}) {
|
|
19133
19336
|
const eventBus = useEventBus();
|
|
19134
|
-
const [active, setActive] =
|
|
19135
|
-
const handlePress =
|
|
19337
|
+
const [active, setActive] = React76.useState(/* @__PURE__ */ new Set());
|
|
19338
|
+
const handlePress = React76.useCallback(
|
|
19136
19339
|
(id) => {
|
|
19137
19340
|
setActive((prev) => new Set(prev).add(id));
|
|
19138
19341
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -19146,7 +19349,7 @@ function ControlGrid({
|
|
|
19146
19349
|
},
|
|
19147
19350
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
19148
19351
|
);
|
|
19149
|
-
const handleRelease =
|
|
19352
|
+
const handleRelease = React76.useCallback(
|
|
19150
19353
|
(id) => {
|
|
19151
19354
|
setActive((prev) => {
|
|
19152
19355
|
const next = new Set(prev);
|
|
@@ -20384,8 +20587,8 @@ var init_Menu = __esm({
|
|
|
20384
20587
|
"bottom-end": "bottom-start"
|
|
20385
20588
|
};
|
|
20386
20589
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
20387
|
-
const triggerChild =
|
|
20388
|
-
const triggerElement =
|
|
20590
|
+
const triggerChild = React76__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
20591
|
+
const triggerElement = React76__default.cloneElement(
|
|
20389
20592
|
triggerChild,
|
|
20390
20593
|
{
|
|
20391
20594
|
ref: triggerRef,
|
|
@@ -20480,14 +20683,14 @@ function useDataDnd(args) {
|
|
|
20480
20683
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
20481
20684
|
const enabled = isZone || Boolean(dndRoot);
|
|
20482
20685
|
const eventBus = useEventBus();
|
|
20483
|
-
const parentRoot =
|
|
20686
|
+
const parentRoot = React76__default.useContext(RootCtx);
|
|
20484
20687
|
const isRoot = enabled && parentRoot === null;
|
|
20485
|
-
const zoneId =
|
|
20688
|
+
const zoneId = React76__default.useId();
|
|
20486
20689
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
20487
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
20488
|
-
const optimisticOrdersRef =
|
|
20690
|
+
const [optimisticOrders, setOptimisticOrders] = React76__default.useState(() => /* @__PURE__ */ new Map());
|
|
20691
|
+
const optimisticOrdersRef = React76__default.useRef(optimisticOrders);
|
|
20489
20692
|
optimisticOrdersRef.current = optimisticOrders;
|
|
20490
|
-
const clearOptimisticOrder =
|
|
20693
|
+
const clearOptimisticOrder = React76__default.useCallback((group) => {
|
|
20491
20694
|
setOptimisticOrders((prev) => {
|
|
20492
20695
|
if (!prev.has(group)) return prev;
|
|
20493
20696
|
const next = new Map(prev);
|
|
@@ -20512,7 +20715,7 @@ function useDataDnd(args) {
|
|
|
20512
20715
|
const raw = it[dndItemIdField];
|
|
20513
20716
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
20514
20717
|
}).join("|");
|
|
20515
|
-
const itemIds =
|
|
20718
|
+
const itemIds = React76__default.useMemo(
|
|
20516
20719
|
() => orderedItems.map((it, idx) => {
|
|
20517
20720
|
const raw = it[dndItemIdField];
|
|
20518
20721
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -20523,7 +20726,7 @@ function useDataDnd(args) {
|
|
|
20523
20726
|
const raw = it[dndItemIdField];
|
|
20524
20727
|
return raw != null ? String(raw) : `__${idx}`;
|
|
20525
20728
|
}).join("|");
|
|
20526
|
-
|
|
20729
|
+
React76__default.useEffect(() => {
|
|
20527
20730
|
const root = isRoot ? null : parentRoot;
|
|
20528
20731
|
if (root) {
|
|
20529
20732
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -20531,20 +20734,20 @@ function useDataDnd(args) {
|
|
|
20531
20734
|
clearOptimisticOrder(ownGroup);
|
|
20532
20735
|
}
|
|
20533
20736
|
}, [itemsContentSig, ownGroup]);
|
|
20534
|
-
const zonesRef =
|
|
20535
|
-
const registerZone =
|
|
20737
|
+
const zonesRef = React76__default.useRef(/* @__PURE__ */ new Map());
|
|
20738
|
+
const registerZone = React76__default.useCallback((zoneId2, meta2) => {
|
|
20536
20739
|
zonesRef.current.set(zoneId2, meta2);
|
|
20537
20740
|
}, []);
|
|
20538
|
-
const unregisterZone =
|
|
20741
|
+
const unregisterZone = React76__default.useCallback((zoneId2) => {
|
|
20539
20742
|
zonesRef.current.delete(zoneId2);
|
|
20540
20743
|
}, []);
|
|
20541
|
-
const [activeDrag, setActiveDrag] =
|
|
20542
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
20543
|
-
const meta =
|
|
20744
|
+
const [activeDrag, setActiveDrag] = React76__default.useState(null);
|
|
20745
|
+
const [overZoneGroup, setOverZoneGroup] = React76__default.useState(null);
|
|
20746
|
+
const meta = React76__default.useMemo(
|
|
20544
20747
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
20545
20748
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
20546
20749
|
);
|
|
20547
|
-
|
|
20750
|
+
React76__default.useEffect(() => {
|
|
20548
20751
|
const target = isRoot ? null : parentRoot;
|
|
20549
20752
|
if (!target) {
|
|
20550
20753
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -20563,7 +20766,7 @@ function useDataDnd(args) {
|
|
|
20563
20766
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
20564
20767
|
const sensors = useAlmadarDndSensors(true);
|
|
20565
20768
|
const collisionDetection = almadarDndCollisionDetection;
|
|
20566
|
-
const findZoneByItem =
|
|
20769
|
+
const findZoneByItem = React76__default.useCallback(
|
|
20567
20770
|
(id) => {
|
|
20568
20771
|
for (const z of zonesRef.current.values()) {
|
|
20569
20772
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -20572,7 +20775,7 @@ function useDataDnd(args) {
|
|
|
20572
20775
|
},
|
|
20573
20776
|
[]
|
|
20574
20777
|
);
|
|
20575
|
-
|
|
20778
|
+
React76__default.useCallback(
|
|
20576
20779
|
(group) => {
|
|
20577
20780
|
for (const z of zonesRef.current.values()) {
|
|
20578
20781
|
if (z.group === group) return z;
|
|
@@ -20581,7 +20784,7 @@ function useDataDnd(args) {
|
|
|
20581
20784
|
},
|
|
20582
20785
|
[]
|
|
20583
20786
|
);
|
|
20584
|
-
const handleDragEnd =
|
|
20787
|
+
const handleDragEnd = React76__default.useCallback(
|
|
20585
20788
|
(event) => {
|
|
20586
20789
|
const { active, over } = event;
|
|
20587
20790
|
const activeIdStr = String(active.id);
|
|
@@ -20672,8 +20875,8 @@ function useDataDnd(args) {
|
|
|
20672
20875
|
},
|
|
20673
20876
|
[eventBus]
|
|
20674
20877
|
);
|
|
20675
|
-
const sortableData =
|
|
20676
|
-
const SortableItem =
|
|
20878
|
+
const sortableData = React76__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
20879
|
+
const SortableItem = React76__default.useCallback(
|
|
20677
20880
|
({ id, children }) => {
|
|
20678
20881
|
const {
|
|
20679
20882
|
attributes,
|
|
@@ -20713,7 +20916,7 @@ function useDataDnd(args) {
|
|
|
20713
20916
|
id: droppableId,
|
|
20714
20917
|
data: sortableData
|
|
20715
20918
|
});
|
|
20716
|
-
const ctx =
|
|
20919
|
+
const ctx = React76__default.useContext(RootCtx);
|
|
20717
20920
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
20718
20921
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
20719
20922
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -20728,7 +20931,7 @@ function useDataDnd(args) {
|
|
|
20728
20931
|
showForeignPlaceholder,
|
|
20729
20932
|
ctxAvailable: ctx != null
|
|
20730
20933
|
});
|
|
20731
|
-
|
|
20934
|
+
React76__default.useEffect(() => {
|
|
20732
20935
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
20733
20936
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
20734
20937
|
return /* @__PURE__ */ jsx(
|
|
@@ -20742,11 +20945,11 @@ function useDataDnd(args) {
|
|
|
20742
20945
|
}
|
|
20743
20946
|
);
|
|
20744
20947
|
};
|
|
20745
|
-
const rootContextValue =
|
|
20948
|
+
const rootContextValue = React76__default.useMemo(
|
|
20746
20949
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
20747
20950
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
20748
20951
|
);
|
|
20749
|
-
const handleDragStart =
|
|
20952
|
+
const handleDragStart = React76__default.useCallback((event) => {
|
|
20750
20953
|
const sourceZone = findZoneByItem(event.active.id);
|
|
20751
20954
|
const rect = event.active.rect.current.initial;
|
|
20752
20955
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -20765,7 +20968,7 @@ function useDataDnd(args) {
|
|
|
20765
20968
|
isRoot
|
|
20766
20969
|
});
|
|
20767
20970
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
20768
|
-
const handleDragOver =
|
|
20971
|
+
const handleDragOver = React76__default.useCallback((event) => {
|
|
20769
20972
|
const { active, over } = event;
|
|
20770
20973
|
const overData = over?.data?.current;
|
|
20771
20974
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -20835,7 +21038,7 @@ function useDataDnd(args) {
|
|
|
20835
21038
|
return next;
|
|
20836
21039
|
});
|
|
20837
21040
|
}, []);
|
|
20838
|
-
const handleDragCancel =
|
|
21041
|
+
const handleDragCancel = React76__default.useCallback((event) => {
|
|
20839
21042
|
setActiveDrag(null);
|
|
20840
21043
|
setOverZoneGroup(null);
|
|
20841
21044
|
dndLog.warn("dragCancel", {
|
|
@@ -20843,12 +21046,12 @@ function useDataDnd(args) {
|
|
|
20843
21046
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
20844
21047
|
});
|
|
20845
21048
|
}, []);
|
|
20846
|
-
const handleDragEndWithCleanup =
|
|
21049
|
+
const handleDragEndWithCleanup = React76__default.useCallback((event) => {
|
|
20847
21050
|
handleDragEnd(event);
|
|
20848
21051
|
setActiveDrag(null);
|
|
20849
21052
|
setOverZoneGroup(null);
|
|
20850
21053
|
}, [handleDragEnd]);
|
|
20851
|
-
const wrapContainer =
|
|
21054
|
+
const wrapContainer = React76__default.useCallback(
|
|
20852
21055
|
(children) => {
|
|
20853
21056
|
if (!enabled) return children;
|
|
20854
21057
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -20902,7 +21105,7 @@ var init_useDataDnd = __esm({
|
|
|
20902
21105
|
init_useAlmadarDndCollision();
|
|
20903
21106
|
init_Box();
|
|
20904
21107
|
dndLog = createLogger("almadar:ui:dnd");
|
|
20905
|
-
RootCtx =
|
|
21108
|
+
RootCtx = React76__default.createContext(null);
|
|
20906
21109
|
}
|
|
20907
21110
|
});
|
|
20908
21111
|
function renderIconInput(icon, props) {
|
|
@@ -21444,7 +21647,7 @@ function DataList({
|
|
|
21444
21647
|
}) {
|
|
21445
21648
|
const eventBus = useEventBus();
|
|
21446
21649
|
const { t } = useTranslate();
|
|
21447
|
-
const [visibleCount, setVisibleCount] =
|
|
21650
|
+
const [visibleCount, setVisibleCount] = React76__default.useState(pageSize || Infinity);
|
|
21448
21651
|
const fieldDefs = fields ?? columns ?? [];
|
|
21449
21652
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
21450
21653
|
const dnd = useDataDnd({
|
|
@@ -21460,14 +21663,14 @@ function DataList({
|
|
|
21460
21663
|
dndRoot
|
|
21461
21664
|
});
|
|
21462
21665
|
const orderedData = dnd.orderedItems;
|
|
21463
|
-
const allData =
|
|
21666
|
+
const allData = React76__default.useMemo(
|
|
21464
21667
|
() => sortRows(orderedData, sortBy, sortDirection),
|
|
21465
21668
|
[orderedData, sortBy, sortDirection]
|
|
21466
21669
|
);
|
|
21467
21670
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
21468
21671
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
21469
21672
|
const hasRenderProp = typeof children === "function";
|
|
21470
|
-
|
|
21673
|
+
React76__default.useEffect(() => {
|
|
21471
21674
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
21472
21675
|
const childrenTypeOf = typeof children;
|
|
21473
21676
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -21582,7 +21785,7 @@ function DataList({
|
|
|
21582
21785
|
return v === void 0 || v === null || v === "" ? raw : String(v);
|
|
21583
21786
|
};
|
|
21584
21787
|
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
|
|
21585
|
-
groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
21788
|
+
groups2.map((group, gi) => /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
21586
21789
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
21587
21790
|
group.items.map((itemData, index) => {
|
|
21588
21791
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -21781,7 +21984,7 @@ function DataList({
|
|
|
21781
21984
|
className
|
|
21782
21985
|
),
|
|
21783
21986
|
children: [
|
|
21784
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
21987
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
21785
21988
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
21786
21989
|
group.items.map(
|
|
21787
21990
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -21890,8 +22093,8 @@ function ScalarControl({
|
|
|
21890
22093
|
}
|
|
21891
22094
|
const numeric = typeof value === "number";
|
|
21892
22095
|
const initial = value === null ? "" : String(value);
|
|
21893
|
-
const [draft, setDraft] =
|
|
21894
|
-
|
|
22096
|
+
const [draft, setDraft] = React76__default.useState(initial);
|
|
22097
|
+
React76__default.useEffect(() => setDraft(initial), [initial]);
|
|
21895
22098
|
const commit = () => {
|
|
21896
22099
|
if (numeric) {
|
|
21897
22100
|
const n = draft.trim() === "" ? 0 : Number(draft);
|
|
@@ -21959,8 +22162,8 @@ function Row({
|
|
|
21959
22162
|
onRemove,
|
|
21960
22163
|
readonly
|
|
21961
22164
|
}) {
|
|
21962
|
-
const [keyDraft, setKeyDraft] =
|
|
21963
|
-
|
|
22165
|
+
const [keyDraft, setKeyDraft] = React76__default.useState(rowKey);
|
|
22166
|
+
React76__default.useEffect(() => setKeyDraft(rowKey), [rowKey]);
|
|
21964
22167
|
const container = isObj(value) || isArr(value);
|
|
21965
22168
|
return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "group w-max min-w-full", children: [
|
|
21966
22169
|
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", className: "py-0.5 w-max", children: [
|
|
@@ -22003,7 +22206,7 @@ function ContainerNode({
|
|
|
22003
22206
|
depth,
|
|
22004
22207
|
readonly
|
|
22005
22208
|
}) {
|
|
22006
|
-
const [open, setOpen] =
|
|
22209
|
+
const [open, setOpen] = React76__default.useState(depth < 2);
|
|
22007
22210
|
const array = isArr(value);
|
|
22008
22211
|
const entries = array ? value.map((v, i) => [String(i), v]) : Object.entries(value);
|
|
22009
22212
|
const setObjValue = (key, next) => {
|
|
@@ -22145,7 +22348,7 @@ var init_FormSection = __esm({
|
|
|
22145
22348
|
columns = 1,
|
|
22146
22349
|
className
|
|
22147
22350
|
}) => {
|
|
22148
|
-
const [collapsed, setCollapsed] =
|
|
22351
|
+
const [collapsed, setCollapsed] = React76__default.useState(defaultCollapsed);
|
|
22149
22352
|
const { t } = useTranslate();
|
|
22150
22353
|
const eventBus = useEventBus();
|
|
22151
22354
|
const gridClass = {
|
|
@@ -22153,7 +22356,7 @@ var init_FormSection = __esm({
|
|
|
22153
22356
|
2: "grid-cols-1 md:grid-cols-2",
|
|
22154
22357
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
22155
22358
|
}[columns];
|
|
22156
|
-
|
|
22359
|
+
React76__default.useCallback(() => {
|
|
22157
22360
|
if (collapsible) {
|
|
22158
22361
|
setCollapsed((prev) => !prev);
|
|
22159
22362
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -22561,8 +22764,8 @@ function TextLikeControl({
|
|
|
22561
22764
|
onCommit
|
|
22562
22765
|
}) {
|
|
22563
22766
|
const initial = value === void 0 || value === null ? "" : String(value);
|
|
22564
|
-
const [draft, setDraft] =
|
|
22565
|
-
|
|
22767
|
+
const [draft, setDraft] = React76__default.useState(initial);
|
|
22768
|
+
React76__default.useEffect(() => setDraft(initial), [initial]);
|
|
22566
22769
|
const commit = () => {
|
|
22567
22770
|
if (numeric) {
|
|
22568
22771
|
const n = draft.trim() === "" ? 0 : Number(draft);
|
|
@@ -22747,14 +22950,14 @@ var init_NodeSlotEditor = __esm({
|
|
|
22747
22950
|
isObj2 = (v) => v !== null && v !== void 0 && typeof v === "object" && !Array.isArray(v);
|
|
22748
22951
|
NodeSlotEditor = ({ value, onChange, className }) => {
|
|
22749
22952
|
const { type, props, wasArray } = normalize(value);
|
|
22750
|
-
const patterns =
|
|
22953
|
+
const patterns = React76__default.useMemo(() => {
|
|
22751
22954
|
try {
|
|
22752
22955
|
return [...getKnownPatterns()].sort();
|
|
22753
22956
|
} catch {
|
|
22754
22957
|
return [];
|
|
22755
22958
|
}
|
|
22756
22959
|
}, []);
|
|
22757
|
-
const options =
|
|
22960
|
+
const options = React76__default.useMemo(
|
|
22758
22961
|
() => [{ value: "", label: "\u2014 none \u2014" }, ...patterns.map((p) => ({ value: p, label: p }))],
|
|
22759
22962
|
[patterns]
|
|
22760
22963
|
);
|
|
@@ -22766,7 +22969,7 @@ var init_NodeSlotEditor = __esm({
|
|
|
22766
22969
|
const pattern = { type: nextType, ...nextProps };
|
|
22767
22970
|
onChange(wasArray || value === void 0 ? [pattern] : pattern);
|
|
22768
22971
|
};
|
|
22769
|
-
const schemaEntries =
|
|
22972
|
+
const schemaEntries = React76__default.useMemo(() => {
|
|
22770
22973
|
if (!type) return [];
|
|
22771
22974
|
const def = getPatternDefinition(type);
|
|
22772
22975
|
if (!def?.propsSchema) return [];
|
|
@@ -23587,7 +23790,7 @@ var init_Flex = __esm({
|
|
|
23587
23790
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
23588
23791
|
}
|
|
23589
23792
|
}
|
|
23590
|
-
return
|
|
23793
|
+
return React76__default.createElement(Component, {
|
|
23591
23794
|
className: cn(
|
|
23592
23795
|
inline ? "inline-flex" : "flex",
|
|
23593
23796
|
directionStyles[direction],
|
|
@@ -23706,7 +23909,7 @@ var init_Grid = __esm({
|
|
|
23706
23909
|
as: Component = "div"
|
|
23707
23910
|
}) => {
|
|
23708
23911
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
23709
|
-
return
|
|
23912
|
+
return React76__default.createElement(
|
|
23710
23913
|
Component,
|
|
23711
23914
|
{
|
|
23712
23915
|
className: cn(
|
|
@@ -23938,9 +24141,9 @@ var init_Popover = __esm({
|
|
|
23938
24141
|
onMouseLeave: handleClose,
|
|
23939
24142
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
23940
24143
|
};
|
|
23941
|
-
const childElement =
|
|
24144
|
+
const childElement = React76__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
23942
24145
|
const childPointerDown = childElement.props.onPointerDown;
|
|
23943
|
-
const triggerElement =
|
|
24146
|
+
const triggerElement = React76__default.cloneElement(
|
|
23944
24147
|
childElement,
|
|
23945
24148
|
{
|
|
23946
24149
|
ref: triggerRef,
|
|
@@ -24799,9 +25002,9 @@ var init_Tooltip = __esm({
|
|
|
24799
25002
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
24800
25003
|
};
|
|
24801
25004
|
}, []);
|
|
24802
|
-
const triggerElement =
|
|
25005
|
+
const triggerElement = React76__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
24803
25006
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
24804
|
-
const trigger =
|
|
25007
|
+
const trigger = React76__default.cloneElement(triggerElement, {
|
|
24805
25008
|
ref: triggerRef,
|
|
24806
25009
|
onMouseEnter: handleMouseEnter,
|
|
24807
25010
|
onMouseLeave: handleMouseLeave,
|
|
@@ -24891,7 +25094,7 @@ var init_WizardProgress = __esm({
|
|
|
24891
25094
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
24892
25095
|
const isActive = index === currentStep;
|
|
24893
25096
|
const isCompleted = index < currentStep;
|
|
24894
|
-
return /* @__PURE__ */ jsxs(
|
|
25097
|
+
return /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
24895
25098
|
/* @__PURE__ */ jsx(
|
|
24896
25099
|
"button",
|
|
24897
25100
|
{
|
|
@@ -26702,7 +26905,7 @@ function GameMenu({
|
|
|
26702
26905
|
}) {
|
|
26703
26906
|
const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
|
|
26704
26907
|
const eventBus = useEventBus();
|
|
26705
|
-
const handleOptionClick =
|
|
26908
|
+
const handleOptionClick = React76.useCallback(
|
|
26706
26909
|
(option) => {
|
|
26707
26910
|
if (option.event) {
|
|
26708
26911
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -26938,7 +27141,7 @@ function StateGraph({
|
|
|
26938
27141
|
}) {
|
|
26939
27142
|
const eventBus = useEventBus();
|
|
26940
27143
|
const nodes = states ?? [];
|
|
26941
|
-
const positions =
|
|
27144
|
+
const positions = React76.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
26942
27145
|
return /* @__PURE__ */ jsxs(
|
|
26943
27146
|
Box,
|
|
26944
27147
|
{
|
|
@@ -27475,7 +27678,7 @@ function LinearView({
|
|
|
27475
27678
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
27476
27679
|
const isDone = i < currentIdx;
|
|
27477
27680
|
const isCurrent = i === currentIdx;
|
|
27478
|
-
return /* @__PURE__ */ jsxs(
|
|
27681
|
+
return /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
27479
27682
|
i > 0 && /* @__PURE__ */ jsx(
|
|
27480
27683
|
Typography,
|
|
27481
27684
|
{
|
|
@@ -28108,7 +28311,7 @@ function SequenceBar({
|
|
|
28108
28311
|
else onSlotRemove?.(index);
|
|
28109
28312
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
28110
28313
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
28111
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
28314
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
28112
28315
|
i > 0 && /* @__PURE__ */ jsx(
|
|
28113
28316
|
Typography,
|
|
28114
28317
|
{
|
|
@@ -29088,7 +29291,7 @@ var init_MapView = __esm({
|
|
|
29088
29291
|
shadowSize: [41, 41]
|
|
29089
29292
|
});
|
|
29090
29293
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
29091
|
-
const { useEffect: useEffect65, useRef: useRef63, useCallback: useCallback106, useState: useState103 } =
|
|
29294
|
+
const { useEffect: useEffect65, useRef: useRef63, useCallback: useCallback106, useState: useState103 } = React76__default;
|
|
29092
29295
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
29093
29296
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
29094
29297
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -30006,8 +30209,8 @@ function TableView({
|
|
|
30006
30209
|
}) {
|
|
30007
30210
|
const eventBus = useEventBus();
|
|
30008
30211
|
const { t } = useTranslate();
|
|
30009
|
-
const [visibleCount, setVisibleCount] =
|
|
30010
|
-
const [localSelected, setLocalSelected] =
|
|
30212
|
+
const [visibleCount, setVisibleCount] = React76__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
30213
|
+
const [localSelected, setLocalSelected] = React76__default.useState(/* @__PURE__ */ new Set());
|
|
30011
30214
|
const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
|
|
30012
30215
|
const actionDefs = Array.isArray(itemActions) ? itemActions : [];
|
|
30013
30216
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
@@ -30029,7 +30232,7 @@ function TableView({
|
|
|
30029
30232
|
const hasRenderProp = typeof children === "function";
|
|
30030
30233
|
const idField = dndItemIdField ?? "id";
|
|
30031
30234
|
const isCoarsePointer = useMediaQuery("(pointer: coarse)");
|
|
30032
|
-
|
|
30235
|
+
React76__default.useEffect(() => {
|
|
30033
30236
|
tableViewLog.debug("render", {
|
|
30034
30237
|
rowCount: data.length,
|
|
30035
30238
|
colCount: colDefs.length,
|
|
@@ -30086,7 +30289,7 @@ function TableView({
|
|
|
30086
30289
|
};
|
|
30087
30290
|
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
30088
30291
|
};
|
|
30089
|
-
const colFloors =
|
|
30292
|
+
const colFloors = React76__default.useMemo(
|
|
30090
30293
|
() => colDefs.map((col) => {
|
|
30091
30294
|
const longest = data.reduce((widest, row) => {
|
|
30092
30295
|
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
@@ -30248,12 +30451,12 @@ function TableView({
|
|
|
30248
30451
|
]
|
|
30249
30452
|
}
|
|
30250
30453
|
);
|
|
30251
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
30454
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React76__default.Fragment, { children: rowInner }, id);
|
|
30252
30455
|
};
|
|
30253
30456
|
const items = Array.from(data);
|
|
30254
30457
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
30255
30458
|
let runningIndex = 0;
|
|
30256
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
30459
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
30257
30460
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
30258
30461
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
30259
30462
|
] }, gi)) });
|
|
@@ -31616,7 +31819,7 @@ var init_StepFlow = __esm({
|
|
|
31616
31819
|
className
|
|
31617
31820
|
}) => {
|
|
31618
31821
|
if (orientation === "vertical") {
|
|
31619
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
31822
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React76__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
31620
31823
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
31621
31824
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
31622
31825
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -31627,7 +31830,7 @@ var init_StepFlow = __esm({
|
|
|
31627
31830
|
] })
|
|
31628
31831
|
] }) }, index)) });
|
|
31629
31832
|
}
|
|
31630
|
-
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(
|
|
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(React76__default.Fragment, { children: [
|
|
31631
31834
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
31632
31835
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
31633
31836
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -32617,7 +32820,7 @@ var init_LikertScale = __esm({
|
|
|
32617
32820
|
md: "text-base",
|
|
32618
32821
|
lg: "text-lg"
|
|
32619
32822
|
};
|
|
32620
|
-
LikertScale =
|
|
32823
|
+
LikertScale = React76__default.forwardRef(
|
|
32621
32824
|
({
|
|
32622
32825
|
question,
|
|
32623
32826
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -32629,7 +32832,7 @@ var init_LikertScale = __esm({
|
|
|
32629
32832
|
variant = "radios",
|
|
32630
32833
|
className
|
|
32631
32834
|
}, ref) => {
|
|
32632
|
-
const groupId =
|
|
32835
|
+
const groupId = React76__default.useId();
|
|
32633
32836
|
const eventBus = useEventBus();
|
|
32634
32837
|
const handleSelect = useCallback(
|
|
32635
32838
|
(next) => {
|
|
@@ -34918,7 +35121,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
34918
35121
|
"aria-label": t("aria.breadcrumb"),
|
|
34919
35122
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
34920
35123
|
const isLast = idx === items.length - 1;
|
|
34921
|
-
return /* @__PURE__ */ jsxs(
|
|
35124
|
+
return /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
34922
35125
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
34923
35126
|
Icon,
|
|
34924
35127
|
{
|
|
@@ -35787,7 +35990,7 @@ var init_MiniStateMachine = __esm({
|
|
|
35787
35990
|
const x = 2 + i * (NODE_W + GAP2 + ARROW_W + GAP2);
|
|
35788
35991
|
const tc = transitionCounts[s.name] ?? 0;
|
|
35789
35992
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
35790
|
-
return /* @__PURE__ */ jsxs(
|
|
35993
|
+
return /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
35791
35994
|
/* @__PURE__ */ jsx(
|
|
35792
35995
|
AvlState,
|
|
35793
35996
|
{
|
|
@@ -35991,7 +36194,7 @@ var init_PageHeader = __esm({
|
|
|
35991
36194
|
info: "bg-info/10 text-info"
|
|
35992
36195
|
};
|
|
35993
36196
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
35994
|
-
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(
|
|
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(React76__default.Fragment, { children: [
|
|
35995
36198
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
35996
36199
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
35997
36200
|
"a",
|
|
@@ -36349,7 +36552,7 @@ var init_Section = __esm({
|
|
|
36349
36552
|
as: Component = "section"
|
|
36350
36553
|
}) => {
|
|
36351
36554
|
const hasHeader = title || description || action;
|
|
36352
|
-
return
|
|
36555
|
+
return React76__default.createElement(
|
|
36353
36556
|
Component,
|
|
36354
36557
|
{
|
|
36355
36558
|
className: cn(
|
|
@@ -36723,7 +36926,7 @@ var init_WizardContainer = __esm({
|
|
|
36723
36926
|
const isCompleted = index < currentStep;
|
|
36724
36927
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
36725
36928
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
36726
|
-
return /* @__PURE__ */ jsxs(
|
|
36929
|
+
return /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
36727
36930
|
/* @__PURE__ */ jsx(
|
|
36728
36931
|
Button,
|
|
36729
36932
|
{
|
|
@@ -38510,7 +38713,7 @@ var init_ImportPreviewTree = __esm({
|
|
|
38510
38713
|
const renderUnit = (unit, childrenByParent, depth) => {
|
|
38511
38714
|
const summary = fieldSummary(unit);
|
|
38512
38715
|
const children = childrenByParent.get(unit.ref) ?? [];
|
|
38513
|
-
return /* @__PURE__ */ jsxs(
|
|
38716
|
+
return /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
38514
38717
|
/* @__PURE__ */ jsxs(
|
|
38515
38718
|
Box,
|
|
38516
38719
|
{
|
|
@@ -38607,7 +38810,7 @@ var init_ImportProgress = __esm({
|
|
|
38607
38810
|
PIPELINE.map((key, index) => {
|
|
38608
38811
|
const isComplete = index < currentIndex;
|
|
38609
38812
|
const isActive = index === currentIndex;
|
|
38610
|
-
return /* @__PURE__ */ jsxs(
|
|
38813
|
+
return /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
38611
38814
|
index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
|
|
38612
38815
|
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
|
|
38613
38816
|
/* @__PURE__ */ jsx(
|
|
@@ -39942,7 +40145,7 @@ var init_DrawGroup = __esm({
|
|
|
39942
40145
|
}
|
|
39943
40146
|
});
|
|
39944
40147
|
function extractTitle(children) {
|
|
39945
|
-
if (!
|
|
40148
|
+
if (!React76__default.isValidElement(children)) return void 0;
|
|
39946
40149
|
const props = children.props;
|
|
39947
40150
|
if (typeof props.title === "string") {
|
|
39948
40151
|
return props.title;
|
|
@@ -40292,12 +40495,12 @@ var init_Form = __esm({
|
|
|
40292
40495
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
40293
40496
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
40294
40497
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
40295
|
-
const normalizedInitialData =
|
|
40498
|
+
const normalizedInitialData = React76__default.useMemo(() => {
|
|
40296
40499
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
40297
40500
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
40298
40501
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
40299
40502
|
}, [entity, initialData]);
|
|
40300
|
-
const entityDerivedFields =
|
|
40503
|
+
const entityDerivedFields = React76__default.useMemo(() => {
|
|
40301
40504
|
if (fields && fields.length > 0) return void 0;
|
|
40302
40505
|
if (!resolvedEntity) return void 0;
|
|
40303
40506
|
return resolvedEntity.fields.map(
|
|
@@ -40318,16 +40521,16 @@ var init_Form = __esm({
|
|
|
40318
40521
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
40319
40522
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
40320
40523
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
40321
|
-
const [formData, setFormData] =
|
|
40524
|
+
const [formData, setFormData] = React76__default.useState(
|
|
40322
40525
|
normalizedInitialData
|
|
40323
40526
|
);
|
|
40324
|
-
const [collapsedSections, setCollapsedSections] =
|
|
40527
|
+
const [collapsedSections, setCollapsedSections] = React76__default.useState(
|
|
40325
40528
|
/* @__PURE__ */ new Set()
|
|
40326
40529
|
);
|
|
40327
|
-
const [submitError, setSubmitError] =
|
|
40328
|
-
const formRef =
|
|
40530
|
+
const [submitError, setSubmitError] = React76__default.useState(null);
|
|
40531
|
+
const formRef = React76__default.useRef(null);
|
|
40329
40532
|
const formMode = props.mode;
|
|
40330
|
-
const mountedRef =
|
|
40533
|
+
const mountedRef = React76__default.useRef(false);
|
|
40331
40534
|
if (!mountedRef.current) {
|
|
40332
40535
|
mountedRef.current = true;
|
|
40333
40536
|
debug("forms", "mount", {
|
|
@@ -40340,7 +40543,7 @@ var init_Form = __esm({
|
|
|
40340
40543
|
});
|
|
40341
40544
|
}
|
|
40342
40545
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
40343
|
-
const evalContext =
|
|
40546
|
+
const evalContext = React76__default.useMemo(
|
|
40344
40547
|
() => ({
|
|
40345
40548
|
formValues: formData,
|
|
40346
40549
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -40349,7 +40552,7 @@ var init_Form = __esm({
|
|
|
40349
40552
|
}),
|
|
40350
40553
|
[formData, externalContext]
|
|
40351
40554
|
);
|
|
40352
|
-
|
|
40555
|
+
React76__default.useEffect(() => {
|
|
40353
40556
|
debug("forms", "initialData-sync", {
|
|
40354
40557
|
mode: formMode,
|
|
40355
40558
|
normalizedInitialData,
|
|
@@ -40360,7 +40563,7 @@ var init_Form = __esm({
|
|
|
40360
40563
|
setFormData(normalizedInitialData);
|
|
40361
40564
|
}
|
|
40362
40565
|
}, [normalizedInitialData]);
|
|
40363
|
-
const processCalculations =
|
|
40566
|
+
const processCalculations = React76__default.useCallback(
|
|
40364
40567
|
(changedFieldId, newFormData) => {
|
|
40365
40568
|
if (!hiddenCalculations.length) return;
|
|
40366
40569
|
const context = {
|
|
@@ -40385,7 +40588,7 @@ var init_Form = __esm({
|
|
|
40385
40588
|
},
|
|
40386
40589
|
[hiddenCalculations, externalContext, eventBus]
|
|
40387
40590
|
);
|
|
40388
|
-
const checkViolations =
|
|
40591
|
+
const checkViolations = React76__default.useCallback(
|
|
40389
40592
|
(changedFieldId, newFormData) => {
|
|
40390
40593
|
if (!violationTriggers.length) return;
|
|
40391
40594
|
const context = {
|
|
@@ -40423,7 +40626,7 @@ var init_Form = __esm({
|
|
|
40423
40626
|
processCalculations(name, newFormData);
|
|
40424
40627
|
checkViolations(name, newFormData);
|
|
40425
40628
|
};
|
|
40426
|
-
const isFieldVisible =
|
|
40629
|
+
const isFieldVisible = React76__default.useCallback(
|
|
40427
40630
|
(fieldName) => {
|
|
40428
40631
|
const condition = conditionalFields[fieldName];
|
|
40429
40632
|
if (!condition) return true;
|
|
@@ -40431,7 +40634,7 @@ var init_Form = __esm({
|
|
|
40431
40634
|
},
|
|
40432
40635
|
[conditionalFields, evalContext]
|
|
40433
40636
|
);
|
|
40434
|
-
const isSectionVisible =
|
|
40637
|
+
const isSectionVisible = React76__default.useCallback(
|
|
40435
40638
|
(section) => {
|
|
40436
40639
|
if (!section.condition) return true;
|
|
40437
40640
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -40507,7 +40710,7 @@ var init_Form = __esm({
|
|
|
40507
40710
|
eventBus.emit(`UI:${onCancel}`);
|
|
40508
40711
|
}
|
|
40509
40712
|
};
|
|
40510
|
-
const renderField =
|
|
40713
|
+
const renderField = React76__default.useCallback(
|
|
40511
40714
|
(field) => {
|
|
40512
40715
|
const fieldName = field.name || field.field;
|
|
40513
40716
|
if (!fieldName) return null;
|
|
@@ -40528,7 +40731,7 @@ var init_Form = __esm({
|
|
|
40528
40731
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
40529
40732
|
);
|
|
40530
40733
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
40531
|
-
const normalizedFields =
|
|
40734
|
+
const normalizedFields = React76__default.useMemo(() => {
|
|
40532
40735
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
40533
40736
|
return effectiveFields.map((field) => {
|
|
40534
40737
|
if (typeof field === "string") {
|
|
@@ -40552,7 +40755,7 @@ var init_Form = __esm({
|
|
|
40552
40755
|
return field;
|
|
40553
40756
|
});
|
|
40554
40757
|
}, [effectiveFields, resolvedEntity]);
|
|
40555
|
-
const schemaFields =
|
|
40758
|
+
const schemaFields = React76__default.useMemo(() => {
|
|
40556
40759
|
if (normalizedFields.length === 0) return null;
|
|
40557
40760
|
if (isDebugEnabled()) {
|
|
40558
40761
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -40562,7 +40765,7 @@ var init_Form = __esm({
|
|
|
40562
40765
|
}
|
|
40563
40766
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
40564
40767
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
40565
|
-
const sectionElements =
|
|
40768
|
+
const sectionElements = React76__default.useMemo(() => {
|
|
40566
40769
|
if (!sections || sections.length === 0) return null;
|
|
40567
40770
|
return sections.map((section) => {
|
|
40568
40771
|
if (!isSectionVisible(section)) {
|
|
@@ -41288,7 +41491,7 @@ var init_List = __esm({
|
|
|
41288
41491
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
41289
41492
|
return [];
|
|
41290
41493
|
}, [entity]);
|
|
41291
|
-
const getItemActions =
|
|
41494
|
+
const getItemActions = React76__default.useCallback(
|
|
41292
41495
|
(item) => {
|
|
41293
41496
|
if (!itemActions) return [];
|
|
41294
41497
|
if (typeof itemActions === "function") {
|
|
@@ -41769,7 +41972,7 @@ var init_MediaGallery = __esm({
|
|
|
41769
41972
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
41770
41973
|
);
|
|
41771
41974
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
41772
|
-
const items =
|
|
41975
|
+
const items = React76__default.useMemo(() => {
|
|
41773
41976
|
if (propItems && propItems.length > 0) return propItems;
|
|
41774
41977
|
if (entityData.length === 0) return [];
|
|
41775
41978
|
return entityData.map((record, idx) => {
|
|
@@ -41934,7 +42137,7 @@ var init_MediaGallery = __esm({
|
|
|
41934
42137
|
}
|
|
41935
42138
|
});
|
|
41936
42139
|
function extractTitle2(children) {
|
|
41937
|
-
if (!
|
|
42140
|
+
if (!React76__default.isValidElement(children)) return void 0;
|
|
41938
42141
|
const props = children.props;
|
|
41939
42142
|
if (typeof props.title === "string") {
|
|
41940
42143
|
return props.title;
|
|
@@ -42189,7 +42392,7 @@ var init_debugRegistry = __esm({
|
|
|
42189
42392
|
}
|
|
42190
42393
|
});
|
|
42191
42394
|
function useDebugData() {
|
|
42192
|
-
const [data, setData] =
|
|
42395
|
+
const [data, setData] = React76.useState(() => ({
|
|
42193
42396
|
traits: [],
|
|
42194
42397
|
ticks: [],
|
|
42195
42398
|
guards: [],
|
|
@@ -42203,7 +42406,7 @@ function useDebugData() {
|
|
|
42203
42406
|
},
|
|
42204
42407
|
lastUpdate: Date.now()
|
|
42205
42408
|
}));
|
|
42206
|
-
|
|
42409
|
+
React76.useEffect(() => {
|
|
42207
42410
|
const updateData = () => {
|
|
42208
42411
|
setData({
|
|
42209
42412
|
traits: getAllTraits(),
|
|
@@ -42312,12 +42515,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
42312
42515
|
return positions;
|
|
42313
42516
|
}
|
|
42314
42517
|
function WalkMinimap() {
|
|
42315
|
-
const [walkStep, setWalkStep] =
|
|
42316
|
-
const [traits2, setTraits] =
|
|
42317
|
-
const [coveredEdges, setCoveredEdges] =
|
|
42318
|
-
const [completedTraits, setCompletedTraits] =
|
|
42319
|
-
const prevTraitRef =
|
|
42320
|
-
|
|
42518
|
+
const [walkStep, setWalkStep] = React76.useState(null);
|
|
42519
|
+
const [traits2, setTraits] = React76.useState([]);
|
|
42520
|
+
const [coveredEdges, setCoveredEdges] = React76.useState([]);
|
|
42521
|
+
const [completedTraits, setCompletedTraits] = React76.useState(/* @__PURE__ */ new Set());
|
|
42522
|
+
const prevTraitRef = React76.useRef(null);
|
|
42523
|
+
React76.useEffect(() => {
|
|
42321
42524
|
const interval = setInterval(() => {
|
|
42322
42525
|
const w = window;
|
|
42323
42526
|
const step = w.__orbitalWalkStep;
|
|
@@ -42753,15 +42956,15 @@ var init_EntitiesTab = __esm({
|
|
|
42753
42956
|
});
|
|
42754
42957
|
function EventFlowTab({ events: events2 }) {
|
|
42755
42958
|
const { t } = useTranslate();
|
|
42756
|
-
const [filter, setFilter] =
|
|
42757
|
-
const containerRef =
|
|
42758
|
-
const [autoScroll, setAutoScroll] =
|
|
42759
|
-
|
|
42959
|
+
const [filter, setFilter] = React76.useState("all");
|
|
42960
|
+
const containerRef = React76.useRef(null);
|
|
42961
|
+
const [autoScroll, setAutoScroll] = React76.useState(true);
|
|
42962
|
+
React76.useEffect(() => {
|
|
42760
42963
|
if (autoScroll && containerRef.current) {
|
|
42761
42964
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42762
42965
|
}
|
|
42763
42966
|
}, [events2.length, autoScroll]);
|
|
42764
|
-
const filteredEvents =
|
|
42967
|
+
const filteredEvents = React76.useMemo(() => {
|
|
42765
42968
|
if (filter === "all") return events2;
|
|
42766
42969
|
return events2.filter((e) => e.type === filter);
|
|
42767
42970
|
}, [events2, filter]);
|
|
@@ -42877,7 +43080,7 @@ var init_EventFlowTab = __esm({
|
|
|
42877
43080
|
});
|
|
42878
43081
|
function GuardsPanel({ guards }) {
|
|
42879
43082
|
const { t } = useTranslate();
|
|
42880
|
-
const [filter, setFilter] =
|
|
43083
|
+
const [filter, setFilter] = React76.useState("all");
|
|
42881
43084
|
if (guards.length === 0) {
|
|
42882
43085
|
return /* @__PURE__ */ jsx(
|
|
42883
43086
|
EmptyState,
|
|
@@ -42890,7 +43093,7 @@ function GuardsPanel({ guards }) {
|
|
|
42890
43093
|
}
|
|
42891
43094
|
const passedCount = guards.filter((g) => g.result).length;
|
|
42892
43095
|
const failedCount = guards.length - passedCount;
|
|
42893
|
-
const filteredGuards =
|
|
43096
|
+
const filteredGuards = React76.useMemo(() => {
|
|
42894
43097
|
if (filter === "all") return guards;
|
|
42895
43098
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
42896
43099
|
return guards.filter((g) => !g.result);
|
|
@@ -43053,10 +43256,10 @@ function EffectBadge({ effect }) {
|
|
|
43053
43256
|
}
|
|
43054
43257
|
function TransitionTimeline({ transitions }) {
|
|
43055
43258
|
const { t } = useTranslate();
|
|
43056
|
-
const containerRef =
|
|
43057
|
-
const [autoScroll, setAutoScroll] =
|
|
43058
|
-
const [expandedId, setExpandedId] =
|
|
43059
|
-
|
|
43259
|
+
const containerRef = React76.useRef(null);
|
|
43260
|
+
const [autoScroll, setAutoScroll] = React76.useState(true);
|
|
43261
|
+
const [expandedId, setExpandedId] = React76.useState(null);
|
|
43262
|
+
React76.useEffect(() => {
|
|
43060
43263
|
if (autoScroll && containerRef.current) {
|
|
43061
43264
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
43062
43265
|
}
|
|
@@ -43336,9 +43539,9 @@ function getAllEvents(traits2) {
|
|
|
43336
43539
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
43337
43540
|
const eventBus = useEventBus();
|
|
43338
43541
|
const { t } = useTranslate();
|
|
43339
|
-
const [log19, setLog] =
|
|
43340
|
-
const prevStatesRef =
|
|
43341
|
-
|
|
43542
|
+
const [log19, setLog] = React76.useState([]);
|
|
43543
|
+
const prevStatesRef = React76.useRef(/* @__PURE__ */ new Map());
|
|
43544
|
+
React76.useEffect(() => {
|
|
43342
43545
|
for (const trait of traits2) {
|
|
43343
43546
|
const prev = prevStatesRef.current.get(trait.id);
|
|
43344
43547
|
if (prev && prev !== trait.currentState) {
|
|
@@ -43507,10 +43710,10 @@ function VerifyModePanel({
|
|
|
43507
43710
|
localCount
|
|
43508
43711
|
}) {
|
|
43509
43712
|
const { t } = useTranslate();
|
|
43510
|
-
const [expanded, setExpanded] =
|
|
43511
|
-
const scrollRef =
|
|
43512
|
-
const prevCountRef =
|
|
43513
|
-
|
|
43713
|
+
const [expanded, setExpanded] = React76.useState(true);
|
|
43714
|
+
const scrollRef = React76.useRef(null);
|
|
43715
|
+
const prevCountRef = React76.useRef(0);
|
|
43716
|
+
React76.useEffect(() => {
|
|
43514
43717
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
43515
43718
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
43516
43719
|
}
|
|
@@ -43567,10 +43770,10 @@ function RuntimeDebugger({
|
|
|
43567
43770
|
schema
|
|
43568
43771
|
}) {
|
|
43569
43772
|
const { t } = useTranslate();
|
|
43570
|
-
const [isCollapsed, setIsCollapsed] =
|
|
43571
|
-
const [isVisible, setIsVisible] =
|
|
43773
|
+
const [isCollapsed, setIsCollapsed] = React76.useState(mode === "verify" ? true : defaultCollapsed);
|
|
43774
|
+
const [isVisible, setIsVisible] = React76.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
43572
43775
|
const debugData = useDebugData();
|
|
43573
|
-
|
|
43776
|
+
React76.useEffect(() => {
|
|
43574
43777
|
if (mode === "inline") return;
|
|
43575
43778
|
return onDebugToggle((enabled) => {
|
|
43576
43779
|
setIsVisible(enabled);
|
|
@@ -43579,7 +43782,7 @@ function RuntimeDebugger({
|
|
|
43579
43782
|
}
|
|
43580
43783
|
});
|
|
43581
43784
|
}, [mode]);
|
|
43582
|
-
|
|
43785
|
+
React76.useEffect(() => {
|
|
43583
43786
|
if (mode === "inline") return;
|
|
43584
43787
|
const handleKeyDown = (e) => {
|
|
43585
43788
|
if (e.key === "`" && isVisible) {
|
|
@@ -44099,7 +44302,7 @@ var init_StatCard = __esm({
|
|
|
44099
44302
|
const labelToUse = propLabel ?? propTitle;
|
|
44100
44303
|
const eventBus = useEventBus();
|
|
44101
44304
|
const { t } = useTranslate();
|
|
44102
|
-
const handleActionClick =
|
|
44305
|
+
const handleActionClick = React76__default.useCallback(() => {
|
|
44103
44306
|
if (action?.event) {
|
|
44104
44307
|
eventBus.emit(`UI:${action.event}`, {});
|
|
44105
44308
|
}
|
|
@@ -44110,7 +44313,7 @@ var init_StatCard = __esm({
|
|
|
44110
44313
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
44111
44314
|
const isLoading = externalLoading ?? false;
|
|
44112
44315
|
const error = externalError;
|
|
44113
|
-
const computeMetricValue =
|
|
44316
|
+
const computeMetricValue = React76__default.useCallback(
|
|
44114
44317
|
(metric, items) => {
|
|
44115
44318
|
if (metric.value !== void 0) {
|
|
44116
44319
|
return metric.value;
|
|
@@ -44149,7 +44352,7 @@ var init_StatCard = __esm({
|
|
|
44149
44352
|
},
|
|
44150
44353
|
[]
|
|
44151
44354
|
);
|
|
44152
|
-
const schemaStats =
|
|
44355
|
+
const schemaStats = React76__default.useMemo(() => {
|
|
44153
44356
|
if (!metrics || metrics.length === 0) return null;
|
|
44154
44357
|
return metrics.map((metric) => ({
|
|
44155
44358
|
label: metric.label,
|
|
@@ -44157,7 +44360,7 @@ var init_StatCard = __esm({
|
|
|
44157
44360
|
format: metric.format
|
|
44158
44361
|
}));
|
|
44159
44362
|
}, [metrics, data, computeMetricValue]);
|
|
44160
|
-
const calculatedTrend =
|
|
44363
|
+
const calculatedTrend = React76__default.useMemo(() => {
|
|
44161
44364
|
if (manualTrend !== void 0) return manualTrend;
|
|
44162
44365
|
if (previousValue === void 0 || currentValue2 === void 0)
|
|
44163
44366
|
return void 0;
|
|
@@ -44797,8 +45000,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
44797
45000
|
] });
|
|
44798
45001
|
};
|
|
44799
45002
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
44800
|
-
const endRef =
|
|
44801
|
-
|
|
45003
|
+
const endRef = React76__default.useRef(null);
|
|
45004
|
+
React76__default.useEffect(() => {
|
|
44802
45005
|
if (!autoScroll) return;
|
|
44803
45006
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
44804
45007
|
}, [activities.length, autoScroll]);
|
|
@@ -44892,7 +45095,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
44892
45095
|
};
|
|
44893
45096
|
SubagentRichCard = ({ subagent }) => {
|
|
44894
45097
|
const { t } = useTranslate();
|
|
44895
|
-
const activities =
|
|
45098
|
+
const activities = React76__default.useMemo(
|
|
44896
45099
|
() => subagentMessagesToActivities(subagent.messages),
|
|
44897
45100
|
[subagent.messages]
|
|
44898
45101
|
);
|
|
@@ -44969,8 +45172,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
44969
45172
|
] });
|
|
44970
45173
|
};
|
|
44971
45174
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
44972
|
-
const endRef =
|
|
44973
|
-
|
|
45175
|
+
const endRef = React76__default.useRef(null);
|
|
45176
|
+
React76__default.useEffect(() => {
|
|
44974
45177
|
if (!autoScroll) return;
|
|
44975
45178
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
44976
45179
|
}, [messages.length, autoScroll]);
|
|
@@ -45405,7 +45608,7 @@ var init_Timeline = __esm({
|
|
|
45405
45608
|
}) => {
|
|
45406
45609
|
const { t } = useTranslate();
|
|
45407
45610
|
const entityData = entity ?? [];
|
|
45408
|
-
const items =
|
|
45611
|
+
const items = React76__default.useMemo(() => {
|
|
45409
45612
|
if (propItems) return propItems;
|
|
45410
45613
|
if (entityData.length === 0) return [];
|
|
45411
45614
|
return entityData.map((record, idx) => {
|
|
@@ -45507,7 +45710,7 @@ var init_Timeline = __esm({
|
|
|
45507
45710
|
}
|
|
45508
45711
|
});
|
|
45509
45712
|
function extractToastProps(children) {
|
|
45510
|
-
if (!
|
|
45713
|
+
if (!React76__default.isValidElement(children)) {
|
|
45511
45714
|
if (typeof children === "string") {
|
|
45512
45715
|
return { message: children };
|
|
45513
45716
|
}
|
|
@@ -45549,7 +45752,7 @@ var init_ToastSlot = __esm({
|
|
|
45549
45752
|
eventBus.emit(`${prefix}CLOSE`);
|
|
45550
45753
|
};
|
|
45551
45754
|
if (!isVisible) return null;
|
|
45552
|
-
const isCustomContent =
|
|
45755
|
+
const isCustomContent = React76__default.isValidElement(children) && !message;
|
|
45553
45756
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
45554
45757
|
Toast,
|
|
45555
45758
|
{
|
|
@@ -46122,7 +46325,7 @@ function SuspenseConfigProvider({
|
|
|
46122
46325
|
config,
|
|
46123
46326
|
children
|
|
46124
46327
|
}) {
|
|
46125
|
-
return
|
|
46328
|
+
return React76__default.createElement(
|
|
46126
46329
|
SuspenseConfigContext.Provider,
|
|
46127
46330
|
{ value: config },
|
|
46128
46331
|
children
|
|
@@ -46164,7 +46367,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
46164
46367
|
}
|
|
46165
46368
|
return { name: field, label: humanizeFieldName(field) };
|
|
46166
46369
|
}
|
|
46167
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
46370
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React76__default.isValidElement(field) && !(field instanceof Date)) {
|
|
46168
46371
|
const obj = field;
|
|
46169
46372
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
46170
46373
|
if (!fieldName) return field;
|
|
@@ -46636,7 +46839,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
46636
46839
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
46637
46840
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
46638
46841
|
}
|
|
46639
|
-
return /* @__PURE__ */ jsx(
|
|
46842
|
+
return /* @__PURE__ */ jsx(React76__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
46640
46843
|
}
|
|
46641
46844
|
if (!child || typeof child !== "object") return null;
|
|
46642
46845
|
const childId = `${parentId}-${index}`;
|
|
@@ -46693,14 +46896,14 @@ function isPatternConfig(value) {
|
|
|
46693
46896
|
if (value === null || value === void 0) return false;
|
|
46694
46897
|
if (typeof value !== "object") return false;
|
|
46695
46898
|
if (Array.isArray(value)) return false;
|
|
46696
|
-
if (
|
|
46899
|
+
if (React76__default.isValidElement(value)) return false;
|
|
46697
46900
|
if (value instanceof Date) return false;
|
|
46698
46901
|
if (typeof value === "function") return false;
|
|
46699
46902
|
const record = value;
|
|
46700
46903
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
46701
46904
|
}
|
|
46702
46905
|
function isPlainConfigObject(value) {
|
|
46703
|
-
if (
|
|
46906
|
+
if (React76__default.isValidElement(value)) return false;
|
|
46704
46907
|
if (value instanceof Date) return false;
|
|
46705
46908
|
const proto = Object.getPrototypeOf(value);
|
|
46706
46909
|
return proto === Object.prototype || proto === null;
|
|
@@ -46821,8 +47024,13 @@ function SlotContentRenderer({
|
|
|
46821
47024
|
const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
|
|
46822
47025
|
const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
|
|
46823
47026
|
const isDrawHost = isDrawHostPattern(content.pattern);
|
|
47027
|
+
const arr = Array.isArray(childrenConfig) ? childrenConfig : childrenConfig ? [childrenConfig] : [];
|
|
47028
|
+
const hasTraitChildren = arr.some(
|
|
47029
|
+
(c) => typeof c === "string" && TRAIT_BINDING_RE.test(c)
|
|
47030
|
+
);
|
|
47031
|
+
const drawHostUsesReactChildren = isDrawHost && hasTraitChildren;
|
|
46824
47032
|
const myPath = patternPath ?? "root";
|
|
46825
|
-
const renderedChildren = hasChildren && !isDrawHost ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait, {
|
|
47033
|
+
const renderedChildren = hasChildren && (!isDrawHost || drawHostUsesReactChildren) ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait, {
|
|
46826
47034
|
slot: content.slot,
|
|
46827
47035
|
transitionEvent: content.transitionEvent,
|
|
46828
47036
|
fromState: content.fromState,
|
|
@@ -46836,7 +47044,7 @@ function SlotContentRenderer({
|
|
|
46836
47044
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
46837
47045
|
const slotVal = restProps[slotKey];
|
|
46838
47046
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
46839
|
-
if (
|
|
47047
|
+
if (React76__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
46840
47048
|
const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
|
|
46841
47049
|
if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
46842
47050
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
@@ -46883,14 +47091,14 @@ function SlotContentRenderer({
|
|
|
46883
47091
|
for (const [k, v] of Object.entries(nodeSlotOverrides)) {
|
|
46884
47092
|
finalProps[k] = v;
|
|
46885
47093
|
}
|
|
46886
|
-
if (isDrawHost && Array.isArray(childrenConfig) && childrenConfig.length > 0) {
|
|
47094
|
+
if (isDrawHost && !drawHostUsesReactChildren && Array.isArray(childrenConfig) && childrenConfig.length > 0) {
|
|
46887
47095
|
finalProps.drawables = toDrawableNodes(childrenConfig);
|
|
46888
47096
|
}
|
|
46889
47097
|
const entityVal = finalProps.entity;
|
|
46890
47098
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
46891
47099
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
46892
47100
|
const sample = resolvedItems[0];
|
|
46893
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
47101
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React76__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
46894
47102
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
46895
47103
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
46896
47104
|
}
|
|
@@ -47062,6 +47270,8 @@ var init_UISlotRenderer = __esm({
|
|
|
47062
47270
|
"vstack",
|
|
47063
47271
|
"hstack",
|
|
47064
47272
|
"box",
|
|
47273
|
+
"canvas",
|
|
47274
|
+
"canvas-2d",
|
|
47065
47275
|
"grid",
|
|
47066
47276
|
"center",
|
|
47067
47277
|
"card",
|