@arach/arc-iso 0.4.4 → 0.4.5

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +134 -2
  2. package/package.json +5 -1
package/dist/index.d.ts CHANGED
@@ -22,23 +22,30 @@ export declare interface ArcConnectorStyle {
22
22
  dashed?: boolean;
23
23
  }
24
24
 
25
- export declare function ArcDiagram({ data, className, interactive, mode, theme, label, labelPosition, defaultZoom, zoomLevels, showArcToggle, showAutoLayout, showControls, showMinimap, frame, hoverEffects, onNodeHover, titleBlock, maxFitZoom, }: ArcDiagramProps): JSX.Element;
25
+ export declare function ArcDiagram({ data, className, interactive, mode, theme, label, labelPosition, defaultZoom, zoomLevels, showArcToggle, showAutoLayout, showControls, showMinimap, showFocusStory, frame, hoverEffects, onNodeHover, titleBlock, maxFitZoom, }: ArcDiagramProps): JSX.Element;
26
26
 
27
27
  export declare interface ArcDiagramData {
28
28
  id?: string;
29
29
  layout: DiagramLayout;
30
+ layoutHints?: LayoutHints;
30
31
  nodes: Record<string, ArcNodePosition>;
31
32
  nodeData: Record<string, ArcNodeData>;
32
33
  connectors: ArcConnector[];
33
34
  connectorStyles: Record<string, ArcConnectorStyle>;
35
+ focusTargets?: Record<string, FocusTarget>;
36
+ groups?: GroupShape[];
34
37
  }
35
38
 
36
39
  declare interface ArcDiagramData_2 {
40
+ id?: string;
37
41
  layout: DiagramLayout_2;
42
+ layoutHints?: LayoutHints_2;
38
43
  nodes: Record<string, NodePosition_2>;
39
44
  nodeData: Record<string, NodeData>;
40
45
  connectors: Connector[];
41
46
  connectorStyles: Record<string, ConnectorStyle_2>;
47
+ focusTargets?: Record<string, FocusTarget_2>;
48
+ groups?: GroupShape_2[];
42
49
  }
43
50
 
44
51
  export declare function ArcDiagramIsometric({ config, options, className, style, onNodeClick, onLayerClick }: ArcDiagramProps_2): JSX.Element;
@@ -67,6 +74,8 @@ declare interface ArcDiagramProps {
67
74
  showControls?: boolean;
68
75
  /** Show a minimap overview (bottom-left). Default: false */
69
76
  showMinimap?: boolean;
77
+ /** Show the active focus target's caption and steps. Default: false */
78
+ showFocusStory?: boolean;
70
79
  /** Override the edge/frame treatment (else the theme's brand.frame). */
71
80
  frame?: BrandSpec['frame'];
72
81
  /** Control hover behavior. true = all effects (default), false = none, object = granular control */
@@ -124,6 +133,8 @@ export declare interface AsciiOptions {
124
133
  * Generate a diagram from minimal input — no positions or anchors needed.
125
134
  */
126
135
  export declare interface AutoDiagramInput {
136
+ layoutHints?: ArcDiagramData_2['layoutHints'];
137
+ groups?: ArcDiagramData_2['groups'];
127
138
  nodeData: ArcDiagramData_2['nodeData'];
128
139
  connectors: Array<Omit<Connector, 'fromAnchor' | 'toAnchor'> & {
129
140
  fromAnchor?: AnchorPosition_2;
@@ -437,6 +448,44 @@ export declare interface EmbedConfig {
437
448
  showGrid?: boolean;
438
449
  }
439
450
 
451
+ export declare interface FocusConnectorRef {
452
+ from: string;
453
+ to: string;
454
+ }
455
+
456
+ declare interface FocusConnectorRef_2 {
457
+ from: string;
458
+ to: string;
459
+ }
460
+
461
+ export declare interface FocusStep {
462
+ icon: string;
463
+ label: string;
464
+ }
465
+
466
+ declare interface FocusStep_2 {
467
+ icon: string;
468
+ label: string;
469
+ }
470
+
471
+ export declare interface FocusTarget {
472
+ mode?: 'append' | 'replace';
473
+ nodes?: string[];
474
+ connectors?: FocusConnectorRef[];
475
+ caption?: string;
476
+ steps?: FocusStep[];
477
+ }
478
+
479
+ /** A declarative highlight story activated by hovering or selecting a node. */
480
+ declare interface FocusTarget_2 {
481
+ /** `append` includes direct neighbors; `replace` uses only the explicit story. */
482
+ mode?: 'append' | 'replace';
483
+ nodes?: string[];
484
+ connectors?: FocusConnectorRef_2[];
485
+ caption?: string;
486
+ steps?: FocusStep_2[];
487
+ }
488
+
440
489
  /** Generate a short session ID (first 8 hex chars of a UUID for brevity in URLs) */
441
490
  export declare function generateSessionId(): string;
442
491
 
@@ -451,6 +500,54 @@ export declare function getThemeList(): {
451
500
  description: string;
452
501
  }[];
453
502
 
503
+ export declare type GroupLayoutDirection = 'horizontal' | 'vertical';
504
+
505
+ declare type GroupLayoutDirection_2 = 'horizontal' | 'vertical';
506
+
507
+ export declare interface GroupLayoutHint {
508
+ direction?: GroupLayoutDirection;
509
+ padding?: number;
510
+ layerGap?: number;
511
+ itemGap?: number;
512
+ align?: LayoutAlignment;
513
+ justify?: LayoutAlignment | 'space-between';
514
+ }
515
+
516
+ /** Layout policy for the nodes inside one group frame. */
517
+ declare interface GroupLayoutHint_2 {
518
+ /** `horizontal` lays layers left-to-right; `vertical` lays them top-to-bottom. */
519
+ direction?: GroupLayoutDirection_2;
520
+ padding?: number;
521
+ layerGap?: number;
522
+ itemGap?: number;
523
+ align?: LayoutAlignment_2;
524
+ justify?: LayoutAlignment_2 | 'space-between';
525
+ }
526
+
527
+ export declare interface GroupShape {
528
+ id: string;
529
+ x: number;
530
+ y: number;
531
+ width: number;
532
+ height: number;
533
+ type: 'rect' | 'circle';
534
+ color: DiagramColor;
535
+ label?: string;
536
+ dashed?: boolean;
537
+ }
538
+
539
+ declare interface GroupShape_2 {
540
+ id: string;
541
+ x: number;
542
+ y: number;
543
+ width: number;
544
+ height: number;
545
+ type: 'rect' | 'circle';
546
+ color: DiagramColor_2;
547
+ label?: string;
548
+ dashed?: boolean;
549
+ }
550
+
454
551
  declare interface HoverEffectsConfig {
455
552
  /** Dim unrelated nodes/connectors. Default: true */
456
553
  dim?: boolean;
@@ -596,6 +693,20 @@ declare type LabelAlign = 'left' | 'right' | 'center';
596
693
 
597
694
  declare type LabelCorner = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
598
695
 
696
+ export declare type LayoutAlignment = 'start' | 'center' | 'end';
697
+
698
+ declare type LayoutAlignment_2 = 'start' | 'center' | 'end';
699
+
700
+ export declare interface LayoutHints {
701
+ nodes?: Record<string, NodeLayoutHint>;
702
+ groups?: Record<string, GroupLayoutHint>;
703
+ }
704
+
705
+ declare interface LayoutHints_2 {
706
+ nodes?: Record<string, NodeLayoutHint_2>;
707
+ groups?: Record<string, GroupLayoutHint_2>;
708
+ }
709
+
599
710
  declare interface LayoutOptions {
600
711
  /** Horizontal gap between columns */
601
712
  columnGap?: number;
@@ -625,6 +736,22 @@ declare interface NodeData {
625
736
  color: DiagramColor_2;
626
737
  }
627
738
 
739
+ export declare interface NodeLayoutHint {
740
+ group?: string;
741
+ layer?: number;
742
+ order?: number;
743
+ }
744
+
745
+ /** Optional placement hints used by autoLayout when nodes belong to groups. */
746
+ declare interface NodeLayoutHint_2 {
747
+ /** ID of the group frame that owns this node. */
748
+ group?: string;
749
+ /** Explicit layer within the group. Connected nodes are layered automatically otherwise. */
750
+ layer?: number;
751
+ /** Stable ordering within a layer. Lower values render first. */
752
+ order?: number;
753
+ }
754
+
628
755
  export declare interface NodePosition {
629
756
  x: number;
630
757
  y: number;
@@ -644,7 +771,7 @@ declare interface NodePosition_2 {
644
771
 
645
772
  export declare type NodeSize = 'xs' | 's' | 'm' | 'l';
646
773
 
647
- declare type NodeSize_2 = 's' | 'm' | 'l';
774
+ declare type NodeSize_2 = 'xs' | 's' | 'm' | 'l';
648
775
 
649
776
  declare type NodeSize_3 = 'large' | 'normal' | 'small';
650
777
 
@@ -704,6 +831,11 @@ export declare function renderToElement(container: HTMLElement, config: DiagramC
704
831
  */
705
832
  export declare function renderToString(config: DiagramConfig): string;
706
833
 
834
+ export declare function resolveFocusState(activeNodeId: string | null, connectors: ArcConnector[], focusTargets?: Record<string, FocusTarget>): {
835
+ nodeIds: Set<string>;
836
+ connectorIndexes: Set<number>;
837
+ };
838
+
707
839
  /** Save a diagram session to localStorage */
708
840
  export declare function saveDiagramSession(id: string, data: Omit<DiagramSession, 'updatedAt'>): void;
709
841
 
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@arach/arc-iso",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "type": "module",
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "provenance": true
8
+ },
5
9
  "description": "Isometric diagrams as code for React and the browser",
6
10
  "author": "Arach Tchoupani",
7
11
  "license": "MIT",