@almadar/ui 2.60.3 → 2.60.5
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 +30 -26
- package/dist/avl/index.js +30 -26
- package/dist/components/index.cjs +5 -4
- package/dist/components/index.js +5 -4
- package/dist/providers/index.cjs +5 -4
- package/dist/providers/index.js +5 -4
- package/dist/runtime/index.cjs +30 -26
- package/dist/runtime/index.js +30 -26
- package/package.json +2 -2
package/dist/avl/index.cjs
CHANGED
|
@@ -19317,7 +19317,8 @@ var init_Carousel = __esm({
|
|
|
19317
19317
|
const scrollRef = React127.useRef(null);
|
|
19318
19318
|
const autoPlayRef = React127.useRef(null);
|
|
19319
19319
|
const eventBus = useSafeEventBus3();
|
|
19320
|
-
const
|
|
19320
|
+
const safeItems = items ?? [];
|
|
19321
|
+
const totalSlides = safeItems.length;
|
|
19321
19322
|
const emitSlideChange = React127.useCallback(
|
|
19322
19323
|
(newIndex) => {
|
|
19323
19324
|
if (slideChangeEvent) {
|
|
@@ -19428,7 +19429,7 @@ var init_Carousel = __esm({
|
|
|
19428
19429
|
onPointerMove: swipeHandlers.onPointerMove,
|
|
19429
19430
|
onPointerUp: swipeHandlers.onPointerUp,
|
|
19430
19431
|
onPointerCancel: swipeHandlers.onPointerCancel,
|
|
19431
|
-
children:
|
|
19432
|
+
children: safeItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
19432
19433
|
Box,
|
|
19433
19434
|
{
|
|
19434
19435
|
className: cn(
|
|
@@ -19497,7 +19498,7 @@ var init_Carousel = __esm({
|
|
|
19497
19498
|
{
|
|
19498
19499
|
position: "absolute",
|
|
19499
19500
|
className: "bottom-3 left-0 right-0 z-10",
|
|
19500
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", justify: "center", children:
|
|
19501
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
|
|
19501
19502
|
const isActive = index === activeIndex;
|
|
19502
19503
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19503
19504
|
Box,
|
|
@@ -46428,7 +46429,7 @@ function UISlotComponent({
|
|
|
46428
46429
|
);
|
|
46429
46430
|
}
|
|
46430
46431
|
const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
|
|
46431
|
-
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React127.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
|
|
46432
|
+
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React127.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: slotContent });
|
|
46432
46433
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
46433
46434
|
Box,
|
|
46434
46435
|
{
|
|
@@ -51852,9 +51853,30 @@ function SlotBridge() {
|
|
|
51852
51853
|
}, [slots, render, clear]);
|
|
51853
51854
|
return null;
|
|
51854
51855
|
}
|
|
51856
|
+
function applyServerEffects(effects, uiSlots, onNavigate) {
|
|
51857
|
+
for (const eff of effects) {
|
|
51858
|
+
if (eff.type === "render-ui" && eff.slot && eff.pattern) {
|
|
51859
|
+
const patternRecord = eff.pattern;
|
|
51860
|
+
const { type: patternType, children, ...inlineProps } = patternRecord;
|
|
51861
|
+
const normalizedChildren = Array.isArray(children) ? children.map((c) => normalizeChild(c)) : children;
|
|
51862
|
+
uiSlots.render({
|
|
51863
|
+
target: eff.slot,
|
|
51864
|
+
pattern: patternType,
|
|
51865
|
+
props: {
|
|
51866
|
+
...inlineProps,
|
|
51867
|
+
...normalizedChildren !== void 0 ? { children: normalizedChildren } : {}
|
|
51868
|
+
},
|
|
51869
|
+
sourceTrait: eff.traitName ?? "server"
|
|
51870
|
+
});
|
|
51871
|
+
} else if (eff.type === "navigate" && eff.route && onNavigate) {
|
|
51872
|
+
onNavigate(eff.route, eff.params);
|
|
51873
|
+
}
|
|
51874
|
+
}
|
|
51875
|
+
}
|
|
51855
51876
|
function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFallback }) {
|
|
51856
51877
|
const slotsActions = useSlotsActions();
|
|
51857
51878
|
const bridge = useServerBridge();
|
|
51879
|
+
const uiSlots = useUISlots();
|
|
51858
51880
|
const entityStore = useEntityStore();
|
|
51859
51881
|
const onEventProcessed = React127.useCallback(async (event, payload) => {
|
|
51860
51882
|
if (!bridge.connected || !orbitalNames?.length) return;
|
|
@@ -51869,19 +51891,9 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
|
|
|
51869
51891
|
}
|
|
51870
51892
|
}
|
|
51871
51893
|
}
|
|
51872
|
-
|
|
51873
|
-
if (eff.type === "render-ui" && eff.slot && eff.pattern) {
|
|
51874
|
-
slotsActions.setSlotPatterns(
|
|
51875
|
-
eff.slot,
|
|
51876
|
-
[{ pattern: eff.pattern, props: {} }],
|
|
51877
|
-
{ trait: eff.traitName ?? "server", state: "server", transition: "server-effect" }
|
|
51878
|
-
);
|
|
51879
|
-
} else if (eff.type === "navigate" && eff.route && onNavigate) {
|
|
51880
|
-
onNavigate(eff.route, eff.params);
|
|
51881
|
-
}
|
|
51882
|
-
}
|
|
51894
|
+
applyServerEffects(effects, uiSlots, onNavigate);
|
|
51883
51895
|
}
|
|
51884
|
-
}, [bridge.connected, bridge.sendEvent, orbitalNames,
|
|
51896
|
+
}, [bridge.connected, bridge.sendEvent, orbitalNames, uiSlots, onNavigate, entityStore]);
|
|
51885
51897
|
const opts = orbitalNames ? { onEventProcessed, navigate: onNavigate } : { navigate: onNavigate };
|
|
51886
51898
|
const { sendEvent } = useTraitStateMachine(traits2, slotsActions, opts);
|
|
51887
51899
|
const initSentRef = React127.useRef(false);
|
|
@@ -51929,18 +51941,10 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
|
|
|
51929
51941
|
}
|
|
51930
51942
|
}
|
|
51931
51943
|
}
|
|
51932
|
-
|
|
51933
|
-
if (eff.type === "render-ui" && eff.slot && eff.pattern) {
|
|
51934
|
-
slotsActions.setSlotPatterns(
|
|
51935
|
-
eff.slot,
|
|
51936
|
-
[{ pattern: eff.pattern, props: {} }],
|
|
51937
|
-
{ trait: eff.traitName ?? "server", state: "server", transition: "server-effect" }
|
|
51938
|
-
);
|
|
51939
|
-
}
|
|
51940
|
-
}
|
|
51944
|
+
applyServerEffects(effects, uiSlots, onNavigate);
|
|
51941
51945
|
}
|
|
51942
51946
|
})();
|
|
51943
|
-
}, [bridge.connected, orbitalNames, bridge.sendEvent,
|
|
51947
|
+
}, [bridge.connected, orbitalNames, bridge.sendEvent, uiSlots, onNavigate]);
|
|
51944
51948
|
return null;
|
|
51945
51949
|
}
|
|
51946
51950
|
function SchemaRunner({ schema, serverUrl, mockData, pageName, onNavigate, onLocalFallback }) {
|
package/dist/avl/index.js
CHANGED
|
@@ -19271,7 +19271,8 @@ var init_Carousel = __esm({
|
|
|
19271
19271
|
const scrollRef = useRef(null);
|
|
19272
19272
|
const autoPlayRef = useRef(null);
|
|
19273
19273
|
const eventBus = useSafeEventBus3();
|
|
19274
|
-
const
|
|
19274
|
+
const safeItems = items ?? [];
|
|
19275
|
+
const totalSlides = safeItems.length;
|
|
19275
19276
|
const emitSlideChange = useCallback(
|
|
19276
19277
|
(newIndex) => {
|
|
19277
19278
|
if (slideChangeEvent) {
|
|
@@ -19382,7 +19383,7 @@ var init_Carousel = __esm({
|
|
|
19382
19383
|
onPointerMove: swipeHandlers.onPointerMove,
|
|
19383
19384
|
onPointerUp: swipeHandlers.onPointerUp,
|
|
19384
19385
|
onPointerCancel: swipeHandlers.onPointerCancel,
|
|
19385
|
-
children:
|
|
19386
|
+
children: safeItems.map((item, index) => /* @__PURE__ */ jsx(
|
|
19386
19387
|
Box,
|
|
19387
19388
|
{
|
|
19388
19389
|
className: cn(
|
|
@@ -19451,7 +19452,7 @@ var init_Carousel = __esm({
|
|
|
19451
19452
|
{
|
|
19452
19453
|
position: "absolute",
|
|
19453
19454
|
className: "bottom-3 left-0 right-0 z-10",
|
|
19454
|
-
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children:
|
|
19455
|
+
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
|
|
19455
19456
|
const isActive = index === activeIndex;
|
|
19456
19457
|
return /* @__PURE__ */ jsx(
|
|
19457
19458
|
Box,
|
|
@@ -46382,7 +46383,7 @@ function UISlotComponent({
|
|
|
46382
46383
|
);
|
|
46383
46384
|
}
|
|
46384
46385
|
const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
|
|
46385
|
-
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
|
|
46386
|
+
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsx(ErrorBoundary, { children: slotContent });
|
|
46386
46387
|
return /* @__PURE__ */ jsx(
|
|
46387
46388
|
Box,
|
|
46388
46389
|
{
|
|
@@ -51806,9 +51807,30 @@ function SlotBridge() {
|
|
|
51806
51807
|
}, [slots, render, clear]);
|
|
51807
51808
|
return null;
|
|
51808
51809
|
}
|
|
51810
|
+
function applyServerEffects(effects, uiSlots, onNavigate) {
|
|
51811
|
+
for (const eff of effects) {
|
|
51812
|
+
if (eff.type === "render-ui" && eff.slot && eff.pattern) {
|
|
51813
|
+
const patternRecord = eff.pattern;
|
|
51814
|
+
const { type: patternType, children, ...inlineProps } = patternRecord;
|
|
51815
|
+
const normalizedChildren = Array.isArray(children) ? children.map((c) => normalizeChild(c)) : children;
|
|
51816
|
+
uiSlots.render({
|
|
51817
|
+
target: eff.slot,
|
|
51818
|
+
pattern: patternType,
|
|
51819
|
+
props: {
|
|
51820
|
+
...inlineProps,
|
|
51821
|
+
...normalizedChildren !== void 0 ? { children: normalizedChildren } : {}
|
|
51822
|
+
},
|
|
51823
|
+
sourceTrait: eff.traitName ?? "server"
|
|
51824
|
+
});
|
|
51825
|
+
} else if (eff.type === "navigate" && eff.route && onNavigate) {
|
|
51826
|
+
onNavigate(eff.route, eff.params);
|
|
51827
|
+
}
|
|
51828
|
+
}
|
|
51829
|
+
}
|
|
51809
51830
|
function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFallback }) {
|
|
51810
51831
|
const slotsActions = useSlotsActions();
|
|
51811
51832
|
const bridge = useServerBridge();
|
|
51833
|
+
const uiSlots = useUISlots();
|
|
51812
51834
|
const entityStore = useEntityStore();
|
|
51813
51835
|
const onEventProcessed = useCallback(async (event, payload) => {
|
|
51814
51836
|
if (!bridge.connected || !orbitalNames?.length) return;
|
|
@@ -51823,19 +51845,9 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
|
|
|
51823
51845
|
}
|
|
51824
51846
|
}
|
|
51825
51847
|
}
|
|
51826
|
-
|
|
51827
|
-
if (eff.type === "render-ui" && eff.slot && eff.pattern) {
|
|
51828
|
-
slotsActions.setSlotPatterns(
|
|
51829
|
-
eff.slot,
|
|
51830
|
-
[{ pattern: eff.pattern, props: {} }],
|
|
51831
|
-
{ trait: eff.traitName ?? "server", state: "server", transition: "server-effect" }
|
|
51832
|
-
);
|
|
51833
|
-
} else if (eff.type === "navigate" && eff.route && onNavigate) {
|
|
51834
|
-
onNavigate(eff.route, eff.params);
|
|
51835
|
-
}
|
|
51836
|
-
}
|
|
51848
|
+
applyServerEffects(effects, uiSlots, onNavigate);
|
|
51837
51849
|
}
|
|
51838
|
-
}, [bridge.connected, bridge.sendEvent, orbitalNames,
|
|
51850
|
+
}, [bridge.connected, bridge.sendEvent, orbitalNames, uiSlots, onNavigate, entityStore]);
|
|
51839
51851
|
const opts = orbitalNames ? { onEventProcessed, navigate: onNavigate } : { navigate: onNavigate };
|
|
51840
51852
|
const { sendEvent } = useTraitStateMachine(traits2, slotsActions, opts);
|
|
51841
51853
|
const initSentRef = useRef(false);
|
|
@@ -51883,18 +51895,10 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
|
|
|
51883
51895
|
}
|
|
51884
51896
|
}
|
|
51885
51897
|
}
|
|
51886
|
-
|
|
51887
|
-
if (eff.type === "render-ui" && eff.slot && eff.pattern) {
|
|
51888
|
-
slotsActions.setSlotPatterns(
|
|
51889
|
-
eff.slot,
|
|
51890
|
-
[{ pattern: eff.pattern, props: {} }],
|
|
51891
|
-
{ trait: eff.traitName ?? "server", state: "server", transition: "server-effect" }
|
|
51892
|
-
);
|
|
51893
|
-
}
|
|
51894
|
-
}
|
|
51898
|
+
applyServerEffects(effects, uiSlots, onNavigate);
|
|
51895
51899
|
}
|
|
51896
51900
|
})();
|
|
51897
|
-
}, [bridge.connected, orbitalNames, bridge.sendEvent,
|
|
51901
|
+
}, [bridge.connected, orbitalNames, bridge.sendEvent, uiSlots, onNavigate]);
|
|
51898
51902
|
return null;
|
|
51899
51903
|
}
|
|
51900
51904
|
function SchemaRunner({ schema, serverUrl, mockData, pageName, onNavigate, onLocalFallback }) {
|
|
@@ -14590,7 +14590,8 @@ var init_Carousel = __esm({
|
|
|
14590
14590
|
const scrollRef = React110.useRef(null);
|
|
14591
14591
|
const autoPlayRef = React110.useRef(null);
|
|
14592
14592
|
const eventBus = useSafeEventBus3();
|
|
14593
|
-
const
|
|
14593
|
+
const safeItems = items ?? [];
|
|
14594
|
+
const totalSlides = safeItems.length;
|
|
14594
14595
|
const emitSlideChange = React110.useCallback(
|
|
14595
14596
|
(newIndex) => {
|
|
14596
14597
|
if (slideChangeEvent) {
|
|
@@ -14701,7 +14702,7 @@ var init_Carousel = __esm({
|
|
|
14701
14702
|
onPointerMove: swipeHandlers.onPointerMove,
|
|
14702
14703
|
onPointerUp: swipeHandlers.onPointerUp,
|
|
14703
14704
|
onPointerCancel: swipeHandlers.onPointerCancel,
|
|
14704
|
-
children:
|
|
14705
|
+
children: safeItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
14705
14706
|
exports.Box,
|
|
14706
14707
|
{
|
|
14707
14708
|
className: cn(
|
|
@@ -14770,7 +14771,7 @@ var init_Carousel = __esm({
|
|
|
14770
14771
|
{
|
|
14771
14772
|
position: "absolute",
|
|
14772
14773
|
className: "bottom-3 left-0 right-0 z-10",
|
|
14773
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(exports.HStack, { gap: "xs", align: "center", justify: "center", children:
|
|
14774
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(exports.HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
|
|
14774
14775
|
const isActive = index === activeIndex;
|
|
14775
14776
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14776
14777
|
exports.Box,
|
|
@@ -37250,7 +37251,7 @@ function UISlotComponent({
|
|
|
37250
37251
|
);
|
|
37251
37252
|
}
|
|
37252
37253
|
const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
|
|
37253
|
-
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(exports.ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React110.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
|
|
37254
|
+
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(exports.ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React110.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsxRuntime.jsx(exports.ErrorBoundary, { children: slotContent });
|
|
37254
37255
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37255
37256
|
exports.Box,
|
|
37256
37257
|
{
|
package/dist/components/index.js
CHANGED
|
@@ -14545,7 +14545,8 @@ var init_Carousel = __esm({
|
|
|
14545
14545
|
const scrollRef = useRef(null);
|
|
14546
14546
|
const autoPlayRef = useRef(null);
|
|
14547
14547
|
const eventBus = useSafeEventBus3();
|
|
14548
|
-
const
|
|
14548
|
+
const safeItems = items ?? [];
|
|
14549
|
+
const totalSlides = safeItems.length;
|
|
14549
14550
|
const emitSlideChange = useCallback(
|
|
14550
14551
|
(newIndex) => {
|
|
14551
14552
|
if (slideChangeEvent) {
|
|
@@ -14656,7 +14657,7 @@ var init_Carousel = __esm({
|
|
|
14656
14657
|
onPointerMove: swipeHandlers.onPointerMove,
|
|
14657
14658
|
onPointerUp: swipeHandlers.onPointerUp,
|
|
14658
14659
|
onPointerCancel: swipeHandlers.onPointerCancel,
|
|
14659
|
-
children:
|
|
14660
|
+
children: safeItems.map((item, index) => /* @__PURE__ */ jsx(
|
|
14660
14661
|
Box,
|
|
14661
14662
|
{
|
|
14662
14663
|
className: cn(
|
|
@@ -14725,7 +14726,7 @@ var init_Carousel = __esm({
|
|
|
14725
14726
|
{
|
|
14726
14727
|
position: "absolute",
|
|
14727
14728
|
className: "bottom-3 left-0 right-0 z-10",
|
|
14728
|
-
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children:
|
|
14729
|
+
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
|
|
14729
14730
|
const isActive = index === activeIndex;
|
|
14730
14731
|
return /* @__PURE__ */ jsx(
|
|
14731
14732
|
Box,
|
|
@@ -37205,7 +37206,7 @@ function UISlotComponent({
|
|
|
37205
37206
|
);
|
|
37206
37207
|
}
|
|
37207
37208
|
const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
|
|
37208
|
-
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
|
|
37209
|
+
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsx(ErrorBoundary, { children: slotContent });
|
|
37209
37210
|
return /* @__PURE__ */ jsx(
|
|
37210
37211
|
Box,
|
|
37211
37212
|
{
|
package/dist/providers/index.cjs
CHANGED
|
@@ -16134,7 +16134,8 @@ var init_Carousel = __esm({
|
|
|
16134
16134
|
const scrollRef = React116.useRef(null);
|
|
16135
16135
|
const autoPlayRef = React116.useRef(null);
|
|
16136
16136
|
const eventBus = useSafeEventBus3();
|
|
16137
|
-
const
|
|
16137
|
+
const safeItems = items ?? [];
|
|
16138
|
+
const totalSlides = safeItems.length;
|
|
16138
16139
|
const emitSlideChange = React116.useCallback(
|
|
16139
16140
|
(newIndex) => {
|
|
16140
16141
|
if (slideChangeEvent) {
|
|
@@ -16245,7 +16246,7 @@ var init_Carousel = __esm({
|
|
|
16245
16246
|
onPointerMove: swipeHandlers.onPointerMove,
|
|
16246
16247
|
onPointerUp: swipeHandlers.onPointerUp,
|
|
16247
16248
|
onPointerCancel: swipeHandlers.onPointerCancel,
|
|
16248
|
-
children:
|
|
16249
|
+
children: safeItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
16249
16250
|
Box,
|
|
16250
16251
|
{
|
|
16251
16252
|
className: cn(
|
|
@@ -16314,7 +16315,7 @@ var init_Carousel = __esm({
|
|
|
16314
16315
|
{
|
|
16315
16316
|
position: "absolute",
|
|
16316
16317
|
className: "bottom-3 left-0 right-0 z-10",
|
|
16317
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", justify: "center", children:
|
|
16318
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
|
|
16318
16319
|
const isActive = index === activeIndex;
|
|
16319
16320
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16320
16321
|
Box,
|
|
@@ -37760,7 +37761,7 @@ function UISlotComponent({
|
|
|
37760
37761
|
);
|
|
37761
37762
|
}
|
|
37762
37763
|
const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
|
|
37763
|
-
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React116.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
|
|
37764
|
+
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React116.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: slotContent });
|
|
37764
37765
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37765
37766
|
Box,
|
|
37766
37767
|
{
|
package/dist/providers/index.js
CHANGED
|
@@ -16089,7 +16089,8 @@ var init_Carousel = __esm({
|
|
|
16089
16089
|
const scrollRef = useRef(null);
|
|
16090
16090
|
const autoPlayRef = useRef(null);
|
|
16091
16091
|
const eventBus = useSafeEventBus3();
|
|
16092
|
-
const
|
|
16092
|
+
const safeItems = items ?? [];
|
|
16093
|
+
const totalSlides = safeItems.length;
|
|
16093
16094
|
const emitSlideChange = useCallback(
|
|
16094
16095
|
(newIndex) => {
|
|
16095
16096
|
if (slideChangeEvent) {
|
|
@@ -16200,7 +16201,7 @@ var init_Carousel = __esm({
|
|
|
16200
16201
|
onPointerMove: swipeHandlers.onPointerMove,
|
|
16201
16202
|
onPointerUp: swipeHandlers.onPointerUp,
|
|
16202
16203
|
onPointerCancel: swipeHandlers.onPointerCancel,
|
|
16203
|
-
children:
|
|
16204
|
+
children: safeItems.map((item, index) => /* @__PURE__ */ jsx(
|
|
16204
16205
|
Box,
|
|
16205
16206
|
{
|
|
16206
16207
|
className: cn(
|
|
@@ -16269,7 +16270,7 @@ var init_Carousel = __esm({
|
|
|
16269
16270
|
{
|
|
16270
16271
|
position: "absolute",
|
|
16271
16272
|
className: "bottom-3 left-0 right-0 z-10",
|
|
16272
|
-
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children:
|
|
16273
|
+
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
|
|
16273
16274
|
const isActive = index === activeIndex;
|
|
16274
16275
|
return /* @__PURE__ */ jsx(
|
|
16275
16276
|
Box,
|
|
@@ -37715,7 +37716,7 @@ function UISlotComponent({
|
|
|
37715
37716
|
);
|
|
37716
37717
|
}
|
|
37717
37718
|
const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
|
|
37718
|
-
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
|
|
37719
|
+
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsx(ErrorBoundary, { children: slotContent });
|
|
37719
37720
|
return /* @__PURE__ */ jsx(
|
|
37720
37721
|
Box,
|
|
37721
37722
|
{
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -15939,7 +15939,8 @@ var init_Carousel = __esm({
|
|
|
15939
15939
|
const scrollRef = React116.useRef(null);
|
|
15940
15940
|
const autoPlayRef = React116.useRef(null);
|
|
15941
15941
|
const eventBus = useSafeEventBus3();
|
|
15942
|
-
const
|
|
15942
|
+
const safeItems = items ?? [];
|
|
15943
|
+
const totalSlides = safeItems.length;
|
|
15943
15944
|
const emitSlideChange = React116.useCallback(
|
|
15944
15945
|
(newIndex) => {
|
|
15945
15946
|
if (slideChangeEvent) {
|
|
@@ -16050,7 +16051,7 @@ var init_Carousel = __esm({
|
|
|
16050
16051
|
onPointerMove: swipeHandlers.onPointerMove,
|
|
16051
16052
|
onPointerUp: swipeHandlers.onPointerUp,
|
|
16052
16053
|
onPointerCancel: swipeHandlers.onPointerCancel,
|
|
16053
|
-
children:
|
|
16054
|
+
children: safeItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
16054
16055
|
Box,
|
|
16055
16056
|
{
|
|
16056
16057
|
className: cn(
|
|
@@ -16119,7 +16120,7 @@ var init_Carousel = __esm({
|
|
|
16119
16120
|
{
|
|
16120
16121
|
position: "absolute",
|
|
16121
16122
|
className: "bottom-3 left-0 right-0 z-10",
|
|
16122
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", justify: "center", children:
|
|
16123
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
|
|
16123
16124
|
const isActive = index === activeIndex;
|
|
16124
16125
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16125
16126
|
Box,
|
|
@@ -37333,7 +37334,7 @@ function UISlotComponent({
|
|
|
37333
37334
|
);
|
|
37334
37335
|
}
|
|
37335
37336
|
const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
|
|
37336
|
-
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React116.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
|
|
37337
|
+
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(React116.Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: slotContent });
|
|
37337
37338
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37338
37339
|
Box,
|
|
37339
37340
|
{
|
|
@@ -38627,9 +38628,30 @@ function SlotBridge() {
|
|
|
38627
38628
|
}, [slots, render, clear]);
|
|
38628
38629
|
return null;
|
|
38629
38630
|
}
|
|
38631
|
+
function applyServerEffects(effects, uiSlots, onNavigate) {
|
|
38632
|
+
for (const eff of effects) {
|
|
38633
|
+
if (eff.type === "render-ui" && eff.slot && eff.pattern) {
|
|
38634
|
+
const patternRecord = eff.pattern;
|
|
38635
|
+
const { type: patternType, children, ...inlineProps } = patternRecord;
|
|
38636
|
+
const normalizedChildren = Array.isArray(children) ? children.map((c) => normalizeChild(c)) : children;
|
|
38637
|
+
uiSlots.render({
|
|
38638
|
+
target: eff.slot,
|
|
38639
|
+
pattern: patternType,
|
|
38640
|
+
props: {
|
|
38641
|
+
...inlineProps,
|
|
38642
|
+
...normalizedChildren !== void 0 ? { children: normalizedChildren } : {}
|
|
38643
|
+
},
|
|
38644
|
+
sourceTrait: eff.traitName ?? "server"
|
|
38645
|
+
});
|
|
38646
|
+
} else if (eff.type === "navigate" && eff.route && onNavigate) {
|
|
38647
|
+
onNavigate(eff.route, eff.params);
|
|
38648
|
+
}
|
|
38649
|
+
}
|
|
38650
|
+
}
|
|
38630
38651
|
function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFallback }) {
|
|
38631
38652
|
const slotsActions = useSlotsActions();
|
|
38632
38653
|
const bridge = useServerBridge();
|
|
38654
|
+
const uiSlots = context.useUISlots();
|
|
38633
38655
|
const entityStore = providers.useEntityStore();
|
|
38634
38656
|
const onEventProcessed = React116.useCallback(async (event, payload) => {
|
|
38635
38657
|
if (!bridge.connected || !orbitalNames?.length) return;
|
|
@@ -38644,19 +38666,9 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
|
|
|
38644
38666
|
}
|
|
38645
38667
|
}
|
|
38646
38668
|
}
|
|
38647
|
-
|
|
38648
|
-
if (eff.type === "render-ui" && eff.slot && eff.pattern) {
|
|
38649
|
-
slotsActions.setSlotPatterns(
|
|
38650
|
-
eff.slot,
|
|
38651
|
-
[{ pattern: eff.pattern, props: {} }],
|
|
38652
|
-
{ trait: eff.traitName ?? "server", state: "server", transition: "server-effect" }
|
|
38653
|
-
);
|
|
38654
|
-
} else if (eff.type === "navigate" && eff.route && onNavigate) {
|
|
38655
|
-
onNavigate(eff.route, eff.params);
|
|
38656
|
-
}
|
|
38657
|
-
}
|
|
38669
|
+
applyServerEffects(effects, uiSlots, onNavigate);
|
|
38658
38670
|
}
|
|
38659
|
-
}, [bridge.connected, bridge.sendEvent, orbitalNames,
|
|
38671
|
+
}, [bridge.connected, bridge.sendEvent, orbitalNames, uiSlots, onNavigate, entityStore]);
|
|
38660
38672
|
const opts = orbitalNames ? { onEventProcessed, navigate: onNavigate } : { navigate: onNavigate };
|
|
38661
38673
|
const { sendEvent } = useTraitStateMachine(traits2, slotsActions, opts);
|
|
38662
38674
|
const initSentRef = React116.useRef(false);
|
|
@@ -38704,18 +38716,10 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
|
|
|
38704
38716
|
}
|
|
38705
38717
|
}
|
|
38706
38718
|
}
|
|
38707
|
-
|
|
38708
|
-
if (eff.type === "render-ui" && eff.slot && eff.pattern) {
|
|
38709
|
-
slotsActions.setSlotPatterns(
|
|
38710
|
-
eff.slot,
|
|
38711
|
-
[{ pattern: eff.pattern, props: {} }],
|
|
38712
|
-
{ trait: eff.traitName ?? "server", state: "server", transition: "server-effect" }
|
|
38713
|
-
);
|
|
38714
|
-
}
|
|
38715
|
-
}
|
|
38719
|
+
applyServerEffects(effects, uiSlots, onNavigate);
|
|
38716
38720
|
}
|
|
38717
38721
|
})();
|
|
38718
|
-
}, [bridge.connected, orbitalNames, bridge.sendEvent,
|
|
38722
|
+
}, [bridge.connected, orbitalNames, bridge.sendEvent, uiSlots, onNavigate]);
|
|
38719
38723
|
return null;
|
|
38720
38724
|
}
|
|
38721
38725
|
function SchemaRunner({ schema, serverUrl, mockData, pageName, onNavigate, onLocalFallback }) {
|
package/dist/runtime/index.js
CHANGED
|
@@ -15894,7 +15894,8 @@ var init_Carousel = __esm({
|
|
|
15894
15894
|
const scrollRef = useRef(null);
|
|
15895
15895
|
const autoPlayRef = useRef(null);
|
|
15896
15896
|
const eventBus = useSafeEventBus3();
|
|
15897
|
-
const
|
|
15897
|
+
const safeItems = items ?? [];
|
|
15898
|
+
const totalSlides = safeItems.length;
|
|
15898
15899
|
const emitSlideChange = useCallback(
|
|
15899
15900
|
(newIndex) => {
|
|
15900
15901
|
if (slideChangeEvent) {
|
|
@@ -16005,7 +16006,7 @@ var init_Carousel = __esm({
|
|
|
16005
16006
|
onPointerMove: swipeHandlers.onPointerMove,
|
|
16006
16007
|
onPointerUp: swipeHandlers.onPointerUp,
|
|
16007
16008
|
onPointerCancel: swipeHandlers.onPointerCancel,
|
|
16008
|
-
children:
|
|
16009
|
+
children: safeItems.map((item, index) => /* @__PURE__ */ jsx(
|
|
16009
16010
|
Box,
|
|
16010
16011
|
{
|
|
16011
16012
|
className: cn(
|
|
@@ -16074,7 +16075,7 @@ var init_Carousel = __esm({
|
|
|
16074
16075
|
{
|
|
16075
16076
|
position: "absolute",
|
|
16076
16077
|
className: "bottom-3 left-0 right-0 z-10",
|
|
16077
|
-
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children:
|
|
16078
|
+
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", justify: "center", children: safeItems.map((_, index) => {
|
|
16078
16079
|
const isActive = index === activeIndex;
|
|
16079
16080
|
return /* @__PURE__ */ jsx(
|
|
16080
16081
|
Box,
|
|
@@ -37288,7 +37289,7 @@ function UISlotComponent({
|
|
|
37288
37289
|
);
|
|
37289
37290
|
}
|
|
37290
37291
|
const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss: handleDismiss });
|
|
37291
|
-
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : slotContent;
|
|
37292
|
+
const wrappedContent = suspenseConfig.enabled ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: getSlotFallback(slot, suspenseConfig), children: slotContent }) }) : /* @__PURE__ */ jsx(ErrorBoundary, { children: slotContent });
|
|
37292
37293
|
return /* @__PURE__ */ jsx(
|
|
37293
37294
|
Box,
|
|
37294
37295
|
{
|
|
@@ -38582,9 +38583,30 @@ function SlotBridge() {
|
|
|
38582
38583
|
}, [slots, render, clear]);
|
|
38583
38584
|
return null;
|
|
38584
38585
|
}
|
|
38586
|
+
function applyServerEffects(effects, uiSlots, onNavigate) {
|
|
38587
|
+
for (const eff of effects) {
|
|
38588
|
+
if (eff.type === "render-ui" && eff.slot && eff.pattern) {
|
|
38589
|
+
const patternRecord = eff.pattern;
|
|
38590
|
+
const { type: patternType, children, ...inlineProps } = patternRecord;
|
|
38591
|
+
const normalizedChildren = Array.isArray(children) ? children.map((c) => normalizeChild(c)) : children;
|
|
38592
|
+
uiSlots.render({
|
|
38593
|
+
target: eff.slot,
|
|
38594
|
+
pattern: patternType,
|
|
38595
|
+
props: {
|
|
38596
|
+
...inlineProps,
|
|
38597
|
+
...normalizedChildren !== void 0 ? { children: normalizedChildren } : {}
|
|
38598
|
+
},
|
|
38599
|
+
sourceTrait: eff.traitName ?? "server"
|
|
38600
|
+
});
|
|
38601
|
+
} else if (eff.type === "navigate" && eff.route && onNavigate) {
|
|
38602
|
+
onNavigate(eff.route, eff.params);
|
|
38603
|
+
}
|
|
38604
|
+
}
|
|
38605
|
+
}
|
|
38585
38606
|
function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFallback }) {
|
|
38586
38607
|
const slotsActions = useSlotsActions();
|
|
38587
38608
|
const bridge = useServerBridge();
|
|
38609
|
+
const uiSlots = useUISlots();
|
|
38588
38610
|
const entityStore = useEntityStore();
|
|
38589
38611
|
const onEventProcessed = useCallback(async (event, payload) => {
|
|
38590
38612
|
if (!bridge.connected || !orbitalNames?.length) return;
|
|
@@ -38599,19 +38621,9 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
|
|
|
38599
38621
|
}
|
|
38600
38622
|
}
|
|
38601
38623
|
}
|
|
38602
|
-
|
|
38603
|
-
if (eff.type === "render-ui" && eff.slot && eff.pattern) {
|
|
38604
|
-
slotsActions.setSlotPatterns(
|
|
38605
|
-
eff.slot,
|
|
38606
|
-
[{ pattern: eff.pattern, props: {} }],
|
|
38607
|
-
{ trait: eff.traitName ?? "server", state: "server", transition: "server-effect" }
|
|
38608
|
-
);
|
|
38609
|
-
} else if (eff.type === "navigate" && eff.route && onNavigate) {
|
|
38610
|
-
onNavigate(eff.route, eff.params);
|
|
38611
|
-
}
|
|
38612
|
-
}
|
|
38624
|
+
applyServerEffects(effects, uiSlots, onNavigate);
|
|
38613
38625
|
}
|
|
38614
|
-
}, [bridge.connected, bridge.sendEvent, orbitalNames,
|
|
38626
|
+
}, [bridge.connected, bridge.sendEvent, orbitalNames, uiSlots, onNavigate, entityStore]);
|
|
38615
38627
|
const opts = orbitalNames ? { onEventProcessed, navigate: onNavigate } : { navigate: onNavigate };
|
|
38616
38628
|
const { sendEvent } = useTraitStateMachine(traits2, slotsActions, opts);
|
|
38617
38629
|
const initSentRef = useRef(false);
|
|
@@ -38659,18 +38671,10 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
|
|
|
38659
38671
|
}
|
|
38660
38672
|
}
|
|
38661
38673
|
}
|
|
38662
|
-
|
|
38663
|
-
if (eff.type === "render-ui" && eff.slot && eff.pattern) {
|
|
38664
|
-
slotsActions.setSlotPatterns(
|
|
38665
|
-
eff.slot,
|
|
38666
|
-
[{ pattern: eff.pattern, props: {} }],
|
|
38667
|
-
{ trait: eff.traitName ?? "server", state: "server", transition: "server-effect" }
|
|
38668
|
-
);
|
|
38669
|
-
}
|
|
38670
|
-
}
|
|
38674
|
+
applyServerEffects(effects, uiSlots, onNavigate);
|
|
38671
38675
|
}
|
|
38672
38676
|
})();
|
|
38673
|
-
}, [bridge.connected, orbitalNames, bridge.sendEvent,
|
|
38677
|
+
}, [bridge.connected, orbitalNames, bridge.sendEvent, uiSlots, onNavigate]);
|
|
38674
38678
|
return null;
|
|
38675
38679
|
}
|
|
38676
38680
|
function SchemaRunner({ schema, serverUrl, mockData, pageName, onNavigate, onLocalFallback }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/ui",
|
|
3
|
-
"version": "2.60.
|
|
3
|
+
"version": "2.60.5",
|
|
4
4
|
"description": "React UI components, hooks, and providers for Almadar",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/components/index.js",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"@almadar/core": ">=4.8.2",
|
|
122
122
|
"@almadar/evaluator": ">=2.8.1",
|
|
123
123
|
"@almadar/patterns": ">=2.14.1",
|
|
124
|
-
"@almadar/runtime": ">=3.2.
|
|
124
|
+
"@almadar/runtime": ">=3.2.6",
|
|
125
125
|
"@almadar/std": ">=6.4.1",
|
|
126
126
|
"@almadar/syntax": ">=1.3.1",
|
|
127
127
|
"@xyflow/react": "12.10.1",
|