@almadar/ui 2.22.2 → 2.24.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 +699 -343
- package/dist/avl/index.d.cts +47 -10
- package/dist/avl/index.d.ts +2 -0
- package/dist/avl/index.js +696 -345
- package/dist/components/atoms/PatternTile.d.ts +41 -0
- package/dist/components/atoms/avl/AvlEffect.d.ts +2 -0
- package/dist/components/atoms/avl/AvlState.d.ts +5 -0
- package/dist/components/atoms/avl/index.d.ts +2 -0
- package/dist/components/atoms/avl/types.d.ts +34 -0
- package/dist/components/atoms/index.d.ts +1 -0
- package/dist/components/index.cjs +2136 -1124
- package/dist/components/index.js +1272 -264
- package/dist/components/molecules/EdgeDecoration.d.ts +35 -0
- package/dist/components/molecules/GeometricPattern.d.ts +33 -0
- package/dist/components/molecules/avl/AvlSwimLane.d.ts +10 -0
- package/dist/components/molecules/avl/AvlTransitionLane.d.ts +18 -0
- package/dist/components/molecules/avl/index.d.ts +2 -0
- package/dist/components/molecules/index.d.ts +2 -0
- package/dist/components/organisms/avl/AvlTraitScene.d.ts +3 -3
- package/dist/components/organisms/avl/AvlTransitionScene.d.ts +3 -6
- package/dist/docs/index.cjs +3 -3
- package/dist/docs/index.js +3 -3
- package/dist/illustrations/index.cjs +65 -12
- package/dist/illustrations/index.d.cts +7 -0
- package/dist/illustrations/index.js +65 -12
- package/dist/marketing/index.cjs +1035 -23
- package/dist/marketing/index.d.cts +112 -1
- package/dist/marketing/index.d.ts +6 -0
- package/dist/marketing/index.js +1034 -26
- package/dist/providers/index.cjs +125 -125
- package/dist/providers/index.js +37 -37
- package/dist/runtime/enrichFromResponse.d.ts +1 -1
- package/dist/runtime/index.cjs +1006 -998
- package/dist/runtime/index.js +247 -239
- package/package.json +1 -1
- package/themes/almadar-website.css +36 -34
package/dist/runtime/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React114 from 'react';
|
|
2
|
+
import React114__default, { createContext, useCallback, useState, useRef, useLayoutEffect, useEffect, lazy, useContext, useMemo, Suspense, useId } from 'react';
|
|
3
3
|
import { EventBusContext } from '@almadar/ui/providers';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import '@tanstack/react-query';
|
|
@@ -978,8 +978,8 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
978
978
|
states: trait.states.map((s) => s.name),
|
|
979
979
|
transitions: trait.transitions.flatMap((t) => {
|
|
980
980
|
const froms = Array.isArray(t.from) ? t.from : [t.from];
|
|
981
|
-
return froms.map((
|
|
982
|
-
from:
|
|
981
|
+
return froms.map((f3) => ({
|
|
982
|
+
from: f3,
|
|
983
983
|
to: t.to,
|
|
984
984
|
event: t.event,
|
|
985
985
|
guard: t.guard ? String(t.guard) : void 0
|
|
@@ -1556,7 +1556,7 @@ var positionStyles = {
|
|
|
1556
1556
|
fixed: "fixed",
|
|
1557
1557
|
sticky: "sticky"
|
|
1558
1558
|
};
|
|
1559
|
-
var Box =
|
|
1559
|
+
var Box = React114__default.forwardRef(
|
|
1560
1560
|
({
|
|
1561
1561
|
padding,
|
|
1562
1562
|
paddingX,
|
|
@@ -2590,9 +2590,9 @@ var variantStyles2 = {
|
|
|
2590
2590
|
"active:scale-[var(--active-scale)] active:shadow-[var(--shadow-active)]"
|
|
2591
2591
|
].join(" "),
|
|
2592
2592
|
secondary: [
|
|
2593
|
-
"bg-
|
|
2594
|
-
"border-[length:var(--border-width
|
|
2595
|
-
"hover:bg-[var(--color-
|
|
2593
|
+
"bg-transparent text-[var(--color-accent)]",
|
|
2594
|
+
"border-[length:var(--border-width)] border-[var(--color-accent)]",
|
|
2595
|
+
"hover:bg-[var(--color-accent)] hover:text-white",
|
|
2596
2596
|
"active:scale-[var(--active-scale)]"
|
|
2597
2597
|
].join(" "),
|
|
2598
2598
|
ghost: [
|
|
@@ -2650,7 +2650,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
2650
2650
|
const IconComp = value;
|
|
2651
2651
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
2652
2652
|
}
|
|
2653
|
-
if (
|
|
2653
|
+
if (React114__default.isValidElement(value)) {
|
|
2654
2654
|
return value;
|
|
2655
2655
|
}
|
|
2656
2656
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -2659,7 +2659,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
2659
2659
|
}
|
|
2660
2660
|
return value;
|
|
2661
2661
|
}
|
|
2662
|
-
var Button =
|
|
2662
|
+
var Button = React114__default.forwardRef(
|
|
2663
2663
|
({
|
|
2664
2664
|
className,
|
|
2665
2665
|
variant = "primary",
|
|
@@ -2754,7 +2754,7 @@ var sizeStyles3 = {
|
|
|
2754
2754
|
md: "px-2.5 py-1 text-sm",
|
|
2755
2755
|
lg: "px-3 py-1.5 text-base"
|
|
2756
2756
|
};
|
|
2757
|
-
var Badge =
|
|
2757
|
+
var Badge = React114__default.forwardRef(
|
|
2758
2758
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
2759
2759
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
2760
2760
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -2877,7 +2877,7 @@ var Toast = ({
|
|
|
2877
2877
|
);
|
|
2878
2878
|
};
|
|
2879
2879
|
Toast.displayName = "Toast";
|
|
2880
|
-
var Input =
|
|
2880
|
+
var Input = React114__default.forwardRef(
|
|
2881
2881
|
({
|
|
2882
2882
|
className,
|
|
2883
2883
|
inputType,
|
|
@@ -2989,7 +2989,7 @@ var Input = React112__default.forwardRef(
|
|
|
2989
2989
|
}
|
|
2990
2990
|
);
|
|
2991
2991
|
Input.displayName = "Input";
|
|
2992
|
-
var Label =
|
|
2992
|
+
var Label = React114__default.forwardRef(
|
|
2993
2993
|
({ className, required, children, ...props }, ref) => {
|
|
2994
2994
|
return /* @__PURE__ */ jsxs(
|
|
2995
2995
|
"label",
|
|
@@ -3009,7 +3009,7 @@ var Label = React112__default.forwardRef(
|
|
|
3009
3009
|
}
|
|
3010
3010
|
);
|
|
3011
3011
|
Label.displayName = "Label";
|
|
3012
|
-
var Textarea =
|
|
3012
|
+
var Textarea = React114__default.forwardRef(
|
|
3013
3013
|
({ className, error, ...props }, ref) => {
|
|
3014
3014
|
return /* @__PURE__ */ jsx(
|
|
3015
3015
|
"textarea",
|
|
@@ -3032,7 +3032,7 @@ var Textarea = React112__default.forwardRef(
|
|
|
3032
3032
|
}
|
|
3033
3033
|
);
|
|
3034
3034
|
Textarea.displayName = "Textarea";
|
|
3035
|
-
var Select =
|
|
3035
|
+
var Select = React114__default.forwardRef(
|
|
3036
3036
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
3037
3037
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
3038
3038
|
/* @__PURE__ */ jsxs(
|
|
@@ -3068,7 +3068,7 @@ var Select = React112__default.forwardRef(
|
|
|
3068
3068
|
}
|
|
3069
3069
|
);
|
|
3070
3070
|
Select.displayName = "Select";
|
|
3071
|
-
var Checkbox =
|
|
3071
|
+
var Checkbox = React114__default.forwardRef(
|
|
3072
3072
|
({ className, label, id, ...props }, ref) => {
|
|
3073
3073
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3074
3074
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -3142,7 +3142,7 @@ var shadowStyles2 = {
|
|
|
3142
3142
|
md: "shadow-[var(--shadow-main)]",
|
|
3143
3143
|
lg: "shadow-[var(--shadow-lg)]"
|
|
3144
3144
|
};
|
|
3145
|
-
var Card =
|
|
3145
|
+
var Card = React114__default.forwardRef(
|
|
3146
3146
|
({
|
|
3147
3147
|
className,
|
|
3148
3148
|
variant = "bordered",
|
|
@@ -3178,9 +3178,9 @@ var Card = React112__default.forwardRef(
|
|
|
3178
3178
|
}
|
|
3179
3179
|
);
|
|
3180
3180
|
Card.displayName = "Card";
|
|
3181
|
-
var CardHeader =
|
|
3181
|
+
var CardHeader = React114__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3182
3182
|
CardHeader.displayName = "CardHeader";
|
|
3183
|
-
var CardTitle =
|
|
3183
|
+
var CardTitle = React114__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3184
3184
|
"h3",
|
|
3185
3185
|
{
|
|
3186
3186
|
ref,
|
|
@@ -3193,11 +3193,11 @@ var CardTitle = React112__default.forwardRef(({ className, ...props }, ref) => /
|
|
|
3193
3193
|
}
|
|
3194
3194
|
));
|
|
3195
3195
|
CardTitle.displayName = "CardTitle";
|
|
3196
|
-
var CardContent =
|
|
3196
|
+
var CardContent = React114__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3197
3197
|
CardContent.displayName = "CardContent";
|
|
3198
3198
|
var CardBody = CardContent;
|
|
3199
3199
|
CardBody.displayName = "CardBody";
|
|
3200
|
-
var CardFooter =
|
|
3200
|
+
var CardFooter = React114__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3201
3201
|
"div",
|
|
3202
3202
|
{
|
|
3203
3203
|
ref,
|
|
@@ -3212,7 +3212,7 @@ var sizeStyles4 = {
|
|
|
3212
3212
|
md: "h-6 w-6",
|
|
3213
3213
|
lg: "h-8 w-8"
|
|
3214
3214
|
};
|
|
3215
|
-
var Spinner =
|
|
3215
|
+
var Spinner = React114__default.forwardRef(
|
|
3216
3216
|
({ className, size = "md", ...props }, ref) => {
|
|
3217
3217
|
return /* @__PURE__ */ jsx(
|
|
3218
3218
|
"div",
|
|
@@ -3628,7 +3628,7 @@ var ProgressBar = ({
|
|
|
3628
3628
|
return null;
|
|
3629
3629
|
};
|
|
3630
3630
|
ProgressBar.displayName = "ProgressBar";
|
|
3631
|
-
var Radio =
|
|
3631
|
+
var Radio = React114__default.forwardRef(
|
|
3632
3632
|
({
|
|
3633
3633
|
label,
|
|
3634
3634
|
helperText,
|
|
@@ -3732,7 +3732,7 @@ var Radio = React112__default.forwardRef(
|
|
|
3732
3732
|
}
|
|
3733
3733
|
);
|
|
3734
3734
|
Radio.displayName = "Radio";
|
|
3735
|
-
var Switch =
|
|
3735
|
+
var Switch = React114.forwardRef(
|
|
3736
3736
|
({
|
|
3737
3737
|
checked,
|
|
3738
3738
|
defaultChecked = false,
|
|
@@ -3743,10 +3743,10 @@ var Switch = React112.forwardRef(
|
|
|
3743
3743
|
name,
|
|
3744
3744
|
className
|
|
3745
3745
|
}, ref) => {
|
|
3746
|
-
const [isChecked, setIsChecked] =
|
|
3746
|
+
const [isChecked, setIsChecked] = React114.useState(
|
|
3747
3747
|
checked !== void 0 ? checked : defaultChecked
|
|
3748
3748
|
);
|
|
3749
|
-
|
|
3749
|
+
React114.useEffect(() => {
|
|
3750
3750
|
if (checked !== void 0) {
|
|
3751
3751
|
setIsChecked(checked);
|
|
3752
3752
|
}
|
|
@@ -4111,8 +4111,8 @@ var LawReferenceTooltip = ({
|
|
|
4111
4111
|
position = "top",
|
|
4112
4112
|
className
|
|
4113
4113
|
}) => {
|
|
4114
|
-
const [isVisible, setIsVisible] =
|
|
4115
|
-
const timeoutRef =
|
|
4114
|
+
const [isVisible, setIsVisible] = React114__default.useState(false);
|
|
4115
|
+
const timeoutRef = React114__default.useRef(null);
|
|
4116
4116
|
const handleMouseEnter = () => {
|
|
4117
4117
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4118
4118
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -4121,7 +4121,7 @@ var LawReferenceTooltip = ({
|
|
|
4121
4121
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4122
4122
|
setIsVisible(false);
|
|
4123
4123
|
};
|
|
4124
|
-
|
|
4124
|
+
React114__default.useEffect(() => {
|
|
4125
4125
|
return () => {
|
|
4126
4126
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4127
4127
|
};
|
|
@@ -4309,7 +4309,7 @@ var sizeStyles5 = {
|
|
|
4309
4309
|
md: "w-2.5 h-2.5",
|
|
4310
4310
|
lg: "w-3 h-3"
|
|
4311
4311
|
};
|
|
4312
|
-
var StatusDot =
|
|
4312
|
+
var StatusDot = React114__default.forwardRef(
|
|
4313
4313
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
4314
4314
|
return /* @__PURE__ */ jsx(
|
|
4315
4315
|
"span",
|
|
@@ -4356,7 +4356,7 @@ var iconMap2 = {
|
|
|
4356
4356
|
down: TrendingDown,
|
|
4357
4357
|
flat: ArrowRight
|
|
4358
4358
|
};
|
|
4359
|
-
var TrendIndicator =
|
|
4359
|
+
var TrendIndicator = React114__default.forwardRef(
|
|
4360
4360
|
({
|
|
4361
4361
|
className,
|
|
4362
4362
|
value,
|
|
@@ -4415,7 +4415,7 @@ var thumbSizes = {
|
|
|
4415
4415
|
md: "w-4 h-4",
|
|
4416
4416
|
lg: "w-5 h-5"
|
|
4417
4417
|
};
|
|
4418
|
-
var RangeSlider =
|
|
4418
|
+
var RangeSlider = React114__default.forwardRef(
|
|
4419
4419
|
({
|
|
4420
4420
|
className,
|
|
4421
4421
|
min = 0,
|
|
@@ -4865,7 +4865,7 @@ var paddingClasses = {
|
|
|
4865
4865
|
md: "py-16",
|
|
4866
4866
|
lg: "py-24"
|
|
4867
4867
|
};
|
|
4868
|
-
var ContentSection =
|
|
4868
|
+
var ContentSection = React114__default.forwardRef(
|
|
4869
4869
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
4870
4870
|
return /* @__PURE__ */ jsx(
|
|
4871
4871
|
Box,
|
|
@@ -4878,7 +4878,7 @@ var ContentSection = React112__default.forwardRef(
|
|
|
4878
4878
|
paddingClasses[padding],
|
|
4879
4879
|
className
|
|
4880
4880
|
),
|
|
4881
|
-
children
|
|
4881
|
+
children
|
|
4882
4882
|
}
|
|
4883
4883
|
);
|
|
4884
4884
|
}
|
|
@@ -4968,9 +4968,9 @@ function ScoreDisplay({
|
|
|
4968
4968
|
...rest
|
|
4969
4969
|
}) {
|
|
4970
4970
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
4971
|
-
const [displayValue, setDisplayValue] =
|
|
4972
|
-
const [isAnimating, setIsAnimating] =
|
|
4973
|
-
|
|
4971
|
+
const [displayValue, setDisplayValue] = React114.useState(resolvedValue);
|
|
4972
|
+
const [isAnimating, setIsAnimating] = React114.useState(false);
|
|
4973
|
+
React114.useEffect(() => {
|
|
4974
4974
|
if (!animated || displayValue === resolvedValue) {
|
|
4975
4975
|
setDisplayValue(resolvedValue);
|
|
4976
4976
|
return;
|
|
@@ -5043,9 +5043,9 @@ function ControlButton({
|
|
|
5043
5043
|
className
|
|
5044
5044
|
}) {
|
|
5045
5045
|
const eventBus = useEventBus();
|
|
5046
|
-
const [isPressed, setIsPressed] =
|
|
5046
|
+
const [isPressed, setIsPressed] = React114.useState(false);
|
|
5047
5047
|
const actualPressed = pressed ?? isPressed;
|
|
5048
|
-
const handlePointerDown =
|
|
5048
|
+
const handlePointerDown = React114.useCallback(
|
|
5049
5049
|
(e) => {
|
|
5050
5050
|
e.preventDefault();
|
|
5051
5051
|
if (disabled) return;
|
|
@@ -5055,7 +5055,7 @@ function ControlButton({
|
|
|
5055
5055
|
},
|
|
5056
5056
|
[disabled, pressEvent, eventBus, onPress]
|
|
5057
5057
|
);
|
|
5058
|
-
const handlePointerUp =
|
|
5058
|
+
const handlePointerUp = React114.useCallback(
|
|
5059
5059
|
(e) => {
|
|
5060
5060
|
e.preventDefault();
|
|
5061
5061
|
if (disabled) return;
|
|
@@ -5065,7 +5065,7 @@ function ControlButton({
|
|
|
5065
5065
|
},
|
|
5066
5066
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
5067
5067
|
);
|
|
5068
|
-
const handlePointerLeave =
|
|
5068
|
+
const handlePointerLeave = React114.useCallback(
|
|
5069
5069
|
(e) => {
|
|
5070
5070
|
if (isPressed) {
|
|
5071
5071
|
setIsPressed(false);
|
|
@@ -5855,9 +5855,9 @@ function MiniMap({
|
|
|
5855
5855
|
viewportRect,
|
|
5856
5856
|
className
|
|
5857
5857
|
}) {
|
|
5858
|
-
const canvasRef =
|
|
5859
|
-
const frameRef =
|
|
5860
|
-
|
|
5858
|
+
const canvasRef = React114.useRef(null);
|
|
5859
|
+
const frameRef = React114.useRef(0);
|
|
5860
|
+
React114.useEffect(() => {
|
|
5861
5861
|
const canvas = canvasRef.current;
|
|
5862
5862
|
if (!canvas) return;
|
|
5863
5863
|
const ctx = canvas.getContext("2d");
|
|
@@ -5966,7 +5966,7 @@ var ErrorState = ({
|
|
|
5966
5966
|
);
|
|
5967
5967
|
};
|
|
5968
5968
|
ErrorState.displayName = "ErrorState";
|
|
5969
|
-
var ErrorBoundary = class extends
|
|
5969
|
+
var ErrorBoundary = class extends React114__default.Component {
|
|
5970
5970
|
constructor(props) {
|
|
5971
5971
|
super(props);
|
|
5972
5972
|
__publicField(this, "reset", () => {
|
|
@@ -6329,8 +6329,8 @@ var Tooltip = ({
|
|
|
6329
6329
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
6330
6330
|
};
|
|
6331
6331
|
}, []);
|
|
6332
|
-
const triggerElement =
|
|
6333
|
-
const trigger =
|
|
6332
|
+
const triggerElement = React114__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
6333
|
+
const trigger = React114__default.cloneElement(triggerElement, {
|
|
6334
6334
|
ref: triggerRef,
|
|
6335
6335
|
onMouseEnter: handleMouseEnter,
|
|
6336
6336
|
onMouseLeave: handleMouseLeave,
|
|
@@ -6443,8 +6443,8 @@ var Popover = ({
|
|
|
6443
6443
|
onMouseEnter: handleOpen,
|
|
6444
6444
|
onMouseLeave: handleClose
|
|
6445
6445
|
};
|
|
6446
|
-
const childElement =
|
|
6447
|
-
const triggerElement =
|
|
6446
|
+
const childElement = React114__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
6447
|
+
const triggerElement = React114__default.cloneElement(
|
|
6448
6448
|
childElement,
|
|
6449
6449
|
{
|
|
6450
6450
|
ref: triggerRef,
|
|
@@ -6548,8 +6548,8 @@ var Menu = ({
|
|
|
6548
6548
|
"bottom-start": "top-full left-0 mt-2",
|
|
6549
6549
|
"bottom-end": "top-full right-0 mt-2"
|
|
6550
6550
|
};
|
|
6551
|
-
const triggerChild =
|
|
6552
|
-
const triggerElement =
|
|
6551
|
+
const triggerChild = React114__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
|
|
6552
|
+
const triggerElement = React114__default.cloneElement(
|
|
6553
6553
|
triggerChild,
|
|
6554
6554
|
{
|
|
6555
6555
|
ref: triggerRef,
|
|
@@ -7249,7 +7249,7 @@ function InputPattern({
|
|
|
7249
7249
|
className
|
|
7250
7250
|
}) {
|
|
7251
7251
|
const { emit } = useEventBus();
|
|
7252
|
-
const [localValue, setLocalValue] =
|
|
7252
|
+
const [localValue, setLocalValue] = React114__default.useState(value);
|
|
7253
7253
|
const handleChange = (e) => {
|
|
7254
7254
|
setLocalValue(e.target.value);
|
|
7255
7255
|
if (onChange) {
|
|
@@ -7286,7 +7286,7 @@ function TextareaPattern({
|
|
|
7286
7286
|
className
|
|
7287
7287
|
}) {
|
|
7288
7288
|
const { emit } = useEventBus();
|
|
7289
|
-
const [localValue, setLocalValue] =
|
|
7289
|
+
const [localValue, setLocalValue] = React114__default.useState(value);
|
|
7290
7290
|
const handleChange = (e) => {
|
|
7291
7291
|
setLocalValue(e.target.value);
|
|
7292
7292
|
if (onChange) {
|
|
@@ -7317,7 +7317,7 @@ function SelectPattern({
|
|
|
7317
7317
|
className
|
|
7318
7318
|
}) {
|
|
7319
7319
|
const { emit } = useEventBus();
|
|
7320
|
-
const [localValue, setLocalValue] =
|
|
7320
|
+
const [localValue, setLocalValue] = React114__default.useState(value);
|
|
7321
7321
|
const handleChange = (e) => {
|
|
7322
7322
|
setLocalValue(e.target.value);
|
|
7323
7323
|
if (onChange) {
|
|
@@ -7346,7 +7346,7 @@ function CheckboxPattern({
|
|
|
7346
7346
|
className
|
|
7347
7347
|
}) {
|
|
7348
7348
|
const { emit } = useEventBus();
|
|
7349
|
-
const [localChecked, setLocalChecked] =
|
|
7349
|
+
const [localChecked, setLocalChecked] = React114__default.useState(checked);
|
|
7350
7350
|
const handleChange = (e) => {
|
|
7351
7351
|
setLocalChecked(e.target.checked);
|
|
7352
7352
|
if (onChange) {
|
|
@@ -7547,8 +7547,8 @@ function ActionButtons({
|
|
|
7547
7547
|
disabled
|
|
7548
7548
|
}) {
|
|
7549
7549
|
const eventBus = useEventBus();
|
|
7550
|
-
const [activeButtons, setActiveButtons] =
|
|
7551
|
-
const handlePress =
|
|
7550
|
+
const [activeButtons, setActiveButtons] = React114.useState(/* @__PURE__ */ new Set());
|
|
7551
|
+
const handlePress = React114.useCallback(
|
|
7552
7552
|
(id) => {
|
|
7553
7553
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
7554
7554
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -7556,7 +7556,7 @@ function ActionButtons({
|
|
|
7556
7556
|
},
|
|
7557
7557
|
[actionEvent, eventBus, onAction]
|
|
7558
7558
|
);
|
|
7559
|
-
const handleRelease =
|
|
7559
|
+
const handleRelease = React114.useCallback(
|
|
7560
7560
|
(id) => {
|
|
7561
7561
|
setActiveButtons((prev) => {
|
|
7562
7562
|
const next = new Set(prev);
|
|
@@ -8105,10 +8105,10 @@ function IsometricCanvas({
|
|
|
8105
8105
|
[unitsProp]
|
|
8106
8106
|
);
|
|
8107
8107
|
const features = useMemo(
|
|
8108
|
-
() => featuresProp.map((
|
|
8109
|
-
if (
|
|
8110
|
-
const raw =
|
|
8111
|
-
return raw.featureType ? { ...
|
|
8108
|
+
() => featuresProp.map((f3) => {
|
|
8109
|
+
if (f3.type) return f3;
|
|
8110
|
+
const raw = f3;
|
|
8111
|
+
return raw.featureType ? { ...f3, type: raw.featureType } : f3;
|
|
8112
8112
|
}),
|
|
8113
8113
|
[featuresProp]
|
|
8114
8114
|
);
|
|
@@ -9220,7 +9220,7 @@ var ScaledDiagram = ({
|
|
|
9220
9220
|
);
|
|
9221
9221
|
};
|
|
9222
9222
|
ScaledDiagram.displayName = "ScaledDiagram";
|
|
9223
|
-
var MarkdownContent =
|
|
9223
|
+
var MarkdownContent = React114__default.memo(
|
|
9224
9224
|
({ content, direction, className }) => {
|
|
9225
9225
|
const { t: _t } = useTranslate();
|
|
9226
9226
|
return /* @__PURE__ */ jsx(
|
|
@@ -9321,7 +9321,7 @@ var MarkdownContent = React112__default.memo(
|
|
|
9321
9321
|
(prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
|
|
9322
9322
|
);
|
|
9323
9323
|
MarkdownContent.displayName = "MarkdownContent";
|
|
9324
|
-
var CodeBlock =
|
|
9324
|
+
var CodeBlock = React114__default.memo(
|
|
9325
9325
|
({
|
|
9326
9326
|
code,
|
|
9327
9327
|
language = "text",
|
|
@@ -10280,7 +10280,7 @@ var StateMachineView = ({
|
|
|
10280
10280
|
style: { top: title ? 30 : 0 },
|
|
10281
10281
|
children: [
|
|
10282
10282
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
10283
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
10283
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React114__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
10284
10284
|
StateNode,
|
|
10285
10285
|
{
|
|
10286
10286
|
state,
|
|
@@ -10714,7 +10714,7 @@ function renderStateMachineToDomData(stateMachine, options = {}, config = DEFAUL
|
|
|
10714
10714
|
const boxHeight = Math.max(80, fieldCount * 22 + 50);
|
|
10715
10715
|
domEntity = {
|
|
10716
10716
|
name: entity.name || "Entity",
|
|
10717
|
-
fields: entity.fields?.map((
|
|
10717
|
+
fields: entity.fields?.map((f3) => typeof f3 === "string" ? f3 : f3.name) || [],
|
|
10718
10718
|
x: 20,
|
|
10719
10719
|
y: height / 2 - boxHeight / 2,
|
|
10720
10720
|
width: boxWidth,
|
|
@@ -10812,7 +10812,7 @@ function extractEntityFields(schema) {
|
|
|
10812
10812
|
if (!schema?.orbitals?.length) return [];
|
|
10813
10813
|
const entity = schema.orbitals[0].entity;
|
|
10814
10814
|
if (!entity?.fields) return [];
|
|
10815
|
-
return entity.fields.map((
|
|
10815
|
+
return entity.fields.map((f3) => f3.name);
|
|
10816
10816
|
}
|
|
10817
10817
|
function toStateMachineDefinition(sm) {
|
|
10818
10818
|
return {
|
|
@@ -12584,7 +12584,7 @@ function getAllEffectSpriteUrls(manifest) {
|
|
|
12584
12584
|
if (manifest.animations) {
|
|
12585
12585
|
for (const frames of Object.values(manifest.animations)) {
|
|
12586
12586
|
if (Array.isArray(frames)) {
|
|
12587
|
-
frames.forEach((
|
|
12587
|
+
frames.forEach((f3) => urls.push(`${base}/${f3}`));
|
|
12588
12588
|
}
|
|
12589
12589
|
}
|
|
12590
12590
|
}
|
|
@@ -12592,7 +12592,7 @@ function getAllEffectSpriteUrls(manifest) {
|
|
|
12592
12592
|
}
|
|
12593
12593
|
|
|
12594
12594
|
// components/organisms/game/utils/combatPresets.ts
|
|
12595
|
-
var
|
|
12595
|
+
var PI2 = Math.PI;
|
|
12596
12596
|
function p(manifest, key) {
|
|
12597
12597
|
const particles = manifest.particles;
|
|
12598
12598
|
if (!particles) return [];
|
|
@@ -12623,8 +12623,8 @@ function createCombatPresets(manifest) {
|
|
|
12623
12623
|
spread: 8,
|
|
12624
12624
|
velocityMin: 40,
|
|
12625
12625
|
velocityMax: 120,
|
|
12626
|
-
angleMin: -
|
|
12627
|
-
angleMax: -
|
|
12626
|
+
angleMin: -PI2 * 0.8,
|
|
12627
|
+
angleMax: -PI2 * 0.2,
|
|
12628
12628
|
gravity: 0,
|
|
12629
12629
|
tint: { r: 255, g: 60, b: 40 },
|
|
12630
12630
|
scaleMin: 0.3,
|
|
@@ -12641,8 +12641,8 @@ function createCombatPresets(manifest) {
|
|
|
12641
12641
|
spread: 12,
|
|
12642
12642
|
velocityMin: 20,
|
|
12643
12643
|
velocityMax: 60,
|
|
12644
|
-
angleMin: -
|
|
12645
|
-
angleMax: -
|
|
12644
|
+
angleMin: -PI2 * 0.9,
|
|
12645
|
+
angleMax: -PI2 * 0.1,
|
|
12646
12646
|
gravity: 120,
|
|
12647
12647
|
tint: { r: 180, g: 140, b: 90 },
|
|
12648
12648
|
scaleMin: 0.15,
|
|
@@ -12659,8 +12659,8 @@ function createCombatPresets(manifest) {
|
|
|
12659
12659
|
spread: 5,
|
|
12660
12660
|
velocityMin: 10,
|
|
12661
12661
|
velocityMax: 30,
|
|
12662
|
-
angleMin: -
|
|
12663
|
-
angleMax: -
|
|
12662
|
+
angleMin: -PI2 * 0.7,
|
|
12663
|
+
angleMax: -PI2 * 0.3,
|
|
12664
12664
|
gravity: 0,
|
|
12665
12665
|
tint: { r: 255, g: 200, b: 150 },
|
|
12666
12666
|
scaleMin: 0.25,
|
|
@@ -12702,8 +12702,8 @@ function createCombatPresets(manifest) {
|
|
|
12702
12702
|
spread: 4,
|
|
12703
12703
|
velocityMin: 60,
|
|
12704
12704
|
velocityMax: 150,
|
|
12705
|
-
angleMin: -
|
|
12706
|
-
angleMax: -
|
|
12705
|
+
angleMin: -PI2 * 0.6,
|
|
12706
|
+
angleMax: -PI2 * 0.4,
|
|
12707
12707
|
gravity: 0,
|
|
12708
12708
|
tint: { r: 255, g: 220, b: 100 },
|
|
12709
12709
|
scaleMin: 0.2,
|
|
@@ -12720,8 +12720,8 @@ function createCombatPresets(manifest) {
|
|
|
12720
12720
|
spread: 3,
|
|
12721
12721
|
velocityMin: 100,
|
|
12722
12722
|
velocityMax: 200,
|
|
12723
|
-
angleMin: -
|
|
12724
|
-
angleMax: -
|
|
12723
|
+
angleMin: -PI2 * 0.55,
|
|
12724
|
+
angleMax: -PI2 * 0.45,
|
|
12725
12725
|
gravity: 0,
|
|
12726
12726
|
tint: { r: 255, g: 200, b: 80 },
|
|
12727
12727
|
scaleMin: 0.15,
|
|
@@ -12738,8 +12738,8 @@ function createCombatPresets(manifest) {
|
|
|
12738
12738
|
spread: 6,
|
|
12739
12739
|
velocityMin: 10,
|
|
12740
12740
|
velocityMax: 30,
|
|
12741
|
-
angleMin: -
|
|
12742
|
-
angleMax: -
|
|
12741
|
+
angleMin: -PI2 * 0.8,
|
|
12742
|
+
angleMax: -PI2 * 0.2,
|
|
12743
12743
|
gravity: -20,
|
|
12744
12744
|
tint: { r: 200, g: 200, b: 200 },
|
|
12745
12745
|
scaleMin: 0.2,
|
|
@@ -12782,7 +12782,7 @@ function createCombatPresets(manifest) {
|
|
|
12782
12782
|
velocityMin: 20,
|
|
12783
12783
|
velocityMax: 80,
|
|
12784
12784
|
angleMin: 0,
|
|
12785
|
-
angleMax:
|
|
12785
|
+
angleMax: PI2 * 2,
|
|
12786
12786
|
gravity: -30,
|
|
12787
12787
|
tint: { r: 180, g: 80, b: 255 },
|
|
12788
12788
|
scaleMin: 0.2,
|
|
@@ -12803,7 +12803,7 @@ function createCombatPresets(manifest) {
|
|
|
12803
12803
|
velocityMin: 30,
|
|
12804
12804
|
velocityMax: 100,
|
|
12805
12805
|
angleMin: 0,
|
|
12806
|
-
angleMax:
|
|
12806
|
+
angleMax: PI2 * 2,
|
|
12807
12807
|
gravity: -15,
|
|
12808
12808
|
tint: { r: 200, g: 120, b: 255 },
|
|
12809
12809
|
scaleMin: 0.1,
|
|
@@ -12821,7 +12821,7 @@ function createCombatPresets(manifest) {
|
|
|
12821
12821
|
spread: 10,
|
|
12822
12822
|
velocityMin: 15,
|
|
12823
12823
|
velocityMax: 50,
|
|
12824
|
-
angleMin: -
|
|
12824
|
+
angleMin: -PI2,
|
|
12825
12825
|
angleMax: 0,
|
|
12826
12826
|
gravity: -40,
|
|
12827
12827
|
tint: { r: 220, g: 180, b: 255 },
|
|
@@ -12870,8 +12870,8 @@ function createCombatPresets(manifest) {
|
|
|
12870
12870
|
spread: 15,
|
|
12871
12871
|
velocityMin: 10,
|
|
12872
12872
|
velocityMax: 40,
|
|
12873
|
-
angleMin: -
|
|
12874
|
-
angleMax: -
|
|
12873
|
+
angleMin: -PI2,
|
|
12874
|
+
angleMax: -PI2 * 0.3,
|
|
12875
12875
|
gravity: -50,
|
|
12876
12876
|
tint: { r: 80, g: 255, b: 120 },
|
|
12877
12877
|
scaleMin: 0.15,
|
|
@@ -12889,8 +12889,8 @@ function createCombatPresets(manifest) {
|
|
|
12889
12889
|
spread: 12,
|
|
12890
12890
|
velocityMin: 15,
|
|
12891
12891
|
velocityMax: 50,
|
|
12892
|
-
angleMin: -
|
|
12893
|
-
angleMax: -
|
|
12892
|
+
angleMin: -PI2 * 0.9,
|
|
12893
|
+
angleMax: -PI2 * 0.1,
|
|
12894
12894
|
gravity: -60,
|
|
12895
12895
|
tint: { r: 100, g: 255, b: 140 },
|
|
12896
12896
|
scaleMin: 0.1,
|
|
@@ -12939,7 +12939,7 @@ function createCombatPresets(manifest) {
|
|
|
12939
12939
|
velocityMin: 10,
|
|
12940
12940
|
velocityMax: 35,
|
|
12941
12941
|
angleMin: 0,
|
|
12942
|
-
angleMax:
|
|
12942
|
+
angleMax: PI2 * 2,
|
|
12943
12943
|
gravity: 0,
|
|
12944
12944
|
tint: { r: 80, g: 160, b: 255 },
|
|
12945
12945
|
scaleMin: 0.12,
|
|
@@ -12988,7 +12988,7 @@ function createCombatPresets(manifest) {
|
|
|
12988
12988
|
velocityMin: 8,
|
|
12989
12989
|
velocityMax: 30,
|
|
12990
12990
|
angleMin: 0,
|
|
12991
|
-
angleMax:
|
|
12991
|
+
angleMax: PI2 * 2,
|
|
12992
12992
|
gravity: 0,
|
|
12993
12993
|
tint: { r: 60, g: 180, b: 255 },
|
|
12994
12994
|
scaleMin: 0.1,
|
|
@@ -13039,7 +13039,7 @@ function createCombatPresets(manifest) {
|
|
|
13039
13039
|
velocityMin: 50,
|
|
13040
13040
|
velocityMax: 150,
|
|
13041
13041
|
angleMin: 0,
|
|
13042
|
-
angleMax:
|
|
13042
|
+
angleMax: PI2 * 2,
|
|
13043
13043
|
gravity: 80,
|
|
13044
13044
|
tint: { r: 255, g: 180, b: 50 },
|
|
13045
13045
|
scaleMin: 0.08,
|
|
@@ -13080,7 +13080,7 @@ function createCombatPresets(manifest) {
|
|
|
13080
13080
|
velocityMin: 60,
|
|
13081
13081
|
velocityMax: 180,
|
|
13082
13082
|
angleMin: 0,
|
|
13083
|
-
angleMax:
|
|
13083
|
+
angleMax: PI2 * 2,
|
|
13084
13084
|
gravity: 60,
|
|
13085
13085
|
tint: { r: 255, g: 120, b: 30 },
|
|
13086
13086
|
scaleMin: 0.15,
|
|
@@ -13098,7 +13098,7 @@ function createCombatPresets(manifest) {
|
|
|
13098
13098
|
velocityMin: 80,
|
|
13099
13099
|
velocityMax: 200,
|
|
13100
13100
|
angleMin: 0,
|
|
13101
|
-
angleMax:
|
|
13101
|
+
angleMax: PI2 * 2,
|
|
13102
13102
|
gravity: 100,
|
|
13103
13103
|
tint: { r: 255, g: 200, b: 60 },
|
|
13104
13104
|
scaleMin: 0.06,
|
|
@@ -13141,7 +13141,7 @@ function createCombatPresets(manifest) {
|
|
|
13141
13141
|
velocityMin: 30,
|
|
13142
13142
|
velocityMax: 100,
|
|
13143
13143
|
angleMin: 0,
|
|
13144
|
-
angleMax:
|
|
13144
|
+
angleMax: PI2 * 2,
|
|
13145
13145
|
gravity: 100,
|
|
13146
13146
|
tint: { r: 140, g: 140, b: 140 },
|
|
13147
13147
|
scaleMin: 0.15,
|
|
@@ -13207,7 +13207,7 @@ function createCombatPresets(manifest) {
|
|
|
13207
13207
|
spread: 15,
|
|
13208
13208
|
velocityMin: 15,
|
|
13209
13209
|
velocityMax: 50,
|
|
13210
|
-
angleMin: -
|
|
13210
|
+
angleMin: -PI2,
|
|
13211
13211
|
angleMax: 0,
|
|
13212
13212
|
gravity: -30,
|
|
13213
13213
|
tint: { r: 255, g: 215, b: 50 },
|
|
@@ -13226,8 +13226,8 @@ function createCombatPresets(manifest) {
|
|
|
13226
13226
|
spread: 8,
|
|
13227
13227
|
velocityMin: 5,
|
|
13228
13228
|
velocityMax: 20,
|
|
13229
|
-
angleMin: -
|
|
13230
|
-
angleMax: -
|
|
13229
|
+
angleMin: -PI2 * 0.7,
|
|
13230
|
+
angleMax: -PI2 * 0.3,
|
|
13231
13231
|
gravity: -20,
|
|
13232
13232
|
tint: { r: 255, g: 230, b: 100 },
|
|
13233
13233
|
scaleMin: 0.2,
|
|
@@ -13275,7 +13275,7 @@ function createCombatPresets(manifest) {
|
|
|
13275
13275
|
spread: 12,
|
|
13276
13276
|
velocityMin: 15,
|
|
13277
13277
|
velocityMax: 40,
|
|
13278
|
-
angleMin: -
|
|
13278
|
+
angleMin: -PI2,
|
|
13279
13279
|
angleMax: 0,
|
|
13280
13280
|
gravity: -20,
|
|
13281
13281
|
tint: { r: 120, g: 40, b: 160 },
|
|
@@ -13293,8 +13293,8 @@ function createCombatPresets(manifest) {
|
|
|
13293
13293
|
spread: 10,
|
|
13294
13294
|
velocityMin: 8,
|
|
13295
13295
|
velocityMax: 25,
|
|
13296
|
-
angleMin: -
|
|
13297
|
-
angleMax: -
|
|
13296
|
+
angleMin: -PI2 * 0.8,
|
|
13297
|
+
angleMax: -PI2 * 0.2,
|
|
13298
13298
|
gravity: -15,
|
|
13299
13299
|
tint: { r: 100, g: 50, b: 140 },
|
|
13300
13300
|
scaleMin: 0.2,
|
|
@@ -13341,7 +13341,7 @@ function createCombatPresets(manifest) {
|
|
|
13341
13341
|
velocityMin: 40,
|
|
13342
13342
|
velocityMax: 140,
|
|
13343
13343
|
angleMin: 0,
|
|
13344
|
-
angleMax:
|
|
13344
|
+
angleMax: PI2 * 2,
|
|
13345
13345
|
gravity: 40,
|
|
13346
13346
|
tint: { r: 255, g: 140, b: 30 },
|
|
13347
13347
|
scaleMin: 0.2,
|
|
@@ -13359,7 +13359,7 @@ function createCombatPresets(manifest) {
|
|
|
13359
13359
|
velocityMin: 60,
|
|
13360
13360
|
velocityMax: 200,
|
|
13361
13361
|
angleMin: 0,
|
|
13362
|
-
angleMax:
|
|
13362
|
+
angleMax: PI2 * 2,
|
|
13363
13363
|
gravity: 60,
|
|
13364
13364
|
tint: { r: 255, g: 180, b: 60 },
|
|
13365
13365
|
scaleMin: 0.06,
|
|
@@ -13813,7 +13813,7 @@ var Pagination = ({
|
|
|
13813
13813
|
Pagination.displayName = "Pagination";
|
|
13814
13814
|
function normalizeFields(fields) {
|
|
13815
13815
|
if (!fields) return [];
|
|
13816
|
-
return fields.map((
|
|
13816
|
+
return fields.map((f3) => typeof f3 === "string" ? f3 : f3.key ?? f3.name ?? "");
|
|
13817
13817
|
}
|
|
13818
13818
|
function fieldLabel(key) {
|
|
13819
13819
|
return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
@@ -13889,8 +13889,8 @@ var CardGrid = ({
|
|
|
13889
13889
|
eventBus.emit("UI:PAGINATE", { page: newPage, pageSize });
|
|
13890
13890
|
};
|
|
13891
13891
|
const titleField = effectiveFieldNames?.[0];
|
|
13892
|
-
const statusField = effectiveFieldNames?.find((
|
|
13893
|
-
const bodyFields = effectiveFieldNames?.filter((
|
|
13892
|
+
const statusField = effectiveFieldNames?.find((f3) => STATUS_FIELDS.has(f3.toLowerCase()));
|
|
13893
|
+
const bodyFields = effectiveFieldNames?.filter((f3) => f3 !== titleField && f3 !== statusField) ?? [];
|
|
13894
13894
|
const primaryActions = itemActions?.filter((a) => a.variant !== "danger") ?? [];
|
|
13895
13895
|
const dangerActions = itemActions?.filter((a) => a.variant === "danger") ?? [];
|
|
13896
13896
|
const handleActionClick = (action, itemData) => (e) => {
|
|
@@ -14300,7 +14300,7 @@ function CastleBoard({
|
|
|
14300
14300
|
const [selectedFeature, setSelectedFeature] = useState(null);
|
|
14301
14301
|
const hoveredFeature = useMemo(() => {
|
|
14302
14302
|
if (!hoveredTile) return null;
|
|
14303
|
-
return features.find((
|
|
14303
|
+
return features.find((f3) => f3.x === hoveredTile.x && f3.y === hoveredTile.y) ?? null;
|
|
14304
14304
|
}, [hoveredTile, features]);
|
|
14305
14305
|
const hoveredUnit = useMemo(() => {
|
|
14306
14306
|
if (!hoveredTile) return null;
|
|
@@ -14315,7 +14315,7 @@ function CastleBoard({
|
|
|
14315
14315
|
[scale, baseOffsetX]
|
|
14316
14316
|
);
|
|
14317
14317
|
const handleTileClick = useCallback((x, y) => {
|
|
14318
|
-
const feature = features.find((
|
|
14318
|
+
const feature = features.find((f3) => f3.x === x && f3.y === y);
|
|
14319
14319
|
if (feature) {
|
|
14320
14320
|
setSelectedFeature(feature);
|
|
14321
14321
|
onFeatureClick?.(feature);
|
|
@@ -15616,7 +15616,7 @@ function CraftingRecipe({
|
|
|
15616
15616
|
className
|
|
15617
15617
|
}) {
|
|
15618
15618
|
const eventBus = useEventBus();
|
|
15619
|
-
const handleCraft =
|
|
15619
|
+
const handleCraft = React114.useCallback(() => {
|
|
15620
15620
|
onCraft?.();
|
|
15621
15621
|
if (craftEvent) {
|
|
15622
15622
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -15633,7 +15633,7 @@ function CraftingRecipe({
|
|
|
15633
15633
|
children: [
|
|
15634
15634
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
15635
15635
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
15636
|
-
return /* @__PURE__ */ jsxs(
|
|
15636
|
+
return /* @__PURE__ */ jsxs(React114.Fragment, { children: [
|
|
15637
15637
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
15638
15638
|
ItemSlot,
|
|
15639
15639
|
{
|
|
@@ -15912,8 +15912,8 @@ function DPad({
|
|
|
15912
15912
|
}) {
|
|
15913
15913
|
const eventBus = useEventBus();
|
|
15914
15914
|
const sizes = sizeMap15[size];
|
|
15915
|
-
const [activeDirections, setActiveDirections] =
|
|
15916
|
-
const handlePress =
|
|
15915
|
+
const [activeDirections, setActiveDirections] = React114.useState(/* @__PURE__ */ new Set());
|
|
15916
|
+
const handlePress = React114.useCallback(
|
|
15917
15917
|
(direction) => {
|
|
15918
15918
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
15919
15919
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -15921,7 +15921,7 @@ function DPad({
|
|
|
15921
15921
|
},
|
|
15922
15922
|
[directionEvent, eventBus, onDirection]
|
|
15923
15923
|
);
|
|
15924
|
-
const handleRelease =
|
|
15924
|
+
const handleRelease = React114.useCallback(
|
|
15925
15925
|
(direction) => {
|
|
15926
15926
|
setActiveDirections((prev) => {
|
|
15927
15927
|
const next = new Set(prev);
|
|
@@ -16395,9 +16395,9 @@ var DataGrid = ({
|
|
|
16395
16395
|
return next;
|
|
16396
16396
|
});
|
|
16397
16397
|
}, [data, selectionEvent, eventBus]);
|
|
16398
|
-
const titleField = fields.find((
|
|
16399
|
-
const badgeFields = fields.filter((
|
|
16400
|
-
const bodyFields = fields.filter((
|
|
16398
|
+
const titleField = fields.find((f3) => f3.variant === "h3" || f3.variant === "h4") ?? fields[0];
|
|
16399
|
+
const badgeFields = fields.filter((f3) => f3.variant === "badge" && f3 !== titleField);
|
|
16400
|
+
const bodyFields = fields.filter((f3) => f3 !== titleField && !badgeFields.includes(f3));
|
|
16401
16401
|
const primaryActions = itemActions?.filter((a) => a.variant !== "danger") ?? [];
|
|
16402
16402
|
const dangerActions = itemActions?.filter((a) => a.variant === "danger") ?? [];
|
|
16403
16403
|
const handleActionClick = (action, itemData) => (e) => {
|
|
@@ -16698,16 +16698,16 @@ var DataList = ({
|
|
|
16698
16698
|
}) => {
|
|
16699
16699
|
const eventBus = useEventBus();
|
|
16700
16700
|
const { t } = useTranslate();
|
|
16701
|
-
const [visibleCount, setVisibleCount] =
|
|
16701
|
+
const [visibleCount, setVisibleCount] = React114__default.useState(pageSize || Infinity);
|
|
16702
16702
|
const fields = fieldsProp ?? columnsProp ?? [];
|
|
16703
16703
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
16704
16704
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
16705
16705
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
16706
|
-
const titleField = fields.find((
|
|
16707
|
-
const badgeFields = fields.filter((
|
|
16708
|
-
const progressFields = fields.filter((
|
|
16706
|
+
const titleField = fields.find((f3) => f3.variant === "h3" || f3.variant === "h4") ?? fields[0];
|
|
16707
|
+
const badgeFields = fields.filter((f3) => f3.variant === "badge" && f3 !== titleField);
|
|
16708
|
+
const progressFields = fields.filter((f3) => f3.variant === "progress");
|
|
16709
16709
|
const bodyFields = fields.filter(
|
|
16710
|
-
(
|
|
16710
|
+
(f3) => f3 !== titleField && !badgeFields.includes(f3) && !progressFields.includes(f3)
|
|
16711
16711
|
);
|
|
16712
16712
|
const handleActionClick = (action, itemData) => (e) => {
|
|
16713
16713
|
e.stopPropagation();
|
|
@@ -16735,14 +16735,14 @@ var DataList = ({
|
|
|
16735
16735
|
const items2 = data.map((item) => item);
|
|
16736
16736
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
16737
16737
|
const contentField = titleField?.name ?? fields[0]?.name ?? "";
|
|
16738
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
16738
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React114__default.Fragment, { children: [
|
|
16739
16739
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
16740
16740
|
group.items.map((itemData, index) => {
|
|
16741
16741
|
const id = itemData.id || `${gi}-${index}`;
|
|
16742
16742
|
const sender = senderField ? String(getNestedValue(itemData, senderField) ?? "") : "";
|
|
16743
16743
|
const isSent = Boolean(currentUser && sender === currentUser);
|
|
16744
16744
|
const content = getNestedValue(itemData, contentField);
|
|
16745
|
-
const timestampField = fields.find((
|
|
16745
|
+
const timestampField = fields.find((f3) => f3.format === "date");
|
|
16746
16746
|
const timestamp = timestampField ? getNestedValue(itemData, timestampField.name) : null;
|
|
16747
16747
|
return /* @__PURE__ */ jsx(
|
|
16748
16748
|
Box,
|
|
@@ -16938,7 +16938,7 @@ var DataList = ({
|
|
|
16938
16938
|
className
|
|
16939
16939
|
),
|
|
16940
16940
|
children: [
|
|
16941
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
16941
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React114__default.Fragment, { children: [
|
|
16942
16942
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
16943
16943
|
group.items.map(
|
|
16944
16944
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -17238,7 +17238,7 @@ var FilterGroup = ({
|
|
|
17238
17238
|
) }, filter.field)),
|
|
17239
17239
|
activeFilterCount > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17240
17240
|
Object.entries(selectedValues).map(([field, value]) => {
|
|
17241
|
-
const filterDef = filters.find((
|
|
17241
|
+
const filterDef = filters.find((f3) => f3.field === field);
|
|
17242
17242
|
return /* @__PURE__ */ jsxs(
|
|
17243
17243
|
Badge,
|
|
17244
17244
|
{
|
|
@@ -17907,7 +17907,7 @@ var WizardProgress = ({
|
|
|
17907
17907
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: steps.map((step, index) => {
|
|
17908
17908
|
const isActive = index === currentStep;
|
|
17909
17909
|
const isCompleted = index < currentStep;
|
|
17910
|
-
return /* @__PURE__ */ jsxs(
|
|
17910
|
+
return /* @__PURE__ */ jsxs(React114__default.Fragment, { children: [
|
|
17911
17911
|
/* @__PURE__ */ jsx(
|
|
17912
17912
|
"button",
|
|
17913
17913
|
{
|
|
@@ -18732,7 +18732,7 @@ function InventoryGrid({
|
|
|
18732
18732
|
const eventBus = useEventBus();
|
|
18733
18733
|
const slotCount = totalSlots ?? items.length;
|
|
18734
18734
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
18735
|
-
const handleSelect =
|
|
18735
|
+
const handleSelect = React114.useCallback(
|
|
18736
18736
|
(id) => {
|
|
18737
18737
|
onSelect?.(id);
|
|
18738
18738
|
if (selectEvent) {
|
|
@@ -18905,15 +18905,15 @@ function GameCanvas2D({
|
|
|
18905
18905
|
fps = 60,
|
|
18906
18906
|
className
|
|
18907
18907
|
}) {
|
|
18908
|
-
const canvasRef =
|
|
18909
|
-
const rafRef =
|
|
18910
|
-
const frameRef =
|
|
18911
|
-
const lastTimeRef =
|
|
18912
|
-
const onDrawRef =
|
|
18908
|
+
const canvasRef = React114.useRef(null);
|
|
18909
|
+
const rafRef = React114.useRef(0);
|
|
18910
|
+
const frameRef = React114.useRef(0);
|
|
18911
|
+
const lastTimeRef = React114.useRef(0);
|
|
18912
|
+
const onDrawRef = React114.useRef(onDraw);
|
|
18913
18913
|
onDrawRef.current = onDraw;
|
|
18914
|
-
const onTickRef =
|
|
18914
|
+
const onTickRef = React114.useRef(onTick);
|
|
18915
18915
|
onTickRef.current = onTick;
|
|
18916
|
-
|
|
18916
|
+
React114.useEffect(() => {
|
|
18917
18917
|
const canvas = canvasRef.current;
|
|
18918
18918
|
if (!canvas) return;
|
|
18919
18919
|
const ctx = canvas.getContext("2d");
|
|
@@ -19166,7 +19166,7 @@ function TurnPanel({
|
|
|
19166
19166
|
className
|
|
19167
19167
|
}) {
|
|
19168
19168
|
const eventBus = useEventBus();
|
|
19169
|
-
const handleAction =
|
|
19169
|
+
const handleAction = React114.useCallback(
|
|
19170
19170
|
(event) => {
|
|
19171
19171
|
if (event) {
|
|
19172
19172
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -19291,7 +19291,7 @@ function UnitCommandBar({
|
|
|
19291
19291
|
className
|
|
19292
19292
|
}) {
|
|
19293
19293
|
const eventBus = useEventBus();
|
|
19294
|
-
const handleCommand =
|
|
19294
|
+
const handleCommand = React114.useCallback(
|
|
19295
19295
|
(event) => {
|
|
19296
19296
|
if (event) {
|
|
19297
19297
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -19750,7 +19750,7 @@ function GameMenu({
|
|
|
19750
19750
|
} catch {
|
|
19751
19751
|
}
|
|
19752
19752
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
19753
|
-
const handleOptionClick =
|
|
19753
|
+
const handleOptionClick = React114.useCallback(
|
|
19754
19754
|
(option) => {
|
|
19755
19755
|
if (option.event && eventBus) {
|
|
19756
19756
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -19873,7 +19873,7 @@ function GameOverScreen({
|
|
|
19873
19873
|
} catch {
|
|
19874
19874
|
}
|
|
19875
19875
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
19876
|
-
const handleActionClick =
|
|
19876
|
+
const handleActionClick = React114.useCallback(
|
|
19877
19877
|
(action) => {
|
|
19878
19878
|
if (action.event && eventBus) {
|
|
19879
19879
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -20904,7 +20904,7 @@ var UploadDropZone = ({
|
|
|
20904
20904
|
if (action) {
|
|
20905
20905
|
eventBus.emit(`UI:${action}`, {
|
|
20906
20906
|
...actionPayload,
|
|
20907
|
-
files: valid.map((
|
|
20907
|
+
files: valid.map((f3) => ({ name: f3.name, size: f3.size, type: f3.type }))
|
|
20908
20908
|
});
|
|
20909
20909
|
}
|
|
20910
20910
|
}
|
|
@@ -22453,19 +22453,19 @@ function renderRichFieldValue(value, fieldName, fieldType) {
|
|
|
22453
22453
|
}
|
|
22454
22454
|
function normalizeFieldDefs(fields) {
|
|
22455
22455
|
if (!fields) return [];
|
|
22456
|
-
return fields.map((
|
|
22457
|
-
if (typeof
|
|
22458
|
-
if ("key" in
|
|
22459
|
-
if ("name" in
|
|
22460
|
-
return String(
|
|
22456
|
+
return fields.map((f3) => {
|
|
22457
|
+
if (typeof f3 === "string") return f3;
|
|
22458
|
+
if ("key" in f3) return f3.key;
|
|
22459
|
+
if ("name" in f3) return f3.name;
|
|
22460
|
+
return String(f3);
|
|
22461
22461
|
});
|
|
22462
22462
|
}
|
|
22463
22463
|
function buildFieldTypeMap(fields) {
|
|
22464
22464
|
const map = {};
|
|
22465
22465
|
if (!fields) return map;
|
|
22466
|
-
for (const
|
|
22467
|
-
if (typeof
|
|
22468
|
-
map[
|
|
22466
|
+
for (const f3 of fields) {
|
|
22467
|
+
if (typeof f3 === "object" && "name" in f3 && "type" in f3) {
|
|
22468
|
+
map[f3.name] = f3.type;
|
|
22469
22469
|
}
|
|
22470
22470
|
}
|
|
22471
22471
|
return map;
|
|
@@ -22545,22 +22545,22 @@ var DetailPanel = ({
|
|
|
22545
22545
|
title = String(normalizedData[primaryField]);
|
|
22546
22546
|
}
|
|
22547
22547
|
const statusFields = effectiveFieldNames.filter(
|
|
22548
|
-
(
|
|
22548
|
+
(f3) => f3.toLowerCase().includes("status") || f3.toLowerCase().includes("priority")
|
|
22549
22549
|
);
|
|
22550
22550
|
const progressFields = effectiveFieldNames.filter(
|
|
22551
|
-
(
|
|
22551
|
+
(f3) => f3.toLowerCase().includes("progress") || f3.toLowerCase().includes("percent")
|
|
22552
22552
|
);
|
|
22553
22553
|
const metricFields = effectiveFieldNames.filter(
|
|
22554
|
-
(
|
|
22554
|
+
(f3) => (f3.toLowerCase().includes("budget") || f3.toLowerCase().includes("cost") || f3.toLowerCase().includes("count")) && !progressFields.includes(f3)
|
|
22555
22555
|
);
|
|
22556
22556
|
const dateFields = effectiveFieldNames.filter(
|
|
22557
|
-
(
|
|
22557
|
+
(f3) => f3.toLowerCase().includes("date") || f3.toLowerCase().includes("time")
|
|
22558
22558
|
);
|
|
22559
22559
|
const descriptionFields = effectiveFieldNames.filter(
|
|
22560
|
-
(
|
|
22560
|
+
(f3) => f3.toLowerCase().includes("description") || f3.toLowerCase().includes("note")
|
|
22561
22561
|
);
|
|
22562
22562
|
const otherFields = effectiveFieldNames.filter(
|
|
22563
|
-
(
|
|
22563
|
+
(f3) => f3 !== primaryField && !statusFields.includes(f3) && !progressFields.includes(f3) && !metricFields.includes(f3) && !dateFields.includes(f3) && !descriptionFields.includes(f3)
|
|
22564
22564
|
);
|
|
22565
22565
|
sections = [];
|
|
22566
22566
|
if (statusFields.length > 0 || otherFields.length > 0) {
|
|
@@ -22713,7 +22713,7 @@ var DetailPanel = ({
|
|
|
22713
22713
|
subtitle && /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: subtitle }),
|
|
22714
22714
|
/* @__PURE__ */ jsxs(HStack, { gap: "xs", wrap: true, children: [
|
|
22715
22715
|
normalizedData && effectiveFieldNames && effectiveFieldNames.filter(
|
|
22716
|
-
(
|
|
22716
|
+
(f3) => f3.toLowerCase().includes("status") || f3.toLowerCase().includes("priority")
|
|
22717
22717
|
).map((field) => {
|
|
22718
22718
|
const value = getNestedValue(normalizedData, field);
|
|
22719
22719
|
if (!value) return null;
|
|
@@ -22729,7 +22729,7 @@ var DetailPanel = ({
|
|
|
22729
22729
|
status && /* @__PURE__ */ jsx(Badge, { variant: status.variant ?? "default", children: status.label })
|
|
22730
22730
|
] }),
|
|
22731
22731
|
normalizedData && effectiveFieldNames && effectiveFieldNames.filter(
|
|
22732
|
-
(
|
|
22732
|
+
(f3) => f3.toLowerCase().includes("progress") || f3.toLowerCase().includes("percent")
|
|
22733
22733
|
).map((field) => {
|
|
22734
22734
|
const value = getNestedValue(normalizedData, field);
|
|
22735
22735
|
if (value === void 0 || value === null || typeof value !== "number")
|
|
@@ -22973,7 +22973,7 @@ var DocumentViewer = ({
|
|
|
22973
22973
|
};
|
|
22974
22974
|
DocumentViewer.displayName = "DocumentViewer";
|
|
22975
22975
|
function extractTitle(children) {
|
|
22976
|
-
if (!
|
|
22976
|
+
if (!React114__default.isValidElement(children)) return void 0;
|
|
22977
22977
|
const props = children.props;
|
|
22978
22978
|
if (typeof props.title === "string") {
|
|
22979
22979
|
return props.title;
|
|
@@ -23025,7 +23025,7 @@ function LinearView({
|
|
|
23025
23025
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
23026
23026
|
const isDone = i < currentIdx;
|
|
23027
23027
|
const isCurrent = i === currentIdx;
|
|
23028
|
-
return /* @__PURE__ */ jsxs(
|
|
23028
|
+
return /* @__PURE__ */ jsxs(React114__default.Fragment, { children: [
|
|
23029
23029
|
i > 0 && /* @__PURE__ */ jsx(
|
|
23030
23030
|
Typography,
|
|
23031
23031
|
{
|
|
@@ -23691,33 +23691,33 @@ var Form = ({
|
|
|
23691
23691
|
const normalizedInitialData = initialData ?? {};
|
|
23692
23692
|
const resolvedEntity = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
23693
23693
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
23694
|
-
const entityDerivedFields =
|
|
23694
|
+
const entityDerivedFields = React114__default.useMemo(() => {
|
|
23695
23695
|
if (fields && fields.length > 0) return void 0;
|
|
23696
23696
|
if (!resolvedEntity) return void 0;
|
|
23697
23697
|
return resolvedEntity.fields.map(
|
|
23698
|
-
(
|
|
23699
|
-
name:
|
|
23700
|
-
type:
|
|
23701
|
-
required:
|
|
23702
|
-
defaultValue:
|
|
23703
|
-
values:
|
|
23704
|
-
min:
|
|
23705
|
-
max:
|
|
23706
|
-
relation:
|
|
23698
|
+
(f3) => ({
|
|
23699
|
+
name: f3.name,
|
|
23700
|
+
type: f3.type,
|
|
23701
|
+
required: f3.required,
|
|
23702
|
+
defaultValue: f3.default,
|
|
23703
|
+
values: f3.values,
|
|
23704
|
+
min: f3.min,
|
|
23705
|
+
max: f3.max,
|
|
23706
|
+
relation: f3.relation ? { entity: f3.relation.entity } : void 0
|
|
23707
23707
|
})
|
|
23708
23708
|
);
|
|
23709
23709
|
}, [entity, fields]);
|
|
23710
23710
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
23711
23711
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
23712
23712
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
23713
|
-
const [formData, setFormData] =
|
|
23713
|
+
const [formData, setFormData] = React114__default.useState(
|
|
23714
23714
|
normalizedInitialData
|
|
23715
23715
|
);
|
|
23716
|
-
const [collapsedSections, setCollapsedSections] =
|
|
23716
|
+
const [collapsedSections, setCollapsedSections] = React114__default.useState(
|
|
23717
23717
|
/* @__PURE__ */ new Set()
|
|
23718
23718
|
);
|
|
23719
23719
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
23720
|
-
const evalContext =
|
|
23720
|
+
const evalContext = React114__default.useMemo(
|
|
23721
23721
|
() => ({
|
|
23722
23722
|
formValues: formData,
|
|
23723
23723
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -23726,13 +23726,13 @@ var Form = ({
|
|
|
23726
23726
|
}),
|
|
23727
23727
|
[formData, externalContext]
|
|
23728
23728
|
);
|
|
23729
|
-
|
|
23729
|
+
React114__default.useEffect(() => {
|
|
23730
23730
|
const data = initialData;
|
|
23731
23731
|
if (data && Object.keys(data).length > 0) {
|
|
23732
23732
|
setFormData(data);
|
|
23733
23733
|
}
|
|
23734
23734
|
}, [initialData]);
|
|
23735
|
-
const processCalculations =
|
|
23735
|
+
const processCalculations = React114__default.useCallback(
|
|
23736
23736
|
(changedFieldId, newFormData) => {
|
|
23737
23737
|
if (!hiddenCalculations.length) return;
|
|
23738
23738
|
const context = {
|
|
@@ -23757,7 +23757,7 @@ var Form = ({
|
|
|
23757
23757
|
},
|
|
23758
23758
|
[hiddenCalculations, externalContext, eventBus]
|
|
23759
23759
|
);
|
|
23760
|
-
const checkViolations =
|
|
23760
|
+
const checkViolations = React114__default.useCallback(
|
|
23761
23761
|
(changedFieldId, newFormData) => {
|
|
23762
23762
|
if (!violationTriggers.length) return;
|
|
23763
23763
|
const context = {
|
|
@@ -23794,7 +23794,7 @@ var Form = ({
|
|
|
23794
23794
|
processCalculations(name, newFormData);
|
|
23795
23795
|
checkViolations(name, newFormData);
|
|
23796
23796
|
};
|
|
23797
|
-
const isFieldVisible =
|
|
23797
|
+
const isFieldVisible = React114__default.useCallback(
|
|
23798
23798
|
(fieldName) => {
|
|
23799
23799
|
const condition = conditionalFields[fieldName];
|
|
23800
23800
|
if (!condition) return true;
|
|
@@ -23802,7 +23802,7 @@ var Form = ({
|
|
|
23802
23802
|
},
|
|
23803
23803
|
[conditionalFields, evalContext]
|
|
23804
23804
|
);
|
|
23805
|
-
const isSectionVisible =
|
|
23805
|
+
const isSectionVisible = React114__default.useCallback(
|
|
23806
23806
|
(section) => {
|
|
23807
23807
|
if (!section.condition) return true;
|
|
23808
23808
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -23834,7 +23834,7 @@ var Form = ({
|
|
|
23834
23834
|
eventBus.emit(`UI:${onCancel}`);
|
|
23835
23835
|
}
|
|
23836
23836
|
};
|
|
23837
|
-
const renderField =
|
|
23837
|
+
const renderField = React114__default.useCallback(
|
|
23838
23838
|
(field) => {
|
|
23839
23839
|
const fieldName = field.name || field.field;
|
|
23840
23840
|
if (!fieldName) return null;
|
|
@@ -23855,11 +23855,11 @@ var Form = ({
|
|
|
23855
23855
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
23856
23856
|
);
|
|
23857
23857
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
23858
|
-
const normalizedFields =
|
|
23858
|
+
const normalizedFields = React114__default.useMemo(() => {
|
|
23859
23859
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
23860
23860
|
return effectiveFields.map((field) => {
|
|
23861
23861
|
if (typeof field === "string") {
|
|
23862
|
-
const entityField = resolvedEntity?.fields?.find((
|
|
23862
|
+
const entityField = resolvedEntity?.fields?.find((f3) => f3.name === field);
|
|
23863
23863
|
if (entityField) {
|
|
23864
23864
|
return {
|
|
23865
23865
|
name: field,
|
|
@@ -23877,7 +23877,7 @@ var Form = ({
|
|
|
23877
23877
|
return field;
|
|
23878
23878
|
});
|
|
23879
23879
|
}, [effectiveFields, resolvedEntity]);
|
|
23880
|
-
const schemaFields =
|
|
23880
|
+
const schemaFields = React114__default.useMemo(() => {
|
|
23881
23881
|
if (normalizedFields.length === 0) return null;
|
|
23882
23882
|
if (isDebugEnabled()) {
|
|
23883
23883
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -23887,7 +23887,7 @@ var Form = ({
|
|
|
23887
23887
|
}
|
|
23888
23888
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
23889
23889
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
23890
|
-
const sectionElements =
|
|
23890
|
+
const sectionElements = React114__default.useMemo(() => {
|
|
23891
23891
|
if (!sections || sections.length === 0) return null;
|
|
23892
23892
|
return sections.map((section) => {
|
|
23893
23893
|
if (!isSectionVisible(section)) {
|
|
@@ -25111,7 +25111,7 @@ var Header = ({
|
|
|
25111
25111
|
Header.displayName = "Header";
|
|
25112
25112
|
function normalizeFields2(fields) {
|
|
25113
25113
|
if (!fields) return [];
|
|
25114
|
-
return fields.map((
|
|
25114
|
+
return fields.map((f3) => typeof f3 === "string" ? f3 : f3.key ?? f3.name ?? "");
|
|
25115
25115
|
}
|
|
25116
25116
|
var STATUS_STYLES2 = {
|
|
25117
25117
|
complete: {
|
|
@@ -25291,7 +25291,7 @@ var List2 = ({
|
|
|
25291
25291
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
25292
25292
|
return [];
|
|
25293
25293
|
}, [entity]);
|
|
25294
|
-
const getItemActions =
|
|
25294
|
+
const getItemActions = React114__default.useCallback(
|
|
25295
25295
|
(item) => {
|
|
25296
25296
|
if (!itemActions) return [];
|
|
25297
25297
|
if (typeof itemActions === "function") {
|
|
@@ -25396,19 +25396,19 @@ var List2 = ({
|
|
|
25396
25396
|
const rowActionPayload = { row: item };
|
|
25397
25397
|
const primaryField = effectiveFieldNames?.[0];
|
|
25398
25398
|
const statusField = effectiveFieldNames?.find(
|
|
25399
|
-
(
|
|
25399
|
+
(f3) => f3.toLowerCase().includes("status")
|
|
25400
25400
|
);
|
|
25401
25401
|
const priorityField = effectiveFieldNames?.find(
|
|
25402
|
-
(
|
|
25402
|
+
(f3) => f3.toLowerCase().includes("priority")
|
|
25403
25403
|
);
|
|
25404
25404
|
const progressField = effectiveFieldNames?.find(
|
|
25405
|
-
(
|
|
25405
|
+
(f3) => f3.toLowerCase().includes("progress") || f3.toLowerCase().includes("percent")
|
|
25406
25406
|
);
|
|
25407
25407
|
const dateFields = effectiveFieldNames?.filter(
|
|
25408
|
-
(
|
|
25408
|
+
(f3) => f3.toLowerCase().includes("date") || f3.toLowerCase().includes("due")
|
|
25409
25409
|
) || [];
|
|
25410
25410
|
const metadataFields = effectiveFieldNames?.filter(
|
|
25411
|
-
(
|
|
25411
|
+
(f3) => f3 !== primaryField && f3 !== statusField && f3 !== priorityField && f3 !== progressField && !dateFields.includes(f3)
|
|
25412
25412
|
).slice(0, 2) || [];
|
|
25413
25413
|
const statusValue = statusField ? item._fields?.[statusField] : null;
|
|
25414
25414
|
statusValue ? getStatusStyle(statusField, String(statusValue)) : null;
|
|
@@ -25717,7 +25717,7 @@ var MediaGallery = ({
|
|
|
25717
25717
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
25718
25718
|
);
|
|
25719
25719
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
25720
|
-
const items =
|
|
25720
|
+
const items = React114__default.useMemo(() => {
|
|
25721
25721
|
if (propItems) return propItems;
|
|
25722
25722
|
if (entityData.length === 0) return [];
|
|
25723
25723
|
return entityData.map((record, idx) => ({
|
|
@@ -25879,7 +25879,7 @@ var MediaGallery = ({
|
|
|
25879
25879
|
};
|
|
25880
25880
|
MediaGallery.displayName = "MediaGallery";
|
|
25881
25881
|
function extractTitle2(children) {
|
|
25882
|
-
if (!
|
|
25882
|
+
if (!React114__default.isValidElement(children)) return void 0;
|
|
25883
25883
|
const props = children.props;
|
|
25884
25884
|
if (typeof props.title === "string") {
|
|
25885
25885
|
return props.title;
|
|
@@ -26549,7 +26549,7 @@ var PageHeader = ({
|
|
|
26549
26549
|
info: "bg-[var(--color-info)]/10 text-[var(--color-info)]"
|
|
26550
26550
|
};
|
|
26551
26551
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
26552
|
-
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(
|
|
26552
|
+
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(React114__default.Fragment, { children: [
|
|
26553
26553
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
26554
26554
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
26555
26555
|
"a",
|
|
@@ -26675,7 +26675,7 @@ function subscribeToDebugEvents(listener) {
|
|
|
26675
26675
|
|
|
26676
26676
|
// components/organisms/debug/hooks/useDebugData.ts
|
|
26677
26677
|
function useDebugData() {
|
|
26678
|
-
const [data, setData] =
|
|
26678
|
+
const [data, setData] = React114.useState(() => ({
|
|
26679
26679
|
traits: [],
|
|
26680
26680
|
ticks: [],
|
|
26681
26681
|
guards: [],
|
|
@@ -26689,7 +26689,7 @@ function useDebugData() {
|
|
|
26689
26689
|
},
|
|
26690
26690
|
lastUpdate: Date.now()
|
|
26691
26691
|
}));
|
|
26692
|
-
|
|
26692
|
+
React114.useEffect(() => {
|
|
26693
26693
|
const updateData = () => {
|
|
26694
26694
|
setData({
|
|
26695
26695
|
traits: getAllTraits(),
|
|
@@ -26958,15 +26958,15 @@ var TYPE_BADGES = {
|
|
|
26958
26958
|
state: { variant: "danger", icon: "\u{1F4CA}" }
|
|
26959
26959
|
};
|
|
26960
26960
|
function EventFlowTab({ events: events2 }) {
|
|
26961
|
-
const [filter, setFilter] =
|
|
26962
|
-
const containerRef =
|
|
26963
|
-
const [autoScroll, setAutoScroll] =
|
|
26964
|
-
|
|
26961
|
+
const [filter, setFilter] = React114.useState("all");
|
|
26962
|
+
const containerRef = React114.useRef(null);
|
|
26963
|
+
const [autoScroll, setAutoScroll] = React114.useState(true);
|
|
26964
|
+
React114.useEffect(() => {
|
|
26965
26965
|
if (autoScroll && containerRef.current) {
|
|
26966
26966
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
26967
26967
|
}
|
|
26968
26968
|
}, [events2.length, autoScroll]);
|
|
26969
|
-
const filteredEvents =
|
|
26969
|
+
const filteredEvents = React114.useMemo(() => {
|
|
26970
26970
|
if (filter === "all") return events2;
|
|
26971
26971
|
return events2.filter((e) => e.type === filter);
|
|
26972
26972
|
}, [events2, filter]);
|
|
@@ -27065,7 +27065,7 @@ function EventFlowTab({ events: events2 }) {
|
|
|
27065
27065
|
}
|
|
27066
27066
|
EventFlowTab.displayName = "EventFlowTab";
|
|
27067
27067
|
function GuardsPanel({ guards }) {
|
|
27068
|
-
const [filter, setFilter] =
|
|
27068
|
+
const [filter, setFilter] = React114.useState("all");
|
|
27069
27069
|
if (guards.length === 0) {
|
|
27070
27070
|
return /* @__PURE__ */ jsx(
|
|
27071
27071
|
EmptyState,
|
|
@@ -27078,7 +27078,7 @@ function GuardsPanel({ guards }) {
|
|
|
27078
27078
|
}
|
|
27079
27079
|
const passedCount = guards.filter((g) => g.result).length;
|
|
27080
27080
|
const failedCount = guards.length - passedCount;
|
|
27081
|
-
const filteredGuards =
|
|
27081
|
+
const filteredGuards = React114.useMemo(() => {
|
|
27082
27082
|
if (filter === "all") return guards;
|
|
27083
27083
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
27084
27084
|
return guards.filter((g) => !g.result);
|
|
@@ -27222,10 +27222,10 @@ function EffectBadge({ effect }) {
|
|
|
27222
27222
|
] });
|
|
27223
27223
|
}
|
|
27224
27224
|
function TransitionTimeline({ transitions: transitions2 }) {
|
|
27225
|
-
const containerRef =
|
|
27226
|
-
const [autoScroll, setAutoScroll] =
|
|
27227
|
-
const [expandedId, setExpandedId] =
|
|
27228
|
-
|
|
27225
|
+
const containerRef = React114.useRef(null);
|
|
27226
|
+
const [autoScroll, setAutoScroll] = React114.useState(true);
|
|
27227
|
+
const [expandedId, setExpandedId] = React114.useState(null);
|
|
27228
|
+
React114.useEffect(() => {
|
|
27229
27229
|
if (autoScroll && containerRef.current) {
|
|
27230
27230
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
27231
27231
|
}
|
|
@@ -27424,9 +27424,9 @@ function extractPayloadFields(schema, eventName) {
|
|
|
27424
27424
|
for (const evt of events2) {
|
|
27425
27425
|
if (evt.name !== eventName) continue;
|
|
27426
27426
|
const payload = evt.payload ?? [];
|
|
27427
|
-
return payload.map((
|
|
27428
|
-
name:
|
|
27429
|
-
type:
|
|
27427
|
+
return payload.map((f3) => ({
|
|
27428
|
+
name: f3.name,
|
|
27429
|
+
type: f3.type ?? "string"
|
|
27430
27430
|
}));
|
|
27431
27431
|
}
|
|
27432
27432
|
}
|
|
@@ -27486,9 +27486,9 @@ function getAllEvents(traits2) {
|
|
|
27486
27486
|
}
|
|
27487
27487
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
27488
27488
|
const eventBus = useEventBus();
|
|
27489
|
-
const [log, setLog] =
|
|
27490
|
-
const prevStatesRef =
|
|
27491
|
-
|
|
27489
|
+
const [log, setLog] = React114.useState([]);
|
|
27490
|
+
const prevStatesRef = React114.useRef(/* @__PURE__ */ new Map());
|
|
27491
|
+
React114.useEffect(() => {
|
|
27492
27492
|
for (const trait of traits2) {
|
|
27493
27493
|
const prev = prevStatesRef.current.get(trait.id);
|
|
27494
27494
|
if (prev && prev !== trait.currentState) {
|
|
@@ -27571,10 +27571,10 @@ function RuntimeDebugger({
|
|
|
27571
27571
|
defaultTab,
|
|
27572
27572
|
schema
|
|
27573
27573
|
}) {
|
|
27574
|
-
const [isCollapsed, setIsCollapsed] =
|
|
27575
|
-
const [isVisible, setIsVisible] =
|
|
27574
|
+
const [isCollapsed, setIsCollapsed] = React114.useState(defaultCollapsed);
|
|
27575
|
+
const [isVisible, setIsVisible] = React114.useState(mode === "inline" || isDebugEnabled2());
|
|
27576
27576
|
const debugData = useDebugData();
|
|
27577
|
-
|
|
27577
|
+
React114.useEffect(() => {
|
|
27578
27578
|
if (mode === "inline") return;
|
|
27579
27579
|
return onDebugToggle((enabled) => {
|
|
27580
27580
|
setIsVisible(enabled);
|
|
@@ -27583,7 +27583,7 @@ function RuntimeDebugger({
|
|
|
27583
27583
|
}
|
|
27584
27584
|
});
|
|
27585
27585
|
}, [mode]);
|
|
27586
|
-
|
|
27586
|
+
React114.useEffect(() => {
|
|
27587
27587
|
if (mode === "inline") return;
|
|
27588
27588
|
const handleKeyDown = (e) => {
|
|
27589
27589
|
if (e.key === "`" && isVisible) {
|
|
@@ -28072,7 +28072,7 @@ function SequenceBar({
|
|
|
28072
28072
|
onSlotRemove(index);
|
|
28073
28073
|
}, [onSlotRemove, playing]);
|
|
28074
28074
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
28075
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
28075
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React114__default.Fragment, { children: [
|
|
28076
28076
|
i > 0 && /* @__PURE__ */ jsx(
|
|
28077
28077
|
Typography,
|
|
28078
28078
|
{
|
|
@@ -28215,7 +28215,7 @@ function SequencerBoard({
|
|
|
28215
28215
|
setPlayState("idle");
|
|
28216
28216
|
setCurrentStep(-1);
|
|
28217
28217
|
emit("UI:PLAY_SOUND", { key: "fail" });
|
|
28218
|
-
const correctCount2 = feedback.filter((
|
|
28218
|
+
const correctCount2 = feedback.filter((f3) => f3 === "correct").length;
|
|
28219
28219
|
for (let ci = 0; ci < correctCount2; ci++) {
|
|
28220
28220
|
setTimeout(() => {
|
|
28221
28221
|
emit("UI:PLAY_SOUND", { key: "correctSlot" });
|
|
@@ -28242,8 +28242,8 @@ function SequencerBoard({
|
|
|
28242
28242
|
};
|
|
28243
28243
|
const usedIds = entity.allowDuplicates === false ? slots.filter(Boolean).map((s) => s?.id || "") : [];
|
|
28244
28244
|
const showHint = attempts >= 3 && !!entity.hint;
|
|
28245
|
-
const hasFeedback = slotFeedback.some((
|
|
28246
|
-
const correctCount = slotFeedback.filter((
|
|
28245
|
+
const hasFeedback = slotFeedback.some((f3) => f3 !== null);
|
|
28246
|
+
const correctCount = slotFeedback.filter((f3) => f3 === "correct").length;
|
|
28247
28247
|
const encourageKey = ENCOURAGEMENT_KEYS2[Math.min(attempts - 1, ENCOURAGEMENT_KEYS2.length - 1)] ?? ENCOURAGEMENT_KEYS2[0];
|
|
28248
28248
|
return /* @__PURE__ */ jsxs(
|
|
28249
28249
|
VStack,
|
|
@@ -29310,7 +29310,7 @@ var StatCard = ({
|
|
|
29310
29310
|
const labelToUse = propLabel ?? propTitle;
|
|
29311
29311
|
const eventBus = useEventBus();
|
|
29312
29312
|
const { t } = useTranslate();
|
|
29313
|
-
const handleActionClick =
|
|
29313
|
+
const handleActionClick = React114__default.useCallback(() => {
|
|
29314
29314
|
if (action?.event) {
|
|
29315
29315
|
eventBus.emit(`UI:${action.event}`, {});
|
|
29316
29316
|
}
|
|
@@ -29321,7 +29321,7 @@ var StatCard = ({
|
|
|
29321
29321
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
29322
29322
|
const isLoading = externalLoading ?? false;
|
|
29323
29323
|
const error = externalError;
|
|
29324
|
-
const computeMetricValue =
|
|
29324
|
+
const computeMetricValue = React114__default.useCallback(
|
|
29325
29325
|
(metric, items) => {
|
|
29326
29326
|
if (metric.value !== void 0) {
|
|
29327
29327
|
return metric.value;
|
|
@@ -29360,7 +29360,7 @@ var StatCard = ({
|
|
|
29360
29360
|
},
|
|
29361
29361
|
[]
|
|
29362
29362
|
);
|
|
29363
|
-
const schemaStats =
|
|
29363
|
+
const schemaStats = React114__default.useMemo(() => {
|
|
29364
29364
|
if (!metrics || metrics.length === 0) return null;
|
|
29365
29365
|
return metrics.map((metric) => ({
|
|
29366
29366
|
label: metric.label,
|
|
@@ -29368,7 +29368,7 @@ var StatCard = ({
|
|
|
29368
29368
|
format: metric.format
|
|
29369
29369
|
}));
|
|
29370
29370
|
}, [metrics, data, computeMetricValue]);
|
|
29371
|
-
const calculatedTrend =
|
|
29371
|
+
const calculatedTrend = React114__default.useMemo(() => {
|
|
29372
29372
|
if (manualTrend !== void 0) return manualTrend;
|
|
29373
29373
|
if (previousValue === void 0 || currentValue === void 0)
|
|
29374
29374
|
return void 0;
|
|
@@ -30279,23 +30279,23 @@ var Timeline = ({
|
|
|
30279
30279
|
}) => {
|
|
30280
30280
|
const { t } = useTranslate();
|
|
30281
30281
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
30282
|
-
const items =
|
|
30282
|
+
const items = React114__default.useMemo(() => {
|
|
30283
30283
|
if (propItems) return propItems;
|
|
30284
30284
|
if (entityData.length === 0) return [];
|
|
30285
30285
|
return entityData.map((record, idx) => {
|
|
30286
|
-
const resolveField = (
|
|
30287
|
-
if (typeof
|
|
30288
|
-
if (
|
|
30286
|
+
const resolveField = (f3) => {
|
|
30287
|
+
if (typeof f3 === "string") return f3;
|
|
30288
|
+
if (f3 && typeof f3 === "object" && "name" in f3) return String(f3.name);
|
|
30289
30289
|
return "";
|
|
30290
30290
|
};
|
|
30291
30291
|
const resolvedFields = fields?.map(resolveField) ?? [];
|
|
30292
30292
|
const titleField = resolvedFields[0] || "title";
|
|
30293
30293
|
const descField = resolvedFields[1] || "description";
|
|
30294
30294
|
const dateField = resolvedFields.find(
|
|
30295
|
-
(
|
|
30295
|
+
(f3) => f3.toLowerCase().includes("date")
|
|
30296
30296
|
) || "date";
|
|
30297
30297
|
const statusField = resolvedFields.find(
|
|
30298
|
-
(
|
|
30298
|
+
(f3) => f3.toLowerCase().includes("status")
|
|
30299
30299
|
) || "status";
|
|
30300
30300
|
return {
|
|
30301
30301
|
id: String(record.id ?? idx),
|
|
@@ -30381,7 +30381,7 @@ var Timeline = ({
|
|
|
30381
30381
|
};
|
|
30382
30382
|
Timeline.displayName = "Timeline";
|
|
30383
30383
|
function extractToastProps(children) {
|
|
30384
|
-
if (!
|
|
30384
|
+
if (!React114__default.isValidElement(children)) {
|
|
30385
30385
|
if (typeof children === "string") {
|
|
30386
30386
|
return { message: children };
|
|
30387
30387
|
}
|
|
@@ -30412,7 +30412,7 @@ var ToastSlot = ({
|
|
|
30412
30412
|
eventBus.emit("UI:CLOSE");
|
|
30413
30413
|
};
|
|
30414
30414
|
if (!isVisible) return null;
|
|
30415
|
-
const isCustomContent =
|
|
30415
|
+
const isCustomContent = React114__default.isValidElement(children) && !message;
|
|
30416
30416
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
30417
30417
|
Toast,
|
|
30418
30418
|
{
|
|
@@ -30656,7 +30656,7 @@ var WizardContainer = ({
|
|
|
30656
30656
|
const isCompleted = index < currentStep;
|
|
30657
30657
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
30658
30658
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
30659
|
-
return /* @__PURE__ */ jsxs(
|
|
30659
|
+
return /* @__PURE__ */ jsxs(React114__default.Fragment, { children: [
|
|
30660
30660
|
/* @__PURE__ */ jsx(
|
|
30661
30661
|
Button,
|
|
30662
30662
|
{
|
|
@@ -31022,12 +31022,12 @@ WorldMapTemplate.displayName = "WorldMapTemplate";
|
|
|
31022
31022
|
|
|
31023
31023
|
// components/organisms/component-registry.generated.ts
|
|
31024
31024
|
function lazyThree(name, loader) {
|
|
31025
|
-
const Lazy =
|
|
31025
|
+
const Lazy = React114__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
31026
31026
|
function ThreeWrapper(props) {
|
|
31027
|
-
return
|
|
31028
|
-
|
|
31027
|
+
return React114__default.createElement(
|
|
31028
|
+
React114__default.Suspense,
|
|
31029
31029
|
{ fallback: null },
|
|
31030
|
-
|
|
31030
|
+
React114__default.createElement(Lazy, props)
|
|
31031
31031
|
);
|
|
31032
31032
|
}
|
|
31033
31033
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -31315,7 +31315,7 @@ function SuspenseConfigProvider({
|
|
|
31315
31315
|
config,
|
|
31316
31316
|
children
|
|
31317
31317
|
}) {
|
|
31318
|
-
return
|
|
31318
|
+
return React114__default.createElement(
|
|
31319
31319
|
SuspenseConfigContext.Provider,
|
|
31320
31320
|
{ value: config },
|
|
31321
31321
|
children
|
|
@@ -32026,6 +32026,7 @@ function OrbitalProvider({
|
|
|
32026
32026
|
}
|
|
32027
32027
|
OrbitalProvider.displayName = "OrbitalProvider";
|
|
32028
32028
|
function enrichFromResponse(node, data) {
|
|
32029
|
+
if (!node || typeof node !== "object") return node ?? {};
|
|
32029
32030
|
let enriched = node;
|
|
32030
32031
|
if (Array.isArray(enriched.children)) {
|
|
32031
32032
|
enriched = {
|
|
@@ -32113,7 +32114,7 @@ function ServerBridgeProvider({
|
|
|
32113
32114
|
if (effectType === "render-ui") {
|
|
32114
32115
|
const slot = arr[1];
|
|
32115
32116
|
const pattern = arr[2];
|
|
32116
|
-
const enriched = enrichFromResponse(pattern, responseData);
|
|
32117
|
+
const enriched = pattern ? enrichFromResponse(pattern, responseData) : void 0;
|
|
32117
32118
|
effects.push({ type: "render-ui", slot, pattern: enriched });
|
|
32118
32119
|
} else if (effectType === "navigate") {
|
|
32119
32120
|
effects.push({ type: "navigate", route: arr[1], params: arr[2] });
|
|
@@ -32209,12 +32210,19 @@ function TraitInitializer({ traits: traits2, orbitalNames }) {
|
|
|
32209
32210
|
}, [bridge.connected, bridge.sendEvent, orbitalNames, slotsActions]);
|
|
32210
32211
|
const opts = orbitalNames ? { onEventProcessed } : {};
|
|
32211
32212
|
const { sendEvent } = useTraitStateMachine(traits2, slotsActions, opts);
|
|
32213
|
+
const initSentRef = useRef(false);
|
|
32212
32214
|
useEffect(() => {
|
|
32213
|
-
if (orbitalNames?.length)
|
|
32214
|
-
|
|
32215
|
-
|
|
32215
|
+
if (!orbitalNames?.length) {
|
|
32216
|
+
const t = setTimeout(() => sendEvent("INIT"), 50);
|
|
32217
|
+
return () => clearTimeout(t);
|
|
32218
|
+
}
|
|
32219
|
+
const fallback = setTimeout(() => {
|
|
32220
|
+
if (!initSentRef.current) {
|
|
32221
|
+
sendEvent("INIT");
|
|
32222
|
+
}
|
|
32223
|
+
}, 5e3);
|
|
32224
|
+
return () => clearTimeout(fallback);
|
|
32216
32225
|
}, [traits2, orbitalNames, sendEvent]);
|
|
32217
|
-
const initSentRef = useRef(false);
|
|
32218
32226
|
useEffect(() => {
|
|
32219
32227
|
if (!bridge.connected || !orbitalNames?.length || initSentRef.current) return;
|
|
32220
32228
|
initSentRef.current = true;
|