@rebasepro/admin 0.0.1-canary.4f204c2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +6 -0
- package/dist/CollectionEditorDialog-B2M9lCyL.js +4720 -0
- package/dist/CollectionEditorDialog-B2M9lCyL.js.map +1 -0
- package/dist/CollectionsStudioView-WG6soyfs.js +218 -0
- package/dist/CollectionsStudioView-WG6soyfs.js.map +1 -0
- package/dist/ContentHomePage-CDF_a6Lp.js +1786 -0
- package/dist/ContentHomePage-CDF_a6Lp.js.map +1 -0
- package/dist/ExportCollectionAction-Dc0VOWMN.js +439 -0
- package/dist/ExportCollectionAction-Dc0VOWMN.js.map +1 -0
- package/dist/ImportCollectionAction-DpCagAOy.js +686 -0
- package/dist/ImportCollectionAction-DpCagAOy.js.map +1 -0
- package/dist/PropertyEditView-DS67DxoT.js +8138 -0
- package/dist/PropertyEditView-DS67DxoT.js.map +1 -0
- package/dist/RoleChip-QtUFXeTp.js +67 -0
- package/dist/RoleChip-QtUFXeTp.js.map +1 -0
- package/dist/RolesView-CIuYBimF.js +424 -0
- package/dist/RolesView-CIuYBimF.js.map +1 -0
- package/dist/UsersView-B5zelXnH.js +493 -0
- package/dist/UsersView-B5zelXnH.js.map +1 -0
- package/dist/collection_editor/CollectionEditorDialogsContext.d.ts +19 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +45 -0
- package/dist/collection_editor/_cms_internals.d.ts +29 -0
- package/dist/collection_editor/api/generateCollectionApi.d.ts +77 -0
- package/dist/collection_editor/api/index.d.ts +1 -0
- package/dist/collection_editor/index.d.ts +16 -0
- package/dist/collection_editor/pgColumnToProperty.d.ts +6 -0
- package/dist/collection_editor/types/collection_editor_controller.d.ts +56 -0
- package/dist/collection_editor/types/collection_inference.d.ts +10 -0
- package/dist/collection_editor/types/config_controller.d.ts +91 -0
- package/dist/collection_editor/types/config_permissions.d.ts +19 -0
- package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +11 -0
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +10 -0
- package/dist/collection_editor/ui/EditorCollectionAction.d.ts +2 -0
- package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +2 -0
- package/dist/collection_editor/ui/EditorEntityAction.d.ts +2 -0
- package/dist/collection_editor/ui/HomePageEditorCollectionAction.d.ts +2 -0
- package/dist/collection_editor/ui/KanbanSetupAction.d.ts +10 -0
- package/dist/collection_editor/ui/MissingReferenceWidget.d.ts +3 -0
- package/dist/collection_editor/ui/NewCollectionButton.d.ts +1 -0
- package/dist/collection_editor/ui/NewCollectionCard.d.ts +2 -0
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +36 -0
- package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.d.ts +20 -0
- package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +11 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +72 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +19 -0
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +17 -0
- package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.d.ts +12 -0
- package/dist/collection_editor/ui/collection_editor/CollectionRelationsTab.d.ts +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.d.ts +14 -0
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/EntityActionsSelectDialog.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/EnumForm.d.ts +12 -0
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +6 -0
- package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +47 -0
- package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.d.ts +16 -0
- package/dist/collection_editor/ui/collection_editor/PropertyTree.d.ts +31 -0
- package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +11 -0
- package/dist/collection_editor/ui/collection_editor/SwitchControl.d.ts +8 -0
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.d.ts +6 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +13 -0
- package/dist/collection_editor/ui/collection_editor/import/clean_import_data.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/CommonPropertyFields.d.ts +10 -0
- package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.d.ts +9 -0
- package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.d.ts +14 -0
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.d.ts +15 -0
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.d.ts +9 -0
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.d.ts +10 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.d.ts +6 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/index.d.ts +6 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/property_paths.d.ts +19 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +11 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +2 -0
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +2 -0
- package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +2 -0
- package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +2 -0
- package/dist/collection_editor/ui/collection_editor/util.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/utils/strings.d.ts +1 -0
- package/dist/collection_editor/ui/collection_editor/utils/supported_fields.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.d.ts +2 -0
- package/dist/collection_editor/useCollectionEditorController.d.ts +6 -0
- package/dist/collection_editor/useCollectionsConfigController.d.ts +6 -0
- package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +6 -0
- package/dist/collection_editor/validateCollectionJson.d.ts +22 -0
- package/dist/collection_editor_ui.d.ts +8 -0
- package/dist/collection_editor_ui.js +11 -0
- package/dist/collection_editor_ui.js.map +1 -0
- package/dist/components/AdminModeSyncer.d.ts +17 -0
- package/dist/components/ArrayContainer.d.ts +58 -0
- package/dist/components/ClearFilterSortButton.d.ts +5 -0
- package/dist/components/CollectionEditorDialogs.d.ts +15 -0
- package/dist/components/DefaultAppBar.d.ts +29 -0
- package/dist/components/DefaultDrawer.d.ts +29 -0
- package/dist/components/DeleteEntityDialog.d.ts +13 -0
- package/dist/components/DrawerNavigationGroup.d.ts +49 -0
- package/dist/components/DrawerNavigationItem.d.ts +10 -0
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +39 -0
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +27 -0
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +129 -0
- package/dist/components/EntityCollectionTable/PropertyTableCell.d.ts +26 -0
- package/dist/components/EntityCollectionTable/column_utils.d.ts +16 -0
- package/dist/components/EntityCollectionTable/fields/TableMultipleRelationField.d.ts +21 -0
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +22 -0
- package/dist/components/EntityCollectionTable/fields/TableRelationField.d.ts +22 -0
- package/dist/components/EntityCollectionTable/fields/TableRelationSelectorField.d.ts +20 -0
- package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +35 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableDateField.d.ts +12 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableInput.d.ts +9 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableNumberInput.d.ts +8 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableSelect.d.ts +15 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableSwitch.d.ts +7 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableUserSelect.d.ts +12 -0
- package/dist/components/EntityCollectionTable/index.d.ts +6 -0
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +21 -0
- package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +32 -0
- package/dist/components/EntityCollectionTable/internal/EntityTableCellActions.d.ts +9 -0
- package/dist/components/EntityCollectionTable/internal/common.d.ts +5 -0
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +27 -0
- package/dist/components/EntityCollectionTable/internal/popup_field/useDraggable.d.ts +13 -0
- package/dist/components/EntityCollectionTable/internal/popup_field/useWindowSize.d.ts +6 -0
- package/dist/components/EntityCollectionTable/table_bindings.d.ts +28 -0
- package/dist/components/EntityCollectionView/Board.d.ts +2 -0
- package/dist/components/EntityCollectionView/BoardColumn.d.ts +42 -0
- package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +9 -0
- package/dist/components/EntityCollectionView/BoardSortableList.d.ts +14 -0
- package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +31 -0
- package/dist/components/EntityCollectionView/EntityCard.d.ts +20 -0
- package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +21 -0
- package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +32 -0
- package/dist/components/EntityCollectionView/EntityCollectionListView.d.ts +34 -0
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +64 -0
- package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +18 -0
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +18 -0
- package/dist/components/EntityCollectionView/FiltersDialog.d.ts +15 -0
- package/dist/components/EntityCollectionView/SplitListView.d.ts +57 -0
- package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +44 -0
- package/dist/components/EntityCollectionView/board_types.d.ts +105 -0
- package/dist/components/EntityCollectionView/hooks/useCollectionInlineEditor.d.ts +12 -0
- package/dist/components/EntityCollectionView/hooks/useKanbanDragAndDrop.d.ts +19 -0
- package/dist/components/EntityCollectionView/useBoardDataController.d.ts +61 -0
- package/dist/components/EntityCollectionView/useEntityPreviewSlots.d.ts +101 -0
- package/dist/components/EntityCollectionView/useSelectionController.d.ts +2 -0
- package/dist/components/EntityCollectionView/utils.d.ts +3 -0
- package/dist/components/EntityEditView.d.ts +49 -0
- package/dist/components/EntityEditViewFormActions.d.ts +2 -0
- package/dist/components/EntityJsonPreview.d.ts +3 -0
- package/dist/components/EntityPreview.d.ts +56 -0
- package/dist/components/EntitySidePanel.d.ts +10 -0
- package/dist/components/EntityView.d.ts +12 -0
- package/dist/components/FieldCaption.d.ts +5 -0
- package/dist/components/HomePage/ContentHomePage.d.ts +11 -0
- package/dist/components/HomePage/FavouritesView.d.ts +3 -0
- package/dist/components/HomePage/HomePageDnD.d.ts +77 -0
- package/dist/components/HomePage/NavigationCard.d.ts +11 -0
- package/dist/components/HomePage/NavigationCardBinding.d.ts +18 -0
- package/dist/components/HomePage/NavigationGroup.d.ts +11 -0
- package/dist/components/HomePage/RenameGroupDialog.d.ts +9 -0
- package/dist/components/HomePage/SmallNavigationCard.d.ts +6 -0
- package/dist/components/HomePage/index.d.ts +4 -0
- package/dist/components/PropertyCollectionView.d.ts +24 -0
- package/dist/components/PropertyConfigBadge.d.ts +6 -0
- package/dist/components/PropertyIdCopyTooltip.d.ts +8 -0
- package/dist/components/RebaseAuthGate.d.ts +21 -0
- package/dist/components/RebaseCMS.d.ts +10 -0
- package/dist/components/RebaseLayout.d.ts +32 -0
- package/dist/components/RebaseNavigation.d.ts +24 -0
- package/dist/components/RebaseRouteDefs.d.ts +30 -0
- package/dist/components/RebaseShell.d.ts +25 -0
- package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +59 -0
- package/dist/components/ReferenceWidget.d.ts +30 -0
- package/dist/components/RelationSelector.d.ts +32 -0
- package/dist/components/SearchIconsView.d.ts +5 -0
- package/dist/components/SelectableTable/SelectableTable.d.ts +95 -0
- package/dist/components/SelectableTable/SelectableTableContext.d.ts +4 -0
- package/dist/components/SelectableTable/SelectionStore.d.ts +26 -0
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +9 -0
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +12 -0
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +15 -0
- package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +12 -0
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +13 -0
- package/dist/components/SideDialogs.d.ts +25 -0
- package/dist/components/SideEntityProvider.d.ts +32 -0
- package/dist/components/UserSelector.d.ts +18 -0
- package/dist/components/admin/RoleChip.d.ts +4 -0
- package/dist/components/admin/RolesView.d.ts +4 -0
- package/dist/components/admin/UsersView.d.ts +4 -0
- package/dist/components/admin/index.d.ts +3 -0
- package/dist/components/app/AppBar.d.ts +12 -0
- package/dist/components/app/Drawer.d.ts +19 -0
- package/dist/components/app/Scaffold.d.ts +34 -0
- package/dist/components/app/index.d.ts +4 -0
- package/dist/components/app/useApp.d.ts +17 -0
- package/dist/components/common/default_entity_actions.d.ts +4 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/field_configs.d.ts +7 -0
- package/dist/components/history/EntityHistoryEntry.d.ts +17 -0
- package/dist/components/history/EntityHistoryView.d.ts +6 -0
- package/dist/components/history/LastEditedByFormAction.d.ts +6 -0
- package/dist/components/history/LastEditedByIndicator.d.ts +10 -0
- package/dist/components/history/UserChip.d.ts +4 -0
- package/dist/components/history/index.d.ts +5 -0
- package/dist/components/index.d.ts +38 -0
- package/dist/contexts/BreacrumbsContext.d.ts +8 -0
- package/dist/contexts/SideDialogsControllerContext.d.ts +3 -0
- package/dist/contexts/SideEntityControllerContext.d.ts +3 -0
- package/dist/data_export/export/BasicExportAction.d.ts +7 -0
- package/dist/data_export/export/ExportCollectionAction.d.ts +11 -0
- package/dist/data_export/export/export.d.ts +22 -0
- package/dist/data_export/export/index.d.ts +3 -0
- package/dist/data_export/index.d.ts +1 -0
- package/dist/data_import/components/DataNewPropertiesMapping.d.ts +13 -0
- package/dist/data_import/components/ImportFileUpload.d.ts +3 -0
- package/dist/data_import/components/ImportNewPropertyFieldPreview.d.ts +9 -0
- package/dist/data_import/components/ImportSaveInProgress.d.ts +8 -0
- package/dist/data_import/components/index.d.ts +4 -0
- package/dist/data_import/hooks/index.d.ts +1 -0
- package/dist/data_import/hooks/useImportConfig.d.ts +2 -0
- package/dist/data_import/import/ImportCollectionAction.d.ts +15 -0
- package/dist/data_import/import/index.d.ts +1 -0
- package/dist/data_import/index.d.ts +5 -0
- package/dist/data_import/types/column_mapping.d.ts +20 -0
- package/dist/data_import/types/index.d.ts +1 -0
- package/dist/data_import/utils/data.d.ts +4 -0
- package/dist/data_import/utils/file_headers.d.ts +1 -0
- package/dist/data_import/utils/file_to_json.d.ts +16 -0
- package/dist/data_import/utils/get_import_inference_type.d.ts +2 -0
- package/dist/data_import/utils/get_properties_mapping.d.ts +1 -0
- package/dist/data_import/utils/index.d.ts +3 -0
- package/dist/editor/components/SlashCommandMenu.d.ts +6 -0
- package/dist/editor/components/editor-bubble-item.d.ts +8 -0
- package/dist/editor/components/editor-bubble.d.ts +8 -0
- package/dist/editor/components/image-bubble.d.ts +5 -0
- package/dist/editor/components/index.d.ts +16 -0
- package/dist/editor/components/table-bubble.d.ts +5 -0
- package/dist/editor/editor.d.ts +30 -0
- package/dist/editor/extensions/HighlightDecorationExtension.d.ts +24 -0
- package/dist/editor/extensions/Image/index.d.ts +6 -0
- package/dist/editor/extensions/Image.d.ts +6 -0
- package/dist/editor/extensions/TextLoadingDecorationExtension.d.ts +16 -0
- package/dist/editor/extensions/clipboard.d.ts +7 -0
- package/dist/editor/extensions/custom-keymap.d.ts +1 -0
- package/dist/editor/extensions/drag-and-drop.d.ts +9 -0
- package/dist/editor/hooks/useProseMirror.d.ts +13 -0
- package/dist/editor/hooks/useProseMirrorContext.d.ts +9 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/markdown.d.ts +5 -0
- package/dist/editor/nodeViews/ImageComponent.d.ts +3 -0
- package/dist/editor/nodeViews/ReactNodeView.d.ts +29 -0
- package/dist/editor/nodeViews/TaskItemComponent.d.ts +3 -0
- package/dist/editor/nodeViews/index.d.ts +6 -0
- package/dist/editor/plugins/index.d.ts +2 -0
- package/dist/editor/plugins/inputrules.d.ts +6 -0
- package/dist/editor/plugins/placeholderPlugin.d.ts +3 -0
- package/dist/editor/plugins/slashCommandPlugin.d.ts +12 -0
- package/dist/editor/schema.d.ts +2 -0
- package/dist/editor/selectors/ai-selector.d.ts +0 -0
- package/dist/editor/selectors/color-selector.d.ts +10 -0
- package/dist/editor/selectors/link-selector.d.ts +8 -0
- package/dist/editor/selectors/node-selector.d.ts +15 -0
- package/dist/editor/selectors/text-buttons.d.ts +1 -0
- package/dist/editor/types.d.ts +5 -0
- package/dist/editor/useProseMirror.d.ts +16 -0
- package/dist/editor/utils/prosemirror-utils.d.ts +7 -0
- package/dist/editor/utils/remove_classes.d.ts +1 -0
- package/dist/editor/utils/useDebouncedCallback.d.ts +1 -0
- package/dist/editor.js +3834 -0
- package/dist/editor.js.map +1 -0
- package/dist/form/EntityForm.d.ts +10 -0
- package/dist/form/EntityFormActions.d.ts +2 -0
- package/dist/form/PropertyFieldBinding.d.ts +30 -0
- package/dist/form/components/ErrorFocus.d.ts +4 -0
- package/dist/form/components/FieldHelperText.d.ts +12 -0
- package/dist/form/components/FormEntry.d.ts +6 -0
- package/dist/form/components/FormLayout.d.ts +5 -0
- package/dist/form/components/LabelWithIcon.d.ts +14 -0
- package/dist/form/components/LabelWithIconAndTooltip.d.ts +15 -0
- package/dist/form/components/LocalChangesMenu.d.ts +11 -0
- package/dist/form/components/StorageItemPreview.d.ts +14 -0
- package/dist/form/components/StorageUploadProgress.d.ts +10 -0
- package/dist/form/components/index.d.ts +5 -0
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +13 -0
- package/dist/form/field_bindings/BlockFieldBinding.d.ts +11 -0
- package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +12 -0
- package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +8 -0
- package/dist/form/field_bindings/MapFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +12 -0
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/MultipleRelationFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +11 -0
- package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/RelationFieldBinding.d.ts +3 -0
- package/dist/form/field_bindings/RepeatFieldBinding.d.ts +11 -0
- package/dist/form/field_bindings/SelectFieldBinding.d.ts +11 -0
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +21 -0
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/TextFieldBinding.d.ts +9 -0
- package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +14 -0
- package/dist/form/index.d.ts +20 -0
- package/dist/form/useClearRestoreValue.d.ts +13 -0
- package/dist/form/validation.d.ts +21 -0
- package/dist/hooks/index.d.ts +15 -0
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.d.ts +5 -0
- package/dist/hooks/navigation/contexts/NavigationStateContext.d.ts +4 -0
- package/dist/hooks/navigation/contexts/UrlContext.d.ts +4 -0
- package/dist/hooks/navigation/contexts/index.d.ts +3 -0
- package/dist/hooks/navigation/useBuildCollectionRegistryController.d.ts +7 -0
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +34 -0
- package/dist/hooks/navigation/useBuildUrlController.d.ts +7 -0
- package/dist/hooks/navigation/useNavigationRegistry.d.ts +11 -0
- package/dist/hooks/navigation/useNavigationResolution.d.ts +7 -0
- package/dist/hooks/navigation/useNavigationURLs.d.ts +11 -0
- package/dist/hooks/navigation/useResolvedCollections.d.ts +28 -0
- package/dist/hooks/navigation/useResolvedViews.d.ts +29 -0
- package/dist/hooks/navigation/useTopLevelNavigation.d.ts +27 -0
- package/dist/hooks/navigation/utils.d.ts +12 -0
- package/dist/hooks/useBreadcrumbsController.d.ts +42 -0
- package/dist/hooks/useBuildSideDialogsController.d.ts +2 -0
- package/dist/hooks/useBuildSideEntityController.d.ts +6 -0
- package/dist/hooks/useCMSContext.d.ts +27 -0
- package/dist/hooks/useEntityHistory.d.ts +30 -0
- package/dist/hooks/useEntitySelectionDialog.d.ts +18 -0
- package/dist/hooks/useResolvedNavigationFrom.d.ts +73 -0
- package/dist/hooks/useSideDialogsController.d.ts +19 -0
- package/dist/hooks/useSideEntityController.d.ts +11 -0
- package/dist/index-CBhrgpR7.js +12 -0
- package/dist/index-CBhrgpR7.js.map +1 -0
- package/dist/index-CHxgwt6E.js +456 -0
- package/dist/index-CHxgwt6E.js.map +1 -0
- package/dist/index-Dey5WJpO.js +8 -0
- package/dist/index-Dey5WJpO.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +799 -0
- package/dist/index.js.map +1 -0
- package/dist/markdown-z2Ir7Cgo.js +618 -0
- package/dist/markdown-z2Ir7Cgo.js.map +1 -0
- package/dist/preview/PropertyPreview.d.ts +7 -0
- package/dist/preview/components/ArrayEnumPreview.d.ts +11 -0
- package/dist/preview/components/BooleanPreview.d.ts +11 -0
- package/dist/preview/components/DatePreview.d.ts +17 -0
- package/dist/preview/components/EmptyValue.d.ts +6 -0
- package/dist/preview/components/EnumValuesChip.d.ts +13 -0
- package/dist/preview/components/ImagePreview.d.ts +16 -0
- package/dist/preview/components/ReferencePreview.d.ts +17 -0
- package/dist/preview/components/RelationPreview.d.ts +17 -0
- package/dist/preview/components/StorageThumbnail.d.ts +15 -0
- package/dist/preview/components/UrlComponentPreview.d.ts +14 -0
- package/dist/preview/components/UserPreview.d.ts +9 -0
- package/dist/preview/index.d.ts +23 -0
- package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOfRelationsPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +6 -0
- package/dist/preview/property_previews/MapPropertyPreview.d.ts +9 -0
- package/dist/preview/property_previews/NumberPropertyPreview.d.ts +7 -0
- package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +14 -0
- package/dist/preview/property_previews/StringPropertyPreview.d.ts +7 -0
- package/dist/preview/util.d.ts +7 -0
- package/dist/routes/CustomViewRoute.d.ts +4 -0
- package/dist/routes/RebaseRoute.d.ts +1 -0
- package/dist/routes/index.d.ts +2 -0
- package/dist/types/components/EntityFormActionsProps.d.ts +19 -0
- package/dist/types/components/EntityFormProps.d.ts +48 -0
- package/dist/types/components/PropertyPreviewProps.d.ts +47 -0
- package/dist/types/components/formex.d.ts +40 -0
- package/dist/types/components/index.d.ts +3 -0
- package/dist/types/fields.d.ts +221 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/useEntityHistory-Dcj4zhGj.js +121 -0
- package/dist/useEntityHistory-Dcj4zhGj.js.map +1 -0
- package/dist/util/entity_actions.d.ts +2 -0
- package/dist/util/index.d.ts +5 -0
- package/dist/util/navigation_utils.d.ts +17 -0
- package/dist/util/previews.d.ts +4 -0
- package/dist/util/property_utils.d.ts +25 -0
- package/dist/util/resolutions.d.ts +9 -0
- package/dist/util-BQ82ySL3.js +27720 -0
- package/dist/util-BQ82ySL3.js.map +1 -0
- package/package.json +171 -0
- package/src/collection_editor/CollectionEditorDialogsContext.tsx +25 -0
- package/src/collection_editor/ConfigControllerProvider.tsx +407 -0
- package/src/collection_editor/_cms_internals.ts +41 -0
- package/src/collection_editor/api/generateCollectionApi.ts +125 -0
- package/src/collection_editor/api/index.ts +1 -0
- package/src/collection_editor/index.ts +63 -0
- package/src/collection_editor/pgColumnToProperty.ts +273 -0
- package/src/collection_editor/types/collection_editor_controller.tsx +64 -0
- package/src/collection_editor/types/collection_inference.ts +17 -0
- package/src/collection_editor/types/config_controller.tsx +109 -0
- package/src/collection_editor/types/config_permissions.ts +20 -0
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +186 -0
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +50 -0
- package/src/collection_editor/ui/EditorCollectionAction.tsx +58 -0
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +93 -0
- package/src/collection_editor/ui/EditorEntityAction.tsx +54 -0
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +120 -0
- package/src/collection_editor/ui/KanbanSetupAction.tsx +40 -0
- package/src/collection_editor/ui/MissingReferenceWidget.tsx +33 -0
- package/src/collection_editor/ui/NewCollectionButton.tsx +27 -0
- package/src/collection_editor/ui/NewCollectionCard.tsx +53 -0
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +53 -0
- package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +246 -0
- package/src/collection_editor/ui/collection_editor/AIModifiedPathsContext.tsx +90 -0
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +417 -0
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +977 -0
- package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +286 -0
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +164 -0
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +589 -0
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +332 -0
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +242 -0
- package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +101 -0
- package/src/collection_editor/ui/collection_editor/CollectionYupValidation.tsx +9 -0
- package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +133 -0
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +302 -0
- package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +151 -0
- package/src/collection_editor/ui/collection_editor/EntityActionsSelectDialog.tsx +40 -0
- package/src/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +39 -0
- package/src/collection_editor/ui/collection_editor/EnumForm.tsx +358 -0
- package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +252 -0
- package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +142 -0
- package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +194 -0
- package/src/collection_editor/ui/collection_editor/LayoutModeSwitch.tsx +41 -0
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +777 -0
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +155 -0
- package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +350 -0
- package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +241 -0
- package/src/collection_editor/ui/collection_editor/SwitchControl.tsx +39 -0
- package/src/collection_editor/ui/collection_editor/ViewModeSwitch.tsx +47 -0
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +67 -0
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.tsx +295 -0
- package/src/collection_editor/ui/collection_editor/import/clean_import_data.ts +57 -0
- package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +147 -0
- package/src/collection_editor/ui/collection_editor/properties/BooleanPropertyField.tsx +41 -0
- package/src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx +113 -0
- package/src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx +250 -0
- package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +125 -0
- package/src/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.tsx +20 -0
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +153 -0
- package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +210 -0
- package/src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx +117 -0
- package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +163 -0
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +346 -0
- package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +106 -0
- package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +360 -0
- package/src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx +148 -0
- package/src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx +90 -0
- package/src/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +47 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +915 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.tsx +29 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.tsx +614 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/index.ts +6 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/property_paths.ts +93 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +52 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +63 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +117 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +154 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.tsx +29 -0
- package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +112 -0
- package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +183 -0
- package/src/collection_editor/ui/collection_editor/templates/products_template.ts +88 -0
- package/src/collection_editor/ui/collection_editor/templates/users_template.ts +42 -0
- package/src/collection_editor/ui/collection_editor/util.ts +28 -0
- package/src/collection_editor/ui/collection_editor/utils/strings.ts +1 -0
- package/src/collection_editor/ui/collection_editor/utils/supported_fields.tsx +34 -0
- package/src/collection_editor/ui/collection_editor/utils/update_property_for_widget.ts +281 -0
- package/src/collection_editor/useCollectionEditorController.tsx +9 -0
- package/src/collection_editor/useCollectionsConfigController.tsx +9 -0
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +120 -0
- package/src/collection_editor/validateCollectionJson.ts +379 -0
- package/src/collection_editor_ui.ts +15 -0
- package/src/components/AdminModeSyncer.tsx +56 -0
- package/src/components/ArrayContainer.tsx +538 -0
- package/src/components/ClearFilterSortButton.tsx +48 -0
- package/src/components/CollectionEditorDialogs.tsx +68 -0
- package/src/components/DefaultAppBar.tsx +242 -0
- package/src/components/DefaultDrawer.tsx +347 -0
- package/src/components/DeleteEntityDialog.tsx +182 -0
- package/src/components/DrawerNavigationGroup.tsx +130 -0
- package/src/components/DrawerNavigationItem.tsx +65 -0
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +233 -0
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +385 -0
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +171 -0
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +340 -0
- package/src/components/EntityCollectionTable/column_utils.tsx +75 -0
- package/src/components/EntityCollectionTable/fields/TableMultipleRelationField.tsx +130 -0
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +172 -0
- package/src/components/EntityCollectionTable/fields/TableRelationField.tsx +181 -0
- package/src/components/EntityCollectionTable/fields/TableRelationSelectorField.tsx +42 -0
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +322 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableDateField.tsx +39 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableInput.tsx +90 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableNumberInput.tsx +80 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableSelect.tsx +133 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableSwitch.tsx +32 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableUserSelect.tsx +41 -0
- package/src/components/EntityCollectionTable/index.tsx +14 -0
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +102 -0
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +310 -0
- package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +81 -0
- package/src/components/EntityCollectionTable/internal/common.tsx +73 -0
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +418 -0
- package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +96 -0
- package/src/components/EntityCollectionTable/internal/popup_field/useWindowSize.tsx +22 -0
- package/src/components/EntityCollectionTable/table_bindings.tsx +346 -0
- package/src/components/EntityCollectionView/Board.tsx +474 -0
- package/src/components/EntityCollectionView/BoardColumn.tsx +158 -0
- package/src/components/EntityCollectionView/BoardColumnTitle.tsx +45 -0
- package/src/components/EntityCollectionView/BoardSortableList.tsx +177 -0
- package/src/components/EntityCollectionView/EntityBoardCard.tsx +264 -0
- package/src/components/EntityCollectionView/EntityCard.tsx +224 -0
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +614 -0
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +267 -0
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +816 -0
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +1277 -0
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +179 -0
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +148 -0
- package/src/components/EntityCollectionView/FiltersDialog.tsx +242 -0
- package/src/components/EntityCollectionView/SplitListView.tsx +314 -0
- package/src/components/EntityCollectionView/ViewModeToggle.tsx +199 -0
- package/src/components/EntityCollectionView/board_types.ts +113 -0
- package/src/components/EntityCollectionView/hooks/useCollectionInlineEditor.ts +79 -0
- package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +140 -0
- package/src/components/EntityCollectionView/useBoardDataController.tsx +675 -0
- package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +442 -0
- package/src/components/EntityCollectionView/useSelectionController.tsx +39 -0
- package/src/components/EntityCollectionView/utils.ts +19 -0
- package/src/components/EntityEditView.tsx +632 -0
- package/src/components/EntityEditViewFormActions.tsx +352 -0
- package/src/components/EntityJsonPreview.tsx +66 -0
- package/src/components/EntityPreview.tsx +372 -0
- package/src/components/EntitySidePanel.tsx +160 -0
- package/src/components/EntityView.tsx +69 -0
- package/src/components/FieldCaption.tsx +14 -0
- package/src/components/HomePage/ContentHomePage.tsx +567 -0
- package/src/components/HomePage/FavouritesView.tsx +61 -0
- package/src/components/HomePage/HomePageDnD.tsx +703 -0
- package/src/components/HomePage/NavigationCard.tsx +88 -0
- package/src/components/HomePage/NavigationCardBinding.tsx +108 -0
- package/src/components/HomePage/NavigationGroup.tsx +157 -0
- package/src/components/HomePage/RenameGroupDialog.tsx +123 -0
- package/src/components/HomePage/SmallNavigationCard.tsx +46 -0
- package/src/components/HomePage/index.tsx +5 -0
- package/src/components/PropertyCollectionView.tsx +335 -0
- package/src/components/PropertyConfigBadge.tsx +27 -0
- package/src/components/PropertyIdCopyTooltip.tsx +48 -0
- package/src/components/RebaseAuthGate.tsx +42 -0
- package/src/components/RebaseCMS.tsx +27 -0
- package/src/components/RebaseLayout.tsx +73 -0
- package/src/components/RebaseNavigation.tsx +230 -0
- package/src/components/RebaseRouteDefs.tsx +130 -0
- package/src/components/RebaseShell.tsx +70 -0
- package/src/components/ReferenceTable/EntitySelectionTable.tsx +363 -0
- package/src/components/ReferenceWidget.tsx +155 -0
- package/src/components/RelationSelector.tsx +672 -0
- package/src/components/SearchIconsView.tsx +96 -0
- package/src/components/SelectableTable/SelectableTable.tsx +356 -0
- package/src/components/SelectableTable/SelectableTableContext.tsx +6 -0
- package/src/components/SelectableTable/SelectionStore.ts +67 -0
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +51 -0
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +125 -0
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +208 -0
- package/src/components/SelectableTable/filters/RelationFilterField.tsx +138 -0
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +221 -0
- package/src/components/SideDialogs.tsx +208 -0
- package/src/components/SideEntityProvider.tsx +76 -0
- package/src/components/UserSelector.tsx +339 -0
- package/src/components/admin/RoleChip.tsx +23 -0
- package/src/components/admin/RolesView.tsx +419 -0
- package/src/components/admin/UsersView.tsx +782 -0
- package/src/components/admin/index.ts +3 -0
- package/src/components/app/AppBar.tsx +17 -0
- package/src/components/app/Drawer.tsx +30 -0
- package/src/components/app/Scaffold.tsx +242 -0
- package/src/components/app/index.ts +4 -0
- package/src/components/app/useApp.tsx +36 -0
- package/src/components/common/default_entity_actions.tsx +156 -0
- package/src/components/common/index.ts +1 -0
- package/src/components/field_configs.tsx +423 -0
- package/src/components/history/EntityHistoryEntry.tsx +182 -0
- package/src/components/history/EntityHistoryView.tsx +191 -0
- package/src/components/history/LastEditedByFormAction.tsx +24 -0
- package/src/components/history/LastEditedByIndicator.tsx +98 -0
- package/src/components/history/UserChip.tsx +15 -0
- package/src/components/history/index.tsx +5 -0
- package/src/components/index.ts +55 -0
- package/src/contexts/BreacrumbsContext.tsx +53 -0
- package/src/contexts/SideDialogsControllerContext.tsx +5 -0
- package/src/contexts/SideEntityControllerContext.tsx +5 -0
- package/src/data_export/export/BasicExportAction.tsx +143 -0
- package/src/data_export/export/ExportCollectionAction.tsx +266 -0
- package/src/data_export/export/export.ts +248 -0
- package/src/data_export/export/index.ts +3 -0
- package/src/data_export/index.ts +1 -0
- package/src/data_import/components/DataNewPropertiesMapping.tsx +231 -0
- package/src/data_import/components/ImportFileUpload.tsx +43 -0
- package/src/data_import/components/ImportNewPropertyFieldPreview.tsx +60 -0
- package/src/data_import/components/ImportSaveInProgress.tsx +121 -0
- package/src/data_import/components/index.ts +4 -0
- package/src/data_import/hooks/index.ts +1 -0
- package/src/data_import/hooks/useImportConfig.tsx +34 -0
- package/src/data_import/import/ImportCollectionAction.tsx +436 -0
- package/src/data_import/import/index.ts +1 -0
- package/src/data_import/index.ts +5 -0
- package/src/data_import/types/column_mapping.ts +32 -0
- package/src/data_import/types/index.ts +1 -0
- package/src/data_import/utils/data.ts +148 -0
- package/src/data_import/utils/file_headers.ts +90 -0
- package/src/data_import/utils/file_to_json.ts +106 -0
- package/src/data_import/utils/get_import_inference_type.ts +27 -0
- package/src/data_import/utils/get_properties_mapping.ts +67 -0
- package/src/data_import/utils/index.ts +3 -0
- package/src/editor/components/SlashCommandMenu.tsx +517 -0
- package/src/editor/components/editor-bubble-item.tsx +32 -0
- package/src/editor/components/editor-bubble.tsx +120 -0
- package/src/editor/components/image-bubble.tsx +165 -0
- package/src/editor/components/index.ts +14 -0
- package/src/editor/components/table-bubble.tsx +171 -0
- package/src/editor/editor.tsx +510 -0
- package/src/editor/extensions/HighlightDecorationExtension.ts +114 -0
- package/src/editor/extensions/Image/index.ts +133 -0
- package/src/editor/extensions/Image.ts +159 -0
- package/src/editor/extensions/TextLoadingDecorationExtension.tsx +107 -0
- package/src/editor/extensions/clipboard.ts +72 -0
- package/src/editor/extensions/custom-keymap.ts +25 -0
- package/src/editor/extensions/drag-and-drop.tsx +508 -0
- package/src/editor/hooks/useProseMirror.ts +126 -0
- package/src/editor/hooks/useProseMirrorContext.ts +15 -0
- package/src/editor/index.ts +2 -0
- package/src/editor/markdown.ts +205 -0
- package/src/editor/nodeViews/ImageComponent.tsx +20 -0
- package/src/editor/nodeViews/ReactNodeView.tsx +89 -0
- package/src/editor/nodeViews/TaskItemComponent.tsx +29 -0
- package/src/editor/nodeViews/index.ts +35 -0
- package/src/editor/plugins/index.ts +58 -0
- package/src/editor/plugins/inputrules.ts +82 -0
- package/src/editor/plugins/placeholderPlugin.ts +55 -0
- package/src/editor/plugins/slashCommandPlugin.ts +65 -0
- package/src/editor/schema.ts +263 -0
- package/src/editor/selectors/ai-selector.tsx +111 -0
- package/src/editor/selectors/color-selector.tsx +200 -0
- package/src/editor/selectors/link-selector.tsx +119 -0
- package/src/editor/selectors/node-selector.tsx +145 -0
- package/src/editor/selectors/text-buttons.tsx +80 -0
- package/src/editor/types.ts +6 -0
- package/src/editor/useProseMirror.ts +125 -0
- package/src/editor/utils/prosemirror-utils.ts +113 -0
- package/src/editor/utils/remove_classes.ts +17 -0
- package/src/editor/utils/useDebouncedCallback.ts +25 -0
- package/src/form/EntityForm.tsx +855 -0
- package/src/form/EntityFormActions.tsx +214 -0
- package/src/form/PropertyFieldBinding.tsx +344 -0
- package/src/form/components/ErrorFocus.tsx +44 -0
- package/src/form/components/FieldHelperText.tsx +85 -0
- package/src/form/components/FormEntry.tsx +22 -0
- package/src/form/components/FormLayout.tsx +16 -0
- package/src/form/components/LabelWithIcon.tsx +43 -0
- package/src/form/components/LabelWithIconAndTooltip.tsx +28 -0
- package/src/form/components/LocalChangesMenu.tsx +132 -0
- package/src/form/components/StorageItemPreview.tsx +82 -0
- package/src/form/components/StorageUploadProgress.tsx +105 -0
- package/src/form/components/index.tsx +5 -0
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +107 -0
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +171 -0
- package/src/form/field_bindings/BlockFieldBinding.tsx +280 -0
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +72 -0
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +554 -0
- package/src/form/field_bindings/MapFieldBinding.tsx +162 -0
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +232 -0
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +123 -0
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +157 -0
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +66 -0
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +141 -0
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +141 -0
- package/src/form/field_bindings/RelationFieldBinding.tsx +184 -0
- package/src/form/field_bindings/RepeatFieldBinding.tsx +139 -0
- package/src/form/field_bindings/SelectFieldBinding.tsx +110 -0
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +493 -0
- package/src/form/field_bindings/SwitchFieldBinding.tsx +65 -0
- package/src/form/field_bindings/TextFieldBinding.tsx +156 -0
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +66 -0
- package/src/form/index.tsx +27 -0
- package/src/form/useClearRestoreValue.tsx +36 -0
- package/src/form/validation.ts +519 -0
- package/src/hooks/index.ts +15 -0
- package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +20 -0
- package/src/hooks/navigation/contexts/NavigationStateContext.tsx +16 -0
- package/src/hooks/navigation/contexts/UrlContext.tsx +25 -0
- package/src/hooks/navigation/contexts/index.ts +14 -0
- package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +171 -0
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +133 -0
- package/src/hooks/navigation/useBuildUrlController.tsx +66 -0
- package/src/hooks/navigation/useNavigationRegistry.ts +153 -0
- package/src/hooks/navigation/useNavigationResolution.ts +91 -0
- package/src/hooks/navigation/useNavigationURLs.ts +56 -0
- package/src/hooks/navigation/useResolvedCollections.ts +133 -0
- package/src/hooks/navigation/useResolvedViews.tsx +216 -0
- package/src/hooks/navigation/useTopLevelNavigation.ts +257 -0
- package/src/hooks/navigation/utils.ts +176 -0
- package/src/hooks/useBreadcrumbsController.tsx +49 -0
- package/src/hooks/useBuildSideDialogsController.tsx +145 -0
- package/src/hooks/useBuildSideEntityController.tsx +310 -0
- package/src/hooks/useCMSContext.tsx +79 -0
- package/src/hooks/useEntityHistory.ts +167 -0
- package/src/hooks/useEntitySelectionDialog.tsx +57 -0
- package/src/hooks/useResolvedNavigationFrom.tsx +160 -0
- package/src/hooks/useSideDialogsController.tsx +25 -0
- package/src/hooks/useSideEntityController.tsx +13 -0
- package/src/index.ts +95 -0
- package/src/preview/PropertyPreview.tsx +292 -0
- package/src/preview/components/ArrayEnumPreview.tsx +39 -0
- package/src/preview/components/BooleanPreview.tsx +25 -0
- package/src/preview/components/DatePreview.tsx +93 -0
- package/src/preview/components/EmptyValue.tsx +10 -0
- package/src/preview/components/EnumValuesChip.tsx +39 -0
- package/src/preview/components/ImagePreview.tsx +143 -0
- package/src/preview/components/ReferencePreview.tsx +166 -0
- package/src/preview/components/RelationPreview.tsx +160 -0
- package/src/preview/components/StorageThumbnail.tsx +90 -0
- package/src/preview/components/UrlComponentPreview.tsx +115 -0
- package/src/preview/components/UserPreview.tsx +30 -0
- package/src/preview/index.ts +25 -0
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +73 -0
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +44 -0
- package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +50 -0
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +49 -0
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +44 -0
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +72 -0
- package/src/preview/property_previews/ArrayPropertyEnumPreview.tsx +35 -0
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +70 -0
- package/src/preview/property_previews/MapPropertyPreview.tsx +146 -0
- package/src/preview/property_previews/NumberPropertyPreview.tsx +29 -0
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +277 -0
- package/src/preview/property_previews/StringPropertyPreview.tsx +59 -0
- package/src/preview/util.ts +30 -0
- package/src/routes/CustomViewRoute.tsx +24 -0
- package/src/routes/RebaseRoute.tsx +344 -0
- package/src/routes/index.ts +2 -0
- package/src/types/components/EntityFormActionsProps.tsx +20 -0
- package/src/types/components/EntityFormProps.tsx +54 -0
- package/src/types/components/PropertyPreviewProps.tsx +59 -0
- package/src/types/components/formex.tsx +46 -0
- package/src/types/components/index.ts +3 -0
- package/src/types/fields.tsx +299 -0
- package/src/types/index.ts +4 -0
- package/src/util/entity_actions.ts +28 -0
- package/src/util/index.ts +5 -0
- package/src/util/navigation_utils.ts +69 -0
- package/src/util/previews.ts +50 -0
- package/src/util/property_utils.tsx +215 -0
- package/src/util/resolutions.ts +71 -0
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React__default, { useState, useRef, useCallback, useEffect } from "react";
|
|
3
|
+
import { useSnackbarController, useAuthController, useTranslation, ConfirmationDialog } from "@rebasepro/core";
|
|
4
|
+
import "react-compiler-runtime";
|
|
5
|
+
import "fast-equals";
|
|
6
|
+
import { CenteredView, CircularProgress, Container, Typography, Button, Select, SelectItem, SearchBar, Table, TableHeader, TableCell, TableBody, TableRow, Skeleton, Tooltip, IconButton, iconSize, Dialog, DialogTitle, DialogContent, TextField, MultiSelect, MultiSelectItem, DialogActions, LoadingButton } from "@rebasepro/ui";
|
|
7
|
+
import { PlusIcon, KeyRoundIcon, Trash2Icon, ChevronLeftIcon, ChevronRightIcon, MailIcon, CheckCircleIcon, CopyIcon } from "lucide-react";
|
|
8
|
+
import "@rebasepro/common";
|
|
9
|
+
import "@rebasepro/formex";
|
|
10
|
+
import "zod";
|
|
11
|
+
import "@rebasepro/utils";
|
|
12
|
+
import { i as useBreadcrumbsController } from "./util-BQ82ySL3.js";
|
|
13
|
+
import "date-fns";
|
|
14
|
+
import "date-fns/locale";
|
|
15
|
+
import "@rebasepro/types";
|
|
16
|
+
import "@dnd-kit/core";
|
|
17
|
+
import "@dnd-kit/modifiers";
|
|
18
|
+
import "@dnd-kit/sortable";
|
|
19
|
+
import "@dnd-kit/utilities";
|
|
20
|
+
import "react-dropzone";
|
|
21
|
+
import "react-router-dom";
|
|
22
|
+
import "react-router";
|
|
23
|
+
import "xlsx";
|
|
24
|
+
import "@rebasepro/schema-inference";
|
|
25
|
+
import { R as RoleChip } from "./RoleChip-QtUFXeTp.js";
|
|
26
|
+
const PAGE_SIZE = 25;
|
|
27
|
+
function UsersView({
|
|
28
|
+
userManagement
|
|
29
|
+
}) {
|
|
30
|
+
const {
|
|
31
|
+
roles,
|
|
32
|
+
saveUser,
|
|
33
|
+
createUser,
|
|
34
|
+
deleteUser,
|
|
35
|
+
resetPassword,
|
|
36
|
+
loading: delegateLoading,
|
|
37
|
+
bootstrapAdmin
|
|
38
|
+
} = userManagement;
|
|
39
|
+
const snackbarController = useSnackbarController();
|
|
40
|
+
const {
|
|
41
|
+
user: loggedInUser
|
|
42
|
+
} = useAuthController();
|
|
43
|
+
const {
|
|
44
|
+
t
|
|
45
|
+
} = useTranslation();
|
|
46
|
+
const breadcrumbs = useBreadcrumbsController();
|
|
47
|
+
React__default.useEffect(() => {
|
|
48
|
+
breadcrumbs.set({
|
|
49
|
+
breadcrumbs: [{
|
|
50
|
+
title: t("users"),
|
|
51
|
+
url: "/users"
|
|
52
|
+
}]
|
|
53
|
+
});
|
|
54
|
+
}, []);
|
|
55
|
+
const [dialogOpen, setDialogOpen] = useState(false);
|
|
56
|
+
const [selectedUser, setSelectedUser] = useState();
|
|
57
|
+
const [deleteConfirmOpen, setDeleteConfirmOpen] = useState(false);
|
|
58
|
+
const [userToDelete, setUserToDelete] = useState();
|
|
59
|
+
const [deleteInProgress, setDeleteInProgress] = useState(false);
|
|
60
|
+
const [formKey, setFormKey] = useState(0);
|
|
61
|
+
const [bootstrapping, setBootstrapping] = useState(false);
|
|
62
|
+
const [creationResult, setCreationResult] = useState(null);
|
|
63
|
+
const [resetConfirmOpen, setResetConfirmOpen] = useState(false);
|
|
64
|
+
const [userToReset, setUserToReset] = useState();
|
|
65
|
+
const [resetInProgress, setResetInProgress] = useState(false);
|
|
66
|
+
const hasServerSearch = !!userManagement.searchUsers;
|
|
67
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
68
|
+
const [roleFilter, setRoleFilter] = useState("");
|
|
69
|
+
const [page, setPage] = useState(0);
|
|
70
|
+
const [paginatedUsers, setPaginatedUsers] = useState([]);
|
|
71
|
+
const [totalUsers, setTotalUsers] = useState(0);
|
|
72
|
+
const [tableLoading, setTableLoading] = useState(hasServerSearch);
|
|
73
|
+
const searchTimerRef = useRef(null);
|
|
74
|
+
const allUsers = userManagement.users;
|
|
75
|
+
const fetchPage = useCallback(async (pageNum, search, filterRole, forceLoading = false) => {
|
|
76
|
+
if (!userManagement.searchUsers) return;
|
|
77
|
+
if (forceLoading) {
|
|
78
|
+
setTableLoading(true);
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
const result = await userManagement.searchUsers({
|
|
82
|
+
search: search || void 0,
|
|
83
|
+
roleId: filterRole || void 0,
|
|
84
|
+
limit: PAGE_SIZE,
|
|
85
|
+
offset: pageNum * PAGE_SIZE,
|
|
86
|
+
orderBy: "createdAt",
|
|
87
|
+
orderDir: "desc"
|
|
88
|
+
});
|
|
89
|
+
setPaginatedUsers(result.users);
|
|
90
|
+
setTotalUsers(result.total);
|
|
91
|
+
} catch (error) {
|
|
92
|
+
console.error("Failed to fetch users:", error);
|
|
93
|
+
snackbarController.open({
|
|
94
|
+
type: "error",
|
|
95
|
+
message: error instanceof Error ? error.message : "Failed to load users"
|
|
96
|
+
});
|
|
97
|
+
} finally {
|
|
98
|
+
setTableLoading(false);
|
|
99
|
+
}
|
|
100
|
+
}, [userManagement.searchUsers, snackbarController]);
|
|
101
|
+
const fetchPageRef = useRef(fetchPage);
|
|
102
|
+
fetchPageRef.current = fetchPage;
|
|
103
|
+
const initialFetchDone = useRef(false);
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (!delegateLoading && hasServerSearch && !initialFetchDone.current) {
|
|
106
|
+
initialFetchDone.current = true;
|
|
107
|
+
fetchPageRef.current(0, "", roleFilter, true);
|
|
108
|
+
}
|
|
109
|
+
}, [delegateLoading, hasServerSearch, roleFilter]);
|
|
110
|
+
const handleSearch = useCallback((value) => {
|
|
111
|
+
setSearchQuery(value);
|
|
112
|
+
setPage(0);
|
|
113
|
+
if (searchTimerRef.current) {
|
|
114
|
+
clearTimeout(searchTimerRef.current);
|
|
115
|
+
}
|
|
116
|
+
if (hasServerSearch) {
|
|
117
|
+
searchTimerRef.current = setTimeout(() => {
|
|
118
|
+
fetchPage(0, value, roleFilter, true);
|
|
119
|
+
}, 300);
|
|
120
|
+
}
|
|
121
|
+
}, [hasServerSearch, fetchPage, roleFilter]);
|
|
122
|
+
const handleRoleFilterChange = useCallback((newRole) => {
|
|
123
|
+
setRoleFilter(newRole);
|
|
124
|
+
setPage(0);
|
|
125
|
+
if (hasServerSearch) {
|
|
126
|
+
fetchPage(0, searchQuery, newRole, true);
|
|
127
|
+
}
|
|
128
|
+
}, [hasServerSearch, fetchPage, searchQuery]);
|
|
129
|
+
const handlePageChange = useCallback((newPage) => {
|
|
130
|
+
setPage(newPage);
|
|
131
|
+
if (hasServerSearch) {
|
|
132
|
+
fetchPage(newPage, searchQuery, roleFilter, true);
|
|
133
|
+
}
|
|
134
|
+
}, [hasServerSearch, fetchPage, searchQuery, roleFilter]);
|
|
135
|
+
const refreshCurrentPage = useCallback(() => {
|
|
136
|
+
if (hasServerSearch) {
|
|
137
|
+
fetchPage(page, searchQuery, roleFilter);
|
|
138
|
+
}
|
|
139
|
+
}, [hasServerSearch, fetchPage, page, searchQuery, roleFilter]);
|
|
140
|
+
let displayUsers;
|
|
141
|
+
let displayTotal;
|
|
142
|
+
if (hasServerSearch) {
|
|
143
|
+
displayUsers = paginatedUsers;
|
|
144
|
+
displayTotal = totalUsers;
|
|
145
|
+
} else {
|
|
146
|
+
const filtered = allUsers.filter((u) => {
|
|
147
|
+
let matches = true;
|
|
148
|
+
if (searchQuery) {
|
|
149
|
+
const q = searchQuery.toLowerCase();
|
|
150
|
+
matches = !!(u.email?.toLowerCase().includes(q) || u.displayName?.toLowerCase().includes(q));
|
|
151
|
+
}
|
|
152
|
+
if (matches && roleFilter) {
|
|
153
|
+
matches = !!u.roles?.includes(roleFilter);
|
|
154
|
+
}
|
|
155
|
+
return matches;
|
|
156
|
+
});
|
|
157
|
+
displayTotal = filtered.length;
|
|
158
|
+
displayUsers = filtered.slice(page * PAGE_SIZE, (page + 1) * PAGE_SIZE);
|
|
159
|
+
}
|
|
160
|
+
const totalPages = Math.max(1, Math.ceil(displayTotal / PAGE_SIZE));
|
|
161
|
+
const hasAdmin = allUsers.some((u_0) => u_0.roles?.includes("admin"));
|
|
162
|
+
const handleBootstrap = async () => {
|
|
163
|
+
if (!bootstrapAdmin) return;
|
|
164
|
+
setBootstrapping(true);
|
|
165
|
+
try {
|
|
166
|
+
await bootstrapAdmin();
|
|
167
|
+
snackbarController.open({
|
|
168
|
+
type: "success",
|
|
169
|
+
message: t("bootstrap_admin_success")
|
|
170
|
+
});
|
|
171
|
+
window.location.reload();
|
|
172
|
+
} catch (error_0) {
|
|
173
|
+
snackbarController.open({
|
|
174
|
+
type: "error",
|
|
175
|
+
message: error_0 instanceof Error ? error_0.message : t("failed_to_bootstrap_admin")
|
|
176
|
+
});
|
|
177
|
+
} finally {
|
|
178
|
+
setBootstrapping(false);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
const handleAddUser = () => {
|
|
182
|
+
setSelectedUser(void 0);
|
|
183
|
+
setFormKey((k) => k + 1);
|
|
184
|
+
setDialogOpen(true);
|
|
185
|
+
};
|
|
186
|
+
const handleEditUser = (user) => {
|
|
187
|
+
setSelectedUser(user);
|
|
188
|
+
setDialogOpen(true);
|
|
189
|
+
};
|
|
190
|
+
const handleClose = () => {
|
|
191
|
+
setDialogOpen(false);
|
|
192
|
+
setSelectedUser(void 0);
|
|
193
|
+
};
|
|
194
|
+
const handleDelete = async () => {
|
|
195
|
+
if (!userToDelete || !deleteUser) return;
|
|
196
|
+
setDeleteInProgress(true);
|
|
197
|
+
try {
|
|
198
|
+
await deleteUser(userToDelete);
|
|
199
|
+
snackbarController.open({
|
|
200
|
+
type: "success",
|
|
201
|
+
message: t("user_deleted_successfully")
|
|
202
|
+
});
|
|
203
|
+
setDeleteConfirmOpen(false);
|
|
204
|
+
setUserToDelete(void 0);
|
|
205
|
+
refreshCurrentPage();
|
|
206
|
+
} catch (error_1) {
|
|
207
|
+
snackbarController.open({
|
|
208
|
+
type: "error",
|
|
209
|
+
message: error_1 instanceof Error ? error_1.message : t("error_deleting_user")
|
|
210
|
+
});
|
|
211
|
+
} finally {
|
|
212
|
+
setDeleteInProgress(false);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
const handleResetPassword = async () => {
|
|
216
|
+
if (!userToReset || !resetPassword) return;
|
|
217
|
+
setResetInProgress(true);
|
|
218
|
+
try {
|
|
219
|
+
const result_0 = await resetPassword(userToReset);
|
|
220
|
+
setResetConfirmOpen(false);
|
|
221
|
+
setUserToReset(void 0);
|
|
222
|
+
setCreationResult(result_0);
|
|
223
|
+
snackbarController.open({
|
|
224
|
+
type: "success",
|
|
225
|
+
message: t("reset_password_success")
|
|
226
|
+
});
|
|
227
|
+
} catch (error_2) {
|
|
228
|
+
snackbarController.open({
|
|
229
|
+
type: "error",
|
|
230
|
+
message: error_2 instanceof Error ? error_2.message : t("error_resetting_password")
|
|
231
|
+
});
|
|
232
|
+
} finally {
|
|
233
|
+
setResetInProgress(false);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
if (delegateLoading) {
|
|
237
|
+
return /* @__PURE__ */ jsx(CenteredView, { children: /* @__PURE__ */ jsx(CircularProgress, {}) });
|
|
238
|
+
}
|
|
239
|
+
return /* @__PURE__ */ jsxs(Container, { className: "w-full flex flex-col py-4 gap-4", maxWidth: "6xl", children: [
|
|
240
|
+
!hasAdmin && loggedInUser && bootstrapAdmin && /* @__PURE__ */ jsxs("div", { className: "bg-yellow-100 dark:bg-yellow-900 border border-yellow-400 dark:border-yellow-700 rounded p-4 flex items-center justify-between", children: [
|
|
241
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Typography, { variant: "label", className: "text-yellow-800 dark:text-yellow-200", children: t("no_users_or_roles_defined") }) }),
|
|
242
|
+
/* @__PURE__ */ jsx(Button, { onClick: handleBootstrap, disabled: bootstrapping, children: bootstrapping ? /* @__PURE__ */ jsx(CircularProgress, { size: "small" }) : t("add_logged_user_as_admin") })
|
|
243
|
+
] }),
|
|
244
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center mt-12 mb-4 gap-4", children: [
|
|
245
|
+
/* @__PURE__ */ jsx(Typography, { gutterBottom: true, variant: "h4", className: "grow mb-0", component: "h4", children: t("users") }),
|
|
246
|
+
roles && roles.length > 0 && /* @__PURE__ */ jsxs(Select, { value: roleFilter || "__all__", onValueChange: (v) => handleRoleFilterChange(v === "__all__" ? "" : v), placeholder: t("all_roles") || "All Roles", size: "small", className: "w-48", children: [
|
|
247
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "__all__", children: t("all_roles") || "All Roles" }),
|
|
248
|
+
roles.map((role) => /* @__PURE__ */ jsx(SelectItem, { value: role.id, children: role.name }, role.id))
|
|
249
|
+
] }),
|
|
250
|
+
/* @__PURE__ */ jsx(SearchBar, { placeholder: t("search_users"), onTextSearch: (v_0) => handleSearch(v_0 || ""), size: "small", expandable: true }),
|
|
251
|
+
/* @__PURE__ */ jsx(Button, { startIcon: /* @__PURE__ */ jsx(PlusIcon, {}), onClick: handleAddUser, disabled: !saveUser, children: t("add_user") })
|
|
252
|
+
] }),
|
|
253
|
+
/* @__PURE__ */ jsx("div", { className: "overflow-auto", children: /* @__PURE__ */ jsxs(Table, { className: "w-full", children: [
|
|
254
|
+
/* @__PURE__ */ jsxs(TableHeader, { children: [
|
|
255
|
+
/* @__PURE__ */ jsx(TableCell, { header: true, className: "w-48", children: t("id") || "ID" }),
|
|
256
|
+
/* @__PURE__ */ jsx(TableCell, { header: true, children: t("email") }),
|
|
257
|
+
/* @__PURE__ */ jsx(TableCell, { header: true, children: t("name") }),
|
|
258
|
+
/* @__PURE__ */ jsx(TableCell, { header: true, children: t("roles") }),
|
|
259
|
+
/* @__PURE__ */ jsx(TableCell, { header: true, className: "whitespace-nowrap", children: t("created") }),
|
|
260
|
+
/* @__PURE__ */ jsx(TableCell, { header: true, className: "w-24 text-right", children: t("actions") })
|
|
261
|
+
] }),
|
|
262
|
+
/* @__PURE__ */ jsxs(TableBody, { children: [
|
|
263
|
+
tableLoading ? [{
|
|
264
|
+
email: "w-48",
|
|
265
|
+
name: "w-32",
|
|
266
|
+
roles: ["w-16", "w-20"]
|
|
267
|
+
}, {
|
|
268
|
+
email: "w-32",
|
|
269
|
+
name: "w-24",
|
|
270
|
+
roles: ["w-24"]
|
|
271
|
+
}, {
|
|
272
|
+
email: "w-40",
|
|
273
|
+
name: "w-36",
|
|
274
|
+
roles: ["w-16", "w-16"]
|
|
275
|
+
}].map((row, i) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
276
|
+
/* @__PURE__ */ jsx(TableCell, { className: "font-mono text-xs", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-40" }) }),
|
|
277
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: `h-4 ${row.email}` }) }),
|
|
278
|
+
/* @__PURE__ */ jsx(TableCell, { className: "font-medium", children: /* @__PURE__ */ jsx(Skeleton, { className: `h-4 ${row.name}` }) }),
|
|
279
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: row.roles.map((w, j) => /* @__PURE__ */ jsx(Skeleton, { className: `h-6 ${w} rounded-full` }, j)) }) }),
|
|
280
|
+
/* @__PURE__ */ jsx(TableCell, { className: "whitespace-nowrap text-sm", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20" }) }),
|
|
281
|
+
/* @__PURE__ */ jsx(TableCell, { className: "text-right whitespace-nowrap", children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end items-center gap-1", children: [
|
|
282
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-7 rounded-md" }),
|
|
283
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-7 rounded-md" })
|
|
284
|
+
] }) })
|
|
285
|
+
] }, `skeleton-${i}`)) : displayUsers.map((user_0) => /* @__PURE__ */ jsxs(TableRow, { onClick: () => saveUser && handleEditUser(user_0), children: [
|
|
286
|
+
/* @__PURE__ */ jsx(TableCell, { className: "font-mono text-xs", children: user_0.uid }),
|
|
287
|
+
/* @__PURE__ */ jsx(TableCell, { children: user_0.email }),
|
|
288
|
+
/* @__PURE__ */ jsx(TableCell, { className: "font-medium", children: user_0.displayName }),
|
|
289
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: user_0.roles?.map((roleId) => {
|
|
290
|
+
const role_0 = roles?.find((r) => r.id === roleId);
|
|
291
|
+
return role_0 ? /* @__PURE__ */ jsx(RoleChip, { role: role_0 }, roleId) : /* @__PURE__ */ jsx("span", { children: roleId }, roleId);
|
|
292
|
+
}) }) }),
|
|
293
|
+
/* @__PURE__ */ jsx(TableCell, { className: "whitespace-nowrap text-sm text-surface-accent-600 dark:text-surface-accent-400", children: user_0.createdAt ? new Date(user_0.createdAt).toLocaleDateString() : "-" }),
|
|
294
|
+
/* @__PURE__ */ jsx(TableCell, { className: "text-right whitespace-nowrap", children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end items-center gap-1", children: [
|
|
295
|
+
resetPassword && /* @__PURE__ */ jsx(Tooltip, { asChild: true, title: t("reset_password"), children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: (e) => {
|
|
296
|
+
e.stopPropagation();
|
|
297
|
+
setUserToReset(user_0);
|
|
298
|
+
setResetConfirmOpen(true);
|
|
299
|
+
}, children: /* @__PURE__ */ jsx(KeyRoundIcon, { size: iconSize.small }) }) }),
|
|
300
|
+
deleteUser && /* @__PURE__ */ jsx(Tooltip, { asChild: true, title: t("delete_this_user"), children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: (e_0) => {
|
|
301
|
+
e_0.stopPropagation();
|
|
302
|
+
setUserToDelete(user_0);
|
|
303
|
+
setDeleteConfirmOpen(true);
|
|
304
|
+
}, children: /* @__PURE__ */ jsx(Trash2Icon, { size: iconSize.small }) }) })
|
|
305
|
+
] }) })
|
|
306
|
+
] }, user_0.uid)),
|
|
307
|
+
displayUsers.length === 0 && !tableLoading && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colspan: 5, children: /* @__PURE__ */ jsx(CenteredView, { className: "flex flex-col gap-4 my-8 items-center", children: /* @__PURE__ */ jsx(Typography, { variant: "label", children: searchQuery ? t("no_users_found") : t("no_users_yet") }) }) }) })
|
|
308
|
+
] })
|
|
309
|
+
] }) }),
|
|
310
|
+
displayTotal > PAGE_SIZE && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-2 py-3", children: [
|
|
311
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-surface-accent-500 dark:text-surface-accent-400", children: `${page * PAGE_SIZE + 1}–${Math.min((page + 1) * PAGE_SIZE, displayTotal)} / ${displayTotal}` }),
|
|
312
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
313
|
+
/* @__PURE__ */ jsx(IconButton, { size: "small", disabled: page === 0, onClick: () => handlePageChange(page - 1), children: /* @__PURE__ */ jsx(ChevronLeftIcon, { size: iconSize.smallest }) }),
|
|
314
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "body2", className: "px-3 text-surface-accent-600 dark:text-surface-accent-300", children: [
|
|
315
|
+
page + 1,
|
|
316
|
+
" / ",
|
|
317
|
+
totalPages
|
|
318
|
+
] }),
|
|
319
|
+
/* @__PURE__ */ jsx(IconButton, { size: "small", disabled: page >= totalPages - 1, onClick: () => handlePageChange(page + 1), children: /* @__PURE__ */ jsx(ChevronRightIcon, { size: iconSize.smallest }) })
|
|
320
|
+
] })
|
|
321
|
+
] }),
|
|
322
|
+
saveUser && /* @__PURE__ */ jsx(UserDetailsForm, { open: dialogOpen, user: selectedUser, roles, saveUser, createUser, handleClose, onCreationResult: setCreationResult, onSaved: refreshCurrentPage }, selectedUser?.uid ?? `new-${formKey}`),
|
|
323
|
+
creationResult && /* @__PURE__ */ jsx(CreationResultDialog, { result: creationResult, onClose: () => setCreationResult(null) }),
|
|
324
|
+
/* @__PURE__ */ jsx(ConfirmationDialog, { open: deleteConfirmOpen, loading: deleteInProgress, onAccept: handleDelete, onCancel: () => {
|
|
325
|
+
setDeleteConfirmOpen(false);
|
|
326
|
+
setUserToDelete(void 0);
|
|
327
|
+
}, title: /* @__PURE__ */ jsx(Fragment, { children: t("delete_confirmation_title") }), body: /* @__PURE__ */ jsx(Fragment, { children: t("delete_user_confirmation") }) }),
|
|
328
|
+
/* @__PURE__ */ jsx(ConfirmationDialog, { open: resetConfirmOpen, loading: resetInProgress, onAccept: handleResetPassword, onCancel: () => {
|
|
329
|
+
setResetConfirmOpen(false);
|
|
330
|
+
setUserToReset(void 0);
|
|
331
|
+
}, title: /* @__PURE__ */ jsx(Fragment, { children: t("reset_password") }), body: /* @__PURE__ */ jsx(Fragment, { children: t("reset_password_confirmation") }) })
|
|
332
|
+
] });
|
|
333
|
+
}
|
|
334
|
+
function CreationResultDialog({
|
|
335
|
+
result,
|
|
336
|
+
onClose
|
|
337
|
+
}) {
|
|
338
|
+
const {
|
|
339
|
+
t
|
|
340
|
+
} = useTranslation();
|
|
341
|
+
const snackbarController = useSnackbarController();
|
|
342
|
+
const [copied, setCopied] = useState(false);
|
|
343
|
+
const handleCopyPassword = async () => {
|
|
344
|
+
if (!result.temporaryPassword) return;
|
|
345
|
+
try {
|
|
346
|
+
await navigator.clipboard.writeText(result.temporaryPassword);
|
|
347
|
+
setCopied(true);
|
|
348
|
+
snackbarController.open({
|
|
349
|
+
type: "success",
|
|
350
|
+
message: t("password_copied") ?? "Password copied to clipboard"
|
|
351
|
+
});
|
|
352
|
+
setTimeout(() => setCopied(false), 3e3);
|
|
353
|
+
} catch {
|
|
354
|
+
const textArea = document.createElement("textarea");
|
|
355
|
+
textArea.value = result.temporaryPassword;
|
|
356
|
+
document.body.appendChild(textArea);
|
|
357
|
+
textArea.select();
|
|
358
|
+
document.execCommand("copy");
|
|
359
|
+
document.body.removeChild(textArea);
|
|
360
|
+
setCopied(true);
|
|
361
|
+
setTimeout(() => setCopied(false), 3e3);
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
if (result.invitationSent) {
|
|
365
|
+
return /* @__PURE__ */ jsxs(Dialog, { open: true, onOpenChange: (open) => !open ? onClose() : void 0, maxWidth: "xl", children: [
|
|
366
|
+
/* @__PURE__ */ jsx(DialogTitle, { variant: "h5", gutterBottom: false, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
367
|
+
/* @__PURE__ */ jsx(MailIcon, {}),
|
|
368
|
+
t("invitation_sent_title") ?? "Invitation Sent"
|
|
369
|
+
] }) }),
|
|
370
|
+
/* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 py-2", children: /* @__PURE__ */ jsx("div", { className: "bg-green-50 dark:bg-green-900/30 border border-green-200 dark:border-green-800 rounded-lg p-4", children: /* @__PURE__ */ jsx(Typography, { className: "text-green-800 dark:text-green-200", children: (t("invitation_sent") ?? "An invitation email has been sent to {{email}}. They can use the link to set their password.").replace("{{email}}", result.user.email ?? "") }) }) }) }),
|
|
371
|
+
/* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(Button, { variant: "filled", onClick: onClose, children: t("ok") }) })
|
|
372
|
+
] });
|
|
373
|
+
}
|
|
374
|
+
if (result.temporaryPassword) {
|
|
375
|
+
return /* @__PURE__ */ jsxs(Dialog, { open: true, onOpenChange: (open_0) => !open_0 ? onClose() : void 0, maxWidth: "xl", children: [
|
|
376
|
+
/* @__PURE__ */ jsx(DialogTitle, { variant: "h5", gutterBottom: false, children: t("temporary_password") ?? "Temporary Password" }),
|
|
377
|
+
/* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 py-2", children: [
|
|
378
|
+
/* @__PURE__ */ jsx("div", { className: "bg-amber-50 dark:bg-amber-900/30 border border-amber-200 dark:border-amber-800 rounded-lg p-4", children: /* @__PURE__ */ jsx(Typography, { className: "text-amber-800 dark:text-amber-200", variant: "body2", children: t("temporary_password_description") ?? "Email is not configured. Share this temporary password with the user securely. It will not be shown again." }) }),
|
|
379
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
380
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "mb-1", children: t("email") }),
|
|
381
|
+
/* @__PURE__ */ jsx(Typography, { children: result.user.email })
|
|
382
|
+
] }),
|
|
383
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
384
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "mb-1", children: t("temporary_password") ?? "Temporary Password" }),
|
|
385
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mt-1", children: [
|
|
386
|
+
/* @__PURE__ */ jsx("code", { className: "flex-grow bg-surface-100 dark:bg-surface-900 border border-surface-300 dark:border-surface-600 rounded px-3 py-2 font-mono text-base select-all", children: result.temporaryPassword }),
|
|
387
|
+
/* @__PURE__ */ jsx(Tooltip, { title: t("copy_password") ?? "CopyIcon password", asChild: true, children: /* @__PURE__ */ jsx(IconButton, { onClick: handleCopyPassword, children: copied ? /* @__PURE__ */ jsx(CheckCircleIcon, { className: "text-green-600" }) : /* @__PURE__ */ jsx(CopyIcon, {}) }) })
|
|
388
|
+
] })
|
|
389
|
+
] })
|
|
390
|
+
] }) }),
|
|
391
|
+
/* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(Button, { variant: "filled", onClick: onClose, children: t("ok") }) })
|
|
392
|
+
] });
|
|
393
|
+
}
|
|
394
|
+
return null;
|
|
395
|
+
}
|
|
396
|
+
function UserDetailsForm({
|
|
397
|
+
open,
|
|
398
|
+
user: userProp,
|
|
399
|
+
roles,
|
|
400
|
+
saveUser,
|
|
401
|
+
createUser,
|
|
402
|
+
handleClose,
|
|
403
|
+
onCreationResult,
|
|
404
|
+
onSaved
|
|
405
|
+
}) {
|
|
406
|
+
const snackbarController = useSnackbarController();
|
|
407
|
+
const {
|
|
408
|
+
t
|
|
409
|
+
} = useTranslation();
|
|
410
|
+
const isNewUser = !userProp;
|
|
411
|
+
const [displayName, setDisplayName] = useState(userProp?.displayName || "");
|
|
412
|
+
const [email, setEmail] = useState(userProp?.email || "");
|
|
413
|
+
const [selectedRoleIds, setSelectedRoleIds] = useState(userProp?.roles || []);
|
|
414
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
415
|
+
const [errors, setErrors] = useState({});
|
|
416
|
+
const [submitCount, setSubmitCount] = useState(0);
|
|
417
|
+
const validate = () => {
|
|
418
|
+
const newErrors = {};
|
|
419
|
+
if (!displayName) newErrors.displayName = "Required";
|
|
420
|
+
if (!email) newErrors.email = "Required";
|
|
421
|
+
else if (!/\S+@\S+\.\S+/.test(email)) newErrors.email = "Invalid email";
|
|
422
|
+
setErrors(newErrors);
|
|
423
|
+
return Object.keys(newErrors).length === 0;
|
|
424
|
+
};
|
|
425
|
+
const handleSubmit = async (e) => {
|
|
426
|
+
e.preventDefault();
|
|
427
|
+
setSubmitCount((c) => c + 1);
|
|
428
|
+
if (!validate()) return;
|
|
429
|
+
setIsSubmitting(true);
|
|
430
|
+
try {
|
|
431
|
+
const userRoles = selectedRoleIds;
|
|
432
|
+
const userToSave = {
|
|
433
|
+
uid: userProp?.uid || crypto.randomUUID(),
|
|
434
|
+
email,
|
|
435
|
+
displayName: displayName || null,
|
|
436
|
+
photoURL: userProp?.photoURL || null,
|
|
437
|
+
providerId: userProp?.providerId || "custom",
|
|
438
|
+
isAnonymous: userProp?.isAnonymous || false,
|
|
439
|
+
roles: userRoles
|
|
440
|
+
};
|
|
441
|
+
if (isNewUser && createUser && onCreationResult) {
|
|
442
|
+
const result = await createUser(userToSave);
|
|
443
|
+
handleClose();
|
|
444
|
+
onCreationResult(result);
|
|
445
|
+
} else {
|
|
446
|
+
await saveUser(userToSave);
|
|
447
|
+
handleClose();
|
|
448
|
+
}
|
|
449
|
+
onSaved?.();
|
|
450
|
+
} catch (error) {
|
|
451
|
+
snackbarController.open({
|
|
452
|
+
type: "error",
|
|
453
|
+
message: error instanceof Error ? error.message : "Failed to save user"
|
|
454
|
+
});
|
|
455
|
+
} finally {
|
|
456
|
+
setIsSubmitting(false);
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
const dirty = isNewUser || displayName !== (userProp?.displayName || "") || email !== (userProp?.email || "") || (() => {
|
|
460
|
+
const prev = userProp?.roles || [];
|
|
461
|
+
if (selectedRoleIds.length !== prev.length) return true;
|
|
462
|
+
const set = new Set(prev);
|
|
463
|
+
return selectedRoleIds.some((id) => !set.has(id));
|
|
464
|
+
})();
|
|
465
|
+
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: (open_0) => !open_0 ? handleClose() : void 0, maxWidth: "4xl", children: /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, autoComplete: "off", noValidate: true, style: {
|
|
466
|
+
display: "flex",
|
|
467
|
+
flexDirection: "column",
|
|
468
|
+
position: "relative",
|
|
469
|
+
height: "100%"
|
|
470
|
+
}, children: [
|
|
471
|
+
/* @__PURE__ */ jsx(DialogTitle, { variant: "h4", gutterBottom: false, children: t("user") }),
|
|
472
|
+
/* @__PURE__ */ jsx(DialogContent, { className: "h-full grow", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4", children: [
|
|
473
|
+
!isNewUser && /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(TextField, { name: "uid", value: userProp?.uid || "", label: t("id") || "ID", disabled: true }) }),
|
|
474
|
+
/* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
475
|
+
/* @__PURE__ */ jsx(TextField, { name: "displayName", required: true, error: submitCount > 0 && Boolean(errors.displayName), value: displayName, onChange: (e_0) => setDisplayName(e_0.target.value), label: t("name") }),
|
|
476
|
+
submitCount > 0 && errors.displayName && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "error", children: errors.displayName })
|
|
477
|
+
] }),
|
|
478
|
+
/* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
479
|
+
/* @__PURE__ */ jsx(TextField, { required: true, error: submitCount > 0 && Boolean(errors.email), name: "email", value: email, onChange: (e_1) => setEmail(e_1.target.value), label: t("email"), disabled: !isNewUser }),
|
|
480
|
+
submitCount > 0 && errors.email && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "error", children: errors.email })
|
|
481
|
+
] }),
|
|
482
|
+
roles && roles.length > 0 && /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(MultiSelect, { className: "w-full", label: t("roles"), value: selectedRoleIds, onValueChange: (value) => setSelectedRoleIds(value), children: roles.map((role) => /* @__PURE__ */ jsx(MultiSelectItem, { value: role.id, children: /* @__PURE__ */ jsx(RoleChip, { role }) }, role.id)) }) })
|
|
483
|
+
] }) }),
|
|
484
|
+
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
485
|
+
/* @__PURE__ */ jsx(Button, { variant: "text", onClick: handleClose, children: t("cancel") }),
|
|
486
|
+
/* @__PURE__ */ jsx(LoadingButton, { variant: "filled", type: "submit", disabled: !dirty, loading: isSubmitting, children: isNewUser ? t("create_user") : t("update") })
|
|
487
|
+
] })
|
|
488
|
+
] }) });
|
|
489
|
+
}
|
|
490
|
+
export {
|
|
491
|
+
UsersView
|
|
492
|
+
};
|
|
493
|
+
//# sourceMappingURL=UsersView-B5zelXnH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UsersView-B5zelXnH.js","sources":["../src/components/admin/UsersView.tsx"],"sourcesContent":["\nimport React, { useState, useEffect, useCallback, useRef } from \"react\";\nimport { User } from \"@rebasepro/types\";\nimport { useSnackbarController, useAuthController, useTranslation } from \"@rebasepro/core\";\nimport { useBreadcrumbsController } from \"../../index\";\nimport { Button, Container, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, Table, TableBody, TableCell, TableHeader, TableRow, TextField, Typography, CircularProgress, CenteredView, Tooltip, MultiSelect, MultiSelectItem, LoadingButton, SearchBar, Select, SelectItem, Skeleton , iconSize } from \"@rebasepro/ui\";\nimport { MailIcon, KeyRoundIcon, PlusIcon, Trash2Icon, CopyIcon, CheckCircleIcon, ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\nimport { RoleChip } from \"./RoleChip\";\nimport { UserManagementDelegate, Role, UserCreationResult } from \"@rebasepro/types\";\nimport { ConfirmationDialog } from \"@rebasepro/core\";\n\nconst PAGE_SIZE = 25;\n\n// ============================================\n// UsersView Component\n// ============================================\nexport function UsersView({ userManagement }: {\n userManagement: UserManagementDelegate;\n}) {\n const { roles, saveUser, createUser, deleteUser, resetPassword, loading: delegateLoading, bootstrapAdmin } = userManagement;\n const snackbarController = useSnackbarController();\n const { user: loggedInUser } = useAuthController();\n const { t } = useTranslation();\n const breadcrumbs = useBreadcrumbsController();\n\n React.useEffect(() => {\n breadcrumbs.set({\n breadcrumbs: [{ title: t(\"users\"),\nurl: \"/users\" }]\n });\n\n }, []);\n\n const [dialogOpen, setDialogOpen] = useState(false);\n const [selectedUser, setSelectedUser] = useState<User | undefined>();\n const [deleteConfirmOpen, setDeleteConfirmOpen] = useState(false);\n const [userToDelete, setUserToDelete] = useState<User | undefined>();\n const [deleteInProgress, setDeleteInProgress] = useState(false);\n const [formKey, setFormKey] = useState(0);\n const [bootstrapping, setBootstrapping] = useState(false);\n\n // Creation result state\n const [creationResult, setCreationResult] = useState<UserCreationResult | null>(null);\n\n // Reset password\n const [resetConfirmOpen, setResetConfirmOpen] = useState(false);\n const [userToReset, setUserToReset] = useState<User | undefined>();\n const [resetInProgress, setResetInProgress] = useState(false);\n\n // Check if server-side search is available\n const hasServerSearch = !!userManagement.searchUsers;\n\n // ---- Server-side pagination state ----\n const [searchQuery, setSearchQuery] = useState(\"\");\n const [roleFilter, setRoleFilter] = useState<string>(\"\");\n const [page, setPage] = useState(0);\n const [paginatedUsers, setPaginatedUsers] = useState<User[]>([]);\n const [totalUsers, setTotalUsers] = useState(0);\n const [tableLoading, setTableLoading] = useState(hasServerSearch);\n\n // Debounce timer ref for search\n const searchTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n // Fallback: use in-memory users if no searchUsers\n const allUsers = userManagement.users;\n\n /**\n * Fetch a page of users from the server.\n * Only shows the loading skeleton when we have no data yet (initial load).\n * Subsequent re-fetches (pagination, search) update in-place without flashing.\n */\n const fetchPage = useCallback(async (pageNum: number, search: string, filterRole: string, forceLoading = false) => {\n if (!userManagement.searchUsers) return;\n\n // Only show skeleton on initial load or explicit requests (search/filter/page change).\n // This avoids flashing skeletons when the effect re-fires from dep changes.\n if (forceLoading) {\n setTableLoading(true);\n }\n try {\n const result = await userManagement.searchUsers({\n search: search || undefined,\n roleId: filterRole || undefined,\n limit: PAGE_SIZE,\n offset: pageNum * PAGE_SIZE,\n orderBy: \"createdAt\",\n orderDir: \"desc\"\n });\n setPaginatedUsers(result.users);\n setTotalUsers(result.total);\n } catch (error: unknown) {\n console.error(\"Failed to fetch users:\", error);\n snackbarController.open({ type: \"error\",\nmessage: error instanceof Error ? error.message : \"Failed to load users\" });\n } finally {\n setTableLoading(false);\n }\n }, [userManagement.searchUsers, snackbarController]);\n\n // Stable ref for fetchPage so the initial-load effect doesn't re-fire\n // every time fetchPage's reference changes (which happens on parent re-renders).\n const fetchPageRef = useRef(fetchPage);\n fetchPageRef.current = fetchPage;\n const initialFetchDone = useRef(false);\n\n // Load initial page when delegate finishes loading — runs exactly once.\n useEffect(() => {\n if (!delegateLoading && hasServerSearch && !initialFetchDone.current) {\n initialFetchDone.current = true;\n fetchPageRef.current(0, \"\", roleFilter, true);\n }\n }, [delegateLoading, hasServerSearch, roleFilter]);\n\n // Handle search changes (debounced)\n const handleSearch = useCallback((value: string) => {\n setSearchQuery(value);\n setPage(0);\n\n if (searchTimerRef.current) {\n clearTimeout(searchTimerRef.current);\n }\n\n if (hasServerSearch) {\n searchTimerRef.current = setTimeout(() => {\n fetchPage(0, value, roleFilter, true);\n }, 300);\n }\n }, [hasServerSearch, fetchPage, roleFilter]);\n\n const handleRoleFilterChange = useCallback((newRole: string) => {\n setRoleFilter(newRole);\n setPage(0);\n if (hasServerSearch) {\n fetchPage(0, searchQuery, newRole, true);\n }\n }, [hasServerSearch, fetchPage, searchQuery]);\n\n // Handle page change\n const handlePageChange = useCallback((newPage: number) => {\n setPage(newPage);\n if (hasServerSearch) {\n fetchPage(newPage, searchQuery, roleFilter, true);\n }\n }, [hasServerSearch, fetchPage, searchQuery, roleFilter]);\n\n // Refresh current page (after create/update/delete)\n const refreshCurrentPage = useCallback(() => {\n if (hasServerSearch) {\n fetchPage(page, searchQuery, roleFilter);\n }\n }, [hasServerSearch, fetchPage, page, searchQuery, roleFilter]);\n\n // Determine which users to show\n let displayUsers: User[];\n let displayTotal: number;\n\n if (hasServerSearch) {\n displayUsers = paginatedUsers;\n displayTotal = totalUsers;\n } else {\n // Fallback: local filtering for backward compat\n const filtered = allUsers.filter(u => {\n let matches = true;\n if (searchQuery) {\n const q = searchQuery.toLowerCase();\n matches = !!(u.email?.toLowerCase().includes(q) || u.displayName?.toLowerCase().includes(q));\n }\n if (matches && roleFilter) {\n matches = !!u.roles?.includes(roleFilter);\n }\n return matches;\n });\n displayTotal = filtered.length;\n displayUsers = filtered.slice(page * PAGE_SIZE, (page + 1) * PAGE_SIZE);\n }\n\n const totalPages = Math.max(1, Math.ceil(displayTotal / PAGE_SIZE));\n\n // Check if any admin exists\n const hasAdmin = allUsers.some(u => u.roles?.includes(\"admin\"));\n\n const handleBootstrap = async () => {\n if (!bootstrapAdmin) return;\n setBootstrapping(true);\n try {\n await bootstrapAdmin();\n snackbarController.open({ type: \"success\",\nmessage: t(\"bootstrap_admin_success\") });\n window.location.reload();\n } catch (error: unknown) {\n snackbarController.open({ type: \"error\",\nmessage: error instanceof Error ? error.message : t(\"failed_to_bootstrap_admin\") });\n } finally {\n setBootstrapping(false);\n }\n };\n\n const handleAddUser = () => {\n setSelectedUser(undefined);\n setFormKey(k => k + 1);\n setDialogOpen(true);\n };\n\n const handleEditUser = (user: User) => {\n setSelectedUser(user);\n setDialogOpen(true);\n };\n\n const handleClose = () => {\n setDialogOpen(false);\n setSelectedUser(undefined);\n };\n\n const handleDelete = async () => {\n if (!userToDelete || !deleteUser) return;\n setDeleteInProgress(true);\n try {\n await deleteUser(userToDelete);\n snackbarController.open({ type: \"success\",\nmessage: t(\"user_deleted_successfully\") });\n setDeleteConfirmOpen(false);\n setUserToDelete(undefined);\n refreshCurrentPage();\n } catch (error: unknown) {\n snackbarController.open({ type: \"error\",\nmessage: error instanceof Error ? error.message : t(\"error_deleting_user\") });\n } finally {\n setDeleteInProgress(false);\n }\n };\n\n const handleResetPassword = async () => {\n if (!userToReset || !resetPassword) return;\n setResetInProgress(true);\n try {\n const result = await resetPassword(userToReset);\n setResetConfirmOpen(false);\n setUserToReset(undefined);\n setCreationResult(result);\n snackbarController.open({ type: \"success\",\nmessage: t(\"reset_password_success\") });\n } catch (error: unknown) {\n snackbarController.open({ type: \"error\",\nmessage: error instanceof Error ? error.message : t(\"error_resetting_password\") });\n } finally {\n setResetInProgress(false);\n }\n };\n\n if (delegateLoading) {\n return <CenteredView><CircularProgress/></CenteredView>;\n }\n\n return (\n <Container className=\"w-full flex flex-col py-4 gap-4\" maxWidth={\"6xl\"}>\n {/* Bootstrap warning when no admins */}\n {!hasAdmin && loggedInUser && bootstrapAdmin && (\n <div className=\"bg-yellow-100 dark:bg-yellow-900 border border-yellow-400 dark:border-yellow-700 rounded p-4 flex items-center justify-between\">\n <div>\n <Typography variant=\"label\" className=\"text-yellow-800 dark:text-yellow-200\">\n {t(\"no_users_or_roles_defined\")}\n </Typography>\n </div>\n <Button\n onClick={handleBootstrap}\n disabled={bootstrapping}\n >\n {bootstrapping ? <CircularProgress size=\"small\"/> : t(\"add_logged_user_as_admin\")}\n </Button>\n </div>\n )}\n\n <div className=\"flex items-center mt-12 mb-4 gap-4\">\n <Typography gutterBottom variant=\"h4\" className=\"grow mb-0\" component=\"h4\">\n {t(\"users\")}\n </Typography>\n {roles && roles.length > 0 && (\n <Select\n value={roleFilter || \"__all__\"}\n onValueChange={(v) => handleRoleFilterChange(v === \"__all__\" ? \"\" : v)}\n placeholder={t(\"all_roles\") || \"All Roles\"}\n size=\"small\"\n className=\"w-48\"\n >\n <SelectItem value=\"__all__\">{t(\"all_roles\") || \"All Roles\"}</SelectItem>\n {roles.map(role => (\n <SelectItem key={role.id} value={role.id}>{role.name}</SelectItem>\n ))}\n </Select>\n )}\n <SearchBar\n placeholder={t(\"search_users\")}\n onTextSearch={(v) => handleSearch(v || \"\")}\n size=\"small\"\n expandable\n />\n <Button startIcon={<PlusIcon/>} onClick={handleAddUser} disabled={!saveUser}>\n {t(\"add_user\")}\n </Button>\n </div>\n\n <div className=\"overflow-auto\">\n <Table className=\"w-full\">\n <TableHeader>\n <TableCell header className=\"w-48\">{t(\"id\") || \"ID\"}</TableCell>\n <TableCell header>{t(\"email\")}</TableCell>\n <TableCell header>{t(\"name\")}</TableCell>\n <TableCell header>{t(\"roles\")}</TableCell>\n <TableCell header className=\"whitespace-nowrap\">{t(\"created\")}</TableCell>\n <TableCell header className=\"w-24 text-right\">{t(\"actions\")}</TableCell>\n </TableHeader>\n <TableBody>\n {tableLoading ? (\n [\n { email: \"w-48\",\nname: \"w-32\",\nroles: [\"w-16\", \"w-20\"] },\n { email: \"w-32\",\nname: \"w-24\",\nroles: [\"w-24\"] },\n { email: \"w-40\",\nname: \"w-36\",\nroles: [\"w-16\", \"w-16\"] }\n ].map((row, i) => (\n <TableRow key={`skeleton-${i}`}>\n <TableCell className=\"font-mono text-xs\"><Skeleton className=\"h-3 w-40\"/></TableCell>\n <TableCell><Skeleton className={`h-4 ${row.email}`}/></TableCell>\n <TableCell className=\"font-medium\"><Skeleton className={`h-4 ${row.name}`}/></TableCell>\n <TableCell>\n <div className=\"flex flex-wrap gap-2\">\n {row.roles.map((w, j) => (\n <Skeleton key={j} className={`h-6 ${w} rounded-full`}/>\n ))}\n </div>\n </TableCell>\n <TableCell className=\"whitespace-nowrap text-sm\">\n <Skeleton className=\"h-4 w-20\"/>\n </TableCell>\n <TableCell className=\"text-right whitespace-nowrap\">\n <div className=\"flex justify-end items-center gap-1\">\n <Skeleton className=\"h-7 w-7 rounded-md\"/>\n <Skeleton className=\"h-7 w-7 rounded-md\"/>\n </div>\n </TableCell>\n </TableRow>\n ))\n ) : (\n displayUsers.map(user => (\n <TableRow key={user.uid} onClick={() => saveUser && handleEditUser(user)}>\n <TableCell className=\"font-mono text-xs\">{user.uid}</TableCell>\n <TableCell>{user.email}</TableCell>\n <TableCell className=\"font-medium\">{user.displayName}</TableCell>\n <TableCell>\n <div className=\"flex flex-wrap gap-2\">\n {user.roles?.map((roleId: string) => {\n const role = roles?.find(r => r.id === roleId);\n return role ? <RoleChip key={roleId} role={role}/> : <span key={roleId}>{roleId}</span>;\n })}\n </div>\n </TableCell>\n <TableCell className=\"whitespace-nowrap text-sm text-surface-accent-600 dark:text-surface-accent-400\">\n {user.createdAt ? new Date(user.createdAt).toLocaleDateString() : \"-\"}\n </TableCell>\n <TableCell className=\"text-right whitespace-nowrap\">\n <div className=\"flex justify-end items-center gap-1\">\n {resetPassword && (\n <Tooltip asChild title={t(\"reset_password\")}>\n <IconButton\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n setUserToReset(user);\n setResetConfirmOpen(true);\n }}>\n <KeyRoundIcon size={iconSize.small}/>\n </IconButton>\n </Tooltip>\n )}\n {deleteUser && (\n <Tooltip asChild title={t(\"delete_this_user\")}>\n <IconButton\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n setUserToDelete(user);\n setDeleteConfirmOpen(true);\n }}>\n <Trash2Icon size={iconSize.small}/>\n </IconButton>\n </Tooltip>\n )}\n </div>\n </TableCell>\n </TableRow>\n )))}\n\n {displayUsers.length === 0 && !tableLoading && (\n <TableRow>\n <TableCell colspan={5}>\n <CenteredView className=\"flex flex-col gap-4 my-8 items-center\">\n <Typography variant=\"label\">\n {searchQuery ? t(\"no_users_found\") : t(\"no_users_yet\")}\n </Typography>\n </CenteredView>\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n </div>\n\n {/* Pagination */}\n {displayTotal > PAGE_SIZE && (\n <div className=\"flex items-center justify-between px-2 py-3\">\n <Typography variant=\"body2\" className=\"text-surface-accent-500 dark:text-surface-accent-400\">\n {`${page * PAGE_SIZE + 1}–${Math.min((page + 1) * PAGE_SIZE, displayTotal)} / ${displayTotal}`}\n </Typography>\n <div className=\"flex items-center gap-1\">\n <IconButton\n size=\"small\"\n disabled={page === 0}\n onClick={() => handlePageChange(page - 1)}>\n <ChevronLeftIcon size={iconSize.smallest}/>\n </IconButton>\n <Typography variant=\"body2\" className=\"px-3 text-surface-accent-600 dark:text-surface-accent-300\">\n {page + 1} / {totalPages}\n </Typography>\n <IconButton\n size=\"small\"\n disabled={page >= totalPages - 1}\n onClick={() => handlePageChange(page + 1)}>\n <ChevronRightIcon size={iconSize.smallest}/>\n </IconButton>\n </div>\n </div>\n )}\n\n {/* User Edit Dialog */}\n {saveUser && (\n <UserDetailsForm\n key={selectedUser?.uid ?? `new-${formKey}`}\n open={dialogOpen}\n user={selectedUser}\n roles={roles}\n saveUser={saveUser}\n createUser={createUser}\n handleClose={handleClose}\n onCreationResult={setCreationResult}\n onSaved={refreshCurrentPage}\n />\n )}\n\n {/* Creation Result Dialog */}\n {creationResult && (\n <CreationResultDialog\n result={creationResult}\n onClose={() => setCreationResult(null)}\n />\n )}\n\n {/* Delete Confirmation */}\n <ConfirmationDialog\n open={deleteConfirmOpen}\n loading={deleteInProgress}\n onAccept={handleDelete}\n onCancel={() => { setDeleteConfirmOpen(false); setUserToDelete(undefined); }}\n title={<>{t(\"delete_confirmation_title\")}</>}\n body={<>{t(\"delete_user_confirmation\")}</>}\n />\n\n {/* Reset Password Confirmation */}\n <ConfirmationDialog\n open={resetConfirmOpen}\n loading={resetInProgress}\n onAccept={handleResetPassword}\n onCancel={() => { setResetConfirmOpen(false); setUserToReset(undefined); }}\n title={<>{t(\"reset_password\")}</>}\n body={<>{t(\"reset_password_confirmation\")}</>}\n />\n </Container>\n );\n}\n\n// ============================================\n// CreationResultDialog Component\n// ============================================\nfunction CreationResultDialog({\n result,\n onClose\n}: {\n result: UserCreationResult;\n onClose: () => void;\n}) {\n const { t } = useTranslation();\n const snackbarController = useSnackbarController();\n const [copied, setCopied] = useState(false);\n\n const handleCopyPassword = async () => {\n if (!result.temporaryPassword) return;\n try {\n await navigator.clipboard.writeText(result.temporaryPassword);\n setCopied(true);\n snackbarController.open({ type: \"success\",\nmessage: t(\"password_copied\") ?? \"Password copied to clipboard\" });\n setTimeout(() => setCopied(false), 3000);\n } catch {\n // Fallback for older browsers\n const textArea = document.createElement(\"textarea\");\n textArea.value = result.temporaryPassword;\n document.body.appendChild(textArea);\n textArea.select();\n document.execCommand(\"copy\");\n document.body.removeChild(textArea);\n setCopied(true);\n setTimeout(() => setCopied(false), 3000);\n }\n };\n\n if (result.invitationSent) {\n // Invitation sent via email\n return (\n <Dialog open={true} onOpenChange={(open) => !open ? onClose() : undefined} maxWidth=\"xl\">\n <DialogTitle variant=\"h5\" gutterBottom={false}>\n <div className=\"flex items-center gap-3\">\n <MailIcon/>\n {t(\"invitation_sent_title\") ?? \"Invitation Sent\"}\n </div>\n </DialogTitle>\n <DialogContent>\n <div className=\"flex flex-col gap-4 py-2\">\n <div className=\"bg-green-50 dark:bg-green-900/30 border border-green-200 dark:border-green-800 rounded-lg p-4\">\n <Typography className=\"text-green-800 dark:text-green-200\">\n {(t(\"invitation_sent\") ?? \"An invitation email has been sent to {{email}}. They can use the link to set their password.\")\n .replace(\"{{email}}\", result.user.email ?? \"\")}\n </Typography>\n </div>\n </div>\n </DialogContent>\n <DialogActions>\n <Button variant=\"filled\" onClick={onClose}>\n {t(\"ok\")}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n if (result.temporaryPassword) {\n // No email — show temporary password\n return (\n <Dialog open={true} onOpenChange={(open) => !open ? onClose() : undefined} maxWidth=\"xl\">\n <DialogTitle variant=\"h5\" gutterBottom={false}>\n {t(\"temporary_password\") ?? \"Temporary Password\"}\n </DialogTitle>\n <DialogContent>\n <div className=\"flex flex-col gap-4 py-2\">\n <div className=\"bg-amber-50 dark:bg-amber-900/30 border border-amber-200 dark:border-amber-800 rounded-lg p-4\">\n <Typography className=\"text-amber-800 dark:text-amber-200\" variant=\"body2\">\n {t(\"temporary_password_description\") ??\n \"Email is not configured. Share this temporary password with the user securely. It will not be shown again.\"}\n </Typography>\n </div>\n\n <div>\n <Typography variant=\"caption\" color=\"secondary\" className=\"mb-1\">\n {t(\"email\")}\n </Typography>\n <Typography>\n {result.user.email}\n </Typography>\n </div>\n\n <div>\n <Typography variant=\"caption\" color=\"secondary\" className=\"mb-1\">\n {t(\"temporary_password\") ?? \"Temporary Password\"}\n </Typography>\n <div className=\"flex items-center gap-2 mt-1\">\n <code className=\"flex-grow bg-surface-100 dark:bg-surface-900 border border-surface-300 dark:border-surface-600 rounded px-3 py-2 font-mono text-base select-all\">\n {result.temporaryPassword}\n </code>\n <Tooltip title={t(\"copy_password\") ?? \"CopyIcon password\"} asChild>\n <IconButton onClick={handleCopyPassword}>\n {copied ? <CheckCircleIcon className=\"text-green-600\"/> : <CopyIcon/>}\n </IconButton>\n </Tooltip>\n </div>\n </div>\n </div>\n </DialogContent>\n <DialogActions>\n <Button variant=\"filled\" onClick={onClose}>\n {t(\"ok\")}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n // Shouldn't happen, but fallback\n return null;\n}\n\n// ============================================\n// UserDetailsForm Component\n// ============================================\nfunction UserDetailsForm({\n open,\n user: userProp,\n roles,\n saveUser,\n createUser,\n handleClose,\n onCreationResult,\n onSaved\n}: {\n open: boolean;\n user?: User;\n roles?: Role[];\n saveUser: (user: User) => Promise<User>;\n createUser?: (user: User) => Promise<UserCreationResult>;\n handleClose: () => void;\n onCreationResult?: (result: UserCreationResult) => void;\n onSaved?: () => void;\n}) {\n const snackbarController = useSnackbarController();\n const { t } = useTranslation();\n const isNewUser = !userProp;\n\n const [displayName, setDisplayName] = useState(userProp?.displayName || \"\");\n const [email, setEmail] = useState(userProp?.email || \"\");\n const [selectedRoleIds, setSelectedRoleIds] = useState<string[]>(\n userProp?.roles || []\n );\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [errors, setErrors] = useState<{ displayName?: string; email?: string; roles?: string }>({});\n const [submitCount, setSubmitCount] = useState(0);\n\n const validate = () => {\n const newErrors: typeof errors = {};\n if (!displayName) newErrors.displayName = \"Required\";\n if (!email) newErrors.email = \"Required\";\n else if (!/\\S+@\\S+\\.\\S+/.test(email)) newErrors.email = \"Invalid email\";\n setErrors(newErrors);\n return Object.keys(newErrors).length === 0;\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n setSubmitCount(c => c + 1);\n\n if (!validate()) return;\n\n setIsSubmitting(true);\n try {\n const userRoles = selectedRoleIds;\n const userToSave: User = {\n uid: userProp?.uid || crypto.randomUUID(),\n email,\n displayName: displayName || null,\n photoURL: userProp?.photoURL || null,\n providerId: userProp?.providerId || \"custom\",\n isAnonymous: userProp?.isAnonymous || false,\n roles: userRoles\n };\n\n if (isNewUser && createUser && onCreationResult) {\n // Use createUser for new users to get invitation/password info\n const result = await createUser(userToSave);\n handleClose();\n onCreationResult(result);\n } else {\n await saveUser(userToSave);\n handleClose();\n }\n onSaved?.();\n } catch (error: unknown) {\n snackbarController.open({ type: \"error\",\nmessage: error instanceof Error ? error.message : \"Failed to save user\" });\n } finally {\n setIsSubmitting(false);\n }\n };\n\n const dirty = isNewUser ||\n displayName !== (userProp?.displayName || \"\") ||\n email !== (userProp?.email || \"\") ||\n (() => {\n const prev = userProp?.roles || [];\n if (selectedRoleIds.length !== prev.length) return true;\n const set = new Set(prev);\n return selectedRoleIds.some(id => !set.has(id));\n })();\n\n return (\n <Dialog open={open} onOpenChange={(open) => !open ? handleClose() : undefined} maxWidth=\"4xl\">\n <form onSubmit={handleSubmit} autoComplete=\"off\" noValidate\n style={{ display: \"flex\",\nflexDirection: \"column\",\nposition: \"relative\",\nheight: \"100%\" }}>\n\n <DialogTitle variant=\"h4\" gutterBottom={false}>\n {t(\"user\")}\n </DialogTitle>\n\n <DialogContent className=\"h-full grow\">\n <div className=\"grid grid-cols-12 gap-4\">\n {!isNewUser && (\n <div className=\"col-span-12\">\n <TextField\n name=\"uid\"\n value={userProp?.uid || \"\"}\n label={t(\"id\") || \"ID\"}\n disabled\n />\n </div>\n )}\n <div className=\"col-span-12\">\n <TextField\n name=\"displayName\"\n required\n error={submitCount > 0 && Boolean(errors.displayName)}\n value={displayName}\n onChange={(e) => setDisplayName(e.target.value)}\n label={t(\"name\")}\n />\n {submitCount > 0 && errors.displayName && (\n <Typography variant=\"caption\" color=\"error\">{errors.displayName}</Typography>\n )}\n </div>\n\n <div className=\"col-span-12\">\n <TextField\n required\n error={submitCount > 0 && Boolean(errors.email)}\n name=\"email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n label={t(\"email\")}\n disabled={!isNewUser}\n />\n {submitCount > 0 && errors.email && (\n <Typography variant=\"caption\" color=\"error\">{errors.email}</Typography>\n )}\n </div>\n\n {roles && roles.length > 0 && (\n <div className=\"col-span-12\">\n <MultiSelect\n className=\"w-full\"\n label={t(\"roles\")}\n value={selectedRoleIds}\n onValueChange={(value: string[]) => setSelectedRoleIds(value)}\n >\n {roles.map(role => (\n <MultiSelectItem key={role.id} value={role.id}>\n <RoleChip role={role}/>\n </MultiSelectItem>\n ))}\n </MultiSelect>\n </div>\n )}\n </div>\n </DialogContent>\n\n <DialogActions>\n <Button variant=\"text\" onClick={handleClose}>\n {t(\"cancel\")}\n </Button>\n <LoadingButton\n variant=\"filled\"\n type=\"submit\"\n disabled={!dirty}\n loading={isSubmitting}\n >\n {isNewUser ? t(\"create_user\") : t(\"update\")}\n </LoadingButton>\n </DialogActions>\n </form>\n </Dialog>\n );\n}\n"],"names":["PAGE_SIZE","UsersView","userManagement","roles","saveUser","createUser","deleteUser","resetPassword","loading","delegateLoading","bootstrapAdmin","snackbarController","useSnackbarController","user","loggedInUser","useAuthController","t","useTranslation","breadcrumbs","useBreadcrumbsController","React","useEffect","set","title","url","dialogOpen","setDialogOpen","useState","selectedUser","setSelectedUser","deleteConfirmOpen","setDeleteConfirmOpen","userToDelete","setUserToDelete","deleteInProgress","setDeleteInProgress","formKey","setFormKey","bootstrapping","setBootstrapping","creationResult","setCreationResult","resetConfirmOpen","setResetConfirmOpen","userToReset","setUserToReset","resetInProgress","setResetInProgress","hasServerSearch","searchUsers","searchQuery","setSearchQuery","roleFilter","setRoleFilter","page","setPage","paginatedUsers","setPaginatedUsers","totalUsers","setTotalUsers","tableLoading","setTableLoading","searchTimerRef","useRef","allUsers","users","fetchPage","useCallback","pageNum","search","filterRole","forceLoading","result","undefined","roleId","limit","offset","orderBy","orderDir","total","error","console","open","type","message","Error","fetchPageRef","current","initialFetchDone","handleSearch","value","clearTimeout","setTimeout","handleRoleFilterChange","newRole","handlePageChange","newPage","refreshCurrentPage","displayUsers","displayTotal","filtered","filter","u","matches","q","toLowerCase","email","includes","displayName","length","slice","totalPages","Math","max","ceil","hasAdmin","some","handleBootstrap","window","location","reload","handleAddUser","k","handleEditUser","handleClose","handleDelete","handleResetPassword","v","map","role","id","name","row","i","w","j","uid","find","r","createdAt","Date","toLocaleDateString","e","stopPropagation","iconSize","small","min","smallest","CreationResultDialog","onClose","copied","setCopied","handleCopyPassword","temporaryPassword","navigator","clipboard","writeText","textArea","document","createElement","body","appendChild","select","execCommand","removeChild","invitationSent","replace","UserDetailsForm","userProp","onCreationResult","onSaved","isNewUser","setDisplayName","setEmail","selectedRoleIds","setSelectedRoleIds","isSubmitting","setIsSubmitting","errors","setErrors","submitCount","setSubmitCount","validate","newErrors","test","Object","keys","handleSubmit","preventDefault","c","userRoles","userToSave","crypto","randomUUID","photoURL","providerId","isAnonymous","dirty","prev","Set","has","display","flexDirection","position","height","Boolean","target"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAMA,YAAY;AAKX,SAASC,UAAU;AAAA,EAAEC;AAE5B,GAAG;AACC,QAAM;AAAA,IAAEC;AAAAA,IAAOC;AAAAA,IAAUC;AAAAA,IAAYC;AAAAA,IAAYC;AAAAA,IAAeC,SAASC;AAAAA,IAAiBC;AAAAA,EAAAA,IAAmBR;AAC7G,QAAMS,qBAAqBC,sBAAAA;AAC3B,QAAM;AAAA,IAAEC,MAAMC;AAAAA,EAAAA,IAAiBC,kBAAAA;AAC/B,QAAM;AAAA,IAAEC;AAAAA,EAAAA,IAAMC,eAAAA;AACd,QAAMC,cAAcC,yBAAAA;AAEpBC,iBAAMC,UAAU,MAAM;AAClBH,gBAAYI,IAAI;AAAA,MACZJ,aAAa,CAAC;AAAA,QAAEK,OAAOP,EAAE,OAAO;AAAA,QAC5CQ,KAAK;AAAA,MAAA,CAAU;AAAA,IAAA,CACN;AAAA,EAEL,GAAG,CAAA,CAAE;AAEL,QAAM,CAACC,YAAYC,aAAa,IAAIC,SAAS,KAAK;AAClD,QAAM,CAACC,cAAcC,eAAe,IAAIF,SAAAA;AACxC,QAAM,CAACG,mBAAmBC,oBAAoB,IAAIJ,SAAS,KAAK;AAChE,QAAM,CAACK,cAAcC,eAAe,IAAIN,SAAAA;AACxC,QAAM,CAACO,kBAAkBC,mBAAmB,IAAIR,SAAS,KAAK;AAC9D,QAAM,CAACS,SAASC,UAAU,IAAIV,SAAS,CAAC;AACxC,QAAM,CAACW,eAAeC,gB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