@arach/arc 0.1.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/README.md +60 -0
- package/dist/arc.es.js +9215 -0
- package/dist/arc.umd.js +172 -0
- package/dist/index.d.ts +152 -0
- package/package.json +81 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { default as ArcDiagram } from './player/ArcDiagram';
|
|
2
|
+
import { configToYaml } from './utils/yamlConfig';
|
|
3
|
+
import { default as DiagramCanvas } from './components/editor/DiagramCanvas';
|
|
4
|
+
import { default as DiagramEditor } from './components/editor/DiagramEditor';
|
|
5
|
+
import { EditorProvider } from './components/editor/EditorProvider';
|
|
6
|
+
import { getColorShading } from './utils/isometric';
|
|
7
|
+
import { ISO_COLORS } from './utils/isometric';
|
|
8
|
+
import { isoBoundingBox } from './utils/isometric';
|
|
9
|
+
import { isoBox } from './utils/isometric';
|
|
10
|
+
import { isoShading } from './utils/isometric';
|
|
11
|
+
import { isoToScreen } from './utils/isometric';
|
|
12
|
+
import { parseYamlConfig } from './utils/yamlConfig';
|
|
13
|
+
import { renderToElement } from './player/vanilla';
|
|
14
|
+
import { renderToString } from './player/vanilla';
|
|
15
|
+
import { screenToIsoFloor } from './utils/isometric';
|
|
16
|
+
import { useDiagram } from './components/editor/EditorProvider';
|
|
17
|
+
import { useEditor } from './components/editor/EditorProvider';
|
|
18
|
+
import { useEditorState } from './components/editor/EditorProvider';
|
|
19
|
+
import { useViewMode } from './components/editor/EditorProvider';
|
|
20
|
+
|
|
21
|
+
export { ArcDiagram }
|
|
22
|
+
|
|
23
|
+
export { configToYaml }
|
|
24
|
+
|
|
25
|
+
export declare interface ConnectorStyle {
|
|
26
|
+
color: string;
|
|
27
|
+
strokeWidth: number;
|
|
28
|
+
label?: string;
|
|
29
|
+
dashed?: boolean;
|
|
30
|
+
bidirectional?: boolean;
|
|
31
|
+
animated?: boolean;
|
|
32
|
+
showArrow?: boolean;
|
|
33
|
+
showEndpoints?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { DiagramCanvas }
|
|
37
|
+
|
|
38
|
+
export declare interface DiagramConfig {
|
|
39
|
+
id?: string;
|
|
40
|
+
title: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
theme: 'dark' | 'light';
|
|
43
|
+
canvas: {
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
};
|
|
47
|
+
origin: {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
};
|
|
51
|
+
cornerRadius?: number;
|
|
52
|
+
tiers: TierConfig[];
|
|
53
|
+
floorSize: {
|
|
54
|
+
width: number;
|
|
55
|
+
depth: number;
|
|
56
|
+
};
|
|
57
|
+
nodes: DiagramNode[];
|
|
58
|
+
pillars?: {
|
|
59
|
+
x: number;
|
|
60
|
+
y: number;
|
|
61
|
+
fromTier: number;
|
|
62
|
+
toTier: number;
|
|
63
|
+
}[];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { DiagramEditor }
|
|
67
|
+
|
|
68
|
+
export declare interface DiagramNode {
|
|
69
|
+
tier: number;
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
width: number;
|
|
73
|
+
depth: number;
|
|
74
|
+
height: number;
|
|
75
|
+
color: string;
|
|
76
|
+
label: string;
|
|
77
|
+
opacity?: number;
|
|
78
|
+
blur?: number;
|
|
79
|
+
translucent?: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export { EditorProvider }
|
|
83
|
+
|
|
84
|
+
export declare interface EmbedConfig {
|
|
85
|
+
defaultViewMode?: ViewMode;
|
|
86
|
+
enableViewModeToggle?: boolean;
|
|
87
|
+
enableZoom?: boolean;
|
|
88
|
+
enablePan?: boolean;
|
|
89
|
+
enableDrag?: boolean;
|
|
90
|
+
enableSelection?: boolean;
|
|
91
|
+
showZoomControls?: boolean;
|
|
92
|
+
showMiniMap?: boolean;
|
|
93
|
+
showGrid?: boolean;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { getColorShading }
|
|
97
|
+
|
|
98
|
+
export { ISO_COLORS }
|
|
99
|
+
|
|
100
|
+
export { isoBoundingBox }
|
|
101
|
+
|
|
102
|
+
export { isoBox }
|
|
103
|
+
|
|
104
|
+
export { isoShading }
|
|
105
|
+
|
|
106
|
+
export { isoToScreen }
|
|
107
|
+
|
|
108
|
+
export declare interface NodePosition {
|
|
109
|
+
x: number;
|
|
110
|
+
y: number;
|
|
111
|
+
size: NodeSize;
|
|
112
|
+
width?: number;
|
|
113
|
+
height?: number;
|
|
114
|
+
z?: number;
|
|
115
|
+
isoHeight?: number;
|
|
116
|
+
isoDepth?: number;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
declare type NodeSize = 'large' | 'normal' | 'small';
|
|
120
|
+
|
|
121
|
+
export { parseYamlConfig }
|
|
122
|
+
|
|
123
|
+
export { renderToElement }
|
|
124
|
+
|
|
125
|
+
export { renderToString }
|
|
126
|
+
|
|
127
|
+
export { screenToIsoFloor }
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Arc Player Types
|
|
131
|
+
*/
|
|
132
|
+
export declare interface TierConfig {
|
|
133
|
+
name: string;
|
|
134
|
+
elevation: number;
|
|
135
|
+
floorColor?: string;
|
|
136
|
+
floorOpacity?: number;
|
|
137
|
+
borderColor?: string;
|
|
138
|
+
nodeOpacity?: number;
|
|
139
|
+
blur?: number;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export { useDiagram }
|
|
143
|
+
|
|
144
|
+
export { useEditor }
|
|
145
|
+
|
|
146
|
+
export { useEditorState }
|
|
147
|
+
|
|
148
|
+
export { useViewMode }
|
|
149
|
+
|
|
150
|
+
export declare type ViewMode = '2d' | 'isometric';
|
|
151
|
+
|
|
152
|
+
export { }
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@arach/arc",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Visual diagram editor for creating architecture diagrams",
|
|
6
|
+
"author": "Arach Tchoupani",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/arach/arc.git"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"diagram",
|
|
14
|
+
"editor",
|
|
15
|
+
"architecture",
|
|
16
|
+
"visualization",
|
|
17
|
+
"react",
|
|
18
|
+
"isometric"
|
|
19
|
+
],
|
|
20
|
+
"files": [
|
|
21
|
+
"dist/arc.es.js",
|
|
22
|
+
"dist/arc.umd.js",
|
|
23
|
+
"dist/index.d.ts"
|
|
24
|
+
],
|
|
25
|
+
"main": "./dist/arc.umd.js",
|
|
26
|
+
"module": "./dist/arc.es.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/arc.es.js",
|
|
32
|
+
"require": "./dist/arc.umd.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"sideEffects": false,
|
|
36
|
+
"scripts": {
|
|
37
|
+
"dev": "vite",
|
|
38
|
+
"build": "tsc && vite build",
|
|
39
|
+
"build:lib": "vite build --config vite.config.lib.js",
|
|
40
|
+
"build:player": "vite build --config vite.config.player.js && vite build --config vite.config.player-slim.js",
|
|
41
|
+
"lint": "eslint .",
|
|
42
|
+
"typecheck": "tsc --noEmit",
|
|
43
|
+
"preview": "vite preview",
|
|
44
|
+
"generate-og": "node scripts/generate-og.js",
|
|
45
|
+
"prepublishOnly": "pnpm build:lib"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
49
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@base-ui/react": "^1.0.0",
|
|
53
|
+
"@types/three": "^0.182.0",
|
|
54
|
+
"js-yaml": "^4.1.1",
|
|
55
|
+
"react": "^19.2.0",
|
|
56
|
+
"react-dom": "^19.2.0",
|
|
57
|
+
"react-router-dom": "^7.12.0",
|
|
58
|
+
"three": "^0.182.0"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@eslint/js": "^9.39.1",
|
|
62
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
63
|
+
"@types/js-yaml": "^4.0.9",
|
|
64
|
+
"@types/react": "^19.2.5",
|
|
65
|
+
"@types/react-dom": "^19.2.3",
|
|
66
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
67
|
+
"eslint": "^9.39.1",
|
|
68
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
69
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
70
|
+
"globals": "^16.5.0",
|
|
71
|
+
"lucide-react": "^0.562.0",
|
|
72
|
+
"puppeteer": "^24.34.0",
|
|
73
|
+
"rollup-plugin-visualizer": "^6.0.5",
|
|
74
|
+
"satori": "^0.18.3",
|
|
75
|
+
"sharp": "^0.34.5",
|
|
76
|
+
"tailwindcss": "^4.1.18",
|
|
77
|
+
"typescript": "^5.9.3",
|
|
78
|
+
"vite": "^7.2.4",
|
|
79
|
+
"vite-plugin-dts": "^4.5.4"
|
|
80
|
+
}
|
|
81
|
+
}
|