@rebasepro/cms 0.24.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/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.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 +4 -1
- package/dist/collection_editor/serializable_utils.js +504 -0
- package/dist/collection_editor/serializable_utils.js.map +1 -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-CcFSXvkK.js → collection_editor/ui/collection_editor/SchemaChangeDialog.js} +42 -59
- 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.js +214 -0
- package/dist/collection_editor/useLiveSchemaEditing.js.map +1 -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.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.js +146 -0
- package/dist/components/CollectionViewBinding/CollectionViewActions.js.map +1 -0
- 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.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.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.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.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.js +30 -0
- package/dist/components/common/ActionMenuLabel.js.map +1 -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.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/hooks/useImportConfig.js +34 -0
- package/dist/data_import/hooks/useImportConfig.js.map +1 -0
- package/dist/{import-DjQoRrIU.js → data_import/import/ImportCollectionAction.js} +53 -43
- 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.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.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.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 +7 -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.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 -3147
- 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 +24 -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 +2 -1
- 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.js +108 -0
- package/dist/hooks/useRecordActions.js.map +1 -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 +4 -2
- 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 -3867
- 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 +2 -1
- 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 +4 -3
- package/dist/{util-D7ebttKT.js → preview/util.js} +8 -5
- 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.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 +5 -0
- 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.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-p5-I-Apu.js +0 -3669
- package/dist/CollectionEditorDialog-p5-I-Apu.js.map +0 -1
- package/dist/JsonPreviewBinding-v0w3H0fp.js.map +0 -1
- package/dist/PropertyEditView-DDB_X-00.js +0 -3837
- package/dist/PropertyEditView-DDB_X-00.js.map +0 -1
- package/dist/RouterCollectionsStudioView-SGBV4CMg.js +0 -212
- package/dist/RouterCollectionsStudioView-SGBV4CMg.js.map +0 -1
- package/dist/SchemaChangeDialog-CcFSXvkK.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-DCHuPD1a.js +0 -520
- package/dist/export-DCHuPD1a.js.map +0 -1
- package/dist/history-CBd6SBRs.js +0 -314
- package/dist/history-CBd6SBRs.js.map +0 -1
- package/dist/import-DjQoRrIU.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-BRvKFMLa.js +0 -27773
- package/dist/util-BRvKFMLa.js.map +0 -1
- package/dist/util-D7ebttKT.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field_configs.js","names":[],"sources":["../../src/components/field_configs.tsx"],"sourcesContent":["\nimport type { DefaultFieldConfig } from \"../types/fields\";\nimport type { Property } from \"@rebasepro/types\";\nimport type { PropertyConfig } from \"@rebasepro/cms-types\";\nimport { ArrayCustomShapedFieldBinding } from \"../form/field_bindings/ArrayCustomShapedFieldBinding\";\nimport { ArrayOfReferencesFieldBinding } from \"../form/field_bindings/ArrayOfReferencesFieldBinding\";\nimport { BlockFieldBinding } from \"../form/field_bindings/BlockFieldBinding\";\nimport { DateTimeFieldBinding } from \"../form/field_bindings/DateTimeFieldBinding\";\nimport { KeyValueFieldBinding } from \"../form/field_bindings/KeyValueFieldBinding\";\nimport { MapFieldBinding } from \"../form/field_bindings/MapFieldBinding\";\nimport { MarkdownEditorFieldBinding } from \"../form/field_bindings/MarkdownEditorFieldBinding\";\nimport { MultiSelectFieldBinding } from \"../form/field_bindings/MultiSelectFieldBinding\";\nimport { ReferenceFieldBinding } from \"../form/field_bindings/ReferenceFieldBinding\";\nimport { RepeatFieldBinding } from \"../form/field_bindings/RepeatFieldBinding\";\nimport { SelectFieldBinding } from \"../form/field_bindings/SelectFieldBinding\";\nimport { StorageUploadFieldBinding } from \"../form/field_bindings/StorageUploadFieldBinding\";\nimport { SwitchFieldBinding } from \"../form/field_bindings/SwitchFieldBinding\";\nimport { TextFieldBinding } from \"../form/field_bindings/TextFieldBinding\";\nimport { VectorFieldBinding } from \"../form/field_bindings/VectorFieldBinding\";\nimport { GeopointFieldBinding } from \"../form/field_bindings/GeopointFieldBinding\";\nimport { BinaryFieldBinding } from \"../form/field_bindings/BinaryFieldBinding\";\n\nimport {\n AlignLeftIcon,\n CalendarIcon,\n FlagIcon,\n FolderUpIcon,\n GlobeIcon,\n HashIcon,\n LinkIcon,\n ListIcon,\n ListOrderedIcon,\n MailIcon,\n QuoteIcon,\n RepeatIcon,\n Rows3Icon,\n TextIcon,\n UploadIcon,\n UserCheckIcon,\n UserIcon,\n VoteIcon\n} from \"@rebasepro/ui\";\nimport { RelationFieldBinding } from \"../form/field_bindings/RelationFieldBinding\";\nimport { UserSelectFieldBinding } from \"../form/field_bindings/UserSelectFieldBinding\";\nimport { mergeDeep } from \"@rebasepro/utils\";\n// Which widget a property gets is decided without the widgets: those two\n// functions live in a module that imports no field binding, so code that only\n// asks (the AI plugin, the import mapper) does not pull every field binding —\n// and through them the whole entity form — into its bundle.\nimport { getDefaultFieldId, getFieldId } from \"./field_ids\";\n\nexport { getDefaultFieldId, getFieldId };\n\n/**\n * Every `Field` below is a getter on purpose — do not inline it back to\n * `Field: SomeBinding`.\n *\n * This module and the field bindings form an import cycle: we import the\n * bindings, the container bindings (map, repeat, block, custom-shaped array)\n * import `PropertyFieldBinding` to render their children, and that imports\n * `getFieldConfig` from here. Enter the cycle at a binding rather than here and\n * this object is built while that binding's module is still initialising.\n *\n * As a plain value the binding would be read at that moment. It happens to\n * survive today only because every binding is declared `export function`, which\n * hoists; rewriting a single one as `export const` would make the read a\n * temporal dead zone ReferenceError at import time, surfacing as a blank screen\n * far from its cause. The getter defers the read to first access, long after\n * every module has initialised, so declaration style stops mattering.\n */\nexport const DEFAULT_FIELD_CONFIGS: Record<DefaultFieldConfig, PropertyConfig> = {\n text_field: {\n key: \"text_field\",\n name: \"Text field\",\n description: \"Simple short text\",\n Icon: TextIcon,\n color: \"#2d7ff9\",\n property: {\n type: \"string\",\n admin: { get Field() { return TextFieldBinding; } }\n }\n },\n multiline: {\n key: \"multiline\",\n name: \"Multiline\",\n description: \"Text with multiple lines\",\n Icon: AlignLeftIcon,\n color: \"#2d7ff9\",\n property: {\n type: \"string\",\n admin: { multiline: true,\nget Field() { return TextFieldBinding; } }\n }\n },\n markdown: {\n key: \"markdown\",\n name: \"Markdown\",\n description: \"Text with advanced markdown syntax\",\n Icon: QuoteIcon,\n color: \"#2d7ff9\",\n property: {\n type: \"string\",\n admin: { markdown: true,\nget Field() { return MarkdownEditorFieldBinding; } }\n }\n },\n url: {\n key: \"url\",\n name: \"Url\",\n description: \"Text with URL validation\",\n Icon: GlobeIcon,\n color: \"#154fb3\",\n property: {\n type: \"string\",\n url: true,\n admin: { get Field() { return TextFieldBinding; } }\n }\n },\n email: {\n key: \"email\",\n name: \"Email\",\n description: \"Text with email validation\",\n Icon: MailIcon,\n color: \"#154fb3\",\n property: {\n type: \"string\",\n email: true,\n admin: { get Field() { return TextFieldBinding; } }\n }\n },\n switch: {\n key: \"switch\",\n name: \"Switch\",\n description: \"Boolean true or false field (or yes or no, 0 or 1...)\",\n Icon: FlagIcon,\n color: \"#20d9d2\",\n property: {\n type: \"boolean\",\n admin: { get Field() { return SwitchFieldBinding; } }\n }\n },\n select: {\n key: \"select\",\n name: \"Select/enum\",\n description: \"Select one text value from within an enumeration\",\n Icon: ListIcon,\n color: \"#4223c9\",\n property: {\n type: \"string\",\n enum: [],\n admin: { get Field() { return SelectFieldBinding; } }\n }\n },\n multi_select: {\n key: \"multi_select\",\n name: \"Multi select (enum)\",\n description: \"Select multiple text values from within an enumeration\",\n Icon: ListIcon,\n color: \"#4223c9\",\n property: {\n type: \"array\",\n of: {\n type: \"string\",\n enum: []\n },\n admin: { get Field() { return MultiSelectFieldBinding; } }\n }\n },\n user_select: {\n key: \"user_select\",\n name: \"User select\",\n description: \"Select a user from the user management system. Store the user ID.\",\n Icon: UserIcon,\n property: {\n type: \"string\",\n admin: { get Field() { return UserSelectFieldBinding; } }\n }\n },\n number_input: {\n key: \"number_input\",\n name: \"Number input\",\n description: \"Simple number field with validation\",\n Icon: HashIcon,\n color: \"#bec920\",\n property: {\n type: \"number\",\n admin: { get Field() { return TextFieldBinding; } }\n }\n },\n number_select: {\n key: \"number_select\",\n name: \"Number select\",\n description: \"Select a number value from within an enumeration\",\n Icon: ListOrderedIcon,\n color: \"#bec920\",\n property: {\n type: \"number\",\n enum: [],\n admin: { get Field() { return SelectFieldBinding; } }\n }\n },\n multi_number_select: {\n key: \"multi_number_select\",\n name: \"Multiple number select\",\n description: \"Select multiple number values from within an enumeration\",\n Icon: ListOrderedIcon,\n color: \"#bec920\",\n property: {\n type: \"array\",\n of: {\n type: \"number\",\n enum: []\n },\n admin: { get Field() { return MultiSelectFieldBinding; } }\n }\n },\n file_upload: {\n key: \"file_upload\",\n name: \"File upload\",\n description: \"Input for uploading single files\",\n Icon: UploadIcon,\n color: \"#f92d9a\",\n property: {\n type: \"string\",\n storage: {\n storagePath: \"{path}\"\n },\n admin: { get Field() { return StorageUploadFieldBinding; } }\n }\n },\n multi_file_upload: {\n key: \"multi_file_upload\",\n name: \"Multiple file upload\",\n description: \"Input for uploading multiple files\",\n Icon: FolderUpIcon,\n color: \"#f92d9a\",\n property: {\n type: \"array\",\n of: {\n type: \"string\",\n storage: {\n storagePath: \"{path}\"\n }\n },\n admin: { get Field() { return StorageUploadFieldBinding; } }\n }\n },\n reference: {\n key: \"reference\",\n name: \"Reference\",\n description: \"The value refers to a different collection (it is saved as a reference)\",\n Icon: LinkIcon,\n color: \"#ff0042\",\n property: {\n type: \"reference\",\n admin: { get Field() { return ReferenceFieldBinding; } }\n }\n },\n multi_references: {\n key: \"multi_references\",\n name: \"Multiple references\",\n description: \"Multiple values that refer to a different collection\",\n Icon: LinkIcon,\n color: \"#ff0042\",\n property: {\n type: \"array\",\n of: {\n type: \"reference\"\n },\n admin: { get Field() { return ArrayOfReferencesFieldBinding; } }\n }\n },\n relation: {\n key: \"relation\",\n name: \"Relation\",\n description: \"Multiple values that refer to a different collection\",\n Icon: LinkIcon,\n color: \"#ff0042\",\n property: {\n // relationName now lives on the link\n // relationName: \"\",\n type: \"relation\",\n admin: { get Field() { return RelationFieldBinding; } }\n }\n },\n date_time: {\n key: \"date_time\",\n name: \"Date/time\",\n description: \"A date time select field\",\n Icon: CalendarIcon,\n color: \"#8b46ff\",\n property: {\n type: \"date\",\n admin: { get Field() { return DateTimeFieldBinding; } }\n }\n },\n group: {\n key: \"group\",\n name: \"Group\",\n description: \"Group of multiple fields\",\n Icon: VoteIcon,\n color: \"#ff9408\",\n property: {\n type: \"map\",\n properties: {},\n admin: { get Field() { return MapFieldBinding; } }\n }\n },\n key_value: {\n key: \"key_value\",\n name: \"Key-value\",\n description: \"Flexible field that allows the user to add multiple key-value pairs\",\n Icon: VoteIcon,\n color: \"#ff9408\",\n property: {\n type: \"map\",\n keyValue: true,\n admin: { get Field() { return KeyValueFieldBinding; } }\n }\n },\n repeat: {\n key: \"repeat\",\n name: \"Repeat/list\",\n description: \"A field that gets repeated multiple times (e.g. multiple text fields)\",\n Icon: RepeatIcon,\n color: \"#ff9408\",\n property: {\n type: \"array\",\n of: {\n type: \"string\"\n },\n admin: { get Field() { return RepeatFieldBinding; } }\n }\n },\n custom_array: {\n key: \"custom_array\",\n name: \"Custom array\",\n description: \"A field that saved its value as an array of custom objects\",\n Icon: RepeatIcon,\n color: \"#ff9408\",\n property: {\n type: \"array\",\n admin: { get Field() { return ArrayCustomShapedFieldBinding; } }\n }\n },\n block: {\n key: \"block\",\n name: \"Block\",\n description: \"A complex field that allows the user to compose different fields together, with a key/value format\",\n Icon: Rows3Icon,\n color: \"#ff9408\",\n property: {\n type: \"array\",\n oneOf: {\n properties: {}\n },\n admin: { get Field() { return BlockFieldBinding; } }\n }\n },\n vector_input: {\n key: \"vector_input\",\n name: \"Vector input\",\n description: \"Vector array for embeddings\",\n Icon: HashIcon,\n color: \"#bec920\",\n property: {\n type: \"vector\",\n dimensions: 1536,\n admin: { get Field() { return VectorFieldBinding; } }\n }\n },\n geopoint: {\n key: \"geopoint\",\n name: \"Location\",\n description: \"A latitude and longitude\",\n Icon: GlobeIcon,\n color: \"#3f9e5c\",\n property: {\n type: \"geopoint\",\n admin: { get Field() { return GeopointFieldBinding; } }\n }\n },\n binary: {\n key: \"binary\",\n name: \"Binary\",\n description: \"Base64-encoded bytes\",\n Icon: HashIcon,\n color: \"#7a6ff0\",\n property: {\n type: \"binary\",\n admin: { get Field() { return BinaryFieldBinding; } }\n }\n }\n};\n\nexport function getDefaultFieldConfig(property: Property): PropertyConfig | undefined {\n const fieldId = getDefaultFieldId(property);\n if (!fieldId) {\n console.error(\"No field id found for property\", property);\n return undefined;\n }\n return DEFAULT_FIELD_CONFIGS[fieldId];\n}\n\nexport function getFieldConfig(property: Property, propertyConfigs: Record<string, PropertyConfig>): PropertyConfig | undefined {\n const fieldId = getFieldId(property);\n const defaultFieldId = getDefaultFieldId(property);\n if (!defaultFieldId) {\n console.error(\"No field id found for property\", property);\n return undefined;\n }\n const defaultFieldConfig = defaultFieldId ? DEFAULT_FIELD_CONFIGS[defaultFieldId] : undefined;\n const customField = fieldId && propertyConfigs ? propertyConfigs[fieldId] : undefined;\n return mergeDeep(defaultFieldConfig ?? {}, customField ?? {} as PropertyConfig);\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,IAAa,wBAAoE;CAC7E,YAAY;EACR,KAAK;EACL,MAAM;EACN,aAAa;EACb,MAAM;EACN,OAAO;EACP,UAAU;GACN,MAAM;GACN,OAAO,EAAE,IAAI,QAAQ;IAAE,OAAO;GAAkB,EAAE;EACtD;CACJ;CACA,WAAW;EACP,KAAK;EACL,MAAM;EACN,aAAa;EACb,MAAM;EACN,OAAO;EACP,UAAU;GACN,MAAM;GACN,OAAO;IAAE,WAAW;IAChC,IAAI,QAAQ;KAAE,OAAO;IAAkB;GAAE;EACjC;CACJ;CACA,UAAU;EACN,KAAK;EACL,MAAM;EACN,aAAa;EACb,MAAM;EACN,OAAO;EACP,UAAU;GACN,MAAM;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ACN,KAAK;EACL,MAAM;EACN,aAAa;EACb,MAAM;EACN,OAAO;EACP,UAAU;GACN,MAAM;GACN,OAAO,EAAE,IAAI,QAAQ;IAAE,OAAO;GAAsB,EAAE;EAC1D;CACJ;CACA,QAAQ;EACJ,KAAK;EACL,MAAM;EACN,aAAa;EACb,MAAM;EACN,OAAO;EACP,UAAU;GACN,MAAM;GACN,OAAO,EAAE,IAAI,QAAQ;IAAE,OAAO;GAAoB,EAAE;EACxD;CACJ;AACJ;AAEA,SAAgB,sBAAsB,UAAgD;CAClF,MAAM,UAAU,kBAAkB,QAAQ;CAC1C,IAAI,CAAC,SAAS;EACV,QAAQ,MAAM,kCAAkC,QAAQ;EACxD;CACJ;CACA,OAAO,sBAAsB;AACjC;AAEA,SAAgB,eAAe,UAAoB,iBAA6E;CAC5H,MAAM,UAAU,WAAW,QAAQ;CACnC,MAAM,iBAAiB,kBAAkB,QAAQ;CACjD,IAAI,CAAC,gBAAgB;EACjB,QAAQ,MAAM,kCAAkC,QAAQ;EACxD;CACJ;CACA,MAAM,qBAAqB,iBAAiB,sBAAsB,kBAAkB,KAAA;CACpF,MAAM,cAAc,WAAW,kBAAkB,gBAAgB,WAAW,KAAA;CAC5E,OAAO,UAAU,sBAAsB,CAAC,GAAG,eAAe,CAAC,CAAmB;AAClF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Property } from "@rebasepro/types";
|
|
2
|
+
/**
|
|
3
|
+
* The id of the widget a property is edited with, decided from the property
|
|
4
|
+
* alone. Kept apart from `field_configs.tsx`, which maps those ids to the
|
|
5
|
+
* field binding components: importing that module imports every binding, and
|
|
6
|
+
* with them the entity form, so a caller that only needs the id — the AI
|
|
7
|
+
* plugin asks it for every property on every page — paid for the whole form
|
|
8
|
+
* on the login screen.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getDefaultFieldId(property: Property): "reference" | "geopoint" | "relation" | "binary" | "date_time" | "text_field" | "multiline" | "markdown" | "url" | "email" | "switch" | "select" | "multi_select" | "user_select" | "number_input" | "number_select" | "multi_number_select" | "file_upload" | "multi_file_upload" | "multi_references" | "group" | "key_value" | "repeat" | "custom_array" | "block" | "vector_input" | undefined;
|
|
11
|
+
export declare function getFieldId(property: Property): string | undefined;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { isPropertyBuilder } from "@rebasepro/common";
|
|
2
|
+
//#region src/components/field_ids.ts
|
|
3
|
+
/**
|
|
4
|
+
* The id of the widget a property is edited with, decided from the property
|
|
5
|
+
* alone. Kept apart from `field_configs.tsx`, which maps those ids to the
|
|
6
|
+
* field binding components: importing that module imports every binding, and
|
|
7
|
+
* with them the entity form, so a caller that only needs the id — the AI
|
|
8
|
+
* plugin asks it for every property on every page — paid for the whole form
|
|
9
|
+
* on the login screen.
|
|
10
|
+
*/
|
|
11
|
+
function getDefaultFieldId(property) {
|
|
12
|
+
if (property.type === "string") if (property.admin?.markdown) return "markdown";
|
|
13
|
+
else if (property.admin?.multiline) return "multiline";
|
|
14
|
+
else if (property.storage) return "file_upload";
|
|
15
|
+
else if (property.admin?.urlPreview) return "url";
|
|
16
|
+
else if (property.email) return "email";
|
|
17
|
+
else if (property.enum) return "select";
|
|
18
|
+
else if (property.userSelect) return "user_select";
|
|
19
|
+
else return "text_field";
|
|
20
|
+
else if (property.type === "number") {
|
|
21
|
+
if (property.enum) return "number_select";
|
|
22
|
+
return "number_input";
|
|
23
|
+
} else if (property.type === "map") {
|
|
24
|
+
if (property.keyValue) return "key_value";
|
|
25
|
+
return "group";
|
|
26
|
+
} else if (property.type === "array") {
|
|
27
|
+
const of = property.of;
|
|
28
|
+
if (property.oneOf) return "block";
|
|
29
|
+
else if (Array.isArray(of)) return "custom_array";
|
|
30
|
+
else if (isPropertyBuilder(of)) return "repeat";
|
|
31
|
+
else if (of) {
|
|
32
|
+
const ofProperty = of;
|
|
33
|
+
if (ofProperty.type === "string" && ofProperty.enum) return "multi_select";
|
|
34
|
+
else if (ofProperty.type === "number" && ofProperty.enum) return "multi_number_select";
|
|
35
|
+
else if (ofProperty.type === "string" && ofProperty.storage) return "multi_file_upload";
|
|
36
|
+
else if (ofProperty.type === "reference") return "multi_references";
|
|
37
|
+
else if (of?.type === "relation") {
|
|
38
|
+
console.error("A `relation` cannot go inside an array — a relation is a join, not a stored value. Use a `reference` for an array of links, or declare a to-many relation on the collection.", property);
|
|
39
|
+
return;
|
|
40
|
+
} else return "repeat";
|
|
41
|
+
} else return "repeat";
|
|
42
|
+
} else if (property.type === "boolean") return "switch";
|
|
43
|
+
else if (property.type === "date") return "date_time";
|
|
44
|
+
else if (property.type === "relation") return "relation";
|
|
45
|
+
else if (property.type === "reference") return "reference";
|
|
46
|
+
else if (property.type === "vector") return "vector_input";
|
|
47
|
+
else if (property.type === "binary") return "binary";
|
|
48
|
+
else if (property.type === "geopoint") return "geopoint";
|
|
49
|
+
console.error("Unsupported field config mapping", property);
|
|
50
|
+
}
|
|
51
|
+
function getFieldId(property) {
|
|
52
|
+
if (property.propertyConfig) return property.propertyConfig;
|
|
53
|
+
return getDefaultFieldId(property);
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { getDefaultFieldId, getFieldId };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=field_ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field_ids.js","names":[],"sources":["../../src/components/field_ids.ts"],"sourcesContent":["import type { ArrayProperty, NumberProperty, Property, StringProperty } from \"@rebasepro/types\";\nimport { isPropertyBuilder } from \"@rebasepro/common\";\n\n/**\n * The id of the widget a property is edited with, decided from the property\n * alone. Kept apart from `field_configs.tsx`, which maps those ids to the\n * field binding components: importing that module imports every binding, and\n * with them the entity form, so a caller that only needs the id — the AI\n * plugin asks it for every property on every page — paid for the whole form\n * on the login screen.\n */\nexport function getDefaultFieldId(property: Property) {\n if (property.type === \"string\") {\n if (property.admin?.markdown) {\n return \"markdown\";\n } else if (property.admin?.multiline) {\n return \"multiline\";\n } else if (property.storage) {\n return \"file_upload\";\n } else if (property.admin?.urlPreview) {\n return \"url\";\n } else if (property.email) {\n return \"email\";\n } else if (property.enum) {\n return \"select\";\n } else if (property.userSelect) {\n return \"user_select\";\n } else {\n return \"text_field\";\n }\n } else if (property.type === \"number\") {\n if (property.enum) {\n return \"number_select\";\n }\n return \"number_input\";\n } else if (property.type === \"map\") {\n if (property.keyValue)\n return \"key_value\";\n return \"group\";\n } else if (property.type === \"array\") {\n const of = (property as ArrayProperty).of;\n const oneOf = (property as ArrayProperty).oneOf;\n if (oneOf) {\n return \"block\";\n } else if (Array.isArray(of)) {\n return \"custom_array\";\n } else if (isPropertyBuilder(of)) {\n return \"repeat\";\n } else if (of) {\n const ofProperty = of as Property;\n if (ofProperty.type === \"string\" && (ofProperty as StringProperty).enum) {\n return \"multi_select\";\n } else if (ofProperty.type === \"number\" && (ofProperty as NumberProperty).enum) {\n return \"multi_number_select\";\n } else if (ofProperty.type === \"string\" && (ofProperty as StringProperty).storage) {\n return \"multi_file_upload\";\n } else if (ofProperty.type === \"reference\") {\n return \"multi_references\";\n } else if (of?.type === \"relation\") {\n // Genuinely unsupported — a relation is a join, not a value, so\n // there is nothing sensible to put in an array cell. But this\n // used to `throw`, and it is called during render: an array of\n // relations took down the whole property dialog with an error\n // boundary instead of showing which property was at fault.\n // Returning undefined routes it to the \"no editor\" notice.\n console.error(\n \"A `relation` cannot go inside an array — a relation is a join, not a stored value. \" +\n \"Use a `reference` for an array of links, or declare a to-many relation on the collection.\",\n property\n );\n return undefined;\n } else {\n return \"repeat\";\n }\n } else {\n return \"repeat\";\n }\n } else if (property.type === \"boolean\") {\n return \"switch\";\n } else if (property.type === \"date\") {\n return \"date_time\";\n } else if (property.type === \"relation\") {\n return \"relation\";\n } else if (property.type === \"reference\") {\n return \"reference\";\n } else if (property.type === \"vector\") {\n return \"vector_input\";\n } else if (property.type === \"binary\") {\n // Was \"text_field\": a binary column rendered as a string input, and the\n // string widget's editor merges `type: \"string\"`, so touching the widget\n // silently changed the property's type.\n return \"binary\";\n } else if (property.type === \"geopoint\") {\n // Was missing entirely — this fell through to the console.error below,\n // returned undefined, and the field never rendered at all.\n return \"geopoint\";\n }\n\n console.error(\"Unsupported field config mapping\", property);\n return undefined;\n}\n\nexport function getFieldId(property: Property): string | undefined {\n if (property.propertyConfig)\n return property.propertyConfig;\n return getDefaultFieldId(property);\n}\n"],"mappings":";;;;;;;;;;AAWA,SAAgB,kBAAkB,UAAoB;CAClD,IAAI,SAAS,SAAS,UAClB,IAAI,SAAS,OAAO,UAChB,OAAO;MACJ,IAAI,SAAS,OAAO,WACvB,OAAO;MACJ,IAAI,SAAS,SAChB,OAAO;MACJ,IAAI,SAAS,OAAO,YACvB,OAAO;MACJ,IAAI,SAAS,OAChB,OAAO;MACJ,IAAI,SAAS,MAChB,OAAO;MACJ,IAAI,SAAS,YAChB,OAAO;MAEP,OAAO;MAER,IAAI,SAAS,SAAS,UAAU;EACnC,IAAI,SAAS,MACT,OAAO;EAEX,OAAO;CACX,OAAO,IAAI,SAAS,SAAS,OAAO;EAChC,IAAI,SAAS,UACT,OAAO;EACX,OAAO;CACX,OAAO,IAAI,SAAS,SAAS,SAAS;EAClC,MAAM,KAAM,SAA2B;EAEvC,IADe,SAA2B,OAEtC,OAAO;OACJ,IAAI,MAAM,QAAQ,EAAE,GACvB,OAAO;OACJ,IAAI,kBAAkB,EAAE,GAC3B,OAAO;OACJ,IAAI,IAAI;GACX,MAAM,aAAa;GACnB,IAAI,WAAW,SAAS,YAAa,WAA8B,MAC/D,OAAO;QACJ,IAAI,WAAW,SAAS,YAAa,WAA8B,MACtE,OAAO;QACJ,IAAI,WAAW,SAAS,YAAa,WAA8B,SACtE,OAAO;QACJ,IAAI,WAAW,SAAS,aAC3B,OAAO;QACJ,IAAI,IAAI,SAAS,YAAY;IAOhC,QAAQ,MACJ,gLAEA,QACJ;IACA;GACJ,OACI,OAAO;EAEf,OACI,OAAO;CAEf,OAAO,IAAI,SAAS,SAAS,WACzB,OAAO;MACJ,IAAI,SAAS,SAAS,QACzB,OAAO;MACJ,IAAI,SAAS,SAAS,YACzB,OAAO;MACJ,IAAI,SAAS,SAAS,aACzB,OAAO;MACJ,IAAI,SAAS,SAAS,UACzB,OAAO;MACJ,IAAI,SAAS,SAAS,UAIzB,OAAO;MACJ,IAAI,SAAS,SAAS,YAGzB,OAAO;CAGX,QAAQ,MAAM,oCAAoC,QAAQ;AAE9D;AAEA,SAAgB,WAAW,UAAwC;CAC/D,IAAI,SAAS,gBACT,OAAO,SAAS;CACpB,OAAO,kBAAkB,QAAQ;AACrC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { getPropertyInPath as getPropertyInPath$1 } from "../../util/property_utils.js";
|
|
2
|
+
import { PropertyPreview } from "../../preview/PropertyPreview.js";
|
|
3
|
+
import { UserChip } from "./UserChip.js";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ArrowLeftIcon, Chip, Tooltip, Typography, cls, defaultBorderMixin, iconSize } from "@rebasepro/ui";
|
|
7
|
+
import { useAuthController } from "@rebasepro/app";
|
|
8
|
+
import { getValueInPath } from "@rebasepro/utils";
|
|
9
|
+
//#region src/components/history/EntityHistoryEntry.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Recursive deep equality for primitives, arrays and plain objects.
|
|
12
|
+
*/
|
|
13
|
+
function deepEqual(a, b) {
|
|
14
|
+
if (a === b) return true;
|
|
15
|
+
if (a == null || b == null) return a === b;
|
|
16
|
+
if (typeof a !== typeof b) return false;
|
|
17
|
+
if (typeof a !== "object") return false;
|
|
18
|
+
if (Array.isArray(a)) {
|
|
19
|
+
if (!Array.isArray(b) || a.length !== b.length) return false;
|
|
20
|
+
return a.every((item, i) => deepEqual(item, b[i]));
|
|
21
|
+
}
|
|
22
|
+
if (Array.isArray(b)) return false;
|
|
23
|
+
const aObj = a;
|
|
24
|
+
const bObj = b;
|
|
25
|
+
const aKeys = Object.keys(aObj);
|
|
26
|
+
const bKeys = Object.keys(bObj);
|
|
27
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
28
|
+
return aKeys.every((key) => key in bObj && deepEqual(aObj[key], bObj[key]));
|
|
29
|
+
}
|
|
30
|
+
function PreviousValueView({ previousValueInPath, childProperty, propertyKey }) {
|
|
31
|
+
if (typeof previousValueInPath === "string" || typeof previousValueInPath === "number") return /* @__PURE__ */ jsx(Typography, {
|
|
32
|
+
variant: "caption",
|
|
33
|
+
color: "secondary",
|
|
34
|
+
className: "line-through",
|
|
35
|
+
children: previousValueInPath
|
|
36
|
+
});
|
|
37
|
+
else if (typeof previousValueInPath === "boolean") return /* @__PURE__ */ jsx(Typography, {
|
|
38
|
+
variant: "caption",
|
|
39
|
+
color: "secondary",
|
|
40
|
+
className: "line-through",
|
|
41
|
+
children: previousValueInPath ? "true" : "false"
|
|
42
|
+
});
|
|
43
|
+
else return /* @__PURE__ */ jsx(Tooltip, {
|
|
44
|
+
side: "left",
|
|
45
|
+
title: /* @__PURE__ */ jsxs("div", {
|
|
46
|
+
className: "flex flex-col gap-2",
|
|
47
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
48
|
+
variant: "caption",
|
|
49
|
+
color: "secondary",
|
|
50
|
+
children: "Previous value"
|
|
51
|
+
}), /* @__PURE__ */ jsx(PropertyPreview, {
|
|
52
|
+
propertyKey,
|
|
53
|
+
value: previousValueInPath,
|
|
54
|
+
property: childProperty,
|
|
55
|
+
size: "small"
|
|
56
|
+
})]
|
|
57
|
+
}),
|
|
58
|
+
children: /* @__PURE__ */ jsx(ArrowLeftIcon, {
|
|
59
|
+
size: iconSize.smallest,
|
|
60
|
+
color: "disabled",
|
|
61
|
+
className: "mb-1"
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Displays a single entity history revision entry.
|
|
67
|
+
* Adapted from the entity_history plugin — now reads from backend API data.
|
|
68
|
+
*/
|
|
69
|
+
function EntityHistoryEntry({ actions, hover, collection, size, entry }) {
|
|
70
|
+
const authController = useAuthController();
|
|
71
|
+
const changedFields = React$1.useMemo(() => {
|
|
72
|
+
const all = entry.changed_fields;
|
|
73
|
+
if (!all || !collection) return all;
|
|
74
|
+
return all.filter((key) => {
|
|
75
|
+
const property = getPropertyInPath$1(collection.properties, key);
|
|
76
|
+
if (!property) return true;
|
|
77
|
+
if ("isId" in property && property.isId) return false;
|
|
78
|
+
return !(property.type === "date" && "autoValue" in property && property.autoValue);
|
|
79
|
+
});
|
|
80
|
+
}, [entry.changed_fields, collection]);
|
|
81
|
+
const previousValues = entry.previous_values;
|
|
82
|
+
const updatedOn = new Date(entry.updated_at);
|
|
83
|
+
const updatedBy = entry.updated_by;
|
|
84
|
+
const currentUser = authController.user;
|
|
85
|
+
const userDisplay = updatedBy === currentUser?.uid ? currentUser : void 0;
|
|
86
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
87
|
+
className: "@container/histentry w-full flex flex-col gap-2",
|
|
88
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
89
|
+
className: "flex items-center flex-wrap gap-2",
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsx(Typography, {
|
|
92
|
+
variant: "body2",
|
|
93
|
+
color: "secondary",
|
|
94
|
+
children: updatedOn.toLocaleString()
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ jsx(Chip, {
|
|
97
|
+
size: "small",
|
|
98
|
+
children: entry.action
|
|
99
|
+
}),
|
|
100
|
+
!userDisplay && updatedBy && /* @__PURE__ */ jsx(Chip, {
|
|
101
|
+
size: "small",
|
|
102
|
+
children: updatedBy
|
|
103
|
+
}),
|
|
104
|
+
userDisplay && /* @__PURE__ */ jsx(UserChip, { user: userDisplay })
|
|
105
|
+
]
|
|
106
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
107
|
+
className: cls("bg-surface-card", "min-h-[44px]", "w-full", "items-center", hover ? "hover:bg-surface-hover" : "", size === "small" ? "p-1" : "px-2 py-1", "flex border rounded-lg", defaultBorderMixin),
|
|
108
|
+
children: [actions, /* @__PURE__ */ jsxs("div", {
|
|
109
|
+
className: "flex flex-col grow w-full m-1 shrink min-w-0",
|
|
110
|
+
children: [changedFields && collection && changedFields.map((key) => {
|
|
111
|
+
const childProperty = getPropertyInPath$1(collection.properties, key);
|
|
112
|
+
const valueInPath = entry.values ? getValueInPath(entry.values, key) : void 0;
|
|
113
|
+
const previousValueInPath = previousValues ? getValueInPath(previousValues, key) : void 0;
|
|
114
|
+
const element = childProperty ? /* @__PURE__ */ jsx(PropertyPreview, {
|
|
115
|
+
propertyKey: key,
|
|
116
|
+
value: valueInPath,
|
|
117
|
+
property: childProperty,
|
|
118
|
+
size: "small"
|
|
119
|
+
}) : /* @__PURE__ */ jsx(Typography, {
|
|
120
|
+
variant: "body2",
|
|
121
|
+
children: typeof valueInPath === "string" ? valueInPath : JSON.stringify(valueInPath)
|
|
122
|
+
});
|
|
123
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
124
|
+
className: "flex flex-col @sm/histentry:flex-row @sm/histentry:items-baseline gap-x-4 gap-y-0.5 w-full my-1.5",
|
|
125
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
126
|
+
variant: "caption",
|
|
127
|
+
color: "secondary",
|
|
128
|
+
className: "shrink-0 break-all @sm/histentry:w-40 @sm/histentry:text-right @sm/histentry:break-normal @sm/histentry:truncate",
|
|
129
|
+
children: key
|
|
130
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
131
|
+
className: "min-w-0 flex-1 flex flex-col items-start gap-0.5",
|
|
132
|
+
children: [previousValueInPath !== void 0 && !deepEqual(previousValueInPath, valueInPath) && /* @__PURE__ */ jsx(PreviousValueView, {
|
|
133
|
+
previousValueInPath,
|
|
134
|
+
childProperty,
|
|
135
|
+
propertyKey: key
|
|
136
|
+
}), element]
|
|
137
|
+
})]
|
|
138
|
+
}, "ref_prev_" + key);
|
|
139
|
+
}), (!changedFields || changedFields.length === 0) && /* @__PURE__ */ jsx(Typography, {
|
|
140
|
+
variant: "caption",
|
|
141
|
+
color: "secondary",
|
|
142
|
+
children: entry.action === "create" ? "Entity created" : entry.action === "delete" ? "Entity deleted" : "No field changes recorded"
|
|
143
|
+
})]
|
|
144
|
+
})]
|
|
145
|
+
})]
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
export { EntityHistoryEntry };
|
|
150
|
+
|
|
151
|
+
//# sourceMappingURL=EntityHistoryEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityHistoryEntry.js","names":[],"sources":["../../../src/components/history/EntityHistoryEntry.tsx"],"sourcesContent":["\nimport type { Property } from \"@rebasepro/types\";\nimport * as React from \"react\";\n\nimport { ArrowLeftIcon, Chip, cls, defaultBorderMixin, iconSize, Tooltip, Typography } from \"@rebasepro/ui\";\nimport { PreviewSize } from \"../../types/components/PropertyPreviewProps\";\nimport { getPropertyInPath } from \"../../util/property_utils\";\nimport { PropertyPreview } from \"../../preview/PropertyPreview\";\nimport { SkeletonPropertyComponent } from \"../../preview/property_previews/SkeletonPropertyComponent\";\nimport { useAuthController } from \"@rebasepro/app\";\nimport { UserChip } from \"./UserChip\";\nimport { HistoryEntryData } from \"../../hooks\";\nimport { getValueInPath } from \"@rebasepro/utils\";\nimport type { AdminCollection } from \"@rebasepro/cms-types\";\n\n/**\n * Recursive deep equality for primitives, arrays and plain objects.\n */\nfunction deepEqual(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (a == null || b == null) return a === b;\n if (typeof a !== typeof b) return false;\n if (typeof a !== \"object\") return false;\n\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== (b as unknown[]).length) return false;\n return a.every((item, i) => deepEqual(item, (b as unknown[])[i]));\n }\n\n if (Array.isArray(b)) return false;\n\n const aObj = a as Record<string, unknown>;\n const bObj = b as Record<string, unknown>;\n const aKeys = Object.keys(aObj);\n const bKeys = Object.keys(bObj);\n if (aKeys.length !== bKeys.length) return false;\n return aKeys.every(key => key in bObj && deepEqual(aObj[key], bObj[key]));\n}\n\nexport type EntityHistoryEntryProps = {\n size: PreviewSize;\n actions?: React.ReactNode;\n collection?: AdminCollection;\n hover?: boolean;\n entry: HistoryEntryData;\n onClick?: (e: React.SyntheticEvent) => void;\n};\n\nfunction PreviousValueView({\n previousValueInPath,\n childProperty,\n propertyKey\n}: {\n previousValueInPath: unknown;\n childProperty: Property;\n propertyKey: string;\n}) {\n if (typeof previousValueInPath === \"string\" || typeof previousValueInPath === \"number\") {\n return <Typography variant={\"caption\"} color={\"secondary\"} className=\"line-through\">\n {previousValueInPath}\n </Typography>;\n } else if (typeof previousValueInPath === \"boolean\") {\n return <Typography variant={\"caption\"} color={\"secondary\"} className=\"line-through\">\n {previousValueInPath ? \"true\" : \"false\"}\n </Typography>;\n } else {\n return <Tooltip\n side={\"left\"}\n title={<div className={\"flex flex-col gap-2\"}>\n <Typography variant={\"caption\"} color={\"secondary\"}>\n Previous value\n </Typography>\n <PropertyPreview\n propertyKey={propertyKey as string}\n value={previousValueInPath as never}\n property={childProperty as Property}\n size={\"small\"}/>\n </div>}>\n <ArrowLeftIcon size={iconSize.smallest} color={\"disabled\"} className={\"mb-1\"}/>\n </Tooltip>\n }\n}\n\n/**\n * Displays a single entity history revision entry.\n * Adapted from the entity_history plugin — now reads from backend API data.\n */\nexport function EntityHistoryEntry({\n actions,\n hover,\n collection,\n size,\n entry\n}: EntityHistoryEntryProps) {\n\n const authController = useAuthController();\n\n // The backend reports the whole row as changed, which includes the columns\n // that cannot meaningfully change: a timestamp it stamps itself on every\n // write, and the primary key, which is what identifies the row being\n // revised. Every revision was listing `updated_at: <now>` and `id: <the id\n // in the title bar>` around the one field the user actually edited.\n const changedFields = React.useMemo(() => {\n const all = entry.changed_fields;\n if (!all || !collection) return all;\n return all.filter(key => {\n const property = getPropertyInPath(collection.properties, key);\n if (!property) return true;\n if (\"isId\" in property && property.isId) return false;\n return !(property.type === \"date\" && \"autoValue\" in property && property.autoValue);\n });\n }, [entry.changed_fields, collection]);\n\n const previousValues = entry.previous_values;\n const updatedOn = new Date(entry.updated_at);\n const updatedBy = entry.updated_by;\n\n // Resolve user display\n const currentUser = authController.user;\n const userDisplay = updatedBy === currentUser?.uid\n ? currentUser\n : undefined;\n\n return <div className={\"@container/histentry w-full flex flex-col gap-2\"}>\n <div className={\"flex items-center flex-wrap gap-2\"}>\n <Typography variant={\"body2\"} color={\"secondary\"}>\n {updatedOn.toLocaleString()}\n </Typography>\n <Chip size={\"small\"}>\n {entry.action}\n </Chip>\n {!userDisplay && updatedBy && <Chip size={\"small\"}>{updatedBy}</Chip>}\n {userDisplay && <UserChip user={userDisplay}/>}\n </div>\n <div\n className={cls(\n \"bg-surface-card\",\n \"min-h-[44px]\",\n \"w-full\",\n \"items-center\",\n hover ? \"hover:bg-surface-hover\" : \"\",\n size === \"small\" ? \"p-1\" : \"px-2 py-1\",\n \"flex border rounded-lg\",\n defaultBorderMixin\n )}>\n\n {actions}\n\n <div className={\"flex flex-col grow w-full m-1 shrink min-w-0\"}>\n\n {changedFields && collection && changedFields.map((key: string) => {\n const childProperty = getPropertyInPath(collection.properties, key);\n const valueInPath = entry.values ? getValueInPath(entry.values, key) : undefined;\n const previousValueInPath = previousValues ? getValueInPath(previousValues, key) : undefined;\n\n const element = childProperty\n ? <PropertyPreview\n propertyKey={key}\n value={valueInPath as never}\n property={childProperty as Property}\n size={\"small\"}/>\n : <Typography variant={\"body2\"}>\n {typeof valueInPath === \"string\" ? valueInPath : JSON.stringify(valueInPath)}\n </Typography>;\n\n // The key column used to be `min-w-[200px] w-1/5` beside a\n // `w-4/5` value — 200px of label and 80% of the row, which\n // adds up to more than the row in anything narrower than a\n // full page. In the inspector that pushed every value off\n // the right edge and wrapped ids one character per line.\n // It stacks until the entry itself is wide enough.\n return (\n <div key={\"ref_prev_\" + key}\n className=\"flex flex-col @sm/histentry:flex-row @sm/histentry:items-baseline gap-x-4 gap-y-0.5 w-full my-1.5\">\n <Typography variant={\"caption\"}\n color={\"secondary\"}\n className=\"shrink-0 break-all @sm/histentry:w-40 @sm/histentry:text-right @sm/histentry:break-normal @sm/histentry:truncate\">\n {key}\n </Typography>\n <div className=\"min-w-0 flex-1 flex flex-col items-start gap-0.5\">\n {previousValueInPath !== undefined && !deepEqual(previousValueInPath, valueInPath) &&\n <PreviousValueView previousValueInPath={previousValueInPath}\n childProperty={childProperty as Property}\n propertyKey={key}/>\n }\n {element}\n </div>\n </div>\n );\n })}\n\n {(!changedFields || changedFields.length === 0) && (\n <Typography variant={\"caption\"} color={\"secondary\"}>\n {entry.action === \"create\" ? \"Entity created\" :\n entry.action === \"delete\" ? \"Entity deleted\" : \"No field changes recorded\"}\n </Typography>\n )}\n\n </div>\n\n </div>\n </div>;\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAS,UAAU,GAAY,GAAqB;CAChD,IAAI,MAAM,GAAG,OAAO;CACpB,IAAI,KAAK,QAAQ,KAAK,MAAM,OAAO,MAAM;CACzC,IAAI,OAAO,MAAM,OAAO,GAAG,OAAO;CAClC,IAAI,OAAO,MAAM,UAAU,OAAO;CAElC,IAAI,MAAM,QAAQ,CAAC,GAAG;EAClB,IAAI,CAAC,MAAM,QAAQ,CAAC,KAAK,EAAE,WAAY,EAAgB,QAAQ,OAAO;EACtE,OAAO,EAAE,OAAO,MAAM,MAAM,UAAU,MAAO,EAAgB,EAAE,CAAC;CACpE;CAEA,IAAI,MAAM,QAAQ,CAAC,GAAG,OAAO;CAE7B,MAAM,OAAO;CACb,MAAM,OAAO;CACb,MAAM,QAAQ,OAAO,KAAK,IAAI;CAC9B,MAAM,QAAQ,OAAO,KAAK,IAAI;CAC9B,IAAI,MAAM,WAAW,MAAM,QAAQ,OAAO;CAC1C,OAAO,MAAM,OAAM,QAAO,OAAO,QAAQ,UAAU,KAAK,MAAM,KAAK,IAAI,CAAC;AAC5E;AAWA,SAAS,kBAAkB,EACvB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S;KAAW,OAAO;eAClC,MAAM,WAAW,WAAW,mBACzB,MAAM,WAAW,WAAW,mBAAmB;IAC3C,CAAA,CAGf;KAEJ;IACJ;;AACT"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { useHistory } from "../../hooks/useHistory.js";
|
|
2
|
+
import { EntityHistoryEntry } from "./EntityHistoryEntry.js";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ErrorBoundary, HistoryIcon, IconButton, Label, Tooltip, Typography, cls } from "@rebasepro/ui";
|
|
6
|
+
import { ConfirmationDialog, useAuthController, useSnackbarController, useTranslation } from "@rebasepro/app";
|
|
7
|
+
//#region src/components/history/EntityHistoryView.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Entity history tab view. Shows a paginated list of entity revisions
|
|
10
|
+
* fetched from the backend API. Supports infinite scroll and revert.
|
|
11
|
+
*/
|
|
12
|
+
function EntityHistoryView({ entity, collection, formContext, refreshToken }) {
|
|
13
|
+
const { t } = useTranslation();
|
|
14
|
+
const snackbarController = useSnackbarController();
|
|
15
|
+
useAuthController();
|
|
16
|
+
const dirty = formContext?.formex.dirty;
|
|
17
|
+
const slug = collection.slug;
|
|
18
|
+
const entityId = entity?.id;
|
|
19
|
+
const { entries, isLoading, hasMore, loadMore, revert } = useHistory({
|
|
20
|
+
slug,
|
|
21
|
+
entityId,
|
|
22
|
+
enabled: !!entityId,
|
|
23
|
+
pageSize: 10,
|
|
24
|
+
refreshToken
|
|
25
|
+
});
|
|
26
|
+
const [revertHistoryId, setRevertHistoryId] = useState();
|
|
27
|
+
const [isReverting, setIsReverting] = useState(false);
|
|
28
|
+
const containerRef = useRef(null);
|
|
29
|
+
const loadMoreRef = useRef(null);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const currentContainer = containerRef.current;
|
|
32
|
+
const currentLoadMore = loadMoreRef.current;
|
|
33
|
+
if (!currentContainer || !currentLoadMore || !hasMore || isLoading) return;
|
|
34
|
+
const observer = new IntersectionObserver((observerEntries) => {
|
|
35
|
+
if (observerEntries[0].isIntersecting && hasMore && !isLoading) loadMore();
|
|
36
|
+
}, {
|
|
37
|
+
root: currentContainer,
|
|
38
|
+
rootMargin: "0px 0px 200px 0px",
|
|
39
|
+
threshold: .01
|
|
40
|
+
});
|
|
41
|
+
observer.observe(currentLoadMore);
|
|
42
|
+
return () => observer.disconnect();
|
|
43
|
+
}, [
|
|
44
|
+
hasMore,
|
|
45
|
+
isLoading,
|
|
46
|
+
entries.length,
|
|
47
|
+
loadMore
|
|
48
|
+
]);
|
|
49
|
+
if (!entity) return /* @__PURE__ */ jsx("div", {
|
|
50
|
+
className: "flex items-center justify-center h-full",
|
|
51
|
+
children: /* @__PURE__ */ jsx(Label, { children: t("history_new_entity") ?? "History is only available for existing records" })
|
|
52
|
+
});
|
|
53
|
+
async function doRevert(historyId) {
|
|
54
|
+
setIsReverting(true);
|
|
55
|
+
try {
|
|
56
|
+
const revertedValues = await revert(historyId);
|
|
57
|
+
setRevertHistoryId(void 0);
|
|
58
|
+
if (formContext?.formex?.resetForm && revertedValues) formContext.formex.resetForm({
|
|
59
|
+
values: revertedValues,
|
|
60
|
+
submitCount: 0,
|
|
61
|
+
touched: {}
|
|
62
|
+
});
|
|
63
|
+
snackbarController.open({
|
|
64
|
+
message: t("history_reverted") ?? "Reverted to selected version",
|
|
65
|
+
type: "info"
|
|
66
|
+
});
|
|
67
|
+
} catch (error) {
|
|
68
|
+
console.error("Error reverting entity:", error);
|
|
69
|
+
snackbarController.open({
|
|
70
|
+
message: t("history_revert_error") ?? "Error reverting entity",
|
|
71
|
+
type: "error"
|
|
72
|
+
});
|
|
73
|
+
} finally {
|
|
74
|
+
setIsReverting(false);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const revertEntry = revertHistoryId ? entries.find((e) => e.id === revertHistoryId) : void 0;
|
|
78
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
79
|
+
ref: containerRef,
|
|
80
|
+
className: cls("relative flex-1 h-full overflow-auto w-full flex flex-col gap-4 p-4 sm:p-5"),
|
|
81
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
82
|
+
className: "flex flex-col gap-2 max-w-6xl mx-auto w-full",
|
|
83
|
+
children: [
|
|
84
|
+
isLoading && entries.length === 0 && /* @__PURE__ */ jsx("div", {
|
|
85
|
+
className: "flex flex-col gap-4",
|
|
86
|
+
children: [
|
|
87
|
+
1,
|
|
88
|
+
2,
|
|
89
|
+
3
|
|
90
|
+
].map((i) => /* @__PURE__ */ jsxs("div", {
|
|
91
|
+
className: "flex flex-col gap-2 animate-pulse",
|
|
92
|
+
children: [/* @__PURE__ */ jsx("div", { className: "h-4 w-48 bg-surface-raised rounded" }), /* @__PURE__ */ jsx("div", { className: "h-12 w-full bg-surface-raised rounded-lg border border-hairline-strong" })]
|
|
93
|
+
}, i))
|
|
94
|
+
}),
|
|
95
|
+
!isLoading && entries.length === 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Label, { children: t("history_empty") ?? "No history available" }), /* @__PURE__ */ jsx(Typography, {
|
|
96
|
+
variant: "caption",
|
|
97
|
+
children: t("history_empty_description") ?? "When you save a record, a new version is created and stored in the history."
|
|
98
|
+
})] }),
|
|
99
|
+
entries.map((entry) => /* @__PURE__ */ jsx("div", {
|
|
100
|
+
className: "flex flex-col gap-2 w-full",
|
|
101
|
+
children: /* @__PURE__ */ jsx(EntityHistoryEntry, {
|
|
102
|
+
entry,
|
|
103
|
+
collection,
|
|
104
|
+
size: "medium",
|
|
105
|
+
actions: /* @__PURE__ */ jsx(Tooltip, {
|
|
106
|
+
title: t("history_revert") ?? "Revert to this version",
|
|
107
|
+
className: "m-2 grow-0 self-start",
|
|
108
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
109
|
+
"aria-label": t("history_revert") ?? "Revert to this version",
|
|
110
|
+
onClick: () => {
|
|
111
|
+
if (dirty) snackbarController.open({
|
|
112
|
+
message: t("history_revert_dirty") ?? "Please save or discard your changes before reverting",
|
|
113
|
+
type: "warning"
|
|
114
|
+
});
|
|
115
|
+
else setRevertHistoryId(entry.id);
|
|
116
|
+
},
|
|
117
|
+
children: /* @__PURE__ */ jsx(HistoryIcon, {})
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
}, entry.id)),
|
|
122
|
+
entries.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
123
|
+
ref: loadMoreRef,
|
|
124
|
+
className: "py-4 text-center",
|
|
125
|
+
children: [isLoading && /* @__PURE__ */ jsx(Label, { children: t("loading") }), !hasMore && entries.length > 10 && /* @__PURE__ */ jsx(Label, { children: t("history_no_more") ?? "No more history" })]
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
}), /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(ConfirmationDialog, {
|
|
129
|
+
open: Boolean(revertHistoryId),
|
|
130
|
+
onAccept: () => {
|
|
131
|
+
if (revertHistoryId) doRevert(revertHistoryId);
|
|
132
|
+
},
|
|
133
|
+
onCancel: () => setRevertHistoryId(void 0),
|
|
134
|
+
title: /* @__PURE__ */ jsx(Typography, {
|
|
135
|
+
variant: "subtitle2",
|
|
136
|
+
children: t("history_revert_title") ?? "Revert data to this version?"
|
|
137
|
+
}),
|
|
138
|
+
body: revertEntry ? /* @__PURE__ */ jsx("div", {
|
|
139
|
+
className: "p-4",
|
|
140
|
+
children: /* @__PURE__ */ jsxs(Typography, {
|
|
141
|
+
variant: "caption",
|
|
142
|
+
color: "secondary",
|
|
143
|
+
children: [
|
|
144
|
+
"This will save the entity with the values from",
|
|
145
|
+
" ",
|
|
146
|
+
new Date(revertEntry.updated_at).toLocaleString(),
|
|
147
|
+
". A new history entry will be created for the revert."
|
|
148
|
+
]
|
|
149
|
+
})
|
|
150
|
+
}) : null
|
|
151
|
+
}) })]
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
//#endregion
|
|
155
|
+
export { EntityHistoryView };
|
|
156
|
+
|
|
157
|
+
//# sourceMappingURL=EntityHistoryView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityHistoryView.js","names":[],"sources":["../../../src/components/history/EntityHistoryView.tsx"],"sourcesContent":["\nimport type { EntityCustomViewParams } from \"@rebasepro/cms-types\";\nimport { useRef, useEffect } from \"react\";\nimport { cls, IconButton, Label, Tooltip, Typography } from \"@rebasepro/ui\";\nimport { ErrorBoundary, HistoryIcon } from \"@rebasepro/ui\";\nimport { EntityHistoryEntry } from \"./EntityHistoryEntry\";\nimport { useSnackbarController, useAuthController, useTranslation } from \"@rebasepro/app\";\nimport { ConfirmationDialog } from \"@rebasepro/app\";\nimport { useState } from \"react\";\nimport { useHistory } from \"../../hooks/useHistory\";\n\n/**\n * Entity history tab view. Shows a paginated list of entity revisions\n * fetched from the backend API. Supports infinite scroll and revert.\n */\nexport function EntityHistoryView<M extends Record<string, unknown>>({\n entity,\n collection,\n formContext,\n refreshToken\n}: EntityCustomViewParams<M> & {\n /** Bumped once per save, so the list picks up the revision it just made. */\n refreshToken?: number;\n}) {\n\n const { t } = useTranslation();\n const snackbarController = useSnackbarController();\n const authController = useAuthController();\n const dirty = formContext?.formex.dirty;\n\n const slug = collection.slug;\n const entityId = entity?.id;\n\n const {\n entries,\n isLoading,\n hasMore,\n loadMore,\n revert\n } = useHistory({\n slug,\n entityId,\n enabled: !!entityId,\n pageSize: 10,\n refreshToken\n });\n\n const [revertHistoryId, setRevertHistoryId] = useState<string | undefined>();\n const [isReverting, setIsReverting] = useState(false);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const loadMoreRef = useRef<HTMLDivElement>(null);\n\n // Intersection observer for infinite scroll\n useEffect(() => {\n const currentContainer = containerRef.current;\n const currentLoadMore = loadMoreRef.current;\n\n if (!currentContainer || !currentLoadMore || !hasMore || isLoading) return;\n\n const observer = new IntersectionObserver(\n (observerEntries) => {\n if (observerEntries[0].isIntersecting && hasMore && !isLoading) {\n loadMore();\n }\n },\n {\n root: currentContainer,\n rootMargin: \"0px 0px 200px 0px\",\n threshold: 0.01\n }\n );\n\n observer.observe(currentLoadMore);\n\n return () => observer.disconnect();\n }, [hasMore, isLoading, entries.length, loadMore]);\n\n if (!entity) {\n return <div className=\"flex items-center justify-center h-full\">\n <Label>{t(\"history_new_entity\") ?? \"History is only available for existing records\"}</Label>\n </div>;\n }\n\n async function doRevert(historyId: string) {\n setIsReverting(true);\n try {\n const revertedValues = await revert(historyId);\n setRevertHistoryId(undefined);\n\n // Reset the form with the reverted values so the UI updates\n // immediately without requiring a page refresh.\n if (formContext?.formex?.resetForm && revertedValues) {\n formContext.formex.resetForm({\n values: revertedValues as M,\n submitCount: 0,\n touched: {}\n });\n }\n\n snackbarController.open({\n message: t(\"history_reverted\") ?? \"Reverted to selected version\",\n type: \"info\"\n });\n } catch (error) {\n console.error(\"Error reverting entity:\", error);\n snackbarController.open({\n message: t(\"history_revert_error\") ?? \"Error reverting entity\",\n type: \"error\"\n });\n } finally {\n setIsReverting(false);\n }\n }\n\n const revertEntry = revertHistoryId\n ? entries.find(e => e.id === revertHistoryId)\n : undefined;\n\n // `p-8` plus a `mt-24` heading were sized for a full-width tab that no\n // longer exists. In the inspector panel that was 96px of nothing above the\n // first revision, and 32px of gutter on each side of a 448px column.\n return <div\n ref={containerRef}\n className={cls(\"relative flex-1 h-full overflow-auto w-full flex flex-col gap-4 p-4 sm:p-5\")}>\n <div className=\"flex flex-col gap-2 max-w-6xl mx-auto w-full\">\n\n {isLoading && entries.length === 0 && (\n <div className=\"flex flex-col gap-4\">\n {[1, 2, 3].map(i => (\n <div key={i} className=\"flex flex-col gap-2 animate-pulse\">\n <div className=\"h-4 w-48 bg-surface-raised rounded\"/>\n <div className=\"h-12 w-full bg-surface-raised rounded-lg border border-hairline-strong\"/>\n </div>\n ))}\n </div>\n )}\n\n {!isLoading && entries.length === 0 && <>\n <Label>\n {t(\"history_empty\") ?? \"No history available\"}\n </Label>\n <Typography variant={\"caption\"}>\n {t(\"history_empty_description\") ?? \"When you save a record, a new version is created and stored in the history.\"}\n </Typography>\n </>}\n\n {entries.map((entry) => (\n <div key={entry.id} className=\"flex flex-col gap-2 w-full\">\n <EntityHistoryEntry\n entry={entry}\n collection={collection}\n size={\"medium\"}\n actions={\n <Tooltip title={t(\"history_revert\") ?? \"Revert to this version\"}\n className={\"m-2 grow-0 self-start\"}>\n <IconButton aria-label={t(\"history_revert\") ?? \"Revert to this version\"}\n onClick={() => {\n if (dirty) {\n snackbarController.open({\n message: t(\"history_revert_dirty\") ?? \"Please save or discard your changes before reverting\",\n type: \"warning\"\n });\n } else {\n setRevertHistoryId(entry.id);\n }\n }}>\n <HistoryIcon/>\n </IconButton>\n </Tooltip>\n }\n />\n </div>\n ))}\n\n {/* Load more sentinel */}\n {entries.length > 0 && (\n <div ref={loadMoreRef} className=\"py-4 text-center\">\n {isLoading && <Label>{t(\"loading\")}</Label>}\n {!hasMore && entries.length > 10 && <Label>{t(\"history_no_more\") ?? \"No more history\"}</Label>}\n </div>\n )}\n </div>\n\n <ErrorBoundary>\n <ConfirmationDialog\n open={Boolean(revertHistoryId)}\n onAccept={() => {\n if (revertHistoryId) doRevert(revertHistoryId);\n }}\n onCancel={() => setRevertHistoryId(undefined)}\n title={<Typography variant={\"subtitle2\"}>{t(\"history_revert_title\") ?? \"Revert data to this version?\"}</Typography>}\n body={revertEntry\n ? <div className=\"p-4\">\n <Typography variant={\"caption\"} color={\"secondary\"}>\n This will save the entity with the values from{\" \"}\n {new Date(revertEntry.updated_at).toLocaleString()}.\n A new history entry will be created for the revert.\n </Typography>\n </div>\n : null\n }\n />\n </ErrorBoundary>\n </div>;\n}\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,kBAAqD,EACjE,QACA,YACA,aACA,gBAID;CAEC,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,qBAAqB,sBAAsB;CAC1B,kBAA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AS,KACd,qBAAC,OAAD;KAAK,KAAK;KAAa,WAAU;eAAjC,CACK,aAAa,oBAAC,OAAD,EAAA,UAAQ,EAAE,SAAS,EAAS,CAAA,GACzC,CAAC,WAAW,QAAQ,SAAS,MAAM,oBAAC,OAAD,EAAA,UAAQ,EAAE,iBAAiB,KAAK,kBAAyB,CAAA,CAC5F;;GAER;MAEL,oBAAC,eAAD,EAAA,UACI,oBAAC,oBAAD;GACI,MAAM,QAAQ,eAAe;GAC7B,gBAAgB;IACZ,IAAI,iBAAiB,SAAS,eAAe;GACjD;GACA,gBAAgB,mBAAmB,KAAA,CAAS;GAC5C,OAAO,oBAAC,YAAD;IAAY,SAAS;cAAc,EAAE,sBAAsB,KAAK;GAA2C,CAAA;GAClH,MAAM,cACA,oBAAC,OAAD;IAAK,WAAU;cACb,qBAAC,YAAD;KAAY,SAAS;KAAW,OAAO;eAAvC;MAAoD;MACD;MAC9C,IAAI,KAAK,YAAY,UAAU,CAAC,CAAC,eAAe;MAAE;KAE3C;;GACX,CAAA,IACH;EAET,CAAA,EACU,CAAA,CACd;;AACT"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Chip, Tooltip } from "@rebasepro/ui";
|
|
3
|
+
//#region src/components/history/UserChip.tsx
|
|
4
|
+
function UserChip({ user }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
6
|
+
title: user.email ?? user.uid,
|
|
7
|
+
children: /* @__PURE__ */ jsxs(Chip, {
|
|
8
|
+
size: "small",
|
|
9
|
+
className: "flex items-center",
|
|
10
|
+
children: [user.photoURL && /* @__PURE__ */ jsx("img", {
|
|
11
|
+
className: "rounded-full w-6 h-6 mr-2",
|
|
12
|
+
src: user.photoURL,
|
|
13
|
+
alt: user.displayName ?? "User picture"
|
|
14
|
+
}), /* @__PURE__ */ jsx("span", { children: user.displayName ?? user.email ?? user.uid })]
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { UserChip };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=UserChip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserChip.js","names":[],"sources":["../../../src/components/history/UserChip.tsx"],"sourcesContent":["import { User } from \"@rebasepro/types\";\nimport { Chip, Tooltip } from \"@rebasepro/ui\";\n\nexport function UserChip({ user }: { user: User }) {\n return (\n <Tooltip title={user.email ?? user.uid}>\n <Chip size={\"small\"} className={\"flex items-center\"}>\n {user.photoURL && <img\n className={\"rounded-full w-6 h-6 mr-2\"}\n src={user.photoURL} alt={user.displayName ?? \"User picture\"}/>}\n <span>{user.displayName ?? user.email ?? user.uid}</span>\n </Chip>\n </Tooltip>\n );\n}\n"],"mappings":";;;AAGA,SAAgB,SAAS,EAAE,QAAwB;CAC/C,OACI,oBAAC,SAAD;EAAS,OAAO,KAAK,SAAS,KAAK;YAC/B,qBAAC,MAAD;GAAM,MAAM;GAAS,WAAW;aAAhC,CACK,KAAK,YAAY,oBAAC,OAAD;IACd,WAAW;IACX,KAAK,KAAK;IAAU,KAAK,KAAK,eAAe;GAAgB,CAAA,GACjE,oBAAC,QAAD,EAAA,UAAO,KAAK,eAAe,KAAK,SAAS,KAAK,IAAU,CAAA,CACtD;;CACD,CAAA;AAEjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const LazyCollectionViewBinding: import("react").LazyExoticComponent<import("react").FunctionComponent<import(".").CollectionViewBindingProps<any>>>;
|
|
2
|
+
export declare const LazyEditViewBinding: import("react").LazyExoticComponent<typeof import("./EditViewBinding.js").EditViewBinding>;
|
|
3
|
+
export declare const LazyDetailViewBinding: import("react").LazyExoticComponent<typeof import("./DetailViewBinding.js").DetailViewBinding>;
|
|
4
|
+
export declare const LazySidePanelBinding: import("react").LazyExoticComponent<typeof import("./SidePanelBinding.js").SidePanelBinding>;
|
|
5
|
+
/**
|
|
6
|
+
* Fetch the chunks above in the background. A failure here is ignored: the
|
|
7
|
+
* lazy component retries (and reports) the load when it is actually rendered.
|
|
8
|
+
* Returns a cancel function for the effect that schedules it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function prefetchRecordViews(): () => void;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { lazyChunk } from "@rebasepro/ui";
|
|
2
|
+
//#region src/components/lazy_record_views.ts
|
|
3
|
+
/**
|
|
4
|
+
* The collection table, the record views and the side panel, loaded on demand.
|
|
5
|
+
*
|
|
6
|
+
* Together they are the heaviest part of the admin — the table, the entity
|
|
7
|
+
* form with every field binding, the side panel, import/export — and neither
|
|
8
|
+
* the login screen nor the home page shows any of them. The shell used to
|
|
9
|
+
* import them statically (from `RebaseRoute` and the side-panel builder), so
|
|
10
|
+
* all of it was modulepreloaded before the login form could paint.
|
|
11
|
+
*
|
|
12
|
+
* `prefetchRecordViews` starts the downloads once someone is signed in, when
|
|
13
|
+
* the browser is idle, so the first collection they open does not wait on the
|
|
14
|
+
* network. Guarded by test/shell-static-graph.test.ts.
|
|
15
|
+
*
|
|
16
|
+
* It fetches markdown-it too. The kit's `Markdown` imports it the first time
|
|
17
|
+
* one renders (it is ~100 kB, and the login screen has none) and shows the
|
|
18
|
+
* source as plain text until it lands; warm in the module cache, it lands in
|
|
19
|
+
* the same tick instead of after a download, so the first markdown cell or
|
|
20
|
+
* preview of a session does not flash its source.
|
|
21
|
+
*/
|
|
22
|
+
var loadCollectionView = () => import("./CollectionViewBinding/CollectionViewBinding.js");
|
|
23
|
+
var loadEditView = () => import("./EditViewBinding.js");
|
|
24
|
+
var loadDetailView = () => import("./DetailViewBinding.js");
|
|
25
|
+
var loadSidePanel = () => import("./SidePanelBinding.js");
|
|
26
|
+
var loadMarkdownParser = () => import("markdown-it");
|
|
27
|
+
var LazyCollectionViewBinding = lazyChunk(() => loadCollectionView().then((m) => ({ default: m.CollectionViewBinding })));
|
|
28
|
+
var LazyEditViewBinding = lazyChunk(() => loadEditView().then((m) => ({ default: m.EditViewBinding })));
|
|
29
|
+
var LazyDetailViewBinding = lazyChunk(() => loadDetailView().then((m) => ({ default: m.DetailViewBinding })));
|
|
30
|
+
var LazySidePanelBinding = lazyChunk(() => loadSidePanel().then((m) => ({ default: m.SidePanelBinding })));
|
|
31
|
+
/**
|
|
32
|
+
* Fetch the chunks above in the background. A failure here is ignored: the
|
|
33
|
+
* lazy component retries (and reports) the load when it is actually rendered.
|
|
34
|
+
* Returns a cancel function for the effect that schedules it.
|
|
35
|
+
*/
|
|
36
|
+
function prefetchRecordViews() {
|
|
37
|
+
if (typeof window === "undefined") return () => void 0;
|
|
38
|
+
const run = () => {
|
|
39
|
+
for (const load of [
|
|
40
|
+
loadCollectionView,
|
|
41
|
+
loadEditView,
|
|
42
|
+
loadDetailView,
|
|
43
|
+
loadSidePanel,
|
|
44
|
+
loadMarkdownParser
|
|
45
|
+
]) load().catch(() => void 0);
|
|
46
|
+
};
|
|
47
|
+
if (typeof window.requestIdleCallback === "function") {
|
|
48
|
+
const handle = window.requestIdleCallback(run, { timeout: 4e3 });
|
|
49
|
+
return () => window.cancelIdleCallback(handle);
|
|
50
|
+
}
|
|
51
|
+
const handle = window.setTimeout(run, 1500);
|
|
52
|
+
return () => window.clearTimeout(handle);
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { LazyCollectionViewBinding, LazyDetailViewBinding, LazyEditViewBinding, LazySidePanelBinding, prefetchRecordViews };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=lazy_record_views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy_record_views.js","names":[],"sources":["../../src/components/lazy_record_views.ts"],"sourcesContent":["import { lazyChunk } from \"@rebasepro/ui\";\n\n/**\n * The collection table, the record views and the side panel, loaded on demand.\n *\n * Together they are the heaviest part of the admin — the table, the entity\n * form with every field binding, the side panel, import/export — and neither\n * the login screen nor the home page shows any of them. The shell used to\n * import them statically (from `RebaseRoute` and the side-panel builder), so\n * all of it was modulepreloaded before the login form could paint.\n *\n * `prefetchRecordViews` starts the downloads once someone is signed in, when\n * the browser is idle, so the first collection they open does not wait on the\n * network. Guarded by test/shell-static-graph.test.ts.\n *\n * It fetches markdown-it too. The kit's `Markdown` imports it the first time\n * one renders (it is ~100 kB, and the login screen has none) and shows the\n * source as plain text until it lands; warm in the module cache, it lands in\n * the same tick instead of after a download, so the first markdown cell or\n * preview of a session does not flash its source.\n */\nconst loadCollectionView = () => import(\"./CollectionViewBinding/CollectionViewBinding\");\nconst loadEditView = () => import(\"./EditViewBinding\");\nconst loadDetailView = () => import(\"./DetailViewBinding\");\nconst loadSidePanel = () => import(\"./SidePanelBinding\");\nconst loadMarkdownParser = () => import(\"markdown-it\");\n\nexport const LazyCollectionViewBinding = lazyChunk(() => loadCollectionView().then(m => ({ default: m.CollectionViewBinding })));\nexport const LazyEditViewBinding = lazyChunk(() => loadEditView().then(m => ({ default: m.EditViewBinding })));\nexport const LazyDetailViewBinding = lazyChunk(() => loadDetailView().then(m => ({ default: m.DetailViewBinding })));\nexport const LazySidePanelBinding = lazyChunk(() => loadSidePanel().then(m => ({ default: m.SidePanelBinding })));\n\n/**\n * Fetch the chunks above in the background. A failure here is ignored: the\n * lazy component retries (and reports) the load when it is actually rendered.\n * Returns a cancel function for the effect that schedules it.\n */\nexport function prefetchRecordViews(): () => void {\n if (typeof window === \"undefined\") return () => undefined;\n const run = () => {\n for (const load of [loadCollectionView, loadEditView, loadDetailView, loadSidePanel, loadMarkdownParser]) {\n load().catch(() => undefined);\n }\n };\n if (typeof window.requestIdleCallback === \"function\") {\n const handle = window.requestIdleCallback(run, { timeout: 4000 });\n return () => window.cancelIdleCallback(handle);\n }\n const handle = window.setTimeout(run, 1500);\n return () => window.clearTimeout(handle);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,IAAM,2BAA2B,OAAO;AACxC,IAAM,qBAAqB,OAAO;AAClC,IAAM,uBAAuB,OAAO;AACpC,IAAM,sBAAsB,OAAO;AACnC,IAAM,2BAA2B,OAAO;AAExC,IAAa,4BAA4B,gBAAgB,mBAAmB,CAAC,CAAC,MAAK,OAAM,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAAC;AAC/H,IAAa,sBAAsB,gBAAgB,aAAa,CAAC,CAAC,MAAK,OAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;AAC7G,IAAa,wBAAwB,gBAAgB,eAAe,CAAC,CAAC,MAAK,OAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;AACnH,IAAa,uBAAuB,gBAAgB,cAAc,CAAC,CAAC,MAAK,OAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;;;;;;AAOhH,SAAgB,sBAAkC;CAC9C,IAAI,OAAO,WAAW,aAAa,aAAa,KAAA;CAChD,MAAM,YAAY;EACd,KAAK,MAAM,QAAQ;GAAC;GAAoB;GAAc;GAAgB;GAAe;EAAkB,GACnG,KAAK,CAAC,CAAC,YAAY,KAAA,CAAS;CAEpC;CACA,IAAI,OAAO,OAAO,wBAAwB,YAAY;EAClD,MAAM,SAAS,OAAO,oBAAoB,KAAK,EAAE,SAAS,IAAK,CAAC;EAChE,aAAa,OAAO,mBAAmB,MAAM;CACjD;CACA,MAAM,SAAS,OAAO,WAAW,KAAK,IAAI;CAC1C,aAAa,OAAO,aAAa,MAAM;AAC3C"}
|