@almadar/ui 4.54.13 → 4.54.15

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.
@@ -60481,7 +60481,10 @@ function buildTransitionSchema(fullSchema, orbitalName, traitName, transitionEve
60481
60481
  if (!Array.isArray(eff)) continue;
60482
60482
  const op = eff[0];
60483
60483
  if (op === "render-ui") {
60484
- previewEffects.push(eff);
60484
+ const slotTarget = eff[1];
60485
+ const PORTAL_SLOTS = /* @__PURE__ */ new Set(["modal", "drawer", "overlay", "center"]);
60486
+ const rewritten = typeof slotTarget === "string" && PORTAL_SLOTS.has(slotTarget) ? ["render-ui", "main", ...eff.slice(2)] : eff;
60487
+ previewEffects.push(rewritten);
60485
60488
  hasRenderUI = true;
60486
60489
  continue;
60487
60490
  }
@@ -60520,6 +60523,22 @@ function buildTransitionSchema(fullSchema, orbitalName, traitName, transitionEve
60520
60523
  if (targetTrait) {
60521
60524
  clonedOrbital.traits = [targetTrait];
60522
60525
  }
60526
+ if (Array.isArray(clonedOrbital.pages)) {
60527
+ const linkedEntityForTrait = core.isInlineTrait(targetTrait) ? targetTrait.linkedEntity ?? entityNameOf(clonedOrbital.entity) : entityNameOf(clonedOrbital.entity);
60528
+ clonedOrbital.pages = clonedOrbital.pages.map((page) => {
60529
+ if (core.isPageReference(page)) return page;
60530
+ const inline = page;
60531
+ if (!Array.isArray(inline.traits)) return inline;
60532
+ const filteredTraits = inline.traits.filter((t) => t.ref === traitName).map((t) => ({
60533
+ ...t,
60534
+ linkedEntity: t.linkedEntity ?? linkedEntityForTrait
60535
+ }));
60536
+ return { ...inline, traits: filteredTraits };
60537
+ }).filter((page) => {
60538
+ if (core.isPageReference(page)) return true;
60539
+ return Array.isArray(page.traits) && page.traits.length > 0;
60540
+ });
60541
+ }
60523
60542
  return { ...fullSchema, name: `${fullSchema.name}__${orbitalName}__${traitName}__${transitionEvent}`, orbitals: [clonedOrbital] };
60524
60543
  }
60525
60544
  var SELECTION_STYLES = `
@@ -60741,7 +60760,7 @@ var OrbPreviewNodeInner = (props) => {
60741
60760
  },
60742
60761
  children: [
60743
60762
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 12 }, children: "\u279E" }),
60744
- "Click to open"
60763
+ "Double-click to open"
60745
60764
  ]
60746
60765
  }
60747
60766
  )
@@ -60842,33 +60861,20 @@ var OrbPreviewNodeInner = (props) => {
60842
60861
  ref: setContentRef,
60843
60862
  className: `orb-preview-live nodrag${dragActive || l2IsOver ? " drag-active" : ""}`,
60844
60863
  onClick: handleContentClick,
60845
- children: orbitalSchema ? isExpanded ? (
60846
- // L2 transition card: OrbPreview's `<Box style={{height}}>` is the
60847
- // only positioned ancestor with a resolved height inside the
60848
- // runtime tree. When the synthesized transition's render-ui
60849
- // targets `modal`/`drawer`/`overlay`, UISlotRenderer paints them
60850
- // via `renderContainedPortal` as `absolute inset-0` which
60851
- // collapses to 0 when the parent chain is `height: auto` →
60852
- // `min-h-full` (no resolved height to inherit). Forcing a real
60853
- // pixel height here gives the contained modal a real card to
60854
- // fill, so the L2 preview shows the modal panel sized to the
60855
- // card instead of a tiny floating rectangle.
60856
- /* @__PURE__ */ jsxRuntime.jsx(
60864
+ children: orbitalSchema ? (
60865
+ // L1 and L2 both auto-grow with content. L2's `buildTransitionSchema`
60866
+ // rewrites portal slots (modal/drawer/overlay/center) to `main`, so
60867
+ // the rendered pattern lands inline in the main slot and contributes
60868
+ // to the card's height — same height model as L1 orbital cards.
60869
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { style: { minHeight: preset.minHeight }, children: /* @__PURE__ */ jsxRuntime.jsx(
60857
60870
  BrowserPlayground,
60858
60871
  {
60859
60872
  schema: orbitalSchema,
60860
60873
  mode: "mock",
60861
- height: `${preset.minHeight}px`
60874
+ height: "auto"
60862
60875
  }
60863
- )
60864
- ) : /* @__PURE__ */ jsxRuntime.jsx(Box, { style: { minHeight: preset.minHeight }, children: /* @__PURE__ */ jsxRuntime.jsx(
60865
- BrowserPlayground,
60866
- {
60867
- schema: orbitalSchema,
60868
- mode: "mock",
60869
- height: "auto"
60870
- }
60871
- ) }) : /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex items-center justify-center", style: { minHeight: preset.minHeight }, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground", children: "No preview available" }) })
60876
+ ) })
60877
+ ) : /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex items-center justify-center", style: { minHeight: preset.minHeight }, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground", children: "No preview available" }) })
60872
60878
  }
60873
60879
  ),
60874
60880
  /* @__PURE__ */ jsxRuntime.jsx(react.Handle, { type: "target", position: react.Position.Left, style: TARGET_HANDLE_STYLE }),
@@ -62361,10 +62367,7 @@ function FlowCanvasInner({
62361
62367
  const orbitalName = nodeData.orbitalName ?? node.id;
62362
62368
  onNodeClick?.({ level: "overview", orbital: orbitalName });
62363
62369
  onNodeSelect?.(orbitalName);
62364
- setExpandedOrbital(orbitalName);
62365
- setLevel("expanded");
62366
- onLevelChange?.("expanded", orbitalName);
62367
- }, [level, expandedOrbital, onNodeClick, onNodeSelect, onLevelChange]);
62370
+ }, [level, expandedOrbital, onNodeClick, onNodeSelect]);
62368
62371
  const handleClosePanel = React96.useCallback(() => {
62369
62372
  setSelectedNode(null);
62370
62373
  }, []);
package/dist/avl/index.js CHANGED
@@ -33,7 +33,7 @@ import langDiff from 'react-syntax-highlighter/dist/esm/languages/prism/diff.js'
33
33
  import langToml from 'react-syntax-highlighter/dist/esm/languages/prism/toml.js';
34
34
  import langGo from 'react-syntax-highlighter/dist/esm/languages/prism/go.js';
35
35
  import langGraphql from 'react-syntax-highlighter/dist/esm/languages/prism/graphql.js';
36
- import { FieldTypeSchema, isInlineTrait, isEntityCall, schemaToIR, getPage, isCircuitEvent } from '@almadar/core';
36
+ import { FieldTypeSchema, isInlineTrait, isPageReference, isEntityCall, schemaToIR, getPage, isCircuitEvent } from '@almadar/core';
37
37
  import { useDroppable, useDraggable, DndContext, DragOverlay, useSensors, useSensor, PointerSensor, KeyboardSensor, pointerWithin, rectIntersection, closestCorners } from '@dnd-kit/core';
38
38
  import { sortableKeyboardCoordinates, useSortable, arrayMove, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from '@dnd-kit/sortable';
39
39
  import { CSS } from '@dnd-kit/utilities';
@@ -60435,7 +60435,10 @@ function buildTransitionSchema(fullSchema, orbitalName, traitName, transitionEve
60435
60435
  if (!Array.isArray(eff)) continue;
60436
60436
  const op = eff[0];
60437
60437
  if (op === "render-ui") {
60438
- previewEffects.push(eff);
60438
+ const slotTarget = eff[1];
60439
+ const PORTAL_SLOTS = /* @__PURE__ */ new Set(["modal", "drawer", "overlay", "center"]);
60440
+ const rewritten = typeof slotTarget === "string" && PORTAL_SLOTS.has(slotTarget) ? ["render-ui", "main", ...eff.slice(2)] : eff;
60441
+ previewEffects.push(rewritten);
60439
60442
  hasRenderUI = true;
60440
60443
  continue;
60441
60444
  }
@@ -60474,6 +60477,22 @@ function buildTransitionSchema(fullSchema, orbitalName, traitName, transitionEve
60474
60477
  if (targetTrait) {
60475
60478
  clonedOrbital.traits = [targetTrait];
60476
60479
  }
60480
+ if (Array.isArray(clonedOrbital.pages)) {
60481
+ const linkedEntityForTrait = isInlineTrait(targetTrait) ? targetTrait.linkedEntity ?? entityNameOf(clonedOrbital.entity) : entityNameOf(clonedOrbital.entity);
60482
+ clonedOrbital.pages = clonedOrbital.pages.map((page) => {
60483
+ if (isPageReference(page)) return page;
60484
+ const inline = page;
60485
+ if (!Array.isArray(inline.traits)) return inline;
60486
+ const filteredTraits = inline.traits.filter((t) => t.ref === traitName).map((t) => ({
60487
+ ...t,
60488
+ linkedEntity: t.linkedEntity ?? linkedEntityForTrait
60489
+ }));
60490
+ return { ...inline, traits: filteredTraits };
60491
+ }).filter((page) => {
60492
+ if (isPageReference(page)) return true;
60493
+ return Array.isArray(page.traits) && page.traits.length > 0;
60494
+ });
60495
+ }
60477
60496
  return { ...fullSchema, name: `${fullSchema.name}__${orbitalName}__${traitName}__${transitionEvent}`, orbitals: [clonedOrbital] };
60478
60497
  }
60479
60498
  var SELECTION_STYLES = `
@@ -60695,7 +60714,7 @@ var OrbPreviewNodeInner = (props) => {
60695
60714
  },
60696
60715
  children: [
60697
60716
  /* @__PURE__ */ jsx("span", { style: { fontSize: 12 }, children: "\u279E" }),
60698
- "Click to open"
60717
+ "Double-click to open"
60699
60718
  ]
60700
60719
  }
60701
60720
  )
@@ -60796,33 +60815,20 @@ var OrbPreviewNodeInner = (props) => {
60796
60815
  ref: setContentRef,
60797
60816
  className: `orb-preview-live nodrag${dragActive || l2IsOver ? " drag-active" : ""}`,
60798
60817
  onClick: handleContentClick,
60799
- children: orbitalSchema ? isExpanded ? (
60800
- // L2 transition card: OrbPreview's `<Box style={{height}}>` is the
60801
- // only positioned ancestor with a resolved height inside the
60802
- // runtime tree. When the synthesized transition's render-ui
60803
- // targets `modal`/`drawer`/`overlay`, UISlotRenderer paints them
60804
- // via `renderContainedPortal` as `absolute inset-0` which
60805
- // collapses to 0 when the parent chain is `height: auto` →
60806
- // `min-h-full` (no resolved height to inherit). Forcing a real
60807
- // pixel height here gives the contained modal a real card to
60808
- // fill, so the L2 preview shows the modal panel sized to the
60809
- // card instead of a tiny floating rectangle.
60810
- /* @__PURE__ */ jsx(
60818
+ children: orbitalSchema ? (
60819
+ // L1 and L2 both auto-grow with content. L2's `buildTransitionSchema`
60820
+ // rewrites portal slots (modal/drawer/overlay/center) to `main`, so
60821
+ // the rendered pattern lands inline in the main slot and contributes
60822
+ // to the card's height — same height model as L1 orbital cards.
60823
+ /* @__PURE__ */ jsx(Box, { style: { minHeight: preset.minHeight }, children: /* @__PURE__ */ jsx(
60811
60824
  BrowserPlayground,
60812
60825
  {
60813
60826
  schema: orbitalSchema,
60814
60827
  mode: "mock",
60815
- height: `${preset.minHeight}px`
60828
+ height: "auto"
60816
60829
  }
60817
- )
60818
- ) : /* @__PURE__ */ jsx(Box, { style: { minHeight: preset.minHeight }, children: /* @__PURE__ */ jsx(
60819
- BrowserPlayground,
60820
- {
60821
- schema: orbitalSchema,
60822
- mode: "mock",
60823
- height: "auto"
60824
- }
60825
- ) }) : /* @__PURE__ */ jsx(Box, { className: "flex items-center justify-center", style: { minHeight: preset.minHeight }, children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: "No preview available" }) })
60830
+ ) })
60831
+ ) : /* @__PURE__ */ jsx(Box, { className: "flex items-center justify-center", style: { minHeight: preset.minHeight }, children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: "No preview available" }) })
60826
60832
  }
60827
60833
  ),
60828
60834
  /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Left, style: TARGET_HANDLE_STYLE }),
@@ -62315,10 +62321,7 @@ function FlowCanvasInner({
62315
62321
  const orbitalName = nodeData.orbitalName ?? node.id;
62316
62322
  onNodeClick?.({ level: "overview", orbital: orbitalName });
62317
62323
  onNodeSelect?.(orbitalName);
62318
- setExpandedOrbital(orbitalName);
62319
- setLevel("expanded");
62320
- onLevelChange?.("expanded", orbitalName);
62321
- }, [level, expandedOrbital, onNodeClick, onNodeSelect, onLevelChange]);
62324
+ }, [level, expandedOrbital, onNodeClick, onNodeSelect]);
62322
62325
  const handleClosePanel = useCallback(() => {
62323
62326
  setSelectedNode(null);
62324
62327
  }, []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "4.54.13",
3
+ "version": "4.54.15",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [