@dineug/erd-editor 4.2.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +208 -20
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/assertClassBrand.js +7 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/checkPrivateRedeclaration.js +6 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldGet2.js +7 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldInitSpec.js +7 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldSet2.js +7 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.js +12 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPrimitive.js +14 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPropertyKey.js +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/typeof.js +11 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/components/appContext.js +45 -0
- package/dist/components/customElementClass.d.ts +10 -0
- package/dist/components/dictionary/Dictionary.js +584 -0
- package/dist/components/dictionary/Dictionary.styles.js +208 -0
- package/dist/components/dictionary/checkCount.js +59 -0
- package/dist/components/dictionary/checkSheet.js +121 -0
- package/dist/components/dictionary/dictionary-context-menu/DictionaryContextMenu.js +17 -0
- package/dist/components/dictionary/dictionaryCommit.js +237 -0
- package/dist/components/dictionary/dictionaryFile.js +72 -0
- package/dist/components/dictionary/dictionaryKeys.js +86 -0
- package/dist/components/dictionary/dictionaryView.js +100 -0
- package/dist/components/dictionary/domain-cell-editor/DomainCellEditor.js +110 -0
- package/dist/components/dictionary/domain-cell-editor/DomainCellEditor.styles.js +65 -0
- package/dist/components/dictionary/domain-cell-editor/openDomainCellEditor.js +16 -0
- package/dist/components/dictionary/gridTheme.js +51 -0
- package/dist/components/dictionary/sheets.js +199 -0
- package/dist/components/diffContext.d.ts +10 -0
- package/dist/components/diffContext.js +7 -0
- package/dist/components/element-host/localeHost.d.ts +43 -0
- package/dist/components/element-host/localeHost.js +81 -0
- package/dist/components/element-host/themeHost.d.ts +30 -0
- package/dist/components/element-host/themeHost.js +101 -0
- package/dist/components/erd/Erd.d.ts +2 -0
- package/dist/components/erd/Erd.js +431 -0
- package/dist/components/erd/Erd.styles.js +12 -0
- package/dist/components/erd/automatic-table-placement/AutomaticTablePlacement.js +139 -0
- package/dist/components/erd/automatic-table-placement/AutomaticTablePlacement.styles.js +22 -0
- package/dist/components/erd/automatic-table-placement/createAutomaticTablePlacement.js +175 -0
- package/dist/components/erd/automatic-table-placement/elkPlacement.js +56 -0
- package/dist/components/erd/automatic-table-placement/flowPlacement.js +32 -0
- package/dist/components/erd/automatic-table-placement/placementActions.js +33 -0
- package/dist/components/erd/automatic-table-placement/runElkPlacement.d.ts +3 -2
- package/dist/components/erd/automatic-table-placement/runElkPlacement.js +30 -0
- package/dist/components/erd/canvas/Canvas.d.ts +8 -2
- package/dist/components/erd/canvas/Canvas.js +78 -0
- package/dist/components/erd/canvas/Canvas.styles.js +15 -0
- package/dist/components/erd/canvas/CanvasScene.d.ts +28 -3
- package/dist/components/erd/canvas/CanvasScene.js +80 -0
- package/dist/components/erd/canvas/DiffOutline.template.js +5 -0
- package/dist/components/erd/canvas/EditOverlay.js +349 -0
- package/dist/components/erd/canvas/EditOverlay.styles.js +19 -0
- package/dist/components/erd/canvas/SceneIcon.template.js +14 -0
- package/dist/components/erd/canvas/altDragDuplicate.js +16 -0
- package/dist/components/erd/canvas/column-drag-ghost/ColumnDragGhost.js +61 -0
- package/dist/components/erd/canvas/{column-drag-ghost/columnDragPointer.d.ts → columnDragPointer.d.ts} +2 -2
- package/dist/components/erd/canvas/columnDragPointer.js +30 -0
- package/dist/components/erd/canvas/drag-select/DragSelect.js +109 -0
- package/dist/components/erd/canvas/draw-relationship/DrawRelationship.js +60 -0
- package/dist/components/erd/canvas/duplicate-ghost/DuplicateGhost.js +108 -0
- package/dist/components/erd/canvas/editingLayers.d.ts +8 -0
- package/dist/components/erd/canvas/editingLayers.js +21 -0
- package/dist/components/erd/canvas/entityDrag.d.ts +2 -1
- package/dist/components/erd/canvas/entityDrag.js +42 -0
- package/dist/components/erd/canvas/high-level-table/HighLevelTable.js +82 -0
- package/dist/components/erd/canvas/highlightTransition.d.ts +6 -0
- package/dist/components/erd/canvas/highlightTransition.js +79 -0
- package/dist/components/erd/canvas/memo/Memo.js +152 -0
- package/dist/components/erd/canvas/memo/memo-sash/MemoSash.js +190 -0
- package/dist/components/erd/canvas/memo/memoCaret.js +66 -0
- package/dist/components/erd/canvas/memo/memoScroll.js +14 -0
- package/dist/components/erd/canvas/memo/memoText.js +41 -0
- package/dist/components/erd/canvas/memo/useMoveMemo.js +19 -0
- package/dist/components/erd/canvas/middleButtonPan.js +33 -0
- package/dist/components/erd/canvas/mixColor.js +23 -0
- package/dist/components/erd/canvas/readPress.d.ts +43 -0
- package/dist/components/erd/canvas/readPress.js +102 -0
- package/dist/components/erd/canvas/relationship-group/RelationshipGroup.js +26 -0
- package/dist/components/erd/canvas/relationship-group/relationship/Relationship.js +153 -0
- package/dist/components/erd/canvas/relationship-group/relationship/Relationship.template.js +75 -0
- package/dist/components/erd/canvas/relationship-group/relationship/RelationshipActionLabel.js +68 -0
- package/dist/components/erd/canvas/sceneHit.js +38 -0
- package/dist/components/erd/canvas/sceneKind.js +12 -0
- package/dist/components/erd/canvas/sceneRetention.js +20 -0
- package/dist/components/erd/canvas/sceneTokens.js +110 -0
- package/dist/components/erd/canvas/shared-drag-select/SharedDragSelect.js +35 -0
- package/dist/components/erd/canvas/shared-mouse-tracker/SharedMouseTracker.js +29 -0
- package/dist/components/erd/canvas/shared-mouse-tracker/shared-mouse-cursor/SharedMouseCursor.js +40 -0
- package/dist/components/erd/canvas/stagePressScope.d.ts +11 -0
- package/dist/components/erd/canvas/stagePressScope.js +51 -0
- package/dist/components/erd/canvas/table/Table.js +399 -0
- package/dist/components/erd/canvas/table/blankLogicalName.js +14 -0
- package/dist/components/erd/canvas/table/cellLayout.js +147 -0
- package/dist/components/erd/canvas/table/colorEdge.js +16 -0
- package/dist/components/erd/canvas/table/column/Column.d.ts +6 -1
- package/dist/components/erd/canvas/table/column/Column.js +416 -0
- package/dist/components/erd/canvas/table/dictionaryMarks.js +42 -0
- package/dist/components/erd/canvas/table/doubleClick.js +15 -0
- package/dist/components/erd/canvas/table/goToErd.js +10 -0
- package/dist/components/erd/canvas/table/useFocusTable.js +19 -0
- package/dist/components/erd/canvas/table/useMoveTable.js +21 -0
- package/dist/components/erd/canvas/table/useSharedFocusTable.js +53 -0
- package/dist/components/erd/canvas/table/useViewPin.js +21 -0
- package/dist/components/erd/canvas/table-group/TableGroup.js +141 -0
- package/dist/components/erd/canvas/table-group/TableGroupBody.js +47 -0
- package/dist/components/erd/canvas/table-group/TableGroupDropTarget.js +25 -0
- package/dist/components/erd/canvas/table-group/TableGroupSash.js +143 -0
- package/dist/components/erd/canvas/table-group/TableGroups.js +21 -0
- package/dist/components/erd/canvas/table-group/tableGroupBox.js +57 -0
- package/dist/components/erd/canvas/table-group/tableGroupNameEditor.d.ts +11 -0
- package/dist/components/erd/canvas/table-group/tableGroupNameEditor.js +9 -0
- package/dist/components/erd/canvas/table-group/titleLayout.js +31 -0
- package/dist/components/erd/canvas/useMoveEntity.d.ts +1 -1
- package/dist/components/erd/canvas/useMoveEntity.js +80 -0
- package/dist/components/erd/canvas/useSharedSelectEntity.js +28 -0
- package/dist/components/erd/content-compass/ContentCompass.js +23 -0
- package/dist/components/erd/content-compass/ContentCompass.styles.js +32 -0
- package/dist/components/erd/content-compass/compassGeometry.js +71 -0
- package/dist/components/erd/diff-viewer/DiffViewer.js +75 -0
- package/dist/components/erd/diff-viewer/DiffViewer.styles.js +28 -0
- package/dist/components/erd/diff-viewer/diff-erd-viewer/DiffErdViewer.d.ts +11 -0
- package/dist/components/erd/diff-viewer/diff-erd-viewer/DiffErdViewer.js +105 -0
- package/dist/components/erd/diff-viewer/{erd-viewer/ErdViewer.styles.d.ts → diff-erd-viewer/DiffErdViewer.styles.d.ts} +1 -1
- package/dist/components/erd/diff-viewer/diff-erd-viewer/DiffErdViewer.styles.js +12 -0
- package/dist/components/erd/diff-viewer/diff-tree/DiffTree.js +130 -0
- package/dist/components/erd/diff-viewer/diff-tree/DiffTree.styles.js +139 -0
- package/dist/components/erd/diff-viewer/diff-tree/diffTreeModel.js +203 -0
- package/dist/components/erd/draw-target/DrawTargetButtons.js +284 -0
- package/dist/components/erd/draw-target/DrawTargetButtons.styles.js +64 -0
- package/dist/components/erd/draw-target/drawTargetState.js +37 -0
- package/dist/components/erd/draw-target/findDrawTarget.js +22 -0
- package/dist/components/erd/draw-target/placePill.js +72 -0
- package/dist/components/erd/erd-context-menu/ErdContextMenu.d.ts +6 -0
- package/dist/components/erd/erd-context-menu/ErdContextMenu.js +306 -0
- package/dist/components/erd/erd-context-menu/menus/databaseMenus.js +51 -0
- package/dist/components/erd/erd-context-menu/menus/drawRelationshipMenus.js +48 -0
- package/dist/components/erd/erd-context-menu/menus/exportMenus.js +38 -0
- package/dist/components/erd/erd-context-menu/menus/importMenus.js +49 -0
- package/dist/components/erd/erd-context-menu/menus/nameViewMenus.d.ts +1 -10
- package/dist/components/erd/erd-context-menu/menus/nameViewMenus.js +16 -0
- package/dist/components/erd/erd-context-menu/menus/relationshipMenus.js +105 -0
- package/dist/components/erd/erd-context-menu/menus/showMenus.js +80 -0
- package/dist/components/erd/erd-context-menu/menus/tablePlacementMenus.js +42 -0
- package/dist/components/erd/erdShortcutPerformCheck.js +20 -0
- package/dist/components/erd/erdTarget.d.ts +9 -0
- package/dist/components/erd/erdTarget.js +65 -0
- package/dist/components/erd/fieldIcon.js +17 -0
- package/dist/components/erd/floating-toolbar/FloatingToolbar.d.ts +1 -5
- package/dist/components/erd/floating-toolbar/FloatingToolbar.js +105 -0
- package/dist/components/erd/floating-toolbar/FloatingToolbar.styles.d.ts +1 -6
- package/dist/components/erd/goToErdTarget.js +248 -0
- package/dist/components/erd/hitTest.d.ts +9 -0
- package/dist/components/erd/hitTest.js +115 -0
- package/dist/components/erd/minimap/Minimap.js +98 -0
- package/dist/components/erd/minimap/Minimap.styles.js +29 -0
- package/dist/components/erd/minimap/MinimapScene.js +41 -0
- package/dist/components/erd/minimap/memo/Memo.js +17 -0
- package/dist/components/erd/minimap/minimapGeometry.js +140 -0
- package/dist/components/erd/minimap/table/Table.js +22 -0
- package/dist/components/erd/minimap/table-group/TableGroup.js +22 -0
- package/dist/components/erd/minimap/useMinimapScroll.js +83 -0
- package/dist/components/erd/minimap/viewport/Viewport.js +34 -0
- package/dist/components/erd/minimap/viewport/Viewport.styles.js +17 -0
- package/dist/components/erd/nameViewOptions.d.ts +11 -0
- package/dist/components/erd/nameViewOptions.js +18 -0
- package/dist/components/erd/readerNameView.js +5 -0
- package/dist/components/erd/relationshipHighlight.d.ts +8 -3
- package/dist/components/erd/relationshipHighlight.js +32 -0
- package/dist/components/erd/table-group/TableGroupDraft.js +14 -0
- package/dist/components/erd/table-group/TableGroupDraft.styles.js +22 -0
- package/dist/components/erd/table-group/tableGroupName.d.ts +0 -9
- package/dist/components/erd/table-group/tableGroupName.js +10 -0
- package/dist/components/erd/table-group/useTableGroupDraw.js +97 -0
- package/dist/components/erd/table-properties/TableProperties.js +67 -0
- package/dist/components/erd/table-properties/TableProperties.styles.js +172 -0
- package/dist/components/erd/table-properties/table-properties-indexes/TablePropertiesIndexes.js +76 -0
- package/dist/components/erd/table-properties/table-properties-indexes/TablePropertiesIndexes.styles.js +115 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-checkbox-column/IndexesCheckboxColumn.js +92 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-checkbox-column/IndexesCheckboxColumn.styles.js +70 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-column/IndexesColumn.js +85 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-column/IndexesColumn.styles.js +60 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-index/IndexesIndex.js +46 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-index/IndexesIndex.styles.js +85 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-key/IndexesKey.js +30 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-key/IndexesKey.styles.js +62 -0
- package/dist/components/erd/table-properties/table-properties-tabs/TablePropertiesTabs.js +21 -0
- package/dist/components/erd/table-properties/table-properties-tabs/TablePropertiesTabs.styles.js +34 -0
- package/dist/components/erd/time-travel/TimeTravel.js +83 -0
- package/dist/components/erd/time-travel/TimeTravel.styles.js +42 -0
- package/dist/components/erd/useErdShortcut.js +214 -0
- package/dist/components/erd/view-controls/ToolbarCompass.template.js +10 -0
- package/dist/components/erd/view-controls/nameViewDropdown.js +107 -0
- package/dist/components/erd/view-controls/nameViewDropdown.styles.js +31 -0
- package/dist/components/erd/view-controls/viewControls.styles.d.ts +7 -0
- package/dist/components/erd/view-controls/viewControls.styles.js +75 -0
- package/dist/components/erd/view-controls/zoomControls.d.ts +9 -0
- package/dist/components/erd/view-controls/zoomControls.js +31 -0
- package/dist/components/erd/virtual-scroll/VirtualScroll.js +63 -0
- package/dist/components/erd/virtual-scroll/VirtualScroll.styles.js +48 -0
- package/dist/components/erd/virtual-scroll/useVirtualScroll.js +126 -0
- package/dist/components/erd/welcome-screen/WelcomeScreen.js +194 -0
- package/dist/components/erd/welcome-screen/WelcomeScreen.styles.js +67 -0
- package/dist/components/erd/welcome-screen/welcome-hints/WelcomeHints.js +47 -0
- package/dist/components/erd/welcome-screen/welcome-hints/WelcomeHints.styles.js +52 -0
- package/dist/components/erd/welcome-screen/welcome-hints/hintArrows.js +10 -0
- package/dist/components/erd/welcome-screen/welcomeLayout.js +65 -0
- package/dist/components/erd-editor/ErdEditor.d.ts +14 -3
- package/dist/components/erd-editor/ErdEditor.js +188 -0
- package/dist/components/erd-editor/ErdEditor.styles.js +47 -0
- package/dist/components/erd-editor/useErdEditorAttachElement.d.ts +6 -20
- package/dist/components/erd-editor/useErdEditorAttachElement.js +284 -0
- package/dist/components/erd-editor/viewportLayout.js +93 -0
- package/dist/components/erd-view/ErdView.d.ts +25 -0
- package/dist/components/erd-view/ErdView.js +125 -0
- package/dist/components/erd-view/ErdView.styles.d.ts +3 -0
- package/dist/components/erd-view/ErdView.styles.js +51 -0
- package/dist/components/erd-view/viewportMeasure.d.ts +9 -0
- package/dist/components/erd-view/viewportMeasure.js +19 -0
- package/dist/components/erd-viewer/ErdViewer.d.ts +67 -0
- package/dist/components/erd-viewer/ErdViewer.js +287 -0
- package/dist/components/erd-viewer/documentSource.d.ts +26 -0
- package/dist/components/erd-viewer/documentSource.js +39 -0
- package/dist/components/explorer/Explorer.js +40 -0
- package/dist/components/explorer/explorer-controller/ExplorerController.js +43 -0
- package/dist/components/explorer/explorer-panel/ExplorerPanel.js +207 -0
- package/dist/components/explorer/explorer-panel/ExplorerPanel.styles.js +133 -0
- package/dist/components/explorer/explorer-search/ExplorerSearch.js +119 -0
- package/dist/components/explorer/explorer-search/ExplorerSearch.styles.js +151 -0
- package/dist/components/explorer/explorerCommands.js +45 -0
- package/dist/components/explorer/explorerNavigation.js +50 -0
- package/dist/components/explorer/explorerSearch.js +298 -0
- package/dist/components/explorer/explorerTree.js +331 -0
- package/dist/components/explorer/explorerView.js +46 -0
- package/dist/components/explorer/matchTarget.d.ts +0 -7
- package/dist/components/explorer/matchTarget.js +51 -0
- package/dist/components/export-image/ExportImage.js +230 -0
- package/dist/components/export-image/ExportImage.styles.js +172 -0
- package/dist/components/export-image/exportImageActions.js +102 -0
- package/dist/components/flowCenters.js +29 -0
- package/dist/components/generator-code/GeneratorCode.d.ts +1 -0
- package/dist/components/generator-code/GeneratorCode.js +96 -0
- package/dist/components/generator-code/generator-code-context-menu/GeneratorCodeContextMenu.js +49 -0
- package/dist/components/generator-code/generator-code-context-menu/menus/columnNameCaseMenus.js +37 -0
- package/dist/components/generator-code/generator-code-context-menu/menus/languageMenus.js +115 -0
- package/dist/components/generator-code/generator-code-context-menu/menus/tableNameCaseMenus.js +37 -0
- package/dist/components/generator-code/generator-code-options/GeneratorCodeOptions.d.ts +4 -3
- package/dist/components/generator-code/generator-code-options/GeneratorCodeOptions.js +122 -0
- package/dist/components/generator-code/generator-code-options/GeneratorCodeOptions.styles.js +12 -0
- package/dist/components/generator-code/generatorCodeView.js +17 -0
- package/dist/components/generator-code/languageSettings.js +48 -0
- package/dist/components/global-styles/GlobalStyles.js +18 -0
- package/dist/components/locale-picker/LocalePicker.js +129 -0
- package/dist/components/locale-picker/LocalePicker.styles.js +112 -0
- package/dist/components/localeContext.js +8 -0
- package/dist/components/localized/Localized.js +15 -0
- package/dist/components/map-columns/MapColumnsBody.js +186 -0
- package/dist/components/map-columns/MapColumnsDialog.js +112 -0
- package/dist/components/map-columns/MapColumnsDialog.styles.js +169 -0
- package/dist/components/map-columns/mapColumnsAction.js +18 -0
- package/dist/components/map-columns/nameOf.js +8 -0
- package/dist/components/map-columns/openMapColumns.js +10 -0
- package/dist/components/primitives/button/Button.js +12 -0
- package/dist/components/primitives/button/Button.styles.js +64 -0
- package/dist/components/primitives/code-block/CodeBlock.js +94 -0
- package/dist/components/primitives/code-block/CodeBlock.styles.js +108 -0
- package/dist/components/primitives/color-picker/ColorPicker.js +333 -0
- package/dist/components/primitives/color-picker/ColorPicker.styles.js +219 -0
- package/dist/components/primitives/color-picker/colorModel.js +116 -0
- package/dist/components/primitives/color-picker/presetColors.js +25 -0
- package/dist/components/primitives/color-picker/resolveColor.js +25 -0
- package/dist/components/primitives/context-menu/ContextMenu.js +13 -0
- package/dist/components/primitives/context-menu/context-menu-content/ContextMenuContent.js +72 -0
- package/dist/components/primitives/context-menu/context-menu-content/ContextMenuContent.styles.js +19 -0
- package/dist/components/primitives/context-menu/context-menu-content/fitMenu.js +21 -0
- package/dist/components/primitives/context-menu/context-menu-item/ContextMenuItem.js +47 -0
- package/dist/components/primitives/context-menu/context-menu-item/ContextMenuItem.styles.js +22 -0
- package/dist/components/primitives/context-menu/context-menu-root/ContextMenuRoot.js +10 -0
- package/dist/components/primitives/context-menu/context-menu-root/contextMenuRootContext.js +45 -0
- package/dist/components/primitives/context-menu/context-menu-separator/ContextMenuSeparator.js +6 -0
- package/dist/components/primitives/context-menu/context-menu-separator/ContextMenuSeparator.styles.js +9 -0
- package/dist/components/primitives/context-menu/menu/Menu.js +6 -0
- package/dist/components/primitives/context-menu/menu/Menu.styles.js +21 -0
- package/dist/components/primitives/context-menu/submenu-chevron/SubmenuChevron.js +10 -0
- package/dist/components/primitives/dialog/Dialog.js +75 -0
- package/dist/components/primitives/dialog/Dialog.styles.js +35 -0
- package/dist/components/primitives/edit-input/EditInput.js +68 -0
- package/dist/components/primitives/edit-input/EditInput.styles.js +40 -0
- package/dist/components/primitives/highlighted-text/HighlightedText.js +14 -0
- package/dist/components/primitives/highlighted-text/HighlightedText.styles.js +7 -0
- package/dist/components/primitives/icon/Icon.js +38 -0
- package/dist/components/primitives/icon/Icon.styles.js +12 -0
- package/dist/components/primitives/icon/icons.js +156 -0
- package/dist/components/primitives/kbd/Kbd.js +12 -0
- package/dist/components/primitives/kbd/Kbd.styles.js +44 -0
- package/dist/components/primitives/sash/Sash.js +46 -0
- package/dist/components/primitives/sash/Sash.styles.js +23 -0
- package/dist/components/primitives/select/Select.js +6 -0
- package/dist/components/primitives/select/Select.styles.js +59 -0
- package/dist/components/primitives/separator/Separator.js +14 -0
- package/dist/components/primitives/separator/Separator.styles.js +11 -0
- package/dist/components/primitives/slider/Slider.js +42 -0
- package/dist/components/primitives/slider/Slider.styles.js +58 -0
- package/dist/components/primitives/switch/Switch.d.ts +2 -0
- package/dist/components/primitives/switch/Switch.js +11 -0
- package/dist/components/primitives/switch/Switch.styles.js +117 -0
- package/dist/components/primitives/text-input/TextInput.js +25 -0
- package/dist/components/primitives/toast/Toast.js +24 -0
- package/dist/components/primitives/toast/Toast.styles.js +87 -0
- package/dist/components/primitives/tree/Tree.js +182 -0
- package/dist/components/primitives/tree/Tree.styles.js +71 -0
- package/dist/components/primitives/tree/treeModel.js +60 -0
- package/dist/components/quick-search/QuickSearch.d.ts +11 -2
- package/dist/components/quick-search/QuickSearch.js +290 -0
- package/dist/components/quick-search/QuickSearch.styles.js +168 -0
- package/dist/components/quick-search/actions.d.ts +2 -56
- package/dist/components/quick-search/actions.js +471 -0
- package/dist/components/quick-search/documentSearch.d.ts +60 -0
- package/dist/components/quick-search/documentSearch.js +132 -0
- package/dist/components/quick-search/hangul.js +183 -0
- package/dist/components/quick-search/paletteList.js +3 -0
- package/dist/components/quick-search/paletteQuery.js +73 -0
- package/dist/components/quick-search/scopedActions.d.ts +1 -1
- package/dist/components/quick-search/scopedActions.js +115 -0
- package/dist/components/sceneInteractionContext.d.ts +27 -0
- package/dist/components/sceneInteractionContext.js +15 -0
- package/dist/components/sceneSourceContext.js +7 -0
- package/dist/components/schema-sql/SchemaSQL.js +120 -0
- package/dist/components/schema-sql/SchemaSQL.styles.js +35 -0
- package/dist/components/schema-sql/schema-sql-context-menu/SchemaSQLContextMenu.js +45 -0
- package/dist/components/schema-sql/schema-sql-context-menu/menus/bracketMenus.js +37 -0
- package/dist/components/schema-sql/schema-sql-context-menu/menus/headerMenus.js +62 -0
- package/dist/components/schema-sql/schema-sql-context-menu/menus/statementsMenus.js +41 -0
- package/dist/components/schema-sql/schema-sql-options/SchemaSQLOptions.js +172 -0
- package/dist/components/schema-sql/schema-sql-options/SchemaSQLOptions.styles.js +271 -0
- package/dist/components/schema-sql/schema-sql-options/ScriptEditor.js +117 -0
- package/dist/components/schema-sql/schema-sql-options/ScriptEditor.styles.js +82 -0
- package/dist/components/schema-sql/schema-sql-options/dropWarning.js +13 -0
- package/dist/components/schema-sql/schemaSQLView.js +107 -0
- package/dist/components/settings/Settings.js +112 -0
- package/dist/components/settings/Settings.styles.d.ts +1 -0
- package/dist/components/settings/Settings.styles.js +158 -0
- package/dist/components/settings/columnTypeLabels.js +15 -0
- package/dist/components/settings/lockSettingRows.js +73 -0
- package/dist/components/settings/settings-lnb/SettingsLnb.js +24 -0
- package/dist/components/settings/settings-lnb/SettingsLnb.styles.js +37 -0
- package/dist/components/settings/settingsPage.js +15 -0
- package/dist/components/settings/shortcuts/Shortcuts.js +49 -0
- package/dist/components/settings/shortcuts/Shortcuts.styles.js +36 -0
- package/dist/components/table-view/Table.styles.js +76 -0
- package/dist/components/table-view/column/Column.styles.js +45 -0
- package/dist/components/table-view/column/column-data-type/ColumnDataType.js +93 -0
- package/dist/components/table-view/column/column-data-type/ColumnDataType.styles.js +51 -0
- package/dist/components/table-view/column/column-domain/ColumnDomain.js +77 -0
- package/dist/components/table-view/column/column-domain/domainOptions.js +20 -0
- package/dist/components/table-view/column/column-key/ColumnKey.js +24 -0
- package/dist/components/table-view/column/column-key/ColumnKey.styles.js +19 -0
- package/dist/components/table-view/column/column-logical-name/ColumnLogicalName.js +96 -0
- package/dist/components/table-view/column/column-logical-name/ColumnLogicalName.styles.js +51 -0
- package/dist/components/table-view/column/column-not-null/ColumnNotNull.js +15 -0
- package/dist/components/table-view/column/column-not-null/ColumnNotNull.styles.js +22 -0
- package/dist/components/table-view/column/column-option/ColumnOption.js +18 -0
- package/dist/components/table-view/column/column-option/ColumnOption.styles.js +26 -0
- package/dist/components/table-view/column/columnViewText.js +23 -0
- package/dist/components/table-view/column/useColumnCell.js +117 -0
- package/dist/components/table-view/column/useHintList.js +83 -0
- package/dist/components/theme/Theme.d.ts +5 -0
- package/dist/components/theme/Theme.js +20 -0
- package/dist/components/theme-builder/ThemeBuilder.js +90 -0
- package/dist/components/theme-builder/ThemeBuilder.styles.js +100 -0
- package/dist/components/themeContext.js +7 -0
- package/dist/components/toast-container/ToastContainer.js +46 -0
- package/dist/components/toast-container/ToastContainer.styles.js +48 -0
- package/dist/components/toast-container/openStatusToast.js +28 -0
- package/dist/components/toast-container/openToastWhileRunning.js +20 -0
- package/dist/components/toolbar/Toolbar.js +120 -0
- package/dist/components/toolbar/Toolbar.styles.d.ts +1 -0
- package/dist/components/toolbar/Toolbar.styles.js +68 -0
- package/dist/components/visualization/Visualization.js +39 -0
- package/dist/components/visualization/Visualization.styles.js +16 -0
- package/dist/components/visualization/VisualizationFlow.js +44 -0
- package/dist/components/visualization/VisualizationGraph.js +109 -0
- package/dist/components/visualization/VisualizationScene.js +56 -0
- package/dist/components/visualization/captureDrag.js +15 -0
- package/dist/components/visualization/createVisualization.js +77 -0
- package/dist/components/visualization/flowLayout.js +203 -0
- package/dist/components/visualization/graph-node/GraphNode.js +80 -0
- package/dist/components/visualization/graphPan.js +26 -0
- package/dist/components/visualization/graphViewHandle.js +30 -0
- package/dist/components/visualization/particles/ParticleLayer.js +33 -0
- package/dist/components/visualization/particles/particleEdges.js +36 -0
- package/dist/components/visualization/particles/particleLoop.js +118 -0
- package/dist/components/visualization/particles/particlePath.js +146 -0
- package/dist/components/visualization/table/Table.js +50 -0
- package/dist/components/visualization/table/column/Column.js +77 -0
- package/dist/components/visualization/useViewGestures.js +82 -0
- package/dist/components/visualization/visualization-toolbar/VisualizationToolbar.js +184 -0
- package/dist/components/visualization/visualization-toolbar/VisualizationToolbar.styles.js +24 -0
- package/dist/components/visualization/visualizationView.js +152 -0
- package/dist/components/visualization/zoomVisualization.js +31 -0
- package/dist/constants/language.js +28 -0
- package/dist/constants/layout.js +14 -0
- package/dist/constants/open.js +14 -0
- package/dist/constants/schema.js +54 -0
- package/dist/constants/sql/dataType/Databricks.js +185 -0
- package/dist/constants/sql/dataType/MSSQL.js +197 -0
- package/dist/constants/sql/dataType/MariaDB.js +349 -0
- package/dist/constants/sql/dataType/MySQL.js +285 -0
- package/dist/constants/sql/dataType/Oracle.js +209 -0
- package/dist/constants/sql/dataType/PostgreSQL.js +433 -0
- package/dist/constants/sql/dataType/SQLite.js +129 -0
- package/dist/constants/sql/dataType/Snowflake.js +221 -0
- package/dist/constants/sql/dataType/index.js +22 -0
- package/dist/constants/sql/database.js +25 -0
- package/dist/constants/tablePlacement.js +11 -0
- package/dist/constants/zoom.js +5 -0
- package/dist/engine/actions.d.ts +25 -3
- package/dist/engine/actions.js +280 -0
- package/dist/engine/clock.js +25 -0
- package/dist/engine/context.d.ts +3 -3
- package/dist/engine/context.js +10 -0
- package/dist/engine/documentJson.d.ts +16 -0
- package/dist/engine/documentJson.js +20 -0
- package/dist/engine/history.actions.js +224 -0
- package/dist/engine/history.js +72 -0
- package/dist/engine/index.js +2 -56
- package/dist/engine/modules/dictionary/actions.js +42 -0
- package/dist/engine/modules/dictionary/atom.actions.js +106 -0
- package/dist/engine/modules/dictionary/checks.js +331 -0
- package/dist/engine/modules/dictionary/derive.js +101 -0
- package/dist/engine/modules/dictionary/derivedNames.js +88 -0
- package/dist/engine/modules/dictionary/dictionaryIndex.js +112 -0
- package/dist/engine/modules/dictionary/domainLinks.js +26 -0
- package/dist/engine/modules/dictionary/domainTypes.js +72 -0
- package/dist/engine/modules/dictionary/entryWrites.js +197 -0
- package/dist/engine/modules/dictionary/generator.actions.js +217 -0
- package/dist/engine/modules/dictionary/history.js +54 -0
- package/dist/engine/modules/dictionary/membership.js +42 -0
- package/dist/engine/modules/dictionary/orderKeys.js +28 -0
- package/dist/engine/modules/dictionary/termIndex.js +42 -0
- package/dist/engine/modules/editor/actions.d.ts +5 -1
- package/dist/engine/modules/editor/actions.js +58 -0
- package/dist/engine/modules/editor/atom.actions.d.ts +19 -0
- package/dist/engine/modules/editor/atom.actions.js +584 -0
- package/dist/engine/modules/editor/generator.actions.js +761 -0
- package/dist/engine/modules/editor/history.js +37 -0
- package/dist/engine/modules/editor/state.d.ts +21 -0
- package/dist/engine/modules/editor/state.js +97 -0
- package/dist/engine/modules/editor/utils/color.js +37 -0
- package/dist/engine/modules/editor/utils/duplicate.js +234 -0
- package/dist/engine/modules/editor/utils/findRelationshipColumn.js +34 -0
- package/dist/engine/modules/editor/utils/focus.d.ts +5 -0
- package/dist/engine/modules/editor/utils/focus.js +276 -0
- package/dist/engine/modules/editor/utils/nameView.js +113 -0
- package/dist/engine/modules/editor/utils/releaseHidden.js +25 -0
- package/dist/engine/modules/editor/utils/selectRangeColumn.js +18 -0
- package/dist/engine/modules/editor/utils/selection.js +16 -0
- package/dist/engine/modules/editor/view.actions.js +134 -0
- package/dist/engine/modules/editor/view.generator.actions.js +25 -0
- package/dist/engine/modules/editor/view.js +29 -0
- package/dist/engine/modules/index/actions.js +9 -0
- package/dist/engine/modules/index/atom.actions.js +73 -0
- package/dist/engine/modules/index/generator.actions.js +25 -0
- package/dist/engine/modules/index/history.js +40 -0
- package/dist/engine/modules/index-column/actions.js +9 -0
- package/dist/engine/modules/index-column/atom.actions.js +93 -0
- package/dist/engine/modules/index-column/generator.actions.js +63 -0
- package/dist/engine/modules/index-column/history.js +55 -0
- package/dist/engine/modules/memo/actions.js +13 -0
- package/dist/engine/modules/memo/atom.actions.js +106 -0
- package/dist/engine/modules/memo/generator.actions.js +50 -0
- package/dist/engine/modules/memo/history.js +109 -0
- package/dist/engine/modules/relationship/actions.js +11 -0
- package/dist/engine/modules/relationship/atom.actions.js +103 -0
- package/dist/engine/modules/relationship/endFlags.js +32 -0
- package/dist/engine/modules/relationship/fkColumns.js +85 -0
- package/dist/engine/modules/relationship/generator.actions.js +52 -0
- package/dist/engine/modules/relationship/history.js +72 -0
- package/dist/engine/modules/relationship/hooks.js +250 -0
- package/dist/engine/modules/relationship/referenceType.js +29 -0
- package/dist/engine/modules/settings/actions.js +24 -0
- package/dist/engine/modules/settings/atom.actions.d.ts +1 -1
- package/dist/engine/modules/settings/atom.actions.js +324 -0
- package/dist/engine/modules/settings/generator.actions.d.ts +6 -0
- package/dist/engine/modules/settings/generator.actions.js +132 -0
- package/dist/engine/modules/settings/history.js +65 -0
- package/dist/engine/modules/settings/screenBaseline.d.ts +37 -0
- package/dist/engine/modules/settings/screenBaseline.js +82 -0
- package/dist/engine/modules/settings/scrollRange.js +18 -0
- package/dist/engine/modules/table/actions.js +17 -0
- package/dist/engine/modules/table/atom.actions.js +231 -0
- package/dist/engine/modules/table/generator.actions.js +351 -0
- package/dist/engine/modules/table/history.js +134 -0
- package/dist/engine/modules/table/hooks.js +12 -0
- package/dist/engine/modules/table-column/actions.js +19 -0
- package/dist/engine/modules/table-column/atom.actions.js +223 -0
- package/dist/engine/modules/table-column/generator.actions.js +165 -0
- package/dist/engine/modules/table-column/history.js +146 -0
- package/dist/engine/modules/table-column/hooks.js +33 -0
- package/dist/engine/modules/table-column/keys.js +30 -0
- package/dist/engine/modules/table-column/utils/dataType.js +71 -0
- package/dist/engine/modules/table-group/actions.js +13 -0
- package/dist/engine/modules/table-group/atom.actions.js +108 -0
- package/dist/engine/modules/table-group/generator.actions.js +158 -0
- package/dist/engine/modules/table-group/history.js +106 -0
- package/dist/engine/peer-store.js +318 -0
- package/dist/engine/presence.js +45 -0
- package/dist/engine/replication-store.js +95 -0
- package/dist/engine/rx-operators/actionsFilter.js +14 -0
- package/dist/engine/rx-operators/bufferCircuitBreaker.js +35 -0
- package/dist/engine/rx-operators/createSharedStreamActionsCompressor.js +24 -0
- package/dist/engine/rx-operators/flushOnNotifier.js +6 -0
- package/dist/engine/rx-operators/groupByStreamActions.js +32 -0
- package/dist/engine/rx-operators/ignoreTagFilter.js +17 -0
- package/dist/engine/rx-operators/lockIgnoreFilter.js +20 -0
- package/dist/engine/rx-operators/notEmptyActions.js +5 -0
- package/dist/engine/rx-operators/readonlyIgnoreFilter.d.ts +6 -1
- package/dist/engine/rx-operators/readonlyIgnoreFilter.js +23 -0
- package/dist/engine/rx-operators/readonlyScreenTag.d.ts +16 -0
- package/dist/engine/rx-operators/readonlyScreenTag.js +49 -0
- package/dist/engine/rx-operators/viewActionRedirect.js +32 -0
- package/dist/engine/rx-operators/viewIgnoreFilter.js +22 -0
- package/dist/engine/rx-store.d.ts +12 -1
- package/dist/engine/rx-store.js +158 -0
- package/dist/engine/settle.js +15 -0
- package/dist/engine/shared-store.js +114 -0
- package/dist/engine/store-hooks.js +36 -0
- package/dist/engine/store.js +39 -0
- package/dist/engine/stream-flush.js +9 -0
- package/dist/engine/tag.d.ts +5 -0
- package/dist/engine/tag.js +28 -0
- package/dist/engine/to-width.js +6 -0
- package/dist/erd-editor-schema/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.js +12 -0
- package/dist/erd-editor-schema/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPrimitive.js +14 -0
- package/dist/erd-editor-schema/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPropertyKey.js +9 -0
- package/dist/erd-editor-schema/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/typeof.js +11 -0
- package/dist/erd-editor-schema/dist/convert/v2ToV3.js +142 -0
- package/dist/erd-editor-schema/dist/dictionaryRows.js +86 -0
- package/dist/erd-editor-schema/dist/helper.js +28 -0
- package/dist/erd-editor-schema/dist/normalizeSettings.js +24 -0
- package/dist/erd-editor-schema/dist/orderKey.js +139 -0
- package/dist/erd-editor-schema/dist/parser.js +73 -0
- package/dist/erd-editor-schema/dist/query/index.js +98 -0
- package/dist/erd-editor-schema/dist/query/lww.js +38 -0
- package/dist/erd-editor-schema/dist/storageForm.js +209 -0
- package/dist/erd-editor-schema/dist/utils/bit.js +6 -0
- package/dist/erd-editor-schema/dist/v2/migrations/relationshipType.migration.js +14 -0
- package/dist/erd-editor-schema/dist/v2/parser/canvas.js +91 -0
- package/dist/erd-editor-schema/dist/v2/parser/index.js +16 -0
- package/dist/erd-editor-schema/dist/v2/parser/memo.js +40 -0
- package/dist/erd-editor-schema/dist/v2/parser/relationship.js +62 -0
- package/dist/erd-editor-schema/dist/v2/parser/table.js +125 -0
- package/dist/erd-editor-schema/dist/v2/schema/canvasEntity.js +65 -0
- package/dist/erd-editor-schema/dist/v2/schema/relationshipEntity.js +25 -0
- package/dist/erd-editor-schema/dist/v2/schema/tableEntity.js +8 -0
- package/dist/erd-editor-schema/dist/v3/parser/doc.js +29 -0
- package/dist/erd-editor-schema/dist/v3/parser/domain.entity.js +28 -0
- package/dist/erd-editor-schema/dist/v3/parser/index.entity.js +33 -0
- package/dist/erd-editor-schema/dist/v3/parser/index.js +107 -0
- package/dist/erd-editor-schema/dist/v3/parser/indexColumn.entity.js +27 -0
- package/dist/erd-editor-schema/dist/v3/parser/memo.entity.js +38 -0
- package/dist/erd-editor-schema/dist/v3/parser/migrateScroll.js +11 -0
- package/dist/erd-editor-schema/dist/v3/parser/relationship.entity.js +60 -0
- package/dist/erd-editor-schema/dist/v3/parser/settings.js +140 -0
- package/dist/erd-editor-schema/dist/v3/parser/table.entity.js +55 -0
- package/dist/erd-editor-schema/dist/v3/parser/tableColumn.entity.js +54 -0
- package/dist/erd-editor-schema/dist/v3/parser/tableGroup.entity.js +37 -0
- package/dist/erd-editor-schema/dist/v3/parser/term.entity.js +30 -0
- package/dist/erd-editor-schema/dist/v3/parser/word.entity.js +32 -0
- package/dist/erd-editor-schema/dist/v3/schema/index.js +46 -0
- package/dist/erd-editor-schema/dist/v3/schema/indexColumn.entity.js +8 -0
- package/dist/erd-editor-schema/dist/v3/schema/relationship.entity.js +31 -0
- package/dist/erd-editor-schema/dist/v3/schema/settings.js +141 -0
- package/dist/erd-editor-schema/dist/v3/schema/tableColumn.entity.js +14 -0
- package/dist/erd-editor.d.ts +2 -0
- package/dist/erd-editor.js +4 -0
- package/dist/erd-editor.umd.js +789 -750
- package/dist/erd-viewer.d.ts +2 -0
- package/dist/erd-viewer.js +4 -0
- package/dist/erd-viewer.umd.js +696 -0
- package/dist/grid/dist/Grid.js +511 -0
- package/dist/grid/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.js +12 -0
- package/dist/grid/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPrimitive.js +14 -0
- package/dist/grid/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPropertyKey.js +9 -0
- package/dist/grid/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/typeof.js +11 -0
- package/dist/grid/dist/font.js +58 -0
- package/dist/grid/dist/input/editing.js +460 -0
- package/dist/grid/dist/input/pointer.js +426 -0
- package/dist/grid/dist/model/columns.js +41 -0
- package/dist/grid/dist/model/editing.js +93 -0
- package/dist/grid/dist/model/keys.js +89 -0
- package/dist/grid/dist/model/selection.js +237 -0
- package/dist/grid/dist/model/text.js +122 -0
- package/dist/grid/dist/model/tsv.js +108 -0
- package/dist/grid/dist/model/viewport.js +75 -0
- package/dist/grid/dist/scene/GridScene.js +64 -0
- package/dist/grid/dist/scene/draw/cells.js +61 -0
- package/dist/grid/dist/scene/draw/context.js +17 -0
- package/dist/grid/dist/scene/draw/headers.js +48 -0
- package/dist/grid/dist/scene/draw/scrollbar.js +70 -0
- package/dist/grid/dist/scene/layout.js +62 -0
- package/dist/grid/dist/scene/overlay.js +144 -0
- package/dist/grid/dist/scene/paint.js +123 -0
- package/dist/grid/dist/scene/state.js +269 -0
- package/dist/grid/dist/theme.js +37 -0
- package/dist/hooks/useDarkMode.d.ts +2 -0
- package/dist/hooks/useDarkMode.js +35 -0
- package/dist/hooks/useFlipAnimation.js +10 -0
- package/dist/hooks/useKeyBindingMap.js +55 -0
- package/dist/hooks/useNavigatorLanguages.js +22 -0
- package/dist/hooks/usePinchZoom.d.ts +6 -1
- package/dist/hooks/usePinchZoom.js +60 -0
- package/dist/hooks/useUnmounted.js +16 -0
- package/dist/hooks/useViewShortcut.d.ts +14 -0
- package/dist/hooks/useViewShortcut.js +34 -0
- package/dist/i18n/loadMessages.d.ts +12 -0
- package/dist/i18n/loadMessages.js +40 -0
- package/dist/i18n/locales.js +145 -0
- package/dist/i18n/menuLabel.js +4 -0
- package/dist/i18n/messages/ar-SA.d.ts +2 -3
- package/dist/i18n/messages/ar-SA.js +550 -0
- package/dist/i18n/messages/de-DE.d.ts +2 -3
- package/dist/i18n/messages/de-DE.js +498 -0
- package/dist/i18n/messages/en/code.js +13 -0
- package/dist/i18n/messages/en/colorPicker.js +36 -0
- package/dist/i18n/messages/en/common.js +76 -0
- package/dist/i18n/messages/en/contextMenu.js +31 -0
- package/dist/i18n/messages/en/dictionary.js +76 -0
- package/dist/i18n/messages/en/explorer.js +38 -0
- package/dist/i18n/messages/en/exportImage.js +23 -0
- package/dist/i18n/messages/en/feedback.js +9 -0
- package/dist/i18n/messages/en/findReplace.js +43 -0
- package/dist/i18n/messages/en/floatingToolbar.js +13 -0
- package/dist/i18n/messages/en/index.d.ts +2 -3
- package/dist/i18n/messages/en/index.js +47 -0
- package/dist/i18n/messages/en/mapColumns.js +36 -0
- package/dist/i18n/messages/en/palette.js +36 -0
- package/dist/i18n/messages/en/schemaSql.js +27 -0
- package/dist/i18n/messages/en/settings.d.ts +0 -3
- package/dist/i18n/messages/en/settings.js +18 -0
- package/dist/i18n/messages/en/shortcuts.js +35 -0
- package/dist/i18n/messages/en/tableProperties.js +35 -0
- package/dist/i18n/messages/en/themeBuilder.js +8 -0
- package/dist/i18n/messages/en/toolbar.js +9 -0
- package/dist/i18n/messages/en/viewer.d.ts +6 -0
- package/dist/i18n/messages/en/viewer.js +7 -0
- package/dist/i18n/messages/en/visualization.js +15 -0
- package/dist/i18n/messages/en/welcome.js +14 -0
- package/dist/i18n/messages/es-ES.d.ts +2 -3
- package/dist/i18n/messages/es-ES.js +511 -0
- package/dist/i18n/messages/eu-ES.d.ts +2 -3
- package/dist/i18n/messages/eu-ES.js +498 -0
- package/dist/i18n/messages/fa-IR.d.ts +2 -3
- package/dist/i18n/messages/fa-IR.js +498 -0
- package/dist/i18n/messages/fr-FR.d.ts +2 -3
- package/dist/i18n/messages/fr-FR.js +511 -0
- package/dist/i18n/messages/he-IL.d.ts +2 -3
- package/dist/i18n/messages/he-IL.js +511 -0
- package/dist/i18n/messages/id-ID.d.ts +2 -3
- package/dist/i18n/messages/id-ID.js +459 -0
- package/dist/i18n/messages/index.d.ts +3 -3
- package/dist/i18n/messages/index.js +58 -0
- package/dist/i18n/messages/it-IT.d.ts +2 -3
- package/dist/i18n/messages/it-IT.js +511 -0
- package/dist/i18n/messages/ja-JP.d.ts +2 -3
- package/dist/i18n/messages/ja-JP.js +459 -0
- package/dist/i18n/messages/ko-KR.d.ts +2 -3
- package/dist/i18n/messages/ko-KR.js +459 -0
- package/dist/i18n/messages/nl-NL.d.ts +2 -3
- package/dist/i18n/messages/nl-NL.js +498 -0
- package/dist/i18n/messages/pl-PL.d.ts +2 -3
- package/dist/i18n/messages/pl-PL.js +524 -0
- package/dist/i18n/messages/pt-BR.d.ts +2 -3
- package/dist/i18n/messages/pt-BR.js +511 -0
- package/dist/i18n/messages/pt-PT.d.ts +2 -3
- package/dist/i18n/messages/pt-PT.js +511 -0
- package/dist/i18n/messages/ro-RO.d.ts +2 -3
- package/dist/i18n/messages/ro-RO.js +511 -0
- package/dist/i18n/messages/ru-RU.d.ts +2 -3
- package/dist/i18n/messages/ru-RU.js +524 -0
- package/dist/i18n/messages/sk-SK.d.ts +2 -3
- package/dist/i18n/messages/sk-SK.js +524 -0
- package/dist/i18n/messages/sl-SI.d.ts +2 -3
- package/dist/i18n/messages/sl-SI.js +524 -0
- package/dist/i18n/messages/sv-SE.d.ts +2 -3
- package/dist/i18n/messages/sv-SE.js +498 -0
- package/dist/i18n/messages/tr-TR.d.ts +2 -3
- package/dist/i18n/messages/tr-TR.js +498 -0
- package/dist/i18n/messages/uk-UA.d.ts +2 -3
- package/dist/i18n/messages/uk-UA.js +524 -0
- package/dist/i18n/messages/zh-CN.d.ts +2 -3
- package/dist/i18n/messages/zh-CN.js +459 -0
- package/dist/i18n/messages/zh-TW.d.ts +2 -3
- package/dist/i18n/messages/zh-TW.js +459 -0
- package/dist/i18n/resolveLocale.js +28 -0
- package/dist/i18n/source.js +6 -0
- package/dist/i18n/translate.js +34 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +8 -48293
- package/dist/konva/scene/columnDropTarget.js +43 -0
- package/dist/konva/scene/contentBounds.js +48 -0
- package/dist/konva/scene/fitZoom.d.ts +7 -0
- package/dist/konva/scene/fitZoom.js +31 -0
- package/dist/konva/scene/konvaFlip.js +125 -0
- package/dist/konva/scene/metrics.js +59 -0
- package/dist/konva/scene/renderScene.js +37 -0
- package/dist/konva/scene/stacking.js +13 -0
- package/dist/konva/scene/viewFreeze.js +29 -0
- package/dist/konva/scene/viewLayout.js +171 -0
- package/dist/konva/scene/viewport.js +86 -0
- package/dist/konva/testHandle.d.ts +9 -3
- package/dist/konva/testHandle.js +5 -0
- package/dist/konva/theme.js +45 -0
- package/dist/peer/index.js +35 -235
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/assertClassBrand.js +7 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/checkPrivateRedeclaration.js +6 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldGet2.js +7 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldInitSpec.js +7 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldSet2.js +7 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.js +12 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPrimitive.js +14 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPropertyKey.js +9 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/typeof.js +11 -0
- package/dist/r-html/dist/constants.js +36 -0
- package/dist/r-html/dist/context/createContext.js +49 -0
- package/dist/r-html/dist/context/useContext.js +28 -0
- package/dist/r-html/dist/context/useProvider.js +41 -0
- package/dist/r-html/dist/css/compile.js +27 -0
- package/dist/r-html/dist/css/diagnostics.js +195 -0
- package/dist/r-html/dist/css/element.js +34 -0
- package/dist/r-html/dist/css/emit.js +26 -0
- package/dist/r-html/dist/css/flatten.js +76 -0
- package/dist/r-html/dist/css/hash.js +15 -0
- package/dist/r-html/dist/css/index.js +31 -0
- package/dist/r-html/dist/css/selector.js +11 -0
- package/dist/r-html/dist/helpers/array.js +9 -0
- package/dist/r-html/dist/helpers/fn.js +14 -0
- package/dist/r-html/dist/helpers/is-type.js +16 -0
- package/dist/r-html/dist/helpers/subject.js +21 -0
- package/dist/r-html/dist/observable/index.js +78 -0
- package/dist/r-html/dist/observable/scheduler.js +84 -0
- package/dist/r-html/dist/parser/html/helper.js +58 -0
- package/dist/r-html/dist/parser/html/index.js +101 -0
- package/dist/r-html/dist/parser/html/tokenizer.js +161 -0
- package/dist/r-html/dist/parser/vNode.js +32 -0
- package/dist/r-html/dist/render/directives/attribute/ref.js +18 -0
- package/dist/r-html/dist/render/directives/attributeDirective.js +7 -0
- package/dist/r-html/dist/render/directives/index.js +13 -0
- package/dist/r-html/dist/render/directives/node/cache.js +56 -0
- package/dist/r-html/dist/render/directives/node/innerHTML.js +20 -0
- package/dist/r-html/dist/render/directives/node/repeat.js +124 -0
- package/dist/r-html/dist/render/directives/nodeDirective.js +15 -0
- package/dist/r-html/dist/render/domAdapter.js +74 -0
- package/dist/r-html/dist/render/helper.js +91 -0
- package/dist/r-html/dist/render/hmr.js +64 -0
- package/dist/r-html/dist/render/host.js +16 -0
- package/dist/r-html/dist/render/hostTemplate.js +35 -0
- package/dist/r-html/dist/render/index.js +9 -0
- package/dist/r-html/dist/render/part/attribute/attribute.js +102 -0
- package/dist/r-html/dist/render/part/attribute/boolean.js +33 -0
- package/dist/r-html/dist/render/part/attribute/directive.js +48 -0
- package/dist/r-html/dist/render/part/attribute/event.js +49 -0
- package/dist/r-html/dist/render/part/attribute/index.js +12 -0
- package/dist/r-html/dist/render/part/attribute/property.js +30 -0
- package/dist/r-html/dist/render/part/attribute/spread.js +28 -0
- package/dist/r-html/dist/render/part/container.js +64 -0
- package/dist/r-html/dist/render/part/index.js +32 -0
- package/dist/r-html/dist/render/part/node/comment.js +34 -0
- package/dist/r-html/dist/render/part/node/component/hooks.js +28 -0
- package/dist/r-html/dist/render/part/node/component/index.js +37 -0
- package/dist/r-html/dist/render/part/node/component/observableComponent.js +111 -0
- package/dist/r-html/dist/render/part/node/component/prop.js +30 -0
- package/dist/r-html/dist/render/part/node/component/webComponent/helper.js +19 -0
- package/dist/r-html/dist/render/part/node/component/webComponent/index.js +79 -0
- package/dist/r-html/dist/render/part/node/text/array.js +87 -0
- package/dist/r-html/dist/render/part/node/text/arrayDiff.js +90 -0
- package/dist/r-html/dist/render/part/node/text/directive.js +51 -0
- package/dist/r-html/dist/render/part/node/text/function.js +7 -0
- package/dist/r-html/dist/render/part/node/text/helper.js +55 -0
- package/dist/r-html/dist/render/part/node/text/index.js +54 -0
- package/dist/r-html/dist/render/part/node/text/node.js +25 -0
- package/dist/r-html/dist/render/part/node/text/object.js +60 -0
- package/dist/r-html/dist/render/part/node/text/primitive.js +26 -0
- package/dist/r-html/dist/render/part/node/text/templateLiterals.js +38 -0
- package/dist/r-html/dist/render/value.js +8 -0
- package/dist/r-html/dist/store/index.js +72 -0
- package/dist/r-html/dist/template/css.js +70 -0
- package/dist/r-html/dist/template/cssDiagnostics.js +23 -0
- package/dist/r-html/dist/template/cssSource.js +62 -0
- package/dist/r-html/dist/template/helper.js +37 -0
- package/dist/r-html/dist/template/html.js +29 -0
- package/dist/r-html/dist/template/index.js +13 -0
- package/dist/r-html/dist/template/tNode.js +107 -0
- package/dist/r-html/dist/template/vCSSStyleSheet.js +162 -0
- package/dist/r-html-konva/dist/batchDraw.js +90 -0
- package/dist/r-html-konva/dist/host.js +336 -0
- package/dist/schema-sql-parser/dist/parser/dataType/Databricks.js +50 -0
- package/dist/schema-sql-parser/dist/parser/dataType/MSSQL.js +53 -0
- package/dist/schema-sql-parser/dist/parser/dataType/MariaDB.js +91 -0
- package/dist/schema-sql-parser/dist/parser/dataType/MySQL.js +75 -0
- package/dist/schema-sql-parser/dist/parser/dataType/Oracle.js +56 -0
- package/dist/schema-sql-parser/dist/parser/dataType/PostgreSQL.js +112 -0
- package/dist/schema-sql-parser/dist/parser/dataType/SQLite.js +36 -0
- package/dist/schema-sql-parser/dist/parser/dataType/Snowflake.js +59 -0
- package/dist/schema-sql-parser/dist/parser/helper.js +701 -0
- package/dist/schema-sql-parser/dist/parser/index.js +70 -0
- package/dist/schema-sql-parser/dist/parser/statement/add.extended.property.js +73 -0
- package/dist/schema-sql-parser/dist/parser/statement/alter.table.add.default.js +75 -0
- package/dist/schema-sql-parser/dist/parser/statement/alter.table.add.foreignKey.js +69 -0
- package/dist/schema-sql-parser/dist/parser/statement/alter.table.add.primaryKey.js +86 -0
- package/dist/schema-sql-parser/dist/parser/statement/alter.table.add.unique.js +128 -0
- package/dist/schema-sql-parser/dist/parser/statement/alter.table.alter.column.js +90 -0
- package/dist/schema-sql-parser/dist/parser/statement/comment.on.column.js +56 -0
- package/dist/schema-sql-parser/dist/parser/statement/comment.on.table.js +52 -0
- package/dist/schema-sql-parser/dist/parser/statement/create.index.js +61 -0
- package/dist/schema-sql-parser/dist/parser/statement/create.table.js +549 -0
- package/dist/schema-sql-parser/dist/parser/statement/default.expression.js +206 -0
- package/dist/schema-sql-parser/dist/parser/statement/index.columns.js +49 -0
- package/dist/schema-sql-parser/dist/parser/statement/index.js +25 -0
- package/dist/schema-sql-parser/dist/parser/tokenizer.js +241 -0
- package/dist/services/elk-layout/elkGraph.js +184 -0
- package/dist/services/elk-layout/elkLayoutOptions.js +52 -0
- package/dist/services/elk-layout/index.js +45 -0
- package/dist/services/export-png/ExportScene.js +30 -0
- package/dist/services/export-png/documentScene.js +45 -0
- package/dist/services/export-png/exportBox.js +63 -0
- package/dist/services/export-png/exportTheme.js +16 -0
- package/dist/services/export-png/index.js +139 -0
- package/dist/services/export-png/pixelRatio.js +12 -0
- package/dist/services/export-png/renderPng.js +52 -0
- package/dist/services/export-png/renderSvg.js +24 -0
- package/dist/services/export-png/sceneSvg.js +315 -0
- package/dist/services/export-png/textWidth.js +12 -0
- package/dist/services/export-png/toImage.d.ts +27 -0
- package/dist/services/export-png/toImage.js +49 -0
- package/dist/services/shiki/index.js +24 -0
- package/dist/styles/elevation.styles.js +9 -0
- package/dist/styles/fonts.styles.js +12 -0
- package/dist/styles/reset.styles.js +104 -0
- package/dist/styles/scrollbar.styles.js +27 -0
- package/dist/styles/typography.styles.js +63 -0
- package/dist/themes/radix-ui-theme.config.js +133 -0
- package/dist/themes/radix-ui-theme.js +231 -0
- package/dist/themes/tokens.js +107 -0
- package/dist/utils/arrayHas.js +7 -0
- package/dist/utils/attribute.js +11 -0
- package/dist/utils/bit.js +6 -0
- package/dist/utils/calcMemo.js +9 -0
- package/dist/utils/calcTable.js +220 -0
- package/dist/utils/clickGesture.js +33 -0
- package/dist/utils/clipboard.js +45 -0
- package/dist/utils/collection/domain.entity.js +13 -0
- package/dist/utils/collection/index.entity.js +13 -0
- package/dist/utils/collection/indexColumn.entity.js +12 -0
- package/dist/utils/collection/memo.entity.js +18 -0
- package/dist/utils/collection/relationship.entity.js +28 -0
- package/dist/utils/collection/sequence.js +21 -0
- package/dist/utils/collection/table.entity.js +24 -0
- package/dist/utils/collection/tableColumn.entity.js +25 -0
- package/dist/utils/collection/tableGroup.entity.js +17 -0
- package/dist/utils/collection/term.entity.js +14 -0
- package/dist/utils/collection/word.entity.js +15 -0
- package/dist/utils/contrastText.js +26 -0
- package/dist/utils/deepMerge.js +24 -0
- package/dist/utils/device-detect/index.js +6 -0
- package/dist/utils/dictionary-csv/csv.js +61 -0
- package/dist/utils/dictionary-csv/decode.js +10 -0
- package/dist/utils/dictionary-csv/dictionaryCsv.js +150 -0
- package/dist/utils/diff/compareEntities.js +200 -0
- package/dist/{components/erd/diff-viewer → utils/diff}/diff.d.ts +1 -1
- package/dist/utils/diff/diff.js +29 -0
- package/dist/utils/diff/diffDocuments.js +224 -0
- package/dist/utils/diff/pairEntities.js +71 -0
- package/dist/utils/diff/types.d.ts +1 -1
- package/dist/utils/diff/types.js +38 -0
- package/dist/utils/domEvent.js +55 -0
- package/dist/utils/dragSelect.js +9 -0
- package/dist/utils/draw-relationship/bezier.js +44 -0
- package/dist/utils/draw-relationship/calc.js +91 -0
- package/dist/utils/draw-relationship/corner.js +60 -0
- package/dist/utils/draw-relationship/draw.js +194 -0
- package/dist/utils/draw-relationship/incremental.d.ts +4 -4
- package/dist/utils/draw-relationship/incremental.js +135 -0
- package/dist/utils/draw-relationship/index.d.ts +16 -1
- package/dist/utils/draw-relationship/index.js +198 -0
- package/dist/utils/draw-relationship/loop.js +25 -0
- package/dist/utils/draw-relationship/nudge.js +402 -0
- package/dist/utils/draw-relationship/pathFinding.js +277 -0
- package/dist/utils/draw-relationship/route.d.ts +12 -0
- package/dist/utils/draw-relationship/route.js +460 -0
- package/dist/utils/draw-relationship/search.d.ts +15 -0
- package/dist/utils/draw-relationship/search.js +294 -0
- package/dist/utils/draw-relationship/sort.js +370 -0
- package/dist/utils/draw-relationship/stub.js +46 -0
- package/dist/utils/emitter.d.ts +15 -0
- package/dist/utils/emitter.js +76 -0
- package/dist/utils/file/exportFile.js +52 -0
- package/dist/utils/file/importFile.js +201 -0
- package/dist/utils/file/importSchema.js +128 -0
- package/dist/utils/find-replace/findMatches.js +212 -0
- package/dist/utils/find-replace/index.d.ts +0 -1
- package/dist/utils/find-replace/matcher.js +128 -0
- package/dist/utils/find-replace/present.js +48 -0
- package/dist/utils/find-replace/preserveCase.js +25 -0
- package/dist/utils/find-replace/replaceActions.js +70 -0
- package/dist/utils/flipAnimation.js +52 -0
- package/dist/utils/focus.js +40 -0
- package/dist/utils/formatCount.js +12 -0
- package/dist/utils/generator-code/aml.js +199 -0
- package/dist/utils/generator-code/columnTypes.js +369 -0
- package/dist/utils/generator-code/csharp.js +230 -0
- package/dist/utils/generator-code/dbml.js +248 -0
- package/dist/utils/generator-code/doctrine.js +964 -0
- package/dist/utils/generator-code/doctrineReservedWords.js +57 -0
- package/dist/utils/generator-code/drizzle.js +1853 -0
- package/dist/utils/generator-code/go.js +160 -0
- package/dist/utils/generator-code/graphql.js +347 -0
- package/dist/utils/generator-code/heck.js +47 -0
- package/dist/utils/generator-code/index.js +179 -0
- package/dist/utils/generator-code/java.js +179 -0
- package/dist/utils/generator-code/jpa.js +218 -0
- package/dist/utils/generator-code/jsonSchema.js +402 -0
- package/dist/utils/generator-code/jsonShape.js +169 -0
- package/dist/utils/generator-code/kotlin.js +102 -0
- package/dist/utils/generator-code/mermaid.js +130 -0
- package/dist/utils/generator-code/php.js +211 -0
- package/dist/utils/generator-code/rust.js +143 -0
- package/dist/utils/generator-code/rustTypes.js +132 -0
- package/dist/utils/generator-code/scala.js +124 -0
- package/dist/utils/generator-code/seaorm.js +581 -0
- package/dist/utils/generator-code/sequelize.js +1225 -0
- package/dist/utils/generator-code/sqlalchemy.js +1250 -0
- package/dist/utils/generator-code/swift.js +222 -0
- package/dist/utils/generator-code/typeorm.js +998 -0
- package/dist/utils/generator-code/typescript.js +67 -0
- package/dist/utils/generator-code/utils.js +87 -0
- package/dist/utils/generator-code/zod.js +106 -0
- package/dist/utils/globalEventObservable.js +67 -0
- package/dist/utils/highlightWords.js +48 -0
- package/dist/utils/icon.js +35 -0
- package/dist/utils/index.js +26 -0
- package/dist/utils/internalEvents.js +26 -0
- package/dist/utils/keyboard-shortcut/bindKeys.js +30 -0
- package/dist/utils/keyboard-shortcut/index.d.ts +7 -1
- package/dist/utils/keyboard-shortcut/index.js +243 -0
- package/dist/utils/keyboard-shortcut/utils.js +32 -0
- package/dist/utils/loadValue.js +11 -0
- package/dist/utils/map-columns/alignTypes.js +48 -0
- package/dist/utils/map-columns/buildRows.js +337 -0
- package/dist/utils/map-columns/candidateKeys.js +24 -0
- package/dist/utils/map-columns/mapping.js +41 -0
- package/dist/utils/map-columns/prefill.js +32 -0
- package/dist/utils/map-columns/toMapColumnsActions.js +63 -0
- package/dist/utils/map-columns/validate.js +81 -0
- package/dist/utils/memo.js +6 -0
- package/dist/utils/pinch.d.ts +5 -1
- package/dist/utils/pinch.js +99 -0
- package/dist/utils/promise.js +16 -0
- package/dist/utils/referentialAction.js +23 -0
- package/dist/utils/rx-operators/fromCopy.js +7 -0
- package/dist/utils/rx-operators/fromPaste.js +7 -0
- package/dist/utils/rx-operators/fromShadowDraggable.js +5 -0
- package/dist/utils/safeCallback.js +10 -0
- package/dist/utils/schema-aml-parser/convert.js +285 -0
- package/dist/utils/schema-aml-parser/dataType.js +57 -0
- package/dist/utils/schema-aml-parser/index.js +22 -0
- package/dist/utils/schema-aml-parser/parser.js +637 -0
- package/dist/utils/schema-aml-parser/tokenizer.js +208 -0
- package/dist/utils/schema-aml-parser/types.js +8 -0
- package/dist/utils/schema-dbml-parser/convert.js +324 -0
- package/dist/utils/schema-dbml-parser/dataType.js +32 -0
- package/dist/utils/schema-dbml-parser/index.js +23 -0
- package/dist/utils/schema-dbml-parser/parser.js +646 -0
- package/dist/utils/schema-dbml-parser/tokenizer.js +185 -0
- package/dist/utils/schema-graphql-parser/convert.js +410 -0
- package/dist/utils/schema-graphql-parser/dataType.js +228 -0
- package/dist/utils/schema-graphql-parser/index.js +23 -0
- package/dist/utils/schema-graphql-parser/parser.js +490 -0
- package/dist/utils/schema-sql/Databricks.js +158 -0
- package/dist/utils/schema-sql/MSSQL.js +214 -0
- package/dist/utils/schema-sql/MariaDB.js +143 -0
- package/dist/utils/schema-sql/MySQL.js +224 -0
- package/dist/utils/schema-sql/Oracle.js +236 -0
- package/dist/utils/schema-sql/PostgreSQL.js +179 -0
- package/dist/utils/schema-sql/SQLite.js +129 -0
- package/dist/utils/schema-sql/Snowflake.js +148 -0
- package/dist/utils/schema-sql/index.d.ts +6 -3
- package/dist/utils/schema-sql/index.js +238 -0
- package/dist/utils/schema-sql/options.js +97 -0
- package/dist/utils/schema-sql/utils.d.ts +1 -43
- package/dist/utils/schema-sql/utils.js +251 -0
- package/dist/utils/schema-sql-parser/index.js +312 -0
- package/dist/utils/schema-sql-parser/utils.js +7 -0
- package/dist/utils/sharedColor.js +19 -0
- package/dist/utils/stageCursor.js +20 -0
- package/dist/utils/table-clipboard/copy.js +208 -0
- package/dist/utils/table-clipboard/index.js +28 -0
- package/dist/utils/table-clipboard/paste.js +154 -0
- package/dist/utils/table-clipboard/payload.js +73 -0
- package/dist/utils/table-clipboard/placement.js +54 -0
- package/dist/utils/tableColor.js +139 -0
- package/dist/utils/tableGroup.js +146 -0
- package/dist/utils/tableKeys.js +82 -0
- package/dist/utils/tableName.d.ts +47 -0
- package/dist/utils/tableName.js +72 -0
- package/dist/utils/takeover.js +10 -0
- package/dist/utils/text.js +47 -0
- package/dist/utils/validation.js +47 -0
- package/dist/utils/virtualRange.js +21 -0
- package/dist/uuid/dist/uuid25.js +11 -0
- package/dist/uuid/dist/uuidv7.js +25 -0
- package/dist/workers/elkLayout.shared-worker.js +327 -1
- package/dist/workers/elkLayout.spawn.d.ts +3 -0
- package/dist/workers/elkLayout.spawn.inline.d.ts +3 -0
- package/dist/workers/elkLayout.spawn.js +9 -0
- package/dist/workers/exportPng.shared-worker.js +32969 -55
- package/dist/workers/exportPng.spawn.d.ts +7 -0
- package/dist/workers/exportPng.spawn.inline.d.ts +7 -0
- package/dist/workers/exportPng.spawn.js +9 -0
- package/dist/workers/shiki.shared-worker.js +119 -1
- package/dist/workers/shiki.spawn.d.ts +3 -0
- package/dist/workers/shiki.spawn.inline.d.ts +3 -0
- package/dist/workers/shiki.spawn.js +9 -0
- package/package.json +37 -5
- package/dist/components/customElementRegistry.d.ts +0 -1
- package/dist/components/erd/diff-viewer/diffContext.d.ts +0 -9
- package/dist/components/erd/diff-viewer/erd-viewer/ErdViewer.d.ts +0 -11
- package/dist/loadValue-B5ojYrZ-.js +0 -14682
- package/dist/shared-store-S7YWEz3E.js +0 -1656
- package/dist/workers/spawn.d.ts +0 -9
- package/dist/workers/spawn.inline.d.ts +0 -9
- /package/dist/components/{explorer → erd}/fieldIcon.d.ts +0 -0
- /package/dist/components/erd/{floating-toolbar → view-controls}/ToolbarCompass.template.d.ts +0 -0
- /package/dist/components/erd/{floating-toolbar → view-controls}/nameViewDropdown.d.ts +0 -0
- /package/dist/components/erd/{floating-toolbar → view-controls}/nameViewDropdown.styles.d.ts +0 -0
|
@@ -0,0 +1,964 @@
|
|
|
1
|
+
import { query } from "../../erd-editor-schema/dist/query/index.js";
|
|
2
|
+
import { BracketType, ColumnOption, Database } from "../../constants/schema.js";
|
|
3
|
+
import { bHas } from "../bit.js";
|
|
4
|
+
import { autoNameIgnoreCase, isDelimitedPart, orderByNameASC, splitNameParts, tableNamePart, unquoteNamePart } from "../tableName.js";
|
|
5
|
+
import { referentialActionSupport } from "../schema-sql/utils.js";
|
|
6
|
+
import { baseTypeName, fractionalNumber, getNameCase, getPrimitiveType, hasNRelationship, hasOneRelationship, referentialActionEntries } from "./utils.js";
|
|
7
|
+
import { POSTGRES_BIT_TYPES, enumMembers } from "./columnTypes.js";
|
|
8
|
+
import { DOCTRINE_RESERVED_WORDS } from "./doctrineReservedWords.js";
|
|
9
|
+
import { INDENT, PHP_HEADER, isPostgresArray, toClassName } from "./php.js";
|
|
10
|
+
//#region src/utils/generator-code/doctrine.ts
|
|
11
|
+
var PHP_TYPES = {
|
|
12
|
+
BIGINT: "int",
|
|
13
|
+
BINARY: "string",
|
|
14
|
+
BLOB: "mixed",
|
|
15
|
+
BOOLEAN: "bool",
|
|
16
|
+
DATE_IMMUTABLE: "\\DateTimeImmutable",
|
|
17
|
+
DATETIME_IMMUTABLE: "\\DateTimeImmutable",
|
|
18
|
+
DATETIMETZ_IMMUTABLE: "\\DateTimeImmutable",
|
|
19
|
+
DECIMAL: "string",
|
|
20
|
+
ENUM: "string",
|
|
21
|
+
FLOAT: "float",
|
|
22
|
+
GUID: "string",
|
|
23
|
+
INTEGER: "int",
|
|
24
|
+
JSON: "array",
|
|
25
|
+
SIMPLE_ARRAY: "array",
|
|
26
|
+
SMALLFLOAT: "float",
|
|
27
|
+
SMALLINT: "int",
|
|
28
|
+
STRING: "string",
|
|
29
|
+
TEXT: "string",
|
|
30
|
+
TIME_IMMUTABLE: "\\DateTimeImmutable"
|
|
31
|
+
};
|
|
32
|
+
var convertTypeMap = {
|
|
33
|
+
int: "INTEGER",
|
|
34
|
+
long: "BIGINT",
|
|
35
|
+
float: "FLOAT",
|
|
36
|
+
double: "FLOAT",
|
|
37
|
+
decimal: "DECIMAL",
|
|
38
|
+
boolean: "BOOLEAN",
|
|
39
|
+
string: "STRING",
|
|
40
|
+
lob: "TEXT",
|
|
41
|
+
date: "DATE_IMMUTABLE",
|
|
42
|
+
dateTime: "DATETIME_IMMUTABLE",
|
|
43
|
+
time: "STRING"
|
|
44
|
+
};
|
|
45
|
+
var namedTypes = /* @__PURE__ */ new Map([
|
|
46
|
+
["bfile", "BLOB"],
|
|
47
|
+
["binary", "BINARY"],
|
|
48
|
+
["binary varying", "BINARY"],
|
|
49
|
+
["binary_float", "FLOAT"],
|
|
50
|
+
["blob", "BLOB"],
|
|
51
|
+
["bytea", "BLOB"],
|
|
52
|
+
["datetimeoffset", "DATETIMETZ_IMMUTABLE"],
|
|
53
|
+
["image", "BLOB"],
|
|
54
|
+
["int2", "SMALLINT"],
|
|
55
|
+
["json", "JSON"],
|
|
56
|
+
["jsonb", "JSON"],
|
|
57
|
+
["long raw", "BLOB"],
|
|
58
|
+
["long varbinary", "BLOB"],
|
|
59
|
+
["longblob", "BLOB"],
|
|
60
|
+
["mediumblob", "BLOB"],
|
|
61
|
+
["money", "DECIMAL"],
|
|
62
|
+
["raw", "BINARY"],
|
|
63
|
+
["serial2", "SMALLINT"],
|
|
64
|
+
["smallint", "SMALLINT"],
|
|
65
|
+
["smallmoney", "DECIMAL"],
|
|
66
|
+
["smallserial", "SMALLINT"],
|
|
67
|
+
["time", "TIME_IMMUTABLE"],
|
|
68
|
+
["time with time zone", "TIME_IMMUTABLE"],
|
|
69
|
+
["time without time zone", "TIME_IMMUTABLE"],
|
|
70
|
+
["timestamp with time zone", "DATETIMETZ_IMMUTABLE"],
|
|
71
|
+
["timestamp_tz", "DATETIMETZ_IMMUTABLE"],
|
|
72
|
+
["timestamptz", "DATETIMETZ_IMMUTABLE"],
|
|
73
|
+
["timetz", "TIME_IMMUTABLE"],
|
|
74
|
+
["tinyblob", "BLOB"],
|
|
75
|
+
["tinyint", "SMALLINT"],
|
|
76
|
+
["uniqueidentifier", "GUID"],
|
|
77
|
+
["uuid", "GUID"],
|
|
78
|
+
["varbinary", "BINARY"]
|
|
79
|
+
]);
|
|
80
|
+
var vendorTypes = /* @__PURE__ */ new Map([
|
|
81
|
+
[Database.MSSQL, /* @__PURE__ */ new Map([["bit", "BOOLEAN"], ["numeric", "DECIMAL"]])],
|
|
82
|
+
[Database.Oracle, /* @__PURE__ */ new Map([["date", "DATE_IMMUTABLE"], ["smallint", "INTEGER"]])],
|
|
83
|
+
[Database.MySQL, /* @__PURE__ */ new Map([["char byte", "BINARY"]])],
|
|
84
|
+
[Database.MariaDB, /* @__PURE__ */ new Map([["char byte", "BINARY"]])]
|
|
85
|
+
]);
|
|
86
|
+
var rowVersionTypes = /* @__PURE__ */ new Set(["rowversion", "timestamp"]);
|
|
87
|
+
var nationalTypes = /* @__PURE__ */ new Set([
|
|
88
|
+
"national char varying",
|
|
89
|
+
"national character varying",
|
|
90
|
+
"nvarchar"
|
|
91
|
+
]);
|
|
92
|
+
var unicodeTextTypes = /* @__PURE__ */ new Set(["national text", "ntext"]);
|
|
93
|
+
var mysqlNationalTypes = /* @__PURE__ */ new Set([
|
|
94
|
+
"national char",
|
|
95
|
+
"national char varying",
|
|
96
|
+
"national character",
|
|
97
|
+
"national character varying",
|
|
98
|
+
"national varchar",
|
|
99
|
+
"national varcharacter",
|
|
100
|
+
"nchar",
|
|
101
|
+
"nchar varchar",
|
|
102
|
+
"nchar varcharacter",
|
|
103
|
+
"nchar varying",
|
|
104
|
+
"nvarchar"
|
|
105
|
+
]);
|
|
106
|
+
var oracleNumberTypes = /* @__PURE__ */ new Set([
|
|
107
|
+
"dec",
|
|
108
|
+
"decimal",
|
|
109
|
+
"number",
|
|
110
|
+
"numeric"
|
|
111
|
+
]);
|
|
112
|
+
var lengthTypes = /* @__PURE__ */ new Set([
|
|
113
|
+
"binary",
|
|
114
|
+
"binary varying",
|
|
115
|
+
"bpchar",
|
|
116
|
+
"char",
|
|
117
|
+
"char byte",
|
|
118
|
+
"char varying",
|
|
119
|
+
"character",
|
|
120
|
+
"character varying",
|
|
121
|
+
"national char",
|
|
122
|
+
"national char varying",
|
|
123
|
+
"national character",
|
|
124
|
+
"national character varying",
|
|
125
|
+
"national varchar",
|
|
126
|
+
"national varcharacter",
|
|
127
|
+
"native character",
|
|
128
|
+
"nchar",
|
|
129
|
+
"nchar varchar",
|
|
130
|
+
"nchar varcharacter",
|
|
131
|
+
"nchar varying",
|
|
132
|
+
"nvarchar",
|
|
133
|
+
"nvarchar2",
|
|
134
|
+
"raw",
|
|
135
|
+
"string",
|
|
136
|
+
"text",
|
|
137
|
+
"varbinary",
|
|
138
|
+
"varchar",
|
|
139
|
+
"varchar2",
|
|
140
|
+
"varcharacter",
|
|
141
|
+
"varying character"
|
|
142
|
+
]);
|
|
143
|
+
var fixedLengthTypes = /* @__PURE__ */ new Set([
|
|
144
|
+
"binary",
|
|
145
|
+
"bpchar",
|
|
146
|
+
"char",
|
|
147
|
+
"char byte",
|
|
148
|
+
"character",
|
|
149
|
+
"national char",
|
|
150
|
+
"national character",
|
|
151
|
+
"nchar"
|
|
152
|
+
]);
|
|
153
|
+
var oneCharacterTypes = /* @__PURE__ */ new Set([
|
|
154
|
+
"char",
|
|
155
|
+
"character",
|
|
156
|
+
"national char",
|
|
157
|
+
"national character",
|
|
158
|
+
"nchar"
|
|
159
|
+
]);
|
|
160
|
+
var unboundedStringTypes = /* @__PURE__ */ new Set(["string", "text"]);
|
|
161
|
+
var mysqlLobLengths = /* @__PURE__ */ new Map([
|
|
162
|
+
["long", 16777215],
|
|
163
|
+
["long char varying", 16777215],
|
|
164
|
+
["long character varying", 16777215],
|
|
165
|
+
["long varbinary", 16777215],
|
|
166
|
+
["long varchar", 16777215],
|
|
167
|
+
["long varcharacter", 16777215],
|
|
168
|
+
["mediumblob", 16777215],
|
|
169
|
+
["mediumtext", 16777215],
|
|
170
|
+
["tinyblob", 255],
|
|
171
|
+
["tinytext", 255],
|
|
172
|
+
["blob", 65535],
|
|
173
|
+
["text", 65535]
|
|
174
|
+
]);
|
|
175
|
+
var MYSQL_TEXT_BYTES = [
|
|
176
|
+
255,
|
|
177
|
+
65535,
|
|
178
|
+
16777215
|
|
179
|
+
];
|
|
180
|
+
var serialTypes = /* @__PURE__ */ new Set([
|
|
181
|
+
"bigserial",
|
|
182
|
+
"serial",
|
|
183
|
+
"serial2",
|
|
184
|
+
"serial4",
|
|
185
|
+
"serial8",
|
|
186
|
+
"smallserial"
|
|
187
|
+
]);
|
|
188
|
+
var integerTypes = /* @__PURE__ */ new Set([
|
|
189
|
+
"BIGINT",
|
|
190
|
+
"INTEGER",
|
|
191
|
+
"SMALLINT"
|
|
192
|
+
]);
|
|
193
|
+
var unsignedTypes = /* @__PURE__ */ new Set([
|
|
194
|
+
...integerTypes,
|
|
195
|
+
"DECIMAL",
|
|
196
|
+
"FLOAT",
|
|
197
|
+
"SMALLFLOAT"
|
|
198
|
+
]);
|
|
199
|
+
var timestampTypes = /* @__PURE__ */ new Set(["DATETIME_IMMUTABLE", "DATETIMETZ_IMMUTABLE"]);
|
|
200
|
+
var IMPORTED_NAMES = [
|
|
201
|
+
"ArrayCollection",
|
|
202
|
+
"Collection",
|
|
203
|
+
"ORM",
|
|
204
|
+
"Types"
|
|
205
|
+
];
|
|
206
|
+
var USE_COLLECTIONS = ["use Doctrine\\Common\\Collections\\ArrayCollection;", "use Doctrine\\Common\\Collections\\Collection;"];
|
|
207
|
+
var USE_TYPES = "use Doctrine\\DBAL\\Types\\Types;";
|
|
208
|
+
var USE_ORM = "use Doctrine\\ORM\\Mapping as ORM;";
|
|
209
|
+
var LINE_LIMIT = 120;
|
|
210
|
+
var OWNING = "owning";
|
|
211
|
+
var INVERSE = "inverse";
|
|
212
|
+
function createCode(state) {
|
|
213
|
+
const { doc: { tableIds }, collections } = state;
|
|
214
|
+
const tables = query(collections).collection("tableEntities").selectByIds(tableIds).sort(orderByNameASC);
|
|
215
|
+
if (tables.length === 0) return "";
|
|
216
|
+
const context = createClassContext(state);
|
|
217
|
+
const uses = {
|
|
218
|
+
collections: false,
|
|
219
|
+
types: false
|
|
220
|
+
};
|
|
221
|
+
const classBuffer = [];
|
|
222
|
+
tables.forEach((table) => {
|
|
223
|
+
classBuffer.push("");
|
|
224
|
+
formatClass(state, {
|
|
225
|
+
buffer: classBuffer,
|
|
226
|
+
table
|
|
227
|
+
}, context, uses);
|
|
228
|
+
});
|
|
229
|
+
return joinFile(uses, classBuffer);
|
|
230
|
+
}
|
|
231
|
+
function createTableCode(state, table) {
|
|
232
|
+
const uses = {
|
|
233
|
+
collections: false,
|
|
234
|
+
types: false
|
|
235
|
+
};
|
|
236
|
+
const classBuffer = [""];
|
|
237
|
+
formatClass(state, {
|
|
238
|
+
buffer: classBuffer,
|
|
239
|
+
table
|
|
240
|
+
}, createClassContext(state), uses);
|
|
241
|
+
return joinFile(uses, classBuffer);
|
|
242
|
+
}
|
|
243
|
+
function joinFile(uses, classBuffer) {
|
|
244
|
+
return [
|
|
245
|
+
...PHP_HEADER,
|
|
246
|
+
"",
|
|
247
|
+
...uses.collections ? USE_COLLECTIONS : [],
|
|
248
|
+
...uses.types ? [USE_TYPES] : [],
|
|
249
|
+
USE_ORM,
|
|
250
|
+
...classBuffer,
|
|
251
|
+
""
|
|
252
|
+
].join("\n");
|
|
253
|
+
}
|
|
254
|
+
function formatClass(state, { buffer, table }, context, uses) {
|
|
255
|
+
const naming = getNaming(state, context, table);
|
|
256
|
+
const columns = query(state.collections).collection("tableColumnEntities").selectByIds(table.columnIds);
|
|
257
|
+
const fieldIds = new Set(naming.fields.map((column) => column.id));
|
|
258
|
+
const quotedIds = quotedColumnIds(state, naming.owning);
|
|
259
|
+
const identifierCount = naming.fields.filter(isPrimaryKey).length + naming.owning.filter(({ relationship }) => context.derivedIds.has(relationship.id)).length;
|
|
260
|
+
const uniqueColumnIds = /* @__PURE__ */ new Set();
|
|
261
|
+
const members = [];
|
|
262
|
+
const collectionNames = [];
|
|
263
|
+
columns.forEach((column) => {
|
|
264
|
+
if (fieldIds.has(column.id)) {
|
|
265
|
+
uses.types = true;
|
|
266
|
+
members.push(columnMember(state, naming, column, identifierCount === 1, quotedIds));
|
|
267
|
+
}
|
|
268
|
+
naming.owning.filter((resolved) => firstJoinColumnId(columns, resolved) === column.id).forEach((resolved) => {
|
|
269
|
+
members.push(owningMember(state, context, naming, resolved, uniqueColumnIds, quotedIds));
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
context.relationships.filter(({ relationship }) => relationship.start.tableId === table.id).forEach(({ relationship, endTable }) => {
|
|
273
|
+
const name = relationshipName(naming, relationship, INVERSE);
|
|
274
|
+
const childNaming = getNaming(state, context, endTable);
|
|
275
|
+
const target = childNaming.className;
|
|
276
|
+
const mappedBy = phpString(relationshipName(childNaming, relationship, OWNING));
|
|
277
|
+
if (context.oneToOneIds.has(relationship.id)) {
|
|
278
|
+
members.push([...formatAttribute(INDENT, "OneToOne", [`targetEntity: ${target}::class`, `mappedBy: ${mappedBy}`]), propertyLine(target, name, true)]);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
collectionNames.push(name);
|
|
282
|
+
members.push([
|
|
283
|
+
`${INDENT}/** @var Collection<int, ${target}> */`,
|
|
284
|
+
...formatAttribute(INDENT, "OneToMany", [`targetEntity: ${target}::class`, `mappedBy: ${mappedBy}`]),
|
|
285
|
+
`${INDENT}public Collection $${name};`
|
|
286
|
+
]);
|
|
287
|
+
});
|
|
288
|
+
if (collectionNames.length !== 0) {
|
|
289
|
+
uses.collections = true;
|
|
290
|
+
members.push([
|
|
291
|
+
`${INDENT}public function __construct()`,
|
|
292
|
+
`${INDENT}{`,
|
|
293
|
+
...collectionNames.map((name) => `${INDENT}${INDENT}$this->${name} = new ArrayCollection();`),
|
|
294
|
+
`${INDENT}}`
|
|
295
|
+
]);
|
|
296
|
+
}
|
|
297
|
+
[
|
|
298
|
+
"#[ORM\\Entity]",
|
|
299
|
+
...formatAttribute("", "Table", [...tableNameArguments(state, table.name), ...optionsArgument(commentEntry(table.comment))]),
|
|
300
|
+
...indexAttributes(state, context, table, quotedIds)
|
|
301
|
+
].forEach((line) => buffer.push(line));
|
|
302
|
+
if (members.length === 0) {
|
|
303
|
+
buffer.push(`class ${naming.className} {}`);
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
buffer.push(`class ${naming.className}`);
|
|
307
|
+
buffer.push("{");
|
|
308
|
+
members.forEach((lines, index) => {
|
|
309
|
+
if (index !== 0) buffer.push("");
|
|
310
|
+
lines.forEach((line) => buffer.push(line));
|
|
311
|
+
});
|
|
312
|
+
buffer.push("}");
|
|
313
|
+
}
|
|
314
|
+
function columnMember(state, naming, column, isSingleIdentifier, quotedIds) {
|
|
315
|
+
const { database } = state.settings;
|
|
316
|
+
const isPrimary = isPrimaryKey(column);
|
|
317
|
+
const columnType = getColumnType(column.dataType, database, isPrimary);
|
|
318
|
+
const { type, php, args, options, definition, isReadOnly } = columnType;
|
|
319
|
+
const isGenerated = isPrimary && isSingleIdentifier && integerTypes.has(type) && (bHas(column.options, ColumnOption.autoIncrement) || serialTypes.has(baseTypeName(column.dataType)));
|
|
320
|
+
const isNullable = !isReadOnly && !isRequired(column);
|
|
321
|
+
const isUnset = isNullable || isGenerated || isReadOnly;
|
|
322
|
+
return [
|
|
323
|
+
...isPrimary ? [`${INDENT}#[ORM\\Id]`] : [],
|
|
324
|
+
...isGenerated ? [`${INDENT}#[ORM\\GeneratedValue]`] : [],
|
|
325
|
+
...formatAttribute(INDENT, "Column", [
|
|
326
|
+
`name: ${phpString(sqlText(columnSqlName(state, column, quotedIds)))}`,
|
|
327
|
+
`type: Types::${type}`,
|
|
328
|
+
...args,
|
|
329
|
+
...!isPrimary && bHas(column.options, ColumnOption.unique) ? ["unique: true"] : [],
|
|
330
|
+
...isNullable ? ["nullable: true"] : [],
|
|
331
|
+
...isReadOnly ? ["insertable: false", "updatable: false"] : [],
|
|
332
|
+
...optionsArgument([
|
|
333
|
+
...options,
|
|
334
|
+
...defaultEntry(database, column.default, columnType, isGenerated),
|
|
335
|
+
...commentEntry(column.comment)
|
|
336
|
+
]),
|
|
337
|
+
...definitionArgument(database, column, definition, isNullable),
|
|
338
|
+
...isReadOnly ? ["generated: 'ALWAYS'"] : []
|
|
339
|
+
]),
|
|
340
|
+
propertyLine(php, naming.propertyNames.get(column.id), isUnset)
|
|
341
|
+
];
|
|
342
|
+
}
|
|
343
|
+
function owningMember(state, context, naming, { relationship, startTable, startColumns, endColumns }, uniqueColumnIds, quotedIds) {
|
|
344
|
+
const { database } = state.settings;
|
|
345
|
+
const parentNaming = getNaming(state, context, startTable);
|
|
346
|
+
const isDerived = context.derivedIds.has(relationship.id);
|
|
347
|
+
const isOneToOne = context.oneToOneIds.has(relationship.id);
|
|
348
|
+
const onDelete = referentialActionEntries(relationship, referentialActionSupport(database)).filter(({ key }) => key === "onDelete").map(({ sql }) => `onDelete: ${phpString(sql)}`);
|
|
349
|
+
const joinColumns = endColumns.flatMap((column, index) => {
|
|
350
|
+
const parent = startColumns[index];
|
|
351
|
+
const isCarried = isDerived || !isPrimaryKey(column);
|
|
352
|
+
const isUnique = !isPrimaryKey(column) && bHas(column.options, ColumnOption.unique) && !(isOneToOne && endColumns.length === 1) && !uniqueColumnIds.has(column.id);
|
|
353
|
+
const parentType = getColumnType(parent.dataType, database, isPrimaryKey(parent));
|
|
354
|
+
if (isUnique) uniqueColumnIds.add(column.id);
|
|
355
|
+
return formatAttribute(INDENT, "JoinColumn", [
|
|
356
|
+
...joinColumnNames(state, column, parent, quotedIds.has(column.id)),
|
|
357
|
+
...isUnique ? ["unique: true"] : [],
|
|
358
|
+
...isRequired(column) ? ["nullable: false"] : [],
|
|
359
|
+
...onDelete,
|
|
360
|
+
...isCarried ? definitionArgument(database, column, parentType.definition, !isRequired(column)) : [],
|
|
361
|
+
...optionsArgument(isCarried ? carriedOptions(database, column, parent, parentType) : [])
|
|
362
|
+
]);
|
|
363
|
+
});
|
|
364
|
+
return [
|
|
365
|
+
...isDerived ? [`${INDENT}#[ORM\\Id]`] : [],
|
|
366
|
+
...formatAttribute(INDENT, isOneToOne ? "OneToOne" : "ManyToOne", [`targetEntity: ${parentNaming.className}::class`, `inversedBy: ${phpString(relationshipName(parentNaming, relationship, INVERSE))}`]),
|
|
367
|
+
...joinColumns,
|
|
368
|
+
propertyLine(parentNaming.className, relationshipName(naming, relationship, OWNING), !endColumns.every(isRequired))
|
|
369
|
+
];
|
|
370
|
+
}
|
|
371
|
+
function carriedOptions(database, column, parent, parentType) {
|
|
372
|
+
const ownDefault = defaultEntry(database, column.default, parentType, false);
|
|
373
|
+
const parentDefault = defaultEntry(database, parent.default, parentType, false);
|
|
374
|
+
return [...ownDefault.length === 0 && parentDefault.length !== 0 ? ["'default' => null"] : ownDefault, ...column.comment.trim() === "" && parent.comment.trim() !== "" ? ["'comment' => ''"] : commentEntry(column.comment)];
|
|
375
|
+
}
|
|
376
|
+
function firstJoinColumnId(columns, { endColumns }) {
|
|
377
|
+
return columns.find((column) => endColumns.some((end) => end.id === column.id))?.id;
|
|
378
|
+
}
|
|
379
|
+
function joinColumnNames(state, column, parent, isQuoted) {
|
|
380
|
+
return [`name: ${phpString(sqlText({
|
|
381
|
+
...sqlName(state, column.name),
|
|
382
|
+
isQuoted
|
|
383
|
+
}))}`, `referencedColumnName: ${phpString(sqlText({
|
|
384
|
+
...sqlName(state, parent.name),
|
|
385
|
+
isQuoted
|
|
386
|
+
}))}`];
|
|
387
|
+
}
|
|
388
|
+
function quotedColumnIds(state, owning) {
|
|
389
|
+
return new Set(owning.flatMap(({ startColumns, endColumns }) => endColumns.filter((column, index) => sqlName(state, column.name).isQuoted || sqlName(state, startColumns[index].name).isQuoted).map((column) => column.id)));
|
|
390
|
+
}
|
|
391
|
+
function columnSqlName(state, column, quotedIds) {
|
|
392
|
+
const name = sqlName(state, column.name);
|
|
393
|
+
return quotedIds.has(column.id) ? {
|
|
394
|
+
...name,
|
|
395
|
+
isQuoted: true
|
|
396
|
+
} : name;
|
|
397
|
+
}
|
|
398
|
+
function indexAttributes(state, { indexNames }, table, quotedIds) {
|
|
399
|
+
const { doc: { indexIds }, collections } = state;
|
|
400
|
+
const columnCollection = query(collections).collection("tableColumnEntities");
|
|
401
|
+
const indexColumnCollection = query(collections).collection("indexColumnEntities");
|
|
402
|
+
const unnamed = /* @__PURE__ */ new Set();
|
|
403
|
+
const names = /* @__PURE__ */ new Set(["primary"]);
|
|
404
|
+
return query(collections).collection("indexEntities").selectByIds(indexIds).filter((index) => index.tableId === table.id).flatMap((index) => {
|
|
405
|
+
const columns = indexColumnCollection.selectByIds(index.indexColumnIds).map((indexColumn) => columnCollection.selectById(indexColumn.columnId)).filter((column) => column !== void 0 && table.columnIds.includes(column.id));
|
|
406
|
+
const written = indexName(indexNames.get(index.id) ?? index.name);
|
|
407
|
+
const name = written === null || names.has(written.toLowerCase()) ? null : written;
|
|
408
|
+
const key = `${index.unique}:${columns.map(({ id }) => id).join(",")}`;
|
|
409
|
+
if (columns.length === 0 || name === null && unnamed.has(key)) return [];
|
|
410
|
+
if (name === null) unnamed.add(key);
|
|
411
|
+
else names.add(name.toLowerCase());
|
|
412
|
+
return formatAttribute("", index.unique ? "UniqueConstraint" : "Index", [...name === null ? [] : [`name: ${phpString(name)}`], `columns: [${columns.map((column) => phpString(sqlText(columnSqlName(state, column, quotedIds)))).join(", ")}]`]);
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
var INDEX_NAME = /^[0-9A-Za-z_]+$/;
|
|
416
|
+
var NUMERIC_NAME = /^[0-9]+([Ee][0-9]+)?$/;
|
|
417
|
+
var BACKTICKED = /^`((?:[^`]|``)*)`$/;
|
|
418
|
+
function indexName(name) {
|
|
419
|
+
const text = name.trim();
|
|
420
|
+
const value = backtickedName(text) ?? unquoteNamePart(text);
|
|
421
|
+
return INDEX_NAME.test(value) && !NUMERIC_NAME.test(value) ? value : null;
|
|
422
|
+
}
|
|
423
|
+
function backtickedName(text) {
|
|
424
|
+
const matched = BACKTICKED.exec(text);
|
|
425
|
+
return matched ? matched[1].replaceAll("``", "`") : null;
|
|
426
|
+
}
|
|
427
|
+
function propertyLine(type, name, isNullable) {
|
|
428
|
+
return isNullable ? `${INDENT}public ${nullableType(type)} $${name} = null;` : `${INDENT}public ${type} $${name};`;
|
|
429
|
+
}
|
|
430
|
+
function nullableType(type) {
|
|
431
|
+
if (type === "mixed") return type;
|
|
432
|
+
return type.includes("|") ? `${type}|null` : `?${type}`;
|
|
433
|
+
}
|
|
434
|
+
function isRequired(column) {
|
|
435
|
+
return isPrimaryKey(column) || bHas(column.options, ColumnOption.notNull);
|
|
436
|
+
}
|
|
437
|
+
function definitionArgument(database, column, definition, isNullable) {
|
|
438
|
+
if (definition === null) return [];
|
|
439
|
+
const isOracleKey = database === Database.Oracle && isPrimaryKey(column) && (baseTypeName(definition) !== "date" || column.default.trim() !== "");
|
|
440
|
+
const text = isNullable || isOracleKey ? definition : `${definition} NOT NULL`;
|
|
441
|
+
return [`columnDefinition: ${phpString(isMySQLFamily(database) && column.comment.trim() !== "" ? `${text} COMMENT ${mysqlString(column.comment)}` : text)}`];
|
|
442
|
+
}
|
|
443
|
+
function mysqlString(value) {
|
|
444
|
+
return `'${value.replaceAll("\\", "\\\\").replaceAll("'", "''")}'`;
|
|
445
|
+
}
|
|
446
|
+
function isMySQLFamily(database) {
|
|
447
|
+
return database === Database.MySQL || database === Database.MariaDB;
|
|
448
|
+
}
|
|
449
|
+
function commentEntry(comment) {
|
|
450
|
+
return comment.trim() === "" ? [] : [`'comment' => ${phpString(comment)}`];
|
|
451
|
+
}
|
|
452
|
+
function optionsArgument(entries) {
|
|
453
|
+
return entries.length === 0 ? [] : [`options: [${entries.join(", ")}]`];
|
|
454
|
+
}
|
|
455
|
+
function formatAttribute(indent, name, args) {
|
|
456
|
+
const line = `${indent}#[ORM\\${name}(${args.join(", ")})]`;
|
|
457
|
+
if (line.length <= LINE_LIMIT || args.length < 2) return [line];
|
|
458
|
+
return [
|
|
459
|
+
`${indent}#[ORM\\${name}(`,
|
|
460
|
+
...args.map((arg) => `${indent}${INDENT}${arg},`),
|
|
461
|
+
`${indent})]`
|
|
462
|
+
];
|
|
463
|
+
}
|
|
464
|
+
var NUMBER_LITERAL = /^([+-]?)([0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[Ee]([+-]?[0-9]+))?$/;
|
|
465
|
+
var LEADING_ZEROS = /^0+(?=[0-9])/;
|
|
466
|
+
var TRAILING_ZEROS = /0+$/;
|
|
467
|
+
var MYSQL_STRING = /^(?:[Nn]|_[0-9A-Za-z]+\s*)?'((?:[^'\\]|''|\\[\s\S])*)'$/;
|
|
468
|
+
var MYSQL_ESCAPE = /''|\\([\s\S])/g;
|
|
469
|
+
var STRING_LITERAL = /^([Nn]?)'((?:[^']|'')*)'$/;
|
|
470
|
+
var PRINTABLE_ASCII = /^[ -~]*$/;
|
|
471
|
+
var BOOLEAN_LITERAL = /^(true|false)$/i;
|
|
472
|
+
var POSTGRES_TRUE = /^(t|true|y|yes|on|1)$/i;
|
|
473
|
+
var POSTGRES_FALSE = /^(f|false|n|no|off|0)$/i;
|
|
474
|
+
var CURRENT_TIMESTAMP = /^current_timestamp(\(\s*\))?$/i;
|
|
475
|
+
var MYSQL_NOW = /^(current_timestamp|now|localtime|localtimestamp)(\(\s*\))?$/i;
|
|
476
|
+
var PHP_INT_MAX = 9223372036854775807n;
|
|
477
|
+
var mysqlEscapes = /* @__PURE__ */ new Map([
|
|
478
|
+
["0", String.fromCharCode(0)],
|
|
479
|
+
["b", "\b"],
|
|
480
|
+
["n", "\n"],
|
|
481
|
+
["r", "\r"],
|
|
482
|
+
["t", " "],
|
|
483
|
+
["Z", String.fromCharCode(26)]
|
|
484
|
+
]);
|
|
485
|
+
var currentTimes = /* @__PURE__ */ new Map([
|
|
486
|
+
[Database.MariaDB, MYSQL_NOW],
|
|
487
|
+
[Database.MSSQL, /^(current_timestamp|getdate\(\s*\))$/i],
|
|
488
|
+
[Database.MySQL, MYSQL_NOW],
|
|
489
|
+
[Database.PostgreSQL, /^(current_timestamp|localtimestamp|(now|transaction_timestamp)\(\s*\))$/i]
|
|
490
|
+
]);
|
|
491
|
+
function defaultEntry(database, value, columnType, isGenerated) {
|
|
492
|
+
const text = value.trim();
|
|
493
|
+
if (text === "" || isGenerated || columnType.definition !== null) return [];
|
|
494
|
+
const literal = stringLiteral(database, text);
|
|
495
|
+
const entry = literal === null ? bareDefault(database, text, columnType) : literalDefault(database, literal, columnType);
|
|
496
|
+
return entry === null ? [] : [`'default' => ${entry}`];
|
|
497
|
+
}
|
|
498
|
+
function literalDefault(database, literal, columnType) {
|
|
499
|
+
const { type } = columnType;
|
|
500
|
+
if (type === "BOOLEAN") return booleanDefault(database, literal.trim());
|
|
501
|
+
if (NUMBER_LITERAL.test(literal) && isNumberType(type)) return numberDefault(database, literal, columnType);
|
|
502
|
+
if (type === "JSON" && database === Database.MySQL) return null;
|
|
503
|
+
return phpString(literal);
|
|
504
|
+
}
|
|
505
|
+
function bareDefault(database, text, columnType) {
|
|
506
|
+
const { type } = columnType;
|
|
507
|
+
if (NUMBER_LITERAL.test(text)) return isNumberType(type) ? numberDefault(database, text, columnType) : phpString(numberText(database, text));
|
|
508
|
+
if (BOOLEAN_LITERAL.test(text)) {
|
|
509
|
+
if (integerTypes.has(type) && (isMySQLFamily(database) || database === Database.SQLite)) return text.toLowerCase() === "true" ? "1" : "0";
|
|
510
|
+
return type === "BOOLEAN" ? text.toLowerCase() : null;
|
|
511
|
+
}
|
|
512
|
+
if (timestampTypes.has(type) && (currentTimes.get(database) ?? CURRENT_TIMESTAMP).test(text)) return "'CURRENT_TIMESTAMP'";
|
|
513
|
+
return null;
|
|
514
|
+
}
|
|
515
|
+
function booleanDefault(database, text) {
|
|
516
|
+
if (database === Database.PostgreSQL) {
|
|
517
|
+
if (POSTGRES_TRUE.test(text)) return "true";
|
|
518
|
+
return POSTGRES_FALSE.test(text) ? "false" : null;
|
|
519
|
+
}
|
|
520
|
+
if (BOOLEAN_LITERAL.test(text)) return text.toLowerCase();
|
|
521
|
+
const number = NUMBER_LITERAL.test(text) ? canonicalNumber(text) : null;
|
|
522
|
+
return number === "0" || number === "1" ? number : null;
|
|
523
|
+
}
|
|
524
|
+
function isNumberType(type) {
|
|
525
|
+
return integerTypes.has(type) || type === "BOOLEAN" || type === "DECIMAL" || type === "FLOAT" || type === "SMALLFLOAT";
|
|
526
|
+
}
|
|
527
|
+
function numberDefault(database, text, { type, scale }) {
|
|
528
|
+
if (type === "BOOLEAN") return booleanDefault(database, text);
|
|
529
|
+
const isMySQL = isMySQLFamily(database);
|
|
530
|
+
if (integerTypes.has(type)) {
|
|
531
|
+
const value = isMySQL ? decimalAtScale(canonicalNumber(text), 0) : numberText(database, text);
|
|
532
|
+
return value === canonicalNumber(value) && !value.includes(".") && BigInt(value.replace("-", "")) <= PHP_INT_MAX ? value : phpString(value);
|
|
533
|
+
}
|
|
534
|
+
if (isMySQL && scale !== null) return phpString(decimalAtScale(canonicalNumber(text), scale));
|
|
535
|
+
return phpString(numberText(database, text));
|
|
536
|
+
}
|
|
537
|
+
function numberText(database, text) {
|
|
538
|
+
return database === Database.Oracle || database === Database.SQLite ? text : canonicalNumber(text);
|
|
539
|
+
}
|
|
540
|
+
function canonicalNumber(text) {
|
|
541
|
+
const [, sign, mantissa, exponent = "0"] = NUMBER_LITERAL.exec(text);
|
|
542
|
+
const [whole, fraction = ""] = mantissa.split(".");
|
|
543
|
+
const digits = `${whole}${fraction}`;
|
|
544
|
+
const point = whole.length + Number(exponent);
|
|
545
|
+
const padded = point < 0 ? `${"0".repeat(-point)}${digits}` : digits.padEnd(point, "0");
|
|
546
|
+
const at = Math.max(point, 0);
|
|
547
|
+
const integer = (padded.slice(0, at) || "0").replace(LEADING_ZEROS, "");
|
|
548
|
+
const decimals = padded.slice(at).replace(TRAILING_ZEROS, "");
|
|
549
|
+
const value = decimals === "" ? integer : `${integer}.${decimals}`;
|
|
550
|
+
return value === "0" || sign !== "-" ? value : `-${value}`;
|
|
551
|
+
}
|
|
552
|
+
function decimalAtScale(number, scale) {
|
|
553
|
+
const [whole, fraction = ""] = number.replace("-", "").split(".");
|
|
554
|
+
const digits = BigInt(`${whole}${fraction.slice(0, scale).padEnd(scale, "0")}`) + (fraction.charAt(scale) >= "5" ? 1n : 0n);
|
|
555
|
+
const text = digits.toString().padStart(scale + 1, "0");
|
|
556
|
+
const value = scale === 0 ? text : `${text.slice(0, -scale)}.${text.slice(-scale)}`;
|
|
557
|
+
return number.startsWith("-") && digits !== 0n ? `-${value}` : value;
|
|
558
|
+
}
|
|
559
|
+
function stringLiteral(database, text) {
|
|
560
|
+
if (isMySQLFamily(database)) {
|
|
561
|
+
const matched = MYSQL_STRING.exec(text);
|
|
562
|
+
return matched ? unescapeMySQL(matched[1]) : null;
|
|
563
|
+
}
|
|
564
|
+
const matched = STRING_LITERAL.exec(text);
|
|
565
|
+
if (!matched) return null;
|
|
566
|
+
const [, prefix, body] = matched;
|
|
567
|
+
const value = body.replaceAll("''", "'");
|
|
568
|
+
return database === Database.MSSQL && prefix !== "" && !PRINTABLE_ASCII.test(value) ? null : value;
|
|
569
|
+
}
|
|
570
|
+
function unescapeMySQL(body) {
|
|
571
|
+
return body.replace(MYSQL_ESCAPE, (escape, char) => {
|
|
572
|
+
if (char === void 0) return "'";
|
|
573
|
+
return char === "%" || char === "_" ? escape : mysqlEscapes.get(char) ?? char;
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
var ASCII_IDENTIFIER = /^[A-Za-z_][0-9A-Za-z_]*$/;
|
|
577
|
+
var ASCII_CAPITALS = /[A-Z]+/g;
|
|
578
|
+
function quotesNames({ settings: { bracketType } }) {
|
|
579
|
+
return bracketType !== BracketType.none;
|
|
580
|
+
}
|
|
581
|
+
function needsQuotes(name) {
|
|
582
|
+
return !ASCII_IDENTIFIER.test(name) || DOCTRINE_RESERVED_WORDS.has(name.toLowerCase());
|
|
583
|
+
}
|
|
584
|
+
function foldName(database, name) {
|
|
585
|
+
if (database === Database.Oracle) return Array.from(name, oracleCapital).join("");
|
|
586
|
+
if (database === Database.PostgreSQL) return name.replace(ASCII_CAPITALS, (letters) => letters.toLowerCase());
|
|
587
|
+
return name;
|
|
588
|
+
}
|
|
589
|
+
function oracleCapital(char) {
|
|
590
|
+
const upper = char.toUpperCase();
|
|
591
|
+
const code = char.codePointAt(0);
|
|
592
|
+
if (Array.from(upper).length === 1) return upper;
|
|
593
|
+
if (code >= 8064 && code <= 8103 && (code & 15) < 8) return String.fromCodePoint(code + 8);
|
|
594
|
+
return code === 8115 || code === 8131 || code === 8179 ? String.fromCodePoint(code + 9) : char;
|
|
595
|
+
}
|
|
596
|
+
function sqlName(state, name) {
|
|
597
|
+
if (quotesNames(state)) return {
|
|
598
|
+
text: name,
|
|
599
|
+
isQuoted: true
|
|
600
|
+
};
|
|
601
|
+
if (isDelimitedPart(name)) return {
|
|
602
|
+
text: unquoteNamePart(name),
|
|
603
|
+
isQuoted: true
|
|
604
|
+
};
|
|
605
|
+
const text = foldName(state.settings.database, name);
|
|
606
|
+
return {
|
|
607
|
+
text,
|
|
608
|
+
isQuoted: needsQuotes(text)
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
function sqlText({ text, isQuoted }) {
|
|
612
|
+
return isQuoted ? `\`${text}\`` : text;
|
|
613
|
+
}
|
|
614
|
+
var BACKTICK_DATABASES = /* @__PURE__ */ new Set([
|
|
615
|
+
Database.Databricks,
|
|
616
|
+
Database.MariaDB,
|
|
617
|
+
Database.MySQL,
|
|
618
|
+
Database.SQLite
|
|
619
|
+
]);
|
|
620
|
+
function tableNameArguments(state, name) {
|
|
621
|
+
const { database } = state.settings;
|
|
622
|
+
if (quotesNames(state) && !name.includes(".")) return [`name: ${phpString(sqlText({
|
|
623
|
+
text: name,
|
|
624
|
+
isQuoted: true
|
|
625
|
+
}))}`];
|
|
626
|
+
const parts = splitNameParts(name).slice(-2).map((part) => {
|
|
627
|
+
const backticked = BACKTICK_DATABASES.has(database) ? backtickedName(part) : null;
|
|
628
|
+
if (backticked !== null) return {
|
|
629
|
+
text: backticked,
|
|
630
|
+
isQuoted: true
|
|
631
|
+
};
|
|
632
|
+
if (isDelimitedPart(part)) return {
|
|
633
|
+
text: unquoteNamePart(part),
|
|
634
|
+
isQuoted: true
|
|
635
|
+
};
|
|
636
|
+
return sqlName(state, part);
|
|
637
|
+
});
|
|
638
|
+
const table = parts[parts.length - 1];
|
|
639
|
+
return [`name: ${phpString(sqlText({
|
|
640
|
+
...table,
|
|
641
|
+
isQuoted: parts.some((part) => part.isQuoted)
|
|
642
|
+
}))}`, ...parts.length === 1 ? [] : [`schema: ${phpString(parts[0].text)}`]];
|
|
643
|
+
}
|
|
644
|
+
var TYPE_ARGUMENTS = /\(\s*([^)]*)\)/;
|
|
645
|
+
var DIGITS = /^[0-9]+$/;
|
|
646
|
+
var LENGTH = /^([0-9]+)(?:\s+(?:byte|char))?$/i;
|
|
647
|
+
var MAX_ARGUMENT = /\(\s*max\s*\)/i;
|
|
648
|
+
var UNSIGNED = /(^|[^0-9a-z_])unsigned([^0-9a-z_]|$)/;
|
|
649
|
+
var ZEROFILL = /(^|[^0-9a-z_])zerofill([^0-9a-z_]|$)/;
|
|
650
|
+
var SPACES = /\s+/g;
|
|
651
|
+
var DEFAULT_DECIMAL = [10, 0];
|
|
652
|
+
var moneyDecimals = /* @__PURE__ */ new Map([["money", [19, 2]], ["smallmoney", [10, 4]]]);
|
|
653
|
+
var MSSQL_MONEY = [19, 4];
|
|
654
|
+
var MSSQL_DECIMAL = [18, 0];
|
|
655
|
+
var FIXED = "'fixed' => true";
|
|
656
|
+
var UTF8MB3 = "'charset' => 'utf8mb3'";
|
|
657
|
+
var JSONB = "'jsonb' => true";
|
|
658
|
+
var UNSIGNED_OPTION = "'unsigned' => true";
|
|
659
|
+
function createColumnType(type, rest = {}) {
|
|
660
|
+
return {
|
|
661
|
+
type,
|
|
662
|
+
php: PHP_TYPES[type],
|
|
663
|
+
args: [],
|
|
664
|
+
options: [],
|
|
665
|
+
definition: null,
|
|
666
|
+
isReadOnly: false,
|
|
667
|
+
scale: null,
|
|
668
|
+
...rest
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
function getColumnType(dataType, database, isKey) {
|
|
672
|
+
const isMySQL = isMySQLFamily(database);
|
|
673
|
+
const typeName = baseTypeName(dataType);
|
|
674
|
+
const isUnsigned = isMySQL && (UNSIGNED.test(typeName) || ZEROFILL.test(typeName) || typeName === "serial");
|
|
675
|
+
const resolved = resolveColumnType(dataType, isMySQL ? typeName.replace(UNSIGNED, "$1$2").replace(ZEROFILL, "$1$2").replace(SPACES, " ").trim() : typeName, database, isKey);
|
|
676
|
+
if (!isUnsigned || !unsignedTypes.has(resolved.type) || resolved.definition !== null) return resolved;
|
|
677
|
+
return {
|
|
678
|
+
...resolved,
|
|
679
|
+
options: [...resolved.options, UNSIGNED_OPTION],
|
|
680
|
+
php: resolved.type === "BIGINT" ? "int|string" : resolved.php
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
function resolveColumnType(dataType, base, database, isKey) {
|
|
684
|
+
const isMySQL = isMySQLFamily(database);
|
|
685
|
+
const args = typeArguments(dataType);
|
|
686
|
+
if (database === Database.MSSQL && rowVersionTypes.has(base)) return createColumnType("BINARY", {
|
|
687
|
+
args: ["length: 8"],
|
|
688
|
+
definition: "ROWVERSION",
|
|
689
|
+
isReadOnly: true
|
|
690
|
+
});
|
|
691
|
+
if (isPostgresArray(dataType, database) || database === Database.PostgreSQL && (POSTGRES_BIT_TYPES.has(base) || base === "pg_lsn")) return createColumnType("TEXT", { definition: dataType.trim() });
|
|
692
|
+
if (isMySQL && base === "enum") {
|
|
693
|
+
const members = enumMembers(dataType);
|
|
694
|
+
if (members) return createColumnType("ENUM", { options: [`'values' => [${members.map(phpString).join(", ")}]`] });
|
|
695
|
+
}
|
|
696
|
+
if (isMySQL && base === "set") return createColumnType("SIMPLE_ARRAY");
|
|
697
|
+
const fraction = fractionalNumber(dataType, database);
|
|
698
|
+
if (fraction) return createColumnType("DECIMAL", {
|
|
699
|
+
args: [`precision: ${fraction[0]}`, `scale: ${fraction[1]}`],
|
|
700
|
+
scale: fraction[1]
|
|
701
|
+
});
|
|
702
|
+
if (database === Database.Oracle && oracleNumberTypes.has(base)) {
|
|
703
|
+
if (args.length === 1 || args.length === 2 && args[1] === 0) return createColumnType(oracleIntegerType(args[0]));
|
|
704
|
+
if (base !== "number" && args.length === 0) return createColumnType("INTEGER");
|
|
705
|
+
}
|
|
706
|
+
if (database === Database.MSSQL && (unicodeTextTypes.has(base) || nationalTypes.has(base) && MAX_ARGUMENT.test(dataType))) return createColumnType("STRING", {
|
|
707
|
+
args: ["length: -1"],
|
|
708
|
+
definition: "NVARCHAR(MAX)"
|
|
709
|
+
});
|
|
710
|
+
const type = vendorTypes.get(database)?.get(base) ?? namedTypes.get(base) ?? (isSmallFloat(base, database, args) ? "SMALLFLOAT" : void 0) ?? convertTypeMap[getPrimitiveType(dataType, database)];
|
|
711
|
+
if (isKey && PHP_TYPES[type] === "\\DateTimeImmutable") return createColumnType("STRING", {
|
|
712
|
+
args: ["length: 255"],
|
|
713
|
+
definition: dataType.trim()
|
|
714
|
+
});
|
|
715
|
+
if (isKey && type === "BLOB" && (database === Database.PostgreSQL || database === Database.SQLite)) return createColumnType("BINARY");
|
|
716
|
+
if (type === "STRING" || type === "BINARY") {
|
|
717
|
+
const resolved = lengthType(type, base, dataType, database);
|
|
718
|
+
return isKey && resolved.type === "STRING" && resolved.args.length === 0 ? {
|
|
719
|
+
...resolved,
|
|
720
|
+
args: ["length: 255"]
|
|
721
|
+
} : resolved;
|
|
722
|
+
}
|
|
723
|
+
if (isMySQL && (type === "TEXT" || type === "BLOB")) {
|
|
724
|
+
const length = mysqlLobLength(base, database, args);
|
|
725
|
+
return createColumnType(type, { args: length === void 0 ? [] : [`length: ${length}`] });
|
|
726
|
+
}
|
|
727
|
+
if (type === "DECIMAL" && args.length === 1) return createColumnType(type, {
|
|
728
|
+
args: [`precision: ${args[0]}`],
|
|
729
|
+
scale: 0
|
|
730
|
+
});
|
|
731
|
+
if (type === "DECIMAL") {
|
|
732
|
+
const [precision, scale] = decimalDigits(base, database, args);
|
|
733
|
+
return createColumnType(type, {
|
|
734
|
+
args: [`precision: ${precision}`, `scale: ${scale}`],
|
|
735
|
+
scale
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
if (type === "JSON" && base === "jsonb") return createColumnType(type, { options: [JSONB] });
|
|
739
|
+
if (isMySQL && (type === "FLOAT" || type === "SMALLFLOAT") && args.length === 2) return createColumnType(type, { scale: args[1] });
|
|
740
|
+
return createColumnType(type);
|
|
741
|
+
}
|
|
742
|
+
function mysqlLobLength(base, database, args) {
|
|
743
|
+
if (args.length !== 1 || base !== "text" && base !== "blob") return mysqlLobLengths.get(base);
|
|
744
|
+
if (args[0] === 0) return database === Database.MariaDB ? mysqlLobLengths.get(base) : 255;
|
|
745
|
+
if (base === "text") return MYSQL_TEXT_BYTES.find((bytes) => args[0] * 4 <= bytes);
|
|
746
|
+
return args[0];
|
|
747
|
+
}
|
|
748
|
+
function decimalDigits(base, database, args) {
|
|
749
|
+
if (args.length === 2) return args;
|
|
750
|
+
if (base === "money" && database === Database.MSSQL) return MSSQL_MONEY;
|
|
751
|
+
return moneyDecimals.get(base) ?? (database === Database.MSSQL ? MSSQL_DECIMAL : DEFAULT_DECIMAL);
|
|
752
|
+
}
|
|
753
|
+
function oracleIntegerType(precision) {
|
|
754
|
+
if (precision === 5) return "SMALLINT";
|
|
755
|
+
return precision <= 10 ? "INTEGER" : "BIGINT";
|
|
756
|
+
}
|
|
757
|
+
function lengthType(type, base, dataType, database) {
|
|
758
|
+
const length = lengthTypes.has(base) ? lengthArgument(dataType) : null;
|
|
759
|
+
const options = [...fixedLengthTypes.has(base) ? [FIXED] : [], ...isMySQLFamily(database) && mysqlNationalTypes.has(base) ? [UTF8MB3] : []];
|
|
760
|
+
if (length !== null) return createColumnType(type, {
|
|
761
|
+
args: [`length: ${length}`],
|
|
762
|
+
options,
|
|
763
|
+
definition: database === Database.MSSQL && type === "STRING" && !nationalTypes.has(base) && length > 4e3 ? dataType.trim() : null
|
|
764
|
+
});
|
|
765
|
+
if (type === "BINARY" && (isMySQLFamily(database) || database === Database.MSSQL) && !MAX_ARGUMENT.test(dataType)) return createColumnType("BINARY", {
|
|
766
|
+
args: ["length: 1"],
|
|
767
|
+
options
|
|
768
|
+
});
|
|
769
|
+
if (type === "BINARY") return createColumnType("BLOB");
|
|
770
|
+
if (MAX_ARGUMENT.test(dataType) || unboundedStringTypes.has(base)) return createColumnType("TEXT");
|
|
771
|
+
if (oneCharacterTypes.has(base)) return createColumnType("STRING", {
|
|
772
|
+
args: ["length: 1"],
|
|
773
|
+
options
|
|
774
|
+
});
|
|
775
|
+
return createColumnType("STRING");
|
|
776
|
+
}
|
|
777
|
+
function isSmallFloat(base, database, args) {
|
|
778
|
+
const isSinglePrecision = base === "float" && args.length === 1 && args[0] <= 24;
|
|
779
|
+
switch (database) {
|
|
780
|
+
case Database.MySQL:
|
|
781
|
+
case Database.MariaDB: return (base === "float" || base === "float4") && (args.length !== 1 || args[0] <= 24);
|
|
782
|
+
case Database.PostgreSQL: return base === "real" || base === "float4" || isSinglePrecision;
|
|
783
|
+
case Database.MSSQL: return base === "real" || isSinglePrecision;
|
|
784
|
+
case Database.Oracle: return base === "real" || base === "float" && args.length === 1 && args[0] === 63;
|
|
785
|
+
case Database.SQLite: return base === "real";
|
|
786
|
+
}
|
|
787
|
+
return false;
|
|
788
|
+
}
|
|
789
|
+
function typeArguments(dataType) {
|
|
790
|
+
const matched = TYPE_ARGUMENTS.exec(dataType);
|
|
791
|
+
if (!matched) return [];
|
|
792
|
+
const values = matched[1].split(",").map((value) => value.trim());
|
|
793
|
+
return values.every((value) => DIGITS.test(value)) ? values.map(Number) : [];
|
|
794
|
+
}
|
|
795
|
+
function lengthArgument(dataType) {
|
|
796
|
+
const matched = LENGTH.exec(TYPE_ARGUMENTS.exec(dataType)?.[1].trim() ?? "");
|
|
797
|
+
const length = Number(matched?.[1]);
|
|
798
|
+
return length > 0 ? length : null;
|
|
799
|
+
}
|
|
800
|
+
function createClassContext(state) {
|
|
801
|
+
const relationships = resolveRelationships(state);
|
|
802
|
+
const derivedIds = new Set(relationships.filter((resolved) => isDerivedIdentity(state, resolved, relationships)).map(({ relationship }) => relationship.id));
|
|
803
|
+
const context = {
|
|
804
|
+
relationships,
|
|
805
|
+
derivedIds,
|
|
806
|
+
oneToOneIds: new Set(relationships.filter(({ relationship, endTable }) => !hasNRelationship(relationship.relationshipType) || derivedIds.has(relationship.id) && keyColumns(state, endTable).length === 1).map(({ relationship }) => relationship.id)),
|
|
807
|
+
indexNames: createIndexNames(state),
|
|
808
|
+
namings: /* @__PURE__ */ new Map(),
|
|
809
|
+
classNames: new Set(IMPORTED_NAMES.map((name) => name.toLowerCase()))
|
|
810
|
+
};
|
|
811
|
+
query(state.collections).collection("tableEntities").selectByIds(state.doc.tableIds).sort(orderByNameASC).forEach((table) => getNaming(state, context, table));
|
|
812
|
+
return context;
|
|
813
|
+
}
|
|
814
|
+
function createIndexNames(state) {
|
|
815
|
+
const { doc: { indexIds }, settings: { bracketType }, collections } = state;
|
|
816
|
+
const tableCollection = query(collections).collection("tableEntities");
|
|
817
|
+
const columnCollection = query(collections).collection("tableColumnEntities");
|
|
818
|
+
const indexColumnCollection = query(collections).collection("indexColumnEntities");
|
|
819
|
+
const used = [];
|
|
820
|
+
const names = /* @__PURE__ */ new Map();
|
|
821
|
+
query(collections).collection("indexEntities").selectByIds(indexIds).forEach((index) => {
|
|
822
|
+
const table = tableCollection.selectById(index.tableId);
|
|
823
|
+
const hasColumns = indexColumnCollection.selectByIds(index.indexColumnIds).some(({ columnId }) => columnCollection.selectById(columnId));
|
|
824
|
+
if (!table || index.name.trim() !== "" || !hasColumns) return;
|
|
825
|
+
const name = autoNameIgnoreCase(used, `IDX_${tableNamePart(table.name, bracketType)}`);
|
|
826
|
+
used.push({
|
|
827
|
+
id: index.id,
|
|
828
|
+
name
|
|
829
|
+
});
|
|
830
|
+
names.set(index.id, name);
|
|
831
|
+
});
|
|
832
|
+
return names;
|
|
833
|
+
}
|
|
834
|
+
function resolveRelationships(state) {
|
|
835
|
+
const { doc: { relationshipIds, tableIds }, collections } = state;
|
|
836
|
+
const documentTableIds = new Set(tableIds);
|
|
837
|
+
const tableCollection = query(collections).collection("tableEntities");
|
|
838
|
+
const columnCollection = query(collections).collection("tableColumnEntities");
|
|
839
|
+
return query(collections).collection("relationshipEntities").selectByIds(relationshipIds).map((relationship) => {
|
|
840
|
+
const startTable = tableCollection.selectById(relationship.start.tableId);
|
|
841
|
+
const endTable = tableCollection.selectById(relationship.end.tableId);
|
|
842
|
+
const startColumns = columnCollection.selectByIds(relationship.start.columnIds);
|
|
843
|
+
const endColumns = columnCollection.selectByIds(relationship.end.columnIds);
|
|
844
|
+
return !isMapped(relationship) || !startTable || !endTable || !documentTableIds.has(startTable.id) || !documentTableIds.has(endTable.id) || endColumns.length === 0 || startColumns.length !== relationship.start.columnIds.length || endColumns.length !== relationship.end.columnIds.length || startColumns.length !== endColumns.length || !startColumns.every((column) => startTable.columnIds.includes(column.id) && isPrimaryKey(column)) || !endColumns.every((column) => endTable.columnIds.includes(column.id)) ? null : {
|
|
845
|
+
relationship,
|
|
846
|
+
startTable,
|
|
847
|
+
endTable,
|
|
848
|
+
startColumns,
|
|
849
|
+
endColumns
|
|
850
|
+
};
|
|
851
|
+
}).filter((resolved) => resolved !== null);
|
|
852
|
+
}
|
|
853
|
+
function getNaming(state, context, table) {
|
|
854
|
+
const cached = context.namings.get(table.id);
|
|
855
|
+
if (cached) return cached;
|
|
856
|
+
const naming = createTableNaming(state, table, context);
|
|
857
|
+
context.namings.set(table.id, naming);
|
|
858
|
+
return naming;
|
|
859
|
+
}
|
|
860
|
+
function createTableNaming(state, table, { relationships, derivedIds, oneToOneIds, classNames }) {
|
|
861
|
+
const { settings: { tableNameCase, columnNameCase }, collections } = state;
|
|
862
|
+
const used = /* @__PURE__ */ new Set();
|
|
863
|
+
const propertyNames = /* @__PURE__ */ new Map();
|
|
864
|
+
const relationshipNames = /* @__PURE__ */ new Map();
|
|
865
|
+
const owning = relationships.filter(({ relationship }) => relationship.end.tableId === table.id);
|
|
866
|
+
const carried = new Set(owning.flatMap(({ relationship, endColumns }) => endColumns.filter((column) => derivedIds.has(relationship.id) || !isPrimaryKey(column)).map((column) => column.id)));
|
|
867
|
+
const columnNames = /* @__PURE__ */ new Set();
|
|
868
|
+
const fields = query(collections).collection("tableColumnEntities").selectByIds(table.columnIds).filter((column) => {
|
|
869
|
+
if (carried.has(column.id) || columnNames.has(column.name)) return false;
|
|
870
|
+
columnNames.add(column.name);
|
|
871
|
+
return true;
|
|
872
|
+
});
|
|
873
|
+
fields.forEach((column) => {
|
|
874
|
+
propertyNames.set(column.id, uniqueName(used, phpIdentifier(getNameCase(column.name, columnNameCase))));
|
|
875
|
+
});
|
|
876
|
+
owning.forEach(({ relationship, startTable }) => {
|
|
877
|
+
const name = isSelfReferential(relationship) ? `parent_${startTable.name}` : startTable.name;
|
|
878
|
+
relationshipNames.set(relationshipKey(relationship, OWNING), uniqueName(used, phpIdentifier(getNameCase(name, columnNameCase))));
|
|
879
|
+
});
|
|
880
|
+
relationships.filter(({ relationship }) => relationship.start.tableId === table.id).forEach(({ relationship, endTable }) => {
|
|
881
|
+
const name = oneToOneIds.has(relationship.id) ? endTable.name : `${endTable.name}List`;
|
|
882
|
+
relationshipNames.set(relationshipKey(relationship, INVERSE), uniqueName(used, phpIdentifier(getNameCase(name, columnNameCase))));
|
|
883
|
+
});
|
|
884
|
+
return {
|
|
885
|
+
className: uniqueClassName(classNames, toClassName(phpIdentifier(getNameCase(table.name, tableNameCase)))),
|
|
886
|
+
fields,
|
|
887
|
+
owning,
|
|
888
|
+
propertyNames,
|
|
889
|
+
relationshipNames
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
function isDerivedIdentity(state, { startTable, startColumns, endColumns }, relationships) {
|
|
893
|
+
const parentKey = keyColumns(state, startTable);
|
|
894
|
+
return endColumns.every(isPrimaryKey) && parentKey.length === 1 && startColumns.length === 1 && startColumns[0].id === parentKey[0].id && !relationships.some(({ relationship, endColumns: parentColumns }) => relationship.end.tableId === startTable.id && parentColumns.every(isPrimaryKey) && parentColumns.some((column) => column.id === parentKey[0].id));
|
|
895
|
+
}
|
|
896
|
+
function keyColumns(state, table) {
|
|
897
|
+
return query(state.collections).collection("tableColumnEntities").selectByIds(table.columnIds).filter(isPrimaryKey);
|
|
898
|
+
}
|
|
899
|
+
function isMapped(relationship) {
|
|
900
|
+
return hasOneRelationship(relationship.relationshipType) || hasNRelationship(relationship.relationshipType);
|
|
901
|
+
}
|
|
902
|
+
function isPrimaryKey(column) {
|
|
903
|
+
return bHas(column.options, ColumnOption.primaryKey);
|
|
904
|
+
}
|
|
905
|
+
function relationshipKey(relationship, side) {
|
|
906
|
+
return `${relationship.id}:${side}`;
|
|
907
|
+
}
|
|
908
|
+
function relationshipName(naming, relationship, side) {
|
|
909
|
+
return naming.relationshipNames.get(relationshipKey(relationship, side));
|
|
910
|
+
}
|
|
911
|
+
function isSelfReferential(relationship) {
|
|
912
|
+
return relationship.start.tableId === relationship.end.tableId;
|
|
913
|
+
}
|
|
914
|
+
function uniqueName(used, name) {
|
|
915
|
+
let result = name;
|
|
916
|
+
let index = 2;
|
|
917
|
+
while (used.has(result)) {
|
|
918
|
+
result = `${name}${index}`;
|
|
919
|
+
index += 1;
|
|
920
|
+
}
|
|
921
|
+
used.add(result);
|
|
922
|
+
return result;
|
|
923
|
+
}
|
|
924
|
+
function uniqueClassName(used, name) {
|
|
925
|
+
let result = name;
|
|
926
|
+
let index = 2;
|
|
927
|
+
while (used.has(result.toLowerCase())) {
|
|
928
|
+
result = `${name}${index}`;
|
|
929
|
+
index += 1;
|
|
930
|
+
}
|
|
931
|
+
used.add(result.toLowerCase());
|
|
932
|
+
return result;
|
|
933
|
+
}
|
|
934
|
+
var WORD_CHARACTER = /^[0-9A-Za-z_]$/;
|
|
935
|
+
var DIGIT_START = /^[0-9]/;
|
|
936
|
+
function phpIdentifier(name) {
|
|
937
|
+
const value = Array.from(name, (char) => char.charCodeAt(0) >= 128 || WORD_CHARACTER.test(char) ? char : "_").join("");
|
|
938
|
+
return value === "" || DIGIT_START.test(value) ? `_${value}` : value;
|
|
939
|
+
}
|
|
940
|
+
var SINGLE_QUOTED = /[\\']/g;
|
|
941
|
+
var doubleQuotedEscapes = /* @__PURE__ */ new Map([
|
|
942
|
+
["\\", "\\\\"],
|
|
943
|
+
["\"", "\\\""],
|
|
944
|
+
["$", "\\$"],
|
|
945
|
+
["\n", "\\n"],
|
|
946
|
+
["\r", "\\r"],
|
|
947
|
+
[" ", "\\t"]
|
|
948
|
+
]);
|
|
949
|
+
function phpString(value) {
|
|
950
|
+
const chars = Array.from(value);
|
|
951
|
+
if (!chars.some(isControlCharacter)) return `'${value.replace(SINGLE_QUOTED, "\\$&")}'`;
|
|
952
|
+
return `"${chars.map(escapeDoubleQuoted).join("")}"`;
|
|
953
|
+
}
|
|
954
|
+
function escapeDoubleQuoted(char) {
|
|
955
|
+
const escape = doubleQuotedEscapes.get(char);
|
|
956
|
+
if (escape !== void 0) return escape;
|
|
957
|
+
return isControlCharacter(char) ? `\\x${char.charCodeAt(0).toString(16).padStart(2, "0")}` : char;
|
|
958
|
+
}
|
|
959
|
+
function isControlCharacter(char) {
|
|
960
|
+
const code = char.charCodeAt(0);
|
|
961
|
+
return code < 32 || code === 127;
|
|
962
|
+
}
|
|
963
|
+
//#endregion
|
|
964
|
+
export { createCode, createTableCode };
|