@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,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Global, not scoped. The ::-webkit-scrollbar* pseudo elements have no element of their own to
|
|
3
|
-
* hang a component class on, and .scrollbar is a hook class
|
|
3
|
+
* hang a component class on, and .scrollbar is a hook class the scrolling panels opt into by
|
|
4
4
|
* literal name (class=${['scrollbar', ...]}) — scoping it would rename it out from under them.
|
|
5
5
|
*/
|
|
6
6
|
export declare const scrollbarStyle: import('@dineug/r-html').CSSTemplateLiterals;
|
package/dist/themes/tokens.d.ts
CHANGED
|
@@ -74,12 +74,17 @@ export type Theme = {
|
|
|
74
74
|
keyPK: string;
|
|
75
75
|
keyFK: string;
|
|
76
76
|
keyPFK: string;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
treeBackground: string;
|
|
78
|
+
treeRowHover: string;
|
|
79
|
+
treeRowCurrent: string;
|
|
80
|
+
treeMuted: string;
|
|
81
|
+
treeMatch: string;
|
|
82
|
+
explorerBackground: string;
|
|
83
|
+
explorerBorder: string;
|
|
80
84
|
diffInsertForeground: string;
|
|
81
85
|
diffDeleteForeground: string;
|
|
82
|
-
|
|
86
|
+
diffModifyForeground: string;
|
|
87
|
+
diffRenameForeground: string;
|
|
83
88
|
};
|
|
84
89
|
export declare const ThemeTokens: ReadonlyArray<keyof Theme>;
|
|
85
90
|
/** The custom property one token is published under on :host. */
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { RootState } from '../../engine/state';
|
|
2
|
+
import { Column, Index, Memo, Relationship, Table, TableGroup } from '../../internal-types';
|
|
3
|
+
import { Pairing } from './pairEntities';
|
|
4
|
+
import { DiffChange } from './types';
|
|
5
|
+
/** Both documents and what pairs across them, which every comparison reads. */
|
|
6
|
+
export type DiffContext = {
|
|
7
|
+
prev: RootState;
|
|
8
|
+
next: RootState;
|
|
9
|
+
tables: Pairing;
|
|
10
|
+
columns: Pairing;
|
|
11
|
+
tableGroups: Pairing;
|
|
12
|
+
};
|
|
13
|
+
/** Name, comment, the group it is in, where it stands and its colour; never its z-index or the widths its text gives it. */
|
|
14
|
+
export declare function compareTables(ctx: DiffContext, prev: Table, next: Table): DiffChange[];
|
|
15
|
+
/**
|
|
16
|
+
* Name, comment, type, default and the four options, and its place among the
|
|
17
|
+
* columns once it moved, given as where it stood and stands, counted from one.
|
|
18
|
+
*/
|
|
19
|
+
export declare function compareColumns(prev: Column, next: Column, moved: {
|
|
20
|
+
before: number;
|
|
21
|
+
after: number;
|
|
22
|
+
} | null): DiffChange[];
|
|
23
|
+
/** The columns of an index in key order, each as the current column it pairs with and its direction. */
|
|
24
|
+
export declare function indexKeyOf(ctx: DiffContext, index: Index, side: 'prev' | 'next'): string;
|
|
25
|
+
/** Name, UNIQUE, and the columns in their order and direction, each column by the one it pairs with. */
|
|
26
|
+
export declare function compareIndexes(ctx: DiffContext, prev: Index, next: Index): DiffChange[];
|
|
27
|
+
/** A foreign key as it reads: its columns, the parent and the parent's columns. */
|
|
28
|
+
export declare function foreignKeyText(state: RootState, relationship: Relationship): string;
|
|
29
|
+
/** The column pairs of a foreign key, child to parent, as the current columns they pair with. */
|
|
30
|
+
export declare function foreignKeyPairsOf(ctx: DiffContext, relationship: Relationship, side: 'prev' | 'next'): string;
|
|
31
|
+
/** Its column pairs, its kind and what ON DELETE and ON UPDATE do; never where its ends are anchored. */
|
|
32
|
+
export declare function compareForeignKeys(ctx: DiffContext, prev: Relationship, next: Relationship): DiffChange[];
|
|
33
|
+
/** What it says, where it stands, its size and its colour; never its z-index. */
|
|
34
|
+
export declare function compareMemos(prev: Memo, next: Memo): DiffChange[];
|
|
35
|
+
/** The tables a group holds, each as the current table it pairs with. */
|
|
36
|
+
export declare function groupMembersOf(ctx: DiffContext, group: TableGroup, side: 'prev' | 'next'): string[];
|
|
37
|
+
/** Name, the tables it holds, its colour and the box it keeps; never its z-index. */
|
|
38
|
+
export declare function compareTableGroups(ctx: DiffContext, prev: TableGroup, next: TableGroup): DiffChange[];
|
|
39
|
+
//# sourceMappingURL=compareEntities.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RootState } from '../../engine/state';
|
|
2
|
+
import { DocumentDiff } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* What changed from a saved document to the current one: the entries the diff
|
|
5
|
+
* tree lists and the marks each pane draws, which say the same thing. An entity
|
|
6
|
+
* pairs by id, then one to one by a name it keeps (src/components/erd/AGENTS.md).
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const { entries, prev, next } = diffDocuments(savedStore.state, store.state);
|
|
10
|
+
*/
|
|
11
|
+
export declare function diffDocuments(prev: RootState, next: RootState): DocumentDiff;
|
|
12
|
+
//# sourceMappingURL=diffDocuments.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** Which entity of the saved document stands for which of the current one, both ways. */
|
|
2
|
+
export type Pairing = {
|
|
3
|
+
/** A saved id to the current id it pairs with. */
|
|
4
|
+
toNext: Map<string, string>;
|
|
5
|
+
/** A current id to the saved id it pairs with. */
|
|
6
|
+
toPrev: Map<string, string>;
|
|
7
|
+
};
|
|
8
|
+
export declare const emptyPairing: () => Pairing;
|
|
9
|
+
/** An id as the current one it stands for: a saved id as the one it pairs with, or one no current id can equal. */
|
|
10
|
+
export declare function asNextId(pairing: Pairing, id: string, side: 'prev' | 'next'): string;
|
|
11
|
+
/**
|
|
12
|
+
* A key two entities pair on, read on either side: a saved entity spells the
|
|
13
|
+
* ids it refers to as the current ones they pair with, so equal keys mean the
|
|
14
|
+
* same thing. Null for an entity the key cannot pair, an unnamed one say.
|
|
15
|
+
*/
|
|
16
|
+
export type PairKey<T> = (item: T, side: 'prev' | 'next') => string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Pairs two lists one to one: by id first, then by each key in turn, the
|
|
19
|
+
* saved entities taken in document order each pairing with the first current
|
|
20
|
+
* one left that has its key, so a rerun pairs the same way.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* pairEntities(prevTables, nextTables, [table => table.name.trim() ? table.name : null]);
|
|
24
|
+
*/
|
|
25
|
+
export declare function pairEntities<T extends {
|
|
26
|
+
id: string;
|
|
27
|
+
}>(prev: ReadonlyArray<T>, next: ReadonlyArray<T>, keys?: ReadonlyArray<PairKey<T>>): Pairing;
|
|
28
|
+
/**
|
|
29
|
+
* Pairs what is left by the most members two entities share, for those a key
|
|
30
|
+
* cannot name, such as table groups with no name: the saved ones in document
|
|
31
|
+
* order, each taking the current one it shares the most with, ties the first.
|
|
32
|
+
*/
|
|
33
|
+
export declare function pairByOverlap<T extends {
|
|
34
|
+
id: string;
|
|
35
|
+
}>(pairing: Pairing, prev: ReadonlyArray<T>, next: ReadonlyArray<T>, membersOf: (item: T, side: 'prev' | 'next') => ReadonlyArray<string>): void;
|
|
36
|
+
/**
|
|
37
|
+
* The positions of the longest run two sequences share in order, as the
|
|
38
|
+
* indexes of the second one, so an entry outside it is one that moved.
|
|
39
|
+
*/
|
|
40
|
+
export declare function longestCommonIndexes(a: ReadonlyArray<string>, b: ReadonlyArray<string>): Set<number>;
|
|
41
|
+
//# sourceMappingURL=pairEntities.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { DiffMap } from '../../components/erd/diff-viewer/diff';
|
|
2
|
+
import { ValuesType } from '../../internal-types';
|
|
3
|
+
export declare const DiffKind: {
|
|
4
|
+
readonly table: "table";
|
|
5
|
+
readonly column: "column";
|
|
6
|
+
readonly index: "index";
|
|
7
|
+
readonly foreignKey: "foreignKey";
|
|
8
|
+
readonly memo: "memo";
|
|
9
|
+
readonly tableGroup: "tableGroup";
|
|
10
|
+
};
|
|
11
|
+
export type DiffKind = ValuesType<typeof DiffKind>;
|
|
12
|
+
export declare const DiffStatus: {
|
|
13
|
+
readonly added: "added";
|
|
14
|
+
readonly modified: "modified";
|
|
15
|
+
readonly deleted: "deleted";
|
|
16
|
+
readonly renamed: "renamed";
|
|
17
|
+
};
|
|
18
|
+
export type DiffStatus = ValuesType<typeof DiffStatus>;
|
|
19
|
+
/** What of an entity changed, each the name of a tooltip line. */
|
|
20
|
+
export declare const DiffField: {
|
|
21
|
+
readonly name: "name";
|
|
22
|
+
readonly comment: "comment";
|
|
23
|
+
readonly dataType: "dataType";
|
|
24
|
+
readonly default: "default";
|
|
25
|
+
readonly autoIncrement: "autoIncrement";
|
|
26
|
+
readonly primaryKey: "primaryKey";
|
|
27
|
+
readonly unique: "unique";
|
|
28
|
+
readonly notNull: "notNull";
|
|
29
|
+
readonly order: "order";
|
|
30
|
+
readonly tableGroup: "tableGroup";
|
|
31
|
+
readonly position: "position";
|
|
32
|
+
readonly size: "size";
|
|
33
|
+
readonly color: "color";
|
|
34
|
+
readonly members: "members";
|
|
35
|
+
readonly columns: "columns";
|
|
36
|
+
readonly relationshipType: "relationshipType";
|
|
37
|
+
readonly onDelete: "onDelete";
|
|
38
|
+
readonly onUpdate: "onUpdate";
|
|
39
|
+
readonly value: "value";
|
|
40
|
+
};
|
|
41
|
+
export type DiffField = ValuesType<typeof DiffField>;
|
|
42
|
+
/** A value as the saved or the current document holds it, before any wording. */
|
|
43
|
+
export type DiffValue = string | number | boolean;
|
|
44
|
+
export type DiffChange = {
|
|
45
|
+
field: DiffField;
|
|
46
|
+
before: DiffValue;
|
|
47
|
+
after: DiffValue;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* One entity the two documents differ on, or that holds one that does. Its
|
|
51
|
+
* status is null for a table listed only for what changed inside it.
|
|
52
|
+
*/
|
|
53
|
+
export type DiffEntry = {
|
|
54
|
+
kind: DiffKind;
|
|
55
|
+
status: DiffStatus | null;
|
|
56
|
+
prevId: string | null;
|
|
57
|
+
nextId: string | null;
|
|
58
|
+
/** What the current document calls it, or the saved one where it is gone. */
|
|
59
|
+
name: string;
|
|
60
|
+
/** What the saved document calls it, the same as name unless renamed or added. */
|
|
61
|
+
prevName: string;
|
|
62
|
+
changes: DiffChange[];
|
|
63
|
+
/** A table's columns, indexes and foreign keys, in that order. */
|
|
64
|
+
children: DiffEntry[];
|
|
65
|
+
};
|
|
66
|
+
export type DiffEntries = {
|
|
67
|
+
tables: DiffEntry[];
|
|
68
|
+
tableGroups: DiffEntry[];
|
|
69
|
+
memos: DiffEntry[];
|
|
70
|
+
};
|
|
71
|
+
/** The entries for the tree and what each pane marks, which say the same thing. */
|
|
72
|
+
export type DocumentDiff = {
|
|
73
|
+
entries: DiffEntries;
|
|
74
|
+
prev: DiffMap;
|
|
75
|
+
next: DiffMap;
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=types.d.ts.map
|
package/dist/utils/emitter.d.ts
CHANGED
|
@@ -4,12 +4,6 @@ import { LocaleOption } from '../i18n/locales';
|
|
|
4
4
|
import { ValuesType } from '../internal-types';
|
|
5
5
|
import { ThemeOptions } from '../themes/radix-ui-theme';
|
|
6
6
|
import { GeometrySource } from './draw-relationship/geometrySource';
|
|
7
|
-
import { FindField } from './find-replace/findMatches';
|
|
8
|
-
/** A search the palette hands Find and Replace: the query, and the kinds of text it searches in. */
|
|
9
|
-
export type FindReplaceQuery = {
|
|
10
|
-
query: string;
|
|
11
|
-
fields: FindField[];
|
|
12
|
-
};
|
|
13
7
|
/**
|
|
14
8
|
* What Map Columns opens on: a relationship drawn between two tables and not
|
|
15
9
|
* made yet, or one the document holds whose columns it changes.
|
|
@@ -71,7 +65,7 @@ type InternalActionMap = {
|
|
|
71
65
|
event: ClipboardEvent;
|
|
72
66
|
};
|
|
73
67
|
[InternalActionType.toggleSearch]: void;
|
|
74
|
-
[InternalActionType.openFindReplace]:
|
|
68
|
+
[InternalActionType.openFindReplace]: void;
|
|
75
69
|
[InternalActionType.openExportImage]: void;
|
|
76
70
|
[InternalActionType.openMapColumns]: MapColumnsOpening;
|
|
77
71
|
[InternalActionType.openThemeBuilder]: void;
|
|
@@ -178,7 +172,7 @@ export declare const toggleSearchAction: {
|
|
|
178
172
|
type: string;
|
|
179
173
|
};
|
|
180
174
|
export declare const openFindReplaceAction: {
|
|
181
|
-
(payload: void
|
|
175
|
+
(payload: void): AnyAction<void>;
|
|
182
176
|
toString(): string;
|
|
183
177
|
type: string;
|
|
184
178
|
};
|
|
@@ -8,20 +8,22 @@ export declare const FindField: {
|
|
|
8
8
|
readonly columnName: "columnName";
|
|
9
9
|
readonly columnComment: "columnComment";
|
|
10
10
|
readonly memo: "memo";
|
|
11
|
+
readonly indexName: "indexName";
|
|
12
|
+
readonly tableGroupName: "tableGroupName";
|
|
11
13
|
};
|
|
12
14
|
export type FindField = ValuesType<typeof FindField>;
|
|
13
15
|
export declare const FindFieldList: ReadonlyArray<FindField>;
|
|
14
16
|
/**
|
|
15
|
-
* The kinds of text Find and Replace first opens on, the names of
|
|
16
|
-
* columns
|
|
17
|
-
* should not reach unasked.
|
|
17
|
+
* The kinds of text Find and Replace first opens on, the names alone of
|
|
18
|
+
* tables, columns, indexes and table groups (an owner decision): a comment or
|
|
19
|
+
* memo is prose a rename should not reach unasked. No fields reads every kind.
|
|
18
20
|
*/
|
|
19
21
|
export declare const DEFAULT_FIND_FIELDS: ReadonlyArray<FindField>;
|
|
20
22
|
export type FindMatch = {
|
|
21
23
|
field: FindField;
|
|
22
|
-
/** The entity holding the text: a table, a column or a memo. */
|
|
24
|
+
/** The entity holding the text: a table, a column, an index, a table group or a memo. */
|
|
23
25
|
id: string;
|
|
24
|
-
/** The table of a table or
|
|
26
|
+
/** The table of a table, column or index field; empty for a memo or a table group. */
|
|
25
27
|
tableId: string;
|
|
26
28
|
/** Where the field stands in the walk, so a match keeps its place when its text changes. */
|
|
27
29
|
slot: number;
|
|
@@ -37,19 +39,30 @@ type Field = Omit<FindMatch, 'start' | 'end'>;
|
|
|
37
39
|
*/
|
|
38
40
|
export declare const FindTextActionTypes: ReadonlyArray<ActionType>;
|
|
39
41
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
42
|
+
* The order a walk takes the tables and the table groups in. A search on the
|
|
43
|
+
* tree reads them by name; a run of Replace presses keeps the order it began
|
|
44
|
+
* with, so a rename that moves a table in the name order is not met again.
|
|
43
45
|
*/
|
|
44
|
-
export
|
|
46
|
+
export type FieldOrder = {
|
|
47
|
+
tableIds: ReadonlyArray<string>;
|
|
48
|
+
tableGroupIds: ReadonlyArray<string>;
|
|
49
|
+
};
|
|
50
|
+
/** The tables and the table groups by name, as the tree lists them, ties in document order. */
|
|
51
|
+
export declare function treeOrderOf({ doc, collections }: RootState): FieldOrder;
|
|
52
|
+
/**
|
|
53
|
+
* Every text field the fields given cover: each table's name and comment,
|
|
54
|
+
* its columns' names and comments and its index names, then the table groups'
|
|
55
|
+
* names and the memos, in document order or in the order given.
|
|
56
|
+
*/
|
|
57
|
+
export declare function walkFields(state: RootState, fields: ReadonlyArray<FindField>, order?: FieldOrder): Field[];
|
|
45
58
|
/**
|
|
46
59
|
* Every occurrence the matcher finds in the fields given, one entry each, in
|
|
47
|
-
* document order.
|
|
60
|
+
* document order or in the order given.
|
|
48
61
|
*
|
|
49
62
|
* @example
|
|
50
63
|
* findMatches(store.state, matcher, [FindField.columnName]);
|
|
51
64
|
*/
|
|
52
|
-
export declare function findMatches(state: RootState, matcher: Matcher, fields?: ReadonlyArray<FindField
|
|
65
|
+
export declare function findMatches(state: RootState, matcher: Matcher, fields?: ReadonlyArray<FindField>, order?: FieldOrder): FindMatch[];
|
|
53
66
|
/**
|
|
54
67
|
* The matches as they will stand once the field a match was found in holds a
|
|
55
68
|
* new value, before the store has it: that field searched again in the value,
|
|
@@ -76,7 +89,7 @@ export type ReplaceRun = Pick<FindMatch, 'field' | 'id' | 'slot' | 'start'> & {
|
|
|
76
89
|
* table added or removed before it moves that, or null once the field is gone
|
|
77
90
|
* or holds a text the run did not leave, after an undo or a peer's edit say.
|
|
78
91
|
*/
|
|
79
|
-
export declare function resumeRun(state: RootState, fields: ReadonlyArray<FindField>, run: ReplaceRun | null): ReplaceRun | null;
|
|
92
|
+
export declare function resumeRun(state: RootState, fields: ReadonlyArray<FindField>, run: ReplaceRun | null, order?: FieldOrder): ReplaceRun | null;
|
|
80
93
|
/**
|
|
81
94
|
* Where a Replace goes on to once it has written value in place of a match:
|
|
82
95
|
* the first match past what it wrote, wrapping to the first, or minus one once
|
|
@@ -4,8 +4,9 @@ import { FindField, FindMatch } from './findMatches';
|
|
|
4
4
|
/** The kind of text a match was found in, as its result row names it. */
|
|
5
5
|
export declare const FindFieldLabel: Record<FindField, PlainMessageKey>;
|
|
6
6
|
/**
|
|
7
|
-
* Where a match sits, as a reader finds it on the canvas: the table,
|
|
8
|
-
* table and column, and nothing for a memo
|
|
7
|
+
* Where a match sits, as a reader finds it on the canvas: the table, the
|
|
8
|
+
* table and column, the table an index belongs to, and nothing for a memo or
|
|
9
|
+
* a table group, which stand on their own.
|
|
9
10
|
*/
|
|
10
11
|
export declare function locationOf({ collections }: RootState, { field, id, tableId }: FindMatch, i18n?: Pick<I18n, 't'>): string;
|
|
11
12
|
/** A result row's second line: where the match sits, then the kind of text it was found in. */
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The replacement cased the way the text it replaces is, as VS Code's Preserve
|
|
3
|
+
* Case does: all upper, all lower or by the first letter, and piece by piece
|
|
4
|
+
* across the hyphens or the underscores both split into as many pieces by.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* preserveCase('USER_ID', 'account_key'); // 'ACCOUNT_KEY'
|
|
8
|
+
*/
|
|
9
|
+
export declare function preserveCase(matched: string, replacement: string): string;
|
|
10
|
+
//# sourceMappingURL=preserveCase.d.ts.map
|
|
@@ -16,6 +16,8 @@ export declare const KeyBindingName: {
|
|
|
16
16
|
readonly addTable: "addTable";
|
|
17
17
|
readonly addColumn: "addColumn";
|
|
18
18
|
readonly addMemo: "addMemo";
|
|
19
|
+
readonly addTableGroup: "addTableGroup";
|
|
20
|
+
readonly groupSelectedTables: "groupSelectedTables";
|
|
19
21
|
readonly removeTable: "removeTable";
|
|
20
22
|
readonly removeColumn: "removeColumn";
|
|
21
23
|
readonly removeSelection: "removeSelection";
|
|
@@ -35,18 +37,24 @@ export declare const KeyBindingName: {
|
|
|
35
37
|
readonly zenMode: "zenMode";
|
|
36
38
|
};
|
|
37
39
|
export type KeyBindingName = ValuesType<typeof KeyBindingName>;
|
|
38
|
-
export declare const KeyBindingNameList: ("undo" | "redo" | "selectAllColumn" | "search" | "stop" | "primaryKey" | "edit" | "addMemo" | "addTable" | "removeTable" | "addColumn" | "removeColumn" | "findReplace" | "removeSelection" | "selectAllTable" | "relationshipZeroOne" | "relationshipZeroN" | "relationshipOneOnly" | "relationshipOneN" | "tableProperties" | "focusView" | "zoomIn" | "zoomOut" | "zoomReset" | "handTool" | "zenMode")[];
|
|
40
|
+
export declare const KeyBindingNameList: ("undo" | "redo" | "selectAllColumn" | "search" | "stop" | "primaryKey" | "edit" | "addMemo" | "addTable" | "removeTable" | "addColumn" | "removeColumn" | "addTableGroup" | "findReplace" | "groupSelectedTables" | "removeSelection" | "selectAllTable" | "relationshipZeroOne" | "relationshipZeroN" | "relationshipOneOnly" | "relationshipOneN" | "tableProperties" | "focusView" | "zoomIn" | "zoomOut" | "zoomReset" | "handTool" | "zenMode")[];
|
|
39
41
|
/**
|
|
40
42
|
* The chords a press inside a floating panel still carries to the editor:
|
|
41
43
|
* Find and Replace's own, search, the document's undo and redo, and the zoom.
|
|
42
44
|
*/
|
|
43
45
|
export declare const PANEL_PASSING_BINDINGS: ReadonlyArray<KeyBindingName>;
|
|
44
46
|
export type KeyBindingMap = Record<KeyBindingName, ShortcutOption[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Whether a press inside a panel stops there: a press an IME still holds, a
|
|
49
|
+
* chord of the map outside the passing list, or a key the panel moves or
|
|
50
|
+
* presses with. A host that leaves Escape to the editor passes stop through.
|
|
51
|
+
*/
|
|
52
|
+
export declare function stopsAtPanel(event: KeyboardEvent, keyBindingMap: KeyBindingMap, passing?: ReadonlyArray<KeyBindingName>): boolean;
|
|
45
53
|
export declare const createKeyBindingMap: () => KeyBindingMap;
|
|
46
54
|
/**
|
|
47
55
|
* Whether the press is one of the chords given, matched as bindKeys matches a
|
|
48
|
-
* press, so a panel reads a binding as the editor root does.
|
|
49
|
-
*
|
|
56
|
+
* press, so a panel reads a binding as the editor root does. Of a sequence it
|
|
57
|
+
* is the last press, the one that would complete it at the root.
|
|
50
58
|
*/
|
|
51
59
|
export declare function matchesShortcut(event: KeyboardEvent, options: ReadonlyArray<ShortcutOption>): boolean;
|
|
52
60
|
export declare function shortcutToTuple(shortcut?: string): KeyBindingPress[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RootState } from '../engine/state';
|
|
2
|
+
/** The overlays that take the whole canvas over, each standing a scene of its own there. */
|
|
3
|
+
export declare const TAKEOVERS: ("automaticTablePlacement" | "diffViewer" | "timeTravel")[];
|
|
4
|
+
/** Whether an overlay that takes the canvas over is up, which keeps Find and Replace and the Explorer shut. */
|
|
5
|
+
export declare const isTakenOver: ({ editor }: RootState) => boolean;
|
|
6
|
+
//# sourceMappingURL=takeover.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** How many rows a virtual list draws past each edge of its view, so a short scroll finds them drawn already. */
|
|
2
|
+
export declare const VIRTUAL_OVERSCAN = 8;
|
|
3
|
+
/** The rows a list renders, first to last, both included; none while last is below first. */
|
|
4
|
+
export type VirtualRange = {
|
|
5
|
+
first: number;
|
|
6
|
+
last: number;
|
|
7
|
+
};
|
|
8
|
+
/** The rows the screen shows at a scroll offset, with the overscan either side. */
|
|
9
|
+
export declare function visibleRange(count: number, scrollTop: number, height: number, rowHeight: number): VirtualRange;
|
|
10
|
+
/**
|
|
11
|
+
* The scroll offset nearest the one given that shows a row whole: the same
|
|
12
|
+
* while it shows, else the row's top or bottom at the edge it is past.
|
|
13
|
+
*/
|
|
14
|
+
export declare function offsetToShow(index: number, scrollTop: number, height: number, rowHeight: number): number;
|
|
15
|
+
//# sourceMappingURL=virtualRange.d.ts.map
|