@almadar/ui 5.16.1 → 5.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +25 -13
- package/dist/avl/index.js +26 -14
- package/dist/components/organisms/Chart.d.ts +10 -2
- package/dist/providers/EventBusProvider.d.ts +10 -1
- package/dist/providers/OrbitalProvider.d.ts +7 -1
- package/dist/providers/index.cjs +6 -4
- package/dist/providers/index.js +6 -4
- package/dist/runtime/OrbPreview.d.ts +8 -1
- package/dist/runtime/index.cjs +5 -3
- package/dist/runtime/index.js +5 -3
- package/package.json +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -3357,7 +3357,7 @@ function captureSubscriberTag(listener) {
|
|
|
3357
3357
|
}
|
|
3358
3358
|
return "unknown";
|
|
3359
3359
|
}
|
|
3360
|
-
function EventBusProvider({ children }) {
|
|
3360
|
+
function EventBusProvider({ children, isolated = false }) {
|
|
3361
3361
|
const listenersRef = React98.useRef(/* @__PURE__ */ new Map());
|
|
3362
3362
|
const anyListenersRef = React98.useRef(/* @__PURE__ */ new Set());
|
|
3363
3363
|
const deprecationWarningShown = React98.useRef(false);
|
|
@@ -3473,11 +3473,12 @@ function EventBusProvider({ children }) {
|
|
|
3473
3473
|
[emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
|
|
3474
3474
|
);
|
|
3475
3475
|
React98.useEffect(() => {
|
|
3476
|
+
if (isolated) return;
|
|
3476
3477
|
setGlobalEventBus(contextValue);
|
|
3477
3478
|
return () => {
|
|
3478
3479
|
setGlobalEventBus(null);
|
|
3479
3480
|
};
|
|
3480
|
-
}, [contextValue]);
|
|
3481
|
+
}, [contextValue, isolated]);
|
|
3481
3482
|
return /* @__PURE__ */ jsxRuntime.jsx(EventBusContext.Provider, { value: contextValue, children });
|
|
3482
3483
|
}
|
|
3483
3484
|
var busLog, subLog, EventBusContext, listenerTags;
|
|
@@ -60048,13 +60049,14 @@ function OrbitalProvider({
|
|
|
60048
60049
|
debug: debug2 = false,
|
|
60049
60050
|
initialData,
|
|
60050
60051
|
suspense = false,
|
|
60051
|
-
verification
|
|
60052
|
+
verification,
|
|
60053
|
+
isolated = false
|
|
60052
60054
|
}) {
|
|
60053
60055
|
const suspenseConfig = React98.useMemo(
|
|
60054
60056
|
() => ({ enabled: suspense }),
|
|
60055
60057
|
[suspense]
|
|
60056
60058
|
);
|
|
60057
|
-
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 }) }) }) });
|
|
60059
|
+
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 }) }) }) });
|
|
60058
60060
|
if (skipTheme) {
|
|
60059
60061
|
return inner;
|
|
60060
60062
|
}
|
|
@@ -62061,7 +62063,8 @@ function OrbPreview({
|
|
|
62061
62063
|
className,
|
|
62062
62064
|
serverUrl,
|
|
62063
62065
|
transport,
|
|
62064
|
-
initialPagePath
|
|
62066
|
+
initialPagePath,
|
|
62067
|
+
isolated = false
|
|
62065
62068
|
}) {
|
|
62066
62069
|
if (serverUrl && transport) {
|
|
62067
62070
|
throw new Error("OrbPreview accepts serverUrl OR transport, not both");
|
|
@@ -62183,7 +62186,7 @@ function OrbPreview({
|
|
|
62183
62186
|
style: { height },
|
|
62184
62187
|
children: [
|
|
62185
62188
|
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." }) }),
|
|
62186
|
-
/* @__PURE__ */ jsxRuntime.jsx(OrbitalProvider, { initialData: effectiveMockData, skipTheme: true, verification: true, children: /* @__PURE__ */ jsxRuntime.jsx(UISlotProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
62189
|
+
/* @__PURE__ */ jsxRuntime.jsx(OrbitalProvider, { initialData: effectiveMockData, skipTheme: true, verification: true, isolated, children: /* @__PURE__ */ jsxRuntime.jsx(UISlotProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
62187
62190
|
SchemaRunner,
|
|
62188
62191
|
{
|
|
62189
62192
|
schema: parsedSchema,
|
|
@@ -62256,7 +62259,8 @@ function BrowserPlayground({
|
|
|
62256
62259
|
transport,
|
|
62257
62260
|
initialPagePath,
|
|
62258
62261
|
height,
|
|
62259
|
-
className
|
|
62262
|
+
className,
|
|
62263
|
+
isolated: true
|
|
62260
62264
|
}
|
|
62261
62265
|
);
|
|
62262
62266
|
}
|
|
@@ -62710,11 +62714,17 @@ function absUnion(el) {
|
|
|
62710
62714
|
}
|
|
62711
62715
|
return r2;
|
|
62712
62716
|
}
|
|
62713
|
-
function rectRelativeTo(el, container) {
|
|
62717
|
+
function rectRelativeTo(el, container, zoom) {
|
|
62714
62718
|
const u = absUnion(el);
|
|
62715
62719
|
if (!u) return null;
|
|
62716
62720
|
const base = container.getBoundingClientRect();
|
|
62717
|
-
|
|
62721
|
+
const z = zoom > 0 ? zoom : 1;
|
|
62722
|
+
return {
|
|
62723
|
+
top: (u.top - base.top) / z,
|
|
62724
|
+
left: (u.left - base.left) / z,
|
|
62725
|
+
width: (u.right - u.left) / z,
|
|
62726
|
+
height: (u.bottom - u.top) / z
|
|
62727
|
+
};
|
|
62718
62728
|
}
|
|
62719
62729
|
function buildFocus(el, orbitalName) {
|
|
62720
62730
|
if (!orbitalName) return null;
|
|
@@ -62745,6 +62755,7 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
62745
62755
|
const preset = SCREEN_SIZE_PRESETS[screenSize];
|
|
62746
62756
|
const { select } = React98.useContext(PatternSelectionContext);
|
|
62747
62757
|
const eventBus = useEventBus();
|
|
62758
|
+
const reactFlow = react.useReactFlow();
|
|
62748
62759
|
const contentRef = React98.useRef(null);
|
|
62749
62760
|
const [hovered, setHovered] = React98.useState(false);
|
|
62750
62761
|
const handleMouseEnter = React98.useCallback(() => setHovered(true), []);
|
|
@@ -62788,9 +62799,10 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
62788
62799
|
container?.querySelectorAll(".pattern-selected").forEach((el) => {
|
|
62789
62800
|
el.classList.remove("pattern-selected");
|
|
62790
62801
|
});
|
|
62802
|
+
const zoom = reactFlow.getViewport().zoom;
|
|
62791
62803
|
if (patternEl && container) {
|
|
62792
62804
|
patternEl.classList.add("pattern-selected");
|
|
62793
|
-
const rect = rectRelativeTo(patternEl, container);
|
|
62805
|
+
const rect = rectRelativeTo(patternEl, container, zoom);
|
|
62794
62806
|
setSelectedRect(rect);
|
|
62795
62807
|
select({
|
|
62796
62808
|
patternType: patternEl.getAttribute("data-pattern") ?? "unknown",
|
|
@@ -62811,15 +62823,15 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
62811
62823
|
select(null);
|
|
62812
62824
|
eventBus.emit("UI:ELEMENT_SELECTED", { focus: null });
|
|
62813
62825
|
}
|
|
62814
|
-
}, [data, select, eventBus]);
|
|
62826
|
+
}, [data, select, eventBus, reactFlow]);
|
|
62815
62827
|
const handleContentMouseMove = React98.useCallback((e) => {
|
|
62816
62828
|
const container = contentRef.current;
|
|
62817
62829
|
if (!container) return;
|
|
62818
62830
|
const el = e.target.closest("[data-pattern]");
|
|
62819
62831
|
if (el === lastHoverElRef.current) return;
|
|
62820
62832
|
lastHoverElRef.current = el;
|
|
62821
|
-
setHoverRect(el ? rectRelativeTo(el, container) : null);
|
|
62822
|
-
}, []);
|
|
62833
|
+
setHoverRect(el ? rectRelativeTo(el, container, reactFlow.getViewport().zoom) : null);
|
|
62834
|
+
}, [reactFlow]);
|
|
62823
62835
|
const handleContentMouseLeave = React98.useCallback(() => {
|
|
62824
62836
|
lastHoverElRef.current = null;
|
|
62825
62837
|
setHoverRect(null);
|
package/dist/avl/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import * as React98 from 'react';
|
|
|
4
4
|
import React98__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
|
|
5
5
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
6
6
|
import ELK from 'elkjs/lib/elk.bundled.js';
|
|
7
|
-
import { MarkerType, Handle, Position, getBezierPath, EdgeLabelRenderer, BaseEdge, ReactFlowProvider, useNodesState, useEdgesState,
|
|
7
|
+
import { MarkerType, useReactFlow, Handle, Position, getBezierPath, EdgeLabelRenderer, BaseEdge, ReactFlowProvider, useNodesState, useEdgesState, ReactFlow, Controls, Background, BackgroundVariant } from '@xyflow/react';
|
|
8
8
|
import * as LucideIcons2 from 'lucide-react';
|
|
9
9
|
import { Loader2, X, List, Printer, ChevronRight, ChevronLeft, GitBranch, Pencil, Eye, Plus, ArrowRight, Trash, Code, FileText, WrapText, Check, Copy, AlertTriangle, Trash2, ZoomOut, ZoomIn, Download, RotateCcw, Menu as Menu$1, Package, Calendar, MoreHorizontal, Image as Image$1, Upload, ArrowLeft, HelpCircle, Search, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, Minus, Eraser, TrendingUp, TrendingDown, ArrowUp, ArrowDown, MoreVertical, AlertCircle, Circle, Clock, CheckCircle2, CheckCircle, XCircle, Play, Pause, SkipForward, Bug, Send, ChevronUp, ChevronDown, Wrench, Tag, User, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
|
|
10
10
|
import * as PhosphorIcons from '@phosphor-icons/react';
|
|
@@ -3308,7 +3308,7 @@ function captureSubscriberTag(listener) {
|
|
|
3308
3308
|
}
|
|
3309
3309
|
return "unknown";
|
|
3310
3310
|
}
|
|
3311
|
-
function EventBusProvider({ children }) {
|
|
3311
|
+
function EventBusProvider({ children, isolated = false }) {
|
|
3312
3312
|
const listenersRef = useRef(/* @__PURE__ */ new Map());
|
|
3313
3313
|
const anyListenersRef = useRef(/* @__PURE__ */ new Set());
|
|
3314
3314
|
const deprecationWarningShown = useRef(false);
|
|
@@ -3424,11 +3424,12 @@ function EventBusProvider({ children }) {
|
|
|
3424
3424
|
[emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
|
|
3425
3425
|
);
|
|
3426
3426
|
useEffect(() => {
|
|
3427
|
+
if (isolated) return;
|
|
3427
3428
|
setGlobalEventBus(contextValue);
|
|
3428
3429
|
return () => {
|
|
3429
3430
|
setGlobalEventBus(null);
|
|
3430
3431
|
};
|
|
3431
|
-
}, [contextValue]);
|
|
3432
|
+
}, [contextValue, isolated]);
|
|
3432
3433
|
return /* @__PURE__ */ jsx(EventBusContext.Provider, { value: contextValue, children });
|
|
3433
3434
|
}
|
|
3434
3435
|
var busLog, subLog, EventBusContext, listenerTags;
|
|
@@ -59999,13 +60000,14 @@ function OrbitalProvider({
|
|
|
59999
60000
|
debug: debug2 = false,
|
|
60000
60001
|
initialData,
|
|
60001
60002
|
suspense = false,
|
|
60002
|
-
verification
|
|
60003
|
+
verification,
|
|
60004
|
+
isolated = false
|
|
60003
60005
|
}) {
|
|
60004
60006
|
const suspenseConfig = useMemo(
|
|
60005
60007
|
() => ({ enabled: suspense }),
|
|
60006
60008
|
[suspense]
|
|
60007
60009
|
);
|
|
60008
|
-
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 }) }) }) });
|
|
60010
|
+
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 }) }) }) });
|
|
60009
60011
|
if (skipTheme) {
|
|
60010
60012
|
return inner;
|
|
60011
60013
|
}
|
|
@@ -62012,7 +62014,8 @@ function OrbPreview({
|
|
|
62012
62014
|
className,
|
|
62013
62015
|
serverUrl,
|
|
62014
62016
|
transport,
|
|
62015
|
-
initialPagePath
|
|
62017
|
+
initialPagePath,
|
|
62018
|
+
isolated = false
|
|
62016
62019
|
}) {
|
|
62017
62020
|
if (serverUrl && transport) {
|
|
62018
62021
|
throw new Error("OrbPreview accepts serverUrl OR transport, not both");
|
|
@@ -62134,7 +62137,7 @@ function OrbPreview({
|
|
|
62134
62137
|
style: { height },
|
|
62135
62138
|
children: [
|
|
62136
62139
|
localFallback && /* @__PURE__ */ 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__ */ 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." }) }),
|
|
62137
|
-
/* @__PURE__ */ jsx(OrbitalProvider, { initialData: effectiveMockData, skipTheme: true, verification: true, children: /* @__PURE__ */ jsx(UISlotProvider, { children: /* @__PURE__ */ jsx(
|
|
62140
|
+
/* @__PURE__ */ jsx(OrbitalProvider, { initialData: effectiveMockData, skipTheme: true, verification: true, isolated, children: /* @__PURE__ */ jsx(UISlotProvider, { children: /* @__PURE__ */ jsx(
|
|
62138
62141
|
SchemaRunner,
|
|
62139
62142
|
{
|
|
62140
62143
|
schema: parsedSchema,
|
|
@@ -62207,7 +62210,8 @@ function BrowserPlayground({
|
|
|
62207
62210
|
transport,
|
|
62208
62211
|
initialPagePath,
|
|
62209
62212
|
height,
|
|
62210
|
-
className
|
|
62213
|
+
className,
|
|
62214
|
+
isolated: true
|
|
62211
62215
|
}
|
|
62212
62216
|
);
|
|
62213
62217
|
}
|
|
@@ -62661,11 +62665,17 @@ function absUnion(el) {
|
|
|
62661
62665
|
}
|
|
62662
62666
|
return r2;
|
|
62663
62667
|
}
|
|
62664
|
-
function rectRelativeTo(el, container) {
|
|
62668
|
+
function rectRelativeTo(el, container, zoom) {
|
|
62665
62669
|
const u = absUnion(el);
|
|
62666
62670
|
if (!u) return null;
|
|
62667
62671
|
const base = container.getBoundingClientRect();
|
|
62668
|
-
|
|
62672
|
+
const z = zoom > 0 ? zoom : 1;
|
|
62673
|
+
return {
|
|
62674
|
+
top: (u.top - base.top) / z,
|
|
62675
|
+
left: (u.left - base.left) / z,
|
|
62676
|
+
width: (u.right - u.left) / z,
|
|
62677
|
+
height: (u.bottom - u.top) / z
|
|
62678
|
+
};
|
|
62669
62679
|
}
|
|
62670
62680
|
function buildFocus(el, orbitalName) {
|
|
62671
62681
|
if (!orbitalName) return null;
|
|
@@ -62696,6 +62706,7 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
62696
62706
|
const preset = SCREEN_SIZE_PRESETS[screenSize];
|
|
62697
62707
|
const { select } = useContext(PatternSelectionContext);
|
|
62698
62708
|
const eventBus = useEventBus();
|
|
62709
|
+
const reactFlow = useReactFlow();
|
|
62699
62710
|
const contentRef = useRef(null);
|
|
62700
62711
|
const [hovered, setHovered] = useState(false);
|
|
62701
62712
|
const handleMouseEnter = useCallback(() => setHovered(true), []);
|
|
@@ -62739,9 +62750,10 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
62739
62750
|
container?.querySelectorAll(".pattern-selected").forEach((el) => {
|
|
62740
62751
|
el.classList.remove("pattern-selected");
|
|
62741
62752
|
});
|
|
62753
|
+
const zoom = reactFlow.getViewport().zoom;
|
|
62742
62754
|
if (patternEl && container) {
|
|
62743
62755
|
patternEl.classList.add("pattern-selected");
|
|
62744
|
-
const rect = rectRelativeTo(patternEl, container);
|
|
62756
|
+
const rect = rectRelativeTo(patternEl, container, zoom);
|
|
62745
62757
|
setSelectedRect(rect);
|
|
62746
62758
|
select({
|
|
62747
62759
|
patternType: patternEl.getAttribute("data-pattern") ?? "unknown",
|
|
@@ -62762,15 +62774,15 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
62762
62774
|
select(null);
|
|
62763
62775
|
eventBus.emit("UI:ELEMENT_SELECTED", { focus: null });
|
|
62764
62776
|
}
|
|
62765
|
-
}, [data, select, eventBus]);
|
|
62777
|
+
}, [data, select, eventBus, reactFlow]);
|
|
62766
62778
|
const handleContentMouseMove = useCallback((e) => {
|
|
62767
62779
|
const container = contentRef.current;
|
|
62768
62780
|
if (!container) return;
|
|
62769
62781
|
const el = e.target.closest("[data-pattern]");
|
|
62770
62782
|
if (el === lastHoverElRef.current) return;
|
|
62771
62783
|
lastHoverElRef.current = el;
|
|
62772
|
-
setHoverRect(el ? rectRelativeTo(el, container) : null);
|
|
62773
|
-
}, []);
|
|
62784
|
+
setHoverRect(el ? rectRelativeTo(el, container, reactFlow.getViewport().zoom) : null);
|
|
62785
|
+
}, [reactFlow]);
|
|
62774
62786
|
const handleContentMouseLeave = useCallback(() => {
|
|
62775
62787
|
lastHoverElRef.current = null;
|
|
62776
62788
|
setHoverRect(null);
|
|
@@ -63,9 +63,17 @@ export interface ChartProps {
|
|
|
63
63
|
title?: string;
|
|
64
64
|
/** Chart subtitle / description */
|
|
65
65
|
subtitle?: string;
|
|
66
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Chart type (legacy alias for `look`).
|
|
68
|
+
* @synonyms chart style, graph type, bar chart, line chart, pie chart, area chart, donut chart, scatter plot, histogram
|
|
69
|
+
* @tier domain
|
|
70
|
+
*/
|
|
67
71
|
chartType?: ChartType;
|
|
68
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Layer 2 visual treatment — drives the chart sub-renderer (bar / line / pie / etc.).
|
|
74
|
+
* @synonyms chart style, render style, visual treatment
|
|
75
|
+
* @tier presentation
|
|
76
|
+
*/
|
|
69
77
|
look?: ChartLook;
|
|
70
78
|
/** Multi-series data */
|
|
71
79
|
series?: readonly ChartSeries[];
|
|
@@ -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
|
@@ -48077,7 +48077,7 @@ function captureSubscriberTag(listener) {
|
|
|
48077
48077
|
}
|
|
48078
48078
|
return "unknown";
|
|
48079
48079
|
}
|
|
48080
|
-
function EventBusProvider({ children }) {
|
|
48080
|
+
function EventBusProvider({ children, isolated = false }) {
|
|
48081
48081
|
const listenersRef = React86.useRef(/* @__PURE__ */ new Map());
|
|
48082
48082
|
const anyListenersRef = React86.useRef(/* @__PURE__ */ new Set());
|
|
48083
48083
|
const deprecationWarningShown = React86.useRef(false);
|
|
@@ -48193,11 +48193,12 @@ function EventBusProvider({ children }) {
|
|
|
48193
48193
|
[emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
|
|
48194
48194
|
);
|
|
48195
48195
|
React86.useEffect(() => {
|
|
48196
|
+
if (isolated) return;
|
|
48196
48197
|
setGlobalEventBus(contextValue);
|
|
48197
48198
|
return () => {
|
|
48198
48199
|
setGlobalEventBus(null);
|
|
48199
48200
|
};
|
|
48200
|
-
}, [contextValue]);
|
|
48201
|
+
}, [contextValue, isolated]);
|
|
48201
48202
|
return /* @__PURE__ */ jsxRuntime.jsx(EventBusContext2.Provider, { value: contextValue, children });
|
|
48202
48203
|
}
|
|
48203
48204
|
|
|
@@ -48497,13 +48498,14 @@ function OrbitalProvider({
|
|
|
48497
48498
|
debug: debug2 = false,
|
|
48498
48499
|
initialData,
|
|
48499
48500
|
suspense = false,
|
|
48500
|
-
verification
|
|
48501
|
+
verification,
|
|
48502
|
+
isolated = false
|
|
48501
48503
|
}) {
|
|
48502
48504
|
const suspenseConfig = React86.useMemo(
|
|
48503
48505
|
() => ({ enabled: suspense }),
|
|
48504
48506
|
[suspense]
|
|
48505
48507
|
);
|
|
48506
|
-
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 }) }) }) });
|
|
48507
48509
|
if (skipTheme) {
|
|
48508
48510
|
return inner;
|
|
48509
48511
|
}
|
package/dist/providers/index.js
CHANGED
|
@@ -48028,7 +48028,7 @@ function captureSubscriberTag(listener) {
|
|
|
48028
48028
|
}
|
|
48029
48029
|
return "unknown";
|
|
48030
48030
|
}
|
|
48031
|
-
function EventBusProvider({ children }) {
|
|
48031
|
+
function EventBusProvider({ children, isolated = false }) {
|
|
48032
48032
|
const listenersRef = useRef(/* @__PURE__ */ new Map());
|
|
48033
48033
|
const anyListenersRef = useRef(/* @__PURE__ */ new Set());
|
|
48034
48034
|
const deprecationWarningShown = useRef(false);
|
|
@@ -48144,11 +48144,12 @@ function EventBusProvider({ children }) {
|
|
|
48144
48144
|
[emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
|
|
48145
48145
|
);
|
|
48146
48146
|
useEffect(() => {
|
|
48147
|
+
if (isolated) return;
|
|
48147
48148
|
setGlobalEventBus(contextValue);
|
|
48148
48149
|
return () => {
|
|
48149
48150
|
setGlobalEventBus(null);
|
|
48150
48151
|
};
|
|
48151
|
-
}, [contextValue]);
|
|
48152
|
+
}, [contextValue, isolated]);
|
|
48152
48153
|
return /* @__PURE__ */ jsx(EventBusContext2.Provider, { value: contextValue, children });
|
|
48153
48154
|
}
|
|
48154
48155
|
|
|
@@ -48448,13 +48449,14 @@ function OrbitalProvider({
|
|
|
48448
48449
|
debug: debug2 = false,
|
|
48449
48450
|
initialData,
|
|
48450
48451
|
suspense = false,
|
|
48451
|
-
verification
|
|
48452
|
+
verification,
|
|
48453
|
+
isolated = false
|
|
48452
48454
|
}) {
|
|
48453
48455
|
const suspenseConfig = useMemo(
|
|
48454
48456
|
() => ({ enabled: suspense }),
|
|
48455
48457
|
[suspense]
|
|
48456
48458
|
);
|
|
48457
|
-
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 }) }) }) });
|
|
48458
48460
|
if (skipTheme) {
|
|
48459
48461
|
return inner;
|
|
48460
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
|
@@ -49736,7 +49736,8 @@ function OrbPreview({
|
|
|
49736
49736
|
className,
|
|
49737
49737
|
serverUrl,
|
|
49738
49738
|
transport,
|
|
49739
|
-
initialPagePath
|
|
49739
|
+
initialPagePath,
|
|
49740
|
+
isolated = false
|
|
49740
49741
|
}) {
|
|
49741
49742
|
if (serverUrl && transport) {
|
|
49742
49743
|
throw new Error("OrbPreview accepts serverUrl OR transport, not both");
|
|
@@ -49858,7 +49859,7 @@ function OrbPreview({
|
|
|
49858
49859
|
style: { height },
|
|
49859
49860
|
children: [
|
|
49860
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." }) }),
|
|
49861
|
-
/* @__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(
|
|
49862
49863
|
SchemaRunner,
|
|
49863
49864
|
{
|
|
49864
49865
|
schema: parsedSchema,
|
|
@@ -49931,7 +49932,8 @@ function BrowserPlayground({
|
|
|
49931
49932
|
transport,
|
|
49932
49933
|
initialPagePath,
|
|
49933
49934
|
height,
|
|
49934
|
-
className
|
|
49935
|
+
className,
|
|
49936
|
+
isolated: true
|
|
49935
49937
|
}
|
|
49936
49938
|
);
|
|
49937
49939
|
}
|
package/dist/runtime/index.js
CHANGED
|
@@ -49687,7 +49687,8 @@ function OrbPreview({
|
|
|
49687
49687
|
className,
|
|
49688
49688
|
serverUrl,
|
|
49689
49689
|
transport,
|
|
49690
|
-
initialPagePath
|
|
49690
|
+
initialPagePath,
|
|
49691
|
+
isolated = false
|
|
49691
49692
|
}) {
|
|
49692
49693
|
if (serverUrl && transport) {
|
|
49693
49694
|
throw new Error("OrbPreview accepts serverUrl OR transport, not both");
|
|
@@ -49809,7 +49810,7 @@ function OrbPreview({
|
|
|
49809
49810
|
style: { height },
|
|
49810
49811
|
children: [
|
|
49811
49812
|
localFallback && /* @__PURE__ */ 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__ */ 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." }) }),
|
|
49812
|
-
/* @__PURE__ */ jsx(OrbitalProvider, { initialData: effectiveMockData, skipTheme: true, verification: true, children: /* @__PURE__ */ jsx(UISlotProvider, { children: /* @__PURE__ */ jsx(
|
|
49813
|
+
/* @__PURE__ */ jsx(OrbitalProvider, { initialData: effectiveMockData, skipTheme: true, verification: true, isolated, children: /* @__PURE__ */ jsx(UISlotProvider, { children: /* @__PURE__ */ jsx(
|
|
49813
49814
|
SchemaRunner,
|
|
49814
49815
|
{
|
|
49815
49816
|
schema: parsedSchema,
|
|
@@ -49882,7 +49883,8 @@ function BrowserPlayground({
|
|
|
49882
49883
|
transport,
|
|
49883
49884
|
initialPagePath,
|
|
49884
49885
|
height,
|
|
49885
|
-
className
|
|
49886
|
+
className,
|
|
49887
|
+
isolated: true
|
|
49886
49888
|
}
|
|
49887
49889
|
);
|
|
49888
49890
|
}
|