@dineug/erd-editor 3.6.0 → 3.8.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 (107) hide show
  1. package/README.md +21 -24
  2. package/dist/components/erd/automatic-table-placement/AutomaticTablePlacement.d.ts +5 -15
  3. package/dist/components/erd/automatic-table-placement/runElkPlacement.d.ts +23 -0
  4. package/dist/components/erd/canvas/CanvasScene.d.ts +3 -3
  5. package/dist/components/erd/canvas/entityDrag.d.ts +5 -4
  6. package/dist/components/erd/canvas/highlightTransition.d.ts +35 -0
  7. package/dist/components/erd/canvas/memo/useMoveMemo.d.ts +3 -1
  8. package/dist/components/erd/canvas/mixColor.d.ts +7 -0
  9. package/dist/components/erd/canvas/relationship-group/RelationshipGroup.d.ts +2 -0
  10. package/dist/components/erd/canvas/relationship-group/relationship/Relationship.d.ts +2 -0
  11. package/dist/components/erd/canvas/relationship-group/relationship/Relationship.template.d.ts +3 -3
  12. package/dist/components/erd/canvas/sceneHit.d.ts +7 -6
  13. package/dist/components/erd/canvas/sceneTokens.d.ts +30 -4
  14. package/dist/components/erd/canvas/table/Table.d.ts +7 -0
  15. package/dist/components/erd/canvas/table/cellLayout.d.ts +48 -18
  16. package/dist/components/erd/canvas/table/column/Column.d.ts +26 -0
  17. package/dist/components/erd/canvas/table/goToErd.d.ts +18 -0
  18. package/dist/components/erd/canvas/table/useMoveTable.d.ts +3 -1
  19. package/dist/components/erd/canvas/table/useViewPin.d.ts +19 -0
  20. package/dist/components/erd/canvas/useMoveEntity.d.ts +9 -2
  21. package/dist/components/erd/content-compass/ContentCompass.d.ts +1 -1
  22. package/dist/components/erd/content-compass/compassGeometry.d.ts +27 -4
  23. package/dist/components/erd/erd-context-menu/menus/tablePlacementMenus.d.ts +24 -0
  24. package/dist/components/erd/floating-toolbar/FloatingToolbar.d.ts +3 -3
  25. package/dist/components/erd/floating-toolbar/FloatingToolbar.styles.d.ts +3 -0
  26. package/dist/components/erd/floating-toolbar/ToolbarCompass.template.d.ts +14 -0
  27. package/dist/components/erd/minimap/MinimapScene.d.ts +1 -1
  28. package/dist/components/erd/minimap/minimapGeometry.d.ts +4 -3
  29. package/dist/components/flowCenters.d.ts +10 -0
  30. package/dist/components/primitives/code-block/CodeBlock.d.ts +2 -2
  31. package/dist/components/primitives/icon/icons.d.ts +7 -0
  32. package/dist/components/sceneSourceContext.d.ts +10 -0
  33. package/dist/components/theme-builder/ThemeBuilder.styles.d.ts +5 -0
  34. package/dist/components/visualization/Visualization.d.ts +3 -4
  35. package/dist/components/visualization/VisualizationFlow.d.ts +10 -0
  36. package/dist/components/visualization/VisualizationGraph.d.ts +10 -0
  37. package/dist/components/visualization/flowLayout.d.ts +29 -0
  38. package/dist/components/visualization/graphViewHandle.d.ts +33 -0
  39. package/dist/components/visualization/particles/ParticleLayer.d.ts +10 -0
  40. package/dist/components/visualization/particles/particleEdges.d.ts +15 -0
  41. package/dist/components/visualization/particles/particleLoop.d.ts +28 -0
  42. package/dist/components/visualization/particles/particlePath.d.ts +83 -0
  43. package/dist/components/visualization/useViewGestures.d.ts +24 -0
  44. package/dist/components/visualization/visualization-toolbar/VisualizationToolbar.d.ts +10 -0
  45. package/dist/components/visualization/visualization-toolbar/VisualizationToolbar.styles.d.ts +4 -0
  46. package/dist/components/visualization/visualizationView.d.ts +29 -5
  47. package/dist/components/visualization/zoomVisualization.d.ts +20 -0
  48. package/dist/constants/layout.d.ts +50 -0
  49. package/dist/constants/tablePlacement.d.ts +16 -0
  50. package/dist/constants/zoom.d.ts +7 -0
  51. package/dist/engine/actions.d.ts +6 -0
  52. package/dist/engine/index.js +12 -12
  53. package/dist/engine/modules/editor/actions.d.ts +60 -2
  54. package/dist/engine/modules/editor/atom.actions.d.ts +136 -0
  55. package/dist/engine/modules/editor/generator.actions.d.ts +16 -4
  56. package/dist/engine/modules/editor/state.d.ts +41 -0
  57. package/dist/engine/modules/editor/view.actions.d.ts +270 -0
  58. package/dist/engine/modules/editor/view.d.ts +28 -0
  59. package/dist/engine/modules/editor/view.generator.actions.d.ts +24 -0
  60. package/dist/engine/modules/settings/atom.actions.d.ts +17 -3
  61. package/dist/engine/modules/settings/generator.actions.d.ts +6 -4
  62. package/dist/engine/rx-operators/viewActionRedirect.d.ts +10 -0
  63. package/dist/engine/rx-operators/viewIgnoreFilter.d.ts +10 -0
  64. package/dist/erd-editor.umd.js +319 -282
  65. package/dist/index.d.ts +0 -1
  66. package/dist/index.dev.d.ts +0 -1
  67. package/dist/index.js +6238 -4937
  68. package/dist/konva/scene/columnDropTarget.d.ts +2 -1
  69. package/dist/konva/scene/contentBounds.d.ts +12 -5
  70. package/dist/konva/scene/fitZoom.d.ts +16 -0
  71. package/dist/konva/scene/metrics.d.ts +6 -5
  72. package/dist/konva/scene/viewFreeze.d.ts +10 -7
  73. package/dist/konva/scene/viewLayout.d.ts +89 -0
  74. package/dist/konva/scene/viewport.d.ts +17 -4
  75. package/dist/{schemaGCService--wGet5O7.js → schemaGCService-CXVjeF9p.js} +3145 -2655
  76. package/dist/services/elk-layout/elkGraph.d.ts +83 -0
  77. package/dist/services/elk-layout/elkLayout.shared-worker.d.ts +2 -0
  78. package/dist/services/elk-layout/elkLayoutOptions.d.ts +46 -0
  79. package/dist/services/elk-layout/elkLayoutService.d.ts +25 -0
  80. package/dist/services/elk-layout/elkWorkerRealm.d.ts +2 -0
  81. package/dist/services/elk-layout/index.d.ts +19 -0
  82. package/dist/services/shiki/index.d.ts +10 -0
  83. package/dist/services/shiki/shiki.shared-worker.d.ts +2 -0
  84. package/dist/services/shiki/shikiService.d.ts +18 -0
  85. package/dist/utils/calcTable.d.ts +27 -1
  86. package/dist/utils/clickGesture.d.ts +19 -0
  87. package/dist/utils/domEvent.d.ts +12 -0
  88. package/dist/utils/draw-relationship/bezier.d.ts +32 -0
  89. package/dist/utils/draw-relationship/calc.d.ts +6 -1
  90. package/dist/utils/draw-relationship/geometrySource.d.ts +9 -0
  91. package/dist/utils/draw-relationship/incremental.d.ts +7 -1
  92. package/dist/utils/draw-relationship/index.d.ts +37 -11
  93. package/dist/utils/draw-relationship/pathFinding.d.ts +2 -1
  94. package/dist/utils/draw-relationship/route.d.ts +5 -3
  95. package/dist/utils/draw-relationship/sort.d.ts +2 -1
  96. package/dist/utils/draw-relationship/stub.d.ts +9 -4
  97. package/dist/utils/emitter.d.ts +18 -7
  98. package/dist/utils/globalEventObservable.d.ts +6 -1
  99. package/dist/utils/keyboard-shortcut/index.d.ts +2 -1
  100. package/dist/utils/promise.d.ts +6 -0
  101. package/dist/workers/elkLayout.shared-worker.js +1 -0
  102. package/dist/workers/exportPng.shared-worker.js +26 -26
  103. package/dist/workers/shiki.shared-worker.js +1 -0
  104. package/dist/workers/spawn.d.ts +5 -3
  105. package/dist/workers/spawn.inline.d.ts +2 -0
  106. package/package.json +7 -4
  107. package/dist/services/shikiService.d.ts +0 -9
@@ -0,0 +1,7 @@
1
+ /** The zoom a scene opens at, and the one the reset chord puts it back to. */
2
+ export declare const ZOOM_RESET = 1;
3
+ /** How far one zoom chord steps the zoom, in or out. */
4
+ export declare const ZOOM_STEP = 0.04;
5
+ /** How far one wheel notch carrying the modifier zooms, on the ERD tab and in a view alike. */
6
+ export declare const WHEEL_ZOOM_STEP = 0.03;
7
+ //# sourceMappingURL=zoom.d.ts.map
@@ -28,6 +28,12 @@ export type ActionType = keyof RootActionMap;
28
28
  export declare const actions: Actions;
29
29
  export declare const ChangeActionTypes: ReadonlyArray<ActionType>;
30
30
  export declare const ReadonlyIgnoreActionTypes: ReadonlyArray<ActionType>;
31
+ /**
32
+ * What a view keeps from the document while it is active: every edit a
33
+ * readonly host refuses, less the host replacing the document outright, which
34
+ * a view cannot stand in the way of and answers by closing.
35
+ */
36
+ export declare const ViewIgnoreActionTypes: ReadonlyArray<ActionType>;
31
37
  export declare const SharedStreamActionTypes: ReadonlyArray<ActionType>;
32
38
  export declare const SharedActionTypes: ReadonlyArray<ActionType>;
33
39
  export declare const SharedFollowingActionTypes: ReadonlyArray<ActionType>;
@@ -1,33 +1,33 @@
1
- import { Rr as e, Wt as t, b as n, g as r, jn as i, l as a, m as o, n as s, on as c, q as l, r as u, t as d, ui as f } from "../schemaGCService--wGet5O7.js";
1
+ import { In as e, X as t, Yt as n, _ as r, _i as i, dn as a, h as o, n as s, qi as c, r as l, t as u, u as d, x as f } from "../schemaGCService-CXVjeF9p.js";
2
2
  import { isEmpty as p } from "es-toolkit/compat";
3
3
  import { omit as m } from "es-toolkit";
4
4
  import { Observable as h, Subject as g, debounceTime as _, map as v } from "rxjs";
5
5
  //#region src/engine/replication-store.ts
6
6
  var y = { change: "change" };
7
7
  function b(b) {
8
- let x = /* @__PURE__ */ new Set(), S = r(b), C = a(S, !1);
9
- C.dispatchSync(c({
8
+ let x = /* @__PURE__ */ new Set(), S = r(b), C = d(S, !1);
9
+ C.dispatchSync(a({
10
10
  width: 0,
11
11
  height: 0
12
12
  }));
13
- let w = u(C), T = new g(), E = new h((e) => C.subscribe((t) => e.next(t))).pipe(o(n), _(200)), D = /* @__PURE__ */ new Set(), O = new d(), k = (e) => (D.has(e) || D.add(e), () => {
13
+ let w = l(C), T = new g(), E = new h((e) => C.subscribe((t) => e.next(t))).pipe(o(f), _(200)), D = /* @__PURE__ */ new Set(), O = new u(), k = (e) => (D.has(e) || D.add(e), () => {
14
14
  D.delete(e);
15
- }), A = (e, n) => {
15
+ }), A = (e, t) => {
16
16
  D.forEach((r) => {
17
17
  let i = Reflect.get(r, e);
18
- t(i, n);
18
+ n(i, t);
19
19
  });
20
- }, j = (t) => {
21
- let n = e(t);
22
- C.dispatchSync(l(p(n) ? "{}" : n)), O.run(f(C.state)).then((e) => {
23
- (e.tableIds.length || e.tableColumnIds.length || e.relationshipIds.length || e.indexIds.length || e.indexColumnIds.length || e.memoIds.length) && (s(C.state, e), C.dispatchSync(i()));
20
+ }, j = (n) => {
21
+ let r = i(n);
22
+ C.dispatchSync(t(p(r) ? "{}" : r)), O.run(c(C.state)).then((t) => {
23
+ (t.tableIds.length || t.tableColumnIds.length || t.relationshipIds.length || t.indexIds.length || t.indexColumnIds.length || t.memoIds.length) && (s(C.state, t), C.dispatchSync(e()));
24
24
  });
25
25
  }, M = (e) => {
26
26
  T.next([e].flat());
27
27
  };
28
- return x.add(E.subscribe(() => A(y.change, void 0))).add(T.pipe(o(n), v((e) => e.map((e) => m(e, ["tags"])))).subscribe(C.dispatchSync)), Object.freeze({
28
+ return x.add(E.subscribe(() => A(y.change, void 0))).add(T.pipe(o(f), v((e) => e.map((e) => m(e, ["tags"])))).subscribe(C.dispatchSync)), Object.freeze({
29
29
  get value() {
30
- return f(C.state);
30
+ return c(C.state);
31
31
  },
32
32
  on: k,
33
33
  setInitialValue: j,
@@ -1,9 +1,9 @@
1
1
  import { Reducer } from '@dineug/r-html';
2
2
  import { EngineContext } from '../../context';
3
3
  import { RootState } from '../../state';
4
- import { LWW, ValuesType } from '../../../internal-types';
4
+ import { LWW, Point, ValuesType } from '../../../internal-types';
5
5
  import { Rect } from '../../../utils/dragSelect';
6
- import { FocusType, MoveKey, SelectType, SharedFocus } from './state';
6
+ import { FocusType, MoveKey, SelectType, SharedFocus, ShowMode, ViewKind, VisualizationMode } from './state';
7
7
  export declare const ActionType: {
8
8
  readonly changeHasHistory: "editor.changeHasHistory";
9
9
  readonly selectAll: "editor.selectAll";
@@ -43,6 +43,17 @@ export declare const ActionType: {
43
43
  readonly validationIds: "editor.validationIds";
44
44
  readonly getLWW: "editor.getLWW";
45
45
  readonly mergeLWW: "editor.mergeLWW";
46
+ readonly viewOpen: "editor.viewOpen";
47
+ readonly viewClose: "editor.viewClose";
48
+ readonly viewScrollTo: "editor.viewScrollTo";
49
+ readonly viewStreamScrollTo: "editor.viewStreamScrollTo";
50
+ readonly viewChangeZoomLevel: "editor.viewChangeZoomLevel";
51
+ readonly viewStreamZoomLevel: "editor.viewStreamZoomLevel";
52
+ readonly viewMoveTable: "editor.viewMoveTable";
53
+ readonly viewSetLayout: "editor.viewSetLayout";
54
+ readonly viewChangeShowMode: "editor.viewChangeShowMode";
55
+ readonly viewSetCenters: "editor.viewSetCenters";
56
+ readonly changeVisualizationMode: "editor.changeVisualizationMode";
46
57
  };
47
58
  export type ActionType = ValuesType<typeof ActionType>;
48
59
  export type ActionMap = {
@@ -143,6 +154,53 @@ export type ActionMap = {
143
154
  [ActionType.mergeLWW]: {
144
155
  lww: LWW;
145
156
  };
157
+ [ActionType.viewOpen]: {
158
+ kind: ViewKind;
159
+ /** The tables the view opens narrowed to; none and it opens on the whole document. */
160
+ centerIds?: string[];
161
+ };
162
+ [ActionType.viewClose]: {
163
+ kind: ViewKind;
164
+ };
165
+ [ActionType.viewScrollTo]: {
166
+ originX: number;
167
+ originY: number;
168
+ kind?: ViewKind;
169
+ };
170
+ [ActionType.viewStreamScrollTo]: {
171
+ movementX: number;
172
+ movementY: number;
173
+ kind?: ViewKind;
174
+ };
175
+ [ActionType.viewChangeZoomLevel]: {
176
+ value: number;
177
+ kind?: ViewKind;
178
+ };
179
+ [ActionType.viewStreamZoomLevel]: {
180
+ value: number;
181
+ kind?: ViewKind;
182
+ };
183
+ [ActionType.viewMoveTable]: {
184
+ ids: string[];
185
+ movementX: number;
186
+ movementY: number;
187
+ kind?: ViewKind;
188
+ };
189
+ [ActionType.viewSetLayout]: {
190
+ kind: ViewKind;
191
+ positions: Record<string, Point>;
192
+ };
193
+ [ActionType.viewChangeShowMode]: {
194
+ value: ShowMode;
195
+ kind?: ViewKind;
196
+ };
197
+ [ActionType.viewSetCenters]: {
198
+ tableIds: string[];
199
+ kind?: ViewKind;
200
+ };
201
+ [ActionType.changeVisualizationMode]: {
202
+ value: VisualizationMode;
203
+ };
146
204
  };
147
205
  export type ReducerType<T extends keyof ActionMap> = Reducer<RootState, T, ActionMap, EngineContext>;
148
206
  //# sourceMappingURL=actions.d.ts.map
@@ -309,6 +309,17 @@ export declare const mergeLWWAction: {
309
309
  type: string;
310
310
  };
311
311
  export declare const editorReducers: {
312
+ "editor.viewOpen": ReducerType<"editor.viewOpen">;
313
+ "editor.viewClose": ReducerType<"editor.viewClose">;
314
+ "editor.viewScrollTo": ReducerType<"editor.viewScrollTo">;
315
+ "editor.viewStreamScrollTo": ReducerType<"editor.viewStreamScrollTo">;
316
+ "editor.viewChangeZoomLevel": ReducerType<"editor.viewChangeZoomLevel">;
317
+ "editor.viewStreamZoomLevel": ReducerType<"editor.viewStreamZoomLevel">;
318
+ "editor.viewMoveTable": ReducerType<"editor.viewMoveTable">;
319
+ "editor.viewSetLayout": ReducerType<"editor.viewSetLayout">;
320
+ "editor.viewChangeShowMode": ReducerType<"editor.viewChangeShowMode">;
321
+ "editor.viewSetCenters": ReducerType<"editor.viewSetCenters">;
322
+ "editor.changeVisualizationMode": ReducerType<"editor.changeVisualizationMode">;
312
323
  "editor.changeHasHistory": ReducerType<"editor.changeHasHistory">;
313
324
  "editor.selectAll": ReducerType<"editor.selectAll">;
314
325
  "editor.unselectAll": ReducerType<"editor.unselectAll">;
@@ -349,6 +360,131 @@ export declare const editorReducers: {
349
360
  "editor.mergeLWW": ReducerType<"editor.mergeLWW">;
350
361
  };
351
362
  export declare const actions: {
363
+ viewOpenAction: {
364
+ (payload: {
365
+ kind: import('./state').ViewKind;
366
+ centerIds?: string[];
367
+ }): import('@dineug/r-html').AnyAction<{
368
+ kind: import('./state').ViewKind;
369
+ centerIds?: string[];
370
+ }>;
371
+ toString(): string;
372
+ type: string;
373
+ };
374
+ viewCloseAction: {
375
+ (payload: {
376
+ kind: import('./state').ViewKind;
377
+ }): import('@dineug/r-html').AnyAction<{
378
+ kind: import('./state').ViewKind;
379
+ }>;
380
+ toString(): string;
381
+ type: string;
382
+ };
383
+ viewScrollToAction: {
384
+ (payload: {
385
+ originX: number;
386
+ originY: number;
387
+ kind?: import('./state').ViewKind;
388
+ }): import('@dineug/r-html').AnyAction<{
389
+ originX: number;
390
+ originY: number;
391
+ kind?: import('./state').ViewKind;
392
+ }>;
393
+ toString(): string;
394
+ type: string;
395
+ };
396
+ viewStreamScrollToAction: {
397
+ (payload: {
398
+ movementX: number;
399
+ movementY: number;
400
+ kind?: import('./state').ViewKind;
401
+ }): import('@dineug/r-html').AnyAction<{
402
+ movementX: number;
403
+ movementY: number;
404
+ kind?: import('./state').ViewKind;
405
+ }>;
406
+ toString(): string;
407
+ type: string;
408
+ };
409
+ viewChangeZoomLevelAction: {
410
+ (payload: {
411
+ value: number;
412
+ kind?: import('./state').ViewKind;
413
+ }): import('@dineug/r-html').AnyAction<{
414
+ value: number;
415
+ kind?: import('./state').ViewKind;
416
+ }>;
417
+ toString(): string;
418
+ type: string;
419
+ };
420
+ viewStreamZoomLevelAction: {
421
+ (payload: {
422
+ value: number;
423
+ kind?: import('./state').ViewKind;
424
+ }): import('@dineug/r-html').AnyAction<{
425
+ value: number;
426
+ kind?: import('./state').ViewKind;
427
+ }>;
428
+ toString(): string;
429
+ type: string;
430
+ };
431
+ viewMoveTableAction: {
432
+ (payload: {
433
+ ids: string[];
434
+ movementX: number;
435
+ movementY: number;
436
+ kind?: import('./state').ViewKind;
437
+ }): import('@dineug/r-html').AnyAction<{
438
+ ids: string[];
439
+ movementX: number;
440
+ movementY: number;
441
+ kind?: import('./state').ViewKind;
442
+ }>;
443
+ toString(): string;
444
+ type: string;
445
+ };
446
+ viewSetLayoutAction: {
447
+ (payload: {
448
+ kind: import('./state').ViewKind;
449
+ positions: Record<string, import('../../../internal-types').Point>;
450
+ }): import('@dineug/r-html').AnyAction<{
451
+ kind: import('./state').ViewKind;
452
+ positions: Record<string, import('../../../internal-types').Point>;
453
+ }>;
454
+ toString(): string;
455
+ type: string;
456
+ };
457
+ viewChangeShowModeAction: {
458
+ (payload: {
459
+ value: import('./state').ShowMode;
460
+ kind?: import('./state').ViewKind;
461
+ }): import('@dineug/r-html').AnyAction<{
462
+ value: import('./state').ShowMode;
463
+ kind?: import('./state').ViewKind;
464
+ }>;
465
+ toString(): string;
466
+ type: string;
467
+ };
468
+ viewSetCentersAction: {
469
+ (payload: {
470
+ tableIds: string[];
471
+ kind?: import('./state').ViewKind;
472
+ }): import('@dineug/r-html').AnyAction<{
473
+ tableIds: string[];
474
+ kind?: import('./state').ViewKind;
475
+ }>;
476
+ toString(): string;
477
+ type: string;
478
+ };
479
+ changeVisualizationModeAction: {
480
+ (payload: {
481
+ value: import('./state').VisualizationMode;
482
+ }): import('@dineug/r-html').AnyAction<{
483
+ value: import('./state').VisualizationMode;
484
+ }>;
485
+ toString(): string;
486
+ type: string;
487
+ };
352
488
  changeHasHistoryAction: {
353
489
  (payload: {
354
490
  hasUndo: boolean;
@@ -1,11 +1,17 @@
1
1
  import { GeneratorAction } from '../../generator.actions';
2
2
  import { Point } from '../../../internal-types';
3
3
  import { Rect } from '../../../utils/dragSelect';
4
+ import { GeometrySource } from '../../../utils/draw-relationship/geometrySource';
4
5
  import { ClipboardPayload } from '../../../utils/table-clipboard';
5
6
  import { MoveKey } from './state';
6
7
  export declare const loadJsonAction$: (value: string) => GeneratorAction;
7
8
  export declare const initialLoadJsonAction$: (value: string) => GeneratorAction;
8
- export declare const moveAllAction$: (movementX: number, movementY: number) => GeneratorAction;
9
+ /**
10
+ * Moves the selection by a pointer step, scaled by the zoom of the scene the
11
+ * drag runs in. From a view scene the step goes to that view's own placement,
12
+ * which holds tables alone, and the document's placement is left where it is.
13
+ */
14
+ export declare const moveAllAction$: (movementX: number, movementY: number, source?: GeometrySource) => GeneratorAction;
9
15
  export declare const removeSelectedAction$: () => GeneratorAction;
10
16
  export type DuplicateConfig = {
11
17
  tableIds?: string[];
@@ -15,7 +21,12 @@ export type DuplicateConfig = {
15
21
  };
16
22
  export declare const pasteEntitiesAction$: (payload: ClipboardPayload, pasteRound: number) => GeneratorAction;
17
23
  export declare const duplicateAction$: ({ tableIds, memoIds, offset, escapeCollision, }: DuplicateConfig) => GeneratorAction;
18
- export declare const dragSelectAction$: (dragRect: Rect) => GeneratorAction;
24
+ /**
25
+ * Selects what the rect covers among what the source shows, each entity read
26
+ * at the point and the size that source draws it: a view places its tables
27
+ * and shows no memo, so a marquee drawn over it picks by the view, not the document.
28
+ */
29
+ export declare const dragSelectAction$: (dragRect: Rect, source?: GeometrySource) => GeneratorAction;
19
30
  export declare const unselectAllAction$: () => GeneratorAction;
20
31
  export declare const focusMoveTableAction$: (moveKey: MoveKey, shiftKey: boolean) => GeneratorAction;
21
32
  export declare const drawStartRelationshipAction$: (relationshipType: number) => GeneratorAction;
@@ -30,13 +41,14 @@ export declare const dragoverColumnAction$: (targetId: string, targetTableId: st
30
41
  export declare const columnKeyHoverStartAction$: (columnId: string) => GeneratorAction;
31
42
  export declare const columnKeyHoverEndAction$: () => GeneratorAction;
32
43
  export declare const actions$: {
44
+ focusFlowTableAction$: (tableIds: string[]) => GeneratorAction;
33
45
  loadJsonAction$: (value: string) => GeneratorAction;
34
46
  initialLoadJsonAction$: (value: string) => GeneratorAction;
35
- moveAllAction$: (movementX: number, movementY: number) => GeneratorAction;
47
+ moveAllAction$: (movementX: number, movementY: number, source?: GeometrySource) => GeneratorAction;
36
48
  removeSelectedAction$: () => GeneratorAction;
37
49
  pasteEntitiesAction$: (payload: ClipboardPayload, pasteRound: number) => GeneratorAction;
38
50
  duplicateAction$: ({ tableIds, memoIds, offset, escapeCollision, }: DuplicateConfig) => GeneratorAction;
39
- dragSelectAction$: (dragRect: Rect) => GeneratorAction;
51
+ dragSelectAction$: (dragRect: Rect, source?: GeometrySource) => GeneratorAction;
40
52
  unselectAllAction$: () => GeneratorAction;
41
53
  focusMoveTableAction$: (moveKey: MoveKey, shiftKey: boolean) => GeneratorAction;
42
54
  drawStartRelationshipAction$: (relationshipType: number) => GeneratorAction;
@@ -36,6 +36,14 @@ export type Editor = {
36
36
  sharedSelectionTrackerMap: Record<string, SharedSelectionTracker>;
37
37
  sharedDragSelectTrackerMap: Record<string, SharedDragSelectTracker>;
38
38
  dragSelect: Rect | null;
39
+ /**
40
+ * The scene view a reader can stand in over the document: the Flow mode of
41
+ * the visualization tab, null while it is not open. Local to this client,
42
+ * never the file, the history or a peer.
43
+ */
44
+ views: EditorViews;
45
+ /** Which of its two modes the visualization tab shows. Remembered for the session. */
46
+ visualizationMode: VisualizationMode;
39
47
  };
40
48
  export type Viewport = {
41
49
  width: number;
@@ -90,6 +98,39 @@ export declare const SelectType: {
90
98
  readonly memo: "memo";
91
99
  };
92
100
  export type SelectType = ValuesType<typeof SelectType>;
101
+ export declare const ShowMode: {
102
+ readonly nameOnly: "nameOnly";
103
+ readonly keysOnly: "keysOnly";
104
+ readonly allFields: "allFields";
105
+ };
106
+ export type ShowMode = ValuesType<typeof ShowMode>;
107
+ export declare const ViewKind: {
108
+ readonly flow: "flow";
109
+ };
110
+ export type ViewKind = ValuesType<typeof ViewKind>;
111
+ export declare const VisualizationMode: {
112
+ readonly graph: "graph";
113
+ readonly flow: "flow";
114
+ };
115
+ export type VisualizationMode = ValuesType<typeof VisualizationMode>;
116
+ /**
117
+ * A scene drawn over the document in its own coordinates: the tables it places
118
+ * by id, the placement it is looked at through, and what it shows of each
119
+ * table. Memos are never placed, so a view draws none.
120
+ */
121
+ export type SceneView = {
122
+ kind: ViewKind;
123
+ showMode: ShowMode;
124
+ positions: Record<string, Point>;
125
+ originX: number;
126
+ originY: number;
127
+ zoomLevel: number;
128
+ /** The tables the view narrows to, and none while it shows the whole document. */
129
+ centerIds: string[];
130
+ };
131
+ export type EditorViews = {
132
+ flow: SceneView | null;
133
+ };
93
134
  export declare const FocusType: {
94
135
  readonly tableName: "tableName";
95
136
  readonly tableComment: "tableComment";
@@ -0,0 +1,270 @@
1
+ import { ReducerType } from './actions';
2
+ import { Editor, ViewKind } from './state';
3
+ /** Drops the view, which is what any replacement of the document owes it. */
4
+ export declare function clearViews(editor: Editor): void;
5
+ export declare const viewOpenAction: {
6
+ (payload: {
7
+ kind: ViewKind;
8
+ centerIds?: string[];
9
+ }): import('@dineug/r-html').AnyAction<{
10
+ kind: ViewKind;
11
+ centerIds?: string[];
12
+ }>;
13
+ toString(): string;
14
+ type: string;
15
+ };
16
+ export declare const viewCloseAction: {
17
+ (payload: {
18
+ kind: ViewKind;
19
+ }): import('@dineug/r-html').AnyAction<{
20
+ kind: ViewKind;
21
+ }>;
22
+ toString(): string;
23
+ type: string;
24
+ };
25
+ export declare const viewScrollToAction: {
26
+ (payload: {
27
+ originX: number;
28
+ originY: number;
29
+ kind?: ViewKind;
30
+ }): import('@dineug/r-html').AnyAction<{
31
+ originX: number;
32
+ originY: number;
33
+ kind?: ViewKind;
34
+ }>;
35
+ toString(): string;
36
+ type: string;
37
+ };
38
+ export declare const viewStreamScrollToAction: {
39
+ (payload: {
40
+ movementX: number;
41
+ movementY: number;
42
+ kind?: ViewKind;
43
+ }): import('@dineug/r-html').AnyAction<{
44
+ movementX: number;
45
+ movementY: number;
46
+ kind?: ViewKind;
47
+ }>;
48
+ toString(): string;
49
+ type: string;
50
+ };
51
+ export declare const viewChangeZoomLevelAction: {
52
+ (payload: {
53
+ value: number;
54
+ kind?: ViewKind;
55
+ }): import('@dineug/r-html').AnyAction<{
56
+ value: number;
57
+ kind?: ViewKind;
58
+ }>;
59
+ toString(): string;
60
+ type: string;
61
+ };
62
+ export declare const viewStreamZoomLevelAction: {
63
+ (payload: {
64
+ value: number;
65
+ kind?: ViewKind;
66
+ }): import('@dineug/r-html').AnyAction<{
67
+ value: number;
68
+ kind?: ViewKind;
69
+ }>;
70
+ toString(): string;
71
+ type: string;
72
+ };
73
+ export declare const viewMoveTableAction: {
74
+ (payload: {
75
+ ids: string[];
76
+ movementX: number;
77
+ movementY: number;
78
+ kind?: ViewKind;
79
+ }): import('@dineug/r-html').AnyAction<{
80
+ ids: string[];
81
+ movementX: number;
82
+ movementY: number;
83
+ kind?: ViewKind;
84
+ }>;
85
+ toString(): string;
86
+ type: string;
87
+ };
88
+ export declare const viewSetLayoutAction: {
89
+ (payload: {
90
+ kind: ViewKind;
91
+ positions: Record<string, import('../../../internal-types').Point>;
92
+ }): import('@dineug/r-html').AnyAction<{
93
+ kind: ViewKind;
94
+ positions: Record<string, import('../../../internal-types').Point>;
95
+ }>;
96
+ toString(): string;
97
+ type: string;
98
+ };
99
+ export declare const viewChangeShowModeAction: {
100
+ (payload: {
101
+ value: import('./state').ShowMode;
102
+ kind?: ViewKind;
103
+ }): import('@dineug/r-html').AnyAction<{
104
+ value: import('./state').ShowMode;
105
+ kind?: ViewKind;
106
+ }>;
107
+ toString(): string;
108
+ type: string;
109
+ };
110
+ export declare const viewSetCentersAction: {
111
+ (payload: {
112
+ tableIds: string[];
113
+ kind?: ViewKind;
114
+ }): import('@dineug/r-html').AnyAction<{
115
+ tableIds: string[];
116
+ kind?: ViewKind;
117
+ }>;
118
+ toString(): string;
119
+ type: string;
120
+ };
121
+ export declare const changeVisualizationModeAction: {
122
+ (payload: {
123
+ value: import('./state').VisualizationMode;
124
+ }): import('@dineug/r-html').AnyAction<{
125
+ value: import('./state').VisualizationMode;
126
+ }>;
127
+ toString(): string;
128
+ type: string;
129
+ };
130
+ export declare const viewReducers: {
131
+ "editor.viewOpen": ReducerType<"editor.viewOpen">;
132
+ "editor.viewClose": ReducerType<"editor.viewClose">;
133
+ "editor.viewScrollTo": ReducerType<"editor.viewScrollTo">;
134
+ "editor.viewStreamScrollTo": ReducerType<"editor.viewStreamScrollTo">;
135
+ "editor.viewChangeZoomLevel": ReducerType<"editor.viewChangeZoomLevel">;
136
+ "editor.viewStreamZoomLevel": ReducerType<"editor.viewStreamZoomLevel">;
137
+ "editor.viewMoveTable": ReducerType<"editor.viewMoveTable">;
138
+ "editor.viewSetLayout": ReducerType<"editor.viewSetLayout">;
139
+ "editor.viewChangeShowMode": ReducerType<"editor.viewChangeShowMode">;
140
+ "editor.viewSetCenters": ReducerType<"editor.viewSetCenters">;
141
+ "editor.changeVisualizationMode": ReducerType<"editor.changeVisualizationMode">;
142
+ };
143
+ export declare const viewActions: {
144
+ viewOpenAction: {
145
+ (payload: {
146
+ kind: ViewKind;
147
+ centerIds?: string[];
148
+ }): import('@dineug/r-html').AnyAction<{
149
+ kind: ViewKind;
150
+ centerIds?: string[];
151
+ }>;
152
+ toString(): string;
153
+ type: string;
154
+ };
155
+ viewCloseAction: {
156
+ (payload: {
157
+ kind: ViewKind;
158
+ }): import('@dineug/r-html').AnyAction<{
159
+ kind: ViewKind;
160
+ }>;
161
+ toString(): string;
162
+ type: string;
163
+ };
164
+ viewScrollToAction: {
165
+ (payload: {
166
+ originX: number;
167
+ originY: number;
168
+ kind?: ViewKind;
169
+ }): import('@dineug/r-html').AnyAction<{
170
+ originX: number;
171
+ originY: number;
172
+ kind?: ViewKind;
173
+ }>;
174
+ toString(): string;
175
+ type: string;
176
+ };
177
+ viewStreamScrollToAction: {
178
+ (payload: {
179
+ movementX: number;
180
+ movementY: number;
181
+ kind?: ViewKind;
182
+ }): import('@dineug/r-html').AnyAction<{
183
+ movementX: number;
184
+ movementY: number;
185
+ kind?: ViewKind;
186
+ }>;
187
+ toString(): string;
188
+ type: string;
189
+ };
190
+ viewChangeZoomLevelAction: {
191
+ (payload: {
192
+ value: number;
193
+ kind?: ViewKind;
194
+ }): import('@dineug/r-html').AnyAction<{
195
+ value: number;
196
+ kind?: ViewKind;
197
+ }>;
198
+ toString(): string;
199
+ type: string;
200
+ };
201
+ viewStreamZoomLevelAction: {
202
+ (payload: {
203
+ value: number;
204
+ kind?: ViewKind;
205
+ }): import('@dineug/r-html').AnyAction<{
206
+ value: number;
207
+ kind?: ViewKind;
208
+ }>;
209
+ toString(): string;
210
+ type: string;
211
+ };
212
+ viewMoveTableAction: {
213
+ (payload: {
214
+ ids: string[];
215
+ movementX: number;
216
+ movementY: number;
217
+ kind?: ViewKind;
218
+ }): import('@dineug/r-html').AnyAction<{
219
+ ids: string[];
220
+ movementX: number;
221
+ movementY: number;
222
+ kind?: ViewKind;
223
+ }>;
224
+ toString(): string;
225
+ type: string;
226
+ };
227
+ viewSetLayoutAction: {
228
+ (payload: {
229
+ kind: ViewKind;
230
+ positions: Record<string, import('../../../internal-types').Point>;
231
+ }): import('@dineug/r-html').AnyAction<{
232
+ kind: ViewKind;
233
+ positions: Record<string, import('../../../internal-types').Point>;
234
+ }>;
235
+ toString(): string;
236
+ type: string;
237
+ };
238
+ viewChangeShowModeAction: {
239
+ (payload: {
240
+ value: import('./state').ShowMode;
241
+ kind?: ViewKind;
242
+ }): import('@dineug/r-html').AnyAction<{
243
+ value: import('./state').ShowMode;
244
+ kind?: ViewKind;
245
+ }>;
246
+ toString(): string;
247
+ type: string;
248
+ };
249
+ viewSetCentersAction: {
250
+ (payload: {
251
+ tableIds: string[];
252
+ kind?: ViewKind;
253
+ }): import('@dineug/r-html').AnyAction<{
254
+ tableIds: string[];
255
+ kind?: ViewKind;
256
+ }>;
257
+ toString(): string;
258
+ type: string;
259
+ };
260
+ changeVisualizationModeAction: {
261
+ (payload: {
262
+ value: import('./state').VisualizationMode;
263
+ }): import('@dineug/r-html').AnyAction<{
264
+ value: import('./state').VisualizationMode;
265
+ }>;
266
+ toString(): string;
267
+ type: string;
268
+ };
269
+ };
270
+ //# sourceMappingURL=view.actions.d.ts.map