@almadar/ui 2.28.2 → 2.29.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 +412 -0
- package/dist/avl/index.d.cts +89 -1
- package/dist/avl/index.d.ts +3 -0
- package/dist/avl/index.js +410 -2
- package/dist/providers/EntityStoreProvider.d.ts +47 -0
- package/dist/providers/index.cjs +221 -141
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +115 -40
- package/dist/runtime/OrbPreview.d.ts +2 -2
- package/dist/runtime/index.cjs +968 -938
- package/dist/runtime/index.js +190 -160
- package/dist/runtime/useTraitStateMachine.d.ts +1 -1
- package/package.json +1 -1
package/dist/runtime/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React118 from 'react';
|
|
2
|
+
import React118__default, { createContext, useCallback, useState, useRef, useEffect, useLayoutEffect, 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';
|
|
@@ -212,43 +212,43 @@ function useQuerySingleton(query) {
|
|
|
212
212
|
if (!query) {
|
|
213
213
|
return null;
|
|
214
214
|
}
|
|
215
|
-
const
|
|
215
|
+
const store2 = useMemo(() => getOrCreateStore(query), [query]);
|
|
216
216
|
useMemo(() => {
|
|
217
217
|
const listener = () => forceUpdate({});
|
|
218
|
-
|
|
218
|
+
store2.listeners.add(listener);
|
|
219
219
|
return () => {
|
|
220
|
-
|
|
220
|
+
store2.listeners.delete(listener);
|
|
221
221
|
};
|
|
222
|
-
}, [
|
|
222
|
+
}, [store2]);
|
|
223
223
|
const notifyListeners3 = useCallback(() => {
|
|
224
|
-
|
|
225
|
-
}, [
|
|
224
|
+
store2.listeners.forEach((listener) => listener());
|
|
225
|
+
}, [store2]);
|
|
226
226
|
const setSearch = useCallback((value) => {
|
|
227
|
-
|
|
227
|
+
store2.search = value;
|
|
228
228
|
notifyListeners3();
|
|
229
|
-
}, [
|
|
229
|
+
}, [store2, notifyListeners3]);
|
|
230
230
|
const setFilter = useCallback((key, value) => {
|
|
231
|
-
|
|
231
|
+
store2.filters = { ...store2.filters, [key]: value };
|
|
232
232
|
notifyListeners3();
|
|
233
|
-
}, [
|
|
233
|
+
}, [store2, notifyListeners3]);
|
|
234
234
|
const clearFilters = useCallback(() => {
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
store2.filters = {};
|
|
236
|
+
store2.search = "";
|
|
237
237
|
notifyListeners3();
|
|
238
|
-
}, [
|
|
238
|
+
}, [store2, notifyListeners3]);
|
|
239
239
|
const setSort = useCallback((field, direction) => {
|
|
240
|
-
|
|
241
|
-
|
|
240
|
+
store2.sortField = field;
|
|
241
|
+
store2.sortDirection = direction;
|
|
242
242
|
notifyListeners3();
|
|
243
|
-
}, [
|
|
243
|
+
}, [store2, notifyListeners3]);
|
|
244
244
|
return {
|
|
245
|
-
search:
|
|
245
|
+
search: store2.search,
|
|
246
246
|
setSearch,
|
|
247
|
-
filters:
|
|
247
|
+
filters: store2.filters,
|
|
248
248
|
setFilter,
|
|
249
249
|
clearFilters,
|
|
250
|
-
sortField:
|
|
251
|
-
sortDirection:
|
|
250
|
+
sortField: store2.sortField,
|
|
251
|
+
sortDirection: store2.sortDirection,
|
|
252
252
|
setSort
|
|
253
253
|
};
|
|
254
254
|
}
|
|
@@ -1289,7 +1289,7 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
const onEventProcessed = optionsRef.current?.onEventProcessed;
|
|
1291
1291
|
if (onEventProcessed) {
|
|
1292
|
-
onEventProcessed(normalizedEvent, payload);
|
|
1292
|
+
await onEventProcessed(normalizedEvent, payload);
|
|
1293
1293
|
}
|
|
1294
1294
|
}, [entities, eventBus]);
|
|
1295
1295
|
const drainEventQueue = useCallback(async () => {
|
|
@@ -1616,7 +1616,7 @@ var positionStyles = {
|
|
|
1616
1616
|
fixed: "fixed",
|
|
1617
1617
|
sticky: "sticky"
|
|
1618
1618
|
};
|
|
1619
|
-
var Box =
|
|
1619
|
+
var Box = React118__default.forwardRef(
|
|
1620
1620
|
({
|
|
1621
1621
|
padding,
|
|
1622
1622
|
paddingX,
|
|
@@ -2066,6 +2066,36 @@ function useTheme() {
|
|
|
2066
2066
|
}
|
|
2067
2067
|
return context;
|
|
2068
2068
|
}
|
|
2069
|
+
var store = /* @__PURE__ */ new Map();
|
|
2070
|
+
var storeListeners = /* @__PURE__ */ new Set();
|
|
2071
|
+
var watchCallbacks = /* @__PURE__ */ new Map();
|
|
2072
|
+
function advance(entityType, data) {
|
|
2073
|
+
const prev = store.get(entityType);
|
|
2074
|
+
const oldData = prev?.data ?? [];
|
|
2075
|
+
store.set(entityType, { data, version: (prev?.version ?? 0) + 1 });
|
|
2076
|
+
for (const listener of storeListeners) {
|
|
2077
|
+
listener();
|
|
2078
|
+
}
|
|
2079
|
+
const cbs = watchCallbacks.get(entityType);
|
|
2080
|
+
if (cbs) {
|
|
2081
|
+
for (const cb of cbs) {
|
|
2082
|
+
try {
|
|
2083
|
+
cb(oldData, data);
|
|
2084
|
+
} catch {
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
function getSnapshot3(entityType) {
|
|
2090
|
+
return store.get(entityType)?.data ?? [];
|
|
2091
|
+
}
|
|
2092
|
+
var EntityStoreContext = createContext({
|
|
2093
|
+
advance,
|
|
2094
|
+
getSnapshot: getSnapshot3
|
|
2095
|
+
});
|
|
2096
|
+
function EntityStoreProvider({ children }) {
|
|
2097
|
+
return /* @__PURE__ */ jsx(EntityStoreContext.Provider, { value: { advance, getSnapshot: getSnapshot3 }, children });
|
|
2098
|
+
}
|
|
2069
2099
|
var EventBusContext2 = createContext(null);
|
|
2070
2100
|
function EventBusProvider({ children, debug: debug2 = false }) {
|
|
2071
2101
|
const listenersRef = useRef(/* @__PURE__ */ new Map());
|
|
@@ -2711,7 +2741,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
2711
2741
|
const IconComp = value;
|
|
2712
2742
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
2713
2743
|
}
|
|
2714
|
-
if (
|
|
2744
|
+
if (React118__default.isValidElement(value)) {
|
|
2715
2745
|
return value;
|
|
2716
2746
|
}
|
|
2717
2747
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -2720,7 +2750,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
2720
2750
|
}
|
|
2721
2751
|
return value;
|
|
2722
2752
|
}
|
|
2723
|
-
var Button =
|
|
2753
|
+
var Button = React118__default.forwardRef(
|
|
2724
2754
|
({
|
|
2725
2755
|
className,
|
|
2726
2756
|
variant = "primary",
|
|
@@ -2816,7 +2846,7 @@ var sizeStyles3 = {
|
|
|
2816
2846
|
md: "px-2.5 py-1 text-sm",
|
|
2817
2847
|
lg: "px-3 py-1.5 text-base"
|
|
2818
2848
|
};
|
|
2819
|
-
var Badge =
|
|
2849
|
+
var Badge = React118__default.forwardRef(
|
|
2820
2850
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
2821
2851
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
2822
2852
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -2939,7 +2969,7 @@ var Toast = ({
|
|
|
2939
2969
|
);
|
|
2940
2970
|
};
|
|
2941
2971
|
Toast.displayName = "Toast";
|
|
2942
|
-
var Input =
|
|
2972
|
+
var Input = React118__default.forwardRef(
|
|
2943
2973
|
({
|
|
2944
2974
|
className,
|
|
2945
2975
|
inputType,
|
|
@@ -3051,7 +3081,7 @@ var Input = React117__default.forwardRef(
|
|
|
3051
3081
|
}
|
|
3052
3082
|
);
|
|
3053
3083
|
Input.displayName = "Input";
|
|
3054
|
-
var Label =
|
|
3084
|
+
var Label = React118__default.forwardRef(
|
|
3055
3085
|
({ className, required, children, ...props }, ref) => {
|
|
3056
3086
|
return /* @__PURE__ */ jsxs(
|
|
3057
3087
|
"label",
|
|
@@ -3071,7 +3101,7 @@ var Label = React117__default.forwardRef(
|
|
|
3071
3101
|
}
|
|
3072
3102
|
);
|
|
3073
3103
|
Label.displayName = "Label";
|
|
3074
|
-
var Textarea =
|
|
3104
|
+
var Textarea = React118__default.forwardRef(
|
|
3075
3105
|
({ className, error, ...props }, ref) => {
|
|
3076
3106
|
return /* @__PURE__ */ jsx(
|
|
3077
3107
|
"textarea",
|
|
@@ -3094,7 +3124,7 @@ var Textarea = React117__default.forwardRef(
|
|
|
3094
3124
|
}
|
|
3095
3125
|
);
|
|
3096
3126
|
Textarea.displayName = "Textarea";
|
|
3097
|
-
var Select =
|
|
3127
|
+
var Select = React118__default.forwardRef(
|
|
3098
3128
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
3099
3129
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
3100
3130
|
/* @__PURE__ */ jsxs(
|
|
@@ -3130,7 +3160,7 @@ var Select = React117__default.forwardRef(
|
|
|
3130
3160
|
}
|
|
3131
3161
|
);
|
|
3132
3162
|
Select.displayName = "Select";
|
|
3133
|
-
var Checkbox =
|
|
3163
|
+
var Checkbox = React118__default.forwardRef(
|
|
3134
3164
|
({ className, label, id, ...props }, ref) => {
|
|
3135
3165
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3136
3166
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -3206,7 +3236,7 @@ var shadowStyles2 = {
|
|
|
3206
3236
|
md: "shadow",
|
|
3207
3237
|
lg: "shadow-lg"
|
|
3208
3238
|
};
|
|
3209
|
-
var Card =
|
|
3239
|
+
var Card = React118__default.forwardRef(
|
|
3210
3240
|
({
|
|
3211
3241
|
className,
|
|
3212
3242
|
variant = "bordered",
|
|
@@ -3242,9 +3272,9 @@ var Card = React117__default.forwardRef(
|
|
|
3242
3272
|
}
|
|
3243
3273
|
);
|
|
3244
3274
|
Card.displayName = "Card";
|
|
3245
|
-
var CardHeader =
|
|
3275
|
+
var CardHeader = React118__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3246
3276
|
CardHeader.displayName = "CardHeader";
|
|
3247
|
-
var CardTitle =
|
|
3277
|
+
var CardTitle = React118__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3248
3278
|
"h3",
|
|
3249
3279
|
{
|
|
3250
3280
|
ref,
|
|
@@ -3257,11 +3287,11 @@ var CardTitle = React117__default.forwardRef(({ className, ...props }, ref) => /
|
|
|
3257
3287
|
}
|
|
3258
3288
|
));
|
|
3259
3289
|
CardTitle.displayName = "CardTitle";
|
|
3260
|
-
var CardContent =
|
|
3290
|
+
var CardContent = React118__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3261
3291
|
CardContent.displayName = "CardContent";
|
|
3262
3292
|
var CardBody = CardContent;
|
|
3263
3293
|
CardBody.displayName = "CardBody";
|
|
3264
|
-
var CardFooter =
|
|
3294
|
+
var CardFooter = React118__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3265
3295
|
"div",
|
|
3266
3296
|
{
|
|
3267
3297
|
ref,
|
|
@@ -3276,7 +3306,7 @@ var sizeStyles4 = {
|
|
|
3276
3306
|
md: "h-6 w-6",
|
|
3277
3307
|
lg: "h-8 w-8"
|
|
3278
3308
|
};
|
|
3279
|
-
var Spinner =
|
|
3309
|
+
var Spinner = React118__default.forwardRef(
|
|
3280
3310
|
({ className, size = "md", ...props }, ref) => {
|
|
3281
3311
|
return /* @__PURE__ */ jsx(
|
|
3282
3312
|
"div",
|
|
@@ -3692,7 +3722,7 @@ var ProgressBar = ({
|
|
|
3692
3722
|
return null;
|
|
3693
3723
|
};
|
|
3694
3724
|
ProgressBar.displayName = "ProgressBar";
|
|
3695
|
-
var Radio =
|
|
3725
|
+
var Radio = React118__default.forwardRef(
|
|
3696
3726
|
({
|
|
3697
3727
|
label,
|
|
3698
3728
|
helperText,
|
|
@@ -3796,7 +3826,7 @@ var Radio = React117__default.forwardRef(
|
|
|
3796
3826
|
}
|
|
3797
3827
|
);
|
|
3798
3828
|
Radio.displayName = "Radio";
|
|
3799
|
-
var Switch =
|
|
3829
|
+
var Switch = React118.forwardRef(
|
|
3800
3830
|
({
|
|
3801
3831
|
checked,
|
|
3802
3832
|
defaultChecked = false,
|
|
@@ -3807,10 +3837,10 @@ var Switch = React117.forwardRef(
|
|
|
3807
3837
|
name,
|
|
3808
3838
|
className
|
|
3809
3839
|
}, ref) => {
|
|
3810
|
-
const [isChecked, setIsChecked] =
|
|
3840
|
+
const [isChecked, setIsChecked] = React118.useState(
|
|
3811
3841
|
checked !== void 0 ? checked : defaultChecked
|
|
3812
3842
|
);
|
|
3813
|
-
|
|
3843
|
+
React118.useEffect(() => {
|
|
3814
3844
|
if (checked !== void 0) {
|
|
3815
3845
|
setIsChecked(checked);
|
|
3816
3846
|
}
|
|
@@ -4175,8 +4205,8 @@ var LawReferenceTooltip = ({
|
|
|
4175
4205
|
position = "top",
|
|
4176
4206
|
className
|
|
4177
4207
|
}) => {
|
|
4178
|
-
const [isVisible, setIsVisible] =
|
|
4179
|
-
const timeoutRef =
|
|
4208
|
+
const [isVisible, setIsVisible] = React118__default.useState(false);
|
|
4209
|
+
const timeoutRef = React118__default.useRef(null);
|
|
4180
4210
|
const handleMouseEnter = () => {
|
|
4181
4211
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4182
4212
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -4185,7 +4215,7 @@ var LawReferenceTooltip = ({
|
|
|
4185
4215
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4186
4216
|
setIsVisible(false);
|
|
4187
4217
|
};
|
|
4188
|
-
|
|
4218
|
+
React118__default.useEffect(() => {
|
|
4189
4219
|
return () => {
|
|
4190
4220
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4191
4221
|
};
|
|
@@ -4373,7 +4403,7 @@ var sizeStyles5 = {
|
|
|
4373
4403
|
md: "w-2.5 h-2.5",
|
|
4374
4404
|
lg: "w-3 h-3"
|
|
4375
4405
|
};
|
|
4376
|
-
var StatusDot =
|
|
4406
|
+
var StatusDot = React118__default.forwardRef(
|
|
4377
4407
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
4378
4408
|
return /* @__PURE__ */ jsx(
|
|
4379
4409
|
"span",
|
|
@@ -4420,7 +4450,7 @@ var iconMap2 = {
|
|
|
4420
4450
|
down: TrendingDown,
|
|
4421
4451
|
flat: ArrowRight
|
|
4422
4452
|
};
|
|
4423
|
-
var TrendIndicator =
|
|
4453
|
+
var TrendIndicator = React118__default.forwardRef(
|
|
4424
4454
|
({
|
|
4425
4455
|
className,
|
|
4426
4456
|
value,
|
|
@@ -4479,7 +4509,7 @@ var thumbSizes = {
|
|
|
4479
4509
|
md: "w-4 h-4",
|
|
4480
4510
|
lg: "w-5 h-5"
|
|
4481
4511
|
};
|
|
4482
|
-
var RangeSlider =
|
|
4512
|
+
var RangeSlider = React118__default.forwardRef(
|
|
4483
4513
|
({
|
|
4484
4514
|
className,
|
|
4485
4515
|
min = 0,
|
|
@@ -4930,7 +4960,7 @@ var paddingClasses = {
|
|
|
4930
4960
|
md: "py-16",
|
|
4931
4961
|
lg: "py-24"
|
|
4932
4962
|
};
|
|
4933
|
-
var ContentSection =
|
|
4963
|
+
var ContentSection = React118__default.forwardRef(
|
|
4934
4964
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
4935
4965
|
return /* @__PURE__ */ jsx(
|
|
4936
4966
|
Box,
|
|
@@ -4969,7 +4999,7 @@ var animatedStyles = {
|
|
|
4969
4999
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
4970
5000
|
"none": {}
|
|
4971
5001
|
};
|
|
4972
|
-
var AnimatedReveal =
|
|
5002
|
+
var AnimatedReveal = React118__default.forwardRef(
|
|
4973
5003
|
({
|
|
4974
5004
|
trigger = "scroll",
|
|
4975
5005
|
animation = "fade-up",
|
|
@@ -5122,7 +5152,7 @@ function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
|
5122
5152
|
el.style.opacity = animate ? "1" : "0";
|
|
5123
5153
|
});
|
|
5124
5154
|
}
|
|
5125
|
-
var AnimatedGraphic =
|
|
5155
|
+
var AnimatedGraphic = React118__default.forwardRef(
|
|
5126
5156
|
({
|
|
5127
5157
|
src,
|
|
5128
5158
|
svgContent,
|
|
@@ -5145,7 +5175,7 @@ var AnimatedGraphic = React117__default.forwardRef(
|
|
|
5145
5175
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
5146
5176
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
5147
5177
|
const prevAnimateRef = useRef(animate);
|
|
5148
|
-
const setRef =
|
|
5178
|
+
const setRef = React118__default.useCallback(
|
|
5149
5179
|
(node) => {
|
|
5150
5180
|
containerRef.current = node;
|
|
5151
5181
|
if (typeof ref === "function") ref(node);
|
|
@@ -5316,9 +5346,9 @@ function ScoreDisplay({
|
|
|
5316
5346
|
...rest
|
|
5317
5347
|
}) {
|
|
5318
5348
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
5319
|
-
const [displayValue, setDisplayValue] =
|
|
5320
|
-
const [isAnimating, setIsAnimating] =
|
|
5321
|
-
|
|
5349
|
+
const [displayValue, setDisplayValue] = React118.useState(resolvedValue);
|
|
5350
|
+
const [isAnimating, setIsAnimating] = React118.useState(false);
|
|
5351
|
+
React118.useEffect(() => {
|
|
5322
5352
|
if (!animated || displayValue === resolvedValue) {
|
|
5323
5353
|
setDisplayValue(resolvedValue);
|
|
5324
5354
|
return;
|
|
@@ -5391,9 +5421,9 @@ function ControlButton({
|
|
|
5391
5421
|
className
|
|
5392
5422
|
}) {
|
|
5393
5423
|
const eventBus = useEventBus();
|
|
5394
|
-
const [isPressed, setIsPressed] =
|
|
5424
|
+
const [isPressed, setIsPressed] = React118.useState(false);
|
|
5395
5425
|
const actualPressed = pressed ?? isPressed;
|
|
5396
|
-
const handlePointerDown =
|
|
5426
|
+
const handlePointerDown = React118.useCallback(
|
|
5397
5427
|
(e) => {
|
|
5398
5428
|
e.preventDefault();
|
|
5399
5429
|
if (disabled) return;
|
|
@@ -5403,7 +5433,7 @@ function ControlButton({
|
|
|
5403
5433
|
},
|
|
5404
5434
|
[disabled, pressEvent, eventBus, onPress]
|
|
5405
5435
|
);
|
|
5406
|
-
const handlePointerUp =
|
|
5436
|
+
const handlePointerUp = React118.useCallback(
|
|
5407
5437
|
(e) => {
|
|
5408
5438
|
e.preventDefault();
|
|
5409
5439
|
if (disabled) return;
|
|
@@ -5413,7 +5443,7 @@ function ControlButton({
|
|
|
5413
5443
|
},
|
|
5414
5444
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
5415
5445
|
);
|
|
5416
|
-
const handlePointerLeave =
|
|
5446
|
+
const handlePointerLeave = React118.useCallback(
|
|
5417
5447
|
(e) => {
|
|
5418
5448
|
if (isPressed) {
|
|
5419
5449
|
setIsPressed(false);
|
|
@@ -6203,9 +6233,9 @@ function MiniMap({
|
|
|
6203
6233
|
viewportRect,
|
|
6204
6234
|
className
|
|
6205
6235
|
}) {
|
|
6206
|
-
const canvasRef =
|
|
6207
|
-
const frameRef =
|
|
6208
|
-
|
|
6236
|
+
const canvasRef = React118.useRef(null);
|
|
6237
|
+
const frameRef = React118.useRef(0);
|
|
6238
|
+
React118.useEffect(() => {
|
|
6209
6239
|
const canvas = canvasRef.current;
|
|
6210
6240
|
if (!canvas) return;
|
|
6211
6241
|
const ctx = canvas.getContext("2d");
|
|
@@ -6314,7 +6344,7 @@ var ErrorState = ({
|
|
|
6314
6344
|
);
|
|
6315
6345
|
};
|
|
6316
6346
|
ErrorState.displayName = "ErrorState";
|
|
6317
|
-
var ErrorBoundary = class extends
|
|
6347
|
+
var ErrorBoundary = class extends React118__default.Component {
|
|
6318
6348
|
constructor(props) {
|
|
6319
6349
|
super(props);
|
|
6320
6350
|
__publicField(this, "reset", () => {
|
|
@@ -6697,8 +6727,8 @@ var Tooltip = ({
|
|
|
6697
6727
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
6698
6728
|
};
|
|
6699
6729
|
}, []);
|
|
6700
|
-
const triggerElement =
|
|
6701
|
-
const trigger =
|
|
6730
|
+
const triggerElement = React118__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
6731
|
+
const trigger = React118__default.cloneElement(triggerElement, {
|
|
6702
6732
|
ref: triggerRef,
|
|
6703
6733
|
onMouseEnter: handleMouseEnter,
|
|
6704
6734
|
onMouseLeave: handleMouseLeave,
|
|
@@ -6811,8 +6841,8 @@ var Popover = ({
|
|
|
6811
6841
|
onMouseEnter: handleOpen,
|
|
6812
6842
|
onMouseLeave: handleClose
|
|
6813
6843
|
};
|
|
6814
|
-
const childElement =
|
|
6815
|
-
const triggerElement =
|
|
6844
|
+
const childElement = React118__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
6845
|
+
const triggerElement = React118__default.cloneElement(
|
|
6816
6846
|
childElement,
|
|
6817
6847
|
{
|
|
6818
6848
|
ref: triggerRef,
|
|
@@ -6916,8 +6946,8 @@ var Menu = ({
|
|
|
6916
6946
|
"bottom-start": "top-full left-0 mt-2",
|
|
6917
6947
|
"bottom-end": "top-full right-0 mt-2"
|
|
6918
6948
|
};
|
|
6919
|
-
const triggerChild =
|
|
6920
|
-
const triggerElement =
|
|
6949
|
+
const triggerChild = React118__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
|
|
6950
|
+
const triggerElement = React118__default.cloneElement(
|
|
6921
6951
|
triggerChild,
|
|
6922
6952
|
{
|
|
6923
6953
|
ref: triggerRef,
|
|
@@ -7617,7 +7647,7 @@ function InputPattern({
|
|
|
7617
7647
|
className
|
|
7618
7648
|
}) {
|
|
7619
7649
|
const { emit } = useEventBus();
|
|
7620
|
-
const [localValue, setLocalValue] =
|
|
7650
|
+
const [localValue, setLocalValue] = React118__default.useState(value);
|
|
7621
7651
|
const handleChange = (e) => {
|
|
7622
7652
|
setLocalValue(e.target.value);
|
|
7623
7653
|
if (onChange) {
|
|
@@ -7654,7 +7684,7 @@ function TextareaPattern({
|
|
|
7654
7684
|
className
|
|
7655
7685
|
}) {
|
|
7656
7686
|
const { emit } = useEventBus();
|
|
7657
|
-
const [localValue, setLocalValue] =
|
|
7687
|
+
const [localValue, setLocalValue] = React118__default.useState(value);
|
|
7658
7688
|
const handleChange = (e) => {
|
|
7659
7689
|
setLocalValue(e.target.value);
|
|
7660
7690
|
if (onChange) {
|
|
@@ -7685,7 +7715,7 @@ function SelectPattern({
|
|
|
7685
7715
|
className
|
|
7686
7716
|
}) {
|
|
7687
7717
|
const { emit } = useEventBus();
|
|
7688
|
-
const [localValue, setLocalValue] =
|
|
7718
|
+
const [localValue, setLocalValue] = React118__default.useState(value);
|
|
7689
7719
|
const handleChange = (e) => {
|
|
7690
7720
|
setLocalValue(e.target.value);
|
|
7691
7721
|
if (onChange) {
|
|
@@ -7714,7 +7744,7 @@ function CheckboxPattern({
|
|
|
7714
7744
|
className
|
|
7715
7745
|
}) {
|
|
7716
7746
|
const { emit } = useEventBus();
|
|
7717
|
-
const [localChecked, setLocalChecked] =
|
|
7747
|
+
const [localChecked, setLocalChecked] = React118__default.useState(checked);
|
|
7718
7748
|
const handleChange = (e) => {
|
|
7719
7749
|
setLocalChecked(e.target.checked);
|
|
7720
7750
|
if (onChange) {
|
|
@@ -7915,8 +7945,8 @@ function ActionButtons({
|
|
|
7915
7945
|
disabled
|
|
7916
7946
|
}) {
|
|
7917
7947
|
const eventBus = useEventBus();
|
|
7918
|
-
const [activeButtons, setActiveButtons] =
|
|
7919
|
-
const handlePress =
|
|
7948
|
+
const [activeButtons, setActiveButtons] = React118.useState(/* @__PURE__ */ new Set());
|
|
7949
|
+
const handlePress = React118.useCallback(
|
|
7920
7950
|
(id) => {
|
|
7921
7951
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
7922
7952
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -7924,7 +7954,7 @@ function ActionButtons({
|
|
|
7924
7954
|
},
|
|
7925
7955
|
[actionEvent, eventBus, onAction]
|
|
7926
7956
|
);
|
|
7927
|
-
const handleRelease =
|
|
7957
|
+
const handleRelease = React118.useCallback(
|
|
7928
7958
|
(id) => {
|
|
7929
7959
|
setActiveButtons((prev) => {
|
|
7930
7960
|
const next = new Set(prev);
|
|
@@ -9588,7 +9618,7 @@ var ScaledDiagram = ({
|
|
|
9588
9618
|
);
|
|
9589
9619
|
};
|
|
9590
9620
|
ScaledDiagram.displayName = "ScaledDiagram";
|
|
9591
|
-
var MarkdownContent =
|
|
9621
|
+
var MarkdownContent = React118__default.memo(
|
|
9592
9622
|
({ content, direction, className }) => {
|
|
9593
9623
|
const { t: _t } = useTranslate();
|
|
9594
9624
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -9690,7 +9720,7 @@ var MarkdownContent = React117__default.memo(
|
|
|
9690
9720
|
(prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
|
|
9691
9721
|
);
|
|
9692
9722
|
MarkdownContent.displayName = "MarkdownContent";
|
|
9693
|
-
var CodeBlock =
|
|
9723
|
+
var CodeBlock = React118__default.memo(
|
|
9694
9724
|
({
|
|
9695
9725
|
code: rawCode,
|
|
9696
9726
|
language = "text",
|
|
@@ -10650,7 +10680,7 @@ var StateMachineView = ({
|
|
|
10650
10680
|
style: { top: title ? 30 : 0 },
|
|
10651
10681
|
children: [
|
|
10652
10682
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
10653
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
10683
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React118__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
10654
10684
|
StateNode,
|
|
10655
10685
|
{
|
|
10656
10686
|
state,
|
|
@@ -15987,7 +16017,7 @@ function CraftingRecipe({
|
|
|
15987
16017
|
className
|
|
15988
16018
|
}) {
|
|
15989
16019
|
const eventBus = useEventBus();
|
|
15990
|
-
const handleCraft =
|
|
16020
|
+
const handleCraft = React118.useCallback(() => {
|
|
15991
16021
|
onCraft?.();
|
|
15992
16022
|
if (craftEvent) {
|
|
15993
16023
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -16004,7 +16034,7 @@ function CraftingRecipe({
|
|
|
16004
16034
|
children: [
|
|
16005
16035
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
16006
16036
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
16007
|
-
return /* @__PURE__ */ jsxs(
|
|
16037
|
+
return /* @__PURE__ */ jsxs(React118.Fragment, { children: [
|
|
16008
16038
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
16009
16039
|
ItemSlot,
|
|
16010
16040
|
{
|
|
@@ -16283,8 +16313,8 @@ function DPad({
|
|
|
16283
16313
|
}) {
|
|
16284
16314
|
const eventBus = useEventBus();
|
|
16285
16315
|
const sizes = sizeMap15[size];
|
|
16286
|
-
const [activeDirections, setActiveDirections] =
|
|
16287
|
-
const handlePress =
|
|
16316
|
+
const [activeDirections, setActiveDirections] = React118.useState(/* @__PURE__ */ new Set());
|
|
16317
|
+
const handlePress = React118.useCallback(
|
|
16288
16318
|
(direction) => {
|
|
16289
16319
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
16290
16320
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -16292,7 +16322,7 @@ function DPad({
|
|
|
16292
16322
|
},
|
|
16293
16323
|
[directionEvent, eventBus, onDirection]
|
|
16294
16324
|
);
|
|
16295
|
-
const handleRelease =
|
|
16325
|
+
const handleRelease = React118.useCallback(
|
|
16296
16326
|
(direction) => {
|
|
16297
16327
|
setActiveDirections((prev) => {
|
|
16298
16328
|
const next = new Set(prev);
|
|
@@ -17069,7 +17099,7 @@ var DataList = ({
|
|
|
17069
17099
|
}) => {
|
|
17070
17100
|
const eventBus = useEventBus();
|
|
17071
17101
|
const { t } = useTranslate();
|
|
17072
|
-
const [visibleCount, setVisibleCount] =
|
|
17102
|
+
const [visibleCount, setVisibleCount] = React118__default.useState(pageSize || Infinity);
|
|
17073
17103
|
const fields = fieldsProp ?? columnsProp ?? [];
|
|
17074
17104
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
17075
17105
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
@@ -17106,7 +17136,7 @@ var DataList = ({
|
|
|
17106
17136
|
const items2 = data.map((item) => item);
|
|
17107
17137
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
17108
17138
|
const contentField = titleField?.name ?? fields[0]?.name ?? "";
|
|
17109
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
17139
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
|
|
17110
17140
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
17111
17141
|
group.items.map((itemData, index) => {
|
|
17112
17142
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -17309,7 +17339,7 @@ var DataList = ({
|
|
|
17309
17339
|
className
|
|
17310
17340
|
),
|
|
17311
17341
|
children: [
|
|
17312
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
17342
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
|
|
17313
17343
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
17314
17344
|
group.items.map(
|
|
17315
17345
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -18278,7 +18308,7 @@ var WizardProgress = ({
|
|
|
18278
18308
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: steps.map((step, index) => {
|
|
18279
18309
|
const isActive = index === currentStep;
|
|
18280
18310
|
const isCompleted = index < currentStep;
|
|
18281
|
-
return /* @__PURE__ */ jsxs(
|
|
18311
|
+
return /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
|
|
18282
18312
|
/* @__PURE__ */ jsx(
|
|
18283
18313
|
"button",
|
|
18284
18314
|
{
|
|
@@ -19103,7 +19133,7 @@ function InventoryGrid({
|
|
|
19103
19133
|
const eventBus = useEventBus();
|
|
19104
19134
|
const slotCount = totalSlots ?? items.length;
|
|
19105
19135
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
19106
|
-
const handleSelect =
|
|
19136
|
+
const handleSelect = React118.useCallback(
|
|
19107
19137
|
(id) => {
|
|
19108
19138
|
onSelect?.(id);
|
|
19109
19139
|
if (selectEvent) {
|
|
@@ -19276,15 +19306,15 @@ function GameCanvas2D({
|
|
|
19276
19306
|
fps = 60,
|
|
19277
19307
|
className
|
|
19278
19308
|
}) {
|
|
19279
|
-
const canvasRef =
|
|
19280
|
-
const rafRef =
|
|
19281
|
-
const frameRef =
|
|
19282
|
-
const lastTimeRef =
|
|
19283
|
-
const onDrawRef =
|
|
19309
|
+
const canvasRef = React118.useRef(null);
|
|
19310
|
+
const rafRef = React118.useRef(0);
|
|
19311
|
+
const frameRef = React118.useRef(0);
|
|
19312
|
+
const lastTimeRef = React118.useRef(0);
|
|
19313
|
+
const onDrawRef = React118.useRef(onDraw);
|
|
19284
19314
|
onDrawRef.current = onDraw;
|
|
19285
|
-
const onTickRef =
|
|
19315
|
+
const onTickRef = React118.useRef(onTick);
|
|
19286
19316
|
onTickRef.current = onTick;
|
|
19287
|
-
|
|
19317
|
+
React118.useEffect(() => {
|
|
19288
19318
|
const canvas = canvasRef.current;
|
|
19289
19319
|
if (!canvas) return;
|
|
19290
19320
|
const ctx = canvas.getContext("2d");
|
|
@@ -19537,7 +19567,7 @@ function TurnPanel({
|
|
|
19537
19567
|
className
|
|
19538
19568
|
}) {
|
|
19539
19569
|
const eventBus = useEventBus();
|
|
19540
|
-
const handleAction =
|
|
19570
|
+
const handleAction = React118.useCallback(
|
|
19541
19571
|
(event) => {
|
|
19542
19572
|
if (event) {
|
|
19543
19573
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -19662,7 +19692,7 @@ function UnitCommandBar({
|
|
|
19662
19692
|
className
|
|
19663
19693
|
}) {
|
|
19664
19694
|
const eventBus = useEventBus();
|
|
19665
|
-
const handleCommand =
|
|
19695
|
+
const handleCommand = React118.useCallback(
|
|
19666
19696
|
(event) => {
|
|
19667
19697
|
if (event) {
|
|
19668
19698
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -20121,7 +20151,7 @@ function GameMenu({
|
|
|
20121
20151
|
} catch {
|
|
20122
20152
|
}
|
|
20123
20153
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
20124
|
-
const handleOptionClick =
|
|
20154
|
+
const handleOptionClick = React118.useCallback(
|
|
20125
20155
|
(option) => {
|
|
20126
20156
|
if (option.event && eventBus) {
|
|
20127
20157
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -20244,7 +20274,7 @@ function GameOverScreen({
|
|
|
20244
20274
|
} catch {
|
|
20245
20275
|
}
|
|
20246
20276
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
20247
|
-
const handleActionClick =
|
|
20277
|
+
const handleActionClick = React118.useCallback(
|
|
20248
20278
|
(action) => {
|
|
20249
20279
|
if (action.event && eventBus) {
|
|
20250
20280
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -23344,7 +23374,7 @@ var DocumentViewer = ({
|
|
|
23344
23374
|
};
|
|
23345
23375
|
DocumentViewer.displayName = "DocumentViewer";
|
|
23346
23376
|
function extractTitle(children) {
|
|
23347
|
-
if (!
|
|
23377
|
+
if (!React118__default.isValidElement(children)) return void 0;
|
|
23348
23378
|
const props = children.props;
|
|
23349
23379
|
if (typeof props.title === "string") {
|
|
23350
23380
|
return props.title;
|
|
@@ -23396,7 +23426,7 @@ function LinearView({
|
|
|
23396
23426
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
23397
23427
|
const isDone = i < currentIdx;
|
|
23398
23428
|
const isCurrent = i === currentIdx;
|
|
23399
|
-
return /* @__PURE__ */ jsxs(
|
|
23429
|
+
return /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
|
|
23400
23430
|
i > 0 && /* @__PURE__ */ jsx(
|
|
23401
23431
|
Typography,
|
|
23402
23432
|
{
|
|
@@ -24062,7 +24092,7 @@ var Form = ({
|
|
|
24062
24092
|
const normalizedInitialData = initialData ?? {};
|
|
24063
24093
|
const resolvedEntity = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
24064
24094
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
24065
|
-
const entityDerivedFields =
|
|
24095
|
+
const entityDerivedFields = React118__default.useMemo(() => {
|
|
24066
24096
|
if (fields && fields.length > 0) return void 0;
|
|
24067
24097
|
if (!resolvedEntity) return void 0;
|
|
24068
24098
|
return resolvedEntity.fields.map(
|
|
@@ -24081,14 +24111,14 @@ var Form = ({
|
|
|
24081
24111
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
24082
24112
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
24083
24113
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
24084
|
-
const [formData, setFormData] =
|
|
24114
|
+
const [formData, setFormData] = React118__default.useState(
|
|
24085
24115
|
normalizedInitialData
|
|
24086
24116
|
);
|
|
24087
|
-
const [collapsedSections, setCollapsedSections] =
|
|
24117
|
+
const [collapsedSections, setCollapsedSections] = React118__default.useState(
|
|
24088
24118
|
/* @__PURE__ */ new Set()
|
|
24089
24119
|
);
|
|
24090
24120
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
24091
|
-
const evalContext =
|
|
24121
|
+
const evalContext = React118__default.useMemo(
|
|
24092
24122
|
() => ({
|
|
24093
24123
|
formValues: formData,
|
|
24094
24124
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -24097,13 +24127,13 @@ var Form = ({
|
|
|
24097
24127
|
}),
|
|
24098
24128
|
[formData, externalContext]
|
|
24099
24129
|
);
|
|
24100
|
-
|
|
24130
|
+
React118__default.useEffect(() => {
|
|
24101
24131
|
const data = initialData;
|
|
24102
24132
|
if (data && Object.keys(data).length > 0) {
|
|
24103
24133
|
setFormData(data);
|
|
24104
24134
|
}
|
|
24105
24135
|
}, [initialData]);
|
|
24106
|
-
const processCalculations =
|
|
24136
|
+
const processCalculations = React118__default.useCallback(
|
|
24107
24137
|
(changedFieldId, newFormData) => {
|
|
24108
24138
|
if (!hiddenCalculations.length) return;
|
|
24109
24139
|
const context = {
|
|
@@ -24128,7 +24158,7 @@ var Form = ({
|
|
|
24128
24158
|
},
|
|
24129
24159
|
[hiddenCalculations, externalContext, eventBus]
|
|
24130
24160
|
);
|
|
24131
|
-
const checkViolations =
|
|
24161
|
+
const checkViolations = React118__default.useCallback(
|
|
24132
24162
|
(changedFieldId, newFormData) => {
|
|
24133
24163
|
if (!violationTriggers.length) return;
|
|
24134
24164
|
const context = {
|
|
@@ -24165,7 +24195,7 @@ var Form = ({
|
|
|
24165
24195
|
processCalculations(name, newFormData);
|
|
24166
24196
|
checkViolations(name, newFormData);
|
|
24167
24197
|
};
|
|
24168
|
-
const isFieldVisible =
|
|
24198
|
+
const isFieldVisible = React118__default.useCallback(
|
|
24169
24199
|
(fieldName) => {
|
|
24170
24200
|
const condition = conditionalFields[fieldName];
|
|
24171
24201
|
if (!condition) return true;
|
|
@@ -24173,7 +24203,7 @@ var Form = ({
|
|
|
24173
24203
|
},
|
|
24174
24204
|
[conditionalFields, evalContext]
|
|
24175
24205
|
);
|
|
24176
|
-
const isSectionVisible =
|
|
24206
|
+
const isSectionVisible = React118__default.useCallback(
|
|
24177
24207
|
(section) => {
|
|
24178
24208
|
if (!section.condition) return true;
|
|
24179
24209
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -24205,7 +24235,7 @@ var Form = ({
|
|
|
24205
24235
|
eventBus.emit(`UI:${onCancel}`);
|
|
24206
24236
|
}
|
|
24207
24237
|
};
|
|
24208
|
-
const renderField =
|
|
24238
|
+
const renderField = React118__default.useCallback(
|
|
24209
24239
|
(field) => {
|
|
24210
24240
|
const fieldName = field.name || field.field;
|
|
24211
24241
|
if (!fieldName) return null;
|
|
@@ -24226,7 +24256,7 @@ var Form = ({
|
|
|
24226
24256
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
24227
24257
|
);
|
|
24228
24258
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
24229
|
-
const normalizedFields =
|
|
24259
|
+
const normalizedFields = React118__default.useMemo(() => {
|
|
24230
24260
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
24231
24261
|
return effectiveFields.map((field) => {
|
|
24232
24262
|
if (typeof field === "string") {
|
|
@@ -24248,7 +24278,7 @@ var Form = ({
|
|
|
24248
24278
|
return field;
|
|
24249
24279
|
});
|
|
24250
24280
|
}, [effectiveFields, resolvedEntity]);
|
|
24251
|
-
const schemaFields =
|
|
24281
|
+
const schemaFields = React118__default.useMemo(() => {
|
|
24252
24282
|
if (normalizedFields.length === 0) return null;
|
|
24253
24283
|
if (isDebugEnabled()) {
|
|
24254
24284
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -24258,7 +24288,7 @@ var Form = ({
|
|
|
24258
24288
|
}
|
|
24259
24289
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
24260
24290
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
24261
|
-
const sectionElements =
|
|
24291
|
+
const sectionElements = React118__default.useMemo(() => {
|
|
24262
24292
|
if (!sections || sections.length === 0) return null;
|
|
24263
24293
|
return sections.map((section) => {
|
|
24264
24294
|
if (!isSectionVisible(section)) {
|
|
@@ -25662,7 +25692,7 @@ var List2 = ({
|
|
|
25662
25692
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
25663
25693
|
return [];
|
|
25664
25694
|
}, [entity]);
|
|
25665
|
-
const getItemActions =
|
|
25695
|
+
const getItemActions = React118__default.useCallback(
|
|
25666
25696
|
(item) => {
|
|
25667
25697
|
if (!itemActions) return [];
|
|
25668
25698
|
if (typeof itemActions === "function") {
|
|
@@ -26088,7 +26118,7 @@ var MediaGallery = ({
|
|
|
26088
26118
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
26089
26119
|
);
|
|
26090
26120
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
26091
|
-
const items =
|
|
26121
|
+
const items = React118__default.useMemo(() => {
|
|
26092
26122
|
if (propItems) return propItems;
|
|
26093
26123
|
if (entityData.length === 0) return [];
|
|
26094
26124
|
return entityData.map((record, idx) => ({
|
|
@@ -26250,7 +26280,7 @@ var MediaGallery = ({
|
|
|
26250
26280
|
};
|
|
26251
26281
|
MediaGallery.displayName = "MediaGallery";
|
|
26252
26282
|
function extractTitle2(children) {
|
|
26253
|
-
if (!
|
|
26283
|
+
if (!React118__default.isValidElement(children)) return void 0;
|
|
26254
26284
|
const props = children.props;
|
|
26255
26285
|
if (typeof props.title === "string") {
|
|
26256
26286
|
return props.title;
|
|
@@ -26920,7 +26950,7 @@ var PageHeader = ({
|
|
|
26920
26950
|
info: "bg-info/10 text-info"
|
|
26921
26951
|
};
|
|
26922
26952
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
26923
|
-
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(
|
|
26953
|
+
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(React118__default.Fragment, { children: [
|
|
26924
26954
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
26925
26955
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
26926
26956
|
"a",
|
|
@@ -27046,7 +27076,7 @@ function subscribeToDebugEvents(listener) {
|
|
|
27046
27076
|
|
|
27047
27077
|
// components/organisms/debug/hooks/useDebugData.ts
|
|
27048
27078
|
function useDebugData() {
|
|
27049
|
-
const [data, setData] =
|
|
27079
|
+
const [data, setData] = React118.useState(() => ({
|
|
27050
27080
|
traits: [],
|
|
27051
27081
|
ticks: [],
|
|
27052
27082
|
guards: [],
|
|
@@ -27060,7 +27090,7 @@ function useDebugData() {
|
|
|
27060
27090
|
},
|
|
27061
27091
|
lastUpdate: Date.now()
|
|
27062
27092
|
}));
|
|
27063
|
-
|
|
27093
|
+
React118.useEffect(() => {
|
|
27064
27094
|
const updateData = () => {
|
|
27065
27095
|
setData({
|
|
27066
27096
|
traits: getAllTraits(),
|
|
@@ -27329,15 +27359,15 @@ var TYPE_BADGES = {
|
|
|
27329
27359
|
state: { variant: "danger", icon: "\u{1F4CA}" }
|
|
27330
27360
|
};
|
|
27331
27361
|
function EventFlowTab({ events: events2 }) {
|
|
27332
|
-
const [filter, setFilter] =
|
|
27333
|
-
const containerRef =
|
|
27334
|
-
const [autoScroll, setAutoScroll] =
|
|
27335
|
-
|
|
27362
|
+
const [filter, setFilter] = React118.useState("all");
|
|
27363
|
+
const containerRef = React118.useRef(null);
|
|
27364
|
+
const [autoScroll, setAutoScroll] = React118.useState(true);
|
|
27365
|
+
React118.useEffect(() => {
|
|
27336
27366
|
if (autoScroll && containerRef.current) {
|
|
27337
27367
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
27338
27368
|
}
|
|
27339
27369
|
}, [events2.length, autoScroll]);
|
|
27340
|
-
const filteredEvents =
|
|
27370
|
+
const filteredEvents = React118.useMemo(() => {
|
|
27341
27371
|
if (filter === "all") return events2;
|
|
27342
27372
|
return events2.filter((e) => e.type === filter);
|
|
27343
27373
|
}, [events2, filter]);
|
|
@@ -27436,7 +27466,7 @@ function EventFlowTab({ events: events2 }) {
|
|
|
27436
27466
|
}
|
|
27437
27467
|
EventFlowTab.displayName = "EventFlowTab";
|
|
27438
27468
|
function GuardsPanel({ guards }) {
|
|
27439
|
-
const [filter, setFilter] =
|
|
27469
|
+
const [filter, setFilter] = React118.useState("all");
|
|
27440
27470
|
if (guards.length === 0) {
|
|
27441
27471
|
return /* @__PURE__ */ jsx(
|
|
27442
27472
|
EmptyState,
|
|
@@ -27449,7 +27479,7 @@ function GuardsPanel({ guards }) {
|
|
|
27449
27479
|
}
|
|
27450
27480
|
const passedCount = guards.filter((g) => g.result).length;
|
|
27451
27481
|
const failedCount = guards.length - passedCount;
|
|
27452
|
-
const filteredGuards =
|
|
27482
|
+
const filteredGuards = React118.useMemo(() => {
|
|
27453
27483
|
if (filter === "all") return guards;
|
|
27454
27484
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
27455
27485
|
return guards.filter((g) => !g.result);
|
|
@@ -27593,10 +27623,10 @@ function EffectBadge({ effect }) {
|
|
|
27593
27623
|
] });
|
|
27594
27624
|
}
|
|
27595
27625
|
function TransitionTimeline({ transitions }) {
|
|
27596
|
-
const containerRef =
|
|
27597
|
-
const [autoScroll, setAutoScroll] =
|
|
27598
|
-
const [expandedId, setExpandedId] =
|
|
27599
|
-
|
|
27626
|
+
const containerRef = React118.useRef(null);
|
|
27627
|
+
const [autoScroll, setAutoScroll] = React118.useState(true);
|
|
27628
|
+
const [expandedId, setExpandedId] = React118.useState(null);
|
|
27629
|
+
React118.useEffect(() => {
|
|
27600
27630
|
if (autoScroll && containerRef.current) {
|
|
27601
27631
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
27602
27632
|
}
|
|
@@ -27857,9 +27887,9 @@ function getAllEvents(traits2) {
|
|
|
27857
27887
|
}
|
|
27858
27888
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
27859
27889
|
const eventBus = useEventBus();
|
|
27860
|
-
const [log, setLog] =
|
|
27861
|
-
const prevStatesRef =
|
|
27862
|
-
|
|
27890
|
+
const [log, setLog] = React118.useState([]);
|
|
27891
|
+
const prevStatesRef = React118.useRef(/* @__PURE__ */ new Map());
|
|
27892
|
+
React118.useEffect(() => {
|
|
27863
27893
|
for (const trait of traits2) {
|
|
27864
27894
|
const prev = prevStatesRef.current.get(trait.id);
|
|
27865
27895
|
if (prev && prev !== trait.currentState) {
|
|
@@ -28012,9 +28042,9 @@ function VerifyModePanel({
|
|
|
28012
28042
|
serverCount,
|
|
28013
28043
|
localCount
|
|
28014
28044
|
}) {
|
|
28015
|
-
const scrollRef =
|
|
28016
|
-
const prevCountRef =
|
|
28017
|
-
|
|
28045
|
+
const scrollRef = React118.useRef(null);
|
|
28046
|
+
const prevCountRef = React118.useRef(0);
|
|
28047
|
+
React118.useEffect(() => {
|
|
28018
28048
|
if (transitions.length > prevCountRef.current && scrollRef.current) {
|
|
28019
28049
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
28020
28050
|
}
|
|
@@ -28055,10 +28085,10 @@ function RuntimeDebugger({
|
|
|
28055
28085
|
defaultTab,
|
|
28056
28086
|
schema
|
|
28057
28087
|
}) {
|
|
28058
|
-
const [isCollapsed, setIsCollapsed] =
|
|
28059
|
-
const [isVisible, setIsVisible] =
|
|
28088
|
+
const [isCollapsed, setIsCollapsed] = React118.useState(mode === "verify" ? true : defaultCollapsed);
|
|
28089
|
+
const [isVisible, setIsVisible] = React118.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
28060
28090
|
const debugData = useDebugData();
|
|
28061
|
-
|
|
28091
|
+
React118.useEffect(() => {
|
|
28062
28092
|
if (mode === "inline") return;
|
|
28063
28093
|
return onDebugToggle((enabled) => {
|
|
28064
28094
|
setIsVisible(enabled);
|
|
@@ -28067,7 +28097,7 @@ function RuntimeDebugger({
|
|
|
28067
28097
|
}
|
|
28068
28098
|
});
|
|
28069
28099
|
}, [mode]);
|
|
28070
|
-
|
|
28100
|
+
React118.useEffect(() => {
|
|
28071
28101
|
if (mode === "inline") return;
|
|
28072
28102
|
const handleKeyDown = (e) => {
|
|
28073
28103
|
if (e.key === "`" && isVisible) {
|
|
@@ -28572,7 +28602,7 @@ function SequenceBar({
|
|
|
28572
28602
|
onSlotRemove(index);
|
|
28573
28603
|
}, [onSlotRemove, playing]);
|
|
28574
28604
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
28575
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
28605
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
|
|
28576
28606
|
i > 0 && /* @__PURE__ */ jsx(
|
|
28577
28607
|
Typography,
|
|
28578
28608
|
{
|
|
@@ -28693,7 +28723,7 @@ function SequencerBoard({
|
|
|
28693
28723
|
setPlayState("playing");
|
|
28694
28724
|
setCurrentStep(0);
|
|
28695
28725
|
let step = 0;
|
|
28696
|
-
const
|
|
28726
|
+
const advance2 = () => {
|
|
28697
28727
|
step++;
|
|
28698
28728
|
if (step >= entity.maxSlots) {
|
|
28699
28729
|
const playerSeq = slots.map((s) => s?.id);
|
|
@@ -28724,10 +28754,10 @@ function SequencerBoard({
|
|
|
28724
28754
|
}
|
|
28725
28755
|
} else {
|
|
28726
28756
|
setCurrentStep(step);
|
|
28727
|
-
timerRef.current = setTimeout(
|
|
28757
|
+
timerRef.current = setTimeout(advance2, stepDurationMs);
|
|
28728
28758
|
}
|
|
28729
28759
|
};
|
|
28730
|
-
timerRef.current = setTimeout(
|
|
28760
|
+
timerRef.current = setTimeout(advance2, stepDurationMs);
|
|
28731
28761
|
}, [canPlay, slots, entity.maxSlots, entity.solutions, stepDurationMs, playEvent, completeEvent, emit]);
|
|
28732
28762
|
const machine = {
|
|
28733
28763
|
name: entity.title,
|
|
@@ -29810,7 +29840,7 @@ var StatCard = ({
|
|
|
29810
29840
|
const labelToUse = propLabel ?? propTitle;
|
|
29811
29841
|
const eventBus = useEventBus();
|
|
29812
29842
|
const { t } = useTranslate();
|
|
29813
|
-
const handleActionClick =
|
|
29843
|
+
const handleActionClick = React118__default.useCallback(() => {
|
|
29814
29844
|
if (action?.event) {
|
|
29815
29845
|
eventBus.emit(`UI:${action.event}`, {});
|
|
29816
29846
|
}
|
|
@@ -29821,7 +29851,7 @@ var StatCard = ({
|
|
|
29821
29851
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
29822
29852
|
const isLoading = externalLoading ?? false;
|
|
29823
29853
|
const error = externalError;
|
|
29824
|
-
const computeMetricValue =
|
|
29854
|
+
const computeMetricValue = React118__default.useCallback(
|
|
29825
29855
|
(metric, items) => {
|
|
29826
29856
|
if (metric.value !== void 0) {
|
|
29827
29857
|
return metric.value;
|
|
@@ -29860,7 +29890,7 @@ var StatCard = ({
|
|
|
29860
29890
|
},
|
|
29861
29891
|
[]
|
|
29862
29892
|
);
|
|
29863
|
-
const schemaStats =
|
|
29893
|
+
const schemaStats = React118__default.useMemo(() => {
|
|
29864
29894
|
if (!metrics || metrics.length === 0) return null;
|
|
29865
29895
|
return metrics.map((metric) => ({
|
|
29866
29896
|
label: metric.label,
|
|
@@ -29868,7 +29898,7 @@ var StatCard = ({
|
|
|
29868
29898
|
format: metric.format
|
|
29869
29899
|
}));
|
|
29870
29900
|
}, [metrics, data, computeMetricValue]);
|
|
29871
|
-
const calculatedTrend =
|
|
29901
|
+
const calculatedTrend = React118__default.useMemo(() => {
|
|
29872
29902
|
if (manualTrend !== void 0) return manualTrend;
|
|
29873
29903
|
if (previousValue === void 0 || currentValue === void 0)
|
|
29874
29904
|
return void 0;
|
|
@@ -30779,7 +30809,7 @@ var Timeline = ({
|
|
|
30779
30809
|
}) => {
|
|
30780
30810
|
const { t } = useTranslate();
|
|
30781
30811
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
30782
|
-
const items =
|
|
30812
|
+
const items = React118__default.useMemo(() => {
|
|
30783
30813
|
if (propItems) return propItems;
|
|
30784
30814
|
if (entityData.length === 0) return [];
|
|
30785
30815
|
return entityData.map((record, idx) => {
|
|
@@ -30881,7 +30911,7 @@ var Timeline = ({
|
|
|
30881
30911
|
};
|
|
30882
30912
|
Timeline.displayName = "Timeline";
|
|
30883
30913
|
function extractToastProps(children) {
|
|
30884
|
-
if (!
|
|
30914
|
+
if (!React118__default.isValidElement(children)) {
|
|
30885
30915
|
if (typeof children === "string") {
|
|
30886
30916
|
return { message: children };
|
|
30887
30917
|
}
|
|
@@ -30912,7 +30942,7 @@ var ToastSlot = ({
|
|
|
30912
30942
|
eventBus.emit("UI:CLOSE");
|
|
30913
30943
|
};
|
|
30914
30944
|
if (!isVisible) return null;
|
|
30915
|
-
const isCustomContent =
|
|
30945
|
+
const isCustomContent = React118__default.isValidElement(children) && !message;
|
|
30916
30946
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
30917
30947
|
Toast,
|
|
30918
30948
|
{
|
|
@@ -31156,7 +31186,7 @@ var WizardContainer = ({
|
|
|
31156
31186
|
const isCompleted = index < currentStep;
|
|
31157
31187
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
31158
31188
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
31159
|
-
return /* @__PURE__ */ jsxs(
|
|
31189
|
+
return /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
|
|
31160
31190
|
/* @__PURE__ */ jsx(
|
|
31161
31191
|
Button,
|
|
31162
31192
|
{
|
|
@@ -31522,12 +31552,12 @@ WorldMapTemplate.displayName = "WorldMapTemplate";
|
|
|
31522
31552
|
|
|
31523
31553
|
// components/organisms/component-registry.generated.ts
|
|
31524
31554
|
function lazyThree(name, loader) {
|
|
31525
|
-
const Lazy =
|
|
31555
|
+
const Lazy = React118__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
31526
31556
|
function ThreeWrapper(props) {
|
|
31527
|
-
return
|
|
31528
|
-
|
|
31557
|
+
return React118__default.createElement(
|
|
31558
|
+
React118__default.Suspense,
|
|
31529
31559
|
{ fallback: null },
|
|
31530
|
-
|
|
31560
|
+
React118__default.createElement(Lazy, props)
|
|
31531
31561
|
);
|
|
31532
31562
|
}
|
|
31533
31563
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -31815,7 +31845,7 @@ function SuspenseConfigProvider({
|
|
|
31815
31845
|
config,
|
|
31816
31846
|
children
|
|
31817
31847
|
}) {
|
|
31818
|
-
return
|
|
31848
|
+
return React118__default.createElement(
|
|
31819
31849
|
SuspenseConfigContext.Provider,
|
|
31820
31850
|
{ value: config },
|
|
31821
31851
|
children
|
|
@@ -32544,7 +32574,7 @@ function OrbitalProvider({
|
|
|
32544
32574
|
() => ({ enabled: suspense }),
|
|
32545
32575
|
[suspense]
|
|
32546
32576
|
);
|
|
32547
|
-
const inner = /* @__PURE__ */ jsx(EventBusProvider, { debug: debug2, children: /* @__PURE__ */ jsx(VerificationProvider, { enabled: verification, children: /* @__PURE__ */ jsx(SelectionProvider, { debug: debug2, children: /* @__PURE__ */ jsx(SuspenseConfigProvider, { config: suspenseConfig, children }) }) }) });
|
|
32577
|
+
const inner = /* @__PURE__ */ jsx(EntityStoreProvider, { children: /* @__PURE__ */ jsx(EventBusProvider, { debug: debug2, children: /* @__PURE__ */ jsx(VerificationProvider, { enabled: verification, children: /* @__PURE__ */ jsx(SelectionProvider, { debug: debug2, children: /* @__PURE__ */ jsx(SuspenseConfigProvider, { config: suspenseConfig, children }) }) }) }) });
|
|
32548
32578
|
if (skipTheme) {
|
|
32549
32579
|
return inner;
|
|
32550
32580
|
}
|