@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/avl/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as React104 from 'react';
|
|
3
|
+
import React104__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId } from 'react';
|
|
4
4
|
import { getAllPages, OrbitalProvider, EventBusContext, useTraitScope, ServerBridgeProvider, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge, useEntitySchema, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath } from '@almadar/ui/providers';
|
|
5
5
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
6
6
|
import ELK from 'elkjs/lib/elk.bundled.js';
|
|
@@ -41,7 +41,7 @@ import { sortableKeyboardCoordinates, useSortable, arrayMove, SortableContext, r
|
|
|
41
41
|
import { CSS } from '@dnd-kit/utilities';
|
|
42
42
|
import { getPatternDefinition, getComponentForPattern as getComponentForPattern$1, isEntityAwarePattern } from '@almadar/patterns';
|
|
43
43
|
import { OrbitalServerRuntime } from '@almadar/runtime/OrbitalServerRuntime';
|
|
44
|
-
import { InMemoryPersistence, StateMachineManager, collectDeclaredConfigDefaults, createServerEffectHandlers, EffectExecutor, createContextFromBindings } from '@almadar/runtime';
|
|
44
|
+
import { InMemoryPersistence, StateMachineManager, collectDeclaredConfigDefaults, createServerEffectHandlers, EffectExecutor, createContextFromBindings, createTickScheduler } from '@almadar/runtime';
|
|
45
45
|
|
|
46
46
|
var __defProp = Object.defineProperty;
|
|
47
47
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -3174,7 +3174,7 @@ var init_Typography = __esm({
|
|
|
3174
3174
|
}) => {
|
|
3175
3175
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
3176
3176
|
const Component = as || defaultElements[variant];
|
|
3177
|
-
return
|
|
3177
|
+
return React104__default.createElement(
|
|
3178
3178
|
Component,
|
|
3179
3179
|
{
|
|
3180
3180
|
id,
|
|
@@ -3511,7 +3511,7 @@ var init_Box = __esm({
|
|
|
3511
3511
|
fixed: "fixed",
|
|
3512
3512
|
sticky: "sticky"
|
|
3513
3513
|
};
|
|
3514
|
-
Box =
|
|
3514
|
+
Box = React104__default.forwardRef(
|
|
3515
3515
|
({
|
|
3516
3516
|
padding,
|
|
3517
3517
|
paddingX,
|
|
@@ -3576,7 +3576,7 @@ var init_Box = __esm({
|
|
|
3576
3576
|
onPointerDown?.(e);
|
|
3577
3577
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
3578
3578
|
const isClickable = action || onClick;
|
|
3579
|
-
return
|
|
3579
|
+
return React104__default.createElement(
|
|
3580
3580
|
Component,
|
|
3581
3581
|
{
|
|
3582
3582
|
ref,
|
|
@@ -3672,7 +3672,7 @@ var init_Stack = __esm({
|
|
|
3672
3672
|
};
|
|
3673
3673
|
const isHorizontal = direction === "horizontal";
|
|
3674
3674
|
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";
|
|
3675
|
-
return
|
|
3675
|
+
return React104__default.createElement(
|
|
3676
3676
|
Component,
|
|
3677
3677
|
{
|
|
3678
3678
|
className: cn(
|
|
@@ -4164,7 +4164,7 @@ var init_MiniStateMachine = __esm({
|
|
|
4164
4164
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
4165
4165
|
const tc = transitionCounts[s.name] ?? 0;
|
|
4166
4166
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
4167
|
-
return /* @__PURE__ */ jsxs(
|
|
4167
|
+
return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
|
|
4168
4168
|
/* @__PURE__ */ jsx(
|
|
4169
4169
|
AvlState,
|
|
4170
4170
|
{
|
|
@@ -4494,7 +4494,7 @@ function loadLib(key, importer) {
|
|
|
4494
4494
|
return p;
|
|
4495
4495
|
}
|
|
4496
4496
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
4497
|
-
const Lazy =
|
|
4497
|
+
const Lazy = React104__default.lazy(async () => {
|
|
4498
4498
|
const lib = await loadLib(libKey, importer);
|
|
4499
4499
|
const Comp = pick(lib);
|
|
4500
4500
|
if (!Comp) {
|
|
@@ -4504,7 +4504,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
4504
4504
|
return { default: Comp };
|
|
4505
4505
|
});
|
|
4506
4506
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
4507
|
-
|
|
4507
|
+
React104__default.Suspense,
|
|
4508
4508
|
{
|
|
4509
4509
|
fallback: /* @__PURE__ */ jsx(
|
|
4510
4510
|
"span",
|
|
@@ -5235,7 +5235,7 @@ var init_Icon = __esm({
|
|
|
5235
5235
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
5236
5236
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
5237
5237
|
const family = useIconFamily();
|
|
5238
|
-
const RenderedComponent =
|
|
5238
|
+
const RenderedComponent = React104__default.useMemo(() => {
|
|
5239
5239
|
if (directIcon) return null;
|
|
5240
5240
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
5241
5241
|
}, [directIcon, effectiveName, family]);
|
|
@@ -5297,7 +5297,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
5297
5297
|
const IconComp = value;
|
|
5298
5298
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
5299
5299
|
}
|
|
5300
|
-
if (
|
|
5300
|
+
if (React104__default.isValidElement(value)) {
|
|
5301
5301
|
return value;
|
|
5302
5302
|
}
|
|
5303
5303
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -5373,7 +5373,7 @@ var init_Button = __esm({
|
|
|
5373
5373
|
md: "h-icon-default w-icon-default",
|
|
5374
5374
|
lg: "h-icon-default w-icon-default"
|
|
5375
5375
|
};
|
|
5376
|
-
Button =
|
|
5376
|
+
Button = React104__default.forwardRef(
|
|
5377
5377
|
({
|
|
5378
5378
|
className,
|
|
5379
5379
|
variant = "primary",
|
|
@@ -5441,7 +5441,7 @@ var Dialog;
|
|
|
5441
5441
|
var init_Dialog = __esm({
|
|
5442
5442
|
"components/core/atoms/Dialog.tsx"() {
|
|
5443
5443
|
init_cn();
|
|
5444
|
-
Dialog =
|
|
5444
|
+
Dialog = React104__default.forwardRef(
|
|
5445
5445
|
({
|
|
5446
5446
|
role = "dialog",
|
|
5447
5447
|
"aria-modal": ariaModal = true,
|
|
@@ -5936,7 +5936,7 @@ var init_Badge = __esm({
|
|
|
5936
5936
|
md: "px-2.5 py-1 text-sm",
|
|
5937
5937
|
lg: "px-3 py-1.5 text-base"
|
|
5938
5938
|
};
|
|
5939
|
-
Badge =
|
|
5939
|
+
Badge = React104__default.forwardRef(
|
|
5940
5940
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
5941
5941
|
const iconSizes3 = {
|
|
5942
5942
|
sm: "h-icon-default w-icon-default",
|
|
@@ -6273,7 +6273,7 @@ var init_SvgFlow = __esm({
|
|
|
6273
6273
|
width = 100,
|
|
6274
6274
|
height = 100
|
|
6275
6275
|
}) => {
|
|
6276
|
-
const markerId =
|
|
6276
|
+
const markerId = React104__default.useMemo(() => {
|
|
6277
6277
|
flowIdCounter += 1;
|
|
6278
6278
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
6279
6279
|
}, []);
|
|
@@ -6866,7 +6866,7 @@ var init_SvgRing = __esm({
|
|
|
6866
6866
|
width = 100,
|
|
6867
6867
|
height = 100
|
|
6868
6868
|
}) => {
|
|
6869
|
-
const gradientId =
|
|
6869
|
+
const gradientId = React104__default.useMemo(() => {
|
|
6870
6870
|
ringIdCounter += 1;
|
|
6871
6871
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
6872
6872
|
}, []);
|
|
@@ -7047,7 +7047,7 @@ var init_Input = __esm({
|
|
|
7047
7047
|
init_cn();
|
|
7048
7048
|
init_Icon();
|
|
7049
7049
|
init_useEventBus();
|
|
7050
|
-
Input =
|
|
7050
|
+
Input = React104__default.forwardRef(
|
|
7051
7051
|
({
|
|
7052
7052
|
className,
|
|
7053
7053
|
inputType,
|
|
@@ -7207,7 +7207,7 @@ var Label;
|
|
|
7207
7207
|
var init_Label = __esm({
|
|
7208
7208
|
"components/core/atoms/Label.tsx"() {
|
|
7209
7209
|
init_cn();
|
|
7210
|
-
Label =
|
|
7210
|
+
Label = React104__default.forwardRef(
|
|
7211
7211
|
({ className, required, children, ...props }, ref) => {
|
|
7212
7212
|
return /* @__PURE__ */ jsxs(
|
|
7213
7213
|
"label",
|
|
@@ -7234,7 +7234,7 @@ var init_Textarea = __esm({
|
|
|
7234
7234
|
"components/core/atoms/Textarea.tsx"() {
|
|
7235
7235
|
init_cn();
|
|
7236
7236
|
init_useEventBus();
|
|
7237
|
-
Textarea =
|
|
7237
|
+
Textarea = React104__default.forwardRef(
|
|
7238
7238
|
({ className, error, onChange, ...props }, ref) => {
|
|
7239
7239
|
const eventBus = useEventBus();
|
|
7240
7240
|
const handleChange = (e) => {
|
|
@@ -7473,7 +7473,7 @@ var init_Select = __esm({
|
|
|
7473
7473
|
init_cn();
|
|
7474
7474
|
init_Icon();
|
|
7475
7475
|
init_useEventBus();
|
|
7476
|
-
Select =
|
|
7476
|
+
Select = React104__default.forwardRef(
|
|
7477
7477
|
(props, _ref) => {
|
|
7478
7478
|
const { multiple, searchable, clearable } = props;
|
|
7479
7479
|
if (multiple || searchable || clearable) {
|
|
@@ -7490,7 +7490,7 @@ var init_Checkbox = __esm({
|
|
|
7490
7490
|
"components/core/atoms/Checkbox.tsx"() {
|
|
7491
7491
|
init_cn();
|
|
7492
7492
|
init_useEventBus();
|
|
7493
|
-
Checkbox =
|
|
7493
|
+
Checkbox = React104__default.forwardRef(
|
|
7494
7494
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
7495
7495
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
7496
7496
|
const eventBus = useEventBus();
|
|
@@ -7544,7 +7544,7 @@ var init_Spinner = __esm({
|
|
|
7544
7544
|
md: "h-6 w-6",
|
|
7545
7545
|
lg: "h-8 w-8"
|
|
7546
7546
|
};
|
|
7547
|
-
Spinner =
|
|
7547
|
+
Spinner = React104__default.forwardRef(
|
|
7548
7548
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
7549
7549
|
if (overlay) {
|
|
7550
7550
|
return /* @__PURE__ */ jsx(
|
|
@@ -7634,7 +7634,7 @@ var init_Card = __esm({
|
|
|
7634
7634
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
7635
7635
|
"tile-image-first": "p-0 overflow-hidden"
|
|
7636
7636
|
};
|
|
7637
|
-
Card =
|
|
7637
|
+
Card = React104__default.forwardRef(
|
|
7638
7638
|
({
|
|
7639
7639
|
className,
|
|
7640
7640
|
variant = "bordered",
|
|
@@ -7682,9 +7682,9 @@ var init_Card = __esm({
|
|
|
7682
7682
|
}
|
|
7683
7683
|
);
|
|
7684
7684
|
Card.displayName = "Card";
|
|
7685
|
-
CardHeader =
|
|
7685
|
+
CardHeader = React104__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
7686
7686
|
CardHeader.displayName = "CardHeader";
|
|
7687
|
-
CardTitle =
|
|
7687
|
+
CardTitle = React104__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7688
7688
|
"h3",
|
|
7689
7689
|
{
|
|
7690
7690
|
ref,
|
|
@@ -7697,11 +7697,11 @@ var init_Card = __esm({
|
|
|
7697
7697
|
}
|
|
7698
7698
|
));
|
|
7699
7699
|
CardTitle.displayName = "CardTitle";
|
|
7700
|
-
CardContent =
|
|
7700
|
+
CardContent = React104__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
7701
7701
|
CardContent.displayName = "CardContent";
|
|
7702
7702
|
CardBody = CardContent;
|
|
7703
7703
|
CardBody.displayName = "CardBody";
|
|
7704
|
-
CardFooter =
|
|
7704
|
+
CardFooter = React104__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7705
7705
|
"div",
|
|
7706
7706
|
{
|
|
7707
7707
|
ref,
|
|
@@ -7756,7 +7756,7 @@ var init_FilterPill = __esm({
|
|
|
7756
7756
|
md: "w-3.5 h-3.5",
|
|
7757
7757
|
lg: "w-4 h-4"
|
|
7758
7758
|
};
|
|
7759
|
-
FilterPill =
|
|
7759
|
+
FilterPill = React104__default.forwardRef(
|
|
7760
7760
|
({
|
|
7761
7761
|
className,
|
|
7762
7762
|
variant = "default",
|
|
@@ -7885,8 +7885,8 @@ var init_Avatar = __esm({
|
|
|
7885
7885
|
actionPayload
|
|
7886
7886
|
}) => {
|
|
7887
7887
|
const eventBus = useEventBus();
|
|
7888
|
-
const [imgFailed, setImgFailed] =
|
|
7889
|
-
|
|
7888
|
+
const [imgFailed, setImgFailed] = React104__default.useState(false);
|
|
7889
|
+
React104__default.useEffect(() => {
|
|
7890
7890
|
setImgFailed(false);
|
|
7891
7891
|
}, [src]);
|
|
7892
7892
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -7999,7 +7999,7 @@ var init_Center = __esm({
|
|
|
7999
7999
|
as: Component = "div"
|
|
8000
8000
|
}) => {
|
|
8001
8001
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
8002
|
-
return
|
|
8002
|
+
return React104__default.createElement(Component, {
|
|
8003
8003
|
className: cn(
|
|
8004
8004
|
inline ? "inline-flex" : "flex",
|
|
8005
8005
|
horizontal && "justify-center",
|
|
@@ -8267,7 +8267,7 @@ var init_Radio = __esm({
|
|
|
8267
8267
|
md: "w-2.5 h-2.5",
|
|
8268
8268
|
lg: "w-3 h-3"
|
|
8269
8269
|
};
|
|
8270
|
-
Radio =
|
|
8270
|
+
Radio = React104__default.forwardRef(
|
|
8271
8271
|
({
|
|
8272
8272
|
label,
|
|
8273
8273
|
helperText,
|
|
@@ -8284,12 +8284,12 @@ var init_Radio = __esm({
|
|
|
8284
8284
|
onChange,
|
|
8285
8285
|
...props
|
|
8286
8286
|
}, ref) => {
|
|
8287
|
-
const reactId =
|
|
8287
|
+
const reactId = React104__default.useId();
|
|
8288
8288
|
const baseId = id || `radio-${reactId}`;
|
|
8289
8289
|
const hasError = !!error;
|
|
8290
8290
|
const eventBus = useEventBus();
|
|
8291
|
-
const [selected, setSelected] =
|
|
8292
|
-
|
|
8291
|
+
const [selected, setSelected] = React104__default.useState(value);
|
|
8292
|
+
React104__default.useEffect(() => {
|
|
8293
8293
|
if (value !== void 0) setSelected(value);
|
|
8294
8294
|
}, [value]);
|
|
8295
8295
|
const pick = (next, e) => {
|
|
@@ -8471,7 +8471,7 @@ var init_Switch = __esm({
|
|
|
8471
8471
|
"components/core/atoms/Switch.tsx"() {
|
|
8472
8472
|
"use client";
|
|
8473
8473
|
init_cn();
|
|
8474
|
-
Switch =
|
|
8474
|
+
Switch = React104.forwardRef(
|
|
8475
8475
|
({
|
|
8476
8476
|
checked,
|
|
8477
8477
|
defaultChecked = false,
|
|
@@ -8482,10 +8482,10 @@ var init_Switch = __esm({
|
|
|
8482
8482
|
name,
|
|
8483
8483
|
className
|
|
8484
8484
|
}, ref) => {
|
|
8485
|
-
const [isChecked, setIsChecked] =
|
|
8485
|
+
const [isChecked, setIsChecked] = React104.useState(
|
|
8486
8486
|
checked !== void 0 ? checked : defaultChecked
|
|
8487
8487
|
);
|
|
8488
|
-
|
|
8488
|
+
React104.useEffect(() => {
|
|
8489
8489
|
if (checked !== void 0) {
|
|
8490
8490
|
setIsChecked(checked);
|
|
8491
8491
|
}
|
|
@@ -8763,7 +8763,7 @@ var Aside;
|
|
|
8763
8763
|
var init_Aside = __esm({
|
|
8764
8764
|
"components/core/atoms/Aside.tsx"() {
|
|
8765
8765
|
init_cn();
|
|
8766
|
-
Aside =
|
|
8766
|
+
Aside = React104__default.forwardRef(
|
|
8767
8767
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
8768
8768
|
);
|
|
8769
8769
|
Aside.displayName = "Aside";
|
|
@@ -8842,9 +8842,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
8842
8842
|
className
|
|
8843
8843
|
}) => {
|
|
8844
8844
|
const { t } = useTranslate();
|
|
8845
|
-
const [isVisible, setIsVisible] =
|
|
8846
|
-
const timeoutRef =
|
|
8847
|
-
const triggerRef =
|
|
8845
|
+
const [isVisible, setIsVisible] = React104__default.useState(false);
|
|
8846
|
+
const timeoutRef = React104__default.useRef(null);
|
|
8847
|
+
const triggerRef = React104__default.useRef(null);
|
|
8848
8848
|
const handleMouseEnter = () => {
|
|
8849
8849
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8850
8850
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -8855,7 +8855,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
8855
8855
|
};
|
|
8856
8856
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
8857
8857
|
const open = isVisible || revealed;
|
|
8858
|
-
|
|
8858
|
+
React104__default.useEffect(() => {
|
|
8859
8859
|
return () => {
|
|
8860
8860
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8861
8861
|
};
|
|
@@ -9065,7 +9065,7 @@ var init_StatusDot = __esm({
|
|
|
9065
9065
|
md: "w-2.5 h-2.5",
|
|
9066
9066
|
lg: "w-3 h-3"
|
|
9067
9067
|
};
|
|
9068
|
-
StatusDot =
|
|
9068
|
+
StatusDot = React104__default.forwardRef(
|
|
9069
9069
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
9070
9070
|
return /* @__PURE__ */ jsx(
|
|
9071
9071
|
"span",
|
|
@@ -9119,7 +9119,7 @@ var init_TrendIndicator = __esm({
|
|
|
9119
9119
|
down: "trending-down",
|
|
9120
9120
|
flat: "arrow-right"
|
|
9121
9121
|
};
|
|
9122
|
-
TrendIndicator =
|
|
9122
|
+
TrendIndicator = React104__default.forwardRef(
|
|
9123
9123
|
({
|
|
9124
9124
|
className,
|
|
9125
9125
|
value,
|
|
@@ -9186,7 +9186,7 @@ var init_RangeSlider = __esm({
|
|
|
9186
9186
|
md: "w-4 h-4",
|
|
9187
9187
|
lg: "w-5 h-5"
|
|
9188
9188
|
};
|
|
9189
|
-
RangeSlider =
|
|
9189
|
+
RangeSlider = React104__default.forwardRef(
|
|
9190
9190
|
({
|
|
9191
9191
|
className,
|
|
9192
9192
|
min = 0,
|
|
@@ -9780,7 +9780,7 @@ var init_ContentSection = __esm({
|
|
|
9780
9780
|
md: "py-16",
|
|
9781
9781
|
lg: "py-24"
|
|
9782
9782
|
};
|
|
9783
|
-
ContentSection =
|
|
9783
|
+
ContentSection = React104__default.forwardRef(
|
|
9784
9784
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
9785
9785
|
return /* @__PURE__ */ jsx(
|
|
9786
9786
|
Box,
|
|
@@ -10314,7 +10314,7 @@ var init_AnimatedReveal = __esm({
|
|
|
10314
10314
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
10315
10315
|
"none": {}
|
|
10316
10316
|
};
|
|
10317
|
-
AnimatedReveal =
|
|
10317
|
+
AnimatedReveal = React104__default.forwardRef(
|
|
10318
10318
|
({
|
|
10319
10319
|
trigger = "scroll",
|
|
10320
10320
|
animation = "fade-up",
|
|
@@ -10474,7 +10474,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
10474
10474
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
10475
10475
|
"use client";
|
|
10476
10476
|
init_cn();
|
|
10477
|
-
AnimatedGraphic =
|
|
10477
|
+
AnimatedGraphic = React104__default.forwardRef(
|
|
10478
10478
|
({
|
|
10479
10479
|
src,
|
|
10480
10480
|
svgContent,
|
|
@@ -10497,7 +10497,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
10497
10497
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
10498
10498
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
10499
10499
|
const prevAnimateRef = useRef(animate);
|
|
10500
|
-
const setRef =
|
|
10500
|
+
const setRef = React104__default.useCallback(
|
|
10501
10501
|
(node) => {
|
|
10502
10502
|
containerRef.current = node;
|
|
10503
10503
|
if (typeof ref === "function") ref(node);
|
|
@@ -11099,12 +11099,13 @@ function GameCard({
|
|
|
11099
11099
|
selected = false,
|
|
11100
11100
|
disabled = false,
|
|
11101
11101
|
size = "md",
|
|
11102
|
+
animState = "idle",
|
|
11102
11103
|
onClick,
|
|
11103
11104
|
clickEvent,
|
|
11104
11105
|
className
|
|
11105
11106
|
}) {
|
|
11106
11107
|
const eventBus = useEventBus();
|
|
11107
|
-
const handleClick =
|
|
11108
|
+
const handleClick = React104.useCallback(() => {
|
|
11108
11109
|
if (disabled) return;
|
|
11109
11110
|
onClick?.(id);
|
|
11110
11111
|
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
|
|
@@ -11126,6 +11127,7 @@ function GameCard({
|
|
|
11126
11127
|
cardSizeMap[size],
|
|
11127
11128
|
disabled ? "border-border opacity-50 cursor-not-allowed" : "border-accent hover:brightness-125 hover:-translate-y-1 cursor-pointer",
|
|
11128
11129
|
selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background -translate-y-1",
|
|
11130
|
+
ANIM_STATE_CLASS[animState],
|
|
11129
11131
|
className
|
|
11130
11132
|
),
|
|
11131
11133
|
children: [
|
|
@@ -11158,7 +11160,7 @@ function GameCard({
|
|
|
11158
11160
|
}
|
|
11159
11161
|
);
|
|
11160
11162
|
}
|
|
11161
|
-
var cardSizeMap, artPxMap;
|
|
11163
|
+
var cardSizeMap, artPxMap, ANIM_STATE_CLASS;
|
|
11162
11164
|
var init_GameCard = __esm({
|
|
11163
11165
|
"components/game/2d/atoms/GameCard.tsx"() {
|
|
11164
11166
|
"use client";
|
|
@@ -11174,6 +11176,12 @@ var init_GameCard = __esm({
|
|
|
11174
11176
|
lg: "w-24 h-36"
|
|
11175
11177
|
};
|
|
11176
11178
|
artPxMap = { sm: 40, md: 52, lg: 64 };
|
|
11179
|
+
ANIM_STATE_CLASS = {
|
|
11180
|
+
idle: "",
|
|
11181
|
+
drawn: "scale-105",
|
|
11182
|
+
played: "-translate-y-2 opacity-80",
|
|
11183
|
+
flipped: "scale-x-0"
|
|
11184
|
+
};
|
|
11177
11185
|
GameCard.displayName = "GameCard";
|
|
11178
11186
|
}
|
|
11179
11187
|
});
|
|
@@ -11386,9 +11394,9 @@ function ControlButton({
|
|
|
11386
11394
|
className
|
|
11387
11395
|
}) {
|
|
11388
11396
|
const eventBus = useEventBus();
|
|
11389
|
-
const [isPressed, setIsPressed] =
|
|
11397
|
+
const [isPressed, setIsPressed] = React104.useState(false);
|
|
11390
11398
|
const actualPressed = pressed ?? isPressed;
|
|
11391
|
-
const handlePointerDown =
|
|
11399
|
+
const handlePointerDown = React104.useCallback(
|
|
11392
11400
|
(e) => {
|
|
11393
11401
|
e.preventDefault();
|
|
11394
11402
|
if (disabled) return;
|
|
@@ -11398,7 +11406,7 @@ function ControlButton({
|
|
|
11398
11406
|
},
|
|
11399
11407
|
[disabled, pressEvent, eventBus, onPress]
|
|
11400
11408
|
);
|
|
11401
|
-
const handlePointerUp =
|
|
11409
|
+
const handlePointerUp = React104.useCallback(
|
|
11402
11410
|
(e) => {
|
|
11403
11411
|
e.preventDefault();
|
|
11404
11412
|
if (disabled) return;
|
|
@@ -11408,7 +11416,7 @@ function ControlButton({
|
|
|
11408
11416
|
},
|
|
11409
11417
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
11410
11418
|
);
|
|
11411
|
-
const handlePointerLeave =
|
|
11419
|
+
const handlePointerLeave = React104.useCallback(
|
|
11412
11420
|
(e) => {
|
|
11413
11421
|
if (isPressed) {
|
|
11414
11422
|
setIsPressed(false);
|
|
@@ -12214,8 +12222,11 @@ function DialogueBubble({
|
|
|
12214
12222
|
text = "The dungeon awaits. Choose your path wisely.",
|
|
12215
12223
|
portrait = DEFAULT_PORTRAIT,
|
|
12216
12224
|
position = "bottom",
|
|
12225
|
+
mood = "neutral",
|
|
12226
|
+
revealedChars,
|
|
12217
12227
|
className
|
|
12218
12228
|
}) {
|
|
12229
|
+
const visibleText = revealedChars === void 0 ? text : text.slice(0, revealedChars);
|
|
12219
12230
|
return /* @__PURE__ */ jsxs(
|
|
12220
12231
|
Box,
|
|
12221
12232
|
{
|
|
@@ -12225,16 +12236,16 @@ function DialogueBubble({
|
|
|
12225
12236
|
className
|
|
12226
12237
|
),
|
|
12227
12238
|
children: [
|
|
12228
|
-
portrait && /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 w-12 h-12 rounded-full overflow-hidden border-2
|
|
12239
|
+
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" }) }),
|
|
12229
12240
|
/* @__PURE__ */ jsxs(Box, { className: "flex flex-col gap-1 min-w-0", children: [
|
|
12230
12241
|
speaker && /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm font-bold text-warning", children: speaker }),
|
|
12231
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm text-foreground leading-relaxed", children:
|
|
12242
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm text-foreground leading-relaxed", children: visibleText })
|
|
12232
12243
|
] })
|
|
12233
12244
|
]
|
|
12234
12245
|
}
|
|
12235
12246
|
);
|
|
12236
12247
|
}
|
|
12237
|
-
var DEFAULT_PORTRAIT;
|
|
12248
|
+
var DEFAULT_PORTRAIT, MOOD_RING_CLASS;
|
|
12238
12249
|
var init_DialogueBubble = __esm({
|
|
12239
12250
|
"components/game/2d/atoms/DialogueBubble.tsx"() {
|
|
12240
12251
|
init_cn();
|
|
@@ -12246,6 +12257,12 @@ var init_DialogueBubble = __esm({
|
|
|
12246
12257
|
role: "effect",
|
|
12247
12258
|
category: "character"
|
|
12248
12259
|
};
|
|
12260
|
+
MOOD_RING_CLASS = {
|
|
12261
|
+
neutral: "border-warning/60",
|
|
12262
|
+
happy: "border-success/70",
|
|
12263
|
+
concerned: "border-info/70",
|
|
12264
|
+
angry: "border-error/70"
|
|
12265
|
+
};
|
|
12249
12266
|
DialogueBubble.displayName = "DialogueBubble";
|
|
12250
12267
|
}
|
|
12251
12268
|
});
|
|
@@ -12427,8 +12444,8 @@ function MiniMap({
|
|
|
12427
12444
|
tileAssets,
|
|
12428
12445
|
unitAssets
|
|
12429
12446
|
}) {
|
|
12430
|
-
const canvasRef =
|
|
12431
|
-
const imgCacheRef =
|
|
12447
|
+
const canvasRef = React104.useRef(null);
|
|
12448
|
+
const imgCacheRef = React104.useRef(/* @__PURE__ */ new Map());
|
|
12432
12449
|
function loadImg(url) {
|
|
12433
12450
|
const cached = imgCacheRef.current.get(url);
|
|
12434
12451
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -12443,7 +12460,7 @@ function MiniMap({
|
|
|
12443
12460
|
imgCacheRef.current.set(url, img);
|
|
12444
12461
|
return null;
|
|
12445
12462
|
}
|
|
12446
|
-
|
|
12463
|
+
React104.useEffect(() => {
|
|
12447
12464
|
const canvas = canvasRef.current;
|
|
12448
12465
|
if (!canvas) return;
|
|
12449
12466
|
const ctx = canvas.getContext("2d");
|
|
@@ -12578,8 +12595,8 @@ function ControlGrid({
|
|
|
12578
12595
|
className
|
|
12579
12596
|
}) {
|
|
12580
12597
|
const eventBus = useEventBus();
|
|
12581
|
-
const [active, setActive] =
|
|
12582
|
-
const handlePress =
|
|
12598
|
+
const [active, setActive] = React104.useState(/* @__PURE__ */ new Set());
|
|
12599
|
+
const handlePress = React104.useCallback(
|
|
12583
12600
|
(id) => {
|
|
12584
12601
|
setActive((prev) => new Set(prev).add(id));
|
|
12585
12602
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -12593,7 +12610,7 @@ function ControlGrid({
|
|
|
12593
12610
|
},
|
|
12594
12611
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
12595
12612
|
);
|
|
12596
|
-
const handleRelease =
|
|
12613
|
+
const handleRelease = React104.useCallback(
|
|
12597
12614
|
(id) => {
|
|
12598
12615
|
setActive((prev) => {
|
|
12599
12616
|
const next = new Set(prev);
|
|
@@ -12851,7 +12868,7 @@ function InventoryGrid({
|
|
|
12851
12868
|
const eventBus = useEventBus();
|
|
12852
12869
|
const slotCount = totalSlots ?? items.length;
|
|
12853
12870
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
12854
|
-
const handleSelect =
|
|
12871
|
+
const handleSelect = React104.useCallback(
|
|
12855
12872
|
(id) => {
|
|
12856
12873
|
onSelect?.(id);
|
|
12857
12874
|
if (selectEvent) {
|
|
@@ -13068,7 +13085,7 @@ function GameMenu({
|
|
|
13068
13085
|
}) {
|
|
13069
13086
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
13070
13087
|
const eventBus = useEventBus();
|
|
13071
|
-
const handleOptionClick =
|
|
13088
|
+
const handleOptionClick = React104.useCallback(
|
|
13072
13089
|
(option) => {
|
|
13073
13090
|
if (option.event) {
|
|
13074
13091
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -13191,7 +13208,7 @@ function StateNode({
|
|
|
13191
13208
|
);
|
|
13192
13209
|
}
|
|
13193
13210
|
var init_StateNode = __esm({
|
|
13194
|
-
"components/game/2d/
|
|
13211
|
+
"components/game/2d/molecules/StateNode.tsx"() {
|
|
13195
13212
|
init_atoms();
|
|
13196
13213
|
init_cn();
|
|
13197
13214
|
StateNode.displayName = "StateNode";
|
|
@@ -13263,7 +13280,7 @@ function TransitionArrow({
|
|
|
13263
13280
|
}
|
|
13264
13281
|
var NODE_RADIUS;
|
|
13265
13282
|
var init_TransitionArrow = __esm({
|
|
13266
|
-
"components/game/2d/
|
|
13283
|
+
"components/game/2d/molecules/TransitionArrow.tsx"() {
|
|
13267
13284
|
init_cn();
|
|
13268
13285
|
NODE_RADIUS = 40;
|
|
13269
13286
|
TransitionArrow.displayName = "TransitionArrow";
|
|
@@ -13294,7 +13311,7 @@ function StateGraph({
|
|
|
13294
13311
|
}) {
|
|
13295
13312
|
const eventBus = useEventBus();
|
|
13296
13313
|
const nodes = states ?? [];
|
|
13297
|
-
const positions =
|
|
13314
|
+
const positions = React104.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
13298
13315
|
return /* @__PURE__ */ jsxs(
|
|
13299
13316
|
Box,
|
|
13300
13317
|
{
|
|
@@ -14060,6 +14077,7 @@ function Canvas2D({
|
|
|
14060
14077
|
unitScale = 1,
|
|
14061
14078
|
showMinimap = true,
|
|
14062
14079
|
animate,
|
|
14080
|
+
interpolateUnits = false,
|
|
14063
14081
|
// Tuning
|
|
14064
14082
|
debug: debug2 = false,
|
|
14065
14083
|
spriteHeightRatio = 1.5,
|
|
@@ -14094,6 +14112,8 @@ function Canvas2D({
|
|
|
14094
14112
|
const containerRef = useRef(null);
|
|
14095
14113
|
const lerpRafRef = useRef(0);
|
|
14096
14114
|
const animRafRef = useRef(0);
|
|
14115
|
+
const unitInterp = useRenderInterpolation();
|
|
14116
|
+
const interpolatedUnitPositionsRef = useRef(/* @__PURE__ */ new Map());
|
|
14097
14117
|
const [viewportSize, setViewportSize] = useState({ width: 800, height: 600 });
|
|
14098
14118
|
useEffect(() => {
|
|
14099
14119
|
const el = containerRef.current;
|
|
@@ -14408,7 +14428,8 @@ function Canvas2D({
|
|
|
14408
14428
|
return depthA !== depthB ? depthA - depthB : a.position.y - b.position.y;
|
|
14409
14429
|
});
|
|
14410
14430
|
for (const unit of sortedUnits) {
|
|
14411
|
-
const
|
|
14431
|
+
const interpolated = interpolateUnits ? interpolatedUnitPositionsRef.current.get(unit.id) : void 0;
|
|
14432
|
+
const pos = project(interpolated?.x ?? unit.position.x, interpolated?.y ?? unit.position.y, baseOffsetX);
|
|
14412
14433
|
if (pos.x + scaledTileWidth < visLeft || pos.x > visRight || pos.y + scaledTileHeight < visTop || pos.y > visBottom) {
|
|
14413
14434
|
continue;
|
|
14414
14435
|
}
|
|
@@ -14560,7 +14581,8 @@ function Canvas2D({
|
|
|
14560
14581
|
unitScale,
|
|
14561
14582
|
assetManifest,
|
|
14562
14583
|
spriteHeightRatio,
|
|
14563
|
-
spriteMaxWidthRatio
|
|
14584
|
+
spriteMaxWidthRatio,
|
|
14585
|
+
interpolateUnits
|
|
14564
14586
|
]);
|
|
14565
14587
|
useEffect(() => {
|
|
14566
14588
|
if (camera === "fixed") return;
|
|
@@ -14575,6 +14597,19 @@ function Canvas2D({
|
|
|
14575
14597
|
y: centerY - viewportSize.height / 2
|
|
14576
14598
|
};
|
|
14577
14599
|
}, [camera, selectedUnitId, units, project, baseOffsetX, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, targetCameraRef]);
|
|
14600
|
+
useEffect(() => {
|
|
14601
|
+
if (isSide || !interpolateUnits) return;
|
|
14602
|
+
unitInterp.onSnapshot(
|
|
14603
|
+
units.filter((u) => !!u.position).map((u) => ({ id: u.id, x: u.position.x, y: u.position.y }))
|
|
14604
|
+
);
|
|
14605
|
+
}, [isSide, interpolateUnits, units, unitInterp]);
|
|
14606
|
+
useEffect(() => {
|
|
14607
|
+
if (isSide || !interpolateUnits) return;
|
|
14608
|
+
return unitInterp.startLoop((positions) => {
|
|
14609
|
+
interpolatedUnitPositionsRef.current = positions;
|
|
14610
|
+
draw();
|
|
14611
|
+
});
|
|
14612
|
+
}, [isSide, interpolateUnits, unitInterp, draw]);
|
|
14578
14613
|
useEffect(() => {
|
|
14579
14614
|
if (isSide) return;
|
|
14580
14615
|
draw();
|
|
@@ -14950,7 +14985,7 @@ function LinearView({
|
|
|
14950
14985
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
14951
14986
|
const isDone = i < currentIdx;
|
|
14952
14987
|
const isCurrent = i === currentIdx;
|
|
14953
|
-
return /* @__PURE__ */ jsxs(
|
|
14988
|
+
return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
|
|
14954
14989
|
i > 0 && /* @__PURE__ */ jsx(
|
|
14955
14990
|
Typography,
|
|
14956
14991
|
{
|
|
@@ -15147,7 +15182,7 @@ function TraitStateViewer({
|
|
|
15147
15182
|
}
|
|
15148
15183
|
var SIZE_CONFIG;
|
|
15149
15184
|
var init_TraitStateViewer = __esm({
|
|
15150
|
-
"components/game/2d/
|
|
15185
|
+
"components/game/2d/molecules/TraitStateViewer.tsx"() {
|
|
15151
15186
|
"use client";
|
|
15152
15187
|
init_cn();
|
|
15153
15188
|
init_Box();
|
|
@@ -15180,7 +15215,8 @@ function TraitSlot({
|
|
|
15180
15215
|
onClick,
|
|
15181
15216
|
onRemove,
|
|
15182
15217
|
clickEvent,
|
|
15183
|
-
removeEvent
|
|
15218
|
+
removeEvent,
|
|
15219
|
+
dropEvent
|
|
15184
15220
|
}) {
|
|
15185
15221
|
const { emit } = useEventBus();
|
|
15186
15222
|
const [isHovered, setIsHovered] = useState(false);
|
|
@@ -15212,29 +15248,30 @@ function TraitSlot({
|
|
|
15212
15248
|
onDragStart?.(equippedItem);
|
|
15213
15249
|
}, [equippedItem, draggable, onDragStart]);
|
|
15214
15250
|
const handleDragOver = useCallback((e) => {
|
|
15215
|
-
if (locked || !onItemDrop) return;
|
|
15251
|
+
if (locked || !onItemDrop && !dropEvent) return;
|
|
15216
15252
|
if (e.dataTransfer.types.includes(DRAG_MIME)) {
|
|
15217
15253
|
e.preventDefault();
|
|
15218
15254
|
const allowed = e.dataTransfer.effectAllowed;
|
|
15219
15255
|
e.dataTransfer.dropEffect = allowed === "copy" ? "copy" : "move";
|
|
15220
15256
|
setIsDragOver(true);
|
|
15221
15257
|
}
|
|
15222
|
-
}, [locked, onItemDrop]);
|
|
15258
|
+
}, [locked, onItemDrop, dropEvent]);
|
|
15223
15259
|
const handleDragLeave = useCallback(() => {
|
|
15224
15260
|
setIsDragOver(false);
|
|
15225
15261
|
}, []);
|
|
15226
15262
|
const handleDrop = useCallback((e) => {
|
|
15227
15263
|
e.preventDefault();
|
|
15228
15264
|
setIsDragOver(false);
|
|
15229
|
-
if (locked || !onItemDrop) return;
|
|
15265
|
+
if (locked || !onItemDrop && !dropEvent) return;
|
|
15230
15266
|
const raw = e.dataTransfer.getData(DRAG_MIME);
|
|
15231
15267
|
if (!raw) return;
|
|
15232
15268
|
try {
|
|
15233
15269
|
const item = JSON.parse(raw);
|
|
15234
|
-
|
|
15270
|
+
if (dropEvent) emit(`UI:${dropEvent}`, { slotNumber, itemId: item.id });
|
|
15271
|
+
else onItemDrop?.(item);
|
|
15235
15272
|
} catch {
|
|
15236
15273
|
}
|
|
15237
|
-
}, [locked, onItemDrop]);
|
|
15274
|
+
}, [locked, onItemDrop, dropEvent, emit, slotNumber]);
|
|
15238
15275
|
const getTooltipStyle = () => {
|
|
15239
15276
|
if (!slotRef.current) return {};
|
|
15240
15277
|
const rect = slotRef.current.getBoundingClientRect();
|
|
@@ -15354,7 +15391,7 @@ function TraitSlot({
|
|
|
15354
15391
|
}
|
|
15355
15392
|
var SIZE_CONFIG2, DRAG_MIME;
|
|
15356
15393
|
var init_TraitSlot = __esm({
|
|
15357
|
-
"components/game/2d/
|
|
15394
|
+
"components/game/2d/molecules/TraitSlot.tsx"() {
|
|
15358
15395
|
"use client";
|
|
15359
15396
|
init_cn();
|
|
15360
15397
|
init_useEventBus();
|
|
@@ -15413,7 +15450,7 @@ function ActionTile({
|
|
|
15413
15450
|
}
|
|
15414
15451
|
var DRAG_MIME2, SIZE_CONFIG3;
|
|
15415
15452
|
var init_ActionTile = __esm({
|
|
15416
|
-
"components/game/2d/
|
|
15453
|
+
"components/game/2d/molecules/ActionTile.tsx"() {
|
|
15417
15454
|
init_atoms();
|
|
15418
15455
|
init_cn();
|
|
15419
15456
|
DRAG_MIME2 = "application/x-almadar-slot-item";
|
|
@@ -15450,7 +15487,7 @@ function ActionPalette({
|
|
|
15450
15487
|
] });
|
|
15451
15488
|
}
|
|
15452
15489
|
var init_ActionPalette = __esm({
|
|
15453
|
-
"components/game/2d/
|
|
15490
|
+
"components/game/2d/molecules/ActionPalette.tsx"() {
|
|
15454
15491
|
init_atoms();
|
|
15455
15492
|
init_cn();
|
|
15456
15493
|
init_ActionTile();
|
|
@@ -15462,6 +15499,8 @@ function SequenceBar({
|
|
|
15462
15499
|
maxSlots,
|
|
15463
15500
|
onSlotDrop,
|
|
15464
15501
|
onSlotRemove,
|
|
15502
|
+
slotDropEvent,
|
|
15503
|
+
slotRemoveEvent,
|
|
15465
15504
|
playing = false,
|
|
15466
15505
|
currentStep = -1,
|
|
15467
15506
|
categoryColors,
|
|
@@ -15469,16 +15508,19 @@ function SequenceBar({
|
|
|
15469
15508
|
size = "lg",
|
|
15470
15509
|
className
|
|
15471
15510
|
}) {
|
|
15511
|
+
const { emit } = useEventBus();
|
|
15472
15512
|
const handleDrop = useCallback((index) => (item) => {
|
|
15473
15513
|
if (playing) return;
|
|
15474
|
-
|
|
15475
|
-
|
|
15514
|
+
if (slotDropEvent) emit(`UI:${slotDropEvent}`, { slotNumber: index, itemId: item.id });
|
|
15515
|
+
else onSlotDrop?.(index, item);
|
|
15516
|
+
}, [emit, slotDropEvent, onSlotDrop, playing]);
|
|
15476
15517
|
const handleRemove = useCallback((index) => () => {
|
|
15477
15518
|
if (playing) return;
|
|
15478
|
-
|
|
15479
|
-
|
|
15519
|
+
if (slotRemoveEvent) emit(`UI:${slotRemoveEvent}`, { slotNumber: index });
|
|
15520
|
+
else onSlotRemove?.(index);
|
|
15521
|
+
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
15480
15522
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
15481
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
15523
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
|
|
15482
15524
|
i > 0 && /* @__PURE__ */ jsx(
|
|
15483
15525
|
Typography,
|
|
15484
15526
|
{
|
|
@@ -15508,9 +15550,10 @@ function SequenceBar({
|
|
|
15508
15550
|
] }, i)) });
|
|
15509
15551
|
}
|
|
15510
15552
|
var init_SequenceBar = __esm({
|
|
15511
|
-
"components/game/2d/
|
|
15553
|
+
"components/game/2d/molecules/SequenceBar.tsx"() {
|
|
15512
15554
|
init_atoms();
|
|
15513
15555
|
init_cn();
|
|
15556
|
+
init_useEventBus();
|
|
15514
15557
|
init_TraitSlot();
|
|
15515
15558
|
SequenceBar.displayName = "SequenceBar";
|
|
15516
15559
|
}
|
|
@@ -15826,7 +15869,7 @@ function RuleEditor({
|
|
|
15826
15869
|
] });
|
|
15827
15870
|
}
|
|
15828
15871
|
var init_RuleEditor = __esm({
|
|
15829
|
-
"components/game/2d/
|
|
15872
|
+
"components/game/2d/molecules/RuleEditor.tsx"() {
|
|
15830
15873
|
init_atoms();
|
|
15831
15874
|
init_cn();
|
|
15832
15875
|
RuleEditor.displayName = "RuleEditor";
|
|
@@ -15867,7 +15910,7 @@ function EventLog({
|
|
|
15867
15910
|
}
|
|
15868
15911
|
var STATUS_STYLES, STATUS_DOTS;
|
|
15869
15912
|
var init_EventLog = __esm({
|
|
15870
|
-
"components/game/2d/
|
|
15913
|
+
"components/game/2d/molecules/EventLog.tsx"() {
|
|
15871
15914
|
init_atoms();
|
|
15872
15915
|
init_cn();
|
|
15873
15916
|
STATUS_STYLES = {
|
|
@@ -15922,10 +15965,12 @@ var init_puzzleObject = __esm({
|
|
|
15922
15965
|
function ObjectRulePanel({
|
|
15923
15966
|
object,
|
|
15924
15967
|
onRulesChange,
|
|
15968
|
+
rulesChangeEvent,
|
|
15925
15969
|
disabled = false,
|
|
15926
15970
|
className
|
|
15927
15971
|
}) {
|
|
15928
15972
|
const { t } = useTranslate();
|
|
15973
|
+
const { emit } = useEventBus();
|
|
15929
15974
|
const id = objId(object);
|
|
15930
15975
|
const name = objName(object);
|
|
15931
15976
|
const icon = objIcon(object);
|
|
@@ -15936,15 +15981,19 @@ function ObjectRulePanel({
|
|
|
15936
15981
|
const rules = objRules(object);
|
|
15937
15982
|
const maxRules = objMaxRules(object);
|
|
15938
15983
|
const canAdd = rules.length < maxRules;
|
|
15984
|
+
const emitRules = useCallback((newRules) => {
|
|
15985
|
+
if (rulesChangeEvent) emit(`UI:${rulesChangeEvent}`, { objectId: id, rules: newRules });
|
|
15986
|
+
else onRulesChange?.(id, newRules);
|
|
15987
|
+
}, [rulesChangeEvent, emit, id, onRulesChange]);
|
|
15939
15988
|
const handleRuleChange = useCallback((index, updatedRule) => {
|
|
15940
15989
|
const newRules = [...rules];
|
|
15941
15990
|
newRules[index] = updatedRule;
|
|
15942
|
-
|
|
15943
|
-
}, [
|
|
15991
|
+
emitRules(newRules);
|
|
15992
|
+
}, [rules, emitRules]);
|
|
15944
15993
|
const handleRuleRemove = useCallback((index) => {
|
|
15945
15994
|
const newRules = rules.filter((_, i) => i !== index);
|
|
15946
|
-
|
|
15947
|
-
}, [
|
|
15995
|
+
emitRules(newRules);
|
|
15996
|
+
}, [rules, emitRules]);
|
|
15948
15997
|
const handleAddRule = useCallback(() => {
|
|
15949
15998
|
if (!canAdd || disabled) return;
|
|
15950
15999
|
const firstEvent = availableEvents[0]?.value || "";
|
|
@@ -15954,8 +16003,8 @@ function ObjectRulePanel({
|
|
|
15954
16003
|
whenEvent: firstEvent,
|
|
15955
16004
|
thenAction: firstAction
|
|
15956
16005
|
};
|
|
15957
|
-
|
|
15958
|
-
}, [canAdd, disabled,
|
|
16006
|
+
emitRules([...rules, newRule]);
|
|
16007
|
+
}, [canAdd, disabled, rules, availableEvents, availableActions, emitRules]);
|
|
15959
16008
|
const machine = {
|
|
15960
16009
|
name,
|
|
15961
16010
|
states,
|
|
@@ -15995,9 +16044,10 @@ function ObjectRulePanel({
|
|
|
15995
16044
|
}
|
|
15996
16045
|
var nextRuleId;
|
|
15997
16046
|
var init_ObjectRulePanel = __esm({
|
|
15998
|
-
"components/game/2d/
|
|
16047
|
+
"components/game/2d/molecules/ObjectRulePanel.tsx"() {
|
|
15999
16048
|
init_atoms();
|
|
16000
16049
|
init_cn();
|
|
16050
|
+
init_useEventBus();
|
|
16001
16051
|
init_TraitStateViewer();
|
|
16002
16052
|
init_RuleEditor();
|
|
16003
16053
|
init_puzzleObject();
|
|
@@ -16227,61 +16277,35 @@ function VariablePanel({
|
|
|
16227
16277
|
const { t } = useTranslate();
|
|
16228
16278
|
return /* @__PURE__ */ jsxs(VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
|
|
16229
16279
|
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("stateArchitect.variables", { name: entityName }) }),
|
|
16230
|
-
variables.map((v) => {
|
|
16231
|
-
|
|
16232
|
-
|
|
16233
|
-
|
|
16234
|
-
const min = numField(v.min, 0);
|
|
16235
|
-
const unit = v.unit == null ? "" : String(v.unit);
|
|
16236
|
-
const pct = Math.round((value - min) / (max - min) * 100);
|
|
16237
|
-
const isHigh = pct > 80;
|
|
16238
|
-
const isLow = pct < 20;
|
|
16239
|
-
return /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
|
|
16240
|
-
/* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
|
|
16241
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: name }),
|
|
16242
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "caption", className: cn(
|
|
16243
|
-
isHigh ? "text-error" : isLow ? "text-warning" : "text-foreground"
|
|
16244
|
-
), children: [
|
|
16245
|
-
value,
|
|
16246
|
-
unit,
|
|
16247
|
-
" / ",
|
|
16248
|
-
max,
|
|
16249
|
-
unit
|
|
16250
|
-
] })
|
|
16251
|
-
] }),
|
|
16252
|
-
/* @__PURE__ */ jsx(
|
|
16253
|
-
ProgressBar,
|
|
16254
|
-
{
|
|
16255
|
-
value: pct,
|
|
16256
|
-
color: isHigh ? "danger" : isLow ? "warning" : "primary",
|
|
16257
|
-
size: "sm"
|
|
16258
|
-
}
|
|
16259
|
-
)
|
|
16260
|
-
] }, name);
|
|
16261
|
-
})
|
|
16280
|
+
(variables ?? []).map((v) => /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
|
|
16281
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: v.name }),
|
|
16282
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-accent font-mono", children: v.value })
|
|
16283
|
+
] }, v.name))
|
|
16262
16284
|
] });
|
|
16263
16285
|
}
|
|
16264
|
-
var numField;
|
|
16265
16286
|
var init_VariablePanel = __esm({
|
|
16266
|
-
"components/game/2d/
|
|
16287
|
+
"components/game/2d/molecules/VariablePanel.tsx"() {
|
|
16267
16288
|
init_atoms();
|
|
16268
16289
|
init_cn();
|
|
16269
|
-
numField = (v, fallback = 0) => {
|
|
16270
|
-
const n = Number(v);
|
|
16271
|
-
return Number.isFinite(n) ? n : fallback;
|
|
16272
|
-
};
|
|
16273
16290
|
VariablePanel.displayName = "VariablePanel";
|
|
16274
16291
|
}
|
|
16275
16292
|
});
|
|
16276
16293
|
function StateJsonView({
|
|
16277
|
-
|
|
16294
|
+
name,
|
|
16295
|
+
initialState,
|
|
16296
|
+
states,
|
|
16297
|
+
transitions,
|
|
16278
16298
|
label,
|
|
16279
16299
|
defaultExpanded = false,
|
|
16280
16300
|
className
|
|
16281
16301
|
}) {
|
|
16282
16302
|
const { t } = useTranslate();
|
|
16283
16303
|
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
16284
|
-
const jsonString = JSON.stringify(
|
|
16304
|
+
const jsonString = JSON.stringify(
|
|
16305
|
+
{ name, initialState, states: states ?? [], transitions: transitions ?? [] },
|
|
16306
|
+
null,
|
|
16307
|
+
2
|
|
16308
|
+
);
|
|
16285
16309
|
return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
|
|
16286
16310
|
/* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
|
|
16287
16311
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
|
|
@@ -16298,7 +16322,7 @@ function StateJsonView({
|
|
|
16298
16322
|
] });
|
|
16299
16323
|
}
|
|
16300
16324
|
var init_StateJsonView = __esm({
|
|
16301
|
-
"components/game/2d/
|
|
16325
|
+
"components/game/2d/molecules/StateJsonView.tsx"() {
|
|
16302
16326
|
init_atoms();
|
|
16303
16327
|
init_cn();
|
|
16304
16328
|
StateJsonView.displayName = "StateJsonView";
|
|
@@ -16467,7 +16491,7 @@ function StateArchitectBoard({
|
|
|
16467
16491
|
setAddingFrom(null);
|
|
16468
16492
|
if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
|
|
16469
16493
|
}, [initialState, entityVariables, playAgainEvent, emit]);
|
|
16470
|
-
|
|
16494
|
+
useMemo(() => ({
|
|
16471
16495
|
name: entityName,
|
|
16472
16496
|
states: entityStates,
|
|
16473
16497
|
initialState,
|
|
@@ -16602,7 +16626,7 @@ function StateArchitectBoard({
|
|
|
16602
16626
|
VariablePanel,
|
|
16603
16627
|
{
|
|
16604
16628
|
entityName,
|
|
16605
|
-
variables
|
|
16629
|
+
variables: variables.map((v) => ({ name: String(v.name ?? ""), value: String(v.value ?? "") }))
|
|
16606
16630
|
}
|
|
16607
16631
|
),
|
|
16608
16632
|
testResults.length > 0 && /* @__PURE__ */ jsxs(VStack, { className: "p-3 rounded-container bg-card border border-border", gap: "xs", children: [
|
|
@@ -16613,7 +16637,16 @@ function StateArchitectBoard({
|
|
|
16613
16637
|
!r2.passed && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error", children: t("stateArchitect.gotState", { state: r2.actualState }) })
|
|
16614
16638
|
] }, i))
|
|
16615
16639
|
] }),
|
|
16616
|
-
resolved.showCodeView !== false && /* @__PURE__ */ jsx(
|
|
16640
|
+
resolved.showCodeView !== false && /* @__PURE__ */ jsx(
|
|
16641
|
+
StateJsonView,
|
|
16642
|
+
{
|
|
16643
|
+
name: entityName,
|
|
16644
|
+
initialState,
|
|
16645
|
+
states: entityStates,
|
|
16646
|
+
transitions: transitions.map((tr) => ({ from: tr.from, to: tr.to, event: tr.event })),
|
|
16647
|
+
label: "View Code"
|
|
16648
|
+
}
|
|
16649
|
+
)
|
|
16617
16650
|
] })
|
|
16618
16651
|
] }),
|
|
16619
16652
|
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") }) }),
|
|
@@ -17525,227 +17558,6 @@ var init_NegotiatorBoard = __esm({
|
|
|
17525
17558
|
NegotiatorBoard.displayName = "NegotiatorBoard";
|
|
17526
17559
|
}
|
|
17527
17560
|
});
|
|
17528
|
-
|
|
17529
|
-
// components/game/shared/lib/mechanics.ts
|
|
17530
|
-
var projectileMotion, pendulum, springOscillator;
|
|
17531
|
-
var init_mechanics = __esm({
|
|
17532
|
-
"components/game/shared/lib/mechanics.ts"() {
|
|
17533
|
-
projectileMotion = {
|
|
17534
|
-
id: "mechanics-projectile",
|
|
17535
|
-
name: "Projectile Motion",
|
|
17536
|
-
description: "Launch a ball and observe parabolic trajectory under gravity.",
|
|
17537
|
-
domain: "natural",
|
|
17538
|
-
gravity: { x: 0, y: 9.81 },
|
|
17539
|
-
bodies: [
|
|
17540
|
-
{ id: "ball", x: 50, y: 350, vx: 80, vy: -120, mass: 1, radius: 10, color: "#e94560", fixed: false },
|
|
17541
|
-
{ id: "ground", x: 300, y: 390, vx: 0, vy: 0, mass: 1e3, radius: 400, color: "#333", fixed: true }
|
|
17542
|
-
],
|
|
17543
|
-
showVelocity: true,
|
|
17544
|
-
parameters: {
|
|
17545
|
-
angle: { value: 45, min: 0, max: 90, step: 1, label: "Launch angle (deg)" },
|
|
17546
|
-
velocity: { value: 100, min: 10, max: 200, step: 5, label: "Initial velocity (m/s)" },
|
|
17547
|
-
gravity: { value: 9.81, min: 0, max: 20, step: 0.1, label: "Gravity (m/s\xB2)" }
|
|
17548
|
-
}
|
|
17549
|
-
};
|
|
17550
|
-
pendulum = {
|
|
17551
|
-
id: "mechanics-pendulum",
|
|
17552
|
-
name: "Simple Pendulum",
|
|
17553
|
-
description: "A mass on a string swinging under gravity.",
|
|
17554
|
-
domain: "natural",
|
|
17555
|
-
gravity: { x: 0, y: 9.81 },
|
|
17556
|
-
bodies: [
|
|
17557
|
-
{ id: "pivot", x: 300, y: 50, vx: 0, vy: 0, mass: 1e3, radius: 5, color: "#888", fixed: true },
|
|
17558
|
-
{ id: "bob", x: 400, y: 200, vx: 0, vy: 0, mass: 5, radius: 15, color: "#e94560", fixed: false }
|
|
17559
|
-
],
|
|
17560
|
-
constraints: [{ bodyA: 0, bodyB: 1, length: 180, stiffness: 1 }],
|
|
17561
|
-
parameters: {
|
|
17562
|
-
length: { value: 180, min: 50, max: 300, step: 10, label: "String length (px)" },
|
|
17563
|
-
mass: { value: 5, min: 1, max: 20, step: 0.5, label: "Mass (kg)" },
|
|
17564
|
-
gravity: { value: 9.81, min: 0, max: 20, step: 0.1, label: "Gravity (m/s\xB2)" }
|
|
17565
|
-
}
|
|
17566
|
-
};
|
|
17567
|
-
springOscillator = {
|
|
17568
|
-
id: "mechanics-spring",
|
|
17569
|
-
name: "Spring Oscillator",
|
|
17570
|
-
description: "A mass bouncing on a spring \u2014 simple harmonic motion.",
|
|
17571
|
-
domain: "natural",
|
|
17572
|
-
gravity: { x: 0, y: 0 },
|
|
17573
|
-
bodies: [
|
|
17574
|
-
{ id: "anchor", x: 300, y: 50, vx: 0, vy: 0, mass: 1e3, radius: 8, color: "#888", fixed: true },
|
|
17575
|
-
{ id: "mass", x: 300, y: 250, vx: 0, vy: 0, mass: 2, radius: 20, color: "#0f3460", fixed: false }
|
|
17576
|
-
],
|
|
17577
|
-
constraints: [{ bodyA: 0, bodyB: 1, length: 150, stiffness: 0.5 }],
|
|
17578
|
-
parameters: {
|
|
17579
|
-
stiffness: { value: 0.5, min: 0.1, max: 2, step: 0.05, label: "Spring stiffness (k)" },
|
|
17580
|
-
mass: { value: 2, min: 0.5, max: 10, step: 0.5, label: "Mass (kg)" },
|
|
17581
|
-
damping: { value: 0, min: 0, max: 0.5, step: 0.01, label: "Damping" }
|
|
17582
|
-
}
|
|
17583
|
-
};
|
|
17584
|
-
}
|
|
17585
|
-
});
|
|
17586
|
-
|
|
17587
|
-
// components/game/shared/lib/physicsPresets.ts
|
|
17588
|
-
var init_physicsPresets = __esm({
|
|
17589
|
-
"components/game/shared/lib/physicsPresets.ts"() {
|
|
17590
|
-
init_mechanics();
|
|
17591
|
-
}
|
|
17592
|
-
});
|
|
17593
|
-
function resolvePreset(preset) {
|
|
17594
|
-
if (typeof preset !== "string") return preset;
|
|
17595
|
-
return PRESET_BY_ID[preset] ?? projectileMotion;
|
|
17596
|
-
}
|
|
17597
|
-
function SimulationCanvas({
|
|
17598
|
-
preset: presetProp,
|
|
17599
|
-
width = 600,
|
|
17600
|
-
height = 400,
|
|
17601
|
-
bodies: externalBodies,
|
|
17602
|
-
className
|
|
17603
|
-
}) {
|
|
17604
|
-
const preset = useMemo(() => resolvePreset(presetProp), [presetProp]);
|
|
17605
|
-
const canvasRef = useRef(null);
|
|
17606
|
-
const bodiesRef = useRef(structuredClone(preset.bodies));
|
|
17607
|
-
const interp = useRenderInterpolation();
|
|
17608
|
-
useEffect(() => {
|
|
17609
|
-
bodiesRef.current = structuredClone(preset.bodies);
|
|
17610
|
-
}, [preset]);
|
|
17611
|
-
const draw = useCallback(() => {
|
|
17612
|
-
const canvas = canvasRef.current;
|
|
17613
|
-
if (!canvas) return;
|
|
17614
|
-
const ctx = canvas.getContext("2d");
|
|
17615
|
-
if (!ctx) return;
|
|
17616
|
-
const bodies = bodiesRef.current;
|
|
17617
|
-
ctx.clearRect(0, 0, width, height);
|
|
17618
|
-
ctx.fillStyle = preset.backgroundColor ?? "#1a1a2e";
|
|
17619
|
-
ctx.fillRect(0, 0, width, height);
|
|
17620
|
-
if (preset.constraints) {
|
|
17621
|
-
for (const c of preset.constraints) {
|
|
17622
|
-
const a = bodies[c.bodyA];
|
|
17623
|
-
const b = bodies[c.bodyB];
|
|
17624
|
-
if (a && b) {
|
|
17625
|
-
ctx.beginPath();
|
|
17626
|
-
ctx.moveTo(a.x, a.y);
|
|
17627
|
-
ctx.lineTo(b.x, b.y);
|
|
17628
|
-
ctx.strokeStyle = "#533483";
|
|
17629
|
-
ctx.lineWidth = 1;
|
|
17630
|
-
ctx.setLineDash([4, 4]);
|
|
17631
|
-
ctx.stroke();
|
|
17632
|
-
ctx.setLineDash([]);
|
|
17633
|
-
}
|
|
17634
|
-
}
|
|
17635
|
-
}
|
|
17636
|
-
for (const body of bodies) {
|
|
17637
|
-
ctx.beginPath();
|
|
17638
|
-
ctx.arc(body.x, body.y, body.radius, 0, Math.PI * 2);
|
|
17639
|
-
ctx.fillStyle = body.color ?? "#e94560";
|
|
17640
|
-
ctx.fill();
|
|
17641
|
-
if (preset.showVelocity) {
|
|
17642
|
-
ctx.beginPath();
|
|
17643
|
-
ctx.moveTo(body.x, body.y);
|
|
17644
|
-
ctx.lineTo(body.x + body.vx * 0.1, body.y + body.vy * 0.1);
|
|
17645
|
-
ctx.strokeStyle = "#16213e";
|
|
17646
|
-
ctx.lineWidth = 2;
|
|
17647
|
-
ctx.stroke();
|
|
17648
|
-
}
|
|
17649
|
-
}
|
|
17650
|
-
}, [width, height, preset]);
|
|
17651
|
-
useEffect(() => {
|
|
17652
|
-
if (!externalBodies) return;
|
|
17653
|
-
interp.onSnapshot(externalBodies.map((b) => ({ id: b.id, x: b.x, y: b.y })));
|
|
17654
|
-
}, [externalBodies]);
|
|
17655
|
-
const presetRef = useRef(preset);
|
|
17656
|
-
presetRef.current = preset;
|
|
17657
|
-
const widthRef = useRef(width);
|
|
17658
|
-
widthRef.current = width;
|
|
17659
|
-
const heightRef = useRef(height);
|
|
17660
|
-
heightRef.current = height;
|
|
17661
|
-
useEffect(() => {
|
|
17662
|
-
if (!externalBodies) return;
|
|
17663
|
-
const drawInterpolated = (positions) => {
|
|
17664
|
-
const canvas = canvasRef.current;
|
|
17665
|
-
if (!canvas) return;
|
|
17666
|
-
const ctx = canvas.getContext("2d");
|
|
17667
|
-
if (!ctx) return;
|
|
17668
|
-
const bodies = bodiesRef.current;
|
|
17669
|
-
const p = presetRef.current;
|
|
17670
|
-
const w = widthRef.current;
|
|
17671
|
-
const h = heightRef.current;
|
|
17672
|
-
ctx.clearRect(0, 0, w, h);
|
|
17673
|
-
ctx.fillStyle = p.backgroundColor ?? "#1a1a2e";
|
|
17674
|
-
ctx.fillRect(0, 0, w, h);
|
|
17675
|
-
if (p.constraints) {
|
|
17676
|
-
for (const c of p.constraints) {
|
|
17677
|
-
const a = bodies[c.bodyA];
|
|
17678
|
-
const b = bodies[c.bodyB];
|
|
17679
|
-
if (a && b) {
|
|
17680
|
-
const aPos = positions.get(a.id) ?? a;
|
|
17681
|
-
const bPos = positions.get(b.id) ?? b;
|
|
17682
|
-
ctx.beginPath();
|
|
17683
|
-
ctx.moveTo(aPos.x, aPos.y);
|
|
17684
|
-
ctx.lineTo(bPos.x, bPos.y);
|
|
17685
|
-
ctx.strokeStyle = "#533483";
|
|
17686
|
-
ctx.lineWidth = 1;
|
|
17687
|
-
ctx.setLineDash([4, 4]);
|
|
17688
|
-
ctx.stroke();
|
|
17689
|
-
ctx.setLineDash([]);
|
|
17690
|
-
}
|
|
17691
|
-
}
|
|
17692
|
-
}
|
|
17693
|
-
for (const body of bodies) {
|
|
17694
|
-
const pos = positions.get(body.id) ?? body;
|
|
17695
|
-
ctx.beginPath();
|
|
17696
|
-
ctx.arc(pos.x, pos.y, body.radius, 0, Math.PI * 2);
|
|
17697
|
-
ctx.fillStyle = body.color ?? "#e94560";
|
|
17698
|
-
ctx.fill();
|
|
17699
|
-
if (p.showVelocity) {
|
|
17700
|
-
ctx.beginPath();
|
|
17701
|
-
ctx.moveTo(pos.x, pos.y);
|
|
17702
|
-
ctx.lineTo(pos.x + body.vx * 0.1, pos.y + body.vy * 0.1);
|
|
17703
|
-
ctx.strokeStyle = "#16213e";
|
|
17704
|
-
ctx.lineWidth = 2;
|
|
17705
|
-
ctx.stroke();
|
|
17706
|
-
}
|
|
17707
|
-
}
|
|
17708
|
-
};
|
|
17709
|
-
return interp.startLoop(drawInterpolated);
|
|
17710
|
-
}, [externalBodies !== void 0, interp.startLoop]);
|
|
17711
|
-
useEffect(() => {
|
|
17712
|
-
draw();
|
|
17713
|
-
}, [draw]);
|
|
17714
|
-
useEffect(() => {
|
|
17715
|
-
if (typeof window === "undefined") return;
|
|
17716
|
-
const canvas = canvasRef.current;
|
|
17717
|
-
if (!canvas) return;
|
|
17718
|
-
bindCanvasCapture(() => canvas.toDataURL("image/png"));
|
|
17719
|
-
return () => {
|
|
17720
|
-
bindCanvasCapture(() => null);
|
|
17721
|
-
};
|
|
17722
|
-
}, []);
|
|
17723
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("flex justify-center", className), children: /* @__PURE__ */ jsx(
|
|
17724
|
-
"canvas",
|
|
17725
|
-
{
|
|
17726
|
-
ref: canvasRef,
|
|
17727
|
-
width,
|
|
17728
|
-
height,
|
|
17729
|
-
className: "rounded-container block max-w-full h-auto"
|
|
17730
|
-
}
|
|
17731
|
-
) });
|
|
17732
|
-
}
|
|
17733
|
-
var PRESET_BY_ID;
|
|
17734
|
-
var init_SimulationCanvas = __esm({
|
|
17735
|
-
"components/game/2d/organisms/SimulationCanvas.tsx"() {
|
|
17736
|
-
init_cn();
|
|
17737
|
-
init_atoms();
|
|
17738
|
-
init_verificationRegistry();
|
|
17739
|
-
init_physicsPresets();
|
|
17740
|
-
init_useRenderInterpolation();
|
|
17741
|
-
PRESET_BY_ID = {
|
|
17742
|
-
"mechanics-projectile": projectileMotion,
|
|
17743
|
-
"mechanics-pendulum": pendulum,
|
|
17744
|
-
"mechanics-spring": springOscillator
|
|
17745
|
-
};
|
|
17746
|
-
SimulationCanvas.displayName = "SimulationCanvas";
|
|
17747
|
-
}
|
|
17748
|
-
});
|
|
17749
17561
|
var GameTemplate;
|
|
17750
17562
|
var init_GameTemplate = __esm({
|
|
17751
17563
|
"components/game/2d/templates/GameTemplate.tsx"() {
|
|
@@ -18354,7 +18166,7 @@ var init_ErrorBoundary = __esm({
|
|
|
18354
18166
|
}
|
|
18355
18167
|
);
|
|
18356
18168
|
};
|
|
18357
|
-
ErrorBoundary = class extends
|
|
18169
|
+
ErrorBoundary = class extends React104__default.Component {
|
|
18358
18170
|
constructor(props) {
|
|
18359
18171
|
super(props);
|
|
18360
18172
|
__publicField(this, "reset", () => {
|
|
@@ -18636,7 +18448,7 @@ var init_Container = __esm({
|
|
|
18636
18448
|
as: Component = "div"
|
|
18637
18449
|
}) => {
|
|
18638
18450
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
18639
|
-
return
|
|
18451
|
+
return React104__default.createElement(
|
|
18640
18452
|
Component,
|
|
18641
18453
|
{
|
|
18642
18454
|
className: cn(
|
|
@@ -20477,7 +20289,7 @@ var init_CodeBlock = __esm({
|
|
|
20477
20289
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
20478
20290
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
20479
20291
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
20480
|
-
CodeBlock =
|
|
20292
|
+
CodeBlock = React104__default.memo(
|
|
20481
20293
|
({
|
|
20482
20294
|
code: rawCode,
|
|
20483
20295
|
language = "text",
|
|
@@ -21064,7 +20876,7 @@ var init_MarkdownContent = __esm({
|
|
|
21064
20876
|
init_Box();
|
|
21065
20877
|
init_CodeBlock();
|
|
21066
20878
|
init_cn();
|
|
21067
|
-
MarkdownContent =
|
|
20879
|
+
MarkdownContent = React104__default.memo(
|
|
21068
20880
|
({ content, direction = "ltr", className }) => {
|
|
21069
20881
|
const { t: _t } = useTranslate();
|
|
21070
20882
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -22391,7 +22203,7 @@ var init_StateMachineView = __esm({
|
|
|
22391
22203
|
style: { top: title ? 30 : 0 },
|
|
22392
22204
|
children: [
|
|
22393
22205
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
22394
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
22206
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React104__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
22395
22207
|
StateNode2,
|
|
22396
22208
|
{
|
|
22397
22209
|
state,
|
|
@@ -28029,8 +27841,8 @@ var init_Menu = __esm({
|
|
|
28029
27841
|
"bottom-end": "bottom-start"
|
|
28030
27842
|
};
|
|
28031
27843
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
28032
|
-
const triggerChild =
|
|
28033
|
-
const triggerElement =
|
|
27844
|
+
const triggerChild = React104__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
27845
|
+
const triggerElement = React104__default.cloneElement(
|
|
28034
27846
|
triggerChild,
|
|
28035
27847
|
{
|
|
28036
27848
|
ref: triggerRef,
|
|
@@ -28125,14 +27937,14 @@ function useDataDnd(args) {
|
|
|
28125
27937
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
28126
27938
|
const enabled = isZone || Boolean(dndRoot);
|
|
28127
27939
|
const eventBus = useEventBus();
|
|
28128
|
-
const parentRoot =
|
|
27940
|
+
const parentRoot = React104__default.useContext(RootCtx);
|
|
28129
27941
|
const isRoot = enabled && parentRoot === null;
|
|
28130
|
-
const zoneId =
|
|
27942
|
+
const zoneId = React104__default.useId();
|
|
28131
27943
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
28132
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
28133
|
-
const optimisticOrdersRef =
|
|
27944
|
+
const [optimisticOrders, setOptimisticOrders] = React104__default.useState(() => /* @__PURE__ */ new Map());
|
|
27945
|
+
const optimisticOrdersRef = React104__default.useRef(optimisticOrders);
|
|
28134
27946
|
optimisticOrdersRef.current = optimisticOrders;
|
|
28135
|
-
const clearOptimisticOrder =
|
|
27947
|
+
const clearOptimisticOrder = React104__default.useCallback((group) => {
|
|
28136
27948
|
setOptimisticOrders((prev) => {
|
|
28137
27949
|
if (!prev.has(group)) return prev;
|
|
28138
27950
|
const next = new Map(prev);
|
|
@@ -28157,7 +27969,7 @@ function useDataDnd(args) {
|
|
|
28157
27969
|
const raw = it[dndItemIdField];
|
|
28158
27970
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
28159
27971
|
}).join("|");
|
|
28160
|
-
const itemIds =
|
|
27972
|
+
const itemIds = React104__default.useMemo(
|
|
28161
27973
|
() => orderedItems.map((it, idx) => {
|
|
28162
27974
|
const raw = it[dndItemIdField];
|
|
28163
27975
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -28168,7 +27980,7 @@ function useDataDnd(args) {
|
|
|
28168
27980
|
const raw = it[dndItemIdField];
|
|
28169
27981
|
return raw != null ? String(raw) : `__${idx}`;
|
|
28170
27982
|
}).join("|");
|
|
28171
|
-
|
|
27983
|
+
React104__default.useEffect(() => {
|
|
28172
27984
|
const root = isRoot ? null : parentRoot;
|
|
28173
27985
|
if (root) {
|
|
28174
27986
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -28176,20 +27988,20 @@ function useDataDnd(args) {
|
|
|
28176
27988
|
clearOptimisticOrder(ownGroup);
|
|
28177
27989
|
}
|
|
28178
27990
|
}, [itemsContentSig, ownGroup]);
|
|
28179
|
-
const zonesRef =
|
|
28180
|
-
const registerZone =
|
|
27991
|
+
const zonesRef = React104__default.useRef(/* @__PURE__ */ new Map());
|
|
27992
|
+
const registerZone = React104__default.useCallback((zoneId2, meta2) => {
|
|
28181
27993
|
zonesRef.current.set(zoneId2, meta2);
|
|
28182
27994
|
}, []);
|
|
28183
|
-
const unregisterZone =
|
|
27995
|
+
const unregisterZone = React104__default.useCallback((zoneId2) => {
|
|
28184
27996
|
zonesRef.current.delete(zoneId2);
|
|
28185
27997
|
}, []);
|
|
28186
|
-
const [activeDrag, setActiveDrag] =
|
|
28187
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
28188
|
-
const meta =
|
|
27998
|
+
const [activeDrag, setActiveDrag] = React104__default.useState(null);
|
|
27999
|
+
const [overZoneGroup, setOverZoneGroup] = React104__default.useState(null);
|
|
28000
|
+
const meta = React104__default.useMemo(
|
|
28189
28001
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
28190
28002
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
28191
28003
|
);
|
|
28192
|
-
|
|
28004
|
+
React104__default.useEffect(() => {
|
|
28193
28005
|
const target = isRoot ? null : parentRoot;
|
|
28194
28006
|
if (!target) {
|
|
28195
28007
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -28208,7 +28020,7 @@ function useDataDnd(args) {
|
|
|
28208
28020
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
28209
28021
|
const sensors = useAlmadarDndSensors(true);
|
|
28210
28022
|
const collisionDetection = almadarDndCollisionDetection;
|
|
28211
|
-
const findZoneByItem =
|
|
28023
|
+
const findZoneByItem = React104__default.useCallback(
|
|
28212
28024
|
(id) => {
|
|
28213
28025
|
for (const z of zonesRef.current.values()) {
|
|
28214
28026
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -28217,7 +28029,7 @@ function useDataDnd(args) {
|
|
|
28217
28029
|
},
|
|
28218
28030
|
[]
|
|
28219
28031
|
);
|
|
28220
|
-
|
|
28032
|
+
React104__default.useCallback(
|
|
28221
28033
|
(group) => {
|
|
28222
28034
|
for (const z of zonesRef.current.values()) {
|
|
28223
28035
|
if (z.group === group) return z;
|
|
@@ -28226,7 +28038,7 @@ function useDataDnd(args) {
|
|
|
28226
28038
|
},
|
|
28227
28039
|
[]
|
|
28228
28040
|
);
|
|
28229
|
-
const handleDragEnd =
|
|
28041
|
+
const handleDragEnd = React104__default.useCallback(
|
|
28230
28042
|
(event) => {
|
|
28231
28043
|
const { active, over } = event;
|
|
28232
28044
|
const activeIdStr = String(active.id);
|
|
@@ -28317,8 +28129,8 @@ function useDataDnd(args) {
|
|
|
28317
28129
|
},
|
|
28318
28130
|
[eventBus]
|
|
28319
28131
|
);
|
|
28320
|
-
const sortableData =
|
|
28321
|
-
const SortableItem =
|
|
28132
|
+
const sortableData = React104__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
28133
|
+
const SortableItem = React104__default.useCallback(
|
|
28322
28134
|
({ id, children }) => {
|
|
28323
28135
|
const {
|
|
28324
28136
|
attributes,
|
|
@@ -28358,7 +28170,7 @@ function useDataDnd(args) {
|
|
|
28358
28170
|
id: droppableId,
|
|
28359
28171
|
data: sortableData
|
|
28360
28172
|
});
|
|
28361
|
-
const ctx =
|
|
28173
|
+
const ctx = React104__default.useContext(RootCtx);
|
|
28362
28174
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
28363
28175
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
28364
28176
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -28373,7 +28185,7 @@ function useDataDnd(args) {
|
|
|
28373
28185
|
showForeignPlaceholder,
|
|
28374
28186
|
ctxAvailable: ctx != null
|
|
28375
28187
|
});
|
|
28376
|
-
|
|
28188
|
+
React104__default.useEffect(() => {
|
|
28377
28189
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
28378
28190
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
28379
28191
|
return /* @__PURE__ */ jsx(
|
|
@@ -28387,11 +28199,11 @@ function useDataDnd(args) {
|
|
|
28387
28199
|
}
|
|
28388
28200
|
);
|
|
28389
28201
|
};
|
|
28390
|
-
const rootContextValue =
|
|
28202
|
+
const rootContextValue = React104__default.useMemo(
|
|
28391
28203
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
28392
28204
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
28393
28205
|
);
|
|
28394
|
-
const handleDragStart =
|
|
28206
|
+
const handleDragStart = React104__default.useCallback((event) => {
|
|
28395
28207
|
const sourceZone = findZoneByItem(event.active.id);
|
|
28396
28208
|
const rect = event.active.rect.current.initial;
|
|
28397
28209
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -28410,7 +28222,7 @@ function useDataDnd(args) {
|
|
|
28410
28222
|
isRoot
|
|
28411
28223
|
});
|
|
28412
28224
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
28413
|
-
const handleDragOver =
|
|
28225
|
+
const handleDragOver = React104__default.useCallback((event) => {
|
|
28414
28226
|
const { active, over } = event;
|
|
28415
28227
|
const overData = over?.data?.current;
|
|
28416
28228
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -28480,7 +28292,7 @@ function useDataDnd(args) {
|
|
|
28480
28292
|
return next;
|
|
28481
28293
|
});
|
|
28482
28294
|
}, []);
|
|
28483
|
-
const handleDragCancel =
|
|
28295
|
+
const handleDragCancel = React104__default.useCallback((event) => {
|
|
28484
28296
|
setActiveDrag(null);
|
|
28485
28297
|
setOverZoneGroup(null);
|
|
28486
28298
|
dndLog.warn("dragCancel", {
|
|
@@ -28488,12 +28300,12 @@ function useDataDnd(args) {
|
|
|
28488
28300
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
28489
28301
|
});
|
|
28490
28302
|
}, []);
|
|
28491
|
-
const handleDragEndWithCleanup =
|
|
28303
|
+
const handleDragEndWithCleanup = React104__default.useCallback((event) => {
|
|
28492
28304
|
handleDragEnd(event);
|
|
28493
28305
|
setActiveDrag(null);
|
|
28494
28306
|
setOverZoneGroup(null);
|
|
28495
28307
|
}, [handleDragEnd]);
|
|
28496
|
-
const wrapContainer =
|
|
28308
|
+
const wrapContainer = React104__default.useCallback(
|
|
28497
28309
|
(children) => {
|
|
28498
28310
|
if (!enabled) return children;
|
|
28499
28311
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -28547,7 +28359,7 @@ var init_useDataDnd = __esm({
|
|
|
28547
28359
|
init_useAlmadarDndCollision();
|
|
28548
28360
|
init_Box();
|
|
28549
28361
|
dndLog = createLogger("almadar:ui:dnd");
|
|
28550
|
-
RootCtx =
|
|
28362
|
+
RootCtx = React104__default.createContext(null);
|
|
28551
28363
|
}
|
|
28552
28364
|
});
|
|
28553
28365
|
function renderIconInput(icon, props) {
|
|
@@ -29073,7 +28885,7 @@ function DataList({
|
|
|
29073
28885
|
}) {
|
|
29074
28886
|
const eventBus = useEventBus();
|
|
29075
28887
|
const { t } = useTranslate();
|
|
29076
|
-
const [visibleCount, setVisibleCount] =
|
|
28888
|
+
const [visibleCount, setVisibleCount] = React104__default.useState(pageSize || Infinity);
|
|
29077
28889
|
const fieldDefs = fields ?? columns ?? [];
|
|
29078
28890
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
29079
28891
|
const dnd = useDataDnd({
|
|
@@ -29092,7 +28904,7 @@ function DataList({
|
|
|
29092
28904
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
29093
28905
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
29094
28906
|
const hasRenderProp = typeof children === "function";
|
|
29095
|
-
|
|
28907
|
+
React104__default.useEffect(() => {
|
|
29096
28908
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
29097
28909
|
const childrenTypeOf = typeof children;
|
|
29098
28910
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -29196,7 +29008,7 @@ function DataList({
|
|
|
29196
29008
|
const items2 = [...data];
|
|
29197
29009
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
29198
29010
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
29199
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
29011
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
|
|
29200
29012
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
29201
29013
|
group.items.map((itemData, index) => {
|
|
29202
29014
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -29337,7 +29149,7 @@ function DataList({
|
|
|
29337
29149
|
className
|
|
29338
29150
|
),
|
|
29339
29151
|
children: [
|
|
29340
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
29152
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
|
|
29341
29153
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
29342
29154
|
group.items.map(
|
|
29343
29155
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -29422,7 +29234,7 @@ var init_FormSection = __esm({
|
|
|
29422
29234
|
columns = 1,
|
|
29423
29235
|
className
|
|
29424
29236
|
}) => {
|
|
29425
|
-
const [collapsed, setCollapsed] =
|
|
29237
|
+
const [collapsed, setCollapsed] = React104__default.useState(defaultCollapsed);
|
|
29426
29238
|
const { t } = useTranslate();
|
|
29427
29239
|
const eventBus = useEventBus();
|
|
29428
29240
|
const gridClass = {
|
|
@@ -29430,7 +29242,7 @@ var init_FormSection = __esm({
|
|
|
29430
29242
|
2: "grid-cols-1 md:grid-cols-2",
|
|
29431
29243
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
29432
29244
|
}[columns];
|
|
29433
|
-
|
|
29245
|
+
React104__default.useCallback(() => {
|
|
29434
29246
|
if (collapsible) {
|
|
29435
29247
|
setCollapsed((prev) => !prev);
|
|
29436
29248
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -30380,7 +30192,7 @@ var init_Flex = __esm({
|
|
|
30380
30192
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
30381
30193
|
}
|
|
30382
30194
|
}
|
|
30383
|
-
return
|
|
30195
|
+
return React104__default.createElement(Component, {
|
|
30384
30196
|
className: cn(
|
|
30385
30197
|
inline ? "inline-flex" : "flex",
|
|
30386
30198
|
directionStyles[direction],
|
|
@@ -30499,7 +30311,7 @@ var init_Grid = __esm({
|
|
|
30499
30311
|
as: Component = "div"
|
|
30500
30312
|
}) => {
|
|
30501
30313
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
30502
|
-
return
|
|
30314
|
+
return React104__default.createElement(
|
|
30503
30315
|
Component,
|
|
30504
30316
|
{
|
|
30505
30317
|
className: cn(
|
|
@@ -30695,9 +30507,9 @@ var init_Popover = __esm({
|
|
|
30695
30507
|
onMouseLeave: handleClose,
|
|
30696
30508
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
30697
30509
|
};
|
|
30698
|
-
const childElement =
|
|
30510
|
+
const childElement = React104__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
30699
30511
|
const childPointerDown = childElement.props.onPointerDown;
|
|
30700
|
-
const triggerElement =
|
|
30512
|
+
const triggerElement = React104__default.cloneElement(
|
|
30701
30513
|
childElement,
|
|
30702
30514
|
{
|
|
30703
30515
|
ref: triggerRef,
|
|
@@ -31299,9 +31111,9 @@ var init_Tooltip = __esm({
|
|
|
31299
31111
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
31300
31112
|
};
|
|
31301
31113
|
}, []);
|
|
31302
|
-
const triggerElement =
|
|
31114
|
+
const triggerElement = React104__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
31303
31115
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
31304
|
-
const trigger =
|
|
31116
|
+
const trigger = React104__default.cloneElement(triggerElement, {
|
|
31305
31117
|
ref: triggerRef,
|
|
31306
31118
|
onMouseEnter: handleMouseEnter,
|
|
31307
31119
|
onMouseLeave: handleMouseLeave,
|
|
@@ -31391,7 +31203,7 @@ var init_WizardProgress = __esm({
|
|
|
31391
31203
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
31392
31204
|
const isActive = index === currentStep;
|
|
31393
31205
|
const isCompleted = index < currentStep;
|
|
31394
|
-
return /* @__PURE__ */ jsxs(
|
|
31206
|
+
return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
|
|
31395
31207
|
/* @__PURE__ */ jsx(
|
|
31396
31208
|
"button",
|
|
31397
31209
|
{
|
|
@@ -32951,13 +32763,13 @@ var init_MapView = __esm({
|
|
|
32951
32763
|
shadowSize: [41, 41]
|
|
32952
32764
|
});
|
|
32953
32765
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
32954
|
-
const { useEffect:
|
|
32766
|
+
const { useEffect: useEffect70, useRef: useRef66, useCallback: useCallback104, useState: useState105 } = React104__default;
|
|
32955
32767
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
32956
32768
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
32957
32769
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
32958
32770
|
const map = useMap();
|
|
32959
|
-
const prevRef =
|
|
32960
|
-
|
|
32771
|
+
const prevRef = useRef66({ centerLat, centerLng, zoom });
|
|
32772
|
+
useEffect70(() => {
|
|
32961
32773
|
const prev = prevRef.current;
|
|
32962
32774
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
32963
32775
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -32968,7 +32780,7 @@ var init_MapView = __esm({
|
|
|
32968
32780
|
}
|
|
32969
32781
|
function MapClickHandler({ onMapClick }) {
|
|
32970
32782
|
const map = useMap();
|
|
32971
|
-
|
|
32783
|
+
useEffect70(() => {
|
|
32972
32784
|
if (!onMapClick) return;
|
|
32973
32785
|
const handler = (e) => {
|
|
32974
32786
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -32997,7 +32809,7 @@ var init_MapView = __esm({
|
|
|
32997
32809
|
}) {
|
|
32998
32810
|
const eventBus = useEventBus2();
|
|
32999
32811
|
const [clickedPosition, setClickedPosition] = useState105(null);
|
|
33000
|
-
const handleMapClick =
|
|
32812
|
+
const handleMapClick = useCallback104((lat, lng) => {
|
|
33001
32813
|
if (showClickedPin) {
|
|
33002
32814
|
setClickedPosition({ lat, lng });
|
|
33003
32815
|
}
|
|
@@ -33006,7 +32818,7 @@ var init_MapView = __esm({
|
|
|
33006
32818
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
33007
32819
|
}
|
|
33008
32820
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
33009
|
-
const handleMarkerClick =
|
|
32821
|
+
const handleMarkerClick = useCallback104((marker) => {
|
|
33010
32822
|
onMarkerClick?.(marker);
|
|
33011
32823
|
if (markerClickEvent) {
|
|
33012
32824
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -33866,8 +33678,8 @@ function TableView({
|
|
|
33866
33678
|
}) {
|
|
33867
33679
|
const eventBus = useEventBus();
|
|
33868
33680
|
const { t } = useTranslate();
|
|
33869
|
-
const [visibleCount, setVisibleCount] =
|
|
33870
|
-
const [localSelected, setLocalSelected] =
|
|
33681
|
+
const [visibleCount, setVisibleCount] = React104__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
33682
|
+
const [localSelected, setLocalSelected] = React104__default.useState(/* @__PURE__ */ new Set());
|
|
33871
33683
|
const colDefs = columns ?? fields ?? [];
|
|
33872
33684
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
33873
33685
|
const dnd = useDataDnd({
|
|
@@ -34062,12 +33874,12 @@ function TableView({
|
|
|
34062
33874
|
]
|
|
34063
33875
|
}
|
|
34064
33876
|
);
|
|
34065
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
33877
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React104__default.Fragment, { children: rowInner }, id);
|
|
34066
33878
|
};
|
|
34067
33879
|
const items = Array.from(data);
|
|
34068
33880
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
34069
33881
|
let runningIndex = 0;
|
|
34070
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
33882
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
|
|
34071
33883
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
34072
33884
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
34073
33885
|
] }, gi)) });
|
|
@@ -35424,7 +35236,7 @@ var init_StepFlow = __esm({
|
|
|
35424
35236
|
className
|
|
35425
35237
|
}) => {
|
|
35426
35238
|
if (orientation === "vertical") {
|
|
35427
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
35239
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React104__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
35428
35240
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
35429
35241
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
35430
35242
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -35435,7 +35247,7 @@ var init_StepFlow = __esm({
|
|
|
35435
35247
|
] })
|
|
35436
35248
|
] }) }, index)) });
|
|
35437
35249
|
}
|
|
35438
|
-
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(
|
|
35250
|
+
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(React104__default.Fragment, { children: [
|
|
35439
35251
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
35440
35252
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
35441
35253
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -36420,7 +36232,7 @@ var init_LikertScale = __esm({
|
|
|
36420
36232
|
md: "text-base",
|
|
36421
36233
|
lg: "text-lg"
|
|
36422
36234
|
};
|
|
36423
|
-
LikertScale =
|
|
36235
|
+
LikertScale = React104__default.forwardRef(
|
|
36424
36236
|
({
|
|
36425
36237
|
question,
|
|
36426
36238
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -36432,7 +36244,7 @@ var init_LikertScale = __esm({
|
|
|
36432
36244
|
variant = "radios",
|
|
36433
36245
|
className
|
|
36434
36246
|
}, ref) => {
|
|
36435
|
-
const groupId =
|
|
36247
|
+
const groupId = React104__default.useId();
|
|
36436
36248
|
const eventBus = useEventBus();
|
|
36437
36249
|
const handleSelect = useCallback(
|
|
36438
36250
|
(next) => {
|
|
@@ -38714,7 +38526,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
38714
38526
|
"aria-label": t("aria.breadcrumb"),
|
|
38715
38527
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
38716
38528
|
const isLast = idx === items.length - 1;
|
|
38717
|
-
return /* @__PURE__ */ jsxs(
|
|
38529
|
+
return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
|
|
38718
38530
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
38719
38531
|
Icon,
|
|
38720
38532
|
{
|
|
@@ -39378,7 +39190,7 @@ var init_PageHeader = __esm({
|
|
|
39378
39190
|
info: "bg-info/10 text-info"
|
|
39379
39191
|
};
|
|
39380
39192
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
39381
|
-
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(
|
|
39193
|
+
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(React104__default.Fragment, { children: [
|
|
39382
39194
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
39383
39195
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
39384
39196
|
"a",
|
|
@@ -39736,7 +39548,7 @@ var init_Section = __esm({
|
|
|
39736
39548
|
as: Component = "section"
|
|
39737
39549
|
}) => {
|
|
39738
39550
|
const hasHeader = title || description || action;
|
|
39739
|
-
return
|
|
39551
|
+
return React104__default.createElement(
|
|
39740
39552
|
Component,
|
|
39741
39553
|
{
|
|
39742
39554
|
className: cn(
|
|
@@ -40110,7 +39922,7 @@ var init_WizardContainer = __esm({
|
|
|
40110
39922
|
const isCompleted = index < currentStep;
|
|
40111
39923
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
40112
39924
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
40113
|
-
return /* @__PURE__ */ jsxs(
|
|
39925
|
+
return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
|
|
40114
39926
|
/* @__PURE__ */ jsx(
|
|
40115
39927
|
Button,
|
|
40116
39928
|
{
|
|
@@ -42543,7 +42355,7 @@ var init_DetailPanel = __esm({
|
|
|
42543
42355
|
}
|
|
42544
42356
|
});
|
|
42545
42357
|
function extractTitle(children) {
|
|
42546
|
-
if (!
|
|
42358
|
+
if (!React104__default.isValidElement(children)) return void 0;
|
|
42547
42359
|
const props = children.props;
|
|
42548
42360
|
if (typeof props.title === "string") {
|
|
42549
42361
|
return props.title;
|
|
@@ -42893,12 +42705,12 @@ var init_Form = __esm({
|
|
|
42893
42705
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
42894
42706
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
42895
42707
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
42896
|
-
const normalizedInitialData =
|
|
42708
|
+
const normalizedInitialData = React104__default.useMemo(() => {
|
|
42897
42709
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
42898
42710
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
42899
42711
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
42900
42712
|
}, [entity, initialData]);
|
|
42901
|
-
const entityDerivedFields =
|
|
42713
|
+
const entityDerivedFields = React104__default.useMemo(() => {
|
|
42902
42714
|
if (fields && fields.length > 0) return void 0;
|
|
42903
42715
|
if (!resolvedEntity) return void 0;
|
|
42904
42716
|
return resolvedEntity.fields.map(
|
|
@@ -42919,16 +42731,16 @@ var init_Form = __esm({
|
|
|
42919
42731
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
42920
42732
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
42921
42733
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
42922
|
-
const [formData, setFormData] =
|
|
42734
|
+
const [formData, setFormData] = React104__default.useState(
|
|
42923
42735
|
normalizedInitialData
|
|
42924
42736
|
);
|
|
42925
|
-
const [collapsedSections, setCollapsedSections] =
|
|
42737
|
+
const [collapsedSections, setCollapsedSections] = React104__default.useState(
|
|
42926
42738
|
/* @__PURE__ */ new Set()
|
|
42927
42739
|
);
|
|
42928
|
-
const [submitError, setSubmitError] =
|
|
42929
|
-
const formRef =
|
|
42740
|
+
const [submitError, setSubmitError] = React104__default.useState(null);
|
|
42741
|
+
const formRef = React104__default.useRef(null);
|
|
42930
42742
|
const formMode = props.mode;
|
|
42931
|
-
const mountedRef =
|
|
42743
|
+
const mountedRef = React104__default.useRef(false);
|
|
42932
42744
|
if (!mountedRef.current) {
|
|
42933
42745
|
mountedRef.current = true;
|
|
42934
42746
|
debug("forms", "mount", {
|
|
@@ -42941,7 +42753,7 @@ var init_Form = __esm({
|
|
|
42941
42753
|
});
|
|
42942
42754
|
}
|
|
42943
42755
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
42944
|
-
const evalContext =
|
|
42756
|
+
const evalContext = React104__default.useMemo(
|
|
42945
42757
|
() => ({
|
|
42946
42758
|
formValues: formData,
|
|
42947
42759
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -42950,7 +42762,7 @@ var init_Form = __esm({
|
|
|
42950
42762
|
}),
|
|
42951
42763
|
[formData, externalContext]
|
|
42952
42764
|
);
|
|
42953
|
-
|
|
42765
|
+
React104__default.useEffect(() => {
|
|
42954
42766
|
debug("forms", "initialData-sync", {
|
|
42955
42767
|
mode: formMode,
|
|
42956
42768
|
normalizedInitialData,
|
|
@@ -42961,7 +42773,7 @@ var init_Form = __esm({
|
|
|
42961
42773
|
setFormData(normalizedInitialData);
|
|
42962
42774
|
}
|
|
42963
42775
|
}, [normalizedInitialData]);
|
|
42964
|
-
const processCalculations =
|
|
42776
|
+
const processCalculations = React104__default.useCallback(
|
|
42965
42777
|
(changedFieldId, newFormData) => {
|
|
42966
42778
|
if (!hiddenCalculations.length) return;
|
|
42967
42779
|
const context = {
|
|
@@ -42986,7 +42798,7 @@ var init_Form = __esm({
|
|
|
42986
42798
|
},
|
|
42987
42799
|
[hiddenCalculations, externalContext, eventBus]
|
|
42988
42800
|
);
|
|
42989
|
-
const checkViolations =
|
|
42801
|
+
const checkViolations = React104__default.useCallback(
|
|
42990
42802
|
(changedFieldId, newFormData) => {
|
|
42991
42803
|
if (!violationTriggers.length) return;
|
|
42992
42804
|
const context = {
|
|
@@ -43024,7 +42836,7 @@ var init_Form = __esm({
|
|
|
43024
42836
|
processCalculations(name, newFormData);
|
|
43025
42837
|
checkViolations(name, newFormData);
|
|
43026
42838
|
};
|
|
43027
|
-
const isFieldVisible =
|
|
42839
|
+
const isFieldVisible = React104__default.useCallback(
|
|
43028
42840
|
(fieldName) => {
|
|
43029
42841
|
const condition = conditionalFields[fieldName];
|
|
43030
42842
|
if (!condition) return true;
|
|
@@ -43032,7 +42844,7 @@ var init_Form = __esm({
|
|
|
43032
42844
|
},
|
|
43033
42845
|
[conditionalFields, evalContext]
|
|
43034
42846
|
);
|
|
43035
|
-
const isSectionVisible =
|
|
42847
|
+
const isSectionVisible = React104__default.useCallback(
|
|
43036
42848
|
(section) => {
|
|
43037
42849
|
if (!section.condition) return true;
|
|
43038
42850
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -43108,7 +42920,7 @@ var init_Form = __esm({
|
|
|
43108
42920
|
eventBus.emit(`UI:${onCancel}`);
|
|
43109
42921
|
}
|
|
43110
42922
|
};
|
|
43111
|
-
const renderField =
|
|
42923
|
+
const renderField = React104__default.useCallback(
|
|
43112
42924
|
(field) => {
|
|
43113
42925
|
const fieldName = field.name || field.field;
|
|
43114
42926
|
if (!fieldName) return null;
|
|
@@ -43129,7 +42941,7 @@ var init_Form = __esm({
|
|
|
43129
42941
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
43130
42942
|
);
|
|
43131
42943
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
43132
|
-
const normalizedFields =
|
|
42944
|
+
const normalizedFields = React104__default.useMemo(() => {
|
|
43133
42945
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
43134
42946
|
return effectiveFields.map((field) => {
|
|
43135
42947
|
if (typeof field === "string") {
|
|
@@ -43153,7 +42965,7 @@ var init_Form = __esm({
|
|
|
43153
42965
|
return field;
|
|
43154
42966
|
});
|
|
43155
42967
|
}, [effectiveFields, resolvedEntity]);
|
|
43156
|
-
const schemaFields =
|
|
42968
|
+
const schemaFields = React104__default.useMemo(() => {
|
|
43157
42969
|
if (normalizedFields.length === 0) return null;
|
|
43158
42970
|
if (isDebugEnabled()) {
|
|
43159
42971
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -43163,7 +42975,7 @@ var init_Form = __esm({
|
|
|
43163
42975
|
}
|
|
43164
42976
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
43165
42977
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
43166
|
-
const sectionElements =
|
|
42978
|
+
const sectionElements = React104__default.useMemo(() => {
|
|
43167
42979
|
if (!sections || sections.length === 0) return null;
|
|
43168
42980
|
return sections.map((section) => {
|
|
43169
42981
|
if (!isSectionVisible(section)) {
|
|
@@ -43888,7 +43700,7 @@ var init_List = __esm({
|
|
|
43888
43700
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
43889
43701
|
return [];
|
|
43890
43702
|
}, [entity]);
|
|
43891
|
-
const getItemActions =
|
|
43703
|
+
const getItemActions = React104__default.useCallback(
|
|
43892
43704
|
(item) => {
|
|
43893
43705
|
if (!itemActions) return [];
|
|
43894
43706
|
if (typeof itemActions === "function") {
|
|
@@ -44363,7 +44175,7 @@ var init_MediaGallery = __esm({
|
|
|
44363
44175
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
44364
44176
|
);
|
|
44365
44177
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
44366
|
-
const items =
|
|
44178
|
+
const items = React104__default.useMemo(() => {
|
|
44367
44179
|
if (propItems) return propItems;
|
|
44368
44180
|
if (entityData.length === 0) return [];
|
|
44369
44181
|
return entityData.map((record, idx) => {
|
|
@@ -44526,7 +44338,7 @@ var init_MediaGallery = __esm({
|
|
|
44526
44338
|
}
|
|
44527
44339
|
});
|
|
44528
44340
|
function extractTitle2(children) {
|
|
44529
|
-
if (!
|
|
44341
|
+
if (!React104__default.isValidElement(children)) return void 0;
|
|
44530
44342
|
const props = children.props;
|
|
44531
44343
|
if (typeof props.title === "string") {
|
|
44532
44344
|
return props.title;
|
|
@@ -44800,7 +44612,7 @@ var init_debugRegistry = __esm({
|
|
|
44800
44612
|
}
|
|
44801
44613
|
});
|
|
44802
44614
|
function useDebugData() {
|
|
44803
|
-
const [data, setData] =
|
|
44615
|
+
const [data, setData] = React104.useState(() => ({
|
|
44804
44616
|
traits: [],
|
|
44805
44617
|
ticks: [],
|
|
44806
44618
|
guards: [],
|
|
@@ -44814,7 +44626,7 @@ function useDebugData() {
|
|
|
44814
44626
|
},
|
|
44815
44627
|
lastUpdate: Date.now()
|
|
44816
44628
|
}));
|
|
44817
|
-
|
|
44629
|
+
React104.useEffect(() => {
|
|
44818
44630
|
const updateData = () => {
|
|
44819
44631
|
setData({
|
|
44820
44632
|
traits: getAllTraits(),
|
|
@@ -44923,12 +44735,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
44923
44735
|
return positions;
|
|
44924
44736
|
}
|
|
44925
44737
|
function WalkMinimap() {
|
|
44926
|
-
const [walkStep, setWalkStep] =
|
|
44927
|
-
const [traits2, setTraits] =
|
|
44928
|
-
const [coveredEdges, setCoveredEdges] =
|
|
44929
|
-
const [completedTraits, setCompletedTraits] =
|
|
44930
|
-
const prevTraitRef =
|
|
44931
|
-
|
|
44738
|
+
const [walkStep, setWalkStep] = React104.useState(null);
|
|
44739
|
+
const [traits2, setTraits] = React104.useState([]);
|
|
44740
|
+
const [coveredEdges, setCoveredEdges] = React104.useState([]);
|
|
44741
|
+
const [completedTraits, setCompletedTraits] = React104.useState(/* @__PURE__ */ new Set());
|
|
44742
|
+
const prevTraitRef = React104.useRef(null);
|
|
44743
|
+
React104.useEffect(() => {
|
|
44932
44744
|
const interval = setInterval(() => {
|
|
44933
44745
|
const w = window;
|
|
44934
44746
|
const step = w.__orbitalWalkStep;
|
|
@@ -45364,15 +45176,15 @@ var init_EntitiesTab = __esm({
|
|
|
45364
45176
|
});
|
|
45365
45177
|
function EventFlowTab({ events: events2 }) {
|
|
45366
45178
|
const { t } = useTranslate();
|
|
45367
|
-
const [filter, setFilter] =
|
|
45368
|
-
const containerRef =
|
|
45369
|
-
const [autoScroll, setAutoScroll] =
|
|
45370
|
-
|
|
45179
|
+
const [filter, setFilter] = React104.useState("all");
|
|
45180
|
+
const containerRef = React104.useRef(null);
|
|
45181
|
+
const [autoScroll, setAutoScroll] = React104.useState(true);
|
|
45182
|
+
React104.useEffect(() => {
|
|
45371
45183
|
if (autoScroll && containerRef.current) {
|
|
45372
45184
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
45373
45185
|
}
|
|
45374
45186
|
}, [events2.length, autoScroll]);
|
|
45375
|
-
const filteredEvents =
|
|
45187
|
+
const filteredEvents = React104.useMemo(() => {
|
|
45376
45188
|
if (filter === "all") return events2;
|
|
45377
45189
|
return events2.filter((e) => e.type === filter);
|
|
45378
45190
|
}, [events2, filter]);
|
|
@@ -45488,7 +45300,7 @@ var init_EventFlowTab = __esm({
|
|
|
45488
45300
|
});
|
|
45489
45301
|
function GuardsPanel({ guards }) {
|
|
45490
45302
|
const { t } = useTranslate();
|
|
45491
|
-
const [filter, setFilter] =
|
|
45303
|
+
const [filter, setFilter] = React104.useState("all");
|
|
45492
45304
|
if (guards.length === 0) {
|
|
45493
45305
|
return /* @__PURE__ */ jsx(
|
|
45494
45306
|
EmptyState,
|
|
@@ -45501,7 +45313,7 @@ function GuardsPanel({ guards }) {
|
|
|
45501
45313
|
}
|
|
45502
45314
|
const passedCount = guards.filter((g) => g.result).length;
|
|
45503
45315
|
const failedCount = guards.length - passedCount;
|
|
45504
|
-
const filteredGuards =
|
|
45316
|
+
const filteredGuards = React104.useMemo(() => {
|
|
45505
45317
|
if (filter === "all") return guards;
|
|
45506
45318
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
45507
45319
|
return guards.filter((g) => !g.result);
|
|
@@ -45664,10 +45476,10 @@ function EffectBadge({ effect }) {
|
|
|
45664
45476
|
}
|
|
45665
45477
|
function TransitionTimeline({ transitions }) {
|
|
45666
45478
|
const { t } = useTranslate();
|
|
45667
|
-
const containerRef =
|
|
45668
|
-
const [autoScroll, setAutoScroll] =
|
|
45669
|
-
const [expandedId, setExpandedId] =
|
|
45670
|
-
|
|
45479
|
+
const containerRef = React104.useRef(null);
|
|
45480
|
+
const [autoScroll, setAutoScroll] = React104.useState(true);
|
|
45481
|
+
const [expandedId, setExpandedId] = React104.useState(null);
|
|
45482
|
+
React104.useEffect(() => {
|
|
45671
45483
|
if (autoScroll && containerRef.current) {
|
|
45672
45484
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
45673
45485
|
}
|
|
@@ -45947,9 +45759,9 @@ function getAllEvents(traits2) {
|
|
|
45947
45759
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
45948
45760
|
const eventBus = useEventBus();
|
|
45949
45761
|
const { t } = useTranslate();
|
|
45950
|
-
const [log11, setLog] =
|
|
45951
|
-
const prevStatesRef =
|
|
45952
|
-
|
|
45762
|
+
const [log11, setLog] = React104.useState([]);
|
|
45763
|
+
const prevStatesRef = React104.useRef(/* @__PURE__ */ new Map());
|
|
45764
|
+
React104.useEffect(() => {
|
|
45953
45765
|
for (const trait of traits2) {
|
|
45954
45766
|
const prev = prevStatesRef.current.get(trait.id);
|
|
45955
45767
|
if (prev && prev !== trait.currentState) {
|
|
@@ -46118,10 +45930,10 @@ function VerifyModePanel({
|
|
|
46118
45930
|
localCount
|
|
46119
45931
|
}) {
|
|
46120
45932
|
const { t } = useTranslate();
|
|
46121
|
-
const [expanded, setExpanded] =
|
|
46122
|
-
const scrollRef =
|
|
46123
|
-
const prevCountRef =
|
|
46124
|
-
|
|
45933
|
+
const [expanded, setExpanded] = React104.useState(true);
|
|
45934
|
+
const scrollRef = React104.useRef(null);
|
|
45935
|
+
const prevCountRef = React104.useRef(0);
|
|
45936
|
+
React104.useEffect(() => {
|
|
46125
45937
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
46126
45938
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
46127
45939
|
}
|
|
@@ -46178,10 +45990,10 @@ function RuntimeDebugger({
|
|
|
46178
45990
|
schema
|
|
46179
45991
|
}) {
|
|
46180
45992
|
const { t } = useTranslate();
|
|
46181
|
-
const [isCollapsed, setIsCollapsed] =
|
|
46182
|
-
const [isVisible, setIsVisible] =
|
|
45993
|
+
const [isCollapsed, setIsCollapsed] = React104.useState(mode === "verify" ? true : defaultCollapsed);
|
|
45994
|
+
const [isVisible, setIsVisible] = React104.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
46183
45995
|
const debugData = useDebugData();
|
|
46184
|
-
|
|
45996
|
+
React104.useEffect(() => {
|
|
46185
45997
|
if (mode === "inline") return;
|
|
46186
45998
|
return onDebugToggle((enabled) => {
|
|
46187
45999
|
setIsVisible(enabled);
|
|
@@ -46190,7 +46002,7 @@ function RuntimeDebugger({
|
|
|
46190
46002
|
}
|
|
46191
46003
|
});
|
|
46192
46004
|
}, [mode]);
|
|
46193
|
-
|
|
46005
|
+
React104.useEffect(() => {
|
|
46194
46006
|
if (mode === "inline") return;
|
|
46195
46007
|
const handleKeyDown = (e) => {
|
|
46196
46008
|
if (e.key === "`" && isVisible) {
|
|
@@ -46710,7 +46522,7 @@ var init_StatCard = __esm({
|
|
|
46710
46522
|
const labelToUse = propLabel ?? propTitle;
|
|
46711
46523
|
const eventBus = useEventBus();
|
|
46712
46524
|
const { t } = useTranslate();
|
|
46713
|
-
const handleActionClick =
|
|
46525
|
+
const handleActionClick = React104__default.useCallback(() => {
|
|
46714
46526
|
if (action?.event) {
|
|
46715
46527
|
eventBus.emit(`UI:${action.event}`, {});
|
|
46716
46528
|
}
|
|
@@ -46721,7 +46533,7 @@ var init_StatCard = __esm({
|
|
|
46721
46533
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
46722
46534
|
const isLoading = externalLoading ?? false;
|
|
46723
46535
|
const error = externalError;
|
|
46724
|
-
const computeMetricValue =
|
|
46536
|
+
const computeMetricValue = React104__default.useCallback(
|
|
46725
46537
|
(metric, items) => {
|
|
46726
46538
|
if (metric.value !== void 0) {
|
|
46727
46539
|
return metric.value;
|
|
@@ -46760,7 +46572,7 @@ var init_StatCard = __esm({
|
|
|
46760
46572
|
},
|
|
46761
46573
|
[]
|
|
46762
46574
|
);
|
|
46763
|
-
const schemaStats =
|
|
46575
|
+
const schemaStats = React104__default.useMemo(() => {
|
|
46764
46576
|
if (!metrics || metrics.length === 0) return null;
|
|
46765
46577
|
return metrics.map((metric) => ({
|
|
46766
46578
|
label: metric.label,
|
|
@@ -46768,7 +46580,7 @@ var init_StatCard = __esm({
|
|
|
46768
46580
|
format: metric.format
|
|
46769
46581
|
}));
|
|
46770
46582
|
}, [metrics, data, computeMetricValue]);
|
|
46771
|
-
const calculatedTrend =
|
|
46583
|
+
const calculatedTrend = React104__default.useMemo(() => {
|
|
46772
46584
|
if (manualTrend !== void 0) return manualTrend;
|
|
46773
46585
|
if (previousValue === void 0 || currentValue === void 0)
|
|
46774
46586
|
return void 0;
|
|
@@ -47408,8 +47220,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
47408
47220
|
] });
|
|
47409
47221
|
};
|
|
47410
47222
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
47411
|
-
const endRef =
|
|
47412
|
-
|
|
47223
|
+
const endRef = React104__default.useRef(null);
|
|
47224
|
+
React104__default.useEffect(() => {
|
|
47413
47225
|
if (!autoScroll) return;
|
|
47414
47226
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
47415
47227
|
}, [activities.length, autoScroll]);
|
|
@@ -47503,7 +47315,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
47503
47315
|
};
|
|
47504
47316
|
SubagentRichCard = ({ subagent }) => {
|
|
47505
47317
|
const { t } = useTranslate();
|
|
47506
|
-
const activities =
|
|
47318
|
+
const activities = React104__default.useMemo(
|
|
47507
47319
|
() => subagentMessagesToActivities(subagent.messages),
|
|
47508
47320
|
[subagent.messages]
|
|
47509
47321
|
);
|
|
@@ -47580,8 +47392,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
47580
47392
|
] });
|
|
47581
47393
|
};
|
|
47582
47394
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
47583
|
-
const endRef =
|
|
47584
|
-
|
|
47395
|
+
const endRef = React104__default.useRef(null);
|
|
47396
|
+
React104__default.useEffect(() => {
|
|
47585
47397
|
if (!autoScroll) return;
|
|
47586
47398
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
47587
47399
|
}, [messages.length, autoScroll]);
|
|
@@ -48011,7 +47823,7 @@ var init_Timeline = __esm({
|
|
|
48011
47823
|
}) => {
|
|
48012
47824
|
const { t } = useTranslate();
|
|
48013
47825
|
const entityData = entity ?? [];
|
|
48014
|
-
const items =
|
|
47826
|
+
const items = React104__default.useMemo(() => {
|
|
48015
47827
|
if (propItems) return propItems;
|
|
48016
47828
|
if (entityData.length === 0) return [];
|
|
48017
47829
|
return entityData.map((record, idx) => {
|
|
@@ -48113,7 +47925,7 @@ var init_Timeline = __esm({
|
|
|
48113
47925
|
}
|
|
48114
47926
|
});
|
|
48115
47927
|
function extractToastProps(children) {
|
|
48116
|
-
if (!
|
|
47928
|
+
if (!React104__default.isValidElement(children)) {
|
|
48117
47929
|
if (typeof children === "string") {
|
|
48118
47930
|
return { message: children };
|
|
48119
47931
|
}
|
|
@@ -48155,7 +47967,7 @@ var init_ToastSlot = __esm({
|
|
|
48155
47967
|
eventBus.emit(`${prefix}CLOSE`);
|
|
48156
47968
|
};
|
|
48157
47969
|
if (!isVisible) return null;
|
|
48158
|
-
const isCustomContent =
|
|
47970
|
+
const isCustomContent = React104__default.isValidElement(children) && !message;
|
|
48159
47971
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
48160
47972
|
Toast,
|
|
48161
47973
|
{
|
|
@@ -48172,7 +47984,7 @@ var init_ToastSlot = __esm({
|
|
|
48172
47984
|
}
|
|
48173
47985
|
});
|
|
48174
47986
|
function lazyThree(name, loader) {
|
|
48175
|
-
const Lazy =
|
|
47987
|
+
const Lazy = React104__default.lazy(
|
|
48176
47988
|
() => loader().then((m) => {
|
|
48177
47989
|
const Resolved = m[name];
|
|
48178
47990
|
if (!Resolved) {
|
|
@@ -48184,13 +47996,13 @@ function lazyThree(name, loader) {
|
|
|
48184
47996
|
})
|
|
48185
47997
|
);
|
|
48186
47998
|
function ThreeWrapper(props) {
|
|
48187
|
-
return
|
|
47999
|
+
return React104__default.createElement(
|
|
48188
48000
|
ThreeBoundary,
|
|
48189
48001
|
{ name },
|
|
48190
|
-
|
|
48191
|
-
|
|
48002
|
+
React104__default.createElement(
|
|
48003
|
+
React104__default.Suspense,
|
|
48192
48004
|
{ fallback: null },
|
|
48193
|
-
|
|
48005
|
+
React104__default.createElement(Lazy, props)
|
|
48194
48006
|
)
|
|
48195
48007
|
);
|
|
48196
48008
|
}
|
|
@@ -48351,6 +48163,7 @@ var init_component_registry_generated = __esm({
|
|
|
48351
48163
|
init_Navigation();
|
|
48352
48164
|
init_NegotiatorBoard();
|
|
48353
48165
|
init_NumberStepper();
|
|
48166
|
+
init_ObjectRulePanel();
|
|
48354
48167
|
init_OptionConstraintGroup();
|
|
48355
48168
|
init_OrbitalVisualization();
|
|
48356
48169
|
init_Overlay();
|
|
@@ -48396,7 +48209,6 @@ var init_component_registry_generated = __esm({
|
|
|
48396
48209
|
init_Sidebar();
|
|
48397
48210
|
init_SignaturePad();
|
|
48398
48211
|
init_SimpleGrid();
|
|
48399
|
-
init_SimulationCanvas();
|
|
48400
48212
|
init_SimulatorBoard();
|
|
48401
48213
|
init_Skeleton();
|
|
48402
48214
|
init_SocialProof();
|
|
@@ -48414,6 +48226,7 @@ var init_component_registry_generated = __esm({
|
|
|
48414
48226
|
init_StateArchitectBoard();
|
|
48415
48227
|
init_StateGraph();
|
|
48416
48228
|
init_StateIndicator();
|
|
48229
|
+
init_StateJsonView();
|
|
48417
48230
|
init_StateMachineView();
|
|
48418
48231
|
init_StatsGrid();
|
|
48419
48232
|
init_StatsOrganism();
|
|
@@ -48460,6 +48273,7 @@ var init_component_registry_generated = __esm({
|
|
|
48460
48273
|
init_Typography();
|
|
48461
48274
|
init_UISlotRenderer();
|
|
48462
48275
|
init_UploadDropZone();
|
|
48276
|
+
init_VariablePanel();
|
|
48463
48277
|
init_VersionDiff();
|
|
48464
48278
|
init_ViolationAlert();
|
|
48465
48279
|
init_VoteStack();
|
|
@@ -48467,7 +48281,7 @@ var init_component_registry_generated = __esm({
|
|
|
48467
48281
|
init_WizardContainer();
|
|
48468
48282
|
init_WizardNavigation();
|
|
48469
48283
|
init_WizardProgress();
|
|
48470
|
-
ThreeBoundary = class extends
|
|
48284
|
+
ThreeBoundary = class extends React104__default.Component {
|
|
48471
48285
|
constructor() {
|
|
48472
48286
|
super(...arguments);
|
|
48473
48287
|
__publicField(this, "state", { failed: false });
|
|
@@ -48477,7 +48291,7 @@ var init_component_registry_generated = __esm({
|
|
|
48477
48291
|
}
|
|
48478
48292
|
render() {
|
|
48479
48293
|
if (this.state.failed) {
|
|
48480
|
-
return
|
|
48294
|
+
return React104__default.createElement(
|
|
48481
48295
|
"div",
|
|
48482
48296
|
{
|
|
48483
48297
|
"data-testid": "three-unavailable",
|
|
@@ -48660,6 +48474,7 @@ var init_component_registry_generated = __esm({
|
|
|
48660
48474
|
"Navigation": Navigation,
|
|
48661
48475
|
"NegotiatorBoard": NegotiatorBoard,
|
|
48662
48476
|
"NumberStepper": NumberStepper,
|
|
48477
|
+
"ObjectRulePanel": ObjectRulePanel,
|
|
48663
48478
|
"OptionConstraintGroup": OptionConstraintGroup,
|
|
48664
48479
|
"OrbitalVisualization": OrbitalVisualization,
|
|
48665
48480
|
"Overlay": Overlay,
|
|
@@ -48705,7 +48520,6 @@ var init_component_registry_generated = __esm({
|
|
|
48705
48520
|
"Sidebar": Sidebar,
|
|
48706
48521
|
"SignaturePad": SignaturePad,
|
|
48707
48522
|
"SimpleGrid": SimpleGrid,
|
|
48708
|
-
"SimulationCanvas": SimulationCanvas,
|
|
48709
48523
|
"SimulatorBoard": SimulatorBoard,
|
|
48710
48524
|
"Skeleton": Skeleton,
|
|
48711
48525
|
"SocialProof": SocialProof,
|
|
@@ -48726,6 +48540,7 @@ var init_component_registry_generated = __esm({
|
|
|
48726
48540
|
"StateArchitectBoard": StateArchitectBoard,
|
|
48727
48541
|
"StateGraph": StateGraph,
|
|
48728
48542
|
"StateIndicator": StateIndicator,
|
|
48543
|
+
"StateJsonView": StateJsonView,
|
|
48729
48544
|
"StateMachineView": StateMachineView,
|
|
48730
48545
|
"StatsGrid": StatsGrid,
|
|
48731
48546
|
"StatsOrganism": StatsOrganism,
|
|
@@ -48773,6 +48588,7 @@ var init_component_registry_generated = __esm({
|
|
|
48773
48588
|
"UISlotRenderer": UISlotRenderer,
|
|
48774
48589
|
"UploadDropZone": UploadDropZone,
|
|
48775
48590
|
"VStack": VStack,
|
|
48591
|
+
"VariablePanel": VariablePanel,
|
|
48776
48592
|
"VersionDiff": VersionDiff,
|
|
48777
48593
|
"ViolationAlert": ViolationAlert,
|
|
48778
48594
|
"VoteStack": VoteStack,
|
|
@@ -48798,7 +48614,7 @@ function SuspenseConfigProvider({
|
|
|
48798
48614
|
config,
|
|
48799
48615
|
children
|
|
48800
48616
|
}) {
|
|
48801
|
-
return
|
|
48617
|
+
return React104__default.createElement(
|
|
48802
48618
|
SuspenseConfigContext.Provider,
|
|
48803
48619
|
{ value: config },
|
|
48804
48620
|
children
|
|
@@ -48840,7 +48656,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
48840
48656
|
}
|
|
48841
48657
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
48842
48658
|
}
|
|
48843
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
48659
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React104__default.isValidElement(field) && !(field instanceof Date)) {
|
|
48844
48660
|
const obj = field;
|
|
48845
48661
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
48846
48662
|
if (!fieldName) return field;
|
|
@@ -49293,7 +49109,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
49293
49109
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
49294
49110
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
49295
49111
|
}
|
|
49296
|
-
return /* @__PURE__ */ jsx(
|
|
49112
|
+
return /* @__PURE__ */ jsx(React104__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
49297
49113
|
}
|
|
49298
49114
|
if (!child || typeof child !== "object") return null;
|
|
49299
49115
|
const childId = `${parentId}-${index}`;
|
|
@@ -49333,14 +49149,14 @@ function isPatternConfig(value) {
|
|
|
49333
49149
|
if (value === null || value === void 0) return false;
|
|
49334
49150
|
if (typeof value !== "object") return false;
|
|
49335
49151
|
if (Array.isArray(value)) return false;
|
|
49336
|
-
if (
|
|
49152
|
+
if (React104__default.isValidElement(value)) return false;
|
|
49337
49153
|
if (value instanceof Date) return false;
|
|
49338
49154
|
if (typeof value === "function") return false;
|
|
49339
49155
|
const record = value;
|
|
49340
49156
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
49341
49157
|
}
|
|
49342
49158
|
function isPlainConfigObject(value) {
|
|
49343
|
-
if (
|
|
49159
|
+
if (React104__default.isValidElement(value)) return false;
|
|
49344
49160
|
if (value instanceof Date) return false;
|
|
49345
49161
|
const proto = Object.getPrototypeOf(value);
|
|
49346
49162
|
return proto === Object.prototype || proto === null;
|
|
@@ -49466,7 +49282,7 @@ function SlotContentRenderer({
|
|
|
49466
49282
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
49467
49283
|
const slotVal = restProps[slotKey];
|
|
49468
49284
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
49469
|
-
if (
|
|
49285
|
+
if (React104__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
49470
49286
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
49471
49287
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
49472
49288
|
slotVal,
|
|
@@ -49515,7 +49331,7 @@ function SlotContentRenderer({
|
|
|
49515
49331
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
49516
49332
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
49517
49333
|
const sample = resolvedItems[0];
|
|
49518
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
49334
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React104__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
49519
49335
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
49520
49336
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
49521
49337
|
}
|
|
@@ -49878,7 +49694,7 @@ var AvlTransition = ({
|
|
|
49878
49694
|
opacity = 1,
|
|
49879
49695
|
className
|
|
49880
49696
|
}) => {
|
|
49881
|
-
const ids =
|
|
49697
|
+
const ids = React104__default.useMemo(() => {
|
|
49882
49698
|
avlTransitionId += 1;
|
|
49883
49699
|
return { arrow: `avl-tr-${avlTransitionId}-arrow` };
|
|
49884
49700
|
}, []);
|
|
@@ -50439,7 +50255,7 @@ var AvlStateMachine = ({
|
|
|
50439
50255
|
color = "var(--color-primary)",
|
|
50440
50256
|
animated = false
|
|
50441
50257
|
}) => {
|
|
50442
|
-
const ids =
|
|
50258
|
+
const ids = React104__default.useMemo(() => {
|
|
50443
50259
|
avlSmId += 1;
|
|
50444
50260
|
const base = `avl-sm-${avlSmId}`;
|
|
50445
50261
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -50638,7 +50454,7 @@ var AvlOrbitalUnit = ({
|
|
|
50638
50454
|
color = "var(--color-primary)",
|
|
50639
50455
|
animated = false
|
|
50640
50456
|
}) => {
|
|
50641
|
-
const ids =
|
|
50457
|
+
const ids = React104__default.useMemo(() => {
|
|
50642
50458
|
avlOuId += 1;
|
|
50643
50459
|
const base = `avl-ou-${avlOuId}`;
|
|
50644
50460
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -50734,7 +50550,7 @@ var AvlClosedCircuit = ({
|
|
|
50734
50550
|
color = "var(--color-primary)",
|
|
50735
50551
|
animated = false
|
|
50736
50552
|
}) => {
|
|
50737
|
-
const ids =
|
|
50553
|
+
const ids = React104__default.useMemo(() => {
|
|
50738
50554
|
avlCcId += 1;
|
|
50739
50555
|
const base = `avl-cc-${avlCcId}`;
|
|
50740
50556
|
return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
|
|
@@ -50889,7 +50705,7 @@ var AvlEmitListen = ({
|
|
|
50889
50705
|
color = "var(--color-primary)",
|
|
50890
50706
|
animated = false
|
|
50891
50707
|
}) => {
|
|
50892
|
-
const ids =
|
|
50708
|
+
const ids = React104__default.useMemo(() => {
|
|
50893
50709
|
avlElId += 1;
|
|
50894
50710
|
const base = `avl-el-${avlElId}`;
|
|
50895
50711
|
return { arrow: `${base}-arrow`, grad: `${base}-grad` };
|
|
@@ -51163,7 +50979,7 @@ function renderNode(node, color, glowId) {
|
|
|
51163
50979
|
const baseR = node.type === "operator" ? 20 : 16;
|
|
51164
50980
|
const r2 = Math.max(baseR, labelLen * 3.5 + 6);
|
|
51165
50981
|
const nc = nodeColor(node.type, color);
|
|
51166
|
-
return /* @__PURE__ */ jsxs(
|
|
50982
|
+
return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
|
|
51167
50983
|
node.children.map((child, i) => {
|
|
51168
50984
|
const childR = Math.max(
|
|
51169
50985
|
child.type === "operator" ? 20 : 16,
|
|
@@ -51220,7 +51036,7 @@ var AvlExprTree = ({
|
|
|
51220
51036
|
className,
|
|
51221
51037
|
color = "var(--color-primary)"
|
|
51222
51038
|
}) => {
|
|
51223
|
-
const ids =
|
|
51039
|
+
const ids = React104__default.useMemo(() => {
|
|
51224
51040
|
avlEtId += 1;
|
|
51225
51041
|
return { glow: `avl-et-${avlEtId}-glow` };
|
|
51226
51042
|
}, []);
|
|
@@ -52055,7 +51871,7 @@ var SystemNode = ({ data }) => {
|
|
|
52055
51871
|
stateChain.length > 0 && /* @__PURE__ */ jsx("svg", { width: stateChain.length * 14 + 2, height: 10, viewBox: `0 0 ${stateChain.length * 14 + 2} 10`, children: stateChain.map((s, i) => {
|
|
52056
51872
|
const tc = transitionCounts[s.name] ?? 0;
|
|
52057
51873
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
52058
|
-
return /* @__PURE__ */ jsxs(
|
|
51874
|
+
return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
|
|
52059
51875
|
/* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial ?? void 0, isTerminal: s.isTerminal ?? void 0 }),
|
|
52060
51876
|
i < stateChain.length - 1 && /* @__PURE__ */ jsx("line", { x1: i * 14 + 12, y1: 5, x2: i * 14 + 15, y2: 5, stroke: "var(--color-border)", strokeWidth: 0.5 })
|
|
52061
51877
|
] }, s.name);
|
|
@@ -53200,7 +53016,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
53200
53016
|
if (Array.isArray(body)) {
|
|
53201
53017
|
return body.map((b) => recur(b));
|
|
53202
53018
|
}
|
|
53203
|
-
if (body !== null && typeof body === "object" && !
|
|
53019
|
+
if (body !== null && typeof body === "object" && !React104__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
53204
53020
|
const out = {};
|
|
53205
53021
|
for (const [k, v] of Object.entries(body)) {
|
|
53206
53022
|
out[k] = recur(v);
|
|
@@ -53219,7 +53035,7 @@ function getSlotContentRenderer2() {
|
|
|
53219
53035
|
function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
53220
53036
|
return (item, index) => {
|
|
53221
53037
|
const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
|
|
53222
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
53038
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React104__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
53223
53039
|
return null;
|
|
53224
53040
|
}
|
|
53225
53041
|
const record = resolvedBody;
|
|
@@ -53238,7 +53054,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
53238
53054
|
props: childProps,
|
|
53239
53055
|
priority: 0
|
|
53240
53056
|
};
|
|
53241
|
-
return
|
|
53057
|
+
return React104__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
53242
53058
|
};
|
|
53243
53059
|
}
|
|
53244
53060
|
function convertNode(node, callerKey) {
|
|
@@ -53257,7 +53073,7 @@ function convertNode(node, callerKey) {
|
|
|
53257
53073
|
});
|
|
53258
53074
|
return anyChanged ? mapped : node;
|
|
53259
53075
|
}
|
|
53260
|
-
if (typeof node === "object" && !
|
|
53076
|
+
if (typeof node === "object" && !React104__default.isValidElement(node) && !(node instanceof Date)) {
|
|
53261
53077
|
return convertObjectProps(node);
|
|
53262
53078
|
}
|
|
53263
53079
|
return node;
|
|
@@ -53764,42 +53580,14 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
53764
53580
|
});
|
|
53765
53581
|
}, [executeTransitionEffects]);
|
|
53766
53582
|
useEffect(() => {
|
|
53767
|
-
const
|
|
53768
|
-
(b) => b.trait.ticks?.some((t) => t.interval === "frame")
|
|
53769
|
-
);
|
|
53770
|
-
if (!hasFrameTicks) return;
|
|
53771
|
-
let running = true;
|
|
53772
|
-
let rafId = 0;
|
|
53773
|
-
const frame = () => {
|
|
53774
|
-
if (!running) return;
|
|
53775
|
-
for (const binding of traitBindingsRef.current) {
|
|
53776
|
-
for (const tick of binding.trait.ticks ?? []) {
|
|
53777
|
-
if (tick.interval !== "frame") continue;
|
|
53778
|
-
runTickEffects(tick, binding);
|
|
53779
|
-
}
|
|
53780
|
-
}
|
|
53781
|
-
rafId = requestAnimationFrame(frame);
|
|
53782
|
-
};
|
|
53783
|
-
rafId = requestAnimationFrame(frame);
|
|
53784
|
-
return () => {
|
|
53785
|
-
running = false;
|
|
53786
|
-
cancelAnimationFrame(rafId);
|
|
53787
|
-
};
|
|
53788
|
-
}, [traitBindings, runTickEffects]);
|
|
53789
|
-
useEffect(() => {
|
|
53790
|
-
const intervals = [];
|
|
53583
|
+
const scheduler = createTickScheduler();
|
|
53791
53584
|
for (const binding of traitBindings) {
|
|
53792
53585
|
for (const tick of binding.trait.ticks ?? []) {
|
|
53793
|
-
|
|
53794
|
-
|
|
53795
|
-
intervals.push(setInterval(() => {
|
|
53796
|
-
runTickEffects(tick, binding);
|
|
53797
|
-
}, ms));
|
|
53586
|
+
const intervalMs = tick.interval === "frame" ? 0 : tick.interval;
|
|
53587
|
+
scheduler.add(intervalMs, () => runTickEffects(tick, binding));
|
|
53798
53588
|
}
|
|
53799
53589
|
}
|
|
53800
|
-
return () =>
|
|
53801
|
-
for (const id of intervals) clearInterval(id);
|
|
53802
|
-
};
|
|
53590
|
+
return () => scheduler.stopAll();
|
|
53803
53591
|
}, [traitBindings, runTickEffects]);
|
|
53804
53592
|
const processEventQueued = useCallback(async (eventKey, payload) => {
|
|
53805
53593
|
const normalizedEvent = normalizeEventKey(eventKey);
|
|
@@ -54920,8 +54708,8 @@ function CanvasDndProvider({
|
|
|
54920
54708
|
}) {
|
|
54921
54709
|
const eventBus = useEventBus();
|
|
54922
54710
|
const sensors = useAlmadarDndSensors(false);
|
|
54923
|
-
const [activePayload, setActivePayload] =
|
|
54924
|
-
const handleDragStart =
|
|
54711
|
+
const [activePayload, setActivePayload] = React104__default.useState(null);
|
|
54712
|
+
const handleDragStart = React104__default.useCallback((e) => {
|
|
54925
54713
|
const data = e.active.data.current;
|
|
54926
54714
|
const payload = data?.payload;
|
|
54927
54715
|
if (payload) {
|
|
@@ -54932,7 +54720,7 @@ function CanvasDndProvider({
|
|
|
54932
54720
|
log9.warn("dragStart:missing-payload", { id: e.active.id });
|
|
54933
54721
|
}
|
|
54934
54722
|
}, [eventBus]);
|
|
54935
|
-
const handleDragEnd =
|
|
54723
|
+
const handleDragEnd = React104__default.useCallback((e) => {
|
|
54936
54724
|
setActivePayload(null);
|
|
54937
54725
|
const activeData = e.active.data.current;
|
|
54938
54726
|
const payload = activeData?.payload;
|
|
@@ -54961,7 +54749,7 @@ function CanvasDndProvider({
|
|
|
54961
54749
|
const suppressed = onDrop ? onDrop(drop) === true : false;
|
|
54962
54750
|
if (!suppressed) defaultEmit(eventBus, drop);
|
|
54963
54751
|
}, [eventBus, onDrop]);
|
|
54964
|
-
const handleDragCancel =
|
|
54752
|
+
const handleDragCancel = React104__default.useCallback(() => {
|
|
54965
54753
|
setActivePayload(null);
|
|
54966
54754
|
log9.info("dragCancel");
|
|
54967
54755
|
}, []);
|
|
@@ -55719,7 +55507,7 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
55719
55507
|
}
|
|
55720
55508
|
);
|
|
55721
55509
|
};
|
|
55722
|
-
var OrbPreviewNode =
|
|
55510
|
+
var OrbPreviewNode = React104__default.memo(OrbPreviewNodeInner);
|
|
55723
55511
|
OrbPreviewNode.displayName = "OrbPreviewNode";
|
|
55724
55512
|
orbPreviewLog.debug("export-resolved", () => ({
|
|
55725
55513
|
type: typeof OrbPreviewNode,
|
|
@@ -55824,7 +55612,7 @@ var EventFlowEdgeInner = (props) => {
|
|
|
55824
55612
|
) })
|
|
55825
55613
|
] });
|
|
55826
55614
|
};
|
|
55827
|
-
var EventFlowEdge =
|
|
55615
|
+
var EventFlowEdge = React104__default.memo(EventFlowEdgeInner);
|
|
55828
55616
|
EventFlowEdge.displayName = "EventFlowEdge";
|
|
55829
55617
|
|
|
55830
55618
|
// components/avl/molecules/BehaviorComposeNode.tsx
|
|
@@ -55971,7 +55759,7 @@ var BehaviorComposeNodeInner = (props) => {
|
|
|
55971
55759
|
}
|
|
55972
55760
|
);
|
|
55973
55761
|
};
|
|
55974
|
-
var BehaviorComposeNode =
|
|
55762
|
+
var BehaviorComposeNode = React104__default.memo(BehaviorComposeNodeInner);
|
|
55975
55763
|
BehaviorComposeNode.displayName = "BehaviorComposeNode";
|
|
55976
55764
|
|
|
55977
55765
|
// components/avl/lib/avl-behavior-compose-converter.ts
|
|
@@ -56997,7 +56785,7 @@ var TraitCardNodeInner = (props) => {
|
|
|
56997
56785
|
}
|
|
56998
56786
|
);
|
|
56999
56787
|
};
|
|
57000
|
-
var TraitCardNode =
|
|
56788
|
+
var TraitCardNode = React104__default.memo(TraitCardNodeInner);
|
|
57001
56789
|
TraitCardNode.displayName = "TraitCardNode";
|
|
57002
56790
|
|
|
57003
56791
|
// components/avl/organisms/FlowCanvas.tsx
|
|
@@ -57070,7 +56858,7 @@ function FlowCanvasInner({
|
|
|
57070
56858
|
initialOrbital
|
|
57071
56859
|
);
|
|
57072
56860
|
const [expandedBehaviorAlias, setExpandedBehaviorAlias] = useState(void 0);
|
|
57073
|
-
const screenSizeUserOverrideRef =
|
|
56861
|
+
const screenSizeUserOverrideRef = React104__default.useRef(false);
|
|
57074
56862
|
const [screenSize, setScreenSize] = useState(
|
|
57075
56863
|
() => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
|
|
57076
56864
|
);
|
|
@@ -57454,7 +57242,7 @@ var ZoomBreadcrumb = ({
|
|
|
57454
57242
|
if (eventName && band === "detail") {
|
|
57455
57243
|
segments.push({ icon: "\u26A1", label: eventName });
|
|
57456
57244
|
}
|
|
57457
|
-
return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(
|
|
57245
|
+
return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
|
|
57458
57246
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
|
|
57459
57247
|
/* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
|
|
57460
57248
|
/* @__PURE__ */ jsx("span", { children: seg.label })
|
|
@@ -57795,7 +57583,7 @@ var EventWireOverlay = ({
|
|
|
57795
57583
|
containerW,
|
|
57796
57584
|
containerH
|
|
57797
57585
|
}) => {
|
|
57798
|
-
const ids =
|
|
57586
|
+
const ids = React104__default.useMemo(() => {
|
|
57799
57587
|
avlOczWireId += 1;
|
|
57800
57588
|
return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
|
|
57801
57589
|
}, []);
|
|
@@ -58162,7 +57950,7 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
58162
57950
|
borderRadius: 6,
|
|
58163
57951
|
border: `1px solid ${color}`
|
|
58164
57952
|
},
|
|
58165
|
-
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(
|
|
57953
|
+
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
|
|
58166
57954
|
i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
|
|
58167
57955
|
i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
|
|
58168
57956
|
Box,
|