@dineug/erd-editor 3.1.8 → 3.2.1
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 +2 -429
- package/dist/components/appContext.d.ts +8 -7
- package/dist/components/customElementRegistry.d.ts +0 -1
- package/dist/components/erd/automatic-table-placement/AutomaticTablePlacement.d.ts +1 -2
- package/dist/components/erd/automatic-table-placement/createAutomaticTablePlacement.d.ts +2 -2
- package/dist/components/erd/canvas/canvas-svg/relationship/Relationship.d.ts +1 -1
- package/dist/components/erd/canvas/canvas-svg/relationship/Relationship.template.d.ts +1 -1
- package/dist/components/erd/canvas/draw-relationship/DrawRelationship.d.ts +1 -1
- package/dist/components/erd/canvas/high-level-table/HighLevelTable.d.ts +1 -1
- package/dist/components/erd/canvas/memo/Memo.d.ts +1 -1
- package/dist/components/erd/canvas/memo/memo-sash/MemoSash.d.ts +1 -1
- package/dist/components/erd/canvas/shared-mouse-tracker/shared-mouse-cursor/SharedMouseCursor.d.ts +1 -1
- package/dist/components/erd/canvas/table/Table.d.ts +1 -1
- package/dist/components/erd/canvas/table/column/Column.d.ts +2 -2
- package/dist/components/erd/canvas/table/column/column-data-type/ColumnDataType.d.ts +1 -1
- package/dist/components/erd/canvas/table/useFocusTable.d.ts +2 -2
- package/dist/components/erd/canvas/table/useMoveTable.d.ts +1 -1
- package/dist/components/erd/diff-viewer/DiffViewer.d.ts +9 -0
- package/dist/components/erd/diff-viewer/DiffViewer.styles.d.ts +3 -0
- package/dist/components/erd/diff-viewer/diff.d.ts +19 -0
- package/dist/components/erd/diff-viewer/erd-viewer/ErdViewer.d.ts +10 -0
- package/dist/components/erd/diff-viewer/erd-viewer/ErdViewer.styles.d.ts +1 -0
- package/dist/components/erd/diff-viewer/tree-viewer/TreeViewer.d.ts +11 -0
- package/dist/components/erd/diff-viewer/tree-viewer/TreeViewer.styles.d.ts +5 -0
- package/dist/components/erd/erd-context-menu/ErdContextMenu.d.ts +1 -1
- package/dist/components/erd/erd-context-menu/menus/databaseMenus.d.ts +1 -1
- package/dist/components/erd/erd-context-menu/menus/drawRelationshipMenus.d.ts +2 -2
- package/dist/components/erd/erd-context-menu/menus/exportMenus.d.ts +1 -1
- package/dist/components/erd/erd-context-menu/menus/importMenus.d.ts +1 -1
- package/dist/components/erd/erd-context-menu/menus/relationshipMenus.d.ts +1 -1
- package/dist/components/erd/erd-context-menu/menus/showMenus.d.ts +1 -1
- package/dist/components/erd/erdShortcutPerformCheck.d.ts +1 -1
- package/dist/components/erd/minimap/memo/Memo.d.ts +1 -1
- package/dist/components/erd/minimap/table/Table.d.ts +1 -1
- package/dist/components/erd/minimap/useMinimapScroll.d.ts +1 -1
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-checkbox-column/IndexesCheckboxColumn.d.ts +1 -1
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-column/IndexesColumn.d.ts +1 -1
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-index/IndexesIndex.d.ts +1 -1
- package/dist/components/erd/table-properties/table-properties-tabs/TablePropertiesTabs.d.ts +1 -1
- package/dist/components/erd/time-travel/TimeTravel.d.ts +9 -0
- package/dist/components/erd/time-travel/TimeTravel.styles.d.ts +4 -0
- package/dist/components/erd/useErdShortcut.d.ts +1 -1
- package/dist/components/erd/virtual-scroll/useVirtualScroll.d.ts +1 -1
- package/dist/components/erd-editor/ErdEditor.d.ts +6 -5
- package/dist/components/erd-editor/ErdEditor.stories.d.ts +0 -1
- package/dist/components/erd-editor/useErdEditorAttachElement.d.ts +5 -5
- package/dist/components/generator-code/generator-code-context-menu/menus/columnNameCaseMenus.d.ts +1 -1
- package/dist/components/generator-code/generator-code-context-menu/menus/languageMenus.d.ts +1 -1
- package/dist/components/generator-code/generator-code-context-menu/menus/tableNameCaseMenus.d.ts +1 -1
- package/dist/components/primitives/code-block/CodeBlock.d.ts +1 -1
- package/dist/components/primitives/color-picker/ColorPicker.d.ts +1 -1
- package/dist/components/primitives/context-menu/context-menu-root/contextMenuRootContext.d.ts +1 -1
- package/dist/components/primitives/icon/icons.d.ts +1 -1
- package/dist/components/primitives/sash/Sash.d.ts +2 -2
- package/dist/components/primitives/slider/Slider.d.ts +9 -0
- package/dist/components/primitives/slider/Slider.stories.d.ts +23 -0
- package/dist/components/primitives/slider/Slider.styles.d.ts +4 -0
- package/dist/components/quick-search/actions.d.ts +1 -1
- package/dist/components/schema-sql/schema-sql-context-menu/menus/bracketMenus.d.ts +1 -1
- package/dist/components/settings/settings-lnb/SettingsLnb.d.ts +1 -1
- package/dist/components/theme/Theme.d.ts +1 -1
- package/dist/components/theme-builder/ThemeBuilder.d.ts +1 -1
- package/dist/components/visualization/createVisualization.d.ts +1 -1
- package/dist/components/visualization/table/Table.d.ts +1 -1
- package/dist/components/visualization/table/column/Column.d.ts +1 -1
- package/dist/constants/layout.d.ts +1 -0
- package/dist/constants/open.d.ts +3 -1
- package/dist/constants/sql/dataType/MSSQL.d.ts +1 -1
- package/dist/constants/sql/dataType/MariaDB.d.ts +1 -1
- package/dist/constants/sql/dataType/MySQL.d.ts +1 -1
- package/dist/constants/sql/dataType/Oracle.d.ts +1 -1
- package/dist/constants/sql/dataType/PostgreSQL.d.ts +1 -1
- package/dist/constants/sql/dataType/SQLite.d.ts +1 -1
- package/dist/constants/sql/dataType/index.d.ts +1 -1
- package/dist/constants/sql/database.d.ts +1 -1
- package/dist/engine/actions.d.ts +24 -24
- package/dist/engine/generator.actions.d.ts +2 -2
- package/dist/engine/history.actions.d.ts +3 -3
- package/dist/engine/history.d.ts +24 -10
- package/dist/engine/hooks.d.ts +2 -2
- package/dist/engine/modules/editor/actions.d.ts +3 -3
- package/dist/engine/modules/editor/generator.actions.d.ts +2 -2
- package/dist/engine/modules/editor/history.d.ts +1 -1
- package/dist/engine/modules/editor/state.d.ts +1 -1
- package/dist/engine/modules/editor/utils/focus.d.ts +3 -3
- package/dist/engine/modules/index/actions.d.ts +3 -3
- package/dist/engine/modules/index/generator.actions.d.ts +1 -1
- package/dist/engine/modules/index/history.d.ts +1 -1
- package/dist/engine/modules/index-column/actions.d.ts +3 -3
- package/dist/engine/modules/index-column/generator.actions.d.ts +1 -1
- package/dist/engine/modules/index-column/history.d.ts +1 -1
- package/dist/engine/modules/memo/actions.d.ts +3 -3
- package/dist/engine/modules/memo/generator.actions.d.ts +1 -1
- package/dist/engine/modules/memo/history.d.ts +1 -1
- package/dist/engine/modules/relationship/actions.d.ts +3 -3
- package/dist/engine/modules/relationship/history.d.ts +1 -1
- package/dist/engine/modules/relationship/hooks.d.ts +1 -1
- package/dist/engine/modules/settings/actions.d.ts +3 -3
- package/dist/engine/modules/settings/generator.actions.d.ts +1 -1
- package/dist/engine/modules/settings/history.d.ts +1 -1
- package/dist/engine/modules/table/actions.d.ts +3 -3
- package/dist/engine/modules/table/generator.actions.d.ts +2 -2
- package/dist/engine/modules/table/history.d.ts +1 -1
- package/dist/engine/modules/table/hooks.d.ts +1 -1
- package/dist/engine/modules/table-column/actions.d.ts +3 -3
- package/dist/engine/modules/table-column/generator.actions.d.ts +2 -2
- package/dist/engine/modules/table-column/history.d.ts +1 -1
- package/dist/engine/modules/table-column/hooks.d.ts +1 -1
- package/dist/engine/modules/table-column/utils/dataType.d.ts +2 -2
- package/dist/engine/replication-store.d.ts +2 -2
- package/dist/engine/rx-store.d.ts +10 -3
- package/dist/engine/shared-store.d.ts +2 -2
- package/dist/engine/state.d.ts +1 -1
- package/dist/engine/store-hooks.d.ts +1 -1
- package/dist/engine/store.d.ts +2 -2
- package/dist/engine/tag.d.ts +1 -1
- package/dist/engine.js +8 -8
- package/dist/erd-editor.js +8876 -8205
- package/dist/hooks/useKeyBindingMap.d.ts +1 -1
- package/dist/hooks/useUnmounted.d.ts +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/{schemaGCService-Cyip5lJB.js → schemaGCService-tEI4URA5.js} +500 -499
- package/dist/services/schema-gc/procGC.d.ts +1 -1
- package/dist/services/schema-gc/schemaGCService.d.ts +1 -1
- package/dist/themes/radix-ui-theme.config.d.ts +1 -1
- package/dist/themes/radix-ui-theme.d.ts +2 -2
- package/dist/themes/tokens.d.ts +6 -0
- package/dist/utils/calcMemo.d.ts +1 -1
- package/dist/utils/calcTable.d.ts +3 -3
- package/dist/utils/collection/index.entity.d.ts +1 -1
- package/dist/utils/collection/indexColumn.entity.d.ts +1 -1
- package/dist/utils/collection/memo.entity.d.ts +1 -1
- package/dist/utils/collection/relationship.entity.d.ts +1 -1
- package/dist/utils/collection/table.entity.d.ts +1 -1
- package/dist/utils/collection/tableColumn.entity.d.ts +1 -1
- package/dist/utils/dragSelect.d.ts +1 -1
- package/dist/utils/draw-relationship/calc.d.ts +3 -3
- package/dist/utils/draw-relationship/draw.d.ts +3 -3
- package/dist/utils/draw-relationship/index.d.ts +1 -1
- package/dist/utils/draw-relationship/pathFinding.d.ts +2 -2
- package/dist/utils/draw-relationship/sort.d.ts +1 -1
- package/dist/utils/emitter.d.ts +15 -2
- package/dist/utils/file/importFile.d.ts +3 -1
- package/dist/utils/focus.d.ts +1 -1
- package/dist/utils/generator-code/csharp.d.ts +1 -1
- package/dist/utils/generator-code/graphql.d.ts +1 -1
- package/dist/utils/generator-code/index.d.ts +2 -2
- package/dist/utils/generator-code/java.d.ts +1 -1
- package/dist/utils/generator-code/jpa.d.ts +1 -1
- package/dist/utils/generator-code/kotlin.d.ts +1 -1
- package/dist/utils/generator-code/scala.d.ts +1 -1
- package/dist/utils/generator-code/typescript.d.ts +1 -1
- package/dist/utils/generator-code/utils.d.ts +2 -2
- package/dist/utils/globalEmitter.d.ts +4 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/internalEvents.d.ts +1 -1
- package/dist/utils/keyboard-shortcut/index.d.ts +1 -1
- package/dist/utils/rx-operators/fromCopy.d.ts +1 -1
- package/dist/utils/rx-operators/fromPaste.d.ts +1 -1
- package/dist/utils/schema-sql/MSSQL.d.ts +1 -1
- package/dist/utils/schema-sql/MariaDB.d.ts +1 -1
- package/dist/utils/schema-sql/MySQL.d.ts +1 -1
- 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 +1 -1
- package/dist/utils/schema-sql/index.d.ts +2 -2
- package/dist/utils/schema-sql/utils.d.ts +4 -2
- package/dist/utils/schema-sql-parser/index.d.ts +1 -1
- package/dist/utils/table-clipboard/copy.d.ts +1 -1
- package/dist/utils/table-clipboard/index.d.ts +1 -1
- package/dist/utils/table-clipboard/paste.d.ts +2 -2
- package/package.json +14 -13
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Install
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
10
|
npm install @dineug/erd-editor
|
|
@@ -43,434 +43,7 @@ document.body.appendChild(editor);
|
|
|
43
43
|
</script>
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
```ts
|
|
49
|
-
interface ErdEditorElement extends HTMLElement {
|
|
50
|
-
readonly: boolean;
|
|
51
|
-
systemDarkMode: boolean; // system dark/light auto
|
|
52
|
-
enableThemeBuilder: boolean;
|
|
53
|
-
value: string;
|
|
54
|
-
focus: () => void;
|
|
55
|
-
blur: () => void;
|
|
56
|
-
clear: () => void;
|
|
57
|
-
destroy: () => void;
|
|
58
|
-
setInitialValue: (value: string) => void;
|
|
59
|
-
setPresetTheme: (themeOptions: Partial<ThemeOptions>) => void;
|
|
60
|
-
setTheme: (theme: Partial<Theme>) => void;
|
|
61
|
-
setKeyBindingMap: (keyBindingMap: Partial<KeyBindingMap>) => void;
|
|
62
|
-
setSchemaSQL: (value: string) => void;
|
|
63
|
-
getSchemaSQL: (databaseVendor?: DatabaseVendor) => string;
|
|
64
|
-
getSharedStore: (config?: SharedStoreConfig) => SharedStore;
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## readonly
|
|
69
|
-
|
|
70
|
-
Sets the editing capability of the editor.
|
|
71
|
-
|
|
72
|
-
```js
|
|
73
|
-
editor.readonly = true;
|
|
74
|
-
// or
|
|
75
|
-
editor.setAttribute('readonly', 'true');
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
```html
|
|
79
|
-
<erd-editor readonly></erd-editor>
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## systemDarkMode
|
|
83
|
-
|
|
84
|
-
Determines whether to automatically synchronize with the system's dark/light mode.
|
|
85
|
-
|
|
86
|
-
```js
|
|
87
|
-
editor.systemDarkMode = true;
|
|
88
|
-
// or
|
|
89
|
-
editor.setAttribute('systemDarkMode', 'true');
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
```html
|
|
93
|
-
<erd-editor system-dark-mode></erd-editor>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## enableThemeBuilder
|
|
97
|
-
|
|
98
|
-
Determines if a UI for easily setting preset themes is provided.
|
|
99
|
-
|
|
100
|
-
<img src="https://github.com/dineug/erd-editor/blob/main/img/theme-builder.png?raw=true" width="400" />
|
|
101
|
-
|
|
102
|
-
```js
|
|
103
|
-
editor.enableThemeBuilder = true;
|
|
104
|
-
// or
|
|
105
|
-
editor.setAttribute('enableThemeBuilder', 'true');
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
```html
|
|
109
|
-
<erd-editor enable-theme-builder></erd-editor>
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Triggers the `changePresetTheme` event upon changing the preset theme.
|
|
113
|
-
|
|
114
|
-
```js
|
|
115
|
-
editor.addEventListener('changePresetTheme', event => {
|
|
116
|
-
const themeOptions = event.detail;
|
|
117
|
-
});
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
## value
|
|
121
|
-
|
|
122
|
-
### getter
|
|
123
|
-
|
|
124
|
-
Retrieves the current editor state as JSON data.
|
|
125
|
-
|
|
126
|
-
```js
|
|
127
|
-
const data = editor.value;
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### setter
|
|
131
|
-
|
|
132
|
-
Loads a previously saved editor state. It is recorded in the history list, enabling `Undo, Redo`.
|
|
133
|
-
|
|
134
|
-
```js
|
|
135
|
-
editor.value = 'json...';
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## setInitialValue
|
|
139
|
-
|
|
140
|
-
Loads a previously saved editor state. It is not recorded in the history list, so `Undo, Redo` is not possible.
|
|
141
|
-
|
|
142
|
-
```js
|
|
143
|
-
editor.setInitialValue('json...');
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
## Event
|
|
147
|
-
|
|
148
|
-
### change
|
|
149
|
-
|
|
150
|
-
When there are changes in the editor, it emits an event.
|
|
151
|
-
|
|
152
|
-
```js
|
|
153
|
-
editor.addEventListener('change', event => {
|
|
154
|
-
const data = event.target.value;
|
|
155
|
-
});
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
## focus
|
|
159
|
-
|
|
160
|
-
Focuses on the editor.
|
|
161
|
-
|
|
162
|
-
```js
|
|
163
|
-
editor.focus();
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
## blur
|
|
167
|
-
|
|
168
|
-
Removes focus from the editor.
|
|
169
|
-
|
|
170
|
-
```js
|
|
171
|
-
editor.blur();
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
## clear
|
|
175
|
-
|
|
176
|
-
Resets the editor state.
|
|
177
|
-
|
|
178
|
-
```js
|
|
179
|
-
editor.clear();
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
## destroy
|
|
183
|
-
|
|
184
|
-
Completely disables reusing the editor instance.
|
|
185
|
-
|
|
186
|
-
```js
|
|
187
|
-
editor.destroy();
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
## setKeyBindingMap
|
|
191
|
-
|
|
192
|
-
Redefines keyboard shortcuts.
|
|
193
|
-
|
|
194
|
-
```ts
|
|
195
|
-
type ShortcutOption = {
|
|
196
|
-
shortcut: string;
|
|
197
|
-
preventDefault?: boolean;
|
|
198
|
-
stopPropagation?: boolean;
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
const defaultKeyBindingMap: KeyBindingMap = {
|
|
202
|
-
addTable: [{ shortcut: 'Alt+KeyN' }],
|
|
203
|
-
addColumn: [{ shortcut: 'Alt+Enter' }],
|
|
204
|
-
addMemo: [{ shortcut: 'Alt+KeyM' }],
|
|
205
|
-
removeTable: [{ shortcut: '$mod+Backspace' }, { shortcut: '$mod+Delete' }],
|
|
206
|
-
removeColumn: [{ shortcut: 'Alt+Backspace' }, { shortcut: 'Alt+Delete' }],
|
|
207
|
-
primaryKey: [{ shortcut: 'Alt+KeyK' }],
|
|
208
|
-
selectAllTable: [{ shortcut: '$mod+Alt+KeyA' }],
|
|
209
|
-
selectAllColumn: [{ shortcut: 'Alt+KeyA' }],
|
|
210
|
-
relationshipZeroOne: [{ shortcut: '$mod+Alt+Digit1' }],
|
|
211
|
-
relationshipZeroN: [{ shortcut: '$mod+Alt+Digit2' }],
|
|
212
|
-
relationshipOneOnly: [{ shortcut: '$mod+Alt+Digit3' }],
|
|
213
|
-
relationshipOneN: [{ shortcut: '$mod+Alt+Digit4' }],
|
|
214
|
-
tableProperties: [{ shortcut: 'Alt+Space' }],
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
// example
|
|
218
|
-
editor.setKeyBindingMap({
|
|
219
|
-
addTable: [{ shortcut: '$mod+KeyN', preventDefault: true }];
|
|
220
|
-
});
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### $mod
|
|
224
|
-
|
|
225
|
-
Switches `Control` key depending on the environment.
|
|
226
|
-
|
|
227
|
-
- Mac: $mod = Meta (⌘)
|
|
228
|
-
- Windows/Linux: $mod = Control
|
|
229
|
-
|
|
230
|
-
### Shortcut Table
|
|
231
|
-
|
|
232
|
-
Uses keyboard event `key, code` properties.
|
|
233
|
-
Use `code` for absolute positions and `key` for input values.
|
|
234
|
-
|
|
235
|
-
| Windows | macOS | `key` | `code` |
|
|
236
|
-
| ------------- | --------------- | ------------- | ------------------------------ |
|
|
237
|
-
| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |
|
|
238
|
-
| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |
|
|
239
|
-
| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |
|
|
240
|
-
| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |
|
|
241
|
-
| `Space` | `Space` | N/A | `Space` |
|
|
242
|
-
| `Enter` | `Return` | `Enter` | `Enter` |
|
|
243
|
-
| `Esc` | `Esc` | `Escape` | `Escape` |
|
|
244
|
-
| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |
|
|
245
|
-
| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |
|
|
246
|
-
| `-` | `-` | `-` | `Minus` |
|
|
247
|
-
| `=` | `=` | `=` | `Equal` |
|
|
248
|
-
| `+` | `+` | `+` | `Equal`\* |
|
|
249
|
-
|
|
250
|
-
## Theme
|
|
251
|
-
|
|
252
|
-
### setPresetTheme
|
|
253
|
-
|
|
254
|
-
Sets a preset theme.
|
|
255
|
-
|
|
256
|
-
```ts
|
|
257
|
-
type ThemeOptions = {
|
|
258
|
-
appearance: 'dark' | 'light';
|
|
259
|
-
grayColor: 'gray' | 'mauve' | 'slate' | 'sage' | 'olive' | 'sand';
|
|
260
|
-
accentColor:
|
|
261
|
-
| 'gray'
|
|
262
|
-
| 'gold'
|
|
263
|
-
| 'bronze'
|
|
264
|
-
| 'brown'
|
|
265
|
-
| 'yellow'
|
|
266
|
-
| 'amber'
|
|
267
|
-
| 'orange'
|
|
268
|
-
| 'tomato'
|
|
269
|
-
| 'red'
|
|
270
|
-
| 'ruby'
|
|
271
|
-
| 'crimson'
|
|
272
|
-
| 'pink'
|
|
273
|
-
| 'plum'
|
|
274
|
-
| 'purple'
|
|
275
|
-
| 'violet'
|
|
276
|
-
| 'iris'
|
|
277
|
-
| 'indigo'
|
|
278
|
-
| 'blue'
|
|
279
|
-
| 'cyan'
|
|
280
|
-
| 'teal'
|
|
281
|
-
| 'jade'
|
|
282
|
-
| 'green'
|
|
283
|
-
| 'grass'
|
|
284
|
-
| 'lime'
|
|
285
|
-
| 'mint'
|
|
286
|
-
| 'sky';
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
// example
|
|
290
|
-
editor.setPresetTheme({ appearance: 'light' });
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### setTheme
|
|
294
|
-
|
|
295
|
-
Allows customizing the theme.
|
|
296
|
-
|
|
297
|
-
#### JavaScript
|
|
298
|
-
|
|
299
|
-
```ts
|
|
300
|
-
type Theme = {
|
|
301
|
-
grayColor1: string;
|
|
302
|
-
grayColor2: string;
|
|
303
|
-
grayColor3: string;
|
|
304
|
-
grayColor4: string;
|
|
305
|
-
grayColor5: string;
|
|
306
|
-
grayColor6: string;
|
|
307
|
-
grayColor7: string;
|
|
308
|
-
grayColor8: string;
|
|
309
|
-
grayColor9: string;
|
|
310
|
-
grayColor10: string;
|
|
311
|
-
grayColor11: string;
|
|
312
|
-
grayColor12: string;
|
|
313
|
-
|
|
314
|
-
accentColor1: string;
|
|
315
|
-
accentColor2: string;
|
|
316
|
-
accentColor3: string;
|
|
317
|
-
accentColor4: string;
|
|
318
|
-
accentColor5: string;
|
|
319
|
-
accentColor6: string;
|
|
320
|
-
accentColor7: string;
|
|
321
|
-
accentColor8: string;
|
|
322
|
-
accentColor9: string;
|
|
323
|
-
accentColor10: string;
|
|
324
|
-
accentColor11: string;
|
|
325
|
-
accentColor12: string;
|
|
326
|
-
|
|
327
|
-
canvasBackground: string;
|
|
328
|
-
canvasBoundaryBackground: string;
|
|
329
|
-
|
|
330
|
-
tableBackground: string;
|
|
331
|
-
tableSelect: string;
|
|
332
|
-
tableBorder: string;
|
|
333
|
-
|
|
334
|
-
memoBackground: string;
|
|
335
|
-
memoSelect: string;
|
|
336
|
-
memoBorder: string;
|
|
337
|
-
|
|
338
|
-
columnSelect: string;
|
|
339
|
-
columnHover: string;
|
|
340
|
-
|
|
341
|
-
relationshipHover: string;
|
|
342
|
-
|
|
343
|
-
toolbarBackground: string;
|
|
344
|
-
|
|
345
|
-
contextMenuBackground: string;
|
|
346
|
-
contextMenuSelect: string;
|
|
347
|
-
contextMenuHover: string;
|
|
348
|
-
contextMenuBorder: string;
|
|
349
|
-
|
|
350
|
-
minimapBorder: string;
|
|
351
|
-
minimapShadow: string;
|
|
352
|
-
minimapViewportBorder: string;
|
|
353
|
-
minimapViewportBorderHover: string;
|
|
354
|
-
|
|
355
|
-
toastBackground: string;
|
|
356
|
-
toastBorder: string;
|
|
357
|
-
|
|
358
|
-
dargSelectBackground: string;
|
|
359
|
-
dargSelectBorder: string;
|
|
360
|
-
|
|
361
|
-
scrollbarTrack: string;
|
|
362
|
-
scrollbarThumb: string;
|
|
363
|
-
scrollbarThumbHover: string;
|
|
364
|
-
|
|
365
|
-
foreground: string;
|
|
366
|
-
active: string;
|
|
367
|
-
placeholder: string;
|
|
368
|
-
|
|
369
|
-
focus: string;
|
|
370
|
-
inputActive: string;
|
|
371
|
-
|
|
372
|
-
keyPK: string;
|
|
373
|
-
keyFK: string;
|
|
374
|
-
keyPFK: string;
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
// example
|
|
379
|
-
editor.setTheme({...});
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
#### CSS Variables
|
|
383
|
-
|
|
384
|
-
```css
|
|
385
|
-
:root {
|
|
386
|
-
--erd-editor-gray-color-1: #111113;
|
|
387
|
-
--erd-editor-gray-color-2: #18191b;
|
|
388
|
-
--erd-editor-gray-color-3: #212225;
|
|
389
|
-
--erd-editor-gray-color-4: #272a2d;
|
|
390
|
-
--erd-editor-gray-color-5: #2e3135;
|
|
391
|
-
--erd-editor-gray-color-6: #363a3f;
|
|
392
|
-
--erd-editor-gray-color-7: #43484e;
|
|
393
|
-
--erd-editor-gray-color-8: #5a6169;
|
|
394
|
-
--erd-editor-gray-color-9: #696e77;
|
|
395
|
-
--erd-editor-gray-color-10: #777b84;
|
|
396
|
-
--erd-editor-gray-color-11: #b0b4ba;
|
|
397
|
-
--erd-editor-gray-color-12: #edeef0;
|
|
398
|
-
--erd-editor-accent-color-1: #11131f;
|
|
399
|
-
--erd-editor-accent-color-2: #141726;
|
|
400
|
-
--erd-editor-accent-color-3: #182449;
|
|
401
|
-
--erd-editor-accent-color-4: #1d2e62;
|
|
402
|
-
--erd-editor-accent-color-5: #253974;
|
|
403
|
-
--erd-editor-accent-color-6: #304384;
|
|
404
|
-
--erd-editor-accent-color-7: #3a4f97;
|
|
405
|
-
--erd-editor-accent-color-8: #435db1;
|
|
406
|
-
--erd-editor-accent-color-9: #3e63dd;
|
|
407
|
-
--erd-editor-accent-color-10: #5472e4;
|
|
408
|
-
--erd-editor-accent-color-11: #9eb1ff;
|
|
409
|
-
--erd-editor-accent-color-12: #d6e1ff;
|
|
410
|
-
--erd-editor-canvas-background: #212225;
|
|
411
|
-
--erd-editor-canvas-boundary-background: #111113;
|
|
412
|
-
--erd-editor-table-background: #18191b;
|
|
413
|
-
--erd-editor-table-select: #435db1;
|
|
414
|
-
--erd-editor-table-border: #363a3f;
|
|
415
|
-
--erd-editor-memo-background: #18191b;
|
|
416
|
-
--erd-editor-memo-select: #435db1;
|
|
417
|
-
--erd-editor-memo-border: #363a3f;
|
|
418
|
-
--erd-editor-column-select: #2e3135;
|
|
419
|
-
--erd-editor-column-hover: #272a2d;
|
|
420
|
-
--erd-editor-relationship-hover: #435db1;
|
|
421
|
-
--erd-editor-toolbar-background: #111113;
|
|
422
|
-
--erd-editor-context-menu-background: #18191b;
|
|
423
|
-
--erd-editor-context-menu-select: #272a2d;
|
|
424
|
-
--erd-editor-context-menu-hover: #3a4f97;
|
|
425
|
-
--erd-editor-context-menu-border: #363a3f;
|
|
426
|
-
--erd-editor-minimap-border: black;
|
|
427
|
-
--erd-editor-minimap-shadow: black;
|
|
428
|
-
--erd-editor-minimap-viewport-border: #3a4f97;
|
|
429
|
-
--erd-editor-minimap-viewport-border-hover: #435db1;
|
|
430
|
-
--erd-editor-toast-background: #18191b;
|
|
431
|
-
--erd-editor-toast-border: #363a3f;
|
|
432
|
-
--erd-editor-darg-select-background: #253974;
|
|
433
|
-
--erd-editor-darg-select-border: #435db1;
|
|
434
|
-
--erd-editor-scrollbar-track: #ddeaf814;
|
|
435
|
-
--erd-editor-scrollbar-thumb: #696e77;
|
|
436
|
-
--erd-editor-scrollbar-thumb-hover: #777b84;
|
|
437
|
-
--erd-editor-foreground: #b0b4ba;
|
|
438
|
-
--erd-editor-active: #edeef0;
|
|
439
|
-
--erd-editor-placeholder: #e5edfd7b;
|
|
440
|
-
--erd-editor-focus: #435db1;
|
|
441
|
-
--erd-editor-input-active: #5472e4;
|
|
442
|
-
--erd-editor-key-pk: #ffc53d;
|
|
443
|
-
--erd-editor-key-fk: #e54666;
|
|
444
|
-
--erd-editor-key-pfk: #00a2c7;
|
|
445
|
-
}
|
|
446
|
-
```
|
|
447
|
-
|
|
448
|
-
## setSchemaSQL
|
|
449
|
-
|
|
450
|
-
Loads a schema SQL file.
|
|
451
|
-
|
|
452
|
-
```js
|
|
453
|
-
editor.setSchemaSQL('Schema SQL...');
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
## getSchemaSQL
|
|
457
|
-
|
|
458
|
-
Extracts the current editor state into a schema SQL.
|
|
459
|
-
If `databaseVendor` is not specified, it operates based on the currently set vendor.
|
|
460
|
-
|
|
461
|
-
```ts
|
|
462
|
-
type DatabaseVendor =
|
|
463
|
-
| 'MariaDB'
|
|
464
|
-
| 'MSSQL'
|
|
465
|
-
| 'MySQL'
|
|
466
|
-
| 'Oracle'
|
|
467
|
-
| 'PostgreSQL'
|
|
468
|
-
| 'SQLite';
|
|
469
|
-
|
|
470
|
-
const schemaSQL = editor.getSchemaSQL();
|
|
471
|
-
```
|
|
472
|
-
|
|
473
|
-
# Document
|
|
46
|
+
## [Document](https://docs.erd-editor.io)
|
|
474
47
|
|
|
475
48
|
- [Web App](https://erd-editor.io)
|
|
476
49
|
- [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=dineug.vuerd-vscode)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Subject } from 'rxjs';
|
|
2
|
-
import { Actions } from
|
|
3
|
-
import { EngineContext, InjectEngineContext } from
|
|
4
|
-
import { RxStore } from
|
|
5
|
-
import { Ctx } from
|
|
6
|
-
import { Emitter } from
|
|
7
|
-
import { KeyBindingMap, KeyBindingName } from
|
|
2
|
+
import { Actions } from '../engine/actions';
|
|
3
|
+
import { EngineContext, InjectEngineContext } from '../engine/context';
|
|
4
|
+
import { RxStore, RxStoreOptions } from '../engine/rx-store';
|
|
5
|
+
import { Ctx } from '../internal-types';
|
|
6
|
+
import { Emitter } from '../utils/emitter';
|
|
7
|
+
import { KeyBindingMap, KeyBindingName } from '../utils/keyboard-shortcut';
|
|
8
8
|
export type AppContext = EngineContext & {
|
|
9
9
|
actions: Actions;
|
|
10
10
|
store: RxStore;
|
|
@@ -17,6 +17,7 @@ export type AppContext = EngineContext & {
|
|
|
17
17
|
emitter: Emitter;
|
|
18
18
|
};
|
|
19
19
|
export type InjectAppContext = InjectEngineContext;
|
|
20
|
-
export declare function createAppContext(ctx: InjectAppContext,
|
|
20
|
+
export declare function createAppContext(ctx: InjectAppContext, options?: RxStoreOptions): AppContext;
|
|
21
21
|
export declare const appContext: import("@dineug/r-html").Context<AppContext>;
|
|
22
22
|
export declare const useAppContext: (ctx: Ctx, fallback?: AppContext) => import("@dineug/r-html").Ref<AppContext>;
|
|
23
|
+
export declare function appDestroy(app: AppContext): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./erd-editor/ErdEditor";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { FC, Ref } from '@dineug/r-html';
|
|
2
|
-
import { AppContext } from
|
|
2
|
+
import { AppContext } from '../../appContext';
|
|
3
3
|
export type AutomaticTablePlacementProps = {
|
|
4
4
|
app: Ref<AppContext>;
|
|
5
|
-
root: Ref<HTMLDivElement>;
|
|
6
5
|
onChange: (tables: TablePoint[]) => void;
|
|
7
6
|
};
|
|
8
7
|
export type TablePoint = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from '@dineug/r-html';
|
|
2
|
-
import { Relationship as RelationshipType } from
|
|
2
|
+
import { Relationship as RelationshipType } from '../../../../../internal-types';
|
|
3
3
|
export type RelationshipProps = {
|
|
4
4
|
relationship: RelationshipType;
|
|
5
5
|
strokeWidth: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DOMTemplateLiterals } from '@dineug/r-html';
|
|
2
|
-
import { RelationshipPath } from
|
|
2
|
+
import { RelationshipPath } from '../../../../../utils/draw-relationship';
|
|
3
3
|
export declare function relationshipShape(relationshipType: number, relationshipPath: RelationshipPath): DOMTemplateLiterals | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC, Ref } from '@dineug/r-html';
|
|
2
|
-
import { DrawRelationship as DrawRelationshipType } from
|
|
2
|
+
import { DrawRelationship as DrawRelationshipType } from '../../../../engine/modules/editor/state';
|
|
3
3
|
export type DrawRelationshipProps = {
|
|
4
4
|
root: Ref<HTMLDivElement>;
|
|
5
5
|
draw: DrawRelationshipType;
|
package/dist/components/erd/canvas/shared-mouse-tracker/shared-mouse-cursor/SharedMouseCursor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from '@dineug/r-html';
|
|
2
|
-
import { SharedMouseTracker } from
|
|
2
|
+
import { SharedMouseTracker } from '../../../../../engine/modules/editor/state';
|
|
3
3
|
export type SharedMouseCursorProps = {
|
|
4
4
|
tracker: SharedMouseTracker;
|
|
5
5
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC, Ref } from '@dineug/r-html';
|
|
2
|
-
import { AppContext } from
|
|
3
|
-
import { Column } from
|
|
2
|
+
import { AppContext } from '../../../../appContext';
|
|
3
|
+
import { Column } from '../../../../../internal-types';
|
|
4
4
|
export type ColumnProps = {
|
|
5
5
|
app: Ref<AppContext>;
|
|
6
6
|
column: Column;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FocusType } from
|
|
2
|
-
import { Ctx } from
|
|
1
|
+
import { FocusType } from '../../../../engine/modules/editor/state';
|
|
2
|
+
import { Ctx } from '../../../../internal-types';
|
|
3
3
|
export declare function useFocusTable(ctx: Ctx, tableId: string): {
|
|
4
4
|
hasFocus: (focusType: FocusType, columnId?: string) => boolean;
|
|
5
5
|
hasEdit: (focusType: FocusType, columnId?: string) => boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC, Ref } from '@dineug/r-html';
|
|
2
|
+
import { AppContext } from '../../appContext';
|
|
3
|
+
export type DiffViewerProps = {
|
|
4
|
+
app: Ref<AppContext>;
|
|
5
|
+
initialValue: string;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
};
|
|
8
|
+
declare const DiffViewer: FC<DiffViewerProps>;
|
|
9
|
+
export default DiffViewer;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RootState } from '../../../engine/state';
|
|
2
|
+
import { Column, Table } from '../../../internal-types';
|
|
3
|
+
/**
|
|
4
|
+
* Map<uuid, [tag, Map<path, diff>]>
|
|
5
|
+
*/
|
|
6
|
+
export type DiffMap = Map<string, DiffTuple>;
|
|
7
|
+
type DiffTuple = [string, Map<string, number>];
|
|
8
|
+
type NameToTableMap = Map<string, {
|
|
9
|
+
table: Table;
|
|
10
|
+
nameToColumnMap: Map<string, Column>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const Diff: {
|
|
13
|
+
readonly insert: 1;
|
|
14
|
+
readonly delete: 2;
|
|
15
|
+
};
|
|
16
|
+
export declare function diffState(prevState: RootState, state: RootState): [DiffMap, DiffMap];
|
|
17
|
+
export declare function getNameToTableMap({ doc: { tableIds }, collections, }: RootState): NameToTableMap;
|
|
18
|
+
export declare function getDiffStyle(diff: number, diffMap: DiffMap): HTMLStyleElement;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from '@dineug/r-html';
|
|
2
|
+
import { AppContext } from '../../../appContext';
|
|
3
|
+
import { DiffMap } from '../diff';
|
|
4
|
+
export type ErdViewerProps = {
|
|
5
|
+
app: AppContext;
|
|
6
|
+
diff: number;
|
|
7
|
+
diffMap: DiffMap;
|
|
8
|
+
};
|
|
9
|
+
declare const ErdViewer: FC<ErdViewerProps>;
|
|
10
|
+
export default ErdViewer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const root: import("@dineug/r-html").CSSTemplateLiterals;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from '@dineug/r-html';
|
|
2
|
+
import { AppContext } from '../../../appContext';
|
|
3
|
+
import { DiffMap } from '../diff';
|
|
4
|
+
export type TreeViewerProps = {
|
|
5
|
+
prevApp: AppContext;
|
|
6
|
+
prevDiffMap: DiffMap;
|
|
7
|
+
app: AppContext;
|
|
8
|
+
diffMap: DiffMap;
|
|
9
|
+
};
|
|
10
|
+
declare const TreeViewer: FC<TreeViewerProps>;
|
|
11
|
+
export default TreeViewer;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const root: import("@dineug/r-html").CSSTemplateLiterals;
|
|
2
|
+
export declare const icon: import("@dineug/r-html").CSSTemplateLiterals;
|
|
3
|
+
export declare const table: import("@dineug/r-html").CSSTemplateLiterals;
|
|
4
|
+
export declare const column: import("@dineug/r-html").CSSTemplateLiterals;
|
|
5
|
+
export declare const ellipsis: import("@dineug/r-html").CSSTemplateLiterals;
|