@almadar/ui 2.11.1 → 2.11.3
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/chunk-42YQ6JVR.js +48 -0
- package/dist/{chunk-3E73CE7J.js → chunk-4ZBSL37D.js} +28 -75
- package/dist/{chunk-QAFNBUDT.js → chunk-D54SBLJJ.js} +26 -14
- package/dist/{chunk-HQZV4PYL.js → chunk-SSJZTICC.js} +1 -1
- package/dist/components/index.css +3 -0
- package/dist/components/index.js +30 -15
- package/dist/lib/index.js +2 -1
- package/dist/providers/index.js +2 -2
- package/dist/runtime/index.js +60 -3
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// lib/traitRegistry.ts
|
|
2
|
+
var traits = /* @__PURE__ */ new Map();
|
|
3
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
4
|
+
function notifyListeners() {
|
|
5
|
+
listeners.forEach((listener) => listener());
|
|
6
|
+
}
|
|
7
|
+
function registerTrait(info) {
|
|
8
|
+
traits.set(info.id, info);
|
|
9
|
+
notifyListeners();
|
|
10
|
+
}
|
|
11
|
+
function updateTraitState(id, newState) {
|
|
12
|
+
const trait = traits.get(id);
|
|
13
|
+
if (trait) {
|
|
14
|
+
trait.currentState = newState;
|
|
15
|
+
trait.transitionCount++;
|
|
16
|
+
notifyListeners();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function updateGuardResult(traitId, guardName, result) {
|
|
20
|
+
const trait = traits.get(traitId);
|
|
21
|
+
if (trait) {
|
|
22
|
+
const guard = trait.guards.find((g) => g.name === guardName);
|
|
23
|
+
if (guard) {
|
|
24
|
+
guard.lastResult = result;
|
|
25
|
+
notifyListeners();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function unregisterTrait(id) {
|
|
30
|
+
traits.delete(id);
|
|
31
|
+
notifyListeners();
|
|
32
|
+
}
|
|
33
|
+
function getAllTraits() {
|
|
34
|
+
return Array.from(traits.values());
|
|
35
|
+
}
|
|
36
|
+
function getTrait(id) {
|
|
37
|
+
return traits.get(id);
|
|
38
|
+
}
|
|
39
|
+
function subscribeToTraitChanges(listener) {
|
|
40
|
+
listeners.add(listener);
|
|
41
|
+
return () => listeners.delete(listener);
|
|
42
|
+
}
|
|
43
|
+
function clearTraits() {
|
|
44
|
+
traits.clear();
|
|
45
|
+
notifyListeners();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { clearTraits, getAllTraits, getTrait, registerTrait, subscribeToTraitChanges, unregisterTrait, updateGuardResult, updateTraitState };
|
|
@@ -744,62 +744,15 @@ function parseContentSegments(content) {
|
|
|
744
744
|
return segments;
|
|
745
745
|
}
|
|
746
746
|
|
|
747
|
-
// lib/
|
|
748
|
-
var
|
|
747
|
+
// lib/tickRegistry.ts
|
|
748
|
+
var ticks = /* @__PURE__ */ new Map();
|
|
749
749
|
var listeners = /* @__PURE__ */ new Set();
|
|
750
750
|
function notifyListeners() {
|
|
751
751
|
listeners.forEach((listener) => listener());
|
|
752
752
|
}
|
|
753
|
-
function registerTrait(info) {
|
|
754
|
-
traits.set(info.id, info);
|
|
755
|
-
notifyListeners();
|
|
756
|
-
}
|
|
757
|
-
function updateTraitState(id, newState) {
|
|
758
|
-
const trait = traits.get(id);
|
|
759
|
-
if (trait) {
|
|
760
|
-
trait.currentState = newState;
|
|
761
|
-
trait.transitionCount++;
|
|
762
|
-
notifyListeners();
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
function updateGuardResult(traitId, guardName, result) {
|
|
766
|
-
const trait = traits.get(traitId);
|
|
767
|
-
if (trait) {
|
|
768
|
-
const guard = trait.guards.find((g) => g.name === guardName);
|
|
769
|
-
if (guard) {
|
|
770
|
-
guard.lastResult = result;
|
|
771
|
-
notifyListeners();
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
function unregisterTrait(id) {
|
|
776
|
-
traits.delete(id);
|
|
777
|
-
notifyListeners();
|
|
778
|
-
}
|
|
779
|
-
function getAllTraits() {
|
|
780
|
-
return Array.from(traits.values());
|
|
781
|
-
}
|
|
782
|
-
function getTrait(id) {
|
|
783
|
-
return traits.get(id);
|
|
784
|
-
}
|
|
785
|
-
function subscribeToTraitChanges(listener) {
|
|
786
|
-
listeners.add(listener);
|
|
787
|
-
return () => listeners.delete(listener);
|
|
788
|
-
}
|
|
789
|
-
function clearTraits() {
|
|
790
|
-
traits.clear();
|
|
791
|
-
notifyListeners();
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
// lib/tickRegistry.ts
|
|
795
|
-
var ticks = /* @__PURE__ */ new Map();
|
|
796
|
-
var listeners2 = /* @__PURE__ */ new Set();
|
|
797
|
-
function notifyListeners2() {
|
|
798
|
-
listeners2.forEach((listener) => listener());
|
|
799
|
-
}
|
|
800
753
|
function registerTick(tick) {
|
|
801
754
|
ticks.set(tick.id, tick);
|
|
802
|
-
|
|
755
|
+
notifyListeners();
|
|
803
756
|
}
|
|
804
757
|
function updateTickExecution(id, timestamp) {
|
|
805
758
|
const tick = ticks.get(id);
|
|
@@ -807,19 +760,19 @@ function updateTickExecution(id, timestamp) {
|
|
|
807
760
|
tick.lastExecuted = timestamp;
|
|
808
761
|
tick.nextExecution = timestamp + tick.interval;
|
|
809
762
|
tick.executionCount++;
|
|
810
|
-
|
|
763
|
+
notifyListeners();
|
|
811
764
|
}
|
|
812
765
|
}
|
|
813
766
|
function setTickActive(id, isActive) {
|
|
814
767
|
const tick = ticks.get(id);
|
|
815
768
|
if (tick) {
|
|
816
769
|
tick.isActive = isActive;
|
|
817
|
-
|
|
770
|
+
notifyListeners();
|
|
818
771
|
}
|
|
819
772
|
}
|
|
820
773
|
function unregisterTick(id) {
|
|
821
774
|
ticks.delete(id);
|
|
822
|
-
|
|
775
|
+
notifyListeners();
|
|
823
776
|
}
|
|
824
777
|
function getAllTicks() {
|
|
825
778
|
return Array.from(ticks.values());
|
|
@@ -828,20 +781,20 @@ function getTick(id) {
|
|
|
828
781
|
return ticks.get(id);
|
|
829
782
|
}
|
|
830
783
|
function subscribeToTickChanges(listener) {
|
|
831
|
-
|
|
832
|
-
return () =>
|
|
784
|
+
listeners.add(listener);
|
|
785
|
+
return () => listeners.delete(listener);
|
|
833
786
|
}
|
|
834
787
|
function clearTicks() {
|
|
835
788
|
ticks.clear();
|
|
836
|
-
|
|
789
|
+
notifyListeners();
|
|
837
790
|
}
|
|
838
791
|
|
|
839
792
|
// lib/guardRegistry.ts
|
|
840
793
|
var guardHistory = [];
|
|
841
|
-
var
|
|
794
|
+
var listeners2 = /* @__PURE__ */ new Set();
|
|
842
795
|
var MAX_HISTORY = 100;
|
|
843
|
-
function
|
|
844
|
-
|
|
796
|
+
function notifyListeners2() {
|
|
797
|
+
listeners2.forEach((listener) => listener());
|
|
845
798
|
}
|
|
846
799
|
function recordGuardEvaluation(evaluation) {
|
|
847
800
|
const entry = {
|
|
@@ -853,7 +806,7 @@ function recordGuardEvaluation(evaluation) {
|
|
|
853
806
|
if (guardHistory.length > MAX_HISTORY) {
|
|
854
807
|
guardHistory.pop();
|
|
855
808
|
}
|
|
856
|
-
|
|
809
|
+
notifyListeners2();
|
|
857
810
|
}
|
|
858
811
|
function getGuardHistory() {
|
|
859
812
|
return [...guardHistory];
|
|
@@ -865,12 +818,12 @@ function getGuardEvaluationsForTrait(traitName) {
|
|
|
865
818
|
return guardHistory.filter((g) => g.traitName === traitName);
|
|
866
819
|
}
|
|
867
820
|
function subscribeToGuardChanges(listener) {
|
|
868
|
-
|
|
869
|
-
return () =>
|
|
821
|
+
listeners2.add(listener);
|
|
822
|
+
return () => listeners2.delete(listener);
|
|
870
823
|
}
|
|
871
824
|
function clearGuardHistory() {
|
|
872
825
|
guardHistory.length = 0;
|
|
873
|
-
|
|
826
|
+
notifyListeners2();
|
|
874
827
|
}
|
|
875
828
|
|
|
876
829
|
// lib/entityDebug.ts
|
|
@@ -910,10 +863,10 @@ function getEntitiesByType(type) {
|
|
|
910
863
|
|
|
911
864
|
// lib/debugRegistry.ts
|
|
912
865
|
var events = [];
|
|
913
|
-
var
|
|
866
|
+
var listeners3 = /* @__PURE__ */ new Set();
|
|
914
867
|
var MAX_EVENTS = 500;
|
|
915
|
-
function
|
|
916
|
-
|
|
868
|
+
function notifyListeners3() {
|
|
869
|
+
listeners3.forEach((listener) => listener());
|
|
917
870
|
}
|
|
918
871
|
function logDebugEvent(type, source, message, data) {
|
|
919
872
|
const event = {
|
|
@@ -928,7 +881,7 @@ function logDebugEvent(type, source, message, data) {
|
|
|
928
881
|
if (events.length > MAX_EVENTS) {
|
|
929
882
|
events.pop();
|
|
930
883
|
}
|
|
931
|
-
|
|
884
|
+
notifyListeners3();
|
|
932
885
|
}
|
|
933
886
|
function logStateChange(source, from, to, event) {
|
|
934
887
|
logDebugEvent("state-change", source, `${from} \u2192 ${to}`, { from, to, event });
|
|
@@ -961,17 +914,17 @@ function getEventsBySource(source) {
|
|
|
961
914
|
return events.filter((e) => e.source === source);
|
|
962
915
|
}
|
|
963
916
|
function subscribeToDebugEvents(listener) {
|
|
964
|
-
|
|
965
|
-
return () =>
|
|
917
|
+
listeners3.add(listener);
|
|
918
|
+
return () => listeners3.delete(listener);
|
|
966
919
|
}
|
|
967
920
|
function clearDebugEvents() {
|
|
968
921
|
events.length = 0;
|
|
969
|
-
|
|
922
|
+
notifyListeners3();
|
|
970
923
|
}
|
|
971
924
|
|
|
972
925
|
// lib/debugUtils.ts
|
|
973
926
|
var DEBUG_STORAGE_KEY = "orbital-debug";
|
|
974
|
-
var
|
|
927
|
+
var listeners4 = /* @__PURE__ */ new Set();
|
|
975
928
|
function isDebugEnabled() {
|
|
976
929
|
if (typeof window === "undefined") return false;
|
|
977
930
|
return localStorage.getItem(DEBUG_STORAGE_KEY) === "true";
|
|
@@ -979,7 +932,7 @@ function isDebugEnabled() {
|
|
|
979
932
|
function setDebugEnabled(enabled) {
|
|
980
933
|
if (typeof window === "undefined") return;
|
|
981
934
|
localStorage.setItem(DEBUG_STORAGE_KEY, String(enabled));
|
|
982
|
-
|
|
935
|
+
listeners4.forEach((listener) => listener(enabled));
|
|
983
936
|
}
|
|
984
937
|
function toggleDebug() {
|
|
985
938
|
const newValue = !isDebugEnabled();
|
|
@@ -987,8 +940,8 @@ function toggleDebug() {
|
|
|
987
940
|
return newValue;
|
|
988
941
|
}
|
|
989
942
|
function onDebugToggle(listener) {
|
|
990
|
-
|
|
991
|
-
return () =>
|
|
943
|
+
listeners4.add(listener);
|
|
944
|
+
return () => listeners4.delete(listener);
|
|
992
945
|
}
|
|
993
946
|
function initDebugShortcut() {
|
|
994
947
|
if (typeof window === "undefined") return () => {
|
|
@@ -1003,4 +956,4 @@ function initDebugShortcut() {
|
|
|
1003
956
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
1004
957
|
}
|
|
1005
958
|
|
|
1006
|
-
export { DEFAULT_CONFIG, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks,
|
|
959
|
+
export { DEFAULT_CONFIG, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, extractOutputsFromTransitions, extractStateMachine, formatGuard, getAllTicks, getDebugEvents, getEffectSummary, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getRecentEvents, getRecentGuardEvaluations, getTick, initDebugShortcut, isDebugEnabled, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, parseContentSegments, parseMarkdownWithCodeBlocks, recordGuardEvaluation, registerTick, renderStateMachineToDomData, renderStateMachineToSvg, setDebugEnabled, setEntityProvider, setTickActive, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, toggleDebug, unregisterTick, updateTickExecution };
|
|
@@ -18534,18 +18534,33 @@ function UISlotComponent({
|
|
|
18534
18534
|
}
|
|
18535
18535
|
);
|
|
18536
18536
|
}
|
|
18537
|
+
function getOrCreatePortalRoot() {
|
|
18538
|
+
let root = document.getElementById("ui-slot-portal-root");
|
|
18539
|
+
if (!root) {
|
|
18540
|
+
root = document.createElement("div");
|
|
18541
|
+
root.id = "ui-slot-portal-root";
|
|
18542
|
+
root.style.position = "relative";
|
|
18543
|
+
root.style.zIndex = "9999";
|
|
18544
|
+
document.body.appendChild(root);
|
|
18545
|
+
}
|
|
18546
|
+
const themed = document.querySelector('[data-theme*="-"]') ?? document.querySelector("[data-theme]");
|
|
18547
|
+
if (themed) {
|
|
18548
|
+
const theme = themed.getAttribute("data-theme");
|
|
18549
|
+
if (theme && root.getAttribute("data-theme") !== theme) {
|
|
18550
|
+
root.setAttribute("data-theme", theme);
|
|
18551
|
+
}
|
|
18552
|
+
}
|
|
18553
|
+
return root;
|
|
18554
|
+
}
|
|
18537
18555
|
function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
18538
18556
|
const [portalRoot, setPortalRoot] = useState(null);
|
|
18539
18557
|
const eventBus = useUISlots();
|
|
18540
18558
|
useEffect(() => {
|
|
18541
|
-
|
|
18542
|
-
if (!root) {
|
|
18543
|
-
root = document.createElement("div");
|
|
18544
|
-
root.id = "ui-slot-portal-root";
|
|
18545
|
-
document.body.appendChild(root);
|
|
18546
|
-
}
|
|
18547
|
-
setPortalRoot(root);
|
|
18559
|
+
setPortalRoot(getOrCreatePortalRoot());
|
|
18548
18560
|
}, []);
|
|
18561
|
+
useEffect(() => {
|
|
18562
|
+
if (portalRoot) getOrCreatePortalRoot();
|
|
18563
|
+
});
|
|
18549
18564
|
const handleDismiss = () => {
|
|
18550
18565
|
eventBus.clear(slot);
|
|
18551
18566
|
};
|
|
@@ -18606,14 +18621,11 @@ function SlotPortal({
|
|
|
18606
18621
|
}) {
|
|
18607
18622
|
const [portalRoot, setPortalRoot] = useState(null);
|
|
18608
18623
|
useEffect(() => {
|
|
18609
|
-
|
|
18610
|
-
if (!root) {
|
|
18611
|
-
root = document.createElement("div");
|
|
18612
|
-
root.id = "ui-slot-portal-root";
|
|
18613
|
-
document.body.appendChild(root);
|
|
18614
|
-
}
|
|
18615
|
-
setPortalRoot(root);
|
|
18624
|
+
setPortalRoot(getOrCreatePortalRoot());
|
|
18616
18625
|
}, []);
|
|
18626
|
+
useEffect(() => {
|
|
18627
|
+
if (portalRoot) getOrCreatePortalRoot();
|
|
18628
|
+
});
|
|
18617
18629
|
if (!portalRoot) return null;
|
|
18618
18630
|
let wrapper;
|
|
18619
18631
|
switch (slot) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SuspenseConfigProvider } from './chunk-
|
|
1
|
+
import { SuspenseConfigProvider } from './chunk-D54SBLJJ.js';
|
|
2
2
|
import { ThemeProvider } from './chunk-DKQN5FVU.js';
|
|
3
3
|
import { SelectionProvider, EntityDataProvider } from './chunk-WGJIL4YR.js';
|
|
4
4
|
import { useEventBus, EventBusProvider } from './chunk-YXZM3WCF.js';
|
package/dist/components/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { DEFAULT_CONFIG, renderStateMachineToDomData, parseContentSegments, isDebugEnabled, onDebugToggle,
|
|
1
|
+
import { DEFAULT_CONFIG, renderStateMachineToDomData, parseContentSegments, isDebugEnabled, onDebugToggle, subscribeToTickChanges, subscribeToGuardChanges, subscribeToDebugEvents, getEntitySnapshot, getDebugEvents, getGuardHistory, getAllTicks } from '../chunk-4ZBSL37D.js';
|
|
2
2
|
import { useAuthContext } from '../chunk-GTIAVPI5.js';
|
|
3
3
|
export { ENTITY_EVENTS, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity as useEntityById, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePinchZoom, usePlayer, usePreview, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-GTIAVPI5.js';
|
|
4
4
|
export { clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../chunk-N7MVUW4R.js';
|
|
5
|
+
import { subscribeToTraitChanges, getAllTraits } from '../chunk-42YQ6JVR.js';
|
|
5
6
|
import '../chunk-3HJHHULT.js';
|
|
6
|
-
import { VStack, HStack, Typography, Button, Icon, Box, Card, Avatar, Badge, SearchInput, Checkbox, Menu as Menu$1, Pagination, LoadingState, EmptyState, Modal, ErrorState, QuizBlock, CodeBlock, ScaledDiagram, MarkdownContent, Divider, ProgressBar, isoToScreen, IsometricCanvas_default, Stack, Select, Drawer, Toast, Tabs, Input, ThemeToggle, TILE_WIDTH, EntityDisplayEvents, StateIndicator, Accordion, ButtonGroup, Container } from '../chunk-
|
|
7
|
-
export { ALL_PRESETS, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, Alert, AnimatedCounter, Avatar, Badge, Box, Breadcrumb, Button, ButtonGroup, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, Center, Chart, ChartLegend, Checkbox, ChoiceButton, CodeBlock, CombatLog, ComboCounter, ConditionalWrapper, ConfettiEffect, Container, ControlButton, CraftingRecipe, DIAMOND_TOP_Y, DPad, DamageNumber, DataGrid, DataList, DataTable, DateRangeSelector, DayCell, DetailPanel, DialogueBox, DialogueBubble, Divider, Drawer, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FLOOR_HEIGHT, FilterGroup, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormField, FormSectionHeader, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GraphView, Grid, HStack, Heading, HealthBar, HealthPanel, Icon, InfiniteScrollSentinel, Input, InputGroup, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, Label, LawReferenceTooltip, Lightbox, LineChart, LoadingState, MapView, MarkdownContent, MasterDetail, Menu, Meter, MiniMap, Modal, NumberStepper, Overlay, PageHeader, Pagination, PlatformerCanvas, Popover, PowerupSlots, ProgressBar, ProgressDots, PullToRefresh, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ResourceBar, ResourceCounter, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Select, SidePanel, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, Skeleton, SlotContentRenderer, SortableList, Spacer, Spinner, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateIndicator, StatusDot, StatusEffect, SwipeableRow, Switch, TILE_HEIGHT, TILE_WIDTH, Tabs, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, TimerDisplay, Toast, Tooltip, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UnitCommandBar, UploadDropZone, VStack, ViolationAlert, WaypointMarker, WizardNavigation, WizardProgress, XPBar, drawSprite, isoToScreen, pendulum, projectileMotion, screenToIso, springOscillator, useCamera, useImageCache } from '../chunk-
|
|
7
|
+
import { VStack, HStack, Typography, Button, Icon, Box, Card, Avatar, Badge, SearchInput, Checkbox, Menu as Menu$1, Pagination, LoadingState, EmptyState, Modal, ErrorState, QuizBlock, CodeBlock, ScaledDiagram, MarkdownContent, Divider, ProgressBar, isoToScreen, IsometricCanvas_default, Stack, Select, Drawer, Toast, Tabs, Input, ThemeToggle, TILE_WIDTH, EntityDisplayEvents, StateIndicator, Accordion, ButtonGroup, Container } from '../chunk-D54SBLJJ.js';
|
|
8
|
+
export { ALL_PRESETS, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, Alert, AnimatedCounter, Avatar, Badge, Box, Breadcrumb, Button, ButtonGroup, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, Center, Chart, ChartLegend, Checkbox, ChoiceButton, CodeBlock, CombatLog, ComboCounter, ConditionalWrapper, ConfettiEffect, Container, ControlButton, CraftingRecipe, DIAMOND_TOP_Y, DPad, DamageNumber, DataGrid, DataList, DataTable, DateRangeSelector, DayCell, DetailPanel, DialogueBox, DialogueBubble, Divider, Drawer, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FLOOR_HEIGHT, FilterGroup, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormField, FormSectionHeader, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GraphView, Grid, HStack, Heading, HealthBar, HealthPanel, Icon, InfiniteScrollSentinel, Input, InputGroup, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, Label, LawReferenceTooltip, Lightbox, LineChart, LoadingState, MapView, MarkdownContent, MasterDetail, Menu, Meter, MiniMap, Modal, NumberStepper, Overlay, PageHeader, Pagination, PlatformerCanvas, Popover, PowerupSlots, ProgressBar, ProgressDots, PullToRefresh, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ResourceBar, ResourceCounter, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Select, SidePanel, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, Skeleton, SlotContentRenderer, SortableList, Spacer, Spinner, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateIndicator, StatusDot, StatusEffect, SwipeableRow, Switch, TILE_HEIGHT, TILE_WIDTH, Tabs, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, TimerDisplay, Toast, Tooltip, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UnitCommandBar, UploadDropZone, VStack, ViolationAlert, WaypointMarker, WizardNavigation, WizardProgress, XPBar, drawSprite, isoToScreen, pendulum, projectileMotion, screenToIso, springOscillator, useCamera, useImageCache } from '../chunk-D54SBLJJ.js';
|
|
8
9
|
import '../chunk-DKQN5FVU.js';
|
|
9
10
|
import { useTranslate } from '../chunk-WGJIL4YR.js';
|
|
10
11
|
export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useDragReorder, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useInfiniteScroll, useLongPress, usePullToRefresh, useQuerySingleton, useSwipeGesture, useTranslate } from '../chunk-WGJIL4YR.js';
|
|
@@ -10388,18 +10389,32 @@ function RuntimeDebugger({
|
|
|
10388
10389
|
className
|
|
10389
10390
|
),
|
|
10390
10391
|
"data-testid": "debugger-inline",
|
|
10391
|
-
children: /* @__PURE__ */ jsxs(Card, { className:
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10392
|
+
children: /* @__PURE__ */ jsxs(Card, { className: cn(
|
|
10393
|
+
"runtime-debugger__panel",
|
|
10394
|
+
isCollapsed ? "runtime-debugger__panel--inline-collapsed" : "runtime-debugger__panel--inline"
|
|
10395
|
+
), children: [
|
|
10396
|
+
/* @__PURE__ */ jsx(
|
|
10397
|
+
"div",
|
|
10398
|
+
{
|
|
10399
|
+
className: "runtime-debugger__header",
|
|
10400
|
+
onClick: () => setIsCollapsed((prev) => !prev),
|
|
10401
|
+
style: { cursor: "pointer", userSelect: "none" },
|
|
10402
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
10403
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "h6", style: { fontSize: "0.75rem" }, children: [
|
|
10404
|
+
isCollapsed ? "\u25B6" : "\u25BC",
|
|
10405
|
+
" Debugger"
|
|
10406
|
+
] }),
|
|
10407
|
+
failedChecks > 0 ? /* @__PURE__ */ jsxs(Badge, { variant: "danger", size: "sm", children: [
|
|
10408
|
+
failedChecks,
|
|
10409
|
+
" failed"
|
|
10410
|
+
] }) : debugData.traits.length > 0 ? /* @__PURE__ */ jsxs(Badge, { variant: "success", size: "sm", children: [
|
|
10411
|
+
debugData.traits.length,
|
|
10412
|
+
" traits"
|
|
10413
|
+
] }) : /* @__PURE__ */ jsx(Badge, { variant: "info", size: "sm", children: "Idle" })
|
|
10414
|
+
] })
|
|
10415
|
+
}
|
|
10416
|
+
),
|
|
10417
|
+
!isCollapsed && /* @__PURE__ */ jsx("div", { className: "runtime-debugger__content", children: /* @__PURE__ */ jsx(
|
|
10403
10418
|
Tabs,
|
|
10404
10419
|
{
|
|
10405
10420
|
items: tabItems,
|
package/dist/lib/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { DEFAULT_CONFIG, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks,
|
|
1
|
+
export { DEFAULT_CONFIG, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, extractOutputsFromTransitions, extractStateMachine, formatGuard, getAllTicks, getDebugEvents, getEffectSummary, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getRecentEvents, getRecentGuardEvaluations, getTick, initDebugShortcut, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, parseContentSegments, parseMarkdownWithCodeBlocks, recordGuardEvaluation, registerTick, renderStateMachineToDomData, renderStateMachineToSvg, setDebugEnabled, setEntityProvider, setTickActive, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, toggleDebug, unregisterTick, updateTickExecution } from '../chunk-4ZBSL37D.js';
|
|
2
|
+
export { clearTraits, getAllTraits, getTrait, registerTrait, subscribeToTraitChanges, unregisterTrait, updateGuardResult, updateTraitState } from '../chunk-42YQ6JVR.js';
|
|
2
3
|
export { ApiError, apiClient } from '../chunk-3HJHHULT.js';
|
|
3
4
|
export { bindCanvasCapture, bindEventBus, bindTraitStateGetter, clearVerification, cn, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, formatNestedFieldLabel, getAllChecks, getBridgeHealth, getNestedValue, getSnapshot, getSummary, getTransitions, getTransitionsForTrait, isDebugEnabled, recordTransition, registerCheck, subscribeToVerification, updateAssetStatus, updateBridgeHealth, updateCheck, waitForTransition } from '../chunk-WCTZ7WZX.js';
|
|
4
5
|
import '../chunk-PKBMQBKP.js';
|
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { FetchedDataContext, FetchedDataProvider, OfflineModeProvider, OrbitalProvider, VerificationProvider, useFetchedData, useFetchedDataContext, useFetchedEntity, useOfflineMode, useOptionalOfflineMode } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { FetchedDataContext, FetchedDataProvider, OfflineModeProvider, OrbitalProvider, VerificationProvider, useFetchedData, useFetchedDataContext, useFetchedEntity, useOfflineMode, useOptionalOfflineMode } from '../chunk-SSJZTICC.js';
|
|
2
|
+
import '../chunk-D54SBLJJ.js';
|
|
3
3
|
import '../chunk-DKQN5FVU.js';
|
|
4
4
|
export { SelectionContext, SelectionProvider, useSelection, useSelectionOptional } from '../chunk-WGJIL4YR.js';
|
|
5
5
|
export { EventBusContext, EventBusProvider } from '../chunk-YXZM3WCF.js';
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import '../chunk-GTIAVPI5.js';
|
|
2
2
|
import '../chunk-N7MVUW4R.js';
|
|
3
|
+
import { registerTrait, unregisterTrait, updateTraitState } from '../chunk-42YQ6JVR.js';
|
|
3
4
|
import '../chunk-3HJHHULT.js';
|
|
4
|
-
import { useFetchedDataContext } from '../chunk-
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import { useFetchedDataContext } from '../chunk-SSJZTICC.js';
|
|
6
|
+
import '../chunk-D54SBLJJ.js';
|
|
6
7
|
import '../chunk-DKQN5FVU.js';
|
|
7
8
|
import '../chunk-WGJIL4YR.js';
|
|
8
9
|
import { useEventBus } from '../chunk-YXZM3WCF.js';
|
|
9
10
|
import '../chunk-3JGAROCW.js';
|
|
10
|
-
import '../chunk-WCTZ7WZX.js';
|
|
11
|
+
import { recordTransition } from '../chunk-WCTZ7WZX.js';
|
|
11
12
|
import '../chunk-TSETXL2E.js';
|
|
12
13
|
import '../chunk-K2D5D3WK.js';
|
|
13
14
|
import '../chunk-PKBMQBKP.js';
|
|
@@ -123,6 +124,39 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
123
124
|
useEffect(() => {
|
|
124
125
|
optionsRef.current = options;
|
|
125
126
|
}, [options]);
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
const mgr = managerRef.current;
|
|
129
|
+
const bindings = traitBindingsRef.current;
|
|
130
|
+
const ids = [];
|
|
131
|
+
for (const binding of bindings) {
|
|
132
|
+
const trait = binding.trait;
|
|
133
|
+
const state = mgr.getState(trait.name);
|
|
134
|
+
const info = {
|
|
135
|
+
id: trait.name,
|
|
136
|
+
name: trait.name,
|
|
137
|
+
currentState: state?.currentState ?? trait.states[0]?.name ?? "unknown",
|
|
138
|
+
states: trait.states.map((s) => s.name),
|
|
139
|
+
transitions: trait.transitions.flatMap((t) => {
|
|
140
|
+
const froms = Array.isArray(t.from) ? t.from : [t.from];
|
|
141
|
+
return froms.map((f) => ({
|
|
142
|
+
from: f,
|
|
143
|
+
to: t.to,
|
|
144
|
+
event: t.event,
|
|
145
|
+
guard: t.guard ? String(t.guard) : void 0
|
|
146
|
+
}));
|
|
147
|
+
}),
|
|
148
|
+
guards: trait.transitions.filter((t) => t.guard).map((t) => ({ name: String(t.guard) })),
|
|
149
|
+
transitionCount: 0
|
|
150
|
+
};
|
|
151
|
+
registerTrait(info);
|
|
152
|
+
ids.push(trait.name);
|
|
153
|
+
}
|
|
154
|
+
return () => {
|
|
155
|
+
for (const id of ids) {
|
|
156
|
+
unregisterTrait(id);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
}, [traitBindings]);
|
|
126
160
|
useEffect(() => {
|
|
127
161
|
const newManager = managerRef.current;
|
|
128
162
|
newManager.resetAll();
|
|
@@ -292,6 +326,29 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
292
326
|
}
|
|
293
327
|
}
|
|
294
328
|
}
|
|
329
|
+
for (const { traitName, result } of results) {
|
|
330
|
+
if (result.executed) {
|
|
331
|
+
updateTraitState(traitName, result.newState);
|
|
332
|
+
const effectTraces = result.effects.map(
|
|
333
|
+
(e) => {
|
|
334
|
+
const eff = e;
|
|
335
|
+
return {
|
|
336
|
+
type: String(eff.type ?? "unknown"),
|
|
337
|
+
args: Array.isArray(eff.args) ? eff.args : [],
|
|
338
|
+
status: "executed"
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
);
|
|
342
|
+
recordTransition({
|
|
343
|
+
traitName,
|
|
344
|
+
from: result.previousState,
|
|
345
|
+
to: result.newState,
|
|
346
|
+
event: normalizedEvent,
|
|
347
|
+
effects: effectTraces,
|
|
348
|
+
timestamp: Date.now()
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
295
352
|
if (results.length > 0) {
|
|
296
353
|
setTraitStates(currentManager.getAllStates());
|
|
297
354
|
}
|