@dineug/erd-editor 4.1.0 → 5.0.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 (1162) hide show
  1. package/README.md +222 -21
  2. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/assertClassBrand.js +7 -0
  3. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/checkPrivateRedeclaration.js +6 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldGet2.js +7 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldInitSpec.js +7 -0
  6. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldSet2.js +7 -0
  7. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.js +12 -0
  8. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPrimitive.js +14 -0
  9. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPropertyKey.js +9 -0
  10. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/typeof.js +11 -0
  11. package/dist/_virtual/_rolldown/runtime.js +13 -0
  12. package/dist/components/appContext.js +45 -0
  13. package/dist/components/customElementClass.d.ts +10 -0
  14. package/dist/components/dictionary/Dictionary.d.ts +12 -0
  15. package/dist/components/dictionary/Dictionary.js +584 -0
  16. package/dist/components/dictionary/Dictionary.styles.d.ts +33 -0
  17. package/dist/components/dictionary/Dictionary.styles.js +208 -0
  18. package/dist/components/dictionary/checkCount.d.ts +28 -0
  19. package/dist/components/dictionary/checkCount.js +59 -0
  20. package/dist/components/dictionary/checkSheet.d.ts +41 -0
  21. package/dist/components/dictionary/checkSheet.js +121 -0
  22. package/dist/components/dictionary/dictionary-context-menu/DictionaryContextMenu.d.ts +30 -0
  23. package/dist/components/dictionary/dictionary-context-menu/DictionaryContextMenu.js +17 -0
  24. package/dist/components/dictionary/dictionaryCommit.d.ts +83 -0
  25. package/dist/components/dictionary/dictionaryCommit.js +237 -0
  26. package/dist/components/dictionary/dictionaryFile.d.ts +23 -0
  27. package/dist/components/dictionary/dictionaryFile.js +72 -0
  28. package/dist/components/dictionary/dictionaryKeys.d.ts +48 -0
  29. package/dist/components/dictionary/dictionaryKeys.js +86 -0
  30. package/dist/components/dictionary/dictionaryView.d.ts +65 -0
  31. package/dist/components/dictionary/dictionaryView.js +100 -0
  32. package/dist/components/dictionary/domain-cell-editor/DomainCellEditor.d.ts +22 -0
  33. package/dist/components/dictionary/domain-cell-editor/DomainCellEditor.js +110 -0
  34. package/dist/components/dictionary/domain-cell-editor/DomainCellEditor.styles.d.ts +7 -0
  35. package/dist/components/dictionary/domain-cell-editor/DomainCellEditor.styles.js +65 -0
  36. package/dist/components/dictionary/domain-cell-editor/openDomainCellEditor.d.ts +9 -0
  37. package/dist/components/dictionary/domain-cell-editor/openDomainCellEditor.js +16 -0
  38. package/dist/components/dictionary/gridTheme.d.ts +18 -0
  39. package/dist/components/dictionary/gridTheme.js +51 -0
  40. package/dist/components/dictionary/sheets.d.ts +65 -0
  41. package/dist/components/dictionary/sheets.js +199 -0
  42. package/dist/components/diffContext.d.ts +10 -0
  43. package/dist/components/diffContext.js +7 -0
  44. package/dist/components/element-host/localeHost.d.ts +43 -0
  45. package/dist/components/element-host/localeHost.js +81 -0
  46. package/dist/components/element-host/themeHost.d.ts +30 -0
  47. package/dist/components/element-host/themeHost.js +101 -0
  48. package/dist/components/erd/Erd.d.ts +2 -0
  49. package/dist/components/erd/Erd.js +431 -0
  50. package/dist/components/erd/Erd.styles.js +12 -0
  51. package/dist/components/erd/automatic-table-placement/AutomaticTablePlacement.js +139 -0
  52. package/dist/components/erd/automatic-table-placement/AutomaticTablePlacement.styles.js +22 -0
  53. package/dist/components/erd/automatic-table-placement/createAutomaticTablePlacement.js +175 -0
  54. package/dist/components/erd/automatic-table-placement/elkPlacement.js +56 -0
  55. package/dist/components/erd/automatic-table-placement/flowPlacement.d.ts +4 -4
  56. package/dist/components/erd/automatic-table-placement/flowPlacement.js +32 -0
  57. package/dist/components/erd/automatic-table-placement/placementActions.js +33 -0
  58. package/dist/components/erd/automatic-table-placement/runElkPlacement.d.ts +3 -2
  59. package/dist/components/erd/automatic-table-placement/runElkPlacement.js +30 -0
  60. package/dist/components/erd/canvas/Canvas.d.ts +8 -2
  61. package/dist/components/erd/canvas/Canvas.js +78 -0
  62. package/dist/components/erd/canvas/Canvas.styles.js +15 -0
  63. package/dist/components/erd/canvas/CanvasScene.d.ts +28 -3
  64. package/dist/components/erd/canvas/CanvasScene.js +80 -0
  65. package/dist/components/erd/canvas/DiffOutline.template.js +5 -0
  66. package/dist/components/erd/canvas/EditOverlay.js +349 -0
  67. package/dist/components/erd/canvas/EditOverlay.styles.d.ts +6 -0
  68. package/dist/components/erd/canvas/EditOverlay.styles.js +19 -0
  69. package/dist/components/erd/canvas/SceneIcon.template.js +14 -0
  70. package/dist/components/erd/canvas/altDragDuplicate.js +16 -0
  71. package/dist/components/erd/canvas/column-drag-ghost/ColumnDragGhost.js +61 -0
  72. package/dist/components/erd/canvas/{column-drag-ghost/columnDragPointer.d.ts → columnDragPointer.d.ts} +2 -2
  73. package/dist/components/erd/canvas/columnDragPointer.js +30 -0
  74. package/dist/components/erd/canvas/drag-select/DragSelect.js +109 -0
  75. package/dist/components/erd/canvas/draw-relationship/DrawRelationship.js +60 -0
  76. package/dist/components/erd/canvas/duplicate-ghost/DuplicateGhost.js +108 -0
  77. package/dist/components/erd/canvas/editingLayers.d.ts +8 -0
  78. package/dist/components/erd/canvas/editingLayers.js +21 -0
  79. package/dist/components/erd/canvas/entityDrag.d.ts +2 -1
  80. package/dist/components/erd/canvas/entityDrag.js +42 -0
  81. package/dist/components/erd/canvas/high-level-table/HighLevelTable.js +82 -0
  82. package/dist/components/erd/canvas/highlightTransition.d.ts +6 -0
  83. package/dist/components/erd/canvas/highlightTransition.js +79 -0
  84. package/dist/components/erd/canvas/memo/Memo.js +152 -0
  85. package/dist/components/erd/canvas/memo/memo-sash/MemoSash.js +190 -0
  86. package/dist/components/erd/canvas/memo/memoCaret.js +66 -0
  87. package/dist/components/erd/canvas/memo/memoScroll.js +14 -0
  88. package/dist/components/erd/canvas/memo/memoText.js +41 -0
  89. package/dist/components/erd/canvas/memo/useMoveMemo.js +19 -0
  90. package/dist/components/erd/canvas/middleButtonPan.js +33 -0
  91. package/dist/components/erd/canvas/mixColor.js +23 -0
  92. package/dist/components/erd/canvas/readPress.d.ts +43 -0
  93. package/dist/components/erd/canvas/readPress.js +102 -0
  94. package/dist/components/erd/canvas/relationship-group/RelationshipGroup.js +26 -0
  95. package/dist/components/erd/canvas/relationship-group/relationship/Relationship.js +153 -0
  96. package/dist/components/erd/canvas/relationship-group/relationship/Relationship.template.js +75 -0
  97. package/dist/components/erd/canvas/relationship-group/relationship/RelationshipActionLabel.js +68 -0
  98. package/dist/components/erd/canvas/sceneHit.d.ts +5 -0
  99. package/dist/components/erd/canvas/sceneHit.js +38 -0
  100. package/dist/components/erd/canvas/sceneKind.js +12 -0
  101. package/dist/components/erd/canvas/sceneRetention.js +20 -0
  102. package/dist/components/erd/canvas/sceneTokens.d.ts +6 -0
  103. package/dist/components/erd/canvas/sceneTokens.js +110 -0
  104. package/dist/components/erd/canvas/shared-drag-select/SharedDragSelect.js +35 -0
  105. package/dist/components/erd/canvas/shared-mouse-tracker/SharedMouseTracker.js +29 -0
  106. package/dist/components/erd/canvas/shared-mouse-tracker/shared-mouse-cursor/SharedMouseCursor.js +40 -0
  107. package/dist/components/erd/canvas/stagePressScope.d.ts +11 -0
  108. package/dist/components/erd/canvas/stagePressScope.js +24 -0
  109. package/dist/components/erd/canvas/table/Table.d.ts +6 -0
  110. package/dist/components/erd/canvas/table/Table.js +399 -0
  111. package/dist/components/erd/canvas/table/blankLogicalName.d.ts +19 -0
  112. package/dist/components/erd/canvas/table/blankLogicalName.js +14 -0
  113. package/dist/components/erd/canvas/table/cellLayout.d.ts +4 -4
  114. package/dist/components/erd/canvas/table/cellLayout.js +147 -0
  115. package/dist/components/erd/canvas/table/colorEdge.js +16 -0
  116. package/dist/components/erd/canvas/table/column/Column.d.ts +38 -6
  117. package/dist/components/erd/canvas/table/column/Column.js +416 -0
  118. package/dist/components/erd/canvas/table/dictionaryMarks.d.ts +29 -0
  119. package/dist/components/erd/canvas/table/dictionaryMarks.js +42 -0
  120. package/dist/components/erd/canvas/table/doubleClick.js +15 -0
  121. package/dist/components/erd/canvas/table/goToErd.js +10 -0
  122. package/dist/components/erd/canvas/table/useFocusTable.d.ts +1 -0
  123. package/dist/components/erd/canvas/table/useFocusTable.js +19 -0
  124. package/dist/components/erd/canvas/table/useMoveTable.js +21 -0
  125. package/dist/components/erd/canvas/table/useSharedFocusTable.js +53 -0
  126. package/dist/components/erd/canvas/table/useViewPin.js +21 -0
  127. package/dist/components/erd/canvas/table-group/TableGroup.js +141 -0
  128. package/dist/components/erd/canvas/table-group/TableGroupBody.js +47 -0
  129. package/dist/components/erd/canvas/table-group/TableGroupDropTarget.js +25 -0
  130. package/dist/components/erd/canvas/table-group/TableGroupSash.js +143 -0
  131. package/dist/components/erd/canvas/table-group/TableGroups.js +21 -0
  132. package/dist/components/erd/canvas/table-group/tableGroupBox.js +57 -0
  133. package/dist/components/erd/canvas/table-group/tableGroupNameEditor.d.ts +11 -0
  134. package/dist/components/erd/canvas/table-group/tableGroupNameEditor.js +9 -0
  135. package/dist/components/erd/canvas/table-group/titleLayout.js +31 -0
  136. package/dist/components/erd/canvas/useMoveEntity.d.ts +1 -1
  137. package/dist/components/erd/canvas/useMoveEntity.js +80 -0
  138. package/dist/components/erd/canvas/useSharedSelectEntity.js +28 -0
  139. package/dist/components/erd/content-compass/ContentCompass.js +23 -0
  140. package/dist/components/erd/content-compass/ContentCompass.styles.js +32 -0
  141. package/dist/components/erd/content-compass/compassGeometry.js +71 -0
  142. package/dist/components/erd/diff-viewer/DiffViewer.js +75 -0
  143. package/dist/components/erd/diff-viewer/DiffViewer.styles.js +28 -0
  144. package/dist/components/erd/diff-viewer/diff-erd-viewer/DiffErdViewer.d.ts +11 -0
  145. package/dist/components/erd/diff-viewer/diff-erd-viewer/DiffErdViewer.js +105 -0
  146. package/dist/components/erd/diff-viewer/{erd-viewer/ErdViewer.styles.d.ts → diff-erd-viewer/DiffErdViewer.styles.d.ts} +1 -1
  147. package/dist/components/erd/diff-viewer/diff-erd-viewer/DiffErdViewer.styles.js +12 -0
  148. package/dist/components/erd/diff-viewer/diff-tree/DiffTree.js +130 -0
  149. package/dist/components/erd/diff-viewer/diff-tree/DiffTree.styles.d.ts +1 -0
  150. package/dist/components/erd/diff-viewer/diff-tree/DiffTree.styles.js +139 -0
  151. package/dist/components/erd/diff-viewer/diff-tree/diffTreeModel.d.ts +4 -1
  152. package/dist/components/erd/diff-viewer/diff-tree/diffTreeModel.js +203 -0
  153. package/dist/components/erd/draw-target/DrawTargetButtons.js +284 -0
  154. package/dist/components/erd/draw-target/DrawTargetButtons.styles.js +64 -0
  155. package/dist/components/erd/draw-target/drawTargetState.js +37 -0
  156. package/dist/components/erd/draw-target/findDrawTarget.js +22 -0
  157. package/dist/components/erd/draw-target/placePill.js +72 -0
  158. package/dist/components/erd/erd-context-menu/ErdContextMenu.d.ts +6 -0
  159. package/dist/components/erd/erd-context-menu/ErdContextMenu.js +306 -0
  160. package/dist/components/erd/erd-context-menu/menus/databaseMenus.js +51 -0
  161. package/dist/components/erd/erd-context-menu/menus/drawRelationshipMenus.js +48 -0
  162. package/dist/components/erd/erd-context-menu/menus/exportMenus.js +38 -0
  163. package/dist/components/erd/erd-context-menu/menus/importMenus.js +49 -0
  164. package/dist/components/erd/erd-context-menu/menus/nameViewMenus.d.ts +13 -0
  165. package/dist/components/erd/erd-context-menu/menus/nameViewMenus.js +16 -0
  166. package/dist/components/erd/erd-context-menu/menus/relationshipMenus.js +105 -0
  167. package/dist/components/erd/erd-context-menu/menus/showMenus.js +80 -0
  168. package/dist/components/erd/erd-context-menu/menus/tablePlacementMenus.js +42 -0
  169. package/dist/components/erd/erdShortcutPerformCheck.js +20 -0
  170. package/dist/components/erd/erdTarget.d.ts +9 -0
  171. package/dist/components/erd/erdTarget.js +65 -0
  172. package/dist/components/{explorer → erd}/fieldIcon.d.ts +4 -1
  173. package/dist/components/erd/fieldIcon.js +17 -0
  174. package/dist/components/erd/floating-toolbar/FloatingToolbar.d.ts +2 -6
  175. package/dist/components/erd/floating-toolbar/FloatingToolbar.js +105 -0
  176. package/dist/components/erd/floating-toolbar/FloatingToolbar.styles.d.ts +1 -6
  177. package/dist/components/erd/goToErdTarget.js +248 -0
  178. package/dist/components/erd/hitTest.d.ts +9 -0
  179. package/dist/components/erd/hitTest.js +115 -0
  180. package/dist/components/erd/minimap/Minimap.js +98 -0
  181. package/dist/components/erd/minimap/Minimap.styles.js +29 -0
  182. package/dist/components/erd/minimap/MinimapScene.js +41 -0
  183. package/dist/components/erd/minimap/memo/Memo.js +17 -0
  184. package/dist/components/erd/minimap/minimapGeometry.js +140 -0
  185. package/dist/components/erd/minimap/table/Table.js +22 -0
  186. package/dist/components/erd/minimap/table-group/TableGroup.js +22 -0
  187. package/dist/components/erd/minimap/useMinimapScroll.js +83 -0
  188. package/dist/components/erd/minimap/viewport/Viewport.js +34 -0
  189. package/dist/components/erd/minimap/viewport/Viewport.styles.js +17 -0
  190. package/dist/components/erd/nameViewOptions.d.ts +11 -0
  191. package/dist/components/erd/nameViewOptions.js +18 -0
  192. package/dist/components/erd/readerNameView.d.ts +15 -0
  193. package/dist/components/erd/readerNameView.js +5 -0
  194. package/dist/components/erd/relationshipHighlight.d.ts +8 -3
  195. package/dist/components/erd/relationshipHighlight.js +32 -0
  196. package/dist/components/erd/table-group/TableGroupDraft.js +14 -0
  197. package/dist/components/erd/table-group/TableGroupDraft.styles.js +22 -0
  198. package/dist/components/erd/table-group/tableGroupName.d.ts +0 -9
  199. package/dist/components/erd/table-group/tableGroupName.js +10 -0
  200. package/dist/components/erd/table-group/useTableGroupDraw.js +97 -0
  201. package/dist/components/erd/table-properties/TableProperties.js +67 -0
  202. package/dist/components/erd/table-properties/TableProperties.styles.js +172 -0
  203. package/dist/components/erd/table-properties/table-properties-indexes/TablePropertiesIndexes.js +76 -0
  204. package/dist/components/erd/table-properties/table-properties-indexes/TablePropertiesIndexes.styles.js +115 -0
  205. package/dist/components/erd/table-properties/table-properties-indexes/indexes-checkbox-column/IndexesCheckboxColumn.js +92 -0
  206. package/dist/components/erd/table-properties/table-properties-indexes/indexes-checkbox-column/IndexesCheckboxColumn.styles.js +70 -0
  207. package/dist/components/erd/table-properties/table-properties-indexes/indexes-column/IndexesColumn.js +85 -0
  208. package/dist/components/erd/table-properties/table-properties-indexes/indexes-column/IndexesColumn.styles.js +60 -0
  209. package/dist/components/erd/table-properties/table-properties-indexes/indexes-index/IndexesIndex.js +46 -0
  210. package/dist/components/erd/table-properties/table-properties-indexes/indexes-index/IndexesIndex.styles.js +85 -0
  211. package/dist/components/erd/table-properties/table-properties-indexes/indexes-key/IndexesKey.js +30 -0
  212. package/dist/components/erd/table-properties/table-properties-indexes/indexes-key/IndexesKey.styles.js +62 -0
  213. package/dist/components/erd/table-properties/table-properties-tabs/TablePropertiesTabs.js +21 -0
  214. package/dist/components/erd/table-properties/table-properties-tabs/TablePropertiesTabs.styles.js +34 -0
  215. package/dist/components/erd/time-travel/TimeTravel.js +83 -0
  216. package/dist/components/erd/time-travel/TimeTravel.styles.js +42 -0
  217. package/dist/components/erd/useErdShortcut.js +214 -0
  218. package/dist/components/erd/view-controls/ToolbarCompass.template.js +10 -0
  219. package/dist/components/erd/view-controls/nameViewDropdown.d.ts +16 -0
  220. package/dist/components/erd/view-controls/nameViewDropdown.js +107 -0
  221. package/dist/components/erd/view-controls/nameViewDropdown.styles.d.ts +5 -0
  222. package/dist/components/erd/view-controls/nameViewDropdown.styles.js +31 -0
  223. package/dist/components/erd/view-controls/viewControls.styles.d.ts +7 -0
  224. package/dist/components/erd/view-controls/viewControls.styles.js +75 -0
  225. package/dist/components/erd/view-controls/zoomControls.d.ts +9 -0
  226. package/dist/components/erd/view-controls/zoomControls.js +31 -0
  227. package/dist/components/erd/virtual-scroll/VirtualScroll.js +63 -0
  228. package/dist/components/erd/virtual-scroll/VirtualScroll.styles.js +48 -0
  229. package/dist/components/erd/virtual-scroll/useVirtualScroll.js +126 -0
  230. package/dist/components/erd/welcome-screen/WelcomeScreen.js +194 -0
  231. package/dist/components/erd/welcome-screen/WelcomeScreen.styles.js +67 -0
  232. package/dist/components/erd/welcome-screen/welcome-hints/WelcomeHints.js +47 -0
  233. package/dist/components/erd/welcome-screen/welcome-hints/WelcomeHints.styles.js +52 -0
  234. package/dist/components/erd/welcome-screen/welcome-hints/hintArrows.js +10 -0
  235. package/dist/components/erd/welcome-screen/welcomeLayout.js +65 -0
  236. package/dist/components/erd-editor/ErdEditor.d.ts +14 -3
  237. package/dist/components/erd-editor/ErdEditor.js +188 -0
  238. package/dist/components/erd-editor/ErdEditor.styles.js +47 -0
  239. package/dist/components/erd-editor/useErdEditorAttachElement.d.ts +6 -20
  240. package/dist/components/erd-editor/useErdEditorAttachElement.js +284 -0
  241. package/dist/components/erd-editor/viewportLayout.js +93 -0
  242. package/dist/components/erd-view/ErdView.d.ts +25 -0
  243. package/dist/components/erd-view/ErdView.js +125 -0
  244. package/dist/components/erd-view/ErdView.styles.d.ts +3 -0
  245. package/dist/components/erd-view/ErdView.styles.js +51 -0
  246. package/dist/components/erd-view/viewportMeasure.d.ts +9 -0
  247. package/dist/components/erd-view/viewportMeasure.js +19 -0
  248. package/dist/components/erd-viewer/ErdViewer.d.ts +67 -0
  249. package/dist/components/erd-viewer/ErdViewer.js +287 -0
  250. package/dist/components/erd-viewer/documentSource.d.ts +26 -0
  251. package/dist/components/erd-viewer/documentSource.js +39 -0
  252. package/dist/components/explorer/Explorer.js +40 -0
  253. package/dist/components/explorer/explorer-controller/ExplorerController.js +43 -0
  254. package/dist/components/explorer/explorer-panel/ExplorerPanel.js +207 -0
  255. package/dist/components/explorer/explorer-panel/ExplorerPanel.styles.js +133 -0
  256. package/dist/components/explorer/explorer-search/ExplorerSearch.js +119 -0
  257. package/dist/components/explorer/explorer-search/ExplorerSearch.styles.js +151 -0
  258. package/dist/components/explorer/explorerCommands.js +45 -0
  259. package/dist/components/explorer/explorerNavigation.js +50 -0
  260. package/dist/components/explorer/explorerSearch.js +298 -0
  261. package/dist/components/explorer/explorerTree.d.ts +4 -1
  262. package/dist/components/explorer/explorerTree.js +331 -0
  263. package/dist/components/explorer/explorerView.js +46 -0
  264. package/dist/components/explorer/matchTarget.d.ts +3 -10
  265. package/dist/components/explorer/matchTarget.js +51 -0
  266. package/dist/components/export-image/ExportImage.d.ts +10 -0
  267. package/dist/components/export-image/ExportImage.js +230 -0
  268. package/dist/components/export-image/ExportImage.styles.js +172 -0
  269. package/dist/components/export-image/exportImageActions.d.ts +2 -2
  270. package/dist/components/export-image/exportImageActions.js +102 -0
  271. package/dist/components/flowCenters.d.ts +9 -0
  272. package/dist/components/flowCenters.js +29 -0
  273. package/dist/components/generator-code/GeneratorCode.d.ts +1 -0
  274. package/dist/components/generator-code/GeneratorCode.js +96 -0
  275. package/dist/components/generator-code/generator-code-context-menu/GeneratorCodeContextMenu.js +49 -0
  276. package/dist/components/generator-code/generator-code-context-menu/menus/columnNameCaseMenus.js +37 -0
  277. package/dist/components/generator-code/generator-code-context-menu/menus/languageMenus.js +115 -0
  278. package/dist/components/generator-code/generator-code-context-menu/menus/tableNameCaseMenus.js +37 -0
  279. package/dist/components/generator-code/generator-code-options/GeneratorCodeOptions.d.ts +4 -3
  280. package/dist/components/generator-code/generator-code-options/GeneratorCodeOptions.js +122 -0
  281. package/dist/components/generator-code/generator-code-options/GeneratorCodeOptions.styles.js +12 -0
  282. package/dist/components/generator-code/generatorCodeView.js +17 -0
  283. package/dist/components/generator-code/languageSettings.js +48 -0
  284. package/dist/components/global-styles/GlobalStyles.js +18 -0
  285. package/dist/components/locale-picker/LocalePicker.js +129 -0
  286. package/dist/components/locale-picker/LocalePicker.styles.js +112 -0
  287. package/dist/components/localeContext.js +8 -0
  288. package/dist/components/localized/Localized.js +15 -0
  289. package/dist/components/map-columns/MapColumnsBody.js +186 -0
  290. package/dist/components/map-columns/MapColumnsDialog.js +112 -0
  291. package/dist/components/map-columns/MapColumnsDialog.styles.js +169 -0
  292. package/dist/components/map-columns/mapColumnsAction.js +18 -0
  293. package/dist/components/map-columns/nameOf.d.ts +11 -3
  294. package/dist/components/map-columns/nameOf.js +8 -0
  295. package/dist/components/map-columns/openMapColumns.js +10 -0
  296. package/dist/components/primitives/button/Button.js +12 -0
  297. package/dist/components/primitives/button/Button.styles.js +64 -0
  298. package/dist/components/primitives/code-block/CodeBlock.js +94 -0
  299. package/dist/components/primitives/code-block/CodeBlock.styles.js +108 -0
  300. package/dist/components/primitives/color-picker/ColorPicker.js +333 -0
  301. package/dist/components/primitives/color-picker/ColorPicker.styles.js +219 -0
  302. package/dist/components/primitives/color-picker/colorModel.js +116 -0
  303. package/dist/components/primitives/color-picker/presetColors.js +25 -0
  304. package/dist/components/primitives/color-picker/resolveColor.js +25 -0
  305. package/dist/components/primitives/context-menu/ContextMenu.js +13 -0
  306. package/dist/components/primitives/context-menu/context-menu-content/ContextMenuContent.js +72 -0
  307. package/dist/components/primitives/context-menu/context-menu-content/ContextMenuContent.styles.js +19 -0
  308. package/dist/components/primitives/context-menu/context-menu-content/fitMenu.js +21 -0
  309. package/dist/components/primitives/context-menu/context-menu-item/ContextMenuItem.js +47 -0
  310. package/dist/components/primitives/context-menu/context-menu-item/ContextMenuItem.styles.js +22 -0
  311. package/dist/components/primitives/context-menu/context-menu-root/ContextMenuRoot.js +10 -0
  312. package/dist/components/primitives/context-menu/context-menu-root/contextMenuRootContext.js +45 -0
  313. package/dist/components/primitives/context-menu/context-menu-separator/ContextMenuSeparator.js +6 -0
  314. package/dist/components/primitives/context-menu/context-menu-separator/ContextMenuSeparator.styles.js +9 -0
  315. package/dist/components/primitives/context-menu/menu/Menu.js +6 -0
  316. package/dist/components/primitives/context-menu/menu/Menu.styles.js +21 -0
  317. package/dist/components/primitives/context-menu/submenu-chevron/SubmenuChevron.js +10 -0
  318. package/dist/components/primitives/dialog/Dialog.js +75 -0
  319. package/dist/components/primitives/dialog/Dialog.styles.js +35 -0
  320. package/dist/components/primitives/edit-input/EditInput.js +68 -0
  321. package/dist/components/primitives/edit-input/EditInput.styles.js +40 -0
  322. package/dist/components/primitives/highlighted-text/HighlightedText.js +14 -0
  323. package/dist/components/primitives/highlighted-text/HighlightedText.styles.js +7 -0
  324. package/dist/components/primitives/icon/Icon.js +38 -0
  325. package/dist/components/primitives/icon/Icon.styles.js +12 -0
  326. package/dist/components/primitives/icon/icons.d.ts +5 -0
  327. package/dist/components/primitives/icon/icons.js +156 -0
  328. package/dist/components/primitives/kbd/Kbd.js +12 -0
  329. package/dist/components/primitives/kbd/Kbd.styles.js +44 -0
  330. package/dist/components/primitives/sash/Sash.js +46 -0
  331. package/dist/components/primitives/sash/Sash.styles.js +23 -0
  332. package/dist/components/primitives/select/Select.js +6 -0
  333. package/dist/components/primitives/select/Select.styles.js +59 -0
  334. package/dist/components/primitives/separator/Separator.js +14 -0
  335. package/dist/components/primitives/separator/Separator.styles.js +11 -0
  336. package/dist/components/primitives/slider/Slider.js +42 -0
  337. package/dist/components/primitives/slider/Slider.styles.js +58 -0
  338. package/dist/components/primitives/switch/Switch.d.ts +2 -0
  339. package/dist/components/primitives/switch/Switch.js +11 -0
  340. package/dist/components/primitives/switch/Switch.styles.js +117 -0
  341. package/dist/components/primitives/text-input/TextInput.js +25 -0
  342. package/dist/components/primitives/toast/Toast.js +24 -0
  343. package/dist/components/primitives/toast/Toast.styles.js +87 -0
  344. package/dist/components/primitives/tree/Tree.js +182 -0
  345. package/dist/components/primitives/tree/Tree.styles.js +71 -0
  346. package/dist/components/primitives/tree/treeModel.js +60 -0
  347. package/dist/components/quick-search/QuickSearch.d.ts +11 -2
  348. package/dist/components/quick-search/QuickSearch.js +290 -0
  349. package/dist/components/quick-search/QuickSearch.styles.js +168 -0
  350. package/dist/components/quick-search/actions.d.ts +3 -55
  351. package/dist/components/quick-search/actions.js +471 -0
  352. package/dist/components/quick-search/documentSearch.d.ts +60 -0
  353. package/dist/components/quick-search/documentSearch.js +132 -0
  354. package/dist/components/quick-search/hangul.js +183 -0
  355. package/dist/components/quick-search/paletteList.js +3 -0
  356. package/dist/components/quick-search/paletteQuery.js +73 -0
  357. package/dist/components/quick-search/scopedActions.d.ts +3 -3
  358. package/dist/components/quick-search/scopedActions.js +115 -0
  359. package/dist/components/sceneInteractionContext.d.ts +27 -0
  360. package/dist/components/sceneInteractionContext.js +15 -0
  361. package/dist/components/sceneSourceContext.js +7 -0
  362. package/dist/components/schema-sql/SchemaSQL.js +120 -0
  363. package/dist/components/schema-sql/SchemaSQL.styles.js +35 -0
  364. package/dist/components/schema-sql/schema-sql-context-menu/SchemaSQLContextMenu.js +45 -0
  365. package/dist/components/schema-sql/schema-sql-context-menu/menus/bracketMenus.js +37 -0
  366. package/dist/components/schema-sql/schema-sql-context-menu/menus/headerMenus.js +62 -0
  367. package/dist/components/schema-sql/schema-sql-context-menu/menus/statementsMenus.js +41 -0
  368. package/dist/components/schema-sql/schema-sql-options/SchemaSQLOptions.d.ts +2 -2
  369. package/dist/components/schema-sql/schema-sql-options/SchemaSQLOptions.js +172 -0
  370. package/dist/components/schema-sql/schema-sql-options/SchemaSQLOptions.styles.d.ts +2 -0
  371. package/dist/components/schema-sql/schema-sql-options/SchemaSQLOptions.styles.js +271 -0
  372. package/dist/components/schema-sql/schema-sql-options/ScriptEditor.js +117 -0
  373. package/dist/components/schema-sql/schema-sql-options/ScriptEditor.styles.js +82 -0
  374. package/dist/components/schema-sql/schema-sql-options/dropWarning.js +13 -0
  375. package/dist/components/schema-sql/schemaSQLView.d.ts +2 -0
  376. package/dist/components/schema-sql/schemaSQLView.js +107 -0
  377. package/dist/components/settings/Settings.js +112 -0
  378. package/dist/components/settings/Settings.styles.d.ts +1 -0
  379. package/dist/components/settings/Settings.styles.js +158 -0
  380. package/dist/components/settings/columnTypeLabels.js +15 -0
  381. package/dist/components/settings/lockSettingRows.d.ts +2 -1
  382. package/dist/components/settings/lockSettingRows.js +73 -0
  383. package/dist/components/settings/settings-lnb/SettingsLnb.js +24 -0
  384. package/dist/components/settings/settings-lnb/SettingsLnb.styles.js +37 -0
  385. package/dist/components/settings/settingsPage.js +15 -0
  386. package/dist/components/settings/shortcuts/Shortcuts.js +49 -0
  387. package/dist/components/settings/shortcuts/Shortcuts.styles.js +36 -0
  388. package/dist/components/table-view/Table.styles.js +76 -0
  389. package/dist/components/table-view/column/Column.styles.js +45 -0
  390. package/dist/components/table-view/column/column-data-type/ColumnDataType.js +93 -0
  391. package/dist/components/table-view/column/column-data-type/ColumnDataType.styles.js +51 -0
  392. package/dist/components/table-view/column/column-domain/ColumnDomain.d.ts +19 -0
  393. package/dist/components/table-view/column/column-domain/ColumnDomain.js +77 -0
  394. package/dist/components/table-view/column/column-domain/domainOptions.d.ts +13 -0
  395. package/dist/components/table-view/column/column-domain/domainOptions.js +20 -0
  396. package/dist/components/table-view/column/column-key/ColumnKey.js +24 -0
  397. package/dist/components/table-view/column/column-key/ColumnKey.styles.js +19 -0
  398. package/dist/components/table-view/column/column-logical-name/ColumnLogicalName.d.ts +22 -0
  399. package/dist/components/table-view/column/column-logical-name/ColumnLogicalName.js +96 -0
  400. package/dist/components/table-view/column/column-logical-name/ColumnLogicalName.styles.d.ts +4 -0
  401. package/dist/components/table-view/column/column-logical-name/ColumnLogicalName.styles.js +51 -0
  402. package/dist/components/table-view/column/column-not-null/ColumnNotNull.js +15 -0
  403. package/dist/components/table-view/column/column-not-null/ColumnNotNull.styles.js +22 -0
  404. package/dist/components/table-view/column/column-option/ColumnOption.js +18 -0
  405. package/dist/components/table-view/column/column-option/ColumnOption.styles.js +26 -0
  406. package/dist/components/table-view/column/columnViewText.d.ts +33 -0
  407. package/dist/components/table-view/column/columnViewText.js +23 -0
  408. package/dist/components/table-view/column/useColumnCell.js +117 -0
  409. package/dist/components/table-view/column/useHintList.d.ts +24 -0
  410. package/dist/components/table-view/column/useHintList.js +83 -0
  411. package/dist/components/theme/Theme.d.ts +5 -0
  412. package/dist/components/theme/Theme.js +20 -0
  413. package/dist/components/theme-builder/ThemeBuilder.js +90 -0
  414. package/dist/components/theme-builder/ThemeBuilder.styles.js +100 -0
  415. package/dist/components/themeContext.js +7 -0
  416. package/dist/components/toast-container/ToastContainer.js +46 -0
  417. package/dist/components/toast-container/ToastContainer.styles.js +48 -0
  418. package/dist/components/toast-container/openStatusToast.js +28 -0
  419. package/dist/components/toast-container/openToastWhileRunning.js +20 -0
  420. package/dist/components/toolbar/Toolbar.js +120 -0
  421. package/dist/components/toolbar/Toolbar.styles.d.ts +1 -0
  422. package/dist/components/toolbar/Toolbar.styles.js +68 -0
  423. package/dist/components/visualization/Visualization.js +39 -0
  424. package/dist/components/visualization/Visualization.styles.js +16 -0
  425. package/dist/components/visualization/VisualizationFlow.js +44 -0
  426. package/dist/components/visualization/VisualizationGraph.js +109 -0
  427. package/dist/components/visualization/VisualizationScene.js +56 -0
  428. package/dist/components/visualization/captureDrag.js +15 -0
  429. package/dist/components/visualization/createVisualization.d.ts +2 -0
  430. package/dist/components/visualization/createVisualization.js +77 -0
  431. package/dist/components/visualization/flowLayout.d.ts +2 -1
  432. package/dist/components/visualization/flowLayout.js +203 -0
  433. package/dist/components/visualization/graph-node/GraphNode.js +80 -0
  434. package/dist/components/visualization/graphPan.js +26 -0
  435. package/dist/components/visualization/graphViewHandle.js +30 -0
  436. package/dist/components/visualization/particles/ParticleLayer.js +33 -0
  437. package/dist/components/visualization/particles/particleEdges.js +36 -0
  438. package/dist/components/visualization/particles/particleLoop.js +118 -0
  439. package/dist/components/visualization/particles/particlePath.js +146 -0
  440. package/dist/components/visualization/table/Table.js +50 -0
  441. package/dist/components/visualization/table/column/Column.d.ts +4 -0
  442. package/dist/components/visualization/table/column/Column.js +77 -0
  443. package/dist/components/visualization/useViewGestures.js +82 -0
  444. package/dist/components/visualization/visualization-toolbar/VisualizationToolbar.d.ts +2 -2
  445. package/dist/components/visualization/visualization-toolbar/VisualizationToolbar.js +184 -0
  446. package/dist/components/visualization/visualization-toolbar/VisualizationToolbar.styles.js +24 -0
  447. package/dist/components/visualization/visualizationView.d.ts +15 -4
  448. package/dist/components/visualization/visualizationView.js +152 -0
  449. package/dist/components/visualization/zoomVisualization.js +31 -0
  450. package/dist/constants/language.js +28 -0
  451. package/dist/constants/layout.d.ts +11 -0
  452. package/dist/constants/layout.js +14 -0
  453. package/dist/constants/open.js +14 -0
  454. package/dist/constants/schema.d.ts +15 -2
  455. package/dist/constants/schema.js +54 -0
  456. package/dist/constants/sql/dataType/Databricks.js +185 -0
  457. package/dist/constants/sql/dataType/MSSQL.js +197 -0
  458. package/dist/constants/sql/dataType/MariaDB.js +349 -0
  459. package/dist/constants/sql/dataType/MySQL.js +285 -0
  460. package/dist/constants/sql/dataType/Oracle.js +209 -0
  461. package/dist/constants/sql/dataType/PostgreSQL.js +433 -0
  462. package/dist/constants/sql/dataType/SQLite.js +129 -0
  463. package/dist/constants/sql/dataType/Snowflake.js +221 -0
  464. package/dist/constants/sql/dataType/index.js +22 -0
  465. package/dist/constants/sql/database.js +25 -0
  466. package/dist/constants/tablePlacement.js +11 -0
  467. package/dist/constants/zoom.js +5 -0
  468. package/dist/engine/actions.d.ts +30 -5
  469. package/dist/engine/actions.js +280 -0
  470. package/dist/engine/clock.js +25 -0
  471. package/dist/engine/context.d.ts +3 -3
  472. package/dist/engine/context.js +10 -0
  473. package/dist/engine/documentJson.d.ts +16 -0
  474. package/dist/engine/documentJson.js +20 -0
  475. package/dist/engine/history.actions.d.ts +8 -0
  476. package/dist/engine/history.actions.js +224 -0
  477. package/dist/engine/history.d.ts +11 -3
  478. package/dist/engine/history.js +72 -0
  479. package/dist/engine/index.js +2 -56
  480. package/dist/engine/modules/dictionary/actions.d.ts +74 -0
  481. package/dist/engine/modules/dictionary/actions.js +42 -0
  482. package/dist/engine/modules/dictionary/atom.actions.d.ts +74 -0
  483. package/dist/engine/modules/dictionary/atom.actions.js +106 -0
  484. package/dist/engine/modules/dictionary/checks.d.ts +76 -0
  485. package/dist/engine/modules/dictionary/checks.js +331 -0
  486. package/dist/engine/modules/dictionary/derive.d.ts +54 -0
  487. package/dist/engine/modules/dictionary/derive.js +101 -0
  488. package/dist/engine/modules/dictionary/derivedNames.d.ts +23 -0
  489. package/dist/engine/modules/dictionary/derivedNames.js +88 -0
  490. package/dist/engine/modules/dictionary/dictionaryIndex.d.ts +73 -0
  491. package/dist/engine/modules/dictionary/dictionaryIndex.js +112 -0
  492. package/dist/engine/modules/dictionary/domainLinks.d.ts +9 -0
  493. package/dist/engine/modules/dictionary/domainLinks.js +26 -0
  494. package/dist/engine/modules/dictionary/domainTypes.d.ts +27 -0
  495. package/dist/engine/modules/dictionary/domainTypes.js +72 -0
  496. package/dist/engine/modules/dictionary/entryWrites.d.ts +63 -0
  497. package/dist/engine/modules/dictionary/entryWrites.js +197 -0
  498. package/dist/engine/modules/dictionary/generator.actions.d.ts +126 -0
  499. package/dist/engine/modules/dictionary/generator.actions.js +217 -0
  500. package/dist/engine/modules/dictionary/history.d.ts +14 -0
  501. package/dist/engine/modules/dictionary/history.js +54 -0
  502. package/dist/engine/modules/dictionary/membership.d.ts +28 -0
  503. package/dist/engine/modules/dictionary/membership.js +42 -0
  504. package/dist/engine/modules/dictionary/orderKeys.d.ts +13 -0
  505. package/dist/engine/modules/dictionary/orderKeys.js +28 -0
  506. package/dist/engine/modules/dictionary/termIndex.d.ts +24 -0
  507. package/dist/engine/modules/dictionary/termIndex.js +42 -0
  508. package/dist/engine/modules/editor/actions.d.ts +22 -3
  509. package/dist/engine/modules/editor/actions.js +58 -0
  510. package/dist/engine/modules/editor/atom.actions.d.ts +43 -6
  511. package/dist/engine/modules/editor/atom.actions.js +584 -0
  512. package/dist/engine/modules/editor/generator.actions.d.ts +22 -8
  513. package/dist/engine/modules/editor/generator.actions.js +761 -0
  514. package/dist/engine/modules/editor/history.js +37 -0
  515. package/dist/engine/modules/editor/state.d.ts +45 -0
  516. package/dist/engine/modules/editor/state.js +97 -0
  517. package/dist/engine/modules/editor/utils/color.js +37 -0
  518. package/dist/engine/modules/editor/utils/duplicate.js +234 -0
  519. package/dist/engine/modules/editor/utils/findRelationshipColumn.js +34 -0
  520. package/dist/engine/modules/editor/utils/focus.d.ts +5 -0
  521. package/dist/engine/modules/editor/utils/focus.js +276 -0
  522. package/dist/engine/modules/editor/utils/nameView.d.ts +103 -0
  523. package/dist/engine/modules/editor/utils/nameView.js +113 -0
  524. package/dist/engine/modules/editor/utils/releaseHidden.js +25 -0
  525. package/dist/engine/modules/editor/utils/selectRangeColumn.js +18 -0
  526. package/dist/engine/modules/editor/utils/selection.js +16 -0
  527. package/dist/engine/modules/editor/view.actions.d.ts +24 -1
  528. package/dist/engine/modules/editor/view.actions.js +134 -0
  529. package/dist/engine/modules/editor/view.d.ts +8 -0
  530. package/dist/engine/modules/editor/view.generator.actions.js +25 -0
  531. package/dist/engine/modules/editor/view.js +29 -0
  532. package/dist/engine/modules/index/actions.js +9 -0
  533. package/dist/engine/modules/index/atom.actions.js +73 -0
  534. package/dist/engine/modules/index/generator.actions.js +25 -0
  535. package/dist/engine/modules/index/history.js +40 -0
  536. package/dist/engine/modules/index-column/actions.js +9 -0
  537. package/dist/engine/modules/index-column/atom.actions.js +93 -0
  538. package/dist/engine/modules/index-column/generator.actions.js +63 -0
  539. package/dist/engine/modules/index-column/history.js +55 -0
  540. package/dist/engine/modules/memo/actions.js +13 -0
  541. package/dist/engine/modules/memo/atom.actions.js +106 -0
  542. package/dist/engine/modules/memo/generator.actions.js +50 -0
  543. package/dist/engine/modules/memo/history.js +109 -0
  544. package/dist/engine/modules/relationship/actions.js +11 -0
  545. package/dist/engine/modules/relationship/atom.actions.js +103 -0
  546. package/dist/engine/modules/relationship/endFlags.js +32 -0
  547. package/dist/engine/modules/relationship/fkColumns.d.ts +10 -4
  548. package/dist/engine/modules/relationship/fkColumns.js +85 -0
  549. package/dist/engine/modules/relationship/generator.actions.js +52 -0
  550. package/dist/engine/modules/relationship/history.js +72 -0
  551. package/dist/engine/modules/relationship/hooks.js +250 -0
  552. package/dist/engine/modules/relationship/referenceType.js +29 -0
  553. package/dist/engine/modules/settings/actions.d.ts +13 -3
  554. package/dist/engine/modules/settings/actions.js +24 -0
  555. package/dist/engine/modules/settings/atom.actions.d.ts +50 -6
  556. package/dist/engine/modules/settings/atom.actions.js +324 -0
  557. package/dist/engine/modules/settings/generator.actions.d.ts +8 -2
  558. package/dist/engine/modules/settings/generator.actions.js +132 -0
  559. package/dist/engine/modules/settings/history.js +65 -0
  560. package/dist/engine/modules/settings/screenBaseline.d.ts +37 -0
  561. package/dist/engine/modules/settings/screenBaseline.js +82 -0
  562. package/dist/engine/modules/settings/scrollRange.js +18 -0
  563. package/dist/engine/modules/table/actions.d.ts +7 -0
  564. package/dist/engine/modules/table/actions.js +17 -0
  565. package/dist/engine/modules/table/atom.actions.d.ts +46 -0
  566. package/dist/engine/modules/table/atom.actions.js +231 -0
  567. package/dist/engine/modules/table/generator.actions.d.ts +7 -0
  568. package/dist/engine/modules/table/generator.actions.js +351 -0
  569. package/dist/engine/modules/table/history.d.ts +2 -0
  570. package/dist/engine/modules/table/history.js +134 -0
  571. package/dist/engine/modules/table/hooks.js +12 -0
  572. package/dist/engine/modules/table-column/actions.d.ts +7 -0
  573. package/dist/engine/modules/table-column/actions.js +19 -0
  574. package/dist/engine/modules/table-column/atom.actions.d.ts +49 -0
  575. package/dist/engine/modules/table-column/atom.actions.js +223 -0
  576. package/dist/engine/modules/table-column/generator.actions.d.ts +5 -0
  577. package/dist/engine/modules/table-column/generator.actions.js +165 -0
  578. package/dist/engine/modules/table-column/history.d.ts +3 -0
  579. package/dist/engine/modules/table-column/history.js +146 -0
  580. package/dist/engine/modules/table-column/hooks.js +33 -0
  581. package/dist/engine/modules/table-column/keys.js +30 -0
  582. package/dist/engine/modules/table-column/utils/dataType.d.ts +3 -1
  583. package/dist/engine/modules/table-column/utils/dataType.js +71 -0
  584. package/dist/engine/modules/table-group/actions.js +13 -0
  585. package/dist/engine/modules/table-group/atom.actions.js +108 -0
  586. package/dist/engine/modules/table-group/generator.actions.js +158 -0
  587. package/dist/engine/modules/table-group/history.js +106 -0
  588. package/dist/engine/peer-store.js +318 -0
  589. package/dist/engine/presence.js +45 -0
  590. package/dist/engine/replication-store.js +95 -0
  591. package/dist/engine/rx-operators/actionsFilter.js +14 -0
  592. package/dist/engine/rx-operators/bufferCircuitBreaker.js +35 -0
  593. package/dist/engine/rx-operators/createSharedStreamActionsCompressor.js +24 -0
  594. package/dist/engine/rx-operators/flushOnNotifier.js +6 -0
  595. package/dist/engine/rx-operators/groupByStreamActions.js +32 -0
  596. package/dist/engine/rx-operators/ignoreTagFilter.js +17 -0
  597. package/dist/engine/rx-operators/lockIgnoreFilter.js +20 -0
  598. package/dist/engine/rx-operators/notEmptyActions.js +5 -0
  599. package/dist/engine/rx-operators/readonlyIgnoreFilter.d.ts +6 -1
  600. package/dist/engine/rx-operators/readonlyIgnoreFilter.js +23 -0
  601. package/dist/engine/rx-operators/readonlyScreenTag.d.ts +16 -0
  602. package/dist/engine/rx-operators/readonlyScreenTag.js +49 -0
  603. package/dist/engine/rx-operators/viewActionRedirect.js +32 -0
  604. package/dist/engine/rx-operators/viewIgnoreFilter.js +22 -0
  605. package/dist/engine/rx-store.d.ts +18 -1
  606. package/dist/engine/rx-store.js +158 -0
  607. package/dist/engine/settle.js +15 -0
  608. package/dist/engine/shared-store.js +114 -0
  609. package/dist/engine/store-hooks.js +36 -0
  610. package/dist/engine/store.js +39 -0
  611. package/dist/engine/stream-flush.js +9 -0
  612. package/dist/engine/tag.d.ts +13 -0
  613. package/dist/engine/tag.js +28 -0
  614. package/dist/engine/to-width.js +6 -0
  615. package/dist/erd-editor-schema/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.js +12 -0
  616. package/dist/erd-editor-schema/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPrimitive.js +14 -0
  617. package/dist/erd-editor-schema/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPropertyKey.js +9 -0
  618. package/dist/erd-editor-schema/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/typeof.js +11 -0
  619. package/dist/erd-editor-schema/dist/convert/v2ToV3.js +142 -0
  620. package/dist/erd-editor-schema/dist/dictionaryRows.js +86 -0
  621. package/dist/erd-editor-schema/dist/helper.js +28 -0
  622. package/dist/erd-editor-schema/dist/normalizeSettings.js +24 -0
  623. package/dist/erd-editor-schema/dist/orderKey.js +139 -0
  624. package/dist/erd-editor-schema/dist/parser.js +73 -0
  625. package/dist/erd-editor-schema/dist/query/index.js +98 -0
  626. package/dist/erd-editor-schema/dist/query/lww.js +38 -0
  627. package/dist/erd-editor-schema/dist/storageForm.js +209 -0
  628. package/dist/erd-editor-schema/dist/utils/bit.js +6 -0
  629. package/dist/erd-editor-schema/dist/v2/migrations/relationshipType.migration.js +14 -0
  630. package/dist/erd-editor-schema/dist/v2/parser/canvas.js +91 -0
  631. package/dist/erd-editor-schema/dist/v2/parser/index.js +16 -0
  632. package/dist/erd-editor-schema/dist/v2/parser/memo.js +40 -0
  633. package/dist/erd-editor-schema/dist/v2/parser/relationship.js +62 -0
  634. package/dist/erd-editor-schema/dist/v2/parser/table.js +125 -0
  635. package/dist/erd-editor-schema/dist/v2/schema/canvasEntity.js +65 -0
  636. package/dist/erd-editor-schema/dist/v2/schema/relationshipEntity.js +25 -0
  637. package/dist/erd-editor-schema/dist/v2/schema/tableEntity.js +8 -0
  638. package/dist/erd-editor-schema/dist/v3/parser/doc.js +29 -0
  639. package/dist/erd-editor-schema/dist/v3/parser/domain.entity.js +28 -0
  640. package/dist/erd-editor-schema/dist/v3/parser/index.entity.js +33 -0
  641. package/dist/erd-editor-schema/dist/v3/parser/index.js +107 -0
  642. package/dist/erd-editor-schema/dist/v3/parser/indexColumn.entity.js +27 -0
  643. package/dist/erd-editor-schema/dist/v3/parser/memo.entity.js +38 -0
  644. package/dist/erd-editor-schema/dist/v3/parser/migrateScroll.js +11 -0
  645. package/dist/erd-editor-schema/dist/v3/parser/relationship.entity.js +60 -0
  646. package/dist/erd-editor-schema/dist/v3/parser/settings.js +140 -0
  647. package/dist/erd-editor-schema/dist/v3/parser/table.entity.js +55 -0
  648. package/dist/erd-editor-schema/dist/v3/parser/tableColumn.entity.js +54 -0
  649. package/dist/erd-editor-schema/dist/v3/parser/tableGroup.entity.js +37 -0
  650. package/dist/erd-editor-schema/dist/v3/parser/term.entity.js +30 -0
  651. package/dist/erd-editor-schema/dist/v3/parser/word.entity.js +32 -0
  652. package/dist/erd-editor-schema/dist/v3/schema/index.js +46 -0
  653. package/dist/erd-editor-schema/dist/v3/schema/indexColumn.entity.js +8 -0
  654. package/dist/erd-editor-schema/dist/v3/schema/relationship.entity.js +31 -0
  655. package/dist/erd-editor-schema/dist/v3/schema/settings.js +141 -0
  656. package/dist/erd-editor-schema/dist/v3/schema/tableColumn.entity.js +14 -0
  657. package/dist/erd-editor.d.ts +2 -0
  658. package/dist/erd-editor.js +4 -0
  659. package/dist/erd-editor.umd.js +1277 -892
  660. package/dist/erd-viewer.d.ts +2 -0
  661. package/dist/erd-viewer.js +4 -0
  662. package/dist/erd-viewer.umd.js +696 -0
  663. package/dist/grid/dist/Grid.js +511 -0
  664. package/dist/grid/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.js +12 -0
  665. package/dist/grid/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPrimitive.js +14 -0
  666. package/dist/grid/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPropertyKey.js +9 -0
  667. package/dist/grid/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/typeof.js +11 -0
  668. package/dist/grid/dist/font.js +58 -0
  669. package/dist/grid/dist/input/editing.js +460 -0
  670. package/dist/grid/dist/input/pointer.js +426 -0
  671. package/dist/grid/dist/model/columns.js +41 -0
  672. package/dist/grid/dist/model/editing.js +93 -0
  673. package/dist/grid/dist/model/keys.js +89 -0
  674. package/dist/grid/dist/model/selection.js +237 -0
  675. package/dist/grid/dist/model/text.js +122 -0
  676. package/dist/grid/dist/model/tsv.js +108 -0
  677. package/dist/grid/dist/model/viewport.js +75 -0
  678. package/dist/grid/dist/scene/GridScene.js +64 -0
  679. package/dist/grid/dist/scene/draw/cells.js +61 -0
  680. package/dist/grid/dist/scene/draw/context.js +17 -0
  681. package/dist/grid/dist/scene/draw/headers.js +48 -0
  682. package/dist/grid/dist/scene/draw/scrollbar.js +70 -0
  683. package/dist/grid/dist/scene/layout.js +62 -0
  684. package/dist/grid/dist/scene/overlay.js +144 -0
  685. package/dist/grid/dist/scene/paint.js +123 -0
  686. package/dist/grid/dist/scene/state.js +269 -0
  687. package/dist/grid/dist/theme.js +37 -0
  688. package/dist/hooks/useDarkMode.d.ts +2 -0
  689. package/dist/hooks/useDarkMode.js +35 -0
  690. package/dist/hooks/useFlipAnimation.js +10 -0
  691. package/dist/hooks/useKeyBindingMap.js +55 -0
  692. package/dist/hooks/useNavigatorLanguages.js +22 -0
  693. package/dist/hooks/usePinchZoom.d.ts +6 -1
  694. package/dist/hooks/usePinchZoom.js +60 -0
  695. package/dist/hooks/useUnmounted.js +16 -0
  696. package/dist/hooks/useViewShortcut.d.ts +14 -0
  697. package/dist/hooks/useViewShortcut.js +34 -0
  698. package/dist/i18n/loadMessages.d.ts +12 -0
  699. package/dist/i18n/loadMessages.js +40 -0
  700. package/dist/i18n/locales.js +145 -0
  701. package/dist/i18n/menuLabel.js +4 -0
  702. package/dist/i18n/messages/ar-SA.d.ts +127 -3
  703. package/dist/i18n/messages/ar-SA.js +550 -0
  704. package/dist/i18n/messages/de-DE.d.ts +95 -3
  705. package/dist/i18n/messages/de-DE.js +498 -0
  706. package/dist/i18n/messages/en/code.js +13 -0
  707. package/dist/i18n/messages/en/colorPicker.js +36 -0
  708. package/dist/i18n/messages/en/common.d.ts +11 -0
  709. package/dist/i18n/messages/en/common.js +76 -0
  710. package/dist/i18n/messages/en/contextMenu.d.ts +1 -0
  711. package/dist/i18n/messages/en/contextMenu.js +31 -0
  712. package/dist/i18n/messages/en/dictionary.d.ts +79 -0
  713. package/dist/i18n/messages/en/dictionary.js +76 -0
  714. package/dist/i18n/messages/en/explorer.js +38 -0
  715. package/dist/i18n/messages/en/exportImage.js +23 -0
  716. package/dist/i18n/messages/en/feedback.js +9 -0
  717. package/dist/i18n/messages/en/findReplace.d.ts +2 -0
  718. package/dist/i18n/messages/en/findReplace.js +43 -0
  719. package/dist/i18n/messages/en/floatingToolbar.js +13 -0
  720. package/dist/i18n/messages/en/index.d.ts +95 -3
  721. package/dist/i18n/messages/en/index.js +47 -0
  722. package/dist/i18n/messages/en/mapColumns.js +36 -0
  723. package/dist/i18n/messages/en/palette.d.ts +4 -0
  724. package/dist/i18n/messages/en/palette.js +36 -0
  725. package/dist/i18n/messages/en/schemaSql.d.ts +1 -0
  726. package/dist/i18n/messages/en/schemaSql.js +27 -0
  727. package/dist/i18n/messages/en/settings.d.ts +1 -3
  728. package/dist/i18n/messages/en/settings.js +18 -0
  729. package/dist/i18n/messages/en/shortcuts.js +35 -0
  730. package/dist/i18n/messages/en/tableProperties.js +35 -0
  731. package/dist/i18n/messages/en/themeBuilder.js +8 -0
  732. package/dist/i18n/messages/en/toolbar.js +9 -0
  733. package/dist/i18n/messages/en/viewer.d.ts +6 -0
  734. package/dist/i18n/messages/en/viewer.js +7 -0
  735. package/dist/i18n/messages/en/visualization.d.ts +2 -0
  736. package/dist/i18n/messages/en/visualization.js +15 -0
  737. package/dist/i18n/messages/en/welcome.js +14 -0
  738. package/dist/i18n/messages/es-ES.d.ts +103 -3
  739. package/dist/i18n/messages/es-ES.js +511 -0
  740. package/dist/i18n/messages/eu-ES.d.ts +95 -3
  741. package/dist/i18n/messages/eu-ES.js +498 -0
  742. package/dist/i18n/messages/fa-IR.d.ts +95 -3
  743. package/dist/i18n/messages/fa-IR.js +498 -0
  744. package/dist/i18n/messages/fr-FR.d.ts +103 -3
  745. package/dist/i18n/messages/fr-FR.js +511 -0
  746. package/dist/i18n/messages/he-IL.d.ts +103 -3
  747. package/dist/i18n/messages/he-IL.js +511 -0
  748. package/dist/i18n/messages/id-ID.d.ts +87 -3
  749. package/dist/i18n/messages/id-ID.js +459 -0
  750. package/dist/i18n/messages/index.d.ts +3 -3
  751. package/dist/i18n/messages/index.js +58 -0
  752. package/dist/i18n/messages/it-IT.d.ts +103 -3
  753. package/dist/i18n/messages/it-IT.js +511 -0
  754. package/dist/i18n/messages/ja-JP.d.ts +87 -3
  755. package/dist/i18n/messages/ja-JP.js +459 -0
  756. package/dist/i18n/messages/ko-KR.d.ts +87 -3
  757. package/dist/i18n/messages/ko-KR.js +459 -0
  758. package/dist/i18n/messages/nl-NL.d.ts +95 -3
  759. package/dist/i18n/messages/nl-NL.js +498 -0
  760. package/dist/i18n/messages/pl-PL.d.ts +111 -3
  761. package/dist/i18n/messages/pl-PL.js +524 -0
  762. package/dist/i18n/messages/pt-BR.d.ts +103 -3
  763. package/dist/i18n/messages/pt-BR.js +511 -0
  764. package/dist/i18n/messages/pt-PT.d.ts +103 -3
  765. package/dist/i18n/messages/pt-PT.js +511 -0
  766. package/dist/i18n/messages/ro-RO.d.ts +103 -3
  767. package/dist/i18n/messages/ro-RO.js +511 -0
  768. package/dist/i18n/messages/ru-RU.d.ts +111 -3
  769. package/dist/i18n/messages/ru-RU.js +524 -0
  770. package/dist/i18n/messages/sk-SK.d.ts +111 -3
  771. package/dist/i18n/messages/sk-SK.js +524 -0
  772. package/dist/i18n/messages/sl-SI.d.ts +111 -3
  773. package/dist/i18n/messages/sl-SI.js +524 -0
  774. package/dist/i18n/messages/sv-SE.d.ts +95 -3
  775. package/dist/i18n/messages/sv-SE.js +498 -0
  776. package/dist/i18n/messages/tr-TR.d.ts +95 -3
  777. package/dist/i18n/messages/tr-TR.js +498 -0
  778. package/dist/i18n/messages/uk-UA.d.ts +111 -3
  779. package/dist/i18n/messages/uk-UA.js +524 -0
  780. package/dist/i18n/messages/zh-CN.d.ts +87 -3
  781. package/dist/i18n/messages/zh-CN.js +459 -0
  782. package/dist/i18n/messages/zh-TW.d.ts +87 -3
  783. package/dist/i18n/messages/zh-TW.js +459 -0
  784. package/dist/i18n/resolveLocale.js +28 -0
  785. package/dist/i18n/source.js +6 -0
  786. package/dist/i18n/translate.js +34 -0
  787. package/dist/index.d.ts +4 -1
  788. package/dist/index.js +8 -41112
  789. package/dist/internal-types/index.d.ts +6 -0
  790. package/dist/konva/scene/columnDropTarget.d.ts +2 -2
  791. package/dist/konva/scene/columnDropTarget.js +43 -0
  792. package/dist/konva/scene/contentBounds.js +48 -0
  793. package/dist/konva/scene/fitZoom.d.ts +7 -0
  794. package/dist/konva/scene/fitZoom.js +31 -0
  795. package/dist/konva/scene/konvaFlip.js +125 -0
  796. package/dist/konva/scene/metrics.js +59 -0
  797. package/dist/konva/scene/renderScene.js +37 -0
  798. package/dist/konva/scene/stacking.js +13 -0
  799. package/dist/konva/scene/viewFreeze.js +29 -0
  800. package/dist/konva/scene/viewLayout.js +171 -0
  801. package/dist/konva/scene/viewport.js +86 -0
  802. package/dist/konva/testHandle.d.ts +9 -3
  803. package/dist/konva/testHandle.js +5 -0
  804. package/dist/konva/theme.js +45 -0
  805. package/dist/peer/index.d.ts +4 -0
  806. package/dist/peer/index.js +35 -234
  807. package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/assertClassBrand.js +7 -0
  808. package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/checkPrivateRedeclaration.js +6 -0
  809. package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldGet2.js +7 -0
  810. package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldInitSpec.js +7 -0
  811. package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldSet2.js +7 -0
  812. package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.js +12 -0
  813. package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPrimitive.js +14 -0
  814. package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPropertyKey.js +9 -0
  815. package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/typeof.js +11 -0
  816. package/dist/r-html/dist/constants.js +36 -0
  817. package/dist/r-html/dist/context/createContext.js +49 -0
  818. package/dist/r-html/dist/context/useContext.js +28 -0
  819. package/dist/r-html/dist/context/useProvider.js +41 -0
  820. package/dist/r-html/dist/css/compile.js +27 -0
  821. package/dist/r-html/dist/css/diagnostics.js +195 -0
  822. package/dist/r-html/dist/css/element.js +34 -0
  823. package/dist/r-html/dist/css/emit.js +26 -0
  824. package/dist/r-html/dist/css/flatten.js +76 -0
  825. package/dist/r-html/dist/css/hash.js +15 -0
  826. package/dist/r-html/dist/css/index.js +31 -0
  827. package/dist/r-html/dist/css/selector.js +11 -0
  828. package/dist/r-html/dist/helpers/array.js +9 -0
  829. package/dist/r-html/dist/helpers/fn.js +14 -0
  830. package/dist/r-html/dist/helpers/is-type.js +16 -0
  831. package/dist/r-html/dist/helpers/subject.js +21 -0
  832. package/dist/r-html/dist/observable/index.js +78 -0
  833. package/dist/r-html/dist/observable/scheduler.js +84 -0
  834. package/dist/r-html/dist/parser/html/helper.js +58 -0
  835. package/dist/r-html/dist/parser/html/index.js +101 -0
  836. package/dist/r-html/dist/parser/html/tokenizer.js +161 -0
  837. package/dist/r-html/dist/parser/vNode.js +32 -0
  838. package/dist/r-html/dist/render/directives/attribute/ref.js +18 -0
  839. package/dist/r-html/dist/render/directives/attributeDirective.js +7 -0
  840. package/dist/r-html/dist/render/directives/index.js +13 -0
  841. package/dist/r-html/dist/render/directives/node/cache.js +56 -0
  842. package/dist/r-html/dist/render/directives/node/innerHTML.js +20 -0
  843. package/dist/r-html/dist/render/directives/node/repeat.js +124 -0
  844. package/dist/r-html/dist/render/directives/nodeDirective.js +15 -0
  845. package/dist/r-html/dist/render/domAdapter.js +74 -0
  846. package/dist/r-html/dist/render/helper.js +91 -0
  847. package/dist/r-html/dist/render/hmr.js +64 -0
  848. package/dist/r-html/dist/render/host.js +16 -0
  849. package/dist/r-html/dist/render/hostTemplate.js +35 -0
  850. package/dist/r-html/dist/render/index.js +9 -0
  851. package/dist/r-html/dist/render/part/attribute/attribute.js +102 -0
  852. package/dist/r-html/dist/render/part/attribute/boolean.js +33 -0
  853. package/dist/r-html/dist/render/part/attribute/directive.js +48 -0
  854. package/dist/r-html/dist/render/part/attribute/event.js +49 -0
  855. package/dist/r-html/dist/render/part/attribute/index.js +12 -0
  856. package/dist/r-html/dist/render/part/attribute/property.js +30 -0
  857. package/dist/r-html/dist/render/part/attribute/spread.js +28 -0
  858. package/dist/r-html/dist/render/part/container.js +64 -0
  859. package/dist/r-html/dist/render/part/index.js +32 -0
  860. package/dist/r-html/dist/render/part/node/comment.js +34 -0
  861. package/dist/r-html/dist/render/part/node/component/hooks.js +28 -0
  862. package/dist/r-html/dist/render/part/node/component/index.js +37 -0
  863. package/dist/r-html/dist/render/part/node/component/observableComponent.js +111 -0
  864. package/dist/r-html/dist/render/part/node/component/prop.js +30 -0
  865. package/dist/r-html/dist/render/part/node/component/webComponent/helper.js +19 -0
  866. package/dist/r-html/dist/render/part/node/component/webComponent/index.js +79 -0
  867. package/dist/r-html/dist/render/part/node/text/array.js +87 -0
  868. package/dist/r-html/dist/render/part/node/text/arrayDiff.js +90 -0
  869. package/dist/r-html/dist/render/part/node/text/directive.js +51 -0
  870. package/dist/r-html/dist/render/part/node/text/function.js +7 -0
  871. package/dist/r-html/dist/render/part/node/text/helper.js +55 -0
  872. package/dist/r-html/dist/render/part/node/text/index.js +54 -0
  873. package/dist/r-html/dist/render/part/node/text/node.js +25 -0
  874. package/dist/r-html/dist/render/part/node/text/object.js +60 -0
  875. package/dist/r-html/dist/render/part/node/text/primitive.js +26 -0
  876. package/dist/r-html/dist/render/part/node/text/templateLiterals.js +38 -0
  877. package/dist/r-html/dist/render/value.js +8 -0
  878. package/dist/r-html/dist/store/index.js +72 -0
  879. package/dist/r-html/dist/template/css.js +70 -0
  880. package/dist/r-html/dist/template/cssDiagnostics.js +23 -0
  881. package/dist/r-html/dist/template/cssSource.js +62 -0
  882. package/dist/r-html/dist/template/helper.js +37 -0
  883. package/dist/r-html/dist/template/html.js +29 -0
  884. package/dist/r-html/dist/template/index.js +13 -0
  885. package/dist/r-html/dist/template/tNode.js +107 -0
  886. package/dist/r-html/dist/template/vCSSStyleSheet.js +162 -0
  887. package/dist/r-html-konva/dist/batchDraw.js +90 -0
  888. package/dist/r-html-konva/dist/host.js +336 -0
  889. package/dist/schema-sql-parser/dist/parser/dataType/Databricks.js +50 -0
  890. package/dist/schema-sql-parser/dist/parser/dataType/MSSQL.js +53 -0
  891. package/dist/schema-sql-parser/dist/parser/dataType/MariaDB.js +91 -0
  892. package/dist/schema-sql-parser/dist/parser/dataType/MySQL.js +75 -0
  893. package/dist/schema-sql-parser/dist/parser/dataType/Oracle.js +56 -0
  894. package/dist/schema-sql-parser/dist/parser/dataType/PostgreSQL.js +112 -0
  895. package/dist/schema-sql-parser/dist/parser/dataType/SQLite.js +36 -0
  896. package/dist/schema-sql-parser/dist/parser/dataType/Snowflake.js +59 -0
  897. package/dist/schema-sql-parser/dist/parser/helper.js +701 -0
  898. package/dist/schema-sql-parser/dist/parser/index.js +70 -0
  899. package/dist/schema-sql-parser/dist/parser/statement/add.extended.property.js +73 -0
  900. package/dist/schema-sql-parser/dist/parser/statement/alter.table.add.default.js +75 -0
  901. package/dist/schema-sql-parser/dist/parser/statement/alter.table.add.foreignKey.js +69 -0
  902. package/dist/schema-sql-parser/dist/parser/statement/alter.table.add.primaryKey.js +86 -0
  903. package/dist/schema-sql-parser/dist/parser/statement/alter.table.add.unique.js +128 -0
  904. package/dist/schema-sql-parser/dist/parser/statement/alter.table.alter.column.js +90 -0
  905. package/dist/schema-sql-parser/dist/parser/statement/comment.on.column.js +56 -0
  906. package/dist/schema-sql-parser/dist/parser/statement/comment.on.table.js +52 -0
  907. package/dist/schema-sql-parser/dist/parser/statement/create.index.js +61 -0
  908. package/dist/schema-sql-parser/dist/parser/statement/create.table.js +549 -0
  909. package/dist/schema-sql-parser/dist/parser/statement/default.expression.js +206 -0
  910. package/dist/schema-sql-parser/dist/parser/statement/index.columns.js +49 -0
  911. package/dist/schema-sql-parser/dist/parser/statement/index.js +25 -0
  912. package/dist/schema-sql-parser/dist/parser/tokenizer.js +241 -0
  913. package/dist/services/elk-layout/elkGraph.js +184 -0
  914. package/dist/services/elk-layout/elkLayoutOptions.js +52 -0
  915. package/dist/services/elk-layout/index.js +45 -0
  916. package/dist/services/export-png/ExportScene.d.ts +1 -1
  917. package/dist/services/export-png/ExportScene.js +30 -0
  918. package/dist/services/export-png/documentScene.d.ts +7 -1
  919. package/dist/services/export-png/documentScene.js +45 -0
  920. package/dist/services/export-png/exportBox.js +63 -0
  921. package/dist/services/export-png/exportTheme.js +16 -0
  922. package/dist/services/export-png/index.d.ts +11 -5
  923. package/dist/services/export-png/index.js +139 -0
  924. package/dist/services/export-png/pixelRatio.js +12 -0
  925. package/dist/services/export-png/renderPng.d.ts +4 -1
  926. package/dist/services/export-png/renderPng.js +52 -0
  927. package/dist/services/export-png/renderSvg.d.ts +4 -1
  928. package/dist/services/export-png/renderSvg.js +24 -0
  929. package/dist/services/export-png/sceneSvg.js +315 -0
  930. package/dist/services/export-png/textWidth.js +12 -0
  931. package/dist/services/export-png/toImage.d.ts +27 -0
  932. package/dist/services/export-png/toImage.js +49 -0
  933. package/dist/services/shiki/index.js +24 -0
  934. package/dist/styles/elevation.styles.js +9 -0
  935. package/dist/styles/fonts.styles.js +12 -0
  936. package/dist/styles/reset.styles.js +104 -0
  937. package/dist/styles/scrollbar.styles.js +27 -0
  938. package/dist/styles/typography.styles.js +63 -0
  939. package/dist/themes/radix-ui-theme.config.js +133 -0
  940. package/dist/themes/radix-ui-theme.js +231 -0
  941. package/dist/themes/tokens.d.ts +12 -0
  942. package/dist/themes/tokens.js +107 -0
  943. package/dist/utils/arrayHas.js +7 -0
  944. package/dist/utils/attribute.js +11 -0
  945. package/dist/utils/bit.js +6 -0
  946. package/dist/utils/calcMemo.js +9 -0
  947. package/dist/utils/calcTable.d.ts +20 -4
  948. package/dist/utils/calcTable.js +220 -0
  949. package/dist/utils/clickGesture.js +33 -0
  950. package/dist/utils/clipboard.js +45 -0
  951. package/dist/utils/collection/domain.entity.d.ts +3 -0
  952. package/dist/utils/collection/domain.entity.js +13 -0
  953. package/dist/utils/collection/index.entity.js +13 -0
  954. package/dist/utils/collection/indexColumn.entity.js +12 -0
  955. package/dist/utils/collection/memo.entity.js +18 -0
  956. package/dist/utils/collection/relationship.entity.js +28 -0
  957. package/dist/utils/collection/sequence.js +21 -0
  958. package/dist/utils/collection/table.entity.js +24 -0
  959. package/dist/utils/collection/tableColumn.entity.js +25 -0
  960. package/dist/utils/collection/tableGroup.entity.js +17 -0
  961. package/dist/utils/collection/term.entity.d.ts +3 -0
  962. package/dist/utils/collection/term.entity.js +14 -0
  963. package/dist/utils/collection/word.entity.d.ts +3 -0
  964. package/dist/utils/collection/word.entity.js +15 -0
  965. package/dist/utils/contrastText.js +26 -0
  966. package/dist/utils/deepMerge.js +24 -0
  967. package/dist/utils/device-detect/index.js +6 -0
  968. package/dist/utils/dictionary-csv/csv.d.ts +13 -0
  969. package/dist/utils/dictionary-csv/csv.js +61 -0
  970. package/dist/utils/dictionary-csv/decode.d.ts +7 -0
  971. package/dist/utils/dictionary-csv/decode.js +10 -0
  972. package/dist/utils/dictionary-csv/dictionaryCsv.d.ts +55 -0
  973. package/dist/utils/dictionary-csv/dictionaryCsv.js +150 -0
  974. package/dist/utils/dictionary-csv/index.d.ts +4 -0
  975. package/dist/utils/diff/compareEntities.js +200 -0
  976. package/dist/{components/erd/diff-viewer → utils/diff}/diff.d.ts +1 -1
  977. package/dist/utils/diff/diff.js +29 -0
  978. package/dist/utils/diff/diffDocuments.js +224 -0
  979. package/dist/utils/diff/pairEntities.js +71 -0
  980. package/dist/utils/diff/types.d.ts +5 -1
  981. package/dist/utils/diff/types.js +38 -0
  982. package/dist/utils/domEvent.js +55 -0
  983. package/dist/utils/dragSelect.js +9 -0
  984. package/dist/utils/draw-relationship/bezier.js +44 -0
  985. package/dist/utils/draw-relationship/calc.js +91 -0
  986. package/dist/utils/draw-relationship/corner.js +60 -0
  987. package/dist/utils/draw-relationship/draw.js +194 -0
  988. package/dist/utils/draw-relationship/incremental.d.ts +4 -4
  989. package/dist/utils/draw-relationship/incremental.js +135 -0
  990. package/dist/utils/draw-relationship/index.d.ts +16 -1
  991. package/dist/utils/draw-relationship/index.js +198 -0
  992. package/dist/utils/draw-relationship/loop.js +25 -0
  993. package/dist/utils/draw-relationship/nudge.js +402 -0
  994. package/dist/utils/draw-relationship/pathFinding.js +277 -0
  995. package/dist/utils/draw-relationship/route.d.ts +12 -0
  996. package/dist/utils/draw-relationship/route.js +460 -0
  997. package/dist/utils/draw-relationship/search.d.ts +15 -0
  998. package/dist/utils/draw-relationship/search.js +294 -0
  999. package/dist/utils/draw-relationship/sort.js +370 -0
  1000. package/dist/utils/draw-relationship/stub.js +46 -0
  1001. package/dist/utils/emitter.d.ts +15 -0
  1002. package/dist/utils/emitter.js +76 -0
  1003. package/dist/utils/file/exportFile.d.ts +10 -0
  1004. package/dist/utils/file/exportFile.js +52 -0
  1005. package/dist/utils/file/importFile.js +201 -0
  1006. package/dist/utils/file/importSchema.js +128 -0
  1007. package/dist/utils/find-replace/findMatches.d.ts +10 -4
  1008. package/dist/utils/find-replace/findMatches.js +212 -0
  1009. package/dist/utils/find-replace/index.d.ts +0 -1
  1010. package/dist/utils/find-replace/matcher.js +128 -0
  1011. package/dist/utils/find-replace/present.d.ts +1 -1
  1012. package/dist/utils/find-replace/present.js +48 -0
  1013. package/dist/utils/find-replace/preserveCase.js +25 -0
  1014. package/dist/utils/find-replace/replaceActions.d.ts +9 -5
  1015. package/dist/utils/find-replace/replaceActions.js +70 -0
  1016. package/dist/utils/flipAnimation.js +52 -0
  1017. package/dist/utils/focus.d.ts +2 -0
  1018. package/dist/utils/focus.js +40 -0
  1019. package/dist/utils/formatCount.d.ts +10 -0
  1020. package/dist/utils/formatCount.js +12 -0
  1021. package/dist/utils/generator-code/aml.js +199 -0
  1022. package/dist/utils/generator-code/columnTypes.js +369 -0
  1023. package/dist/utils/generator-code/csharp.js +230 -0
  1024. package/dist/utils/generator-code/dbml.js +248 -0
  1025. package/dist/utils/generator-code/doctrine.js +964 -0
  1026. package/dist/utils/generator-code/doctrineReservedWords.js +57 -0
  1027. package/dist/utils/generator-code/drizzle.js +1853 -0
  1028. package/dist/utils/generator-code/go.js +160 -0
  1029. package/dist/utils/generator-code/graphql.js +347 -0
  1030. package/dist/utils/generator-code/heck.js +47 -0
  1031. package/dist/utils/generator-code/index.js +179 -0
  1032. package/dist/utils/generator-code/java.js +179 -0
  1033. package/dist/utils/generator-code/jpa.js +218 -0
  1034. package/dist/utils/generator-code/jsonSchema.js +402 -0
  1035. package/dist/utils/generator-code/jsonShape.js +169 -0
  1036. package/dist/utils/generator-code/kotlin.js +102 -0
  1037. package/dist/utils/generator-code/mermaid.js +130 -0
  1038. package/dist/utils/generator-code/php.js +211 -0
  1039. package/dist/utils/generator-code/rust.js +143 -0
  1040. package/dist/utils/generator-code/rustTypes.js +132 -0
  1041. package/dist/utils/generator-code/scala.js +124 -0
  1042. package/dist/utils/generator-code/seaorm.js +581 -0
  1043. package/dist/utils/generator-code/sequelize.js +1225 -0
  1044. package/dist/utils/generator-code/sqlalchemy.js +1250 -0
  1045. package/dist/utils/generator-code/swift.js +222 -0
  1046. package/dist/utils/generator-code/typeorm.js +998 -0
  1047. package/dist/utils/generator-code/typescript.js +67 -0
  1048. package/dist/utils/generator-code/utils.js +87 -0
  1049. package/dist/utils/generator-code/zod.js +106 -0
  1050. package/dist/utils/globalEventObservable.js +67 -0
  1051. package/dist/utils/highlightWords.js +48 -0
  1052. package/dist/utils/icon.js +35 -0
  1053. package/dist/utils/index.js +26 -0
  1054. package/dist/utils/internalEvents.js +26 -0
  1055. package/dist/utils/keyboard-shortcut/bindKeys.js +30 -0
  1056. package/dist/utils/keyboard-shortcut/index.d.ts +7 -1
  1057. package/dist/utils/keyboard-shortcut/index.js +243 -0
  1058. package/dist/utils/keyboard-shortcut/utils.js +32 -0
  1059. package/dist/utils/loadValue.js +11 -0
  1060. package/dist/utils/map-columns/alignTypes.d.ts +3 -3
  1061. package/dist/utils/map-columns/alignTypes.js +48 -0
  1062. package/dist/utils/map-columns/buildRows.js +337 -0
  1063. package/dist/utils/map-columns/candidateKeys.js +24 -0
  1064. package/dist/utils/map-columns/mapping.js +41 -0
  1065. package/dist/utils/map-columns/prefill.js +32 -0
  1066. package/dist/utils/map-columns/toMapColumnsActions.js +63 -0
  1067. package/dist/utils/map-columns/validate.js +81 -0
  1068. package/dist/utils/memo.js +6 -0
  1069. package/dist/utils/pinch.d.ts +5 -1
  1070. package/dist/utils/pinch.js +99 -0
  1071. package/dist/utils/promise.js +16 -0
  1072. package/dist/utils/referentialAction.js +23 -0
  1073. package/dist/utils/rx-operators/fromCopy.js +7 -0
  1074. package/dist/utils/rx-operators/fromPaste.js +7 -0
  1075. package/dist/utils/rx-operators/fromShadowDraggable.js +5 -0
  1076. package/dist/utils/safeCallback.js +10 -0
  1077. package/dist/utils/schema-aml-parser/convert.js +285 -0
  1078. package/dist/utils/schema-aml-parser/dataType.js +57 -0
  1079. package/dist/utils/schema-aml-parser/index.js +22 -0
  1080. package/dist/utils/schema-aml-parser/parser.js +637 -0
  1081. package/dist/utils/schema-aml-parser/tokenizer.js +208 -0
  1082. package/dist/utils/schema-aml-parser/types.js +8 -0
  1083. package/dist/utils/schema-dbml-parser/convert.js +324 -0
  1084. package/dist/utils/schema-dbml-parser/dataType.js +32 -0
  1085. package/dist/utils/schema-dbml-parser/index.js +23 -0
  1086. package/dist/utils/schema-dbml-parser/parser.js +646 -0
  1087. package/dist/utils/schema-dbml-parser/tokenizer.js +185 -0
  1088. package/dist/utils/schema-graphql-parser/convert.js +410 -0
  1089. package/dist/utils/schema-graphql-parser/dataType.js +228 -0
  1090. package/dist/utils/schema-graphql-parser/index.js +23 -0
  1091. package/dist/utils/schema-graphql-parser/parser.js +490 -0
  1092. package/dist/utils/schema-sql/Databricks.d.ts +2 -2
  1093. package/dist/utils/schema-sql/Databricks.js +158 -0
  1094. package/dist/utils/schema-sql/MSSQL.d.ts +1 -1
  1095. package/dist/utils/schema-sql/MSSQL.js +214 -0
  1096. package/dist/utils/schema-sql/MariaDB.d.ts +2 -2
  1097. package/dist/utils/schema-sql/MariaDB.js +143 -0
  1098. package/dist/utils/schema-sql/MySQL.d.ts +2 -2
  1099. package/dist/utils/schema-sql/MySQL.js +224 -0
  1100. package/dist/utils/schema-sql/Oracle.d.ts +1 -1
  1101. package/dist/utils/schema-sql/Oracle.js +236 -0
  1102. package/dist/utils/schema-sql/PostgreSQL.d.ts +1 -1
  1103. package/dist/utils/schema-sql/PostgreSQL.js +179 -0
  1104. package/dist/utils/schema-sql/SQLite.d.ts +2 -2
  1105. package/dist/utils/schema-sql/SQLite.js +129 -0
  1106. package/dist/utils/schema-sql/Snowflake.d.ts +2 -2
  1107. package/dist/utils/schema-sql/Snowflake.js +148 -0
  1108. package/dist/utils/schema-sql/index.d.ts +6 -3
  1109. package/dist/utils/schema-sql/index.js +238 -0
  1110. package/dist/utils/schema-sql/options.d.ts +2 -0
  1111. package/dist/utils/schema-sql/options.js +97 -0
  1112. package/dist/utils/schema-sql/utils.d.ts +15 -43
  1113. package/dist/utils/schema-sql/utils.js +251 -0
  1114. package/dist/utils/schema-sql-parser/index.js +312 -0
  1115. package/dist/utils/schema-sql-parser/utils.js +7 -0
  1116. package/dist/utils/sharedColor.js +19 -0
  1117. package/dist/utils/stageCursor.js +20 -0
  1118. package/dist/utils/table-clipboard/copy.d.ts +2 -3
  1119. package/dist/utils/table-clipboard/copy.js +208 -0
  1120. package/dist/utils/table-clipboard/index.d.ts +9 -1
  1121. package/dist/utils/table-clipboard/index.js +28 -0
  1122. package/dist/utils/table-clipboard/paste.d.ts +2 -2
  1123. package/dist/utils/table-clipboard/paste.js +154 -0
  1124. package/dist/utils/table-clipboard/payload.d.ts +12 -0
  1125. package/dist/utils/table-clipboard/payload.js +73 -0
  1126. package/dist/utils/table-clipboard/placement.js +54 -0
  1127. package/dist/utils/tableColor.js +139 -0
  1128. package/dist/utils/tableGroup.js +146 -0
  1129. package/dist/utils/tableKeys.js +82 -0
  1130. package/dist/utils/tableName.d.ts +47 -0
  1131. package/dist/utils/tableName.js +72 -0
  1132. package/dist/utils/takeover.js +10 -0
  1133. package/dist/utils/text.js +47 -0
  1134. package/dist/utils/validation.d.ts +1 -0
  1135. package/dist/utils/validation.js +47 -0
  1136. package/dist/utils/virtualRange.js +21 -0
  1137. package/dist/uuid/dist/uuid25.js +11 -0
  1138. package/dist/uuid/dist/uuidv7.js +25 -0
  1139. package/dist/workers/elkLayout.shared-worker.js +327 -1
  1140. package/dist/workers/elkLayout.spawn.d.ts +3 -0
  1141. package/dist/workers/elkLayout.spawn.inline.d.ts +3 -0
  1142. package/dist/workers/elkLayout.spawn.js +9 -0
  1143. package/dist/workers/exportPng.shared-worker.js +32969 -54
  1144. package/dist/workers/exportPng.spawn.d.ts +7 -0
  1145. package/dist/workers/exportPng.spawn.inline.d.ts +7 -0
  1146. package/dist/workers/exportPng.spawn.js +9 -0
  1147. package/dist/workers/shiki.shared-worker.js +119 -1
  1148. package/dist/workers/shiki.spawn.d.ts +3 -0
  1149. package/dist/workers/shiki.spawn.inline.d.ts +3 -0
  1150. package/dist/workers/shiki.spawn.js +9 -0
  1151. package/package.json +39 -5
  1152. package/dist/components/customElementRegistry.d.ts +0 -1
  1153. package/dist/components/erd/diff-viewer/diffContext.d.ts +0 -9
  1154. package/dist/components/erd/diff-viewer/erd-viewer/ErdViewer.d.ts +0 -11
  1155. package/dist/konva/batchDraw.d.ts +0 -42
  1156. package/dist/konva/host.d.ts +0 -30
  1157. package/dist/konva/jsx-types.test-d.d.ts +0 -2
  1158. package/dist/loadValue-BKvXDYoC.js +0 -12925
  1159. package/dist/shared-store-2IUOt99m.js +0 -1341
  1160. package/dist/workers/spawn.d.ts +0 -9
  1161. package/dist/workers/spawn.inline.d.ts +0 -9
  1162. /package/dist/components/erd/{floating-toolbar → view-controls}/ToolbarCompass.template.d.ts +0 -0
@@ -1,1341 +0,0 @@
1
- import { Aa as e, C as t, Ca as n, D as r, Da as i, E as a, Ea as o, Fa as s, Ia as c, Kn as l, Ko as u, Mo as d, Na as f, Oa as p, Sa as m, T as h, Ta as g, Vo as _, Xa as v, Ya as y, Za as b, Zo as x, _ as ee, _a as S, a as te, aa as C, b as ne, ba as w, c as T, ca as E, cs as D, da as O, dr as re, fa as k, g as ie, gs as ae, h as oe, ha as se, hr as ce, hs as A, i as le, ja as j, jo as M, ka as N, l as P, la as F, m as ue, ma as I, mr as de, n as fe, ni as L, o as pe, oa as R, oo as me, pa as z, pn as he, ps as B, r as ge, s as _e, sa as ve, ts as V, ua as H, va as U, w as ye, wa as W, x as be, xa as xe, ya as G } from "./loadValue-BKvXDYoC.js";
2
- import { Observable as K, Subject as q, debounceTime as Se, filter as Ce, map as we, merge as Te, race as Ee, startWith as De, switchMap as J, take as Oe, timer as ke } from "rxjs";
3
- import { isEmpty as Ae } from "es-toolkit/compat";
4
- import { isFunction as je, isNil as Y } from "es-toolkit";
5
- //#region src/engine/history.ts
6
- function X({ notify: e, dispatch: t, getNextVersion: n }, r) {
7
- let i = r?.commands ?? [], a = r?.cursor ?? -1, o = r?.limit ?? 0, s = !0, c = () => a !== -1, l = () => a < i.length - 1, u = (e) => o = e, d = () => ({
8
- hasRedo: l(),
9
- hasUndo: c()
10
- }), f = (e, r) => {
11
- s = !1, e[r](t, n), s = !0;
12
- };
13
- return Object.freeze({
14
- get cursor() {
15
- return a;
16
- },
17
- get size() {
18
- return i.length;
19
- },
20
- hasUndo: c,
21
- hasRedo: l,
22
- push: (t) => {
23
- s && (i.splice(a + 1, i.length - a), i.push(t), o !== 0 && i.length > o && (i = i.slice(i.length - o, i.length)), a = i.length - 1, e(d()));
24
- },
25
- undo: () => {
26
- if (!c()) return;
27
- let t = i[a];
28
- f(t, "undo"), a--, e(d());
29
- },
30
- redo: () => {
31
- if (!l()) return;
32
- let t = i[a + 1];
33
- f(t, "redo"), a++, e(d());
34
- },
35
- clear: () => {
36
- let t = i.length;
37
- i = [], a = -1, t > 0 && e(d());
38
- },
39
- setLimit: u,
40
- clone: (e) => X(e, {
41
- commands: [...i],
42
- cursor: a,
43
- limit: o
44
- })
45
- });
46
- }
47
- //#endregion
48
- //#region src/engine/rx-operators/flushOnNotifier.ts
49
- var Me = (e) => (t) => t.pipe(J((t) => e.pipe(Oe(1), we(() => t)))), Ne = (e, t = 200) => (n) => n.pipe(J((n) => Ee(ke(t), e.pipe(Oe(1))).pipe(we(() => n)))), Pe = (e) => {
50
- let t = (e) => (t) => {
51
- let n = Reflect.get(ie, t.type);
52
- return !n || !M(e, n);
53
- };
54
- return (n) => new K((r) => n.subscribe({
55
- next: (n) => {
56
- r.next(n.filter(t(e())));
57
- },
58
- error: (e) => r.error(e),
59
- complete: () => r.complete()
60
- })).pipe(P);
61
- }, Z = (e, t = []) => {
62
- let n = _(ee), r = (e) => !Y(e.tags) && t.some((t) => M(e.tags, t)) || !n(e.type);
63
- return (t) => new K((n) => t.subscribe({
64
- next: (t) => {
65
- n.next(e() ? t.filter(r) : t);
66
- },
67
- error: (e) => n.error(e),
68
- complete: () => n.complete()
69
- })).pipe(P);
70
- }, Fe = {
71
- [L.scrollTo]: u.viewScrollTo,
72
- [L.streamScrollTo]: u.viewStreamScrollTo,
73
- [L.changeZoomLevel]: u.viewChangeZoomLevel,
74
- [L.streamZoomLevel]: u.viewStreamZoomLevel
75
- }, Ie = ({ tags: e }) => !Y(e) && (M(e, y.shared) || M(e, y.following)), Le = (e) => {
76
- let t = Fe[e.type];
77
- return t && !Ie(e) ? {
78
- ...e,
79
- type: t
80
- } : e;
81
- }, Re = (e) => (t) => new K((n) => t.subscribe({
82
- next: (t) => {
83
- n.next(e() ? t.map(Le) : t);
84
- },
85
- error: (e) => n.error(e),
86
- complete: () => n.complete()
87
- })), ze = (e, t = []) => {
88
- let n = _(r), i = (e) => !Y(e.tags) && t.some((t) => M(e.tags, t)) || !n(e.type);
89
- return (t) => new K((n) => t.subscribe({
90
- next: (t) => {
91
- n.next(e() ? t.filter(i) : t);
92
- },
93
- error: (e) => n.error(e),
94
- complete: () => n.complete()
95
- })).pipe(P);
96
- }, Be = 2048;
97
- function Ve(e, { getReadonly: n = () => !1, getHistory: r, manualStreamFlush: i = !1, observable: o = !0 } = {}) {
98
- let s = /* @__PURE__ */ new Set(), c = ge(e, o), u = fe(c), d = {
99
- notify: (e) => c.dispatch(l(e)),
100
- dispatch: c.dispatchSync,
101
- getNextVersion: () => e.clock.getNextVersion()
102
- }, f = r?.(d) ?? X(d);
103
- f.setLimit(Be);
104
- let p = () => me(c.state), m = new q(), g = m.pipe(Re(p)), _ = new q(), v = new q(), b = new q(), x = v.pipe(De(void 0), J(() => _.pipe(pe(t, [
105
- [
106
- "@@move",
107
- h,
108
- y.drag
109
- ],
110
- ["@@scroll", a],
111
- ["@@color", ye]
112
- ], i ? Me(b) : void 0)))), ee = new K((e) => c.subscribe((t) => e.next(t))).pipe(T(ue), Pe(() => c.state.settings.lockSettings), Z(n, [y.shared]), Se(200)), S = (...t) => {
113
- let n = e.clock.getNextVersion();
114
- return ae(c.state, c.context, t).map((e) => (Y(e.version) && (e.version = n), e));
115
- }, C = (...e) => {
116
- let t = S(e);
117
- m.next(t);
118
- }, ne = (...e) => {
119
- queueMicrotask(() => C(e));
120
- }, w = () => {
121
- Array.from(s).forEach((e) => je(e) ? e() : e.unsubscribe()), s.clear(), c.destroy(), u.destroy(), f.clear(), m.complete(), b.complete();
122
- }, E = () => {
123
- v.next(), f.clear();
124
- }, D = () => {
125
- n() || p() || f.undo();
126
- }, O = () => {
127
- n() || p() || f.redo();
128
- }, re = () => {
129
- i && b.next();
130
- };
131
- return s.add(x.subscribe(he(c, f))).add(g.pipe(T(oe), te([y.changeOnly, y.shared]), Z(n), ze(p)).subscribe(_)).add(g.pipe(Z(n, [y.shared]), ze(p, [y.shared])).subscribe(c.dispatchSync)).add(c.subscribe((t) => {
132
- t.forEach((t) => e.clock.merge(t.version));
133
- })), Object.freeze({
134
- ...c,
135
- dispatch: ne,
136
- dispatchSync: C,
137
- destroy: w,
138
- undo: D,
139
- redo: O,
140
- history: f,
141
- resetHistory: E,
142
- change$: ee,
143
- flushStreamBuffers: re,
144
- getReadonly: n
145
- });
146
- }
147
- //#endregion
148
- //#region src/utils/focus.ts
149
- function He(e, t, n, r = null) {
150
- if (!e || n !== e.tableId) return !1;
151
- switch (t) {
152
- case "tableName":
153
- case "tableComment": return t === e.focusType;
154
- }
155
- return r === e.columnId && t === e.focusType;
156
- }
157
- var Ue = (e, t, n) => e?.tableId === t && e.selectColumnIds.includes(n);
158
- function We(e, t, n, r = null) {
159
- if (e?.tableId !== n) return !1;
160
- switch (t) {
161
- case d.tableName:
162
- case d.tableComment: return t === e.focusType && e.edit;
163
- }
164
- return r === e.columnId && t === e.focusType && e.edit;
165
- }
166
- function Ge(e) {
167
- let t = e.value.length;
168
- e.selectionStart = t, e.selectionEnd = t, e.focus();
169
- }
170
- var Ke = (e) => e ? {
171
- tableId: e.tableId,
172
- columnId: e.columnId,
173
- focusType: e.focusType
174
- } : null, qe = (e) => e ? JSON.stringify([
175
- e.tableId,
176
- e.columnId,
177
- e.focusType
178
- ]) : "", Q = "`";
179
- function Je(e) {
180
- return `'${e.replace(/[\\']/g, "\\$&")}'`;
181
- }
182
- var Ye = "NOT ENFORCED RELY", Xe = G(V.Databricks), Ze = /* @__PURE__ */ new Set(["BIGINT", "LONG"]);
183
- function Qe(e) {
184
- return M(e.options, x.autoIncrement) && Ze.has(e.dataType.trim().toUpperCase());
185
- }
186
- function $e(e, t, { statements: n, written: r } = {}) {
187
- let i = [], a = [], s = [""], { tables: c, relationships: l, indexes: u } = o(e, t);
188
- return c.forEach((t) => {
189
- r?.tables.push(t), et(e, {
190
- table: t,
191
- buffer: s,
192
- statements: n
193
- }), s.push(""), tt(e, {
194
- table: t,
195
- buffer: s
196
- });
197
- }), l.forEach((t) => {
198
- rt(e, {
199
- relationship: t,
200
- buffer: s,
201
- fkNames: i,
202
- statements: n
203
- }) && s.push("");
204
- }), u.forEach((t) => {
205
- it(e, {
206
- index: t,
207
- buffer: s,
208
- indexNames: a
209
- }), s.push("");
210
- }), s.join("\n");
211
- }
212
- function et(e, { buffer: t, table: n, statements: r }) {
213
- let { collections: i } = e, a = B(i).collection("tableColumnEntities").selectByIds(n.columnIds);
214
- t.push(`CREATE TABLE${I(r)} ${Q}${n.name}${Q}`), t.push("(");
215
- let o = S(a), s = O(a);
216
- if (a.forEach((n, r) => {
217
- nt(e, {
218
- column: n,
219
- isComma: o || a.length !== r + 1,
220
- spaceSize: s,
221
- buffer: t
222
- });
223
- }), o) {
224
- let e = U(a);
225
- t.push(` CONSTRAINT ${Q}PK_${n.name}${Q} PRIMARY KEY (${F(e, Q)}) ${Ye}`);
226
- }
227
- t.push(")"), n.comment.trim() === "" ? t.push("USING DELTA;") : (t.push("USING DELTA"), t.push(`COMMENT ${Je(n.comment)};`));
228
- let c = a.filter((e) => M(e.options, x.autoIncrement) && !Qe(e));
229
- c.length !== 0 && (t.push(""), c.forEach((e) => {
230
- t.push(`-- Databricks takes IDENTITY only on BIGINT, so ${Q}${n.name}${Q}.${Q}${e.name}${Q} is written without it.`);
231
- }));
232
- }
233
- function tt({ collections: e }, { buffer: t, table: n }) {
234
- let r = B(e).collection("tableColumnEntities").selectByIds(n.columnIds);
235
- N(r).forEach((e) => {
236
- t.push(`-- Databricks does not support UNIQUE constraints: ${Q}${n.name}${Q}.${Q}${e.name}${Q}`), t.push("");
237
- });
238
- }
239
- function nt(e, { buffer: t, column: n, isComma: r, spaceSize: i }) {
240
- let a = [];
241
- a.push(` ${Q}${n.name}${Q}` + k(i.name - n.name.length)), a.push(`${n.dataType}` + k(i.dataType - n.dataType.length));
242
- let o = M(n.options, x.notNull) || M(n.options, x.primaryKey);
243
- a.push(o ? "NOT NULL" : " "), Qe(n) ? a.push("GENERATED ALWAYS AS IDENTITY") : !M(n.options, x.autoIncrement) && n.default.trim() !== "" && a.push(`DEFAULT ${n.default}`), n.comment.trim() !== "" && a.push(`COMMENT ${Je(n.comment)}`), t.push(a.join(" ").trimEnd() + `${r ? "," : ""}`);
244
- }
245
- function rt(e, { buffer: t, relationship: n, fkNames: r, statements: i }) {
246
- let a = W(e, n);
247
- if (!a) return !1;
248
- let { startTable: o, endTable: s } = a, c = `FK_${o.name}_TO_${s.name}`;
249
- c = C(r, "", c), r.push({
250
- id: A(),
251
- name: c
252
- });
253
- let l = `ALTER TABLE ${Q}${s.name}${Q}`;
254
- return i === f.ifNotExists && t.push(`${l} DROP CONSTRAINT IF EXISTS ${Q}${c}${Q};`), t.push(l), t.push(` ADD CONSTRAINT ${Q}${c}${Q}`), t.push(` FOREIGN KEY (${F(a.end, Q)})`), t.push([
255
- ` REFERENCES ${Q}${o.name}${Q} (${F(a.start, Q)})`,
256
- ...H(n, Xe),
257
- `${Ye};`
258
- ].join(" ")), !0;
259
- }
260
- function it({ collections: e }, { buffer: t, index: n, indexNames: r }) {
261
- let i = B(e).collection("tableEntities").selectById(n.tableId);
262
- if (!i) return;
263
- let a = w(e, i, n).map(({ indexColumn: e, column: t }) => ({ name: `${Q}${t.name}${Q} ${g(e.orderType)}` }));
264
- if (a.length === 0) return;
265
- let o = n.name;
266
- n.name.trim() === "" && (o = `IDX_${i.name}`, o = C(r, "", o), r.push({
267
- id: A(),
268
- name: o
269
- })), t.push(`-- Databricks has no secondary indexes. ${Q}${o}${Q} on ${Q}${i.name}${Q} (${F(a)})`), t.push(`-- ALTER TABLE ${Q}${i.name}${Q} CLUSTER BY (${F(w(e, i, n).map(({ column: e }) => e), Q)});`);
270
- }
271
- function at(e, t, n) {
272
- let r = `${Q}${n}${Q}`, i = `USE SCHEMA ${r};`;
273
- return t === j.createAndUse ? `CREATE SCHEMA IF NOT EXISTS ${r};\n${i}` : i;
274
- }
275
- function ot(e, { tables: t }) {
276
- return t.map(({ name: e }) => `DROP TABLE IF EXISTS ${Q}${e}${Q};`).join("\n");
277
- }
278
- //#endregion
279
- //#region src/utils/schema-sql/MySQL.ts
280
- var st = G(V.MySQL), ct = "SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;", lt = "SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;";
281
- function ut(e, t, { statements: n, written: r } = {}) {
282
- if (n === f.ifNotExists) return dt(e, t, r);
283
- let i = [], a = [], s = [""], { tables: c, relationships: l, indexes: u } = o(e, t);
284
- return c.forEach((t) => {
285
- r?.tables.push(t), ft(e, {
286
- table: t,
287
- buffer: s
288
- }), s.push(""), ht(e, {
289
- table: t,
290
- buffer: s
291
- });
292
- }), l.forEach((t) => {
293
- vt(e, {
294
- relationship: t,
295
- buffer: s,
296
- fkNames: i
297
- }) && s.push("");
298
- }), u.forEach((t) => {
299
- bt(e, {
300
- index: t,
301
- buffer: s,
302
- indexNames: a
303
- }), s.push("");
304
- }), s.join("\n");
305
- }
306
- function dt(e, t, n) {
307
- let { settings: { bracketType: r }, collections: i } = e, { tables: a, relationships: s, indexes: c } = o(e, t);
308
- if (a.length === 0) return "";
309
- let l = [], u = /* @__PURE__ */ new Map();
310
- s.forEach((t) => {
311
- let n = _t(e, t, l);
312
- if (!n) return;
313
- let [r, ...i] = n.lines, a = u.get(n.table.id) ?? [];
314
- a.push([` ${r}`, ...i]), u.set(n.table.id, a);
315
- });
316
- let d = [], p = /* @__PURE__ */ new Map();
317
- c.forEach((t) => {
318
- let n = yt(e, t, d);
319
- if (!n) return;
320
- let r = p.get(n.table.id) ?? [];
321
- r.push([` ${t.unique ? "UNIQUE " : ""}INDEX ${n.name} (${n.columns})`]), p.set(n.table.id, r);
322
- });
323
- let m = [
324
- "",
325
- ct,
326
- ""
327
- ];
328
- return a.forEach((t) => {
329
- n?.tables.push(t);
330
- let a = B(i).collection("tableColumnEntities").selectByIds(t.columnIds);
331
- pt(e, m, t, f.ifNotExists, [
332
- ...N(a).map((e) => [` ${mt(r, t, e)}`]),
333
- ...p.get(t.id) ?? [],
334
- ...u.get(t.id) ?? []
335
- ]), m.push("");
336
- }), m.push(lt, ""), m.join("\n");
337
- }
338
- function ft(e, { buffer: t, table: n, statements: r }) {
339
- pt(e, t, n, r, []);
340
- }
341
- function pt(e, t, n, r, a) {
342
- let { settings: { bracketType: o }, collections: s } = e, c = z(o), l = B(s).collection("tableColumnEntities").selectByIds(n.columnIds);
343
- t.push(`CREATE TABLE${I(r)} ${c}${n.name}${c}`), t.push("(");
344
- let u = S(l), d = O(l), f = a.length !== 0;
345
- if (l.forEach((n, r) => {
346
- gt(e, {
347
- column: n,
348
- isComma: u || f || l.length !== r + 1,
349
- spaceSize: d,
350
- buffer: t
351
- });
352
- }), u) {
353
- let e = U(l);
354
- t.push(` PRIMARY KEY (${F(e, c)})${f ? "," : ""}`);
355
- }
356
- a.forEach((e, n) => {
357
- t.push(...e), n !== a.length - 1 && (t[t.length - 1] += ",");
358
- }), n.comment.trim() === "" ? t.push(");") : t.push(`) COMMENT ${i(n.comment)};`);
359
- }
360
- function mt(e, t, r) {
361
- let i = z(e);
362
- return `CONSTRAINT ${i}UQ_${n(t.name, e)}_${r.name}${i} UNIQUE (${i}${r.name}${i})`;
363
- }
364
- function ht({ settings: { bracketType: e }, collections: t }, { buffer: n, table: r }) {
365
- let i = z(e), a = B(t).collection("tableColumnEntities").selectByIds(r.columnIds);
366
- p(a) && N(a).forEach((t) => {
367
- n.push(`ALTER TABLE ${i}${r.name}${i}`), n.push(` ADD ${mt(e, r, t)};`), n.push("");
368
- });
369
- }
370
- function gt({ settings: { bracketType: e } }, { buffer: t, column: n, isComma: r, spaceSize: a }) {
371
- let o = z(e), s = [];
372
- s.push(` ${o}${n.name}${o}` + k(a.name - n.name.length)), s.push(`${n.dataType}` + k(a.dataType - n.dataType.length)), s.push(`${M(n.options, x.notNull) ? "NOT NULL" : "NULL "}`), M(n.options, x.autoIncrement) ? s.push("AUTO_INCREMENT") : n.default.trim() !== "" && s.push(`DEFAULT ${E(n.default, V.MySQL, n.dataType)}`), n.comment.trim() !== "" && s.push(`COMMENT ${i(n.comment)}`), t.push(s.join(" ") + `${r ? "," : ""}`);
373
- }
374
- function _t(e, t, r) {
375
- let { settings: { bracketType: i } } = e, a = W(e, t);
376
- if (!a) return null;
377
- let { startTable: o, endTable: s } = a, c = z(i), l = n(o.name, i), u = n(s.name, i), d = R(r, `FK_${l}_TO_${u}`);
378
- return r.push({
379
- id: A(),
380
- name: d
381
- }), {
382
- table: s,
383
- lines: [
384
- `CONSTRAINT ${c}${d}${c}`,
385
- ` FOREIGN KEY (${F(a.end, c)})`,
386
- ` REFERENCES ${c}${o.name}${c} (${F(a.start, c)})`,
387
- ...H(t, st).map((e) => ` ${e}`)
388
- ]
389
- };
390
- }
391
- function vt(e, { buffer: t, relationship: n, fkNames: r }) {
392
- let i = _t(e, n, r);
393
- if (!i) return !1;
394
- let a = z(e.settings.bracketType), [o, ...s] = i.lines;
395
- return t.push(`ALTER TABLE ${a}${i.table.name}${a}`, ` ADD ${o}`, ...s), t[t.length - 1] += ";", !0;
396
- }
397
- function yt({ settings: { bracketType: e }, collections: t }, r, i) {
398
- let a = z(e), o = B(t).collection("tableEntities").selectById(r.tableId);
399
- if (!o) return null;
400
- let s = w(t, o, r).map(({ indexColumn: e, column: t }) => ({ name: `${a}${t.name}${a} ${g(e.orderType)}` }));
401
- if (s.length === 0) return null;
402
- let c = r.name;
403
- if (r.name.trim() === "") {
404
- let t = n(o.name, e);
405
- c = R(i, `IDX_${t}`), i.push({
406
- id: A(),
407
- name: c
408
- });
409
- }
410
- return {
411
- table: o,
412
- name: `${a}${c}${a}`,
413
- columns: F(s)
414
- };
415
- }
416
- function bt(e, { buffer: t, index: n, indexNames: r }) {
417
- let i = yt(e, n, r);
418
- if (!i) return;
419
- let a = z(e.settings.bracketType);
420
- t.push(`CREATE ${n.unique ? "UNIQUE " : ""}INDEX ${i.name}`), t.push(` ON ${a}${i.table.name}${a} (${i.columns});`);
421
- }
422
- function xt({ settings: { bracketType: e } }, t, n) {
423
- let r = z(e), i = `${r}${n}${r}`, a = `USE ${i};`;
424
- return t === j.createAndUse ? `CREATE DATABASE IF NOT EXISTS ${i};\n${a}` : a;
425
- }
426
- function St({ settings: { bracketType: e } }, { tables: t }) {
427
- if (t.length === 0) return "";
428
- let n = z(e);
429
- return [
430
- ct,
431
- t.map((e) => `DROP TABLE IF EXISTS ${n}${e.name}${n};`).join("\n"),
432
- lt
433
- ].join("\n\n");
434
- }
435
- //#endregion
436
- //#region src/utils/schema-sql/MariaDB.ts
437
- var Ct = G(V.MariaDB);
438
- function wt(e, t, { statements: n, written: r } = {}) {
439
- let i = [], a = [], s = [""], { tables: c, relationships: l, indexes: u } = o(e, t);
440
- return c.forEach((t) => {
441
- r?.tables.push(t), Tt(e, {
442
- table: t,
443
- buffer: s,
444
- statements: n
445
- }), s.push(""), Et(e, {
446
- table: t,
447
- buffer: s,
448
- statements: n
449
- });
450
- }), l.forEach((t) => {
451
- Ot(e, {
452
- relationship: t,
453
- buffer: s,
454
- fkNames: i,
455
- statements: n
456
- }) && s.push("");
457
- }), u.forEach((t) => {
458
- kt(e, {
459
- index: t,
460
- buffer: s,
461
- indexNames: a,
462
- statements: n
463
- }), s.push("");
464
- }), s.join("\n");
465
- }
466
- function Tt(e, { buffer: t, table: n, statements: r }) {
467
- let { settings: { bracketType: a }, collections: o } = e, s = z(a), c = B(o).collection("tableColumnEntities").selectByIds(n.columnIds);
468
- t.push(`CREATE TABLE${I(r)} ${s}${n.name}${s}`), t.push("(");
469
- let l = S(c), u = O(c);
470
- if (c.forEach((n, r) => {
471
- l ? Dt(e, {
472
- column: n,
473
- isComma: !0,
474
- spaceSize: u,
475
- buffer: t
476
- }) : Dt(e, {
477
- column: n,
478
- isComma: c.length !== r + 1,
479
- spaceSize: u,
480
- buffer: t
481
- });
482
- }), l) {
483
- let e = U(c);
484
- t.push(` PRIMARY KEY (${F(e, s)})`);
485
- }
486
- n.comment.trim() === "" ? t.push(");") : t.push(`) COMMENT ${i(n.comment)};`);
487
- }
488
- function Et({ settings: { bracketType: e }, collections: t }, { buffer: r, table: i, statements: a }) {
489
- let o = z(e), s = B(t).collection("tableColumnEntities").selectByIds(i.columnIds);
490
- p(s) && N(s).forEach((t) => {
491
- r.push(`ALTER TABLE ${o}${i.name}${o}`), r.push(` ADD CONSTRAINT ${o}UQ_${n(i.name, e)}_${t.name}${o} UNIQUE${I(a)} (${o}${t.name}${o});`), r.push("");
492
- });
493
- }
494
- function Dt({ settings: { bracketType: e } }, { buffer: t, column: n, isComma: r, spaceSize: a }) {
495
- let o = z(e), s = [];
496
- s.push(` ${o}${n.name}${o}` + k(a.name - n.name.length)), s.push(`${n.dataType}` + k(a.dataType - n.dataType.length)), s.push(`${M(n.options, x.notNull) ? "NOT NULL" : "NULL "}`), M(n.options, x.autoIncrement) ? s.push("AUTO_INCREMENT") : n.default.trim() !== "" && s.push(`DEFAULT ${E(n.default, V.MariaDB)}`), n.comment.trim() !== "" && s.push(`COMMENT ${i(n.comment)}`), t.push(s.join(" ") + `${r ? "," : ""}`);
497
- }
498
- function Ot(e, { buffer: t, relationship: r, fkNames: i, statements: a }) {
499
- let { settings: { bracketType: o } } = e, s = W(e, r);
500
- if (!s) return !1;
501
- let { startTable: c, endTable: l } = s, u = z(o);
502
- t.push(`ALTER TABLE ${u}${l.name}${u}`);
503
- let d = n(c.name, o), f = n(l.name, o), p = R(i, `FK_${d}_TO_${f}`);
504
- return i.push({
505
- id: A(),
506
- name: p
507
- }), t.push(` ADD CONSTRAINT ${u}${p}${u}`), t.push(` FOREIGN KEY${I(a)} (${F(s.end, u)})`), t.push(` REFERENCES ${u}${c.name}${u} (${F(s.start, u)})`, ...H(r, Ct).map((e) => ` ${e}`)), t[t.length - 1] += ";", !0;
508
- }
509
- function kt({ settings: { bracketType: e }, collections: t }, { buffer: r, index: i, indexNames: a, statements: o }) {
510
- let s = z(e), c = B(t).collection("tableEntities").selectById(i.tableId);
511
- if (!c) return;
512
- let l = w(t, c, i).map(({ indexColumn: e, column: t }) => ({ name: `${s}${t.name}${s} ${g(e.orderType)}` }));
513
- if (l.length !== 0) {
514
- let t = i.name;
515
- if (i.name.trim() === "") {
516
- let r = n(c.name, e);
517
- t = R(a, `IDX_${r}`), a.push({
518
- id: A(),
519
- name: t
520
- });
521
- }
522
- r.push(`CREATE ${i.unique ? "UNIQUE " : ""}INDEX${I(o)} ${s}${t}${s}`), r.push(` ON ${s}${c.name}${s} (${F(l)});`);
523
- }
524
- }
525
- //#endregion
526
- //#region src/utils/schema-sql/MSSQL.ts
527
- var At = G(V.MSSQL), jt = "dbo";
528
- function Mt(e, t, { written: n } = {}) {
529
- let r = [], i = [], a = [""], { tables: s, relationships: c, indexes: l } = o(e, t);
530
- return s.forEach((t) => {
531
- n?.tables.push(t), Nt(e, {
532
- table: t,
533
- buffer: a
534
- }), a.push(""), Pt(e, {
535
- table: t,
536
- buffer: a
537
- }), Bt(e, {
538
- table: t,
539
- buffer: a
540
- });
541
- }), c.forEach((t) => {
542
- Vt(e, {
543
- relationship: t,
544
- buffer: a,
545
- fkNames: r
546
- }) && a.push("");
547
- }), l.forEach((t) => {
548
- Ht(e, {
549
- index: t,
550
- buffer: a,
551
- indexNames: i
552
- }), a.push("");
553
- }), a.join("\n");
554
- }
555
- function Nt(e, { buffer: t, table: r }) {
556
- let { settings: { bracketType: i }, collections: a } = e, o = z(i), s = B(a).collection("tableColumnEntities").selectByIds(r.columnIds);
557
- t.push(`CREATE TABLE ${o}${r.name}${o}`), t.push("(");
558
- let c = S(s), l = O(s);
559
- if (s.forEach((n, r) => {
560
- c ? Ft(e, {
561
- column: n,
562
- isComma: !0,
563
- spaceSize: l,
564
- buffer: t
565
- }) : Ft(e, {
566
- column: n,
567
- isComma: s.length !== r + 1,
568
- spaceSize: l,
569
- buffer: t
570
- });
571
- }), c) {
572
- let e = U(s), a = `PK_${n(r.name, i)}`;
573
- t.push(` CONSTRAINT ${o}${a}${o} PRIMARY KEY (${F(e, o)})`);
574
- }
575
- t.push(")\nGO");
576
- }
577
- function Pt({ settings: { bracketType: e }, collections: t }, { buffer: r, table: i }) {
578
- let a = z(e), o = B(t).collection("tableColumnEntities").selectByIds(i.columnIds);
579
- p(o) && N(o).forEach((t) => {
580
- r.push(`ALTER TABLE ${a}${i.name}${a}`), r.push(` ADD CONSTRAINT ${a}UQ_${n(i.name, e)}_${t.name}${a} UNIQUE (${a}${t.name}${a})\nGO`), r.push("");
581
- });
582
- }
583
- function Ft({ settings: { bracketType: e } }, { buffer: t, column: n, isComma: r, spaceSize: i }) {
584
- let a = z(e), o = [];
585
- o.push(` ${a}${n.name}${a}` + k(i.name - n.name.length)), o.push(`${n.dataType}` + k(i.dataType - n.dataType.length)), M(n.options, x.notNull) && o.push("NOT NULL"), M(n.options, x.autoIncrement) ? o.push("IDENTITY(1,1)") : n.default.trim() !== "" && o.push(`DEFAULT ${n.default}`), t.push(o.join(" ") + `${r ? "," : ""}`);
586
- }
587
- var It = /^[\p{L}_@#][\p{L}\p{N}_@#$]*$/u;
588
- function Lt(e) {
589
- return se(e) || It.test(e);
590
- }
591
- function Rt(e, t) {
592
- if (t) return "";
593
- let [, , n = ""] = xe(e).reverse();
594
- return Lt(n) ? `${n}.` : "";
595
- }
596
- function zt(t, n) {
597
- let [r, a = ""] = n ? [t] : xe(t).reverse(), o = e(a) || jt, s = n ? r : e(r);
598
- return {
599
- procedure: `${Rt(t, n)}sys.sp_addextendedproperty`,
600
- levels: `'schema', ${i(o)}, 'table', ${i(s)}`
601
- };
602
- }
603
- function Bt({ settings: { bracketType: e }, collections: t }, { table: n, buffer: r }) {
604
- let { procedure: a, levels: o } = zt(n.name, z(e));
605
- n.comment.trim() !== "" && (r.push(`EXECUTE ${a} 'MS_Description',`), r.push(` ${i(n.comment)}, ${o}\nGO`), r.push("")), B(t).collection("tableColumnEntities").selectByIds(n.columnIds).forEach((e) => {
606
- e.comment.trim() !== "" && (r.push(`EXECUTE ${a} 'MS_Description',`), r.push(` ${i(e.comment)}, ${o}, 'column', ${i(e.name)}\nGO`), r.push(""));
607
- });
608
- }
609
- function Vt(e, { buffer: t, relationship: r, fkNames: i }) {
610
- let { settings: { bracketType: a } } = e, o = W(e, r);
611
- if (!o) return !1;
612
- let { startTable: s, endTable: c } = o, l = z(a);
613
- t.push(`ALTER TABLE ${l}${c.name}${l}`);
614
- let u = n(s.name, a), d = n(c.name, a), f = R(i, `FK_${u}_TO_${d}`);
615
- return i.push({
616
- id: A(),
617
- name: f
618
- }), t.push(` ADD CONSTRAINT ${l}${f}${l}`), t.push(` FOREIGN KEY (${F(o.end, l)})`), t.push(` REFERENCES ${l}${s.name}${l} (${F(o.start, l)})`, ...H(r, At).map((e) => ` ${e}`)), t[t.length - 1] += "\nGO", !0;
619
- }
620
- function Ht({ settings: { bracketType: e }, collections: t }, { buffer: r, index: i, indexNames: a }) {
621
- let o = z(e), s = B(t).collection("tableEntities").selectById(i.tableId);
622
- if (!s) return;
623
- let c = w(t, s, i).map(({ indexColumn: e, column: t }) => ({ name: `${o}${t.name}${o} ${g(e.orderType)}` }));
624
- if (c.length !== 0) {
625
- let t = i.name;
626
- if (i.name.trim() === "") {
627
- let r = n(s.name, e);
628
- t = R(a, `IDX_${r}`), a.push({
629
- id: A(),
630
- name: t
631
- });
632
- }
633
- i.unique ? r.push(`CREATE UNIQUE INDEX ${o}${t}${o}`) : r.push(`CREATE INDEX ${o}${t}${o}`), r.push(` ON ${o}${s.name}${o} (${F(c)})\nGO`);
634
- }
635
- }
636
- function Ut({ settings: { bracketType: e } }, t, n) {
637
- let r = z(e), a = `${r}${n}${r}`, o = `USE ${a}\nGO`;
638
- return t === j.createAndUse ? `IF DB_ID(N${i(n)}) IS NULL\n CREATE DATABASE ${a}\nGO\n\n${o}` : o;
639
- }
640
- function Wt({ settings: { bracketType: e } }, { tables: t }) {
641
- if (t.length === 0) return "";
642
- let n = z(e), r = (e) => `${n}${e}${n}`;
643
- return [
644
- "BEGIN TRY",
645
- " BEGIN TRANSACTION",
646
- "",
647
- " DECLARE @sql NVARCHAR(MAX) = N''",
648
- ...t.flatMap(({ name: e }) => {
649
- let t = Rt(e, n), a = `OBJECT_ID(N${i(r(e))}, N'U')`, o = [
650
- `SELECT @sql += N${i(`ALTER TABLE ${r(e)} DROP CONSTRAINT `)} + QUOTENAME(name) + N';'`,
651
- ` FROM ${t}sys.foreign_keys`,
652
- ` WHERE parent_object_id = ${a}`
653
- ];
654
- return t ? [` IF ${a} IS NOT NULL`, ...o.map((e) => ` ${e}`)] : o.map((e) => ` ${e}`);
655
- }),
656
- " EXECUTE sp_executesql @sql",
657
- "",
658
- ` DROP TABLE IF EXISTS ${t.map(({ name: e }) => r(e)).join(", ")}`,
659
- "",
660
- " COMMIT TRANSACTION",
661
- "END TRY",
662
- "BEGIN CATCH",
663
- " IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION;",
664
- " THROW;",
665
- "END CATCH",
666
- "GO"
667
- ].join("\n");
668
- }
669
- //#endregion
670
- //#region src/utils/schema-sql/Oracle.ts
671
- var Gt = G(V.Oracle);
672
- function Kt(e, t, { written: r } = {}) {
673
- let { settings: { bracketType: i }, collections: a } = e, s = [], c = [], l = [], u = [], d = [""], { tables: f, relationships: p, indexes: h } = o(e, t);
674
- return f.forEach((t) => {
675
- r?.tables.push(t), qt(e, {
676
- table: t,
677
- buffer: d,
678
- written: r
679
- }), d.push(""), Jt(e, {
680
- table: t,
681
- buffer: d,
682
- written: r
683
- });
684
- let o = B(a).collection("tableColumnEntities").selectByIds(t.columnIds), [s] = m(t.name, i), u = n(t.name, i), f = s === "" ? "" : `${s}.`;
685
- o.forEach((e) => {
686
- if (M(e.options, x.autoIncrement)) {
687
- let n = C(c, "", `SEQ_${u}`);
688
- c.push({
689
- id: A(),
690
- name: n
691
- });
692
- let i = `${f}${n}`;
693
- r?.sequences.push(i), r?.identifiers.push(n), d.push(`CREATE SEQUENCE ${i}`), d.push("START WITH 1"), d.push("INCREMENT BY 1;"), d.push("");
694
- let a = C(c, "", `SEQ_TRG_${u}`);
695
- l.push({
696
- id: A(),
697
- name: a
698
- }), r?.identifiers.push(a), d.push(`CREATE OR REPLACE TRIGGER ${f}${a}`), d.push(`BEFORE INSERT ON ${t.name}`), d.push("REFERENCING NEW AS NEW FOR EACH ROW"), d.push("BEGIN"), d.push(` SELECT ${i}.NEXTVAL`), d.push(` INTO :NEW.${e.name}`), d.push(" FROM DUAL;"), d.push("END;"), d.push("/"), d.push("");
699
- }
700
- }), Xt(e, {
701
- table: t,
702
- buffer: d
703
- });
704
- }), p.forEach((t) => {
705
- Zt(e, {
706
- relationship: t,
707
- buffer: d,
708
- fkNames: s,
709
- written: r
710
- }) && d.push("");
711
- }), h.forEach((t) => {
712
- Qt(e, {
713
- index: t,
714
- buffer: d,
715
- indexNames: u,
716
- written: r
717
- }), d.push("");
718
- }), d.join("\n");
719
- }
720
- function qt(t, { buffer: r, table: i, written: a }) {
721
- let { settings: { bracketType: o }, collections: s } = t, c = z(o), l = B(s).collection("tableColumnEntities").selectByIds(i.columnIds);
722
- if (a) {
723
- let [t, n] = m(i.name, o);
724
- t !== "" && a.identifiers.push(e(t)), a.identifiers.push(e(n)), a.identifiers.push(...l.map((e) => e.name));
725
- }
726
- r.push(`CREATE TABLE ${c}${i.name}${c}`), r.push("(");
727
- let u = S(l), d = O(l);
728
- if (l.forEach((e, n) => {
729
- u ? Yt(t, {
730
- column: e,
731
- isComma: !0,
732
- spaceSize: d,
733
- buffer: r
734
- }) : Yt(t, {
735
- column: e,
736
- isComma: l.length !== n + 1,
737
- spaceSize: d,
738
- buffer: r
739
- });
740
- }), u) {
741
- let e = U(l), t = `PK_${n(i.name, o)}`;
742
- a?.identifiers.push(t), r.push(` CONSTRAINT ${c}${t}${c} PRIMARY KEY (${F(e, c)})`);
743
- }
744
- r.push(");");
745
- }
746
- function Jt({ settings: { bracketType: e }, collections: t }, { buffer: r, table: i, written: a }) {
747
- let o = z(e), s = B(t).collection("tableColumnEntities").selectByIds(i.columnIds);
748
- p(s) && N(s).forEach((t) => {
749
- let s = `UQ_${n(i.name, e)}_${t.name}`;
750
- a?.identifiers.push(s), r.push(`ALTER TABLE ${o}${i.name}${o}`), r.push(` ADD CONSTRAINT ${o}${s}${o} UNIQUE (${o}${t.name}${o});`), r.push("");
751
- });
752
- }
753
- function Yt({ settings: { bracketType: e } }, { buffer: t, column: n, isComma: r, spaceSize: i }) {
754
- let a = z(e), o = [];
755
- o.push(` ${a}${n.name}${a}` + k(i.name - n.name.length)), o.push(`${n.dataType}` + k(i.dataType - n.dataType.length)), n.default.trim() !== "" && o.push(`DEFAULT ${n.default}`), M(n.options, x.notNull) && o.push("NOT NULL"), t.push(o.join(" ") + `${r ? "," : ""}`);
756
- }
757
- function Xt({ settings: { bracketType: e }, collections: t }, { table: n, buffer: r }) {
758
- let a = z(e);
759
- n.comment.trim() !== "" && (r.push(`COMMENT ON TABLE ${a}${n.name}${a} IS ${i(n.comment)};`), r.push("")), B(t).collection("tableColumnEntities").selectByIds(n.columnIds).forEach((e) => {
760
- e.comment.trim() !== "" && (r.push(`COMMENT ON COLUMN ${a}${n.name}${a}.${a}${e.name}${a} IS ${i(e.comment)};`), r.push(""));
761
- });
762
- }
763
- function Zt(e, { buffer: t, relationship: r, fkNames: i, written: a }) {
764
- let { settings: { bracketType: o } } = e, s = W(e, r);
765
- if (!s) return !1;
766
- let { startTable: c, endTable: l } = s, u = z(o);
767
- t.push(`ALTER TABLE ${u}${l.name}${u}`);
768
- let d = n(c.name, o), f = n(l.name, o), p = R(i, `FK_${d}_TO_${f}`);
769
- return i.push({
770
- id: A(),
771
- name: p
772
- }), a?.identifiers.push(p), t.push(` ADD CONSTRAINT ${u}${p}${u}`), t.push(` FOREIGN KEY (${F(s.end, u)})`), t.push(` REFERENCES ${u}${c.name}${u} (${F(s.start, u)})`, ...H(r, Gt).map((e) => ` ${e}`)), t[t.length - 1] += ";", !0;
773
- }
774
- function Qt({ settings: { bracketType: e }, collections: t }, { buffer: r, index: i, indexNames: a, written: o }) {
775
- let s = z(e), c = B(t).collection("tableEntities").selectById(i.tableId);
776
- if (!c) return;
777
- let l = w(t, c, i).map(({ indexColumn: e, column: t }) => ({ name: `${s}${t.name}${s} ${g(e.orderType)}` }));
778
- if (l.length !== 0) {
779
- let [t] = m(c.name, e), u = i.name;
780
- if (i.name.trim() === "") {
781
- let t = n(c.name, e);
782
- u = R(a, `IDX_${t}`), a.push({
783
- id: A(),
784
- name: u
785
- });
786
- }
787
- let d = `${t === "" || u.includes(".") ? "" : `${t}.`}${s}${u}${s}`;
788
- o?.identifiers.push(u.slice(u.lastIndexOf(".") + 1)), i.unique ? r.push(`CREATE UNIQUE INDEX ${d}`) : r.push(`CREATE INDEX ${d}`), r.push(` ON ${s}${c.name}${s} (${F(l)});`);
789
- }
790
- }
791
- function $t(e, t) {
792
- let n = ve();
793
- Kt(e, t, { written: n });
794
- let r = new TextEncoder();
795
- return [...new Set(n.identifiers)].filter((e) => r.encode(e).length > 30);
796
- }
797
- function en({ settings: { bracketType: e } }, t, n) {
798
- if (t !== j.use) return "";
799
- let r = z(e);
800
- return `ALTER SESSION SET CURRENT_SCHEMA = ${r}${n}${r};`;
801
- }
802
- function tn(e, t) {
803
- return [
804
- "BEGIN",
805
- ` EXECUTE IMMEDIATE ${i(e)};`,
806
- "EXCEPTION WHEN OTHERS THEN",
807
- ` IF SQLCODE != ${t} THEN RAISE; END IF;`,
808
- "END;",
809
- "/"
810
- ].join("\n");
811
- }
812
- function nn({ settings: { bracketType: e } }, { tables: t, sequences: n }) {
813
- if (t.length === 0) return "";
814
- let r = z(e);
815
- return [...t.map(({ name: e }) => tn(`DROP TABLE ${r}${e}${r} CASCADE CONSTRAINTS`, -942)), ...n.map((e) => tn(`DROP SEQUENCE ${e}`, -2289))].join("\n\n");
816
- }
817
- //#endregion
818
- //#region src/utils/schema-sql/PostgreSQL.ts
819
- var rn = G(V.PostgreSQL), an = /* @__PURE__ */ new Set([
820
- "INT",
821
- "INTEGER",
822
- "BIGINT",
823
- "SMALLINT",
824
- "INT2",
825
- "INT4",
826
- "INT8"
827
- ]);
828
- function on(e) {
829
- return M(e.options, x.autoIncrement) && an.has(e.dataType.trim().toUpperCase());
830
- }
831
- function sn(e, t, { statements: n, written: r } = {}) {
832
- let i = [], a = [], s = [""], { tables: c, relationships: l, indexes: u } = o(e, t);
833
- return c.forEach((t) => {
834
- r?.tables.push(t), cn(e, {
835
- table: t,
836
- buffer: s,
837
- statements: n
838
- }), s.push(""), un(e, {
839
- table: t,
840
- buffer: s
841
- });
842
- }), l.forEach((t) => {
843
- dn(e, {
844
- relationship: t,
845
- buffer: s,
846
- fkNames: i,
847
- statements: n
848
- }) && s.push("");
849
- }), u.forEach((t) => {
850
- fn(e, {
851
- index: t,
852
- buffer: s,
853
- indexNames: a,
854
- statements: n
855
- }), s.push("");
856
- }), s.join("\n");
857
- }
858
- function cn(e, { buffer: t, table: n, statements: r }) {
859
- let { settings: { bracketType: i }, collections: a } = e, o = z(i), s = B(a).collection("tableColumnEntities").selectByIds(n.columnIds);
860
- t.push(`CREATE TABLE${I(r)} ${o}${n.name}${o}`), t.push("(");
861
- let c = S(s), l = O(s);
862
- if (s.forEach((n, r) => {
863
- c ? ln(e, {
864
- column: n,
865
- isComma: !0,
866
- spaceSize: l,
867
- buffer: t
868
- }) : ln(e, {
869
- column: n,
870
- isComma: s.length !== r + 1,
871
- spaceSize: l,
872
- buffer: t
873
- });
874
- }), c) {
875
- let e = U(s);
876
- t.push(` PRIMARY KEY (${F(e, o)})`);
877
- }
878
- t.push(");");
879
- let u = s.filter((e) => M(e.options, x.autoIncrement) && !on(e));
880
- u.length !== 0 && (t.push(""), u.forEach((e) => {
881
- t.push(`-- PostgreSQL takes IDENTITY only on smallint, integer or bigint, so ${o}${n.name}${o}.${o}${e.name}${o} is written without it.`);
882
- }));
883
- }
884
- function ln({ settings: { bracketType: e } }, { buffer: t, column: n, isComma: r, spaceSize: i }) {
885
- let a = z(e), o = [];
886
- o.push(` ${a}${n.name}${a}` + k(i.name - n.name.length)), o.push(`${n.dataType}` + k(i.dataType - n.dataType.length)), M(n.options, x.notNull) && o.push("NOT NULL"), M(n.options, x.autoIncrement) ? on(n) && o.push("GENERATED ALWAYS AS IDENTITY") : n.default.trim() !== "" && o.push(`DEFAULT ${E(n.default, V.PostgreSQL)}`), M(n.options, x.unique) && o.push("UNIQUE"), t.push(o.join(" ") + `${r ? "," : ""}`);
887
- }
888
- function un({ settings: { bracketType: e }, collections: t }, { buffer: n, table: r }) {
889
- let a = z(e);
890
- r.comment.trim() !== "" && (n.push(`COMMENT ON TABLE ${a}${r.name}${a} IS ${i(r.comment)};`), n.push("")), B(t).collection("tableColumnEntities").selectByIds(r.columnIds).forEach((e) => {
891
- e.comment.trim() !== "" && (n.push(`COMMENT ON COLUMN ${a}${r.name}${a}.${a}${e.name}${a} IS ${i(e.comment)};`), n.push(""));
892
- });
893
- }
894
- function dn(e, { buffer: t, relationship: r, fkNames: i, statements: a }) {
895
- let { settings: { bracketType: o } } = e, s = W(e, r);
896
- if (!s) return !1;
897
- let { startTable: c, endTable: l } = s, u = z(o), d = n(c.name, o), p = n(l.name, o), m = R(i, `FK_${d}_TO_${p}`);
898
- i.push({
899
- id: A(),
900
- name: m
901
- });
902
- let h = `ALTER TABLE ${u}${l.name}${u}`;
903
- return a === f.ifNotExists && t.push(`${h} DROP CONSTRAINT IF EXISTS ${u}${m}${u};`), t.push(h), t.push(` ADD CONSTRAINT ${u}${m}${u}`), t.push(` FOREIGN KEY (${F(s.end, u)})`), t.push(` REFERENCES ${u}${c.name}${u} (${F(s.start, u)})`, ...H(r, rn).map((e) => ` ${e}`)), t[t.length - 1] += ";", !0;
904
- }
905
- function fn({ settings: { bracketType: e }, collections: t }, { buffer: r, index: i, indexNames: a, statements: o }) {
906
- let s = z(e), c = B(t).collection("tableEntities").selectById(i.tableId);
907
- if (!c) return;
908
- let l = w(t, c, i).map(({ indexColumn: e, column: t }) => ({ name: `${s}${t.name}${s} ${g(e.orderType)}` }));
909
- if (l.length !== 0) {
910
- let t = i.name;
911
- if (i.name.trim() === "") {
912
- let r = n(c.name, e);
913
- t = R(a, `IDX_${r}`), a.push({
914
- id: A(),
915
- name: t
916
- });
917
- }
918
- r.push(`CREATE ${i.unique ? "UNIQUE " : ""}INDEX${I(o)} ${s}${t}${s}`), r.push(` ON ${s}${c.name}${s} (${F(l)});`);
919
- }
920
- }
921
- function pn({ settings: { bracketType: e } }, t, n) {
922
- if (t !== j.createAndUse) return "";
923
- let r = z(e), i = `${r}${n}${r}`;
924
- return `CREATE SCHEMA IF NOT EXISTS ${i};\nSET search_path TO ${i}, public;`;
925
- }
926
- function mn({ settings: { bracketType: e } }, { tables: t }, n, r) {
927
- if (t.length === 0) return "";
928
- let i = z(e), a = n === j.createAndUse ? `${i}${r}${i}.` : "";
929
- return `DROP TABLE IF EXISTS ${t.map(({ name: t }) => {
930
- let [n] = m(t, e);
931
- return `${n === "" ? a : ""}${i}${t}${i}`;
932
- }).join(", ")};`;
933
- }
934
- //#endregion
935
- //#region src/utils/schema-sql/Snowflake.ts
936
- var hn = G(V.Snowflake), $ = (e) => z(e) === "" ? "" : "\"";
937
- function gn(e, t, { statements: n, written: r } = {}) {
938
- let i = [], a = [], s = [""], { tables: c, relationships: l, indexes: u } = o(e, t);
939
- return c.forEach((t) => {
940
- r?.tables.push(t), _n(e, {
941
- table: t,
942
- buffer: s,
943
- statements: n
944
- }), s.push("");
945
- }), l.forEach((t) => {
946
- yn(e, {
947
- relationship: t,
948
- buffer: s,
949
- fkNames: i
950
- }) && s.push("");
951
- }), u.forEach((t) => {
952
- xn(e, {
953
- index: t,
954
- buffer: s,
955
- indexNames: a
956
- }), s.push("");
957
- }), s.join("\n");
958
- }
959
- function _n(e, { buffer: t, table: n, statements: r }) {
960
- let { collections: a, settings: { bracketType: o } } = e, s = $(o), c = B(a).collection("tableColumnEntities").selectByIds(n.columnIds), l = r === f.recreate ? "CREATE OR REPLACE TABLE" : "CREATE TABLE";
961
- t.push(`${l} ${s}${n.name}${s}`), t.push("(");
962
- let u = S(c), d = O(c);
963
- if (c.forEach((n, r) => {
964
- vn(e, {
965
- column: n,
966
- isComma: u || c.length !== r + 1,
967
- spaceSize: d,
968
- buffer: t
969
- });
970
- }), u) {
971
- let e = U(c);
972
- t.push(` CONSTRAINT ${s}PK_${n.name}${s} PRIMARY KEY (${F(e, s)})`);
973
- }
974
- n.comment.trim() === "" ? t.push(");") : (t.push(")"), t.push(`COMMENT = ${i(n.comment)};`));
975
- }
976
- function vn({ settings: { bracketType: e } }, { buffer: t, column: n, isComma: r, spaceSize: a }) {
977
- let o = $(e), s = [];
978
- s.push(` ${o}${n.name}${o}` + k(a.name - n.name.length)), s.push(`${n.dataType}` + k(a.dataType - n.dataType.length)), M(n.options, x.unique) && s.push("UNIQUE");
979
- let c = M(n.options, x.notNull) || M(n.options, x.primaryKey);
980
- s.push(c ? "NOT NULL" : " "), M(n.options, x.autoIncrement) ? s.push("AUTOINCREMENT") : n.default.trim() !== "" && s.push(`DEFAULT ${n.default}`), n.comment.trim() !== "" && s.push(`COMMENT ${i(n.comment)}`), t.push(s.join(" ").trimEnd() + `${r ? "," : ""}`);
981
- }
982
- function yn(e, { buffer: t, relationship: n, fkNames: r }) {
983
- let { settings: { bracketType: i } } = e, a = W(e, n);
984
- if (!a) return !1;
985
- let { startTable: o, endTable: s } = a, c = $(i), l = bn(n);
986
- l.length !== 0 && t.push(`-- Snowflake creates no foreign key with a referential action other than NO ACTION, so ${l.join(" and ")} ${l.length === 1 ? "is" : "are"} left out.`), t.push(`ALTER TABLE ${c}${s.name}${c}`);
987
- let u = `FK_${o.name}_TO_${s.name}`;
988
- return u = C(r, "", u), r.push({
989
- id: A(),
990
- name: u
991
- }), t.push(` ADD CONSTRAINT ${c}${u}${c}`), t.push(` FOREIGN KEY (${F(a.end, c)})`), t.push(` REFERENCES ${c}${o.name}${c} (${F(a.start, c)})`, ...H(n, hn).map((e) => ` ${e}`)), t[t.length - 1] += ";", !0;
992
- }
993
- function bn({ onDelete: e, onUpdate: t }) {
994
- let n = [];
995
- return D[e] && !hn.onDelete.includes(e) && n.push(`ON DELETE ${D[e]}`), D[t] && !hn.onUpdate.includes(t) && n.push(`ON UPDATE ${D[t]}`), n;
996
- }
997
- function xn({ collections: e, settings: { bracketType: t } }, { buffer: n, index: r, indexNames: i }) {
998
- let a = $(t), o = B(e).collection("tableEntities").selectById(r.tableId);
999
- if (!o) return;
1000
- let s = w(e, o, r), c = s.map(({ column: e }) => e);
1001
- if (c.length === 0) return;
1002
- let l = r.name;
1003
- if (r.name.trim() === "" && (l = `IDX_${o.name}`, l = C(i, "", l), i.push({
1004
- id: A(),
1005
- name: l
1006
- })), r.unique) {
1007
- n.push(`ALTER TABLE ${a}${o.name}${a}`), n.push(` ADD CONSTRAINT ${a}${l}${a} UNIQUE (${F(c, a)});`);
1008
- return;
1009
- }
1010
- let u = s.map(({ indexColumn: e, column: t }) => ({ name: `${a}${t.name}${a} ${g(e.orderType)}` }));
1011
- n.push(`-- Snowflake has no secondary indexes. ${a}${l}${a} on ${a}${o.name}${a} (${F(u)})`), n.push(`-- ALTER TABLE ${a}${o.name}${a} CLUSTER BY (${F(c, a)});`);
1012
- }
1013
- function Sn({ settings: { bracketType: e } }, t, n) {
1014
- let r = $(e), i = `${r}${n}${r}`, a = `USE SCHEMA ${i};`;
1015
- return t === j.createAndUse ? `CREATE SCHEMA IF NOT EXISTS ${i};\n${a}` : a;
1016
- }
1017
- function Cn() {
1018
- return "";
1019
- }
1020
- //#endregion
1021
- //#region src/utils/schema-sql/SQLite.ts
1022
- var wn = G(V.SQLite);
1023
- function Tn(e, t, { statements: n, written: r } = {}) {
1024
- let i = [], a = [""], { tables: s, indexes: c } = o(e, t);
1025
- return s.forEach((t) => {
1026
- r?.tables.push(t), Dn(e, {
1027
- table: t,
1028
- buffer: a,
1029
- statements: n
1030
- }), a.push("");
1031
- }), c.forEach((t) => {
1032
- kn(e, {
1033
- index: t,
1034
- buffer: a,
1035
- indexNames: i,
1036
- statements: n
1037
- }), a.push("");
1038
- }), a.join("\n");
1039
- }
1040
- function En(e) {
1041
- return /^(?:(?:TINY|SMALL|MEDIUM|BIG)?INT(?:EGER)?|INT[248]|UNSIGNED\s+BIG\s+INT)(?:\s*\(\s*\d+\s*\))?$/i.test(e.trim());
1042
- }
1043
- function Dn(e, { buffer: t, table: n, statements: r }) {
1044
- let { settings: { bracketType: i }, doc: { relationshipIds: a }, collections: o } = e, s = z(i), c = B(o).collection("tableColumnEntities").selectByIds(n.columnIds), l = U(c), u = l.length === 1 && M(l[0].options, x.autoIncrement) ? l[0] : null, d = u !== null && En(u.dataType), f = d ? c.map((e) => e === u ? {
1045
- ...e,
1046
- dataType: "INTEGER"
1047
- } : e) : c, p = B(o).collection("relationshipEntities").selectByIds(a).filter(({ end: e }) => e.tableId === n.id).flatMap((t) => {
1048
- let n = W(e, t);
1049
- return n ? [{
1050
- relationship: t,
1051
- ...n
1052
- }] : [];
1053
- }), h = p.length !== 0;
1054
- n.comment.trim() !== "" && t.push(`-- ${n.comment}`), t.push(`CREATE TABLE${I(r)} ${s}${n.name}${s}`), t.push("(");
1055
- let g = S(f), _ = O(f);
1056
- if (f.forEach((n, r) => {
1057
- On(e, {
1058
- column: n,
1059
- isComma: g || h || f.length !== r + 1,
1060
- spaceSize: _,
1061
- buffer: t
1062
- });
1063
- }), g) {
1064
- let e = d ? " AUTOINCREMENT" : "";
1065
- t.push(` PRIMARY KEY (${F(l, s)}${e})` + (h ? "," : ""));
1066
- }
1067
- p.forEach(({ relationship: e, startTable: n, start: r, end: a }, o) => {
1068
- let c = H(e, wn).map((e) => ` ${e}`).join(""), [, l] = m(n.name, i);
1069
- t.push(` FOREIGN KEY (${F(a, s)}) REFERENCES ${s}${l}${s} (${F(r, s)})${c}` + (p.length - 1 > o ? "," : ""));
1070
- }), t.push(");"), u !== null && !d && (t.push(""), t.push(`-- SQLite takes AUTOINCREMENT only on an INTEGER column, so ${s}${n.name}${s}.${s}${u.name}${s} is written without it.`));
1071
- }
1072
- function On({ settings: { bracketType: e } }, { buffer: t, column: n, isComma: r, spaceSize: i }) {
1073
- let a = z(e), o = [];
1074
- n.comment.trim() !== "" && t.push(` -- ${n.comment}`), o.push(` ${a}${n.name}${a}` + k(i.name - n.name.length)), o.push(`${n.dataType}` + k(i.dataType - n.dataType.length)), o.push(`${M(n.options, x.notNull) ? "NOT NULL" : "NULL "}`), M(n.options, x.unique) && o.push("UNIQUE"), !M(n.options, x.autoIncrement) && n.default.trim() !== "" && o.push(`DEFAULT ${E(n.default, V.SQLite)}`), t.push(o.join(" ") + `${r ? "," : ""}`);
1075
- }
1076
- function kn({ settings: { bracketType: e }, collections: t }, { buffer: r, index: i, indexNames: a, statements: o }) {
1077
- let s = z(e), c = B(t).collection("tableEntities").selectById(i.tableId);
1078
- if (!c) return;
1079
- let l = w(t, c, i).map(({ indexColumn: e, column: t }) => ({ name: `${s}${t.name}${s} ${g(e.orderType)}` }));
1080
- if (l.length !== 0) {
1081
- let [t, u] = m(c.name, e), d = i.name;
1082
- if (i.name.trim() === "") {
1083
- let t = n(c.name, e);
1084
- d = R(a, `IDX_${t}`), a.push({
1085
- id: A(),
1086
- name: d
1087
- });
1088
- }
1089
- let f = `${t === "" || d.includes(".") ? "" : `${t}.`}${s}${d}${s}`;
1090
- r.push(`CREATE ${i.unique ? "UNIQUE " : ""}INDEX${I(o)} ${f}`), r.push(` ON ${s}${u}${s} (${F(l)});`);
1091
- }
1092
- }
1093
- function An() {
1094
- return "";
1095
- }
1096
- function jn({ settings: { bracketType: e } }, { tables: t }) {
1097
- if (t.length === 0) return "";
1098
- let n = z(e);
1099
- return ["PRAGMA foreign_keys=OFF;", t.map(({ name: e }) => `DROP TABLE IF EXISTS ${n}${e}${n};`).join("\n")].join("\n\n");
1100
- }
1101
- //#endregion
1102
- //#region src/utils/schema-sql/index.ts
1103
- var Mn = {
1104
- [V.Databricks]: {
1105
- createSchema: $e,
1106
- formatHeader: at,
1107
- formatDropBlock: ot
1108
- },
1109
- [V.MariaDB]: {
1110
- createSchema: wt,
1111
- formatHeader: xt,
1112
- formatDropBlock: St
1113
- },
1114
- [V.MSSQL]: {
1115
- createSchema: Mt,
1116
- formatHeader: Ut,
1117
- formatDropBlock: Wt
1118
- },
1119
- [V.MySQL]: {
1120
- createSchema: ut,
1121
- formatHeader: xt,
1122
- formatDropBlock: St
1123
- },
1124
- [V.Oracle]: {
1125
- createSchema: Kt,
1126
- formatHeader: en,
1127
- formatDropBlock: nn
1128
- },
1129
- [V.PostgreSQL]: {
1130
- createSchema: sn,
1131
- formatHeader: pn,
1132
- formatDropBlock: mn
1133
- },
1134
- [V.Snowflake]: {
1135
- createSchema: gn,
1136
- formatHeader: Sn,
1137
- formatDropBlock: Cn
1138
- },
1139
- [V.SQLite]: {
1140
- createSchema: Tn,
1141
- formatHeader: An,
1142
- formatDropBlock: jn
1143
- }
1144
- };
1145
- function Nn(e) {
1146
- return e === "" ? "" : e.slice(1, -1);
1147
- }
1148
- function Pn(e, t, n, r) {
1149
- let i = t || e.settings.database, a = Mn[i];
1150
- if (!a) return "";
1151
- let { databaseName: o } = e.settings, l = c(i, r, o), u = ve(), d = Nn(a.createSchema(e, n, {
1152
- statements: l.statements,
1153
- written: u
1154
- })), p = r?.scripts ?? n === void 0 ? e.settings.ddlScripts : void 0, m = s(p?.before ?? "", i), h = s(p?.after ?? "", i), g = l.headerName === "valid" ? l.header : j.none, _ = l.statements === f.recreate ? a.formatDropBlock(e, u, g, o) : "";
1155
- return !m && !_ && !d && !h ? "" : `\n${[
1156
- g === j.none ? "" : a.formatHeader(e, g, o),
1157
- m,
1158
- _,
1159
- h ? d.replace(/\n+$/, "") : d,
1160
- h
1161
- ].filter(Boolean).join("\n\n")}\n`;
1162
- }
1163
- function Fn(e, t) {
1164
- return o(e, t).tables.map((e) => e.name);
1165
- }
1166
- function In(e, t) {
1167
- let { settings: n, doc: { indexIds: r }, collections: i } = e, a = [""], o = n.database, s = [], c = B(i).collection("indexEntities").selectByIds(r).filter((e) => e.tableId === t.id);
1168
- switch (o) {
1169
- case V.Databricks:
1170
- et(e, {
1171
- buffer: a,
1172
- table: t
1173
- }), a.push(""), tt(e, {
1174
- buffer: a,
1175
- table: t
1176
- }), c.forEach((t) => {
1177
- it(e, {
1178
- index: t,
1179
- buffer: a,
1180
- indexNames: s
1181
- }), a.push("");
1182
- });
1183
- break;
1184
- case V.MariaDB:
1185
- Tt(e, {
1186
- buffer: a,
1187
- table: t
1188
- }), a.push(""), Et(e, {
1189
- buffer: a,
1190
- table: t
1191
- }), c.forEach((t) => {
1192
- kt(e, {
1193
- index: t,
1194
- buffer: a,
1195
- indexNames: s
1196
- }), a.push("");
1197
- });
1198
- break;
1199
- case V.MSSQL:
1200
- Nt(e, {
1201
- buffer: a,
1202
- table: t
1203
- }), a.push(""), Pt(e, {
1204
- buffer: a,
1205
- table: t
1206
- }), c.forEach((t) => {
1207
- Ht(e, {
1208
- index: t,
1209
- buffer: a,
1210
- indexNames: s
1211
- }), a.push("");
1212
- });
1213
- break;
1214
- case V.MySQL:
1215
- ft(e, {
1216
- buffer: a,
1217
- table: t
1218
- }), a.push(""), ht(e, {
1219
- buffer: a,
1220
- table: t
1221
- }), c.forEach((t) => {
1222
- bt(e, {
1223
- index: t,
1224
- buffer: a,
1225
- indexNames: s
1226
- }), a.push("");
1227
- });
1228
- break;
1229
- case V.Oracle:
1230
- qt(e, {
1231
- buffer: a,
1232
- table: t
1233
- }), a.push(""), Jt(e, {
1234
- buffer: a,
1235
- table: t
1236
- }), c.forEach((t) => {
1237
- Qt(e, {
1238
- index: t,
1239
- buffer: a,
1240
- indexNames: s
1241
- }), a.push("");
1242
- });
1243
- break;
1244
- case V.PostgreSQL:
1245
- cn(e, {
1246
- buffer: a,
1247
- table: t
1248
- }), a.push(""), c.forEach((t) => {
1249
- fn(e, {
1250
- index: t,
1251
- buffer: a,
1252
- indexNames: s
1253
- }), a.push("");
1254
- });
1255
- break;
1256
- case V.Snowflake:
1257
- _n(e, {
1258
- buffer: a,
1259
- table: t
1260
- }), a.push(""), c.forEach((t) => {
1261
- xn(e, {
1262
- index: t,
1263
- buffer: a,
1264
- indexNames: s
1265
- }), a.push("");
1266
- });
1267
- break;
1268
- case V.SQLite: Dn(e, {
1269
- buffer: a,
1270
- table: t
1271
- }), a.push(""), c.forEach((t) => {
1272
- kn(e, {
1273
- index: t,
1274
- buffer: a,
1275
- indexNames: s
1276
- }), a.push("");
1277
- });
1278
- }
1279
- return a.join("\n");
1280
- }
1281
- //#endregion
1282
- //#region src/engine/shared-store.ts
1283
- var Ln = 2, Rn = _(be);
1284
- function zn(e, t, n) {
1285
- let r = n?.manualStreamFlush ?? !1, i = { editorId: e.state.editor.id }, a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = new q(), c = new q(), l = new q(), u = new q(), d = new q(), f = le(r ? Me(d) : Ne(d)), p = !0, m = !0;
1286
- a.add(Te(new K((t) => e.subscribe((e) => t.next(e))), c).pipe(T(ne), te([y.shared]), f, _e(l, u), f, we((e) => b(y.shared, e.map((e) => {
1287
- let n = {
1288
- ...e,
1289
- meta: Object.assign({}, e.meta ?? {}, {
1290
- ...i,
1291
- nickname: t?.getNickname?.()
1292
- })
1293
- };
1294
- return Rn(e.type) ? v(y.following, n) : n;
1295
- })))).subscribe((e) => s.next(e)));
1296
- let h = () => {
1297
- c.next([{
1298
- ...re(),
1299
- version: e.context.clock.getVersion()
1300
- }]);
1301
- };
1302
- a.add(new K((t) => e.subscribe((e) => t.next(e))).pipe(Ce((e) => !m && e.some(({ type: e }) => e === de.type))).subscribe(h));
1303
- let g = () => {
1304
- let e = 0 < o.size;
1305
- p && e ? l.next() : u.next();
1306
- }, _ = (t) => {
1307
- let n = (Array.isArray(t) ? t : [t]).some((e) => e.type === re.type), r = e.state.lww;
1308
- n && !Ae(r) && c.next([{
1309
- ...ce({ lww: r }),
1310
- version: e.context.clock.getVersion()
1311
- }]);
1312
- };
1313
- return Object.freeze({
1314
- connection: () => {
1315
- p = !0, g();
1316
- },
1317
- disconnect: () => {
1318
- p = !1, g();
1319
- },
1320
- dispatch: (t) => {
1321
- e.dispatch(t), _(t);
1322
- },
1323
- dispatchSync: (t) => {
1324
- e.dispatchSync(t), _(t);
1325
- },
1326
- subscribe: (e) => {
1327
- let t = s.subscribe((t) => e(t));
1328
- return o.add(t), g(), m &&= (h(), !1), () => {
1329
- t.unsubscribe(), o.delete(t), g();
1330
- };
1331
- },
1332
- flushStreamBuffers: () => {
1333
- for (let e = 0; e < Ln; e++) d.next();
1334
- },
1335
- destroy: () => {
1336
- Array.from(a).forEach((e) => e.unsubscribe()), Array.from(o).forEach((e) => e.unsubscribe()), a.clear(), o.clear(), s.complete(), l.complete(), u.complete(), d.complete();
1337
- }
1338
- });
1339
- }
1340
- //#endregion
1341
- export { En as a, He as c, Ke as d, qe as f, X as h, Fn as i, Ue as l, Ve as m, Pn as n, $t as o, Be as p, In as r, We as s, zn as t, Ge as u };