@johnoscott/isometric-engine 0.0.0-stage → 0.9.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 (310) hide show
  1. package/EDITOR-GUIDE.md +317 -0
  2. package/LICENSE +21 -0
  3. package/LICENSES/ajv.txt +22 -0
  4. package/LICENSES/lucide-static.txt +43 -0
  5. package/LICENSES/yaml.txt +13 -0
  6. package/README.md +62 -2
  7. package/assets/app.css +265 -0
  8. package/assets/default-theme.yaml +99 -0
  9. package/assets/icons.svg +1 -0
  10. package/assets/marks.css +35 -0
  11. package/assets/skin.css +181 -0
  12. package/iso-editor.d.ts +4 -0
  13. package/iso-editor.js +550 -0
  14. package/iso-render.d.ts +3 -0
  15. package/iso-render.js +388 -0
  16. package/iso-systems.d.ts +4 -0
  17. package/iso-systems.js +389 -0
  18. package/js/iso-core/compile-schema.js +22 -0
  19. package/js/iso-core/depth.js +55 -0
  20. package/js/iso-core/errors.js +65 -0
  21. package/js/iso-core/glyphs.js +100 -0
  22. package/js/iso-core/index.js +55 -0
  23. package/js/iso-core/kernel.js +158 -0
  24. package/js/iso-core/metrics.json +1 -0
  25. package/js/iso-core/package.json +6 -0
  26. package/js/iso-core/parse.js +79 -0
  27. package/js/iso-core/schema-errors.js +170 -0
  28. package/js/iso-core/shims/crypto.js +125 -0
  29. package/js/iso-core/shims/path.js +49 -0
  30. package/js/iso-core/svg-dom.js +144 -0
  31. package/js/iso-core/theme.js +48 -0
  32. package/js/iso-core/vdom.js +48 -0
  33. package/js/iso-editor/adapter.js +0 -0
  34. package/js/iso-editor/clipboard.js +152 -0
  35. package/js/iso-editor/commands.js +173 -0
  36. package/js/iso-editor/complete.js +55 -0
  37. package/js/iso-editor/doc.js +182 -0
  38. package/js/iso-editor/index.js +105 -0
  39. package/js/iso-editor/model.js +210 -0
  40. package/js/iso-editor/outline.js +111 -0
  41. package/js/iso-editor/package.json +6 -0
  42. package/js/iso-editor/path.js +19 -0
  43. package/js/iso-editor/providers.js +96 -0
  44. package/js/iso-editor/schema-nav.js +117 -0
  45. package/js/iso-editor/splice.js +441 -0
  46. package/js/iso-editor/storage-keys.js +6 -0
  47. package/js/iso-editor/ui/actions.js +116 -0
  48. package/js/iso-editor/ui/canvas-layer.js +0 -0
  49. package/js/iso-editor/ui/canvas.js +1205 -0
  50. package/js/iso-editor/ui/clip.js +133 -0
  51. package/js/iso-editor/ui/dialog.js +26 -0
  52. package/js/iso-editor/ui/flat-canvas.js +54 -0
  53. package/js/iso-editor/ui/icons.js +15 -0
  54. package/js/iso-editor/ui/keys.js +26 -0
  55. package/js/iso-editor/ui/later.js +28 -0
  56. package/js/iso-editor/ui/layer.js +11 -0
  57. package/js/iso-editor/ui/menu.js +105 -0
  58. package/js/iso-editor/ui/monaco-entry.js +2 -0
  59. package/js/iso-editor/ui/mount-kit.js +0 -0
  60. package/js/iso-editor/ui/mount.js +767 -0
  61. package/js/iso-editor/ui/pane.js +0 -0
  62. package/js/iso-editor/ui/part.js +0 -0
  63. package/js/iso-editor/ui/plain-icons.js +34 -0
  64. package/js/iso-editor/ui/props.js +314 -0
  65. package/js/iso-editor/ui/scope-css.js +81 -0
  66. package/js/iso-editor/ui/setup.js +145 -0
  67. package/js/iso-editor/ui/text.js +323 -0
  68. package/js/iso-editor/ui/tree.js +728 -0
  69. package/js/iso-editor/validate.js +33 -0
  70. package/js/iso-editor/window/protocol.js +8 -0
  71. package/js/iso-objects/assemble.js +43 -0
  72. package/js/iso-objects/assets.js +88 -0
  73. package/js/iso-objects/board.js +162 -0
  74. package/js/iso-objects/compile.js +60 -0
  75. package/js/iso-objects/css.js +154 -0
  76. package/js/iso-objects/flat.js +696 -0
  77. package/js/iso-objects/focus.js +16 -0
  78. package/js/iso-objects/geometry.js +76 -0
  79. package/js/iso-objects/index.js +93 -0
  80. package/js/iso-objects/kinds.js +12 -0
  81. package/js/iso-objects/labels.js +325 -0
  82. package/js/iso-objects/package.json +6 -0
  83. package/js/iso-objects/place.js +347 -0
  84. package/js/iso-objects/route.js +461 -0
  85. package/js/iso-objects/scene.js +350 -0
  86. package/js/iso-objects/steps.js +246 -0
  87. package/js/iso-objects/types.js +0 -0
  88. package/js/iso-systems/catalog.js +42 -0
  89. package/js/iso-systems/compile.js +34 -0
  90. package/js/iso-systems/css.js +8 -0
  91. package/js/iso-systems/index.js +16 -0
  92. package/js/iso-systems/nodes.js +124 -0
  93. package/js/iso-systems/package.json +6 -0
  94. package/js/iso-systems/schema.json +311 -0
  95. package/js/iso-systems/validate.js +35 -0
  96. package/js/iso-viewer/bundle.js +20 -0
  97. package/js/iso-viewer/card-motion.js +228 -0
  98. package/js/iso-viewer/dom.js +14 -0
  99. package/js/iso-viewer/dual-view.js +212 -0
  100. package/js/iso-viewer/flat-view.js +124 -0
  101. package/js/iso-viewer/history.js +990 -0
  102. package/js/iso-viewer/index.js +98 -0
  103. package/js/iso-viewer/morph.js +192 -0
  104. package/js/iso-viewer/overlay.js +199 -0
  105. package/js/iso-viewer/package.json +6 -0
  106. package/js/iso-viewer/page.js +138 -0
  107. package/js/iso-viewer/player.js +409 -0
  108. package/js/iso-viewer/still.js +81 -0
  109. package/js/iso-viewer/timeline-contract.js +14 -0
  110. package/js/iso-viewer/timeline-engine.js +475 -0
  111. package/js/iso-viewer/timeline-export.js +36 -0
  112. package/js/iso-viewer/timeline-scale.js +116 -0
  113. package/js/iso-viewer/timeline-scope.js +58 -0
  114. package/js/iso-viewer/timeline-search.js +216 -0
  115. package/js/iso-viewer/timeline-time.js +55 -0
  116. package/js/iso-viewer/view-css.js +68 -0
  117. package/js/iso-viewer/viewport.js +177 -0
  118. package/package.json +502 -4
  119. package/src/iso-core/compile-schema.ts +23 -0
  120. package/src/iso-core/depth.ts +56 -0
  121. package/src/iso-core/errors.ts +73 -0
  122. package/src/iso-core/glyphs.ts +108 -0
  123. package/src/iso-core/index.ts +27 -0
  124. package/src/iso-core/kernel.ts +163 -0
  125. package/src/iso-core/metrics.json +1 -0
  126. package/src/iso-core/package.json +6 -0
  127. package/src/iso-core/parse.ts +91 -0
  128. package/src/iso-core/schema-errors.ts +163 -0
  129. package/src/iso-core/shims/crypto.ts +37 -0
  130. package/src/iso-core/shims/path.ts +24 -0
  131. package/src/iso-core/svg-dom.ts +103 -0
  132. package/src/iso-core/theme.ts +64 -0
  133. package/src/iso-core/vdom.ts +41 -0
  134. package/src/iso-editor/adapter.ts +128 -0
  135. package/src/iso-editor/clipboard.ts +163 -0
  136. package/src/iso-editor/commands.ts +191 -0
  137. package/src/iso-editor/complete.ts +73 -0
  138. package/src/iso-editor/doc.ts +207 -0
  139. package/src/iso-editor/index.ts +67 -0
  140. package/src/iso-editor/model.ts +234 -0
  141. package/src/iso-editor/outline.ts +126 -0
  142. package/src/iso-editor/package.json +6 -0
  143. package/src/iso-editor/path.ts +18 -0
  144. package/src/iso-editor/providers.ts +113 -0
  145. package/src/iso-editor/schema-nav.ts +129 -0
  146. package/src/iso-editor/splice.ts +472 -0
  147. package/src/iso-editor/storage-keys.ts +6 -0
  148. package/src/iso-editor/ui/actions.ts +119 -0
  149. package/src/iso-editor/ui/app.css +230 -0
  150. package/src/iso-editor/ui/canvas-layer.ts +56 -0
  151. package/src/iso-editor/ui/canvas.ts +1071 -0
  152. package/src/iso-editor/ui/clip.ts +97 -0
  153. package/src/iso-editor/ui/dialog.ts +25 -0
  154. package/src/iso-editor/ui/flat-canvas.ts +51 -0
  155. package/src/iso-editor/ui/icons.ts +21 -0
  156. package/src/iso-editor/ui/keys.ts +30 -0
  157. package/src/iso-editor/ui/later.ts +22 -0
  158. package/src/iso-editor/ui/layer.ts +7 -0
  159. package/src/iso-editor/ui/marks.css +35 -0
  160. package/src/iso-editor/ui/menu.ts +67 -0
  161. package/src/iso-editor/ui/monaco-entry.ts +6 -0
  162. package/src/iso-editor/ui/mount-kit.ts +35 -0
  163. package/src/iso-editor/ui/mount.ts +684 -0
  164. package/src/iso-editor/ui/pane.ts +45 -0
  165. package/src/iso-editor/ui/part.ts +45 -0
  166. package/src/iso-editor/ui/plain-icons.ts +83 -0
  167. package/src/iso-editor/ui/props.ts +347 -0
  168. package/src/iso-editor/ui/scope-css.ts +65 -0
  169. package/src/iso-editor/ui/setup.ts +144 -0
  170. package/src/iso-editor/ui/skin.css +181 -0
  171. package/src/iso-editor/ui/text.ts +262 -0
  172. package/src/iso-editor/ui/tree.ts +657 -0
  173. package/src/iso-editor/validate.ts +62 -0
  174. package/src/iso-editor/window/protocol.ts +33 -0
  175. package/src/iso-objects/assemble.ts +57 -0
  176. package/src/iso-objects/assets.ts +122 -0
  177. package/src/iso-objects/board.ts +169 -0
  178. package/src/iso-objects/compile.ts +76 -0
  179. package/src/iso-objects/css.ts +163 -0
  180. package/src/iso-objects/flat.ts +653 -0
  181. package/src/iso-objects/focus.ts +14 -0
  182. package/src/iso-objects/geometry.ts +86 -0
  183. package/src/iso-objects/index.ts +33 -0
  184. package/src/iso-objects/kinds.ts +56 -0
  185. package/src/iso-objects/labels.ts +310 -0
  186. package/src/iso-objects/package.json +6 -0
  187. package/src/iso-objects/place.ts +318 -0
  188. package/src/iso-objects/route.ts +444 -0
  189. package/src/iso-objects/scene.ts +376 -0
  190. package/src/iso-objects/steps.ts +234 -0
  191. package/src/iso-objects/types.ts +68 -0
  192. package/src/iso-systems/catalog.ts +31 -0
  193. package/src/iso-systems/compile.ts +39 -0
  194. package/src/iso-systems/css.ts +9 -0
  195. package/src/iso-systems/index.ts +12 -0
  196. package/src/iso-systems/nodes.ts +126 -0
  197. package/src/iso-systems/package.json +6 -0
  198. package/src/iso-systems/schema.json +311 -0
  199. package/src/iso-systems/validate.ts +34 -0
  200. package/src/iso-viewer/bundle.ts +15 -0
  201. package/src/iso-viewer/card-motion.ts +237 -0
  202. package/src/iso-viewer/dom.ts +13 -0
  203. package/src/iso-viewer/dual-view.ts +212 -0
  204. package/src/iso-viewer/flat-view.ts +127 -0
  205. package/src/iso-viewer/history.ts +781 -0
  206. package/src/iso-viewer/index.ts +40 -0
  207. package/src/iso-viewer/morph.ts +191 -0
  208. package/src/iso-viewer/overlay.ts +212 -0
  209. package/src/iso-viewer/package.json +6 -0
  210. package/src/iso-viewer/page.ts +150 -0
  211. package/src/iso-viewer/player.ts +321 -0
  212. package/src/iso-viewer/still.ts +74 -0
  213. package/src/iso-viewer/timeline-contract.ts +342 -0
  214. package/src/iso-viewer/timeline-engine.ts +420 -0
  215. package/src/iso-viewer/timeline-export.ts +31 -0
  216. package/src/iso-viewer/timeline-scale.ts +129 -0
  217. package/src/iso-viewer/timeline-scope.ts +56 -0
  218. package/src/iso-viewer/timeline-search.ts +198 -0
  219. package/src/iso-viewer/timeline-time.ts +54 -0
  220. package/src/iso-viewer/view-css.ts +59 -0
  221. package/src/iso-viewer/viewport.ts +142 -0
  222. package/types/iso-core/compile-schema.d.ts +11 -0
  223. package/types/iso-core/depth.d.ts +6 -0
  224. package/types/iso-core/errors.d.ts +24 -0
  225. package/types/iso-core/glyphs.d.ts +19 -0
  226. package/types/iso-core/index.d.ts +17 -0
  227. package/types/iso-core/kernel.d.ts +130 -0
  228. package/types/iso-core/metrics.json +1 -0
  229. package/types/iso-core/parse.d.ts +18 -0
  230. package/types/iso-core/schema-errors.d.ts +14 -0
  231. package/types/iso-core/shims/crypto.d.ts +9 -0
  232. package/types/iso-core/svg-dom.d.ts +15 -0
  233. package/types/iso-core/theme.d.ts +38 -0
  234. package/types/iso-core/vdom.d.ts +26 -0
  235. package/types/iso-editor/adapter.d.ts +145 -0
  236. package/types/iso-editor/clipboard.d.ts +23 -0
  237. package/types/iso-editor/commands.d.ts +32 -0
  238. package/types/iso-editor/complete.d.ts +25 -0
  239. package/types/iso-editor/doc.d.ts +50 -0
  240. package/types/iso-editor/index.d.ts +57 -0
  241. package/types/iso-editor/model.d.ts +96 -0
  242. package/types/iso-editor/outline.d.ts +28 -0
  243. package/types/iso-editor/path.d.ts +7 -0
  244. package/types/iso-editor/providers.d.ts +43 -0
  245. package/types/iso-editor/schema-nav.d.ts +34 -0
  246. package/types/iso-editor/splice.d.ts +53 -0
  247. package/types/iso-editor/storage-keys.d.ts +5 -0
  248. package/types/iso-editor/ui/actions.d.ts +23 -0
  249. package/types/iso-editor/ui/canvas-layer.d.ts +65 -0
  250. package/types/iso-editor/ui/canvas.d.ts +279 -0
  251. package/types/iso-editor/ui/clip.d.ts +14 -0
  252. package/types/iso-editor/ui/dialog.d.ts +7 -0
  253. package/types/iso-editor/ui/flat-canvas.d.ts +2 -0
  254. package/types/iso-editor/ui/icons.d.ts +5 -0
  255. package/types/iso-editor/ui/keys.d.ts +7 -0
  256. package/types/iso-editor/ui/later.d.ts +12 -0
  257. package/types/iso-editor/ui/layer.d.ts +2 -0
  258. package/types/iso-editor/ui/menu.d.ts +21 -0
  259. package/types/iso-editor/ui/mount-kit.d.ts +31 -0
  260. package/types/iso-editor/ui/mount.d.ts +146 -0
  261. package/types/iso-editor/ui/pane.d.ts +60 -0
  262. package/types/iso-editor/ui/part.d.ts +40 -0
  263. package/types/iso-editor/ui/plain-icons.d.ts +10 -0
  264. package/types/iso-editor/ui/props.d.ts +57 -0
  265. package/types/iso-editor/ui/scope-css.d.ts +5 -0
  266. package/types/iso-editor/ui/setup.d.ts +40 -0
  267. package/types/iso-editor/ui/text.d.ts +19 -0
  268. package/types/iso-editor/ui/tree.d.ts +100 -0
  269. package/types/iso-editor/validate.d.ts +36 -0
  270. package/types/iso-editor/window/protocol.d.ts +60 -0
  271. package/types/iso-objects/assemble.d.ts +35 -0
  272. package/types/iso-objects/assets.d.ts +49 -0
  273. package/types/iso-objects/board.d.ts +36 -0
  274. package/types/iso-objects/compile.d.ts +35 -0
  275. package/types/iso-objects/css.d.ts +16 -0
  276. package/types/iso-objects/flat.d.ts +130 -0
  277. package/types/iso-objects/focus.d.ts +1 -0
  278. package/types/iso-objects/geometry.d.ts +59 -0
  279. package/types/iso-objects/index.d.ts +26 -0
  280. package/types/iso-objects/kinds.d.ts +53 -0
  281. package/types/iso-objects/labels.d.ts +92 -0
  282. package/types/iso-objects/place.d.ts +25 -0
  283. package/types/iso-objects/route.d.ts +67 -0
  284. package/types/iso-objects/scene.d.ts +63 -0
  285. package/types/iso-objects/steps.d.ts +90 -0
  286. package/types/iso-objects/types.d.ts +140 -0
  287. package/types/iso-systems/catalog.d.ts +4 -0
  288. package/types/iso-systems/compile.d.ts +6 -0
  289. package/types/iso-systems/css.d.ts +3 -0
  290. package/types/iso-systems/index.d.ts +5 -0
  291. package/types/iso-systems/nodes.d.ts +3 -0
  292. package/types/iso-viewer/card-motion.d.ts +56 -0
  293. package/types/iso-viewer/dom.d.ts +1 -0
  294. package/types/iso-viewer/dual-view.d.ts +44 -0
  295. package/types/iso-viewer/flat-view.d.ts +25 -0
  296. package/types/iso-viewer/history.d.ts +91 -0
  297. package/types/iso-viewer/index.d.ts +31 -0
  298. package/types/iso-viewer/morph.d.ts +28 -0
  299. package/types/iso-viewer/overlay.d.ts +135 -0
  300. package/types/iso-viewer/page.d.ts +13 -0
  301. package/types/iso-viewer/still.d.ts +26 -0
  302. package/types/iso-viewer/timeline-contract.d.ts +345 -0
  303. package/types/iso-viewer/timeline-engine.d.ts +20 -0
  304. package/types/iso-viewer/timeline-export.d.ts +5 -0
  305. package/types/iso-viewer/timeline-scale.d.ts +44 -0
  306. package/types/iso-viewer/timeline-scope.d.ts +33 -0
  307. package/types/iso-viewer/timeline-search.d.ts +52 -0
  308. package/types/iso-viewer/timeline-time.d.ts +8 -0
  309. package/types/iso-viewer/view-css.d.ts +7 -0
  310. package/types/iso-viewer/viewport.d.ts +50 -0
@@ -0,0 +1,96 @@
1
+ import { EditorDoc } from './doc.js';
2
+ import { type Splice, type Step } from './splice.js';
3
+ import type { Path } from './path.js';
4
+ export type Origin = 'text' | 'tree' | 'canvas' | 'props' | 'menu' | 'api' | 'history' | 'file';
5
+ export interface Command {
6
+ /** for the menu and the undo button's tooltip: "Delete node web" */
7
+ label: string;
8
+ /** the change, worked out against the text it will apply to */
9
+ build(text: string): Splice;
10
+ /** the paths it touched (for the views to refresh and reveal) */
11
+ touched?: Path[];
12
+ /** where a path is after the change (a rename moves paths); null when it no longer exists */
13
+ remap?(p: Path): Path | null;
14
+ /** the selection afterwards (default: the old one, remapped) */
15
+ select?: Path[];
16
+ }
17
+ /** What a view needs to know about a change. */
18
+ export interface Change {
19
+ kind: 'do' | 'undo' | 'redo' | 'load';
20
+ origin: Origin;
21
+ label: string;
22
+ /** the steps, in order, each against the text the one before produced */
23
+ steps: Step[];
24
+ version: number;
25
+ /** the text selection to put back (undo/redo of typing), opaque to the model */
26
+ textSel?: unknown;
27
+ /** typing: which text pane typed it (each pane skips only its own; another pane takes it like any change) */
28
+ source?: string;
29
+ /** where paths moved (a rename), so views can carry their own state (expanded rows) along */
30
+ remap?(p: Path): Path | null;
31
+ }
32
+ /** The selection changed, and which view changed it (a view doesn't react to its own). */
33
+ export interface SelectionChange {
34
+ paths: Path[];
35
+ origin: Origin;
36
+ }
37
+ export declare const HISTORY_DEPTH = 500;
38
+ export declare class EditorModel {
39
+ private _text;
40
+ private _doc;
41
+ private _version;
42
+ private undoStack;
43
+ private redoStack;
44
+ private nextId;
45
+ private cleanId;
46
+ private listeners;
47
+ private selListeners;
48
+ private _good;
49
+ /** the selected paths (tree, canvas, properties) */
50
+ selection: Path[];
51
+ /** the text pane's selection, as it last reported it (opaque) */
52
+ textSel: unknown;
53
+ /** how many commands needed a fallback (re-serialising a collection): for the tests */
54
+ fallbacks: number;
55
+ depth: number;
56
+ now: () => number;
57
+ constructor(text?: string);
58
+ get text(): string;
59
+ get version(): number;
60
+ get doc(): EditorDoc;
61
+ /** the document as last parsed without a YAML error: what the tree and canvas show while the text is broken */
62
+ get goodDoc(): EditorDoc;
63
+ /** Select paths (from a view). Every other view shows it. */
64
+ select(paths: Path[], origin: Origin): void;
65
+ onSelect(fn: (c: SelectionChange) => void): () => void;
66
+ on(fn: (c: Change) => void): () => void;
67
+ private emit;
68
+ /** A new file: the text, an empty history, clean. */
69
+ load(text: string, origin?: Origin): void;
70
+ private set;
71
+ /** Run a command: build it against the text, apply its steps, push it. Returns false if it changed nothing. */
72
+ apply(cmd: Command, origin?: Origin): boolean;
73
+ /**
74
+ * Text the user typed (one change from the text pane: edits against the text before it). The view has already
75
+ * made the change; the model takes it, and coalesces typing into one command per word or pause.
76
+ */
77
+ typed(step: Step, sel?: {
78
+ before?: unknown;
79
+ after?: unknown;
80
+ }, source?: string): void;
81
+ /** End the typing group being added to (a caret jump, a pause, leaving the text pane, a save). */
82
+ seal(): void;
83
+ private run;
84
+ private push;
85
+ get canUndo(): boolean;
86
+ get canRedo(): boolean;
87
+ get undoLabel(): string;
88
+ get redoLabel(): string;
89
+ undo(): boolean;
90
+ redo(): boolean;
91
+ /** The text was saved: this is the clean point. */
92
+ markClean(): void;
93
+ get dirty(): boolean;
94
+ /** the labels on the stack, oldest first (for tests and a history list) */
95
+ get history(): string[];
96
+ }
@@ -0,0 +1,28 @@
1
+ import type { EditorDoc } from './doc.js';
2
+ import { type Path } from './path.js';
3
+ import type { OutlineAdapter, FileRole } from './adapter.js';
4
+ export type NodeKind = 'root' | 'group' | 'resource' | 'key' | 'item';
5
+ export interface OutlineNode {
6
+ /** the JSON Pointer of the node's path (unique) */
7
+ id: string;
8
+ path: Path;
9
+ kind: NodeKind;
10
+ label: string;
11
+ /** a scalar's text, as written */
12
+ value?: string;
13
+ shape: 'map' | 'list' | 'scalar' | 'missing';
14
+ /** for an object and its group: its kind */
15
+ section?: string;
16
+ /** for an object: its tag (the reader's, else the adapter's from this file) */
17
+ lifetime?: string;
18
+ /** the key is an x-* extension */
19
+ ext?: boolean;
20
+ children: OutlineNode[];
21
+ }
22
+ /**
23
+ * @param tags the reader's tags by object name (with the base files merged), when known; without them an object's
24
+ * tag is the adapter's, from this file alone
25
+ */
26
+ export declare function outline(d: EditorDoc, a: OutlineAdapter, role?: FileRole, tags?: Map<string, string>): OutlineNode;
27
+ /** Every node, depth first (for search and keyboard). */
28
+ export declare function flatten(n: OutlineNode, out?: OutlineNode[]): OutlineNode[];
@@ -0,0 +1,7 @@
1
+ export type Seg = string | number;
2
+ export type Path = Seg[];
3
+ export declare const toPointer: (p: Path) => string;
4
+ export declare function fromPointer(ptr: string): Path;
5
+ export declare const parentOf: (p: Path) => Path | undefined;
6
+ export declare const isPrefix: (a: Path, b: Path) => boolean;
7
+ export declare const samePath: (a: Path, b: Path) => boolean;
@@ -0,0 +1,43 @@
1
+ import { EditorDoc } from './doc.js';
2
+ import { SchemaNav } from './schema-nav.js';
3
+ import { type Item } from './complete.js';
4
+ import type { Problem } from './validate.js';
5
+ import { type Path } from './path.js';
6
+ import type { ProvidersAdapter } from './adapter.js';
7
+ export declare function docFor(text: string): EditorDoc;
8
+ /** What the text panes ask, for one domain: completion, hover and go to definition, and the schema navigator for a
9
+ * text (the main one, or a base file's). */
10
+ export declare function providersFor(a: ProvidersAdapter): {
11
+ navFor: (text: string) => SchemaNav;
12
+ completionAt: (d: EditorDoc, offset: number) => {
13
+ from: number;
14
+ items: Item[];
15
+ };
16
+ hoverAt: (d: EditorDoc, offset: number) => {
17
+ from: number;
18
+ to: number;
19
+ parts: string[];
20
+ } | null;
21
+ definitionAt: (d: EditorDoc, offset: number) => {
22
+ from: number;
23
+ to: number;
24
+ } | {
25
+ open: string;
26
+ } | null;
27
+ };
28
+ export type Providers = ReturnType<typeof providersFor>;
29
+ /** Where a path is drawn in the text, to mark it: its whole pair, else its value. */
30
+ export declare function rangeOfPath(d: EditorDoc, p: Path): [number, number] | undefined;
31
+ /** A problem's range as offsets into the text (its lines and columns are 1-based), clamped to the text. */
32
+ export declare function problemRange(text: string, p: Pick<Problem, 'startLine' | 'startCol' | 'endLine' | 'endCol'>): [number, number];
33
+ /**
34
+ * Completion's snippets are written in Monaco's syntax (${1:name}, ${2|a,b|}, ${0}). CodeMirror's has fields (${1:name},
35
+ * ${}) but no choices: a choice becomes a field holding its first option (the others are offered as values once the
36
+ * caret is there), and the final ${0} an empty field.
37
+ */
38
+ export declare function cmSnippet(monaco: string): string;
39
+ /** The Markdown a hover or completion carries, as runs of text: plain, bold or code, in paragraphs (never markup). */
40
+ export declare function mdRuns(md: string): {
41
+ kind: 'text' | 'bold' | 'code';
42
+ text: string;
43
+ }[][];
@@ -0,0 +1,34 @@
1
+ import type { Path } from './path.js';
2
+ type J = Record<string, unknown>;
3
+ export interface KeyInfo {
4
+ name: string;
5
+ /** Markdown */
6
+ doc?: string;
7
+ /** the value's shape, for the text inserted after "key:" */
8
+ shape: 'map' | 'list' | 'scalar';
9
+ enumValues: string[];
10
+ examples: unknown[];
11
+ }
12
+ export declare class SchemaNav {
13
+ private root;
14
+ private defs;
15
+ constructor(schema: object);
16
+ /** a schema with its $ref and anyOf/allOf branches spread out (each branch is a candidate) */
17
+ private spread;
18
+ /** The candidate schemas at a path. A name in a section map matches additionalProperties; x-* keys match nothing useful. */
19
+ at(path: Path): J[];
20
+ /** The keys a map at this path may have (not counting x-*), given what the map holds now. */
21
+ keys(path: Path, present?: J): KeyInfo[];
22
+ private info;
23
+ /** The words a value at this path may be: enum values, consts, true/false. */
24
+ values(path: Path, cands?: J[]): string[];
25
+ /** Markdown for a path: the description of the key, plus allowed values. */
26
+ hover(path: Path): string | undefined;
27
+ /** A value to start a new key with: the first allowed value, else an empty one of the right shape. */
28
+ defaultFor(path: Path): unknown;
29
+ /** The value types a path takes (for parsing what is typed into the tree). */
30
+ types(path: Path): Set<string>;
31
+ /** Is the path a map of names (a section of named things)? */
32
+ isNameMap(path: Path): boolean;
33
+ }
34
+ export {};
@@ -0,0 +1,53 @@
1
+ import type { Path, Seg } from './path.js';
2
+ export interface TextEdit {
3
+ start: number;
4
+ end: number;
5
+ text: string;
6
+ }
7
+ /** one step: non-overlapping edits against the same text */
8
+ export type Step = TextEdit[];
9
+ export interface Splice {
10
+ steps: Step[];
11
+ fallback?: boolean;
12
+ }
13
+ export declare class SpliceError extends Error {
14
+ }
15
+ /** Apply one step's edits (non-overlapping) to a text. */
16
+ export declare function applyStep(text: string, step: Step): string;
17
+ /** The step that undoes `step` on the text it produced. */
18
+ export declare function invertStep(text: string, step: Step): Step;
19
+ type Style = string | undefined;
20
+ /** A scalar as YAML text. Keeps a quoting style when one is given; multi-line text becomes a block literal. */
21
+ export declare function scalarText(v: unknown, opts: {
22
+ flow: boolean;
23
+ indent: number;
24
+ style?: Style;
25
+ }): string;
26
+ /** A value inline, in flow style: { a: 1, b: [x, y] } */
27
+ export declare function flowText(v: unknown): string;
28
+ /** Set the value at a path (which must exist: use insertKey for a new key). */
29
+ export declare function setValue(text: string, path: Path, value: unknown): Splice;
30
+ /** Add `key: value` to the map at a path (creating the map, and its parents, when missing). order: the format's
31
+ * top-level key order, for where a new top-level key goes (the adapter's topOrder). */
32
+ export declare function insertKey(text: string, mapPath: Path, key: string, value: unknown, opts?: {
33
+ after?: string;
34
+ before?: string;
35
+ order?: readonly string[];
36
+ }): Splice;
37
+ /** Remove the entry at a path: a key and its value (with its own comment lines), or a list item. */
38
+ export declare function deleteAt(text: string, path: Path): Splice;
39
+ /** Add an item to the list at a path, at an index (default: the end). */
40
+ export declare function insertItem(text: string, listPath: Path, value: unknown, index?: number, order?: readonly string[]): Splice;
41
+ /** Rename a key in place. */
42
+ export declare function renameKey(text: string, path: Path, to: string): Splice;
43
+ /** Move a block map's entry (with its comment lines) to before another key, or to the end. */
44
+ export declare function moveKey(text: string, path: Path, before?: string, order?: readonly string[]): Splice;
45
+ export type { Seg };
46
+ /**
47
+ * Add a pair given as source text ("key: value", with its own comments, at indent 0) to the map at a path, re-indented
48
+ * to the map's; the text, comments and all, is kept. A flow map (or one the splices can't place a line in) takes the
49
+ * value's data instead. The map must exist (insertKey makes a missing one).
50
+ */
51
+ export declare function insertRawPair(text: string, mapPath: Path, key: string, pairText: string, order?: readonly string[]): Splice;
52
+ /** A pair's source text (its own comment lines, the key and its value, a comment after it), at indent 0. */
53
+ export declare function pairText(text: string, path: Path): string | undefined;
@@ -0,0 +1,5 @@
1
+ export declare const PREF: {
2
+ readonly view: 'view';
3
+ readonly live: 'live';
4
+ };
5
+ export declare const VIEWS: readonly ['text', 'both', 'canvas'];
@@ -0,0 +1,23 @@
1
+ import type { EditorModel, Command } from '../model.js';
2
+ import type { Commands } from '../commands.js';
3
+ import type { ObjectKindInfo, ObjectRef } from '../adapter.js';
4
+ import { type Path } from '../path.js';
5
+ /** what the shared actions are given of the domain */
6
+ export interface ActionsKit {
7
+ commands: Pick<Commands, 'deleteCmd' | 'renameCmd' | 'renameKeyCmd' | 'referencesTo' | 'describe' | 'duplicateCmd'>;
8
+ objectOf(ptr: string): ObjectRef | undefined;
9
+ kinds: ObjectKindInfo[];
10
+ nameRule: RegExp;
11
+ nameHint: string;
12
+ }
13
+ export declare function run(doc: EditorModel, c: Command, origin: 'canvas' | 'props' | 'menu', note?: (t: string, tone?: 'bad') => void): boolean;
14
+ /** Several commands as one undo step. */
15
+ export declare function composite(label: string, cmds: Command[]): Command;
16
+ /** The shared actions, for one domain. */
17
+ export declare function actionsFor(kit: ActionsKit): {
18
+ deletePaths: (doc: EditorModel, paths: Path[], origin: 'canvas' | 'props' | 'menu', note?: (t: string, tone?: 'bad') => void) => Promise<boolean>;
19
+ renameDialog: (doc: EditorModel, path: Path, origin: 'canvas' | 'props' | 'menu', note?: (t: string, tone?: 'bad') => void) => Promise<boolean>;
20
+ duplicate: (doc: EditorModel, path: Path, origin: 'canvas' | 'menu', note?: (t: string, tone?: 'bad') => void) => void;
21
+ connected: (doc: EditorModel, paths: Path[]) => Path[];
22
+ };
23
+ export type Actions = ReturnType<typeof actionsFor>;
@@ -0,0 +1,65 @@
1
+ import type { EditorModel } from '../model.js';
2
+ import type { Path } from '../path.js';
3
+ export interface Box {
4
+ x: number;
5
+ y: number;
6
+ w: number;
7
+ h: number;
8
+ }
9
+ export type Outline = {
10
+ kind: 'poly';
11
+ id: string;
12
+ points: [number, number][];
13
+ } | {
14
+ kind: 'route';
15
+ d: string;
16
+ };
17
+ /** what the canvas gives a layer (D: the domain's drawn document) */
18
+ export interface CanvasCtx<D> {
19
+ host: HTMLElement;
20
+ doc: EditorModel;
21
+ cd(): D | undefined;
22
+ svg(): SVGSVGElement | undefined;
23
+ elementsFor(ptr: string): SVGGraphicsElement[];
24
+ boxOf(e: SVGGraphicsElement): Box;
25
+ union(bs: Box[]): Box | undefined;
26
+ outlinesFor(ptr: string): Outline[];
27
+ scale(): number;
28
+ /** the whole drawing's box */
29
+ full(): Box | undefined;
30
+ toSvg(x: number, y: number): {
31
+ x: number;
32
+ y: number;
33
+ };
34
+ autoFit(): void;
35
+ /** paint the overlay again (the layer's paint() runs in it) */
36
+ paint(): void;
37
+ /** pan to it, if it is outside the view */
38
+ reveal(p: Path): void;
39
+ note(t: string, tone?: 'info' | 'warn' | 'bad'): void;
40
+ }
41
+ /** what a layer gives the canvas; A: its calls, added to what the canvas returns */
42
+ export interface CanvasLayer<A extends object> {
43
+ tools?: HTMLElement[];
44
+ marks?: HTMLElement[];
45
+ /** each new drawing: the layer's groups, put after the overlay's */
46
+ groups?(): SVGGElement[];
47
+ /** a new drawing is on the stage */
48
+ drawn?(): void;
49
+ /** what a fit takes in besides the drawing */
50
+ extent?(): Box[];
51
+ /** the layer shows marks (the view keeps them in a fit) */
52
+ showing?(): boolean;
53
+ /** after the overlay's own marks */
54
+ paint?(d: Document): void;
55
+ /** a press the layer takes (true: the canvas does nothing more) */
56
+ down?(e: PointerEvent): boolean;
57
+ /** a menu the layer opens (true: the canvas's own isn't) */
58
+ context?(e: MouseEvent, at: {
59
+ x: number;
60
+ y: number;
61
+ }): boolean;
62
+ /** a key: handled (the canvas stops it), ignore (the canvas leaves it be), or not the layer's */
63
+ key?(e: KeyboardEvent): 'handled' | 'ignore' | undefined;
64
+ api: A;
65
+ }
@@ -0,0 +1,279 @@
1
+ import { type IconName } from './icons.js';
2
+ import { type MenuItem } from './menu.js';
3
+ import { type Actions } from './actions.js';
4
+ import { type Move } from '../../iso-objects/geometry.js';
5
+ import { type KindCatalog } from '../../iso-objects/kinds.js';
6
+ import type { CompiledScene } from '../../iso-objects/compile.js';
7
+ import type { EditorModel } from '../model.js';
8
+ import type { Problem } from '../validate.js';
9
+ import { type Commands } from '../commands.js';
10
+ import type { ObjectKindInfo, ObjectRef } from '../adapter.js';
11
+ import { type Path } from '../path.js';
12
+ import { type View } from '../../iso-viewer/viewport.js';
13
+ import type { CanvasCtx, CanvasLayer } from './canvas-layer.js';
14
+ import type { FlatStyle } from '../../iso-viewer/flat-view.js';
15
+ import type { FlatOptions } from '../../iso-objects/flat.js';
16
+ import type { SvgMorph } from '../../iso-viewer/morph.js';
17
+ /** what the canvas draws: the domain's drawn document */
18
+ export interface CanvasDrawing {
19
+ scene: CompiledScene;
20
+ /** the frame: the scene's SVG */
21
+ svg: string;
22
+ /** data-id → the JSON pointer in the file it shows */
23
+ pathOf: Map<string, string>;
24
+ /** object name → the id of the element a pin moves */
25
+ pinId: Map<string, string>;
26
+ /** pins that couldn't apply, with why */
27
+ pinNotes: string[];
28
+ diags: string[];
29
+ }
30
+ /** a scene drawn in 2D, as the canvas uses it (flat-canvas.ts makes it) */
31
+ export interface FlatDrawn {
32
+ svg: string;
33
+ /** its viewBox */
34
+ full: [number, number, number, number];
35
+ /** the layout (for tests) */
36
+ layout: unknown;
37
+ /** the outlines of these drawn ids: a card's or a panel's rect, a link's path */
38
+ outlines(ids: Set<string>, svg: SVGSVGElement): ({
39
+ kind: 'poly';
40
+ id: string;
41
+ points: [number, number][];
42
+ } | {
43
+ kind: 'route';
44
+ d: string;
45
+ })[];
46
+ /** the ids of the cards and panels in a rectangle (or touching it) */
47
+ hits(r: {
48
+ l: number;
49
+ t: number;
50
+ r: number;
51
+ b: number;
52
+ }, touch: boolean): string[];
53
+ /** the panels under a point, innermost first */
54
+ panelsAt(x: number, y: number): string[];
55
+ }
56
+ /** the 2D view's implementation, handed to the canvas by its host */
57
+ export interface FlatCanvas {
58
+ draw(scene: CompiledScene, stage: Element, o: {
59
+ styles?: Record<string, FlatStyle>;
60
+ title?: string;
61
+ options?: Partial<FlatOptions>;
62
+ }): FlatDrawn;
63
+ /** (0.7.5) the switch's morph, from the view on the stage to the other, both laid out in `root`: undefined when it
64
+ * shouldn't animate (the motion option, reduced motion); the canvas shows and hides the two drawings itself */
65
+ morph?(root: HTMLElement, scene: CompiledScene, from: {
66
+ svg: SVGSVGElement;
67
+ mode: '3d' | '2d';
68
+ }, to: SVGSVGElement, o: {
69
+ duration?: number;
70
+ motion?: 'auto' | 'always' | 'never';
71
+ }): SvgMorph | undefined;
72
+ }
73
+ /** a drop into a container: what the new object is made as, and the words for it */
74
+ export interface DropInto {
75
+ container: string;
76
+ value(container: string): unknown;
77
+ label(container: string): string;
78
+ }
79
+ /** the canvas's words and names */
80
+ export interface CanvasUi {
81
+ /** the stage's class (the host's canvas CSS is scoped under it), and the drawing's class while the space key is down */
82
+ rootClass: string;
83
+ panKeyClass: string;
84
+ /** the kinds the canvas's menu offers, in order */
85
+ newOrder: string[];
86
+ palette: {
87
+ kind: string;
88
+ icon: IconName;
89
+ label: string;
90
+ }[];
91
+ text: {
92
+ stage: string;
93
+ dragGroup: string;
94
+ dragSelectTip: string;
95
+ unreadable: string;
96
+ palette: string;
97
+ /** the end of a pin drag's hint */
98
+ pinHint: string;
99
+ renameWhy: string;
100
+ duplicateWhy: string;
101
+ };
102
+ }
103
+ /** what the canvas is given of the domain (M: the domain's reading of the file; D: its drawing) */
104
+ export interface CanvasKit<M, D extends CanvasDrawing> {
105
+ draw(model: M, data: unknown, theme: string): D;
106
+ /** the drawing a text would be (a trial: where a drop lands), or undefined */
107
+ trial(text: string, theme: string): D | undefined;
108
+ catalog: KindCatalog;
109
+ objectOf(ptr: string): ObjectRef | undefined;
110
+ kinds: ObjectKindInfo[];
111
+ commands: Pick<Commands, 'setCmd' | 'deleteCmd' | 'insertCmd' | 'pinsCmd' | 'withPinsMoved' | 'describe' | 'freshName'>;
112
+ actions: Actions;
113
+ /** what an object's own menu offers, beyond rename, duplicate and delete */
114
+ objectItems(doc: EditorModel, path: Path, origin: 'canvas' | 'menu', note?: (t: string, tone?: 'bad') => void): MenuItem[];
115
+ pins: {
116
+ key: string;
117
+ legacyKey?: string;
118
+ of(data: unknown): Record<string, unknown> | undefined;
119
+ keyOf(data: unknown): string;
120
+ legacyOnly(data: unknown): boolean;
121
+ };
122
+ /** the 2D view (0.6.4): offered as a 3D | 2D switch when given. `load` hands over its implementation (flat-canvas.ts;
123
+ * the canvas never names it, so a host without a 2D view bundles none of it). In 2D, selecting, the menu, renaming,
124
+ * deleting, adding from the palette (into a panel, or placed by the layout) and undo work as in 3D; pins (moving)
125
+ * are 3D only. The host's canvas CSS has the 2D view's (flatCss), scoped as the drawing's is. */
126
+ flat?: {
127
+ load(): Promise<FlatCanvas>;
128
+ styles?: Record<string, FlatStyle>;
129
+ title?: string;
130
+ options?: Partial<FlatOptions>;
131
+ /** (0.7.5) the switch morphs, as dualView does: 'auto' (the default) honours prefers-reduced-motion, 'always' morphs
132
+ * regardless, 'never' swaps at once; `duration` in ms (600) */
133
+ motion?: 'auto' | 'always' | 'never';
134
+ duration?: number;
135
+ };
136
+ /** a drop of this kind onto a container's floor (none: it is pinned where it drops) */
137
+ dropInto?(kind: string): DropInto | undefined;
138
+ ui: CanvasUi;
139
+ }
140
+ export interface CanvasOpts<M, D extends CanvasDrawing, A extends object = object> {
141
+ kit: CanvasKit<M, D>;
142
+ theme: string;
143
+ problems(): Problem[];
144
+ note(t: string, tone?: 'info' | 'warn' | 'bad'): void;
145
+ showInText(p: Path): void;
146
+ showInTree(p: Path): void;
147
+ onZoom(pct: number): void;
148
+ /** the navigation modes, for the status bar */
149
+ onHint?(text: string): void;
150
+ /** Copy, Cut and Paste for the menu */
151
+ clipItems?(): MenuItem[];
152
+ /** where the navigation modes are kept between visits (the host's storage); none: for this mount only */
153
+ store?: {
154
+ get(k: string): string | null;
155
+ set(k: string, v: string | null): void;
156
+ };
157
+ /** a layer over the drawing (none: the drawing and its marks only) */
158
+ layer?: (ctx: CanvasCtx<D>) => CanvasLayer<A>;
159
+ }
160
+ export declare function canvasView<M, D extends CanvasDrawing, A extends object = object>(host: HTMLElement, doc: EditorModel, opts: CanvasOpts<M, D, A>): {
161
+ addFromPalette: (sec: string, at?: {
162
+ x: number;
163
+ y: number;
164
+ }) => Path | undefined;
165
+ palette: HTMLDivElement;
166
+ render: (s3: M | undefined, data: unknown) => Promise<void>;
167
+ setTheme: (_t: 'light' | 'dark') => void;
168
+ paintOverlay: () => void;
169
+ fit: () => void;
170
+ fitAll: (box?: View | undefined) => void;
171
+ actual: () => void;
172
+ zoomAt: (f: number, cx?: number, cy?: number) => void;
173
+ itemsBox: () => {
174
+ x: number;
175
+ y: number;
176
+ w: number;
177
+ h: number;
178
+ } | undefined;
179
+ readonly moved: boolean;
180
+ settled: () => Promise<void>;
181
+ readonly zoom: number;
182
+ dispose(): void;
183
+ focus: () => void;
184
+ /** for the tests */
185
+ readonly view: View | undefined;
186
+ readonly doc: D | undefined;
187
+ /** the view (3D or 2D), and the 2D layout while it shows */
188
+ readonly mode: "2d" | "3d";
189
+ setMode: (m: '3d' | '2d') => void;
190
+ readonly flat: unknown;
191
+ stage: HTMLDivElement;
192
+ key: (e: KeyboardEvent) => void;
193
+ scale: () => number;
194
+ nav: {
195
+ wheel: 'zoom' | 'scroll';
196
+ drag: 'pan' | 'select';
197
+ };
198
+ paintNav: () => void;
199
+ outlinesFor: (ptr: string) => ({
200
+ kind: 'poly';
201
+ id: string;
202
+ points: [number, number][];
203
+ } | {
204
+ kind: 'route';
205
+ d: string;
206
+ })[];
207
+ footprints: () => Map<string, {
208
+ x0: number;
209
+ y0: number;
210
+ x1: number;
211
+ y1: number;
212
+ }>;
213
+ readonly drag: {
214
+ kind: 'pan' | 'marquee' | 'pin' | 'click';
215
+ x0: number;
216
+ y0: number;
217
+ v0?: View;
218
+ emptyClick?: boolean;
219
+ start?: [number, number];
220
+ shown?: [number, number];
221
+ z0?: number;
222
+ size?: [number, number];
223
+ parent?: {
224
+ w: number;
225
+ d: number;
226
+ pad: number;
227
+ box: {
228
+ x0: number;
229
+ y0: number;
230
+ x1: number;
231
+ y1: number;
232
+ };
233
+ label: string;
234
+ };
235
+ siblings?: {
236
+ x0: number;
237
+ y0: number;
238
+ x1: number;
239
+ y1: number;
240
+ }[];
241
+ move?: Move;
242
+ invalid?: boolean;
243
+ step?: number;
244
+ origCd?: D;
245
+ gridShown?: boolean;
246
+ /** siblings that flow after the dragged item, pinned where they stand so the drag doesn't push them */
247
+ keep?: [string, [number, number]][];
248
+ sel0?: Path[];
249
+ add?: boolean;
250
+ touch?: boolean;
251
+ name?: string;
252
+ id?: string;
253
+ box?: {
254
+ x: number;
255
+ y: number;
256
+ w: number;
257
+ h: number;
258
+ };
259
+ moved?: boolean;
260
+ ptr?: string;
261
+ narrow?: string;
262
+ } | undefined;
263
+ readonly lastMarquee: {
264
+ x0: number;
265
+ y0: number;
266
+ x1: number;
267
+ y1: number;
268
+ } | undefined;
269
+ boxFor: (p: Path) => {
270
+ x: number;
271
+ y: number;
272
+ w: number;
273
+ h: number;
274
+ } | undefined;
275
+ pageXYOf: (p: Path) => {
276
+ x: number;
277
+ y: number;
278
+ } | undefined;
279
+ } & A;
@@ -0,0 +1,14 @@
1
+ import type { Clipboard } from '../clipboard.js';
2
+ import type { EditorModel } from '../model.js';
3
+ import type { MenuItem } from './menu.js';
4
+ export interface Clip {
5
+ /** the menu items for what is selected */
6
+ items(): MenuItem[];
7
+ /** handle the clipboard events of a document (the page, or the canvas's frame) */
8
+ attach(d: EventTarget, owns: (target: EventTarget | null) => boolean): () => void;
9
+ copy(): Promise<boolean>;
10
+ cut(): Promise<boolean>;
11
+ paste(text?: string): Promise<boolean>;
12
+ }
13
+ /** the page's clipboard over the domain's (its copyText, cutCmd and pasteCmd: src/iso-editor/clipboard.ts) */
14
+ export declare function clipboard(doc: EditorModel, note: (t: string, tone?: 'info' | 'warn' | 'bad') => void, services: Clipboard): Clip;
@@ -0,0 +1,7 @@
1
+ export interface DialogButton {
2
+ label: string;
3
+ value: string;
4
+ primary?: boolean;
5
+ danger?: boolean;
6
+ }
7
+ export declare function ask(title: string, body: (Node | string)[], buttons: DialogButton[]): Promise<string | null>;
@@ -0,0 +1,2 @@
1
+ import type { FlatCanvas } from './canvas.js';
2
+ export declare const flatCanvas: FlatCanvas;