@almadar/ui 5.89.0 → 5.93.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 +1350 -1562
- package/dist/avl/index.js +353 -565
- package/dist/components/game/2d/atoms/DialogueBubble.d.ts +9 -1
- package/dist/components/game/2d/atoms/GameCard.d.ts +7 -1
- package/dist/components/game/2d/molecules/Canvas2D.d.ts +9 -1
- package/dist/components/game/2d/{organisms → molecules}/ObjectRulePanel.d.ts +9 -4
- package/dist/components/game/2d/{organisms → molecules}/SequenceBar.d.ts +15 -5
- package/dist/components/game/2d/molecules/StateJsonView.d.ts +37 -0
- package/dist/components/game/2d/{organisms → molecules}/TraitSlot.d.ts +6 -3
- package/dist/components/game/2d/{organisms → molecules}/TraitStateViewer.d.ts +0 -2
- package/dist/components/game/2d/molecules/VariablePanel.d.ts +28 -0
- package/dist/components/game/2d/molecules/index.d.ts +12 -16
- package/dist/components/game/2d/organisms/EventHandlerBoard.d.ts +1 -1
- package/dist/components/game/shared/lib/puzzleObject.d.ts +1 -1
- package/dist/components/game/shared/spriteAnimationTypes.d.ts +10 -35
- package/dist/components/index.cjs +121 -420
- package/dist/components/index.js +123 -419
- package/dist/lib/verificationRegistry.d.ts +1 -1
- package/dist/providers/index.cjs +1214 -1398
- package/dist/providers/index.js +324 -508
- package/dist/runtime/index.cjs +1211 -1423
- package/dist/runtime/index.js +333 -545
- package/package.json +3 -3
- package/dist/components/game/2d/organisms/SimulationCanvas.d.ts +0 -27
- package/dist/components/game/2d/organisms/SimulationControls.d.ts +0 -51
- package/dist/components/game/2d/organisms/SimulationGraph.d.ts +0 -25
- package/dist/components/game/2d/organisms/StateJsonView.d.ts +0 -17
- package/dist/components/game/2d/organisms/VariablePanel.d.ts +0 -22
- /package/dist/components/game/2d/{organisms → molecules}/ActionPalette.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/ActionTile.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/EventLog.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/RuleEditor.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/StateNode.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/TransitionArrow.d.ts +0 -0
package/dist/runtime/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React95 from 'react';
|
|
2
|
+
import React95__default, { useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, createContext, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
|
|
3
3
|
import { EventBusContext, useTraitScope, useEntitySchemaOptional, useEntitySchema, getAllPages, OrbitalProvider, TraitScopeProvider, ServerBridgeProvider, useCurrentPagePath, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge } from '@almadar/ui/providers';
|
|
4
4
|
export { EntitySchemaProvider, ServerBridgeProvider, TraitContext, TraitProvider, useEntitySchema, useEntitySchemaOptional, useServerBridge, useTrait, useTraitContext } from '@almadar/ui/providers';
|
|
5
5
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
@@ -43,7 +43,7 @@ import { useSortable, arrayMove, sortableKeyboardCoordinates, SortableContext, r
|
|
|
43
43
|
import { CSS } from '@dnd-kit/utilities';
|
|
44
44
|
import { useNodeId, ReactFlowProvider, Handle, Position } from '@xyflow/react';
|
|
45
45
|
import { getPatternDefinition, getComponentForPattern as getComponentForPattern$1 } from '@almadar/patterns';
|
|
46
|
-
import { StateMachineManager, collectDeclaredConfigDefaults, createServerEffectHandlers, EffectExecutor, createContextFromBindings, InMemoryPersistence } from '@almadar/runtime';
|
|
46
|
+
import { StateMachineManager, collectDeclaredConfigDefaults, createServerEffectHandlers, EffectExecutor, createContextFromBindings, createTickScheduler, InMemoryPersistence } from '@almadar/runtime';
|
|
47
47
|
import { OrbitalServerRuntime } from '@almadar/runtime/OrbitalServerRuntime';
|
|
48
48
|
|
|
49
49
|
var __defProp = Object.defineProperty;
|
|
@@ -937,7 +937,7 @@ var init_Box = __esm({
|
|
|
937
937
|
fixed: "fixed",
|
|
938
938
|
sticky: "sticky"
|
|
939
939
|
};
|
|
940
|
-
Box =
|
|
940
|
+
Box = React95__default.forwardRef(
|
|
941
941
|
({
|
|
942
942
|
padding,
|
|
943
943
|
paddingX,
|
|
@@ -1002,7 +1002,7 @@ var init_Box = __esm({
|
|
|
1002
1002
|
onPointerDown?.(e);
|
|
1003
1003
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
1004
1004
|
const isClickable = action || onClick;
|
|
1005
|
-
return
|
|
1005
|
+
return React95__default.createElement(
|
|
1006
1006
|
Component,
|
|
1007
1007
|
{
|
|
1008
1008
|
ref,
|
|
@@ -1098,7 +1098,7 @@ function loadLib(key, importer) {
|
|
|
1098
1098
|
return p;
|
|
1099
1099
|
}
|
|
1100
1100
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
1101
|
-
const Lazy =
|
|
1101
|
+
const Lazy = React95__default.lazy(async () => {
|
|
1102
1102
|
const lib = await loadLib(libKey, importer);
|
|
1103
1103
|
const Comp = pick(lib);
|
|
1104
1104
|
if (!Comp) {
|
|
@@ -1108,7 +1108,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
1108
1108
|
return { default: Comp };
|
|
1109
1109
|
});
|
|
1110
1110
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
1111
|
-
|
|
1111
|
+
React95__default.Suspense,
|
|
1112
1112
|
{
|
|
1113
1113
|
fallback: /* @__PURE__ */ jsx(
|
|
1114
1114
|
"span",
|
|
@@ -1839,7 +1839,7 @@ var init_Icon = __esm({
|
|
|
1839
1839
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1840
1840
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1841
1841
|
const family = useIconFamily();
|
|
1842
|
-
const RenderedComponent =
|
|
1842
|
+
const RenderedComponent = React95__default.useMemo(() => {
|
|
1843
1843
|
if (directIcon) return null;
|
|
1844
1844
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1845
1845
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1901,7 +1901,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1901
1901
|
const IconComp = value;
|
|
1902
1902
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1903
1903
|
}
|
|
1904
|
-
if (
|
|
1904
|
+
if (React95__default.isValidElement(value)) {
|
|
1905
1905
|
return value;
|
|
1906
1906
|
}
|
|
1907
1907
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1977,7 +1977,7 @@ var init_Button = __esm({
|
|
|
1977
1977
|
md: "h-icon-default w-icon-default",
|
|
1978
1978
|
lg: "h-icon-default w-icon-default"
|
|
1979
1979
|
};
|
|
1980
|
-
Button =
|
|
1980
|
+
Button = React95__default.forwardRef(
|
|
1981
1981
|
({
|
|
1982
1982
|
className,
|
|
1983
1983
|
variant = "primary",
|
|
@@ -2045,7 +2045,7 @@ var Dialog;
|
|
|
2045
2045
|
var init_Dialog = __esm({
|
|
2046
2046
|
"components/core/atoms/Dialog.tsx"() {
|
|
2047
2047
|
init_cn();
|
|
2048
|
-
Dialog =
|
|
2048
|
+
Dialog = React95__default.forwardRef(
|
|
2049
2049
|
({
|
|
2050
2050
|
role = "dialog",
|
|
2051
2051
|
"aria-modal": ariaModal = true,
|
|
@@ -2163,7 +2163,7 @@ var init_Typography = __esm({
|
|
|
2163
2163
|
}) => {
|
|
2164
2164
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
2165
2165
|
const Component = as || defaultElements[variant];
|
|
2166
|
-
return
|
|
2166
|
+
return React95__default.createElement(
|
|
2167
2167
|
Component,
|
|
2168
2168
|
{
|
|
2169
2169
|
id,
|
|
@@ -2658,7 +2658,7 @@ var init_Badge = __esm({
|
|
|
2658
2658
|
md: "px-2.5 py-1 text-sm",
|
|
2659
2659
|
lg: "px-3 py-1.5 text-base"
|
|
2660
2660
|
};
|
|
2661
|
-
Badge =
|
|
2661
|
+
Badge = React95__default.forwardRef(
|
|
2662
2662
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2663
2663
|
const iconSizes3 = {
|
|
2664
2664
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2995,7 +2995,7 @@ var init_SvgFlow = __esm({
|
|
|
2995
2995
|
width = 100,
|
|
2996
2996
|
height = 100
|
|
2997
2997
|
}) => {
|
|
2998
|
-
const markerId =
|
|
2998
|
+
const markerId = React95__default.useMemo(() => {
|
|
2999
2999
|
flowIdCounter += 1;
|
|
3000
3000
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
3001
3001
|
}, []);
|
|
@@ -3588,7 +3588,7 @@ var init_SvgRing = __esm({
|
|
|
3588
3588
|
width = 100,
|
|
3589
3589
|
height = 100
|
|
3590
3590
|
}) => {
|
|
3591
|
-
const gradientId =
|
|
3591
|
+
const gradientId = React95__default.useMemo(() => {
|
|
3592
3592
|
ringIdCounter += 1;
|
|
3593
3593
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3594
3594
|
}, []);
|
|
@@ -3769,7 +3769,7 @@ var init_Input = __esm({
|
|
|
3769
3769
|
init_cn();
|
|
3770
3770
|
init_Icon();
|
|
3771
3771
|
init_useEventBus();
|
|
3772
|
-
Input =
|
|
3772
|
+
Input = React95__default.forwardRef(
|
|
3773
3773
|
({
|
|
3774
3774
|
className,
|
|
3775
3775
|
inputType,
|
|
@@ -3929,7 +3929,7 @@ var Label;
|
|
|
3929
3929
|
var init_Label = __esm({
|
|
3930
3930
|
"components/core/atoms/Label.tsx"() {
|
|
3931
3931
|
init_cn();
|
|
3932
|
-
Label =
|
|
3932
|
+
Label = React95__default.forwardRef(
|
|
3933
3933
|
({ className, required, children, ...props }, ref) => {
|
|
3934
3934
|
return /* @__PURE__ */ jsxs(
|
|
3935
3935
|
"label",
|
|
@@ -3956,7 +3956,7 @@ var init_Textarea = __esm({
|
|
|
3956
3956
|
"components/core/atoms/Textarea.tsx"() {
|
|
3957
3957
|
init_cn();
|
|
3958
3958
|
init_useEventBus();
|
|
3959
|
-
Textarea =
|
|
3959
|
+
Textarea = React95__default.forwardRef(
|
|
3960
3960
|
({ className, error, onChange, ...props }, ref) => {
|
|
3961
3961
|
const eventBus = useEventBus();
|
|
3962
3962
|
const handleChange = (e) => {
|
|
@@ -4195,7 +4195,7 @@ var init_Select = __esm({
|
|
|
4195
4195
|
init_cn();
|
|
4196
4196
|
init_Icon();
|
|
4197
4197
|
init_useEventBus();
|
|
4198
|
-
Select =
|
|
4198
|
+
Select = React95__default.forwardRef(
|
|
4199
4199
|
(props, _ref) => {
|
|
4200
4200
|
const { multiple, searchable, clearable } = props;
|
|
4201
4201
|
if (multiple || searchable || clearable) {
|
|
@@ -4212,7 +4212,7 @@ var init_Checkbox = __esm({
|
|
|
4212
4212
|
"components/core/atoms/Checkbox.tsx"() {
|
|
4213
4213
|
init_cn();
|
|
4214
4214
|
init_useEventBus();
|
|
4215
|
-
Checkbox =
|
|
4215
|
+
Checkbox = React95__default.forwardRef(
|
|
4216
4216
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
4217
4217
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
4218
4218
|
const eventBus = useEventBus();
|
|
@@ -4266,7 +4266,7 @@ var init_Spinner = __esm({
|
|
|
4266
4266
|
md: "h-6 w-6",
|
|
4267
4267
|
lg: "h-8 w-8"
|
|
4268
4268
|
};
|
|
4269
|
-
Spinner =
|
|
4269
|
+
Spinner = React95__default.forwardRef(
|
|
4270
4270
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
4271
4271
|
if (overlay) {
|
|
4272
4272
|
return /* @__PURE__ */ jsx(
|
|
@@ -4356,7 +4356,7 @@ var init_Card = __esm({
|
|
|
4356
4356
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
4357
4357
|
"tile-image-first": "p-0 overflow-hidden"
|
|
4358
4358
|
};
|
|
4359
|
-
Card =
|
|
4359
|
+
Card = React95__default.forwardRef(
|
|
4360
4360
|
({
|
|
4361
4361
|
className,
|
|
4362
4362
|
variant = "bordered",
|
|
@@ -4404,9 +4404,9 @@ var init_Card = __esm({
|
|
|
4404
4404
|
}
|
|
4405
4405
|
);
|
|
4406
4406
|
Card.displayName = "Card";
|
|
4407
|
-
CardHeader =
|
|
4407
|
+
CardHeader = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
4408
4408
|
CardHeader.displayName = "CardHeader";
|
|
4409
|
-
CardTitle =
|
|
4409
|
+
CardTitle = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4410
4410
|
"h3",
|
|
4411
4411
|
{
|
|
4412
4412
|
ref,
|
|
@@ -4419,11 +4419,11 @@ var init_Card = __esm({
|
|
|
4419
4419
|
}
|
|
4420
4420
|
));
|
|
4421
4421
|
CardTitle.displayName = "CardTitle";
|
|
4422
|
-
CardContent =
|
|
4422
|
+
CardContent = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
4423
4423
|
CardContent.displayName = "CardContent";
|
|
4424
4424
|
CardBody = CardContent;
|
|
4425
4425
|
CardBody.displayName = "CardBody";
|
|
4426
|
-
CardFooter =
|
|
4426
|
+
CardFooter = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4427
4427
|
"div",
|
|
4428
4428
|
{
|
|
4429
4429
|
ref,
|
|
@@ -4478,7 +4478,7 @@ var init_FilterPill = __esm({
|
|
|
4478
4478
|
md: "w-3.5 h-3.5",
|
|
4479
4479
|
lg: "w-4 h-4"
|
|
4480
4480
|
};
|
|
4481
|
-
FilterPill =
|
|
4481
|
+
FilterPill = React95__default.forwardRef(
|
|
4482
4482
|
({
|
|
4483
4483
|
className,
|
|
4484
4484
|
variant = "default",
|
|
@@ -4607,8 +4607,8 @@ var init_Avatar = __esm({
|
|
|
4607
4607
|
actionPayload
|
|
4608
4608
|
}) => {
|
|
4609
4609
|
const eventBus = useEventBus();
|
|
4610
|
-
const [imgFailed, setImgFailed] =
|
|
4611
|
-
|
|
4610
|
+
const [imgFailed, setImgFailed] = React95__default.useState(false);
|
|
4611
|
+
React95__default.useEffect(() => {
|
|
4612
4612
|
setImgFailed(false);
|
|
4613
4613
|
}, [src]);
|
|
4614
4614
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4721,7 +4721,7 @@ var init_Center = __esm({
|
|
|
4721
4721
|
as: Component = "div"
|
|
4722
4722
|
}) => {
|
|
4723
4723
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4724
|
-
return
|
|
4724
|
+
return React95__default.createElement(Component, {
|
|
4725
4725
|
className: cn(
|
|
4726
4726
|
inline ? "inline-flex" : "flex",
|
|
4727
4727
|
horizontal && "justify-center",
|
|
@@ -4989,7 +4989,7 @@ var init_Radio = __esm({
|
|
|
4989
4989
|
md: "w-2.5 h-2.5",
|
|
4990
4990
|
lg: "w-3 h-3"
|
|
4991
4991
|
};
|
|
4992
|
-
Radio =
|
|
4992
|
+
Radio = React95__default.forwardRef(
|
|
4993
4993
|
({
|
|
4994
4994
|
label,
|
|
4995
4995
|
helperText,
|
|
@@ -5006,12 +5006,12 @@ var init_Radio = __esm({
|
|
|
5006
5006
|
onChange,
|
|
5007
5007
|
...props
|
|
5008
5008
|
}, ref) => {
|
|
5009
|
-
const reactId =
|
|
5009
|
+
const reactId = React95__default.useId();
|
|
5010
5010
|
const baseId = id || `radio-${reactId}`;
|
|
5011
5011
|
const hasError = !!error;
|
|
5012
5012
|
const eventBus = useEventBus();
|
|
5013
|
-
const [selected, setSelected] =
|
|
5014
|
-
|
|
5013
|
+
const [selected, setSelected] = React95__default.useState(value);
|
|
5014
|
+
React95__default.useEffect(() => {
|
|
5015
5015
|
if (value !== void 0) setSelected(value);
|
|
5016
5016
|
}, [value]);
|
|
5017
5017
|
const pick = (next, e) => {
|
|
@@ -5193,7 +5193,7 @@ var init_Switch = __esm({
|
|
|
5193
5193
|
"components/core/atoms/Switch.tsx"() {
|
|
5194
5194
|
"use client";
|
|
5195
5195
|
init_cn();
|
|
5196
|
-
Switch =
|
|
5196
|
+
Switch = React95.forwardRef(
|
|
5197
5197
|
({
|
|
5198
5198
|
checked,
|
|
5199
5199
|
defaultChecked = false,
|
|
@@ -5204,10 +5204,10 @@ var init_Switch = __esm({
|
|
|
5204
5204
|
name,
|
|
5205
5205
|
className
|
|
5206
5206
|
}, ref) => {
|
|
5207
|
-
const [isChecked, setIsChecked] =
|
|
5207
|
+
const [isChecked, setIsChecked] = React95.useState(
|
|
5208
5208
|
checked !== void 0 ? checked : defaultChecked
|
|
5209
5209
|
);
|
|
5210
|
-
|
|
5210
|
+
React95.useEffect(() => {
|
|
5211
5211
|
if (checked !== void 0) {
|
|
5212
5212
|
setIsChecked(checked);
|
|
5213
5213
|
}
|
|
@@ -5370,7 +5370,7 @@ var init_Stack = __esm({
|
|
|
5370
5370
|
};
|
|
5371
5371
|
const isHorizontal = direction === "horizontal";
|
|
5372
5372
|
const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
|
|
5373
|
-
return
|
|
5373
|
+
return React95__default.createElement(
|
|
5374
5374
|
Component,
|
|
5375
5375
|
{
|
|
5376
5376
|
className: cn(
|
|
@@ -5570,7 +5570,7 @@ var Aside;
|
|
|
5570
5570
|
var init_Aside = __esm({
|
|
5571
5571
|
"components/core/atoms/Aside.tsx"() {
|
|
5572
5572
|
init_cn();
|
|
5573
|
-
Aside =
|
|
5573
|
+
Aside = React95__default.forwardRef(
|
|
5574
5574
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5575
5575
|
);
|
|
5576
5576
|
Aside.displayName = "Aside";
|
|
@@ -5649,9 +5649,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5649
5649
|
className
|
|
5650
5650
|
}) => {
|
|
5651
5651
|
const { t } = useTranslate();
|
|
5652
|
-
const [isVisible, setIsVisible] =
|
|
5653
|
-
const timeoutRef =
|
|
5654
|
-
const triggerRef =
|
|
5652
|
+
const [isVisible, setIsVisible] = React95__default.useState(false);
|
|
5653
|
+
const timeoutRef = React95__default.useRef(null);
|
|
5654
|
+
const triggerRef = React95__default.useRef(null);
|
|
5655
5655
|
const handleMouseEnter = () => {
|
|
5656
5656
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5657
5657
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5662,7 +5662,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5662
5662
|
};
|
|
5663
5663
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5664
5664
|
const open = isVisible || revealed;
|
|
5665
|
-
|
|
5665
|
+
React95__default.useEffect(() => {
|
|
5666
5666
|
return () => {
|
|
5667
5667
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5668
5668
|
};
|
|
@@ -5872,7 +5872,7 @@ var init_StatusDot = __esm({
|
|
|
5872
5872
|
md: "w-2.5 h-2.5",
|
|
5873
5873
|
lg: "w-3 h-3"
|
|
5874
5874
|
};
|
|
5875
|
-
StatusDot =
|
|
5875
|
+
StatusDot = React95__default.forwardRef(
|
|
5876
5876
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5877
5877
|
return /* @__PURE__ */ jsx(
|
|
5878
5878
|
"span",
|
|
@@ -5926,7 +5926,7 @@ var init_TrendIndicator = __esm({
|
|
|
5926
5926
|
down: "trending-down",
|
|
5927
5927
|
flat: "arrow-right"
|
|
5928
5928
|
};
|
|
5929
|
-
TrendIndicator =
|
|
5929
|
+
TrendIndicator = React95__default.forwardRef(
|
|
5930
5930
|
({
|
|
5931
5931
|
className,
|
|
5932
5932
|
value,
|
|
@@ -5993,7 +5993,7 @@ var init_RangeSlider = __esm({
|
|
|
5993
5993
|
md: "w-4 h-4",
|
|
5994
5994
|
lg: "w-5 h-5"
|
|
5995
5995
|
};
|
|
5996
|
-
RangeSlider =
|
|
5996
|
+
RangeSlider = React95__default.forwardRef(
|
|
5997
5997
|
({
|
|
5998
5998
|
className,
|
|
5999
5999
|
min = 0,
|
|
@@ -6552,7 +6552,7 @@ var init_ContentSection = __esm({
|
|
|
6552
6552
|
md: "py-16",
|
|
6553
6553
|
lg: "py-24"
|
|
6554
6554
|
};
|
|
6555
|
-
ContentSection =
|
|
6555
|
+
ContentSection = React95__default.forwardRef(
|
|
6556
6556
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
6557
6557
|
return /* @__PURE__ */ jsx(
|
|
6558
6558
|
Box,
|
|
@@ -7086,7 +7086,7 @@ var init_AnimatedReveal = __esm({
|
|
|
7086
7086
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
7087
7087
|
"none": {}
|
|
7088
7088
|
};
|
|
7089
|
-
AnimatedReveal =
|
|
7089
|
+
AnimatedReveal = React95__default.forwardRef(
|
|
7090
7090
|
({
|
|
7091
7091
|
trigger = "scroll",
|
|
7092
7092
|
animation = "fade-up",
|
|
@@ -7246,7 +7246,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
7246
7246
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
7247
7247
|
"use client";
|
|
7248
7248
|
init_cn();
|
|
7249
|
-
AnimatedGraphic =
|
|
7249
|
+
AnimatedGraphic = React95__default.forwardRef(
|
|
7250
7250
|
({
|
|
7251
7251
|
src,
|
|
7252
7252
|
svgContent,
|
|
@@ -7269,7 +7269,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
7269
7269
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
7270
7270
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
7271
7271
|
const prevAnimateRef = useRef(animate);
|
|
7272
|
-
const setRef =
|
|
7272
|
+
const setRef = React95__default.useCallback(
|
|
7273
7273
|
(node) => {
|
|
7274
7274
|
containerRef.current = node;
|
|
7275
7275
|
if (typeof ref === "function") ref(node);
|
|
@@ -7871,12 +7871,13 @@ function GameCard({
|
|
|
7871
7871
|
selected = false,
|
|
7872
7872
|
disabled = false,
|
|
7873
7873
|
size = "md",
|
|
7874
|
+
animState = "idle",
|
|
7874
7875
|
onClick,
|
|
7875
7876
|
clickEvent,
|
|
7876
7877
|
className
|
|
7877
7878
|
}) {
|
|
7878
7879
|
const eventBus = useEventBus();
|
|
7879
|
-
const handleClick =
|
|
7880
|
+
const handleClick = React95.useCallback(() => {
|
|
7880
7881
|
if (disabled) return;
|
|
7881
7882
|
onClick?.(id);
|
|
7882
7883
|
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
|
|
@@ -7898,6 +7899,7 @@ function GameCard({
|
|
|
7898
7899
|
cardSizeMap[size],
|
|
7899
7900
|
disabled ? "border-border opacity-50 cursor-not-allowed" : "border-accent hover:brightness-125 hover:-translate-y-1 cursor-pointer",
|
|
7900
7901
|
selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background -translate-y-1",
|
|
7902
|
+
ANIM_STATE_CLASS[animState],
|
|
7901
7903
|
className
|
|
7902
7904
|
),
|
|
7903
7905
|
children: [
|
|
@@ -7930,7 +7932,7 @@ function GameCard({
|
|
|
7930
7932
|
}
|
|
7931
7933
|
);
|
|
7932
7934
|
}
|
|
7933
|
-
var cardSizeMap, artPxMap;
|
|
7935
|
+
var cardSizeMap, artPxMap, ANIM_STATE_CLASS;
|
|
7934
7936
|
var init_GameCard = __esm({
|
|
7935
7937
|
"components/game/2d/atoms/GameCard.tsx"() {
|
|
7936
7938
|
"use client";
|
|
@@ -7946,6 +7948,12 @@ var init_GameCard = __esm({
|
|
|
7946
7948
|
lg: "w-24 h-36"
|
|
7947
7949
|
};
|
|
7948
7950
|
artPxMap = { sm: 40, md: 52, lg: 64 };
|
|
7951
|
+
ANIM_STATE_CLASS = {
|
|
7952
|
+
idle: "",
|
|
7953
|
+
drawn: "scale-105",
|
|
7954
|
+
played: "-translate-y-2 opacity-80",
|
|
7955
|
+
flipped: "scale-x-0"
|
|
7956
|
+
};
|
|
7949
7957
|
GameCard.displayName = "GameCard";
|
|
7950
7958
|
}
|
|
7951
7959
|
});
|
|
@@ -8158,9 +8166,9 @@ function ControlButton({
|
|
|
8158
8166
|
className
|
|
8159
8167
|
}) {
|
|
8160
8168
|
const eventBus = useEventBus();
|
|
8161
|
-
const [isPressed, setIsPressed] =
|
|
8169
|
+
const [isPressed, setIsPressed] = React95.useState(false);
|
|
8162
8170
|
const actualPressed = pressed ?? isPressed;
|
|
8163
|
-
const handlePointerDown =
|
|
8171
|
+
const handlePointerDown = React95.useCallback(
|
|
8164
8172
|
(e) => {
|
|
8165
8173
|
e.preventDefault();
|
|
8166
8174
|
if (disabled) return;
|
|
@@ -8170,7 +8178,7 @@ function ControlButton({
|
|
|
8170
8178
|
},
|
|
8171
8179
|
[disabled, pressEvent, eventBus, onPress]
|
|
8172
8180
|
);
|
|
8173
|
-
const handlePointerUp =
|
|
8181
|
+
const handlePointerUp = React95.useCallback(
|
|
8174
8182
|
(e) => {
|
|
8175
8183
|
e.preventDefault();
|
|
8176
8184
|
if (disabled) return;
|
|
@@ -8180,7 +8188,7 @@ function ControlButton({
|
|
|
8180
8188
|
},
|
|
8181
8189
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
8182
8190
|
);
|
|
8183
|
-
const handlePointerLeave =
|
|
8191
|
+
const handlePointerLeave = React95.useCallback(
|
|
8184
8192
|
(e) => {
|
|
8185
8193
|
if (isPressed) {
|
|
8186
8194
|
setIsPressed(false);
|
|
@@ -8986,8 +8994,11 @@ function DialogueBubble({
|
|
|
8986
8994
|
text = "The dungeon awaits. Choose your path wisely.",
|
|
8987
8995
|
portrait = DEFAULT_PORTRAIT,
|
|
8988
8996
|
position = "bottom",
|
|
8997
|
+
mood = "neutral",
|
|
8998
|
+
revealedChars,
|
|
8989
8999
|
className
|
|
8990
9000
|
}) {
|
|
9001
|
+
const visibleText = revealedChars === void 0 ? text : text.slice(0, revealedChars);
|
|
8991
9002
|
return /* @__PURE__ */ jsxs(
|
|
8992
9003
|
Box,
|
|
8993
9004
|
{
|
|
@@ -8997,16 +9008,16 @@ function DialogueBubble({
|
|
|
8997
9008
|
className
|
|
8998
9009
|
),
|
|
8999
9010
|
children: [
|
|
9000
|
-
portrait && /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 w-12 h-12 rounded-full overflow-hidden border-2
|
|
9011
|
+
portrait && /* @__PURE__ */ jsx(Box, { className: cn("flex-shrink-0 w-12 h-12 rounded-full overflow-hidden border-2 transition-colors duration-300", MOOD_RING_CLASS[mood]), children: /* @__PURE__ */ jsx(GameIcon, { assetUrl: portrait, icon: "image", size: 48, alt: speaker ?? "speaker", className: "w-full h-full object-cover" }) }),
|
|
9001
9012
|
/* @__PURE__ */ jsxs(Box, { className: "flex flex-col gap-1 min-w-0", children: [
|
|
9002
9013
|
speaker && /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm font-bold text-warning", children: speaker }),
|
|
9003
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm text-foreground leading-relaxed", children:
|
|
9014
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm text-foreground leading-relaxed", children: visibleText })
|
|
9004
9015
|
] })
|
|
9005
9016
|
]
|
|
9006
9017
|
}
|
|
9007
9018
|
);
|
|
9008
9019
|
}
|
|
9009
|
-
var DEFAULT_PORTRAIT;
|
|
9020
|
+
var DEFAULT_PORTRAIT, MOOD_RING_CLASS;
|
|
9010
9021
|
var init_DialogueBubble = __esm({
|
|
9011
9022
|
"components/game/2d/atoms/DialogueBubble.tsx"() {
|
|
9012
9023
|
init_cn();
|
|
@@ -9018,6 +9029,12 @@ var init_DialogueBubble = __esm({
|
|
|
9018
9029
|
role: "effect",
|
|
9019
9030
|
category: "character"
|
|
9020
9031
|
};
|
|
9032
|
+
MOOD_RING_CLASS = {
|
|
9033
|
+
neutral: "border-warning/60",
|
|
9034
|
+
happy: "border-success/70",
|
|
9035
|
+
concerned: "border-info/70",
|
|
9036
|
+
angry: "border-error/70"
|
|
9037
|
+
};
|
|
9021
9038
|
DialogueBubble.displayName = "DialogueBubble";
|
|
9022
9039
|
}
|
|
9023
9040
|
});
|
|
@@ -9199,8 +9216,8 @@ function MiniMap({
|
|
|
9199
9216
|
tileAssets,
|
|
9200
9217
|
unitAssets
|
|
9201
9218
|
}) {
|
|
9202
|
-
const canvasRef =
|
|
9203
|
-
const imgCacheRef =
|
|
9219
|
+
const canvasRef = React95.useRef(null);
|
|
9220
|
+
const imgCacheRef = React95.useRef(/* @__PURE__ */ new Map());
|
|
9204
9221
|
function loadImg(url) {
|
|
9205
9222
|
const cached = imgCacheRef.current.get(url);
|
|
9206
9223
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -9215,7 +9232,7 @@ function MiniMap({
|
|
|
9215
9232
|
imgCacheRef.current.set(url, img);
|
|
9216
9233
|
return null;
|
|
9217
9234
|
}
|
|
9218
|
-
|
|
9235
|
+
React95.useEffect(() => {
|
|
9219
9236
|
const canvas = canvasRef.current;
|
|
9220
9237
|
if (!canvas) return;
|
|
9221
9238
|
const ctx = canvas.getContext("2d");
|
|
@@ -9350,8 +9367,8 @@ function ControlGrid({
|
|
|
9350
9367
|
className
|
|
9351
9368
|
}) {
|
|
9352
9369
|
const eventBus = useEventBus();
|
|
9353
|
-
const [active, setActive] =
|
|
9354
|
-
const handlePress =
|
|
9370
|
+
const [active, setActive] = React95.useState(/* @__PURE__ */ new Set());
|
|
9371
|
+
const handlePress = React95.useCallback(
|
|
9355
9372
|
(id) => {
|
|
9356
9373
|
setActive((prev) => new Set(prev).add(id));
|
|
9357
9374
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9365,7 +9382,7 @@ function ControlGrid({
|
|
|
9365
9382
|
},
|
|
9366
9383
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
9367
9384
|
);
|
|
9368
|
-
const handleRelease =
|
|
9385
|
+
const handleRelease = React95.useCallback(
|
|
9369
9386
|
(id) => {
|
|
9370
9387
|
setActive((prev) => {
|
|
9371
9388
|
const next = new Set(prev);
|
|
@@ -9623,7 +9640,7 @@ function InventoryGrid({
|
|
|
9623
9640
|
const eventBus = useEventBus();
|
|
9624
9641
|
const slotCount = totalSlots ?? items.length;
|
|
9625
9642
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
9626
|
-
const handleSelect =
|
|
9643
|
+
const handleSelect = React95.useCallback(
|
|
9627
9644
|
(id) => {
|
|
9628
9645
|
onSelect?.(id);
|
|
9629
9646
|
if (selectEvent) {
|
|
@@ -9840,7 +9857,7 @@ function GameMenu({
|
|
|
9840
9857
|
}) {
|
|
9841
9858
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
9842
9859
|
const eventBus = useEventBus();
|
|
9843
|
-
const handleOptionClick =
|
|
9860
|
+
const handleOptionClick = React95.useCallback(
|
|
9844
9861
|
(option) => {
|
|
9845
9862
|
if (option.event) {
|
|
9846
9863
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -9963,7 +9980,7 @@ function StateNode({
|
|
|
9963
9980
|
);
|
|
9964
9981
|
}
|
|
9965
9982
|
var init_StateNode = __esm({
|
|
9966
|
-
"components/game/2d/
|
|
9983
|
+
"components/game/2d/molecules/StateNode.tsx"() {
|
|
9967
9984
|
init_atoms();
|
|
9968
9985
|
init_cn();
|
|
9969
9986
|
StateNode.displayName = "StateNode";
|
|
@@ -10035,7 +10052,7 @@ function TransitionArrow({
|
|
|
10035
10052
|
}
|
|
10036
10053
|
var NODE_RADIUS;
|
|
10037
10054
|
var init_TransitionArrow = __esm({
|
|
10038
|
-
"components/game/2d/
|
|
10055
|
+
"components/game/2d/molecules/TransitionArrow.tsx"() {
|
|
10039
10056
|
init_cn();
|
|
10040
10057
|
NODE_RADIUS = 40;
|
|
10041
10058
|
TransitionArrow.displayName = "TransitionArrow";
|
|
@@ -10066,7 +10083,7 @@ function StateGraph({
|
|
|
10066
10083
|
}) {
|
|
10067
10084
|
const eventBus = useEventBus();
|
|
10068
10085
|
const nodes = states ?? [];
|
|
10069
|
-
const positions =
|
|
10086
|
+
const positions = React95.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
10070
10087
|
return /* @__PURE__ */ jsxs(
|
|
10071
10088
|
Box,
|
|
10072
10089
|
{
|
|
@@ -10653,6 +10670,7 @@ function Canvas2D({
|
|
|
10653
10670
|
unitScale = 1,
|
|
10654
10671
|
showMinimap = true,
|
|
10655
10672
|
animate,
|
|
10673
|
+
interpolateUnits = false,
|
|
10656
10674
|
// Tuning
|
|
10657
10675
|
debug: debug2 = false,
|
|
10658
10676
|
spriteHeightRatio = 1.5,
|
|
@@ -10687,6 +10705,8 @@ function Canvas2D({
|
|
|
10687
10705
|
const containerRef = useRef(null);
|
|
10688
10706
|
const lerpRafRef = useRef(0);
|
|
10689
10707
|
const animRafRef = useRef(0);
|
|
10708
|
+
const unitInterp = useRenderInterpolation();
|
|
10709
|
+
const interpolatedUnitPositionsRef = useRef(/* @__PURE__ */ new Map());
|
|
10690
10710
|
const [viewportSize, setViewportSize] = useState({ width: 800, height: 600 });
|
|
10691
10711
|
useEffect(() => {
|
|
10692
10712
|
const el = containerRef.current;
|
|
@@ -11001,7 +11021,8 @@ function Canvas2D({
|
|
|
11001
11021
|
return depthA !== depthB ? depthA - depthB : a.position.y - b.position.y;
|
|
11002
11022
|
});
|
|
11003
11023
|
for (const unit of sortedUnits) {
|
|
11004
|
-
const
|
|
11024
|
+
const interpolated = interpolateUnits ? interpolatedUnitPositionsRef.current.get(unit.id) : void 0;
|
|
11025
|
+
const pos = project(interpolated?.x ?? unit.position.x, interpolated?.y ?? unit.position.y, baseOffsetX);
|
|
11005
11026
|
if (pos.x + scaledTileWidth < visLeft || pos.x > visRight || pos.y + scaledTileHeight < visTop || pos.y > visBottom) {
|
|
11006
11027
|
continue;
|
|
11007
11028
|
}
|
|
@@ -11153,7 +11174,8 @@ function Canvas2D({
|
|
|
11153
11174
|
unitScale,
|
|
11154
11175
|
assetManifest,
|
|
11155
11176
|
spriteHeightRatio,
|
|
11156
|
-
spriteMaxWidthRatio
|
|
11177
|
+
spriteMaxWidthRatio,
|
|
11178
|
+
interpolateUnits
|
|
11157
11179
|
]);
|
|
11158
11180
|
useEffect(() => {
|
|
11159
11181
|
if (camera === "fixed") return;
|
|
@@ -11168,6 +11190,19 @@ function Canvas2D({
|
|
|
11168
11190
|
y: centerY - viewportSize.height / 2
|
|
11169
11191
|
};
|
|
11170
11192
|
}, [camera, selectedUnitId, units, project, baseOffsetX, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, targetCameraRef]);
|
|
11193
|
+
useEffect(() => {
|
|
11194
|
+
if (isSide || !interpolateUnits) return;
|
|
11195
|
+
unitInterp.onSnapshot(
|
|
11196
|
+
units.filter((u) => !!u.position).map((u) => ({ id: u.id, x: u.position.x, y: u.position.y }))
|
|
11197
|
+
);
|
|
11198
|
+
}, [isSide, interpolateUnits, units, unitInterp]);
|
|
11199
|
+
useEffect(() => {
|
|
11200
|
+
if (isSide || !interpolateUnits) return;
|
|
11201
|
+
return unitInterp.startLoop((positions) => {
|
|
11202
|
+
interpolatedUnitPositionsRef.current = positions;
|
|
11203
|
+
draw();
|
|
11204
|
+
});
|
|
11205
|
+
}, [isSide, interpolateUnits, unitInterp, draw]);
|
|
11171
11206
|
useEffect(() => {
|
|
11172
11207
|
if (isSide) return;
|
|
11173
11208
|
draw();
|
|
@@ -11543,7 +11578,7 @@ function LinearView({
|
|
|
11543
11578
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
11544
11579
|
const isDone = i < currentIdx;
|
|
11545
11580
|
const isCurrent = i === currentIdx;
|
|
11546
|
-
return /* @__PURE__ */ jsxs(
|
|
11581
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
11547
11582
|
i > 0 && /* @__PURE__ */ jsx(
|
|
11548
11583
|
Typography,
|
|
11549
11584
|
{
|
|
@@ -11740,7 +11775,7 @@ function TraitStateViewer({
|
|
|
11740
11775
|
}
|
|
11741
11776
|
var SIZE_CONFIG;
|
|
11742
11777
|
var init_TraitStateViewer = __esm({
|
|
11743
|
-
"components/game/2d/
|
|
11778
|
+
"components/game/2d/molecules/TraitStateViewer.tsx"() {
|
|
11744
11779
|
"use client";
|
|
11745
11780
|
init_cn();
|
|
11746
11781
|
init_Box();
|
|
@@ -11773,7 +11808,8 @@ function TraitSlot({
|
|
|
11773
11808
|
onClick,
|
|
11774
11809
|
onRemove,
|
|
11775
11810
|
clickEvent,
|
|
11776
|
-
removeEvent
|
|
11811
|
+
removeEvent,
|
|
11812
|
+
dropEvent
|
|
11777
11813
|
}) {
|
|
11778
11814
|
const { emit } = useEventBus();
|
|
11779
11815
|
const [isHovered, setIsHovered] = useState(false);
|
|
@@ -11805,29 +11841,30 @@ function TraitSlot({
|
|
|
11805
11841
|
onDragStart?.(equippedItem);
|
|
11806
11842
|
}, [equippedItem, draggable, onDragStart]);
|
|
11807
11843
|
const handleDragOver = useCallback((e) => {
|
|
11808
|
-
if (locked || !onItemDrop) return;
|
|
11844
|
+
if (locked || !onItemDrop && !dropEvent) return;
|
|
11809
11845
|
if (e.dataTransfer.types.includes(DRAG_MIME)) {
|
|
11810
11846
|
e.preventDefault();
|
|
11811
11847
|
const allowed = e.dataTransfer.effectAllowed;
|
|
11812
11848
|
e.dataTransfer.dropEffect = allowed === "copy" ? "copy" : "move";
|
|
11813
11849
|
setIsDragOver(true);
|
|
11814
11850
|
}
|
|
11815
|
-
}, [locked, onItemDrop]);
|
|
11851
|
+
}, [locked, onItemDrop, dropEvent]);
|
|
11816
11852
|
const handleDragLeave = useCallback(() => {
|
|
11817
11853
|
setIsDragOver(false);
|
|
11818
11854
|
}, []);
|
|
11819
11855
|
const handleDrop = useCallback((e) => {
|
|
11820
11856
|
e.preventDefault();
|
|
11821
11857
|
setIsDragOver(false);
|
|
11822
|
-
if (locked || !onItemDrop) return;
|
|
11858
|
+
if (locked || !onItemDrop && !dropEvent) return;
|
|
11823
11859
|
const raw = e.dataTransfer.getData(DRAG_MIME);
|
|
11824
11860
|
if (!raw) return;
|
|
11825
11861
|
try {
|
|
11826
11862
|
const item = JSON.parse(raw);
|
|
11827
|
-
|
|
11863
|
+
if (dropEvent) emit(`UI:${dropEvent}`, { slotNumber, itemId: item.id });
|
|
11864
|
+
else onItemDrop?.(item);
|
|
11828
11865
|
} catch {
|
|
11829
11866
|
}
|
|
11830
|
-
}, [locked, onItemDrop]);
|
|
11867
|
+
}, [locked, onItemDrop, dropEvent, emit, slotNumber]);
|
|
11831
11868
|
const getTooltipStyle = () => {
|
|
11832
11869
|
if (!slotRef.current) return {};
|
|
11833
11870
|
const rect = slotRef.current.getBoundingClientRect();
|
|
@@ -11947,7 +11984,7 @@ function TraitSlot({
|
|
|
11947
11984
|
}
|
|
11948
11985
|
var SIZE_CONFIG2, DRAG_MIME;
|
|
11949
11986
|
var init_TraitSlot = __esm({
|
|
11950
|
-
"components/game/2d/
|
|
11987
|
+
"components/game/2d/molecules/TraitSlot.tsx"() {
|
|
11951
11988
|
"use client";
|
|
11952
11989
|
init_cn();
|
|
11953
11990
|
init_useEventBus();
|
|
@@ -12006,7 +12043,7 @@ function ActionTile({
|
|
|
12006
12043
|
}
|
|
12007
12044
|
var DRAG_MIME2, SIZE_CONFIG3;
|
|
12008
12045
|
var init_ActionTile = __esm({
|
|
12009
|
-
"components/game/2d/
|
|
12046
|
+
"components/game/2d/molecules/ActionTile.tsx"() {
|
|
12010
12047
|
init_atoms();
|
|
12011
12048
|
init_cn();
|
|
12012
12049
|
DRAG_MIME2 = "application/x-almadar-slot-item";
|
|
@@ -12043,7 +12080,7 @@ function ActionPalette({
|
|
|
12043
12080
|
] });
|
|
12044
12081
|
}
|
|
12045
12082
|
var init_ActionPalette = __esm({
|
|
12046
|
-
"components/game/2d/
|
|
12083
|
+
"components/game/2d/molecules/ActionPalette.tsx"() {
|
|
12047
12084
|
init_atoms();
|
|
12048
12085
|
init_cn();
|
|
12049
12086
|
init_ActionTile();
|
|
@@ -12055,6 +12092,8 @@ function SequenceBar({
|
|
|
12055
12092
|
maxSlots,
|
|
12056
12093
|
onSlotDrop,
|
|
12057
12094
|
onSlotRemove,
|
|
12095
|
+
slotDropEvent,
|
|
12096
|
+
slotRemoveEvent,
|
|
12058
12097
|
playing = false,
|
|
12059
12098
|
currentStep = -1,
|
|
12060
12099
|
categoryColors,
|
|
@@ -12062,16 +12101,19 @@ function SequenceBar({
|
|
|
12062
12101
|
size = "lg",
|
|
12063
12102
|
className
|
|
12064
12103
|
}) {
|
|
12104
|
+
const { emit } = useEventBus();
|
|
12065
12105
|
const handleDrop = useCallback((index) => (item) => {
|
|
12066
12106
|
if (playing) return;
|
|
12067
|
-
|
|
12068
|
-
|
|
12107
|
+
if (slotDropEvent) emit(`UI:${slotDropEvent}`, { slotNumber: index, itemId: item.id });
|
|
12108
|
+
else onSlotDrop?.(index, item);
|
|
12109
|
+
}, [emit, slotDropEvent, onSlotDrop, playing]);
|
|
12069
12110
|
const handleRemove = useCallback((index) => () => {
|
|
12070
12111
|
if (playing) return;
|
|
12071
|
-
|
|
12072
|
-
|
|
12112
|
+
if (slotRemoveEvent) emit(`UI:${slotRemoveEvent}`, { slotNumber: index });
|
|
12113
|
+
else onSlotRemove?.(index);
|
|
12114
|
+
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
12073
12115
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
12074
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
12116
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
12075
12117
|
i > 0 && /* @__PURE__ */ jsx(
|
|
12076
12118
|
Typography,
|
|
12077
12119
|
{
|
|
@@ -12101,9 +12143,10 @@ function SequenceBar({
|
|
|
12101
12143
|
] }, i)) });
|
|
12102
12144
|
}
|
|
12103
12145
|
var init_SequenceBar = __esm({
|
|
12104
|
-
"components/game/2d/
|
|
12146
|
+
"components/game/2d/molecules/SequenceBar.tsx"() {
|
|
12105
12147
|
init_atoms();
|
|
12106
12148
|
init_cn();
|
|
12149
|
+
init_useEventBus();
|
|
12107
12150
|
init_TraitSlot();
|
|
12108
12151
|
SequenceBar.displayName = "SequenceBar";
|
|
12109
12152
|
}
|
|
@@ -12419,7 +12462,7 @@ function RuleEditor({
|
|
|
12419
12462
|
] });
|
|
12420
12463
|
}
|
|
12421
12464
|
var init_RuleEditor = __esm({
|
|
12422
|
-
"components/game/2d/
|
|
12465
|
+
"components/game/2d/molecules/RuleEditor.tsx"() {
|
|
12423
12466
|
init_atoms();
|
|
12424
12467
|
init_cn();
|
|
12425
12468
|
RuleEditor.displayName = "RuleEditor";
|
|
@@ -12460,7 +12503,7 @@ function EventLog({
|
|
|
12460
12503
|
}
|
|
12461
12504
|
var STATUS_STYLES, STATUS_DOTS;
|
|
12462
12505
|
var init_EventLog = __esm({
|
|
12463
|
-
"components/game/2d/
|
|
12506
|
+
"components/game/2d/molecules/EventLog.tsx"() {
|
|
12464
12507
|
init_atoms();
|
|
12465
12508
|
init_cn();
|
|
12466
12509
|
STATUS_STYLES = {
|
|
@@ -12515,10 +12558,12 @@ var init_puzzleObject = __esm({
|
|
|
12515
12558
|
function ObjectRulePanel({
|
|
12516
12559
|
object,
|
|
12517
12560
|
onRulesChange,
|
|
12561
|
+
rulesChangeEvent,
|
|
12518
12562
|
disabled = false,
|
|
12519
12563
|
className
|
|
12520
12564
|
}) {
|
|
12521
12565
|
const { t } = useTranslate();
|
|
12566
|
+
const { emit } = useEventBus();
|
|
12522
12567
|
const id = objId(object);
|
|
12523
12568
|
const name = objName(object);
|
|
12524
12569
|
const icon = objIcon(object);
|
|
@@ -12529,15 +12574,19 @@ function ObjectRulePanel({
|
|
|
12529
12574
|
const rules = objRules(object);
|
|
12530
12575
|
const maxRules = objMaxRules(object);
|
|
12531
12576
|
const canAdd = rules.length < maxRules;
|
|
12577
|
+
const emitRules = useCallback((newRules) => {
|
|
12578
|
+
if (rulesChangeEvent) emit(`UI:${rulesChangeEvent}`, { objectId: id, rules: newRules });
|
|
12579
|
+
else onRulesChange?.(id, newRules);
|
|
12580
|
+
}, [rulesChangeEvent, emit, id, onRulesChange]);
|
|
12532
12581
|
const handleRuleChange = useCallback((index, updatedRule) => {
|
|
12533
12582
|
const newRules = [...rules];
|
|
12534
12583
|
newRules[index] = updatedRule;
|
|
12535
|
-
|
|
12536
|
-
}, [
|
|
12584
|
+
emitRules(newRules);
|
|
12585
|
+
}, [rules, emitRules]);
|
|
12537
12586
|
const handleRuleRemove = useCallback((index) => {
|
|
12538
12587
|
const newRules = rules.filter((_, i) => i !== index);
|
|
12539
|
-
|
|
12540
|
-
}, [
|
|
12588
|
+
emitRules(newRules);
|
|
12589
|
+
}, [rules, emitRules]);
|
|
12541
12590
|
const handleAddRule = useCallback(() => {
|
|
12542
12591
|
if (!canAdd || disabled) return;
|
|
12543
12592
|
const firstEvent = availableEvents[0]?.value || "";
|
|
@@ -12547,8 +12596,8 @@ function ObjectRulePanel({
|
|
|
12547
12596
|
whenEvent: firstEvent,
|
|
12548
12597
|
thenAction: firstAction
|
|
12549
12598
|
};
|
|
12550
|
-
|
|
12551
|
-
}, [canAdd, disabled,
|
|
12599
|
+
emitRules([...rules, newRule]);
|
|
12600
|
+
}, [canAdd, disabled, rules, availableEvents, availableActions, emitRules]);
|
|
12552
12601
|
const machine = {
|
|
12553
12602
|
name,
|
|
12554
12603
|
states,
|
|
@@ -12588,9 +12637,10 @@ function ObjectRulePanel({
|
|
|
12588
12637
|
}
|
|
12589
12638
|
var nextRuleId;
|
|
12590
12639
|
var init_ObjectRulePanel = __esm({
|
|
12591
|
-
"components/game/2d/
|
|
12640
|
+
"components/game/2d/molecules/ObjectRulePanel.tsx"() {
|
|
12592
12641
|
init_atoms();
|
|
12593
12642
|
init_cn();
|
|
12643
|
+
init_useEventBus();
|
|
12594
12644
|
init_TraitStateViewer();
|
|
12595
12645
|
init_RuleEditor();
|
|
12596
12646
|
init_puzzleObject();
|
|
@@ -12820,61 +12870,35 @@ function VariablePanel({
|
|
|
12820
12870
|
const { t } = useTranslate();
|
|
12821
12871
|
return /* @__PURE__ */ jsxs(VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
|
|
12822
12872
|
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("stateArchitect.variables", { name: entityName }) }),
|
|
12823
|
-
variables.map((v) => {
|
|
12824
|
-
|
|
12825
|
-
|
|
12826
|
-
|
|
12827
|
-
const min = numField(v.min, 0);
|
|
12828
|
-
const unit = v.unit == null ? "" : String(v.unit);
|
|
12829
|
-
const pct = Math.round((value - min) / (max - min) * 100);
|
|
12830
|
-
const isHigh = pct > 80;
|
|
12831
|
-
const isLow = pct < 20;
|
|
12832
|
-
return /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
|
|
12833
|
-
/* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
|
|
12834
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: name }),
|
|
12835
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "caption", className: cn(
|
|
12836
|
-
isHigh ? "text-error" : isLow ? "text-warning" : "text-foreground"
|
|
12837
|
-
), children: [
|
|
12838
|
-
value,
|
|
12839
|
-
unit,
|
|
12840
|
-
" / ",
|
|
12841
|
-
max,
|
|
12842
|
-
unit
|
|
12843
|
-
] })
|
|
12844
|
-
] }),
|
|
12845
|
-
/* @__PURE__ */ jsx(
|
|
12846
|
-
ProgressBar,
|
|
12847
|
-
{
|
|
12848
|
-
value: pct,
|
|
12849
|
-
color: isHigh ? "danger" : isLow ? "warning" : "primary",
|
|
12850
|
-
size: "sm"
|
|
12851
|
-
}
|
|
12852
|
-
)
|
|
12853
|
-
] }, name);
|
|
12854
|
-
})
|
|
12873
|
+
(variables ?? []).map((v) => /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
|
|
12874
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: v.name }),
|
|
12875
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-accent font-mono", children: v.value })
|
|
12876
|
+
] }, v.name))
|
|
12855
12877
|
] });
|
|
12856
12878
|
}
|
|
12857
|
-
var numField;
|
|
12858
12879
|
var init_VariablePanel = __esm({
|
|
12859
|
-
"components/game/2d/
|
|
12880
|
+
"components/game/2d/molecules/VariablePanel.tsx"() {
|
|
12860
12881
|
init_atoms();
|
|
12861
12882
|
init_cn();
|
|
12862
|
-
numField = (v, fallback = 0) => {
|
|
12863
|
-
const n = Number(v);
|
|
12864
|
-
return Number.isFinite(n) ? n : fallback;
|
|
12865
|
-
};
|
|
12866
12883
|
VariablePanel.displayName = "VariablePanel";
|
|
12867
12884
|
}
|
|
12868
12885
|
});
|
|
12869
12886
|
function StateJsonView({
|
|
12870
|
-
|
|
12887
|
+
name,
|
|
12888
|
+
initialState,
|
|
12889
|
+
states,
|
|
12890
|
+
transitions,
|
|
12871
12891
|
label,
|
|
12872
12892
|
defaultExpanded = false,
|
|
12873
12893
|
className
|
|
12874
12894
|
}) {
|
|
12875
12895
|
const { t } = useTranslate();
|
|
12876
12896
|
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
12877
|
-
const jsonString = JSON.stringify(
|
|
12897
|
+
const jsonString = JSON.stringify(
|
|
12898
|
+
{ name, initialState, states: states ?? [], transitions: transitions ?? [] },
|
|
12899
|
+
null,
|
|
12900
|
+
2
|
|
12901
|
+
);
|
|
12878
12902
|
return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
|
|
12879
12903
|
/* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
|
|
12880
12904
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
|
|
@@ -12891,7 +12915,7 @@ function StateJsonView({
|
|
|
12891
12915
|
] });
|
|
12892
12916
|
}
|
|
12893
12917
|
var init_StateJsonView = __esm({
|
|
12894
|
-
"components/game/2d/
|
|
12918
|
+
"components/game/2d/molecules/StateJsonView.tsx"() {
|
|
12895
12919
|
init_atoms();
|
|
12896
12920
|
init_cn();
|
|
12897
12921
|
StateJsonView.displayName = "StateJsonView";
|
|
@@ -13060,7 +13084,7 @@ function StateArchitectBoard({
|
|
|
13060
13084
|
setAddingFrom(null);
|
|
13061
13085
|
if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
|
|
13062
13086
|
}, [initialState, entityVariables, playAgainEvent, emit]);
|
|
13063
|
-
|
|
13087
|
+
useMemo(() => ({
|
|
13064
13088
|
name: entityName,
|
|
13065
13089
|
states: entityStates,
|
|
13066
13090
|
initialState,
|
|
@@ -13195,7 +13219,7 @@ function StateArchitectBoard({
|
|
|
13195
13219
|
VariablePanel,
|
|
13196
13220
|
{
|
|
13197
13221
|
entityName,
|
|
13198
|
-
variables
|
|
13222
|
+
variables: variables.map((v) => ({ name: String(v.name ?? ""), value: String(v.value ?? "") }))
|
|
13199
13223
|
}
|
|
13200
13224
|
),
|
|
13201
13225
|
testResults.length > 0 && /* @__PURE__ */ jsxs(VStack, { className: "p-3 rounded-container bg-card border border-border", gap: "xs", children: [
|
|
@@ -13206,7 +13230,16 @@ function StateArchitectBoard({
|
|
|
13206
13230
|
!r.passed && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error", children: t("stateArchitect.gotState", { state: r.actualState }) })
|
|
13207
13231
|
] }, i))
|
|
13208
13232
|
] }),
|
|
13209
|
-
resolved.showCodeView !== false && /* @__PURE__ */ jsx(
|
|
13233
|
+
resolved.showCodeView !== false && /* @__PURE__ */ jsx(
|
|
13234
|
+
StateJsonView,
|
|
13235
|
+
{
|
|
13236
|
+
name: entityName,
|
|
13237
|
+
initialState,
|
|
13238
|
+
states: entityStates,
|
|
13239
|
+
transitions: transitions.map((tr) => ({ from: tr.from, to: tr.to, event: tr.event })),
|
|
13240
|
+
label: "View Code"
|
|
13241
|
+
}
|
|
13242
|
+
)
|
|
13210
13243
|
] })
|
|
13211
13244
|
] }),
|
|
13212
13245
|
isSuccess && /* @__PURE__ */ jsx(Box, { className: "p-4 rounded-container bg-success/20 border border-success text-center", children: /* @__PURE__ */ jsx(Typography, { variant: "h5", className: "text-success", children: str(resolved.successMessage) || t("stateArchitect.allPassed") }) }),
|
|
@@ -14118,227 +14151,6 @@ var init_NegotiatorBoard = __esm({
|
|
|
14118
14151
|
NegotiatorBoard.displayName = "NegotiatorBoard";
|
|
14119
14152
|
}
|
|
14120
14153
|
});
|
|
14121
|
-
|
|
14122
|
-
// components/game/shared/lib/mechanics.ts
|
|
14123
|
-
var projectileMotion, pendulum, springOscillator;
|
|
14124
|
-
var init_mechanics = __esm({
|
|
14125
|
-
"components/game/shared/lib/mechanics.ts"() {
|
|
14126
|
-
projectileMotion = {
|
|
14127
|
-
id: "mechanics-projectile",
|
|
14128
|
-
name: "Projectile Motion",
|
|
14129
|
-
description: "Launch a ball and observe parabolic trajectory under gravity.",
|
|
14130
|
-
domain: "natural",
|
|
14131
|
-
gravity: { x: 0, y: 9.81 },
|
|
14132
|
-
bodies: [
|
|
14133
|
-
{ id: "ball", x: 50, y: 350, vx: 80, vy: -120, mass: 1, radius: 10, color: "#e94560", fixed: false },
|
|
14134
|
-
{ id: "ground", x: 300, y: 390, vx: 0, vy: 0, mass: 1e3, radius: 400, color: "#333", fixed: true }
|
|
14135
|
-
],
|
|
14136
|
-
showVelocity: true,
|
|
14137
|
-
parameters: {
|
|
14138
|
-
angle: { value: 45, min: 0, max: 90, step: 1, label: "Launch angle (deg)" },
|
|
14139
|
-
velocity: { value: 100, min: 10, max: 200, step: 5, label: "Initial velocity (m/s)" },
|
|
14140
|
-
gravity: { value: 9.81, min: 0, max: 20, step: 0.1, label: "Gravity (m/s\xB2)" }
|
|
14141
|
-
}
|
|
14142
|
-
};
|
|
14143
|
-
pendulum = {
|
|
14144
|
-
id: "mechanics-pendulum",
|
|
14145
|
-
name: "Simple Pendulum",
|
|
14146
|
-
description: "A mass on a string swinging under gravity.",
|
|
14147
|
-
domain: "natural",
|
|
14148
|
-
gravity: { x: 0, y: 9.81 },
|
|
14149
|
-
bodies: [
|
|
14150
|
-
{ id: "pivot", x: 300, y: 50, vx: 0, vy: 0, mass: 1e3, radius: 5, color: "#888", fixed: true },
|
|
14151
|
-
{ id: "bob", x: 400, y: 200, vx: 0, vy: 0, mass: 5, radius: 15, color: "#e94560", fixed: false }
|
|
14152
|
-
],
|
|
14153
|
-
constraints: [{ bodyA: 0, bodyB: 1, length: 180, stiffness: 1 }],
|
|
14154
|
-
parameters: {
|
|
14155
|
-
length: { value: 180, min: 50, max: 300, step: 10, label: "String length (px)" },
|
|
14156
|
-
mass: { value: 5, min: 1, max: 20, step: 0.5, label: "Mass (kg)" },
|
|
14157
|
-
gravity: { value: 9.81, min: 0, max: 20, step: 0.1, label: "Gravity (m/s\xB2)" }
|
|
14158
|
-
}
|
|
14159
|
-
};
|
|
14160
|
-
springOscillator = {
|
|
14161
|
-
id: "mechanics-spring",
|
|
14162
|
-
name: "Spring Oscillator",
|
|
14163
|
-
description: "A mass bouncing on a spring \u2014 simple harmonic motion.",
|
|
14164
|
-
domain: "natural",
|
|
14165
|
-
gravity: { x: 0, y: 0 },
|
|
14166
|
-
bodies: [
|
|
14167
|
-
{ id: "anchor", x: 300, y: 50, vx: 0, vy: 0, mass: 1e3, radius: 8, color: "#888", fixed: true },
|
|
14168
|
-
{ id: "mass", x: 300, y: 250, vx: 0, vy: 0, mass: 2, radius: 20, color: "#0f3460", fixed: false }
|
|
14169
|
-
],
|
|
14170
|
-
constraints: [{ bodyA: 0, bodyB: 1, length: 150, stiffness: 0.5 }],
|
|
14171
|
-
parameters: {
|
|
14172
|
-
stiffness: { value: 0.5, min: 0.1, max: 2, step: 0.05, label: "Spring stiffness (k)" },
|
|
14173
|
-
mass: { value: 2, min: 0.5, max: 10, step: 0.5, label: "Mass (kg)" },
|
|
14174
|
-
damping: { value: 0, min: 0, max: 0.5, step: 0.01, label: "Damping" }
|
|
14175
|
-
}
|
|
14176
|
-
};
|
|
14177
|
-
}
|
|
14178
|
-
});
|
|
14179
|
-
|
|
14180
|
-
// components/game/shared/lib/physicsPresets.ts
|
|
14181
|
-
var init_physicsPresets = __esm({
|
|
14182
|
-
"components/game/shared/lib/physicsPresets.ts"() {
|
|
14183
|
-
init_mechanics();
|
|
14184
|
-
}
|
|
14185
|
-
});
|
|
14186
|
-
function resolvePreset(preset) {
|
|
14187
|
-
if (typeof preset !== "string") return preset;
|
|
14188
|
-
return PRESET_BY_ID[preset] ?? projectileMotion;
|
|
14189
|
-
}
|
|
14190
|
-
function SimulationCanvas({
|
|
14191
|
-
preset: presetProp,
|
|
14192
|
-
width = 600,
|
|
14193
|
-
height = 400,
|
|
14194
|
-
bodies: externalBodies,
|
|
14195
|
-
className
|
|
14196
|
-
}) {
|
|
14197
|
-
const preset = useMemo(() => resolvePreset(presetProp), [presetProp]);
|
|
14198
|
-
const canvasRef = useRef(null);
|
|
14199
|
-
const bodiesRef = useRef(structuredClone(preset.bodies));
|
|
14200
|
-
const interp = useRenderInterpolation();
|
|
14201
|
-
useEffect(() => {
|
|
14202
|
-
bodiesRef.current = structuredClone(preset.bodies);
|
|
14203
|
-
}, [preset]);
|
|
14204
|
-
const draw = useCallback(() => {
|
|
14205
|
-
const canvas = canvasRef.current;
|
|
14206
|
-
if (!canvas) return;
|
|
14207
|
-
const ctx = canvas.getContext("2d");
|
|
14208
|
-
if (!ctx) return;
|
|
14209
|
-
const bodies = bodiesRef.current;
|
|
14210
|
-
ctx.clearRect(0, 0, width, height);
|
|
14211
|
-
ctx.fillStyle = preset.backgroundColor ?? "#1a1a2e";
|
|
14212
|
-
ctx.fillRect(0, 0, width, height);
|
|
14213
|
-
if (preset.constraints) {
|
|
14214
|
-
for (const c of preset.constraints) {
|
|
14215
|
-
const a = bodies[c.bodyA];
|
|
14216
|
-
const b = bodies[c.bodyB];
|
|
14217
|
-
if (a && b) {
|
|
14218
|
-
ctx.beginPath();
|
|
14219
|
-
ctx.moveTo(a.x, a.y);
|
|
14220
|
-
ctx.lineTo(b.x, b.y);
|
|
14221
|
-
ctx.strokeStyle = "#533483";
|
|
14222
|
-
ctx.lineWidth = 1;
|
|
14223
|
-
ctx.setLineDash([4, 4]);
|
|
14224
|
-
ctx.stroke();
|
|
14225
|
-
ctx.setLineDash([]);
|
|
14226
|
-
}
|
|
14227
|
-
}
|
|
14228
|
-
}
|
|
14229
|
-
for (const body of bodies) {
|
|
14230
|
-
ctx.beginPath();
|
|
14231
|
-
ctx.arc(body.x, body.y, body.radius, 0, Math.PI * 2);
|
|
14232
|
-
ctx.fillStyle = body.color ?? "#e94560";
|
|
14233
|
-
ctx.fill();
|
|
14234
|
-
if (preset.showVelocity) {
|
|
14235
|
-
ctx.beginPath();
|
|
14236
|
-
ctx.moveTo(body.x, body.y);
|
|
14237
|
-
ctx.lineTo(body.x + body.vx * 0.1, body.y + body.vy * 0.1);
|
|
14238
|
-
ctx.strokeStyle = "#16213e";
|
|
14239
|
-
ctx.lineWidth = 2;
|
|
14240
|
-
ctx.stroke();
|
|
14241
|
-
}
|
|
14242
|
-
}
|
|
14243
|
-
}, [width, height, preset]);
|
|
14244
|
-
useEffect(() => {
|
|
14245
|
-
if (!externalBodies) return;
|
|
14246
|
-
interp.onSnapshot(externalBodies.map((b) => ({ id: b.id, x: b.x, y: b.y })));
|
|
14247
|
-
}, [externalBodies]);
|
|
14248
|
-
const presetRef = useRef(preset);
|
|
14249
|
-
presetRef.current = preset;
|
|
14250
|
-
const widthRef = useRef(width);
|
|
14251
|
-
widthRef.current = width;
|
|
14252
|
-
const heightRef = useRef(height);
|
|
14253
|
-
heightRef.current = height;
|
|
14254
|
-
useEffect(() => {
|
|
14255
|
-
if (!externalBodies) return;
|
|
14256
|
-
const drawInterpolated = (positions) => {
|
|
14257
|
-
const canvas = canvasRef.current;
|
|
14258
|
-
if (!canvas) return;
|
|
14259
|
-
const ctx = canvas.getContext("2d");
|
|
14260
|
-
if (!ctx) return;
|
|
14261
|
-
const bodies = bodiesRef.current;
|
|
14262
|
-
const p = presetRef.current;
|
|
14263
|
-
const w = widthRef.current;
|
|
14264
|
-
const h = heightRef.current;
|
|
14265
|
-
ctx.clearRect(0, 0, w, h);
|
|
14266
|
-
ctx.fillStyle = p.backgroundColor ?? "#1a1a2e";
|
|
14267
|
-
ctx.fillRect(0, 0, w, h);
|
|
14268
|
-
if (p.constraints) {
|
|
14269
|
-
for (const c of p.constraints) {
|
|
14270
|
-
const a = bodies[c.bodyA];
|
|
14271
|
-
const b = bodies[c.bodyB];
|
|
14272
|
-
if (a && b) {
|
|
14273
|
-
const aPos = positions.get(a.id) ?? a;
|
|
14274
|
-
const bPos = positions.get(b.id) ?? b;
|
|
14275
|
-
ctx.beginPath();
|
|
14276
|
-
ctx.moveTo(aPos.x, aPos.y);
|
|
14277
|
-
ctx.lineTo(bPos.x, bPos.y);
|
|
14278
|
-
ctx.strokeStyle = "#533483";
|
|
14279
|
-
ctx.lineWidth = 1;
|
|
14280
|
-
ctx.setLineDash([4, 4]);
|
|
14281
|
-
ctx.stroke();
|
|
14282
|
-
ctx.setLineDash([]);
|
|
14283
|
-
}
|
|
14284
|
-
}
|
|
14285
|
-
}
|
|
14286
|
-
for (const body of bodies) {
|
|
14287
|
-
const pos = positions.get(body.id) ?? body;
|
|
14288
|
-
ctx.beginPath();
|
|
14289
|
-
ctx.arc(pos.x, pos.y, body.radius, 0, Math.PI * 2);
|
|
14290
|
-
ctx.fillStyle = body.color ?? "#e94560";
|
|
14291
|
-
ctx.fill();
|
|
14292
|
-
if (p.showVelocity) {
|
|
14293
|
-
ctx.beginPath();
|
|
14294
|
-
ctx.moveTo(pos.x, pos.y);
|
|
14295
|
-
ctx.lineTo(pos.x + body.vx * 0.1, pos.y + body.vy * 0.1);
|
|
14296
|
-
ctx.strokeStyle = "#16213e";
|
|
14297
|
-
ctx.lineWidth = 2;
|
|
14298
|
-
ctx.stroke();
|
|
14299
|
-
}
|
|
14300
|
-
}
|
|
14301
|
-
};
|
|
14302
|
-
return interp.startLoop(drawInterpolated);
|
|
14303
|
-
}, [externalBodies !== void 0, interp.startLoop]);
|
|
14304
|
-
useEffect(() => {
|
|
14305
|
-
draw();
|
|
14306
|
-
}, [draw]);
|
|
14307
|
-
useEffect(() => {
|
|
14308
|
-
if (typeof window === "undefined") return;
|
|
14309
|
-
const canvas = canvasRef.current;
|
|
14310
|
-
if (!canvas) return;
|
|
14311
|
-
bindCanvasCapture(() => canvas.toDataURL("image/png"));
|
|
14312
|
-
return () => {
|
|
14313
|
-
bindCanvasCapture(() => null);
|
|
14314
|
-
};
|
|
14315
|
-
}, []);
|
|
14316
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("flex justify-center", className), children: /* @__PURE__ */ jsx(
|
|
14317
|
-
"canvas",
|
|
14318
|
-
{
|
|
14319
|
-
ref: canvasRef,
|
|
14320
|
-
width,
|
|
14321
|
-
height,
|
|
14322
|
-
className: "rounded-container block max-w-full h-auto"
|
|
14323
|
-
}
|
|
14324
|
-
) });
|
|
14325
|
-
}
|
|
14326
|
-
var PRESET_BY_ID;
|
|
14327
|
-
var init_SimulationCanvas = __esm({
|
|
14328
|
-
"components/game/2d/organisms/SimulationCanvas.tsx"() {
|
|
14329
|
-
init_cn();
|
|
14330
|
-
init_atoms();
|
|
14331
|
-
init_verificationRegistry();
|
|
14332
|
-
init_physicsPresets();
|
|
14333
|
-
init_useRenderInterpolation();
|
|
14334
|
-
PRESET_BY_ID = {
|
|
14335
|
-
"mechanics-projectile": projectileMotion,
|
|
14336
|
-
"mechanics-pendulum": pendulum,
|
|
14337
|
-
"mechanics-spring": springOscillator
|
|
14338
|
-
};
|
|
14339
|
-
SimulationCanvas.displayName = "SimulationCanvas";
|
|
14340
|
-
}
|
|
14341
|
-
});
|
|
14342
14154
|
var GameTemplate;
|
|
14343
14155
|
var init_GameTemplate = __esm({
|
|
14344
14156
|
"components/game/2d/templates/GameTemplate.tsx"() {
|
|
@@ -14947,7 +14759,7 @@ var init_ErrorBoundary = __esm({
|
|
|
14947
14759
|
}
|
|
14948
14760
|
);
|
|
14949
14761
|
};
|
|
14950
|
-
ErrorBoundary = class extends
|
|
14762
|
+
ErrorBoundary = class extends React95__default.Component {
|
|
14951
14763
|
constructor(props) {
|
|
14952
14764
|
super(props);
|
|
14953
14765
|
__publicField(this, "reset", () => {
|
|
@@ -15229,7 +15041,7 @@ var init_Container = __esm({
|
|
|
15229
15041
|
as: Component = "div"
|
|
15230
15042
|
}) => {
|
|
15231
15043
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
15232
|
-
return
|
|
15044
|
+
return React95__default.createElement(
|
|
15233
15045
|
Component,
|
|
15234
15046
|
{
|
|
15235
15047
|
className: cn(
|
|
@@ -17897,7 +17709,7 @@ var init_CodeBlock = __esm({
|
|
|
17897
17709
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
17898
17710
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
17899
17711
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
17900
|
-
CodeBlock =
|
|
17712
|
+
CodeBlock = React95__default.memo(
|
|
17901
17713
|
({
|
|
17902
17714
|
code: rawCode,
|
|
17903
17715
|
language = "text",
|
|
@@ -18484,7 +18296,7 @@ var init_MarkdownContent = __esm({
|
|
|
18484
18296
|
init_Box();
|
|
18485
18297
|
init_CodeBlock();
|
|
18486
18298
|
init_cn();
|
|
18487
|
-
MarkdownContent =
|
|
18299
|
+
MarkdownContent = React95__default.memo(
|
|
18488
18300
|
({ content, direction = "ltr", className }) => {
|
|
18489
18301
|
const { t: _t } = useTranslate();
|
|
18490
18302
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -19761,7 +19573,7 @@ var init_StateMachineView = __esm({
|
|
|
19761
19573
|
style: { top: title ? 30 : 0 },
|
|
19762
19574
|
children: [
|
|
19763
19575
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
19764
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
19576
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React95__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
19765
19577
|
StateNode2,
|
|
19766
19578
|
{
|
|
19767
19579
|
state,
|
|
@@ -25318,8 +25130,8 @@ var init_Menu = __esm({
|
|
|
25318
25130
|
"bottom-end": "bottom-start"
|
|
25319
25131
|
};
|
|
25320
25132
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
25321
|
-
const triggerChild =
|
|
25322
|
-
const triggerElement =
|
|
25133
|
+
const triggerChild = React95__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
25134
|
+
const triggerElement = React95__default.cloneElement(
|
|
25323
25135
|
triggerChild,
|
|
25324
25136
|
{
|
|
25325
25137
|
ref: triggerRef,
|
|
@@ -25414,14 +25226,14 @@ function useDataDnd(args) {
|
|
|
25414
25226
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
25415
25227
|
const enabled = isZone || Boolean(dndRoot);
|
|
25416
25228
|
const eventBus = useEventBus();
|
|
25417
|
-
const parentRoot =
|
|
25229
|
+
const parentRoot = React95__default.useContext(RootCtx);
|
|
25418
25230
|
const isRoot = enabled && parentRoot === null;
|
|
25419
|
-
const zoneId =
|
|
25231
|
+
const zoneId = React95__default.useId();
|
|
25420
25232
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
25421
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
25422
|
-
const optimisticOrdersRef =
|
|
25233
|
+
const [optimisticOrders, setOptimisticOrders] = React95__default.useState(() => /* @__PURE__ */ new Map());
|
|
25234
|
+
const optimisticOrdersRef = React95__default.useRef(optimisticOrders);
|
|
25423
25235
|
optimisticOrdersRef.current = optimisticOrders;
|
|
25424
|
-
const clearOptimisticOrder =
|
|
25236
|
+
const clearOptimisticOrder = React95__default.useCallback((group) => {
|
|
25425
25237
|
setOptimisticOrders((prev) => {
|
|
25426
25238
|
if (!prev.has(group)) return prev;
|
|
25427
25239
|
const next = new Map(prev);
|
|
@@ -25446,7 +25258,7 @@ function useDataDnd(args) {
|
|
|
25446
25258
|
const raw = it[dndItemIdField];
|
|
25447
25259
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
25448
25260
|
}).join("|");
|
|
25449
|
-
const itemIds =
|
|
25261
|
+
const itemIds = React95__default.useMemo(
|
|
25450
25262
|
() => orderedItems.map((it, idx) => {
|
|
25451
25263
|
const raw = it[dndItemIdField];
|
|
25452
25264
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -25457,7 +25269,7 @@ function useDataDnd(args) {
|
|
|
25457
25269
|
const raw = it[dndItemIdField];
|
|
25458
25270
|
return raw != null ? String(raw) : `__${idx}`;
|
|
25459
25271
|
}).join("|");
|
|
25460
|
-
|
|
25272
|
+
React95__default.useEffect(() => {
|
|
25461
25273
|
const root = isRoot ? null : parentRoot;
|
|
25462
25274
|
if (root) {
|
|
25463
25275
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -25465,20 +25277,20 @@ function useDataDnd(args) {
|
|
|
25465
25277
|
clearOptimisticOrder(ownGroup);
|
|
25466
25278
|
}
|
|
25467
25279
|
}, [itemsContentSig, ownGroup]);
|
|
25468
|
-
const zonesRef =
|
|
25469
|
-
const registerZone =
|
|
25280
|
+
const zonesRef = React95__default.useRef(/* @__PURE__ */ new Map());
|
|
25281
|
+
const registerZone = React95__default.useCallback((zoneId2, meta2) => {
|
|
25470
25282
|
zonesRef.current.set(zoneId2, meta2);
|
|
25471
25283
|
}, []);
|
|
25472
|
-
const unregisterZone =
|
|
25284
|
+
const unregisterZone = React95__default.useCallback((zoneId2) => {
|
|
25473
25285
|
zonesRef.current.delete(zoneId2);
|
|
25474
25286
|
}, []);
|
|
25475
|
-
const [activeDrag, setActiveDrag] =
|
|
25476
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
25477
|
-
const meta =
|
|
25287
|
+
const [activeDrag, setActiveDrag] = React95__default.useState(null);
|
|
25288
|
+
const [overZoneGroup, setOverZoneGroup] = React95__default.useState(null);
|
|
25289
|
+
const meta = React95__default.useMemo(
|
|
25478
25290
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
25479
25291
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
25480
25292
|
);
|
|
25481
|
-
|
|
25293
|
+
React95__default.useEffect(() => {
|
|
25482
25294
|
const target = isRoot ? null : parentRoot;
|
|
25483
25295
|
if (!target) {
|
|
25484
25296
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -25497,7 +25309,7 @@ function useDataDnd(args) {
|
|
|
25497
25309
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
25498
25310
|
const sensors = useAlmadarDndSensors(true);
|
|
25499
25311
|
const collisionDetection = almadarDndCollisionDetection;
|
|
25500
|
-
const findZoneByItem =
|
|
25312
|
+
const findZoneByItem = React95__default.useCallback(
|
|
25501
25313
|
(id) => {
|
|
25502
25314
|
for (const z of zonesRef.current.values()) {
|
|
25503
25315
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -25506,7 +25318,7 @@ function useDataDnd(args) {
|
|
|
25506
25318
|
},
|
|
25507
25319
|
[]
|
|
25508
25320
|
);
|
|
25509
|
-
|
|
25321
|
+
React95__default.useCallback(
|
|
25510
25322
|
(group) => {
|
|
25511
25323
|
for (const z of zonesRef.current.values()) {
|
|
25512
25324
|
if (z.group === group) return z;
|
|
@@ -25515,7 +25327,7 @@ function useDataDnd(args) {
|
|
|
25515
25327
|
},
|
|
25516
25328
|
[]
|
|
25517
25329
|
);
|
|
25518
|
-
const handleDragEnd =
|
|
25330
|
+
const handleDragEnd = React95__default.useCallback(
|
|
25519
25331
|
(event) => {
|
|
25520
25332
|
const { active, over } = event;
|
|
25521
25333
|
const activeIdStr = String(active.id);
|
|
@@ -25606,8 +25418,8 @@ function useDataDnd(args) {
|
|
|
25606
25418
|
},
|
|
25607
25419
|
[eventBus]
|
|
25608
25420
|
);
|
|
25609
|
-
const sortableData =
|
|
25610
|
-
const SortableItem =
|
|
25421
|
+
const sortableData = React95__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
25422
|
+
const SortableItem = React95__default.useCallback(
|
|
25611
25423
|
({ id, children }) => {
|
|
25612
25424
|
const {
|
|
25613
25425
|
attributes,
|
|
@@ -25647,7 +25459,7 @@ function useDataDnd(args) {
|
|
|
25647
25459
|
id: droppableId,
|
|
25648
25460
|
data: sortableData
|
|
25649
25461
|
});
|
|
25650
|
-
const ctx =
|
|
25462
|
+
const ctx = React95__default.useContext(RootCtx);
|
|
25651
25463
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
25652
25464
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
25653
25465
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -25662,7 +25474,7 @@ function useDataDnd(args) {
|
|
|
25662
25474
|
showForeignPlaceholder,
|
|
25663
25475
|
ctxAvailable: ctx != null
|
|
25664
25476
|
});
|
|
25665
|
-
|
|
25477
|
+
React95__default.useEffect(() => {
|
|
25666
25478
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
25667
25479
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
25668
25480
|
return /* @__PURE__ */ jsx(
|
|
@@ -25676,11 +25488,11 @@ function useDataDnd(args) {
|
|
|
25676
25488
|
}
|
|
25677
25489
|
);
|
|
25678
25490
|
};
|
|
25679
|
-
const rootContextValue =
|
|
25491
|
+
const rootContextValue = React95__default.useMemo(
|
|
25680
25492
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
25681
25493
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
25682
25494
|
);
|
|
25683
|
-
const handleDragStart =
|
|
25495
|
+
const handleDragStart = React95__default.useCallback((event) => {
|
|
25684
25496
|
const sourceZone = findZoneByItem(event.active.id);
|
|
25685
25497
|
const rect = event.active.rect.current.initial;
|
|
25686
25498
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -25699,7 +25511,7 @@ function useDataDnd(args) {
|
|
|
25699
25511
|
isRoot
|
|
25700
25512
|
});
|
|
25701
25513
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
25702
|
-
const handleDragOver =
|
|
25514
|
+
const handleDragOver = React95__default.useCallback((event) => {
|
|
25703
25515
|
const { active, over } = event;
|
|
25704
25516
|
const overData = over?.data?.current;
|
|
25705
25517
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -25769,7 +25581,7 @@ function useDataDnd(args) {
|
|
|
25769
25581
|
return next;
|
|
25770
25582
|
});
|
|
25771
25583
|
}, []);
|
|
25772
|
-
const handleDragCancel =
|
|
25584
|
+
const handleDragCancel = React95__default.useCallback((event) => {
|
|
25773
25585
|
setActiveDrag(null);
|
|
25774
25586
|
setOverZoneGroup(null);
|
|
25775
25587
|
dndLog.warn("dragCancel", {
|
|
@@ -25777,12 +25589,12 @@ function useDataDnd(args) {
|
|
|
25777
25589
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
25778
25590
|
});
|
|
25779
25591
|
}, []);
|
|
25780
|
-
const handleDragEndWithCleanup =
|
|
25592
|
+
const handleDragEndWithCleanup = React95__default.useCallback((event) => {
|
|
25781
25593
|
handleDragEnd(event);
|
|
25782
25594
|
setActiveDrag(null);
|
|
25783
25595
|
setOverZoneGroup(null);
|
|
25784
25596
|
}, [handleDragEnd]);
|
|
25785
|
-
const wrapContainer =
|
|
25597
|
+
const wrapContainer = React95__default.useCallback(
|
|
25786
25598
|
(children) => {
|
|
25787
25599
|
if (!enabled) return children;
|
|
25788
25600
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -25836,7 +25648,7 @@ var init_useDataDnd = __esm({
|
|
|
25836
25648
|
init_useAlmadarDndCollision();
|
|
25837
25649
|
init_Box();
|
|
25838
25650
|
dndLog = createLogger("almadar:ui:dnd");
|
|
25839
|
-
RootCtx =
|
|
25651
|
+
RootCtx = React95__default.createContext(null);
|
|
25840
25652
|
}
|
|
25841
25653
|
});
|
|
25842
25654
|
function renderIconInput(icon, props) {
|
|
@@ -26362,7 +26174,7 @@ function DataList({
|
|
|
26362
26174
|
}) {
|
|
26363
26175
|
const eventBus = useEventBus();
|
|
26364
26176
|
const { t } = useTranslate();
|
|
26365
|
-
const [visibleCount, setVisibleCount] =
|
|
26177
|
+
const [visibleCount, setVisibleCount] = React95__default.useState(pageSize || Infinity);
|
|
26366
26178
|
const fieldDefs = fields ?? columns ?? [];
|
|
26367
26179
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
26368
26180
|
const dnd = useDataDnd({
|
|
@@ -26381,7 +26193,7 @@ function DataList({
|
|
|
26381
26193
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
26382
26194
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
26383
26195
|
const hasRenderProp = typeof children === "function";
|
|
26384
|
-
|
|
26196
|
+
React95__default.useEffect(() => {
|
|
26385
26197
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
26386
26198
|
const childrenTypeOf = typeof children;
|
|
26387
26199
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -26485,7 +26297,7 @@ function DataList({
|
|
|
26485
26297
|
const items2 = [...data];
|
|
26486
26298
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
26487
26299
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
26488
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
26300
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
26489
26301
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
26490
26302
|
group.items.map((itemData, index) => {
|
|
26491
26303
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -26626,7 +26438,7 @@ function DataList({
|
|
|
26626
26438
|
className
|
|
26627
26439
|
),
|
|
26628
26440
|
children: [
|
|
26629
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
26441
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
26630
26442
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
26631
26443
|
group.items.map(
|
|
26632
26444
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -26711,7 +26523,7 @@ var init_FormSection = __esm({
|
|
|
26711
26523
|
columns = 1,
|
|
26712
26524
|
className
|
|
26713
26525
|
}) => {
|
|
26714
|
-
const [collapsed, setCollapsed] =
|
|
26526
|
+
const [collapsed, setCollapsed] = React95__default.useState(defaultCollapsed);
|
|
26715
26527
|
const { t } = useTranslate();
|
|
26716
26528
|
const eventBus = useEventBus();
|
|
26717
26529
|
const gridClass = {
|
|
@@ -26719,7 +26531,7 @@ var init_FormSection = __esm({
|
|
|
26719
26531
|
2: "grid-cols-1 md:grid-cols-2",
|
|
26720
26532
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
26721
26533
|
}[columns];
|
|
26722
|
-
|
|
26534
|
+
React95__default.useCallback(() => {
|
|
26723
26535
|
if (collapsible) {
|
|
26724
26536
|
setCollapsed((prev) => !prev);
|
|
26725
26537
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -27605,7 +27417,7 @@ var init_Flex = __esm({
|
|
|
27605
27417
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
27606
27418
|
}
|
|
27607
27419
|
}
|
|
27608
|
-
return
|
|
27420
|
+
return React95__default.createElement(Component, {
|
|
27609
27421
|
className: cn(
|
|
27610
27422
|
inline ? "inline-flex" : "flex",
|
|
27611
27423
|
directionStyles[direction],
|
|
@@ -27724,7 +27536,7 @@ var init_Grid = __esm({
|
|
|
27724
27536
|
as: Component = "div"
|
|
27725
27537
|
}) => {
|
|
27726
27538
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
27727
|
-
return
|
|
27539
|
+
return React95__default.createElement(
|
|
27728
27540
|
Component,
|
|
27729
27541
|
{
|
|
27730
27542
|
className: cn(
|
|
@@ -27920,9 +27732,9 @@ var init_Popover = __esm({
|
|
|
27920
27732
|
onMouseLeave: handleClose,
|
|
27921
27733
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
27922
27734
|
};
|
|
27923
|
-
const childElement =
|
|
27735
|
+
const childElement = React95__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
27924
27736
|
const childPointerDown = childElement.props.onPointerDown;
|
|
27925
|
-
const triggerElement =
|
|
27737
|
+
const triggerElement = React95__default.cloneElement(
|
|
27926
27738
|
childElement,
|
|
27927
27739
|
{
|
|
27928
27740
|
ref: triggerRef,
|
|
@@ -28524,9 +28336,9 @@ var init_Tooltip = __esm({
|
|
|
28524
28336
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
28525
28337
|
};
|
|
28526
28338
|
}, []);
|
|
28527
|
-
const triggerElement =
|
|
28339
|
+
const triggerElement = React95__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
28528
28340
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
28529
|
-
const trigger =
|
|
28341
|
+
const trigger = React95__default.cloneElement(triggerElement, {
|
|
28530
28342
|
ref: triggerRef,
|
|
28531
28343
|
onMouseEnter: handleMouseEnter,
|
|
28532
28344
|
onMouseLeave: handleMouseLeave,
|
|
@@ -28616,7 +28428,7 @@ var init_WizardProgress = __esm({
|
|
|
28616
28428
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
28617
28429
|
const isActive = index === currentStep;
|
|
28618
28430
|
const isCompleted = index < currentStep;
|
|
28619
|
-
return /* @__PURE__ */ jsxs(
|
|
28431
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
28620
28432
|
/* @__PURE__ */ jsx(
|
|
28621
28433
|
"button",
|
|
28622
28434
|
{
|
|
@@ -30176,13 +29988,13 @@ var init_MapView = __esm({
|
|
|
30176
29988
|
shadowSize: [41, 41]
|
|
30177
29989
|
});
|
|
30178
29990
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
30179
|
-
const { useEffect:
|
|
29991
|
+
const { useEffect: useEffect66, useRef: useRef64, useCallback: useCallback98, useState: useState97 } = React95__default;
|
|
30180
29992
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
30181
29993
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
30182
29994
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
30183
29995
|
const map = useMap();
|
|
30184
|
-
const prevRef =
|
|
30185
|
-
|
|
29996
|
+
const prevRef = useRef64({ centerLat, centerLng, zoom });
|
|
29997
|
+
useEffect66(() => {
|
|
30186
29998
|
const prev = prevRef.current;
|
|
30187
29999
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
30188
30000
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -30193,7 +30005,7 @@ var init_MapView = __esm({
|
|
|
30193
30005
|
}
|
|
30194
30006
|
function MapClickHandler({ onMapClick }) {
|
|
30195
30007
|
const map = useMap();
|
|
30196
|
-
|
|
30008
|
+
useEffect66(() => {
|
|
30197
30009
|
if (!onMapClick) return;
|
|
30198
30010
|
const handler = (e) => {
|
|
30199
30011
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -30222,7 +30034,7 @@ var init_MapView = __esm({
|
|
|
30222
30034
|
}) {
|
|
30223
30035
|
const eventBus = useEventBus2();
|
|
30224
30036
|
const [clickedPosition, setClickedPosition] = useState97(null);
|
|
30225
|
-
const handleMapClick =
|
|
30037
|
+
const handleMapClick = useCallback98((lat, lng) => {
|
|
30226
30038
|
if (showClickedPin) {
|
|
30227
30039
|
setClickedPosition({ lat, lng });
|
|
30228
30040
|
}
|
|
@@ -30231,7 +30043,7 @@ var init_MapView = __esm({
|
|
|
30231
30043
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
30232
30044
|
}
|
|
30233
30045
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
30234
|
-
const handleMarkerClick =
|
|
30046
|
+
const handleMarkerClick = useCallback98((marker) => {
|
|
30235
30047
|
onMarkerClick?.(marker);
|
|
30236
30048
|
if (markerClickEvent) {
|
|
30237
30049
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -31091,8 +30903,8 @@ function TableView({
|
|
|
31091
30903
|
}) {
|
|
31092
30904
|
const eventBus = useEventBus();
|
|
31093
30905
|
const { t } = useTranslate();
|
|
31094
|
-
const [visibleCount, setVisibleCount] =
|
|
31095
|
-
const [localSelected, setLocalSelected] =
|
|
30906
|
+
const [visibleCount, setVisibleCount] = React95__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
30907
|
+
const [localSelected, setLocalSelected] = React95__default.useState(/* @__PURE__ */ new Set());
|
|
31096
30908
|
const colDefs = columns ?? fields ?? [];
|
|
31097
30909
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
31098
30910
|
const dnd = useDataDnd({
|
|
@@ -31287,12 +31099,12 @@ function TableView({
|
|
|
31287
31099
|
]
|
|
31288
31100
|
}
|
|
31289
31101
|
);
|
|
31290
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
31102
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React95__default.Fragment, { children: rowInner }, id);
|
|
31291
31103
|
};
|
|
31292
31104
|
const items = Array.from(data);
|
|
31293
31105
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
31294
31106
|
let runningIndex = 0;
|
|
31295
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
31107
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
31296
31108
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
31297
31109
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
31298
31110
|
] }, gi)) });
|
|
@@ -32511,7 +32323,7 @@ var init_StepFlow = __esm({
|
|
|
32511
32323
|
className
|
|
32512
32324
|
}) => {
|
|
32513
32325
|
if (orientation === "vertical") {
|
|
32514
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
32326
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React95__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
32515
32327
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
32516
32328
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
32517
32329
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -32522,7 +32334,7 @@ var init_StepFlow = __esm({
|
|
|
32522
32334
|
] })
|
|
32523
32335
|
] }) }, index)) });
|
|
32524
32336
|
}
|
|
32525
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(
|
|
32337
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
32526
32338
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
32527
32339
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
32528
32340
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -33507,7 +33319,7 @@ var init_LikertScale = __esm({
|
|
|
33507
33319
|
md: "text-base",
|
|
33508
33320
|
lg: "text-lg"
|
|
33509
33321
|
};
|
|
33510
|
-
LikertScale =
|
|
33322
|
+
LikertScale = React95__default.forwardRef(
|
|
33511
33323
|
({
|
|
33512
33324
|
question,
|
|
33513
33325
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -33519,7 +33331,7 @@ var init_LikertScale = __esm({
|
|
|
33519
33331
|
variant = "radios",
|
|
33520
33332
|
className
|
|
33521
33333
|
}, ref) => {
|
|
33522
|
-
const groupId =
|
|
33334
|
+
const groupId = React95__default.useId();
|
|
33523
33335
|
const eventBus = useEventBus();
|
|
33524
33336
|
const handleSelect = useCallback(
|
|
33525
33337
|
(next) => {
|
|
@@ -35801,7 +35613,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
35801
35613
|
"aria-label": t("aria.breadcrumb"),
|
|
35802
35614
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
35803
35615
|
const isLast = idx === items.length - 1;
|
|
35804
|
-
return /* @__PURE__ */ jsxs(
|
|
35616
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
35805
35617
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
35806
35618
|
Icon,
|
|
35807
35619
|
{
|
|
@@ -36670,7 +36482,7 @@ var init_MiniStateMachine = __esm({
|
|
|
36670
36482
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
36671
36483
|
const tc = transitionCounts[s.name] ?? 0;
|
|
36672
36484
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
36673
|
-
return /* @__PURE__ */ jsxs(
|
|
36485
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
36674
36486
|
/* @__PURE__ */ jsx(
|
|
36675
36487
|
AvlState,
|
|
36676
36488
|
{
|
|
@@ -36874,7 +36686,7 @@ var init_PageHeader = __esm({
|
|
|
36874
36686
|
info: "bg-info/10 text-info"
|
|
36875
36687
|
};
|
|
36876
36688
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
36877
|
-
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(
|
|
36689
|
+
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(React95__default.Fragment, { children: [
|
|
36878
36690
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
36879
36691
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
36880
36692
|
"a",
|
|
@@ -37232,7 +37044,7 @@ var init_Section = __esm({
|
|
|
37232
37044
|
as: Component = "section"
|
|
37233
37045
|
}) => {
|
|
37234
37046
|
const hasHeader = title || description || action;
|
|
37235
|
-
return
|
|
37047
|
+
return React95__default.createElement(
|
|
37236
37048
|
Component,
|
|
37237
37049
|
{
|
|
37238
37050
|
className: cn(
|
|
@@ -37606,7 +37418,7 @@ var init_WizardContainer = __esm({
|
|
|
37606
37418
|
const isCompleted = index < currentStep;
|
|
37607
37419
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
37608
37420
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
37609
|
-
return /* @__PURE__ */ jsxs(
|
|
37421
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
37610
37422
|
/* @__PURE__ */ jsx(
|
|
37611
37423
|
Button,
|
|
37612
37424
|
{
|
|
@@ -40039,7 +39851,7 @@ var init_DetailPanel = __esm({
|
|
|
40039
39851
|
}
|
|
40040
39852
|
});
|
|
40041
39853
|
function extractTitle(children) {
|
|
40042
|
-
if (!
|
|
39854
|
+
if (!React95__default.isValidElement(children)) return void 0;
|
|
40043
39855
|
const props = children.props;
|
|
40044
39856
|
if (typeof props.title === "string") {
|
|
40045
39857
|
return props.title;
|
|
@@ -40389,12 +40201,12 @@ var init_Form = __esm({
|
|
|
40389
40201
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
40390
40202
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
40391
40203
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
40392
|
-
const normalizedInitialData =
|
|
40204
|
+
const normalizedInitialData = React95__default.useMemo(() => {
|
|
40393
40205
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
40394
40206
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
40395
40207
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
40396
40208
|
}, [entity, initialData]);
|
|
40397
|
-
const entityDerivedFields =
|
|
40209
|
+
const entityDerivedFields = React95__default.useMemo(() => {
|
|
40398
40210
|
if (fields && fields.length > 0) return void 0;
|
|
40399
40211
|
if (!resolvedEntity) return void 0;
|
|
40400
40212
|
return resolvedEntity.fields.map(
|
|
@@ -40415,16 +40227,16 @@ var init_Form = __esm({
|
|
|
40415
40227
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
40416
40228
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
40417
40229
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
40418
|
-
const [formData, setFormData] =
|
|
40230
|
+
const [formData, setFormData] = React95__default.useState(
|
|
40419
40231
|
normalizedInitialData
|
|
40420
40232
|
);
|
|
40421
|
-
const [collapsedSections, setCollapsedSections] =
|
|
40233
|
+
const [collapsedSections, setCollapsedSections] = React95__default.useState(
|
|
40422
40234
|
/* @__PURE__ */ new Set()
|
|
40423
40235
|
);
|
|
40424
|
-
const [submitError, setSubmitError] =
|
|
40425
|
-
const formRef =
|
|
40236
|
+
const [submitError, setSubmitError] = React95__default.useState(null);
|
|
40237
|
+
const formRef = React95__default.useRef(null);
|
|
40426
40238
|
const formMode = props.mode;
|
|
40427
|
-
const mountedRef =
|
|
40239
|
+
const mountedRef = React95__default.useRef(false);
|
|
40428
40240
|
if (!mountedRef.current) {
|
|
40429
40241
|
mountedRef.current = true;
|
|
40430
40242
|
debug("forms", "mount", {
|
|
@@ -40437,7 +40249,7 @@ var init_Form = __esm({
|
|
|
40437
40249
|
});
|
|
40438
40250
|
}
|
|
40439
40251
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
40440
|
-
const evalContext =
|
|
40252
|
+
const evalContext = React95__default.useMemo(
|
|
40441
40253
|
() => ({
|
|
40442
40254
|
formValues: formData,
|
|
40443
40255
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -40446,7 +40258,7 @@ var init_Form = __esm({
|
|
|
40446
40258
|
}),
|
|
40447
40259
|
[formData, externalContext]
|
|
40448
40260
|
);
|
|
40449
|
-
|
|
40261
|
+
React95__default.useEffect(() => {
|
|
40450
40262
|
debug("forms", "initialData-sync", {
|
|
40451
40263
|
mode: formMode,
|
|
40452
40264
|
normalizedInitialData,
|
|
@@ -40457,7 +40269,7 @@ var init_Form = __esm({
|
|
|
40457
40269
|
setFormData(normalizedInitialData);
|
|
40458
40270
|
}
|
|
40459
40271
|
}, [normalizedInitialData]);
|
|
40460
|
-
const processCalculations =
|
|
40272
|
+
const processCalculations = React95__default.useCallback(
|
|
40461
40273
|
(changedFieldId, newFormData) => {
|
|
40462
40274
|
if (!hiddenCalculations.length) return;
|
|
40463
40275
|
const context = {
|
|
@@ -40482,7 +40294,7 @@ var init_Form = __esm({
|
|
|
40482
40294
|
},
|
|
40483
40295
|
[hiddenCalculations, externalContext, eventBus]
|
|
40484
40296
|
);
|
|
40485
|
-
const checkViolations =
|
|
40297
|
+
const checkViolations = React95__default.useCallback(
|
|
40486
40298
|
(changedFieldId, newFormData) => {
|
|
40487
40299
|
if (!violationTriggers.length) return;
|
|
40488
40300
|
const context = {
|
|
@@ -40520,7 +40332,7 @@ var init_Form = __esm({
|
|
|
40520
40332
|
processCalculations(name, newFormData);
|
|
40521
40333
|
checkViolations(name, newFormData);
|
|
40522
40334
|
};
|
|
40523
|
-
const isFieldVisible =
|
|
40335
|
+
const isFieldVisible = React95__default.useCallback(
|
|
40524
40336
|
(fieldName) => {
|
|
40525
40337
|
const condition = conditionalFields[fieldName];
|
|
40526
40338
|
if (!condition) return true;
|
|
@@ -40528,7 +40340,7 @@ var init_Form = __esm({
|
|
|
40528
40340
|
},
|
|
40529
40341
|
[conditionalFields, evalContext]
|
|
40530
40342
|
);
|
|
40531
|
-
const isSectionVisible =
|
|
40343
|
+
const isSectionVisible = React95__default.useCallback(
|
|
40532
40344
|
(section) => {
|
|
40533
40345
|
if (!section.condition) return true;
|
|
40534
40346
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -40604,7 +40416,7 @@ var init_Form = __esm({
|
|
|
40604
40416
|
eventBus.emit(`UI:${onCancel}`);
|
|
40605
40417
|
}
|
|
40606
40418
|
};
|
|
40607
|
-
const renderField =
|
|
40419
|
+
const renderField = React95__default.useCallback(
|
|
40608
40420
|
(field) => {
|
|
40609
40421
|
const fieldName = field.name || field.field;
|
|
40610
40422
|
if (!fieldName) return null;
|
|
@@ -40625,7 +40437,7 @@ var init_Form = __esm({
|
|
|
40625
40437
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
40626
40438
|
);
|
|
40627
40439
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
40628
|
-
const normalizedFields =
|
|
40440
|
+
const normalizedFields = React95__default.useMemo(() => {
|
|
40629
40441
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
40630
40442
|
return effectiveFields.map((field) => {
|
|
40631
40443
|
if (typeof field === "string") {
|
|
@@ -40649,7 +40461,7 @@ var init_Form = __esm({
|
|
|
40649
40461
|
return field;
|
|
40650
40462
|
});
|
|
40651
40463
|
}, [effectiveFields, resolvedEntity]);
|
|
40652
|
-
const schemaFields =
|
|
40464
|
+
const schemaFields = React95__default.useMemo(() => {
|
|
40653
40465
|
if (normalizedFields.length === 0) return null;
|
|
40654
40466
|
if (isDebugEnabled()) {
|
|
40655
40467
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -40659,7 +40471,7 @@ var init_Form = __esm({
|
|
|
40659
40471
|
}
|
|
40660
40472
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
40661
40473
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
40662
|
-
const sectionElements =
|
|
40474
|
+
const sectionElements = React95__default.useMemo(() => {
|
|
40663
40475
|
if (!sections || sections.length === 0) return null;
|
|
40664
40476
|
return sections.map((section) => {
|
|
40665
40477
|
if (!isSectionVisible(section)) {
|
|
@@ -41384,7 +41196,7 @@ var init_List = __esm({
|
|
|
41384
41196
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
41385
41197
|
return [];
|
|
41386
41198
|
}, [entity]);
|
|
41387
|
-
const getItemActions =
|
|
41199
|
+
const getItemActions = React95__default.useCallback(
|
|
41388
41200
|
(item) => {
|
|
41389
41201
|
if (!itemActions) return [];
|
|
41390
41202
|
if (typeof itemActions === "function") {
|
|
@@ -41859,7 +41671,7 @@ var init_MediaGallery = __esm({
|
|
|
41859
41671
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
41860
41672
|
);
|
|
41861
41673
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
41862
|
-
const items =
|
|
41674
|
+
const items = React95__default.useMemo(() => {
|
|
41863
41675
|
if (propItems) return propItems;
|
|
41864
41676
|
if (entityData.length === 0) return [];
|
|
41865
41677
|
return entityData.map((record, idx) => {
|
|
@@ -42022,7 +41834,7 @@ var init_MediaGallery = __esm({
|
|
|
42022
41834
|
}
|
|
42023
41835
|
});
|
|
42024
41836
|
function extractTitle2(children) {
|
|
42025
|
-
if (!
|
|
41837
|
+
if (!React95__default.isValidElement(children)) return void 0;
|
|
42026
41838
|
const props = children.props;
|
|
42027
41839
|
if (typeof props.title === "string") {
|
|
42028
41840
|
return props.title;
|
|
@@ -42296,7 +42108,7 @@ var init_debugRegistry = __esm({
|
|
|
42296
42108
|
}
|
|
42297
42109
|
});
|
|
42298
42110
|
function useDebugData() {
|
|
42299
|
-
const [data, setData] =
|
|
42111
|
+
const [data, setData] = React95.useState(() => ({
|
|
42300
42112
|
traits: [],
|
|
42301
42113
|
ticks: [],
|
|
42302
42114
|
guards: [],
|
|
@@ -42310,7 +42122,7 @@ function useDebugData() {
|
|
|
42310
42122
|
},
|
|
42311
42123
|
lastUpdate: Date.now()
|
|
42312
42124
|
}));
|
|
42313
|
-
|
|
42125
|
+
React95.useEffect(() => {
|
|
42314
42126
|
const updateData = () => {
|
|
42315
42127
|
setData({
|
|
42316
42128
|
traits: getAllTraits(),
|
|
@@ -42419,12 +42231,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
42419
42231
|
return positions;
|
|
42420
42232
|
}
|
|
42421
42233
|
function WalkMinimap() {
|
|
42422
|
-
const [walkStep, setWalkStep] =
|
|
42423
|
-
const [traits2, setTraits] =
|
|
42424
|
-
const [coveredEdges, setCoveredEdges] =
|
|
42425
|
-
const [completedTraits, setCompletedTraits] =
|
|
42426
|
-
const prevTraitRef =
|
|
42427
|
-
|
|
42234
|
+
const [walkStep, setWalkStep] = React95.useState(null);
|
|
42235
|
+
const [traits2, setTraits] = React95.useState([]);
|
|
42236
|
+
const [coveredEdges, setCoveredEdges] = React95.useState([]);
|
|
42237
|
+
const [completedTraits, setCompletedTraits] = React95.useState(/* @__PURE__ */ new Set());
|
|
42238
|
+
const prevTraitRef = React95.useRef(null);
|
|
42239
|
+
React95.useEffect(() => {
|
|
42428
42240
|
const interval = setInterval(() => {
|
|
42429
42241
|
const w = window;
|
|
42430
42242
|
const step = w.__orbitalWalkStep;
|
|
@@ -42860,15 +42672,15 @@ var init_EntitiesTab = __esm({
|
|
|
42860
42672
|
});
|
|
42861
42673
|
function EventFlowTab({ events: events2 }) {
|
|
42862
42674
|
const { t } = useTranslate();
|
|
42863
|
-
const [filter, setFilter] =
|
|
42864
|
-
const containerRef =
|
|
42865
|
-
const [autoScroll, setAutoScroll] =
|
|
42866
|
-
|
|
42675
|
+
const [filter, setFilter] = React95.useState("all");
|
|
42676
|
+
const containerRef = React95.useRef(null);
|
|
42677
|
+
const [autoScroll, setAutoScroll] = React95.useState(true);
|
|
42678
|
+
React95.useEffect(() => {
|
|
42867
42679
|
if (autoScroll && containerRef.current) {
|
|
42868
42680
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42869
42681
|
}
|
|
42870
42682
|
}, [events2.length, autoScroll]);
|
|
42871
|
-
const filteredEvents =
|
|
42683
|
+
const filteredEvents = React95.useMemo(() => {
|
|
42872
42684
|
if (filter === "all") return events2;
|
|
42873
42685
|
return events2.filter((e) => e.type === filter);
|
|
42874
42686
|
}, [events2, filter]);
|
|
@@ -42984,7 +42796,7 @@ var init_EventFlowTab = __esm({
|
|
|
42984
42796
|
});
|
|
42985
42797
|
function GuardsPanel({ guards }) {
|
|
42986
42798
|
const { t } = useTranslate();
|
|
42987
|
-
const [filter, setFilter] =
|
|
42799
|
+
const [filter, setFilter] = React95.useState("all");
|
|
42988
42800
|
if (guards.length === 0) {
|
|
42989
42801
|
return /* @__PURE__ */ jsx(
|
|
42990
42802
|
EmptyState,
|
|
@@ -42997,7 +42809,7 @@ function GuardsPanel({ guards }) {
|
|
|
42997
42809
|
}
|
|
42998
42810
|
const passedCount = guards.filter((g) => g.result).length;
|
|
42999
42811
|
const failedCount = guards.length - passedCount;
|
|
43000
|
-
const filteredGuards =
|
|
42812
|
+
const filteredGuards = React95.useMemo(() => {
|
|
43001
42813
|
if (filter === "all") return guards;
|
|
43002
42814
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
43003
42815
|
return guards.filter((g) => !g.result);
|
|
@@ -43160,10 +42972,10 @@ function EffectBadge({ effect }) {
|
|
|
43160
42972
|
}
|
|
43161
42973
|
function TransitionTimeline({ transitions }) {
|
|
43162
42974
|
const { t } = useTranslate();
|
|
43163
|
-
const containerRef =
|
|
43164
|
-
const [autoScroll, setAutoScroll] =
|
|
43165
|
-
const [expandedId, setExpandedId] =
|
|
43166
|
-
|
|
42975
|
+
const containerRef = React95.useRef(null);
|
|
42976
|
+
const [autoScroll, setAutoScroll] = React95.useState(true);
|
|
42977
|
+
const [expandedId, setExpandedId] = React95.useState(null);
|
|
42978
|
+
React95.useEffect(() => {
|
|
43167
42979
|
if (autoScroll && containerRef.current) {
|
|
43168
42980
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
43169
42981
|
}
|
|
@@ -43443,9 +43255,9 @@ function getAllEvents(traits2) {
|
|
|
43443
43255
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
43444
43256
|
const eventBus = useEventBus();
|
|
43445
43257
|
const { t } = useTranslate();
|
|
43446
|
-
const [log9, setLog] =
|
|
43447
|
-
const prevStatesRef =
|
|
43448
|
-
|
|
43258
|
+
const [log9, setLog] = React95.useState([]);
|
|
43259
|
+
const prevStatesRef = React95.useRef(/* @__PURE__ */ new Map());
|
|
43260
|
+
React95.useEffect(() => {
|
|
43449
43261
|
for (const trait of traits2) {
|
|
43450
43262
|
const prev = prevStatesRef.current.get(trait.id);
|
|
43451
43263
|
if (prev && prev !== trait.currentState) {
|
|
@@ -43614,10 +43426,10 @@ function VerifyModePanel({
|
|
|
43614
43426
|
localCount
|
|
43615
43427
|
}) {
|
|
43616
43428
|
const { t } = useTranslate();
|
|
43617
|
-
const [expanded, setExpanded] =
|
|
43618
|
-
const scrollRef =
|
|
43619
|
-
const prevCountRef =
|
|
43620
|
-
|
|
43429
|
+
const [expanded, setExpanded] = React95.useState(true);
|
|
43430
|
+
const scrollRef = React95.useRef(null);
|
|
43431
|
+
const prevCountRef = React95.useRef(0);
|
|
43432
|
+
React95.useEffect(() => {
|
|
43621
43433
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
43622
43434
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
43623
43435
|
}
|
|
@@ -43674,10 +43486,10 @@ function RuntimeDebugger({
|
|
|
43674
43486
|
schema
|
|
43675
43487
|
}) {
|
|
43676
43488
|
const { t } = useTranslate();
|
|
43677
|
-
const [isCollapsed, setIsCollapsed] =
|
|
43678
|
-
const [isVisible, setIsVisible] =
|
|
43489
|
+
const [isCollapsed, setIsCollapsed] = React95.useState(mode === "verify" ? true : defaultCollapsed);
|
|
43490
|
+
const [isVisible, setIsVisible] = React95.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
43679
43491
|
const debugData = useDebugData();
|
|
43680
|
-
|
|
43492
|
+
React95.useEffect(() => {
|
|
43681
43493
|
if (mode === "inline") return;
|
|
43682
43494
|
return onDebugToggle((enabled) => {
|
|
43683
43495
|
setIsVisible(enabled);
|
|
@@ -43686,7 +43498,7 @@ function RuntimeDebugger({
|
|
|
43686
43498
|
}
|
|
43687
43499
|
});
|
|
43688
43500
|
}, [mode]);
|
|
43689
|
-
|
|
43501
|
+
React95.useEffect(() => {
|
|
43690
43502
|
if (mode === "inline") return;
|
|
43691
43503
|
const handleKeyDown = (e) => {
|
|
43692
43504
|
if (e.key === "`" && isVisible) {
|
|
@@ -44206,7 +44018,7 @@ var init_StatCard = __esm({
|
|
|
44206
44018
|
const labelToUse = propLabel ?? propTitle;
|
|
44207
44019
|
const eventBus = useEventBus();
|
|
44208
44020
|
const { t } = useTranslate();
|
|
44209
|
-
const handleActionClick =
|
|
44021
|
+
const handleActionClick = React95__default.useCallback(() => {
|
|
44210
44022
|
if (action?.event) {
|
|
44211
44023
|
eventBus.emit(`UI:${action.event}`, {});
|
|
44212
44024
|
}
|
|
@@ -44217,7 +44029,7 @@ var init_StatCard = __esm({
|
|
|
44217
44029
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
44218
44030
|
const isLoading = externalLoading ?? false;
|
|
44219
44031
|
const error = externalError;
|
|
44220
|
-
const computeMetricValue =
|
|
44032
|
+
const computeMetricValue = React95__default.useCallback(
|
|
44221
44033
|
(metric, items) => {
|
|
44222
44034
|
if (metric.value !== void 0) {
|
|
44223
44035
|
return metric.value;
|
|
@@ -44256,7 +44068,7 @@ var init_StatCard = __esm({
|
|
|
44256
44068
|
},
|
|
44257
44069
|
[]
|
|
44258
44070
|
);
|
|
44259
|
-
const schemaStats =
|
|
44071
|
+
const schemaStats = React95__default.useMemo(() => {
|
|
44260
44072
|
if (!metrics || metrics.length === 0) return null;
|
|
44261
44073
|
return metrics.map((metric) => ({
|
|
44262
44074
|
label: metric.label,
|
|
@@ -44264,7 +44076,7 @@ var init_StatCard = __esm({
|
|
|
44264
44076
|
format: metric.format
|
|
44265
44077
|
}));
|
|
44266
44078
|
}, [metrics, data, computeMetricValue]);
|
|
44267
|
-
const calculatedTrend =
|
|
44079
|
+
const calculatedTrend = React95__default.useMemo(() => {
|
|
44268
44080
|
if (manualTrend !== void 0) return manualTrend;
|
|
44269
44081
|
if (previousValue === void 0 || currentValue === void 0)
|
|
44270
44082
|
return void 0;
|
|
@@ -44904,8 +44716,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
44904
44716
|
] });
|
|
44905
44717
|
};
|
|
44906
44718
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
44907
|
-
const endRef =
|
|
44908
|
-
|
|
44719
|
+
const endRef = React95__default.useRef(null);
|
|
44720
|
+
React95__default.useEffect(() => {
|
|
44909
44721
|
if (!autoScroll) return;
|
|
44910
44722
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
44911
44723
|
}, [activities.length, autoScroll]);
|
|
@@ -44999,7 +44811,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
44999
44811
|
};
|
|
45000
44812
|
SubagentRichCard = ({ subagent }) => {
|
|
45001
44813
|
const { t } = useTranslate();
|
|
45002
|
-
const activities =
|
|
44814
|
+
const activities = React95__default.useMemo(
|
|
45003
44815
|
() => subagentMessagesToActivities(subagent.messages),
|
|
45004
44816
|
[subagent.messages]
|
|
45005
44817
|
);
|
|
@@ -45076,8 +44888,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
45076
44888
|
] });
|
|
45077
44889
|
};
|
|
45078
44890
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
45079
|
-
const endRef =
|
|
45080
|
-
|
|
44891
|
+
const endRef = React95__default.useRef(null);
|
|
44892
|
+
React95__default.useEffect(() => {
|
|
45081
44893
|
if (!autoScroll) return;
|
|
45082
44894
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
45083
44895
|
}, [messages.length, autoScroll]);
|
|
@@ -45507,7 +45319,7 @@ var init_Timeline = __esm({
|
|
|
45507
45319
|
}) => {
|
|
45508
45320
|
const { t } = useTranslate();
|
|
45509
45321
|
const entityData = entity ?? [];
|
|
45510
|
-
const items =
|
|
45322
|
+
const items = React95__default.useMemo(() => {
|
|
45511
45323
|
if (propItems) return propItems;
|
|
45512
45324
|
if (entityData.length === 0) return [];
|
|
45513
45325
|
return entityData.map((record, idx) => {
|
|
@@ -45609,7 +45421,7 @@ var init_Timeline = __esm({
|
|
|
45609
45421
|
}
|
|
45610
45422
|
});
|
|
45611
45423
|
function extractToastProps(children) {
|
|
45612
|
-
if (!
|
|
45424
|
+
if (!React95__default.isValidElement(children)) {
|
|
45613
45425
|
if (typeof children === "string") {
|
|
45614
45426
|
return { message: children };
|
|
45615
45427
|
}
|
|
@@ -45651,7 +45463,7 @@ var init_ToastSlot = __esm({
|
|
|
45651
45463
|
eventBus.emit(`${prefix}CLOSE`);
|
|
45652
45464
|
};
|
|
45653
45465
|
if (!isVisible) return null;
|
|
45654
|
-
const isCustomContent =
|
|
45466
|
+
const isCustomContent = React95__default.isValidElement(children) && !message;
|
|
45655
45467
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
45656
45468
|
Toast,
|
|
45657
45469
|
{
|
|
@@ -45668,7 +45480,7 @@ var init_ToastSlot = __esm({
|
|
|
45668
45480
|
}
|
|
45669
45481
|
});
|
|
45670
45482
|
function lazyThree(name, loader) {
|
|
45671
|
-
const Lazy =
|
|
45483
|
+
const Lazy = React95__default.lazy(
|
|
45672
45484
|
() => loader().then((m) => {
|
|
45673
45485
|
const Resolved = m[name];
|
|
45674
45486
|
if (!Resolved) {
|
|
@@ -45680,13 +45492,13 @@ function lazyThree(name, loader) {
|
|
|
45680
45492
|
})
|
|
45681
45493
|
);
|
|
45682
45494
|
function ThreeWrapper(props) {
|
|
45683
|
-
return
|
|
45495
|
+
return React95__default.createElement(
|
|
45684
45496
|
ThreeBoundary,
|
|
45685
45497
|
{ name },
|
|
45686
|
-
|
|
45687
|
-
|
|
45498
|
+
React95__default.createElement(
|
|
45499
|
+
React95__default.Suspense,
|
|
45688
45500
|
{ fallback: null },
|
|
45689
|
-
|
|
45501
|
+
React95__default.createElement(Lazy, props)
|
|
45690
45502
|
)
|
|
45691
45503
|
);
|
|
45692
45504
|
}
|
|
@@ -45847,6 +45659,7 @@ var init_component_registry_generated = __esm({
|
|
|
45847
45659
|
init_Navigation();
|
|
45848
45660
|
init_NegotiatorBoard();
|
|
45849
45661
|
init_NumberStepper();
|
|
45662
|
+
init_ObjectRulePanel();
|
|
45850
45663
|
init_OptionConstraintGroup();
|
|
45851
45664
|
init_OrbitalVisualization();
|
|
45852
45665
|
init_Overlay();
|
|
@@ -45892,7 +45705,6 @@ var init_component_registry_generated = __esm({
|
|
|
45892
45705
|
init_Sidebar();
|
|
45893
45706
|
init_SignaturePad();
|
|
45894
45707
|
init_SimpleGrid();
|
|
45895
|
-
init_SimulationCanvas();
|
|
45896
45708
|
init_SimulatorBoard();
|
|
45897
45709
|
init_Skeleton();
|
|
45898
45710
|
init_SocialProof();
|
|
@@ -45910,6 +45722,7 @@ var init_component_registry_generated = __esm({
|
|
|
45910
45722
|
init_StateArchitectBoard();
|
|
45911
45723
|
init_StateGraph();
|
|
45912
45724
|
init_StateIndicator();
|
|
45725
|
+
init_StateJsonView();
|
|
45913
45726
|
init_StateMachineView();
|
|
45914
45727
|
init_StatsGrid();
|
|
45915
45728
|
init_StatsOrganism();
|
|
@@ -45956,6 +45769,7 @@ var init_component_registry_generated = __esm({
|
|
|
45956
45769
|
init_Typography();
|
|
45957
45770
|
init_UISlotRenderer();
|
|
45958
45771
|
init_UploadDropZone();
|
|
45772
|
+
init_VariablePanel();
|
|
45959
45773
|
init_VersionDiff();
|
|
45960
45774
|
init_ViolationAlert();
|
|
45961
45775
|
init_VoteStack();
|
|
@@ -45963,7 +45777,7 @@ var init_component_registry_generated = __esm({
|
|
|
45963
45777
|
init_WizardContainer();
|
|
45964
45778
|
init_WizardNavigation();
|
|
45965
45779
|
init_WizardProgress();
|
|
45966
|
-
ThreeBoundary = class extends
|
|
45780
|
+
ThreeBoundary = class extends React95__default.Component {
|
|
45967
45781
|
constructor() {
|
|
45968
45782
|
super(...arguments);
|
|
45969
45783
|
__publicField(this, "state", { failed: false });
|
|
@@ -45973,7 +45787,7 @@ var init_component_registry_generated = __esm({
|
|
|
45973
45787
|
}
|
|
45974
45788
|
render() {
|
|
45975
45789
|
if (this.state.failed) {
|
|
45976
|
-
return
|
|
45790
|
+
return React95__default.createElement(
|
|
45977
45791
|
"div",
|
|
45978
45792
|
{
|
|
45979
45793
|
"data-testid": "three-unavailable",
|
|
@@ -46156,6 +45970,7 @@ var init_component_registry_generated = __esm({
|
|
|
46156
45970
|
"Navigation": Navigation,
|
|
46157
45971
|
"NegotiatorBoard": NegotiatorBoard,
|
|
46158
45972
|
"NumberStepper": NumberStepper,
|
|
45973
|
+
"ObjectRulePanel": ObjectRulePanel,
|
|
46159
45974
|
"OptionConstraintGroup": OptionConstraintGroup,
|
|
46160
45975
|
"OrbitalVisualization": OrbitalVisualization,
|
|
46161
45976
|
"Overlay": Overlay,
|
|
@@ -46201,7 +46016,6 @@ var init_component_registry_generated = __esm({
|
|
|
46201
46016
|
"Sidebar": Sidebar,
|
|
46202
46017
|
"SignaturePad": SignaturePad,
|
|
46203
46018
|
"SimpleGrid": SimpleGrid,
|
|
46204
|
-
"SimulationCanvas": SimulationCanvas,
|
|
46205
46019
|
"SimulatorBoard": SimulatorBoard,
|
|
46206
46020
|
"Skeleton": Skeleton,
|
|
46207
46021
|
"SocialProof": SocialProof,
|
|
@@ -46222,6 +46036,7 @@ var init_component_registry_generated = __esm({
|
|
|
46222
46036
|
"StateArchitectBoard": StateArchitectBoard,
|
|
46223
46037
|
"StateGraph": StateGraph,
|
|
46224
46038
|
"StateIndicator": StateIndicator,
|
|
46039
|
+
"StateJsonView": StateJsonView,
|
|
46225
46040
|
"StateMachineView": StateMachineView,
|
|
46226
46041
|
"StatsGrid": StatsGrid,
|
|
46227
46042
|
"StatsOrganism": StatsOrganism,
|
|
@@ -46269,6 +46084,7 @@ var init_component_registry_generated = __esm({
|
|
|
46269
46084
|
"UISlotRenderer": UISlotRenderer,
|
|
46270
46085
|
"UploadDropZone": UploadDropZone,
|
|
46271
46086
|
"VStack": VStack,
|
|
46087
|
+
"VariablePanel": VariablePanel,
|
|
46272
46088
|
"VersionDiff": VersionDiff,
|
|
46273
46089
|
"ViolationAlert": ViolationAlert,
|
|
46274
46090
|
"VoteStack": VoteStack,
|
|
@@ -46294,7 +46110,7 @@ function SuspenseConfigProvider({
|
|
|
46294
46110
|
config,
|
|
46295
46111
|
children
|
|
46296
46112
|
}) {
|
|
46297
|
-
return
|
|
46113
|
+
return React95__default.createElement(
|
|
46298
46114
|
SuspenseConfigContext.Provider,
|
|
46299
46115
|
{ value: config },
|
|
46300
46116
|
children
|
|
@@ -46336,7 +46152,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
46336
46152
|
}
|
|
46337
46153
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
46338
46154
|
}
|
|
46339
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
46155
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React95__default.isValidElement(field) && !(field instanceof Date)) {
|
|
46340
46156
|
const obj = field;
|
|
46341
46157
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
46342
46158
|
if (!fieldName) return field;
|
|
@@ -46789,7 +46605,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
46789
46605
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
46790
46606
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
46791
46607
|
}
|
|
46792
|
-
return /* @__PURE__ */ jsx(
|
|
46608
|
+
return /* @__PURE__ */ jsx(React95__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
46793
46609
|
}
|
|
46794
46610
|
if (!child || typeof child !== "object") return null;
|
|
46795
46611
|
const childId = `${parentId}-${index}`;
|
|
@@ -46829,14 +46645,14 @@ function isPatternConfig(value) {
|
|
|
46829
46645
|
if (value === null || value === void 0) return false;
|
|
46830
46646
|
if (typeof value !== "object") return false;
|
|
46831
46647
|
if (Array.isArray(value)) return false;
|
|
46832
|
-
if (
|
|
46648
|
+
if (React95__default.isValidElement(value)) return false;
|
|
46833
46649
|
if (value instanceof Date) return false;
|
|
46834
46650
|
if (typeof value === "function") return false;
|
|
46835
46651
|
const record = value;
|
|
46836
46652
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
46837
46653
|
}
|
|
46838
46654
|
function isPlainConfigObject(value) {
|
|
46839
|
-
if (
|
|
46655
|
+
if (React95__default.isValidElement(value)) return false;
|
|
46840
46656
|
if (value instanceof Date) return false;
|
|
46841
46657
|
const proto = Object.getPrototypeOf(value);
|
|
46842
46658
|
return proto === Object.prototype || proto === null;
|
|
@@ -46962,7 +46778,7 @@ function SlotContentRenderer({
|
|
|
46962
46778
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
46963
46779
|
const slotVal = restProps[slotKey];
|
|
46964
46780
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
46965
|
-
if (
|
|
46781
|
+
if (React95__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
46966
46782
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
46967
46783
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
46968
46784
|
slotVal,
|
|
@@ -47011,7 +46827,7 @@ function SlotContentRenderer({
|
|
|
47011
46827
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
47012
46828
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
47013
46829
|
const sample = resolvedItems[0];
|
|
47014
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
46830
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React95__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
47015
46831
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
47016
46832
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
47017
46833
|
}
|
|
@@ -47303,7 +47119,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
47303
47119
|
if (Array.isArray(body)) {
|
|
47304
47120
|
return body.map((b) => recur(b));
|
|
47305
47121
|
}
|
|
47306
|
-
if (body !== null && typeof body === "object" && !
|
|
47122
|
+
if (body !== null && typeof body === "object" && !React95__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
47307
47123
|
const out = {};
|
|
47308
47124
|
for (const [k, v] of Object.entries(body)) {
|
|
47309
47125
|
out[k] = recur(v);
|
|
@@ -47322,7 +47138,7 @@ function getSlotContentRenderer2() {
|
|
|
47322
47138
|
function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
47323
47139
|
return (item, index) => {
|
|
47324
47140
|
const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
|
|
47325
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
47141
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React95__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
47326
47142
|
return null;
|
|
47327
47143
|
}
|
|
47328
47144
|
const record = resolvedBody;
|
|
@@ -47341,7 +47157,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
47341
47157
|
props: childProps,
|
|
47342
47158
|
priority: 0
|
|
47343
47159
|
};
|
|
47344
|
-
return
|
|
47160
|
+
return React95__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
47345
47161
|
};
|
|
47346
47162
|
}
|
|
47347
47163
|
function convertNode(node, callerKey) {
|
|
@@ -47360,7 +47176,7 @@ function convertNode(node, callerKey) {
|
|
|
47360
47176
|
});
|
|
47361
47177
|
return anyChanged ? mapped : node;
|
|
47362
47178
|
}
|
|
47363
|
-
if (typeof node === "object" && !
|
|
47179
|
+
if (typeof node === "object" && !React95__default.isValidElement(node) && !(node instanceof Date)) {
|
|
47364
47180
|
return convertObjectProps(node);
|
|
47365
47181
|
}
|
|
47366
47182
|
return node;
|
|
@@ -47811,42 +47627,14 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
47811
47627
|
});
|
|
47812
47628
|
}, [executeTransitionEffects]);
|
|
47813
47629
|
useEffect(() => {
|
|
47814
|
-
const
|
|
47815
|
-
(b) => b.trait.ticks?.some((t) => t.interval === "frame")
|
|
47816
|
-
);
|
|
47817
|
-
if (!hasFrameTicks) return;
|
|
47818
|
-
let running = true;
|
|
47819
|
-
let rafId = 0;
|
|
47820
|
-
const frame = () => {
|
|
47821
|
-
if (!running) return;
|
|
47822
|
-
for (const binding of traitBindingsRef.current) {
|
|
47823
|
-
for (const tick of binding.trait.ticks ?? []) {
|
|
47824
|
-
if (tick.interval !== "frame") continue;
|
|
47825
|
-
runTickEffects(tick, binding);
|
|
47826
|
-
}
|
|
47827
|
-
}
|
|
47828
|
-
rafId = requestAnimationFrame(frame);
|
|
47829
|
-
};
|
|
47830
|
-
rafId = requestAnimationFrame(frame);
|
|
47831
|
-
return () => {
|
|
47832
|
-
running = false;
|
|
47833
|
-
cancelAnimationFrame(rafId);
|
|
47834
|
-
};
|
|
47835
|
-
}, [traitBindings, runTickEffects]);
|
|
47836
|
-
useEffect(() => {
|
|
47837
|
-
const intervals = [];
|
|
47630
|
+
const scheduler = createTickScheduler();
|
|
47838
47631
|
for (const binding of traitBindings) {
|
|
47839
47632
|
for (const tick of binding.trait.ticks ?? []) {
|
|
47840
|
-
|
|
47841
|
-
|
|
47842
|
-
intervals.push(setInterval(() => {
|
|
47843
|
-
runTickEffects(tick, binding);
|
|
47844
|
-
}, ms));
|
|
47633
|
+
const intervalMs = tick.interval === "frame" ? 0 : tick.interval;
|
|
47634
|
+
scheduler.add(intervalMs, () => runTickEffects(tick, binding));
|
|
47845
47635
|
}
|
|
47846
47636
|
}
|
|
47847
|
-
return () =>
|
|
47848
|
-
for (const id of intervals) clearInterval(id);
|
|
47849
|
-
};
|
|
47637
|
+
return () => scheduler.stopAll();
|
|
47850
47638
|
}, [traitBindings, runTickEffects]);
|
|
47851
47639
|
const processEventQueued = useCallback(async (eventKey, payload) => {
|
|
47852
47640
|
const normalizedEvent = normalizeEventKey(eventKey);
|