@almadar/ui 2.12.6 → 2.13.1
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-TSETXL2E.js → chunk-2XXSUIOK.js} +3 -0
- package/dist/{chunk-WGJIL4YR.js → chunk-3CP74CBL.js} +525 -525
- package/dist/{chunk-4ZBSL37D.js → chunk-MNMASFYN.js} +212 -212
- package/dist/{chunk-GTIAVPI5.js → chunk-X2ZDE63F.js} +1 -1
- package/dist/{chunk-AX45OCIB.js → chunk-XF7GGUTH.js} +3 -3
- package/dist/{chunk-DKQN5FVU.js → chunk-YLKXEXBP.js} +24 -24
- package/dist/{chunk-HJJIE4K5.js → chunk-YYCP5CD7.js} +28 -13
- package/dist/components/index.d.ts +10 -10
- package/dist/components/index.js +9 -9
- package/dist/context/index.js +2 -2
- package/dist/hooks/index.d.ts +61 -61
- package/dist/hooks/index.js +3 -3
- package/dist/lib/index.d.ts +174 -174
- package/dist/lib/index.js +1 -1
- package/dist/locales/index.js +1 -1
- package/dist/providers/index.js +5 -5
- package/dist/runtime/index.js +6 -6
- package/package.json +1 -1
- package/themes/arctic.css +6 -6
- package/themes/copper.css +2 -2
- package/themes/ember.css +6 -6
- package/themes/forest.css +2 -2
- package/themes/lavender.css +2 -2
- package/themes/midnight.css +2 -2
- package/themes/minimalist.css +7 -7
- package/themes/neon.css +6 -6
- package/themes/ocean.css +2 -2
- package/themes/rose.css +2 -2
- package/themes/sand.css +6 -6
- package/themes/slate.css +6 -6
- package/themes/sunset.css +2 -2
- package/dist/{cn-C_ATNPvi.d.ts → parseContentSegments-BZrQRvgK.d.ts} +144 -144
|
@@ -1,3 +1,215 @@
|
|
|
1
|
+
// lib/debugUtils.ts
|
|
2
|
+
var DEBUG_STORAGE_KEY = "orbital-debug";
|
|
3
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
4
|
+
function isDebugEnabled() {
|
|
5
|
+
if (typeof window === "undefined") return false;
|
|
6
|
+
return localStorage.getItem(DEBUG_STORAGE_KEY) === "true";
|
|
7
|
+
}
|
|
8
|
+
function setDebugEnabled(enabled) {
|
|
9
|
+
if (typeof window === "undefined") return;
|
|
10
|
+
localStorage.setItem(DEBUG_STORAGE_KEY, String(enabled));
|
|
11
|
+
listeners.forEach((listener) => listener(enabled));
|
|
12
|
+
}
|
|
13
|
+
function toggleDebug() {
|
|
14
|
+
const newValue = !isDebugEnabled();
|
|
15
|
+
setDebugEnabled(newValue);
|
|
16
|
+
return newValue;
|
|
17
|
+
}
|
|
18
|
+
function onDebugToggle(listener) {
|
|
19
|
+
listeners.add(listener);
|
|
20
|
+
return () => listeners.delete(listener);
|
|
21
|
+
}
|
|
22
|
+
function initDebugShortcut() {
|
|
23
|
+
if (typeof window === "undefined") return () => {
|
|
24
|
+
};
|
|
25
|
+
const handleKeyDown = (e) => {
|
|
26
|
+
if (e.ctrlKey && e.shiftKey && e.key === "D") {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
toggleDebug();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
32
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// lib/entityDebug.ts
|
|
36
|
+
var entityProvider = null;
|
|
37
|
+
function setEntityProvider(provider) {
|
|
38
|
+
entityProvider = provider;
|
|
39
|
+
}
|
|
40
|
+
function clearEntityProvider() {
|
|
41
|
+
entityProvider = null;
|
|
42
|
+
}
|
|
43
|
+
function getEntitySnapshot() {
|
|
44
|
+
if (!entityProvider) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const entities = entityProvider();
|
|
48
|
+
return {
|
|
49
|
+
entities,
|
|
50
|
+
timestamp: Date.now(),
|
|
51
|
+
totalCount: entities.length,
|
|
52
|
+
singletons: {},
|
|
53
|
+
runtime: entities.map((e) => ({ id: e.id, type: e.type, data: e.fields })),
|
|
54
|
+
persistent: {}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function getEntityById(id) {
|
|
58
|
+
if (!entityProvider) {
|
|
59
|
+
return void 0;
|
|
60
|
+
}
|
|
61
|
+
return entityProvider().find((e) => e.id === id);
|
|
62
|
+
}
|
|
63
|
+
function getEntitiesByType(type) {
|
|
64
|
+
if (!entityProvider) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
return entityProvider().filter((e) => e.type === type);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// lib/debugRegistry.ts
|
|
71
|
+
var events = [];
|
|
72
|
+
var listeners2 = /* @__PURE__ */ new Set();
|
|
73
|
+
var MAX_EVENTS = 500;
|
|
74
|
+
function notifyListeners() {
|
|
75
|
+
listeners2.forEach((listener) => listener());
|
|
76
|
+
}
|
|
77
|
+
function logDebugEvent(type, source, message, data) {
|
|
78
|
+
const event = {
|
|
79
|
+
id: `event-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,
|
|
80
|
+
type,
|
|
81
|
+
source,
|
|
82
|
+
message,
|
|
83
|
+
data,
|
|
84
|
+
timestamp: Date.now()
|
|
85
|
+
};
|
|
86
|
+
events.unshift(event);
|
|
87
|
+
if (events.length > MAX_EVENTS) {
|
|
88
|
+
events.pop();
|
|
89
|
+
}
|
|
90
|
+
notifyListeners();
|
|
91
|
+
}
|
|
92
|
+
function logStateChange(source, from, to, event) {
|
|
93
|
+
logDebugEvent("state-change", source, `${from} \u2192 ${to}`, { from, to, event });
|
|
94
|
+
}
|
|
95
|
+
function logEventFired(source, eventName, payload) {
|
|
96
|
+
logDebugEvent("event-fired", source, eventName, { eventName, payload });
|
|
97
|
+
}
|
|
98
|
+
function logEffectExecuted(source, effectType, details) {
|
|
99
|
+
logDebugEvent("effect-executed", source, effectType, { effectType, details });
|
|
100
|
+
}
|
|
101
|
+
function logError(source, message, error) {
|
|
102
|
+
logDebugEvent("error", source, message, { error });
|
|
103
|
+
}
|
|
104
|
+
function logWarning(source, message, data) {
|
|
105
|
+
logDebugEvent("warning", source, message, data);
|
|
106
|
+
}
|
|
107
|
+
function logInfo(source, message, data) {
|
|
108
|
+
logDebugEvent("info", source, message, data);
|
|
109
|
+
}
|
|
110
|
+
function getDebugEvents() {
|
|
111
|
+
return [...events];
|
|
112
|
+
}
|
|
113
|
+
function getRecentEvents(count) {
|
|
114
|
+
return events.slice(0, count);
|
|
115
|
+
}
|
|
116
|
+
function getEventsByType(type) {
|
|
117
|
+
return events.filter((e) => e.type === type);
|
|
118
|
+
}
|
|
119
|
+
function getEventsBySource(source) {
|
|
120
|
+
return events.filter((e) => e.source === source);
|
|
121
|
+
}
|
|
122
|
+
function subscribeToDebugEvents(listener) {
|
|
123
|
+
listeners2.add(listener);
|
|
124
|
+
return () => listeners2.delete(listener);
|
|
125
|
+
}
|
|
126
|
+
function clearDebugEvents() {
|
|
127
|
+
events.length = 0;
|
|
128
|
+
notifyListeners();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// lib/guardRegistry.ts
|
|
132
|
+
var guardHistory = [];
|
|
133
|
+
var listeners3 = /* @__PURE__ */ new Set();
|
|
134
|
+
var MAX_HISTORY = 100;
|
|
135
|
+
function notifyListeners2() {
|
|
136
|
+
listeners3.forEach((listener) => listener());
|
|
137
|
+
}
|
|
138
|
+
function recordGuardEvaluation(evaluation) {
|
|
139
|
+
const entry = {
|
|
140
|
+
...evaluation,
|
|
141
|
+
id: `guard-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,
|
|
142
|
+
timestamp: Date.now()
|
|
143
|
+
};
|
|
144
|
+
guardHistory.unshift(entry);
|
|
145
|
+
if (guardHistory.length > MAX_HISTORY) {
|
|
146
|
+
guardHistory.pop();
|
|
147
|
+
}
|
|
148
|
+
notifyListeners2();
|
|
149
|
+
}
|
|
150
|
+
function getGuardHistory() {
|
|
151
|
+
return [...guardHistory];
|
|
152
|
+
}
|
|
153
|
+
function getRecentGuardEvaluations(count) {
|
|
154
|
+
return guardHistory.slice(0, count);
|
|
155
|
+
}
|
|
156
|
+
function getGuardEvaluationsForTrait(traitName) {
|
|
157
|
+
return guardHistory.filter((g) => g.traitName === traitName);
|
|
158
|
+
}
|
|
159
|
+
function subscribeToGuardChanges(listener) {
|
|
160
|
+
listeners3.add(listener);
|
|
161
|
+
return () => listeners3.delete(listener);
|
|
162
|
+
}
|
|
163
|
+
function clearGuardHistory() {
|
|
164
|
+
guardHistory.length = 0;
|
|
165
|
+
notifyListeners2();
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// lib/tickRegistry.ts
|
|
169
|
+
var ticks = /* @__PURE__ */ new Map();
|
|
170
|
+
var listeners4 = /* @__PURE__ */ new Set();
|
|
171
|
+
function notifyListeners3() {
|
|
172
|
+
listeners4.forEach((listener) => listener());
|
|
173
|
+
}
|
|
174
|
+
function registerTick(tick) {
|
|
175
|
+
ticks.set(tick.id, tick);
|
|
176
|
+
notifyListeners3();
|
|
177
|
+
}
|
|
178
|
+
function updateTickExecution(id, timestamp) {
|
|
179
|
+
const tick = ticks.get(id);
|
|
180
|
+
if (tick) {
|
|
181
|
+
tick.lastExecuted = timestamp;
|
|
182
|
+
tick.nextExecution = timestamp + tick.interval;
|
|
183
|
+
tick.executionCount++;
|
|
184
|
+
notifyListeners3();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function setTickActive(id, isActive) {
|
|
188
|
+
const tick = ticks.get(id);
|
|
189
|
+
if (tick) {
|
|
190
|
+
tick.isActive = isActive;
|
|
191
|
+
notifyListeners3();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
function unregisterTick(id) {
|
|
195
|
+
ticks.delete(id);
|
|
196
|
+
notifyListeners3();
|
|
197
|
+
}
|
|
198
|
+
function getAllTicks() {
|
|
199
|
+
return Array.from(ticks.values());
|
|
200
|
+
}
|
|
201
|
+
function getTick(id) {
|
|
202
|
+
return ticks.get(id);
|
|
203
|
+
}
|
|
204
|
+
function subscribeToTickChanges(listener) {
|
|
205
|
+
listeners4.add(listener);
|
|
206
|
+
return () => listeners4.delete(listener);
|
|
207
|
+
}
|
|
208
|
+
function clearTicks() {
|
|
209
|
+
ticks.clear();
|
|
210
|
+
notifyListeners3();
|
|
211
|
+
}
|
|
212
|
+
|
|
1
213
|
// lib/visualizer/index.ts
|
|
2
214
|
function formatSExprGuardToDomain(guard, _entityName) {
|
|
3
215
|
if (Array.isArray(guard)) {
|
|
@@ -744,216 +956,4 @@ function parseContentSegments(content) {
|
|
|
744
956
|
return segments;
|
|
745
957
|
}
|
|
746
958
|
|
|
747
|
-
// lib/tickRegistry.ts
|
|
748
|
-
var ticks = /* @__PURE__ */ new Map();
|
|
749
|
-
var listeners = /* @__PURE__ */ new Set();
|
|
750
|
-
function notifyListeners() {
|
|
751
|
-
listeners.forEach((listener) => listener());
|
|
752
|
-
}
|
|
753
|
-
function registerTick(tick) {
|
|
754
|
-
ticks.set(tick.id, tick);
|
|
755
|
-
notifyListeners();
|
|
756
|
-
}
|
|
757
|
-
function updateTickExecution(id, timestamp) {
|
|
758
|
-
const tick = ticks.get(id);
|
|
759
|
-
if (tick) {
|
|
760
|
-
tick.lastExecuted = timestamp;
|
|
761
|
-
tick.nextExecution = timestamp + tick.interval;
|
|
762
|
-
tick.executionCount++;
|
|
763
|
-
notifyListeners();
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
function setTickActive(id, isActive) {
|
|
767
|
-
const tick = ticks.get(id);
|
|
768
|
-
if (tick) {
|
|
769
|
-
tick.isActive = isActive;
|
|
770
|
-
notifyListeners();
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
function unregisterTick(id) {
|
|
774
|
-
ticks.delete(id);
|
|
775
|
-
notifyListeners();
|
|
776
|
-
}
|
|
777
|
-
function getAllTicks() {
|
|
778
|
-
return Array.from(ticks.values());
|
|
779
|
-
}
|
|
780
|
-
function getTick(id) {
|
|
781
|
-
return ticks.get(id);
|
|
782
|
-
}
|
|
783
|
-
function subscribeToTickChanges(listener) {
|
|
784
|
-
listeners.add(listener);
|
|
785
|
-
return () => listeners.delete(listener);
|
|
786
|
-
}
|
|
787
|
-
function clearTicks() {
|
|
788
|
-
ticks.clear();
|
|
789
|
-
notifyListeners();
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
// lib/guardRegistry.ts
|
|
793
|
-
var guardHistory = [];
|
|
794
|
-
var listeners2 = /* @__PURE__ */ new Set();
|
|
795
|
-
var MAX_HISTORY = 100;
|
|
796
|
-
function notifyListeners2() {
|
|
797
|
-
listeners2.forEach((listener) => listener());
|
|
798
|
-
}
|
|
799
|
-
function recordGuardEvaluation(evaluation) {
|
|
800
|
-
const entry = {
|
|
801
|
-
...evaluation,
|
|
802
|
-
id: `guard-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,
|
|
803
|
-
timestamp: Date.now()
|
|
804
|
-
};
|
|
805
|
-
guardHistory.unshift(entry);
|
|
806
|
-
if (guardHistory.length > MAX_HISTORY) {
|
|
807
|
-
guardHistory.pop();
|
|
808
|
-
}
|
|
809
|
-
notifyListeners2();
|
|
810
|
-
}
|
|
811
|
-
function getGuardHistory() {
|
|
812
|
-
return [...guardHistory];
|
|
813
|
-
}
|
|
814
|
-
function getRecentGuardEvaluations(count) {
|
|
815
|
-
return guardHistory.slice(0, count);
|
|
816
|
-
}
|
|
817
|
-
function getGuardEvaluationsForTrait(traitName) {
|
|
818
|
-
return guardHistory.filter((g) => g.traitName === traitName);
|
|
819
|
-
}
|
|
820
|
-
function subscribeToGuardChanges(listener) {
|
|
821
|
-
listeners2.add(listener);
|
|
822
|
-
return () => listeners2.delete(listener);
|
|
823
|
-
}
|
|
824
|
-
function clearGuardHistory() {
|
|
825
|
-
guardHistory.length = 0;
|
|
826
|
-
notifyListeners2();
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
// lib/entityDebug.ts
|
|
830
|
-
var entityProvider = null;
|
|
831
|
-
function setEntityProvider(provider) {
|
|
832
|
-
entityProvider = provider;
|
|
833
|
-
}
|
|
834
|
-
function clearEntityProvider() {
|
|
835
|
-
entityProvider = null;
|
|
836
|
-
}
|
|
837
|
-
function getEntitySnapshot() {
|
|
838
|
-
if (!entityProvider) {
|
|
839
|
-
return null;
|
|
840
|
-
}
|
|
841
|
-
const entities = entityProvider();
|
|
842
|
-
return {
|
|
843
|
-
entities,
|
|
844
|
-
timestamp: Date.now(),
|
|
845
|
-
totalCount: entities.length,
|
|
846
|
-
singletons: {},
|
|
847
|
-
runtime: entities.map((e) => ({ id: e.id, type: e.type, data: e.fields })),
|
|
848
|
-
persistent: {}
|
|
849
|
-
};
|
|
850
|
-
}
|
|
851
|
-
function getEntityById(id) {
|
|
852
|
-
if (!entityProvider) {
|
|
853
|
-
return void 0;
|
|
854
|
-
}
|
|
855
|
-
return entityProvider().find((e) => e.id === id);
|
|
856
|
-
}
|
|
857
|
-
function getEntitiesByType(type) {
|
|
858
|
-
if (!entityProvider) {
|
|
859
|
-
return [];
|
|
860
|
-
}
|
|
861
|
-
return entityProvider().filter((e) => e.type === type);
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
// lib/debugRegistry.ts
|
|
865
|
-
var events = [];
|
|
866
|
-
var listeners3 = /* @__PURE__ */ new Set();
|
|
867
|
-
var MAX_EVENTS = 500;
|
|
868
|
-
function notifyListeners3() {
|
|
869
|
-
listeners3.forEach((listener) => listener());
|
|
870
|
-
}
|
|
871
|
-
function logDebugEvent(type, source, message, data) {
|
|
872
|
-
const event = {
|
|
873
|
-
id: `event-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,
|
|
874
|
-
type,
|
|
875
|
-
source,
|
|
876
|
-
message,
|
|
877
|
-
data,
|
|
878
|
-
timestamp: Date.now()
|
|
879
|
-
};
|
|
880
|
-
events.unshift(event);
|
|
881
|
-
if (events.length > MAX_EVENTS) {
|
|
882
|
-
events.pop();
|
|
883
|
-
}
|
|
884
|
-
notifyListeners3();
|
|
885
|
-
}
|
|
886
|
-
function logStateChange(source, from, to, event) {
|
|
887
|
-
logDebugEvent("state-change", source, `${from} \u2192 ${to}`, { from, to, event });
|
|
888
|
-
}
|
|
889
|
-
function logEventFired(source, eventName, payload) {
|
|
890
|
-
logDebugEvent("event-fired", source, eventName, { eventName, payload });
|
|
891
|
-
}
|
|
892
|
-
function logEffectExecuted(source, effectType, details) {
|
|
893
|
-
logDebugEvent("effect-executed", source, effectType, { effectType, details });
|
|
894
|
-
}
|
|
895
|
-
function logError(source, message, error) {
|
|
896
|
-
logDebugEvent("error", source, message, { error });
|
|
897
|
-
}
|
|
898
|
-
function logWarning(source, message, data) {
|
|
899
|
-
logDebugEvent("warning", source, message, data);
|
|
900
|
-
}
|
|
901
|
-
function logInfo(source, message, data) {
|
|
902
|
-
logDebugEvent("info", source, message, data);
|
|
903
|
-
}
|
|
904
|
-
function getDebugEvents() {
|
|
905
|
-
return [...events];
|
|
906
|
-
}
|
|
907
|
-
function getRecentEvents(count) {
|
|
908
|
-
return events.slice(0, count);
|
|
909
|
-
}
|
|
910
|
-
function getEventsByType(type) {
|
|
911
|
-
return events.filter((e) => e.type === type);
|
|
912
|
-
}
|
|
913
|
-
function getEventsBySource(source) {
|
|
914
|
-
return events.filter((e) => e.source === source);
|
|
915
|
-
}
|
|
916
|
-
function subscribeToDebugEvents(listener) {
|
|
917
|
-
listeners3.add(listener);
|
|
918
|
-
return () => listeners3.delete(listener);
|
|
919
|
-
}
|
|
920
|
-
function clearDebugEvents() {
|
|
921
|
-
events.length = 0;
|
|
922
|
-
notifyListeners3();
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
// lib/debugUtils.ts
|
|
926
|
-
var DEBUG_STORAGE_KEY = "orbital-debug";
|
|
927
|
-
var listeners4 = /* @__PURE__ */ new Set();
|
|
928
|
-
function isDebugEnabled() {
|
|
929
|
-
if (typeof window === "undefined") return false;
|
|
930
|
-
return localStorage.getItem(DEBUG_STORAGE_KEY) === "true";
|
|
931
|
-
}
|
|
932
|
-
function setDebugEnabled(enabled) {
|
|
933
|
-
if (typeof window === "undefined") return;
|
|
934
|
-
localStorage.setItem(DEBUG_STORAGE_KEY, String(enabled));
|
|
935
|
-
listeners4.forEach((listener) => listener(enabled));
|
|
936
|
-
}
|
|
937
|
-
function toggleDebug() {
|
|
938
|
-
const newValue = !isDebugEnabled();
|
|
939
|
-
setDebugEnabled(newValue);
|
|
940
|
-
return newValue;
|
|
941
|
-
}
|
|
942
|
-
function onDebugToggle(listener) {
|
|
943
|
-
listeners4.add(listener);
|
|
944
|
-
return () => listeners4.delete(listener);
|
|
945
|
-
}
|
|
946
|
-
function initDebugShortcut() {
|
|
947
|
-
if (typeof window === "undefined") return () => {
|
|
948
|
-
};
|
|
949
|
-
const handleKeyDown = (e) => {
|
|
950
|
-
if (e.ctrlKey && e.shiftKey && e.key === "D") {
|
|
951
|
-
e.preventDefault();
|
|
952
|
-
toggleDebug();
|
|
953
|
-
}
|
|
954
|
-
};
|
|
955
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
956
|
-
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
957
|
-
}
|
|
958
|
-
|
|
959
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,6 +1,6 @@
|
|
|
1
1
|
import { subscribe, getSnapshot, clearEntities, removeEntity, updateSingleton, updateEntity, spawnEntity, getSingleton, getAllEntities, getByType, getEntity } from './chunk-N7MVUW4R.js';
|
|
2
2
|
import { apiClient } from './chunk-3HJHHULT.js';
|
|
3
|
-
import { SelectionContext, entityDataKeys, useEntityList } from './chunk-
|
|
3
|
+
import { SelectionContext, entityDataKeys, useEntityList } from './chunk-3CP74CBL.js';
|
|
4
4
|
import { useEventBus } from './chunk-YXZM3WCF.js';
|
|
5
5
|
import { useCallback, useState, useEffect, useMemo, useContext, useSyncExternalStore, useRef } from 'react';
|
|
6
6
|
import { useQueryClient, useMutation, useQuery } from '@tanstack/react-query';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SuspenseConfigProvider } from './chunk-
|
|
2
|
-
import { ThemeProvider } from './chunk-
|
|
3
|
-
import { SelectionProvider, EntityDataProvider } from './chunk-
|
|
1
|
+
import { SuspenseConfigProvider } from './chunk-YYCP5CD7.js';
|
|
2
|
+
import { ThemeProvider } from './chunk-YLKXEXBP.js';
|
|
3
|
+
import { SelectionProvider, EntityDataProvider } from './chunk-3CP74CBL.js';
|
|
4
4
|
import { useEventBus, EventBusProvider } from './chunk-YXZM3WCF.js';
|
|
5
5
|
import { recordTransition, registerCheck, bindEventBus, bindTraitStateGetter } from './chunk-WCTZ7WZX.js';
|
|
6
6
|
import { useOfflineExecutor } from './chunk-K2D5D3WK.js';
|
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import { useUISlotManager } from './chunk-3JGAROCW.js';
|
|
2
|
-
import { createContext, useMemo, useState, useEffect, useCallback
|
|
2
|
+
import { createContext, useMemo, useContext, useState, useEffect, useCallback } from 'react';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
+
var UISlotContext = createContext(null);
|
|
6
|
+
function UISlotProvider({ children }) {
|
|
7
|
+
const slotManager = useUISlotManager();
|
|
8
|
+
const contextValue = useMemo(() => slotManager, [slotManager]);
|
|
9
|
+
return /* @__PURE__ */ jsx(UISlotContext.Provider, { value: contextValue, children });
|
|
10
|
+
}
|
|
11
|
+
function useUISlots() {
|
|
12
|
+
const context = useContext(UISlotContext);
|
|
13
|
+
if (!context) {
|
|
14
|
+
throw new Error(
|
|
15
|
+
"useUISlots must be used within a UISlotProvider. Make sure your component tree is wrapped with <UISlotProvider>."
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
function useSlotContent(slot) {
|
|
21
|
+
const { getContent } = useUISlots();
|
|
22
|
+
return getContent(slot);
|
|
23
|
+
}
|
|
24
|
+
function useSlotHasContent(slot) {
|
|
25
|
+
const { hasContent } = useUISlots();
|
|
26
|
+
return hasContent(slot);
|
|
27
|
+
}
|
|
5
28
|
var BUILT_IN_THEMES = [
|
|
6
29
|
{
|
|
7
30
|
name: "wireframe",
|
|
@@ -252,28 +275,5 @@ function useTheme() {
|
|
|
252
275
|
return context;
|
|
253
276
|
}
|
|
254
277
|
var ThemeContext_default = ThemeContext;
|
|
255
|
-
var UISlotContext = createContext(null);
|
|
256
|
-
function UISlotProvider({ children }) {
|
|
257
|
-
const slotManager = useUISlotManager();
|
|
258
|
-
const contextValue = useMemo(() => slotManager, [slotManager]);
|
|
259
|
-
return /* @__PURE__ */ jsx(UISlotContext.Provider, { value: contextValue, children });
|
|
260
|
-
}
|
|
261
|
-
function useUISlots() {
|
|
262
|
-
const context = useContext(UISlotContext);
|
|
263
|
-
if (!context) {
|
|
264
|
-
throw new Error(
|
|
265
|
-
"useUISlots must be used within a UISlotProvider. Make sure your component tree is wrapped with <UISlotProvider>."
|
|
266
|
-
);
|
|
267
|
-
}
|
|
268
|
-
return context;
|
|
269
|
-
}
|
|
270
|
-
function useSlotContent(slot) {
|
|
271
|
-
const { getContent } = useUISlots();
|
|
272
|
-
return getContent(slot);
|
|
273
|
-
}
|
|
274
|
-
function useSlotHasContent(slot) {
|
|
275
|
-
const { hasContent } = useUISlots();
|
|
276
|
-
return hasContent(slot);
|
|
277
|
-
}
|
|
278
278
|
|
|
279
279
|
export { BUILT_IN_THEMES, ThemeContext_default, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTheme, useUISlots } from './chunk-
|
|
2
|
-
import { useTranslate, useInfiniteScroll, useQuerySingleton, useLongPress, useSwipeGesture, useDragReorder, usePullToRefresh } from './chunk-
|
|
1
|
+
import { useTheme, useUISlots } from './chunk-YLKXEXBP.js';
|
|
2
|
+
import { useTranslate, useInfiniteScroll, useQuerySingleton, useLongPress, useSwipeGesture, useDragReorder, usePullToRefresh } from './chunk-3CP74CBL.js';
|
|
3
3
|
import { useEventBus } from './chunk-YXZM3WCF.js';
|
|
4
4
|
import { cn, debugGroup, debug, debugGroupEnd, updateAssetStatus, bindCanvasCapture, getNestedValue, isDebugEnabled } from './chunk-WCTZ7WZX.js';
|
|
5
5
|
import { isPortalSlot } from './chunk-K2D5D3WK.js';
|
|
@@ -159,6 +159,18 @@ var iconSizeStyles = {
|
|
|
159
159
|
md: "h-4 w-4",
|
|
160
160
|
lg: "h-5 w-5"
|
|
161
161
|
};
|
|
162
|
+
function resolveIconProp(value, sizeClass) {
|
|
163
|
+
if (!value) return null;
|
|
164
|
+
if (typeof value === "string") {
|
|
165
|
+
const Resolved = resolveIcon(value);
|
|
166
|
+
return Resolved ? /* @__PURE__ */ jsx(Resolved, { className: sizeClass }) : null;
|
|
167
|
+
}
|
|
168
|
+
if (typeof value === "function") {
|
|
169
|
+
const IconComp = value;
|
|
170
|
+
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
171
|
+
}
|
|
172
|
+
return value;
|
|
173
|
+
}
|
|
162
174
|
var Button = React80__default.forwardRef(
|
|
163
175
|
({
|
|
164
176
|
className,
|
|
@@ -178,10 +190,10 @@ var Button = React80__default.forwardRef(
|
|
|
178
190
|
...props
|
|
179
191
|
}, ref) => {
|
|
180
192
|
const eventBus = useEventBus();
|
|
181
|
-
const
|
|
182
|
-
const
|
|
183
|
-
const resolvedLeftIcon =
|
|
184
|
-
const resolvedRightIcon =
|
|
193
|
+
const leftIconValue = leftIcon || iconProp;
|
|
194
|
+
const rightIconValue = rightIcon || iconRightProp;
|
|
195
|
+
const resolvedLeftIcon = resolveIconProp(leftIconValue, iconSizeStyles[size]);
|
|
196
|
+
const resolvedRightIcon = resolveIconProp(rightIconValue, iconSizeStyles[size]);
|
|
185
197
|
const handleClick = (e) => {
|
|
186
198
|
if (action) {
|
|
187
199
|
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
@@ -9257,16 +9269,16 @@ function DialogueBox({
|
|
|
9257
9269
|
const [displayedText, setDisplayedText] = useState("");
|
|
9258
9270
|
const [isTyping, setIsTyping] = useState(false);
|
|
9259
9271
|
const [selectedChoice, setSelectedChoice] = useState(0);
|
|
9260
|
-
const textRef = useRef(dialogue.text);
|
|
9272
|
+
const textRef = useRef(dialogue.text ?? "");
|
|
9261
9273
|
const charIndexRef = useRef(0);
|
|
9262
9274
|
const autoAdvanceTimerRef = useRef(null);
|
|
9263
9275
|
useEffect(() => {
|
|
9264
|
-
textRef.current = dialogue.text;
|
|
9276
|
+
textRef.current = dialogue.text ?? "";
|
|
9265
9277
|
charIndexRef.current = 0;
|
|
9266
9278
|
setDisplayedText("");
|
|
9267
9279
|
setSelectedChoice(0);
|
|
9268
9280
|
if (typewriterSpeed === 0) {
|
|
9269
|
-
setDisplayedText(dialogue.text);
|
|
9281
|
+
setDisplayedText(dialogue.text ?? "");
|
|
9270
9282
|
setIsTyping(false);
|
|
9271
9283
|
if (completeEvent) eventBus.emit(`UI:${completeEvent}`, {});
|
|
9272
9284
|
onComplete?.();
|
|
@@ -9466,12 +9478,13 @@ function CombatLog({
|
|
|
9466
9478
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
9467
9479
|
}
|
|
9468
9480
|
}, [events, autoScroll]);
|
|
9469
|
-
const
|
|
9481
|
+
const safeEvents = events ?? [];
|
|
9482
|
+
const visibleEvents = safeEvents.slice(-maxVisible);
|
|
9470
9483
|
return /* @__PURE__ */ jsxs(Card, { variant: "default", className: cn("flex flex-col", className), children: [
|
|
9471
9484
|
/* @__PURE__ */ jsx(Box, { padding: "sm", border: true, className: "border-b-2 border-x-0 border-t-0 border-[var(--color-border)]", children: /* @__PURE__ */ jsxs(Box, { display: "flex", className: "items-center justify-between", children: [
|
|
9472
9485
|
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "font-bold", children: title }),
|
|
9473
9486
|
/* @__PURE__ */ jsxs(Badge, { variant: "neutral", size: "sm", children: [
|
|
9474
|
-
|
|
9487
|
+
safeEvents.length,
|
|
9475
9488
|
" events"
|
|
9476
9489
|
] })
|
|
9477
9490
|
] }) }),
|
|
@@ -12241,6 +12254,7 @@ var DataGrid = ({
|
|
|
12241
12254
|
Box,
|
|
12242
12255
|
{
|
|
12243
12256
|
"data-entity-row": true,
|
|
12257
|
+
"data-entity-id": id,
|
|
12244
12258
|
className: cn(
|
|
12245
12259
|
"bg-[var(--color-card)] rounded-[var(--radius-lg)]",
|
|
12246
12260
|
"border border-[var(--color-border)]",
|
|
@@ -12259,6 +12273,7 @@ var DataGrid = ({
|
|
|
12259
12273
|
Box,
|
|
12260
12274
|
{
|
|
12261
12275
|
"data-entity-row": true,
|
|
12276
|
+
"data-entity-id": id,
|
|
12262
12277
|
className: cn(
|
|
12263
12278
|
"bg-[var(--color-card)] rounded-[var(--radius-lg)]",
|
|
12264
12279
|
"border border-[var(--color-border)]",
|
|
@@ -12568,7 +12583,7 @@ var DataList = ({
|
|
|
12568
12583
|
const renderItem = (itemData, index, isLast) => {
|
|
12569
12584
|
if (hasRenderProp) {
|
|
12570
12585
|
const id2 = itemData.id || String(index);
|
|
12571
|
-
return /* @__PURE__ */ jsxs(Box, { "data-entity-row": true, children: [
|
|
12586
|
+
return /* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, children: [
|
|
12572
12587
|
/* @__PURE__ */ jsxs(
|
|
12573
12588
|
Box,
|
|
12574
12589
|
{
|
|
@@ -12615,7 +12630,7 @@ var DataList = ({
|
|
|
12615
12630
|
}
|
|
12616
12631
|
const id = itemData.id || String(index);
|
|
12617
12632
|
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
12618
|
-
return /* @__PURE__ */ jsxs(Box, { "data-entity-row": true, children: [
|
|
12633
|
+
return /* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, children: [
|
|
12619
12634
|
/* @__PURE__ */ jsxs(
|
|
12620
12635
|
Box,
|
|
12621
12636
|
{
|
|
@@ -8,8 +8,8 @@ import { E as EventBusContextType } from '../event-bus-types-CjJduURa.js';
|
|
|
8
8
|
export { a as EventListener, K as KFlowEvent, U as Unsubscribe } from '../event-bus-types-CjJduURa.js';
|
|
9
9
|
import { I as IsometricTile, a as IsometricUnit, b as IsometricFeature, C as CameraState } from '../isometric-ynNHVPZx.js';
|
|
10
10
|
import { OrbitalEntity } from '@almadar/core';
|
|
11
|
-
import { c as DomLayoutData, e as DomStateNode, n as VisualizerConfig, f as DomTransitionLabel, a as ContentSegment } from '../
|
|
12
|
-
export { s as cn } from '../
|
|
11
|
+
import { c as DomLayoutData, e as DomStateNode, n as VisualizerConfig, f as DomTransitionLabel, a as ContentSegment } from '../parseContentSegments-BZrQRvgK.js';
|
|
12
|
+
export { s as cn } from '../parseContentSegments-BZrQRvgK.js';
|
|
13
13
|
import { S as SlotContent, a as UISlot } from '../useUISlots-BBjNvQtb.js';
|
|
14
14
|
export { D as DEFAULT_SLOTS, R as RenderUIConfig, b as SlotAnimation, c as SlotChangeCallback, U as UISlotManager, u as useUISlotManager } from '../useUISlots-BBjNvQtb.js';
|
|
15
15
|
export { Entity, clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../stores/index.js';
|
|
@@ -22,14 +22,14 @@ interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElem
|
|
|
22
22
|
variant?: ButtonVariant;
|
|
23
23
|
size?: ButtonSize;
|
|
24
24
|
isLoading?: boolean;
|
|
25
|
-
/** Left icon as ReactNode (
|
|
26
|
-
leftIcon?: React__default.ReactNode;
|
|
27
|
-
/** Right icon as ReactNode
|
|
28
|
-
rightIcon?: React__default.ReactNode;
|
|
29
|
-
/**
|
|
30
|
-
icon?: LucideIcon | string;
|
|
31
|
-
/**
|
|
32
|
-
iconRight?: LucideIcon | string;
|
|
25
|
+
/** Left icon as ReactNode, Lucide component, or string name (e.g. "plus", "trash") */
|
|
26
|
+
leftIcon?: React__default.ReactNode | LucideIcon | string;
|
|
27
|
+
/** Right icon as ReactNode, Lucide component, or string name */
|
|
28
|
+
rightIcon?: React__default.ReactNode | LucideIcon | string;
|
|
29
|
+
/** Alias for leftIcon */
|
|
30
|
+
icon?: React__default.ReactNode | LucideIcon | string;
|
|
31
|
+
/** Alias for rightIcon */
|
|
32
|
+
iconRight?: React__default.ReactNode | LucideIcon | string;
|
|
33
33
|
/** Declarative event name — emits UI:{action} via eventBus on click */
|
|
34
34
|
action?: string;
|
|
35
35
|
/** Payload to include with the action event */
|