@dineug/erd-editor 3.9.1 → 3.10.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 +46 -9
- package/dist/components/erd/Erd.d.ts +1 -0
- package/dist/components/erd/canvas/relationship-group/relationship/Relationship.d.ts +2 -0
- package/dist/components/erd/canvas/relationship-group/relationship/RelationshipActionLabel.d.ts +32 -0
- package/dist/components/erd/canvas/table/cellLayout.d.ts +11 -0
- package/dist/components/erd/canvas/table/column/Column.d.ts +7 -0
- package/dist/components/erd/canvas/table/goToErd.d.ts +3 -10
- package/dist/components/erd/erd-context-menu/menus/relationshipMenus.d.ts +11 -0
- package/dist/components/erd/goToErdTarget.d.ts +85 -0
- package/dist/components/erd/table-properties/TableProperties.d.ts +2 -0
- package/dist/components/erd/table-properties/TableProperties.styles.d.ts +24 -2
- package/dist/components/erd/table-properties/table-properties-indexes/TablePropertiesIndexes.d.ts +2 -0
- package/dist/components/erd/table-properties/table-properties-indexes/TablePropertiesIndexes.styles.d.ts +32 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-checkbox-column/IndexesCheckboxColumn.d.ts +7 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-checkbox-column/IndexesCheckboxColumn.styles.d.ts +5 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-column/IndexesColumn.d.ts +7 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-column/IndexesColumn.styles.d.ts +3 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-index/IndexesIndex.d.ts +7 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-index/IndexesIndex.styles.d.ts +6 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-key/IndexesKey.d.ts +15 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-key/IndexesKey.styles.d.ts +13 -0
- package/dist/components/erd-editor/ErdEditor.d.ts +1 -1
- package/dist/components/find-replace/FindReplace.d.ts +13 -0
- package/dist/components/find-replace/FindReplace.styles.d.ts +27 -0
- package/dist/components/find-replace/fieldIcon.d.ts +5 -0
- package/dist/components/find-replace/matchTarget.d.ts +26 -0
- package/dist/components/find-replace/panelLayout.d.ts +17 -0
- package/dist/components/primitives/icon/icons.d.ts +10 -1
- package/dist/components/quick-search/QuickSearch.styles.d.ts +6 -0
- package/dist/components/quick-search/actions.d.ts +23 -0
- package/dist/components/quick-search/hangul.d.ts +73 -0
- package/dist/components/quick-search/paletteQuery.d.ts +37 -0
- package/dist/components/quick-search/scopedActions.d.ts +41 -0
- package/dist/components/visualization/table/column/Column.d.ts +4 -0
- package/dist/constants/layout.d.ts +13 -0
- package/dist/constants/open.d.ts +1 -0
- package/dist/constants/schema.d.ts +13 -0
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.js +20 -14
- package/dist/engine/modules/relationship/actions.d.ts +13 -0
- package/dist/engine/modules/relationship/atom.actions.d.ts +54 -0
- package/dist/engine/modules/relationship/fkColumns.d.ts +20 -3
- package/dist/engine/modules/relationship/generator.actions.d.ts +5 -2
- package/dist/engine/modules/relationship/history.d.ts +2 -0
- package/dist/engine/modules/relationship/hooks.d.ts +11 -0
- package/dist/engine/modules/table-column/hooks.d.ts +6 -0
- package/dist/engine/replication-store.d.ts +15 -1
- package/dist/engine/rx-operators/flushOnNotifier.d.ts +6 -0
- package/dist/engine/shared-store.d.ts +2 -2
- package/dist/engine/store-hooks.d.ts +8 -0
- package/dist/erd-editor.umd.js +1038 -481
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7151 -5306
- package/dist/konva/scene/metrics.d.ts +5 -0
- package/dist/{store-hooks-DuNN9ZKu.js → loadValue-Mdc5K4qO.js} +4002 -3426
- package/dist/peer/index.d.ts +1 -1
- package/dist/peer/index.js +77 -80
- package/dist/schemaGCService-CZtGFh2z.js +42 -0
- package/dist/services/schema-gc/schemaGCService.d.ts +5 -0
- package/dist/shared-store-D82WVL5a.js +1129 -0
- package/dist/utils/calcTable.d.ts +9 -1
- package/dist/utils/emitter.d.ts +13 -0
- package/dist/utils/find-replace/findMatches.d.ts +90 -0
- package/dist/utils/find-replace/index.d.ts +5 -0
- package/dist/utils/find-replace/matcher.d.ts +53 -0
- package/dist/utils/find-replace/present.d.ts +22 -0
- package/dist/utils/find-replace/replaceActions.d.ts +20 -0
- package/dist/utils/generator-code/utils.d.ts +12 -1
- package/dist/utils/keyboard-shortcut/index.d.ts +8 -1
- package/dist/utils/loadValue.d.ts +7 -0
- package/dist/utils/referentialAction.d.ts +21 -0
- package/dist/utils/schema-aml-parser/types.d.ts +6 -0
- package/dist/utils/schema-dbml-parser/types.d.ts +3 -0
- package/dist/utils/schema-sql/Databricks.d.ts +5 -0
- package/dist/utils/schema-sql/MSSQL.d.ts +5 -0
- package/dist/utils/schema-sql/MariaDB.d.ts +5 -0
- package/dist/utils/schema-sql/MySQL.d.ts +5 -0
- package/dist/utils/schema-sql/Oracle.d.ts +5 -0
- package/dist/utils/schema-sql/index.d.ts +5 -0
- package/dist/utils/schema-sql/utils.d.ts +19 -0
- package/dist/utils/schema-sql-parser/index.d.ts +5 -1
- package/dist/utils/table-clipboard/payload.d.ts +3 -0
- package/dist/utils/tableKeys.d.ts +46 -0
- package/dist/workers/elkLayout.shared-worker.js +1 -1
- package/dist/workers/exportPng.shared-worker.js +29 -27
- package/dist/workers/schemaGC.shared-worker.js +1 -1
- package/package.json +9 -8
- package/dist/schemaGCService-_8A8Oh9Q.js +0 -38
- package/dist/shared-store-CtJL8B4I.js +0 -1072
|
@@ -4,7 +4,9 @@ export declare const ICON_VIEW_BOX = "0 0 24 24";
|
|
|
4
4
|
export declare const ICON_STROKE_WIDTH = 2;
|
|
5
5
|
export type IconNodeChild = IconNode[number];
|
|
6
6
|
declare const LUCIDE_ICON: {
|
|
7
|
+
'arrow-down': IconNode;
|
|
7
8
|
'arrow-right': IconNode;
|
|
9
|
+
'arrow-up': IconNode;
|
|
8
10
|
atom: IconNode;
|
|
9
11
|
braces: IconNode;
|
|
10
12
|
brackets: IconNode;
|
|
@@ -13,6 +15,7 @@ declare const LUCIDE_ICON: {
|
|
|
13
15
|
'chevron-down': IconNode;
|
|
14
16
|
'chevron-right': IconNode;
|
|
15
17
|
code: IconNode;
|
|
18
|
+
'columns-2': IconNode;
|
|
16
19
|
contrast: IconNode;
|
|
17
20
|
copy: IconNode;
|
|
18
21
|
database: IconNode;
|
|
@@ -27,7 +30,9 @@ declare const LUCIDE_ICON: {
|
|
|
27
30
|
'grip-vertical': IconNode;
|
|
28
31
|
hand: IconNode;
|
|
29
32
|
'key-round': IconNode;
|
|
33
|
+
lock: IconNode;
|
|
30
34
|
maximize: IconNode;
|
|
35
|
+
'message-square': IconNode;
|
|
31
36
|
minimize: IconNode;
|
|
32
37
|
minus: IconNode;
|
|
33
38
|
'moon-star': IconNode;
|
|
@@ -37,6 +42,9 @@ declare const LUCIDE_ICON: {
|
|
|
37
42
|
plus: IconNode;
|
|
38
43
|
'redo-2': IconNode;
|
|
39
44
|
'refresh-cw': IconNode;
|
|
45
|
+
regex: IconNode;
|
|
46
|
+
replace: IconNode;
|
|
47
|
+
'replace-all': IconNode;
|
|
40
48
|
'rotate-ccw-clock': IconNode;
|
|
41
49
|
search: IconNode;
|
|
42
50
|
settings: IconNode;
|
|
@@ -44,12 +52,13 @@ declare const LUCIDE_ICON: {
|
|
|
44
52
|
spline: IconNode;
|
|
45
53
|
'sticky-note': IconNode;
|
|
46
54
|
sun: IconNode;
|
|
47
|
-
table: IconNode;
|
|
48
55
|
'table-2': IconNode;
|
|
49
56
|
'table-properties': IconNode;
|
|
57
|
+
'text-search': IconNode;
|
|
50
58
|
'undo-2': IconNode;
|
|
51
59
|
'wand-sparkles': IconNode;
|
|
52
60
|
waypoints: IconNode;
|
|
61
|
+
'whole-word': IconNode;
|
|
53
62
|
workflow: IconNode;
|
|
54
63
|
x: IconNode;
|
|
55
64
|
};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export declare const root: import('@dineug/r-html').CSSTemplateLiterals;
|
|
2
2
|
export declare const container: import('@dineug/r-html').CSSTemplateLiterals;
|
|
3
|
+
export declare const field: import('@dineug/r-html').CSSTemplateLiterals;
|
|
3
4
|
export declare const search: import('@dineug/r-html').CSSTemplateLiterals;
|
|
5
|
+
export declare const scope: import('@dineug/r-html').CSSTemplateLiterals;
|
|
6
|
+
export declare const hint: import('@dineug/r-html').CSSTemplateLiterals;
|
|
7
|
+
export declare const hintItem: import('@dineug/r-html').CSSTemplateLiterals;
|
|
8
|
+
export declare const empty: import('@dineug/r-html').CSSTemplateLiterals;
|
|
9
|
+
export declare const prefix: import('@dineug/r-html').CSSTemplateLiterals;
|
|
4
10
|
export declare const list: import('@dineug/r-html').CSSTemplateLiterals;
|
|
5
11
|
export declare const action: import('@dineug/r-html').CSSTemplateLiterals;
|
|
6
12
|
export declare const icon: import('@dineug/r-html').CSSTemplateLiterals;
|
|
@@ -1,15 +1,38 @@
|
|
|
1
1
|
import { DOMTemplateLiterals } from '@dineug/r-html';
|
|
2
2
|
import { AppContext } from '../appContext';
|
|
3
|
+
import { RootState } from '../../engine/state';
|
|
4
|
+
import { FindReplaceQuery } from '../../utils/emitter';
|
|
5
|
+
import { FindMatch } from '../../utils/find-replace';
|
|
3
6
|
export type Action = {
|
|
4
7
|
icon?: DOMTemplateLiterals | null;
|
|
5
8
|
name: string;
|
|
6
9
|
keywords?: string;
|
|
7
10
|
shortcut?: string;
|
|
11
|
+
/** The table a row jumps to, whose keyword names the kind of row, not the table. */
|
|
12
|
+
tableId?: string;
|
|
13
|
+
/** What choosing the row types into the input, which stays open, instead of running a command. */
|
|
14
|
+
insert?: string;
|
|
8
15
|
filter?: (app: AppContext) => boolean;
|
|
9
16
|
perform?: (app: AppContext) => void;
|
|
10
17
|
next?: Action[];
|
|
11
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* Whether a row holds the keyword: as typed, or by its Hangul letters, which
|
|
21
|
+
* an IME spells out one jamo at a time and a choseong search abbreviates.
|
|
22
|
+
*/
|
|
23
|
+
export declare function keywordHolder(keyword: string): (action: Action) => boolean;
|
|
24
|
+
/**
|
|
25
|
+
* How loose a fuzzy hit may be: stricter than fuse.js's 0.6, which fuzzed most
|
|
26
|
+
* words to some command (memo to the relationships, #us to orders), while a
|
|
27
|
+
* typo such as tabel still finds New Table. A row holding the keyword stays.
|
|
28
|
+
*/
|
|
29
|
+
export declare const SEARCH_THRESHOLD = 0.4;
|
|
12
30
|
export declare function searchActions(actions: Action[], keyword: string): Action[];
|
|
31
|
+
/** The palette's top level: the commands of every tab, then a jump to each table, which only the # prefix lists. */
|
|
13
32
|
export declare function createScopeActions(app: AppContext): Action[];
|
|
33
|
+
/** The row for one field a search found, saying where it is, which stands the reader on it when chosen. */
|
|
34
|
+
export declare function createMatchAction(state: RootState, match: FindMatch): Action;
|
|
35
|
+
/** The row handing a search to Find and Replace, named with the count the panel opens on. */
|
|
36
|
+
export declare function createShowAllAction(count: number, payload: FindReplaceQuery): Action;
|
|
14
37
|
export declare const allScopeActions: Action[];
|
|
15
38
|
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Chunk, FindChunksArgs } from 'highlight-words-core';
|
|
2
|
+
import { Matcher, TextRange } from '../../utils/find-replace';
|
|
3
|
+
export type HangulForms = {
|
|
4
|
+
/** The text spelled in jamo letter by letter and lower-cased, as disassemble spells it. */
|
|
5
|
+
jamo: string;
|
|
6
|
+
/** The initial of each syllable and each lone consonant, a cluster split in two, run together without the spaces. */
|
|
7
|
+
choseong: string;
|
|
8
|
+
};
|
|
9
|
+
/** A text's forms, spelled once and kept until the palette next opens or closes, since it reads every field again on each keystroke. */
|
|
10
|
+
export declare function hangulFormsOf(text: string): HangulForms;
|
|
11
|
+
/** Lets go of every form kept, as the palette opens and closes: they last one open and outlive no text the document dropped. */
|
|
12
|
+
export declare function clearHangulForms(): void;
|
|
13
|
+
export type HangulQuery = {
|
|
14
|
+
/** The keyword spelled in jamo, which the text's jamo has to hold. */
|
|
15
|
+
jamo: string;
|
|
16
|
+
/** The consonants of a keyword typed as initials alone, a cluster split in two, spaces dropped; null for any other keyword. */
|
|
17
|
+
choseong: string | null;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* How a keyword reads as a Hangul search, or null when it holds no Hangul and
|
|
21
|
+
* the palette matches as it always has.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* hangulQueryOf('ㅅㅇㅈ'); // { jamo: 'ㅅㅇㅈ', choseong: 'ㅅㅇㅈ' }
|
|
25
|
+
* hangulQueryOf('ㅄ'); // { jamo: 'ㅂㅅ', choseong: 'ㅂㅅ' }
|
|
26
|
+
* hangulQueryOf('사요'); // { jamo: 'ㅅㅏㅇㅛ', choseong: null }
|
|
27
|
+
*/
|
|
28
|
+
export declare function hangulQueryOf(keyword: string): HangulQuery | null;
|
|
29
|
+
/** How closely a text holds a Hangul keyword: all of it, from its start, or somewhere inside. */
|
|
30
|
+
export declare const HangulTier: {
|
|
31
|
+
readonly exact: 0;
|
|
32
|
+
readonly prefix: 1;
|
|
33
|
+
readonly inside: 2;
|
|
34
|
+
};
|
|
35
|
+
export type HangulTier = (typeof HangulTier)[keyof typeof HangulTier];
|
|
36
|
+
/**
|
|
37
|
+
* How closely a text holds a Hangul keyword, by its jamo or, for a keyword of
|
|
38
|
+
* initials, by the initials of its syllables; null when it holds it neither way.
|
|
39
|
+
*/
|
|
40
|
+
export declare function hangulTier(text: string, query: HangulQuery): HangulTier | null;
|
|
41
|
+
/**
|
|
42
|
+
* Every place a text holds a Hangul keyword, as whole letters of the text in
|
|
43
|
+
* order of where they start, so a jamo typed mid-syllable covers the syllables
|
|
44
|
+
* it spells: 상 in 사용자 covers 사용.
|
|
45
|
+
*/
|
|
46
|
+
export declare function hangulRanges(text: string, query: HangulQuery): TextRange[];
|
|
47
|
+
/** Where a text holds the keyword: as typed, which Find and Replace finds too, or by its Hangul letters alone, and how closely. */
|
|
48
|
+
export type TextHit = TextRange & ({
|
|
49
|
+
literal: true;
|
|
50
|
+
} | {
|
|
51
|
+
literal: false;
|
|
52
|
+
tier: HangulTier;
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* The first place a text holds the keyword: as typed, or failing that by its
|
|
56
|
+
* Hangul letters, which only the palette reads.
|
|
57
|
+
*/
|
|
58
|
+
export declare function matchText(text: string, matcher: Matcher, hangul: HangulQuery | null): TextHit | null;
|
|
59
|
+
/**
|
|
60
|
+
* Hits in a Hangul search's order: those holding the keyword as typed first,
|
|
61
|
+
* as they came, the way a search without Hangul lists them, then those only its
|
|
62
|
+
* letters hold, closest first and as they came within a tier.
|
|
63
|
+
*/
|
|
64
|
+
export declare function rankHits<T extends {
|
|
65
|
+
hit: TextHit;
|
|
66
|
+
}>(hits: T[]): T[];
|
|
67
|
+
/**
|
|
68
|
+
* The chunks a palette row lights up: each word where the text holds it as
|
|
69
|
+
* typed, and a Hangul word where the text holds it by its letters, widened to
|
|
70
|
+
* whole syllables. HighlightedText merges the ones that overlap.
|
|
71
|
+
*/
|
|
72
|
+
export declare function findPaletteChunks(args: FindChunksArgs): Chunk[];
|
|
73
|
+
//# sourceMappingURL=hangul.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ValuesType } from '../../internal-types';
|
|
2
|
+
export declare const PaletteScope: {
|
|
3
|
+
readonly tables: "tables";
|
|
4
|
+
readonly columns: "columns";
|
|
5
|
+
readonly text: "text";
|
|
6
|
+
readonly help: "help";
|
|
7
|
+
};
|
|
8
|
+
export type PaletteScope = ValuesType<typeof PaletteScope>;
|
|
9
|
+
export type PalettePrefix = {
|
|
10
|
+
prefix: string;
|
|
11
|
+
scope: PaletteScope;
|
|
12
|
+
label: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
/** The characters that, typed first, narrow the palette to one kind of row, in the order its hint lists them. */
|
|
16
|
+
export declare const PALETTE_PREFIXES: ReadonlyArray<PalettePrefix>;
|
|
17
|
+
export type PaletteQuery = {
|
|
18
|
+
/** The kind of row the prefix asks for, or null with no prefix, which lists the commands. */
|
|
19
|
+
scope: PaletteScope | null;
|
|
20
|
+
/** What is searched for, without the prefix, the space after it or the table part. */
|
|
21
|
+
keyword: string;
|
|
22
|
+
/** The table part of a column search, the text before its first dot; null when it has no dot. */
|
|
23
|
+
table: string | null;
|
|
24
|
+
};
|
|
25
|
+
/** The label the palette shows beside its input while a prefix narrows the list. */
|
|
26
|
+
export declare const scopeLabel: (scope: PaletteScope) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Reads what is typed into the palette: a prefix counts only as the first
|
|
29
|
+
* character past any space, in its full-width form too, a space may follow it,
|
|
30
|
+
* and a column search splits on its first dot.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* parsePaletteQuery('@users.em'); // { scope: 'columns', keyword: 'em', table: 'users' }
|
|
34
|
+
* parsePaletteQuery(':login email'); // { scope: 'text', keyword: 'login email', table: null }
|
|
35
|
+
*/
|
|
36
|
+
export declare function parsePaletteQuery(value: string): PaletteQuery;
|
|
37
|
+
//# sourceMappingURL=paletteQuery.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AppContext } from '../appContext';
|
|
2
|
+
import { FindField } from '../../utils/find-replace';
|
|
3
|
+
import { Action } from './actions';
|
|
4
|
+
import { PaletteQuery, PaletteScope } from './paletteQuery';
|
|
5
|
+
/** How many rows a prefixed list shows, few enough to draw at once. */
|
|
6
|
+
export declare const SCOPED_ACTION_LIMIT = 100;
|
|
7
|
+
/** What the colon searches: the free text, never a name. */
|
|
8
|
+
export declare const TEXT_FIELDS: FindField[];
|
|
9
|
+
/**
|
|
10
|
+
* The rows of a level a scope hands to the fuzzy search: the commands without
|
|
11
|
+
* a prefix, the tables after # alone, and none for a scope whose rows are read
|
|
12
|
+
* from the document. A submenu holds commands only.
|
|
13
|
+
*/
|
|
14
|
+
export declare function scopeBase(actions: Action[], scope: PaletteScope | null): Action[];
|
|
15
|
+
/**
|
|
16
|
+
* What the top level lists for a query, from the fuzzy hits of its scope: the
|
|
17
|
+
* commands, then the prefixes when none holds the keyword; the tables; or rows
|
|
18
|
+
* read from the document for the columns, the free text and the help.
|
|
19
|
+
*/
|
|
20
|
+
export declare function paletteRows(app: AppContext, found: Action[], { scope, keyword, table }: PaletteQuery): Action[];
|
|
21
|
+
/**
|
|
22
|
+
* The table rows the keyword fuzzes to, those holding it as typed or by its
|
|
23
|
+
* Hangul letters first, up to the scoped limit, past which a table whose name
|
|
24
|
+
* the panel finds it in hands the search to Find and Replace over the names.
|
|
25
|
+
*/
|
|
26
|
+
export declare function rankTableActions(app: AppContext, found: Action[], keyword: string): Action[];
|
|
27
|
+
/**
|
|
28
|
+
* One row a field of the kinds given holding the keyword, Hangul letters too,
|
|
29
|
+
* or every column or text, up to the scoped limit, past which one holding it as
|
|
30
|
+
* typed hands it to Find and Replace over those kinds, without the table part.
|
|
31
|
+
*/
|
|
32
|
+
export declare function createFieldActions(app: AppContext, fields: FindField[], keyword: string, table?: string | null): Action[];
|
|
33
|
+
/** The prefixes as rows, each typing its character into the input when chosen; a keyword fuzzes them. */
|
|
34
|
+
export declare function createHelpActions(keyword?: string): Action[];
|
|
35
|
+
/**
|
|
36
|
+
* The prefixes that search the document as rows offering the keyword to one,
|
|
37
|
+
* what a search with no prefix lists below its commands once none holds it:
|
|
38
|
+
* choosing one types its prefix before the keyword, so users becomes #users.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createPrefixActions(keyword: string): Action[];
|
|
41
|
+
//# sourceMappingURL=scopedActions.d.ts.map
|
|
@@ -6,6 +6,10 @@ export type ColumnProps = {
|
|
|
6
6
|
widthDataType: number;
|
|
7
7
|
widthDefault: number;
|
|
8
8
|
widthComment: number;
|
|
9
|
+
/** The room the table keeps for alternate key marks, 0 while it draws none. */
|
|
10
|
+
widthAlternateKey?: number;
|
|
11
|
+
/** The mark this row carries in that room, last, as the ERD scene draws it. */
|
|
12
|
+
alternateKey?: string;
|
|
9
13
|
};
|
|
10
14
|
declare const Column: FC<ColumnProps>;
|
|
11
15
|
export default Column;
|
|
@@ -48,6 +48,12 @@ export declare const COLUMN_MIN_WIDTH = 60;
|
|
|
48
48
|
export declare const COLUMN_NOT_NULL_WIDTH = 35;
|
|
49
49
|
export declare const COLUMN_UNIQUE_WIDTH = 22;
|
|
50
50
|
export declare const COLUMN_AUTO_INCREMENT_WIDTH = 15;
|
|
51
|
+
/**
|
|
52
|
+
* The advance one alternate key mark character takes. The mark is drawn at the
|
|
53
|
+
* cell size in the code face, whose glyphs all advance about 0.6 of the size,
|
|
54
|
+
* so a table is sized by the mark's length alone, in a headless peer too.
|
|
55
|
+
*/
|
|
56
|
+
export declare const COLUMN_ALTERNATE_KEY_CHAR_WIDTH: number;
|
|
51
57
|
export declare const COLUMN_PADDING = 2;
|
|
52
58
|
export declare const COLUMN_HEIGHT: number;
|
|
53
59
|
/** The table icon a view card draws beside its name, at the reference's 1rem. */
|
|
@@ -98,6 +104,13 @@ export declare const MEMO_MIN_HEIGHT = 100;
|
|
|
98
104
|
export declare const MINIMAP_SIZE = 150;
|
|
99
105
|
export declare const MINIMAP_MARGIN = 20;
|
|
100
106
|
export declare const TOOLBAR_HEIGHT = 30;
|
|
107
|
+
/**
|
|
108
|
+
* The padding around the Table Properties body. A band stuck to an edge of the
|
|
109
|
+
* body reaches back over it, so no row scrolls into sight behind the band.
|
|
110
|
+
*/
|
|
111
|
+
export declare const TABLE_PROPERTIES_BODY_PADDING = 12;
|
|
112
|
+
/** How many rows the Table Properties index order shows before it scrolls the rest. */
|
|
113
|
+
export declare const INDEX_ORDER_MAX_ROWS = 3;
|
|
101
114
|
export declare const DIFF_TREE_WIDTH = 200;
|
|
102
115
|
/**
|
|
103
116
|
* How thick a relationship connector is drawn. A whole number rather than a
|
package/dist/constants/open.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare const Open: {
|
|
|
6
6
|
readonly themeBuilder: "themeBuilder";
|
|
7
7
|
readonly diffViewer: "diffViewer";
|
|
8
8
|
readonly timeTravel: "timeTravel";
|
|
9
|
+
readonly findReplace: "findReplace";
|
|
9
10
|
};
|
|
10
11
|
export type Open = ValuesType<typeof Open>;
|
|
11
12
|
//# sourceMappingURL=open.d.ts.map
|
|
@@ -16,6 +16,8 @@ export declare const Show: {
|
|
|
16
16
|
readonly columnUnique: 64;
|
|
17
17
|
readonly columnNotNull: 128;
|
|
18
18
|
readonly relationship: 256;
|
|
19
|
+
readonly columnAlternateKey: 512;
|
|
20
|
+
readonly hideReferentialAction: 1024;
|
|
19
21
|
};
|
|
20
22
|
export declare const ColumnType: {
|
|
21
23
|
readonly columnName: 1;
|
|
@@ -81,6 +83,15 @@ export declare const StartRelationshipType: {
|
|
|
81
83
|
readonly dash: 2;
|
|
82
84
|
};
|
|
83
85
|
export declare const StartRelationshipTypeList: readonly number[];
|
|
86
|
+
export declare const ReferentialAction: {
|
|
87
|
+
readonly none: 1;
|
|
88
|
+
readonly noAction: 2;
|
|
89
|
+
readonly cascade: 4;
|
|
90
|
+
readonly setNull: 8;
|
|
91
|
+
readonly setDefault: 16;
|
|
92
|
+
readonly restrict: 32;
|
|
93
|
+
};
|
|
94
|
+
export declare const ReferentialActionList: readonly number[];
|
|
84
95
|
export declare const Direction: {
|
|
85
96
|
readonly left: 1;
|
|
86
97
|
readonly right: 2;
|
|
@@ -112,5 +123,7 @@ export declare const CANVAS_SIZE_MIN: 2000;
|
|
|
112
123
|
export declare const CANVAS_ZOOM_MAX: 1.5;
|
|
113
124
|
export declare const CANVAS_ZOOM_MIN: 0.1;
|
|
114
125
|
export declare const BracketTypeMap: Record<number, string>;
|
|
126
|
+
/** The clause each action writes after ON DELETE / ON UPDATE; none writes none. */
|
|
127
|
+
export declare const ReferentialActionToSQL: Record<number, string>;
|
|
115
128
|
export declare const ColumnTypeToName: Record<number, string>;
|
|
116
129
|
//# sourceMappingURL=schema.d.ts.map
|
package/dist/engine/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createReplicationStore, type ReplicationStore, } from './replication-store';
|
|
1
|
+
export { createReplicationStore, type ReplicationChange, type ReplicationStore, } from './replication-store';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/engine/index.js
CHANGED
|
@@ -1,34 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import { isEmpty as p } from "es-toolkit/compat";
|
|
1
|
+
import { Ln as e, Va as t, _ as n, dr as r, h as i, n as a, nt as o, r as s, t as c, u as l, un as u, x as d } from "../loadValue-Mdc5K4qO.js";
|
|
2
|
+
import { n as f, r as p } from "../schemaGCService-CZtGFh2z.js";
|
|
4
3
|
import { omit as m } from "es-toolkit";
|
|
5
4
|
import { Observable as h, Subject as g, debounceTime as _, map as v } from "rxjs";
|
|
6
5
|
//#region src/engine/replication-store.ts
|
|
7
6
|
var y = { change: "change" };
|
|
8
7
|
function b(b) {
|
|
9
|
-
let x = /* @__PURE__ */ new Set(), S =
|
|
10
|
-
C.dispatchSync(
|
|
8
|
+
let x = /* @__PURE__ */ new Set(), S = n(b), C = l(S, !1);
|
|
9
|
+
C.dispatchSync(e({
|
|
11
10
|
width: 0,
|
|
12
11
|
height: 0
|
|
13
12
|
}));
|
|
14
|
-
let w =
|
|
13
|
+
let w = a(C), T = new g(), E = new h((e) => C.subscribe((t) => e.next(t))).pipe(i(d), _(200)), D = /* @__PURE__ */ new Set(), O = null, k = (e) => (D.has(e) || D.add(e), () => {
|
|
15
14
|
D.delete(e);
|
|
16
15
|
}), A = (e, t) => {
|
|
17
16
|
D.forEach((n) => {
|
|
18
17
|
let r = Reflect.get(n, e);
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
}, j = (t) => {
|
|
22
|
-
let r = e(t);
|
|
23
|
-
C.dispatchSync(l(p(r) ? "{}" : r)), O.run(u(C.state)).then((e) => {
|
|
24
|
-
(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()));
|
|
18
|
+
u(r, t);
|
|
25
19
|
});
|
|
20
|
+
}, j = (e) => {
|
|
21
|
+
O = null, C.dispatchSync(o(c(e)));
|
|
22
|
+
let n = f(t(C.state));
|
|
23
|
+
Object.values(n).some((e) => e.length) && (p(C.state, n), C.dispatchSync(r())), s(C.state, S);
|
|
26
24
|
}, M = (e) => {
|
|
27
25
|
T.next([e].flat());
|
|
28
26
|
};
|
|
29
|
-
return x.add(E.subscribe(() =>
|
|
27
|
+
return x.add(E.subscribe(() => {
|
|
28
|
+
let e = t(C.state), n = O !== null && e !== O;
|
|
29
|
+
O !== null && (O = e), A(y.change, {
|
|
30
|
+
value: e,
|
|
31
|
+
changed: n
|
|
32
|
+
});
|
|
33
|
+
})).add(T.pipe(i(d), v((e) => e.map((e) => m(e, ["tags"])))).subscribe((e) => {
|
|
34
|
+
O ??= t(C.state), C.dispatchSync(e);
|
|
35
|
+
})), Object.freeze({
|
|
30
36
|
get value() {
|
|
31
|
-
return
|
|
37
|
+
return t(C.state);
|
|
32
38
|
},
|
|
33
39
|
on: k,
|
|
34
40
|
setInitialValue: j,
|
|
@@ -6,12 +6,17 @@ export declare const ActionType: {
|
|
|
6
6
|
readonly addRelationship: "relationship.add";
|
|
7
7
|
readonly removeRelationship: "relationship.remove";
|
|
8
8
|
readonly changeRelationshipType: "relationship.changeType";
|
|
9
|
+
readonly changeRelationshipOnDelete: "relationship.changeOnDelete";
|
|
10
|
+
readonly changeRelationshipOnUpdate: "relationship.changeOnUpdate";
|
|
9
11
|
};
|
|
10
12
|
export type ActionType = ValuesType<typeof ActionType>;
|
|
11
13
|
export type ActionMap = {
|
|
12
14
|
[ActionType.addRelationship]: {
|
|
13
15
|
id: string;
|
|
14
16
|
relationshipType: number;
|
|
17
|
+
/** Absent from an editor that predates the referential actions. */
|
|
18
|
+
onDelete?: number;
|
|
19
|
+
onUpdate?: number;
|
|
15
20
|
start: RelationshipPoint;
|
|
16
21
|
end: RelationshipPoint;
|
|
17
22
|
};
|
|
@@ -22,6 +27,14 @@ export type ActionMap = {
|
|
|
22
27
|
id: string;
|
|
23
28
|
value: number;
|
|
24
29
|
};
|
|
30
|
+
[ActionType.changeRelationshipOnDelete]: {
|
|
31
|
+
id: string;
|
|
32
|
+
value: number;
|
|
33
|
+
};
|
|
34
|
+
[ActionType.changeRelationshipOnUpdate]: {
|
|
35
|
+
id: string;
|
|
36
|
+
value: number;
|
|
37
|
+
};
|
|
25
38
|
};
|
|
26
39
|
export type ReducerType<T extends keyof ActionMap> = Reducer<RootState, T, ActionMap, EngineContext>;
|
|
27
40
|
type RelationshipPoint = {
|
|
@@ -3,6 +3,8 @@ export declare const addRelationshipAction: {
|
|
|
3
3
|
(payload: {
|
|
4
4
|
id: string;
|
|
5
5
|
relationshipType: number;
|
|
6
|
+
onDelete?: number;
|
|
7
|
+
onUpdate?: number;
|
|
6
8
|
start: {
|
|
7
9
|
tableId: string;
|
|
8
10
|
columnIds: string[];
|
|
@@ -14,6 +16,8 @@ export declare const addRelationshipAction: {
|
|
|
14
16
|
}): import('@dineug/r-html').AnyAction<{
|
|
15
17
|
id: string;
|
|
16
18
|
relationshipType: number;
|
|
19
|
+
onDelete?: number;
|
|
20
|
+
onUpdate?: number;
|
|
17
21
|
start: {
|
|
18
22
|
tableId: string;
|
|
19
23
|
columnIds: string[];
|
|
@@ -46,16 +50,42 @@ export declare const changeRelationshipTypeAction: {
|
|
|
46
50
|
toString(): string;
|
|
47
51
|
type: string;
|
|
48
52
|
};
|
|
53
|
+
export declare const changeRelationshipOnDeleteAction: {
|
|
54
|
+
(payload: {
|
|
55
|
+
id: string;
|
|
56
|
+
value: number;
|
|
57
|
+
}): import('@dineug/r-html').AnyAction<{
|
|
58
|
+
id: string;
|
|
59
|
+
value: number;
|
|
60
|
+
}>;
|
|
61
|
+
toString(): string;
|
|
62
|
+
type: string;
|
|
63
|
+
};
|
|
64
|
+
export declare const changeRelationshipOnUpdateAction: {
|
|
65
|
+
(payload: {
|
|
66
|
+
id: string;
|
|
67
|
+
value: number;
|
|
68
|
+
}): import('@dineug/r-html').AnyAction<{
|
|
69
|
+
id: string;
|
|
70
|
+
value: number;
|
|
71
|
+
}>;
|
|
72
|
+
toString(): string;
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
49
75
|
export declare const relationshipReducers: {
|
|
50
76
|
"relationship.add": ReducerType<"relationship.add">;
|
|
51
77
|
"relationship.remove": ReducerType<"relationship.remove">;
|
|
52
78
|
"relationship.changeType": ReducerType<"relationship.changeType">;
|
|
79
|
+
"relationship.changeOnDelete": ReducerType<"relationship.changeOnDelete">;
|
|
80
|
+
"relationship.changeOnUpdate": ReducerType<"relationship.changeOnUpdate">;
|
|
53
81
|
};
|
|
54
82
|
export declare const actions: {
|
|
55
83
|
addRelationshipAction: {
|
|
56
84
|
(payload: {
|
|
57
85
|
id: string;
|
|
58
86
|
relationshipType: number;
|
|
87
|
+
onDelete?: number;
|
|
88
|
+
onUpdate?: number;
|
|
59
89
|
start: {
|
|
60
90
|
tableId: string;
|
|
61
91
|
columnIds: string[];
|
|
@@ -67,6 +97,8 @@ export declare const actions: {
|
|
|
67
97
|
}): import('@dineug/r-html').AnyAction<{
|
|
68
98
|
id: string;
|
|
69
99
|
relationshipType: number;
|
|
100
|
+
onDelete?: number;
|
|
101
|
+
onUpdate?: number;
|
|
70
102
|
start: {
|
|
71
103
|
tableId: string;
|
|
72
104
|
columnIds: string[];
|
|
@@ -99,5 +131,27 @@ export declare const actions: {
|
|
|
99
131
|
toString(): string;
|
|
100
132
|
type: string;
|
|
101
133
|
};
|
|
134
|
+
changeRelationshipOnDeleteAction: {
|
|
135
|
+
(payload: {
|
|
136
|
+
id: string;
|
|
137
|
+
value: number;
|
|
138
|
+
}): import('@dineug/r-html').AnyAction<{
|
|
139
|
+
id: string;
|
|
140
|
+
value: number;
|
|
141
|
+
}>;
|
|
142
|
+
toString(): string;
|
|
143
|
+
type: string;
|
|
144
|
+
};
|
|
145
|
+
changeRelationshipOnUpdateAction: {
|
|
146
|
+
(payload: {
|
|
147
|
+
id: string;
|
|
148
|
+
value: number;
|
|
149
|
+
}): import('@dineug/r-html').AnyAction<{
|
|
150
|
+
id: string;
|
|
151
|
+
value: number;
|
|
152
|
+
}>;
|
|
153
|
+
toString(): string;
|
|
154
|
+
type: string;
|
|
155
|
+
};
|
|
102
156
|
};
|
|
103
157
|
//# sourceMappingURL=atom.actions.d.ts.map
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import { AnyAction } from '@dineug/r-html';
|
|
2
2
|
import { Column } from '../../../internal-types';
|
|
3
|
+
/** The start table's name and the names the end table's columns hold. */
|
|
4
|
+
export type ForeignKeyNaming = {
|
|
5
|
+
startTableName: string;
|
|
6
|
+
endColumnNames: string[];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Tells a name of one word, id, ID, Id, UUID, id2 or 회원번호, from one of
|
|
10
|
+
* several, user_id, userId, UserID, IDCard or 회원ID: one word is letters and
|
|
11
|
+
* digits with none of the breaks CASE_BOUNDARY finds, read past marks and digits.
|
|
12
|
+
*/
|
|
13
|
+
export declare const isSingleWord: (name: string) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Names the foreign key column of each single word key after the start table,
|
|
16
|
+
* user_id for the key id of user, keeps other key names, and numbers a name
|
|
17
|
+
* already taken, user_id_2, without case; free names, kept first, claim first.
|
|
18
|
+
*/
|
|
19
|
+
export declare function toForeignKeyNames(startTableName: string, keyNames: string[], endColumnNames: string[]): string[];
|
|
3
20
|
/**
|
|
4
21
|
* Adds a NOT NULL copy of each start column to the end table under the id at
|
|
5
|
-
* the same index of endColumnIds,
|
|
6
|
-
* comment. The caller owns the ids
|
|
22
|
+
* the same index of endColumnIds, named by toForeignKeyNames, carrying its data
|
|
23
|
+
* type, default and comment. The caller owns the ids the relationship needs.
|
|
7
24
|
*/
|
|
8
|
-
export declare const toForeignKeyActions: (startColumns: Column[], endTableId: string, endColumnIds: string[]) => AnyAction[];
|
|
25
|
+
export declare const toForeignKeyActions: (startColumns: Column[], endTableId: string, endColumnIds: string[], { startTableName, endColumnNames }: ForeignKeyNaming) => AnyAction[];
|
|
9
26
|
//# sourceMappingURL=fkColumns.d.ts.map
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { GeneratorAction } from '../../generator.actions';
|
|
2
|
+
import { ActionMap, ActionType } from './actions';
|
|
3
|
+
type ReferentialActions = Pick<ActionMap[typeof ActionType.addRelationship], 'onDelete' | 'onUpdate'>;
|
|
2
4
|
/**
|
|
3
5
|
* Draws a relationship between two live tables in one batch, giving the start
|
|
4
6
|
* table a primary key first when it has none and copying the keys onto the end
|
|
5
7
|
* table, which may be the start table itself. An unknown table yields nothing.
|
|
6
8
|
*/
|
|
7
|
-
export declare const addRelationshipAction$: (startTableId: string, endTableId: string, relationshipType: number) => GeneratorAction;
|
|
9
|
+
export declare const addRelationshipAction$: (startTableId: string, endTableId: string, relationshipType: number, referentialActions?: ReferentialActions) => GeneratorAction;
|
|
8
10
|
export declare const actions$: {
|
|
9
|
-
addRelationshipAction$: (startTableId: string, endTableId: string, relationshipType: number) => GeneratorAction;
|
|
11
|
+
addRelationshipAction$: (startTableId: string, endTableId: string, relationshipType: number, referentialActions?: ReferentialActions) => GeneratorAction;
|
|
10
12
|
};
|
|
13
|
+
export {};
|
|
11
14
|
//# sourceMappingURL=generator.actions.d.ts.map
|
|
@@ -3,5 +3,7 @@ export declare const relationshipPushUndoHistoryMap: {
|
|
|
3
3
|
"relationship.add": PushUndoHistory;
|
|
4
4
|
"relationship.remove": PushUndoHistory;
|
|
5
5
|
"relationship.changeType": PushUndoHistory;
|
|
6
|
+
"relationship.changeOnDelete": PushUndoHistory;
|
|
7
|
+
"relationship.changeOnUpdate": PushUndoHistory;
|
|
6
8
|
};
|
|
7
9
|
//# sourceMappingURL=history.d.ts.map
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
import { Hook } from '../../hooks';
|
|
2
|
+
import { RootState } from '../../state';
|
|
3
|
+
/**
|
|
4
|
+
* Marks each relationship identifying when every column it ends on is a primary
|
|
5
|
+
* key. A load reads it off the columns again, as a key edit or a removal does.
|
|
6
|
+
*/
|
|
7
|
+
export declare function recalculateIdentification({ doc, collections }: RootState): void;
|
|
8
|
+
/**
|
|
9
|
+
* Starts each relationship dashed when every column it ends on is not null and
|
|
10
|
+
* ringed otherwise, read off the columns as the identification is.
|
|
11
|
+
*/
|
|
12
|
+
export declare function recalculateStartRelationshipType({ doc, collections, }: RootState): void;
|
|
2
13
|
export declare const hooks: Hook[];
|
|
3
14
|
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { Hook } from '../../hooks';
|
|
2
|
+
import { RootState } from '../../state';
|
|
3
|
+
/**
|
|
4
|
+
* Marks as a foreign key every column a relationship ends on, and only those,
|
|
5
|
+
* as a load leaves the marks to be read off the relationships again.
|
|
6
|
+
*/
|
|
7
|
+
export declare function validateForeignKeys({ doc, collections }: RootState): void;
|
|
2
8
|
export declare const hooks: Hook[];
|
|
3
9
|
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -9,10 +9,24 @@ declare const InternalActionType: {
|
|
|
9
9
|
};
|
|
10
10
|
type InternalActionType = ValuesType<typeof InternalActionType>;
|
|
11
11
|
type InternalActionMap = {
|
|
12
|
-
[InternalActionType.change]:
|
|
12
|
+
[InternalActionType.change]: ReplicationChange;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* What a change hands its listeners: the document serialized, and whether the
|
|
16
|
+
* change actions since the last change, or since the load, left it byte for
|
|
17
|
+
* byte as it was, as a scroll or a zoom the file does not save does.
|
|
18
|
+
*/
|
|
19
|
+
export type ReplicationChange = {
|
|
20
|
+
value: string;
|
|
21
|
+
changed: boolean;
|
|
13
22
|
};
|
|
14
23
|
export type ReplicationStore = {
|
|
15
24
|
readonly value: string;
|
|
25
|
+
/**
|
|
26
|
+
* A change comes 200 ms after the last change action, even one that left the
|
|
27
|
+
* value as it was (changed false): a hub waits for each as a save, and a host
|
|
28
|
+
* writes nothing for such a one, whatever bytes its file holds.
|
|
29
|
+
*/
|
|
16
30
|
on: (listeners: Partial<ListenerRecord>) => Unsubscribe;
|
|
17
31
|
setInitialValue: (value: string) => void;
|
|
18
32
|
dispatch: (actions: Array<AnyAction> | AnyAction) => void;
|
|
@@ -6,4 +6,10 @@ import { StreamBufferOperator } from './groupByStreamActions';
|
|
|
6
6
|
* pending emits nothing and an extra tick is harmless.
|
|
7
7
|
*/
|
|
8
8
|
export declare const flushOnNotifier: (notifier$: Observable<unknown>) => StreamBufferOperator;
|
|
9
|
+
/**
|
|
10
|
+
* Closes a stream buffer after groupByStreamActions' 200 ms quiet period, or
|
|
11
|
+
* at once when the notifier fires: the editor keeps its timing, and a host
|
|
12
|
+
* can still send what is held before it lets the store go.
|
|
13
|
+
*/
|
|
14
|
+
export declare const quietPeriodOrNotifier: (notifier$: Observable<unknown>, quietMs?: number) => StreamBufferOperator;
|
|
9
15
|
//# sourceMappingURL=flushOnNotifier.d.ts.map
|