@rebasepro/cms 0.23.0 → 0.24.1-canary.g56af4a4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/collection_editor/CollectionEditorDialogsContext.js +10 -0
- package/dist/collection_editor/CollectionEditorDialogsContext.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.js +274 -0
- package/dist/collection_editor/ConfigControllerProvider.js.map +1 -0
- package/dist/collection_editor/_cms_internals.d.ts +2 -1
- package/dist/collection_editor/api/generateCollectionApi.js +64 -0
- package/dist/collection_editor/api/generateCollectionApi.js.map +1 -0
- package/dist/collection_editor/collection_wire.d.ts +13 -0
- package/dist/collection_editor/collection_wire.js +49 -0
- package/dist/collection_editor/collection_wire.js.map +1 -0
- package/dist/collection_editor/liveSchemaClient.d.ts +38 -18
- package/dist/collection_editor/liveSchemaClient.js +130 -0
- package/dist/collection_editor/liveSchemaClient.js.map +1 -0
- package/dist/collection_editor/relation_kinds.js +74 -0
- package/dist/collection_editor/relation_kinds.js.map +1 -0
- package/dist/collection_editor/serializable_types.d.ts +6 -1
- package/dist/collection_editor/serializable_utils.js +504 -0
- package/dist/collection_editor/serializable_utils.js.map +1 -0
- package/dist/collection_editor/types/config_controller.d.ts +11 -0
- package/dist/collection_editor/ui/EditorCollectionAction.js +37 -0
- package/dist/collection_editor/ui/EditorCollectionAction.js.map +1 -0
- package/dist/collection_editor/ui/MissingReferenceWidget.js +39 -0
- package/dist/collection_editor/ui/MissingReferenceWidget.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.js +160 -0
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.js +61 -0
- package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.js +731 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.js +220 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.js +160 -0
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.js +394 -0
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.js +616 -0
- package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.js +68 -0
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.js +11 -0
- package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.js +148 -0
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.js +244 -0
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/EnumForm.js +222 -0
- package/dist/collection_editor/ui/collection_editor/EnumForm.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.js +204 -0
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.js +108 -0
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.js +163 -0
- package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.js +59 -0
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.js +640 -0
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.js +141 -0
- package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/PropertyTree.js +210 -0
- package/dist/collection_editor/ui/collection_editor/PropertyTree.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/RouterCollectionStudioView.js +31 -0
- package/dist/collection_editor/ui/collection_editor/RouterCollectionStudioView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/RouterCollectionsStudioView.js +25 -0
- package/dist/collection_editor/ui/collection_editor/RouterCollectionsStudioView.js.map +1 -0
- package/dist/{SchemaChangeDialog-BeP0A4MJ.js → collection_editor/ui/collection_editor/SchemaChangeDialog.js} +73 -69
- package/dist/collection_editor/ui/collection_editor/SchemaChangeDialog.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/SwitchControl.js +24 -0
- package/dist/collection_editor/ui/collection_editor/SwitchControl.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.js +66 -0
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js +61 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.js +188 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/import/clean_import_data.d.ts +12 -0
- package/dist/collection_editor/ui/collection_editor/import/clean_import_data.js +74 -0
- package/dist/collection_editor/ui/collection_editor/import/clean_import_data.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.js +100 -0
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.js +34 -0
- package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/CommonPropertyFields.js +75 -0
- package/dist/collection_editor/ui/collection_editor/properties/CommonPropertyFields.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.js +338 -0
- package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.js +83 -0
- package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.js +15 -0
- package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.js +121 -0
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.js +127 -0
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.js +151 -0
- package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.js +77 -0
- package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.js +254 -0
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.js +71 -0
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.js +356 -0
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.js +173 -0
- package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.js +79 -0
- package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.js +34 -0
- package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.js +47 -0
- package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.js +47 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.js +62 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.js +119 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +10 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.js +178 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.js +23 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.js +116 -0
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.js +182 -0
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/templates/products_template.js +87 -0
- package/dist/collection_editor/ui/collection_editor/templates/products_template.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/templates/users_template.js +46 -0
- package/dist/collection_editor/ui/collection_editor/templates/users_template.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/util.js +20 -0
- package/dist/collection_editor/ui/collection_editor/util.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/utils/strings.js +2 -0
- package/dist/collection_editor/ui/collection_editor/utils/supported_fields.js +37 -0
- package/dist/collection_editor/ui/collection_editor/utils/supported_fields.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.js +192 -0
- package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.js.map +1 -0
- package/dist/collection_editor/useCollectionEditorController.js +12 -0
- package/dist/collection_editor/useCollectionEditorController.js.map +1 -0
- package/dist/collection_editor/useCollectionsConfigController.js +12 -0
- package/dist/collection_editor/useCollectionsConfigController.js.map +1 -0
- package/dist/collection_editor/useJsonCollectionsConfigController.js +191 -0
- package/dist/collection_editor/useJsonCollectionsConfigController.js.map +1 -0
- package/dist/collection_editor/useLiveSchemaEditing.d.ts +5 -5
- package/dist/collection_editor/useLiveSchemaEditing.js +214 -0
- package/dist/collection_editor/useLiveSchemaEditing.js.map +1 -0
- package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +7 -0
- package/dist/collection_editor/useLocalCollectionsConfigController.js +228 -0
- package/dist/collection_editor/useLocalCollectionsConfigController.js.map +1 -0
- package/dist/collection_editor/useSafeSnackbarController.js +13 -0
- package/dist/collection_editor/useSafeSnackbarController.js.map +1 -0
- package/dist/collection_editor/validateCollectionJson.js +289 -0
- package/dist/collection_editor/validateCollectionJson.js.map +1 -0
- package/dist/collection_editor_ui.js +7 -33
- package/dist/components/AdditionalFieldValue.js +60 -0
- package/dist/components/AdditionalFieldValue.js.map +1 -0
- package/dist/components/AdminModeSyncer.js +41 -0
- package/dist/components/AdminModeSyncer.js.map +1 -0
- package/dist/components/ArrayContainer.d.ts +8 -2
- package/dist/components/ArrayContainer.js +363 -0
- package/dist/components/ArrayContainer.js.map +1 -0
- package/dist/components/ClearFilterSortButton.d.ts +7 -1
- package/dist/components/ClearFilterSortButton.js +33 -0
- package/dist/components/ClearFilterSortButton.js.map +1 -0
- package/dist/components/CollectionEditorDialogs.js +49 -0
- package/dist/components/CollectionEditorDialogs.js.map +1 -0
- package/dist/components/CollectionPanel.js +95 -0
- package/dist/components/CollectionPanel.js.map +1 -0
- package/dist/components/CollectionTableBinding/CollectionRowActions.js +165 -0
- package/dist/components/CollectionTableBinding/CollectionRowActions.js.map +1 -0
- package/dist/components/CollectionTableBinding/CollectionTableBinding.js +329 -0
- package/dist/components/CollectionTableBinding/CollectionTableBinding.js.map +1 -0
- package/dist/components/CollectionTableBinding/PropertyTableCell.js +311 -0
- package/dist/components/CollectionTableBinding/PropertyTableCell.js.map +1 -0
- package/dist/components/CollectionTableBinding/column_utils.js +85 -0
- package/dist/components/CollectionTableBinding/column_utils.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/CompactEntityCellField.js +45 -0
- package/dist/components/CollectionTableBinding/fields/CompactEntityCellField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js +66 -0
- package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableReferenceField.js +86 -0
- package/dist/components/CollectionTableBinding/fields/TableReferenceField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableRelationField.js +93 -0
- package/dist/components/CollectionTableBinding/fields/TableRelationField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableRelationSelectorField.js +33 -0
- package/dist/components/CollectionTableBinding/fields/TableRelationSelectorField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableStorageUpload.js +171 -0
- package/dist/components/CollectionTableBinding/fields/TableStorageUpload.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/VirtualTableSelect.js +91 -0
- package/dist/components/CollectionTableBinding/fields/VirtualTableSelect.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/VirtualTableUserSelect.js +36 -0
- package/dist/components/CollectionTableBinding/fields/VirtualTableUserSelect.js.map +1 -0
- package/dist/components/CollectionTableBinding/index.js +6 -0
- package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.js +50 -0
- package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCell.d.ts +2 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCell.js +223 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCell.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCellActions.js +58 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCellActions.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/TableCellOpener.js +53 -0
- package/dist/components/CollectionTableBinding/internal/TableCellOpener.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/common.js +40 -0
- package/dist/components/CollectionTableBinding/internal/common.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js +270 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/useDraggable.js +68 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/useDraggable.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/useWindowSize.js +24 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/useWindowSize.js.map +1 -0
- package/dist/components/CollectionTableBinding/table_bindings.js +306 -0
- package/dist/components/CollectionTableBinding/table_bindings.js.map +1 -0
- package/dist/components/CollectionViewBinding/BoardCardBinding.js +160 -0
- package/dist/components/CollectionViewBinding/BoardCardBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js +471 -0
- package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js +108 -0
- package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionListViewBinding.js +988 -0
- package/dist/components/CollectionViewBinding/CollectionListViewBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewActions.d.ts +6 -1
- package/dist/components/CollectionViewBinding/CollectionViewActions.js +146 -0
- package/dist/components/CollectionViewBinding/CollectionViewActions.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewBinding.d.ts +5 -2
- package/dist/components/CollectionViewBinding/CollectionViewBinding.js +1209 -0
- package/dist/components/CollectionViewBinding/CollectionViewBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewStartActions.js +133 -0
- package/dist/components/CollectionViewBinding/CollectionViewStartActions.js.map +1 -0
- package/dist/components/CollectionViewBinding/EntityCardBinding.js +133 -0
- package/dist/components/CollectionViewBinding/EntityCardBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/FilterPresetsButton.js +203 -0
- package/dist/components/CollectionViewBinding/FilterPresetsButton.js.map +1 -0
- package/dist/components/CollectionViewBinding/FiltersDialog.d.ts +5 -0
- package/dist/components/CollectionViewBinding/FiltersDialog.js +148 -0
- package/dist/components/CollectionViewBinding/FiltersDialog.js.map +1 -0
- package/dist/components/CollectionViewBinding/SearchExplanation.js +86 -0
- package/dist/components/CollectionViewBinding/SearchExplanation.js.map +1 -0
- package/dist/components/CollectionViewBinding/SearchHighlight.js +262 -0
- package/dist/components/CollectionViewBinding/SearchHighlight.js.map +1 -0
- package/dist/components/CollectionViewBinding/SlotValue.js +117 -0
- package/dist/components/CollectionViewBinding/SlotValue.js.map +1 -0
- package/dist/components/CollectionViewBinding/SortButton.js +214 -0
- package/dist/components/CollectionViewBinding/SortButton.js.map +1 -0
- package/dist/components/CollectionViewBinding/SplitListCloseButton.js +41 -0
- package/dist/components/CollectionViewBinding/SplitListCloseButton.js.map +1 -0
- package/dist/components/CollectionViewBinding/SplitListShowButton.js +29 -0
- package/dist/components/CollectionViewBinding/SplitListShowButton.js.map +1 -0
- package/dist/components/CollectionViewBinding/SplitListView.js +311 -0
- package/dist/components/CollectionViewBinding/SplitListView.js.map +1 -0
- package/dist/components/CollectionViewBinding/SplitViewContext.js +21 -0
- package/dist/components/CollectionViewBinding/SplitViewContext.js.map +1 -0
- package/dist/components/CollectionViewBinding/ViewModeToggle.js +150 -0
- package/dist/components/CollectionViewBinding/ViewModeToggle.js.map +1 -0
- package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.js +49 -0
- package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.js.map +1 -0
- package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.js +122 -0
- package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.js.map +1 -0
- package/dist/components/CollectionViewBinding/useBoardDataController.js +530 -0
- package/dist/components/CollectionViewBinding/useBoardDataController.js.map +1 -0
- package/dist/components/CollectionViewBinding/usePreviewSlots.d.ts +4 -1
- package/dist/components/CollectionViewBinding/usePreviewSlots.js +384 -0
- package/dist/components/CollectionViewBinding/usePreviewSlots.js.map +1 -0
- package/dist/components/CollectionViewBinding/useSelectionController.js +104 -0
- package/dist/components/CollectionViewBinding/useSelectionController.js.map +1 -0
- package/dist/components/CollectionViewBinding/utils.js +21 -0
- package/dist/components/CollectionViewBinding/utils.js.map +1 -0
- package/dist/components/DefaultAppBar.js +179 -0
- package/dist/components/DefaultAppBar.js.map +1 -0
- package/dist/components/DefaultDrawer.js +364 -0
- package/dist/components/DefaultDrawer.js.map +1 -0
- package/dist/components/DeleteEntityDialog.js +256 -0
- package/dist/components/DeleteEntityDialog.js.map +1 -0
- package/dist/components/DetailViewBinding.js +504 -0
- package/dist/components/DetailViewBinding.js.map +1 -0
- package/dist/components/DrawerNavigationGroup.js +74 -0
- package/dist/components/DrawerNavigationGroup.js.map +1 -0
- package/dist/components/DrawerNavigationItem.d.ts +8 -0
- package/dist/components/DrawerNavigationItem.js +45 -0
- package/dist/components/DrawerNavigationItem.js.map +1 -0
- package/dist/components/EditFormActions.js +210 -0
- package/dist/components/EditFormActions.js.map +1 -0
- package/dist/components/EditViewBinding.d.ts +7 -1
- package/dist/components/EditViewBinding.js +802 -0
- package/dist/components/EditViewBinding.js.map +1 -0
- package/dist/components/EntityDisplayHeader.js +139 -0
- package/dist/components/EntityDisplayHeader.js.map +1 -0
- package/dist/components/EntityIdentityBar.d.ts +29 -4
- package/dist/components/EntityIdentityBar.js +364 -0
- package/dist/components/EntityIdentityBar.js.map +1 -0
- package/dist/components/EntityInspector.js +96 -0
- package/dist/components/EntityInspector.js.map +1 -0
- package/dist/components/EntityPreviewBinding.js +282 -0
- package/dist/components/EntityPreviewBinding.js.map +1 -0
- package/dist/components/EntityPreviewNesting.js +53 -0
- package/dist/components/EntityPreviewNesting.js.map +1 -0
- package/dist/components/EntityViewBinding.js +246 -0
- package/dist/components/EntityViewBinding.js.map +1 -0
- package/dist/components/FieldCaption.js +17 -0
- package/dist/components/FieldCaption.js.map +1 -0
- package/dist/components/HomePage/ContentHomePage.js +326 -0
- package/dist/components/HomePage/ContentHomePage.js.map +1 -0
- package/dist/components/HomePage/FavouritesView.js +44 -0
- package/dist/components/HomePage/FavouritesView.js.map +1 -0
- package/dist/components/HomePage/HomePageDnD.js +436 -0
- package/dist/components/HomePage/HomePageDnD.js.map +1 -0
- package/dist/components/HomePage/NavigationCard.js +59 -0
- package/dist/components/HomePage/NavigationCard.js.map +1 -0
- package/dist/components/HomePage/NavigationCardBinding.js +70 -0
- package/dist/components/HomePage/NavigationCardBinding.js.map +1 -0
- package/dist/components/HomePage/NavigationGroup.js +98 -0
- package/dist/components/HomePage/NavigationGroup.js.map +1 -0
- package/dist/components/HomePage/RenameGroupDialog.js +89 -0
- package/dist/components/HomePage/RenameGroupDialog.js.map +1 -0
- package/dist/components/InlineEntityPreview.js +116 -0
- package/dist/components/InlineEntityPreview.js.map +1 -0
- package/dist/{JsonPreviewBinding-v0w3H0fp.js → components/JsonPreviewBinding.js} +2 -2
- package/dist/components/JsonPreviewBinding.js.map +1 -0
- package/dist/components/NavigationLoadingErrorView.d.ts +16 -0
- package/dist/components/NavigationLoadingErrorView.js +27 -0
- package/dist/components/NavigationLoadingErrorView.js.map +1 -0
- package/dist/components/PickerTrigger.js +27 -0
- package/dist/components/PickerTrigger.js.map +1 -0
- package/dist/components/PropertyCollectionView.js +215 -0
- package/dist/components/PropertyCollectionView.js.map +1 -0
- package/dist/components/PropertyConfigBadge.js +19 -0
- package/dist/components/PropertyConfigBadge.js.map +1 -0
- package/dist/components/PropertyKeyHint.js +58 -0
- package/dist/components/PropertyKeyHint.js.map +1 -0
- package/dist/components/RebaseAuthGate.js +35 -0
- package/dist/components/RebaseAuthGate.js.map +1 -0
- package/dist/components/RebaseCMS.js +44 -0
- package/dist/components/RebaseCMS.js.map +1 -0
- package/dist/components/RebaseLayout.js +59 -0
- package/dist/components/RebaseLayout.js.map +1 -0
- package/dist/components/RebaseNavigation.js +211 -0
- package/dist/components/RebaseNavigation.js.map +1 -0
- package/dist/components/RebaseRouteDefs.js +96 -0
- package/dist/components/RebaseRouteDefs.js.map +1 -0
- package/dist/components/RebaseShell.js +50 -0
- package/dist/components/RebaseShell.js.map +1 -0
- package/dist/components/ReferenceTable/SelectionTableBinding.js +224 -0
- package/dist/components/ReferenceTable/SelectionTableBinding.js.map +1 -0
- package/dist/components/ReferenceWidget.js +100 -0
- package/dist/components/ReferenceWidget.js.map +1 -0
- package/dist/components/RelationSelector.js +625 -0
- package/dist/components/RelationSelector.js.map +1 -0
- package/dist/components/SearchIconsView.js +52 -0
- package/dist/components/SearchIconsView.js.map +1 -0
- package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
- package/dist/components/SelectableTable/SelectableTable.js +158 -0
- package/dist/components/SelectableTable/SelectableTable.js.map +1 -0
- package/dist/components/SelectableTable/SelectableTableContext.js +8 -0
- package/dist/components/SelectableTable/SelectableTableContext.js.map +1 -0
- package/dist/components/SelectableTable/SelectionStore.js +29 -0
- package/dist/components/SelectableTable/SelectionStore.js.map +1 -0
- package/dist/components/SelectableTable/filters/BooleanFilterField.js +28 -0
- package/dist/components/SelectableTable/filters/BooleanFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/DateTimeFilterField.js +93 -0
- package/dist/components/SelectableTable/filters/DateTimeFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/FilterFieldBinding.js +132 -0
- package/dist/components/SelectableTable/filters/FilterFieldBinding.js.map +1 -0
- package/dist/components/SelectableTable/filters/ReferenceFilterField.js +157 -0
- package/dist/components/SelectableTable/filters/ReferenceFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/RelationFilterField.js +169 -0
- package/dist/components/SelectableTable/filters/RelationFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/StringNumberFilterField.js +181 -0
- package/dist/components/SelectableTable/filters/StringNumberFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/null_filter.js +36 -0
- package/dist/components/SelectableTable/filters/null_filter.js.map +1 -0
- package/dist/components/SideDialogs.js +149 -0
- package/dist/components/SideDialogs.js.map +1 -0
- package/dist/components/SidePanelBinding.js +287 -0
- package/dist/components/SidePanelBinding.js.map +1 -0
- package/dist/components/SidePanelProvider.js +69 -0
- package/dist/components/SidePanelProvider.js.map +1 -0
- package/dist/components/UserSelector.d.ts +2 -0
- package/dist/components/UserSelector.js +418 -0
- package/dist/components/UserSelector.js.map +1 -0
- package/dist/components/admin/CreationResultDialog.js +118 -0
- package/dist/components/admin/CreationResultDialog.js.map +1 -0
- package/dist/components/app/AppBar.js +14 -0
- package/dist/components/app/AppBar.js.map +1 -0
- package/dist/components/app/Drawer.js +26 -0
- package/dist/components/app/Drawer.js.map +1 -0
- package/dist/components/app/Scaffold.js +229 -0
- package/dist/components/app/Scaffold.js.map +1 -0
- package/dist/components/app/useApp.js +24 -0
- package/dist/components/app/useApp.js.map +1 -0
- package/dist/components/common/ActionMenuLabel.d.ts +15 -0
- package/dist/components/common/ActionMenuLabel.js +30 -0
- package/dist/components/common/ActionMenuLabel.js.map +1 -0
- package/dist/components/common/default_entity_actions.d.ts +37 -0
- package/dist/components/common/default_entity_actions.js +590 -0
- package/dist/components/common/default_entity_actions.js.map +1 -0
- package/dist/components/drawer_expansion.d.ts +25 -0
- package/dist/components/drawer_expansion.js +44 -0
- package/dist/components/drawer_expansion.js.map +1 -0
- package/dist/components/field_configs.d.ts +2 -2
- package/dist/components/field_configs.js +431 -0
- package/dist/components/field_configs.js.map +1 -0
- package/dist/components/field_ids.d.ts +11 -0
- package/dist/components/field_ids.js +58 -0
- package/dist/components/field_ids.js.map +1 -0
- package/dist/components/history/EntityHistoryEntry.js +151 -0
- package/dist/components/history/EntityHistoryEntry.js.map +1 -0
- package/dist/components/history/EntityHistoryView.js +157 -0
- package/dist/components/history/EntityHistoryView.js.map +1 -0
- package/dist/components/history/UserChip.js +21 -0
- package/dist/components/history/UserChip.js.map +1 -0
- package/dist/components/history/index.js +4 -0
- package/dist/components/lazy_record_views.d.ts +10 -0
- package/dist/components/lazy_record_views.js +57 -0
- package/dist/components/lazy_record_views.js.map +1 -0
- package/dist/contexts/BreacrumbsContext.js +28 -0
- package/dist/contexts/BreacrumbsContext.js.map +1 -0
- package/dist/contexts/EditorAIControllerContext.d.ts +18 -0
- package/dist/contexts/EditorAIControllerContext.js +29 -0
- package/dist/contexts/EditorAIControllerContext.js.map +1 -0
- package/dist/contexts/SideDialogsControllerContext.js +7 -0
- package/dist/contexts/SideDialogsControllerContext.js.map +1 -0
- package/dist/data_export/export/BasicExportAction.js +151 -0
- package/dist/data_export/export/BasicExportAction.js.map +1 -0
- package/dist/data_export/export/ExportCollectionAction.js +297 -0
- package/dist/data_export/export/ExportCollectionAction.js.map +1 -0
- package/dist/data_export/export/additional_fields.js +40 -0
- package/dist/data_export/export/additional_fields.js.map +1 -0
- package/dist/data_export/export/export.d.ts +35 -0
- package/dist/data_export/export/export.js +400 -0
- package/dist/data_export/export/export.js.map +1 -0
- package/dist/data_export/export/fetch_export_data.d.ts +17 -7
- package/dist/data_export/export/fetch_export_data.js +67 -0
- package/dist/data_export/export/fetch_export_data.js.map +1 -0
- package/dist/data_export/export/index.d.ts +4 -2
- package/dist/data_export/export/index.js +5 -0
- package/dist/data_import/components/DataNewPropertiesMapping.js +207 -0
- package/dist/data_import/components/DataNewPropertiesMapping.js.map +1 -0
- package/dist/data_import/components/ImportConversionProblems.d.ts +11 -0
- package/dist/data_import/components/ImportConversionProblems.js +89 -0
- package/dist/data_import/components/ImportConversionProblems.js.map +1 -0
- package/dist/data_import/components/ImportFileUpload.js +43 -0
- package/dist/data_import/components/ImportFileUpload.js.map +1 -0
- package/dist/data_import/components/ImportNewPropertyFieldPreview.js +42 -0
- package/dist/data_import/components/ImportNewPropertyFieldPreview.js.map +1 -0
- package/dist/data_import/components/ImportSaveInProgress.js +105 -0
- package/dist/data_import/components/ImportSaveInProgress.js.map +1 -0
- package/dist/data_import/components/index.d.ts +1 -0
- package/dist/data_import/hooks/useImportConfig.js +34 -0
- package/dist/data_import/hooks/useImportConfig.js.map +1 -0
- package/dist/{import-TCgkTVlS.js → data_import/import/ImportCollectionAction.js} +84 -92
- package/dist/data_import/import/ImportCollectionAction.js.map +1 -0
- package/dist/data_import/import/index.js +2 -0
- package/dist/data_import/utils/csv.js +146 -0
- package/dist/data_import/utils/csv.js.map +1 -0
- package/dist/data_import/utils/data.d.ts +81 -4
- package/dist/data_import/utils/data.js +366 -0
- package/dist/data_import/utils/data.js.map +1 -0
- package/dist/data_import/utils/file_headers.js +32 -0
- package/dist/data_import/utils/file_headers.js.map +1 -0
- package/dist/data_import/utils/file_to_json.js +149 -0
- package/dist/data_import/utils/file_to_json.js.map +1 -0
- package/dist/data_import/utils/get_import_inference_type.js +14 -0
- package/dist/data_import/utils/get_import_inference_type.js.map +1 -0
- package/dist/data_import/utils/id_column.js +27 -0
- package/dist/data_import/utils/id_column.js.map +1 -0
- package/dist/data_import/utils/import_columns.d.ts +48 -0
- package/dist/data_import/utils/import_columns.js +92 -0
- package/dist/data_import/utils/import_columns.js.map +1 -0
- package/dist/data_import/utils/save_entities.d.ts +33 -4
- package/dist/data_import/utils/save_entities.js +244 -0
- package/dist/data_import/utils/save_entities.js.map +1 -0
- package/dist/data_import/utils/transforms.js +83 -0
- package/dist/data_import/utils/transforms.js.map +1 -0
- package/dist/editor/components/SlashCommandMenu.js +497 -0
- package/dist/editor/components/SlashCommandMenu.js.map +1 -0
- package/dist/editor/components/editor-bubble-item.js +24 -0
- package/dist/editor/components/editor-bubble-item.js.map +1 -0
- package/dist/editor/components/editor-bubble.js +97 -0
- package/dist/editor/components/editor-bubble.js.map +1 -0
- package/dist/editor/components/image-bubble.js +148 -0
- package/dist/editor/components/image-bubble.js.map +1 -0
- package/dist/editor/components/table-bubble.js +406 -0
- package/dist/editor/components/table-bubble.js.map +1 -0
- package/dist/editor/editor.d.ts +7 -1
- package/dist/editor/editor.js +423 -0
- package/dist/editor/editor.js.map +1 -0
- package/dist/editor/extensions/HighlightDecorationExtension.js +74 -0
- package/dist/editor/extensions/HighlightDecorationExtension.js.map +1 -0
- package/dist/editor/extensions/Image.d.ts +28 -1
- package/dist/editor/extensions/Image.js +160 -0
- package/dist/editor/extensions/Image.js.map +1 -0
- package/dist/editor/extensions/TextLoadingDecorationExtension.js +82 -0
- package/dist/editor/extensions/TextLoadingDecorationExtension.js.map +1 -0
- package/dist/editor/extensions/clipboard.js +63 -0
- package/dist/editor/extensions/clipboard.js.map +1 -0
- package/dist/editor/extensions/drag-and-drop.js +354 -0
- package/dist/editor/extensions/drag-and-drop.js.map +1 -0
- package/dist/editor/hooks/useProseMirror.d.ts +4 -1
- package/dist/editor/hooks/useProseMirror.js +101 -0
- package/dist/editor/hooks/useProseMirror.js.map +1 -0
- package/dist/editor/hooks/useProseMirrorContext.js +11 -0
- package/dist/editor/hooks/useProseMirrorContext.js.map +1 -0
- package/dist/editor/markdown.js +154 -0
- package/dist/editor/markdown.js.map +1 -0
- package/dist/editor/nodeViews/ImageComponent.js +35 -0
- package/dist/editor/nodeViews/ImageComponent.js.map +1 -0
- package/dist/editor/nodeViews/ReactNodeView.js +57 -0
- package/dist/editor/nodeViews/ReactNodeView.js.map +1 -0
- package/dist/editor/nodeViews/TaskItemComponent.js +29 -0
- package/dist/editor/nodeViews/TaskItemComponent.js.map +1 -0
- package/dist/editor/nodeViews/index.js +21 -0
- package/dist/editor/nodeViews/index.js.map +1 -0
- package/dist/editor/plugins/index.js +54 -0
- package/dist/editor/plugins/index.js.map +1 -0
- package/dist/editor/plugins/inputrules.js +54 -0
- package/dist/editor/plugins/inputrules.js.map +1 -0
- package/dist/editor/plugins/placeholderPlugin.js +38 -0
- package/dist/editor/plugins/placeholderPlugin.js.map +1 -0
- package/dist/editor/plugins/slashCommandPlugin.js +40 -0
- package/dist/editor/plugins/slashCommandPlugin.js.map +1 -0
- package/dist/editor/sanitize-html.js +190 -0
- package/dist/editor/sanitize-html.js.map +1 -0
- package/dist/{markdown-CCqp8ibf.js → editor/schema.js} +2 -159
- package/dist/editor/schema.js.map +1 -0
- package/dist/editor/selectors/link-selector.js +118 -0
- package/dist/editor/selectors/link-selector.js.map +1 -0
- package/dist/editor/selectors/node-selector.js +118 -0
- package/dist/editor/selectors/node-selector.js.map +1 -0
- package/dist/editor/selectors/text-buttons.js +71 -0
- package/dist/editor/selectors/text-buttons.js.map +1 -0
- package/dist/editor/utils/prosemirror-utils.js +92 -0
- package/dist/editor/utils/prosemirror-utils.js.map +1 -0
- package/dist/editor/utils/remove_classes.js +16 -0
- package/dist/editor/utils/remove_classes.js.map +1 -0
- package/dist/editor.js +1 -3085
- package/dist/form/EntityForm.js +734 -0
- package/dist/form/EntityForm.js.map +1 -0
- package/dist/form/EntityFormActions.js +101 -0
- package/dist/form/EntityFormActions.js.map +1 -0
- package/dist/form/EntityFormBinding.js +257 -0
- package/dist/form/EntityFormBinding.js.map +1 -0
- package/dist/form/PropertyFieldBinding.js +298 -0
- package/dist/form/PropertyFieldBinding.js.map +1 -0
- package/dist/form/components/ErrorFocus.js +33 -0
- package/dist/form/components/ErrorFocus.js.map +1 -0
- package/dist/form/components/FieldBlock.js +118 -0
- package/dist/form/components/FieldBlock.js.map +1 -0
- package/dist/form/components/FieldHelperText.js +56 -0
- package/dist/form/components/FieldHelperText.js.map +1 -0
- package/dist/form/components/FormRail.js +118 -0
- package/dist/form/components/FormRail.js.map +1 -0
- package/dist/form/components/FormSections.js +63 -0
- package/dist/form/components/FormSections.js.map +1 -0
- package/dist/form/components/LabelWithIcon.js +29 -0
- package/dist/form/components/LabelWithIcon.js.map +1 -0
- package/dist/form/components/LocalChangesMenu.js +127 -0
- package/dist/form/components/LocalChangesMenu.js.map +1 -0
- package/dist/form/components/StorageItemPreview.js +46 -0
- package/dist/form/components/StorageItemPreview.js.map +1 -0
- package/dist/form/components/StorageUploadProgress.js +84 -0
- package/dist/form/components/StorageUploadProgress.js.map +1 -0
- package/dist/form/components/useRailVisible.js +43 -0
- package/dist/form/components/useRailVisible.js.map +1 -0
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.js +84 -0
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js +125 -0
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/BinaryFieldBinding.js +135 -0
- package/dist/form/field_bindings/BinaryFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/BlockFieldBinding.js +164 -0
- package/dist/form/field_bindings/BlockFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/DateTimeFieldBinding.js +47 -0
- package/dist/form/field_bindings/DateTimeFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/GeopointFieldBinding.js +148 -0
- package/dist/form/field_bindings/GeopointFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/KeyValueFieldBinding.js +450 -0
- package/dist/form/field_bindings/KeyValueFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/MapFieldBinding.js +77 -0
- package/dist/form/field_bindings/MapFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.js +215 -0
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/MultiSelectFieldBinding.js +88 -0
- package/dist/form/field_bindings/MultiSelectFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/MultipleRelationFieldBinding.js +118 -0
- package/dist/form/field_bindings/MultipleRelationFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/ReadOnlyFieldBinding.js +52 -0
- package/dist/form/field_bindings/ReadOnlyFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/ReferenceFieldBinding.js +99 -0
- package/dist/form/field_bindings/ReferenceFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/RelationFieldBinding.js +135 -0
- package/dist/form/field_bindings/RelationFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/RepeatFieldBinding.js +103 -0
- package/dist/form/field_bindings/RepeatFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/SelectFieldBinding.js +80 -0
- package/dist/form/field_bindings/SelectFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/StorageUploadFieldBinding.js +266 -0
- package/dist/form/field_bindings/StorageUploadFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/SwitchFieldBinding.js +41 -0
- package/dist/form/field_bindings/SwitchFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/TextFieldBinding.js +114 -0
- package/dist/form/field_bindings/TextFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/UserSelectFieldBinding.js +48 -0
- package/dist/form/field_bindings/UserSelectFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/VectorFieldBinding.js +147 -0
- package/dist/form/field_bindings/VectorFieldBinding.js.map +1 -0
- package/dist/form/form_keyboard_scope.d.ts +26 -0
- package/dist/form/form_keyboard_scope.js +39 -0
- package/dist/form/form_keyboard_scope.js.map +1 -0
- package/dist/form/form_uploads.d.ts +24 -0
- package/dist/form/form_uploads.js +31 -0
- package/dist/form/form_uploads.js.map +1 -0
- package/dist/form/form_utils.d.ts +48 -0
- package/dist/form/form_utils.js +280 -0
- package/dist/form/form_utils.js.map +1 -0
- package/dist/form/resolve_cell_property.d.ts +32 -0
- package/dist/form/resolve_cell_property.js +80 -0
- package/dist/form/resolve_cell_property.js.map +1 -0
- package/dist/form/resolve_form_properties.d.ts +27 -0
- package/dist/form/resolve_form_properties.js +78 -0
- package/dist/form/resolve_form_properties.js.map +1 -0
- package/dist/form/useClearRestoreValue.js +27 -0
- package/dist/form/useClearRestoreValue.js.map +1 -0
- package/dist/form/useUndoableDiscard.js +36 -0
- package/dist/form/useUndoableDiscard.js.map +1 -0
- package/dist/form/validation.d.ts +20 -0
- package/dist/form/validation.js +416 -0
- package/dist/form/validation.js.map +1 -0
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.js +22 -0
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.js.map +1 -0
- package/dist/hooks/navigation/contexts/NavigationStateContext.js +15 -0
- package/dist/hooks/navigation/contexts/NavigationStateContext.js.map +1 -0
- package/dist/hooks/navigation/contexts/UrlContext.js +22 -0
- package/dist/hooks/navigation/contexts/UrlContext.js.map +1 -0
- package/dist/hooks/navigation/useAsyncResolver.js +68 -0
- package/dist/hooks/navigation/useAsyncResolver.js.map +1 -0
- package/dist/hooks/navigation/useBuildCollectionRegistryController.js +141 -0
- package/dist/hooks/navigation/useBuildCollectionRegistryController.js.map +1 -0
- package/dist/hooks/navigation/useBuildNavigationStateController.js +77 -0
- package/dist/hooks/navigation/useBuildNavigationStateController.js.map +1 -0
- package/dist/hooks/navigation/useBuildUrlController.js +57 -0
- package/dist/hooks/navigation/useBuildUrlController.js.map +1 -0
- package/dist/hooks/navigation/useNavigationResolution.js +177 -0
- package/dist/hooks/navigation/useNavigationResolution.js.map +1 -0
- package/dist/hooks/navigation/useResolvedCollections.js +56 -0
- package/dist/hooks/navigation/useResolvedCollections.js.map +1 -0
- package/dist/hooks/navigation/useResolvedViews.js +94 -0
- package/dist/hooks/navigation/useResolvedViews.js.map +1 -0
- package/dist/hooks/navigation/useTopLevelNavigation.js +162 -0
- package/dist/hooks/navigation/useTopLevelNavigation.js.map +1 -0
- package/dist/hooks/navigation/utils.js +125 -0
- package/dist/hooks/navigation/utils.js.map +1 -0
- package/dist/hooks/useAdminContext.js +45 -0
- package/dist/hooks/useAdminContext.js.map +1 -0
- package/dist/hooks/useBreadcrumbsController.js +17 -0
- package/dist/hooks/useBreadcrumbsController.js.map +1 -0
- package/dist/hooks/useBuildSideDialogsController.js +96 -0
- package/dist/hooks/useBuildSideDialogsController.js.map +1 -0
- package/dist/hooks/useBuildSidePanel.js +208 -0
- package/dist/hooks/useBuildSidePanel.js.map +1 -0
- package/dist/hooks/useChildViewSource.js +41 -0
- package/dist/hooks/useChildViewSource.js.map +1 -0
- package/dist/hooks/useEntityDisplay.js +136 -0
- package/dist/hooks/useEntityDisplay.js.map +1 -0
- package/dist/hooks/useEntityDisplayTitle.js +34 -0
- package/dist/hooks/useEntityDisplayTitle.js.map +1 -0
- package/dist/hooks/useHistory.js +137 -0
- package/dist/hooks/useHistory.js.map +1 -0
- package/dist/hooks/useRecordActions.d.ts +28 -6
- package/dist/hooks/useRecordActions.js +108 -0
- package/dist/hooks/useRecordActions.js.map +1 -0
- package/dist/hooks/useReferencePaths.d.ts +21 -0
- package/dist/hooks/useReferencePaths.js +32 -0
- package/dist/hooks/useReferencePaths.js.map +1 -0
- package/dist/hooks/useResolvedNavigationFrom.js +83 -0
- package/dist/hooks/useResolvedNavigationFrom.js.map +1 -0
- package/dist/hooks/useResolvedUsers.js +109 -0
- package/dist/hooks/useResolvedUsers.js.map +1 -0
- package/dist/hooks/useSelectionDialog.js +53 -0
- package/dist/hooks/useSelectionDialog.js.map +1 -0
- package/dist/hooks/useSideDialogsController.js +8 -0
- package/dist/hooks/useSideDialogsController.js.map +1 -0
- package/dist/hooks/useSidePanel.js +15 -0
- package/dist/hooks/useSidePanel.js.map +1 -0
- package/dist/hooks/useStorageReferenceResolver.d.ts +25 -0
- package/dist/hooks/useStorageReferenceResolver.js +49 -0
- package/dist/hooks/useStorageReferenceResolver.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +149 -3793
- package/dist/preview/PropertyPreview.js +260 -0
- package/dist/preview/PropertyPreview.js.map +1 -0
- package/dist/preview/compact_text.js +52 -0
- package/dist/preview/compact_text.js.map +1 -0
- package/dist/preview/components/ArrayEnumPreview.js +24 -0
- package/dist/preview/components/ArrayEnumPreview.js.map +1 -0
- package/dist/preview/components/BooleanPreview.js +25 -0
- package/dist/preview/components/BooleanPreview.js.map +1 -0
- package/dist/preview/components/DatePreview.d.ts +3 -2
- package/dist/preview/components/DatePreview.js +87 -0
- package/dist/preview/components/DatePreview.js.map +1 -0
- package/dist/preview/components/EmptyValue.js +13 -0
- package/dist/preview/components/EmptyValue.js.map +1 -0
- package/dist/preview/components/EnumValuesChip.js +26 -0
- package/dist/preview/components/EnumValuesChip.js.map +1 -0
- package/dist/preview/components/ImagePreview.d.ts +7 -1
- package/dist/preview/components/ImagePreview.js +112 -0
- package/dist/preview/components/ImagePreview.js.map +1 -0
- package/dist/preview/components/InlineEntityListPreview.js +31 -0
- package/dist/preview/components/InlineEntityListPreview.js.map +1 -0
- package/dist/preview/components/ReferencePreview.js +162 -0
- package/dist/preview/components/ReferencePreview.js.map +1 -0
- package/dist/preview/components/RelationPreview.js +196 -0
- package/dist/preview/components/RelationPreview.js.map +1 -0
- package/dist/preview/components/StorageMarkdown.d.ts +11 -0
- package/dist/preview/components/StorageMarkdown.js +49 -0
- package/dist/preview/components/StorageMarkdown.js.map +1 -0
- package/dist/preview/components/StorageThumbnail.js +183 -0
- package/dist/preview/components/StorageThumbnail.js.map +1 -0
- package/dist/preview/components/UrlComponentPreview.d.ts +3 -1
- package/dist/preview/components/UrlComponentPreview.js +88 -0
- package/dist/preview/components/UrlComponentPreview.js.map +1 -0
- package/dist/preview/components/UserPreview.js +30 -0
- package/dist/preview/components/UserPreview.js.map +1 -0
- package/dist/preview/components/date_fns_locales.js +124 -0
- package/dist/preview/components/date_fns_locales.js.map +1 -0
- package/dist/preview/components/storageRenditions.d.ts +10 -0
- package/dist/preview/components/storageRenditions.js +93 -0
- package/dist/preview/components/storageRenditions.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfMapsPreview.js +44 -0
- package/dist/preview/property_previews/ArrayOfMapsPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfReferencesPreview.js +48 -0
- package/dist/preview/property_previews/ArrayOfReferencesPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfRelationsPreview.js +50 -0
- package/dist/preview/property_previews/ArrayOfRelationsPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.js +30 -0
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfStringsPreview.js +42 -0
- package/dist/preview/property_previews/ArrayOfStringsPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOneOfPreview.js +47 -0
- package/dist/preview/property_previews/ArrayOneOfPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.js +25 -0
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayPropertyPreview.js +48 -0
- package/dist/preview/property_previews/ArrayPropertyPreview.js.map +1 -0
- package/dist/preview/property_previews/MapPropertyPreview.js +137 -0
- package/dist/preview/property_previews/MapPropertyPreview.js.map +1 -0
- package/dist/preview/property_previews/NumberPropertyPreview.js +34 -0
- package/dist/preview/property_previews/NumberPropertyPreview.js.map +1 -0
- package/dist/preview/property_previews/SkeletonPropertyComponent.js +151 -0
- package/dist/preview/property_previews/SkeletonPropertyComponent.js.map +1 -0
- package/dist/preview/property_previews/StringPropertyPreview.js +49 -0
- package/dist/preview/property_previews/StringPropertyPreview.js.map +1 -0
- package/dist/preview/util.d.ts +8 -3
- package/dist/{util-CC0ozHoD.js → preview/util.js} +13 -6
- package/dist/preview/util.js.map +1 -0
- package/dist/routes/CustomViewRoute.js +26 -0
- package/dist/routes/CustomViewRoute.js.map +1 -0
- package/dist/routes/RebaseRoute.js +311 -0
- package/dist/routes/RebaseRoute.js.map +1 -0
- package/dist/selection/SelectionMenu.js +90 -0
- package/dist/selection/SelectionMenu.js.map +1 -0
- package/dist/selection/resolve_selection.js +79 -0
- package/dist/selection/resolve_selection.js.map +1 -0
- package/dist/util/caller_scopes.d.ts +15 -0
- package/dist/util/caller_scopes.js +25 -0
- package/dist/util/caller_scopes.js.map +1 -0
- package/dist/util/collection_open_mode.d.ts +20 -0
- package/dist/util/collection_open_mode.js +32 -0
- package/dist/util/collection_open_mode.js.map +1 -0
- package/dist/util/dataControllerAdapter.js +65 -0
- package/dist/util/dataControllerAdapter.js.map +1 -0
- package/dist/util/entity_actions.d.ts +42 -1
- package/dist/util/entity_actions.js +77 -0
- package/dist/util/entity_actions.js.map +1 -0
- package/dist/util/entity_pages.d.ts +37 -3
- package/dist/util/entity_pages.js +71 -0
- package/dist/util/entity_pages.js.map +1 -0
- package/dist/util/find_entities_by_ids.d.ts +23 -0
- package/dist/util/find_entities_by_ids.js +55 -0
- package/dist/util/find_entities_by_ids.js.map +1 -0
- package/dist/util/fit_inline_actions.d.ts +20 -0
- package/dist/util/fit_inline_actions.js +40 -0
- package/dist/util/fit_inline_actions.js.map +1 -0
- package/dist/util/format_collection_date.d.ts +29 -0
- package/dist/util/format_collection_date.js +60 -0
- package/dist/util/format_collection_date.js.map +1 -0
- package/dist/util/map_with_concurrency.js +46 -0
- package/dist/util/map_with_concurrency.js.map +1 -0
- package/dist/util/navigation_utils.js +44 -0
- package/dist/util/navigation_utils.js.map +1 -0
- package/dist/util/number_format.js +33 -0
- package/dist/util/number_format.js.map +1 -0
- package/dist/util/previews.js +71 -0
- package/dist/util/previews.js.map +1 -0
- package/dist/util/propertyConfigMapper.js +83 -0
- package/dist/util/propertyConfigMapper.js.map +1 -0
- package/dist/util/property_utils.js +141 -0
- package/dist/util/property_utils.js.map +1 -0
- package/dist/util/resolutions.js +55 -0
- package/dist/util/resolutions.js.map +1 -0
- package/dist/util/view_constants.js +35 -0
- package/dist/util/view_constants.js.map +1 -0
- package/dist/util/view_mode.js +112 -0
- package/dist/util/view_mode.js.map +1 -0
- package/package.json +13 -9
- package/dist/CollectionEditorDialog-DLHCka00.js +0 -3630
- package/dist/CollectionEditorDialog-DLHCka00.js.map +0 -1
- package/dist/JsonPreviewBinding-v0w3H0fp.js.map +0 -1
- package/dist/PropertyEditView-_pu5hzZn.js +0 -3837
- package/dist/PropertyEditView-_pu5hzZn.js.map +0 -1
- package/dist/RouterCollectionsStudioView-ChPNl_uU.js +0 -212
- package/dist/RouterCollectionsStudioView-ChPNl_uU.js.map +0 -1
- package/dist/SchemaChangeDialog-BeP0A4MJ.js.map +0 -1
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +0 -13
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +0 -8
- package/dist/collection_editor_ui.js.map +0 -1
- package/dist/editor.js.map +0 -1
- package/dist/export-4bJWdlDK.js +0 -520
- package/dist/export-4bJWdlDK.js.map +0 -1
- package/dist/history-BElrZ5Rw.js +0 -313
- package/dist/history-BElrZ5Rw.js.map +0 -1
- package/dist/import-TCgkTVlS.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/markdown-CCqp8ibf.js.map +0 -1
- package/dist/rolldown-runtime-D7D4PA-g.js +0 -13
- package/dist/util-CC0ozHoD.js.map +0 -1
- package/dist/util-DybQBkug.js +0 -26390
- package/dist/util-DybQBkug.js.map +0 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { useAdminContext } from "../../hooks/useAdminContext.js";
|
|
2
|
+
import { entityActionName, placeEntityActions, resolveEntityActionState } from "../../util/entity_actions.js";
|
|
3
|
+
import { ActionMenuLabel } from "../common/ActionMenuLabel.js";
|
|
4
|
+
import React, { useCallback } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Badge, Checkbox, IconButton, Menu, MenuItem, MoreVerticalIcon, Separator, Skeleton, Tooltip, cls } from "@rebasepro/ui";
|
|
7
|
+
import { getEntityFromCache, getIcon, getLocalChangesBackup, useSlot, useTranslation } from "@rebasepro/app";
|
|
8
|
+
//#region src/components/CollectionTableBinding/CollectionRowActions.tsx
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param entity
|
|
12
|
+
* @param width
|
|
13
|
+
* @param frozen
|
|
14
|
+
* @param isSelected
|
|
15
|
+
* @param selectionEnabled
|
|
16
|
+
* @param size
|
|
17
|
+
* @param toggleEntitySelection
|
|
18
|
+
* @param hideId
|
|
19
|
+
*
|
|
20
|
+
* @group Collection components
|
|
21
|
+
*/
|
|
22
|
+
var CollectionRowActions = function CollectionRowActions({ entity, collection, path, width, frozen, isSelected, selectionEnabled, size, highlightEntity, onCollectionChange, unhighlightEntity, actions = [], hideId, selectionController, openEntityMode, sortableNodeRef, sortableStyle, sortableAttributes, isDragging, isDraggable }) {
|
|
23
|
+
const context = useAdminContext();
|
|
24
|
+
const sidePanelCtrl = context.sidePanelController;
|
|
25
|
+
const { t } = useTranslation();
|
|
26
|
+
const slotActions = useSlot("entity.row.actions", React.useMemo(() => ({
|
|
27
|
+
entity,
|
|
28
|
+
entityId: entity.id,
|
|
29
|
+
path,
|
|
30
|
+
collection,
|
|
31
|
+
selectionController,
|
|
32
|
+
context
|
|
33
|
+
}), [
|
|
34
|
+
entity,
|
|
35
|
+
path,
|
|
36
|
+
collection,
|
|
37
|
+
selectionController,
|
|
38
|
+
context
|
|
39
|
+
]));
|
|
40
|
+
const onCheckedChange = useCallback((checked) => {
|
|
41
|
+
selectionController?.toggleEntitySelection(entity, checked);
|
|
42
|
+
}, [entity, selectionController?.toggleEntitySelection]);
|
|
43
|
+
const hasActions = actions.length > 0 || slotActions.length > 0;
|
|
44
|
+
const placed = placeEntityActions(actions);
|
|
45
|
+
const uncollapsedActions = placed.inline;
|
|
46
|
+
const collapsedGroups = [
|
|
47
|
+
placed.own,
|
|
48
|
+
placed.generic,
|
|
49
|
+
placed.destructive
|
|
50
|
+
].filter((group) => group.length > 0);
|
|
51
|
+
const hasCollapsedActions = collapsedGroups.length > 0;
|
|
52
|
+
const hasDraft = (collection ? getLocalChangesBackup(collection) : false) ? getEntityFromCache(path + "/" + entity.id) : false;
|
|
53
|
+
const iconSize = "small";
|
|
54
|
+
const clickProps = {
|
|
55
|
+
view: "collection",
|
|
56
|
+
entity,
|
|
57
|
+
path,
|
|
58
|
+
collection,
|
|
59
|
+
context,
|
|
60
|
+
sidePanelController: sidePanelCtrl,
|
|
61
|
+
selectionController,
|
|
62
|
+
highlightEntity,
|
|
63
|
+
unhighlightEntity,
|
|
64
|
+
onCollectionChange,
|
|
65
|
+
openEntityMode: openEntityMode ?? collection?.openEntityMode
|
|
66
|
+
};
|
|
67
|
+
const actionState = (action) => resolveEntityActionState(action, clickProps);
|
|
68
|
+
const content = /* @__PURE__ */ jsxs("div", {
|
|
69
|
+
className: cls("h-full flex items-center justify-center flex-col z-10", isSelected ? "bg-surface-raised" : "bg-surface-card group-hover:bg-surface-card-hover", frozen ? "sticky left-0" : ""),
|
|
70
|
+
onClick: useCallback((event) => {
|
|
71
|
+
event.stopPropagation();
|
|
72
|
+
}, []),
|
|
73
|
+
style: {
|
|
74
|
+
width,
|
|
75
|
+
position: frozen ? "sticky" : "relative",
|
|
76
|
+
left: frozen ? 0 : "initial",
|
|
77
|
+
contain: "strict"
|
|
78
|
+
},
|
|
79
|
+
children: [(hasActions || selectionEnabled) && /* @__PURE__ */ jsxs("div", {
|
|
80
|
+
className: cls("absolute inset-0 flex items-center justify-center gap-0.5", isSelected ? "bg-surface-raised" : "bg-surface-card group-hover:bg-surface-card-hover opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity duration-100"),
|
|
81
|
+
children: [
|
|
82
|
+
uncollapsedActions.map((action, index) => {
|
|
83
|
+
const isEditAction = action.key === "edit";
|
|
84
|
+
const { enabled, disabledReason } = actionState(action);
|
|
85
|
+
const name = entityActionName(action, t);
|
|
86
|
+
const tooltip = isEditAction && hasDraft ? t("unsaved_local_changes") : disabledReason ? `${name}: ${disabledReason}` : name;
|
|
87
|
+
let iconButton = /* @__PURE__ */ jsx(IconButton, {
|
|
88
|
+
"aria-label": name,
|
|
89
|
+
disabled: !enabled,
|
|
90
|
+
onClick: (event) => {
|
|
91
|
+
event.stopPropagation();
|
|
92
|
+
action.onClick(clickProps);
|
|
93
|
+
},
|
|
94
|
+
size: iconSize,
|
|
95
|
+
children: getIcon(action.icon, void 0, void 0, "smallest")
|
|
96
|
+
});
|
|
97
|
+
if (isEditAction && hasDraft) iconButton = /* @__PURE__ */ jsx(Badge, {
|
|
98
|
+
color: "warning",
|
|
99
|
+
children: iconButton
|
|
100
|
+
});
|
|
101
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
102
|
+
title: tooltip,
|
|
103
|
+
asChild: enabled,
|
|
104
|
+
children: iconButton
|
|
105
|
+
}, index);
|
|
106
|
+
}),
|
|
107
|
+
slotActions,
|
|
108
|
+
hasCollapsedActions && /* @__PURE__ */ jsx(Menu, {
|
|
109
|
+
trigger: /* @__PURE__ */ jsx(IconButton, {
|
|
110
|
+
"aria-label": t("more_actions"),
|
|
111
|
+
size: iconSize,
|
|
112
|
+
children: /* @__PURE__ */ jsx(MoreVerticalIcon, {})
|
|
113
|
+
}),
|
|
114
|
+
children: collapsedGroups.map((group, groupIndex) => /* @__PURE__ */ jsxs(React.Fragment, { children: [groupIndex > 0 && /* @__PURE__ */ jsx(Separator, { orientation: "horizontal" }), group.map((action, index) => {
|
|
115
|
+
const { enabled, disabledReason } = actionState(action);
|
|
116
|
+
return /* @__PURE__ */ jsxs(MenuItem, {
|
|
117
|
+
disabled: !enabled,
|
|
118
|
+
onClick: (e) => {
|
|
119
|
+
e.stopPropagation();
|
|
120
|
+
action.onClick(clickProps);
|
|
121
|
+
},
|
|
122
|
+
children: [getIcon(action.icon, void 0, void 0, "smallest"), /* @__PURE__ */ jsx(ActionMenuLabel, {
|
|
123
|
+
name: entityActionName(action, t),
|
|
124
|
+
disabledReason
|
|
125
|
+
})]
|
|
126
|
+
}, action.key ?? index);
|
|
127
|
+
})] }, groupIndex))
|
|
128
|
+
}),
|
|
129
|
+
selectionEnabled && /* @__PURE__ */ jsx(Tooltip, {
|
|
130
|
+
title: t("select_row", { id: String(entity.id) }),
|
|
131
|
+
children: /* @__PURE__ */ jsx(Checkbox, {
|
|
132
|
+
"aria-label": t("select_row", { id: String(entity.id) }),
|
|
133
|
+
size: "smallest",
|
|
134
|
+
checked: Boolean(isSelected),
|
|
135
|
+
onCheckedChange
|
|
136
|
+
})
|
|
137
|
+
})
|
|
138
|
+
]
|
|
139
|
+
}), !hideId && /* @__PURE__ */ jsx("div", {
|
|
140
|
+
className: "w-[138px] overflow-hidden truncate font-mono text-xs text-text-secondary dark:text-text-secondary-dark max-w-full text-ellipsis px-2 align-center justify-center flex items-center gap-1",
|
|
141
|
+
onClick: (event) => {
|
|
142
|
+
event.stopPropagation();
|
|
143
|
+
},
|
|
144
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
145
|
+
className: "min-w-0 truncate text-center",
|
|
146
|
+
children: entity ? entity.id : /* @__PURE__ */ jsx(Skeleton, {})
|
|
147
|
+
})
|
|
148
|
+
})]
|
|
149
|
+
});
|
|
150
|
+
if (sortableNodeRef) {
|
|
151
|
+
const { tabIndex: _tabIndex, ...sortableAttrsWithoutTabIndex } = sortableAttributes ?? {};
|
|
152
|
+
return /* @__PURE__ */ jsx("div", {
|
|
153
|
+
ref: sortableNodeRef,
|
|
154
|
+
style: sortableStyle,
|
|
155
|
+
className: cls("flex-shrink-0", frozen && "sticky left-0 z-10 bg-surface-card"),
|
|
156
|
+
...sortableAttrsWithoutTabIndex,
|
|
157
|
+
children: content
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
return content;
|
|
161
|
+
};
|
|
162
|
+
//#endregion
|
|
163
|
+
export { CollectionRowActions };
|
|
164
|
+
|
|
165
|
+
//# sourceMappingURL=CollectionRowActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionRowActions.js","names":[],"sources":["../../../src/components/CollectionTableBinding/CollectionRowActions.tsx"],"sourcesContent":["\nimport type { EntityAction, EntityActionClickProps, AdminCollection } from \"@rebasepro/cms-types\";\nimport React, { MouseEvent, useCallback } from \"react\";\n\nimport { Entity } from \"@rebasepro/types\";\nimport { CollectionSize, SelectionController } from \"@rebasepro/cms-types\";\nimport {\n Badge,\n Checkbox,\n cls,\n IconButton,\n Menu,\n MenuItem,\n MoreVerticalIcon,\n Separator,\n Skeleton,\n Tooltip\n} from \"@rebasepro/ui\";\nimport { useTranslation, useSlot } from \"@rebasepro/app\";\nimport { getIcon } from \"@rebasepro/app\";\nimport { getEntityFromCache } from \"@rebasepro/app\";\nimport { getLocalChangesBackup } from \"@rebasepro/app\";\nimport { useAdminContext } from \"../../hooks/useAdminContext\";\nimport { entityActionName, placeEntityActions, resolveEntityActionState } from \"../../util/entity_actions\";\nimport { ActionMenuLabel } from \"../common/ActionMenuLabel\";\n\n/**\n *\n * @param entity\n * @param width\n * @param frozen\n * @param isSelected\n * @param selectionEnabled\n * @param size\n * @param toggleEntitySelection\n * @param hideId\n *\n * @group Collection components\n */\nexport const CollectionRowActions = function CollectionRowActions({\n entity,\n collection,\n path,\n width,\n frozen,\n isSelected,\n selectionEnabled,\n size,\n highlightEntity,\n onCollectionChange,\n unhighlightEntity,\n actions = [],\n hideId,\n selectionController,\n openEntityMode,\n sortableNodeRef,\n sortableStyle,\n sortableAttributes,\n isDragging,\n isDraggable\n}:\n {\n entity: Entity<any>,\n collection?: AdminCollection<any>,\n path?: string,\n width: number,\n frozen?: boolean,\n size: CollectionSize,\n isSelected?: boolean,\n selectionEnabled?: boolean,\n actions?: EntityAction[],\n hideId?: boolean,\n onCollectionChange?: () => void,\n selectionController?: SelectionController;\n highlightEntity?: (entity: Entity<any>) => void;\n unhighlightEntity?: (entity: Entity<any>) => void;\n openEntityMode: \"side_panel\" | \"full_screen\" | \"split\" | \"dialog\";\n // Sortable props for dnd-kit integration\n sortableNodeRef?: (node: HTMLElement | null) => void;\n sortableStyle?: React.CSSProperties;\n sortableAttributes?: Record<string, any>;\n isDragging?: boolean;\n isDraggable?: boolean;\n }) {\n\n const context = useAdminContext();\n const sidePanelCtrl = context.sidePanelController;\n const { t } = useTranslation();\n\n // Plugin row actions, rendered in the same hover overlay as the built-in\n // ones — beside `edit` and before the collapsed menu, which is where a\n // per-row action goes. `collection`, `path` and `selectionController` are\n // forwarded as they arrive: a relation picker renders rows with no\n // collection path, and a table can be shown with selection off.\n const rowSlotProps = React.useMemo(() => ({\n entity,\n entityId: entity.id,\n path,\n collection,\n selectionController,\n context\n }), [entity, path, collection, selectionController, context]);\n const slotActions = useSlot(\"entity.row.actions\", rowSlotProps);\n\n const onCheckedChange = useCallback((checked: boolean) => {\n selectionController?.toggleEntitySelection(entity, checked);\n }, [entity, selectionController?.toggleEntitySelection]);\n\n const hasActions = actions.length > 0 || slotActions.length > 0;\n\n // Placed as the record's own bar places them: icons for `collapsed: false`,\n // and a menu of the collection's actions, then Copy, then Delete apart.\n const placed = placeEntityActions(actions);\n const uncollapsedActions = placed.inline;\n const collapsedGroups = [placed.own, placed.generic, placed.destructive].filter(group => group.length > 0);\n const hasCollapsedActions = collapsedGroups.length > 0;\n const enableLocalChangesBackup = collection ? getLocalChangesBackup(collection) : false;\n const hasDraft = enableLocalChangesBackup ? getEntityFromCache(path + \"/\" + entity.id) : false;\n const iconSize = \"small\" as const;\n\n // What every action on this row is called with, and asked `isEnabled`\n // with — the same question the record's own action bar asks, so an action\n // its record does not allow is disabled here too.\n const clickProps: EntityActionClickProps<Record<string, unknown>> = {\n view: \"collection\",\n entity,\n path,\n collection,\n context,\n sidePanelController: sidePanelCtrl,\n selectionController,\n highlightEntity,\n unhighlightEntity,\n onCollectionChange,\n openEntityMode: openEntityMode ?? collection?.openEntityMode\n };\n const actionState = (action: EntityAction) => resolveEntityActionState(action, clickProps);\n\n const content = (\n <div\n className={cls(\n \"h-full flex items-center justify-center flex-col z-10\",\n isSelected\n ? \"bg-surface-raised\"\n : \"bg-surface-card group-hover:bg-surface-card-hover\",\n frozen ? \"sticky left-0\" : \"\"\n )}\n onClick={useCallback((event: React.MouseEvent) => {\n event.stopPropagation();\n }, [])}\n style={{\n width,\n position: frozen ? \"sticky\" : \"relative\",\n left: frozen ? 0 : \"initial\",\n contain: \"strict\"\n }}>\n\n {/* The row's resting content is its id. The actions (edit, menu,\n select) cover it while the row is hovered, focused or selected,\n so a 36px row carries one line and the tools still fit. */}\n {(hasActions || selectionEnabled) &&\n <div className={cls(\n \"absolute inset-0 flex items-center justify-center gap-0.5\",\n isSelected\n ? \"bg-surface-raised\"\n : \"bg-surface-card group-hover:bg-surface-card-hover opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity duration-100\"\n )}>\n\n {uncollapsedActions.map((action, index) => {\n const isEditAction = action.key === \"edit\";\n const { enabled, disabledReason } = actionState(action);\n const name = entityActionName(action, t);\n const tooltip = isEditAction && hasDraft\n ? t(\"unsaved_local_changes\")\n : disabledReason ? `${name}: ${disabledReason}` : name;\n\n let iconButton = <IconButton\n aria-label={name}\n disabled={!enabled}\n onClick={(event: MouseEvent) => {\n event.stopPropagation();\n action.onClick(clickProps);\n }}\n size={iconSize}>\n {getIcon(action.icon, undefined, undefined, \"smallest\")}\n </IconButton>;\n if (isEditAction && hasDraft) {\n iconButton = (\n <Badge color={\"warning\"}>\n {iconButton}\n </Badge>\n );\n }\n // A disabled icon takes no pointer events, so as the\n // trigger itself its tooltip — the one place it can\n // say why — never opened. Wrapped, the wrapper hovers.\n return (\n <Tooltip key={index}\n title={tooltip}\n asChild={enabled}>\n {iconButton}\n </Tooltip>\n );\n })}\n\n {slotActions}\n\n {hasCollapsedActions &&\n <Menu\n trigger={<IconButton aria-label={t(\"more_actions\")}\n size={iconSize}>\n <MoreVerticalIcon/>\n </IconButton>}>\n {collapsedGroups.map((group, groupIndex) => (\n <React.Fragment key={groupIndex}>\n {groupIndex > 0 && <Separator orientation={\"horizontal\"}/>}\n {group.map((action, index) => {\n const { enabled, disabledReason } = actionState(action);\n return <MenuItem\n key={action.key ?? index}\n disabled={!enabled}\n onClick={(e) => {\n e.stopPropagation();\n action.onClick(clickProps);\n }}>\n {getIcon(action.icon, undefined, undefined, \"smallest\")}\n <ActionMenuLabel name={entityActionName(action, t)} disabledReason={disabledReason}/>\n </MenuItem>;\n })}\n </React.Fragment>\n ))}\n </Menu>\n }\n\n {selectionEnabled &&\n <Tooltip title={t(\"select_row\", { id: String(entity.id) })}>\n <Checkbox\n aria-label={t(\"select_row\", { id: String(entity.id) })}\n size={\"smallest\"}\n checked={Boolean(isSelected)}\n onCheckedChange={onCheckedChange}\n />\n </Tooltip>}\n\n </div>}\n\n {!hideId && (\n <div\n className=\"w-[138px] overflow-hidden truncate font-mono text-xs text-text-secondary dark:text-text-secondary-dark max-w-full text-ellipsis px-2 align-center justify-center flex items-center gap-1\"\n onClick={(event) => {\n event.stopPropagation();\n }}>\n <span className=\"min-w-0 truncate text-center\">\n {entity\n ? entity.id\n : <Skeleton/>\n }\n </span>\n </div>\n )}\n\n </div>\n );\n\n // Wrap with sortable outer div when sortable props are provided\n // Remove tabIndex from attributes to avoid capturing focus before cell content\n if (sortableNodeRef) {\n const { tabIndex: _tabIndex, ...sortableAttrsWithoutTabIndex } = sortableAttributes ?? {};\n return (\n <div\n ref={sortableNodeRef}\n style={sortableStyle}\n className={cls(\n \"flex-shrink-0\",\n frozen && \"sticky left-0 z-10 bg-surface-card\"\n )}\n {...sortableAttrsWithoutTabIndex}\n >\n {content}\n </div>\n );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UAAU;OAC7B;iBANG,CAOF,QAAQ,OAAO,MAAM,KAAA,GAAW,KAAA,GAAW,UAAU,GACtD,oBAAC,iBAAD;QAAiB,MAAM,iBAAiB,QAAQ,CAAC;QAAmB;OAAgB,CAAA,CAC9E;SARD,OAAO,OAAO,KAQb;KACd,CAAC,CACW,EAAA,GAfK,UAeL,CACnB;IACC,CAAA;IAGT,oBACG,oBAAC,SAAD;KAAS,OAAO,EAAE,cAAc,EAAE,IAAI,OAAO,OAAO,EAAE,EAAE,CAAC;eACrD,oBAAC,UAAD;MACI,cAAY,EAAE,cAAc,EAAE,IAAI,OAAO,OAAO,EAAE,EAAE,CAAC;MACrD,MAAM;MACN,SAAS,QAAQ,UAAU;MACV;KACpB,CAAA;IACI,CAAA;GAEZ;MAER,CAAC,UACE,oBAAC,OAAD;GACI,WAAU;GACV,UAAU,UAAU;IAChB,MAAM,gBAAgB;GAC1B;aACA,oBAAC,QAAD;IAAM,WAAU;cACX,SACK,OAAO,KACP,oBAAC,UAAD,CAAU,CAAA;GAEd,CAAA;EACL,CAAA,CAGR;;CAKT,IAAI,iBAAiB;EACjB,MAAM,EAAE,UAAU,WAAW,GAAG,iCAAiC,sBAAsB,CAAC;EACxF,OACI,oBAAC,OAAD;GACI,KAAK;GACL,OAAO;GACP,WAAW,IACP,iBACA,UAAU,oCACd;GACA,GAAI;aAEH;EACA,CAAA;CAEb;CAEA,OAAO;AAEX"}
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { AdditionalFieldValue } from "../AdditionalFieldValue.js";
|
|
2
|
+
import { renderSkeletonText } from "../../preview/property_previews/SkeletonPropertyComponent.js";
|
|
3
|
+
import { EntityTableCell } from "./internal/EntityTableCell.js";
|
|
4
|
+
import { PropertyTableCell } from "./PropertyTableCell.js";
|
|
5
|
+
import { CollectionRowActions } from "./CollectionRowActions.js";
|
|
6
|
+
import { CollectionTableToolbar } from "./internal/CollectionTableToolbar.js";
|
|
7
|
+
import { propertiesToColumns } from "./column_utils.js";
|
|
8
|
+
import { SelectableTable } from "../SelectableTable/SelectableTable.js";
|
|
9
|
+
import React, { useCallback, useContext, useMemo, useRef } from "react";
|
|
10
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { deepEqual } from "fast-equals";
|
|
12
|
+
import { ErrorBoundary, cls } from "@rebasepro/ui";
|
|
13
|
+
import { ErrorView, getRowHeight, isDisabled, useCollectionScope, useLargeLayout, useRebaseContext } from "@rebasepro/app";
|
|
14
|
+
import { getValueInPath } from "@rebasepro/utils";
|
|
15
|
+
//#region src/components/CollectionTableBinding/CollectionTableBinding.tsx
|
|
16
|
+
/**
|
|
17
|
+
* This component is in charge of rendering a collection table with a high
|
|
18
|
+
* degree of customization.
|
|
19
|
+
*
|
|
20
|
+
* This component is used internally by {@link CollectionViewBinding} and
|
|
21
|
+
* {@link useReferenceDialog}
|
|
22
|
+
*
|
|
23
|
+
* Please note that you only need to use this component if you are building
|
|
24
|
+
* a custom view. If you just need to create a default view you can do it
|
|
25
|
+
* exclusively with config options.
|
|
26
|
+
*
|
|
27
|
+
* If you want to bind a {@link AdminCollection} to a table with the default
|
|
28
|
+
* options you see in collections in the top level navigation, you can
|
|
29
|
+
* check {@link CollectionViewBinding}.
|
|
30
|
+
*
|
|
31
|
+
* The data displayed in the table is managed by a {@link EntityTableController}.
|
|
32
|
+
* You can build the default, bound to a path in the driver, by using the hook
|
|
33
|
+
* {@link useDataTableController}
|
|
34
|
+
*
|
|
35
|
+
* @see CollectionTableBindingProps
|
|
36
|
+
* @see CollectionViewBinding
|
|
37
|
+
* @see VirtualTable
|
|
38
|
+
* @group Components
|
|
39
|
+
*/
|
|
40
|
+
var CollectionTableBinding = function CollectionTableBinding({ className, style, fixedFilter, actionsStart, actions, viewModeToggle, title, tableRowActionsBuilder, uniqueFieldValidator, getPropertyFor, onValueChange, selectionController, highlightedEntities, onEntityClick, onColumnResize, initialScroll, onScroll, onSizeChanged, hoverRow = true, inlineEditing = false, additionalFields, displayedColumnIds, defaultSize, properties, tableController, filterable = true, sortable = true, endAdornment, AddColumnComponent, AdditionalHeaderWidget, additionalIDHeaderWidget, emptyComponent, getIdColumnWidth, enablePopupIcon, openEntityMode = "side_panel", onColumnsOrderChange, hideToolbar = false }) {
|
|
41
|
+
const ref = useRef(null);
|
|
42
|
+
const largeLayout = useLargeLayout();
|
|
43
|
+
const hasSelection = Boolean(selectionController?.hasSelection);
|
|
44
|
+
const isRowHighlighted = useCallback((entity) => {
|
|
45
|
+
if (hasSelection) return selectionController.isEntitySelected(entity);
|
|
46
|
+
return Boolean(highlightedEntities?.some((e) => e && e.id === entity.id && e.path === entity.path));
|
|
47
|
+
}, [
|
|
48
|
+
hasSelection,
|
|
49
|
+
selectionController,
|
|
50
|
+
highlightedEntities
|
|
51
|
+
]);
|
|
52
|
+
const highlightedKey = JSON.stringify(highlightedEntities?.map((e) => e ? [e.path, e.id] : null) ?? []);
|
|
53
|
+
const rowActionsContext = useMemo(() => ({
|
|
54
|
+
tableRowActionsBuilder,
|
|
55
|
+
openEntityMode
|
|
56
|
+
}), [
|
|
57
|
+
tableRowActionsBuilder,
|
|
58
|
+
openEntityMode,
|
|
59
|
+
selectionController?.selection,
|
|
60
|
+
highlightedKey
|
|
61
|
+
]);
|
|
62
|
+
const context = useRebaseContext();
|
|
63
|
+
const [size, setSize] = React.useState(defaultSize ?? "m");
|
|
64
|
+
React.useEffect(() => {
|
|
65
|
+
if (defaultSize) setSize(defaultSize);
|
|
66
|
+
}, [defaultSize]);
|
|
67
|
+
useCallback((size) => {
|
|
68
|
+
if (onSizeChanged) onSizeChanged(size);
|
|
69
|
+
setSize(size);
|
|
70
|
+
}, []);
|
|
71
|
+
const onTextSearch = useCallback((newSearchString) => tableController.setSearchString?.(newSearchString), []);
|
|
72
|
+
const additionalFieldsMap = useMemo(() => {
|
|
73
|
+
return additionalFields ? additionalFields.map((aC) => ({ [aC.key]: aC })).reduce((a, b) => ({
|
|
74
|
+
...a,
|
|
75
|
+
...b
|
|
76
|
+
}), {}) : {};
|
|
77
|
+
}, [additionalFields]);
|
|
78
|
+
const customFieldValidator = uniqueFieldValidator;
|
|
79
|
+
const propertyCellRenderer = useCallback(({ column, columnIndex, rowData, rowIndex, sortableNodeRef, sortableStyle, sortableAttributes, isDragging, isDraggable, frozen }) => {
|
|
80
|
+
const entity = rowData;
|
|
81
|
+
if (!entity) return null;
|
|
82
|
+
const propertyKey = column.key;
|
|
83
|
+
const columnCustom = column.custom;
|
|
84
|
+
let disabled = columnCustom?.disabled ?? false;
|
|
85
|
+
const property = getPropertyFor?.({
|
|
86
|
+
propertyKey,
|
|
87
|
+
entity
|
|
88
|
+
}) ?? columnCustom?.resolvedProperty;
|
|
89
|
+
if (!property || !isDisabled(property)) disabled = false;
|
|
90
|
+
if (!property) return null;
|
|
91
|
+
return /* @__PURE__ */ jsx(ErrorBoundary, { children: entity ? /* @__PURE__ */ jsx(PropertyTableCell, {
|
|
92
|
+
readonly: !inlineEditing,
|
|
93
|
+
align: column.align ?? "left",
|
|
94
|
+
propertyKey,
|
|
95
|
+
property,
|
|
96
|
+
value: entity?.values ? getValueInPath(entity.values, propertyKey) : void 0,
|
|
97
|
+
customFieldValidator,
|
|
98
|
+
columnIndex,
|
|
99
|
+
width: column.width,
|
|
100
|
+
height: getRowHeight(size),
|
|
101
|
+
entity,
|
|
102
|
+
disabled,
|
|
103
|
+
enablePopupIcon,
|
|
104
|
+
path: entity.path,
|
|
105
|
+
sortableNodeRef,
|
|
106
|
+
sortableStyle,
|
|
107
|
+
sortableAttributes,
|
|
108
|
+
isDragging,
|
|
109
|
+
isDraggable,
|
|
110
|
+
frozen
|
|
111
|
+
}, `property_table_cell_${entity.id}_${propertyKey}`) : renderSkeletonText() });
|
|
112
|
+
}, [
|
|
113
|
+
getPropertyFor,
|
|
114
|
+
customFieldValidator,
|
|
115
|
+
inlineEditing,
|
|
116
|
+
enablePopupIcon,
|
|
117
|
+
size
|
|
118
|
+
]);
|
|
119
|
+
const additionalCellRenderer = useCallback(({ column, rowData, width, sortableNodeRef, sortableStyle, sortableAttributes, isDragging, isDraggable, frozen }) => {
|
|
120
|
+
const entity = rowData;
|
|
121
|
+
if (!entity) return null;
|
|
122
|
+
const additionalField = additionalFieldsMap[column.key];
|
|
123
|
+
const value = additionalField.dependencies ? Object.entries(entity.values).filter(([key, value]) => additionalField.dependencies.includes(key)).reduce((a, b) => ({
|
|
124
|
+
...a,
|
|
125
|
+
...b
|
|
126
|
+
}), {}) : entity;
|
|
127
|
+
const Builder = additionalField.Builder;
|
|
128
|
+
if (!Builder && !additionalField.value) throw new Error("When using additional fields you need to provide a Builder or a value");
|
|
129
|
+
return /* @__PURE__ */ jsx(EntityTableCell, {
|
|
130
|
+
width,
|
|
131
|
+
size,
|
|
132
|
+
value,
|
|
133
|
+
selected: false,
|
|
134
|
+
disabled: true,
|
|
135
|
+
align: "left",
|
|
136
|
+
allowScroll: false,
|
|
137
|
+
showExpandIcon: false,
|
|
138
|
+
disabledTooltip: "This column can't be edited directly",
|
|
139
|
+
sortableNodeRef,
|
|
140
|
+
sortableStyle,
|
|
141
|
+
sortableAttributes,
|
|
142
|
+
isDragging,
|
|
143
|
+
isDraggable,
|
|
144
|
+
frozen,
|
|
145
|
+
children: /* @__PURE__ */ jsx(ErrorBoundary, { children: Builder ? /* @__PURE__ */ jsx(Builder, {
|
|
146
|
+
entity,
|
|
147
|
+
context
|
|
148
|
+
}) : /* @__PURE__ */ jsx(AdditionalFieldValue, {
|
|
149
|
+
field: additionalField,
|
|
150
|
+
entity,
|
|
151
|
+
context
|
|
152
|
+
}) })
|
|
153
|
+
}, `additional_table_cell_${entity.id}_${column.key}`);
|
|
154
|
+
}, [
|
|
155
|
+
size,
|
|
156
|
+
additionalFieldsMap,
|
|
157
|
+
context
|
|
158
|
+
]);
|
|
159
|
+
const engine = useCollectionScope()?.engine;
|
|
160
|
+
const collectionColumns = useMemo(() => {
|
|
161
|
+
const columnsResult = propertiesToColumns({
|
|
162
|
+
properties,
|
|
163
|
+
sortable,
|
|
164
|
+
fixedFilter,
|
|
165
|
+
engine,
|
|
166
|
+
AdditionalHeaderWidget
|
|
167
|
+
});
|
|
168
|
+
const propertyColumnKeys = new Set(columnsResult.map((col) => col.key));
|
|
169
|
+
const additionalTableColumns = additionalFields ? additionalFields.filter((additionalField) => !propertyColumnKeys.has(additionalField.key)).map((additionalField) => ({
|
|
170
|
+
key: additionalField.key,
|
|
171
|
+
align: "left",
|
|
172
|
+
sortable: false,
|
|
173
|
+
title: additionalField.name,
|
|
174
|
+
width: additionalField.width ?? 200
|
|
175
|
+
})) : [];
|
|
176
|
+
return [...columnsResult, ...additionalTableColumns];
|
|
177
|
+
}, [
|
|
178
|
+
properties,
|
|
179
|
+
sortable,
|
|
180
|
+
fixedFilter,
|
|
181
|
+
engine,
|
|
182
|
+
AdditionalHeaderWidget,
|
|
183
|
+
additionalFields
|
|
184
|
+
]);
|
|
185
|
+
const idHeaderWidgetRef = useRef(additionalIDHeaderWidget);
|
|
186
|
+
if (idHeaderWidgetRef.current !== additionalIDHeaderWidget && !deepEqual(idHeaderWidgetRef.current, additionalIDHeaderWidget)) idHeaderWidgetRef.current = additionalIDHeaderWidget;
|
|
187
|
+
const stableIdHeaderWidget = idHeaderWidgetRef.current;
|
|
188
|
+
const idColumn = useMemo(() => ({
|
|
189
|
+
key: "id_ewcfedcswdf3",
|
|
190
|
+
width: getIdColumnWidth?.() ?? (largeLayout ? 140 : 120),
|
|
191
|
+
title: "ID",
|
|
192
|
+
resizable: false,
|
|
193
|
+
frozen: largeLayout,
|
|
194
|
+
headerAlign: "center",
|
|
195
|
+
align: "center",
|
|
196
|
+
AdditionalHeaderWidget: () => stableIdHeaderWidget
|
|
197
|
+
}), [
|
|
198
|
+
getIdColumnWidth,
|
|
199
|
+
largeLayout,
|
|
200
|
+
stableIdHeaderWidget
|
|
201
|
+
]);
|
|
202
|
+
const columns = useMemo(() => [idColumn, ...displayedColumnIds ? displayedColumnIds.map((p) => {
|
|
203
|
+
return collectionColumns.find((c) => c.key === p.key);
|
|
204
|
+
}).filter(Boolean) : collectionColumns], [
|
|
205
|
+
idColumn,
|
|
206
|
+
displayedColumnIds,
|
|
207
|
+
collectionColumns
|
|
208
|
+
]);
|
|
209
|
+
const cellRenderer = useCallback((props) => {
|
|
210
|
+
const column = props.column;
|
|
211
|
+
const columns = props.columns;
|
|
212
|
+
const columnKey = column.key;
|
|
213
|
+
if (!props.rowData) return /* @__PURE__ */ jsx("div", {
|
|
214
|
+
className: "w-full h-full flex items-center px-4",
|
|
215
|
+
style: { width: column.width },
|
|
216
|
+
"aria-busy": true,
|
|
217
|
+
children: renderSkeletonText(void 0, Math.min(120, Math.max(24, column.width - 32)))
|
|
218
|
+
});
|
|
219
|
+
try {
|
|
220
|
+
if (props.columnIndex === 0) return /* @__PURE__ */ jsx(TableRowActions, {
|
|
221
|
+
entity: props.rowData,
|
|
222
|
+
size,
|
|
223
|
+
width: column.width,
|
|
224
|
+
frozen: column.frozen,
|
|
225
|
+
sortableNodeRef: props.sortableNodeRef,
|
|
226
|
+
sortableStyle: props.sortableStyle,
|
|
227
|
+
sortableAttributes: props.sortableAttributes,
|
|
228
|
+
isDragging: props.isDragging,
|
|
229
|
+
isDraggable: props.isDraggable
|
|
230
|
+
});
|
|
231
|
+
else if (additionalFieldsMap[columnKey]) return additionalCellRenderer(props);
|
|
232
|
+
else if (props.columnIndex < columns.length + 1) return propertyCellRenderer(props);
|
|
233
|
+
else throw Error("Internal: columns not mapped properly");
|
|
234
|
+
} catch (e) {
|
|
235
|
+
console.error("Error rendering cell", e);
|
|
236
|
+
return /* @__PURE__ */ jsx(EntityTableCell, {
|
|
237
|
+
size,
|
|
238
|
+
width: column.width,
|
|
239
|
+
savedTimestamp: void 0,
|
|
240
|
+
value: null,
|
|
241
|
+
align: "left",
|
|
242
|
+
fullHeight: false,
|
|
243
|
+
disabled: true,
|
|
244
|
+
sortableNodeRef: props.sortableNodeRef,
|
|
245
|
+
sortableStyle: props.sortableStyle,
|
|
246
|
+
sortableAttributes: props.sortableAttributes,
|
|
247
|
+
isDragging: props.isDragging,
|
|
248
|
+
isDraggable: props.isDraggable,
|
|
249
|
+
frozen: props.frozen,
|
|
250
|
+
children: /* @__PURE__ */ jsx(ErrorView, { error: e instanceof Error ? e : new Error(String(e)) })
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}, [
|
|
254
|
+
additionalFieldsMap,
|
|
255
|
+
additionalCellRenderer,
|
|
256
|
+
propertyCellRenderer,
|
|
257
|
+
size
|
|
258
|
+
]);
|
|
259
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
260
|
+
ref,
|
|
261
|
+
style,
|
|
262
|
+
className: cls("h-full w-full flex flex-col bg-surface-card", className),
|
|
263
|
+
children: [!hideToolbar && /* @__PURE__ */ jsx(CollectionTableToolbar, {
|
|
264
|
+
onTextSearch,
|
|
265
|
+
title,
|
|
266
|
+
actionsStart,
|
|
267
|
+
actions,
|
|
268
|
+
viewModeToggle,
|
|
269
|
+
loading: tableController.dataLoading
|
|
270
|
+
}), /* @__PURE__ */ jsx(RowActionsContext.Provider, {
|
|
271
|
+
value: rowActionsContext,
|
|
272
|
+
children: /* @__PURE__ */ jsx(SelectableTable, {
|
|
273
|
+
columns,
|
|
274
|
+
size,
|
|
275
|
+
inlineEditing,
|
|
276
|
+
cellRenderer,
|
|
277
|
+
onEntityClick,
|
|
278
|
+
highlightedRow: isRowHighlighted,
|
|
279
|
+
tableController,
|
|
280
|
+
onValueChange,
|
|
281
|
+
initialScroll,
|
|
282
|
+
onScroll,
|
|
283
|
+
onColumnResize,
|
|
284
|
+
hoverRow,
|
|
285
|
+
filterable,
|
|
286
|
+
emptyComponent,
|
|
287
|
+
endAdornment,
|
|
288
|
+
AddColumnComponent,
|
|
289
|
+
onColumnsOrderChange
|
|
290
|
+
})
|
|
291
|
+
})]
|
|
292
|
+
});
|
|
293
|
+
};
|
|
294
|
+
var RowActionsContext = React.createContext({
|
|
295
|
+
tableRowActionsBuilder: void 0,
|
|
296
|
+
openEntityMode: "side_panel"
|
|
297
|
+
});
|
|
298
|
+
/**
|
|
299
|
+
* The first cell of a row: its actions, from the table's builder or the
|
|
300
|
+
* default ones. Reads the builder from context, so a new builder or a new
|
|
301
|
+
* selection redraws this cell in every row and leaves the property cells
|
|
302
|
+
* alone.
|
|
303
|
+
*/
|
|
304
|
+
function TableRowActions({ entity, size, width, frozen, sortableNodeRef, sortableStyle, sortableAttributes, isDragging, isDraggable }) {
|
|
305
|
+
const { tableRowActionsBuilder, openEntityMode } = useContext(RowActionsContext);
|
|
306
|
+
if (tableRowActionsBuilder) return /* @__PURE__ */ jsx(Fragment, { children: tableRowActionsBuilder({
|
|
307
|
+
entity,
|
|
308
|
+
size,
|
|
309
|
+
width,
|
|
310
|
+
frozen
|
|
311
|
+
}) });
|
|
312
|
+
return /* @__PURE__ */ jsx(CollectionRowActions, {
|
|
313
|
+
entity,
|
|
314
|
+
width,
|
|
315
|
+
frozen,
|
|
316
|
+
isSelected: false,
|
|
317
|
+
size,
|
|
318
|
+
openEntityMode,
|
|
319
|
+
sortableNodeRef,
|
|
320
|
+
sortableStyle,
|
|
321
|
+
sortableAttributes,
|
|
322
|
+
isDragging,
|
|
323
|
+
isDraggable
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
//#endregion
|
|
327
|
+
export { CollectionTableBinding };
|
|
328
|
+
|
|
329
|
+
//# sourceMappingURL=CollectionTableBinding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionTableBinding.js","names":[],"sources":["../../../src/components/CollectionTableBinding/CollectionTableBinding.tsx"],"sourcesContent":["import type { AdditionalFieldDelegate, AdminCollection } from \"@rebasepro/cms-types\";\nimport { AdditionalFieldValue } from \"../AdditionalFieldValue\";\nimport React, { useCallback, useContext, useMemo, useRef } from \"react\";\nimport { Entity, User, Property } from \"@rebasepro/types\";\nimport { CollectionSize, RebaseContext } from \"@rebasepro/cms-types\";\nimport { PropertyTableCell } from \"./PropertyTableCell\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\nimport { useRebaseContext, useLargeLayout, useCollectionScope } from \"@rebasepro/app\";\nimport { CellRendererParams, VirtualTableColumn } from \"@rebasepro/ui\";\nimport { CollectionRowActions } from \"./CollectionRowActions\";\nimport { CollectionTableToolbar } from \"./internal/CollectionTableToolbar\";\nimport { CollectionTableBindingProps } from \"./CollectionTableBindingProps\";\nimport { EntityTableCell } from \"./internal/EntityTableCell\";\nimport { CustomFieldValidator } from \"../../form/validation\";\nimport { renderSkeletonText } from \"../../preview\";\nimport { propertiesToColumns } from \"./column_utils\";\nimport { ErrorView } from \"@rebasepro/app\";\nimport { SelectableTable } from \"../SelectableTable/SelectableTable\";\nimport { cls } from \"@rebasepro/ui\";\nimport { getRowHeight, isDisabled } from \"@rebasepro/app\";\nimport { getValueInPath } from \"@rebasepro/utils\";\nimport { deepEqual as equal } from \"fast-equals\";\n\n/**\n * This component is in charge of rendering a collection table with a high\n * degree of customization.\n *\n * This component is used internally by {@link CollectionViewBinding} and\n * {@link useReferenceDialog}\n *\n * Please note that you only need to use this component if you are building\n * a custom view. If you just need to create a default view you can do it\n * exclusively with config options.\n *\n * If you want to bind a {@link AdminCollection} to a table with the default\n * options you see in collections in the top level navigation, you can\n * check {@link CollectionViewBinding}.\n *\n * The data displayed in the table is managed by a {@link EntityTableController}.\n * You can build the default, bound to a path in the driver, by using the hook\n * {@link useDataTableController}\n *\n * @see CollectionTableBindingProps\n * @see CollectionViewBinding\n * @see VirtualTable\n * @group Components\n */\nexport const CollectionTableBinding = function CollectionTableBinding<M extends Record<string, unknown> = Record<string, unknown>, USER extends User = User>\n ({\n className,\n style,\n fixedFilter,\n actionsStart,\n actions,\n viewModeToggle,\n title,\n tableRowActionsBuilder,\n uniqueFieldValidator,\n getPropertyFor,\n onValueChange,\n selectionController,\n highlightedEntities,\n onEntityClick,\n onColumnResize,\n initialScroll,\n onScroll,\n onSizeChanged,\n\n hoverRow = true,\n inlineEditing = false,\n additionalFields,\n displayedColumnIds,\n defaultSize,\n properties,\n tableController,\n filterable = true,\n sortable = true,\n endAdornment,\n AddColumnComponent,\n AdditionalHeaderWidget,\n additionalIDHeaderWidget,\n emptyComponent,\n getIdColumnWidth,\n enablePopupIcon,\n openEntityMode = \"side_panel\",\n onColumnsOrderChange,\n hideToolbar = false\n }: CollectionTableBindingProps<M>) {\n\n const ref = useRef<HTMLDivElement>(null);\n\n const largeLayout = useLargeLayout();\n // Asked per row rather than held as a list: a query selection has no list,\n // and the one this replaced would have answered with whatever the view had\n // scrolled. `highlightedEntities` is the fallback the table has always had\n // — the row you navigated to, shown lit when nothing is selected.\n const hasSelection = Boolean(selectionController?.hasSelection);\n const isRowHighlighted = useCallback((entity: Entity<M>) => {\n if (hasSelection) return selectionController!.isEntitySelected(entity);\n return Boolean(highlightedEntities?.some(e => e && e.id === entity.id && e.path === entity.path));\n }, [hasSelection, selectionController, highlightedEntities]);\n\n // What the row actions are drawn from besides their row. Handed down by\n // context rather than through the cell renderer, so that a change here\n // draws the id column of each row and nothing else: it used to be the\n // cells' memo key, and ticking one checkbox re-ran the renderer of every\n // cell on screen (~460) to redraw the one column that shows a selection.\n //\n // The selection and the highlighted rows are dependencies, not fields: a\n // builder may read either from its closure, and a change to them has to\n // reach the actions it built. The highlighted rows by identity, not by\n // array: a caller passing a new `[]` each render changes nothing.\n const highlightedKey = JSON.stringify(highlightedEntities?.map(e => e ? [e.path, e.id] : null) ?? []);\n const rowActionsContext: RowActionsContextValue<M> = useMemo(() => ({\n tableRowActionsBuilder,\n openEntityMode\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [tableRowActionsBuilder, openEntityMode, selectionController?.selection, highlightedKey]);\n\n const context: RebaseContext<USER> = useRebaseContext<USER>();\n\n const [size, setSize] = React.useState<CollectionSize>(defaultSize ?? \"m\");\n\n // Sync internal size with defaultSize prop when it changes\n React.useEffect(() => {\n if (defaultSize) {\n setSize(defaultSize);\n }\n }, [defaultSize]);\n\n const updateSize = useCallback((size: CollectionSize) => {\n if (onSizeChanged)\n onSizeChanged(size);\n setSize(size);\n }, []);\n\n const onTextSearch = useCallback((newSearchString?: string) => tableController.setSearchString?.(newSearchString), []);\n\n const additionalFieldsMap: Record<string, AdditionalFieldDelegate<M, USER>> = useMemo(() => {\n return (additionalFields\n ? additionalFields\n .map((aC) => ({ [aC.key]: aC as AdditionalFieldDelegate<M, USER> }))\n .reduce((a, b) => ({ ...a,\n...b }), {})\n : {}) as Record<string, AdditionalFieldDelegate<M, USER>>;\n }, [additionalFields]);\n\n const customFieldValidator: CustomFieldValidator | undefined = uniqueFieldValidator;\n\n const propertyCellRenderer = useCallback(({\n column,\n columnIndex,\n rowData,\n rowIndex,\n sortableNodeRef,\n sortableStyle,\n sortableAttributes,\n isDragging,\n isDraggable,\n frozen\n }: CellRendererParams<Entity<M>>) => {\n\n const entity: Entity<M> | undefined = rowData;\n if (!entity) return null;\n\n const propertyKey = column.key;\n\n const columnCustom = column.custom as { disabled?: boolean; resolvedProperty?: Property } | undefined;\n let disabled: boolean = columnCustom?.disabled ?? false;\n const property = getPropertyFor?.({\n propertyKey,\n entity\n }) ?? columnCustom?.resolvedProperty;\n if (!property || !isDisabled(property)) {\n disabled = false;\n }\n\n if (!property) {\n return null;\n }\n\n return (\n <ErrorBoundary>\n {entity\n ? <PropertyTableCell\n key={`property_table_cell_${entity.id}_${propertyKey}`}\n readonly={!inlineEditing}\n align={column.align ?? \"left\"}\n propertyKey={propertyKey as string}\n property={property}\n value={entity?.values ? getValueInPath(entity.values, propertyKey) : undefined}\n customFieldValidator={customFieldValidator}\n columnIndex={columnIndex}\n width={column.width}\n height={getRowHeight(size)}\n entity={entity}\n disabled={disabled}\n enablePopupIcon={enablePopupIcon}\n path={entity.path}\n sortableNodeRef={sortableNodeRef}\n sortableStyle={sortableStyle}\n sortableAttributes={sortableAttributes}\n isDragging={isDragging}\n isDraggable={isDraggable}\n frozen={frozen}/>\n : renderSkeletonText()\n }\n </ErrorBoundary>);\n\n }, [getPropertyFor, customFieldValidator, inlineEditing, enablePopupIcon, size]);\n\n const additionalCellRenderer = useCallback(({\n column,\n rowData,\n width,\n sortableNodeRef,\n sortableStyle,\n sortableAttributes,\n isDragging,\n isDraggable,\n frozen\n }: CellRendererParams<Entity<M>>) => {\n\n const entity: Entity<M> | undefined = rowData;\n if (!entity) return null;\n\n const additionalField = additionalFieldsMap[column.key as string];\n const value = additionalField.dependencies\n ? Object.entries(entity.values)\n .filter(([key, value]) => additionalField.dependencies!.includes(key as Extract<keyof M, string>))\n .reduce((a, b) => ({ ...a,\n...b }), {})\n : entity;\n\n const Builder = additionalField.Builder;\n if (!Builder && !additionalField.value) {\n throw new Error(\"When using additional fields you need to provide a Builder or a value\");\n }\n\n const child: React.ReactNode = Builder\n ? <Builder entity={entity} context={context}/>\n : <AdditionalFieldValue\n field={additionalField}\n entity={entity}\n context={context as RebaseContext}/>;\n\n return (\n <EntityTableCell\n key={`additional_table_cell_${entity.id}_${column.key}`}\n width={width}\n size={size}\n value={value}\n selected={false}\n disabled={true}\n align={\"left\"}\n allowScroll={false}\n showExpandIcon={false}\n disabledTooltip={\"This column can't be edited directly\"}\n sortableNodeRef={sortableNodeRef}\n sortableStyle={sortableStyle}\n sortableAttributes={sortableAttributes as Record<string, string | number | undefined>}\n isDragging={isDragging}\n isDraggable={isDraggable}\n frozen={frozen}\n >\n <ErrorBoundary>\n {child}\n </ErrorBoundary>\n </EntityTableCell>\n );\n\n }, [size, additionalFieldsMap, context]);\n\n // Same source the filter fields read their engine from, so the header's\n // filter control and the field it opens cannot disagree about what the\n // collection's driver can answer.\n const engine = useCollectionScope()?.engine;\n\n const collectionColumns: VirtualTableColumn[] = useMemo(() => {\n const columnsResult: VirtualTableColumn[] = propertiesToColumns({\n properties,\n sortable,\n fixedFilter,\n engine,\n AdditionalHeaderWidget\n });\n\n // Get keys from property columns to filter out duplicate additional fields\n const propertyColumnKeys = new Set(columnsResult.map(col => col.key));\n\n const additionalTableColumns: VirtualTableColumn[] = additionalFields\n // Filter out additional fields whose key already exists in property columns\n ? additionalFields\n .filter((additionalField) => !propertyColumnKeys.has(additionalField.key))\n .map((additionalField) =>\n ({\n key: additionalField.key,\n align: \"left\",\n sortable: false,\n title: additionalField.name,\n width: additionalField.width ?? 200\n }))\n : [];\n return [...columnsResult, ...additionalTableColumns];\n }, [properties, sortable, fixedFilter, engine, AdditionalHeaderWidget, additionalFields]);\n\n // Held by value: the widget is an element, and a caller that builds it\n // inline hands over a new one on every render. Each new one rebuilt the\n // id column, so the table's columns, so every cell on screen.\n const idHeaderWidgetRef = useRef(additionalIDHeaderWidget);\n if (idHeaderWidgetRef.current !== additionalIDHeaderWidget && !equal(idHeaderWidgetRef.current, additionalIDHeaderWidget)) {\n idHeaderWidgetRef.current = additionalIDHeaderWidget;\n }\n const stableIdHeaderWidget = idHeaderWidgetRef.current;\n\n const idColumn: VirtualTableColumn = useMemo(() => ({\n key: \"id_ewcfedcswdf3\",\n width: getIdColumnWidth?.() ?? (largeLayout ? 140 : 120),\n title: \"ID\",\n resizable: false,\n frozen: largeLayout,\n headerAlign: \"center\",\n align: \"center\",\n AdditionalHeaderWidget: () => stableIdHeaderWidget\n }), [getIdColumnWidth, largeLayout, stableIdHeaderWidget]);\n\n const columns: VirtualTableColumn[] = useMemo(() => [\n idColumn,\n ...(displayedColumnIds\n ? displayedColumnIds\n .map((p) => {\n return collectionColumns.find(c => c.key === p.key);\n }).filter(Boolean)\n : collectionColumns) as VirtualTableColumn[]\n ], [idColumn, displayedColumnIds, collectionColumns]);\n\n const cellRenderer = useCallback((props: CellRendererParams<Entity<M>>) => {\n const column = props.column;\n const columns = props.columns;\n const columnKey = column.key;\n\n // A row that exists but has not been read: above a scroll position\n // the view came back to, until it is scrolled to.\n if (!props.rowData) {\n return <div className=\"w-full h-full flex items-center px-4\" style={{ width: column.width }} aria-busy={true}>\n {renderSkeletonText(undefined, Math.min(120, Math.max(24, column.width - 32)))}\n </div>;\n }\n\n try {\n if (props.columnIndex === 0) {\n return <TableRowActions entity={props.rowData!}\n size={size}\n width={column.width}\n frozen={column.frozen}\n sortableNodeRef={props.sortableNodeRef}\n sortableStyle={props.sortableStyle}\n sortableAttributes={props.sortableAttributes}\n isDragging={props.isDragging}\n isDraggable={props.isDraggable}/>;\n } else if (additionalFieldsMap[columnKey]) {\n return additionalCellRenderer(props);\n } else if (props.columnIndex < columns.length + 1) {\n return propertyCellRenderer(props);\n } else {\n throw Error(\"Internal: columns not mapped properly\");\n }\n } catch (e: unknown) {\n console.error(\"Error rendering cell\", e);\n return <EntityTableCell\n size={size}\n width={column.width}\n savedTimestamp={undefined}\n value={null}\n align={\"left\"}\n fullHeight={false}\n disabled={true}\n sortableNodeRef={props.sortableNodeRef}\n sortableStyle={props.sortableStyle}\n sortableAttributes={props.sortableAttributes as Record<string, string | number | undefined>}\n isDragging={props.isDragging}\n isDraggable={props.isDraggable}\n frozen={props.frozen}>\n <ErrorView error={e instanceof Error ? e : new Error(String(e))}/>\n </EntityTableCell>;\n }\n }, [additionalFieldsMap, additionalCellRenderer, propertyCellRenderer, size]);\n\n return (\n\n <div ref={ref}\n style={style}\n className={cls(\"h-full w-full flex flex-col bg-surface-card\", className)}>\n\n {!hideToolbar && <CollectionTableToolbar\n onTextSearch={onTextSearch}\n title={title}\n actionsStart={actionsStart}\n actions={actions}\n viewModeToggle={viewModeToggle}\n loading={tableController.dataLoading}/>}\n\n <RowActionsContext.Provider value={rowActionsContext as RowActionsContextValue<Record<string, unknown>>}>\n <SelectableTable columns={columns}\n size={size}\n inlineEditing={inlineEditing}\n cellRenderer={cellRenderer}\n onEntityClick={onEntityClick}\n highlightedRow={isRowHighlighted}\n tableController={tableController}\n onValueChange={onValueChange}\n initialScroll={initialScroll}\n onScroll={onScroll}\n onColumnResize={onColumnResize}\n hoverRow={hoverRow}\n filterable={filterable}\n emptyComponent={emptyComponent}\n endAdornment={endAdornment}\n AddColumnComponent={AddColumnComponent}\n onColumnsOrderChange={onColumnsOrderChange}/>\n </RowActionsContext.Provider>\n\n </div>\n );\n\n};\n\ntype RowActionsContextValue<M extends Record<string, unknown>> = {\n tableRowActionsBuilder: CollectionTableBindingProps<M>[\"tableRowActionsBuilder\"];\n openEntityMode: NonNullable<CollectionTableBindingProps<M>[\"openEntityMode\"]>;\n};\n\nconst RowActionsContext = React.createContext<RowActionsContextValue<Record<string, unknown>>>({\n tableRowActionsBuilder: undefined,\n openEntityMode: \"side_panel\"\n});\n\n/**\n * The first cell of a row: its actions, from the table's builder or the\n * default ones. Reads the builder from context, so a new builder or a new\n * selection redraws this cell in every row and leaves the property cells\n * alone.\n */\nfunction TableRowActions<M extends Record<string, unknown>>({\n entity,\n size,\n width,\n frozen,\n sortableNodeRef,\n sortableStyle,\n sortableAttributes,\n isDragging,\n isDraggable\n}: {\n entity: Entity<M>;\n size: CollectionSize;\n width: number;\n frozen?: boolean;\n sortableNodeRef?: (node: HTMLElement | null) => void;\n sortableStyle?: React.CSSProperties;\n sortableAttributes?: Record<string, unknown>;\n isDragging?: boolean;\n isDraggable?: boolean;\n}) {\n const { tableRowActionsBuilder, openEntityMode } = useContext(RowActionsContext) as RowActionsContextValue<M>;\n if (tableRowActionsBuilder)\n return <>{tableRowActionsBuilder({\n entity,\n size,\n width,\n frozen\n })}</>;\n return <CollectionRowActions entity={entity}\n width={width}\n frozen={frozen}\n isSelected={false}\n size={size}\n openEntityMode={openEntityMode}\n sortableNodeRef={sortableNodeRef}\n sortableStyle={sortableStyle}\n sortableAttributes={sortableAttributes}\n isDragging={isDragging}\n isDraggable={isDraggable}/>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,IAAa,yBAAyB,SAAS,uBAC1C,EACG,WACA,OACA,aACA,cACA,SACA,gBACA,OACA,wBACA,sBACA,gBACA,eACA,qBACA,qBACA,eACA,gBACA,eACA,UACA,eAEA,WAAW,MACX,gBAAgB,OAChB,kBACA,oBACA,aACA,YACA,iBACA,aAAa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