@almadar/ui 5.137.0 → 5.139.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +1321 -1236
- package/dist/avl/index.js +357 -272
- package/dist/components/index.cjs +1300 -1215
- package/dist/components/index.d.cts +9 -2
- package/dist/components/index.d.ts +9 -2
- package/dist/components/index.js +342 -257
- package/dist/lib/drawable/three/index.cjs +6 -0
- package/dist/lib/drawable/three/index.js +6 -0
- package/dist/providers/index.cjs +1204 -1119
- package/dist/providers/index.js +332 -247
- package/dist/runtime/index.cjs +1182 -1097
- package/dist/runtime/index.js +337 -252
- package/package.json +4 -4
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React86 from 'react';
|
|
2
|
+
import React86__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
|
|
3
3
|
import { EventBusContext, useTraitScopeChain, useEntitySchemaOptional, useEntityBindingSnapshot, useTraitScope, TraitScopeProvider, useCurrentPagePath, useGameAudioContextOptional } from '@almadar/ui/providers';
|
|
4
4
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
5
5
|
import { createContextFromBindings, interpolateValue } from '@almadar/runtime';
|
|
@@ -281,7 +281,7 @@ function resolveMarkerExpression(expression, entity, config, state) {
|
|
|
281
281
|
function isPlainObject(value) {
|
|
282
282
|
if (value === null || value === void 0 || typeof value !== "object") return false;
|
|
283
283
|
if (Array.isArray(value)) return false;
|
|
284
|
-
if (
|
|
284
|
+
if (React86__default.isValidElement(value)) return false;
|
|
285
285
|
if (value instanceof Date) return false;
|
|
286
286
|
if (typeof value === "function") return false;
|
|
287
287
|
return true;
|
|
@@ -501,7 +501,7 @@ var init_Box = __esm({
|
|
|
501
501
|
fixed: "fixed",
|
|
502
502
|
sticky: "sticky"
|
|
503
503
|
};
|
|
504
|
-
Box =
|
|
504
|
+
Box = React86__default.forwardRef(
|
|
505
505
|
({
|
|
506
506
|
padding,
|
|
507
507
|
paddingX,
|
|
@@ -566,7 +566,7 @@ var init_Box = __esm({
|
|
|
566
566
|
onPointerDown?.(e);
|
|
567
567
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
568
568
|
const isClickable = action || onClick;
|
|
569
|
-
return
|
|
569
|
+
return React86__default.createElement(
|
|
570
570
|
Component,
|
|
571
571
|
{
|
|
572
572
|
ref,
|
|
@@ -783,7 +783,7 @@ var init_Icon = __esm({
|
|
|
783
783
|
const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
|
|
784
784
|
const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
|
|
785
785
|
const family = useIconFamily();
|
|
786
|
-
const RenderedComponent =
|
|
786
|
+
const RenderedComponent = React86__default.useMemo(() => {
|
|
787
787
|
if (directIcon) return null;
|
|
788
788
|
return effectiveName ? resolveIconForFamily(effectiveName) : null;
|
|
789
789
|
}, [directIcon, effectiveName, family]);
|
|
@@ -907,7 +907,7 @@ var init_atlasSlice = __esm({
|
|
|
907
907
|
}
|
|
908
908
|
});
|
|
909
909
|
function useAtlasSliceDataUrl(asset) {
|
|
910
|
-
const [, bump] =
|
|
910
|
+
const [, bump] = React86.useReducer((x) => x + 1, 0);
|
|
911
911
|
if (!isAtlasAsset(asset)) return void 0;
|
|
912
912
|
const key = `${asset.atlas}#${asset.sprite}`;
|
|
913
913
|
const cached = sliceDataUrlCache.get(key);
|
|
@@ -970,13 +970,13 @@ function AtlasImage({
|
|
|
970
970
|
style,
|
|
971
971
|
"aria-hidden": ariaHidden
|
|
972
972
|
}) {
|
|
973
|
-
const [, bump] =
|
|
974
|
-
const canvasRef =
|
|
973
|
+
const [, bump] = React86.useReducer((x) => x + 1, 0);
|
|
974
|
+
const canvasRef = React86.useRef(null);
|
|
975
975
|
const sliced = isAtlasAsset(asset);
|
|
976
976
|
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
977
977
|
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
978
978
|
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
979
|
-
|
|
979
|
+
React86.useEffect(() => {
|
|
980
980
|
const canvas = canvasRef.current;
|
|
981
981
|
if (!canvas || !img || !rect) return;
|
|
982
982
|
canvas.width = rect.sw;
|
|
@@ -1052,7 +1052,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1052
1052
|
const IconComp = value;
|
|
1053
1053
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1054
1054
|
}
|
|
1055
|
-
if (
|
|
1055
|
+
if (React86__default.isValidElement(value)) {
|
|
1056
1056
|
return value;
|
|
1057
1057
|
}
|
|
1058
1058
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1129,7 +1129,7 @@ var init_Button = __esm({
|
|
|
1129
1129
|
md: "h-icon-default w-icon-default",
|
|
1130
1130
|
lg: "h-icon-default w-icon-default"
|
|
1131
1131
|
};
|
|
1132
|
-
Button =
|
|
1132
|
+
Button = React86__default.forwardRef(
|
|
1133
1133
|
({
|
|
1134
1134
|
className,
|
|
1135
1135
|
variant = "primary",
|
|
@@ -1199,7 +1199,7 @@ var Dialog;
|
|
|
1199
1199
|
var init_Dialog = __esm({
|
|
1200
1200
|
"components/core/atoms/Dialog.tsx"() {
|
|
1201
1201
|
init_cn();
|
|
1202
|
-
Dialog =
|
|
1202
|
+
Dialog = React86__default.forwardRef(
|
|
1203
1203
|
({
|
|
1204
1204
|
role = "dialog",
|
|
1205
1205
|
"aria-modal": ariaModal = true,
|
|
@@ -1410,7 +1410,7 @@ var init_Typography = __esm({
|
|
|
1410
1410
|
if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
|
|
1411
1411
|
body = formatValue(body, format);
|
|
1412
1412
|
}
|
|
1413
|
-
return
|
|
1413
|
+
return React86__default.createElement(
|
|
1414
1414
|
Component,
|
|
1415
1415
|
{
|
|
1416
1416
|
id,
|
|
@@ -1973,7 +1973,7 @@ var init_Badge = __esm({
|
|
|
1973
1973
|
md: "px-2.5 py-1 text-sm",
|
|
1974
1974
|
lg: "px-3 py-1.5 text-base"
|
|
1975
1975
|
};
|
|
1976
|
-
Badge =
|
|
1976
|
+
Badge = React86__default.forwardRef(
|
|
1977
1977
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
1978
1978
|
const iconSizes3 = {
|
|
1979
1979
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2323,7 +2323,7 @@ var init_SvgFlow = __esm({
|
|
|
2323
2323
|
width = 100,
|
|
2324
2324
|
height = 100
|
|
2325
2325
|
}) => {
|
|
2326
|
-
const markerId =
|
|
2326
|
+
const markerId = React86__default.useMemo(() => {
|
|
2327
2327
|
flowIdCounter += 1;
|
|
2328
2328
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2329
2329
|
}, []);
|
|
@@ -2916,7 +2916,7 @@ var init_SvgRing = __esm({
|
|
|
2916
2916
|
width = 100,
|
|
2917
2917
|
height = 100
|
|
2918
2918
|
}) => {
|
|
2919
|
-
const gradientId =
|
|
2919
|
+
const gradientId = React86__default.useMemo(() => {
|
|
2920
2920
|
ringIdCounter += 1;
|
|
2921
2921
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
2922
2922
|
}, []);
|
|
@@ -3097,7 +3097,7 @@ var init_Input = __esm({
|
|
|
3097
3097
|
init_cn();
|
|
3098
3098
|
init_Icon();
|
|
3099
3099
|
init_useEventBus();
|
|
3100
|
-
Input =
|
|
3100
|
+
Input = React86__default.forwardRef(
|
|
3101
3101
|
({
|
|
3102
3102
|
className,
|
|
3103
3103
|
inputType,
|
|
@@ -3121,9 +3121,9 @@ var init_Input = __esm({
|
|
|
3121
3121
|
const eventBus = useEventBus();
|
|
3122
3122
|
const type = inputType || htmlType || "text";
|
|
3123
3123
|
const isDeclarative = typeof onChange === "string";
|
|
3124
|
-
const [localValue, setLocalValue] =
|
|
3125
|
-
const pendingEchoRef =
|
|
3126
|
-
|
|
3124
|
+
const [localValue, setLocalValue] = React86__default.useState(value);
|
|
3125
|
+
const pendingEchoRef = React86__default.useRef(/* @__PURE__ */ new Set());
|
|
3126
|
+
React86__default.useEffect(() => {
|
|
3127
3127
|
if (!isDeclarative) return;
|
|
3128
3128
|
const incoming = value == null ? "" : String(value);
|
|
3129
3129
|
if (pendingEchoRef.current.has(incoming)) {
|
|
@@ -3283,7 +3283,7 @@ var Label;
|
|
|
3283
3283
|
var init_Label = __esm({
|
|
3284
3284
|
"components/core/atoms/Label.tsx"() {
|
|
3285
3285
|
init_cn();
|
|
3286
|
-
Label =
|
|
3286
|
+
Label = React86__default.forwardRef(
|
|
3287
3287
|
({ className, required, children, ...props }, ref) => {
|
|
3288
3288
|
return /* @__PURE__ */ jsxs(
|
|
3289
3289
|
"label",
|
|
@@ -3310,7 +3310,7 @@ var init_Textarea = __esm({
|
|
|
3310
3310
|
"components/core/atoms/Textarea.tsx"() {
|
|
3311
3311
|
init_cn();
|
|
3312
3312
|
init_useEventBus();
|
|
3313
|
-
Textarea =
|
|
3313
|
+
Textarea = React86__default.forwardRef(
|
|
3314
3314
|
({ className, error, onChange, ...props }, ref) => {
|
|
3315
3315
|
const eventBus = useEventBus();
|
|
3316
3316
|
const handleChange = (e) => {
|
|
@@ -3549,7 +3549,7 @@ var init_Select = __esm({
|
|
|
3549
3549
|
init_cn();
|
|
3550
3550
|
init_Icon();
|
|
3551
3551
|
init_useEventBus();
|
|
3552
|
-
Select =
|
|
3552
|
+
Select = React86__default.forwardRef(
|
|
3553
3553
|
(props, _ref) => {
|
|
3554
3554
|
const { multiple, searchable, clearable } = props;
|
|
3555
3555
|
if (multiple || searchable || clearable) {
|
|
@@ -3566,7 +3566,7 @@ var init_Checkbox = __esm({
|
|
|
3566
3566
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3567
3567
|
init_cn();
|
|
3568
3568
|
init_useEventBus();
|
|
3569
|
-
Checkbox =
|
|
3569
|
+
Checkbox = React86__default.forwardRef(
|
|
3570
3570
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
3571
3571
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3572
3572
|
const eventBus = useEventBus();
|
|
@@ -3620,7 +3620,7 @@ var init_Spinner = __esm({
|
|
|
3620
3620
|
md: "h-6 w-6",
|
|
3621
3621
|
lg: "h-8 w-8"
|
|
3622
3622
|
};
|
|
3623
|
-
Spinner =
|
|
3623
|
+
Spinner = React86__default.forwardRef(
|
|
3624
3624
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
3625
3625
|
if (overlay) {
|
|
3626
3626
|
return /* @__PURE__ */ jsx(
|
|
@@ -3710,7 +3710,7 @@ var init_Card = __esm({
|
|
|
3710
3710
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
3711
3711
|
"tile-image-first": "p-0 overflow-hidden"
|
|
3712
3712
|
};
|
|
3713
|
-
Card =
|
|
3713
|
+
Card = React86__default.forwardRef(
|
|
3714
3714
|
({
|
|
3715
3715
|
className,
|
|
3716
3716
|
variant = "bordered",
|
|
@@ -3759,9 +3759,9 @@ var init_Card = __esm({
|
|
|
3759
3759
|
}
|
|
3760
3760
|
);
|
|
3761
3761
|
Card.displayName = "Card";
|
|
3762
|
-
CardHeader =
|
|
3762
|
+
CardHeader = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3763
3763
|
CardHeader.displayName = "CardHeader";
|
|
3764
|
-
CardTitle =
|
|
3764
|
+
CardTitle = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3765
3765
|
"h3",
|
|
3766
3766
|
{
|
|
3767
3767
|
ref,
|
|
@@ -3774,11 +3774,11 @@ var init_Card = __esm({
|
|
|
3774
3774
|
}
|
|
3775
3775
|
));
|
|
3776
3776
|
CardTitle.displayName = "CardTitle";
|
|
3777
|
-
CardContent =
|
|
3777
|
+
CardContent = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3778
3778
|
CardContent.displayName = "CardContent";
|
|
3779
3779
|
CardBody = CardContent;
|
|
3780
3780
|
CardBody.displayName = "CardBody";
|
|
3781
|
-
CardFooter =
|
|
3781
|
+
CardFooter = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3782
3782
|
"div",
|
|
3783
3783
|
{
|
|
3784
3784
|
ref,
|
|
@@ -3865,7 +3865,7 @@ var init_FilterPill = __esm({
|
|
|
3865
3865
|
md: "w-3.5 h-3.5",
|
|
3866
3866
|
lg: "w-4 h-4"
|
|
3867
3867
|
};
|
|
3868
|
-
FilterPill =
|
|
3868
|
+
FilterPill = React86__default.forwardRef(
|
|
3869
3869
|
({
|
|
3870
3870
|
className,
|
|
3871
3871
|
variant = "default",
|
|
@@ -3994,8 +3994,8 @@ var init_Avatar = __esm({
|
|
|
3994
3994
|
actionPayload
|
|
3995
3995
|
}) => {
|
|
3996
3996
|
const eventBus = useEventBus();
|
|
3997
|
-
const [imgFailed, setImgFailed] =
|
|
3998
|
-
|
|
3997
|
+
const [imgFailed, setImgFailed] = React86__default.useState(false);
|
|
3998
|
+
React86__default.useEffect(() => {
|
|
3999
3999
|
setImgFailed(false);
|
|
4000
4000
|
}, [src]);
|
|
4001
4001
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4108,7 +4108,7 @@ var init_Center = __esm({
|
|
|
4108
4108
|
as: Component = "div"
|
|
4109
4109
|
}) => {
|
|
4110
4110
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4111
|
-
return
|
|
4111
|
+
return React86__default.createElement(Component, {
|
|
4112
4112
|
className: cn(
|
|
4113
4113
|
inline ? "inline-flex" : "flex",
|
|
4114
4114
|
horizontal && "justify-center",
|
|
@@ -4376,7 +4376,7 @@ var init_Radio = __esm({
|
|
|
4376
4376
|
md: "w-2.5 h-2.5",
|
|
4377
4377
|
lg: "w-3 h-3"
|
|
4378
4378
|
};
|
|
4379
|
-
Radio =
|
|
4379
|
+
Radio = React86__default.forwardRef(
|
|
4380
4380
|
({
|
|
4381
4381
|
label,
|
|
4382
4382
|
helperText,
|
|
@@ -4393,12 +4393,12 @@ var init_Radio = __esm({
|
|
|
4393
4393
|
onChange,
|
|
4394
4394
|
...props
|
|
4395
4395
|
}, ref) => {
|
|
4396
|
-
const reactId =
|
|
4396
|
+
const reactId = React86__default.useId();
|
|
4397
4397
|
const baseId = id || `radio-${reactId}`;
|
|
4398
4398
|
const hasError = !!error;
|
|
4399
4399
|
const eventBus = useEventBus();
|
|
4400
|
-
const [selected, setSelected] =
|
|
4401
|
-
|
|
4400
|
+
const [selected, setSelected] = React86__default.useState(value);
|
|
4401
|
+
React86__default.useEffect(() => {
|
|
4402
4402
|
if (value !== void 0) setSelected(value);
|
|
4403
4403
|
}, [value]);
|
|
4404
4404
|
const pick = (next, e) => {
|
|
@@ -4580,7 +4580,7 @@ var init_Switch = __esm({
|
|
|
4580
4580
|
"components/core/atoms/Switch.tsx"() {
|
|
4581
4581
|
"use client";
|
|
4582
4582
|
init_cn();
|
|
4583
|
-
Switch =
|
|
4583
|
+
Switch = React86.forwardRef(
|
|
4584
4584
|
({
|
|
4585
4585
|
checked,
|
|
4586
4586
|
defaultChecked = false,
|
|
@@ -4591,10 +4591,10 @@ var init_Switch = __esm({
|
|
|
4591
4591
|
name,
|
|
4592
4592
|
className
|
|
4593
4593
|
}, ref) => {
|
|
4594
|
-
const [isChecked, setIsChecked] =
|
|
4594
|
+
const [isChecked, setIsChecked] = React86.useState(
|
|
4595
4595
|
checked !== void 0 ? checked : defaultChecked
|
|
4596
4596
|
);
|
|
4597
|
-
|
|
4597
|
+
React86.useEffect(() => {
|
|
4598
4598
|
if (checked !== void 0) {
|
|
4599
4599
|
setIsChecked(checked);
|
|
4600
4600
|
}
|
|
@@ -4757,7 +4757,7 @@ var init_Stack = __esm({
|
|
|
4757
4757
|
};
|
|
4758
4758
|
const isHorizontal = direction === "horizontal";
|
|
4759
4759
|
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";
|
|
4760
|
-
return
|
|
4760
|
+
return React86__default.createElement(
|
|
4761
4761
|
Component,
|
|
4762
4762
|
{
|
|
4763
4763
|
className: cn(
|
|
@@ -4957,7 +4957,7 @@ var Aside;
|
|
|
4957
4957
|
var init_Aside = __esm({
|
|
4958
4958
|
"components/core/atoms/Aside.tsx"() {
|
|
4959
4959
|
init_cn();
|
|
4960
|
-
Aside =
|
|
4960
|
+
Aside = React86__default.forwardRef(
|
|
4961
4961
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
4962
4962
|
);
|
|
4963
4963
|
Aside.displayName = "Aside";
|
|
@@ -5036,9 +5036,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5036
5036
|
className
|
|
5037
5037
|
}) => {
|
|
5038
5038
|
const { t } = useTranslate();
|
|
5039
|
-
const [isVisible, setIsVisible] =
|
|
5040
|
-
const timeoutRef =
|
|
5041
|
-
const triggerRef =
|
|
5039
|
+
const [isVisible, setIsVisible] = React86__default.useState(false);
|
|
5040
|
+
const timeoutRef = React86__default.useRef(null);
|
|
5041
|
+
const triggerRef = React86__default.useRef(null);
|
|
5042
5042
|
const handleMouseEnter = () => {
|
|
5043
5043
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5044
5044
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5049,7 +5049,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5049
5049
|
};
|
|
5050
5050
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5051
5051
|
const open = isVisible || revealed;
|
|
5052
|
-
|
|
5052
|
+
React86__default.useEffect(() => {
|
|
5053
5053
|
return () => {
|
|
5054
5054
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5055
5055
|
};
|
|
@@ -5259,7 +5259,7 @@ var init_StatusDot = __esm({
|
|
|
5259
5259
|
md: "w-2.5 h-2.5",
|
|
5260
5260
|
lg: "w-3 h-3"
|
|
5261
5261
|
};
|
|
5262
|
-
StatusDot =
|
|
5262
|
+
StatusDot = React86__default.forwardRef(
|
|
5263
5263
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5264
5264
|
return /* @__PURE__ */ jsx(
|
|
5265
5265
|
"span",
|
|
@@ -5313,7 +5313,7 @@ var init_TrendIndicator = __esm({
|
|
|
5313
5313
|
down: "trending-down",
|
|
5314
5314
|
flat: "arrow-right"
|
|
5315
5315
|
};
|
|
5316
|
-
TrendIndicator =
|
|
5316
|
+
TrendIndicator = React86__default.forwardRef(
|
|
5317
5317
|
({
|
|
5318
5318
|
className,
|
|
5319
5319
|
value,
|
|
@@ -5382,7 +5382,7 @@ var init_RangeSlider = __esm({
|
|
|
5382
5382
|
md: "w-4 h-4",
|
|
5383
5383
|
lg: "w-5 h-5"
|
|
5384
5384
|
};
|
|
5385
|
-
RangeSlider =
|
|
5385
|
+
RangeSlider = React86__default.forwardRef(
|
|
5386
5386
|
({
|
|
5387
5387
|
className,
|
|
5388
5388
|
min = 0,
|
|
@@ -5993,7 +5993,7 @@ var init_ContentSection = __esm({
|
|
|
5993
5993
|
md: "py-16",
|
|
5994
5994
|
lg: "py-24"
|
|
5995
5995
|
};
|
|
5996
|
-
ContentSection =
|
|
5996
|
+
ContentSection = React86__default.forwardRef(
|
|
5997
5997
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
5998
5998
|
return /* @__PURE__ */ jsx(
|
|
5999
5999
|
Box,
|
|
@@ -6527,7 +6527,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6527
6527
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6528
6528
|
"none": {}
|
|
6529
6529
|
};
|
|
6530
|
-
AnimatedReveal =
|
|
6530
|
+
AnimatedReveal = React86__default.forwardRef(
|
|
6531
6531
|
({
|
|
6532
6532
|
trigger = "scroll",
|
|
6533
6533
|
animation = "fade-up",
|
|
@@ -6687,7 +6687,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6687
6687
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6688
6688
|
"use client";
|
|
6689
6689
|
init_cn();
|
|
6690
|
-
AnimatedGraphic =
|
|
6690
|
+
AnimatedGraphic = React86__default.forwardRef(
|
|
6691
6691
|
({
|
|
6692
6692
|
src,
|
|
6693
6693
|
svgContent,
|
|
@@ -6710,7 +6710,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6710
6710
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6711
6711
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6712
6712
|
const prevAnimateRef = useRef(animate);
|
|
6713
|
-
const setRef =
|
|
6713
|
+
const setRef = React86__default.useCallback(
|
|
6714
6714
|
(node) => {
|
|
6715
6715
|
containerRef.current = node;
|
|
6716
6716
|
if (typeof ref === "function") ref(node);
|
|
@@ -7438,9 +7438,9 @@ function ControlButton({
|
|
|
7438
7438
|
className
|
|
7439
7439
|
}) {
|
|
7440
7440
|
const eventBus = useEventBus();
|
|
7441
|
-
const [isPressed, setIsPressed] =
|
|
7441
|
+
const [isPressed, setIsPressed] = React86.useState(false);
|
|
7442
7442
|
const actualPressed = pressed ?? isPressed;
|
|
7443
|
-
const handlePointerDown =
|
|
7443
|
+
const handlePointerDown = React86.useCallback(
|
|
7444
7444
|
(e) => {
|
|
7445
7445
|
e.preventDefault();
|
|
7446
7446
|
if (disabled) return;
|
|
@@ -7450,7 +7450,7 @@ function ControlButton({
|
|
|
7450
7450
|
},
|
|
7451
7451
|
[disabled, pressEvent, eventBus, onPress]
|
|
7452
7452
|
);
|
|
7453
|
-
const handlePointerUp =
|
|
7453
|
+
const handlePointerUp = React86.useCallback(
|
|
7454
7454
|
(e) => {
|
|
7455
7455
|
e.preventDefault();
|
|
7456
7456
|
if (disabled) return;
|
|
@@ -7460,7 +7460,7 @@ function ControlButton({
|
|
|
7460
7460
|
},
|
|
7461
7461
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
7462
7462
|
);
|
|
7463
|
-
const handlePointerLeave =
|
|
7463
|
+
const handlePointerLeave = React86.useCallback(
|
|
7464
7464
|
(e) => {
|
|
7465
7465
|
if (isPressed) {
|
|
7466
7466
|
setIsPressed(false);
|
|
@@ -7718,8 +7718,8 @@ function ControlGrid({
|
|
|
7718
7718
|
className
|
|
7719
7719
|
}) {
|
|
7720
7720
|
const eventBus = useEventBus();
|
|
7721
|
-
const [active, setActive] =
|
|
7722
|
-
const handlePress =
|
|
7721
|
+
const [active, setActive] = React86.useState(/* @__PURE__ */ new Set());
|
|
7722
|
+
const handlePress = React86.useCallback(
|
|
7723
7723
|
(id) => {
|
|
7724
7724
|
setActive((prev) => new Set(prev).add(id));
|
|
7725
7725
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -7733,7 +7733,7 @@ function ControlGrid({
|
|
|
7733
7733
|
},
|
|
7734
7734
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
7735
7735
|
);
|
|
7736
|
-
const handleRelease =
|
|
7736
|
+
const handleRelease = React86.useCallback(
|
|
7737
7737
|
(id) => {
|
|
7738
7738
|
setActive((prev) => {
|
|
7739
7739
|
const next = new Set(prev);
|
|
@@ -8091,7 +8091,7 @@ function GameMenu({
|
|
|
8091
8091
|
}) {
|
|
8092
8092
|
const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
|
|
8093
8093
|
const eventBus = useEventBus();
|
|
8094
|
-
const handleOptionClick =
|
|
8094
|
+
const handleOptionClick = React86.useCallback(
|
|
8095
8095
|
(option) => {
|
|
8096
8096
|
if (option.event) {
|
|
8097
8097
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -8327,7 +8327,7 @@ function StateGraph({
|
|
|
8327
8327
|
}) {
|
|
8328
8328
|
const eventBus = useEventBus();
|
|
8329
8329
|
const nodes = states ?? [];
|
|
8330
|
-
const positions =
|
|
8330
|
+
const positions = React86.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
8331
8331
|
return /* @__PURE__ */ jsxs(
|
|
8332
8332
|
Box,
|
|
8333
8333
|
{
|
|
@@ -8398,8 +8398,8 @@ function MiniMap({
|
|
|
8398
8398
|
tileAssets,
|
|
8399
8399
|
unitAssets
|
|
8400
8400
|
}) {
|
|
8401
|
-
const canvasRef =
|
|
8402
|
-
const imgCacheRef =
|
|
8401
|
+
const canvasRef = React86.useRef(null);
|
|
8402
|
+
const imgCacheRef = React86.useRef(/* @__PURE__ */ new Map());
|
|
8403
8403
|
function loadImg(url) {
|
|
8404
8404
|
const cached = imgCacheRef.current.get(url);
|
|
8405
8405
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -8415,7 +8415,7 @@ function MiniMap({
|
|
|
8415
8415
|
imgCacheRef.current.set(url, img);
|
|
8416
8416
|
return null;
|
|
8417
8417
|
}
|
|
8418
|
-
|
|
8418
|
+
React86.useEffect(() => {
|
|
8419
8419
|
const canvas = canvasRef.current;
|
|
8420
8420
|
if (!canvas) return;
|
|
8421
8421
|
const ctx = canvas.getContext("2d");
|
|
@@ -8762,19 +8762,12 @@ var init_useCanvasGestures = __esm({
|
|
|
8762
8762
|
});
|
|
8763
8763
|
|
|
8764
8764
|
// lib/imageCache.ts
|
|
8765
|
-
function
|
|
8766
|
-
if (!url || typeof window === "undefined") return null;
|
|
8767
|
-
const existing = cache.get(url);
|
|
8768
|
-
if (existing) {
|
|
8769
|
-
if (existing.status === "loaded") return existing.img;
|
|
8770
|
-
if (existing.status === "pending" && onReady) existing.onReady = onReady;
|
|
8771
|
-
return null;
|
|
8772
|
-
}
|
|
8765
|
+
function startLoad(url, onReady, existing) {
|
|
8773
8766
|
const img = new Image();
|
|
8774
8767
|
img.crossOrigin = "anonymous";
|
|
8775
|
-
const entry = { img, status: "pending"
|
|
8776
|
-
|
|
8777
|
-
|
|
8768
|
+
const entry = existing ?? { img, status: "pending" };
|
|
8769
|
+
entry.img = img;
|
|
8770
|
+
if (onReady) entry.onReady = onReady;
|
|
8778
8771
|
img.onload = () => {
|
|
8779
8772
|
entry.status = "loaded";
|
|
8780
8773
|
updateAssetStatus(url, "loaded");
|
|
@@ -8782,20 +8775,39 @@ function getOrLoadImage(url, onReady) {
|
|
|
8782
8775
|
};
|
|
8783
8776
|
img.onerror = () => {
|
|
8784
8777
|
entry.status = "failed";
|
|
8778
|
+
entry.failedAt = Date.now();
|
|
8785
8779
|
updateAssetStatus(url, "failed");
|
|
8786
8780
|
entry.onReady?.();
|
|
8787
8781
|
};
|
|
8788
8782
|
img.src = url;
|
|
8783
|
+
return entry;
|
|
8784
|
+
}
|
|
8785
|
+
function getOrLoadImage(url, onReady) {
|
|
8786
|
+
if (!url || typeof window === "undefined") return null;
|
|
8787
|
+
const existing = cache.get(url);
|
|
8788
|
+
if (existing) {
|
|
8789
|
+
if (existing.status === "loaded") return existing.img;
|
|
8790
|
+
if (existing.status === "pending" && onReady) existing.onReady = onReady;
|
|
8791
|
+
if (existing.status === "failed" && Date.now() - (existing.failedAt ?? 0) >= RETRY_AFTER_MS) {
|
|
8792
|
+
existing.failedAt = Date.now();
|
|
8793
|
+
startLoad(url, onReady, existing);
|
|
8794
|
+
}
|
|
8795
|
+
return null;
|
|
8796
|
+
}
|
|
8797
|
+
const entry = startLoad(url, onReady);
|
|
8798
|
+
cache.set(url, entry);
|
|
8799
|
+
updateAssetStatus(url, "pending");
|
|
8789
8800
|
return null;
|
|
8790
8801
|
}
|
|
8791
8802
|
function getImageStatus(url) {
|
|
8792
8803
|
return cache.get(url)?.status;
|
|
8793
8804
|
}
|
|
8794
|
-
var cache;
|
|
8805
|
+
var RETRY_AFTER_MS, cache;
|
|
8795
8806
|
var init_imageCache = __esm({
|
|
8796
8807
|
"lib/imageCache.ts"() {
|
|
8797
8808
|
"use client";
|
|
8798
8809
|
init_verificationRegistry();
|
|
8810
|
+
RETRY_AFTER_MS = 5e3;
|
|
8799
8811
|
cache = /* @__PURE__ */ new Map();
|
|
8800
8812
|
}
|
|
8801
8813
|
});
|
|
@@ -8978,6 +8990,21 @@ var init_projector = __esm({
|
|
|
8978
8990
|
function isValidScenePos(pos) {
|
|
8979
8991
|
return Number.isFinite(pos?.x) && Number.isFinite(pos?.y);
|
|
8980
8992
|
}
|
|
8993
|
+
function spriteRect(projector, node, natural) {
|
|
8994
|
+
const tw = projector.tileWidth;
|
|
8995
|
+
const fallbackW = projector.worldPixelDirect ? natural?.w ?? 0 : tw;
|
|
8996
|
+
const fallbackH = projector.worldPixelDirect ? natural?.h ?? 0 : tw;
|
|
8997
|
+
const w = node.width !== void 0 ? node.width * tw : fallbackW;
|
|
8998
|
+
const h = node.height !== void 0 ? node.height * tw : fallbackH;
|
|
8999
|
+
const anchor = node.anchor ?? "top-left";
|
|
9000
|
+
const p = projector.anchorPoint(node.position, anchor);
|
|
9001
|
+
return {
|
|
9002
|
+
x: anchor === "top-left" ? p.x : p.x - w / 2,
|
|
9003
|
+
y: anchor === "ground" ? p.y - h : anchor === "center" ? p.y - h / 2 : p.y,
|
|
9004
|
+
w,
|
|
9005
|
+
h
|
|
9006
|
+
};
|
|
9007
|
+
}
|
|
8981
9008
|
var init_contract = __esm({
|
|
8982
9009
|
"lib/drawable/contract.ts"() {
|
|
8983
9010
|
}
|
|
@@ -8992,16 +9019,11 @@ function paintFallbackSquare(painter, node, dctx, reason) {
|
|
|
8992
9019
|
warnMissingOnce(reason, node);
|
|
8993
9020
|
const tw = dctx.projector.tileWidth;
|
|
8994
9021
|
const natural = dctx.projector.worldPixelDirect ? FALLBACK_WORLD_PX : tw;
|
|
8995
|
-
const
|
|
8996
|
-
const h = node.height !== void 0 ? node.height * tw : natural;
|
|
8997
|
-
const anchor = node.anchor ?? "top-left";
|
|
8998
|
-
const p = dctx.projector.anchorPoint(node.position, anchor);
|
|
8999
|
-
const dx = anchor === "top-left" ? p.x : p.x - w / 2;
|
|
9000
|
-
const dy = anchor === "ground" ? p.y - h : anchor === "center" ? p.y - h / 2 : p.y;
|
|
9022
|
+
const rect = spriteRect(dctx.projector, node, { w: natural, h: natural });
|
|
9001
9023
|
painter.save();
|
|
9002
9024
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
9003
|
-
painter.fillRect(
|
|
9004
|
-
painter.strokeRect(
|
|
9025
|
+
painter.fillRect(rect.x, rect.y, rect.w, rect.h, "#9b8f7f");
|
|
9026
|
+
painter.strokeRect(rect.x, rect.y, rect.w, rect.h, "#5e564b", Math.max(1, tw / 32));
|
|
9005
9027
|
painter.restore();
|
|
9006
9028
|
}
|
|
9007
9029
|
function DrawSprite(_props) {
|
|
@@ -9038,15 +9060,10 @@ var init_DrawSprite = __esm({
|
|
|
9038
9060
|
}
|
|
9039
9061
|
src = { x: r.sx, y: r.sy, w: r.sw, h: r.sh };
|
|
9040
9062
|
}
|
|
9041
|
-
const
|
|
9042
|
-
const
|
|
9043
|
-
const
|
|
9044
|
-
const
|
|
9045
|
-
const h = node.height !== void 0 ? node.height * tw : fallbackH;
|
|
9046
|
-
const anchor = node.anchor ?? "top-left";
|
|
9047
|
-
const p = dctx.projector.anchorPoint(node.position, anchor);
|
|
9048
|
-
const dx = anchor === "top-left" ? p.x : p.x - w / 2;
|
|
9049
|
-
const dy = anchor === "ground" ? p.y - h : anchor === "center" ? p.y - h / 2 : p.y;
|
|
9063
|
+
const rect = spriteRect(dctx.projector, node, src ? { w: src.w, h: src.h } : { w: tex.width, h: tex.height });
|
|
9064
|
+
const { w, h } = rect;
|
|
9065
|
+
const dx = rect.x;
|
|
9066
|
+
const dy = rect.y;
|
|
9050
9067
|
painter.save();
|
|
9051
9068
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
9052
9069
|
if (node.shadow) painter.setShadow(node.shadow);
|
|
@@ -9068,9 +9085,24 @@ var init_DrawSprite = __esm({
|
|
|
9068
9085
|
};
|
|
9069
9086
|
}
|
|
9070
9087
|
});
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9088
|
+
var DrawableRegistryContext;
|
|
9089
|
+
var init_registry = __esm({
|
|
9090
|
+
"lib/drawable/registry.ts"() {
|
|
9091
|
+
DrawableRegistryContext = createContext(null);
|
|
9092
|
+
}
|
|
9093
|
+
});
|
|
9094
|
+
function DrawShape(props) {
|
|
9095
|
+
const register = useContext(DrawableRegistryContext);
|
|
9096
|
+
if (register) {
|
|
9097
|
+
const { opacity, ...rest } = props;
|
|
9098
|
+
const node = {
|
|
9099
|
+
...rest,
|
|
9100
|
+
type: "draw-shape",
|
|
9101
|
+
...opacity !== void 0 && opacity > 0 ? { opacity } : {}
|
|
9102
|
+
};
|
|
9103
|
+
register(node);
|
|
9104
|
+
return /* @__PURE__ */ jsx("div", { "data-draw-shape-debug": "", style: { position: "absolute", width: 4, height: 4, background: "red", zIndex: 9999 } });
|
|
9105
|
+
}
|
|
9074
9106
|
return null;
|
|
9075
9107
|
}
|
|
9076
9108
|
var paintShape;
|
|
@@ -9078,6 +9110,7 @@ var init_DrawShape = __esm({
|
|
|
9078
9110
|
"components/game/atoms/DrawShape.tsx"() {
|
|
9079
9111
|
"use client";
|
|
9080
9112
|
init_contract();
|
|
9113
|
+
init_registry();
|
|
9081
9114
|
paintShape = (painter, node, dctx) => {
|
|
9082
9115
|
if (!isValidScenePos(node.position)) return;
|
|
9083
9116
|
painter.save();
|
|
@@ -9262,12 +9295,18 @@ function collectDrawnItems(nodes) {
|
|
|
9262
9295
|
for (const n of nodes) {
|
|
9263
9296
|
switch (n.type) {
|
|
9264
9297
|
case "draw-sprite":
|
|
9298
|
+
if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id, anchor: n.anchor, width: n.width, height: n.height });
|
|
9299
|
+
break;
|
|
9265
9300
|
case "draw-shape":
|
|
9266
9301
|
case "draw-text":
|
|
9267
9302
|
case "draw-group":
|
|
9268
9303
|
if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id });
|
|
9269
9304
|
break;
|
|
9270
9305
|
case "draw-sprite-layer":
|
|
9306
|
+
for (const it of n.items) {
|
|
9307
|
+
if (isValidScenePos(it.position)) out.push({ pos: it.position, id: it.id, anchor: it.anchor, width: it.width, height: it.height });
|
|
9308
|
+
}
|
|
9309
|
+
break;
|
|
9271
9310
|
case "draw-shape-layer":
|
|
9272
9311
|
case "draw-text-layer":
|
|
9273
9312
|
for (const it of n.items) {
|
|
@@ -9285,6 +9324,15 @@ function buildHitIndex(items) {
|
|
|
9285
9324
|
}
|
|
9286
9325
|
return m;
|
|
9287
9326
|
}
|
|
9327
|
+
function hitTestSprites(items, projector, point) {
|
|
9328
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
9329
|
+
const it = items[i];
|
|
9330
|
+
if (it.id === void 0) continue;
|
|
9331
|
+
const r = spriteRect(projector, { position: it.pos, anchor: it.anchor, width: it.width, height: it.height });
|
|
9332
|
+
if (point.x >= r.x && point.x <= r.x + r.w && point.y >= r.y && point.y <= r.y + r.h) return it.id;
|
|
9333
|
+
}
|
|
9334
|
+
return void 0;
|
|
9335
|
+
}
|
|
9288
9336
|
var init_hitTest = __esm({
|
|
9289
9337
|
"lib/drawable/hitTest.ts"() {
|
|
9290
9338
|
init_contract();
|
|
@@ -9313,9 +9361,17 @@ function Canvas2D({
|
|
|
9313
9361
|
showMinimap = true,
|
|
9314
9362
|
followTarget,
|
|
9315
9363
|
cameraPos,
|
|
9316
|
-
bgColor
|
|
9364
|
+
bgColor,
|
|
9365
|
+
children
|
|
9317
9366
|
}) {
|
|
9318
9367
|
const instanceId = useMemo(() => Math.random().toString(36).slice(2, 8), []);
|
|
9368
|
+
const childDrawablesRef = useRef([]);
|
|
9369
|
+
childDrawablesRef.current = [];
|
|
9370
|
+
const registerChildDrawable = useCallback((node) => {
|
|
9371
|
+
childDrawablesRef.current.push(node);
|
|
9372
|
+
}, []);
|
|
9373
|
+
const hasJsxChildren = React86.Children.count(children) > 0;
|
|
9374
|
+
drawables && drawables.length > 0 ? drawables : childDrawablesRef.current;
|
|
9319
9375
|
function isDrawableLayer(node) {
|
|
9320
9376
|
return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
|
|
9321
9377
|
}
|
|
@@ -9498,7 +9554,19 @@ function Canvas2D({
|
|
|
9498
9554
|
ctx.fillStyle = bgColor ?? BACKGROUND_FALLBACK_COLOR;
|
|
9499
9555
|
ctx.fillRect(0, 0, viewportSize.width, viewportSize.height);
|
|
9500
9556
|
}
|
|
9501
|
-
if (!drawables || drawables.length === 0)
|
|
9557
|
+
if (!drawables || drawables.length === 0) {
|
|
9558
|
+
const childDrawables = childDrawablesRef.current;
|
|
9559
|
+
if (childDrawables.length === 0) return;
|
|
9560
|
+
const painter0 = createWebPainter(ctx, bumpAtlas);
|
|
9561
|
+
painter0.save();
|
|
9562
|
+
painter0.translate(viewportSize.width / 2, viewportSize.height / 2);
|
|
9563
|
+
painter0.scale(cameraRef.current.zoom, cameraRef.current.zoom);
|
|
9564
|
+
painter0.translate(-viewportSize.width / 2, -viewportSize.height / 2);
|
|
9565
|
+
const dctx0 = { projector, time: 0, invalidate: bumpAtlas };
|
|
9566
|
+
for (const node of childDrawables) paintDrawable(painter0, node, dctx0);
|
|
9567
|
+
painter0.restore();
|
|
9568
|
+
return;
|
|
9569
|
+
}
|
|
9502
9570
|
const cam = cameraRef.current;
|
|
9503
9571
|
if (camera !== "follow" && dragDistance() === 0) {
|
|
9504
9572
|
const focus = cameraPos ?? defaultGridFocus;
|
|
@@ -9582,6 +9650,11 @@ function Canvas2D({
|
|
|
9582
9650
|
if (dragDistance() > 5) return;
|
|
9583
9651
|
if (!canvasRef.current || !tileClickEvent && !unitClickEvent) return;
|
|
9584
9652
|
const world = screenToWorld(e.clientX, e.clientY, canvasRef.current, viewportSize);
|
|
9653
|
+
const spriteHit = unitClickEvent ? hitTestSprites(drawnItems, projector, world) : void 0;
|
|
9654
|
+
if (spriteHit !== void 0 && unitClickEvent) {
|
|
9655
|
+
eventBus.emit(`UI:${unitClickEvent}`, { unitId: spriteHit });
|
|
9656
|
+
return;
|
|
9657
|
+
}
|
|
9585
9658
|
const adjustedX = world.x - scaledTileWidth / 2;
|
|
9586
9659
|
const adjustedY = squareGrid ? world.y - scaledTileWidth / 2 : world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
9587
9660
|
const isoPos = unproject(adjustedX, adjustedY);
|
|
@@ -9591,7 +9664,7 @@ function Canvas2D({
|
|
|
9591
9664
|
} else if (tileClickEvent) {
|
|
9592
9665
|
eventBus.emit(`UI:${tileClickEvent}`, { x: isoPos.x, y: isoPos.y });
|
|
9593
9666
|
}
|
|
9594
|
-
}, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, hitIndex, tileClickEvent, unitClickEvent, eventBus]);
|
|
9667
|
+
}, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, hitIndex, drawnItems, projector, tileClickEvent, unitClickEvent, eventBus]);
|
|
9595
9668
|
const handleCanvasPointerLeave = useCallback(() => {
|
|
9596
9669
|
handleMouseLeave();
|
|
9597
9670
|
if (tileLeaveEvent) eventBus.emit(`UI:${tileLeaveEvent}`, {});
|
|
@@ -9661,7 +9734,7 @@ function Canvas2D({
|
|
|
9661
9734
|
/* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-muted-foreground", children: t("canvas.loadingMessage") || "Loading\u2026" })
|
|
9662
9735
|
] }) });
|
|
9663
9736
|
}
|
|
9664
|
-
if (!drawables || drawables.length === 0) {
|
|
9737
|
+
if ((!drawables || drawables.length === 0) && !hasJsxChildren) {
|
|
9665
9738
|
return /* @__PURE__ */ jsx(
|
|
9666
9739
|
Box,
|
|
9667
9740
|
{
|
|
@@ -9675,7 +9748,7 @@ function Canvas2D({
|
|
|
9675
9748
|
}
|
|
9676
9749
|
);
|
|
9677
9750
|
}
|
|
9678
|
-
return /* @__PURE__ */ jsxs(
|
|
9751
|
+
return /* @__PURE__ */ jsx(DrawableRegistryContext.Provider, { value: registerChildDrawable, children: /* @__PURE__ */ jsxs(
|
|
9679
9752
|
Box,
|
|
9680
9753
|
{
|
|
9681
9754
|
ref: containerRef,
|
|
@@ -9736,10 +9809,19 @@ function Canvas2D({
|
|
|
9736
9809
|
mapWidth: miniMapWidth,
|
|
9737
9810
|
mapHeight: miniMapHeight
|
|
9738
9811
|
}
|
|
9739
|
-
) })
|
|
9812
|
+
) }),
|
|
9813
|
+
hasJsxChildren && /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children }),
|
|
9814
|
+
/* @__PURE__ */ jsxs("div", { "data-debug": "", style: { position: "absolute", top: 0, left: 0, background: "yellow", color: "black", zIndex: 9999, fontSize: 24, padding: 8 }, children: [
|
|
9815
|
+
"C=",
|
|
9816
|
+
React86.Children.count(children),
|
|
9817
|
+
" J=",
|
|
9818
|
+
String(hasJsxChildren),
|
|
9819
|
+
" D=",
|
|
9820
|
+
drawables?.length ?? -1
|
|
9821
|
+
] })
|
|
9740
9822
|
]
|
|
9741
9823
|
}
|
|
9742
|
-
);
|
|
9824
|
+
) });
|
|
9743
9825
|
}
|
|
9744
9826
|
var canvas2DLog;
|
|
9745
9827
|
var init_Canvas2D = __esm({
|
|
@@ -9761,6 +9843,7 @@ var init_Canvas2D = __esm({
|
|
|
9761
9843
|
init_webPainter2d();
|
|
9762
9844
|
init_projector();
|
|
9763
9845
|
init_paintDispatch();
|
|
9846
|
+
init_registry();
|
|
9764
9847
|
init_hitTest();
|
|
9765
9848
|
init_isometric();
|
|
9766
9849
|
canvas2DLog = createLogger("almadar:ui:game-canvas");
|
|
@@ -9802,7 +9885,8 @@ function Canvas({
|
|
|
9802
9885
|
tileLeaveEvent,
|
|
9803
9886
|
featureClickEvent,
|
|
9804
9887
|
keyMap,
|
|
9805
|
-
keyUpMap
|
|
9888
|
+
keyUpMap,
|
|
9889
|
+
children
|
|
9806
9890
|
}) {
|
|
9807
9891
|
canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
|
|
9808
9892
|
const zoom = camera?.zoom;
|
|
@@ -9855,7 +9939,8 @@ function Canvas({
|
|
|
9855
9939
|
tileHoverEvent,
|
|
9856
9940
|
tileLeaveEvent,
|
|
9857
9941
|
keyMap,
|
|
9858
|
-
keyUpMap
|
|
9942
|
+
keyUpMap,
|
|
9943
|
+
...children !== void 0 ? { children } : {}
|
|
9859
9944
|
}
|
|
9860
9945
|
);
|
|
9861
9946
|
}
|
|
@@ -10254,7 +10339,7 @@ function LinearView({
|
|
|
10254
10339
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
10255
10340
|
const isDone = i < currentIdx;
|
|
10256
10341
|
const isCurrent = i === currentIdx;
|
|
10257
|
-
return /* @__PURE__ */ jsxs(
|
|
10342
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
10258
10343
|
i > 0 && /* @__PURE__ */ jsx(
|
|
10259
10344
|
Typography,
|
|
10260
10345
|
{
|
|
@@ -10789,7 +10874,7 @@ function SequenceBar({
|
|
|
10789
10874
|
else onSlotRemove?.(index);
|
|
10790
10875
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
10791
10876
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
10792
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
10877
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
10793
10878
|
i > 0 && /* @__PURE__ */ jsx(
|
|
10794
10879
|
Typography,
|
|
10795
10880
|
{
|
|
@@ -11438,7 +11523,7 @@ var init_ErrorBoundary = __esm({
|
|
|
11438
11523
|
}
|
|
11439
11524
|
);
|
|
11440
11525
|
};
|
|
11441
|
-
ErrorBoundary = class extends
|
|
11526
|
+
ErrorBoundary = class extends React86__default.Component {
|
|
11442
11527
|
constructor(props) {
|
|
11443
11528
|
super(props);
|
|
11444
11529
|
__publicField(this, "reset", () => {
|
|
@@ -12090,7 +12175,7 @@ var init_Container = __esm({
|
|
|
12090
12175
|
as: Component = "div"
|
|
12091
12176
|
}) => {
|
|
12092
12177
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
12093
|
-
return
|
|
12178
|
+
return React86__default.createElement(
|
|
12094
12179
|
Component,
|
|
12095
12180
|
{
|
|
12096
12181
|
className: cn(
|
|
@@ -15055,7 +15140,7 @@ var init_CodeBlock = __esm({
|
|
|
15055
15140
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
15056
15141
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
15057
15142
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
15058
|
-
CodeBlock =
|
|
15143
|
+
CodeBlock = React86__default.memo(
|
|
15059
15144
|
({
|
|
15060
15145
|
code: rawCode,
|
|
15061
15146
|
language = "text",
|
|
@@ -15643,7 +15728,7 @@ var init_MarkdownContent = __esm({
|
|
|
15643
15728
|
init_Box();
|
|
15644
15729
|
init_CodeBlock();
|
|
15645
15730
|
init_cn();
|
|
15646
|
-
MarkdownContent =
|
|
15731
|
+
MarkdownContent = React86__default.memo(
|
|
15647
15732
|
({ content, direction = "ltr", className }) => {
|
|
15648
15733
|
const { t: _t } = useTranslate();
|
|
15649
15734
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -16970,7 +17055,7 @@ var init_StateMachineView = __esm({
|
|
|
16970
17055
|
style: { top: title ? 30 : 0 },
|
|
16971
17056
|
children: [
|
|
16972
17057
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
16973
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
17058
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React86__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
16974
17059
|
StateNode2,
|
|
16975
17060
|
{
|
|
16976
17061
|
state,
|
|
@@ -22792,8 +22877,8 @@ var init_Menu = __esm({
|
|
|
22792
22877
|
"bottom-end": "bottom-start"
|
|
22793
22878
|
};
|
|
22794
22879
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
22795
|
-
const triggerChild =
|
|
22796
|
-
const triggerElement =
|
|
22880
|
+
const triggerChild = React86__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
22881
|
+
const triggerElement = React86__default.cloneElement(
|
|
22797
22882
|
triggerChild,
|
|
22798
22883
|
{
|
|
22799
22884
|
ref: triggerRef,
|
|
@@ -22888,14 +22973,14 @@ function useDataDnd(args) {
|
|
|
22888
22973
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
22889
22974
|
const enabled = isZone || Boolean(dndRoot);
|
|
22890
22975
|
const eventBus = useEventBus();
|
|
22891
|
-
const parentRoot =
|
|
22976
|
+
const parentRoot = React86__default.useContext(RootCtx);
|
|
22892
22977
|
const isRoot = enabled && parentRoot === null;
|
|
22893
|
-
const zoneId =
|
|
22978
|
+
const zoneId = React86__default.useId();
|
|
22894
22979
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
22895
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
22896
|
-
const optimisticOrdersRef =
|
|
22980
|
+
const [optimisticOrders, setOptimisticOrders] = React86__default.useState(() => /* @__PURE__ */ new Map());
|
|
22981
|
+
const optimisticOrdersRef = React86__default.useRef(optimisticOrders);
|
|
22897
22982
|
optimisticOrdersRef.current = optimisticOrders;
|
|
22898
|
-
const clearOptimisticOrder =
|
|
22983
|
+
const clearOptimisticOrder = React86__default.useCallback((group) => {
|
|
22899
22984
|
setOptimisticOrders((prev) => {
|
|
22900
22985
|
if (!prev.has(group)) return prev;
|
|
22901
22986
|
const next = new Map(prev);
|
|
@@ -22920,7 +23005,7 @@ function useDataDnd(args) {
|
|
|
22920
23005
|
const raw = it[dndItemIdField];
|
|
22921
23006
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
22922
23007
|
}).join("|");
|
|
22923
|
-
const itemIds =
|
|
23008
|
+
const itemIds = React86__default.useMemo(
|
|
22924
23009
|
() => orderedItems.map((it, idx) => {
|
|
22925
23010
|
const raw = it[dndItemIdField];
|
|
22926
23011
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -22931,7 +23016,7 @@ function useDataDnd(args) {
|
|
|
22931
23016
|
const raw = it[dndItemIdField];
|
|
22932
23017
|
return raw != null ? String(raw) : `__${idx}`;
|
|
22933
23018
|
}).join("|");
|
|
22934
|
-
|
|
23019
|
+
React86__default.useEffect(() => {
|
|
22935
23020
|
const root = isRoot ? null : parentRoot;
|
|
22936
23021
|
if (root) {
|
|
22937
23022
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -22939,20 +23024,20 @@ function useDataDnd(args) {
|
|
|
22939
23024
|
clearOptimisticOrder(ownGroup);
|
|
22940
23025
|
}
|
|
22941
23026
|
}, [itemsContentSig, ownGroup]);
|
|
22942
|
-
const zonesRef =
|
|
22943
|
-
const registerZone =
|
|
23027
|
+
const zonesRef = React86__default.useRef(/* @__PURE__ */ new Map());
|
|
23028
|
+
const registerZone = React86__default.useCallback((zoneId2, meta2) => {
|
|
22944
23029
|
zonesRef.current.set(zoneId2, meta2);
|
|
22945
23030
|
}, []);
|
|
22946
|
-
const unregisterZone =
|
|
23031
|
+
const unregisterZone = React86__default.useCallback((zoneId2) => {
|
|
22947
23032
|
zonesRef.current.delete(zoneId2);
|
|
22948
23033
|
}, []);
|
|
22949
|
-
const [activeDrag, setActiveDrag] =
|
|
22950
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
22951
|
-
const meta =
|
|
23034
|
+
const [activeDrag, setActiveDrag] = React86__default.useState(null);
|
|
23035
|
+
const [overZoneGroup, setOverZoneGroup] = React86__default.useState(null);
|
|
23036
|
+
const meta = React86__default.useMemo(
|
|
22952
23037
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
22953
23038
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
22954
23039
|
);
|
|
22955
|
-
|
|
23040
|
+
React86__default.useEffect(() => {
|
|
22956
23041
|
const target = isRoot ? null : parentRoot;
|
|
22957
23042
|
if (!target) {
|
|
22958
23043
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -22971,7 +23056,7 @@ function useDataDnd(args) {
|
|
|
22971
23056
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
22972
23057
|
const sensors = useAlmadarDndSensors(true);
|
|
22973
23058
|
const collisionDetection = almadarDndCollisionDetection;
|
|
22974
|
-
const findZoneByItem =
|
|
23059
|
+
const findZoneByItem = React86__default.useCallback(
|
|
22975
23060
|
(id) => {
|
|
22976
23061
|
for (const z of zonesRef.current.values()) {
|
|
22977
23062
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -22980,7 +23065,7 @@ function useDataDnd(args) {
|
|
|
22980
23065
|
},
|
|
22981
23066
|
[]
|
|
22982
23067
|
);
|
|
22983
|
-
|
|
23068
|
+
React86__default.useCallback(
|
|
22984
23069
|
(group) => {
|
|
22985
23070
|
for (const z of zonesRef.current.values()) {
|
|
22986
23071
|
if (z.group === group) return z;
|
|
@@ -22989,7 +23074,7 @@ function useDataDnd(args) {
|
|
|
22989
23074
|
},
|
|
22990
23075
|
[]
|
|
22991
23076
|
);
|
|
22992
|
-
const handleDragEnd =
|
|
23077
|
+
const handleDragEnd = React86__default.useCallback(
|
|
22993
23078
|
(event) => {
|
|
22994
23079
|
const { active, over } = event;
|
|
22995
23080
|
const activeIdStr = String(active.id);
|
|
@@ -23080,8 +23165,8 @@ function useDataDnd(args) {
|
|
|
23080
23165
|
},
|
|
23081
23166
|
[eventBus]
|
|
23082
23167
|
);
|
|
23083
|
-
const sortableData =
|
|
23084
|
-
const SortableItem =
|
|
23168
|
+
const sortableData = React86__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
23169
|
+
const SortableItem = React86__default.useCallback(
|
|
23085
23170
|
({ id, children }) => {
|
|
23086
23171
|
const {
|
|
23087
23172
|
attributes,
|
|
@@ -23121,7 +23206,7 @@ function useDataDnd(args) {
|
|
|
23121
23206
|
id: droppableId,
|
|
23122
23207
|
data: sortableData
|
|
23123
23208
|
});
|
|
23124
|
-
const ctx =
|
|
23209
|
+
const ctx = React86__default.useContext(RootCtx);
|
|
23125
23210
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
23126
23211
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
23127
23212
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -23136,7 +23221,7 @@ function useDataDnd(args) {
|
|
|
23136
23221
|
showForeignPlaceholder,
|
|
23137
23222
|
ctxAvailable: ctx != null
|
|
23138
23223
|
});
|
|
23139
|
-
|
|
23224
|
+
React86__default.useEffect(() => {
|
|
23140
23225
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
23141
23226
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
23142
23227
|
return /* @__PURE__ */ jsx(
|
|
@@ -23150,11 +23235,11 @@ function useDataDnd(args) {
|
|
|
23150
23235
|
}
|
|
23151
23236
|
);
|
|
23152
23237
|
};
|
|
23153
|
-
const rootContextValue =
|
|
23238
|
+
const rootContextValue = React86__default.useMemo(
|
|
23154
23239
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
23155
23240
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
23156
23241
|
);
|
|
23157
|
-
const handleDragStart =
|
|
23242
|
+
const handleDragStart = React86__default.useCallback((event) => {
|
|
23158
23243
|
const sourceZone = findZoneByItem(event.active.id);
|
|
23159
23244
|
const rect = event.active.rect.current.initial;
|
|
23160
23245
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -23173,7 +23258,7 @@ function useDataDnd(args) {
|
|
|
23173
23258
|
isRoot
|
|
23174
23259
|
});
|
|
23175
23260
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
23176
|
-
const handleDragOver =
|
|
23261
|
+
const handleDragOver = React86__default.useCallback((event) => {
|
|
23177
23262
|
const { active, over } = event;
|
|
23178
23263
|
const overData = over?.data?.current;
|
|
23179
23264
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -23243,7 +23328,7 @@ function useDataDnd(args) {
|
|
|
23243
23328
|
return next;
|
|
23244
23329
|
});
|
|
23245
23330
|
}, []);
|
|
23246
|
-
const handleDragCancel =
|
|
23331
|
+
const handleDragCancel = React86__default.useCallback((event) => {
|
|
23247
23332
|
setActiveDrag(null);
|
|
23248
23333
|
setOverZoneGroup(null);
|
|
23249
23334
|
dndLog.warn("dragCancel", {
|
|
@@ -23251,12 +23336,12 @@ function useDataDnd(args) {
|
|
|
23251
23336
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
23252
23337
|
});
|
|
23253
23338
|
}, []);
|
|
23254
|
-
const handleDragEndWithCleanup =
|
|
23339
|
+
const handleDragEndWithCleanup = React86__default.useCallback((event) => {
|
|
23255
23340
|
handleDragEnd(event);
|
|
23256
23341
|
setActiveDrag(null);
|
|
23257
23342
|
setOverZoneGroup(null);
|
|
23258
23343
|
}, [handleDragEnd]);
|
|
23259
|
-
const wrapContainer =
|
|
23344
|
+
const wrapContainer = React86__default.useCallback(
|
|
23260
23345
|
(children) => {
|
|
23261
23346
|
if (!enabled) return children;
|
|
23262
23347
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -23310,7 +23395,7 @@ var init_useDataDnd = __esm({
|
|
|
23310
23395
|
init_useAlmadarDndCollision();
|
|
23311
23396
|
init_Box();
|
|
23312
23397
|
dndLog = createLogger("almadar:ui:dnd");
|
|
23313
|
-
RootCtx =
|
|
23398
|
+
RootCtx = React86__default.createContext(null);
|
|
23314
23399
|
}
|
|
23315
23400
|
});
|
|
23316
23401
|
function renderIconInput(icon, props) {
|
|
@@ -23852,7 +23937,7 @@ function DataList({
|
|
|
23852
23937
|
}) {
|
|
23853
23938
|
const eventBus = useEventBus();
|
|
23854
23939
|
const { t } = useTranslate();
|
|
23855
|
-
const [visibleCount, setVisibleCount] =
|
|
23940
|
+
const [visibleCount, setVisibleCount] = React86__default.useState(pageSize || Infinity);
|
|
23856
23941
|
const fieldDefs = fields ?? columns ?? [];
|
|
23857
23942
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
23858
23943
|
const dnd = useDataDnd({
|
|
@@ -23868,14 +23953,14 @@ function DataList({
|
|
|
23868
23953
|
dndRoot
|
|
23869
23954
|
});
|
|
23870
23955
|
const orderedData = dnd.orderedItems;
|
|
23871
|
-
const allData =
|
|
23956
|
+
const allData = React86__default.useMemo(
|
|
23872
23957
|
() => sortRows(orderedData, sortBy, sortDirection),
|
|
23873
23958
|
[orderedData, sortBy, sortDirection]
|
|
23874
23959
|
);
|
|
23875
23960
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
23876
23961
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
23877
23962
|
const hasRenderProp = typeof children === "function";
|
|
23878
|
-
|
|
23963
|
+
React86__default.useEffect(() => {
|
|
23879
23964
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
23880
23965
|
const childrenTypeOf = typeof children;
|
|
23881
23966
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -23990,7 +24075,7 @@ function DataList({
|
|
|
23990
24075
|
return v === void 0 || v === null || v === "" ? raw : String(v);
|
|
23991
24076
|
};
|
|
23992
24077
|
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
|
|
23993
|
-
groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
24078
|
+
groups2.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
23994
24079
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
23995
24080
|
group.items.map((itemData, index) => {
|
|
23996
24081
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -24189,7 +24274,7 @@ function DataList({
|
|
|
24189
24274
|
className
|
|
24190
24275
|
),
|
|
24191
24276
|
children: [
|
|
24192
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
24277
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
24193
24278
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
24194
24279
|
group.items.map(
|
|
24195
24280
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -24276,7 +24361,7 @@ var init_FormSection = __esm({
|
|
|
24276
24361
|
columns = 1,
|
|
24277
24362
|
className
|
|
24278
24363
|
}) => {
|
|
24279
|
-
const [collapsed, setCollapsed] =
|
|
24364
|
+
const [collapsed, setCollapsed] = React86__default.useState(defaultCollapsed);
|
|
24280
24365
|
const { t } = useTranslate();
|
|
24281
24366
|
const eventBus = useEventBus();
|
|
24282
24367
|
const gridClass = {
|
|
@@ -24284,7 +24369,7 @@ var init_FormSection = __esm({
|
|
|
24284
24369
|
2: "grid-cols-1 md:grid-cols-2",
|
|
24285
24370
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
24286
24371
|
}[columns];
|
|
24287
|
-
|
|
24372
|
+
React86__default.useCallback(() => {
|
|
24288
24373
|
if (collapsible) {
|
|
24289
24374
|
setCollapsed((prev) => !prev);
|
|
24290
24375
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -25329,7 +25414,7 @@ var init_Flex = __esm({
|
|
|
25329
25414
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
25330
25415
|
}
|
|
25331
25416
|
}
|
|
25332
|
-
return
|
|
25417
|
+
return React86__default.createElement(Component, {
|
|
25333
25418
|
className: cn(
|
|
25334
25419
|
inline ? "inline-flex" : "flex",
|
|
25335
25420
|
directionStyles[direction],
|
|
@@ -25448,7 +25533,7 @@ var init_Grid = __esm({
|
|
|
25448
25533
|
as: Component = "div"
|
|
25449
25534
|
}) => {
|
|
25450
25535
|
const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
|
|
25451
|
-
return
|
|
25536
|
+
return React86__default.createElement(
|
|
25452
25537
|
Component,
|
|
25453
25538
|
{
|
|
25454
25539
|
className: cn(
|
|
@@ -25680,9 +25765,9 @@ var init_Popover = __esm({
|
|
|
25680
25765
|
onMouseLeave: handleClose,
|
|
25681
25766
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
25682
25767
|
};
|
|
25683
|
-
const childElement =
|
|
25768
|
+
const childElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
25684
25769
|
const childPointerDown = childElement.props.onPointerDown;
|
|
25685
|
-
const triggerElement =
|
|
25770
|
+
const triggerElement = React86__default.cloneElement(
|
|
25686
25771
|
childElement,
|
|
25687
25772
|
{
|
|
25688
25773
|
ref: triggerRef,
|
|
@@ -26291,9 +26376,9 @@ var init_Tooltip = __esm({
|
|
|
26291
26376
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
26292
26377
|
};
|
|
26293
26378
|
}, []);
|
|
26294
|
-
const triggerElement =
|
|
26379
|
+
const triggerElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
26295
26380
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
26296
|
-
const trigger =
|
|
26381
|
+
const trigger = React86__default.cloneElement(triggerElement, {
|
|
26297
26382
|
ref: triggerRef,
|
|
26298
26383
|
onMouseEnter: handleMouseEnter,
|
|
26299
26384
|
onMouseLeave: handleMouseLeave,
|
|
@@ -26383,7 +26468,7 @@ var init_WizardProgress = __esm({
|
|
|
26383
26468
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
26384
26469
|
const isActive = index === currentStep;
|
|
26385
26470
|
const isCompleted = index < currentStep;
|
|
26386
|
-
return /* @__PURE__ */ jsxs(
|
|
26471
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
26387
26472
|
/* @__PURE__ */ jsx(
|
|
26388
26473
|
"button",
|
|
26389
26474
|
{
|
|
@@ -28018,7 +28103,7 @@ var init_MapView = __esm({
|
|
|
28018
28103
|
shadowSize: [41, 41]
|
|
28019
28104
|
});
|
|
28020
28105
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
28021
|
-
const { useEffect: useEffect62, useRef: useRef61, useCallback: useCallback95, useState: useState93 } =
|
|
28106
|
+
const { useEffect: useEffect62, useRef: useRef61, useCallback: useCallback95, useState: useState93 } = React86__default;
|
|
28022
28107
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
28023
28108
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
28024
28109
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -28936,8 +29021,8 @@ function TableView({
|
|
|
28936
29021
|
}) {
|
|
28937
29022
|
const eventBus = useEventBus();
|
|
28938
29023
|
const { t } = useTranslate();
|
|
28939
|
-
const [visibleCount, setVisibleCount] =
|
|
28940
|
-
const [localSelected, setLocalSelected] =
|
|
29024
|
+
const [visibleCount, setVisibleCount] = React86__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
29025
|
+
const [localSelected, setLocalSelected] = React86__default.useState(/* @__PURE__ */ new Set());
|
|
28941
29026
|
const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
|
|
28942
29027
|
const actionDefs = Array.isArray(itemActions) ? itemActions : [];
|
|
28943
29028
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
@@ -28959,7 +29044,7 @@ function TableView({
|
|
|
28959
29044
|
const hasRenderProp = typeof children === "function";
|
|
28960
29045
|
const idField = dndItemIdField ?? "id";
|
|
28961
29046
|
const isCoarsePointer = useMediaQuery("(pointer: coarse)");
|
|
28962
|
-
|
|
29047
|
+
React86__default.useEffect(() => {
|
|
28963
29048
|
tableViewLog.debug("render", {
|
|
28964
29049
|
rowCount: data.length,
|
|
28965
29050
|
colCount: colDefs.length,
|
|
@@ -29016,7 +29101,7 @@ function TableView({
|
|
|
29016
29101
|
};
|
|
29017
29102
|
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
29018
29103
|
};
|
|
29019
|
-
const colFloors =
|
|
29104
|
+
const colFloors = React86__default.useMemo(
|
|
29020
29105
|
() => colDefs.map((col) => {
|
|
29021
29106
|
const longest = data.reduce((widest, row) => {
|
|
29022
29107
|
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
@@ -29178,12 +29263,12 @@ function TableView({
|
|
|
29178
29263
|
]
|
|
29179
29264
|
}
|
|
29180
29265
|
);
|
|
29181
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
29266
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React86__default.Fragment, { children: rowInner }, id);
|
|
29182
29267
|
};
|
|
29183
29268
|
const items = Array.from(data);
|
|
29184
29269
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
29185
29270
|
let runningIndex = 0;
|
|
29186
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
29271
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
29187
29272
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
29188
29273
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
29189
29274
|
] }, gi)) });
|
|
@@ -30546,7 +30631,7 @@ var init_StepFlow = __esm({
|
|
|
30546
30631
|
className
|
|
30547
30632
|
}) => {
|
|
30548
30633
|
if (orientation === "vertical") {
|
|
30549
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
30634
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React86__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
30550
30635
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
30551
30636
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30552
30637
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -30557,7 +30642,7 @@ var init_StepFlow = __esm({
|
|
|
30557
30642
|
] })
|
|
30558
30643
|
] }) }, index)) });
|
|
30559
30644
|
}
|
|
30560
|
-
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(
|
|
30645
|
+
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(React86__default.Fragment, { children: [
|
|
30561
30646
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
30562
30647
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30563
30648
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -31547,7 +31632,7 @@ var init_LikertScale = __esm({
|
|
|
31547
31632
|
md: "text-base",
|
|
31548
31633
|
lg: "text-lg"
|
|
31549
31634
|
};
|
|
31550
|
-
LikertScale =
|
|
31635
|
+
LikertScale = React86__default.forwardRef(
|
|
31551
31636
|
({
|
|
31552
31637
|
question,
|
|
31553
31638
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -31559,7 +31644,7 @@ var init_LikertScale = __esm({
|
|
|
31559
31644
|
variant = "radios",
|
|
31560
31645
|
className
|
|
31561
31646
|
}, ref) => {
|
|
31562
|
-
const groupId =
|
|
31647
|
+
const groupId = React86__default.useId();
|
|
31563
31648
|
const eventBus = useEventBus();
|
|
31564
31649
|
const handleSelect = useCallback(
|
|
31565
31650
|
(next) => {
|
|
@@ -33848,7 +33933,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
33848
33933
|
"aria-label": t("aria.breadcrumb"),
|
|
33849
33934
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
33850
33935
|
const isLast = idx === items.length - 1;
|
|
33851
|
-
return /* @__PURE__ */ jsxs(
|
|
33936
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
33852
33937
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
33853
33938
|
Icon,
|
|
33854
33939
|
{
|
|
@@ -34717,7 +34802,7 @@ var init_MiniStateMachine = __esm({
|
|
|
34717
34802
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
34718
34803
|
const tc = transitionCounts[s.name] ?? 0;
|
|
34719
34804
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
34720
|
-
return /* @__PURE__ */ jsxs(
|
|
34805
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
34721
34806
|
/* @__PURE__ */ jsx(
|
|
34722
34807
|
AvlState,
|
|
34723
34808
|
{
|
|
@@ -34921,7 +35006,7 @@ var init_PageHeader = __esm({
|
|
|
34921
35006
|
info: "bg-info/10 text-info"
|
|
34922
35007
|
};
|
|
34923
35008
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
34924
|
-
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(
|
|
35009
|
+
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(React86__default.Fragment, { children: [
|
|
34925
35010
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
34926
35011
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
34927
35012
|
"a",
|
|
@@ -35279,7 +35364,7 @@ var init_Section = __esm({
|
|
|
35279
35364
|
as: Component = "section"
|
|
35280
35365
|
}) => {
|
|
35281
35366
|
const hasHeader = title || description || action;
|
|
35282
|
-
return
|
|
35367
|
+
return React86__default.createElement(
|
|
35283
35368
|
Component,
|
|
35284
35369
|
{
|
|
35285
35370
|
className: cn(
|
|
@@ -35653,7 +35738,7 @@ var init_WizardContainer = __esm({
|
|
|
35653
35738
|
const isCompleted = index < currentStep;
|
|
35654
35739
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
35655
35740
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
35656
|
-
return /* @__PURE__ */ jsxs(
|
|
35741
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
35657
35742
|
/* @__PURE__ */ jsx(
|
|
35658
35743
|
Button,
|
|
35659
35744
|
{
|
|
@@ -37440,7 +37525,7 @@ var init_ImportPreviewTree = __esm({
|
|
|
37440
37525
|
const renderUnit = (unit, childrenByParent, depth) => {
|
|
37441
37526
|
const summary = fieldSummary(unit);
|
|
37442
37527
|
const children = childrenByParent.get(unit.ref) ?? [];
|
|
37443
|
-
return /* @__PURE__ */ jsxs(
|
|
37528
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
37444
37529
|
/* @__PURE__ */ jsxs(
|
|
37445
37530
|
Box,
|
|
37446
37531
|
{
|
|
@@ -37537,7 +37622,7 @@ var init_ImportProgress = __esm({
|
|
|
37537
37622
|
PIPELINE.map((key, index) => {
|
|
37538
37623
|
const isComplete = index < currentIndex;
|
|
37539
37624
|
const isActive = index === currentIndex;
|
|
37540
|
-
return /* @__PURE__ */ jsxs(
|
|
37625
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
37541
37626
|
index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
|
|
37542
37627
|
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
|
|
37543
37628
|
/* @__PURE__ */ jsx(
|
|
@@ -38650,7 +38735,7 @@ var init_DrawGroup = __esm({
|
|
|
38650
38735
|
}
|
|
38651
38736
|
});
|
|
38652
38737
|
function extractTitle(children) {
|
|
38653
|
-
if (!
|
|
38738
|
+
if (!React86__default.isValidElement(children)) return void 0;
|
|
38654
38739
|
const props = children.props;
|
|
38655
38740
|
if (typeof props.title === "string") {
|
|
38656
38741
|
return props.title;
|
|
@@ -39000,12 +39085,12 @@ var init_Form = __esm({
|
|
|
39000
39085
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
39001
39086
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
39002
39087
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
39003
|
-
const normalizedInitialData =
|
|
39088
|
+
const normalizedInitialData = React86__default.useMemo(() => {
|
|
39004
39089
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
39005
39090
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
39006
39091
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
39007
39092
|
}, [entity, initialData]);
|
|
39008
|
-
const entityDerivedFields =
|
|
39093
|
+
const entityDerivedFields = React86__default.useMemo(() => {
|
|
39009
39094
|
if (fields && fields.length > 0) return void 0;
|
|
39010
39095
|
if (!resolvedEntity) return void 0;
|
|
39011
39096
|
return resolvedEntity.fields.map(
|
|
@@ -39026,16 +39111,16 @@ var init_Form = __esm({
|
|
|
39026
39111
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
39027
39112
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
39028
39113
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
39029
|
-
const [formData, setFormData] =
|
|
39114
|
+
const [formData, setFormData] = React86__default.useState(
|
|
39030
39115
|
normalizedInitialData
|
|
39031
39116
|
);
|
|
39032
|
-
const [collapsedSections, setCollapsedSections] =
|
|
39117
|
+
const [collapsedSections, setCollapsedSections] = React86__default.useState(
|
|
39033
39118
|
/* @__PURE__ */ new Set()
|
|
39034
39119
|
);
|
|
39035
|
-
const [submitError, setSubmitError] =
|
|
39036
|
-
const formRef =
|
|
39120
|
+
const [submitError, setSubmitError] = React86__default.useState(null);
|
|
39121
|
+
const formRef = React86__default.useRef(null);
|
|
39037
39122
|
const formMode = props.mode;
|
|
39038
|
-
const mountedRef =
|
|
39123
|
+
const mountedRef = React86__default.useRef(false);
|
|
39039
39124
|
if (!mountedRef.current) {
|
|
39040
39125
|
mountedRef.current = true;
|
|
39041
39126
|
debug("forms", "mount", {
|
|
@@ -39048,7 +39133,7 @@ var init_Form = __esm({
|
|
|
39048
39133
|
});
|
|
39049
39134
|
}
|
|
39050
39135
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
39051
|
-
const evalContext =
|
|
39136
|
+
const evalContext = React86__default.useMemo(
|
|
39052
39137
|
() => ({
|
|
39053
39138
|
formValues: formData,
|
|
39054
39139
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -39057,7 +39142,7 @@ var init_Form = __esm({
|
|
|
39057
39142
|
}),
|
|
39058
39143
|
[formData, externalContext]
|
|
39059
39144
|
);
|
|
39060
|
-
|
|
39145
|
+
React86__default.useEffect(() => {
|
|
39061
39146
|
debug("forms", "initialData-sync", {
|
|
39062
39147
|
mode: formMode,
|
|
39063
39148
|
normalizedInitialData,
|
|
@@ -39068,7 +39153,7 @@ var init_Form = __esm({
|
|
|
39068
39153
|
setFormData(normalizedInitialData);
|
|
39069
39154
|
}
|
|
39070
39155
|
}, [normalizedInitialData]);
|
|
39071
|
-
const processCalculations =
|
|
39156
|
+
const processCalculations = React86__default.useCallback(
|
|
39072
39157
|
(changedFieldId, newFormData) => {
|
|
39073
39158
|
if (!hiddenCalculations.length) return;
|
|
39074
39159
|
const context = {
|
|
@@ -39093,7 +39178,7 @@ var init_Form = __esm({
|
|
|
39093
39178
|
},
|
|
39094
39179
|
[hiddenCalculations, externalContext, eventBus]
|
|
39095
39180
|
);
|
|
39096
|
-
const checkViolations =
|
|
39181
|
+
const checkViolations = React86__default.useCallback(
|
|
39097
39182
|
(changedFieldId, newFormData) => {
|
|
39098
39183
|
if (!violationTriggers.length) return;
|
|
39099
39184
|
const context = {
|
|
@@ -39131,7 +39216,7 @@ var init_Form = __esm({
|
|
|
39131
39216
|
processCalculations(name, newFormData);
|
|
39132
39217
|
checkViolations(name, newFormData);
|
|
39133
39218
|
};
|
|
39134
|
-
const isFieldVisible =
|
|
39219
|
+
const isFieldVisible = React86__default.useCallback(
|
|
39135
39220
|
(fieldName) => {
|
|
39136
39221
|
const condition = conditionalFields[fieldName];
|
|
39137
39222
|
if (!condition) return true;
|
|
@@ -39139,7 +39224,7 @@ var init_Form = __esm({
|
|
|
39139
39224
|
},
|
|
39140
39225
|
[conditionalFields, evalContext]
|
|
39141
39226
|
);
|
|
39142
|
-
const isSectionVisible =
|
|
39227
|
+
const isSectionVisible = React86__default.useCallback(
|
|
39143
39228
|
(section) => {
|
|
39144
39229
|
if (!section.condition) return true;
|
|
39145
39230
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -39215,7 +39300,7 @@ var init_Form = __esm({
|
|
|
39215
39300
|
eventBus.emit(`UI:${onCancel}`);
|
|
39216
39301
|
}
|
|
39217
39302
|
};
|
|
39218
|
-
const renderField =
|
|
39303
|
+
const renderField = React86__default.useCallback(
|
|
39219
39304
|
(field) => {
|
|
39220
39305
|
const fieldName = field.name || field.field;
|
|
39221
39306
|
if (!fieldName) return null;
|
|
@@ -39236,7 +39321,7 @@ var init_Form = __esm({
|
|
|
39236
39321
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
39237
39322
|
);
|
|
39238
39323
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
39239
|
-
const normalizedFields =
|
|
39324
|
+
const normalizedFields = React86__default.useMemo(() => {
|
|
39240
39325
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
39241
39326
|
return effectiveFields.map((field) => {
|
|
39242
39327
|
if (typeof field === "string") {
|
|
@@ -39260,7 +39345,7 @@ var init_Form = __esm({
|
|
|
39260
39345
|
return field;
|
|
39261
39346
|
});
|
|
39262
39347
|
}, [effectiveFields, resolvedEntity]);
|
|
39263
|
-
const schemaFields =
|
|
39348
|
+
const schemaFields = React86__default.useMemo(() => {
|
|
39264
39349
|
if (normalizedFields.length === 0) return null;
|
|
39265
39350
|
if (isDebugEnabled()) {
|
|
39266
39351
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -39270,7 +39355,7 @@ var init_Form = __esm({
|
|
|
39270
39355
|
}
|
|
39271
39356
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
39272
39357
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
39273
|
-
const sectionElements =
|
|
39358
|
+
const sectionElements = React86__default.useMemo(() => {
|
|
39274
39359
|
if (!sections || sections.length === 0) return null;
|
|
39275
39360
|
return sections.map((section) => {
|
|
39276
39361
|
if (!isSectionVisible(section)) {
|
|
@@ -39996,7 +40081,7 @@ var init_List = __esm({
|
|
|
39996
40081
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
39997
40082
|
return [];
|
|
39998
40083
|
}, [entity]);
|
|
39999
|
-
const getItemActions =
|
|
40084
|
+
const getItemActions = React86__default.useCallback(
|
|
40000
40085
|
(item) => {
|
|
40001
40086
|
if (!itemActions) return [];
|
|
40002
40087
|
if (typeof itemActions === "function") {
|
|
@@ -40477,7 +40562,7 @@ var init_MediaGallery = __esm({
|
|
|
40477
40562
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
40478
40563
|
);
|
|
40479
40564
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
40480
|
-
const items =
|
|
40565
|
+
const items = React86__default.useMemo(() => {
|
|
40481
40566
|
if (propItems && propItems.length > 0) return propItems;
|
|
40482
40567
|
if (entityData.length === 0) return [];
|
|
40483
40568
|
return entityData.map((record, idx) => {
|
|
@@ -40642,7 +40727,7 @@ var init_MediaGallery = __esm({
|
|
|
40642
40727
|
}
|
|
40643
40728
|
});
|
|
40644
40729
|
function extractTitle2(children) {
|
|
40645
|
-
if (!
|
|
40730
|
+
if (!React86__default.isValidElement(children)) return void 0;
|
|
40646
40731
|
const props = children.props;
|
|
40647
40732
|
if (typeof props.title === "string") {
|
|
40648
40733
|
return props.title;
|
|
@@ -40897,7 +40982,7 @@ var init_debugRegistry = __esm({
|
|
|
40897
40982
|
}
|
|
40898
40983
|
});
|
|
40899
40984
|
function useDebugData() {
|
|
40900
|
-
const [data, setData] =
|
|
40985
|
+
const [data, setData] = React86.useState(() => ({
|
|
40901
40986
|
traits: [],
|
|
40902
40987
|
ticks: [],
|
|
40903
40988
|
guards: [],
|
|
@@ -40911,7 +40996,7 @@ function useDebugData() {
|
|
|
40911
40996
|
},
|
|
40912
40997
|
lastUpdate: Date.now()
|
|
40913
40998
|
}));
|
|
40914
|
-
|
|
40999
|
+
React86.useEffect(() => {
|
|
40915
41000
|
const updateData = () => {
|
|
40916
41001
|
setData({
|
|
40917
41002
|
traits: getAllTraits(),
|
|
@@ -41020,12 +41105,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
41020
41105
|
return positions;
|
|
41021
41106
|
}
|
|
41022
41107
|
function WalkMinimap() {
|
|
41023
|
-
const [walkStep, setWalkStep] =
|
|
41024
|
-
const [traits2, setTraits] =
|
|
41025
|
-
const [coveredEdges, setCoveredEdges] =
|
|
41026
|
-
const [completedTraits, setCompletedTraits] =
|
|
41027
|
-
const prevTraitRef =
|
|
41028
|
-
|
|
41108
|
+
const [walkStep, setWalkStep] = React86.useState(null);
|
|
41109
|
+
const [traits2, setTraits] = React86.useState([]);
|
|
41110
|
+
const [coveredEdges, setCoveredEdges] = React86.useState([]);
|
|
41111
|
+
const [completedTraits, setCompletedTraits] = React86.useState(/* @__PURE__ */ new Set());
|
|
41112
|
+
const prevTraitRef = React86.useRef(null);
|
|
41113
|
+
React86.useEffect(() => {
|
|
41029
41114
|
const interval = setInterval(() => {
|
|
41030
41115
|
const w = window;
|
|
41031
41116
|
const step = w.__orbitalWalkStep;
|
|
@@ -41461,15 +41546,15 @@ var init_EntitiesTab = __esm({
|
|
|
41461
41546
|
});
|
|
41462
41547
|
function EventFlowTab({ events: events2 }) {
|
|
41463
41548
|
const { t } = useTranslate();
|
|
41464
|
-
const [filter, setFilter] =
|
|
41465
|
-
const containerRef =
|
|
41466
|
-
const [autoScroll, setAutoScroll] =
|
|
41467
|
-
|
|
41549
|
+
const [filter, setFilter] = React86.useState("all");
|
|
41550
|
+
const containerRef = React86.useRef(null);
|
|
41551
|
+
const [autoScroll, setAutoScroll] = React86.useState(true);
|
|
41552
|
+
React86.useEffect(() => {
|
|
41468
41553
|
if (autoScroll && containerRef.current) {
|
|
41469
41554
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
41470
41555
|
}
|
|
41471
41556
|
}, [events2.length, autoScroll]);
|
|
41472
|
-
const filteredEvents =
|
|
41557
|
+
const filteredEvents = React86.useMemo(() => {
|
|
41473
41558
|
if (filter === "all") return events2;
|
|
41474
41559
|
return events2.filter((e) => e.type === filter);
|
|
41475
41560
|
}, [events2, filter]);
|
|
@@ -41585,7 +41670,7 @@ var init_EventFlowTab = __esm({
|
|
|
41585
41670
|
});
|
|
41586
41671
|
function GuardsPanel({ guards }) {
|
|
41587
41672
|
const { t } = useTranslate();
|
|
41588
|
-
const [filter, setFilter] =
|
|
41673
|
+
const [filter, setFilter] = React86.useState("all");
|
|
41589
41674
|
if (guards.length === 0) {
|
|
41590
41675
|
return /* @__PURE__ */ jsx(
|
|
41591
41676
|
EmptyState,
|
|
@@ -41598,7 +41683,7 @@ function GuardsPanel({ guards }) {
|
|
|
41598
41683
|
}
|
|
41599
41684
|
const passedCount = guards.filter((g) => g.result).length;
|
|
41600
41685
|
const failedCount = guards.length - passedCount;
|
|
41601
|
-
const filteredGuards =
|
|
41686
|
+
const filteredGuards = React86.useMemo(() => {
|
|
41602
41687
|
if (filter === "all") return guards;
|
|
41603
41688
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
41604
41689
|
return guards.filter((g) => !g.result);
|
|
@@ -41761,10 +41846,10 @@ function EffectBadge({ effect }) {
|
|
|
41761
41846
|
}
|
|
41762
41847
|
function TransitionTimeline({ transitions }) {
|
|
41763
41848
|
const { t } = useTranslate();
|
|
41764
|
-
const containerRef =
|
|
41765
|
-
const [autoScroll, setAutoScroll] =
|
|
41766
|
-
const [expandedId, setExpandedId] =
|
|
41767
|
-
|
|
41849
|
+
const containerRef = React86.useRef(null);
|
|
41850
|
+
const [autoScroll, setAutoScroll] = React86.useState(true);
|
|
41851
|
+
const [expandedId, setExpandedId] = React86.useState(null);
|
|
41852
|
+
React86.useEffect(() => {
|
|
41768
41853
|
if (autoScroll && containerRef.current) {
|
|
41769
41854
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
41770
41855
|
}
|
|
@@ -42044,9 +42129,9 @@ function getAllEvents(traits2) {
|
|
|
42044
42129
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
42045
42130
|
const eventBus = useEventBus();
|
|
42046
42131
|
const { t } = useTranslate();
|
|
42047
|
-
const [log13, setLog] =
|
|
42048
|
-
const prevStatesRef =
|
|
42049
|
-
|
|
42132
|
+
const [log13, setLog] = React86.useState([]);
|
|
42133
|
+
const prevStatesRef = React86.useRef(/* @__PURE__ */ new Map());
|
|
42134
|
+
React86.useEffect(() => {
|
|
42050
42135
|
for (const trait of traits2) {
|
|
42051
42136
|
const prev = prevStatesRef.current.get(trait.id);
|
|
42052
42137
|
if (prev && prev !== trait.currentState) {
|
|
@@ -42215,10 +42300,10 @@ function VerifyModePanel({
|
|
|
42215
42300
|
localCount
|
|
42216
42301
|
}) {
|
|
42217
42302
|
const { t } = useTranslate();
|
|
42218
|
-
const [expanded, setExpanded] =
|
|
42219
|
-
const scrollRef =
|
|
42220
|
-
const prevCountRef =
|
|
42221
|
-
|
|
42303
|
+
const [expanded, setExpanded] = React86.useState(true);
|
|
42304
|
+
const scrollRef = React86.useRef(null);
|
|
42305
|
+
const prevCountRef = React86.useRef(0);
|
|
42306
|
+
React86.useEffect(() => {
|
|
42222
42307
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
42223
42308
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
42224
42309
|
}
|
|
@@ -42275,10 +42360,10 @@ function RuntimeDebugger({
|
|
|
42275
42360
|
schema
|
|
42276
42361
|
}) {
|
|
42277
42362
|
const { t } = useTranslate();
|
|
42278
|
-
const [isCollapsed, setIsCollapsed] =
|
|
42279
|
-
const [isVisible, setIsVisible] =
|
|
42363
|
+
const [isCollapsed, setIsCollapsed] = React86.useState(mode === "verify" ? true : defaultCollapsed);
|
|
42364
|
+
const [isVisible, setIsVisible] = React86.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
42280
42365
|
const debugData = useDebugData();
|
|
42281
|
-
|
|
42366
|
+
React86.useEffect(() => {
|
|
42282
42367
|
if (mode === "inline") return;
|
|
42283
42368
|
return onDebugToggle((enabled) => {
|
|
42284
42369
|
setIsVisible(enabled);
|
|
@@ -42287,7 +42372,7 @@ function RuntimeDebugger({
|
|
|
42287
42372
|
}
|
|
42288
42373
|
});
|
|
42289
42374
|
}, [mode]);
|
|
42290
|
-
|
|
42375
|
+
React86.useEffect(() => {
|
|
42291
42376
|
if (mode === "inline") return;
|
|
42292
42377
|
const handleKeyDown = (e) => {
|
|
42293
42378
|
if (e.key === "`" && isVisible) {
|
|
@@ -42807,7 +42892,7 @@ var init_StatCard = __esm({
|
|
|
42807
42892
|
const labelToUse = propLabel ?? propTitle;
|
|
42808
42893
|
const eventBus = useEventBus();
|
|
42809
42894
|
const { t } = useTranslate();
|
|
42810
|
-
const handleActionClick =
|
|
42895
|
+
const handleActionClick = React86__default.useCallback(() => {
|
|
42811
42896
|
if (action?.event) {
|
|
42812
42897
|
eventBus.emit(`UI:${action.event}`, {});
|
|
42813
42898
|
}
|
|
@@ -42818,7 +42903,7 @@ var init_StatCard = __esm({
|
|
|
42818
42903
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
42819
42904
|
const isLoading = externalLoading ?? false;
|
|
42820
42905
|
const error = externalError;
|
|
42821
|
-
const computeMetricValue =
|
|
42906
|
+
const computeMetricValue = React86__default.useCallback(
|
|
42822
42907
|
(metric, items) => {
|
|
42823
42908
|
if (metric.value !== void 0) {
|
|
42824
42909
|
return metric.value;
|
|
@@ -42857,7 +42942,7 @@ var init_StatCard = __esm({
|
|
|
42857
42942
|
},
|
|
42858
42943
|
[]
|
|
42859
42944
|
);
|
|
42860
|
-
const schemaStats =
|
|
42945
|
+
const schemaStats = React86__default.useMemo(() => {
|
|
42861
42946
|
if (!metrics || metrics.length === 0) return null;
|
|
42862
42947
|
return metrics.map((metric) => ({
|
|
42863
42948
|
label: metric.label,
|
|
@@ -42865,7 +42950,7 @@ var init_StatCard = __esm({
|
|
|
42865
42950
|
format: metric.format
|
|
42866
42951
|
}));
|
|
42867
42952
|
}, [metrics, data, computeMetricValue]);
|
|
42868
|
-
const calculatedTrend =
|
|
42953
|
+
const calculatedTrend = React86__default.useMemo(() => {
|
|
42869
42954
|
if (manualTrend !== void 0) return manualTrend;
|
|
42870
42955
|
if (previousValue === void 0 || currentValue === void 0)
|
|
42871
42956
|
return void 0;
|
|
@@ -43505,8 +43590,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
43505
43590
|
] });
|
|
43506
43591
|
};
|
|
43507
43592
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
43508
|
-
const endRef =
|
|
43509
|
-
|
|
43593
|
+
const endRef = React86__default.useRef(null);
|
|
43594
|
+
React86__default.useEffect(() => {
|
|
43510
43595
|
if (!autoScroll) return;
|
|
43511
43596
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
43512
43597
|
}, [activities.length, autoScroll]);
|
|
@@ -43600,7 +43685,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
43600
43685
|
};
|
|
43601
43686
|
SubagentRichCard = ({ subagent }) => {
|
|
43602
43687
|
const { t } = useTranslate();
|
|
43603
|
-
const activities =
|
|
43688
|
+
const activities = React86__default.useMemo(
|
|
43604
43689
|
() => subagentMessagesToActivities(subagent.messages),
|
|
43605
43690
|
[subagent.messages]
|
|
43606
43691
|
);
|
|
@@ -43677,8 +43762,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
43677
43762
|
] });
|
|
43678
43763
|
};
|
|
43679
43764
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
43680
|
-
const endRef =
|
|
43681
|
-
|
|
43765
|
+
const endRef = React86__default.useRef(null);
|
|
43766
|
+
React86__default.useEffect(() => {
|
|
43682
43767
|
if (!autoScroll) return;
|
|
43683
43768
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
43684
43769
|
}, [messages.length, autoScroll]);
|
|
@@ -44113,7 +44198,7 @@ var init_Timeline = __esm({
|
|
|
44113
44198
|
}) => {
|
|
44114
44199
|
const { t } = useTranslate();
|
|
44115
44200
|
const entityData = entity ?? [];
|
|
44116
|
-
const items =
|
|
44201
|
+
const items = React86__default.useMemo(() => {
|
|
44117
44202
|
if (propItems) return propItems;
|
|
44118
44203
|
if (entityData.length === 0) return [];
|
|
44119
44204
|
return entityData.map((record, idx) => {
|
|
@@ -44215,7 +44300,7 @@ var init_Timeline = __esm({
|
|
|
44215
44300
|
}
|
|
44216
44301
|
});
|
|
44217
44302
|
function extractToastProps(children) {
|
|
44218
|
-
if (!
|
|
44303
|
+
if (!React86__default.isValidElement(children)) {
|
|
44219
44304
|
if (typeof children === "string") {
|
|
44220
44305
|
return { message: children };
|
|
44221
44306
|
}
|
|
@@ -44257,7 +44342,7 @@ var init_ToastSlot = __esm({
|
|
|
44257
44342
|
eventBus.emit(`${prefix}CLOSE`);
|
|
44258
44343
|
};
|
|
44259
44344
|
if (!isVisible) return null;
|
|
44260
|
-
const isCustomContent =
|
|
44345
|
+
const isCustomContent = React86__default.isValidElement(children) && !message;
|
|
44261
44346
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
44262
44347
|
Toast,
|
|
44263
44348
|
{
|
|
@@ -44830,7 +44915,7 @@ function SuspenseConfigProvider({
|
|
|
44830
44915
|
config,
|
|
44831
44916
|
children
|
|
44832
44917
|
}) {
|
|
44833
|
-
return
|
|
44918
|
+
return React86__default.createElement(
|
|
44834
44919
|
SuspenseConfigContext.Provider,
|
|
44835
44920
|
{ value: config },
|
|
44836
44921
|
children
|
|
@@ -44872,7 +44957,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
44872
44957
|
}
|
|
44873
44958
|
return { name: field, label: humanizeFieldName(field) };
|
|
44874
44959
|
}
|
|
44875
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
44960
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React86__default.isValidElement(field) && !(field instanceof Date)) {
|
|
44876
44961
|
const obj = field;
|
|
44877
44962
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
44878
44963
|
if (!fieldName) return field;
|
|
@@ -45344,7 +45429,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
45344
45429
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
45345
45430
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
45346
45431
|
}
|
|
45347
|
-
return /* @__PURE__ */ jsx(
|
|
45432
|
+
return /* @__PURE__ */ jsx(React86__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
45348
45433
|
}
|
|
45349
45434
|
if (!child || typeof child !== "object") return null;
|
|
45350
45435
|
const childId = `${parentId}-${index}`;
|
|
@@ -45401,14 +45486,14 @@ function isPatternConfig(value) {
|
|
|
45401
45486
|
if (value === null || value === void 0) return false;
|
|
45402
45487
|
if (typeof value !== "object") return false;
|
|
45403
45488
|
if (Array.isArray(value)) return false;
|
|
45404
|
-
if (
|
|
45489
|
+
if (React86__default.isValidElement(value)) return false;
|
|
45405
45490
|
if (value instanceof Date) return false;
|
|
45406
45491
|
if (typeof value === "function") return false;
|
|
45407
45492
|
const record = value;
|
|
45408
45493
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
45409
45494
|
}
|
|
45410
45495
|
function isPlainConfigObject(value) {
|
|
45411
|
-
if (
|
|
45496
|
+
if (React86__default.isValidElement(value)) return false;
|
|
45412
45497
|
if (value instanceof Date) return false;
|
|
45413
45498
|
const proto = Object.getPrototypeOf(value);
|
|
45414
45499
|
return proto === Object.prototype || proto === null;
|
|
@@ -45544,7 +45629,7 @@ function SlotContentRenderer({
|
|
|
45544
45629
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
45545
45630
|
const slotVal = restProps[slotKey];
|
|
45546
45631
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
45547
|
-
if (
|
|
45632
|
+
if (React86__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
45548
45633
|
const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
|
|
45549
45634
|
if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
45550
45635
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
@@ -45598,7 +45683,7 @@ function SlotContentRenderer({
|
|
|
45598
45683
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
45599
45684
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
45600
45685
|
const sample = resolvedItems[0];
|
|
45601
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
45686
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React86__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
45602
45687
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
45603
45688
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
45604
45689
|
}
|