@almadar/ui 5.141.0 → 5.143.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 +1326 -1240
- package/dist/avl/index.js +355 -269
- package/dist/{avl-schema-parser-B8Onmfsu.d.cts → avl-schema-parser-0hkiHOq3.d.ts} +233 -2
- package/dist/{avl-schema-parser-B8Onmfsu.d.ts → avl-schema-parser-BZ8pICOS.d.cts} +233 -2
- package/dist/{cn-rwc3svaX.d.cts → cn-CvImTgKH.d.cts} +1 -1
- package/dist/{cn-BDwC4QpH.d.ts → cn-DryTiahe.d.ts} +1 -1
- package/dist/components/index.cjs +1310 -1224
- package/dist/components/index.d.cts +13 -6
- package/dist/components/index.d.ts +13 -6
- package/dist/components/index.js +346 -260
- package/dist/lib/drawable/three/index.cjs +560 -194
- package/dist/lib/drawable/three/index.d.cts +14 -173
- package/dist/lib/drawable/three/index.d.ts +14 -173
- package/dist/lib/drawable/three/index.js +536 -170
- package/dist/lib/index.d.cts +2 -2
- package/dist/lib/index.d.ts +2 -2
- package/dist/{paintDispatch-BQn5Lyx1.d.cts → paintDispatch-D3-5_cOb.d.cts} +72 -32
- package/dist/{paintDispatch-BQn5Lyx1.d.ts → paintDispatch-D3-5_cOb.d.ts} +72 -32
- package/dist/providers/index.cjs +1209 -1123
- package/dist/providers/index.js +330 -244
- package/dist/runtime/index.cjs +1187 -1101
- package/dist/runtime/index.js +335 -249
- package/package.json +8 -8
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React87 from 'react';
|
|
2
|
+
import React87__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 (React87__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 = React87__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 React87__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 = React87__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] = React87.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] = React87.useReducer((x) => x + 1, 0);
|
|
974
|
+
const canvasRef = React87.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
|
+
React87.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 (React87__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 = React87__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 = React87__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 React87__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 = React87__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 = React87__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 = React87__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 = React87__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] = React87__default.useState(value);
|
|
3125
|
+
const pendingEchoRef = React87__default.useRef(/* @__PURE__ */ new Set());
|
|
3126
|
+
React87__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 = React87__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 = React87__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 = React87__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 = React87__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 = React87__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 = React87__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 = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3763
3763
|
CardHeader.displayName = "CardHeader";
|
|
3764
|
-
CardTitle =
|
|
3764
|
+
CardTitle = React87__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 = React87__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 = React87__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 = React87__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] = React87__default.useState(false);
|
|
3998
|
+
React87__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 React87__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 = React87__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 = React87__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] = React87__default.useState(value);
|
|
4401
|
+
React87__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 = React87.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] = React87.useState(
|
|
4595
4595
|
checked !== void 0 ? checked : defaultChecked
|
|
4596
4596
|
);
|
|
4597
|
-
|
|
4597
|
+
React87.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 React87__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 = React87__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] = React87__default.useState(false);
|
|
5040
|
+
const timeoutRef = React87__default.useRef(null);
|
|
5041
|
+
const triggerRef = React87__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
|
+
React87__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 = React87__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 = React87__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 = React87__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 = React87__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 = React87__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 = React87__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 = React87__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] = React87.useState(false);
|
|
7442
7442
|
const actualPressed = pressed ?? isPressed;
|
|
7443
|
-
const handlePointerDown =
|
|
7443
|
+
const handlePointerDown = React87.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 = React87.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 = React87.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] = React87.useState(/* @__PURE__ */ new Set());
|
|
7722
|
+
const handlePress = React87.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 = React87.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 = React87.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 = React87.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 = React87.useRef(null);
|
|
8402
|
+
const imgCacheRef = React87.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
|
+
React87.useEffect(() => {
|
|
8419
8419
|
const canvas = canvasRef.current;
|
|
8420
8420
|
if (!canvas) return;
|
|
8421
8421
|
const ctx = canvas.getContext("2d");
|
|
@@ -9398,6 +9398,83 @@ var init_DrawText = __esm({
|
|
|
9398
9398
|
};
|
|
9399
9399
|
}
|
|
9400
9400
|
});
|
|
9401
|
+
function isAnimatedGroup(node) {
|
|
9402
|
+
return Boolean(node.animation && node.animation.durationMs > 0 && node.animation.keyframes.length > 0);
|
|
9403
|
+
}
|
|
9404
|
+
function DrawGroup(props) {
|
|
9405
|
+
const register = useContext(DrawableRegistryContext);
|
|
9406
|
+
if (register) register({ ...props, type: "draw-group" });
|
|
9407
|
+
return null;
|
|
9408
|
+
}
|
|
9409
|
+
var init_DrawGroup = __esm({
|
|
9410
|
+
"components/game/atoms/DrawGroup.tsx"() {
|
|
9411
|
+
"use client";
|
|
9412
|
+
init_registry();
|
|
9413
|
+
}
|
|
9414
|
+
});
|
|
9415
|
+
function applyMeshAnimation(node, timeMs) {
|
|
9416
|
+
const anim = node.animation;
|
|
9417
|
+
if (!anim || !(anim.durationMs > 0) || anim.keyframes.length === 0) return null;
|
|
9418
|
+
const frames = [...anim.keyframes].sort((a, b) => a.at - b.at);
|
|
9419
|
+
const cycle = timeMs / anim.durationMs;
|
|
9420
|
+
const t = anim.loop === false ? Math.min(cycle, 1) : cycle - Math.floor(cycle);
|
|
9421
|
+
const trackValue = (key) => {
|
|
9422
|
+
const defined = frames.filter((f3) => f3[key] !== void 0);
|
|
9423
|
+
if (defined.length === 0) return void 0;
|
|
9424
|
+
let prev;
|
|
9425
|
+
let next;
|
|
9426
|
+
for (const f3 of defined) {
|
|
9427
|
+
if (f3.at <= t) prev = f3;
|
|
9428
|
+
else if (!next) next = f3;
|
|
9429
|
+
}
|
|
9430
|
+
if (!prev) return defined[0][key];
|
|
9431
|
+
if (!next) return prev[key];
|
|
9432
|
+
const span = next.at - prev.at;
|
|
9433
|
+
const k = span > 0 ? (t - prev.at) / span : 1;
|
|
9434
|
+
const a = prev[key];
|
|
9435
|
+
const b = next[key];
|
|
9436
|
+
if (typeof a === "number" && typeof b === "number") return lerp2(a, b, k);
|
|
9437
|
+
return a;
|
|
9438
|
+
};
|
|
9439
|
+
const num = {};
|
|
9440
|
+
for (const key of NUMERIC_TRACKS2) {
|
|
9441
|
+
const v = trackValue(key);
|
|
9442
|
+
if (v !== void 0) num[key] = v;
|
|
9443
|
+
}
|
|
9444
|
+
return {
|
|
9445
|
+
offset: [num.offsetX ?? 0, num.offsetY ?? 0, num.offsetZ ?? 0],
|
|
9446
|
+
rotate: [num.rotateX ?? 0, num.rotateY ?? 0, num.rotateZ ?? 0],
|
|
9447
|
+
scale: num.scale ?? 1,
|
|
9448
|
+
opacity: num.opacity,
|
|
9449
|
+
emissiveIntensity: num.emissiveIntensity,
|
|
9450
|
+
color: trackValue("color"),
|
|
9451
|
+
emissive: trackValue("emissive")
|
|
9452
|
+
};
|
|
9453
|
+
}
|
|
9454
|
+
function DrawMesh(props) {
|
|
9455
|
+
const register = useContext(DrawableRegistryContext);
|
|
9456
|
+
if (register) register({ ...props, type: "draw-mesh" });
|
|
9457
|
+
return null;
|
|
9458
|
+
}
|
|
9459
|
+
var lerp2, NUMERIC_TRACKS2;
|
|
9460
|
+
var init_DrawMesh = __esm({
|
|
9461
|
+
"components/game/atoms/DrawMesh.tsx"() {
|
|
9462
|
+
"use client";
|
|
9463
|
+
init_registry();
|
|
9464
|
+
lerp2 = (a, b, k) => a + (b - a) * k;
|
|
9465
|
+
NUMERIC_TRACKS2 = [
|
|
9466
|
+
"offsetX",
|
|
9467
|
+
"offsetY",
|
|
9468
|
+
"offsetZ",
|
|
9469
|
+
"rotateX",
|
|
9470
|
+
"rotateY",
|
|
9471
|
+
"rotateZ",
|
|
9472
|
+
"scale",
|
|
9473
|
+
"opacity",
|
|
9474
|
+
"emissiveIntensity"
|
|
9475
|
+
];
|
|
9476
|
+
}
|
|
9477
|
+
});
|
|
9401
9478
|
|
|
9402
9479
|
// components/game/molecules/DrawSpriteLayer.tsx
|
|
9403
9480
|
function DrawSpriteLayer(_props) {
|
|
@@ -9464,18 +9541,22 @@ function paintDrawable(painter, node, dctx) {
|
|
|
9464
9541
|
if (!isValidScenePos(node.position)) break;
|
|
9465
9542
|
if (!Array.isArray(node.items)) break;
|
|
9466
9543
|
const p = dctx.projector.project(node.position);
|
|
9544
|
+
const anim = dctx.time > 0 && isAnimatedGroup(node) ? applyMeshAnimation(node, dctx.time) : null;
|
|
9545
|
+
const tw = dctx.projector.tileWidth;
|
|
9467
9546
|
painter.save();
|
|
9468
|
-
painter.translate(p.x, p.y);
|
|
9469
|
-
|
|
9470
|
-
if (
|
|
9471
|
-
|
|
9547
|
+
painter.translate(p.x + (anim ? anim.offset[0] * tw : 0), p.y + (anim ? anim.offset[1] * tw : 0));
|
|
9548
|
+
const scale = (node.scale ?? 1) * (anim?.scale ?? 1);
|
|
9549
|
+
if (scale !== 1) painter.scale(scale, scale);
|
|
9550
|
+
const rotate = (node.rotate ?? 0) + (node.rotation?.[2] ?? 0) + (anim?.rotate[2] ?? 0);
|
|
9551
|
+
if (rotate !== 0) painter.rotate(rotate);
|
|
9552
|
+
const opacity = (node.opacity ?? 1) * (anim?.opacity ?? 1);
|
|
9553
|
+
if (opacity !== 1) painter.setAlpha(opacity);
|
|
9472
9554
|
if (node.clip) {
|
|
9473
|
-
const tw = dctx.projector.tileWidth;
|
|
9474
9555
|
painter.scale(tw, tw);
|
|
9475
9556
|
painter.clipPath(node.clip);
|
|
9476
9557
|
painter.scale(1 / tw, 1 / tw);
|
|
9477
9558
|
}
|
|
9478
|
-
const childCtx =
|
|
9559
|
+
const childCtx = scale !== 1 ? { ...dctx, groupScale: (dctx.groupScale ?? 1) * scale } : dctx;
|
|
9479
9560
|
for (const item of node.items) paintDrawable(painter, item, childCtx);
|
|
9480
9561
|
painter.restore();
|
|
9481
9562
|
break;
|
|
@@ -9501,6 +9582,8 @@ var init_paintDispatch = __esm({
|
|
|
9501
9582
|
init_DrawSprite();
|
|
9502
9583
|
init_DrawShape();
|
|
9503
9584
|
init_DrawText();
|
|
9585
|
+
init_DrawGroup();
|
|
9586
|
+
init_DrawMesh();
|
|
9504
9587
|
init_DrawSpriteLayer();
|
|
9505
9588
|
init_DrawShapeLayer();
|
|
9506
9589
|
init_DrawTextLayer();
|
|
@@ -9596,7 +9679,7 @@ function Canvas2D({
|
|
|
9596
9679
|
const registerChildDrawable = useCallback((node) => {
|
|
9597
9680
|
childDrawablesRef.current.push(node);
|
|
9598
9681
|
}, []);
|
|
9599
|
-
const hasJsxChildren =
|
|
9682
|
+
const hasJsxChildren = React87.Children.count(children) > 0;
|
|
9600
9683
|
function isDrawableLayer(node) {
|
|
9601
9684
|
return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
|
|
9602
9685
|
}
|
|
@@ -9747,7 +9830,8 @@ function Canvas2D({
|
|
|
9747
9830
|
const miniMapHeight = gridExtent.height || 10;
|
|
9748
9831
|
const drawableIsAnimated = (node) => {
|
|
9749
9832
|
if (node.type === "draw-shape") return isAnimatedShape(node);
|
|
9750
|
-
if (node.type === "draw-group")
|
|
9833
|
+
if (node.type === "draw-group")
|
|
9834
|
+
return isAnimatedGroup(node) || Array.isArray(node.items) && node.items.some(drawableIsAnimated);
|
|
9751
9835
|
if (node.type === "draw-shape-layer") return Array.isArray(node.items) && node.items.some(isAnimatedShape);
|
|
9752
9836
|
return false;
|
|
9753
9837
|
};
|
|
@@ -10089,6 +10173,7 @@ var init_Canvas2D = __esm({
|
|
|
10089
10173
|
init_projector();
|
|
10090
10174
|
init_paintDispatch();
|
|
10091
10175
|
init_DrawShape();
|
|
10176
|
+
init_DrawGroup();
|
|
10092
10177
|
init_registry();
|
|
10093
10178
|
init_hitTest();
|
|
10094
10179
|
init_isometric();
|
|
@@ -10125,6 +10210,8 @@ function Canvas({
|
|
|
10125
10210
|
showCoordinates,
|
|
10126
10211
|
showTileInfo,
|
|
10127
10212
|
fogOfWar,
|
|
10213
|
+
lighting,
|
|
10214
|
+
post,
|
|
10128
10215
|
tileClickEvent,
|
|
10129
10216
|
unitClickEvent,
|
|
10130
10217
|
tileHoverEvent,
|
|
@@ -10136,10 +10223,25 @@ function Canvas({
|
|
|
10136
10223
|
}) {
|
|
10137
10224
|
canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
|
|
10138
10225
|
const zoom = camera?.zoom;
|
|
10226
|
+
const childDrawablesRef = useRef([]);
|
|
10227
|
+
if (mode === "3d") childDrawablesRef.current = [];
|
|
10228
|
+
const registerChildDrawable = useCallback((node) => {
|
|
10229
|
+
childDrawablesRef.current.push(node);
|
|
10230
|
+
}, []);
|
|
10231
|
+
const [childDrawables, setChildDrawables] = useState([]);
|
|
10232
|
+
useEffect(() => {
|
|
10233
|
+
if (mode !== "3d") return;
|
|
10234
|
+
const next = childDrawablesRef.current;
|
|
10235
|
+
canvasLog.debug("children:adopt", { registered: next.length, adopted: childDrawables.length });
|
|
10236
|
+
if (next.length === 0 && React87.Children.count(children) > 0) return;
|
|
10237
|
+
setChildDrawables(
|
|
10238
|
+
(prev) => prev.length === next.length && JSON.stringify(prev) === JSON.stringify(next) ? prev : [...next]
|
|
10239
|
+
);
|
|
10240
|
+
});
|
|
10139
10241
|
if (mode === "3d") {
|
|
10140
10242
|
const props3d = {
|
|
10141
10243
|
className,
|
|
10142
|
-
drawables,
|
|
10244
|
+
drawables: [...drawables ?? [], ...childDrawables],
|
|
10143
10245
|
isLoading,
|
|
10144
10246
|
cameraMode: to3DCameraMode(camera?.mode),
|
|
10145
10247
|
...zoom !== void 0 ? { scale: zoom } : {},
|
|
@@ -10155,6 +10257,8 @@ function Canvas({
|
|
|
10155
10257
|
showCoordinates,
|
|
10156
10258
|
showTileInfo,
|
|
10157
10259
|
fogOfWar,
|
|
10260
|
+
lighting,
|
|
10261
|
+
post,
|
|
10158
10262
|
tileClickEvent,
|
|
10159
10263
|
unitClickEvent,
|
|
10160
10264
|
tileHoverEvent,
|
|
@@ -10163,7 +10267,10 @@ function Canvas({
|
|
|
10163
10267
|
keyMap,
|
|
10164
10268
|
keyUpMap
|
|
10165
10269
|
};
|
|
10166
|
-
return /* @__PURE__ */
|
|
10270
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10271
|
+
/* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Canvas3DHost, { ...props3d }) }),
|
|
10272
|
+
React87.Children.count(children) > 0 && /* @__PURE__ */ jsx(DrawableRegistryContext.Provider, { value: registerChildDrawable, children: /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children }) })
|
|
10273
|
+
] });
|
|
10167
10274
|
}
|
|
10168
10275
|
return /* @__PURE__ */ jsx(
|
|
10169
10276
|
Canvas2D,
|
|
@@ -10195,6 +10302,7 @@ var Canvas3DHost, canvasLog;
|
|
|
10195
10302
|
var init_Canvas = __esm({
|
|
10196
10303
|
"components/game/molecules/Canvas.tsx"() {
|
|
10197
10304
|
"use client";
|
|
10305
|
+
init_registry();
|
|
10198
10306
|
init_Canvas2D();
|
|
10199
10307
|
Canvas3DHost = lazy(
|
|
10200
10308
|
() => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.Canvas3DHost }))
|
|
@@ -10586,7 +10694,7 @@ function LinearView({
|
|
|
10586
10694
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
10587
10695
|
const isDone = i < currentIdx;
|
|
10588
10696
|
const isCurrent = i === currentIdx;
|
|
10589
|
-
return /* @__PURE__ */ jsxs(
|
|
10697
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
10590
10698
|
i > 0 && /* @__PURE__ */ jsx(
|
|
10591
10699
|
Typography,
|
|
10592
10700
|
{
|
|
@@ -11121,7 +11229,7 @@ function SequenceBar({
|
|
|
11121
11229
|
else onSlotRemove?.(index);
|
|
11122
11230
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
11123
11231
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
11124
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
11232
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
11125
11233
|
i > 0 && /* @__PURE__ */ jsx(
|
|
11126
11234
|
Typography,
|
|
11127
11235
|
{
|
|
@@ -11770,7 +11878,7 @@ var init_ErrorBoundary = __esm({
|
|
|
11770
11878
|
}
|
|
11771
11879
|
);
|
|
11772
11880
|
};
|
|
11773
|
-
ErrorBoundary = class extends
|
|
11881
|
+
ErrorBoundary = class extends React87__default.Component {
|
|
11774
11882
|
constructor(props) {
|
|
11775
11883
|
super(props);
|
|
11776
11884
|
__publicField(this, "reset", () => {
|
|
@@ -12422,7 +12530,7 @@ var init_Container = __esm({
|
|
|
12422
12530
|
as: Component = "div"
|
|
12423
12531
|
}) => {
|
|
12424
12532
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
12425
|
-
return
|
|
12533
|
+
return React87__default.createElement(
|
|
12426
12534
|
Component,
|
|
12427
12535
|
{
|
|
12428
12536
|
className: cn(
|
|
@@ -15387,7 +15495,7 @@ var init_CodeBlock = __esm({
|
|
|
15387
15495
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
15388
15496
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
15389
15497
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
15390
|
-
CodeBlock =
|
|
15498
|
+
CodeBlock = React87__default.memo(
|
|
15391
15499
|
({
|
|
15392
15500
|
code: rawCode,
|
|
15393
15501
|
language = "text",
|
|
@@ -15975,7 +16083,7 @@ var init_MarkdownContent = __esm({
|
|
|
15975
16083
|
init_Box();
|
|
15976
16084
|
init_CodeBlock();
|
|
15977
16085
|
init_cn();
|
|
15978
|
-
MarkdownContent =
|
|
16086
|
+
MarkdownContent = React87__default.memo(
|
|
15979
16087
|
({ content, direction = "ltr", className }) => {
|
|
15980
16088
|
const { t: _t } = useTranslate();
|
|
15981
16089
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -17302,7 +17410,7 @@ var init_StateMachineView = __esm({
|
|
|
17302
17410
|
style: { top: title ? 30 : 0 },
|
|
17303
17411
|
children: [
|
|
17304
17412
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
17305
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
17413
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React87__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
17306
17414
|
StateNode2,
|
|
17307
17415
|
{
|
|
17308
17416
|
state,
|
|
@@ -23124,8 +23232,8 @@ var init_Menu = __esm({
|
|
|
23124
23232
|
"bottom-end": "bottom-start"
|
|
23125
23233
|
};
|
|
23126
23234
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
23127
|
-
const triggerChild =
|
|
23128
|
-
const triggerElement =
|
|
23235
|
+
const triggerChild = React87__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
23236
|
+
const triggerElement = React87__default.cloneElement(
|
|
23129
23237
|
triggerChild,
|
|
23130
23238
|
{
|
|
23131
23239
|
ref: triggerRef,
|
|
@@ -23220,14 +23328,14 @@ function useDataDnd(args) {
|
|
|
23220
23328
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
23221
23329
|
const enabled = isZone || Boolean(dndRoot);
|
|
23222
23330
|
const eventBus = useEventBus();
|
|
23223
|
-
const parentRoot =
|
|
23331
|
+
const parentRoot = React87__default.useContext(RootCtx);
|
|
23224
23332
|
const isRoot = enabled && parentRoot === null;
|
|
23225
|
-
const zoneId =
|
|
23333
|
+
const zoneId = React87__default.useId();
|
|
23226
23334
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
23227
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
23228
|
-
const optimisticOrdersRef =
|
|
23335
|
+
const [optimisticOrders, setOptimisticOrders] = React87__default.useState(() => /* @__PURE__ */ new Map());
|
|
23336
|
+
const optimisticOrdersRef = React87__default.useRef(optimisticOrders);
|
|
23229
23337
|
optimisticOrdersRef.current = optimisticOrders;
|
|
23230
|
-
const clearOptimisticOrder =
|
|
23338
|
+
const clearOptimisticOrder = React87__default.useCallback((group) => {
|
|
23231
23339
|
setOptimisticOrders((prev) => {
|
|
23232
23340
|
if (!prev.has(group)) return prev;
|
|
23233
23341
|
const next = new Map(prev);
|
|
@@ -23252,7 +23360,7 @@ function useDataDnd(args) {
|
|
|
23252
23360
|
const raw = it[dndItemIdField];
|
|
23253
23361
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
23254
23362
|
}).join("|");
|
|
23255
|
-
const itemIds =
|
|
23363
|
+
const itemIds = React87__default.useMemo(
|
|
23256
23364
|
() => orderedItems.map((it, idx) => {
|
|
23257
23365
|
const raw = it[dndItemIdField];
|
|
23258
23366
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -23263,7 +23371,7 @@ function useDataDnd(args) {
|
|
|
23263
23371
|
const raw = it[dndItemIdField];
|
|
23264
23372
|
return raw != null ? String(raw) : `__${idx}`;
|
|
23265
23373
|
}).join("|");
|
|
23266
|
-
|
|
23374
|
+
React87__default.useEffect(() => {
|
|
23267
23375
|
const root = isRoot ? null : parentRoot;
|
|
23268
23376
|
if (root) {
|
|
23269
23377
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -23271,20 +23379,20 @@ function useDataDnd(args) {
|
|
|
23271
23379
|
clearOptimisticOrder(ownGroup);
|
|
23272
23380
|
}
|
|
23273
23381
|
}, [itemsContentSig, ownGroup]);
|
|
23274
|
-
const zonesRef =
|
|
23275
|
-
const registerZone =
|
|
23382
|
+
const zonesRef = React87__default.useRef(/* @__PURE__ */ new Map());
|
|
23383
|
+
const registerZone = React87__default.useCallback((zoneId2, meta2) => {
|
|
23276
23384
|
zonesRef.current.set(zoneId2, meta2);
|
|
23277
23385
|
}, []);
|
|
23278
|
-
const unregisterZone =
|
|
23386
|
+
const unregisterZone = React87__default.useCallback((zoneId2) => {
|
|
23279
23387
|
zonesRef.current.delete(zoneId2);
|
|
23280
23388
|
}, []);
|
|
23281
|
-
const [activeDrag, setActiveDrag] =
|
|
23282
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
23283
|
-
const meta =
|
|
23389
|
+
const [activeDrag, setActiveDrag] = React87__default.useState(null);
|
|
23390
|
+
const [overZoneGroup, setOverZoneGroup] = React87__default.useState(null);
|
|
23391
|
+
const meta = React87__default.useMemo(
|
|
23284
23392
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
23285
23393
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
23286
23394
|
);
|
|
23287
|
-
|
|
23395
|
+
React87__default.useEffect(() => {
|
|
23288
23396
|
const target = isRoot ? null : parentRoot;
|
|
23289
23397
|
if (!target) {
|
|
23290
23398
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -23303,7 +23411,7 @@ function useDataDnd(args) {
|
|
|
23303
23411
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
23304
23412
|
const sensors = useAlmadarDndSensors(true);
|
|
23305
23413
|
const collisionDetection = almadarDndCollisionDetection;
|
|
23306
|
-
const findZoneByItem =
|
|
23414
|
+
const findZoneByItem = React87__default.useCallback(
|
|
23307
23415
|
(id) => {
|
|
23308
23416
|
for (const z of zonesRef.current.values()) {
|
|
23309
23417
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -23312,7 +23420,7 @@ function useDataDnd(args) {
|
|
|
23312
23420
|
},
|
|
23313
23421
|
[]
|
|
23314
23422
|
);
|
|
23315
|
-
|
|
23423
|
+
React87__default.useCallback(
|
|
23316
23424
|
(group) => {
|
|
23317
23425
|
for (const z of zonesRef.current.values()) {
|
|
23318
23426
|
if (z.group === group) return z;
|
|
@@ -23321,7 +23429,7 @@ function useDataDnd(args) {
|
|
|
23321
23429
|
},
|
|
23322
23430
|
[]
|
|
23323
23431
|
);
|
|
23324
|
-
const handleDragEnd =
|
|
23432
|
+
const handleDragEnd = React87__default.useCallback(
|
|
23325
23433
|
(event) => {
|
|
23326
23434
|
const { active, over } = event;
|
|
23327
23435
|
const activeIdStr = String(active.id);
|
|
@@ -23412,8 +23520,8 @@ function useDataDnd(args) {
|
|
|
23412
23520
|
},
|
|
23413
23521
|
[eventBus]
|
|
23414
23522
|
);
|
|
23415
|
-
const sortableData =
|
|
23416
|
-
const SortableItem =
|
|
23523
|
+
const sortableData = React87__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
23524
|
+
const SortableItem = React87__default.useCallback(
|
|
23417
23525
|
({ id, children }) => {
|
|
23418
23526
|
const {
|
|
23419
23527
|
attributes,
|
|
@@ -23453,7 +23561,7 @@ function useDataDnd(args) {
|
|
|
23453
23561
|
id: droppableId,
|
|
23454
23562
|
data: sortableData
|
|
23455
23563
|
});
|
|
23456
|
-
const ctx =
|
|
23564
|
+
const ctx = React87__default.useContext(RootCtx);
|
|
23457
23565
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
23458
23566
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
23459
23567
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -23468,7 +23576,7 @@ function useDataDnd(args) {
|
|
|
23468
23576
|
showForeignPlaceholder,
|
|
23469
23577
|
ctxAvailable: ctx != null
|
|
23470
23578
|
});
|
|
23471
|
-
|
|
23579
|
+
React87__default.useEffect(() => {
|
|
23472
23580
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
23473
23581
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
23474
23582
|
return /* @__PURE__ */ jsx(
|
|
@@ -23482,11 +23590,11 @@ function useDataDnd(args) {
|
|
|
23482
23590
|
}
|
|
23483
23591
|
);
|
|
23484
23592
|
};
|
|
23485
|
-
const rootContextValue =
|
|
23593
|
+
const rootContextValue = React87__default.useMemo(
|
|
23486
23594
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
23487
23595
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
23488
23596
|
);
|
|
23489
|
-
const handleDragStart =
|
|
23597
|
+
const handleDragStart = React87__default.useCallback((event) => {
|
|
23490
23598
|
const sourceZone = findZoneByItem(event.active.id);
|
|
23491
23599
|
const rect = event.active.rect.current.initial;
|
|
23492
23600
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -23505,7 +23613,7 @@ function useDataDnd(args) {
|
|
|
23505
23613
|
isRoot
|
|
23506
23614
|
});
|
|
23507
23615
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
23508
|
-
const handleDragOver =
|
|
23616
|
+
const handleDragOver = React87__default.useCallback((event) => {
|
|
23509
23617
|
const { active, over } = event;
|
|
23510
23618
|
const overData = over?.data?.current;
|
|
23511
23619
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -23575,7 +23683,7 @@ function useDataDnd(args) {
|
|
|
23575
23683
|
return next;
|
|
23576
23684
|
});
|
|
23577
23685
|
}, []);
|
|
23578
|
-
const handleDragCancel =
|
|
23686
|
+
const handleDragCancel = React87__default.useCallback((event) => {
|
|
23579
23687
|
setActiveDrag(null);
|
|
23580
23688
|
setOverZoneGroup(null);
|
|
23581
23689
|
dndLog.warn("dragCancel", {
|
|
@@ -23583,12 +23691,12 @@ function useDataDnd(args) {
|
|
|
23583
23691
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
23584
23692
|
});
|
|
23585
23693
|
}, []);
|
|
23586
|
-
const handleDragEndWithCleanup =
|
|
23694
|
+
const handleDragEndWithCleanup = React87__default.useCallback((event) => {
|
|
23587
23695
|
handleDragEnd(event);
|
|
23588
23696
|
setActiveDrag(null);
|
|
23589
23697
|
setOverZoneGroup(null);
|
|
23590
23698
|
}, [handleDragEnd]);
|
|
23591
|
-
const wrapContainer =
|
|
23699
|
+
const wrapContainer = React87__default.useCallback(
|
|
23592
23700
|
(children) => {
|
|
23593
23701
|
if (!enabled) return children;
|
|
23594
23702
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -23642,7 +23750,7 @@ var init_useDataDnd = __esm({
|
|
|
23642
23750
|
init_useAlmadarDndCollision();
|
|
23643
23751
|
init_Box();
|
|
23644
23752
|
dndLog = createLogger("almadar:ui:dnd");
|
|
23645
|
-
RootCtx =
|
|
23753
|
+
RootCtx = React87__default.createContext(null);
|
|
23646
23754
|
}
|
|
23647
23755
|
});
|
|
23648
23756
|
function renderIconInput(icon, props) {
|
|
@@ -24184,7 +24292,7 @@ function DataList({
|
|
|
24184
24292
|
}) {
|
|
24185
24293
|
const eventBus = useEventBus();
|
|
24186
24294
|
const { t } = useTranslate();
|
|
24187
|
-
const [visibleCount, setVisibleCount] =
|
|
24295
|
+
const [visibleCount, setVisibleCount] = React87__default.useState(pageSize || Infinity);
|
|
24188
24296
|
const fieldDefs = fields ?? columns ?? [];
|
|
24189
24297
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
24190
24298
|
const dnd = useDataDnd({
|
|
@@ -24200,14 +24308,14 @@ function DataList({
|
|
|
24200
24308
|
dndRoot
|
|
24201
24309
|
});
|
|
24202
24310
|
const orderedData = dnd.orderedItems;
|
|
24203
|
-
const allData =
|
|
24311
|
+
const allData = React87__default.useMemo(
|
|
24204
24312
|
() => sortRows(orderedData, sortBy, sortDirection),
|
|
24205
24313
|
[orderedData, sortBy, sortDirection]
|
|
24206
24314
|
);
|
|
24207
24315
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
24208
24316
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
24209
24317
|
const hasRenderProp = typeof children === "function";
|
|
24210
|
-
|
|
24318
|
+
React87__default.useEffect(() => {
|
|
24211
24319
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
24212
24320
|
const childrenTypeOf = typeof children;
|
|
24213
24321
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -24322,7 +24430,7 @@ function DataList({
|
|
|
24322
24430
|
return v === void 0 || v === null || v === "" ? raw : String(v);
|
|
24323
24431
|
};
|
|
24324
24432
|
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
|
|
24325
|
-
groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
24433
|
+
groups2.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
24326
24434
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
24327
24435
|
group.items.map((itemData, index) => {
|
|
24328
24436
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -24521,7 +24629,7 @@ function DataList({
|
|
|
24521
24629
|
className
|
|
24522
24630
|
),
|
|
24523
24631
|
children: [
|
|
24524
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
24632
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
24525
24633
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
24526
24634
|
group.items.map(
|
|
24527
24635
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -24608,7 +24716,7 @@ var init_FormSection = __esm({
|
|
|
24608
24716
|
columns = 1,
|
|
24609
24717
|
className
|
|
24610
24718
|
}) => {
|
|
24611
|
-
const [collapsed, setCollapsed] =
|
|
24719
|
+
const [collapsed, setCollapsed] = React87__default.useState(defaultCollapsed);
|
|
24612
24720
|
const { t } = useTranslate();
|
|
24613
24721
|
const eventBus = useEventBus();
|
|
24614
24722
|
const gridClass = {
|
|
@@ -24616,7 +24724,7 @@ var init_FormSection = __esm({
|
|
|
24616
24724
|
2: "grid-cols-1 md:grid-cols-2",
|
|
24617
24725
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
24618
24726
|
}[columns];
|
|
24619
|
-
|
|
24727
|
+
React87__default.useCallback(() => {
|
|
24620
24728
|
if (collapsible) {
|
|
24621
24729
|
setCollapsed((prev) => !prev);
|
|
24622
24730
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -25661,7 +25769,7 @@ var init_Flex = __esm({
|
|
|
25661
25769
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
25662
25770
|
}
|
|
25663
25771
|
}
|
|
25664
|
-
return
|
|
25772
|
+
return React87__default.createElement(Component, {
|
|
25665
25773
|
className: cn(
|
|
25666
25774
|
inline ? "inline-flex" : "flex",
|
|
25667
25775
|
directionStyles[direction],
|
|
@@ -25780,7 +25888,7 @@ var init_Grid = __esm({
|
|
|
25780
25888
|
as: Component = "div"
|
|
25781
25889
|
}) => {
|
|
25782
25890
|
const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
|
|
25783
|
-
return
|
|
25891
|
+
return React87__default.createElement(
|
|
25784
25892
|
Component,
|
|
25785
25893
|
{
|
|
25786
25894
|
className: cn(
|
|
@@ -26012,9 +26120,9 @@ var init_Popover = __esm({
|
|
|
26012
26120
|
onMouseLeave: handleClose,
|
|
26013
26121
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
26014
26122
|
};
|
|
26015
|
-
const childElement =
|
|
26123
|
+
const childElement = React87__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
26016
26124
|
const childPointerDown = childElement.props.onPointerDown;
|
|
26017
|
-
const triggerElement =
|
|
26125
|
+
const triggerElement = React87__default.cloneElement(
|
|
26018
26126
|
childElement,
|
|
26019
26127
|
{
|
|
26020
26128
|
ref: triggerRef,
|
|
@@ -26623,9 +26731,9 @@ var init_Tooltip = __esm({
|
|
|
26623
26731
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
26624
26732
|
};
|
|
26625
26733
|
}, []);
|
|
26626
|
-
const triggerElement =
|
|
26734
|
+
const triggerElement = React87__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
26627
26735
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
26628
|
-
const trigger =
|
|
26736
|
+
const trigger = React87__default.cloneElement(triggerElement, {
|
|
26629
26737
|
ref: triggerRef,
|
|
26630
26738
|
onMouseEnter: handleMouseEnter,
|
|
26631
26739
|
onMouseLeave: handleMouseLeave,
|
|
@@ -26715,7 +26823,7 @@ var init_WizardProgress = __esm({
|
|
|
26715
26823
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
26716
26824
|
const isActive = index === currentStep;
|
|
26717
26825
|
const isCompleted = index < currentStep;
|
|
26718
|
-
return /* @__PURE__ */ jsxs(
|
|
26826
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
26719
26827
|
/* @__PURE__ */ jsx(
|
|
26720
26828
|
"button",
|
|
26721
26829
|
{
|
|
@@ -28350,13 +28458,13 @@ var init_MapView = __esm({
|
|
|
28350
28458
|
shadowSize: [41, 41]
|
|
28351
28459
|
});
|
|
28352
28460
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
28353
|
-
const { useEffect:
|
|
28461
|
+
const { useEffect: useEffect63, useRef: useRef62, useCallback: useCallback96, useState: useState94 } = React87__default;
|
|
28354
28462
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
28355
28463
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
28356
28464
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
28357
28465
|
const map = useMap();
|
|
28358
|
-
const prevRef =
|
|
28359
|
-
|
|
28466
|
+
const prevRef = useRef62({ centerLat, centerLng, zoom });
|
|
28467
|
+
useEffect63(() => {
|
|
28360
28468
|
const prev = prevRef.current;
|
|
28361
28469
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
28362
28470
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -28367,7 +28475,7 @@ var init_MapView = __esm({
|
|
|
28367
28475
|
}
|
|
28368
28476
|
function MapClickHandler({ onMapClick }) {
|
|
28369
28477
|
const map = useMap();
|
|
28370
|
-
|
|
28478
|
+
useEffect63(() => {
|
|
28371
28479
|
if (!onMapClick) return;
|
|
28372
28480
|
const handler = (e) => {
|
|
28373
28481
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -28395,8 +28503,8 @@ var init_MapView = __esm({
|
|
|
28395
28503
|
showAttribution = true
|
|
28396
28504
|
}) {
|
|
28397
28505
|
const eventBus = useEventBus2();
|
|
28398
|
-
const [clickedPosition, setClickedPosition] =
|
|
28399
|
-
const handleMapClick =
|
|
28506
|
+
const [clickedPosition, setClickedPosition] = useState94(null);
|
|
28507
|
+
const handleMapClick = useCallback96((lat, lng) => {
|
|
28400
28508
|
if (showClickedPin) {
|
|
28401
28509
|
setClickedPosition({ lat, lng });
|
|
28402
28510
|
}
|
|
@@ -28405,7 +28513,7 @@ var init_MapView = __esm({
|
|
|
28405
28513
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
28406
28514
|
}
|
|
28407
28515
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
28408
|
-
const handleMarkerClick =
|
|
28516
|
+
const handleMarkerClick = useCallback96((marker) => {
|
|
28409
28517
|
onMarkerClick?.(marker);
|
|
28410
28518
|
if (markerClickEvent) {
|
|
28411
28519
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -29268,8 +29376,8 @@ function TableView({
|
|
|
29268
29376
|
}) {
|
|
29269
29377
|
const eventBus = useEventBus();
|
|
29270
29378
|
const { t } = useTranslate();
|
|
29271
|
-
const [visibleCount, setVisibleCount] =
|
|
29272
|
-
const [localSelected, setLocalSelected] =
|
|
29379
|
+
const [visibleCount, setVisibleCount] = React87__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
29380
|
+
const [localSelected, setLocalSelected] = React87__default.useState(/* @__PURE__ */ new Set());
|
|
29273
29381
|
const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
|
|
29274
29382
|
const actionDefs = Array.isArray(itemActions) ? itemActions : [];
|
|
29275
29383
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
@@ -29291,7 +29399,7 @@ function TableView({
|
|
|
29291
29399
|
const hasRenderProp = typeof children === "function";
|
|
29292
29400
|
const idField = dndItemIdField ?? "id";
|
|
29293
29401
|
const isCoarsePointer = useMediaQuery("(pointer: coarse)");
|
|
29294
|
-
|
|
29402
|
+
React87__default.useEffect(() => {
|
|
29295
29403
|
tableViewLog.debug("render", {
|
|
29296
29404
|
rowCount: data.length,
|
|
29297
29405
|
colCount: colDefs.length,
|
|
@@ -29348,7 +29456,7 @@ function TableView({
|
|
|
29348
29456
|
};
|
|
29349
29457
|
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
29350
29458
|
};
|
|
29351
|
-
const colFloors =
|
|
29459
|
+
const colFloors = React87__default.useMemo(
|
|
29352
29460
|
() => colDefs.map((col) => {
|
|
29353
29461
|
const longest = data.reduce((widest, row) => {
|
|
29354
29462
|
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
@@ -29510,12 +29618,12 @@ function TableView({
|
|
|
29510
29618
|
]
|
|
29511
29619
|
}
|
|
29512
29620
|
);
|
|
29513
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
29621
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React87__default.Fragment, { children: rowInner }, id);
|
|
29514
29622
|
};
|
|
29515
29623
|
const items = Array.from(data);
|
|
29516
29624
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
29517
29625
|
let runningIndex = 0;
|
|
29518
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
29626
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
29519
29627
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
29520
29628
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
29521
29629
|
] }, gi)) });
|
|
@@ -30878,7 +30986,7 @@ var init_StepFlow = __esm({
|
|
|
30878
30986
|
className
|
|
30879
30987
|
}) => {
|
|
30880
30988
|
if (orientation === "vertical") {
|
|
30881
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
30989
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React87__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
30882
30990
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
30883
30991
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30884
30992
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -30889,7 +30997,7 @@ var init_StepFlow = __esm({
|
|
|
30889
30997
|
] })
|
|
30890
30998
|
] }) }, index)) });
|
|
30891
30999
|
}
|
|
30892
|
-
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(
|
|
31000
|
+
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(React87__default.Fragment, { children: [
|
|
30893
31001
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
30894
31002
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30895
31003
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -31879,7 +31987,7 @@ var init_LikertScale = __esm({
|
|
|
31879
31987
|
md: "text-base",
|
|
31880
31988
|
lg: "text-lg"
|
|
31881
31989
|
};
|
|
31882
|
-
LikertScale =
|
|
31990
|
+
LikertScale = React87__default.forwardRef(
|
|
31883
31991
|
({
|
|
31884
31992
|
question,
|
|
31885
31993
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -31891,7 +31999,7 @@ var init_LikertScale = __esm({
|
|
|
31891
31999
|
variant = "radios",
|
|
31892
32000
|
className
|
|
31893
32001
|
}, ref) => {
|
|
31894
|
-
const groupId =
|
|
32002
|
+
const groupId = React87__default.useId();
|
|
31895
32003
|
const eventBus = useEventBus();
|
|
31896
32004
|
const handleSelect = useCallback(
|
|
31897
32005
|
(next) => {
|
|
@@ -34180,7 +34288,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
34180
34288
|
"aria-label": t("aria.breadcrumb"),
|
|
34181
34289
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
34182
34290
|
const isLast = idx === items.length - 1;
|
|
34183
|
-
return /* @__PURE__ */ jsxs(
|
|
34291
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
34184
34292
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
34185
34293
|
Icon,
|
|
34186
34294
|
{
|
|
@@ -35049,7 +35157,7 @@ var init_MiniStateMachine = __esm({
|
|
|
35049
35157
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
35050
35158
|
const tc = transitionCounts[s.name] ?? 0;
|
|
35051
35159
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
35052
|
-
return /* @__PURE__ */ jsxs(
|
|
35160
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
35053
35161
|
/* @__PURE__ */ jsx(
|
|
35054
35162
|
AvlState,
|
|
35055
35163
|
{
|
|
@@ -35253,7 +35361,7 @@ var init_PageHeader = __esm({
|
|
|
35253
35361
|
info: "bg-info/10 text-info"
|
|
35254
35362
|
};
|
|
35255
35363
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
35256
|
-
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(
|
|
35364
|
+
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(React87__default.Fragment, { children: [
|
|
35257
35365
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
35258
35366
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
35259
35367
|
"a",
|
|
@@ -35611,7 +35719,7 @@ var init_Section = __esm({
|
|
|
35611
35719
|
as: Component = "section"
|
|
35612
35720
|
}) => {
|
|
35613
35721
|
const hasHeader = title || description || action;
|
|
35614
|
-
return
|
|
35722
|
+
return React87__default.createElement(
|
|
35615
35723
|
Component,
|
|
35616
35724
|
{
|
|
35617
35725
|
className: cn(
|
|
@@ -35985,7 +36093,7 @@ var init_WizardContainer = __esm({
|
|
|
35985
36093
|
const isCompleted = index < currentStep;
|
|
35986
36094
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
35987
36095
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
35988
|
-
return /* @__PURE__ */ jsxs(
|
|
36096
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
35989
36097
|
/* @__PURE__ */ jsx(
|
|
35990
36098
|
Button,
|
|
35991
36099
|
{
|
|
@@ -37772,7 +37880,7 @@ var init_ImportPreviewTree = __esm({
|
|
|
37772
37880
|
const renderUnit = (unit, childrenByParent, depth) => {
|
|
37773
37881
|
const summary = fieldSummary(unit);
|
|
37774
37882
|
const children = childrenByParent.get(unit.ref) ?? [];
|
|
37775
|
-
return /* @__PURE__ */ jsxs(
|
|
37883
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
37776
37884
|
/* @__PURE__ */ jsxs(
|
|
37777
37885
|
Box,
|
|
37778
37886
|
{
|
|
@@ -37869,7 +37977,7 @@ var init_ImportProgress = __esm({
|
|
|
37869
37977
|
PIPELINE.map((key, index) => {
|
|
37870
37978
|
const isComplete = index < currentIndex;
|
|
37871
37979
|
const isActive = index === currentIndex;
|
|
37872
|
-
return /* @__PURE__ */ jsxs(
|
|
37980
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
37873
37981
|
index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
|
|
37874
37982
|
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
|
|
37875
37983
|
/* @__PURE__ */ jsx(
|
|
@@ -38971,30 +39079,8 @@ var init_DetailPanel = __esm({
|
|
|
38971
39079
|
DetailPanel.displayName = "DetailPanel";
|
|
38972
39080
|
}
|
|
38973
39081
|
});
|
|
38974
|
-
function DrawGroup(props) {
|
|
38975
|
-
const register = useContext(DrawableRegistryContext);
|
|
38976
|
-
if (register) register({ ...props, type: "draw-group" });
|
|
38977
|
-
return null;
|
|
38978
|
-
}
|
|
38979
|
-
var init_DrawGroup = __esm({
|
|
38980
|
-
"components/game/atoms/DrawGroup.tsx"() {
|
|
38981
|
-
"use client";
|
|
38982
|
-
init_registry();
|
|
38983
|
-
}
|
|
38984
|
-
});
|
|
38985
|
-
function DrawMesh(props) {
|
|
38986
|
-
const register = useContext(DrawableRegistryContext);
|
|
38987
|
-
if (register) register({ ...props, type: "draw-mesh" });
|
|
38988
|
-
return null;
|
|
38989
|
-
}
|
|
38990
|
-
var init_DrawMesh = __esm({
|
|
38991
|
-
"components/game/atoms/DrawMesh.tsx"() {
|
|
38992
|
-
"use client";
|
|
38993
|
-
init_registry();
|
|
38994
|
-
}
|
|
38995
|
-
});
|
|
38996
39082
|
function extractTitle(children) {
|
|
38997
|
-
if (!
|
|
39083
|
+
if (!React87__default.isValidElement(children)) return void 0;
|
|
38998
39084
|
const props = children.props;
|
|
38999
39085
|
if (typeof props.title === "string") {
|
|
39000
39086
|
return props.title;
|
|
@@ -39344,12 +39430,12 @@ var init_Form = __esm({
|
|
|
39344
39430
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
39345
39431
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
39346
39432
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
39347
|
-
const normalizedInitialData =
|
|
39433
|
+
const normalizedInitialData = React87__default.useMemo(() => {
|
|
39348
39434
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
39349
39435
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
39350
39436
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
39351
39437
|
}, [entity, initialData]);
|
|
39352
|
-
const entityDerivedFields =
|
|
39438
|
+
const entityDerivedFields = React87__default.useMemo(() => {
|
|
39353
39439
|
if (fields && fields.length > 0) return void 0;
|
|
39354
39440
|
if (!resolvedEntity) return void 0;
|
|
39355
39441
|
return resolvedEntity.fields.map(
|
|
@@ -39370,16 +39456,16 @@ var init_Form = __esm({
|
|
|
39370
39456
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
39371
39457
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
39372
39458
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
39373
|
-
const [formData, setFormData] =
|
|
39459
|
+
const [formData, setFormData] = React87__default.useState(
|
|
39374
39460
|
normalizedInitialData
|
|
39375
39461
|
);
|
|
39376
|
-
const [collapsedSections, setCollapsedSections] =
|
|
39462
|
+
const [collapsedSections, setCollapsedSections] = React87__default.useState(
|
|
39377
39463
|
/* @__PURE__ */ new Set()
|
|
39378
39464
|
);
|
|
39379
|
-
const [submitError, setSubmitError] =
|
|
39380
|
-
const formRef =
|
|
39465
|
+
const [submitError, setSubmitError] = React87__default.useState(null);
|
|
39466
|
+
const formRef = React87__default.useRef(null);
|
|
39381
39467
|
const formMode = props.mode;
|
|
39382
|
-
const mountedRef =
|
|
39468
|
+
const mountedRef = React87__default.useRef(false);
|
|
39383
39469
|
if (!mountedRef.current) {
|
|
39384
39470
|
mountedRef.current = true;
|
|
39385
39471
|
debug("forms", "mount", {
|
|
@@ -39392,7 +39478,7 @@ var init_Form = __esm({
|
|
|
39392
39478
|
});
|
|
39393
39479
|
}
|
|
39394
39480
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
39395
|
-
const evalContext =
|
|
39481
|
+
const evalContext = React87__default.useMemo(
|
|
39396
39482
|
() => ({
|
|
39397
39483
|
formValues: formData,
|
|
39398
39484
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -39401,7 +39487,7 @@ var init_Form = __esm({
|
|
|
39401
39487
|
}),
|
|
39402
39488
|
[formData, externalContext]
|
|
39403
39489
|
);
|
|
39404
|
-
|
|
39490
|
+
React87__default.useEffect(() => {
|
|
39405
39491
|
debug("forms", "initialData-sync", {
|
|
39406
39492
|
mode: formMode,
|
|
39407
39493
|
normalizedInitialData,
|
|
@@ -39412,7 +39498,7 @@ var init_Form = __esm({
|
|
|
39412
39498
|
setFormData(normalizedInitialData);
|
|
39413
39499
|
}
|
|
39414
39500
|
}, [normalizedInitialData]);
|
|
39415
|
-
const processCalculations =
|
|
39501
|
+
const processCalculations = React87__default.useCallback(
|
|
39416
39502
|
(changedFieldId, newFormData) => {
|
|
39417
39503
|
if (!hiddenCalculations.length) return;
|
|
39418
39504
|
const context = {
|
|
@@ -39437,7 +39523,7 @@ var init_Form = __esm({
|
|
|
39437
39523
|
},
|
|
39438
39524
|
[hiddenCalculations, externalContext, eventBus]
|
|
39439
39525
|
);
|
|
39440
|
-
const checkViolations =
|
|
39526
|
+
const checkViolations = React87__default.useCallback(
|
|
39441
39527
|
(changedFieldId, newFormData) => {
|
|
39442
39528
|
if (!violationTriggers.length) return;
|
|
39443
39529
|
const context = {
|
|
@@ -39475,7 +39561,7 @@ var init_Form = __esm({
|
|
|
39475
39561
|
processCalculations(name, newFormData);
|
|
39476
39562
|
checkViolations(name, newFormData);
|
|
39477
39563
|
};
|
|
39478
|
-
const isFieldVisible =
|
|
39564
|
+
const isFieldVisible = React87__default.useCallback(
|
|
39479
39565
|
(fieldName) => {
|
|
39480
39566
|
const condition = conditionalFields[fieldName];
|
|
39481
39567
|
if (!condition) return true;
|
|
@@ -39483,7 +39569,7 @@ var init_Form = __esm({
|
|
|
39483
39569
|
},
|
|
39484
39570
|
[conditionalFields, evalContext]
|
|
39485
39571
|
);
|
|
39486
|
-
const isSectionVisible =
|
|
39572
|
+
const isSectionVisible = React87__default.useCallback(
|
|
39487
39573
|
(section) => {
|
|
39488
39574
|
if (!section.condition) return true;
|
|
39489
39575
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -39559,7 +39645,7 @@ var init_Form = __esm({
|
|
|
39559
39645
|
eventBus.emit(`UI:${onCancel}`);
|
|
39560
39646
|
}
|
|
39561
39647
|
};
|
|
39562
|
-
const renderField =
|
|
39648
|
+
const renderField = React87__default.useCallback(
|
|
39563
39649
|
(field) => {
|
|
39564
39650
|
const fieldName = field.name || field.field;
|
|
39565
39651
|
if (!fieldName) return null;
|
|
@@ -39580,7 +39666,7 @@ var init_Form = __esm({
|
|
|
39580
39666
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
39581
39667
|
);
|
|
39582
39668
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
39583
|
-
const normalizedFields =
|
|
39669
|
+
const normalizedFields = React87__default.useMemo(() => {
|
|
39584
39670
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
39585
39671
|
return effectiveFields.map((field) => {
|
|
39586
39672
|
if (typeof field === "string") {
|
|
@@ -39604,7 +39690,7 @@ var init_Form = __esm({
|
|
|
39604
39690
|
return field;
|
|
39605
39691
|
});
|
|
39606
39692
|
}, [effectiveFields, resolvedEntity]);
|
|
39607
|
-
const schemaFields =
|
|
39693
|
+
const schemaFields = React87__default.useMemo(() => {
|
|
39608
39694
|
if (normalizedFields.length === 0) return null;
|
|
39609
39695
|
if (isDebugEnabled()) {
|
|
39610
39696
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -39614,7 +39700,7 @@ var init_Form = __esm({
|
|
|
39614
39700
|
}
|
|
39615
39701
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
39616
39702
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
39617
|
-
const sectionElements =
|
|
39703
|
+
const sectionElements = React87__default.useMemo(() => {
|
|
39618
39704
|
if (!sections || sections.length === 0) return null;
|
|
39619
39705
|
return sections.map((section) => {
|
|
39620
39706
|
if (!isSectionVisible(section)) {
|
|
@@ -40340,7 +40426,7 @@ var init_List = __esm({
|
|
|
40340
40426
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
40341
40427
|
return [];
|
|
40342
40428
|
}, [entity]);
|
|
40343
|
-
const getItemActions =
|
|
40429
|
+
const getItemActions = React87__default.useCallback(
|
|
40344
40430
|
(item) => {
|
|
40345
40431
|
if (!itemActions) return [];
|
|
40346
40432
|
if (typeof itemActions === "function") {
|
|
@@ -40821,7 +40907,7 @@ var init_MediaGallery = __esm({
|
|
|
40821
40907
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
40822
40908
|
);
|
|
40823
40909
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
40824
|
-
const items =
|
|
40910
|
+
const items = React87__default.useMemo(() => {
|
|
40825
40911
|
if (propItems && propItems.length > 0) return propItems;
|
|
40826
40912
|
if (entityData.length === 0) return [];
|
|
40827
40913
|
return entityData.map((record, idx) => {
|
|
@@ -40986,7 +41072,7 @@ var init_MediaGallery = __esm({
|
|
|
40986
41072
|
}
|
|
40987
41073
|
});
|
|
40988
41074
|
function extractTitle2(children) {
|
|
40989
|
-
if (!
|
|
41075
|
+
if (!React87__default.isValidElement(children)) return void 0;
|
|
40990
41076
|
const props = children.props;
|
|
40991
41077
|
if (typeof props.title === "string") {
|
|
40992
41078
|
return props.title;
|
|
@@ -41241,7 +41327,7 @@ var init_debugRegistry = __esm({
|
|
|
41241
41327
|
}
|
|
41242
41328
|
});
|
|
41243
41329
|
function useDebugData() {
|
|
41244
|
-
const [data, setData] =
|
|
41330
|
+
const [data, setData] = React87.useState(() => ({
|
|
41245
41331
|
traits: [],
|
|
41246
41332
|
ticks: [],
|
|
41247
41333
|
guards: [],
|
|
@@ -41255,7 +41341,7 @@ function useDebugData() {
|
|
|
41255
41341
|
},
|
|
41256
41342
|
lastUpdate: Date.now()
|
|
41257
41343
|
}));
|
|
41258
|
-
|
|
41344
|
+
React87.useEffect(() => {
|
|
41259
41345
|
const updateData = () => {
|
|
41260
41346
|
setData({
|
|
41261
41347
|
traits: getAllTraits(),
|
|
@@ -41364,12 +41450,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
41364
41450
|
return positions;
|
|
41365
41451
|
}
|
|
41366
41452
|
function WalkMinimap() {
|
|
41367
|
-
const [walkStep, setWalkStep] =
|
|
41368
|
-
const [traits2, setTraits] =
|
|
41369
|
-
const [coveredEdges, setCoveredEdges] =
|
|
41370
|
-
const [completedTraits, setCompletedTraits] =
|
|
41371
|
-
const prevTraitRef =
|
|
41372
|
-
|
|
41453
|
+
const [walkStep, setWalkStep] = React87.useState(null);
|
|
41454
|
+
const [traits2, setTraits] = React87.useState([]);
|
|
41455
|
+
const [coveredEdges, setCoveredEdges] = React87.useState([]);
|
|
41456
|
+
const [completedTraits, setCompletedTraits] = React87.useState(/* @__PURE__ */ new Set());
|
|
41457
|
+
const prevTraitRef = React87.useRef(null);
|
|
41458
|
+
React87.useEffect(() => {
|
|
41373
41459
|
const interval = setInterval(() => {
|
|
41374
41460
|
const w = window;
|
|
41375
41461
|
const step = w.__orbitalWalkStep;
|
|
@@ -41805,15 +41891,15 @@ var init_EntitiesTab = __esm({
|
|
|
41805
41891
|
});
|
|
41806
41892
|
function EventFlowTab({ events: events2 }) {
|
|
41807
41893
|
const { t } = useTranslate();
|
|
41808
|
-
const [filter, setFilter] =
|
|
41809
|
-
const containerRef =
|
|
41810
|
-
const [autoScroll, setAutoScroll] =
|
|
41811
|
-
|
|
41894
|
+
const [filter, setFilter] = React87.useState("all");
|
|
41895
|
+
const containerRef = React87.useRef(null);
|
|
41896
|
+
const [autoScroll, setAutoScroll] = React87.useState(true);
|
|
41897
|
+
React87.useEffect(() => {
|
|
41812
41898
|
if (autoScroll && containerRef.current) {
|
|
41813
41899
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
41814
41900
|
}
|
|
41815
41901
|
}, [events2.length, autoScroll]);
|
|
41816
|
-
const filteredEvents =
|
|
41902
|
+
const filteredEvents = React87.useMemo(() => {
|
|
41817
41903
|
if (filter === "all") return events2;
|
|
41818
41904
|
return events2.filter((e) => e.type === filter);
|
|
41819
41905
|
}, [events2, filter]);
|
|
@@ -41929,7 +42015,7 @@ var init_EventFlowTab = __esm({
|
|
|
41929
42015
|
});
|
|
41930
42016
|
function GuardsPanel({ guards }) {
|
|
41931
42017
|
const { t } = useTranslate();
|
|
41932
|
-
const [filter, setFilter] =
|
|
42018
|
+
const [filter, setFilter] = React87.useState("all");
|
|
41933
42019
|
if (guards.length === 0) {
|
|
41934
42020
|
return /* @__PURE__ */ jsx(
|
|
41935
42021
|
EmptyState,
|
|
@@ -41942,7 +42028,7 @@ function GuardsPanel({ guards }) {
|
|
|
41942
42028
|
}
|
|
41943
42029
|
const passedCount = guards.filter((g) => g.result).length;
|
|
41944
42030
|
const failedCount = guards.length - passedCount;
|
|
41945
|
-
const filteredGuards =
|
|
42031
|
+
const filteredGuards = React87.useMemo(() => {
|
|
41946
42032
|
if (filter === "all") return guards;
|
|
41947
42033
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
41948
42034
|
return guards.filter((g) => !g.result);
|
|
@@ -42105,10 +42191,10 @@ function EffectBadge({ effect }) {
|
|
|
42105
42191
|
}
|
|
42106
42192
|
function TransitionTimeline({ transitions }) {
|
|
42107
42193
|
const { t } = useTranslate();
|
|
42108
|
-
const containerRef =
|
|
42109
|
-
const [autoScroll, setAutoScroll] =
|
|
42110
|
-
const [expandedId, setExpandedId] =
|
|
42111
|
-
|
|
42194
|
+
const containerRef = React87.useRef(null);
|
|
42195
|
+
const [autoScroll, setAutoScroll] = React87.useState(true);
|
|
42196
|
+
const [expandedId, setExpandedId] = React87.useState(null);
|
|
42197
|
+
React87.useEffect(() => {
|
|
42112
42198
|
if (autoScroll && containerRef.current) {
|
|
42113
42199
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42114
42200
|
}
|
|
@@ -42388,9 +42474,9 @@ function getAllEvents(traits2) {
|
|
|
42388
42474
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
42389
42475
|
const eventBus = useEventBus();
|
|
42390
42476
|
const { t } = useTranslate();
|
|
42391
|
-
const [log13, setLog] =
|
|
42392
|
-
const prevStatesRef =
|
|
42393
|
-
|
|
42477
|
+
const [log13, setLog] = React87.useState([]);
|
|
42478
|
+
const prevStatesRef = React87.useRef(/* @__PURE__ */ new Map());
|
|
42479
|
+
React87.useEffect(() => {
|
|
42394
42480
|
for (const trait of traits2) {
|
|
42395
42481
|
const prev = prevStatesRef.current.get(trait.id);
|
|
42396
42482
|
if (prev && prev !== trait.currentState) {
|
|
@@ -42559,10 +42645,10 @@ function VerifyModePanel({
|
|
|
42559
42645
|
localCount
|
|
42560
42646
|
}) {
|
|
42561
42647
|
const { t } = useTranslate();
|
|
42562
|
-
const [expanded, setExpanded] =
|
|
42563
|
-
const scrollRef =
|
|
42564
|
-
const prevCountRef =
|
|
42565
|
-
|
|
42648
|
+
const [expanded, setExpanded] = React87.useState(true);
|
|
42649
|
+
const scrollRef = React87.useRef(null);
|
|
42650
|
+
const prevCountRef = React87.useRef(0);
|
|
42651
|
+
React87.useEffect(() => {
|
|
42566
42652
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
42567
42653
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
42568
42654
|
}
|
|
@@ -42619,10 +42705,10 @@ function RuntimeDebugger({
|
|
|
42619
42705
|
schema
|
|
42620
42706
|
}) {
|
|
42621
42707
|
const { t } = useTranslate();
|
|
42622
|
-
const [isCollapsed, setIsCollapsed] =
|
|
42623
|
-
const [isVisible, setIsVisible] =
|
|
42708
|
+
const [isCollapsed, setIsCollapsed] = React87.useState(mode === "verify" ? true : defaultCollapsed);
|
|
42709
|
+
const [isVisible, setIsVisible] = React87.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
42624
42710
|
const debugData = useDebugData();
|
|
42625
|
-
|
|
42711
|
+
React87.useEffect(() => {
|
|
42626
42712
|
if (mode === "inline") return;
|
|
42627
42713
|
return onDebugToggle((enabled) => {
|
|
42628
42714
|
setIsVisible(enabled);
|
|
@@ -42631,7 +42717,7 @@ function RuntimeDebugger({
|
|
|
42631
42717
|
}
|
|
42632
42718
|
});
|
|
42633
42719
|
}, [mode]);
|
|
42634
|
-
|
|
42720
|
+
React87.useEffect(() => {
|
|
42635
42721
|
if (mode === "inline") return;
|
|
42636
42722
|
const handleKeyDown = (e) => {
|
|
42637
42723
|
if (e.key === "`" && isVisible) {
|
|
@@ -43151,7 +43237,7 @@ var init_StatCard = __esm({
|
|
|
43151
43237
|
const labelToUse = propLabel ?? propTitle;
|
|
43152
43238
|
const eventBus = useEventBus();
|
|
43153
43239
|
const { t } = useTranslate();
|
|
43154
|
-
const handleActionClick =
|
|
43240
|
+
const handleActionClick = React87__default.useCallback(() => {
|
|
43155
43241
|
if (action?.event) {
|
|
43156
43242
|
eventBus.emit(`UI:${action.event}`, {});
|
|
43157
43243
|
}
|
|
@@ -43162,7 +43248,7 @@ var init_StatCard = __esm({
|
|
|
43162
43248
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
43163
43249
|
const isLoading = externalLoading ?? false;
|
|
43164
43250
|
const error = externalError;
|
|
43165
|
-
const computeMetricValue =
|
|
43251
|
+
const computeMetricValue = React87__default.useCallback(
|
|
43166
43252
|
(metric, items) => {
|
|
43167
43253
|
if (metric.value !== void 0) {
|
|
43168
43254
|
return metric.value;
|
|
@@ -43201,7 +43287,7 @@ var init_StatCard = __esm({
|
|
|
43201
43287
|
},
|
|
43202
43288
|
[]
|
|
43203
43289
|
);
|
|
43204
|
-
const schemaStats =
|
|
43290
|
+
const schemaStats = React87__default.useMemo(() => {
|
|
43205
43291
|
if (!metrics || metrics.length === 0) return null;
|
|
43206
43292
|
return metrics.map((metric) => ({
|
|
43207
43293
|
label: metric.label,
|
|
@@ -43209,7 +43295,7 @@ var init_StatCard = __esm({
|
|
|
43209
43295
|
format: metric.format
|
|
43210
43296
|
}));
|
|
43211
43297
|
}, [metrics, data, computeMetricValue]);
|
|
43212
|
-
const calculatedTrend =
|
|
43298
|
+
const calculatedTrend = React87__default.useMemo(() => {
|
|
43213
43299
|
if (manualTrend !== void 0) return manualTrend;
|
|
43214
43300
|
if (previousValue === void 0 || currentValue === void 0)
|
|
43215
43301
|
return void 0;
|
|
@@ -43849,8 +43935,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
43849
43935
|
] });
|
|
43850
43936
|
};
|
|
43851
43937
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
43852
|
-
const endRef =
|
|
43853
|
-
|
|
43938
|
+
const endRef = React87__default.useRef(null);
|
|
43939
|
+
React87__default.useEffect(() => {
|
|
43854
43940
|
if (!autoScroll) return;
|
|
43855
43941
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
43856
43942
|
}, [activities.length, autoScroll]);
|
|
@@ -43944,7 +44030,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
43944
44030
|
};
|
|
43945
44031
|
SubagentRichCard = ({ subagent }) => {
|
|
43946
44032
|
const { t } = useTranslate();
|
|
43947
|
-
const activities =
|
|
44033
|
+
const activities = React87__default.useMemo(
|
|
43948
44034
|
() => subagentMessagesToActivities(subagent.messages),
|
|
43949
44035
|
[subagent.messages]
|
|
43950
44036
|
);
|
|
@@ -44021,8 +44107,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
44021
44107
|
] });
|
|
44022
44108
|
};
|
|
44023
44109
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
44024
|
-
const endRef =
|
|
44025
|
-
|
|
44110
|
+
const endRef = React87__default.useRef(null);
|
|
44111
|
+
React87__default.useEffect(() => {
|
|
44026
44112
|
if (!autoScroll) return;
|
|
44027
44113
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
44028
44114
|
}, [messages.length, autoScroll]);
|
|
@@ -44457,7 +44543,7 @@ var init_Timeline = __esm({
|
|
|
44457
44543
|
}) => {
|
|
44458
44544
|
const { t } = useTranslate();
|
|
44459
44545
|
const entityData = entity ?? [];
|
|
44460
|
-
const items =
|
|
44546
|
+
const items = React87__default.useMemo(() => {
|
|
44461
44547
|
if (propItems) return propItems;
|
|
44462
44548
|
if (entityData.length === 0) return [];
|
|
44463
44549
|
return entityData.map((record, idx) => {
|
|
@@ -44559,7 +44645,7 @@ var init_Timeline = __esm({
|
|
|
44559
44645
|
}
|
|
44560
44646
|
});
|
|
44561
44647
|
function extractToastProps(children) {
|
|
44562
|
-
if (!
|
|
44648
|
+
if (!React87__default.isValidElement(children)) {
|
|
44563
44649
|
if (typeof children === "string") {
|
|
44564
44650
|
return { message: children };
|
|
44565
44651
|
}
|
|
@@ -44601,7 +44687,7 @@ var init_ToastSlot = __esm({
|
|
|
44601
44687
|
eventBus.emit(`${prefix}CLOSE`);
|
|
44602
44688
|
};
|
|
44603
44689
|
if (!isVisible) return null;
|
|
44604
|
-
const isCustomContent =
|
|
44690
|
+
const isCustomContent = React87__default.isValidElement(children) && !message;
|
|
44605
44691
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
44606
44692
|
Toast,
|
|
44607
44693
|
{
|
|
@@ -45176,7 +45262,7 @@ function SuspenseConfigProvider({
|
|
|
45176
45262
|
config,
|
|
45177
45263
|
children
|
|
45178
45264
|
}) {
|
|
45179
|
-
return
|
|
45265
|
+
return React87__default.createElement(
|
|
45180
45266
|
SuspenseConfigContext.Provider,
|
|
45181
45267
|
{ value: config },
|
|
45182
45268
|
children
|
|
@@ -45218,7 +45304,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
45218
45304
|
}
|
|
45219
45305
|
return { name: field, label: humanizeFieldName(field) };
|
|
45220
45306
|
}
|
|
45221
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
45307
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React87__default.isValidElement(field) && !(field instanceof Date)) {
|
|
45222
45308
|
const obj = field;
|
|
45223
45309
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
45224
45310
|
if (!fieldName) return field;
|
|
@@ -45690,7 +45776,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
45690
45776
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
45691
45777
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
45692
45778
|
}
|
|
45693
|
-
return /* @__PURE__ */ jsx(
|
|
45779
|
+
return /* @__PURE__ */ jsx(React87__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
45694
45780
|
}
|
|
45695
45781
|
if (!child || typeof child !== "object") return null;
|
|
45696
45782
|
const childId = `${parentId}-${index}`;
|
|
@@ -45747,14 +45833,14 @@ function isPatternConfig(value) {
|
|
|
45747
45833
|
if (value === null || value === void 0) return false;
|
|
45748
45834
|
if (typeof value !== "object") return false;
|
|
45749
45835
|
if (Array.isArray(value)) return false;
|
|
45750
|
-
if (
|
|
45836
|
+
if (React87__default.isValidElement(value)) return false;
|
|
45751
45837
|
if (value instanceof Date) return false;
|
|
45752
45838
|
if (typeof value === "function") return false;
|
|
45753
45839
|
const record = value;
|
|
45754
45840
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
45755
45841
|
}
|
|
45756
45842
|
function isPlainConfigObject(value) {
|
|
45757
|
-
if (
|
|
45843
|
+
if (React87__default.isValidElement(value)) return false;
|
|
45758
45844
|
if (value instanceof Date) return false;
|
|
45759
45845
|
const proto = Object.getPrototypeOf(value);
|
|
45760
45846
|
return proto === Object.prototype || proto === null;
|
|
@@ -45895,7 +45981,7 @@ function SlotContentRenderer({
|
|
|
45895
45981
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
45896
45982
|
const slotVal = restProps[slotKey];
|
|
45897
45983
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
45898
|
-
if (
|
|
45984
|
+
if (React87__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
45899
45985
|
const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
|
|
45900
45986
|
if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
45901
45987
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
@@ -45949,7 +46035,7 @@ function SlotContentRenderer({
|
|
|
45949
46035
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
45950
46036
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
45951
46037
|
const sample = resolvedItems[0];
|
|
45952
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
46038
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React87__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
45953
46039
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
45954
46040
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
45955
46041
|
}
|