@dineug/erd-editor 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/appContext.d.ts +8 -1
- package/dist/components/erd/automatic-table-placement/createAutomaticTablePlacement.d.ts +17 -1
- package/dist/components/erd/canvas/Canvas.d.ts +5 -0
- package/dist/components/erd/canvas/Canvas.styles.d.ts +11 -0
- package/dist/components/erd/canvas/CanvasScene.d.ts +18 -0
- package/dist/components/erd/canvas/EditOverlay.d.ts +8 -0
- package/dist/components/erd/canvas/EditOverlay.styles.d.ts +6 -0
- package/dist/components/erd/canvas/SceneIcon.template.d.ts +21 -0
- package/dist/components/erd/canvas/drag-select/DragSelect.d.ts +11 -0
- package/dist/components/erd/canvas/duplicate-ghost/DuplicateGhost.d.ts +5 -0
- package/dist/components/erd/canvas/entityDrag.d.ts +4 -0
- package/dist/components/erd/canvas/high-level-table/HighLevelTable.d.ts +4 -0
- package/dist/components/erd/canvas/memo/Memo.d.ts +2 -0
- package/dist/components/erd/canvas/memo/memo-sash/MemoSash.d.ts +11 -1
- package/dist/components/erd/canvas/memo/memoCaret.d.ts +26 -0
- package/dist/components/erd/canvas/memo/memoScroll.d.ts +28 -0
- package/dist/components/erd/canvas/memo/memoText.d.ts +33 -0
- package/dist/components/erd/canvas/memo/useMoveMemo.d.ts +6 -0
- package/dist/components/erd/canvas/relationship-group/RelationshipGroup.d.ts +15 -0
- package/dist/components/erd/canvas/relationship-group/relationship/Relationship.template.d.ts +17 -0
- package/dist/components/erd/canvas/sceneHit.d.ts +18 -0
- package/dist/components/erd/canvas/sceneKind.d.ts +11 -0
- package/dist/components/erd/canvas/sceneRetention.d.ts +31 -0
- package/dist/components/erd/canvas/sceneTokens.d.ts +67 -0
- package/dist/components/erd/canvas/shared-drag-select/SharedDragSelect.d.ts +4 -0
- package/dist/components/erd/canvas/shared-mouse-tracker/SharedMouseTracker.d.ts +1 -0
- package/dist/components/erd/canvas/shared-mouse-tracker/shared-mouse-cursor/SharedMouseCursor.d.ts +5 -0
- package/dist/components/erd/canvas/table/Table.d.ts +8 -0
- package/dist/components/erd/canvas/table/cellLayout.d.ts +63 -0
- package/dist/components/erd/canvas/table/column/Column.d.ts +16 -6
- package/dist/components/erd/canvas/table/doubleClick.d.ts +14 -0
- package/dist/components/erd/canvas/table/useMoveTable.d.ts +1 -1
- package/dist/components/erd/canvas/useMoveEntity.d.ts +18 -0
- package/dist/components/erd/erd-context-menu/ErdContextMenu.d.ts +1 -2
- package/dist/components/erd/erd-context-menu/menus/drawRelationshipMenus.d.ts +2 -2
- package/dist/components/erd/erd-context-menu/menus/exportMenus.d.ts +2 -1
- package/dist/components/erd/hide-sign/hideSignBounds.d.ts +9 -0
- package/dist/components/erd/hitTest.d.ts +22 -0
- package/dist/components/erd/minimap/Minimap.styles.d.ts +0 -1
- package/dist/components/erd/minimap/MinimapScene.d.ts +16 -0
- package/dist/components/erd/minimap/memo/Memo.d.ts +5 -0
- package/dist/components/erd/minimap/minimapGeometry.d.ts +52 -0
- package/dist/components/erd/minimap/table/Table.d.ts +5 -0
- package/dist/components/erd/virtual-scroll/useVirtualScroll.d.ts +19 -0
- package/dist/components/global-styles/GlobalStyles.d.ts +3 -12
- package/dist/components/primitives/code-block/CodeBlock.styles.d.ts +1 -1
- package/dist/components/primitives/icon/icons.d.ts +50 -25
- package/dist/components/primitives/sash/Sash.stories.d.ts +1 -1
- package/dist/components/primitives/toast/Toast.d.ts +4 -0
- package/dist/components/primitives/toast/Toast.stories.d.ts +13 -0
- package/dist/components/primitives/toast/Toast.styles.d.ts +5 -0
- package/dist/components/{erd/canvas/table → table-view}/column/column-data-type/ColumnDataType.d.ts +1 -1
- package/dist/components/table-view/column/useColumnCell.d.ts +23 -0
- package/dist/components/themeContext.d.ts +9 -0
- package/dist/components/toast-container/openToastWhileRunning.d.ts +11 -0
- package/dist/components/visualization/Visualization.d.ts +6 -0
- package/dist/components/visualization/Visualization.styles.d.ts +6 -0
- package/dist/components/visualization/VisualizationScene.d.ts +21 -0
- package/dist/components/visualization/createVisualization.d.ts +67 -8
- package/dist/components/visualization/graph-node/GraphNode.d.ts +23 -0
- package/dist/components/visualization/table/Table.d.ts +0 -1
- package/dist/components/visualization/table/column/Column.d.ts +0 -1
- package/dist/components/visualization/visualizationView.d.ts +90 -0
- package/dist/constants/language.d.ts +2 -2
- package/dist/constants/layout.d.ts +6 -13
- package/dist/constants/schema.d.ts +1 -1
- package/dist/engine/modules/editor/actions.d.ts +12 -0
- package/dist/engine/modules/editor/atom.actions.d.ts +53 -0
- package/dist/engine/modules/editor/state.d.ts +20 -0
- package/dist/engine/modules/settings/atom.actions.d.ts +24 -0
- package/dist/engine.js +10 -10
- package/dist/erd-editor.js +23476 -13675
- package/dist/konva/batchDraw.d.ts +41 -0
- package/dist/konva/host.d.ts +29 -0
- package/dist/konva/scene/columnDropTarget.d.ts +13 -0
- package/dist/konva/scene/konvaFlip.d.ts +18 -0
- package/dist/konva/scene/metrics.d.ts +29 -0
- package/dist/konva/scene/renderScene.d.ts +34 -0
- package/dist/konva/scene/viewport.d.ts +38 -0
- package/dist/konva/testHandle.d.ts +22 -0
- package/dist/konva/theme.d.ts +31 -0
- package/dist/konva/workerDomStubs.d.ts +1 -0
- package/dist/{schemaGCService-DAGNq0wk.js → schemaGCService-DrlqIen8.js} +5246 -4789
- package/dist/services/export-png/ExportScene.d.ts +9 -0
- package/dist/services/export-png/documentScene.d.ts +20 -0
- package/dist/services/export-png/exportPng.shared-worker.d.ts +0 -0
- package/dist/services/export-png/exportPngService.d.ts +24 -0
- package/dist/services/export-png/index.d.ts +48 -0
- package/dist/services/export-png/pixelRatio.d.ts +21 -0
- package/dist/services/export-png/renderPng.d.ts +37 -0
- package/dist/services/export-png/textWidth.d.ts +27 -0
- package/dist/services/schema-gc/index.d.ts +5 -0
- package/dist/styles/colorPicker.style.d.ts +3 -7
- package/dist/styles/fonts.styles.d.ts +1 -1
- package/dist/styles/reset.styles.d.ts +1 -1
- package/dist/styles/scrollbar.styles.d.ts +3 -3
- package/dist/styles/typography.styles.d.ts +1 -1
- package/dist/themes/tokens.d.ts +4 -0
- package/dist/utils/calcTable.d.ts +1 -1
- package/dist/utils/draw-relationship/incremental.d.ts +70 -0
- package/dist/utils/draw-relationship/index.d.ts +47 -42
- package/dist/utils/draw-relationship/nudge.d.ts +2 -1
- package/dist/utils/draw-relationship/pathFinding.d.ts +3 -5
- package/dist/utils/draw-relationship/route.d.ts +4 -9
- package/dist/utils/draw-relationship/stub.d.ts +5 -16
- package/dist/utils/emitter.d.ts +16 -0
- package/dist/utils/file/exportFile.d.ts +10 -1
- package/dist/utils/focus.d.ts +1 -1
- package/dist/utils/globalEventObservable.d.ts +13 -12
- package/dist/utils/icon.d.ts +9 -1
- package/dist/utils/keyboard-shortcut/index.d.ts +6 -0
- package/dist/utils/schema-aml-parser/dataType.d.ts +5 -6
- package/dist/utils/schema-aml-parser/tokenizer.d.ts +3 -5
- package/dist/utils/schema-aml-parser/types.d.ts +13 -14
- package/dist/utils/schema-dbml-parser/dataType.d.ts +2 -2
- package/dist/utils/schema-dbml-parser/types.d.ts +5 -5
- package/dist/utils/schema-graphql-parser/dataType.d.ts +2 -2
- package/dist/utils/schema-graphql-parser/types.d.ts +7 -7
- package/package.json +6 -5
- package/dist/components/erd/canvas/canvas-svg/CanvasSvg.d.ts +0 -7
- package/dist/components/erd/canvas/canvas-svg/relationship/Relationship.template.d.ts +0 -3
- package/dist/components/erd/canvas/draw-relationship/DrawRelationship.styles.d.ts +0 -1
- package/dist/components/erd/canvas/duplicate-ghost/DuplicateGhost.styles.d.ts +0 -2
- package/dist/components/erd/canvas/high-level-table/HighLevelTable.styles.d.ts +0 -1
- package/dist/components/erd/canvas/memo/Memo.styles.d.ts +0 -6
- package/dist/components/erd/canvas/shared-mouse-tracker/shared-mouse-cursor/SharedMouseCursor.styles.d.ts +0 -1
- package/dist/components/erd/canvas/table/column/Column.styles.d.ts +0 -2
- package/dist/components/erd/drag-select/DragSelect.d.ts +0 -9
- package/dist/components/erd/drag-select/DragSelect.styles.d.ts +0 -1
- /package/dist/components/erd/canvas/{canvas-svg → relationship-group}/relationship/Relationship.d.ts +0 -0
- /package/dist/components/{erd/canvas/table → table-view}/Table.styles.d.ts +0 -0
- /package/dist/components/{erd/canvas/canvas-svg/CanvasSvg.styles.d.ts → table-view/column/Column.styles.d.ts} +0 -0
- /package/dist/components/{erd/canvas/table → table-view}/column/column-data-type/ColumnDataType.styles.d.ts +0 -0
- /package/dist/components/{erd/canvas/table → table-view}/column/column-key/ColumnKey.d.ts +0 -0
- /package/dist/components/{erd/canvas/table → table-view}/column/column-key/ColumnKey.styles.d.ts +0 -0
- /package/dist/components/{erd/canvas/table → table-view}/column/column-not-null/ColumnNotNull.d.ts +0 -0
- /package/dist/components/{erd/canvas/table → table-view}/column/column-not-null/ColumnNotNull.styles.d.ts +0 -0
- /package/dist/components/{erd/canvas/table → table-view}/column/column-option/ColumnOption.d.ts +0 -0
- /package/dist/components/{erd/canvas/table → table-view}/column/column-option/ColumnOption.styles.d.ts +0 -0
- /package/dist/{services/schema-gc/schemaGC.worker.d.ts → konva/jsx-types.test-d.d.ts} +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Point } from '../../internal-types';
|
|
2
|
+
import { Group, VisualizationLink, VisualizationNode } from './createVisualization';
|
|
3
|
+
/** The most of a table name a label shows before it is cut. */
|
|
4
|
+
export declare const NAME_MAX_LENGTH = 15;
|
|
5
|
+
/**
|
|
6
|
+
* A name as its label shows it. The cut counts code points rather than UTF-16
|
|
7
|
+
* units, so a name ending in an emoji or a CJK glyph is never split inside one.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* truncateName('a_very_long_table_name'); // 'a_very_long_tab…'
|
|
11
|
+
*/
|
|
12
|
+
export declare function truncateName(name: string): string;
|
|
13
|
+
/** The text a table's label draws: its name cut to length, or a placeholder. */
|
|
14
|
+
export declare function labelOf(node: Pick<VisualizationNode, 'name'>): string;
|
|
15
|
+
/** Whether a table has a name of its own, which is what its label is painted by. */
|
|
16
|
+
export declare const hasName: (node: Pick<VisualizationNode, "name">) => boolean;
|
|
17
|
+
export declare const TABLE_RADIUS = 8;
|
|
18
|
+
export declare const COLUMN_RADIUS = 4;
|
|
19
|
+
/** A table draws larger than the columns that hang off it. */
|
|
20
|
+
export declare const nodeRadius: (group: Group) => number;
|
|
21
|
+
/**
|
|
22
|
+
* What a dot, a line or a name fades to while it sits outside the lit
|
|
23
|
+
* neighbourhood of a hovered table, so that neighbourhood reads on its own.
|
|
24
|
+
*/
|
|
25
|
+
export declare const DIM_OPACITY = 0.2;
|
|
26
|
+
/** The ids a hovered table lights up: nodes on one side, links on the other. */
|
|
27
|
+
export type Highlight = {
|
|
28
|
+
nodeIds: Set<string>;
|
|
29
|
+
linkIds: Set<string>;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* What a hovered table lights: itself, every link at it and whatever sits at
|
|
33
|
+
* the other end of each, which is its own columns and the tables its
|
|
34
|
+
* relationships join either way round. The rest is what the scene fades.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* const { nodeIds, linkIds } = highlightOf(graph.links, 't1');
|
|
38
|
+
*/
|
|
39
|
+
export declare function highlightOf(links: VisualizationLink[], tableId: string): Highlight;
|
|
40
|
+
/**
|
|
41
|
+
* The scale a table name is fully gone below and the one it is whole from,
|
|
42
|
+
* fading between the two: the graph reads as shapes from afar and as names at
|
|
43
|
+
* rest, as Obsidian's graph does. A column carries no name at any scale.
|
|
44
|
+
*/
|
|
45
|
+
export declare const LABEL_FADE_START = 0.5;
|
|
46
|
+
export declare const LABEL_FADE_END = 1;
|
|
47
|
+
export declare function labelOpacity(scale: number): number;
|
|
48
|
+
export declare const ZOOM_MIN = 0.1;
|
|
49
|
+
export declare const ZOOM_MAX = 4;
|
|
50
|
+
/** Where the scene's origin sits on the stage, and how large a scene unit is. */
|
|
51
|
+
export type VisualizationView = {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
scale: number;
|
|
55
|
+
};
|
|
56
|
+
/** The origin at the middle of the stage, where the forces gather the graph. */
|
|
57
|
+
export declare function createView(width: number, height: number): VisualizationView;
|
|
58
|
+
/**
|
|
59
|
+
* The view after a zoom about a stage point. The scene point under that point
|
|
60
|
+
* is held still, so whatever the pointer is over grows or shrinks around it.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* const next = zoomAt(view, { x: event.offsetX, y: event.offsetY }, 1.2);
|
|
64
|
+
*/
|
|
65
|
+
export declare function zoomAt(view: VisualizationView, point: Point, factor: number): VisualizationView;
|
|
66
|
+
/**
|
|
67
|
+
* How much a wheel event scales the view, above one for a wheel rolled away
|
|
68
|
+
* from the user. Exponential in the travel, so a notch each way cancels out.
|
|
69
|
+
*/
|
|
70
|
+
export declare function wheelZoomFactor(deltaY: number, deltaMode?: number): number;
|
|
71
|
+
/**
|
|
72
|
+
* Everything the panel keeps between renders, and none of it in the store: the
|
|
73
|
+
* view is this client's alone and a force layout is not part of the document.
|
|
74
|
+
*/
|
|
75
|
+
export type VisualizationState = VisualizationView & {
|
|
76
|
+
/** Bumped by every simulation step, which is what redraws the moved graph. */
|
|
77
|
+
tick: number;
|
|
78
|
+
/** A node or the view is being dragged, which is when no preview opens. */
|
|
79
|
+
drag: boolean;
|
|
80
|
+
/** The dot under the pointer, table or column, the one that wears the ring. */
|
|
81
|
+
hoveredId: string | null;
|
|
82
|
+
/**
|
|
83
|
+
* The hovered dot when it is a table, and null over a column: the preview
|
|
84
|
+
* opens for it, and the graph fades around its neighbourhood.
|
|
85
|
+
*/
|
|
86
|
+
hoveredTableId: string | null;
|
|
87
|
+
previewX: number;
|
|
88
|
+
previewY: number;
|
|
89
|
+
};
|
|
90
|
+
export declare function createVisualizationState(width: number, height: number): VisualizationState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shiki grammar names. Spelled out rather than left as
|
|
3
|
-
* the annotation used to widen them to —
|
|
2
|
+
* Shiki grammar names. Spelled out rather than left as string, which is what
|
|
3
|
+
* the annotation used to widen them to — CodeBlock's lang is a union, and
|
|
4
4
|
* widening here meant nothing checked that these were members of it.
|
|
5
5
|
*/
|
|
6
6
|
export type Lang = 'csharp' | 'go' | 'graphql' | 'java' | 'kotlin' | 'python' | 'scala' | 'sql' | 'typescript';
|
|
@@ -33,21 +33,14 @@ export declare const MINIMAP_MARGIN = 20;
|
|
|
33
33
|
export declare const TOOLBAR_HEIGHT = 30;
|
|
34
34
|
export declare const DIFF_TREE_WIDTH = 200;
|
|
35
35
|
/**
|
|
36
|
-
* How thick a relationship connector is drawn.
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* busy diagram read as a mass of strokes rather than as connections. A whole
|
|
40
|
-
* number rather than 1.5, so the stroke lands on pixel boundaries instead of
|
|
41
|
-
* being spread across two rows at partial alpha on a 1x display.
|
|
36
|
+
* How thick a relationship connector is drawn. A whole number rather than a
|
|
37
|
+
* fraction, so the stroke lands on pixel boundaries instead of spreading across
|
|
38
|
+
* two rows at partial alpha on a 1x display.
|
|
42
39
|
*/
|
|
43
40
|
export declare const RELATIONSHIP_STROKE_WIDTH = 2;
|
|
44
41
|
/**
|
|
45
|
-
* The
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* would otherwise halve the target the user has to hit to hover a relationship
|
|
49
|
-
* or open its context menu. `NUDGE_GAP` is 10, so a band this wide stays clear
|
|
50
|
-
* of the neighbouring corridor except where the router had to fall back to a
|
|
51
|
-
* narrower gap.
|
|
42
|
+
* The invisible band that catches the pointer for a connector, because
|
|
43
|
+
* hit-testing follows the painted stroke. Narrower than NUDGE_GAP, so it stays
|
|
44
|
+
* clear of the neighbouring corridor at the router's usual separation.
|
|
52
45
|
*/
|
|
53
46
|
export declare const RELATIONSHIP_HIT_STROKE_WIDTH = 8;
|
|
@@ -109,7 +109,7 @@ export declare const SaveSettingType: {
|
|
|
109
109
|
};
|
|
110
110
|
export declare const CANVAS_SIZE_MAX: 20000;
|
|
111
111
|
export declare const CANVAS_SIZE_MIN: 2000;
|
|
112
|
-
export declare const CANVAS_ZOOM_MAX: 1;
|
|
112
|
+
export declare const CANVAS_ZOOM_MAX: 1.5;
|
|
113
113
|
export declare const CANVAS_ZOOM_MIN: 0.1;
|
|
114
114
|
export declare const BracketTypeMap: Record<number, string>;
|
|
115
115
|
export declare const ColumnTypeToName: Record<number, string>;
|
|
@@ -20,6 +20,9 @@ export declare const ActionType: {
|
|
|
20
20
|
readonly focusMoveTable: "editor.focusMoveTable";
|
|
21
21
|
readonly editTable: "editor.editTable";
|
|
22
22
|
readonly editTableEnd: "editor.editTableEnd";
|
|
23
|
+
readonly editMemo: "editor.editMemo";
|
|
24
|
+
readonly editMemoEnd: "editor.editMemoEnd";
|
|
25
|
+
readonly scrollMemo: "editor.scrollMemo";
|
|
23
26
|
readonly selectAllColumn: "editor.selectAllColumn";
|
|
24
27
|
readonly drawStartRelationship: "editor.drawStartRelationship";
|
|
25
28
|
readonly drawStartAddRelationship: "editor.drawStartAddRelationship";
|
|
@@ -78,6 +81,15 @@ export type ActionMap = {
|
|
|
78
81
|
};
|
|
79
82
|
[ActionType.editTable]: void;
|
|
80
83
|
[ActionType.editTableEnd]: void;
|
|
84
|
+
[ActionType.editMemo]: {
|
|
85
|
+
id: string;
|
|
86
|
+
};
|
|
87
|
+
[ActionType.editMemoEnd]: void;
|
|
88
|
+
[ActionType.scrollMemo]: {
|
|
89
|
+
id: string;
|
|
90
|
+
/** How far down its body the memo is shown from, in body px. */
|
|
91
|
+
scrollTop: number;
|
|
92
|
+
};
|
|
81
93
|
[ActionType.selectAllColumn]: void;
|
|
82
94
|
[ActionType.drawStartRelationship]: {
|
|
83
95
|
relationshipType: number;
|
|
@@ -121,6 +121,31 @@ export declare const editTableEndAction: {
|
|
|
121
121
|
toString(): string;
|
|
122
122
|
type: string;
|
|
123
123
|
};
|
|
124
|
+
export declare const editMemoAction: {
|
|
125
|
+
(payload: {
|
|
126
|
+
id: string;
|
|
127
|
+
}): import('@dineug/r-html').AnyAction<{
|
|
128
|
+
id: string;
|
|
129
|
+
}>;
|
|
130
|
+
toString(): string;
|
|
131
|
+
type: string;
|
|
132
|
+
};
|
|
133
|
+
export declare const editMemoEndAction: {
|
|
134
|
+
(payload: void): import('@dineug/r-html').AnyAction<void>;
|
|
135
|
+
toString(): string;
|
|
136
|
+
type: string;
|
|
137
|
+
};
|
|
138
|
+
export declare const scrollMemoAction: {
|
|
139
|
+
(payload: {
|
|
140
|
+
id: string;
|
|
141
|
+
scrollTop: number;
|
|
142
|
+
}): import('@dineug/r-html').AnyAction<{
|
|
143
|
+
id: string;
|
|
144
|
+
scrollTop: number;
|
|
145
|
+
}>;
|
|
146
|
+
toString(): string;
|
|
147
|
+
type: string;
|
|
148
|
+
};
|
|
124
149
|
export declare const selectAllColumnAction: {
|
|
125
150
|
(payload: void): import('@dineug/r-html').AnyAction<void>;
|
|
126
151
|
toString(): string;
|
|
@@ -281,6 +306,9 @@ export declare const editorReducers: {
|
|
|
281
306
|
"editor.focusMoveTable": ReducerType<"editor.focusMoveTable">;
|
|
282
307
|
"editor.editTable": ReducerType<"editor.editTable">;
|
|
283
308
|
"editor.editTableEnd": ReducerType<"editor.editTableEnd">;
|
|
309
|
+
"editor.editMemo": ReducerType<"editor.editMemo">;
|
|
310
|
+
"editor.editMemoEnd": ReducerType<"editor.editMemoEnd">;
|
|
311
|
+
"editor.scrollMemo": ReducerType<"editor.scrollMemo">;
|
|
284
312
|
"editor.selectAllColumn": ReducerType<"editor.selectAllColumn">;
|
|
285
313
|
"editor.drawStartRelationship": ReducerType<"editor.drawStartRelationship">;
|
|
286
314
|
"editor.drawStartAddRelationship": ReducerType<"editor.drawStartAddRelationship">;
|
|
@@ -420,6 +448,31 @@ export declare const actions: {
|
|
|
420
448
|
toString(): string;
|
|
421
449
|
type: string;
|
|
422
450
|
};
|
|
451
|
+
editMemoAction: {
|
|
452
|
+
(payload: {
|
|
453
|
+
id: string;
|
|
454
|
+
}): import('@dineug/r-html').AnyAction<{
|
|
455
|
+
id: string;
|
|
456
|
+
}>;
|
|
457
|
+
toString(): string;
|
|
458
|
+
type: string;
|
|
459
|
+
};
|
|
460
|
+
editMemoEndAction: {
|
|
461
|
+
(payload: void): import('@dineug/r-html').AnyAction<void>;
|
|
462
|
+
toString(): string;
|
|
463
|
+
type: string;
|
|
464
|
+
};
|
|
465
|
+
scrollMemoAction: {
|
|
466
|
+
(payload: {
|
|
467
|
+
id: string;
|
|
468
|
+
scrollTop: number;
|
|
469
|
+
}): import('@dineug/r-html').AnyAction<{
|
|
470
|
+
id: string;
|
|
471
|
+
scrollTop: number;
|
|
472
|
+
}>;
|
|
473
|
+
toString(): string;
|
|
474
|
+
type: string;
|
|
475
|
+
};
|
|
423
476
|
selectAllColumnAction: {
|
|
424
477
|
(payload: void): import('@dineug/r-html').AnyAction<void>;
|
|
425
478
|
toString(): string;
|
|
@@ -7,6 +7,14 @@ export type Editor = {
|
|
|
7
7
|
hasRedo: boolean;
|
|
8
8
|
viewport: Viewport;
|
|
9
9
|
focusTable: FocusTable | null;
|
|
10
|
+
/** The memo whose body an overlay editor is open on, and null while none is. */
|
|
11
|
+
editMemoId: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* How far down its body each memo is shown from, by memo id. The scene and
|
|
14
|
+
* the overlay editor both read it, so the lines a body shows survive the
|
|
15
|
+
* editor opening and closing over it. Local to this client, never the file.
|
|
16
|
+
*/
|
|
17
|
+
memoScrollTopMap: Record<string, number>;
|
|
10
18
|
drawRelationship: DrawRelationship | null;
|
|
11
19
|
hoverColumnMap: Record<string, boolean>;
|
|
12
20
|
hoverRelationshipMap: Record<string, boolean>;
|
|
@@ -93,4 +101,16 @@ export declare const MoveKey: {
|
|
|
93
101
|
};
|
|
94
102
|
export type MoveKey = ValuesType<typeof MoveKey>;
|
|
95
103
|
export declare const hasMoveKeys: (value: string) => boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Whether the memo body editor owns the keyboard. Its textarea covers no grid,
|
|
106
|
+
* so the traversal and edit keys a focused table would otherwise answer belong
|
|
107
|
+
* to the caret for as long as it is open.
|
|
108
|
+
*/
|
|
109
|
+
export declare const isEditingMemo: ({ editMemoId }: Editor) => boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Whether a live text editor owns the keyboard. A memo body and a table cell
|
|
112
|
+
* both open a real input over the scene, so a canvas shortcut stands down for
|
|
113
|
+
* either of them rather than for the cell alone.
|
|
114
|
+
*/
|
|
115
|
+
export declare const isEditingText: (editor: Editor) => boolean;
|
|
96
116
|
export declare const createEditor: () => Editor;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Viewport } from '../editor/state';
|
|
2
|
+
import { Settings } from '../../../internal-types';
|
|
1
3
|
import { ReducerType } from './actions';
|
|
2
4
|
export declare const changeDatabaseNameAction: {
|
|
3
5
|
(payload: {
|
|
@@ -37,6 +39,28 @@ export declare const streamZoomLevelAction: {
|
|
|
37
39
|
toString(): string;
|
|
38
40
|
type: string;
|
|
39
41
|
};
|
|
42
|
+
/** How far the scroll may travel on one axis, measured in screen pixels. */
|
|
43
|
+
export type ScrollRange = {
|
|
44
|
+
min: number;
|
|
45
|
+
max: number;
|
|
46
|
+
};
|
|
47
|
+
export type ScrollRanges = {
|
|
48
|
+
left: ScrollRange;
|
|
49
|
+
top: ScrollRange;
|
|
50
|
+
};
|
|
51
|
+
/** The canvas box and the zoom that draws it, which is all a range needs. */
|
|
52
|
+
export type ScrollTransform = Pick<Settings, 'width' | 'height' | 'zoomLevel'>;
|
|
53
|
+
/**
|
|
54
|
+
* How far the scroll may travel on each axis. A scene layer sits at the scroll
|
|
55
|
+
* plus the zoom viewport offset, so magnifying reaches further both ways, while
|
|
56
|
+
* shrinking closes the travel in by the zoom instead of leaving the box's own.
|
|
57
|
+
*/
|
|
58
|
+
export declare function getScrollRanges(settings: ScrollTransform, viewport: Viewport): ScrollRanges;
|
|
59
|
+
/** The clamps every reducer that writes a scroll offset shares. */
|
|
60
|
+
export declare function createScrollInRange(settings: ScrollTransform, viewport: Viewport): {
|
|
61
|
+
scrollLeftInRange: (num: number) => number;
|
|
62
|
+
scrollTopInRange: (num: number) => number;
|
|
63
|
+
};
|
|
40
64
|
export declare const scrollToAction: {
|
|
41
65
|
(payload: {
|
|
42
66
|
scrollTop: number;
|
package/dist/engine.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @dineug/erd-editor
|
|
3
|
-
* @version 3.
|
|
3
|
+
* @version 3.5.0 | Sat Sep 05 2026
|
|
4
4
|
* @author SeungHwan-Lee <dineug2@gmail.com>
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { Ai as e, Fi as t, Kn as n, Qr as r, Ri as i, Wi as a, _ as o, b as s, h as c, i as l, ii as u, n as d, t as f, ti as p, u as m, ut as h, vi as g, wr as _, xi as v } from "./schemaGCService-DrlqIen8.js";
|
|
8
8
|
//#region src/engine/replication-store.ts
|
|
9
9
|
var y = { change: "change" };
|
|
10
10
|
function b(b) {
|
|
11
|
-
let x = /* @__PURE__ */ new Set(), S =
|
|
11
|
+
let x = /* @__PURE__ */ new Set(), S = o(b), C = m(S, !1), w = l(C), T = new g(), E = new v((e) => C.subscribe((t) => e.next(t))).pipe(c(s), p(200)), D = /* @__PURE__ */ new Set(), O = new f(), k = (e) => (D.has(e) || D.add(e), () => {
|
|
12
12
|
D.delete(e);
|
|
13
13
|
}), A = (e, t) => {
|
|
14
14
|
D.forEach((n) => {
|
|
15
15
|
let r = Reflect.get(n, e);
|
|
16
|
-
|
|
16
|
+
i(r, t);
|
|
17
17
|
});
|
|
18
18
|
}, j = (t) => {
|
|
19
|
-
let
|
|
20
|
-
C.dispatchSync(
|
|
21
|
-
(e.tableIds.length || e.tableColumnIds.length || e.relationshipIds.length || e.indexIds.length || e.indexColumnIds.length || e.memoIds.length) && (d(C.state, e), C.dispatchSync(
|
|
19
|
+
let i = _(t);
|
|
20
|
+
C.dispatchSync(h(r(i) ? "{}" : i)), O.run(e(C.state)).then((e) => {
|
|
21
|
+
(e.tableIds.length || e.tableColumnIds.length || e.relationshipIds.length || e.indexIds.length || e.indexColumnIds.length || e.memoIds.length) && (d(C.state, e), C.dispatchSync(n()));
|
|
22
22
|
});
|
|
23
23
|
}, M = (e) => {
|
|
24
24
|
T.next([e].flat());
|
|
25
25
|
};
|
|
26
|
-
return x.add(E.subscribe(() => A(y.change, void 0))).add(T.pipe(
|
|
26
|
+
return x.add(E.subscribe(() => A(y.change, void 0))).add(T.pipe(c(s), u((e) => e.map((e) => a(e, ["tags"])))).subscribe(C.dispatchSync)), Object.freeze({
|
|
27
27
|
get value() {
|
|
28
|
-
return
|
|
28
|
+
return e(C.state);
|
|
29
29
|
},
|
|
30
30
|
on: k,
|
|
31
31
|
setInitialValue: j,
|
|
32
32
|
dispatch: (e) => {
|
|
33
|
-
|
|
33
|
+
t(() => M(e));
|
|
34
34
|
},
|
|
35
35
|
dispatchSync: M,
|
|
36
36
|
destroy: () => {
|