@almadar/ui 5.79.2 → 5.81.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 +1963 -1948
- package/dist/avl/index.css +3 -3
- package/dist/avl/index.js +754 -739
- 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 +530 -483
- package/dist/components/index.css +3 -3
- package/dist/components/index.js +532 -485
- 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 +1826 -1811
- package/dist/providers/index.css +3 -3
- package/dist/providers/index.js +726 -711
- package/dist/runtime/index.cjs +1820 -1805
- package/dist/runtime/index.css +3 -3
- package/dist/runtime/index.js +730 -715
- package/package.json +1 -1
package/dist/avl/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as React112 from 'react';
|
|
3
|
+
import React112__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId } from 'react';
|
|
4
4
|
import { getAllPages, OrbitalProvider, EventBusContext, useTraitScope, ServerBridgeProvider, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge, useEntitySchema, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath } from '@almadar/ui/providers';
|
|
5
5
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
6
6
|
import ELK from 'elkjs/lib/elk.bundled.js';
|
|
@@ -11,7 +11,6 @@ import { Loader2, X, Code, FileText, WrapText, Check, Copy, Lightbulb, CheckCirc
|
|
|
11
11
|
import { createPortal } from 'react-dom';
|
|
12
12
|
import { UISlotProvider, useUISlots, useTheme } from '@almadar/ui/context';
|
|
13
13
|
import { evaluateGuard, evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
14
|
-
import { getPatternDefinition, getComponentForPattern, isEntityAwarePattern } from '@almadar/patterns';
|
|
15
14
|
import { Link, Outlet, useLocation } from 'react-router-dom';
|
|
16
15
|
import SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light.js';
|
|
17
16
|
import dark from 'react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.js';
|
|
@@ -40,6 +39,7 @@ import { FieldTypeSchema, isInlineTrait, isPageReference, isEntityCall, schemaTo
|
|
|
40
39
|
import { useDroppable, useDraggable, DndContext, DragOverlay, useSensors, useSensor, PointerSensor, KeyboardSensor, pointerWithin, rectIntersection, closestCorners } from '@dnd-kit/core';
|
|
41
40
|
import { sortableKeyboardCoordinates, useSortable, arrayMove, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
42
41
|
import { CSS } from '@dnd-kit/utilities';
|
|
42
|
+
import { getPatternDefinition, getComponentForPattern as getComponentForPattern$1, isEntityAwarePattern } from '@almadar/patterns';
|
|
43
43
|
import { OrbitalServerRuntime } from '@almadar/runtime/OrbitalServerRuntime';
|
|
44
44
|
import { InMemoryPersistence, StateMachineManager, collectDeclaredConfigDefaults, createServerEffectHandlers, EffectExecutor, createContextFromBindings } from '@almadar/runtime';
|
|
45
45
|
|
|
@@ -584,7 +584,7 @@ var init_AvlFieldType = __esm({
|
|
|
584
584
|
}
|
|
585
585
|
});
|
|
586
586
|
|
|
587
|
-
// node_modules
|
|
587
|
+
// node_modules/clsx/dist/clsx.mjs
|
|
588
588
|
function r(e) {
|
|
589
589
|
var t, f3, n = "";
|
|
590
590
|
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
@@ -599,11 +599,11 @@ function clsx() {
|
|
|
599
599
|
return n;
|
|
600
600
|
}
|
|
601
601
|
var init_clsx = __esm({
|
|
602
|
-
"node_modules
|
|
602
|
+
"node_modules/clsx/dist/clsx.mjs"() {
|
|
603
603
|
}
|
|
604
604
|
});
|
|
605
605
|
|
|
606
|
-
// node_modules
|
|
606
|
+
// node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
607
607
|
function twJoin() {
|
|
608
608
|
let index = 0;
|
|
609
609
|
let argument;
|
|
@@ -647,7 +647,7 @@ function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
|
647
647
|
}
|
|
648
648
|
var CLASS_PART_SEPARATOR, createClassGroupUtils, getGroupRecursive, arbitraryPropertyRegex, getGroupIdForArbitraryProperty, createClassMap, processClassesRecursively, getPart, isThemeGetter, getPrefixedClassGroupEntries, createLruCache, IMPORTANT_MODIFIER, createParseClassName, sortModifiers, createConfigUtils, SPLIT_CLASSES_REGEX, mergeClassList, toValue, fromTheme, arbitraryValueRegex, fractionRegex, stringLengths, tshirtUnitRegex, lengthUnitRegex, colorFunctionRegex, shadowRegex, imageRegex, isLength, isArbitraryLength, isNumber, isArbitraryNumber, isInteger, isPercent, isArbitraryValue, isTshirtSize, sizeLabels, isArbitrarySize, isArbitraryPosition, imageLabels, isArbitraryImage, isArbitraryShadow, isAny, getIsArbitraryValue, isLengthOnly, isNever, isShadow, isImage, getDefaultConfig, twMerge;
|
|
649
649
|
var init_bundle_mjs = __esm({
|
|
650
|
-
"node_modules
|
|
650
|
+
"node_modules/tailwind-merge/dist/bundle-mjs.mjs"() {
|
|
651
651
|
CLASS_PART_SEPARATOR = "-";
|
|
652
652
|
createClassGroupUtils = (config) => {
|
|
653
653
|
const classMap = createClassMap(config);
|
|
@@ -3174,7 +3174,7 @@ var init_Typography = __esm({
|
|
|
3174
3174
|
}) => {
|
|
3175
3175
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
3176
3176
|
const Component = as || defaultElements[variant];
|
|
3177
|
-
return
|
|
3177
|
+
return React112__default.createElement(
|
|
3178
3178
|
Component,
|
|
3179
3179
|
{
|
|
3180
3180
|
id,
|
|
@@ -3511,7 +3511,7 @@ var init_Box = __esm({
|
|
|
3511
3511
|
fixed: "fixed",
|
|
3512
3512
|
sticky: "sticky"
|
|
3513
3513
|
};
|
|
3514
|
-
Box =
|
|
3514
|
+
Box = React112__default.forwardRef(
|
|
3515
3515
|
({
|
|
3516
3516
|
padding,
|
|
3517
3517
|
paddingX,
|
|
@@ -3576,7 +3576,7 @@ var init_Box = __esm({
|
|
|
3576
3576
|
onPointerDown?.(e);
|
|
3577
3577
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
3578
3578
|
const isClickable = action || onClick;
|
|
3579
|
-
return
|
|
3579
|
+
return React112__default.createElement(
|
|
3580
3580
|
Component,
|
|
3581
3581
|
{
|
|
3582
3582
|
ref,
|
|
@@ -3672,7 +3672,7 @@ var init_Stack = __esm({
|
|
|
3672
3672
|
};
|
|
3673
3673
|
const isHorizontal = direction === "horizontal";
|
|
3674
3674
|
const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
|
|
3675
|
-
return
|
|
3675
|
+
return React112__default.createElement(
|
|
3676
3676
|
Component,
|
|
3677
3677
|
{
|
|
3678
3678
|
className: cn(
|
|
@@ -4164,7 +4164,7 @@ var init_MiniStateMachine = __esm({
|
|
|
4164
4164
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
4165
4165
|
const tc = transitionCounts[s.name] ?? 0;
|
|
4166
4166
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
4167
|
-
return /* @__PURE__ */ jsxs(
|
|
4167
|
+
return /* @__PURE__ */ jsxs(React112__default.Fragment, { children: [
|
|
4168
4168
|
/* @__PURE__ */ jsx(
|
|
4169
4169
|
AvlState,
|
|
4170
4170
|
{
|
|
@@ -4494,7 +4494,7 @@ function loadLib(key, importer) {
|
|
|
4494
4494
|
return p2;
|
|
4495
4495
|
}
|
|
4496
4496
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
4497
|
-
const Lazy =
|
|
4497
|
+
const Lazy = React112__default.lazy(async () => {
|
|
4498
4498
|
const lib = await loadLib(libKey, importer);
|
|
4499
4499
|
const Comp = pick(lib);
|
|
4500
4500
|
if (!Comp) {
|
|
@@ -4504,7 +4504,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
4504
4504
|
return { default: Comp };
|
|
4505
4505
|
});
|
|
4506
4506
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
4507
|
-
|
|
4507
|
+
React112__default.Suspense,
|
|
4508
4508
|
{
|
|
4509
4509
|
fallback: /* @__PURE__ */ jsx(
|
|
4510
4510
|
"span",
|
|
@@ -5235,7 +5235,7 @@ var init_Icon = __esm({
|
|
|
5235
5235
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
5236
5236
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
5237
5237
|
const family = useIconFamily();
|
|
5238
|
-
const RenderedComponent =
|
|
5238
|
+
const RenderedComponent = React112__default.useMemo(() => {
|
|
5239
5239
|
if (directIcon) return null;
|
|
5240
5240
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
5241
5241
|
}, [directIcon, effectiveName, family]);
|
|
@@ -5297,7 +5297,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
5297
5297
|
const IconComp = value;
|
|
5298
5298
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
5299
5299
|
}
|
|
5300
|
-
if (
|
|
5300
|
+
if (React112__default.isValidElement(value)) {
|
|
5301
5301
|
return value;
|
|
5302
5302
|
}
|
|
5303
5303
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -5373,7 +5373,7 @@ var init_Button = __esm({
|
|
|
5373
5373
|
md: "h-icon-default w-icon-default",
|
|
5374
5374
|
lg: "h-icon-default w-icon-default"
|
|
5375
5375
|
};
|
|
5376
|
-
Button =
|
|
5376
|
+
Button = React112__default.forwardRef(
|
|
5377
5377
|
({
|
|
5378
5378
|
className,
|
|
5379
5379
|
variant = "primary",
|
|
@@ -5439,7 +5439,7 @@ var Dialog;
|
|
|
5439
5439
|
var init_Dialog = __esm({
|
|
5440
5440
|
"components/core/atoms/Dialog.tsx"() {
|
|
5441
5441
|
init_cn();
|
|
5442
|
-
Dialog =
|
|
5442
|
+
Dialog = React112__default.forwardRef(
|
|
5443
5443
|
({
|
|
5444
5444
|
role = "dialog",
|
|
5445
5445
|
"aria-modal": ariaModal = true,
|
|
@@ -5934,7 +5934,7 @@ var init_Badge = __esm({
|
|
|
5934
5934
|
md: "px-2.5 py-1 text-sm",
|
|
5935
5935
|
lg: "px-3 py-1.5 text-base"
|
|
5936
5936
|
};
|
|
5937
|
-
Badge =
|
|
5937
|
+
Badge = React112__default.forwardRef(
|
|
5938
5938
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
5939
5939
|
const iconSizes3 = {
|
|
5940
5940
|
sm: "h-icon-default w-icon-default",
|
|
@@ -6270,7 +6270,7 @@ var init_SvgFlow = __esm({
|
|
|
6270
6270
|
width = 100,
|
|
6271
6271
|
height = 100
|
|
6272
6272
|
}) => {
|
|
6273
|
-
const markerId =
|
|
6273
|
+
const markerId = React112__default.useMemo(() => {
|
|
6274
6274
|
flowIdCounter += 1;
|
|
6275
6275
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
6276
6276
|
}, []);
|
|
@@ -6863,7 +6863,7 @@ var init_SvgRing = __esm({
|
|
|
6863
6863
|
width = 100,
|
|
6864
6864
|
height = 100
|
|
6865
6865
|
}) => {
|
|
6866
|
-
const gradientId =
|
|
6866
|
+
const gradientId = React112__default.useMemo(() => {
|
|
6867
6867
|
ringIdCounter += 1;
|
|
6868
6868
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
6869
6869
|
}, []);
|
|
@@ -7044,7 +7044,7 @@ var init_Input = __esm({
|
|
|
7044
7044
|
init_cn();
|
|
7045
7045
|
init_Icon();
|
|
7046
7046
|
init_useEventBus();
|
|
7047
|
-
Input =
|
|
7047
|
+
Input = React112__default.forwardRef(
|
|
7048
7048
|
({
|
|
7049
7049
|
className,
|
|
7050
7050
|
inputType,
|
|
@@ -7204,7 +7204,7 @@ var Label;
|
|
|
7204
7204
|
var init_Label = __esm({
|
|
7205
7205
|
"components/core/atoms/Label.tsx"() {
|
|
7206
7206
|
init_cn();
|
|
7207
|
-
Label =
|
|
7207
|
+
Label = React112__default.forwardRef(
|
|
7208
7208
|
({ className, required, children, ...props }, ref) => {
|
|
7209
7209
|
return /* @__PURE__ */ jsxs(
|
|
7210
7210
|
"label",
|
|
@@ -7231,7 +7231,7 @@ var init_Textarea = __esm({
|
|
|
7231
7231
|
"components/core/atoms/Textarea.tsx"() {
|
|
7232
7232
|
init_cn();
|
|
7233
7233
|
init_useEventBus();
|
|
7234
|
-
Textarea =
|
|
7234
|
+
Textarea = React112__default.forwardRef(
|
|
7235
7235
|
({ className, error, onChange, ...props }, ref) => {
|
|
7236
7236
|
const eventBus = useEventBus();
|
|
7237
7237
|
const handleChange = (e) => {
|
|
@@ -7470,7 +7470,7 @@ var init_Select = __esm({
|
|
|
7470
7470
|
init_cn();
|
|
7471
7471
|
init_Icon();
|
|
7472
7472
|
init_useEventBus();
|
|
7473
|
-
Select =
|
|
7473
|
+
Select = React112__default.forwardRef(
|
|
7474
7474
|
(props, _ref) => {
|
|
7475
7475
|
const { multiple, searchable, clearable } = props;
|
|
7476
7476
|
if (multiple || searchable || clearable) {
|
|
@@ -7487,7 +7487,7 @@ var init_Checkbox = __esm({
|
|
|
7487
7487
|
"components/core/atoms/Checkbox.tsx"() {
|
|
7488
7488
|
init_cn();
|
|
7489
7489
|
init_useEventBus();
|
|
7490
|
-
Checkbox =
|
|
7490
|
+
Checkbox = React112__default.forwardRef(
|
|
7491
7491
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
7492
7492
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
7493
7493
|
const eventBus = useEventBus();
|
|
@@ -7541,7 +7541,7 @@ var init_Spinner = __esm({
|
|
|
7541
7541
|
md: "h-6 w-6",
|
|
7542
7542
|
lg: "h-8 w-8"
|
|
7543
7543
|
};
|
|
7544
|
-
Spinner =
|
|
7544
|
+
Spinner = React112__default.forwardRef(
|
|
7545
7545
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
7546
7546
|
if (overlay) {
|
|
7547
7547
|
return /* @__PURE__ */ jsx(
|
|
@@ -7631,7 +7631,7 @@ var init_Card = __esm({
|
|
|
7631
7631
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
7632
7632
|
"tile-image-first": "p-0 overflow-hidden"
|
|
7633
7633
|
};
|
|
7634
|
-
Card =
|
|
7634
|
+
Card = React112__default.forwardRef(
|
|
7635
7635
|
({
|
|
7636
7636
|
className,
|
|
7637
7637
|
variant = "bordered",
|
|
@@ -7679,9 +7679,9 @@ var init_Card = __esm({
|
|
|
7679
7679
|
}
|
|
7680
7680
|
);
|
|
7681
7681
|
Card.displayName = "Card";
|
|
7682
|
-
CardHeader =
|
|
7682
|
+
CardHeader = React112__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
7683
7683
|
CardHeader.displayName = "CardHeader";
|
|
7684
|
-
CardTitle =
|
|
7684
|
+
CardTitle = React112__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7685
7685
|
"h3",
|
|
7686
7686
|
{
|
|
7687
7687
|
ref,
|
|
@@ -7694,11 +7694,11 @@ var init_Card = __esm({
|
|
|
7694
7694
|
}
|
|
7695
7695
|
));
|
|
7696
7696
|
CardTitle.displayName = "CardTitle";
|
|
7697
|
-
CardContent =
|
|
7697
|
+
CardContent = React112__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
7698
7698
|
CardContent.displayName = "CardContent";
|
|
7699
7699
|
CardBody = CardContent;
|
|
7700
7700
|
CardBody.displayName = "CardBody";
|
|
7701
|
-
CardFooter =
|
|
7701
|
+
CardFooter = React112__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7702
7702
|
"div",
|
|
7703
7703
|
{
|
|
7704
7704
|
ref,
|
|
@@ -7753,7 +7753,7 @@ var init_FilterPill = __esm({
|
|
|
7753
7753
|
md: "w-3.5 h-3.5",
|
|
7754
7754
|
lg: "w-4 h-4"
|
|
7755
7755
|
};
|
|
7756
|
-
FilterPill =
|
|
7756
|
+
FilterPill = React112__default.forwardRef(
|
|
7757
7757
|
({
|
|
7758
7758
|
className,
|
|
7759
7759
|
variant = "default",
|
|
@@ -7882,8 +7882,8 @@ var init_Avatar = __esm({
|
|
|
7882
7882
|
actionPayload
|
|
7883
7883
|
}) => {
|
|
7884
7884
|
const eventBus = useEventBus();
|
|
7885
|
-
const [imgFailed, setImgFailed] =
|
|
7886
|
-
|
|
7885
|
+
const [imgFailed, setImgFailed] = React112__default.useState(false);
|
|
7886
|
+
React112__default.useEffect(() => {
|
|
7887
7887
|
setImgFailed(false);
|
|
7888
7888
|
}, [src]);
|
|
7889
7889
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -7996,7 +7996,7 @@ var init_Center = __esm({
|
|
|
7996
7996
|
as: Component = "div"
|
|
7997
7997
|
}) => {
|
|
7998
7998
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
7999
|
-
return
|
|
7999
|
+
return React112__default.createElement(Component, {
|
|
8000
8000
|
className: cn(
|
|
8001
8001
|
inline ? "inline-flex" : "flex",
|
|
8002
8002
|
horizontal && "justify-center",
|
|
@@ -8264,7 +8264,7 @@ var init_Radio = __esm({
|
|
|
8264
8264
|
md: "w-2.5 h-2.5",
|
|
8265
8265
|
lg: "w-3 h-3"
|
|
8266
8266
|
};
|
|
8267
|
-
Radio =
|
|
8267
|
+
Radio = React112__default.forwardRef(
|
|
8268
8268
|
({
|
|
8269
8269
|
label,
|
|
8270
8270
|
helperText,
|
|
@@ -8281,12 +8281,12 @@ var init_Radio = __esm({
|
|
|
8281
8281
|
onChange,
|
|
8282
8282
|
...props
|
|
8283
8283
|
}, ref) => {
|
|
8284
|
-
const reactId =
|
|
8284
|
+
const reactId = React112__default.useId();
|
|
8285
8285
|
const baseId = id || `radio-${reactId}`;
|
|
8286
8286
|
const hasError = !!error;
|
|
8287
8287
|
const eventBus = useEventBus();
|
|
8288
|
-
const [selected, setSelected] =
|
|
8289
|
-
|
|
8288
|
+
const [selected, setSelected] = React112__default.useState(value);
|
|
8289
|
+
React112__default.useEffect(() => {
|
|
8290
8290
|
if (value !== void 0) setSelected(value);
|
|
8291
8291
|
}, [value]);
|
|
8292
8292
|
const pick = (next, e) => {
|
|
@@ -8468,7 +8468,7 @@ var init_Switch = __esm({
|
|
|
8468
8468
|
"components/core/atoms/Switch.tsx"() {
|
|
8469
8469
|
"use client";
|
|
8470
8470
|
init_cn();
|
|
8471
|
-
Switch =
|
|
8471
|
+
Switch = React112.forwardRef(
|
|
8472
8472
|
({
|
|
8473
8473
|
checked,
|
|
8474
8474
|
defaultChecked = false,
|
|
@@ -8479,10 +8479,10 @@ var init_Switch = __esm({
|
|
|
8479
8479
|
name,
|
|
8480
8480
|
className
|
|
8481
8481
|
}, ref) => {
|
|
8482
|
-
const [isChecked, setIsChecked] =
|
|
8482
|
+
const [isChecked, setIsChecked] = React112.useState(
|
|
8483
8483
|
checked !== void 0 ? checked : defaultChecked
|
|
8484
8484
|
);
|
|
8485
|
-
|
|
8485
|
+
React112.useEffect(() => {
|
|
8486
8486
|
if (checked !== void 0) {
|
|
8487
8487
|
setIsChecked(checked);
|
|
8488
8488
|
}
|
|
@@ -8760,7 +8760,7 @@ var Aside;
|
|
|
8760
8760
|
var init_Aside = __esm({
|
|
8761
8761
|
"components/core/atoms/Aside.tsx"() {
|
|
8762
8762
|
init_cn();
|
|
8763
|
-
Aside =
|
|
8763
|
+
Aside = React112__default.forwardRef(
|
|
8764
8764
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
8765
8765
|
);
|
|
8766
8766
|
Aside.displayName = "Aside";
|
|
@@ -8839,9 +8839,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
8839
8839
|
className
|
|
8840
8840
|
}) => {
|
|
8841
8841
|
const { t } = useTranslate();
|
|
8842
|
-
const [isVisible, setIsVisible] =
|
|
8843
|
-
const timeoutRef =
|
|
8844
|
-
const triggerRef =
|
|
8842
|
+
const [isVisible, setIsVisible] = React112__default.useState(false);
|
|
8843
|
+
const timeoutRef = React112__default.useRef(null);
|
|
8844
|
+
const triggerRef = React112__default.useRef(null);
|
|
8845
8845
|
const handleMouseEnter = () => {
|
|
8846
8846
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8847
8847
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -8852,7 +8852,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
8852
8852
|
};
|
|
8853
8853
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
8854
8854
|
const open = isVisible || revealed;
|
|
8855
|
-
|
|
8855
|
+
React112__default.useEffect(() => {
|
|
8856
8856
|
return () => {
|
|
8857
8857
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8858
8858
|
};
|
|
@@ -9062,7 +9062,7 @@ var init_StatusDot = __esm({
|
|
|
9062
9062
|
md: "w-2.5 h-2.5",
|
|
9063
9063
|
lg: "w-3 h-3"
|
|
9064
9064
|
};
|
|
9065
|
-
StatusDot =
|
|
9065
|
+
StatusDot = React112__default.forwardRef(
|
|
9066
9066
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
9067
9067
|
return /* @__PURE__ */ jsx(
|
|
9068
9068
|
"span",
|
|
@@ -9116,7 +9116,7 @@ var init_TrendIndicator = __esm({
|
|
|
9116
9116
|
down: "trending-down",
|
|
9117
9117
|
flat: "arrow-right"
|
|
9118
9118
|
};
|
|
9119
|
-
TrendIndicator =
|
|
9119
|
+
TrendIndicator = React112__default.forwardRef(
|
|
9120
9120
|
({
|
|
9121
9121
|
className,
|
|
9122
9122
|
value,
|
|
@@ -9183,7 +9183,7 @@ var init_RangeSlider = __esm({
|
|
|
9183
9183
|
md: "w-4 h-4",
|
|
9184
9184
|
lg: "w-5 h-5"
|
|
9185
9185
|
};
|
|
9186
|
-
RangeSlider =
|
|
9186
|
+
RangeSlider = React112__default.forwardRef(
|
|
9187
9187
|
({
|
|
9188
9188
|
className,
|
|
9189
9189
|
min = 0,
|
|
@@ -9777,7 +9777,7 @@ var init_ContentSection = __esm({
|
|
|
9777
9777
|
md: "py-16",
|
|
9778
9778
|
lg: "py-24"
|
|
9779
9779
|
};
|
|
9780
|
-
ContentSection =
|
|
9780
|
+
ContentSection = React112__default.forwardRef(
|
|
9781
9781
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
9782
9782
|
return /* @__PURE__ */ jsx(
|
|
9783
9783
|
Box,
|
|
@@ -10311,7 +10311,7 @@ var init_AnimatedReveal = __esm({
|
|
|
10311
10311
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
10312
10312
|
"none": {}
|
|
10313
10313
|
};
|
|
10314
|
-
AnimatedReveal =
|
|
10314
|
+
AnimatedReveal = React112__default.forwardRef(
|
|
10315
10315
|
({
|
|
10316
10316
|
trigger = "scroll",
|
|
10317
10317
|
animation = "fade-up",
|
|
@@ -10471,7 +10471,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
10471
10471
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
10472
10472
|
"use client";
|
|
10473
10473
|
init_cn();
|
|
10474
|
-
AnimatedGraphic =
|
|
10474
|
+
AnimatedGraphic = React112__default.forwardRef(
|
|
10475
10475
|
({
|
|
10476
10476
|
src,
|
|
10477
10477
|
svgContent,
|
|
@@ -10494,7 +10494,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
10494
10494
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
10495
10495
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
10496
10496
|
const prevAnimateRef = useRef(animate);
|
|
10497
|
-
const setRef =
|
|
10497
|
+
const setRef = React112__default.useCallback(
|
|
10498
10498
|
(node) => {
|
|
10499
10499
|
containerRef.current = node;
|
|
10500
10500
|
if (typeof ref === "function") ref(node);
|
|
@@ -12111,6 +12111,38 @@ var init_shared = __esm({
|
|
|
12111
12111
|
init_canvasEffects();
|
|
12112
12112
|
}
|
|
12113
12113
|
});
|
|
12114
|
+
function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
|
|
12115
|
+
const px = typeof size === "number" ? size : sizeMap[size];
|
|
12116
|
+
if (assetUrl?.url) {
|
|
12117
|
+
return /* @__PURE__ */ jsx(
|
|
12118
|
+
"img",
|
|
12119
|
+
{
|
|
12120
|
+
src: assetUrl.url,
|
|
12121
|
+
alt: alt ?? assetUrl.category ?? "",
|
|
12122
|
+
width: px,
|
|
12123
|
+
height: px,
|
|
12124
|
+
style: { imageRendering: "pixelated", objectFit: "contain", width: px, height: px },
|
|
12125
|
+
className: cn("flex-shrink-0", className)
|
|
12126
|
+
}
|
|
12127
|
+
);
|
|
12128
|
+
}
|
|
12129
|
+
const I = typeof icon === "string" ? resolveIcon(icon) : icon;
|
|
12130
|
+
return /* @__PURE__ */ jsx(I, { width: px, height: px, className: cn("flex-shrink-0", className) });
|
|
12131
|
+
}
|
|
12132
|
+
var sizeMap;
|
|
12133
|
+
var init_GameIcon = __esm({
|
|
12134
|
+
"components/game/2d/atoms/GameIcon.tsx"() {
|
|
12135
|
+
"use client";
|
|
12136
|
+
init_cn();
|
|
12137
|
+
init_Icon();
|
|
12138
|
+
sizeMap = {
|
|
12139
|
+
sm: 16,
|
|
12140
|
+
md: 24,
|
|
12141
|
+
lg: 32
|
|
12142
|
+
};
|
|
12143
|
+
GameIcon.displayName = "GameIcon";
|
|
12144
|
+
}
|
|
12145
|
+
});
|
|
12114
12146
|
function GameCard({
|
|
12115
12147
|
id,
|
|
12116
12148
|
cost,
|
|
@@ -12126,16 +12158,16 @@ function GameCard({
|
|
|
12126
12158
|
className
|
|
12127
12159
|
}) {
|
|
12128
12160
|
const eventBus = useEventBus();
|
|
12129
|
-
const handleClick =
|
|
12161
|
+
const handleClick = React112.useCallback(() => {
|
|
12130
12162
|
if (disabled) return;
|
|
12131
12163
|
onClick?.(id);
|
|
12132
12164
|
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
|
|
12133
12165
|
}, [disabled, id, onClick, clickEvent, eventBus]);
|
|
12134
12166
|
const artPx = artPxMap[size];
|
|
12135
12167
|
return /* @__PURE__ */ jsxs(
|
|
12136
|
-
|
|
12168
|
+
Button,
|
|
12137
12169
|
{
|
|
12138
|
-
|
|
12170
|
+
variant: "ghost",
|
|
12139
12171
|
onClick: handleClick,
|
|
12140
12172
|
disabled,
|
|
12141
12173
|
title: name,
|
|
@@ -12149,8 +12181,9 @@ function GameCard({
|
|
|
12149
12181
|
),
|
|
12150
12182
|
children: [
|
|
12151
12183
|
cost != null && /* @__PURE__ */ jsx(
|
|
12152
|
-
|
|
12184
|
+
Typography,
|
|
12153
12185
|
{
|
|
12186
|
+
as: "span",
|
|
12154
12187
|
className: cn(
|
|
12155
12188
|
"absolute -top-2 -left-2 flex items-center justify-center",
|
|
12156
12189
|
"min-w-[22px] h-[22px] rounded-full px-1",
|
|
@@ -12159,17 +12192,7 @@ function GameCard({
|
|
|
12159
12192
|
children: cost
|
|
12160
12193
|
}
|
|
12161
12194
|
),
|
|
12162
|
-
/* @__PURE__ */ jsx(Box, { className: "flex-1 flex items-center justify-center w-full", children: art ? /* @__PURE__ */ jsx(
|
|
12163
|
-
"img",
|
|
12164
|
-
{
|
|
12165
|
-
src: art.url,
|
|
12166
|
-
alt: name ?? id,
|
|
12167
|
-
width: artPx,
|
|
12168
|
-
height: artPx,
|
|
12169
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
12170
|
-
className: "flex-shrink-0"
|
|
12171
|
-
}
|
|
12172
|
-
) : /* @__PURE__ */ jsx(Box, { className: "rounded bg-muted/40", style: { width: artPx, height: artPx } }) }),
|
|
12195
|
+
/* @__PURE__ */ jsx(Box, { className: "flex-1 flex items-center justify-center w-full", children: art ? /* @__PURE__ */ jsx(GameIcon, { assetUrl: art, icon: "image", size: artPx, alt: name ?? id, className: "flex-shrink-0" }) : /* @__PURE__ */ jsx(Box, { className: "rounded bg-muted/40", style: { width: artPx, height: artPx } }) }),
|
|
12173
12196
|
name != null && /* @__PURE__ */ jsx(
|
|
12174
12197
|
Typography,
|
|
12175
12198
|
{
|
|
@@ -12179,8 +12202,8 @@ function GameCard({
|
|
|
12179
12202
|
}
|
|
12180
12203
|
),
|
|
12181
12204
|
(attack != null || defense != null) && /* @__PURE__ */ jsxs(Box, { className: "flex w-full items-center justify-between px-0.5 text-[10px] font-bold leading-none", children: [
|
|
12182
|
-
/* @__PURE__ */ jsx("span",
|
|
12183
|
-
/* @__PURE__ */ jsx("span",
|
|
12205
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-error", children: attack != null ? `\u2694${attack}` : "" }),
|
|
12206
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-info", children: defense != null ? `\u{1F6E1}${defense}` : "" })
|
|
12184
12207
|
] })
|
|
12185
12208
|
]
|
|
12186
12209
|
}
|
|
@@ -12193,7 +12216,9 @@ var init_GameCard = __esm({
|
|
|
12193
12216
|
init_cn();
|
|
12194
12217
|
init_useEventBus();
|
|
12195
12218
|
init_Box();
|
|
12219
|
+
init_Button();
|
|
12196
12220
|
init_Typography();
|
|
12221
|
+
init_GameIcon();
|
|
12197
12222
|
cardSizeMap = {
|
|
12198
12223
|
sm: "w-16 h-24",
|
|
12199
12224
|
md: "w-20 h-28",
|
|
@@ -12212,14 +12237,17 @@ function HealthBar({
|
|
|
12212
12237
|
labelSuffix,
|
|
12213
12238
|
size = "md",
|
|
12214
12239
|
className,
|
|
12215
|
-
animated = true
|
|
12240
|
+
animated = true,
|
|
12241
|
+
frameAsset,
|
|
12242
|
+
fillAsset
|
|
12216
12243
|
}) {
|
|
12217
|
-
const sizes =
|
|
12244
|
+
const sizes = sizeMap2[size];
|
|
12218
12245
|
const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
|
|
12219
12246
|
if (format === "hearts") {
|
|
12220
|
-
return /* @__PURE__ */ jsx(
|
|
12221
|
-
|
|
12247
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("flex items-center gap-1", className), children: Array.from({ length: max }).map((_, i) => /* @__PURE__ */ jsx(
|
|
12248
|
+
Box,
|
|
12222
12249
|
{
|
|
12250
|
+
as: "span",
|
|
12223
12251
|
className: cn(animated && "transition-transform hover:scale-110"),
|
|
12224
12252
|
children: heartIcon(i < current, sizes.heart)
|
|
12225
12253
|
},
|
|
@@ -12228,33 +12256,42 @@ function HealthBar({
|
|
|
12228
12256
|
}
|
|
12229
12257
|
if (format === "bar") {
|
|
12230
12258
|
return /* @__PURE__ */ jsx(
|
|
12231
|
-
|
|
12259
|
+
Box,
|
|
12232
12260
|
{
|
|
12261
|
+
position: "relative",
|
|
12262
|
+
overflow: "hidden",
|
|
12233
12263
|
className: cn(
|
|
12234
|
-
"
|
|
12264
|
+
"rounded-full",
|
|
12265
|
+
!frameAsset && "bg-muted",
|
|
12235
12266
|
sizes.bar,
|
|
12236
12267
|
"w-24",
|
|
12237
12268
|
className
|
|
12238
12269
|
),
|
|
12270
|
+
style: frameAsset ? { backgroundImage: `url(${frameAsset.url})`, backgroundSize: "100% 100%" } : void 0,
|
|
12239
12271
|
children: /* @__PURE__ */ jsx(
|
|
12240
|
-
|
|
12272
|
+
Box,
|
|
12241
12273
|
{
|
|
12274
|
+
position: "absolute",
|
|
12242
12275
|
className: cn(
|
|
12243
|
-
"
|
|
12244
|
-
percentage > 66 ? "bg-success" : percentage > 33 ? "bg-warning" : "bg-error",
|
|
12276
|
+
"inset-y-0 left-0 rounded-full",
|
|
12277
|
+
!fillAsset && (percentage > 66 ? "bg-success" : percentage > 33 ? "bg-warning" : "bg-error"),
|
|
12245
12278
|
animated && "transition-all duration-300"
|
|
12246
12279
|
),
|
|
12247
|
-
style: {
|
|
12280
|
+
style: {
|
|
12281
|
+
width: `${percentage}%`,
|
|
12282
|
+
...fillAsset ? { backgroundImage: `url(${fillAsset.url})`, backgroundSize: "auto 100%" } : {}
|
|
12283
|
+
}
|
|
12248
12284
|
}
|
|
12249
12285
|
)
|
|
12250
12286
|
}
|
|
12251
12287
|
);
|
|
12252
12288
|
}
|
|
12253
12289
|
if (format === "progress") {
|
|
12254
|
-
return /* @__PURE__ */ jsxs(
|
|
12290
|
+
return /* @__PURE__ */ jsxs(Box, { className: cn("flex items-center gap-2", className), children: [
|
|
12255
12291
|
level != null && /* @__PURE__ */ jsxs(
|
|
12256
|
-
|
|
12292
|
+
Typography,
|
|
12257
12293
|
{
|
|
12294
|
+
as: "span",
|
|
12258
12295
|
className: cn(
|
|
12259
12296
|
"flex-shrink-0 rounded-interactive font-bold",
|
|
12260
12297
|
"bg-accent text-accent-foreground border border-accent",
|
|
@@ -12266,28 +12303,35 @@ function HealthBar({
|
|
|
12266
12303
|
]
|
|
12267
12304
|
}
|
|
12268
12305
|
),
|
|
12269
|
-
/* @__PURE__ */ jsxs(
|
|
12306
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex-1 flex flex-col gap-0.5", children: [
|
|
12270
12307
|
/* @__PURE__ */ jsx(
|
|
12271
|
-
|
|
12308
|
+
Box,
|
|
12272
12309
|
{
|
|
12310
|
+
position: "relative",
|
|
12273
12311
|
className: cn(
|
|
12274
|
-
"
|
|
12312
|
+
"w-full overflow-hidden rounded-full",
|
|
12313
|
+
!frameAsset && "bg-muted border border-muted",
|
|
12275
12314
|
sizes.bar
|
|
12276
12315
|
),
|
|
12316
|
+
style: frameAsset ? { backgroundImage: `url(${frameAsset.url})`, backgroundSize: "100% 100%" } : void 0,
|
|
12277
12317
|
children: /* @__PURE__ */ jsx(
|
|
12278
|
-
|
|
12318
|
+
Box,
|
|
12279
12319
|
{
|
|
12320
|
+
position: "absolute",
|
|
12280
12321
|
className: cn(
|
|
12281
|
-
"
|
|
12282
|
-
"bg-gradient-to-r from-accent to-info",
|
|
12322
|
+
"inset-y-0 left-0 rounded-full",
|
|
12323
|
+
!fillAsset && "bg-gradient-to-r from-accent to-info",
|
|
12283
12324
|
animated && "transition-all duration-500 ease-out"
|
|
12284
12325
|
),
|
|
12285
|
-
style: {
|
|
12326
|
+
style: {
|
|
12327
|
+
width: `${percentage}%`,
|
|
12328
|
+
...fillAsset ? { backgroundImage: `url(${fillAsset.url})`, backgroundSize: "auto 100%" } : {}
|
|
12329
|
+
}
|
|
12286
12330
|
}
|
|
12287
12331
|
)
|
|
12288
12332
|
}
|
|
12289
12333
|
),
|
|
12290
|
-
showLabel && /* @__PURE__ */ jsxs("span",
|
|
12334
|
+
showLabel && /* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("text-foreground/70 tabular-nums", sizes.label), children: [
|
|
12291
12335
|
current,
|
|
12292
12336
|
" / ",
|
|
12293
12337
|
max,
|
|
@@ -12296,16 +12340,18 @@ function HealthBar({
|
|
|
12296
12340
|
] })
|
|
12297
12341
|
] });
|
|
12298
12342
|
}
|
|
12299
|
-
return /* @__PURE__ */ jsxs("span",
|
|
12343
|
+
return /* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("font-mono font-bold", sizes.text, className), children: [
|
|
12300
12344
|
current,
|
|
12301
12345
|
"/",
|
|
12302
12346
|
max
|
|
12303
12347
|
] });
|
|
12304
12348
|
}
|
|
12305
|
-
var heartIcon,
|
|
12349
|
+
var heartIcon, sizeMap2;
|
|
12306
12350
|
var init_HealthBar = __esm({
|
|
12307
12351
|
"components/game/2d/atoms/HealthBar.tsx"() {
|
|
12308
12352
|
init_cn();
|
|
12353
|
+
init_Box();
|
|
12354
|
+
init_Typography();
|
|
12309
12355
|
heartIcon = (filled, size) => /* @__PURE__ */ jsx(
|
|
12310
12356
|
"svg",
|
|
12311
12357
|
{
|
|
@@ -12317,7 +12363,7 @@ var init_HealthBar = __esm({
|
|
|
12317
12363
|
children: /* @__PURE__ */ jsx("path", { d: "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" })
|
|
12318
12364
|
}
|
|
12319
12365
|
);
|
|
12320
|
-
|
|
12366
|
+
sizeMap2 = {
|
|
12321
12367
|
sm: { heart: "w-4 h-4", bar: "h-2", text: "text-sm", label: "text-xs", badge: "text-xs px-1.5 py-0.5" },
|
|
12322
12368
|
md: { heart: "w-6 h-6", bar: "h-3", text: "text-base", label: "text-xs", badge: "text-xs px-2 py-0.5" },
|
|
12323
12369
|
lg: { heart: "w-8 h-8", bar: "h-4", text: "text-lg", label: "text-sm", badge: "text-sm px-2.5 py-1" }
|
|
@@ -12338,37 +12384,30 @@ function ScoreDisplay({
|
|
|
12338
12384
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof score === "number" && !Number.isNaN(score) ? score : 0;
|
|
12339
12385
|
const formattedValue = new Intl.NumberFormat(locale).format(resolvedValue);
|
|
12340
12386
|
return /* @__PURE__ */ jsxs(
|
|
12341
|
-
|
|
12387
|
+
Box,
|
|
12342
12388
|
{
|
|
12343
12389
|
className: cn(
|
|
12344
12390
|
"flex items-center gap-2 font-bold",
|
|
12345
|
-
|
|
12391
|
+
sizeMap3[size],
|
|
12346
12392
|
className
|
|
12347
12393
|
),
|
|
12348
12394
|
children: [
|
|
12349
|
-
assetUrl ? /* @__PURE__ */ jsx(
|
|
12350
|
-
|
|
12351
|
-
|
|
12352
|
-
src: assetUrl.url,
|
|
12353
|
-
alt: "",
|
|
12354
|
-
width: 20,
|
|
12355
|
-
height: 20,
|
|
12356
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
12357
|
-
className: "flex-shrink-0"
|
|
12358
|
-
}
|
|
12359
|
-
) : icon ? /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) }) : null,
|
|
12360
|
-
label && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: label }),
|
|
12361
|
-
/* @__PURE__ */ jsx("span", { className: "tabular-nums", children: formattedValue })
|
|
12395
|
+
assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 20, className: "flex-shrink-0" }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: "flex-shrink-0", children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) }) : null,
|
|
12396
|
+
label && /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: label }),
|
|
12397
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "tabular-nums", children: formattedValue })
|
|
12362
12398
|
]
|
|
12363
12399
|
}
|
|
12364
12400
|
);
|
|
12365
12401
|
}
|
|
12366
|
-
var
|
|
12402
|
+
var sizeMap3, DEFAULT_ASSET_URL;
|
|
12367
12403
|
var init_ScoreDisplay = __esm({
|
|
12368
12404
|
"components/game/2d/atoms/ScoreDisplay.tsx"() {
|
|
12369
12405
|
init_cn();
|
|
12370
12406
|
init_Icon();
|
|
12371
|
-
|
|
12407
|
+
init_Box();
|
|
12408
|
+
init_Typography();
|
|
12409
|
+
init_GameIcon();
|
|
12410
|
+
sizeMap3 = {
|
|
12372
12411
|
sm: "text-sm",
|
|
12373
12412
|
md: "text-lg",
|
|
12374
12413
|
lg: "text-2xl",
|
|
@@ -12398,9 +12437,9 @@ function ControlButton({
|
|
|
12398
12437
|
className
|
|
12399
12438
|
}) {
|
|
12400
12439
|
const eventBus = useEventBus();
|
|
12401
|
-
const [isPressed, setIsPressed] =
|
|
12440
|
+
const [isPressed, setIsPressed] = React112.useState(false);
|
|
12402
12441
|
const actualPressed = pressed ?? isPressed;
|
|
12403
|
-
const handlePointerDown =
|
|
12442
|
+
const handlePointerDown = React112.useCallback(
|
|
12404
12443
|
(e) => {
|
|
12405
12444
|
e.preventDefault();
|
|
12406
12445
|
if (disabled) return;
|
|
@@ -12410,7 +12449,7 @@ function ControlButton({
|
|
|
12410
12449
|
},
|
|
12411
12450
|
[disabled, pressEvent, eventBus, onPress]
|
|
12412
12451
|
);
|
|
12413
|
-
const handlePointerUp =
|
|
12452
|
+
const handlePointerUp = React112.useCallback(
|
|
12414
12453
|
(e) => {
|
|
12415
12454
|
e.preventDefault();
|
|
12416
12455
|
if (disabled) return;
|
|
@@ -12420,7 +12459,7 @@ function ControlButton({
|
|
|
12420
12459
|
},
|
|
12421
12460
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
12422
12461
|
);
|
|
12423
|
-
const handlePointerLeave =
|
|
12462
|
+
const handlePointerLeave = React112.useCallback(
|
|
12424
12463
|
(e) => {
|
|
12425
12464
|
if (isPressed) {
|
|
12426
12465
|
setIsPressed(false);
|
|
@@ -12431,9 +12470,9 @@ function ControlButton({
|
|
|
12431
12470
|
[isPressed, releaseEvent, eventBus, onRelease]
|
|
12432
12471
|
);
|
|
12433
12472
|
return /* @__PURE__ */ jsx(
|
|
12434
|
-
|
|
12473
|
+
Button,
|
|
12435
12474
|
{
|
|
12436
|
-
|
|
12475
|
+
variant,
|
|
12437
12476
|
disabled,
|
|
12438
12477
|
onPointerDown: handlePointerDown,
|
|
12439
12478
|
onPointerUp: handlePointerUp,
|
|
@@ -12444,41 +12483,35 @@ function ControlButton({
|
|
|
12444
12483
|
"select-none touch-none",
|
|
12445
12484
|
"transition-all duration-100",
|
|
12446
12485
|
"active:scale-95",
|
|
12447
|
-
|
|
12486
|
+
sizeMap4[size] ?? sizeMap4.md,
|
|
12448
12487
|
shapeMap[shape] ?? shapeMap.circle,
|
|
12449
12488
|
variantMap[variant] ?? variantMap.secondary,
|
|
12450
12489
|
actualPressed && "scale-95 brightness-110 border-foreground",
|
|
12451
12490
|
disabled && "opacity-50 cursor-not-allowed",
|
|
12452
12491
|
className
|
|
12453
12492
|
),
|
|
12454
|
-
children: assetUrl ? /* @__PURE__ */ jsx(
|
|
12455
|
-
"img",
|
|
12456
|
-
{
|
|
12457
|
-
src: assetUrl.url,
|
|
12458
|
-
alt: "",
|
|
12459
|
-
width: 24,
|
|
12460
|
-
height: 24,
|
|
12461
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
12462
|
-
className: "flex-shrink-0"
|
|
12463
|
-
}
|
|
12464
|
-
) : icon ? /* @__PURE__ */ jsx("span", { className: "text-2xl", children: typeof icon === "string" ? /^[a-zA-Z0-9-]+$/.test(icon) ? (() => {
|
|
12493
|
+
children: assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 24, className: "flex-shrink-0" }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: "text-2xl", children: typeof icon === "string" ? /^[a-zA-Z0-9-]+$/.test(icon) ? (() => {
|
|
12465
12494
|
const I = resolveIcon(icon);
|
|
12466
12495
|
return I ? /* @__PURE__ */ jsx(I, { className: "w-6 h-6" }) : null;
|
|
12467
12496
|
})() : icon : /* @__PURE__ */ (() => {
|
|
12468
12497
|
const I = icon;
|
|
12469
12498
|
return /* @__PURE__ */ jsx(I, { className: "w-6 h-6" });
|
|
12470
|
-
})() }) : label ? /* @__PURE__ */ jsx("span",
|
|
12499
|
+
})() }) : label ? /* @__PURE__ */ jsx(Typography, { as: "span", children: label }) : null
|
|
12471
12500
|
}
|
|
12472
12501
|
);
|
|
12473
12502
|
}
|
|
12474
|
-
var
|
|
12503
|
+
var sizeMap4, shapeMap, variantMap, DEFAULT_ASSET_URL2;
|
|
12475
12504
|
var init_ControlButton = __esm({
|
|
12476
12505
|
"components/game/2d/atoms/ControlButton.tsx"() {
|
|
12477
12506
|
"use client";
|
|
12478
12507
|
init_cn();
|
|
12479
12508
|
init_useEventBus();
|
|
12480
12509
|
init_Icon();
|
|
12481
|
-
|
|
12510
|
+
init_Button();
|
|
12511
|
+
init_Box();
|
|
12512
|
+
init_Typography();
|
|
12513
|
+
init_GameIcon();
|
|
12514
|
+
sizeMap4 = {
|
|
12482
12515
|
sm: "w-10 h-10 text-sm",
|
|
12483
12516
|
md: "w-14 h-14 text-base",
|
|
12484
12517
|
lg: "w-18 h-18 text-lg",
|
|
@@ -12548,12 +12581,12 @@ function Sprite({
|
|
|
12548
12581
|
onClick?.();
|
|
12549
12582
|
};
|
|
12550
12583
|
return /* @__PURE__ */ jsx(
|
|
12551
|
-
|
|
12584
|
+
Box,
|
|
12552
12585
|
{
|
|
12586
|
+
position: "absolute",
|
|
12553
12587
|
className,
|
|
12554
12588
|
onClick: action || onClick ? handleClick : void 0,
|
|
12555
12589
|
style: {
|
|
12556
|
-
position: "absolute",
|
|
12557
12590
|
width: frameWidth,
|
|
12558
12591
|
height: frameHeight,
|
|
12559
12592
|
backgroundImage: `url(${spritesheet.url})`,
|
|
@@ -12574,6 +12607,7 @@ var init_Sprite = __esm({
|
|
|
12574
12607
|
"components/game/2d/atoms/Sprite.tsx"() {
|
|
12575
12608
|
"use client";
|
|
12576
12609
|
init_useEventBus();
|
|
12610
|
+
init_Box();
|
|
12577
12611
|
init_spriteAnimation();
|
|
12578
12612
|
DEFAULT_SPRITESHEET = {
|
|
12579
12613
|
url: "https://almadar-kflow-assets.web.app/shared/isometric-blocks/Spritesheet/allTiles_sheet.png",
|
|
@@ -12610,17 +12644,7 @@ function StateIndicator({
|
|
|
12610
12644
|
className
|
|
12611
12645
|
),
|
|
12612
12646
|
children: [
|
|
12613
|
-
/* @__PURE__ */ jsx(Box, { as: "span", children: assetUrl ? /* @__PURE__ */ jsx(
|
|
12614
|
-
"img",
|
|
12615
|
-
{
|
|
12616
|
-
src: assetUrl.url,
|
|
12617
|
-
alt: displayLabel,
|
|
12618
|
-
width: 16,
|
|
12619
|
-
height: 16,
|
|
12620
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
12621
|
-
className: "flex-shrink-0"
|
|
12622
|
-
}
|
|
12623
|
-
) : typeof config.icon === "string" ? /^[a-zA-Z0-9-]+$/.test(config.icon) ? /* @__PURE__ */ jsx(Icon, { name: config.icon }) : config.icon : /* @__PURE__ */ jsx(Icon, { icon: config.icon }) }),
|
|
12647
|
+
/* @__PURE__ */ jsx(Box, { as: "span", children: assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 16, alt: displayLabel, className: "flex-shrink-0" }) : typeof config.icon === "string" ? /^[a-zA-Z0-9-]+$/.test(config.icon) ? /* @__PURE__ */ jsx(Icon, { name: config.icon }) : config.icon : /* @__PURE__ */ jsx(Icon, { icon: config.icon }) }),
|
|
12624
12648
|
/* @__PURE__ */ jsx(Box, { as: "span", children: displayLabel })
|
|
12625
12649
|
]
|
|
12626
12650
|
}
|
|
@@ -12632,6 +12656,7 @@ var init_StateIndicator = __esm({
|
|
|
12632
12656
|
init_Box();
|
|
12633
12657
|
init_Icon();
|
|
12634
12658
|
init_cn();
|
|
12659
|
+
init_GameIcon();
|
|
12635
12660
|
DEFAULT_ASSET_URL3 = {
|
|
12636
12661
|
url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
|
|
12637
12662
|
role: "ui",
|
|
@@ -12680,30 +12705,36 @@ function TimerDisplay({
|
|
|
12680
12705
|
format = "mm:ss",
|
|
12681
12706
|
size = "md",
|
|
12682
12707
|
className,
|
|
12683
|
-
lowThreshold
|
|
12708
|
+
lowThreshold,
|
|
12709
|
+
iconAsset
|
|
12684
12710
|
}) {
|
|
12685
12711
|
const isLow = lowThreshold != null && seconds <= lowThreshold && seconds > 0;
|
|
12686
|
-
return /* @__PURE__ */
|
|
12687
|
-
|
|
12712
|
+
return /* @__PURE__ */ jsxs(
|
|
12713
|
+
Box,
|
|
12688
12714
|
{
|
|
12689
12715
|
className: cn(
|
|
12690
|
-
"inline-flex items-center justify-center rounded-container",
|
|
12716
|
+
"inline-flex items-center gap-1 justify-center rounded-container",
|
|
12691
12717
|
"bg-card/80 border border-muted font-mono font-bold tabular-nums",
|
|
12692
|
-
|
|
12718
|
+
sizeMap5[size],
|
|
12693
12719
|
running && "border-success/50",
|
|
12694
12720
|
isLow && "text-error border-error/50 animate-pulse",
|
|
12695
12721
|
!isLow && "text-foreground",
|
|
12696
12722
|
className
|
|
12697
12723
|
),
|
|
12698
|
-
children:
|
|
12724
|
+
children: [
|
|
12725
|
+
iconAsset && /* @__PURE__ */ jsx(GameIcon, { assetUrl: iconAsset, icon: "image", size: 16, className: "w-4 h-4 object-contain flex-shrink-0" }),
|
|
12726
|
+
formatTime(seconds, format)
|
|
12727
|
+
]
|
|
12699
12728
|
}
|
|
12700
12729
|
);
|
|
12701
12730
|
}
|
|
12702
|
-
var
|
|
12731
|
+
var sizeMap5;
|
|
12703
12732
|
var init_TimerDisplay = __esm({
|
|
12704
12733
|
"components/game/2d/atoms/TimerDisplay.tsx"() {
|
|
12705
12734
|
init_cn();
|
|
12706
|
-
|
|
12735
|
+
init_Box();
|
|
12736
|
+
init_GameIcon();
|
|
12737
|
+
sizeMap5 = {
|
|
12707
12738
|
sm: "text-sm px-2 py-0.5",
|
|
12708
12739
|
md: "text-lg px-3 py-1",
|
|
12709
12740
|
lg: "text-2xl px-4 py-1.5"
|
|
@@ -12721,9 +12752,9 @@ function ResourceCounter({
|
|
|
12721
12752
|
size = "md",
|
|
12722
12753
|
className
|
|
12723
12754
|
}) {
|
|
12724
|
-
const sizes =
|
|
12755
|
+
const sizes = sizeMap6[size];
|
|
12725
12756
|
return /* @__PURE__ */ jsxs(
|
|
12726
|
-
|
|
12757
|
+
Box,
|
|
12727
12758
|
{
|
|
12728
12759
|
className: cn(
|
|
12729
12760
|
"inline-flex items-center rounded-container",
|
|
@@ -12732,21 +12763,11 @@ function ResourceCounter({
|
|
|
12732
12763
|
className
|
|
12733
12764
|
),
|
|
12734
12765
|
children: [
|
|
12735
|
-
assetUrl ? /* @__PURE__ */ jsx(
|
|
12736
|
-
|
|
12737
|
-
|
|
12738
|
-
src: assetUrl.url,
|
|
12739
|
-
alt: label,
|
|
12740
|
-
width: sizes.img,
|
|
12741
|
-
height: sizes.img,
|
|
12742
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
12743
|
-
className: "flex-shrink-0"
|
|
12744
|
-
}
|
|
12745
|
-
) : icon ? /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", sizes.icon), children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) }) : null,
|
|
12746
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: label }),
|
|
12747
|
-
/* @__PURE__ */ jsxs("span", { className: cn("font-bold tabular-nums", color && (color in colorTokenClasses2 ? colorTokenClasses2[color] : color)), children: [
|
|
12766
|
+
assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: sizes.img, alt: label, className: "flex-shrink-0" }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: cn("flex-shrink-0", sizes.icon), children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) }) : null,
|
|
12767
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: label }),
|
|
12768
|
+
/* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("font-bold tabular-nums", color && (color in colorTokenClasses2 ? colorTokenClasses2[color] : color)), children: [
|
|
12748
12769
|
value,
|
|
12749
|
-
max != null && /* @__PURE__ */ jsxs("span",
|
|
12770
|
+
max != null && /* @__PURE__ */ jsxs(Typography, { as: "span", className: "text-muted-foreground", children: [
|
|
12750
12771
|
"/",
|
|
12751
12772
|
max
|
|
12752
12773
|
] })
|
|
@@ -12755,11 +12776,14 @@ function ResourceCounter({
|
|
|
12755
12776
|
}
|
|
12756
12777
|
);
|
|
12757
12778
|
}
|
|
12758
|
-
var colorTokenClasses2, DEFAULT_ASSET_URL4,
|
|
12779
|
+
var colorTokenClasses2, DEFAULT_ASSET_URL4, sizeMap6;
|
|
12759
12780
|
var init_ResourceCounter = __esm({
|
|
12760
12781
|
"components/game/2d/atoms/ResourceCounter.tsx"() {
|
|
12761
12782
|
init_cn();
|
|
12762
12783
|
init_Icon();
|
|
12784
|
+
init_Box();
|
|
12785
|
+
init_Typography();
|
|
12786
|
+
init_GameIcon();
|
|
12763
12787
|
colorTokenClasses2 = {
|
|
12764
12788
|
primary: "text-primary",
|
|
12765
12789
|
secondary: "text-secondary",
|
|
@@ -12773,7 +12797,7 @@ var init_ResourceCounter = __esm({
|
|
|
12773
12797
|
role: "ui",
|
|
12774
12798
|
category: "coin"
|
|
12775
12799
|
};
|
|
12776
|
-
|
|
12800
|
+
sizeMap6 = {
|
|
12777
12801
|
sm: { wrapper: "text-xs gap-1 px-1.5 py-0.5", icon: "text-sm", img: 16 },
|
|
12778
12802
|
md: { wrapper: "text-sm gap-1.5 px-2 py-1", icon: "text-base", img: 20 },
|
|
12779
12803
|
lg: { wrapper: "text-base gap-2 px-3 py-1.5", icon: "text-lg", img: 28 }
|
|
@@ -12791,21 +12815,26 @@ function ItemSlot({
|
|
|
12791
12815
|
size = "md",
|
|
12792
12816
|
selected,
|
|
12793
12817
|
onClick,
|
|
12818
|
+
action,
|
|
12794
12819
|
className
|
|
12795
12820
|
}) {
|
|
12796
|
-
const
|
|
12821
|
+
const eventBus = useEventBus();
|
|
12822
|
+
const isClickable = onClick != null || action != null;
|
|
12797
12823
|
const px = assetSizeMap[size];
|
|
12798
12824
|
return /* @__PURE__ */ jsx(
|
|
12799
|
-
|
|
12825
|
+
Button,
|
|
12800
12826
|
{
|
|
12801
|
-
|
|
12802
|
-
onClick
|
|
12827
|
+
variant: "ghost",
|
|
12828
|
+
onClick: () => {
|
|
12829
|
+
if (action) eventBus.emit(`UI:${action}`, {});
|
|
12830
|
+
onClick?.();
|
|
12831
|
+
},
|
|
12803
12832
|
disabled: !isClickable,
|
|
12804
12833
|
title: label,
|
|
12805
12834
|
className: cn(
|
|
12806
12835
|
"relative flex items-center justify-center rounded-interactive border-2",
|
|
12807
12836
|
"bg-card/80 transition-all duration-150",
|
|
12808
|
-
|
|
12837
|
+
sizeMap7[size],
|
|
12809
12838
|
empty ? "border-border bg-card/50" : rarityBorderMap[rarity],
|
|
12810
12839
|
!empty && rarityGlowMap[rarity],
|
|
12811
12840
|
selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background",
|
|
@@ -12814,21 +12843,12 @@ function ItemSlot({
|
|
|
12814
12843
|
!isClickable && "cursor-default",
|
|
12815
12844
|
className
|
|
12816
12845
|
),
|
|
12817
|
-
children: empty ? /* @__PURE__ */ jsx("span",
|
|
12818
|
-
assetUrl ? /* @__PURE__ */ jsx(
|
|
12819
|
-
"img",
|
|
12820
|
-
{
|
|
12821
|
-
src: assetUrl?.url,
|
|
12822
|
-
alt: label,
|
|
12823
|
-
width: px,
|
|
12824
|
-
height: px,
|
|
12825
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
12826
|
-
className: "flex-shrink-0"
|
|
12827
|
-
}
|
|
12828
|
-
) : icon ? /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) }) : null,
|
|
12846
|
+
children: empty ? /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground text-base", children: "+" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12847
|
+
assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: px, alt: label, className: "flex-shrink-0" }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: "flex-shrink-0", children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) }) : null,
|
|
12829
12848
|
quantity != null && quantity > 1 && /* @__PURE__ */ jsx(
|
|
12830
|
-
|
|
12849
|
+
Typography,
|
|
12831
12850
|
{
|
|
12851
|
+
as: "span",
|
|
12832
12852
|
className: cn(
|
|
12833
12853
|
"absolute -bottom-1 -right-1 flex items-center justify-center",
|
|
12834
12854
|
"min-w-[18px] h-[18px] rounded-full px-1",
|
|
@@ -12841,13 +12861,18 @@ function ItemSlot({
|
|
|
12841
12861
|
}
|
|
12842
12862
|
);
|
|
12843
12863
|
}
|
|
12844
|
-
var
|
|
12864
|
+
var sizeMap7, rarityBorderMap, rarityGlowMap, DEFAULT_ASSET_URL5, assetSizeMap;
|
|
12845
12865
|
var init_ItemSlot = __esm({
|
|
12846
12866
|
"components/game/2d/atoms/ItemSlot.tsx"() {
|
|
12847
12867
|
"use client";
|
|
12848
12868
|
init_cn();
|
|
12849
12869
|
init_Icon();
|
|
12850
|
-
|
|
12870
|
+
init_useEventBus();
|
|
12871
|
+
init_Button();
|
|
12872
|
+
init_Box();
|
|
12873
|
+
init_Typography();
|
|
12874
|
+
init_GameIcon();
|
|
12875
|
+
sizeMap7 = {
|
|
12851
12876
|
sm: "w-10 h-10 text-lg",
|
|
12852
12877
|
md: "w-14 h-14 text-2xl",
|
|
12853
12878
|
lg: "w-18 h-18 text-3xl"
|
|
@@ -12888,9 +12913,9 @@ function TurnIndicator({
|
|
|
12888
12913
|
size = "md",
|
|
12889
12914
|
className
|
|
12890
12915
|
}) {
|
|
12891
|
-
const sizes =
|
|
12916
|
+
const sizes = sizeMap8[size];
|
|
12892
12917
|
return /* @__PURE__ */ jsxs(
|
|
12893
|
-
|
|
12918
|
+
Box,
|
|
12894
12919
|
{
|
|
12895
12920
|
className: cn(
|
|
12896
12921
|
"inline-flex items-center rounded-container",
|
|
@@ -12899,42 +12924,35 @@ function TurnIndicator({
|
|
|
12899
12924
|
className
|
|
12900
12925
|
),
|
|
12901
12926
|
children: [
|
|
12902
|
-
/* @__PURE__ */ jsxs("span",
|
|
12927
|
+
/* @__PURE__ */ jsxs(Typography, { as: "span", className: "font-bold tabular-nums", children: [
|
|
12903
12928
|
"Turn ",
|
|
12904
12929
|
currentTurn,
|
|
12905
|
-
maxTurns != null && /* @__PURE__ */ jsxs("span",
|
|
12930
|
+
maxTurns != null && /* @__PURE__ */ jsxs(Typography, { as: "span", className: "text-muted-foreground", children: [
|
|
12906
12931
|
"/",
|
|
12907
12932
|
maxTurns
|
|
12908
12933
|
] })
|
|
12909
12934
|
] }),
|
|
12910
12935
|
phase && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12911
|
-
/* @__PURE__ */ jsx("span",
|
|
12912
|
-
/* @__PURE__ */ jsx("span",
|
|
12936
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: "|" }),
|
|
12937
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: phase })
|
|
12913
12938
|
] }),
|
|
12914
12939
|
activeTeam && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12915
|
-
/* @__PURE__ */ jsx("span",
|
|
12916
|
-
assetUrl ? /* @__PURE__ */ jsx(
|
|
12917
|
-
|
|
12918
|
-
{
|
|
12919
|
-
src: assetUrl.url,
|
|
12920
|
-
alt: "",
|
|
12921
|
-
width: 12,
|
|
12922
|
-
height: 12,
|
|
12923
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
12924
|
-
className: "flex-shrink-0"
|
|
12925
|
-
}
|
|
12926
|
-
) : /* @__PURE__ */ jsx("span", { className: cn("rounded-full bg-success/20", sizes.dot) }),
|
|
12927
|
-
/* @__PURE__ */ jsx("span", { className: "text-success", children: activeTeam })
|
|
12940
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: "|" }),
|
|
12941
|
+
assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 12, className: "flex-shrink-0" }) : /* @__PURE__ */ jsx(Box, { as: "span", className: cn("rounded-full bg-success/20", sizes.dot) }),
|
|
12942
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-success", children: activeTeam })
|
|
12928
12943
|
] })
|
|
12929
12944
|
]
|
|
12930
12945
|
}
|
|
12931
12946
|
);
|
|
12932
12947
|
}
|
|
12933
|
-
var
|
|
12948
|
+
var sizeMap8, DEFAULT_ASSET_URL6;
|
|
12934
12949
|
var init_TurnIndicator = __esm({
|
|
12935
12950
|
"components/game/2d/atoms/TurnIndicator.tsx"() {
|
|
12936
12951
|
init_cn();
|
|
12937
|
-
|
|
12952
|
+
init_Box();
|
|
12953
|
+
init_Typography();
|
|
12954
|
+
init_GameIcon();
|
|
12955
|
+
sizeMap8 = {
|
|
12938
12956
|
sm: { wrapper: "text-xs gap-1.5 px-2 py-0.5", dot: "w-1.5 h-1.5" },
|
|
12939
12957
|
md: { wrapper: "text-sm gap-2 px-3 py-1", dot: "w-2 h-2" },
|
|
12940
12958
|
lg: { wrapper: "text-base gap-2.5 px-4 py-1.5", dot: "w-2.5 h-2.5" }
|
|
@@ -12966,10 +12984,10 @@ function ComboCounter({
|
|
|
12966
12984
|
size = "md",
|
|
12967
12985
|
className
|
|
12968
12986
|
}) {
|
|
12969
|
-
const sizes =
|
|
12987
|
+
const sizes = sizeMap9[size];
|
|
12970
12988
|
if (combo <= 0) return null;
|
|
12971
12989
|
return /* @__PURE__ */ jsxs(
|
|
12972
|
-
|
|
12990
|
+
Box,
|
|
12973
12991
|
{
|
|
12974
12992
|
className: cn(
|
|
12975
12993
|
"inline-flex flex-col items-center justify-center",
|
|
@@ -12979,24 +12997,14 @@ function ComboCounter({
|
|
|
12979
12997
|
className
|
|
12980
12998
|
),
|
|
12981
12999
|
children: [
|
|
12982
|
-
assetUrl && /* @__PURE__ */ jsx(
|
|
12983
|
-
|
|
12984
|
-
|
|
12985
|
-
|
|
12986
|
-
alt: "combo",
|
|
12987
|
-
width: 24,
|
|
12988
|
-
height: 24,
|
|
12989
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
12990
|
-
className: "flex-shrink-0 mb-0.5"
|
|
12991
|
-
}
|
|
12992
|
-
),
|
|
12993
|
-
/* @__PURE__ */ jsx("span", { className: cn("font-black tabular-nums leading-none", sizes.combo, getComboIntensity(combo)), children: combo }),
|
|
12994
|
-
/* @__PURE__ */ jsx("span", { className: cn("font-bold uppercase tracking-wider text-muted-foreground", sizes.label), children: "combo" }),
|
|
12995
|
-
multiplier != null && multiplier > 1 && /* @__PURE__ */ jsxs("span", { className: cn("font-bold text-warning tabular-nums", sizes.multiplier), children: [
|
|
13000
|
+
assetUrl && /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 24, className: "flex-shrink-0 mb-0.5" }),
|
|
13001
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: cn("font-black tabular-nums leading-none", sizes.combo, getComboIntensity(combo)), children: combo }),
|
|
13002
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: cn("font-bold uppercase tracking-wider text-muted-foreground", sizes.label), children: "combo" }),
|
|
13003
|
+
multiplier != null && multiplier > 1 && /* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("font-bold text-warning tabular-nums", sizes.multiplier), children: [
|
|
12996
13004
|
"x",
|
|
12997
13005
|
multiplier.toFixed(1)
|
|
12998
13006
|
] }),
|
|
12999
|
-
streak != null && streak > 0 && /* @__PURE__ */ jsxs("span",
|
|
13007
|
+
streak != null && streak > 0 && /* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("text-muted-foreground tabular-nums", sizes.label), children: [
|
|
13000
13008
|
streak,
|
|
13001
13009
|
" streak"
|
|
13002
13010
|
] })
|
|
@@ -13004,16 +13012,19 @@ function ComboCounter({
|
|
|
13004
13012
|
}
|
|
13005
13013
|
);
|
|
13006
13014
|
}
|
|
13007
|
-
var DEFAULT_ASSET_URL7,
|
|
13015
|
+
var DEFAULT_ASSET_URL7, sizeMap9;
|
|
13008
13016
|
var init_ComboCounter = __esm({
|
|
13009
13017
|
"components/game/2d/atoms/ComboCounter.tsx"() {
|
|
13010
13018
|
init_cn();
|
|
13019
|
+
init_Box();
|
|
13020
|
+
init_Typography();
|
|
13021
|
+
init_GameIcon();
|
|
13011
13022
|
DEFAULT_ASSET_URL7 = {
|
|
13012
13023
|
url: "https://almadar-kflow-assets.web.app/shared/effects/flash/flash00.png",
|
|
13013
13024
|
role: "effect",
|
|
13014
13025
|
category: "effect"
|
|
13015
13026
|
};
|
|
13016
|
-
|
|
13027
|
+
sizeMap9 = {
|
|
13017
13028
|
sm: { combo: "text-lg", label: "text-xs", multiplier: "text-xs" },
|
|
13018
13029
|
md: { combo: "text-2xl", label: "text-xs", multiplier: "text-sm" },
|
|
13019
13030
|
lg: { combo: "text-4xl", label: "text-sm", multiplier: "text-base" }
|
|
@@ -13030,54 +13041,48 @@ function WaypointMarker({
|
|
|
13030
13041
|
size = "md",
|
|
13031
13042
|
className
|
|
13032
13043
|
}) {
|
|
13033
|
-
const sizes =
|
|
13034
|
-
return /* @__PURE__ */ jsxs(
|
|
13035
|
-
/* @__PURE__ */ jsxs(
|
|
13044
|
+
const sizes = sizeMap10[size];
|
|
13045
|
+
return /* @__PURE__ */ jsxs(Box, { className: cn("flex flex-col items-center", className), children: [
|
|
13046
|
+
/* @__PURE__ */ jsxs(Box, { className: "relative flex items-center justify-center", children: [
|
|
13036
13047
|
active && /* @__PURE__ */ jsx(
|
|
13037
|
-
|
|
13048
|
+
Box,
|
|
13038
13049
|
{
|
|
13050
|
+
position: "absolute",
|
|
13039
13051
|
className: cn(
|
|
13040
|
-
"
|
|
13052
|
+
"rounded-full border-2 border-info animate-ping opacity-50",
|
|
13041
13053
|
sizes.ring
|
|
13042
13054
|
)
|
|
13043
13055
|
}
|
|
13044
13056
|
),
|
|
13045
13057
|
active && /* @__PURE__ */ jsx(
|
|
13046
|
-
|
|
13058
|
+
Box,
|
|
13047
13059
|
{
|
|
13060
|
+
position: "absolute",
|
|
13048
13061
|
className: cn(
|
|
13049
|
-
"
|
|
13062
|
+
"rounded-full border-2 border-info",
|
|
13050
13063
|
sizes.ring
|
|
13051
13064
|
)
|
|
13052
13065
|
}
|
|
13053
13066
|
),
|
|
13054
13067
|
/* @__PURE__ */ jsx(
|
|
13055
|
-
|
|
13068
|
+
Box,
|
|
13056
13069
|
{
|
|
13070
|
+
position: "relative",
|
|
13057
13071
|
className: cn(
|
|
13058
|
-
"
|
|
13072
|
+
"flex items-center justify-center rounded-full transition-all duration-200",
|
|
13059
13073
|
sizes.dot,
|
|
13060
13074
|
completed && "bg-success text-foreground",
|
|
13061
13075
|
active && !completed && "bg-info text-foreground",
|
|
13062
13076
|
!active && !completed && "bg-muted"
|
|
13063
13077
|
),
|
|
13064
|
-
children: completed ? checkIcon : assetUrl ? /* @__PURE__ */ jsx(
|
|
13065
|
-
"img",
|
|
13066
|
-
{
|
|
13067
|
-
src: assetUrl.url,
|
|
13068
|
-
alt: label,
|
|
13069
|
-
width: sizes.img,
|
|
13070
|
-
height: sizes.img,
|
|
13071
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
13072
|
-
className: "flex-shrink-0"
|
|
13073
|
-
}
|
|
13074
|
-
) : icon ? typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) : null
|
|
13078
|
+
children: completed ? checkIcon : assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: sizes.img, alt: label, className: "flex-shrink-0" }) : icon ? typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) : null
|
|
13075
13079
|
}
|
|
13076
13080
|
)
|
|
13077
13081
|
] }),
|
|
13078
13082
|
label && /* @__PURE__ */ jsx(
|
|
13079
|
-
|
|
13083
|
+
Typography,
|
|
13080
13084
|
{
|
|
13085
|
+
as: "span",
|
|
13081
13086
|
className: cn(
|
|
13082
13087
|
"text-center whitespace-nowrap",
|
|
13083
13088
|
sizes.label,
|
|
@@ -13088,17 +13093,20 @@ function WaypointMarker({
|
|
|
13088
13093
|
)
|
|
13089
13094
|
] });
|
|
13090
13095
|
}
|
|
13091
|
-
var DEFAULT_ASSET_URL8,
|
|
13096
|
+
var DEFAULT_ASSET_URL8, sizeMap10, checkIcon;
|
|
13092
13097
|
var init_WaypointMarker = __esm({
|
|
13093
13098
|
"components/game/2d/atoms/WaypointMarker.tsx"() {
|
|
13094
13099
|
init_cn();
|
|
13095
13100
|
init_Icon();
|
|
13101
|
+
init_Box();
|
|
13102
|
+
init_Typography();
|
|
13103
|
+
init_GameIcon();
|
|
13096
13104
|
DEFAULT_ASSET_URL8 = {
|
|
13097
13105
|
url: "https://almadar-kflow-assets.web.app/shared/world-map/battle_marker.png",
|
|
13098
13106
|
role: "ui",
|
|
13099
13107
|
category: "waypoint"
|
|
13100
13108
|
};
|
|
13101
|
-
|
|
13109
|
+
sizeMap10 = {
|
|
13102
13110
|
sm: { dot: "w-4 h-4", ring: "w-6 h-6", label: "text-xs mt-1", img: 12 },
|
|
13103
13111
|
md: { dot: "w-6 h-6", ring: "w-8 h-8", label: "text-sm mt-1.5", img: 18 },
|
|
13104
13112
|
lg: { dot: "w-8 h-8", ring: "w-10 h-10", label: "text-base mt-2", img: 24 }
|
|
@@ -13123,32 +13131,24 @@ function StatusEffect({
|
|
|
13123
13131
|
size = "md",
|
|
13124
13132
|
className
|
|
13125
13133
|
}) {
|
|
13126
|
-
const sizes =
|
|
13127
|
-
return /* @__PURE__ */ jsxs("
|
|
13134
|
+
const sizes = sizeMap11[size];
|
|
13135
|
+
return /* @__PURE__ */ jsxs(Box, { position: "relative", className: cn("inline-flex flex-col items-center", className), children: [
|
|
13128
13136
|
/* @__PURE__ */ jsxs(
|
|
13129
|
-
|
|
13137
|
+
Box,
|
|
13130
13138
|
{
|
|
13139
|
+
position: "relative",
|
|
13131
13140
|
className: cn(
|
|
13132
|
-
"
|
|
13141
|
+
"flex items-center justify-center rounded-interactive border-2",
|
|
13133
13142
|
sizes.container,
|
|
13134
13143
|
variantStyles7[variant]
|
|
13135
13144
|
),
|
|
13136
13145
|
title: label,
|
|
13137
13146
|
children: [
|
|
13138
|
-
/* @__PURE__ */ jsx("span",
|
|
13139
|
-
"img",
|
|
13140
|
-
{
|
|
13141
|
-
src: assetUrl.url,
|
|
13142
|
-
alt: label,
|
|
13143
|
-
width: sizes.img,
|
|
13144
|
-
height: sizes.img,
|
|
13145
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
13146
|
-
className: "flex-shrink-0"
|
|
13147
|
-
}
|
|
13148
|
-
) : icon != null && typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }) : icon != null ? /* @__PURE__ */ jsx(Icon, { icon, size: "sm" }) : null }),
|
|
13147
|
+
/* @__PURE__ */ jsx(Box, { as: "span", className: cn("flex items-center justify-center", sizes.icon), children: assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: sizes.img, alt: label, className: "flex-shrink-0" }) : icon != null && typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }) : icon != null ? /* @__PURE__ */ jsx(Icon, { icon, size: "sm" }) : null }),
|
|
13149
13148
|
duration !== void 0 && /* @__PURE__ */ jsx(
|
|
13150
|
-
|
|
13149
|
+
Typography,
|
|
13151
13150
|
{
|
|
13151
|
+
as: "span",
|
|
13152
13152
|
className: cn(
|
|
13153
13153
|
"absolute bottom-0 left-0 right-0 text-center font-mono font-bold text-foreground bg-background/60 leading-tight",
|
|
13154
13154
|
sizes.timer
|
|
@@ -13160,8 +13160,9 @@ function StatusEffect({
|
|
|
13160
13160
|
}
|
|
13161
13161
|
),
|
|
13162
13162
|
stacks !== void 0 && stacks > 1 && /* @__PURE__ */ jsx(
|
|
13163
|
-
|
|
13163
|
+
Typography,
|
|
13164
13164
|
{
|
|
13165
|
+
as: "span",
|
|
13165
13166
|
className: cn(
|
|
13166
13167
|
"absolute flex items-center justify-center rounded-full bg-card text-foreground font-bold leading-none",
|
|
13167
13168
|
sizes.badge
|
|
@@ -13169,20 +13170,23 @@ function StatusEffect({
|
|
|
13169
13170
|
children: stacks
|
|
13170
13171
|
}
|
|
13171
13172
|
),
|
|
13172
|
-
label && /* @__PURE__ */ jsx("span",
|
|
13173
|
+
label && /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-xs text-muted-foreground mt-0.5 text-center whitespace-nowrap", children: label })
|
|
13173
13174
|
] });
|
|
13174
13175
|
}
|
|
13175
|
-
var DEFAULT_ASSET_URL9,
|
|
13176
|
+
var DEFAULT_ASSET_URL9, sizeMap11, variantStyles7;
|
|
13176
13177
|
var init_StatusEffect = __esm({
|
|
13177
13178
|
"components/game/2d/atoms/StatusEffect.tsx"() {
|
|
13178
13179
|
init_cn();
|
|
13179
13180
|
init_Icon();
|
|
13181
|
+
init_Box();
|
|
13182
|
+
init_Typography();
|
|
13183
|
+
init_GameIcon();
|
|
13180
13184
|
DEFAULT_ASSET_URL9 = {
|
|
13181
13185
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/flame_01.png",
|
|
13182
13186
|
role: "ui",
|
|
13183
13187
|
category: "effect"
|
|
13184
13188
|
};
|
|
13185
|
-
|
|
13189
|
+
sizeMap11 = {
|
|
13186
13190
|
sm: { container: "w-8 h-8", icon: "text-sm", badge: "text-xs -top-1 -right-1 w-4 h-4", timer: "text-[9px]", img: 20 },
|
|
13187
13191
|
md: { container: "w-10 h-10", icon: "text-base", badge: "text-xs -top-1 -right-1 w-5 h-5", timer: "text-xs", img: 28 },
|
|
13188
13192
|
lg: { container: "w-12 h-12", icon: "text-lg", badge: "text-sm -top-1.5 -right-1.5 w-6 h-6", timer: "text-xs", img: 36 }
|
|
@@ -13206,38 +13210,31 @@ function DamageNumber({
|
|
|
13206
13210
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13207
13211
|
/* @__PURE__ */ jsx("style", { children: floatKeyframes }),
|
|
13208
13212
|
/* @__PURE__ */ jsxs(
|
|
13209
|
-
|
|
13213
|
+
Typography,
|
|
13210
13214
|
{
|
|
13215
|
+
as: "span",
|
|
13211
13216
|
className: cn(
|
|
13212
13217
|
"inline-flex items-center gap-0.5 font-mono select-none pointer-events-none",
|
|
13213
|
-
|
|
13218
|
+
sizeMap12[size],
|
|
13214
13219
|
typeStyles[type],
|
|
13215
13220
|
className
|
|
13216
13221
|
),
|
|
13217
13222
|
style: { animation: "damageFloat 1s ease-out forwards" },
|
|
13218
13223
|
children: [
|
|
13219
|
-
assetUrl && /* @__PURE__ */ jsx(
|
|
13220
|
-
"img",
|
|
13221
|
-
{
|
|
13222
|
-
src: assetUrl.url,
|
|
13223
|
-
alt: "",
|
|
13224
|
-
width: 14,
|
|
13225
|
-
height: 14,
|
|
13226
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
13227
|
-
className: "flex-shrink-0"
|
|
13228
|
-
}
|
|
13229
|
-
),
|
|
13224
|
+
assetUrl && /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 14, className: "flex-shrink-0" }),
|
|
13230
13225
|
displayText
|
|
13231
13226
|
]
|
|
13232
13227
|
}
|
|
13233
13228
|
)
|
|
13234
13229
|
] });
|
|
13235
13230
|
}
|
|
13236
|
-
var
|
|
13231
|
+
var sizeMap12, typeStyles, floatKeyframes, DEFAULT_ASSET_URL10;
|
|
13237
13232
|
var init_DamageNumber = __esm({
|
|
13238
13233
|
"components/game/2d/atoms/DamageNumber.tsx"() {
|
|
13239
13234
|
init_cn();
|
|
13240
|
-
|
|
13235
|
+
init_Typography();
|
|
13236
|
+
init_GameIcon();
|
|
13237
|
+
sizeMap12 = {
|
|
13241
13238
|
sm: "text-sm",
|
|
13242
13239
|
md: "text-lg",
|
|
13243
13240
|
lg: "text-2xl"
|
|
@@ -13271,7 +13268,7 @@ function DialogueBubble({
|
|
|
13271
13268
|
className
|
|
13272
13269
|
}) {
|
|
13273
13270
|
return /* @__PURE__ */ jsxs(
|
|
13274
|
-
|
|
13271
|
+
Box,
|
|
13275
13272
|
{
|
|
13276
13273
|
className: cn(
|
|
13277
13274
|
"flex items-start gap-3 rounded-container bg-background/80 backdrop-blur-sm px-4 py-3 border border-border/10",
|
|
@@ -13279,17 +13276,10 @@ function DialogueBubble({
|
|
|
13279
13276
|
className
|
|
13280
13277
|
),
|
|
13281
13278
|
children: [
|
|
13282
|
-
portrait && /* @__PURE__ */ jsx(
|
|
13283
|
-
|
|
13284
|
-
{
|
|
13285
|
-
|
|
13286
|
-
alt: speaker ?? "speaker",
|
|
13287
|
-
className: "w-full h-full object-cover"
|
|
13288
|
-
}
|
|
13289
|
-
) }),
|
|
13290
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [
|
|
13291
|
-
speaker && /* @__PURE__ */ jsx("span", { className: "text-sm font-bold text-warning", children: speaker }),
|
|
13292
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm text-foreground leading-relaxed", children: text })
|
|
13279
|
+
portrait && /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 w-12 h-12 rounded-full overflow-hidden border-2 border-warning/60", children: /* @__PURE__ */ jsx(GameIcon, { assetUrl: portrait, icon: "image", size: 48, alt: speaker ?? "speaker", className: "w-full h-full object-cover" }) }),
|
|
13280
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex flex-col gap-1 min-w-0", children: [
|
|
13281
|
+
speaker && /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm font-bold text-warning", children: speaker }),
|
|
13282
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm text-foreground leading-relaxed", children: text })
|
|
13293
13283
|
] })
|
|
13294
13284
|
]
|
|
13295
13285
|
}
|
|
@@ -13299,6 +13289,9 @@ var DEFAULT_PORTRAIT;
|
|
|
13299
13289
|
var init_DialogueBubble = __esm({
|
|
13300
13290
|
"components/game/2d/atoms/DialogueBubble.tsx"() {
|
|
13301
13291
|
init_cn();
|
|
13292
|
+
init_Box();
|
|
13293
|
+
init_Typography();
|
|
13294
|
+
init_GameIcon();
|
|
13302
13295
|
DEFAULT_PORTRAIT = {
|
|
13303
13296
|
url: "https://almadar-kflow-assets.web.app/shared/characters/archetypes/04_hero.png",
|
|
13304
13297
|
role: "effect",
|
|
@@ -13315,14 +13308,19 @@ function ChoiceButton({
|
|
|
13315
13308
|
disabled = false,
|
|
13316
13309
|
selected = false,
|
|
13317
13310
|
onClick,
|
|
13311
|
+
action,
|
|
13318
13312
|
className
|
|
13319
13313
|
}) {
|
|
13314
|
+
const eventBus = useEventBus();
|
|
13320
13315
|
return /* @__PURE__ */ jsxs(
|
|
13321
|
-
|
|
13316
|
+
Button,
|
|
13322
13317
|
{
|
|
13323
|
-
|
|
13318
|
+
variant: "ghost",
|
|
13324
13319
|
disabled,
|
|
13325
|
-
onClick
|
|
13320
|
+
onClick: () => {
|
|
13321
|
+
if (action) eventBus.emit(`UI:${action}`, {});
|
|
13322
|
+
onClick?.();
|
|
13323
|
+
},
|
|
13326
13324
|
className: cn(
|
|
13327
13325
|
"w-full text-left px-4 py-2.5 rounded-interactive border transition-all duration-150",
|
|
13328
13326
|
"flex items-center gap-2",
|
|
@@ -13332,8 +13330,9 @@ function ChoiceButton({
|
|
|
13332
13330
|
),
|
|
13333
13331
|
children: [
|
|
13334
13332
|
index !== void 0 && /* @__PURE__ */ jsxs(
|
|
13335
|
-
|
|
13333
|
+
Typography,
|
|
13336
13334
|
{
|
|
13335
|
+
as: "span",
|
|
13337
13336
|
className: cn(
|
|
13338
13337
|
"flex-shrink-0 font-mono font-bold text-sm",
|
|
13339
13338
|
selected ? "text-accent" : "text-muted-foreground"
|
|
@@ -13344,24 +13343,14 @@ function ChoiceButton({
|
|
|
13344
13343
|
]
|
|
13345
13344
|
}
|
|
13346
13345
|
),
|
|
13347
|
-
assetUrl ? /* @__PURE__ */ jsx(
|
|
13348
|
-
"img",
|
|
13349
|
-
{
|
|
13350
|
-
src: assetUrl.url,
|
|
13351
|
-
alt: "",
|
|
13352
|
-
width: 16,
|
|
13353
|
-
height: 16,
|
|
13354
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
13355
|
-
className: "flex-shrink-0"
|
|
13356
|
-
}
|
|
13357
|
-
) : icon ? /* @__PURE__ */ jsx("span", { className: "flex-shrink-0 text-sm", children: typeof icon === "string" ? (() => {
|
|
13346
|
+
assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 16, className: "flex-shrink-0" }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: "flex-shrink-0 text-sm", children: typeof icon === "string" ? (() => {
|
|
13358
13347
|
const I = resolveIcon(icon);
|
|
13359
13348
|
return I ? /* @__PURE__ */ jsx(I, { className: "w-4 h-4" }) : null;
|
|
13360
13349
|
})() : /* @__PURE__ */ (() => {
|
|
13361
13350
|
const I = icon;
|
|
13362
13351
|
return /* @__PURE__ */ jsx(I, { className: "w-4 h-4" });
|
|
13363
13352
|
})() }) : null,
|
|
13364
|
-
/* @__PURE__ */ jsx("span",
|
|
13353
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm leading-snug", children: text })
|
|
13365
13354
|
]
|
|
13366
13355
|
}
|
|
13367
13356
|
);
|
|
@@ -13370,6 +13359,11 @@ var init_ChoiceButton = __esm({
|
|
|
13370
13359
|
"components/game/2d/atoms/ChoiceButton.tsx"() {
|
|
13371
13360
|
init_cn();
|
|
13372
13361
|
init_Icon();
|
|
13362
|
+
init_useEventBus();
|
|
13363
|
+
init_Button();
|
|
13364
|
+
init_Box();
|
|
13365
|
+
init_Typography();
|
|
13366
|
+
init_GameIcon();
|
|
13373
13367
|
ChoiceButton.displayName = "ChoiceButton";
|
|
13374
13368
|
}
|
|
13375
13369
|
});
|
|
@@ -13383,18 +13377,23 @@ function ActionButton({
|
|
|
13383
13377
|
size = "md",
|
|
13384
13378
|
variant = "primary",
|
|
13385
13379
|
onClick,
|
|
13380
|
+
action,
|
|
13386
13381
|
className
|
|
13387
13382
|
}) {
|
|
13388
|
-
const
|
|
13383
|
+
const eventBus = useEventBus();
|
|
13384
|
+
const sizes = sizeMap13[size];
|
|
13389
13385
|
const onCooldown = cooldown > 0;
|
|
13390
13386
|
const isDisabled = disabled || onCooldown;
|
|
13391
13387
|
const cooldownDeg = Math.round(cooldown * 360);
|
|
13392
13388
|
return /* @__PURE__ */ jsxs(
|
|
13393
|
-
|
|
13389
|
+
Button,
|
|
13394
13390
|
{
|
|
13395
|
-
|
|
13391
|
+
variant: variant === "danger" ? "danger" : variant === "secondary" ? "secondary" : "primary",
|
|
13396
13392
|
disabled: isDisabled,
|
|
13397
|
-
onClick
|
|
13393
|
+
onClick: () => {
|
|
13394
|
+
if (action) eventBus.emit(`UI:${action}`, {});
|
|
13395
|
+
onClick?.();
|
|
13396
|
+
},
|
|
13398
13397
|
className: cn(
|
|
13399
13398
|
"relative inline-flex items-center gap-1.5 rounded-interactive border font-medium overflow-hidden transition-colors duration-150",
|
|
13400
13399
|
sizes.button,
|
|
@@ -13404,9 +13403,10 @@ function ActionButton({
|
|
|
13404
13403
|
),
|
|
13405
13404
|
children: [
|
|
13406
13405
|
onCooldown && /* @__PURE__ */ jsx(
|
|
13407
|
-
|
|
13406
|
+
Box,
|
|
13408
13407
|
{
|
|
13409
|
-
|
|
13408
|
+
position: "absolute",
|
|
13409
|
+
className: "inset-0 bg-foreground/40 pointer-events-none",
|
|
13410
13410
|
style: {
|
|
13411
13411
|
clipPath: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, black ${360 - cooldownDeg}deg)`,
|
|
13412
13412
|
WebkitClipPath: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, black ${360 - cooldownDeg}deg)`,
|
|
@@ -13414,27 +13414,18 @@ function ActionButton({
|
|
|
13414
13414
|
}
|
|
13415
13415
|
}
|
|
13416
13416
|
),
|
|
13417
|
-
assetUrl ? /* @__PURE__ */ jsx(
|
|
13418
|
-
"img",
|
|
13419
|
-
{
|
|
13420
|
-
src: assetUrl.url,
|
|
13421
|
-
alt: "",
|
|
13422
|
-
width: 16,
|
|
13423
|
-
height: 16,
|
|
13424
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
13425
|
-
className: cn("flex-shrink-0", sizes.icon)
|
|
13426
|
-
}
|
|
13427
|
-
) : icon ? /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", sizes.icon), children: typeof icon === "string" ? (() => {
|
|
13417
|
+
assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 16, className: cn("flex-shrink-0", sizes.icon) }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: cn("flex-shrink-0", sizes.icon), children: typeof icon === "string" ? (() => {
|
|
13428
13418
|
const I = resolveIcon(icon);
|
|
13429
13419
|
return I ? /* @__PURE__ */ jsx(I, { className: "w-4 h-4" }) : null;
|
|
13430
13420
|
})() : /* @__PURE__ */ (() => {
|
|
13431
13421
|
const I = icon;
|
|
13432
13422
|
return /* @__PURE__ */ jsx(I, { className: "w-4 h-4" });
|
|
13433
13423
|
})() }) : null,
|
|
13434
|
-
/* @__PURE__ */ jsx("span",
|
|
13424
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "relative z-10", children: label }),
|
|
13435
13425
|
hotkey && /* @__PURE__ */ jsx(
|
|
13436
|
-
|
|
13426
|
+
Typography,
|
|
13437
13427
|
{
|
|
13428
|
+
as: "span",
|
|
13438
13429
|
className: cn(
|
|
13439
13430
|
"absolute top-0.5 right-0.5 bg-foreground/30 text-primary-foreground rounded font-mono leading-tight",
|
|
13440
13431
|
sizes.hotkey
|
|
@@ -13446,12 +13437,17 @@ function ActionButton({
|
|
|
13446
13437
|
}
|
|
13447
13438
|
);
|
|
13448
13439
|
}
|
|
13449
|
-
var
|
|
13440
|
+
var sizeMap13, variantStyles8, DEFAULT_ASSET_URL11;
|
|
13450
13441
|
var init_ActionButton = __esm({
|
|
13451
13442
|
"components/game/2d/atoms/ActionButton.tsx"() {
|
|
13452
13443
|
init_cn();
|
|
13453
13444
|
init_Icon();
|
|
13454
|
-
|
|
13445
|
+
init_useEventBus();
|
|
13446
|
+
init_Button();
|
|
13447
|
+
init_Box();
|
|
13448
|
+
init_Typography();
|
|
13449
|
+
init_GameIcon();
|
|
13450
|
+
sizeMap13 = {
|
|
13455
13451
|
sm: { button: "h-button-sm px-3 text-xs", hotkey: "text-[9px] px-1", icon: "text-xs" },
|
|
13456
13452
|
md: { button: "h-button-md px-4 text-sm", hotkey: "text-xs px-1.5", icon: "text-sm" },
|
|
13457
13453
|
lg: { button: "h-button-lg px-5 text-base", hotkey: "text-xs px-2", icon: "text-base" }
|
|
@@ -13477,10 +13473,27 @@ function MiniMap({
|
|
|
13477
13473
|
mapWidth = 100,
|
|
13478
13474
|
mapHeight = 100,
|
|
13479
13475
|
viewportRect = DEFAULT_VIEWPORT,
|
|
13480
|
-
className
|
|
13476
|
+
className,
|
|
13477
|
+
tileAssets,
|
|
13478
|
+
unitAssets
|
|
13481
13479
|
}) {
|
|
13482
|
-
const canvasRef =
|
|
13483
|
-
|
|
13480
|
+
const canvasRef = React112.useRef(null);
|
|
13481
|
+
const imgCacheRef = React112.useRef(/* @__PURE__ */ new Map());
|
|
13482
|
+
function loadImg(url) {
|
|
13483
|
+
const cached = imgCacheRef.current.get(url);
|
|
13484
|
+
if (cached) return cached.complete ? cached : null;
|
|
13485
|
+
const img = new Image();
|
|
13486
|
+
img.src = url;
|
|
13487
|
+
img.onload = () => {
|
|
13488
|
+
const canvas = canvasRef.current;
|
|
13489
|
+
if (!canvas) return;
|
|
13490
|
+
const ctx = canvas.getContext("2d");
|
|
13491
|
+
if (ctx) ctx.clearRect(0, 0, 0, 0);
|
|
13492
|
+
};
|
|
13493
|
+
imgCacheRef.current.set(url, img);
|
|
13494
|
+
return null;
|
|
13495
|
+
}
|
|
13496
|
+
React112.useEffect(() => {
|
|
13484
13497
|
const canvas = canvasRef.current;
|
|
13485
13498
|
if (!canvas) return;
|
|
13486
13499
|
const ctx = canvas.getContext("2d");
|
|
@@ -13491,20 +13504,31 @@ function MiniMap({
|
|
|
13491
13504
|
ctx.fillStyle = "#111";
|
|
13492
13505
|
ctx.fillRect(0, 0, width, height);
|
|
13493
13506
|
for (const tile of tiles) {
|
|
13494
|
-
|
|
13495
|
-
|
|
13496
|
-
|
|
13497
|
-
|
|
13498
|
-
|
|
13499
|
-
|
|
13500
|
-
)
|
|
13507
|
+
const tileAsset = tileAssets?.[tile.color] ?? tileAssets?.["default"];
|
|
13508
|
+
const tileImg = tileAsset ? loadImg(tileAsset.url) : null;
|
|
13509
|
+
const tx = Math.floor(tile.x * scaleX2);
|
|
13510
|
+
const ty = Math.floor(tile.y * scaleY2);
|
|
13511
|
+
const tw = Math.max(1, Math.ceil(scaleX2));
|
|
13512
|
+
const th = Math.max(1, Math.ceil(scaleY2));
|
|
13513
|
+
if (tileImg) {
|
|
13514
|
+
ctx.drawImage(tileImg, tx, ty, tw, th);
|
|
13515
|
+
} else {
|
|
13516
|
+
ctx.fillStyle = tile.color;
|
|
13517
|
+
ctx.fillRect(tx, ty, tw, th);
|
|
13518
|
+
}
|
|
13501
13519
|
}
|
|
13502
13520
|
for (const unit of units) {
|
|
13503
13521
|
if (unit.isPlayer) continue;
|
|
13504
|
-
|
|
13522
|
+
const unitAsset = unitAssets?.[unit.color] ?? unitAssets?.["default"];
|
|
13523
|
+
const unitImg = unitAsset ? loadImg(unitAsset.url) : null;
|
|
13505
13524
|
const ux = Math.floor(unit.x * scaleX2) - 1;
|
|
13506
13525
|
const uy = Math.floor(unit.y * scaleY2) - 1;
|
|
13507
|
-
|
|
13526
|
+
if (unitImg) {
|
|
13527
|
+
ctx.drawImage(unitImg, ux, uy, 5, 5);
|
|
13528
|
+
} else {
|
|
13529
|
+
ctx.fillStyle = unit.color;
|
|
13530
|
+
ctx.fillRect(ux, uy, 3, 3);
|
|
13531
|
+
}
|
|
13508
13532
|
}
|
|
13509
13533
|
if (viewportRect) {
|
|
13510
13534
|
ctx.strokeStyle = "#ffffff";
|
|
@@ -13516,7 +13540,7 @@ function MiniMap({
|
|
|
13516
13540
|
Math.floor(viewportRect.h * scaleY2)
|
|
13517
13541
|
);
|
|
13518
13542
|
}
|
|
13519
|
-
}, [tiles, units, width, height, mapWidth, mapHeight, viewportRect]);
|
|
13543
|
+
}, [tiles, units, width, height, mapWidth, mapHeight, viewportRect, tileAssets, unitAssets]);
|
|
13520
13544
|
const scaleX = width / mapWidth;
|
|
13521
13545
|
const scaleY = height / mapHeight;
|
|
13522
13546
|
const playerUnit = units.find((u) => u.isPlayer);
|
|
@@ -13525,10 +13549,12 @@ function MiniMap({
|
|
|
13525
13549
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13526
13550
|
/* @__PURE__ */ jsx("style", { children: `@keyframes minimap-blink{0%,49%{opacity:1}50%,100%{opacity:0}}` }),
|
|
13527
13551
|
/* @__PURE__ */ jsxs(
|
|
13528
|
-
|
|
13552
|
+
Box,
|
|
13529
13553
|
{
|
|
13554
|
+
position: "relative",
|
|
13555
|
+
display: "inline-block",
|
|
13530
13556
|
className: cn(
|
|
13531
|
-
"
|
|
13557
|
+
"border border-border/20 rounded-container",
|
|
13532
13558
|
className
|
|
13533
13559
|
),
|
|
13534
13560
|
children: [
|
|
@@ -13543,10 +13569,10 @@ function MiniMap({
|
|
|
13543
13569
|
}
|
|
13544
13570
|
),
|
|
13545
13571
|
playerLeft !== null && playerTop !== null && /* @__PURE__ */ jsx(
|
|
13546
|
-
|
|
13572
|
+
Box,
|
|
13547
13573
|
{
|
|
13574
|
+
position: "absolute",
|
|
13548
13575
|
style: {
|
|
13549
|
-
position: "absolute",
|
|
13550
13576
|
left: playerLeft,
|
|
13551
13577
|
top: playerTop,
|
|
13552
13578
|
width: 3,
|
|
@@ -13567,6 +13593,7 @@ var init_MiniMap = __esm({
|
|
|
13567
13593
|
"components/game/2d/atoms/MiniMap.tsx"() {
|
|
13568
13594
|
"use client";
|
|
13569
13595
|
init_cn();
|
|
13596
|
+
init_Box();
|
|
13570
13597
|
DEFAULT_TILES = [
|
|
13571
13598
|
{ x: 10, y: 10, color: "#4ade80" },
|
|
13572
13599
|
{ x: 20, y: 15, color: "#4ade80" },
|
|
@@ -13584,38 +13611,6 @@ var init_MiniMap = __esm({
|
|
|
13584
13611
|
MiniMap.displayName = "MiniMap";
|
|
13585
13612
|
}
|
|
13586
13613
|
});
|
|
13587
|
-
function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
|
|
13588
|
-
const px = typeof size === "number" ? size : sizeMap13[size];
|
|
13589
|
-
if (assetUrl?.url) {
|
|
13590
|
-
return /* @__PURE__ */ jsx(
|
|
13591
|
-
"img",
|
|
13592
|
-
{
|
|
13593
|
-
src: assetUrl.url,
|
|
13594
|
-
alt: alt ?? assetUrl.category ?? "",
|
|
13595
|
-
width: px,
|
|
13596
|
-
height: px,
|
|
13597
|
-
style: { imageRendering: "pixelated", objectFit: "contain", width: px, height: px },
|
|
13598
|
-
className: cn("flex-shrink-0", className)
|
|
13599
|
-
}
|
|
13600
|
-
);
|
|
13601
|
-
}
|
|
13602
|
-
const I = typeof icon === "string" ? resolveIcon(icon) : icon;
|
|
13603
|
-
return /* @__PURE__ */ jsx(I, { width: px, height: px, className: cn("flex-shrink-0", className) });
|
|
13604
|
-
}
|
|
13605
|
-
var sizeMap13;
|
|
13606
|
-
var init_GameIcon = __esm({
|
|
13607
|
-
"components/game/2d/atoms/GameIcon.tsx"() {
|
|
13608
|
-
"use client";
|
|
13609
|
-
init_cn();
|
|
13610
|
-
init_Icon();
|
|
13611
|
-
sizeMap13 = {
|
|
13612
|
-
sm: 16,
|
|
13613
|
-
md: 24,
|
|
13614
|
-
lg: 32
|
|
13615
|
-
};
|
|
13616
|
-
GameIcon.displayName = "GameIcon";
|
|
13617
|
-
}
|
|
13618
|
-
});
|
|
13619
13614
|
function ControlGrid({
|
|
13620
13615
|
kind,
|
|
13621
13616
|
buttons = DEFAULT_BUTTONS,
|
|
@@ -13625,13 +13620,14 @@ function ControlGrid({
|
|
|
13625
13620
|
actionEvent,
|
|
13626
13621
|
onDirection,
|
|
13627
13622
|
directionEvent,
|
|
13623
|
+
directionAssets,
|
|
13628
13624
|
size = "md",
|
|
13629
13625
|
disabled,
|
|
13630
13626
|
className
|
|
13631
13627
|
}) {
|
|
13632
13628
|
const eventBus = useEventBus();
|
|
13633
|
-
const [active, setActive] =
|
|
13634
|
-
const handlePress =
|
|
13629
|
+
const [active, setActive] = React112.useState(/* @__PURE__ */ new Set());
|
|
13630
|
+
const handlePress = React112.useCallback(
|
|
13635
13631
|
(id) => {
|
|
13636
13632
|
setActive((prev) => new Set(prev).add(id));
|
|
13637
13633
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -13643,7 +13639,7 @@ function ControlGrid({
|
|
|
13643
13639
|
},
|
|
13644
13640
|
[kind, actionEvent, directionEvent, eventBus, onAction, onDirection]
|
|
13645
13641
|
);
|
|
13646
|
-
const handleRelease =
|
|
13642
|
+
const handleRelease = React112.useCallback(
|
|
13647
13643
|
(id) => {
|
|
13648
13644
|
setActive((prev) => {
|
|
13649
13645
|
const next = new Set(prev);
|
|
@@ -13664,7 +13660,8 @@ function ControlGrid({
|
|
|
13664
13660
|
const dir = (d) => /* @__PURE__ */ jsx(
|
|
13665
13661
|
ControlButton,
|
|
13666
13662
|
{
|
|
13667
|
-
icon: arrowIcons[d],
|
|
13663
|
+
icon: directionAssets?.[d] ? void 0 : arrowIcons[d],
|
|
13664
|
+
assetUrl: directionAssets?.[d],
|
|
13668
13665
|
size: sizeKey[size],
|
|
13669
13666
|
variant: "secondary",
|
|
13670
13667
|
pressed: active.has(d),
|
|
@@ -13674,22 +13671,22 @@ function ControlGrid({
|
|
|
13674
13671
|
},
|
|
13675
13672
|
d
|
|
13676
13673
|
);
|
|
13677
|
-
return /* @__PURE__ */ jsxs(
|
|
13678
|
-
/* @__PURE__ */ jsx(
|
|
13674
|
+
return /* @__PURE__ */ jsxs(Box, { className: cn("inline-grid grid-cols-3", ds.gap, ds.container, className), children: [
|
|
13675
|
+
/* @__PURE__ */ jsx(Box, {}),
|
|
13679
13676
|
dir("up"),
|
|
13680
|
-
/* @__PURE__ */ jsx(
|
|
13677
|
+
/* @__PURE__ */ jsx(Box, {}),
|
|
13681
13678
|
dir("left"),
|
|
13682
|
-
/* @__PURE__ */ jsx(
|
|
13679
|
+
/* @__PURE__ */ jsx(Box, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(Box, { className: "w-6 h-6 rounded-interactive bg-muted border-2 border-muted-foreground" }) }),
|
|
13683
13680
|
dir("right"),
|
|
13684
|
-
/* @__PURE__ */ jsx(
|
|
13681
|
+
/* @__PURE__ */ jsx(Box, {}),
|
|
13685
13682
|
dir("down"),
|
|
13686
|
-
/* @__PURE__ */ jsx(
|
|
13683
|
+
/* @__PURE__ */ jsx(Box, {})
|
|
13687
13684
|
] });
|
|
13688
13685
|
}
|
|
13689
13686
|
if (layout === "diamond" && buttons.length === 4) {
|
|
13690
13687
|
const [top, right, bottom, left] = buttons;
|
|
13691
|
-
return /* @__PURE__ */ jsxs(
|
|
13692
|
-
/* @__PURE__ */ jsx(
|
|
13688
|
+
return /* @__PURE__ */ jsxs(Box, { className: cn(layoutClass.diamond, className), children: [
|
|
13689
|
+
/* @__PURE__ */ jsx(Box, {}),
|
|
13693
13690
|
/* @__PURE__ */ jsx(
|
|
13694
13691
|
ControlButton,
|
|
13695
13692
|
{
|
|
@@ -13704,7 +13701,7 @@ function ControlGrid({
|
|
|
13704
13701
|
disabled
|
|
13705
13702
|
}
|
|
13706
13703
|
),
|
|
13707
|
-
/* @__PURE__ */ jsx(
|
|
13704
|
+
/* @__PURE__ */ jsx(Box, {}),
|
|
13708
13705
|
/* @__PURE__ */ jsx(
|
|
13709
13706
|
ControlButton,
|
|
13710
13707
|
{
|
|
@@ -13719,7 +13716,7 @@ function ControlGrid({
|
|
|
13719
13716
|
disabled
|
|
13720
13717
|
}
|
|
13721
13718
|
),
|
|
13722
|
-
/* @__PURE__ */ jsx(
|
|
13719
|
+
/* @__PURE__ */ jsx(Box, {}),
|
|
13723
13720
|
/* @__PURE__ */ jsx(
|
|
13724
13721
|
ControlButton,
|
|
13725
13722
|
{
|
|
@@ -13734,7 +13731,7 @@ function ControlGrid({
|
|
|
13734
13731
|
disabled
|
|
13735
13732
|
}
|
|
13736
13733
|
),
|
|
13737
|
-
/* @__PURE__ */ jsx(
|
|
13734
|
+
/* @__PURE__ */ jsx(Box, {}),
|
|
13738
13735
|
/* @__PURE__ */ jsx(
|
|
13739
13736
|
ControlButton,
|
|
13740
13737
|
{
|
|
@@ -13749,10 +13746,10 @@ function ControlGrid({
|
|
|
13749
13746
|
disabled
|
|
13750
13747
|
}
|
|
13751
13748
|
),
|
|
13752
|
-
/* @__PURE__ */ jsx(
|
|
13749
|
+
/* @__PURE__ */ jsx(Box, {})
|
|
13753
13750
|
] });
|
|
13754
13751
|
}
|
|
13755
|
-
return /* @__PURE__ */ jsx(
|
|
13752
|
+
return /* @__PURE__ */ jsx(Box, { className: cn(layoutClass[layout], className), children: buttons.map((button) => /* @__PURE__ */ jsx(
|
|
13756
13753
|
ControlButton,
|
|
13757
13754
|
{
|
|
13758
13755
|
icon: button.icon,
|
|
@@ -13774,6 +13771,7 @@ var init_ControlGrid = __esm({
|
|
|
13774
13771
|
"use client";
|
|
13775
13772
|
init_cn();
|
|
13776
13773
|
init_useEventBus();
|
|
13774
|
+
init_Box();
|
|
13777
13775
|
init_ControlButton();
|
|
13778
13776
|
sizeKey = { sm: "sm", md: "md", lg: "lg" };
|
|
13779
13777
|
layoutClass = {
|
|
@@ -13818,7 +13816,7 @@ function StatBadge({
|
|
|
13818
13816
|
const numValue = typeof value === "number" ? value : parseInt(String(value), 10) || 0;
|
|
13819
13817
|
const resolvedAsset = iconUrl ?? assetUrl;
|
|
13820
13818
|
return /* @__PURE__ */ jsxs(
|
|
13821
|
-
|
|
13819
|
+
Box,
|
|
13822
13820
|
{
|
|
13823
13821
|
className: cn(
|
|
13824
13822
|
"inline-flex items-center gap-2 rounded-container border backdrop-blur-sm",
|
|
@@ -13827,18 +13825,8 @@ function StatBadge({
|
|
|
13827
13825
|
className
|
|
13828
13826
|
),
|
|
13829
13827
|
children: [
|
|
13830
|
-
resolvedAsset ? /* @__PURE__ */ jsx(
|
|
13831
|
-
|
|
13832
|
-
{
|
|
13833
|
-
src: resolvedAsset.url,
|
|
13834
|
-
alt: "",
|
|
13835
|
-
width: 16,
|
|
13836
|
-
height: 16,
|
|
13837
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
13838
|
-
className: "flex-shrink-0"
|
|
13839
|
-
}
|
|
13840
|
-
) : icon ? /* @__PURE__ */ jsx("span", { className: "flex-shrink-0 text-lg", children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, className: "w-4 h-4" }) : /* @__PURE__ */ jsx(Icon, { icon, className: "w-4 h-4" }) }) : null,
|
|
13841
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground font-medium", children: label }),
|
|
13828
|
+
resolvedAsset ? /* @__PURE__ */ jsx(GameIcon, { assetUrl: resolvedAsset, icon: "image", size: 16, className: "flex-shrink-0" }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: "flex-shrink-0 text-lg", children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, className: "w-4 h-4" }) : /* @__PURE__ */ jsx(Icon, { icon, className: "w-4 h-4" }) }) : null,
|
|
13829
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground font-medium", children: label }),
|
|
13842
13830
|
format === "hearts" && max && /* @__PURE__ */ jsx(
|
|
13843
13831
|
HealthBar,
|
|
13844
13832
|
{
|
|
@@ -13864,7 +13852,7 @@ function StatBadge({
|
|
|
13864
13852
|
size: size === "lg" ? "md" : "sm"
|
|
13865
13853
|
}
|
|
13866
13854
|
),
|
|
13867
|
-
format === "text" && /* @__PURE__ */ jsx("span",
|
|
13855
|
+
format === "text" && /* @__PURE__ */ jsx(Typography, { as: "span", className: "font-bold text-foreground", children: value })
|
|
13868
13856
|
]
|
|
13869
13857
|
}
|
|
13870
13858
|
);
|
|
@@ -13874,6 +13862,9 @@ var init_StatBadge = __esm({
|
|
|
13874
13862
|
"components/game/2d/molecules/StatBadge.tsx"() {
|
|
13875
13863
|
init_cn();
|
|
13876
13864
|
init_Icon();
|
|
13865
|
+
init_Box();
|
|
13866
|
+
init_Typography();
|
|
13867
|
+
init_GameIcon();
|
|
13877
13868
|
init_HealthBar();
|
|
13878
13869
|
init_ScoreDisplay();
|
|
13879
13870
|
sizeMap14 = {
|
|
@@ -13904,11 +13895,11 @@ function InventoryGrid({
|
|
|
13904
13895
|
const eventBus = useEventBus();
|
|
13905
13896
|
const slotCount = totalSlots ?? items.length;
|
|
13906
13897
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
13907
|
-
const handleSelect =
|
|
13898
|
+
const handleSelect = React112.useCallback(
|
|
13908
13899
|
(id) => {
|
|
13909
13900
|
onSelect?.(id);
|
|
13910
13901
|
if (selectEvent) {
|
|
13911
|
-
eventBus.emit(selectEvent
|
|
13902
|
+
eventBus.emit(`UI:${selectEvent}`, { id });
|
|
13912
13903
|
}
|
|
13913
13904
|
},
|
|
13914
13905
|
[onSelect, selectEvent, eventBus]
|
|
@@ -14051,9 +14042,9 @@ function GameHud({
|
|
|
14051
14042
|
if (position === "corners") {
|
|
14052
14043
|
const leftStats = stats.slice(0, Math.ceil(stats.length / 2));
|
|
14053
14044
|
const rightStats = stats.slice(Math.ceil(stats.length / 2));
|
|
14054
|
-
return /* @__PURE__ */ jsxs(
|
|
14055
|
-
/* @__PURE__ */ jsx(
|
|
14056
|
-
/* @__PURE__ */ jsx(
|
|
14045
|
+
return /* @__PURE__ */ jsxs(Box, { position: "relative", className: cn(positionMap[position], className), children: [
|
|
14046
|
+
/* @__PURE__ */ jsx(Box, { position: "absolute", className: "top-4 left-4 flex flex-col gap-2 pointer-events-auto", children: leftStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) }),
|
|
14047
|
+
/* @__PURE__ */ jsx(Box, { position: "absolute", className: "top-4 right-4 flex flex-col gap-2 items-end pointer-events-auto", children: rightStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
|
|
14057
14048
|
] });
|
|
14058
14049
|
}
|
|
14059
14050
|
if (position === "top" || position === "bottom") {
|
|
@@ -14062,7 +14053,7 @@ function GameHud({
|
|
|
14062
14053
|
const rightStats = stats.slice(mid);
|
|
14063
14054
|
const isTop = position === "top";
|
|
14064
14055
|
return /* @__PURE__ */ jsxs(
|
|
14065
|
-
|
|
14056
|
+
Box,
|
|
14066
14057
|
{
|
|
14067
14058
|
className: cn(
|
|
14068
14059
|
"flex items-center justify-between w-full",
|
|
@@ -14072,17 +14063,18 @@ function GameHud({
|
|
|
14072
14063
|
className
|
|
14073
14064
|
),
|
|
14074
14065
|
children: [
|
|
14075
|
-
/* @__PURE__ */ jsx(
|
|
14076
|
-
rightStats.length > 0 && /* @__PURE__ */ jsx(
|
|
14066
|
+
/* @__PURE__ */ jsx(Box, { className: "flex items-center gap-3 flex-shrink-0", children: leftStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) }),
|
|
14067
|
+
rightStats.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-3 flex-shrink-0", children: rightStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
|
|
14077
14068
|
]
|
|
14078
14069
|
}
|
|
14079
14070
|
);
|
|
14080
14071
|
}
|
|
14081
14072
|
return /* @__PURE__ */ jsx(
|
|
14082
|
-
|
|
14073
|
+
Box,
|
|
14083
14074
|
{
|
|
14075
|
+
position: "relative",
|
|
14084
14076
|
className: cn(
|
|
14085
|
-
"
|
|
14077
|
+
"z-10 flex items-center gap-4 px-4 py-2",
|
|
14086
14078
|
transparent ? "bg-black/30 backdrop-blur-sm" : "bg-surface/90 backdrop-blur-sm",
|
|
14087
14079
|
className
|
|
14088
14080
|
),
|
|
@@ -14094,6 +14086,7 @@ var positionMap, DEFAULT_HUD_STATS;
|
|
|
14094
14086
|
var init_GameHud = __esm({
|
|
14095
14087
|
"components/game/2d/molecules/GameHud.tsx"() {
|
|
14096
14088
|
init_cn();
|
|
14089
|
+
init_Box();
|
|
14097
14090
|
init_StatBadge();
|
|
14098
14091
|
positionMap = {
|
|
14099
14092
|
corners: "inset-0 pointer-events-none"
|
|
@@ -14113,34 +14106,28 @@ function GameMenu({
|
|
|
14113
14106
|
options,
|
|
14114
14107
|
menuItems,
|
|
14115
14108
|
onSelect,
|
|
14116
|
-
eventBus: eventBusProp,
|
|
14117
14109
|
background,
|
|
14118
|
-
logo
|
|
14110
|
+
logo,
|
|
14119
14111
|
className
|
|
14120
14112
|
}) {
|
|
14121
14113
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
14122
|
-
|
|
14123
|
-
|
|
14124
|
-
eventBusFromHook = useEventBus();
|
|
14125
|
-
} catch {
|
|
14126
|
-
}
|
|
14127
|
-
const eventBus = eventBusProp || eventBusFromHook;
|
|
14128
|
-
const handleOptionClick = React114.useCallback(
|
|
14114
|
+
const eventBus = useEventBus();
|
|
14115
|
+
const handleOptionClick = React112.useCallback(
|
|
14129
14116
|
(option) => {
|
|
14130
|
-
if (option.event
|
|
14117
|
+
if (option.event) {
|
|
14131
14118
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
14132
14119
|
}
|
|
14133
14120
|
if (onSelect) {
|
|
14134
14121
|
onSelect(option);
|
|
14135
14122
|
}
|
|
14136
|
-
if (option.navigatesTo
|
|
14123
|
+
if (option.navigatesTo) {
|
|
14137
14124
|
eventBus.emit("UI:NAVIGATE", { url: option.navigatesTo, option });
|
|
14138
14125
|
}
|
|
14139
14126
|
},
|
|
14140
14127
|
[eventBus, onSelect]
|
|
14141
14128
|
);
|
|
14142
14129
|
return /* @__PURE__ */ jsxs(
|
|
14143
|
-
|
|
14130
|
+
Box,
|
|
14144
14131
|
{
|
|
14145
14132
|
className: cn(
|
|
14146
14133
|
"min-h-screen w-full flex flex-col items-center justify-center p-8",
|
|
@@ -14150,18 +14137,12 @@ function GameMenu({
|
|
|
14150
14137
|
background: background ?? "linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0e17 100%)"
|
|
14151
14138
|
},
|
|
14152
14139
|
children: [
|
|
14153
|
-
/* @__PURE__ */ jsxs(
|
|
14154
|
-
logo && /* @__PURE__ */ jsx(
|
|
14155
|
-
"img",
|
|
14156
|
-
{
|
|
14157
|
-
src: logo,
|
|
14158
|
-
alt: title,
|
|
14159
|
-
className: "h-24 w-auto mx-auto mb-6 drop-shadow-2xl"
|
|
14160
|
-
}
|
|
14161
|
-
),
|
|
14140
|
+
/* @__PURE__ */ jsxs(Box, { className: "text-center mb-12 animate-fade-in", children: [
|
|
14141
|
+
logo && /* @__PURE__ */ jsx(GameIcon, { assetUrl: logo, icon: "image", size: 96, alt: title, className: "h-24 w-auto mx-auto mb-6 drop-shadow-2xl" }),
|
|
14162
14142
|
/* @__PURE__ */ jsx(
|
|
14163
|
-
|
|
14143
|
+
Typography,
|
|
14164
14144
|
{
|
|
14145
|
+
variant: "h1",
|
|
14165
14146
|
className: "text-5xl md:text-7xl font-bold text-[var(--color-foreground)] tracking-tight",
|
|
14166
14147
|
style: {
|
|
14167
14148
|
textShadow: "0 4px 12px rgba(0,0,0,0.5)"
|
|
@@ -14169,9 +14150,9 @@ function GameMenu({
|
|
|
14169
14150
|
children: title
|
|
14170
14151
|
}
|
|
14171
14152
|
),
|
|
14172
|
-
subtitle && /* @__PURE__ */ jsx("
|
|
14153
|
+
subtitle && /* @__PURE__ */ jsx(Typography, { variant: "body", className: "mt-2 text-lg text-muted-foreground tracking-widest uppercase", children: subtitle })
|
|
14173
14154
|
] }),
|
|
14174
|
-
/* @__PURE__ */ jsx(
|
|
14155
|
+
/* @__PURE__ */ jsx(Box, { className: "flex flex-col gap-4 w-full max-w-md", children: resolvedOptions.map((option, index) => /* @__PURE__ */ jsx(
|
|
14175
14156
|
ChoiceButton,
|
|
14176
14157
|
{
|
|
14177
14158
|
text: option.label,
|
|
@@ -14182,9 +14163,9 @@ function GameMenu({
|
|
|
14182
14163
|
},
|
|
14183
14164
|
index
|
|
14184
14165
|
)) }),
|
|
14185
|
-
/* @__PURE__ */ jsxs(
|
|
14186
|
-
/* @__PURE__ */ jsx(
|
|
14187
|
-
/* @__PURE__ */ jsx(
|
|
14166
|
+
/* @__PURE__ */ jsxs(Box, { position: "absolute", className: "inset-0 pointer-events-none overflow-hidden", children: [
|
|
14167
|
+
/* @__PURE__ */ jsx(Box, { position: "absolute", className: "top-1/4 left-1/4 w-64 h-64 bg-info/10 rounded-container blur-3xl" }),
|
|
14168
|
+
/* @__PURE__ */ jsx(Box, { position: "absolute", className: "bottom-1/4 right-1/4 w-96 h-96 bg-accent/10 rounded-container blur-3xl" })
|
|
14188
14169
|
] })
|
|
14189
14170
|
]
|
|
14190
14171
|
}
|
|
@@ -14196,6 +14177,9 @@ var init_GameMenu = __esm({
|
|
|
14196
14177
|
"use client";
|
|
14197
14178
|
init_cn();
|
|
14198
14179
|
init_useEventBus();
|
|
14180
|
+
init_Box();
|
|
14181
|
+
init_Typography();
|
|
14182
|
+
init_GameIcon();
|
|
14199
14183
|
init_ChoiceButton();
|
|
14200
14184
|
DEFAULT_MENU_OPTIONS = [
|
|
14201
14185
|
{ label: "New Game", event: "NEW_GAME", variant: "primary" },
|
|
@@ -15615,10 +15599,11 @@ function Canvas2D({
|
|
|
15615
15599
|
}
|
|
15616
15600
|
}
|
|
15617
15601
|
),
|
|
15618
|
-
process.env.NODE_ENV !== "production" && /* @__PURE__ */ jsxs(
|
|
15602
|
+
process.env.NODE_ENV !== "production" && /* @__PURE__ */ jsxs(Box, { "data-game-actions": "", className: "sr-only", "aria-hidden": "true", children: [
|
|
15619
15603
|
tileClickEvent && /* @__PURE__ */ jsx(
|
|
15620
|
-
|
|
15604
|
+
Button,
|
|
15621
15605
|
{
|
|
15606
|
+
variant: "ghost",
|
|
15622
15607
|
"data-event": tileClickEvent,
|
|
15623
15608
|
"data-x": "0",
|
|
15624
15609
|
"data-y": "0",
|
|
@@ -15627,8 +15612,9 @@ function Canvas2D({
|
|
|
15627
15612
|
}
|
|
15628
15613
|
),
|
|
15629
15614
|
unitClickEvent && units && units.length > 0 && /* @__PURE__ */ jsx(
|
|
15630
|
-
|
|
15615
|
+
Button,
|
|
15631
15616
|
{
|
|
15617
|
+
variant: "ghost",
|
|
15632
15618
|
"data-event": unitClickEvent,
|
|
15633
15619
|
"data-unit-id": units[0].id,
|
|
15634
15620
|
onClick: () => eventBus.emit(`UI:${unitClickEvent}`, { unitId: units[0].id }),
|
|
@@ -15637,15 +15623,17 @@ function Canvas2D({
|
|
|
15637
15623
|
)
|
|
15638
15624
|
] }),
|
|
15639
15625
|
unitOverlays.map(({ unit, screenX, screenY }) => /* @__PURE__ */ jsxs(
|
|
15640
|
-
|
|
15626
|
+
Box,
|
|
15641
15627
|
{
|
|
15642
|
-
|
|
15628
|
+
position: "absolute",
|
|
15629
|
+
className: "pointer-events-none",
|
|
15643
15630
|
style: { left: Math.round(screenX), top: Math.round(screenY), transform: "translate(-50%, 0)", zIndex: 5 },
|
|
15644
15631
|
children: [
|
|
15645
15632
|
unit.name && /* @__PURE__ */ jsx(
|
|
15646
|
-
|
|
15633
|
+
Typography,
|
|
15647
15634
|
{
|
|
15648
|
-
|
|
15635
|
+
as: "span",
|
|
15636
|
+
className: "text-white text-xs font-bold px-1.5 py-0.5 rounded mb-0.5 whitespace-nowrap block",
|
|
15649
15637
|
style: { background: unit.team === "player" ? "rgba(59,130,246,0.9)" : unit.team === "enemy" ? "rgba(239,68,68,0.9)" : "rgba(107,114,128,0.9)" },
|
|
15650
15638
|
children: unit.name
|
|
15651
15639
|
}
|
|
@@ -15655,7 +15643,7 @@ function Canvas2D({
|
|
|
15655
15643
|
},
|
|
15656
15644
|
unit.id
|
|
15657
15645
|
)),
|
|
15658
|
-
showMinimap && /* @__PURE__ */ jsx(
|
|
15646
|
+
showMinimap && /* @__PURE__ */ jsx(Box, { position: "absolute", className: "bottom-2 right-2 pointer-events-none", style: { zIndex: 10 }, children: /* @__PURE__ */ jsx(
|
|
15659
15647
|
MiniMap,
|
|
15660
15648
|
{
|
|
15661
15649
|
tiles: miniMapTiles,
|
|
@@ -15677,6 +15665,7 @@ var init_Canvas2D = __esm({
|
|
|
15677
15665
|
init_cn();
|
|
15678
15666
|
init_useEventBus();
|
|
15679
15667
|
init_Box();
|
|
15668
|
+
init_Button();
|
|
15680
15669
|
init_Stack();
|
|
15681
15670
|
init_Icon();
|
|
15682
15671
|
init_Typography();
|
|
@@ -15988,7 +15977,9 @@ var init_GameAudioProvider = __esm({
|
|
|
15988
15977
|
});
|
|
15989
15978
|
function GameAudioToggle({
|
|
15990
15979
|
size = "sm",
|
|
15991
|
-
className
|
|
15980
|
+
className,
|
|
15981
|
+
onAsset,
|
|
15982
|
+
offAsset
|
|
15992
15983
|
}) {
|
|
15993
15984
|
const ctx = useGameAudioContextOptional();
|
|
15994
15985
|
const [localMuted, setLocalMuted] = useState(false);
|
|
@@ -15997,6 +15988,7 @@ function GameAudioToggle({
|
|
|
15997
15988
|
const handleToggle = useCallback(() => {
|
|
15998
15989
|
setMuted(!muted);
|
|
15999
15990
|
}, [muted, setMuted]);
|
|
15991
|
+
const activeAsset = muted ? offAsset : onAsset;
|
|
16000
15992
|
return /* @__PURE__ */ jsx(
|
|
16001
15993
|
Button,
|
|
16002
15994
|
{
|
|
@@ -16005,7 +15997,7 @@ function GameAudioToggle({
|
|
|
16005
15997
|
onClick: handleToggle,
|
|
16006
15998
|
className: cn("text-lg leading-none px-2", className),
|
|
16007
15999
|
"aria-pressed": muted,
|
|
16008
|
-
children: muted ? "\u{1F507}" : "\u{1F50A}"
|
|
16000
|
+
children: activeAsset ? /* @__PURE__ */ jsx(GameIcon, { assetUrl: activeAsset, icon: "image", size: 20, alt: muted ? "Muted" : "Sound on", className: "w-5 h-5 object-contain" }) : muted ? "\u{1F507}" : "\u{1F50A}"
|
|
16009
16001
|
}
|
|
16010
16002
|
);
|
|
16011
16003
|
}
|
|
@@ -16015,6 +16007,7 @@ var init_GameAudioToggle = __esm({
|
|
|
16015
16007
|
init_atoms();
|
|
16016
16008
|
init_cn();
|
|
16017
16009
|
init_GameAudioProvider();
|
|
16010
|
+
init_GameIcon();
|
|
16018
16011
|
GameAudioToggle.displayName = "GameAudioToggle";
|
|
16019
16012
|
}
|
|
16020
16013
|
});
|
|
@@ -17297,6 +17290,7 @@ function PlatformerBoard({
|
|
|
17297
17290
|
canvasHeight: _canvasHeight = 400,
|
|
17298
17291
|
playerSprite,
|
|
17299
17292
|
tileSprites,
|
|
17293
|
+
ui: _ui,
|
|
17300
17294
|
bgColor: _bgColor,
|
|
17301
17295
|
keyEvent = "KEY",
|
|
17302
17296
|
playAgainEvent = "PLAY_AGAIN",
|
|
@@ -19155,6 +19149,7 @@ function TanksBoard({
|
|
|
19155
19149
|
features,
|
|
19156
19150
|
assetManifest,
|
|
19157
19151
|
assetBaseUrl,
|
|
19152
|
+
ui: _ui,
|
|
19158
19153
|
scale = 0.45,
|
|
19159
19154
|
showMinimap = true,
|
|
19160
19155
|
enableCamera = true,
|
|
@@ -19682,7 +19677,7 @@ function LinearView({
|
|
|
19682
19677
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
19683
19678
|
const isDone = i < currentIdx;
|
|
19684
19679
|
const isCurrent = i === currentIdx;
|
|
19685
|
-
return /* @__PURE__ */ jsxs(
|
|
19680
|
+
return /* @__PURE__ */ jsxs(React112__default.Fragment, { children: [
|
|
19686
19681
|
i > 0 && /* @__PURE__ */ jsx(
|
|
19687
19682
|
Typography,
|
|
19688
19683
|
{
|
|
@@ -19903,7 +19898,7 @@ function TraitSlot({
|
|
|
19903
19898
|
size = "md",
|
|
19904
19899
|
showTooltip = true,
|
|
19905
19900
|
categoryColors,
|
|
19906
|
-
tooltipFrameUrl
|
|
19901
|
+
tooltipFrameUrl,
|
|
19907
19902
|
className,
|
|
19908
19903
|
feedback,
|
|
19909
19904
|
onItemDrop,
|
|
@@ -20033,7 +20028,7 @@ function TraitSlot({
|
|
|
20033
20028
|
as: "img",
|
|
20034
20029
|
className: "object-contain",
|
|
20035
20030
|
style: { width: config.icon, height: config.icon },
|
|
20036
|
-
...{ src: equippedItem.iconUrl, alt: equippedItem.name }
|
|
20031
|
+
...{ src: equippedItem.iconUrl.url, alt: equippedItem.name }
|
|
20037
20032
|
}
|
|
20038
20033
|
) : /* @__PURE__ */ jsx(Typography, { variant: "body1", className: "text-center leading-none", style: { fontSize: config.icon }, children: equippedItem.iconEmoji || "\u2726" }),
|
|
20039
20034
|
(onRemove || removeEvent) && /* @__PURE__ */ jsx(
|
|
@@ -20062,7 +20057,7 @@ function TraitSlot({
|
|
|
20062
20057
|
...getTooltipStyle(),
|
|
20063
20058
|
minWidth: 200,
|
|
20064
20059
|
...tooltipFrameUrl ? {
|
|
20065
|
-
borderImage: `url(${tooltipFrameUrl}) 60 fill / 15px / 0 stretch`,
|
|
20060
|
+
borderImage: `url(${tooltipFrameUrl.url}) 60 fill / 15px / 0 stretch`,
|
|
20066
20061
|
border: "none"
|
|
20067
20062
|
} : {}
|
|
20068
20063
|
},
|
|
@@ -20137,7 +20132,7 @@ function ActionTile({
|
|
|
20137
20132
|
draggable: !disabled,
|
|
20138
20133
|
onDragStart: handleDragStart,
|
|
20139
20134
|
children: [
|
|
20140
|
-
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" }),
|
|
20135
|
+
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" }),
|
|
20141
20136
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: cn(config.text, "text-foreground font-medium whitespace-nowrap"), children: action.name })
|
|
20142
20137
|
]
|
|
20143
20138
|
}
|
|
@@ -20210,7 +20205,7 @@ function SequenceBar({
|
|
|
20210
20205
|
onSlotRemove(index);
|
|
20211
20206
|
}, [onSlotRemove, playing]);
|
|
20212
20207
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
20213
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
20208
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React112__default.Fragment, { children: [
|
|
20214
20209
|
i > 0 && /* @__PURE__ */ jsx(
|
|
20215
20210
|
Typography,
|
|
20216
20211
|
{
|
|
@@ -20261,6 +20256,42 @@ function computeSlotFeedback(playerSeq, solutions) {
|
|
|
20261
20256
|
(id, i) => id !== void 0 && id === bestSolution[i] ? "correct" : "wrong"
|
|
20262
20257
|
);
|
|
20263
20258
|
}
|
|
20259
|
+
function isFieldRecord(v) {
|
|
20260
|
+
return typeof v === "object" && v !== null && !Array.isArray(v) && !(v instanceof Date);
|
|
20261
|
+
}
|
|
20262
|
+
function assetFromField(v) {
|
|
20263
|
+
if (!isFieldRecord(v)) return void 0;
|
|
20264
|
+
const url = typeof v.url === "string" ? v.url : void 0;
|
|
20265
|
+
const role = typeof v.role === "string" ? v.role : void 0;
|
|
20266
|
+
const category = typeof v.category === "string" ? v.category : "";
|
|
20267
|
+
if (!url || !role) return void 0;
|
|
20268
|
+
return {
|
|
20269
|
+
url,
|
|
20270
|
+
role,
|
|
20271
|
+
category,
|
|
20272
|
+
name: typeof v.name === "string" ? v.name : void 0,
|
|
20273
|
+
thumbnailUrl: typeof v.thumbnailUrl === "string" ? v.thumbnailUrl : void 0,
|
|
20274
|
+
style: typeof v.style === "string" ? v.style : void 0,
|
|
20275
|
+
variant: typeof v.variant === "string" ? v.variant : void 0,
|
|
20276
|
+
dimension: typeof v.dimension === "string" ? v.dimension : void 0,
|
|
20277
|
+
aspect: typeof v.aspect === "string" ? v.aspect : void 0
|
|
20278
|
+
};
|
|
20279
|
+
}
|
|
20280
|
+
function slotItemFromField(fv) {
|
|
20281
|
+
if (!isFieldRecord(fv)) return void 0;
|
|
20282
|
+
const id = typeof fv.id === "string" ? fv.id : void 0;
|
|
20283
|
+
const name = typeof fv.name === "string" ? fv.name : void 0;
|
|
20284
|
+
const category = typeof fv.category === "string" ? fv.category : void 0;
|
|
20285
|
+
if (!id || !name || !category) return void 0;
|
|
20286
|
+
return {
|
|
20287
|
+
id,
|
|
20288
|
+
name,
|
|
20289
|
+
category,
|
|
20290
|
+
description: typeof fv.description === "string" ? fv.description : void 0,
|
|
20291
|
+
iconEmoji: typeof fv.iconEmoji === "string" ? fv.iconEmoji : void 0,
|
|
20292
|
+
iconUrl: assetFromField(fv.iconUrl)
|
|
20293
|
+
};
|
|
20294
|
+
}
|
|
20264
20295
|
function SequencerBoard({
|
|
20265
20296
|
entity,
|
|
20266
20297
|
categoryColors,
|
|
@@ -20271,6 +20302,7 @@ function SequencerBoard({
|
|
|
20271
20302
|
removeEvent,
|
|
20272
20303
|
checkEvent,
|
|
20273
20304
|
playAgainEvent,
|
|
20305
|
+
stepEvent,
|
|
20274
20306
|
className
|
|
20275
20307
|
}) {
|
|
20276
20308
|
const { emit } = useEventBus();
|
|
@@ -20278,7 +20310,11 @@ function SequencerBoard({
|
|
|
20278
20310
|
const resolved = boardEntity(entity);
|
|
20279
20311
|
const maxSlots = num(resolved?.maxSlots) || 3;
|
|
20280
20312
|
const solutions = Array.isArray(resolved?.solutions) ? resolved.solutions : [];
|
|
20281
|
-
const availableActions = Array.isArray(resolved?.availableActions) ? resolved.availableActions : []
|
|
20313
|
+
const availableActions = (Array.isArray(resolved?.availableActions) ? resolved.availableActions : []).reduce((acc, fv) => {
|
|
20314
|
+
const item = slotItemFromField(fv);
|
|
20315
|
+
if (item) acc.push(item);
|
|
20316
|
+
return acc;
|
|
20317
|
+
}, []);
|
|
20282
20318
|
const allowDuplicates = resolved?.allowDuplicates !== false;
|
|
20283
20319
|
const entitySlots = Array.isArray(resolved?.slots) ? resolved.slots : [];
|
|
20284
20320
|
const entityResult = str(resolved?.result);
|
|
@@ -20336,7 +20372,7 @@ function SequencerBoard({
|
|
|
20336
20372
|
let step = 0;
|
|
20337
20373
|
const advance = () => {
|
|
20338
20374
|
step++;
|
|
20339
|
-
emit(
|
|
20375
|
+
if (stepEvent) emit(`UI:${stepEvent}`, { step });
|
|
20340
20376
|
if (step >= maxSlots) {
|
|
20341
20377
|
if (checkEvent) emit(`UI:${checkEvent}`, { sequence: playerIds });
|
|
20342
20378
|
const playerSeq = slots.map((s) => s?.id);
|
|
@@ -22561,35 +22597,7 @@ var init_SimulationCanvas = __esm({
|
|
|
22561
22597
|
SimulationCanvas.displayName = "SimulationCanvas";
|
|
22562
22598
|
}
|
|
22563
22599
|
});
|
|
22564
|
-
|
|
22565
|
-
if (_scr) return _scr;
|
|
22566
|
-
const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
|
|
22567
|
-
_scr = mod.SlotContentRenderer;
|
|
22568
|
-
return _scr;
|
|
22569
|
-
}
|
|
22570
|
-
function resolveDescriptor(value, idPrefix) {
|
|
22571
|
-
if (value === null || value === void 0) return value;
|
|
22572
|
-
if (React114__default.isValidElement(value)) return value;
|
|
22573
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
|
|
22574
|
-
if (Array.isArray(value)) {
|
|
22575
|
-
return value.map((item, i) => /* @__PURE__ */ jsx(React114__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
|
|
22576
|
-
}
|
|
22577
|
-
if (typeof value === "object") {
|
|
22578
|
-
const rec = value;
|
|
22579
|
-
if (typeof rec.type === "string" && getComponentForPattern(rec.type) !== null) {
|
|
22580
|
-
const type = rec.type;
|
|
22581
|
-
const _id = typeof rec._id === "string" ? rec._id : void 0;
|
|
22582
|
-
const nestedProps = rec.props !== void 0 && typeof rec.props === "object" && !Array.isArray(rec.props) && rec.props !== null ? rec.props : void 0;
|
|
22583
|
-
const { type: _t, props: _p, _id: _d, ...flatRest } = rec;
|
|
22584
|
-
const resolvedProps = nestedProps !== void 0 ? nestedProps : flatRest;
|
|
22585
|
-
const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
|
|
22586
|
-
const SCR = getSlotContentRenderer2();
|
|
22587
|
-
return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
|
|
22588
|
-
}
|
|
22589
|
-
}
|
|
22590
|
-
return null;
|
|
22591
|
-
}
|
|
22592
|
-
var _scr, GameTemplate;
|
|
22600
|
+
var GameTemplate;
|
|
22593
22601
|
var init_GameTemplate = __esm({
|
|
22594
22602
|
"components/game/2d/templates/GameTemplate.tsx"() {
|
|
22595
22603
|
init_cn();
|
|
@@ -22597,7 +22605,6 @@ var init_GameTemplate = __esm({
|
|
|
22597
22605
|
init_Stack();
|
|
22598
22606
|
init_Typography();
|
|
22599
22607
|
init_Button();
|
|
22600
|
-
_scr = null;
|
|
22601
22608
|
GameTemplate = ({
|
|
22602
22609
|
entity,
|
|
22603
22610
|
title = "Game",
|
|
@@ -22606,7 +22613,8 @@ var init_GameTemplate = __esm({
|
|
|
22606
22613
|
debugPanel,
|
|
22607
22614
|
showDebugPanel = false,
|
|
22608
22615
|
controls,
|
|
22609
|
-
className
|
|
22616
|
+
className,
|
|
22617
|
+
backgroundAsset
|
|
22610
22618
|
}) => {
|
|
22611
22619
|
return /* @__PURE__ */ jsxs(
|
|
22612
22620
|
Box,
|
|
@@ -22663,15 +22671,16 @@ var init_GameTemplate = __esm({
|
|
|
22663
22671
|
{
|
|
22664
22672
|
position: "relative",
|
|
22665
22673
|
fullWidth: true,
|
|
22666
|
-
className: "flex-1 bg-muted",
|
|
22674
|
+
className: backgroundAsset ? "flex-1" : "flex-1 bg-muted",
|
|
22675
|
+
style: backgroundAsset ? { backgroundImage: `url(${backgroundAsset.url})`, backgroundSize: "cover", backgroundPosition: "center" } : void 0,
|
|
22667
22676
|
children: [
|
|
22668
|
-
|
|
22677
|
+
children,
|
|
22669
22678
|
hud && /* @__PURE__ */ jsx(
|
|
22670
22679
|
Box,
|
|
22671
22680
|
{
|
|
22672
22681
|
position: "absolute",
|
|
22673
22682
|
className: "top-0 left-0 right-0 pointer-events-none",
|
|
22674
|
-
children: /* @__PURE__ */ jsx(Box, { padding: "md", className: "pointer-events-auto w-fit", children:
|
|
22683
|
+
children: /* @__PURE__ */ jsx(Box, { padding: "md", className: "pointer-events-auto w-fit", children: hud })
|
|
22675
22684
|
}
|
|
22676
22685
|
)
|
|
22677
22686
|
]
|
|
@@ -22696,7 +22705,7 @@ var init_GameTemplate = __esm({
|
|
|
22696
22705
|
children: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Debug Panel" })
|
|
22697
22706
|
}
|
|
22698
22707
|
),
|
|
22699
|
-
/* @__PURE__ */ jsx(Box, { padding: "md", children:
|
|
22708
|
+
/* @__PURE__ */ jsx(Box, { padding: "md", children: debugPanel })
|
|
22700
22709
|
]
|
|
22701
22710
|
}
|
|
22702
22711
|
)
|
|
@@ -22707,59 +22716,21 @@ var init_GameTemplate = __esm({
|
|
|
22707
22716
|
GameTemplate.displayName = "GameTemplate";
|
|
22708
22717
|
}
|
|
22709
22718
|
});
|
|
22710
|
-
|
|
22711
|
-
if (Array.isArray(v) || React114__default.isValidElement(v)) return null;
|
|
22712
|
-
const o = v;
|
|
22713
|
-
if (typeof o.type !== "string") return null;
|
|
22714
|
-
const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
|
|
22715
|
-
const _id = typeof o._id === "string" ? o._id : void 0;
|
|
22716
|
-
const sourceTrait = typeof o.sourceTrait === "string" ? o.sourceTrait : void 0;
|
|
22717
|
-
return { type: o.type, props, _id, sourceTrait };
|
|
22718
|
-
}
|
|
22719
|
-
function getSlotContentRenderer3() {
|
|
22720
|
-
if (_scr2) return _scr2;
|
|
22721
|
-
const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
|
|
22722
|
-
_scr2 = mod.SlotContentRenderer;
|
|
22723
|
-
return _scr2;
|
|
22724
|
-
}
|
|
22725
|
-
function resolveDescriptor2(value, idPrefix) {
|
|
22726
|
-
if (value === null || value === void 0) return value;
|
|
22727
|
-
if (React114__default.isValidElement(value)) return value;
|
|
22728
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
|
|
22729
|
-
if (Array.isArray(value)) {
|
|
22730
|
-
return value.map((item, i) => /* @__PURE__ */ jsx(React114__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
|
|
22731
|
-
}
|
|
22732
|
-
if (typeof value === "object" && value !== null) {
|
|
22733
|
-
const desc = asDescriptor(value);
|
|
22734
|
-
if (desc !== null && getComponentForPattern(desc.type) !== null) {
|
|
22735
|
-
const resolvedProps = desc.props ?? {};
|
|
22736
|
-
const content = {
|
|
22737
|
-
id: desc._id ?? idPrefix,
|
|
22738
|
-
pattern: desc.type,
|
|
22739
|
-
props: resolvedProps,
|
|
22740
|
-
priority: 0,
|
|
22741
|
-
...desc.sourceTrait !== void 0 && { sourceTrait: desc.sourceTrait }
|
|
22742
|
-
};
|
|
22743
|
-
const SCR = getSlotContentRenderer3();
|
|
22744
|
-
return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 }, content.id);
|
|
22745
|
-
}
|
|
22746
|
-
}
|
|
22747
|
-
return null;
|
|
22748
|
-
}
|
|
22749
|
-
var _scr2, GameShell;
|
|
22719
|
+
var GameShell;
|
|
22750
22720
|
var init_GameShell = __esm({
|
|
22751
22721
|
"components/game/2d/templates/GameShell.tsx"() {
|
|
22752
22722
|
init_cn();
|
|
22753
22723
|
init_Box();
|
|
22754
22724
|
init_Stack();
|
|
22755
22725
|
init_Typography();
|
|
22756
|
-
_scr2 = null;
|
|
22757
22726
|
GameShell = ({
|
|
22758
22727
|
appName = "Game",
|
|
22759
22728
|
hud,
|
|
22760
22729
|
className,
|
|
22761
22730
|
showTopBar = true,
|
|
22762
|
-
children
|
|
22731
|
+
children,
|
|
22732
|
+
backgroundAsset,
|
|
22733
|
+
hudBackgroundAsset
|
|
22763
22734
|
}) => {
|
|
22764
22735
|
return /* @__PURE__ */ jsxs(
|
|
22765
22736
|
Box,
|
|
@@ -22774,7 +22745,7 @@ var init_GameShell = __esm({
|
|
|
22774
22745
|
width: "100vw",
|
|
22775
22746
|
height: "100vh",
|
|
22776
22747
|
overflow: "hidden",
|
|
22777
|
-
background: "var(--color-background, #0a0a0f)",
|
|
22748
|
+
background: backgroundAsset ? `url(${backgroundAsset.url}) center/cover no-repeat` : "var(--color-background, #0a0a0f)",
|
|
22778
22749
|
color: "var(--color-text, #e0e0e0)"
|
|
22779
22750
|
},
|
|
22780
22751
|
children: [
|
|
@@ -22784,7 +22755,7 @@ var init_GameShell = __esm({
|
|
|
22784
22755
|
className: "game-shell__header",
|
|
22785
22756
|
style: {
|
|
22786
22757
|
flexShrink: 0,
|
|
22787
|
-
background: "var(--color-surface, #12121f)",
|
|
22758
|
+
background: hudBackgroundAsset ? `url(${hudBackgroundAsset.url}) center/cover no-repeat` : "var(--color-surface, #12121f)",
|
|
22788
22759
|
borderBottom: "1px solid var(--color-border, #2a2a3a)"
|
|
22789
22760
|
},
|
|
22790
22761
|
children: [
|
|
@@ -22807,7 +22778,7 @@ var init_GameShell = __esm({
|
|
|
22807
22778
|
)
|
|
22808
22779
|
}
|
|
22809
22780
|
),
|
|
22810
|
-
hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", style: { width: "100%" }, children:
|
|
22781
|
+
hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", style: { width: "100%" }, children: hud })
|
|
22811
22782
|
]
|
|
22812
22783
|
}
|
|
22813
22784
|
),
|
|
@@ -22820,7 +22791,7 @@ var init_GameShell = __esm({
|
|
|
22820
22791
|
overflow: "hidden",
|
|
22821
22792
|
position: "relative"
|
|
22822
22793
|
},
|
|
22823
|
-
children
|
|
22794
|
+
children
|
|
22824
22795
|
}
|
|
22825
22796
|
)
|
|
22826
22797
|
]
|
|
@@ -24027,7 +23998,7 @@ var init_ErrorBoundary = __esm({
|
|
|
24027
23998
|
}
|
|
24028
23999
|
);
|
|
24029
24000
|
};
|
|
24030
|
-
ErrorBoundary = class extends
|
|
24001
|
+
ErrorBoundary = class extends React112__default.Component {
|
|
24031
24002
|
constructor(props) {
|
|
24032
24003
|
super(props);
|
|
24033
24004
|
__publicField(this, "reset", () => {
|
|
@@ -24309,7 +24280,7 @@ var init_Container = __esm({
|
|
|
24309
24280
|
as: Component = "div"
|
|
24310
24281
|
}) => {
|
|
24311
24282
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
24312
|
-
return
|
|
24283
|
+
return React112__default.createElement(
|
|
24313
24284
|
Component,
|
|
24314
24285
|
{
|
|
24315
24286
|
className: cn(
|
|
@@ -25664,9 +25635,9 @@ var init_BiologyCanvas = __esm({
|
|
|
25664
25635
|
}
|
|
25665
25636
|
});
|
|
25666
25637
|
|
|
25667
|
-
// node_modules
|
|
25638
|
+
// node_modules/katex/dist/katex.min.css
|
|
25668
25639
|
var init_katex_min = __esm({
|
|
25669
|
-
"node_modules
|
|
25640
|
+
"node_modules/katex/dist/katex.min.css"() {
|
|
25670
25641
|
}
|
|
25671
25642
|
});
|
|
25672
25643
|
var Tabs;
|
|
@@ -26106,7 +26077,7 @@ var init_CodeBlock = __esm({
|
|
|
26106
26077
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
26107
26078
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
26108
26079
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
26109
|
-
CodeBlock =
|
|
26080
|
+
CodeBlock = React112__default.memo(
|
|
26110
26081
|
({
|
|
26111
26082
|
code: rawCode,
|
|
26112
26083
|
language = "text",
|
|
@@ -26693,7 +26664,7 @@ var init_MarkdownContent = __esm({
|
|
|
26693
26664
|
init_Box();
|
|
26694
26665
|
init_CodeBlock();
|
|
26695
26666
|
init_cn();
|
|
26696
|
-
MarkdownContent =
|
|
26667
|
+
MarkdownContent = React112__default.memo(
|
|
26697
26668
|
({ content, direction = "ltr", className }) => {
|
|
26698
26669
|
const { t: _t } = useTranslate();
|
|
26699
26670
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -28020,7 +27991,7 @@ var init_StateMachineView = __esm({
|
|
|
28020
27991
|
style: { top: title ? 30 : 0 },
|
|
28021
27992
|
children: [
|
|
28022
27993
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
28023
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
27994
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React112__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
28024
27995
|
StateNode2,
|
|
28025
27996
|
{
|
|
28026
27997
|
state,
|
|
@@ -32623,6 +32594,8 @@ function CounterMinimal({
|
|
|
32623
32594
|
size = "md",
|
|
32624
32595
|
onDecrement,
|
|
32625
32596
|
onIncrement,
|
|
32597
|
+
decrementEvent,
|
|
32598
|
+
incrementEvent,
|
|
32626
32599
|
className
|
|
32627
32600
|
}) {
|
|
32628
32601
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
@@ -32633,6 +32606,7 @@ function CounterMinimal({
|
|
|
32633
32606
|
{
|
|
32634
32607
|
variant: "secondary",
|
|
32635
32608
|
size: sizeStyles8[size].button,
|
|
32609
|
+
action: decrementEvent,
|
|
32636
32610
|
onClick: onDecrement,
|
|
32637
32611
|
disabled: resolved.decrementDisabled,
|
|
32638
32612
|
icon: "minus",
|
|
@@ -32655,6 +32629,7 @@ function CounterMinimal({
|
|
|
32655
32629
|
{
|
|
32656
32630
|
variant: "secondary",
|
|
32657
32631
|
size: sizeStyles8[size].button,
|
|
32632
|
+
action: incrementEvent,
|
|
32658
32633
|
onClick: onIncrement,
|
|
32659
32634
|
disabled: resolved.incrementDisabled,
|
|
32660
32635
|
icon: "plus",
|
|
@@ -32671,6 +32646,9 @@ function CounterStandard({
|
|
|
32671
32646
|
onDecrement,
|
|
32672
32647
|
onIncrement,
|
|
32673
32648
|
onReset,
|
|
32649
|
+
decrementEvent,
|
|
32650
|
+
incrementEvent,
|
|
32651
|
+
resetEvent,
|
|
32674
32652
|
className
|
|
32675
32653
|
}) {
|
|
32676
32654
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
@@ -32701,6 +32679,7 @@ function CounterStandard({
|
|
|
32701
32679
|
{
|
|
32702
32680
|
variant: "secondary",
|
|
32703
32681
|
size: sizeStyles8[size].button,
|
|
32682
|
+
action: decrementEvent,
|
|
32704
32683
|
onClick: onDecrement,
|
|
32705
32684
|
disabled: resolved.decrementDisabled,
|
|
32706
32685
|
icon: "minus"
|
|
@@ -32711,6 +32690,7 @@ function CounterStandard({
|
|
|
32711
32690
|
{
|
|
32712
32691
|
variant: "primary",
|
|
32713
32692
|
size: sizeStyles8[size].button,
|
|
32693
|
+
action: incrementEvent,
|
|
32714
32694
|
onClick: onIncrement,
|
|
32715
32695
|
disabled: resolved.incrementDisabled,
|
|
32716
32696
|
icon: "plus"
|
|
@@ -32722,6 +32702,7 @@ function CounterStandard({
|
|
|
32722
32702
|
{
|
|
32723
32703
|
variant: "ghost",
|
|
32724
32704
|
size: "sm",
|
|
32705
|
+
action: resetEvent,
|
|
32725
32706
|
onClick: onReset,
|
|
32726
32707
|
icon: "rotate-ccw",
|
|
32727
32708
|
children: "Reset"
|
|
@@ -32737,6 +32718,9 @@ function CounterFull({
|
|
|
32737
32718
|
onDecrement,
|
|
32738
32719
|
onIncrement,
|
|
32739
32720
|
onReset,
|
|
32721
|
+
decrementEvent,
|
|
32722
|
+
incrementEvent,
|
|
32723
|
+
resetEvent,
|
|
32740
32724
|
className
|
|
32741
32725
|
}) {
|
|
32742
32726
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
@@ -32770,6 +32754,7 @@ function CounterFull({
|
|
|
32770
32754
|
{
|
|
32771
32755
|
variant: "secondary",
|
|
32772
32756
|
size: sizeStyles8[size].button,
|
|
32757
|
+
action: decrementEvent,
|
|
32773
32758
|
onClick: onDecrement,
|
|
32774
32759
|
disabled: resolved.decrementDisabled,
|
|
32775
32760
|
icon: "minus",
|
|
@@ -32781,6 +32766,7 @@ function CounterFull({
|
|
|
32781
32766
|
{
|
|
32782
32767
|
variant: "primary",
|
|
32783
32768
|
size: sizeStyles8[size].button,
|
|
32769
|
+
action: incrementEvent,
|
|
32784
32770
|
onClick: onIncrement,
|
|
32785
32771
|
disabled: resolved.incrementDisabled,
|
|
32786
32772
|
icon: "plus",
|
|
@@ -32793,6 +32779,7 @@ function CounterFull({
|
|
|
32793
32779
|
{
|
|
32794
32780
|
variant: "ghost",
|
|
32795
32781
|
size: "sm",
|
|
32782
|
+
action: resetEvent,
|
|
32796
32783
|
onClick: onReset,
|
|
32797
32784
|
icon: "rotate-ccw",
|
|
32798
32785
|
children: "Reset to 0"
|
|
@@ -33642,8 +33629,8 @@ var init_Menu = __esm({
|
|
|
33642
33629
|
"bottom-end": "bottom-start"
|
|
33643
33630
|
};
|
|
33644
33631
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
33645
|
-
const triggerChild =
|
|
33646
|
-
const triggerElement =
|
|
33632
|
+
const triggerChild = React112__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
33633
|
+
const triggerElement = React112__default.cloneElement(
|
|
33647
33634
|
triggerChild,
|
|
33648
33635
|
{
|
|
33649
33636
|
ref: triggerRef,
|
|
@@ -33738,14 +33725,14 @@ function useDataDnd(args) {
|
|
|
33738
33725
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
33739
33726
|
const enabled = isZone || Boolean(dndRoot);
|
|
33740
33727
|
const eventBus = useEventBus();
|
|
33741
|
-
const parentRoot =
|
|
33728
|
+
const parentRoot = React112__default.useContext(RootCtx);
|
|
33742
33729
|
const isRoot = enabled && parentRoot === null;
|
|
33743
|
-
const zoneId =
|
|
33730
|
+
const zoneId = React112__default.useId();
|
|
33744
33731
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
33745
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
33746
|
-
const optimisticOrdersRef =
|
|
33732
|
+
const [optimisticOrders, setOptimisticOrders] = React112__default.useState(() => /* @__PURE__ */ new Map());
|
|
33733
|
+
const optimisticOrdersRef = React112__default.useRef(optimisticOrders);
|
|
33747
33734
|
optimisticOrdersRef.current = optimisticOrders;
|
|
33748
|
-
const clearOptimisticOrder =
|
|
33735
|
+
const clearOptimisticOrder = React112__default.useCallback((group) => {
|
|
33749
33736
|
setOptimisticOrders((prev) => {
|
|
33750
33737
|
if (!prev.has(group)) return prev;
|
|
33751
33738
|
const next = new Map(prev);
|
|
@@ -33770,7 +33757,7 @@ function useDataDnd(args) {
|
|
|
33770
33757
|
const raw = it[dndItemIdField];
|
|
33771
33758
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
33772
33759
|
}).join("|");
|
|
33773
|
-
const itemIds =
|
|
33760
|
+
const itemIds = React112__default.useMemo(
|
|
33774
33761
|
() => orderedItems.map((it, idx) => {
|
|
33775
33762
|
const raw = it[dndItemIdField];
|
|
33776
33763
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -33781,7 +33768,7 @@ function useDataDnd(args) {
|
|
|
33781
33768
|
const raw = it[dndItemIdField];
|
|
33782
33769
|
return raw != null ? String(raw) : `__${idx}`;
|
|
33783
33770
|
}).join("|");
|
|
33784
|
-
|
|
33771
|
+
React112__default.useEffect(() => {
|
|
33785
33772
|
const root = isRoot ? null : parentRoot;
|
|
33786
33773
|
if (root) {
|
|
33787
33774
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -33789,20 +33776,20 @@ function useDataDnd(args) {
|
|
|
33789
33776
|
clearOptimisticOrder(ownGroup);
|
|
33790
33777
|
}
|
|
33791
33778
|
}, [itemsContentSig, ownGroup]);
|
|
33792
|
-
const zonesRef =
|
|
33793
|
-
const registerZone =
|
|
33779
|
+
const zonesRef = React112__default.useRef(/* @__PURE__ */ new Map());
|
|
33780
|
+
const registerZone = React112__default.useCallback((zoneId2, meta2) => {
|
|
33794
33781
|
zonesRef.current.set(zoneId2, meta2);
|
|
33795
33782
|
}, []);
|
|
33796
|
-
const unregisterZone =
|
|
33783
|
+
const unregisterZone = React112__default.useCallback((zoneId2) => {
|
|
33797
33784
|
zonesRef.current.delete(zoneId2);
|
|
33798
33785
|
}, []);
|
|
33799
|
-
const [activeDrag, setActiveDrag] =
|
|
33800
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
33801
|
-
const meta =
|
|
33786
|
+
const [activeDrag, setActiveDrag] = React112__default.useState(null);
|
|
33787
|
+
const [overZoneGroup, setOverZoneGroup] = React112__default.useState(null);
|
|
33788
|
+
const meta = React112__default.useMemo(
|
|
33802
33789
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
33803
33790
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
33804
33791
|
);
|
|
33805
|
-
|
|
33792
|
+
React112__default.useEffect(() => {
|
|
33806
33793
|
const target = isRoot ? null : parentRoot;
|
|
33807
33794
|
if (!target) {
|
|
33808
33795
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -33821,7 +33808,7 @@ function useDataDnd(args) {
|
|
|
33821
33808
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
33822
33809
|
const sensors = useAlmadarDndSensors(true);
|
|
33823
33810
|
const collisionDetection = almadarDndCollisionDetection;
|
|
33824
|
-
const findZoneByItem =
|
|
33811
|
+
const findZoneByItem = React112__default.useCallback(
|
|
33825
33812
|
(id) => {
|
|
33826
33813
|
for (const z of zonesRef.current.values()) {
|
|
33827
33814
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -33830,7 +33817,7 @@ function useDataDnd(args) {
|
|
|
33830
33817
|
},
|
|
33831
33818
|
[]
|
|
33832
33819
|
);
|
|
33833
|
-
|
|
33820
|
+
React112__default.useCallback(
|
|
33834
33821
|
(group) => {
|
|
33835
33822
|
for (const z of zonesRef.current.values()) {
|
|
33836
33823
|
if (z.group === group) return z;
|
|
@@ -33839,7 +33826,7 @@ function useDataDnd(args) {
|
|
|
33839
33826
|
},
|
|
33840
33827
|
[]
|
|
33841
33828
|
);
|
|
33842
|
-
const handleDragEnd =
|
|
33829
|
+
const handleDragEnd = React112__default.useCallback(
|
|
33843
33830
|
(event) => {
|
|
33844
33831
|
const { active, over } = event;
|
|
33845
33832
|
const activeIdStr = String(active.id);
|
|
@@ -33930,8 +33917,8 @@ function useDataDnd(args) {
|
|
|
33930
33917
|
},
|
|
33931
33918
|
[eventBus]
|
|
33932
33919
|
);
|
|
33933
|
-
const sortableData =
|
|
33934
|
-
const SortableItem =
|
|
33920
|
+
const sortableData = React112__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
33921
|
+
const SortableItem = React112__default.useCallback(
|
|
33935
33922
|
({ id, children }) => {
|
|
33936
33923
|
const {
|
|
33937
33924
|
attributes,
|
|
@@ -33971,7 +33958,7 @@ function useDataDnd(args) {
|
|
|
33971
33958
|
id: droppableId,
|
|
33972
33959
|
data: sortableData
|
|
33973
33960
|
});
|
|
33974
|
-
const ctx =
|
|
33961
|
+
const ctx = React112__default.useContext(RootCtx);
|
|
33975
33962
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
33976
33963
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
33977
33964
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -33986,7 +33973,7 @@ function useDataDnd(args) {
|
|
|
33986
33973
|
showForeignPlaceholder,
|
|
33987
33974
|
ctxAvailable: ctx != null
|
|
33988
33975
|
});
|
|
33989
|
-
|
|
33976
|
+
React112__default.useEffect(() => {
|
|
33990
33977
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
33991
33978
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
33992
33979
|
return /* @__PURE__ */ jsx(
|
|
@@ -34000,11 +33987,11 @@ function useDataDnd(args) {
|
|
|
34000
33987
|
}
|
|
34001
33988
|
);
|
|
34002
33989
|
};
|
|
34003
|
-
const rootContextValue =
|
|
33990
|
+
const rootContextValue = React112__default.useMemo(
|
|
34004
33991
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
34005
33992
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
34006
33993
|
);
|
|
34007
|
-
const handleDragStart =
|
|
33994
|
+
const handleDragStart = React112__default.useCallback((event) => {
|
|
34008
33995
|
const sourceZone = findZoneByItem(event.active.id);
|
|
34009
33996
|
const rect = event.active.rect.current.initial;
|
|
34010
33997
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -34023,7 +34010,7 @@ function useDataDnd(args) {
|
|
|
34023
34010
|
isRoot
|
|
34024
34011
|
});
|
|
34025
34012
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
34026
|
-
const handleDragOver =
|
|
34013
|
+
const handleDragOver = React112__default.useCallback((event) => {
|
|
34027
34014
|
const { active, over } = event;
|
|
34028
34015
|
const overData = over?.data?.current;
|
|
34029
34016
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -34093,7 +34080,7 @@ function useDataDnd(args) {
|
|
|
34093
34080
|
return next;
|
|
34094
34081
|
});
|
|
34095
34082
|
}, []);
|
|
34096
|
-
const handleDragCancel =
|
|
34083
|
+
const handleDragCancel = React112__default.useCallback((event) => {
|
|
34097
34084
|
setActiveDrag(null);
|
|
34098
34085
|
setOverZoneGroup(null);
|
|
34099
34086
|
dndLog.warn("dragCancel", {
|
|
@@ -34101,12 +34088,12 @@ function useDataDnd(args) {
|
|
|
34101
34088
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
34102
34089
|
});
|
|
34103
34090
|
}, []);
|
|
34104
|
-
const handleDragEndWithCleanup =
|
|
34091
|
+
const handleDragEndWithCleanup = React112__default.useCallback((event) => {
|
|
34105
34092
|
handleDragEnd(event);
|
|
34106
34093
|
setActiveDrag(null);
|
|
34107
34094
|
setOverZoneGroup(null);
|
|
34108
34095
|
}, [handleDragEnd]);
|
|
34109
|
-
const wrapContainer =
|
|
34096
|
+
const wrapContainer = React112__default.useCallback(
|
|
34110
34097
|
(children) => {
|
|
34111
34098
|
if (!enabled) return children;
|
|
34112
34099
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -34160,7 +34147,7 @@ var init_useDataDnd = __esm({
|
|
|
34160
34147
|
init_useAlmadarDndCollision();
|
|
34161
34148
|
init_Box();
|
|
34162
34149
|
dndLog = createLogger("almadar:ui:dnd");
|
|
34163
|
-
RootCtx =
|
|
34150
|
+
RootCtx = React112__default.createContext(null);
|
|
34164
34151
|
}
|
|
34165
34152
|
});
|
|
34166
34153
|
function renderIconInput(icon, props) {
|
|
@@ -34686,7 +34673,7 @@ function DataList({
|
|
|
34686
34673
|
}) {
|
|
34687
34674
|
const eventBus = useEventBus();
|
|
34688
34675
|
const { t } = useTranslate();
|
|
34689
|
-
const [visibleCount, setVisibleCount] =
|
|
34676
|
+
const [visibleCount, setVisibleCount] = React112__default.useState(pageSize || Infinity);
|
|
34690
34677
|
const fieldDefs = fields ?? columns ?? [];
|
|
34691
34678
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
34692
34679
|
const dnd = useDataDnd({
|
|
@@ -34705,7 +34692,7 @@ function DataList({
|
|
|
34705
34692
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
34706
34693
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
34707
34694
|
const hasRenderProp = typeof children === "function";
|
|
34708
|
-
|
|
34695
|
+
React112__default.useEffect(() => {
|
|
34709
34696
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
34710
34697
|
const childrenTypeOf = typeof children;
|
|
34711
34698
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -34809,7 +34796,7 @@ function DataList({
|
|
|
34809
34796
|
const items2 = [...data];
|
|
34810
34797
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
34811
34798
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
34812
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
34799
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React112__default.Fragment, { children: [
|
|
34813
34800
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
34814
34801
|
group.items.map((itemData, index) => {
|
|
34815
34802
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -34950,7 +34937,7 @@ function DataList({
|
|
|
34950
34937
|
className
|
|
34951
34938
|
),
|
|
34952
34939
|
children: [
|
|
34953
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
34940
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React112__default.Fragment, { children: [
|
|
34954
34941
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
34955
34942
|
group.items.map(
|
|
34956
34943
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -35035,7 +35022,7 @@ var init_FormSection = __esm({
|
|
|
35035
35022
|
columns = 1,
|
|
35036
35023
|
className
|
|
35037
35024
|
}) => {
|
|
35038
|
-
const [collapsed, setCollapsed] =
|
|
35025
|
+
const [collapsed, setCollapsed] = React112__default.useState(defaultCollapsed);
|
|
35039
35026
|
const { t } = useTranslate();
|
|
35040
35027
|
const eventBus = useEventBus();
|
|
35041
35028
|
const gridClass = {
|
|
@@ -35043,7 +35030,7 @@ var init_FormSection = __esm({
|
|
|
35043
35030
|
2: "grid-cols-1 md:grid-cols-2",
|
|
35044
35031
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
35045
35032
|
}[columns];
|
|
35046
|
-
|
|
35033
|
+
React112__default.useCallback(() => {
|
|
35047
35034
|
if (collapsible) {
|
|
35048
35035
|
setCollapsed((prev) => !prev);
|
|
35049
35036
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -35993,7 +35980,7 @@ var init_Flex = __esm({
|
|
|
35993
35980
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
35994
35981
|
}
|
|
35995
35982
|
}
|
|
35996
|
-
return
|
|
35983
|
+
return React112__default.createElement(Component, {
|
|
35997
35984
|
className: cn(
|
|
35998
35985
|
inline ? "inline-flex" : "flex",
|
|
35999
35986
|
directionStyles[direction],
|
|
@@ -36112,7 +36099,7 @@ var init_Grid = __esm({
|
|
|
36112
36099
|
as: Component = "div"
|
|
36113
36100
|
}) => {
|
|
36114
36101
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
36115
|
-
return
|
|
36102
|
+
return React112__default.createElement(
|
|
36116
36103
|
Component,
|
|
36117
36104
|
{
|
|
36118
36105
|
className: cn(
|
|
@@ -36308,9 +36295,9 @@ var init_Popover = __esm({
|
|
|
36308
36295
|
onMouseLeave: handleClose,
|
|
36309
36296
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
36310
36297
|
};
|
|
36311
|
-
const childElement =
|
|
36298
|
+
const childElement = React112__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
36312
36299
|
const childPointerDown = childElement.props.onPointerDown;
|
|
36313
|
-
const triggerElement =
|
|
36300
|
+
const triggerElement = React112__default.cloneElement(
|
|
36314
36301
|
childElement,
|
|
36315
36302
|
{
|
|
36316
36303
|
ref: triggerRef,
|
|
@@ -36912,9 +36899,9 @@ var init_Tooltip = __esm({
|
|
|
36912
36899
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
36913
36900
|
};
|
|
36914
36901
|
}, []);
|
|
36915
|
-
const triggerElement =
|
|
36902
|
+
const triggerElement = React112__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
36916
36903
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
36917
|
-
const trigger =
|
|
36904
|
+
const trigger = React112__default.cloneElement(triggerElement, {
|
|
36918
36905
|
ref: triggerRef,
|
|
36919
36906
|
onMouseEnter: handleMouseEnter,
|
|
36920
36907
|
onMouseLeave: handleMouseLeave,
|
|
@@ -37004,7 +36991,7 @@ var init_WizardProgress = __esm({
|
|
|
37004
36991
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
37005
36992
|
const isActive = index === currentStep;
|
|
37006
36993
|
const isCompleted = index < currentStep;
|
|
37007
|
-
return /* @__PURE__ */ jsxs(
|
|
36994
|
+
return /* @__PURE__ */ jsxs(React112__default.Fragment, { children: [
|
|
37008
36995
|
/* @__PURE__ */ jsx(
|
|
37009
36996
|
"button",
|
|
37010
36997
|
{
|
|
@@ -38564,7 +38551,7 @@ var init_MapView = __esm({
|
|
|
38564
38551
|
shadowSize: [41, 41]
|
|
38565
38552
|
});
|
|
38566
38553
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
38567
|
-
const { useEffect: useEffect79, useRef: useRef79, useCallback: useCallback118, useState: useState115 } =
|
|
38554
|
+
const { useEffect: useEffect79, useRef: useRef79, useCallback: useCallback118, useState: useState115 } = React112__default;
|
|
38568
38555
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
38569
38556
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
38570
38557
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -39479,8 +39466,8 @@ function TableView({
|
|
|
39479
39466
|
}) {
|
|
39480
39467
|
const eventBus = useEventBus();
|
|
39481
39468
|
const { t } = useTranslate();
|
|
39482
|
-
const [visibleCount, setVisibleCount] =
|
|
39483
|
-
const [localSelected, setLocalSelected] =
|
|
39469
|
+
const [visibleCount, setVisibleCount] = React112__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
39470
|
+
const [localSelected, setLocalSelected] = React112__default.useState(/* @__PURE__ */ new Set());
|
|
39484
39471
|
const colDefs = columns ?? fields ?? [];
|
|
39485
39472
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
39486
39473
|
const dnd = useDataDnd({
|
|
@@ -39675,12 +39662,12 @@ function TableView({
|
|
|
39675
39662
|
]
|
|
39676
39663
|
}
|
|
39677
39664
|
);
|
|
39678
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
39665
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React112__default.Fragment, { children: rowInner }, id);
|
|
39679
39666
|
};
|
|
39680
39667
|
const items = Array.from(data);
|
|
39681
39668
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
39682
39669
|
let runningIndex = 0;
|
|
39683
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
39670
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React112__default.Fragment, { children: [
|
|
39684
39671
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
39685
39672
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
39686
39673
|
] }, gi)) });
|
|
@@ -41037,7 +41024,7 @@ var init_StepFlow = __esm({
|
|
|
41037
41024
|
className
|
|
41038
41025
|
}) => {
|
|
41039
41026
|
if (orientation === "vertical") {
|
|
41040
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
41027
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React112__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
41041
41028
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
41042
41029
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
41043
41030
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -41048,7 +41035,7 @@ var init_StepFlow = __esm({
|
|
|
41048
41035
|
] })
|
|
41049
41036
|
] }) }, index)) });
|
|
41050
41037
|
}
|
|
41051
|
-
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(
|
|
41038
|
+
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(React112__default.Fragment, { children: [
|
|
41052
41039
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
41053
41040
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
41054
41041
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -42033,7 +42020,7 @@ var init_LikertScale = __esm({
|
|
|
42033
42020
|
md: "text-base",
|
|
42034
42021
|
lg: "text-lg"
|
|
42035
42022
|
};
|
|
42036
|
-
LikertScale =
|
|
42023
|
+
LikertScale = React112__default.forwardRef(
|
|
42037
42024
|
({
|
|
42038
42025
|
question,
|
|
42039
42026
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -42045,7 +42032,7 @@ var init_LikertScale = __esm({
|
|
|
42045
42032
|
variant = "radios",
|
|
42046
42033
|
className
|
|
42047
42034
|
}, ref) => {
|
|
42048
|
-
const groupId =
|
|
42035
|
+
const groupId = React112__default.useId();
|
|
42049
42036
|
const eventBus = useEventBus();
|
|
42050
42037
|
const handleSelect = useCallback(
|
|
42051
42038
|
(next) => {
|
|
@@ -44327,7 +44314,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
44327
44314
|
"aria-label": t("aria.breadcrumb"),
|
|
44328
44315
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
44329
44316
|
const isLast = idx === items.length - 1;
|
|
44330
|
-
return /* @__PURE__ */ jsxs(
|
|
44317
|
+
return /* @__PURE__ */ jsxs(React112__default.Fragment, { children: [
|
|
44331
44318
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
44332
44319
|
Icon,
|
|
44333
44320
|
{
|
|
@@ -44991,7 +44978,7 @@ var init_PageHeader = __esm({
|
|
|
44991
44978
|
info: "bg-info/10 text-info"
|
|
44992
44979
|
};
|
|
44993
44980
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
44994
|
-
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(
|
|
44981
|
+
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(React112__default.Fragment, { children: [
|
|
44995
44982
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
44996
44983
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
44997
44984
|
"a",
|
|
@@ -45349,7 +45336,7 @@ var init_Section = __esm({
|
|
|
45349
45336
|
as: Component = "section"
|
|
45350
45337
|
}) => {
|
|
45351
45338
|
const hasHeader = title || description || action;
|
|
45352
|
-
return
|
|
45339
|
+
return React112__default.createElement(
|
|
45353
45340
|
Component,
|
|
45354
45341
|
{
|
|
45355
45342
|
className: cn(
|
|
@@ -45651,6 +45638,7 @@ var init_WizardContainer = __esm({
|
|
|
45651
45638
|
init_Stack();
|
|
45652
45639
|
init_Icon();
|
|
45653
45640
|
init_cn();
|
|
45641
|
+
init_useEventBus();
|
|
45654
45642
|
WizardContainer = ({
|
|
45655
45643
|
steps,
|
|
45656
45644
|
currentStep: controlledStep,
|
|
@@ -45659,9 +45647,13 @@ var init_WizardContainer = __esm({
|
|
|
45659
45647
|
showProgress = true,
|
|
45660
45648
|
allowBack = true,
|
|
45661
45649
|
compact = false,
|
|
45662
|
-
className
|
|
45650
|
+
className,
|
|
45651
|
+
nextEvent,
|
|
45652
|
+
backEvent,
|
|
45653
|
+
completeEvent
|
|
45663
45654
|
}) => {
|
|
45664
45655
|
const { t } = useTranslate();
|
|
45656
|
+
const eventBus = useEventBus();
|
|
45665
45657
|
const [internalStep, setInternalStep] = useState(0);
|
|
45666
45658
|
const normalizedControlledStep = (() => {
|
|
45667
45659
|
if (controlledStep === void 0 || controlledStep === null)
|
|
@@ -45691,13 +45683,16 @@ var init_WizardContainer = __esm({
|
|
|
45691
45683
|
return;
|
|
45692
45684
|
}
|
|
45693
45685
|
if (isLastStep) {
|
|
45686
|
+
if (completeEvent) eventBus.emit(`UI:${completeEvent}`, { step: currentStep });
|
|
45694
45687
|
onComplete?.();
|
|
45695
45688
|
} else {
|
|
45689
|
+
if (nextEvent) eventBus.emit(`UI:${nextEvent}`, { step: currentStep + 1 });
|
|
45696
45690
|
goToStep(currentStep + 1);
|
|
45697
45691
|
}
|
|
45698
45692
|
};
|
|
45699
45693
|
const handleBack = () => {
|
|
45700
45694
|
if (!isFirstStep && allowBack) {
|
|
45695
|
+
if (backEvent) eventBus.emit(`UI:${backEvent}`, { step: currentStep - 1 });
|
|
45701
45696
|
goToStep(currentStep - 1);
|
|
45702
45697
|
}
|
|
45703
45698
|
};
|
|
@@ -45715,7 +45710,7 @@ var init_WizardContainer = __esm({
|
|
|
45715
45710
|
const isCompleted = index < currentStep;
|
|
45716
45711
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
45717
45712
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
45718
|
-
return /* @__PURE__ */ jsxs(
|
|
45713
|
+
return /* @__PURE__ */ jsxs(React112__default.Fragment, { children: [
|
|
45719
45714
|
/* @__PURE__ */ jsx(
|
|
45720
45715
|
Button,
|
|
45721
45716
|
{
|
|
@@ -48148,7 +48143,7 @@ var init_DetailPanel = __esm({
|
|
|
48148
48143
|
}
|
|
48149
48144
|
});
|
|
48150
48145
|
function extractTitle(children) {
|
|
48151
|
-
if (!
|
|
48146
|
+
if (!React112__default.isValidElement(children)) return void 0;
|
|
48152
48147
|
const props = children.props;
|
|
48153
48148
|
if (typeof props.title === "string") {
|
|
48154
48149
|
return props.title;
|
|
@@ -48166,14 +48161,18 @@ var init_DrawerSlot = __esm({
|
|
|
48166
48161
|
title: overrideTitle,
|
|
48167
48162
|
position = "right",
|
|
48168
48163
|
size = "md",
|
|
48169
|
-
className
|
|
48164
|
+
className,
|
|
48165
|
+
sourceTrait
|
|
48170
48166
|
}) => {
|
|
48171
48167
|
const eventBus = useEventBus();
|
|
48168
|
+
const schemaCtx = useEntitySchemaOptional();
|
|
48172
48169
|
const isOpen = Boolean(children);
|
|
48173
48170
|
const title = overrideTitle || extractTitle(children);
|
|
48174
48171
|
const handleClose = () => {
|
|
48175
|
-
|
|
48176
|
-
|
|
48172
|
+
const orbital = sourceTrait !== void 0 && schemaCtx !== null ? schemaCtx.orbitalsByTrait.get(sourceTrait) : void 0;
|
|
48173
|
+
const prefix = orbital !== void 0 && sourceTrait !== void 0 ? `UI:${orbital}.${sourceTrait}.` : "UI:";
|
|
48174
|
+
eventBus.emit(`${prefix}CLOSE`);
|
|
48175
|
+
eventBus.emit(`${prefix}CANCEL`);
|
|
48177
48176
|
};
|
|
48178
48177
|
if (!isOpen) return null;
|
|
48179
48178
|
return /* @__PURE__ */ jsx(
|
|
@@ -48494,12 +48493,12 @@ var init_Form = __esm({
|
|
|
48494
48493
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
48495
48494
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
48496
48495
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
48497
|
-
const normalizedInitialData =
|
|
48496
|
+
const normalizedInitialData = React112__default.useMemo(() => {
|
|
48498
48497
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
48499
48498
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
48500
48499
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
48501
48500
|
}, [entity, initialData]);
|
|
48502
|
-
const entityDerivedFields =
|
|
48501
|
+
const entityDerivedFields = React112__default.useMemo(() => {
|
|
48503
48502
|
if (fields && fields.length > 0) return void 0;
|
|
48504
48503
|
if (!resolvedEntity) return void 0;
|
|
48505
48504
|
return resolvedEntity.fields.map(
|
|
@@ -48520,16 +48519,16 @@ var init_Form = __esm({
|
|
|
48520
48519
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
48521
48520
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
48522
48521
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
48523
|
-
const [formData, setFormData] =
|
|
48522
|
+
const [formData, setFormData] = React112__default.useState(
|
|
48524
48523
|
normalizedInitialData
|
|
48525
48524
|
);
|
|
48526
|
-
const [collapsedSections, setCollapsedSections] =
|
|
48525
|
+
const [collapsedSections, setCollapsedSections] = React112__default.useState(
|
|
48527
48526
|
/* @__PURE__ */ new Set()
|
|
48528
48527
|
);
|
|
48529
|
-
const [submitError, setSubmitError] =
|
|
48530
|
-
const formRef =
|
|
48528
|
+
const [submitError, setSubmitError] = React112__default.useState(null);
|
|
48529
|
+
const formRef = React112__default.useRef(null);
|
|
48531
48530
|
const formMode = props.mode;
|
|
48532
|
-
const mountedRef =
|
|
48531
|
+
const mountedRef = React112__default.useRef(false);
|
|
48533
48532
|
if (!mountedRef.current) {
|
|
48534
48533
|
mountedRef.current = true;
|
|
48535
48534
|
debug("forms", "mount", {
|
|
@@ -48542,7 +48541,7 @@ var init_Form = __esm({
|
|
|
48542
48541
|
});
|
|
48543
48542
|
}
|
|
48544
48543
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
48545
|
-
const evalContext =
|
|
48544
|
+
const evalContext = React112__default.useMemo(
|
|
48546
48545
|
() => ({
|
|
48547
48546
|
formValues: formData,
|
|
48548
48547
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -48551,7 +48550,7 @@ var init_Form = __esm({
|
|
|
48551
48550
|
}),
|
|
48552
48551
|
[formData, externalContext]
|
|
48553
48552
|
);
|
|
48554
|
-
|
|
48553
|
+
React112__default.useEffect(() => {
|
|
48555
48554
|
debug("forms", "initialData-sync", {
|
|
48556
48555
|
mode: formMode,
|
|
48557
48556
|
normalizedInitialData,
|
|
@@ -48562,7 +48561,7 @@ var init_Form = __esm({
|
|
|
48562
48561
|
setFormData(normalizedInitialData);
|
|
48563
48562
|
}
|
|
48564
48563
|
}, [normalizedInitialData]);
|
|
48565
|
-
const processCalculations =
|
|
48564
|
+
const processCalculations = React112__default.useCallback(
|
|
48566
48565
|
(changedFieldId, newFormData) => {
|
|
48567
48566
|
if (!hiddenCalculations.length) return;
|
|
48568
48567
|
const context = {
|
|
@@ -48587,7 +48586,7 @@ var init_Form = __esm({
|
|
|
48587
48586
|
},
|
|
48588
48587
|
[hiddenCalculations, externalContext, eventBus]
|
|
48589
48588
|
);
|
|
48590
|
-
const checkViolations =
|
|
48589
|
+
const checkViolations = React112__default.useCallback(
|
|
48591
48590
|
(changedFieldId, newFormData) => {
|
|
48592
48591
|
if (!violationTriggers.length) return;
|
|
48593
48592
|
const context = {
|
|
@@ -48625,7 +48624,7 @@ var init_Form = __esm({
|
|
|
48625
48624
|
processCalculations(name, newFormData);
|
|
48626
48625
|
checkViolations(name, newFormData);
|
|
48627
48626
|
};
|
|
48628
|
-
const isFieldVisible =
|
|
48627
|
+
const isFieldVisible = React112__default.useCallback(
|
|
48629
48628
|
(fieldName) => {
|
|
48630
48629
|
const condition = conditionalFields[fieldName];
|
|
48631
48630
|
if (!condition) return true;
|
|
@@ -48633,7 +48632,7 @@ var init_Form = __esm({
|
|
|
48633
48632
|
},
|
|
48634
48633
|
[conditionalFields, evalContext]
|
|
48635
48634
|
);
|
|
48636
|
-
const isSectionVisible =
|
|
48635
|
+
const isSectionVisible = React112__default.useCallback(
|
|
48637
48636
|
(section) => {
|
|
48638
48637
|
if (!section.condition) return true;
|
|
48639
48638
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -48709,7 +48708,7 @@ var init_Form = __esm({
|
|
|
48709
48708
|
eventBus.emit(`UI:${onCancel}`);
|
|
48710
48709
|
}
|
|
48711
48710
|
};
|
|
48712
|
-
const renderField =
|
|
48711
|
+
const renderField = React112__default.useCallback(
|
|
48713
48712
|
(field) => {
|
|
48714
48713
|
const fieldName = field.name || field.field;
|
|
48715
48714
|
if (!fieldName) return null;
|
|
@@ -48730,7 +48729,7 @@ var init_Form = __esm({
|
|
|
48730
48729
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
48731
48730
|
);
|
|
48732
48731
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
48733
|
-
const normalizedFields =
|
|
48732
|
+
const normalizedFields = React112__default.useMemo(() => {
|
|
48734
48733
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
48735
48734
|
return effectiveFields.map((field) => {
|
|
48736
48735
|
if (typeof field === "string") {
|
|
@@ -48754,7 +48753,7 @@ var init_Form = __esm({
|
|
|
48754
48753
|
return field;
|
|
48755
48754
|
});
|
|
48756
48755
|
}, [effectiveFields, resolvedEntity]);
|
|
48757
|
-
const schemaFields =
|
|
48756
|
+
const schemaFields = React112__default.useMemo(() => {
|
|
48758
48757
|
if (normalizedFields.length === 0) return null;
|
|
48759
48758
|
if (isDebugEnabled()) {
|
|
48760
48759
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -48764,7 +48763,7 @@ var init_Form = __esm({
|
|
|
48764
48763
|
}
|
|
48765
48764
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
48766
48765
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
48767
|
-
const sectionElements =
|
|
48766
|
+
const sectionElements = React112__default.useMemo(() => {
|
|
48768
48767
|
if (!sections || sections.length === 0) return null;
|
|
48769
48768
|
return sections.map((section) => {
|
|
48770
48769
|
if (!isSectionVisible(section)) {
|
|
@@ -49489,7 +49488,7 @@ var init_List = __esm({
|
|
|
49489
49488
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
49490
49489
|
return [];
|
|
49491
49490
|
}, [entity]);
|
|
49492
|
-
const getItemActions =
|
|
49491
|
+
const getItemActions = React112__default.useCallback(
|
|
49493
49492
|
(item) => {
|
|
49494
49493
|
if (!itemActions) return [];
|
|
49495
49494
|
if (typeof itemActions === "function") {
|
|
@@ -49964,7 +49963,7 @@ var init_MediaGallery = __esm({
|
|
|
49964
49963
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
49965
49964
|
);
|
|
49966
49965
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
49967
|
-
const items =
|
|
49966
|
+
const items = React112__default.useMemo(() => {
|
|
49968
49967
|
if (propItems) return propItems;
|
|
49969
49968
|
if (entityData.length === 0) return [];
|
|
49970
49969
|
return entityData.map((record, idx) => {
|
|
@@ -50127,7 +50126,7 @@ var init_MediaGallery = __esm({
|
|
|
50127
50126
|
}
|
|
50128
50127
|
});
|
|
50129
50128
|
function extractTitle2(children) {
|
|
50130
|
-
if (!
|
|
50129
|
+
if (!React112__default.isValidElement(children)) return void 0;
|
|
50131
50130
|
const props = children.props;
|
|
50132
50131
|
if (typeof props.title === "string") {
|
|
50133
50132
|
return props.title;
|
|
@@ -50144,14 +50143,18 @@ var init_ModalSlot = __esm({
|
|
|
50144
50143
|
children,
|
|
50145
50144
|
title: overrideTitle,
|
|
50146
50145
|
size = "md",
|
|
50147
|
-
className
|
|
50146
|
+
className,
|
|
50147
|
+
sourceTrait
|
|
50148
50148
|
}) => {
|
|
50149
50149
|
const eventBus = useEventBus();
|
|
50150
|
+
const schemaCtx = useEntitySchemaOptional();
|
|
50150
50151
|
const isOpen = Boolean(children);
|
|
50151
50152
|
const title = overrideTitle || extractTitle2(children);
|
|
50152
50153
|
const handleClose = () => {
|
|
50153
|
-
|
|
50154
|
-
|
|
50154
|
+
const orbital = sourceTrait !== void 0 && schemaCtx !== null ? schemaCtx.orbitalsByTrait.get(sourceTrait) : void 0;
|
|
50155
|
+
const prefix = orbital !== void 0 && sourceTrait !== void 0 ? `UI:${orbital}.${sourceTrait}.` : "UI:";
|
|
50156
|
+
eventBus.emit(`${prefix}CLOSE`);
|
|
50157
|
+
eventBus.emit(`${prefix}CANCEL`);
|
|
50155
50158
|
};
|
|
50156
50159
|
if (!isOpen) return null;
|
|
50157
50160
|
return /* @__PURE__ */ jsx(
|
|
@@ -50397,7 +50400,7 @@ var init_debugRegistry = __esm({
|
|
|
50397
50400
|
}
|
|
50398
50401
|
});
|
|
50399
50402
|
function useDebugData() {
|
|
50400
|
-
const [data, setData] =
|
|
50403
|
+
const [data, setData] = React112.useState(() => ({
|
|
50401
50404
|
traits: [],
|
|
50402
50405
|
ticks: [],
|
|
50403
50406
|
guards: [],
|
|
@@ -50411,7 +50414,7 @@ function useDebugData() {
|
|
|
50411
50414
|
},
|
|
50412
50415
|
lastUpdate: Date.now()
|
|
50413
50416
|
}));
|
|
50414
|
-
|
|
50417
|
+
React112.useEffect(() => {
|
|
50415
50418
|
const updateData = () => {
|
|
50416
50419
|
setData({
|
|
50417
50420
|
traits: getAllTraits(),
|
|
@@ -50520,12 +50523,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
50520
50523
|
return positions;
|
|
50521
50524
|
}
|
|
50522
50525
|
function WalkMinimap() {
|
|
50523
|
-
const [walkStep, setWalkStep] =
|
|
50524
|
-
const [traits2, setTraits] =
|
|
50525
|
-
const [coveredEdges, setCoveredEdges] =
|
|
50526
|
-
const [completedTraits, setCompletedTraits] =
|
|
50527
|
-
const prevTraitRef =
|
|
50528
|
-
|
|
50526
|
+
const [walkStep, setWalkStep] = React112.useState(null);
|
|
50527
|
+
const [traits2, setTraits] = React112.useState([]);
|
|
50528
|
+
const [coveredEdges, setCoveredEdges] = React112.useState([]);
|
|
50529
|
+
const [completedTraits, setCompletedTraits] = React112.useState(/* @__PURE__ */ new Set());
|
|
50530
|
+
const prevTraitRef = React112.useRef(null);
|
|
50531
|
+
React112.useEffect(() => {
|
|
50529
50532
|
const interval = setInterval(() => {
|
|
50530
50533
|
const w = window;
|
|
50531
50534
|
const step = w.__orbitalWalkStep;
|
|
@@ -50961,15 +50964,15 @@ var init_EntitiesTab = __esm({
|
|
|
50961
50964
|
});
|
|
50962
50965
|
function EventFlowTab({ events: events2 }) {
|
|
50963
50966
|
const { t } = useTranslate();
|
|
50964
|
-
const [filter, setFilter] =
|
|
50965
|
-
const containerRef =
|
|
50966
|
-
const [autoScroll, setAutoScroll] =
|
|
50967
|
-
|
|
50967
|
+
const [filter, setFilter] = React112.useState("all");
|
|
50968
|
+
const containerRef = React112.useRef(null);
|
|
50969
|
+
const [autoScroll, setAutoScroll] = React112.useState(true);
|
|
50970
|
+
React112.useEffect(() => {
|
|
50968
50971
|
if (autoScroll && containerRef.current) {
|
|
50969
50972
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
50970
50973
|
}
|
|
50971
50974
|
}, [events2.length, autoScroll]);
|
|
50972
|
-
const filteredEvents =
|
|
50975
|
+
const filteredEvents = React112.useMemo(() => {
|
|
50973
50976
|
if (filter === "all") return events2;
|
|
50974
50977
|
return events2.filter((e) => e.type === filter);
|
|
50975
50978
|
}, [events2, filter]);
|
|
@@ -51085,7 +51088,7 @@ var init_EventFlowTab = __esm({
|
|
|
51085
51088
|
});
|
|
51086
51089
|
function GuardsPanel({ guards }) {
|
|
51087
51090
|
const { t } = useTranslate();
|
|
51088
|
-
const [filter, setFilter] =
|
|
51091
|
+
const [filter, setFilter] = React112.useState("all");
|
|
51089
51092
|
if (guards.length === 0) {
|
|
51090
51093
|
return /* @__PURE__ */ jsx(
|
|
51091
51094
|
EmptyState,
|
|
@@ -51098,7 +51101,7 @@ function GuardsPanel({ guards }) {
|
|
|
51098
51101
|
}
|
|
51099
51102
|
const passedCount = guards.filter((g) => g.result).length;
|
|
51100
51103
|
const failedCount = guards.length - passedCount;
|
|
51101
|
-
const filteredGuards =
|
|
51104
|
+
const filteredGuards = React112.useMemo(() => {
|
|
51102
51105
|
if (filter === "all") return guards;
|
|
51103
51106
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
51104
51107
|
return guards.filter((g) => !g.result);
|
|
@@ -51261,10 +51264,10 @@ function EffectBadge({ effect }) {
|
|
|
51261
51264
|
}
|
|
51262
51265
|
function TransitionTimeline({ transitions }) {
|
|
51263
51266
|
const { t } = useTranslate();
|
|
51264
|
-
const containerRef =
|
|
51265
|
-
const [autoScroll, setAutoScroll] =
|
|
51266
|
-
const [expandedId, setExpandedId] =
|
|
51267
|
-
|
|
51267
|
+
const containerRef = React112.useRef(null);
|
|
51268
|
+
const [autoScroll, setAutoScroll] = React112.useState(true);
|
|
51269
|
+
const [expandedId, setExpandedId] = React112.useState(null);
|
|
51270
|
+
React112.useEffect(() => {
|
|
51268
51271
|
if (autoScroll && containerRef.current) {
|
|
51269
51272
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
51270
51273
|
}
|
|
@@ -51544,9 +51547,9 @@ function getAllEvents(traits2) {
|
|
|
51544
51547
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
51545
51548
|
const eventBus = useEventBus();
|
|
51546
51549
|
const { t } = useTranslate();
|
|
51547
|
-
const [log11, setLog] =
|
|
51548
|
-
const prevStatesRef =
|
|
51549
|
-
|
|
51550
|
+
const [log11, setLog] = React112.useState([]);
|
|
51551
|
+
const prevStatesRef = React112.useRef(/* @__PURE__ */ new Map());
|
|
51552
|
+
React112.useEffect(() => {
|
|
51550
51553
|
for (const trait of traits2) {
|
|
51551
51554
|
const prev = prevStatesRef.current.get(trait.id);
|
|
51552
51555
|
if (prev && prev !== trait.currentState) {
|
|
@@ -51715,10 +51718,10 @@ function VerifyModePanel({
|
|
|
51715
51718
|
localCount
|
|
51716
51719
|
}) {
|
|
51717
51720
|
const { t } = useTranslate();
|
|
51718
|
-
const [expanded, setExpanded] =
|
|
51719
|
-
const scrollRef =
|
|
51720
|
-
const prevCountRef =
|
|
51721
|
-
|
|
51721
|
+
const [expanded, setExpanded] = React112.useState(true);
|
|
51722
|
+
const scrollRef = React112.useRef(null);
|
|
51723
|
+
const prevCountRef = React112.useRef(0);
|
|
51724
|
+
React112.useEffect(() => {
|
|
51722
51725
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
51723
51726
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
51724
51727
|
}
|
|
@@ -51775,10 +51778,10 @@ function RuntimeDebugger({
|
|
|
51775
51778
|
schema
|
|
51776
51779
|
}) {
|
|
51777
51780
|
const { t } = useTranslate();
|
|
51778
|
-
const [isCollapsed, setIsCollapsed] =
|
|
51779
|
-
const [isVisible, setIsVisible] =
|
|
51781
|
+
const [isCollapsed, setIsCollapsed] = React112.useState(mode === "verify" ? true : defaultCollapsed);
|
|
51782
|
+
const [isVisible, setIsVisible] = React112.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
51780
51783
|
const debugData = useDebugData();
|
|
51781
|
-
|
|
51784
|
+
React112.useEffect(() => {
|
|
51782
51785
|
if (mode === "inline") return;
|
|
51783
51786
|
return onDebugToggle((enabled) => {
|
|
51784
51787
|
setIsVisible(enabled);
|
|
@@ -51787,7 +51790,7 @@ function RuntimeDebugger({
|
|
|
51787
51790
|
}
|
|
51788
51791
|
});
|
|
51789
51792
|
}, [mode]);
|
|
51790
|
-
|
|
51793
|
+
React112.useEffect(() => {
|
|
51791
51794
|
if (mode === "inline") return;
|
|
51792
51795
|
const handleKeyDown = (e) => {
|
|
51793
51796
|
if (e.key === "`" && isVisible) {
|
|
@@ -52307,7 +52310,7 @@ var init_StatCard = __esm({
|
|
|
52307
52310
|
const labelToUse = propLabel ?? propTitle;
|
|
52308
52311
|
const eventBus = useEventBus();
|
|
52309
52312
|
const { t } = useTranslate();
|
|
52310
|
-
const handleActionClick =
|
|
52313
|
+
const handleActionClick = React112__default.useCallback(() => {
|
|
52311
52314
|
if (action?.event) {
|
|
52312
52315
|
eventBus.emit(`UI:${action.event}`, {});
|
|
52313
52316
|
}
|
|
@@ -52318,7 +52321,7 @@ var init_StatCard = __esm({
|
|
|
52318
52321
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
52319
52322
|
const isLoading = externalLoading ?? false;
|
|
52320
52323
|
const error = externalError;
|
|
52321
|
-
const computeMetricValue =
|
|
52324
|
+
const computeMetricValue = React112__default.useCallback(
|
|
52322
52325
|
(metric, items) => {
|
|
52323
52326
|
if (metric.value !== void 0) {
|
|
52324
52327
|
return metric.value;
|
|
@@ -52357,7 +52360,7 @@ var init_StatCard = __esm({
|
|
|
52357
52360
|
},
|
|
52358
52361
|
[]
|
|
52359
52362
|
);
|
|
52360
|
-
const schemaStats =
|
|
52363
|
+
const schemaStats = React112__default.useMemo(() => {
|
|
52361
52364
|
if (!metrics || metrics.length === 0) return null;
|
|
52362
52365
|
return metrics.map((metric) => ({
|
|
52363
52366
|
label: metric.label,
|
|
@@ -52365,7 +52368,7 @@ var init_StatCard = __esm({
|
|
|
52365
52368
|
format: metric.format
|
|
52366
52369
|
}));
|
|
52367
52370
|
}, [metrics, data, computeMetricValue]);
|
|
52368
|
-
const calculatedTrend =
|
|
52371
|
+
const calculatedTrend = React112__default.useMemo(() => {
|
|
52369
52372
|
if (manualTrend !== void 0) return manualTrend;
|
|
52370
52373
|
if (previousValue === void 0 || currentValue === void 0)
|
|
52371
52374
|
return void 0;
|
|
@@ -53005,8 +53008,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
53005
53008
|
] });
|
|
53006
53009
|
};
|
|
53007
53010
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
53008
|
-
const endRef =
|
|
53009
|
-
|
|
53011
|
+
const endRef = React112__default.useRef(null);
|
|
53012
|
+
React112__default.useEffect(() => {
|
|
53010
53013
|
if (!autoScroll) return;
|
|
53011
53014
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
53012
53015
|
}, [activities.length, autoScroll]);
|
|
@@ -53100,7 +53103,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
53100
53103
|
};
|
|
53101
53104
|
SubagentRichCard = ({ subagent }) => {
|
|
53102
53105
|
const { t } = useTranslate();
|
|
53103
|
-
const activities =
|
|
53106
|
+
const activities = React112__default.useMemo(
|
|
53104
53107
|
() => subagentMessagesToActivities(subagent.messages),
|
|
53105
53108
|
[subagent.messages]
|
|
53106
53109
|
);
|
|
@@ -53177,8 +53180,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
53177
53180
|
] });
|
|
53178
53181
|
};
|
|
53179
53182
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
53180
|
-
const endRef =
|
|
53181
|
-
|
|
53183
|
+
const endRef = React112__default.useRef(null);
|
|
53184
|
+
React112__default.useEffect(() => {
|
|
53182
53185
|
if (!autoScroll) return;
|
|
53183
53186
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
53184
53187
|
}, [messages.length, autoScroll]);
|
|
@@ -53608,7 +53611,7 @@ var init_Timeline = __esm({
|
|
|
53608
53611
|
}) => {
|
|
53609
53612
|
const { t } = useTranslate();
|
|
53610
53613
|
const entityData = entity ?? [];
|
|
53611
|
-
const items =
|
|
53614
|
+
const items = React112__default.useMemo(() => {
|
|
53612
53615
|
if (propItems) return propItems;
|
|
53613
53616
|
if (entityData.length === 0) return [];
|
|
53614
53617
|
return entityData.map((record, idx) => {
|
|
@@ -53710,7 +53713,7 @@ var init_Timeline = __esm({
|
|
|
53710
53713
|
}
|
|
53711
53714
|
});
|
|
53712
53715
|
function extractToastProps(children) {
|
|
53713
|
-
if (!
|
|
53716
|
+
if (!React112__default.isValidElement(children)) {
|
|
53714
53717
|
if (typeof children === "string") {
|
|
53715
53718
|
return { message: children };
|
|
53716
53719
|
}
|
|
@@ -53735,20 +53738,24 @@ var init_ToastSlot = __esm({
|
|
|
53735
53738
|
variant: overrideVariant,
|
|
53736
53739
|
title: overrideTitle,
|
|
53737
53740
|
duration = 5e3,
|
|
53738
|
-
className
|
|
53741
|
+
className,
|
|
53742
|
+
sourceTrait
|
|
53739
53743
|
}) => {
|
|
53740
53744
|
const eventBus = useEventBus();
|
|
53745
|
+
const schemaCtx = useEntitySchemaOptional();
|
|
53741
53746
|
const isVisible = Boolean(children);
|
|
53742
53747
|
const extracted = extractToastProps(children);
|
|
53743
53748
|
const variant = overrideVariant || extracted.variant || "info";
|
|
53744
53749
|
const title = overrideTitle || extracted.title;
|
|
53745
53750
|
const message = extracted.message || (typeof children === "string" ? children : "");
|
|
53746
53751
|
const handleDismiss = () => {
|
|
53747
|
-
|
|
53748
|
-
|
|
53752
|
+
const orbital = sourceTrait !== void 0 && schemaCtx !== null ? schemaCtx.orbitalsByTrait.get(sourceTrait) : void 0;
|
|
53753
|
+
const prefix = orbital !== void 0 && sourceTrait !== void 0 ? `UI:${orbital}.${sourceTrait}.` : "UI:";
|
|
53754
|
+
eventBus.emit(`${prefix}DISMISS`);
|
|
53755
|
+
eventBus.emit(`${prefix}CLOSE`);
|
|
53749
53756
|
};
|
|
53750
53757
|
if (!isVisible) return null;
|
|
53751
|
-
const isCustomContent =
|
|
53758
|
+
const isCustomContent = React112__default.isValidElement(children) && !message;
|
|
53752
53759
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
53753
53760
|
Toast,
|
|
53754
53761
|
{
|
|
@@ -53765,7 +53772,7 @@ var init_ToastSlot = __esm({
|
|
|
53765
53772
|
}
|
|
53766
53773
|
});
|
|
53767
53774
|
function lazyThree(name, loader) {
|
|
53768
|
-
const Lazy =
|
|
53775
|
+
const Lazy = React112__default.lazy(
|
|
53769
53776
|
() => loader().then((m) => {
|
|
53770
53777
|
const Resolved = m[name];
|
|
53771
53778
|
if (!Resolved) {
|
|
@@ -53777,13 +53784,13 @@ function lazyThree(name, loader) {
|
|
|
53777
53784
|
})
|
|
53778
53785
|
);
|
|
53779
53786
|
function ThreeWrapper(props) {
|
|
53780
|
-
return
|
|
53787
|
+
return React112__default.createElement(
|
|
53781
53788
|
ThreeBoundary,
|
|
53782
53789
|
{ name },
|
|
53783
|
-
|
|
53784
|
-
|
|
53790
|
+
React112__default.createElement(
|
|
53791
|
+
React112__default.Suspense,
|
|
53785
53792
|
{ fallback: null },
|
|
53786
|
-
|
|
53793
|
+
React112__default.createElement(Lazy, props)
|
|
53787
53794
|
)
|
|
53788
53795
|
);
|
|
53789
53796
|
}
|
|
@@ -54095,7 +54102,7 @@ var init_component_registry_generated = __esm({
|
|
|
54095
54102
|
init_WizardProgress();
|
|
54096
54103
|
init_WorldMapBoard();
|
|
54097
54104
|
init_WorldMapTemplate();
|
|
54098
|
-
ThreeBoundary = class extends
|
|
54105
|
+
ThreeBoundary = class extends React112__default.Component {
|
|
54099
54106
|
constructor() {
|
|
54100
54107
|
super(...arguments);
|
|
54101
54108
|
__publicField(this, "state", { failed: false });
|
|
@@ -54105,7 +54112,7 @@ var init_component_registry_generated = __esm({
|
|
|
54105
54112
|
}
|
|
54106
54113
|
render() {
|
|
54107
54114
|
if (this.state.failed) {
|
|
54108
|
-
return
|
|
54115
|
+
return React112__default.createElement(
|
|
54109
54116
|
"div",
|
|
54110
54117
|
{
|
|
54111
54118
|
"data-testid": "three-unavailable",
|
|
@@ -54461,7 +54468,7 @@ function SuspenseConfigProvider({
|
|
|
54461
54468
|
config,
|
|
54462
54469
|
children
|
|
54463
54470
|
}) {
|
|
54464
|
-
return
|
|
54471
|
+
return React112__default.createElement(
|
|
54465
54472
|
SuspenseConfigContext.Provider,
|
|
54466
54473
|
{ value: config },
|
|
54467
54474
|
children
|
|
@@ -54472,8 +54479,8 @@ function getSlotFallback(slot, config) {
|
|
|
54472
54479
|
const variant = SLOT_SKELETON_MAP[slot] ?? "text";
|
|
54473
54480
|
return /* @__PURE__ */ jsx(Skeleton, { variant });
|
|
54474
54481
|
}
|
|
54475
|
-
function
|
|
54476
|
-
const mapping = getComponentForPattern(patternType);
|
|
54482
|
+
function getComponentForPattern(patternType) {
|
|
54483
|
+
const mapping = getComponentForPattern$1(patternType);
|
|
54477
54484
|
if (!mapping) {
|
|
54478
54485
|
return null;
|
|
54479
54486
|
}
|
|
@@ -54503,7 +54510,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
54503
54510
|
}
|
|
54504
54511
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
54505
54512
|
}
|
|
54506
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
54513
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React112__default.isValidElement(field) && !(field instanceof Date)) {
|
|
54507
54514
|
const obj = field;
|
|
54508
54515
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
54509
54516
|
if (!fieldName) return field;
|
|
@@ -54681,6 +54688,7 @@ function UISlotComponent({
|
|
|
54681
54688
|
const { t } = useTranslate();
|
|
54682
54689
|
const suspenseConfig = useContext(SuspenseConfigContext);
|
|
54683
54690
|
const contained = useContext(SlotContainedContext);
|
|
54691
|
+
const schemaCtx = useEntitySchemaOptional();
|
|
54684
54692
|
const content = slots[slot];
|
|
54685
54693
|
if (children !== void 0) {
|
|
54686
54694
|
if (pattern === "clear") {
|
|
@@ -54726,8 +54734,11 @@ function UISlotComponent({
|
|
|
54726
54734
|
}
|
|
54727
54735
|
const handleDismiss = () => {
|
|
54728
54736
|
if (slot === "modal" || slot === "drawer") {
|
|
54729
|
-
|
|
54730
|
-
|
|
54737
|
+
const trait = content?.sourceTrait;
|
|
54738
|
+
const orbital = trait !== void 0 && schemaCtx !== null ? schemaCtx.orbitalsByTrait.get(trait) : void 0;
|
|
54739
|
+
const prefix = orbital !== void 0 && trait !== void 0 ? `UI:${orbital}.${trait}.` : "UI:";
|
|
54740
|
+
eventBus.emit(`${prefix}CLOSE`);
|
|
54741
|
+
eventBus.emit(`${prefix}CANCEL`);
|
|
54731
54742
|
}
|
|
54732
54743
|
clear(slot);
|
|
54733
54744
|
};
|
|
@@ -54781,6 +54792,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
54781
54792
|
const slotsBus = useUISlots();
|
|
54782
54793
|
const eventBus = useEventBus();
|
|
54783
54794
|
const { t } = useTranslate();
|
|
54795
|
+
const compiledPortalSchemaCtx = useEntitySchemaOptional();
|
|
54784
54796
|
useEffect(() => {
|
|
54785
54797
|
setPortalRoot(getOrCreatePortalRoot());
|
|
54786
54798
|
}, []);
|
|
@@ -54789,8 +54801,10 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
54789
54801
|
});
|
|
54790
54802
|
const handleDismiss = () => {
|
|
54791
54803
|
if (slot === "modal" || slot === "drawer") {
|
|
54792
|
-
|
|
54793
|
-
|
|
54804
|
+
const orbital = sourceTrait !== void 0 && compiledPortalSchemaCtx !== null ? compiledPortalSchemaCtx.orbitalsByTrait.get(sourceTrait) : void 0;
|
|
54805
|
+
const prefix = orbital !== void 0 && sourceTrait !== void 0 ? `UI:${orbital}.${sourceTrait}.` : "UI:";
|
|
54806
|
+
eventBus.emit(`${prefix}CLOSE`);
|
|
54807
|
+
eventBus.emit(`${prefix}CANCEL`);
|
|
54794
54808
|
}
|
|
54795
54809
|
slotsBus.clear(slot);
|
|
54796
54810
|
};
|
|
@@ -54949,7 +54963,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
54949
54963
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
54950
54964
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
54951
54965
|
}
|
|
54952
|
-
return /* @__PURE__ */ jsx(
|
|
54966
|
+
return /* @__PURE__ */ jsx(React112__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
54953
54967
|
}
|
|
54954
54968
|
if (!child || typeof child !== "object") return null;
|
|
54955
54969
|
const childId = `${parentId}-${index}`;
|
|
@@ -54989,14 +55003,14 @@ function isPatternConfig(value) {
|
|
|
54989
55003
|
if (value === null || value === void 0) return false;
|
|
54990
55004
|
if (typeof value !== "object") return false;
|
|
54991
55005
|
if (Array.isArray(value)) return false;
|
|
54992
|
-
if (
|
|
55006
|
+
if (React112__default.isValidElement(value)) return false;
|
|
54993
55007
|
if (value instanceof Date) return false;
|
|
54994
55008
|
if (typeof value === "function") return false;
|
|
54995
55009
|
const record = value;
|
|
54996
|
-
return "type" in record && typeof record.type === "string" && getComponentForPattern(record.type) !== null;
|
|
55010
|
+
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
54997
55011
|
}
|
|
54998
55012
|
function isPlainConfigObject(value) {
|
|
54999
|
-
if (
|
|
55013
|
+
if (React112__default.isValidElement(value)) return false;
|
|
55000
55014
|
if (value instanceof Date) return false;
|
|
55001
55015
|
const proto = Object.getPrototypeOf(value);
|
|
55002
55016
|
return proto === Object.prototype || proto === null;
|
|
@@ -55102,7 +55116,7 @@ function SlotContentRenderer({
|
|
|
55102
55116
|
}
|
|
55103
55117
|
}
|
|
55104
55118
|
const orbitalName = schemaCtx && content.sourceTrait !== void 0 ? schemaCtx.orbitalsByTrait.get(content.sourceTrait) : void 0;
|
|
55105
|
-
const PatternComponent =
|
|
55119
|
+
const PatternComponent = getComponentForPattern(content.pattern);
|
|
55106
55120
|
if (PatternComponent) {
|
|
55107
55121
|
const childrenConfig = content.props.children;
|
|
55108
55122
|
const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
|
|
@@ -55122,7 +55136,7 @@ function SlotContentRenderer({
|
|
|
55122
55136
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
55123
55137
|
const slotVal = restProps[slotKey];
|
|
55124
55138
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
55125
|
-
if (
|
|
55139
|
+
if (React112__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
55126
55140
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
55127
55141
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
55128
55142
|
slotVal,
|
|
@@ -55171,7 +55185,7 @@ function SlotContentRenderer({
|
|
|
55171
55185
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
55172
55186
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
55173
55187
|
const sample = resolvedItems[0];
|
|
55174
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
55188
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React112__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
55175
55189
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
55176
55190
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
55177
55191
|
}
|
|
@@ -55349,6 +55363,7 @@ var init_UISlotRenderer = __esm({
|
|
|
55349
55363
|
"custom",
|
|
55350
55364
|
"dashboard-layout",
|
|
55351
55365
|
"game-shell",
|
|
55366
|
+
"game-template",
|
|
55352
55367
|
"scaled-diagram",
|
|
55353
55368
|
"master-detail",
|
|
55354
55369
|
"form-field",
|
|
@@ -55533,7 +55548,7 @@ var AvlTransition = ({
|
|
|
55533
55548
|
opacity = 1,
|
|
55534
55549
|
className
|
|
55535
55550
|
}) => {
|
|
55536
|
-
const ids =
|
|
55551
|
+
const ids = React112__default.useMemo(() => {
|
|
55537
55552
|
avlTransitionId += 1;
|
|
55538
55553
|
return { arrow: `avl-tr-${avlTransitionId}-arrow` };
|
|
55539
55554
|
}, []);
|
|
@@ -56094,7 +56109,7 @@ var AvlStateMachine = ({
|
|
|
56094
56109
|
color = "var(--color-primary)",
|
|
56095
56110
|
animated = false
|
|
56096
56111
|
}) => {
|
|
56097
|
-
const ids =
|
|
56112
|
+
const ids = React112__default.useMemo(() => {
|
|
56098
56113
|
avlSmId += 1;
|
|
56099
56114
|
const base = `avl-sm-${avlSmId}`;
|
|
56100
56115
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -56293,7 +56308,7 @@ var AvlOrbitalUnit = ({
|
|
|
56293
56308
|
color = "var(--color-primary)",
|
|
56294
56309
|
animated = false
|
|
56295
56310
|
}) => {
|
|
56296
|
-
const ids =
|
|
56311
|
+
const ids = React112__default.useMemo(() => {
|
|
56297
56312
|
avlOuId += 1;
|
|
56298
56313
|
const base = `avl-ou-${avlOuId}`;
|
|
56299
56314
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -56389,7 +56404,7 @@ var AvlClosedCircuit = ({
|
|
|
56389
56404
|
color = "var(--color-primary)",
|
|
56390
56405
|
animated = false
|
|
56391
56406
|
}) => {
|
|
56392
|
-
const ids =
|
|
56407
|
+
const ids = React112__default.useMemo(() => {
|
|
56393
56408
|
avlCcId += 1;
|
|
56394
56409
|
const base = `avl-cc-${avlCcId}`;
|
|
56395
56410
|
return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
|
|
@@ -56544,7 +56559,7 @@ var AvlEmitListen = ({
|
|
|
56544
56559
|
color = "var(--color-primary)",
|
|
56545
56560
|
animated = false
|
|
56546
56561
|
}) => {
|
|
56547
|
-
const ids =
|
|
56562
|
+
const ids = React112__default.useMemo(() => {
|
|
56548
56563
|
avlElId += 1;
|
|
56549
56564
|
const base = `avl-el-${avlElId}`;
|
|
56550
56565
|
return { arrow: `${base}-arrow`, grad: `${base}-grad` };
|
|
@@ -56818,7 +56833,7 @@ function renderNode(node, color, glowId) {
|
|
|
56818
56833
|
const baseR = node.type === "operator" ? 20 : 16;
|
|
56819
56834
|
const r2 = Math.max(baseR, labelLen * 3.5 + 6);
|
|
56820
56835
|
const nc = nodeColor(node.type, color);
|
|
56821
|
-
return /* @__PURE__ */ jsxs(
|
|
56836
|
+
return /* @__PURE__ */ jsxs(React112__default.Fragment, { children: [
|
|
56822
56837
|
node.children.map((child, i) => {
|
|
56823
56838
|
const childR = Math.max(
|
|
56824
56839
|
child.type === "operator" ? 20 : 16,
|
|
@@ -56875,7 +56890,7 @@ var AvlExprTree = ({
|
|
|
56875
56890
|
className,
|
|
56876
56891
|
color = "var(--color-primary)"
|
|
56877
56892
|
}) => {
|
|
56878
|
-
const ids =
|
|
56893
|
+
const ids = React112__default.useMemo(() => {
|
|
56879
56894
|
avlEtId += 1;
|
|
56880
56895
|
return { glow: `avl-et-${avlEtId}-glow` };
|
|
56881
56896
|
}, []);
|
|
@@ -57710,7 +57725,7 @@ var SystemNode = ({ data }) => {
|
|
|
57710
57725
|
stateChain.length > 0 && /* @__PURE__ */ jsx("svg", { width: stateChain.length * 14 + 2, height: 10, viewBox: `0 0 ${stateChain.length * 14 + 2} 10`, children: stateChain.map((s, i) => {
|
|
57711
57726
|
const tc = transitionCounts[s.name] ?? 0;
|
|
57712
57727
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
57713
|
-
return /* @__PURE__ */ jsxs(
|
|
57728
|
+
return /* @__PURE__ */ jsxs(React112__default.Fragment, { children: [
|
|
57714
57729
|
/* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial ?? void 0, isTerminal: s.isTerminal ?? void 0 }),
|
|
57715
57730
|
i < stateChain.length - 1 && /* @__PURE__ */ jsx("line", { x1: i * 14 + 12, y1: 5, x2: i * 14 + 15, y2: 5, stroke: "var(--color-border)", strokeWidth: 0.5 })
|
|
57716
57731
|
] }, s.name);
|
|
@@ -58855,7 +58870,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
58855
58870
|
if (Array.isArray(body)) {
|
|
58856
58871
|
return body.map((b) => recur(b));
|
|
58857
58872
|
}
|
|
58858
|
-
if (body !== null && typeof body === "object" && !
|
|
58873
|
+
if (body !== null && typeof body === "object" && !React112__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
58859
58874
|
const out = {};
|
|
58860
58875
|
for (const [k, v] of Object.entries(body)) {
|
|
58861
58876
|
out[k] = recur(v);
|
|
@@ -58865,7 +58880,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
58865
58880
|
return body;
|
|
58866
58881
|
}
|
|
58867
58882
|
var _slotContentRenderer2 = null;
|
|
58868
|
-
function
|
|
58883
|
+
function getSlotContentRenderer2() {
|
|
58869
58884
|
if (_slotContentRenderer2) return _slotContentRenderer2;
|
|
58870
58885
|
const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
|
|
58871
58886
|
_slotContentRenderer2 = mod.SlotContentRenderer;
|
|
@@ -58874,14 +58889,14 @@ function getSlotContentRenderer4() {
|
|
|
58874
58889
|
function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
58875
58890
|
return (item, index) => {
|
|
58876
58891
|
const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
|
|
58877
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
58892
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React112__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
58878
58893
|
return null;
|
|
58879
58894
|
}
|
|
58880
58895
|
const record = resolvedBody;
|
|
58881
58896
|
if (typeof record.type !== "string") {
|
|
58882
58897
|
return null;
|
|
58883
58898
|
}
|
|
58884
|
-
const SlotContentRenderer2 =
|
|
58899
|
+
const SlotContentRenderer2 = getSlotContentRenderer2();
|
|
58885
58900
|
const rawChildProps = {};
|
|
58886
58901
|
for (const [k, v] of Object.entries(record)) {
|
|
58887
58902
|
if (k !== "type") rawChildProps[k] = v;
|
|
@@ -58893,7 +58908,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
58893
58908
|
props: childProps,
|
|
58894
58909
|
priority: 0
|
|
58895
58910
|
};
|
|
58896
|
-
return
|
|
58911
|
+
return React112__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
58897
58912
|
};
|
|
58898
58913
|
}
|
|
58899
58914
|
function convertNode(node, callerKey) {
|
|
@@ -58912,7 +58927,7 @@ function convertNode(node, callerKey) {
|
|
|
58912
58927
|
});
|
|
58913
58928
|
return anyChanged ? mapped : node;
|
|
58914
58929
|
}
|
|
58915
|
-
if (typeof node === "object" && !
|
|
58930
|
+
if (typeof node === "object" && !React112__default.isValidElement(node) && !(node instanceof Date)) {
|
|
58916
58931
|
return convertObjectProps(node);
|
|
58917
58932
|
}
|
|
58918
58933
|
return node;
|
|
@@ -60575,8 +60590,8 @@ function CanvasDndProvider({
|
|
|
60575
60590
|
}) {
|
|
60576
60591
|
const eventBus = useEventBus();
|
|
60577
60592
|
const sensors = useAlmadarDndSensors(false);
|
|
60578
|
-
const [activePayload, setActivePayload] =
|
|
60579
|
-
const handleDragStart =
|
|
60593
|
+
const [activePayload, setActivePayload] = React112__default.useState(null);
|
|
60594
|
+
const handleDragStart = React112__default.useCallback((e) => {
|
|
60580
60595
|
const data = e.active.data.current;
|
|
60581
60596
|
const payload = data?.payload;
|
|
60582
60597
|
if (payload) {
|
|
@@ -60587,7 +60602,7 @@ function CanvasDndProvider({
|
|
|
60587
60602
|
log9.warn("dragStart:missing-payload", { id: e.active.id });
|
|
60588
60603
|
}
|
|
60589
60604
|
}, [eventBus]);
|
|
60590
|
-
const handleDragEnd =
|
|
60605
|
+
const handleDragEnd = React112__default.useCallback((e) => {
|
|
60591
60606
|
setActivePayload(null);
|
|
60592
60607
|
const activeData = e.active.data.current;
|
|
60593
60608
|
const payload = activeData?.payload;
|
|
@@ -60616,7 +60631,7 @@ function CanvasDndProvider({
|
|
|
60616
60631
|
const suppressed = onDrop ? onDrop(drop) === true : false;
|
|
60617
60632
|
if (!suppressed) defaultEmit(eventBus, drop);
|
|
60618
60633
|
}, [eventBus, onDrop]);
|
|
60619
|
-
const handleDragCancel =
|
|
60634
|
+
const handleDragCancel = React112__default.useCallback(() => {
|
|
60620
60635
|
setActivePayload(null);
|
|
60621
60636
|
log9.info("dragCancel");
|
|
60622
60637
|
}, []);
|
|
@@ -61374,7 +61389,7 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
61374
61389
|
}
|
|
61375
61390
|
);
|
|
61376
61391
|
};
|
|
61377
|
-
var OrbPreviewNode =
|
|
61392
|
+
var OrbPreviewNode = React112__default.memo(OrbPreviewNodeInner);
|
|
61378
61393
|
OrbPreviewNode.displayName = "OrbPreviewNode";
|
|
61379
61394
|
orbPreviewLog.debug("export-resolved", () => ({
|
|
61380
61395
|
type: typeof OrbPreviewNode,
|
|
@@ -61479,7 +61494,7 @@ var EventFlowEdgeInner = (props) => {
|
|
|
61479
61494
|
) })
|
|
61480
61495
|
] });
|
|
61481
61496
|
};
|
|
61482
|
-
var EventFlowEdge =
|
|
61497
|
+
var EventFlowEdge = React112__default.memo(EventFlowEdgeInner);
|
|
61483
61498
|
EventFlowEdge.displayName = "EventFlowEdge";
|
|
61484
61499
|
|
|
61485
61500
|
// components/avl/molecules/BehaviorComposeNode.tsx
|
|
@@ -61626,7 +61641,7 @@ var BehaviorComposeNodeInner = (props) => {
|
|
|
61626
61641
|
}
|
|
61627
61642
|
);
|
|
61628
61643
|
};
|
|
61629
|
-
var BehaviorComposeNode =
|
|
61644
|
+
var BehaviorComposeNode = React112__default.memo(BehaviorComposeNodeInner);
|
|
61630
61645
|
BehaviorComposeNode.displayName = "BehaviorComposeNode";
|
|
61631
61646
|
|
|
61632
61647
|
// components/avl/lib/avl-behavior-compose-converter.ts
|
|
@@ -62652,7 +62667,7 @@ var TraitCardNodeInner = (props) => {
|
|
|
62652
62667
|
}
|
|
62653
62668
|
);
|
|
62654
62669
|
};
|
|
62655
|
-
var TraitCardNode =
|
|
62670
|
+
var TraitCardNode = React112__default.memo(TraitCardNodeInner);
|
|
62656
62671
|
TraitCardNode.displayName = "TraitCardNode";
|
|
62657
62672
|
|
|
62658
62673
|
// components/avl/organisms/FlowCanvas.tsx
|
|
@@ -62725,7 +62740,7 @@ function FlowCanvasInner({
|
|
|
62725
62740
|
initialOrbital
|
|
62726
62741
|
);
|
|
62727
62742
|
const [expandedBehaviorAlias, setExpandedBehaviorAlias] = useState(void 0);
|
|
62728
|
-
const screenSizeUserOverrideRef =
|
|
62743
|
+
const screenSizeUserOverrideRef = React112__default.useRef(false);
|
|
62729
62744
|
const [screenSize, setScreenSize] = useState(
|
|
62730
62745
|
() => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
|
|
62731
62746
|
);
|
|
@@ -63109,7 +63124,7 @@ var ZoomBreadcrumb = ({
|
|
|
63109
63124
|
if (eventName && band === "detail") {
|
|
63110
63125
|
segments.push({ icon: "\u26A1", label: eventName });
|
|
63111
63126
|
}
|
|
63112
|
-
return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(
|
|
63127
|
+
return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React112__default.Fragment, { children: [
|
|
63113
63128
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
|
|
63114
63129
|
/* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
|
|
63115
63130
|
/* @__PURE__ */ jsx("span", { children: seg.label })
|
|
@@ -63450,7 +63465,7 @@ var EventWireOverlay = ({
|
|
|
63450
63465
|
containerW,
|
|
63451
63466
|
containerH
|
|
63452
63467
|
}) => {
|
|
63453
|
-
const ids =
|
|
63468
|
+
const ids = React112__default.useMemo(() => {
|
|
63454
63469
|
avlOczWireId += 1;
|
|
63455
63470
|
return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
|
|
63456
63471
|
}, []);
|
|
@@ -63817,7 +63832,7 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
63817
63832
|
borderRadius: 6,
|
|
63818
63833
|
border: `1px solid ${color}`
|
|
63819
63834
|
},
|
|
63820
|
-
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(
|
|
63835
|
+
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React112__default.Fragment, { children: [
|
|
63821
63836
|
i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
|
|
63822
63837
|
i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
|
|
63823
63838
|
Box,
|