@almadar/ui 5.15.0 → 5.16.2
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 +191 -58
- package/dist/avl/index.js +192 -59
- package/dist/components/index.cjs +37 -17
- package/dist/components/index.js +37 -17
- package/dist/providers/EventBusProvider.d.ts +10 -1
- package/dist/providers/OrbitalProvider.d.ts +7 -1
- package/dist/providers/index.cjs +43 -21
- package/dist/providers/index.js +43 -21
- package/dist/runtime/OrbPreview.d.ts +8 -1
- package/dist/runtime/index.cjs +42 -20
- package/dist/runtime/index.js +42 -20
- package/package.json +2 -2
|
@@ -32,6 +32,15 @@ interface EventBusProviderProps {
|
|
|
32
32
|
* from `@almadar/logger` to control verbosity. Kept for API compatibility.
|
|
33
33
|
*/
|
|
34
34
|
debug?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* When true, this provider does NOT register itself as the global event bus
|
|
37
|
+
* (`window.__kflowEventBus`). Use for SANDBOXED subtrees — e.g. a studio
|
|
38
|
+
* preview (`BrowserPlayground`) embedded inside a host app — whose internal
|
|
39
|
+
* events must stay context-local and must NOT clobber the host's global bus.
|
|
40
|
+
* Children still get this bus via React context; only the global bridge is
|
|
41
|
+
* skipped. Default false (root/standalone providers own the global bridge).
|
|
42
|
+
*/
|
|
43
|
+
isolated?: boolean;
|
|
35
44
|
}
|
|
36
|
-
export declare function EventBusProvider({ children }: EventBusProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare function EventBusProvider({ children, isolated }: EventBusProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
37
46
|
export type { EventBusContextType };
|
|
@@ -46,6 +46,12 @@ export interface OrbitalProviderProps {
|
|
|
46
46
|
* Default: true in development, false in production.
|
|
47
47
|
*/
|
|
48
48
|
verification?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Sandbox mode: the event bus stays context-local and does NOT register as
|
|
51
|
+
* the global bus. Set for studio previews embedded in a host app (so the
|
|
52
|
+
* preview's events don't clobber the host's global bus). Default false.
|
|
53
|
+
*/
|
|
54
|
+
isolated?: boolean;
|
|
49
55
|
}
|
|
50
56
|
/**
|
|
51
57
|
* OrbitalProvider - Unified context provider for Orbital applications
|
|
@@ -94,7 +100,7 @@ export interface OrbitalProviderProps {
|
|
|
94
100
|
* }
|
|
95
101
|
* ```
|
|
96
102
|
*/
|
|
97
|
-
export declare function OrbitalProvider({ children, themes, defaultTheme, defaultMode, targetRef, skipTheme, debug, initialData, suspense, verification, }: OrbitalProviderProps): React.ReactElement;
|
|
103
|
+
export declare function OrbitalProvider({ children, themes, defaultTheme, defaultMode, targetRef, skipTheme, debug, initialData, suspense, verification, isolated, }: OrbitalProviderProps): React.ReactElement;
|
|
98
104
|
export declare namespace OrbitalProvider {
|
|
99
105
|
var displayName: string;
|
|
100
106
|
}
|
package/dist/providers/index.cjs
CHANGED
|
@@ -10247,13 +10247,13 @@ var init_MapView = __esm({
|
|
|
10247
10247
|
shadowSize: [41, 41]
|
|
10248
10248
|
});
|
|
10249
10249
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
10250
|
-
const { useEffect:
|
|
10250
|
+
const { useEffect: useEffect70, useRef: useRef66, useCallback: useCallback114, useState: useState100 } = React86__namespace.default;
|
|
10251
10251
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
10252
10252
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
10253
10253
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
10254
10254
|
const map = useMap();
|
|
10255
|
-
const prevRef =
|
|
10256
|
-
|
|
10255
|
+
const prevRef = useRef66({ centerLat, centerLng, zoom });
|
|
10256
|
+
useEffect70(() => {
|
|
10257
10257
|
const prev = prevRef.current;
|
|
10258
10258
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
10259
10259
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -10264,7 +10264,7 @@ var init_MapView = __esm({
|
|
|
10264
10264
|
}
|
|
10265
10265
|
function MapClickHandler({ onMapClick }) {
|
|
10266
10266
|
const map = useMap();
|
|
10267
|
-
|
|
10267
|
+
useEffect70(() => {
|
|
10268
10268
|
if (!onMapClick) return;
|
|
10269
10269
|
const handler = (e) => {
|
|
10270
10270
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -22566,6 +22566,21 @@ var init_DashboardLayout = __esm({
|
|
|
22566
22566
|
};
|
|
22567
22567
|
const [sidebarOpen, setSidebarOpen] = React86.useState(false);
|
|
22568
22568
|
const [userMenuOpen, setUserMenuOpen] = React86.useState(false);
|
|
22569
|
+
const layoutRef = React86.useRef(null);
|
|
22570
|
+
const [isMobile, setIsMobile] = React86.useState(false);
|
|
22571
|
+
React86.useEffect(() => {
|
|
22572
|
+
const el = layoutRef.current;
|
|
22573
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
22574
|
+
const ro = new ResizeObserver((entries) => {
|
|
22575
|
+
const w = entries[0]?.contentRect.width ?? el.clientWidth;
|
|
22576
|
+
setIsMobile(w < 1024);
|
|
22577
|
+
});
|
|
22578
|
+
ro.observe(el);
|
|
22579
|
+
return () => ro.disconnect();
|
|
22580
|
+
}, []);
|
|
22581
|
+
React86.useEffect(() => {
|
|
22582
|
+
if (!isMobile && sidebarOpen) setSidebarOpen(false);
|
|
22583
|
+
}, [isMobile, sidebarOpen]);
|
|
22569
22584
|
const location = reactRouterDom.useLocation();
|
|
22570
22585
|
const ctxPagePath = useCurrentPagePath();
|
|
22571
22586
|
const activePath = currentPath ?? ctxPagePath ?? location.pathname;
|
|
@@ -22578,15 +22593,15 @@ var init_DashboardLayout = __esm({
|
|
|
22578
22593
|
const showBottomNav = layoutMode === "bottomnav";
|
|
22579
22594
|
const isTopNav = layoutMode === "topnav";
|
|
22580
22595
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
22581
|
-
|
|
22596
|
+
Box,
|
|
22582
22597
|
{
|
|
22583
|
-
|
|
22584
|
-
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
22598
|
+
ref: layoutRef,
|
|
22599
|
+
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background flex flex-row items-stretch",
|
|
22585
22600
|
children: [
|
|
22586
|
-
showSidebar && sidebarOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22601
|
+
showSidebar && isMobile && sidebarOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22587
22602
|
Box,
|
|
22588
22603
|
{
|
|
22589
|
-
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20
|
|
22604
|
+
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20",
|
|
22590
22605
|
onClick: () => setSidebarOpen(false)
|
|
22591
22606
|
}
|
|
22592
22607
|
),
|
|
@@ -22596,11 +22611,16 @@ var init_DashboardLayout = __esm({
|
|
|
22596
22611
|
as: "aside",
|
|
22597
22612
|
className: cn(
|
|
22598
22613
|
"z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
|
|
22599
|
-
"
|
|
22600
|
-
"transform transition-transform duration-200 ease-in-out",
|
|
22601
|
-
"flex flex-col",
|
|
22602
|
-
sidebarOpen ? "translate-x-0" : "-translate-x-full"
|
|
22614
|
+
"flex flex-col"
|
|
22603
22615
|
),
|
|
22616
|
+
style: isMobile ? {
|
|
22617
|
+
position: "fixed",
|
|
22618
|
+
top: 0,
|
|
22619
|
+
bottom: 0,
|
|
22620
|
+
left: 0,
|
|
22621
|
+
transform: sidebarOpen ? "translateX(0)" : "translateX(-100%)",
|
|
22622
|
+
transition: "transform 200ms ease-in-out"
|
|
22623
|
+
} : { position: "static", transform: "none" },
|
|
22604
22624
|
children: [
|
|
22605
22625
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
22606
22626
|
HStack,
|
|
@@ -22629,11 +22649,11 @@ var init_DashboardLayout = __esm({
|
|
|
22629
22649
|
}
|
|
22630
22650
|
)
|
|
22631
22651
|
] }),
|
|
22632
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22652
|
+
isMobile && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22633
22653
|
Button,
|
|
22634
22654
|
{
|
|
22635
22655
|
variant: "ghost",
|
|
22636
|
-
className: "
|
|
22656
|
+
className: "p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
22637
22657
|
onClick: () => setSidebarOpen(false),
|
|
22638
22658
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "x", className: "h-5 w-5" })
|
|
22639
22659
|
}
|
|
@@ -22674,11 +22694,11 @@ var init_DashboardLayout = __esm({
|
|
|
22674
22694
|
justify: "between",
|
|
22675
22695
|
className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
|
|
22676
22696
|
children: [
|
|
22677
|
-
showSidebar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22697
|
+
showSidebar && isMobile && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22678
22698
|
Button,
|
|
22679
22699
|
{
|
|
22680
22700
|
variant: "ghost",
|
|
22681
|
-
className: "
|
|
22701
|
+
className: "p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
|
|
22682
22702
|
onClick: () => setSidebarOpen(true),
|
|
22683
22703
|
"aria-label": "Open sidebar",
|
|
22684
22704
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "menu", className: "h-5 w-5" })
|
|
@@ -48057,7 +48077,7 @@ function captureSubscriberTag(listener) {
|
|
|
48057
48077
|
}
|
|
48058
48078
|
return "unknown";
|
|
48059
48079
|
}
|
|
48060
|
-
function EventBusProvider({ children }) {
|
|
48080
|
+
function EventBusProvider({ children, isolated = false }) {
|
|
48061
48081
|
const listenersRef = React86.useRef(/* @__PURE__ */ new Map());
|
|
48062
48082
|
const anyListenersRef = React86.useRef(/* @__PURE__ */ new Set());
|
|
48063
48083
|
const deprecationWarningShown = React86.useRef(false);
|
|
@@ -48173,11 +48193,12 @@ function EventBusProvider({ children }) {
|
|
|
48173
48193
|
[emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
|
|
48174
48194
|
);
|
|
48175
48195
|
React86.useEffect(() => {
|
|
48196
|
+
if (isolated) return;
|
|
48176
48197
|
setGlobalEventBus(contextValue);
|
|
48177
48198
|
return () => {
|
|
48178
48199
|
setGlobalEventBus(null);
|
|
48179
48200
|
};
|
|
48180
|
-
}, [contextValue]);
|
|
48201
|
+
}, [contextValue, isolated]);
|
|
48181
48202
|
return /* @__PURE__ */ jsxRuntime.jsx(EventBusContext2.Provider, { value: contextValue, children });
|
|
48182
48203
|
}
|
|
48183
48204
|
|
|
@@ -48477,13 +48498,14 @@ function OrbitalProvider({
|
|
|
48477
48498
|
debug: debug2 = false,
|
|
48478
48499
|
initialData,
|
|
48479
48500
|
suspense = false,
|
|
48480
|
-
verification
|
|
48501
|
+
verification,
|
|
48502
|
+
isolated = false
|
|
48481
48503
|
}) {
|
|
48482
48504
|
const suspenseConfig = React86.useMemo(
|
|
48483
48505
|
() => ({ enabled: suspense }),
|
|
48484
48506
|
[suspense]
|
|
48485
48507
|
);
|
|
48486
|
-
const inner = /* @__PURE__ */ jsxRuntime.jsx(EventBusProvider, { debug: debug2, children: /* @__PURE__ */ jsxRuntime.jsx(VerificationProvider, { enabled: verification, children: /* @__PURE__ */ jsxRuntime.jsx(SelectionProvider, { debug: debug2, children: /* @__PURE__ */ jsxRuntime.jsx(SuspenseConfigProvider, { config: suspenseConfig, children }) }) }) });
|
|
48508
|
+
const inner = /* @__PURE__ */ jsxRuntime.jsx(EventBusProvider, { debug: debug2, isolated, children: /* @__PURE__ */ jsxRuntime.jsx(VerificationProvider, { enabled: verification, children: /* @__PURE__ */ jsxRuntime.jsx(SelectionProvider, { debug: debug2, children: /* @__PURE__ */ jsxRuntime.jsx(SuspenseConfigProvider, { config: suspenseConfig, children }) }) }) });
|
|
48487
48509
|
if (skipTheme) {
|
|
48488
48510
|
return inner;
|
|
48489
48511
|
}
|
package/dist/providers/index.js
CHANGED
|
@@ -10198,13 +10198,13 @@ var init_MapView = __esm({
|
|
|
10198
10198
|
shadowSize: [41, 41]
|
|
10199
10199
|
});
|
|
10200
10200
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
10201
|
-
const { useEffect:
|
|
10201
|
+
const { useEffect: useEffect70, useRef: useRef66, useCallback: useCallback114, useState: useState100 } = React86__default;
|
|
10202
10202
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
10203
10203
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
10204
10204
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
10205
10205
|
const map = useMap();
|
|
10206
|
-
const prevRef =
|
|
10207
|
-
|
|
10206
|
+
const prevRef = useRef66({ centerLat, centerLng, zoom });
|
|
10207
|
+
useEffect70(() => {
|
|
10208
10208
|
const prev = prevRef.current;
|
|
10209
10209
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
10210
10210
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -10215,7 +10215,7 @@ var init_MapView = __esm({
|
|
|
10215
10215
|
}
|
|
10216
10216
|
function MapClickHandler({ onMapClick }) {
|
|
10217
10217
|
const map = useMap();
|
|
10218
|
-
|
|
10218
|
+
useEffect70(() => {
|
|
10219
10219
|
if (!onMapClick) return;
|
|
10220
10220
|
const handler = (e) => {
|
|
10221
10221
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -22517,6 +22517,21 @@ var init_DashboardLayout = __esm({
|
|
|
22517
22517
|
};
|
|
22518
22518
|
const [sidebarOpen, setSidebarOpen] = useState(false);
|
|
22519
22519
|
const [userMenuOpen, setUserMenuOpen] = useState(false);
|
|
22520
|
+
const layoutRef = useRef(null);
|
|
22521
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
22522
|
+
useEffect(() => {
|
|
22523
|
+
const el = layoutRef.current;
|
|
22524
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
22525
|
+
const ro = new ResizeObserver((entries) => {
|
|
22526
|
+
const w = entries[0]?.contentRect.width ?? el.clientWidth;
|
|
22527
|
+
setIsMobile(w < 1024);
|
|
22528
|
+
});
|
|
22529
|
+
ro.observe(el);
|
|
22530
|
+
return () => ro.disconnect();
|
|
22531
|
+
}, []);
|
|
22532
|
+
useEffect(() => {
|
|
22533
|
+
if (!isMobile && sidebarOpen) setSidebarOpen(false);
|
|
22534
|
+
}, [isMobile, sidebarOpen]);
|
|
22520
22535
|
const location = useLocation();
|
|
22521
22536
|
const ctxPagePath = useCurrentPagePath();
|
|
22522
22537
|
const activePath = currentPath ?? ctxPagePath ?? location.pathname;
|
|
@@ -22529,15 +22544,15 @@ var init_DashboardLayout = __esm({
|
|
|
22529
22544
|
const showBottomNav = layoutMode === "bottomnav";
|
|
22530
22545
|
const isTopNav = layoutMode === "topnav";
|
|
22531
22546
|
return /* @__PURE__ */ jsxs(
|
|
22532
|
-
|
|
22547
|
+
Box,
|
|
22533
22548
|
{
|
|
22534
|
-
|
|
22535
|
-
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
22549
|
+
ref: layoutRef,
|
|
22550
|
+
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background flex flex-row items-stretch",
|
|
22536
22551
|
children: [
|
|
22537
|
-
showSidebar && sidebarOpen && /* @__PURE__ */ jsx(
|
|
22552
|
+
showSidebar && isMobile && sidebarOpen && /* @__PURE__ */ jsx(
|
|
22538
22553
|
Box,
|
|
22539
22554
|
{
|
|
22540
|
-
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20
|
|
22555
|
+
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20",
|
|
22541
22556
|
onClick: () => setSidebarOpen(false)
|
|
22542
22557
|
}
|
|
22543
22558
|
),
|
|
@@ -22547,11 +22562,16 @@ var init_DashboardLayout = __esm({
|
|
|
22547
22562
|
as: "aside",
|
|
22548
22563
|
className: cn(
|
|
22549
22564
|
"z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
|
|
22550
|
-
"
|
|
22551
|
-
"transform transition-transform duration-200 ease-in-out",
|
|
22552
|
-
"flex flex-col",
|
|
22553
|
-
sidebarOpen ? "translate-x-0" : "-translate-x-full"
|
|
22565
|
+
"flex flex-col"
|
|
22554
22566
|
),
|
|
22567
|
+
style: isMobile ? {
|
|
22568
|
+
position: "fixed",
|
|
22569
|
+
top: 0,
|
|
22570
|
+
bottom: 0,
|
|
22571
|
+
left: 0,
|
|
22572
|
+
transform: sidebarOpen ? "translateX(0)" : "translateX(-100%)",
|
|
22573
|
+
transition: "transform 200ms ease-in-out"
|
|
22574
|
+
} : { position: "static", transform: "none" },
|
|
22555
22575
|
children: [
|
|
22556
22576
|
/* @__PURE__ */ jsxs(
|
|
22557
22577
|
HStack,
|
|
@@ -22580,11 +22600,11 @@ var init_DashboardLayout = __esm({
|
|
|
22580
22600
|
}
|
|
22581
22601
|
)
|
|
22582
22602
|
] }),
|
|
22583
|
-
/* @__PURE__ */ jsx(
|
|
22603
|
+
isMobile && /* @__PURE__ */ jsx(
|
|
22584
22604
|
Button,
|
|
22585
22605
|
{
|
|
22586
22606
|
variant: "ghost",
|
|
22587
|
-
className: "
|
|
22607
|
+
className: "p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
22588
22608
|
onClick: () => setSidebarOpen(false),
|
|
22589
22609
|
children: /* @__PURE__ */ jsx(Icon, { name: "x", className: "h-5 w-5" })
|
|
22590
22610
|
}
|
|
@@ -22625,11 +22645,11 @@ var init_DashboardLayout = __esm({
|
|
|
22625
22645
|
justify: "between",
|
|
22626
22646
|
className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
|
|
22627
22647
|
children: [
|
|
22628
|
-
showSidebar && /* @__PURE__ */ jsx(
|
|
22648
|
+
showSidebar && isMobile && /* @__PURE__ */ jsx(
|
|
22629
22649
|
Button,
|
|
22630
22650
|
{
|
|
22631
22651
|
variant: "ghost",
|
|
22632
|
-
className: "
|
|
22652
|
+
className: "p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
|
|
22633
22653
|
onClick: () => setSidebarOpen(true),
|
|
22634
22654
|
"aria-label": "Open sidebar",
|
|
22635
22655
|
children: /* @__PURE__ */ jsx(Icon, { name: "menu", className: "h-5 w-5" })
|
|
@@ -48008,7 +48028,7 @@ function captureSubscriberTag(listener) {
|
|
|
48008
48028
|
}
|
|
48009
48029
|
return "unknown";
|
|
48010
48030
|
}
|
|
48011
|
-
function EventBusProvider({ children }) {
|
|
48031
|
+
function EventBusProvider({ children, isolated = false }) {
|
|
48012
48032
|
const listenersRef = useRef(/* @__PURE__ */ new Map());
|
|
48013
48033
|
const anyListenersRef = useRef(/* @__PURE__ */ new Set());
|
|
48014
48034
|
const deprecationWarningShown = useRef(false);
|
|
@@ -48124,11 +48144,12 @@ function EventBusProvider({ children }) {
|
|
|
48124
48144
|
[emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
|
|
48125
48145
|
);
|
|
48126
48146
|
useEffect(() => {
|
|
48147
|
+
if (isolated) return;
|
|
48127
48148
|
setGlobalEventBus(contextValue);
|
|
48128
48149
|
return () => {
|
|
48129
48150
|
setGlobalEventBus(null);
|
|
48130
48151
|
};
|
|
48131
|
-
}, [contextValue]);
|
|
48152
|
+
}, [contextValue, isolated]);
|
|
48132
48153
|
return /* @__PURE__ */ jsx(EventBusContext2.Provider, { value: contextValue, children });
|
|
48133
48154
|
}
|
|
48134
48155
|
|
|
@@ -48428,13 +48449,14 @@ function OrbitalProvider({
|
|
|
48428
48449
|
debug: debug2 = false,
|
|
48429
48450
|
initialData,
|
|
48430
48451
|
suspense = false,
|
|
48431
|
-
verification
|
|
48452
|
+
verification,
|
|
48453
|
+
isolated = false
|
|
48432
48454
|
}) {
|
|
48433
48455
|
const suspenseConfig = useMemo(
|
|
48434
48456
|
() => ({ enabled: suspense }),
|
|
48435
48457
|
[suspense]
|
|
48436
48458
|
);
|
|
48437
|
-
const inner = /* @__PURE__ */ jsx(EventBusProvider, { debug: debug2, children: /* @__PURE__ */ jsx(VerificationProvider, { enabled: verification, children: /* @__PURE__ */ jsx(SelectionProvider, { debug: debug2, children: /* @__PURE__ */ jsx(SuspenseConfigProvider, { config: suspenseConfig, children }) }) }) });
|
|
48459
|
+
const inner = /* @__PURE__ */ jsx(EventBusProvider, { debug: debug2, isolated, children: /* @__PURE__ */ jsx(VerificationProvider, { enabled: verification, children: /* @__PURE__ */ jsx(SelectionProvider, { debug: debug2, children: /* @__PURE__ */ jsx(SuspenseConfigProvider, { config: suspenseConfig, children }) }) }) });
|
|
48438
48460
|
if (skipTheme) {
|
|
48439
48461
|
return inner;
|
|
48440
48462
|
}
|
|
@@ -57,6 +57,13 @@ export interface OrbPreviewProps {
|
|
|
57
57
|
* to walk DealCreate, NoteCompose, etc. on their owning pages.
|
|
58
58
|
*/
|
|
59
59
|
initialPagePath?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Sandbox mode: the preview's event bus stays context-local and does NOT
|
|
62
|
+
* register as the global bus. Set when embedded inside a host app (e.g. the
|
|
63
|
+
* studio canvas) so preview events don't clobber the host's global bus.
|
|
64
|
+
* Default false (standalone previews own the global bridge).
|
|
65
|
+
*/
|
|
66
|
+
isolated?: boolean;
|
|
60
67
|
}
|
|
61
68
|
/**
|
|
62
69
|
* Renders a live preview of an Orbital schema.
|
|
@@ -71,7 +78,7 @@ export interface OrbPreviewProps {
|
|
|
71
78
|
* <OrbPreview schema={schema} serverUrl="/api/orbitals" />
|
|
72
79
|
* ```
|
|
73
80
|
*/
|
|
74
|
-
export declare function OrbPreview({ schema, mockData, autoMock, height, className, serverUrl, transport, initialPagePath, }: OrbPreviewProps): React.ReactElement;
|
|
81
|
+
export declare function OrbPreview({ schema, mockData, autoMock, height, className, serverUrl, transport, initialPagePath, isolated, }: OrbPreviewProps): React.ReactElement;
|
|
75
82
|
export declare namespace OrbPreview {
|
|
76
83
|
var displayName: string;
|
|
77
84
|
}
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -10135,13 +10135,13 @@ var init_MapView = __esm({
|
|
|
10135
10135
|
shadowSize: [41, 41]
|
|
10136
10136
|
});
|
|
10137
10137
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
10138
|
-
const { useEffect:
|
|
10138
|
+
const { useEffect: useEffect71, useRef: useRef66, useCallback: useCallback114, useState: useState103 } = React85__namespace.default;
|
|
10139
10139
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
10140
10140
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
10141
10141
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
10142
10142
|
const map = useMap();
|
|
10143
|
-
const prevRef =
|
|
10144
|
-
|
|
10143
|
+
const prevRef = useRef66({ centerLat, centerLng, zoom });
|
|
10144
|
+
useEffect71(() => {
|
|
10145
10145
|
const prev = prevRef.current;
|
|
10146
10146
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
10147
10147
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -10152,7 +10152,7 @@ var init_MapView = __esm({
|
|
|
10152
10152
|
}
|
|
10153
10153
|
function MapClickHandler({ onMapClick }) {
|
|
10154
10154
|
const map = useMap();
|
|
10155
|
-
|
|
10155
|
+
useEffect71(() => {
|
|
10156
10156
|
if (!onMapClick) return;
|
|
10157
10157
|
const handler = (e) => {
|
|
10158
10158
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -22335,6 +22335,21 @@ var init_DashboardLayout = __esm({
|
|
|
22335
22335
|
};
|
|
22336
22336
|
const [sidebarOpen, setSidebarOpen] = React85.useState(false);
|
|
22337
22337
|
const [userMenuOpen, setUserMenuOpen] = React85.useState(false);
|
|
22338
|
+
const layoutRef = React85.useRef(null);
|
|
22339
|
+
const [isMobile, setIsMobile] = React85.useState(false);
|
|
22340
|
+
React85.useEffect(() => {
|
|
22341
|
+
const el = layoutRef.current;
|
|
22342
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
22343
|
+
const ro = new ResizeObserver((entries) => {
|
|
22344
|
+
const w = entries[0]?.contentRect.width ?? el.clientWidth;
|
|
22345
|
+
setIsMobile(w < 1024);
|
|
22346
|
+
});
|
|
22347
|
+
ro.observe(el);
|
|
22348
|
+
return () => ro.disconnect();
|
|
22349
|
+
}, []);
|
|
22350
|
+
React85.useEffect(() => {
|
|
22351
|
+
if (!isMobile && sidebarOpen) setSidebarOpen(false);
|
|
22352
|
+
}, [isMobile, sidebarOpen]);
|
|
22338
22353
|
const location = reactRouterDom.useLocation();
|
|
22339
22354
|
const ctxPagePath = useCurrentPagePath();
|
|
22340
22355
|
const activePath = currentPath ?? ctxPagePath ?? location.pathname;
|
|
@@ -22347,15 +22362,15 @@ var init_DashboardLayout = __esm({
|
|
|
22347
22362
|
const showBottomNav = layoutMode === "bottomnav";
|
|
22348
22363
|
const isTopNav = layoutMode === "topnav";
|
|
22349
22364
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
22350
|
-
|
|
22365
|
+
Box,
|
|
22351
22366
|
{
|
|
22352
|
-
|
|
22353
|
-
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
22367
|
+
ref: layoutRef,
|
|
22368
|
+
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background flex flex-row items-stretch",
|
|
22354
22369
|
children: [
|
|
22355
|
-
showSidebar && sidebarOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22370
|
+
showSidebar && isMobile && sidebarOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22356
22371
|
Box,
|
|
22357
22372
|
{
|
|
22358
|
-
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20
|
|
22373
|
+
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20",
|
|
22359
22374
|
onClick: () => setSidebarOpen(false)
|
|
22360
22375
|
}
|
|
22361
22376
|
),
|
|
@@ -22365,11 +22380,16 @@ var init_DashboardLayout = __esm({
|
|
|
22365
22380
|
as: "aside",
|
|
22366
22381
|
className: cn(
|
|
22367
22382
|
"z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
|
|
22368
|
-
"
|
|
22369
|
-
"transform transition-transform duration-200 ease-in-out",
|
|
22370
|
-
"flex flex-col",
|
|
22371
|
-
sidebarOpen ? "translate-x-0" : "-translate-x-full"
|
|
22383
|
+
"flex flex-col"
|
|
22372
22384
|
),
|
|
22385
|
+
style: isMobile ? {
|
|
22386
|
+
position: "fixed",
|
|
22387
|
+
top: 0,
|
|
22388
|
+
bottom: 0,
|
|
22389
|
+
left: 0,
|
|
22390
|
+
transform: sidebarOpen ? "translateX(0)" : "translateX(-100%)",
|
|
22391
|
+
transition: "transform 200ms ease-in-out"
|
|
22392
|
+
} : { position: "static", transform: "none" },
|
|
22373
22393
|
children: [
|
|
22374
22394
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
22375
22395
|
HStack,
|
|
@@ -22398,11 +22418,11 @@ var init_DashboardLayout = __esm({
|
|
|
22398
22418
|
}
|
|
22399
22419
|
)
|
|
22400
22420
|
] }),
|
|
22401
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22421
|
+
isMobile && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22402
22422
|
Button,
|
|
22403
22423
|
{
|
|
22404
22424
|
variant: "ghost",
|
|
22405
|
-
className: "
|
|
22425
|
+
className: "p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
22406
22426
|
onClick: () => setSidebarOpen(false),
|
|
22407
22427
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "x", className: "h-5 w-5" })
|
|
22408
22428
|
}
|
|
@@ -22443,11 +22463,11 @@ var init_DashboardLayout = __esm({
|
|
|
22443
22463
|
justify: "between",
|
|
22444
22464
|
className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
|
|
22445
22465
|
children: [
|
|
22446
|
-
showSidebar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22466
|
+
showSidebar && isMobile && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22447
22467
|
Button,
|
|
22448
22468
|
{
|
|
22449
22469
|
variant: "ghost",
|
|
22450
|
-
className: "
|
|
22470
|
+
className: "p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
|
|
22451
22471
|
onClick: () => setSidebarOpen(true),
|
|
22452
22472
|
"aria-label": "Open sidebar",
|
|
22453
22473
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "menu", className: "h-5 w-5" })
|
|
@@ -49716,7 +49736,8 @@ function OrbPreview({
|
|
|
49716
49736
|
className,
|
|
49717
49737
|
serverUrl,
|
|
49718
49738
|
transport,
|
|
49719
|
-
initialPagePath
|
|
49739
|
+
initialPagePath,
|
|
49740
|
+
isolated = false
|
|
49720
49741
|
}) {
|
|
49721
49742
|
if (serverUrl && transport) {
|
|
49722
49743
|
throw new Error("OrbPreview accepts serverUrl OR transport, not both");
|
|
@@ -49838,7 +49859,7 @@ function OrbPreview({
|
|
|
49838
49859
|
style: { height },
|
|
49839
49860
|
children: [
|
|
49840
49861
|
localFallback && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "px-3 py-2 bg-[var(--color-warning)] bg-opacity-10 border-b border-[var(--color-warning)] flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-[var(--color-warning-foreground)] flex-1", children: "Preview server unreachable \u2014 running locally. Server-side state and persistence are disabled." }) }),
|
|
49841
|
-
/* @__PURE__ */ jsxRuntime.jsx(providers.OrbitalProvider, { initialData: effectiveMockData, skipTheme: true, verification: true, children: /* @__PURE__ */ jsxRuntime.jsx(context.UISlotProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
49862
|
+
/* @__PURE__ */ jsxRuntime.jsx(providers.OrbitalProvider, { initialData: effectiveMockData, skipTheme: true, verification: true, isolated, children: /* @__PURE__ */ jsxRuntime.jsx(context.UISlotProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
49842
49863
|
SchemaRunner,
|
|
49843
49864
|
{
|
|
49844
49865
|
schema: parsedSchema,
|
|
@@ -49911,7 +49932,8 @@ function BrowserPlayground({
|
|
|
49911
49932
|
transport,
|
|
49912
49933
|
initialPagePath,
|
|
49913
49934
|
height,
|
|
49914
|
-
className
|
|
49935
|
+
className,
|
|
49936
|
+
isolated: true
|
|
49915
49937
|
}
|
|
49916
49938
|
);
|
|
49917
49939
|
}
|