@almadar/ui 2.11.2 → 2.11.4
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-D54SBLJJ.js → chunk-4LBNLALH.js} +22 -18
- package/dist/{chunk-3E73CE7J.js → chunk-4ZBSL37D.js} +28 -75
- package/dist/{chunk-SSJZTICC.js → chunk-A2NPH2P3.js} +1 -1
- package/dist/components/index.css +3 -0
- package/dist/components/index.d.ts +1 -1
- 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 };
|
|
@@ -2826,17 +2826,19 @@ function ScoreDisplay({
|
|
|
2826
2826
|
size = "md",
|
|
2827
2827
|
className,
|
|
2828
2828
|
animated = true,
|
|
2829
|
-
locale = "en-US"
|
|
2829
|
+
locale = "en-US",
|
|
2830
|
+
...rest
|
|
2830
2831
|
}) {
|
|
2831
|
-
const
|
|
2832
|
+
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
2833
|
+
const [displayValue, setDisplayValue] = React80.useState(resolvedValue);
|
|
2832
2834
|
const [isAnimating, setIsAnimating] = React80.useState(false);
|
|
2833
2835
|
React80.useEffect(() => {
|
|
2834
|
-
if (!animated || displayValue ===
|
|
2835
|
-
setDisplayValue(
|
|
2836
|
+
if (!animated || displayValue === resolvedValue) {
|
|
2837
|
+
setDisplayValue(resolvedValue);
|
|
2836
2838
|
return;
|
|
2837
2839
|
}
|
|
2838
2840
|
setIsAnimating(true);
|
|
2839
|
-
const diff =
|
|
2841
|
+
const diff = resolvedValue - displayValue;
|
|
2840
2842
|
const steps = Math.min(Math.abs(diff), 20);
|
|
2841
2843
|
const increment = diff / steps;
|
|
2842
2844
|
let current = displayValue;
|
|
@@ -2847,12 +2849,12 @@ function ScoreDisplay({
|
|
|
2847
2849
|
setDisplayValue(Math.round(current));
|
|
2848
2850
|
if (step >= steps) {
|
|
2849
2851
|
clearInterval(timer);
|
|
2850
|
-
setDisplayValue(
|
|
2852
|
+
setDisplayValue(resolvedValue);
|
|
2851
2853
|
setIsAnimating(false);
|
|
2852
2854
|
}
|
|
2853
2855
|
}, 50);
|
|
2854
2856
|
return () => clearInterval(timer);
|
|
2855
|
-
}, [
|
|
2857
|
+
}, [resolvedValue, animated]);
|
|
2856
2858
|
const formattedValue = new Intl.NumberFormat(locale).format(displayValue);
|
|
2857
2859
|
return /* @__PURE__ */ jsxs(
|
|
2858
2860
|
"div",
|
|
@@ -10416,7 +10418,7 @@ function IsometricCanvas({
|
|
|
10416
10418
|
if (url) urls.push(url);
|
|
10417
10419
|
}
|
|
10418
10420
|
}
|
|
10419
|
-
urls.push(...effectSpriteUrls);
|
|
10421
|
+
if (effectSpriteUrls) urls.push(...effectSpriteUrls);
|
|
10420
10422
|
if (backgroundImage) urls.push(backgroundImage);
|
|
10421
10423
|
return [...new Set(urls.filter(Boolean))];
|
|
10422
10424
|
}, [sortedTiles, features, units, getTerrainSprite, getFeatureSprite, getUnitSprite, effectSpriteUrls, backgroundImage, assetManifest, resolveManifestUrl]);
|
|
@@ -11901,7 +11903,7 @@ function useSafeEventBus7() {
|
|
|
11901
11903
|
}
|
|
11902
11904
|
}
|
|
11903
11905
|
var Lightbox = ({
|
|
11904
|
-
images,
|
|
11906
|
+
images = [],
|
|
11905
11907
|
currentIndex = 0,
|
|
11906
11908
|
isOpen = false,
|
|
11907
11909
|
showCounter = true,
|
|
@@ -11910,6 +11912,7 @@ var Lightbox = ({
|
|
|
11910
11912
|
onIndexChange,
|
|
11911
11913
|
className
|
|
11912
11914
|
}) => {
|
|
11915
|
+
const safeImages = Array.isArray(images) ? images : [];
|
|
11913
11916
|
const [index, setIndex] = useState(currentIndex);
|
|
11914
11917
|
const [touchStartX, setTouchStartX] = useState(null);
|
|
11915
11918
|
const eventBus = useSafeEventBus7();
|
|
@@ -11924,11 +11927,12 @@ var Lightbox = ({
|
|
|
11924
11927
|
}, [closeAction, eventBus, onClose]);
|
|
11925
11928
|
const goTo = useCallback(
|
|
11926
11929
|
(newIndex) => {
|
|
11927
|
-
|
|
11930
|
+
if (safeImages.length === 0) return;
|
|
11931
|
+
const clamped = Math.max(0, Math.min(safeImages.length - 1, newIndex));
|
|
11928
11932
|
setIndex(clamped);
|
|
11929
11933
|
onIndexChange?.(clamped);
|
|
11930
11934
|
},
|
|
11931
|
-
[
|
|
11935
|
+
[safeImages.length, onIndexChange]
|
|
11932
11936
|
);
|
|
11933
11937
|
const goPrev = useCallback(() => goTo(index - 1), [goTo, index]);
|
|
11934
11938
|
const goNext = useCallback(() => goTo(index + 1), [goTo, index]);
|
|
@@ -11958,10 +11962,10 @@ var Lightbox = ({
|
|
|
11958
11962
|
};
|
|
11959
11963
|
}
|
|
11960
11964
|
}, [isOpen]);
|
|
11961
|
-
if (!isOpen ||
|
|
11962
|
-
const currentImage =
|
|
11965
|
+
if (!isOpen || safeImages.length === 0) return null;
|
|
11966
|
+
const currentImage = safeImages[index];
|
|
11963
11967
|
const hasPrev = index > 0;
|
|
11964
|
-
const hasNext = index <
|
|
11968
|
+
const hasNext = index < safeImages.length - 1;
|
|
11965
11969
|
const handleTouchStart = (e) => {
|
|
11966
11970
|
setTouchStartX(e.touches[0].clientX);
|
|
11967
11971
|
};
|
|
@@ -12005,7 +12009,7 @@ var Lightbox = ({
|
|
|
12005
12009
|
children: /* @__PURE__ */ jsx(X, { className: "w-6 h-6" })
|
|
12006
12010
|
}
|
|
12007
12011
|
),
|
|
12008
|
-
hasPrev &&
|
|
12012
|
+
hasPrev && safeImages.length > 1 && /* @__PURE__ */ jsx(
|
|
12009
12013
|
"button",
|
|
12010
12014
|
{
|
|
12011
12015
|
type: "button",
|
|
@@ -12042,7 +12046,7 @@ var Lightbox = ({
|
|
|
12042
12046
|
)
|
|
12043
12047
|
}
|
|
12044
12048
|
),
|
|
12045
|
-
hasNext &&
|
|
12049
|
+
hasNext && safeImages.length > 1 && /* @__PURE__ */ jsx(
|
|
12046
12050
|
"button",
|
|
12047
12051
|
{
|
|
12048
12052
|
type: "button",
|
|
@@ -12062,10 +12066,10 @@ var Lightbox = ({
|
|
|
12062
12066
|
}
|
|
12063
12067
|
),
|
|
12064
12068
|
/* @__PURE__ */ jsxs("div", { className: "absolute bottom-4 left-0 right-0 text-center", children: [
|
|
12065
|
-
showCounter &&
|
|
12069
|
+
showCounter && safeImages.length > 1 && /* @__PURE__ */ jsxs("div", { className: "text-white text-sm mb-1", children: [
|
|
12066
12070
|
index + 1,
|
|
12067
12071
|
" of ",
|
|
12068
|
-
|
|
12072
|
+
safeImages.length
|
|
12069
12073
|
] }),
|
|
12070
12074
|
currentImage?.caption && /* @__PURE__ */ jsx("div", { className: "text-white text-sm opacity-80 px-8", children: currentImage.caption })
|
|
12071
12075
|
] })
|
|
@@ -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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SuspenseConfigProvider } from './chunk-
|
|
1
|
+
import { SuspenseConfigProvider } from './chunk-4LBNLALH.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';
|
|
@@ -1079,7 +1079,7 @@ interface ScoreDisplayProps {
|
|
|
1079
1079
|
/** Number formatting locale */
|
|
1080
1080
|
locale?: string;
|
|
1081
1081
|
}
|
|
1082
|
-
declare function ScoreDisplay({ value, label, icon, size, className, animated, locale, }: ScoreDisplayProps): react_jsx_runtime.JSX.Element;
|
|
1082
|
+
declare function ScoreDisplay({ value, label, icon, size, className, animated, locale, ...rest }: ScoreDisplayProps & Record<string, unknown>): react_jsx_runtime.JSX.Element;
|
|
1083
1083
|
declare namespace ScoreDisplay {
|
|
1084
1084
|
var displayName: string;
|
|
1085
1085
|
}
|
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-4LBNLALH.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-4LBNLALH.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-A2NPH2P3.js';
|
|
2
|
+
import '../chunk-4LBNLALH.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-A2NPH2P3.js';
|
|
6
|
+
import '../chunk-4LBNLALH.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
|
}
|