@draftably/editor 0.1.0 → 0.2.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 (97) hide show
  1. package/README.md +4 -5
  2. package/dist/assets/{engine.worker-DmHew5f6.js → engine.worker-DwN9io_m.js} +2765 -2722
  3. package/dist/element.js +1 -1
  4. package/dist/index.js +19553 -2
  5. package/dist/types/src/components/controls.d.ts +8 -5
  6. package/dist/types/src/state/canvas-commands.d.ts +169 -0
  7. package/dist/types/src/state/canvas-keyboard.d.ts +15 -0
  8. package/dist/types/src/state/links.d.ts +4 -1
  9. package/dist/types/src/state/workspace.d.ts +3 -0
  10. package/package.json +1 -1
  11. package/dist/assets/import-d2.worker-CnXfFXoa.js +0 -5395
  12. package/dist/chunks/abnfDiagram-WEYOIA3C-llcpthp5.js +0 -87
  13. package/dist/chunks/arc-rJj0TtXf.js +0 -83
  14. package/dist/chunks/architectureDiagram-ZHVYKT53-CfiXg0Lk.js +0 -4781
  15. package/dist/chunks/blockDiagram-RJAE7QA3-CO-14jWz.js +0 -1440
  16. package/dist/chunks/browser-iNhbPsGc.js +0 -40
  17. package/dist/chunks/c4Diagram-XDPPPE54-DYKuxA4n.js +0 -1524
  18. package/dist/chunks/channel-qMvPU6eH.js +0 -5
  19. package/dist/chunks/chunk-2E7WHVMD-BEZwsFS3.js +0 -670
  20. package/dist/chunks/chunk-2Q5K7J3B-gqtzQ8ux.js +0 -18
  21. package/dist/chunks/chunk-4EMNKR2T-MC54CXVe.js +0 -262
  22. package/dist/chunks/chunk-55XCU76K-DkZUAaqC.js +0 -68
  23. package/dist/chunks/chunk-5VM5RSS4-CaKe4sjM.js +0 -19
  24. package/dist/chunks/chunk-JWPE2WC7-CnAFS2xF.js +0 -8
  25. package/dist/chunks/chunk-VQ5W62QI-CXRv7FiX.js +0 -19
  26. package/dist/chunks/chunk-XXDRQBXY-B-AMQgD2.js +0 -8
  27. package/dist/chunks/chunk-ZCHMQSOR-BALpdc3g.js +0 -451
  28. package/dist/chunks/classDiagram-v2-4MYWR3UA-wPjgJTg4.js +0 -1570
  29. package/dist/chunks/cose-bilkent-JH36ORCC-Bbh5ggBc.js +0 -2608
  30. package/dist/chunks/cynefin-EF2NZ3EQ-Bt6b88hY.js +0 -22361
  31. package/dist/chunks/cynefinDiagram-WF24UDRP-BHWZvxoF.js +0 -299
  32. package/dist/chunks/cytoscape.esm-CRsF_JA3.js +0 -18791
  33. package/dist/chunks/dagre-NK4GIZVX-Cz37yPrT.js +0 -2157
  34. package/dist/chunks/defaultLocale-BgPVtth8.js +0 -171
  35. package/dist/chunks/diagram-CBK3MWTC-Q2R6FJ0B.js +0 -531
  36. package/dist/chunks/diagram-I5XIIV2D-a2Kdu_wA.js +0 -153
  37. package/dist/chunks/diagram-ODIL2UCW-DTWXxcOn.js +0 -346
  38. package/dist/chunks/diagram-PFBEJUXE-DIAQQ5KX.js +0 -480
  39. package/dist/chunks/diagram-RJA3I4VV-BPD0GghS.js +0 -219
  40. package/dist/chunks/diagram-TYUNFSNR-BmdkONfG.js +0 -2586
  41. package/dist/chunks/dot-importer-B23jwEkx.js +0 -1547
  42. package/dist/chunks/ebnfDiagram-V4P3TTPT-C5IKvYlb.js +0 -109
  43. package/dist/chunks/elk-QONTBCTQ-CtdQFvh2.js +0 -49229
  44. package/dist/chunks/erDiagram-KYQIGQAA-5wguK9Dx.js +0 -1064
  45. package/dist/chunks/flowDiagram-IUGLLWBU-BijvFPku.js +0 -1771
  46. package/dist/chunks/ganttDiagram-R7GPNTJY-BaqGPz-O.js +0 -2729
  47. package/dist/chunks/gitGraphDiagram-PDYL7XHY-DZfMGyHE.js +0 -815
  48. package/dist/chunks/graph-CKJmgLki.js +0 -1541
  49. package/dist/chunks/import-core-C-I1wGfw.js +0 -145
  50. package/dist/chunks/infoDiagram-MVDRKAX5-C2vH_59e.js +0 -24
  51. package/dist/chunks/init-DjUOC4st.js +0 -16
  52. package/dist/chunks/ishikawaDiagram-HPEHV2GE-q149MFlV.js +0 -624
  53. package/dist/chunks/journeyDiagram-BOSHW7O7-D-2Z3VtR.js +0 -834
  54. package/dist/chunks/kanban-definition-FNSA4HC5-wvAjV5ub.js +0 -724
  55. package/dist/chunks/katex-BsrBVQKd.js +0 -11314
  56. package/dist/chunks/linear-4t7D_ros.js +0 -259
  57. package/dist/chunks/mermaid-facade-BoLWBerE.js +0 -289
  58. package/dist/chunks/mermaid-importer-Cgx1IhmR.js +0 -478
  59. package/dist/chunks/mermaid.core-DXv6D2Sm.js +0 -19244
  60. package/dist/chunks/mindmap-definition-6OY57UG3-r9wTKul_.js +0 -837
  61. package/dist/chunks/mount-C1Xk_GQz.js +0 -22131
  62. package/dist/chunks/ordinal-DfAQgscy.js +0 -61
  63. package/dist/chunks/pegDiagram-ECIUJNBX-CmKlFWiP.js +0 -95
  64. package/dist/chunks/pieDiagram-GNMPY74T-DNTw_qan.js +0 -208
  65. package/dist/chunks/quadrantDiagram-D57K4MC3-CT_tvVub.js +0 -1029
  66. package/dist/chunks/railroadDiagram-Y72NRBL7-C5TUvZBe.js +0 -77
  67. package/dist/chunks/requirementDiagram-EQYSW5RA-C_c65aCa.js +0 -889
  68. package/dist/chunks/sankeyDiagram-SY24JHO5-CKcbizM1.js +0 -859
  69. package/dist/chunks/sequenceDiagram-BLEHNHQU-GpVnHOjf.js +0 -2972
  70. package/dist/chunks/sizeCapture-INFHLROL-CToN3JSu.js +0 -46
  71. package/dist/chunks/stateDiagram-v2-A6IESKWZ-rJYd2FfM.js +0 -1520
  72. package/dist/chunks/swimlanes-B3ENRKFQ-C7w5pfxG.js +0 -4991
  73. package/dist/chunks/swimlanesDiagram-AYQRV4AK-BpGY_bvE.js +0 -13
  74. package/dist/chunks/timeline-definition-JXYKGLGB-ChKFPBKc.js +0 -1058
  75. package/dist/chunks/usecaseDiagram-WPOLBNNX-skXH8Dcu.js +0 -7945
  76. package/dist/chunks/vennDiagram-Q3Y3IDCW-C5KknmJf.js +0 -1578
  77. package/dist/chunks/wardleyDiagram-IVAIDKWA-DY4Lkfpu.js +0 -678
  78. package/dist/chunks/xychartDiagram-4URNHDU4-BHScsL7h.js +0 -1536
  79. package/dist/types/src/import/browser.d.ts +0 -3
  80. package/dist/types/src/import/detect.d.ts +0 -31
  81. package/dist/types/src/import/dot-importer.d.ts +0 -3
  82. package/dist/types/src/import/import-core.d.ts +0 -105
  83. package/dist/types/src/import/mermaid-facade.d.ts +0 -120
  84. package/dist/types/src/import/mermaid-importer.d.ts +0 -4
  85. package/dist/types/src/import/mermaid-sequence.d.ts +0 -8
  86. package/dist/types/src/import/scratch.d.ts +0 -3
  87. package/dist/types/src/lib/source-hash.d.ts +0 -7
  88. package/dist/types/src/model/candidates.d.ts +0 -53
  89. package/dist/types/src/model/examples.d.ts +0 -15
  90. package/dist/types/src/model/label-hits.d.ts +0 -27
  91. package/dist/types/src/model/static-scene.d.ts +0 -15
  92. package/dist/types/src/state/commands.d.ts +0 -529
  93. package/dist/types/src/state/comparison.d.ts +0 -151
  94. package/dist/types/src/state/files.d.ts +0 -61
  95. package/dist/types/src/state/keyboard.d.ts +0 -6
  96. package/dist/types/src/state/launch.d.ts +0 -61
  97. package/dist/types/src/state/ui.d.ts +0 -39
@@ -1,529 +0,0 @@
1
- /**
2
- * Named commands shared by the toolbar, menus and keyboard shortcuts.
3
- * While a timeline preview is open, only navigation and view commands run.
4
- */
5
- import { togglePanels } from './ui';
6
- export interface Command {
7
- label: string;
8
- /** Shortcut shown in menus. */
9
- keys?: string;
10
- icon?: string;
11
- /** What it does, in a sentence: shown in tooltips and the palette. */
12
- hint?: string;
13
- run: () => unknown;
14
- /** Allowed while a timeline preview is open. */
15
- duringTimeline?: boolean;
16
- /** Exits the brush before running. */
17
- endsBrush?: boolean;
18
- enabled?: () => boolean;
19
- /** Why this cannot work here, shown instead of running it. */
20
- blocked?: () => string | null;
21
- }
22
- declare let fileInput: ((replaceImageId: string | null, accept: 'diagram' | 'image' | 'foreign') => void) | null;
23
- /** Set by the app shell, which owns the hidden file inputs. */
24
- export declare const setFilePicker: (fn: typeof fileInput) => ((replaceImageId: string | null, accept: "diagram" | "image" | "foreign") => void) | null;
25
- declare function undoCommand(): void;
26
- declare function redoCommand(): void;
27
- /** Show the files panel and put the cursor in its filter. */
28
- declare function findFile(): void;
29
- /**
30
- * A served folder names the new diagram in its files panel. The static site replaces the
31
- * browser copy; from an example there, a blank scratch copy opens instead, like the Playground's.
32
- */
33
- declare function newDiagram(): Promise<void>;
34
- declare function openStart(): void;
35
- export declare const commands: {
36
- undo: {
37
- hint: string;
38
- label: string;
39
- keys: string;
40
- icon: string;
41
- run: typeof undoCommand;
42
- duringTimeline: true;
43
- enabled: () => boolean;
44
- };
45
- redo: {
46
- hint: string;
47
- label: string;
48
- keys: string;
49
- icon: string;
50
- run: typeof redoCommand;
51
- enabled: () => boolean;
52
- };
53
- 'add-node': {
54
- hint: string;
55
- label: string;
56
- keys: string;
57
- icon: string;
58
- run: () => void;
59
- };
60
- 'add-connected': {
61
- hint: string;
62
- label: string;
63
- keys: string;
64
- icon: string;
65
- run: () => string | undefined;
66
- };
67
- 'quick-build': {
68
- hint: string;
69
- label: string;
70
- keys: string;
71
- icon: string;
72
- run: () => void;
73
- };
74
- 'insert-step': {
75
- label: string;
76
- run: () => void;
77
- };
78
- duplicate: {
79
- hint: string;
80
- enabled: () => boolean;
81
- label: string;
82
- keys: string;
83
- icon: string;
84
- run: () => void;
85
- };
86
- group: {
87
- hint: string;
88
- enabled: () => boolean;
89
- label: string;
90
- keys: string;
91
- icon: string;
92
- run: () => string;
93
- };
94
- ungroup: {
95
- hint: string;
96
- enabled: () => boolean;
97
- label: string;
98
- keys: string;
99
- run: () => void;
100
- };
101
- pin: {
102
- hint: string;
103
- enabled: () => boolean;
104
- label: string;
105
- keys: string;
106
- icon: string;
107
- run: () => void;
108
- };
109
- 'release-manual': {
110
- hint: string;
111
- label: string;
112
- run: () => void;
113
- };
114
- delete: {
115
- hint: string;
116
- label: string;
117
- enabled: () => boolean;
118
- keys: string;
119
- icon: string;
120
- run: () => void;
121
- };
122
- 'delete-deep': {
123
- label: string;
124
- keys: string;
125
- run: () => void;
126
- };
127
- 'align-left': {
128
- label: string;
129
- icon: string;
130
- enabled: () => boolean;
131
- run: () => void;
132
- };
133
- 'align-top': {
134
- label: string;
135
- icon: string;
136
- enabled: () => boolean;
137
- run: () => void;
138
- };
139
- 'align-center': {
140
- label: string;
141
- icon: string;
142
- enabled: () => boolean;
143
- run: () => void;
144
- };
145
- 'align-middle': {
146
- label: string;
147
- icon: string;
148
- enabled: () => boolean;
149
- run: () => void;
150
- };
151
- 'distribute-x': {
152
- label: string;
153
- icon: string;
154
- enabled: () => boolean;
155
- run: () => void;
156
- };
157
- 'distribute-y': {
158
- label: string;
159
- icon: string;
160
- enabled: () => boolean;
161
- run: () => void;
162
- };
163
- 'fit-container': {
164
- label: string;
165
- run: () => void;
166
- };
167
- 'reflow-group': {
168
- hint: string;
169
- label: string;
170
- run: () => void;
171
- enabled: () => boolean;
172
- };
173
- 'collapse-selected': {
174
- label: string;
175
- run: () => void;
176
- };
177
- 'reverse-edge': {
178
- label: string;
179
- run: () => void;
180
- };
181
- 'reset-route': {
182
- label: string;
183
- run: () => void;
184
- };
185
- 'mark-start': {
186
- label: string;
187
- run: () => void;
188
- };
189
- 'mark-end': {
190
- label: string;
191
- run: () => void;
192
- };
193
- layout: {
194
- hint: string;
195
- label: string;
196
- keys: string;
197
- icon: string;
198
- run: () => Promise<import("./session/layout").LayoutOutcome>;
199
- blocked: () => string | null;
200
- endsBrush: true;
201
- };
202
- 'layout-rebuild': {
203
- hint: string;
204
- label: string;
205
- keys: string;
206
- run: () => Promise<import("./session/layout").LayoutOutcome>;
207
- blocked: () => string | null;
208
- endsBrush: true;
209
- };
210
- 'layout-preview': {
211
- label: string;
212
- run: () => Promise<import("./session/layout").LayoutOutcome>;
213
- blocked: () => string | null;
214
- endsBrush: true;
215
- };
216
- 'layout-accept': {
217
- label: string;
218
- run: () => void;
219
- };
220
- 'layout-discard': {
221
- label: string;
222
- run: () => void;
223
- };
224
- 'layout-menu': {
225
- hint: string;
226
- label: string;
227
- keys: string;
228
- icon: string;
229
- run: () => void;
230
- endsBrush: true;
231
- duringTimeline: true;
232
- };
233
- 'layout-checkpoint': {
234
- label: string;
235
- run: () => void;
236
- };
237
- 'layout-restore': {
238
- label: string;
239
- run: () => void;
240
- };
241
- 'compare-layouts': {
242
- hint: string;
243
- label: string;
244
- keys: string;
245
- run: () => void;
246
- blocked: () => string | null;
247
- endsBrush: true;
248
- };
249
- 'compare-routes': {
250
- hint: string;
251
- label: string;
252
- run: () => void;
253
- blocked: () => string | null;
254
- endsBrush: true;
255
- };
256
- reroute: {
257
- hint: string;
258
- label: string;
259
- keys: string;
260
- icon: string;
261
- run: () => void;
262
- };
263
- 'auto-ports': {
264
- hint: string;
265
- label: string;
266
- keys: string;
267
- run: () => void;
268
- };
269
- 'timeline-toggle': {
270
- hint: string;
271
- label: string;
272
- keys: string;
273
- icon: string;
274
- run: () => void | Promise<void>;
275
- blocked: () => string | null;
276
- duringTimeline: true;
277
- };
278
- 'timeline-reopen': {
279
- hint: string;
280
- label: string;
281
- icon: string;
282
- run: () => void;
283
- duringTimeline: true;
284
- };
285
- 'timeline-save': {
286
- hint: string;
287
- label: string;
288
- icon: string;
289
- run: () => void;
290
- duringTimeline: true;
291
- };
292
- 'brush-toggle': {
293
- hint: string;
294
- label: string;
295
- keys: string;
296
- icon: string;
297
- run: () => void;
298
- blocked: () => string | null;
299
- duringTimeline: true;
300
- };
301
- fit: {
302
- hint: string;
303
- label: string;
304
- keys: string;
305
- icon: string;
306
- run: () => void;
307
- duringTimeline: true;
308
- };
309
- 'zoom-in': {
310
- label: string;
311
- keys: string;
312
- icon: string;
313
- run: () => void;
314
- duringTimeline: true;
315
- };
316
- 'zoom-out': {
317
- label: string;
318
- keys: string;
319
- icon: string;
320
- run: () => void;
321
- duringTimeline: true;
322
- };
323
- 'reset-camera': {
324
- label: string;
325
- keys: string;
326
- run: () => void;
327
- duringTimeline: true;
328
- };
329
- 'toggle-objects': {
330
- hint: string;
331
- label: string;
332
- keys: string;
333
- icon: string;
334
- run: () => void;
335
- duringTimeline: true;
336
- };
337
- 'toggle-sidebar': {
338
- hint: string;
339
- label: string;
340
- icon: string;
341
- run: () => void;
342
- duringTimeline: true;
343
- };
344
- 'toggle-files': {
345
- hint: string;
346
- label: string;
347
- keys: string;
348
- icon: string;
349
- run: () => void;
350
- enabled: () => boolean;
351
- duringTimeline: true;
352
- };
353
- 'find-file': {
354
- hint: string;
355
- label: string;
356
- keys: string;
357
- icon: string;
358
- run: typeof findFile;
359
- enabled: () => boolean;
360
- duringTimeline: true;
361
- };
362
- 'toggle-inspector': {
363
- hint: string;
364
- label: string;
365
- keys: string;
366
- icon: string;
367
- run: () => void;
368
- duringTimeline: true;
369
- };
370
- 'toggle-source': {
371
- hint: string;
372
- label: string;
373
- keys: string;
374
- icon: string;
375
- run: () => void;
376
- duringTimeline: true;
377
- };
378
- 'toggle-panels': {
379
- hint: string;
380
- label: string;
381
- keys: string;
382
- run: typeof togglePanels;
383
- duringTimeline: true;
384
- };
385
- palette: {
386
- label: string;
387
- keys: string;
388
- icon: string;
389
- hint: string;
390
- run: () => void;
391
- duringTimeline: true;
392
- };
393
- help: {
394
- hint: string;
395
- label: string;
396
- keys: string;
397
- icon: string;
398
- run: () => void;
399
- duringTimeline: true;
400
- };
401
- start: {
402
- hint: string;
403
- label: string;
404
- icon: string;
405
- run: typeof openStart;
406
- duringTimeline: true;
407
- };
408
- 'new-diagram': {
409
- label: string;
410
- icon: string;
411
- run: typeof newDiagram;
412
- hint: string;
413
- };
414
- open: {
415
- hint: string;
416
- label: string;
417
- keys: string;
418
- icon: string;
419
- run: () => void | undefined;
420
- };
421
- 'save-example': {
422
- hint: string;
423
- label: string;
424
- icon: string;
425
- enabled: () => boolean;
426
- run: () => true;
427
- };
428
- 'import-diagram': {
429
- hint: string;
430
- label: string;
431
- icon: string;
432
- run: () => void | undefined;
433
- };
434
- 'insert-image': {
435
- hint: string;
436
- label: string;
437
- icon: string;
438
- run: () => void | undefined;
439
- };
440
- 'replace-image': {
441
- label: string;
442
- run: () => void | undefined;
443
- };
444
- 'export-json': {
445
- hint: string;
446
- label: string;
447
- keys: string;
448
- icon: string;
449
- run: () => Promise<void> | undefined;
450
- };
451
- 'export-folder': {
452
- hint: string;
453
- label: string;
454
- icon: string;
455
- enabled: () => boolean;
456
- run: () => void;
457
- };
458
- 'export-png': {
459
- hint: string;
460
- label: string;
461
- icon: string;
462
- run: () => void;
463
- };
464
- 'export-svg': {
465
- hint: string;
466
- label: string;
467
- icon: string;
468
- run: () => void;
469
- };
470
- 'export-pdf': {
471
- hint: string;
472
- label: string;
473
- icon: string;
474
- run: () => void;
475
- };
476
- 'copy-image': {
477
- hint: string;
478
- label: string;
479
- keys: string;
480
- icon: string;
481
- run: () => Promise<void> | undefined;
482
- };
483
- 'copy-svg': {
484
- label: string;
485
- icon: string;
486
- run: () => Promise<void> | undefined;
487
- };
488
- 'copy-source': {
489
- label: string;
490
- icon: string;
491
- run: () => Promise<void> | undefined;
492
- };
493
- 'copy-link': {
494
- label: string;
495
- icon: string;
496
- run: () => Promise<void> | undefined;
497
- };
498
- theme: {
499
- hint: string;
500
- label: string;
501
- icon: string;
502
- run: () => void;
503
- };
504
- home: {
505
- hint: string;
506
- label: string;
507
- icon: string;
508
- run: () => undefined;
509
- duringTimeline: true;
510
- };
511
- docs: {
512
- hint: string;
513
- label: string;
514
- icon: string;
515
- run: () => Window | null;
516
- duringTimeline: true;
517
- };
518
- 'open-playground': {
519
- hint: string;
520
- label: string;
521
- icon: string;
522
- enabled: () => boolean;
523
- run: () => void;
524
- };
525
- };
526
- export type CommandId = keyof typeof commands;
527
- export declare function runCommand(id: CommandId): undefined;
528
- export declare const commandEnabled: (id: CommandId) => boolean;
529
- export {};
@@ -1,151 +0,0 @@
1
- import { type CandidateResult, type ComparisonConfig, type ComparisonMode } from '../engines/explorer-engine.js';
2
- import { type Measure } from '../model/candidates';
3
- import { type ViewCamera } from '../model/camera';
4
- import { type StaticScene } from '../model/static-scene';
5
- import type { Diagram, IntentRole } from '../model/types';
6
- export type Presentation = 'grid' | 'overlay';
7
- export type CameraMode = 'sync' | 'focus' | 'independent';
8
- export type { ViewCamera };
9
- export interface Candidate {
10
- title: string;
11
- subtitle: string;
12
- status: 'pending' | 'ready' | 'error';
13
- error?: string;
14
- /** The drawing as it is now. The others are read against it, and it has nothing to apply. */
15
- current?: boolean;
16
- measure?: Measure;
17
- result?: CandidateResult;
18
- /** In a diagram file: the source this candidate compiles from, which Apply saves. */
19
- source?: string;
20
- scene?: StaticScene;
21
- camera: ViewCamera;
22
- layer: {
23
- visible: boolean;
24
- opacity: number;
25
- adjusted: boolean;
26
- };
27
- }
28
- interface ComparisonState {
29
- open: boolean;
30
- baseline: Diagram | null;
31
- signature: string;
32
- config: ComparisonConfig | null;
33
- generatedConfig: ComparisonConfig | null;
34
- cells: Candidate[];
35
- presentation: Presentation;
36
- controlsHidden: boolean;
37
- overlay: {
38
- camera: ViewCamera;
39
- active: number;
40
- allLabels: boolean;
41
- };
42
- cameraMode: CameraMode;
43
- focusId: string;
44
- shared: ViewCamera;
45
- busy: boolean;
46
- progress: {
47
- text: string;
48
- error: boolean;
49
- };
50
- expanded: number | null;
51
- /** Every candidate is on screen, not only the few chosen to show. */
52
- showAll: boolean;
53
- userCameraMoved: boolean;
54
- /** Measured size of each candidate viewport; index -1 is the overlay. */
55
- viewports: Record<number, {
56
- width: number;
57
- height: number;
58
- }>;
59
- }
60
- export declare const LAYER_COLORS: string[];
61
- export declare const comparison: ComparisonState;
62
- interface Sheet {
63
- shown: number[];
64
- others: number[];
65
- failed: number[];
66
- alike: number;
67
- }
68
- /** Which candidates to show: the current drawing, the best few, and the count of the rest. */
69
- export declare const comparisonSheet: import("solid-js").Accessor<Sheet>;
70
- /** Candidates on screen, in order. */
71
- export declare const shownCells: () => number[];
72
- export declare const toggleShowAll: () => void;
73
- export declare function openComparison(mode?: ComparisonMode): void;
74
- export declare function cancelGeneration(): void;
75
- export declare const rememberFocus: (el: Element | null) => Element | null;
76
- export declare function closeComparison(): void;
77
- export declare function updateConfig(patch: Partial<ComparisonConfig>): void;
78
- /** Switch between layout and routing comparisons, from the same frozen starting point. */
79
- export declare function setComparisonMode(mode: ComparisonMode): void;
80
- export declare function generate(override?: Partial<ComparisonConfig>): Promise<{
81
- status: string;
82
- ready?: undefined;
83
- total?: undefined;
84
- } | {
85
- status: string;
86
- ready: number;
87
- total: number;
88
- } | undefined>;
89
- /** Apply a candidate to the editor as one undo step. */
90
- export declare function applyCandidate(i: number): boolean;
91
- /** The `layout` or `routing` line a file candidate writes, as Apply would save it. */
92
- export declare const candidateChange: (source: string) => string;
93
- /** Record a viewport's size. Until the user moves a camera, every resize refits the views. */
94
- export declare function setViewport(i: number, size: {
95
- width: number;
96
- height: number;
97
- }): void;
98
- export declare function anchorFor(i: number): import("../model/types").Point;
99
- /** The camera a candidate is actually drawn with, given the camera mode. */
100
- export declare function effectiveCamera(i: number): ViewCamera;
101
- /** Ready candidates that are on screen: the shown ones, or only the enlarged one. */
102
- export declare const visibleReadyCells: () => {
103
- cell: Candidate;
104
- i: number;
105
- }[];
106
- export declare function fitCell(i: number): void;
107
- export declare function fitAll(): void;
108
- export declare function fitOverlay(): void;
109
- export declare function setCamera(i: number, next: ViewCamera): void;
110
- export declare function panCamera(i: number, dx: number, dy: number): void;
111
- /** Zoom around a point given relative to the viewport center. */
112
- export declare function zoomCamera(i: number, factor: number, dx?: number, dy?: number): void;
113
- export declare function actualSize(): void;
114
- export declare function setCameraMode(mode: CameraMode): void;
115
- export declare function setPresentation(mode: Presentation): void;
116
- export declare const toggleControls: () => void;
117
- export declare function toggleExpanded(i: number): void;
118
- /** Center every candidate (and the overlay) on the same object. Display only. */
119
- export declare function chooseAnchor(id: string): void;
120
- export declare function emphasizeLayer(i: number): void;
121
- export declare const setLayerVisible: (i: number, visible: boolean) => void;
122
- export declare const setLayerOpacity: (i: number, opacity: number) => void;
123
- export declare const setAllLabels: (on: boolean) => void;
124
- /** Choose the clicked shape as the preferred start or end for the next generation. */
125
- export declare function setComparisonIntent(role: IntentRole, clear?: boolean): void;
126
- export declare function setIntentPlacement(role: IntentRole, placement: NonNullable<ComparisonConfig['intent'][IntentRole]>['placement']): void;
127
- /** Column count that keeps candidates as large as possible. */
128
- export declare function gridColumns(size: {
129
- width: number;
130
- height: number;
131
- }): number;
132
- export declare function experiment(): {
133
- format: string;
134
- version: number;
135
- baseline: Diagram | null;
136
- config: ComparisonConfig | null;
137
- cameraMode: CameraMode;
138
- focusId: string;
139
- presentation: Presentation;
140
- overlay: {
141
- camera: ViewCamera;
142
- active: number;
143
- allLabels: boolean;
144
- };
145
- layers: {
146
- visible: boolean;
147
- opacity: number;
148
- adjusted: boolean;
149
- }[];
150
- candidates: (CandidateResult | undefined)[];
151
- } | null;