@dineug/erd-editor 3.3.1 → 3.4.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.
Files changed (119) hide show
  1. package/README.md +197 -17
  2. package/dist/components/erd/canvas/altDragDuplicate.d.ts +3 -0
  3. package/dist/components/erd/canvas/duplicate-ghost/DuplicateGhost.d.ts +4 -0
  4. package/dist/components/erd/canvas/duplicate-ghost/DuplicateGhost.styles.d.ts +2 -0
  5. package/dist/components/erd/canvas/shared-drag-select/SharedDragSelect.d.ts +4 -0
  6. package/dist/components/erd/canvas/table/column/Column.d.ts +7 -0
  7. package/dist/components/erd/canvas/table/column/column-data-type/ColumnDataType.d.ts +3 -3
  8. package/dist/components/erd/canvas/table/column/column-not-null/ColumnNotNull.d.ts +1 -1
  9. package/dist/components/erd/canvas/table/column/column-option/ColumnOption.d.ts +1 -1
  10. package/dist/components/erd/canvas/table/useSharedFocusTable.d.ts +6 -0
  11. package/dist/components/erd/canvas/useSharedSelectEntity.d.ts +4 -0
  12. package/dist/components/erd/erd-context-menu/menus/drawRelationshipMenus.d.ts +3 -2
  13. package/dist/components/erd/erd-context-menu/menus/exportMenus.d.ts +6 -6
  14. package/dist/components/erd/erd-context-menu/menus/importMenus.d.ts +6 -6
  15. package/dist/components/erd/erd-context-menu/menus/relationshipMenus.d.ts +1 -1
  16. package/dist/components/erd/table-properties/table-properties-indexes/indexes-checkbox-column/IndexesCheckboxColumn.d.ts +1 -1
  17. package/dist/components/erd-editor/ErdEditor.d.ts +4 -0
  18. package/dist/components/erd-editor/ErdEditor.stories.d.ts +1 -1
  19. package/dist/components/global-styles/GlobalStyles.d.ts +14 -0
  20. package/dist/components/primitives/button/Button.stories.d.ts +4 -4
  21. package/dist/components/primitives/code-block/CodeBlock.stories.d.ts +4 -4
  22. package/dist/components/primitives/code-block/CodeBlock.styles.d.ts +6 -1
  23. package/dist/components/primitives/color-picker/ColorPicker.d.ts +1 -1
  24. package/dist/components/primitives/color-picker/ColorPicker.stories.d.ts +1 -1
  25. package/dist/components/primitives/context-menu/ContextMenu.stories.d.ts +1 -1
  26. package/dist/components/primitives/context-menu/context-menu-item/ContextMenuItem.d.ts +1 -1
  27. package/dist/components/primitives/context-menu/menu/Menu.d.ts +2 -2
  28. package/dist/components/primitives/edit-input/EditInput.d.ts +2 -2
  29. package/dist/components/primitives/edit-input/EditInput.stories.d.ts +6 -6
  30. package/dist/components/primitives/highlighted-text/HighlightedText.stories.d.ts +1 -1
  31. package/dist/components/primitives/icon/Icon.d.ts +2 -3
  32. package/dist/components/primitives/icon/Icon.stories.d.ts +3 -1
  33. package/dist/components/primitives/icon/icons.d.ts +59 -15
  34. package/dist/components/primitives/kbd/Kbd.stories.d.ts +3 -3
  35. package/dist/components/primitives/sash/Sash.stories.d.ts +5 -5
  36. package/dist/components/primitives/separator/Separator.stories.d.ts +3 -3
  37. package/dist/components/primitives/slider/Slider.stories.d.ts +4 -4
  38. package/dist/components/primitives/switch/Switch.stories.d.ts +3 -3
  39. package/dist/components/primitives/text-input/TextInput.d.ts +1 -1
  40. package/dist/components/primitives/text-input/TextInput.stories.d.ts +7 -7
  41. package/dist/components/primitives/toast/Toast.stories.d.ts +4 -4
  42. package/dist/constants/language.d.ts +7 -1
  43. package/dist/constants/layout.d.ts +20 -0
  44. package/dist/constants/schema.d.ts +11 -2
  45. package/dist/constants/sql/dataType/Databricks.d.ts +5 -0
  46. package/dist/constants/sql/dataType/MSSQL.d.ts +1 -1
  47. package/dist/constants/sql/dataType/MySQL.d.ts +1 -1
  48. package/dist/constants/sql/dataType/Oracle.d.ts +1 -1
  49. package/dist/constants/sql/dataType/Snowflake.d.ts +5 -0
  50. package/dist/constants/sql/database.d.ts +2 -0
  51. package/dist/engine/history.d.ts +5 -3
  52. package/dist/engine/hooks.d.ts +3 -3
  53. package/dist/engine/modules/editor/actions.d.ts +18 -1
  54. package/dist/engine/modules/editor/atom.actions.d.ts +78 -0
  55. package/dist/engine/modules/editor/generator.actions.d.ts +18 -0
  56. package/dist/engine/modules/editor/state.d.ts +23 -0
  57. package/dist/engine/modules/editor/utils/duplicate.d.ts +13 -0
  58. package/dist/engine/modules/memo/actions.d.ts +3 -0
  59. package/dist/engine/modules/memo/atom.actions.d.ts +12 -0
  60. package/dist/engine/modules/table/actions.d.ts +1 -0
  61. package/dist/engine/modules/table/atom.actions.d.ts +4 -0
  62. package/dist/engine.js +40 -51
  63. package/dist/erd-editor.js +30677 -26598
  64. package/dist/schemaGCService-DAGNq0wk.js +17092 -0
  65. package/dist/services/shikiService.d.ts +1 -1
  66. package/dist/styles/colorPicker.style.d.ts +10 -1
  67. package/dist/styles/fonts.styles.d.ts +2 -1
  68. package/dist/styles/reset.styles.d.ts +5 -1
  69. package/dist/styles/scrollbar.styles.d.ts +6 -1
  70. package/dist/styles/typography.styles.d.ts +2 -1
  71. package/dist/themes/radix-ui-theme.d.ts +1 -1
  72. package/dist/themes/tokens.d.ts +2 -2
  73. package/dist/utils/calcTable.d.ts +7 -0
  74. package/dist/utils/draw-relationship/chamfer.d.ts +2 -0
  75. package/dist/utils/draw-relationship/index.d.ts +73 -14
  76. package/dist/utils/draw-relationship/nudge.d.ts +3 -0
  77. package/dist/utils/draw-relationship/pathFinding.d.ts +9 -1
  78. package/dist/utils/draw-relationship/route.d.ts +32 -0
  79. package/dist/utils/draw-relationship/stub.d.ts +47 -0
  80. package/dist/utils/emitter.d.ts +16 -0
  81. package/dist/utils/file/importFile.d.ts +4 -1
  82. package/dist/utils/focus.d.ts +4 -2
  83. package/dist/utils/generator-code/aml.d.ts +4 -0
  84. package/dist/utils/generator-code/dbml.d.ts +4 -0
  85. package/dist/utils/generator-code/drizzle.d.ts +4 -0
  86. package/dist/utils/generator-code/go.d.ts +4 -0
  87. package/dist/utils/generator-code/sequelize.d.ts +4 -0
  88. package/dist/utils/generator-code/sqlalchemy.d.ts +4 -0
  89. package/dist/utils/generator-code/typeorm.d.ts +4 -0
  90. package/dist/utils/keyboard-shortcut/index.d.ts +1 -1
  91. package/dist/utils/promise.d.ts +1 -0
  92. package/dist/utils/schema-aml-parser/convert.d.ts +4 -0
  93. package/dist/utils/schema-aml-parser/dataType.d.ts +13 -0
  94. package/dist/utils/schema-aml-parser/index.d.ts +3 -0
  95. package/dist/utils/schema-aml-parser/parser.d.ts +2 -0
  96. package/dist/utils/schema-aml-parser/tokenizer.d.ts +25 -0
  97. package/dist/utils/schema-aml-parser/types.d.ts +79 -0
  98. package/dist/utils/schema-dbml-parser/convert.d.ts +4 -0
  99. package/dist/utils/schema-dbml-parser/dataType.d.ts +7 -0
  100. package/dist/utils/schema-dbml-parser/index.d.ts +3 -0
  101. package/dist/utils/schema-dbml-parser/parser.d.ts +2 -0
  102. package/dist/utils/schema-dbml-parser/tokenizer.d.ts +16 -0
  103. package/dist/utils/schema-dbml-parser/types.d.ts +62 -0
  104. package/dist/utils/schema-graphql-parser/convert.d.ts +4 -0
  105. package/dist/utils/schema-graphql-parser/dataType.d.ts +7 -0
  106. package/dist/utils/schema-graphql-parser/index.d.ts +3 -0
  107. package/dist/utils/schema-graphql-parser/parser.d.ts +2 -0
  108. package/dist/utils/schema-graphql-parser/types.d.ts +58 -0
  109. package/dist/utils/schema-sql/Databricks.d.ts +5 -0
  110. package/dist/utils/schema-sql/Snowflake.d.ts +5 -0
  111. package/dist/utils/sharedColor.d.ts +2 -0
  112. package/dist/utils/table-clipboard/copy.d.ts +7 -0
  113. package/dist/utils/table-clipboard/index.d.ts +2 -0
  114. package/dist/utils/table-clipboard/paste.d.ts +3 -0
  115. package/dist/utils/table-clipboard/payload.d.ts +83 -0
  116. package/dist/utils/table-clipboard/placement.d.ts +30 -0
  117. package/dist/utils/validation.d.ts +1 -0
  118. package/package.json +29 -25
  119. package/dist/schemaGCService-Br6jn6B2.js +0 -15866
@@ -1,4 +1,6 @@
1
+ import { IconNode } from 'lucide';
1
2
  import { ValuesType } from '../../../internal-types';
3
+ /** Raster crow's-foot notation; `@/utils/icon` reads the data URIs back as strings. */
2
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NDQwRjc3NjQ4M0MxMUU3QkRBMDg1MDlCNjg0QjgzMCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkbQDKwAAAGjSURBVHja7Jcxb4JQEMefLl272cjSUbYu0g+gSVemdpPZwKzRRSf4AGg70k8AfACTdqx+ibYJLp2MfoDr/wg0vJp2Al6TeskFeQ+4e/fufvdsEJFQKU2hWE4OKHeg0el0TlugQi6h5+kW1MkBXddbuMw0TRvu93txOBwumjUaH+Hy4jjOcLVaCcuyeHgmOAJVKpLcgAaDwYCSJKGi9Hq9yo273W6XwjCUDCP8NJlMCPP3VRm+hT6xETZWlCiKiJ3CvJfmX8mGW7wqDu16vZYMb7db4m3A/CP0On+HQTRHMpRVCiaS7Mq2bWlwuVyKxWLxjp/BEQkxQWWVYr/fF9/JipALrP5nFJPiA0EagbI+BsAI0zSlMV59HMe/NqN5mYg1DMPyPE+02+2vwc1mI6bTKTvzgNsP6Y0KSnAMfctySxLf97kKXqGj/PmqOJCWI7aDsHrJCaZhVo4BU7JqEt5Bn13XPQIS05GBVEcvOGPqsTE0IQnHtThQcOQGGnP4mYpZL/Bqc6CYpFkvGOcoVsEfPg3tVB7Jdn/nWH76b/jvHfgUYADeZNmzPgOYQQAAAABJRU5ErkJggg==";
13
15
  };
14
16
  export type BASE_64_ICON = ValuesType<typeof BASE_64_ICON>;
15
- export interface IconDefinition {
16
- prefix: string;
17
- iconName: string;
18
- icon: [
19
- number,
20
- number,
21
- // height
22
- string[] | undefined,
23
- // ligatures
24
- string | undefined,
25
- string
26
- ];
27
- }
28
- export declare const iconMap: Record<string, IconDefinition>;
29
- export declare function getIcon(prefix: string, iconName: string): IconDefinition | undefined;
17
+ export declare const ICON_VIEW_BOX = "0 0 24 24";
18
+ export type IconNodeChild = IconNode[number];
19
+ declare const SVG_ICON: {
20
+ atom: IconNode;
21
+ braces: IconNode;
22
+ brackets: IconNode;
23
+ 'case-sensitive': IconNode;
24
+ check: IconNode;
25
+ 'chevron-right': IconNode;
26
+ code: IconNode;
27
+ contrast: IconNode;
28
+ copy: IconNode;
29
+ database: IconNode;
30
+ diff: IconNode;
31
+ eye: IconNode;
32
+ 'file-diff': IconNode;
33
+ 'file-image': IconNode;
34
+ 'file-input': IconNode;
35
+ 'file-output': IconNode;
36
+ 'grip-vertical': IconNode;
37
+ 'key-round': IconNode;
38
+ 'map-pin': IconNode;
39
+ minus: IconNode;
40
+ 'moon-star': IconNode;
41
+ 'mouse-pointer-2': IconNode;
42
+ palette: IconNode;
43
+ plus: IconNode;
44
+ 'redo-2': IconNode;
45
+ 'refresh-cw': IconNode;
46
+ 'rotate-ccw-clock': IconNode;
47
+ search: IconNode;
48
+ settings: IconNode;
49
+ 'share-2': IconNode;
50
+ spline: IconNode;
51
+ 'sticky-note': IconNode;
52
+ sun: IconNode;
53
+ table: IconNode;
54
+ 'table-properties': IconNode;
55
+ 'undo-2': IconNode;
56
+ workflow: IconNode;
57
+ x: IconNode;
58
+ };
59
+ export type SvgIconName = keyof typeof SVG_ICON;
60
+ export type Base64IconName = keyof typeof BASE_64_ICON;
61
+ export type IconName = SvgIconName | Base64IconName;
62
+ export type IconDefinition = {
63
+ type: 'svg';
64
+ name: SvgIconName;
65
+ node: IconNode;
66
+ } | {
67
+ type: 'base64';
68
+ name: Base64IconName;
69
+ src: string;
70
+ };
71
+ export declare const iconMap: Record<IconName, IconDefinition>;
72
+ export declare function getIcon(name: string): IconDefinition | undefined;
73
+ export {};
@@ -1,14 +1,14 @@
1
- import { StoryObj } from '@storybook/html';
1
+ import { StoryObj } from '@storybook/html-vite';
2
2
  import { KbdProps } from './Kbd';
3
3
  declare const meta: {
4
4
  title: string;
5
5
  render: (args: KbdProps) => DocumentFragment;
6
6
  argTypes: {
7
7
  shortcut: {
8
- control: string;
8
+ control: "text";
9
9
  };
10
10
  mini: {
11
- control: string;
11
+ control: "boolean";
12
12
  };
13
13
  };
14
14
  };
@@ -1,4 +1,4 @@
1
- import { StoryObj } from '@storybook/html';
1
+ import { StoryObj } from '@storybook/html-vite';
2
2
  import { SashProps } from './Sash';
3
3
  declare const meta: {
4
4
  title: string;
@@ -6,17 +6,17 @@ declare const meta: {
6
6
  argTypes: {
7
7
  type: {
8
8
  options: ("vertical" | "horizontal" | "edge")[];
9
- control: string;
9
+ control: "radio";
10
10
  };
11
11
  cursor: {
12
12
  options: ("default" | "ew-resize" | "ns-resize" | "nesw-resize" | "nwse-resize")[];
13
- control: string;
13
+ control: "select";
14
14
  };
15
15
  top: {
16
- control: string;
16
+ control: "number";
17
17
  };
18
18
  left: {
19
- control: string;
19
+ control: "number";
20
20
  };
21
21
  onMove: {
22
22
  action: string;
@@ -1,4 +1,4 @@
1
- import { StoryObj } from '@storybook/html';
1
+ import { StoryObj } from '@storybook/html-vite';
2
2
  import { SeparatorProps } from './Separator';
3
3
  declare const meta: {
4
4
  title: string;
@@ -6,14 +6,14 @@ declare const meta: {
6
6
  argTypes: {
7
7
  space: {
8
8
  control: {
9
- type: string;
9
+ type: "range";
10
10
  min: number;
11
11
  max: number;
12
12
  };
13
13
  };
14
14
  padding: {
15
15
  control: {
16
- type: string;
16
+ type: "range";
17
17
  min: number;
18
18
  max: number;
19
19
  };
@@ -1,17 +1,17 @@
1
- import { StoryObj } from '@storybook/html';
1
+ import { StoryObj } from '@storybook/html-vite';
2
2
  import { SliderProps } from './Slider';
3
3
  declare const meta: {
4
4
  title: string;
5
5
  render: (args: SliderProps) => DocumentFragment;
6
6
  argTypes: {
7
7
  min: {
8
- control: string;
8
+ control: "number";
9
9
  };
10
10
  max: {
11
- control: string;
11
+ control: "number";
12
12
  };
13
13
  value: {
14
- control: string;
14
+ control: "number";
15
15
  };
16
16
  onChange: {
17
17
  action: string;
@@ -1,15 +1,15 @@
1
- import { StoryObj } from '@storybook/html';
1
+ import { StoryObj } from '@storybook/html-vite';
2
2
  import { SwitchProps } from './Switch';
3
3
  declare const meta: {
4
4
  title: string;
5
5
  render: (args: SwitchProps) => DocumentFragment;
6
6
  argTypes: {
7
7
  size: {
8
- control: string;
8
+ control: "radio";
9
9
  options: string[];
10
10
  };
11
11
  value: {
12
- control: string;
12
+ control: "boolean";
13
13
  };
14
14
  onChange: {
15
15
  action: string;
@@ -10,7 +10,7 @@ export type TextInputProps = {
10
10
  numberOnly?: boolean;
11
11
  autofocus?: boolean;
12
12
  onInput?: (event: InputEvent) => void;
13
- onChange?: (event: InputEvent) => void;
13
+ onChange?: (event: Event) => void;
14
14
  onBlur?: (event: FocusEvent) => void;
15
15
  onKeyup?: (event: KeyboardEvent) => void;
16
16
  onKeydown?: (event: KeyboardEvent) => void;
@@ -1,26 +1,26 @@
1
- import { StoryObj } from '@storybook/html';
1
+ import { StoryObj } from '@storybook/html-vite';
2
2
  import { TextInputProps } from './TextInput';
3
3
  declare const meta: {
4
4
  title: string;
5
5
  render: (args: TextInputProps) => DocumentFragment;
6
6
  argTypes: {
7
7
  title: {
8
- control: string;
8
+ control: "text";
9
9
  };
10
10
  placeholder: {
11
- control: string;
11
+ control: "text";
12
12
  };
13
13
  readonly: {
14
- control: string;
14
+ control: "boolean";
15
15
  };
16
16
  width: {
17
- control: string;
17
+ control: "number";
18
18
  };
19
19
  value: {
20
- control: string;
20
+ control: "text";
21
21
  };
22
22
  numberOnly: {
23
- control: string;
23
+ control: "boolean";
24
24
  };
25
25
  onInput: {
26
26
  action: string;
@@ -1,17 +1,17 @@
1
- import { StoryObj } from '@storybook/html';
1
+ import { StoryObj } from '@storybook/html-vite';
2
2
  import { ToastProps } from './Toast';
3
3
  declare const meta: {
4
4
  title: string;
5
5
  render: (args: ToastProps) => DocumentFragment;
6
6
  argTypes: {
7
7
  title: {
8
- control: string;
8
+ control: "text";
9
9
  };
10
10
  description: {
11
- control: string;
11
+ control: "text";
12
12
  };
13
13
  action: {
14
- control: string;
14
+ control: "text";
15
15
  };
16
16
  };
17
17
  };
@@ -1 +1,7 @@
1
- export declare const LanguageToLangMap: Record<number, string>;
1
+ /**
2
+ * Shiki grammar names. Spelled out rather than left as `string`, which is what
3
+ * the annotation used to widen them to — `CodeBlock`'s `lang` is a union, and
4
+ * widening here meant nothing checked that these were members of it.
5
+ */
6
+ export type Lang = 'csharp' | 'go' | 'graphql' | 'java' | 'kotlin' | 'python' | 'scala' | 'sql' | 'typescript';
7
+ export declare const LanguageToLangMap: Record<number, Lang>;
@@ -1,6 +1,7 @@
1
1
  export declare const START_X = 200;
2
2
  export declare const START_Y = 100;
3
3
  export declare const START_ADD = 50;
4
+ export declare const DUPLICATE_MIN_MOVE = 4;
4
5
  export declare const DEFAULT_WIDTH = 1200;
5
6
  export declare const DEFAULT_HEIGHT: number;
6
7
  export declare const INPUT_HEIGHT = 20;
@@ -31,3 +32,22 @@ export declare const MINIMAP_SIZE = 150;
31
32
  export declare const MINIMAP_MARGIN = 20;
32
33
  export declare const TOOLBAR_HEIGHT = 30;
33
34
  export declare const DIFF_TREE_WIDTH = 200;
35
+ /**
36
+ * How thick a relationship connector is drawn.
37
+ *
38
+ * Down from 3: the thick line ate the gap between neighbouring tables and made a
39
+ * busy diagram read as a mass of strokes rather than as connections. A whole
40
+ * number rather than 1.5, so the stroke lands on pixel boundaries instead of
41
+ * being spread across two rows at partial alpha on a 1x display.
42
+ */
43
+ export declare const RELATIONSHIP_STROKE_WIDTH = 2;
44
+ /**
45
+ * The width of the invisible band that catches the pointer for a connector.
46
+ *
47
+ * Hit-testing an SVG path follows its painted stroke, so halving the stroke
48
+ * would otherwise halve the target the user has to hit to hover a relationship
49
+ * or open its context menu. `NUDGE_GAP` is 10, so a band this wide stays clear
50
+ * of the neighbouring corridor except where the router had to fall back to a
51
+ * narrower gap.
52
+ */
53
+ export declare const RELATIONSHIP_HIT_STROKE_WIDTH = 8;
@@ -34,6 +34,8 @@ export declare const Database: {
34
34
  readonly Oracle: 8;
35
35
  readonly PostgreSQL: 16;
36
36
  readonly SQLite: 32;
37
+ readonly Databricks: 64;
38
+ readonly Snowflake: 128;
37
39
  };
38
40
  export declare const DatabaseList: readonly number[];
39
41
  export declare const Language: {
@@ -44,6 +46,13 @@ export declare const Language: {
44
46
  readonly TypeScript: 16;
45
47
  readonly JPA: 32;
46
48
  readonly Scala: 64;
49
+ readonly Go: 128;
50
+ readonly SQLAlchemy: 256;
51
+ readonly TypeORM: 512;
52
+ readonly Sequelize: 1024;
53
+ readonly Drizzle: 2048;
54
+ readonly DBML: 4096;
55
+ readonly AML: 8192;
47
56
  };
48
57
  export declare const LanguageList: readonly number[];
49
58
  export declare const NameCase: {
@@ -95,8 +104,8 @@ export declare const OrderType: {
95
104
  };
96
105
  export declare const OrderTypeList: readonly number[];
97
106
  export declare const SaveSettingType: {
98
- scroll: number;
99
- zoomLevel: number;
107
+ readonly scroll: 1;
108
+ readonly zoomLevel: 2;
100
109
  };
101
110
  export declare const CANVAS_SIZE_MAX: 20000;
102
111
  export declare const CANVAS_SIZE_MIN: 2000;
@@ -0,0 +1,5 @@
1
+ import { DataTypeHint } from '.';
2
+ /**
3
+ * https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-datatypes
4
+ */
5
+ export declare const DatabricksTypes: DataTypeHint[];
@@ -1,5 +1,5 @@
1
1
  import { DataTypeHint } from '.';
2
2
  /**
3
- * https://docs.microsoft.com/ko-kr/sql/t-sql/data-types/data-types-transact-sql?view=sql-server-ver15
3
+ * https://learn.microsoft.com/en-us/sql/t-sql/data-types/data-types-transact-sql
4
4
  */
5
5
  export declare const MSSQLTypes: DataTypeHint[];
@@ -1,5 +1,5 @@
1
1
  import { DataTypeHint } from '.';
2
2
  /**
3
- * https://dev.mysql.com/doc/refman/8.0/en/data-types.html
3
+ * https://dev.mysql.com/doc/refman/8.4/en/data-types.html
4
4
  */
5
5
  export declare const MySQLTypes: DataTypeHint[];
@@ -1,5 +1,5 @@
1
1
  import { DataTypeHint } from '.';
2
2
  /**
3
- * https://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#CNCPT012
3
+ * https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html
4
4
  */
5
5
  export declare const OracleTypes: DataTypeHint[];
@@ -0,0 +1,5 @@
1
+ import { DataTypeHint } from '.';
2
+ /**
3
+ * https://docs.snowflake.com/en/sql-reference-data-types
4
+ */
5
+ export declare const SnowflakeTypes: DataTypeHint[];
@@ -1,10 +1,12 @@
1
1
  import { ValuesType } from '../../internal-types';
2
2
  export declare const DatabaseVendor: {
3
+ readonly Databricks: "Databricks";
3
4
  readonly MariaDB: "MariaDB";
4
5
  readonly MSSQL: "MSSQL";
5
6
  readonly MySQL: "MySQL";
6
7
  readonly Oracle: "Oracle";
7
8
  readonly PostgreSQL: "PostgreSQL";
9
+ readonly Snowflake: "Snowflake";
8
10
  readonly SQLite: "SQLite";
9
11
  };
10
12
  export type DatabaseVendor = ValuesType<typeof DatabaseVendor>;
@@ -1,8 +1,9 @@
1
1
  import { AnyAction } from '@dineug/r-html';
2
2
  type Dispatch = (actions: AnyAction[]) => void;
3
+ type GetNextVersion = () => number;
3
4
  export type Command = {
4
- undo: (dispatch: Dispatch) => void;
5
- redo: (dispatch: Dispatch) => void;
5
+ undo: (dispatch: Dispatch, getNextVersion: GetNextVersion) => void;
6
+ redo: (dispatch: Dispatch, getNextVersion: GetNextVersion) => void;
6
7
  };
7
8
  export type CommandKey = keyof Command;
8
9
  export type History = {
@@ -24,11 +25,12 @@ type HasHistory = {
24
25
  export type HistoryOptions = {
25
26
  notify: (has: HasHistory) => void;
26
27
  dispatch: Dispatch;
28
+ getNextVersion: GetNextVersion;
27
29
  };
28
30
  type HistoryState = {
29
31
  commands: Command[];
30
32
  cursor: number;
31
33
  limit: number;
32
34
  };
33
- export declare function createHistory({ notify, dispatch }: HistoryOptions, initialState?: HistoryState): History;
35
+ export declare function createHistory({ notify, dispatch, getNextVersion }: HistoryOptions, initialState?: HistoryState): History;
34
36
  export {};
@@ -1,8 +1,8 @@
1
- import { Channel, CoroutineCreator } from '@dineug/go';
2
1
  import { AnyAction, createAction } from '@dineug/r-html';
2
+ import { Observable, Subscription } from 'rxjs';
3
3
  import { EngineContext } from './context';
4
4
  import { RootState } from './state';
5
5
  type ActionCreator = ReturnType<typeof createAction<any>>;
6
- export type CO = (channel: Channel<AnyAction>, getState: () => RootState, ctx: EngineContext) => ReturnType<CoroutineCreator>;
7
- export type Hook = [Array<ActionCreator | string>, CO];
6
+ export type HookEffect = (action$: Observable<AnyAction>, getState: () => RootState, ctx: EngineContext) => Subscription;
7
+ export type Hook = [Array<ActionCreator | string>, HookEffect];
8
8
  export {};
@@ -2,7 +2,8 @@ import { Reducer } from '@dineug/r-html';
2
2
  import { EngineContext } from '../../context';
3
3
  import { RootState } from '../../state';
4
4
  import { LWW, ValuesType } from '../../../internal-types';
5
- import { FocusType, MoveKey, SelectType } from './state';
5
+ import { Rect } from '../../../utils/dragSelect';
6
+ import { FocusType, MoveKey, SelectType, SharedFocus } from './state';
6
7
  export declare const ActionType: {
7
8
  readonly changeHasHistory: "editor.changeHasHistory";
8
9
  readonly selectAll: "editor.selectAll";
@@ -30,6 +31,10 @@ export declare const ActionType: {
30
31
  readonly dragstartColumn: "editor.dragstartColumn";
31
32
  readonly dragendColumn: "editor.dragendColumn";
32
33
  readonly sharedMouseTracker: "editor.sharedMouseTracker";
34
+ readonly sharedFocusTracker: "editor.sharedFocusTracker";
35
+ readonly sharedSelectionTracker: "editor.sharedSelectionTracker";
36
+ readonly sharedDragSelectTracker: "editor.sharedDragSelectTracker";
37
+ readonly dragSelectRect: "editor.dragSelectRect";
33
38
  readonly validationIds: "editor.validationIds";
34
39
  readonly getLWW: "editor.getLWW";
35
40
  readonly mergeLWW: "editor.mergeLWW";
@@ -101,6 +106,18 @@ export type ActionMap = {
101
106
  x: number;
102
107
  y: number;
103
108
  };
109
+ [ActionType.sharedFocusTracker]: {
110
+ focus: SharedFocus | null;
111
+ };
112
+ [ActionType.sharedSelectionTracker]: {
113
+ selectedIds: string[];
114
+ };
115
+ [ActionType.sharedDragSelectTracker]: {
116
+ rect: Rect | null;
117
+ };
118
+ [ActionType.dragSelectRect]: {
119
+ rect: Rect | null;
120
+ };
104
121
  [ActionType.validationIds]: void;
105
122
  [ActionType.getLWW]: void;
106
123
  [ActionType.mergeLWW]: {
@@ -1,5 +1,7 @@
1
1
  import { ReducerType } from './actions';
2
2
  import { FocusType, MoveKey, SelectType } from './state';
3
+ export declare const SHARED_FOCUS_TRACKER_TIMEOUT: number;
4
+ export declare const SHARED_DRAG_SELECT_TRACKER_TIMEOUT: number;
3
5
  export declare const changeHasHistoryAction: {
4
6
  (payload: {
5
7
  hasUndo: boolean;
@@ -208,6 +210,42 @@ export declare const sharedMouseTrackerAction: {
208
210
  toString(): string;
209
211
  type: string;
210
212
  };
213
+ export declare const sharedFocusTrackerAction: {
214
+ (payload: {
215
+ focus: import('./state').SharedFocus | null;
216
+ }): import('@dineug/r-html').AnyAction<{
217
+ focus: import('./state').SharedFocus | null;
218
+ }>;
219
+ toString(): string;
220
+ type: string;
221
+ };
222
+ export declare const sharedSelectionTrackerAction: {
223
+ (payload: {
224
+ selectedIds: string[];
225
+ }): import('@dineug/r-html').AnyAction<{
226
+ selectedIds: string[];
227
+ }>;
228
+ toString(): string;
229
+ type: string;
230
+ };
231
+ export declare const sharedDragSelectTrackerAction: {
232
+ (payload: {
233
+ rect: import('../../../utils/dragSelect').Rect | null;
234
+ }): import('@dineug/r-html').AnyAction<{
235
+ rect: import('../../../utils/dragSelect').Rect | null;
236
+ }>;
237
+ toString(): string;
238
+ type: string;
239
+ };
240
+ export declare const dragSelectRectAction: {
241
+ (payload: {
242
+ rect: import('../../../utils/dragSelect').Rect | null;
243
+ }): import('@dineug/r-html').AnyAction<{
244
+ rect: import('../../../utils/dragSelect').Rect | null;
245
+ }>;
246
+ toString(): string;
247
+ type: string;
248
+ };
211
249
  export declare const validationIdsAction: {
212
250
  (payload: void): import('@dineug/r-html').AnyAction<void>;
213
251
  toString(): string;
@@ -254,6 +292,10 @@ export declare const editorReducers: {
254
292
  "editor.dragstartColumn": ReducerType<"editor.dragstartColumn">;
255
293
  "editor.dragendColumn": ReducerType<"editor.dragendColumn">;
256
294
  "editor.sharedMouseTracker": ReducerType<"editor.sharedMouseTracker">;
295
+ "editor.sharedFocusTracker": ReducerType<"editor.sharedFocusTracker">;
296
+ "editor.sharedSelectionTracker": ReducerType<"editor.sharedSelectionTracker">;
297
+ "editor.sharedDragSelectTracker": ReducerType<"editor.sharedDragSelectTracker">;
298
+ "editor.dragSelectRect": ReducerType<"editor.dragSelectRect">;
257
299
  "editor.validationIds": ReducerType<"editor.validationIds">;
258
300
  "editor.getLWW": ReducerType<"editor.getLWW">;
259
301
  "editor.mergeLWW": ReducerType<"editor.mergeLWW">;
@@ -467,6 +509,42 @@ export declare const actions: {
467
509
  toString(): string;
468
510
  type: string;
469
511
  };
512
+ sharedFocusTrackerAction: {
513
+ (payload: {
514
+ focus: import('./state').SharedFocus | null;
515
+ }): import('@dineug/r-html').AnyAction<{
516
+ focus: import('./state').SharedFocus | null;
517
+ }>;
518
+ toString(): string;
519
+ type: string;
520
+ };
521
+ sharedSelectionTrackerAction: {
522
+ (payload: {
523
+ selectedIds: string[];
524
+ }): import('@dineug/r-html').AnyAction<{
525
+ selectedIds: string[];
526
+ }>;
527
+ toString(): string;
528
+ type: string;
529
+ };
530
+ sharedDragSelectTrackerAction: {
531
+ (payload: {
532
+ rect: import('../../../utils/dragSelect').Rect | null;
533
+ }): import('@dineug/r-html').AnyAction<{
534
+ rect: import('../../../utils/dragSelect').Rect | null;
535
+ }>;
536
+ toString(): string;
537
+ type: string;
538
+ };
539
+ dragSelectRectAction: {
540
+ (payload: {
541
+ rect: import('../../../utils/dragSelect').Rect | null;
542
+ }): import('@dineug/r-html').AnyAction<{
543
+ rect: import('../../../utils/dragSelect').Rect | null;
544
+ }>;
545
+ toString(): string;
546
+ type: string;
547
+ };
470
548
  validationIdsAction: {
471
549
  (payload: void): import('@dineug/r-html').AnyAction<void>;
472
550
  toString(): string;
@@ -1,10 +1,20 @@
1
1
  import { GeneratorAction } from '../../generator.actions';
2
+ import { Point } from '../../../internal-types';
2
3
  import { Rect } from '../../../utils/dragSelect';
4
+ import { ClipboardPayload } from '../../../utils/table-clipboard';
3
5
  import { MoveKey } from './state';
4
6
  export declare const loadJsonAction$: (value: string) => GeneratorAction;
5
7
  export declare const initialLoadJsonAction$: (value: string) => GeneratorAction;
6
8
  export declare const moveAllAction$: (movementX: number, movementY: number) => GeneratorAction;
7
9
  export declare const removeSelectedAction$: () => GeneratorAction;
10
+ export type DuplicateConfig = {
11
+ tableIds?: string[];
12
+ memoIds?: string[];
13
+ offset: Point;
14
+ escapeCollision: boolean;
15
+ };
16
+ export declare const pasteEntitiesAction$: (payload: ClipboardPayload, pasteRound: number) => GeneratorAction;
17
+ export declare const duplicateAction$: ({ tableIds, memoIds, offset, escapeCollision, }: DuplicateConfig) => GeneratorAction;
8
18
  export declare const dragSelectAction$: (dragRect: Rect) => GeneratorAction;
9
19
  export declare const unselectAllAction$: () => GeneratorAction;
10
20
  export declare const focusMoveTableAction$: (moveKey: MoveKey, shiftKey: boolean) => GeneratorAction;
@@ -12,6 +22,9 @@ export declare const drawStartRelationshipAction$: (relationshipType: number) =>
12
22
  export declare const drawStartAddRelationshipAction$: (tableId: string) => GeneratorAction;
13
23
  export declare const changeColorAllAction$: (color: string) => GeneratorAction;
14
24
  export declare const loadSchemaSQLAction$: (value: string) => GeneratorAction;
25
+ export declare const loadSchemaGraphQLAction$: (value: string) => GeneratorAction;
26
+ export declare const loadSchemaDBMLAction$: (value: string) => GeneratorAction;
27
+ export declare const loadSchemaAMLAction$: (value: string) => GeneratorAction;
15
28
  export declare const dragstartColumnAction$: ($mod: boolean) => GeneratorAction;
16
29
  export declare const dragoverColumnAction$: (targetId: string, targetTableId: string) => GeneratorAction;
17
30
  export declare const columnKeyHoverStartAction$: (columnId: string) => GeneratorAction;
@@ -21,6 +34,8 @@ export declare const actions$: {
21
34
  initialLoadJsonAction$: (value: string) => GeneratorAction;
22
35
  moveAllAction$: (movementX: number, movementY: number) => GeneratorAction;
23
36
  removeSelectedAction$: () => GeneratorAction;
37
+ pasteEntitiesAction$: (payload: ClipboardPayload, pasteRound: number) => GeneratorAction;
38
+ duplicateAction$: ({ tableIds, memoIds, offset, escapeCollision, }: DuplicateConfig) => GeneratorAction;
24
39
  dragSelectAction$: (dragRect: Rect) => GeneratorAction;
25
40
  unselectAllAction$: () => GeneratorAction;
26
41
  focusMoveTableAction$: (moveKey: MoveKey, shiftKey: boolean) => GeneratorAction;
@@ -28,6 +43,9 @@ export declare const actions$: {
28
43
  drawStartAddRelationshipAction$: (tableId: string) => GeneratorAction;
29
44
  changeColorAllAction$: (color: string) => GeneratorAction;
30
45
  loadSchemaSQLAction$: (value: string) => GeneratorAction;
46
+ loadSchemaGraphQLAction$: (value: string) => GeneratorAction;
47
+ loadSchemaDBMLAction$: (value: string) => GeneratorAction;
48
+ loadSchemaAMLAction$: (value: string) => GeneratorAction;
31
49
  dragstartColumnAction$: ($mod: boolean) => GeneratorAction;
32
50
  dragoverColumnAction$: (targetId: string, targetTableId: string) => GeneratorAction;
33
51
  columnKeyHoverStartAction$: (columnId: string) => GeneratorAction;