@almadar/ui 5.14.1 → 5.16.1
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 +222 -61
- package/dist/avl/index.js +222 -61
- package/dist/components/index.cjs +68 -22
- package/dist/components/index.js +68 -22
- package/dist/context/index.cjs +5 -1
- package/dist/context/index.js +5 -1
- package/dist/hooks/index.cjs +5 -1
- package/dist/hooks/index.js +5 -1
- package/dist/hooks/useUISlots.d.ts +14 -0
- package/dist/providers/index.cjs +63 -21
- package/dist/providers/index.js +63 -21
- package/dist/runtime/index.cjs +82 -26
- package/dist/runtime/index.js +82 -26
- package/package.json +2 -2
|
@@ -8679,13 +8679,13 @@ var init_MapView = __esm({
|
|
|
8679
8679
|
shadowSize: [41, 41]
|
|
8680
8680
|
});
|
|
8681
8681
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
8682
|
-
const { useEffect:
|
|
8682
|
+
const { useEffect: useEffect74, useRef: useRef68, useCallback: useCallback129, useState: useState112 } = React80__namespace.default;
|
|
8683
8683
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
8684
8684
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
8685
8685
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
8686
8686
|
const map = useMap();
|
|
8687
|
-
const prevRef =
|
|
8688
|
-
|
|
8687
|
+
const prevRef = useRef68({ centerLat, centerLng, zoom });
|
|
8688
|
+
useEffect74(() => {
|
|
8689
8689
|
const prev = prevRef.current;
|
|
8690
8690
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
8691
8691
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -8696,7 +8696,7 @@ var init_MapView = __esm({
|
|
|
8696
8696
|
}
|
|
8697
8697
|
function MapClickHandler({ onMapClick }) {
|
|
8698
8698
|
const map = useMap();
|
|
8699
|
-
|
|
8699
|
+
useEffect74(() => {
|
|
8700
8700
|
if (!onMapClick) return;
|
|
8701
8701
|
const handler = (e) => {
|
|
8702
8702
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -21317,6 +21317,21 @@ var init_DashboardLayout = __esm({
|
|
|
21317
21317
|
};
|
|
21318
21318
|
const [sidebarOpen, setSidebarOpen] = React80.useState(false);
|
|
21319
21319
|
const [userMenuOpen, setUserMenuOpen] = React80.useState(false);
|
|
21320
|
+
const layoutRef = React80.useRef(null);
|
|
21321
|
+
const [isMobile, setIsMobile] = React80.useState(false);
|
|
21322
|
+
React80.useEffect(() => {
|
|
21323
|
+
const el = layoutRef.current;
|
|
21324
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
21325
|
+
const ro = new ResizeObserver((entries) => {
|
|
21326
|
+
const w = entries[0]?.contentRect.width ?? el.clientWidth;
|
|
21327
|
+
setIsMobile(w < 1024);
|
|
21328
|
+
});
|
|
21329
|
+
ro.observe(el);
|
|
21330
|
+
return () => ro.disconnect();
|
|
21331
|
+
}, []);
|
|
21332
|
+
React80.useEffect(() => {
|
|
21333
|
+
if (!isMobile && sidebarOpen) setSidebarOpen(false);
|
|
21334
|
+
}, [isMobile, sidebarOpen]);
|
|
21320
21335
|
const location = reactRouterDom.useLocation();
|
|
21321
21336
|
const ctxPagePath = useCurrentPagePath();
|
|
21322
21337
|
const activePath = currentPath ?? ctxPagePath ?? location.pathname;
|
|
@@ -21333,15 +21348,15 @@ var init_DashboardLayout = __esm({
|
|
|
21333
21348
|
const showBottomNav = layoutMode === "bottomnav";
|
|
21334
21349
|
const isTopNav = layoutMode === "topnav";
|
|
21335
21350
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21336
|
-
exports.
|
|
21351
|
+
exports.Box,
|
|
21337
21352
|
{
|
|
21338
|
-
|
|
21339
|
-
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
21353
|
+
ref: layoutRef,
|
|
21354
|
+
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background flex flex-row items-stretch",
|
|
21340
21355
|
children: [
|
|
21341
|
-
showSidebar && sidebarOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21356
|
+
showSidebar && isMobile && sidebarOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21342
21357
|
exports.Box,
|
|
21343
21358
|
{
|
|
21344
|
-
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20
|
|
21359
|
+
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20",
|
|
21345
21360
|
onClick: () => setSidebarOpen(false)
|
|
21346
21361
|
}
|
|
21347
21362
|
),
|
|
@@ -21351,11 +21366,16 @@ var init_DashboardLayout = __esm({
|
|
|
21351
21366
|
as: "aside",
|
|
21352
21367
|
className: cn(
|
|
21353
21368
|
"z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
|
|
21354
|
-
"
|
|
21355
|
-
"transform transition-transform duration-200 ease-in-out",
|
|
21356
|
-
"flex flex-col",
|
|
21357
|
-
sidebarOpen ? "translate-x-0" : "-translate-x-full"
|
|
21369
|
+
"flex flex-col"
|
|
21358
21370
|
),
|
|
21371
|
+
style: isMobile ? {
|
|
21372
|
+
position: "fixed",
|
|
21373
|
+
top: 0,
|
|
21374
|
+
bottom: 0,
|
|
21375
|
+
left: 0,
|
|
21376
|
+
transform: sidebarOpen ? "translateX(0)" : "translateX(-100%)",
|
|
21377
|
+
transition: "transform 200ms ease-in-out"
|
|
21378
|
+
} : { position: "static", transform: "none" },
|
|
21359
21379
|
children: [
|
|
21360
21380
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
21361
21381
|
exports.HStack,
|
|
@@ -21384,11 +21404,11 @@ var init_DashboardLayout = __esm({
|
|
|
21384
21404
|
}
|
|
21385
21405
|
)
|
|
21386
21406
|
] }),
|
|
21387
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21407
|
+
isMobile && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21388
21408
|
exports.Button,
|
|
21389
21409
|
{
|
|
21390
21410
|
variant: "ghost",
|
|
21391
|
-
className: "
|
|
21411
|
+
className: "p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
21392
21412
|
onClick: () => setSidebarOpen(false),
|
|
21393
21413
|
children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: "x", className: "h-5 w-5" })
|
|
21394
21414
|
}
|
|
@@ -21429,11 +21449,11 @@ var init_DashboardLayout = __esm({
|
|
|
21429
21449
|
justify: "between",
|
|
21430
21450
|
className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
|
|
21431
21451
|
children: [
|
|
21432
|
-
showSidebar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21452
|
+
showSidebar && isMobile && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21433
21453
|
exports.Button,
|
|
21434
21454
|
{
|
|
21435
21455
|
variant: "ghost",
|
|
21436
|
-
className: "
|
|
21456
|
+
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",
|
|
21437
21457
|
onClick: () => setSidebarOpen(true),
|
|
21438
21458
|
"aria-label": "Open sidebar",
|
|
21439
21459
|
children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: "menu", className: "h-5 w-5" })
|
|
@@ -47599,7 +47619,7 @@ function getToastPosition(position) {
|
|
|
47599
47619
|
return "top-4 right-4";
|
|
47600
47620
|
}
|
|
47601
47621
|
}
|
|
47602
|
-
function renderPatternChildren(children, onDismiss, parentId = "root", parentPath = "root", sourceTrait) {
|
|
47622
|
+
function renderPatternChildren(children, onDismiss, parentId = "root", parentPath = "root", sourceTrait, orbCtx) {
|
|
47603
47623
|
if (children === void 0 || children === null) return null;
|
|
47604
47624
|
const childrenArray = Array.isArray(children) ? children : typeof children === "string" || typeof children === "object" && "type" in children ? [children] : [];
|
|
47605
47625
|
if (childrenArray.length === 0) return null;
|
|
@@ -47630,8 +47650,11 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
47630
47650
|
nodeId: child._id,
|
|
47631
47651
|
// Inherit sourceTrait from the parent slot so nested patterns
|
|
47632
47652
|
// (e.g. form-section inside a stack) can resolve entityDef via
|
|
47633
|
-
// the trait's linkedEntity for form-field enrichment.
|
|
47634
|
-
|
|
47653
|
+
// the trait's linkedEntity for form-field enrichment. The orbCtx
|
|
47654
|
+
// (slot/transition/state/entity) propagates the same way so every
|
|
47655
|
+
// nested node carries a complete contextual-edit address.
|
|
47656
|
+
...sourceTrait !== void 0 && { sourceTrait },
|
|
47657
|
+
...orbCtx ?? {}
|
|
47635
47658
|
};
|
|
47636
47659
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
47637
47660
|
SlotContentRenderer,
|
|
@@ -47747,7 +47770,12 @@ function SlotContentRenderer({
|
|
|
47747
47770
|
const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
|
|
47748
47771
|
const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
|
|
47749
47772
|
const myPath = patternPath ?? "root";
|
|
47750
|
-
const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait
|
|
47773
|
+
const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait, {
|
|
47774
|
+
slot: content.slot,
|
|
47775
|
+
transitionEvent: content.transitionEvent,
|
|
47776
|
+
fromState: content.fromState,
|
|
47777
|
+
entity: content.entity
|
|
47778
|
+
}) : void 0;
|
|
47751
47779
|
const incomingChildren = content.props.children;
|
|
47752
47780
|
const childrenIsRenderFn = typeof incomingChildren === "function";
|
|
47753
47781
|
const { children: _childrenConfig, ...restPropsNoChildren } = content.props;
|
|
@@ -47794,6 +47822,13 @@ function SlotContentRenderer({
|
|
|
47794
47822
|
"data-pattern-path": myPath,
|
|
47795
47823
|
"data-pattern-type": content.pattern,
|
|
47796
47824
|
"data-accepts-children": acceptsChildren ? "true" : void 0,
|
|
47825
|
+
"data-orb-trait": content.sourceTrait,
|
|
47826
|
+
"data-orb-slot": content.slot,
|
|
47827
|
+
"data-orb-transition": content.transitionEvent,
|
|
47828
|
+
"data-orb-state": content.fromState,
|
|
47829
|
+
"data-orb-entity": content.entity,
|
|
47830
|
+
"data-orb-path": myPath,
|
|
47831
|
+
"data-orb-pattern": content.pattern,
|
|
47797
47832
|
children: renderedChildren !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(PatternComponent, { ...finalProps, children: renderedChildren }) : /* @__PURE__ */ jsxRuntime.jsx(PatternComponent, { ...finalProps })
|
|
47798
47833
|
}
|
|
47799
47834
|
);
|
|
@@ -47806,6 +47841,13 @@ function SlotContentRenderer({
|
|
|
47806
47841
|
"data-id": content.id,
|
|
47807
47842
|
"data-node-id": content.nodeId,
|
|
47808
47843
|
"data-source-trait": content.sourceTrait,
|
|
47844
|
+
"data-orb-trait": content.sourceTrait,
|
|
47845
|
+
"data-orb-slot": content.slot,
|
|
47846
|
+
"data-orb-transition": content.transitionEvent,
|
|
47847
|
+
"data-orb-state": content.fromState,
|
|
47848
|
+
"data-orb-entity": content.entity,
|
|
47849
|
+
"data-orb-path": patternPath ?? "root",
|
|
47850
|
+
"data-orb-pattern": content.pattern,
|
|
47809
47851
|
children: content.props.children ?? /* @__PURE__ */ jsxRuntime.jsxs(exports.Box, { className: "p-4 text-sm text-muted-foreground border border-dashed border-border rounded", children: [
|
|
47810
47852
|
"Unknown pattern: ",
|
|
47811
47853
|
content.pattern,
|
|
@@ -50360,7 +50402,11 @@ function useUISlotManager() {
|
|
|
50360
50402
|
priority: config.priority ?? 0,
|
|
50361
50403
|
animation: config.animation ?? "fade",
|
|
50362
50404
|
onDismiss: config.onDismiss,
|
|
50363
|
-
sourceTrait: config.sourceTrait
|
|
50405
|
+
sourceTrait: config.sourceTrait,
|
|
50406
|
+
slot: config.target,
|
|
50407
|
+
transitionEvent: config.transitionEvent,
|
|
50408
|
+
fromState: config.fromState,
|
|
50409
|
+
entity: config.entity
|
|
50364
50410
|
};
|
|
50365
50411
|
if (config.autoDismissMs && config.autoDismissMs > 0) {
|
|
50366
50412
|
content.autoDismissAt = Date.now() + config.autoDismissMs;
|
package/dist/components/index.js
CHANGED
|
@@ -8630,13 +8630,13 @@ var init_MapView = __esm({
|
|
|
8630
8630
|
shadowSize: [41, 41]
|
|
8631
8631
|
});
|
|
8632
8632
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
8633
|
-
const { useEffect:
|
|
8633
|
+
const { useEffect: useEffect74, useRef: useRef68, useCallback: useCallback129, useState: useState112 } = React80__default;
|
|
8634
8634
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
8635
8635
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
8636
8636
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
8637
8637
|
const map = useMap();
|
|
8638
|
-
const prevRef =
|
|
8639
|
-
|
|
8638
|
+
const prevRef = useRef68({ centerLat, centerLng, zoom });
|
|
8639
|
+
useEffect74(() => {
|
|
8640
8640
|
const prev = prevRef.current;
|
|
8641
8641
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
8642
8642
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -8647,7 +8647,7 @@ var init_MapView = __esm({
|
|
|
8647
8647
|
}
|
|
8648
8648
|
function MapClickHandler({ onMapClick }) {
|
|
8649
8649
|
const map = useMap();
|
|
8650
|
-
|
|
8650
|
+
useEffect74(() => {
|
|
8651
8651
|
if (!onMapClick) return;
|
|
8652
8652
|
const handler = (e) => {
|
|
8653
8653
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -21268,6 +21268,21 @@ var init_DashboardLayout = __esm({
|
|
|
21268
21268
|
};
|
|
21269
21269
|
const [sidebarOpen, setSidebarOpen] = useState(false);
|
|
21270
21270
|
const [userMenuOpen, setUserMenuOpen] = useState(false);
|
|
21271
|
+
const layoutRef = useRef(null);
|
|
21272
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
21273
|
+
useEffect(() => {
|
|
21274
|
+
const el = layoutRef.current;
|
|
21275
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
21276
|
+
const ro = new ResizeObserver((entries) => {
|
|
21277
|
+
const w = entries[0]?.contentRect.width ?? el.clientWidth;
|
|
21278
|
+
setIsMobile(w < 1024);
|
|
21279
|
+
});
|
|
21280
|
+
ro.observe(el);
|
|
21281
|
+
return () => ro.disconnect();
|
|
21282
|
+
}, []);
|
|
21283
|
+
useEffect(() => {
|
|
21284
|
+
if (!isMobile && sidebarOpen) setSidebarOpen(false);
|
|
21285
|
+
}, [isMobile, sidebarOpen]);
|
|
21271
21286
|
const location = useLocation();
|
|
21272
21287
|
const ctxPagePath = useCurrentPagePath();
|
|
21273
21288
|
const activePath = currentPath ?? ctxPagePath ?? location.pathname;
|
|
@@ -21284,15 +21299,15 @@ var init_DashboardLayout = __esm({
|
|
|
21284
21299
|
const showBottomNav = layoutMode === "bottomnav";
|
|
21285
21300
|
const isTopNav = layoutMode === "topnav";
|
|
21286
21301
|
return /* @__PURE__ */ jsxs(
|
|
21287
|
-
|
|
21302
|
+
Box,
|
|
21288
21303
|
{
|
|
21289
|
-
|
|
21290
|
-
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
21304
|
+
ref: layoutRef,
|
|
21305
|
+
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background flex flex-row items-stretch",
|
|
21291
21306
|
children: [
|
|
21292
|
-
showSidebar && sidebarOpen && /* @__PURE__ */ jsx(
|
|
21307
|
+
showSidebar && isMobile && sidebarOpen && /* @__PURE__ */ jsx(
|
|
21293
21308
|
Box,
|
|
21294
21309
|
{
|
|
21295
|
-
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20
|
|
21310
|
+
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20",
|
|
21296
21311
|
onClick: () => setSidebarOpen(false)
|
|
21297
21312
|
}
|
|
21298
21313
|
),
|
|
@@ -21302,11 +21317,16 @@ var init_DashboardLayout = __esm({
|
|
|
21302
21317
|
as: "aside",
|
|
21303
21318
|
className: cn(
|
|
21304
21319
|
"z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
|
|
21305
|
-
"
|
|
21306
|
-
"transform transition-transform duration-200 ease-in-out",
|
|
21307
|
-
"flex flex-col",
|
|
21308
|
-
sidebarOpen ? "translate-x-0" : "-translate-x-full"
|
|
21320
|
+
"flex flex-col"
|
|
21309
21321
|
),
|
|
21322
|
+
style: isMobile ? {
|
|
21323
|
+
position: "fixed",
|
|
21324
|
+
top: 0,
|
|
21325
|
+
bottom: 0,
|
|
21326
|
+
left: 0,
|
|
21327
|
+
transform: sidebarOpen ? "translateX(0)" : "translateX(-100%)",
|
|
21328
|
+
transition: "transform 200ms ease-in-out"
|
|
21329
|
+
} : { position: "static", transform: "none" },
|
|
21310
21330
|
children: [
|
|
21311
21331
|
/* @__PURE__ */ jsxs(
|
|
21312
21332
|
HStack,
|
|
@@ -21335,11 +21355,11 @@ var init_DashboardLayout = __esm({
|
|
|
21335
21355
|
}
|
|
21336
21356
|
)
|
|
21337
21357
|
] }),
|
|
21338
|
-
/* @__PURE__ */ jsx(
|
|
21358
|
+
isMobile && /* @__PURE__ */ jsx(
|
|
21339
21359
|
Button,
|
|
21340
21360
|
{
|
|
21341
21361
|
variant: "ghost",
|
|
21342
|
-
className: "
|
|
21362
|
+
className: "p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
21343
21363
|
onClick: () => setSidebarOpen(false),
|
|
21344
21364
|
children: /* @__PURE__ */ jsx(Icon, { name: "x", className: "h-5 w-5" })
|
|
21345
21365
|
}
|
|
@@ -21380,11 +21400,11 @@ var init_DashboardLayout = __esm({
|
|
|
21380
21400
|
justify: "between",
|
|
21381
21401
|
className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
|
|
21382
21402
|
children: [
|
|
21383
|
-
showSidebar && /* @__PURE__ */ jsx(
|
|
21403
|
+
showSidebar && isMobile && /* @__PURE__ */ jsx(
|
|
21384
21404
|
Button,
|
|
21385
21405
|
{
|
|
21386
21406
|
variant: "ghost",
|
|
21387
|
-
className: "
|
|
21407
|
+
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",
|
|
21388
21408
|
onClick: () => setSidebarOpen(true),
|
|
21389
21409
|
"aria-label": "Open sidebar",
|
|
21390
21410
|
children: /* @__PURE__ */ jsx(Icon, { name: "menu", className: "h-5 w-5" })
|
|
@@ -47550,7 +47570,7 @@ function getToastPosition(position) {
|
|
|
47550
47570
|
return "top-4 right-4";
|
|
47551
47571
|
}
|
|
47552
47572
|
}
|
|
47553
|
-
function renderPatternChildren(children, onDismiss, parentId = "root", parentPath = "root", sourceTrait) {
|
|
47573
|
+
function renderPatternChildren(children, onDismiss, parentId = "root", parentPath = "root", sourceTrait, orbCtx) {
|
|
47554
47574
|
if (children === void 0 || children === null) return null;
|
|
47555
47575
|
const childrenArray = Array.isArray(children) ? children : typeof children === "string" || typeof children === "object" && "type" in children ? [children] : [];
|
|
47556
47576
|
if (childrenArray.length === 0) return null;
|
|
@@ -47581,8 +47601,11 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
47581
47601
|
nodeId: child._id,
|
|
47582
47602
|
// Inherit sourceTrait from the parent slot so nested patterns
|
|
47583
47603
|
// (e.g. form-section inside a stack) can resolve entityDef via
|
|
47584
|
-
// the trait's linkedEntity for form-field enrichment.
|
|
47585
|
-
|
|
47604
|
+
// the trait's linkedEntity for form-field enrichment. The orbCtx
|
|
47605
|
+
// (slot/transition/state/entity) propagates the same way so every
|
|
47606
|
+
// nested node carries a complete contextual-edit address.
|
|
47607
|
+
...sourceTrait !== void 0 && { sourceTrait },
|
|
47608
|
+
...orbCtx ?? {}
|
|
47586
47609
|
};
|
|
47587
47610
|
return /* @__PURE__ */ jsx(
|
|
47588
47611
|
SlotContentRenderer,
|
|
@@ -47698,7 +47721,12 @@ function SlotContentRenderer({
|
|
|
47698
47721
|
const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
|
|
47699
47722
|
const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
|
|
47700
47723
|
const myPath = patternPath ?? "root";
|
|
47701
|
-
const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait
|
|
47724
|
+
const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait, {
|
|
47725
|
+
slot: content.slot,
|
|
47726
|
+
transitionEvent: content.transitionEvent,
|
|
47727
|
+
fromState: content.fromState,
|
|
47728
|
+
entity: content.entity
|
|
47729
|
+
}) : void 0;
|
|
47702
47730
|
const incomingChildren = content.props.children;
|
|
47703
47731
|
const childrenIsRenderFn = typeof incomingChildren === "function";
|
|
47704
47732
|
const { children: _childrenConfig, ...restPropsNoChildren } = content.props;
|
|
@@ -47745,6 +47773,13 @@ function SlotContentRenderer({
|
|
|
47745
47773
|
"data-pattern-path": myPath,
|
|
47746
47774
|
"data-pattern-type": content.pattern,
|
|
47747
47775
|
"data-accepts-children": acceptsChildren ? "true" : void 0,
|
|
47776
|
+
"data-orb-trait": content.sourceTrait,
|
|
47777
|
+
"data-orb-slot": content.slot,
|
|
47778
|
+
"data-orb-transition": content.transitionEvent,
|
|
47779
|
+
"data-orb-state": content.fromState,
|
|
47780
|
+
"data-orb-entity": content.entity,
|
|
47781
|
+
"data-orb-path": myPath,
|
|
47782
|
+
"data-orb-pattern": content.pattern,
|
|
47748
47783
|
children: renderedChildren !== void 0 ? /* @__PURE__ */ jsx(PatternComponent, { ...finalProps, children: renderedChildren }) : /* @__PURE__ */ jsx(PatternComponent, { ...finalProps })
|
|
47749
47784
|
}
|
|
47750
47785
|
);
|
|
@@ -47757,6 +47792,13 @@ function SlotContentRenderer({
|
|
|
47757
47792
|
"data-id": content.id,
|
|
47758
47793
|
"data-node-id": content.nodeId,
|
|
47759
47794
|
"data-source-trait": content.sourceTrait,
|
|
47795
|
+
"data-orb-trait": content.sourceTrait,
|
|
47796
|
+
"data-orb-slot": content.slot,
|
|
47797
|
+
"data-orb-transition": content.transitionEvent,
|
|
47798
|
+
"data-orb-state": content.fromState,
|
|
47799
|
+
"data-orb-entity": content.entity,
|
|
47800
|
+
"data-orb-path": patternPath ?? "root",
|
|
47801
|
+
"data-orb-pattern": content.pattern,
|
|
47760
47802
|
children: content.props.children ?? /* @__PURE__ */ jsxs(Box, { className: "p-4 text-sm text-muted-foreground border border-dashed border-border rounded", children: [
|
|
47761
47803
|
"Unknown pattern: ",
|
|
47762
47804
|
content.pattern,
|
|
@@ -50311,7 +50353,11 @@ function useUISlotManager() {
|
|
|
50311
50353
|
priority: config.priority ?? 0,
|
|
50312
50354
|
animation: config.animation ?? "fade",
|
|
50313
50355
|
onDismiss: config.onDismiss,
|
|
50314
|
-
sourceTrait: config.sourceTrait
|
|
50356
|
+
sourceTrait: config.sourceTrait,
|
|
50357
|
+
slot: config.target,
|
|
50358
|
+
transitionEvent: config.transitionEvent,
|
|
50359
|
+
fromState: config.fromState,
|
|
50360
|
+
entity: config.entity
|
|
50315
50361
|
};
|
|
50316
50362
|
if (config.autoDismissMs && config.autoDismissMs > 0) {
|
|
50317
50363
|
content.autoDismissAt = Date.now() + config.autoDismissMs;
|
package/dist/context/index.cjs
CHANGED
|
@@ -124,7 +124,11 @@ function useUISlotManager() {
|
|
|
124
124
|
priority: config.priority ?? 0,
|
|
125
125
|
animation: config.animation ?? "fade",
|
|
126
126
|
onDismiss: config.onDismiss,
|
|
127
|
-
sourceTrait: config.sourceTrait
|
|
127
|
+
sourceTrait: config.sourceTrait,
|
|
128
|
+
slot: config.target,
|
|
129
|
+
transitionEvent: config.transitionEvent,
|
|
130
|
+
fromState: config.fromState,
|
|
131
|
+
entity: config.entity
|
|
128
132
|
};
|
|
129
133
|
if (config.autoDismissMs && config.autoDismissMs > 0) {
|
|
130
134
|
content.autoDismissAt = Date.now() + config.autoDismissMs;
|
package/dist/context/index.js
CHANGED
|
@@ -122,7 +122,11 @@ function useUISlotManager() {
|
|
|
122
122
|
priority: config.priority ?? 0,
|
|
123
123
|
animation: config.animation ?? "fade",
|
|
124
124
|
onDismiss: config.onDismiss,
|
|
125
|
-
sourceTrait: config.sourceTrait
|
|
125
|
+
sourceTrait: config.sourceTrait,
|
|
126
|
+
slot: config.target,
|
|
127
|
+
transitionEvent: config.transitionEvent,
|
|
128
|
+
fromState: config.fromState,
|
|
129
|
+
entity: config.entity
|
|
126
130
|
};
|
|
127
131
|
if (config.autoDismissMs && config.autoDismissMs > 0) {
|
|
128
132
|
content.autoDismissAt = Date.now() + config.autoDismissMs;
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -1131,7 +1131,11 @@ function useUISlotManager() {
|
|
|
1131
1131
|
priority: config.priority ?? 0,
|
|
1132
1132
|
animation: config.animation ?? "fade",
|
|
1133
1133
|
onDismiss: config.onDismiss,
|
|
1134
|
-
sourceTrait: config.sourceTrait
|
|
1134
|
+
sourceTrait: config.sourceTrait,
|
|
1135
|
+
slot: config.target,
|
|
1136
|
+
transitionEvent: config.transitionEvent,
|
|
1137
|
+
fromState: config.fromState,
|
|
1138
|
+
entity: config.entity
|
|
1135
1139
|
};
|
|
1136
1140
|
if (config.autoDismissMs && config.autoDismissMs > 0) {
|
|
1137
1141
|
content.autoDismissAt = Date.now() + config.autoDismissMs;
|
package/dist/hooks/index.js
CHANGED
|
@@ -1129,7 +1129,11 @@ function useUISlotManager() {
|
|
|
1129
1129
|
priority: config.priority ?? 0,
|
|
1130
1130
|
animation: config.animation ?? "fade",
|
|
1131
1131
|
onDismiss: config.onDismiss,
|
|
1132
|
-
sourceTrait: config.sourceTrait
|
|
1132
|
+
sourceTrait: config.sourceTrait,
|
|
1133
|
+
slot: config.target,
|
|
1134
|
+
transitionEvent: config.transitionEvent,
|
|
1135
|
+
fromState: config.fromState,
|
|
1136
|
+
entity: config.entity
|
|
1133
1137
|
};
|
|
1134
1138
|
if (config.autoDismissMs && config.autoDismissMs > 0) {
|
|
1135
1139
|
content.autoDismissAt = Date.now() + config.autoDismissMs;
|
|
@@ -95,6 +95,14 @@ export interface SlotContent {
|
|
|
95
95
|
sourceTrait?: string;
|
|
96
96
|
/** Stable node ID from the schema pattern tree (for edit mode overlay targeting) */
|
|
97
97
|
nodeId?: string;
|
|
98
|
+
/** Slot this content was rendered into (= RenderUIConfig.target) — contextual-edit address. */
|
|
99
|
+
slot?: string;
|
|
100
|
+
/** Transition event key that produced this render (raw, as fired). */
|
|
101
|
+
transitionEvent?: string;
|
|
102
|
+
/** State the trait was in when this render fired (the from-state). */
|
|
103
|
+
fromState?: string;
|
|
104
|
+
/** linkedEntity of the source trait — contextual-edit address. */
|
|
105
|
+
entity?: string;
|
|
98
106
|
}
|
|
99
107
|
/**
|
|
100
108
|
* Configuration for render_ui effect
|
|
@@ -116,6 +124,12 @@ export interface RenderUIConfig {
|
|
|
116
124
|
onDismiss?: () => void;
|
|
117
125
|
/** Source trait name */
|
|
118
126
|
sourceTrait?: string;
|
|
127
|
+
/** Transition event key that produced this render (raw, as fired). */
|
|
128
|
+
transitionEvent?: string;
|
|
129
|
+
/** State the trait was in when this render fired (the from-state). */
|
|
130
|
+
fromState?: string;
|
|
131
|
+
/** linkedEntity of the source trait. */
|
|
132
|
+
entity?: string;
|
|
119
133
|
}
|
|
120
134
|
/**
|
|
121
135
|
* Callback for slot changes
|