@isothrum/editor 0.0.0-stage → 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.
Files changed (293) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/PUBLISHING.md +93 -0
  4. package/README.md +106 -2
  5. package/desktop-editor/editor.css +11 -0
  6. package/desktop-editor/index.html +14 -0
  7. package/desktop-editor/main.tsx +26 -0
  8. package/dist/desktop/editor.css +1 -0
  9. package/dist/desktop/editor.js +181 -0
  10. package/dist/desktop/fonts/geist-cyrillic-ext-wght-normal-RO72NYA2.woff2 +0 -0
  11. package/dist/desktop/fonts/geist-cyrillic-wght-normal-CK2XY27K.woff2 +0 -0
  12. package/dist/desktop/fonts/geist-latin-ext-wght-normal-XEQ56JUF.woff2 +0 -0
  13. package/dist/desktop/fonts/geist-latin-wght-normal-T72VVCUW.woff2 +0 -0
  14. package/dist/desktop/fonts/geist-mono-cyrillic-ext-wght-normal-QXKVIKFD.woff2 +0 -0
  15. package/dist/desktop/fonts/geist-mono-cyrillic-wght-normal-GOIAQAGU.woff2 +0 -0
  16. package/dist/desktop/fonts/geist-mono-latin-ext-wght-normal-HU3ZAWN6.woff2 +0 -0
  17. package/dist/desktop/fonts/geist-mono-latin-wght-normal-CJNQKXUG.woff2 +0 -0
  18. package/dist/desktop/fonts/geist-mono-symbols2-wght-normal-WZJJVLQO.woff2 +0 -0
  19. package/dist/desktop/fonts/geist-mono-vietnamese-wght-normal-KW5NM6YV.woff2 +0 -0
  20. package/dist/desktop/fonts/geist-vietnamese-wght-normal-Y2R7JZKV.woff2 +0 -0
  21. package/dist/desktop/fonts/shantell-sans-cyrillic-ext-wght-normal-ILPQWRJJ.woff2 +0 -0
  22. package/dist/desktop/fonts/shantell-sans-cyrillic-wght-normal-RKC6NDPM.woff2 +0 -0
  23. package/dist/desktop/fonts/shantell-sans-latin-ext-wght-normal-SNKHG3LM.woff2 +0 -0
  24. package/dist/desktop/fonts/shantell-sans-latin-wght-normal-7CHHGC3N.woff2 +0 -0
  25. package/dist/desktop/fonts/shantell-sans-vietnamese-wght-normal-IPFAQSBA.woff2 +0 -0
  26. package/dist/desktop/index.html +14 -0
  27. package/dist/desktop/styles.css +2 -0
  28. package/dist/desktop/wasm/isothrum_wasm.d.ts +60 -0
  29. package/dist/desktop/wasm/isothrum_wasm.js +312 -0
  30. package/dist/desktop/wasm/isothrum_wasm_bg.wasm +0 -0
  31. package/dist/index.js +7059 -0
  32. package/dist/index.js.map +7 -0
  33. package/dist/model.js +745 -0
  34. package/dist/model.js.map +7 -0
  35. package/dist/types/components/tool/canvas/cable-edge.d.ts +4 -0
  36. package/dist/types/components/tool/canvas/contexts.d.ts +12 -0
  37. package/dist/types/components/tool/canvas/device-icon.d.ts +17 -0
  38. package/dist/types/components/tool/canvas/inline-text.d.ts +15 -0
  39. package/dist/types/components/tool/canvas/lan-node.d.ts +8 -0
  40. package/dist/types/components/tool/canvas/machine-addresses.d.ts +14 -0
  41. package/dist/types/components/tool/canvas/machine-node.d.ts +4 -0
  42. package/dist/types/components/tool/canvas/note-node.d.ts +7 -0
  43. package/dist/types/components/tool/canvas/port-led.d.ts +10 -0
  44. package/dist/types/components/tool/canvas/router-node.d.ts +8 -0
  45. package/dist/types/components/tool/canvas/sketch.d.ts +50 -0
  46. package/dist/types/components/tool/canvas/status-dot.d.ts +5 -0
  47. package/dist/types/components/tool/canvas/switch-node.d.ts +8 -0
  48. package/dist/types/components/tool/canvas/use-measured-ports.d.ts +7 -0
  49. package/dist/types/components/tool/context-menus.d.ts +5 -0
  50. package/dist/types/components/tool/device-block.d.ts +12 -0
  51. package/dist/types/components/tool/editor-menu.d.ts +28 -0
  52. package/dist/types/components/tool/export/copy-button.d.ts +9 -0
  53. package/dist/types/components/tool/export/export-panel.d.ts +17 -0
  54. package/dist/types/components/tool/export/target-list.d.ts +15 -0
  55. package/dist/types/components/tool/floating-window.d.ts +13 -0
  56. package/dist/types/components/tool/flow-canvas.d.ts +6 -0
  57. package/dist/types/components/tool/hooks/use-cabling.d.ts +23 -0
  58. package/dist/types/components/tool/hooks/use-captures.d.ts +9 -0
  59. package/dist/types/components/tool/hooks/use-clipboard.d.ts +12 -0
  60. package/dist/types/components/tool/hooks/use-context-menus.d.ts +25 -0
  61. package/dist/types/components/tool/hooks/use-design.d.ts +10 -0
  62. package/dist/types/components/tool/hooks/use-desktop.d.ts +50 -0
  63. package/dist/types/components/tool/hooks/use-devices.d.ts +17 -0
  64. package/dist/types/components/tool/hooks/use-downloads.d.ts +9 -0
  65. package/dist/types/components/tool/hooks/use-editor.d.ts +609 -0
  66. package/dist/types/components/tool/hooks/use-engine.d.ts +9 -0
  67. package/dist/types/components/tool/hooks/use-history.d.ts +9 -0
  68. package/dist/types/components/tool/hooks/use-lab-actions.d.ts +25 -0
  69. package/dist/types/components/tool/hooks/use-lab-run.d.ts +25 -0
  70. package/dist/types/components/tool/hooks/use-lab.d.ts +18 -0
  71. package/dist/types/components/tool/hooks/use-lan-carry.d.ts +8 -0
  72. package/dist/types/components/tool/hooks/use-machine-actions.d.ts +26 -0
  73. package/dist/types/components/tool/hooks/use-placement.d.ts +27 -0
  74. package/dist/types/components/tool/hooks/use-project.d.ts +25 -0
  75. package/dist/types/components/tool/hooks/use-projects.d.ts +34 -0
  76. package/dist/types/components/tool/hooks/use-shared-link.d.ts +23 -0
  77. package/dist/types/components/tool/hooks/use-toast.d.ts +2 -0
  78. package/dist/types/components/tool/hooks/use-tools.d.ts +17 -0
  79. package/dist/types/components/tool/lab-canvas.d.ts +18 -0
  80. package/dist/types/components/tool/overlays.d.ts +5 -0
  81. package/dist/types/components/tool/projects-list.d.ts +9 -0
  82. package/dist/types/components/tool/text.d.ts +418 -0
  83. package/dist/types/components/tool/toolbar.d.ts +5 -0
  84. package/dist/types/components/tool/top-bars.d.ts +10 -0
  85. package/dist/types/components/tool/windows/conditions-fields.d.ts +6 -0
  86. package/dist/types/components/tool/windows/editor-windows.d.ts +5 -0
  87. package/dist/types/components/tool/windows/fields.d.ts +4 -0
  88. package/dist/types/components/tool/windows/lab-status.d.ts +6 -0
  89. package/dist/types/components/tool/windows/lab-windows.d.ts +13 -0
  90. package/dist/types/components/tool/windows/link-controls.d.ts +21 -0
  91. package/dist/types/components/tool/windows/machine-controls.d.ts +16 -0
  92. package/dist/types/components/tool/windows/machine-inspector.d.ts +11 -0
  93. package/dist/types/components/tool/windows/runs-fields.d.ts +18 -0
  94. package/dist/types/components/tool/windows/selected-windows.d.ts +21 -0
  95. package/dist/types/components/ui/button.d.ts +8 -0
  96. package/dist/types/components/ui/dropdown-menu.d.ts +21 -0
  97. package/dist/types/index.d.ts +7 -0
  98. package/dist/types/lib/auth.d.ts +38 -0
  99. package/dist/types/lib/brand.d.ts +19 -0
  100. package/dist/types/lib/i18n.d.ts +19 -0
  101. package/dist/types/lib/tool/blocks.d.ts +35 -0
  102. package/dist/types/lib/tool/cables.d.ts +48 -0
  103. package/dist/types/lib/tool/clone.d.ts +12 -0
  104. package/dist/types/lib/tool/conditions.d.ts +31 -0
  105. package/dist/types/lib/tool/create.d.ts +22 -0
  106. package/dist/types/lib/tool/desktop.d.ts +63 -0
  107. package/dist/types/lib/tool/draft.d.ts +20 -0
  108. package/dist/types/lib/tool/engine.d.ts +33 -0
  109. package/dist/types/lib/tool/examples.d.ts +11 -0
  110. package/dist/types/lib/tool/export-targets.d.ts +21 -0
  111. package/dist/types/lib/tool/facing.d.ts +9 -0
  112. package/dist/types/lib/tool/geometry.d.ts +36 -0
  113. package/dist/types/lib/tool/gns3-cables.d.ts +17 -0
  114. package/dist/types/lib/tool/gns3-import.d.ts +15 -0
  115. package/dist/types/lib/tool/gns3-parts.d.ts +25 -0
  116. package/dist/types/lib/tool/issues.d.ts +12 -0
  117. package/dist/types/lib/tool/layout.d.ts +52 -0
  118. package/dist/types/lib/tool/live.d.ts +21 -0
  119. package/dist/types/lib/tool/logos.d.ts +7 -0
  120. package/dist/types/lib/tool/model.d.ts +173 -0
  121. package/dist/types/lib/tool/os.d.ts +20 -0
  122. package/dist/types/lib/tool/pins.d.ts +5 -0
  123. package/dist/types/lib/tool/placement.d.ts +21 -0
  124. package/dist/types/lib/tool/ports.d.ts +21 -0
  125. package/dist/types/lib/tool/presets.d.ts +21 -0
  126. package/dist/types/lib/tool/projects-api.d.ts +37 -0
  127. package/dist/types/lib/tool/router-ports.d.ts +22 -0
  128. package/dist/types/lib/tool/selection.d.ts +19 -0
  129. package/dist/types/lib/tool/storage.d.ts +25 -0
  130. package/dist/types/lib/tool/switch-edit.d.ts +17 -0
  131. package/dist/types/lib/tool/text/de.d.ts +2 -0
  132. package/dist/types/lib/tool/text/en.d.ts +429 -0
  133. package/dist/types/lib/tool/text/es.d.ts +2 -0
  134. package/dist/types/lib/tool/text/fr.d.ts +2 -0
  135. package/dist/types/lib/tool/text/index.d.ts +419 -0
  136. package/dist/types/lib/tool/topology.d.ts +2 -0
  137. package/dist/types/lib/tool/vlans.d.ts +24 -0
  138. package/dist/types/lib/utils.d.ts +2 -0
  139. package/dist/types/model.d.ts +13 -0
  140. package/package.json +88 -4
  141. package/scripts/build-desktop-editor.mjs +43 -0
  142. package/scripts/build-lib.mjs +38 -0
  143. package/src/components/tool/canvas/cable-edge.tsx +112 -0
  144. package/src/components/tool/canvas/contexts.ts +18 -0
  145. package/src/components/tool/canvas/device-icon.tsx +105 -0
  146. package/src/components/tool/canvas/inline-text.tsx +69 -0
  147. package/src/components/tool/canvas/lan-node.tsx +148 -0
  148. package/src/components/tool/canvas/machine-addresses.tsx +117 -0
  149. package/src/components/tool/canvas/machine-node.tsx +114 -0
  150. package/src/components/tool/canvas/note-node.tsx +109 -0
  151. package/src/components/tool/canvas/port-led.tsx +21 -0
  152. package/src/components/tool/canvas/router-node.tsx +114 -0
  153. package/src/components/tool/canvas/sketch.tsx +130 -0
  154. package/src/components/tool/canvas/status-dot.tsx +29 -0
  155. package/src/components/tool/canvas/switch-node.tsx +143 -0
  156. package/src/components/tool/canvas/use-measured-ports.ts +25 -0
  157. package/src/components/tool/context-menus.tsx +142 -0
  158. package/src/components/tool/device-block.tsx +107 -0
  159. package/src/components/tool/editor-menu.tsx +191 -0
  160. package/src/components/tool/export/copy-button.tsx +45 -0
  161. package/src/components/tool/export/export-panel.tsx +127 -0
  162. package/src/components/tool/export/target-list.tsx +87 -0
  163. package/src/components/tool/floating-window.tsx +69 -0
  164. package/src/components/tool/flow-canvas.tsx +138 -0
  165. package/src/components/tool/hooks/use-cabling.ts +66 -0
  166. package/src/components/tool/hooks/use-captures.ts +24 -0
  167. package/src/components/tool/hooks/use-clipboard.ts +54 -0
  168. package/src/components/tool/hooks/use-context-menus.ts +37 -0
  169. package/src/components/tool/hooks/use-design.ts +24 -0
  170. package/src/components/tool/hooks/use-desktop.ts +100 -0
  171. package/src/components/tool/hooks/use-devices.ts +58 -0
  172. package/src/components/tool/hooks/use-downloads.ts +42 -0
  173. package/src/components/tool/hooks/use-editor.ts +114 -0
  174. package/src/components/tool/hooks/use-engine.ts +29 -0
  175. package/src/components/tool/hooks/use-history.ts +107 -0
  176. package/src/components/tool/hooks/use-lab-actions.ts +57 -0
  177. package/src/components/tool/hooks/use-lab-run.ts +61 -0
  178. package/src/components/tool/hooks/use-lab.ts +32 -0
  179. package/src/components/tool/hooks/use-lan-carry.ts +43 -0
  180. package/src/components/tool/hooks/use-machine-actions.ts +57 -0
  181. package/src/components/tool/hooks/use-placement.ts +80 -0
  182. package/src/components/tool/hooks/use-project.ts +112 -0
  183. package/src/components/tool/hooks/use-projects.ts +85 -0
  184. package/src/components/tool/hooks/use-shared-link.ts +64 -0
  185. package/src/components/tool/hooks/use-toast.ts +16 -0
  186. package/src/components/tool/hooks/use-tools.ts +60 -0
  187. package/src/components/tool/lab-canvas.tsx +96 -0
  188. package/src/components/tool/overlays.tsx +104 -0
  189. package/src/components/tool/projects-list.tsx +96 -0
  190. package/src/components/tool/text.ts +9 -0
  191. package/src/components/tool/toolbar.tsx +106 -0
  192. package/src/components/tool/top-bars.tsx +90 -0
  193. package/src/components/tool/windows/conditions-fields.tsx +43 -0
  194. package/src/components/tool/windows/editor-windows.tsx +73 -0
  195. package/src/components/tool/windows/fields.ts +6 -0
  196. package/src/components/tool/windows/lab-status.tsx +68 -0
  197. package/src/components/tool/windows/lab-windows.tsx +130 -0
  198. package/src/components/tool/windows/link-controls.tsx +69 -0
  199. package/src/components/tool/windows/machine-controls.tsx +116 -0
  200. package/src/components/tool/windows/machine-inspector.tsx +83 -0
  201. package/src/components/tool/windows/runs-fields.tsx +127 -0
  202. package/src/components/tool/windows/selected-windows.tsx +147 -0
  203. package/src/components/ui/button.tsx +59 -0
  204. package/src/components/ui/dropdown-menu.tsx +185 -0
  205. package/src/index.ts +21 -0
  206. package/src/lib/auth.tsx +43 -0
  207. package/src/lib/brand.tsx +46 -0
  208. package/src/lib/i18n.ts +53 -0
  209. package/src/lib/tool/blocks.test.ts +64 -0
  210. package/src/lib/tool/blocks.ts +78 -0
  211. package/src/lib/tool/cable-wiring.test.ts +74 -0
  212. package/src/lib/tool/cables.test.ts +75 -0
  213. package/src/lib/tool/cables.ts +215 -0
  214. package/src/lib/tool/clone.test.ts +54 -0
  215. package/src/lib/tool/clone.ts +48 -0
  216. package/src/lib/tool/conditions.test.ts +170 -0
  217. package/src/lib/tool/conditions.ts +132 -0
  218. package/src/lib/tool/create.test.ts +67 -0
  219. package/src/lib/tool/create.ts +83 -0
  220. package/src/lib/tool/desktop.test.ts +59 -0
  221. package/src/lib/tool/desktop.ts +99 -0
  222. package/src/lib/tool/draft.test.ts +150 -0
  223. package/src/lib/tool/draft.ts +109 -0
  224. package/src/lib/tool/engine.test.ts +39 -0
  225. package/src/lib/tool/engine.ts +58 -0
  226. package/src/lib/tool/examples.test.ts +35 -0
  227. package/src/lib/tool/examples.ts +71 -0
  228. package/src/lib/tool/export-targets.test.ts +47 -0
  229. package/src/lib/tool/export-targets.ts +84 -0
  230. package/src/lib/tool/facing.test.ts +72 -0
  231. package/src/lib/tool/facing.ts +100 -0
  232. package/src/lib/tool/geometry.test.ts +80 -0
  233. package/src/lib/tool/geometry.ts +109 -0
  234. package/src/lib/tool/gns3-cables.test.ts +47 -0
  235. package/src/lib/tool/gns3-cables.ts +81 -0
  236. package/src/lib/tool/gns3-import.test.ts +102 -0
  237. package/src/lib/tool/gns3-import.ts +198 -0
  238. package/src/lib/tool/gns3-layout.test.ts +62 -0
  239. package/src/lib/tool/gns3-parts.test.ts +47 -0
  240. package/src/lib/tool/gns3-parts.ts +68 -0
  241. package/src/lib/tool/issues.test.ts +35 -0
  242. package/src/lib/tool/issues.ts +60 -0
  243. package/src/lib/tool/layout.test.ts +128 -0
  244. package/src/lib/tool/layout.ts +229 -0
  245. package/src/lib/tool/live.test.ts +46 -0
  246. package/src/lib/tool/live.ts +49 -0
  247. package/src/lib/tool/logos.test.ts +30 -0
  248. package/src/lib/tool/logos.ts +99 -0
  249. package/src/lib/tool/model.test.ts +128 -0
  250. package/src/lib/tool/model.ts +238 -0
  251. package/src/lib/tool/os.test.ts +45 -0
  252. package/src/lib/tool/os.ts +57 -0
  253. package/src/lib/tool/parity.test.ts +145 -0
  254. package/src/lib/tool/pins.test.ts +24 -0
  255. package/src/lib/tool/pins.ts +11 -0
  256. package/src/lib/tool/placement.test.ts +79 -0
  257. package/src/lib/tool/placement.ts +60 -0
  258. package/src/lib/tool/ports.test.ts +39 -0
  259. package/src/lib/tool/ports.ts +48 -0
  260. package/src/lib/tool/presets.test.ts +50 -0
  261. package/src/lib/tool/presets.ts +77 -0
  262. package/src/lib/tool/projects-api.test.ts +59 -0
  263. package/src/lib/tool/projects-api.ts +47 -0
  264. package/src/lib/tool/router-ports.test.ts +63 -0
  265. package/src/lib/tool/router-ports.ts +88 -0
  266. package/src/lib/tool/selection.test.ts +44 -0
  267. package/src/lib/tool/selection.ts +34 -0
  268. package/src/lib/tool/storage.test.ts +123 -0
  269. package/src/lib/tool/storage.ts +127 -0
  270. package/src/lib/tool/switch-edit.test.ts +49 -0
  271. package/src/lib/tool/switch-edit.ts +38 -0
  272. package/src/lib/tool/text/de.ts +358 -0
  273. package/src/lib/tool/text/en.ts +371 -0
  274. package/src/lib/tool/text/es.ts +358 -0
  275. package/src/lib/tool/text/fr.ts +358 -0
  276. package/src/lib/tool/text/index.ts +21 -0
  277. package/src/lib/tool/text/text.test.ts +33 -0
  278. package/src/lib/tool/topology.test.ts +108 -0
  279. package/src/lib/tool/topology.ts +116 -0
  280. package/src/lib/tool/vlans.test.ts +64 -0
  281. package/src/lib/tool/vlans.ts +79 -0
  282. package/src/lib/utils.ts +6 -0
  283. package/src/model.ts +13 -0
  284. package/src/test/arbitrary.ts +41 -0
  285. package/src/test/engine.ts +48 -0
  286. package/src/test/lab.ts +101 -0
  287. package/styles/globals.css +258 -0
  288. package/styles/theme.css +192 -0
  289. package/tsconfig.build.json +12 -0
  290. package/tsconfig.json +22 -0
  291. package/wasm/isothrum_wasm.d.ts +60 -0
  292. package/wasm/isothrum_wasm.js +312 -0
  293. package/wasm/isothrum_wasm_bg.wasm +0 -0
@@ -0,0 +1,192 @@
1
+ /*
2
+ * ─────────────────────────────────────────────────────────────────────────────
3
+ * THEME — the one file to edit to rebrand the site.
4
+ * ─────────────────────────────────────────────────────────────────────────────
5
+ *
6
+ * Three layers, each built only from the one above it:
7
+ *
8
+ * 1. Palettes --brand-*, --base-* → point at a Tailwind color scale.
9
+ * 2. Semantic --primary, --border… → what components use (shadcn contract).
10
+ * 3. Utilities bg-primary, text-muted-foreground… (wired in globals.css).
11
+ *
12
+ * Quick recipes
13
+ * • New brand color: replace `indigo` below with any Tailwind scale
14
+ * (violet, blue, emerald, rose, orange…).
15
+ * • Warmer/cooler UI: replace `zinc` with neutral, slate, gray or stone.
16
+ * • Rounder/sharper: change --radius (0 = square, 1rem = pill-ish).
17
+ * • Fonts: lib/fonts.ts.
18
+ * • Logo / favicon / OG colors: lib/brand.ts (mirror the hex values).
19
+ *
20
+ * Components should only ever use semantic tokens (bg-primary, text-muted-
21
+ * foreground, border…) or the brand scale (bg-brand-50) — never raw palette
22
+ * classes like bg-indigo-600 — so a palette swap here restyles everything.
23
+ */
24
+
25
+ :root {
26
+ /* 1. Palettes ------------------------------------------------------------ */
27
+ /* Excalidraw-style violet (500 is #6965db). */
28
+ --brand-50: #f3f2ff;
29
+ --brand-100: #e9e8ff;
30
+ --brand-200: #d4d2fc;
31
+ --brand-300: #b5b2f6;
32
+ --brand-400: #a8a5ff;
33
+ --brand-500: #6965db;
34
+ --brand-600: #5b57d1;
35
+ --brand-700: #4a47b1;
36
+ --brand-800: #3d3a91;
37
+ --brand-900: #2f2d70;
38
+ --brand-950: #1d1b45;
39
+
40
+ --base-50: var(--color-zinc-50);
41
+ --base-100: var(--color-zinc-100);
42
+ --base-200: var(--color-zinc-200);
43
+ --base-300: var(--color-zinc-300);
44
+ --base-400: var(--color-zinc-400);
45
+ --base-500: var(--color-zinc-500);
46
+ --base-600: var(--color-zinc-600);
47
+ --base-700: var(--color-zinc-700);
48
+ --base-800: var(--color-zinc-800);
49
+ --base-900: var(--color-zinc-900);
50
+ --base-950: var(--color-zinc-950);
51
+
52
+ /* Shape, layout & type */
53
+ /* Soft corners: clear, a little playful. */
54
+ --radius: 0.75rem;
55
+ /* Max width of `.container` (header, pages, footer). */
56
+ --content-width: 72rem;
57
+ /* Geist needs no character variants. */
58
+ --font-features: normal;
59
+
60
+ /* 2. Semantic tokens — light --------------------------------------------- */
61
+ --background: var(--color-white);
62
+ --foreground: var(--base-950);
63
+ /* Subtle alternate section background (feature bands, footers). */
64
+ /* Barely-there gray for bands and the editor's chrome, as on vercel.com. */
65
+ --surface: oklch(0.985 0 0);
66
+
67
+ --card: var(--color-white);
68
+ --card-foreground: var(--base-950);
69
+ --popover: var(--color-white);
70
+ --popover-foreground: var(--base-950);
71
+
72
+ /* Isothrum's identity: a white whiteboard, ink lines, soft violet for what you act on
73
+ and what is selected. 600 keeps white button text above 4.5:1. */
74
+ --primary: var(--brand-600);
75
+ --primary-foreground: var(--color-white);
76
+ --signal: var(--brand-500);
77
+ --signal-foreground: var(--brand-700);
78
+ /* Pastel fills for devices, as on a whiteboard. */
79
+ --pastel-blue: #e7f5ff;
80
+ --pastel-green: #ebfbee;
81
+ --pastel-yellow: #fff9db;
82
+ --pastel-violet: #f3f0ff;
83
+ --pastel-red: #fff0f0;
84
+ --secondary: var(--base-100);
85
+ --secondary-foreground: var(--base-900);
86
+ --muted: var(--base-100);
87
+ --muted-foreground: oklch(0.52 0 0);
88
+ --accent: var(--base-100);
89
+ --accent-foreground: var(--base-900);
90
+
91
+ /* Inline text links (prose, "link" buttons). */
92
+ --link: var(--brand-700);
93
+
94
+ --destructive: var(--color-red-600);
95
+ --success: var(--color-emerald-700);
96
+ --warning: var(--color-amber-500);
97
+ --info: var(--color-sky-600);
98
+
99
+ --border: oklch(0.922 0 0);
100
+ --input: oklch(0.9 0 0);
101
+ --ring: var(--brand-500);
102
+
103
+ --chart-1: var(--brand-500);
104
+ --chart-2: var(--color-sky-500);
105
+ --chart-3: var(--color-emerald-500);
106
+ --chart-4: var(--color-amber-500);
107
+ --chart-5: var(--color-rose-500);
108
+
109
+ --sidebar: var(--base-50);
110
+ --sidebar-foreground: var(--base-950);
111
+ --sidebar-primary: var(--primary);
112
+ --sidebar-primary-foreground: var(--primary-foreground);
113
+ --sidebar-accent: var(--base-100);
114
+ --sidebar-accent-foreground: var(--base-900);
115
+ --sidebar-border: var(--base-200);
116
+ --sidebar-ring: var(--ring);
117
+ }
118
+
119
+ /* 2b. Semantic tokens — dark ---------------------------------------------- */
120
+ .dark {
121
+ /* Near-black with barely-raised surfaces, as on a lit rack at night. */
122
+ --background: oklch(0.145 0.003 286);
123
+ --foreground: var(--base-50);
124
+ --surface: oklch(0.17 0.003 286);
125
+
126
+ --card: oklch(0.185 0.004 286);
127
+ --card-foreground: var(--base-50);
128
+ --popover: oklch(0.2 0.004 286);
129
+ --popover-foreground: var(--base-50);
130
+
131
+ --primary: var(--brand-400);
132
+ --primary-foreground: var(--base-950);
133
+ --signal: var(--brand-400);
134
+ --signal-foreground: var(--brand-400);
135
+ --pastel-blue: oklch(0.3 0.04 240);
136
+ --pastel-green: oklch(0.3 0.04 150);
137
+ --pastel-yellow: oklch(0.32 0.04 95);
138
+ --pastel-violet: oklch(0.3 0.05 285);
139
+ --pastel-red: oklch(0.3 0.04 20);
140
+ --secondary: var(--base-800);
141
+ --secondary-foreground: var(--base-50);
142
+ --muted: var(--base-800);
143
+ --muted-foreground: var(--base-400);
144
+ --accent: var(--base-800);
145
+ --accent-foreground: var(--base-50);
146
+
147
+ --link: var(--brand-400);
148
+
149
+ --destructive: var(--color-red-500);
150
+ --success: var(--color-emerald-400);
151
+ --warning: var(--color-amber-400);
152
+ --info: var(--color-sky-400);
153
+
154
+ --border: oklch(1 0 0 / 10%);
155
+ --input: oklch(1 0 0 / 15%);
156
+ --ring: var(--brand-400);
157
+
158
+ --sidebar: var(--base-900);
159
+ --sidebar-foreground: var(--base-50);
160
+ --sidebar-accent: var(--base-800);
161
+ --sidebar-accent-foreground: var(--base-50);
162
+ --sidebar-border: oklch(1 0 0 / 10%);
163
+ }
164
+
165
+ /* The editor's business design: the canvas in the plain sans, with quiet fills, for a diagram
166
+ that goes into a report (the sketch design is the default above). */
167
+ [data-design="business"] {
168
+ --font-brand-heading: var(--font-brand-sans);
169
+ /* Resolved at the root from the brand's heading font: said again here, for business. */
170
+ --font-heading: var(--font-sans);
171
+ --pastel-blue: oklch(0.975 0.006 250);
172
+ --pastel-green: oklch(0.975 0.006 160);
173
+ --pastel-yellow: oklch(0.98 0.008 95);
174
+ --pastel-violet: oklch(0.975 0.006 285);
175
+ --pastel-red: oklch(0.975 0.006 20);
176
+ }
177
+ .dark [data-design="business"] {
178
+ --pastel-blue: oklch(0.23 0.012 250);
179
+ --pastel-green: oklch(0.23 0.012 160);
180
+ --pastel-yellow: oklch(0.24 0.012 95);
181
+ --pastel-violet: oklch(0.23 0.012 285);
182
+ --pastel-red: oklch(0.23 0.012 20);
183
+ }
184
+
185
+ /* Business: connection points show on the device under the pointer (or selected) only, as in a
186
+ network diagram tool. */
187
+ [data-design="business"] .react-flow__node:not(:hover):not(.selected) .react-flow__handle {
188
+ opacity: 0;
189
+ }
190
+ [data-design="business"] .react-flow__handle {
191
+ transition: opacity 120ms;
192
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "noEmit": false,
5
+ "declaration": true,
6
+ "emitDeclarationOnly": true,
7
+ "outDir": "./dist/types",
8
+ "rootDir": "./src"
9
+ },
10
+ "include": ["src/**/*.ts", "src/**/*.tsx"],
11
+ "exclude": ["node_modules", "dist", "src/**/*.test.ts", "src/**/*.test.tsx", "src/test/**"]
12
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "strict": true,
6
+ "noEmit": true,
7
+ "esModuleInterop": true,
8
+ "module": "esnext",
9
+ "moduleResolution": "bundler",
10
+ "resolveJsonModule": true,
11
+ "isolatedModules": true,
12
+ "jsx": "react-jsx",
13
+ "skipLibCheck": true,
14
+ "types": ["node"],
15
+ "baseUrl": ".",
16
+ "paths": {
17
+ "@/*": ["./src/*"]
18
+ }
19
+ },
20
+ "include": ["src/**/*.ts", "src/**/*.tsx", "scripts/**/*.mjs", "desktop-editor/**/*.tsx"],
21
+ "exclude": ["node_modules", "dist"]
22
+ }
@@ -0,0 +1,60 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * The download: a zip with `isoloom.yml` and every generated file.
6
+ */
7
+ export function bundle(topology_json: string): Uint8Array;
8
+
9
+ /**
10
+ * The download for one target (see [`bundle_target_bytes`]).
11
+ */
12
+ export function bundle_target(topology_json: string, target_dir: string): Uint8Array;
13
+
14
+ /**
15
+ * JSON for the desktop app: [`own_files`].
16
+ */
17
+ export function own_files_json(topology_json: string): string;
18
+
19
+ /**
20
+ * JSON for the editor: a [`Plan`].
21
+ */
22
+ export function plan_json(topology_json: string): string;
23
+
24
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
25
+
26
+ export interface InitOutput {
27
+ readonly memory: WebAssembly.Memory;
28
+ readonly bundle: (a: number, b: number) => [number, number, number, number];
29
+ readonly bundle_target: (a: number, b: number, c: number, d: number) => [number, number, number, number];
30
+ readonly own_files_json: (a: number, b: number) => [number, number];
31
+ readonly plan_json: (a: number, b: number) => [number, number];
32
+ readonly __wbindgen_externrefs: WebAssembly.Table;
33
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
34
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
35
+ readonly __externref_table_dealloc: (a: number) => void;
36
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
37
+ readonly __wbindgen_start: () => void;
38
+ }
39
+
40
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
41
+
42
+ /**
43
+ * Instantiates the given `module`, which can either be bytes or
44
+ * a precompiled `WebAssembly.Module`.
45
+ *
46
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
47
+ *
48
+ * @returns {InitOutput}
49
+ */
50
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
51
+
52
+ /**
53
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
54
+ * for everything else, calls `WebAssembly.instantiate` directly.
55
+ *
56
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
57
+ *
58
+ * @returns {Promise<InitOutput>}
59
+ */
60
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -0,0 +1,312 @@
1
+ /* @ts-self-types="./isothrum_wasm.d.ts" */
2
+
3
+ /**
4
+ * The download: a zip with `isoloom.yml` and every generated file.
5
+ *
6
+ * # Errors
7
+ *
8
+ * The [`EngineError`]'s message, as a JavaScript `Error`.
9
+ * @param {string} topology_json
10
+ * @returns {Uint8Array}
11
+ */
12
+ export function bundle(topology_json) {
13
+ const ptr0 = passStringToWasm0(topology_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
14
+ const len0 = WASM_VECTOR_LEN;
15
+ const ret = wasm.bundle(ptr0, len0);
16
+ if (ret[3]) {
17
+ throw takeFromExternrefTable0(ret[2]);
18
+ }
19
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
20
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
21
+ return v2;
22
+ }
23
+
24
+ /**
25
+ * The download for one target (see [`bundle_target_bytes`]).
26
+ *
27
+ * # Errors
28
+ *
29
+ * The [`EngineError`]'s message, as a JavaScript `Error`.
30
+ * @param {string} topology_json
31
+ * @param {string} target_dir
32
+ * @returns {Uint8Array}
33
+ */
34
+ export function bundle_target(topology_json, target_dir) {
35
+ const ptr0 = passStringToWasm0(topology_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
36
+ const len0 = WASM_VECTOR_LEN;
37
+ const ptr1 = passStringToWasm0(target_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
38
+ const len1 = WASM_VECTOR_LEN;
39
+ const ret = wasm.bundle_target(ptr0, len0, ptr1, len1);
40
+ if (ret[3]) {
41
+ throw takeFromExternrefTable0(ret[2]);
42
+ }
43
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
44
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
45
+ return v3;
46
+ }
47
+
48
+ /**
49
+ * JSON for the editor: Isoloom's lists ([`Choices`]), what its OS, appliance and protocol
50
+ * fields offer.
51
+ * @returns {string}
52
+ */
53
+ export function choices_json() {
54
+ let deferred1_0;
55
+ let deferred1_1;
56
+ try {
57
+ const ret = wasm.choices_json();
58
+ deferred1_0 = ret[0];
59
+ deferred1_1 = ret[1];
60
+ return getStringFromWasm0(ret[0], ret[1]);
61
+ } finally {
62
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
63
+ }
64
+ }
65
+
66
+ /**
67
+ * JSON for the desktop app: [`own_files`].
68
+ * @param {string} topology_json
69
+ * @returns {string}
70
+ */
71
+ export function own_files_json(topology_json) {
72
+ let deferred2_0;
73
+ let deferred2_1;
74
+ try {
75
+ const ptr0 = passStringToWasm0(topology_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
76
+ const len0 = WASM_VECTOR_LEN;
77
+ const ret = wasm.own_files_json(ptr0, len0);
78
+ deferred2_0 = ret[0];
79
+ deferred2_1 = ret[1];
80
+ return getStringFromWasm0(ret[0], ret[1]);
81
+ } finally {
82
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
83
+ }
84
+ }
85
+
86
+ /**
87
+ * JSON for the editor: a [`Plan`].
88
+ * @param {string} topology_json
89
+ * @returns {string}
90
+ */
91
+ export function plan_json(topology_json) {
92
+ let deferred2_0;
93
+ let deferred2_1;
94
+ try {
95
+ const ptr0 = passStringToWasm0(topology_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
96
+ const len0 = WASM_VECTOR_LEN;
97
+ const ret = wasm.plan_json(ptr0, len0);
98
+ deferred2_0 = ret[0];
99
+ deferred2_1 = ret[1];
100
+ return getStringFromWasm0(ret[0], ret[1]);
101
+ } finally {
102
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
103
+ }
104
+ }
105
+ function __wbg_get_imports() {
106
+ const import0 = {
107
+ __proto__: null,
108
+ __wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
109
+ const ret = Error(getStringFromWasm0(arg0, arg1));
110
+ return ret;
111
+ },
112
+ __wbindgen_init_externref_table: function() {
113
+ const table = wasm.__wbindgen_externrefs;
114
+ const offset = table.grow(4);
115
+ table.set(0, undefined);
116
+ table.set(offset + 0, undefined);
117
+ table.set(offset + 1, null);
118
+ table.set(offset + 2, true);
119
+ table.set(offset + 3, false);
120
+ },
121
+ };
122
+ return {
123
+ __proto__: null,
124
+ "./isothrum_wasm_bg.js": import0,
125
+ };
126
+ }
127
+
128
+ function getArrayU8FromWasm0(ptr, len) {
129
+ ptr = ptr >>> 0;
130
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
131
+ }
132
+
133
+ function getStringFromWasm0(ptr, len) {
134
+ return decodeText(ptr >>> 0, len);
135
+ }
136
+
137
+ let cachedUint8ArrayMemory0 = null;
138
+ function getUint8ArrayMemory0() {
139
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
140
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
141
+ }
142
+ return cachedUint8ArrayMemory0;
143
+ }
144
+
145
+ function passStringToWasm0(arg, malloc, realloc) {
146
+ if (realloc === undefined) {
147
+ const buf = cachedTextEncoder.encode(arg);
148
+ const ptr = malloc(buf.length, 1) >>> 0;
149
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
150
+ WASM_VECTOR_LEN = buf.length;
151
+ return ptr;
152
+ }
153
+
154
+ let len = arg.length;
155
+ let ptr = malloc(len, 1) >>> 0;
156
+
157
+ const mem = getUint8ArrayMemory0();
158
+
159
+ let offset = 0;
160
+
161
+ for (; offset < len; offset++) {
162
+ const code = arg.charCodeAt(offset);
163
+ if (code > 0x7F) break;
164
+ mem[ptr + offset] = code;
165
+ }
166
+ if (offset !== len) {
167
+ if (offset !== 0) {
168
+ arg = arg.slice(offset);
169
+ }
170
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
171
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
172
+ const ret = cachedTextEncoder.encodeInto(arg, view);
173
+
174
+ offset += ret.written;
175
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
176
+ }
177
+
178
+ WASM_VECTOR_LEN = offset;
179
+ return ptr;
180
+ }
181
+
182
+ function takeFromExternrefTable0(idx) {
183
+ const value = wasm.__wbindgen_externrefs.get(idx);
184
+ wasm.__externref_table_dealloc(idx);
185
+ return value;
186
+ }
187
+
188
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
189
+ cachedTextDecoder.decode();
190
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
191
+ let numBytesDecoded = 0;
192
+ function decodeText(ptr, len) {
193
+ numBytesDecoded += len;
194
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
195
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
196
+ cachedTextDecoder.decode();
197
+ numBytesDecoded = len;
198
+ }
199
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
200
+ }
201
+
202
+ const cachedTextEncoder = new TextEncoder();
203
+
204
+ if (!('encodeInto' in cachedTextEncoder)) {
205
+ cachedTextEncoder.encodeInto = function (arg, view) {
206
+ const buf = cachedTextEncoder.encode(arg);
207
+ view.set(buf);
208
+ return {
209
+ read: arg.length,
210
+ written: buf.length
211
+ };
212
+ };
213
+ }
214
+
215
+ let WASM_VECTOR_LEN = 0;
216
+
217
+ let wasmModule, wasmInstance, wasm;
218
+ function __wbg_finalize_init(instance, module) {
219
+ wasmInstance = instance;
220
+ wasm = instance.exports;
221
+ wasmModule = module;
222
+ cachedUint8ArrayMemory0 = null;
223
+ wasm.__wbindgen_start();
224
+ return wasm;
225
+ }
226
+
227
+ async function __wbg_load(module, imports) {
228
+ if (typeof Response === 'function' && module instanceof Response) {
229
+ if (!module.ok) {
230
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
231
+ }
232
+
233
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
234
+ try {
235
+ return await WebAssembly.instantiateStreaming(module, imports);
236
+ } catch (e) {
237
+ const validResponse = expectedResponseType(module.type);
238
+
239
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
240
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
241
+
242
+ } else { throw e; }
243
+ }
244
+ }
245
+
246
+ const bytes = await module.arrayBuffer();
247
+ return await WebAssembly.instantiate(bytes, imports);
248
+ } else {
249
+ const instance = await WebAssembly.instantiate(module, imports);
250
+
251
+ if (instance instanceof WebAssembly.Instance) {
252
+ return { instance, module };
253
+ } else {
254
+ return instance;
255
+ }
256
+ }
257
+
258
+ function expectedResponseType(type) {
259
+ switch (type) {
260
+ case 'basic': case 'cors': case 'default': return true;
261
+ }
262
+ return false;
263
+ }
264
+ }
265
+
266
+ function initSync(module) {
267
+ if (wasm !== undefined) return wasm;
268
+
269
+
270
+ if (module !== undefined) {
271
+ if (Object.getPrototypeOf(module) === Object.prototype) {
272
+ ({module} = module)
273
+ } else {
274
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
275
+ }
276
+ }
277
+
278
+ const imports = __wbg_get_imports();
279
+ if (!(module instanceof WebAssembly.Module)) {
280
+ module = new WebAssembly.Module(module);
281
+ }
282
+ const instance = new WebAssembly.Instance(module, imports);
283
+ return __wbg_finalize_init(instance, module);
284
+ }
285
+
286
+ async function __wbg_init(module_or_path) {
287
+ if (wasm !== undefined) return wasm;
288
+
289
+
290
+ if (module_or_path !== undefined) {
291
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
292
+ ({module_or_path} = module_or_path)
293
+ } else {
294
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
295
+ }
296
+ }
297
+
298
+ if (module_or_path === undefined) {
299
+ module_or_path = new URL('isothrum_wasm_bg.wasm', import.meta.url);
300
+ }
301
+ const imports = __wbg_get_imports();
302
+
303
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
304
+ module_or_path = fetch(module_or_path);
305
+ }
306
+
307
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
308
+
309
+ return __wbg_finalize_init(instance, module);
310
+ }
311
+
312
+ export { initSync, __wbg_init as default };
Binary file