@arach/arc-iso 0.4.5 → 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
@@ -22,7 +22,21 @@ 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, showFocusStory, 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, showLegend, showFocusStory, frame, hoverEffects, onNodeHover, titleBlock, maxFitZoom, }: ArcDiagramProps): JSX.Element;
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
+ }
26
40
 
27
41
  export declare interface ArcDiagramData {
28
42
  id?: string;
@@ -74,6 +88,8 @@ declare interface ArcDiagramProps {
74
88
  showControls?: boolean;
75
89
  /** Show a minimap overview (bottom-left). Default: false */
76
90
  showMinimap?: boolean;
91
+ /** Show a key for the connector styles and labelled groups (bottom-left). Default: false */
92
+ showLegend?: boolean;
77
93
  /** Show the active focus target's caption and steps. Default: false */
78
94
  showFocusStory?: boolean;
79
95
  /** Override the edge/frame treatment (else the theme's brand.frame). */
@@ -106,6 +122,8 @@ export declare interface ArcNodeData {
106
122
  subtitle?: string;
107
123
  description?: string;
108
124
  color: DiagramColor;
125
+ /** Per-node silhouette. Omit to follow the theme's own node shape. */
126
+ shape?: NodeShape;
109
127
  }
110
128
 
111
129
  export declare interface ArcNodePosition {
@@ -174,8 +192,11 @@ declare interface BrandSpec {
174
192
  frame?: 'hairline' | 'inset' | 'brackets' | 'ticks' | 'cropmarks' | 'corners' | 'sheet' | 'reticle' | 'none';
175
193
  /** Render an engineering-drawing title block in the bottom-right corner. */
176
194
  titleBlock?: boolean;
177
- /** Node silhouette when nodeRadius is not set explicitly. */
178
- nodeShape?: 'rounded' | 'square' | 'chamfer' | 'pill';
195
+ /** Node silhouette. 'chamfer' cuts all four corners, 'notch' cuts the top-right;
196
+ * both are drawn with clip-path, not rounding. See utils/nodeShape.ts. */
197
+ nodeShape?: 'rounded' | 'square' | 'chamfer' | 'notch' | 'pill';
198
+ /** Ornament on the node shell — supersedes accentBar, which still works. */
199
+ nodeDecor?: 'none' | 'bar-left' | 'bar-top' | 'ticks' | 'rule' | 'dot' | 'stripe';
179
200
  /** Overall node opacity (0–1). */
180
201
  nodeOpacity?: number;
181
202
  /** Frosted glass backdrop on nodes. */
@@ -277,7 +298,7 @@ export declare function deleteDiagramSession(id: string): void;
277
298
  /** Derive a URL-safe session ID from a diagram's source path or ID */
278
299
  export declare function deriveSessionId(source: string): string;
279
300
 
280
- 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;
281
302
 
282
303
  declare interface DiagramCanvasProps {
283
304
  onViewportChange?: (bounds: {
@@ -288,6 +309,10 @@ declare interface DiagramCanvasProps {
288
309
  }) => void;
289
310
  embedConfig?: EmbedConfig;
290
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';
291
316
  /** Override canvas background with an Arc theme. */
292
317
  themeOverride?: string;
293
318
  isDark?: boolean;
@@ -302,6 +327,8 @@ export declare interface DiagramConfig {
302
327
  title: string;
303
328
  description?: string;
304
329
  theme: 'dark' | 'light';
330
+ /** Render style: shaded solids, or a technical line-art plate. */
331
+ style?: IsoStyleId;
305
332
  canvas: {
306
333
  width: number;
307
334
  height: number;
@@ -329,6 +356,7 @@ declare interface DiagramConfig_2 {
329
356
  title: string;
330
357
  description: string;
331
358
  theme: 'dark' | 'light';
359
+ style?: 'solid' | 'blueprint' | 'cyanotype';
332
360
  canvas: {
333
361
  width: number;
334
362
  height: number;
@@ -360,6 +388,17 @@ export declare function DiagramEditor({ initialData, themeId, colorMode, session
360
388
  initialDiagramMeta?: Record<string, any>;
361
389
  }): JSX.Element;
362
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
+
363
402
  export declare interface DiagramLayout {
364
403
  width: number;
365
404
  height: number;
@@ -372,6 +411,8 @@ declare interface DiagramLayout_2 {
372
411
 
373
412
  export declare interface DiagramMeta {
374
413
  themeId?: string | null;
414
+ isoStyle?: IsoStyleId;
415
+ viewMode?: ViewMode;
375
416
  colorMode?: 'light' | 'dark';
376
417
  viewport?: {
377
418
  width: number;
@@ -438,6 +479,7 @@ export declare function EditorProvider({ children, initialDiagram, initialThemeI
438
479
 
439
480
  export declare interface EmbedConfig {
440
481
  defaultViewMode?: ViewMode;
482
+ defaultIsoStyle?: IsoStyleId;
441
483
  enableViewModeToggle?: boolean;
442
484
  enableZoom?: boolean;
443
485
  enablePan?: boolean;
@@ -448,6 +490,13 @@ export declare interface EmbedConfig {
448
490
  showGrid?: boolean;
449
491
  }
450
492
 
493
+ declare interface ExportZone {
494
+ x: number;
495
+ y: number;
496
+ width: number;
497
+ height: number;
498
+ }
499
+
451
500
  export declare interface FocusConnectorRef {
452
501
  from: string;
453
502
  to: string;
@@ -500,6 +549,14 @@ export declare function getThemeList(): {
500
549
  description: string;
501
550
  }[];
502
551
 
552
+ declare interface GridConfig {
553
+ enabled: boolean;
554
+ size: number;
555
+ color: string;
556
+ opacity: number;
557
+ type: 'dots' | 'lines';
558
+ }
559
+
503
560
  export declare type GroupLayoutDirection = 'horizontal' | 'vertical';
504
561
 
505
562
  declare type GroupLayoutDirection_2 = 'horizontal' | 'vertical';
@@ -601,6 +658,7 @@ declare const initialState: {
601
658
  template: string;
602
659
  zoom: number;
603
660
  viewMode: string;
661
+ isoStyle: string;
604
662
  themeId: string;
605
663
  colorMode: string;
606
664
  };
@@ -616,6 +674,8 @@ declare const initialState: {
616
674
  };
617
675
  };
618
676
 
677
+ export declare function isDiagramShape(value: unknown): boolean;
678
+
619
679
  /** Preset HSL palettes matching Arc's diagram colors. */
620
680
  export declare const ISO_COLORS: {
621
681
  violet: IsoColorDef;
@@ -686,6 +746,8 @@ declare interface IsoShadingResult {
686
746
  left: string;
687
747
  }
688
748
 
749
+ declare type IsoStyleId = 'solid' | 'blueprint' | 'cyanotype';
750
+
689
751
  /** Convert 3D isometric coordinates to 2D screen coordinates. */
690
752
  export declare function isoToScreen(x: number, y: number, z?: number): IsoScreenPoint;
691
753
 
@@ -734,6 +796,8 @@ declare interface NodeData {
734
796
  subtitle?: string;
735
797
  description?: string;
736
798
  color: DiagramColor_2;
799
+ /** Per-node silhouette. Omit to follow the theme's own node shape. */
800
+ shape?: NodeShape;
737
801
  }
738
802
 
739
803
  export declare interface NodeLayoutHint {
@@ -769,11 +833,13 @@ declare interface NodePosition_2 {
769
833
  size: NodeSize_2;
770
834
  }
771
835
 
836
+ declare type NodeShape = 'rounded' | 'square' | 'chamfer' | 'notch' | 'pill';
837
+
772
838
  export declare type NodeSize = 'xs' | 's' | 'm' | 'l';
773
839
 
774
840
  declare type NodeSize_2 = 'xs' | 's' | 'm' | 'l';
775
841
 
776
- declare type NodeSize_3 = 'large' | 'normal' | 'small';
842
+ declare type NodeSize_3 = 'xs' | 's' | 'm' | 'l';
777
843
 
778
844
  /**
779
845
  * Parse YAML config into DiagramConfig
@@ -881,9 +947,6 @@ export declare type ThemeId = 'default' | 'warm' | 'cool' | 'mono' | 'engineerin
881
947
 
882
948
  export declare const THEMES: Record<ThemeId, Theme>;
883
949
 
884
- /**
885
- * Arc Isometric Types
886
- */
887
950
  export declare interface TierConfig {
888
951
  name: string;
889
952
  elevation: number;
@@ -925,6 +988,10 @@ declare interface TitleBlockInfo {
925
988
  sheet?: string;
926
989
  }
927
990
 
991
+ export declare function toExportFormat(diagram: ArcDiagram_2): ArcDiagramData_2;
992
+
993
+ export declare function toTypeScriptSource(diagram: ArcDiagram_2, name?: string): string;
994
+
928
995
  export declare function useColorMode(): string;
929
996
 
930
997
  export declare function useDiagram(): {
@@ -971,6 +1038,7 @@ export declare function useEditorState(): {
971
1038
  template: string;
972
1039
  zoom: number;
973
1040
  viewMode: string;
1041
+ isoStyle: string;
974
1042
  themeId: string;
975
1043
  colorMode: string;
976
1044
  };
@@ -993,6 +1061,9 @@ export declare function useThemeId(): string;
993
1061
 
994
1062
  export declare function useViewMode(): string;
995
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
+
996
1067
  export declare type ViewMode = '2d' | 'isometric';
997
1068
 
998
1069
  declare interface ZoomConfig {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arach/arc-iso",
3
- "version": "0.4.5",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",