@almadar/ui 5.79.2 → 5.80.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 +1673 -1590
- package/dist/avl/index.css +3 -3
- package/dist/avl/index.js +464 -381
- package/dist/components/core/atoms/FlipContainer.d.ts +1 -1
- package/dist/components/core/molecules/Card.d.ts +1 -1
- package/dist/components/core/molecules/DataGrid.d.ts +1 -1
- package/dist/components/core/molecules/DataList.d.ts +1 -1
- package/dist/components/core/molecules/DocPagination.d.ts +1 -8
- package/dist/components/core/molecules/DocSearch.d.ts +1 -8
- package/dist/components/core/molecules/FlipCard.d.ts +1 -1
- package/dist/components/core/molecules/MapView.d.ts +1 -18
- package/dist/components/core/molecules/SortableList.d.ts +1 -1
- package/dist/components/core/molecules/TableView.d.ts +1 -1
- package/dist/components/core/molecules/WizardContainer.d.ts +7 -1
- package/dist/components/core/organisms/DataTable.d.ts +1 -1
- package/dist/components/core/organisms/DrawerSlot.d.ts +2 -0
- package/dist/components/core/organisms/ModalSlot.d.ts +2 -0
- package/dist/components/core/organisms/ToastSlot.d.ts +2 -0
- package/dist/components/core/organisms/debug/RuntimeDebugger.d.ts +1 -10
- package/dist/components/core/organisms/debug/tabs/EntitiesTab.d.ts +1 -2
- package/dist/components/core/organisms/debug/tabs/EventDispatcherTab.d.ts +1 -2
- package/dist/components/core/organisms/debug/tabs/EventFlowTab.d.ts +1 -6
- package/dist/components/core/organisms/debug/tabs/GuardsPanel.d.ts +1 -6
- package/dist/components/core/organisms/debug/tabs/ServerBridgeTab.d.ts +1 -12
- package/dist/components/core/organisms/debug/tabs/TicksTab.d.ts +1 -2
- package/dist/components/core/organisms/debug/tabs/TraitsTab.d.ts +1 -2
- package/dist/components/core/organisms/debug/tabs/TransitionTimeline.d.ts +1 -11
- package/dist/components/core/organisms/debug/tabs/VerificationTab.d.ts +1 -8
- package/dist/components/core/templates/CounterTemplate.d.ts +7 -0
- package/dist/components/game/2d/atoms/ActionButton.d.ts +4 -3
- package/dist/components/game/2d/atoms/ChoiceButton.d.ts +4 -3
- package/dist/components/game/2d/atoms/ComboCounter.d.ts +1 -2
- package/dist/components/game/2d/atoms/ControlButton.d.ts +1 -2
- package/dist/components/game/2d/atoms/DamageNumber.d.ts +1 -2
- package/dist/components/game/2d/atoms/DialogueBubble.d.ts +1 -2
- package/dist/components/game/2d/atoms/GameAudioToggle.d.ts +6 -1
- package/dist/components/game/2d/atoms/GameIcon.d.ts +1 -2
- package/dist/components/game/2d/atoms/HealthBar.d.ts +6 -2
- package/dist/components/game/2d/atoms/ItemSlot.d.ts +4 -3
- package/dist/components/game/2d/atoms/MiniMap.d.ts +6 -2
- package/dist/components/game/2d/atoms/ResourceCounter.d.ts +1 -2
- package/dist/components/game/2d/atoms/ScoreDisplay.d.ts +1 -2
- package/dist/components/game/2d/atoms/StatusEffect.d.ts +1 -2
- package/dist/components/game/2d/atoms/TimerDisplay.d.ts +4 -2
- package/dist/components/game/2d/atoms/TurnIndicator.d.ts +1 -2
- package/dist/components/game/2d/atoms/WaypointMarker.d.ts +1 -2
- package/dist/components/game/2d/molecules/ControlGrid.d.ts +3 -1
- package/dist/components/game/2d/molecules/GameHud.d.ts +1 -2
- package/dist/components/game/2d/molecules/GameMenu.d.ts +4 -8
- package/dist/components/game/2d/molecules/InventoryGrid.d.ts +1 -2
- package/dist/components/game/2d/molecules/ResourceBar.d.ts +1 -2
- package/dist/components/game/2d/molecules/StatBadge.d.ts +1 -2
- package/dist/components/game/2d/organisms/CityBuilderBoard.d.ts +2 -0
- package/dist/components/game/2d/organisms/PlatformerBoard.d.ts +3 -1
- package/dist/components/game/2d/organisms/RoguelikeBoard.d.ts +2 -0
- package/dist/components/game/2d/organisms/SequencerBoard.d.ts +5 -1
- package/dist/components/game/2d/organisms/SimulationControls.d.ts +25 -8
- package/dist/components/game/2d/organisms/TanksBoard.d.ts +4 -2
- package/dist/components/game/2d/organisms/TopDownShooterBoard.d.ts +2 -0
- package/dist/components/game/2d/organisms/TowerDefenseBoard.d.ts +2 -0
- package/dist/components/game/2d/organisms/TraitSlot.d.ts +5 -5
- package/dist/components/game/2d/templates/GameShell.d.ts +5 -0
- package/dist/components/game/2d/templates/GameTemplate.d.ts +3 -0
- package/dist/components/game/shared/lib/editorUtils.d.ts +8 -8
- package/dist/components/index.cjs +270 -155
- package/dist/components/index.css +3 -3
- package/dist/components/index.js +272 -157
- package/dist/hooks/useGitHub.d.ts +7 -7
- package/dist/marketing/index.cjs +2 -2
- package/dist/marketing/index.js +2 -2
- package/dist/providers/EventBusProvider.d.ts +1 -1
- package/dist/providers/SelectionProvider.d.ts +1 -1
- package/dist/providers/ServerBridge.d.ts +1 -1
- package/dist/providers/index.cjs +1536 -1453
- package/dist/providers/index.css +3 -3
- package/dist/providers/index.js +436 -353
- package/dist/runtime/index.cjs +1530 -1447
- package/dist/runtime/index.css +3 -3
- package/dist/runtime/index.js +440 -357
- package/package.json +1 -1
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React105 from 'react';
|
|
2
|
+
import React105__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore } from 'react';
|
|
3
3
|
import { EventBusContext, useTraitScope, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath } from '@almadar/ui/providers';
|
|
4
4
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
@@ -12,7 +12,6 @@ import { useTranslate } from '@almadar/ui/hooks';
|
|
|
12
12
|
import { useUISlots, ThemeProvider, useTheme } from '@almadar/ui/context';
|
|
13
13
|
export { DesignThemeProvider, useDesignTheme } from '@almadar/ui/context';
|
|
14
14
|
import { evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
15
|
-
import { getPatternDefinition, getComponentForPattern } from '@almadar/patterns';
|
|
16
15
|
import { Link, Outlet, useLocation } from 'react-router-dom';
|
|
17
16
|
import ELK from 'elkjs/lib/elk.bundled.js';
|
|
18
17
|
import SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light.js';
|
|
@@ -43,6 +42,7 @@ import { DndContext, pointerWithin, rectIntersection, closestCorners, useSensors
|
|
|
43
42
|
import { useSortable, arrayMove, sortableKeyboardCoordinates, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
44
43
|
import { CSS } from '@dnd-kit/utilities';
|
|
45
44
|
import { useNodeId, ReactFlowProvider, Handle, Position } from '@xyflow/react';
|
|
45
|
+
import { getPatternDefinition, getComponentForPattern as getComponentForPattern$1 } from '@almadar/patterns';
|
|
46
46
|
|
|
47
47
|
var __defProp = Object.defineProperty;
|
|
48
48
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -388,7 +388,7 @@ var init_Box = __esm({
|
|
|
388
388
|
fixed: "fixed",
|
|
389
389
|
sticky: "sticky"
|
|
390
390
|
};
|
|
391
|
-
Box =
|
|
391
|
+
Box = React105__default.forwardRef(
|
|
392
392
|
({
|
|
393
393
|
padding,
|
|
394
394
|
paddingX,
|
|
@@ -453,7 +453,7 @@ var init_Box = __esm({
|
|
|
453
453
|
onPointerDown?.(e);
|
|
454
454
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
455
455
|
const isClickable = action || onClick;
|
|
456
|
-
return
|
|
456
|
+
return React105__default.createElement(
|
|
457
457
|
Component,
|
|
458
458
|
{
|
|
459
459
|
ref,
|
|
@@ -549,7 +549,7 @@ function loadLib(key, importer) {
|
|
|
549
549
|
return p2;
|
|
550
550
|
}
|
|
551
551
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
552
|
-
const Lazy =
|
|
552
|
+
const Lazy = React105__default.lazy(async () => {
|
|
553
553
|
const lib = await loadLib(libKey, importer);
|
|
554
554
|
const Comp = pick(lib);
|
|
555
555
|
if (!Comp) {
|
|
@@ -559,7 +559,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
559
559
|
return { default: Comp };
|
|
560
560
|
});
|
|
561
561
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
562
|
-
|
|
562
|
+
React105__default.Suspense,
|
|
563
563
|
{
|
|
564
564
|
fallback: /* @__PURE__ */ jsx(
|
|
565
565
|
"span",
|
|
@@ -1290,7 +1290,7 @@ var init_Icon = __esm({
|
|
|
1290
1290
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1291
1291
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1292
1292
|
const family = useIconFamily();
|
|
1293
|
-
const RenderedComponent =
|
|
1293
|
+
const RenderedComponent = React105__default.useMemo(() => {
|
|
1294
1294
|
if (directIcon) return null;
|
|
1295
1295
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1296
1296
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1352,7 +1352,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1352
1352
|
const IconComp = value;
|
|
1353
1353
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1354
1354
|
}
|
|
1355
|
-
if (
|
|
1355
|
+
if (React105__default.isValidElement(value)) {
|
|
1356
1356
|
return value;
|
|
1357
1357
|
}
|
|
1358
1358
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1428,7 +1428,7 @@ var init_Button = __esm({
|
|
|
1428
1428
|
md: "h-icon-default w-icon-default",
|
|
1429
1429
|
lg: "h-icon-default w-icon-default"
|
|
1430
1430
|
};
|
|
1431
|
-
Button =
|
|
1431
|
+
Button = React105__default.forwardRef(
|
|
1432
1432
|
({
|
|
1433
1433
|
className,
|
|
1434
1434
|
variant = "primary",
|
|
@@ -1494,7 +1494,7 @@ var Dialog;
|
|
|
1494
1494
|
var init_Dialog = __esm({
|
|
1495
1495
|
"components/core/atoms/Dialog.tsx"() {
|
|
1496
1496
|
init_cn();
|
|
1497
|
-
Dialog =
|
|
1497
|
+
Dialog = React105__default.forwardRef(
|
|
1498
1498
|
({
|
|
1499
1499
|
role = "dialog",
|
|
1500
1500
|
"aria-modal": ariaModal = true,
|
|
@@ -1612,7 +1612,7 @@ var init_Typography = __esm({
|
|
|
1612
1612
|
}) => {
|
|
1613
1613
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
1614
1614
|
const Component = as || defaultElements[variant];
|
|
1615
|
-
return
|
|
1615
|
+
return React105__default.createElement(
|
|
1616
1616
|
Component,
|
|
1617
1617
|
{
|
|
1618
1618
|
id,
|
|
@@ -2107,7 +2107,7 @@ var init_Badge = __esm({
|
|
|
2107
2107
|
md: "px-2.5 py-1 text-sm",
|
|
2108
2108
|
lg: "px-3 py-1.5 text-base"
|
|
2109
2109
|
};
|
|
2110
|
-
Badge =
|
|
2110
|
+
Badge = React105__default.forwardRef(
|
|
2111
2111
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2112
2112
|
const iconSizes3 = {
|
|
2113
2113
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2443,7 +2443,7 @@ var init_SvgFlow = __esm({
|
|
|
2443
2443
|
width = 100,
|
|
2444
2444
|
height = 100
|
|
2445
2445
|
}) => {
|
|
2446
|
-
const markerId =
|
|
2446
|
+
const markerId = React105__default.useMemo(() => {
|
|
2447
2447
|
flowIdCounter += 1;
|
|
2448
2448
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2449
2449
|
}, []);
|
|
@@ -3036,7 +3036,7 @@ var init_SvgRing = __esm({
|
|
|
3036
3036
|
width = 100,
|
|
3037
3037
|
height = 100
|
|
3038
3038
|
}) => {
|
|
3039
|
-
const gradientId =
|
|
3039
|
+
const gradientId = React105__default.useMemo(() => {
|
|
3040
3040
|
ringIdCounter += 1;
|
|
3041
3041
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3042
3042
|
}, []);
|
|
@@ -3217,7 +3217,7 @@ var init_Input = __esm({
|
|
|
3217
3217
|
init_cn();
|
|
3218
3218
|
init_Icon();
|
|
3219
3219
|
init_useEventBus();
|
|
3220
|
-
Input =
|
|
3220
|
+
Input = React105__default.forwardRef(
|
|
3221
3221
|
({
|
|
3222
3222
|
className,
|
|
3223
3223
|
inputType,
|
|
@@ -3377,7 +3377,7 @@ var Label;
|
|
|
3377
3377
|
var init_Label = __esm({
|
|
3378
3378
|
"components/core/atoms/Label.tsx"() {
|
|
3379
3379
|
init_cn();
|
|
3380
|
-
Label =
|
|
3380
|
+
Label = React105__default.forwardRef(
|
|
3381
3381
|
({ className, required, children, ...props }, ref) => {
|
|
3382
3382
|
return /* @__PURE__ */ jsxs(
|
|
3383
3383
|
"label",
|
|
@@ -3404,7 +3404,7 @@ var init_Textarea = __esm({
|
|
|
3404
3404
|
"components/core/atoms/Textarea.tsx"() {
|
|
3405
3405
|
init_cn();
|
|
3406
3406
|
init_useEventBus();
|
|
3407
|
-
Textarea =
|
|
3407
|
+
Textarea = React105__default.forwardRef(
|
|
3408
3408
|
({ className, error, onChange, ...props }, ref) => {
|
|
3409
3409
|
const eventBus = useEventBus();
|
|
3410
3410
|
const handleChange = (e) => {
|
|
@@ -3643,7 +3643,7 @@ var init_Select = __esm({
|
|
|
3643
3643
|
init_cn();
|
|
3644
3644
|
init_Icon();
|
|
3645
3645
|
init_useEventBus();
|
|
3646
|
-
Select =
|
|
3646
|
+
Select = React105__default.forwardRef(
|
|
3647
3647
|
(props, _ref) => {
|
|
3648
3648
|
const { multiple, searchable, clearable } = props;
|
|
3649
3649
|
if (multiple || searchable || clearable) {
|
|
@@ -3660,7 +3660,7 @@ var init_Checkbox = __esm({
|
|
|
3660
3660
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3661
3661
|
init_cn();
|
|
3662
3662
|
init_useEventBus();
|
|
3663
|
-
Checkbox =
|
|
3663
|
+
Checkbox = React105__default.forwardRef(
|
|
3664
3664
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
3665
3665
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3666
3666
|
const eventBus = useEventBus();
|
|
@@ -3714,7 +3714,7 @@ var init_Spinner = __esm({
|
|
|
3714
3714
|
md: "h-6 w-6",
|
|
3715
3715
|
lg: "h-8 w-8"
|
|
3716
3716
|
};
|
|
3717
|
-
Spinner =
|
|
3717
|
+
Spinner = React105__default.forwardRef(
|
|
3718
3718
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
3719
3719
|
if (overlay) {
|
|
3720
3720
|
return /* @__PURE__ */ jsx(
|
|
@@ -3804,7 +3804,7 @@ var init_Card = __esm({
|
|
|
3804
3804
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
3805
3805
|
"tile-image-first": "p-0 overflow-hidden"
|
|
3806
3806
|
};
|
|
3807
|
-
Card =
|
|
3807
|
+
Card = React105__default.forwardRef(
|
|
3808
3808
|
({
|
|
3809
3809
|
className,
|
|
3810
3810
|
variant = "bordered",
|
|
@@ -3852,9 +3852,9 @@ var init_Card = __esm({
|
|
|
3852
3852
|
}
|
|
3853
3853
|
);
|
|
3854
3854
|
Card.displayName = "Card";
|
|
3855
|
-
CardHeader =
|
|
3855
|
+
CardHeader = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3856
3856
|
CardHeader.displayName = "CardHeader";
|
|
3857
|
-
CardTitle =
|
|
3857
|
+
CardTitle = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3858
3858
|
"h3",
|
|
3859
3859
|
{
|
|
3860
3860
|
ref,
|
|
@@ -3867,11 +3867,11 @@ var init_Card = __esm({
|
|
|
3867
3867
|
}
|
|
3868
3868
|
));
|
|
3869
3869
|
CardTitle.displayName = "CardTitle";
|
|
3870
|
-
CardContent =
|
|
3870
|
+
CardContent = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3871
3871
|
CardContent.displayName = "CardContent";
|
|
3872
3872
|
CardBody = CardContent;
|
|
3873
3873
|
CardBody.displayName = "CardBody";
|
|
3874
|
-
CardFooter =
|
|
3874
|
+
CardFooter = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3875
3875
|
"div",
|
|
3876
3876
|
{
|
|
3877
3877
|
ref,
|
|
@@ -3926,7 +3926,7 @@ var init_FilterPill = __esm({
|
|
|
3926
3926
|
md: "w-3.5 h-3.5",
|
|
3927
3927
|
lg: "w-4 h-4"
|
|
3928
3928
|
};
|
|
3929
|
-
FilterPill =
|
|
3929
|
+
FilterPill = React105__default.forwardRef(
|
|
3930
3930
|
({
|
|
3931
3931
|
className,
|
|
3932
3932
|
variant = "default",
|
|
@@ -4055,8 +4055,8 @@ var init_Avatar = __esm({
|
|
|
4055
4055
|
actionPayload
|
|
4056
4056
|
}) => {
|
|
4057
4057
|
const eventBus = useEventBus();
|
|
4058
|
-
const [imgFailed, setImgFailed] =
|
|
4059
|
-
|
|
4058
|
+
const [imgFailed, setImgFailed] = React105__default.useState(false);
|
|
4059
|
+
React105__default.useEffect(() => {
|
|
4060
4060
|
setImgFailed(false);
|
|
4061
4061
|
}, [src]);
|
|
4062
4062
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4169,7 +4169,7 @@ var init_Center = __esm({
|
|
|
4169
4169
|
as: Component = "div"
|
|
4170
4170
|
}) => {
|
|
4171
4171
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4172
|
-
return
|
|
4172
|
+
return React105__default.createElement(Component, {
|
|
4173
4173
|
className: cn(
|
|
4174
4174
|
inline ? "inline-flex" : "flex",
|
|
4175
4175
|
horizontal && "justify-center",
|
|
@@ -4437,7 +4437,7 @@ var init_Radio = __esm({
|
|
|
4437
4437
|
md: "w-2.5 h-2.5",
|
|
4438
4438
|
lg: "w-3 h-3"
|
|
4439
4439
|
};
|
|
4440
|
-
Radio =
|
|
4440
|
+
Radio = React105__default.forwardRef(
|
|
4441
4441
|
({
|
|
4442
4442
|
label,
|
|
4443
4443
|
helperText,
|
|
@@ -4454,12 +4454,12 @@ var init_Radio = __esm({
|
|
|
4454
4454
|
onChange,
|
|
4455
4455
|
...props
|
|
4456
4456
|
}, ref) => {
|
|
4457
|
-
const reactId =
|
|
4457
|
+
const reactId = React105__default.useId();
|
|
4458
4458
|
const baseId = id || `radio-${reactId}`;
|
|
4459
4459
|
const hasError = !!error;
|
|
4460
4460
|
const eventBus = useEventBus();
|
|
4461
|
-
const [selected, setSelected] =
|
|
4462
|
-
|
|
4461
|
+
const [selected, setSelected] = React105__default.useState(value);
|
|
4462
|
+
React105__default.useEffect(() => {
|
|
4463
4463
|
if (value !== void 0) setSelected(value);
|
|
4464
4464
|
}, [value]);
|
|
4465
4465
|
const pick = (next, e) => {
|
|
@@ -4641,7 +4641,7 @@ var init_Switch = __esm({
|
|
|
4641
4641
|
"components/core/atoms/Switch.tsx"() {
|
|
4642
4642
|
"use client";
|
|
4643
4643
|
init_cn();
|
|
4644
|
-
Switch =
|
|
4644
|
+
Switch = React105.forwardRef(
|
|
4645
4645
|
({
|
|
4646
4646
|
checked,
|
|
4647
4647
|
defaultChecked = false,
|
|
@@ -4652,10 +4652,10 @@ var init_Switch = __esm({
|
|
|
4652
4652
|
name,
|
|
4653
4653
|
className
|
|
4654
4654
|
}, ref) => {
|
|
4655
|
-
const [isChecked, setIsChecked] =
|
|
4655
|
+
const [isChecked, setIsChecked] = React105.useState(
|
|
4656
4656
|
checked !== void 0 ? checked : defaultChecked
|
|
4657
4657
|
);
|
|
4658
|
-
|
|
4658
|
+
React105.useEffect(() => {
|
|
4659
4659
|
if (checked !== void 0) {
|
|
4660
4660
|
setIsChecked(checked);
|
|
4661
4661
|
}
|
|
@@ -4818,7 +4818,7 @@ var init_Stack = __esm({
|
|
|
4818
4818
|
};
|
|
4819
4819
|
const isHorizontal = direction === "horizontal";
|
|
4820
4820
|
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";
|
|
4821
|
-
return
|
|
4821
|
+
return React105__default.createElement(
|
|
4822
4822
|
Component,
|
|
4823
4823
|
{
|
|
4824
4824
|
className: cn(
|
|
@@ -5018,7 +5018,7 @@ var Aside;
|
|
|
5018
5018
|
var init_Aside = __esm({
|
|
5019
5019
|
"components/core/atoms/Aside.tsx"() {
|
|
5020
5020
|
init_cn();
|
|
5021
|
-
Aside =
|
|
5021
|
+
Aside = React105__default.forwardRef(
|
|
5022
5022
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5023
5023
|
);
|
|
5024
5024
|
Aside.displayName = "Aside";
|
|
@@ -5097,9 +5097,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5097
5097
|
className
|
|
5098
5098
|
}) => {
|
|
5099
5099
|
const { t } = useTranslate();
|
|
5100
|
-
const [isVisible, setIsVisible] =
|
|
5101
|
-
const timeoutRef =
|
|
5102
|
-
const triggerRef =
|
|
5100
|
+
const [isVisible, setIsVisible] = React105__default.useState(false);
|
|
5101
|
+
const timeoutRef = React105__default.useRef(null);
|
|
5102
|
+
const triggerRef = React105__default.useRef(null);
|
|
5103
5103
|
const handleMouseEnter = () => {
|
|
5104
5104
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5105
5105
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5110,7 +5110,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5110
5110
|
};
|
|
5111
5111
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5112
5112
|
const open = isVisible || revealed;
|
|
5113
|
-
|
|
5113
|
+
React105__default.useEffect(() => {
|
|
5114
5114
|
return () => {
|
|
5115
5115
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5116
5116
|
};
|
|
@@ -5320,7 +5320,7 @@ var init_StatusDot = __esm({
|
|
|
5320
5320
|
md: "w-2.5 h-2.5",
|
|
5321
5321
|
lg: "w-3 h-3"
|
|
5322
5322
|
};
|
|
5323
|
-
StatusDot =
|
|
5323
|
+
StatusDot = React105__default.forwardRef(
|
|
5324
5324
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5325
5325
|
return /* @__PURE__ */ jsx(
|
|
5326
5326
|
"span",
|
|
@@ -5374,7 +5374,7 @@ var init_TrendIndicator = __esm({
|
|
|
5374
5374
|
down: "trending-down",
|
|
5375
5375
|
flat: "arrow-right"
|
|
5376
5376
|
};
|
|
5377
|
-
TrendIndicator =
|
|
5377
|
+
TrendIndicator = React105__default.forwardRef(
|
|
5378
5378
|
({
|
|
5379
5379
|
className,
|
|
5380
5380
|
value,
|
|
@@ -5441,7 +5441,7 @@ var init_RangeSlider = __esm({
|
|
|
5441
5441
|
md: "w-4 h-4",
|
|
5442
5442
|
lg: "w-5 h-5"
|
|
5443
5443
|
};
|
|
5444
|
-
RangeSlider =
|
|
5444
|
+
RangeSlider = React105__default.forwardRef(
|
|
5445
5445
|
({
|
|
5446
5446
|
className,
|
|
5447
5447
|
min = 0,
|
|
@@ -6035,7 +6035,7 @@ var init_ContentSection = __esm({
|
|
|
6035
6035
|
md: "py-16",
|
|
6036
6036
|
lg: "py-24"
|
|
6037
6037
|
};
|
|
6038
|
-
ContentSection =
|
|
6038
|
+
ContentSection = React105__default.forwardRef(
|
|
6039
6039
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
6040
6040
|
return /* @__PURE__ */ jsx(
|
|
6041
6041
|
Box,
|
|
@@ -6569,7 +6569,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6569
6569
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6570
6570
|
"none": {}
|
|
6571
6571
|
};
|
|
6572
|
-
AnimatedReveal =
|
|
6572
|
+
AnimatedReveal = React105__default.forwardRef(
|
|
6573
6573
|
({
|
|
6574
6574
|
trigger = "scroll",
|
|
6575
6575
|
animation = "fade-up",
|
|
@@ -6729,7 +6729,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6729
6729
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6730
6730
|
"use client";
|
|
6731
6731
|
init_cn();
|
|
6732
|
-
AnimatedGraphic =
|
|
6732
|
+
AnimatedGraphic = React105__default.forwardRef(
|
|
6733
6733
|
({
|
|
6734
6734
|
src,
|
|
6735
6735
|
svgContent,
|
|
@@ -6752,7 +6752,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6752
6752
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6753
6753
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6754
6754
|
const prevAnimateRef = useRef(animate);
|
|
6755
|
-
const setRef =
|
|
6755
|
+
const setRef = React105__default.useCallback(
|
|
6756
6756
|
(node) => {
|
|
6757
6757
|
containerRef.current = node;
|
|
6758
6758
|
if (typeof ref === "function") ref(node);
|
|
@@ -8372,7 +8372,7 @@ function GameCard({
|
|
|
8372
8372
|
className
|
|
8373
8373
|
}) {
|
|
8374
8374
|
const eventBus = useEventBus();
|
|
8375
|
-
const handleClick =
|
|
8375
|
+
const handleClick = React105.useCallback(() => {
|
|
8376
8376
|
if (disabled) return;
|
|
8377
8377
|
onClick?.(id);
|
|
8378
8378
|
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
|
|
@@ -8458,7 +8458,9 @@ function HealthBar({
|
|
|
8458
8458
|
labelSuffix,
|
|
8459
8459
|
size = "md",
|
|
8460
8460
|
className,
|
|
8461
|
-
animated = true
|
|
8461
|
+
animated = true,
|
|
8462
|
+
frameAsset,
|
|
8463
|
+
fillAsset
|
|
8462
8464
|
}) {
|
|
8463
8465
|
const sizes = sizeMap[size];
|
|
8464
8466
|
const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
|
|
@@ -8477,20 +8479,25 @@ function HealthBar({
|
|
|
8477
8479
|
"div",
|
|
8478
8480
|
{
|
|
8479
8481
|
className: cn(
|
|
8480
|
-
"relative overflow-hidden rounded-full
|
|
8482
|
+
"relative overflow-hidden rounded-full",
|
|
8483
|
+
!frameAsset && "bg-muted",
|
|
8481
8484
|
sizes.bar,
|
|
8482
8485
|
"w-24",
|
|
8483
8486
|
className
|
|
8484
8487
|
),
|
|
8488
|
+
style: frameAsset ? { backgroundImage: `url(${frameAsset.url})`, backgroundSize: "100% 100%" } : void 0,
|
|
8485
8489
|
children: /* @__PURE__ */ jsx(
|
|
8486
8490
|
"div",
|
|
8487
8491
|
{
|
|
8488
8492
|
className: cn(
|
|
8489
8493
|
"absolute inset-y-0 left-0 rounded-full",
|
|
8490
|
-
percentage > 66 ? "bg-success" : percentage > 33 ? "bg-warning" : "bg-error",
|
|
8494
|
+
!fillAsset && (percentage > 66 ? "bg-success" : percentage > 33 ? "bg-warning" : "bg-error"),
|
|
8491
8495
|
animated && "transition-all duration-300"
|
|
8492
8496
|
),
|
|
8493
|
-
style: {
|
|
8497
|
+
style: {
|
|
8498
|
+
width: `${percentage}%`,
|
|
8499
|
+
...fillAsset ? { backgroundImage: `url(${fillAsset.url})`, backgroundSize: "auto 100%" } : {}
|
|
8500
|
+
}
|
|
8494
8501
|
}
|
|
8495
8502
|
)
|
|
8496
8503
|
}
|
|
@@ -8517,18 +8524,23 @@ function HealthBar({
|
|
|
8517
8524
|
"div",
|
|
8518
8525
|
{
|
|
8519
8526
|
className: cn(
|
|
8520
|
-
"relative w-full overflow-hidden rounded-full
|
|
8527
|
+
"relative w-full overflow-hidden rounded-full",
|
|
8528
|
+
!frameAsset && "bg-muted border border-muted",
|
|
8521
8529
|
sizes.bar
|
|
8522
8530
|
),
|
|
8531
|
+
style: frameAsset ? { backgroundImage: `url(${frameAsset.url})`, backgroundSize: "100% 100%" } : void 0,
|
|
8523
8532
|
children: /* @__PURE__ */ jsx(
|
|
8524
8533
|
"div",
|
|
8525
8534
|
{
|
|
8526
8535
|
className: cn(
|
|
8527
8536
|
"absolute inset-y-0 left-0 rounded-full",
|
|
8528
|
-
"bg-gradient-to-r from-accent to-info",
|
|
8537
|
+
!fillAsset && "bg-gradient-to-r from-accent to-info",
|
|
8529
8538
|
animated && "transition-all duration-500 ease-out"
|
|
8530
8539
|
),
|
|
8531
|
-
style: {
|
|
8540
|
+
style: {
|
|
8541
|
+
width: `${percentage}%`,
|
|
8542
|
+
...fillAsset ? { backgroundImage: `url(${fillAsset.url})`, backgroundSize: "auto 100%" } : {}
|
|
8543
|
+
}
|
|
8532
8544
|
}
|
|
8533
8545
|
)
|
|
8534
8546
|
}
|
|
@@ -8644,9 +8656,9 @@ function ControlButton({
|
|
|
8644
8656
|
className
|
|
8645
8657
|
}) {
|
|
8646
8658
|
const eventBus = useEventBus();
|
|
8647
|
-
const [isPressed, setIsPressed] =
|
|
8659
|
+
const [isPressed, setIsPressed] = React105.useState(false);
|
|
8648
8660
|
const actualPressed = pressed ?? isPressed;
|
|
8649
|
-
const handlePointerDown =
|
|
8661
|
+
const handlePointerDown = React105.useCallback(
|
|
8650
8662
|
(e) => {
|
|
8651
8663
|
e.preventDefault();
|
|
8652
8664
|
if (disabled) return;
|
|
@@ -8656,7 +8668,7 @@ function ControlButton({
|
|
|
8656
8668
|
},
|
|
8657
8669
|
[disabled, pressEvent, eventBus, onPress]
|
|
8658
8670
|
);
|
|
8659
|
-
const handlePointerUp =
|
|
8671
|
+
const handlePointerUp = React105.useCallback(
|
|
8660
8672
|
(e) => {
|
|
8661
8673
|
e.preventDefault();
|
|
8662
8674
|
if (disabled) return;
|
|
@@ -8666,7 +8678,7 @@ function ControlButton({
|
|
|
8666
8678
|
},
|
|
8667
8679
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
8668
8680
|
);
|
|
8669
|
-
const handlePointerLeave =
|
|
8681
|
+
const handlePointerLeave = React105.useCallback(
|
|
8670
8682
|
(e) => {
|
|
8671
8683
|
if (isPressed) {
|
|
8672
8684
|
setIsPressed(false);
|
|
@@ -8926,14 +8938,15 @@ function TimerDisplay({
|
|
|
8926
8938
|
format = "mm:ss",
|
|
8927
8939
|
size = "md",
|
|
8928
8940
|
className,
|
|
8929
|
-
lowThreshold
|
|
8941
|
+
lowThreshold,
|
|
8942
|
+
iconAsset
|
|
8930
8943
|
}) {
|
|
8931
8944
|
const isLow = lowThreshold != null && seconds <= lowThreshold && seconds > 0;
|
|
8932
|
-
return /* @__PURE__ */
|
|
8945
|
+
return /* @__PURE__ */ jsxs(
|
|
8933
8946
|
"div",
|
|
8934
8947
|
{
|
|
8935
8948
|
className: cn(
|
|
8936
|
-
"inline-flex items-center justify-center rounded-container",
|
|
8949
|
+
"inline-flex items-center gap-1 justify-center rounded-container",
|
|
8937
8950
|
"bg-card/80 border border-muted font-mono font-bold tabular-nums",
|
|
8938
8951
|
sizeMap4[size],
|
|
8939
8952
|
running && "border-success/50",
|
|
@@ -8941,7 +8954,10 @@ function TimerDisplay({
|
|
|
8941
8954
|
!isLow && "text-foreground",
|
|
8942
8955
|
className
|
|
8943
8956
|
),
|
|
8944
|
-
children:
|
|
8957
|
+
children: [
|
|
8958
|
+
iconAsset && /* @__PURE__ */ jsx("img", { src: iconAsset.url, alt: "", className: "w-4 h-4 object-contain flex-shrink-0" }),
|
|
8959
|
+
formatTime(seconds, format)
|
|
8960
|
+
]
|
|
8945
8961
|
}
|
|
8946
8962
|
);
|
|
8947
8963
|
}
|
|
@@ -9037,15 +9053,20 @@ function ItemSlot({
|
|
|
9037
9053
|
size = "md",
|
|
9038
9054
|
selected,
|
|
9039
9055
|
onClick,
|
|
9056
|
+
action,
|
|
9040
9057
|
className
|
|
9041
9058
|
}) {
|
|
9042
|
-
const
|
|
9059
|
+
const eventBus = useEventBus();
|
|
9060
|
+
const isClickable = onClick != null || action != null;
|
|
9043
9061
|
const px = assetSizeMap[size];
|
|
9044
9062
|
return /* @__PURE__ */ jsx(
|
|
9045
9063
|
"button",
|
|
9046
9064
|
{
|
|
9047
9065
|
type: "button",
|
|
9048
|
-
onClick
|
|
9066
|
+
onClick: () => {
|
|
9067
|
+
if (action) eventBus.emit(`UI:${action}`, {});
|
|
9068
|
+
onClick?.();
|
|
9069
|
+
},
|
|
9049
9070
|
disabled: !isClickable,
|
|
9050
9071
|
title: label,
|
|
9051
9072
|
className: cn(
|
|
@@ -9093,6 +9114,7 @@ var init_ItemSlot = __esm({
|
|
|
9093
9114
|
"use client";
|
|
9094
9115
|
init_cn();
|
|
9095
9116
|
init_Icon();
|
|
9117
|
+
init_useEventBus();
|
|
9096
9118
|
sizeMap6 = {
|
|
9097
9119
|
sm: "w-10 h-10 text-lg",
|
|
9098
9120
|
md: "w-14 h-14 text-2xl",
|
|
@@ -9561,14 +9583,19 @@ function ChoiceButton({
|
|
|
9561
9583
|
disabled = false,
|
|
9562
9584
|
selected = false,
|
|
9563
9585
|
onClick,
|
|
9586
|
+
action,
|
|
9564
9587
|
className
|
|
9565
9588
|
}) {
|
|
9589
|
+
const eventBus = useEventBus();
|
|
9566
9590
|
return /* @__PURE__ */ jsxs(
|
|
9567
9591
|
"button",
|
|
9568
9592
|
{
|
|
9569
9593
|
type: "button",
|
|
9570
9594
|
disabled,
|
|
9571
|
-
onClick
|
|
9595
|
+
onClick: (e) => {
|
|
9596
|
+
if (action) eventBus.emit(`UI:${action}`, {});
|
|
9597
|
+
onClick?.();
|
|
9598
|
+
},
|
|
9572
9599
|
className: cn(
|
|
9573
9600
|
"w-full text-left px-4 py-2.5 rounded-interactive border transition-all duration-150",
|
|
9574
9601
|
"flex items-center gap-2",
|
|
@@ -9616,6 +9643,7 @@ var init_ChoiceButton = __esm({
|
|
|
9616
9643
|
"components/game/2d/atoms/ChoiceButton.tsx"() {
|
|
9617
9644
|
init_cn();
|
|
9618
9645
|
init_Icon();
|
|
9646
|
+
init_useEventBus();
|
|
9619
9647
|
ChoiceButton.displayName = "ChoiceButton";
|
|
9620
9648
|
}
|
|
9621
9649
|
});
|
|
@@ -9629,8 +9657,10 @@ function ActionButton({
|
|
|
9629
9657
|
size = "md",
|
|
9630
9658
|
variant = "primary",
|
|
9631
9659
|
onClick,
|
|
9660
|
+
action,
|
|
9632
9661
|
className
|
|
9633
9662
|
}) {
|
|
9663
|
+
const eventBus = useEventBus();
|
|
9634
9664
|
const sizes = sizeMap12[size];
|
|
9635
9665
|
const onCooldown = cooldown > 0;
|
|
9636
9666
|
const isDisabled = disabled || onCooldown;
|
|
@@ -9640,7 +9670,10 @@ function ActionButton({
|
|
|
9640
9670
|
{
|
|
9641
9671
|
type: "button",
|
|
9642
9672
|
disabled: isDisabled,
|
|
9643
|
-
onClick
|
|
9673
|
+
onClick: (e) => {
|
|
9674
|
+
if (action) eventBus.emit(`UI:${action}`, {});
|
|
9675
|
+
onClick?.();
|
|
9676
|
+
},
|
|
9644
9677
|
className: cn(
|
|
9645
9678
|
"relative inline-flex items-center gap-1.5 rounded-interactive border font-medium overflow-hidden transition-colors duration-150",
|
|
9646
9679
|
sizes.button,
|
|
@@ -9697,6 +9730,7 @@ var init_ActionButton = __esm({
|
|
|
9697
9730
|
"components/game/2d/atoms/ActionButton.tsx"() {
|
|
9698
9731
|
init_cn();
|
|
9699
9732
|
init_Icon();
|
|
9733
|
+
init_useEventBus();
|
|
9700
9734
|
sizeMap12 = {
|
|
9701
9735
|
sm: { button: "h-button-sm px-3 text-xs", hotkey: "text-[9px] px-1", icon: "text-xs" },
|
|
9702
9736
|
md: { button: "h-button-md px-4 text-sm", hotkey: "text-xs px-1.5", icon: "text-sm" },
|
|
@@ -9723,10 +9757,27 @@ function MiniMap({
|
|
|
9723
9757
|
mapWidth = 100,
|
|
9724
9758
|
mapHeight = 100,
|
|
9725
9759
|
viewportRect = DEFAULT_VIEWPORT,
|
|
9726
|
-
className
|
|
9760
|
+
className,
|
|
9761
|
+
tileAssets,
|
|
9762
|
+
unitAssets
|
|
9727
9763
|
}) {
|
|
9728
|
-
const canvasRef =
|
|
9729
|
-
|
|
9764
|
+
const canvasRef = React105.useRef(null);
|
|
9765
|
+
const imgCacheRef = React105.useRef(/* @__PURE__ */ new Map());
|
|
9766
|
+
function loadImg(url) {
|
|
9767
|
+
const cached = imgCacheRef.current.get(url);
|
|
9768
|
+
if (cached) return cached.complete ? cached : null;
|
|
9769
|
+
const img = new Image();
|
|
9770
|
+
img.src = url;
|
|
9771
|
+
img.onload = () => {
|
|
9772
|
+
const canvas = canvasRef.current;
|
|
9773
|
+
if (!canvas) return;
|
|
9774
|
+
const ctx = canvas.getContext("2d");
|
|
9775
|
+
if (ctx) ctx.clearRect(0, 0, 0, 0);
|
|
9776
|
+
};
|
|
9777
|
+
imgCacheRef.current.set(url, img);
|
|
9778
|
+
return null;
|
|
9779
|
+
}
|
|
9780
|
+
React105.useEffect(() => {
|
|
9730
9781
|
const canvas = canvasRef.current;
|
|
9731
9782
|
if (!canvas) return;
|
|
9732
9783
|
const ctx = canvas.getContext("2d");
|
|
@@ -9737,20 +9788,31 @@ function MiniMap({
|
|
|
9737
9788
|
ctx.fillStyle = "#111";
|
|
9738
9789
|
ctx.fillRect(0, 0, width, height);
|
|
9739
9790
|
for (const tile of tiles) {
|
|
9740
|
-
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
)
|
|
9791
|
+
const tileAsset = tileAssets?.[tile.color] ?? tileAssets?.["default"];
|
|
9792
|
+
const tileImg = tileAsset ? loadImg(tileAsset.url) : null;
|
|
9793
|
+
const tx = Math.floor(tile.x * scaleX2);
|
|
9794
|
+
const ty = Math.floor(tile.y * scaleY2);
|
|
9795
|
+
const tw = Math.max(1, Math.ceil(scaleX2));
|
|
9796
|
+
const th = Math.max(1, Math.ceil(scaleY2));
|
|
9797
|
+
if (tileImg) {
|
|
9798
|
+
ctx.drawImage(tileImg, tx, ty, tw, th);
|
|
9799
|
+
} else {
|
|
9800
|
+
ctx.fillStyle = tile.color;
|
|
9801
|
+
ctx.fillRect(tx, ty, tw, th);
|
|
9802
|
+
}
|
|
9747
9803
|
}
|
|
9748
9804
|
for (const unit of units) {
|
|
9749
9805
|
if (unit.isPlayer) continue;
|
|
9750
|
-
|
|
9806
|
+
const unitAsset = unitAssets?.[unit.color] ?? unitAssets?.["default"];
|
|
9807
|
+
const unitImg = unitAsset ? loadImg(unitAsset.url) : null;
|
|
9751
9808
|
const ux = Math.floor(unit.x * scaleX2) - 1;
|
|
9752
9809
|
const uy = Math.floor(unit.y * scaleY2) - 1;
|
|
9753
|
-
|
|
9810
|
+
if (unitImg) {
|
|
9811
|
+
ctx.drawImage(unitImg, ux, uy, 5, 5);
|
|
9812
|
+
} else {
|
|
9813
|
+
ctx.fillStyle = unit.color;
|
|
9814
|
+
ctx.fillRect(ux, uy, 3, 3);
|
|
9815
|
+
}
|
|
9754
9816
|
}
|
|
9755
9817
|
if (viewportRect) {
|
|
9756
9818
|
ctx.strokeStyle = "#ffffff";
|
|
@@ -9762,7 +9824,7 @@ function MiniMap({
|
|
|
9762
9824
|
Math.floor(viewportRect.h * scaleY2)
|
|
9763
9825
|
);
|
|
9764
9826
|
}
|
|
9765
|
-
}, [tiles, units, width, height, mapWidth, mapHeight, viewportRect]);
|
|
9827
|
+
}, [tiles, units, width, height, mapWidth, mapHeight, viewportRect, tileAssets, unitAssets]);
|
|
9766
9828
|
const scaleX = width / mapWidth;
|
|
9767
9829
|
const scaleY = height / mapHeight;
|
|
9768
9830
|
const playerUnit = units.find((u) => u.isPlayer);
|
|
@@ -9871,13 +9933,14 @@ function ControlGrid({
|
|
|
9871
9933
|
actionEvent,
|
|
9872
9934
|
onDirection,
|
|
9873
9935
|
directionEvent,
|
|
9936
|
+
directionAssets,
|
|
9874
9937
|
size = "md",
|
|
9875
9938
|
disabled,
|
|
9876
9939
|
className
|
|
9877
9940
|
}) {
|
|
9878
9941
|
const eventBus = useEventBus();
|
|
9879
|
-
const [active, setActive] =
|
|
9880
|
-
const handlePress =
|
|
9942
|
+
const [active, setActive] = React105.useState(/* @__PURE__ */ new Set());
|
|
9943
|
+
const handlePress = React105.useCallback(
|
|
9881
9944
|
(id) => {
|
|
9882
9945
|
setActive((prev) => new Set(prev).add(id));
|
|
9883
9946
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9889,7 +9952,7 @@ function ControlGrid({
|
|
|
9889
9952
|
},
|
|
9890
9953
|
[kind, actionEvent, directionEvent, eventBus, onAction, onDirection]
|
|
9891
9954
|
);
|
|
9892
|
-
const handleRelease =
|
|
9955
|
+
const handleRelease = React105.useCallback(
|
|
9893
9956
|
(id) => {
|
|
9894
9957
|
setActive((prev) => {
|
|
9895
9958
|
const next = new Set(prev);
|
|
@@ -9910,7 +9973,8 @@ function ControlGrid({
|
|
|
9910
9973
|
const dir = (d) => /* @__PURE__ */ jsx(
|
|
9911
9974
|
ControlButton,
|
|
9912
9975
|
{
|
|
9913
|
-
icon: arrowIcons[d],
|
|
9976
|
+
icon: directionAssets?.[d] ? void 0 : arrowIcons[d],
|
|
9977
|
+
assetUrl: directionAssets?.[d],
|
|
9914
9978
|
size: sizeKey[size],
|
|
9915
9979
|
variant: "secondary",
|
|
9916
9980
|
pressed: active.has(d),
|
|
@@ -10150,11 +10214,11 @@ function InventoryGrid({
|
|
|
10150
10214
|
const eventBus = useEventBus();
|
|
10151
10215
|
const slotCount = totalSlots ?? items.length;
|
|
10152
10216
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
10153
|
-
const handleSelect =
|
|
10217
|
+
const handleSelect = React105.useCallback(
|
|
10154
10218
|
(id) => {
|
|
10155
10219
|
onSelect?.(id);
|
|
10156
10220
|
if (selectEvent) {
|
|
10157
|
-
eventBus.emit(selectEvent
|
|
10221
|
+
eventBus.emit(`UI:${selectEvent}`, { id });
|
|
10158
10222
|
}
|
|
10159
10223
|
},
|
|
10160
10224
|
[onSelect, selectEvent, eventBus]
|
|
@@ -10359,27 +10423,21 @@ function GameMenu({
|
|
|
10359
10423
|
options,
|
|
10360
10424
|
menuItems,
|
|
10361
10425
|
onSelect,
|
|
10362
|
-
eventBus: eventBusProp,
|
|
10363
10426
|
background,
|
|
10364
|
-
logo
|
|
10427
|
+
logo,
|
|
10365
10428
|
className
|
|
10366
10429
|
}) {
|
|
10367
10430
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
10368
|
-
|
|
10369
|
-
|
|
10370
|
-
eventBusFromHook = useEventBus();
|
|
10371
|
-
} catch {
|
|
10372
|
-
}
|
|
10373
|
-
const eventBus = eventBusProp || eventBusFromHook;
|
|
10374
|
-
const handleOptionClick = React107.useCallback(
|
|
10431
|
+
const eventBus = useEventBus();
|
|
10432
|
+
const handleOptionClick = React105.useCallback(
|
|
10375
10433
|
(option) => {
|
|
10376
|
-
if (option.event
|
|
10434
|
+
if (option.event) {
|
|
10377
10435
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
10378
10436
|
}
|
|
10379
10437
|
if (onSelect) {
|
|
10380
10438
|
onSelect(option);
|
|
10381
10439
|
}
|
|
10382
|
-
if (option.navigatesTo
|
|
10440
|
+
if (option.navigatesTo) {
|
|
10383
10441
|
eventBus.emit("UI:NAVIGATE", { url: option.navigatesTo, option });
|
|
10384
10442
|
}
|
|
10385
10443
|
},
|
|
@@ -10400,7 +10458,7 @@ function GameMenu({
|
|
|
10400
10458
|
logo && /* @__PURE__ */ jsx(
|
|
10401
10459
|
"img",
|
|
10402
10460
|
{
|
|
10403
|
-
src: logo,
|
|
10461
|
+
src: logo.url,
|
|
10404
10462
|
alt: title,
|
|
10405
10463
|
className: "h-24 w-auto mx-auto mb-6 drop-shadow-2xl"
|
|
10406
10464
|
}
|
|
@@ -12234,7 +12292,9 @@ var init_GameAudioProvider = __esm({
|
|
|
12234
12292
|
});
|
|
12235
12293
|
function GameAudioToggle({
|
|
12236
12294
|
size = "sm",
|
|
12237
|
-
className
|
|
12295
|
+
className,
|
|
12296
|
+
onAsset,
|
|
12297
|
+
offAsset
|
|
12238
12298
|
}) {
|
|
12239
12299
|
const ctx = useGameAudioContextOptional();
|
|
12240
12300
|
const [localMuted, setLocalMuted] = useState(false);
|
|
@@ -12243,6 +12303,7 @@ function GameAudioToggle({
|
|
|
12243
12303
|
const handleToggle = useCallback(() => {
|
|
12244
12304
|
setMuted(!muted);
|
|
12245
12305
|
}, [muted, setMuted]);
|
|
12306
|
+
const activeAsset = muted ? offAsset : onAsset;
|
|
12246
12307
|
return /* @__PURE__ */ jsx(
|
|
12247
12308
|
Button,
|
|
12248
12309
|
{
|
|
@@ -12251,7 +12312,7 @@ function GameAudioToggle({
|
|
|
12251
12312
|
onClick: handleToggle,
|
|
12252
12313
|
className: cn("text-lg leading-none px-2", className),
|
|
12253
12314
|
"aria-pressed": muted,
|
|
12254
|
-
children: muted ? "\u{1F507}" : "\u{1F50A}"
|
|
12315
|
+
children: activeAsset ? /* @__PURE__ */ jsx("img", { src: activeAsset.url, alt: muted ? "Muted" : "Sound on", className: "w-5 h-5 object-contain" }) : muted ? "\u{1F507}" : "\u{1F50A}"
|
|
12255
12316
|
}
|
|
12256
12317
|
);
|
|
12257
12318
|
}
|
|
@@ -13543,6 +13604,7 @@ function PlatformerBoard({
|
|
|
13543
13604
|
canvasHeight: _canvasHeight = 400,
|
|
13544
13605
|
playerSprite,
|
|
13545
13606
|
tileSprites,
|
|
13607
|
+
ui: _ui,
|
|
13546
13608
|
bgColor: _bgColor,
|
|
13547
13609
|
keyEvent = "KEY",
|
|
13548
13610
|
playAgainEvent = "PLAY_AGAIN",
|
|
@@ -15401,6 +15463,7 @@ function TanksBoard({
|
|
|
15401
15463
|
features,
|
|
15402
15464
|
assetManifest,
|
|
15403
15465
|
assetBaseUrl,
|
|
15466
|
+
ui: _ui,
|
|
15404
15467
|
scale = 0.45,
|
|
15405
15468
|
showMinimap = true,
|
|
15406
15469
|
enableCamera = true,
|
|
@@ -15928,7 +15991,7 @@ function LinearView({
|
|
|
15928
15991
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
15929
15992
|
const isDone = i < currentIdx;
|
|
15930
15993
|
const isCurrent = i === currentIdx;
|
|
15931
|
-
return /* @__PURE__ */ jsxs(
|
|
15994
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
15932
15995
|
i > 0 && /* @__PURE__ */ jsx(
|
|
15933
15996
|
Typography,
|
|
15934
15997
|
{
|
|
@@ -16149,7 +16212,7 @@ function TraitSlot({
|
|
|
16149
16212
|
size = "md",
|
|
16150
16213
|
showTooltip = true,
|
|
16151
16214
|
categoryColors,
|
|
16152
|
-
tooltipFrameUrl
|
|
16215
|
+
tooltipFrameUrl,
|
|
16153
16216
|
className,
|
|
16154
16217
|
feedback,
|
|
16155
16218
|
onItemDrop,
|
|
@@ -16279,7 +16342,7 @@ function TraitSlot({
|
|
|
16279
16342
|
as: "img",
|
|
16280
16343
|
className: "object-contain",
|
|
16281
16344
|
style: { width: config.icon, height: config.icon },
|
|
16282
|
-
...{ src: equippedItem.iconUrl, alt: equippedItem.name }
|
|
16345
|
+
...{ src: equippedItem.iconUrl.url, alt: equippedItem.name }
|
|
16283
16346
|
}
|
|
16284
16347
|
) : /* @__PURE__ */ jsx(Typography, { variant: "body1", className: "text-center leading-none", style: { fontSize: config.icon }, children: equippedItem.iconEmoji || "\u2726" }),
|
|
16285
16348
|
(onRemove || removeEvent) && /* @__PURE__ */ jsx(
|
|
@@ -16308,7 +16371,7 @@ function TraitSlot({
|
|
|
16308
16371
|
...getTooltipStyle(),
|
|
16309
16372
|
minWidth: 200,
|
|
16310
16373
|
...tooltipFrameUrl ? {
|
|
16311
|
-
borderImage: `url(${tooltipFrameUrl}) 60 fill / 15px / 0 stretch`,
|
|
16374
|
+
borderImage: `url(${tooltipFrameUrl.url}) 60 fill / 15px / 0 stretch`,
|
|
16312
16375
|
border: "none"
|
|
16313
16376
|
} : {}
|
|
16314
16377
|
},
|
|
@@ -16383,7 +16446,7 @@ function ActionTile({
|
|
|
16383
16446
|
draggable: !disabled,
|
|
16384
16447
|
onDragStart: handleDragStart,
|
|
16385
16448
|
children: [
|
|
16386
|
-
action.iconUrl ? /* @__PURE__ */ jsx("img", { src: action.iconUrl, alt: "", className: "w-8 h-8 object-contain" }) : /* @__PURE__ */ jsx(Typography, { variant: "body1", className: cn(config.icon, "leading-none"), children: action.iconEmoji || "\u2726" }),
|
|
16449
|
+
action.iconUrl ? /* @__PURE__ */ jsx("img", { src: action.iconUrl.url, alt: "", className: "w-8 h-8 object-contain" }) : /* @__PURE__ */ jsx(Typography, { variant: "body1", className: cn(config.icon, "leading-none"), children: action.iconEmoji || "\u2726" }),
|
|
16387
16450
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: cn(config.text, "text-foreground font-medium whitespace-nowrap"), children: action.name })
|
|
16388
16451
|
]
|
|
16389
16452
|
}
|
|
@@ -16456,7 +16519,7 @@ function SequenceBar({
|
|
|
16456
16519
|
onSlotRemove(index);
|
|
16457
16520
|
}, [onSlotRemove, playing]);
|
|
16458
16521
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
16459
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
16522
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
16460
16523
|
i > 0 && /* @__PURE__ */ jsx(
|
|
16461
16524
|
Typography,
|
|
16462
16525
|
{
|
|
@@ -16507,6 +16570,42 @@ function computeSlotFeedback(playerSeq, solutions) {
|
|
|
16507
16570
|
(id, i) => id !== void 0 && id === bestSolution[i] ? "correct" : "wrong"
|
|
16508
16571
|
);
|
|
16509
16572
|
}
|
|
16573
|
+
function isFieldRecord(v) {
|
|
16574
|
+
return typeof v === "object" && v !== null && !Array.isArray(v) && !(v instanceof Date);
|
|
16575
|
+
}
|
|
16576
|
+
function assetFromField(v) {
|
|
16577
|
+
if (!isFieldRecord(v)) return void 0;
|
|
16578
|
+
const url = typeof v.url === "string" ? v.url : void 0;
|
|
16579
|
+
const role = typeof v.role === "string" ? v.role : void 0;
|
|
16580
|
+
const category = typeof v.category === "string" ? v.category : "";
|
|
16581
|
+
if (!url || !role) return void 0;
|
|
16582
|
+
return {
|
|
16583
|
+
url,
|
|
16584
|
+
role,
|
|
16585
|
+
category,
|
|
16586
|
+
name: typeof v.name === "string" ? v.name : void 0,
|
|
16587
|
+
thumbnailUrl: typeof v.thumbnailUrl === "string" ? v.thumbnailUrl : void 0,
|
|
16588
|
+
style: typeof v.style === "string" ? v.style : void 0,
|
|
16589
|
+
variant: typeof v.variant === "string" ? v.variant : void 0,
|
|
16590
|
+
dimension: typeof v.dimension === "string" ? v.dimension : void 0,
|
|
16591
|
+
aspect: typeof v.aspect === "string" ? v.aspect : void 0
|
|
16592
|
+
};
|
|
16593
|
+
}
|
|
16594
|
+
function slotItemFromField(fv) {
|
|
16595
|
+
if (!isFieldRecord(fv)) return void 0;
|
|
16596
|
+
const id = typeof fv.id === "string" ? fv.id : void 0;
|
|
16597
|
+
const name = typeof fv.name === "string" ? fv.name : void 0;
|
|
16598
|
+
const category = typeof fv.category === "string" ? fv.category : void 0;
|
|
16599
|
+
if (!id || !name || !category) return void 0;
|
|
16600
|
+
return {
|
|
16601
|
+
id,
|
|
16602
|
+
name,
|
|
16603
|
+
category,
|
|
16604
|
+
description: typeof fv.description === "string" ? fv.description : void 0,
|
|
16605
|
+
iconEmoji: typeof fv.iconEmoji === "string" ? fv.iconEmoji : void 0,
|
|
16606
|
+
iconUrl: assetFromField(fv.iconUrl)
|
|
16607
|
+
};
|
|
16608
|
+
}
|
|
16510
16609
|
function SequencerBoard({
|
|
16511
16610
|
entity,
|
|
16512
16611
|
categoryColors,
|
|
@@ -16517,6 +16616,7 @@ function SequencerBoard({
|
|
|
16517
16616
|
removeEvent,
|
|
16518
16617
|
checkEvent,
|
|
16519
16618
|
playAgainEvent,
|
|
16619
|
+
stepEvent,
|
|
16520
16620
|
className
|
|
16521
16621
|
}) {
|
|
16522
16622
|
const { emit } = useEventBus();
|
|
@@ -16524,7 +16624,11 @@ function SequencerBoard({
|
|
|
16524
16624
|
const resolved = boardEntity(entity);
|
|
16525
16625
|
const maxSlots = num(resolved?.maxSlots) || 3;
|
|
16526
16626
|
const solutions = Array.isArray(resolved?.solutions) ? resolved.solutions : [];
|
|
16527
|
-
const availableActions = Array.isArray(resolved?.availableActions) ? resolved.availableActions : []
|
|
16627
|
+
const availableActions = (Array.isArray(resolved?.availableActions) ? resolved.availableActions : []).reduce((acc, fv) => {
|
|
16628
|
+
const item = slotItemFromField(fv);
|
|
16629
|
+
if (item) acc.push(item);
|
|
16630
|
+
return acc;
|
|
16631
|
+
}, []);
|
|
16528
16632
|
const allowDuplicates = resolved?.allowDuplicates !== false;
|
|
16529
16633
|
const entitySlots = Array.isArray(resolved?.slots) ? resolved.slots : [];
|
|
16530
16634
|
const entityResult = str(resolved?.result);
|
|
@@ -16582,7 +16686,7 @@ function SequencerBoard({
|
|
|
16582
16686
|
let step = 0;
|
|
16583
16687
|
const advance = () => {
|
|
16584
16688
|
step++;
|
|
16585
|
-
emit(
|
|
16689
|
+
if (stepEvent) emit(`UI:${stepEvent}`, { step });
|
|
16586
16690
|
if (step >= maxSlots) {
|
|
16587
16691
|
if (checkEvent) emit(`UI:${checkEvent}`, { sequence: playerIds });
|
|
16588
16692
|
const playerSeq = slots.map((s) => s?.id);
|
|
@@ -18807,35 +18911,7 @@ var init_SimulationCanvas = __esm({
|
|
|
18807
18911
|
SimulationCanvas.displayName = "SimulationCanvas";
|
|
18808
18912
|
}
|
|
18809
18913
|
});
|
|
18810
|
-
|
|
18811
|
-
if (_scr) return _scr;
|
|
18812
|
-
const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
|
|
18813
|
-
_scr = mod.SlotContentRenderer;
|
|
18814
|
-
return _scr;
|
|
18815
|
-
}
|
|
18816
|
-
function resolveDescriptor(value, idPrefix) {
|
|
18817
|
-
if (value === null || value === void 0) return value;
|
|
18818
|
-
if (React107__default.isValidElement(value)) return value;
|
|
18819
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
|
|
18820
|
-
if (Array.isArray(value)) {
|
|
18821
|
-
return value.map((item, i) => /* @__PURE__ */ jsx(React107__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
|
|
18822
|
-
}
|
|
18823
|
-
if (typeof value === "object") {
|
|
18824
|
-
const rec = value;
|
|
18825
|
-
if (typeof rec.type === "string" && getComponentForPattern(rec.type) !== null) {
|
|
18826
|
-
const type = rec.type;
|
|
18827
|
-
const _id = typeof rec._id === "string" ? rec._id : void 0;
|
|
18828
|
-
const nestedProps = rec.props !== void 0 && typeof rec.props === "object" && !Array.isArray(rec.props) && rec.props !== null ? rec.props : void 0;
|
|
18829
|
-
const { type: _t, props: _p, _id: _d, ...flatRest } = rec;
|
|
18830
|
-
const resolvedProps = nestedProps !== void 0 ? nestedProps : flatRest;
|
|
18831
|
-
const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
|
|
18832
|
-
const SCR = getSlotContentRenderer2();
|
|
18833
|
-
return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
|
|
18834
|
-
}
|
|
18835
|
-
}
|
|
18836
|
-
return null;
|
|
18837
|
-
}
|
|
18838
|
-
var _scr, GameTemplate;
|
|
18914
|
+
var GameTemplate;
|
|
18839
18915
|
var init_GameTemplate = __esm({
|
|
18840
18916
|
"components/game/2d/templates/GameTemplate.tsx"() {
|
|
18841
18917
|
init_cn();
|
|
@@ -18843,7 +18919,6 @@ var init_GameTemplate = __esm({
|
|
|
18843
18919
|
init_Stack();
|
|
18844
18920
|
init_Typography();
|
|
18845
18921
|
init_Button();
|
|
18846
|
-
_scr = null;
|
|
18847
18922
|
GameTemplate = ({
|
|
18848
18923
|
entity,
|
|
18849
18924
|
title = "Game",
|
|
@@ -18852,7 +18927,8 @@ var init_GameTemplate = __esm({
|
|
|
18852
18927
|
debugPanel,
|
|
18853
18928
|
showDebugPanel = false,
|
|
18854
18929
|
controls,
|
|
18855
|
-
className
|
|
18930
|
+
className,
|
|
18931
|
+
backgroundAsset
|
|
18856
18932
|
}) => {
|
|
18857
18933
|
return /* @__PURE__ */ jsxs(
|
|
18858
18934
|
Box,
|
|
@@ -18909,15 +18985,16 @@ var init_GameTemplate = __esm({
|
|
|
18909
18985
|
{
|
|
18910
18986
|
position: "relative",
|
|
18911
18987
|
fullWidth: true,
|
|
18912
|
-
className: "flex-1 bg-muted",
|
|
18988
|
+
className: backgroundAsset ? "flex-1" : "flex-1 bg-muted",
|
|
18989
|
+
style: backgroundAsset ? { backgroundImage: `url(${backgroundAsset.url})`, backgroundSize: "cover", backgroundPosition: "center" } : void 0,
|
|
18913
18990
|
children: [
|
|
18914
|
-
|
|
18991
|
+
children,
|
|
18915
18992
|
hud && /* @__PURE__ */ jsx(
|
|
18916
18993
|
Box,
|
|
18917
18994
|
{
|
|
18918
18995
|
position: "absolute",
|
|
18919
18996
|
className: "top-0 left-0 right-0 pointer-events-none",
|
|
18920
|
-
children: /* @__PURE__ */ jsx(Box, { padding: "md", className: "pointer-events-auto w-fit", children:
|
|
18997
|
+
children: /* @__PURE__ */ jsx(Box, { padding: "md", className: "pointer-events-auto w-fit", children: hud })
|
|
18921
18998
|
}
|
|
18922
18999
|
)
|
|
18923
19000
|
]
|
|
@@ -18942,7 +19019,7 @@ var init_GameTemplate = __esm({
|
|
|
18942
19019
|
children: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Debug Panel" })
|
|
18943
19020
|
}
|
|
18944
19021
|
),
|
|
18945
|
-
/* @__PURE__ */ jsx(Box, { padding: "md", children:
|
|
19022
|
+
/* @__PURE__ */ jsx(Box, { padding: "md", children: debugPanel })
|
|
18946
19023
|
]
|
|
18947
19024
|
}
|
|
18948
19025
|
)
|
|
@@ -18953,59 +19030,21 @@ var init_GameTemplate = __esm({
|
|
|
18953
19030
|
GameTemplate.displayName = "GameTemplate";
|
|
18954
19031
|
}
|
|
18955
19032
|
});
|
|
18956
|
-
|
|
18957
|
-
if (Array.isArray(v) || React107__default.isValidElement(v)) return null;
|
|
18958
|
-
const o = v;
|
|
18959
|
-
if (typeof o.type !== "string") return null;
|
|
18960
|
-
const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
|
|
18961
|
-
const _id = typeof o._id === "string" ? o._id : void 0;
|
|
18962
|
-
const sourceTrait = typeof o.sourceTrait === "string" ? o.sourceTrait : void 0;
|
|
18963
|
-
return { type: o.type, props, _id, sourceTrait };
|
|
18964
|
-
}
|
|
18965
|
-
function getSlotContentRenderer3() {
|
|
18966
|
-
if (_scr2) return _scr2;
|
|
18967
|
-
const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
|
|
18968
|
-
_scr2 = mod.SlotContentRenderer;
|
|
18969
|
-
return _scr2;
|
|
18970
|
-
}
|
|
18971
|
-
function resolveDescriptor2(value, idPrefix) {
|
|
18972
|
-
if (value === null || value === void 0) return value;
|
|
18973
|
-
if (React107__default.isValidElement(value)) return value;
|
|
18974
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
|
|
18975
|
-
if (Array.isArray(value)) {
|
|
18976
|
-
return value.map((item, i) => /* @__PURE__ */ jsx(React107__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
|
|
18977
|
-
}
|
|
18978
|
-
if (typeof value === "object" && value !== null) {
|
|
18979
|
-
const desc = asDescriptor(value);
|
|
18980
|
-
if (desc !== null && getComponentForPattern(desc.type) !== null) {
|
|
18981
|
-
const resolvedProps = desc.props ?? {};
|
|
18982
|
-
const content = {
|
|
18983
|
-
id: desc._id ?? idPrefix,
|
|
18984
|
-
pattern: desc.type,
|
|
18985
|
-
props: resolvedProps,
|
|
18986
|
-
priority: 0,
|
|
18987
|
-
...desc.sourceTrait !== void 0 && { sourceTrait: desc.sourceTrait }
|
|
18988
|
-
};
|
|
18989
|
-
const SCR = getSlotContentRenderer3();
|
|
18990
|
-
return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 }, content.id);
|
|
18991
|
-
}
|
|
18992
|
-
}
|
|
18993
|
-
return null;
|
|
18994
|
-
}
|
|
18995
|
-
var _scr2, GameShell;
|
|
19033
|
+
var GameShell;
|
|
18996
19034
|
var init_GameShell = __esm({
|
|
18997
19035
|
"components/game/2d/templates/GameShell.tsx"() {
|
|
18998
19036
|
init_cn();
|
|
18999
19037
|
init_Box();
|
|
19000
19038
|
init_Stack();
|
|
19001
19039
|
init_Typography();
|
|
19002
|
-
_scr2 = null;
|
|
19003
19040
|
GameShell = ({
|
|
19004
19041
|
appName = "Game",
|
|
19005
19042
|
hud,
|
|
19006
19043
|
className,
|
|
19007
19044
|
showTopBar = true,
|
|
19008
|
-
children
|
|
19045
|
+
children,
|
|
19046
|
+
backgroundAsset,
|
|
19047
|
+
hudBackgroundAsset
|
|
19009
19048
|
}) => {
|
|
19010
19049
|
return /* @__PURE__ */ jsxs(
|
|
19011
19050
|
Box,
|
|
@@ -19020,7 +19059,7 @@ var init_GameShell = __esm({
|
|
|
19020
19059
|
width: "100vw",
|
|
19021
19060
|
height: "100vh",
|
|
19022
19061
|
overflow: "hidden",
|
|
19023
|
-
background: "var(--color-background, #0a0a0f)",
|
|
19062
|
+
background: backgroundAsset ? `url(${backgroundAsset.url}) center/cover no-repeat` : "var(--color-background, #0a0a0f)",
|
|
19024
19063
|
color: "var(--color-text, #e0e0e0)"
|
|
19025
19064
|
},
|
|
19026
19065
|
children: [
|
|
@@ -19030,7 +19069,7 @@ var init_GameShell = __esm({
|
|
|
19030
19069
|
className: "game-shell__header",
|
|
19031
19070
|
style: {
|
|
19032
19071
|
flexShrink: 0,
|
|
19033
|
-
background: "var(--color-surface, #12121f)",
|
|
19072
|
+
background: hudBackgroundAsset ? `url(${hudBackgroundAsset.url}) center/cover no-repeat` : "var(--color-surface, #12121f)",
|
|
19034
19073
|
borderBottom: "1px solid var(--color-border, #2a2a3a)"
|
|
19035
19074
|
},
|
|
19036
19075
|
children: [
|
|
@@ -19053,7 +19092,7 @@ var init_GameShell = __esm({
|
|
|
19053
19092
|
)
|
|
19054
19093
|
}
|
|
19055
19094
|
),
|
|
19056
|
-
hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", style: { width: "100%" }, children:
|
|
19095
|
+
hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", style: { width: "100%" }, children: hud })
|
|
19057
19096
|
]
|
|
19058
19097
|
}
|
|
19059
19098
|
),
|
|
@@ -19066,7 +19105,7 @@ var init_GameShell = __esm({
|
|
|
19066
19105
|
overflow: "hidden",
|
|
19067
19106
|
position: "relative"
|
|
19068
19107
|
},
|
|
19069
|
-
children
|
|
19108
|
+
children
|
|
19070
19109
|
}
|
|
19071
19110
|
)
|
|
19072
19111
|
]
|
|
@@ -20273,7 +20312,7 @@ var init_ErrorBoundary = __esm({
|
|
|
20273
20312
|
}
|
|
20274
20313
|
);
|
|
20275
20314
|
};
|
|
20276
|
-
ErrorBoundary = class extends
|
|
20315
|
+
ErrorBoundary = class extends React105__default.Component {
|
|
20277
20316
|
constructor(props) {
|
|
20278
20317
|
super(props);
|
|
20279
20318
|
__publicField(this, "reset", () => {
|
|
@@ -20938,7 +20977,7 @@ var init_Container = __esm({
|
|
|
20938
20977
|
as: Component = "div"
|
|
20939
20978
|
}) => {
|
|
20940
20979
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
20941
|
-
return
|
|
20980
|
+
return React105__default.createElement(
|
|
20942
20981
|
Component,
|
|
20943
20982
|
{
|
|
20944
20983
|
className: cn(
|
|
@@ -23120,9 +23159,9 @@ var init_BiologyCanvas = __esm({
|
|
|
23120
23159
|
}
|
|
23121
23160
|
});
|
|
23122
23161
|
|
|
23123
|
-
// node_modules
|
|
23162
|
+
// node_modules/katex/dist/katex.min.css
|
|
23124
23163
|
var init_katex_min = __esm({
|
|
23125
|
-
"node_modules
|
|
23164
|
+
"node_modules/katex/dist/katex.min.css"() {
|
|
23126
23165
|
}
|
|
23127
23166
|
});
|
|
23128
23167
|
var Tabs;
|
|
@@ -23562,7 +23601,7 @@ var init_CodeBlock = __esm({
|
|
|
23562
23601
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
23563
23602
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
23564
23603
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
23565
|
-
CodeBlock =
|
|
23604
|
+
CodeBlock = React105__default.memo(
|
|
23566
23605
|
({
|
|
23567
23606
|
code: rawCode,
|
|
23568
23607
|
language = "text",
|
|
@@ -24149,7 +24188,7 @@ var init_MarkdownContent = __esm({
|
|
|
24149
24188
|
init_Box();
|
|
24150
24189
|
init_CodeBlock();
|
|
24151
24190
|
init_cn();
|
|
24152
|
-
MarkdownContent =
|
|
24191
|
+
MarkdownContent = React105__default.memo(
|
|
24153
24192
|
({ content, direction = "ltr", className }) => {
|
|
24154
24193
|
const { t: _t } = useTranslate();
|
|
24155
24194
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -25476,7 +25515,7 @@ var init_StateMachineView = __esm({
|
|
|
25476
25515
|
style: { top: title ? 30 : 0 },
|
|
25477
25516
|
children: [
|
|
25478
25517
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
25479
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
25518
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React105__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
25480
25519
|
StateNode2,
|
|
25481
25520
|
{
|
|
25482
25521
|
state,
|
|
@@ -30079,6 +30118,8 @@ function CounterMinimal({
|
|
|
30079
30118
|
size = "md",
|
|
30080
30119
|
onDecrement,
|
|
30081
30120
|
onIncrement,
|
|
30121
|
+
decrementEvent,
|
|
30122
|
+
incrementEvent,
|
|
30082
30123
|
className
|
|
30083
30124
|
}) {
|
|
30084
30125
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
@@ -30089,6 +30130,7 @@ function CounterMinimal({
|
|
|
30089
30130
|
{
|
|
30090
30131
|
variant: "secondary",
|
|
30091
30132
|
size: sizeStyles8[size].button,
|
|
30133
|
+
action: decrementEvent,
|
|
30092
30134
|
onClick: onDecrement,
|
|
30093
30135
|
disabled: resolved.decrementDisabled,
|
|
30094
30136
|
icon: "minus",
|
|
@@ -30111,6 +30153,7 @@ function CounterMinimal({
|
|
|
30111
30153
|
{
|
|
30112
30154
|
variant: "secondary",
|
|
30113
30155
|
size: sizeStyles8[size].button,
|
|
30156
|
+
action: incrementEvent,
|
|
30114
30157
|
onClick: onIncrement,
|
|
30115
30158
|
disabled: resolved.incrementDisabled,
|
|
30116
30159
|
icon: "plus",
|
|
@@ -30127,6 +30170,9 @@ function CounterStandard({
|
|
|
30127
30170
|
onDecrement,
|
|
30128
30171
|
onIncrement,
|
|
30129
30172
|
onReset,
|
|
30173
|
+
decrementEvent,
|
|
30174
|
+
incrementEvent,
|
|
30175
|
+
resetEvent,
|
|
30130
30176
|
className
|
|
30131
30177
|
}) {
|
|
30132
30178
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
@@ -30157,6 +30203,7 @@ function CounterStandard({
|
|
|
30157
30203
|
{
|
|
30158
30204
|
variant: "secondary",
|
|
30159
30205
|
size: sizeStyles8[size].button,
|
|
30206
|
+
action: decrementEvent,
|
|
30160
30207
|
onClick: onDecrement,
|
|
30161
30208
|
disabled: resolved.decrementDisabled,
|
|
30162
30209
|
icon: "minus"
|
|
@@ -30167,6 +30214,7 @@ function CounterStandard({
|
|
|
30167
30214
|
{
|
|
30168
30215
|
variant: "primary",
|
|
30169
30216
|
size: sizeStyles8[size].button,
|
|
30217
|
+
action: incrementEvent,
|
|
30170
30218
|
onClick: onIncrement,
|
|
30171
30219
|
disabled: resolved.incrementDisabled,
|
|
30172
30220
|
icon: "plus"
|
|
@@ -30178,6 +30226,7 @@ function CounterStandard({
|
|
|
30178
30226
|
{
|
|
30179
30227
|
variant: "ghost",
|
|
30180
30228
|
size: "sm",
|
|
30229
|
+
action: resetEvent,
|
|
30181
30230
|
onClick: onReset,
|
|
30182
30231
|
icon: "rotate-ccw",
|
|
30183
30232
|
children: "Reset"
|
|
@@ -30193,6 +30242,9 @@ function CounterFull({
|
|
|
30193
30242
|
onDecrement,
|
|
30194
30243
|
onIncrement,
|
|
30195
30244
|
onReset,
|
|
30245
|
+
decrementEvent,
|
|
30246
|
+
incrementEvent,
|
|
30247
|
+
resetEvent,
|
|
30196
30248
|
className
|
|
30197
30249
|
}) {
|
|
30198
30250
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
@@ -30226,6 +30278,7 @@ function CounterFull({
|
|
|
30226
30278
|
{
|
|
30227
30279
|
variant: "secondary",
|
|
30228
30280
|
size: sizeStyles8[size].button,
|
|
30281
|
+
action: decrementEvent,
|
|
30229
30282
|
onClick: onDecrement,
|
|
30230
30283
|
disabled: resolved.decrementDisabled,
|
|
30231
30284
|
icon: "minus",
|
|
@@ -30237,6 +30290,7 @@ function CounterFull({
|
|
|
30237
30290
|
{
|
|
30238
30291
|
variant: "primary",
|
|
30239
30292
|
size: sizeStyles8[size].button,
|
|
30293
|
+
action: incrementEvent,
|
|
30240
30294
|
onClick: onIncrement,
|
|
30241
30295
|
disabled: resolved.incrementDisabled,
|
|
30242
30296
|
icon: "plus",
|
|
@@ -30249,6 +30303,7 @@ function CounterFull({
|
|
|
30249
30303
|
{
|
|
30250
30304
|
variant: "ghost",
|
|
30251
30305
|
size: "sm",
|
|
30306
|
+
action: resetEvent,
|
|
30252
30307
|
onClick: onReset,
|
|
30253
30308
|
icon: "rotate-ccw",
|
|
30254
30309
|
children: "Reset to 0"
|
|
@@ -31098,8 +31153,8 @@ var init_Menu = __esm({
|
|
|
31098
31153
|
"bottom-end": "bottom-start"
|
|
31099
31154
|
};
|
|
31100
31155
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
31101
|
-
const triggerChild =
|
|
31102
|
-
const triggerElement =
|
|
31156
|
+
const triggerChild = React105__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
31157
|
+
const triggerElement = React105__default.cloneElement(
|
|
31103
31158
|
triggerChild,
|
|
31104
31159
|
{
|
|
31105
31160
|
ref: triggerRef,
|
|
@@ -31194,14 +31249,14 @@ function useDataDnd(args) {
|
|
|
31194
31249
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
31195
31250
|
const enabled = isZone || Boolean(dndRoot);
|
|
31196
31251
|
const eventBus = useEventBus();
|
|
31197
|
-
const parentRoot =
|
|
31252
|
+
const parentRoot = React105__default.useContext(RootCtx);
|
|
31198
31253
|
const isRoot = enabled && parentRoot === null;
|
|
31199
|
-
const zoneId =
|
|
31254
|
+
const zoneId = React105__default.useId();
|
|
31200
31255
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
31201
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
31202
|
-
const optimisticOrdersRef =
|
|
31256
|
+
const [optimisticOrders, setOptimisticOrders] = React105__default.useState(() => /* @__PURE__ */ new Map());
|
|
31257
|
+
const optimisticOrdersRef = React105__default.useRef(optimisticOrders);
|
|
31203
31258
|
optimisticOrdersRef.current = optimisticOrders;
|
|
31204
|
-
const clearOptimisticOrder =
|
|
31259
|
+
const clearOptimisticOrder = React105__default.useCallback((group) => {
|
|
31205
31260
|
setOptimisticOrders((prev) => {
|
|
31206
31261
|
if (!prev.has(group)) return prev;
|
|
31207
31262
|
const next = new Map(prev);
|
|
@@ -31226,7 +31281,7 @@ function useDataDnd(args) {
|
|
|
31226
31281
|
const raw = it[dndItemIdField];
|
|
31227
31282
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
31228
31283
|
}).join("|");
|
|
31229
|
-
const itemIds =
|
|
31284
|
+
const itemIds = React105__default.useMemo(
|
|
31230
31285
|
() => orderedItems.map((it, idx) => {
|
|
31231
31286
|
const raw = it[dndItemIdField];
|
|
31232
31287
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -31237,7 +31292,7 @@ function useDataDnd(args) {
|
|
|
31237
31292
|
const raw = it[dndItemIdField];
|
|
31238
31293
|
return raw != null ? String(raw) : `__${idx}`;
|
|
31239
31294
|
}).join("|");
|
|
31240
|
-
|
|
31295
|
+
React105__default.useEffect(() => {
|
|
31241
31296
|
const root = isRoot ? null : parentRoot;
|
|
31242
31297
|
if (root) {
|
|
31243
31298
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -31245,20 +31300,20 @@ function useDataDnd(args) {
|
|
|
31245
31300
|
clearOptimisticOrder(ownGroup);
|
|
31246
31301
|
}
|
|
31247
31302
|
}, [itemsContentSig, ownGroup]);
|
|
31248
|
-
const zonesRef =
|
|
31249
|
-
const registerZone =
|
|
31303
|
+
const zonesRef = React105__default.useRef(/* @__PURE__ */ new Map());
|
|
31304
|
+
const registerZone = React105__default.useCallback((zoneId2, meta2) => {
|
|
31250
31305
|
zonesRef.current.set(zoneId2, meta2);
|
|
31251
31306
|
}, []);
|
|
31252
|
-
const unregisterZone =
|
|
31307
|
+
const unregisterZone = React105__default.useCallback((zoneId2) => {
|
|
31253
31308
|
zonesRef.current.delete(zoneId2);
|
|
31254
31309
|
}, []);
|
|
31255
|
-
const [activeDrag, setActiveDrag] =
|
|
31256
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
31257
|
-
const meta =
|
|
31310
|
+
const [activeDrag, setActiveDrag] = React105__default.useState(null);
|
|
31311
|
+
const [overZoneGroup, setOverZoneGroup] = React105__default.useState(null);
|
|
31312
|
+
const meta = React105__default.useMemo(
|
|
31258
31313
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
31259
31314
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
31260
31315
|
);
|
|
31261
|
-
|
|
31316
|
+
React105__default.useEffect(() => {
|
|
31262
31317
|
const target = isRoot ? null : parentRoot;
|
|
31263
31318
|
if (!target) {
|
|
31264
31319
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -31277,7 +31332,7 @@ function useDataDnd(args) {
|
|
|
31277
31332
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
31278
31333
|
const sensors = useAlmadarDndSensors(true);
|
|
31279
31334
|
const collisionDetection = almadarDndCollisionDetection;
|
|
31280
|
-
const findZoneByItem =
|
|
31335
|
+
const findZoneByItem = React105__default.useCallback(
|
|
31281
31336
|
(id) => {
|
|
31282
31337
|
for (const z of zonesRef.current.values()) {
|
|
31283
31338
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -31286,7 +31341,7 @@ function useDataDnd(args) {
|
|
|
31286
31341
|
},
|
|
31287
31342
|
[]
|
|
31288
31343
|
);
|
|
31289
|
-
|
|
31344
|
+
React105__default.useCallback(
|
|
31290
31345
|
(group) => {
|
|
31291
31346
|
for (const z of zonesRef.current.values()) {
|
|
31292
31347
|
if (z.group === group) return z;
|
|
@@ -31295,7 +31350,7 @@ function useDataDnd(args) {
|
|
|
31295
31350
|
},
|
|
31296
31351
|
[]
|
|
31297
31352
|
);
|
|
31298
|
-
const handleDragEnd =
|
|
31353
|
+
const handleDragEnd = React105__default.useCallback(
|
|
31299
31354
|
(event) => {
|
|
31300
31355
|
const { active, over } = event;
|
|
31301
31356
|
const activeIdStr = String(active.id);
|
|
@@ -31386,8 +31441,8 @@ function useDataDnd(args) {
|
|
|
31386
31441
|
},
|
|
31387
31442
|
[eventBus]
|
|
31388
31443
|
);
|
|
31389
|
-
const sortableData =
|
|
31390
|
-
const SortableItem =
|
|
31444
|
+
const sortableData = React105__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
31445
|
+
const SortableItem = React105__default.useCallback(
|
|
31391
31446
|
({ id, children }) => {
|
|
31392
31447
|
const {
|
|
31393
31448
|
attributes,
|
|
@@ -31427,7 +31482,7 @@ function useDataDnd(args) {
|
|
|
31427
31482
|
id: droppableId,
|
|
31428
31483
|
data: sortableData
|
|
31429
31484
|
});
|
|
31430
|
-
const ctx =
|
|
31485
|
+
const ctx = React105__default.useContext(RootCtx);
|
|
31431
31486
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
31432
31487
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
31433
31488
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -31442,7 +31497,7 @@ function useDataDnd(args) {
|
|
|
31442
31497
|
showForeignPlaceholder,
|
|
31443
31498
|
ctxAvailable: ctx != null
|
|
31444
31499
|
});
|
|
31445
|
-
|
|
31500
|
+
React105__default.useEffect(() => {
|
|
31446
31501
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
31447
31502
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
31448
31503
|
return /* @__PURE__ */ jsx(
|
|
@@ -31456,11 +31511,11 @@ function useDataDnd(args) {
|
|
|
31456
31511
|
}
|
|
31457
31512
|
);
|
|
31458
31513
|
};
|
|
31459
|
-
const rootContextValue =
|
|
31514
|
+
const rootContextValue = React105__default.useMemo(
|
|
31460
31515
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
31461
31516
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
31462
31517
|
);
|
|
31463
|
-
const handleDragStart =
|
|
31518
|
+
const handleDragStart = React105__default.useCallback((event) => {
|
|
31464
31519
|
const sourceZone = findZoneByItem(event.active.id);
|
|
31465
31520
|
const rect = event.active.rect.current.initial;
|
|
31466
31521
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -31479,7 +31534,7 @@ function useDataDnd(args) {
|
|
|
31479
31534
|
isRoot
|
|
31480
31535
|
});
|
|
31481
31536
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
31482
|
-
const handleDragOver =
|
|
31537
|
+
const handleDragOver = React105__default.useCallback((event) => {
|
|
31483
31538
|
const { active, over } = event;
|
|
31484
31539
|
const overData = over?.data?.current;
|
|
31485
31540
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -31549,7 +31604,7 @@ function useDataDnd(args) {
|
|
|
31549
31604
|
return next;
|
|
31550
31605
|
});
|
|
31551
31606
|
}, []);
|
|
31552
|
-
const handleDragCancel =
|
|
31607
|
+
const handleDragCancel = React105__default.useCallback((event) => {
|
|
31553
31608
|
setActiveDrag(null);
|
|
31554
31609
|
setOverZoneGroup(null);
|
|
31555
31610
|
dndLog.warn("dragCancel", {
|
|
@@ -31557,12 +31612,12 @@ function useDataDnd(args) {
|
|
|
31557
31612
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
31558
31613
|
});
|
|
31559
31614
|
}, []);
|
|
31560
|
-
const handleDragEndWithCleanup =
|
|
31615
|
+
const handleDragEndWithCleanup = React105__default.useCallback((event) => {
|
|
31561
31616
|
handleDragEnd(event);
|
|
31562
31617
|
setActiveDrag(null);
|
|
31563
31618
|
setOverZoneGroup(null);
|
|
31564
31619
|
}, [handleDragEnd]);
|
|
31565
|
-
const wrapContainer =
|
|
31620
|
+
const wrapContainer = React105__default.useCallback(
|
|
31566
31621
|
(children) => {
|
|
31567
31622
|
if (!enabled) return children;
|
|
31568
31623
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -31616,7 +31671,7 @@ var init_useDataDnd = __esm({
|
|
|
31616
31671
|
init_useAlmadarDndCollision();
|
|
31617
31672
|
init_Box();
|
|
31618
31673
|
dndLog = createLogger("almadar:ui:dnd");
|
|
31619
|
-
RootCtx =
|
|
31674
|
+
RootCtx = React105__default.createContext(null);
|
|
31620
31675
|
}
|
|
31621
31676
|
});
|
|
31622
31677
|
function renderIconInput(icon, props) {
|
|
@@ -32142,7 +32197,7 @@ function DataList({
|
|
|
32142
32197
|
}) {
|
|
32143
32198
|
const eventBus = useEventBus();
|
|
32144
32199
|
const { t } = useTranslate();
|
|
32145
|
-
const [visibleCount, setVisibleCount] =
|
|
32200
|
+
const [visibleCount, setVisibleCount] = React105__default.useState(pageSize || Infinity);
|
|
32146
32201
|
const fieldDefs = fields ?? columns ?? [];
|
|
32147
32202
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
32148
32203
|
const dnd = useDataDnd({
|
|
@@ -32161,7 +32216,7 @@ function DataList({
|
|
|
32161
32216
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
32162
32217
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
32163
32218
|
const hasRenderProp = typeof children === "function";
|
|
32164
|
-
|
|
32219
|
+
React105__default.useEffect(() => {
|
|
32165
32220
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
32166
32221
|
const childrenTypeOf = typeof children;
|
|
32167
32222
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -32265,7 +32320,7 @@ function DataList({
|
|
|
32265
32320
|
const items2 = [...data];
|
|
32266
32321
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
32267
32322
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
32268
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
32323
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
32269
32324
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
32270
32325
|
group.items.map((itemData, index) => {
|
|
32271
32326
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -32406,7 +32461,7 @@ function DataList({
|
|
|
32406
32461
|
className
|
|
32407
32462
|
),
|
|
32408
32463
|
children: [
|
|
32409
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
32464
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
32410
32465
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
32411
32466
|
group.items.map(
|
|
32412
32467
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -32491,7 +32546,7 @@ var init_FormSection = __esm({
|
|
|
32491
32546
|
columns = 1,
|
|
32492
32547
|
className
|
|
32493
32548
|
}) => {
|
|
32494
|
-
const [collapsed, setCollapsed] =
|
|
32549
|
+
const [collapsed, setCollapsed] = React105__default.useState(defaultCollapsed);
|
|
32495
32550
|
const { t } = useTranslate();
|
|
32496
32551
|
const eventBus = useEventBus();
|
|
32497
32552
|
const gridClass = {
|
|
@@ -32499,7 +32554,7 @@ var init_FormSection = __esm({
|
|
|
32499
32554
|
2: "grid-cols-1 md:grid-cols-2",
|
|
32500
32555
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
32501
32556
|
}[columns];
|
|
32502
|
-
|
|
32557
|
+
React105__default.useCallback(() => {
|
|
32503
32558
|
if (collapsible) {
|
|
32504
32559
|
setCollapsed((prev) => !prev);
|
|
32505
32560
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -33449,7 +33504,7 @@ var init_Flex = __esm({
|
|
|
33449
33504
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
33450
33505
|
}
|
|
33451
33506
|
}
|
|
33452
|
-
return
|
|
33507
|
+
return React105__default.createElement(Component, {
|
|
33453
33508
|
className: cn(
|
|
33454
33509
|
inline ? "inline-flex" : "flex",
|
|
33455
33510
|
directionStyles[direction],
|
|
@@ -33568,7 +33623,7 @@ var init_Grid = __esm({
|
|
|
33568
33623
|
as: Component = "div"
|
|
33569
33624
|
}) => {
|
|
33570
33625
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
33571
|
-
return
|
|
33626
|
+
return React105__default.createElement(
|
|
33572
33627
|
Component,
|
|
33573
33628
|
{
|
|
33574
33629
|
className: cn(
|
|
@@ -33764,9 +33819,9 @@ var init_Popover = __esm({
|
|
|
33764
33819
|
onMouseLeave: handleClose,
|
|
33765
33820
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
33766
33821
|
};
|
|
33767
|
-
const childElement =
|
|
33822
|
+
const childElement = React105__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
33768
33823
|
const childPointerDown = childElement.props.onPointerDown;
|
|
33769
|
-
const triggerElement =
|
|
33824
|
+
const triggerElement = React105__default.cloneElement(
|
|
33770
33825
|
childElement,
|
|
33771
33826
|
{
|
|
33772
33827
|
ref: triggerRef,
|
|
@@ -34368,9 +34423,9 @@ var init_Tooltip = __esm({
|
|
|
34368
34423
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
34369
34424
|
};
|
|
34370
34425
|
}, []);
|
|
34371
|
-
const triggerElement =
|
|
34426
|
+
const triggerElement = React105__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
34372
34427
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
34373
|
-
const trigger =
|
|
34428
|
+
const trigger = React105__default.cloneElement(triggerElement, {
|
|
34374
34429
|
ref: triggerRef,
|
|
34375
34430
|
onMouseEnter: handleMouseEnter,
|
|
34376
34431
|
onMouseLeave: handleMouseLeave,
|
|
@@ -34460,7 +34515,7 @@ var init_WizardProgress = __esm({
|
|
|
34460
34515
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
34461
34516
|
const isActive = index === currentStep;
|
|
34462
34517
|
const isCompleted = index < currentStep;
|
|
34463
|
-
return /* @__PURE__ */ jsxs(
|
|
34518
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
34464
34519
|
/* @__PURE__ */ jsx(
|
|
34465
34520
|
"button",
|
|
34466
34521
|
{
|
|
@@ -36020,7 +36075,7 @@ var init_MapView = __esm({
|
|
|
36020
36075
|
shadowSize: [41, 41]
|
|
36021
36076
|
});
|
|
36022
36077
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
36023
|
-
const { useEffect: useEffect76, useRef: useRef77, useCallback: useCallback117, useState: useState108 } =
|
|
36078
|
+
const { useEffect: useEffect76, useRef: useRef77, useCallback: useCallback117, useState: useState108 } = React105__default;
|
|
36024
36079
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
36025
36080
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
36026
36081
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -36935,8 +36990,8 @@ function TableView({
|
|
|
36935
36990
|
}) {
|
|
36936
36991
|
const eventBus = useEventBus();
|
|
36937
36992
|
const { t } = useTranslate();
|
|
36938
|
-
const [visibleCount, setVisibleCount] =
|
|
36939
|
-
const [localSelected, setLocalSelected] =
|
|
36993
|
+
const [visibleCount, setVisibleCount] = React105__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
36994
|
+
const [localSelected, setLocalSelected] = React105__default.useState(/* @__PURE__ */ new Set());
|
|
36940
36995
|
const colDefs = columns ?? fields ?? [];
|
|
36941
36996
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
36942
36997
|
const dnd = useDataDnd({
|
|
@@ -37131,12 +37186,12 @@ function TableView({
|
|
|
37131
37186
|
]
|
|
37132
37187
|
}
|
|
37133
37188
|
);
|
|
37134
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
37189
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React105__default.Fragment, { children: rowInner }, id);
|
|
37135
37190
|
};
|
|
37136
37191
|
const items = Array.from(data);
|
|
37137
37192
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
37138
37193
|
let runningIndex = 0;
|
|
37139
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
37194
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
37140
37195
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
37141
37196
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
37142
37197
|
] }, gi)) });
|
|
@@ -38493,7 +38548,7 @@ var init_StepFlow = __esm({
|
|
|
38493
38548
|
className
|
|
38494
38549
|
}) => {
|
|
38495
38550
|
if (orientation === "vertical") {
|
|
38496
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
38551
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React105__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
38497
38552
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
38498
38553
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
38499
38554
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -38504,7 +38559,7 @@ var init_StepFlow = __esm({
|
|
|
38504
38559
|
] })
|
|
38505
38560
|
] }) }, index)) });
|
|
38506
38561
|
}
|
|
38507
|
-
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(
|
|
38562
|
+
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(React105__default.Fragment, { children: [
|
|
38508
38563
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
38509
38564
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
38510
38565
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -39489,7 +39544,7 @@ var init_LikertScale = __esm({
|
|
|
39489
39544
|
md: "text-base",
|
|
39490
39545
|
lg: "text-lg"
|
|
39491
39546
|
};
|
|
39492
|
-
LikertScale =
|
|
39547
|
+
LikertScale = React105__default.forwardRef(
|
|
39493
39548
|
({
|
|
39494
39549
|
question,
|
|
39495
39550
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -39501,7 +39556,7 @@ var init_LikertScale = __esm({
|
|
|
39501
39556
|
variant = "radios",
|
|
39502
39557
|
className
|
|
39503
39558
|
}, ref) => {
|
|
39504
|
-
const groupId =
|
|
39559
|
+
const groupId = React105__default.useId();
|
|
39505
39560
|
const eventBus = useEventBus();
|
|
39506
39561
|
const handleSelect = useCallback(
|
|
39507
39562
|
(next) => {
|
|
@@ -41783,7 +41838,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
41783
41838
|
"aria-label": t("aria.breadcrumb"),
|
|
41784
41839
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
41785
41840
|
const isLast = idx === items.length - 1;
|
|
41786
|
-
return /* @__PURE__ */ jsxs(
|
|
41841
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
41787
41842
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
41788
41843
|
Icon,
|
|
41789
41844
|
{
|
|
@@ -42652,7 +42707,7 @@ var init_MiniStateMachine = __esm({
|
|
|
42652
42707
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
42653
42708
|
const tc = transitionCounts[s.name] ?? 0;
|
|
42654
42709
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
42655
|
-
return /* @__PURE__ */ jsxs(
|
|
42710
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
42656
42711
|
/* @__PURE__ */ jsx(
|
|
42657
42712
|
AvlState,
|
|
42658
42713
|
{
|
|
@@ -42856,7 +42911,7 @@ var init_PageHeader = __esm({
|
|
|
42856
42911
|
info: "bg-info/10 text-info"
|
|
42857
42912
|
};
|
|
42858
42913
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
42859
|
-
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(
|
|
42914
|
+
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(React105__default.Fragment, { children: [
|
|
42860
42915
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
42861
42916
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
42862
42917
|
"a",
|
|
@@ -43214,7 +43269,7 @@ var init_Section = __esm({
|
|
|
43214
43269
|
as: Component = "section"
|
|
43215
43270
|
}) => {
|
|
43216
43271
|
const hasHeader = title || description || action;
|
|
43217
|
-
return
|
|
43272
|
+
return React105__default.createElement(
|
|
43218
43273
|
Component,
|
|
43219
43274
|
{
|
|
43220
43275
|
className: cn(
|
|
@@ -43516,6 +43571,7 @@ var init_WizardContainer = __esm({
|
|
|
43516
43571
|
init_Stack();
|
|
43517
43572
|
init_Icon();
|
|
43518
43573
|
init_cn();
|
|
43574
|
+
init_useEventBus();
|
|
43519
43575
|
WizardContainer = ({
|
|
43520
43576
|
steps,
|
|
43521
43577
|
currentStep: controlledStep,
|
|
@@ -43524,9 +43580,13 @@ var init_WizardContainer = __esm({
|
|
|
43524
43580
|
showProgress = true,
|
|
43525
43581
|
allowBack = true,
|
|
43526
43582
|
compact = false,
|
|
43527
|
-
className
|
|
43583
|
+
className,
|
|
43584
|
+
nextEvent,
|
|
43585
|
+
backEvent,
|
|
43586
|
+
completeEvent
|
|
43528
43587
|
}) => {
|
|
43529
43588
|
const { t } = useTranslate();
|
|
43589
|
+
const eventBus = useEventBus();
|
|
43530
43590
|
const [internalStep, setInternalStep] = useState(0);
|
|
43531
43591
|
const normalizedControlledStep = (() => {
|
|
43532
43592
|
if (controlledStep === void 0 || controlledStep === null)
|
|
@@ -43556,13 +43616,16 @@ var init_WizardContainer = __esm({
|
|
|
43556
43616
|
return;
|
|
43557
43617
|
}
|
|
43558
43618
|
if (isLastStep) {
|
|
43619
|
+
if (completeEvent) eventBus.emit(`UI:${completeEvent}`, { step: currentStep });
|
|
43559
43620
|
onComplete?.();
|
|
43560
43621
|
} else {
|
|
43622
|
+
if (nextEvent) eventBus.emit(`UI:${nextEvent}`, { step: currentStep + 1 });
|
|
43561
43623
|
goToStep(currentStep + 1);
|
|
43562
43624
|
}
|
|
43563
43625
|
};
|
|
43564
43626
|
const handleBack = () => {
|
|
43565
43627
|
if (!isFirstStep && allowBack) {
|
|
43628
|
+
if (backEvent) eventBus.emit(`UI:${backEvent}`, { step: currentStep - 1 });
|
|
43566
43629
|
goToStep(currentStep - 1);
|
|
43567
43630
|
}
|
|
43568
43631
|
};
|
|
@@ -43580,7 +43643,7 @@ var init_WizardContainer = __esm({
|
|
|
43580
43643
|
const isCompleted = index < currentStep;
|
|
43581
43644
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
43582
43645
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
43583
|
-
return /* @__PURE__ */ jsxs(
|
|
43646
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
43584
43647
|
/* @__PURE__ */ jsx(
|
|
43585
43648
|
Button,
|
|
43586
43649
|
{
|
|
@@ -46013,7 +46076,7 @@ var init_DetailPanel = __esm({
|
|
|
46013
46076
|
}
|
|
46014
46077
|
});
|
|
46015
46078
|
function extractTitle(children) {
|
|
46016
|
-
if (!
|
|
46079
|
+
if (!React105__default.isValidElement(children)) return void 0;
|
|
46017
46080
|
const props = children.props;
|
|
46018
46081
|
if (typeof props.title === "string") {
|
|
46019
46082
|
return props.title;
|
|
@@ -46031,14 +46094,18 @@ var init_DrawerSlot = __esm({
|
|
|
46031
46094
|
title: overrideTitle,
|
|
46032
46095
|
position = "right",
|
|
46033
46096
|
size = "md",
|
|
46034
|
-
className
|
|
46097
|
+
className,
|
|
46098
|
+
sourceTrait
|
|
46035
46099
|
}) => {
|
|
46036
46100
|
const eventBus = useEventBus();
|
|
46101
|
+
const schemaCtx = useEntitySchemaOptional();
|
|
46037
46102
|
const isOpen = Boolean(children);
|
|
46038
46103
|
const title = overrideTitle || extractTitle(children);
|
|
46039
46104
|
const handleClose = () => {
|
|
46040
|
-
|
|
46041
|
-
|
|
46105
|
+
const orbital = sourceTrait !== void 0 && schemaCtx !== null ? schemaCtx.orbitalsByTrait.get(sourceTrait) : void 0;
|
|
46106
|
+
const prefix = orbital !== void 0 && sourceTrait !== void 0 ? `UI:${orbital}.${sourceTrait}.` : "UI:";
|
|
46107
|
+
eventBus.emit(`${prefix}CLOSE`);
|
|
46108
|
+
eventBus.emit(`${prefix}CANCEL`);
|
|
46042
46109
|
};
|
|
46043
46110
|
if (!isOpen) return null;
|
|
46044
46111
|
return /* @__PURE__ */ jsx(
|
|
@@ -46359,12 +46426,12 @@ var init_Form = __esm({
|
|
|
46359
46426
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
46360
46427
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
46361
46428
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
46362
|
-
const normalizedInitialData =
|
|
46429
|
+
const normalizedInitialData = React105__default.useMemo(() => {
|
|
46363
46430
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
46364
46431
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
46365
46432
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
46366
46433
|
}, [entity, initialData]);
|
|
46367
|
-
const entityDerivedFields =
|
|
46434
|
+
const entityDerivedFields = React105__default.useMemo(() => {
|
|
46368
46435
|
if (fields && fields.length > 0) return void 0;
|
|
46369
46436
|
if (!resolvedEntity) return void 0;
|
|
46370
46437
|
return resolvedEntity.fields.map(
|
|
@@ -46385,16 +46452,16 @@ var init_Form = __esm({
|
|
|
46385
46452
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
46386
46453
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
46387
46454
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
46388
|
-
const [formData, setFormData] =
|
|
46455
|
+
const [formData, setFormData] = React105__default.useState(
|
|
46389
46456
|
normalizedInitialData
|
|
46390
46457
|
);
|
|
46391
|
-
const [collapsedSections, setCollapsedSections] =
|
|
46458
|
+
const [collapsedSections, setCollapsedSections] = React105__default.useState(
|
|
46392
46459
|
/* @__PURE__ */ new Set()
|
|
46393
46460
|
);
|
|
46394
|
-
const [submitError, setSubmitError] =
|
|
46395
|
-
const formRef =
|
|
46461
|
+
const [submitError, setSubmitError] = React105__default.useState(null);
|
|
46462
|
+
const formRef = React105__default.useRef(null);
|
|
46396
46463
|
const formMode = props.mode;
|
|
46397
|
-
const mountedRef =
|
|
46464
|
+
const mountedRef = React105__default.useRef(false);
|
|
46398
46465
|
if (!mountedRef.current) {
|
|
46399
46466
|
mountedRef.current = true;
|
|
46400
46467
|
debug("forms", "mount", {
|
|
@@ -46407,7 +46474,7 @@ var init_Form = __esm({
|
|
|
46407
46474
|
});
|
|
46408
46475
|
}
|
|
46409
46476
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
46410
|
-
const evalContext =
|
|
46477
|
+
const evalContext = React105__default.useMemo(
|
|
46411
46478
|
() => ({
|
|
46412
46479
|
formValues: formData,
|
|
46413
46480
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -46416,7 +46483,7 @@ var init_Form = __esm({
|
|
|
46416
46483
|
}),
|
|
46417
46484
|
[formData, externalContext]
|
|
46418
46485
|
);
|
|
46419
|
-
|
|
46486
|
+
React105__default.useEffect(() => {
|
|
46420
46487
|
debug("forms", "initialData-sync", {
|
|
46421
46488
|
mode: formMode,
|
|
46422
46489
|
normalizedInitialData,
|
|
@@ -46427,7 +46494,7 @@ var init_Form = __esm({
|
|
|
46427
46494
|
setFormData(normalizedInitialData);
|
|
46428
46495
|
}
|
|
46429
46496
|
}, [normalizedInitialData]);
|
|
46430
|
-
const processCalculations =
|
|
46497
|
+
const processCalculations = React105__default.useCallback(
|
|
46431
46498
|
(changedFieldId, newFormData) => {
|
|
46432
46499
|
if (!hiddenCalculations.length) return;
|
|
46433
46500
|
const context = {
|
|
@@ -46452,7 +46519,7 @@ var init_Form = __esm({
|
|
|
46452
46519
|
},
|
|
46453
46520
|
[hiddenCalculations, externalContext, eventBus]
|
|
46454
46521
|
);
|
|
46455
|
-
const checkViolations =
|
|
46522
|
+
const checkViolations = React105__default.useCallback(
|
|
46456
46523
|
(changedFieldId, newFormData) => {
|
|
46457
46524
|
if (!violationTriggers.length) return;
|
|
46458
46525
|
const context = {
|
|
@@ -46490,7 +46557,7 @@ var init_Form = __esm({
|
|
|
46490
46557
|
processCalculations(name, newFormData);
|
|
46491
46558
|
checkViolations(name, newFormData);
|
|
46492
46559
|
};
|
|
46493
|
-
const isFieldVisible =
|
|
46560
|
+
const isFieldVisible = React105__default.useCallback(
|
|
46494
46561
|
(fieldName) => {
|
|
46495
46562
|
const condition = conditionalFields[fieldName];
|
|
46496
46563
|
if (!condition) return true;
|
|
@@ -46498,7 +46565,7 @@ var init_Form = __esm({
|
|
|
46498
46565
|
},
|
|
46499
46566
|
[conditionalFields, evalContext]
|
|
46500
46567
|
);
|
|
46501
|
-
const isSectionVisible =
|
|
46568
|
+
const isSectionVisible = React105__default.useCallback(
|
|
46502
46569
|
(section) => {
|
|
46503
46570
|
if (!section.condition) return true;
|
|
46504
46571
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -46574,7 +46641,7 @@ var init_Form = __esm({
|
|
|
46574
46641
|
eventBus.emit(`UI:${onCancel}`);
|
|
46575
46642
|
}
|
|
46576
46643
|
};
|
|
46577
|
-
const renderField =
|
|
46644
|
+
const renderField = React105__default.useCallback(
|
|
46578
46645
|
(field) => {
|
|
46579
46646
|
const fieldName = field.name || field.field;
|
|
46580
46647
|
if (!fieldName) return null;
|
|
@@ -46595,7 +46662,7 @@ var init_Form = __esm({
|
|
|
46595
46662
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
46596
46663
|
);
|
|
46597
46664
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
46598
|
-
const normalizedFields =
|
|
46665
|
+
const normalizedFields = React105__default.useMemo(() => {
|
|
46599
46666
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
46600
46667
|
return effectiveFields.map((field) => {
|
|
46601
46668
|
if (typeof field === "string") {
|
|
@@ -46619,7 +46686,7 @@ var init_Form = __esm({
|
|
|
46619
46686
|
return field;
|
|
46620
46687
|
});
|
|
46621
46688
|
}, [effectiveFields, resolvedEntity]);
|
|
46622
|
-
const schemaFields =
|
|
46689
|
+
const schemaFields = React105__default.useMemo(() => {
|
|
46623
46690
|
if (normalizedFields.length === 0) return null;
|
|
46624
46691
|
if (isDebugEnabled()) {
|
|
46625
46692
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -46629,7 +46696,7 @@ var init_Form = __esm({
|
|
|
46629
46696
|
}
|
|
46630
46697
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
46631
46698
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
46632
|
-
const sectionElements =
|
|
46699
|
+
const sectionElements = React105__default.useMemo(() => {
|
|
46633
46700
|
if (!sections || sections.length === 0) return null;
|
|
46634
46701
|
return sections.map((section) => {
|
|
46635
46702
|
if (!isSectionVisible(section)) {
|
|
@@ -47354,7 +47421,7 @@ var init_List = __esm({
|
|
|
47354
47421
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
47355
47422
|
return [];
|
|
47356
47423
|
}, [entity]);
|
|
47357
|
-
const getItemActions =
|
|
47424
|
+
const getItemActions = React105__default.useCallback(
|
|
47358
47425
|
(item) => {
|
|
47359
47426
|
if (!itemActions) return [];
|
|
47360
47427
|
if (typeof itemActions === "function") {
|
|
@@ -47829,7 +47896,7 @@ var init_MediaGallery = __esm({
|
|
|
47829
47896
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
47830
47897
|
);
|
|
47831
47898
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
47832
|
-
const items =
|
|
47899
|
+
const items = React105__default.useMemo(() => {
|
|
47833
47900
|
if (propItems) return propItems;
|
|
47834
47901
|
if (entityData.length === 0) return [];
|
|
47835
47902
|
return entityData.map((record, idx) => {
|
|
@@ -47992,7 +48059,7 @@ var init_MediaGallery = __esm({
|
|
|
47992
48059
|
}
|
|
47993
48060
|
});
|
|
47994
48061
|
function extractTitle2(children) {
|
|
47995
|
-
if (!
|
|
48062
|
+
if (!React105__default.isValidElement(children)) return void 0;
|
|
47996
48063
|
const props = children.props;
|
|
47997
48064
|
if (typeof props.title === "string") {
|
|
47998
48065
|
return props.title;
|
|
@@ -48009,14 +48076,18 @@ var init_ModalSlot = __esm({
|
|
|
48009
48076
|
children,
|
|
48010
48077
|
title: overrideTitle,
|
|
48011
48078
|
size = "md",
|
|
48012
|
-
className
|
|
48079
|
+
className,
|
|
48080
|
+
sourceTrait
|
|
48013
48081
|
}) => {
|
|
48014
48082
|
const eventBus = useEventBus();
|
|
48083
|
+
const schemaCtx = useEntitySchemaOptional();
|
|
48015
48084
|
const isOpen = Boolean(children);
|
|
48016
48085
|
const title = overrideTitle || extractTitle2(children);
|
|
48017
48086
|
const handleClose = () => {
|
|
48018
|
-
|
|
48019
|
-
|
|
48087
|
+
const orbital = sourceTrait !== void 0 && schemaCtx !== null ? schemaCtx.orbitalsByTrait.get(sourceTrait) : void 0;
|
|
48088
|
+
const prefix = orbital !== void 0 && sourceTrait !== void 0 ? `UI:${orbital}.${sourceTrait}.` : "UI:";
|
|
48089
|
+
eventBus.emit(`${prefix}CLOSE`);
|
|
48090
|
+
eventBus.emit(`${prefix}CANCEL`);
|
|
48020
48091
|
};
|
|
48021
48092
|
if (!isOpen) return null;
|
|
48022
48093
|
return /* @__PURE__ */ jsx(
|
|
@@ -48243,7 +48314,7 @@ var init_debugRegistry = __esm({
|
|
|
48243
48314
|
}
|
|
48244
48315
|
});
|
|
48245
48316
|
function useDebugData() {
|
|
48246
|
-
const [data, setData] =
|
|
48317
|
+
const [data, setData] = React105.useState(() => ({
|
|
48247
48318
|
traits: [],
|
|
48248
48319
|
ticks: [],
|
|
48249
48320
|
guards: [],
|
|
@@ -48257,7 +48328,7 @@ function useDebugData() {
|
|
|
48257
48328
|
},
|
|
48258
48329
|
lastUpdate: Date.now()
|
|
48259
48330
|
}));
|
|
48260
|
-
|
|
48331
|
+
React105.useEffect(() => {
|
|
48261
48332
|
const updateData = () => {
|
|
48262
48333
|
setData({
|
|
48263
48334
|
traits: getAllTraits(),
|
|
@@ -48366,12 +48437,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
48366
48437
|
return positions;
|
|
48367
48438
|
}
|
|
48368
48439
|
function WalkMinimap() {
|
|
48369
|
-
const [walkStep, setWalkStep] =
|
|
48370
|
-
const [traits2, setTraits] =
|
|
48371
|
-
const [coveredEdges, setCoveredEdges] =
|
|
48372
|
-
const [completedTraits, setCompletedTraits] =
|
|
48373
|
-
const prevTraitRef =
|
|
48374
|
-
|
|
48440
|
+
const [walkStep, setWalkStep] = React105.useState(null);
|
|
48441
|
+
const [traits2, setTraits] = React105.useState([]);
|
|
48442
|
+
const [coveredEdges, setCoveredEdges] = React105.useState([]);
|
|
48443
|
+
const [completedTraits, setCompletedTraits] = React105.useState(/* @__PURE__ */ new Set());
|
|
48444
|
+
const prevTraitRef = React105.useRef(null);
|
|
48445
|
+
React105.useEffect(() => {
|
|
48375
48446
|
const interval = setInterval(() => {
|
|
48376
48447
|
const w = window;
|
|
48377
48448
|
const step = w.__orbitalWalkStep;
|
|
@@ -48807,15 +48878,15 @@ var init_EntitiesTab = __esm({
|
|
|
48807
48878
|
});
|
|
48808
48879
|
function EventFlowTab({ events: events2 }) {
|
|
48809
48880
|
const { t } = useTranslate();
|
|
48810
|
-
const [filter, setFilter] =
|
|
48811
|
-
const containerRef =
|
|
48812
|
-
const [autoScroll, setAutoScroll] =
|
|
48813
|
-
|
|
48881
|
+
const [filter, setFilter] = React105.useState("all");
|
|
48882
|
+
const containerRef = React105.useRef(null);
|
|
48883
|
+
const [autoScroll, setAutoScroll] = React105.useState(true);
|
|
48884
|
+
React105.useEffect(() => {
|
|
48814
48885
|
if (autoScroll && containerRef.current) {
|
|
48815
48886
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
48816
48887
|
}
|
|
48817
48888
|
}, [events2.length, autoScroll]);
|
|
48818
|
-
const filteredEvents =
|
|
48889
|
+
const filteredEvents = React105.useMemo(() => {
|
|
48819
48890
|
if (filter === "all") return events2;
|
|
48820
48891
|
return events2.filter((e) => e.type === filter);
|
|
48821
48892
|
}, [events2, filter]);
|
|
@@ -48931,7 +49002,7 @@ var init_EventFlowTab = __esm({
|
|
|
48931
49002
|
});
|
|
48932
49003
|
function GuardsPanel({ guards }) {
|
|
48933
49004
|
const { t } = useTranslate();
|
|
48934
|
-
const [filter, setFilter] =
|
|
49005
|
+
const [filter, setFilter] = React105.useState("all");
|
|
48935
49006
|
if (guards.length === 0) {
|
|
48936
49007
|
return /* @__PURE__ */ jsx(
|
|
48937
49008
|
EmptyState,
|
|
@@ -48944,7 +49015,7 @@ function GuardsPanel({ guards }) {
|
|
|
48944
49015
|
}
|
|
48945
49016
|
const passedCount = guards.filter((g) => g.result).length;
|
|
48946
49017
|
const failedCount = guards.length - passedCount;
|
|
48947
|
-
const filteredGuards =
|
|
49018
|
+
const filteredGuards = React105.useMemo(() => {
|
|
48948
49019
|
if (filter === "all") return guards;
|
|
48949
49020
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
48950
49021
|
return guards.filter((g) => !g.result);
|
|
@@ -49107,10 +49178,10 @@ function EffectBadge({ effect }) {
|
|
|
49107
49178
|
}
|
|
49108
49179
|
function TransitionTimeline({ transitions }) {
|
|
49109
49180
|
const { t } = useTranslate();
|
|
49110
|
-
const containerRef =
|
|
49111
|
-
const [autoScroll, setAutoScroll] =
|
|
49112
|
-
const [expandedId, setExpandedId] =
|
|
49113
|
-
|
|
49181
|
+
const containerRef = React105.useRef(null);
|
|
49182
|
+
const [autoScroll, setAutoScroll] = React105.useState(true);
|
|
49183
|
+
const [expandedId, setExpandedId] = React105.useState(null);
|
|
49184
|
+
React105.useEffect(() => {
|
|
49114
49185
|
if (autoScroll && containerRef.current) {
|
|
49115
49186
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
49116
49187
|
}
|
|
@@ -49390,9 +49461,9 @@ function getAllEvents(traits2) {
|
|
|
49390
49461
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
49391
49462
|
const eventBus = useEventBus();
|
|
49392
49463
|
const { t } = useTranslate();
|
|
49393
|
-
const [log13, setLog] =
|
|
49394
|
-
const prevStatesRef =
|
|
49395
|
-
|
|
49464
|
+
const [log13, setLog] = React105.useState([]);
|
|
49465
|
+
const prevStatesRef = React105.useRef(/* @__PURE__ */ new Map());
|
|
49466
|
+
React105.useEffect(() => {
|
|
49396
49467
|
for (const trait of traits2) {
|
|
49397
49468
|
const prev = prevStatesRef.current.get(trait.id);
|
|
49398
49469
|
if (prev && prev !== trait.currentState) {
|
|
@@ -49561,10 +49632,10 @@ function VerifyModePanel({
|
|
|
49561
49632
|
localCount
|
|
49562
49633
|
}) {
|
|
49563
49634
|
const { t } = useTranslate();
|
|
49564
|
-
const [expanded, setExpanded] =
|
|
49565
|
-
const scrollRef =
|
|
49566
|
-
const prevCountRef =
|
|
49567
|
-
|
|
49635
|
+
const [expanded, setExpanded] = React105.useState(true);
|
|
49636
|
+
const scrollRef = React105.useRef(null);
|
|
49637
|
+
const prevCountRef = React105.useRef(0);
|
|
49638
|
+
React105.useEffect(() => {
|
|
49568
49639
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
49569
49640
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
49570
49641
|
}
|
|
@@ -49621,10 +49692,10 @@ function RuntimeDebugger({
|
|
|
49621
49692
|
schema
|
|
49622
49693
|
}) {
|
|
49623
49694
|
const { t } = useTranslate();
|
|
49624
|
-
const [isCollapsed, setIsCollapsed] =
|
|
49625
|
-
const [isVisible, setIsVisible] =
|
|
49695
|
+
const [isCollapsed, setIsCollapsed] = React105.useState(mode === "verify" ? true : defaultCollapsed);
|
|
49696
|
+
const [isVisible, setIsVisible] = React105.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
49626
49697
|
const debugData = useDebugData();
|
|
49627
|
-
|
|
49698
|
+
React105.useEffect(() => {
|
|
49628
49699
|
if (mode === "inline") return;
|
|
49629
49700
|
return onDebugToggle((enabled) => {
|
|
49630
49701
|
setIsVisible(enabled);
|
|
@@ -49633,7 +49704,7 @@ function RuntimeDebugger({
|
|
|
49633
49704
|
}
|
|
49634
49705
|
});
|
|
49635
49706
|
}, [mode]);
|
|
49636
|
-
|
|
49707
|
+
React105.useEffect(() => {
|
|
49637
49708
|
if (mode === "inline") return;
|
|
49638
49709
|
const handleKeyDown = (e) => {
|
|
49639
49710
|
if (e.key === "`" && isVisible) {
|
|
@@ -50153,7 +50224,7 @@ var init_StatCard = __esm({
|
|
|
50153
50224
|
const labelToUse = propLabel ?? propTitle;
|
|
50154
50225
|
const eventBus = useEventBus();
|
|
50155
50226
|
const { t } = useTranslate();
|
|
50156
|
-
const handleActionClick =
|
|
50227
|
+
const handleActionClick = React105__default.useCallback(() => {
|
|
50157
50228
|
if (action?.event) {
|
|
50158
50229
|
eventBus.emit(`UI:${action.event}`, {});
|
|
50159
50230
|
}
|
|
@@ -50164,7 +50235,7 @@ var init_StatCard = __esm({
|
|
|
50164
50235
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
50165
50236
|
const isLoading = externalLoading ?? false;
|
|
50166
50237
|
const error = externalError;
|
|
50167
|
-
const computeMetricValue =
|
|
50238
|
+
const computeMetricValue = React105__default.useCallback(
|
|
50168
50239
|
(metric, items) => {
|
|
50169
50240
|
if (metric.value !== void 0) {
|
|
50170
50241
|
return metric.value;
|
|
@@ -50203,7 +50274,7 @@ var init_StatCard = __esm({
|
|
|
50203
50274
|
},
|
|
50204
50275
|
[]
|
|
50205
50276
|
);
|
|
50206
|
-
const schemaStats =
|
|
50277
|
+
const schemaStats = React105__default.useMemo(() => {
|
|
50207
50278
|
if (!metrics || metrics.length === 0) return null;
|
|
50208
50279
|
return metrics.map((metric) => ({
|
|
50209
50280
|
label: metric.label,
|
|
@@ -50211,7 +50282,7 @@ var init_StatCard = __esm({
|
|
|
50211
50282
|
format: metric.format
|
|
50212
50283
|
}));
|
|
50213
50284
|
}, [metrics, data, computeMetricValue]);
|
|
50214
|
-
const calculatedTrend =
|
|
50285
|
+
const calculatedTrend = React105__default.useMemo(() => {
|
|
50215
50286
|
if (manualTrend !== void 0) return manualTrend;
|
|
50216
50287
|
if (previousValue === void 0 || currentValue === void 0)
|
|
50217
50288
|
return void 0;
|
|
@@ -50851,8 +50922,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
50851
50922
|
] });
|
|
50852
50923
|
};
|
|
50853
50924
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
50854
|
-
const endRef =
|
|
50855
|
-
|
|
50925
|
+
const endRef = React105__default.useRef(null);
|
|
50926
|
+
React105__default.useEffect(() => {
|
|
50856
50927
|
if (!autoScroll) return;
|
|
50857
50928
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
50858
50929
|
}, [activities.length, autoScroll]);
|
|
@@ -50946,7 +51017,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
50946
51017
|
};
|
|
50947
51018
|
SubagentRichCard = ({ subagent }) => {
|
|
50948
51019
|
const { t } = useTranslate();
|
|
50949
|
-
const activities =
|
|
51020
|
+
const activities = React105__default.useMemo(
|
|
50950
51021
|
() => subagentMessagesToActivities(subagent.messages),
|
|
50951
51022
|
[subagent.messages]
|
|
50952
51023
|
);
|
|
@@ -51023,8 +51094,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
51023
51094
|
] });
|
|
51024
51095
|
};
|
|
51025
51096
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
51026
|
-
const endRef =
|
|
51027
|
-
|
|
51097
|
+
const endRef = React105__default.useRef(null);
|
|
51098
|
+
React105__default.useEffect(() => {
|
|
51028
51099
|
if (!autoScroll) return;
|
|
51029
51100
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
51030
51101
|
}, [messages.length, autoScroll]);
|
|
@@ -51454,7 +51525,7 @@ var init_Timeline = __esm({
|
|
|
51454
51525
|
}) => {
|
|
51455
51526
|
const { t } = useTranslate();
|
|
51456
51527
|
const entityData = entity ?? [];
|
|
51457
|
-
const items =
|
|
51528
|
+
const items = React105__default.useMemo(() => {
|
|
51458
51529
|
if (propItems) return propItems;
|
|
51459
51530
|
if (entityData.length === 0) return [];
|
|
51460
51531
|
return entityData.map((record, idx) => {
|
|
@@ -51556,7 +51627,7 @@ var init_Timeline = __esm({
|
|
|
51556
51627
|
}
|
|
51557
51628
|
});
|
|
51558
51629
|
function extractToastProps(children) {
|
|
51559
|
-
if (!
|
|
51630
|
+
if (!React105__default.isValidElement(children)) {
|
|
51560
51631
|
if (typeof children === "string") {
|
|
51561
51632
|
return { message: children };
|
|
51562
51633
|
}
|
|
@@ -51581,20 +51652,24 @@ var init_ToastSlot = __esm({
|
|
|
51581
51652
|
variant: overrideVariant,
|
|
51582
51653
|
title: overrideTitle,
|
|
51583
51654
|
duration = 5e3,
|
|
51584
|
-
className
|
|
51655
|
+
className,
|
|
51656
|
+
sourceTrait
|
|
51585
51657
|
}) => {
|
|
51586
51658
|
const eventBus = useEventBus();
|
|
51659
|
+
const schemaCtx = useEntitySchemaOptional();
|
|
51587
51660
|
const isVisible = Boolean(children);
|
|
51588
51661
|
const extracted = extractToastProps(children);
|
|
51589
51662
|
const variant = overrideVariant || extracted.variant || "info";
|
|
51590
51663
|
const title = overrideTitle || extracted.title;
|
|
51591
51664
|
const message = extracted.message || (typeof children === "string" ? children : "");
|
|
51592
51665
|
const handleDismiss = () => {
|
|
51593
|
-
|
|
51594
|
-
|
|
51666
|
+
const orbital = sourceTrait !== void 0 && schemaCtx !== null ? schemaCtx.orbitalsByTrait.get(sourceTrait) : void 0;
|
|
51667
|
+
const prefix = orbital !== void 0 && sourceTrait !== void 0 ? `UI:${orbital}.${sourceTrait}.` : "UI:";
|
|
51668
|
+
eventBus.emit(`${prefix}DISMISS`);
|
|
51669
|
+
eventBus.emit(`${prefix}CLOSE`);
|
|
51595
51670
|
};
|
|
51596
51671
|
if (!isVisible) return null;
|
|
51597
|
-
const isCustomContent =
|
|
51672
|
+
const isCustomContent = React105__default.isValidElement(children) && !message;
|
|
51598
51673
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
51599
51674
|
Toast,
|
|
51600
51675
|
{
|
|
@@ -51611,7 +51686,7 @@ var init_ToastSlot = __esm({
|
|
|
51611
51686
|
}
|
|
51612
51687
|
});
|
|
51613
51688
|
function lazyThree(name, loader) {
|
|
51614
|
-
const Lazy =
|
|
51689
|
+
const Lazy = React105__default.lazy(
|
|
51615
51690
|
() => loader().then((m) => {
|
|
51616
51691
|
const Resolved = m[name];
|
|
51617
51692
|
if (!Resolved) {
|
|
@@ -51623,13 +51698,13 @@ function lazyThree(name, loader) {
|
|
|
51623
51698
|
})
|
|
51624
51699
|
);
|
|
51625
51700
|
function ThreeWrapper(props) {
|
|
51626
|
-
return
|
|
51701
|
+
return React105__default.createElement(
|
|
51627
51702
|
ThreeBoundary,
|
|
51628
51703
|
{ name },
|
|
51629
|
-
|
|
51630
|
-
|
|
51704
|
+
React105__default.createElement(
|
|
51705
|
+
React105__default.Suspense,
|
|
51631
51706
|
{ fallback: null },
|
|
51632
|
-
|
|
51707
|
+
React105__default.createElement(Lazy, props)
|
|
51633
51708
|
)
|
|
51634
51709
|
);
|
|
51635
51710
|
}
|
|
@@ -51941,7 +52016,7 @@ var init_component_registry_generated = __esm({
|
|
|
51941
52016
|
init_WizardProgress();
|
|
51942
52017
|
init_WorldMapBoard();
|
|
51943
52018
|
init_WorldMapTemplate();
|
|
51944
|
-
ThreeBoundary = class extends
|
|
52019
|
+
ThreeBoundary = class extends React105__default.Component {
|
|
51945
52020
|
constructor() {
|
|
51946
52021
|
super(...arguments);
|
|
51947
52022
|
__publicField(this, "state", { failed: false });
|
|
@@ -51951,7 +52026,7 @@ var init_component_registry_generated = __esm({
|
|
|
51951
52026
|
}
|
|
51952
52027
|
render() {
|
|
51953
52028
|
if (this.state.failed) {
|
|
51954
|
-
return
|
|
52029
|
+
return React105__default.createElement(
|
|
51955
52030
|
"div",
|
|
51956
52031
|
{
|
|
51957
52032
|
"data-testid": "three-unavailable",
|
|
@@ -52307,7 +52382,7 @@ function SuspenseConfigProvider({
|
|
|
52307
52382
|
config,
|
|
52308
52383
|
children
|
|
52309
52384
|
}) {
|
|
52310
|
-
return
|
|
52385
|
+
return React105__default.createElement(
|
|
52311
52386
|
SuspenseConfigContext.Provider,
|
|
52312
52387
|
{ value: config },
|
|
52313
52388
|
children
|
|
@@ -52318,8 +52393,8 @@ function getSlotFallback(slot, config) {
|
|
|
52318
52393
|
const variant = SLOT_SKELETON_MAP[slot] ?? "text";
|
|
52319
52394
|
return /* @__PURE__ */ jsx(Skeleton, { variant });
|
|
52320
52395
|
}
|
|
52321
|
-
function
|
|
52322
|
-
const mapping = getComponentForPattern(patternType);
|
|
52396
|
+
function getComponentForPattern(patternType) {
|
|
52397
|
+
const mapping = getComponentForPattern$1(patternType);
|
|
52323
52398
|
if (!mapping) {
|
|
52324
52399
|
return null;
|
|
52325
52400
|
}
|
|
@@ -52349,7 +52424,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
52349
52424
|
}
|
|
52350
52425
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
52351
52426
|
}
|
|
52352
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
52427
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React105__default.isValidElement(field) && !(field instanceof Date)) {
|
|
52353
52428
|
const obj = field;
|
|
52354
52429
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
52355
52430
|
if (!fieldName) return field;
|
|
@@ -52527,6 +52602,7 @@ function UISlotComponent({
|
|
|
52527
52602
|
const { t } = useTranslate();
|
|
52528
52603
|
const suspenseConfig = useContext(SuspenseConfigContext);
|
|
52529
52604
|
const contained = useContext(SlotContainedContext);
|
|
52605
|
+
const schemaCtx = useEntitySchemaOptional();
|
|
52530
52606
|
const content = slots[slot];
|
|
52531
52607
|
if (children !== void 0) {
|
|
52532
52608
|
if (pattern === "clear") {
|
|
@@ -52572,8 +52648,11 @@ function UISlotComponent({
|
|
|
52572
52648
|
}
|
|
52573
52649
|
const handleDismiss = () => {
|
|
52574
52650
|
if (slot === "modal" || slot === "drawer") {
|
|
52575
|
-
|
|
52576
|
-
|
|
52651
|
+
const trait = content?.sourceTrait;
|
|
52652
|
+
const orbital = trait !== void 0 && schemaCtx !== null ? schemaCtx.orbitalsByTrait.get(trait) : void 0;
|
|
52653
|
+
const prefix = orbital !== void 0 && trait !== void 0 ? `UI:${orbital}.${trait}.` : "UI:";
|
|
52654
|
+
eventBus.emit(`${prefix}CLOSE`);
|
|
52655
|
+
eventBus.emit(`${prefix}CANCEL`);
|
|
52577
52656
|
}
|
|
52578
52657
|
clear(slot);
|
|
52579
52658
|
};
|
|
@@ -52627,6 +52706,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
52627
52706
|
const slotsBus = useUISlots();
|
|
52628
52707
|
const eventBus = useEventBus();
|
|
52629
52708
|
const { t } = useTranslate();
|
|
52709
|
+
const compiledPortalSchemaCtx = useEntitySchemaOptional();
|
|
52630
52710
|
useEffect(() => {
|
|
52631
52711
|
setPortalRoot(getOrCreatePortalRoot());
|
|
52632
52712
|
}, []);
|
|
@@ -52635,8 +52715,10 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
52635
52715
|
});
|
|
52636
52716
|
const handleDismiss = () => {
|
|
52637
52717
|
if (slot === "modal" || slot === "drawer") {
|
|
52638
|
-
|
|
52639
|
-
|
|
52718
|
+
const orbital = sourceTrait !== void 0 && compiledPortalSchemaCtx !== null ? compiledPortalSchemaCtx.orbitalsByTrait.get(sourceTrait) : void 0;
|
|
52719
|
+
const prefix = orbital !== void 0 && sourceTrait !== void 0 ? `UI:${orbital}.${sourceTrait}.` : "UI:";
|
|
52720
|
+
eventBus.emit(`${prefix}CLOSE`);
|
|
52721
|
+
eventBus.emit(`${prefix}CANCEL`);
|
|
52640
52722
|
}
|
|
52641
52723
|
slotsBus.clear(slot);
|
|
52642
52724
|
};
|
|
@@ -52795,7 +52877,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
52795
52877
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
52796
52878
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
52797
52879
|
}
|
|
52798
|
-
return /* @__PURE__ */ jsx(
|
|
52880
|
+
return /* @__PURE__ */ jsx(React105__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
52799
52881
|
}
|
|
52800
52882
|
if (!child || typeof child !== "object") return null;
|
|
52801
52883
|
const childId = `${parentId}-${index}`;
|
|
@@ -52835,14 +52917,14 @@ function isPatternConfig(value) {
|
|
|
52835
52917
|
if (value === null || value === void 0) return false;
|
|
52836
52918
|
if (typeof value !== "object") return false;
|
|
52837
52919
|
if (Array.isArray(value)) return false;
|
|
52838
|
-
if (
|
|
52920
|
+
if (React105__default.isValidElement(value)) return false;
|
|
52839
52921
|
if (value instanceof Date) return false;
|
|
52840
52922
|
if (typeof value === "function") return false;
|
|
52841
52923
|
const record = value;
|
|
52842
|
-
return "type" in record && typeof record.type === "string" && getComponentForPattern(record.type) !== null;
|
|
52924
|
+
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
52843
52925
|
}
|
|
52844
52926
|
function isPlainConfigObject(value) {
|
|
52845
|
-
if (
|
|
52927
|
+
if (React105__default.isValidElement(value)) return false;
|
|
52846
52928
|
if (value instanceof Date) return false;
|
|
52847
52929
|
const proto = Object.getPrototypeOf(value);
|
|
52848
52930
|
return proto === Object.prototype || proto === null;
|
|
@@ -52948,7 +53030,7 @@ function SlotContentRenderer({
|
|
|
52948
53030
|
}
|
|
52949
53031
|
}
|
|
52950
53032
|
const orbitalName = schemaCtx && content.sourceTrait !== void 0 ? schemaCtx.orbitalsByTrait.get(content.sourceTrait) : void 0;
|
|
52951
|
-
const PatternComponent =
|
|
53033
|
+
const PatternComponent = getComponentForPattern(content.pattern);
|
|
52952
53034
|
if (PatternComponent) {
|
|
52953
53035
|
const childrenConfig = content.props.children;
|
|
52954
53036
|
const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
|
|
@@ -52968,7 +53050,7 @@ function SlotContentRenderer({
|
|
|
52968
53050
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
52969
53051
|
const slotVal = restProps[slotKey];
|
|
52970
53052
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
52971
|
-
if (
|
|
53053
|
+
if (React105__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
52972
53054
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
52973
53055
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
52974
53056
|
slotVal,
|
|
@@ -53017,7 +53099,7 @@ function SlotContentRenderer({
|
|
|
53017
53099
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
53018
53100
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
53019
53101
|
const sample = resolvedItems[0];
|
|
53020
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
53102
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React105__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
53021
53103
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
53022
53104
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
53023
53105
|
}
|
|
@@ -53195,6 +53277,7 @@ var init_UISlotRenderer = __esm({
|
|
|
53195
53277
|
"custom",
|
|
53196
53278
|
"dashboard-layout",
|
|
53197
53279
|
"game-shell",
|
|
53280
|
+
"game-template",
|
|
53198
53281
|
"scaled-diagram",
|
|
53199
53282
|
"master-detail",
|
|
53200
53283
|
"form-field",
|
|
@@ -54050,7 +54133,7 @@ function useEntitySchema() {
|
|
|
54050
54133
|
}
|
|
54051
54134
|
return context;
|
|
54052
54135
|
}
|
|
54053
|
-
function
|
|
54136
|
+
function useEntitySchemaOptional6() {
|
|
54054
54137
|
return useContext(EntitySchemaContext);
|
|
54055
54138
|
}
|
|
54056
54139
|
var log11 = createLogger("almadar:ui:navigation");
|
|
@@ -54577,4 +54660,4 @@ function useOptionalOfflineMode() {
|
|
|
54577
54660
|
return useContext(OfflineModeContext);
|
|
54578
54661
|
}
|
|
54579
54662
|
|
|
54580
|
-
export { ANONYMOUS_USER, CurrentPagePathContext, CurrentPagePathProvider, EntitySchemaProvider, EventBusContext2 as EventBusContext, EventBusProvider, NavigationProvider2 as NavigationProvider, OfflineModeProvider, OrbitalProvider, OrbitalThemeProvider, SelectionContext, SelectionProvider, ServerBridgeProvider, TraitContext, TraitProvider, TraitScopeProvider3 as TraitScopeProvider, UserContext, UserProvider, VerificationProvider, extractRouteParams2 as extractRouteParams, findPageByName2 as findPageByName, findPageByPath2 as findPageByPath, getAllPages2 as getAllPages, getDefaultPage2 as getDefaultPage, matchPath2 as matchPath, pathMatches2 as pathMatches, useActivePage2 as useActivePage, useCurrentPagePath2 as useCurrentPagePath, useEntitySchema,
|
|
54663
|
+
export { ANONYMOUS_USER, CurrentPagePathContext, CurrentPagePathProvider, EntitySchemaProvider, EventBusContext2 as EventBusContext, EventBusProvider, NavigationProvider2 as NavigationProvider, OfflineModeProvider, OrbitalProvider, OrbitalThemeProvider, SelectionContext, SelectionProvider, ServerBridgeProvider, TraitContext, TraitProvider, TraitScopeProvider3 as TraitScopeProvider, UserContext, UserProvider, VerificationProvider, extractRouteParams2 as extractRouteParams, findPageByName2 as findPageByName, findPageByPath2 as findPageByPath, getAllPages2 as getAllPages, getDefaultPage2 as getDefaultPage, matchPath2 as matchPath, pathMatches2 as pathMatches, useActivePage2 as useActivePage, useCurrentPagePath2 as useCurrentPagePath, useEntitySchema, useEntitySchemaOptional6 as useEntitySchemaOptional, useHasPermission, useHasRole, useInitPayload2 as useInitPayload, useNavigateTo2 as useNavigateTo, useNavigation2 as useNavigation, useNavigationId2 as useNavigationId, useNavigationState2 as useNavigationState, useOfflineMode, useOptionalOfflineMode, useSelection, useSelectionOptional, useServerBridge, useTrait, useTraitContext, useTraitScope2 as useTraitScope, useUser, useUserForEvaluation };
|