@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
package/README.md
CHANGED
|
@@ -15,6 +15,8 @@ leaking styles either way. It is the same editor as [erd-editor.io](https://erd-
|
|
|
15
15
|
|
|
16
16
|
- **Design** — tables, columns, memos and table groups, four relationship cardinalities, ON DELETE
|
|
17
17
|
and ON UPDATE, alternate keys, Auto Layout
|
|
18
|
+
- **Naming standards** — logical and physical names, physical names and data types derived from
|
|
19
|
+
word, term and domain dictionaries, which have their own tab with CSV import and export and checks
|
|
18
20
|
- **Import** — SQL DDL, GraphQL SDL, DBML and AML from the menu or [`setSchema*`](#importing-a-schema),
|
|
19
21
|
replacing the diagram or adding to it
|
|
20
22
|
- **Export** — DDL for eight databases, also from `getSchemaSQL()`, code in 22 languages and ORMs,
|
|
@@ -86,7 +88,8 @@ export default {
|
|
|
86
88
|
### Script tag
|
|
87
89
|
|
|
88
90
|
`dist/erd-editor.umd.js` bundles every dependency and worker, registers `<erd-editor>` and puts
|
|
89
|
-
`setExportFileCallback`, `setImportFileCallback
|
|
91
|
+
`setExportFileCallback`, `setImportFileCallback`, `createKeyBindingMap` and `dictionaryRowChords`
|
|
92
|
+
on `window.ErdEditor`.
|
|
90
93
|
Its workers are `data:` URLs, so a strict CSP needs `worker-src data:`. Pin a version beyond a demo.
|
|
91
94
|
|
|
92
95
|
```html
|
|
@@ -124,7 +127,7 @@ An attribute is on when present with no value or `"true"`.
|
|
|
124
127
|
| Method | Description |
|
|
125
128
|
| --- | --- |
|
|
126
129
|
| `setInitialValue(value)` | Load a document with no undo entry; `''` starts a new one. |
|
|
127
|
-
| `getSchemaSQL(vendor?, options?)` | DDL for one of the eight databases, by default the document's. `options`: `statements` (`create`, `ifNotExists`, `recreate`), `header` (`none`, `use`, `createAndUse`). |
|
|
130
|
+
| `getSchemaSQL(vendor?, options?)` | DDL for one of the eight databases, by default the document's. `options`: `statements` (`create`, `ifNotExists`, `recreate`), `header` (`none`, `use`, `createAndUse`), `logicalNameAsComment` (`true` writes a table's or column's logical name where its comment is empty). |
|
|
128
131
|
| `setSchemaSQL(value, options?)`, `setSchemaGraphQL`, `setSchemaDBML`, `setSchemaAML` | Replace the document with parsed DDL, GraphQL SDL, DBML or AML, or append it ([Importing a schema](#importing-a-schema)). |
|
|
129
132
|
| `setSchemaJSON(value, options?)` | Load an `.erd.json` document as `value` does, or append it. |
|
|
130
133
|
| `setDiffValue(value)` | Diff another document over the ERD tab. |
|
|
@@ -152,7 +155,8 @@ An attribute is on when present with no value or `"true"`.
|
|
|
152
155
|
- Save `value`. `runtimeValue` also keeps removed entities and only seeds a
|
|
153
156
|
[collaborator](#collaboration).
|
|
154
157
|
- `change` fires 200 ms after the last change, never under `readonly`, and never for scroll, zoom,
|
|
155
|
-
the open tab or the code settings while the document locks them, which a new
|
|
158
|
+
the open tab, the name view or the code settings while the document locks them, which a new
|
|
159
|
+
document does.
|
|
156
160
|
- A file written by hand or by another release can differ from `value` once loaded, so detect edits
|
|
157
161
|
with a [replica](#headless-replica)'s `changed`, not by comparing bytes.
|
|
158
162
|
|
|
@@ -163,6 +167,9 @@ An attribute is on when present with no value or `"true"`.
|
|
|
163
167
|
- `'grid'`, the default, lands at once in rows. `'auto'` lays the tables out as the Import menu does
|
|
164
168
|
and returns a `Promise` that resolves when they land; a later load supersedes it.
|
|
165
169
|
- `mode: 'append'` adds the tables below the diagram, as Import and Add does.
|
|
170
|
+
- A replace by the four text methods keeps the document's word, term and domain dictionaries, which
|
|
171
|
+
the text cannot hold; a replacing `setSchemaJSON` takes the ones its document holds, as `value`
|
|
172
|
+
does.
|
|
166
173
|
|
|
167
174
|
### Theme and language
|
|
168
175
|
|
|
@@ -194,6 +201,10 @@ names. A chord is modifiers (`Shift`, `Alt`, `Control`, `Meta`, or `$mod` for Cm
|
|
|
194
201
|
elsewhere) joined by `+` with a `KeyboardEvent.code` or `key`; a space separates the chords of a
|
|
195
202
|
sequence, such as `KeyT KeyG`. Several defaults, search and find and replace among them, stop the
|
|
196
203
|
keydown, so to leave `$mod+KeyF` to the page, call `setKeyBindingMap({ findReplace: [] })`.
|
|
204
|
+
`dictionaryRowChords(map)` lists the chords the Dictionary tab's grid inserts and deletes rows by
|
|
205
|
+
under a map: the one-press chords of `addColumn` and `removeColumn`, and those of `addColumn` with
|
|
206
|
+
`Shift` held as well, for Insert above, which no binding names. A host that keeps its own hotkeys
|
|
207
|
+
off the editor's keys takes both lists.
|
|
197
208
|
|
|
198
209
|
## Display language
|
|
199
210
|
|
|
@@ -229,7 +240,9 @@ setImportFileCallback(async ({ type, op, accept, mode }) => {
|
|
|
229
240
|
```
|
|
230
241
|
|
|
231
242
|
Skip a `type` you do not handle: a replacing `setSchemaJSON()` empties the document on any other
|
|
232
|
-
payload. Unset or `null`, the browser's download and file picker work.
|
|
243
|
+
payload. Unset or `null`, the browser's download and file picker work. The Dictionary tab's Import
|
|
244
|
+
CSV always opens the browser's file picker, since no `type` names CSV, and its Export CSV goes
|
|
245
|
+
through the export callback.
|
|
233
246
|
|
|
234
247
|
## Headless replica
|
|
235
248
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from '@dineug/r-html';
|
|
2
|
+
export type DictionaryProps = {
|
|
3
|
+
readonly: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* The Dictionary tab: the sheet switch, the search and the row and file tools
|
|
7
|
+
* over a grid of the sheet shown, and its row count and selection under it.
|
|
8
|
+
* Every edit, paste or clear the grid commits is one dispatch and one undo.
|
|
9
|
+
*/
|
|
10
|
+
declare const Dictionary: FC<DictionaryProps>;
|
|
11
|
+
export default Dictionary;
|
|
12
|
+
//# sourceMappingURL=Dictionary.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** The bar, the sheet under it and the status line at the foot. */
|
|
2
|
+
export declare const root: import('@dineug/r-html').CSSTemplateLiterals;
|
|
3
|
+
/**
|
|
4
|
+
* The sheet switch, the search and the row and file tools, on one line while
|
|
5
|
+
* they fit and on more where they do not, since the tab clips what overflows
|
|
6
|
+
* it and a narrow pane would hide the tools. Each control stands 28px high.
|
|
7
|
+
*/
|
|
8
|
+
export declare const bar: import('@dineug/r-html').CSSTemplateLiterals;
|
|
9
|
+
export declare const segments: import('@dineug/r-html').CSSTemplateLiterals;
|
|
10
|
+
export declare const segment: import('@dineug/r-html').CSSTemplateLiterals;
|
|
11
|
+
/** A sheet's row count beside its name, quieter than the name. */
|
|
12
|
+
export declare const count: import('@dineug/r-html').CSSTemplateLiterals;
|
|
13
|
+
/** The check sheet's count in the colour of the loudest check it holds. */
|
|
14
|
+
export declare const countError: import('@dineug/r-html').CSSTemplateLiterals;
|
|
15
|
+
export declare const countWarning: import('@dineug/r-html').CSSTemplateLiterals;
|
|
16
|
+
/** The search takes what the switch and the tools leave, up to a width that keeps it a field. */
|
|
17
|
+
export declare const searchField: import('@dineug/r-html').CSSTemplateLiterals;
|
|
18
|
+
export declare const searchIcon: import('@dineug/r-html').CSSTemplateLiterals;
|
|
19
|
+
export declare const search: import('@dineug/r-html').CSSTemplateLiterals;
|
|
20
|
+
/** Clears the search, shown while it holds text. */
|
|
21
|
+
export declare const clear: import('@dineug/r-html').CSSTemplateLiterals;
|
|
22
|
+
/** The row and file tools, pushed to the bar's end, a rule between the two groups. */
|
|
23
|
+
export declare const tools: import('@dineug/r-html').CSSTemplateLiterals;
|
|
24
|
+
export declare const tool: import('@dineug/r-html').CSSTemplateLiterals;
|
|
25
|
+
/** Delete, which reads as the one tool that takes rows away once it is under the pointer. */
|
|
26
|
+
export declare const toolDanger: import('@dineug/r-html').CSSTemplateLiterals;
|
|
27
|
+
export declare const divider: import('@dineug/r-html').CSSTemplateLiterals;
|
|
28
|
+
/** The grid fills what the bar and the status line leave. */
|
|
29
|
+
export declare const sheet: import('@dineug/r-html').CSSTemplateLiterals;
|
|
30
|
+
/** What to do on a sheet with no row, over the grid's empty cells and out of the pointer's way. */
|
|
31
|
+
export declare const empty: import('@dineug/r-html').CSSTemplateLiterals;
|
|
32
|
+
export declare const status: import('@dineug/r-html').CSSTemplateLiterals;
|
|
33
|
+
//# sourceMappingURL=Dictionary.styles.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DictionaryCheck, DictionaryCheckLevel } from '../../engine/modules/dictionary/checks';
|
|
2
|
+
/** What an idle period hands its task: how long it may run, and whether it waited past its timeout instead. */
|
|
3
|
+
export type IdleBudget = Pick<IdleDeadline, 'didTimeout' | 'timeRemaining'>;
|
|
4
|
+
/** How long an idle task may wait for the browser to go idle before it runs anyway. */
|
|
5
|
+
export declare const IDLE_TIMEOUT_MS = 1000;
|
|
6
|
+
/** How long a slice runs where the browser names no idle time: one that timed out, or a timer's. */
|
|
7
|
+
export declare const SLICE_MS = 8;
|
|
8
|
+
/** Runs a task once the browser is idle, or on a timer where it names no idle time, and hands back its cancel. */
|
|
9
|
+
export declare function whenIdle(task: (budget: IdleBudget) => void): () => void;
|
|
10
|
+
export type CheckCountOptions = {
|
|
11
|
+
/** The checks of the document a step at a time (walkDictionaryChecks). */
|
|
12
|
+
walk: () => Iterator<ReadonlyArray<DictionaryCheck>>;
|
|
13
|
+
/** Whether a count is still wanted: a slice that finds none drops the walk. */
|
|
14
|
+
wanted: () => boolean;
|
|
15
|
+
/** Takes the number of checks and the loudest of their levels once a walk ends. */
|
|
16
|
+
done: (count: number, mark: DictionaryCheckLevel | null) => void;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Counts the checks on idle, a slice per idle period: each takes steps until
|
|
20
|
+
* its time runs out, one at least, and the next goes on where it stopped, so
|
|
21
|
+
* a slice outlasts its period by one step at most. A restart drops a walk begun.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createCheckCount({ walk, wanted, done }: CheckCountOptions): {
|
|
24
|
+
/** Counts afresh on the next idle period, once however many restarts come before it. */
|
|
25
|
+
restart(): void;
|
|
26
|
+
stop(): void;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=checkCount.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { GridColumn } from '@dineug/grid';
|
|
2
|
+
import { ErdTarget } from '../erd/goToErdTarget';
|
|
3
|
+
import { DictionaryKind } from '../../engine/modules/dictionary/actions';
|
|
4
|
+
import { DictionaryCheck } from '../../engine/modules/dictionary/checks';
|
|
5
|
+
import { RootState } from '../../engine/state';
|
|
6
|
+
import { I18n } from '../../i18n/translate';
|
|
7
|
+
/** The check sheet's columns: what kind of check, what it is about, and what it found. */
|
|
8
|
+
export declare const CheckColumn: {
|
|
9
|
+
readonly type: "type";
|
|
10
|
+
readonly target: "target";
|
|
11
|
+
readonly detail: "detail";
|
|
12
|
+
};
|
|
13
|
+
type Translator = Pick<I18n, 't' | 'locale'>;
|
|
14
|
+
/**
|
|
15
|
+
* The check sheet's three columns, labelled in the reader's language and
|
|
16
|
+
* read-only in every document, since a check is read off the other sheets
|
|
17
|
+
* and the tables, never written.
|
|
18
|
+
*/
|
|
19
|
+
export declare function checkSheetColumns(widths?: Readonly<Record<string, number>>, i18n?: Pick<I18n, 't'>): GridColumn[];
|
|
20
|
+
/** What a cell of the check sheet shows, nothing for a column the sheet lacks. */
|
|
21
|
+
export declare function checkCellText(state: RootState, check: DictionaryCheck, columnId: string, i18n?: Translator): string;
|
|
22
|
+
/** Where a check leads: a dictionary row's cell on its own sheet, or a table's or a column's cell on the ERD tab. */
|
|
23
|
+
export type CheckDestination = {
|
|
24
|
+
kind: 'entry';
|
|
25
|
+
sheet: DictionaryKind;
|
|
26
|
+
id: string;
|
|
27
|
+
columnId: string;
|
|
28
|
+
} | {
|
|
29
|
+
kind: 'erd';
|
|
30
|
+
target: ErdTarget;
|
|
31
|
+
};
|
|
32
|
+
/** The cell a check names: a dictionary row's by its field, a table's or a column's on the canvas, the name view left to the jump. */
|
|
33
|
+
export declare function checkDestination({ target, field, }: DictionaryCheck): CheckDestination;
|
|
34
|
+
/**
|
|
35
|
+
* The checks the sheet lists, in the order the document gives them, those
|
|
36
|
+
* whose three cells hold the search's text while it holds any. It walks the
|
|
37
|
+
* whole document unless handed the checks a caller already listed.
|
|
38
|
+
*/
|
|
39
|
+
export declare function checkRows(state: RootState, search?: string, i18n?: Translator, checks?: ReadonlyArray<DictionaryCheck>): ReadonlyArray<DictionaryCheck>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=checkSheet.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FC } from '@dineug/r-html';
|
|
2
|
+
export type DictionaryContextMenuProps = {
|
|
3
|
+
/** The rows the selection covers, which Insert adds beside it and Delete removes. */
|
|
4
|
+
count: number;
|
|
5
|
+
/** The header of the column right clicked, which the sorts order by; null shows no sort. */
|
|
6
|
+
column: string | null;
|
|
7
|
+
/** The grid shows no row, so only Insert below and the file rows show. */
|
|
8
|
+
empty?: boolean;
|
|
9
|
+
/** The chord that inserts above in the grid, shown beside its row. */
|
|
10
|
+
insertAboveShortcut?: string;
|
|
11
|
+
/** The chord that inserts below in the grid, shown beside its row. */
|
|
12
|
+
insertShortcut?: string;
|
|
13
|
+
/** The chord that deletes in the grid, shown beside its row. */
|
|
14
|
+
deleteShortcut?: string;
|
|
15
|
+
onInsertAbove: () => void;
|
|
16
|
+
onInsertBelow: () => void;
|
|
17
|
+
onDeleteRows: () => void;
|
|
18
|
+
onSortAscending: () => void;
|
|
19
|
+
onSortDescending: () => void;
|
|
20
|
+
onImport: () => void;
|
|
21
|
+
onExport: () => void;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The menu a right click on an entry sheet's grid opens: as many rows as the
|
|
25
|
+
* selection covers inserted above or below it or removed, the sheet sorted by
|
|
26
|
+
* the column, and a CSV file in and out, as the bar's buttons do.
|
|
27
|
+
*/
|
|
28
|
+
declare const DictionaryContextMenu: FC<DictionaryContextMenuProps>;
|
|
29
|
+
export default DictionaryContextMenu;
|
|
30
|
+
//# sourceMappingURL=DictionaryContextMenu.d.ts.map
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { CommitEvent, GridSelection, RejectEvent } from '@dineug/grid';
|
|
2
|
+
import { AppContext } from '../appContext';
|
|
3
|
+
import { DomainOption } from '../table-view/column/column-domain/domainOptions';
|
|
4
|
+
import { DictionaryKind } from '../../engine/modules/dictionary/actions';
|
|
5
|
+
import { RxStore } from '../../engine/rx-store';
|
|
6
|
+
import { RootState } from '../../engine/state';
|
|
7
|
+
import { I18n } from '../../i18n/translate';
|
|
8
|
+
/** One row a commit writes: a listed row by its id, or null for one past the end. */
|
|
9
|
+
export type ResolvedRow = {
|
|
10
|
+
id: string | null;
|
|
11
|
+
/** The text each column of the commit gives, by column id. */
|
|
12
|
+
cells: Readonly<Record<string, string>>;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The rows one grid shows, a list per version the tab hands it. An edit is read
|
|
16
|
+
* by the id of the row it opened on, which a peer's removal above cannot move,
|
|
17
|
+
* a paste or a clear by the rows of the version the grid last received.
|
|
18
|
+
*/
|
|
19
|
+
export type SheetRows = {
|
|
20
|
+
/** The newest version, the one the tab hands the grid next. */
|
|
21
|
+
readonly version: number;
|
|
22
|
+
/** The rows of the newest version. */
|
|
23
|
+
readonly ids: ReadonlyArray<string>;
|
|
24
|
+
/** The rows of the version the grid last received. */
|
|
25
|
+
readonly receivedIds: ReadonlyArray<string>;
|
|
26
|
+
/** The id of the active cell's row, null while that row shows none. */
|
|
27
|
+
readonly activeId: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Takes the rows a batch or a search left under the next version. With no
|
|
30
|
+
* edit open the active id becomes the row the grid's active cell will show;
|
|
31
|
+
* an open edit keeps the row it opened on.
|
|
32
|
+
*/
|
|
33
|
+
bump(ids: ReadonlyArray<string>, editing?: boolean): number;
|
|
34
|
+
/** Notes the version the tab hands the grid as it renders; older rows are let go. */
|
|
35
|
+
receive(version: number): void;
|
|
36
|
+
/** Notes the active cell's row: the one onReady selects, and every one onSelectionChange reports. */
|
|
37
|
+
activate(row: number): void;
|
|
38
|
+
/**
|
|
39
|
+
* Reads the active id again from the rows the grid shows, unless an edit is
|
|
40
|
+
* open. The tab calls it as a key, a double click, a composition or an input
|
|
41
|
+
* reaches the grid, in the capture phase, before any of them opens an edit.
|
|
42
|
+
*/
|
|
43
|
+
settle(editing: boolean): void;
|
|
44
|
+
/** The rows a commit writes, in row order, or none for an edit on no row. */
|
|
45
|
+
resolve(event: CommitEvent): ResolvedRow[];
|
|
46
|
+
};
|
|
47
|
+
export declare function createSheetRows(ids?: ReadonlyArray<string>): SheetRows;
|
|
48
|
+
/** How many names a toast shows before it counts the rest in its number alone. */
|
|
49
|
+
export declare const NAMES_SHOWN = 3;
|
|
50
|
+
/**
|
|
51
|
+
* Says what the grid refused, under one key per reason so a press repeated
|
|
52
|
+
* shows one toast: a copy or a clear that did nothing is an error, while a
|
|
53
|
+
* paste whose columns ran past the last wrote the rest.
|
|
54
|
+
*/
|
|
55
|
+
export declare function reportGridRefusal({ emitter }: Pick<AppContext, 'emitter'>, { reason }: RejectEvent): void;
|
|
56
|
+
/**
|
|
57
|
+
* The names a toast shows in the reader's language, each in its own direction
|
|
58
|
+
* under a right-to-left one, in a list that says no more than its items do,
|
|
59
|
+
* since the number before it counts the rows it leaves out.
|
|
60
|
+
*/
|
|
61
|
+
export declare function formatNames(i18n: Pick<I18n, 'locale' | 'dir'>, names: ReadonlyArray<string>): string;
|
|
62
|
+
/**
|
|
63
|
+
* Sends a grid's commit as one dispatch and one undo, a term's domain read from
|
|
64
|
+
* its name, or nothing, with a toast saying why, when a row it names was
|
|
65
|
+
* removed meanwhile or any of its rows is refused.
|
|
66
|
+
*/
|
|
67
|
+
export declare function commitDictionaryCells({ store, emitter }: Pick<AppContext, 'store' | 'emitter'>, kind: DictionaryKind, rows: SheetRows, event: CommitEvent, i18n?: Pick<I18n, 'locale' | 'dir'>): boolean;
|
|
68
|
+
/** The domain the active row's term links, '' for none or a removed one: the row a term's domain picker opens on. */
|
|
69
|
+
export declare function activeTermDomain(state: RootState, rows: Pick<SheetRows, 'activeId'>): string;
|
|
70
|
+
/**
|
|
71
|
+
* Links the term the picker's edit opened on to the domain picked, by its id,
|
|
72
|
+
* None unlinking whatever it linked, a removed domain too, in one dispatch and
|
|
73
|
+
* one undo; nothing for the link it holds, or with a toast for a peer's removal.
|
|
74
|
+
*/
|
|
75
|
+
export declare function commitTermDomain({ store, emitter }: Pick<AppContext, 'store' | 'emitter'>, rows: Pick<SheetRows, 'activeId'>, { id: domainId, name }: DomainOption, i18n?: Pick<I18n, 'locale' | 'dir'>): boolean;
|
|
76
|
+
/** The ids of the rows a selection covers, among the rows the grid drew it over, each once in sheet order. */
|
|
77
|
+
export declare function selectedRowIds(rows: Pick<SheetRows, 'receivedIds'>, selection: GridSelection): string[];
|
|
78
|
+
/**
|
|
79
|
+
* Removes the rows a selection covers in one dispatch, so one undo lists them
|
|
80
|
+
* all again; the generator sends the removals from the end of the list back.
|
|
81
|
+
*/
|
|
82
|
+
export declare function removeSelectedRows(store: Pick<RxStore, 'dispatch'>, kind: DictionaryKind, rows: Pick<SheetRows, 'receivedIds'>, selection: GridSelection): boolean;
|
|
83
|
+
//# sourceMappingURL=dictionaryCommit.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AppContext } from '../appContext';
|
|
2
|
+
import { DictionaryKind } from '../../engine/modules/dictionary/actions';
|
|
3
|
+
import { RootState } from '../../engine/state';
|
|
4
|
+
import { I18n } from '../../i18n/translate';
|
|
5
|
+
/** What the tab's file input takes: a dictionary comes in one format, whichever layout its header names. */
|
|
6
|
+
export declare const DICTIONARY_FILE_ACCEPT = ".csv";
|
|
7
|
+
/** The file format the buttons, the menu and the empty sheet's hint name, which no language translates. */
|
|
8
|
+
export declare const DICTIONARY_FILE_FORMAT = "CSV";
|
|
9
|
+
/**
|
|
10
|
+
* Imports a file into the dictionary its header names in one dispatch, reports
|
|
11
|
+
* the counts and answers that dictionary; null for a read-only document or a
|
|
12
|
+
* file no layout reads, which sends nothing and says so.
|
|
13
|
+
*/
|
|
14
|
+
export declare function importDictionaryFile({ store, emitter }: Pick<AppContext, 'store' | 'emitter'>, file: Blob, i18n?: Pick<I18n, 'locale' | 'dir'>): Promise<DictionaryKind | null>;
|
|
15
|
+
/**
|
|
16
|
+
* A dictionary's listed rows in the editor's own CSV format, in the order its
|
|
17
|
+
* sheet shows them, whatever a search shows. A term names its domain by the
|
|
18
|
+
* domain's name, and nothing for one the document does not list.
|
|
19
|
+
*/
|
|
20
|
+
export declare function toDictionaryCsv(state: RootState, kind: DictionaryKind): string;
|
|
21
|
+
/** Saves a dictionary as its own CSV file, named after the database and the sheet. */
|
|
22
|
+
export declare function exportDictionarySheet(state: RootState, kind: DictionaryKind): void;
|
|
23
|
+
//# sourceMappingURL=dictionaryFile.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ValuesType } from '../../internal-types';
|
|
2
|
+
import { KeyBindingMap, KeyBindingName, ShortcutOption } from '../../utils/keyboard-shortcut';
|
|
3
|
+
/**
|
|
4
|
+
* The editor's chords a press in the Dictionary tab still hands on: the
|
|
5
|
+
* palette, undo and redo, which the tab runs on the sheet's own history, and
|
|
6
|
+
* find, whose chord works on every tab.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DICTIONARY_PASSING_BINDINGS: ReadonlyArray<KeyBindingName>;
|
|
9
|
+
/** What a press does to a sheet's rows in the grid. */
|
|
10
|
+
export declare const RowCommand: {
|
|
11
|
+
readonly insertBelow: "insertBelow";
|
|
12
|
+
readonly insertAbove: "insertAbove";
|
|
13
|
+
readonly deleteRows: "deleteRows";
|
|
14
|
+
};
|
|
15
|
+
export type RowCommand = ValuesType<typeof RowCommand>;
|
|
16
|
+
/** The chord a menu row shows for a row command, if one is bound. */
|
|
17
|
+
export declare const rowChordOf: (keyBindingMap: KeyBindingMap, command: RowCommand) => string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Every chord the grid runs a row command by under the bindings given, Insert
|
|
20
|
+
* above's among them, which no binding names: what a host that keeps its own
|
|
21
|
+
* hotkeys off the editor's keys registers beside the binding map's.
|
|
22
|
+
*/
|
|
23
|
+
export declare const dictionaryRowChords: (keyBindingMap: KeyBindingMap) => ShortcutOption[];
|
|
24
|
+
export type DictionaryKeyContext = {
|
|
25
|
+
keyBindingMap: KeyBindingMap;
|
|
26
|
+
/** Undoes the last edit of the sheet shown, from its own history. */
|
|
27
|
+
undo: () => void;
|
|
28
|
+
redo: () => void;
|
|
29
|
+
/** Whether the press came from inside the tab's grid. */
|
|
30
|
+
inGrid: boolean;
|
|
31
|
+
/** Whether the grid holds an open edit, whose own undo takes the press and which keeps the palette and find. */
|
|
32
|
+
isEditing: () => boolean;
|
|
33
|
+
/** Inserts as many rows below the selection as it covers. */
|
|
34
|
+
insertRows: () => void;
|
|
35
|
+
/** Inserts as many rows above the selection as it covers. */
|
|
36
|
+
insertRowsAbove: () => void;
|
|
37
|
+
/** Deletes the rows the selection covers. */
|
|
38
|
+
deleteRows: () => void;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Reads a press at the tab's root: undo and redo undo the sheet shown unless an
|
|
42
|
+
* edit or a field takes them, the row chords insert and delete rows in a grid
|
|
43
|
+
* with no edit open, which keeps find and the palette, and the rest stops.
|
|
44
|
+
*/
|
|
45
|
+
export declare function handleDictionaryKeydown(event: KeyboardEvent, { keyBindingMap, undo: undoSheet, redo: redoSheet, inGrid, isEditing, insertRows, insertRowsAbove, deleteRows, }: DictionaryKeyContext): void;
|
|
46
|
+
/** Keeps a copy, a cut or a paste in the tab, which the editor root would read as a diagram's. */
|
|
47
|
+
export declare const keepClipboard: (event: ClipboardEvent) => void;
|
|
48
|
+
//# sourceMappingURL=dictionaryKeys.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { GridHandle, GridSelection } from '@dineug/grid';
|
|
2
|
+
import { AppContext } from '../appContext';
|
|
3
|
+
import { DictionarySheet } from './sheets';
|
|
4
|
+
/** The first cell a sheet showed, the one a grid mounted again scrolls back to. */
|
|
5
|
+
export type SheetScroll = {
|
|
6
|
+
row: number;
|
|
7
|
+
col: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* What the tab keeps of one sheet across its mounts. The selection and the
|
|
11
|
+
* scroll count rows of the sheet as its search shows them. Each is frozen and
|
|
12
|
+
* replaced whole, so a watcher hears one change and a grid is handed no proxy.
|
|
13
|
+
*/
|
|
14
|
+
export type DictionarySheetView = {
|
|
15
|
+
search: string;
|
|
16
|
+
selection: Readonly<GridSelection> | null;
|
|
17
|
+
scroll: Readonly<SheetScroll> | null;
|
|
18
|
+
/** The widths a resize left, by column id. */
|
|
19
|
+
widths: Readonly<Record<string, number>>;
|
|
20
|
+
};
|
|
21
|
+
export type DictionaryView = {
|
|
22
|
+
sheet: DictionarySheet;
|
|
23
|
+
sheets: Record<DictionarySheet, DictionarySheetView>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The window's own place in the Dictionary tab: never in the store, the file
|
|
27
|
+
* or a change event, kept until the element goes, one per editor. The tab
|
|
28
|
+
* mounts again on every visit and reads it back.
|
|
29
|
+
*/
|
|
30
|
+
export declare function dictionaryViewOf({ store, }: Pick<AppContext, 'store'>): DictionaryView;
|
|
31
|
+
/**
|
|
32
|
+
* Writes a sheet's search. The rows it shows change with it, so the selection
|
|
33
|
+
* and the scroll it kept, which count those rows, are dropped.
|
|
34
|
+
*/
|
|
35
|
+
export declare function changeSearch(view: DictionaryView, sheet: DictionarySheet, search: string): void;
|
|
36
|
+
/** Keeps the selection a grid reported or was handed, as a frozen copy. */
|
|
37
|
+
export declare function rememberSelection(view: DictionaryView, sheet: DictionarySheet, selection: GridSelection): void;
|
|
38
|
+
/**
|
|
39
|
+
* A selection held inside the rows and columns a grid has, every index cut to
|
|
40
|
+
* the last one and a range kept start before end; a grid with no rows keeps
|
|
41
|
+
* its first cell, where a row added comes up active.
|
|
42
|
+
*/
|
|
43
|
+
export declare function clampSelection(selection: Readonly<GridSelection>, rowCount: number, colCount: number): GridSelection;
|
|
44
|
+
/** The first cell alone, what a sheet opens on before it has a selection of its own. */
|
|
45
|
+
export declare const FIRST_CELL_SELECTION: Readonly<GridSelection>;
|
|
46
|
+
/**
|
|
47
|
+
* The selection a grid mounted on the sheet is handed: the one it kept, held
|
|
48
|
+
* inside the rows it shows now, or the first cell. A fresh copy, since a grid
|
|
49
|
+
* holds what it is handed.
|
|
50
|
+
*/
|
|
51
|
+
export declare function storedSelection(view: DictionaryView, sheet: DictionarySheet, rowCount: number, colCount: number): GridSelection;
|
|
52
|
+
/** Keeps the first cell a grid showed, from its viewport report, when it moved. */
|
|
53
|
+
export declare function rememberScroll(view: DictionaryView, sheet: DictionarySheet, { rowStart, colStart }: {
|
|
54
|
+
rowStart: number;
|
|
55
|
+
colStart: number;
|
|
56
|
+
}): void;
|
|
57
|
+
/**
|
|
58
|
+
* Scrolls a grid back to the first cell its sheet showed. A grid scrolls the
|
|
59
|
+
* least distance that shows a cell, so it goes to the last cell first, and the
|
|
60
|
+
* way back up then stops with the kept cell first in view.
|
|
61
|
+
*/
|
|
62
|
+
export declare function restoreScroll(handle: Pick<GridHandle, 'scrollTo'>, view: DictionaryView, sheet: DictionarySheet, rowCount: number, colCount: number): void;
|
|
63
|
+
/** Keeps the width a resize left a column at, which the grid draws only while the host holds it. */
|
|
64
|
+
export declare function rememberWidth(view: DictionaryView, sheet: DictionarySheet, columnId: string, width: number): void;
|
|
65
|
+
//# sourceMappingURL=dictionaryView.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EditorContext } from '@dineug/grid';
|
|
2
|
+
import { FC } from '@dineug/r-html';
|
|
3
|
+
import { DomainOption } from '../../table-view/column/column-domain/domainOptions';
|
|
4
|
+
export type DomainCellEditorProps = {
|
|
5
|
+
editor: EditorContext;
|
|
6
|
+
/** The column's header, which names the search field. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** The id of the domain the cell's row links, '' for none, which the list opens on. */
|
|
9
|
+
linkedId: string;
|
|
10
|
+
/** Links the row to the domain picked, by its id, '' for None. */
|
|
11
|
+
onPick: (option: DomainOption) => void;
|
|
12
|
+
/** Runs once its edit has closed, after onPick for a pick. */
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A term's domain cell editor: a search over the domain sheet by name that only
|
|
17
|
+
* picks, as the ERD tab's domain cell does. The grid's edit writes no text: a
|
|
18
|
+
* pick cancels it and hands the tab the domain picked by its id, None as ''.
|
|
19
|
+
*/
|
|
20
|
+
declare const DomainCellEditor: FC<DomainCellEditorProps>;
|
|
21
|
+
export default DomainCellEditor;
|
|
22
|
+
//# sourceMappingURL=DomainCellEditor.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The height of one domain in the list. */
|
|
2
|
+
export declare const OPTION_HEIGHT = 26;
|
|
3
|
+
export declare const root: import('@dineug/r-html').CSSTemplateLiterals;
|
|
4
|
+
export declare const input: import('@dineug/r-html').CSSTemplateLiterals;
|
|
5
|
+
export declare const list: import('@dineug/r-html').CSSTemplateLiterals;
|
|
6
|
+
export declare const option: import('@dineug/r-html').CSSTemplateLiterals;
|
|
7
|
+
//# sourceMappingURL=DomainCellEditor.styles.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EditorContext } from '@dineug/grid';
|
|
2
|
+
import { DomainCellEditorProps } from './DomainCellEditor';
|
|
3
|
+
/**
|
|
4
|
+
* Opens the domain picker of a term's domain cell in the grid's editor slot,
|
|
5
|
+
* and takes it out again once its edit has closed, by a pick or a cancel,
|
|
6
|
+
* before onClose runs.
|
|
7
|
+
*/
|
|
8
|
+
export declare function openDomainCellEditor(editor: EditorContext, { label, linkedId, onPick, onClose }: Omit<DomainCellEditorProps, 'editor'>): void;
|
|
9
|
+
//# sourceMappingURL=openDomainCellEditor.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CellStyle, GridTheme } from '@dineug/grid';
|
|
2
|
+
import { DictionaryCheckLevel } from '../../engine/modules/dictionary/checks';
|
|
3
|
+
import { Theme } from '../../themes/tokens';
|
|
4
|
+
/**
|
|
5
|
+
* The theme the tab hands its grid. The grid redraws on a new object, so the
|
|
6
|
+
* one handed before comes back while every colour still matches, and only a
|
|
7
|
+
* theme change, light to dark or a new accent, makes another.
|
|
8
|
+
*/
|
|
9
|
+
export declare function toGridTheme(theme: Theme, previous?: Readonly<GridTheme>): Readonly<GridTheme>;
|
|
10
|
+
/** The style a sheet gives a cell the checks mark, by the loudest level they find. */
|
|
11
|
+
export type CellMarks = Readonly<Record<DictionaryCheckLevel, Readonly<CellStyle>>>;
|
|
12
|
+
/**
|
|
13
|
+
* Each level's text on its own fill, from the tab's four mark tokens: the
|
|
14
|
+
* error pair and the warning pair. The marks handed before come back while
|
|
15
|
+
* both pairs match, so the tab hands the grid a new style getter only then.
|
|
16
|
+
*/
|
|
17
|
+
export declare function toCellMarks(theme: Theme, previous?: CellMarks): CellMarks;
|
|
18
|
+
//# sourceMappingURL=gridTheme.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { GridColumn } from '@dineug/grid';
|
|
2
|
+
import { AnyAction } from '@dineug/r-html';
|
|
3
|
+
import { DictionaryFields, DictionaryKind } from '../../engine/modules/dictionary/actions';
|
|
4
|
+
import { DictionaryCheckLevel } from '../../engine/modules/dictionary/checks';
|
|
5
|
+
import { RootState } from '../../engine/state';
|
|
6
|
+
import { I18n, PlainMessageKey } from '../../i18n/translate';
|
|
7
|
+
import { ValuesType } from '../../internal-types';
|
|
8
|
+
/**
|
|
9
|
+
* The tab's sheets in the order its bar lists them: the domains, the words
|
|
10
|
+
* and the terms, as a standard is built up, then their checks.
|
|
11
|
+
*/
|
|
12
|
+
export declare const DictionarySheet: {
|
|
13
|
+
readonly domain: "domain";
|
|
14
|
+
readonly word: "word";
|
|
15
|
+
readonly term: "term";
|
|
16
|
+
readonly check: "check";
|
|
17
|
+
};
|
|
18
|
+
export type DictionarySheet = ValuesType<typeof DictionarySheet>;
|
|
19
|
+
export declare const DictionarySheetList: ReadonlyArray<DictionarySheet>;
|
|
20
|
+
/** Whether the sheet lists a dictionary's own rows, which it edits, rather than the checks over them. */
|
|
21
|
+
export declare const isEntrySheet: (sheet: DictionarySheet) => sheet is DictionaryKind;
|
|
22
|
+
export declare const DictionarySheetLabelKey: Readonly<Record<DictionarySheet, PlainMessageKey>>;
|
|
23
|
+
/** A field of a dictionary's rows, which is the id of its column on the sheet. */
|
|
24
|
+
export type SheetField<K extends DictionaryKind = DictionaryKind> = (typeof DictionaryFields)[K][number];
|
|
25
|
+
export type SheetColumnOptions = {
|
|
26
|
+
/** A read-only document makes every column read-only. */
|
|
27
|
+
readonly: boolean;
|
|
28
|
+
/** The widths a resize left, by column id, in place of each column's own. */
|
|
29
|
+
widths?: Readonly<Record<string, number>>;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A dictionary's columns, one per field in the order its rows hold them, each
|
|
33
|
+
* labelled in the reader's language. A term's domain column shows and takes
|
|
34
|
+
* the domain's name, which the commit reads back to the domain's id.
|
|
35
|
+
*/
|
|
36
|
+
export declare function sheetColumns(kind: DictionaryKind, { readonly, widths }: SheetColumnOptions, i18n?: Pick<I18n, 't'>): GridColumn[];
|
|
37
|
+
/** The field a column of the sheet writes, or undefined for an id the sheet has no column of. */
|
|
38
|
+
export declare function sheetField<K extends DictionaryKind>(kind: K, columnId: string): SheetField<K> | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* What a row's cell shows: the field as the row holds it, and for a term's
|
|
41
|
+
* domain the name of the domain it links while the document lists that one,
|
|
42
|
+
* else nothing; nothing too for an id with no row or a column the sheet lacks.
|
|
43
|
+
*/
|
|
44
|
+
export declare function sheetCellText(state: RootState, kind: DictionaryKind, id: string, columnId: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* How loud a row's cell shows what the checks find in it: an error, a warning,
|
|
47
|
+
* or null for nothing found, a column no check reads or an id with no row. It
|
|
48
|
+
* reads the dictionaries' indexes, so a draw marks only the cells it paints.
|
|
49
|
+
*/
|
|
50
|
+
export declare function sheetCellMark(state: RootState, kind: DictionaryKind, id: string, columnId: string): DictionaryCheckLevel | null;
|
|
51
|
+
/** A text as a search compares it, composed and in lower case, so a match ignores both. */
|
|
52
|
+
export declare const toSearchText: (text: string) => string;
|
|
53
|
+
/**
|
|
54
|
+
* The ids of a sheet's rows, its listed rows in key order, those whose
|
|
55
|
+
* searched fields hold the search's text while it holds any; with no search
|
|
56
|
+
* the same frozen array comes back until the sheet is written.
|
|
57
|
+
*/
|
|
58
|
+
export declare function sheetRowIds(state: RootState, kind: DictionaryKind, search?: string): ReadonlyArray<string>;
|
|
59
|
+
/**
|
|
60
|
+
* The sheets a batch raises: all four for a dictionary's write or a load,
|
|
61
|
+
* since a term shows its domain's name and the checks read every dictionary;
|
|
62
|
+
* the checks alone for a table's or a column's write or a name view switch.
|
|
63
|
+
*/
|
|
64
|
+
export declare function bumpedSheets(actions: ReadonlyArray<AnyAction>): ReadonlyArray<DictionarySheet>;
|
|
65
|
+
//# sourceMappingURL=sheets.d.ts.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { AppContext } from '../../appContext';
|
|
2
2
|
import { ElkLayoutPoint, ElkLayoutRequest } from '../../../services/elk-layout';
|
|
3
3
|
/**
|
|
4
|
-
* What a Flow placement of a document asks ELK, measured
|
|
5
|
-
* its own with the editor's text measure, so nothing
|
|
6
|
-
* store. Null under two tables or with no relationship, the grid's cases.
|
|
4
|
+
* What a Flow placement of a document asks ELK, measured in the reader's name
|
|
5
|
+
* view on a plain store of its own with the editor's text measure, so nothing
|
|
6
|
+
* reaches the editor's store. Null under two tables or with no relationship, the grid's cases.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* const request = createFlowRequest(app, json);
|
|
10
10
|
*/
|
|
11
|
-
export declare function createFlowRequest({ toWidth }: AppContext, json: string): ElkLayoutRequest | null;
|
|
11
|
+
export declare function createFlowRequest({ toWidth, store }: AppContext, json: string): ElkLayoutRequest | null;
|
|
12
12
|
/**
|
|
13
13
|
* Where each table of a document not loaded yet goes by Flow, measured from
|
|
14
14
|
* the corner of the block the tables make, so the caller decides where that
|
|
@@ -4,4 +4,10 @@
|
|
|
4
4
|
* paints no underline of its own: the scene's rect keeps running under it.
|
|
5
5
|
*/
|
|
6
6
|
export declare const cell: import('@dineug/r-html').CSSTemplateLiterals;
|
|
7
|
+
/**
|
|
8
|
+
* A tinted header's text color, on the input alone: the term list a logical
|
|
9
|
+
* name opens under it paints the table's background, so its text and keys
|
|
10
|
+
* keep the theme's colors, which read there.
|
|
11
|
+
*/
|
|
12
|
+
export declare const tinted: import('@dineug/r-html').CSSTemplateLiterals;
|
|
7
13
|
//# sourceMappingURL=EditOverlay.styles.d.ts.map
|
|
@@ -11,6 +11,11 @@ export type HitFunc = (context: Context, shape: Shape) => void;
|
|
|
11
11
|
export declare const columnCellHit: Record<GeometrySource, HitFunc>;
|
|
12
12
|
/** One of those per source, built once, for the reason columnCellHit is. */
|
|
13
13
|
export declare const headerCellHit: Record<GeometrySource, HitFunc>;
|
|
14
|
+
/**
|
|
15
|
+
* The column drag handle's box: a row high, from a little left of its button
|
|
16
|
+
* to the table's edge, so a press beside the button still takes the handle.
|
|
17
|
+
*/
|
|
18
|
+
export declare const columnDragHandleHit: HitFunc;
|
|
14
19
|
/**
|
|
15
20
|
* The whole 24 unit box of a lucide icon, answered by the first shape it draws.
|
|
16
21
|
* A circle's origin is its centre, so its own position is what puts the box
|
|
@@ -55,6 +55,10 @@ export declare const HIGH_LEVEL_FONT_SIZES: readonly [20, 24, 28, 35, 60];
|
|
|
55
55
|
export declare const TABLE_INSET: number;
|
|
56
56
|
/** The radius Table.styles rounds a table box with. */
|
|
57
57
|
export declare const TABLE_CORNER_RADIUS = 6;
|
|
58
|
+
/** How much of the column drag handle shows while the pointer is off it. */
|
|
59
|
+
export declare const COLUMN_DRAG_HANDLE_REST_OPACITY = 0.5;
|
|
60
|
+
/** The corner the column drag handle's button is rounded by. */
|
|
61
|
+
export declare const COLUMN_DRAG_HANDLE_RADIUS = 4;
|
|
58
62
|
/** The 1.5px underline EditInput draws for a focused, edited or shared cell. */
|
|
59
63
|
export declare const FOCUS_BORDER_HEIGHT = 1.5;
|
|
60
64
|
/** What the ring outside a table box costs, as outline and box-shadow both do. */
|
|
@@ -122,6 +126,8 @@ export declare const HIT_FILL = "transparent";
|
|
|
122
126
|
export declare function documentCardShadow(color: string | undefined): CardShadow | null;
|
|
123
127
|
/** The hand a clickable scene node asks for, as the dom scene spelt it in css. */
|
|
124
128
|
export declare const CURSOR_POINTER = "pointer";
|
|
129
|
+
/** The open hand the column drag handle asks for under the pointer. */
|
|
130
|
+
export declare const CURSOR_GRAB = "grab";
|
|
125
131
|
/** The beam a textarea carried on its own, which a drawn body has to ask for. */
|
|
126
132
|
export declare const CURSOR_TEXT = "text";
|
|
127
133
|
/** What a node hands back on the way out, leaving the container its own cursor. */
|