@payloadcms/ui 4.0.0-internal.5d5a2b2 → 4.0.0-internal.688c4d0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/colors.css +107 -60
- package/dist/css/radius.css +1 -3
- package/dist/css/theme.css +4 -0
- package/dist/css/utilities.css +5 -0
- package/dist/elements/APIKeyInput/index.css +92 -0
- package/dist/elements/APIKeyInput/index.d.ts +14 -0
- package/dist/elements/APIKeyInput/index.d.ts.map +1 -0
- package/dist/elements/APIKeyInput/index.js +86 -0
- package/dist/elements/APIKeyInput/index.js.map +1 -0
- package/dist/elements/AddNewRelation/index.d.ts.map +1 -1
- package/dist/elements/AddNewRelation/index.js +85 -103
- package/dist/elements/AddNewRelation/index.js.map +1 -1
- package/dist/elements/AppHeader/index.d.ts +2 -1
- package/dist/elements/AppHeader/index.d.ts.map +1 -1
- package/dist/elements/AppHeader/index.js +7 -27
- package/dist/elements/AppHeader/index.js.map +1 -1
- package/dist/elements/BulkUpload/ActionsBar/index.css +10 -4
- package/dist/elements/BulkUpload/ActionsBar/index.d.ts.map +1 -1
- package/dist/elements/BulkUpload/ActionsBar/index.js +43 -40
- package/dist/elements/BulkUpload/ActionsBar/index.js.map +1 -1
- package/dist/elements/BulkUpload/AddFilesView/index.js +1 -1
- package/dist/elements/BulkUpload/AddFilesView/index.js.map +1 -1
- package/dist/elements/BulkUpload/AddingFilesView/index.css +25 -0
- package/dist/elements/BulkUpload/AddingFilesView/index.d.ts +1 -1
- package/dist/elements/BulkUpload/AddingFilesView/index.d.ts.map +1 -1
- package/dist/elements/BulkUpload/AddingFilesView/index.js +1 -1
- package/dist/elements/BulkUpload/AddingFilesView/index.js.map +1 -1
- package/dist/elements/BulkUpload/EditForm/index.css +9 -0
- package/dist/elements/BulkUpload/EditForm/index.d.ts +1 -1
- package/dist/elements/BulkUpload/EditForm/index.d.ts.map +1 -1
- package/dist/elements/BulkUpload/EditForm/index.js +1 -1
- package/dist/elements/BulkUpload/EditForm/index.js.map +1 -1
- package/dist/elements/BulkUpload/EditMany/DrawerContent.d.ts +1 -1
- package/dist/elements/BulkUpload/EditMany/DrawerContent.d.ts.map +1 -1
- package/dist/elements/BulkUpload/EditMany/DrawerContent.js +59 -55
- package/dist/elements/BulkUpload/EditMany/DrawerContent.js.map +1 -1
- package/dist/elements/BulkUpload/EditMany/index.css +71 -0
- package/dist/elements/BulkUpload/EditMany/index.d.ts +1 -1
- package/dist/elements/BulkUpload/EditMany/index.d.ts.map +1 -1
- package/dist/elements/BulkUpload/EditMany/index.js +1 -1
- package/dist/elements/BulkUpload/EditMany/index.js.map +1 -1
- package/dist/elements/BulkUpload/FileSidebar/index.css +54 -75
- package/dist/elements/BulkUpload/FileSidebar/index.d.ts.map +1 -1
- package/dist/elements/BulkUpload/FileSidebar/index.js +60 -50
- package/dist/elements/BulkUpload/FileSidebar/index.js.map +1 -1
- package/dist/elements/BulkUpload/FormsManager/index.d.ts.map +1 -1
- package/dist/elements/BulkUpload/FormsManager/index.js +13 -0
- package/dist/elements/BulkUpload/FormsManager/index.js.map +1 -1
- package/dist/elements/Button/index.css +8 -0
- package/dist/elements/Chip/index.css +1 -1
- package/dist/elements/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/elements/CodeEditor/CodeEditor.js +19 -0
- package/dist/elements/CodeEditor/CodeEditor.js.map +1 -1
- package/dist/elements/ColumnSelector/index.js +1 -1
- package/dist/elements/ColumnSelector/index.js.map +1 -1
- package/dist/elements/Combobox/index.css +9 -8
- package/dist/elements/ConfirmationModal/index.css +7 -0
- package/dist/elements/ConfirmationModal/index.d.ts +1 -0
- package/dist/elements/ConfirmationModal/index.d.ts.map +1 -1
- package/dist/elements/ConfirmationModal/index.js +7 -3
- package/dist/elements/ConfirmationModal/index.js.map +1 -1
- package/dist/elements/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/elements/DatePicker/DatePicker.js +4 -2
- package/dist/elements/DatePicker/DatePicker.js.map +1 -1
- package/dist/elements/DatePicker/index.css +5 -0
- package/dist/elements/DatePicker/index.js +1 -1
- package/dist/elements/DatePicker/index.js.map +1 -1
- package/dist/elements/DeleteMany/index.d.ts +3 -26
- package/dist/elements/DeleteMany/index.d.ts.map +1 -1
- package/dist/elements/DeleteMany/index.js +1 -95
- package/dist/elements/DeleteMany/index.js.map +1 -1
- package/dist/elements/Dialog/DialogModal/index.d.ts +1 -1
- package/dist/elements/Dialog/DialogModal/index.d.ts.map +1 -1
- package/dist/elements/Dialog/DialogModal/index.js.map +1 -1
- package/dist/elements/Dialog/index.css +4 -0
- package/dist/elements/DocumentControls/index.css +10 -0
- package/dist/elements/DocumentControls/index.d.ts +6 -0
- package/dist/elements/DocumentControls/index.d.ts.map +1 -1
- package/dist/elements/DocumentControls/index.js +7 -6
- package/dist/elements/DocumentControls/index.js.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerContent.js +10 -6
- package/dist/elements/DocumentDrawer/DrawerContent.js.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerHeader/index.css +76 -4
- package/dist/elements/DocumentDrawer/DrawerHeader/index.d.ts +7 -1
- package/dist/elements/DocumentDrawer/DrawerHeader/index.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerHeader/index.js +148 -87
- package/dist/elements/DocumentDrawer/DrawerHeader/index.js.map +1 -1
- package/dist/elements/DocumentDrawer/types.d.ts +1 -0
- package/dist/elements/DocumentDrawer/types.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/types.js.map +1 -1
- package/dist/elements/DocumentFields/index.css +61 -2
- package/dist/elements/DraggableSortable/index.js.map +1 -1
- package/dist/elements/Drawer/index.css +57 -26
- package/dist/elements/Drawer/index.d.ts +25 -0
- package/dist/elements/Drawer/index.d.ts.map +1 -1
- package/dist/elements/Drawer/index.js +133 -54
- package/dist/elements/Drawer/index.js.map +1 -1
- package/dist/elements/Drawer/types.d.ts +1 -0
- package/dist/elements/Drawer/types.d.ts.map +1 -1
- package/dist/elements/Drawer/types.js.map +1 -1
- package/dist/elements/EditMany/DrawerContent.d.ts +1 -1
- package/dist/elements/EditMany/DrawerContent.d.ts.map +1 -1
- package/dist/elements/EditMany/DrawerContent.js +76 -71
- package/dist/elements/EditMany/DrawerContent.js.map +1 -1
- package/dist/elements/EditMany/index.css +71 -0
- package/dist/elements/EditMany/index.d.ts +9 -11
- package/dist/elements/EditMany/index.d.ts.map +1 -1
- package/dist/elements/EditMany/index.js +2 -40
- package/dist/elements/EditMany/index.js.map +1 -1
- package/dist/elements/FieldSelect/index.css +3 -0
- package/dist/elements/FileDetails/DraggableFileDetails/index.css +32 -0
- package/dist/elements/FileDetails/DraggableFileDetails/index.d.ts +1 -1
- package/dist/elements/FileDetails/DraggableFileDetails/index.d.ts.map +1 -1
- package/dist/elements/FileDetails/DraggableFileDetails/index.js +19 -18
- package/dist/elements/FileDetails/DraggableFileDetails/index.js.map +1 -1
- package/dist/elements/GroupByControl/index.d.ts.map +1 -1
- package/dist/elements/GroupByControl/index.js +5 -6
- package/dist/elements/GroupByControl/index.js.map +1 -1
- package/dist/elements/Hierarchy/Drawer/index.css +3 -21
- package/dist/elements/Hierarchy/Drawer/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Drawer/index.js +5 -3
- package/dist/elements/Hierarchy/Drawer/index.js.map +1 -1
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.css +36 -0
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.d.ts +1 -1
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.js +1 -1
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.js.map +1 -1
- package/dist/elements/Hierarchy/Field/index.client.d.ts +1 -1
- package/dist/elements/Hierarchy/Field/index.client.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Field/index.client.js +5 -2
- package/dist/elements/Hierarchy/Field/index.client.js.map +1 -1
- package/dist/elements/Hierarchy/Field/index.css +37 -0
- package/dist/elements/Hierarchy/MoveMany/index.d.ts +0 -1
- package/dist/elements/Hierarchy/MoveMany/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/MoveMany/index.js +0 -1
- package/dist/elements/Hierarchy/MoveMany/index.js.map +1 -1
- package/dist/elements/Hierarchy/Tree/LoadMore/index.css +27 -0
- package/dist/elements/Hierarchy/Tree/LoadMore/index.d.ts +1 -1
- package/dist/elements/Hierarchy/Tree/LoadMore/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/LoadMore/index.js +1 -1
- package/dist/elements/Hierarchy/Tree/LoadMore/index.js.map +1 -1
- package/dist/elements/Hierarchy/Tree/TreeFocusContext.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/TreeFocusContext.js +36 -16
- package/dist/elements/Hierarchy/Tree/TreeFocusContext.js.map +1 -1
- package/dist/elements/Hierarchy/Tree/TreeNode/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/TreeNode/index.js +20 -15
- package/dist/elements/Hierarchy/Tree/TreeNode/index.js.map +1 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +1 -1
- package/dist/elements/ListControls/index.css +5 -0
- package/dist/elements/ListControls/index.d.ts.map +1 -1
- package/dist/elements/ListControls/index.js +1 -1
- package/dist/elements/ListControls/index.js.map +1 -1
- package/dist/elements/ListDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/elements/ListDrawer/DrawerContent.js +12 -6
- package/dist/elements/ListDrawer/DrawerContent.js.map +1 -1
- package/dist/elements/ListSelection/index.css +1 -1
- package/dist/elements/LoadMoreRow/index.css +34 -0
- package/dist/elements/LoadMoreRow/index.d.ts +1 -1
- package/dist/elements/LoadMoreRow/index.d.ts.map +1 -1
- package/dist/elements/LoadMoreRow/index.js +4 -8
- package/dist/elements/LoadMoreRow/index.js.map +1 -1
- package/dist/elements/Loading/index.css +28 -74
- package/dist/elements/Loading/index.d.ts.map +1 -1
- package/dist/elements/Loading/index.js +16 -60
- package/dist/elements/Loading/index.js.map +1 -1
- package/dist/elements/Localizer/index.d.ts.map +1 -1
- package/dist/elements/Localizer/index.js +3 -4
- package/dist/elements/Localizer/index.js.map +1 -1
- package/dist/elements/MenuSeparator/index.d.ts +4 -0
- package/dist/elements/MenuSeparator/index.d.ts.map +1 -0
- package/dist/elements/MenuSeparator/index.js +10 -0
- package/dist/elements/MenuSeparator/index.js.map +1 -0
- package/dist/elements/Nav/index.d.ts.map +1 -1
- package/dist/elements/Nav/index.js +4 -23
- package/dist/elements/Nav/index.js.map +1 -1
- package/dist/elements/Pill/index.css +1 -1
- package/dist/elements/PillSelector/index.css +1 -1
- package/dist/elements/Popup/PopupButtonList/index.css +43 -4
- package/dist/elements/Popup/PopupButtonList/index.d.ts.map +1 -1
- package/dist/elements/Popup/PopupButtonList/index.js +1 -0
- package/dist/elements/Popup/PopupButtonList/index.js.map +1 -1
- package/dist/elements/Popup/PopupGroupLabel/index.css +12 -0
- package/dist/elements/Popup/index.d.ts +7 -0
- package/dist/elements/Popup/index.d.ts.map +1 -1
- package/dist/elements/Popup/index.js +125 -59
- package/dist/elements/Popup/index.js.map +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.d.ts +13 -0
- package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.d.ts.map +1 -0
- package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.js +41 -0
- package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.js.map +1 -0
- package/dist/elements/PublishButton/ScheduleDrawer/index.d.ts +1 -0
- package/dist/elements/PublishButton/ScheduleDrawer/index.d.ts.map +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/index.js +9 -31
- package/dist/elements/PublishButton/ScheduleDrawer/index.js.map +1 -1
- package/dist/elements/PublishButton/index.d.ts.map +1 -1
- package/dist/elements/PublishButton/index.js +4 -5
- package/dist/elements/PublishButton/index.js.map +1 -1
- package/dist/elements/ReactSelect/MultiValue/index.css +1 -1
- package/dist/elements/ReactSelect/index.css +53 -52
- package/dist/elements/ReactSelect/index.d.ts.map +1 -1
- package/dist/elements/ReactSelect/index.js +87 -11
- package/dist/elements/ReactSelect/index.js.map +1 -1
- package/dist/elements/ReactSelect/types.d.ts +6 -1
- package/dist/elements/ReactSelect/types.d.ts.map +1 -1
- package/dist/elements/ReactSelect/types.js.map +1 -1
- package/dist/elements/RenderTitle/index.css +10 -0
- package/dist/elements/RenderTitle/index.d.ts +5 -0
- package/dist/elements/RenderTitle/index.d.ts.map +1 -1
- package/dist/elements/RenderTitle/index.js +52 -27
- package/dist/elements/RenderTitle/index.js.map +1 -1
- package/dist/elements/SchedulePublishButton/index.d.ts.map +1 -1
- package/dist/elements/SchedulePublishButton/index.js +6 -1
- package/dist/elements/SchedulePublishButton/index.js.map +1 -1
- package/dist/elements/SelectMany/index.js +1 -1
- package/dist/elements/SelectMany/index.js.map +1 -1
- package/dist/elements/Spinner/index.css +16 -0
- package/dist/elements/Table/DefaultCell/fields/Blocks/index.d.ts.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/Blocks/index.js +1 -2
- package/dist/elements/Table/DefaultCell/fields/Blocks/index.js.map +1 -1
- package/dist/elements/Table/OrderableRow.d.ts.map +1 -1
- package/dist/elements/Table/OrderableRow.js +1 -1
- package/dist/elements/Table/OrderableRow.js.map +1 -1
- package/dist/elements/Table/RelationshipProvider/index.d.ts.map +1 -1
- package/dist/elements/Table/RelationshipProvider/index.js +1 -0
- package/dist/elements/Table/RelationshipProvider/index.js.map +1 -1
- package/dist/elements/Table/index.css +17 -10
- package/dist/elements/Tabs/index.css +100 -0
- package/dist/elements/Tabs/index.d.ts +32 -0
- package/dist/elements/Tabs/index.d.ts.map +1 -0
- package/dist/elements/Tabs/index.js +62 -0
- package/dist/elements/Tabs/index.js.map +1 -0
- package/dist/elements/TimezonePicker/index.css +58 -24
- package/dist/elements/TimezonePicker/index.d.ts.map +1 -1
- package/dist/elements/TimezonePicker/index.js +31 -4
- package/dist/elements/TimezonePicker/index.js.map +1 -1
- package/dist/elements/Tooltip/index.css +20 -4
- package/dist/elements/Tooltip/index.d.ts.map +1 -1
- package/dist/elements/Tooltip/index.js +71 -3
- package/dist/elements/Tooltip/index.js.map +1 -1
- package/dist/elements/UnpublishButton/index.d.ts.map +1 -1
- package/dist/elements/UnpublishButton/index.js +5 -13
- package/dist/elements/UnpublishButton/index.js.map +1 -1
- package/dist/elements/UserMenu/LanguageMenu/index.d.ts +6 -0
- package/dist/elements/UserMenu/LanguageMenu/index.d.ts.map +1 -0
- package/dist/elements/UserMenu/LanguageMenu/index.js +133 -0
- package/dist/elements/UserMenu/LanguageMenu/index.js.map +1 -0
- package/dist/elements/UserMenu/SettingsMenu/index.d.ts +11 -0
- package/dist/elements/UserMenu/SettingsMenu/index.d.ts.map +1 -0
- package/dist/elements/UserMenu/SettingsMenu/index.js +114 -0
- package/dist/elements/UserMenu/SettingsMenu/index.js.map +1 -0
- package/dist/elements/UserMenu/SubMenuHeader/index.d.ts +6 -0
- package/dist/elements/UserMenu/SubMenuHeader/index.d.ts.map +1 -0
- package/dist/elements/UserMenu/SubMenuHeader/index.js +34 -0
- package/dist/elements/UserMenu/SubMenuHeader/index.js.map +1 -0
- package/dist/elements/UserMenu/ThemeMenu/index.d.ts +6 -0
- package/dist/elements/UserMenu/ThemeMenu/index.d.ts.map +1 -0
- package/dist/elements/UserMenu/ThemeMenu/index.js +145 -0
- package/dist/elements/UserMenu/ThemeMenu/index.js.map +1 -0
- package/dist/elements/UserMenu/index.css +80 -0
- package/dist/elements/UserMenu/index.d.ts +9 -0
- package/dist/elements/UserMenu/index.d.ts.map +1 -0
- package/dist/elements/UserMenu/index.js +201 -0
- package/dist/elements/UserMenu/index.js.map +1 -0
- package/dist/elements/WhereBuilder/Condition/index.css +1 -1
- package/dist/elements/WhereBuilder/Condition/index.d.ts.map +1 -1
- package/dist/elements/WhereBuilder/Condition/index.js +3 -0
- package/dist/elements/WhereBuilder/Condition/index.js.map +1 -1
- package/dist/exports/client/index.d.ts +12 -1
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +2 -2
- package/dist/exports/client/index.js.map +3 -3
- package/dist/exports/shared/index.js +2 -2
- package/dist/exports/shared/index.js.map +2 -2
- package/dist/fields/Blocks/BlockSelector/BlockSearch/index.css +1 -49
- package/dist/fields/Blocks/BlockSelector/BlockSearch/index.d.ts.map +1 -1
- package/dist/fields/Blocks/BlockSelector/BlockSearch/index.js +27 -20
- package/dist/fields/Blocks/BlockSelector/BlockSearch/index.js.map +1 -1
- package/dist/fields/Blocks/BlockSelector/index.css +17 -3
- package/dist/fields/Blocks/BlockSelector/index.js +1 -1
- package/dist/fields/Blocks/BlockSelector/index.js.map +1 -1
- package/dist/fields/Blocks/index.d.ts.map +1 -1
- package/dist/fields/Blocks/index.js +6 -11
- package/dist/fields/Blocks/index.js.map +1 -1
- package/dist/fields/Group/index.css +1 -1
- package/dist/fields/Join/index.js +1 -1
- package/dist/fields/Join/index.js.map +1 -1
- package/dist/fields/Relationship/select-components/MultiValueLabel/index.css +3 -3
- package/dist/fields/Row/index.d.ts +1 -1
- package/dist/fields/Tabs/Tab/index.d.ts +0 -1
- package/dist/fields/Tabs/Tab/index.d.ts.map +1 -1
- package/dist/fields/Tabs/Tab/index.js +12 -23
- package/dist/fields/Tabs/Tab/index.js.map +1 -1
- package/dist/fields/Tabs/index.d.ts.map +1 -1
- package/dist/fields/Tabs/index.js +37 -37
- package/dist/fields/Tabs/index.js.map +1 -1
- package/dist/fields/Upload/HasMany/index.css +4 -0
- package/dist/forms/RenderFields/RenderField.d.ts +1 -1
- package/dist/forms/RenderFields/RenderField.js +2 -1
- package/dist/forms/RenderFields/RenderField.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/promise.js +1 -1
- package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/promise.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.js +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.js.map +1 -1
- package/dist/forms/useField/index.js.map +1 -1
- package/dist/icons/Dots/index.css +4 -4
- package/dist/icons/Gear/index.d.ts.map +1 -1
- package/dist/icons/Gear/index.js +8 -1
- package/dist/icons/Gear/index.js.map +1 -1
- package/dist/icons/InteractionEnter/index.css +5 -0
- package/dist/icons/InteractionEnter/index.d.ts +11 -0
- package/dist/icons/InteractionEnter/index.d.ts.map +1 -0
- package/dist/icons/InteractionEnter/index.js +25 -0
- package/dist/icons/InteractionEnter/index.js.map +1 -0
- package/dist/icons/{Write → Key}/index.css +1 -1
- package/dist/icons/Key/index.d.ts +7 -0
- package/dist/icons/Key/index.d.ts.map +1 -0
- package/dist/icons/Key/index.js +24 -0
- package/dist/icons/Key/index.js.map +1 -0
- package/dist/icons/LogOut/index.js +2 -2
- package/dist/icons/LogOut/index.js.map +1 -1
- package/dist/icons/Schedule/index.d.ts.map +1 -1
- package/dist/icons/Schedule/index.js +38 -39
- package/dist/icons/Schedule/index.js.map +1 -1
- package/dist/icons/VariableColor/index.css +5 -0
- package/dist/icons/VariableColor/index.d.ts +7 -0
- package/dist/icons/VariableColor/index.d.ts.map +1 -0
- package/dist/icons/VariableColor/index.js +23 -0
- package/dist/icons/VariableColor/index.js.map +1 -0
- package/dist/icons/WarningTriangle/index.css +5 -0
- package/dist/icons/WarningTriangle/index.d.ts +6 -0
- package/dist/icons/WarningTriangle/index.d.ts.map +1 -0
- package/dist/icons/WarningTriangle/index.js +21 -0
- package/dist/icons/WarningTriangle/index.js.map +1 -0
- package/dist/icons/Write/index.d.ts +0 -1
- package/dist/icons/Write/index.d.ts.map +1 -1
- package/dist/icons/Write/index.js +1 -2
- package/dist/icons/Write/index.js.map +1 -1
- package/dist/providers/Auth/index.d.ts +3 -1
- package/dist/providers/Auth/index.d.ts.map +1 -1
- package/dist/providers/Auth/index.js +8 -3
- package/dist/providers/Auth/index.js.map +1 -1
- package/dist/providers/Config/index.js.map +1 -1
- package/dist/providers/DocumentInfo/index.d.ts.map +1 -1
- package/dist/providers/DocumentInfo/index.js +4 -0
- package/dist/providers/DocumentInfo/index.js.map +1 -1
- package/dist/providers/DocumentInfo/types.d.ts +4 -0
- package/dist/providers/DocumentInfo/types.d.ts.map +1 -1
- package/dist/providers/DocumentInfo/types.js.map +1 -1
- package/dist/providers/ListQuery/index.d.ts.map +1 -1
- package/dist/providers/ListQuery/index.js +1 -8
- package/dist/providers/ListQuery/index.js.map +1 -1
- package/dist/providers/Root/index.d.ts.map +1 -1
- package/dist/providers/Root/index.js +27 -24
- package/dist/providers/Root/index.js.map +1 -1
- package/dist/providers/TableColumns/RenderDefaultCell/index.css +1 -0
- package/dist/providers/Theme/index.d.ts +17 -2
- package/dist/providers/Theme/index.d.ts.map +1 -1
- package/dist/providers/Theme/index.js +126 -75
- package/dist/providers/Theme/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/templates/Default/index.d.ts.map +1 -1
- package/dist/templates/Default/index.js +9 -1
- package/dist/templates/Default/index.js.map +1 -1
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.js +1 -2
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.js.map +1 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js +1 -2
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js.map +1 -1
- package/dist/utilities/copyDataFromLocale.js +1 -1
- package/dist/utilities/copyDataFromLocale.js.map +1 -1
- package/dist/utilities/formatDocTitle/formatDateTitle.d.ts.map +1 -1
- package/dist/utilities/formatDocTitle/formatDateTitle.js +1 -1
- package/dist/utilities/formatDocTitle/formatDateTitle.js.map +1 -1
- package/dist/utilities/getHasScheduledPublish.d.ts +12 -0
- package/dist/utilities/getHasScheduledPublish.d.ts.map +1 -0
- package/dist/utilities/getHasScheduledPublish.js +38 -0
- package/dist/utilities/getHasScheduledPublish.js.map +1 -0
- package/dist/utilities/getVersions.d.ts.map +1 -1
- package/dist/utilities/getVersions.js +1 -21
- package/dist/utilities/getVersions.js.map +1 -1
- package/dist/utilities/renderTable.js +1 -1
- package/dist/utilities/renderTable.js.map +1 -1
- package/dist/utilities/traverseForLocalizedFields.d.ts.map +1 -1
- package/dist/utilities/traverseForLocalizedFields.js +3 -0
- package/dist/utilities/traverseForLocalizedFields.js.map +1 -1
- package/dist/views/Account/ResetPreferences/index.js +1 -0
- package/dist/views/Account/ResetPreferences/index.js.map +1 -1
- package/dist/views/Account/Settings/index.css +30 -13
- package/dist/views/Account/ToggleTheme/index.d.ts.map +1 -1
- package/dist/views/Account/ToggleTheme/index.js +31 -47
- package/dist/views/Account/ToggleTheme/index.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/index.client.js.map +1 -1
- package/dist/views/Document/index.d.ts.map +1 -1
- package/dist/views/Document/index.js +10 -1
- package/dist/views/Document/index.js.map +1 -1
- package/dist/views/Edit/Auth/APIKey.d.ts.map +1 -1
- package/dist/views/Edit/Auth/APIKey.js +10 -32
- package/dist/views/Edit/Auth/APIKey.js.map +1 -1
- package/dist/views/Edit/Auth/index.css +0 -67
- package/dist/views/Edit/index.d.ts.map +1 -1
- package/dist/views/Edit/index.js +62 -48
- package/dist/views/Edit/index.js.map +1 -1
- package/dist/views/HierarchyList/DocumentListSelection/index.js +4 -4
- package/dist/views/HierarchyList/DocumentListSelection/index.js.map +1 -1
- package/dist/views/List/ListHeader/index.css +23 -1
- package/dist/views/List/ListHeader/index.d.ts.map +1 -1
- package/dist/views/List/ListHeader/index.js +0 -1
- package/dist/views/List/ListHeader/index.js.map +1 -1
- package/dist/views/List/ListSelection/index.d.ts.map +1 -1
- package/dist/views/List/ListSelection/index.js +80 -29
- package/dist/views/List/ListSelection/index.js.map +1 -1
- package/dist/views/List/handleGroupBy.d.ts.map +1 -1
- package/dist/views/List/handleGroupBy.js +9 -0
- package/dist/views/List/handleGroupBy.js.map +1 -1
- package/dist/views/List/index.client.d.ts.map +1 -1
- package/dist/views/List/index.client.js +4 -3
- package/dist/views/List/index.client.js.map +1 -1
- package/dist/views/List/index.css +15 -0
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/index.js +11 -4
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/List/renderListViewSlots.d.ts.map +1 -1
- package/dist/views/List/renderListViewSlots.js +8 -0
- package/dist/views/List/renderListViewSlots.js.map +1 -1
- package/dist/views/Logout/LogoutClient.d.ts +14 -0
- package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
- package/dist/views/Logout/LogoutClient.js +38 -32
- package/dist/views/Logout/LogoutClient.js.map +1 -1
- package/dist/views/Logout/index.d.ts.map +1 -1
- package/dist/views/Logout/index.js +7 -2
- package/dist/views/Logout/index.js.map +1 -1
- package/dist/views/Verify/index.client.d.ts +4 -0
- package/dist/views/Verify/index.client.d.ts.map +1 -1
- package/dist/views/Verify/index.client.js +81 -0
- package/dist/views/Verify/index.client.js.map +1 -1
- package/dist/views/Verify/index.css +38 -0
- package/dist/views/Verify/index.d.ts +1 -1
- package/dist/views/Verify/index.d.ts.map +1 -1
- package/dist/views/Verify/index.js +13 -19
- package/dist/views/Verify/index.js.map +1 -1
- package/dist/views/Version/Default/index.css +3 -5
- package/dist/views/Version/Default/index.d.ts.map +1 -1
- package/dist/views/Version/Default/index.js +7 -28
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js +2 -2
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Checkbox/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js +3 -3
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js.map +1 -1
- package/dist/views/Version/Restore/index.css +2 -2
- package/dist/views/Version/SelectComparison/VersionDrawer/index.css +5 -0
- package/dist/views/Version/SelectComparison/VersionDrawer/index.d.ts +1 -1
- package/dist/views/Version/SelectComparison/VersionDrawer/index.d.ts.map +1 -1
- package/dist/views/Version/SelectComparison/VersionDrawer/index.js +1 -2
- package/dist/views/Version/SelectComparison/VersionDrawer/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/index.css +5 -0
- package/dist/views/Version/SelectComparison/index.d.ts +1 -1
- package/dist/views/Version/SelectComparison/index.d.ts.map +1 -1
- package/dist/views/Version/SelectComparison/index.js +1 -1
- package/dist/views/Version/SelectComparison/index.js.map +1 -1
- package/dist/views/Version/SelectLocales/index.d.ts +1 -2
- package/dist/views/Version/SelectLocales/index.d.ts.map +1 -1
- package/dist/views/Version/SelectLocales/index.js +83 -32
- package/dist/views/Version/SelectLocales/index.js.map +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
- package/dist/views/Versions/index.css +20 -13
- package/dist/views/Versions/index.d.ts +1 -1
- package/dist/views/Versions/index.d.ts.map +1 -1
- package/dist/views/Versions/index.js +3 -26
- package/dist/views/Versions/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/elements/BulkUpload/AddingFilesView/index.scss +0 -25
- package/dist/elements/BulkUpload/EditForm/index.scss +0 -11
- package/dist/elements/BulkUpload/EditMany/index.scss +0 -171
- package/dist/elements/EditMany/index.scss +0 -182
- package/dist/elements/FileDetails/DraggableFileDetails/index.scss +0 -35
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.scss +0 -78
- package/dist/elements/Hierarchy/Field/index.scss +0 -41
- package/dist/elements/Hierarchy/MoveMany/index.scss +0 -7
- package/dist/elements/Hierarchy/Tree/LoadMore/index.scss +0 -26
- package/dist/elements/Hierarchy/Tree/TreeConnector.d.ts +0 -7
- package/dist/elements/Hierarchy/Tree/TreeConnector.d.ts.map +0 -1
- package/dist/elements/Hierarchy/Tree/TreeConnector.js +0 -23
- package/dist/elements/Hierarchy/Tree/TreeConnector.js.map +0 -1
- package/dist/elements/LoadMoreRow/index.scss +0 -45
- package/dist/fields/Tabs/Tab/index.css +0 -82
- package/dist/views/Unauthorized/index.scss +0 -14
- package/dist/views/Verify/index.scss +0 -18
- package/dist/views/Version/SelectComparison/VersionDrawer/index.scss +0 -18
- package/dist/views/Version/SelectComparison/index.scss +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["appendDateTimezoneSelectFields","appendUploadSelectFields","combineWhereConstraints","formatAdminURL","isNumber","mergeListSearchAndWhere","transformColumnsToPreferences","transformColumnsToSearchParams","React","Fragment","RenderServerComponent","DefaultListView","HierarchyListView","HydrateAuthProvider","HydrateHierarchyProvider","ListQueryProvider","getColumns","getDocumentPermissions","renderFilters","renderTable","upsertPreferences","enrichDocsWithVersionStatus","handleGroupBy","handleHierarchy","renderListViewSlots","resolveAllFilterOptions","transformColumnsToSelect","renderListView","args","clientConfig","ComponentOverride","customCellProps","disableBulkDelete","disableBulkEdit","disableQueryPresets","drawerSlug","enableRowSelections","initPageResult","overrideEntityVisibility","params","query","queryFromArgs","searchParams","trash","viewType","collectionConfig","slug","collectionSlug","locale","fullLocale","permissions","req","i18n","payload","config","queryFromReq","user","visibleEntities","routes","admin","adminRoute","collections","read","includes","Error","columnsFromQuery","columns","queryByGroup","JSON","parse","collectionPreferences","key","value","groupBy","limit","Number","undefined","preset","sort","queryPreset","queryPresetPermissions","findByID","id","collection","depth","overrideAccess","data","docPermissions","err","logger","error","where","columnPreference","page","pagination","defaultLimit","defaultSort","baseFilterConstraint","baseFilter","baseListFilter","whereWithMergedSearch","search","and","deletedAt","exists","Table","columnState","docs","hasNextPage","hasPrevPage","nextPage","pagingCounter","prevPage","totalDocs","totalPages","clientCollectionConfig","find","c","select","fields","flattenedFields","orderable","_order","versions","drafts","_status","isHierarchyCollection","Boolean","hierarchy","hierarchyParentFieldName","parentFieldName","hierarchyParentId","parentParam","db","defaultIDType","hierarchyData","fieldPermissions","draft","fallbackLocale","includeLockStatus","orderableFieldName","useAsTitle","name","msg","HierarchyIcon","isHierarchyView","typeFilterParam","typeFilter","length","split","parentId","childrenData","hierarchyConfig","Component","components","Icon","importMap","renderedFilters","resolvedFilterOptions","staticDescription","description","t","newDocumentURL","path","hasCreatePermission","create","hasDeletePermission","hasTrashPermission","notFoundDocId","notFound","serverProps","listPreferences","listSearchableFields","server","listViewSlots","clientProps","isInDrawer","stringify","RenderedListViewComponent","views","list","Fallback","List","_jsxs","_jsx","allowedCollections","expandedNodes","breadcrumbs","slice","map","b","parent","tableData","treeLimit","typeFieldName","collectionSpecific","fieldName","modifySearchParams","ListView","RenderedList","message","console"],"sources":["../../../src/views/List/index.tsx"],"sourcesContent":["import type {\n AdminViewServerProps,\n CollectionPreferences,\n Column,\n ColumnPreference,\n HierarchyViewData,\n ListQuery,\n ListViewClientProps,\n ListViewServerPropsOnly,\n PaginatedDocs,\n PayloadComponent,\n QueryPreset,\n SanitizedCollectionPermission,\n} from 'payload'\n\nimport {\n appendDateTimezoneSelectFields,\n appendUploadSelectFields,\n combineWhereConstraints,\n formatAdminURL,\n isNumber,\n mergeListSearchAndWhere,\n transformColumnsToPreferences,\n transformColumnsToSearchParams,\n} from 'payload/shared'\nimport React, { Fragment } from 'react'\n\nimport { RenderServerComponent } from '../../elements/RenderServerComponent/index.js'\n/* eslint-disable payload/no-imports-from-exports-dir -- Server component must reference exports/client bundle for proper client boundary in prod builds */\nimport {\n DefaultListView,\n HierarchyListView,\n HydrateAuthProvider,\n HydrateHierarchyProvider,\n ListQueryProvider,\n} from '../../exports/client/index.js'\n/* eslint-enable payload/no-imports-from-exports-dir */\nimport { getColumns } from '../../utilities/getColumns.js'\nimport { getDocumentPermissions } from '../../utilities/getDocumentPermissions.js'\nimport { renderFilters, renderTable } from '../../utilities/renderTable.js'\nimport { upsertPreferences } from '../../utilities/upsertPreferences.js'\nimport { enrichDocsWithVersionStatus } from './enrichDocsWithVersionStatus.js'\nimport { handleGroupBy } from './handleGroupBy.js'\nimport { handleHierarchy } from './handleHierarchy.js'\nimport { renderListViewSlots } from './renderListViewSlots.js'\nimport { resolveAllFilterOptions } from './resolveAllFilterOptions.js'\nimport { transformColumnsToSelect } from './transformColumnsToSelect.js'\nimport './index.css'\n\n/**\n * @internal\n */\nexport type RenderListViewArgs = {\n /**\n * Allows providing your own list view component. This will override the default list view component and\n * the collection's configured list view component (if any).\n */\n ComponentOverride?:\n | PayloadComponent\n | React.ComponentType<ListViewClientProps | (ListViewClientProps & ListViewServerPropsOnly)>\n customCellProps?: Record<string, any>\n disableBulkDelete?: boolean\n disableBulkEdit?: boolean\n disableQueryPresets?: boolean\n drawerSlug?: string\n enableRowSelections: boolean\n overrideEntityVisibility?: boolean\n /**\n * If not ListQuery is provided, `req.query` will be used.\n */\n query?: ListQuery\n redirectAfterDelete?: boolean\n redirectAfterDuplicate?: boolean\n /**\n * @experimental This prop is subject to change in future releases.\n */\n trash?: boolean\n} & AdminViewServerProps\n\n/**\n * This function is responsible for rendering\n * the list view on the server for both:\n * - default list view\n * - list view within drawers\n *\n * @internal\n */\nexport const renderListView = async (\n args: RenderListViewArgs,\n): Promise<{\n List: React.ReactNode\n}> => {\n const {\n clientConfig,\n ComponentOverride,\n customCellProps,\n disableBulkDelete,\n disableBulkEdit,\n disableQueryPresets,\n drawerSlug,\n enableRowSelections,\n initPageResult,\n overrideEntityVisibility,\n params,\n query: queryFromArgs,\n searchParams,\n trash,\n viewType,\n } = args\n\n const {\n collectionConfig,\n collectionConfig: { slug: collectionSlug },\n locale: fullLocale,\n permissions,\n req,\n req: {\n i18n,\n payload,\n payload: { config },\n query: queryFromReq,\n user,\n },\n visibleEntities,\n } = initPageResult\n const {\n routes: { admin: adminRoute },\n } = config\n\n if (\n !collectionConfig ||\n !permissions?.collections?.[collectionSlug]?.read ||\n (!visibleEntities.collections.includes(collectionSlug) && !overrideEntityVisibility)\n ) {\n throw new Error('not-found')\n }\n\n const query: ListQuery = queryFromArgs || queryFromReq\n\n const columnsFromQuery: ColumnPreference[] = transformColumnsToPreferences(query?.columns)\n\n query.queryByGroup =\n query?.queryByGroup && typeof query.queryByGroup === 'string'\n ? JSON.parse(query.queryByGroup)\n : query?.queryByGroup\n\n const collectionPreferences = await upsertPreferences<CollectionPreferences>({\n key: `collection-${collectionSlug}`,\n req,\n value: {\n columns: columnsFromQuery,\n groupBy: query?.groupBy,\n limit: isNumber(query?.limit) ? Number(query.limit) : undefined,\n preset: query?.preset,\n sort: query?.sort as string,\n },\n })\n\n let queryPreset: QueryPreset | undefined\n let queryPresetPermissions: SanitizedCollectionPermission | undefined =\n permissions?.collections?.['payload-query-presets']\n\n if (collectionPreferences?.preset) {\n try {\n queryPreset = (await payload.findByID({\n id: collectionPreferences?.preset,\n collection: 'payload-query-presets',\n depth: 0,\n overrideAccess: false,\n user,\n })) as QueryPreset\n\n if (queryPreset) {\n queryPresetPermissions = (\n await getDocumentPermissions({\n id: queryPreset.id,\n collectionConfig: req.payload.collections['payload-query-presets'].config,\n data: queryPreset,\n req,\n })\n )?.docPermissions\n }\n } catch (err) {\n req.payload.logger.error(`Error fetching query preset or preset permissions: ${err}`)\n }\n }\n\n query.preset = queryPreset?.id\n if (queryPreset?.where && !query.where) {\n query.where = queryPreset.where\n }\n query.groupBy = query.groupBy ?? queryPreset?.groupBy ?? collectionPreferences?.groupBy\n\n const columnPreference = query.columns\n ? transformColumnsToPreferences(query.columns)\n : (queryPreset?.columns ?? collectionPreferences?.columns)\n query.columns = transformColumnsToSearchParams(columnPreference)\n\n query.page = isNumber(query?.page) ? Number(query.page) : 0\n\n query.limit = collectionPreferences?.limit || collectionConfig.admin.pagination.defaultLimit\n\n query.sort =\n collectionPreferences?.sort ||\n (typeof collectionConfig.defaultSort === 'string' ? collectionConfig.defaultSort : undefined)\n\n const baseFilterConstraint = await (\n collectionConfig.admin?.baseFilter ?? collectionConfig.admin?.baseListFilter\n )?.({\n limit: query.limit,\n page: query.page,\n req,\n sort: query.sort,\n })\n\n let whereWithMergedSearch = mergeListSearchAndWhere({\n collectionConfig,\n search: typeof query?.search === 'string' ? query.search : undefined,\n where: combineWhereConstraints([query?.where, baseFilterConstraint]),\n })\n\n if (trash === true) {\n whereWithMergedSearch = {\n and: [\n whereWithMergedSearch,\n {\n deletedAt: {\n exists: true,\n },\n },\n ],\n }\n }\n\n let Table: React.ReactNode | React.ReactNode[] = null\n let columnState: Column[] = []\n let data: PaginatedDocs = {\n // no results default\n docs: [],\n hasNextPage: false,\n hasPrevPage: false,\n limit: query.limit,\n nextPage: null,\n page: 1,\n pagingCounter: 0,\n prevPage: null,\n totalDocs: 0,\n totalPages: 0,\n }\n\n const clientCollectionConfig = clientConfig.collections.find((c) => c.slug === collectionSlug)\n\n const columns = getColumns({\n clientConfig,\n collectionConfig: clientCollectionConfig,\n collectionSlug,\n columns: columnPreference,\n i18n,\n permissions,\n })\n\n /** Automatically force select active columns. */\n const select = transformColumnsToSelect(columns)\n\n /** Force select image fields for list view thumbnails */\n appendUploadSelectFields({\n collectionConfig,\n select,\n })\n\n /** Force select `_tz` siblings for any timezone-enabled date fields in select */\n appendDateTimezoneSelectFields({\n fields: collectionConfig.flattenedFields,\n select,\n })\n\n /** Force select `_order` for orderable collections — OrderableTable needs it to compute reorder targets */\n if (collectionConfig.orderable === true) {\n select._order = true\n }\n\n /** Force select `_status` for drafts-enabled collections — needed by `enrichDocsWithVersionStatus` and `formatDocURL` */\n if (collectionConfig.versions?.drafts) {\n select._status = true\n }\n\n // Check for hierarchy parent param\n const isHierarchyCollection = Boolean(collectionConfig.hierarchy)\n const hierarchyParentFieldName =\n typeof collectionConfig.hierarchy === 'object'\n ? (collectionConfig.hierarchy.parentFieldName ?? 'parent')\n : 'parent'\n let hierarchyParentId: null | number | string = null\n\n if (isHierarchyCollection) {\n const parentParam = searchParams?.[hierarchyParentFieldName]\n if (parentParam === 'null' || parentParam === undefined) {\n hierarchyParentId = null\n } else if (typeof parentParam === 'string') {\n hierarchyParentId =\n payload.db.defaultIDType === 'number' && isNumber(parentParam)\n ? Number(parentParam)\n : parentParam\n }\n }\n\n // Hierarchy data for client-side rendering\n let hierarchyData: HierarchyViewData | undefined\n\n try {\n if (collectionConfig.admin.groupBy && query.groupBy) {\n ;({ columnState, data, Table } = await handleGroupBy({\n clientCollectionConfig,\n clientConfig,\n collectionConfig,\n collectionSlug,\n columns,\n customCellProps,\n drawerSlug,\n enableRowSelections,\n fieldPermissions: permissions?.collections?.[collectionSlug]?.fields,\n query,\n req,\n select,\n trash,\n user,\n viewType,\n where: whereWithMergedSearch,\n }))\n\n // Enrich documents with correct display status for drafts\n data = await enrichDocsWithVersionStatus({\n collectionConfig,\n data,\n req,\n })\n } else {\n data = await req.payload.find({\n collection: collectionSlug,\n depth: 0,\n draft: true,\n fallbackLocale: false,\n includeLockStatus: true,\n limit: query?.limit ? Number(query.limit) : undefined,\n locale: req.locale,\n overrideAccess: false,\n page: query?.page ? Number(query.page) : undefined,\n req,\n select,\n sort: query?.sort,\n trash,\n user,\n where: whereWithMergedSearch,\n })\n\n // Enrich documents with correct display status for drafts\n data = await enrichDocsWithVersionStatus({\n collectionConfig,\n data,\n req,\n })\n ;({ columnState, Table } = renderTable({\n clientCollectionConfig,\n collectionConfig,\n columns,\n customCellProps,\n data,\n drawerSlug,\n enableRowSelections,\n fieldPermissions: permissions?.collections?.[collectionSlug]?.fields,\n i18n: req.i18n,\n orderableFieldName: collectionConfig.orderable === true ? '_order' : undefined,\n payload: req.payload,\n query,\n req,\n useAsTitle: collectionConfig.admin.useAsTitle,\n viewType,\n }))\n }\n } catch (err) {\n if (err.name !== 'QueryError') {\n // QueryErrors are expected when a user filters by a field they do not have access to\n req.payload.logger.error({\n err,\n msg: `There was an error fetching the list view data for collection ${collectionSlug}`,\n })\n throw err\n }\n }\n\n // Fetch hierarchy data only for hierarchy view\n let HierarchyIcon: React.ReactNode | undefined\n const isHierarchyView = viewType === 'hierarchy'\n\n if (isHierarchyCollection && isHierarchyView) {\n // Extract typeFilter from searchParams (comma-separated list of collection slugs)\n const typeFilterParam = searchParams?.typeFilter\n const typeFilter =\n typeof typeFilterParam === 'string' && typeFilterParam.length > 0\n ? typeFilterParam.split(',')\n : undefined\n\n hierarchyData = await handleHierarchy({\n baseFilter: baseFilterConstraint,\n collectionConfig,\n collectionSlug,\n parentId: hierarchyParentId,\n permissions,\n req,\n search: typeof query?.search === 'string' ? query.search : undefined,\n typeFilter,\n user,\n })\n\n data = hierarchyData.childrenData\n\n // Resolve hierarchy icon from collection config\n const hierarchyConfig =\n typeof collectionConfig.hierarchy === 'object' ? collectionConfig.hierarchy : undefined\n\n HierarchyIcon = RenderServerComponent({\n Component: hierarchyConfig?.admin?.components?.Icon,\n importMap: payload.importMap,\n key: `hierarchy-icon-${collectionSlug}`,\n })\n }\n\n const renderedFilters = renderFilters(collectionConfig.fields, req.payload.importMap)\n\n const resolvedFilterOptions = await resolveAllFilterOptions({\n fields: collectionConfig.fields,\n req,\n })\n\n const staticDescription =\n typeof collectionConfig.admin.description === 'function'\n ? collectionConfig.admin.description({ t: i18n.t })\n : collectionConfig.admin.description\n\n const newDocumentURL = formatAdminURL({\n adminRoute,\n path: `/collections/${collectionSlug}/create`,\n })\n\n const hasCreatePermission = permissions?.collections?.[collectionSlug]?.create\n\n const { hasDeletePermission, hasTrashPermission } = await getDocumentPermissions({\n collectionConfig,\n // Empty object serves as base for computing differentiated trash/delete permissions\n data: {},\n req,\n })\n\n // Check if there's a notFound query parameter (document ID that wasn't found)\n const notFoundDocId = typeof searchParams?.notFound === 'string' ? searchParams.notFound : null\n\n const serverProps: ListViewServerPropsOnly = {\n collectionConfig,\n data,\n i18n,\n limit: query.limit,\n listPreferences: collectionPreferences,\n listSearchableFields: collectionConfig.admin.listSearchableFields,\n locale: fullLocale,\n params,\n payload,\n permissions,\n searchParams,\n server: req.server,\n user,\n }\n\n const listViewSlots = renderListViewSlots({\n clientProps: {\n collectionSlug,\n hasCreatePermission,\n hasDeletePermission,\n hasTrashPermission,\n newDocumentURL,\n },\n collectionConfig,\n description: staticDescription,\n notFoundDocId,\n payload,\n serverProps,\n })\n\n const isInDrawer = Boolean(drawerSlug)\n\n // Needed to prevent: Only plain objects can be passed to Client Components from Server Components. Objects with toJSON methods are not supported. Convert it manually to a simple value before passing it to props.\n // Is there a way to avoid this? The `where` object is already seemingly plain, but is not bc it originates from the params.\n query.where = query?.where ? JSON.parse(JSON.stringify(query?.where || {})) : undefined\n\n const RenderedListViewComponent = RenderServerComponent({\n clientProps: {\n ...listViewSlots,\n baseFilter: baseFilterConstraint,\n collectionSlug,\n columnState,\n disableBulkDelete,\n disableBulkEdit: collectionConfig.disableBulkEdit ?? disableBulkEdit,\n disableQueryPresets,\n enableRowSelections,\n hasCreatePermission,\n hasDeletePermission,\n hasTrashPermission,\n hierarchyData,\n HierarchyIcon,\n listPreferences: collectionPreferences,\n newDocumentURL,\n queryPreset,\n queryPresetPermissions,\n renderedFilters,\n resolvedFilterOptions,\n Table,\n viewType,\n } satisfies ListViewClientProps,\n Component: ComponentOverride ?? collectionConfig?.admin?.components?.views?.list?.Component,\n Fallback: viewType === 'hierarchy' ? HierarchyListView : DefaultListView,\n importMap: payload.importMap,\n key: `list-view-${collectionSlug}-${viewType}`,\n serverProps,\n })\n\n return {\n List: (\n <Fragment>\n <HydrateAuthProvider permissions={permissions} />\n {isHierarchyView ? (\n <Fragment>\n <HydrateHierarchyProvider\n allowedCollections={hierarchyData?.allowedCollections}\n baseFilter={baseFilterConstraint}\n collectionSlug={collectionSlug}\n expandedNodes={hierarchyData?.breadcrumbs?.slice(0, -1).map((b) => b.id)}\n parent={hierarchyData?.parent}\n parentFieldName={\n typeof collectionConfig.hierarchy === 'object'\n ? collectionConfig.hierarchy?.parentFieldName\n : undefined\n }\n tableData={data}\n treeLimit={\n typeof collectionConfig.hierarchy === 'object'\n ? collectionConfig.hierarchy?.admin?.treeLimit\n : undefined\n }\n typeFieldName={\n typeof collectionConfig.hierarchy === 'object' &&\n collectionConfig.hierarchy?.collectionSpecific &&\n typeof collectionConfig.hierarchy.collectionSpecific === 'object'\n ? collectionConfig.hierarchy.collectionSpecific.fieldName\n : undefined\n }\n />\n {RenderedListViewComponent}\n </Fragment>\n ) : (\n <ListQueryProvider\n collectionSlug={collectionSlug}\n data={data}\n modifySearchParams={!isInDrawer}\n orderableFieldName={collectionConfig.orderable === true ? '_order' : undefined}\n query={query}\n >\n {RenderedListViewComponent}\n </ListQueryProvider>\n )}\n </Fragment>\n ),\n }\n}\n\nexport const ListView: React.FC<RenderListViewArgs> = async (args) => {\n try {\n const { List: RenderedList } = await renderListView({ ...args, enableRowSelections: true })\n return RenderedList\n } catch (error) {\n if (error.message === 'not-found') {\n args.initPageResult.req.server.notFound()\n } else {\n console.error(error) // eslint-disable-line no-console\n }\n }\n}\n"],"mappings":";AAeA,SACEA,8BAA8B,EAC9BC,wBAAwB,EACxBC,uBAAuB,EACvBC,cAAc,EACdC,QAAQ,EACRC,uBAAuB,EACvBC,6BAA6B,EAC7BC,8BAA8B,QACzB;AACP,OAAOC,KAAA,IAASC,QAAQ,QAAQ;AAEhC,SAASC,qBAAqB,QAAQ;AACtC;AACA,SACEC,eAAe,EACfC,iBAAiB,EACjBC,mBAAmB,EACnBC,wBAAwB,EACxBC,iBAAiB,QACZ;AACP;AACA,SAASC,UAAU,QAAQ;AAC3B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,aAAa,EAAEC,WAAW,QAAQ;AAC3C,SAASC,iBAAiB,QAAQ;AAClC,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,aAAa,QAAQ;AAC9B,SAASC,eAAe,QAAQ;AAChC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,uBAAuB,QAAQ;AACxC,SAASC,wBAAwB,QAAQ;AACzC,OAAO;AAgCP;;;;;;;;AAQA,OAAO,MAAMC,cAAA,GAAiB,MAC5BC,IAAA;EAIA,MAAM;IACJC,YAAY;IACZC,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F,SAAS,EAAEE,eAAA,GAC5BtD,SAAA;UAENoH,SAAA,EAAW1G,IAAA;UACX2G,SAAA,EACE,OAAOpJ,gBAAA,CAAiBmF,SAAS,KAAK,WAClCnF,gBAAA,CAAiBmF,SAAS,EAAErE,KAAA,EAAOsI,SAAA,GACnCrH,SAAA;UAENsH,aAAA,EACE,OAAOrJ,gBAAA,CAAiBmF,SAAS,KAAK,YACtCnF,gBAAA,CAAiBmF,SAAS,EAAEmE,kBAAA,IAC5B,OAAOtJ,gBAAA,CAAiBmF,SAAS,CAACmE,kBAAkB,KAAK,WACrDtJ,gBAAA,CAAiBmF,SAAS,CAACmE,kBAAkB,CAACC,SAAS,GACvDxH;YAGPsG,yBAAA;wBAGHM,IAAA,CAACzK,iBAAA;QACCgC,cAAA,EAAgBA,cAAA;QAChBuC,IAAA,EAAMA,IAAA;QACN+G,kBAAA,EAAoB,CAACrB,UAAA;QACrBpC,kBAAA,EAAoB/F,gBAAA,CAAiB4E,SAAS,KAAK,OAAO,WAAW7C,SAAA;QACrEpC,KAAA,EAAOA,KAAA;kBAEN0I;;;EAKX;AACF;AAEA,OAAO,MAAMoB,QAAA,GAAyC,MAAO1K,IAAA;EAC3D,IAAI;IACF,MAAM;MAAE0J,IAAA,EAAMiB;IAAY,CAAE,GAAG,MAAM5K,cAAA,CAAe;MAAE,GAAGC,IAAI;MAAEQ,mBAAA,EAAqB;IAAK;IACzF,OAAOmK,YAAA;EACT,EAAE,OAAO7G,KAAA,EAAO;IACd,IAAIA,KAAA,CAAM8G,OAAO,KAAK,aAAa;MACjC5K,IAAA,CAAKS,cAAc,CAACc,GAAG,CAAC0H,MAAM,CAACJ,QAAQ;IACzC,OAAO;MACLgC,OAAA,CAAQ/G,KAAK,CAACA,KAAA,GAAO;IACvB;EACF;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["appendDateTimezoneSelectFields","appendUploadSelectFields","combineWhereConstraints","formatAdminURL","isNumber","mergeListSearchAndWhere","transformColumnsToPreferences","transformColumnsToSearchParams","React","Fragment","RenderServerComponent","DefaultListView","HierarchyListView","HydrateAuthProvider","HydrateHierarchyProvider","ListQueryProvider","getColumns","getDocumentPermissions","renderFilters","renderTable","upsertPreferences","enrichDocsWithVersionStatus","handleGroupBy","handleHierarchy","renderListViewSlots","resolveAllFilterOptions","transformColumnsToSelect","renderListView","args","clientConfig","ComponentOverride","customCellProps","disableBulkDelete","disableBulkEdit","disableQueryPresets","drawerSlug","enableRowSelections","initPageResult","overrideEntityVisibility","params","query","queryFromArgs","searchParams","trash","viewType","collectionConfig","slug","collectionSlug","locale","fullLocale","permissions","req","i18n","payload","config","queryFromReq","user","visibleEntities","routes","admin","adminRoute","collections","read","includes","Error","columnsFromQuery","columns","queryByGroup","JSON","parse","collectionPreferences","key","value","groupBy","limit","Number","undefined","preset","sort","queryPreset","queryPresetPermissions","findByID","id","collection","depth","overrideAccess","data","docPermissions","err","logger","error","where","columnPreference","page","pagination","defaultLimit","defaultSort","baseFilterConstraint","baseFilter","baseListFilter","whereWithMergedSearch","search","and","deletedAt","exists","Table","columnState","docs","hasNextPage","hasPrevPage","nextPage","pagingCounter","prevPage","totalDocs","totalPages","clientCollectionConfig","find","c","select","fields","flattenedFields","orderable","_order","versions","drafts","_status","isHierarchyCollection","Boolean","hierarchy","hierarchyParentFieldName","parentFieldName","hierarchyParentId","parentParam","db","defaultIDType","hierarchyData","fieldPermissions","draft","fallbackLocale","includeLockStatus","orderableFieldName","useAsTitle","name","msg","HierarchyIcon","isHierarchyView","typeFilterParam","typeFilter","length","split","parentId","childrenData","hierarchyConfig","Component","components","Icon","importMap","renderedFilters","resolvedFilterOptions","staticDescription","description","t","newDocumentURL","path","hasCreatePermission","create","hasDeletePermission","hasTrashPermission","notFoundDocId","notFound","serverProps","listPreferences","listSearchableFields","server","listViewSlots","clientProps","isInDrawer","stringify","RenderedListViewComponent","views","list","Fallback","List","_jsxs","_jsx","allowedCollections","expandedNodes","breadcrumbs","slice","map","b","parent","tableData","treeLimit","typeFieldName","collectionSpecific","fieldName","modifySearchParams","ListView","RenderedList","message","console"],"sources":["../../../src/views/List/index.tsx"],"sourcesContent":["import type {\n AdminViewServerProps,\n CollectionPreferences,\n Column,\n ColumnPreference,\n HierarchyViewData,\n ListQuery,\n ListViewClientProps,\n ListViewServerPropsOnly,\n PaginatedDocs,\n PayloadComponent,\n QueryPreset,\n SanitizedCollectionPermission,\n} from 'payload'\n\nimport {\n appendDateTimezoneSelectFields,\n appendUploadSelectFields,\n combineWhereConstraints,\n formatAdminURL,\n isNumber,\n mergeListSearchAndWhere,\n transformColumnsToPreferences,\n transformColumnsToSearchParams,\n} from 'payload/shared'\nimport React, { Fragment } from 'react'\n\nimport { RenderServerComponent } from '../../elements/RenderServerComponent/index.js'\n/* eslint-disable payload/no-imports-from-exports-dir -- Server component must reference exports/client bundle for proper client boundary in prod builds */\nimport {\n DefaultListView,\n HierarchyListView,\n HydrateAuthProvider,\n HydrateHierarchyProvider,\n ListQueryProvider,\n} from '../../exports/client/index.js'\n/* eslint-enable payload/no-imports-from-exports-dir */\nimport { getColumns } from '../../utilities/getColumns.js'\nimport { getDocumentPermissions } from '../../utilities/getDocumentPermissions.js'\nimport { renderFilters, renderTable } from '../../utilities/renderTable.js'\nimport { upsertPreferences } from '../../utilities/upsertPreferences.js'\nimport { enrichDocsWithVersionStatus } from './enrichDocsWithVersionStatus.js'\nimport { handleGroupBy } from './handleGroupBy.js'\nimport { handleHierarchy } from './handleHierarchy.js'\nimport { renderListViewSlots } from './renderListViewSlots.js'\nimport { resolveAllFilterOptions } from './resolveAllFilterOptions.js'\nimport { transformColumnsToSelect } from './transformColumnsToSelect.js'\nimport './index.css'\n\n/**\n * @internal\n */\nexport type RenderListViewArgs = {\n /**\n * Allows providing your own list view component. This will override the default list view component and\n * the collection's configured list view component (if any).\n */\n ComponentOverride?:\n | PayloadComponent\n | React.ComponentType<ListViewClientProps | (ListViewClientProps & ListViewServerPropsOnly)>\n customCellProps?: Record<string, any>\n disableBulkDelete?: boolean\n disableBulkEdit?: boolean\n disableQueryPresets?: boolean\n drawerSlug?: string\n enableRowSelections: boolean\n overrideEntityVisibility?: boolean\n /**\n * If not ListQuery is provided, `req.query` will be used.\n */\n query?: ListQuery\n redirectAfterDelete?: boolean\n redirectAfterDuplicate?: boolean\n /**\n * @experimental This prop is subject to change in future releases.\n */\n trash?: boolean\n} & AdminViewServerProps\n\n/**\n * This function is responsible for rendering\n * the list view on the server for both:\n * - default list view\n * - list view within drawers\n *\n * @internal\n */\nexport const renderListView = async (\n args: RenderListViewArgs,\n): Promise<{\n List: React.ReactNode\n}> => {\n const {\n clientConfig,\n ComponentOverride,\n customCellProps,\n disableBulkDelete,\n disableBulkEdit,\n disableQueryPresets,\n drawerSlug,\n enableRowSelections,\n initPageResult,\n overrideEntityVisibility,\n params,\n query: queryFromArgs,\n searchParams,\n trash,\n viewType,\n } = args\n\n const {\n collectionConfig,\n collectionConfig: { slug: collectionSlug },\n locale: fullLocale,\n permissions,\n req,\n req: {\n i18n,\n payload,\n payload: { config },\n query: queryFromReq,\n user,\n },\n visibleEntities,\n } = initPageResult\n const {\n routes: { admin: adminRoute },\n } = config\n\n if (\n !collectionConfig ||\n !permissions?.collections?.[collectionSlug]?.read ||\n (!visibleEntities.collections.includes(collectionSlug) && !overrideEntityVisibility)\n ) {\n throw new Error('not-found')\n }\n\n const query: ListQuery = queryFromArgs || queryFromReq\n\n const columnsFromQuery: ColumnPreference[] = transformColumnsToPreferences(query?.columns)\n\n query.queryByGroup =\n query?.queryByGroup && typeof query.queryByGroup === 'string'\n ? JSON.parse(query.queryByGroup)\n : query?.queryByGroup\n\n const collectionPreferences = await upsertPreferences<CollectionPreferences>({\n key: `collection-${collectionSlug}`,\n req,\n value: {\n columns: columnsFromQuery,\n groupBy: query?.groupBy,\n limit: isNumber(query?.limit) ? Number(query.limit) : undefined,\n preset: query?.preset,\n sort: query?.sort as string,\n },\n })\n\n let queryPreset: QueryPreset | undefined\n let queryPresetPermissions: SanitizedCollectionPermission | undefined =\n permissions?.collections?.['payload-query-presets']\n\n if (collectionPreferences?.preset) {\n try {\n queryPreset = (await payload.findByID({\n id: collectionPreferences?.preset,\n collection: 'payload-query-presets',\n depth: 0,\n overrideAccess: false,\n user,\n })) as QueryPreset\n\n if (queryPreset) {\n queryPresetPermissions = (\n await getDocumentPermissions({\n id: queryPreset.id,\n collectionConfig: req.payload.collections['payload-query-presets'].config,\n data: queryPreset,\n req,\n })\n )?.docPermissions\n }\n } catch (err) {\n req.payload.logger.error(`Error fetching query preset or preset permissions: ${err}`)\n }\n }\n\n query.preset = queryPreset?.id\n if (queryPreset?.where && !query.where) {\n query.where = queryPreset.where\n }\n // Prefer an explicit user preference (incl. an empty string, which means the\n // user cleared grouping on a modified preset) over the preset's saved groupBy.\n // Otherwise clearing groupBy while a preset is active reverts: the cleared URL\n // re-syncs to `groupBy` absent and `?? queryPreset.groupBy` re-applies the\n // preset's value. `??` keeps an empty-string preference and only falls through\n // to the preset when the preference is truly unset.\n query.groupBy = query.groupBy ?? collectionPreferences?.groupBy ?? queryPreset?.groupBy\n\n const columnPreference = query.columns\n ? transformColumnsToPreferences(query.columns)\n : (queryPreset?.columns ?? collectionPreferences?.columns)\n query.columns = transformColumnsToSearchParams(columnPreference)\n\n query.page = isNumber(query?.page) ? Number(query.page) : 0\n\n query.limit = collectionPreferences?.limit || collectionConfig.admin.pagination.defaultLimit\n\n query.sort =\n collectionPreferences?.sort ||\n (typeof collectionConfig.defaultSort === 'string' ? collectionConfig.defaultSort : undefined)\n\n const baseFilterConstraint = await (\n collectionConfig.admin?.baseFilter ?? collectionConfig.admin?.baseListFilter\n )?.({\n limit: query.limit,\n page: query.page,\n req,\n sort: query.sort,\n })\n\n let whereWithMergedSearch = mergeListSearchAndWhere({\n collectionConfig,\n search: typeof query?.search === 'string' ? query.search : undefined,\n where: combineWhereConstraints([query?.where, baseFilterConstraint]),\n })\n\n if (trash === true) {\n whereWithMergedSearch = {\n and: [\n whereWithMergedSearch,\n {\n deletedAt: {\n exists: true,\n },\n },\n ],\n }\n }\n\n let Table: React.ReactNode | React.ReactNode[] = null\n let columnState: Column[] = []\n let data: PaginatedDocs = {\n // no results default\n docs: [],\n hasNextPage: false,\n hasPrevPage: false,\n limit: query.limit,\n nextPage: null,\n page: 1,\n pagingCounter: 0,\n prevPage: null,\n totalDocs: 0,\n totalPages: 0,\n }\n\n const clientCollectionConfig = clientConfig.collections.find((c) => c.slug === collectionSlug)\n\n const columns = getColumns({\n clientConfig,\n collectionConfig: clientCollectionConfig,\n collectionSlug,\n columns: columnPreference,\n i18n,\n permissions,\n })\n\n /** Automatically force select active columns. */\n const select = transformColumnsToSelect(columns)\n\n /** Force select image fields for list view thumbnails */\n appendUploadSelectFields({\n collectionConfig,\n select,\n })\n\n /** Force select `_tz` siblings for any timezone-enabled date fields in select */\n appendDateTimezoneSelectFields({\n fields: collectionConfig.flattenedFields,\n select,\n })\n\n /** Force select `_order` for orderable collections — OrderableTable needs it to compute reorder targets */\n if (collectionConfig.orderable === true) {\n select._order = true\n }\n\n /** Force select `_status` for drafts-enabled collections — needed by `enrichDocsWithVersionStatus` and `formatDocURL` */\n if (collectionConfig.versions?.drafts) {\n select._status = true\n }\n\n // Check for hierarchy parent param\n const isHierarchyCollection = Boolean(collectionConfig.hierarchy)\n const hierarchyParentFieldName =\n typeof collectionConfig.hierarchy === 'object'\n ? (collectionConfig.hierarchy.parentFieldName ?? 'parent')\n : 'parent'\n let hierarchyParentId: null | number | string = null\n\n if (isHierarchyCollection) {\n const parentParam = searchParams?.[hierarchyParentFieldName]\n if (parentParam === 'null' || parentParam === undefined) {\n hierarchyParentId = null\n } else if (typeof parentParam === 'string') {\n hierarchyParentId =\n payload.db.defaultIDType === 'number' && isNumber(parentParam)\n ? Number(parentParam)\n : parentParam\n }\n }\n\n // Hierarchy data for client-side rendering\n let hierarchyData: HierarchyViewData | undefined\n\n try {\n if (query.groupBy) {\n ;({ columnState, data, Table } = await handleGroupBy({\n clientCollectionConfig,\n clientConfig,\n collectionConfig,\n collectionSlug,\n columns,\n customCellProps,\n drawerSlug,\n enableRowSelections,\n fieldPermissions: permissions?.collections?.[collectionSlug]?.fields,\n query,\n req,\n select,\n trash,\n user,\n viewType,\n where: whereWithMergedSearch,\n }))\n\n // Enrich documents with correct display status for drafts\n data = await enrichDocsWithVersionStatus({\n collectionConfig,\n data,\n req,\n })\n } else {\n data = await req.payload.find({\n collection: collectionSlug,\n depth: 0,\n draft: true,\n fallbackLocale: false,\n includeLockStatus: true,\n limit: query?.limit ? Number(query.limit) : undefined,\n locale: req.locale,\n overrideAccess: false,\n page: query?.page ? Number(query.page) : undefined,\n req,\n select,\n sort: query?.sort,\n trash,\n user,\n where: whereWithMergedSearch,\n })\n\n // Enrich documents with correct display status for drafts\n data = await enrichDocsWithVersionStatus({\n collectionConfig,\n data,\n req,\n })\n ;({ columnState, Table } = renderTable({\n clientCollectionConfig,\n collectionConfig,\n columns,\n customCellProps,\n data,\n drawerSlug,\n enableRowSelections,\n fieldPermissions: permissions?.collections?.[collectionSlug]?.fields,\n i18n: req.i18n,\n orderableFieldName: collectionConfig.orderable === true ? '_order' : undefined,\n payload: req.payload,\n query,\n req,\n useAsTitle: collectionConfig.admin.useAsTitle,\n viewType,\n }))\n }\n } catch (err) {\n if (err.name !== 'QueryError') {\n // QueryErrors are expected when a user filters by a field they do not have access to\n req.payload.logger.error({\n err,\n msg: `There was an error fetching the list view data for collection ${collectionSlug}`,\n })\n throw err\n }\n }\n\n // Fetch hierarchy data only for hierarchy view\n let HierarchyIcon: React.ReactNode | undefined\n const isHierarchyView = viewType === 'hierarchy'\n\n if (isHierarchyCollection && isHierarchyView) {\n // Extract typeFilter from searchParams (comma-separated list of collection slugs)\n const typeFilterParam = searchParams?.typeFilter\n const typeFilter =\n typeof typeFilterParam === 'string' && typeFilterParam.length > 0\n ? typeFilterParam.split(',')\n : undefined\n\n hierarchyData = await handleHierarchy({\n baseFilter: baseFilterConstraint,\n collectionConfig,\n collectionSlug,\n parentId: hierarchyParentId,\n permissions,\n req,\n search: typeof query?.search === 'string' ? query.search : undefined,\n typeFilter,\n user,\n })\n\n data = hierarchyData.childrenData\n\n // Resolve hierarchy icon from collection config\n const hierarchyConfig =\n typeof collectionConfig.hierarchy === 'object' ? collectionConfig.hierarchy : undefined\n\n HierarchyIcon = RenderServerComponent({\n Component: hierarchyConfig?.admin?.components?.Icon,\n importMap: payload.importMap,\n key: `hierarchy-icon-${collectionSlug}`,\n })\n }\n\n const renderedFilters = renderFilters(collectionConfig.fields, req.payload.importMap)\n\n const resolvedFilterOptions = await resolveAllFilterOptions({\n fields: collectionConfig.fields,\n req,\n })\n\n const staticDescription =\n typeof collectionConfig.admin.description === 'function'\n ? collectionConfig.admin.description({ t: i18n.t })\n : collectionConfig.admin.description\n\n const newDocumentURL = formatAdminURL({\n adminRoute,\n path: `/collections/${collectionSlug}/create`,\n })\n\n const hasCreatePermission = permissions?.collections?.[collectionSlug]?.create\n\n const { hasDeletePermission, hasTrashPermission } = await getDocumentPermissions({\n collectionConfig,\n // Empty object serves as base for computing differentiated trash/delete permissions\n data: {},\n req,\n })\n\n // Check if there's a notFound query parameter (document ID that wasn't found)\n const notFoundDocId = typeof searchParams?.notFound === 'string' ? searchParams.notFound : null\n\n const serverProps: ListViewServerPropsOnly = {\n collectionConfig,\n data,\n i18n,\n limit: query.limit,\n listPreferences: collectionPreferences,\n listSearchableFields: collectionConfig.admin.listSearchableFields,\n locale: fullLocale,\n params,\n payload,\n permissions,\n searchParams,\n server: req.server,\n user,\n }\n\n const listViewSlots = renderListViewSlots({\n clientProps: {\n collectionSlug,\n hasCreatePermission,\n hasDeletePermission,\n hasTrashPermission,\n newDocumentURL,\n viewType,\n },\n collectionConfig,\n description: staticDescription,\n notFoundDocId,\n payload,\n serverProps,\n })\n\n const isInDrawer = Boolean(drawerSlug)\n\n // Needed to prevent: Only plain objects can be passed to Client Components from Server Components. Objects with toJSON methods are not supported. Convert it manually to a simple value before passing it to props.\n // Is there a way to avoid this? The `where` object is already seemingly plain, but is not bc it originates from the params.\n query.where = query?.where ? JSON.parse(JSON.stringify(query?.where || {})) : undefined\n\n const RenderedListViewComponent = RenderServerComponent({\n clientProps: {\n ...listViewSlots,\n baseFilter: baseFilterConstraint,\n collectionSlug,\n columnState,\n disableBulkDelete: collectionConfig.disableBulkDelete ?? disableBulkDelete,\n disableBulkEdit: collectionConfig.disableBulkEdit ?? disableBulkEdit,\n disableQueryPresets,\n enableRowSelections,\n hasCreatePermission,\n hasDeletePermission,\n hasTrashPermission,\n hierarchyData,\n HierarchyIcon,\n listPreferences: collectionPreferences,\n newDocumentURL,\n queryPreset,\n queryPresetPermissions,\n renderedFilters,\n resolvedFilterOptions,\n Table,\n viewType,\n } satisfies ListViewClientProps,\n Component: ComponentOverride ?? collectionConfig?.admin?.components?.views?.list?.Component,\n Fallback: viewType === 'hierarchy' ? HierarchyListView : DefaultListView,\n importMap: payload.importMap,\n key: `list-view-${collectionSlug}-${viewType}`,\n serverProps,\n })\n\n return {\n List: (\n <Fragment>\n <HydrateAuthProvider permissions={permissions} />\n {isHierarchyView ? (\n <Fragment>\n <HydrateHierarchyProvider\n allowedCollections={hierarchyData?.allowedCollections}\n baseFilter={baseFilterConstraint}\n collectionSlug={collectionSlug}\n expandedNodes={hierarchyData?.breadcrumbs?.slice(0, -1).map((b) => b.id)}\n parent={hierarchyData?.parent}\n parentFieldName={\n typeof collectionConfig.hierarchy === 'object'\n ? collectionConfig.hierarchy?.parentFieldName\n : undefined\n }\n tableData={data}\n treeLimit={\n typeof collectionConfig.hierarchy === 'object'\n ? collectionConfig.hierarchy?.admin?.treeLimit\n : undefined\n }\n typeFieldName={\n typeof collectionConfig.hierarchy === 'object' &&\n collectionConfig.hierarchy?.collectionSpecific &&\n typeof collectionConfig.hierarchy.collectionSpecific === 'object'\n ? collectionConfig.hierarchy.collectionSpecific.fieldName\n : undefined\n }\n />\n {RenderedListViewComponent}\n </Fragment>\n ) : (\n <ListQueryProvider\n collectionSlug={collectionSlug}\n data={data}\n modifySearchParams={!isInDrawer}\n orderableFieldName={collectionConfig.orderable === true ? '_order' : undefined}\n query={query}\n >\n {RenderedListViewComponent}\n </ListQueryProvider>\n )}\n </Fragment>\n ),\n }\n}\n\nexport const ListView: React.FC<RenderListViewArgs> = async (args) => {\n try {\n const { List: RenderedList } = await renderListView({ ...args, enableRowSelections: true })\n return RenderedList\n } catch (error) {\n if (error.message === 'not-found') {\n args.initPageResult.req.server.notFound()\n } else {\n console.error(error) // eslint-disable-line no-console\n }\n }\n}\n"],"mappings":";AAeA,SACEA,8BAA8B,EAC9BC,wBAAwB,EACxBC,uBAAuB,EACvBC,cAAc,EACdC,QAAQ,EACRC,uBAAuB,EACvBC,6BAA6B,EAC7BC,8BAA8B,QACzB;AACP,OAAOC,KAAA,IAASC,QAAQ,QAAQ;AAEhC,SAASC,qBAAqB,QAAQ;AACtC;AACA,SACEC,eAAe,EACfC,iBAAiB,EACjBC,mBAAmB,EACnBC,wBAAwB,EACxBC,iBAAiB,QACZ;AACP;AACA,SAASC,UAAU,QAAQ;AAC3B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,aAAa,EAAEC,WAAW,QAAQ;AAC3C,SAASC,iBAAiB,QAAQ;AAClC,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,aAAa,QAAQ;AAC9B,SAASC,eAAe,QAAQ;AAChC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,uBAAuB,QAAQ;AACxC,SAASC,wBAAwB,QAAQ;AACzC,OAAO;AAgCP;;;;;;;;AAQA,OAAO,MAAMC,cAAA,GAAiB,MAC5BC,IAAA;EAIA,MAAM;IACJC,YAAY;IACZC,iBAAiB;IACjBC,eAAe;IACfC,iBAAiB;IACjBC,eAAe;IACfC,mBAAmB;IACnBC,UAAU;IACVC,mBAAmB;IACnBC,cAAc;IACdC,wBAAwB;IACxBC,MAAM;IACNC,KAAA,EAAOC,aAAa;IACpBC,YAAY;IACZC,KAAK;IACLC;EAAQ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AAS,EAAErE,KAAA,EAAOsI,SAAA,GACnCrH,SAAA;UAENsH,aAAA,EACE,OAAOrJ,gBAAA,CAAiBmF,SAAS,KAAK,YACtCnF,gBAAA,CAAiBmF,SAAS,EAAEmE,kBAAA,IAC5B,OAAOtJ,gBAAA,CAAiBmF,SAAS,CAACmE,kBAAkB,KAAK,WACrDtJ,gBAAA,CAAiBmF,SAAS,CAACmE,kBAAkB,CAACC,SAAS,GACvDxH;YAGPsG,yBAAA;wBAGHM,IAAA,CAACzK,iBAAA;QACCgC,cAAA,EAAgBA,cAAA;QAChBuC,IAAA,EAAMA,IAAA;QACN+G,kBAAA,EAAoB,CAACrB,UAAA;QACrBpC,kBAAA,EAAoB/F,gBAAA,CAAiB4E,SAAS,KAAK,OAAO,WAAW7C,SAAA;QACrEpC,KAAA,EAAOA,KAAA;kBAEN0I;;;EAKX;AACF;AAEA,OAAO,MAAMoB,QAAA,GAAyC,MAAO1K,IAAA;EAC3D,IAAI;IACF,MAAM;MAAE0J,IAAA,EAAMiB;IAAY,CAAE,GAAG,MAAM5K,cAAA,CAAe;MAAE,GAAGC,IAAI;MAAEQ,mBAAA,EAAqB;IAAK;IACzF,OAAOmK,YAAA;EACT,EAAE,OAAO7G,KAAA,EAAO;IACd,IAAIA,KAAA,CAAM8G,OAAO,KAAK,aAAa;MACjC5K,IAAA,CAAKS,cAAc,CAACc,GAAG,CAAC0H,MAAM,CAACJ,QAAQ;IACzC,OAAO;MACLgC,OAAA,CAAQ/G,KAAK,CAACA,KAAA,GAAO;IACvB;EACF;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderListViewSlots.d.ts","sourceRoot":"","sources":["../../../src/views/List/renderListViewSlots.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAQV,uBAAuB,EACvB,aAAa,EACb,6BAA6B,
|
|
1
|
+
{"version":3,"file":"renderListViewSlots.d.ts","sourceRoot":"","sources":["../../../src/views/List/renderListViewSlots.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAQV,uBAAuB,EACvB,aAAa,EACb,6BAA6B,EAG7B,OAAO,EACP,yBAAyB,EACzB,iBAAiB,EAGlB,MAAM,SAAS,CAAA;AAOhB,KAAK,IAAI,GAAG;IACV,WAAW,EAAE,6BAA6B,CAAA;IAC1C,gBAAgB,EAAE,yBAAyB,CAAA;IAC3C,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,uBAAuB,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,sFAOjC,IAAI,KAAG,aA4FT,CAAA"}
|
|
@@ -76,6 +76,14 @@ export const renderListViewSlots = ({
|
|
|
76
76
|
serverProps: serverProps
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
+
if (collectionConfig.admin.components?.views?.list?.NoResults) {
|
|
80
|
+
result.NoResults = RenderServerComponent({
|
|
81
|
+
clientProps: clientProps,
|
|
82
|
+
Component: collectionConfig.admin.components.views.list.NoResults,
|
|
83
|
+
importMap: payload.importMap,
|
|
84
|
+
serverProps: serverProps
|
|
85
|
+
});
|
|
86
|
+
}
|
|
79
87
|
return result;
|
|
80
88
|
};
|
|
81
89
|
//# sourceMappingURL=renderListViewSlots.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderListViewSlots.js","names":["React","Banner","RenderServerComponent","renderListViewSlots","clientProps","collectionConfig","description","notFoundDocId","payload","serverProps","result","admin","components","afterList","AfterList","Component","importMap","listMenuItems","Array","isArray","afterListTable","AfterListTable","beforeList","BeforeList","existingBeforeListTable","beforeListTable","notFoundBanner","_jsx","className","type","i18n","t","id","BeforeListTable","_jsxs","Fragment","Description","collectionSlug","slug"],"sources":["../../../src/views/List/renderListViewSlots.tsx"],"sourcesContent":["import type {\n AfterListClientProps,\n AfterListTableClientProps,\n AfterListTableServerPropsOnly,\n BeforeListClientProps,\n BeforeListServerPropsOnly,\n BeforeListTableClientProps,\n BeforeListTableServerPropsOnly,\n ListViewServerPropsOnly,\n ListViewSlots,\n ListViewSlotSharedClientProps,\n Payload,\n SanitizedCollectionConfig,\n StaticDescription,\n ViewDescriptionClientProps,\n ViewDescriptionServerPropsOnly,\n} from 'payload'\n\nimport React from 'react'\n\nimport { Banner } from '../../elements/Banner/index.js'\nimport { RenderServerComponent } from '../../elements/RenderServerComponent/index.js'\n\ntype Args = {\n clientProps: ListViewSlotSharedClientProps\n collectionConfig: SanitizedCollectionConfig\n description?: StaticDescription\n notFoundDocId?: null | string\n payload: Payload\n serverProps: ListViewServerPropsOnly\n}\n\nexport const renderListViewSlots = ({\n clientProps,\n collectionConfig,\n description,\n notFoundDocId,\n payload,\n serverProps,\n}: Args): ListViewSlots => {\n const result: ListViewSlots = {} as ListViewSlots\n\n if (collectionConfig.admin.components?.afterList) {\n result.AfterList = RenderServerComponent({\n clientProps: clientProps satisfies AfterListClientProps,\n Component: collectionConfig.admin.components.afterList,\n importMap: payload.importMap,\n serverProps: serverProps satisfies AfterListTableServerPropsOnly,\n })\n }\n\n const listMenuItems = collectionConfig.admin.components?.listMenuItems\n\n if (Array.isArray(listMenuItems)) {\n result.listMenuItems = [\n RenderServerComponent({\n clientProps,\n Component: listMenuItems,\n importMap: payload.importMap,\n serverProps,\n }),\n ]\n }\n\n if (collectionConfig.admin.components?.afterListTable) {\n result.AfterListTable = RenderServerComponent({\n clientProps: clientProps satisfies AfterListTableClientProps,\n Component: collectionConfig.admin.components.afterListTable,\n importMap: payload.importMap,\n serverProps: serverProps satisfies AfterListTableServerPropsOnly,\n })\n }\n\n if (collectionConfig.admin.components?.beforeList) {\n result.BeforeList = RenderServerComponent({\n clientProps: clientProps satisfies BeforeListClientProps,\n Component: collectionConfig.admin.components.beforeList,\n importMap: payload.importMap,\n serverProps: serverProps satisfies BeforeListServerPropsOnly,\n })\n }\n\n // Handle beforeListTable with optional banner\n const existingBeforeListTable = collectionConfig.admin.components?.beforeListTable\n ? RenderServerComponent({\n clientProps: clientProps satisfies BeforeListTableClientProps,\n Component: collectionConfig.admin.components.beforeListTable,\n importMap: payload.importMap,\n serverProps: serverProps satisfies BeforeListTableServerPropsOnly,\n })\n : null\n\n // Create banner for document not found\n const notFoundBanner = notFoundDocId ? (\n <Banner className=\"list-view__not-found-banner\" type=\"danger\">\n {serverProps.i18n.t('error:documentNotFound', { id: notFoundDocId })}\n </Banner>\n ) : null\n\n // Combine banner and existing component\n if (notFoundBanner || existingBeforeListTable) {\n result.BeforeListTable = (\n <React.Fragment>\n {notFoundBanner}\n {existingBeforeListTable}\n </React.Fragment>\n )\n }\n\n if (collectionConfig.admin.components?.Description) {\n result.Description = RenderServerComponent({\n clientProps: {\n collectionSlug: collectionConfig.slug,\n description,\n } satisfies ViewDescriptionClientProps,\n Component: collectionConfig.admin.components.Description,\n importMap: payload.importMap,\n serverProps: serverProps satisfies ViewDescriptionServerPropsOnly,\n })\n }\n\n return result\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"renderListViewSlots.js","names":["React","Banner","RenderServerComponent","renderListViewSlots","clientProps","collectionConfig","description","notFoundDocId","payload","serverProps","result","admin","components","afterList","AfterList","Component","importMap","listMenuItems","Array","isArray","afterListTable","AfterListTable","beforeList","BeforeList","existingBeforeListTable","beforeListTable","notFoundBanner","_jsx","className","type","i18n","t","id","BeforeListTable","_jsxs","Fragment","Description","collectionSlug","slug","views","list","NoResults"],"sources":["../../../src/views/List/renderListViewSlots.tsx"],"sourcesContent":["import type {\n AfterListClientProps,\n AfterListTableClientProps,\n AfterListTableServerPropsOnly,\n BeforeListClientProps,\n BeforeListServerPropsOnly,\n BeforeListTableClientProps,\n BeforeListTableServerPropsOnly,\n ListViewServerPropsOnly,\n ListViewSlots,\n ListViewSlotSharedClientProps,\n NoResultsClientProps,\n NoResultsServerPropsOnly,\n Payload,\n SanitizedCollectionConfig,\n StaticDescription,\n ViewDescriptionClientProps,\n ViewDescriptionServerPropsOnly,\n} from 'payload'\n\nimport React from 'react'\n\nimport { Banner } from '../../elements/Banner/index.js'\nimport { RenderServerComponent } from '../../elements/RenderServerComponent/index.js'\n\ntype Args = {\n clientProps: ListViewSlotSharedClientProps\n collectionConfig: SanitizedCollectionConfig\n description?: StaticDescription\n notFoundDocId?: null | string\n payload: Payload\n serverProps: ListViewServerPropsOnly\n}\n\nexport const renderListViewSlots = ({\n clientProps,\n collectionConfig,\n description,\n notFoundDocId,\n payload,\n serverProps,\n}: Args): ListViewSlots => {\n const result: ListViewSlots = {} as ListViewSlots\n\n if (collectionConfig.admin.components?.afterList) {\n result.AfterList = RenderServerComponent({\n clientProps: clientProps satisfies AfterListClientProps,\n Component: collectionConfig.admin.components.afterList,\n importMap: payload.importMap,\n serverProps: serverProps satisfies AfterListTableServerPropsOnly,\n })\n }\n\n const listMenuItems = collectionConfig.admin.components?.listMenuItems\n\n if (Array.isArray(listMenuItems)) {\n result.listMenuItems = [\n RenderServerComponent({\n clientProps,\n Component: listMenuItems,\n importMap: payload.importMap,\n serverProps,\n }),\n ]\n }\n\n if (collectionConfig.admin.components?.afterListTable) {\n result.AfterListTable = RenderServerComponent({\n clientProps: clientProps satisfies AfterListTableClientProps,\n Component: collectionConfig.admin.components.afterListTable,\n importMap: payload.importMap,\n serverProps: serverProps satisfies AfterListTableServerPropsOnly,\n })\n }\n\n if (collectionConfig.admin.components?.beforeList) {\n result.BeforeList = RenderServerComponent({\n clientProps: clientProps satisfies BeforeListClientProps,\n Component: collectionConfig.admin.components.beforeList,\n importMap: payload.importMap,\n serverProps: serverProps satisfies BeforeListServerPropsOnly,\n })\n }\n\n // Handle beforeListTable with optional banner\n const existingBeforeListTable = collectionConfig.admin.components?.beforeListTable\n ? RenderServerComponent({\n clientProps: clientProps satisfies BeforeListTableClientProps,\n Component: collectionConfig.admin.components.beforeListTable,\n importMap: payload.importMap,\n serverProps: serverProps satisfies BeforeListTableServerPropsOnly,\n })\n : null\n\n // Create banner for document not found\n const notFoundBanner = notFoundDocId ? (\n <Banner className=\"list-view__not-found-banner\" type=\"danger\">\n {serverProps.i18n.t('error:documentNotFound', { id: notFoundDocId })}\n </Banner>\n ) : null\n\n // Combine banner and existing component\n if (notFoundBanner || existingBeforeListTable) {\n result.BeforeListTable = (\n <React.Fragment>\n {notFoundBanner}\n {existingBeforeListTable}\n </React.Fragment>\n )\n }\n\n if (collectionConfig.admin.components?.Description) {\n result.Description = RenderServerComponent({\n clientProps: {\n collectionSlug: collectionConfig.slug,\n description,\n } satisfies ViewDescriptionClientProps,\n Component: collectionConfig.admin.components.Description,\n importMap: payload.importMap,\n serverProps: serverProps satisfies ViewDescriptionServerPropsOnly,\n })\n }\n\n if (collectionConfig.admin.components?.views?.list?.NoResults) {\n result.NoResults = RenderServerComponent({\n clientProps: clientProps satisfies NoResultsClientProps,\n Component: collectionConfig.admin.components.views.list.NoResults,\n importMap: payload.importMap,\n serverProps: serverProps satisfies NoResultsServerPropsOnly,\n })\n }\n\n return result\n}\n"],"mappings":";AAoBA,OAAOA,KAAA,MAAW;AAElB,SAASC,MAAM,QAAQ;AACvB,SAASC,qBAAqB,QAAQ;AAWtC,OAAO,MAAMC,mBAAA,GAAsBA,CAAC;EAClCC,WAAW;EACXC,gBAAgB;EAChBC,WAAW;EACXC,aAAa;EACbC,OAAO;EACPC;AAAW,CACN;EACL,MAAMC,MAAA,GAAwB,CAAC;EAE/B,IAAIL,gBAAA,CAAiBM,KAAK,CAACC,UAAU,EAAEC,SAAA,EAAW;IAChDH,MAAA,CAAOI,SAAS,GAAGZ,qBAAA,CAAsB;MACvCE,WAAA,EAAaA,WAAA;MACbW,SAAA,EAAWV,gBAAA,CAAiBM,KAAK,CAACC,UAAU,CAACC,SAAS;MACtDG,SAAA,EAAWR,OAAA,CAAQQ,SAAS;MAC5BP,WAAA,EAAaA;IACf;EACF;EAEA,MAAMQ,aAAA,GAAgBZ,gBAAA,CAAiBM,KAAK,CAACC,UAAU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AAEC,EAAA,EAAIzB;IAAc;OAElE;EAEJ;EACA,IAAImB,cAAA,IAAkBF,uBAAA,EAAyB;IAC7Cd,MAAA,CAAOuB,eAAe,gBACpBC,KAAA,CAAClC,KAAA,CAAMmC,QAAQ;iBACZT,cAAA,EACAF,uBAAA;;EAGP;EAEA,IAAInB,gBAAA,CAAiBM,KAAK,CAACC,UAAU,EAAEwB,WAAA,EAAa;IAClD1B,MAAA,CAAO0B,WAAW,GAAGlC,qBAAA,CAAsB;MACzCE,WAAA,EAAa;QACXiC,cAAA,EAAgBhC,gBAAA,CAAiBiC,IAAI;QACrChC;MACF;MACAS,SAAA,EAAWV,gBAAA,CAAiBM,KAAK,CAACC,UAAU,CAACwB,WAAW;MACxDpB,SAAA,EAAWR,OAAA,CAAQQ,SAAS;MAC5BP,WAAA,EAAaA;IACf;EACF;EAEA,IAAIJ,gBAAA,CAAiBM,KAAK,CAACC,UAAU,EAAE2B,KAAA,EAAOC,IAAA,EAAMC,SAAA,EAAW;IAC7D/B,MAAA,CAAO+B,SAAS,GAAGvC,qBAAA,CAAsB;MACvCE,WAAA,EAAaA,WAAA;MACbW,SAAA,EAAWV,gBAAA,CAAiBM,KAAK,CAACC,UAAU,CAAC2B,KAAK,CAACC,IAAI,CAACC,SAAS;MACjEzB,SAAA,EAAWR,OAAA,CAAQQ,SAAS;MAC5BP,WAAA,EAAaA;IACf;EACF;EAEA,OAAOC,MAAA;AACT","ignoreList":[]}
|
|
@@ -14,5 +14,19 @@ export declare const LogoutClient: React.FC<{
|
|
|
14
14
|
adminRoute: string;
|
|
15
15
|
inactivity?: boolean;
|
|
16
16
|
redirect: string;
|
|
17
|
+
/**
|
|
18
|
+
* The server-resolved user for the logout request. This is the source of
|
|
19
|
+
* truth for *who* to log out: the client `useAuth().user` is unreliable here
|
|
20
|
+
* because the admin `AuthProvider` clears any user that isn't in the admin
|
|
21
|
+
* user collection (a non-admin/public user resolves to `null` via `/me`).
|
|
22
|
+
* On adapters that mount this view's tree after the layout's auth effects
|
|
23
|
+
* (e.g. TanStack Start, where the RSC payload streams in after hydration),
|
|
24
|
+
* that clear races ahead of this component and `useAuth().user` is already
|
|
25
|
+
* `null` at mount — so relying on it would skip the logout request entirely.
|
|
26
|
+
*/
|
|
27
|
+
user?: {
|
|
28
|
+
collection?: string;
|
|
29
|
+
id?: number | string;
|
|
30
|
+
} | null;
|
|
17
31
|
}>;
|
|
18
32
|
//# sourceMappingURL=LogoutClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogoutClient.d.ts","sourceRoot":"","sources":["../../../src/views/Logout/LogoutClient.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAA;AASxC,OAAO,aAAa,CAAA;AAIpB;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"LogoutClient.d.ts","sourceRoot":"","sources":["../../../src/views/Logout/LogoutClient.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAA;AASxC,OAAO,aAAa,CAAA;AAIpB;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAC5D,CA+DA,CAAA"}
|
|
@@ -24,21 +24,23 @@ const baseClass = 'logout';
|
|
|
24
24
|
* is logged out due to inactivity.
|
|
25
25
|
*/
|
|
26
26
|
export const LogoutClient = props => {
|
|
27
|
-
const $ = _c(
|
|
27
|
+
const $ = _c(24);
|
|
28
28
|
const {
|
|
29
29
|
adminRoute,
|
|
30
30
|
inactivity,
|
|
31
|
-
redirect
|
|
31
|
+
redirect,
|
|
32
|
+
user: serverUser
|
|
32
33
|
} = props;
|
|
33
34
|
const {
|
|
34
35
|
logOut,
|
|
35
|
-
user
|
|
36
|
+
user: clientUser
|
|
36
37
|
} = useAuth();
|
|
38
|
+
const logoutUser = clientUser ?? serverUser;
|
|
37
39
|
const {
|
|
38
40
|
startRouteTransition
|
|
39
41
|
} = useRouteTransition();
|
|
40
|
-
|
|
41
|
-
const isLoggedIn = Boolean(
|
|
42
|
+
logoutUser?.id;
|
|
43
|
+
const isLoggedIn = Boolean(logoutUser?.id);
|
|
42
44
|
const navigatingToLoginRef = React.useRef(false);
|
|
43
45
|
let t0;
|
|
44
46
|
if ($[0] !== adminRoute || $[1] !== inactivity || $[2] !== redirect) {
|
|
@@ -59,11 +61,13 @@ export const LogoutClient = props => {
|
|
|
59
61
|
} = useTranslation();
|
|
60
62
|
const router = useRouter();
|
|
61
63
|
let t1;
|
|
62
|
-
if ($[4] !== logOut || $[5] !== loginRoute || $[6] !==
|
|
64
|
+
if ($[4] !== logOut || $[5] !== loginRoute || $[6] !== logoutUser?.collection || $[7] !== router || $[8] !== startRouteTransition || $[9] !== t) {
|
|
63
65
|
t1 = async () => {
|
|
64
66
|
if (!navigatingToLoginRef.current) {
|
|
65
67
|
navigatingToLoginRef.current = true;
|
|
66
|
-
await logOut(
|
|
68
|
+
await logOut({
|
|
69
|
+
collection: logoutUser?.collection
|
|
70
|
+
});
|
|
67
71
|
toast.success(t("authentication:loggedOutSuccessfully"));
|
|
68
72
|
startRouteTransition(() => router.push(loginRoute));
|
|
69
73
|
return;
|
|
@@ -71,17 +75,19 @@ export const LogoutClient = props => {
|
|
|
71
75
|
};
|
|
72
76
|
$[4] = logOut;
|
|
73
77
|
$[5] = loginRoute;
|
|
74
|
-
$[6] =
|
|
75
|
-
$[7] =
|
|
76
|
-
$[8] =
|
|
77
|
-
$[9] =
|
|
78
|
+
$[6] = logoutUser?.collection;
|
|
79
|
+
$[7] = router;
|
|
80
|
+
$[8] = startRouteTransition;
|
|
81
|
+
$[9] = t;
|
|
82
|
+
$[10] = t1;
|
|
78
83
|
} else {
|
|
79
|
-
t1 = $[
|
|
84
|
+
t1 = $[10];
|
|
80
85
|
}
|
|
86
|
+
logoutUser?.collection;
|
|
81
87
|
const handleLogOut = t1;
|
|
82
88
|
let t2;
|
|
83
89
|
let t3;
|
|
84
|
-
if ($[
|
|
90
|
+
if ($[11] !== handleLogOut || $[12] !== inactivity || $[13] !== isLoggedIn || $[14] !== loginRoute || $[15] !== router || $[16] !== startRouteTransition) {
|
|
85
91
|
t2 = () => {
|
|
86
92
|
if (isLoggedIn && !inactivity) {
|
|
87
93
|
handleLogOut();
|
|
@@ -93,22 +99,22 @@ export const LogoutClient = props => {
|
|
|
93
99
|
}
|
|
94
100
|
};
|
|
95
101
|
t3 = [handleLogOut, isLoggedIn, loginRoute, router, startRouteTransition, inactivity];
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
102
|
+
$[11] = handleLogOut;
|
|
103
|
+
$[12] = inactivity;
|
|
104
|
+
$[13] = isLoggedIn;
|
|
105
|
+
$[14] = loginRoute;
|
|
106
|
+
$[15] = router;
|
|
107
|
+
$[16] = startRouteTransition;
|
|
108
|
+
$[17] = t2;
|
|
109
|
+
$[18] = t3;
|
|
104
110
|
} else {
|
|
105
|
-
t2 = $[
|
|
106
|
-
t3 = $[
|
|
111
|
+
t2 = $[17];
|
|
112
|
+
t3 = $[18];
|
|
107
113
|
}
|
|
108
114
|
useEffect(t2, t3);
|
|
109
115
|
if (!isLoggedIn && inactivity) {
|
|
110
116
|
let t4;
|
|
111
|
-
if ($[
|
|
117
|
+
if ($[19] !== loginRoute || $[20] !== t) {
|
|
112
118
|
t4 = _jsxs("div", {
|
|
113
119
|
className: `${baseClass}__wrap`,
|
|
114
120
|
children: [_jsx("h2", {
|
|
@@ -121,24 +127,24 @@ export const LogoutClient = props => {
|
|
|
121
127
|
children: t("authentication:logBackIn")
|
|
122
128
|
})]
|
|
123
129
|
});
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
130
|
+
$[19] = loginRoute;
|
|
131
|
+
$[20] = t;
|
|
132
|
+
$[21] = t4;
|
|
127
133
|
} else {
|
|
128
|
-
t4 = $[
|
|
134
|
+
t4 = $[21];
|
|
129
135
|
}
|
|
130
136
|
return t4;
|
|
131
137
|
}
|
|
132
138
|
let t4;
|
|
133
|
-
if ($[
|
|
139
|
+
if ($[22] !== t) {
|
|
134
140
|
t4 = _jsx(LoadingOverlay, {
|
|
135
141
|
animationDuration: "0ms",
|
|
136
142
|
loadingText: t("authentication:loggingOut")
|
|
137
143
|
});
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
144
|
+
$[22] = t;
|
|
145
|
+
$[23] = t4;
|
|
140
146
|
} else {
|
|
141
|
-
t4 = $[
|
|
147
|
+
t4 = $[23];
|
|
142
148
|
}
|
|
143
149
|
return t4;
|
|
144
150
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogoutClient.js","names":["c","_c","formatAdminURL","React","useEffect","toast","Button","LoadingOverlay","useAuth","useRouter","useRouteTransition","useTranslation","baseClass","LogoutClient","props","$","adminRoute","inactivity","redirect","logOut","
|
|
1
|
+
{"version":3,"file":"LogoutClient.js","names":["c","_c","formatAdminURL","React","useEffect","toast","Button","LoadingOverlay","useAuth","useRouter","useRouteTransition","useTranslation","baseClass","LogoutClient","props","$","adminRoute","inactivity","redirect","user","serverUser","logOut","clientUser","logoutUser","startRouteTransition","id","isLoggedIn","Boolean","navigatingToLoginRef","useRef","t0","path","length","encodeURIComponent","loginRoute","useState","t","router","t1","collection","current","success","push","handleLogOut","t2","t3","t4","_jsxs","className","children","_jsx","buttonStyle","el","size","url","animationDuration","loadingText"],"sources":["../../../src/views/Logout/LogoutClient.tsx"],"sourcesContent":["'use client'\nimport { formatAdminURL } from 'payload/shared'\nimport React, { useEffect } from 'react'\nimport { toast } from 'sonner'\n\nimport { Button } from '../../elements/Button/index.js'\nimport { LoadingOverlay } from '../../elements/Loading/index.js'\nimport { useAuth } from '../../providers/Auth/index.js'\nimport { useRouter } from '../../providers/RouterAdapter/index.js'\nimport { useRouteTransition } from '../../providers/RouteTransition/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport './index.css'\n\nconst baseClass = 'logout'\n\n/**\n * This component should **just** be the inactivity route and do nothing with logging the user out.\n *\n * It currently handles too much, the auth provider should just log the user out and then\n * we could remove the useEffect in this file. So instead of the logout button\n * being an anchor link, it should be a button that calls `logOut` in the provider.\n *\n * This view is still useful if cookies attempt to refresh and fail, i.e. the user\n * is logged out due to inactivity.\n */\nexport const LogoutClient: React.FC<{\n adminRoute: string\n inactivity?: boolean\n redirect: string\n /**\n * The server-resolved user for the logout request. This is the source of\n * truth for *who* to log out: the client `useAuth().user` is unreliable here\n * because the admin `AuthProvider` clears any user that isn't in the admin\n * user collection (a non-admin/public user resolves to `null` via `/me`).\n * On adapters that mount this view's tree after the layout's auth effects\n * (e.g. TanStack Start, where the RSC payload streams in after hydration),\n * that clear races ahead of this component and `useAuth().user` is already\n * `null` at mount — so relying on it would skip the logout request entirely.\n */\n user?: { collection?: string; id?: number | string } | null\n}> = (props) => {\n const { adminRoute, inactivity, redirect, user: serverUser } = props\n\n const { logOut, user: clientUser } = useAuth()\n\n // Prefer the client user when present (covers token refresh / inactivity),\n // but fall back to the server-resolved user so the logout still fires when\n // the client auth state has already been cleared (see `user` prop above).\n const logoutUser = clientUser ?? serverUser\n\n const { startRouteTransition } = useRouteTransition()\n\n const isLoggedIn = React.useMemo(() => {\n return Boolean(logoutUser?.id)\n }, [logoutUser?.id])\n\n const navigatingToLoginRef = React.useRef(false)\n\n const [loginRoute] = React.useState(() =>\n formatAdminURL({\n adminRoute,\n path: `/login${\n inactivity && redirect && redirect.length > 0\n ? `?redirect=${encodeURIComponent(redirect)}`\n : ''\n }`,\n }),\n )\n\n const { t } = useTranslation()\n const router = useRouter()\n\n const handleLogOut = React.useCallback(async () => {\n if (!navigatingToLoginRef.current) {\n navigatingToLoginRef.current = true\n await logOut({ collection: logoutUser?.collection })\n toast.success(t('authentication:loggedOutSuccessfully'))\n startRouteTransition(() => router.push(loginRoute))\n return\n }\n }, [logOut, logoutUser?.collection, loginRoute, router, startRouteTransition, t])\n\n useEffect(() => {\n if (isLoggedIn && !inactivity) {\n void handleLogOut()\n } else if (!inactivity && !navigatingToLoginRef.current) {\n navigatingToLoginRef.current = true\n startRouteTransition(() => router.push(loginRoute))\n }\n }, [handleLogOut, isLoggedIn, loginRoute, router, startRouteTransition, inactivity])\n\n if (!isLoggedIn && inactivity) {\n return (\n <div className={`${baseClass}__wrap`}>\n <h2>{t('authentication:loggedOutInactivity')}</h2>\n <Button buttonStyle=\"primary\" el=\"link\" size=\"medium\" url={loginRoute}>\n {t('authentication:logBackIn')}\n </Button>\n </div>\n )\n }\n\n return <LoadingOverlay animationDuration={'0ms'} loadingText={t('authentication:loggingOut')} />\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,IAASC,SAAS,QAAQ;AACjC,SAASC,KAAK,QAAQ;AAEtB,SAASC,MAAM,QAAQ;AACvB,SAASC,cAAc,QAAQ;AAC/B,SAASC,OAAO,QAAQ;AACxB,SAASC,SAAS,QAAQ;AAC1B,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB;;;;;;;;;;AAUA,OAAO,MAAMC,YAAA,GAeRC,KAAA;EAAA,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AsB,MAAA;IAAAtB,CAAA,OAAAS,oBAAA;IAAAT,CAAA,OAAA6B,EAAA;IAAA7B,CAAA,OAAA8B,EAAA;EAAA;IAAAD,EAAA,GAAA7B,CAAA;IAAA8B,EAAA,GAAA9B,CAAA;EAAA;EAPnFX,SAAA,CAAUwC,EAOV,EAAGC,EAAgF;EAAA,IAE/E,CAACnB,UAAA,IAAcT,UAAA;IAAA,IAAA6B,EAAA;IAAA,IAAA/B,CAAA,SAAAmB,UAAA,IAAAnB,CAAA,SAAAqB,CAAA;MAEfU,EAAA,GAAAC,KAAA,CAAC;QAAAC,SAAA,EAAe,GAAApC,SAAA,QAAoB;QAAAqC,QAAA,GAClCC,IAAA,CAAC;UAAAD,QAAA,EAAIb,CAAA,CAAE;QAAA,C,GACPc,IAAA,CAAA5C,MAAA;UAAA6C,WAAA,EAAoB;UAAAC,EAAA,EAAa;UAAAC,IAAA,EAAY;UAAAC,GAAA,EAAcpB,UAAA;UAAAe,QAAA,EACxDb,CAAA,CAAE;QAAA,C;;;;;;;;WAHPU,E;;;;IASGA,EAAA,GAAAI,IAAA,CAAA3C,cAAA;MAAAgD,iBAAA,EAAmC;MAAAC,WAAA,EAAoBpB,CAAA,CAAE;IAAA,C;;;;;;SAAzDU,E;CACT","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Logout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,aAAa,CAAA;AAIpB,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAC/B;IACE,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,GAAG,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Logout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,aAAa,CAAA;AAIpB,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAC/B;IACE,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,GAAG,oBAAoB,CAuBzB,CAAA"}
|
|
@@ -17,7 +17,8 @@ export const LogoutView = ({
|
|
|
17
17
|
admin: adminRoute
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
}
|
|
20
|
+
},
|
|
21
|
+
user
|
|
21
22
|
}
|
|
22
23
|
} = initPageResult;
|
|
23
24
|
return /*#__PURE__*/_jsx("div", {
|
|
@@ -25,7 +26,11 @@ export const LogoutView = ({
|
|
|
25
26
|
children: /*#__PURE__*/_jsx(LogoutClient, {
|
|
26
27
|
adminRoute: adminRoute,
|
|
27
28
|
inactivity: inactivity,
|
|
28
|
-
redirect: searchParams.redirect
|
|
29
|
+
redirect: searchParams.redirect,
|
|
30
|
+
user: user ? {
|
|
31
|
+
id: user.id,
|
|
32
|
+
collection: user.collection
|
|
33
|
+
} : null
|
|
29
34
|
})
|
|
30
35
|
});
|
|
31
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","LogoutClient","baseClass","LogoutView","inactivity","initPageResult","searchParams","req","payload","config","routes","admin","adminRoute","_jsx","className","redirect"],"sources":["../../../src/views/Logout/index.tsx"],"sourcesContent":["import type { AdminViewServerProps } from 'payload'\n\nimport React from 'react'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir -- Server component must reference exports/client bundle for proper client boundary in prod builds\nimport { LogoutClient } from '../../exports/client/index.js'\nimport './index.css'\n\nconst baseClass = 'logout'\n\nexport const LogoutView: React.FC<\n {\n inactivity?: boolean\n } & AdminViewServerProps\n> = ({ inactivity, initPageResult, searchParams }) => {\n const {\n req: {\n payload: {\n config: {\n routes: { admin: adminRoute },\n },\n },\n },\n } = initPageResult\n\n return (\n <div className={`${baseClass}`}>\n <LogoutClient\n adminRoute={adminRoute}\n inactivity={inactivity}\n redirect={searchParams.redirect as string}\n />\n </div>\n )\n}\n"],"mappings":";AAEA,OAAOA,KAAA,MAAW;AAElB;AACA,SAASC,YAAY,QAAQ;AAC7B,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,UAAA,GAITA,CAAC;EAAEC,UAAU;EAAEC,cAAc;EAAEC;AAAY,CAAE;EAC/C,MAAM;IACJC,GAAA,EAAK;MACHC,OAAA,EAAS;QACPC,MAAA,EAAQ;UACNC,MAAA,EAAQ;YAAEC,KAAA,EAAOC;UAAU;QAAE;MAC9B;
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","LogoutClient","baseClass","LogoutView","inactivity","initPageResult","searchParams","req","payload","config","routes","admin","adminRoute","user","_jsx","className","redirect","id","collection"],"sources":["../../../src/views/Logout/index.tsx"],"sourcesContent":["import type { AdminViewServerProps } from 'payload'\n\nimport React from 'react'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir -- Server component must reference exports/client bundle for proper client boundary in prod builds\nimport { LogoutClient } from '../../exports/client/index.js'\nimport './index.css'\n\nconst baseClass = 'logout'\n\nexport const LogoutView: React.FC<\n {\n inactivity?: boolean\n } & AdminViewServerProps\n> = ({ inactivity, initPageResult, searchParams }) => {\n const {\n req: {\n payload: {\n config: {\n routes: { admin: adminRoute },\n },\n },\n user,\n },\n } = initPageResult\n\n return (\n <div className={`${baseClass}`}>\n <LogoutClient\n adminRoute={adminRoute}\n inactivity={inactivity}\n redirect={searchParams.redirect as string}\n user={user ? { id: user.id, collection: user.collection } : null}\n />\n </div>\n )\n}\n"],"mappings":";AAEA,OAAOA,KAAA,MAAW;AAElB;AACA,SAASC,YAAY,QAAQ;AAC7B,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,UAAA,GAITA,CAAC;EAAEC,UAAU;EAAEC,cAAc;EAAEC;AAAY,CAAE;EAC/C,MAAM;IACJC,GAAA,EAAK;MACHC,OAAA,EAAS;QACPC,MAAA,EAAQ;UACNC,MAAA,EAAQ;YAAEC,KAAA,EAAOC;UAAU;QAAE;MAC9B,CACF;MACDC;IAAI;EACL,CACF,GAAGR,cAAA;EAEJ,oBACES,IAAA,CAAC;IAAIC,SAAA,EAAW,GAAGb,SAAA,EAAW;cAC5B,aAAAY,IAAA,CAACb,YAAA;MACCW,UAAA,EAAYA,UAAA;MACZR,UAAA,EAAYA,UAAA;MACZY,QAAA,EAAUV,YAAA,CAAaU,QAAQ;MAC/BH,IAAA,EAAMA,IAAA,GAAO;QAAEI,EAAA,EAAIJ,IAAA,CAAKI,EAAE;QAAEC,UAAA,EAAYL,IAAA,CAAKK;MAAW,IAAI;;;AAIpE","ignoreList":[]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
type Props = {
|
|
2
3
|
message: string;
|
|
3
4
|
redirectTo: string;
|
|
4
5
|
};
|
|
5
6
|
export declare function ToastAndRedirect({ message, redirectTo }: Props): any;
|
|
7
|
+
export declare function VerifyClient({ loginRoute }: {
|
|
8
|
+
loginRoute: string;
|
|
9
|
+
}): React.JSX.Element;
|
|
6
10
|
export {};
|
|
7
11
|
//# sourceMappingURL=index.client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../src/views/Verify/index.client.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../src/views/Verify/index.client.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAaxC,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AACD,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,KAAK,OAwB9D;AAED,wBAAgB,YAAY,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,qBAiClE"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
5
|
import React, { useEffect } from 'react';
|
|
5
6
|
import { toast } from 'sonner';
|
|
7
|
+
import { Link } from '../../elements/Link/index.js';
|
|
8
|
+
import { Translation } from '../../elements/Translation/index.js';
|
|
6
9
|
import { useRouter } from '../../providers/RouterAdapter/index.js';
|
|
7
10
|
import { useRouteTransition } from '../../providers/RouteTransition/index.js';
|
|
11
|
+
import { useTranslation } from '../../providers/Translation/index.js';
|
|
12
|
+
const baseClass = 'verify';
|
|
13
|
+
const redirectDelay = 3000;
|
|
8
14
|
export function ToastAndRedirect(t0) {
|
|
9
15
|
const $ = _c(6);
|
|
10
16
|
const {
|
|
@@ -48,4 +54,79 @@ export function ToastAndRedirect(t0) {
|
|
|
48
54
|
useEffect(t1, t2);
|
|
49
55
|
return null;
|
|
50
56
|
}
|
|
57
|
+
export function VerifyClient(t0) {
|
|
58
|
+
const $ = _c(10);
|
|
59
|
+
const {
|
|
60
|
+
loginRoute
|
|
61
|
+
} = t0;
|
|
62
|
+
const router = useRouter();
|
|
63
|
+
const {
|
|
64
|
+
startRouteTransition
|
|
65
|
+
} = useRouteTransition();
|
|
66
|
+
const {
|
|
67
|
+
t
|
|
68
|
+
} = useTranslation();
|
|
69
|
+
let t1;
|
|
70
|
+
let t2;
|
|
71
|
+
if ($[0] !== loginRoute || $[1] !== router || $[2] !== startRouteTransition) {
|
|
72
|
+
t1 = () => {
|
|
73
|
+
const timeoutID = setTimeout(() => {
|
|
74
|
+
startRouteTransition(() => router.push(loginRoute));
|
|
75
|
+
}, redirectDelay);
|
|
76
|
+
return () => {
|
|
77
|
+
clearTimeout(timeoutID);
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
t2 = [router, loginRoute, startRouteTransition];
|
|
81
|
+
$[0] = loginRoute;
|
|
82
|
+
$[1] = router;
|
|
83
|
+
$[2] = startRouteTransition;
|
|
84
|
+
$[3] = t1;
|
|
85
|
+
$[4] = t2;
|
|
86
|
+
} else {
|
|
87
|
+
t1 = $[3];
|
|
88
|
+
t2 = $[4];
|
|
89
|
+
}
|
|
90
|
+
useEffect(t1, t2);
|
|
91
|
+
let t3;
|
|
92
|
+
if ($[5] !== loginRoute || $[6] !== t) {
|
|
93
|
+
let t4;
|
|
94
|
+
if ($[8] !== loginRoute) {
|
|
95
|
+
t4 = t5 => {
|
|
96
|
+
const {
|
|
97
|
+
children
|
|
98
|
+
} = t5;
|
|
99
|
+
return _jsx(Link, {
|
|
100
|
+
href: loginRoute,
|
|
101
|
+
prefetch: false,
|
|
102
|
+
children
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
$[8] = loginRoute;
|
|
106
|
+
$[9] = t4;
|
|
107
|
+
} else {
|
|
108
|
+
t4 = $[9];
|
|
109
|
+
}
|
|
110
|
+
t3 = _jsxs("div", {
|
|
111
|
+
className: `${baseClass}__content`,
|
|
112
|
+
children: [_jsx("p", {
|
|
113
|
+
children: t("authentication:emailVerifiedRedirecting")
|
|
114
|
+
}), _jsx("p", {
|
|
115
|
+
children: _jsx(Translation, {
|
|
116
|
+
elements: {
|
|
117
|
+
0: t4
|
|
118
|
+
},
|
|
119
|
+
i18nKey: "authentication:notRedirected",
|
|
120
|
+
t
|
|
121
|
+
})
|
|
122
|
+
})]
|
|
123
|
+
});
|
|
124
|
+
$[5] = loginRoute;
|
|
125
|
+
$[6] = t;
|
|
126
|
+
$[7] = t3;
|
|
127
|
+
} else {
|
|
128
|
+
t3 = $[7];
|
|
129
|
+
}
|
|
130
|
+
return t3;
|
|
131
|
+
}
|
|
51
132
|
//# sourceMappingURL=index.client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.js","names":["c","_c","React","useEffect","toast","useRouter","useRouteTransition","ToastAndRedirect","t0","$","message","redirectTo","router","startRouteTransition","hasToastedRef","useRef","t1","t2","timeoutID","current","push","clearTimeout"],"sources":["../../../src/views/Verify/index.client.tsx"],"sourcesContent":["'use client'\nimport React, { useEffect } from 'react'\nimport { toast } from 'sonner'\n\nimport { useRouter } from '../../providers/RouterAdapter/index.js'\nimport { useRouteTransition } from '../../providers/RouteTransition/index.js'\n\ntype Props = {\n message: string\n redirectTo: string\n}\nexport function ToastAndRedirect({ message, redirectTo }: Props) {\n const router = useRouter()\n const { startRouteTransition } = useRouteTransition()\n const hasToastedRef = React.useRef(false)\n\n useEffect(() => {\n let timeoutID\n\n if (toast) {\n timeoutID = setTimeout(() => {\n toast.success(message)\n hasToastedRef.current = true\n startRouteTransition(() => router.push(redirectTo))\n }, 100)\n }\n\n return () => {\n if (timeoutID) {\n clearTimeout(timeoutID)\n }\n }\n }, [router, redirectTo, message, startRouteTransition])\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA
|
|
1
|
+
{"version":3,"file":"index.client.js","names":["c","_c","React","useEffect","toast","Link","Translation","useRouter","useRouteTransition","useTranslation","baseClass","redirectDelay","ToastAndRedirect","t0","$","message","redirectTo","router","startRouteTransition","hasToastedRef","useRef","t1","t2","timeoutID","current","push","clearTimeout","VerifyClient","loginRoute","t","setTimeout","t3","t4","t5","children","_jsx","href","prefetch","_jsxs","className","elements","0"],"sources":["../../../src/views/Verify/index.client.tsx"],"sourcesContent":["'use client'\nimport React, { useEffect } from 'react'\nimport { toast } from 'sonner'\n\nimport { Link } from '../../elements/Link/index.js'\nimport { Translation } from '../../elements/Translation/index.js'\nimport { useRouter } from '../../providers/RouterAdapter/index.js'\nimport { useRouteTransition } from '../../providers/RouteTransition/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\n\nconst baseClass = 'verify'\n\nconst redirectDelay = 3000\n\ntype Props = {\n message: string\n redirectTo: string\n}\nexport function ToastAndRedirect({ message, redirectTo }: Props) {\n const router = useRouter()\n const { startRouteTransition } = useRouteTransition()\n const hasToastedRef = React.useRef(false)\n\n useEffect(() => {\n let timeoutID\n\n if (toast) {\n timeoutID = setTimeout(() => {\n toast.success(message)\n hasToastedRef.current = true\n startRouteTransition(() => router.push(redirectTo))\n }, 100)\n }\n\n return () => {\n if (timeoutID) {\n clearTimeout(timeoutID)\n }\n }\n }, [router, redirectTo, message, startRouteTransition])\n\n return null\n}\n\nexport function VerifyClient({ loginRoute }: { loginRoute: string }) {\n const router = useRouter()\n const { startRouteTransition } = useRouteTransition()\n const { t } = useTranslation()\n\n useEffect(() => {\n const timeoutID = setTimeout(() => {\n startRouteTransition(() => router.push(loginRoute))\n }, redirectDelay)\n\n return () => {\n clearTimeout(timeoutID)\n }\n }, [router, loginRoute, startRouteTransition])\n\n return (\n <div className={`${baseClass}__content`}>\n <p>{t('authentication:emailVerifiedRedirecting')}</p>\n <p>\n <Translation\n elements={{\n 0: ({ children }) => (\n <Link href={loginRoute} prefetch={false}>\n {children}\n </Link>\n ),\n }}\n i18nKey=\"authentication:notRedirected\"\n t={t}\n />\n </p>\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,KAAA,IAASC,SAAS,QAAQ;AACjC,SAASC,KAAK,QAAQ;AAEtB,SAASC,IAAI,QAAQ;AACrB,SAASC,WAAW,QAAQ;AAC5B,SAASC,SAAS,QAAQ;AAC1B,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAE/B,MAAMC,SAAA,GAAY;AAElB,MAAMC,aAAA,GAAgB;AAMtB,OAAO,SAAAC,iBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAb,EAAA;EAA0B;IAAAc,OAAA;IAAAC;EAAA,IAAAH,EAA8B;EAC7D,MAAAI,MAAA,GAAeV,SAAA;EACf;IAAAW;EAAA,IAAiCV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