@rebasepro/cms 0.0.1-canary.4d4fb3e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +6 -0
- package/dist/CollectionEditorDialog-DiZYNmYV.js +4731 -0
- package/dist/CollectionEditorDialog-DiZYNmYV.js.map +1 -0
- package/dist/CollectionsStudioView-BHVTfAuK.js +224 -0
- package/dist/CollectionsStudioView-BHVTfAuK.js.map +1 -0
- package/dist/PropertyEditView-BC5GO9AI.js +7776 -0
- package/dist/PropertyEditView-BC5GO9AI.js.map +1 -0
- package/dist/collection_editor/CollectionEditorDialogsContext.d.ts +19 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +45 -0
- package/dist/collection_editor/_cms_internals.d.ts +29 -0
- package/dist/collection_editor/api/generateCollectionApi.d.ts +77 -0
- package/dist/collection_editor/api/index.d.ts +1 -0
- package/dist/collection_editor/index.d.ts +16 -0
- package/dist/collection_editor/pgColumnToProperty.d.ts +6 -0
- package/dist/collection_editor/types/collection_editor_controller.d.ts +56 -0
- package/dist/collection_editor/types/collection_inference.d.ts +10 -0
- package/dist/collection_editor/types/config_controller.d.ts +91 -0
- package/dist/collection_editor/types/config_permissions.d.ts +19 -0
- package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +11 -0
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +10 -0
- package/dist/collection_editor/ui/EditorCollectionAction.d.ts +2 -0
- package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +2 -0
- package/dist/collection_editor/ui/EditorEntityAction.d.ts +2 -0
- package/dist/collection_editor/ui/HomePageEditorCollectionAction.d.ts +2 -0
- package/dist/collection_editor/ui/KanbanSetupAction.d.ts +10 -0
- package/dist/collection_editor/ui/MissingReferenceWidget.d.ts +3 -0
- package/dist/collection_editor/ui/NewCollectionButton.d.ts +1 -0
- package/dist/collection_editor/ui/NewCollectionCard.d.ts +2 -0
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +36 -0
- package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.d.ts +20 -0
- package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +11 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +72 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +19 -0
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +17 -0
- package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.d.ts +12 -0
- package/dist/collection_editor/ui/collection_editor/CollectionRelationsTab.d.ts +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.d.ts +14 -0
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/EntityActionsSelectDialog.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/EnumForm.d.ts +12 -0
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +6 -0
- package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +47 -0
- package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.d.ts +16 -0
- package/dist/collection_editor/ui/collection_editor/PropertyTree.d.ts +31 -0
- package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +11 -0
- package/dist/collection_editor/ui/collection_editor/SwitchControl.d.ts +8 -0
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.d.ts +6 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +13 -0
- package/dist/collection_editor/ui/collection_editor/import/clean_import_data.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/CommonPropertyFields.d.ts +10 -0
- package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.d.ts +9 -0
- package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.d.ts +14 -0
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.d.ts +15 -0
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.d.ts +9 -0
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.d.ts +10 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.d.ts +6 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/index.d.ts +6 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/property_paths.d.ts +19 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +11 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +2 -0
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +2 -0
- package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +2 -0
- package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +2 -0
- package/dist/collection_editor/ui/collection_editor/util.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/utils/strings.d.ts +1 -0
- package/dist/collection_editor/ui/collection_editor/utils/supported_fields.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.d.ts +2 -0
- package/dist/collection_editor/useCollectionEditorController.d.ts +6 -0
- package/dist/collection_editor/useCollectionsConfigController.d.ts +6 -0
- package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +6 -0
- package/dist/collection_editor/validateCollectionJson.d.ts +22 -0
- package/dist/collection_editor_ui.d.ts +8 -0
- package/dist/collection_editor_ui.js +11 -0
- package/dist/collection_editor_ui.js.map +1 -0
- package/dist/components/AdminModeSyncer.d.ts +17 -0
- package/dist/components/ArrayContainer.d.ts +59 -0
- package/dist/components/ClearFilterSortButton.d.ts +5 -0
- package/dist/components/CollectionEditorDialogs.d.ts +15 -0
- package/dist/components/DefaultAppBar.d.ts +29 -0
- package/dist/components/DefaultDrawer.d.ts +29 -0
- package/dist/components/DeleteEntityDialog.d.ts +13 -0
- package/dist/components/DrawerNavigationGroup.d.ts +49 -0
- package/dist/components/DrawerNavigationItem.d.ts +10 -0
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +39 -0
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +27 -0
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +129 -0
- package/dist/components/EntityCollectionTable/PropertyTableCell.d.ts +26 -0
- package/dist/components/EntityCollectionTable/column_utils.d.ts +16 -0
- package/dist/components/EntityCollectionTable/fields/TableMultipleRelationField.d.ts +21 -0
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +22 -0
- package/dist/components/EntityCollectionTable/fields/TableRelationField.d.ts +22 -0
- package/dist/components/EntityCollectionTable/fields/TableRelationSelectorField.d.ts +20 -0
- package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +35 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableDateField.d.ts +12 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableInput.d.ts +9 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableNumberInput.d.ts +8 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableSelect.d.ts +15 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableSwitch.d.ts +7 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableUserSelect.d.ts +12 -0
- package/dist/components/EntityCollectionTable/index.d.ts +6 -0
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +14 -0
- package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +32 -0
- package/dist/components/EntityCollectionTable/internal/EntityTableCellActions.d.ts +9 -0
- package/dist/components/EntityCollectionTable/internal/common.d.ts +5 -0
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +27 -0
- package/dist/components/EntityCollectionTable/internal/popup_field/useDraggable.d.ts +13 -0
- package/dist/components/EntityCollectionTable/internal/popup_field/useWindowSize.d.ts +6 -0
- package/dist/components/EntityCollectionTable/table_bindings.d.ts +28 -0
- package/dist/components/EntityCollectionView/Board.d.ts +2 -0
- package/dist/components/EntityCollectionView/BoardColumn.d.ts +42 -0
- package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +9 -0
- package/dist/components/EntityCollectionView/BoardSortableList.d.ts +14 -0
- package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +27 -0
- package/dist/components/EntityCollectionView/EntityCard.d.ts +20 -0
- package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +21 -0
- package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +32 -0
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +54 -0
- package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +15 -0
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +17 -0
- package/dist/components/EntityCollectionView/FiltersDialog.d.ts +15 -0
- package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +44 -0
- package/dist/components/EntityCollectionView/board_types.d.ts +105 -0
- package/dist/components/EntityCollectionView/hooks/useCollectionInlineEditor.d.ts +12 -0
- package/dist/components/EntityCollectionView/hooks/useKanbanDragAndDrop.d.ts +20 -0
- package/dist/components/EntityCollectionView/useBoardDataController.d.ts +61 -0
- package/dist/components/EntityCollectionView/useSelectionController.d.ts +2 -0
- package/dist/components/EntityCollectionView/utils.d.ts +3 -0
- package/dist/components/EntityEditView.d.ts +48 -0
- package/dist/components/EntityEditViewFormActions.d.ts +2 -0
- package/dist/components/EntityJsonPreview.d.ts +3 -0
- package/dist/components/EntityPreview.d.ts +56 -0
- package/dist/components/EntitySidePanel.d.ts +10 -0
- package/dist/components/EntityView.d.ts +12 -0
- package/dist/components/FieldCaption.d.ts +5 -0
- package/dist/components/HomePage/ContentHomePage.d.ts +11 -0
- package/dist/components/HomePage/FavouritesView.d.ts +3 -0
- package/dist/components/HomePage/HomePageDnD.d.ts +77 -0
- package/dist/components/HomePage/NavigationCard.d.ts +10 -0
- package/dist/components/HomePage/NavigationCardBinding.d.ts +18 -0
- package/dist/components/HomePage/NavigationGroup.d.ts +11 -0
- package/dist/components/HomePage/RenameGroupDialog.d.ts +9 -0
- package/dist/components/HomePage/SmallNavigationCard.d.ts +6 -0
- package/dist/components/HomePage/index.d.ts +4 -0
- package/dist/components/PropertyCollectionView.d.ts +24 -0
- package/dist/components/PropertyConfigBadge.d.ts +6 -0
- package/dist/components/PropertyIdCopyTooltip.d.ts +8 -0
- package/dist/components/RebaseAuthGate.d.ts +21 -0
- package/dist/components/RebaseCMS.d.ts +10 -0
- package/dist/components/RebaseLayout.d.ts +32 -0
- package/dist/components/RebaseNavigation.d.ts +24 -0
- package/dist/components/RebaseRouteDefs.d.ts +30 -0
- package/dist/components/RebaseShell.d.ts +25 -0
- package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +59 -0
- package/dist/components/ReferenceWidget.d.ts +30 -0
- package/dist/components/RelationSelector.d.ts +32 -0
- package/dist/components/SearchIconsView.d.ts +5 -0
- package/dist/components/SelectableTable/SelectableTable.d.ts +89 -0
- package/dist/components/SelectableTable/SelectableTableContext.d.ts +4 -0
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +9 -0
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +12 -0
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +15 -0
- package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +12 -0
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +13 -0
- package/dist/components/SideDialogs.d.ts +25 -0
- package/dist/components/SideEntityProvider.d.ts +32 -0
- package/dist/components/admin/RoleChip.d.ts +4 -0
- package/dist/components/admin/RolesView.d.ts +4 -0
- package/dist/components/admin/UsersView.d.ts +4 -0
- package/dist/components/admin/index.d.ts +3 -0
- package/dist/components/app/AppBar.d.ts +12 -0
- package/dist/components/app/Drawer.d.ts +19 -0
- package/dist/components/app/Scaffold.d.ts +34 -0
- package/dist/components/app/index.d.ts +4 -0
- package/dist/components/app/useApp.d.ts +17 -0
- package/dist/components/common/default_entity_actions.d.ts +4 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/field_configs.d.ts +7 -0
- package/dist/components/history/EntityHistoryEntry.d.ts +17 -0
- package/dist/components/history/EntityHistoryView.d.ts +6 -0
- package/dist/components/history/LastEditedByFormAction.d.ts +6 -0
- package/dist/components/history/LastEditedByIndicator.d.ts +10 -0
- package/dist/components/history/UserChip.d.ts +4 -0
- package/dist/components/history/index.d.ts +5 -0
- package/dist/components/index.d.ts +42 -0
- package/dist/contexts/BreacrumbsContext.d.ts +8 -0
- package/dist/contexts/SideDialogsControllerContext.d.ts +3 -0
- package/dist/contexts/SideEntityControllerContext.d.ts +3 -0
- package/dist/data_export/export/BasicExportAction.d.ts +7 -0
- package/dist/data_export/export/ExportCollectionAction.d.ts +11 -0
- package/dist/data_export/export/export.d.ts +22 -0
- package/dist/data_export/export/index.d.ts +3 -0
- package/dist/data_export/index.d.ts +1 -0
- package/dist/data_import/components/DataNewPropertiesMapping.d.ts +13 -0
- package/dist/data_import/components/ImportFileUpload.d.ts +3 -0
- package/dist/data_import/components/ImportNewPropertyFieldPreview.d.ts +9 -0
- package/dist/data_import/components/ImportSaveInProgress.d.ts +8 -0
- package/dist/data_import/components/index.d.ts +4 -0
- package/dist/data_import/hooks/index.d.ts +1 -0
- package/dist/data_import/hooks/useImportConfig.d.ts +2 -0
- package/dist/data_import/import/ImportCollectionAction.d.ts +15 -0
- package/dist/data_import/import/index.d.ts +1 -0
- package/dist/data_import/index.d.ts +5 -0
- package/dist/data_import/types/column_mapping.d.ts +20 -0
- package/dist/data_import/types/index.d.ts +1 -0
- package/dist/data_import/utils/data.d.ts +4 -0
- package/dist/data_import/utils/file_headers.d.ts +1 -0
- package/dist/data_import/utils/file_to_json.d.ts +16 -0
- package/dist/data_import/utils/get_import_inference_type.d.ts +2 -0
- package/dist/data_import/utils/get_properties_mapping.d.ts +1 -0
- package/dist/data_import/utils/index.d.ts +3 -0
- package/dist/editor/components/SlashCommandMenu.d.ts +6 -0
- package/dist/editor/components/editor-bubble-item.d.ts +8 -0
- package/dist/editor/components/editor-bubble.d.ts +8 -0
- package/dist/editor/components/image-bubble.d.ts +5 -0
- package/dist/editor/components/index.d.ts +16 -0
- package/dist/editor/components/table-bubble.d.ts +5 -0
- package/dist/editor/editor.d.ts +30 -0
- package/dist/editor/extensions/HighlightDecorationExtension.d.ts +24 -0
- package/dist/editor/extensions/Image/index.d.ts +6 -0
- package/dist/editor/extensions/Image.d.ts +6 -0
- package/dist/editor/extensions/TextLoadingDecorationExtension.d.ts +16 -0
- package/dist/editor/extensions/clipboard.d.ts +7 -0
- package/dist/editor/extensions/custom-keymap.d.ts +1 -0
- package/dist/editor/extensions/drag-and-drop.d.ts +9 -0
- package/dist/editor/hooks/useProseMirror.d.ts +13 -0
- package/dist/editor/hooks/useProseMirrorContext.d.ts +9 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/markdown.d.ts +5 -0
- package/dist/editor/nodeViews/ImageComponent.d.ts +3 -0
- package/dist/editor/nodeViews/ReactNodeView.d.ts +29 -0
- package/dist/editor/nodeViews/TaskItemComponent.d.ts +3 -0
- package/dist/editor/nodeViews/index.d.ts +6 -0
- package/dist/editor/plugins/index.d.ts +2 -0
- package/dist/editor/plugins/inputrules.d.ts +6 -0
- package/dist/editor/plugins/placeholderPlugin.d.ts +3 -0
- package/dist/editor/plugins/slashCommandPlugin.d.ts +12 -0
- package/dist/editor/schema.d.ts +2 -0
- package/dist/editor/selectors/ai-selector.d.ts +0 -0
- package/dist/editor/selectors/color-selector.d.ts +10 -0
- package/dist/editor/selectors/link-selector.d.ts +8 -0
- package/dist/editor/selectors/node-selector.d.ts +15 -0
- package/dist/editor/selectors/text-buttons.d.ts +1 -0
- package/dist/editor/types.d.ts +5 -0
- package/dist/editor/useProseMirror.d.ts +16 -0
- package/dist/editor/utils/prosemirror-utils.d.ts +7 -0
- package/dist/editor/utils/remove_classes.d.ts +1 -0
- package/dist/editor/utils/useDebouncedCallback.d.ts +1 -0
- package/dist/form/EntityForm.d.ts +10 -0
- package/dist/form/EntityFormActions.d.ts +2 -0
- package/dist/form/PropertyFieldBinding.d.ts +30 -0
- package/dist/form/components/ErrorFocus.d.ts +4 -0
- package/dist/form/components/FieldHelperText.d.ts +12 -0
- package/dist/form/components/FormEntry.d.ts +6 -0
- package/dist/form/components/FormLayout.d.ts +5 -0
- package/dist/form/components/LabelWithIcon.d.ts +14 -0
- package/dist/form/components/LabelWithIconAndTooltip.d.ts +15 -0
- package/dist/form/components/LocalChangesMenu.d.ts +11 -0
- package/dist/form/components/StorageItemPreview.d.ts +14 -0
- package/dist/form/components/StorageUploadProgress.d.ts +10 -0
- package/dist/form/components/index.d.ts +5 -0
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +13 -0
- package/dist/form/field_bindings/BlockFieldBinding.d.ts +11 -0
- package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +12 -0
- package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +8 -0
- package/dist/form/field_bindings/MapFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +12 -0
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/MultipleRelationFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +11 -0
- package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/RelationFieldBinding.d.ts +3 -0
- package/dist/form/field_bindings/RepeatFieldBinding.d.ts +11 -0
- package/dist/form/field_bindings/SelectFieldBinding.d.ts +11 -0
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +21 -0
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/TextFieldBinding.d.ts +9 -0
- package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +13 -0
- package/dist/form/index.d.ts +20 -0
- package/dist/form/useClearRestoreValue.d.ts +13 -0
- package/dist/form/validation.d.ts +21 -0
- package/dist/hooks/index.d.ts +15 -0
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.d.ts +5 -0
- package/dist/hooks/navigation/contexts/NavigationStateContext.d.ts +4 -0
- package/dist/hooks/navigation/contexts/UrlContext.d.ts +4 -0
- package/dist/hooks/navigation/contexts/index.d.ts +3 -0
- package/dist/hooks/navigation/useBuildCollectionRegistryController.d.ts +7 -0
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +34 -0
- package/dist/hooks/navigation/useBuildUrlController.d.ts +7 -0
- package/dist/hooks/navigation/useNavigationRegistry.d.ts +11 -0
- package/dist/hooks/navigation/useNavigationResolution.d.ts +7 -0
- package/dist/hooks/navigation/useNavigationURLs.d.ts +11 -0
- package/dist/hooks/navigation/useResolvedCollections.d.ts +28 -0
- package/dist/hooks/navigation/useResolvedViews.d.ts +29 -0
- package/dist/hooks/navigation/useTopLevelNavigation.d.ts +27 -0
- package/dist/hooks/navigation/utils.d.ts +12 -0
- package/dist/hooks/useBreadcrumbsController.d.ts +42 -0
- package/dist/hooks/useBuildSideDialogsController.d.ts +2 -0
- package/dist/hooks/useBuildSideEntityController.d.ts +6 -0
- package/dist/hooks/useCMSContext.d.ts +27 -0
- package/dist/hooks/useEntityHistory.d.ts +30 -0
- package/dist/hooks/useEntitySelectionDialog.d.ts +18 -0
- package/dist/hooks/useResolvedNavigationFrom.d.ts +73 -0
- package/dist/hooks/useSideDialogsController.d.ts +19 -0
- package/dist/hooks/useSideEntityController.d.ts +11 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +2885 -0
- package/dist/index.js.map +1 -0
- package/dist/preview/PropertyPreview.d.ts +7 -0
- package/dist/preview/components/ArrayEnumPreview.d.ts +11 -0
- package/dist/preview/components/BooleanPreview.d.ts +11 -0
- package/dist/preview/components/DatePreview.d.ts +17 -0
- package/dist/preview/components/EmptyValue.d.ts +6 -0
- package/dist/preview/components/EnumValuesChip.d.ts +13 -0
- package/dist/preview/components/ImagePreview.d.ts +16 -0
- package/dist/preview/components/ReferencePreview.d.ts +17 -0
- package/dist/preview/components/RelationPreview.d.ts +17 -0
- package/dist/preview/components/StorageThumbnail.d.ts +15 -0
- package/dist/preview/components/UrlComponentPreview.d.ts +14 -0
- package/dist/preview/components/UserPreview.d.ts +9 -0
- package/dist/preview/index.d.ts +23 -0
- package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOfRelationsPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +6 -0
- package/dist/preview/property_previews/MapPropertyPreview.d.ts +9 -0
- package/dist/preview/property_previews/NumberPropertyPreview.d.ts +7 -0
- package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +14 -0
- package/dist/preview/property_previews/StringPropertyPreview.d.ts +7 -0
- package/dist/preview/util.d.ts +7 -0
- package/dist/routes/CustomViewRoute.d.ts +4 -0
- package/dist/routes/RebaseRoute.d.ts +1 -0
- package/dist/routes/index.d.ts +2 -0
- package/dist/types/components/EntityFormActionsProps.d.ts +19 -0
- package/dist/types/components/EntityFormProps.d.ts +48 -0
- package/dist/types/components/PropertyPreviewProps.d.ts +47 -0
- package/dist/types/components/formex.d.ts +40 -0
- package/dist/types/components/index.d.ts +3 -0
- package/dist/types/fields.d.ts +221 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/util/entity_actions.d.ts +2 -0
- package/dist/util/index.d.ts +5 -0
- package/dist/util/navigation_utils.d.ts +32 -0
- package/dist/util/previews.d.ts +4 -0
- package/dist/util/property_utils.d.ts +24 -0
- package/dist/util/resolutions.d.ts +9 -0
- package/dist/util-W5Lh0Emr.js +32604 -0
- package/dist/util-W5Lh0Emr.js.map +1 -0
- package/package.json +170 -0
- package/src/collection_editor/CollectionEditorDialogsContext.tsx +25 -0
- package/src/collection_editor/ConfigControllerProvider.tsx +405 -0
- package/src/collection_editor/_cms_internals.ts +41 -0
- package/src/collection_editor/api/generateCollectionApi.ts +125 -0
- package/src/collection_editor/api/index.ts +1 -0
- package/src/collection_editor/index.ts +63 -0
- package/src/collection_editor/pgColumnToProperty.ts +274 -0
- package/src/collection_editor/types/collection_editor_controller.tsx +64 -0
- package/src/collection_editor/types/collection_inference.ts +17 -0
- package/src/collection_editor/types/config_controller.tsx +109 -0
- package/src/collection_editor/types/config_permissions.ts +20 -0
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +195 -0
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +49 -0
- package/src/collection_editor/ui/EditorCollectionAction.tsx +57 -0
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +92 -0
- package/src/collection_editor/ui/EditorEntityAction.tsx +53 -0
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +119 -0
- package/src/collection_editor/ui/KanbanSetupAction.tsx +40 -0
- package/src/collection_editor/ui/MissingReferenceWidget.tsx +40 -0
- package/src/collection_editor/ui/NewCollectionButton.tsx +26 -0
- package/src/collection_editor/ui/NewCollectionCard.tsx +52 -0
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +52 -0
- package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +253 -0
- package/src/collection_editor/ui/collection_editor/AIModifiedPathsContext.tsx +88 -0
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +437 -0
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +991 -0
- package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +291 -0
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +171 -0
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +600 -0
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +331 -0
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +224 -0
- package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +103 -0
- package/src/collection_editor/ui/collection_editor/CollectionYupValidation.tsx +9 -0
- package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +137 -0
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +312 -0
- package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +164 -0
- package/src/collection_editor/ui/collection_editor/EntityActionsSelectDialog.tsx +40 -0
- package/src/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +39 -0
- package/src/collection_editor/ui/collection_editor/EnumForm.tsx +370 -0
- package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +277 -0
- package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +142 -0
- package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +195 -0
- package/src/collection_editor/ui/collection_editor/LayoutModeSwitch.tsx +35 -0
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +790 -0
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +159 -0
- package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +360 -0
- package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +255 -0
- package/src/collection_editor/ui/collection_editor/SwitchControl.tsx +39 -0
- package/src/collection_editor/ui/collection_editor/ViewModeSwitch.tsx +41 -0
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +66 -0
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.tsx +296 -0
- package/src/collection_editor/ui/collection_editor/import/clean_import_data.ts +54 -0
- package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +146 -0
- package/src/collection_editor/ui/collection_editor/properties/BooleanPropertyField.tsx +41 -0
- package/src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx +111 -0
- package/src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx +205 -0
- package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +124 -0
- package/src/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.tsx +20 -0
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +150 -0
- package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +215 -0
- package/src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx +115 -0
- package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +162 -0
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +344 -0
- package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +106 -0
- package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +366 -0
- package/src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx +146 -0
- package/src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx +90 -0
- package/src/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +47 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +853 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.tsx +28 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.tsx +593 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/index.ts +6 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/property_paths.ts +93 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +50 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +61 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +115 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +152 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.tsx +28 -0
- package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +112 -0
- package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +183 -0
- package/src/collection_editor/ui/collection_editor/templates/products_template.ts +88 -0
- package/src/collection_editor/ui/collection_editor/templates/users_template.ts +42 -0
- package/src/collection_editor/ui/collection_editor/util.ts +28 -0
- package/src/collection_editor/ui/collection_editor/utils/strings.ts +16 -0
- package/src/collection_editor/ui/collection_editor/utils/supported_fields.tsx +33 -0
- package/src/collection_editor/ui/collection_editor/utils/update_property_for_widget.ts +281 -0
- package/src/collection_editor/useCollectionEditorController.tsx +9 -0
- package/src/collection_editor/useCollectionsConfigController.tsx +9 -0
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +111 -0
- package/src/collection_editor/validateCollectionJson.ts +379 -0
- package/src/collection_editor_ui.ts +15 -0
- package/src/components/AdminModeSyncer.tsx +56 -0
- package/src/components/ArrayContainer.tsx +551 -0
- package/src/components/ClearFilterSortButton.tsx +47 -0
- package/src/components/CollectionEditorDialogs.tsx +68 -0
- package/src/components/DefaultAppBar.tsx +280 -0
- package/src/components/DefaultDrawer.tsx +276 -0
- package/src/components/DeleteEntityDialog.tsx +182 -0
- package/src/components/DrawerNavigationGroup.tsx +128 -0
- package/src/components/DrawerNavigationItem.tsx +65 -0
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +232 -0
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +380 -0
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +171 -0
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +342 -0
- package/src/components/EntityCollectionTable/column_utils.tsx +75 -0
- package/src/components/EntityCollectionTable/fields/TableMultipleRelationField.tsx +130 -0
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +172 -0
- package/src/components/EntityCollectionTable/fields/TableRelationField.tsx +181 -0
- package/src/components/EntityCollectionTable/fields/TableRelationSelectorField.tsx +42 -0
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +320 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableDateField.tsx +39 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableInput.tsx +90 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableNumberInput.tsx +80 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableSelect.tsx +133 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableSwitch.tsx +32 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableUserSelect.tsx +112 -0
- package/src/components/EntityCollectionTable/index.tsx +14 -0
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +72 -0
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +311 -0
- package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +82 -0
- package/src/components/EntityCollectionTable/internal/common.tsx +73 -0
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +418 -0
- package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +96 -0
- package/src/components/EntityCollectionTable/internal/popup_field/useWindowSize.tsx +20 -0
- package/src/components/EntityCollectionTable/table_bindings.tsx +345 -0
- package/src/components/EntityCollectionView/Board.tsx +324 -0
- package/src/components/EntityCollectionView/BoardColumn.tsx +158 -0
- package/src/components/EntityCollectionView/BoardColumnTitle.tsx +45 -0
- package/src/components/EntityCollectionView/BoardSortableList.tsx +172 -0
- package/src/components/EntityCollectionView/EntityBoardCard.tsx +204 -0
- package/src/components/EntityCollectionView/EntityCard.tsx +219 -0
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +609 -0
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +249 -0
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +1143 -0
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +149 -0
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +122 -0
- package/src/components/EntityCollectionView/FiltersDialog.tsx +249 -0
- package/src/components/EntityCollectionView/ViewModeToggle.tsx +197 -0
- package/src/components/EntityCollectionView/board_types.ts +113 -0
- package/src/components/EntityCollectionView/hooks/useCollectionInlineEditor.ts +79 -0
- package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +151 -0
- package/src/components/EntityCollectionView/useBoardDataController.tsx +510 -0
- package/src/components/EntityCollectionView/useSelectionController.tsx +43 -0
- package/src/components/EntityCollectionView/utils.ts +19 -0
- package/src/components/EntityEditView.tsx +576 -0
- package/src/components/EntityEditViewFormActions.tsx +345 -0
- package/src/components/EntityJsonPreview.tsx +66 -0
- package/src/components/EntityPreview.tsx +366 -0
- package/src/components/EntitySidePanel.tsx +159 -0
- package/src/components/EntityView.tsx +69 -0
- package/src/components/FieldCaption.tsx +14 -0
- package/src/components/HomePage/ContentHomePage.tsx +553 -0
- package/src/components/HomePage/FavouritesView.tsx +60 -0
- package/src/components/HomePage/HomePageDnD.tsx +703 -0
- package/src/components/HomePage/NavigationCard.tsx +79 -0
- package/src/components/HomePage/NavigationCardBinding.tsx +110 -0
- package/src/components/HomePage/NavigationGroup.tsx +156 -0
- package/src/components/HomePage/RenameGroupDialog.tsx +123 -0
- package/src/components/HomePage/SmallNavigationCard.tsx +45 -0
- package/src/components/HomePage/index.tsx +5 -0
- package/src/components/PropertyCollectionView.tsx +335 -0
- package/src/components/PropertyConfigBadge.tsx +27 -0
- package/src/components/PropertyIdCopyTooltip.tsx +47 -0
- package/src/components/RebaseAuthGate.tsx +42 -0
- package/src/components/RebaseCMS.tsx +22 -0
- package/src/components/RebaseLayout.tsx +73 -0
- package/src/components/RebaseNavigation.tsx +197 -0
- package/src/components/RebaseRouteDefs.tsx +127 -0
- package/src/components/RebaseShell.tsx +70 -0
- package/src/components/ReferenceTable/EntitySelectionTable.tsx +358 -0
- package/src/components/ReferenceWidget.tsx +155 -0
- package/src/components/RelationSelector.tsx +612 -0
- package/src/components/SearchIconsView.tsx +80 -0
- package/src/components/SelectableTable/SelectableTable.tsx +340 -0
- package/src/components/SelectableTable/SelectableTableContext.tsx +6 -0
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +51 -0
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +125 -0
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +208 -0
- package/src/components/SelectableTable/filters/RelationFilterField.tsx +138 -0
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +224 -0
- package/src/components/SideDialogs.tsx +207 -0
- package/src/components/SideEntityProvider.tsx +76 -0
- package/src/components/admin/RoleChip.tsx +23 -0
- package/src/components/admin/RolesView.tsx +424 -0
- package/src/components/admin/UsersView.tsx +707 -0
- package/src/components/admin/index.ts +3 -0
- package/src/components/app/AppBar.tsx +17 -0
- package/src/components/app/Drawer.tsx +30 -0
- package/src/components/app/Scaffold.tsx +239 -0
- package/src/components/app/index.ts +4 -0
- package/src/components/app/useApp.tsx +36 -0
- package/src/components/common/default_entity_actions.tsx +155 -0
- package/src/components/common/index.ts +1 -0
- package/src/components/field_configs.tsx +442 -0
- package/src/components/history/EntityHistoryEntry.tsx +175 -0
- package/src/components/history/EntityHistoryView.tsx +197 -0
- package/src/components/history/LastEditedByFormAction.tsx +24 -0
- package/src/components/history/LastEditedByIndicator.tsx +98 -0
- package/src/components/history/UserChip.tsx +15 -0
- package/src/components/history/index.tsx +5 -0
- package/src/components/index.ts +52 -0
- package/src/contexts/BreacrumbsContext.tsx +45 -0
- package/src/contexts/SideDialogsControllerContext.tsx +5 -0
- package/src/contexts/SideEntityControllerContext.tsx +5 -0
- package/src/data_export/export/BasicExportAction.tsx +152 -0
- package/src/data_export/export/ExportCollectionAction.tsx +275 -0
- package/src/data_export/export/export.ts +244 -0
- package/src/data_export/export/index.ts +3 -0
- package/src/data_export/index.ts +1 -0
- package/src/data_import/components/DataNewPropertiesMapping.tsx +243 -0
- package/src/data_import/components/ImportFileUpload.tsx +42 -0
- package/src/data_import/components/ImportNewPropertyFieldPreview.tsx +59 -0
- package/src/data_import/components/ImportSaveInProgress.tsx +121 -0
- package/src/data_import/components/index.ts +4 -0
- package/src/data_import/hooks/index.ts +1 -0
- package/src/data_import/hooks/useImportConfig.tsx +34 -0
- package/src/data_import/import/ImportCollectionAction.tsx +448 -0
- package/src/data_import/import/index.ts +1 -0
- package/src/data_import/index.ts +5 -0
- package/src/data_import/types/column_mapping.ts +32 -0
- package/src/data_import/types/index.ts +1 -0
- package/src/data_import/utils/data.ts +145 -0
- package/src/data_import/utils/file_headers.ts +90 -0
- package/src/data_import/utils/file_to_json.ts +106 -0
- package/src/data_import/utils/get_import_inference_type.ts +27 -0
- package/src/data_import/utils/get_properties_mapping.ts +67 -0
- package/src/data_import/utils/index.ts +3 -0
- package/src/editor/components/SlashCommandMenu.tsx +516 -0
- package/src/editor/components/editor-bubble-item.tsx +32 -0
- package/src/editor/components/editor-bubble.tsx +118 -0
- package/src/editor/components/image-bubble.tsx +158 -0
- package/src/editor/components/index.ts +14 -0
- package/src/editor/components/table-bubble.tsx +167 -0
- package/src/editor/editor.tsx +455 -0
- package/src/editor/extensions/HighlightDecorationExtension.ts +114 -0
- package/src/editor/extensions/Image/index.ts +133 -0
- package/src/editor/extensions/Image.ts +159 -0
- package/src/editor/extensions/TextLoadingDecorationExtension.tsx +107 -0
- package/src/editor/extensions/clipboard.ts +72 -0
- package/src/editor/extensions/custom-keymap.ts +25 -0
- package/src/editor/extensions/drag-and-drop.tsx +492 -0
- package/src/editor/hooks/useProseMirror.ts +124 -0
- package/src/editor/hooks/useProseMirrorContext.ts +15 -0
- package/src/editor/index.ts +2 -0
- package/src/editor/markdown.ts +172 -0
- package/src/editor/nodeViews/ImageComponent.tsx +20 -0
- package/src/editor/nodeViews/ReactNodeView.tsx +89 -0
- package/src/editor/nodeViews/TaskItemComponent.tsx +29 -0
- package/src/editor/nodeViews/index.ts +35 -0
- package/src/editor/plugins/index.ts +58 -0
- package/src/editor/plugins/inputrules.ts +82 -0
- package/src/editor/plugins/placeholderPlugin.ts +55 -0
- package/src/editor/plugins/slashCommandPlugin.ts +61 -0
- package/src/editor/schema.ts +240 -0
- package/src/editor/selectors/ai-selector.tsx +111 -0
- package/src/editor/selectors/color-selector.tsx +200 -0
- package/src/editor/selectors/link-selector.tsx +118 -0
- package/src/editor/selectors/node-selector.tsx +157 -0
- package/src/editor/selectors/text-buttons.tsx +86 -0
- package/src/editor/types.ts +6 -0
- package/src/editor/useProseMirror.ts +126 -0
- package/src/editor/utils/prosemirror-utils.ts +113 -0
- package/src/editor/utils/remove_classes.ts +17 -0
- package/src/editor/utils/useDebouncedCallback.ts +25 -0
- package/src/form/EntityForm.tsx +800 -0
- package/src/form/EntityFormActions.tsx +204 -0
- package/src/form/PropertyFieldBinding.tsx +344 -0
- package/src/form/components/ErrorFocus.tsx +44 -0
- package/src/form/components/FieldHelperText.tsx +45 -0
- package/src/form/components/FormEntry.tsx +22 -0
- package/src/form/components/FormLayout.tsx +16 -0
- package/src/form/components/LabelWithIcon.tsx +43 -0
- package/src/form/components/LabelWithIconAndTooltip.tsx +28 -0
- package/src/form/components/LocalChangesMenu.tsx +145 -0
- package/src/form/components/StorageItemPreview.tsx +81 -0
- package/src/form/components/StorageUploadProgress.tsx +105 -0
- package/src/form/components/index.tsx +5 -0
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +107 -0
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +169 -0
- package/src/form/field_bindings/BlockFieldBinding.tsx +274 -0
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +72 -0
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +567 -0
- package/src/form/field_bindings/MapFieldBinding.tsx +162 -0
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +142 -0
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +122 -0
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +155 -0
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +66 -0
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +140 -0
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +140 -0
- package/src/form/field_bindings/RelationFieldBinding.tsx +183 -0
- package/src/form/field_bindings/RepeatFieldBinding.tsx +139 -0
- package/src/form/field_bindings/SelectFieldBinding.tsx +109 -0
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +493 -0
- package/src/form/field_bindings/SwitchFieldBinding.tsx +65 -0
- package/src/form/field_bindings/TextFieldBinding.tsx +155 -0
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +98 -0
- package/src/form/index.tsx +27 -0
- package/src/form/useClearRestoreValue.tsx +36 -0
- package/src/form/validation.ts +592 -0
- package/src/hooks/index.ts +15 -0
- package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +20 -0
- package/src/hooks/navigation/contexts/NavigationStateContext.tsx +16 -0
- package/src/hooks/navigation/contexts/UrlContext.tsx +25 -0
- package/src/hooks/navigation/contexts/index.ts +14 -0
- package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +155 -0
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +123 -0
- package/src/hooks/navigation/useBuildUrlController.tsx +66 -0
- package/src/hooks/navigation/useNavigationRegistry.ts +146 -0
- package/src/hooks/navigation/useNavigationResolution.ts +130 -0
- package/src/hooks/navigation/useNavigationURLs.ts +56 -0
- package/src/hooks/navigation/useResolvedCollections.ts +133 -0
- package/src/hooks/navigation/useResolvedViews.tsx +197 -0
- package/src/hooks/navigation/useTopLevelNavigation.ts +257 -0
- package/src/hooks/navigation/utils.ts +171 -0
- package/src/hooks/useBreadcrumbsController.tsx +49 -0
- package/src/hooks/useBuildSideDialogsController.tsx +145 -0
- package/src/hooks/useBuildSideEntityController.tsx +309 -0
- package/src/hooks/useCMSContext.tsx +77 -0
- package/src/hooks/useEntityHistory.ts +168 -0
- package/src/hooks/useEntitySelectionDialog.tsx +57 -0
- package/src/hooks/useResolvedNavigationFrom.tsx +155 -0
- package/src/hooks/useSideDialogsController.tsx +25 -0
- package/src/hooks/useSideEntityController.tsx +13 -0
- package/src/index.ts +95 -0
- package/src/preview/PropertyPreview.tsx +291 -0
- package/src/preview/components/ArrayEnumPreview.tsx +39 -0
- package/src/preview/components/BooleanPreview.tsx +25 -0
- package/src/preview/components/DatePreview.tsx +93 -0
- package/src/preview/components/EmptyValue.tsx +10 -0
- package/src/preview/components/EnumValuesChip.tsx +39 -0
- package/src/preview/components/ImagePreview.tsx +142 -0
- package/src/preview/components/ReferencePreview.tsx +166 -0
- package/src/preview/components/RelationPreview.tsx +158 -0
- package/src/preview/components/StorageThumbnail.tsx +90 -0
- package/src/preview/components/UrlComponentPreview.tsx +114 -0
- package/src/preview/components/UserPreview.tsx +29 -0
- package/src/preview/index.ts +25 -0
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +73 -0
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +44 -0
- package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +50 -0
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +49 -0
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +44 -0
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +68 -0
- package/src/preview/property_previews/ArrayPropertyEnumPreview.tsx +35 -0
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +70 -0
- package/src/preview/property_previews/MapPropertyPreview.tsx +146 -0
- package/src/preview/property_previews/NumberPropertyPreview.tsx +29 -0
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +277 -0
- package/src/preview/property_previews/StringPropertyPreview.tsx +59 -0
- package/src/preview/util.ts +30 -0
- package/src/routes/CustomViewRoute.tsx +24 -0
- package/src/routes/RebaseRoute.tsx +265 -0
- package/src/routes/index.ts +2 -0
- package/src/types/components/EntityFormActionsProps.tsx +20 -0
- package/src/types/components/EntityFormProps.tsx +54 -0
- package/src/types/components/PropertyPreviewProps.tsx +59 -0
- package/src/types/components/formex.tsx +46 -0
- package/src/types/components/index.ts +3 -0
- package/src/types/fields.tsx +299 -0
- package/src/types/index.ts +4 -0
- package/src/util/entity_actions.ts +28 -0
- package/src/util/index.ts +5 -0
- package/src/util/navigation_utils.ts +223 -0
- package/src/util/previews.ts +50 -0
- package/src/util/property_utils.tsx +215 -0
- package/src/util/resolutions.ts +69 -0
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ArrayProperty, Entity, EntityReference, EntityRelation, NumberProperty, Property, StringProperty } from "@rebasepro/types";
|
|
3
|
+
|
|
4
|
+
import { VirtualTableInput } from "./fields/VirtualTableInput";
|
|
5
|
+
import { VirtualTableSelect } from "./fields/VirtualTableSelect";
|
|
6
|
+
import { VirtualTableNumberInput } from "./fields/VirtualTableNumberInput";
|
|
7
|
+
import { VirtualTableSwitch } from "./fields/VirtualTableSwitch";
|
|
8
|
+
import { VirtualTableDateField } from "./fields/VirtualTableDateField";
|
|
9
|
+
import { VirtualTableUserSelect } from "./fields/VirtualTableUserSelect";
|
|
10
|
+
import { TableStorageUpload } from "./fields/TableStorageUpload";
|
|
11
|
+
import { TableReferenceField } from "./fields/TableReferenceField";
|
|
12
|
+
import { TableRelationField } from "./fields/TableRelationField";
|
|
13
|
+
import { TableRelationSelectorField } from "./fields/TableRelationSelectorField";
|
|
14
|
+
|
|
15
|
+
import { getPreviewSizeFrom } from "../../preview/util";
|
|
16
|
+
|
|
17
|
+
export interface TableFieldBindingProps<T = any> {
|
|
18
|
+
propertyKey: string;
|
|
19
|
+
property: Property;
|
|
20
|
+
internalValue: T;
|
|
21
|
+
updateValue: (newValue: T | null) => void;
|
|
22
|
+
error?: Error;
|
|
23
|
+
validationError?: Error;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
selected: boolean;
|
|
26
|
+
size: any;
|
|
27
|
+
align: "left" | "center" | "right";
|
|
28
|
+
entity: Entity<any>;
|
|
29
|
+
path: string;
|
|
30
|
+
openPopup?: (cellRect: DOMRect | undefined) => void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface TableFieldConfig {
|
|
34
|
+
Component: React.ComponentType<TableFieldBindingProps>;
|
|
35
|
+
fullHeight?: boolean;
|
|
36
|
+
allowScroll?: boolean;
|
|
37
|
+
removePadding?: boolean;
|
|
38
|
+
showExpandIcon?: boolean;
|
|
39
|
+
hideOverflow?: boolean;
|
|
40
|
+
includeActions?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function isStorageProperty(property: Property) {
|
|
44
|
+
if (property.type === "string" && property.markdown)
|
|
45
|
+
return false;
|
|
46
|
+
if (property.type === "string" && (property as StringProperty).storage)
|
|
47
|
+
return true;
|
|
48
|
+
if (property.type === "array") {
|
|
49
|
+
if (Array.isArray(property.of)) {
|
|
50
|
+
return false;
|
|
51
|
+
} else {
|
|
52
|
+
return ((property as ArrayProperty).of as Property)?.type === "string" &&
|
|
53
|
+
((property as ArrayProperty).of as StringProperty)?.storage
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function getTableBindingForProperty(
|
|
60
|
+
property: Property,
|
|
61
|
+
selected: boolean
|
|
62
|
+
): TableFieldConfig | undefined {
|
|
63
|
+
const isAStorageProperty = isStorageProperty(property);
|
|
64
|
+
|
|
65
|
+
if (property.type === "string" && (property as StringProperty).reference?.path) {
|
|
66
|
+
return {
|
|
67
|
+
Component: ({ propertyKey, property, internalValue, updateValue, disabled, size, path }) => {
|
|
68
|
+
const referenceProperty = (property as StringProperty).reference as any;
|
|
69
|
+
const referenceValue = internalValue ? new EntityReference({ id: internalValue as string, path: referenceProperty.path as string }) : undefined;
|
|
70
|
+
return (
|
|
71
|
+
<TableReferenceField
|
|
72
|
+
name={propertyKey}
|
|
73
|
+
internalValue={referenceValue}
|
|
74
|
+
updateValue={(v) => updateValue(v ? (v as EntityReference).id : null)}
|
|
75
|
+
disabled={disabled}
|
|
76
|
+
size={size}
|
|
77
|
+
path={referenceProperty.path as string}
|
|
78
|
+
multiselect={false}
|
|
79
|
+
previewProperties={referenceProperty.previewProperties}
|
|
80
|
+
includeId={referenceProperty.includeId}
|
|
81
|
+
includeEntityLink={referenceProperty.includeEntityLink}
|
|
82
|
+
title={property.name}
|
|
83
|
+
forceFilter={referenceProperty.forceFilter}
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
},
|
|
87
|
+
allowScroll: false
|
|
88
|
+
};
|
|
89
|
+
} else if (isAStorageProperty) {
|
|
90
|
+
return {
|
|
91
|
+
Component: ({ validationError, error, disabled, selected, openPopup, property, entity, path, internalValue, size, updateValue, propertyKey }: any) => (
|
|
92
|
+
<TableStorageUpload
|
|
93
|
+
error={validationError ?? error}
|
|
94
|
+
disabled={disabled}
|
|
95
|
+
focused={selected}
|
|
96
|
+
selected={selected}
|
|
97
|
+
openPopup={openPopup}
|
|
98
|
+
property={property as any}
|
|
99
|
+
entity={entity}
|
|
100
|
+
path={path}
|
|
101
|
+
value={internalValue}
|
|
102
|
+
previewSize={getPreviewSizeFrom(size)}
|
|
103
|
+
updateValue={updateValue}
|
|
104
|
+
propertyKey={propertyKey}
|
|
105
|
+
/>
|
|
106
|
+
),
|
|
107
|
+
includeActions: false,
|
|
108
|
+
showExpandIcon: true,
|
|
109
|
+
fullHeight: true,
|
|
110
|
+
removePadding: true
|
|
111
|
+
};
|
|
112
|
+
} else if (selected && property.type === "number") {
|
|
113
|
+
const numberProperty = property as NumberProperty;
|
|
114
|
+
if (numberProperty.enum) {
|
|
115
|
+
return {
|
|
116
|
+
Component: ({ propertyKey, disabled, selected, size, error, validationError, internalValue, updateValue }: any) => (
|
|
117
|
+
<VirtualTableSelect
|
|
118
|
+
name={propertyKey}
|
|
119
|
+
multiple={false}
|
|
120
|
+
disabled={disabled}
|
|
121
|
+
focused={selected}
|
|
122
|
+
valueType={"number"}
|
|
123
|
+
small={getPreviewSizeFrom(size) !== "medium"}
|
|
124
|
+
enumValues={numberProperty.enum!}
|
|
125
|
+
error={validationError ?? error}
|
|
126
|
+
internalValue={internalValue as string | number}
|
|
127
|
+
updateValue={updateValue}
|
|
128
|
+
/>
|
|
129
|
+
),
|
|
130
|
+
fullHeight: true
|
|
131
|
+
};
|
|
132
|
+
} else {
|
|
133
|
+
return {
|
|
134
|
+
Component: ({ align, error, validationError, selected, disabled, internalValue, updateValue }: any) => (
|
|
135
|
+
<VirtualTableNumberInput
|
|
136
|
+
align={align}
|
|
137
|
+
error={validationError ?? error}
|
|
138
|
+
focused={selected}
|
|
139
|
+
disabled={disabled}
|
|
140
|
+
value={internalValue as number}
|
|
141
|
+
updateValue={updateValue}
|
|
142
|
+
/>
|
|
143
|
+
),
|
|
144
|
+
allowScroll: true
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
} else if (selected && property.type === "string") {
|
|
148
|
+
const stringProperty = property as StringProperty;
|
|
149
|
+
if (stringProperty.enum) {
|
|
150
|
+
return {
|
|
151
|
+
Component: ({ propertyKey, disabled, selected, size, error, validationError, internalValue, updateValue }: any) => (
|
|
152
|
+
<VirtualTableSelect
|
|
153
|
+
name={propertyKey}
|
|
154
|
+
multiple={false}
|
|
155
|
+
focused={selected}
|
|
156
|
+
disabled={disabled}
|
|
157
|
+
valueType={"string"}
|
|
158
|
+
small={getPreviewSizeFrom(size) !== "medium"}
|
|
159
|
+
enumValues={stringProperty.enum!}
|
|
160
|
+
error={validationError ?? error}
|
|
161
|
+
internalValue={internalValue as string | number}
|
|
162
|
+
updateValue={updateValue}
|
|
163
|
+
/>
|
|
164
|
+
),
|
|
165
|
+
fullHeight: true
|
|
166
|
+
};
|
|
167
|
+
} else if (stringProperty.userSelect) {
|
|
168
|
+
return {
|
|
169
|
+
Component: ({ propertyKey, disabled, selected, size, error, validationError, internalValue, updateValue }: any) => (
|
|
170
|
+
<VirtualTableUserSelect
|
|
171
|
+
name={propertyKey}
|
|
172
|
+
multiple={false}
|
|
173
|
+
focused={selected}
|
|
174
|
+
disabled={disabled}
|
|
175
|
+
small={getPreviewSizeFrom(size) !== "medium"}
|
|
176
|
+
error={validationError ?? error}
|
|
177
|
+
internalValue={internalValue as string}
|
|
178
|
+
updateValue={updateValue}
|
|
179
|
+
/>
|
|
180
|
+
),
|
|
181
|
+
fullHeight: true
|
|
182
|
+
};
|
|
183
|
+
} else if (stringProperty.markdown || !stringProperty.storage || !stringProperty.reference) {
|
|
184
|
+
const multiline = Boolean(stringProperty.multiline) || Boolean(stringProperty.markdown);
|
|
185
|
+
return {
|
|
186
|
+
Component: ({ error, validationError, disabled, selected, internalValue, updateValue }: any) => (
|
|
187
|
+
<VirtualTableInput
|
|
188
|
+
error={validationError ?? error}
|
|
189
|
+
disabled={disabled}
|
|
190
|
+
multiline={multiline}
|
|
191
|
+
focused={selected}
|
|
192
|
+
value={internalValue as string}
|
|
193
|
+
updateValue={updateValue}
|
|
194
|
+
/>
|
|
195
|
+
),
|
|
196
|
+
allowScroll: true
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
} else if (property.type === "boolean") {
|
|
200
|
+
return {
|
|
201
|
+
Component: ({ error, validationError, disabled, selected, internalValue, updateValue }: any) => (
|
|
202
|
+
<VirtualTableSwitch
|
|
203
|
+
error={validationError ?? error}
|
|
204
|
+
disabled={disabled}
|
|
205
|
+
focused={selected}
|
|
206
|
+
internalValue={internalValue as boolean}
|
|
207
|
+
updateValue={updateValue}
|
|
208
|
+
/>
|
|
209
|
+
)
|
|
210
|
+
};
|
|
211
|
+
} else if (property.type === "date") {
|
|
212
|
+
return {
|
|
213
|
+
Component: ({ propertyKey, error, validationError, disabled, selected, property, internalValue, updateValue }: any) => (
|
|
214
|
+
<VirtualTableDateField
|
|
215
|
+
name={propertyKey}
|
|
216
|
+
error={validationError ?? error}
|
|
217
|
+
disabled={disabled}
|
|
218
|
+
mode={property.mode}
|
|
219
|
+
focused={selected}
|
|
220
|
+
internalValue={internalValue as Date}
|
|
221
|
+
updateValue={updateValue}
|
|
222
|
+
/>
|
|
223
|
+
),
|
|
224
|
+
fullHeight: true,
|
|
225
|
+
hideOverflow: false,
|
|
226
|
+
allowScroll: false
|
|
227
|
+
};
|
|
228
|
+
} else if (property.type === "reference") {
|
|
229
|
+
if (typeof property.path === "string") {
|
|
230
|
+
return {
|
|
231
|
+
Component: ({ propertyKey, internalValue, updateValue, disabled, size, property }: any) => (
|
|
232
|
+
<TableReferenceField
|
|
233
|
+
name={propertyKey}
|
|
234
|
+
internalValue={internalValue as EntityReference}
|
|
235
|
+
updateValue={updateValue}
|
|
236
|
+
disabled={disabled}
|
|
237
|
+
size={size}
|
|
238
|
+
path={property.path}
|
|
239
|
+
multiselect={false}
|
|
240
|
+
previewProperties={property.previewProperties}
|
|
241
|
+
includeId={property.includeId}
|
|
242
|
+
includeEntityLink={property.includeEntityLink}
|
|
243
|
+
title={property.name ?? propertyKey}
|
|
244
|
+
forceFilter={property.forceFilter}
|
|
245
|
+
/>
|
|
246
|
+
),
|
|
247
|
+
allowScroll: false
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
} else if (property.type === "relation") {
|
|
251
|
+
if (property.relation) {
|
|
252
|
+
if (property.widget === "dialog") {
|
|
253
|
+
return {
|
|
254
|
+
Component: ({ propertyKey, internalValue, updateValue, disabled, size, property }: any) => (
|
|
255
|
+
<TableRelationField
|
|
256
|
+
name={propertyKey}
|
|
257
|
+
internalValue={internalValue as EntityRelation}
|
|
258
|
+
updateValue={updateValue}
|
|
259
|
+
disabled={disabled}
|
|
260
|
+
size={size}
|
|
261
|
+
multiselect={false}
|
|
262
|
+
relation={property.relation}
|
|
263
|
+
previewProperties={property.previewProperties}
|
|
264
|
+
includeId={property.includeId}
|
|
265
|
+
includeEntityLink={property.includeEntityLink}
|
|
266
|
+
title={property.name ?? propertyKey}
|
|
267
|
+
forceFilter={property.forceFilter}
|
|
268
|
+
/>
|
|
269
|
+
),
|
|
270
|
+
allowScroll: false
|
|
271
|
+
};
|
|
272
|
+
} else {
|
|
273
|
+
return {
|
|
274
|
+
Component: ({ propertyKey, internalValue, updateValue, disabled, property }: any) => (
|
|
275
|
+
<TableRelationSelectorField
|
|
276
|
+
name={propertyKey}
|
|
277
|
+
internalValue={internalValue as EntityRelation}
|
|
278
|
+
updateValue={updateValue}
|
|
279
|
+
disabled={disabled}
|
|
280
|
+
size={"small"}
|
|
281
|
+
relation={property.relation!}
|
|
282
|
+
forceFilter={property.forceFilter}
|
|
283
|
+
/>
|
|
284
|
+
),
|
|
285
|
+
allowScroll: false
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
} else if (property.type === "array") {
|
|
290
|
+
const arrayProperty = (property as ArrayProperty);
|
|
291
|
+
|
|
292
|
+
if (!arrayProperty.of && !arrayProperty.oneOf) {
|
|
293
|
+
throw Error(`You need to specify an 'of' or 'oneOf' prop (or specify a custom field) in your array property`);
|
|
294
|
+
} else if (arrayProperty.of && !Array.isArray(arrayProperty.of)) {
|
|
295
|
+
const ofProp = arrayProperty.of as any;
|
|
296
|
+
if (ofProp.type === "string" || ofProp.type === "number") {
|
|
297
|
+
if (selected && ofProp.enum) {
|
|
298
|
+
return {
|
|
299
|
+
Component: ({ propertyKey, disabled, selected, size, error, validationError, internalValue, updateValue }: any) => (
|
|
300
|
+
<VirtualTableSelect
|
|
301
|
+
name={propertyKey}
|
|
302
|
+
multiple={true}
|
|
303
|
+
disabled={disabled}
|
|
304
|
+
focused={selected}
|
|
305
|
+
small={getPreviewSizeFrom(size) !== "medium"}
|
|
306
|
+
valueType={ofProp.type}
|
|
307
|
+
enumValues={ofProp.enum}
|
|
308
|
+
error={validationError ?? error}
|
|
309
|
+
internalValue={internalValue as string | number}
|
|
310
|
+
updateValue={updateValue}
|
|
311
|
+
/>
|
|
312
|
+
),
|
|
313
|
+
allowScroll: true,
|
|
314
|
+
fullHeight: true,
|
|
315
|
+
hideOverflow: false
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
} else if (ofProp.type === "reference") {
|
|
319
|
+
if (typeof ofProp.path === "string") {
|
|
320
|
+
return {
|
|
321
|
+
Component: ({ propertyKey, disabled, internalValue, updateValue, size }: any) => (
|
|
322
|
+
<TableReferenceField
|
|
323
|
+
name={propertyKey}
|
|
324
|
+
disabled={disabled}
|
|
325
|
+
internalValue={internalValue as EntityReference[]}
|
|
326
|
+
updateValue={updateValue}
|
|
327
|
+
size={size}
|
|
328
|
+
multiselect={true}
|
|
329
|
+
path={ofProp.path}
|
|
330
|
+
previewProperties={ofProp.previewProperties}
|
|
331
|
+
title={arrayProperty.name}
|
|
332
|
+
forceFilter={ofProp.forceFilter}
|
|
333
|
+
includeId={ofProp.includeId}
|
|
334
|
+
includeEntityLink={ofProp.includeEntityLink}
|
|
335
|
+
/>
|
|
336
|
+
),
|
|
337
|
+
allowScroll: false
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
return undefined;
|
|
345
|
+
}
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
DndContext,
|
|
4
|
+
DragEndEvent,
|
|
5
|
+
DragOverEvent,
|
|
6
|
+
DragOverlay,
|
|
7
|
+
DragStartEvent,
|
|
8
|
+
PointerSensor,
|
|
9
|
+
pointerWithin,
|
|
10
|
+
useSensor,
|
|
11
|
+
useSensors
|
|
12
|
+
} from "@dnd-kit/core";
|
|
13
|
+
import { arrayMove, horizontalListSortingStrategy, SortableContext } from "@dnd-kit/sortable";
|
|
14
|
+
import { BoardColumn } from "./BoardColumn";
|
|
15
|
+
import { BoardItem, BoardItemMap, BoardItemViewProps, BoardProps } from "./board_types";
|
|
16
|
+
import { cls } from "@rebasepro/ui";
|
|
17
|
+
|
|
18
|
+
export function Board<M extends Record<string, unknown>, COLUMN extends string>({
|
|
19
|
+
data,
|
|
20
|
+
columns: columnsProp,
|
|
21
|
+
columnLabels,
|
|
22
|
+
columnColors,
|
|
23
|
+
className,
|
|
24
|
+
assignColumn,
|
|
25
|
+
allowColumnReorder = false,
|
|
26
|
+
onColumnReorder,
|
|
27
|
+
onItemsReorder,
|
|
28
|
+
ItemComponent,
|
|
29
|
+
columnLoadingState,
|
|
30
|
+
onLoadMoreColumn,
|
|
31
|
+
onAddItemToColumn,
|
|
32
|
+
AddColumnComponent,
|
|
33
|
+
}: BoardProps<M, COLUMN>) {
|
|
34
|
+
|
|
35
|
+
const [activeItem, setActiveItem] = useState<BoardItem<M> | null>(null);
|
|
36
|
+
const [activeColumn, setActiveColumn] = useState<COLUMN | null>(null);
|
|
37
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
38
|
+
const [dragOverColumnId, setDragOverColumnId] = useState<string | null>(null);
|
|
39
|
+
const [itemMapState, setItemMapState] = useState<BoardItemMap<M>>(() => {
|
|
40
|
+
const dataColumnMap: Record<string, COLUMN> = data.reduce((prev, item: BoardItem<M>) => ({
|
|
41
|
+
...prev,
|
|
42
|
+
[item.id]: assignColumn(item)
|
|
43
|
+
}), {});
|
|
44
|
+
return columnsProp.reduce(
|
|
45
|
+
(previous: BoardItemMap<M>, column: COLUMN) => ({
|
|
46
|
+
...previous,
|
|
47
|
+
[column]: data.filter((item: BoardItem<M>) => dataColumnMap[item.id] === column)
|
|
48
|
+
}),
|
|
49
|
+
{}
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const sensors = useSensors(
|
|
54
|
+
useSensor(PointerSensor, {
|
|
55
|
+
activationConstraint: {
|
|
56
|
+
distance: 5,
|
|
57
|
+
},
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
const dataColumnMap: Record<string, COLUMN> = data.reduce((prev, item) => ({
|
|
63
|
+
...prev,
|
|
64
|
+
[item.id]: assignColumn(item)
|
|
65
|
+
}), {});
|
|
66
|
+
|
|
67
|
+
setItemMapState(() => columnsProp.reduce(
|
|
68
|
+
(previous: BoardItemMap<M>, column: COLUMN) => ({
|
|
69
|
+
...previous,
|
|
70
|
+
[column]: data.filter((item: BoardItem<M>) => dataColumnMap[item.id] === column)
|
|
71
|
+
}),
|
|
72
|
+
{}
|
|
73
|
+
));
|
|
74
|
+
}, [data, columnsProp, assignColumn]);
|
|
75
|
+
|
|
76
|
+
const findColumnByItemId = (id: string): string | undefined => {
|
|
77
|
+
return Object.keys(itemMapState).find(col => itemMapState[col]?.some(i => i.id === id));
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const handleDragStart = (event: DragStartEvent) => {
|
|
81
|
+
setIsDragging(true);
|
|
82
|
+
setDragOverColumnId(null);
|
|
83
|
+
const { active } = event;
|
|
84
|
+
|
|
85
|
+
if (active.data.current?.type === "COLUMN") {
|
|
86
|
+
const columnId = active.id as string;
|
|
87
|
+
const column = columnsProp.find(col => String(col) === columnId);
|
|
88
|
+
if (column) {
|
|
89
|
+
setActiveColumn(column);
|
|
90
|
+
}
|
|
91
|
+
} else if (active.data.current?.type === "ITEM") {
|
|
92
|
+
const columnId = findColumnByItemId(active.id as string);
|
|
93
|
+
if (columnId) {
|
|
94
|
+
const item = itemMapState[columnId]?.find(i => i.id === active.id);
|
|
95
|
+
setActiveItem(item || null);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const handleDragOver = (event: DragOverEvent) => {
|
|
101
|
+
const {
|
|
102
|
+
active,
|
|
103
|
+
over
|
|
104
|
+
} = event;
|
|
105
|
+
|
|
106
|
+
if (!over) {
|
|
107
|
+
setDragOverColumnId(null);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
let currentHoveredColumnId: string | null = null;
|
|
112
|
+
const overId = over.id as string;
|
|
113
|
+
const overDataType = over.data.current?.type as string | undefined;
|
|
114
|
+
|
|
115
|
+
if (overDataType === "ITEM-LIST" || overDataType === "COLUMN") {
|
|
116
|
+
currentHoveredColumnId = overId;
|
|
117
|
+
} else if (overDataType === "ITEM") {
|
|
118
|
+
currentHoveredColumnId = findColumnByItemId(overId) || null;
|
|
119
|
+
} else if (columnsProp.includes(overId as COLUMN)) {
|
|
120
|
+
currentHoveredColumnId = overId;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
setDragOverColumnId(currentHoveredColumnId);
|
|
124
|
+
|
|
125
|
+
// Skip item reordering if dragging a column
|
|
126
|
+
if (active.data.current?.type !== "ITEM") {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const activeId = active.id as string;
|
|
131
|
+
const activeColumn = findColumnByItemId(activeId);
|
|
132
|
+
let overColumnForMove = findColumnByItemId(overId);
|
|
133
|
+
|
|
134
|
+
if (!overColumnForMove && overDataType === "ITEM-LIST") {
|
|
135
|
+
overColumnForMove = overId;
|
|
136
|
+
}
|
|
137
|
+
if (!overColumnForMove && columnsProp.includes(overId as COLUMN)) {
|
|
138
|
+
overColumnForMove = overId;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (!activeColumn || !overColumnForMove) return;
|
|
142
|
+
if (activeColumn === overColumnForMove && activeId === overId && overDataType !== "ITEM-LIST") return;
|
|
143
|
+
|
|
144
|
+
// Prevent moving to a column if item with same ID already exists there
|
|
145
|
+
if (overColumnForMove !== activeColumn &&
|
|
146
|
+
itemMapState[overColumnForMove]?.some(i => i.id === activeId)) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
setItemMapState(currentMap => {
|
|
151
|
+
const activeItems = [...(currentMap[activeColumn] || [])];
|
|
152
|
+
const overItems = [...(currentMap[overColumnForMove!] || [])];
|
|
153
|
+
const activeIndex = activeItems.findIndex(i => i.id === activeId);
|
|
154
|
+
|
|
155
|
+
if (activeIndex === -1) return currentMap;
|
|
156
|
+
|
|
157
|
+
let overIndex;
|
|
158
|
+
if (overDataType === "ITEM-LIST" || (columnsProp.includes(overId as COLUMN) && !findColumnByItemId(overId))) {
|
|
159
|
+
overIndex = overItems.length;
|
|
160
|
+
} else {
|
|
161
|
+
overIndex = overItems.findIndex(i => i.id === overId);
|
|
162
|
+
if (overIndex !== -1) {
|
|
163
|
+
const { y } = event.delta;
|
|
164
|
+
const overRect = over.rect;
|
|
165
|
+
if (overRect) {
|
|
166
|
+
const threshold = overRect.height / 2;
|
|
167
|
+
if (y > threshold) {
|
|
168
|
+
overIndex += 1;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
} else {
|
|
172
|
+
overIndex = overItems.length;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (activeColumn === overColumnForMove && activeIndex === overIndex) return currentMap;
|
|
177
|
+
|
|
178
|
+
const newItemMap = { ...currentMap };
|
|
179
|
+
if (activeColumn === overColumnForMove) {
|
|
180
|
+
newItemMap[activeColumn] = arrayMove(activeItems, activeIndex, overIndex);
|
|
181
|
+
} else {
|
|
182
|
+
const [moved] = activeItems.splice(activeIndex, 1);
|
|
183
|
+
overItems.splice(overIndex, 0, moved);
|
|
184
|
+
newItemMap[activeColumn] = activeItems;
|
|
185
|
+
newItemMap[overColumnForMove] = overItems;
|
|
186
|
+
}
|
|
187
|
+
return newItemMap;
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
const handleDragEnd = (event: DragEndEvent) => {
|
|
192
|
+
const {
|
|
193
|
+
active,
|
|
194
|
+
over
|
|
195
|
+
} = event;
|
|
196
|
+
|
|
197
|
+
setIsDragging(false);
|
|
198
|
+
setActiveItem(null);
|
|
199
|
+
setActiveColumn(null);
|
|
200
|
+
setDragOverColumnId(null);
|
|
201
|
+
|
|
202
|
+
if (!over) return;
|
|
203
|
+
|
|
204
|
+
const activeId = active.id as string;
|
|
205
|
+
const overId = over.id as string;
|
|
206
|
+
|
|
207
|
+
if (active.data.current?.type === "COLUMN" &&
|
|
208
|
+
over.data.current?.type === "COLUMN" &&
|
|
209
|
+
activeId !== overId) {
|
|
210
|
+
|
|
211
|
+
const oldIndex = columnsProp.findIndex(col => String(col) === activeId);
|
|
212
|
+
const newIndex = columnsProp.findIndex(col => String(col) === overId);
|
|
213
|
+
|
|
214
|
+
if (oldIndex !== -1 && newIndex !== -1 && onColumnReorder && allowColumnReorder) {
|
|
215
|
+
const newOrder = arrayMove([...columnsProp], oldIndex, newIndex);
|
|
216
|
+
onColumnReorder(newOrder);
|
|
217
|
+
}
|
|
218
|
+
} else if (active.data.current?.type === "ITEM" && onItemsReorder) {
|
|
219
|
+
// Find the original column assignment from the input data
|
|
220
|
+
const originalColumn = data.find(item => item.id === activeId)
|
|
221
|
+
? assignColumn(data.find(item => item.id === activeId)!)
|
|
222
|
+
: undefined;
|
|
223
|
+
|
|
224
|
+
// Find the current column assignment from our internal state
|
|
225
|
+
const currentColumn = findColumnByItemId(activeId) as COLUMN | undefined;
|
|
226
|
+
|
|
227
|
+
// When items have been reordered, convert itemMapState to a flat list
|
|
228
|
+
const allItems: BoardItem<M>[] = [];
|
|
229
|
+
|
|
230
|
+
// Collect all items from all columns in their current order
|
|
231
|
+
Object.entries(itemMapState).forEach(([, columnItems]) => {
|
|
232
|
+
if (columnItems && (columnItems as BoardItem<M>[]).length > 0) {
|
|
233
|
+
allItems.push(...(columnItems as BoardItem<M>[]));
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
// Notify parent component of the change, including column movement information
|
|
238
|
+
if (originalColumn !== currentColumn && originalColumn && currentColumn) {
|
|
239
|
+
// Item has moved between columns - provide this context to parent
|
|
240
|
+
onItemsReorder(allItems, {
|
|
241
|
+
itemId: activeId,
|
|
242
|
+
sourceColumn: originalColumn,
|
|
243
|
+
targetColumn: currentColumn
|
|
244
|
+
});
|
|
245
|
+
} else if (currentColumn) {
|
|
246
|
+
// Reordering within the same column - still need to provide moveInfo
|
|
247
|
+
onItemsReorder(allItems, {
|
|
248
|
+
itemId: activeId,
|
|
249
|
+
sourceColumn: currentColumn,
|
|
250
|
+
targetColumn: currentColumn
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
return (
|
|
257
|
+
<DndContext
|
|
258
|
+
sensors={sensors}
|
|
259
|
+
collisionDetection={pointerWithin}
|
|
260
|
+
onDragStart={handleDragStart}
|
|
261
|
+
onDragOver={handleDragOver}
|
|
262
|
+
onDragEnd={handleDragEnd}
|
|
263
|
+
>
|
|
264
|
+
<DragOverlay dropAnimation={{
|
|
265
|
+
duration: 300,
|
|
266
|
+
easing: "cubic-bezier(0.18, 0.67, 0.6, 1.22)",
|
|
267
|
+
}}>
|
|
268
|
+
{activeItem ? (
|
|
269
|
+
<ItemComponent
|
|
270
|
+
item={activeItem}
|
|
271
|
+
isDragging={true}
|
|
272
|
+
index={-1}
|
|
273
|
+
style={{
|
|
274
|
+
boxShadow: "0 4px 16px rgba(0,0,0,0.15)",
|
|
275
|
+
opacity: 0.9,
|
|
276
|
+
}}
|
|
277
|
+
/>
|
|
278
|
+
) : activeColumn ? (
|
|
279
|
+
<BoardColumn
|
|
280
|
+
key={String(activeColumn)}
|
|
281
|
+
index={-1}
|
|
282
|
+
id={String(activeColumn)}
|
|
283
|
+
title={columnLabels?.[activeColumn] ?? String(activeColumn)}
|
|
284
|
+
items={itemMapState[String(activeColumn)] || []}
|
|
285
|
+
ItemComponent={ItemComponent}
|
|
286
|
+
isDragging={true}
|
|
287
|
+
isDragOverColumn={false}
|
|
288
|
+
/>
|
|
289
|
+
) : null}
|
|
290
|
+
</DragOverlay>
|
|
291
|
+
|
|
292
|
+
<SortableContext
|
|
293
|
+
items={columnsProp.map(String)}
|
|
294
|
+
strategy={horizontalListSortingStrategy}
|
|
295
|
+
>
|
|
296
|
+
<div className={cls("p-2 md:p-3 lg:p-4 h-full min-w-full inline-flex", className)}>
|
|
297
|
+
{columnsProp.map((key: COLUMN, index: number) => (
|
|
298
|
+
<BoardColumn
|
|
299
|
+
key={String(key)}
|
|
300
|
+
index={index}
|
|
301
|
+
id={String(key)}
|
|
302
|
+
title={columnLabels?.[key] ?? String(key)}
|
|
303
|
+
color={columnColors?.[key]}
|
|
304
|
+
items={itemMapState[String(key)] || []}
|
|
305
|
+
ItemComponent={ItemComponent}
|
|
306
|
+
isDragging={isDragging}
|
|
307
|
+
isDragOverColumn={String(key) === dragOverColumnId}
|
|
308
|
+
allowReorder={allowColumnReorder}
|
|
309
|
+
loading={columnLoadingState?.[String(key)]?.loading}
|
|
310
|
+
hasMore={columnLoadingState?.[String(key)]?.hasMore}
|
|
311
|
+
totalCount={columnLoadingState?.[String(key)]?.totalCount}
|
|
312
|
+
onLoadMore={onLoadMoreColumn ? () => onLoadMoreColumn(key) : undefined}
|
|
313
|
+
onAddItem={onAddItemToColumn ? () => onAddItemToColumn(key) : undefined}
|
|
314
|
+
style={{
|
|
315
|
+
opacity: activeColumn === key ? 0 : 1
|
|
316
|
+
}}
|
|
317
|
+
/>
|
|
318
|
+
))}
|
|
319
|
+
{AddColumnComponent}
|
|
320
|
+
</div>
|
|
321
|
+
</SortableContext>
|
|
322
|
+
</DndContext>
|
|
323
|
+
);
|
|
324
|
+
}
|