@arach/arc-iso 0.5.0 → 0.6.0

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
@@ -24,6 +24,20 @@ export declare interface ArcConnectorStyle {
24
24
 
25
25
  export declare function ArcDiagram({ data, className, interactive, mode, theme, label, labelPosition, defaultZoom, zoomLevels, showArcToggle, showAutoLayout, showControls, showMinimap, showLegend, showFocusStory, frame, hoverEffects, onNodeHover, titleBlock, maxFitZoom, }: ArcDiagramProps): JSX.Element;
26
26
 
27
+ declare interface ArcDiagram_2 {
28
+ layout: DiagramLayout_2;
29
+ grid: GridConfig;
30
+ layoutHints?: LayoutHints_2;
31
+ nodes: Record<string, NodePosition_2>;
32
+ nodeData: Record<string, NodeData>;
33
+ connectors: Connector[];
34
+ connectorStyles: Record<string, ConnectorStyle_2>;
35
+ groups?: GroupShape_2[];
36
+ focusTargets?: Record<string, FocusTarget_2>;
37
+ images?: DiagramImage[];
38
+ exportZone?: ExportZone | null;
39
+ }
40
+
27
41
  export declare interface ArcDiagramData {
28
42
  id?: string;
29
43
  layout: DiagramLayout;
@@ -108,6 +122,8 @@ export declare interface ArcNodeData {
108
122
  subtitle?: string;
109
123
  description?: string;
110
124
  color: DiagramColor;
125
+ /** Per-node silhouette. Omit to follow the theme's own node shape. */
126
+ shape?: NodeShape;
111
127
  }
112
128
 
113
129
  export declare interface ArcNodePosition {
@@ -282,7 +298,7 @@ export declare function deleteDiagramSession(id: string): void;
282
298
  /** Derive a URL-safe session ID from a diagram's source path or ID */
283
299
  export declare function deriveSessionId(source: string): string;
284
300
 
285
- export declare function DiagramCanvas({ onViewportChange, embedConfig, zoomConfig, themeOverride, isDark }: DiagramCanvasProps): JSX.Element;
301
+ export declare function DiagramCanvas({ onViewportChange, embedConfig, zoomConfig, surface, themeOverride, isDark }: DiagramCanvasProps): JSX.Element;
286
302
 
287
303
  declare interface DiagramCanvasProps {
288
304
  onViewportChange?: (bounds: {
@@ -293,6 +309,10 @@ declare interface DiagramCanvasProps {
293
309
  }) => void;
294
310
  embedConfig?: EmbedConfig;
295
311
  zoomConfig?: ZoomConfig;
312
+ /** Workspace backdrop: 'theme' paints the diagram theme's container (embeds,
313
+ * where the frame is part of the artifact), 'chrome' paints the app canvas
314
+ * so the editor's infinite surface matches the shell skin. */
315
+ surface?: 'theme' | 'chrome';
296
316
  /** Override canvas background with an Arc theme. */
297
317
  themeOverride?: string;
298
318
  isDark?: boolean;
@@ -368,6 +388,17 @@ export declare function DiagramEditor({ initialData, themeId, colorMode, session
368
388
  initialDiagramMeta?: Record<string, any>;
369
389
  }): JSX.Element;
370
390
 
391
+ declare interface DiagramImage {
392
+ id: string;
393
+ src: string;
394
+ name: string;
395
+ x: number;
396
+ y: number;
397
+ width: number;
398
+ height: number;
399
+ opacity: number;
400
+ }
401
+
371
402
  export declare interface DiagramLayout {
372
403
  width: number;
373
404
  height: number;
@@ -459,6 +490,13 @@ export declare interface EmbedConfig {
459
490
  showGrid?: boolean;
460
491
  }
461
492
 
493
+ declare interface ExportZone {
494
+ x: number;
495
+ y: number;
496
+ width: number;
497
+ height: number;
498
+ }
499
+
462
500
  export declare interface FocusConnectorRef {
463
501
  from: string;
464
502
  to: string;
@@ -511,6 +549,14 @@ export declare function getThemeList(): {
511
549
  description: string;
512
550
  }[];
513
551
 
552
+ declare interface GridConfig {
553
+ enabled: boolean;
554
+ size: number;
555
+ color: string;
556
+ opacity: number;
557
+ type: 'dots' | 'lines';
558
+ }
559
+
514
560
  export declare type GroupLayoutDirection = 'horizontal' | 'vertical';
515
561
 
516
562
  declare type GroupLayoutDirection_2 = 'horizontal' | 'vertical';
@@ -628,6 +674,8 @@ declare const initialState: {
628
674
  };
629
675
  };
630
676
 
677
+ export declare function isDiagramShape(value: unknown): boolean;
678
+
631
679
  /** Preset HSL palettes matching Arc's diagram colors. */
632
680
  export declare const ISO_COLORS: {
633
681
  violet: IsoColorDef;
@@ -748,6 +796,8 @@ declare interface NodeData {
748
796
  subtitle?: string;
749
797
  description?: string;
750
798
  color: DiagramColor_2;
799
+ /** Per-node silhouette. Omit to follow the theme's own node shape. */
800
+ shape?: NodeShape;
751
801
  }
752
802
 
753
803
  export declare interface NodeLayoutHint {
@@ -783,11 +833,13 @@ declare interface NodePosition_2 {
783
833
  size: NodeSize_2;
784
834
  }
785
835
 
836
+ declare type NodeShape = 'rounded' | 'square' | 'chamfer' | 'notch' | 'pill';
837
+
786
838
  export declare type NodeSize = 'xs' | 's' | 'm' | 'l';
787
839
 
788
840
  declare type NodeSize_2 = 'xs' | 's' | 'm' | 'l';
789
841
 
790
- declare type NodeSize_3 = 'large' | 'normal' | 'small';
842
+ declare type NodeSize_3 = 'xs' | 's' | 'm' | 'l';
791
843
 
792
844
  /**
793
845
  * Parse YAML config into DiagramConfig
@@ -936,6 +988,10 @@ declare interface TitleBlockInfo {
936
988
  sheet?: string;
937
989
  }
938
990
 
991
+ export declare function toExportFormat(diagram: ArcDiagram_2): ArcDiagramData_2;
992
+
993
+ export declare function toTypeScriptSource(diagram: ArcDiagram_2, name?: string): string;
994
+
939
995
  export declare function useColorMode(): string;
940
996
 
941
997
  export declare function useDiagram(): {
@@ -1005,6 +1061,9 @@ export declare function useThemeId(): string;
1005
1061
 
1006
1062
  export declare function useViewMode(): string;
1007
1063
 
1064
+ /** Human-readable reason this is not a diagram, or null if it is. */
1065
+ export declare function validateDiagramShape(value: unknown): string | null;
1066
+
1008
1067
  export declare type ViewMode = '2d' | 'isometric';
1009
1068
 
1010
1069
  declare interface ZoomConfig {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arach/arc-iso",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",