@almadar/ui 5.138.0 → 5.139.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 +1297 -1224
- package/dist/avl/index.js +333 -260
- package/dist/components/index.cjs +1276 -1203
- package/dist/components/index.d.cts +9 -2
- package/dist/components/index.d.ts +9 -2
- package/dist/components/index.js +318 -245
- package/dist/lib/drawable/three/index.cjs +6 -0
- package/dist/lib/drawable/three/index.js +6 -0
- package/dist/providers/index.cjs +1180 -1107
- package/dist/providers/index.js +308 -235
- package/dist/runtime/index.cjs +1158 -1085
- package/dist/runtime/index.js +313 -240
- 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");
|
|
@@ -15861,6 +15861,21 @@ var init_projector = __esm({
|
|
|
15861
15861
|
function isValidScenePos(pos) {
|
|
15862
15862
|
return Number.isFinite(pos?.x) && Number.isFinite(pos?.y);
|
|
15863
15863
|
}
|
|
15864
|
+
function spriteRect(projector, node, natural) {
|
|
15865
|
+
const tw = projector.tileWidth;
|
|
15866
|
+
const fallbackW = projector.worldPixelDirect ? natural?.w ?? 0 : tw;
|
|
15867
|
+
const fallbackH = projector.worldPixelDirect ? natural?.h ?? 0 : tw;
|
|
15868
|
+
const w = node.width !== void 0 ? node.width * tw : fallbackW;
|
|
15869
|
+
const h = node.height !== void 0 ? node.height * tw : fallbackH;
|
|
15870
|
+
const anchor = node.anchor ?? "top-left";
|
|
15871
|
+
const p = projector.anchorPoint(node.position, anchor);
|
|
15872
|
+
return {
|
|
15873
|
+
x: anchor === "top-left" ? p.x : p.x - w / 2,
|
|
15874
|
+
y: anchor === "ground" ? p.y - h : anchor === "center" ? p.y - h / 2 : p.y,
|
|
15875
|
+
w,
|
|
15876
|
+
h
|
|
15877
|
+
};
|
|
15878
|
+
}
|
|
15864
15879
|
var init_contract = __esm({
|
|
15865
15880
|
"lib/drawable/contract.ts"() {
|
|
15866
15881
|
}
|
|
@@ -15875,16 +15890,11 @@ function paintFallbackSquare(painter, node, dctx, reason) {
|
|
|
15875
15890
|
warnMissingOnce(reason, node);
|
|
15876
15891
|
const tw = dctx.projector.tileWidth;
|
|
15877
15892
|
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;
|
|
15893
|
+
const rect = spriteRect(dctx.projector, node, { w: natural, h: natural });
|
|
15884
15894
|
painter.save();
|
|
15885
15895
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
15886
|
-
painter.fillRect(
|
|
15887
|
-
painter.strokeRect(
|
|
15896
|
+
painter.fillRect(rect.x, rect.y, rect.w, rect.h, "#9b8f7f");
|
|
15897
|
+
painter.strokeRect(rect.x, rect.y, rect.w, rect.h, "#5e564b", Math.max(1, tw / 32));
|
|
15888
15898
|
painter.restore();
|
|
15889
15899
|
}
|
|
15890
15900
|
function DrawSprite(_props) {
|
|
@@ -15921,15 +15931,10 @@ var init_DrawSprite = __esm({
|
|
|
15921
15931
|
}
|
|
15922
15932
|
src = { x: r.sx, y: r.sy, w: r.sw, h: r.sh };
|
|
15923
15933
|
}
|
|
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;
|
|
15934
|
+
const rect = spriteRect(dctx.projector, node, src ? { w: src.w, h: src.h } : { w: tex.width, h: tex.height });
|
|
15935
|
+
const { w, h } = rect;
|
|
15936
|
+
const dx = rect.x;
|
|
15937
|
+
const dy = rect.y;
|
|
15933
15938
|
painter.save();
|
|
15934
15939
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
15935
15940
|
if (node.shadow) painter.setShadow(node.shadow);
|
|
@@ -15951,9 +15956,24 @@ var init_DrawSprite = __esm({
|
|
|
15951
15956
|
};
|
|
15952
15957
|
}
|
|
15953
15958
|
});
|
|
15954
|
-
|
|
15955
|
-
|
|
15956
|
-
|
|
15959
|
+
var DrawableRegistryContext;
|
|
15960
|
+
var init_registry = __esm({
|
|
15961
|
+
"lib/drawable/registry.ts"() {
|
|
15962
|
+
DrawableRegistryContext = createContext(null);
|
|
15963
|
+
}
|
|
15964
|
+
});
|
|
15965
|
+
function DrawShape(props) {
|
|
15966
|
+
const register = useContext(DrawableRegistryContext);
|
|
15967
|
+
if (register) {
|
|
15968
|
+
const { opacity, ...rest } = props;
|
|
15969
|
+
const node = {
|
|
15970
|
+
...rest,
|
|
15971
|
+
type: "draw-shape",
|
|
15972
|
+
...opacity !== void 0 && opacity > 0 ? { opacity } : {}
|
|
15973
|
+
};
|
|
15974
|
+
register(node);
|
|
15975
|
+
return /* @__PURE__ */ jsx("div", { "data-draw-shape-debug": "", style: { position: "absolute", width: 4, height: 4, background: "red", zIndex: 9999 } });
|
|
15976
|
+
}
|
|
15957
15977
|
return null;
|
|
15958
15978
|
}
|
|
15959
15979
|
var paintShape;
|
|
@@ -15961,6 +15981,7 @@ var init_DrawShape = __esm({
|
|
|
15961
15981
|
"components/game/atoms/DrawShape.tsx"() {
|
|
15962
15982
|
"use client";
|
|
15963
15983
|
init_contract();
|
|
15984
|
+
init_registry();
|
|
15964
15985
|
paintShape = (painter, node, dctx) => {
|
|
15965
15986
|
if (!isValidScenePos(node.position)) return;
|
|
15966
15987
|
painter.save();
|
|
@@ -16145,12 +16166,18 @@ function collectDrawnItems(nodes) {
|
|
|
16145
16166
|
for (const n of nodes) {
|
|
16146
16167
|
switch (n.type) {
|
|
16147
16168
|
case "draw-sprite":
|
|
16169
|
+
if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id, anchor: n.anchor, width: n.width, height: n.height });
|
|
16170
|
+
break;
|
|
16148
16171
|
case "draw-shape":
|
|
16149
16172
|
case "draw-text":
|
|
16150
16173
|
case "draw-group":
|
|
16151
16174
|
if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id });
|
|
16152
16175
|
break;
|
|
16153
16176
|
case "draw-sprite-layer":
|
|
16177
|
+
for (const it of n.items) {
|
|
16178
|
+
if (isValidScenePos(it.position)) out.push({ pos: it.position, id: it.id, anchor: it.anchor, width: it.width, height: it.height });
|
|
16179
|
+
}
|
|
16180
|
+
break;
|
|
16154
16181
|
case "draw-shape-layer":
|
|
16155
16182
|
case "draw-text-layer":
|
|
16156
16183
|
for (const it of n.items) {
|
|
@@ -16168,6 +16195,15 @@ function buildHitIndex(items) {
|
|
|
16168
16195
|
}
|
|
16169
16196
|
return m;
|
|
16170
16197
|
}
|
|
16198
|
+
function hitTestSprites(items, projector, point) {
|
|
16199
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
16200
|
+
const it = items[i];
|
|
16201
|
+
if (it.id === void 0) continue;
|
|
16202
|
+
const r = spriteRect(projector, { position: it.pos, anchor: it.anchor, width: it.width, height: it.height });
|
|
16203
|
+
if (point.x >= r.x && point.x <= r.x + r.w && point.y >= r.y && point.y <= r.y + r.h) return it.id;
|
|
16204
|
+
}
|
|
16205
|
+
return void 0;
|
|
16206
|
+
}
|
|
16171
16207
|
var init_hitTest = __esm({
|
|
16172
16208
|
"lib/drawable/hitTest.ts"() {
|
|
16173
16209
|
init_contract();
|
|
@@ -16196,9 +16232,17 @@ function Canvas2D({
|
|
|
16196
16232
|
showMinimap = true,
|
|
16197
16233
|
followTarget,
|
|
16198
16234
|
cameraPos,
|
|
16199
|
-
bgColor
|
|
16235
|
+
bgColor,
|
|
16236
|
+
children
|
|
16200
16237
|
}) {
|
|
16201
16238
|
const instanceId = useMemo(() => Math.random().toString(36).slice(2, 8), []);
|
|
16239
|
+
const childDrawablesRef = useRef([]);
|
|
16240
|
+
childDrawablesRef.current = [];
|
|
16241
|
+
const registerChildDrawable = useCallback((node) => {
|
|
16242
|
+
childDrawablesRef.current.push(node);
|
|
16243
|
+
}, []);
|
|
16244
|
+
const hasJsxChildren = React76.Children.count(children) > 0;
|
|
16245
|
+
drawables && drawables.length > 0 ? drawables : childDrawablesRef.current;
|
|
16202
16246
|
function isDrawableLayer(node) {
|
|
16203
16247
|
return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
|
|
16204
16248
|
}
|
|
@@ -16381,7 +16425,19 @@ function Canvas2D({
|
|
|
16381
16425
|
ctx.fillStyle = bgColor ?? BACKGROUND_FALLBACK_COLOR;
|
|
16382
16426
|
ctx.fillRect(0, 0, viewportSize.width, viewportSize.height);
|
|
16383
16427
|
}
|
|
16384
|
-
if (!drawables || drawables.length === 0)
|
|
16428
|
+
if (!drawables || drawables.length === 0) {
|
|
16429
|
+
const childDrawables = childDrawablesRef.current;
|
|
16430
|
+
if (childDrawables.length === 0) return;
|
|
16431
|
+
const painter0 = createWebPainter(ctx, bumpAtlas);
|
|
16432
|
+
painter0.save();
|
|
16433
|
+
painter0.translate(viewportSize.width / 2, viewportSize.height / 2);
|
|
16434
|
+
painter0.scale(cameraRef.current.zoom, cameraRef.current.zoom);
|
|
16435
|
+
painter0.translate(-viewportSize.width / 2, -viewportSize.height / 2);
|
|
16436
|
+
const dctx0 = { projector, time: 0, invalidate: bumpAtlas };
|
|
16437
|
+
for (const node of childDrawables) paintDrawable(painter0, node, dctx0);
|
|
16438
|
+
painter0.restore();
|
|
16439
|
+
return;
|
|
16440
|
+
}
|
|
16385
16441
|
const cam = cameraRef.current;
|
|
16386
16442
|
if (camera !== "follow" && dragDistance() === 0) {
|
|
16387
16443
|
const focus = cameraPos ?? defaultGridFocus;
|
|
@@ -16465,6 +16521,11 @@ function Canvas2D({
|
|
|
16465
16521
|
if (dragDistance() > 5) return;
|
|
16466
16522
|
if (!canvasRef.current || !tileClickEvent && !unitClickEvent) return;
|
|
16467
16523
|
const world = screenToWorld(e.clientX, e.clientY, canvasRef.current, viewportSize);
|
|
16524
|
+
const spriteHit = unitClickEvent ? hitTestSprites(drawnItems, projector, world) : void 0;
|
|
16525
|
+
if (spriteHit !== void 0 && unitClickEvent) {
|
|
16526
|
+
eventBus.emit(`UI:${unitClickEvent}`, { unitId: spriteHit });
|
|
16527
|
+
return;
|
|
16528
|
+
}
|
|
16468
16529
|
const adjustedX = world.x - scaledTileWidth / 2;
|
|
16469
16530
|
const adjustedY = squareGrid ? world.y - scaledTileWidth / 2 : world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
16470
16531
|
const isoPos = unproject(adjustedX, adjustedY);
|
|
@@ -16474,7 +16535,7 @@ function Canvas2D({
|
|
|
16474
16535
|
} else if (tileClickEvent) {
|
|
16475
16536
|
eventBus.emit(`UI:${tileClickEvent}`, { x: isoPos.x, y: isoPos.y });
|
|
16476
16537
|
}
|
|
16477
|
-
}, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, hitIndex, tileClickEvent, unitClickEvent, eventBus]);
|
|
16538
|
+
}, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, hitIndex, drawnItems, projector, tileClickEvent, unitClickEvent, eventBus]);
|
|
16478
16539
|
const handleCanvasPointerLeave = useCallback(() => {
|
|
16479
16540
|
handleMouseLeave();
|
|
16480
16541
|
if (tileLeaveEvent) eventBus.emit(`UI:${tileLeaveEvent}`, {});
|
|
@@ -16544,7 +16605,7 @@ function Canvas2D({
|
|
|
16544
16605
|
/* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-muted-foreground", children: t("canvas.loadingMessage") || "Loading\u2026" })
|
|
16545
16606
|
] }) });
|
|
16546
16607
|
}
|
|
16547
|
-
if (!drawables || drawables.length === 0) {
|
|
16608
|
+
if ((!drawables || drawables.length === 0) && !hasJsxChildren) {
|
|
16548
16609
|
return /* @__PURE__ */ jsx(
|
|
16549
16610
|
Box,
|
|
16550
16611
|
{
|
|
@@ -16558,7 +16619,7 @@ function Canvas2D({
|
|
|
16558
16619
|
}
|
|
16559
16620
|
);
|
|
16560
16621
|
}
|
|
16561
|
-
return /* @__PURE__ */ jsxs(
|
|
16622
|
+
return /* @__PURE__ */ jsx(DrawableRegistryContext.Provider, { value: registerChildDrawable, children: /* @__PURE__ */ jsxs(
|
|
16562
16623
|
Box,
|
|
16563
16624
|
{
|
|
16564
16625
|
ref: containerRef,
|
|
@@ -16619,10 +16680,19 @@ function Canvas2D({
|
|
|
16619
16680
|
mapWidth: miniMapWidth,
|
|
16620
16681
|
mapHeight: miniMapHeight
|
|
16621
16682
|
}
|
|
16622
|
-
) })
|
|
16683
|
+
) }),
|
|
16684
|
+
hasJsxChildren && /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children }),
|
|
16685
|
+
/* @__PURE__ */ jsxs("div", { "data-debug": "", style: { position: "absolute", top: 0, left: 0, background: "yellow", color: "black", zIndex: 9999, fontSize: 24, padding: 8 }, children: [
|
|
16686
|
+
"C=",
|
|
16687
|
+
React76.Children.count(children),
|
|
16688
|
+
" J=",
|
|
16689
|
+
String(hasJsxChildren),
|
|
16690
|
+
" D=",
|
|
16691
|
+
drawables?.length ?? -1
|
|
16692
|
+
] })
|
|
16623
16693
|
]
|
|
16624
16694
|
}
|
|
16625
|
-
);
|
|
16695
|
+
) });
|
|
16626
16696
|
}
|
|
16627
16697
|
var canvas2DLog;
|
|
16628
16698
|
var init_Canvas2D = __esm({
|
|
@@ -16644,6 +16714,7 @@ var init_Canvas2D = __esm({
|
|
|
16644
16714
|
init_webPainter2d();
|
|
16645
16715
|
init_projector();
|
|
16646
16716
|
init_paintDispatch();
|
|
16717
|
+
init_registry();
|
|
16647
16718
|
init_hitTest();
|
|
16648
16719
|
init_isometric();
|
|
16649
16720
|
canvas2DLog = createLogger("almadar:ui:game-canvas");
|
|
@@ -16685,7 +16756,8 @@ function Canvas({
|
|
|
16685
16756
|
tileLeaveEvent,
|
|
16686
16757
|
featureClickEvent,
|
|
16687
16758
|
keyMap,
|
|
16688
|
-
keyUpMap
|
|
16759
|
+
keyUpMap,
|
|
16760
|
+
children
|
|
16689
16761
|
}) {
|
|
16690
16762
|
canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
|
|
16691
16763
|
const zoom = camera?.zoom;
|
|
@@ -16738,7 +16810,8 @@ function Canvas({
|
|
|
16738
16810
|
tileHoverEvent,
|
|
16739
16811
|
tileLeaveEvent,
|
|
16740
16812
|
keyMap,
|
|
16741
|
-
keyUpMap
|
|
16813
|
+
keyUpMap,
|
|
16814
|
+
...children !== void 0 ? { children } : {}
|
|
16742
16815
|
}
|
|
16743
16816
|
);
|
|
16744
16817
|
}
|
|
@@ -19021,9 +19094,9 @@ function ControlButton({
|
|
|
19021
19094
|
className
|
|
19022
19095
|
}) {
|
|
19023
19096
|
const eventBus = useEventBus();
|
|
19024
|
-
const [isPressed, setIsPressed] =
|
|
19097
|
+
const [isPressed, setIsPressed] = React76.useState(false);
|
|
19025
19098
|
const actualPressed = pressed ?? isPressed;
|
|
19026
|
-
const handlePointerDown =
|
|
19099
|
+
const handlePointerDown = React76.useCallback(
|
|
19027
19100
|
(e) => {
|
|
19028
19101
|
e.preventDefault();
|
|
19029
19102
|
if (disabled) return;
|
|
@@ -19033,7 +19106,7 @@ function ControlButton({
|
|
|
19033
19106
|
},
|
|
19034
19107
|
[disabled, pressEvent, eventBus, onPress]
|
|
19035
19108
|
);
|
|
19036
|
-
const handlePointerUp =
|
|
19109
|
+
const handlePointerUp = React76.useCallback(
|
|
19037
19110
|
(e) => {
|
|
19038
19111
|
e.preventDefault();
|
|
19039
19112
|
if (disabled) return;
|
|
@@ -19043,7 +19116,7 @@ function ControlButton({
|
|
|
19043
19116
|
},
|
|
19044
19117
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
19045
19118
|
);
|
|
19046
|
-
const handlePointerLeave =
|
|
19119
|
+
const handlePointerLeave = React76.useCallback(
|
|
19047
19120
|
(e) => {
|
|
19048
19121
|
if (isPressed) {
|
|
19049
19122
|
setIsPressed(false);
|
|
@@ -19131,8 +19204,8 @@ function ControlGrid({
|
|
|
19131
19204
|
className
|
|
19132
19205
|
}) {
|
|
19133
19206
|
const eventBus = useEventBus();
|
|
19134
|
-
const [active, setActive] =
|
|
19135
|
-
const handlePress =
|
|
19207
|
+
const [active, setActive] = React76.useState(/* @__PURE__ */ new Set());
|
|
19208
|
+
const handlePress = React76.useCallback(
|
|
19136
19209
|
(id) => {
|
|
19137
19210
|
setActive((prev) => new Set(prev).add(id));
|
|
19138
19211
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -19146,7 +19219,7 @@ function ControlGrid({
|
|
|
19146
19219
|
},
|
|
19147
19220
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
19148
19221
|
);
|
|
19149
|
-
const handleRelease =
|
|
19222
|
+
const handleRelease = React76.useCallback(
|
|
19150
19223
|
(id) => {
|
|
19151
19224
|
setActive((prev) => {
|
|
19152
19225
|
const next = new Set(prev);
|
|
@@ -20384,8 +20457,8 @@ var init_Menu = __esm({
|
|
|
20384
20457
|
"bottom-end": "bottom-start"
|
|
20385
20458
|
};
|
|
20386
20459
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
20387
|
-
const triggerChild =
|
|
20388
|
-
const triggerElement =
|
|
20460
|
+
const triggerChild = React76__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
20461
|
+
const triggerElement = React76__default.cloneElement(
|
|
20389
20462
|
triggerChild,
|
|
20390
20463
|
{
|
|
20391
20464
|
ref: triggerRef,
|
|
@@ -20480,14 +20553,14 @@ function useDataDnd(args) {
|
|
|
20480
20553
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
20481
20554
|
const enabled = isZone || Boolean(dndRoot);
|
|
20482
20555
|
const eventBus = useEventBus();
|
|
20483
|
-
const parentRoot =
|
|
20556
|
+
const parentRoot = React76__default.useContext(RootCtx);
|
|
20484
20557
|
const isRoot = enabled && parentRoot === null;
|
|
20485
|
-
const zoneId =
|
|
20558
|
+
const zoneId = React76__default.useId();
|
|
20486
20559
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
20487
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
20488
|
-
const optimisticOrdersRef =
|
|
20560
|
+
const [optimisticOrders, setOptimisticOrders] = React76__default.useState(() => /* @__PURE__ */ new Map());
|
|
20561
|
+
const optimisticOrdersRef = React76__default.useRef(optimisticOrders);
|
|
20489
20562
|
optimisticOrdersRef.current = optimisticOrders;
|
|
20490
|
-
const clearOptimisticOrder =
|
|
20563
|
+
const clearOptimisticOrder = React76__default.useCallback((group) => {
|
|
20491
20564
|
setOptimisticOrders((prev) => {
|
|
20492
20565
|
if (!prev.has(group)) return prev;
|
|
20493
20566
|
const next = new Map(prev);
|
|
@@ -20512,7 +20585,7 @@ function useDataDnd(args) {
|
|
|
20512
20585
|
const raw = it[dndItemIdField];
|
|
20513
20586
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
20514
20587
|
}).join("|");
|
|
20515
|
-
const itemIds =
|
|
20588
|
+
const itemIds = React76__default.useMemo(
|
|
20516
20589
|
() => orderedItems.map((it, idx) => {
|
|
20517
20590
|
const raw = it[dndItemIdField];
|
|
20518
20591
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -20523,7 +20596,7 @@ function useDataDnd(args) {
|
|
|
20523
20596
|
const raw = it[dndItemIdField];
|
|
20524
20597
|
return raw != null ? String(raw) : `__${idx}`;
|
|
20525
20598
|
}).join("|");
|
|
20526
|
-
|
|
20599
|
+
React76__default.useEffect(() => {
|
|
20527
20600
|
const root = isRoot ? null : parentRoot;
|
|
20528
20601
|
if (root) {
|
|
20529
20602
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -20531,20 +20604,20 @@ function useDataDnd(args) {
|
|
|
20531
20604
|
clearOptimisticOrder(ownGroup);
|
|
20532
20605
|
}
|
|
20533
20606
|
}, [itemsContentSig, ownGroup]);
|
|
20534
|
-
const zonesRef =
|
|
20535
|
-
const registerZone =
|
|
20607
|
+
const zonesRef = React76__default.useRef(/* @__PURE__ */ new Map());
|
|
20608
|
+
const registerZone = React76__default.useCallback((zoneId2, meta2) => {
|
|
20536
20609
|
zonesRef.current.set(zoneId2, meta2);
|
|
20537
20610
|
}, []);
|
|
20538
|
-
const unregisterZone =
|
|
20611
|
+
const unregisterZone = React76__default.useCallback((zoneId2) => {
|
|
20539
20612
|
zonesRef.current.delete(zoneId2);
|
|
20540
20613
|
}, []);
|
|
20541
|
-
const [activeDrag, setActiveDrag] =
|
|
20542
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
20543
|
-
const meta =
|
|
20614
|
+
const [activeDrag, setActiveDrag] = React76__default.useState(null);
|
|
20615
|
+
const [overZoneGroup, setOverZoneGroup] = React76__default.useState(null);
|
|
20616
|
+
const meta = React76__default.useMemo(
|
|
20544
20617
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
20545
20618
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
20546
20619
|
);
|
|
20547
|
-
|
|
20620
|
+
React76__default.useEffect(() => {
|
|
20548
20621
|
const target = isRoot ? null : parentRoot;
|
|
20549
20622
|
if (!target) {
|
|
20550
20623
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -20563,7 +20636,7 @@ function useDataDnd(args) {
|
|
|
20563
20636
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
20564
20637
|
const sensors = useAlmadarDndSensors(true);
|
|
20565
20638
|
const collisionDetection = almadarDndCollisionDetection;
|
|
20566
|
-
const findZoneByItem =
|
|
20639
|
+
const findZoneByItem = React76__default.useCallback(
|
|
20567
20640
|
(id) => {
|
|
20568
20641
|
for (const z of zonesRef.current.values()) {
|
|
20569
20642
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -20572,7 +20645,7 @@ function useDataDnd(args) {
|
|
|
20572
20645
|
},
|
|
20573
20646
|
[]
|
|
20574
20647
|
);
|
|
20575
|
-
|
|
20648
|
+
React76__default.useCallback(
|
|
20576
20649
|
(group) => {
|
|
20577
20650
|
for (const z of zonesRef.current.values()) {
|
|
20578
20651
|
if (z.group === group) return z;
|
|
@@ -20581,7 +20654,7 @@ function useDataDnd(args) {
|
|
|
20581
20654
|
},
|
|
20582
20655
|
[]
|
|
20583
20656
|
);
|
|
20584
|
-
const handleDragEnd =
|
|
20657
|
+
const handleDragEnd = React76__default.useCallback(
|
|
20585
20658
|
(event) => {
|
|
20586
20659
|
const { active, over } = event;
|
|
20587
20660
|
const activeIdStr = String(active.id);
|
|
@@ -20672,8 +20745,8 @@ function useDataDnd(args) {
|
|
|
20672
20745
|
},
|
|
20673
20746
|
[eventBus]
|
|
20674
20747
|
);
|
|
20675
|
-
const sortableData =
|
|
20676
|
-
const SortableItem =
|
|
20748
|
+
const sortableData = React76__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
20749
|
+
const SortableItem = React76__default.useCallback(
|
|
20677
20750
|
({ id, children }) => {
|
|
20678
20751
|
const {
|
|
20679
20752
|
attributes,
|
|
@@ -20713,7 +20786,7 @@ function useDataDnd(args) {
|
|
|
20713
20786
|
id: droppableId,
|
|
20714
20787
|
data: sortableData
|
|
20715
20788
|
});
|
|
20716
|
-
const ctx =
|
|
20789
|
+
const ctx = React76__default.useContext(RootCtx);
|
|
20717
20790
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
20718
20791
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
20719
20792
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -20728,7 +20801,7 @@ function useDataDnd(args) {
|
|
|
20728
20801
|
showForeignPlaceholder,
|
|
20729
20802
|
ctxAvailable: ctx != null
|
|
20730
20803
|
});
|
|
20731
|
-
|
|
20804
|
+
React76__default.useEffect(() => {
|
|
20732
20805
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
20733
20806
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
20734
20807
|
return /* @__PURE__ */ jsx(
|
|
@@ -20742,11 +20815,11 @@ function useDataDnd(args) {
|
|
|
20742
20815
|
}
|
|
20743
20816
|
);
|
|
20744
20817
|
};
|
|
20745
|
-
const rootContextValue =
|
|
20818
|
+
const rootContextValue = React76__default.useMemo(
|
|
20746
20819
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
20747
20820
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
20748
20821
|
);
|
|
20749
|
-
const handleDragStart =
|
|
20822
|
+
const handleDragStart = React76__default.useCallback((event) => {
|
|
20750
20823
|
const sourceZone = findZoneByItem(event.active.id);
|
|
20751
20824
|
const rect = event.active.rect.current.initial;
|
|
20752
20825
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -20765,7 +20838,7 @@ function useDataDnd(args) {
|
|
|
20765
20838
|
isRoot
|
|
20766
20839
|
});
|
|
20767
20840
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
20768
|
-
const handleDragOver =
|
|
20841
|
+
const handleDragOver = React76__default.useCallback((event) => {
|
|
20769
20842
|
const { active, over } = event;
|
|
20770
20843
|
const overData = over?.data?.current;
|
|
20771
20844
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -20835,7 +20908,7 @@ function useDataDnd(args) {
|
|
|
20835
20908
|
return next;
|
|
20836
20909
|
});
|
|
20837
20910
|
}, []);
|
|
20838
|
-
const handleDragCancel =
|
|
20911
|
+
const handleDragCancel = React76__default.useCallback((event) => {
|
|
20839
20912
|
setActiveDrag(null);
|
|
20840
20913
|
setOverZoneGroup(null);
|
|
20841
20914
|
dndLog.warn("dragCancel", {
|
|
@@ -20843,12 +20916,12 @@ function useDataDnd(args) {
|
|
|
20843
20916
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
20844
20917
|
});
|
|
20845
20918
|
}, []);
|
|
20846
|
-
const handleDragEndWithCleanup =
|
|
20919
|
+
const handleDragEndWithCleanup = React76__default.useCallback((event) => {
|
|
20847
20920
|
handleDragEnd(event);
|
|
20848
20921
|
setActiveDrag(null);
|
|
20849
20922
|
setOverZoneGroup(null);
|
|
20850
20923
|
}, [handleDragEnd]);
|
|
20851
|
-
const wrapContainer =
|
|
20924
|
+
const wrapContainer = React76__default.useCallback(
|
|
20852
20925
|
(children) => {
|
|
20853
20926
|
if (!enabled) return children;
|
|
20854
20927
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -20902,7 +20975,7 @@ var init_useDataDnd = __esm({
|
|
|
20902
20975
|
init_useAlmadarDndCollision();
|
|
20903
20976
|
init_Box();
|
|
20904
20977
|
dndLog = createLogger("almadar:ui:dnd");
|
|
20905
|
-
RootCtx =
|
|
20978
|
+
RootCtx = React76__default.createContext(null);
|
|
20906
20979
|
}
|
|
20907
20980
|
});
|
|
20908
20981
|
function renderIconInput(icon, props) {
|
|
@@ -21444,7 +21517,7 @@ function DataList({
|
|
|
21444
21517
|
}) {
|
|
21445
21518
|
const eventBus = useEventBus();
|
|
21446
21519
|
const { t } = useTranslate();
|
|
21447
|
-
const [visibleCount, setVisibleCount] =
|
|
21520
|
+
const [visibleCount, setVisibleCount] = React76__default.useState(pageSize || Infinity);
|
|
21448
21521
|
const fieldDefs = fields ?? columns ?? [];
|
|
21449
21522
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
21450
21523
|
const dnd = useDataDnd({
|
|
@@ -21460,14 +21533,14 @@ function DataList({
|
|
|
21460
21533
|
dndRoot
|
|
21461
21534
|
});
|
|
21462
21535
|
const orderedData = dnd.orderedItems;
|
|
21463
|
-
const allData =
|
|
21536
|
+
const allData = React76__default.useMemo(
|
|
21464
21537
|
() => sortRows(orderedData, sortBy, sortDirection),
|
|
21465
21538
|
[orderedData, sortBy, sortDirection]
|
|
21466
21539
|
);
|
|
21467
21540
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
21468
21541
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
21469
21542
|
const hasRenderProp = typeof children === "function";
|
|
21470
|
-
|
|
21543
|
+
React76__default.useEffect(() => {
|
|
21471
21544
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
21472
21545
|
const childrenTypeOf = typeof children;
|
|
21473
21546
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -21582,7 +21655,7 @@ function DataList({
|
|
|
21582
21655
|
return v === void 0 || v === null || v === "" ? raw : String(v);
|
|
21583
21656
|
};
|
|
21584
21657
|
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
|
|
21585
|
-
groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
21658
|
+
groups2.map((group, gi) => /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
21586
21659
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
21587
21660
|
group.items.map((itemData, index) => {
|
|
21588
21661
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -21781,7 +21854,7 @@ function DataList({
|
|
|
21781
21854
|
className
|
|
21782
21855
|
),
|
|
21783
21856
|
children: [
|
|
21784
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
21857
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
21785
21858
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
21786
21859
|
group.items.map(
|
|
21787
21860
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -21890,8 +21963,8 @@ function ScalarControl({
|
|
|
21890
21963
|
}
|
|
21891
21964
|
const numeric = typeof value === "number";
|
|
21892
21965
|
const initial = value === null ? "" : String(value);
|
|
21893
|
-
const [draft, setDraft] =
|
|
21894
|
-
|
|
21966
|
+
const [draft, setDraft] = React76__default.useState(initial);
|
|
21967
|
+
React76__default.useEffect(() => setDraft(initial), [initial]);
|
|
21895
21968
|
const commit = () => {
|
|
21896
21969
|
if (numeric) {
|
|
21897
21970
|
const n = draft.trim() === "" ? 0 : Number(draft);
|
|
@@ -21959,8 +22032,8 @@ function Row({
|
|
|
21959
22032
|
onRemove,
|
|
21960
22033
|
readonly
|
|
21961
22034
|
}) {
|
|
21962
|
-
const [keyDraft, setKeyDraft] =
|
|
21963
|
-
|
|
22035
|
+
const [keyDraft, setKeyDraft] = React76__default.useState(rowKey);
|
|
22036
|
+
React76__default.useEffect(() => setKeyDraft(rowKey), [rowKey]);
|
|
21964
22037
|
const container = isObj(value) || isArr(value);
|
|
21965
22038
|
return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "group w-max min-w-full", children: [
|
|
21966
22039
|
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", className: "py-0.5 w-max", children: [
|
|
@@ -22003,7 +22076,7 @@ function ContainerNode({
|
|
|
22003
22076
|
depth,
|
|
22004
22077
|
readonly
|
|
22005
22078
|
}) {
|
|
22006
|
-
const [open, setOpen] =
|
|
22079
|
+
const [open, setOpen] = React76__default.useState(depth < 2);
|
|
22007
22080
|
const array = isArr(value);
|
|
22008
22081
|
const entries = array ? value.map((v, i) => [String(i), v]) : Object.entries(value);
|
|
22009
22082
|
const setObjValue = (key, next) => {
|
|
@@ -22145,7 +22218,7 @@ var init_FormSection = __esm({
|
|
|
22145
22218
|
columns = 1,
|
|
22146
22219
|
className
|
|
22147
22220
|
}) => {
|
|
22148
|
-
const [collapsed, setCollapsed] =
|
|
22221
|
+
const [collapsed, setCollapsed] = React76__default.useState(defaultCollapsed);
|
|
22149
22222
|
const { t } = useTranslate();
|
|
22150
22223
|
const eventBus = useEventBus();
|
|
22151
22224
|
const gridClass = {
|
|
@@ -22153,7 +22226,7 @@ var init_FormSection = __esm({
|
|
|
22153
22226
|
2: "grid-cols-1 md:grid-cols-2",
|
|
22154
22227
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
22155
22228
|
}[columns];
|
|
22156
|
-
|
|
22229
|
+
React76__default.useCallback(() => {
|
|
22157
22230
|
if (collapsible) {
|
|
22158
22231
|
setCollapsed((prev) => !prev);
|
|
22159
22232
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -22561,8 +22634,8 @@ function TextLikeControl({
|
|
|
22561
22634
|
onCommit
|
|
22562
22635
|
}) {
|
|
22563
22636
|
const initial = value === void 0 || value === null ? "" : String(value);
|
|
22564
|
-
const [draft, setDraft] =
|
|
22565
|
-
|
|
22637
|
+
const [draft, setDraft] = React76__default.useState(initial);
|
|
22638
|
+
React76__default.useEffect(() => setDraft(initial), [initial]);
|
|
22566
22639
|
const commit = () => {
|
|
22567
22640
|
if (numeric) {
|
|
22568
22641
|
const n = draft.trim() === "" ? 0 : Number(draft);
|
|
@@ -22747,14 +22820,14 @@ var init_NodeSlotEditor = __esm({
|
|
|
22747
22820
|
isObj2 = (v) => v !== null && v !== void 0 && typeof v === "object" && !Array.isArray(v);
|
|
22748
22821
|
NodeSlotEditor = ({ value, onChange, className }) => {
|
|
22749
22822
|
const { type, props, wasArray } = normalize(value);
|
|
22750
|
-
const patterns =
|
|
22823
|
+
const patterns = React76__default.useMemo(() => {
|
|
22751
22824
|
try {
|
|
22752
22825
|
return [...getKnownPatterns()].sort();
|
|
22753
22826
|
} catch {
|
|
22754
22827
|
return [];
|
|
22755
22828
|
}
|
|
22756
22829
|
}, []);
|
|
22757
|
-
const options =
|
|
22830
|
+
const options = React76__default.useMemo(
|
|
22758
22831
|
() => [{ value: "", label: "\u2014 none \u2014" }, ...patterns.map((p) => ({ value: p, label: p }))],
|
|
22759
22832
|
[patterns]
|
|
22760
22833
|
);
|
|
@@ -22766,7 +22839,7 @@ var init_NodeSlotEditor = __esm({
|
|
|
22766
22839
|
const pattern = { type: nextType, ...nextProps };
|
|
22767
22840
|
onChange(wasArray || value === void 0 ? [pattern] : pattern);
|
|
22768
22841
|
};
|
|
22769
|
-
const schemaEntries =
|
|
22842
|
+
const schemaEntries = React76__default.useMemo(() => {
|
|
22770
22843
|
if (!type) return [];
|
|
22771
22844
|
const def = getPatternDefinition(type);
|
|
22772
22845
|
if (!def?.propsSchema) return [];
|
|
@@ -23587,7 +23660,7 @@ var init_Flex = __esm({
|
|
|
23587
23660
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
23588
23661
|
}
|
|
23589
23662
|
}
|
|
23590
|
-
return
|
|
23663
|
+
return React76__default.createElement(Component, {
|
|
23591
23664
|
className: cn(
|
|
23592
23665
|
inline ? "inline-flex" : "flex",
|
|
23593
23666
|
directionStyles[direction],
|
|
@@ -23706,7 +23779,7 @@ var init_Grid = __esm({
|
|
|
23706
23779
|
as: Component = "div"
|
|
23707
23780
|
}) => {
|
|
23708
23781
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
23709
|
-
return
|
|
23782
|
+
return React76__default.createElement(
|
|
23710
23783
|
Component,
|
|
23711
23784
|
{
|
|
23712
23785
|
className: cn(
|
|
@@ -23938,9 +24011,9 @@ var init_Popover = __esm({
|
|
|
23938
24011
|
onMouseLeave: handleClose,
|
|
23939
24012
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
23940
24013
|
};
|
|
23941
|
-
const childElement =
|
|
24014
|
+
const childElement = React76__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
23942
24015
|
const childPointerDown = childElement.props.onPointerDown;
|
|
23943
|
-
const triggerElement =
|
|
24016
|
+
const triggerElement = React76__default.cloneElement(
|
|
23944
24017
|
childElement,
|
|
23945
24018
|
{
|
|
23946
24019
|
ref: triggerRef,
|
|
@@ -24799,9 +24872,9 @@ var init_Tooltip = __esm({
|
|
|
24799
24872
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
24800
24873
|
};
|
|
24801
24874
|
}, []);
|
|
24802
|
-
const triggerElement =
|
|
24875
|
+
const triggerElement = React76__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
24803
24876
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
24804
|
-
const trigger =
|
|
24877
|
+
const trigger = React76__default.cloneElement(triggerElement, {
|
|
24805
24878
|
ref: triggerRef,
|
|
24806
24879
|
onMouseEnter: handleMouseEnter,
|
|
24807
24880
|
onMouseLeave: handleMouseLeave,
|
|
@@ -24891,7 +24964,7 @@ var init_WizardProgress = __esm({
|
|
|
24891
24964
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
24892
24965
|
const isActive = index === currentStep;
|
|
24893
24966
|
const isCompleted = index < currentStep;
|
|
24894
|
-
return /* @__PURE__ */ jsxs(
|
|
24967
|
+
return /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
24895
24968
|
/* @__PURE__ */ jsx(
|
|
24896
24969
|
"button",
|
|
24897
24970
|
{
|
|
@@ -26702,7 +26775,7 @@ function GameMenu({
|
|
|
26702
26775
|
}) {
|
|
26703
26776
|
const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
|
|
26704
26777
|
const eventBus = useEventBus();
|
|
26705
|
-
const handleOptionClick =
|
|
26778
|
+
const handleOptionClick = React76.useCallback(
|
|
26706
26779
|
(option) => {
|
|
26707
26780
|
if (option.event) {
|
|
26708
26781
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -26938,7 +27011,7 @@ function StateGraph({
|
|
|
26938
27011
|
}) {
|
|
26939
27012
|
const eventBus = useEventBus();
|
|
26940
27013
|
const nodes = states ?? [];
|
|
26941
|
-
const positions =
|
|
27014
|
+
const positions = React76.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
26942
27015
|
return /* @__PURE__ */ jsxs(
|
|
26943
27016
|
Box,
|
|
26944
27017
|
{
|
|
@@ -27475,7 +27548,7 @@ function LinearView({
|
|
|
27475
27548
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
27476
27549
|
const isDone = i < currentIdx;
|
|
27477
27550
|
const isCurrent = i === currentIdx;
|
|
27478
|
-
return /* @__PURE__ */ jsxs(
|
|
27551
|
+
return /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
27479
27552
|
i > 0 && /* @__PURE__ */ jsx(
|
|
27480
27553
|
Typography,
|
|
27481
27554
|
{
|
|
@@ -28108,7 +28181,7 @@ function SequenceBar({
|
|
|
28108
28181
|
else onSlotRemove?.(index);
|
|
28109
28182
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
28110
28183
|
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(
|
|
28184
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
28112
28185
|
i > 0 && /* @__PURE__ */ jsx(
|
|
28113
28186
|
Typography,
|
|
28114
28187
|
{
|
|
@@ -29088,7 +29161,7 @@ var init_MapView = __esm({
|
|
|
29088
29161
|
shadowSize: [41, 41]
|
|
29089
29162
|
});
|
|
29090
29163
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
29091
|
-
const { useEffect: useEffect65, useRef: useRef63, useCallback: useCallback106, useState: useState103 } =
|
|
29164
|
+
const { useEffect: useEffect65, useRef: useRef63, useCallback: useCallback106, useState: useState103 } = React76__default;
|
|
29092
29165
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
29093
29166
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
29094
29167
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -30006,8 +30079,8 @@ function TableView({
|
|
|
30006
30079
|
}) {
|
|
30007
30080
|
const eventBus = useEventBus();
|
|
30008
30081
|
const { t } = useTranslate();
|
|
30009
|
-
const [visibleCount, setVisibleCount] =
|
|
30010
|
-
const [localSelected, setLocalSelected] =
|
|
30082
|
+
const [visibleCount, setVisibleCount] = React76__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
30083
|
+
const [localSelected, setLocalSelected] = React76__default.useState(/* @__PURE__ */ new Set());
|
|
30011
30084
|
const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
|
|
30012
30085
|
const actionDefs = Array.isArray(itemActions) ? itemActions : [];
|
|
30013
30086
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
@@ -30029,7 +30102,7 @@ function TableView({
|
|
|
30029
30102
|
const hasRenderProp = typeof children === "function";
|
|
30030
30103
|
const idField = dndItemIdField ?? "id";
|
|
30031
30104
|
const isCoarsePointer = useMediaQuery("(pointer: coarse)");
|
|
30032
|
-
|
|
30105
|
+
React76__default.useEffect(() => {
|
|
30033
30106
|
tableViewLog.debug("render", {
|
|
30034
30107
|
rowCount: data.length,
|
|
30035
30108
|
colCount: colDefs.length,
|
|
@@ -30086,7 +30159,7 @@ function TableView({
|
|
|
30086
30159
|
};
|
|
30087
30160
|
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
30088
30161
|
};
|
|
30089
|
-
const colFloors =
|
|
30162
|
+
const colFloors = React76__default.useMemo(
|
|
30090
30163
|
() => colDefs.map((col) => {
|
|
30091
30164
|
const longest = data.reduce((widest, row) => {
|
|
30092
30165
|
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
@@ -30248,12 +30321,12 @@ function TableView({
|
|
|
30248
30321
|
]
|
|
30249
30322
|
}
|
|
30250
30323
|
);
|
|
30251
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
30324
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React76__default.Fragment, { children: rowInner }, id);
|
|
30252
30325
|
};
|
|
30253
30326
|
const items = Array.from(data);
|
|
30254
30327
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
30255
30328
|
let runningIndex = 0;
|
|
30256
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
30329
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
30257
30330
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
30258
30331
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
30259
30332
|
] }, gi)) });
|
|
@@ -31616,7 +31689,7 @@ var init_StepFlow = __esm({
|
|
|
31616
31689
|
className
|
|
31617
31690
|
}) => {
|
|
31618
31691
|
if (orientation === "vertical") {
|
|
31619
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
31692
|
+
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
31693
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
31621
31694
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
31622
31695
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -31627,7 +31700,7 @@ var init_StepFlow = __esm({
|
|
|
31627
31700
|
] })
|
|
31628
31701
|
] }) }, index)) });
|
|
31629
31702
|
}
|
|
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(
|
|
31703
|
+
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
31704
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
31632
31705
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
31633
31706
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -32617,7 +32690,7 @@ var init_LikertScale = __esm({
|
|
|
32617
32690
|
md: "text-base",
|
|
32618
32691
|
lg: "text-lg"
|
|
32619
32692
|
};
|
|
32620
|
-
LikertScale =
|
|
32693
|
+
LikertScale = React76__default.forwardRef(
|
|
32621
32694
|
({
|
|
32622
32695
|
question,
|
|
32623
32696
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -32629,7 +32702,7 @@ var init_LikertScale = __esm({
|
|
|
32629
32702
|
variant = "radios",
|
|
32630
32703
|
className
|
|
32631
32704
|
}, ref) => {
|
|
32632
|
-
const groupId =
|
|
32705
|
+
const groupId = React76__default.useId();
|
|
32633
32706
|
const eventBus = useEventBus();
|
|
32634
32707
|
const handleSelect = useCallback(
|
|
32635
32708
|
(next) => {
|
|
@@ -34918,7 +34991,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
34918
34991
|
"aria-label": t("aria.breadcrumb"),
|
|
34919
34992
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
34920
34993
|
const isLast = idx === items.length - 1;
|
|
34921
|
-
return /* @__PURE__ */ jsxs(
|
|
34994
|
+
return /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
34922
34995
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
34923
34996
|
Icon,
|
|
34924
34997
|
{
|
|
@@ -35787,7 +35860,7 @@ var init_MiniStateMachine = __esm({
|
|
|
35787
35860
|
const x = 2 + i * (NODE_W + GAP2 + ARROW_W + GAP2);
|
|
35788
35861
|
const tc = transitionCounts[s.name] ?? 0;
|
|
35789
35862
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
35790
|
-
return /* @__PURE__ */ jsxs(
|
|
35863
|
+
return /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
35791
35864
|
/* @__PURE__ */ jsx(
|
|
35792
35865
|
AvlState,
|
|
35793
35866
|
{
|
|
@@ -35991,7 +36064,7 @@ var init_PageHeader = __esm({
|
|
|
35991
36064
|
info: "bg-info/10 text-info"
|
|
35992
36065
|
};
|
|
35993
36066
|
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(
|
|
36067
|
+
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
36068
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
35996
36069
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
35997
36070
|
"a",
|
|
@@ -36349,7 +36422,7 @@ var init_Section = __esm({
|
|
|
36349
36422
|
as: Component = "section"
|
|
36350
36423
|
}) => {
|
|
36351
36424
|
const hasHeader = title || description || action;
|
|
36352
|
-
return
|
|
36425
|
+
return React76__default.createElement(
|
|
36353
36426
|
Component,
|
|
36354
36427
|
{
|
|
36355
36428
|
className: cn(
|
|
@@ -36723,7 +36796,7 @@ var init_WizardContainer = __esm({
|
|
|
36723
36796
|
const isCompleted = index < currentStep;
|
|
36724
36797
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
36725
36798
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
36726
|
-
return /* @__PURE__ */ jsxs(
|
|
36799
|
+
return /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
36727
36800
|
/* @__PURE__ */ jsx(
|
|
36728
36801
|
Button,
|
|
36729
36802
|
{
|
|
@@ -38510,7 +38583,7 @@ var init_ImportPreviewTree = __esm({
|
|
|
38510
38583
|
const renderUnit = (unit, childrenByParent, depth) => {
|
|
38511
38584
|
const summary = fieldSummary(unit);
|
|
38512
38585
|
const children = childrenByParent.get(unit.ref) ?? [];
|
|
38513
|
-
return /* @__PURE__ */ jsxs(
|
|
38586
|
+
return /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
38514
38587
|
/* @__PURE__ */ jsxs(
|
|
38515
38588
|
Box,
|
|
38516
38589
|
{
|
|
@@ -38607,7 +38680,7 @@ var init_ImportProgress = __esm({
|
|
|
38607
38680
|
PIPELINE.map((key, index) => {
|
|
38608
38681
|
const isComplete = index < currentIndex;
|
|
38609
38682
|
const isActive = index === currentIndex;
|
|
38610
|
-
return /* @__PURE__ */ jsxs(
|
|
38683
|
+
return /* @__PURE__ */ jsxs(React76__default.Fragment, { children: [
|
|
38611
38684
|
index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
|
|
38612
38685
|
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
|
|
38613
38686
|
/* @__PURE__ */ jsx(
|
|
@@ -39942,7 +40015,7 @@ var init_DrawGroup = __esm({
|
|
|
39942
40015
|
}
|
|
39943
40016
|
});
|
|
39944
40017
|
function extractTitle(children) {
|
|
39945
|
-
if (!
|
|
40018
|
+
if (!React76__default.isValidElement(children)) return void 0;
|
|
39946
40019
|
const props = children.props;
|
|
39947
40020
|
if (typeof props.title === "string") {
|
|
39948
40021
|
return props.title;
|
|
@@ -40292,12 +40365,12 @@ var init_Form = __esm({
|
|
|
40292
40365
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
40293
40366
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
40294
40367
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
40295
|
-
const normalizedInitialData =
|
|
40368
|
+
const normalizedInitialData = React76__default.useMemo(() => {
|
|
40296
40369
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
40297
40370
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
40298
40371
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
40299
40372
|
}, [entity, initialData]);
|
|
40300
|
-
const entityDerivedFields =
|
|
40373
|
+
const entityDerivedFields = React76__default.useMemo(() => {
|
|
40301
40374
|
if (fields && fields.length > 0) return void 0;
|
|
40302
40375
|
if (!resolvedEntity) return void 0;
|
|
40303
40376
|
return resolvedEntity.fields.map(
|
|
@@ -40318,16 +40391,16 @@ var init_Form = __esm({
|
|
|
40318
40391
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
40319
40392
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
40320
40393
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
40321
|
-
const [formData, setFormData] =
|
|
40394
|
+
const [formData, setFormData] = React76__default.useState(
|
|
40322
40395
|
normalizedInitialData
|
|
40323
40396
|
);
|
|
40324
|
-
const [collapsedSections, setCollapsedSections] =
|
|
40397
|
+
const [collapsedSections, setCollapsedSections] = React76__default.useState(
|
|
40325
40398
|
/* @__PURE__ */ new Set()
|
|
40326
40399
|
);
|
|
40327
|
-
const [submitError, setSubmitError] =
|
|
40328
|
-
const formRef =
|
|
40400
|
+
const [submitError, setSubmitError] = React76__default.useState(null);
|
|
40401
|
+
const formRef = React76__default.useRef(null);
|
|
40329
40402
|
const formMode = props.mode;
|
|
40330
|
-
const mountedRef =
|
|
40403
|
+
const mountedRef = React76__default.useRef(false);
|
|
40331
40404
|
if (!mountedRef.current) {
|
|
40332
40405
|
mountedRef.current = true;
|
|
40333
40406
|
debug("forms", "mount", {
|
|
@@ -40340,7 +40413,7 @@ var init_Form = __esm({
|
|
|
40340
40413
|
});
|
|
40341
40414
|
}
|
|
40342
40415
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
40343
|
-
const evalContext =
|
|
40416
|
+
const evalContext = React76__default.useMemo(
|
|
40344
40417
|
() => ({
|
|
40345
40418
|
formValues: formData,
|
|
40346
40419
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -40349,7 +40422,7 @@ var init_Form = __esm({
|
|
|
40349
40422
|
}),
|
|
40350
40423
|
[formData, externalContext]
|
|
40351
40424
|
);
|
|
40352
|
-
|
|
40425
|
+
React76__default.useEffect(() => {
|
|
40353
40426
|
debug("forms", "initialData-sync", {
|
|
40354
40427
|
mode: formMode,
|
|
40355
40428
|
normalizedInitialData,
|
|
@@ -40360,7 +40433,7 @@ var init_Form = __esm({
|
|
|
40360
40433
|
setFormData(normalizedInitialData);
|
|
40361
40434
|
}
|
|
40362
40435
|
}, [normalizedInitialData]);
|
|
40363
|
-
const processCalculations =
|
|
40436
|
+
const processCalculations = React76__default.useCallback(
|
|
40364
40437
|
(changedFieldId, newFormData) => {
|
|
40365
40438
|
if (!hiddenCalculations.length) return;
|
|
40366
40439
|
const context = {
|
|
@@ -40385,7 +40458,7 @@ var init_Form = __esm({
|
|
|
40385
40458
|
},
|
|
40386
40459
|
[hiddenCalculations, externalContext, eventBus]
|
|
40387
40460
|
);
|
|
40388
|
-
const checkViolations =
|
|
40461
|
+
const checkViolations = React76__default.useCallback(
|
|
40389
40462
|
(changedFieldId, newFormData) => {
|
|
40390
40463
|
if (!violationTriggers.length) return;
|
|
40391
40464
|
const context = {
|
|
@@ -40423,7 +40496,7 @@ var init_Form = __esm({
|
|
|
40423
40496
|
processCalculations(name, newFormData);
|
|
40424
40497
|
checkViolations(name, newFormData);
|
|
40425
40498
|
};
|
|
40426
|
-
const isFieldVisible =
|
|
40499
|
+
const isFieldVisible = React76__default.useCallback(
|
|
40427
40500
|
(fieldName) => {
|
|
40428
40501
|
const condition = conditionalFields[fieldName];
|
|
40429
40502
|
if (!condition) return true;
|
|
@@ -40431,7 +40504,7 @@ var init_Form = __esm({
|
|
|
40431
40504
|
},
|
|
40432
40505
|
[conditionalFields, evalContext]
|
|
40433
40506
|
);
|
|
40434
|
-
const isSectionVisible =
|
|
40507
|
+
const isSectionVisible = React76__default.useCallback(
|
|
40435
40508
|
(section) => {
|
|
40436
40509
|
if (!section.condition) return true;
|
|
40437
40510
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -40507,7 +40580,7 @@ var init_Form = __esm({
|
|
|
40507
40580
|
eventBus.emit(`UI:${onCancel}`);
|
|
40508
40581
|
}
|
|
40509
40582
|
};
|
|
40510
|
-
const renderField =
|
|
40583
|
+
const renderField = React76__default.useCallback(
|
|
40511
40584
|
(field) => {
|
|
40512
40585
|
const fieldName = field.name || field.field;
|
|
40513
40586
|
if (!fieldName) return null;
|
|
@@ -40528,7 +40601,7 @@ var init_Form = __esm({
|
|
|
40528
40601
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
40529
40602
|
);
|
|
40530
40603
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
40531
|
-
const normalizedFields =
|
|
40604
|
+
const normalizedFields = React76__default.useMemo(() => {
|
|
40532
40605
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
40533
40606
|
return effectiveFields.map((field) => {
|
|
40534
40607
|
if (typeof field === "string") {
|
|
@@ -40552,7 +40625,7 @@ var init_Form = __esm({
|
|
|
40552
40625
|
return field;
|
|
40553
40626
|
});
|
|
40554
40627
|
}, [effectiveFields, resolvedEntity]);
|
|
40555
|
-
const schemaFields =
|
|
40628
|
+
const schemaFields = React76__default.useMemo(() => {
|
|
40556
40629
|
if (normalizedFields.length === 0) return null;
|
|
40557
40630
|
if (isDebugEnabled()) {
|
|
40558
40631
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -40562,7 +40635,7 @@ var init_Form = __esm({
|
|
|
40562
40635
|
}
|
|
40563
40636
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
40564
40637
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
40565
|
-
const sectionElements =
|
|
40638
|
+
const sectionElements = React76__default.useMemo(() => {
|
|
40566
40639
|
if (!sections || sections.length === 0) return null;
|
|
40567
40640
|
return sections.map((section) => {
|
|
40568
40641
|
if (!isSectionVisible(section)) {
|
|
@@ -41288,7 +41361,7 @@ var init_List = __esm({
|
|
|
41288
41361
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
41289
41362
|
return [];
|
|
41290
41363
|
}, [entity]);
|
|
41291
|
-
const getItemActions =
|
|
41364
|
+
const getItemActions = React76__default.useCallback(
|
|
41292
41365
|
(item) => {
|
|
41293
41366
|
if (!itemActions) return [];
|
|
41294
41367
|
if (typeof itemActions === "function") {
|
|
@@ -41769,7 +41842,7 @@ var init_MediaGallery = __esm({
|
|
|
41769
41842
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
41770
41843
|
);
|
|
41771
41844
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
41772
|
-
const items =
|
|
41845
|
+
const items = React76__default.useMemo(() => {
|
|
41773
41846
|
if (propItems && propItems.length > 0) return propItems;
|
|
41774
41847
|
if (entityData.length === 0) return [];
|
|
41775
41848
|
return entityData.map((record, idx) => {
|
|
@@ -41934,7 +42007,7 @@ var init_MediaGallery = __esm({
|
|
|
41934
42007
|
}
|
|
41935
42008
|
});
|
|
41936
42009
|
function extractTitle2(children) {
|
|
41937
|
-
if (!
|
|
42010
|
+
if (!React76__default.isValidElement(children)) return void 0;
|
|
41938
42011
|
const props = children.props;
|
|
41939
42012
|
if (typeof props.title === "string") {
|
|
41940
42013
|
return props.title;
|
|
@@ -42189,7 +42262,7 @@ var init_debugRegistry = __esm({
|
|
|
42189
42262
|
}
|
|
42190
42263
|
});
|
|
42191
42264
|
function useDebugData() {
|
|
42192
|
-
const [data, setData] =
|
|
42265
|
+
const [data, setData] = React76.useState(() => ({
|
|
42193
42266
|
traits: [],
|
|
42194
42267
|
ticks: [],
|
|
42195
42268
|
guards: [],
|
|
@@ -42203,7 +42276,7 @@ function useDebugData() {
|
|
|
42203
42276
|
},
|
|
42204
42277
|
lastUpdate: Date.now()
|
|
42205
42278
|
}));
|
|
42206
|
-
|
|
42279
|
+
React76.useEffect(() => {
|
|
42207
42280
|
const updateData = () => {
|
|
42208
42281
|
setData({
|
|
42209
42282
|
traits: getAllTraits(),
|
|
@@ -42312,12 +42385,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
42312
42385
|
return positions;
|
|
42313
42386
|
}
|
|
42314
42387
|
function WalkMinimap() {
|
|
42315
|
-
const [walkStep, setWalkStep] =
|
|
42316
|
-
const [traits2, setTraits] =
|
|
42317
|
-
const [coveredEdges, setCoveredEdges] =
|
|
42318
|
-
const [completedTraits, setCompletedTraits] =
|
|
42319
|
-
const prevTraitRef =
|
|
42320
|
-
|
|
42388
|
+
const [walkStep, setWalkStep] = React76.useState(null);
|
|
42389
|
+
const [traits2, setTraits] = React76.useState([]);
|
|
42390
|
+
const [coveredEdges, setCoveredEdges] = React76.useState([]);
|
|
42391
|
+
const [completedTraits, setCompletedTraits] = React76.useState(/* @__PURE__ */ new Set());
|
|
42392
|
+
const prevTraitRef = React76.useRef(null);
|
|
42393
|
+
React76.useEffect(() => {
|
|
42321
42394
|
const interval = setInterval(() => {
|
|
42322
42395
|
const w = window;
|
|
42323
42396
|
const step = w.__orbitalWalkStep;
|
|
@@ -42753,15 +42826,15 @@ var init_EntitiesTab = __esm({
|
|
|
42753
42826
|
});
|
|
42754
42827
|
function EventFlowTab({ events: events2 }) {
|
|
42755
42828
|
const { t } = useTranslate();
|
|
42756
|
-
const [filter, setFilter] =
|
|
42757
|
-
const containerRef =
|
|
42758
|
-
const [autoScroll, setAutoScroll] =
|
|
42759
|
-
|
|
42829
|
+
const [filter, setFilter] = React76.useState("all");
|
|
42830
|
+
const containerRef = React76.useRef(null);
|
|
42831
|
+
const [autoScroll, setAutoScroll] = React76.useState(true);
|
|
42832
|
+
React76.useEffect(() => {
|
|
42760
42833
|
if (autoScroll && containerRef.current) {
|
|
42761
42834
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42762
42835
|
}
|
|
42763
42836
|
}, [events2.length, autoScroll]);
|
|
42764
|
-
const filteredEvents =
|
|
42837
|
+
const filteredEvents = React76.useMemo(() => {
|
|
42765
42838
|
if (filter === "all") return events2;
|
|
42766
42839
|
return events2.filter((e) => e.type === filter);
|
|
42767
42840
|
}, [events2, filter]);
|
|
@@ -42877,7 +42950,7 @@ var init_EventFlowTab = __esm({
|
|
|
42877
42950
|
});
|
|
42878
42951
|
function GuardsPanel({ guards }) {
|
|
42879
42952
|
const { t } = useTranslate();
|
|
42880
|
-
const [filter, setFilter] =
|
|
42953
|
+
const [filter, setFilter] = React76.useState("all");
|
|
42881
42954
|
if (guards.length === 0) {
|
|
42882
42955
|
return /* @__PURE__ */ jsx(
|
|
42883
42956
|
EmptyState,
|
|
@@ -42890,7 +42963,7 @@ function GuardsPanel({ guards }) {
|
|
|
42890
42963
|
}
|
|
42891
42964
|
const passedCount = guards.filter((g) => g.result).length;
|
|
42892
42965
|
const failedCount = guards.length - passedCount;
|
|
42893
|
-
const filteredGuards =
|
|
42966
|
+
const filteredGuards = React76.useMemo(() => {
|
|
42894
42967
|
if (filter === "all") return guards;
|
|
42895
42968
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
42896
42969
|
return guards.filter((g) => !g.result);
|
|
@@ -43053,10 +43126,10 @@ function EffectBadge({ effect }) {
|
|
|
43053
43126
|
}
|
|
43054
43127
|
function TransitionTimeline({ transitions }) {
|
|
43055
43128
|
const { t } = useTranslate();
|
|
43056
|
-
const containerRef =
|
|
43057
|
-
const [autoScroll, setAutoScroll] =
|
|
43058
|
-
const [expandedId, setExpandedId] =
|
|
43059
|
-
|
|
43129
|
+
const containerRef = React76.useRef(null);
|
|
43130
|
+
const [autoScroll, setAutoScroll] = React76.useState(true);
|
|
43131
|
+
const [expandedId, setExpandedId] = React76.useState(null);
|
|
43132
|
+
React76.useEffect(() => {
|
|
43060
43133
|
if (autoScroll && containerRef.current) {
|
|
43061
43134
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
43062
43135
|
}
|
|
@@ -43336,9 +43409,9 @@ function getAllEvents(traits2) {
|
|
|
43336
43409
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
43337
43410
|
const eventBus = useEventBus();
|
|
43338
43411
|
const { t } = useTranslate();
|
|
43339
|
-
const [log19, setLog] =
|
|
43340
|
-
const prevStatesRef =
|
|
43341
|
-
|
|
43412
|
+
const [log19, setLog] = React76.useState([]);
|
|
43413
|
+
const prevStatesRef = React76.useRef(/* @__PURE__ */ new Map());
|
|
43414
|
+
React76.useEffect(() => {
|
|
43342
43415
|
for (const trait of traits2) {
|
|
43343
43416
|
const prev = prevStatesRef.current.get(trait.id);
|
|
43344
43417
|
if (prev && prev !== trait.currentState) {
|
|
@@ -43507,10 +43580,10 @@ function VerifyModePanel({
|
|
|
43507
43580
|
localCount
|
|
43508
43581
|
}) {
|
|
43509
43582
|
const { t } = useTranslate();
|
|
43510
|
-
const [expanded, setExpanded] =
|
|
43511
|
-
const scrollRef =
|
|
43512
|
-
const prevCountRef =
|
|
43513
|
-
|
|
43583
|
+
const [expanded, setExpanded] = React76.useState(true);
|
|
43584
|
+
const scrollRef = React76.useRef(null);
|
|
43585
|
+
const prevCountRef = React76.useRef(0);
|
|
43586
|
+
React76.useEffect(() => {
|
|
43514
43587
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
43515
43588
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
43516
43589
|
}
|
|
@@ -43567,10 +43640,10 @@ function RuntimeDebugger({
|
|
|
43567
43640
|
schema
|
|
43568
43641
|
}) {
|
|
43569
43642
|
const { t } = useTranslate();
|
|
43570
|
-
const [isCollapsed, setIsCollapsed] =
|
|
43571
|
-
const [isVisible, setIsVisible] =
|
|
43643
|
+
const [isCollapsed, setIsCollapsed] = React76.useState(mode === "verify" ? true : defaultCollapsed);
|
|
43644
|
+
const [isVisible, setIsVisible] = React76.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
43572
43645
|
const debugData = useDebugData();
|
|
43573
|
-
|
|
43646
|
+
React76.useEffect(() => {
|
|
43574
43647
|
if (mode === "inline") return;
|
|
43575
43648
|
return onDebugToggle((enabled) => {
|
|
43576
43649
|
setIsVisible(enabled);
|
|
@@ -43579,7 +43652,7 @@ function RuntimeDebugger({
|
|
|
43579
43652
|
}
|
|
43580
43653
|
});
|
|
43581
43654
|
}, [mode]);
|
|
43582
|
-
|
|
43655
|
+
React76.useEffect(() => {
|
|
43583
43656
|
if (mode === "inline") return;
|
|
43584
43657
|
const handleKeyDown = (e) => {
|
|
43585
43658
|
if (e.key === "`" && isVisible) {
|
|
@@ -44099,7 +44172,7 @@ var init_StatCard = __esm({
|
|
|
44099
44172
|
const labelToUse = propLabel ?? propTitle;
|
|
44100
44173
|
const eventBus = useEventBus();
|
|
44101
44174
|
const { t } = useTranslate();
|
|
44102
|
-
const handleActionClick =
|
|
44175
|
+
const handleActionClick = React76__default.useCallback(() => {
|
|
44103
44176
|
if (action?.event) {
|
|
44104
44177
|
eventBus.emit(`UI:${action.event}`, {});
|
|
44105
44178
|
}
|
|
@@ -44110,7 +44183,7 @@ var init_StatCard = __esm({
|
|
|
44110
44183
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
44111
44184
|
const isLoading = externalLoading ?? false;
|
|
44112
44185
|
const error = externalError;
|
|
44113
|
-
const computeMetricValue =
|
|
44186
|
+
const computeMetricValue = React76__default.useCallback(
|
|
44114
44187
|
(metric, items) => {
|
|
44115
44188
|
if (metric.value !== void 0) {
|
|
44116
44189
|
return metric.value;
|
|
@@ -44149,7 +44222,7 @@ var init_StatCard = __esm({
|
|
|
44149
44222
|
},
|
|
44150
44223
|
[]
|
|
44151
44224
|
);
|
|
44152
|
-
const schemaStats =
|
|
44225
|
+
const schemaStats = React76__default.useMemo(() => {
|
|
44153
44226
|
if (!metrics || metrics.length === 0) return null;
|
|
44154
44227
|
return metrics.map((metric) => ({
|
|
44155
44228
|
label: metric.label,
|
|
@@ -44157,7 +44230,7 @@ var init_StatCard = __esm({
|
|
|
44157
44230
|
format: metric.format
|
|
44158
44231
|
}));
|
|
44159
44232
|
}, [metrics, data, computeMetricValue]);
|
|
44160
|
-
const calculatedTrend =
|
|
44233
|
+
const calculatedTrend = React76__default.useMemo(() => {
|
|
44161
44234
|
if (manualTrend !== void 0) return manualTrend;
|
|
44162
44235
|
if (previousValue === void 0 || currentValue2 === void 0)
|
|
44163
44236
|
return void 0;
|
|
@@ -44797,8 +44870,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
44797
44870
|
] });
|
|
44798
44871
|
};
|
|
44799
44872
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
44800
|
-
const endRef =
|
|
44801
|
-
|
|
44873
|
+
const endRef = React76__default.useRef(null);
|
|
44874
|
+
React76__default.useEffect(() => {
|
|
44802
44875
|
if (!autoScroll) return;
|
|
44803
44876
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
44804
44877
|
}, [activities.length, autoScroll]);
|
|
@@ -44892,7 +44965,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
44892
44965
|
};
|
|
44893
44966
|
SubagentRichCard = ({ subagent }) => {
|
|
44894
44967
|
const { t } = useTranslate();
|
|
44895
|
-
const activities =
|
|
44968
|
+
const activities = React76__default.useMemo(
|
|
44896
44969
|
() => subagentMessagesToActivities(subagent.messages),
|
|
44897
44970
|
[subagent.messages]
|
|
44898
44971
|
);
|
|
@@ -44969,8 +45042,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
44969
45042
|
] });
|
|
44970
45043
|
};
|
|
44971
45044
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
44972
|
-
const endRef =
|
|
44973
|
-
|
|
45045
|
+
const endRef = React76__default.useRef(null);
|
|
45046
|
+
React76__default.useEffect(() => {
|
|
44974
45047
|
if (!autoScroll) return;
|
|
44975
45048
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
44976
45049
|
}, [messages.length, autoScroll]);
|
|
@@ -45405,7 +45478,7 @@ var init_Timeline = __esm({
|
|
|
45405
45478
|
}) => {
|
|
45406
45479
|
const { t } = useTranslate();
|
|
45407
45480
|
const entityData = entity ?? [];
|
|
45408
|
-
const items =
|
|
45481
|
+
const items = React76__default.useMemo(() => {
|
|
45409
45482
|
if (propItems) return propItems;
|
|
45410
45483
|
if (entityData.length === 0) return [];
|
|
45411
45484
|
return entityData.map((record, idx) => {
|
|
@@ -45507,7 +45580,7 @@ var init_Timeline = __esm({
|
|
|
45507
45580
|
}
|
|
45508
45581
|
});
|
|
45509
45582
|
function extractToastProps(children) {
|
|
45510
|
-
if (!
|
|
45583
|
+
if (!React76__default.isValidElement(children)) {
|
|
45511
45584
|
if (typeof children === "string") {
|
|
45512
45585
|
return { message: children };
|
|
45513
45586
|
}
|
|
@@ -45549,7 +45622,7 @@ var init_ToastSlot = __esm({
|
|
|
45549
45622
|
eventBus.emit(`${prefix}CLOSE`);
|
|
45550
45623
|
};
|
|
45551
45624
|
if (!isVisible) return null;
|
|
45552
|
-
const isCustomContent =
|
|
45625
|
+
const isCustomContent = React76__default.isValidElement(children) && !message;
|
|
45553
45626
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
45554
45627
|
Toast,
|
|
45555
45628
|
{
|
|
@@ -46122,7 +46195,7 @@ function SuspenseConfigProvider({
|
|
|
46122
46195
|
config,
|
|
46123
46196
|
children
|
|
46124
46197
|
}) {
|
|
46125
|
-
return
|
|
46198
|
+
return React76__default.createElement(
|
|
46126
46199
|
SuspenseConfigContext.Provider,
|
|
46127
46200
|
{ value: config },
|
|
46128
46201
|
children
|
|
@@ -46164,7 +46237,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
46164
46237
|
}
|
|
46165
46238
|
return { name: field, label: humanizeFieldName(field) };
|
|
46166
46239
|
}
|
|
46167
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
46240
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React76__default.isValidElement(field) && !(field instanceof Date)) {
|
|
46168
46241
|
const obj = field;
|
|
46169
46242
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
46170
46243
|
if (!fieldName) return field;
|
|
@@ -46636,7 +46709,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
46636
46709
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
46637
46710
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
46638
46711
|
}
|
|
46639
|
-
return /* @__PURE__ */ jsx(
|
|
46712
|
+
return /* @__PURE__ */ jsx(React76__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
46640
46713
|
}
|
|
46641
46714
|
if (!child || typeof child !== "object") return null;
|
|
46642
46715
|
const childId = `${parentId}-${index}`;
|
|
@@ -46693,14 +46766,14 @@ function isPatternConfig(value) {
|
|
|
46693
46766
|
if (value === null || value === void 0) return false;
|
|
46694
46767
|
if (typeof value !== "object") return false;
|
|
46695
46768
|
if (Array.isArray(value)) return false;
|
|
46696
|
-
if (
|
|
46769
|
+
if (React76__default.isValidElement(value)) return false;
|
|
46697
46770
|
if (value instanceof Date) return false;
|
|
46698
46771
|
if (typeof value === "function") return false;
|
|
46699
46772
|
const record = value;
|
|
46700
46773
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
46701
46774
|
}
|
|
46702
46775
|
function isPlainConfigObject(value) {
|
|
46703
|
-
if (
|
|
46776
|
+
if (React76__default.isValidElement(value)) return false;
|
|
46704
46777
|
if (value instanceof Date) return false;
|
|
46705
46778
|
const proto = Object.getPrototypeOf(value);
|
|
46706
46779
|
return proto === Object.prototype || proto === null;
|
|
@@ -46836,7 +46909,7 @@ function SlotContentRenderer({
|
|
|
46836
46909
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
46837
46910
|
const slotVal = restProps[slotKey];
|
|
46838
46911
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
46839
|
-
if (
|
|
46912
|
+
if (React76__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
46840
46913
|
const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
|
|
46841
46914
|
if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
46842
46915
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
@@ -46890,7 +46963,7 @@ function SlotContentRenderer({
|
|
|
46890
46963
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
46891
46964
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
46892
46965
|
const sample = resolvedItems[0];
|
|
46893
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
46966
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React76__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
46894
46967
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
46895
46968
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
46896
46969
|
}
|