@arach/arc-iso 0.4.4 → 0.5.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/arc-iso-slim.es.js +1102 -440
- package/dist/arc-iso-slim.umd.js +7 -7
- package/dist/arc-iso.es.js +1991 -1328
- package/dist/arc-iso.umd.js +37 -37
- package/dist/index.d.ts +151 -7
- 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, showLegend, 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,10 @@ declare interface ArcDiagramProps {
|
|
|
67
74
|
showControls?: boolean;
|
|
68
75
|
/** Show a minimap overview (bottom-left). Default: false */
|
|
69
76
|
showMinimap?: boolean;
|
|
77
|
+
/** Show a key for the connector styles and labelled groups (bottom-left). Default: false */
|
|
78
|
+
showLegend?: boolean;
|
|
79
|
+
/** Show the active focus target's caption and steps. Default: false */
|
|
80
|
+
showFocusStory?: boolean;
|
|
70
81
|
/** Override the edge/frame treatment (else the theme's brand.frame). */
|
|
71
82
|
frame?: BrandSpec['frame'];
|
|
72
83
|
/** Control hover behavior. true = all effects (default), false = none, object = granular control */
|
|
@@ -124,6 +135,8 @@ export declare interface AsciiOptions {
|
|
|
124
135
|
* Generate a diagram from minimal input — no positions or anchors needed.
|
|
125
136
|
*/
|
|
126
137
|
export declare interface AutoDiagramInput {
|
|
138
|
+
layoutHints?: ArcDiagramData_2['layoutHints'];
|
|
139
|
+
groups?: ArcDiagramData_2['groups'];
|
|
127
140
|
nodeData: ArcDiagramData_2['nodeData'];
|
|
128
141
|
connectors: Array<Omit<Connector, 'fromAnchor' | 'toAnchor'> & {
|
|
129
142
|
fromAnchor?: AnchorPosition_2;
|
|
@@ -163,8 +176,11 @@ declare interface BrandSpec {
|
|
|
163
176
|
frame?: 'hairline' | 'inset' | 'brackets' | 'ticks' | 'cropmarks' | 'corners' | 'sheet' | 'reticle' | 'none';
|
|
164
177
|
/** Render an engineering-drawing title block in the bottom-right corner. */
|
|
165
178
|
titleBlock?: boolean;
|
|
166
|
-
/** Node silhouette
|
|
167
|
-
|
|
179
|
+
/** Node silhouette. 'chamfer' cuts all four corners, 'notch' cuts the top-right;
|
|
180
|
+
* both are drawn with clip-path, not rounding. See utils/nodeShape.ts. */
|
|
181
|
+
nodeShape?: 'rounded' | 'square' | 'chamfer' | 'notch' | 'pill';
|
|
182
|
+
/** Ornament on the node shell — supersedes accentBar, which still works. */
|
|
183
|
+
nodeDecor?: 'none' | 'bar-left' | 'bar-top' | 'ticks' | 'rule' | 'dot' | 'stripe';
|
|
168
184
|
/** Overall node opacity (0–1). */
|
|
169
185
|
nodeOpacity?: number;
|
|
170
186
|
/** Frosted glass backdrop on nodes. */
|
|
@@ -291,6 +307,8 @@ export declare interface DiagramConfig {
|
|
|
291
307
|
title: string;
|
|
292
308
|
description?: string;
|
|
293
309
|
theme: 'dark' | 'light';
|
|
310
|
+
/** Render style: shaded solids, or a technical line-art plate. */
|
|
311
|
+
style?: IsoStyleId;
|
|
294
312
|
canvas: {
|
|
295
313
|
width: number;
|
|
296
314
|
height: number;
|
|
@@ -318,6 +336,7 @@ declare interface DiagramConfig_2 {
|
|
|
318
336
|
title: string;
|
|
319
337
|
description: string;
|
|
320
338
|
theme: 'dark' | 'light';
|
|
339
|
+
style?: 'solid' | 'blueprint' | 'cyanotype';
|
|
321
340
|
canvas: {
|
|
322
341
|
width: number;
|
|
323
342
|
height: number;
|
|
@@ -361,6 +380,8 @@ declare interface DiagramLayout_2 {
|
|
|
361
380
|
|
|
362
381
|
export declare interface DiagramMeta {
|
|
363
382
|
themeId?: string | null;
|
|
383
|
+
isoStyle?: IsoStyleId;
|
|
384
|
+
viewMode?: ViewMode;
|
|
364
385
|
colorMode?: 'light' | 'dark';
|
|
365
386
|
viewport?: {
|
|
366
387
|
width: number;
|
|
@@ -427,6 +448,7 @@ export declare function EditorProvider({ children, initialDiagram, initialThemeI
|
|
|
427
448
|
|
|
428
449
|
export declare interface EmbedConfig {
|
|
429
450
|
defaultViewMode?: ViewMode;
|
|
451
|
+
defaultIsoStyle?: IsoStyleId;
|
|
430
452
|
enableViewModeToggle?: boolean;
|
|
431
453
|
enableZoom?: boolean;
|
|
432
454
|
enablePan?: boolean;
|
|
@@ -437,6 +459,44 @@ export declare interface EmbedConfig {
|
|
|
437
459
|
showGrid?: boolean;
|
|
438
460
|
}
|
|
439
461
|
|
|
462
|
+
export declare interface FocusConnectorRef {
|
|
463
|
+
from: string;
|
|
464
|
+
to: string;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
declare interface FocusConnectorRef_2 {
|
|
468
|
+
from: string;
|
|
469
|
+
to: string;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
export declare interface FocusStep {
|
|
473
|
+
icon: string;
|
|
474
|
+
label: string;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
declare interface FocusStep_2 {
|
|
478
|
+
icon: string;
|
|
479
|
+
label: string;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
export declare interface FocusTarget {
|
|
483
|
+
mode?: 'append' | 'replace';
|
|
484
|
+
nodes?: string[];
|
|
485
|
+
connectors?: FocusConnectorRef[];
|
|
486
|
+
caption?: string;
|
|
487
|
+
steps?: FocusStep[];
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/** A declarative highlight story activated by hovering or selecting a node. */
|
|
491
|
+
declare interface FocusTarget_2 {
|
|
492
|
+
/** `append` includes direct neighbors; `replace` uses only the explicit story. */
|
|
493
|
+
mode?: 'append' | 'replace';
|
|
494
|
+
nodes?: string[];
|
|
495
|
+
connectors?: FocusConnectorRef_2[];
|
|
496
|
+
caption?: string;
|
|
497
|
+
steps?: FocusStep_2[];
|
|
498
|
+
}
|
|
499
|
+
|
|
440
500
|
/** Generate a short session ID (first 8 hex chars of a UUID for brevity in URLs) */
|
|
441
501
|
export declare function generateSessionId(): string;
|
|
442
502
|
|
|
@@ -451,6 +511,54 @@ export declare function getThemeList(): {
|
|
|
451
511
|
description: string;
|
|
452
512
|
}[];
|
|
453
513
|
|
|
514
|
+
export declare type GroupLayoutDirection = 'horizontal' | 'vertical';
|
|
515
|
+
|
|
516
|
+
declare type GroupLayoutDirection_2 = 'horizontal' | 'vertical';
|
|
517
|
+
|
|
518
|
+
export declare interface GroupLayoutHint {
|
|
519
|
+
direction?: GroupLayoutDirection;
|
|
520
|
+
padding?: number;
|
|
521
|
+
layerGap?: number;
|
|
522
|
+
itemGap?: number;
|
|
523
|
+
align?: LayoutAlignment;
|
|
524
|
+
justify?: LayoutAlignment | 'space-between';
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/** Layout policy for the nodes inside one group frame. */
|
|
528
|
+
declare interface GroupLayoutHint_2 {
|
|
529
|
+
/** `horizontal` lays layers left-to-right; `vertical` lays them top-to-bottom. */
|
|
530
|
+
direction?: GroupLayoutDirection_2;
|
|
531
|
+
padding?: number;
|
|
532
|
+
layerGap?: number;
|
|
533
|
+
itemGap?: number;
|
|
534
|
+
align?: LayoutAlignment_2;
|
|
535
|
+
justify?: LayoutAlignment_2 | 'space-between';
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export declare interface GroupShape {
|
|
539
|
+
id: string;
|
|
540
|
+
x: number;
|
|
541
|
+
y: number;
|
|
542
|
+
width: number;
|
|
543
|
+
height: number;
|
|
544
|
+
type: 'rect' | 'circle';
|
|
545
|
+
color: DiagramColor;
|
|
546
|
+
label?: string;
|
|
547
|
+
dashed?: boolean;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
declare interface GroupShape_2 {
|
|
551
|
+
id: string;
|
|
552
|
+
x: number;
|
|
553
|
+
y: number;
|
|
554
|
+
width: number;
|
|
555
|
+
height: number;
|
|
556
|
+
type: 'rect' | 'circle';
|
|
557
|
+
color: DiagramColor_2;
|
|
558
|
+
label?: string;
|
|
559
|
+
dashed?: boolean;
|
|
560
|
+
}
|
|
561
|
+
|
|
454
562
|
declare interface HoverEffectsConfig {
|
|
455
563
|
/** Dim unrelated nodes/connectors. Default: true */
|
|
456
564
|
dim?: boolean;
|
|
@@ -504,6 +612,7 @@ declare const initialState: {
|
|
|
504
612
|
template: string;
|
|
505
613
|
zoom: number;
|
|
506
614
|
viewMode: string;
|
|
615
|
+
isoStyle: string;
|
|
507
616
|
themeId: string;
|
|
508
617
|
colorMode: string;
|
|
509
618
|
};
|
|
@@ -589,6 +698,8 @@ declare interface IsoShadingResult {
|
|
|
589
698
|
left: string;
|
|
590
699
|
}
|
|
591
700
|
|
|
701
|
+
declare type IsoStyleId = 'solid' | 'blueprint' | 'cyanotype';
|
|
702
|
+
|
|
592
703
|
/** Convert 3D isometric coordinates to 2D screen coordinates. */
|
|
593
704
|
export declare function isoToScreen(x: number, y: number, z?: number): IsoScreenPoint;
|
|
594
705
|
|
|
@@ -596,6 +707,20 @@ declare type LabelAlign = 'left' | 'right' | 'center';
|
|
|
596
707
|
|
|
597
708
|
declare type LabelCorner = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
598
709
|
|
|
710
|
+
export declare type LayoutAlignment = 'start' | 'center' | 'end';
|
|
711
|
+
|
|
712
|
+
declare type LayoutAlignment_2 = 'start' | 'center' | 'end';
|
|
713
|
+
|
|
714
|
+
export declare interface LayoutHints {
|
|
715
|
+
nodes?: Record<string, NodeLayoutHint>;
|
|
716
|
+
groups?: Record<string, GroupLayoutHint>;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
declare interface LayoutHints_2 {
|
|
720
|
+
nodes?: Record<string, NodeLayoutHint_2>;
|
|
721
|
+
groups?: Record<string, GroupLayoutHint_2>;
|
|
722
|
+
}
|
|
723
|
+
|
|
599
724
|
declare interface LayoutOptions {
|
|
600
725
|
/** Horizontal gap between columns */
|
|
601
726
|
columnGap?: number;
|
|
@@ -625,6 +750,22 @@ declare interface NodeData {
|
|
|
625
750
|
color: DiagramColor_2;
|
|
626
751
|
}
|
|
627
752
|
|
|
753
|
+
export declare interface NodeLayoutHint {
|
|
754
|
+
group?: string;
|
|
755
|
+
layer?: number;
|
|
756
|
+
order?: number;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/** Optional placement hints used by autoLayout when nodes belong to groups. */
|
|
760
|
+
declare interface NodeLayoutHint_2 {
|
|
761
|
+
/** ID of the group frame that owns this node. */
|
|
762
|
+
group?: string;
|
|
763
|
+
/** Explicit layer within the group. Connected nodes are layered automatically otherwise. */
|
|
764
|
+
layer?: number;
|
|
765
|
+
/** Stable ordering within a layer. Lower values render first. */
|
|
766
|
+
order?: number;
|
|
767
|
+
}
|
|
768
|
+
|
|
628
769
|
export declare interface NodePosition {
|
|
629
770
|
x: number;
|
|
630
771
|
y: number;
|
|
@@ -644,7 +785,7 @@ declare interface NodePosition_2 {
|
|
|
644
785
|
|
|
645
786
|
export declare type NodeSize = 'xs' | 's' | 'm' | 'l';
|
|
646
787
|
|
|
647
|
-
declare type NodeSize_2 = 's' | 'm' | 'l';
|
|
788
|
+
declare type NodeSize_2 = 'xs' | 's' | 'm' | 'l';
|
|
648
789
|
|
|
649
790
|
declare type NodeSize_3 = 'large' | 'normal' | 'small';
|
|
650
791
|
|
|
@@ -704,6 +845,11 @@ export declare function renderToElement(container: HTMLElement, config: DiagramC
|
|
|
704
845
|
*/
|
|
705
846
|
export declare function renderToString(config: DiagramConfig): string;
|
|
706
847
|
|
|
848
|
+
export declare function resolveFocusState(activeNodeId: string | null, connectors: ArcConnector[], focusTargets?: Record<string, FocusTarget>): {
|
|
849
|
+
nodeIds: Set<string>;
|
|
850
|
+
connectorIndexes: Set<number>;
|
|
851
|
+
};
|
|
852
|
+
|
|
707
853
|
/** Save a diagram session to localStorage */
|
|
708
854
|
export declare function saveDiagramSession(id: string, data: Omit<DiagramSession, 'updatedAt'>): void;
|
|
709
855
|
|
|
@@ -749,9 +895,6 @@ export declare type ThemeId = 'default' | 'warm' | 'cool' | 'mono' | 'engineerin
|
|
|
749
895
|
|
|
750
896
|
export declare const THEMES: Record<ThemeId, Theme>;
|
|
751
897
|
|
|
752
|
-
/**
|
|
753
|
-
* Arc Isometric Types
|
|
754
|
-
*/
|
|
755
898
|
export declare interface TierConfig {
|
|
756
899
|
name: string;
|
|
757
900
|
elevation: number;
|
|
@@ -839,6 +982,7 @@ export declare function useEditorState(): {
|
|
|
839
982
|
template: string;
|
|
840
983
|
zoom: number;
|
|
841
984
|
viewMode: string;
|
|
985
|
+
isoStyle: string;
|
|
842
986
|
themeId: string;
|
|
843
987
|
colorMode: string;
|
|
844
988
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arach/arc-iso",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
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",
|