@dineug/erd-editor 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -280
- package/dist/components/erd/canvas/DiffOutline.template.d.ts +14 -0
- package/dist/components/erd/canvas/sceneTokens.d.ts +2 -0
- package/dist/components/erd/diff-viewer/diff-tree/DiffTree.d.ts +19 -0
- package/dist/components/erd/diff-viewer/diff-tree/DiffTree.styles.d.ts +12 -0
- package/dist/components/erd/diff-viewer/diff-tree/diffTreeModel.d.ts +49 -0
- package/dist/components/erd/diff-viewer/diff.d.ts +21 -19
- package/dist/components/erd/draw-target/placePill.d.ts +1 -3
- package/dist/components/erd/floating-toolbar/FloatingToolbar.d.ts +7 -4
- package/dist/components/erd/goToErdTarget.d.ts +40 -16
- package/dist/components/erd/relationshipHighlight.d.ts +18 -0
- package/dist/components/erd/welcome-screen/welcome-hints/WelcomeHints.styles.d.ts +5 -0
- package/dist/components/erd/welcome-screen/welcomeLayout.d.ts +7 -3
- package/dist/components/erd-editor/ErdEditor.styles.d.ts +4 -0
- package/dist/components/erd-editor/viewportLayout.d.ts +52 -0
- package/dist/components/explorer/Explorer.d.ts +12 -0
- package/dist/components/explorer/explorer-controller/ExplorerController.d.ts +11 -0
- package/dist/components/explorer/explorer-panel/ExplorerPanel.d.ts +14 -0
- package/dist/components/explorer/explorer-panel/ExplorerPanel.styles.d.ts +13 -0
- package/dist/components/explorer/explorer-search/ExplorerSearch.d.ts +12 -0
- package/dist/components/explorer/explorer-search/ExplorerSearch.styles.d.ts +13 -0
- package/dist/components/explorer/explorerCommands.d.ts +28 -0
- package/dist/components/explorer/explorerNavigation.d.ts +14 -0
- package/dist/components/explorer/explorerSearch.d.ts +71 -0
- package/dist/components/explorer/explorerTree.d.ts +90 -0
- package/dist/components/explorer/explorerView.d.ts +54 -0
- package/dist/components/{find-replace → explorer}/matchTarget.d.ts +5 -7
- package/dist/components/primitives/icon/icons.d.ts +8 -4
- package/dist/components/primitives/sash/Sash.d.ts +1 -0
- package/dist/components/primitives/tree/Tree.d.ts +30 -0
- package/dist/components/primitives/tree/Tree.styles.d.ts +5 -0
- package/dist/components/primitives/tree/treeModel.d.ts +42 -0
- package/dist/components/quick-search/QuickSearch.styles.d.ts +1 -0
- package/dist/components/quick-search/actions.d.ts +0 -3
- package/dist/components/quick-search/paletteList.d.ts +7 -0
- package/dist/components/quick-search/scopedActions.d.ts +5 -11
- package/dist/components/theme-builder/ThemeBuilder.styles.d.ts +3 -3
- package/dist/components/toolbar/Toolbar.styles.d.ts +0 -1
- package/dist/constants/layout.d.ts +7 -1
- package/dist/constants/open.d.ts +0 -1
- package/dist/engine/index.js +7 -7
- package/dist/erd-editor.umd.js +1008 -786
- package/dist/i18n/messages/ar-SA.d.ts +41 -15
- package/dist/i18n/messages/de-DE.d.ts +41 -11
- package/dist/i18n/messages/en/code.d.ts +0 -1
- package/dist/i18n/messages/en/common.d.ts +0 -1
- package/dist/i18n/messages/en/explorer.d.ts +37 -0
- package/dist/i18n/messages/en/findReplace.d.ts +5 -1
- package/dist/i18n/messages/en/index.d.ts +42 -12
- package/dist/i18n/messages/en/palette.d.ts +1 -7
- package/dist/i18n/messages/en/shortcuts.d.ts +3 -1
- package/dist/i18n/messages/en/toolbar.d.ts +0 -1
- package/dist/i18n/messages/es-ES.d.ts +41 -12
- package/dist/i18n/messages/eu-ES.d.ts +41 -11
- package/dist/i18n/messages/fa-IR.d.ts +41 -11
- package/dist/i18n/messages/fr-FR.d.ts +41 -12
- package/dist/i18n/messages/he-IL.d.ts +41 -12
- package/dist/i18n/messages/id-ID.d.ts +41 -10
- package/dist/i18n/messages/it-IT.d.ts +41 -12
- package/dist/i18n/messages/ja-JP.d.ts +41 -10
- package/dist/i18n/messages/ko-KR.d.ts +41 -10
- package/dist/i18n/messages/nl-NL.d.ts +41 -11
- package/dist/i18n/messages/pl-PL.d.ts +41 -13
- package/dist/i18n/messages/pt-BR.d.ts +41 -12
- package/dist/i18n/messages/pt-PT.d.ts +41 -12
- package/dist/i18n/messages/ro-RO.d.ts +41 -12
- package/dist/i18n/messages/ru-RU.d.ts +41 -13
- package/dist/i18n/messages/sk-SK.d.ts +41 -13
- package/dist/i18n/messages/sl-SI.d.ts +41 -13
- package/dist/i18n/messages/sv-SE.d.ts +41 -11
- package/dist/i18n/messages/tr-TR.d.ts +41 -11
- package/dist/i18n/messages/uk-UA.d.ts +41 -13
- package/dist/i18n/messages/zh-CN.d.ts +41 -10
- package/dist/i18n/messages/zh-TW.d.ts +41 -10
- package/dist/index.js +21553 -18898
- package/dist/{loadValue-B3EFSe9k.js → loadValue-BKvXDYoC.js} +1651 -1651
- package/dist/peer/index.js +23 -23
- package/dist/shared-store-2IUOt99m.js +1341 -0
- package/dist/styles/scrollbar.styles.d.ts +1 -1
- package/dist/themes/tokens.d.ts +9 -4
- package/dist/utils/diff/compareEntities.d.ts +39 -0
- package/dist/utils/diff/diffDocuments.d.ts +12 -0
- package/dist/utils/diff/index.d.ts +5 -0
- package/dist/utils/diff/pairEntities.d.ts +41 -0
- package/dist/utils/diff/types.d.ts +77 -0
- package/dist/utils/emitter.d.ts +2 -8
- package/dist/utils/find-replace/findMatches.d.ts +25 -12
- package/dist/utils/find-replace/matcher.d.ts +2 -0
- package/dist/utils/find-replace/present.d.ts +3 -2
- package/dist/utils/find-replace/preserveCase.d.ts +10 -0
- package/dist/utils/keyboard-shortcut/index.d.ts +11 -3
- package/dist/utils/takeover.d.ts +6 -0
- package/dist/utils/virtualRange.d.ts +15 -0
- package/dist/workers/exportPng.shared-worker.js +29 -29
- package/package.json +4 -4
- package/dist/components/erd/diff-viewer/tree-viewer/TreeViewer.d.ts +0 -12
- package/dist/components/erd/diff-viewer/tree-viewer/TreeViewer.styles.d.ts +0 -6
- package/dist/components/find-replace/FindReplace.d.ts +0 -13
- package/dist/components/find-replace/FindReplace.styles.d.ts +0 -27
- package/dist/components/find-replace/panelLayout.d.ts +0 -20
- package/dist/shared-store-fUggY7sI.js +0 -1341
- /package/dist/components/{find-replace → explorer}/fieldIcon.d.ts +0 -0
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import { RootState } from '../../../engine/state';
|
|
2
|
-
import { Column, Table } from '../../../internal-types';
|
|
3
1
|
import { Theme } from '../../../themes/tokens';
|
|
4
|
-
/**
|
|
5
|
-
* Map<uuid, [tag, Map<path, diff>]>
|
|
6
|
-
*/
|
|
7
|
-
export type DiffMap = Map<string, DiffTuple>;
|
|
8
|
-
/** Map<path, diff> for one entity, each path spelled as the FocusType of the cell showing it. */
|
|
9
|
-
export type DiffPaths = Map<string, number>;
|
|
10
|
-
type DiffTuple = [string, DiffPaths];
|
|
11
|
-
type NameToTableMap = Map<string, {
|
|
12
|
-
table: Table;
|
|
13
|
-
nameToColumnMap: Map<string, Column>;
|
|
14
|
-
}>;
|
|
2
|
+
/** The kinds of change a diff pane marks, one bit each. */
|
|
15
3
|
export declare const Diff: {
|
|
16
4
|
readonly insert: 1;
|
|
17
5
|
readonly delete: 2;
|
|
6
|
+
readonly modify: 4;
|
|
7
|
+
readonly rename: 8;
|
|
18
8
|
};
|
|
19
|
-
export declare function diffState(prevState: RootState, state: RootState): [DiffMap, DiffMap];
|
|
20
|
-
export declare function getNameToTableMap({ doc: { tableIds }, collections, }: RootState): NameToTableMap;
|
|
21
9
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
10
|
+
* Map<path, diff> for one entity: a cell's path is the FocusType of the cell
|
|
11
|
+
* showing it, and ENTITY_PATH stands for the entity as a whole.
|
|
12
|
+
*/
|
|
13
|
+
export type DiffPaths = Map<string, number>;
|
|
14
|
+
/** Map<id, paths> for the entities one pane marks. */
|
|
15
|
+
export type DiffMap = Map<string, DiffPaths>;
|
|
16
|
+
/** An entity added or removed, or one only moved, resized, recoloured or regrouped. */
|
|
17
|
+
export declare const ENTITY_PATH = "entity";
|
|
18
|
+
export declare const MEMO_VALUE_PATH = "memoValue";
|
|
19
|
+
/** A column's primary key, which its key icon shows. */
|
|
20
|
+
export declare const COLUMN_KEY_PATH = "columnPrimaryKey";
|
|
21
|
+
export declare const TABLE_GROUP_NAME_PATH = "tableGroupName";
|
|
22
|
+
/**
|
|
23
|
+
* The colour a cell's text takes in a diff pane: its own change's, else, in a
|
|
24
|
+
* row, the row's as a whole; null where neither changed.
|
|
24
25
|
*/
|
|
25
|
-
export declare function
|
|
26
|
-
|
|
26
|
+
export declare function diffTextColor(theme: Theme, paths: DiffPaths | null | undefined, path: string, row?: boolean): string | null;
|
|
27
|
+
/** The outline an entity takes in a diff pane, or the colour of a line; null for none. */
|
|
28
|
+
export declare function diffOutline(theme: Theme, paths: DiffPaths | null | undefined): string | null;
|
|
27
29
|
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -18,8 +18,6 @@ export type PlacePillInput = {
|
|
|
18
18
|
/** The table's box on screen. */
|
|
19
19
|
card: Rect;
|
|
20
20
|
viewport: Viewport;
|
|
21
|
-
/** How far in from the left edge Find and Replace hides the canvas. */
|
|
22
|
-
covered: number;
|
|
23
21
|
/** The chrome drawn over the canvas that the buttons keep clear of. */
|
|
24
22
|
obstacles: readonly Rect[];
|
|
25
23
|
pill: PillSize;
|
|
@@ -34,7 +32,7 @@ export declare function getVisibleSpan(card: Rect, viewport: Viewport): {
|
|
|
34
32
|
* top of its shown part and inside the canvas. Off the minimap and the floating
|
|
35
33
|
* toolbar by moving below or above it, then by the other side, else put.
|
|
36
34
|
*/
|
|
37
|
-
export declare function placePill({ card, viewport,
|
|
35
|
+
export declare function placePill({ card, viewport, obstacles, pill, }: PlacePillInput): PillPlacement;
|
|
38
36
|
/**
|
|
39
37
|
* The clear strip from a little past the buttons to the table, as tall as both,
|
|
40
38
|
* which takes a press that would reach a neighbour or the start table under it,
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { FC } from '@dineug/r-html';
|
|
2
|
-
export type FloatingToolbarProps = {
|
|
2
|
+
export type FloatingToolbarProps = {
|
|
3
|
+
/** The editor's readonly, under which the bar offers nothing to add. */
|
|
4
|
+
readonly?: boolean;
|
|
5
|
+
};
|
|
3
6
|
/**
|
|
4
|
-
* The bar over the bottom of the canvas: which of the two a press means,
|
|
5
|
-
* zoom, the notation the next relationship is drawn in, zen mode,
|
|
6
|
-
* way the content lies once the screen holds none. It is the one surface zen mode leaves standing.
|
|
7
|
+
* The bar over the bottom of the canvas: which of the two a press means, what
|
|
8
|
+
* to add, the zoom, the notation the next relationship is drawn in, zen mode,
|
|
9
|
+
* and which way the content lies once the screen holds none. It is the one surface zen mode leaves standing.
|
|
7
10
|
*/
|
|
8
11
|
declare const FloatingToolbar: FC<FloatingToolbarProps>;
|
|
9
12
|
export default FloatingToolbar;
|
|
@@ -10,7 +10,7 @@ export type TextRange = {
|
|
|
10
10
|
start: number;
|
|
11
11
|
end: number;
|
|
12
12
|
};
|
|
13
|
-
/** What a jump to the ERD lands on: a table, one cell of a column, or a
|
|
13
|
+
/** What a jump to the ERD lands on: a table, one cell of a column, a memo, a relationship or a table group. */
|
|
14
14
|
export type ErdTarget = {
|
|
15
15
|
kind: 'table';
|
|
16
16
|
tableId: string;
|
|
@@ -25,19 +25,42 @@ export type ErdTarget = {
|
|
|
25
25
|
} | {
|
|
26
26
|
kind: 'memo';
|
|
27
27
|
memoId: string;
|
|
28
|
+
} | {
|
|
29
|
+
kind: 'relationship';
|
|
30
|
+
relationshipId: string;
|
|
31
|
+
} | {
|
|
32
|
+
kind: 'tableGroup';
|
|
33
|
+
tableGroupId: string;
|
|
28
34
|
};
|
|
29
|
-
|
|
35
|
+
/** How far in from the edge of the screen a jump keeps what it shows of a rect too long for it. */
|
|
36
|
+
export declare const EDGE_MARGIN = 40;
|
|
37
|
+
export type Span = {
|
|
30
38
|
start: number;
|
|
31
39
|
end: number;
|
|
32
40
|
};
|
|
33
41
|
/**
|
|
34
|
-
* The
|
|
35
|
-
*
|
|
36
|
-
*
|
|
42
|
+
* The one jump rule every go-to shares: each axis judged on its own, the one
|
|
43
|
+
* that is fine left where it is. Where the rect would start on screen, or null
|
|
44
|
+
* when neither start moves by more than half a pixel, as on a press repeated.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* planJump({ width: 800, height: 600 }, toScreenSpans(state, rect), focusSpans);
|
|
48
|
+
*/
|
|
49
|
+
export declare function planJump(viewport: {
|
|
50
|
+
width: number;
|
|
51
|
+
height: number;
|
|
52
|
+
}, [rectX, rectY]: [Span, Span], [focusX, focusY]: [Span, Span]): {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
} | null;
|
|
56
|
+
/**
|
|
57
|
+
* The scroll the jump rule asks for to bring the rect into view at the
|
|
58
|
+
* document's own zoom, none when it asks for none, since that scroll is the
|
|
59
|
+
* one change of a jump the host hears of.
|
|
37
60
|
*
|
|
38
61
|
* @param focus The part of a rect too big for the screen that has to show.
|
|
39
62
|
*/
|
|
40
|
-
export declare function scrollIntoView(state: RootState, rect: Rect,
|
|
63
|
+
export declare function scrollIntoView(state: RootState, rect: Rect, focus?: Rect): Generator<import('@dineug/r-html').AnyAction<{
|
|
41
64
|
originX: number;
|
|
42
65
|
originY: number;
|
|
43
66
|
}>, void, unknown>;
|
|
@@ -48,7 +71,7 @@ export declare function scrollIntoView(state: RootState, rect: Rect, covered?: n
|
|
|
48
71
|
*
|
|
49
72
|
* @param range Where the text a jump is for stands in that cell, in from its left edge.
|
|
50
73
|
*/
|
|
51
|
-
export declare function scrollTableIntoView(state: RootState, table: Table,
|
|
74
|
+
export declare function scrollTableIntoView(state: RootState, table: Table, focusType?: FocusType, range?: Span): Generator<import('@dineug/r-html').AnyAction<{
|
|
52
75
|
originX: number;
|
|
53
76
|
originY: number;
|
|
54
77
|
}>, void, unknown>;
|
|
@@ -59,13 +82,16 @@ export declare function scrollTableIntoView(state: RootState, table: Table, cove
|
|
|
59
82
|
*/
|
|
60
83
|
export declare const selectTableAloneAction$: (tableId: string) => GeneratorAction;
|
|
61
84
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
85
|
+
* Whether a jump to the relationship shows it, as showErdTargetAction$ does
|
|
86
|
+
* only while it and both its tables stand; a host lights none it did not show.
|
|
87
|
+
*/
|
|
88
|
+
export declare function isRelationshipShown(state: RootState, relationshipId: string): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Stands the reader on a table, a column cell, a memo, a relationship or a
|
|
91
|
+
* table group by the one jump rule, with the focus ring on the cell asked for.
|
|
92
|
+
* A row too wide goes by the ringed cell, a cell too wide by the range found.
|
|
67
93
|
*/
|
|
68
|
-
export declare const showErdTargetAction$: (target: ErdTarget
|
|
94
|
+
export declare const showErdTargetAction$: (target: ErdTarget) => GeneratorAction;
|
|
69
95
|
/**
|
|
70
96
|
* Takes the ERD tab when another is up, in a dispatch of its own: a batch is
|
|
71
97
|
* classified by the state before it, so a scroll travelling with the tab
|
|
@@ -74,12 +100,10 @@ export declare const showErdTargetAction$: (target: ErdTarget, covered?: number)
|
|
|
74
100
|
export declare function showErdTab(store: RxStore): void;
|
|
75
101
|
/**
|
|
76
102
|
* A jump from outside the canvas, a search result say, to anything it holds,
|
|
77
|
-
* from whichever tab is up
|
|
78
|
-
* once the ERD tab is up, so a panel that tab draws again counts too.
|
|
103
|
+
* from whichever tab is up, measured on the canvas once the ERD tab is up.
|
|
79
104
|
*
|
|
80
105
|
* @example
|
|
81
106
|
* goToErdTarget(store, { kind: 'memo', memoId: 'note' });
|
|
82
107
|
*/
|
|
83
108
|
export declare function goToErdTarget(store: RxStore, target: ErdTarget): void;
|
|
84
|
-
export {};
|
|
85
109
|
//# sourceMappingURL=goToErdTarget.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Lights one relationship in the editor, and puts out the one it lit before. */
|
|
2
|
+
export declare function setRelationshipHighlight(editorId: string, relationshipId: string): void;
|
|
3
|
+
/** Puts out whatever relationship the editor has lit. */
|
|
4
|
+
export declare function clearRelationshipHighlight(editorId: string): void;
|
|
5
|
+
/** Whether a jump has lit the relationship, read by its connector as it reads a hover. */
|
|
6
|
+
export declare function isRelationshipHighlighted(editorId: string, relationshipId: string): boolean;
|
|
7
|
+
/** Forgets an editor that went, whose id nothing reads again. */
|
|
8
|
+
export declare function dropRelationshipHighlight(editorId: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* Test-only probe: the flags the reactive record holds and the editors it
|
|
11
|
+
* remembers, which a read of an editor never lit must not grow. Nothing
|
|
12
|
+
* shipping calls it.
|
|
13
|
+
*/
|
|
14
|
+
export declare function countRelationshipHighlights(): {
|
|
15
|
+
flags: number;
|
|
16
|
+
editors: number;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=relationshipHighlight.d.ts.map
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
* stands across the canvas is set inline, from the button it was measured at.
|
|
5
5
|
*/
|
|
6
6
|
export declare const up: import('@dineug/r-html').CSSTemplateLiterals;
|
|
7
|
+
/**
|
|
8
|
+
* A hint whose label has no room beside its arrow: the label hangs under the
|
|
9
|
+
* arrow's tail, clear of a label beside the next arrow.
|
|
10
|
+
*/
|
|
11
|
+
export declare const stacked: import('@dineug/r-html').CSSTemplateLiterals;
|
|
7
12
|
/**
|
|
8
13
|
* The hint over the floating toolbar, centred over it as the toolbar is, its
|
|
9
14
|
* arrow's tip clear of the bar's top edge.
|
|
@@ -16,6 +16,8 @@ export declare const WELCOME_MENU_MIN_HEIGHT = 294;
|
|
|
16
16
|
*/
|
|
17
17
|
export declare const WELCOME_HINTS_MIN_WIDTH = 720;
|
|
18
18
|
export declare const WELCOME_HINTS_MIN_HEIGHT = 562;
|
|
19
|
+
/** The widest a hint's label runs before it wraps, as WelcomeHints.styles.ts sets it. */
|
|
20
|
+
export declare const HINT_LABEL_MAX_WIDTH = 220;
|
|
19
21
|
/** The narrowest canvas whose menu rows still show their chords. */
|
|
20
22
|
export declare const WELCOME_KBD_MIN_WIDTH = 480;
|
|
21
23
|
/** The arrow that climbs to a toolbar button: its box, and its tip near the top right. */
|
|
@@ -75,13 +77,15 @@ export type HintSide = 'before' | 'after';
|
|
|
75
77
|
*/
|
|
76
78
|
export type HintPlacement = {
|
|
77
79
|
labelFirst: boolean;
|
|
80
|
+
/** The label hangs under the arrow's tail, as the side it names has no room for it. */
|
|
81
|
+
stacked: boolean;
|
|
78
82
|
left?: number;
|
|
79
83
|
right?: number;
|
|
80
84
|
};
|
|
81
85
|
/**
|
|
82
|
-
* Places a hint so
|
|
83
|
-
*
|
|
84
|
-
*
|
|
86
|
+
* Places a hint so its arrow's tip meets the anchor, the label on the side it
|
|
87
|
+
* names (before: left to right, left; right to left, right), or under the
|
|
88
|
+
* arrow where that side has no room for a whole label, as beside the Explorer.
|
|
85
89
|
*/
|
|
86
90
|
export declare function hintPlacement(anchorX: number, rootWidth: number, side: HintSide, dir: TextDirection): HintPlacement;
|
|
87
91
|
//# sourceMappingURL=welcomeLayout.d.ts.map
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export declare const root: import('@dineug/r-html').CSSTemplateLiterals;
|
|
2
2
|
export declare const scope: import('@dineug/r-html').CSSTemplateLiterals;
|
|
3
|
+
/** The ERD tab's row: the Explorer, when shown, and the canvas beside it. */
|
|
4
|
+
export declare const erdRow: import('@dineug/r-html').CSSTemplateLiterals;
|
|
5
|
+
/** The canvas's share of the row, all of it the Explorer leaves. */
|
|
6
|
+
export declare const erdScope: import('@dineug/r-html').CSSTemplateLiterals;
|
|
3
7
|
//# sourceMappingURL=ErdEditor.styles.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { RxStore } from '../../engine/rx-store';
|
|
2
|
+
import { RootState } from '../../engine/state';
|
|
3
|
+
import { Unsubscribe } from '../../internal-types';
|
|
4
|
+
export type Layout = {
|
|
5
|
+
/** The root as the ResizeObserver last measured it. */
|
|
6
|
+
observed: {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
/** How much of the root's width a panel docked beside the canvas takes. */
|
|
11
|
+
reach: number;
|
|
12
|
+
};
|
|
13
|
+
/** The root's measured size and the panel reach, one per editor, kept until the element goes. */
|
|
14
|
+
export declare function layoutOf(store: RxStore): Layout;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the toolbar is drawn. Zen mode takes it away over the canvas it was
|
|
17
|
+
* entered from alone, or the tab that turned the mode on would be the only one
|
|
18
|
+
* it could be turned off from.
|
|
19
|
+
*/
|
|
20
|
+
export declare const hasToolbar: ({ editor, settings }: RootState) => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The editor's own width, panel included, which decides whether a dialog
|
|
23
|
+
* stacks: the viewport plus the reach a docked panel takes from it, so a spec
|
|
24
|
+
* that sets the viewport alone reads that width.
|
|
25
|
+
*/
|
|
26
|
+
export declare function editorWidthOf(store: RxStore): number;
|
|
27
|
+
/**
|
|
28
|
+
* Applies the viewport from what decides it: the measured root, the toolbar
|
|
29
|
+
* zen mode takes away, the tab and the Explorer. It compares those first and
|
|
30
|
+
* returns when none moved, writes the reach first, and dispatches only a new viewport.
|
|
31
|
+
*/
|
|
32
|
+
export declare function applyViewport(store: RxStore): void;
|
|
33
|
+
/**
|
|
34
|
+
* Applies the viewport inside every batch that moves its inputs, so a tab,
|
|
35
|
+
* zen mode or takeover change has it before anything renders. The inputs as
|
|
36
|
+
* they stand now are the first ones, so a batch that moves none writes nothing.
|
|
37
|
+
*/
|
|
38
|
+
export declare function observeViewport(store: RxStore): Unsubscribe;
|
|
39
|
+
/** Records what the ResizeObserver measured and applies the viewport from it. */
|
|
40
|
+
export declare function measureRoot(store: RxStore, observed: {
|
|
41
|
+
width: number;
|
|
42
|
+
height: number;
|
|
43
|
+
}): void;
|
|
44
|
+
/** How far in from the canvas's left edge the theme builder and the locale picker stand. */
|
|
45
|
+
export declare const PICKER_INSET = 16;
|
|
46
|
+
/**
|
|
47
|
+
* Where the theme builder and the locale picker stand left to right while the
|
|
48
|
+
* Explorer takes the left of the root: past it, at the canvas's own left edge.
|
|
49
|
+
* Right to left they keep their place at the other end.
|
|
50
|
+
*/
|
|
51
|
+
export declare function insetPastExplorer(store: RxStore, dir: 'ltr' | 'rtl'): Record<string, string>;
|
|
52
|
+
//# sourceMappingURL=viewportLayout.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from '@dineug/r-html';
|
|
2
|
+
export type ExplorerProps = {
|
|
3
|
+
readonly: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* The Explorer's place beside the canvas: the panel at the width the layout
|
|
7
|
+
* reaches, or nothing. It reads the reach alone, so a drag of the edge renders
|
|
8
|
+
* the shell and the panel's root and nothing of the tree.
|
|
9
|
+
*/
|
|
10
|
+
declare const Explorer: FC<ExplorerProps>;
|
|
11
|
+
export default Explorer;
|
|
12
|
+
//# sourceMappingURL=Explorer.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from '@dineug/r-html';
|
|
2
|
+
/** How long the edits must pause before an edit of a searched text searches again. */
|
|
3
|
+
export declare const EDIT_SEARCH_DELAY = 100;
|
|
4
|
+
/**
|
|
5
|
+
* What opens the Explorer's search and keeps it current, mounted beside the
|
|
6
|
+
* panel whether it shows or not: the find chord, the palette row's and the
|
|
7
|
+
* context menu's openings, and the searches an edit asks for.
|
|
8
|
+
*/
|
|
9
|
+
declare const ExplorerController: FC;
|
|
10
|
+
export default ExplorerController;
|
|
11
|
+
//# sourceMappingURL=ExplorerController.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from '@dineug/r-html';
|
|
2
|
+
export type ExplorerPanelProps = {
|
|
3
|
+
/** The width the layout gives the panel, which a drag on its edge asks to change. */
|
|
4
|
+
width: number;
|
|
5
|
+
readonly: boolean;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The Explorer docked left of the canvas: a read-only tree of the document
|
|
9
|
+
* that jumps to what a row stands for on a click or Enter. Escape hands the
|
|
10
|
+
* keyboard back to the canvas and leaves the panel open.
|
|
11
|
+
*/
|
|
12
|
+
declare const ExplorerPanel: FC<ExplorerPanelProps>;
|
|
13
|
+
export default ExplorerPanel;
|
|
14
|
+
//# sourceMappingURL=ExplorerPanel.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const root: import('@dineug/r-html').CSSTemplateLiterals;
|
|
2
|
+
export declare const header: import('@dineug/r-html').CSSTemplateLiterals;
|
|
3
|
+
export declare const title: import('@dineug/r-html').CSSTemplateLiterals;
|
|
4
|
+
export declare const tool: import('@dineug/r-html').CSSTemplateLiterals;
|
|
5
|
+
export declare const body: import('@dineug/r-html').CSSTemplateLiterals;
|
|
6
|
+
export declare const sash: import('@dineug/r-html').CSSTemplateLiterals;
|
|
7
|
+
export declare const rowIcon: import('@dineug/r-html').CSSTemplateLiterals;
|
|
8
|
+
export declare const name: import('@dineug/r-html').CSSTemplateLiterals;
|
|
9
|
+
export declare const muted: import('@dineug/r-html').CSSTemplateLiterals;
|
|
10
|
+
export declare const count: import('@dineug/r-html').CSSTemplateLiterals;
|
|
11
|
+
export declare const dot: import('@dineug/r-html').CSSTemplateLiterals;
|
|
12
|
+
export declare const mark: import('@dineug/r-html').CSSTemplateLiterals;
|
|
13
|
+
//# sourceMappingURL=ExplorerPanel.styles.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from '@dineug/r-html';
|
|
2
|
+
export type ExplorerSearchProps = {
|
|
3
|
+
readonly: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* The Explorer's search above its tree: the find field and its options, the
|
|
7
|
+
* Replace row folded away to begin with, the place in the matches with the
|
|
8
|
+
* steps through them, and the kinds of text searched past the three dots.
|
|
9
|
+
*/
|
|
10
|
+
declare const ExplorerSearch: FC<ExplorerSearchProps>;
|
|
11
|
+
export default ExplorerSearch;
|
|
12
|
+
//# sourceMappingURL=ExplorerSearch.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const root: import('@dineug/r-html').CSSTemplateLiterals;
|
|
2
|
+
export declare const fields: import('@dineug/r-html').CSSTemplateLiterals;
|
|
3
|
+
export declare const rows: import('@dineug/r-html').CSSTemplateLiterals;
|
|
4
|
+
export declare const row: import('@dineug/r-html').CSSTemplateLiterals;
|
|
5
|
+
export declare const field: import('@dineug/r-html').CSSTemplateLiterals;
|
|
6
|
+
export declare const input: import('@dineug/r-html').CSSTemplateLiterals;
|
|
7
|
+
export declare const toggle: import('@dineug/r-html').CSSTemplateLiterals;
|
|
8
|
+
export declare const twisty: import('@dineug/r-html').CSSTemplateLiterals;
|
|
9
|
+
export declare const status: import('@dineug/r-html').CSSTemplateLiterals;
|
|
10
|
+
export declare const count: import('@dineug/r-html').CSSTemplateLiterals;
|
|
11
|
+
export declare const scopes: import('@dineug/r-html').CSSTemplateLiterals;
|
|
12
|
+
export declare const scope: import('@dineug/r-html').CSSTemplateLiterals;
|
|
13
|
+
//# sourceMappingURL=ExplorerSearch.styles.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RxStore } from '../../engine/rx-store';
|
|
2
|
+
import { Emitter } from '../../utils/emitter';
|
|
3
|
+
/**
|
|
4
|
+
* Whether the toolbar shows the Explorer's button pressed: open on the ERD
|
|
5
|
+
* tab and not hidden by zen mode. A panel the canvas width hides for now
|
|
6
|
+
* still counts, so a press there closes it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isExplorerPressed(store: RxStore): boolean;
|
|
9
|
+
/** Whether the panel is drawn now, as opposed to open but stood aside. */
|
|
10
|
+
export declare const isExplorerShown: (store: RxStore) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Opens the Explorer on the ERD tab, from whichever tab is up. Under zen mode
|
|
13
|
+
* it shows the panel and leaves zen on (an owner decision of 2026-10-13).
|
|
14
|
+
* Under a takeover it does nothing.
|
|
15
|
+
*/
|
|
16
|
+
export declare function openExplorer(store: RxStore): void;
|
|
17
|
+
export declare function closeExplorer(store: RxStore): void;
|
|
18
|
+
/** The toolbar button: closes a pressed button's panel, opens any other, and does nothing under a takeover. */
|
|
19
|
+
export declare function toggleExplorer(store: RxStore): void;
|
|
20
|
+
/**
|
|
21
|
+
* The palette's and the context menu's Toggle Explorer, which do what the find
|
|
22
|
+
* chord does: close a pressed button's panel, or ask for the search otherwise.
|
|
23
|
+
* Under a takeover it does nothing.
|
|
24
|
+
*/
|
|
25
|
+
export declare function toggleExplorerSearch(store: RxStore, emitter: Emitter): void;
|
|
26
|
+
/** Sets the width a drag on the edge asks for, held between the least and the most. */
|
|
27
|
+
export declare function setExplorerWidth(store: RxStore, width: number): void;
|
|
28
|
+
//# sourceMappingURL=explorerCommands.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ErdTarget } from '../erd/goToErdTarget';
|
|
2
|
+
import { RxStore } from '../../engine/rx-store';
|
|
3
|
+
import { ExplorerNode } from './explorerTree';
|
|
4
|
+
/** Where on the canvas a row goes: none for a folder, which only folds and unfolds. */
|
|
5
|
+
export declare function targetOf(node: ExplorerNode): ErdTarget | null;
|
|
6
|
+
/**
|
|
7
|
+
* Goes to a row's or a match's target by the one jump rule, and lights a
|
|
8
|
+
* foreign key's relationship once there. Table Properties gives way first, so
|
|
9
|
+
* nothing is left under it (an owner decision of 2026-10-13).
|
|
10
|
+
*/
|
|
11
|
+
export declare function jumpTo(store: RxStore, target: ErdTarget): void;
|
|
12
|
+
/** Goes where a row stands for; a folder goes nowhere. */
|
|
13
|
+
export declare function activateNode(store: RxStore, node: ExplorerNode): void;
|
|
14
|
+
//# sourceMappingURL=explorerNavigation.d.ts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { AnyAction } from '@dineug/r-html';
|
|
2
|
+
import { RxStore } from '../../engine/rx-store';
|
|
3
|
+
import { I18n } from '../../i18n/translate';
|
|
4
|
+
import { Emitter } from '../../utils/emitter';
|
|
5
|
+
import { FindField, FindMatch, Matcher, ReplaceRun } from '../../utils/find-replace';
|
|
6
|
+
/** How long typing must pause before a regular expression is searched, as one can be slow. */
|
|
7
|
+
export declare const REGEX_INPUT_DELAY = 150;
|
|
8
|
+
/** What the search holds that no render reads: the matcher, the run, the timers. */
|
|
9
|
+
type SearchRuntime = {
|
|
10
|
+
matcher: Matcher | null;
|
|
11
|
+
pendingSearch: ReturnType<typeof setTimeout> | null;
|
|
12
|
+
/** Set while the search dispatches its own edit, whose matches it has worked out already. */
|
|
13
|
+
replacing: boolean;
|
|
14
|
+
/** Set by an edit of a searched text the tree does not show yet, one made while it stood aside say. */
|
|
15
|
+
stale: boolean;
|
|
16
|
+
/** Where the presses of Replace since the last jump or change of search began. */
|
|
17
|
+
run: ReplaceRun | null;
|
|
18
|
+
/** Set once that run has come back to where it began, which holds until a new run. */
|
|
19
|
+
stopped: boolean;
|
|
20
|
+
/** The last focus request the find field took or let go. */
|
|
21
|
+
focusTaken: number;
|
|
22
|
+
};
|
|
23
|
+
export declare function searchRuntimeOf(store: RxStore): SearchRuntime;
|
|
24
|
+
/** Whether a query is being searched, which puts the tree in its search form. */
|
|
25
|
+
export declare const isSearching: (store: RxStore) => boolean;
|
|
26
|
+
/** What the line under the fields says: the place in the matches, how many there are, or why none. */
|
|
27
|
+
export declare function countText(store: RxStore, i18n: Pick<I18n, 't'>): string;
|
|
28
|
+
/** Drops a regular expression's search still waiting for typing to pause. */
|
|
29
|
+
export declare function cancelPendingSearch(store: RxStore): void;
|
|
30
|
+
/** Whether the find field may take the keyboard now, which it marks as taken. */
|
|
31
|
+
export declare function takeSearchFocus(store: RxStore): boolean;
|
|
32
|
+
/** Whether a dialog the search trades for itself is up, which the chord then trades. */
|
|
33
|
+
export declare const hasSearchDialog: (store: RxStore) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Brings the keyboard back to the search of a panel shown already, keeping
|
|
36
|
+
* its current match and its run, as every host's find does pressed again.
|
|
37
|
+
*/
|
|
38
|
+
export declare function focusSearch(store: RxStore): void;
|
|
39
|
+
/**
|
|
40
|
+
* Opens the Explorer on its search, handing it the keyboard. A canvas too
|
|
41
|
+
* narrow says so rather than show nothing (an owner decision of 2026-10-13).
|
|
42
|
+
*/
|
|
43
|
+
export declare function openSearch(store: RxStore, emitter: Emitter): void;
|
|
44
|
+
export declare function goToNext(store: RxStore): void;
|
|
45
|
+
export declare function goToPrevious(store: RxStore): void;
|
|
46
|
+
/** A row picked before a regular expression's pause goes to its match among those of what is typed, if any. */
|
|
47
|
+
export declare function goToMatch(store: RxStore, match: FindMatch): void;
|
|
48
|
+
/**
|
|
49
|
+
* Replaces the current match and takes the canvas to the next one in the same
|
|
50
|
+
* dispatch, so one undo takes back both. A run that comes back to where it
|
|
51
|
+
* began stops there rather than go round to what it wrote.
|
|
52
|
+
*/
|
|
53
|
+
export declare function replaceOne(store: RxStore): void;
|
|
54
|
+
/** Replaces every match in one dispatch: one history entry and one batch to every peer. */
|
|
55
|
+
export declare function replaceAll(store: RxStore): void;
|
|
56
|
+
/** Searches plain text at once, as it is quick, and a regular expression once typing pauses. */
|
|
57
|
+
export declare function setQuery(store: RxStore, query: string): void;
|
|
58
|
+
export declare function setReplacement(store: RxStore, replacement: string): void;
|
|
59
|
+
/** Match Case, Whole Word and Regex search again; Preserve Case only shapes what Replace writes. */
|
|
60
|
+
export declare function toggleOption(store: RxStore, key: 'matchCase' | 'wholeWord' | 'regex' | 'preserveCase'): void;
|
|
61
|
+
export declare function toggleField(store: RxStore, field: FindField): void;
|
|
62
|
+
/**
|
|
63
|
+
* An edit of a searched text leaves the matches stale: searched again once
|
|
64
|
+
* the edits pause while the panel is shown, or at once by the batch that shows
|
|
65
|
+
* it again. A hover, a selection or a scroll edits none and searches nothing.
|
|
66
|
+
*/
|
|
67
|
+
export declare function noteBatch(store: RxStore, actions: AnyAction[]): boolean;
|
|
68
|
+
/** Searches again when an edit left the matches stale and the search is on screen. */
|
|
69
|
+
export declare function searchIfStale(store: RxStore): void;
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=explorerSearch.d.ts.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { TreeNode } from '../primitives/tree/treeModel';
|
|
2
|
+
import { RootState } from '../../engine/state';
|
|
3
|
+
import { FindMatch } from '../../utils/find-replace';
|
|
4
|
+
export type ExplorerFolder = 'tables' | 'tableGroups' | 'memos' | 'columns' | 'indexes' | 'foreignKeys';
|
|
5
|
+
/** The matches a search found in a row's own name, which it marks; none outside a search. */
|
|
6
|
+
type NameMatches = {
|
|
7
|
+
matches?: ReadonlyArray<FindMatch>;
|
|
8
|
+
};
|
|
9
|
+
/** What one row of the Explorer stands for, and what it shows of it. */
|
|
10
|
+
export type ExplorerNode = {
|
|
11
|
+
kind: 'folder';
|
|
12
|
+
folder: ExplorerFolder;
|
|
13
|
+
count: number;
|
|
14
|
+
} | ({
|
|
15
|
+
kind: 'table';
|
|
16
|
+
tableId: string;
|
|
17
|
+
name: string;
|
|
18
|
+
} & NameMatches) | ({
|
|
19
|
+
kind: 'column';
|
|
20
|
+
tableId: string;
|
|
21
|
+
columnId: string;
|
|
22
|
+
name: string;
|
|
23
|
+
dataType: string;
|
|
24
|
+
primaryKey: boolean;
|
|
25
|
+
foreignKey: boolean;
|
|
26
|
+
} & NameMatches) | ({
|
|
27
|
+
kind: 'index';
|
|
28
|
+
tableId: string;
|
|
29
|
+
indexId: string;
|
|
30
|
+
name: string;
|
|
31
|
+
unique: boolean;
|
|
32
|
+
columns: string;
|
|
33
|
+
} & NameMatches) | {
|
|
34
|
+
kind: 'foreignKey';
|
|
35
|
+
relationshipId: string;
|
|
36
|
+
tableId: string;
|
|
37
|
+
/** Whether its columns key the child too, which the connector draws in the PK and FK colour. */
|
|
38
|
+
identification: boolean;
|
|
39
|
+
columns: string;
|
|
40
|
+
parent: string;
|
|
41
|
+
parentColumns: string;
|
|
42
|
+
} | ({
|
|
43
|
+
kind: 'tableGroup';
|
|
44
|
+
tableGroupId: string;
|
|
45
|
+
name: string;
|
|
46
|
+
color: string;
|
|
47
|
+
} & NameMatches) | {
|
|
48
|
+
kind: 'groupTable';
|
|
49
|
+
tableGroupId: string;
|
|
50
|
+
tableId: string;
|
|
51
|
+
name: string;
|
|
52
|
+
} | {
|
|
53
|
+
kind: 'memo';
|
|
54
|
+
memoId: string;
|
|
55
|
+
text: string;
|
|
56
|
+
}
|
|
57
|
+
/** One match in a comment or a memo, shown as the stretch of text around it. */
|
|
58
|
+
| {
|
|
59
|
+
kind: 'excerpt';
|
|
60
|
+
match: FindMatch;
|
|
61
|
+
};
|
|
62
|
+
export type ExplorerTreeNode = TreeNode<ExplorerNode>;
|
|
63
|
+
/**
|
|
64
|
+
* The Explorer's folders, Tables, Table Groups and Memos, each only while it
|
|
65
|
+
* holds something and groups and memos only while shown. Tables and groups go
|
|
66
|
+
* by name, memos as the document has them; a table's folders wait for its expanding.
|
|
67
|
+
*/
|
|
68
|
+
export declare function buildExplorerTree(state: RootState): ExplorerTreeNode[];
|
|
69
|
+
/**
|
|
70
|
+
* The row a match shows on in the search's tree: a name's own row, or the
|
|
71
|
+
* excerpt row of a comment or memo, one for each match there.
|
|
72
|
+
*/
|
|
73
|
+
export declare function matchRowId(match: FindMatch): string;
|
|
74
|
+
/** The rows above a match's row in the search's tree, which must be open for the row to be drawn. */
|
|
75
|
+
export declare function matchAncestorIds({ field, id, tableId }: FindMatch): string[];
|
|
76
|
+
export type SearchTree = {
|
|
77
|
+
roots: ExplorerTreeNode[];
|
|
78
|
+
/** Every row with children, which a search shows open unless folded. */
|
|
79
|
+
branchIds: string[];
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* The tree a search shows: the rows that hold a match and the rows above
|
|
83
|
+
* them, in the order the search walked, with a comment's or memo's matches as
|
|
84
|
+
* rows of their own. A group's tables are left out, found under Tables alone.
|
|
85
|
+
*/
|
|
86
|
+
export declare function buildSearchTree(state: RootState, matches: ReadonlyArray<FindMatch>): SearchTree;
|
|
87
|
+
/** What a search shows open: every row with children but those folded. */
|
|
88
|
+
export declare function searchExpanded(branchIds: ReadonlyArray<string>, collapsed: Readonly<Record<string, true>>): Record<string, true>;
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=explorerTree.d.ts.map
|