@almadar/ui 4.10.2 → 4.10.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/avl/index.cjs +16 -28
- package/dist/avl/index.js +16 -28
- package/dist/components/index.cjs +16 -2
- package/dist/components/index.js +16 -2
- package/dist/components/organisms/game/three/index.cjs +15 -1
- package/dist/components/organisms/game/three/index.js +15 -1
- package/dist/docs/index.cjs +15 -1
- package/dist/docs/index.js +15 -1
- package/dist/hooks/index.cjs +15 -1
- package/dist/hooks/index.js +15 -1
- package/dist/marketing/index.cjs +15 -1
- package/dist/marketing/index.js +15 -1
- package/dist/providers/index.cjs +16 -2
- package/dist/providers/index.js +16 -2
- package/dist/runtime/index.cjs +16 -28
- package/dist/runtime/index.js +16 -28
- package/package.json +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -3145,13 +3145,26 @@ function useEventBus() {
|
|
|
3145
3145
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
3146
3146
|
const scope = useTraitScope();
|
|
3147
3147
|
return React128.useMemo(() => {
|
|
3148
|
-
if (!scope)
|
|
3148
|
+
if (!scope) {
|
|
3149
|
+
return {
|
|
3150
|
+
...baseBus,
|
|
3151
|
+
emit: (type, payload, source) => {
|
|
3152
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
3153
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
3154
|
+
}
|
|
3155
|
+
baseBus.emit(type, payload, source);
|
|
3156
|
+
}
|
|
3157
|
+
};
|
|
3158
|
+
}
|
|
3149
3159
|
return {
|
|
3150
3160
|
...baseBus,
|
|
3151
3161
|
emit: (type, payload, source) => {
|
|
3152
3162
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
3153
3163
|
const tail = type.slice(3);
|
|
3154
3164
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
3165
|
+
if (qualified !== type) {
|
|
3166
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
3167
|
+
}
|
|
3155
3168
|
baseBus.emit(qualified, payload, source);
|
|
3156
3169
|
return;
|
|
3157
3170
|
}
|
|
@@ -3183,7 +3196,7 @@ function useEmitEvent() {
|
|
|
3183
3196
|
[eventBus]
|
|
3184
3197
|
);
|
|
3185
3198
|
}
|
|
3186
|
-
var log, subLog2, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
3199
|
+
var log, subLog2, scopeLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
3187
3200
|
var init_useEventBus = __esm({
|
|
3188
3201
|
"hooks/useEventBus.ts"() {
|
|
3189
3202
|
"use client";
|
|
@@ -3192,6 +3205,7 @@ var init_useEventBus = __esm({
|
|
|
3192
3205
|
init_logger();
|
|
3193
3206
|
log = createLogger("almadar:eventbus");
|
|
3194
3207
|
subLog2 = createLogger("almadar:eventbus:subscribe");
|
|
3208
|
+
scopeLog = createLogger("almadar:ui:trait-scope");
|
|
3195
3209
|
fallbackListeners = /* @__PURE__ */ new Map();
|
|
3196
3210
|
fallbackAnyListeners = /* @__PURE__ */ new Set();
|
|
3197
3211
|
fallbackEventBus = {
|
|
@@ -52070,32 +52084,6 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
52070
52084
|
fromBridge: true
|
|
52071
52085
|
});
|
|
52072
52086
|
}
|
|
52073
|
-
const executedTraits = new Set(results.map((r2) => r2.traitName));
|
|
52074
|
-
for (const binding of bindings) {
|
|
52075
|
-
const traitName = binding.trait.name;
|
|
52076
|
-
if (executedTraits.has(traitName)) continue;
|
|
52077
|
-
const { events: traitEvents, transitions: traitTransitions } = binding.trait;
|
|
52078
|
-
const eventDeclared = traitEvents.some((e) => e.key === normalizedEvent);
|
|
52079
|
-
const hasTransition = traitTransitions.some((t) => t.event === normalizedEvent);
|
|
52080
|
-
crossTraitLog.debug("rebroadcast:second-pass:candidate", {
|
|
52081
|
-
event: normalizedEvent,
|
|
52082
|
-
traitName,
|
|
52083
|
-
eventDeclared,
|
|
52084
|
-
hasTransition,
|
|
52085
|
-
orbitalName: orbitalsByTrait?.[traitName],
|
|
52086
|
-
traitEventKeys: traitEvents.map((e) => e.key).join(",")
|
|
52087
|
-
});
|
|
52088
|
-
if (!eventDeclared || hasTransition) continue;
|
|
52089
|
-
const orbitalName = orbitalsByTrait?.[traitName];
|
|
52090
|
-
if (!orbitalName) continue;
|
|
52091
|
-
const busKey = `UI:${orbitalName}.${traitName}.${normalizedEvent}`;
|
|
52092
|
-
crossTraitLog.info("rebroadcast:emit", { busKey, traitName, event: normalizedEvent });
|
|
52093
|
-
eventBus.emit(busKey, payload, {
|
|
52094
|
-
orbital: orbitalName,
|
|
52095
|
-
trait: traitName,
|
|
52096
|
-
fromBridge: true
|
|
52097
|
-
});
|
|
52098
|
-
}
|
|
52099
52087
|
}
|
|
52100
52088
|
if (results.length > 0) {
|
|
52101
52089
|
setTraitStates(currentManager.getAllStates());
|
package/dist/avl/index.js
CHANGED
|
@@ -3099,13 +3099,26 @@ function useEventBus() {
|
|
|
3099
3099
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
3100
3100
|
const scope = useTraitScope();
|
|
3101
3101
|
return useMemo(() => {
|
|
3102
|
-
if (!scope)
|
|
3102
|
+
if (!scope) {
|
|
3103
|
+
return {
|
|
3104
|
+
...baseBus,
|
|
3105
|
+
emit: (type, payload, source) => {
|
|
3106
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
3107
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
3108
|
+
}
|
|
3109
|
+
baseBus.emit(type, payload, source);
|
|
3110
|
+
}
|
|
3111
|
+
};
|
|
3112
|
+
}
|
|
3103
3113
|
return {
|
|
3104
3114
|
...baseBus,
|
|
3105
3115
|
emit: (type, payload, source) => {
|
|
3106
3116
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
3107
3117
|
const tail = type.slice(3);
|
|
3108
3118
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
3119
|
+
if (qualified !== type) {
|
|
3120
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
3121
|
+
}
|
|
3109
3122
|
baseBus.emit(qualified, payload, source);
|
|
3110
3123
|
return;
|
|
3111
3124
|
}
|
|
@@ -3137,7 +3150,7 @@ function useEmitEvent() {
|
|
|
3137
3150
|
[eventBus]
|
|
3138
3151
|
);
|
|
3139
3152
|
}
|
|
3140
|
-
var log, subLog2, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
3153
|
+
var log, subLog2, scopeLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
3141
3154
|
var init_useEventBus = __esm({
|
|
3142
3155
|
"hooks/useEventBus.ts"() {
|
|
3143
3156
|
"use client";
|
|
@@ -3146,6 +3159,7 @@ var init_useEventBus = __esm({
|
|
|
3146
3159
|
init_logger();
|
|
3147
3160
|
log = createLogger("almadar:eventbus");
|
|
3148
3161
|
subLog2 = createLogger("almadar:eventbus:subscribe");
|
|
3162
|
+
scopeLog = createLogger("almadar:ui:trait-scope");
|
|
3149
3163
|
fallbackListeners = /* @__PURE__ */ new Map();
|
|
3150
3164
|
fallbackAnyListeners = /* @__PURE__ */ new Set();
|
|
3151
3165
|
fallbackEventBus = {
|
|
@@ -52024,32 +52038,6 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
52024
52038
|
fromBridge: true
|
|
52025
52039
|
});
|
|
52026
52040
|
}
|
|
52027
|
-
const executedTraits = new Set(results.map((r2) => r2.traitName));
|
|
52028
|
-
for (const binding of bindings) {
|
|
52029
|
-
const traitName = binding.trait.name;
|
|
52030
|
-
if (executedTraits.has(traitName)) continue;
|
|
52031
|
-
const { events: traitEvents, transitions: traitTransitions } = binding.trait;
|
|
52032
|
-
const eventDeclared = traitEvents.some((e) => e.key === normalizedEvent);
|
|
52033
|
-
const hasTransition = traitTransitions.some((t) => t.event === normalizedEvent);
|
|
52034
|
-
crossTraitLog.debug("rebroadcast:second-pass:candidate", {
|
|
52035
|
-
event: normalizedEvent,
|
|
52036
|
-
traitName,
|
|
52037
|
-
eventDeclared,
|
|
52038
|
-
hasTransition,
|
|
52039
|
-
orbitalName: orbitalsByTrait?.[traitName],
|
|
52040
|
-
traitEventKeys: traitEvents.map((e) => e.key).join(",")
|
|
52041
|
-
});
|
|
52042
|
-
if (!eventDeclared || hasTransition) continue;
|
|
52043
|
-
const orbitalName = orbitalsByTrait?.[traitName];
|
|
52044
|
-
if (!orbitalName) continue;
|
|
52045
|
-
const busKey = `UI:${orbitalName}.${traitName}.${normalizedEvent}`;
|
|
52046
|
-
crossTraitLog.info("rebroadcast:emit", { busKey, traitName, event: normalizedEvent });
|
|
52047
|
-
eventBus.emit(busKey, payload, {
|
|
52048
|
-
orbital: orbitalName,
|
|
52049
|
-
trait: traitName,
|
|
52050
|
-
fromBridge: true
|
|
52051
|
-
});
|
|
52052
|
-
}
|
|
52053
52041
|
}
|
|
52054
52042
|
if (results.length > 0) {
|
|
52055
52043
|
setTraitStates(currentManager.getAllStates());
|
|
@@ -192,13 +192,26 @@ function useEventBus() {
|
|
|
192
192
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
193
193
|
const scope = providers.useTraitScope();
|
|
194
194
|
return React111.useMemo(() => {
|
|
195
|
-
if (!scope)
|
|
195
|
+
if (!scope) {
|
|
196
|
+
return {
|
|
197
|
+
...baseBus,
|
|
198
|
+
emit: (type, payload, source) => {
|
|
199
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
200
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
201
|
+
}
|
|
202
|
+
baseBus.emit(type, payload, source);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
}
|
|
196
206
|
return {
|
|
197
207
|
...baseBus,
|
|
198
208
|
emit: (type, payload, source) => {
|
|
199
209
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
200
210
|
const tail = type.slice(3);
|
|
201
211
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
212
|
+
if (qualified !== type) {
|
|
213
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
214
|
+
}
|
|
202
215
|
baseBus.emit(qualified, payload, source);
|
|
203
216
|
return;
|
|
204
217
|
}
|
|
@@ -230,13 +243,14 @@ function useEmitEvent() {
|
|
|
230
243
|
[eventBus]
|
|
231
244
|
);
|
|
232
245
|
}
|
|
233
|
-
var log, subLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
246
|
+
var log, subLog, scopeLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
234
247
|
var init_useEventBus = __esm({
|
|
235
248
|
"hooks/useEventBus.ts"() {
|
|
236
249
|
"use client";
|
|
237
250
|
init_logger();
|
|
238
251
|
log = createLogger("almadar:eventbus");
|
|
239
252
|
subLog = createLogger("almadar:eventbus:subscribe");
|
|
253
|
+
scopeLog = createLogger("almadar:ui:trait-scope");
|
|
240
254
|
fallbackListeners = /* @__PURE__ */ new Map();
|
|
241
255
|
fallbackAnyListeners = /* @__PURE__ */ new Set();
|
|
242
256
|
fallbackEventBus = {
|
package/dist/components/index.js
CHANGED
|
@@ -147,13 +147,26 @@ function useEventBus() {
|
|
|
147
147
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
148
148
|
const scope = useTraitScope();
|
|
149
149
|
return useMemo(() => {
|
|
150
|
-
if (!scope)
|
|
150
|
+
if (!scope) {
|
|
151
|
+
return {
|
|
152
|
+
...baseBus,
|
|
153
|
+
emit: (type, payload, source) => {
|
|
154
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
155
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
156
|
+
}
|
|
157
|
+
baseBus.emit(type, payload, source);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
151
161
|
return {
|
|
152
162
|
...baseBus,
|
|
153
163
|
emit: (type, payload, source) => {
|
|
154
164
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
155
165
|
const tail = type.slice(3);
|
|
156
166
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
167
|
+
if (qualified !== type) {
|
|
168
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
169
|
+
}
|
|
157
170
|
baseBus.emit(qualified, payload, source);
|
|
158
171
|
return;
|
|
159
172
|
}
|
|
@@ -185,13 +198,14 @@ function useEmitEvent() {
|
|
|
185
198
|
[eventBus]
|
|
186
199
|
);
|
|
187
200
|
}
|
|
188
|
-
var log, subLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
201
|
+
var log, subLog, scopeLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
189
202
|
var init_useEventBus = __esm({
|
|
190
203
|
"hooks/useEventBus.ts"() {
|
|
191
204
|
"use client";
|
|
192
205
|
init_logger();
|
|
193
206
|
log = createLogger("almadar:eventbus");
|
|
194
207
|
subLog = createLogger("almadar:eventbus:subscribe");
|
|
208
|
+
scopeLog = createLogger("almadar:ui:trait-scope");
|
|
195
209
|
fallbackListeners = /* @__PURE__ */ new Map();
|
|
196
210
|
fallbackAnyListeners = /* @__PURE__ */ new Set();
|
|
197
211
|
fallbackEventBus = {
|
|
@@ -1427,6 +1427,7 @@ function createLogger(namespace) {
|
|
|
1427
1427
|
// hooks/useEventBus.ts
|
|
1428
1428
|
var log = createLogger("almadar:eventbus");
|
|
1429
1429
|
var subLog = createLogger("almadar:eventbus:subscribe");
|
|
1430
|
+
var scopeLog = createLogger("almadar:ui:trait-scope");
|
|
1430
1431
|
function getGlobalEventBus() {
|
|
1431
1432
|
if (typeof window !== "undefined") {
|
|
1432
1433
|
return window.__kflowEventBus ?? null;
|
|
@@ -1502,13 +1503,26 @@ function useEventBus() {
|
|
|
1502
1503
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
1503
1504
|
const scope = providers.useTraitScope();
|
|
1504
1505
|
return React21.useMemo(() => {
|
|
1505
|
-
if (!scope)
|
|
1506
|
+
if (!scope) {
|
|
1507
|
+
return {
|
|
1508
|
+
...baseBus,
|
|
1509
|
+
emit: (type, payload, source) => {
|
|
1510
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
1511
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
1512
|
+
}
|
|
1513
|
+
baseBus.emit(type, payload, source);
|
|
1514
|
+
}
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1506
1517
|
return {
|
|
1507
1518
|
...baseBus,
|
|
1508
1519
|
emit: (type, payload, source) => {
|
|
1509
1520
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
1510
1521
|
const tail = type.slice(3);
|
|
1511
1522
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
1523
|
+
if (qualified !== type) {
|
|
1524
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
1525
|
+
}
|
|
1512
1526
|
baseBus.emit(qualified, payload, source);
|
|
1513
1527
|
return;
|
|
1514
1528
|
}
|
|
@@ -1403,6 +1403,7 @@ function createLogger(namespace) {
|
|
|
1403
1403
|
// hooks/useEventBus.ts
|
|
1404
1404
|
var log = createLogger("almadar:eventbus");
|
|
1405
1405
|
var subLog = createLogger("almadar:eventbus:subscribe");
|
|
1406
|
+
var scopeLog = createLogger("almadar:ui:trait-scope");
|
|
1406
1407
|
function getGlobalEventBus() {
|
|
1407
1408
|
if (typeof window !== "undefined") {
|
|
1408
1409
|
return window.__kflowEventBus ?? null;
|
|
@@ -1478,13 +1479,26 @@ function useEventBus() {
|
|
|
1478
1479
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
1479
1480
|
const scope = useTraitScope();
|
|
1480
1481
|
return useMemo(() => {
|
|
1481
|
-
if (!scope)
|
|
1482
|
+
if (!scope) {
|
|
1483
|
+
return {
|
|
1484
|
+
...baseBus,
|
|
1485
|
+
emit: (type, payload, source) => {
|
|
1486
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
1487
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
1488
|
+
}
|
|
1489
|
+
baseBus.emit(type, payload, source);
|
|
1490
|
+
}
|
|
1491
|
+
};
|
|
1492
|
+
}
|
|
1482
1493
|
return {
|
|
1483
1494
|
...baseBus,
|
|
1484
1495
|
emit: (type, payload, source) => {
|
|
1485
1496
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
1486
1497
|
const tail = type.slice(3);
|
|
1487
1498
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
1499
|
+
if (qualified !== type) {
|
|
1500
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
1501
|
+
}
|
|
1488
1502
|
baseBus.emit(qualified, payload, source);
|
|
1489
1503
|
return;
|
|
1490
1504
|
}
|
package/dist/docs/index.cjs
CHANGED
|
@@ -2565,6 +2565,7 @@ function useTraitScope() {
|
|
|
2565
2565
|
// hooks/useEventBus.ts
|
|
2566
2566
|
var log = createLogger("almadar:eventbus");
|
|
2567
2567
|
var subLog2 = createLogger("almadar:eventbus:subscribe");
|
|
2568
|
+
var scopeLog = createLogger("almadar:ui:trait-scope");
|
|
2568
2569
|
function getGlobalEventBus() {
|
|
2569
2570
|
if (typeof window !== "undefined") {
|
|
2570
2571
|
return window.__kflowEventBus ?? null;
|
|
@@ -2640,13 +2641,26 @@ function useEventBus() {
|
|
|
2640
2641
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
2641
2642
|
const scope = useTraitScope();
|
|
2642
2643
|
return React5.useMemo(() => {
|
|
2643
|
-
if (!scope)
|
|
2644
|
+
if (!scope) {
|
|
2645
|
+
return {
|
|
2646
|
+
...baseBus,
|
|
2647
|
+
emit: (type, payload, source) => {
|
|
2648
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
2649
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
2650
|
+
}
|
|
2651
|
+
baseBus.emit(type, payload, source);
|
|
2652
|
+
}
|
|
2653
|
+
};
|
|
2654
|
+
}
|
|
2644
2655
|
return {
|
|
2645
2656
|
...baseBus,
|
|
2646
2657
|
emit: (type, payload, source) => {
|
|
2647
2658
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
2648
2659
|
const tail = type.slice(3);
|
|
2649
2660
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
2661
|
+
if (qualified !== type) {
|
|
2662
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
2663
|
+
}
|
|
2650
2664
|
baseBus.emit(qualified, payload, source);
|
|
2651
2665
|
return;
|
|
2652
2666
|
}
|
package/dist/docs/index.js
CHANGED
|
@@ -2541,6 +2541,7 @@ function useTraitScope() {
|
|
|
2541
2541
|
// hooks/useEventBus.ts
|
|
2542
2542
|
var log = createLogger("almadar:eventbus");
|
|
2543
2543
|
var subLog2 = createLogger("almadar:eventbus:subscribe");
|
|
2544
|
+
var scopeLog = createLogger("almadar:ui:trait-scope");
|
|
2544
2545
|
function getGlobalEventBus() {
|
|
2545
2546
|
if (typeof window !== "undefined") {
|
|
2546
2547
|
return window.__kflowEventBus ?? null;
|
|
@@ -2616,13 +2617,26 @@ function useEventBus() {
|
|
|
2616
2617
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
2617
2618
|
const scope = useTraitScope();
|
|
2618
2619
|
return useMemo(() => {
|
|
2619
|
-
if (!scope)
|
|
2620
|
+
if (!scope) {
|
|
2621
|
+
return {
|
|
2622
|
+
...baseBus,
|
|
2623
|
+
emit: (type, payload, source) => {
|
|
2624
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
2625
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
2626
|
+
}
|
|
2627
|
+
baseBus.emit(type, payload, source);
|
|
2628
|
+
}
|
|
2629
|
+
};
|
|
2630
|
+
}
|
|
2620
2631
|
return {
|
|
2621
2632
|
...baseBus,
|
|
2622
2633
|
emit: (type, payload, source) => {
|
|
2623
2634
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
2624
2635
|
const tail = type.slice(3);
|
|
2625
2636
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
2637
|
+
if (qualified !== type) {
|
|
2638
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
2639
|
+
}
|
|
2626
2640
|
baseBus.emit(qualified, payload, source);
|
|
2627
2641
|
return;
|
|
2628
2642
|
}
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -919,6 +919,7 @@ function createLogger(namespace) {
|
|
|
919
919
|
// hooks/useEventBus.ts
|
|
920
920
|
var log = createLogger("almadar:eventbus");
|
|
921
921
|
var subLog = createLogger("almadar:eventbus:subscribe");
|
|
922
|
+
var scopeLog = createLogger("almadar:ui:trait-scope");
|
|
922
923
|
function getGlobalEventBus() {
|
|
923
924
|
if (typeof window !== "undefined") {
|
|
924
925
|
return window.__kflowEventBus ?? null;
|
|
@@ -994,13 +995,26 @@ function useEventBus() {
|
|
|
994
995
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
995
996
|
const scope = providers.useTraitScope();
|
|
996
997
|
return react.useMemo(() => {
|
|
997
|
-
if (!scope)
|
|
998
|
+
if (!scope) {
|
|
999
|
+
return {
|
|
1000
|
+
...baseBus,
|
|
1001
|
+
emit: (type, payload, source) => {
|
|
1002
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
1003
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
1004
|
+
}
|
|
1005
|
+
baseBus.emit(type, payload, source);
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
998
1009
|
return {
|
|
999
1010
|
...baseBus,
|
|
1000
1011
|
emit: (type, payload, source) => {
|
|
1001
1012
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
1002
1013
|
const tail = type.slice(3);
|
|
1003
1014
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
1015
|
+
if (qualified !== type) {
|
|
1016
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
1017
|
+
}
|
|
1004
1018
|
baseBus.emit(qualified, payload, source);
|
|
1005
1019
|
return;
|
|
1006
1020
|
}
|
package/dist/hooks/index.js
CHANGED
|
@@ -917,6 +917,7 @@ function createLogger(namespace) {
|
|
|
917
917
|
// hooks/useEventBus.ts
|
|
918
918
|
var log = createLogger("almadar:eventbus");
|
|
919
919
|
var subLog = createLogger("almadar:eventbus:subscribe");
|
|
920
|
+
var scopeLog = createLogger("almadar:ui:trait-scope");
|
|
920
921
|
function getGlobalEventBus() {
|
|
921
922
|
if (typeof window !== "undefined") {
|
|
922
923
|
return window.__kflowEventBus ?? null;
|
|
@@ -992,13 +993,26 @@ function useEventBus() {
|
|
|
992
993
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
993
994
|
const scope = useTraitScope();
|
|
994
995
|
return useMemo(() => {
|
|
995
|
-
if (!scope)
|
|
996
|
+
if (!scope) {
|
|
997
|
+
return {
|
|
998
|
+
...baseBus,
|
|
999
|
+
emit: (type, payload, source) => {
|
|
1000
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
1001
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
1002
|
+
}
|
|
1003
|
+
baseBus.emit(type, payload, source);
|
|
1004
|
+
}
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
996
1007
|
return {
|
|
997
1008
|
...baseBus,
|
|
998
1009
|
emit: (type, payload, source) => {
|
|
999
1010
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
1000
1011
|
const tail = type.slice(3);
|
|
1001
1012
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
1013
|
+
if (qualified !== type) {
|
|
1014
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
1015
|
+
}
|
|
1002
1016
|
baseBus.emit(qualified, payload, source);
|
|
1003
1017
|
return;
|
|
1004
1018
|
}
|
package/dist/marketing/index.cjs
CHANGED
|
@@ -2565,6 +2565,7 @@ function useTraitScope() {
|
|
|
2565
2565
|
// hooks/useEventBus.ts
|
|
2566
2566
|
var log = createLogger("almadar:eventbus");
|
|
2567
2567
|
var subLog2 = createLogger("almadar:eventbus:subscribe");
|
|
2568
|
+
var scopeLog = createLogger("almadar:ui:trait-scope");
|
|
2568
2569
|
function getGlobalEventBus() {
|
|
2569
2570
|
if (typeof window !== "undefined") {
|
|
2570
2571
|
return window.__kflowEventBus ?? null;
|
|
@@ -2640,13 +2641,26 @@ function useEventBus() {
|
|
|
2640
2641
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
2641
2642
|
const scope = useTraitScope();
|
|
2642
2643
|
return React6.useMemo(() => {
|
|
2643
|
-
if (!scope)
|
|
2644
|
+
if (!scope) {
|
|
2645
|
+
return {
|
|
2646
|
+
...baseBus,
|
|
2647
|
+
emit: (type, payload, source) => {
|
|
2648
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
2649
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
2650
|
+
}
|
|
2651
|
+
baseBus.emit(type, payload, source);
|
|
2652
|
+
}
|
|
2653
|
+
};
|
|
2654
|
+
}
|
|
2644
2655
|
return {
|
|
2645
2656
|
...baseBus,
|
|
2646
2657
|
emit: (type, payload, source) => {
|
|
2647
2658
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
2648
2659
|
const tail = type.slice(3);
|
|
2649
2660
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
2661
|
+
if (qualified !== type) {
|
|
2662
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
2663
|
+
}
|
|
2650
2664
|
baseBus.emit(qualified, payload, source);
|
|
2651
2665
|
return;
|
|
2652
2666
|
}
|
package/dist/marketing/index.js
CHANGED
|
@@ -2541,6 +2541,7 @@ function useTraitScope() {
|
|
|
2541
2541
|
// hooks/useEventBus.ts
|
|
2542
2542
|
var log = createLogger("almadar:eventbus");
|
|
2543
2543
|
var subLog2 = createLogger("almadar:eventbus:subscribe");
|
|
2544
|
+
var scopeLog = createLogger("almadar:ui:trait-scope");
|
|
2544
2545
|
function getGlobalEventBus() {
|
|
2545
2546
|
if (typeof window !== "undefined") {
|
|
2546
2547
|
return window.__kflowEventBus ?? null;
|
|
@@ -2616,13 +2617,26 @@ function useEventBus() {
|
|
|
2616
2617
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
2617
2618
|
const scope = useTraitScope();
|
|
2618
2619
|
return useMemo(() => {
|
|
2619
|
-
if (!scope)
|
|
2620
|
+
if (!scope) {
|
|
2621
|
+
return {
|
|
2622
|
+
...baseBus,
|
|
2623
|
+
emit: (type, payload, source) => {
|
|
2624
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
2625
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
2626
|
+
}
|
|
2627
|
+
baseBus.emit(type, payload, source);
|
|
2628
|
+
}
|
|
2629
|
+
};
|
|
2630
|
+
}
|
|
2620
2631
|
return {
|
|
2621
2632
|
...baseBus,
|
|
2622
2633
|
emit: (type, payload, source) => {
|
|
2623
2634
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
2624
2635
|
const tail = type.slice(3);
|
|
2625
2636
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
2637
|
+
if (qualified !== type) {
|
|
2638
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
2639
|
+
}
|
|
2626
2640
|
baseBus.emit(qualified, payload, source);
|
|
2627
2641
|
return;
|
|
2628
2642
|
}
|
package/dist/providers/index.cjs
CHANGED
|
@@ -439,13 +439,26 @@ function useEventBus() {
|
|
|
439
439
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
440
440
|
const scope = providers.useTraitScope();
|
|
441
441
|
return React116.useMemo(() => {
|
|
442
|
-
if (!scope)
|
|
442
|
+
if (!scope) {
|
|
443
|
+
return {
|
|
444
|
+
...baseBus,
|
|
445
|
+
emit: (type, payload, source) => {
|
|
446
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
447
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
448
|
+
}
|
|
449
|
+
baseBus.emit(type, payload, source);
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
}
|
|
443
453
|
return {
|
|
444
454
|
...baseBus,
|
|
445
455
|
emit: (type, payload, source) => {
|
|
446
456
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
447
457
|
const tail = type.slice(3);
|
|
448
458
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
459
|
+
if (qualified !== type) {
|
|
460
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
461
|
+
}
|
|
449
462
|
baseBus.emit(qualified, payload, source);
|
|
450
463
|
return;
|
|
451
464
|
}
|
|
@@ -477,13 +490,14 @@ function useEmitEvent() {
|
|
|
477
490
|
[eventBus]
|
|
478
491
|
);
|
|
479
492
|
}
|
|
480
|
-
var log, subLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
493
|
+
var log, subLog, scopeLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
481
494
|
var init_useEventBus = __esm({
|
|
482
495
|
"hooks/useEventBus.ts"() {
|
|
483
496
|
"use client";
|
|
484
497
|
init_logger();
|
|
485
498
|
log = createLogger("almadar:eventbus");
|
|
486
499
|
subLog = createLogger("almadar:eventbus:subscribe");
|
|
500
|
+
scopeLog = createLogger("almadar:ui:trait-scope");
|
|
487
501
|
fallbackListeners = /* @__PURE__ */ new Map();
|
|
488
502
|
fallbackAnyListeners = /* @__PURE__ */ new Set();
|
|
489
503
|
fallbackEventBus = {
|
package/dist/providers/index.js
CHANGED
|
@@ -394,13 +394,26 @@ function useEventBus() {
|
|
|
394
394
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
395
395
|
const scope = useTraitScope();
|
|
396
396
|
return useMemo(() => {
|
|
397
|
-
if (!scope)
|
|
397
|
+
if (!scope) {
|
|
398
|
+
return {
|
|
399
|
+
...baseBus,
|
|
400
|
+
emit: (type, payload, source) => {
|
|
401
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
402
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
403
|
+
}
|
|
404
|
+
baseBus.emit(type, payload, source);
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
}
|
|
398
408
|
return {
|
|
399
409
|
...baseBus,
|
|
400
410
|
emit: (type, payload, source) => {
|
|
401
411
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
402
412
|
const tail = type.slice(3);
|
|
403
413
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
414
|
+
if (qualified !== type) {
|
|
415
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
416
|
+
}
|
|
404
417
|
baseBus.emit(qualified, payload, source);
|
|
405
418
|
return;
|
|
406
419
|
}
|
|
@@ -432,13 +445,14 @@ function useEmitEvent() {
|
|
|
432
445
|
[eventBus]
|
|
433
446
|
);
|
|
434
447
|
}
|
|
435
|
-
var log, subLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
448
|
+
var log, subLog, scopeLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
436
449
|
var init_useEventBus = __esm({
|
|
437
450
|
"hooks/useEventBus.ts"() {
|
|
438
451
|
"use client";
|
|
439
452
|
init_logger();
|
|
440
453
|
log = createLogger("almadar:eventbus");
|
|
441
454
|
subLog = createLogger("almadar:eventbus:subscribe");
|
|
455
|
+
scopeLog = createLogger("almadar:ui:trait-scope");
|
|
442
456
|
fallbackListeners = /* @__PURE__ */ new Map();
|
|
443
457
|
fallbackAnyListeners = /* @__PURE__ */ new Set();
|
|
444
458
|
fallbackEventBus = {
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -186,13 +186,26 @@ function useEventBus() {
|
|
|
186
186
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
187
187
|
const scope = providers.useTraitScope();
|
|
188
188
|
return React115.useMemo(() => {
|
|
189
|
-
if (!scope)
|
|
189
|
+
if (!scope) {
|
|
190
|
+
return {
|
|
191
|
+
...baseBus,
|
|
192
|
+
emit: (type, payload, source) => {
|
|
193
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
194
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
195
|
+
}
|
|
196
|
+
baseBus.emit(type, payload, source);
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
190
200
|
return {
|
|
191
201
|
...baseBus,
|
|
192
202
|
emit: (type, payload, source) => {
|
|
193
203
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
194
204
|
const tail = type.slice(3);
|
|
195
205
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
206
|
+
if (qualified !== type) {
|
|
207
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
208
|
+
}
|
|
196
209
|
baseBus.emit(qualified, payload, source);
|
|
197
210
|
return;
|
|
198
211
|
}
|
|
@@ -224,13 +237,14 @@ function useEmitEvent() {
|
|
|
224
237
|
[eventBus]
|
|
225
238
|
);
|
|
226
239
|
}
|
|
227
|
-
var log, subLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
240
|
+
var log, subLog, scopeLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
228
241
|
var init_useEventBus = __esm({
|
|
229
242
|
"hooks/useEventBus.ts"() {
|
|
230
243
|
"use client";
|
|
231
244
|
init_logger();
|
|
232
245
|
log = createLogger("almadar:eventbus");
|
|
233
246
|
subLog = createLogger("almadar:eventbus:subscribe");
|
|
247
|
+
scopeLog = createLogger("almadar:ui:trait-scope");
|
|
234
248
|
fallbackListeners = /* @__PURE__ */ new Map();
|
|
235
249
|
fallbackAnyListeners = /* @__PURE__ */ new Set();
|
|
236
250
|
fallbackEventBus = {
|
|
@@ -38691,32 +38705,6 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
38691
38705
|
fromBridge: true
|
|
38692
38706
|
});
|
|
38693
38707
|
}
|
|
38694
|
-
const executedTraits = new Set(results.map((r) => r.traitName));
|
|
38695
|
-
for (const binding of bindings) {
|
|
38696
|
-
const traitName = binding.trait.name;
|
|
38697
|
-
if (executedTraits.has(traitName)) continue;
|
|
38698
|
-
const { events: traitEvents, transitions: traitTransitions } = binding.trait;
|
|
38699
|
-
const eventDeclared = traitEvents.some((e) => e.key === normalizedEvent);
|
|
38700
|
-
const hasTransition = traitTransitions.some((t) => t.event === normalizedEvent);
|
|
38701
|
-
crossTraitLog.debug("rebroadcast:second-pass:candidate", {
|
|
38702
|
-
event: normalizedEvent,
|
|
38703
|
-
traitName,
|
|
38704
|
-
eventDeclared,
|
|
38705
|
-
hasTransition,
|
|
38706
|
-
orbitalName: orbitalsByTrait?.[traitName],
|
|
38707
|
-
traitEventKeys: traitEvents.map((e) => e.key).join(",")
|
|
38708
|
-
});
|
|
38709
|
-
if (!eventDeclared || hasTransition) continue;
|
|
38710
|
-
const orbitalName = orbitalsByTrait?.[traitName];
|
|
38711
|
-
if (!orbitalName) continue;
|
|
38712
|
-
const busKey = `UI:${orbitalName}.${traitName}.${normalizedEvent}`;
|
|
38713
|
-
crossTraitLog.info("rebroadcast:emit", { busKey, traitName, event: normalizedEvent });
|
|
38714
|
-
eventBus.emit(busKey, payload, {
|
|
38715
|
-
orbital: orbitalName,
|
|
38716
|
-
trait: traitName,
|
|
38717
|
-
fromBridge: true
|
|
38718
|
-
});
|
|
38719
|
-
}
|
|
38720
38708
|
}
|
|
38721
38709
|
if (results.length > 0) {
|
|
38722
38710
|
setTraitStates(currentManager.getAllStates());
|
package/dist/runtime/index.js
CHANGED
|
@@ -141,13 +141,26 @@ function useEventBus() {
|
|
|
141
141
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
142
142
|
const scope = useTraitScope();
|
|
143
143
|
return useMemo(() => {
|
|
144
|
-
if (!scope)
|
|
144
|
+
if (!scope) {
|
|
145
|
+
return {
|
|
146
|
+
...baseBus,
|
|
147
|
+
emit: (type, payload, source) => {
|
|
148
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
149
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
150
|
+
}
|
|
151
|
+
baseBus.emit(type, payload, source);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
}
|
|
145
155
|
return {
|
|
146
156
|
...baseBus,
|
|
147
157
|
emit: (type, payload, source) => {
|
|
148
158
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
149
159
|
const tail = type.slice(3);
|
|
150
160
|
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
161
|
+
if (qualified !== type) {
|
|
162
|
+
scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
|
|
163
|
+
}
|
|
151
164
|
baseBus.emit(qualified, payload, source);
|
|
152
165
|
return;
|
|
153
166
|
}
|
|
@@ -179,13 +192,14 @@ function useEmitEvent() {
|
|
|
179
192
|
[eventBus]
|
|
180
193
|
);
|
|
181
194
|
}
|
|
182
|
-
var log, subLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
195
|
+
var log, subLog, scopeLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
183
196
|
var init_useEventBus = __esm({
|
|
184
197
|
"hooks/useEventBus.ts"() {
|
|
185
198
|
"use client";
|
|
186
199
|
init_logger();
|
|
187
200
|
log = createLogger("almadar:eventbus");
|
|
188
201
|
subLog = createLogger("almadar:eventbus:subscribe");
|
|
202
|
+
scopeLog = createLogger("almadar:ui:trait-scope");
|
|
189
203
|
fallbackListeners = /* @__PURE__ */ new Map();
|
|
190
204
|
fallbackAnyListeners = /* @__PURE__ */ new Set();
|
|
191
205
|
fallbackEventBus = {
|
|
@@ -38646,32 +38660,6 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
38646
38660
|
fromBridge: true
|
|
38647
38661
|
});
|
|
38648
38662
|
}
|
|
38649
|
-
const executedTraits = new Set(results.map((r) => r.traitName));
|
|
38650
|
-
for (const binding of bindings) {
|
|
38651
|
-
const traitName = binding.trait.name;
|
|
38652
|
-
if (executedTraits.has(traitName)) continue;
|
|
38653
|
-
const { events: traitEvents, transitions: traitTransitions } = binding.trait;
|
|
38654
|
-
const eventDeclared = traitEvents.some((e) => e.key === normalizedEvent);
|
|
38655
|
-
const hasTransition = traitTransitions.some((t) => t.event === normalizedEvent);
|
|
38656
|
-
crossTraitLog.debug("rebroadcast:second-pass:candidate", {
|
|
38657
|
-
event: normalizedEvent,
|
|
38658
|
-
traitName,
|
|
38659
|
-
eventDeclared,
|
|
38660
|
-
hasTransition,
|
|
38661
|
-
orbitalName: orbitalsByTrait?.[traitName],
|
|
38662
|
-
traitEventKeys: traitEvents.map((e) => e.key).join(",")
|
|
38663
|
-
});
|
|
38664
|
-
if (!eventDeclared || hasTransition) continue;
|
|
38665
|
-
const orbitalName = orbitalsByTrait?.[traitName];
|
|
38666
|
-
if (!orbitalName) continue;
|
|
38667
|
-
const busKey = `UI:${orbitalName}.${traitName}.${normalizedEvent}`;
|
|
38668
|
-
crossTraitLog.info("rebroadcast:emit", { busKey, traitName, event: normalizedEvent });
|
|
38669
|
-
eventBus.emit(busKey, payload, {
|
|
38670
|
-
orbital: orbitalName,
|
|
38671
|
-
trait: traitName,
|
|
38672
|
-
fromBridge: true
|
|
38673
|
-
});
|
|
38674
|
-
}
|
|
38675
38663
|
}
|
|
38676
38664
|
if (results.length > 0) {
|
|
38677
38665
|
setTraitStates(currentManager.getAllStates());
|