@almadar/ui 5.138.0 → 5.140.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +1472 -1262
- package/dist/avl/index.js +509 -299
- package/dist/{cn-CL0kdshO.d.cts → cn-DkGYzPOg.d.cts} +1 -1
- package/dist/{cn-CCaph5o9.d.ts → cn-Do5Ra3l3.d.ts} +1 -1
- package/dist/components/index.cjs +1451 -1241
- package/dist/components/index.d.cts +12 -5
- package/dist/components/index.d.ts +12 -5
- package/dist/components/index.js +494 -284
- package/dist/lib/drawable/three/index.cjs +6 -0
- package/dist/lib/drawable/three/index.d.cts +1 -1
- package/dist/lib/drawable/three/index.d.ts +1 -1
- package/dist/lib/drawable/three/index.js +6 -0
- package/dist/lib/index.d.cts +2 -2
- package/dist/lib/index.d.ts +2 -2
- package/dist/{paintDispatch-DXygiK7M.d.cts → paintDispatch-B5pPeSEp.d.cts} +74 -1
- package/dist/{paintDispatch-DXygiK7M.d.ts → paintDispatch-B5pPeSEp.d.ts} +74 -1
- package/dist/providers/index.cjs +1355 -1145
- package/dist/providers/index.js +484 -274
- package/dist/runtime/index.cjs +1333 -1123
- package/dist/runtime/index.js +489 -279
- package/package.json +4 -4
package/dist/runtime/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React84 from 'react';
|
|
2
|
+
import React84__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
|
|
3
3
|
import { EventBusContext, useTraitScopeChain, useEntitySchemaOptional, useEntityBindingSnapshot, useTraitScope, useEntitySchema, getAllPages, matchPathAmong, OrbitalProvider, TraitScopeProvider, ServerBridgeProvider, useCurrentPagePath, useGameAudioContextOptional, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge, EntityBindingContext } from '@almadar/ui/providers';
|
|
4
4
|
export { EntitySchemaProvider, ServerBridgeProvider, TraitContext, TraitProvider, useEntitySchema, useEntitySchemaOptional, useServerBridge, useTrait, useTraitContext } from '@almadar/ui/providers';
|
|
5
5
|
import { createLogger, setNamespaceLevel, isLogLevelEnabled } from '@almadar/logger';
|
|
@@ -825,7 +825,7 @@ function resolveMarkerExpression(expression, entity, config, state) {
|
|
|
825
825
|
function isPlainObject(value) {
|
|
826
826
|
if (value === null || value === void 0 || typeof value !== "object") return false;
|
|
827
827
|
if (Array.isArray(value)) return false;
|
|
828
|
-
if (
|
|
828
|
+
if (React84__default.isValidElement(value)) return false;
|
|
829
829
|
if (value instanceof Date) return false;
|
|
830
830
|
if (typeof value === "function") return false;
|
|
831
831
|
return true;
|
|
@@ -998,7 +998,7 @@ var init_Box = __esm({
|
|
|
998
998
|
fixed: "fixed",
|
|
999
999
|
sticky: "sticky"
|
|
1000
1000
|
};
|
|
1001
|
-
Box =
|
|
1001
|
+
Box = React84__default.forwardRef(
|
|
1002
1002
|
({
|
|
1003
1003
|
padding,
|
|
1004
1004
|
paddingX,
|
|
@@ -1063,7 +1063,7 @@ var init_Box = __esm({
|
|
|
1063
1063
|
onPointerDown?.(e);
|
|
1064
1064
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
1065
1065
|
const isClickable = action || onClick;
|
|
1066
|
-
return
|
|
1066
|
+
return React84__default.createElement(
|
|
1067
1067
|
Component,
|
|
1068
1068
|
{
|
|
1069
1069
|
ref,
|
|
@@ -1280,7 +1280,7 @@ var init_Icon = __esm({
|
|
|
1280
1280
|
const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
|
|
1281
1281
|
const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
|
|
1282
1282
|
const family = useIconFamily();
|
|
1283
|
-
const RenderedComponent =
|
|
1283
|
+
const RenderedComponent = React84__default.useMemo(() => {
|
|
1284
1284
|
if (directIcon) return null;
|
|
1285
1285
|
return effectiveName ? resolveIconForFamily(effectiveName) : null;
|
|
1286
1286
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1404,7 +1404,7 @@ var init_atlasSlice = __esm({
|
|
|
1404
1404
|
}
|
|
1405
1405
|
});
|
|
1406
1406
|
function useAtlasSliceDataUrl(asset) {
|
|
1407
|
-
const [, bump] =
|
|
1407
|
+
const [, bump] = React84.useReducer((x) => x + 1, 0);
|
|
1408
1408
|
if (!isAtlasAsset(asset)) return void 0;
|
|
1409
1409
|
const key = `${asset.atlas}#${asset.sprite}`;
|
|
1410
1410
|
const cached = sliceDataUrlCache.get(key);
|
|
@@ -1467,13 +1467,13 @@ function AtlasImage({
|
|
|
1467
1467
|
style,
|
|
1468
1468
|
"aria-hidden": ariaHidden
|
|
1469
1469
|
}) {
|
|
1470
|
-
const [, bump] =
|
|
1471
|
-
const canvasRef =
|
|
1470
|
+
const [, bump] = React84.useReducer((x) => x + 1, 0);
|
|
1471
|
+
const canvasRef = React84.useRef(null);
|
|
1472
1472
|
const sliced = isAtlasAsset(asset);
|
|
1473
1473
|
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
1474
1474
|
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
1475
1475
|
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
1476
|
-
|
|
1476
|
+
React84.useEffect(() => {
|
|
1477
1477
|
const canvas = canvasRef.current;
|
|
1478
1478
|
if (!canvas || !img || !rect) return;
|
|
1479
1479
|
canvas.width = rect.sw;
|
|
@@ -1549,7 +1549,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1549
1549
|
const IconComp = value;
|
|
1550
1550
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1551
1551
|
}
|
|
1552
|
-
if (
|
|
1552
|
+
if (React84__default.isValidElement(value)) {
|
|
1553
1553
|
return value;
|
|
1554
1554
|
}
|
|
1555
1555
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1626,7 +1626,7 @@ var init_Button = __esm({
|
|
|
1626
1626
|
md: "h-icon-default w-icon-default",
|
|
1627
1627
|
lg: "h-icon-default w-icon-default"
|
|
1628
1628
|
};
|
|
1629
|
-
Button =
|
|
1629
|
+
Button = React84__default.forwardRef(
|
|
1630
1630
|
({
|
|
1631
1631
|
className,
|
|
1632
1632
|
variant = "primary",
|
|
@@ -1696,7 +1696,7 @@ var Dialog;
|
|
|
1696
1696
|
var init_Dialog = __esm({
|
|
1697
1697
|
"components/core/atoms/Dialog.tsx"() {
|
|
1698
1698
|
init_cn();
|
|
1699
|
-
Dialog =
|
|
1699
|
+
Dialog = React84__default.forwardRef(
|
|
1700
1700
|
({
|
|
1701
1701
|
role = "dialog",
|
|
1702
1702
|
"aria-modal": ariaModal = true,
|
|
@@ -1907,7 +1907,7 @@ var init_Typography = __esm({
|
|
|
1907
1907
|
if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
|
|
1908
1908
|
body = formatValue(body, format);
|
|
1909
1909
|
}
|
|
1910
|
-
return
|
|
1910
|
+
return React84__default.createElement(
|
|
1911
1911
|
Component,
|
|
1912
1912
|
{
|
|
1913
1913
|
id,
|
|
@@ -2470,7 +2470,7 @@ var init_Badge = __esm({
|
|
|
2470
2470
|
md: "px-2.5 py-1 text-sm",
|
|
2471
2471
|
lg: "px-3 py-1.5 text-base"
|
|
2472
2472
|
};
|
|
2473
|
-
Badge =
|
|
2473
|
+
Badge = React84__default.forwardRef(
|
|
2474
2474
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2475
2475
|
const iconSizes3 = {
|
|
2476
2476
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2820,7 +2820,7 @@ var init_SvgFlow = __esm({
|
|
|
2820
2820
|
width = 100,
|
|
2821
2821
|
height = 100
|
|
2822
2822
|
}) => {
|
|
2823
|
-
const markerId =
|
|
2823
|
+
const markerId = React84__default.useMemo(() => {
|
|
2824
2824
|
flowIdCounter += 1;
|
|
2825
2825
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2826
2826
|
}, []);
|
|
@@ -3413,7 +3413,7 @@ var init_SvgRing = __esm({
|
|
|
3413
3413
|
width = 100,
|
|
3414
3414
|
height = 100
|
|
3415
3415
|
}) => {
|
|
3416
|
-
const gradientId =
|
|
3416
|
+
const gradientId = React84__default.useMemo(() => {
|
|
3417
3417
|
ringIdCounter += 1;
|
|
3418
3418
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3419
3419
|
}, []);
|
|
@@ -3594,7 +3594,7 @@ var init_Input = __esm({
|
|
|
3594
3594
|
init_cn();
|
|
3595
3595
|
init_Icon();
|
|
3596
3596
|
init_useEventBus();
|
|
3597
|
-
Input =
|
|
3597
|
+
Input = React84__default.forwardRef(
|
|
3598
3598
|
({
|
|
3599
3599
|
className,
|
|
3600
3600
|
inputType,
|
|
@@ -3618,9 +3618,9 @@ var init_Input = __esm({
|
|
|
3618
3618
|
const eventBus = useEventBus();
|
|
3619
3619
|
const type = inputType || htmlType || "text";
|
|
3620
3620
|
const isDeclarative = typeof onChange === "string";
|
|
3621
|
-
const [localValue, setLocalValue] =
|
|
3622
|
-
const pendingEchoRef =
|
|
3623
|
-
|
|
3621
|
+
const [localValue, setLocalValue] = React84__default.useState(value);
|
|
3622
|
+
const pendingEchoRef = React84__default.useRef(/* @__PURE__ */ new Set());
|
|
3623
|
+
React84__default.useEffect(() => {
|
|
3624
3624
|
if (!isDeclarative) return;
|
|
3625
3625
|
const incoming = value == null ? "" : String(value);
|
|
3626
3626
|
if (pendingEchoRef.current.has(incoming)) {
|
|
@@ -3780,7 +3780,7 @@ var Label;
|
|
|
3780
3780
|
var init_Label = __esm({
|
|
3781
3781
|
"components/core/atoms/Label.tsx"() {
|
|
3782
3782
|
init_cn();
|
|
3783
|
-
Label =
|
|
3783
|
+
Label = React84__default.forwardRef(
|
|
3784
3784
|
({ className, required, children, ...props }, ref) => {
|
|
3785
3785
|
return /* @__PURE__ */ jsxs(
|
|
3786
3786
|
"label",
|
|
@@ -3807,7 +3807,7 @@ var init_Textarea = __esm({
|
|
|
3807
3807
|
"components/core/atoms/Textarea.tsx"() {
|
|
3808
3808
|
init_cn();
|
|
3809
3809
|
init_useEventBus();
|
|
3810
|
-
Textarea =
|
|
3810
|
+
Textarea = React84__default.forwardRef(
|
|
3811
3811
|
({ className, error, onChange, ...props }, ref) => {
|
|
3812
3812
|
const eventBus = useEventBus();
|
|
3813
3813
|
const handleChange = (e) => {
|
|
@@ -4046,7 +4046,7 @@ var init_Select = __esm({
|
|
|
4046
4046
|
init_cn();
|
|
4047
4047
|
init_Icon();
|
|
4048
4048
|
init_useEventBus();
|
|
4049
|
-
Select =
|
|
4049
|
+
Select = React84__default.forwardRef(
|
|
4050
4050
|
(props, _ref) => {
|
|
4051
4051
|
const { multiple, searchable, clearable } = props;
|
|
4052
4052
|
if (multiple || searchable || clearable) {
|
|
@@ -4063,7 +4063,7 @@ var init_Checkbox = __esm({
|
|
|
4063
4063
|
"components/core/atoms/Checkbox.tsx"() {
|
|
4064
4064
|
init_cn();
|
|
4065
4065
|
init_useEventBus();
|
|
4066
|
-
Checkbox =
|
|
4066
|
+
Checkbox = React84__default.forwardRef(
|
|
4067
4067
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
4068
4068
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
4069
4069
|
const eventBus = useEventBus();
|
|
@@ -4117,7 +4117,7 @@ var init_Spinner = __esm({
|
|
|
4117
4117
|
md: "h-6 w-6",
|
|
4118
4118
|
lg: "h-8 w-8"
|
|
4119
4119
|
};
|
|
4120
|
-
Spinner =
|
|
4120
|
+
Spinner = React84__default.forwardRef(
|
|
4121
4121
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
4122
4122
|
if (overlay) {
|
|
4123
4123
|
return /* @__PURE__ */ jsx(
|
|
@@ -4207,7 +4207,7 @@ var init_Card = __esm({
|
|
|
4207
4207
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
4208
4208
|
"tile-image-first": "p-0 overflow-hidden"
|
|
4209
4209
|
};
|
|
4210
|
-
Card =
|
|
4210
|
+
Card = React84__default.forwardRef(
|
|
4211
4211
|
({
|
|
4212
4212
|
className,
|
|
4213
4213
|
variant = "bordered",
|
|
@@ -4256,9 +4256,9 @@ var init_Card = __esm({
|
|
|
4256
4256
|
}
|
|
4257
4257
|
);
|
|
4258
4258
|
Card.displayName = "Card";
|
|
4259
|
-
CardHeader =
|
|
4259
|
+
CardHeader = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
4260
4260
|
CardHeader.displayName = "CardHeader";
|
|
4261
|
-
CardTitle =
|
|
4261
|
+
CardTitle = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4262
4262
|
"h3",
|
|
4263
4263
|
{
|
|
4264
4264
|
ref,
|
|
@@ -4271,11 +4271,11 @@ var init_Card = __esm({
|
|
|
4271
4271
|
}
|
|
4272
4272
|
));
|
|
4273
4273
|
CardTitle.displayName = "CardTitle";
|
|
4274
|
-
CardContent =
|
|
4274
|
+
CardContent = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
4275
4275
|
CardContent.displayName = "CardContent";
|
|
4276
4276
|
CardBody = CardContent;
|
|
4277
4277
|
CardBody.displayName = "CardBody";
|
|
4278
|
-
CardFooter =
|
|
4278
|
+
CardFooter = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4279
4279
|
"div",
|
|
4280
4280
|
{
|
|
4281
4281
|
ref,
|
|
@@ -4362,7 +4362,7 @@ var init_FilterPill = __esm({
|
|
|
4362
4362
|
md: "w-3.5 h-3.5",
|
|
4363
4363
|
lg: "w-4 h-4"
|
|
4364
4364
|
};
|
|
4365
|
-
FilterPill =
|
|
4365
|
+
FilterPill = React84__default.forwardRef(
|
|
4366
4366
|
({
|
|
4367
4367
|
className,
|
|
4368
4368
|
variant = "default",
|
|
@@ -4491,8 +4491,8 @@ var init_Avatar = __esm({
|
|
|
4491
4491
|
actionPayload
|
|
4492
4492
|
}) => {
|
|
4493
4493
|
const eventBus = useEventBus();
|
|
4494
|
-
const [imgFailed, setImgFailed] =
|
|
4495
|
-
|
|
4494
|
+
const [imgFailed, setImgFailed] = React84__default.useState(false);
|
|
4495
|
+
React84__default.useEffect(() => {
|
|
4496
4496
|
setImgFailed(false);
|
|
4497
4497
|
}, [src]);
|
|
4498
4498
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4605,7 +4605,7 @@ var init_Center = __esm({
|
|
|
4605
4605
|
as: Component = "div"
|
|
4606
4606
|
}) => {
|
|
4607
4607
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4608
|
-
return
|
|
4608
|
+
return React84__default.createElement(Component, {
|
|
4609
4609
|
className: cn(
|
|
4610
4610
|
inline ? "inline-flex" : "flex",
|
|
4611
4611
|
horizontal && "justify-center",
|
|
@@ -4873,7 +4873,7 @@ var init_Radio = __esm({
|
|
|
4873
4873
|
md: "w-2.5 h-2.5",
|
|
4874
4874
|
lg: "w-3 h-3"
|
|
4875
4875
|
};
|
|
4876
|
-
Radio =
|
|
4876
|
+
Radio = React84__default.forwardRef(
|
|
4877
4877
|
({
|
|
4878
4878
|
label,
|
|
4879
4879
|
helperText,
|
|
@@ -4890,12 +4890,12 @@ var init_Radio = __esm({
|
|
|
4890
4890
|
onChange,
|
|
4891
4891
|
...props
|
|
4892
4892
|
}, ref) => {
|
|
4893
|
-
const reactId =
|
|
4893
|
+
const reactId = React84__default.useId();
|
|
4894
4894
|
const baseId = id || `radio-${reactId}`;
|
|
4895
4895
|
const hasError = !!error;
|
|
4896
4896
|
const eventBus = useEventBus();
|
|
4897
|
-
const [selected, setSelected] =
|
|
4898
|
-
|
|
4897
|
+
const [selected, setSelected] = React84__default.useState(value);
|
|
4898
|
+
React84__default.useEffect(() => {
|
|
4899
4899
|
if (value !== void 0) setSelected(value);
|
|
4900
4900
|
}, [value]);
|
|
4901
4901
|
const pick = (next, e) => {
|
|
@@ -5077,7 +5077,7 @@ var init_Switch = __esm({
|
|
|
5077
5077
|
"components/core/atoms/Switch.tsx"() {
|
|
5078
5078
|
"use client";
|
|
5079
5079
|
init_cn();
|
|
5080
|
-
Switch =
|
|
5080
|
+
Switch = React84.forwardRef(
|
|
5081
5081
|
({
|
|
5082
5082
|
checked,
|
|
5083
5083
|
defaultChecked = false,
|
|
@@ -5088,10 +5088,10 @@ var init_Switch = __esm({
|
|
|
5088
5088
|
name,
|
|
5089
5089
|
className
|
|
5090
5090
|
}, ref) => {
|
|
5091
|
-
const [isChecked, setIsChecked] =
|
|
5091
|
+
const [isChecked, setIsChecked] = React84.useState(
|
|
5092
5092
|
checked !== void 0 ? checked : defaultChecked
|
|
5093
5093
|
);
|
|
5094
|
-
|
|
5094
|
+
React84.useEffect(() => {
|
|
5095
5095
|
if (checked !== void 0) {
|
|
5096
5096
|
setIsChecked(checked);
|
|
5097
5097
|
}
|
|
@@ -5254,7 +5254,7 @@ var init_Stack = __esm({
|
|
|
5254
5254
|
};
|
|
5255
5255
|
const isHorizontal = direction === "horizontal";
|
|
5256
5256
|
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";
|
|
5257
|
-
return
|
|
5257
|
+
return React84__default.createElement(
|
|
5258
5258
|
Component,
|
|
5259
5259
|
{
|
|
5260
5260
|
className: cn(
|
|
@@ -5454,7 +5454,7 @@ var Aside;
|
|
|
5454
5454
|
var init_Aside = __esm({
|
|
5455
5455
|
"components/core/atoms/Aside.tsx"() {
|
|
5456
5456
|
init_cn();
|
|
5457
|
-
Aside =
|
|
5457
|
+
Aside = React84__default.forwardRef(
|
|
5458
5458
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5459
5459
|
);
|
|
5460
5460
|
Aside.displayName = "Aside";
|
|
@@ -5533,9 +5533,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5533
5533
|
className
|
|
5534
5534
|
}) => {
|
|
5535
5535
|
const { t } = useTranslate();
|
|
5536
|
-
const [isVisible, setIsVisible] =
|
|
5537
|
-
const timeoutRef =
|
|
5538
|
-
const triggerRef =
|
|
5536
|
+
const [isVisible, setIsVisible] = React84__default.useState(false);
|
|
5537
|
+
const timeoutRef = React84__default.useRef(null);
|
|
5538
|
+
const triggerRef = React84__default.useRef(null);
|
|
5539
5539
|
const handleMouseEnter = () => {
|
|
5540
5540
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5541
5541
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5546,7 +5546,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5546
5546
|
};
|
|
5547
5547
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5548
5548
|
const open = isVisible || revealed;
|
|
5549
|
-
|
|
5549
|
+
React84__default.useEffect(() => {
|
|
5550
5550
|
return () => {
|
|
5551
5551
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5552
5552
|
};
|
|
@@ -5756,7 +5756,7 @@ var init_StatusDot = __esm({
|
|
|
5756
5756
|
md: "w-2.5 h-2.5",
|
|
5757
5757
|
lg: "w-3 h-3"
|
|
5758
5758
|
};
|
|
5759
|
-
StatusDot =
|
|
5759
|
+
StatusDot = React84__default.forwardRef(
|
|
5760
5760
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5761
5761
|
return /* @__PURE__ */ jsx(
|
|
5762
5762
|
"span",
|
|
@@ -5810,7 +5810,7 @@ var init_TrendIndicator = __esm({
|
|
|
5810
5810
|
down: "trending-down",
|
|
5811
5811
|
flat: "arrow-right"
|
|
5812
5812
|
};
|
|
5813
|
-
TrendIndicator =
|
|
5813
|
+
TrendIndicator = React84__default.forwardRef(
|
|
5814
5814
|
({
|
|
5815
5815
|
className,
|
|
5816
5816
|
value,
|
|
@@ -5879,7 +5879,7 @@ var init_RangeSlider = __esm({
|
|
|
5879
5879
|
md: "w-4 h-4",
|
|
5880
5880
|
lg: "w-5 h-5"
|
|
5881
5881
|
};
|
|
5882
|
-
RangeSlider =
|
|
5882
|
+
RangeSlider = React84__default.forwardRef(
|
|
5883
5883
|
({
|
|
5884
5884
|
className,
|
|
5885
5885
|
min = 0,
|
|
@@ -6455,7 +6455,7 @@ var init_ContentSection = __esm({
|
|
|
6455
6455
|
md: "py-16",
|
|
6456
6456
|
lg: "py-24"
|
|
6457
6457
|
};
|
|
6458
|
-
ContentSection =
|
|
6458
|
+
ContentSection = React84__default.forwardRef(
|
|
6459
6459
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
6460
6460
|
return /* @__PURE__ */ jsx(
|
|
6461
6461
|
Box,
|
|
@@ -6989,7 +6989,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6989
6989
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6990
6990
|
"none": {}
|
|
6991
6991
|
};
|
|
6992
|
-
AnimatedReveal =
|
|
6992
|
+
AnimatedReveal = React84__default.forwardRef(
|
|
6993
6993
|
({
|
|
6994
6994
|
trigger = "scroll",
|
|
6995
6995
|
animation = "fade-up",
|
|
@@ -7149,7 +7149,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
7149
7149
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
7150
7150
|
"use client";
|
|
7151
7151
|
init_cn();
|
|
7152
|
-
AnimatedGraphic =
|
|
7152
|
+
AnimatedGraphic = React84__default.forwardRef(
|
|
7153
7153
|
({
|
|
7154
7154
|
src,
|
|
7155
7155
|
svgContent,
|
|
@@ -7172,7 +7172,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
7172
7172
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
7173
7173
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
7174
7174
|
const prevAnimateRef = useRef(animate);
|
|
7175
|
-
const setRef =
|
|
7175
|
+
const setRef = React84__default.useCallback(
|
|
7176
7176
|
(node) => {
|
|
7177
7177
|
containerRef.current = node;
|
|
7178
7178
|
if (typeof ref === "function") ref(node);
|
|
@@ -7899,9 +7899,9 @@ function ControlButton({
|
|
|
7899
7899
|
className
|
|
7900
7900
|
}) {
|
|
7901
7901
|
const eventBus = useEventBus();
|
|
7902
|
-
const [isPressed, setIsPressed] =
|
|
7902
|
+
const [isPressed, setIsPressed] = React84.useState(false);
|
|
7903
7903
|
const actualPressed = pressed ?? isPressed;
|
|
7904
|
-
const handlePointerDown =
|
|
7904
|
+
const handlePointerDown = React84.useCallback(
|
|
7905
7905
|
(e) => {
|
|
7906
7906
|
e.preventDefault();
|
|
7907
7907
|
if (disabled) return;
|
|
@@ -7911,7 +7911,7 @@ function ControlButton({
|
|
|
7911
7911
|
},
|
|
7912
7912
|
[disabled, pressEvent, eventBus, onPress]
|
|
7913
7913
|
);
|
|
7914
|
-
const handlePointerUp =
|
|
7914
|
+
const handlePointerUp = React84.useCallback(
|
|
7915
7915
|
(e) => {
|
|
7916
7916
|
e.preventDefault();
|
|
7917
7917
|
if (disabled) return;
|
|
@@ -7921,7 +7921,7 @@ function ControlButton({
|
|
|
7921
7921
|
},
|
|
7922
7922
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
7923
7923
|
);
|
|
7924
|
-
const handlePointerLeave =
|
|
7924
|
+
const handlePointerLeave = React84.useCallback(
|
|
7925
7925
|
(e) => {
|
|
7926
7926
|
if (isPressed) {
|
|
7927
7927
|
setIsPressed(false);
|
|
@@ -8179,8 +8179,8 @@ function ControlGrid({
|
|
|
8179
8179
|
className
|
|
8180
8180
|
}) {
|
|
8181
8181
|
const eventBus = useEventBus();
|
|
8182
|
-
const [active, setActive] =
|
|
8183
|
-
const handlePress =
|
|
8182
|
+
const [active, setActive] = React84.useState(/* @__PURE__ */ new Set());
|
|
8183
|
+
const handlePress = React84.useCallback(
|
|
8184
8184
|
(id) => {
|
|
8185
8185
|
setActive((prev) => new Set(prev).add(id));
|
|
8186
8186
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -8194,7 +8194,7 @@ function ControlGrid({
|
|
|
8194
8194
|
},
|
|
8195
8195
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
8196
8196
|
);
|
|
8197
|
-
const handleRelease =
|
|
8197
|
+
const handleRelease = React84.useCallback(
|
|
8198
8198
|
(id) => {
|
|
8199
8199
|
setActive((prev) => {
|
|
8200
8200
|
const next = new Set(prev);
|
|
@@ -8552,7 +8552,7 @@ function GameMenu({
|
|
|
8552
8552
|
}) {
|
|
8553
8553
|
const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
|
|
8554
8554
|
const eventBus = useEventBus();
|
|
8555
|
-
const handleOptionClick =
|
|
8555
|
+
const handleOptionClick = React84.useCallback(
|
|
8556
8556
|
(option) => {
|
|
8557
8557
|
if (option.event) {
|
|
8558
8558
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -8788,7 +8788,7 @@ function StateGraph({
|
|
|
8788
8788
|
}) {
|
|
8789
8789
|
const eventBus = useEventBus();
|
|
8790
8790
|
const nodes = states ?? [];
|
|
8791
|
-
const positions =
|
|
8791
|
+
const positions = React84.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
8792
8792
|
return /* @__PURE__ */ jsxs(
|
|
8793
8793
|
Box,
|
|
8794
8794
|
{
|
|
@@ -8859,8 +8859,8 @@ function MiniMap({
|
|
|
8859
8859
|
tileAssets,
|
|
8860
8860
|
unitAssets
|
|
8861
8861
|
}) {
|
|
8862
|
-
const canvasRef =
|
|
8863
|
-
const imgCacheRef =
|
|
8862
|
+
const canvasRef = React84.useRef(null);
|
|
8863
|
+
const imgCacheRef = React84.useRef(/* @__PURE__ */ new Map());
|
|
8864
8864
|
function loadImg(url) {
|
|
8865
8865
|
const cached = imgCacheRef.current.get(url);
|
|
8866
8866
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -8876,7 +8876,7 @@ function MiniMap({
|
|
|
8876
8876
|
imgCacheRef.current.set(url, img);
|
|
8877
8877
|
return null;
|
|
8878
8878
|
}
|
|
8879
|
-
|
|
8879
|
+
React84.useEffect(() => {
|
|
8880
8880
|
const canvas = canvasRef.current;
|
|
8881
8881
|
if (!canvas) return;
|
|
8882
8882
|
const ctx = canvas.getContext("2d");
|
|
@@ -9177,6 +9177,12 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
9177
9177
|
for (let i = 1; i < points.length; i++) ctx.lineTo(points[i].x, points[i].y);
|
|
9178
9178
|
if (closed) ctx.closePath();
|
|
9179
9179
|
};
|
|
9180
|
+
const toCanvasStyle = (style) => {
|
|
9181
|
+
if (typeof style === "string") return style;
|
|
9182
|
+
const g = style.kind === "linear" ? ctx.createLinearGradient(style.x1, style.y1, style.x2, style.y2) : ctx.createRadialGradient(style.cx, style.cy, 0, style.cx, style.cy, style.r);
|
|
9183
|
+
for (const stop of style.stops) g.addColorStop(stop.offset, stop.color);
|
|
9184
|
+
return g;
|
|
9185
|
+
};
|
|
9180
9186
|
return {
|
|
9181
9187
|
setViewport(width, height, dpr) {
|
|
9182
9188
|
vw = width;
|
|
@@ -9230,47 +9236,47 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
9230
9236
|
ctx.drawImage(img, dest.x, dest.y, dw, dh);
|
|
9231
9237
|
}
|
|
9232
9238
|
},
|
|
9233
|
-
fillRect(x, y, w, h,
|
|
9234
|
-
ctx.fillStyle =
|
|
9239
|
+
fillRect(x, y, w, h, style) {
|
|
9240
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
9235
9241
|
ctx.fillRect(x, y, w, h);
|
|
9236
9242
|
},
|
|
9237
|
-
strokeRect(x, y, w, h,
|
|
9238
|
-
ctx.strokeStyle =
|
|
9243
|
+
strokeRect(x, y, w, h, style, lineWidth = 1) {
|
|
9244
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
9239
9245
|
ctx.lineWidth = lineWidth;
|
|
9240
9246
|
ctx.strokeRect(x, y, w, h);
|
|
9241
9247
|
},
|
|
9242
|
-
fillPoly(points,
|
|
9248
|
+
fillPoly(points, style) {
|
|
9243
9249
|
if (points.length === 0) return;
|
|
9244
9250
|
tracePoly(points, true);
|
|
9245
|
-
ctx.fillStyle =
|
|
9251
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
9246
9252
|
ctx.fill();
|
|
9247
9253
|
},
|
|
9248
|
-
strokePoly(points,
|
|
9254
|
+
strokePoly(points, style, lineWidth = 1, closed = false) {
|
|
9249
9255
|
if (points.length === 0) return;
|
|
9250
9256
|
tracePoly(points, closed);
|
|
9251
|
-
ctx.strokeStyle =
|
|
9257
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
9252
9258
|
ctx.lineWidth = lineWidth;
|
|
9253
9259
|
ctx.stroke();
|
|
9254
9260
|
},
|
|
9255
|
-
fillEllipse(cx, cy, rx, ry,
|
|
9261
|
+
fillEllipse(cx, cy, rx, ry, style) {
|
|
9256
9262
|
ctx.beginPath();
|
|
9257
9263
|
ctx.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2);
|
|
9258
|
-
ctx.fillStyle =
|
|
9264
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
9259
9265
|
ctx.fill();
|
|
9260
9266
|
},
|
|
9261
|
-
strokeEllipse(cx, cy, rx, ry,
|
|
9267
|
+
strokeEllipse(cx, cy, rx, ry, style, lineWidth = 1) {
|
|
9262
9268
|
ctx.beginPath();
|
|
9263
9269
|
ctx.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2);
|
|
9264
|
-
ctx.strokeStyle =
|
|
9270
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
9265
9271
|
ctx.lineWidth = lineWidth;
|
|
9266
9272
|
ctx.stroke();
|
|
9267
9273
|
},
|
|
9268
|
-
fillPath(d,
|
|
9269
|
-
ctx.fillStyle =
|
|
9274
|
+
fillPath(d, style) {
|
|
9275
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
9270
9276
|
ctx.fill(new Path2D(d));
|
|
9271
9277
|
},
|
|
9272
|
-
strokePath(d,
|
|
9273
|
-
ctx.strokeStyle =
|
|
9278
|
+
strokePath(d, style, lineWidth = 1) {
|
|
9279
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
9274
9280
|
ctx.lineWidth = lineWidth;
|
|
9275
9281
|
ctx.stroke(new Path2D(d));
|
|
9276
9282
|
},
|
|
@@ -9344,6 +9350,21 @@ var init_projector = __esm({
|
|
|
9344
9350
|
function isValidScenePos(pos) {
|
|
9345
9351
|
return Number.isFinite(pos?.x) && Number.isFinite(pos?.y);
|
|
9346
9352
|
}
|
|
9353
|
+
function spriteRect(projector, node, natural) {
|
|
9354
|
+
const tw = projector.tileWidth;
|
|
9355
|
+
const fallbackW = projector.worldPixelDirect ? natural?.w ?? 0 : tw;
|
|
9356
|
+
const fallbackH = projector.worldPixelDirect ? natural?.h ?? 0 : tw;
|
|
9357
|
+
const w = node.width !== void 0 ? node.width * tw : fallbackW;
|
|
9358
|
+
const h = node.height !== void 0 ? node.height * tw : fallbackH;
|
|
9359
|
+
const anchor = node.anchor ?? "top-left";
|
|
9360
|
+
const p = projector.anchorPoint(node.position, anchor);
|
|
9361
|
+
return {
|
|
9362
|
+
x: anchor === "top-left" ? p.x : p.x - w / 2,
|
|
9363
|
+
y: anchor === "ground" ? p.y - h : anchor === "center" ? p.y - h / 2 : p.y,
|
|
9364
|
+
w,
|
|
9365
|
+
h
|
|
9366
|
+
};
|
|
9367
|
+
}
|
|
9347
9368
|
var init_contract = __esm({
|
|
9348
9369
|
"lib/drawable/contract.ts"() {
|
|
9349
9370
|
}
|
|
@@ -9358,16 +9379,11 @@ function paintFallbackSquare(painter, node, dctx, reason) {
|
|
|
9358
9379
|
warnMissingOnce(reason, node);
|
|
9359
9380
|
const tw = dctx.projector.tileWidth;
|
|
9360
9381
|
const natural = dctx.projector.worldPixelDirect ? FALLBACK_WORLD_PX : tw;
|
|
9361
|
-
const
|
|
9362
|
-
const h = node.height !== void 0 ? node.height * tw : natural;
|
|
9363
|
-
const anchor = node.anchor ?? "top-left";
|
|
9364
|
-
const p = dctx.projector.anchorPoint(node.position, anchor);
|
|
9365
|
-
const dx = anchor === "top-left" ? p.x : p.x - w / 2;
|
|
9366
|
-
const dy = anchor === "ground" ? p.y - h : anchor === "center" ? p.y - h / 2 : p.y;
|
|
9382
|
+
const rect = spriteRect(dctx.projector, node, { w: natural, h: natural });
|
|
9367
9383
|
painter.save();
|
|
9368
9384
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
9369
|
-
painter.fillRect(
|
|
9370
|
-
painter.strokeRect(
|
|
9385
|
+
painter.fillRect(rect.x, rect.y, rect.w, rect.h, "#9b8f7f");
|
|
9386
|
+
painter.strokeRect(rect.x, rect.y, rect.w, rect.h, "#5e564b", Math.max(1, tw / 32));
|
|
9371
9387
|
painter.restore();
|
|
9372
9388
|
}
|
|
9373
9389
|
function DrawSprite(_props) {
|
|
@@ -9404,15 +9420,10 @@ var init_DrawSprite = __esm({
|
|
|
9404
9420
|
}
|
|
9405
9421
|
src = { x: r.sx, y: r.sy, w: r.sw, h: r.sh };
|
|
9406
9422
|
}
|
|
9407
|
-
const
|
|
9408
|
-
const
|
|
9409
|
-
const
|
|
9410
|
-
const
|
|
9411
|
-
const h = node.height !== void 0 ? node.height * tw : fallbackH;
|
|
9412
|
-
const anchor = node.anchor ?? "top-left";
|
|
9413
|
-
const p = dctx.projector.anchorPoint(node.position, anchor);
|
|
9414
|
-
const dx = anchor === "top-left" ? p.x : p.x - w / 2;
|
|
9415
|
-
const dy = anchor === "ground" ? p.y - h : anchor === "center" ? p.y - h / 2 : p.y;
|
|
9423
|
+
const rect = spriteRect(dctx.projector, node, src ? { w: src.w, h: src.h } : { w: tex.width, h: tex.height });
|
|
9424
|
+
const { w, h } = rect;
|
|
9425
|
+
const dx = rect.x;
|
|
9426
|
+
const dy = rect.y;
|
|
9416
9427
|
painter.save();
|
|
9417
9428
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
9418
9429
|
if (node.shadow) painter.setShadow(node.shadow);
|
|
@@ -9434,25 +9445,145 @@ var init_DrawSprite = __esm({
|
|
|
9434
9445
|
};
|
|
9435
9446
|
}
|
|
9436
9447
|
});
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9448
|
+
var DrawableRegistryContext;
|
|
9449
|
+
var init_registry = __esm({
|
|
9450
|
+
"lib/drawable/registry.ts"() {
|
|
9451
|
+
DrawableRegistryContext = createContext(null);
|
|
9452
|
+
}
|
|
9453
|
+
});
|
|
9454
|
+
function isAnimatedShape(node) {
|
|
9455
|
+
return Boolean(node.animation && node.animation.durationMs > 0 && node.animation.keyframes.length > 0);
|
|
9456
|
+
}
|
|
9457
|
+
function applyShapeAnimation(node, timeMs) {
|
|
9458
|
+
const anim = node.animation;
|
|
9459
|
+
if (!anim || !(anim.durationMs > 0) || anim.keyframes.length === 0) return node;
|
|
9460
|
+
const frames = [...anim.keyframes].sort((a, b) => a.at - b.at);
|
|
9461
|
+
const cycle = timeMs / anim.durationMs;
|
|
9462
|
+
const t = anim.loop === false ? Math.min(cycle, 1) : cycle - Math.floor(cycle);
|
|
9463
|
+
const out = { ...node };
|
|
9464
|
+
const trackValue = (key) => {
|
|
9465
|
+
const defined = frames.filter((f3) => f3[key] !== void 0);
|
|
9466
|
+
if (defined.length === 0) return void 0;
|
|
9467
|
+
let prev;
|
|
9468
|
+
let next;
|
|
9469
|
+
for (const f3 of defined) {
|
|
9470
|
+
if (f3.at <= t) prev = f3;
|
|
9471
|
+
else if (!next) next = f3;
|
|
9472
|
+
}
|
|
9473
|
+
if (!prev) return defined[0][key];
|
|
9474
|
+
if (!next) return prev[key];
|
|
9475
|
+
const span = next.at - prev.at;
|
|
9476
|
+
const k = span > 0 ? (t - prev.at) / span : 1;
|
|
9477
|
+
const a = prev[key];
|
|
9478
|
+
const b = next[key];
|
|
9479
|
+
if (typeof a === "number" && typeof b === "number") return lerp(a, b, k);
|
|
9480
|
+
return a;
|
|
9481
|
+
};
|
|
9482
|
+
for (const key of NUMERIC_TRACKS) {
|
|
9483
|
+
const v = trackValue(key);
|
|
9484
|
+
if (v !== void 0) out[key] = v;
|
|
9485
|
+
}
|
|
9486
|
+
const fill = trackValue("fill");
|
|
9487
|
+
if (fill !== void 0) out.fill = fill;
|
|
9488
|
+
const stroke = trackValue("stroke");
|
|
9489
|
+
if (stroke !== void 0) out.stroke = stroke;
|
|
9490
|
+
const shadowFrames = frames.filter((f3) => f3.shadow !== void 0);
|
|
9491
|
+
if (shadowFrames.length > 0) {
|
|
9492
|
+
const sh = trackValue("shadow");
|
|
9493
|
+
if (sh !== void 0) {
|
|
9494
|
+
let prevSh;
|
|
9495
|
+
let nextSh;
|
|
9496
|
+
for (const f3 of shadowFrames) {
|
|
9497
|
+
if (f3.at <= t) prevSh = f3;
|
|
9498
|
+
else if (!nextSh) nextSh = f3;
|
|
9499
|
+
}
|
|
9500
|
+
if (prevSh?.shadow && nextSh?.shadow) {
|
|
9501
|
+
const span = nextSh.at - prevSh.at;
|
|
9502
|
+
const k = span > 0 ? (t - prevSh.at) / span : 1;
|
|
9503
|
+
out.shadow = { color: prevSh.shadow.color, blur: lerp(prevSh.shadow.blur, nextSh.shadow.blur, k) };
|
|
9504
|
+
} else {
|
|
9505
|
+
out.shadow = sh;
|
|
9506
|
+
}
|
|
9507
|
+
}
|
|
9508
|
+
}
|
|
9509
|
+
return out;
|
|
9510
|
+
}
|
|
9511
|
+
function gradientStyle(g, ox, oy, scale) {
|
|
9512
|
+
if (g.kind === "linear") {
|
|
9513
|
+
if (!g.from || !g.to) return void 0;
|
|
9514
|
+
return {
|
|
9515
|
+
kind: "linear",
|
|
9516
|
+
x1: ox + g.from.x * scale,
|
|
9517
|
+
y1: oy + g.from.y * scale,
|
|
9518
|
+
x2: ox + g.to.x * scale,
|
|
9519
|
+
y2: oy + g.to.y * scale,
|
|
9520
|
+
stops: g.stops
|
|
9521
|
+
};
|
|
9522
|
+
}
|
|
9523
|
+
if (!g.center || g.radius === void 0) return void 0;
|
|
9524
|
+
return {
|
|
9525
|
+
kind: "radial",
|
|
9526
|
+
cx: ox + g.center.x * scale,
|
|
9527
|
+
cy: oy + g.center.y * scale,
|
|
9528
|
+
r: g.radius * scale,
|
|
9529
|
+
stops: g.stops
|
|
9530
|
+
};
|
|
9531
|
+
}
|
|
9532
|
+
function DrawShape(props) {
|
|
9533
|
+
const register = useContext(DrawableRegistryContext);
|
|
9534
|
+
if (register) {
|
|
9535
|
+
const { opacity, ...rest } = props;
|
|
9536
|
+
const node = {
|
|
9537
|
+
...rest,
|
|
9538
|
+
type: "draw-shape",
|
|
9539
|
+
...opacity !== void 0 && opacity > 0 ? { opacity } : {}
|
|
9540
|
+
};
|
|
9541
|
+
register(node);
|
|
9542
|
+
}
|
|
9440
9543
|
return null;
|
|
9441
9544
|
}
|
|
9442
|
-
var paintShape;
|
|
9545
|
+
var NUMERIC_TRACKS, lerp, paintShape;
|
|
9443
9546
|
var init_DrawShape = __esm({
|
|
9444
9547
|
"components/game/atoms/DrawShape.tsx"() {
|
|
9445
9548
|
"use client";
|
|
9446
9549
|
init_contract();
|
|
9447
|
-
|
|
9550
|
+
init_registry();
|
|
9551
|
+
NUMERIC_TRACKS = [
|
|
9552
|
+
"offsetX",
|
|
9553
|
+
"offsetY",
|
|
9554
|
+
"rotate",
|
|
9555
|
+
"opacity",
|
|
9556
|
+
"radiusX",
|
|
9557
|
+
"radiusY",
|
|
9558
|
+
"width",
|
|
9559
|
+
"height",
|
|
9560
|
+
"strokeWidth"
|
|
9561
|
+
];
|
|
9562
|
+
lerp = (a, b, k) => a + (b - a) * k;
|
|
9563
|
+
paintShape = (painter, rawNode, dctx) => {
|
|
9564
|
+
const node = dctx.time > 0 ? applyShapeAnimation(rawNode, dctx.time) : rawNode;
|
|
9448
9565
|
if (!isValidScenePos(node.position)) return;
|
|
9449
9566
|
painter.save();
|
|
9450
9567
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
9568
|
+
const origin = dctx.projector.project(node.position);
|
|
9569
|
+
const tileWidth = dctx.projector.tileWidth;
|
|
9570
|
+
if (node.rotate) {
|
|
9571
|
+
const pivot = node.pivot ?? { x: 0.5, y: 0.5 };
|
|
9572
|
+
const px = origin.x + pivot.x * tileWidth;
|
|
9573
|
+
const py = origin.y + pivot.y * tileWidth;
|
|
9574
|
+
painter.translate(px, py);
|
|
9575
|
+
painter.rotate(node.rotate);
|
|
9576
|
+
painter.translate(-px, -py);
|
|
9577
|
+
}
|
|
9578
|
+
if (node.shadow) painter.setShadow({ color: node.shadow.color, blur: node.shadow.blur * tileWidth });
|
|
9579
|
+
const fill = node.fill === "none" ? void 0 : node.fill;
|
|
9580
|
+
const stroke = node.stroke === "none" ? void 0 : node.stroke;
|
|
9581
|
+
const pxFill = node.gradient ? gradientStyle(node.gradient, origin.x, origin.y, tileWidth) ?? fill : fill;
|
|
9451
9582
|
switch (node.shape) {
|
|
9452
9583
|
case "cell": {
|
|
9453
9584
|
const pts = dctx.projector.cellPath(node.position);
|
|
9454
|
-
if (
|
|
9455
|
-
if (
|
|
9585
|
+
if (pxFill) painter.fillPoly(pts, pxFill);
|
|
9586
|
+
if (stroke) painter.strokePoly(pts, stroke, node.strokeWidth ?? 1, true);
|
|
9456
9587
|
break;
|
|
9457
9588
|
}
|
|
9458
9589
|
case "rect": {
|
|
@@ -9462,8 +9593,8 @@ var init_DrawShape = __esm({
|
|
|
9462
9593
|
const y = p.y + (node.offsetY ?? 0) * tw;
|
|
9463
9594
|
const w = (node.width ?? 0) * tw;
|
|
9464
9595
|
const h = (node.height ?? 0) * tw;
|
|
9465
|
-
if (
|
|
9466
|
-
if (
|
|
9596
|
+
if (pxFill) painter.fillRect(x, y, w, h, pxFill);
|
|
9597
|
+
if (stroke) painter.strokeRect(x, y, w, h, stroke, node.strokeWidth ?? 1);
|
|
9467
9598
|
break;
|
|
9468
9599
|
}
|
|
9469
9600
|
case "ellipse": {
|
|
@@ -9473,26 +9604,26 @@ var init_DrawShape = __esm({
|
|
|
9473
9604
|
const cy = p.y + (node.offsetY ?? 0) * tw;
|
|
9474
9605
|
const rx = (node.radiusX ?? 0) * tw;
|
|
9475
9606
|
const ry = (node.radiusY ?? rx) * tw;
|
|
9476
|
-
if (
|
|
9477
|
-
if (
|
|
9607
|
+
if (pxFill) painter.fillEllipse(cx, cy, rx, ry, pxFill);
|
|
9608
|
+
if (stroke) painter.strokeEllipse(cx, cy, rx, ry, stroke, node.strokeWidth ?? 1);
|
|
9478
9609
|
break;
|
|
9479
9610
|
}
|
|
9480
9611
|
case "poly": {
|
|
9481
|
-
const
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
if (
|
|
9612
|
+
const pts = (node.points ?? []).map((pt) => ({
|
|
9613
|
+
x: origin.x + ((node.offsetX ?? 0) + pt.x) * tileWidth,
|
|
9614
|
+
y: origin.y + ((node.offsetY ?? 0) + pt.y) * tileWidth
|
|
9615
|
+
}));
|
|
9616
|
+
if (pxFill) painter.fillPoly(pts, pxFill);
|
|
9617
|
+
if (stroke) painter.strokePoly(pts, stroke, node.strokeWidth ?? 1, true);
|
|
9486
9618
|
break;
|
|
9487
9619
|
}
|
|
9488
9620
|
case "path": {
|
|
9489
9621
|
if (!node.d) break;
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
painter.
|
|
9494
|
-
if (
|
|
9495
|
-
if (node.stroke) painter.strokePath(node.d, node.stroke, (node.strokeWidth ?? 1) / tw);
|
|
9622
|
+
painter.translate(origin.x + (node.offsetX ?? 0) * tileWidth, origin.y + (node.offsetY ?? 0) * tileWidth);
|
|
9623
|
+
painter.scale(tileWidth, tileWidth);
|
|
9624
|
+
const localFill = node.gradient ? gradientStyle(node.gradient, 0, 0, 1) ?? fill : fill;
|
|
9625
|
+
if (localFill) painter.fillPath(node.d, localFill);
|
|
9626
|
+
if (stroke) painter.strokePath(node.d, stroke, (node.strokeWidth ?? 1) / tileWidth);
|
|
9496
9627
|
break;
|
|
9497
9628
|
}
|
|
9498
9629
|
}
|
|
@@ -9628,12 +9759,18 @@ function collectDrawnItems(nodes) {
|
|
|
9628
9759
|
for (const n of nodes) {
|
|
9629
9760
|
switch (n.type) {
|
|
9630
9761
|
case "draw-sprite":
|
|
9762
|
+
if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id, anchor: n.anchor, width: n.width, height: n.height });
|
|
9763
|
+
break;
|
|
9631
9764
|
case "draw-shape":
|
|
9632
9765
|
case "draw-text":
|
|
9633
9766
|
case "draw-group":
|
|
9634
9767
|
if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id });
|
|
9635
9768
|
break;
|
|
9636
9769
|
case "draw-sprite-layer":
|
|
9770
|
+
for (const it of n.items) {
|
|
9771
|
+
if (isValidScenePos(it.position)) out.push({ pos: it.position, id: it.id, anchor: it.anchor, width: it.width, height: it.height });
|
|
9772
|
+
}
|
|
9773
|
+
break;
|
|
9637
9774
|
case "draw-shape-layer":
|
|
9638
9775
|
case "draw-text-layer":
|
|
9639
9776
|
for (const it of n.items) {
|
|
@@ -9651,6 +9788,15 @@ function buildHitIndex(items) {
|
|
|
9651
9788
|
}
|
|
9652
9789
|
return m;
|
|
9653
9790
|
}
|
|
9791
|
+
function hitTestSprites(items, projector, point) {
|
|
9792
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
9793
|
+
const it = items[i];
|
|
9794
|
+
if (it.id === void 0) continue;
|
|
9795
|
+
const r = spriteRect(projector, { position: it.pos, anchor: it.anchor, width: it.width, height: it.height });
|
|
9796
|
+
if (point.x >= r.x && point.x <= r.x + r.w && point.y >= r.y && point.y <= r.y + r.h) return it.id;
|
|
9797
|
+
}
|
|
9798
|
+
return void 0;
|
|
9799
|
+
}
|
|
9654
9800
|
var init_hitTest = __esm({
|
|
9655
9801
|
"lib/drawable/hitTest.ts"() {
|
|
9656
9802
|
init_contract();
|
|
@@ -9679,9 +9825,16 @@ function Canvas2D({
|
|
|
9679
9825
|
showMinimap = true,
|
|
9680
9826
|
followTarget,
|
|
9681
9827
|
cameraPos,
|
|
9682
|
-
bgColor
|
|
9828
|
+
bgColor,
|
|
9829
|
+
children
|
|
9683
9830
|
}) {
|
|
9684
9831
|
const instanceId = useMemo(() => Math.random().toString(36).slice(2, 8), []);
|
|
9832
|
+
const childDrawablesRef = useRef([]);
|
|
9833
|
+
childDrawablesRef.current = [];
|
|
9834
|
+
const registerChildDrawable = useCallback((node) => {
|
|
9835
|
+
childDrawablesRef.current.push(node);
|
|
9836
|
+
}, []);
|
|
9837
|
+
const hasJsxChildren = React84.Children.count(children) > 0;
|
|
9685
9838
|
function isDrawableLayer(node) {
|
|
9686
9839
|
return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
|
|
9687
9840
|
}
|
|
@@ -9830,11 +9983,24 @@ function Canvas2D({
|
|
|
9830
9983
|
}, [showMinimap, scenePositions]);
|
|
9831
9984
|
const miniMapWidth = gridExtent.width || 10;
|
|
9832
9985
|
const miniMapHeight = gridExtent.height || 10;
|
|
9833
|
-
const
|
|
9986
|
+
const drawableIsAnimated = (node) => {
|
|
9987
|
+
if (node.type === "draw-shape") return isAnimatedShape(node);
|
|
9988
|
+
if (node.type === "draw-group") return Array.isArray(node.items) && node.items.some(drawableIsAnimated);
|
|
9989
|
+
if (node.type === "draw-shape-layer") return Array.isArray(node.items) && node.items.some(isAnimatedShape);
|
|
9990
|
+
return false;
|
|
9991
|
+
};
|
|
9992
|
+
const animRafRef = useRef(0);
|
|
9993
|
+
const drawTimeRef = useRef(() => void 0);
|
|
9994
|
+
const draw = useCallback((timeMs = 0) => {
|
|
9834
9995
|
const canvas = canvasRef.current;
|
|
9835
9996
|
if (!canvas) return;
|
|
9836
9997
|
const ctx = canvas.getContext("2d");
|
|
9837
9998
|
if (!ctx) return;
|
|
9999
|
+
const scheduleAnimation = (nodes) => {
|
|
10000
|
+
if (!nodes.some(drawableIsAnimated)) return;
|
|
10001
|
+
cancelAnimationFrame(animRafRef.current);
|
|
10002
|
+
animRafRef.current = requestAnimationFrame(() => drawTimeRef.current(performance.now()));
|
|
10003
|
+
};
|
|
9838
10004
|
const dpr = window.devicePixelRatio || 1;
|
|
9839
10005
|
canvas.width = viewportSize.width * dpr;
|
|
9840
10006
|
canvas.height = viewportSize.height * dpr;
|
|
@@ -9864,7 +10030,29 @@ function Canvas2D({
|
|
|
9864
10030
|
ctx.fillStyle = bgColor ?? BACKGROUND_FALLBACK_COLOR;
|
|
9865
10031
|
ctx.fillRect(0, 0, viewportSize.width, viewportSize.height);
|
|
9866
10032
|
}
|
|
9867
|
-
if (!drawables || drawables.length === 0)
|
|
10033
|
+
if (!drawables || drawables.length === 0) {
|
|
10034
|
+
const childDrawables = childDrawablesRef.current;
|
|
10035
|
+
if (childDrawables.length === 0) return;
|
|
10036
|
+
const cam0 = cameraRef.current;
|
|
10037
|
+
if (camera !== "follow" && dragDistance() === 0) {
|
|
10038
|
+
const focus = cameraPos ?? defaultGridFocus;
|
|
10039
|
+
if (focus) {
|
|
10040
|
+
const p = projector.anchorPoint(focus, "center");
|
|
10041
|
+
cam0.x = p.x - viewportSize.width / 2;
|
|
10042
|
+
cam0.y = p.y - viewportSize.height / 2;
|
|
10043
|
+
}
|
|
10044
|
+
}
|
|
10045
|
+
const painter0 = createWebPainter(ctx, bumpAtlas);
|
|
10046
|
+
painter0.save();
|
|
10047
|
+
painter0.translate(viewportSize.width / 2, viewportSize.height / 2);
|
|
10048
|
+
painter0.scale(cam0.zoom, cam0.zoom);
|
|
10049
|
+
painter0.translate(-viewportSize.width / 2 - cam0.x, -viewportSize.height / 2 - cam0.y);
|
|
10050
|
+
const dctx0 = { projector, time: timeMs, invalidate: bumpAtlas };
|
|
10051
|
+
for (const node of childDrawables) paintDrawable(painter0, node, dctx0);
|
|
10052
|
+
painter0.restore();
|
|
10053
|
+
scheduleAnimation(childDrawables);
|
|
10054
|
+
return;
|
|
10055
|
+
}
|
|
9868
10056
|
const cam = cameraRef.current;
|
|
9869
10057
|
if (camera !== "follow" && dragDistance() === 0) {
|
|
9870
10058
|
const focus = cameraPos ?? defaultGridFocus;
|
|
@@ -9882,10 +10070,15 @@ function Canvas2D({
|
|
|
9882
10070
|
painter.translate(viewportSize.width / 2, viewportSize.height / 2);
|
|
9883
10071
|
painter.scale(cam.zoom, cam.zoom);
|
|
9884
10072
|
painter.translate(-viewportSize.width / 2 - cam.x, -viewportSize.height / 2 - cam.y);
|
|
9885
|
-
const dctx = { projector, time:
|
|
10073
|
+
const dctx = { projector, time: timeMs, invalidate: bumpAtlas };
|
|
9886
10074
|
for (const node of drawables) paintDrawable(painter, node, dctx);
|
|
9887
10075
|
painter.restore();
|
|
10076
|
+
scheduleAnimation(drawables);
|
|
9888
10077
|
}, [viewportSize, backgroundImage, bgColor, drawables, projector, cameraRef, bumpAtlas, getImage, cameraPos, defaultGridFocus, camera, dragDistance]);
|
|
10078
|
+
useEffect(() => {
|
|
10079
|
+
drawTimeRef.current = draw;
|
|
10080
|
+
}, [draw]);
|
|
10081
|
+
useEffect(() => () => cancelAnimationFrame(animRafRef.current), []);
|
|
9889
10082
|
useEffect(() => {
|
|
9890
10083
|
if (camera !== "follow" || !followTarget) return;
|
|
9891
10084
|
const p = projector.anchorPoint(followTarget, "center");
|
|
@@ -9948,6 +10141,11 @@ function Canvas2D({
|
|
|
9948
10141
|
if (dragDistance() > 5) return;
|
|
9949
10142
|
if (!canvasRef.current || !tileClickEvent && !unitClickEvent) return;
|
|
9950
10143
|
const world = screenToWorld(e.clientX, e.clientY, canvasRef.current, viewportSize);
|
|
10144
|
+
const spriteHit = unitClickEvent ? hitTestSprites(drawnItems, projector, world) : void 0;
|
|
10145
|
+
if (spriteHit !== void 0 && unitClickEvent) {
|
|
10146
|
+
eventBus.emit(`UI:${unitClickEvent}`, { unitId: spriteHit });
|
|
10147
|
+
return;
|
|
10148
|
+
}
|
|
9951
10149
|
const adjustedX = world.x - scaledTileWidth / 2;
|
|
9952
10150
|
const adjustedY = squareGrid ? world.y - scaledTileWidth / 2 : world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
9953
10151
|
const isoPos = unproject(adjustedX, adjustedY);
|
|
@@ -9957,7 +10155,7 @@ function Canvas2D({
|
|
|
9957
10155
|
} else if (tileClickEvent) {
|
|
9958
10156
|
eventBus.emit(`UI:${tileClickEvent}`, { x: isoPos.x, y: isoPos.y });
|
|
9959
10157
|
}
|
|
9960
|
-
}, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, hitIndex, tileClickEvent, unitClickEvent, eventBus]);
|
|
10158
|
+
}, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, hitIndex, drawnItems, projector, tileClickEvent, unitClickEvent, eventBus]);
|
|
9961
10159
|
const handleCanvasPointerLeave = useCallback(() => {
|
|
9962
10160
|
handleMouseLeave();
|
|
9963
10161
|
if (tileLeaveEvent) eventBus.emit(`UI:${tileLeaveEvent}`, {});
|
|
@@ -10027,7 +10225,7 @@ function Canvas2D({
|
|
|
10027
10225
|
/* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-muted-foreground", children: t("canvas.loadingMessage") || "Loading\u2026" })
|
|
10028
10226
|
] }) });
|
|
10029
10227
|
}
|
|
10030
|
-
if (!drawables || drawables.length === 0) {
|
|
10228
|
+
if ((!drawables || drawables.length === 0) && !hasJsxChildren) {
|
|
10031
10229
|
return /* @__PURE__ */ jsx(
|
|
10032
10230
|
Box,
|
|
10033
10231
|
{
|
|
@@ -10041,7 +10239,7 @@ function Canvas2D({
|
|
|
10041
10239
|
}
|
|
10042
10240
|
);
|
|
10043
10241
|
}
|
|
10044
|
-
return /* @__PURE__ */ jsxs(
|
|
10242
|
+
return /* @__PURE__ */ jsx(DrawableRegistryContext.Provider, { value: registerChildDrawable, children: /* @__PURE__ */ jsxs(
|
|
10045
10243
|
Box,
|
|
10046
10244
|
{
|
|
10047
10245
|
ref: containerRef,
|
|
@@ -10102,10 +10300,11 @@ function Canvas2D({
|
|
|
10102
10300
|
mapWidth: miniMapWidth,
|
|
10103
10301
|
mapHeight: miniMapHeight
|
|
10104
10302
|
}
|
|
10105
|
-
) })
|
|
10303
|
+
) }),
|
|
10304
|
+
hasJsxChildren && /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children })
|
|
10106
10305
|
]
|
|
10107
10306
|
}
|
|
10108
|
-
);
|
|
10307
|
+
) });
|
|
10109
10308
|
}
|
|
10110
10309
|
var canvas2DLog;
|
|
10111
10310
|
var init_Canvas2D = __esm({
|
|
@@ -10127,6 +10326,8 @@ var init_Canvas2D = __esm({
|
|
|
10127
10326
|
init_webPainter2d();
|
|
10128
10327
|
init_projector();
|
|
10129
10328
|
init_paintDispatch();
|
|
10329
|
+
init_DrawShape();
|
|
10330
|
+
init_registry();
|
|
10130
10331
|
init_hitTest();
|
|
10131
10332
|
init_isometric();
|
|
10132
10333
|
canvas2DLog = createLogger("almadar:ui:game-canvas");
|
|
@@ -10168,7 +10369,8 @@ function Canvas({
|
|
|
10168
10369
|
tileLeaveEvent,
|
|
10169
10370
|
featureClickEvent,
|
|
10170
10371
|
keyMap,
|
|
10171
|
-
keyUpMap
|
|
10372
|
+
keyUpMap,
|
|
10373
|
+
children
|
|
10172
10374
|
}) {
|
|
10173
10375
|
canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
|
|
10174
10376
|
const zoom = camera?.zoom;
|
|
@@ -10221,7 +10423,8 @@ function Canvas({
|
|
|
10221
10423
|
tileHoverEvent,
|
|
10222
10424
|
tileLeaveEvent,
|
|
10223
10425
|
keyMap,
|
|
10224
|
-
keyUpMap
|
|
10426
|
+
keyUpMap,
|
|
10427
|
+
...children !== void 0 ? { children } : {}
|
|
10225
10428
|
}
|
|
10226
10429
|
);
|
|
10227
10430
|
}
|
|
@@ -10353,7 +10556,7 @@ function LinearView({
|
|
|
10353
10556
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
10354
10557
|
const isDone = i < currentIdx;
|
|
10355
10558
|
const isCurrent = i === currentIdx;
|
|
10356
|
-
return /* @__PURE__ */ jsxs(
|
|
10559
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
10357
10560
|
i > 0 && /* @__PURE__ */ jsx(
|
|
10358
10561
|
Typography,
|
|
10359
10562
|
{
|
|
@@ -10888,7 +11091,7 @@ function SequenceBar({
|
|
|
10888
11091
|
else onSlotRemove?.(index);
|
|
10889
11092
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
10890
11093
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
10891
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
11094
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
10892
11095
|
i > 0 && /* @__PURE__ */ jsx(
|
|
10893
11096
|
Typography,
|
|
10894
11097
|
{
|
|
@@ -11537,7 +11740,7 @@ var init_ErrorBoundary = __esm({
|
|
|
11537
11740
|
}
|
|
11538
11741
|
);
|
|
11539
11742
|
};
|
|
11540
|
-
ErrorBoundary = class extends
|
|
11743
|
+
ErrorBoundary = class extends React84__default.Component {
|
|
11541
11744
|
constructor(props) {
|
|
11542
11745
|
super(props);
|
|
11543
11746
|
__publicField(this, "reset", () => {
|
|
@@ -11806,7 +12009,7 @@ var init_Container = __esm({
|
|
|
11806
12009
|
as: Component = "div"
|
|
11807
12010
|
}) => {
|
|
11808
12011
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
11809
|
-
return
|
|
12012
|
+
return React84__default.createElement(
|
|
11810
12013
|
Component,
|
|
11811
12014
|
{
|
|
11812
12015
|
className: cn(
|
|
@@ -14771,7 +14974,7 @@ var init_CodeBlock = __esm({
|
|
|
14771
14974
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
14772
14975
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
14773
14976
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
14774
|
-
CodeBlock =
|
|
14977
|
+
CodeBlock = React84__default.memo(
|
|
14775
14978
|
({
|
|
14776
14979
|
code: rawCode,
|
|
14777
14980
|
language = "text",
|
|
@@ -15359,7 +15562,7 @@ var init_MarkdownContent = __esm({
|
|
|
15359
15562
|
init_Box();
|
|
15360
15563
|
init_CodeBlock();
|
|
15361
15564
|
init_cn();
|
|
15362
|
-
MarkdownContent =
|
|
15565
|
+
MarkdownContent = React84__default.memo(
|
|
15363
15566
|
({ content, direction = "ltr", className }) => {
|
|
15364
15567
|
const { t: _t } = useTranslate();
|
|
15365
15568
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -16636,7 +16839,7 @@ var init_StateMachineView = __esm({
|
|
|
16636
16839
|
style: { top: title ? 30 : 0 },
|
|
16637
16840
|
children: [
|
|
16638
16841
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
16639
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
16842
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React84__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
16640
16843
|
StateNode2,
|
|
16641
16844
|
{
|
|
16642
16845
|
state,
|
|
@@ -22377,8 +22580,8 @@ var init_Menu = __esm({
|
|
|
22377
22580
|
"bottom-end": "bottom-start"
|
|
22378
22581
|
};
|
|
22379
22582
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
22380
|
-
const triggerChild =
|
|
22381
|
-
const triggerElement =
|
|
22583
|
+
const triggerChild = React84__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
22584
|
+
const triggerElement = React84__default.cloneElement(
|
|
22382
22585
|
triggerChild,
|
|
22383
22586
|
{
|
|
22384
22587
|
ref: triggerRef,
|
|
@@ -22473,14 +22676,14 @@ function useDataDnd(args) {
|
|
|
22473
22676
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
22474
22677
|
const enabled = isZone || Boolean(dndRoot);
|
|
22475
22678
|
const eventBus = useEventBus();
|
|
22476
|
-
const parentRoot =
|
|
22679
|
+
const parentRoot = React84__default.useContext(RootCtx);
|
|
22477
22680
|
const isRoot = enabled && parentRoot === null;
|
|
22478
|
-
const zoneId =
|
|
22681
|
+
const zoneId = React84__default.useId();
|
|
22479
22682
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
22480
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
22481
|
-
const optimisticOrdersRef =
|
|
22683
|
+
const [optimisticOrders, setOptimisticOrders] = React84__default.useState(() => /* @__PURE__ */ new Map());
|
|
22684
|
+
const optimisticOrdersRef = React84__default.useRef(optimisticOrders);
|
|
22482
22685
|
optimisticOrdersRef.current = optimisticOrders;
|
|
22483
|
-
const clearOptimisticOrder =
|
|
22686
|
+
const clearOptimisticOrder = React84__default.useCallback((group) => {
|
|
22484
22687
|
setOptimisticOrders((prev) => {
|
|
22485
22688
|
if (!prev.has(group)) return prev;
|
|
22486
22689
|
const next = new Map(prev);
|
|
@@ -22505,7 +22708,7 @@ function useDataDnd(args) {
|
|
|
22505
22708
|
const raw = it[dndItemIdField];
|
|
22506
22709
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
22507
22710
|
}).join("|");
|
|
22508
|
-
const itemIds =
|
|
22711
|
+
const itemIds = React84__default.useMemo(
|
|
22509
22712
|
() => orderedItems.map((it, idx) => {
|
|
22510
22713
|
const raw = it[dndItemIdField];
|
|
22511
22714
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -22516,7 +22719,7 @@ function useDataDnd(args) {
|
|
|
22516
22719
|
const raw = it[dndItemIdField];
|
|
22517
22720
|
return raw != null ? String(raw) : `__${idx}`;
|
|
22518
22721
|
}).join("|");
|
|
22519
|
-
|
|
22722
|
+
React84__default.useEffect(() => {
|
|
22520
22723
|
const root = isRoot ? null : parentRoot;
|
|
22521
22724
|
if (root) {
|
|
22522
22725
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -22524,20 +22727,20 @@ function useDataDnd(args) {
|
|
|
22524
22727
|
clearOptimisticOrder(ownGroup);
|
|
22525
22728
|
}
|
|
22526
22729
|
}, [itemsContentSig, ownGroup]);
|
|
22527
|
-
const zonesRef =
|
|
22528
|
-
const registerZone =
|
|
22730
|
+
const zonesRef = React84__default.useRef(/* @__PURE__ */ new Map());
|
|
22731
|
+
const registerZone = React84__default.useCallback((zoneId2, meta2) => {
|
|
22529
22732
|
zonesRef.current.set(zoneId2, meta2);
|
|
22530
22733
|
}, []);
|
|
22531
|
-
const unregisterZone =
|
|
22734
|
+
const unregisterZone = React84__default.useCallback((zoneId2) => {
|
|
22532
22735
|
zonesRef.current.delete(zoneId2);
|
|
22533
22736
|
}, []);
|
|
22534
|
-
const [activeDrag, setActiveDrag] =
|
|
22535
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
22536
|
-
const meta =
|
|
22737
|
+
const [activeDrag, setActiveDrag] = React84__default.useState(null);
|
|
22738
|
+
const [overZoneGroup, setOverZoneGroup] = React84__default.useState(null);
|
|
22739
|
+
const meta = React84__default.useMemo(
|
|
22537
22740
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
22538
22741
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
22539
22742
|
);
|
|
22540
|
-
|
|
22743
|
+
React84__default.useEffect(() => {
|
|
22541
22744
|
const target = isRoot ? null : parentRoot;
|
|
22542
22745
|
if (!target) {
|
|
22543
22746
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -22556,7 +22759,7 @@ function useDataDnd(args) {
|
|
|
22556
22759
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
22557
22760
|
const sensors = useAlmadarDndSensors(true);
|
|
22558
22761
|
const collisionDetection = almadarDndCollisionDetection;
|
|
22559
|
-
const findZoneByItem =
|
|
22762
|
+
const findZoneByItem = React84__default.useCallback(
|
|
22560
22763
|
(id) => {
|
|
22561
22764
|
for (const z of zonesRef.current.values()) {
|
|
22562
22765
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -22565,7 +22768,7 @@ function useDataDnd(args) {
|
|
|
22565
22768
|
},
|
|
22566
22769
|
[]
|
|
22567
22770
|
);
|
|
22568
|
-
|
|
22771
|
+
React84__default.useCallback(
|
|
22569
22772
|
(group) => {
|
|
22570
22773
|
for (const z of zonesRef.current.values()) {
|
|
22571
22774
|
if (z.group === group) return z;
|
|
@@ -22574,7 +22777,7 @@ function useDataDnd(args) {
|
|
|
22574
22777
|
},
|
|
22575
22778
|
[]
|
|
22576
22779
|
);
|
|
22577
|
-
const handleDragEnd =
|
|
22780
|
+
const handleDragEnd = React84__default.useCallback(
|
|
22578
22781
|
(event) => {
|
|
22579
22782
|
const { active, over } = event;
|
|
22580
22783
|
const activeIdStr = String(active.id);
|
|
@@ -22665,8 +22868,8 @@ function useDataDnd(args) {
|
|
|
22665
22868
|
},
|
|
22666
22869
|
[eventBus]
|
|
22667
22870
|
);
|
|
22668
|
-
const sortableData =
|
|
22669
|
-
const SortableItem =
|
|
22871
|
+
const sortableData = React84__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
22872
|
+
const SortableItem = React84__default.useCallback(
|
|
22670
22873
|
({ id, children }) => {
|
|
22671
22874
|
const {
|
|
22672
22875
|
attributes,
|
|
@@ -22706,7 +22909,7 @@ function useDataDnd(args) {
|
|
|
22706
22909
|
id: droppableId,
|
|
22707
22910
|
data: sortableData
|
|
22708
22911
|
});
|
|
22709
|
-
const ctx =
|
|
22912
|
+
const ctx = React84__default.useContext(RootCtx);
|
|
22710
22913
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
22711
22914
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
22712
22915
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -22721,7 +22924,7 @@ function useDataDnd(args) {
|
|
|
22721
22924
|
showForeignPlaceholder,
|
|
22722
22925
|
ctxAvailable: ctx != null
|
|
22723
22926
|
});
|
|
22724
|
-
|
|
22927
|
+
React84__default.useEffect(() => {
|
|
22725
22928
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
22726
22929
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
22727
22930
|
return /* @__PURE__ */ jsx(
|
|
@@ -22735,11 +22938,11 @@ function useDataDnd(args) {
|
|
|
22735
22938
|
}
|
|
22736
22939
|
);
|
|
22737
22940
|
};
|
|
22738
|
-
const rootContextValue =
|
|
22941
|
+
const rootContextValue = React84__default.useMemo(
|
|
22739
22942
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
22740
22943
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
22741
22944
|
);
|
|
22742
|
-
const handleDragStart =
|
|
22945
|
+
const handleDragStart = React84__default.useCallback((event) => {
|
|
22743
22946
|
const sourceZone = findZoneByItem(event.active.id);
|
|
22744
22947
|
const rect = event.active.rect.current.initial;
|
|
22745
22948
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -22758,7 +22961,7 @@ function useDataDnd(args) {
|
|
|
22758
22961
|
isRoot
|
|
22759
22962
|
});
|
|
22760
22963
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
22761
|
-
const handleDragOver =
|
|
22964
|
+
const handleDragOver = React84__default.useCallback((event) => {
|
|
22762
22965
|
const { active, over } = event;
|
|
22763
22966
|
const overData = over?.data?.current;
|
|
22764
22967
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -22828,7 +23031,7 @@ function useDataDnd(args) {
|
|
|
22828
23031
|
return next;
|
|
22829
23032
|
});
|
|
22830
23033
|
}, []);
|
|
22831
|
-
const handleDragCancel =
|
|
23034
|
+
const handleDragCancel = React84__default.useCallback((event) => {
|
|
22832
23035
|
setActiveDrag(null);
|
|
22833
23036
|
setOverZoneGroup(null);
|
|
22834
23037
|
dndLog.warn("dragCancel", {
|
|
@@ -22836,12 +23039,12 @@ function useDataDnd(args) {
|
|
|
22836
23039
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
22837
23040
|
});
|
|
22838
23041
|
}, []);
|
|
22839
|
-
const handleDragEndWithCleanup =
|
|
23042
|
+
const handleDragEndWithCleanup = React84__default.useCallback((event) => {
|
|
22840
23043
|
handleDragEnd(event);
|
|
22841
23044
|
setActiveDrag(null);
|
|
22842
23045
|
setOverZoneGroup(null);
|
|
22843
23046
|
}, [handleDragEnd]);
|
|
22844
|
-
const wrapContainer =
|
|
23047
|
+
const wrapContainer = React84__default.useCallback(
|
|
22845
23048
|
(children) => {
|
|
22846
23049
|
if (!enabled) return children;
|
|
22847
23050
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -22895,7 +23098,7 @@ var init_useDataDnd = __esm({
|
|
|
22895
23098
|
init_useAlmadarDndCollision();
|
|
22896
23099
|
init_Box();
|
|
22897
23100
|
dndLog = createLogger("almadar:ui:dnd");
|
|
22898
|
-
RootCtx =
|
|
23101
|
+
RootCtx = React84__default.createContext(null);
|
|
22899
23102
|
}
|
|
22900
23103
|
});
|
|
22901
23104
|
function renderIconInput(icon, props) {
|
|
@@ -23437,7 +23640,7 @@ function DataList({
|
|
|
23437
23640
|
}) {
|
|
23438
23641
|
const eventBus = useEventBus();
|
|
23439
23642
|
const { t } = useTranslate();
|
|
23440
|
-
const [visibleCount, setVisibleCount] =
|
|
23643
|
+
const [visibleCount, setVisibleCount] = React84__default.useState(pageSize || Infinity);
|
|
23441
23644
|
const fieldDefs = fields ?? columns ?? [];
|
|
23442
23645
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
23443
23646
|
const dnd = useDataDnd({
|
|
@@ -23453,14 +23656,14 @@ function DataList({
|
|
|
23453
23656
|
dndRoot
|
|
23454
23657
|
});
|
|
23455
23658
|
const orderedData = dnd.orderedItems;
|
|
23456
|
-
const allData =
|
|
23659
|
+
const allData = React84__default.useMemo(
|
|
23457
23660
|
() => sortRows(orderedData, sortBy, sortDirection),
|
|
23458
23661
|
[orderedData, sortBy, sortDirection]
|
|
23459
23662
|
);
|
|
23460
23663
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
23461
23664
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
23462
23665
|
const hasRenderProp = typeof children === "function";
|
|
23463
|
-
|
|
23666
|
+
React84__default.useEffect(() => {
|
|
23464
23667
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
23465
23668
|
const childrenTypeOf = typeof children;
|
|
23466
23669
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -23575,7 +23778,7 @@ function DataList({
|
|
|
23575
23778
|
return v === void 0 || v === null || v === "" ? raw : String(v);
|
|
23576
23779
|
};
|
|
23577
23780
|
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
|
|
23578
|
-
groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
23781
|
+
groups2.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
23579
23782
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
23580
23783
|
group.items.map((itemData, index) => {
|
|
23581
23784
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -23774,7 +23977,7 @@ function DataList({
|
|
|
23774
23977
|
className
|
|
23775
23978
|
),
|
|
23776
23979
|
children: [
|
|
23777
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
23980
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
23778
23981
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
23779
23982
|
group.items.map(
|
|
23780
23983
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -23861,7 +24064,7 @@ var init_FormSection = __esm({
|
|
|
23861
24064
|
columns = 1,
|
|
23862
24065
|
className
|
|
23863
24066
|
}) => {
|
|
23864
|
-
const [collapsed, setCollapsed] =
|
|
24067
|
+
const [collapsed, setCollapsed] = React84__default.useState(defaultCollapsed);
|
|
23865
24068
|
const { t } = useTranslate();
|
|
23866
24069
|
const eventBus = useEventBus();
|
|
23867
24070
|
const gridClass = {
|
|
@@ -23869,7 +24072,7 @@ var init_FormSection = __esm({
|
|
|
23869
24072
|
2: "grid-cols-1 md:grid-cols-2",
|
|
23870
24073
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
23871
24074
|
}[columns];
|
|
23872
|
-
|
|
24075
|
+
React84__default.useCallback(() => {
|
|
23873
24076
|
if (collapsible) {
|
|
23874
24077
|
setCollapsed((prev) => !prev);
|
|
23875
24078
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -24850,7 +25053,7 @@ var init_Flex = __esm({
|
|
|
24850
25053
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
24851
25054
|
}
|
|
24852
25055
|
}
|
|
24853
|
-
return
|
|
25056
|
+
return React84__default.createElement(Component, {
|
|
24854
25057
|
className: cn(
|
|
24855
25058
|
inline ? "inline-flex" : "flex",
|
|
24856
25059
|
directionStyles[direction],
|
|
@@ -24969,7 +25172,7 @@ var init_Grid = __esm({
|
|
|
24969
25172
|
as: Component = "div"
|
|
24970
25173
|
}) => {
|
|
24971
25174
|
const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
|
|
24972
|
-
return
|
|
25175
|
+
return React84__default.createElement(
|
|
24973
25176
|
Component,
|
|
24974
25177
|
{
|
|
24975
25178
|
className: cn(
|
|
@@ -25201,9 +25404,9 @@ var init_Popover = __esm({
|
|
|
25201
25404
|
onMouseLeave: handleClose,
|
|
25202
25405
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
25203
25406
|
};
|
|
25204
|
-
const childElement =
|
|
25407
|
+
const childElement = React84__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
25205
25408
|
const childPointerDown = childElement.props.onPointerDown;
|
|
25206
|
-
const triggerElement =
|
|
25409
|
+
const triggerElement = React84__default.cloneElement(
|
|
25207
25410
|
childElement,
|
|
25208
25411
|
{
|
|
25209
25412
|
ref: triggerRef,
|
|
@@ -25812,9 +26015,9 @@ var init_Tooltip = __esm({
|
|
|
25812
26015
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
25813
26016
|
};
|
|
25814
26017
|
}, []);
|
|
25815
|
-
const triggerElement =
|
|
26018
|
+
const triggerElement = React84__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
25816
26019
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
25817
|
-
const trigger =
|
|
26020
|
+
const trigger = React84__default.cloneElement(triggerElement, {
|
|
25818
26021
|
ref: triggerRef,
|
|
25819
26022
|
onMouseEnter: handleMouseEnter,
|
|
25820
26023
|
onMouseLeave: handleMouseLeave,
|
|
@@ -25904,7 +26107,7 @@ var init_WizardProgress = __esm({
|
|
|
25904
26107
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
25905
26108
|
const isActive = index === currentStep;
|
|
25906
26109
|
const isCompleted = index < currentStep;
|
|
25907
|
-
return /* @__PURE__ */ jsxs(
|
|
26110
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
25908
26111
|
/* @__PURE__ */ jsx(
|
|
25909
26112
|
"button",
|
|
25910
26113
|
{
|
|
@@ -27539,7 +27742,7 @@ var init_MapView = __esm({
|
|
|
27539
27742
|
shadowSize: [41, 41]
|
|
27540
27743
|
});
|
|
27541
27744
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
27542
|
-
const { useEffect: useEffect59, useRef: useRef61, useCallback: useCallback89, useState: useState91 } =
|
|
27745
|
+
const { useEffect: useEffect59, useRef: useRef61, useCallback: useCallback89, useState: useState91 } = React84__default;
|
|
27543
27746
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
27544
27747
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
27545
27748
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -28437,8 +28640,8 @@ function TableView({
|
|
|
28437
28640
|
}) {
|
|
28438
28641
|
const eventBus = useEventBus();
|
|
28439
28642
|
const { t } = useTranslate();
|
|
28440
|
-
const [visibleCount, setVisibleCount] =
|
|
28441
|
-
const [localSelected, setLocalSelected] =
|
|
28643
|
+
const [visibleCount, setVisibleCount] = React84__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
28644
|
+
const [localSelected, setLocalSelected] = React84__default.useState(/* @__PURE__ */ new Set());
|
|
28442
28645
|
const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
|
|
28443
28646
|
const actionDefs = Array.isArray(itemActions) ? itemActions : [];
|
|
28444
28647
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
@@ -28460,7 +28663,7 @@ function TableView({
|
|
|
28460
28663
|
const hasRenderProp = typeof children === "function";
|
|
28461
28664
|
const idField = dndItemIdField ?? "id";
|
|
28462
28665
|
const isCoarsePointer = useMediaQuery("(pointer: coarse)");
|
|
28463
|
-
|
|
28666
|
+
React84__default.useEffect(() => {
|
|
28464
28667
|
tableViewLog.debug("render", {
|
|
28465
28668
|
rowCount: data.length,
|
|
28466
28669
|
colCount: colDefs.length,
|
|
@@ -28517,7 +28720,7 @@ function TableView({
|
|
|
28517
28720
|
};
|
|
28518
28721
|
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
28519
28722
|
};
|
|
28520
|
-
const colFloors =
|
|
28723
|
+
const colFloors = React84__default.useMemo(
|
|
28521
28724
|
() => colDefs.map((col) => {
|
|
28522
28725
|
const longest = data.reduce((widest, row) => {
|
|
28523
28726
|
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
@@ -28679,12 +28882,12 @@ function TableView({
|
|
|
28679
28882
|
]
|
|
28680
28883
|
}
|
|
28681
28884
|
);
|
|
28682
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
28885
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React84__default.Fragment, { children: rowInner }, id);
|
|
28683
28886
|
};
|
|
28684
28887
|
const items = Array.from(data);
|
|
28685
28888
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
28686
28889
|
let runningIndex = 0;
|
|
28687
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
28890
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
28688
28891
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
28689
28892
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
28690
28893
|
] }, gi)) });
|
|
@@ -29909,7 +30112,7 @@ var init_StepFlow = __esm({
|
|
|
29909
30112
|
className
|
|
29910
30113
|
}) => {
|
|
29911
30114
|
if (orientation === "vertical") {
|
|
29912
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
30115
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React84__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
29913
30116
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
29914
30117
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
29915
30118
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -29920,7 +30123,7 @@ var init_StepFlow = __esm({
|
|
|
29920
30123
|
] })
|
|
29921
30124
|
] }) }, index)) });
|
|
29922
30125
|
}
|
|
29923
|
-
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(
|
|
30126
|
+
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(React84__default.Fragment, { children: [
|
|
29924
30127
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
29925
30128
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
29926
30129
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -30910,7 +31113,7 @@ var init_LikertScale = __esm({
|
|
|
30910
31113
|
md: "text-base",
|
|
30911
31114
|
lg: "text-lg"
|
|
30912
31115
|
};
|
|
30913
|
-
LikertScale =
|
|
31116
|
+
LikertScale = React84__default.forwardRef(
|
|
30914
31117
|
({
|
|
30915
31118
|
question,
|
|
30916
31119
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -30922,7 +31125,7 @@ var init_LikertScale = __esm({
|
|
|
30922
31125
|
variant = "radios",
|
|
30923
31126
|
className
|
|
30924
31127
|
}, ref) => {
|
|
30925
|
-
const groupId =
|
|
31128
|
+
const groupId = React84__default.useId();
|
|
30926
31129
|
const eventBus = useEventBus();
|
|
30927
31130
|
const handleSelect = useCallback(
|
|
30928
31131
|
(next) => {
|
|
@@ -33211,7 +33414,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
33211
33414
|
"aria-label": t("aria.breadcrumb"),
|
|
33212
33415
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
33213
33416
|
const isLast = idx === items.length - 1;
|
|
33214
|
-
return /* @__PURE__ */ jsxs(
|
|
33417
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
33215
33418
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
33216
33419
|
Icon,
|
|
33217
33420
|
{
|
|
@@ -34080,7 +34283,7 @@ var init_MiniStateMachine = __esm({
|
|
|
34080
34283
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
34081
34284
|
const tc = transitionCounts[s.name] ?? 0;
|
|
34082
34285
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
34083
|
-
return /* @__PURE__ */ jsxs(
|
|
34286
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
34084
34287
|
/* @__PURE__ */ jsx(
|
|
34085
34288
|
AvlState,
|
|
34086
34289
|
{
|
|
@@ -34284,7 +34487,7 @@ var init_PageHeader = __esm({
|
|
|
34284
34487
|
info: "bg-info/10 text-info"
|
|
34285
34488
|
};
|
|
34286
34489
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
34287
|
-
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(
|
|
34490
|
+
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(React84__default.Fragment, { children: [
|
|
34288
34491
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
34289
34492
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
34290
34493
|
"a",
|
|
@@ -34642,7 +34845,7 @@ var init_Section = __esm({
|
|
|
34642
34845
|
as: Component = "section"
|
|
34643
34846
|
}) => {
|
|
34644
34847
|
const hasHeader = title || description || action;
|
|
34645
|
-
return
|
|
34848
|
+
return React84__default.createElement(
|
|
34646
34849
|
Component,
|
|
34647
34850
|
{
|
|
34648
34851
|
className: cn(
|
|
@@ -35016,7 +35219,7 @@ var init_WizardContainer = __esm({
|
|
|
35016
35219
|
const isCompleted = index < currentStep;
|
|
35017
35220
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
35018
35221
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
35019
|
-
return /* @__PURE__ */ jsxs(
|
|
35222
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
35020
35223
|
/* @__PURE__ */ jsx(
|
|
35021
35224
|
Button,
|
|
35022
35225
|
{
|
|
@@ -36803,7 +37006,7 @@ var init_ImportPreviewTree = __esm({
|
|
|
36803
37006
|
const renderUnit = (unit, childrenByParent, depth) => {
|
|
36804
37007
|
const summary = fieldSummary(unit);
|
|
36805
37008
|
const children = childrenByParent.get(unit.ref) ?? [];
|
|
36806
|
-
return /* @__PURE__ */ jsxs(
|
|
37009
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
36807
37010
|
/* @__PURE__ */ jsxs(
|
|
36808
37011
|
Box,
|
|
36809
37012
|
{
|
|
@@ -36900,7 +37103,7 @@ var init_ImportProgress = __esm({
|
|
|
36900
37103
|
PIPELINE.map((key, index) => {
|
|
36901
37104
|
const isComplete = index < currentIndex;
|
|
36902
37105
|
const isActive = index === currentIndex;
|
|
36903
|
-
return /* @__PURE__ */ jsxs(
|
|
37106
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
36904
37107
|
index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
|
|
36905
37108
|
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
|
|
36906
37109
|
/* @__PURE__ */ jsx(
|
|
@@ -38013,7 +38216,7 @@ var init_DrawGroup = __esm({
|
|
|
38013
38216
|
}
|
|
38014
38217
|
});
|
|
38015
38218
|
function extractTitle(children) {
|
|
38016
|
-
if (!
|
|
38219
|
+
if (!React84__default.isValidElement(children)) return void 0;
|
|
38017
38220
|
const props = children.props;
|
|
38018
38221
|
if (typeof props.title === "string") {
|
|
38019
38222
|
return props.title;
|
|
@@ -38363,12 +38566,12 @@ var init_Form = __esm({
|
|
|
38363
38566
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
38364
38567
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
38365
38568
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
38366
|
-
const normalizedInitialData =
|
|
38569
|
+
const normalizedInitialData = React84__default.useMemo(() => {
|
|
38367
38570
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
38368
38571
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
38369
38572
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
38370
38573
|
}, [entity, initialData]);
|
|
38371
|
-
const entityDerivedFields =
|
|
38574
|
+
const entityDerivedFields = React84__default.useMemo(() => {
|
|
38372
38575
|
if (fields && fields.length > 0) return void 0;
|
|
38373
38576
|
if (!resolvedEntity) return void 0;
|
|
38374
38577
|
return resolvedEntity.fields.map(
|
|
@@ -38389,16 +38592,16 @@ var init_Form = __esm({
|
|
|
38389
38592
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
38390
38593
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
38391
38594
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
38392
|
-
const [formData, setFormData] =
|
|
38595
|
+
const [formData, setFormData] = React84__default.useState(
|
|
38393
38596
|
normalizedInitialData
|
|
38394
38597
|
);
|
|
38395
|
-
const [collapsedSections, setCollapsedSections] =
|
|
38598
|
+
const [collapsedSections, setCollapsedSections] = React84__default.useState(
|
|
38396
38599
|
/* @__PURE__ */ new Set()
|
|
38397
38600
|
);
|
|
38398
|
-
const [submitError, setSubmitError] =
|
|
38399
|
-
const formRef =
|
|
38601
|
+
const [submitError, setSubmitError] = React84__default.useState(null);
|
|
38602
|
+
const formRef = React84__default.useRef(null);
|
|
38400
38603
|
const formMode = props.mode;
|
|
38401
|
-
const mountedRef =
|
|
38604
|
+
const mountedRef = React84__default.useRef(false);
|
|
38402
38605
|
if (!mountedRef.current) {
|
|
38403
38606
|
mountedRef.current = true;
|
|
38404
38607
|
debug("forms", "mount", {
|
|
@@ -38411,7 +38614,7 @@ var init_Form = __esm({
|
|
|
38411
38614
|
});
|
|
38412
38615
|
}
|
|
38413
38616
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
38414
|
-
const evalContext =
|
|
38617
|
+
const evalContext = React84__default.useMemo(
|
|
38415
38618
|
() => ({
|
|
38416
38619
|
formValues: formData,
|
|
38417
38620
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -38420,7 +38623,7 @@ var init_Form = __esm({
|
|
|
38420
38623
|
}),
|
|
38421
38624
|
[formData, externalContext]
|
|
38422
38625
|
);
|
|
38423
|
-
|
|
38626
|
+
React84__default.useEffect(() => {
|
|
38424
38627
|
debug("forms", "initialData-sync", {
|
|
38425
38628
|
mode: formMode,
|
|
38426
38629
|
normalizedInitialData,
|
|
@@ -38431,7 +38634,7 @@ var init_Form = __esm({
|
|
|
38431
38634
|
setFormData(normalizedInitialData);
|
|
38432
38635
|
}
|
|
38433
38636
|
}, [normalizedInitialData]);
|
|
38434
|
-
const processCalculations =
|
|
38637
|
+
const processCalculations = React84__default.useCallback(
|
|
38435
38638
|
(changedFieldId, newFormData) => {
|
|
38436
38639
|
if (!hiddenCalculations.length) return;
|
|
38437
38640
|
const context = {
|
|
@@ -38456,7 +38659,7 @@ var init_Form = __esm({
|
|
|
38456
38659
|
},
|
|
38457
38660
|
[hiddenCalculations, externalContext, eventBus]
|
|
38458
38661
|
);
|
|
38459
|
-
const checkViolations =
|
|
38662
|
+
const checkViolations = React84__default.useCallback(
|
|
38460
38663
|
(changedFieldId, newFormData) => {
|
|
38461
38664
|
if (!violationTriggers.length) return;
|
|
38462
38665
|
const context = {
|
|
@@ -38494,7 +38697,7 @@ var init_Form = __esm({
|
|
|
38494
38697
|
processCalculations(name, newFormData);
|
|
38495
38698
|
checkViolations(name, newFormData);
|
|
38496
38699
|
};
|
|
38497
|
-
const isFieldVisible =
|
|
38700
|
+
const isFieldVisible = React84__default.useCallback(
|
|
38498
38701
|
(fieldName) => {
|
|
38499
38702
|
const condition = conditionalFields[fieldName];
|
|
38500
38703
|
if (!condition) return true;
|
|
@@ -38502,7 +38705,7 @@ var init_Form = __esm({
|
|
|
38502
38705
|
},
|
|
38503
38706
|
[conditionalFields, evalContext]
|
|
38504
38707
|
);
|
|
38505
|
-
const isSectionVisible =
|
|
38708
|
+
const isSectionVisible = React84__default.useCallback(
|
|
38506
38709
|
(section) => {
|
|
38507
38710
|
if (!section.condition) return true;
|
|
38508
38711
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -38578,7 +38781,7 @@ var init_Form = __esm({
|
|
|
38578
38781
|
eventBus.emit(`UI:${onCancel}`);
|
|
38579
38782
|
}
|
|
38580
38783
|
};
|
|
38581
|
-
const renderField =
|
|
38784
|
+
const renderField = React84__default.useCallback(
|
|
38582
38785
|
(field) => {
|
|
38583
38786
|
const fieldName = field.name || field.field;
|
|
38584
38787
|
if (!fieldName) return null;
|
|
@@ -38599,7 +38802,7 @@ var init_Form = __esm({
|
|
|
38599
38802
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
38600
38803
|
);
|
|
38601
38804
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
38602
|
-
const normalizedFields =
|
|
38805
|
+
const normalizedFields = React84__default.useMemo(() => {
|
|
38603
38806
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
38604
38807
|
return effectiveFields.map((field) => {
|
|
38605
38808
|
if (typeof field === "string") {
|
|
@@ -38623,7 +38826,7 @@ var init_Form = __esm({
|
|
|
38623
38826
|
return field;
|
|
38624
38827
|
});
|
|
38625
38828
|
}, [effectiveFields, resolvedEntity]);
|
|
38626
|
-
const schemaFields =
|
|
38829
|
+
const schemaFields = React84__default.useMemo(() => {
|
|
38627
38830
|
if (normalizedFields.length === 0) return null;
|
|
38628
38831
|
if (isDebugEnabled()) {
|
|
38629
38832
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -38633,7 +38836,7 @@ var init_Form = __esm({
|
|
|
38633
38836
|
}
|
|
38634
38837
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
38635
38838
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
38636
|
-
const sectionElements =
|
|
38839
|
+
const sectionElements = React84__default.useMemo(() => {
|
|
38637
38840
|
if (!sections || sections.length === 0) return null;
|
|
38638
38841
|
return sections.map((section) => {
|
|
38639
38842
|
if (!isSectionVisible(section)) {
|
|
@@ -39359,7 +39562,7 @@ var init_List = __esm({
|
|
|
39359
39562
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
39360
39563
|
return [];
|
|
39361
39564
|
}, [entity]);
|
|
39362
|
-
const getItemActions =
|
|
39565
|
+
const getItemActions = React84__default.useCallback(
|
|
39363
39566
|
(item) => {
|
|
39364
39567
|
if (!itemActions) return [];
|
|
39365
39568
|
if (typeof itemActions === "function") {
|
|
@@ -39840,7 +40043,7 @@ var init_MediaGallery = __esm({
|
|
|
39840
40043
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
39841
40044
|
);
|
|
39842
40045
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
39843
|
-
const items =
|
|
40046
|
+
const items = React84__default.useMemo(() => {
|
|
39844
40047
|
if (propItems && propItems.length > 0) return propItems;
|
|
39845
40048
|
if (entityData.length === 0) return [];
|
|
39846
40049
|
return entityData.map((record, idx) => {
|
|
@@ -40005,7 +40208,7 @@ var init_MediaGallery = __esm({
|
|
|
40005
40208
|
}
|
|
40006
40209
|
});
|
|
40007
40210
|
function extractTitle2(children) {
|
|
40008
|
-
if (!
|
|
40211
|
+
if (!React84__default.isValidElement(children)) return void 0;
|
|
40009
40212
|
const props = children.props;
|
|
40010
40213
|
if (typeof props.title === "string") {
|
|
40011
40214
|
return props.title;
|
|
@@ -40279,7 +40482,7 @@ var init_debugRegistry = __esm({
|
|
|
40279
40482
|
}
|
|
40280
40483
|
});
|
|
40281
40484
|
function useDebugData() {
|
|
40282
|
-
const [data, setData] =
|
|
40485
|
+
const [data, setData] = React84.useState(() => ({
|
|
40283
40486
|
traits: [],
|
|
40284
40487
|
ticks: [],
|
|
40285
40488
|
guards: [],
|
|
@@ -40293,7 +40496,7 @@ function useDebugData() {
|
|
|
40293
40496
|
},
|
|
40294
40497
|
lastUpdate: Date.now()
|
|
40295
40498
|
}));
|
|
40296
|
-
|
|
40499
|
+
React84.useEffect(() => {
|
|
40297
40500
|
const updateData = () => {
|
|
40298
40501
|
setData({
|
|
40299
40502
|
traits: getAllTraits(),
|
|
@@ -40402,12 +40605,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
40402
40605
|
return positions;
|
|
40403
40606
|
}
|
|
40404
40607
|
function WalkMinimap() {
|
|
40405
|
-
const [walkStep, setWalkStep] =
|
|
40406
|
-
const [traits2, setTraits] =
|
|
40407
|
-
const [coveredEdges, setCoveredEdges] =
|
|
40408
|
-
const [completedTraits, setCompletedTraits] =
|
|
40409
|
-
const prevTraitRef =
|
|
40410
|
-
|
|
40608
|
+
const [walkStep, setWalkStep] = React84.useState(null);
|
|
40609
|
+
const [traits2, setTraits] = React84.useState([]);
|
|
40610
|
+
const [coveredEdges, setCoveredEdges] = React84.useState([]);
|
|
40611
|
+
const [completedTraits, setCompletedTraits] = React84.useState(/* @__PURE__ */ new Set());
|
|
40612
|
+
const prevTraitRef = React84.useRef(null);
|
|
40613
|
+
React84.useEffect(() => {
|
|
40411
40614
|
const interval = setInterval(() => {
|
|
40412
40615
|
const w = window;
|
|
40413
40616
|
const step = w.__orbitalWalkStep;
|
|
@@ -40843,15 +41046,15 @@ var init_EntitiesTab = __esm({
|
|
|
40843
41046
|
});
|
|
40844
41047
|
function EventFlowTab({ events: events2 }) {
|
|
40845
41048
|
const { t } = useTranslate();
|
|
40846
|
-
const [filter, setFilter] =
|
|
40847
|
-
const containerRef =
|
|
40848
|
-
const [autoScroll, setAutoScroll] =
|
|
40849
|
-
|
|
41049
|
+
const [filter, setFilter] = React84.useState("all");
|
|
41050
|
+
const containerRef = React84.useRef(null);
|
|
41051
|
+
const [autoScroll, setAutoScroll] = React84.useState(true);
|
|
41052
|
+
React84.useEffect(() => {
|
|
40850
41053
|
if (autoScroll && containerRef.current) {
|
|
40851
41054
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
40852
41055
|
}
|
|
40853
41056
|
}, [events2.length, autoScroll]);
|
|
40854
|
-
const filteredEvents =
|
|
41057
|
+
const filteredEvents = React84.useMemo(() => {
|
|
40855
41058
|
if (filter === "all") return events2;
|
|
40856
41059
|
return events2.filter((e) => e.type === filter);
|
|
40857
41060
|
}, [events2, filter]);
|
|
@@ -40967,7 +41170,7 @@ var init_EventFlowTab = __esm({
|
|
|
40967
41170
|
});
|
|
40968
41171
|
function GuardsPanel({ guards }) {
|
|
40969
41172
|
const { t } = useTranslate();
|
|
40970
|
-
const [filter, setFilter] =
|
|
41173
|
+
const [filter, setFilter] = React84.useState("all");
|
|
40971
41174
|
if (guards.length === 0) {
|
|
40972
41175
|
return /* @__PURE__ */ jsx(
|
|
40973
41176
|
EmptyState,
|
|
@@ -40980,7 +41183,7 @@ function GuardsPanel({ guards }) {
|
|
|
40980
41183
|
}
|
|
40981
41184
|
const passedCount = guards.filter((g) => g.result).length;
|
|
40982
41185
|
const failedCount = guards.length - passedCount;
|
|
40983
|
-
const filteredGuards =
|
|
41186
|
+
const filteredGuards = React84.useMemo(() => {
|
|
40984
41187
|
if (filter === "all") return guards;
|
|
40985
41188
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
40986
41189
|
return guards.filter((g) => !g.result);
|
|
@@ -41143,10 +41346,10 @@ function EffectBadge({ effect }) {
|
|
|
41143
41346
|
}
|
|
41144
41347
|
function TransitionTimeline({ transitions }) {
|
|
41145
41348
|
const { t } = useTranslate();
|
|
41146
|
-
const containerRef =
|
|
41147
|
-
const [autoScroll, setAutoScroll] =
|
|
41148
|
-
const [expandedId, setExpandedId] =
|
|
41149
|
-
|
|
41349
|
+
const containerRef = React84.useRef(null);
|
|
41350
|
+
const [autoScroll, setAutoScroll] = React84.useState(true);
|
|
41351
|
+
const [expandedId, setExpandedId] = React84.useState(null);
|
|
41352
|
+
React84.useEffect(() => {
|
|
41150
41353
|
if (autoScroll && containerRef.current) {
|
|
41151
41354
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
41152
41355
|
}
|
|
@@ -41426,9 +41629,9 @@ function getAllEvents(traits2) {
|
|
|
41426
41629
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
41427
41630
|
const eventBus = useEventBus();
|
|
41428
41631
|
const { t } = useTranslate();
|
|
41429
|
-
const [log9, setLog] =
|
|
41430
|
-
const prevStatesRef =
|
|
41431
|
-
|
|
41632
|
+
const [log9, setLog] = React84.useState([]);
|
|
41633
|
+
const prevStatesRef = React84.useRef(/* @__PURE__ */ new Map());
|
|
41634
|
+
React84.useEffect(() => {
|
|
41432
41635
|
for (const trait of traits2) {
|
|
41433
41636
|
const prev = prevStatesRef.current.get(trait.id);
|
|
41434
41637
|
if (prev && prev !== trait.currentState) {
|
|
@@ -41597,10 +41800,10 @@ function VerifyModePanel({
|
|
|
41597
41800
|
localCount
|
|
41598
41801
|
}) {
|
|
41599
41802
|
const { t } = useTranslate();
|
|
41600
|
-
const [expanded, setExpanded] =
|
|
41601
|
-
const scrollRef =
|
|
41602
|
-
const prevCountRef =
|
|
41603
|
-
|
|
41803
|
+
const [expanded, setExpanded] = React84.useState(true);
|
|
41804
|
+
const scrollRef = React84.useRef(null);
|
|
41805
|
+
const prevCountRef = React84.useRef(0);
|
|
41806
|
+
React84.useEffect(() => {
|
|
41604
41807
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
41605
41808
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
41606
41809
|
}
|
|
@@ -41657,10 +41860,10 @@ function RuntimeDebugger({
|
|
|
41657
41860
|
schema
|
|
41658
41861
|
}) {
|
|
41659
41862
|
const { t } = useTranslate();
|
|
41660
|
-
const [isCollapsed, setIsCollapsed] =
|
|
41661
|
-
const [isVisible, setIsVisible] =
|
|
41863
|
+
const [isCollapsed, setIsCollapsed] = React84.useState(mode === "verify" ? true : defaultCollapsed);
|
|
41864
|
+
const [isVisible, setIsVisible] = React84.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
41662
41865
|
const debugData = useDebugData();
|
|
41663
|
-
|
|
41866
|
+
React84.useEffect(() => {
|
|
41664
41867
|
if (mode === "inline") return;
|
|
41665
41868
|
return onDebugToggle((enabled) => {
|
|
41666
41869
|
setIsVisible(enabled);
|
|
@@ -41669,7 +41872,7 @@ function RuntimeDebugger({
|
|
|
41669
41872
|
}
|
|
41670
41873
|
});
|
|
41671
41874
|
}, [mode]);
|
|
41672
|
-
|
|
41875
|
+
React84.useEffect(() => {
|
|
41673
41876
|
if (mode === "inline") return;
|
|
41674
41877
|
const handleKeyDown = (e) => {
|
|
41675
41878
|
if (e.key === "`" && isVisible) {
|
|
@@ -42189,7 +42392,7 @@ var init_StatCard = __esm({
|
|
|
42189
42392
|
const labelToUse = propLabel ?? propTitle;
|
|
42190
42393
|
const eventBus = useEventBus();
|
|
42191
42394
|
const { t } = useTranslate();
|
|
42192
|
-
const handleActionClick =
|
|
42395
|
+
const handleActionClick = React84__default.useCallback(() => {
|
|
42193
42396
|
if (action?.event) {
|
|
42194
42397
|
eventBus.emit(`UI:${action.event}`, {});
|
|
42195
42398
|
}
|
|
@@ -42200,7 +42403,7 @@ var init_StatCard = __esm({
|
|
|
42200
42403
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
42201
42404
|
const isLoading = externalLoading ?? false;
|
|
42202
42405
|
const error = externalError;
|
|
42203
|
-
const computeMetricValue =
|
|
42406
|
+
const computeMetricValue = React84__default.useCallback(
|
|
42204
42407
|
(metric, items) => {
|
|
42205
42408
|
if (metric.value !== void 0) {
|
|
42206
42409
|
return metric.value;
|
|
@@ -42239,7 +42442,7 @@ var init_StatCard = __esm({
|
|
|
42239
42442
|
},
|
|
42240
42443
|
[]
|
|
42241
42444
|
);
|
|
42242
|
-
const schemaStats =
|
|
42445
|
+
const schemaStats = React84__default.useMemo(() => {
|
|
42243
42446
|
if (!metrics || metrics.length === 0) return null;
|
|
42244
42447
|
return metrics.map((metric) => ({
|
|
42245
42448
|
label: metric.label,
|
|
@@ -42247,7 +42450,7 @@ var init_StatCard = __esm({
|
|
|
42247
42450
|
format: metric.format
|
|
42248
42451
|
}));
|
|
42249
42452
|
}, [metrics, data, computeMetricValue]);
|
|
42250
|
-
const calculatedTrend =
|
|
42453
|
+
const calculatedTrend = React84__default.useMemo(() => {
|
|
42251
42454
|
if (manualTrend !== void 0) return manualTrend;
|
|
42252
42455
|
if (previousValue === void 0 || currentValue === void 0)
|
|
42253
42456
|
return void 0;
|
|
@@ -42887,8 +43090,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
42887
43090
|
] });
|
|
42888
43091
|
};
|
|
42889
43092
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
42890
|
-
const endRef =
|
|
42891
|
-
|
|
43093
|
+
const endRef = React84__default.useRef(null);
|
|
43094
|
+
React84__default.useEffect(() => {
|
|
42892
43095
|
if (!autoScroll) return;
|
|
42893
43096
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
42894
43097
|
}, [activities.length, autoScroll]);
|
|
@@ -42982,7 +43185,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
42982
43185
|
};
|
|
42983
43186
|
SubagentRichCard = ({ subagent }) => {
|
|
42984
43187
|
const { t } = useTranslate();
|
|
42985
|
-
const activities =
|
|
43188
|
+
const activities = React84__default.useMemo(
|
|
42986
43189
|
() => subagentMessagesToActivities(subagent.messages),
|
|
42987
43190
|
[subagent.messages]
|
|
42988
43191
|
);
|
|
@@ -43059,8 +43262,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
43059
43262
|
] });
|
|
43060
43263
|
};
|
|
43061
43264
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
43062
|
-
const endRef =
|
|
43063
|
-
|
|
43265
|
+
const endRef = React84__default.useRef(null);
|
|
43266
|
+
React84__default.useEffect(() => {
|
|
43064
43267
|
if (!autoScroll) return;
|
|
43065
43268
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
43066
43269
|
}, [messages.length, autoScroll]);
|
|
@@ -43495,7 +43698,7 @@ var init_Timeline = __esm({
|
|
|
43495
43698
|
}) => {
|
|
43496
43699
|
const { t } = useTranslate();
|
|
43497
43700
|
const entityData = entity ?? [];
|
|
43498
|
-
const items =
|
|
43701
|
+
const items = React84__default.useMemo(() => {
|
|
43499
43702
|
if (propItems) return propItems;
|
|
43500
43703
|
if (entityData.length === 0) return [];
|
|
43501
43704
|
return entityData.map((record, idx) => {
|
|
@@ -43597,7 +43800,7 @@ var init_Timeline = __esm({
|
|
|
43597
43800
|
}
|
|
43598
43801
|
});
|
|
43599
43802
|
function extractToastProps(children) {
|
|
43600
|
-
if (!
|
|
43803
|
+
if (!React84__default.isValidElement(children)) {
|
|
43601
43804
|
if (typeof children === "string") {
|
|
43602
43805
|
return { message: children };
|
|
43603
43806
|
}
|
|
@@ -43639,7 +43842,7 @@ var init_ToastSlot = __esm({
|
|
|
43639
43842
|
eventBus.emit(`${prefix}CLOSE`);
|
|
43640
43843
|
};
|
|
43641
43844
|
if (!isVisible) return null;
|
|
43642
|
-
const isCustomContent =
|
|
43845
|
+
const isCustomContent = React84__default.isValidElement(children) && !message;
|
|
43643
43846
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
43644
43847
|
Toast,
|
|
43645
43848
|
{
|
|
@@ -44212,7 +44415,7 @@ function SuspenseConfigProvider({
|
|
|
44212
44415
|
config,
|
|
44213
44416
|
children
|
|
44214
44417
|
}) {
|
|
44215
|
-
return
|
|
44418
|
+
return React84__default.createElement(
|
|
44216
44419
|
SuspenseConfigContext.Provider,
|
|
44217
44420
|
{ value: config },
|
|
44218
44421
|
children
|
|
@@ -44254,7 +44457,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
44254
44457
|
}
|
|
44255
44458
|
return { name: field, label: humanizeFieldName(field) };
|
|
44256
44459
|
}
|
|
44257
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
44460
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React84__default.isValidElement(field) && !(field instanceof Date)) {
|
|
44258
44461
|
const obj = field;
|
|
44259
44462
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
44260
44463
|
if (!fieldName) return field;
|
|
@@ -44726,7 +44929,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
44726
44929
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
44727
44930
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
44728
44931
|
}
|
|
44729
|
-
return /* @__PURE__ */ jsx(
|
|
44932
|
+
return /* @__PURE__ */ jsx(React84__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
44730
44933
|
}
|
|
44731
44934
|
if (!child || typeof child !== "object") return null;
|
|
44732
44935
|
const childId = `${parentId}-${index}`;
|
|
@@ -44783,14 +44986,14 @@ function isPatternConfig(value) {
|
|
|
44783
44986
|
if (value === null || value === void 0) return false;
|
|
44784
44987
|
if (typeof value !== "object") return false;
|
|
44785
44988
|
if (Array.isArray(value)) return false;
|
|
44786
|
-
if (
|
|
44989
|
+
if (React84__default.isValidElement(value)) return false;
|
|
44787
44990
|
if (value instanceof Date) return false;
|
|
44788
44991
|
if (typeof value === "function") return false;
|
|
44789
44992
|
const record = value;
|
|
44790
44993
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
44791
44994
|
}
|
|
44792
44995
|
function isPlainConfigObject(value) {
|
|
44793
|
-
if (
|
|
44996
|
+
if (React84__default.isValidElement(value)) return false;
|
|
44794
44997
|
if (value instanceof Date) return false;
|
|
44795
44998
|
const proto = Object.getPrototypeOf(value);
|
|
44796
44999
|
return proto === Object.prototype || proto === null;
|
|
@@ -44911,8 +45114,13 @@ function SlotContentRenderer({
|
|
|
44911
45114
|
const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
|
|
44912
45115
|
const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
|
|
44913
45116
|
const isDrawHost = isDrawHostPattern(content.pattern);
|
|
45117
|
+
const arr = Array.isArray(childrenConfig) ? childrenConfig : childrenConfig ? [childrenConfig] : [];
|
|
45118
|
+
const hasTraitChildren = arr.some(
|
|
45119
|
+
(c) => typeof c === "string" && TRAIT_BINDING_RE.test(c)
|
|
45120
|
+
);
|
|
45121
|
+
const drawHostUsesReactChildren = isDrawHost && hasTraitChildren;
|
|
44914
45122
|
const myPath = patternPath ?? "root";
|
|
44915
|
-
const renderedChildren = hasChildren && !isDrawHost ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait, {
|
|
45123
|
+
const renderedChildren = hasChildren && (!isDrawHost || drawHostUsesReactChildren) ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait, {
|
|
44916
45124
|
slot: content.slot,
|
|
44917
45125
|
transitionEvent: content.transitionEvent,
|
|
44918
45126
|
fromState: content.fromState,
|
|
@@ -44926,7 +45134,7 @@ function SlotContentRenderer({
|
|
|
44926
45134
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
44927
45135
|
const slotVal = restProps[slotKey];
|
|
44928
45136
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
44929
|
-
if (
|
|
45137
|
+
if (React84__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
44930
45138
|
const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
|
|
44931
45139
|
if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
44932
45140
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
@@ -44973,14 +45181,14 @@ function SlotContentRenderer({
|
|
|
44973
45181
|
for (const [k, v] of Object.entries(nodeSlotOverrides)) {
|
|
44974
45182
|
finalProps[k] = v;
|
|
44975
45183
|
}
|
|
44976
|
-
if (isDrawHost && Array.isArray(childrenConfig) && childrenConfig.length > 0) {
|
|
45184
|
+
if (isDrawHost && !drawHostUsesReactChildren && Array.isArray(childrenConfig) && childrenConfig.length > 0) {
|
|
44977
45185
|
finalProps.drawables = toDrawableNodes(childrenConfig);
|
|
44978
45186
|
}
|
|
44979
45187
|
const entityVal = finalProps.entity;
|
|
44980
45188
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
44981
45189
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
44982
45190
|
const sample = resolvedItems[0];
|
|
44983
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
45191
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React84__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
44984
45192
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
44985
45193
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
44986
45194
|
}
|
|
@@ -45152,6 +45360,8 @@ var init_UISlotRenderer = __esm({
|
|
|
45152
45360
|
"vstack",
|
|
45153
45361
|
"hstack",
|
|
45154
45362
|
"box",
|
|
45363
|
+
"canvas",
|
|
45364
|
+
"canvas-2d",
|
|
45155
45365
|
"grid",
|
|
45156
45366
|
"center",
|
|
45157
45367
|
"card",
|
|
@@ -45356,7 +45566,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
45356
45566
|
}
|
|
45357
45567
|
return substituted;
|
|
45358
45568
|
}
|
|
45359
|
-
if (body !== null && typeof body === "object" && !
|
|
45569
|
+
if (body !== null && typeof body === "object" && !React84__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
45360
45570
|
const out = {};
|
|
45361
45571
|
for (const [k, v] of Object.entries(body)) {
|
|
45362
45572
|
out[k] = recur(v);
|
|
@@ -45389,7 +45599,7 @@ function deferLambdaEntityExprs(value) {
|
|
|
45389
45599
|
}
|
|
45390
45600
|
return arr.map((v) => deferLambdaEntityExprs(v));
|
|
45391
45601
|
}
|
|
45392
|
-
if (value !== null && typeof value === "object" && !
|
|
45602
|
+
if (value !== null && typeof value === "object" && !React84__default.isValidElement(value) && !(value instanceof Date) && typeof value !== "function" && !isRenderBindingMarker(value)) {
|
|
45393
45603
|
const out = {};
|
|
45394
45604
|
for (const [k, v] of Object.entries(value)) {
|
|
45395
45605
|
out[k] = deferLambdaEntityExprs(v);
|
|
@@ -45403,7 +45613,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
45403
45613
|
const resolvedBody = deferLambdaEntityExprs(
|
|
45404
45614
|
resolveLambdaBindings(lambdaBody, params, item, index)
|
|
45405
45615
|
);
|
|
45406
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
45616
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React84__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
45407
45617
|
return null;
|
|
45408
45618
|
}
|
|
45409
45619
|
const record = resolvedBody;
|
|
@@ -45422,7 +45632,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
45422
45632
|
props: childProps,
|
|
45423
45633
|
priority: 0
|
|
45424
45634
|
};
|
|
45425
|
-
return
|
|
45635
|
+
return React84__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
45426
45636
|
};
|
|
45427
45637
|
}
|
|
45428
45638
|
function convertNode(node, callerKey) {
|
|
@@ -45442,7 +45652,7 @@ function convertNode(node, callerKey) {
|
|
|
45442
45652
|
});
|
|
45443
45653
|
return anyChanged ? mapped : node;
|
|
45444
45654
|
}
|
|
45445
|
-
if (typeof node === "object" && !
|
|
45655
|
+
if (typeof node === "object" && !React84__default.isValidElement(node) && !(node instanceof Date)) {
|
|
45446
45656
|
return convertObjectProps(node);
|
|
45447
45657
|
}
|
|
45448
45658
|
return node;
|