@dineug/erd-editor 4.1.0 → 4.2.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 +17 -4
- package/dist/components/dictionary/Dictionary.d.ts +12 -0
- package/dist/components/dictionary/Dictionary.styles.d.ts +33 -0
- package/dist/components/dictionary/checkCount.d.ts +28 -0
- package/dist/components/dictionary/checkSheet.d.ts +41 -0
- package/dist/components/dictionary/dictionary-context-menu/DictionaryContextMenu.d.ts +30 -0
- package/dist/components/dictionary/dictionaryCommit.d.ts +83 -0
- package/dist/components/dictionary/dictionaryFile.d.ts +23 -0
- package/dist/components/dictionary/dictionaryKeys.d.ts +48 -0
- package/dist/components/dictionary/dictionaryView.d.ts +65 -0
- package/dist/components/dictionary/domain-cell-editor/DomainCellEditor.d.ts +22 -0
- package/dist/components/dictionary/domain-cell-editor/DomainCellEditor.styles.d.ts +7 -0
- package/dist/components/dictionary/domain-cell-editor/openDomainCellEditor.d.ts +9 -0
- package/dist/components/dictionary/gridTheme.d.ts +18 -0
- package/dist/components/dictionary/sheets.d.ts +65 -0
- package/dist/components/erd/automatic-table-placement/flowPlacement.d.ts +4 -4
- package/dist/components/erd/canvas/EditOverlay.styles.d.ts +6 -0
- package/dist/components/erd/canvas/sceneHit.d.ts +5 -0
- package/dist/components/erd/canvas/sceneTokens.d.ts +6 -0
- package/dist/components/erd/canvas/table/Table.d.ts +6 -0
- package/dist/components/erd/canvas/table/blankLogicalName.d.ts +19 -0
- package/dist/components/erd/canvas/table/cellLayout.d.ts +4 -4
- package/dist/components/erd/canvas/table/column/Column.d.ts +32 -5
- package/dist/components/erd/canvas/table/dictionaryMarks.d.ts +29 -0
- package/dist/components/erd/canvas/table/useFocusTable.d.ts +1 -0
- package/dist/components/erd/diff-viewer/diff-tree/DiffTree.styles.d.ts +1 -0
- package/dist/components/erd/diff-viewer/diff-tree/diffTreeModel.d.ts +4 -1
- package/dist/components/erd/erd-context-menu/menus/nameViewMenus.d.ts +22 -0
- package/dist/components/erd/floating-toolbar/FloatingToolbar.d.ts +1 -1
- package/dist/components/erd/floating-toolbar/nameViewDropdown.d.ts +16 -0
- package/dist/components/erd/floating-toolbar/nameViewDropdown.styles.d.ts +5 -0
- package/dist/components/erd/readerNameView.d.ts +15 -0
- package/dist/components/explorer/explorerTree.d.ts +4 -1
- package/dist/components/explorer/fieldIcon.d.ts +4 -1
- package/dist/components/explorer/matchTarget.d.ts +6 -6
- package/dist/components/export-image/ExportImage.d.ts +10 -0
- package/dist/components/export-image/exportImageActions.d.ts +2 -2
- package/dist/components/flowCenters.d.ts +9 -0
- package/dist/components/map-columns/nameOf.d.ts +11 -3
- package/dist/components/primitives/icon/icons.d.ts +5 -0
- package/dist/components/quick-search/actions.d.ts +3 -1
- package/dist/components/quick-search/scopedActions.d.ts +2 -2
- package/dist/components/schema-sql/schema-sql-options/SchemaSQLOptions.d.ts +2 -2
- package/dist/components/schema-sql/schema-sql-options/SchemaSQLOptions.styles.d.ts +2 -0
- package/dist/components/schema-sql/schemaSQLView.d.ts +2 -0
- package/dist/components/settings/lockSettingRows.d.ts +2 -1
- package/dist/components/table-view/column/column-domain/ColumnDomain.d.ts +19 -0
- package/dist/components/table-view/column/column-domain/domainOptions.d.ts +13 -0
- package/dist/components/table-view/column/column-logical-name/ColumnLogicalName.d.ts +22 -0
- package/dist/components/table-view/column/column-logical-name/ColumnLogicalName.styles.d.ts +4 -0
- package/dist/components/table-view/column/columnViewText.d.ts +33 -0
- package/dist/components/table-view/column/useHintList.d.ts +24 -0
- package/dist/components/visualization/createVisualization.d.ts +2 -0
- package/dist/components/visualization/flowLayout.d.ts +2 -1
- package/dist/components/visualization/table/column/Column.d.ts +4 -0
- package/dist/components/visualization/visualization-toolbar/VisualizationToolbar.d.ts +2 -2
- package/dist/components/visualization/visualizationView.d.ts +15 -4
- package/dist/constants/layout.d.ts +11 -0
- package/dist/constants/schema.d.ts +15 -2
- package/dist/engine/actions.d.ts +5 -2
- package/dist/engine/history.actions.d.ts +8 -0
- package/dist/engine/history.d.ts +11 -3
- package/dist/engine/index.js +17 -17
- package/dist/engine/modules/dictionary/actions.d.ts +74 -0
- package/dist/engine/modules/dictionary/atom.actions.d.ts +74 -0
- package/dist/engine/modules/dictionary/checks.d.ts +76 -0
- package/dist/engine/modules/dictionary/derive.d.ts +54 -0
- package/dist/engine/modules/dictionary/derivedNames.d.ts +23 -0
- package/dist/engine/modules/dictionary/dictionaryIndex.d.ts +73 -0
- package/dist/engine/modules/dictionary/domainLinks.d.ts +9 -0
- package/dist/engine/modules/dictionary/domainTypes.d.ts +27 -0
- package/dist/engine/modules/dictionary/entryWrites.d.ts +63 -0
- package/dist/engine/modules/dictionary/generator.actions.d.ts +126 -0
- package/dist/engine/modules/dictionary/history.d.ts +14 -0
- package/dist/engine/modules/dictionary/membership.d.ts +28 -0
- package/dist/engine/modules/dictionary/orderKeys.d.ts +13 -0
- package/dist/engine/modules/dictionary/termIndex.d.ts +24 -0
- package/dist/engine/modules/editor/actions.d.ts +18 -3
- package/dist/engine/modules/editor/atom.actions.d.ts +24 -6
- package/dist/engine/modules/editor/generator.actions.d.ts +22 -8
- package/dist/engine/modules/editor/state.d.ts +24 -0
- package/dist/engine/modules/editor/utils/nameView.d.ts +103 -0
- package/dist/engine/modules/editor/view.actions.d.ts +24 -1
- package/dist/engine/modules/editor/view.d.ts +8 -0
- package/dist/engine/modules/relationship/fkColumns.d.ts +10 -4
- package/dist/engine/modules/settings/actions.d.ts +13 -3
- package/dist/engine/modules/settings/atom.actions.d.ts +49 -5
- package/dist/engine/modules/settings/generator.actions.d.ts +2 -2
- package/dist/engine/modules/table/actions.d.ts +7 -0
- package/dist/engine/modules/table/atom.actions.d.ts +46 -0
- package/dist/engine/modules/table/generator.actions.d.ts +7 -0
- package/dist/engine/modules/table/history.d.ts +2 -0
- package/dist/engine/modules/table-column/actions.d.ts +7 -0
- package/dist/engine/modules/table-column/atom.actions.d.ts +49 -0
- package/dist/engine/modules/table-column/generator.actions.d.ts +5 -0
- package/dist/engine/modules/table-column/history.d.ts +3 -0
- package/dist/engine/modules/table-column/utils/dataType.d.ts +3 -1
- package/dist/engine/rx-store.d.ts +6 -0
- package/dist/engine/tag.d.ts +8 -0
- package/dist/erd-editor.umd.js +1163 -817
- package/dist/i18n/messages/ar-SA.d.ts +125 -0
- package/dist/i18n/messages/de-DE.d.ts +93 -0
- package/dist/i18n/messages/en/common.d.ts +11 -0
- package/dist/i18n/messages/en/contextMenu.d.ts +1 -0
- package/dist/i18n/messages/en/dictionary.d.ts +79 -0
- package/dist/i18n/messages/en/findReplace.d.ts +2 -0
- package/dist/i18n/messages/en/index.d.ts +93 -0
- package/dist/i18n/messages/en/palette.d.ts +4 -0
- package/dist/i18n/messages/en/schemaSql.d.ts +1 -0
- package/dist/i18n/messages/en/settings.d.ts +1 -0
- package/dist/i18n/messages/en/visualization.d.ts +2 -0
- package/dist/i18n/messages/es-ES.d.ts +101 -0
- package/dist/i18n/messages/eu-ES.d.ts +93 -0
- package/dist/i18n/messages/fa-IR.d.ts +93 -0
- package/dist/i18n/messages/fr-FR.d.ts +101 -0
- package/dist/i18n/messages/he-IL.d.ts +101 -0
- package/dist/i18n/messages/id-ID.d.ts +85 -0
- package/dist/i18n/messages/it-IT.d.ts +101 -0
- package/dist/i18n/messages/ja-JP.d.ts +85 -0
- package/dist/i18n/messages/ko-KR.d.ts +85 -0
- package/dist/i18n/messages/nl-NL.d.ts +93 -0
- package/dist/i18n/messages/pl-PL.d.ts +109 -0
- package/dist/i18n/messages/pt-BR.d.ts +101 -0
- package/dist/i18n/messages/pt-PT.d.ts +101 -0
- package/dist/i18n/messages/ro-RO.d.ts +101 -0
- package/dist/i18n/messages/ru-RU.d.ts +109 -0
- package/dist/i18n/messages/sk-SK.d.ts +109 -0
- package/dist/i18n/messages/sl-SI.d.ts +109 -0
- package/dist/i18n/messages/sv-SE.d.ts +93 -0
- package/dist/i18n/messages/tr-TR.d.ts +93 -0
- package/dist/i18n/messages/uk-UA.d.ts +109 -0
- package/dist/i18n/messages/zh-CN.d.ts +85 -0
- package/dist/i18n/messages/zh-TW.d.ts +85 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +25195 -18014
- package/dist/internal-types/index.d.ts +6 -0
- package/dist/konva/scene/columnDropTarget.d.ts +2 -2
- package/dist/loadValue-B5ojYrZ-.js +14682 -0
- package/dist/peer/index.d.ts +4 -0
- package/dist/peer/index.js +61 -60
- package/dist/services/export-png/ExportScene.d.ts +1 -1
- package/dist/services/export-png/documentScene.d.ts +7 -1
- package/dist/services/export-png/index.d.ts +11 -5
- package/dist/services/export-png/renderPng.d.ts +4 -1
- package/dist/services/export-png/renderSvg.d.ts +4 -1
- package/dist/shared-store-S7YWEz3E.js +1656 -0
- package/dist/themes/tokens.d.ts +12 -0
- package/dist/utils/calcTable.d.ts +20 -4
- package/dist/utils/collection/domain.entity.d.ts +3 -0
- package/dist/utils/collection/term.entity.d.ts +3 -0
- package/dist/utils/collection/word.entity.d.ts +3 -0
- package/dist/utils/dictionary-csv/csv.d.ts +13 -0
- package/dist/utils/dictionary-csv/decode.d.ts +7 -0
- package/dist/utils/dictionary-csv/dictionaryCsv.d.ts +55 -0
- package/dist/utils/dictionary-csv/index.d.ts +4 -0
- package/dist/utils/diff/types.d.ts +4 -0
- package/dist/utils/file/exportFile.d.ts +10 -0
- package/dist/utils/find-replace/findMatches.d.ts +10 -4
- package/dist/utils/find-replace/present.d.ts +1 -1
- package/dist/utils/find-replace/replaceActions.d.ts +9 -5
- package/dist/utils/focus.d.ts +2 -0
- package/dist/utils/formatCount.d.ts +10 -0
- package/dist/utils/keyboard-shortcut/index.d.ts +1 -1
- package/dist/utils/map-columns/alignTypes.d.ts +3 -3
- package/dist/utils/schema-sql/Databricks.d.ts +2 -2
- package/dist/utils/schema-sql/MSSQL.d.ts +1 -1
- package/dist/utils/schema-sql/MariaDB.d.ts +2 -2
- package/dist/utils/schema-sql/MySQL.d.ts +2 -2
- package/dist/utils/schema-sql/Oracle.d.ts +1 -1
- package/dist/utils/schema-sql/PostgreSQL.d.ts +1 -1
- package/dist/utils/schema-sql/SQLite.d.ts +2 -2
- package/dist/utils/schema-sql/Snowflake.d.ts +2 -2
- package/dist/utils/schema-sql/options.d.ts +2 -0
- package/dist/utils/schema-sql/utils.d.ts +14 -0
- package/dist/utils/table-clipboard/copy.d.ts +2 -3
- package/dist/utils/table-clipboard/index.d.ts +9 -1
- package/dist/utils/table-clipboard/paste.d.ts +2 -2
- package/dist/utils/table-clipboard/payload.d.ts +12 -0
- package/dist/utils/validation.d.ts +1 -0
- package/dist/workers/exportPng.shared-worker.js +30 -29
- package/package.json +7 -5
- package/dist/konva/batchDraw.d.ts +0 -42
- package/dist/konva/host.d.ts +0 -30
- package/dist/konva/jsx-types.test-d.d.ts +0 -2
- package/dist/loadValue-BKvXDYoC.js +0 -12925
- package/dist/shared-store-2IUOt99m.js +0 -1341
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RootState } from '../../../engine/state';
|
|
2
|
+
import { I18n, PlainMessageKey } from '../../../i18n/translate';
|
|
3
|
+
import { Column } from '../../../internal-types';
|
|
4
|
+
type ViewSettings = Pick<RootState['settings'], 'nameViewMode'>;
|
|
5
|
+
type Names = {
|
|
6
|
+
name: string;
|
|
7
|
+
logicalName: string;
|
|
8
|
+
};
|
|
9
|
+
/** What a cell drawn in the DOM shows, the placeholder dimmed while the value is blank. */
|
|
10
|
+
export type CellText = {
|
|
11
|
+
value: string;
|
|
12
|
+
placeholder: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* What a logical name cell drawn in the DOM shows, as the canvas draws it: the
|
|
16
|
+
* logical name, or while it is blank the name in the logical view, that name's
|
|
17
|
+
* own placeholder while it is blank too, and in the view of both the logical name's.
|
|
18
|
+
*/
|
|
19
|
+
export declare function logicalNameCellText(settings: ViewSettings, { name, logicalName }: Names, nameKey: PlainMessageKey, { t }: Pick<I18n, 't'>): CellText;
|
|
20
|
+
/** What the name cell of a row drawn in the DOM shows: the logical view puts the logical name there. */
|
|
21
|
+
export declare function nameCellText(settings: ViewSettings, column: Names, i18n: Pick<I18n, 't'>): CellText;
|
|
22
|
+
/**
|
|
23
|
+
* What the type cell of a row drawn in the DOM shows: the name of the listed
|
|
24
|
+
* domain it stands for in the logical view, else the type.
|
|
25
|
+
*/
|
|
26
|
+
export declare const typeCellText: (state: RootState, column: Pick<Column, "dataType" | "domainId">) => string;
|
|
27
|
+
/**
|
|
28
|
+
* What the domain cell of a row drawn in the DOM holds: the listed domain's
|
|
29
|
+
* name, or nothing, over which the row dims the domain placeholder.
|
|
30
|
+
*/
|
|
31
|
+
export declare const domainCellText: (state: RootState, column: Pick<Column, "domainId">) => string;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=columnViewText.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type HintListProps = {
|
|
2
|
+
onBlur?: (event: FocusEvent) => void;
|
|
3
|
+
};
|
|
4
|
+
/** The rows a list under a cell editor offers, and the one the keyboard is on, -1 for none. */
|
|
5
|
+
export type HintListState = {
|
|
6
|
+
rows: ReadonlyArray<unknown>;
|
|
7
|
+
index: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The focus, pointer and scroll handling a cell editor with a list under its
|
|
11
|
+
* input shares with the data type cell: a press on the list keeps the caret,
|
|
12
|
+
* the wheel it scrolls by stays off the canvas, and the keyboard row stays in view.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useHintList(props: HintListProps, state: HintListState): {
|
|
15
|
+
root: import('@dineug/r-html').Ref<HTMLDivElement>;
|
|
16
|
+
hintList: import('@dineug/r-html').Ref<HTMLDivElement>;
|
|
17
|
+
handleFocus: () => void;
|
|
18
|
+
handleFocusout: (event: FocusEvent) => void;
|
|
19
|
+
handleHintMousedown: (event: MouseEvent) => void;
|
|
20
|
+
handleHintTouchstart: (event: TouchEvent) => void;
|
|
21
|
+
handleHintWheel: (event: WheelEvent) => void;
|
|
22
|
+
step: (delta: 1 | -1) => void;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=useHintList.d.ts.map
|
|
@@ -15,6 +15,8 @@ export type VisualizationNode = {
|
|
|
15
15
|
id: string;
|
|
16
16
|
group: Group;
|
|
17
17
|
name: string;
|
|
18
|
+
/** The logical name, which a table's label draws in the name views that show one. */
|
|
19
|
+
logicalName: string;
|
|
18
20
|
/** The table a column hangs off; a table node has none. */
|
|
19
21
|
tableId: string | null;
|
|
20
22
|
x: number;
|
|
@@ -14,8 +14,9 @@ export declare function fitFlowView(store: RxStore): void;
|
|
|
14
14
|
* @example
|
|
15
15
|
* onMounted(() => ensureFlowPlaced(app.value));
|
|
16
16
|
*/
|
|
17
|
-
export declare function ensureFlowPlaced(app: AppContext, { force }?: {
|
|
17
|
+
export declare function ensureFlowPlaced(app: AppContext, { force, fit }?: {
|
|
18
18
|
force?: boolean;
|
|
19
|
+
fit?: boolean;
|
|
19
20
|
}): Promise<void>;
|
|
20
21
|
/**
|
|
21
22
|
* Keeps the Flow view placed for as long as the tab draws it: placed again
|
|
@@ -6,6 +6,10 @@ export type ColumnProps = {
|
|
|
6
6
|
widthDataType: number;
|
|
7
7
|
widthDefault: number;
|
|
8
8
|
widthComment: number;
|
|
9
|
+
/** The logical name's own cell, which the view of both names alone lays out. */
|
|
10
|
+
widthLogicalName?: number;
|
|
11
|
+
/** The domain's own cell, laid out while its show bit is set. */
|
|
12
|
+
widthDomain?: number;
|
|
9
13
|
/** The room the table keeps for alternate key marks, 0 while it draws none. */
|
|
10
14
|
widthAlternateKey?: number;
|
|
11
15
|
/** The mark this row carries in that room, last, as the ERD scene draws it. */
|
|
@@ -2,8 +2,8 @@ import { FC } from '@dineug/r-html';
|
|
|
2
2
|
export type VisualizationToolbarProps = {};
|
|
3
3
|
/**
|
|
4
4
|
* The bar over the bottom of the Visualization tab: which of the two modes is
|
|
5
|
-
* up, the
|
|
6
|
-
* the way back to the whole document, and which way the content lies and how far once the screen holds none.
|
|
5
|
+
* up, the steps through the centers the Flow stood on, the zoom, its placement
|
|
6
|
+
* tools, how much of a card it draws, the way back to the whole document, and which way the content lies and how far once the screen holds none.
|
|
7
7
|
*/
|
|
8
8
|
declare const VisualizationToolbar: FC<VisualizationToolbarProps>;
|
|
9
9
|
export default VisualizationToolbar;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ContentCompass } from '../erd/content-compass/compassGeometry';
|
|
2
2
|
import { Viewport } from '../../engine/modules/editor/state';
|
|
3
|
+
import { RootState } from '../../engine/state';
|
|
3
4
|
import { Point } from '../../internal-types';
|
|
4
5
|
import { Group, VisualizationLink, VisualizationNode } from './createVisualization';
|
|
5
6
|
export { DIM_OPACITY } from '../../konva/scene/viewLayout';
|
|
@@ -13,10 +14,20 @@ export declare const NAME_MAX_LENGTH = 15;
|
|
|
13
14
|
* truncateName('a_very_long_table_name'); // 'a_very_long_tab…'
|
|
14
15
|
*/
|
|
15
16
|
export declare function truncateName(name: string): string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
|
|
17
|
+
type LabelNode = Pick<VisualizationNode, 'name' | 'logicalName'>;
|
|
18
|
+
type ViewSettings = Pick<RootState['settings'], 'nameViewMode'>;
|
|
19
|
+
/**
|
|
20
|
+
* The text a table's label draws in the name view: the name it shows cut to
|
|
21
|
+
* length, the name after the logical name on a second line in the view of
|
|
22
|
+
* both, or the placeholder its input shows while it shows no name.
|
|
23
|
+
*/
|
|
24
|
+
export declare function labelOf(node: LabelNode, placeholder: string, settings: ViewSettings): string;
|
|
25
|
+
/**
|
|
26
|
+
* Whether a table's label draws a name of its own, which paints it in the
|
|
27
|
+
* foreground: not the placeholder, nor the name standing in for a blank
|
|
28
|
+
* logical name in the logical view.
|
|
29
|
+
*/
|
|
30
|
+
export declare function hasName(node: LabelNode, settings: ViewSettings): boolean;
|
|
20
31
|
export declare const TABLE_RADIUS = 8;
|
|
21
32
|
export declare const COLUMN_RADIUS = 4;
|
|
22
33
|
/** A table draws larger than the columns that hang off it. */
|
|
@@ -47,6 +47,17 @@ export declare const TABLE_COLOR_WIDTH = 4;
|
|
|
47
47
|
export declare const TABLE_HEADER_BUTTONS_WIDTH: number;
|
|
48
48
|
export declare const COLUMN_DELETE_WIDTH = 12;
|
|
49
49
|
export declare const COLUMN_KEY_WIDTH = 12;
|
|
50
|
+
/** The button a column drag starts from, beside the focused row and outside the table. */
|
|
51
|
+
export declare const COLUMN_DRAG_HANDLE_WIDTH = 16;
|
|
52
|
+
export declare const COLUMN_DRAG_HANDLE_HEIGHT = 20;
|
|
53
|
+
export declare const COLUMN_DRAG_HANDLE_ICON_SIZE = 12;
|
|
54
|
+
/** The room between that button and the table's left edge. */
|
|
55
|
+
export declare const COLUMN_DRAG_HANDLE_GAP = 4;
|
|
56
|
+
/**
|
|
57
|
+
* The strip left of a table the handle answers a press in and a column drop is
|
|
58
|
+
* judged in, so a drag that runs straight down along the handle still reorders.
|
|
59
|
+
*/
|
|
60
|
+
export declare const COLUMN_DRAG_HANDLE_LANE = 24;
|
|
50
61
|
/** The table icon before the name, at the key badge's size so the two stand in one column. */
|
|
51
62
|
export declare const TABLE_HEADER_ICON_SIZE = 12;
|
|
52
63
|
/** The gap after that icon, the one a key badge keeps, which lines the name up with the column names. */
|
|
@@ -5,6 +5,7 @@ export declare const CanvasType: {
|
|
|
5
5
|
readonly schemaSQL: "@dineug/erd-editor/builtin-schema-sql";
|
|
6
6
|
readonly generatorCode: "@dineug/erd-editor/builtin-generator-code";
|
|
7
7
|
readonly settings: "settings";
|
|
8
|
+
readonly dictionary: "@dineug/erd-editor/builtin-dictionary";
|
|
8
9
|
};
|
|
9
10
|
export declare const CanvasTypeList: readonly string[];
|
|
10
11
|
export declare const Show: {
|
|
@@ -21,6 +22,7 @@ export declare const Show: {
|
|
|
21
22
|
readonly hideReferentialAction: 1024;
|
|
22
23
|
readonly hideTableGroup: 2048;
|
|
23
24
|
readonly hideMemo: 4096;
|
|
25
|
+
readonly columnDomain: 8192;
|
|
24
26
|
};
|
|
25
27
|
export declare const ColumnType: {
|
|
26
28
|
readonly columnName: 1;
|
|
@@ -30,6 +32,8 @@ export declare const ColumnType: {
|
|
|
30
32
|
readonly columnAutoIncrement: 16;
|
|
31
33
|
readonly columnDefault: 32;
|
|
32
34
|
readonly columnComment: 64;
|
|
35
|
+
readonly columnLogicalName: 128;
|
|
36
|
+
readonly columnDomain: 256;
|
|
33
37
|
};
|
|
34
38
|
export declare const ColumnTypeList: readonly number[];
|
|
35
39
|
export declare const Database: {
|
|
@@ -115,6 +119,7 @@ export declare const ColumnOption: {
|
|
|
115
119
|
readonly primaryKey: 2;
|
|
116
120
|
readonly unique: 4;
|
|
117
121
|
readonly notNull: 8;
|
|
122
|
+
readonly nameDerived: 16;
|
|
118
123
|
};
|
|
119
124
|
export declare const ColumnUIKey: {
|
|
120
125
|
readonly primaryKey: 1;
|
|
@@ -132,9 +137,17 @@ export declare const LockSettingType: {
|
|
|
132
137
|
readonly tableNameCase: 8;
|
|
133
138
|
readonly columnNameCase: 16;
|
|
134
139
|
readonly bracketType: 32;
|
|
140
|
+
readonly unlockNameViewMode: 64;
|
|
135
141
|
};
|
|
136
|
-
export declare const LockSettingTypeList: readonly
|
|
137
|
-
export declare const LockSettingFields: Readonly<Record<number, readonly ("
|
|
142
|
+
export declare const LockSettingTypeList: readonly import('@dineug/erd-editor-schema').LockSettingType[];
|
|
143
|
+
export declare const LockSettingFields: Readonly<Record<number, readonly ("canvasType" | "language" | "tableNameCase" | "columnNameCase" | "bracketType" | "zoomLevel" | "originX" | "originY" | "nameViewMode")[]>>;
|
|
144
|
+
export declare const InvertedLockSettings: number;
|
|
145
|
+
export declare const NameViewMode: {
|
|
146
|
+
readonly physical: "physical";
|
|
147
|
+
readonly logical: "logical";
|
|
148
|
+
readonly both: "both";
|
|
149
|
+
};
|
|
150
|
+
export declare const NameViewModeList: ReadonlyArray<ValuesType<typeof NameViewMode>>;
|
|
138
151
|
export declare const CANVAS_SIZE_MAX: 20000;
|
|
139
152
|
export declare const CANVAS_SIZE_MIN: 2000;
|
|
140
153
|
export declare const CANVAS_ZOOM_MAX: 1.5;
|
package/dist/engine/actions.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ActionMap as DictionaryActionMap } from './modules/dictionary/actions';
|
|
2
|
+
import { actions as dictionaryActions } from './modules/dictionary/atom.actions';
|
|
3
|
+
import { actions$ as dictionaryActions$ } from './modules/dictionary/generator.actions';
|
|
1
4
|
import { ActionMap as EditorActionMap } from './modules/editor/actions';
|
|
2
5
|
import { actions as editorActions } from './modules/editor/atom.actions';
|
|
3
6
|
import { actions$ as editorActions$ } from './modules/editor/generator.actions';
|
|
@@ -25,8 +28,8 @@ import { actions$ as tableColumnActions$ } from './modules/table-column/generato
|
|
|
25
28
|
import { ActionMap as TableGroupActionMap } from './modules/table-group/actions';
|
|
26
29
|
import { actions as tableGroupActions } from './modules/table-group/atom.actions';
|
|
27
30
|
import { actions$ as tableGroupActions$ } from './modules/table-group/generator.actions';
|
|
28
|
-
export type Actions = typeof editorActions & typeof editorActions$ & typeof indexActions & typeof indexActions$ & typeof indexColumnActions & typeof indexColumnActions$ & typeof memoActions & typeof memoActions$ & typeof relationshipActions & typeof relationshipActions$ & typeof settingsActions & typeof settingsActions$ & typeof tableActions & typeof tableActions$ & typeof tableColumnActions & typeof tableColumnActions$ & typeof tableGroupActions & typeof tableGroupActions$;
|
|
29
|
-
export type RootActionMap = EditorActionMap & TableActionMap & TableColumnActionMap & MemoActionMap & RelationshipActionMap & SettingsActionMap & IndexActionMap & IndexColumnActionMap & TableGroupActionMap;
|
|
31
|
+
export type Actions = typeof editorActions & typeof editorActions$ & typeof indexActions & typeof indexActions$ & typeof indexColumnActions & typeof indexColumnActions$ & typeof memoActions & typeof memoActions$ & typeof relationshipActions & typeof relationshipActions$ & typeof settingsActions & typeof settingsActions$ & typeof tableActions & typeof tableActions$ & typeof tableColumnActions & typeof tableColumnActions$ & typeof tableGroupActions & typeof tableGroupActions$ & typeof dictionaryActions & typeof dictionaryActions$;
|
|
32
|
+
export type RootActionMap = EditorActionMap & TableActionMap & TableColumnActionMap & MemoActionMap & RelationshipActionMap & SettingsActionMap & IndexActionMap & IndexColumnActionMap & TableGroupActionMap & DictionaryActionMap;
|
|
30
33
|
export type ActionType = keyof RootActionMap;
|
|
31
34
|
export declare const actions: Actions;
|
|
32
35
|
export declare const ChangeActionTypes: ReadonlyArray<ActionType>;
|
|
@@ -7,4 +7,12 @@ export type PushStreamHistory = (undoActions: AnyAction[], redoActions: AnyActio
|
|
|
7
7
|
export declare const pushUndoHistoryMap: Record<string, PushUndoHistory>;
|
|
8
8
|
export declare const pushStreamHistoryMap: Record<string, PushStreamHistory>;
|
|
9
9
|
export declare const pushHistory: (store: Store, history: History) => (actions: AnyAction[]) => void;
|
|
10
|
+
/** Whether an action writes a dictionary row, the actions a sheet's history holds. */
|
|
11
|
+
export declare const isDictionaryAction: ({ type }: AnyAction) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Pushes a Dictionary tab batch onto its sheet's history: its row actions and
|
|
14
|
+
* the links it took off columns, the column writes a domain's type spread to
|
|
15
|
+
* worked out again at each replay, which keeps the links it takes off in turn.
|
|
16
|
+
*/
|
|
17
|
+
export declare const pushSheetHistory: (store: Store, history: History) => (actions: AnyAction[]) => void;
|
|
10
18
|
//# sourceMappingURL=history.actions.d.ts.map
|
package/dist/engine/history.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { AnyAction } from '@dineug/r-html';
|
|
2
|
+
import { RootState } from './state';
|
|
2
3
|
type Dispatch = (actions: AnyAction[]) => void;
|
|
3
4
|
type GetNextVersion = () => number;
|
|
5
|
+
type GetState = () => RootState;
|
|
6
|
+
export type Replay = (dispatch: Dispatch, getNextVersion: GetNextVersion, getState?: GetState) => void;
|
|
4
7
|
export type Command = {
|
|
5
|
-
undo:
|
|
6
|
-
redo:
|
|
8
|
+
undo: Replay;
|
|
9
|
+
redo: Replay;
|
|
7
10
|
};
|
|
8
11
|
export type CommandKey = keyof Command;
|
|
9
12
|
export type History = {
|
|
@@ -26,12 +29,17 @@ export type HistoryOptions = {
|
|
|
26
29
|
notify: (has: HasHistory) => void;
|
|
27
30
|
dispatch: Dispatch;
|
|
28
31
|
getNextVersion: GetNextVersion;
|
|
32
|
+
/**
|
|
33
|
+
* The state of the store a replay dispatches into, which a command reads, so
|
|
34
|
+
* a clone replaying into another store reads that store's.
|
|
35
|
+
*/
|
|
36
|
+
getState?: GetState;
|
|
29
37
|
};
|
|
30
38
|
type HistoryState = {
|
|
31
39
|
commands: Command[];
|
|
32
40
|
cursor: number;
|
|
33
41
|
limit: number;
|
|
34
42
|
};
|
|
35
|
-
export declare function createHistory({ notify, dispatch, getNextVersion }: HistoryOptions, initialState?: HistoryState): History;
|
|
43
|
+
export declare function createHistory({ notify, dispatch, getNextVersion, getState }: HistoryOptions, initialState?: HistoryState): History;
|
|
36
44
|
export {};
|
|
37
45
|
//# sourceMappingURL=history.d.ts.map
|
package/dist/engine/index.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { $ as e,
|
|
1
|
+
import { $ as e, In as t, c as n, fr as r, jc as i, kc as a, n as o, r as s, t as c, tc as l, u, v as d, y as f } from "../loadValue-B5ojYrZ-.js";
|
|
2
2
|
import { Observable as p, Subject as m, debounceTime as h, map as g } from "rxjs";
|
|
3
3
|
import { omit as _ } from "es-toolkit";
|
|
4
4
|
//#region src/engine/replication-store.ts
|
|
5
|
-
var v =
|
|
6
|
-
function b(
|
|
5
|
+
var v = l(f), y = { change: "change" };
|
|
6
|
+
function b(l) {
|
|
7
7
|
let b = /* @__PURE__ */ new Set(), x = u({
|
|
8
|
-
...
|
|
8
|
+
...l,
|
|
9
9
|
routes: !1
|
|
10
|
-
}), { clock: S } = x, C =
|
|
11
|
-
C.dispatchSync(
|
|
10
|
+
}), { clock: S } = x, C = s(x, !1);
|
|
11
|
+
C.dispatchSync(r({
|
|
12
12
|
width: 0,
|
|
13
13
|
height: 0
|
|
14
14
|
}));
|
|
15
|
-
let w =
|
|
15
|
+
let w = o(C), T = new m(), E = new p((e) => C.subscribe((t) => e.next(t))).pipe(n(f), h(200)), D = /* @__PURE__ */ new Set(), O = null, k = (e) => (D.has(e) || D.add(e), () => {
|
|
16
16
|
D.delete(e);
|
|
17
|
-
}), A = (e,
|
|
18
|
-
D.forEach((
|
|
19
|
-
let
|
|
20
|
-
|
|
17
|
+
}), A = (e, n) => {
|
|
18
|
+
D.forEach((r) => {
|
|
19
|
+
let i = Reflect.get(r, e);
|
|
20
|
+
t(i, n);
|
|
21
21
|
});
|
|
22
22
|
}, j = (t) => {
|
|
23
|
-
O = null, C.dispatchSync(e(
|
|
23
|
+
O = null, C.dispatchSync(e(c(t)));
|
|
24
24
|
}, M = (e) => {
|
|
25
25
|
T.next([e].flat());
|
|
26
26
|
};
|
|
27
27
|
return b.add(E.subscribe(() => {
|
|
28
|
-
let e =
|
|
28
|
+
let e = a(C.state), t = O !== null && e !== O;
|
|
29
29
|
O !== null && (O = e), A(y.change, {
|
|
30
30
|
value: e,
|
|
31
31
|
changed: t
|
|
32
32
|
});
|
|
33
|
-
})).add(T.pipe(
|
|
34
|
-
e.some(({ type: e }) => v(e)) && (O ??=
|
|
33
|
+
})).add(T.pipe(n(d), g((e) => e.map((e) => _(e, ["tags"])))).subscribe((e) => {
|
|
34
|
+
e.some(({ type: e }) => v(e)) && (O ??= a(C.state));
|
|
35
35
|
let t = S.getNextVersion();
|
|
36
36
|
e.forEach((e) => e.version ??= t), C.dispatchSync(e), e.forEach((e) => S.merge(e.version));
|
|
37
37
|
})), Object.freeze({
|
|
38
38
|
get value() {
|
|
39
|
-
return
|
|
39
|
+
return a(C.state);
|
|
40
40
|
},
|
|
41
41
|
get runtimeValue() {
|
|
42
|
-
return
|
|
42
|
+
return i(C.state);
|
|
43
43
|
},
|
|
44
44
|
on: k,
|
|
45
45
|
setInitialValue: j,
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Reducer } from '@dineug/r-html';
|
|
2
|
+
import { EngineContext } from '../../context';
|
|
3
|
+
import { RootState } from '../../state';
|
|
4
|
+
import { Domain, Term, ValuesType, Word } from '../../../internal-types';
|
|
5
|
+
export declare const ActionType: {
|
|
6
|
+
readonly addDictionary: "dictionary.add";
|
|
7
|
+
readonly updateDictionary: "dictionary.update";
|
|
8
|
+
readonly removeDictionary: "dictionary.remove";
|
|
9
|
+
};
|
|
10
|
+
export type ActionType = ValuesType<typeof ActionType>;
|
|
11
|
+
/** The three dictionaries a document holds, each a sheet of rows. */
|
|
12
|
+
export declare const DictionaryKind: {
|
|
13
|
+
readonly word: "word";
|
|
14
|
+
readonly term: "term";
|
|
15
|
+
readonly domain: "domain";
|
|
16
|
+
};
|
|
17
|
+
export type DictionaryKind = ValuesType<typeof DictionaryKind>;
|
|
18
|
+
export declare const DictionaryKindList: ReadonlyArray<DictionaryKind>;
|
|
19
|
+
/** What a row of each dictionary holds besides its id and its place in its sheet. */
|
|
20
|
+
export type DictionaryValues = {
|
|
21
|
+
[DictionaryKind.word]: Omit<Word, 'id' | 'order'>;
|
|
22
|
+
[DictionaryKind.term]: Omit<Term, 'id' | 'order'>;
|
|
23
|
+
[DictionaryKind.domain]: Omit<Domain, 'id' | 'order'>;
|
|
24
|
+
};
|
|
25
|
+
/** What an action writes into a row: its values and its order key, which places it in its sheet. */
|
|
26
|
+
export type DictionaryStoredValues = {
|
|
27
|
+
[K in DictionaryKind]: DictionaryValues[K] & {
|
|
28
|
+
order: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The fields of each dictionary's rows, in the order a reducer writes them.
|
|
33
|
+
* Every field is a string, and each is a register of its own.
|
|
34
|
+
*/
|
|
35
|
+
export declare const DictionaryFields: {
|
|
36
|
+
readonly word: readonly ["name", "abbreviation", "englishName", "description", "synonyms", "forbiddenWords"];
|
|
37
|
+
readonly term: readonly ["name", "physicalName", "domainId", "description", "synonyms"];
|
|
38
|
+
readonly domain: readonly ["name", "category", "dataType", "description"];
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* The fields a reducer writes, a register each: the values and the order key,
|
|
42
|
+
* which no sheet column, file column or tool shows.
|
|
43
|
+
*/
|
|
44
|
+
export declare const DictionaryStoredFields: {
|
|
45
|
+
readonly word: readonly ["name", "abbreviation", "englishName", "description", "synonyms", "forbiddenWords", "order"];
|
|
46
|
+
readonly term: readonly ["name", "physicalName", "domainId", "description", "synonyms", "order"];
|
|
47
|
+
readonly domain: readonly ["name", "category", "dataType", "description", "order"];
|
|
48
|
+
};
|
|
49
|
+
/** One row of one dictionary, and the values an action writes into it. */
|
|
50
|
+
export type DictionaryRowPayload = {
|
|
51
|
+
[K in DictionaryKind]: {
|
|
52
|
+
kind: K;
|
|
53
|
+
id: string;
|
|
54
|
+
values: Partial<DictionaryStoredValues[K]>;
|
|
55
|
+
};
|
|
56
|
+
}[DictionaryKind];
|
|
57
|
+
/** A row to list, with the values it starts with, none for a row brought back. */
|
|
58
|
+
export type DictionaryAddPayload = {
|
|
59
|
+
[K in DictionaryKind]: {
|
|
60
|
+
kind: K;
|
|
61
|
+
id: string;
|
|
62
|
+
values?: Partial<DictionaryStoredValues[K]>;
|
|
63
|
+
};
|
|
64
|
+
}[DictionaryKind];
|
|
65
|
+
export type ActionMap = {
|
|
66
|
+
[ActionType.addDictionary]: DictionaryAddPayload;
|
|
67
|
+
[ActionType.updateDictionary]: DictionaryRowPayload;
|
|
68
|
+
[ActionType.removeDictionary]: {
|
|
69
|
+
kind: DictionaryKind;
|
|
70
|
+
id: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export type ReducerType<T extends keyof ActionMap> = Reducer<RootState, T, ActionMap, EngineContext>;
|
|
74
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { EngineContext } from '../../context';
|
|
2
|
+
import { RootState } from '../../state';
|
|
3
|
+
import { Domain, Term, Word } from '../../../internal-types';
|
|
4
|
+
import { DictionaryKind, ReducerType } from './actions';
|
|
5
|
+
/** A kind this release knows; a later release's kind changes nothing here. */
|
|
6
|
+
export declare const hasDictionaryKind: (kind: unknown) => kind is DictionaryKind;
|
|
7
|
+
/** The row of a dictionary the id names, a removed one too. */
|
|
8
|
+
export declare const selectDictionaryRow: (state: RootState, kind: DictionaryKind, id: string) => Word | Term | Domain | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* The ids of a dictionary's listed rows, in the order they were listed, which
|
|
11
|
+
* membership reads; a sheet shows them in key order (orderedDictionaryRows).
|
|
12
|
+
*/
|
|
13
|
+
export declare const dictionaryIds: (state: RootState, kind: DictionaryKind) => string[];
|
|
14
|
+
/**
|
|
15
|
+
* The string values a payload names among the kind's fields, in their order,
|
|
16
|
+
* so a field or a value no editor sends is passed over.
|
|
17
|
+
*/
|
|
18
|
+
export declare function dictionaryEntries(kind: DictionaryKind, values: unknown): Array<[field: string, value: string]>;
|
|
19
|
+
/**
|
|
20
|
+
* Measures the domain cell of every column linking the domain, a removed
|
|
21
|
+
* column's too, so each width reads the domain as it now stands whatever
|
|
22
|
+
* order a peer heard the domain's and the column's changes in.
|
|
23
|
+
*/
|
|
24
|
+
export declare function measureDomainColumns(state: RootState, domainId: string, { toWidth }: EngineContext): void;
|
|
25
|
+
export declare const addDictionaryAction: {
|
|
26
|
+
(payload: import('./actions').DictionaryAddPayload): import('@dineug/r-html').AnyAction<import('./actions').DictionaryAddPayload>;
|
|
27
|
+
toString(): string;
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
export declare const updateDictionaryAction: {
|
|
31
|
+
(payload: import('./actions').DictionaryRowPayload): import('@dineug/r-html').AnyAction<import('./actions').DictionaryRowPayload>;
|
|
32
|
+
toString(): string;
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const removeDictionaryAction: {
|
|
36
|
+
(payload: {
|
|
37
|
+
kind: DictionaryKind;
|
|
38
|
+
id: string;
|
|
39
|
+
}): import('@dineug/r-html').AnyAction<{
|
|
40
|
+
kind: DictionaryKind;
|
|
41
|
+
id: string;
|
|
42
|
+
}>;
|
|
43
|
+
toString(): string;
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
export declare const dictionaryReducers: {
|
|
47
|
+
"dictionary.add": ReducerType<"dictionary.add">;
|
|
48
|
+
"dictionary.update": ReducerType<"dictionary.update">;
|
|
49
|
+
"dictionary.remove": ReducerType<"dictionary.remove">;
|
|
50
|
+
};
|
|
51
|
+
export declare const actions: {
|
|
52
|
+
addDictionaryAction: {
|
|
53
|
+
(payload: import('./actions').DictionaryAddPayload): import('@dineug/r-html').AnyAction<import('./actions').DictionaryAddPayload>;
|
|
54
|
+
toString(): string;
|
|
55
|
+
type: string;
|
|
56
|
+
};
|
|
57
|
+
updateDictionaryAction: {
|
|
58
|
+
(payload: import('./actions').DictionaryRowPayload): import('@dineug/r-html').AnyAction<import('./actions').DictionaryRowPayload>;
|
|
59
|
+
toString(): string;
|
|
60
|
+
type: string;
|
|
61
|
+
};
|
|
62
|
+
removeDictionaryAction: {
|
|
63
|
+
(payload: {
|
|
64
|
+
kind: DictionaryKind;
|
|
65
|
+
id: string;
|
|
66
|
+
}): import('@dineug/r-html').AnyAction<{
|
|
67
|
+
kind: DictionaryKind;
|
|
68
|
+
id: string;
|
|
69
|
+
}>;
|
|
70
|
+
toString(): string;
|
|
71
|
+
type: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=atom.actions.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { RootState } from '../../state';
|
|
2
|
+
import { Column, Table, ValuesType } from '../../../internal-types';
|
|
3
|
+
import { DictionaryKind } from './actions';
|
|
4
|
+
import { DictionaryRowOf } from './dictionaryIndex';
|
|
5
|
+
/** The seven checks the dictionaries run over the tables, columns and rows. */
|
|
6
|
+
export declare const DictionaryCheckCode: {
|
|
7
|
+
readonly duplicateName: "duplicateName";
|
|
8
|
+
readonly unknownDomain: "unknownDomain";
|
|
9
|
+
readonly unregisteredWord: "unregisteredWord";
|
|
10
|
+
readonly forbiddenWord: "forbiddenWord";
|
|
11
|
+
readonly synonymWord: "synonymWord";
|
|
12
|
+
readonly physicalNameMismatch: "physicalNameMismatch";
|
|
13
|
+
readonly domainTypeMismatch: "domainTypeMismatch";
|
|
14
|
+
};
|
|
15
|
+
export type DictionaryCheckCode = ValuesType<typeof DictionaryCheckCode>;
|
|
16
|
+
export declare const DictionaryCheckCodeList: ReadonlyArray<DictionaryCheckCode>;
|
|
17
|
+
/** How loud a check shows: an error or a warning. */
|
|
18
|
+
export declare const DictionaryCheckLevel: {
|
|
19
|
+
readonly error: "error";
|
|
20
|
+
readonly warning: "warning";
|
|
21
|
+
};
|
|
22
|
+
export type DictionaryCheckLevel = ValuesType<typeof DictionaryCheckLevel>;
|
|
23
|
+
/**
|
|
24
|
+
* A name two rows share, a link to no listed domain and a forbidden word are
|
|
25
|
+
* errors; an unregistered word, a synonym, a physical name the term would not
|
|
26
|
+
* give and a type other than the linked domain's are warnings.
|
|
27
|
+
*/
|
|
28
|
+
export declare const DictionaryCheckLevelOf: Readonly<Record<DictionaryCheckCode, DictionaryCheckLevel>>;
|
|
29
|
+
/** What a check is about: a table, a column or a dictionary row. */
|
|
30
|
+
export type DictionaryCheckTargetKind = 'table' | 'column' | DictionaryKind;
|
|
31
|
+
/** The cell a check marks, by the field it reads. */
|
|
32
|
+
export type DictionaryCheckField = 'name' | 'logicalName' | 'domainId';
|
|
33
|
+
/**
|
|
34
|
+
* One finding, read only since the walks hand the same one out again. The
|
|
35
|
+
* target's table id is '' for a dictionary row; suggestions are the standard
|
|
36
|
+
* words, the physical name or the type the dictionaries offer instead of the text.
|
|
37
|
+
*/
|
|
38
|
+
export type DictionaryCheck = Readonly<{
|
|
39
|
+
code: DictionaryCheckCode;
|
|
40
|
+
target: Readonly<{
|
|
41
|
+
kind: DictionaryCheckTargetKind;
|
|
42
|
+
id: string;
|
|
43
|
+
tableId: string;
|
|
44
|
+
}>;
|
|
45
|
+
field: DictionaryCheckField;
|
|
46
|
+
text: string;
|
|
47
|
+
suggestions: ReadonlyArray<string>;
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* The checks of a table, or of one of its cells when a field is given: the
|
|
51
|
+
* words of its logical name and the physical name its term gives. Each reads
|
|
52
|
+
* an index, so marking a cell walks no sheet.
|
|
53
|
+
*/
|
|
54
|
+
export declare const checkTable: (state: RootState, table: Table, field?: DictionaryCheckField) => DictionaryCheck[];
|
|
55
|
+
/** The checks of a column, or of one of its cells: a table's two, its domain link and its type against that domain's. */
|
|
56
|
+
export declare const checkColumn: (state: RootState, column: Column, field?: DictionaryCheckField) => DictionaryCheck[];
|
|
57
|
+
/**
|
|
58
|
+
* The checks of a dictionary row, or of one of its cells: a name another row
|
|
59
|
+
* of its sheet holds, and for a term the words of its name and its domain.
|
|
60
|
+
*/
|
|
61
|
+
export declare function checkDictionaryRow<K extends DictionaryKind>(state: RootState, kind: K, row: DictionaryRowOf[K], field?: DictionaryCheckField): DictionaryCheck[];
|
|
62
|
+
/** The loudest level among the checks, null for none: what one cell shows. */
|
|
63
|
+
export declare function markOf(checks: ReadonlyArray<DictionaryCheck>): DictionaryCheckLevel | null;
|
|
64
|
+
/**
|
|
65
|
+
* Every check of the document in the order listDictionaryChecks gives them,
|
|
66
|
+
* a sheet, a term, a table or a column at a time, so a caller can stop
|
|
67
|
+
* between two and go on while the state stays as it was.
|
|
68
|
+
*/
|
|
69
|
+
export declare function walkDictionaryChecks(state: RootState): Generator<ReadonlyArray<DictionaryCheck>, void, undefined>;
|
|
70
|
+
/**
|
|
71
|
+
* Every check of the document, for the sheet that lists them: the words, the
|
|
72
|
+
* terms and the domains in sheet order, then each table and its columns in
|
|
73
|
+
* document order, each target checked again only once a value it read moved.
|
|
74
|
+
*/
|
|
75
|
+
export declare function listDictionaryChecks(state: RootState): DictionaryCheck[];
|
|
76
|
+
//# sourceMappingURL=checks.d.ts.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { RootState } from '../../state';
|
|
2
|
+
import { Term, ValuesType, Word } from '../../../internal-types';
|
|
3
|
+
import { WordIndex } from './dictionaryIndex';
|
|
4
|
+
/** What a stretch of a logical name is to the word sheet. */
|
|
5
|
+
export declare const WordTokenKind: {
|
|
6
|
+
readonly word: "word";
|
|
7
|
+
readonly synonym: "synonym";
|
|
8
|
+
readonly forbidden: "forbidden";
|
|
9
|
+
readonly unregistered: "unregistered";
|
|
10
|
+
};
|
|
11
|
+
export type WordTokenKind = ValuesType<typeof WordTokenKind>;
|
|
12
|
+
/**
|
|
13
|
+
* A stretch of a logical name and the words it reads as: those so named for
|
|
14
|
+
* a word, those listing it for a synonym or a forbidden word, none for an
|
|
15
|
+
* unregistered stretch.
|
|
16
|
+
*/
|
|
17
|
+
export type WordToken = {
|
|
18
|
+
text: string;
|
|
19
|
+
kind: WordTokenKind;
|
|
20
|
+
words: ReadonlyArray<Word>;
|
|
21
|
+
};
|
|
22
|
+
/** The units of a logical name, which the separators bound and no word crosses. */
|
|
23
|
+
export declare const splitNameUnits: (logicalName: string) => string[];
|
|
24
|
+
/**
|
|
25
|
+
* Splits a logical name into units at the separators, then reads each unit
|
|
26
|
+
* from the left, taking the longest text the word sheet marks and never going
|
|
27
|
+
* back. What no text matches joins one unregistered stretch until a match.
|
|
28
|
+
*/
|
|
29
|
+
export declare function decompose(index: WordIndex, logicalName: string): WordToken[];
|
|
30
|
+
/**
|
|
31
|
+
* Joins the words' abbreviations with underscores, trimmed, their case as
|
|
32
|
+
* typed and with no bound on the length; the first listed word of a name
|
|
33
|
+
* answers for it. Any other token, or a word with no abbreviation, gives null.
|
|
34
|
+
*/
|
|
35
|
+
export declare function compose(tokens: ReadonlyArray<WordToken>): string | null;
|
|
36
|
+
/** The physical name the word sheet composes for a logical name; null with no word listed. */
|
|
37
|
+
export declare function composeName(state: RootState, logicalName: string): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* What the dictionaries make of a logical name. A term's physical name is ''
|
|
40
|
+
* when the term holds none and the words compose none, so a caller writes no
|
|
41
|
+
* name then; its domain is '' unless the document lists it.
|
|
42
|
+
*/
|
|
43
|
+
export type DerivedPhysical = {
|
|
44
|
+
physicalName: string;
|
|
45
|
+
domainId: string;
|
|
46
|
+
term: Term | null;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* The term of the logical name first, its physical name composed of words
|
|
50
|
+
* when it holds none, else the composition alone, else null. An empty term
|
|
51
|
+
* sheet matches no term, and an empty word sheet composes nothing.
|
|
52
|
+
*/
|
|
53
|
+
export declare function derivePhysical(state: RootState, logicalName: string): DerivedPhysical | null;
|
|
54
|
+
//# sourceMappingURL=derive.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AnyAction } from '@dineug/r-html';
|
|
2
|
+
import { ChangeColumnValuePayload } from '../table-column/actions';
|
|
3
|
+
import { RootState } from '../../state';
|
|
4
|
+
import { Column, Table } from '../../../internal-types';
|
|
5
|
+
/**
|
|
6
|
+
* The names each table's columns hold, as two names compare, by table then
|
|
7
|
+
* column id; a dispatch that names several columns moves it as it goes.
|
|
8
|
+
*/
|
|
9
|
+
export type ColumnNameLedger = Map<string, Map<string, string>>;
|
|
10
|
+
/** A column's name writes, and the link to its term's domain for the caller to settle. */
|
|
11
|
+
export type ColumnNameWrites = {
|
|
12
|
+
actions: AnyAction[];
|
|
13
|
+
link: ChangeColumnValuePayload | null;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* What the dictionaries write into a column for the logical name given. A
|
|
17
|
+
* name another column of the table holds, or one an earlier column of the
|
|
18
|
+
* ledger's dispatch took, derives nothing: the column keeps name, flag and link.
|
|
19
|
+
*/
|
|
20
|
+
export declare function toColumnNameWrites(state: RootState, tableId: string, column: Column, logicalName: string, force?: boolean, ledger?: ColumnNameLedger): ColumnNameWrites;
|
|
21
|
+
/** What the dictionaries write into a table's name for the logical name given. */
|
|
22
|
+
export declare function toTableNameWrites(state: RootState, table: Table, logicalName: string, force?: boolean): AnyAction[];
|
|
23
|
+
//# sourceMappingURL=derivedNames.d.ts.map
|