@septkit/ui 0.0.57 → 0.0.58

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/index.d.ts CHANGED
@@ -540,6 +540,11 @@ export declare function createDocumentStore<GenericBaseDocument, GenericAugmente
540
540
  clear: () => void;
541
541
  };
542
542
 
543
+ /** Create an ELK-backed `LayoutEngine`. Each instance owns its own ELK
544
+ * worker/instance so callers/tests stay isolated. `defaults` are applied to
545
+ * every `layout()` call and can be overridden per call via its `options`. */
546
+ export declare function createElkLayoutEngine(defaults?: LayoutOptions): LayoutEngine;
547
+
543
548
  /** A user's binary choice on a decision group. */
544
549
  export declare type DecisionAction = 'accept' | 'skip';
545
550
 
@@ -746,6 +751,77 @@ export declare function highlightCode(code: string, options?: {
746
751
  lineStatuses?: readonly LineStatus[];
747
752
  }): Promise<string>;
748
753
 
754
+ export declare type LayoutDirection = 'UP' | 'DOWN' | 'LEFT' | 'RIGHT';
755
+
756
+ /** A connection between nodes. Arrays mirror ELK's hyperedge model, so a
757
+ * single logical edge can bundle multiple sources/targets (for example
758
+ * ELK's `mergeEdges` bus-style routing). */
759
+ export declare type LayoutEdge = {
760
+ id: string;
761
+ sources: string[];
762
+ targets: string[];
763
+ };
764
+
765
+ /** A swappable diagram layout algorithm. */
766
+ export declare type LayoutEngine = {
767
+ layout(input: LayoutGraphInput, options?: LayoutOptions): Promise<LayoutGraphResult>;
768
+ };
769
+
770
+ export declare type LayoutGraphInput = {
771
+ nodes: LayoutNode[];
772
+ edges: LayoutEdge[];
773
+ };
774
+
775
+ export declare type LayoutGraphResult = {
776
+ /** Computed position per node id. */
777
+ positions: Record<string, LayoutPoint>;
778
+ /**
779
+ * Computed route points per edge id (start, optional bend points, end),
780
+ * when the engine produces routed edges. Absent/empty for engines that
781
+ * don't route edges explicitly.
782
+ */
783
+ edgeRoutes: Record<string, LayoutPoint[]>;
784
+ };
785
+
786
+ /**
787
+ * Normalized, engine-agnostic diagram layout contract. No Vue, Pinia, SCL,
788
+ * Dialecte, or VueFlow types may appear here — see ADR-0024 (shared
789
+ * swappable diagram layout engine).
790
+ */
791
+ /** A single node to be positioned. */
792
+ export declare type LayoutNode = {
793
+ id: string;
794
+ width: number;
795
+ height: number;
796
+ /**
797
+ * Rank used to order siblings left-to-right during layout (for example
798
+ * to keep expansion order stable). Engines that don't support ordering
799
+ * hints may ignore this.
800
+ */
801
+ orderHint?: number;
802
+ /** Nested child nodes, for engines/consumers that lay out containment. */
803
+ children?: LayoutNode[];
804
+ };
805
+
806
+ export declare type LayoutOptions = {
807
+ direction?: LayoutDirection;
808
+ /** Minimum spacing between sibling nodes. */
809
+ nodeSpacing?: number;
810
+ /** Minimum spacing between layers/ranks. */
811
+ layerSpacing?: number;
812
+ /**
813
+ * Engine-specific escape hatch. `ElkLayoutEngine` forwards these
814
+ * verbatim as ELK layout options; other engines may ignore it.
815
+ */
816
+ elkOptions?: Record<string, string>;
817
+ };
818
+
819
+ /** An absolute point on an edge's route. */
820
+ export declare type LayoutPoint = {
821
+ x: number;
822
+ y: number;
823
+ };
824
+
749
825
  export declare type LineStatus = 'added' | 'removed' | 'unchanged';
750
826
 
751
827
  /**
package/dist/index.js CHANGED
@@ -37,4 +37,6 @@ import P from "./context-menu/context-menu.js";
37
37
  import "./context-menu/index.js";
38
38
  import F from "./split-layout/split-layout.js";
39
39
  import "./split-layout/index.js";
40
- export { s as Button, y as CATEGORY_ELEMENTS, T as CodeBlock, l as Combobox, P as ContextMenu, O as DecisionToggle, d as Dialog, _ as DialogHost, v as DocumentProgressBar, c as Dropdown, b as ELEMENT_TO_COLOR, x as ELEMENT_TO_ICON, k as ElementDetail, f as FeedbackDialog, N as MergeReview, A as MergeTree, u as MultiSelect, C as SclExplorer, F as SplitLayout, j as TypeNameAuthority, D as XmlDiff, S as collectExpandableNodeIds, p as createDialogHost, e as createDocumentStore, m as dialogHostKey, E as diffLines, w as highlightCode, h as provideDialogHost, i as useActiveDocument, t as useDialecteChannel, g as useDialog, a as useDocumentProgress, o as useDocumentState, n as useLiveData, M as useMergeSession, r as useProjectLiveData };
40
+ import { createElkLayoutEngine as I } from "./diagram-layout/elk-layout-engine.js";
41
+ import "./diagram-layout/index.js";
42
+ export { s as Button, y as CATEGORY_ELEMENTS, T as CodeBlock, l as Combobox, P as ContextMenu, O as DecisionToggle, d as Dialog, _ as DialogHost, v as DocumentProgressBar, c as Dropdown, b as ELEMENT_TO_COLOR, x as ELEMENT_TO_ICON, k as ElementDetail, f as FeedbackDialog, N as MergeReview, A as MergeTree, u as MultiSelect, C as SclExplorer, F as SplitLayout, j as TypeNameAuthority, D as XmlDiff, S as collectExpandableNodeIds, p as createDialogHost, e as createDocumentStore, I as createElkLayoutEngine, m as dialogHostKey, E as diffLines, w as highlightCode, h as provideDialogHost, i as useActiveDocument, t as useDialecteChannel, g as useDialog, a as useDocumentProgress, o as useDocumentState, n as useLiveData, M as useMergeSession, r as useProjectLiveData };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@septkit/ui",
3
- "version": "0.0.57",
3
+ "version": "0.0.58",
4
4
  "type": "module",
5
5
  "source": "lib/index.ts",
6
6
  "files": [
@@ -22,6 +22,7 @@
22
22
  "@tailwindcss/vite": "4.2.2",
23
23
  "@vueuse/components": "^13.9.0",
24
24
  "@vueuse/core": "^14.2.1",
25
+ "elkjs": "^0.10.2",
25
26
  "pinia": "^3.0.4",
26
27
  "reka-ui": "^2.9.6",
27
28
  "shiki": "^3.0.0",