@almadar/ui 5.43.0 → 5.44.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.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/components/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
6
6
|
import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
7
7
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
8
8
|
import * as LucideIcons2 from 'lucide-react';
|
|
9
|
-
import { Loader2, X, List, Printer, ChevronRight, ChevronLeft, CheckCircle, XCircle, Wrench, RotateCcw, Send, Play, Terminal, Search, ChevronUp, ChevronDown, MoreHorizontal, Bug, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ZoomIn, ArrowRight,
|
|
9
|
+
import { Loader2, X, List, Printer, ChevronRight, ChevronLeft, CheckCircle, XCircle, Wrench, RotateCcw, Send, Play, Terminal, Search, ChevronUp, ChevronDown, MoreHorizontal, Bug, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ZoomIn, ArrowRight, TrendingUp, TrendingDown, Minus, AlertCircle, Circle, Clock, CheckCircle2, Pause, SkipForward, Code, FileText, WrapText, Check, Copy, HelpCircle, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, GitBranch, Plus, Trash, ArrowLeft, Menu as Menu$1, AlertTriangle, Trash2, Eraser, ZoomOut, Download, Lightbulb, PauseCircle, Link2, Tag, User, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
|
|
10
10
|
import { useTranslate } from '@almadar/ui/hooks';
|
|
11
11
|
export * from '@almadar/ui/hooks';
|
|
12
12
|
import { evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
@@ -46172,133 +46172,6 @@ var init_SimulationCanvas = __esm({
|
|
|
46172
46172
|
SimulationCanvas.displayName = "SimulationCanvas";
|
|
46173
46173
|
}
|
|
46174
46174
|
});
|
|
46175
|
-
function SimulationControls({
|
|
46176
|
-
running,
|
|
46177
|
-
speed,
|
|
46178
|
-
parameters,
|
|
46179
|
-
onPlay,
|
|
46180
|
-
onPause,
|
|
46181
|
-
onStep,
|
|
46182
|
-
onReset,
|
|
46183
|
-
onSpeedChange,
|
|
46184
|
-
onParameterChange,
|
|
46185
|
-
className
|
|
46186
|
-
}) {
|
|
46187
|
-
return /* @__PURE__ */ jsxs(VStack, { gap: "md", className, children: [
|
|
46188
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
46189
|
-
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" }),
|
|
46190
|
-
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", onClick: onStep, icon: SkipForward, disabled: running, children: "Step" }),
|
|
46191
|
-
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", onClick: onReset, icon: RotateCcw, children: "Reset" })
|
|
46192
|
-
] }),
|
|
46193
|
-
/* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
46194
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", children: [
|
|
46195
|
-
"Speed: ",
|
|
46196
|
-
speed.toFixed(1),
|
|
46197
|
-
"x"
|
|
46198
|
-
] }),
|
|
46199
|
-
/* @__PURE__ */ jsx(
|
|
46200
|
-
"input",
|
|
46201
|
-
{
|
|
46202
|
-
type: "range",
|
|
46203
|
-
min: 0.1,
|
|
46204
|
-
max: 5,
|
|
46205
|
-
step: 0.1,
|
|
46206
|
-
value: speed,
|
|
46207
|
-
onChange: (e) => onSpeedChange(parseFloat(e.target.value)),
|
|
46208
|
-
className: "w-full"
|
|
46209
|
-
}
|
|
46210
|
-
)
|
|
46211
|
-
] }),
|
|
46212
|
-
Object.entries(parameters).map(([name, param]) => /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
46213
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", children: [
|
|
46214
|
-
param.label,
|
|
46215
|
-
": ",
|
|
46216
|
-
param.value.toFixed(2)
|
|
46217
|
-
] }),
|
|
46218
|
-
/* @__PURE__ */ jsx(
|
|
46219
|
-
"input",
|
|
46220
|
-
{
|
|
46221
|
-
type: "range",
|
|
46222
|
-
min: param.min,
|
|
46223
|
-
max: param.max,
|
|
46224
|
-
step: param.step,
|
|
46225
|
-
value: param.value,
|
|
46226
|
-
onChange: (e) => onParameterChange(name, parseFloat(e.target.value)),
|
|
46227
|
-
className: "w-full"
|
|
46228
|
-
}
|
|
46229
|
-
)
|
|
46230
|
-
] }, name))
|
|
46231
|
-
] });
|
|
46232
|
-
}
|
|
46233
|
-
var init_SimulationControls = __esm({
|
|
46234
|
-
"components/game/organisms/physics-sim/SimulationControls.tsx"() {
|
|
46235
|
-
init_atoms2();
|
|
46236
|
-
SimulationControls.displayName = "SimulationControls";
|
|
46237
|
-
}
|
|
46238
|
-
});
|
|
46239
|
-
function SimulationGraph({
|
|
46240
|
-
label,
|
|
46241
|
-
unit,
|
|
46242
|
-
data,
|
|
46243
|
-
maxPoints = 200,
|
|
46244
|
-
width = 300,
|
|
46245
|
-
height = 120,
|
|
46246
|
-
color = "#e94560",
|
|
46247
|
-
className
|
|
46248
|
-
}) {
|
|
46249
|
-
const canvasRef = useRef(null);
|
|
46250
|
-
const visibleData = data.slice(-maxPoints);
|
|
46251
|
-
useEffect(() => {
|
|
46252
|
-
const canvas = canvasRef.current;
|
|
46253
|
-
if (!canvas || visibleData.length < 2) return;
|
|
46254
|
-
const ctx = canvas.getContext("2d");
|
|
46255
|
-
if (!ctx) return;
|
|
46256
|
-
ctx.clearRect(0, 0, width, height);
|
|
46257
|
-
ctx.fillStyle = "#0f0f23";
|
|
46258
|
-
ctx.fillRect(0, 0, width, height);
|
|
46259
|
-
ctx.strokeStyle = "#1a1a3e";
|
|
46260
|
-
ctx.lineWidth = 0.5;
|
|
46261
|
-
for (let i = 0; i < 5; i++) {
|
|
46262
|
-
const y = height / 5 * i;
|
|
46263
|
-
ctx.beginPath();
|
|
46264
|
-
ctx.moveTo(0, y);
|
|
46265
|
-
ctx.lineTo(width, y);
|
|
46266
|
-
ctx.stroke();
|
|
46267
|
-
}
|
|
46268
|
-
let minVal = Infinity;
|
|
46269
|
-
let maxVal = -Infinity;
|
|
46270
|
-
for (const pt of visibleData) {
|
|
46271
|
-
if (pt.value < minVal) minVal = pt.value;
|
|
46272
|
-
if (pt.value > maxVal) maxVal = pt.value;
|
|
46273
|
-
}
|
|
46274
|
-
const range = maxVal - minVal || 1;
|
|
46275
|
-
const pad = height * 0.1;
|
|
46276
|
-
ctx.beginPath();
|
|
46277
|
-
ctx.strokeStyle = color;
|
|
46278
|
-
ctx.lineWidth = 2;
|
|
46279
|
-
for (let i = 0; i < visibleData.length; i++) {
|
|
46280
|
-
const x = i / (maxPoints - 1) * width;
|
|
46281
|
-
const y = pad + (maxVal - visibleData[i].value) / range * (height - 2 * pad);
|
|
46282
|
-
if (i === 0) ctx.moveTo(x, y);
|
|
46283
|
-
else ctx.lineTo(x, y);
|
|
46284
|
-
}
|
|
46285
|
-
ctx.stroke();
|
|
46286
|
-
const last = visibleData[visibleData.length - 1];
|
|
46287
|
-
ctx.fillStyle = color;
|
|
46288
|
-
ctx.font = "12px monospace";
|
|
46289
|
-
ctx.fillText(`${last.value.toFixed(2)} ${unit}`, width - 80, 16);
|
|
46290
|
-
}, [visibleData, width, height, color, unit, maxPoints]);
|
|
46291
|
-
return /* @__PURE__ */ jsx(Card, { padding: "sm", className, children: /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
46292
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", weight: "bold", children: label }),
|
|
46293
|
-
/* @__PURE__ */ jsx("canvas", { ref: canvasRef, width, height, className: "rounded" })
|
|
46294
|
-
] }) });
|
|
46295
|
-
}
|
|
46296
|
-
var init_SimulationGraph = __esm({
|
|
46297
|
-
"components/game/organisms/physics-sim/SimulationGraph.tsx"() {
|
|
46298
|
-
init_atoms2();
|
|
46299
|
-
SimulationGraph.displayName = "SimulationGraph";
|
|
46300
|
-
}
|
|
46301
|
-
});
|
|
46302
46175
|
function SimulatorBoard({
|
|
46303
46176
|
entity,
|
|
46304
46177
|
completeEvent = "PUZZLE_COMPLETE",
|
|
@@ -48832,7 +48705,6 @@ var init_component_registry_generated = __esm({
|
|
|
48832
48705
|
init_Navigation();
|
|
48833
48706
|
init_NegotiatorBoard();
|
|
48834
48707
|
init_NumberStepper();
|
|
48835
|
-
init_ObjectRulePanel();
|
|
48836
48708
|
init_OptionConstraintGroup();
|
|
48837
48709
|
init_OrbitalVisualization();
|
|
48838
48710
|
init_Overlay();
|
|
@@ -48863,7 +48735,6 @@ var init_component_registry_generated = __esm({
|
|
|
48863
48735
|
init_ResourceBar();
|
|
48864
48736
|
init_ResourceCounter();
|
|
48865
48737
|
init_RichBlockEditor();
|
|
48866
|
-
init_RuleEditor();
|
|
48867
48738
|
init_RuntimeDebugger2();
|
|
48868
48739
|
init_ScaledDiagram();
|
|
48869
48740
|
init_ScoreBoard();
|
|
@@ -48883,8 +48754,6 @@ var init_component_registry_generated = __esm({
|
|
|
48883
48754
|
init_SignaturePad();
|
|
48884
48755
|
init_SimpleGrid();
|
|
48885
48756
|
init_SimulationCanvas();
|
|
48886
|
-
init_SimulationControls();
|
|
48887
|
-
init_SimulationGraph();
|
|
48888
48757
|
init_SimulatorBoard();
|
|
48889
48758
|
init_Skeleton();
|
|
48890
48759
|
init_SocialProof();
|
|
@@ -48902,7 +48771,6 @@ var init_component_registry_generated = __esm({
|
|
|
48902
48771
|
init_StateArchitectBoard();
|
|
48903
48772
|
init_StateIndicator();
|
|
48904
48773
|
init_StateMachineView();
|
|
48905
|
-
init_StateNode();
|
|
48906
48774
|
init_StatsGrid();
|
|
48907
48775
|
init_StatsOrganism();
|
|
48908
48776
|
init_StatusDot();
|
|
@@ -48941,8 +48809,6 @@ var init_component_registry_generated = __esm({
|
|
|
48941
48809
|
init_Tooltip();
|
|
48942
48810
|
init_TraitFrame();
|
|
48943
48811
|
init_TraitSlot();
|
|
48944
|
-
init_TraitStateViewer();
|
|
48945
|
-
init_TransitionArrow();
|
|
48946
48812
|
init_TrendIndicator();
|
|
48947
48813
|
init_TurnIndicator();
|
|
48948
48814
|
init_TurnPanel();
|
|
@@ -48952,7 +48818,6 @@ var init_component_registry_generated = __esm({
|
|
|
48952
48818
|
init_UncontrolledBattleBoard();
|
|
48953
48819
|
init_UnitCommandBar();
|
|
48954
48820
|
init_UploadDropZone();
|
|
48955
|
-
init_VariablePanel();
|
|
48956
48821
|
init_VersionDiff();
|
|
48957
48822
|
init_ViolationAlert();
|
|
48958
48823
|
init_VoteStack();
|
|
@@ -49162,7 +49027,6 @@ var init_component_registry_generated = __esm({
|
|
|
49162
49027
|
"Navigation": Navigation,
|
|
49163
49028
|
"NegotiatorBoard": NegotiatorBoard,
|
|
49164
49029
|
"NumberStepper": NumberStepper,
|
|
49165
|
-
"ObjectRulePanel": ObjectRulePanel,
|
|
49166
49030
|
"OptionConstraintGroup": OptionConstraintGroup,
|
|
49167
49031
|
"OrbitalVisualization": OrbitalVisualization,
|
|
49168
49032
|
"Overlay": Overlay,
|
|
@@ -49193,7 +49057,6 @@ var init_component_registry_generated = __esm({
|
|
|
49193
49057
|
"ResourceBar": ResourceBar,
|
|
49194
49058
|
"ResourceCounter": ResourceCounter,
|
|
49195
49059
|
"RichBlockEditor": RichBlockEditor,
|
|
49196
|
-
"RuleEditor": RuleEditor,
|
|
49197
49060
|
"RuntimeDebugger": RuntimeDebugger,
|
|
49198
49061
|
"ScaledDiagram": ScaledDiagram,
|
|
49199
49062
|
"ScoreBoard": ScoreBoard,
|
|
@@ -49213,8 +49076,6 @@ var init_component_registry_generated = __esm({
|
|
|
49213
49076
|
"SignaturePad": SignaturePad,
|
|
49214
49077
|
"SimpleGrid": SimpleGrid,
|
|
49215
49078
|
"SimulationCanvas": SimulationCanvas,
|
|
49216
|
-
"SimulationControls": SimulationControls,
|
|
49217
|
-
"SimulationGraph": SimulationGraph,
|
|
49218
49079
|
"SimulatorBoard": SimulatorBoard,
|
|
49219
49080
|
"Skeleton": Skeleton,
|
|
49220
49081
|
"SocialProof": SocialProof,
|
|
@@ -49235,7 +49096,6 @@ var init_component_registry_generated = __esm({
|
|
|
49235
49096
|
"StateArchitectBoard": StateArchitectBoard,
|
|
49236
49097
|
"StateIndicator": StateIndicator,
|
|
49237
49098
|
"StateMachineView": StateMachineView,
|
|
49238
|
-
"StateNode": StateNode2,
|
|
49239
49099
|
"StatsGrid": StatsGrid,
|
|
49240
49100
|
"StatsOrganism": StatsOrganism,
|
|
49241
49101
|
"StatusDot": StatusDot,
|
|
@@ -49274,8 +49134,6 @@ var init_component_registry_generated = __esm({
|
|
|
49274
49134
|
"Tooltip": Tooltip,
|
|
49275
49135
|
"TraitFrame": TraitFrame,
|
|
49276
49136
|
"TraitSlot": TraitSlot,
|
|
49277
|
-
"TraitStateViewer": TraitStateViewer,
|
|
49278
|
-
"TransitionArrow": TransitionArrow,
|
|
49279
49137
|
"TrendIndicator": TrendIndicator,
|
|
49280
49138
|
"TurnIndicator": TurnIndicator,
|
|
49281
49139
|
"TurnPanel": TurnPanel,
|
|
@@ -49286,7 +49144,6 @@ var init_component_registry_generated = __esm({
|
|
|
49286
49144
|
"UnitCommandBar": UnitCommandBar,
|
|
49287
49145
|
"UploadDropZone": UploadDropZone,
|
|
49288
49146
|
"VStack": VStack,
|
|
49289
|
-
"VariablePanel": VariablePanel,
|
|
49290
49147
|
"VersionDiff": VersionDiff,
|
|
49291
49148
|
"ViolationAlert": ViolationAlert,
|
|
49292
49149
|
"VoteStack": VoteStack,
|
|
@@ -51050,8 +50907,131 @@ init_NegotiatorBoard();
|
|
|
51050
50907
|
|
|
51051
50908
|
// components/game/organisms/physics-sim/index.ts
|
|
51052
50909
|
init_SimulationCanvas();
|
|
51053
|
-
|
|
51054
|
-
|
|
50910
|
+
|
|
50911
|
+
// components/game/organisms/physics-sim/SimulationControls.tsx
|
|
50912
|
+
init_atoms2();
|
|
50913
|
+
function SimulationControls({
|
|
50914
|
+
running,
|
|
50915
|
+
speed,
|
|
50916
|
+
parameters,
|
|
50917
|
+
onPlay,
|
|
50918
|
+
onPause,
|
|
50919
|
+
onStep,
|
|
50920
|
+
onReset,
|
|
50921
|
+
onSpeedChange,
|
|
50922
|
+
onParameterChange,
|
|
50923
|
+
className
|
|
50924
|
+
}) {
|
|
50925
|
+
return /* @__PURE__ */ jsxs(VStack, { gap: "md", className, children: [
|
|
50926
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
50927
|
+
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" }),
|
|
50928
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", onClick: onStep, icon: SkipForward, disabled: running, children: "Step" }),
|
|
50929
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", onClick: onReset, icon: RotateCcw, children: "Reset" })
|
|
50930
|
+
] }),
|
|
50931
|
+
/* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
50932
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", children: [
|
|
50933
|
+
"Speed: ",
|
|
50934
|
+
speed.toFixed(1),
|
|
50935
|
+
"x"
|
|
50936
|
+
] }),
|
|
50937
|
+
/* @__PURE__ */ jsx(
|
|
50938
|
+
"input",
|
|
50939
|
+
{
|
|
50940
|
+
type: "range",
|
|
50941
|
+
min: 0.1,
|
|
50942
|
+
max: 5,
|
|
50943
|
+
step: 0.1,
|
|
50944
|
+
value: speed,
|
|
50945
|
+
onChange: (e) => onSpeedChange(parseFloat(e.target.value)),
|
|
50946
|
+
className: "w-full"
|
|
50947
|
+
}
|
|
50948
|
+
)
|
|
50949
|
+
] }),
|
|
50950
|
+
Object.entries(parameters).map(([name, param]) => /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
50951
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", children: [
|
|
50952
|
+
param.label,
|
|
50953
|
+
": ",
|
|
50954
|
+
param.value.toFixed(2)
|
|
50955
|
+
] }),
|
|
50956
|
+
/* @__PURE__ */ jsx(
|
|
50957
|
+
"input",
|
|
50958
|
+
{
|
|
50959
|
+
type: "range",
|
|
50960
|
+
min: param.min,
|
|
50961
|
+
max: param.max,
|
|
50962
|
+
step: param.step,
|
|
50963
|
+
value: param.value,
|
|
50964
|
+
onChange: (e) => onParameterChange(name, parseFloat(e.target.value)),
|
|
50965
|
+
className: "w-full"
|
|
50966
|
+
}
|
|
50967
|
+
)
|
|
50968
|
+
] }, name))
|
|
50969
|
+
] });
|
|
50970
|
+
}
|
|
50971
|
+
SimulationControls.displayName = "SimulationControls";
|
|
50972
|
+
|
|
50973
|
+
// components/game/organisms/physics-sim/SimulationGraph.tsx
|
|
50974
|
+
init_atoms2();
|
|
50975
|
+
function SimulationGraph({
|
|
50976
|
+
label,
|
|
50977
|
+
unit,
|
|
50978
|
+
data,
|
|
50979
|
+
maxPoints = 200,
|
|
50980
|
+
width = 300,
|
|
50981
|
+
height = 120,
|
|
50982
|
+
color = "#e94560",
|
|
50983
|
+
className
|
|
50984
|
+
}) {
|
|
50985
|
+
const canvasRef = useRef(null);
|
|
50986
|
+
const visibleData = data.slice(-maxPoints);
|
|
50987
|
+
useEffect(() => {
|
|
50988
|
+
const canvas = canvasRef.current;
|
|
50989
|
+
if (!canvas || visibleData.length < 2) return;
|
|
50990
|
+
const ctx = canvas.getContext("2d");
|
|
50991
|
+
if (!ctx) return;
|
|
50992
|
+
ctx.clearRect(0, 0, width, height);
|
|
50993
|
+
ctx.fillStyle = "#0f0f23";
|
|
50994
|
+
ctx.fillRect(0, 0, width, height);
|
|
50995
|
+
ctx.strokeStyle = "#1a1a3e";
|
|
50996
|
+
ctx.lineWidth = 0.5;
|
|
50997
|
+
for (let i = 0; i < 5; i++) {
|
|
50998
|
+
const y = height / 5 * i;
|
|
50999
|
+
ctx.beginPath();
|
|
51000
|
+
ctx.moveTo(0, y);
|
|
51001
|
+
ctx.lineTo(width, y);
|
|
51002
|
+
ctx.stroke();
|
|
51003
|
+
}
|
|
51004
|
+
let minVal = Infinity;
|
|
51005
|
+
let maxVal = -Infinity;
|
|
51006
|
+
for (const pt of visibleData) {
|
|
51007
|
+
if (pt.value < minVal) minVal = pt.value;
|
|
51008
|
+
if (pt.value > maxVal) maxVal = pt.value;
|
|
51009
|
+
}
|
|
51010
|
+
const range = maxVal - minVal || 1;
|
|
51011
|
+
const pad = height * 0.1;
|
|
51012
|
+
ctx.beginPath();
|
|
51013
|
+
ctx.strokeStyle = color;
|
|
51014
|
+
ctx.lineWidth = 2;
|
|
51015
|
+
for (let i = 0; i < visibleData.length; i++) {
|
|
51016
|
+
const x = i / (maxPoints - 1) * width;
|
|
51017
|
+
const y = pad + (maxVal - visibleData[i].value) / range * (height - 2 * pad);
|
|
51018
|
+
if (i === 0) ctx.moveTo(x, y);
|
|
51019
|
+
else ctx.lineTo(x, y);
|
|
51020
|
+
}
|
|
51021
|
+
ctx.stroke();
|
|
51022
|
+
const last = visibleData[visibleData.length - 1];
|
|
51023
|
+
ctx.fillStyle = color;
|
|
51024
|
+
ctx.font = "12px monospace";
|
|
51025
|
+
ctx.fillText(`${last.value.toFixed(2)} ${unit}`, width - 80, 16);
|
|
51026
|
+
}, [visibleData, width, height, color, unit, maxPoints]);
|
|
51027
|
+
return /* @__PURE__ */ jsx(Card, { padding: "sm", className, children: /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
51028
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", weight: "bold", children: label }),
|
|
51029
|
+
/* @__PURE__ */ jsx("canvas", { ref: canvasRef, width, height, className: "rounded" })
|
|
51030
|
+
] }) });
|
|
51031
|
+
}
|
|
51032
|
+
SimulationGraph.displayName = "SimulationGraph";
|
|
51033
|
+
|
|
51034
|
+
// components/game/organisms/physics-sim/index.ts
|
|
51055
51035
|
init_presets();
|
|
51056
51036
|
|
|
51057
51037
|
// components/game/organisms/types/game.ts
|
package/dist/providers/index.cjs
CHANGED
|
@@ -29377,13 +29377,13 @@ var init_MapView = __esm({
|
|
|
29377
29377
|
shadowSize: [41, 41]
|
|
29378
29378
|
});
|
|
29379
29379
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
29380
|
-
const { useEffect:
|
|
29380
|
+
const { useEffect: useEffect73, useRef: useRef68, useCallback: useCallback112, useState: useState104 } = React83__namespace.default;
|
|
29381
29381
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
29382
29382
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
29383
29383
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
29384
29384
|
const map = useMap();
|
|
29385
|
-
const prevRef =
|
|
29386
|
-
|
|
29385
|
+
const prevRef = useRef68({ centerLat, centerLng, zoom });
|
|
29386
|
+
useEffect73(() => {
|
|
29387
29387
|
const prev = prevRef.current;
|
|
29388
29388
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
29389
29389
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -29394,7 +29394,7 @@ var init_MapView = __esm({
|
|
|
29394
29394
|
}
|
|
29395
29395
|
function MapClickHandler({ onMapClick }) {
|
|
29396
29396
|
const map = useMap();
|
|
29397
|
-
|
|
29397
|
+
useEffect73(() => {
|
|
29398
29398
|
if (!onMapClick) return;
|
|
29399
29399
|
const handler = (e) => {
|
|
29400
29400
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -34431,7 +34431,7 @@ var init_RichBlockEditor = __esm({
|
|
|
34431
34431
|
"border-b border-border bg-muted/30 px-2 py-2"
|
|
34432
34432
|
),
|
|
34433
34433
|
children: TOOLBAR_ENTRIES.map((entry) => {
|
|
34434
|
-
const
|
|
34434
|
+
const Icon2 = entry.icon;
|
|
34435
34435
|
const entryLabel = t(entry.labelKey);
|
|
34436
34436
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
34437
34437
|
Button,
|
|
@@ -34443,7 +34443,7 @@ var init_RichBlockEditor = __esm({
|
|
|
34443
34443
|
title: entryLabel,
|
|
34444
34444
|
onClick: () => handleAppend(entry.type),
|
|
34445
34445
|
children: [
|
|
34446
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
34446
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { size: 14 }),
|
|
34447
34447
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { as: "span", variant: "caption", className: "ml-1 hidden text-xs sm:inline", children: entryLabel })
|
|
34448
34448
|
]
|
|
34449
34449
|
},
|
|
@@ -45493,133 +45493,6 @@ var init_SimulationCanvas = __esm({
|
|
|
45493
45493
|
SimulationCanvas.displayName = "SimulationCanvas";
|
|
45494
45494
|
}
|
|
45495
45495
|
});
|
|
45496
|
-
function SimulationControls({
|
|
45497
|
-
running,
|
|
45498
|
-
speed,
|
|
45499
|
-
parameters,
|
|
45500
|
-
onPlay,
|
|
45501
|
-
onPause,
|
|
45502
|
-
onStep,
|
|
45503
|
-
onReset,
|
|
45504
|
-
onSpeedChange,
|
|
45505
|
-
onParameterChange,
|
|
45506
|
-
className
|
|
45507
|
-
}) {
|
|
45508
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "md", className, children: [
|
|
45509
|
-
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
45510
|
-
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" }),
|
|
45511
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", variant: "ghost", onClick: onStep, icon: LucideIcons2.SkipForward, disabled: running, children: "Step" }),
|
|
45512
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", variant: "ghost", onClick: onReset, icon: LucideIcons2.RotateCcw, children: "Reset" })
|
|
45513
|
-
] }),
|
|
45514
|
-
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
|
|
45515
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "caption", color: "muted", children: [
|
|
45516
|
-
"Speed: ",
|
|
45517
|
-
speed.toFixed(1),
|
|
45518
|
-
"x"
|
|
45519
|
-
] }),
|
|
45520
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
45521
|
-
"input",
|
|
45522
|
-
{
|
|
45523
|
-
type: "range",
|
|
45524
|
-
min: 0.1,
|
|
45525
|
-
max: 5,
|
|
45526
|
-
step: 0.1,
|
|
45527
|
-
value: speed,
|
|
45528
|
-
onChange: (e) => onSpeedChange(parseFloat(e.target.value)),
|
|
45529
|
-
className: "w-full"
|
|
45530
|
-
}
|
|
45531
|
-
)
|
|
45532
|
-
] }),
|
|
45533
|
-
Object.entries(parameters).map(([name, param]) => /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
|
|
45534
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "caption", color: "muted", children: [
|
|
45535
|
-
param.label,
|
|
45536
|
-
": ",
|
|
45537
|
-
param.value.toFixed(2)
|
|
45538
|
-
] }),
|
|
45539
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
45540
|
-
"input",
|
|
45541
|
-
{
|
|
45542
|
-
type: "range",
|
|
45543
|
-
min: param.min,
|
|
45544
|
-
max: param.max,
|
|
45545
|
-
step: param.step,
|
|
45546
|
-
value: param.value,
|
|
45547
|
-
onChange: (e) => onParameterChange(name, parseFloat(e.target.value)),
|
|
45548
|
-
className: "w-full"
|
|
45549
|
-
}
|
|
45550
|
-
)
|
|
45551
|
-
] }, name))
|
|
45552
|
-
] });
|
|
45553
|
-
}
|
|
45554
|
-
var init_SimulationControls = __esm({
|
|
45555
|
-
"components/game/organisms/physics-sim/SimulationControls.tsx"() {
|
|
45556
|
-
init_atoms2();
|
|
45557
|
-
SimulationControls.displayName = "SimulationControls";
|
|
45558
|
-
}
|
|
45559
|
-
});
|
|
45560
|
-
function SimulationGraph({
|
|
45561
|
-
label,
|
|
45562
|
-
unit,
|
|
45563
|
-
data,
|
|
45564
|
-
maxPoints = 200,
|
|
45565
|
-
width = 300,
|
|
45566
|
-
height = 120,
|
|
45567
|
-
color = "#e94560",
|
|
45568
|
-
className
|
|
45569
|
-
}) {
|
|
45570
|
-
const canvasRef = React83.useRef(null);
|
|
45571
|
-
const visibleData = data.slice(-maxPoints);
|
|
45572
|
-
React83.useEffect(() => {
|
|
45573
|
-
const canvas = canvasRef.current;
|
|
45574
|
-
if (!canvas || visibleData.length < 2) return;
|
|
45575
|
-
const ctx = canvas.getContext("2d");
|
|
45576
|
-
if (!ctx) return;
|
|
45577
|
-
ctx.clearRect(0, 0, width, height);
|
|
45578
|
-
ctx.fillStyle = "#0f0f23";
|
|
45579
|
-
ctx.fillRect(0, 0, width, height);
|
|
45580
|
-
ctx.strokeStyle = "#1a1a3e";
|
|
45581
|
-
ctx.lineWidth = 0.5;
|
|
45582
|
-
for (let i = 0; i < 5; i++) {
|
|
45583
|
-
const y = height / 5 * i;
|
|
45584
|
-
ctx.beginPath();
|
|
45585
|
-
ctx.moveTo(0, y);
|
|
45586
|
-
ctx.lineTo(width, y);
|
|
45587
|
-
ctx.stroke();
|
|
45588
|
-
}
|
|
45589
|
-
let minVal = Infinity;
|
|
45590
|
-
let maxVal = -Infinity;
|
|
45591
|
-
for (const pt of visibleData) {
|
|
45592
|
-
if (pt.value < minVal) minVal = pt.value;
|
|
45593
|
-
if (pt.value > maxVal) maxVal = pt.value;
|
|
45594
|
-
}
|
|
45595
|
-
const range = maxVal - minVal || 1;
|
|
45596
|
-
const pad = height * 0.1;
|
|
45597
|
-
ctx.beginPath();
|
|
45598
|
-
ctx.strokeStyle = color;
|
|
45599
|
-
ctx.lineWidth = 2;
|
|
45600
|
-
for (let i = 0; i < visibleData.length; i++) {
|
|
45601
|
-
const x = i / (maxPoints - 1) * width;
|
|
45602
|
-
const y = pad + (maxVal - visibleData[i].value) / range * (height - 2 * pad);
|
|
45603
|
-
if (i === 0) ctx.moveTo(x, y);
|
|
45604
|
-
else ctx.lineTo(x, y);
|
|
45605
|
-
}
|
|
45606
|
-
ctx.stroke();
|
|
45607
|
-
const last = visibleData[visibleData.length - 1];
|
|
45608
|
-
ctx.fillStyle = color;
|
|
45609
|
-
ctx.font = "12px monospace";
|
|
45610
|
-
ctx.fillText(`${last.value.toFixed(2)} ${unit}`, width - 80, 16);
|
|
45611
|
-
}, [visibleData, width, height, color, unit, maxPoints]);
|
|
45612
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Card, { padding: "sm", className, children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
|
|
45613
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", weight: "bold", children: label }),
|
|
45614
|
-
/* @__PURE__ */ jsxRuntime.jsx("canvas", { ref: canvasRef, width, height, className: "rounded" })
|
|
45615
|
-
] }) });
|
|
45616
|
-
}
|
|
45617
|
-
var init_SimulationGraph = __esm({
|
|
45618
|
-
"components/game/organisms/physics-sim/SimulationGraph.tsx"() {
|
|
45619
|
-
init_atoms2();
|
|
45620
|
-
SimulationGraph.displayName = "SimulationGraph";
|
|
45621
|
-
}
|
|
45622
|
-
});
|
|
45623
45496
|
function SimulatorBoard({
|
|
45624
45497
|
entity,
|
|
45625
45498
|
completeEvent = "PUZZLE_COMPLETE",
|
|
@@ -45890,7 +45763,7 @@ var init_StatCard = __esm({
|
|
|
45890
45763
|
isLoading: externalLoading,
|
|
45891
45764
|
error: externalError
|
|
45892
45765
|
}) => {
|
|
45893
|
-
const
|
|
45766
|
+
const Icon2 = typeof iconProp === "string" ? resolveIcon(iconProp) ?? void 0 : iconProp;
|
|
45894
45767
|
const labelToUse = propLabel ?? propTitle;
|
|
45895
45768
|
const eventBus = useEventBus();
|
|
45896
45769
|
const { t } = hooks.useTranslate();
|
|
@@ -46033,7 +45906,7 @@ var init_StatCard = __esm({
|
|
|
46033
45906
|
subtitle && !calculatedTrend && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", color: "secondary", children: subtitle })
|
|
46034
45907
|
] }),
|
|
46035
45908
|
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", align: "end", children: [
|
|
46036
|
-
|
|
45909
|
+
Icon2 && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("p-3", iconBg), children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: cn("h-6 w-6", iconColor) }) }),
|
|
46037
45910
|
sparklineData && sparklineData.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(Sparkline, { data: sparklineData, color: "auto" })
|
|
46038
45911
|
] })
|
|
46039
45912
|
] }),
|
|
@@ -47836,7 +47709,6 @@ var init_component_registry_generated = __esm({
|
|
|
47836
47709
|
init_Navigation();
|
|
47837
47710
|
init_NegotiatorBoard();
|
|
47838
47711
|
init_NumberStepper();
|
|
47839
|
-
init_ObjectRulePanel();
|
|
47840
47712
|
init_OptionConstraintGroup();
|
|
47841
47713
|
init_OrbitalVisualization();
|
|
47842
47714
|
init_Overlay();
|
|
@@ -47867,7 +47739,6 @@ var init_component_registry_generated = __esm({
|
|
|
47867
47739
|
init_ResourceBar();
|
|
47868
47740
|
init_ResourceCounter();
|
|
47869
47741
|
init_RichBlockEditor();
|
|
47870
|
-
init_RuleEditor();
|
|
47871
47742
|
init_RuntimeDebugger2();
|
|
47872
47743
|
init_ScaledDiagram();
|
|
47873
47744
|
init_ScoreBoard();
|
|
@@ -47887,8 +47758,6 @@ var init_component_registry_generated = __esm({
|
|
|
47887
47758
|
init_SignaturePad();
|
|
47888
47759
|
init_SimpleGrid();
|
|
47889
47760
|
init_SimulationCanvas();
|
|
47890
|
-
init_SimulationControls();
|
|
47891
|
-
init_SimulationGraph();
|
|
47892
47761
|
init_SimulatorBoard();
|
|
47893
47762
|
init_Skeleton();
|
|
47894
47763
|
init_SocialProof();
|
|
@@ -47906,7 +47775,6 @@ var init_component_registry_generated = __esm({
|
|
|
47906
47775
|
init_StateArchitectBoard();
|
|
47907
47776
|
init_StateIndicator();
|
|
47908
47777
|
init_StateMachineView();
|
|
47909
|
-
init_StateNode();
|
|
47910
47778
|
init_StatsGrid();
|
|
47911
47779
|
init_StatsOrganism();
|
|
47912
47780
|
init_StatusDot();
|
|
@@ -47945,8 +47813,6 @@ var init_component_registry_generated = __esm({
|
|
|
47945
47813
|
init_Tooltip();
|
|
47946
47814
|
init_TraitFrame();
|
|
47947
47815
|
init_TraitSlot();
|
|
47948
|
-
init_TraitStateViewer();
|
|
47949
|
-
init_TransitionArrow();
|
|
47950
47816
|
init_TrendIndicator();
|
|
47951
47817
|
init_TurnIndicator();
|
|
47952
47818
|
init_TurnPanel();
|
|
@@ -47956,7 +47822,6 @@ var init_component_registry_generated = __esm({
|
|
|
47956
47822
|
init_UncontrolledBattleBoard();
|
|
47957
47823
|
init_UnitCommandBar();
|
|
47958
47824
|
init_UploadDropZone();
|
|
47959
|
-
init_VariablePanel();
|
|
47960
47825
|
init_VersionDiff();
|
|
47961
47826
|
init_ViolationAlert();
|
|
47962
47827
|
init_VoteStack();
|
|
@@ -48166,7 +48031,6 @@ var init_component_registry_generated = __esm({
|
|
|
48166
48031
|
"Navigation": Navigation,
|
|
48167
48032
|
"NegotiatorBoard": NegotiatorBoard,
|
|
48168
48033
|
"NumberStepper": NumberStepper,
|
|
48169
|
-
"ObjectRulePanel": ObjectRulePanel,
|
|
48170
48034
|
"OptionConstraintGroup": OptionConstraintGroup,
|
|
48171
48035
|
"OrbitalVisualization": OrbitalVisualization,
|
|
48172
48036
|
"Overlay": Overlay,
|
|
@@ -48197,7 +48061,6 @@ var init_component_registry_generated = __esm({
|
|
|
48197
48061
|
"ResourceBar": ResourceBar,
|
|
48198
48062
|
"ResourceCounter": ResourceCounter,
|
|
48199
48063
|
"RichBlockEditor": RichBlockEditor,
|
|
48200
|
-
"RuleEditor": RuleEditor,
|
|
48201
48064
|
"RuntimeDebugger": RuntimeDebugger,
|
|
48202
48065
|
"ScaledDiagram": ScaledDiagram,
|
|
48203
48066
|
"ScoreBoard": ScoreBoard,
|
|
@@ -48217,8 +48080,6 @@ var init_component_registry_generated = __esm({
|
|
|
48217
48080
|
"SignaturePad": SignaturePad,
|
|
48218
48081
|
"SimpleGrid": SimpleGrid,
|
|
48219
48082
|
"SimulationCanvas": SimulationCanvas,
|
|
48220
|
-
"SimulationControls": SimulationControls,
|
|
48221
|
-
"SimulationGraph": SimulationGraph,
|
|
48222
48083
|
"SimulatorBoard": SimulatorBoard,
|
|
48223
48084
|
"Skeleton": Skeleton,
|
|
48224
48085
|
"SocialProof": SocialProof,
|
|
@@ -48239,7 +48100,6 @@ var init_component_registry_generated = __esm({
|
|
|
48239
48100
|
"StateArchitectBoard": StateArchitectBoard,
|
|
48240
48101
|
"StateIndicator": StateIndicator,
|
|
48241
48102
|
"StateMachineView": StateMachineView,
|
|
48242
|
-
"StateNode": StateNode2,
|
|
48243
48103
|
"StatsGrid": StatsGrid,
|
|
48244
48104
|
"StatsOrganism": StatsOrganism,
|
|
48245
48105
|
"StatusDot": StatusDot,
|
|
@@ -48278,8 +48138,6 @@ var init_component_registry_generated = __esm({
|
|
|
48278
48138
|
"Tooltip": Tooltip,
|
|
48279
48139
|
"TraitFrame": TraitFrame,
|
|
48280
48140
|
"TraitSlot": TraitSlot,
|
|
48281
|
-
"TraitStateViewer": TraitStateViewer,
|
|
48282
|
-
"TransitionArrow": TransitionArrow,
|
|
48283
48141
|
"TrendIndicator": TrendIndicator,
|
|
48284
48142
|
"TurnIndicator": TurnIndicator,
|
|
48285
48143
|
"TurnPanel": TurnPanel,
|
|
@@ -48290,7 +48148,6 @@ var init_component_registry_generated = __esm({
|
|
|
48290
48148
|
"UnitCommandBar": UnitCommandBar,
|
|
48291
48149
|
"UploadDropZone": UploadDropZone,
|
|
48292
48150
|
"VStack": VStack,
|
|
48293
|
-
"VariablePanel": VariablePanel,
|
|
48294
48151
|
"VersionDiff": VersionDiff,
|
|
48295
48152
|
"ViolationAlert": ViolationAlert,
|
|
48296
48153
|
"VoteStack": VoteStack,
|