@almadar/ui 5.43.0 → 5.45.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 +8 -151
- package/dist/avl/index.js +9 -152
- package/dist/components/game/molecules/three/index.cjs +128 -17
- package/dist/components/game/molecules/three/index.css +1 -0
- package/dist/components/game/molecules/three/index.js +128 -17
- package/dist/components/game/templates/GameCanvas3DBattleTemplate.d.ts +8 -1
- package/dist/components/game/templates/GameCanvas3DCastleTemplate.d.ts +8 -1
- package/dist/components/game/templates/GameCanvas3DWorldMapTemplate.d.ts +8 -1
- package/dist/components/index.cjs +125 -145
- package/dist/components/index.js +126 -146
- package/dist/providers/index.cjs +8 -151
- package/dist/providers/index.js +9 -152
- package/dist/runtime/index.cjs +8 -151
- package/dist/runtime/index.js +9 -152
- package/package.json +1 -1
package/dist/providers/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/
|
|
|
6
6
|
import { clsx } from 'clsx';
|
|
7
7
|
import { twMerge } from 'tailwind-merge';
|
|
8
8
|
import * as LucideIcons2 from 'lucide-react';
|
|
9
|
-
import { Loader2, X, Lightbulb, CheckCircle, List, Printer, ChevronRight, ChevronLeft, GitBranch, Pencil, Eye, Plus, ArrowRight, Trash, Code, FileText, WrapText, Check, Copy, RotateCcw, Play, Terminal, XCircle, AlertTriangle, Trash2, Link2, ZoomOut, ZoomIn, Download, Menu as Menu$1, Package, Calendar, MoreHorizontal, Image as Image$1, Upload, ArrowLeft, HelpCircle, PauseCircle, Search, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, Minus, Eraser, TrendingUp, TrendingDown, AlertCircle, Circle, Clock, CheckCircle2,
|
|
9
|
+
import { Loader2, X, Lightbulb, CheckCircle, List, Printer, ChevronRight, ChevronLeft, GitBranch, Pencil, Eye, Plus, ArrowRight, Trash, Code, FileText, WrapText, Check, Copy, RotateCcw, Play, Terminal, XCircle, AlertTriangle, Trash2, Link2, ZoomOut, ZoomIn, Download, Menu as Menu$1, Package, Calendar, MoreHorizontal, Image as Image$1, Upload, ArrowLeft, HelpCircle, PauseCircle, Search, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, Minus, Eraser, TrendingUp, TrendingDown, AlertCircle, Circle, Clock, CheckCircle2, Bug, Send, ChevronUp, ChevronDown, Wrench, Tag, User, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
|
|
10
10
|
import { createPortal } from 'react-dom';
|
|
11
11
|
import { useTranslate } from '@almadar/ui/hooks';
|
|
12
12
|
import { evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
@@ -29331,13 +29331,13 @@ var init_MapView = __esm({
|
|
|
29331
29331
|
shadowSize: [41, 41]
|
|
29332
29332
|
});
|
|
29333
29333
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
29334
|
-
const { useEffect:
|
|
29334
|
+
const { useEffect: useEffect73, useRef: useRef68, useCallback: useCallback112, useState: useState104 } = React83__default;
|
|
29335
29335
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
29336
29336
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
29337
29337
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
29338
29338
|
const map = useMap();
|
|
29339
|
-
const prevRef =
|
|
29340
|
-
|
|
29339
|
+
const prevRef = useRef68({ centerLat, centerLng, zoom });
|
|
29340
|
+
useEffect73(() => {
|
|
29341
29341
|
const prev = prevRef.current;
|
|
29342
29342
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
29343
29343
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -29348,7 +29348,7 @@ var init_MapView = __esm({
|
|
|
29348
29348
|
}
|
|
29349
29349
|
function MapClickHandler({ onMapClick }) {
|
|
29350
29350
|
const map = useMap();
|
|
29351
|
-
|
|
29351
|
+
useEffect73(() => {
|
|
29352
29352
|
if (!onMapClick) return;
|
|
29353
29353
|
const handler = (e) => {
|
|
29354
29354
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -34385,7 +34385,7 @@ var init_RichBlockEditor = __esm({
|
|
|
34385
34385
|
"border-b border-border bg-muted/30 px-2 py-2"
|
|
34386
34386
|
),
|
|
34387
34387
|
children: TOOLBAR_ENTRIES.map((entry) => {
|
|
34388
|
-
const
|
|
34388
|
+
const Icon2 = entry.icon;
|
|
34389
34389
|
const entryLabel = t(entry.labelKey);
|
|
34390
34390
|
return /* @__PURE__ */ jsxs(
|
|
34391
34391
|
Button,
|
|
@@ -34397,7 +34397,7 @@ var init_RichBlockEditor = __esm({
|
|
|
34397
34397
|
title: entryLabel,
|
|
34398
34398
|
onClick: () => handleAppend(entry.type),
|
|
34399
34399
|
children: [
|
|
34400
|
-
/* @__PURE__ */ jsx(
|
|
34400
|
+
/* @__PURE__ */ jsx(Icon2, { size: 14 }),
|
|
34401
34401
|
/* @__PURE__ */ jsx(Typography, { as: "span", variant: "caption", className: "ml-1 hidden text-xs sm:inline", children: entryLabel })
|
|
34402
34402
|
]
|
|
34403
34403
|
},
|
|
@@ -45447,133 +45447,6 @@ var init_SimulationCanvas = __esm({
|
|
|
45447
45447
|
SimulationCanvas.displayName = "SimulationCanvas";
|
|
45448
45448
|
}
|
|
45449
45449
|
});
|
|
45450
|
-
function SimulationControls({
|
|
45451
|
-
running,
|
|
45452
|
-
speed,
|
|
45453
|
-
parameters,
|
|
45454
|
-
onPlay,
|
|
45455
|
-
onPause,
|
|
45456
|
-
onStep,
|
|
45457
|
-
onReset,
|
|
45458
|
-
onSpeedChange,
|
|
45459
|
-
onParameterChange,
|
|
45460
|
-
className
|
|
45461
|
-
}) {
|
|
45462
|
-
return /* @__PURE__ */ jsxs(VStack, { gap: "md", className, children: [
|
|
45463
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
45464
|
-
running ? /* @__PURE__ */ jsx(Button, { size: "sm", variant: "secondary", onClick: onPause, icon: Pause, children: "Pause" }) : /* @__PURE__ */ jsx(Button, { size: "sm", variant: "primary", onClick: onPlay, icon: Play, children: "Play" }),
|
|
45465
|
-
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", onClick: onStep, icon: SkipForward, disabled: running, children: "Step" }),
|
|
45466
|
-
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", onClick: onReset, icon: RotateCcw, children: "Reset" })
|
|
45467
|
-
] }),
|
|
45468
|
-
/* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
45469
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", children: [
|
|
45470
|
-
"Speed: ",
|
|
45471
|
-
speed.toFixed(1),
|
|
45472
|
-
"x"
|
|
45473
|
-
] }),
|
|
45474
|
-
/* @__PURE__ */ jsx(
|
|
45475
|
-
"input",
|
|
45476
|
-
{
|
|
45477
|
-
type: "range",
|
|
45478
|
-
min: 0.1,
|
|
45479
|
-
max: 5,
|
|
45480
|
-
step: 0.1,
|
|
45481
|
-
value: speed,
|
|
45482
|
-
onChange: (e) => onSpeedChange(parseFloat(e.target.value)),
|
|
45483
|
-
className: "w-full"
|
|
45484
|
-
}
|
|
45485
|
-
)
|
|
45486
|
-
] }),
|
|
45487
|
-
Object.entries(parameters).map(([name, param]) => /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
45488
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", children: [
|
|
45489
|
-
param.label,
|
|
45490
|
-
": ",
|
|
45491
|
-
param.value.toFixed(2)
|
|
45492
|
-
] }),
|
|
45493
|
-
/* @__PURE__ */ jsx(
|
|
45494
|
-
"input",
|
|
45495
|
-
{
|
|
45496
|
-
type: "range",
|
|
45497
|
-
min: param.min,
|
|
45498
|
-
max: param.max,
|
|
45499
|
-
step: param.step,
|
|
45500
|
-
value: param.value,
|
|
45501
|
-
onChange: (e) => onParameterChange(name, parseFloat(e.target.value)),
|
|
45502
|
-
className: "w-full"
|
|
45503
|
-
}
|
|
45504
|
-
)
|
|
45505
|
-
] }, name))
|
|
45506
|
-
] });
|
|
45507
|
-
}
|
|
45508
|
-
var init_SimulationControls = __esm({
|
|
45509
|
-
"components/game/organisms/physics-sim/SimulationControls.tsx"() {
|
|
45510
|
-
init_atoms2();
|
|
45511
|
-
SimulationControls.displayName = "SimulationControls";
|
|
45512
|
-
}
|
|
45513
|
-
});
|
|
45514
|
-
function SimulationGraph({
|
|
45515
|
-
label,
|
|
45516
|
-
unit,
|
|
45517
|
-
data,
|
|
45518
|
-
maxPoints = 200,
|
|
45519
|
-
width = 300,
|
|
45520
|
-
height = 120,
|
|
45521
|
-
color = "#e94560",
|
|
45522
|
-
className
|
|
45523
|
-
}) {
|
|
45524
|
-
const canvasRef = useRef(null);
|
|
45525
|
-
const visibleData = data.slice(-maxPoints);
|
|
45526
|
-
useEffect(() => {
|
|
45527
|
-
const canvas = canvasRef.current;
|
|
45528
|
-
if (!canvas || visibleData.length < 2) return;
|
|
45529
|
-
const ctx = canvas.getContext("2d");
|
|
45530
|
-
if (!ctx) return;
|
|
45531
|
-
ctx.clearRect(0, 0, width, height);
|
|
45532
|
-
ctx.fillStyle = "#0f0f23";
|
|
45533
|
-
ctx.fillRect(0, 0, width, height);
|
|
45534
|
-
ctx.strokeStyle = "#1a1a3e";
|
|
45535
|
-
ctx.lineWidth = 0.5;
|
|
45536
|
-
for (let i = 0; i < 5; i++) {
|
|
45537
|
-
const y = height / 5 * i;
|
|
45538
|
-
ctx.beginPath();
|
|
45539
|
-
ctx.moveTo(0, y);
|
|
45540
|
-
ctx.lineTo(width, y);
|
|
45541
|
-
ctx.stroke();
|
|
45542
|
-
}
|
|
45543
|
-
let minVal = Infinity;
|
|
45544
|
-
let maxVal = -Infinity;
|
|
45545
|
-
for (const pt of visibleData) {
|
|
45546
|
-
if (pt.value < minVal) minVal = pt.value;
|
|
45547
|
-
if (pt.value > maxVal) maxVal = pt.value;
|
|
45548
|
-
}
|
|
45549
|
-
const range = maxVal - minVal || 1;
|
|
45550
|
-
const pad = height * 0.1;
|
|
45551
|
-
ctx.beginPath();
|
|
45552
|
-
ctx.strokeStyle = color;
|
|
45553
|
-
ctx.lineWidth = 2;
|
|
45554
|
-
for (let i = 0; i < visibleData.length; i++) {
|
|
45555
|
-
const x = i / (maxPoints - 1) * width;
|
|
45556
|
-
const y = pad + (maxVal - visibleData[i].value) / range * (height - 2 * pad);
|
|
45557
|
-
if (i === 0) ctx.moveTo(x, y);
|
|
45558
|
-
else ctx.lineTo(x, y);
|
|
45559
|
-
}
|
|
45560
|
-
ctx.stroke();
|
|
45561
|
-
const last = visibleData[visibleData.length - 1];
|
|
45562
|
-
ctx.fillStyle = color;
|
|
45563
|
-
ctx.font = "12px monospace";
|
|
45564
|
-
ctx.fillText(`${last.value.toFixed(2)} ${unit}`, width - 80, 16);
|
|
45565
|
-
}, [visibleData, width, height, color, unit, maxPoints]);
|
|
45566
|
-
return /* @__PURE__ */ jsx(Card, { padding: "sm", className, children: /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
45567
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", weight: "bold", children: label }),
|
|
45568
|
-
/* @__PURE__ */ jsx("canvas", { ref: canvasRef, width, height, className: "rounded" })
|
|
45569
|
-
] }) });
|
|
45570
|
-
}
|
|
45571
|
-
var init_SimulationGraph = __esm({
|
|
45572
|
-
"components/game/organisms/physics-sim/SimulationGraph.tsx"() {
|
|
45573
|
-
init_atoms2();
|
|
45574
|
-
SimulationGraph.displayName = "SimulationGraph";
|
|
45575
|
-
}
|
|
45576
|
-
});
|
|
45577
45450
|
function SimulatorBoard({
|
|
45578
45451
|
entity,
|
|
45579
45452
|
completeEvent = "PUZZLE_COMPLETE",
|
|
@@ -45844,7 +45717,7 @@ var init_StatCard = __esm({
|
|
|
45844
45717
|
isLoading: externalLoading,
|
|
45845
45718
|
error: externalError
|
|
45846
45719
|
}) => {
|
|
45847
|
-
const
|
|
45720
|
+
const Icon2 = typeof iconProp === "string" ? resolveIcon(iconProp) ?? void 0 : iconProp;
|
|
45848
45721
|
const labelToUse = propLabel ?? propTitle;
|
|
45849
45722
|
const eventBus = useEventBus();
|
|
45850
45723
|
const { t } = useTranslate();
|
|
@@ -45987,7 +45860,7 @@ var init_StatCard = __esm({
|
|
|
45987
45860
|
subtitle && !calculatedTrend && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "secondary", children: subtitle })
|
|
45988
45861
|
] }),
|
|
45989
45862
|
/* @__PURE__ */ jsxs(VStack, { gap: "xs", align: "end", children: [
|
|
45990
|
-
|
|
45863
|
+
Icon2 && /* @__PURE__ */ jsx(Box, { className: cn("p-3", iconBg), children: /* @__PURE__ */ jsx(Icon2, { className: cn("h-6 w-6", iconColor) }) }),
|
|
45991
45864
|
sparklineData && sparklineData.length > 1 && /* @__PURE__ */ jsx(Sparkline, { data: sparklineData, color: "auto" })
|
|
45992
45865
|
] })
|
|
45993
45866
|
] }),
|
|
@@ -47790,7 +47663,6 @@ var init_component_registry_generated = __esm({
|
|
|
47790
47663
|
init_Navigation();
|
|
47791
47664
|
init_NegotiatorBoard();
|
|
47792
47665
|
init_NumberStepper();
|
|
47793
|
-
init_ObjectRulePanel();
|
|
47794
47666
|
init_OptionConstraintGroup();
|
|
47795
47667
|
init_OrbitalVisualization();
|
|
47796
47668
|
init_Overlay();
|
|
@@ -47821,7 +47693,6 @@ var init_component_registry_generated = __esm({
|
|
|
47821
47693
|
init_ResourceBar();
|
|
47822
47694
|
init_ResourceCounter();
|
|
47823
47695
|
init_RichBlockEditor();
|
|
47824
|
-
init_RuleEditor();
|
|
47825
47696
|
init_RuntimeDebugger2();
|
|
47826
47697
|
init_ScaledDiagram();
|
|
47827
47698
|
init_ScoreBoard();
|
|
@@ -47841,8 +47712,6 @@ var init_component_registry_generated = __esm({
|
|
|
47841
47712
|
init_SignaturePad();
|
|
47842
47713
|
init_SimpleGrid();
|
|
47843
47714
|
init_SimulationCanvas();
|
|
47844
|
-
init_SimulationControls();
|
|
47845
|
-
init_SimulationGraph();
|
|
47846
47715
|
init_SimulatorBoard();
|
|
47847
47716
|
init_Skeleton();
|
|
47848
47717
|
init_SocialProof();
|
|
@@ -47860,7 +47729,6 @@ var init_component_registry_generated = __esm({
|
|
|
47860
47729
|
init_StateArchitectBoard();
|
|
47861
47730
|
init_StateIndicator();
|
|
47862
47731
|
init_StateMachineView();
|
|
47863
|
-
init_StateNode();
|
|
47864
47732
|
init_StatsGrid();
|
|
47865
47733
|
init_StatsOrganism();
|
|
47866
47734
|
init_StatusDot();
|
|
@@ -47899,8 +47767,6 @@ var init_component_registry_generated = __esm({
|
|
|
47899
47767
|
init_Tooltip();
|
|
47900
47768
|
init_TraitFrame();
|
|
47901
47769
|
init_TraitSlot();
|
|
47902
|
-
init_TraitStateViewer();
|
|
47903
|
-
init_TransitionArrow();
|
|
47904
47770
|
init_TrendIndicator();
|
|
47905
47771
|
init_TurnIndicator();
|
|
47906
47772
|
init_TurnPanel();
|
|
@@ -47910,7 +47776,6 @@ var init_component_registry_generated = __esm({
|
|
|
47910
47776
|
init_UncontrolledBattleBoard();
|
|
47911
47777
|
init_UnitCommandBar();
|
|
47912
47778
|
init_UploadDropZone();
|
|
47913
|
-
init_VariablePanel();
|
|
47914
47779
|
init_VersionDiff();
|
|
47915
47780
|
init_ViolationAlert();
|
|
47916
47781
|
init_VoteStack();
|
|
@@ -48120,7 +47985,6 @@ var init_component_registry_generated = __esm({
|
|
|
48120
47985
|
"Navigation": Navigation,
|
|
48121
47986
|
"NegotiatorBoard": NegotiatorBoard,
|
|
48122
47987
|
"NumberStepper": NumberStepper,
|
|
48123
|
-
"ObjectRulePanel": ObjectRulePanel,
|
|
48124
47988
|
"OptionConstraintGroup": OptionConstraintGroup,
|
|
48125
47989
|
"OrbitalVisualization": OrbitalVisualization,
|
|
48126
47990
|
"Overlay": Overlay,
|
|
@@ -48151,7 +48015,6 @@ var init_component_registry_generated = __esm({
|
|
|
48151
48015
|
"ResourceBar": ResourceBar,
|
|
48152
48016
|
"ResourceCounter": ResourceCounter,
|
|
48153
48017
|
"RichBlockEditor": RichBlockEditor,
|
|
48154
|
-
"RuleEditor": RuleEditor,
|
|
48155
48018
|
"RuntimeDebugger": RuntimeDebugger,
|
|
48156
48019
|
"ScaledDiagram": ScaledDiagram,
|
|
48157
48020
|
"ScoreBoard": ScoreBoard,
|
|
@@ -48171,8 +48034,6 @@ var init_component_registry_generated = __esm({
|
|
|
48171
48034
|
"SignaturePad": SignaturePad,
|
|
48172
48035
|
"SimpleGrid": SimpleGrid,
|
|
48173
48036
|
"SimulationCanvas": SimulationCanvas,
|
|
48174
|
-
"SimulationControls": SimulationControls,
|
|
48175
|
-
"SimulationGraph": SimulationGraph,
|
|
48176
48037
|
"SimulatorBoard": SimulatorBoard,
|
|
48177
48038
|
"Skeleton": Skeleton,
|
|
48178
48039
|
"SocialProof": SocialProof,
|
|
@@ -48193,7 +48054,6 @@ var init_component_registry_generated = __esm({
|
|
|
48193
48054
|
"StateArchitectBoard": StateArchitectBoard,
|
|
48194
48055
|
"StateIndicator": StateIndicator,
|
|
48195
48056
|
"StateMachineView": StateMachineView,
|
|
48196
|
-
"StateNode": StateNode2,
|
|
48197
48057
|
"StatsGrid": StatsGrid,
|
|
48198
48058
|
"StatsOrganism": StatsOrganism,
|
|
48199
48059
|
"StatusDot": StatusDot,
|
|
@@ -48232,8 +48092,6 @@ var init_component_registry_generated = __esm({
|
|
|
48232
48092
|
"Tooltip": Tooltip,
|
|
48233
48093
|
"TraitFrame": TraitFrame,
|
|
48234
48094
|
"TraitSlot": TraitSlot,
|
|
48235
|
-
"TraitStateViewer": TraitStateViewer,
|
|
48236
|
-
"TransitionArrow": TransitionArrow,
|
|
48237
48095
|
"TrendIndicator": TrendIndicator,
|
|
48238
48096
|
"TurnIndicator": TurnIndicator,
|
|
48239
48097
|
"TurnPanel": TurnPanel,
|
|
@@ -48244,7 +48102,6 @@ var init_component_registry_generated = __esm({
|
|
|
48244
48102
|
"UnitCommandBar": UnitCommandBar,
|
|
48245
48103
|
"UploadDropZone": UploadDropZone,
|
|
48246
48104
|
"VStack": VStack,
|
|
48247
|
-
"VariablePanel": VariablePanel,
|
|
48248
48105
|
"VersionDiff": VersionDiff,
|
|
48249
48106
|
"ViolationAlert": ViolationAlert,
|
|
48250
48107
|
"VoteStack": VoteStack,
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -28944,13 +28944,13 @@ var init_MapView = __esm({
|
|
|
28944
28944
|
shadowSize: [41, 41]
|
|
28945
28945
|
});
|
|
28946
28946
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
28947
|
-
const { useEffect:
|
|
28947
|
+
const { useEffect: useEffect74, useRef: useRef68, useCallback: useCallback112, useState: useState107 } = React82__namespace.default;
|
|
28948
28948
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
28949
28949
|
const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
28950
28950
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
28951
28951
|
const map = useMap();
|
|
28952
|
-
const prevRef =
|
|
28953
|
-
|
|
28952
|
+
const prevRef = useRef68({ centerLat, centerLng, zoom });
|
|
28953
|
+
useEffect74(() => {
|
|
28954
28954
|
const prev = prevRef.current;
|
|
28955
28955
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
28956
28956
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -28961,7 +28961,7 @@ var init_MapView = __esm({
|
|
|
28961
28961
|
}
|
|
28962
28962
|
function MapClickHandler({ onMapClick }) {
|
|
28963
28963
|
const map = useMap();
|
|
28964
|
-
|
|
28964
|
+
useEffect74(() => {
|
|
28965
28965
|
if (!onMapClick) return;
|
|
28966
28966
|
const handler = (e) => {
|
|
28967
28967
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -33998,7 +33998,7 @@ var init_RichBlockEditor = __esm({
|
|
|
33998
33998
|
"border-b border-border bg-muted/30 px-2 py-2"
|
|
33999
33999
|
),
|
|
34000
34000
|
children: TOOLBAR_ENTRIES.map((entry) => {
|
|
34001
|
-
const
|
|
34001
|
+
const Icon2 = entry.icon;
|
|
34002
34002
|
const entryLabel = t(entry.labelKey);
|
|
34003
34003
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
34004
34004
|
Button,
|
|
@@ -34010,7 +34010,7 @@ var init_RichBlockEditor = __esm({
|
|
|
34010
34010
|
title: entryLabel,
|
|
34011
34011
|
onClick: () => handleAppend(entry.type),
|
|
34012
34012
|
children: [
|
|
34013
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
34013
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { size: 14 }),
|
|
34014
34014
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { as: "span", variant: "caption", className: "ml-1 hidden text-xs sm:inline", children: entryLabel })
|
|
34015
34015
|
]
|
|
34016
34016
|
},
|
|
@@ -45079,133 +45079,6 @@ var init_SimulationCanvas = __esm({
|
|
|
45079
45079
|
SimulationCanvas.displayName = "SimulationCanvas";
|
|
45080
45080
|
}
|
|
45081
45081
|
});
|
|
45082
|
-
function SimulationControls({
|
|
45083
|
-
running,
|
|
45084
|
-
speed,
|
|
45085
|
-
parameters,
|
|
45086
|
-
onPlay,
|
|
45087
|
-
onPause,
|
|
45088
|
-
onStep,
|
|
45089
|
-
onReset,
|
|
45090
|
-
onSpeedChange,
|
|
45091
|
-
onParameterChange,
|
|
45092
|
-
className
|
|
45093
|
-
}) {
|
|
45094
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "md", className, children: [
|
|
45095
|
-
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
45096
|
-
running ? /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", variant: "secondary", onClick: onPause, icon: LucideIcons2.Pause, children: "Pause" }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", variant: "primary", onClick: onPlay, icon: LucideIcons2.Play, children: "Play" }),
|
|
45097
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", variant: "ghost", onClick: onStep, icon: LucideIcons2.SkipForward, disabled: running, children: "Step" }),
|
|
45098
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", variant: "ghost", onClick: onReset, icon: LucideIcons2.RotateCcw, children: "Reset" })
|
|
45099
|
-
] }),
|
|
45100
|
-
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
|
|
45101
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "caption", color: "muted", children: [
|
|
45102
|
-
"Speed: ",
|
|
45103
|
-
speed.toFixed(1),
|
|
45104
|
-
"x"
|
|
45105
|
-
] }),
|
|
45106
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
45107
|
-
"input",
|
|
45108
|
-
{
|
|
45109
|
-
type: "range",
|
|
45110
|
-
min: 0.1,
|
|
45111
|
-
max: 5,
|
|
45112
|
-
step: 0.1,
|
|
45113
|
-
value: speed,
|
|
45114
|
-
onChange: (e) => onSpeedChange(parseFloat(e.target.value)),
|
|
45115
|
-
className: "w-full"
|
|
45116
|
-
}
|
|
45117
|
-
)
|
|
45118
|
-
] }),
|
|
45119
|
-
Object.entries(parameters).map(([name, param]) => /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
|
|
45120
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "caption", color: "muted", children: [
|
|
45121
|
-
param.label,
|
|
45122
|
-
": ",
|
|
45123
|
-
param.value.toFixed(2)
|
|
45124
|
-
] }),
|
|
45125
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
45126
|
-
"input",
|
|
45127
|
-
{
|
|
45128
|
-
type: "range",
|
|
45129
|
-
min: param.min,
|
|
45130
|
-
max: param.max,
|
|
45131
|
-
step: param.step,
|
|
45132
|
-
value: param.value,
|
|
45133
|
-
onChange: (e) => onParameterChange(name, parseFloat(e.target.value)),
|
|
45134
|
-
className: "w-full"
|
|
45135
|
-
}
|
|
45136
|
-
)
|
|
45137
|
-
] }, name))
|
|
45138
|
-
] });
|
|
45139
|
-
}
|
|
45140
|
-
var init_SimulationControls = __esm({
|
|
45141
|
-
"components/game/organisms/physics-sim/SimulationControls.tsx"() {
|
|
45142
|
-
init_atoms2();
|
|
45143
|
-
SimulationControls.displayName = "SimulationControls";
|
|
45144
|
-
}
|
|
45145
|
-
});
|
|
45146
|
-
function SimulationGraph({
|
|
45147
|
-
label,
|
|
45148
|
-
unit,
|
|
45149
|
-
data,
|
|
45150
|
-
maxPoints = 200,
|
|
45151
|
-
width = 300,
|
|
45152
|
-
height = 120,
|
|
45153
|
-
color = "#e94560",
|
|
45154
|
-
className
|
|
45155
|
-
}) {
|
|
45156
|
-
const canvasRef = React82.useRef(null);
|
|
45157
|
-
const visibleData = data.slice(-maxPoints);
|
|
45158
|
-
React82.useEffect(() => {
|
|
45159
|
-
const canvas = canvasRef.current;
|
|
45160
|
-
if (!canvas || visibleData.length < 2) return;
|
|
45161
|
-
const ctx = canvas.getContext("2d");
|
|
45162
|
-
if (!ctx) return;
|
|
45163
|
-
ctx.clearRect(0, 0, width, height);
|
|
45164
|
-
ctx.fillStyle = "#0f0f23";
|
|
45165
|
-
ctx.fillRect(0, 0, width, height);
|
|
45166
|
-
ctx.strokeStyle = "#1a1a3e";
|
|
45167
|
-
ctx.lineWidth = 0.5;
|
|
45168
|
-
for (let i = 0; i < 5; i++) {
|
|
45169
|
-
const y = height / 5 * i;
|
|
45170
|
-
ctx.beginPath();
|
|
45171
|
-
ctx.moveTo(0, y);
|
|
45172
|
-
ctx.lineTo(width, y);
|
|
45173
|
-
ctx.stroke();
|
|
45174
|
-
}
|
|
45175
|
-
let minVal = Infinity;
|
|
45176
|
-
let maxVal = -Infinity;
|
|
45177
|
-
for (const pt of visibleData) {
|
|
45178
|
-
if (pt.value < minVal) minVal = pt.value;
|
|
45179
|
-
if (pt.value > maxVal) maxVal = pt.value;
|
|
45180
|
-
}
|
|
45181
|
-
const range = maxVal - minVal || 1;
|
|
45182
|
-
const pad = height * 0.1;
|
|
45183
|
-
ctx.beginPath();
|
|
45184
|
-
ctx.strokeStyle = color;
|
|
45185
|
-
ctx.lineWidth = 2;
|
|
45186
|
-
for (let i = 0; i < visibleData.length; i++) {
|
|
45187
|
-
const x = i / (maxPoints - 1) * width;
|
|
45188
|
-
const y = pad + (maxVal - visibleData[i].value) / range * (height - 2 * pad);
|
|
45189
|
-
if (i === 0) ctx.moveTo(x, y);
|
|
45190
|
-
else ctx.lineTo(x, y);
|
|
45191
|
-
}
|
|
45192
|
-
ctx.stroke();
|
|
45193
|
-
const last = visibleData[visibleData.length - 1];
|
|
45194
|
-
ctx.fillStyle = color;
|
|
45195
|
-
ctx.font = "12px monospace";
|
|
45196
|
-
ctx.fillText(`${last.value.toFixed(2)} ${unit}`, width - 80, 16);
|
|
45197
|
-
}, [visibleData, width, height, color, unit, maxPoints]);
|
|
45198
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Card, { padding: "sm", className, children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
|
|
45199
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", weight: "bold", children: label }),
|
|
45200
|
-
/* @__PURE__ */ jsxRuntime.jsx("canvas", { ref: canvasRef, width, height, className: "rounded" })
|
|
45201
|
-
] }) });
|
|
45202
|
-
}
|
|
45203
|
-
var init_SimulationGraph = __esm({
|
|
45204
|
-
"components/game/organisms/physics-sim/SimulationGraph.tsx"() {
|
|
45205
|
-
init_atoms2();
|
|
45206
|
-
SimulationGraph.displayName = "SimulationGraph";
|
|
45207
|
-
}
|
|
45208
|
-
});
|
|
45209
45082
|
function SimulatorBoard({
|
|
45210
45083
|
entity,
|
|
45211
45084
|
completeEvent = "PUZZLE_COMPLETE",
|
|
@@ -45476,7 +45349,7 @@ var init_StatCard = __esm({
|
|
|
45476
45349
|
isLoading: externalLoading,
|
|
45477
45350
|
error: externalError
|
|
45478
45351
|
}) => {
|
|
45479
|
-
const
|
|
45352
|
+
const Icon2 = typeof iconProp === "string" ? resolveIcon(iconProp) ?? void 0 : iconProp;
|
|
45480
45353
|
const labelToUse = propLabel ?? propTitle;
|
|
45481
45354
|
const eventBus = useEventBus();
|
|
45482
45355
|
const { t } = hooks.useTranslate();
|
|
@@ -45619,7 +45492,7 @@ var init_StatCard = __esm({
|
|
|
45619
45492
|
subtitle && !calculatedTrend && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", color: "secondary", children: subtitle })
|
|
45620
45493
|
] }),
|
|
45621
45494
|
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", align: "end", children: [
|
|
45622
|
-
|
|
45495
|
+
Icon2 && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("p-3", iconBg), children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: cn("h-6 w-6", iconColor) }) }),
|
|
45623
45496
|
sparklineData && sparklineData.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(Sparkline, { data: sparklineData, color: "auto" })
|
|
45624
45497
|
] })
|
|
45625
45498
|
] }),
|
|
@@ -47422,7 +47295,6 @@ var init_component_registry_generated = __esm({
|
|
|
47422
47295
|
init_Navigation();
|
|
47423
47296
|
init_NegotiatorBoard();
|
|
47424
47297
|
init_NumberStepper();
|
|
47425
|
-
init_ObjectRulePanel();
|
|
47426
47298
|
init_OptionConstraintGroup();
|
|
47427
47299
|
init_OrbitalVisualization();
|
|
47428
47300
|
init_Overlay();
|
|
@@ -47453,7 +47325,6 @@ var init_component_registry_generated = __esm({
|
|
|
47453
47325
|
init_ResourceBar();
|
|
47454
47326
|
init_ResourceCounter();
|
|
47455
47327
|
init_RichBlockEditor();
|
|
47456
|
-
init_RuleEditor();
|
|
47457
47328
|
init_RuntimeDebugger2();
|
|
47458
47329
|
init_ScaledDiagram();
|
|
47459
47330
|
init_ScoreBoard();
|
|
@@ -47473,8 +47344,6 @@ var init_component_registry_generated = __esm({
|
|
|
47473
47344
|
init_SignaturePad();
|
|
47474
47345
|
init_SimpleGrid();
|
|
47475
47346
|
init_SimulationCanvas();
|
|
47476
|
-
init_SimulationControls();
|
|
47477
|
-
init_SimulationGraph();
|
|
47478
47347
|
init_SimulatorBoard();
|
|
47479
47348
|
init_Skeleton();
|
|
47480
47349
|
init_SocialProof();
|
|
@@ -47492,7 +47361,6 @@ var init_component_registry_generated = __esm({
|
|
|
47492
47361
|
init_StateArchitectBoard();
|
|
47493
47362
|
init_StateIndicator();
|
|
47494
47363
|
init_StateMachineView();
|
|
47495
|
-
init_StateNode();
|
|
47496
47364
|
init_StatsGrid();
|
|
47497
47365
|
init_StatsOrganism();
|
|
47498
47366
|
init_StatusDot();
|
|
@@ -47531,8 +47399,6 @@ var init_component_registry_generated = __esm({
|
|
|
47531
47399
|
init_Tooltip();
|
|
47532
47400
|
init_TraitFrame();
|
|
47533
47401
|
init_TraitSlot();
|
|
47534
|
-
init_TraitStateViewer();
|
|
47535
|
-
init_TransitionArrow();
|
|
47536
47402
|
init_TrendIndicator();
|
|
47537
47403
|
init_TurnIndicator();
|
|
47538
47404
|
init_TurnPanel();
|
|
@@ -47542,7 +47408,6 @@ var init_component_registry_generated = __esm({
|
|
|
47542
47408
|
init_UncontrolledBattleBoard();
|
|
47543
47409
|
init_UnitCommandBar();
|
|
47544
47410
|
init_UploadDropZone();
|
|
47545
|
-
init_VariablePanel();
|
|
47546
47411
|
init_VersionDiff();
|
|
47547
47412
|
init_ViolationAlert();
|
|
47548
47413
|
init_VoteStack();
|
|
@@ -47752,7 +47617,6 @@ var init_component_registry_generated = __esm({
|
|
|
47752
47617
|
"Navigation": Navigation,
|
|
47753
47618
|
"NegotiatorBoard": NegotiatorBoard,
|
|
47754
47619
|
"NumberStepper": NumberStepper,
|
|
47755
|
-
"ObjectRulePanel": ObjectRulePanel,
|
|
47756
47620
|
"OptionConstraintGroup": OptionConstraintGroup,
|
|
47757
47621
|
"OrbitalVisualization": OrbitalVisualization,
|
|
47758
47622
|
"Overlay": Overlay,
|
|
@@ -47783,7 +47647,6 @@ var init_component_registry_generated = __esm({
|
|
|
47783
47647
|
"ResourceBar": ResourceBar,
|
|
47784
47648
|
"ResourceCounter": ResourceCounter,
|
|
47785
47649
|
"RichBlockEditor": RichBlockEditor,
|
|
47786
|
-
"RuleEditor": RuleEditor,
|
|
47787
47650
|
"RuntimeDebugger": RuntimeDebugger,
|
|
47788
47651
|
"ScaledDiagram": ScaledDiagram,
|
|
47789
47652
|
"ScoreBoard": ScoreBoard,
|
|
@@ -47803,8 +47666,6 @@ var init_component_registry_generated = __esm({
|
|
|
47803
47666
|
"SignaturePad": SignaturePad,
|
|
47804
47667
|
"SimpleGrid": SimpleGrid,
|
|
47805
47668
|
"SimulationCanvas": SimulationCanvas,
|
|
47806
|
-
"SimulationControls": SimulationControls,
|
|
47807
|
-
"SimulationGraph": SimulationGraph,
|
|
47808
47669
|
"SimulatorBoard": SimulatorBoard,
|
|
47809
47670
|
"Skeleton": Skeleton,
|
|
47810
47671
|
"SocialProof": SocialProof,
|
|
@@ -47825,7 +47686,6 @@ var init_component_registry_generated = __esm({
|
|
|
47825
47686
|
"StateArchitectBoard": StateArchitectBoard,
|
|
47826
47687
|
"StateIndicator": StateIndicator,
|
|
47827
47688
|
"StateMachineView": StateMachineView,
|
|
47828
|
-
"StateNode": StateNode2,
|
|
47829
47689
|
"StatsGrid": StatsGrid,
|
|
47830
47690
|
"StatsOrganism": StatsOrganism,
|
|
47831
47691
|
"StatusDot": StatusDot,
|
|
@@ -47864,8 +47724,6 @@ var init_component_registry_generated = __esm({
|
|
|
47864
47724
|
"Tooltip": Tooltip,
|
|
47865
47725
|
"TraitFrame": TraitFrame,
|
|
47866
47726
|
"TraitSlot": TraitSlot,
|
|
47867
|
-
"TraitStateViewer": TraitStateViewer,
|
|
47868
|
-
"TransitionArrow": TransitionArrow,
|
|
47869
47727
|
"TrendIndicator": TrendIndicator,
|
|
47870
47728
|
"TurnIndicator": TurnIndicator,
|
|
47871
47729
|
"TurnPanel": TurnPanel,
|
|
@@ -47876,7 +47734,6 @@ var init_component_registry_generated = __esm({
|
|
|
47876
47734
|
"UnitCommandBar": UnitCommandBar,
|
|
47877
47735
|
"UploadDropZone": UploadDropZone,
|
|
47878
47736
|
"VStack": VStack,
|
|
47879
|
-
"VariablePanel": VariablePanel,
|
|
47880
47737
|
"VersionDiff": VersionDiff,
|
|
47881
47738
|
"ViolationAlert": ViolationAlert,
|
|
47882
47739
|
"VoteStack": VoteStack,
|