@almadar/ui 6.20.0 → 6.22.0
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 -31
- package/dist/avl/index.js +55 -31
- package/dist/components/index.cjs +50 -28
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +50 -28
- package/dist/providers/index.cjs +46 -26
- package/dist/providers/index.js +46 -26
- package/dist/runtime/index.cjs +55 -31
- package/dist/runtime/index.d.cts +10 -1
- package/dist/runtime/index.d.ts +10 -1
- package/dist/runtime/index.js +55 -31
- package/package.json +1 -1
package/dist/providers/index.js
CHANGED
|
@@ -1503,6 +1503,36 @@ var init_Typography = __esm({
|
|
|
1503
1503
|
Typography.displayName = "Typography";
|
|
1504
1504
|
}
|
|
1505
1505
|
});
|
|
1506
|
+
|
|
1507
|
+
// lib/portalRoot.ts
|
|
1508
|
+
function lastThemedElement(selector, portalRoot) {
|
|
1509
|
+
const matches = Array.from(document.querySelectorAll(selector)).filter(
|
|
1510
|
+
(el) => el !== document.documentElement && el !== portalRoot
|
|
1511
|
+
);
|
|
1512
|
+
return matches[matches.length - 1] ?? null;
|
|
1513
|
+
}
|
|
1514
|
+
function getOrCreatePortalRoot() {
|
|
1515
|
+
let root = document.getElementById("ui-slot-portal-root");
|
|
1516
|
+
if (!root) {
|
|
1517
|
+
root = document.createElement("div");
|
|
1518
|
+
root.id = "ui-slot-portal-root";
|
|
1519
|
+
root.style.position = "relative";
|
|
1520
|
+
root.style.zIndex = "9999";
|
|
1521
|
+
document.body.appendChild(root);
|
|
1522
|
+
}
|
|
1523
|
+
const themed = lastThemedElement('[data-theme*="-"]', root) ?? lastThemedElement("[data-theme]", root);
|
|
1524
|
+
if (themed) {
|
|
1525
|
+
const theme = themed.getAttribute("data-theme");
|
|
1526
|
+
if (theme && root.getAttribute("data-theme") !== theme) {
|
|
1527
|
+
root.setAttribute("data-theme", theme);
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
return root;
|
|
1531
|
+
}
|
|
1532
|
+
var init_portalRoot = __esm({
|
|
1533
|
+
"lib/portalRoot.ts"() {
|
|
1534
|
+
}
|
|
1535
|
+
});
|
|
1506
1536
|
function isMotionEnabled() {
|
|
1507
1537
|
if (typeof document === "undefined") return true;
|
|
1508
1538
|
if (motionEnabledCache !== null) return motionEnabledCache;
|
|
@@ -1583,6 +1613,7 @@ var init_Modal = __esm({
|
|
|
1583
1613
|
init_Dialog();
|
|
1584
1614
|
init_Typography();
|
|
1585
1615
|
init_cn();
|
|
1616
|
+
init_portalRoot();
|
|
1586
1617
|
init_useEventBus();
|
|
1587
1618
|
init_Presence();
|
|
1588
1619
|
sizeClasses2 = {
|
|
@@ -1793,7 +1824,7 @@ var init_Modal = __esm({
|
|
|
1793
1824
|
)
|
|
1794
1825
|
}
|
|
1795
1826
|
),
|
|
1796
|
-
|
|
1827
|
+
getOrCreatePortalRoot()
|
|
1797
1828
|
);
|
|
1798
1829
|
};
|
|
1799
1830
|
Modal.displayName = "Modal";
|
|
@@ -20429,6 +20460,7 @@ var init_StateMachineView = __esm({
|
|
|
20429
20460
|
init_Icon();
|
|
20430
20461
|
init_useEventBus();
|
|
20431
20462
|
init_cn();
|
|
20463
|
+
init_portalRoot();
|
|
20432
20464
|
StateNode2 = ({ state, config }) => {
|
|
20433
20465
|
const { t } = useTranslate();
|
|
20434
20466
|
const size = state.radius * 2;
|
|
@@ -20945,7 +20977,7 @@ var init_StateMachineView = __esm({
|
|
|
20945
20977
|
)
|
|
20946
20978
|
}
|
|
20947
20979
|
),
|
|
20948
|
-
|
|
20980
|
+
getOrCreatePortalRoot()
|
|
20949
20981
|
);
|
|
20950
20982
|
};
|
|
20951
20983
|
EntityBox = ({ entity, config }) => {
|
|
@@ -27586,7 +27618,7 @@ function SubMenu({
|
|
|
27586
27618
|
})
|
|
27587
27619
|
}
|
|
27588
27620
|
);
|
|
27589
|
-
return typeof document !== "undefined" ? createPortal(panel,
|
|
27621
|
+
return typeof document !== "undefined" ? createPortal(panel, getOrCreatePortalRoot()) : panel;
|
|
27590
27622
|
}
|
|
27591
27623
|
function MenuItemRow({
|
|
27592
27624
|
item,
|
|
@@ -27673,6 +27705,7 @@ var init_Menu = __esm({
|
|
|
27673
27705
|
init_Typography();
|
|
27674
27706
|
init_Badge();
|
|
27675
27707
|
init_cn();
|
|
27708
|
+
init_portalRoot();
|
|
27676
27709
|
init_useEventBus();
|
|
27677
27710
|
MENU_GAP = 4;
|
|
27678
27711
|
menuContainerStyles = cn(
|
|
@@ -27809,7 +27842,7 @@ var init_Menu = __esm({
|
|
|
27809
27842
|
) : null;
|
|
27810
27843
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27811
27844
|
triggerElement,
|
|
27812
|
-
panel && typeof document !== "undefined" ? createPortal(panel,
|
|
27845
|
+
panel && typeof document !== "undefined" ? createPortal(panel, getOrCreatePortalRoot()) : panel
|
|
27813
27846
|
] });
|
|
27814
27847
|
};
|
|
27815
27848
|
Menu.displayName = "Menu";
|
|
@@ -31193,6 +31226,7 @@ var init_Popover = __esm({
|
|
|
31193
31226
|
init_Typography();
|
|
31194
31227
|
init_Presence();
|
|
31195
31228
|
init_cn();
|
|
31229
|
+
init_portalRoot();
|
|
31196
31230
|
init_useTapReveal();
|
|
31197
31231
|
arrowClasses = {
|
|
31198
31232
|
top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
|
|
@@ -31352,7 +31386,7 @@ var init_Popover = __esm({
|
|
|
31352
31386
|
) : null;
|
|
31353
31387
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
31354
31388
|
triggerElement,
|
|
31355
|
-
panel && typeof document !== "undefined" ? createPortal(panel,
|
|
31389
|
+
panel && typeof document !== "undefined" ? createPortal(panel, getOrCreatePortalRoot()) : panel
|
|
31356
31390
|
] });
|
|
31357
31391
|
};
|
|
31358
31392
|
Popover.displayName = "Popover";
|
|
@@ -31858,6 +31892,7 @@ var init_Tooltip = __esm({
|
|
|
31858
31892
|
"use client";
|
|
31859
31893
|
init_Typography();
|
|
31860
31894
|
init_cn();
|
|
31895
|
+
init_portalRoot();
|
|
31861
31896
|
init_useTapReveal();
|
|
31862
31897
|
TRIGGER_GAP2 = 8;
|
|
31863
31898
|
arrowClasses2 = {
|
|
@@ -31963,7 +31998,7 @@ var init_Tooltip = __esm({
|
|
|
31963
31998
|
) : null;
|
|
31964
31999
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
31965
32000
|
trigger,
|
|
31966
|
-
typeof window !== "undefined" && tooltipContent ? createPortal(tooltipContent,
|
|
32001
|
+
typeof window !== "undefined" && tooltipContent ? createPortal(tooltipContent, getOrCreatePortalRoot()) : tooltipContent
|
|
31967
32002
|
] });
|
|
31968
32003
|
};
|
|
31969
32004
|
Tooltip.displayName = "Tooltip";
|
|
@@ -43383,6 +43418,7 @@ var init_GraphCanvas = __esm({
|
|
|
43383
43418
|
"components/core/molecules/GraphCanvas.tsx"() {
|
|
43384
43419
|
"use client";
|
|
43385
43420
|
init_cn();
|
|
43421
|
+
init_portalRoot();
|
|
43386
43422
|
init_atoms();
|
|
43387
43423
|
init_Stack();
|
|
43388
43424
|
init_LoadingState();
|
|
@@ -44094,7 +44130,7 @@ var init_GraphCanvas = __esm({
|
|
|
44094
44130
|
children: hoveredObj?.label
|
|
44095
44131
|
}
|
|
44096
44132
|
),
|
|
44097
|
-
|
|
44133
|
+
getOrCreatePortalRoot()
|
|
44098
44134
|
)
|
|
44099
44135
|
] }),
|
|
44100
44136
|
groups.length > 1 && /* @__PURE__ */ jsx(HStack, { gap: "md", className: "px-4 py-2 border-t border-border", wrap: true, children: groups.map((group, idx) => /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
@@ -45255,6 +45291,7 @@ var init_DetailPanel = __esm({
|
|
|
45255
45291
|
init_ErrorState();
|
|
45256
45292
|
init_EmptyState();
|
|
45257
45293
|
init_cn();
|
|
45294
|
+
init_portalRoot();
|
|
45258
45295
|
init_format();
|
|
45259
45296
|
init_getNestedValue();
|
|
45260
45297
|
init_relationLabel();
|
|
@@ -45674,7 +45711,7 @@ var init_DetailPanel = __esm({
|
|
|
45674
45711
|
return /* @__PURE__ */ jsx(Box, { className, children: content });
|
|
45675
45712
|
}
|
|
45676
45713
|
const panel = /* @__PURE__ */ jsx(Box, { className: cn("fixed inset-y-0 right-0 w-full max-w-2xl bg-card shadow-lg z-50 overflow-y-auto p-6", className), children: content });
|
|
45677
|
-
return typeof document === "undefined" ? panel : createPortal(panel,
|
|
45714
|
+
return typeof document === "undefined" ? panel : createPortal(panel, getOrCreatePortalRoot());
|
|
45678
45715
|
};
|
|
45679
45716
|
DetailPanel.displayName = "DetailPanel";
|
|
45680
45717
|
}
|
|
@@ -52565,24 +52602,6 @@ function UISlotComponentInner({
|
|
|
52565
52602
|
}
|
|
52566
52603
|
);
|
|
52567
52604
|
}
|
|
52568
|
-
function getOrCreatePortalRoot() {
|
|
52569
|
-
let root = document.getElementById("ui-slot-portal-root");
|
|
52570
|
-
if (!root) {
|
|
52571
|
-
root = document.createElement("div");
|
|
52572
|
-
root.id = "ui-slot-portal-root";
|
|
52573
|
-
root.style.position = "relative";
|
|
52574
|
-
root.style.zIndex = "9999";
|
|
52575
|
-
document.body.appendChild(root);
|
|
52576
|
-
}
|
|
52577
|
-
const themed = document.querySelector('[data-theme*="-"]') ?? document.querySelector("[data-theme]");
|
|
52578
|
-
if (themed) {
|
|
52579
|
-
const theme = themed.getAttribute("data-theme");
|
|
52580
|
-
if (theme && root.getAttribute("data-theme") !== theme) {
|
|
52581
|
-
root.setAttribute("data-theme", theme);
|
|
52582
|
-
}
|
|
52583
|
-
}
|
|
52584
|
-
return root;
|
|
52585
|
-
}
|
|
52586
52605
|
function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
52587
52606
|
const [portalRoot, setPortalRoot] = useState(null);
|
|
52588
52607
|
const slotsBus = useUISlots();
|
|
@@ -53205,6 +53224,7 @@ var init_UISlotRenderer = __esm({
|
|
|
53205
53224
|
init_slot_types();
|
|
53206
53225
|
init_cn();
|
|
53207
53226
|
init_format();
|
|
53227
|
+
init_portalRoot();
|
|
53208
53228
|
init_ErrorBoundary();
|
|
53209
53229
|
init_Skeleton();
|
|
53210
53230
|
init_renderer();
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -2176,6 +2176,36 @@ var init_Typography = __esm({
|
|
|
2176
2176
|
Typography.displayName = "Typography";
|
|
2177
2177
|
}
|
|
2178
2178
|
});
|
|
2179
|
+
|
|
2180
|
+
// lib/portalRoot.ts
|
|
2181
|
+
function lastThemedElement(selector, portalRoot) {
|
|
2182
|
+
const matches = Array.from(document.querySelectorAll(selector)).filter(
|
|
2183
|
+
(el) => el !== document.documentElement && el !== portalRoot
|
|
2184
|
+
);
|
|
2185
|
+
return matches[matches.length - 1] ?? null;
|
|
2186
|
+
}
|
|
2187
|
+
function getOrCreatePortalRoot() {
|
|
2188
|
+
let root = document.getElementById("ui-slot-portal-root");
|
|
2189
|
+
if (!root) {
|
|
2190
|
+
root = document.createElement("div");
|
|
2191
|
+
root.id = "ui-slot-portal-root";
|
|
2192
|
+
root.style.position = "relative";
|
|
2193
|
+
root.style.zIndex = "9999";
|
|
2194
|
+
document.body.appendChild(root);
|
|
2195
|
+
}
|
|
2196
|
+
const themed = lastThemedElement('[data-theme*="-"]', root) ?? lastThemedElement("[data-theme]", root);
|
|
2197
|
+
if (themed) {
|
|
2198
|
+
const theme = themed.getAttribute("data-theme");
|
|
2199
|
+
if (theme && root.getAttribute("data-theme") !== theme) {
|
|
2200
|
+
root.setAttribute("data-theme", theme);
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
return root;
|
|
2204
|
+
}
|
|
2205
|
+
var init_portalRoot = __esm({
|
|
2206
|
+
"lib/portalRoot.ts"() {
|
|
2207
|
+
}
|
|
2208
|
+
});
|
|
2179
2209
|
function isMotionEnabled() {
|
|
2180
2210
|
if (typeof document === "undefined") return true;
|
|
2181
2211
|
if (motionEnabledCache !== null) return motionEnabledCache;
|
|
@@ -2256,6 +2286,7 @@ var init_Modal = __esm({
|
|
|
2256
2286
|
init_Dialog();
|
|
2257
2287
|
init_Typography();
|
|
2258
2288
|
init_cn();
|
|
2289
|
+
init_portalRoot();
|
|
2259
2290
|
init_useEventBus();
|
|
2260
2291
|
init_Presence();
|
|
2261
2292
|
sizeClasses2 = {
|
|
@@ -2466,7 +2497,7 @@ var init_Modal = __esm({
|
|
|
2466
2497
|
)
|
|
2467
2498
|
}
|
|
2468
2499
|
),
|
|
2469
|
-
|
|
2500
|
+
getOrCreatePortalRoot()
|
|
2470
2501
|
);
|
|
2471
2502
|
};
|
|
2472
2503
|
Modal.displayName = "Modal";
|
|
@@ -20532,6 +20563,7 @@ var init_StateMachineView = __esm({
|
|
|
20532
20563
|
init_Icon();
|
|
20533
20564
|
init_useEventBus();
|
|
20534
20565
|
init_cn();
|
|
20566
|
+
init_portalRoot();
|
|
20535
20567
|
StateNode2 = ({ state, config }) => {
|
|
20536
20568
|
const { t } = hooks.useTranslate();
|
|
20537
20569
|
const size = state.radius * 2;
|
|
@@ -21048,7 +21080,7 @@ var init_StateMachineView = __esm({
|
|
|
21048
21080
|
)
|
|
21049
21081
|
}
|
|
21050
21082
|
),
|
|
21051
|
-
|
|
21083
|
+
getOrCreatePortalRoot()
|
|
21052
21084
|
);
|
|
21053
21085
|
};
|
|
21054
21086
|
EntityBox = ({ entity, config }) => {
|
|
@@ -27608,7 +27640,7 @@ function SubMenu({
|
|
|
27608
27640
|
})
|
|
27609
27641
|
}
|
|
27610
27642
|
);
|
|
27611
|
-
return typeof document !== "undefined" ? reactDom.createPortal(panel,
|
|
27643
|
+
return typeof document !== "undefined" ? reactDom.createPortal(panel, getOrCreatePortalRoot()) : panel;
|
|
27612
27644
|
}
|
|
27613
27645
|
function MenuItemRow({
|
|
27614
27646
|
item,
|
|
@@ -27695,6 +27727,7 @@ var init_Menu = __esm({
|
|
|
27695
27727
|
init_Typography();
|
|
27696
27728
|
init_Badge();
|
|
27697
27729
|
init_cn();
|
|
27730
|
+
init_portalRoot();
|
|
27698
27731
|
init_useEventBus();
|
|
27699
27732
|
MENU_GAP = 4;
|
|
27700
27733
|
menuContainerStyles = cn(
|
|
@@ -27831,7 +27864,7 @@ var init_Menu = __esm({
|
|
|
27831
27864
|
) : null;
|
|
27832
27865
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
27833
27866
|
triggerElement,
|
|
27834
|
-
panel && typeof document !== "undefined" ? reactDom.createPortal(panel,
|
|
27867
|
+
panel && typeof document !== "undefined" ? reactDom.createPortal(panel, getOrCreatePortalRoot()) : panel
|
|
27835
27868
|
] });
|
|
27836
27869
|
};
|
|
27837
27870
|
Menu.displayName = "Menu";
|
|
@@ -31045,6 +31078,7 @@ var init_Popover = __esm({
|
|
|
31045
31078
|
init_Typography();
|
|
31046
31079
|
init_Presence();
|
|
31047
31080
|
init_cn();
|
|
31081
|
+
init_portalRoot();
|
|
31048
31082
|
init_useTapReveal();
|
|
31049
31083
|
arrowClasses = {
|
|
31050
31084
|
top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
|
|
@@ -31204,7 +31238,7 @@ var init_Popover = __esm({
|
|
|
31204
31238
|
) : null;
|
|
31205
31239
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
31206
31240
|
triggerElement,
|
|
31207
|
-
panel && typeof document !== "undefined" ? reactDom.createPortal(panel,
|
|
31241
|
+
panel && typeof document !== "undefined" ? reactDom.createPortal(panel, getOrCreatePortalRoot()) : panel
|
|
31208
31242
|
] });
|
|
31209
31243
|
};
|
|
31210
31244
|
Popover.displayName = "Popover";
|
|
@@ -31710,6 +31744,7 @@ var init_Tooltip = __esm({
|
|
|
31710
31744
|
"use client";
|
|
31711
31745
|
init_Typography();
|
|
31712
31746
|
init_cn();
|
|
31747
|
+
init_portalRoot();
|
|
31713
31748
|
init_useTapReveal();
|
|
31714
31749
|
TRIGGER_GAP2 = 8;
|
|
31715
31750
|
arrowClasses2 = {
|
|
@@ -31815,7 +31850,7 @@ var init_Tooltip = __esm({
|
|
|
31815
31850
|
) : null;
|
|
31816
31851
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
31817
31852
|
trigger,
|
|
31818
|
-
typeof window !== "undefined" && tooltipContent ? reactDom.createPortal(tooltipContent,
|
|
31853
|
+
typeof window !== "undefined" && tooltipContent ? reactDom.createPortal(tooltipContent, getOrCreatePortalRoot()) : tooltipContent
|
|
31819
31854
|
] });
|
|
31820
31855
|
};
|
|
31821
31856
|
Tooltip.displayName = "Tooltip";
|
|
@@ -43097,6 +43132,7 @@ var init_GraphCanvas = __esm({
|
|
|
43097
43132
|
"components/core/molecules/GraphCanvas.tsx"() {
|
|
43098
43133
|
"use client";
|
|
43099
43134
|
init_cn();
|
|
43135
|
+
init_portalRoot();
|
|
43100
43136
|
init_atoms();
|
|
43101
43137
|
init_Stack();
|
|
43102
43138
|
init_LoadingState();
|
|
@@ -43808,7 +43844,7 @@ var init_GraphCanvas = __esm({
|
|
|
43808
43844
|
children: hoveredObj?.label
|
|
43809
43845
|
}
|
|
43810
43846
|
),
|
|
43811
|
-
|
|
43847
|
+
getOrCreatePortalRoot()
|
|
43812
43848
|
)
|
|
43813
43849
|
] }),
|
|
43814
43850
|
groups.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "md", className: "px-4 py-2 border-t border-border", wrap: true, children: groups.map((group, idx) => /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
@@ -44969,6 +45005,7 @@ var init_DetailPanel = __esm({
|
|
|
44969
45005
|
init_ErrorState();
|
|
44970
45006
|
init_EmptyState();
|
|
44971
45007
|
init_cn();
|
|
45008
|
+
init_portalRoot();
|
|
44972
45009
|
init_format();
|
|
44973
45010
|
init_getNestedValue();
|
|
44974
45011
|
init_relationLabel();
|
|
@@ -45388,7 +45425,7 @@ var init_DetailPanel = __esm({
|
|
|
45388
45425
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className, children: content });
|
|
45389
45426
|
}
|
|
45390
45427
|
const panel = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("fixed inset-y-0 right-0 w-full max-w-2xl bg-card shadow-lg z-50 overflow-y-auto p-6", className), children: content });
|
|
45391
|
-
return typeof document === "undefined" ? panel : reactDom.createPortal(panel,
|
|
45428
|
+
return typeof document === "undefined" ? panel : reactDom.createPortal(panel, getOrCreatePortalRoot());
|
|
45392
45429
|
};
|
|
45393
45430
|
DetailPanel.displayName = "DetailPanel";
|
|
45394
45431
|
}
|
|
@@ -52298,24 +52335,6 @@ function UISlotComponentInner({
|
|
|
52298
52335
|
}
|
|
52299
52336
|
);
|
|
52300
52337
|
}
|
|
52301
|
-
function getOrCreatePortalRoot() {
|
|
52302
|
-
let root = document.getElementById("ui-slot-portal-root");
|
|
52303
|
-
if (!root) {
|
|
52304
|
-
root = document.createElement("div");
|
|
52305
|
-
root.id = "ui-slot-portal-root";
|
|
52306
|
-
root.style.position = "relative";
|
|
52307
|
-
root.style.zIndex = "9999";
|
|
52308
|
-
document.body.appendChild(root);
|
|
52309
|
-
}
|
|
52310
|
-
const themed = document.querySelector('[data-theme*="-"]') ?? document.querySelector("[data-theme]");
|
|
52311
|
-
if (themed) {
|
|
52312
|
-
const theme = themed.getAttribute("data-theme");
|
|
52313
|
-
if (theme && root.getAttribute("data-theme") !== theme) {
|
|
52314
|
-
root.setAttribute("data-theme", theme);
|
|
52315
|
-
}
|
|
52316
|
-
}
|
|
52317
|
-
return root;
|
|
52318
|
-
}
|
|
52319
52338
|
function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
52320
52339
|
const [portalRoot, setPortalRoot] = React87.useState(null);
|
|
52321
52340
|
const slotsBus = context.useUISlots();
|
|
@@ -52938,6 +52957,7 @@ var init_UISlotRenderer = __esm({
|
|
|
52938
52957
|
init_slot_types();
|
|
52939
52958
|
init_cn();
|
|
52940
52959
|
init_format();
|
|
52960
|
+
init_portalRoot();
|
|
52941
52961
|
init_ErrorBoundary();
|
|
52942
52962
|
init_Skeleton();
|
|
52943
52963
|
init_renderer();
|
|
@@ -54756,7 +54776,7 @@ function NavStackRefBridge({ apiRef }) {
|
|
|
54756
54776
|
}, [api, apiRef]);
|
|
54757
54777
|
return null;
|
|
54758
54778
|
}
|
|
54759
|
-
function TraitInitializer({ traits: traits2, routeParams, orbitalNames, onNavigate, onNavigateBack, onLocalFallback, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits, callsiteCaptureChildrenByTrait, serverActiveTraits, children }) {
|
|
54779
|
+
function TraitInitializer({ traits: traits2, routeParams, orbitalNames, onNavigate, onNavigateBack, onLocalFallback, localFallbackTimeoutMs, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits, callsiteCaptureChildrenByTrait, serverActiveTraits, children }) {
|
|
54760
54780
|
const bridge = providers.useServerBridge();
|
|
54761
54781
|
const activeTraitNames = React87.useMemo(
|
|
54762
54782
|
() => new Set(traits2.map((b) => b.trait.name).filter((n) => !!n)),
|
|
@@ -54823,9 +54843,9 @@ function TraitInitializer({ traits: traits2, routeParams, orbitalNames, onNaviga
|
|
|
54823
54843
|
sendEvent("INIT", routeParams);
|
|
54824
54844
|
onLocalFallback?.();
|
|
54825
54845
|
}
|
|
54826
|
-
}, 5e3);
|
|
54846
|
+
}, localFallbackTimeoutMs ?? 5e3);
|
|
54827
54847
|
return () => clearTimeout(fallback);
|
|
54828
|
-
}, [traits2, orbitalNames, sendEvent, onLocalFallback, routeParams]);
|
|
54848
|
+
}, [traits2, orbitalNames, sendEvent, onLocalFallback, localFallbackTimeoutMs, routeParams]);
|
|
54829
54849
|
React87.useEffect(() => {
|
|
54830
54850
|
if (!bridge.connected || !orbitalNames?.length || initSentRef.current) return;
|
|
54831
54851
|
initSentRef.current = true;
|
|
@@ -54879,7 +54899,7 @@ function FitToBox({ children }) {
|
|
|
54879
54899
|
}, []);
|
|
54880
54900
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: outerRef, className: "relative h-full w-full overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: innerRef, style: { transform: `scale(${scale})`, transformOrigin: "top left", width: "fit-content" }, children }) });
|
|
54881
54901
|
}
|
|
54882
|
-
function SchemaRunner({ schema, serverUrl, transport, getAccessToken, mockData, pageName, routeParams, onNavigate, onNavigateBack, onLocalFallback, persistence }) {
|
|
54902
|
+
function SchemaRunner({ schema, serverUrl, transport, getAccessToken, mockData, pageName, routeParams, onNavigate, onNavigateBack, onLocalFallback, localFallbackTimeoutMs, persistence }) {
|
|
54883
54903
|
const { traits: traits2, allEntities, allTraits, ir } = useResolvedSchema(schema, pageName);
|
|
54884
54904
|
const allPageTraits = React87.useMemo(() => {
|
|
54885
54905
|
let base;
|
|
@@ -55042,6 +55062,7 @@ function SchemaRunner({ schema, serverUrl, transport, getAccessToken, mockData,
|
|
|
55042
55062
|
onNavigate,
|
|
55043
55063
|
onNavigateBack,
|
|
55044
55064
|
onLocalFallback,
|
|
55065
|
+
localFallbackTimeoutMs,
|
|
55045
55066
|
persistence,
|
|
55046
55067
|
children: /* @__PURE__ */ jsxRuntime.jsx(providers.OrbitalThemeProvider, { theme: activeOrbitalTheme, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "h-full min-h-full overflow-auto p-4", children: /* @__PURE__ */ jsxRuntime.jsx(UISlotRenderer, { includeHud: true, hudMode: "inline", includeFloating: true }) }) })
|
|
55047
55068
|
}
|
|
@@ -55065,7 +55086,8 @@ function OrbPreview({
|
|
|
55065
55086
|
initialPagePath,
|
|
55066
55087
|
isolated = false,
|
|
55067
55088
|
fit = false,
|
|
55068
|
-
user = null
|
|
55089
|
+
user = null,
|
|
55090
|
+
localFallbackTimeoutMs
|
|
55069
55091
|
}) {
|
|
55070
55092
|
if (serverUrl && transport) {
|
|
55071
55093
|
throw new Error("OrbPreview accepts serverUrl OR transport, not both");
|
|
@@ -55247,6 +55269,7 @@ function OrbPreview({
|
|
|
55247
55269
|
onNavigate: handleNavigateEffect,
|
|
55248
55270
|
onNavigateBack: handleNavigateBack,
|
|
55249
55271
|
onLocalFallback: handleLocalFallback,
|
|
55272
|
+
localFallbackTimeoutMs,
|
|
55250
55273
|
persistence
|
|
55251
55274
|
}
|
|
55252
55275
|
) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -55262,6 +55285,7 @@ function OrbPreview({
|
|
|
55262
55285
|
onNavigate: handleNavigateEffect,
|
|
55263
55286
|
onNavigateBack: handleNavigateBack,
|
|
55264
55287
|
onLocalFallback: handleLocalFallback,
|
|
55288
|
+
localFallbackTimeoutMs,
|
|
55265
55289
|
persistence
|
|
55266
55290
|
}
|
|
55267
55291
|
) }) })
|
package/dist/runtime/index.d.cts
CHANGED
|
@@ -292,6 +292,15 @@ interface OrbPreviewProps {
|
|
|
292
292
|
transport?: ServerBridgeTransport;
|
|
293
293
|
/** Bearer token for `serverUrl` requests (see `ServerBridgeProviderProps.getAccessToken`). */
|
|
294
294
|
getAccessToken?: AccessTokenProvider;
|
|
295
|
+
/**
|
|
296
|
+
* How long (ms) to wait for the server bridge to connect before assuming
|
|
297
|
+
* it's unreachable and falling back to local-only execution. Default
|
|
298
|
+
* 5000 (unchanged unless you pass this). Widen it for a caller whose
|
|
299
|
+
* schema is large enough that the server's first `register()` genuinely
|
|
300
|
+
* takes longer than 5s (e.g. a 53-orbital organism measured ~14.5s in
|
|
301
|
+
* production) — see `TraitInitializer`'s `localFallbackTimeoutMs` doc.
|
|
302
|
+
*/
|
|
303
|
+
localFallbackTimeoutMs?: number;
|
|
295
304
|
/**
|
|
296
305
|
* Initial page path to render (e.g. `/deals`). Resolves against the
|
|
297
306
|
* schema's `pages[]` to seed `currentPage` so the right orbital's traits
|
|
@@ -333,7 +342,7 @@ interface OrbPreviewProps {
|
|
|
333
342
|
* <OrbPreview schema={schema} serverUrl="/api/orbitals" />
|
|
334
343
|
* ```
|
|
335
344
|
*/
|
|
336
|
-
declare function OrbPreview({ schema, mockData, autoMock, height, className, serverUrl, transport, getAccessToken, initialPagePath, isolated, fit, user, }: OrbPreviewProps): React__default.ReactElement;
|
|
345
|
+
declare function OrbPreview({ schema, mockData, autoMock, height, className, serverUrl, transport, getAccessToken, initialPagePath, isolated, fit, user, localFallbackTimeoutMs, }: OrbPreviewProps): React__default.ReactElement;
|
|
337
346
|
declare namespace OrbPreview {
|
|
338
347
|
var displayName: string;
|
|
339
348
|
}
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -292,6 +292,15 @@ interface OrbPreviewProps {
|
|
|
292
292
|
transport?: ServerBridgeTransport;
|
|
293
293
|
/** Bearer token for `serverUrl` requests (see `ServerBridgeProviderProps.getAccessToken`). */
|
|
294
294
|
getAccessToken?: AccessTokenProvider;
|
|
295
|
+
/**
|
|
296
|
+
* How long (ms) to wait for the server bridge to connect before assuming
|
|
297
|
+
* it's unreachable and falling back to local-only execution. Default
|
|
298
|
+
* 5000 (unchanged unless you pass this). Widen it for a caller whose
|
|
299
|
+
* schema is large enough that the server's first `register()` genuinely
|
|
300
|
+
* takes longer than 5s (e.g. a 53-orbital organism measured ~14.5s in
|
|
301
|
+
* production) — see `TraitInitializer`'s `localFallbackTimeoutMs` doc.
|
|
302
|
+
*/
|
|
303
|
+
localFallbackTimeoutMs?: number;
|
|
295
304
|
/**
|
|
296
305
|
* Initial page path to render (e.g. `/deals`). Resolves against the
|
|
297
306
|
* schema's `pages[]` to seed `currentPage` so the right orbital's traits
|
|
@@ -333,7 +342,7 @@ interface OrbPreviewProps {
|
|
|
333
342
|
* <OrbPreview schema={schema} serverUrl="/api/orbitals" />
|
|
334
343
|
* ```
|
|
335
344
|
*/
|
|
336
|
-
declare function OrbPreview({ schema, mockData, autoMock, height, className, serverUrl, transport, getAccessToken, initialPagePath, isolated, fit, user, }: OrbPreviewProps): React__default.ReactElement;
|
|
345
|
+
declare function OrbPreview({ schema, mockData, autoMock, height, className, serverUrl, transport, getAccessToken, initialPagePath, isolated, fit, user, localFallbackTimeoutMs, }: OrbPreviewProps): React__default.ReactElement;
|
|
337
346
|
declare namespace OrbPreview {
|
|
338
347
|
var displayName: string;
|
|
339
348
|
}
|