@rebasepro/cms 0.28.1 → 0.29.0-canary.g0e3a0e7
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/README.md +3 -3
- package/dist/collection_editor/_cms_internals.d.ts +0 -1
- package/dist/collection_editor/ui/EditorCollectionAction.d.ts +2 -2
- package/dist/collection_editor/ui/EditorCollectionAction.js.map +1 -1
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js +2 -2
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js.map +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.js +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.js.map +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.js +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.js.map +1 -1
- package/dist/components/AdditionalFieldValue.d.ts +9 -3
- package/dist/components/AdditionalFieldValue.js +7 -4
- package/dist/components/AdditionalFieldValue.js.map +1 -1
- package/dist/components/CollectionPanel.d.ts +117 -18
- package/dist/components/CollectionPanel.js +115 -37
- package/dist/components/CollectionPanel.js.map +1 -1
- package/dist/components/CollectionTableBinding/CollectionRowActions.d.ts +5 -5
- package/dist/components/CollectionTableBinding/CollectionRowActions.js +16 -12
- package/dist/components/CollectionTableBinding/CollectionRowActions.js.map +1 -1
- package/dist/components/CollectionTableBinding/CollectionTableBinding.js +33 -8
- package/dist/components/CollectionTableBinding/CollectionTableBinding.js.map +1 -1
- package/dist/components/CollectionTableBinding/CollectionTableBindingProps.d.ts +8 -3
- package/dist/components/CollectionTableBinding/PropertyTableCell.js +2 -2
- package/dist/components/CollectionTableBinding/PropertyTableCell.js.map +1 -1
- package/dist/components/CollectionTableBinding/column_utils.d.ts +9 -1
- package/dist/components/CollectionTableBinding/column_utils.js +6 -3
- package/dist/components/CollectionTableBinding/column_utils.js.map +1 -1
- package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js +2 -2
- package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js.map +1 -1
- package/dist/components/CollectionTableBinding/fields/TableReferenceField.js +2 -2
- package/dist/components/CollectionTableBinding/fields/TableReferenceField.js.map +1 -1
- package/dist/components/CollectionTableBinding/fields/TableRelationField.js +2 -2
- package/dist/components/CollectionTableBinding/fields/TableRelationField.js.map +1 -1
- package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.d.ts +3 -2
- package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.js +9 -7
- package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.js.map +1 -1
- package/dist/components/CollectionTableBinding/internal/common.d.ts +26 -2
- package/dist/components/CollectionTableBinding/internal/common.js +88 -4
- package/dist/components/CollectionTableBinding/internal/common.js.map +1 -1
- package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js +4 -3
- package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js.map +1 -1
- package/dist/components/CollectionViewBinding/BoardCardBinding.d.ts +7 -1
- package/dist/components/CollectionViewBinding/BoardCardBinding.js +19 -14
- package/dist/components/CollectionViewBinding/BoardCardBinding.js.map +1 -1
- package/dist/components/CollectionViewBinding/CollectionAddButton.d.ts +28 -0
- package/dist/components/CollectionViewBinding/CollectionAddButton.js +50 -0
- package/dist/components/CollectionViewBinding/CollectionAddButton.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.d.ts +11 -3
- package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js +9 -4
- package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js.map +1 -1
- package/dist/components/CollectionViewBinding/CollectionCardViewBinding.d.ts +5 -3
- package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js +5 -3
- package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js.map +1 -1
- package/dist/components/CollectionViewBinding/CollectionEntityActions.d.ts +29 -0
- package/dist/components/CollectionViewBinding/CollectionEntityActions.js +112 -0
- package/dist/components/CollectionViewBinding/CollectionEntityActions.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionListViewBinding.d.ts +2 -2
- package/dist/components/CollectionViewBinding/CollectionListViewBinding.js +58 -16
- package/dist/components/CollectionViewBinding/CollectionListViewBinding.js.map +1 -1
- package/dist/components/CollectionViewBinding/CollectionToolbar.d.ts +57 -0
- package/dist/components/CollectionViewBinding/CollectionToolbar.js +146 -0
- package/dist/components/CollectionViewBinding/CollectionToolbar.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewActions.d.ts +2 -2
- package/dist/components/CollectionViewBinding/CollectionViewActions.js +22 -26
- package/dist/components/CollectionViewBinding/CollectionViewActions.js.map +1 -1
- package/dist/components/CollectionViewBinding/CollectionViewBinding.d.ts +58 -22
- package/dist/components/CollectionViewBinding/CollectionViewBinding.js +81 -1089
- package/dist/components/CollectionViewBinding/CollectionViewBinding.js.map +1 -1
- package/dist/components/CollectionViewBinding/CollectionViewContent.d.ts +9 -0
- package/dist/components/CollectionViewBinding/CollectionViewContent.js +152 -0
- package/dist/components/CollectionViewBinding/CollectionViewContent.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewDialogs.d.ts +9 -0
- package/dist/components/CollectionViewBinding/CollectionViewDialogs.js +38 -0
- package/dist/components/CollectionViewBinding/CollectionViewDialogs.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewFrame.d.ts +13 -0
- package/dist/components/CollectionViewBinding/CollectionViewFrame.js +32 -0
- package/dist/components/CollectionViewBinding/CollectionViewFrame.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewScope.d.ts +14 -0
- package/dist/components/CollectionViewBinding/CollectionViewScope.js +22 -0
- package/dist/components/CollectionViewBinding/CollectionViewScope.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewStartActions.d.ts +2 -2
- package/dist/components/CollectionViewBinding/CollectionViewStartActions.js +39 -67
- package/dist/components/CollectionViewBinding/CollectionViewStartActions.js.map +1 -1
- package/dist/components/CollectionViewBinding/CustomViewHost.d.ts +28 -0
- package/dist/components/CollectionViewBinding/CustomViewHost.js +54 -0
- package/dist/components/CollectionViewBinding/CustomViewHost.js.map +1 -0
- package/dist/components/CollectionViewBinding/EntitiesCount.d.ts +24 -0
- package/dist/components/CollectionViewBinding/EntitiesCount.js +69 -0
- package/dist/components/CollectionViewBinding/EntitiesCount.js.map +1 -0
- package/dist/components/CollectionViewBinding/EntityCardBinding.d.ts +7 -1
- package/dist/components/CollectionViewBinding/EntityCardBinding.js +34 -23
- package/dist/components/CollectionViewBinding/EntityCardBinding.js.map +1 -1
- package/dist/components/CollectionViewBinding/EntityIdHeaderWidget.d.ts +17 -0
- package/dist/components/CollectionViewBinding/EntityIdHeaderWidget.js +107 -0
- package/dist/components/CollectionViewBinding/EntityIdHeaderWidget.js.map +1 -0
- package/dist/components/CollectionViewBinding/FiltersButton.d.ts +15 -0
- package/dist/components/CollectionViewBinding/FiltersButton.js +49 -0
- package/dist/components/CollectionViewBinding/FiltersButton.js.map +1 -0
- package/dist/components/CollectionViewBinding/PluginColumnSlots.d.ts +35 -0
- package/dist/components/CollectionViewBinding/PluginColumnSlots.js +45 -0
- package/dist/components/CollectionViewBinding/PluginColumnSlots.js.map +1 -0
- package/dist/components/CollectionViewBinding/RowActions.d.ts +40 -0
- package/dist/components/CollectionViewBinding/RowActions.js +60 -0
- package/dist/components/CollectionViewBinding/RowActions.js.map +1 -0
- package/dist/components/CollectionViewBinding/SplitListView.d.ts +7 -4
- package/dist/components/CollectionViewBinding/SplitListView.js +20 -21
- package/dist/components/CollectionViewBinding/SplitListView.js.map +1 -1
- package/dist/components/CollectionViewBinding/builtin_action_props.d.ts +13 -0
- package/dist/components/CollectionViewBinding/fields.d.ts +22 -0
- package/dist/components/CollectionViewBinding/fields.js +47 -0
- package/dist/components/CollectionViewBinding/fields.js.map +1 -0
- package/dist/components/CollectionViewBinding/useBoardDataController.js +6 -7
- package/dist/components/CollectionViewBinding/useBoardDataController.js.map +1 -1
- package/dist/components/CollectionViewBinding/useCollectionLargeLayout.d.ts +19 -0
- package/dist/components/CollectionViewBinding/useCollectionLargeLayout.js +28 -0
- package/dist/components/CollectionViewBinding/useCollectionLargeLayout.js.map +1 -0
- package/dist/components/CollectionViewBinding/useCollectionViewState.d.ts +125 -0
- package/dist/components/CollectionViewBinding/useCollectionViewState.js +844 -0
- package/dist/components/CollectionViewBinding/useCollectionViewState.js.map +1 -0
- package/dist/components/CollectionViewBinding/usePreviewSlots.d.ts +20 -0
- package/dist/components/CollectionViewBinding/usePreviewSlots.js +23 -2
- package/dist/components/CollectionViewBinding/usePreviewSlots.js.map +1 -1
- package/dist/components/CollectionViewBinding/useSelectionController.d.ts +21 -3
- package/dist/components/CollectionViewBinding/useSelectionController.js +37 -6
- package/dist/components/CollectionViewBinding/useSelectionController.js.map +1 -1
- package/dist/components/CollectionsProvider.d.ts +3 -3
- package/dist/components/CollectionsProvider.js +4 -4
- package/dist/components/CollectionsProvider.js.map +1 -1
- package/dist/components/CollectionsScopeContext.d.ts +1 -1
- package/dist/components/CollectionsScopeContext.js +1 -1
- package/dist/components/CollectionsScopeContext.js.map +1 -1
- package/dist/components/DeleteEntityDialog.d.ts +1 -1
- package/dist/components/DeleteEntityDialog.js +2 -2
- package/dist/components/DeleteEntityDialog.js.map +1 -1
- package/dist/components/DetailViewBinding.js +32 -68
- package/dist/components/DetailViewBinding.js.map +1 -1
- package/dist/components/EditFormActions.js +5 -4
- package/dist/components/EditFormActions.js.map +1 -1
- package/dist/components/EditViewBinding.d.ts +2 -2
- package/dist/components/EditViewBinding.js +25 -15
- package/dist/components/EditViewBinding.js.map +1 -1
- package/dist/components/EntityDisplayHeader.js +8 -5
- package/dist/components/EntityDisplayHeader.js.map +1 -1
- package/dist/components/EntityPreviewBinding.js +1 -1
- package/dist/components/EntityPreviewBinding.js.map +1 -1
- package/dist/components/EntityViewBinding.d.ts +8 -1
- package/dist/components/EntityViewBinding.js +43 -14
- package/dist/components/EntityViewBinding.js.map +1 -1
- package/dist/components/EntityViewBody.d.ts +40 -0
- package/dist/components/EntityViewBody.js +90 -0
- package/dist/components/EntityViewBody.js.map +1 -0
- package/dist/components/FieldValue.d.ts +50 -0
- package/dist/components/FieldValue.js +81 -0
- package/dist/components/FieldValue.js.map +1 -0
- package/dist/components/InlineEntityPreview.js +1 -1
- package/dist/components/InlineEntityPreview.js.map +1 -1
- package/dist/components/PanelNotFound.d.ts +5 -0
- package/dist/components/PanelNotFound.js +21 -0
- package/dist/components/PanelNotFound.js.map +1 -0
- package/dist/components/RebaseCMS.d.ts +1 -1
- package/dist/components/RebaseCMS.js +11 -3
- package/dist/components/RebaseCMS.js.map +1 -1
- package/dist/components/RebaseNavigation.js +9 -3
- package/dist/components/RebaseNavigation.js.map +1 -1
- package/dist/components/RebaseShell.js +10 -5
- package/dist/components/RebaseShell.js.map +1 -1
- package/dist/components/RecordDetail.d.ts +61 -0
- package/dist/components/RecordDetail.js +123 -0
- package/dist/components/RecordDetail.js.map +1 -0
- package/dist/components/RecordForm.d.ts +126 -0
- package/dist/components/{EntityFormPanel.js → RecordForm.js} +64 -36
- package/dist/components/RecordForm.js.map +1 -0
- package/dist/components/ReferenceTable/SelectionTableBinding.d.ts +47 -17
- package/dist/components/ReferenceTable/SelectionTableBinding.js +89 -53
- package/dist/components/ReferenceTable/SelectionTableBinding.js.map +1 -1
- package/dist/components/ReferenceWidget.d.ts +5 -3
- package/dist/components/ReferenceWidget.js +10 -7
- package/dist/components/ReferenceWidget.js.map +1 -1
- package/dist/components/RelationSelector.js +4 -4
- package/dist/components/RelationSelector.js.map +1 -1
- package/dist/components/SelectableTable/SelectableTable.js +2 -3
- package/dist/components/SelectableTable/SelectableTable.js.map +1 -1
- package/dist/components/SelectableTable/SelectionStore.d.ts +1 -1
- package/dist/components/SelectableTable/SelectionStore.js +1 -1
- package/dist/components/SelectableTable/SelectionStore.js.map +1 -1
- package/dist/components/SelectableTable/filters/ReferenceFilterField.js +2 -2
- package/dist/components/SelectableTable/filters/ReferenceFilterField.js.map +1 -1
- package/dist/components/SidePanelBinding.js +13 -12
- package/dist/components/SidePanelBinding.js.map +1 -1
- package/dist/components/collection_prop.d.ts +18 -0
- package/dist/components/collection_prop.js +23 -0
- package/dist/components/collection_prop.js.map +1 -0
- package/dist/components/common/default_entity_actions.js +54 -54
- package/dist/components/common/default_entity_actions.js.map +1 -1
- package/dist/components/history/EntityHistoryView.d.ts +4 -1
- package/dist/components/history/EntityHistoryView.js +1 -1
- package/dist/components/history/EntityHistoryView.js.map +1 -1
- package/dist/components/history/LastEditedByFormAction.d.ts +1 -1
- package/dist/components/index.d.ts +4 -2
- package/dist/data_export/export/ExportCollectionAction.d.ts +3 -2
- package/dist/data_export/export/ExportCollectionAction.js +4 -3
- package/dist/data_export/export/ExportCollectionAction.js.map +1 -1
- package/dist/data_export/export/additional_fields.d.ts +6 -3
- package/dist/data_export/export/additional_fields.js +8 -4
- package/dist/data_export/export/additional_fields.js.map +1 -1
- package/dist/data_import/import/ImportCollectionAction.js +2 -2
- package/dist/data_import/import/ImportCollectionAction.js.map +1 -1
- package/dist/form/EntityForm.d.ts +1 -1
- package/dist/form/EntityForm.js +252 -150
- package/dist/form/EntityForm.js.map +1 -1
- package/dist/form/EntityFormActions.js +3 -2
- package/dist/form/EntityFormActions.js.map +1 -1
- package/dist/form/EntityFormBinding.d.ts +1 -1
- package/dist/form/EntityFormBinding.js +22 -11
- package/dist/form/EntityFormBinding.js.map +1 -1
- package/dist/form/FormField.d.ts +36 -0
- package/dist/form/FormField.js +41 -0
- package/dist/form/FormField.js.map +1 -0
- package/dist/form/FormFieldsContext.d.ts +69 -0
- package/dist/form/FormFieldsContext.js +143 -0
- package/dist/form/FormFieldsContext.js.map +1 -0
- package/dist/form/PropertyFieldBinding.js +4 -4
- package/dist/form/PropertyFieldBinding.js.map +1 -1
- package/dist/form/collection_showing.d.ts +8 -0
- package/dist/form/collection_showing.js +29 -0
- package/dist/form/collection_showing.js.map +1 -0
- package/dist/form/components/ErrorFocus.js +2 -1
- package/dist/form/components/ErrorFocus.js.map +1 -1
- package/dist/form/components/FieldBlock.js +3 -1
- package/dist/form/components/FieldBlock.js.map +1 -1
- package/dist/form/components/FormRail.d.ts +5 -1
- package/dist/form/components/FormRail.js +5 -1
- package/dist/form/components/FormRail.js.map +1 -1
- package/dist/form/components/FormSections.d.ts +5 -1
- package/dist/form/components/FormSections.js +11 -4
- package/dist/form/components/FormSections.js.map +1 -1
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js +2 -2
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js.map +1 -1
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.js +1 -1
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.js.map +1 -1
- package/dist/form/field_bindings/MultipleRelationFieldBinding.js +2 -2
- package/dist/form/field_bindings/MultipleRelationFieldBinding.js.map +1 -1
- package/dist/form/field_bindings/ReadOnlyFieldBinding.js.map +1 -1
- package/dist/form/field_bindings/ReferenceFieldBinding.js +2 -2
- package/dist/form/field_bindings/ReferenceFieldBinding.js.map +1 -1
- package/dist/form/field_bindings/RelationFieldBinding.js +2 -2
- package/dist/form/field_bindings/RelationFieldBinding.js.map +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.js +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.js.map +1 -1
- package/dist/form/form_dom_ids.d.ts +25 -0
- package/dist/form/form_dom_ids.js +42 -0
- package/dist/form/form_dom_ids.js.map +1 -0
- package/dist/form/index.d.ts +3 -1
- package/dist/form/resolve_cell_property.d.ts +5 -0
- package/dist/form/resolve_cell_property.js +22 -1
- package/dist/form/resolve_cell_property.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +2 -2
- package/dist/hooks/navigation/useBuildNavigationStateController.js.map +1 -1
- package/dist/hooks/navigation/useNavigationResolution.d.ts +3 -3
- package/dist/hooks/navigation/useNavigationResolution.js.map +1 -1
- package/dist/hooks/navigation/useResolvedCollections.d.ts +2 -2
- package/dist/hooks/navigation/useResolvedCollections.js.map +1 -1
- package/dist/hooks/navigation/useResolvedViews.d.ts +2 -2
- package/dist/hooks/navigation/useResolvedViews.js.map +1 -1
- package/dist/hooks/useBuildSidePanel.js +9 -9
- package/dist/hooks/useBuildSidePanel.js.map +1 -1
- package/dist/hooks/useEntityDisplay.js +6 -4
- package/dist/hooks/useEntityDisplay.js.map +1 -1
- package/dist/hooks/useRecordActions.js +2 -2
- package/dist/hooks/useRecordActions.js.map +1 -1
- package/dist/hooks/useSelectionDialog.d.ts +20 -7
- package/dist/hooks/useSelectionDialog.js +29 -8
- package/dist/hooks/useSelectionDialog.js.map +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.js +15 -9
- package/dist/mcp-view.d.ts +9 -0
- package/dist/mcp-view.js +2 -0
- package/dist/mcp_view/app_modules.d.ts +29 -0
- package/dist/mcp_view/app_modules.js +163 -0
- package/dist/mcp_view/app_modules.js.map +1 -0
- package/dist/mcp_view/bridge.d.ts +90 -0
- package/dist/mcp_view/bridge.js +205 -0
- package/dist/mcp_view/bridge.js.map +1 -0
- package/dist/mcp_view/code_app.d.ts +65 -0
- package/dist/mcp_view/code_app.js +139 -0
- package/dist/mcp_view/code_app.js.map +1 -0
- package/dist/mcp_view/index.d.ts +48 -0
- package/dist/mcp_view/index.js +235 -0
- package/dist/mcp_view/index.js.map +1 -0
- package/dist/mcp_view/payload.d.ts +78 -0
- package/dist/mcp_view/payload.js +155 -0
- package/dist/mcp_view/payload.js.map +1 -0
- package/dist/mcp_view/screen.d.ts +28 -0
- package/dist/mcp_view/screen.js +223 -0
- package/dist/mcp_view/screen.js.map +1 -0
- package/dist/mcp_view/storage_source.d.ts +14 -0
- package/dist/mcp_view/storage_source.js +29 -0
- package/dist/mcp_view/storage_source.js.map +1 -0
- package/dist/mcp_view/store.d.ts +9 -0
- package/dist/mcp_view/store.js +27 -0
- package/dist/mcp_view/store.js.map +1 -0
- package/dist/mcp_view/tool_driver.d.ts +135 -0
- package/dist/mcp_view/tool_driver.js +527 -0
- package/dist/mcp_view/tool_driver.js.map +1 -0
- package/dist/preview/components/DatePreview.d.ts +34 -1
- package/dist/preview/components/DatePreview.js +72 -37
- package/dist/preview/components/DatePreview.js.map +1 -1
- package/dist/routes/RebaseRoute.js +1 -1
- package/dist/routes/RebaseRoute.js.map +1 -1
- package/dist/selection/SelectionMenu.d.ts +5 -3
- package/dist/selection/SelectionMenu.js +16 -9
- package/dist/selection/SelectionMenu.js.map +1 -1
- package/dist/selection/index.d.ts +2 -1
- package/dist/selection/resolve_selection.d.ts +61 -7
- package/dist/selection/resolve_selection.js +93 -11
- package/dist/selection/resolve_selection.js.map +1 -1
- package/dist/types/components/EntityFormProps.d.ts +60 -10
- package/dist/types/fields.d.ts +2 -65
- package/dist/util/dataControllerAdapter.d.ts +8 -0
- package/dist/util/dataControllerAdapter.js +11 -0
- package/dist/util/dataControllerAdapter.js.map +1 -1
- package/dist/util/navigation_utils.d.ts +5 -4
- package/dist/util/navigation_utils.js +6 -6
- package/dist/util/navigation_utils.js.map +1 -1
- package/dist/util/propertyConfigMapper.d.ts +8 -0
- package/dist/util/propertyConfigMapper.js +16 -2
- package/dist/util/propertyConfigMapper.js.map +1 -1
- package/package.json +15 -9
- package/recipes/README.md +79 -26
- package/recipes/approval-queue.tsx +79 -0
- package/recipes/bulk-set-status.tsx +23 -17
- package/recipes/calendar-view.tsx +28 -23
- package/recipes/master-detail.tsx +75 -0
- package/recipes/my-preferences.tsx +3 -3
- package/recipes/orders-dashboard.tsx +58 -84
- package/recipes/site-settings.tsx +4 -4
- package/dist/components/EntityFormPanel.d.ts +0 -63
- package/dist/components/EntityFormPanel.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionEntityActions.js","names":[],"sources":["../../../src/components/CollectionViewBinding/CollectionEntityActions.tsx"],"sourcesContent":["import type { AdminCollection, EntityAction, EntityActionClickProps, EntitySelectionController } from \"@rebasepro/cms-types\";\nimport { Entity } from \"@rebasepro/types\";\nimport React, { useCallback, useContext } from \"react\";\nimport { getIcon, useTranslation } from \"@rebasepro/app\";\nimport { IconButton, Menu, MenuItem, MoreVerticalIcon, Separator, Tooltip } from \"@rebasepro/ui\";\nimport { useAdminContext } from \"../../hooks/useAdminContext\";\nimport { entityActionName, placeEntityActions, resolveEntityActionState } from \"../../util/entity_actions\";\nimport { ActionMenuLabel } from \"../common/ActionMenuLabel\";\nimport { rowOfEntity, selectionControllerOf } from \"@rebasepro/app\";\nimport type { OpenEntityMode } from \"../../util/view_mode\";\nimport { RowActionsSlot } from \"./RowActions\";\n\n/**\n * What a card's actions are built from: the actions a row of this collection\n * has, and what the table hands an action it runs.\n */\nexport type EntityActionsScope<M extends Record<string, unknown> = Record<string, unknown>> = {\n getActions: (entity: Entity<M>) => EntityAction[];\n collection: AdminCollection<M>;\n path: string;\n openEntityMode: OpenEntityMode;\n selectionController?: EntitySelectionController<M>;\n onCollectionChange: () => void;\n highlightRow: (id: string | number) => void;\n unhighlightRow: () => void;\n};\n\n/**\n * Reaches the card's actions through context, not through the card's props:\n * the grid and the board draw memoised cards, and a scope that changes with\n * the selection would redraw every one of them.\n */\nexport const EntityActionsScopeContext = React.createContext<EntityActionsScope | null>(null);\n\n/**\n * The actions of one record on a card or a kanban card, placed as a table row\n * places them: `collapsed: false` ones as buttons, the rest in a menu — the\n * collection's own, then Copy, then Delete apart. Edit is left out: clicking\n * the card is what opens it.\n */\nfunction CollectionEntityActions({ entity }: { entity: Entity<Record<string, unknown>> }) {\n const scope = useContext(EntityActionsScopeContext);\n const context = useAdminContext();\n const { t } = useTranslation();\n const stopPropagation = useCallback((event: React.MouseEvent) => event.stopPropagation(), []);\n if (!scope) return null;\n\n const actions = scope.getActions(entity).filter(action => action.key !== \"edit\");\n const rowActions = <RowActionsSlot entity={entity} collection={scope.collection} path={scope.path}/>;\n if (actions.length === 0) return rowActions;\n\n const placed = placeEntityActions(actions);\n const collapsedGroups = [placed.own, placed.generic, placed.destructive].filter(group => group.length > 0);\n const clickProps: EntityActionClickProps<Record<string, unknown>> = {\n view: \"collection\",\n row: rowOfEntity(entity, scope.collection),\n id: String(entity.id),\n path: scope.path,\n collection: scope.collection,\n context,\n sidePanelController: context.sidePanelController,\n selectionController: scope.selectionController\n ? selectionControllerOf(scope.selectionController, scope.collection, scope.path)\n : undefined,\n highlightRow: scope.highlightRow,\n unhighlightRow: scope.unhighlightRow,\n onCollectionChange: scope.onCollectionChange,\n openEntityMode: scope.openEntityMode\n };\n\n return (\n <div className=\"flex items-center gap-0.5 shrink-0\" onClick={stopPropagation}>\n {rowActions}\n {placed.inline.map((action, index) => {\n const { enabled, disabledReason } = resolveEntityActionState(action, clickProps);\n const name = entityActionName(action, t);\n // A disabled icon takes no pointer events: wrapped, the\n // wrapper hovers, and the tooltip can still say why.\n return (\n <Tooltip key={action.key ?? index}\n title={disabledReason ? `${name}: ${disabledReason}` : name}\n asChild={enabled}>\n <IconButton\n aria-label={name}\n disabled={!enabled}\n size=\"small\"\n onClick={(event: React.MouseEvent) => {\n event.stopPropagation();\n action.onClick(clickProps);\n }}>\n {getIcon(action.icon, undefined, undefined, \"smallest\")}\n </IconButton>\n </Tooltip>\n );\n })}\n {collapsedGroups.length > 0 &&\n <Menu\n trigger={<IconButton aria-label={t(\"more_actions\")} size=\"small\">\n <MoreVerticalIcon/>\n </IconButton>}>\n {collapsedGroups.map((group, groupIndex) => (\n <React.Fragment key={groupIndex}>\n {groupIndex > 0 && <Separator orientation={\"horizontal\"}/>}\n {group.map((action, index) => {\n const { enabled, disabledReason } = resolveEntityActionState(action, clickProps);\n return <MenuItem\n key={action.key ?? index}\n disabled={!enabled}\n onClick={(event) => {\n event.stopPropagation();\n action.onClick(clickProps);\n }}>\n {getIcon(action.icon, undefined, undefined, \"smallest\")}\n <ActionMenuLabel name={entityActionName(action, t)} disabledReason={disabledReason}/>\n </MenuItem>;\n })}\n </React.Fragment>\n ))}\n </Menu>}\n </div>\n );\n}\n\n/**\n * Draws a record's actions where a card puts them. One function for the life\n * of the module, so a memoised card is never redrawn for a new one.\n */\nexport function renderCollectionEntityActions(entity: Entity<Record<string, unknown>>): React.ReactNode {\n return <CollectionEntityActions entity={entity}/>;\n}\n"],"mappings":";;;;;;;;;;;;;;AAgCA,IAAa,4BAA4B,MAAM,cAAyC,IAAI;;;;;;;AAQ5F,SAAS,wBAAwB,EAAE,UAAuD;CACtF,MAAM,QAAQ,WAAW,yBAAyB;CAClD,MAAM,UAAU,gBAAgB;CAChC,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,kBAAkB,aAAa,UAA4B,MAAM,gBAAgB,GAAG,CAAC,CAAC;CAC5F,IAAI,CAAC,OAAO,OAAO;CAEnB,MAAM,UAAU,MAAM,WAAW,MAAM,CAAC,CAAC,QAAO,WAAU,OAAO,QAAQ,MAAM;CAC/E,MAAM,aAAa,oBAAC,gBAAD;EAAwB;EAAQ,YAAY,MAAM;EAAY,MAAM,MAAM;CAAM,CAAA;CACnG,IAAI,QAAQ,WAAW,GAAG,OAAO;CAEjC,MAAM,SAAS,mBAAmB,OAAO;CACzC,MAAM,kBAAkB;EAAC,OAAO;EAAK,OAAO;EAAS,OAAO;CAAW,CAAC,CAAC,QAAO,UAAS,MAAM,SAAS,CAAC;CACzG,MAAM,aAA8D;EAChE,MAAM;EACN,KAAK,YAAY,QAAQ,MAAM,UAAU;EACzC,IAAI,OAAO,OAAO,EAAE;EACpB,MAAM,MAAM;EACZ,YAAY,MAAM;EAClB;EACA,qBAAqB,QAAQ;EAC7B,qBAAqB,MAAM,sBACrB,sBAAsB,MAAM,qBAAqB,MAAM,YAAY,MAAM,IAAI,IAC7E,KAAA;EACN,cAAc,MAAM;EACpB,gBAAgB,MAAM;EACtB,oBAAoB,MAAM;EAC1B,gBAAgB,MAAM;CAC1B;CAEA,OACI,qBAAC,OAAD;EAAK,WAAU;EAAqC,SAAS;YAA7D;GACK;GACA,OAAO,OAAO,KAAK,QAAQ,UAAU;IAClC,MAAM,EAAE,SAAS,mBAAmB,yBAAyB,QAAQ,UAAU;IAC/E,MAAM,OAAO,iBAAiB,QAAQ,CAAC;IAGvC,OACI,oBAAC,SAAD;KACI,OAAO,iBAAiB,GAAG,KAAK,IAAI,mBAAmB;KACvD,SAAS;eACT,oBAAC,YAAD;MACI,cAAY;MACZ,UAAU,CAAC;MACX,MAAK;MACL,UAAU,UAA4B;OAClC,MAAM,gBAAgB;OACtB,OAAO,QAAQ,UAAU;MAC7B;gBACC,QAAQ,OAAO,MAAM,KAAA,GAAW,KAAA,GAAW,UAAU;KAC9C,CAAA;IACP,GAbK,OAAO,OAAO,KAanB;GAEjB,CAAC;GACA,gBAAgB,SAAS,KACtB,oBAAC,MAAD;IACI,SAAS,oBAAC,YAAD;KAAY,cAAY,EAAE,cAAc;KAAG,MAAK;eACrD,oBAAC,kBAAD,CAAkB,CAAA;IACV,CAAA;cACX,gBAAgB,KAAK,OAAO,eACzB,qBAAC,MAAM,UAAP,EAAA,UAAA,CACK,aAAa,KAAK,oBAAC,WAAD,EAAW,aAAa,aAAc,CAAA,GACxD,MAAM,KAAK,QAAQ,UAAU;KAC1B,MAAM,EAAE,SAAS,mBAAmB,yBAAyB,QAAQ,UAAU;KAC/E,OAAO,qBAAC,UAAD;MAEH,UAAU,CAAC;MACX,UAAU,UAAU;OAChB,MAAM,gBAAgB;OACtB,OAAO,QAAQ,UAAU;MAC7B;gBANG,CAOF,QAAQ,OAAO,MAAM,KAAA,GAAW,KAAA,GAAW,UAAU,GACtD,oBAAC,iBAAD;OAAiB,MAAM,iBAAiB,QAAQ,CAAC;OAAmB;MAAgB,CAAA,CAC9E;QARD,OAAO,OAAO,KAQb;IACd,CAAC,CACW,EAAA,GAfK,UAeL,CACnB;GACC,CAAA;EACT;;AAEb;;;;;AAMA,SAAgB,8BAA8B,QAA0D;CACpG,OAAO,oBAAC,yBAAD,EAAiC,OAAQ,CAAA;AACpD"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Entity } from "@rebasepro/types";
|
|
3
|
-
import { CollectionSize, EntityAction, EntityTableController,
|
|
3
|
+
import { CollectionSize, EntityAction, EntityTableController, EntitySelectionController, AdminCollection } from "@rebasepro/cms-types";
|
|
4
4
|
export type CollectionListViewBindingProps<M extends Record<string, unknown> = Record<string, unknown>> = {
|
|
5
5
|
collection: AdminCollection<M>;
|
|
6
6
|
tableController: EntityTableController<M>;
|
|
7
7
|
onEntityClick?: (entity: Entity<M>) => void;
|
|
8
|
-
selectionController?:
|
|
8
|
+
selectionController?: EntitySelectionController<M>;
|
|
9
9
|
selectionEnabled?: boolean;
|
|
10
10
|
highlightedEntities?: Entity<M>[];
|
|
11
11
|
emptyComponent?: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getResolvedPropertyInPath } from "../../util/property_utils.js";
|
|
2
2
|
import { formatCollectionDate } from "../../util/format_collection_date.js";
|
|
3
|
-
import { useCollectionSlotKeys, useEntitySlots } from "./usePreviewSlots.js";
|
|
3
|
+
import { useCollectionSlotKeys, useEntitySlots, useImagePlace } from "./usePreviewSlots.js";
|
|
4
4
|
import { PropertyPreview } from "../../preview/PropertyPreview.js";
|
|
5
5
|
import { useAdminContext } from "../../hooks/useAdminContext.js";
|
|
6
6
|
import { entityActionName, resolveEntityActionState } from "../../util/entity_actions.js";
|
|
@@ -9,25 +9,31 @@ import { resolveEntityAction } from "../../util/resolutions.js";
|
|
|
9
9
|
import { Highlighted } from "./SearchHighlight.js";
|
|
10
10
|
import { MatchExplanation, fieldLabel, useSearchExplanation } from "./SearchExplanation.js";
|
|
11
11
|
import { SlotValue, TagChips } from "./SlotValue.js";
|
|
12
|
+
import { RowActionsSlot } from "./RowActions.js";
|
|
12
13
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
13
14
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
15
|
import { ArrowDownIcon, ArrowUpIcon, Checkbox, Chip, IconButton, ListView, Tooltip, Typography, cls, defaultBorderMixin, useUiLabels } from "@rebasepro/ui";
|
|
15
|
-
import {
|
|
16
|
+
import { resolveProperty } from "@rebasepro/common";
|
|
17
|
+
import { IconForView, getDisplayResolver, getIcon, hasDeclaredDisplay, rowOfEntity, selectionControllerOf, useAnalyticsController, useAuthController, useCustomizationController, useTranslation } from "@rebasepro/app";
|
|
16
18
|
import { getValueInPath } from "@rebasepro/utils";
|
|
17
19
|
//#region src/components/CollectionViewBinding/CollectionListViewBinding.tsx
|
|
18
20
|
/** A column left over from a sort or filter that is no longer applied. */
|
|
19
21
|
var PRIORITY_STALE_REQUEST = 1e3;
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
22
|
+
/** The collection's `listProperties`, plus how many come after a column: the last goes first. */
|
|
23
|
+
var PRIORITY_NAMED = 2e3;
|
|
24
|
+
/** The display slots, above any number of named columns, in give-way order. */
|
|
25
|
+
var PRIORITY_DATE = 2500;
|
|
26
|
+
var PRIORITY_STATUS = 2501;
|
|
27
|
+
var PRIORITY_TAGS = 2502;
|
|
23
28
|
/** The sort or filter currently in force. */
|
|
24
29
|
var PRIORITY_ACTIVE_REQUEST = 3e3;
|
|
25
30
|
/**
|
|
26
31
|
* How wide a column of this property wants to be — the Tailwind class the cell
|
|
27
32
|
* gets, and the pixel cost of that class. The two are returned together because
|
|
28
33
|
* they must not drift: the budget is only meaningful if it describes the widths
|
|
29
|
-
* actually rendered.
|
|
30
|
-
* narrow split
|
|
34
|
+
* actually rendered. The wider variant keys off the collection view's width,
|
|
35
|
+
* not the list's, so a narrow split in a wide view gets the larger of the two —
|
|
36
|
+
* the cost we budget.
|
|
31
37
|
*/
|
|
32
38
|
function getIdealColumnWidth(prop) {
|
|
33
39
|
if (prop.type === "string" && "enum" in prop) return {
|
|
@@ -39,11 +45,11 @@ function getIdealColumnWidth(prop) {
|
|
|
39
45
|
widthPx: 112
|
|
40
46
|
};
|
|
41
47
|
if (prop.type === "reference" || prop.type === "relation") return {
|
|
42
|
-
width: "flex-shrink-0 w-56
|
|
48
|
+
width: "flex-shrink-0 w-56 @5xl/collection:w-64",
|
|
43
49
|
widthPx: 256
|
|
44
50
|
};
|
|
45
51
|
if (prop.type === "string") return {
|
|
46
|
-
width: "flex-shrink-0 w-40
|
|
52
|
+
width: "flex-shrink-0 w-40 @5xl/collection:w-48",
|
|
47
53
|
widthPx: 192
|
|
48
54
|
};
|
|
49
55
|
return {
|
|
@@ -104,6 +110,21 @@ function isComplexPropertyType(property) {
|
|
|
104
110
|
return property.type === "array" || property.type === "map" || property.type === "reference" || property.type === "relation";
|
|
105
111
|
}
|
|
106
112
|
/**
|
|
113
|
+
* Whether the property brings its own `Preview`, directly or through the
|
|
114
|
+
* property config it inherits from.
|
|
115
|
+
*/
|
|
116
|
+
function hasOwnPreview(property, propertyKey, propertyConfigs, authController) {
|
|
117
|
+
if (property.admin?.Preview) return true;
|
|
118
|
+
if (!property.propertyConfig) return false;
|
|
119
|
+
return !!resolveProperty({
|
|
120
|
+
property,
|
|
121
|
+
propertyKey,
|
|
122
|
+
propertyConfigs,
|
|
123
|
+
authController,
|
|
124
|
+
ignoreMissingFields: true
|
|
125
|
+
})?.admin?.Preview;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
107
128
|
* Render a complex value as a compact, single-line string.
|
|
108
129
|
* - Arrays → "Item, Item +3"
|
|
109
130
|
* - Maps → "4 fields"
|
|
@@ -261,6 +282,17 @@ function CollectionListViewBinding({ collection, tableController, onEntityClick,
|
|
|
261
282
|
*/
|
|
262
283
|
const declaredColumns = useMemo(() => {
|
|
263
284
|
const cols = [];
|
|
285
|
+
/**
|
|
286
|
+
* The property a slot is declared to read, when it reads one: a
|
|
287
|
+
* resolver computes its value, and an inferred key is a guess.
|
|
288
|
+
*/
|
|
289
|
+
const declaredSlotKey = (slot, key) => key && hasDeclaredDisplay(resolvedCollection, slot) && !getDisplayResolver(resolvedCollection, slot) ? key : void 0;
|
|
290
|
+
const slotPriorities = /* @__PURE__ */ new Map([
|
|
291
|
+
[declaredSlotKey("tags", slotKeys.tagsKey), PRIORITY_TAGS],
|
|
292
|
+
[declaredSlotKey("status", statusPropertyKey), PRIORITY_STATUS],
|
|
293
|
+
[declaredSlotKey("date", datePropertyKey), PRIORITY_DATE]
|
|
294
|
+
]);
|
|
295
|
+
slotPriorities.delete(void 0);
|
|
264
296
|
if (columnMode) {
|
|
265
297
|
const keys = resolvedCollection.listProperties.filter((key) => key !== titleColumn?.key);
|
|
266
298
|
keys.forEach((key, index) => {
|
|
@@ -273,7 +305,7 @@ function CollectionListViewBinding({ collection, tableController, onEntityClick,
|
|
|
273
305
|
align: property.type === "number" || property.type === "date" ? "right" : "left",
|
|
274
306
|
...getIdealColumnWidth(property),
|
|
275
307
|
sortable: sortableKeys.has(key),
|
|
276
|
-
priority:
|
|
308
|
+
priority: slotPriorities.get(key) ?? PRIORITY_NAMED + (keys.length - index)
|
|
277
309
|
});
|
|
278
310
|
});
|
|
279
311
|
}
|
|
@@ -431,7 +463,7 @@ function CollectionListViewBinding({ collection, tableController, onEntityClick,
|
|
|
431
463
|
}
|
|
432
464
|
return actions;
|
|
433
465
|
}, [listViewActionsCache, getListViewActions]);
|
|
434
|
-
const showImage = size !== "xs";
|
|
466
|
+
const showImage = useImagePlace(imagePropertyKey) && size !== "xs";
|
|
435
467
|
/**
|
|
436
468
|
* Does the checkbox ride on the thumbnail rather than sit beside it?
|
|
437
469
|
*
|
|
@@ -821,12 +853,13 @@ var ListRow = React.memo(function ListRow({ entity, collection, onClick, selecte
|
|
|
821
853
|
children: listViewActions.map((action, index) => {
|
|
822
854
|
const clickProps = {
|
|
823
855
|
view: "collection",
|
|
824
|
-
entity,
|
|
825
|
-
|
|
856
|
+
row: rowOfEntity(entity, collection),
|
|
857
|
+
id: String(entity.id),
|
|
858
|
+
path: path ?? entity.path,
|
|
826
859
|
collection,
|
|
827
860
|
context,
|
|
828
861
|
sidePanelController: context?.sidePanelController,
|
|
829
|
-
selectionController,
|
|
862
|
+
selectionController: selectionController ? selectionControllerOf(selectionController, collection, path ?? entity.path) : void 0,
|
|
830
863
|
openEntityMode: openEntityMode ?? collection?.openEntityMode ?? "full_screen"
|
|
831
864
|
};
|
|
832
865
|
const { enabled, disabledReason } = resolveEntityActionState(action, clickProps);
|
|
@@ -846,6 +879,12 @@ var ListRow = React.memo(function ListRow({ entity, collection, onClick, selecte
|
|
|
846
879
|
})
|
|
847
880
|
}, action.key ?? index);
|
|
848
881
|
})
|
|
882
|
+
}),
|
|
883
|
+
/* @__PURE__ */ jsx(RowActionsSlot, {
|
|
884
|
+
entity,
|
|
885
|
+
collection,
|
|
886
|
+
path,
|
|
887
|
+
className: "flex items-center gap-1 flex-shrink-0 ml-2"
|
|
849
888
|
})
|
|
850
889
|
]
|
|
851
890
|
});
|
|
@@ -860,6 +899,8 @@ var ListRow = React.memo(function ListRow({ entity, collection, onClick, selecte
|
|
|
860
899
|
*/
|
|
861
900
|
function ListCell({ column, entity, slots }) {
|
|
862
901
|
const relativeTimeLabels = useUiLabels().relativeTime;
|
|
902
|
+
const { propertyConfigs } = useCustomizationController();
|
|
903
|
+
const authController = useAuthController();
|
|
863
904
|
if (column.slot === "tags") {
|
|
864
905
|
if (!slots.tags) return null;
|
|
865
906
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -890,7 +931,7 @@ function ListCell({ column, entity, slots }) {
|
|
|
890
931
|
className: "whitespace-nowrap text-surface-400 dark:text-surface-500 font-medium",
|
|
891
932
|
children: formatCollectionDate(value, property, { relativeTimeLabels }) ?? "—"
|
|
892
933
|
});
|
|
893
|
-
if (isComplexPropertyType(property)) return /* @__PURE__ */ jsx(Typography, {
|
|
934
|
+
if (isComplexPropertyType(property) && !hasOwnPreview(property, column.key, propertyConfigs, authController)) return /* @__PURE__ */ jsx(Typography, {
|
|
894
935
|
variant: "caption",
|
|
895
936
|
className: "text-surface-500 dark:text-surface-400 truncate",
|
|
896
937
|
children: compactValueSummary(value, property) ?? "—"
|
|
@@ -904,7 +945,8 @@ function ListCell({ column, entity, slots }) {
|
|
|
904
945
|
propertyKey: column.key,
|
|
905
946
|
value,
|
|
906
947
|
property,
|
|
907
|
-
size: "small"
|
|
948
|
+
size: "small",
|
|
949
|
+
hideLabel: true
|
|
908
950
|
})
|
|
909
951
|
});
|
|
910
952
|
}
|