@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/runtime/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
6
6
|
import { EventBusContext, useTraitScope, OrbitalProvider, TraitScopeProvider, VerificationProvider } from '@almadar/ui/providers';
|
|
7
7
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
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, useEventBus as useEventBus$1 } from '@almadar/ui/hooks';
|
|
12
12
|
import { evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
@@ -28898,13 +28898,13 @@ var init_MapView = __esm({
|
|
|
28898
28898
|
shadowSize: [41, 41]
|
|
28899
28899
|
});
|
|
28900
28900
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
28901
|
-
const { useEffect:
|
|
28901
|
+
const { useEffect: useEffect74, useRef: useRef68, useCallback: useCallback112, useState: useState107 } = React82__default;
|
|
28902
28902
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
28903
28903
|
const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
28904
28904
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
28905
28905
|
const map = useMap();
|
|
28906
|
-
const prevRef =
|
|
28907
|
-
|
|
28906
|
+
const prevRef = useRef68({ centerLat, centerLng, zoom });
|
|
28907
|
+
useEffect74(() => {
|
|
28908
28908
|
const prev = prevRef.current;
|
|
28909
28909
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
28910
28910
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -28915,7 +28915,7 @@ var init_MapView = __esm({
|
|
|
28915
28915
|
}
|
|
28916
28916
|
function MapClickHandler({ onMapClick }) {
|
|
28917
28917
|
const map = useMap();
|
|
28918
|
-
|
|
28918
|
+
useEffect74(() => {
|
|
28919
28919
|
if (!onMapClick) return;
|
|
28920
28920
|
const handler = (e) => {
|
|
28921
28921
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -33952,7 +33952,7 @@ var init_RichBlockEditor = __esm({
|
|
|
33952
33952
|
"border-b border-border bg-muted/30 px-2 py-2"
|
|
33953
33953
|
),
|
|
33954
33954
|
children: TOOLBAR_ENTRIES.map((entry) => {
|
|
33955
|
-
const
|
|
33955
|
+
const Icon2 = entry.icon;
|
|
33956
33956
|
const entryLabel = t(entry.labelKey);
|
|
33957
33957
|
return /* @__PURE__ */ jsxs(
|
|
33958
33958
|
Button,
|
|
@@ -33964,7 +33964,7 @@ var init_RichBlockEditor = __esm({
|
|
|
33964
33964
|
title: entryLabel,
|
|
33965
33965
|
onClick: () => handleAppend(entry.type),
|
|
33966
33966
|
children: [
|
|
33967
|
-
/* @__PURE__ */ jsx(
|
|
33967
|
+
/* @__PURE__ */ jsx(Icon2, { size: 14 }),
|
|
33968
33968
|
/* @__PURE__ */ jsx(Typography, { as: "span", variant: "caption", className: "ml-1 hidden text-xs sm:inline", children: entryLabel })
|
|
33969
33969
|
]
|
|
33970
33970
|
},
|
|
@@ -45033,133 +45033,6 @@ var init_SimulationCanvas = __esm({
|
|
|
45033
45033
|
SimulationCanvas.displayName = "SimulationCanvas";
|
|
45034
45034
|
}
|
|
45035
45035
|
});
|
|
45036
|
-
function SimulationControls({
|
|
45037
|
-
running,
|
|
45038
|
-
speed,
|
|
45039
|
-
parameters,
|
|
45040
|
-
onPlay,
|
|
45041
|
-
onPause,
|
|
45042
|
-
onStep,
|
|
45043
|
-
onReset,
|
|
45044
|
-
onSpeedChange,
|
|
45045
|
-
onParameterChange,
|
|
45046
|
-
className
|
|
45047
|
-
}) {
|
|
45048
|
-
return /* @__PURE__ */ jsxs(VStack, { gap: "md", className, children: [
|
|
45049
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
45050
|
-
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" }),
|
|
45051
|
-
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", onClick: onStep, icon: SkipForward, disabled: running, children: "Step" }),
|
|
45052
|
-
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", onClick: onReset, icon: RotateCcw, children: "Reset" })
|
|
45053
|
-
] }),
|
|
45054
|
-
/* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
45055
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", children: [
|
|
45056
|
-
"Speed: ",
|
|
45057
|
-
speed.toFixed(1),
|
|
45058
|
-
"x"
|
|
45059
|
-
] }),
|
|
45060
|
-
/* @__PURE__ */ jsx(
|
|
45061
|
-
"input",
|
|
45062
|
-
{
|
|
45063
|
-
type: "range",
|
|
45064
|
-
min: 0.1,
|
|
45065
|
-
max: 5,
|
|
45066
|
-
step: 0.1,
|
|
45067
|
-
value: speed,
|
|
45068
|
-
onChange: (e) => onSpeedChange(parseFloat(e.target.value)),
|
|
45069
|
-
className: "w-full"
|
|
45070
|
-
}
|
|
45071
|
-
)
|
|
45072
|
-
] }),
|
|
45073
|
-
Object.entries(parameters).map(([name, param]) => /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
45074
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", children: [
|
|
45075
|
-
param.label,
|
|
45076
|
-
": ",
|
|
45077
|
-
param.value.toFixed(2)
|
|
45078
|
-
] }),
|
|
45079
|
-
/* @__PURE__ */ jsx(
|
|
45080
|
-
"input",
|
|
45081
|
-
{
|
|
45082
|
-
type: "range",
|
|
45083
|
-
min: param.min,
|
|
45084
|
-
max: param.max,
|
|
45085
|
-
step: param.step,
|
|
45086
|
-
value: param.value,
|
|
45087
|
-
onChange: (e) => onParameterChange(name, parseFloat(e.target.value)),
|
|
45088
|
-
className: "w-full"
|
|
45089
|
-
}
|
|
45090
|
-
)
|
|
45091
|
-
] }, name))
|
|
45092
|
-
] });
|
|
45093
|
-
}
|
|
45094
|
-
var init_SimulationControls = __esm({
|
|
45095
|
-
"components/game/organisms/physics-sim/SimulationControls.tsx"() {
|
|
45096
|
-
init_atoms2();
|
|
45097
|
-
SimulationControls.displayName = "SimulationControls";
|
|
45098
|
-
}
|
|
45099
|
-
});
|
|
45100
|
-
function SimulationGraph({
|
|
45101
|
-
label,
|
|
45102
|
-
unit,
|
|
45103
|
-
data,
|
|
45104
|
-
maxPoints = 200,
|
|
45105
|
-
width = 300,
|
|
45106
|
-
height = 120,
|
|
45107
|
-
color = "#e94560",
|
|
45108
|
-
className
|
|
45109
|
-
}) {
|
|
45110
|
-
const canvasRef = useRef(null);
|
|
45111
|
-
const visibleData = data.slice(-maxPoints);
|
|
45112
|
-
useEffect(() => {
|
|
45113
|
-
const canvas = canvasRef.current;
|
|
45114
|
-
if (!canvas || visibleData.length < 2) return;
|
|
45115
|
-
const ctx = canvas.getContext("2d");
|
|
45116
|
-
if (!ctx) return;
|
|
45117
|
-
ctx.clearRect(0, 0, width, height);
|
|
45118
|
-
ctx.fillStyle = "#0f0f23";
|
|
45119
|
-
ctx.fillRect(0, 0, width, height);
|
|
45120
|
-
ctx.strokeStyle = "#1a1a3e";
|
|
45121
|
-
ctx.lineWidth = 0.5;
|
|
45122
|
-
for (let i = 0; i < 5; i++) {
|
|
45123
|
-
const y = height / 5 * i;
|
|
45124
|
-
ctx.beginPath();
|
|
45125
|
-
ctx.moveTo(0, y);
|
|
45126
|
-
ctx.lineTo(width, y);
|
|
45127
|
-
ctx.stroke();
|
|
45128
|
-
}
|
|
45129
|
-
let minVal = Infinity;
|
|
45130
|
-
let maxVal = -Infinity;
|
|
45131
|
-
for (const pt of visibleData) {
|
|
45132
|
-
if (pt.value < minVal) minVal = pt.value;
|
|
45133
|
-
if (pt.value > maxVal) maxVal = pt.value;
|
|
45134
|
-
}
|
|
45135
|
-
const range = maxVal - minVal || 1;
|
|
45136
|
-
const pad = height * 0.1;
|
|
45137
|
-
ctx.beginPath();
|
|
45138
|
-
ctx.strokeStyle = color;
|
|
45139
|
-
ctx.lineWidth = 2;
|
|
45140
|
-
for (let i = 0; i < visibleData.length; i++) {
|
|
45141
|
-
const x = i / (maxPoints - 1) * width;
|
|
45142
|
-
const y = pad + (maxVal - visibleData[i].value) / range * (height - 2 * pad);
|
|
45143
|
-
if (i === 0) ctx.moveTo(x, y);
|
|
45144
|
-
else ctx.lineTo(x, y);
|
|
45145
|
-
}
|
|
45146
|
-
ctx.stroke();
|
|
45147
|
-
const last = visibleData[visibleData.length - 1];
|
|
45148
|
-
ctx.fillStyle = color;
|
|
45149
|
-
ctx.font = "12px monospace";
|
|
45150
|
-
ctx.fillText(`${last.value.toFixed(2)} ${unit}`, width - 80, 16);
|
|
45151
|
-
}, [visibleData, width, height, color, unit, maxPoints]);
|
|
45152
|
-
return /* @__PURE__ */ jsx(Card, { padding: "sm", className, children: /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
45153
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", weight: "bold", children: label }),
|
|
45154
|
-
/* @__PURE__ */ jsx("canvas", { ref: canvasRef, width, height, className: "rounded" })
|
|
45155
|
-
] }) });
|
|
45156
|
-
}
|
|
45157
|
-
var init_SimulationGraph = __esm({
|
|
45158
|
-
"components/game/organisms/physics-sim/SimulationGraph.tsx"() {
|
|
45159
|
-
init_atoms2();
|
|
45160
|
-
SimulationGraph.displayName = "SimulationGraph";
|
|
45161
|
-
}
|
|
45162
|
-
});
|
|
45163
45036
|
function SimulatorBoard({
|
|
45164
45037
|
entity,
|
|
45165
45038
|
completeEvent = "PUZZLE_COMPLETE",
|
|
@@ -45430,7 +45303,7 @@ var init_StatCard = __esm({
|
|
|
45430
45303
|
isLoading: externalLoading,
|
|
45431
45304
|
error: externalError
|
|
45432
45305
|
}) => {
|
|
45433
|
-
const
|
|
45306
|
+
const Icon2 = typeof iconProp === "string" ? resolveIcon(iconProp) ?? void 0 : iconProp;
|
|
45434
45307
|
const labelToUse = propLabel ?? propTitle;
|
|
45435
45308
|
const eventBus = useEventBus();
|
|
45436
45309
|
const { t } = useTranslate();
|
|
@@ -45573,7 +45446,7 @@ var init_StatCard = __esm({
|
|
|
45573
45446
|
subtitle && !calculatedTrend && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "secondary", children: subtitle })
|
|
45574
45447
|
] }),
|
|
45575
45448
|
/* @__PURE__ */ jsxs(VStack, { gap: "xs", align: "end", children: [
|
|
45576
|
-
|
|
45449
|
+
Icon2 && /* @__PURE__ */ jsx(Box, { className: cn("p-3", iconBg), children: /* @__PURE__ */ jsx(Icon2, { className: cn("h-6 w-6", iconColor) }) }),
|
|
45577
45450
|
sparklineData && sparklineData.length > 1 && /* @__PURE__ */ jsx(Sparkline, { data: sparklineData, color: "auto" })
|
|
45578
45451
|
] })
|
|
45579
45452
|
] }),
|
|
@@ -47376,7 +47249,6 @@ var init_component_registry_generated = __esm({
|
|
|
47376
47249
|
init_Navigation();
|
|
47377
47250
|
init_NegotiatorBoard();
|
|
47378
47251
|
init_NumberStepper();
|
|
47379
|
-
init_ObjectRulePanel();
|
|
47380
47252
|
init_OptionConstraintGroup();
|
|
47381
47253
|
init_OrbitalVisualization();
|
|
47382
47254
|
init_Overlay();
|
|
@@ -47407,7 +47279,6 @@ var init_component_registry_generated = __esm({
|
|
|
47407
47279
|
init_ResourceBar();
|
|
47408
47280
|
init_ResourceCounter();
|
|
47409
47281
|
init_RichBlockEditor();
|
|
47410
|
-
init_RuleEditor();
|
|
47411
47282
|
init_RuntimeDebugger2();
|
|
47412
47283
|
init_ScaledDiagram();
|
|
47413
47284
|
init_ScoreBoard();
|
|
@@ -47427,8 +47298,6 @@ var init_component_registry_generated = __esm({
|
|
|
47427
47298
|
init_SignaturePad();
|
|
47428
47299
|
init_SimpleGrid();
|
|
47429
47300
|
init_SimulationCanvas();
|
|
47430
|
-
init_SimulationControls();
|
|
47431
|
-
init_SimulationGraph();
|
|
47432
47301
|
init_SimulatorBoard();
|
|
47433
47302
|
init_Skeleton();
|
|
47434
47303
|
init_SocialProof();
|
|
@@ -47446,7 +47315,6 @@ var init_component_registry_generated = __esm({
|
|
|
47446
47315
|
init_StateArchitectBoard();
|
|
47447
47316
|
init_StateIndicator();
|
|
47448
47317
|
init_StateMachineView();
|
|
47449
|
-
init_StateNode();
|
|
47450
47318
|
init_StatsGrid();
|
|
47451
47319
|
init_StatsOrganism();
|
|
47452
47320
|
init_StatusDot();
|
|
@@ -47485,8 +47353,6 @@ var init_component_registry_generated = __esm({
|
|
|
47485
47353
|
init_Tooltip();
|
|
47486
47354
|
init_TraitFrame();
|
|
47487
47355
|
init_TraitSlot();
|
|
47488
|
-
init_TraitStateViewer();
|
|
47489
|
-
init_TransitionArrow();
|
|
47490
47356
|
init_TrendIndicator();
|
|
47491
47357
|
init_TurnIndicator();
|
|
47492
47358
|
init_TurnPanel();
|
|
@@ -47496,7 +47362,6 @@ var init_component_registry_generated = __esm({
|
|
|
47496
47362
|
init_UncontrolledBattleBoard();
|
|
47497
47363
|
init_UnitCommandBar();
|
|
47498
47364
|
init_UploadDropZone();
|
|
47499
|
-
init_VariablePanel();
|
|
47500
47365
|
init_VersionDiff();
|
|
47501
47366
|
init_ViolationAlert();
|
|
47502
47367
|
init_VoteStack();
|
|
@@ -47706,7 +47571,6 @@ var init_component_registry_generated = __esm({
|
|
|
47706
47571
|
"Navigation": Navigation,
|
|
47707
47572
|
"NegotiatorBoard": NegotiatorBoard,
|
|
47708
47573
|
"NumberStepper": NumberStepper,
|
|
47709
|
-
"ObjectRulePanel": ObjectRulePanel,
|
|
47710
47574
|
"OptionConstraintGroup": OptionConstraintGroup,
|
|
47711
47575
|
"OrbitalVisualization": OrbitalVisualization,
|
|
47712
47576
|
"Overlay": Overlay,
|
|
@@ -47737,7 +47601,6 @@ var init_component_registry_generated = __esm({
|
|
|
47737
47601
|
"ResourceBar": ResourceBar,
|
|
47738
47602
|
"ResourceCounter": ResourceCounter,
|
|
47739
47603
|
"RichBlockEditor": RichBlockEditor,
|
|
47740
|
-
"RuleEditor": RuleEditor,
|
|
47741
47604
|
"RuntimeDebugger": RuntimeDebugger,
|
|
47742
47605
|
"ScaledDiagram": ScaledDiagram,
|
|
47743
47606
|
"ScoreBoard": ScoreBoard,
|
|
@@ -47757,8 +47620,6 @@ var init_component_registry_generated = __esm({
|
|
|
47757
47620
|
"SignaturePad": SignaturePad,
|
|
47758
47621
|
"SimpleGrid": SimpleGrid,
|
|
47759
47622
|
"SimulationCanvas": SimulationCanvas,
|
|
47760
|
-
"SimulationControls": SimulationControls,
|
|
47761
|
-
"SimulationGraph": SimulationGraph,
|
|
47762
47623
|
"SimulatorBoard": SimulatorBoard,
|
|
47763
47624
|
"Skeleton": Skeleton,
|
|
47764
47625
|
"SocialProof": SocialProof,
|
|
@@ -47779,7 +47640,6 @@ var init_component_registry_generated = __esm({
|
|
|
47779
47640
|
"StateArchitectBoard": StateArchitectBoard,
|
|
47780
47641
|
"StateIndicator": StateIndicator,
|
|
47781
47642
|
"StateMachineView": StateMachineView,
|
|
47782
|
-
"StateNode": StateNode2,
|
|
47783
47643
|
"StatsGrid": StatsGrid,
|
|
47784
47644
|
"StatsOrganism": StatsOrganism,
|
|
47785
47645
|
"StatusDot": StatusDot,
|
|
@@ -47818,8 +47678,6 @@ var init_component_registry_generated = __esm({
|
|
|
47818
47678
|
"Tooltip": Tooltip,
|
|
47819
47679
|
"TraitFrame": TraitFrame,
|
|
47820
47680
|
"TraitSlot": TraitSlot,
|
|
47821
|
-
"TraitStateViewer": TraitStateViewer,
|
|
47822
|
-
"TransitionArrow": TransitionArrow,
|
|
47823
47681
|
"TrendIndicator": TrendIndicator,
|
|
47824
47682
|
"TurnIndicator": TurnIndicator,
|
|
47825
47683
|
"TurnPanel": TurnPanel,
|
|
@@ -47830,7 +47688,6 @@ var init_component_registry_generated = __esm({
|
|
|
47830
47688
|
"UnitCommandBar": UnitCommandBar,
|
|
47831
47689
|
"UploadDropZone": UploadDropZone,
|
|
47832
47690
|
"VStack": VStack,
|
|
47833
|
-
"VariablePanel": VariablePanel,
|
|
47834
47691
|
"VersionDiff": VersionDiff,
|
|
47835
47692
|
"ViolationAlert": ViolationAlert,
|
|
47836
47693
|
"VoteStack": VoteStack,
|