@almadar/ui 3.5.1 → 3.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +55 -9
- package/dist/avl/index.js +55 -9
- package/dist/components/index.cjs +21 -9
- package/dist/components/index.js +21 -9
- package/dist/providers/index.cjs +21 -9
- package/dist/providers/index.js +21 -9
- package/dist/runtime/index.cjs +55 -9
- package/dist/runtime/index.js +55 -9
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -37091,11 +37091,13 @@ function enrichFormFields(fields, entityDef) {
|
|
|
37091
37091
|
}
|
|
37092
37092
|
function renderContainedPortal(slot, content, onDismiss) {
|
|
37093
37093
|
const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss });
|
|
37094
|
+
const slotId = `slot-${slot}`;
|
|
37094
37095
|
switch (slot) {
|
|
37095
37096
|
case "modal":
|
|
37096
37097
|
return /* @__PURE__ */ jsx(
|
|
37097
37098
|
Box,
|
|
37098
37099
|
{
|
|
37100
|
+
id: slotId,
|
|
37099
37101
|
className: "absolute inset-0 z-50 flex items-start justify-center overflow-auto",
|
|
37100
37102
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)", paddingTop: "10%" },
|
|
37101
37103
|
onClick: onDismiss,
|
|
@@ -37132,6 +37134,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37132
37134
|
return /* @__PURE__ */ jsx(
|
|
37133
37135
|
Box,
|
|
37134
37136
|
{
|
|
37137
|
+
id: slotId,
|
|
37135
37138
|
className: "absolute inset-0 z-50 overflow-hidden",
|
|
37136
37139
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37137
37140
|
onClick: onDismiss,
|
|
@@ -37164,7 +37167,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37164
37167
|
}
|
|
37165
37168
|
);
|
|
37166
37169
|
case "toast":
|
|
37167
|
-
return /* @__PURE__ */ jsx(Box, { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37170
|
+
return /* @__PURE__ */ jsx(Box, { id: slotId, className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37168
37171
|
Toast,
|
|
37169
37172
|
{
|
|
37170
37173
|
variant: content.props.variant ?? "info",
|
|
@@ -37177,6 +37180,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37177
37180
|
return /* @__PURE__ */ jsx(
|
|
37178
37181
|
Box,
|
|
37179
37182
|
{
|
|
37183
|
+
id: slotId,
|
|
37180
37184
|
className: "absolute inset-0 z-50 flex items-center justify-center overflow-auto",
|
|
37181
37185
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37182
37186
|
onClick: onDismiss,
|
|
@@ -37184,9 +37188,9 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37184
37188
|
}
|
|
37185
37189
|
);
|
|
37186
37190
|
case "center":
|
|
37187
|
-
return /* @__PURE__ */ jsx(Box, { className: "absolute inset-0 z-50 flex items-center justify-center pointer-events-none overflow-auto", children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto max-h-full overflow-auto", children: slotContent }) });
|
|
37191
|
+
return /* @__PURE__ */ jsx(Box, { id: slotId, className: "absolute inset-0 z-50 flex items-center justify-center pointer-events-none overflow-auto", children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto max-h-full overflow-auto", children: slotContent }) });
|
|
37188
37192
|
default:
|
|
37189
|
-
return slotContent;
|
|
37193
|
+
return /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent });
|
|
37190
37194
|
}
|
|
37191
37195
|
}
|
|
37192
37196
|
function UISlotComponent({
|
|
@@ -37305,12 +37309,14 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37305
37309
|
eventBus.clear(slot);
|
|
37306
37310
|
};
|
|
37307
37311
|
if (!portalRoot) return null;
|
|
37312
|
+
const slotId = `slot-${slot}`;
|
|
37308
37313
|
let wrapper;
|
|
37309
37314
|
switch (slot) {
|
|
37310
37315
|
case "modal":
|
|
37311
37316
|
wrapper = /* @__PURE__ */ jsx(Modal, { isOpen: true, onClose: handleDismiss, showCloseButton: true, size: "lg", children: /* @__PURE__ */ jsx(
|
|
37312
37317
|
Box,
|
|
37313
37318
|
{
|
|
37319
|
+
id: slotId,
|
|
37314
37320
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37315
37321
|
"data-pattern": pattern,
|
|
37316
37322
|
"data-source-trait": sourceTrait,
|
|
@@ -37322,6 +37328,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37322
37328
|
wrapper = /* @__PURE__ */ jsx(Drawer, { isOpen: true, onClose: handleDismiss, position: "right", children: /* @__PURE__ */ jsx(
|
|
37323
37329
|
Box,
|
|
37324
37330
|
{
|
|
37331
|
+
id: slotId,
|
|
37325
37332
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37326
37333
|
"data-pattern": pattern,
|
|
37327
37334
|
"data-source-trait": sourceTrait,
|
|
@@ -37333,6 +37340,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37333
37340
|
wrapper = /* @__PURE__ */ jsx(Box, { className: "fixed top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37334
37341
|
Box,
|
|
37335
37342
|
{
|
|
37343
|
+
id: slotId,
|
|
37336
37344
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37337
37345
|
"data-pattern": pattern,
|
|
37338
37346
|
"data-source-trait": sourceTrait,
|
|
@@ -37344,6 +37352,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37344
37352
|
wrapper = /* @__PURE__ */ jsx(
|
|
37345
37353
|
Box,
|
|
37346
37354
|
{
|
|
37355
|
+
id: slotId,
|
|
37347
37356
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37348
37357
|
"data-pattern": pattern,
|
|
37349
37358
|
"data-source-trait": sourceTrait,
|
|
@@ -37367,6 +37376,8 @@ function SlotPortal({
|
|
|
37367
37376
|
if (portalRoot) getOrCreatePortalRoot();
|
|
37368
37377
|
});
|
|
37369
37378
|
if (!portalRoot) return null;
|
|
37379
|
+
const slotId = `slot-${slot}`;
|
|
37380
|
+
const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss });
|
|
37370
37381
|
let wrapper;
|
|
37371
37382
|
switch (slot) {
|
|
37372
37383
|
case "modal":
|
|
@@ -37377,7 +37388,7 @@ function SlotPortal({
|
|
|
37377
37388
|
onClose: onDismiss,
|
|
37378
37389
|
title: content.props.title,
|
|
37379
37390
|
size: content.props.size,
|
|
37380
|
-
children: /* @__PURE__ */ jsx(
|
|
37391
|
+
children: /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent })
|
|
37381
37392
|
}
|
|
37382
37393
|
);
|
|
37383
37394
|
break;
|
|
@@ -37390,12 +37401,12 @@ function SlotPortal({
|
|
|
37390
37401
|
title: content.props.title,
|
|
37391
37402
|
position: content.props.position ?? "right",
|
|
37392
37403
|
width: content.props.width,
|
|
37393
|
-
children: /* @__PURE__ */ jsx(
|
|
37404
|
+
children: /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent })
|
|
37394
37405
|
}
|
|
37395
37406
|
);
|
|
37396
37407
|
break;
|
|
37397
37408
|
case "toast":
|
|
37398
|
-
wrapper = /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsx(
|
|
37409
|
+
wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsx(
|
|
37399
37410
|
Toast,
|
|
37400
37411
|
{
|
|
37401
37412
|
variant: content.props.variant ?? "info",
|
|
@@ -37409,17 +37420,18 @@ function SlotPortal({
|
|
|
37409
37420
|
wrapper = /* @__PURE__ */ jsx(
|
|
37410
37421
|
Box,
|
|
37411
37422
|
{
|
|
37423
|
+
id: slotId,
|
|
37412
37424
|
className: "fixed inset-0 z-50 bg-foreground/50 flex items-center justify-center",
|
|
37413
37425
|
onClick: onDismiss,
|
|
37414
|
-
children: /* @__PURE__ */ jsx(Box, { onClick: (e) => e.stopPropagation(), children:
|
|
37426
|
+
children: /* @__PURE__ */ jsx(Box, { onClick: (e) => e.stopPropagation(), children: slotContent })
|
|
37415
37427
|
}
|
|
37416
37428
|
);
|
|
37417
37429
|
break;
|
|
37418
37430
|
case "center":
|
|
37419
|
-
wrapper = /* @__PURE__ */ jsx(Box, { className: "fixed inset-0 z-50 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto", children:
|
|
37431
|
+
wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, className: "fixed inset-0 z-50 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto", children: slotContent }) });
|
|
37420
37432
|
break;
|
|
37421
37433
|
default:
|
|
37422
|
-
wrapper = /* @__PURE__ */ jsx(
|
|
37434
|
+
wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent });
|
|
37423
37435
|
}
|
|
37424
37436
|
return createPortal(wrapper, portalRoot);
|
|
37425
37437
|
}
|
package/dist/providers/index.cjs
CHANGED
|
@@ -37645,11 +37645,13 @@ function enrichFormFields(fields, entityDef) {
|
|
|
37645
37645
|
}
|
|
37646
37646
|
function renderContainedPortal(slot, content, onDismiss) {
|
|
37647
37647
|
const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss });
|
|
37648
|
+
const slotId = `slot-${slot}`;
|
|
37648
37649
|
switch (slot) {
|
|
37649
37650
|
case "modal":
|
|
37650
37651
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37651
37652
|
Box,
|
|
37652
37653
|
{
|
|
37654
|
+
id: slotId,
|
|
37653
37655
|
className: "absolute inset-0 z-50 flex items-start justify-center overflow-auto",
|
|
37654
37656
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)", paddingTop: "10%" },
|
|
37655
37657
|
onClick: onDismiss,
|
|
@@ -37686,6 +37688,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37686
37688
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37687
37689
|
Box,
|
|
37688
37690
|
{
|
|
37691
|
+
id: slotId,
|
|
37689
37692
|
className: "absolute inset-0 z-50 overflow-hidden",
|
|
37690
37693
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37691
37694
|
onClick: onDismiss,
|
|
@@ -37718,7 +37721,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37718
37721
|
}
|
|
37719
37722
|
);
|
|
37720
37723
|
case "toast":
|
|
37721
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37724
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37722
37725
|
Toast,
|
|
37723
37726
|
{
|
|
37724
37727
|
variant: content.props.variant ?? "info",
|
|
@@ -37731,6 +37734,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37731
37734
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37732
37735
|
Box,
|
|
37733
37736
|
{
|
|
37737
|
+
id: slotId,
|
|
37734
37738
|
className: "absolute inset-0 z-50 flex items-center justify-center overflow-auto",
|
|
37735
37739
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37736
37740
|
onClick: onDismiss,
|
|
@@ -37738,9 +37742,9 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37738
37742
|
}
|
|
37739
37743
|
);
|
|
37740
37744
|
case "center":
|
|
37741
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute inset-0 z-50 flex items-center justify-center pointer-events-none overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "pointer-events-auto max-h-full overflow-auto", children: slotContent }) });
|
|
37745
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: "absolute inset-0 z-50 flex items-center justify-center pointer-events-none overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "pointer-events-auto max-h-full overflow-auto", children: slotContent }) });
|
|
37742
37746
|
default:
|
|
37743
|
-
return slotContent;
|
|
37747
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent });
|
|
37744
37748
|
}
|
|
37745
37749
|
}
|
|
37746
37750
|
function UISlotComponent({
|
|
@@ -37859,12 +37863,14 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37859
37863
|
eventBus.clear(slot);
|
|
37860
37864
|
};
|
|
37861
37865
|
if (!portalRoot) return null;
|
|
37866
|
+
const slotId = `slot-${slot}`;
|
|
37862
37867
|
let wrapper;
|
|
37863
37868
|
switch (slot) {
|
|
37864
37869
|
case "modal":
|
|
37865
37870
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Modal, { isOpen: true, onClose: handleDismiss, showCloseButton: true, size: "lg", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37866
37871
|
Box,
|
|
37867
37872
|
{
|
|
37873
|
+
id: slotId,
|
|
37868
37874
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37869
37875
|
"data-pattern": pattern,
|
|
37870
37876
|
"data-source-trait": sourceTrait,
|
|
@@ -37876,6 +37882,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37876
37882
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Drawer, { isOpen: true, onClose: handleDismiss, position: "right", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37877
37883
|
Box,
|
|
37878
37884
|
{
|
|
37885
|
+
id: slotId,
|
|
37879
37886
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37880
37887
|
"data-pattern": pattern,
|
|
37881
37888
|
"data-source-trait": sourceTrait,
|
|
@@ -37887,6 +37894,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37887
37894
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "fixed top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37888
37895
|
Box,
|
|
37889
37896
|
{
|
|
37897
|
+
id: slotId,
|
|
37890
37898
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37891
37899
|
"data-pattern": pattern,
|
|
37892
37900
|
"data-source-trait": sourceTrait,
|
|
@@ -37898,6 +37906,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37898
37906
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(
|
|
37899
37907
|
Box,
|
|
37900
37908
|
{
|
|
37909
|
+
id: slotId,
|
|
37901
37910
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37902
37911
|
"data-pattern": pattern,
|
|
37903
37912
|
"data-source-trait": sourceTrait,
|
|
@@ -37921,6 +37930,8 @@ function SlotPortal({
|
|
|
37921
37930
|
if (portalRoot) getOrCreatePortalRoot();
|
|
37922
37931
|
});
|
|
37923
37932
|
if (!portalRoot) return null;
|
|
37933
|
+
const slotId = `slot-${slot}`;
|
|
37934
|
+
const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss });
|
|
37924
37935
|
let wrapper;
|
|
37925
37936
|
switch (slot) {
|
|
37926
37937
|
case "modal":
|
|
@@ -37931,7 +37942,7 @@ function SlotPortal({
|
|
|
37931
37942
|
onClose: onDismiss,
|
|
37932
37943
|
title: content.props.title,
|
|
37933
37944
|
size: content.props.size,
|
|
37934
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37945
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent })
|
|
37935
37946
|
}
|
|
37936
37947
|
);
|
|
37937
37948
|
break;
|
|
@@ -37944,12 +37955,12 @@ function SlotPortal({
|
|
|
37944
37955
|
title: content.props.title,
|
|
37945
37956
|
position: content.props.position ?? "right",
|
|
37946
37957
|
width: content.props.width,
|
|
37947
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37958
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent })
|
|
37948
37959
|
}
|
|
37949
37960
|
);
|
|
37950
37961
|
break;
|
|
37951
37962
|
case "toast":
|
|
37952
|
-
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37963
|
+
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37953
37964
|
Toast,
|
|
37954
37965
|
{
|
|
37955
37966
|
variant: content.props.variant ?? "info",
|
|
@@ -37963,17 +37974,18 @@ function SlotPortal({
|
|
|
37963
37974
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(
|
|
37964
37975
|
Box,
|
|
37965
37976
|
{
|
|
37977
|
+
id: slotId,
|
|
37966
37978
|
className: "fixed inset-0 z-50 bg-foreground/50 flex items-center justify-center",
|
|
37967
37979
|
onClick: onDismiss,
|
|
37968
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { onClick: (e) => e.stopPropagation(), children:
|
|
37980
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { onClick: (e) => e.stopPropagation(), children: slotContent })
|
|
37969
37981
|
}
|
|
37970
37982
|
);
|
|
37971
37983
|
break;
|
|
37972
37984
|
case "center":
|
|
37973
|
-
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "fixed inset-0 z-50 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "pointer-events-auto", children:
|
|
37985
|
+
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: "fixed inset-0 z-50 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "pointer-events-auto", children: slotContent }) });
|
|
37974
37986
|
break;
|
|
37975
37987
|
default:
|
|
37976
|
-
wrapper = /* @__PURE__ */ jsxRuntime.jsx(
|
|
37988
|
+
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent });
|
|
37977
37989
|
}
|
|
37978
37990
|
return reactDom.createPortal(wrapper, portalRoot);
|
|
37979
37991
|
}
|
package/dist/providers/index.js
CHANGED
|
@@ -37600,11 +37600,13 @@ function enrichFormFields(fields, entityDef) {
|
|
|
37600
37600
|
}
|
|
37601
37601
|
function renderContainedPortal(slot, content, onDismiss) {
|
|
37602
37602
|
const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss });
|
|
37603
|
+
const slotId = `slot-${slot}`;
|
|
37603
37604
|
switch (slot) {
|
|
37604
37605
|
case "modal":
|
|
37605
37606
|
return /* @__PURE__ */ jsx(
|
|
37606
37607
|
Box,
|
|
37607
37608
|
{
|
|
37609
|
+
id: slotId,
|
|
37608
37610
|
className: "absolute inset-0 z-50 flex items-start justify-center overflow-auto",
|
|
37609
37611
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)", paddingTop: "10%" },
|
|
37610
37612
|
onClick: onDismiss,
|
|
@@ -37641,6 +37643,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37641
37643
|
return /* @__PURE__ */ jsx(
|
|
37642
37644
|
Box,
|
|
37643
37645
|
{
|
|
37646
|
+
id: slotId,
|
|
37644
37647
|
className: "absolute inset-0 z-50 overflow-hidden",
|
|
37645
37648
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37646
37649
|
onClick: onDismiss,
|
|
@@ -37673,7 +37676,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37673
37676
|
}
|
|
37674
37677
|
);
|
|
37675
37678
|
case "toast":
|
|
37676
|
-
return /* @__PURE__ */ jsx(Box, { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37679
|
+
return /* @__PURE__ */ jsx(Box, { id: slotId, className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37677
37680
|
Toast,
|
|
37678
37681
|
{
|
|
37679
37682
|
variant: content.props.variant ?? "info",
|
|
@@ -37686,6 +37689,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37686
37689
|
return /* @__PURE__ */ jsx(
|
|
37687
37690
|
Box,
|
|
37688
37691
|
{
|
|
37692
|
+
id: slotId,
|
|
37689
37693
|
className: "absolute inset-0 z-50 flex items-center justify-center overflow-auto",
|
|
37690
37694
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37691
37695
|
onClick: onDismiss,
|
|
@@ -37693,9 +37697,9 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37693
37697
|
}
|
|
37694
37698
|
);
|
|
37695
37699
|
case "center":
|
|
37696
|
-
return /* @__PURE__ */ jsx(Box, { className: "absolute inset-0 z-50 flex items-center justify-center pointer-events-none overflow-auto", children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto max-h-full overflow-auto", children: slotContent }) });
|
|
37700
|
+
return /* @__PURE__ */ jsx(Box, { id: slotId, className: "absolute inset-0 z-50 flex items-center justify-center pointer-events-none overflow-auto", children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto max-h-full overflow-auto", children: slotContent }) });
|
|
37697
37701
|
default:
|
|
37698
|
-
return slotContent;
|
|
37702
|
+
return /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent });
|
|
37699
37703
|
}
|
|
37700
37704
|
}
|
|
37701
37705
|
function UISlotComponent({
|
|
@@ -37814,12 +37818,14 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37814
37818
|
eventBus.clear(slot);
|
|
37815
37819
|
};
|
|
37816
37820
|
if (!portalRoot) return null;
|
|
37821
|
+
const slotId = `slot-${slot}`;
|
|
37817
37822
|
let wrapper;
|
|
37818
37823
|
switch (slot) {
|
|
37819
37824
|
case "modal":
|
|
37820
37825
|
wrapper = /* @__PURE__ */ jsx(Modal, { isOpen: true, onClose: handleDismiss, showCloseButton: true, size: "lg", children: /* @__PURE__ */ jsx(
|
|
37821
37826
|
Box,
|
|
37822
37827
|
{
|
|
37828
|
+
id: slotId,
|
|
37823
37829
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37824
37830
|
"data-pattern": pattern,
|
|
37825
37831
|
"data-source-trait": sourceTrait,
|
|
@@ -37831,6 +37837,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37831
37837
|
wrapper = /* @__PURE__ */ jsx(Drawer, { isOpen: true, onClose: handleDismiss, position: "right", children: /* @__PURE__ */ jsx(
|
|
37832
37838
|
Box,
|
|
37833
37839
|
{
|
|
37840
|
+
id: slotId,
|
|
37834
37841
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37835
37842
|
"data-pattern": pattern,
|
|
37836
37843
|
"data-source-trait": sourceTrait,
|
|
@@ -37842,6 +37849,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37842
37849
|
wrapper = /* @__PURE__ */ jsx(Box, { className: "fixed top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37843
37850
|
Box,
|
|
37844
37851
|
{
|
|
37852
|
+
id: slotId,
|
|
37845
37853
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37846
37854
|
"data-pattern": pattern,
|
|
37847
37855
|
"data-source-trait": sourceTrait,
|
|
@@ -37853,6 +37861,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37853
37861
|
wrapper = /* @__PURE__ */ jsx(
|
|
37854
37862
|
Box,
|
|
37855
37863
|
{
|
|
37864
|
+
id: slotId,
|
|
37856
37865
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37857
37866
|
"data-pattern": pattern,
|
|
37858
37867
|
"data-source-trait": sourceTrait,
|
|
@@ -37876,6 +37885,8 @@ function SlotPortal({
|
|
|
37876
37885
|
if (portalRoot) getOrCreatePortalRoot();
|
|
37877
37886
|
});
|
|
37878
37887
|
if (!portalRoot) return null;
|
|
37888
|
+
const slotId = `slot-${slot}`;
|
|
37889
|
+
const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss });
|
|
37879
37890
|
let wrapper;
|
|
37880
37891
|
switch (slot) {
|
|
37881
37892
|
case "modal":
|
|
@@ -37886,7 +37897,7 @@ function SlotPortal({
|
|
|
37886
37897
|
onClose: onDismiss,
|
|
37887
37898
|
title: content.props.title,
|
|
37888
37899
|
size: content.props.size,
|
|
37889
|
-
children: /* @__PURE__ */ jsx(
|
|
37900
|
+
children: /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent })
|
|
37890
37901
|
}
|
|
37891
37902
|
);
|
|
37892
37903
|
break;
|
|
@@ -37899,12 +37910,12 @@ function SlotPortal({
|
|
|
37899
37910
|
title: content.props.title,
|
|
37900
37911
|
position: content.props.position ?? "right",
|
|
37901
37912
|
width: content.props.width,
|
|
37902
|
-
children: /* @__PURE__ */ jsx(
|
|
37913
|
+
children: /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent })
|
|
37903
37914
|
}
|
|
37904
37915
|
);
|
|
37905
37916
|
break;
|
|
37906
37917
|
case "toast":
|
|
37907
|
-
wrapper = /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsx(
|
|
37918
|
+
wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsx(
|
|
37908
37919
|
Toast,
|
|
37909
37920
|
{
|
|
37910
37921
|
variant: content.props.variant ?? "info",
|
|
@@ -37918,17 +37929,18 @@ function SlotPortal({
|
|
|
37918
37929
|
wrapper = /* @__PURE__ */ jsx(
|
|
37919
37930
|
Box,
|
|
37920
37931
|
{
|
|
37932
|
+
id: slotId,
|
|
37921
37933
|
className: "fixed inset-0 z-50 bg-foreground/50 flex items-center justify-center",
|
|
37922
37934
|
onClick: onDismiss,
|
|
37923
|
-
children: /* @__PURE__ */ jsx(Box, { onClick: (e) => e.stopPropagation(), children:
|
|
37935
|
+
children: /* @__PURE__ */ jsx(Box, { onClick: (e) => e.stopPropagation(), children: slotContent })
|
|
37924
37936
|
}
|
|
37925
37937
|
);
|
|
37926
37938
|
break;
|
|
37927
37939
|
case "center":
|
|
37928
|
-
wrapper = /* @__PURE__ */ jsx(Box, { className: "fixed inset-0 z-50 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto", children:
|
|
37940
|
+
wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, className: "fixed inset-0 z-50 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto", children: slotContent }) });
|
|
37929
37941
|
break;
|
|
37930
37942
|
default:
|
|
37931
|
-
wrapper = /* @__PURE__ */ jsx(
|
|
37943
|
+
wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent });
|
|
37932
37944
|
}
|
|
37933
37945
|
return createPortal(wrapper, portalRoot);
|
|
37934
37946
|
}
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -1048,6 +1048,20 @@ function bindTraitStateGetter(getter) {
|
|
|
1048
1048
|
window.__orbitalVerification.getTraitState = getter;
|
|
1049
1049
|
}
|
|
1050
1050
|
}
|
|
1051
|
+
function registerTraitSnapshot(traitName, getter) {
|
|
1052
|
+
if (typeof window === "undefined") return () => {
|
|
1053
|
+
};
|
|
1054
|
+
getState().traitSnapshots.set(traitName, getter);
|
|
1055
|
+
exposeOnWindow();
|
|
1056
|
+
notifyListeners2();
|
|
1057
|
+
return () => {
|
|
1058
|
+
const s = getState();
|
|
1059
|
+
if (s.traitSnapshots.get(traitName) === getter) {
|
|
1060
|
+
s.traitSnapshots.delete(traitName);
|
|
1061
|
+
notifyListeners2();
|
|
1062
|
+
}
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1051
1065
|
function bindCanvasCapture(captureFn) {
|
|
1052
1066
|
if (typeof window === "undefined") return;
|
|
1053
1067
|
exposeOnWindow();
|
|
@@ -37217,11 +37231,13 @@ function enrichFormFields(fields, entityDef) {
|
|
|
37217
37231
|
}
|
|
37218
37232
|
function renderContainedPortal(slot, content, onDismiss) {
|
|
37219
37233
|
const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss });
|
|
37234
|
+
const slotId = `slot-${slot}`;
|
|
37220
37235
|
switch (slot) {
|
|
37221
37236
|
case "modal":
|
|
37222
37237
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37223
37238
|
Box,
|
|
37224
37239
|
{
|
|
37240
|
+
id: slotId,
|
|
37225
37241
|
className: "absolute inset-0 z-50 flex items-start justify-center overflow-auto",
|
|
37226
37242
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)", paddingTop: "10%" },
|
|
37227
37243
|
onClick: onDismiss,
|
|
@@ -37258,6 +37274,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37258
37274
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37259
37275
|
Box,
|
|
37260
37276
|
{
|
|
37277
|
+
id: slotId,
|
|
37261
37278
|
className: "absolute inset-0 z-50 overflow-hidden",
|
|
37262
37279
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37263
37280
|
onClick: onDismiss,
|
|
@@ -37290,7 +37307,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37290
37307
|
}
|
|
37291
37308
|
);
|
|
37292
37309
|
case "toast":
|
|
37293
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37310
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37294
37311
|
Toast,
|
|
37295
37312
|
{
|
|
37296
37313
|
variant: content.props.variant ?? "info",
|
|
@@ -37303,6 +37320,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37303
37320
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37304
37321
|
Box,
|
|
37305
37322
|
{
|
|
37323
|
+
id: slotId,
|
|
37306
37324
|
className: "absolute inset-0 z-50 flex items-center justify-center overflow-auto",
|
|
37307
37325
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37308
37326
|
onClick: onDismiss,
|
|
@@ -37310,9 +37328,9 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37310
37328
|
}
|
|
37311
37329
|
);
|
|
37312
37330
|
case "center":
|
|
37313
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute inset-0 z-50 flex items-center justify-center pointer-events-none overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "pointer-events-auto max-h-full overflow-auto", children: slotContent }) });
|
|
37331
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: "absolute inset-0 z-50 flex items-center justify-center pointer-events-none overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "pointer-events-auto max-h-full overflow-auto", children: slotContent }) });
|
|
37314
37332
|
default:
|
|
37315
|
-
return slotContent;
|
|
37333
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent });
|
|
37316
37334
|
}
|
|
37317
37335
|
}
|
|
37318
37336
|
function UISlotComponent({
|
|
@@ -37431,12 +37449,14 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37431
37449
|
eventBus.clear(slot);
|
|
37432
37450
|
};
|
|
37433
37451
|
if (!portalRoot) return null;
|
|
37452
|
+
const slotId = `slot-${slot}`;
|
|
37434
37453
|
let wrapper;
|
|
37435
37454
|
switch (slot) {
|
|
37436
37455
|
case "modal":
|
|
37437
37456
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Modal, { isOpen: true, onClose: handleDismiss, showCloseButton: true, size: "lg", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37438
37457
|
Box,
|
|
37439
37458
|
{
|
|
37459
|
+
id: slotId,
|
|
37440
37460
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37441
37461
|
"data-pattern": pattern,
|
|
37442
37462
|
"data-source-trait": sourceTrait,
|
|
@@ -37448,6 +37468,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37448
37468
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Drawer, { isOpen: true, onClose: handleDismiss, position: "right", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37449
37469
|
Box,
|
|
37450
37470
|
{
|
|
37471
|
+
id: slotId,
|
|
37451
37472
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37452
37473
|
"data-pattern": pattern,
|
|
37453
37474
|
"data-source-trait": sourceTrait,
|
|
@@ -37459,6 +37480,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37459
37480
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "fixed top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37460
37481
|
Box,
|
|
37461
37482
|
{
|
|
37483
|
+
id: slotId,
|
|
37462
37484
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37463
37485
|
"data-pattern": pattern,
|
|
37464
37486
|
"data-source-trait": sourceTrait,
|
|
@@ -37470,6 +37492,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37470
37492
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(
|
|
37471
37493
|
Box,
|
|
37472
37494
|
{
|
|
37495
|
+
id: slotId,
|
|
37473
37496
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37474
37497
|
"data-pattern": pattern,
|
|
37475
37498
|
"data-source-trait": sourceTrait,
|
|
@@ -37493,6 +37516,8 @@ function SlotPortal({
|
|
|
37493
37516
|
if (portalRoot) getOrCreatePortalRoot();
|
|
37494
37517
|
});
|
|
37495
37518
|
if (!portalRoot) return null;
|
|
37519
|
+
const slotId = `slot-${slot}`;
|
|
37520
|
+
const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss });
|
|
37496
37521
|
let wrapper;
|
|
37497
37522
|
switch (slot) {
|
|
37498
37523
|
case "modal":
|
|
@@ -37503,7 +37528,7 @@ function SlotPortal({
|
|
|
37503
37528
|
onClose: onDismiss,
|
|
37504
37529
|
title: content.props.title,
|
|
37505
37530
|
size: content.props.size,
|
|
37506
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37531
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent })
|
|
37507
37532
|
}
|
|
37508
37533
|
);
|
|
37509
37534
|
break;
|
|
@@ -37516,12 +37541,12 @@ function SlotPortal({
|
|
|
37516
37541
|
title: content.props.title,
|
|
37517
37542
|
position: content.props.position ?? "right",
|
|
37518
37543
|
width: content.props.width,
|
|
37519
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37544
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent })
|
|
37520
37545
|
}
|
|
37521
37546
|
);
|
|
37522
37547
|
break;
|
|
37523
37548
|
case "toast":
|
|
37524
|
-
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37549
|
+
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37525
37550
|
Toast,
|
|
37526
37551
|
{
|
|
37527
37552
|
variant: content.props.variant ?? "info",
|
|
@@ -37535,17 +37560,18 @@ function SlotPortal({
|
|
|
37535
37560
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(
|
|
37536
37561
|
Box,
|
|
37537
37562
|
{
|
|
37563
|
+
id: slotId,
|
|
37538
37564
|
className: "fixed inset-0 z-50 bg-foreground/50 flex items-center justify-center",
|
|
37539
37565
|
onClick: onDismiss,
|
|
37540
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { onClick: (e) => e.stopPropagation(), children:
|
|
37566
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { onClick: (e) => e.stopPropagation(), children: slotContent })
|
|
37541
37567
|
}
|
|
37542
37568
|
);
|
|
37543
37569
|
break;
|
|
37544
37570
|
case "center":
|
|
37545
|
-
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "fixed inset-0 z-50 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "pointer-events-auto", children:
|
|
37571
|
+
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: "fixed inset-0 z-50 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "pointer-events-auto", children: slotContent }) });
|
|
37546
37572
|
break;
|
|
37547
37573
|
default:
|
|
37548
|
-
wrapper = /* @__PURE__ */ jsxRuntime.jsx(
|
|
37574
|
+
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent });
|
|
37549
37575
|
}
|
|
37550
37576
|
return reactDom.createPortal(wrapper, portalRoot);
|
|
37551
37577
|
}
|
|
@@ -37974,10 +38000,30 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
37974
38000
|
const state = newManager.getState(traitName);
|
|
37975
38001
|
return typeof state === "string" ? state : void 0;
|
|
37976
38002
|
});
|
|
38003
|
+
const snapshotUnregs = [];
|
|
38004
|
+
for (const binding of traitBindingsRef.current) {
|
|
38005
|
+
const traitName = binding.trait.name;
|
|
38006
|
+
const unreg = registerTraitSnapshot(traitName, () => {
|
|
38007
|
+
const managerState = managerRef.current.getState(traitName);
|
|
38008
|
+
const currentState = managerState?.currentState ?? binding.trait.states[0]?.name ?? "unknown";
|
|
38009
|
+
return {
|
|
38010
|
+
traitName,
|
|
38011
|
+
currentState,
|
|
38012
|
+
states: binding.trait.states.map((s) => s.name),
|
|
38013
|
+
events: binding.trait.events.map((e) => e.key),
|
|
38014
|
+
data: {},
|
|
38015
|
+
cascadeReceived: []
|
|
38016
|
+
};
|
|
38017
|
+
});
|
|
38018
|
+
snapshotUnregs.push(unreg);
|
|
38019
|
+
}
|
|
37977
38020
|
console.log(
|
|
37978
38021
|
"[TraitStateMachine] Reset states for page navigation:",
|
|
37979
38022
|
Array.from(newManager.getAllStates().keys()).join(", ")
|
|
37980
38023
|
);
|
|
38024
|
+
return () => {
|
|
38025
|
+
for (const unreg of snapshotUnregs) unreg();
|
|
38026
|
+
};
|
|
37981
38027
|
}, [traitBindings]);
|
|
37982
38028
|
const runTickEffects = React116.useCallback((tick, binding) => {
|
|
37983
38029
|
const actions = slotsActionsRef.current;
|