@solidxai/core-ui 0.1.14-beta.0 → 0.1.14-beta.10
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/dist/components/auth/AuthLayout.js +1 -1
- package/dist/components/auth/AuthLayout.js.map +1 -1
- package/dist/components/auth/AuthLayout.tsx +2 -2
- package/dist/components/common/SettingsComponent.module.css +4 -1
- package/dist/components/common/SolidFieldTooltip.d.ts.map +1 -1
- package/dist/components/common/SolidFieldTooltip.js +1 -1
- package/dist/components/common/SolidFieldTooltip.js.map +1 -1
- package/dist/components/common/SolidFieldTooltip.tsx +1 -0
- package/dist/components/common/SolidFormStepper.d.ts.map +1 -1
- package/dist/components/common/SolidFormStepper.js +7 -6
- package/dist/components/common/SolidFormStepper.js.map +1 -1
- package/dist/components/common/SolidFormStepper.tsx +7 -1
- package/dist/components/common/SolidThemeProvider.d.ts.map +1 -1
- package/dist/components/common/SolidThemeProvider.js +127 -11
- package/dist/components/common/SolidThemeProvider.js.map +1 -1
- package/dist/components/common/SolidThemeProvider.tsx +104 -22
- package/dist/components/core/card/CardGrid.d.ts +1 -1
- package/dist/components/core/card/CardGrid.d.ts.map +1 -1
- package/dist/components/core/card/CardGrid.js +2 -2
- package/dist/components/core/card/CardGrid.js.map +1 -1
- package/dist/components/core/card/CardGrid.tsx +6 -0
- package/dist/components/core/card/CardItem.d.ts +3 -0
- package/dist/components/core/card/CardItem.d.ts.map +1 -1
- package/dist/components/core/card/CardItem.js +5 -4
- package/dist/components/core/card/CardItem.js.map +1 -1
- package/dist/components/core/card/CardItem.tsx +18 -1
- package/dist/components/core/card/SolidCardView.d.ts +28 -1
- package/dist/components/core/card/SolidCardView.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardView.js +117 -46
- package/dist/components/core/card/SolidCardView.js.map +1 -1
- package/dist/components/core/card/SolidCardView.tsx +141 -27
- package/dist/components/core/card/SolidCardViewConfigure.d.ts +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.js +15 -6
- package/dist/components/core/card/SolidCardViewConfigure.js.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.tsx +34 -0
- package/dist/components/core/card/cardViewRegistry.d.ts +7 -0
- package/dist/components/core/card/cardViewRegistry.d.ts.map +1 -0
- package/dist/components/core/card/cardViewRegistry.js +17 -0
- package/dist/components/core/card/cardViewRegistry.js.map +1 -0
- package/dist/components/core/card/cardViewRegistry.ts +23 -0
- package/dist/components/core/chatter/useChatterMentions.js +11 -12
- package/dist/components/core/chatter/useChatterMentions.js.map +1 -1
- package/dist/components/core/chatter/useChatterMentions.ts +6 -6
- package/dist/components/core/common/PDFViewer.d.ts +19 -3
- package/dist/components/core/common/PDFViewer.d.ts.map +1 -1
- package/dist/components/core/common/PDFViewer.js +16 -92
- package/dist/components/core/common/PDFViewer.js.map +1 -1
- package/dist/components/core/common/PDFViewer.tsx +43 -106
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.d.ts.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.js +27 -7
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.js.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.tsx +19 -4
- package/dist/components/core/common/SolidAccountSettings/SolidVersionInfo.d.ts.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidVersionInfo.js +14 -11
- package/dist/components/core/common/SolidAccountSettings/SolidVersionInfo.js.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidVersionInfo.tsx +5 -1
- package/dist/components/core/common/SolidCollectionRowActionMenuItems.d.ts +12 -0
- package/dist/components/core/common/SolidCollectionRowActionMenuItems.d.ts.map +1 -0
- package/dist/components/core/common/SolidCollectionRowActionMenuItems.js +50 -0
- package/dist/components/core/common/SolidCollectionRowActionMenuItems.js.map +1 -0
- package/dist/components/core/common/SolidCollectionRowActionMenuItems.tsx +91 -0
- package/dist/components/core/common/SolidCreateButton.d.ts.map +1 -1
- package/dist/components/core/common/SolidCreateButton.js +2 -2
- package/dist/components/core/common/SolidCreateButton.js.map +1 -1
- package/dist/components/core/common/SolidCreateButton.tsx +22 -2
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +247 -170
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +255 -117
- package/dist/components/core/common/globalSearchPersistence.d.ts +0 -1
- package/dist/components/core/common/globalSearchPersistence.d.ts.map +1 -1
- package/dist/components/core/common/globalSearchPersistence.js +4 -6
- package/dist/components/core/common/globalSearchPersistence.js.map +1 -1
- package/dist/components/core/common/globalSearchPersistence.ts +4 -4
- package/dist/components/core/extension/solid-core/media/card/MediaCardWidget.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/media/card/MediaCardWidget.js +2 -13
- package/dist/components/core/extension/solid-core/media/card/MediaCardWidget.js.map +1 -1
- package/dist/components/core/extension/solid-core/media/card/MediaCardWidget.tsx +2 -10
- package/dist/components/core/extension/solid-core/media/fileSize/MediaFileSizeWidget.d.ts +5 -0
- package/dist/components/core/extension/solid-core/media/fileSize/MediaFileSizeWidget.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/media/fileSize/MediaFileSizeWidget.js +34 -0
- package/dist/components/core/extension/solid-core/media/fileSize/MediaFileSizeWidget.js.map +1 -0
- package/dist/components/core/extension/solid-core/media/fileSize/MediaFileSizeWidget.tsx +47 -0
- package/dist/components/core/extension/solid-core/media/relativeUri/MediaRelativeUriPreview.d.ts +4 -0
- package/dist/components/core/extension/solid-core/media/relativeUri/MediaRelativeUriPreview.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/media/relativeUri/MediaRelativeUriPreview.js +109 -0
- package/dist/components/core/extension/solid-core/media/relativeUri/MediaRelativeUriPreview.js.map +1 -0
- package/dist/components/core/extension/solid-core/media/relativeUri/MediaRelativeUriPreview.tsx +228 -0
- package/dist/components/core/form/SolidDraftPublishWorkflow.d.ts +32 -0
- package/dist/components/core/form/SolidDraftPublishWorkflow.d.ts.map +1 -0
- package/dist/components/core/form/SolidDraftPublishWorkflow.js +228 -0
- package/dist/components/core/form/SolidDraftPublishWorkflow.js.map +1 -0
- package/dist/components/core/form/SolidDraftPublishWorkflow.tsx +234 -0
- package/dist/components/core/form/SolidFormActionHeader.d.ts +1 -1
- package/dist/components/core/form/SolidFormActionHeader.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.js +68 -41
- package/dist/components/core/form/SolidFormActionHeader.js.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.tsx +170 -79
- package/dist/components/core/form/SolidFormView.d.ts +2 -0
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +129 -125
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +111 -95
- package/dist/components/core/form/SolidVersionHistory.d.ts +12 -0
- package/dist/components/core/form/SolidVersionHistory.d.ts.map +1 -0
- package/dist/components/core/form/SolidVersionHistory.js +125 -0
- package/dist/components/core/form/SolidVersionHistory.js.map +1 -0
- package/dist/components/core/form/SolidVersionHistory.tsx +159 -0
- package/dist/components/core/form/fields/ISolidField.d.ts +2 -0
- package/dist/components/core/form/fields/ISolidField.d.ts.map +1 -1
- package/dist/components/core/form/fields/ISolidField.js.map +1 -1
- package/dist/components/core/form/fields/ISolidField.tsx +2 -0
- package/dist/components/core/form/fields/SolidDateField.d.ts +1 -2
- package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.js +0 -7
- package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.tsx +1 -13
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.js +17 -7
- package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +10 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +28 -11
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +17 -2
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts +1 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +13 -9
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +17 -6
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts +1 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +1 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +2 -0
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts +1 -0
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +13 -13
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +16 -11
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.js +2 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.js.map +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.tsx +2 -1
- package/dist/components/core/kanban/KanbanBoard.d.ts +1 -1
- package/dist/components/core/kanban/KanbanBoard.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanBoard.js +2 -2
- package/dist/components/core/kanban/KanbanBoard.js.map +1 -1
- package/dist/components/core/kanban/KanbanBoard.tsx +4 -1
- package/dist/components/core/kanban/KanbanCard.d.ts +3 -0
- package/dist/components/core/kanban/KanbanCard.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanCard.js +5 -3
- package/dist/components/core/kanban/KanbanCard.js.map +1 -1
- package/dist/components/core/kanban/KanbanCard.tsx +16 -2
- package/dist/components/core/kanban/KanbanColumn.d.ts +4 -1
- package/dist/components/core/kanban/KanbanColumn.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanColumn.js +2 -2
- package/dist/components/core/kanban/KanbanColumn.js.map +1 -1
- package/dist/components/core/kanban/KanbanColumn.tsx +5 -2
- package/dist/components/core/kanban/SolidKanbanView.d.ts +25 -1
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +114 -55
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +112 -24
- package/dist/components/core/kanban/kanbanViewRegistry.d.ts +7 -0
- package/dist/components/core/kanban/kanbanViewRegistry.d.ts.map +1 -0
- package/dist/components/core/kanban/kanbanViewRegistry.js +17 -0
- package/dist/components/core/kanban/kanbanViewRegistry.js.map +1 -0
- package/dist/components/core/kanban/kanbanViewRegistry.ts +23 -0
- package/dist/components/core/list/PLAN.md +1 -1
- package/dist/components/core/list/SolidListView.d.ts +11 -0
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +160 -104
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +156 -84
- package/dist/components/core/list/SolidListViewConfigure.js +1 -1
- package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.tsx +1 -1
- package/dist/components/core/list/SolidTableRowCell.js +1 -1
- package/dist/components/core/list/SolidTableRowCell.js.map +1 -1
- package/dist/components/core/list/SolidTableRowCell.tsx +1 -1
- package/dist/components/core/list/columns/PublishStatusColumnDefaults.d.ts +3 -0
- package/dist/components/core/list/columns/PublishStatusColumnDefaults.d.ts.map +1 -0
- package/dist/components/core/list/columns/PublishStatusColumnDefaults.js +23 -0
- package/dist/components/core/list/columns/PublishStatusColumnDefaults.js.map +1 -0
- package/dist/components/core/list/columns/PublishStatusColumnDefaults.ts +26 -0
- package/dist/components/core/list/columns/SolidBooleanColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js +3 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.tsx +2 -1
- package/dist/components/core/list/columns/SolidDateColumn.d.ts +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.js +7 -6
- package/dist/components/core/list/columns/SolidDateColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.tsx +8 -4
- package/dist/components/core/list/columns/SolidDatetimeColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.js +6 -4
- package/dist/components/core/list/columns/SolidDatetimeColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.tsx +3 -3
- package/dist/components/core/list/columns/SolidIntColumn.js +3 -3
- package/dist/components/core/list/columns/SolidIntColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidIntColumn.tsx +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js +5 -5
- package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.tsx +2 -2
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +2 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +2 -1
- package/dist/components/core/list/widgets/PublishedStatusListViewWidget.d.ts +3 -0
- package/dist/components/core/list/widgets/PublishedStatusListViewWidget.d.ts.map +1 -0
- package/dist/components/core/list/widgets/PublishedStatusListViewWidget.js +12 -0
- package/dist/components/core/list/widgets/PublishedStatusListViewWidget.js.map +1 -0
- package/dist/components/core/list/widgets/PublishedStatusListViewWidget.module.css +37 -0
- package/dist/components/core/list/widgets/PublishedStatusListViewWidget.tsx +22 -0
- package/dist/components/core/locales/SolidChatterLocaleTabView.d.ts +1 -0
- package/dist/components/core/locales/SolidChatterLocaleTabView.d.ts.map +1 -1
- package/dist/components/core/locales/SolidChatterLocaleTabView.js +2 -2
- package/dist/components/core/locales/SolidChatterLocaleTabView.js.map +1 -1
- package/dist/components/core/locales/SolidChatterLocaleTabView.tsx +3 -0
- package/dist/components/core/locales/SolidLocale.d.ts +2 -1
- package/dist/components/core/locales/SolidLocale.d.ts.map +1 -1
- package/dist/components/core/locales/SolidLocale.js +83 -11
- package/dist/components/core/locales/SolidLocale.js.map +1 -1
- package/dist/components/core/locales/SolidLocale.tsx +141 -52
- package/dist/components/core/locales/solid-locale.css +153 -44
- package/dist/components/core/model/CreateModel.d.ts.map +1 -1
- package/dist/components/core/model/CreateModel.js +2 -1
- package/dist/components/core/model/CreateModel.js.map +1 -1
- package/dist/components/core/model/CreateModel.tsx +2 -0
- package/dist/components/core/model/FieldMetaData.d.ts +1 -1
- package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaData.js +8 -8
- package/dist/components/core/model/FieldMetaData.js.map +1 -1
- package/dist/components/core/model/FieldMetaData.tsx +2 -2
- package/dist/components/core/model/FieldMetaDataForm.css +119 -0
- package/dist/components/core/model/FieldMetaDataForm.js +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.tsx +1 -1
- package/dist/components/core/module/ModuleMetadataExplorer.css +64 -0
- package/dist/components/core/module/ModulePackageDialog.css +117 -12
- package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
- package/dist/components/core/tree/SolidTreeView.js +94 -72
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +82 -57
- package/dist/components/layout/AdminHeaderActions.d.ts.map +1 -1
- package/dist/components/layout/AdminHeaderActions.js +15 -10
- package/dist/components/layout/AdminHeaderActions.js.map +1 -1
- package/dist/components/layout/AdminHeaderActions.tsx +15 -8
- package/dist/components/layout/AdminTopHeader.d.ts.map +1 -1
- package/dist/components/layout/AdminTopHeader.js +1 -18
- package/dist/components/layout/AdminTopHeader.js.map +1 -1
- package/dist/components/layout/AdminTopHeader.tsx +3 -21
- package/dist/components/layout/AppSidebar.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.js +9 -0
- package/dist/components/layout/AppSidebar.js.map +1 -1
- package/dist/components/layout/AppSidebar.tsx +14 -0
- package/dist/components/shad-cn-ui/SolidCodeEditor.d.ts +2 -1
- package/dist/components/shad-cn-ui/SolidCodeEditor.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidCodeEditor.js +2 -2
- package/dist/components/shad-cn-ui/SolidCodeEditor.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidCodeEditor.tsx +3 -0
- package/dist/components/shad-cn-ui/SolidDropdownMenu.js +1 -1
- package/dist/components/shad-cn-ui/SolidDropdownMenu.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidDropdownMenu.tsx +1 -1
- package/dist/components/workflow/WorkflowFlowCanvas.css +16 -0
- package/dist/components/workflow/WorkflowFlowCanvas.d.ts +3 -1
- package/dist/components/workflow/WorkflowFlowCanvas.d.ts.map +1 -1
- package/dist/components/workflow/WorkflowFlowCanvas.js +68 -6
- package/dist/components/workflow/WorkflowFlowCanvas.js.map +1 -1
- package/dist/components/workflow/WorkflowFlowCanvas.tsx +126 -8
- package/dist/components/workflow/WorkflowNodeSchemaEditor.css +204 -7
- package/dist/components/workflow/WorkflowNodeSchemaEditor.d.ts +3 -1
- package/dist/components/workflow/WorkflowNodeSchemaEditor.d.ts.map +1 -1
- package/dist/components/workflow/WorkflowNodeSchemaEditor.js +685 -47
- package/dist/components/workflow/WorkflowNodeSchemaEditor.js.map +1 -1
- package/dist/components/workflow/WorkflowNodeSchemaEditor.tsx +1108 -92
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +8 -5
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +8 -5
- package/dist/helpers/resolveActiveUserId.d.ts +13 -0
- package/dist/helpers/resolveActiveUserId.d.ts.map +1 -0
- package/dist/helpers/resolveActiveUserId.js +86 -0
- package/dist/helpers/resolveActiveUserId.js.map +1 -0
- package/dist/helpers/resolveActiveUserId.ts +90 -0
- package/dist/helpers/settingsPayload.d.ts +3 -0
- package/dist/helpers/settingsPayload.d.ts.map +1 -1
- package/dist/helpers/settingsPayload.js +9 -0
- package/dist/helpers/settingsPayload.js.map +1 -1
- package/dist/helpers/settingsPayload.ts +13 -0
- package/dist/hooks/useSession.d.ts.map +1 -1
- package/dist/hooks/useSession.js +12 -6
- package/dist/hooks/useSession.js.map +1 -1
- package/dist/hooks/useSession.ts +8 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +8 -1
- package/dist/redux/api/mediaApi.d.ts +2 -1
- package/dist/redux/api/mediaApi.d.ts.map +1 -1
- package/dist/redux/api/mediaApi.js +8 -1
- package/dist/redux/api/mediaApi.js.map +1 -1
- package/dist/redux/api/mediaApi.ts +8 -1
- package/dist/redux/api/solidChatterMessageApi.d.ts +2 -1
- package/dist/redux/api/solidChatterMessageApi.d.ts.map +1 -1
- package/dist/redux/api/solidChatterMessageApi.js +6 -1
- package/dist/redux/api/solidChatterMessageApi.js.map +1 -1
- package/dist/redux/api/solidChatterMessageApi.ts +6 -1
- package/dist/redux/store/defaultStoreConfig.d.ts +2 -0
- package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
- package/dist/redux/store/solidEntityApiPool.js +1 -1
- package/dist/redux/store/solidEntityApiPool.js.map +1 -1
- package/dist/redux/store/solidEntityApiPool.ts +1 -1
- package/dist/resources/globals.css +257 -1
- package/dist/resources/solid-custom.css +185 -18
- package/dist/resources/solid-tailwind-generated.css +1 -1
- package/dist/resources/themes/solid-dark-enterprise/theme-variables.css +28 -0
- package/dist/resources/themes/solid-dark-enterprise/theme.css +926 -0
- package/dist/resources/themes/solid-dark-modern/theme-variables.css +27 -0
- package/dist/resources/themes/solid-dark-modern/theme.css +600 -0
- package/dist/resources/themes/solid-light-enterprise/theme-variables.css +28 -0
- package/dist/resources/themes/solid-light-enterprise/theme.css +930 -0
- package/dist/resources/themes/solid-light-modern/theme-variables.css +31 -0
- package/dist/resources/themes/solid-light-modern/theme.css +1041 -0
- package/dist/routes/pages/admin/core/CardPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.js +15 -2
- package/dist/routes/pages/admin/core/CardPage.js.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.tsx +17 -2
- package/dist/routes/pages/admin/core/DashboardPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/DashboardPage.js +31 -3
- package/dist/routes/pages/admin/core/DashboardPage.js.map +1 -1
- package/dist/routes/pages/admin/core/DashboardPage.tsx +39 -11
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js +4 -0
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js.map +1 -1
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.tsx +4 -0
- package/dist/routes/pages/admin/core/KanbanPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.js +15 -2
- package/dist/routes/pages/admin/core/KanbanPage.js.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.tsx +17 -2
- package/dist/routes/pages/admin/core/ListPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.js +5 -13
- package/dist/routes/pages/admin/core/ListPage.js.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.tsx +5 -15
- package/dist/routes/pages/admin/core/MediaUploadPage.d.ts +2 -0
- package/dist/routes/pages/admin/core/MediaUploadPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/MediaUploadPage.js +267 -0
- package/dist/routes/pages/admin/core/MediaUploadPage.js.map +1 -0
- package/dist/routes/pages/admin/core/MediaUploadPage.tsx +363 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.js +88 -31
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.tsx +126 -19
- package/dist/routes/solidRoutes.js +2 -2
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +2 -2
- package/dist/theme/theme-registry.d.ts +6 -0
- package/dist/theme/theme-registry.d.ts.map +1 -0
- package/dist/theme/theme-registry.js +65 -0
- package/dist/theme/theme-registry.js.map +1 -0
- package/dist/theme/theme-registry.ts +78 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/solid-core.d.ts +25 -0
- package/dist/types/workflow-node.d.ts +1 -0
- package/dist/types/workflow-node.d.ts.map +1 -1
- package/dist/types/workflow-node.js.map +1 -1
- package/dist/types/workflow-node.ts +1 -0
- package/package.json +1 -2
|
@@ -44,7 +44,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
44
44
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
45
45
|
};
|
|
46
46
|
import { useEffect, useState } from 'react';
|
|
47
|
-
import {
|
|
47
|
+
import { useLazyGetMentionableUsersQuery } from '../../../redux/api/solidChatterMessageApi';
|
|
48
48
|
import { getMentionCandidate } from './chatterMentions';
|
|
49
49
|
export var useChatterMentions = function (_a) {
|
|
50
50
|
var value = _a.value, onChange = _a.onChange, textareaRef = _a.textareaRef;
|
|
@@ -53,7 +53,7 @@ export var useChatterMentions = function (_a) {
|
|
|
53
53
|
var _d = useState(null), mentionRange = _d[0], setMentionRange = _d[1];
|
|
54
54
|
var _e = useState([]), mentionSuggestions = _e[0], setMentionSuggestions = _e[1];
|
|
55
55
|
var _f = useState(0), activeMentionIndex = _f[0], setActiveMentionIndex = _f[1];
|
|
56
|
-
var _g =
|
|
56
|
+
var _g = useLazyGetMentionableUsersQuery(), getMentionableUsers = _g[0], isFetchingMentionUsers = _g[1].isFetching;
|
|
57
57
|
var closeMentionMenu = function () {
|
|
58
58
|
setMentionRange(null);
|
|
59
59
|
setMentionQuery('');
|
|
@@ -155,25 +155,24 @@ export var useChatterMentions = function (_a) {
|
|
|
155
155
|
var isActive = true;
|
|
156
156
|
var timeout = window.setTimeout(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
157
157
|
var encodedQuery, queryString, response, error_1;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
switch (_b.label) {
|
|
158
|
+
return __generator(this, function (_a) {
|
|
159
|
+
switch (_a.label) {
|
|
161
160
|
case 0:
|
|
162
|
-
|
|
161
|
+
_a.trys.push([0, 2, , 3]);
|
|
163
162
|
encodedQuery = encodeURIComponent(mentionQuery);
|
|
164
163
|
queryString = mentionQuery
|
|
165
|
-
? "
|
|
164
|
+
? "search=".concat(encodedQuery, "&limit=8")
|
|
166
165
|
: 'limit=8';
|
|
167
|
-
return [4 /*yield*/,
|
|
166
|
+
return [4 /*yield*/, getMentionableUsers(queryString).unwrap()];
|
|
168
167
|
case 1:
|
|
169
|
-
response =
|
|
168
|
+
response = _a.sent();
|
|
170
169
|
if (!isActive)
|
|
171
170
|
return [2 /*return*/];
|
|
172
|
-
setMentionSuggestions((
|
|
171
|
+
setMentionSuggestions((response === null || response === void 0 ? void 0 : response.data) || []);
|
|
173
172
|
setActiveMentionIndex(0);
|
|
174
173
|
return [3 /*break*/, 3];
|
|
175
174
|
case 2:
|
|
176
|
-
error_1 =
|
|
175
|
+
error_1 = _a.sent();
|
|
177
176
|
if (isActive)
|
|
178
177
|
setMentionSuggestions([]);
|
|
179
178
|
return [3 /*break*/, 3];
|
|
@@ -185,7 +184,7 @@ export var useChatterMentions = function (_a) {
|
|
|
185
184
|
isActive = false;
|
|
186
185
|
window.clearTimeout(timeout);
|
|
187
186
|
};
|
|
188
|
-
}, [mentionQuery, mentionRange,
|
|
187
|
+
}, [mentionQuery, mentionRange, getMentionableUsers]);
|
|
189
188
|
return {
|
|
190
189
|
mentions: mentions,
|
|
191
190
|
setMentions: setMentions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChatterMentions.js","sourceRoot":"","sources":["../../../../src/components/core/chatter/useChatterMentions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAyE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnH,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAkB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAQxE,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAAC,EAAyD;QAAvD,KAAK,WAAA,EAAE,QAAQ,cAAA,EAAE,WAAW,iBAAA;IACvD,IAAA,KAA0B,QAAQ,CAAmB,EAAE,CAAC,EAAvD,QAAQ,QAAA,EAAE,WAAW,QAAkC,CAAC;IACzD,IAAA,KAAkC,QAAQ,CAAC,EAAE,CAAC,EAA7C,YAAY,QAAA,EAAE,eAAe,QAAgB,CAAC;IAC/C,IAAA,KAAkC,QAAQ,CAAwC,IAAI,CAAC,EAAtF,YAAY,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AC;;;;;aAE/C,EAAE,GAAG,CAAC,CAAC;QAER,OAAO;YACH,QAAQ,GAAG,KAAK,CAAC;YACjB,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE3C,OAAO;QACH,QAAQ,UAAA;QACR,WAAW,aAAA;QACX,YAAY,cAAA;QACZ,kBAAkB,oBAAA;QAClB,kBAAkB,oBAAA;QAClB,sBAAsB,wBAAA;QACtB,uBAAuB,yBAAA;QACvB,oBAAoB,sBAAA;QACpB,kBAAkB,oBAAA;QAClB,kBAAkB,oBAAA;QAClB,mBAAmB,qBAAA;QACnB,aAAa,eAAA;KAChB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { type ChangeEvent, type KeyboardEvent, type MouseEvent, type RefObject, useEffect, useState } from 'react';\nimport { useLazyGetusersQuery } from '../../../redux/api/userApi';\nimport { ChatterMention, getMentionCandidate } from './chatterMentions';\n\ninterface UseChatterMentionsProps {\n value: string;\n onChange: (value: string) => void;\n textareaRef: RefObject<HTMLTextAreaElement | null>;\n}\n\nexport const useChatterMentions = ({ value, onChange, textareaRef }: UseChatterMentionsProps) => {\n const [mentions, setMentions] = useState<ChatterMention[]>([]);\n const [mentionQuery, setMentionQuery] = useState('');\n const [mentionRange, setMentionRange] = useState<{ start: number; end: number } | null>(null);\n const [mentionSuggestions, setMentionSuggestions] = useState<any[]>([]);\n const [activeMentionIndex, setActiveMentionIndex] = useState(0);\n const [getUsers, { isFetching: isFetchingMentionUsers }] = useLazyGetusersQuery();\n\n const closeMentionMenu = () => {\n setMentionRange(null);\n setMentionQuery('');\n setMentionSuggestions([]);\n setActiveMentionIndex(0);\n };\n\n const updateMentionState = (nextValue: string, cursorPosition: number) => {\n const candidate = getMentionCandidate(nextValue, cursorPosition);\n if (!candidate) {\n closeMentionMenu();\n return;\n }\n\n setMentionRange({ start: candidate.start, end: candidate.end });\n setMentionQuery(candidate.query);\n };\n\n const handleMentionTextChange = (event: ChangeEvent<HTMLTextAreaElement>) => {\n const nextValue = event.target.value;\n onChange(nextValue);\n updateMentionState(nextValue, event.target.selectionStart ?? nextValue.length);\n };\n\n const handleMentionKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (!mentionRange) return;\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n setActiveMentionIndex(prev => {\n if (mentionSuggestions.length === 0) return 0;\n return (prev + 1) % mentionSuggestions.length;\n });\n return;\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n setActiveMentionIndex(prev => {\n if (mentionSuggestions.length === 0) return 0;\n return (prev - 1 + mentionSuggestions.length) % mentionSuggestions.length;\n });\n return;\n }\n\n if (event.key === 'Enter' || event.key === 'Tab') {\n if (mentionSuggestions[activeMentionIndex]) {\n event.preventDefault();\n handleSelectMention(mentionSuggestions[activeMentionIndex]);\n }\n return;\n }\n\n if (event.key === 'Escape') {\n event.preventDefault();\n closeMentionMenu();\n }\n };\n\n const handleMentionKeyUp = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (['ArrowDown', 'ArrowUp', 'Enter', 'Tab', 'Escape'].includes(event.key)) return;\n const target = event.currentTarget;\n updateMentionState(target.value, target.selectionStart ?? target.value.length);\n };\n\n const handleMentionClick = (event: MouseEvent<HTMLTextAreaElement>) => {\n updateMentionState(event.currentTarget.value, event.currentTarget.selectionStart ?? event.currentTarget.value.length);\n };\n\n const handleSelectMention = (user: any) => {\n if (!mentionRange) return;\n const username = user?.username;\n if (!username) return;\n\n const mention: ChatterMention = {\n username,\n display_name: user?.fullName || username,\n id: String(user?.id),\n };\n const mentionText = `@${mention.username}`;\n const nextValue = `${value.slice(0, mentionRange.start)}${mentionText} ${value.slice(mentionRange.end)}`;\n const nextCursorPosition = mentionRange.start + mentionText.length + 1;\n\n onChange(nextValue);\n setMentions(prev => (\n prev.some(item => item.id === mention.id || item.username === mention.username)\n ? prev\n : [...prev, mention]\n ));\n closeMentionMenu();\n\n window.requestAnimationFrame(() => {\n textareaRef.current?.focus();\n textareaRef.current?.setSelectionRange(nextCursorPosition, nextCursorPosition);\n });\n };\n\n const resetMentions = (nextMentions: ChatterMention[] = []) => {\n setMentions(nextMentions);\n closeMentionMenu();\n };\n\n useEffect(() => {\n if (!mentionRange) return;\n\n let isActive = true;\n const timeout = window.setTimeout(async () => {\n try {\n const encodedQuery = encodeURIComponent(mentionQuery);\n const queryString = mentionQuery\n ? `filters[username][$containsi]=${encodedQuery}&limit=8`\n : 'limit=8';\n const response = await getUsers(queryString).unwrap();\n if (!isActive) return;\n setMentionSuggestions(response?.data?.records || []);\n setActiveMentionIndex(0);\n } catch (error) {\n if (isActive) setMentionSuggestions([]);\n }\n }, 180);\n\n return () => {\n isActive = false;\n window.clearTimeout(timeout);\n };\n }, [mentionQuery, mentionRange, getUsers]);\n\n return {\n mentions,\n setMentions,\n mentionRange,\n mentionSuggestions,\n activeMentionIndex,\n isFetchingMentionUsers,\n handleMentionTextChange,\n handleMentionKeyDown,\n handleMentionKeyUp,\n handleMentionClick,\n handleSelectMention,\n resetMentions,\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"useChatterMentions.js","sourceRoot":"","sources":["../../../../src/components/core/chatter/useChatterMentions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAyE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnH,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,EAAkB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAQxE,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAAC,EAAyD;QAAvD,KAAK,WAAA,EAAE,QAAQ,cAAA,EAAE,WAAW,iBAAA;IACvD,IAAA,KAA0B,QAAQ,CAAmB,EAAE,CAAC,EAAvD,QAAQ,QAAA,EAAE,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AAR,QAAQ,CAAE,IAAI,KAAI,EAAE,CAAC,CAAC;wBAC5C,qBAAqB,CAAC,CAAC,CAAC,CAAC;;;;wBAEzB,IAAI,QAAQ;4BAAE,qBAAqB,CAAC,EAAE,CAAC,CAAC;;;;;aAE/C,EAAE,GAAG,CAAC,CAAC;QAER,OAAO;YACH,QAAQ,GAAG,KAAK,CAAC;YACjB,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAEtD,OAAO;QACH,QAAQ,UAAA;QACR,WAAW,aAAA;QACX,YAAY,cAAA;QACZ,kBAAkB,oBAAA;QAClB,kBAAkB,oBAAA;QAClB,sBAAsB,wBAAA;QACtB,uBAAuB,yBAAA;QACvB,oBAAoB,sBAAA;QACpB,kBAAkB,oBAAA;QAClB,kBAAkB,oBAAA;QAClB,mBAAmB,qBAAA;QACnB,aAAa,eAAA;KAChB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { type ChangeEvent, type KeyboardEvent, type MouseEvent, type RefObject, useEffect, useState } from 'react';\nimport { useLazyGetMentionableUsersQuery } from '../../../redux/api/solidChatterMessageApi';\nimport { ChatterMention, getMentionCandidate } from './chatterMentions';\n\ninterface UseChatterMentionsProps {\n value: string;\n onChange: (value: string) => void;\n textareaRef: RefObject<HTMLTextAreaElement | null>;\n}\n\nexport const useChatterMentions = ({ value, onChange, textareaRef }: UseChatterMentionsProps) => {\n const [mentions, setMentions] = useState<ChatterMention[]>([]);\n const [mentionQuery, setMentionQuery] = useState('');\n const [mentionRange, setMentionRange] = useState<{ start: number; end: number } | null>(null);\n const [mentionSuggestions, setMentionSuggestions] = useState<any[]>([]);\n const [activeMentionIndex, setActiveMentionIndex] = useState(0);\n const [getMentionableUsers, { isFetching: isFetchingMentionUsers }] = useLazyGetMentionableUsersQuery();\n\n const closeMentionMenu = () => {\n setMentionRange(null);\n setMentionQuery('');\n setMentionSuggestions([]);\n setActiveMentionIndex(0);\n };\n\n const updateMentionState = (nextValue: string, cursorPosition: number) => {\n const candidate = getMentionCandidate(nextValue, cursorPosition);\n if (!candidate) {\n closeMentionMenu();\n return;\n }\n\n setMentionRange({ start: candidate.start, end: candidate.end });\n setMentionQuery(candidate.query);\n };\n\n const handleMentionTextChange = (event: ChangeEvent<HTMLTextAreaElement>) => {\n const nextValue = event.target.value;\n onChange(nextValue);\n updateMentionState(nextValue, event.target.selectionStart ?? nextValue.length);\n };\n\n const handleMentionKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (!mentionRange) return;\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n setActiveMentionIndex(prev => {\n if (mentionSuggestions.length === 0) return 0;\n return (prev + 1) % mentionSuggestions.length;\n });\n return;\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n setActiveMentionIndex(prev => {\n if (mentionSuggestions.length === 0) return 0;\n return (prev - 1 + mentionSuggestions.length) % mentionSuggestions.length;\n });\n return;\n }\n\n if (event.key === 'Enter' || event.key === 'Tab') {\n if (mentionSuggestions[activeMentionIndex]) {\n event.preventDefault();\n handleSelectMention(mentionSuggestions[activeMentionIndex]);\n }\n return;\n }\n\n if (event.key === 'Escape') {\n event.preventDefault();\n closeMentionMenu();\n }\n };\n\n const handleMentionKeyUp = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (['ArrowDown', 'ArrowUp', 'Enter', 'Tab', 'Escape'].includes(event.key)) return;\n const target = event.currentTarget;\n updateMentionState(target.value, target.selectionStart ?? target.value.length);\n };\n\n const handleMentionClick = (event: MouseEvent<HTMLTextAreaElement>) => {\n updateMentionState(event.currentTarget.value, event.currentTarget.selectionStart ?? event.currentTarget.value.length);\n };\n\n const handleSelectMention = (user: any) => {\n if (!mentionRange) return;\n const username = user?.username;\n if (!username) return;\n\n const mention: ChatterMention = {\n username,\n display_name: user?.fullName || username,\n id: String(user?.id),\n };\n const mentionText = `@${mention.username}`;\n const nextValue = `${value.slice(0, mentionRange.start)}${mentionText} ${value.slice(mentionRange.end)}`;\n const nextCursorPosition = mentionRange.start + mentionText.length + 1;\n\n onChange(nextValue);\n setMentions(prev => (\n prev.some(item => item.id === mention.id || item.username === mention.username)\n ? prev\n : [...prev, mention]\n ));\n closeMentionMenu();\n\n window.requestAnimationFrame(() => {\n textareaRef.current?.focus();\n textareaRef.current?.setSelectionRange(nextCursorPosition, nextCursorPosition);\n });\n };\n\n const resetMentions = (nextMentions: ChatterMention[] = []) => {\n setMentions(nextMentions);\n closeMentionMenu();\n };\n\n useEffect(() => {\n if (!mentionRange) return;\n\n let isActive = true;\n const timeout = window.setTimeout(async () => {\n try {\n const encodedQuery = encodeURIComponent(mentionQuery);\n const queryString = mentionQuery\n ? `search=${encodedQuery}&limit=8`\n : 'limit=8';\n const response = await getMentionableUsers(queryString).unwrap();\n if (!isActive) return;\n setMentionSuggestions(response?.data || []);\n setActiveMentionIndex(0);\n } catch (error) {\n if (isActive) setMentionSuggestions([]);\n }\n }, 180);\n\n return () => {\n isActive = false;\n window.clearTimeout(timeout);\n };\n }, [mentionQuery, mentionRange, getMentionableUsers]);\n\n return {\n mentions,\n setMentions,\n mentionRange,\n mentionSuggestions,\n activeMentionIndex,\n isFetchingMentionUsers,\n handleMentionTextChange,\n handleMentionKeyDown,\n handleMentionKeyUp,\n handleMentionClick,\n handleSelectMention,\n resetMentions,\n };\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ChangeEvent, type KeyboardEvent, type MouseEvent, type RefObject, useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useLazyGetMentionableUsersQuery } from '../../../redux/api/solidChatterMessageApi';
|
|
3
3
|
import { ChatterMention, getMentionCandidate } from './chatterMentions';
|
|
4
4
|
|
|
5
5
|
interface UseChatterMentionsProps {
|
|
@@ -14,7 +14,7 @@ export const useChatterMentions = ({ value, onChange, textareaRef }: UseChatterM
|
|
|
14
14
|
const [mentionRange, setMentionRange] = useState<{ start: number; end: number } | null>(null);
|
|
15
15
|
const [mentionSuggestions, setMentionSuggestions] = useState<any[]>([]);
|
|
16
16
|
const [activeMentionIndex, setActiveMentionIndex] = useState(0);
|
|
17
|
-
const [
|
|
17
|
+
const [getMentionableUsers, { isFetching: isFetchingMentionUsers }] = useLazyGetMentionableUsersQuery();
|
|
18
18
|
|
|
19
19
|
const closeMentionMenu = () => {
|
|
20
20
|
setMentionRange(null);
|
|
@@ -126,11 +126,11 @@ export const useChatterMentions = ({ value, onChange, textareaRef }: UseChatterM
|
|
|
126
126
|
try {
|
|
127
127
|
const encodedQuery = encodeURIComponent(mentionQuery);
|
|
128
128
|
const queryString = mentionQuery
|
|
129
|
-
? `
|
|
129
|
+
? `search=${encodedQuery}&limit=8`
|
|
130
130
|
: 'limit=8';
|
|
131
|
-
const response = await
|
|
131
|
+
const response = await getMentionableUsers(queryString).unwrap();
|
|
132
132
|
if (!isActive) return;
|
|
133
|
-
setMentionSuggestions(response?.data
|
|
133
|
+
setMentionSuggestions(response?.data || []);
|
|
134
134
|
setActiveMentionIndex(0);
|
|
135
135
|
} catch (error) {
|
|
136
136
|
if (isActive) setMentionSuggestions([]);
|
|
@@ -141,7 +141,7 @@ export const useChatterMentions = ({ value, onChange, textareaRef }: UseChatterM
|
|
|
141
141
|
isActive = false;
|
|
142
142
|
window.clearTimeout(timeout);
|
|
143
143
|
};
|
|
144
|
-
}, [mentionQuery, mentionRange,
|
|
144
|
+
}, [mentionQuery, mentionRange, getMentionableUsers]);
|
|
145
145
|
|
|
146
146
|
return {
|
|
147
147
|
mentions,
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export interface PDFViewerProps {
|
|
2
|
+
url?: string | null;
|
|
3
|
+
/** Height of the viewport the PDF renders into. */
|
|
4
|
+
height?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Renders a PDF using the browser's built-in PDF viewer.
|
|
8
|
+
*
|
|
9
|
+
* The signed URL is handed straight to the iframe instead of being fetched into a
|
|
10
|
+
* blob first. `fetch` is subject to CORS, so a blob-based viewer only works where
|
|
11
|
+
* the storage bucket explicitly allows the app's origin — which differs per
|
|
12
|
+
* environment and silently breaks on any bucket that hasn't been configured.
|
|
13
|
+
* Iframes are not subject to CORS, so this renders identically everywhere.
|
|
14
|
+
*
|
|
15
|
+
* Zoom, rotation, page navigation, text search/selection, print and download all
|
|
16
|
+
* come from the browser's native viewer, so there is no pdf.js worker to
|
|
17
|
+
* configure or version-match.
|
|
18
|
+
*/
|
|
19
|
+
export default function PDFViewer({ url, height }: PDFViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
4
20
|
//# sourceMappingURL=PDFViewer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PDFViewer.d.ts","sourceRoot":"","sources":["../../../../src/components/core/common/PDFViewer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PDFViewer.d.ts","sourceRoot":"","sources":["../../../../src/components/core/common/PDFViewer.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC3B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,GAAG,EAAE,MAAe,EAAE,EAAE,cAAc,2CAkCzE"}
|
|
@@ -1,98 +1,22 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Renders a PDF using the browser's built-in PDF viewer.
|
|
4
|
+
*
|
|
5
|
+
* The signed URL is handed straight to the iframe instead of being fetched into a
|
|
6
|
+
* blob first. `fetch` is subject to CORS, so a blob-based viewer only works where
|
|
7
|
+
* the storage bucket explicitly allows the app's origin — which differs per
|
|
8
|
+
* environment and silently breaks on any bucket that hasn't been configured.
|
|
9
|
+
* Iframes are not subject to CORS, so this renders identically everywhere.
|
|
10
|
+
*
|
|
11
|
+
* Zoom, rotation, page navigation, text search/selection, print and download all
|
|
12
|
+
* come from the browser's native viewer, so there is no pdf.js worker to
|
|
13
|
+
* configure or version-match.
|
|
14
|
+
*/
|
|
44
15
|
export default function PDFViewer(_a) {
|
|
45
|
-
var
|
|
46
|
-
var url = _a.url;
|
|
47
|
-
var _b = useState(null), numPages = _b[0], setNumPages = _b[1];
|
|
48
|
-
var _c = useState(1), pageNumber = _c[0], setPageNumber = _c[1];
|
|
49
|
-
var _d = useState(true), loading = _d[0], setLoading = _d[1];
|
|
50
|
-
var _e = useState(null), error = _e[0], setError = _e[1];
|
|
51
|
-
var _f = useState(null), blobUrl = _f[0], setBlobUrl = _f[1];
|
|
52
|
-
// Convert signed URL → Blob → Object URL
|
|
53
|
-
useEffect(function () {
|
|
54
|
-
if (!url)
|
|
55
|
-
return;
|
|
56
|
-
setLoading(true);
|
|
57
|
-
setError(null);
|
|
58
|
-
fetch(url)
|
|
59
|
-
.then(function (res) { return __awaiter(_this, void 0, void 0, function () {
|
|
60
|
-
var blob, blobUrl;
|
|
61
|
-
return __generator(this, function (_a) {
|
|
62
|
-
switch (_a.label) {
|
|
63
|
-
case 0:
|
|
64
|
-
if (!res.ok)
|
|
65
|
-
throw new Error("Failed to fetch PDF");
|
|
66
|
-
return [4 /*yield*/, res.blob()];
|
|
67
|
-
case 1:
|
|
68
|
-
blob = _a.sent();
|
|
69
|
-
blobUrl = URL.createObjectURL(blob);
|
|
70
|
-
setBlobUrl(blobUrl);
|
|
71
|
-
setLoading(false);
|
|
72
|
-
return [2 /*return*/];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}); })
|
|
76
|
-
.catch(function (err) {
|
|
77
|
-
console.error("Blob fetch error:", err);
|
|
78
|
-
setError("Failed to load PDF");
|
|
79
|
-
setLoading(false);
|
|
80
|
-
});
|
|
81
|
-
}, [url]);
|
|
82
|
-
function onDocumentLoadSuccess(_a) {
|
|
83
|
-
var numPages = _a.numPages;
|
|
84
|
-
setNumPages(numPages);
|
|
85
|
-
setError(null);
|
|
86
|
-
}
|
|
87
|
-
function onDocumentLoadError(err) {
|
|
88
|
-
console.error("PDF load error:", err);
|
|
89
|
-
setError("Failed to render PDF");
|
|
90
|
-
}
|
|
91
|
-
var goToPrevPage = function () { return setPageNumber(function (p) { return Math.max(p - 1, 1); }); };
|
|
92
|
-
var goToNextPage = function () { return setPageNumber(function (p) { return Math.min(p + 1, numPages); }); };
|
|
16
|
+
var url = _a.url, _b = _a.height, height = _b === void 0 ? '70vh' : _b;
|
|
93
17
|
if (!url) {
|
|
94
|
-
return (_jsx("div", { className: "flex items-center justify-center
|
|
18
|
+
return (_jsx("div", { className: "flex min-h-0 items-center justify-center rounded-lg bg-[var(--solid-surface-pane)]", style: { height: height }, children: _jsx("p", { className: "text-[var(--solid-text-muted)]", children: "No PDF URL provided" }) }));
|
|
95
19
|
}
|
|
96
|
-
return (_jsxs("div", { className: "flex
|
|
20
|
+
return (_jsxs("div", { className: "flex min-h-0 flex-col gap-2", style: { height: height }, children: [_jsx("iframe", { src: url, title: "PDF preview", className: "block min-h-0 w-full flex-1 rounded-lg border border-[var(--solid-border-default)] bg-[var(--solid-surface-pane)]" }), _jsx("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: "shrink-0 text-center text-xs text-[var(--solid-text-muted)] underline", children: "Not rendering? Open in a new tab" })] }));
|
|
97
21
|
}
|
|
98
22
|
//# sourceMappingURL=PDFViewer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PDFViewer.js","sourceRoot":"","sources":["../../../../src/components/core/common/PDFViewer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PDFViewer.js","sourceRoot":"","sources":["../../../../src/components/core/common/PDFViewer.tsx"],"names":[],"mappings":";AAMA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAwC;QAAtC,GAAG,SAAA,EAAE,cAAe,EAAf,MAAM,mBAAG,MAAM,KAAA;IACpD,IAAI,CAAC,GAAG,EAAE;QACN,OAAO,CACH,cACI,SAAS,EAAC,oFAAoF,EAC9F,KAAK,EAAE,EAAE,MAAM,QAAA,EAAE,YAEjB,YAAG,SAAS,EAAC,gCAAgC,oCAAwB,GACnE,CACT,CAAC;KACL;IAED,OAAO,CACH,eAAK,SAAS,EAAC,6BAA6B,EAAC,KAAK,EAAE,EAAE,MAAM,QAAA,EAAE,aAC1D,iBACI,GAAG,EAAE,GAAG,EACR,KAAK,EAAC,aAAa,EACnB,SAAS,EAAC,mHAAmH,GAC/H,EAMF,YACI,IAAI,EAAE,GAAG,EACT,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,SAAS,EAAC,uEAAuE,iDAGjF,IACF,CACT,CAAC;AACN,CAAC","sourcesContent":["export interface PDFViewerProps {\n url?: string | null;\n /** Height of the viewport the PDF renders into. */\n height?: string;\n}\n\n/**\n * Renders a PDF using the browser's built-in PDF viewer.\n *\n * The signed URL is handed straight to the iframe instead of being fetched into a\n * blob first. `fetch` is subject to CORS, so a blob-based viewer only works where\n * the storage bucket explicitly allows the app's origin — which differs per\n * environment and silently breaks on any bucket that hasn't been configured.\n * Iframes are not subject to CORS, so this renders identically everywhere.\n *\n * Zoom, rotation, page navigation, text search/selection, print and download all\n * come from the browser's native viewer, so there is no pdf.js worker to\n * configure or version-match.\n */\nexport default function PDFViewer({ url, height = '70vh' }: PDFViewerProps) {\n if (!url) {\n return (\n <div\n className=\"flex min-h-0 items-center justify-center rounded-lg bg-[var(--solid-surface-pane)]\"\n style={{ height }}\n >\n <p className=\"text-[var(--solid-text-muted)]\">No PDF URL provided</p>\n </div>\n );\n }\n\n return (\n <div className=\"flex min-h-0 flex-col gap-2\" style={{ height }}>\n <iframe\n src={url}\n title=\"PDF preview\"\n className=\"block min-h-0 w-full flex-1 rounded-lg border border-[var(--solid-border-default)] bg-[var(--solid-surface-pane)]\"\n />\n {/*\n Escape hatch: a browser that won't render PDFs inline (iOS Safari, or\n an object stored with a non-PDF content type) shows a blank frame with\n no error event to hook. This keeps the document reachable in that case.\n */}\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"shrink-0 text-center text-xs text-[var(--solid-text-muted)] underline\"\n >\n Not rendering? Open in a new tab\n </a>\n </div>\n );\n}\n"]}
|
|
@@ -1,117 +1,54 @@
|
|
|
1
|
+
export interface PDFViewerProps {
|
|
2
|
+
url?: string | null;
|
|
3
|
+
/** Height of the viewport the PDF renders into. */
|
|
4
|
+
height?: string;
|
|
5
|
+
}
|
|
1
6
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const [blobUrl, setBlobUrl] = useState<string | null>(null);
|
|
17
|
-
|
|
18
|
-
// Convert signed URL → Blob → Object URL
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (!url) return;
|
|
21
|
-
|
|
22
|
-
setLoading(true);
|
|
23
|
-
setError(null);
|
|
24
|
-
|
|
25
|
-
fetch(url)
|
|
26
|
-
.then(async (res) => {
|
|
27
|
-
if (!res.ok) throw new Error("Failed to fetch PDF");
|
|
28
|
-
|
|
29
|
-
const blob = await res.blob();
|
|
30
|
-
const blobUrl = URL.createObjectURL(blob);
|
|
31
|
-
setBlobUrl(blobUrl);
|
|
32
|
-
setLoading(false);
|
|
33
|
-
})
|
|
34
|
-
.catch((err) => {
|
|
35
|
-
console.error("Blob fetch error:", err);
|
|
36
|
-
setError("Failed to load PDF");
|
|
37
|
-
setLoading(false);
|
|
38
|
-
});
|
|
39
|
-
}, [url]);
|
|
40
|
-
|
|
41
|
-
function onDocumentLoadSuccess({ numPages }: any) {
|
|
42
|
-
setNumPages(numPages);
|
|
43
|
-
setError(null);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function onDocumentLoadError(err: any) {
|
|
47
|
-
console.error("PDF load error:", err);
|
|
48
|
-
setError("Failed to render PDF");
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const goToPrevPage = () => setPageNumber((p) => Math.max(p - 1, 1));
|
|
52
|
-
const goToNextPage = () => setPageNumber((p) => Math.min(p + 1, numPages));
|
|
53
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Renders a PDF using the browser's built-in PDF viewer.
|
|
9
|
+
*
|
|
10
|
+
* The signed URL is handed straight to the iframe instead of being fetched into a
|
|
11
|
+
* blob first. `fetch` is subject to CORS, so a blob-based viewer only works where
|
|
12
|
+
* the storage bucket explicitly allows the app's origin — which differs per
|
|
13
|
+
* environment and silently breaks on any bucket that hasn't been configured.
|
|
14
|
+
* Iframes are not subject to CORS, so this renders identically everywhere.
|
|
15
|
+
*
|
|
16
|
+
* Zoom, rotation, page navigation, text search/selection, print and download all
|
|
17
|
+
* come from the browser's native viewer, so there is no pdf.js worker to
|
|
18
|
+
* configure or version-match.
|
|
19
|
+
*/
|
|
20
|
+
export default function PDFViewer({ url, height = '70vh' }: PDFViewerProps) {
|
|
54
21
|
if (!url) {
|
|
55
22
|
return (
|
|
56
|
-
<div
|
|
57
|
-
|
|
23
|
+
<div
|
|
24
|
+
className="flex min-h-0 items-center justify-center rounded-lg bg-[var(--solid-surface-pane)]"
|
|
25
|
+
style={{ height }}
|
|
26
|
+
>
|
|
27
|
+
<p className="text-[var(--solid-text-muted)]">No PDF URL provided</p>
|
|
58
28
|
</div>
|
|
59
29
|
);
|
|
60
30
|
}
|
|
61
31
|
|
|
62
32
|
return (
|
|
63
|
-
<div className="flex flex-col
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
className="border border-gray-300 rounded-lg shadow-lg"
|
|
83
|
-
>
|
|
84
|
-
<Page
|
|
85
|
-
pageNumber={pageNumber}
|
|
86
|
-
renderTextLayer={true}
|
|
87
|
-
renderAnnotationLayer={true}
|
|
88
|
-
/>
|
|
89
|
-
</Document>
|
|
90
|
-
)}
|
|
91
|
-
|
|
92
|
-
{numPages && (
|
|
93
|
-
<div className="flex items-center space-x-4 bg-white p-4 rounded-lg shadow-md">
|
|
94
|
-
<button
|
|
95
|
-
onClick={goToPrevPage}
|
|
96
|
-
disabled={pageNumber <= 1}
|
|
97
|
-
className="px-4 py-2 bg-primary text-white rounded hover:opacity-90 disabled:bg-gray-300 disabled:cursor-not-allowed"
|
|
98
|
-
>
|
|
99
|
-
Previous
|
|
100
|
-
</button>
|
|
101
|
-
|
|
102
|
-
<span className="text-gray-700 font-medium">
|
|
103
|
-
Page {pageNumber} of {numPages}
|
|
104
|
-
</span>
|
|
105
|
-
|
|
106
|
-
<button
|
|
107
|
-
onClick={goToNextPage}
|
|
108
|
-
disabled={pageNumber >= numPages}
|
|
109
|
-
className="px-4 py-2 bg-primary text-white rounded hover:opacity-90 disabled:bg-gray-300 disabled:cursor-not-allowed"
|
|
110
|
-
>
|
|
111
|
-
Next
|
|
112
|
-
</button>
|
|
113
|
-
</div>
|
|
114
|
-
)}
|
|
33
|
+
<div className="flex min-h-0 flex-col gap-2" style={{ height }}>
|
|
34
|
+
<iframe
|
|
35
|
+
src={url}
|
|
36
|
+
title="PDF preview"
|
|
37
|
+
className="block min-h-0 w-full flex-1 rounded-lg border border-[var(--solid-border-default)] bg-[var(--solid-surface-pane)]"
|
|
38
|
+
/>
|
|
39
|
+
{/*
|
|
40
|
+
Escape hatch: a browser that won't render PDFs inline (iOS Safari, or
|
|
41
|
+
an object stored with a non-PDF content type) shows a blank frame with
|
|
42
|
+
no error event to hook. This keeps the document reachable in that case.
|
|
43
|
+
*/}
|
|
44
|
+
<a
|
|
45
|
+
href={url}
|
|
46
|
+
target="_blank"
|
|
47
|
+
rel="noopener noreferrer"
|
|
48
|
+
className="shrink-0 text-center text-xs text-[var(--solid-text-muted)] underline"
|
|
49
|
+
>
|
|
50
|
+
Not rendering? Open in a new tab
|
|
51
|
+
</a>
|
|
115
52
|
</div>
|
|
116
53
|
);
|
|
117
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidAccountSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/common/SolidAccountSettings/SolidAccountSettings.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,oBAAoB,gEAAiE,GAAG,
|
|
1
|
+
{"version":3,"file":"SolidAccountSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/common/SolidAccountSettings/SolidAccountSettings.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,oBAAoB,gEAAiE,GAAG,mDA0FpG,CAAC"}
|
|
@@ -1,23 +1,43 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
1
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
11
|
import { useEffect, useMemo, useState } from "react";
|
|
3
12
|
import { SolidPersonalInfo } from "./SolidPersonalInfo";
|
|
4
13
|
import { SolidChangePassword } from "./SolidChangePassword";
|
|
5
14
|
import { SolidVersionInfo } from "./SolidVersionInfo";
|
|
6
15
|
import styles from "./SolidAccountSettings.module.css";
|
|
7
|
-
import { useLazyGetSolidSettingsQuery } from "../../../../redux/api/solidSettingsApi";
|
|
8
|
-
import { toLegacySettingsShape } from "../../../../helpers/settingsPayload";
|
|
16
|
+
import { useGetSolidVersionInfoQuery, useLazyGetSolidSettingsQuery } from "../../../../redux/api/solidSettingsApi";
|
|
17
|
+
import { getSettingsMap, toLegacySettingsShape } from "../../../../helpers/settingsPayload";
|
|
9
18
|
export var SolidAccountSettings = function (_a) {
|
|
10
19
|
var showProfileSettingsDialog = _a.showProfileSettingsDialog, setShowProfileSettingsDialog = _a.setShowProfileSettingsDialog;
|
|
11
20
|
var _b = useState("personal_info"), settingKey = _b[0], setSettingKey = _b[1];
|
|
12
21
|
var _c = useLazyGetSolidSettingsQuery(), trigger = _c[0], solidSettingsData = _c[1].data;
|
|
22
|
+
var versionInfoQuery = useGetSolidVersionInfoQuery(undefined, {
|
|
23
|
+
skip: !showProfileSettingsDialog,
|
|
24
|
+
});
|
|
13
25
|
useEffect(function () {
|
|
14
26
|
trigger("");
|
|
15
27
|
}, [trigger]);
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
var settingsMap = useMemo(function () { return getSettingsMap(solidSettingsData); }, [solidSettingsData]);
|
|
29
|
+
var versionInfoErrorStatus = versionInfoQuery.error && typeof versionInfoQuery.error === "object" && "status" in versionInfoQuery.error
|
|
30
|
+
? versionInfoQuery.error.status
|
|
31
|
+
: null;
|
|
32
|
+
var settings = __spreadArray(__spreadArray([
|
|
33
|
+
{ label: "Personal Info", key: "personal_info" }
|
|
34
|
+
], ((settingsMap === null || settingsMap === void 0 ? void 0 : settingsMap.passwordBasedAuth) ? [{ label: "Change Password", key: "change_password" }] : []), true), (versionInfoErrorStatus === 403 ? [] : [{ label: "About", key: "about" }]), true);
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
if (settings.some(function (option) { return option.key === settingKey; }))
|
|
38
|
+
return;
|
|
39
|
+
setSettingKey((_b = (_a = settings[0]) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : "personal_info");
|
|
40
|
+
}, [settingKey, settings]);
|
|
21
41
|
var renderSettingComponent = useMemo(function () {
|
|
22
42
|
var legacySettings = toLegacySettingsShape(solidSettingsData);
|
|
23
43
|
switch (settingKey) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidAccountSettings.js","sourceRoot":"","sources":["../../../../../src/components/core/common/SolidAccountSettings/SolidAccountSettings.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolidAccountSettings.js","sourceRoot":"","sources":["../../../../../src/components/core/common/SolidAccountSettings/SolidAccountSettings.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,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AAC,KAAK,IAAK,OAAA,KAAK,CAAC,eAAe,EAAE,EAAvB,CAAuB,aAE3C,kBAAQ,SAAS,EAAE,MAAM,CAAC,MAAM,aAC9B,0BACE,aAAI,EAAE,EAAC,8BAA8B,EAAC,SAAS,EAAE,MAAM,CAAC,KAAK,iCAExD,EACL,YAAG,SAAS,EAAE,MAAM,CAAC,QAAQ,2DAAgD,IACzE,EACN,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,MAAM,CAAC,WAAW,EAC7B,OAAO,EAAE,cAAM,OAAA,4BAA4B,CAAC,KAAK,CAAC,EAAnC,CAAmC,gBACvC,wBAAwB,uBAG5B,IACF,EAET,cAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAC,SAAS,gBAAY,0BAA0B,YAClF,QAAQ,CAAC,GAAG,CAAC,UAAC,MAAM,IAAK,OAAA,CACxB,iBAEE,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,KAAK,mBACK,MAAM,CAAC,GAAG,KAAK,UAAU,EACxC,SAAS,EAAE,UAAG,MAAM,CAAC,UAAU,cAAI,MAAM,CAAC,GAAG,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAE,EACtF,OAAO,EAAE,cAAM,OAAA,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,EAAzB,CAAyB,YAEvC,MAAM,CAAC,KAAK,IAPR,MAAM,CAAC,GAAG,CAQR,CACV,EAXyB,CAWzB,CAAC,GACE,EAEN,cAAK,SAAS,EAAE,MAAM,CAAC,WAAW,YAAG,sBAAsB,GAAO,IAC1D,GACN,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { SolidPersonalInfo } from \"./SolidPersonalInfo\";\nimport { SolidChangePassword } from \"./SolidChangePassword\";\nimport { SolidVersionInfo } from \"./SolidVersionInfo\";\nimport styles from \"./SolidAccountSettings.module.css\";\nimport { useGetSolidVersionInfoQuery, useLazyGetSolidSettingsQuery } from \"../../../../redux/api/solidSettingsApi\";\nimport { getSettingsMap, toLegacySettingsShape } from \"../../../../helpers/settingsPayload\";\n\nexport const SolidAccountSettings = ({ showProfileSettingsDialog, setShowProfileSettingsDialog }: any) => {\n const [settingKey, setSettingKey] = useState(\"personal_info\");\n\n const [trigger, { data: solidSettingsData }] = useLazyGetSolidSettingsQuery();\n const versionInfoQuery = useGetSolidVersionInfoQuery(undefined, {\n skip: !showProfileSettingsDialog,\n });\n\n useEffect(() => {\n trigger(\"\");\n }, [trigger]);\n\n const settingsMap = useMemo(() => getSettingsMap(solidSettingsData), [solidSettingsData]);\n const versionInfoErrorStatus =\n versionInfoQuery.error && typeof versionInfoQuery.error === \"object\" && \"status\" in versionInfoQuery.error\n ? versionInfoQuery.error.status\n : null;\n\n const settings = [\n { label: \"Personal Info\", key: \"personal_info\" },\n ...(settingsMap?.passwordBasedAuth ? [{ label: \"Change Password\", key: \"change_password\" }] : []),\n ...(versionInfoErrorStatus === 403 ? [] : [{ label: \"About\", key: \"about\" }]),\n ];\n\n useEffect(() => {\n if (settings.some((option) => option.key === settingKey)) return;\n setSettingKey(settings[0]?.key ?? \"personal_info\");\n }, [settingKey, settings]);\n\n const renderSettingComponent = useMemo(() => {\n const legacySettings = toLegacySettingsShape(solidSettingsData);\n switch (settingKey) {\n case \"personal_info\":\n return <SolidPersonalInfo />;\n case \"change_password\":\n return <SolidChangePassword solidSettingsData={legacySettings} />;\n case \"about\":\n return <SolidVersionInfo />;\n default:\n return null;\n }\n }, [settingKey, solidSettingsData]);\n\n if (!showProfileSettingsDialog) return null;\n\n return (\n <div className={styles.backdrop} role=\"presentation\" onClick={() => setShowProfileSettingsDialog(false)}>\n <section\n className={styles.modal}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"solid-account-settings-title\"\n onClick={(event) => event.stopPropagation()}\n >\n <header className={styles.header}>\n <div>\n <h2 id=\"solid-account-settings-title\" className={styles.title}>\n Account Settings\n </h2>\n <p className={styles.subtitle}>Manage your profile and security settings.</p>\n </div>\n <button\n type=\"button\"\n className={styles.closeButton}\n onClick={() => setShowProfileSettingsDialog(false)}\n aria-label=\"Close account settings\"\n >\n ×\n </button>\n </header>\n\n <div className={styles.tabsLine} role=\"tablist\" aria-label=\"Account setting sections\">\n {settings.map((option) => (\n <button\n key={option.key}\n type=\"button\"\n role=\"tab\"\n aria-selected={option.key === settingKey}\n className={`${styles.tabTrigger} ${option.key === settingKey ? styles.tabActive : \"\"}`}\n onClick={() => setSettingKey(option.key)}\n >\n {option.label}\n </button>\n ))}\n </div>\n\n <div className={styles.formWrapper}>{renderSettingComponent}</div>\n </section>\n </div>\n );\n};\n"]}
|