@elyx-code/editor-ui 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/package.json +109 -0
- package/src/App.tsx +31 -0
- package/src/Router.tsx +115 -0
- package/src/__mocks__/defaultModuleMock.ts +1 -0
- package/src/__mocks__/fileMock.ts +1 -0
- package/src/__mocks__/styleMock.ts +1 -0
- package/src/assets/Clock-11.1s-18px.svg +16 -0
- package/src/assets/Clock-11.1s-28px.svg +16 -0
- package/src/assets/authentication.svg +1 -0
- package/src/assets/canvas-backdrop-0.png +0 -0
- package/src/assets/canvas-backdrop-1.png +0 -0
- package/src/assets/canvas-backdrop-2.png +0 -0
- package/src/assets/canvas-backdrop-3.png +0 -0
- package/src/assets/canvas-backdrop-4.png +0 -0
- package/src/assets/canvas-backdrop-5.png +0 -0
- package/src/assets/canvas-backdrop.png +0 -0
- package/src/assets/checkmark-animation.gif +0 -0
- package/src/assets/checkmark-animation.mp4 +0 -0
- package/src/assets/code-formatting/format-black.svg +6 -0
- package/src/assets/code-formatting/format-dark-grey.svg +6 -0
- package/src/assets/code-formatting/format-light-grey.svg +6 -0
- package/src/assets/code-formatting/format-white.svg +6 -0
- package/src/assets/code-formatting/inline-black.svg +5 -0
- package/src/assets/code-formatting/inline-dark-grey.svg +5 -0
- package/src/assets/code-formatting/inline-light-grey.svg +5 -0
- package/src/assets/code-formatting/inline-white.svg +5 -0
- package/src/assets/contained-logo-full-word.png +0 -0
- package/src/assets/cron-job-color.png +0 -0
- package/src/assets/cron-job.png +0 -0
- package/src/assets/database-table-color.png +0 -0
- package/src/assets/database-table.png +0 -0
- package/src/assets/datatype-icons/black/any.svg +1 -0
- package/src/assets/datatype-icons/black/binary.svg +1 -0
- package/src/assets/datatype-icons/black/boolean.svg +3 -0
- package/src/assets/datatype-icons/black/date-time.svg +3 -0
- package/src/assets/datatype-icons/black/definition-entity.svg +6 -0
- package/src/assets/datatype-icons/black/key-file.svg +1 -0
- package/src/assets/datatype-icons/black/list.svg +3 -0
- package/src/assets/datatype-icons/black/null.svg +3 -0
- package/src/assets/datatype-icons/black/number.svg +13 -0
- package/src/assets/datatype-icons/black/project.svg +12 -0
- package/src/assets/datatype-icons/black/sql-program.svg +2 -0
- package/src/assets/datatype-icons/black/text.svg +3 -0
- package/src/assets/datatype-icons/black/unknown.svg +3 -0
- package/src/assets/datatype-icons/black/uuid.svg +4 -0
- package/src/assets/datatype-icons/black/void.svg +1 -0
- package/src/assets/datatype-icons/dark-grey/any.svg +1 -0
- package/src/assets/datatype-icons/dark-grey/boolean.svg +3 -0
- package/src/assets/datatype-icons/dark-grey/date-time.svg +3 -0
- package/src/assets/datatype-icons/dark-grey/definition-entity.svg +6 -0
- package/src/assets/datatype-icons/dark-grey/list.svg +3 -0
- package/src/assets/datatype-icons/dark-grey/null.svg +3 -0
- package/src/assets/datatype-icons/dark-grey/number.svg +13 -0
- package/src/assets/datatype-icons/dark-grey/project.svg +12 -0
- package/src/assets/datatype-icons/dark-grey/sql-program.svg +2 -0
- package/src/assets/datatype-icons/dark-grey/text.svg +3 -0
- package/src/assets/datatype-icons/dark-grey/unknown.svg +3 -0
- package/src/assets/datatype-icons/dark-grey/uuid.svg +4 -0
- package/src/assets/datatype-icons/dark-grey/void.svg +1 -0
- package/src/assets/datatype-icons/light-grey/any.svg +1 -0
- package/src/assets/datatype-icons/light-grey/boolean.svg +3 -0
- package/src/assets/datatype-icons/light-grey/date-time.svg +3 -0
- package/src/assets/datatype-icons/light-grey/definition-entity.svg +6 -0
- package/src/assets/datatype-icons/light-grey/list.svg +3 -0
- package/src/assets/datatype-icons/light-grey/null.svg +3 -0
- package/src/assets/datatype-icons/light-grey/number.svg +13 -0
- package/src/assets/datatype-icons/light-grey/project.svg +12 -0
- package/src/assets/datatype-icons/light-grey/sql-program.svg +2 -0
- package/src/assets/datatype-icons/light-grey/text.svg +3 -0
- package/src/assets/datatype-icons/light-grey/unknown.svg +3 -0
- package/src/assets/datatype-icons/light-grey/uuid.svg +4 -0
- package/src/assets/datatype-icons/light-grey/void.svg +1 -0
- package/src/assets/edit.png +0 -0
- package/src/assets/execution.svg +13 -0
- package/src/assets/favicon.svg +14 -0
- package/src/assets/file-search.svg +1 -0
- package/src/assets/http-endpoint.png +0 -0
- package/src/assets/image-input-placeholder.png +0 -0
- package/src/assets/logo-full-word-white.png +0 -0
- package/src/assets/logo-full-word.png +0 -0
- package/src/assets/password.svg +85 -0
- package/src/assets/pencil.png +0 -0
- package/src/assets/publish-project-rich-icon-2.svg +1 -0
- package/src/assets/publish-project-rich-icon.svg +1 -0
- package/src/assets/relational-database.png +0 -0
- package/src/assets/resources.svg +3 -0
- package/src/assets/resume-icon-14px.png +0 -0
- package/src/assets/server.png +0 -0
- package/src/assets/small-status/checkmark.svg +4 -0
- package/src/assets/small-status/error.svg +4 -0
- package/src/assets/small-status/loading.svg +4 -0
- package/src/assets/small-status/skipped.svg +11 -0
- package/src/assets/sql-connection-config.svg +1 -0
- package/src/assets/sql-row-transformer.svg +1 -0
- package/src/assets/ssl-certificate-config.svg +1 -0
- package/src/assets/sync.svg +1 -0
- package/src/assets/testing-logic-icon.svg +1 -0
- package/src/assets/versions.svg +25 -0
- package/src/assets/visual-programming-icon.svg +1 -0
- package/src/assets/warning-sign-24px.png +0 -0
- package/src/auth/index.ts +318 -0
- package/src/components/DialogLoader.tsx +94 -0
- package/src/components/EntityDialogHeader.tsx +110 -0
- package/src/components/EntityDialogSectionHeader.tsx +214 -0
- package/src/components/GalleryAddExternalIntegrationInfoDialog.tsx +87 -0
- package/src/components/GenerateProjectStartingLogicPromptDialog.tsx +281 -0
- package/src/components/LegacyRouteRedirector.tsx +55 -0
- package/src/components/ProPlanChip.tsx +23 -0
- package/src/components/ReportBugDialog.tsx +412 -0
- package/src/components/RequestIntegrationAccessDialog.tsx +261 -0
- package/src/components/UseTemplateProjectDialog.tsx +193 -0
- package/src/components/WorkspaceLayout.tsx +152 -0
- package/src/components/animated-svg/AnimatedCheckmark.tsx +41 -0
- package/src/components/animated-svg/AnimatedCrossmark.tsx +51 -0
- package/src/components/animated-svg/AnimatedEmailSending.tsx +38 -0
- package/src/components/animated-svg/AnimatedLoading.tsx +72 -0
- package/src/components/animated-svg/animated-svg.css +239 -0
- package/src/components/canvas/Canvas.tsx +16 -0
- package/src/components/canvas/CreateEntityMenu.tsx +2020 -0
- package/src/components/canvas/canvas.css +10 -0
- package/src/components/canvas/create-entity-menu.css +579 -0
- package/src/components/canvas-search/CanvasSearch.tsx +501 -0
- package/src/components/canvas-search/canvas-search.css +126 -0
- package/src/components/canvas-settings-menu/CanvasSettingsMenuButton.tsx +515 -0
- package/src/components/canvas-settings-menu/canvas-settings-menu.css +96 -0
- package/src/components/circular-image-upload/CircularImageUpload.tsx +113 -0
- package/src/components/circular-image-upload/circular-image-upload.css +69 -0
- package/src/components/costs/CostsDialog.tsx +459 -0
- package/src/components/data-type/DataTypeBuilder.tsx +3127 -0
- package/src/components/data-type/data-type-builder.css +45 -0
- package/src/components/dialogs/BetaAcknowledgeDialog.tsx +43 -0
- package/src/components/dialogs/ComplexDataDialog.tsx +458 -0
- package/src/components/dialogs/CronBuilderDialog.tsx +2145 -0
- package/src/components/dialogs/ExternalIntegrationConnections.tsx +565 -0
- package/src/components/dialogs/JsonEditorDialog.tsx +1392 -0
- package/src/components/dialogs/StringEditorDialog.tsx +268 -0
- package/src/components/dialogs/argument-declaration/ArgumentDeclaration.tsx +1167 -0
- package/src/components/dialogs/argument-declaration/ArgumentDeclarationDialogContent.tsx +128 -0
- package/src/components/dialogs/beta-dialog.css +165 -0
- package/src/components/dialogs/condition/Condition.tsx +431 -0
- package/src/components/dialogs/condition/ConditionDialogContent.tsx +126 -0
- package/src/components/dialogs/definition-entity/DefinitionEntityDialogContent.tsx +973 -0
- package/src/components/dialogs/function-call/FunctionCall.tsx +442 -0
- package/src/components/dialogs/function-call/FunctionCallDialogContent.tsx +126 -0
- package/src/components/dialogs/function-declaration/FunctionDeclaration.tsx +926 -0
- package/src/components/dialogs/function-declaration/FunctionDeclarationDialogContent.tsx +124 -0
- package/src/components/dialogs/generating-project-starting-logic-overlay/GeneratingProjectStartingLogicOverlay.tsx +176 -0
- package/src/components/dialogs/generating-project-starting-logic-overlay/generating-project-starting-logic-overlay.css +13 -0
- package/src/components/dialogs/global-event/GlobalEvent.tsx +475 -0
- package/src/components/dialogs/global-event/GlobalEventDialogContent.tsx +126 -0
- package/src/components/dialogs/help/HelpDialog.tsx +217 -0
- package/src/components/dialogs/help/HelpDilalogHomeContent.tsx +178 -0
- package/src/components/dialogs/help/help-dialog.css +116 -0
- package/src/components/dialogs/help/help-icon/HelpIconButton.tsx +41 -0
- package/src/components/dialogs/help/help-icon/help-icon.css +9 -0
- package/src/components/dialogs/input-map/InputMap.tsx +635 -0
- package/src/components/dialogs/input-map/InputMapDialogContent.tsx +126 -0
- package/src/components/dialogs/json-editor-dialog.css +4 -0
- package/src/components/dialogs/loop/Loop.tsx +650 -0
- package/src/components/dialogs/loop/LoopDialogContent.tsx +122 -0
- package/src/components/dialogs/operation/Operation.tsx +440 -0
- package/src/components/dialogs/operation/OperationDialogContent.tsx +126 -0
- package/src/components/dialogs/output-map/OutputMap.tsx +536 -0
- package/src/components/dialogs/output-map/OutputMapDialogContent.tsx +126 -0
- package/src/components/dialogs/property/Property.tsx +1490 -0
- package/src/components/dialogs/property/PropertyDialogContent.tsx +106 -0
- package/src/components/dialogs/search-statement/ColumnSelector.tsx +334 -0
- package/src/components/dialogs/search-statement/ConditionBuilder.tsx +750 -0
- package/src/components/dialogs/search-statement/DataAggregationSection.tsx +621 -0
- package/src/components/dialogs/search-statement/DataSourceSelection.tsx +734 -0
- package/src/components/dialogs/search-statement/EntityMetadataSection.tsx +135 -0
- package/src/components/dialogs/search-statement/FilterConditionsSection.tsx +151 -0
- package/src/components/dialogs/search-statement/InlineInputMap.tsx +153 -0
- package/src/components/dialogs/search-statement/LiteralValue.tsx +616 -0
- package/src/components/dialogs/search-statement/MainSourceAndInputsSection.tsx +271 -0
- package/src/components/dialogs/search-statement/NestedSearchStatementBuilder.tsx +170 -0
- package/src/components/dialogs/search-statement/OutputFormatSection.tsx +1779 -0
- package/src/components/dialogs/search-statement/ResultsSection.tsx +344 -0
- package/src/components/dialogs/search-statement/SearchStatementBuilder.tsx +251 -0
- package/src/components/dialogs/search-statement/SearchStatementDialogContent.tsx +398 -0
- package/src/components/dialogs/search-statement/ValueSelector.tsx +766 -0
- package/src/components/dialogs/search-statement/search-statement-context.tsx +1630 -0
- package/src/components/dialogs/search-statement/search-statement-dialog.css +56 -0
- package/src/components/dialogs/search-statement/test.sql +111 -0
- package/src/components/dialogs/value-descriptor/ValueDescriptor.tsx +824 -0
- package/src/components/dialogs/value-descriptor/ValueDescriptorDialogContent.tsx +124 -0
- package/src/components/dialogs/variable-declaration/VariableDeclaration.tsx +836 -0
- package/src/components/dialogs/variable-declaration/VariableDeclarationDialogContent.tsx +106 -0
- package/src/components/dialogs/variable-instance/VariableInstance.tsx +443 -0
- package/src/components/dialogs/variable-instance/VariableInstanceDialogContent.tsx +124 -0
- package/src/components/draggable-entity-card/ArgumentDeclaration.tsx +736 -0
- package/src/components/draggable-entity-card/CollapseEntityButton.tsx +170 -0
- package/src/components/draggable-entity-card/ConditionCard.tsx +1062 -0
- package/src/components/draggable-entity-card/ConnectionDeleteButton.tsx +309 -0
- package/src/components/draggable-entity-card/DataTypeIcon.tsx +624 -0
- package/src/components/draggable-entity-card/DraggableEntityCard.tsx +617 -0
- package/src/components/draggable-entity-card/ErrorMapProperty.tsx +464 -0
- package/src/components/draggable-entity-card/EventCard.tsx +700 -0
- package/src/components/draggable-entity-card/ExecutionInProgressValue.tsx +327 -0
- package/src/components/draggable-entity-card/FunctionDeclarationCard.tsx +819 -0
- package/src/components/draggable-entity-card/InputMapProperty.tsx +1067 -0
- package/src/components/draggable-entity-card/InternalCall.tsx +978 -0
- package/src/components/draggable-entity-card/InternalCallExecutionNode.tsx +643 -0
- package/src/components/draggable-entity-card/LogicScopeCallerNode.tsx +262 -0
- package/src/components/draggable-entity-card/LoopCard.tsx +791 -0
- package/src/components/draggable-entity-card/MainValueInput.tsx +523 -0
- package/src/components/draggable-entity-card/MainValueOutput.tsx +458 -0
- package/src/components/draggable-entity-card/MethodDeclaration.tsx +1088 -0
- package/src/components/draggable-entity-card/NestedCondition.tsx +1025 -0
- package/src/components/draggable-entity-card/OutputMapProperty.tsx +843 -0
- package/src/components/draggable-entity-card/PassthroughEntityCard.tsx +1247 -0
- package/src/components/draggable-entity-card/ReturnedError.tsx +549 -0
- package/src/components/draggable-entity-card/SmallSuccessFailureNodes.tsx +523 -0
- package/src/components/draggable-entity-card/SuccessFailureNodes.tsx +509 -0
- package/src/components/draggable-entity-card/TestEntityButton.tsx +946 -0
- package/src/components/draggable-entity-card/TestMenu.tsx +523 -0
- package/src/components/draggable-entity-card/TestMenuValidationDropdown.tsx +84 -0
- package/src/components/draggable-entity-card/UnreachableMarker.tsx +114 -0
- package/src/components/draggable-entity-card/VariableCard.tsx +1577 -0
- package/src/components/draggable-entity-card/VariableScopeMarker.tsx +117 -0
- package/src/components/draggable-entity-card/collapse-entity-button.css +44 -0
- package/src/components/draggable-entity-card/definition-entity/DefinitionEntityCard.tsx +1181 -0
- package/src/components/draggable-entity-card/definition-entity/DefinitionEntityIcon.tsx +36 -0
- package/src/components/draggable-entity-card/definition-entity/DefinitionEntityProperty.tsx +478 -0
- package/src/components/draggable-entity-card/definition-entity/DynamicFooterActions.tsx +112 -0
- package/src/components/draggable-entity-card/definition-entity/actions/external-integration-connection/ExportCredentialsFooterAction.tsx +461 -0
- package/src/components/draggable-entity-card/definition-entity/actions/external-integration-connection/RestablishConnectionFooterAction.tsx +199 -0
- package/src/components/draggable-entity-card/definition-entity/actions/external-integration-connection/restablish-connection-footer-action.css +85 -0
- package/src/components/draggable-entity-card/definition-entity/actions/google-drive/GoogleDriveFilePickerAPIFooterAction.tsx +277 -0
- package/src/components/draggable-entity-card/definition-entity/actions/google-drive/google-drive-file-picker-api-footer-action.css +107 -0
- package/src/components/draggable-entity-card/definition-entity/actions/persisted-entity/DatabaseFooterAction.tsx +452 -0
- package/src/components/draggable-entity-card/definition-entity/actions/persisted-entity/database-footer-action.css +86 -0
- package/src/components/draggable-entity-card/definition-entity/definition-entity-card.css +17 -0
- package/src/components/draggable-entity-card/draggable-entity-card.css +1140 -0
- package/src/components/draggable-entity-card/entity-locked-icon/EntityLockedIcon.tsx +133 -0
- package/src/components/draggable-entity-card/entity-locked-icon/entity-locked.css +8 -0
- package/src/components/draggable-entity-card/expand-properties-icon-button/ExpandPropertiesIconButton.tsx +84 -0
- package/src/components/draggable-entity-card/expand-properties-icon-button/expand-properties-icon-button.css +21 -0
- package/src/components/draggable-entity-card/implement-entity-icon/ImplementEntityIcon.tsx +74 -0
- package/src/components/draggable-entity-card/implement-entity-icon/implement-entity-icon.css +13 -0
- package/src/components/draggable-entity-card/logic-error/LogicErrorIconMenu.tsx +424 -0
- package/src/components/draggable-entity-card/logic-error/logic-error.css +23 -0
- package/src/components/draggable-entity-card/new-card-input-button/NewCardInputButton.tsx +193 -0
- package/src/components/draggable-entity-card/new-card-input-button/NewDynamicInputButton.tsx +214 -0
- package/src/components/draggable-entity-card/new-card-input-button/new-card-input-button.css +71 -0
- package/src/components/draggable-entity-card/new-card-output-button/NewCardOutputButton.tsx +192 -0
- package/src/components/draggable-entity-card/new-card-output-button/new-card-output-button.css +71 -0
- package/src/components/draggable-entity-card/termination-statement/TerminationStatementCard.tsx +1543 -0
- package/src/components/draggable-entity-card/termination-statement/termination-statement-card.css +17 -0
- package/src/components/draggable-entity-card/test-entity-button.css +55 -0
- package/src/components/draggable-entity-card/test-menu.css +181 -0
- package/src/components/draggable-entity-card/unreachable-marker.css +43 -0
- package/src/components/draggable-entity-card/variable-scope-marker.css +22 -0
- package/src/components/dynamic-value/DynamicValue.tsx +2395 -0
- package/src/components/dynamic-value/DynamicValueEntry.tsx +1957 -0
- package/src/components/dynamic-value/dynamic-value.css +230 -0
- package/src/components/editor/ElyxMonacoEditor.tsx +38 -0
- package/src/components/entity-error/EntityErrorListItem.tsx +47 -0
- package/src/components/entity-error/entity-error.css +198 -0
- package/src/components/entity-icon/EntityIcon.tsx +292 -0
- package/src/components/entity-icon/entity-icon.css +39 -0
- package/src/components/gallery-card/CreateNewProject.tsx +222 -0
- package/src/components/gallery-card/GalleryCard.tsx +171 -0
- package/src/components/gallery-card/MarketplaceCard.tsx +87 -0
- package/src/components/gallery-card/ProjectDuplicationCard.tsx +575 -0
- package/src/components/gallery-card/gallery-card.css +25 -0
- package/src/components/notifications/NotificationsIconButton.tsx +124 -0
- package/src/components/notifications/NotificationsPanel.tsx +385 -0
- package/src/components/notifications/notifications.css +189 -0
- package/src/components/online-users/LocalOnlineUsers.tsx +175 -0
- package/src/components/online-users/PageOnlineUsers.tsx +297 -0
- package/src/components/online-users/online-users.css +72 -0
- package/src/components/page-backdrop/PageBackdrop.tsx +8 -0
- package/src/components/page-backdrop/page-backdrop.css +7 -0
- package/src/components/project-configuration/DeleteProjectConfirmationDialog.tsx +134 -0
- package/src/components/project-configuration/ProjectConfigurationDialog.tsx +972 -0
- package/src/components/project-configuration/ProjectDataForm.tsx +121 -0
- package/src/components/project-configuration/UnpublishProjectConfirmationDialog.tsx +162 -0
- package/src/components/project-configuration/project-configuration-content.css +209 -0
- package/src/components/project-name/ProjectName.tsx +2025 -0
- package/src/components/project-name/project-name.css +599 -0
- package/src/components/publishing/Publication.tsx +133 -0
- package/src/components/publishing/history/PublicationHistoryContent.tsx +414 -0
- package/src/components/publishing/history/PublicationHistoryDialog.tsx +234 -0
- package/src/components/publishing/preview/PublicationPreviewDialog.tsx +1158 -0
- package/src/components/publishing/preview/PublishingPriceForecast.tsx +160 -0
- package/src/components/publishing/preview/PublishingResourcesDetails.tsx +91 -0
- package/src/components/publishing/publication-sequence/PublishingSequenceContent.tsx +375 -0
- package/src/components/publishing/publication-sequence/PublishingSequenceDialog.tsx +344 -0
- package/src/components/publishing/publishing-dialog.css +142 -0
- package/src/components/publishing/utils.ts +227 -0
- package/src/components/resources/ResourcesDialog.tsx +591 -0
- package/src/components/resources/UpgradeBanner.tsx +102 -0
- package/src/components/resources/codebase/CodebaseDetails.tsx +156 -0
- package/src/components/resources/cron-job/CronJobsList.tsx +532 -0
- package/src/components/resources/functions/FunctionsList.tsx +454 -0
- package/src/components/resources/http-api/HttpAPI.tsx +566 -0
- package/src/components/resources/http-api/HttpAPIClientModule.tsx +37 -0
- package/src/components/resources/logs/LogsViewer.tsx +768 -0
- package/src/components/resources/query.ts +74 -0
- package/src/components/resources/relational-database/DatabaseTable.tsx +905 -0
- package/src/components/resources/relational-database/RelationalDatabase.tsx +83 -0
- package/src/components/resources/relational-database/RelationalDatabaseSecrets.tsx +361 -0
- package/src/components/resources/resources-dialog.css +74 -0
- package/src/components/test-relational-database/DatabaseTable.tsx +913 -0
- package/src/components/test-relational-database/TestDatabaseDialogContent.tsx +670 -0
- package/src/components/test-relational-database/query.ts +74 -0
- package/src/components/toolbar/ToolBar.tsx +236 -0
- package/src/components/toolbar/toolbar.css +78 -0
- package/src/components/transaction-history/TransactionHistoryDialog.tsx +268 -0
- package/src/components/user/CurrentUserAvatar.tsx +65 -0
- package/src/components/user/UserChip.tsx +62 -0
- package/src/components/user/user.css +39 -0
- package/src/components/user-profile/ChangePasswordForm.tsx +67 -0
- package/src/components/user-profile/OwnUserProfileContent.tsx +665 -0
- package/src/components/user-profile/PublicUserProfileContent.tsx +99 -0
- package/src/components/user-profile/UserDataForm.tsx +75 -0
- package/src/components/user-profile/UserProfileDialog.tsx +110 -0
- package/src/components/user-profile/user-profile-content.css +25 -0
- package/src/config.ts +130 -0
- package/src/globals.d.ts +13 -0
- package/src/index.html +27 -0
- package/src/index.tsx +23 -0
- package/src/lib/badge/Badge.tsx +35 -0
- package/src/lib/badge/badge.css +32 -0
- package/src/lib/button/Button.tsx +129 -0
- package/src/lib/button/button.css +145 -0
- package/src/lib/canvas/canvas-undo-redo.ts +263 -0
- package/src/lib/canvas/defs.ts +170 -0
- package/src/lib/canvas/index.test.ts +189 -0
- package/src/lib/canvas/index.ts +6999 -0
- package/src/lib/canvas/utils.ts +59 -0
- package/src/lib/card/Card.tsx +62 -0
- package/src/lib/card/LoadingCard.tsx +82 -0
- package/src/lib/card/card.css +259 -0
- package/src/lib/chip/Chip.tsx +79 -0
- package/src/lib/chip/chip.css +0 -0
- package/src/lib/dialog/Dialog.tsx +122 -0
- package/src/lib/dialog/SmallDialog.tsx +61 -0
- package/src/lib/dialog/dialog.css +40 -0
- package/src/lib/display-data-structure/index.tsx +21 -0
- package/src/lib/dropdown/CanvasDropdownMenuCard.tsx +68 -0
- package/src/lib/dropdown/CanvasDropdownMenuCardOption.tsx +136 -0
- package/src/lib/dropdown/DropdownButton.tsx +104 -0
- package/src/lib/dropdown/DropdownMenuCard.tsx +324 -0
- package/src/lib/dropdown/DropdownMenuPopup.tsx +27 -0
- package/src/lib/dropdown/dropdown-button.css +76 -0
- package/src/lib/dropdown/dropdown-menu.css +151 -0
- package/src/lib/json-editor/RawJsonEditor.tsx +137 -0
- package/src/lib/json-editor/json-editor.css +35 -0
- package/src/lib/loader/Loader.tsx +120 -0
- package/src/lib/loader/loader.css +38 -0
- package/src/lib/pagination/Pagination.tsx +64 -0
- package/src/lib/popup/CanvasPopupBaseComponent.tsx +103 -0
- package/src/lib/popup/Popup.tsx +243 -0
- package/src/lib/popup/popup.css +16 -0
- package/src/lib/table/RowForm.tsx +301 -0
- package/src/lib/table/Table.tsx +1069 -0
- package/src/lib/table/table.css +249 -0
- package/src/lib/table/types.ts +108 -0
- package/src/lib/text-area/TextArea.tsx +183 -0
- package/src/lib/text-area/text-area.css +156 -0
- package/src/lib/text-field/TextField.tsx +218 -0
- package/src/lib/text-field/index.ts +8 -0
- package/src/lib/text-field/text-field.css +201 -0
- package/src/lib/tooltip/Tooltip.tsx +24 -0
- package/src/lib/tooltip/tooltip.css +17 -0
- package/src/localization/index.ts +47 -0
- package/src/main.css +343 -0
- package/src/pages/Auth.tsx +848 -0
- package/src/pages/Editor.tsx +883 -0
- package/src/pages/ErrorPage.tsx +179 -0
- package/src/pages/Gallery.tsx +1693 -0
- package/src/pages/NewPaymentMethodCallback.tsx +53 -0
- package/src/pages/NotFoundPage.tsx +126 -0
- package/src/pages/PricingPlans.tsx +155 -0
- package/src/pages/auth.css +304 -0
- package/src/pages/gallery.css +421 -0
- package/src/payments/index.ts +187 -0
- package/src/popup-notification/index.ts +90 -0
- package/src/services/database/index.ts +1 -0
- package/src/services/database/utils.ts +1301 -0
- package/src/services/editor/CanvasElement.tsx +2934 -0
- package/src/services/editor/CanvasElementConnectionDeleteButton.ts +204 -0
- package/src/services/editor/CanvasPopup.tsx +749 -0
- package/src/services/editor/EditorService.ts +8157 -0
- package/src/services/editor/area.ts +1312 -0
- package/src/services/editor/connections.ts +1019 -0
- package/src/services/editor/create/condition.ts +25 -0
- package/src/services/editor/create/definition-entity.ts +29 -0
- package/src/services/editor/create/function-call.ts +25 -0
- package/src/services/editor/create/global-event.ts +33 -0
- package/src/services/editor/create/loop.ts +25 -0
- package/src/services/editor/create/operation.ts +30 -0
- package/src/services/editor/create/utils.ts +140 -0
- package/src/services/editor/create/variable-declaration.ts +135 -0
- package/src/services/editor/create/variable-instance.ts +100 -0
- package/src/services/editor/editor-ui-extensions-context.ts +43 -0
- package/src/services/editor/entities-metadata.json +9310 -0
- package/src/services/editor/icons.ts +1093 -0
- package/src/services/editor/index.ts +1 -0
- package/src/services/editor/layout.ts +102 -0
- package/src/services/editor/modules/built-in-function-implementations/base.ts +14 -0
- package/src/services/editor/modules/built-in-function-implementations/create-persisted-entity/index.ts +56 -0
- package/src/services/editor/modules/built-in-function-implementations/delete-persisted-entity/index.ts +55 -0
- package/src/services/editor/modules/built-in-function-implementations/index.ts +4 -0
- package/src/services/editor/modules/built-in-function-implementations/update-persisted-entity/index.ts +56 -0
- package/src/services/editor/modules/operations-implementations/external-integrations/google-drive/get-files.ts +183 -0
- package/src/services/editor/modules/operations-implementations/external-integrations/google-drive/list-drives.ts +124 -0
- package/src/services/editor/modules/operations-implementations/external-integrations/google-drive/list-root-folders.ts +125 -0
- package/src/services/editor/modules/operations-implementations/external-integrations/google-drive/smart-fetch-document.ts +702 -0
- package/src/services/editor/modules/operations-implementations/external-integrations/google-drive/upload-document.ts +535 -0
- package/src/services/editor/modules/operations-implementations/external-integrations/google-gemini/generate-content.ts +193 -0
- package/src/services/editor/modules/operations-implementations/external-integrations/google-mail/get-emails.ts +586 -0
- package/src/services/editor/modules/operations-implementations/external-integrations/google-mail/send-email.ts +386 -0
- package/src/services/editor/modules/operations-implementations/external-integrations/index.ts +12 -0
- package/src/services/editor/modules/operations-implementations/external-integrations/slack/channels.ts +240 -0
- package/src/services/editor/modules/operations-implementations/external-integrations/slack/messages.ts +210 -0
- package/src/services/editor/modules/operations-implementations/external-integrations/slack/replies.ts +200 -0
- package/src/services/editor/modules/operations-implementations/external-integrations/slack/send-message.ts +177 -0
- package/src/services/editor/modules/operations-implementations/index.ts +1 -0
- package/src/services/editor/modules/search-node-implementation/index.ts +42 -0
- package/src/services/editor/modules/sql-migrations-generation.tsx +1054 -0
- package/src/services/editor/publication/publication.ts +578 -0
- package/src/services/editor/ui.ts +1348 -0
- package/src/services/editor/utils.ts +5868 -0
- package/src/services/editor/value-store.ts +619 -0
- package/src/services/execution/built-in-function-implementations.ts +422 -0
- package/src/services/execution/index.ts +4747 -0
- package/src/services/execution/logic.ts +121 -0
- package/src/services/execution/test-instance.tsx +2296 -0
- package/src/services/execution/utils.ts +33 -0
- package/src/services/execution/value-resolution.test.ts +424 -0
- package/src/services/execution/value-resolution.ts +4087 -0
- package/src/services/integrations/ExternalIntegrationsService.ts +439 -0
- package/src/services/integrations/api.ts +175 -0
- package/src/services/local-relational-database/idb_helper.ts +66 -0
- package/src/services/local-relational-database/index.ts +3308 -0
- package/src/services/local-relational-database/utils.ts +403 -0
- package/src/services/notifications/index.ts +525 -0
- package/src/services/user/index.ts +144 -0
- package/src/setupTests.ts +1 -0
- package/src/socket/socket.ts +248 -0
- package/src/socket/utils.ts +10 -0
- package/src/store/workspace.ts +12 -0
- package/src/theme.ts +19 -0
- package/src/utils/DOM.ts +39 -0
- package/src/utils/date.ts +169 -0
- package/src/utils/index.ts +158 -0
- package/src/utils/react.tsx +679 -0
- package/src/utils/testing.ts +103 -0
|
@@ -0,0 +1,1054 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
BaseRegisteredExtension,
|
|
4
|
+
ExtensionContextType,
|
|
5
|
+
ExtensionManifest,
|
|
6
|
+
ExtensionPermissions,
|
|
7
|
+
ExtentionPriority,
|
|
8
|
+
IRegisteredExtension,
|
|
9
|
+
DefaultProjectLogicContext,
|
|
10
|
+
ProjectStateEvents,
|
|
11
|
+
DefinitionEntityState,
|
|
12
|
+
ProjectState,
|
|
13
|
+
ChangeSet,
|
|
14
|
+
EntityId,
|
|
15
|
+
PropertyState,
|
|
16
|
+
resolveEntityName,
|
|
17
|
+
EntityType,
|
|
18
|
+
StateMutationAction,
|
|
19
|
+
resolveSQLMigrationsDiffs,
|
|
20
|
+
createOrUpdateRowTransformer,
|
|
21
|
+
} from '@elyx-code/project-logic-tree';
|
|
22
|
+
import { EditorService } from '../EditorService';
|
|
23
|
+
import Button from '../../../lib/button/Button';
|
|
24
|
+
import { getCanvasEntityDraggableContainerDOMId } from '../ui';
|
|
25
|
+
import { Logger } from '@elyx-code/common-ts-utils';
|
|
26
|
+
|
|
27
|
+
const ICON_COL_WIDTH = 22;
|
|
28
|
+
|
|
29
|
+
// Non-interactive row (no hover, no click)
|
|
30
|
+
const Row: React.FC<{
|
|
31
|
+
icon: React.ReactNode;
|
|
32
|
+
color?: string;
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
}> = ({ icon, color, children }) => (
|
|
35
|
+
<div
|
|
36
|
+
role='presentation'
|
|
37
|
+
style={{
|
|
38
|
+
display: 'flex',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
gap: 8,
|
|
41
|
+
padding: '6px 8px',
|
|
42
|
+
border: '1px solid rgba(0,0,0,0.06)',
|
|
43
|
+
borderRadius: 6,
|
|
44
|
+
background: '#fff',
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
<div
|
|
48
|
+
style={{
|
|
49
|
+
width: ICON_COL_WIDTH,
|
|
50
|
+
minWidth: ICON_COL_WIDTH,
|
|
51
|
+
display: 'flex',
|
|
52
|
+
justifyContent: 'center',
|
|
53
|
+
color,
|
|
54
|
+
}}
|
|
55
|
+
>
|
|
56
|
+
{icon}
|
|
57
|
+
</div>
|
|
58
|
+
<div
|
|
59
|
+
style={{
|
|
60
|
+
display: 'flex',
|
|
61
|
+
alignItems: 'center',
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
{children}
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
// Collapsible section with aligned icon
|
|
70
|
+
const Section: React.FC<{
|
|
71
|
+
title: string;
|
|
72
|
+
subtitle?: string;
|
|
73
|
+
count?: number;
|
|
74
|
+
defaultOpen?: boolean;
|
|
75
|
+
icon?: React.ReactNode;
|
|
76
|
+
iconColor?: string;
|
|
77
|
+
children?: React.ReactNode;
|
|
78
|
+
}> = ({
|
|
79
|
+
title,
|
|
80
|
+
subtitle,
|
|
81
|
+
count,
|
|
82
|
+
defaultOpen = true,
|
|
83
|
+
icon,
|
|
84
|
+
iconColor,
|
|
85
|
+
children,
|
|
86
|
+
}) => {
|
|
87
|
+
const [open, setOpen] = React.useState(defaultOpen);
|
|
88
|
+
return (
|
|
89
|
+
<div
|
|
90
|
+
style={{
|
|
91
|
+
border: '1px solid rgba(0,0,0,0.08)',
|
|
92
|
+
borderRadius: 8,
|
|
93
|
+
background: 'rgba(0,0,0,0.02)',
|
|
94
|
+
}}
|
|
95
|
+
>
|
|
96
|
+
<div
|
|
97
|
+
style={{
|
|
98
|
+
display: 'flex',
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
justifyContent: 'space-between',
|
|
101
|
+
padding: '8px 10px',
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
<div
|
|
105
|
+
style={{
|
|
106
|
+
display: 'flex',
|
|
107
|
+
alignItems: 'center',
|
|
108
|
+
gap: 10,
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
<div
|
|
112
|
+
style={{
|
|
113
|
+
width: ICON_COL_WIDTH,
|
|
114
|
+
minWidth: ICON_COL_WIDTH,
|
|
115
|
+
display: 'flex',
|
|
116
|
+
justifyContent: 'center',
|
|
117
|
+
color: iconColor || 'inherit',
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
{icon}
|
|
121
|
+
</div>
|
|
122
|
+
<div
|
|
123
|
+
style={{
|
|
124
|
+
display: 'flex',
|
|
125
|
+
flexDirection: 'column',
|
|
126
|
+
gap: 2,
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
129
|
+
<span style={{ fontSize: 14 }}>{title}</span>
|
|
130
|
+
{!!subtitle && (
|
|
131
|
+
<span
|
|
132
|
+
style={{
|
|
133
|
+
fontSize: 11,
|
|
134
|
+
color: 'rgba(0,0,0,0.54)',
|
|
135
|
+
}}
|
|
136
|
+
>
|
|
137
|
+
{subtitle}
|
|
138
|
+
</span>
|
|
139
|
+
)}
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
<div
|
|
143
|
+
style={{
|
|
144
|
+
display: 'flex',
|
|
145
|
+
alignItems: 'center',
|
|
146
|
+
gap: 8,
|
|
147
|
+
}}
|
|
148
|
+
>
|
|
149
|
+
{typeof count === 'number' && (
|
|
150
|
+
<span
|
|
151
|
+
style={{
|
|
152
|
+
fontSize: 12,
|
|
153
|
+
lineHeight: '20px',
|
|
154
|
+
height: 20,
|
|
155
|
+
minWidth: 20,
|
|
156
|
+
padding: '0 6px',
|
|
157
|
+
borderRadius: 10,
|
|
158
|
+
background: '#eee',
|
|
159
|
+
textAlign: 'center',
|
|
160
|
+
}}
|
|
161
|
+
>
|
|
162
|
+
{count}
|
|
163
|
+
</span>
|
|
164
|
+
)}
|
|
165
|
+
<button
|
|
166
|
+
onClick={() => setOpen((o) => !o)}
|
|
167
|
+
aria-label={open ? 'Collapse section' : 'Expand section'}
|
|
168
|
+
style={{
|
|
169
|
+
width: 24,
|
|
170
|
+
height: 24,
|
|
171
|
+
border: 'none',
|
|
172
|
+
background: 'transparent',
|
|
173
|
+
display: 'flex',
|
|
174
|
+
alignItems: 'center',
|
|
175
|
+
justifyContent: 'center',
|
|
176
|
+
cursor: 'pointer',
|
|
177
|
+
}}
|
|
178
|
+
>
|
|
179
|
+
{open ? (
|
|
180
|
+
<i className='fa-regular fa-chevron-up' />
|
|
181
|
+
) : (
|
|
182
|
+
<i className='fa-regular fa-chevron-down' />
|
|
183
|
+
)}
|
|
184
|
+
</button>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
<div
|
|
189
|
+
style={{
|
|
190
|
+
height: open ? 'auto' : 0,
|
|
191
|
+
overflow: 'hidden',
|
|
192
|
+
}}
|
|
193
|
+
>
|
|
194
|
+
<div
|
|
195
|
+
style={{
|
|
196
|
+
padding: 8,
|
|
197
|
+
display: 'flex',
|
|
198
|
+
flexDirection: 'column',
|
|
199
|
+
gap: 6,
|
|
200
|
+
}}
|
|
201
|
+
>
|
|
202
|
+
{children}
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
);
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const PropChangeCard: React.FC<{
|
|
210
|
+
propId: EntityId;
|
|
211
|
+
changes: {
|
|
212
|
+
castableDataTypeEntity?: { fromId: EntityId; toId: EntityId };
|
|
213
|
+
nonCastableDataTypeEntity?: { fromId: EntityId; toId: EntityId };
|
|
214
|
+
nameChange?: { from: string; to: string };
|
|
215
|
+
requiredChange?: { from: boolean; to: boolean };
|
|
216
|
+
};
|
|
217
|
+
editor: EditorService;
|
|
218
|
+
}> = ({ propId, changes, editor }) => {
|
|
219
|
+
const [open, setOpen] = React.useState(true); // ✅ valid (top-level in a component)
|
|
220
|
+
|
|
221
|
+
const newPropState = editor.project.get(propId) as PropertyState;
|
|
222
|
+
const oldPropState = editor.lastPublishedProjectState.get(
|
|
223
|
+
propId,
|
|
224
|
+
) as PropertyState;
|
|
225
|
+
const title = newPropState?.name || oldPropState?.name || 'Unknown name';
|
|
226
|
+
|
|
227
|
+
return (
|
|
228
|
+
<div
|
|
229
|
+
key={propId + '-changes'}
|
|
230
|
+
style={{
|
|
231
|
+
border: '1px solid rgba(0,0,0,0.06)',
|
|
232
|
+
borderRadius: 8,
|
|
233
|
+
background: 'rgba(0,0,0,0.01)',
|
|
234
|
+
overflow: 'hidden',
|
|
235
|
+
}}
|
|
236
|
+
>
|
|
237
|
+
{/* Per-property header */}
|
|
238
|
+
<div
|
|
239
|
+
style={{
|
|
240
|
+
display: 'flex',
|
|
241
|
+
alignItems: 'center',
|
|
242
|
+
justifyContent: 'space-between',
|
|
243
|
+
padding: '8px 10px',
|
|
244
|
+
}}
|
|
245
|
+
>
|
|
246
|
+
<div
|
|
247
|
+
style={{
|
|
248
|
+
display: 'flex',
|
|
249
|
+
alignItems: 'center',
|
|
250
|
+
gap: 10,
|
|
251
|
+
}}
|
|
252
|
+
>
|
|
253
|
+
<div
|
|
254
|
+
style={{
|
|
255
|
+
width: ICON_COL_WIDTH,
|
|
256
|
+
minWidth: ICON_COL_WIDTH,
|
|
257
|
+
display: 'flex',
|
|
258
|
+
justifyContent: 'center',
|
|
259
|
+
}}
|
|
260
|
+
>
|
|
261
|
+
<i className='fa-regular fa-sliders' />
|
|
262
|
+
</div>
|
|
263
|
+
<span
|
|
264
|
+
style={{
|
|
265
|
+
fontSize: 13,
|
|
266
|
+
fontWeight: 500,
|
|
267
|
+
}}
|
|
268
|
+
>
|
|
269
|
+
{title}
|
|
270
|
+
</span>
|
|
271
|
+
</div>
|
|
272
|
+
<button
|
|
273
|
+
onClick={() => setOpen((o) => !o)}
|
|
274
|
+
aria-label={open ? 'Collapse changes' : 'Expand changes'}
|
|
275
|
+
style={{
|
|
276
|
+
width: 24,
|
|
277
|
+
height: 24,
|
|
278
|
+
border: 'none',
|
|
279
|
+
background: 'transparent',
|
|
280
|
+
display: 'flex',
|
|
281
|
+
alignItems: 'center',
|
|
282
|
+
justifyContent: 'center',
|
|
283
|
+
cursor: 'pointer',
|
|
284
|
+
}}
|
|
285
|
+
>
|
|
286
|
+
{open ? (
|
|
287
|
+
<i className='fa-regular fa-chevron-up' />
|
|
288
|
+
) : (
|
|
289
|
+
<i className='fa-regular fa-chevron-down' />
|
|
290
|
+
)}
|
|
291
|
+
</button>
|
|
292
|
+
</div>
|
|
293
|
+
|
|
294
|
+
{/* Per-property body */}
|
|
295
|
+
<div
|
|
296
|
+
style={{
|
|
297
|
+
height: open ? 'auto' : 0,
|
|
298
|
+
overflow: 'hidden',
|
|
299
|
+
}}
|
|
300
|
+
>
|
|
301
|
+
<div
|
|
302
|
+
style={{
|
|
303
|
+
padding: 8,
|
|
304
|
+
display: 'flex',
|
|
305
|
+
flexDirection: 'column',
|
|
306
|
+
gap: 6,
|
|
307
|
+
}}
|
|
308
|
+
>
|
|
309
|
+
{!!changes.nameChange && (
|
|
310
|
+
<Row icon={<i className='fa-regular fa-font-case' />}>
|
|
311
|
+
<div
|
|
312
|
+
style={{
|
|
313
|
+
display: 'flex',
|
|
314
|
+
flexDirection: 'column',
|
|
315
|
+
gap: 2,
|
|
316
|
+
}}
|
|
317
|
+
>
|
|
318
|
+
<span
|
|
319
|
+
style={{
|
|
320
|
+
fontSize: 13,
|
|
321
|
+
}}
|
|
322
|
+
>
|
|
323
|
+
Name changed
|
|
324
|
+
</span>
|
|
325
|
+
<Diff
|
|
326
|
+
from={changes.nameChange.from || 'Unnamed property'}
|
|
327
|
+
to={changes.nameChange.to || 'Unnamed property'}
|
|
328
|
+
/>
|
|
329
|
+
</div>
|
|
330
|
+
</Row>
|
|
331
|
+
)}
|
|
332
|
+
{!!changes.requiredChange && (
|
|
333
|
+
<Row
|
|
334
|
+
icon={<i className='fa-regular fa-triangle-exclamation' />}
|
|
335
|
+
color={'#ED6C02'}
|
|
336
|
+
>
|
|
337
|
+
<div
|
|
338
|
+
style={{
|
|
339
|
+
display: 'flex',
|
|
340
|
+
flexDirection: 'column',
|
|
341
|
+
gap: 2,
|
|
342
|
+
}}
|
|
343
|
+
>
|
|
344
|
+
<span
|
|
345
|
+
style={{
|
|
346
|
+
fontSize: 13,
|
|
347
|
+
}}
|
|
348
|
+
>
|
|
349
|
+
Required flag
|
|
350
|
+
</span>
|
|
351
|
+
<Diff
|
|
352
|
+
from={
|
|
353
|
+
changes.requiredChange.from ? 'required' : 'not required'
|
|
354
|
+
}
|
|
355
|
+
to={changes.requiredChange.to ? 'required' : 'not required'}
|
|
356
|
+
/>
|
|
357
|
+
</div>
|
|
358
|
+
</Row>
|
|
359
|
+
)}
|
|
360
|
+
{!!changes.castableDataTypeEntity && (
|
|
361
|
+
<Row icon={<i className='fa-regular fa-database' />}>
|
|
362
|
+
<div
|
|
363
|
+
style={{
|
|
364
|
+
display: 'flex',
|
|
365
|
+
flexDirection: 'column',
|
|
366
|
+
gap: 2,
|
|
367
|
+
}}
|
|
368
|
+
>
|
|
369
|
+
<span
|
|
370
|
+
style={{
|
|
371
|
+
fontSize: 13,
|
|
372
|
+
}}
|
|
373
|
+
>
|
|
374
|
+
Data type
|
|
375
|
+
</span>
|
|
376
|
+
<Diff
|
|
377
|
+
from={(() => {
|
|
378
|
+
const ent = editor.project.get(
|
|
379
|
+
changes.castableDataTypeEntity!.fromId,
|
|
380
|
+
);
|
|
381
|
+
return ent
|
|
382
|
+
? resolveEntityName(ent, editor.project)
|
|
383
|
+
: 'Unknown';
|
|
384
|
+
})()}
|
|
385
|
+
to={(() => {
|
|
386
|
+
const ent = editor.project.get(
|
|
387
|
+
changes.castableDataTypeEntity!.toId,
|
|
388
|
+
);
|
|
389
|
+
return ent
|
|
390
|
+
? resolveEntityName(ent, editor.project)
|
|
391
|
+
: 'Unknown';
|
|
392
|
+
})()}
|
|
393
|
+
/>
|
|
394
|
+
</div>
|
|
395
|
+
</Row>
|
|
396
|
+
)}
|
|
397
|
+
</div>
|
|
398
|
+
</div>
|
|
399
|
+
</div>
|
|
400
|
+
);
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
const Diff: React.FC<{
|
|
404
|
+
from?: React.ReactNode;
|
|
405
|
+
to?: React.ReactNode;
|
|
406
|
+
}> = ({ from, to }) => (
|
|
407
|
+
<div
|
|
408
|
+
style={{
|
|
409
|
+
display: 'flex',
|
|
410
|
+
alignItems: 'center',
|
|
411
|
+
gap: 6,
|
|
412
|
+
flexWrap: 'wrap',
|
|
413
|
+
}}
|
|
414
|
+
>
|
|
415
|
+
<span
|
|
416
|
+
style={{
|
|
417
|
+
fontFamily: 'monospace',
|
|
418
|
+
fontSize: 12,
|
|
419
|
+
border: '1px solid rgba(0,0,0,0.12)',
|
|
420
|
+
padding: '2px 6px',
|
|
421
|
+
borderRadius: 12,
|
|
422
|
+
}}
|
|
423
|
+
>
|
|
424
|
+
{String(from ?? '—')}
|
|
425
|
+
</span>
|
|
426
|
+
<i className='fa-regular fa-arrow-right' />
|
|
427
|
+
<span
|
|
428
|
+
style={{
|
|
429
|
+
fontFamily: 'monospace',
|
|
430
|
+
fontSize: 12,
|
|
431
|
+
background: 'rgba(99, 102, 241, 0.12)',
|
|
432
|
+
border: '1px solid rgba(99, 102, 241, 0.35)',
|
|
433
|
+
padding: '2px 6px',
|
|
434
|
+
borderRadius: 12,
|
|
435
|
+
}}
|
|
436
|
+
>
|
|
437
|
+
{String(to ?? '—')}
|
|
438
|
+
</span>
|
|
439
|
+
</div>
|
|
440
|
+
);
|
|
441
|
+
|
|
442
|
+
function getEntityIdFromDialogId(dialogId: string): string | null {
|
|
443
|
+
const match = dialogId.match(/^sql-migration-generated--(.+?)--\d+$/);
|
|
444
|
+
return match ? match[1] : null;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// localStorage flag, scoped to (project, user), that suppresses the
|
|
448
|
+
// upon-change "Live database transformation required" dialog until the user
|
|
449
|
+
// next manually engages with a row-transformer (via this same dialog or via
|
|
450
|
+
// the DefinitionEntityCard 3-dot menu). The publication preview's "you can't
|
|
451
|
+
// publish until you add these" gate intentionally does NOT clear the flag —
|
|
452
|
+
// the gate runs every time the user opens the preview anyway.
|
|
453
|
+
const SQL_MIGRATIONS_DEFER_KEY_PREFIX = 'sql-migrations:defer:';
|
|
454
|
+
|
|
455
|
+
function getDeferKey(editor: EditorService): string {
|
|
456
|
+
return `${SQL_MIGRATIONS_DEFER_KEY_PREFIX}${editor.projectId}:${editor.userAuthorId}`;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export function isSQLMigrationsGenerationDeferred(
|
|
460
|
+
editor: EditorService,
|
|
461
|
+
): boolean {
|
|
462
|
+
return window.localStorage.getItem(getDeferKey(editor)) === 'true';
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
export function setSQLMigrationsGenerationDeferred(
|
|
466
|
+
editor: EditorService,
|
|
467
|
+
value: boolean,
|
|
468
|
+
): void {
|
|
469
|
+
const key = getDeferKey(editor);
|
|
470
|
+
if (value) {
|
|
471
|
+
window.localStorage.setItem(key, 'true');
|
|
472
|
+
} else {
|
|
473
|
+
window.localStorage.removeItem(key);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
const requestedDialogsSet = new Set<string>();
|
|
478
|
+
|
|
479
|
+
export class SQLMigrationsGenerationModule
|
|
480
|
+
extends BaseRegisteredExtension
|
|
481
|
+
implements IRegisteredExtension<any>
|
|
482
|
+
{
|
|
483
|
+
manifest: ExtensionManifest = {
|
|
484
|
+
id: 'sql-migrations-generation-module',
|
|
485
|
+
version: '1.0.0',
|
|
486
|
+
description: 'Manages the generation of SQL migration entities',
|
|
487
|
+
initPriority: ExtentionPriority.High,
|
|
488
|
+
permissions: [ExtensionPermissions.All],
|
|
489
|
+
contexts: [ExtensionContextType.Editor, ExtensionContextType.Logic],
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
module = {
|
|
493
|
+
init: (contexts: (EditorService | DefaultProjectLogicContext)[]) => {
|
|
494
|
+
const editor = contexts.find(
|
|
495
|
+
(context) => context.contextType === ExtensionContextType.Editor,
|
|
496
|
+
) as EditorService;
|
|
497
|
+
|
|
498
|
+
if (!editor) {
|
|
499
|
+
throw new Error(
|
|
500
|
+
'No editor context found for SQLMigrationsGenerationModule',
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
editor.on(
|
|
505
|
+
ProjectStateEvents.PERSISTED_DEFINITION_ENTITY_UPDATED,
|
|
506
|
+
async (
|
|
507
|
+
updatedEntity: DefinitionEntityState,
|
|
508
|
+
changeSet: ChangeSet | null = editor.project.addChangeSet(
|
|
509
|
+
new ChangeSet(
|
|
510
|
+
editor.project,
|
|
511
|
+
ProjectState.sessionAuthor,
|
|
512
|
+
new Date().toISOString(),
|
|
513
|
+
editor.project,
|
|
514
|
+
false,
|
|
515
|
+
StateMutationAction.GenerateSQLMigrationOnPersistedEntityUpdate,
|
|
516
|
+
),
|
|
517
|
+
),
|
|
518
|
+
) => {
|
|
519
|
+
if (!editor.lastPublishedProjectState) {
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
const lastPublishedEntityVersion =
|
|
524
|
+
editor.lastPublishedProjectState.get(
|
|
525
|
+
updatedEntity.id,
|
|
526
|
+
) as DefinitionEntityState | null;
|
|
527
|
+
|
|
528
|
+
if (!lastPublishedEntityVersion) {
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
const dialogId =
|
|
533
|
+
'sql-migration-generated--' + updatedEntity.id + '--' + Date.now();
|
|
534
|
+
|
|
535
|
+
const diffs = resolveSQLMigrationsDiffs(
|
|
536
|
+
editor.logic,
|
|
537
|
+
editor.lastPublishedProjectState,
|
|
538
|
+
updatedEntity,
|
|
539
|
+
);
|
|
540
|
+
|
|
541
|
+
const {
|
|
542
|
+
newRowTransformerNeeded,
|
|
543
|
+
newestOpenRowTransformer,
|
|
544
|
+
newRequiredProperties,
|
|
545
|
+
deletedProperties,
|
|
546
|
+
newNonRequiredProperties,
|
|
547
|
+
propChanges,
|
|
548
|
+
isPreexistingRowTransformerUpToDate,
|
|
549
|
+
} = diffs;
|
|
550
|
+
|
|
551
|
+
if (
|
|
552
|
+
!newRowTransformerNeeded &&
|
|
553
|
+
isPreexistingRowTransformerUpToDate !== false
|
|
554
|
+
) {
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
// The user previously asked to defer migration prompts until they
|
|
559
|
+
// manually engage with a row-transformer or until publication time.
|
|
560
|
+
// Skip surfacing the dialog. The publication-preview gate will still
|
|
561
|
+
// block the publish, and the DefinitionEntityCard menu still works.
|
|
562
|
+
if (isSQLMigrationsGenerationDeferred(editor)) {
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// We want to avoid opening a dialog for this entity, if it extends another entity which already has an open dialog
|
|
567
|
+
if (
|
|
568
|
+
updatedEntity.extends &&
|
|
569
|
+
updatedEntity.extends.type === EntityType.DefinitionEntity
|
|
570
|
+
) {
|
|
571
|
+
const allExtendedEntities: DefinitionEntityState[] = [
|
|
572
|
+
updatedEntity.extends,
|
|
573
|
+
];
|
|
574
|
+
|
|
575
|
+
// const activeDialogs = editor.callbacks
|
|
576
|
+
// .getQueuedDynamicDialogs()
|
|
577
|
+
|
|
578
|
+
const activeDialogs = Array.from(requestedDialogsSet);
|
|
579
|
+
|
|
580
|
+
const otherActiveDialogs = activeDialogs.filter(
|
|
581
|
+
(d) => d !== dialogId,
|
|
582
|
+
);
|
|
583
|
+
|
|
584
|
+
let currentBaseEntity = updatedEntity.extends;
|
|
585
|
+
|
|
586
|
+
while (currentBaseEntity) {
|
|
587
|
+
if (
|
|
588
|
+
currentBaseEntity.extends &&
|
|
589
|
+
currentBaseEntity.extends.type === EntityType.DefinitionEntity
|
|
590
|
+
) {
|
|
591
|
+
currentBaseEntity = currentBaseEntity.extends;
|
|
592
|
+
allExtendedEntities.push(currentBaseEntity);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
break;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
for (const d of otherActiveDialogs) {
|
|
599
|
+
const entityIdFromDialog = getEntityIdFromDialogId(d);
|
|
600
|
+
|
|
601
|
+
if (entityIdFromDialog) {
|
|
602
|
+
const foundMatch = allExtendedEntities.find(
|
|
603
|
+
(ent) => ent.id === entityIdFromDialog,
|
|
604
|
+
);
|
|
605
|
+
if (foundMatch) {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
requestedDialogsSet.add(dialogId);
|
|
613
|
+
|
|
614
|
+
return new Promise<void>((_resolve) => {
|
|
615
|
+
const resolve = () => {
|
|
616
|
+
_resolve();
|
|
617
|
+
requestedDialogsSet.delete(dialogId);
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
editor.callbacks.requestSmallDynamicDialog(
|
|
621
|
+
async (handlers: {
|
|
622
|
+
close: (event: any) => Promise<void> | void;
|
|
623
|
+
}) => {
|
|
624
|
+
return {
|
|
625
|
+
id: dialogId,
|
|
626
|
+
component: (
|
|
627
|
+
<div
|
|
628
|
+
style={{
|
|
629
|
+
display: 'flex',
|
|
630
|
+
flexDirection: 'column',
|
|
631
|
+
height: '100%',
|
|
632
|
+
justifyContent: 'space-between',
|
|
633
|
+
}}
|
|
634
|
+
>
|
|
635
|
+
{/* TOP: header + body */}
|
|
636
|
+
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
637
|
+
{/* Header row (kept as-is) */}
|
|
638
|
+
<div
|
|
639
|
+
style={{
|
|
640
|
+
display: 'flex',
|
|
641
|
+
alignItems: 'center',
|
|
642
|
+
marginBottom: 12,
|
|
643
|
+
gap: 16,
|
|
644
|
+
}}
|
|
645
|
+
>
|
|
646
|
+
{/* <button
|
|
647
|
+
className='dialog_back_button'
|
|
648
|
+
onClick={(e) => {
|
|
649
|
+
// const {
|
|
650
|
+
// rowTransformer,
|
|
651
|
+
// } =
|
|
652
|
+
// createOrUpdateRowTransformer(
|
|
653
|
+
// editor.logic,
|
|
654
|
+
// diffs,
|
|
655
|
+
// changeSet
|
|
656
|
+
// );
|
|
657
|
+
|
|
658
|
+
// const objectId =
|
|
659
|
+
// getCanvasEntityDraggableContainerDOMId(
|
|
660
|
+
// rowTransformer
|
|
661
|
+
// );
|
|
662
|
+
// editor.canvas.scrollToObjectById(
|
|
663
|
+
// objectId
|
|
664
|
+
// );
|
|
665
|
+
|
|
666
|
+
handlers.close(e);
|
|
667
|
+
resolve();
|
|
668
|
+
}}
|
|
669
|
+
>
|
|
670
|
+
<i className='fa-solid fa-arrow-left' />
|
|
671
|
+
</button> */}
|
|
672
|
+
<h2 style={{ margin: 0, fontWeight: 500 }}>
|
|
673
|
+
Live database transformation required
|
|
674
|
+
</h2>
|
|
675
|
+
</div>
|
|
676
|
+
|
|
677
|
+
{/* Explanatory copy */}
|
|
678
|
+
<div
|
|
679
|
+
style={{
|
|
680
|
+
display: 'flex',
|
|
681
|
+
flexDirection: 'column',
|
|
682
|
+
gap: 8,
|
|
683
|
+
marginBottom: 16,
|
|
684
|
+
}}
|
|
685
|
+
>
|
|
686
|
+
<p style={{ margin: 0, color: 'rgba(0,0,0,0.54)' }}>
|
|
687
|
+
The latest changes to{' '}
|
|
688
|
+
<strong>{updatedEntity.name}</strong> require custom
|
|
689
|
+
logic to transform existing rows in the live
|
|
690
|
+
database.
|
|
691
|
+
</p>
|
|
692
|
+
|
|
693
|
+
{!!newestOpenRowTransformer ? (
|
|
694
|
+
<p style={{ margin: 0, color: 'rgba(0,0,0,0.54)' }}>
|
|
695
|
+
You can append the new logic to the most recent
|
|
696
|
+
open row transformer, or create a new one that
|
|
697
|
+
will run after it on publish.
|
|
698
|
+
</p>
|
|
699
|
+
) : (
|
|
700
|
+
<p style={{ margin: 0, color: 'rgba(0,0,0,0.54)' }}>
|
|
701
|
+
A new row transformer is needed to modify each row
|
|
702
|
+
into the new shape of the data structure when
|
|
703
|
+
publishing.
|
|
704
|
+
</p>
|
|
705
|
+
)}
|
|
706
|
+
|
|
707
|
+
<div
|
|
708
|
+
style={{
|
|
709
|
+
display: 'flex',
|
|
710
|
+
alignItems: 'center',
|
|
711
|
+
gap: 8,
|
|
712
|
+
marginTop: 18,
|
|
713
|
+
color: 'rgba(0,0,0,0.54)',
|
|
714
|
+
}}
|
|
715
|
+
>
|
|
716
|
+
<i className='fa-regular fa-circle-info' />
|
|
717
|
+
<span
|
|
718
|
+
style={{
|
|
719
|
+
fontSize: 12,
|
|
720
|
+
}}
|
|
721
|
+
>
|
|
722
|
+
Items in{' '}
|
|
723
|
+
<span style={{ color: '#ED6C02' /* amber */ }}>
|
|
724
|
+
amber
|
|
725
|
+
</span>{' '}
|
|
726
|
+
usually require transformation logic.
|
|
727
|
+
</span>
|
|
728
|
+
</div>
|
|
729
|
+
</div>
|
|
730
|
+
|
|
731
|
+
{/* ===== CHANGES SECTION ===== */}
|
|
732
|
+
<div
|
|
733
|
+
style={{
|
|
734
|
+
display: 'flex',
|
|
735
|
+
flexDirection: 'column',
|
|
736
|
+
gap: 10,
|
|
737
|
+
marginBottom: 16,
|
|
738
|
+
}}
|
|
739
|
+
>
|
|
740
|
+
{/* New required */}
|
|
741
|
+
{newRequiredProperties.length > 0 && (
|
|
742
|
+
<Section
|
|
743
|
+
title='New required properties'
|
|
744
|
+
subtitle='These will block rows unless you populate a value'
|
|
745
|
+
count={newRequiredProperties.length}
|
|
746
|
+
icon={
|
|
747
|
+
<i className='fa-regular fa-triangle-exclamation' />
|
|
748
|
+
}
|
|
749
|
+
iconColor={'#ED6C02' /* amber */}
|
|
750
|
+
>
|
|
751
|
+
{newRequiredProperties.map((prop) => (
|
|
752
|
+
<Row
|
|
753
|
+
key={prop.id + '-new-required'}
|
|
754
|
+
icon={
|
|
755
|
+
<i className='fa-regular fa-circle-plus' />
|
|
756
|
+
}
|
|
757
|
+
color={'#ED6C02'}
|
|
758
|
+
>
|
|
759
|
+
<span>
|
|
760
|
+
Required property{' '}
|
|
761
|
+
<strong>{prop.name}</strong> added
|
|
762
|
+
</span>
|
|
763
|
+
</Row>
|
|
764
|
+
))}
|
|
765
|
+
</Section>
|
|
766
|
+
)}
|
|
767
|
+
|
|
768
|
+
{/* New optional */}
|
|
769
|
+
{newNonRequiredProperties.length > 0 && (
|
|
770
|
+
<Section
|
|
771
|
+
title='New optional properties'
|
|
772
|
+
subtitle='Will backfill with defaults if provided'
|
|
773
|
+
count={newNonRequiredProperties.length}
|
|
774
|
+
icon={<i className='fa-regular fa-circle-plus' />}
|
|
775
|
+
iconColor={'#2e7d32'}
|
|
776
|
+
>
|
|
777
|
+
{newNonRequiredProperties.map((prop) => (
|
|
778
|
+
<Row
|
|
779
|
+
key={prop.id + '-new-non-required'}
|
|
780
|
+
icon={
|
|
781
|
+
<i className='fa-regular fa-circle-plus' />
|
|
782
|
+
}
|
|
783
|
+
color={'#2e7d32'}
|
|
784
|
+
>
|
|
785
|
+
<span>
|
|
786
|
+
Property <strong>{prop.name}</strong> added
|
|
787
|
+
</span>
|
|
788
|
+
</Row>
|
|
789
|
+
))}
|
|
790
|
+
</Section>
|
|
791
|
+
)}
|
|
792
|
+
|
|
793
|
+
{/* Deleted */}
|
|
794
|
+
{deletedProperties.length > 0 && (
|
|
795
|
+
<Section
|
|
796
|
+
title='Deleted properties'
|
|
797
|
+
subtitle='Values will be dropped from existing rows'
|
|
798
|
+
count={deletedProperties.length}
|
|
799
|
+
icon={
|
|
800
|
+
<i className='fa-regular fa-circle-minus' />
|
|
801
|
+
}
|
|
802
|
+
iconColor={'#d32f2f'}
|
|
803
|
+
>
|
|
804
|
+
{deletedProperties.map((prop) => (
|
|
805
|
+
<Row
|
|
806
|
+
key={prop.id + '-deleted'}
|
|
807
|
+
icon={
|
|
808
|
+
<i className='fa-regular fa-circle-minus' />
|
|
809
|
+
}
|
|
810
|
+
color={'#d32f2f'}
|
|
811
|
+
>
|
|
812
|
+
<span>
|
|
813
|
+
Property <strong>{prop.name}</strong>{' '}
|
|
814
|
+
deleted
|
|
815
|
+
</span>
|
|
816
|
+
</Row>
|
|
817
|
+
))}
|
|
818
|
+
</Section>
|
|
819
|
+
)}
|
|
820
|
+
|
|
821
|
+
{/* Modified */}
|
|
822
|
+
{Array.from(propChanges.keys()).length > 0 && (
|
|
823
|
+
<Section
|
|
824
|
+
title='Modified properties'
|
|
825
|
+
subtitle='Inspect name, required flag, and data type changes'
|
|
826
|
+
count={Array.from(propChanges.keys()).length}
|
|
827
|
+
icon={
|
|
828
|
+
<i className='fa-regular fa-pen-to-square' />
|
|
829
|
+
}
|
|
830
|
+
>
|
|
831
|
+
<div
|
|
832
|
+
style={{
|
|
833
|
+
display: 'flex',
|
|
834
|
+
flexDirection: 'column',
|
|
835
|
+
gap: 8,
|
|
836
|
+
}}
|
|
837
|
+
>
|
|
838
|
+
{Array.from(propChanges.entries()).map(
|
|
839
|
+
([propId, changes]) => (
|
|
840
|
+
<PropChangeCard
|
|
841
|
+
key={propId + '-changes'}
|
|
842
|
+
propId={propId}
|
|
843
|
+
changes={changes}
|
|
844
|
+
editor={editor}
|
|
845
|
+
/>
|
|
846
|
+
),
|
|
847
|
+
)}
|
|
848
|
+
</div>
|
|
849
|
+
</Section>
|
|
850
|
+
)}
|
|
851
|
+
</div>
|
|
852
|
+
</div>
|
|
853
|
+
|
|
854
|
+
<div
|
|
855
|
+
style={{
|
|
856
|
+
marginTop: 16,
|
|
857
|
+
display: 'flex',
|
|
858
|
+
justifyContent: 'center',
|
|
859
|
+
flexDirection: 'column',
|
|
860
|
+
gap: 10,
|
|
861
|
+
alignItems: 'center',
|
|
862
|
+
}}
|
|
863
|
+
>
|
|
864
|
+
<p
|
|
865
|
+
style={{
|
|
866
|
+
margin: 0,
|
|
867
|
+
fontSize: 10,
|
|
868
|
+
color: 'rgba(0,0,0,0.54)',
|
|
869
|
+
textAlign: 'center',
|
|
870
|
+
}}
|
|
871
|
+
>
|
|
872
|
+
All transformers are executed in order when the
|
|
873
|
+
project is published again.
|
|
874
|
+
<br />
|
|
875
|
+
Test databases might be reset or lose some entries
|
|
876
|
+
from this change.
|
|
877
|
+
</p>
|
|
878
|
+
{diffs.extendedEntities.length > 0 && (
|
|
879
|
+
<>
|
|
880
|
+
<p
|
|
881
|
+
style={{
|
|
882
|
+
margin: 0,
|
|
883
|
+
fontSize: 10,
|
|
884
|
+
color: 'rgba(0,0,0,0.8)',
|
|
885
|
+
textAlign: 'center',
|
|
886
|
+
fontStyle: 'italic',
|
|
887
|
+
fontWeight: '600',
|
|
888
|
+
}}
|
|
889
|
+
>
|
|
890
|
+
NOTE:
|
|
891
|
+
</p>
|
|
892
|
+
<div
|
|
893
|
+
style={{
|
|
894
|
+
display: 'flex',
|
|
895
|
+
justifyContent: 'center',
|
|
896
|
+
flexDirection: 'column',
|
|
897
|
+
gap: 2,
|
|
898
|
+
alignItems: 'center',
|
|
899
|
+
}}
|
|
900
|
+
>
|
|
901
|
+
<p
|
|
902
|
+
style={{
|
|
903
|
+
margin: 0,
|
|
904
|
+
fontSize: 10,
|
|
905
|
+
color: 'rgba(0,0,0,0.54)',
|
|
906
|
+
textAlign: 'center',
|
|
907
|
+
}}
|
|
908
|
+
>
|
|
909
|
+
Extension nodes will each get their respective
|
|
910
|
+
row transformers too:
|
|
911
|
+
</p>
|
|
912
|
+
<p
|
|
913
|
+
style={{
|
|
914
|
+
margin: 0,
|
|
915
|
+
fontSize: 10,
|
|
916
|
+
color: 'rgba(0,0,0,0.8)',
|
|
917
|
+
textAlign: 'center',
|
|
918
|
+
fontWeight: '600',
|
|
919
|
+
}}
|
|
920
|
+
>
|
|
921
|
+
{diffs.extendedEntities
|
|
922
|
+
.map((ent) => ent.updatedEntityVersion.name)
|
|
923
|
+
.join(', ')}
|
|
924
|
+
</p>
|
|
925
|
+
</div>
|
|
926
|
+
</>
|
|
927
|
+
)}
|
|
928
|
+
{(newRowTransformerNeeded ||
|
|
929
|
+
isPreexistingRowTransformerUpToDate !== true) && (
|
|
930
|
+
<div
|
|
931
|
+
style={{
|
|
932
|
+
display: 'flex',
|
|
933
|
+
flexDirection: 'column',
|
|
934
|
+
alignItems: 'stretch',
|
|
935
|
+
gap: 8,
|
|
936
|
+
width: '100%',
|
|
937
|
+
}}
|
|
938
|
+
>
|
|
939
|
+
<Button
|
|
940
|
+
size='medium'
|
|
941
|
+
variant={
|
|
942
|
+
!!newestOpenRowTransformer
|
|
943
|
+
? 'outlined'
|
|
944
|
+
: 'contained'
|
|
945
|
+
}
|
|
946
|
+
onClick={(e: any) => {
|
|
947
|
+
const { rowTransformer } =
|
|
948
|
+
createOrUpdateRowTransformer(
|
|
949
|
+
editor.logic,
|
|
950
|
+
diffs,
|
|
951
|
+
changeSet,
|
|
952
|
+
);
|
|
953
|
+
|
|
954
|
+
diffs.extendedEntities.forEach((extDiffs, i) => {
|
|
955
|
+
createOrUpdateRowTransformer(
|
|
956
|
+
editor.logic,
|
|
957
|
+
extDiffs,
|
|
958
|
+
changeSet,
|
|
959
|
+
{ x: (i + 1) * 600, y: 800 },
|
|
960
|
+
);
|
|
961
|
+
});
|
|
962
|
+
|
|
963
|
+
// User just engaged with row transformers
|
|
964
|
+
// manually → reset deferral so the next round
|
|
965
|
+
// of changes prompts again.
|
|
966
|
+
setSQLMigrationsGenerationDeferred(
|
|
967
|
+
editor,
|
|
968
|
+
false,
|
|
969
|
+
);
|
|
970
|
+
|
|
971
|
+
const objectId =
|
|
972
|
+
getCanvasEntityDraggableContainerDOMId(
|
|
973
|
+
rowTransformer,
|
|
974
|
+
);
|
|
975
|
+
editor.canvas.scrollToObjectById(objectId);
|
|
976
|
+
|
|
977
|
+
handlers.close(e);
|
|
978
|
+
resolve();
|
|
979
|
+
}}
|
|
980
|
+
>
|
|
981
|
+
{!!newestOpenRowTransformer
|
|
982
|
+
? 'Add to existing'
|
|
983
|
+
: 'Add new row transformer'}
|
|
984
|
+
</Button>
|
|
985
|
+
<Button
|
|
986
|
+
size='medium'
|
|
987
|
+
variant='text'
|
|
988
|
+
onClick={(e: any) => {
|
|
989
|
+
// Remember the user's choice to defer migration
|
|
990
|
+
// authoring. The dialog stays silent until they
|
|
991
|
+
// manually create or update a transformer (here
|
|
992
|
+
// or via the DefinitionEntityCard menu).
|
|
993
|
+
setSQLMigrationsGenerationDeferred(editor, true);
|
|
994
|
+
handlers.close(e);
|
|
995
|
+
resolve();
|
|
996
|
+
}}
|
|
997
|
+
>
|
|
998
|
+
Add later
|
|
999
|
+
</Button>
|
|
1000
|
+
<span
|
|
1001
|
+
style={{
|
|
1002
|
+
fontSize: 11,
|
|
1003
|
+
color: 'rgba(0,0,0,0.54)',
|
|
1004
|
+
textAlign: 'center',
|
|
1005
|
+
marginTop: -4,
|
|
1006
|
+
}}
|
|
1007
|
+
>
|
|
1008
|
+
You'll be asked again before publication
|
|
1009
|
+
</span>
|
|
1010
|
+
</div>
|
|
1011
|
+
)}
|
|
1012
|
+
</div>
|
|
1013
|
+
</div>
|
|
1014
|
+
),
|
|
1015
|
+
props: {
|
|
1016
|
+
onMount: (_htmlElement: HTMLElement) => {},
|
|
1017
|
+
onUpdate: (_htmlElement: HTMLElement) => {},
|
|
1018
|
+
onBeforeUpdate: () => {},
|
|
1019
|
+
onUnmount: () => {},
|
|
1020
|
+
onClose: (_event: any) => {
|
|
1021
|
+
Logger.log('Before closing dialog');
|
|
1022
|
+
|
|
1023
|
+
const { rowTransformer } = createOrUpdateRowTransformer(
|
|
1024
|
+
editor.logic,
|
|
1025
|
+
diffs,
|
|
1026
|
+
changeSet,
|
|
1027
|
+
);
|
|
1028
|
+
|
|
1029
|
+
// Dismissing the dialog auto-creates/updates the
|
|
1030
|
+
// transformer; treat that as the user engaging with
|
|
1031
|
+
// migrations and clear any prior deferral.
|
|
1032
|
+
setSQLMigrationsGenerationDeferred(editor, false);
|
|
1033
|
+
|
|
1034
|
+
const objectId =
|
|
1035
|
+
getCanvasEntityDraggableContainerDOMId(rowTransformer);
|
|
1036
|
+
editor.canvas.scrollToObjectById(objectId);
|
|
1037
|
+
|
|
1038
|
+
resolve();
|
|
1039
|
+
},
|
|
1040
|
+
style: {
|
|
1041
|
+
minWidth: '480px',
|
|
1042
|
+
// Max width, calculate full width minus 64px (32px margin on each side)
|
|
1043
|
+
maxWidth: 'calc(100vw - 64px)',
|
|
1044
|
+
},
|
|
1045
|
+
},
|
|
1046
|
+
};
|
|
1047
|
+
},
|
|
1048
|
+
);
|
|
1049
|
+
});
|
|
1050
|
+
},
|
|
1051
|
+
);
|
|
1052
|
+
},
|
|
1053
|
+
};
|
|
1054
|
+
}
|