@webiny/app-headless-cms 6.0.0-alpha.0 → 6.0.0-alpha.2
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/ContentEntryListConfig.d.ts +7 -2
- package/HeadlessCMS.d.ts +1 -1
- package/HeadlessCMS.js.map +1 -1
- package/admin/components/ContentEntries/Filters/FieldsMapper.d.ts +2 -2
- package/admin/components/ContentEntries/Filters/FieldsMapper.js.map +1 -1
- package/admin/components/ContentEntries/Filters/FilterByStatus.js.map +1 -1
- package/admin/components/ContentEntries/Filters/Filters.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/adapters/EntriesGatewayInterface.d.ts +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/adapters/EntriesGatewayInterface.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/adapters/EntriesGraphQLGateway.d.ts +2 -2
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/adapters/EntriesGraphQLGateway.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/adapters/entries.types.d.ts +2 -2
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/adapters/entries.types.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/components/AutoComplete.d.ts +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/components/AutoComplete.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/components/RefPresenter.d.ts +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/components/RefPresenter.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/components/RefPresenter.test.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/domain/EntryMapper.d.ts +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/domain/EntryMapper.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/domain/EntryRepository.d.ts +2 -2
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/domain/EntryRepository.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/domain/EntryRepositoryFactory.d.ts +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/domain/EntryRepositoryFactory.js.map +1 -1
- package/admin/components/ContentEntries/Scheduler/actions/ScheduleEntryAction.d.ts +2 -0
- package/admin/components/ContentEntries/Scheduler/actions/ScheduleEntryAction.js +82 -0
- package/admin/components/ContentEntries/Scheduler/actions/ScheduleEntryAction.js.map +1 -0
- package/admin/components/ContentEntries/Scheduler/actions/hooks/useGetSchedulerItem.d.ts +11 -0
- package/admin/components/ContentEntries/Scheduler/actions/hooks/useGetSchedulerItem.js +35 -0
- package/admin/components/ContentEntries/Scheduler/actions/hooks/useGetSchedulerItem.js.map +1 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerCancelGraphQLGateway.d.ts +7 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerCancelGraphQLGateway.js +46 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerCancelGraphQLGateway.js.map +1 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerGetGraphQLGateway.d.ts +20 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerGetGraphQLGateway.js +69 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerGetGraphQLGateway.js.map +1 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerListGraphQLGateway.d.ts +7 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerListGraphQLGateway.js +86 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerListGraphQLGateway.js.map +1 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerPublishGraphQLGateway.d.ts +7 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerPublishGraphQLGateway.js +73 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerPublishGraphQLGateway.js.map +1 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerUnpublishGraphQLGateway.d.ts +23 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerUnpublishGraphQLGateway.js +69 -0
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerUnpublishGraphQLGateway.js.map +1 -0
- package/admin/components/ContentEntries/Scheduler/adapters/graphql/fields.d.ts +1 -0
- package/admin/components/ContentEntries/Scheduler/adapters/graphql/fields.js +20 -0
- package/admin/components/ContentEntries/Scheduler/adapters/graphql/fields.js.map +1 -0
- package/admin/components/ContentEntries/Scheduler/adapters/index.d.ts +5 -0
- package/admin/components/ContentEntries/Scheduler/adapters/index.js +7 -0
- package/admin/components/ContentEntries/Scheduler/adapters/index.js.map +1 -0
- package/admin/components/ContentEntries/Scheduler/adapters/schema/schedulerEntry.d.ts +61 -0
- package/admin/components/ContentEntries/Scheduler/adapters/schema/schedulerEntry.js +26 -0
- package/admin/components/ContentEntries/Scheduler/adapters/schema/schedulerEntry.js.map +1 -0
- package/admin/components/ContentEntries/Scheduler/components/ScheduleSidebarButton.d.ts +5 -0
- package/admin/components/ContentEntries/Scheduler/components/ScheduleSidebarButton.js +17 -0
- package/admin/components/ContentEntries/Scheduler/components/ScheduleSidebarButton.js.map +1 -0
- package/admin/components/ContentEntries/Scheduler/components/Scheduler.d.ts +2 -0
- package/admin/components/ContentEntries/Scheduler/components/Scheduler.js +54 -0
- package/admin/components/ContentEntries/Scheduler/components/Scheduler.js.map +1 -0
- package/admin/components/ContentEntries/Scheduler/components/index.d.ts +1 -0
- package/admin/components/ContentEntries/Scheduler/components/index.js +3 -0
- package/admin/components/ContentEntries/Scheduler/components/index.js.map +1 -0
- package/admin/components/ContentEntries/Scheduler/index.d.ts +1 -0
- package/admin/components/ContentEntries/Scheduler/index.js +3 -0
- package/admin/components/ContentEntries/Scheduler/index.js.map +1 -0
- package/admin/components/ContentEntries/SidebarFooter/SidebarFooter.js +3 -2
- package/admin/components/ContentEntries/SidebarFooter/SidebarFooter.js.map +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellActions.js +3 -3
- package/admin/components/ContentEntries/Table/Cells/CellActions.js.map +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellAuthor.js +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellAuthor.js.map +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellCreated.js +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellCreated.js.map +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellModified.js +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellModified.js.map +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellName.d.ts +4 -4
- package/admin/components/ContentEntries/Table/Cells/CellName.js +2 -2
- package/admin/components/ContentEntries/Table/Cells/CellName.js.map +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellStatus.js +4 -3
- package/admin/components/ContentEntries/Table/Cells/CellStatus.js.map +1 -1
- package/admin/components/ContentEntries/Table/index.js +6 -3
- package/admin/components/ContentEntries/Table/index.js.map +1 -1
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinBulkActionsGraphQLGateway.d.ts +4 -4
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinBulkActionsGraphQLGateway.js.map +1 -1
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinDeleteItemGraphQLGateway.d.ts +3 -3
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinDeleteItemGraphQLGateway.js.map +1 -1
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinItemMapper.d.ts +2 -2
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinItemMapper.js.map +1 -1
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinListGraphQLGateway.d.ts +4 -4
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinListGraphQLGateway.js.map +1 -1
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinRestoreItemGraphQLGateway.d.ts +3 -3
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinRestoreItemGraphQLGateway.js.map +1 -1
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinRestoreItemGraphQLGatewayWithCallback.d.ts +2 -2
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinRestoreItemGraphQLGatewayWithCallback.js.map +1 -1
- package/admin/components/ContentEntryForm/ContentEntryForm.d.ts +3 -3
- package/admin/components/ContentEntryForm/ContentEntryForm.js.map +1 -1
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.d.ts +1 -1
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.js.map +1 -1
- package/admin/components/ContentEntryForm/CustomLayout.d.ts +1 -1
- package/admin/components/ContentEntryForm/CustomLayout.js.map +1 -1
- package/admin/components/ContentEntryForm/DefaultLayout.d.ts +1 -1
- package/admin/components/ContentEntryForm/DefaultLayout.js.map +1 -1
- package/admin/components/ContentEntryForm/Header/RevisionSelector/RevisionSelector.js.map +1 -1
- package/admin/components/ContentEntryForm/ParentValue.d.ts +1 -1
- package/admin/components/ContentEntryForm/ParentValue.js.map +1 -1
- package/admin/components/ContentEntryForm/functions/getValue.d.ts +2 -2
- package/admin/components/ContentEntryForm/functions/getValue.js.map +1 -1
- package/admin/components/ContentEntryForm/functions/setValue.d.ts +2 -2
- package/admin/components/ContentEntryForm/functions/setValue.js.map +1 -1
- package/admin/components/ContentEntryForm/useDefaultValues.d.ts +1 -1
- package/admin/components/ContentEntryForm/useDefaultValues.js.map +1 -1
- package/admin/components/ContentEntryForm/useFormRenderer.d.ts +1 -1
- package/admin/components/ContentEntryForm/useFormRenderer.js.map +1 -1
- package/admin/components/ContentModelEditor/ContentModelEditor.js.map +1 -1
- package/admin/components/ContentModelEditor/ContentModelEditorProvider.d.ts +4 -4
- package/admin/components/ContentModelEditor/ContentModelEditorProvider.js.map +1 -1
- package/admin/components/ContentModelEditor/FieldsSidebar.d.ts +2 -1
- package/admin/components/ContentModelEditor/FieldsSidebar.js.map +1 -1
- package/admin/components/ContentModelEditor/PreviewTab.d.ts +1 -1
- package/admin/components/ContentModelEditor/PreviewTab.js.map +1 -1
- package/admin/components/Decorators/ShowConfirmationOnDelete.js +1 -1
- package/admin/components/Decorators/ShowConfirmationOnDelete.js.map +1 -1
- package/admin/components/Decorators/ShowConfirmationOnDeleteRevision/EntryRevisionDeletedSnackbarMessage.d.ts +1 -1
- package/admin/components/Decorators/ShowConfirmationOnDeleteRevision/EntryRevisionDeletedSnackbarMessage.js.map +1 -1
- package/admin/components/Decorators/ShowConfirmationOnDeleteRevision.js +1 -1
- package/admin/components/Decorators/ShowConfirmationOnDeleteRevision.js.map +1 -1
- package/admin/components/Decorators/ShowConfirmationOnPublish.js +1 -1
- package/admin/components/Decorators/ShowConfirmationOnPublish.js.map +1 -1
- package/admin/components/Decorators/ShowConfirmationOnUnpublish.js +1 -1
- package/admin/components/Decorators/ShowConfirmationOnUnpublish.js.map +1 -1
- package/admin/components/DragPreview.js.map +1 -1
- package/admin/components/Draggable.d.ts +3 -2
- package/admin/components/Draggable.js.map +1 -1
- package/admin/components/DropZone/Center.d.ts +3 -2
- package/admin/components/DropZone/Center.js.map +1 -1
- package/admin/components/DropZone/Horizontal.d.ts +2 -2
- package/admin/components/DropZone/Horizontal.js.map +1 -1
- package/admin/components/DropZone/Vertical.d.ts +2 -2
- package/admin/components/DropZone/Vertical.js.map +1 -1
- package/admin/components/Droppable.d.ts +2 -2
- package/admin/components/Droppable.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab/RendererOptions.d.ts +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab/RendererOptions.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/ValidationTab/ValidationsSection.d.ts +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/ValidationTab/ValidationsSection.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/ValidationTab/ValidatorsList.d.ts +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/ValidationTab/ValidatorsList.js +4 -4
- package/admin/components/FieldEditor/EditFieldDialog/ValidationTab/ValidatorsList.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.d.ts +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.d.ts +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/getValidators.d.ts +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/getValidators.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/useRendererPlugins.d.ts +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/useRendererPlugins.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog.d.ts +2 -2
- package/admin/components/FieldEditor/EditFieldDialog.js.map +1 -1
- package/admin/components/FieldEditor/Field.d.ts +1 -1
- package/admin/components/FieldEditor/Field.js.map +1 -1
- package/admin/components/FieldEditor/FieldEditor.d.ts +1 -1
- package/admin/components/FieldEditor/FieldEditor.js.map +1 -1
- package/admin/components/FieldEditor/FieldEditorContext.d.ts +3 -3
- package/admin/components/FieldEditor/FieldEditorContext.js.map +1 -1
- package/admin/components/FieldEditor/utils/deleteField.d.ts +1 -1
- package/admin/components/FieldEditor/utils/deleteField.js.map +1 -1
- package/admin/components/FieldEditor/utils/getFieldPosition.d.ts +1 -1
- package/admin/components/FieldEditor/utils/getFieldPosition.js.map +1 -1
- package/admin/components/FieldEditor/utils/moveField.d.ts +1 -1
- package/admin/components/FieldEditor/utils/moveField.js.map +1 -1
- package/admin/components/FieldEditor/utils/moveRow.d.ts +1 -1
- package/admin/components/FieldEditor/utils/moveRow.js.map +1 -1
- package/admin/components/IconPicker.d.ts +1 -1
- package/admin/components/IconPicker.js.map +1 -1
- package/admin/components/LexicalCmsEditor/LexicalCmsEditor.d.ts +1 -1
- package/admin/components/LexicalCmsEditor/LexicalCmsEditor.js.map +1 -1
- package/admin/components/LexicalCmsEditor/LexicalEditorCmsPlugin.d.ts +1 -1
- package/admin/components/LexicalCmsEditor/LexicalEditorCmsPlugin.js.map +1 -1
- package/admin/components/LexicalCmsEditor/TypographyDropDown.js.map +1 -1
- package/admin/config/contentEntries/editor/Actions/ButtonAction.d.ts +1 -1
- package/admin/config/contentEntries/editor/Actions/ButtonAction.js.map +1 -1
- package/admin/config/contentEntries/editor/Actions/MenuItemAction.d.ts +1 -1
- package/admin/config/contentEntries/editor/Actions/MenuItemAction.js.map +1 -1
- package/admin/config/contentEntries/editor/Actions/index.d.ts +3 -3
- package/admin/config/contentEntries/editor/Actions/index.js.map +1 -1
- package/admin/config/contentEntries/editor/ContentEntryEditorConfig.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/AdvancedSearch/FieldRenderer.d.ts +2 -2
- package/admin/config/contentEntries/list/Browser/AdvancedSearch/FieldRenderer.js +1 -2
- package/admin/config/contentEntries/list/Browser/AdvancedSearch/FieldRenderer.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/AdvancedSearch/index.d.ts +1 -1
- package/admin/config/contentEntries/list/Browser/AdvancedSearch/index.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/BulkAction.d.ts +2 -2
- package/admin/config/contentEntries/list/Browser/BulkAction.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/EntryAction.d.ts +2 -2
- package/admin/config/contentEntries/list/Browser/EntryAction.js +1 -2
- package/admin/config/contentEntries/list/Browser/EntryAction.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/FolderAction.d.ts +2 -2
- package/admin/config/contentEntries/list/Browser/FolderAction.js +1 -2
- package/admin/config/contentEntries/list/Browser/FolderAction.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/FolderFieldDecorator.d.ts +2 -2
- package/admin/config/contentEntries/list/Browser/FolderFieldDecorator.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/Table/Column.d.ts +10 -5
- package/admin/config/contentEntries/list/Browser/Table/Column.js +5 -3
- package/admin/config/contentEntries/list/Browser/Table/Column.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/Table/index.d.ts +8 -3
- package/admin/config/contentEntries/list/Browser/Table/index.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/index.d.ts +14 -9
- package/admin/config/contentEntries/list/Browser/index.js.map +1 -1
- package/admin/config/contentEntries/list/ContentEntryListConfig.d.ts +7 -2
- package/admin/config/contentEntries/list/ContentEntryListConfig.js.map +1 -1
- package/admin/contexts/Cms/index.d.ts +2 -2
- package/admin/contexts/Cms/index.js.map +1 -1
- package/admin/elements/NothingToShowElement.d.ts +3 -2
- package/admin/elements/NothingToShowElement.js +3 -3
- package/admin/elements/NothingToShowElement.js.map +1 -1
- package/admin/graphql/contentModels.d.ts +1 -1
- package/admin/graphql/contentModels.js.map +1 -1
- package/admin/hooks/useApolloClient.d.ts +1 -1
- package/admin/hooks/useApolloClient.js.map +1 -1
- package/admin/hooks/useContentModels.d.ts +1 -1
- package/admin/hooks/useContentModels.js.map +1 -1
- package/admin/hooks/useEntry.d.ts +3 -3
- package/admin/hooks/useEntry.js.map +1 -1
- package/admin/hooks/useLazyQuery.d.ts +3 -3
- package/admin/hooks/useLazyQuery.js.map +1 -1
- package/admin/hooks/useModelFieldGraphqlContext.d.ts +1 -1
- package/admin/hooks/useMutation.d.ts +3 -3
- package/admin/hooks/useMutation.js.map +1 -1
- package/admin/hooks/usePermission.d.ts +1 -1
- package/admin/hooks/usePermission.js.map +1 -1
- package/admin/hooks/usePersistEntry.d.ts +1 -1
- package/admin/hooks/usePersistEntry.js.map +1 -1
- package/admin/hooks/useQuery.d.ts +3 -3
- package/admin/hooks/useQuery.js.map +1 -1
- package/admin/hooks/useQueryLocale.d.ts +3 -3
- package/admin/hooks/useQueryLocale.js.map +1 -1
- package/admin/menus/ContentGroupsMenuItems.js.map +1 -1
- package/admin/plugins/apiInformation/index.d.ts +1 -1
- package/admin/plugins/apiInformation/index.js.map +1 -1
- package/admin/plugins/editor/defaultBar/CreateContentButton.js.map +1 -1
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettings.js.map +1 -1
- package/admin/plugins/editor/formSettings/components/GeneralSettings.d.ts +1 -1
- package/admin/plugins/editor/formSettings/components/GeneralSettings.js.map +1 -1
- package/admin/plugins/editor/formSettings/components/GroupSelect.d.ts +1 -1
- package/admin/plugins/editor/formSettings/components/GroupSelect.js.map +1 -1
- package/admin/plugins/editor/formSettings/index.d.ts +1 -1
- package/admin/plugins/editor/formSettings/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/Accordion.d.ts +2 -1
- package/admin/plugins/fieldRenderers/Accordion.js +4 -4
- package/admin/plugins/fieldRenderers/Accordion.js.map +1 -1
- package/admin/plugins/fieldRenderers/AccordionRenderSettings.d.ts +1 -1
- package/admin/plugins/fieldRenderers/AccordionRenderSettings.js.map +1 -1
- package/admin/plugins/fieldRenderers/DynamicSection.d.ts +2 -2
- package/admin/plugins/fieldRenderers/DynamicSection.js +1 -1
- package/admin/plugins/fieldRenderers/DynamicSection.js.map +1 -1
- package/admin/plugins/fieldRenderers/boolean/booleanSwitch.d.ts +1 -1
- package/admin/plugins/fieldRenderers/boolean/booleanSwitch.js.map +1 -1
- package/admin/plugins/fieldRenderers/checkboxes.d.ts +1 -1
- package/admin/plugins/fieldRenderers/checkboxes.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/DateOnly.d.ts +3 -3
- package/admin/plugins/fieldRenderers/dateTime/DateOnly.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.d.ts +2 -2
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.d.ts +2 -2
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/Input.d.ts +2 -2
- package/admin/plugins/fieldRenderers/dateTime/Input.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/Select.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dateTime/Select.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/Time.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dateTime/Time.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/dateTimeFields.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dateTime/dateTimeFields.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/utils.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dateTime/utils.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/AddTemplate.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/AddTemplate.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/MultiValueDynamicZone.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/MultiValueDynamicZone.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/SingleValueDynamicZone.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/SingleValueDynamicZone.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateGallery.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateGallery.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateIcon.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateItem.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateItem.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateProvider.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateProvider.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/dynamicZoneRenderer.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/dynamicZoneRenderer.js +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/dynamicZoneRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/index.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/index.js +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/useTemplateTypename.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/useTemplateTypename.js.map +1 -1
- package/admin/plugins/fieldRenderers/hidden.d.ts +1 -1
- package/admin/plugins/fieldRenderers/hidden.js.map +1 -1
- package/admin/plugins/fieldRenderers/lexicalText/lexicalTextInput.d.ts +1 -1
- package/admin/plugins/fieldRenderers/lexicalText/lexicalTextInput.js.map +1 -1
- package/admin/plugins/fieldRenderers/lexicalText/lexicalTextInputs.d.ts +1 -1
- package/admin/plugins/fieldRenderers/lexicalText/lexicalTextInputs.js.map +1 -1
- package/admin/plugins/fieldRenderers/lexicalText/utils.d.ts +1 -1
- package/admin/plugins/fieldRenderers/lexicalText/utils.js.map +1 -1
- package/admin/plugins/fieldRenderers/longText/longText.d.ts +1 -1
- package/admin/plugins/fieldRenderers/longText/longText.js.map +1 -1
- package/admin/plugins/fieldRenderers/longText/longTexts.d.ts +1 -1
- package/admin/plugins/fieldRenderers/longText/longTexts.js.map +1 -1
- package/admin/plugins/fieldRenderers/number/numberInput.d.ts +1 -1
- package/admin/plugins/fieldRenderers/number/numberInput.js.map +1 -1
- package/admin/plugins/fieldRenderers/number/numberInputs.d.ts +1 -1
- package/admin/plugins/fieldRenderers/number/numberInputs.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/FieldSettings.d.ts +2 -2
- package/admin/plugins/fieldRenderers/object/FieldSettings.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/MultiValueContainer.d.ts +1 -1
- package/admin/plugins/fieldRenderers/object/MultiValueContainer.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/MultiValueItemContainer.d.ts +1 -1
- package/admin/plugins/fieldRenderers/object/MultiValueItemContainer.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/multipleObjects.d.ts +1 -1
- package/admin/plugins/fieldRenderers/object/multipleObjects.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/multipleObjectsAccordion.d.ts +1 -1
- package/admin/plugins/fieldRenderers/object/multipleObjectsAccordion.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/singleObjectAccordion.d.ts +1 -1
- package/admin/plugins/fieldRenderers/object/singleObjectAccordion.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/singleObjectInline.d.ts +1 -1
- package/admin/plugins/fieldRenderers/object/singleObjectInline.js.map +1 -1
- package/admin/plugins/fieldRenderers/radioButtons.d.ts +1 -1
- package/admin/plugins/fieldRenderers/radioButtons.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/AdvancedMultipleReferenceField.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/advanced/components/AdvancedMultipleReferenceField.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/AdvancedSingleReferenceField.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/advanced/components/AdvancedSingleReferenceField.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/Entries.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/Entries.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/Entry.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/advanced/components/Entry.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/Options.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/Options.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/ReferencesDialog.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/advanced/components/ReferencesDialog.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/CreatedBy.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/CreatedBy.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Excerpt.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Excerpt.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Image.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/ModifiedBy.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/ModifiedBy.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Remove.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Remove.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Select.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Select.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Status.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Status.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/View.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/View.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/options/OptionsModelList.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/options/OptionsModelList.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/options/OptionsModelListItem.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/options/OptionsModelListItem.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/detailedReferenceRenderer.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/detailedReferenceRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/detailedReferencesRenderer.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/detailedReferencesRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/hooks/graphql.d.ts +3 -3
- package/admin/plugins/fieldRenderers/ref/advanced/hooks/graphql.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/hooks/useEntries.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/advanced/hooks/useEntries.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/hooks/useReferences.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/hooks/useReferences.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/EntryStatus.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/components/EntryStatus.js +3 -3
- package/admin/plugins/fieldRenderers/ref/components/EntryStatus.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/NewReferencedEntryDialog.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/components/NewReferencedEntryDialog.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/graphql.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/components/graphql.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/helpers.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/components/helpers.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/renderItem.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/components/renderItem.js +2 -2
- package/admin/plugins/fieldRenderers/ref/components/renderItem.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/types.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/components/types.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/useReference.d.ts +3 -3
- package/admin/plugins/fieldRenderers/ref/components/useReference.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/useReferences.d.ts +3 -3
- package/admin/plugins/fieldRenderers/ref/components/useReferences.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntry.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntry.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/refInput.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/refInput.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/refInputs.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/refInputs.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/components/SimpleMultipleRenderer.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/simple/components/SimpleMultipleRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/components/SimpleSingleRenderer.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/simple/components/SimpleSingleRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/components/useContentModels.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/components/useContentModels.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/components/useReferences.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/simple/components/useReferences.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/simpleMultipleRenderer.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/simpleMultipleRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/simpleSingleRenderer.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/simpleSingleRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/richText/richTextInput.d.ts +1 -1
- package/admin/plugins/fieldRenderers/richText/richTextInput.js.map +1 -1
- package/admin/plugins/fieldRenderers/richText/richTextInputs.d.ts +1 -1
- package/admin/plugins/fieldRenderers/richText/richTextInputs.js +1 -1
- package/admin/plugins/fieldRenderers/richText/richTextInputs.js.map +1 -1
- package/admin/plugins/fieldRenderers/richText/utils.d.ts +1 -1
- package/admin/plugins/fieldRenderers/richText/utils.js.map +1 -1
- package/admin/plugins/fieldRenderers/select.d.ts +1 -1
- package/admin/plugins/fieldRenderers/select.js.map +1 -1
- package/admin/plugins/fieldRenderers/text/tags.d.ts +1 -1
- package/admin/plugins/fieldRenderers/text/tags.js.map +1 -1
- package/admin/plugins/fieldRenderers/text/textInput.d.ts +1 -1
- package/admin/plugins/fieldRenderers/text/textInput.js.map +1 -1
- package/admin/plugins/fieldRenderers/text/textInputs.d.ts +1 -1
- package/admin/plugins/fieldRenderers/text/textInputs.js.map +1 -1
- package/admin/plugins/fieldValidators/date/createDateInputField.d.ts +2 -2
- package/admin/plugins/fieldValidators/date/createDateInputField.js.map +1 -1
- package/admin/plugins/fieldValidators/dateGte.d.ts +1 -1
- package/admin/plugins/fieldValidators/dateGte.js.map +1 -1
- package/admin/plugins/fieldValidators/dateLte.d.ts +1 -1
- package/admin/plugins/fieldValidators/dateLte.js.map +1 -1
- package/admin/plugins/fieldValidators/dynamicZone.d.ts +1 -1
- package/admin/plugins/fieldValidators/dynamicZone.js.map +1 -1
- package/admin/plugins/fieldValidators/gte.d.ts +1 -1
- package/admin/plugins/fieldValidators/gte.js.map +1 -1
- package/admin/plugins/fieldValidators/in.d.ts +1 -1
- package/admin/plugins/fieldValidators/in.js.map +1 -1
- package/admin/plugins/fieldValidators/lte.d.ts +1 -1
- package/admin/plugins/fieldValidators/lte.js.map +1 -1
- package/admin/plugins/fieldValidators/maxLength.d.ts +1 -1
- package/admin/plugins/fieldValidators/maxLength.js.map +1 -1
- package/admin/plugins/fieldValidators/minLength.d.ts +1 -1
- package/admin/plugins/fieldValidators/minLength.js.map +1 -1
- package/admin/plugins/fieldValidators/pattern.d.ts +1 -1
- package/admin/plugins/fieldValidators/pattern.js +16 -14
- package/admin/plugins/fieldValidators/pattern.js.map +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/email.d.ts +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/email.js.map +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.d.ts +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.js.map +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace.d.ts +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace.js.map +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.d.ts +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.js.map +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace.d.ts +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace.js.map +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/url.d.ts +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/url.js.map +1 -1
- package/admin/plugins/fieldValidators/required.d.ts +1 -1
- package/admin/plugins/fieldValidators/required.js.map +1 -1
- package/admin/plugins/fieldValidators/unique.d.ts +1 -1
- package/admin/plugins/fieldValidators/unique.js.map +1 -1
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.d.ts +1 -1
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.js.map +1 -1
- package/admin/plugins/fields/boolean.d.ts +1 -1
- package/admin/plugins/fields/boolean.js.map +1 -1
- package/admin/plugins/fields/dateTime.d.ts +1 -1
- package/admin/plugins/fields/dateTime.js.map +1 -1
- package/admin/plugins/fields/dynamicZone/AddTemplate.d.ts +1 -1
- package/admin/plugins/fields/dynamicZone/AddTemplate.js.map +1 -1
- package/admin/plugins/fields/dynamicZone/DynamicZone.js.map +1 -1
- package/admin/plugins/fields/dynamicZone/DynamicZoneTemplate.d.ts +1 -1
- package/admin/plugins/fields/dynamicZone/DynamicZoneTemplate.js.map +1 -1
- package/admin/plugins/fields/dynamicZone/TemplateDialog.d.ts +1 -1
- package/admin/plugins/fields/dynamicZone/TemplateDialog.js.map +1 -1
- package/admin/plugins/fields/dynamicZone/commonValidators.d.ts +1 -1
- package/admin/plugins/fields/dynamicZone/commonValidators.js.map +1 -1
- package/admin/plugins/fields/dynamicZone.d.ts +1 -1
- package/admin/plugins/fields/dynamicZone.js.map +1 -1
- package/admin/plugins/fields/json.d.ts +1 -1
- package/admin/plugins/fields/json.js.map +1 -1
- package/admin/plugins/fields/longText.d.ts +1 -1
- package/admin/plugins/fields/longText.js.map +1 -1
- package/admin/plugins/fields/number.d.ts +1 -1
- package/admin/plugins/fields/number.js.map +1 -1
- package/admin/plugins/fields/object/ObjectFields.d.ts +1 -1
- package/admin/plugins/fields/object/ObjectFields.js.map +1 -1
- package/admin/plugins/fields/object.d.ts +1 -1
- package/admin/plugins/fields/object.js.map +1 -1
- package/admin/plugins/fields/ref/graphql.d.ts +1 -1
- package/admin/plugins/fields/ref/graphql.js.map +1 -1
- package/admin/plugins/fields/ref/renderInfo.d.ts +1 -1
- package/admin/plugins/fields/ref/renderInfo.js.map +1 -1
- package/admin/plugins/fields/ref.d.ts +1 -1
- package/admin/plugins/fields/ref.js.map +1 -1
- package/admin/plugins/fields/richText.d.ts +1 -1
- package/admin/plugins/fields/richText.js.map +1 -1
- package/admin/plugins/fields/searchableJson.d.ts +1 -1
- package/admin/plugins/fields/searchableJson.js.map +1 -1
- package/admin/plugins/fields/text.d.ts +1 -1
- package/admin/plugins/fields/text.js.map +1 -1
- package/admin/plugins/icons.d.ts +1 -1
- package/admin/plugins/icons.js.map +1 -1
- package/admin/plugins/index.d.ts +3 -3
- package/admin/plugins/install.d.ts +2 -2
- package/admin/plugins/install.js +1 -1
- package/admin/plugins/install.js.map +1 -1
- package/admin/plugins/permissionRenderer/CmsPermissions.d.ts +1 -1
- package/admin/plugins/permissionRenderer/CmsPermissions.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.d.ts +2 -2
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.d.ts +2 -2
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/ContentModelList.d.ts +1 -1
- package/admin/plugins/permissionRenderer/components/ContentModelList.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.d.ts +2 -2
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/PermissionSelector.d.ts +2 -2
- package/admin/plugins/permissionRenderer/components/PermissionSelector.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/useCmsData.js.map +1 -1
- package/admin/plugins/permissionRenderer/index.d.ts +1 -1
- package/admin/plugins/permissionRenderer/index.js.map +1 -1
- package/admin/plugins/routes.d.ts +1 -1
- package/admin/plugins/routes.js.map +1 -1
- package/admin/plugins/transformers/dateTransformer.d.ts +1 -1
- package/admin/plugins/transformers/dateTransformer.js.map +1 -1
- package/admin/plugins/transformers/dynamicZoneTransformer.d.ts +1 -1
- package/admin/plugins/transformers/dynamicZoneTransformer.js.map +1 -1
- package/admin/plugins/transformers/index.d.ts +1 -1
- package/admin/plugins/transformers/index.js.map +1 -1
- package/admin/plugins/transformers/numberTransformer.d.ts +1 -1
- package/admin/plugins/transformers/numberTransformer.js.map +1 -1
- package/admin/plugins/transformers/objectTransformer.d.ts +1 -1
- package/admin/plugins/transformers/objectTransformer.js.map +1 -1
- package/admin/plugins/welcomeScreenWidget.d.ts +1 -1
- package/admin/plugins/welcomeScreenWidget.js.map +1 -1
- package/admin/views/contentEntries/ContentEntriesContainer.js.map +1 -1
- package/admin/views/contentEntries/ContentEntriesContext.d.ts +1 -1
- package/admin/views/contentEntries/ContentEntriesContext.js.map +1 -1
- package/admin/views/contentEntries/ContentEntriesModule.js +4 -0
- package/admin/views/contentEntries/ContentEntriesModule.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.d.ts +4 -4
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/RevisionsList/RevisionListItem.d.ts +1 -1
- package/admin/views/contentEntries/ContentEntry/RevisionsList/RevisionListItem.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/RevisionsList/useRevision.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/RevisionsList/useRevision.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/SingletonContentEntry.js +3 -3
- package/admin/views/contentEntries/ContentEntry/SingletonContentEntry.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/useMockRecords.d.ts +1 -1
- package/admin/views/contentEntries/ContentEntry/useMockRecords.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry.js.map +1 -1
- package/admin/views/contentEntries/hooks/useContentEntriesList.d.ts +7 -6
- package/admin/views/contentEntries/hooks/useContentEntriesList.js +5 -12
- package/admin/views/contentEntries/hooks/useContentEntriesList.js.map +1 -1
- package/admin/views/contentEntries/hooks/useMoveContentEntryToFolder.d.ts +2 -2
- package/admin/views/contentEntries/hooks/useMoveContentEntryToFolder.js.map +1 -1
- package/admin/views/contentModelGroups/ContentModelGroups.js.map +1 -1
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.js.map +1 -1
- package/admin/views/contentModelGroups/ContentModelGroupsForm.js.map +1 -1
- package/admin/views/contentModelGroups/graphql.d.ts +1 -1
- package/admin/views/contentModelGroups/graphql.js.map +1 -1
- package/admin/views/contentModels/CloneContentModelDialog.d.ts +1 -1
- package/admin/views/contentModels/CloneContentModelDialog.js.map +1 -1
- package/admin/views/contentModels/ContentModels.js.map +1 -1
- package/admin/views/contentModels/NewContentModelDialog.js.map +1 -1
- package/admin/views/contentModels/cache.d.ts +3 -3
- package/admin/views/contentModels/cache.js.map +1 -1
- package/admin/views/contentModels/exporting/download.d.ts +1 -1
- package/admin/views/contentModels/exporting/download.js.map +1 -1
- package/admin/views/contentModels/exporting/runExport.d.ts +2 -2
- package/admin/views/contentModels/exporting/runExport.js.map +1 -1
- package/admin/views/contentModels/exporting/useModelExport.d.ts +1 -1
- package/admin/views/contentModels/exporting/useModelExport.js.map +1 -1
- package/admin/views/contentModels/fullDelete/dialog/process.d.ts +1 -1
- package/admin/views/contentModels/fullDelete/dialog/process.js.map +1 -1
- package/admin/views/contentModels/fullDelete/dialog/state.d.ts +1 -1
- package/admin/views/contentModels/fullDelete/dialog/state.js.map +1 -1
- package/admin/views/contentModels/fullDelete/types.d.ts +2 -2
- package/admin/views/contentModels/fullDelete/types.js.map +1 -1
- package/admin/views/contentModels/fullDelete/useCancelDelete.d.ts +1 -1
- package/admin/views/contentModels/fullDelete/useCancelDelete.js.map +1 -1
- package/admin/views/contentModels/helpers/apiNameValidator.d.ts +2 -2
- package/admin/views/contentModels/helpers/apiNameValidator.js.map +1 -1
- package/admin/views/contentModels/helpers/nameValidator.d.ts +1 -1
- package/admin/views/contentModels/helpers/nameValidator.js.map +1 -1
- package/admin/views/contentModels/importing/ImportContext.d.ts +2 -2
- package/admin/views/contentModels/importing/ImportContext.js.map +1 -1
- package/admin/views/contentModels/importing/components/DataList.js.map +1 -1
- package/admin/views/contentModels/importing/components/DataListGroup.d.ts +1 -1
- package/admin/views/contentModels/importing/components/DataListGroup.js +2 -2
- package/admin/views/contentModels/importing/components/DataListGroup.js.map +1 -1
- package/admin/views/contentModels/importing/components/Errors.d.ts +1 -1
- package/admin/views/contentModels/importing/components/Errors.js +1 -1
- package/admin/views/contentModels/importing/components/Errors.js.map +1 -1
- package/admin/views/contentModels/importing/components/Model/DataListModelItem.d.ts +2 -2
- package/admin/views/contentModels/importing/components/Model/DataListModelItem.js +10 -10
- package/admin/views/contentModels/importing/components/Model/DataListModelItem.js.map +1 -1
- package/admin/views/contentModels/importing/components/Model/DataListModelItemError.d.ts +1 -1
- package/admin/views/contentModels/importing/components/Model/DataListModelItemError.js +3 -3
- package/admin/views/contentModels/importing/components/Model/DataListModelItemError.js.map +1 -1
- package/admin/views/contentModels/importing/components/Model/DataListModelItemInfo.d.ts +1 -1
- package/admin/views/contentModels/importing/components/Model/DataListModelItemInfo.js +1 -1
- package/admin/views/contentModels/importing/components/Model/DataListModelItemInfo.js.map +1 -1
- package/admin/views/contentModels/importing/components/Model/DataListModels.d.ts +1 -1
- package/admin/views/contentModels/importing/components/Model/DataListModels.js +1 -1
- package/admin/views/contentModels/importing/components/Model/DataListModels.js.map +1 -1
- package/admin/views/contentModels/importing/graphql.d.ts +2 -2
- package/admin/views/contentModels/importing/graphql.js.map +1 -1
- package/admin/views/contentModels/importing/types.d.ts +1 -1
- package/admin/views/contentModels/importing/types.js.map +1 -1
- package/admin/viewsGraphql.d.ts +1 -1
- package/admin/viewsGraphql.js.map +1 -1
- package/allPlugins.d.ts +4 -4
- package/package.json +32 -30
- package/types.d.ts +6 -6
- package/types.js.map +1 -1
- package/utils/CmsModelFieldValidatorConfigAdapter.d.ts +1 -1
- package/utils/CmsModelFieldValidatorConfigAdapter.js.map +1 -1
- package/utils/getFetchPolicy.d.ts +1 -1
- package/utils/getFetchPolicy.js.map +1 -1
- package/utils/getModelTitleFieldId.d.ts +1 -1
- package/utils/getModelTitleFieldId.js.map +1 -1
|
@@ -119,8 +119,13 @@ export declare const ContentEntryListConfig: {
|
|
|
119
119
|
displayName: string;
|
|
120
120
|
}>) => (props: unknown) => import("react").JSX.Element;
|
|
121
121
|
} & {
|
|
122
|
-
useTableRow:
|
|
123
|
-
|
|
122
|
+
useTableRow: {
|
|
123
|
+
(): import("@webiny/app-aco").TableRowContextData<import("./types").TableItem>;
|
|
124
|
+
<TUserRow>(): import("@webiny/app-aco").TableRowContextData<import("./types").TableItem & {
|
|
125
|
+
data: TUserRow;
|
|
126
|
+
}>;
|
|
127
|
+
};
|
|
128
|
+
isFolderRow: (row: import("./types").TableItem) => row is import("@webiny/app-aco").FolderTableRow;
|
|
124
129
|
};
|
|
125
130
|
};
|
|
126
131
|
FolderAction: (({ modelIds, ...props }: import("./admin/config/contentEntries/list/Browser/FolderAction").FolderActionProps) => import("react").JSX.Element | null) & {
|
package/HeadlessCMS.d.ts
CHANGED
package/HeadlessCMS.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Fragment","memo","plugins","AdminConfig","Provider","ApolloCacheObjectIdPlugin","CmsProvider","CmsMenuLoader","apiInformation","ContentEntriesModule","allPlugins","LexicalEditorCmsPlugin","SingletonContentEntryModule","createHeadlessCMSProvider","createApolloClient","Component","HeadlessCMSProvider","children","createElement","attachTypeName","HeadlessCMSExtension","register","obj","__typename","includes","id","undefined","hoc","HeadlessCMS"],"sources":["HeadlessCMS.tsx"],"sourcesContent":["import React, { Fragment, memo } from \"react\";\nimport { ApolloClient } from \"apollo-client\";\nimport { plugins } from \"@webiny/plugins\";\nimport { AdminConfig, Provider } from \"@webiny/app-admin\";\nimport { ApolloCacheObjectIdPlugin } from \"@webiny/app\";\nimport { CmsProvider } from \"~/admin/contexts/Cms\";\nimport { CmsMenuLoader } from \"~/admin/menus/CmsMenuLoader\";\nimport apiInformation from \"~/admin/plugins/apiInformation\";\nimport { ContentEntriesModule } from \"~/admin/views/contentEntries/ContentEntriesModule\";\nimport allPlugins from \"~/allPlugins\";\nimport { LexicalEditorCmsPlugin } from \"~/admin/components/LexicalCmsEditor/LexicalEditorCmsPlugin\";\nimport { SingletonContentEntryModule } from \"~/admin/views/contentEntries/SingletonContentEntryModule\";\n\ninterface HeadlessCMSProvider {\n children: React.ReactNode;\n}\n\nconst createHeadlessCMSProvider =\n (createApolloClient: CreateApolloClient) =>\n (Component: React.ComponentType<React.PropsWithChildren>) => {\n return function HeadlessCMSProvider({ children }: HeadlessCMSProvider) {\n return (\n <CmsProvider createApolloClient={createApolloClient}>\n <Component>{children}</Component>\n </CmsProvider>\n );\n };\n };\n\ninterface CreateApolloClientParams {\n uri: string;\n}\n\ninterface CreateApolloClient {\n (params: CreateApolloClientParams): ApolloClient<any>;\n}\n\nexport interface HeadlessCMSProps {\n createApolloClient: CreateApolloClient;\n}\n\n/**\n * If there is a problem with some state being reset, it's probably because of this plugin.\n * Check that __typename from the API and the __typename in the state are the same.\n * If not, add it into the attachTypeName array.\n */\nconst attachTypeName = [\"CmsContentEntry\", \"RefField\"];\n\nconst HeadlessCMSExtension = ({ createApolloClient }: HeadlessCMSProps) => {\n plugins.register(apiInformation);\n plugins.register(allPlugins);\n\n plugins.register(\n new ApolloCacheObjectIdPlugin(obj => {\n if (obj.__typename === \"CmsContentModelField\") {\n return null;\n } else if (obj.__typename && attachTypeName.includes(obj.__typename)) {\n return `${obj.__typename}_${obj.id}`;\n }\n\n return undefined;\n })\n );\n\n return (\n <Fragment>\n <ContentEntriesModule />\n <SingletonContentEntryModule />\n <Provider hoc={createHeadlessCMSProvider(createApolloClient)} />\n <AdminConfig>\n <CmsMenuLoader />\n </AdminConfig>\n <LexicalEditorCmsPlugin />\n </Fragment>\n );\n};\n\nexport const HeadlessCMS = memo(HeadlessCMSExtension);\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,IAAI,QAAQ,OAAO;AAE7C,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,WAAW,EAAEC,QAAQ,QAAQ,mBAAmB;AACzD,SAASC,yBAAyB,QAAQ,aAAa;AACvD,SAASC,WAAW;AACpB,SAASC,aAAa;AACtB,OAAOC,cAAc;AACrB,SAASC,oBAAoB;AAC7B,OAAOC,UAAU;AACjB,SAASC,sBAAsB;AAC/B,SAASC,2BAA2B;AAMpC,MAAMC,yBAAyB,GAC1BC,kBAAsC,IACtCC,SAAuD,IAAK;EACzD,OAAO,SAASC,mBAAmBA,CAAC;IAAEC;EAA8B,CAAC,EAAE;IACnE,oBACIlB,KAAA,CAAAmB,aAAA,CAACZ,WAAW;MAACQ,kBAAkB,EAAEA;IAAmB,gBAChDf,KAAA,CAAAmB,aAAA,CAACH,SAAS,QAAEE,QAAoB,CACvB,CAAC;EAEtB,CAAC;AACL,CAAC;AAcL;AACA;AACA;AACA;AACA;AACA,MAAME,cAAc,GAAG,CAAC,iBAAiB,EAAE,UAAU,CAAC;AAEtD,MAAMC,oBAAoB,GAAGA,CAAC;EAAEN;AAAqC,CAAC,KAAK;EACvEZ,OAAO,CAACmB,QAAQ,CAACb,cAAc,CAAC;EAChCN,OAAO,CAACmB,QAAQ,CAACX,UAAU,CAAC;EAE5BR,OAAO,CAACmB,QAAQ,CACZ,IAAIhB,yBAAyB,CAACiB,GAAG,IAAI;IACjC,IAAIA,GAAG,CAACC,UAAU,KAAK,sBAAsB,EAAE;MAC3C,OAAO,IAAI;IACf,CAAC,MAAM,IAAID,GAAG,CAACC,UAAU,IAAIJ,cAAc,CAACK,QAAQ,CAACF,GAAG,CAACC,UAAU,CAAC,EAAE;MAClE,OAAO,GAAGD,GAAG,CAACC,UAAU,IAAID,GAAG,CAACG,EAAE,EAAE;IACxC;IAEA,OAAOC,SAAS;EACpB,CAAC,CACL,CAAC;EAED,oBACI3B,KAAA,CAAAmB,aAAA,CAAClB,QAAQ,qBACLD,KAAA,CAAAmB,aAAA,CAACT,oBAAoB,MAAE,CAAC,eACxBV,KAAA,CAAAmB,aAAA,CAACN,2BAA2B,MAAE,CAAC,eAC/Bb,KAAA,CAAAmB,aAAA,CAACd,QAAQ;IAACuB,GAAG,EAAEd,yBAAyB,CAACC,kBAAkB;EAAE,CAAE,CAAC,eAChEf,KAAA,CAAAmB,aAAA,CAACf,WAAW,qBACRJ,KAAA,CAAAmB,aAAA,CAACX,aAAa,MAAE,CACP,CAAC,eACdR,KAAA,CAAAmB,aAAA,CAACP,sBAAsB,MAAE,CACnB,CAAC;AAEnB,CAAC;AAED,OAAO,MAAMiB,WAAW,gBAAG3B,IAAI,CAACmB,oBAAoB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Fragment","memo","plugins","AdminConfig","Provider","ApolloCacheObjectIdPlugin","CmsProvider","CmsMenuLoader","apiInformation","ContentEntriesModule","allPlugins","LexicalEditorCmsPlugin","SingletonContentEntryModule","createHeadlessCMSProvider","createApolloClient","Component","HeadlessCMSProvider","children","createElement","attachTypeName","HeadlessCMSExtension","register","obj","__typename","includes","id","undefined","hoc","HeadlessCMS"],"sources":["HeadlessCMS.tsx"],"sourcesContent":["import React, { Fragment, memo } from \"react\";\nimport type { ApolloClient } from \"apollo-client\";\nimport { plugins } from \"@webiny/plugins\";\nimport { AdminConfig, Provider } from \"@webiny/app-admin\";\nimport { ApolloCacheObjectIdPlugin } from \"@webiny/app\";\nimport { CmsProvider } from \"~/admin/contexts/Cms\";\nimport { CmsMenuLoader } from \"~/admin/menus/CmsMenuLoader\";\nimport apiInformation from \"~/admin/plugins/apiInformation\";\nimport { ContentEntriesModule } from \"~/admin/views/contentEntries/ContentEntriesModule\";\nimport allPlugins from \"~/allPlugins\";\nimport { LexicalEditorCmsPlugin } from \"~/admin/components/LexicalCmsEditor/LexicalEditorCmsPlugin\";\nimport { SingletonContentEntryModule } from \"~/admin/views/contentEntries/SingletonContentEntryModule\";\n\ninterface HeadlessCMSProvider {\n children: React.ReactNode;\n}\n\nconst createHeadlessCMSProvider =\n (createApolloClient: CreateApolloClient) =>\n (Component: React.ComponentType<React.PropsWithChildren>) => {\n return function HeadlessCMSProvider({ children }: HeadlessCMSProvider) {\n return (\n <CmsProvider createApolloClient={createApolloClient}>\n <Component>{children}</Component>\n </CmsProvider>\n );\n };\n };\n\ninterface CreateApolloClientParams {\n uri: string;\n}\n\ninterface CreateApolloClient {\n (params: CreateApolloClientParams): ApolloClient<any>;\n}\n\nexport interface HeadlessCMSProps {\n createApolloClient: CreateApolloClient;\n}\n\n/**\n * If there is a problem with some state being reset, it's probably because of this plugin.\n * Check that __typename from the API and the __typename in the state are the same.\n * If not, add it into the attachTypeName array.\n */\nconst attachTypeName = [\"CmsContentEntry\", \"RefField\"];\n\nconst HeadlessCMSExtension = ({ createApolloClient }: HeadlessCMSProps) => {\n plugins.register(apiInformation);\n plugins.register(allPlugins);\n\n plugins.register(\n new ApolloCacheObjectIdPlugin(obj => {\n if (obj.__typename === \"CmsContentModelField\") {\n return null;\n } else if (obj.__typename && attachTypeName.includes(obj.__typename)) {\n return `${obj.__typename}_${obj.id}`;\n }\n\n return undefined;\n })\n );\n\n return (\n <Fragment>\n <ContentEntriesModule />\n <SingletonContentEntryModule />\n <Provider hoc={createHeadlessCMSProvider(createApolloClient)} />\n <AdminConfig>\n <CmsMenuLoader />\n </AdminConfig>\n <LexicalEditorCmsPlugin />\n </Fragment>\n );\n};\n\nexport const HeadlessCMS = memo(HeadlessCMSExtension);\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,IAAI,QAAQ,OAAO;AAE7C,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,WAAW,EAAEC,QAAQ,QAAQ,mBAAmB;AACzD,SAASC,yBAAyB,QAAQ,aAAa;AACvD,SAASC,WAAW;AACpB,SAASC,aAAa;AACtB,OAAOC,cAAc;AACrB,SAASC,oBAAoB;AAC7B,OAAOC,UAAU;AACjB,SAASC,sBAAsB;AAC/B,SAASC,2BAA2B;AAMpC,MAAMC,yBAAyB,GAC1BC,kBAAsC,IACtCC,SAAuD,IAAK;EACzD,OAAO,SAASC,mBAAmBA,CAAC;IAAEC;EAA8B,CAAC,EAAE;IACnE,oBACIlB,KAAA,CAAAmB,aAAA,CAACZ,WAAW;MAACQ,kBAAkB,EAAEA;IAAmB,gBAChDf,KAAA,CAAAmB,aAAA,CAACH,SAAS,QAAEE,QAAoB,CACvB,CAAC;EAEtB,CAAC;AACL,CAAC;AAcL;AACA;AACA;AACA;AACA;AACA,MAAME,cAAc,GAAG,CAAC,iBAAiB,EAAE,UAAU,CAAC;AAEtD,MAAMC,oBAAoB,GAAGA,CAAC;EAAEN;AAAqC,CAAC,KAAK;EACvEZ,OAAO,CAACmB,QAAQ,CAACb,cAAc,CAAC;EAChCN,OAAO,CAACmB,QAAQ,CAACX,UAAU,CAAC;EAE5BR,OAAO,CAACmB,QAAQ,CACZ,IAAIhB,yBAAyB,CAACiB,GAAG,IAAI;IACjC,IAAIA,GAAG,CAACC,UAAU,KAAK,sBAAsB,EAAE;MAC3C,OAAO,IAAI;IACf,CAAC,MAAM,IAAID,GAAG,CAACC,UAAU,IAAIJ,cAAc,CAACK,QAAQ,CAACF,GAAG,CAACC,UAAU,CAAC,EAAE;MAClE,OAAO,GAAGD,GAAG,CAACC,UAAU,IAAID,GAAG,CAACG,EAAE,EAAE;IACxC;IAEA,OAAOC,SAAS;EACpB,CAAC,CACL,CAAC;EAED,oBACI3B,KAAA,CAAAmB,aAAA,CAAClB,QAAQ,qBACLD,KAAA,CAAAmB,aAAA,CAACT,oBAAoB,MAAE,CAAC,eACxBV,KAAA,CAAAmB,aAAA,CAACN,2BAA2B,MAAE,CAAC,eAC/Bb,KAAA,CAAAmB,aAAA,CAACd,QAAQ;IAACuB,GAAG,EAAEd,yBAAyB,CAACC,kBAAkB;EAAE,CAAE,CAAC,eAChEf,KAAA,CAAAmB,aAAA,CAACf,WAAW,qBACRJ,KAAA,CAAAmB,aAAA,CAACX,aAAa,MAAE,CACP,CAAC,eACdR,KAAA,CAAAmB,aAAA,CAACP,sBAAsB,MAAE,CACnB,CAAC;AAEnB,CAAC;AAED,OAAO,MAAMiB,WAAW,gBAAG3B,IAAI,CAACmB,oBAAoB,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CmsModel } from "@webiny/app-headless-cms-common/types";
|
|
2
|
-
import { FieldRaw } from "@webiny/app-aco/components/AdvancedSearch/domain";
|
|
1
|
+
import type { CmsModel } from "@webiny/app-headless-cms-common/types";
|
|
2
|
+
import type { FieldRaw } from "@webiny/app-aco/components/AdvancedSearch/domain";
|
|
3
3
|
export declare class FieldsMapper {
|
|
4
4
|
private static excluded;
|
|
5
5
|
private static defaultFields;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sortBy","FieldsMapper","excluded","defaultFields","id","type","label","multipleValues","predefinedValues","enabled","values","value","settings","toRaw","model","modelFields","fields","filter","modelField","includes","map","fieldId","undefined"],"sources":["FieldsMapper.ts"],"sourcesContent":["import sortBy from \"lodash/sortBy\";\nimport { CmsModel } from \"@webiny/app-headless-cms-common/types\";\nimport { FieldRaw } from \"@webiny/app-aco/components/AdvancedSearch/domain\";\n\nexport class FieldsMapper {\n private static excluded: FieldRaw[\"type\"][] = [\"rich-text\", \"file\", \"object\", \"dynamicZone\"];\n private static defaultFields: FieldRaw[] = [\n {\n id: \"status\",\n type: \"text\",\n label: \"Status\",\n multipleValues: false,\n predefinedValues: {\n enabled: true,\n values: [\n {\n label: \"Draft\",\n value: \"draft\"\n },\n {\n label: \"Published\",\n value: \"published\"\n },\n {\n label: \"Unpublished\",\n value: \"unpublished\"\n }\n ]\n }\n },\n {\n id: \"createdOn\",\n type: \"datetime\",\n label: \"Created on\",\n settings: { type: \"dateTimeWithoutTimezone\" }\n },\n {\n id: \"savedOn\",\n type: \"datetime\",\n label: \"Modified on\",\n settings: { type: \"dateTimeWithoutTimezone\" }\n }\n ];\n\n static toRaw(model: CmsModel): FieldRaw[] {\n const modelFields = model.fields\n .filter(modelField => !this.excluded.includes(modelField.type))\n .map(modelField => {\n return {\n id: modelField.fieldId,\n type: modelField.type,\n label: modelField.label,\n multipleValues: modelField.multipleValues || false,\n predefinedValues: modelField?.predefinedValues || undefined,\n settings: modelField.settings\n };\n });\n\n return sortBy([...this.defaultFields, ...modelFields], [\"label\"]);\n }\n}\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,eAAe;AAIlC,OAAO,MAAMC,YAAY,CAAC;EACtB,OAAeC,QAAQ,GAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC;EAC5F,OAAeC,aAAa,GAAe,CACvC;IACIC,EAAE,EAAE,QAAQ;IACZC,IAAI,EAAE,MAAM;IACZC,KAAK,EAAE,QAAQ;IACfC,cAAc,EAAE,KAAK;IACrBC,gBAAgB,EAAE;MACdC,OAAO,EAAE,IAAI;MACbC,MAAM,EAAE,CACJ;QACIJ,KAAK,EAAE,OAAO;QACdK,KAAK,EAAE;MACX,CAAC,EACD;QACIL,KAAK,EAAE,WAAW;QAClBK,KAAK,EAAE;MACX,CAAC,EACD;QACIL,KAAK,EAAE,aAAa;QACpBK,KAAK,EAAE;MACX,CAAC;IAET;EACJ,CAAC,EACD;IACIP,EAAE,EAAE,WAAW;IACfC,IAAI,EAAE,UAAU;IAChBC,KAAK,EAAE,YAAY;IACnBM,QAAQ,EAAE;MAAEP,IAAI,EAAE;IAA0B;EAChD,CAAC,EACD;IACID,EAAE,EAAE,SAAS;IACbC,IAAI,EAAE,UAAU;IAChBC,KAAK,EAAE,aAAa;IACpBM,QAAQ,EAAE;MAAEP,IAAI,EAAE;IAA0B;EAChD,CAAC,CACJ;EAED,OAAOQ,KAAKA,CAACC,KAAe,EAAc;IACtC,MAAMC,WAAW,GAAGD,KAAK,CAACE,MAAM,CAC3BC,MAAM,CAACC,UAAU,IAAI,CAAC,IAAI,CAAChB,QAAQ,CAACiB,QAAQ,CAACD,UAAU,CAACb,IAAI,CAAC,CAAC,CAC9De,GAAG,CAACF,UAAU,IAAI;MACf,OAAO;QACHd,EAAE,EAAEc,UAAU,CAACG,OAAO;QACtBhB,IAAI,EAAEa,UAAU,CAACb,IAAI;QACrBC,KAAK,EAAEY,UAAU,CAACZ,KAAK;QACvBC,cAAc,EAAEW,UAAU,CAACX,cAAc,IAAI,KAAK;QAClDC,gBAAgB,EAAEU,UAAU,EAAEV,gBAAgB,IAAIc,SAAS;QAC3DV,QAAQ,EAAEM,UAAU,CAACN;MACzB,CAAC;IACL,CAAC,CAAC;IAEN,OAAOZ,MAAM,CAAC,CAAC,GAAG,IAAI,CAACG,aAAa,EAAE,GAAGY,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;EACrE;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["sortBy","FieldsMapper","excluded","defaultFields","id","type","label","multipleValues","predefinedValues","enabled","values","value","settings","toRaw","model","modelFields","fields","filter","modelField","includes","map","fieldId","undefined"],"sources":["FieldsMapper.ts"],"sourcesContent":["import sortBy from \"lodash/sortBy\";\nimport type { CmsModel } from \"@webiny/app-headless-cms-common/types\";\nimport type { FieldRaw } from \"@webiny/app-aco/components/AdvancedSearch/domain\";\n\nexport class FieldsMapper {\n private static excluded: FieldRaw[\"type\"][] = [\"rich-text\", \"file\", \"object\", \"dynamicZone\"];\n private static defaultFields: FieldRaw[] = [\n {\n id: \"status\",\n type: \"text\",\n label: \"Status\",\n multipleValues: false,\n predefinedValues: {\n enabled: true,\n values: [\n {\n label: \"Draft\",\n value: \"draft\"\n },\n {\n label: \"Published\",\n value: \"published\"\n },\n {\n label: \"Unpublished\",\n value: \"unpublished\"\n }\n ]\n }\n },\n {\n id: \"createdOn\",\n type: \"datetime\",\n label: \"Created on\",\n settings: { type: \"dateTimeWithoutTimezone\" }\n },\n {\n id: \"savedOn\",\n type: \"datetime\",\n label: \"Modified on\",\n settings: { type: \"dateTimeWithoutTimezone\" }\n }\n ];\n\n static toRaw(model: CmsModel): FieldRaw[] {\n const modelFields = model.fields\n .filter(modelField => !this.excluded.includes(modelField.type))\n .map(modelField => {\n return {\n id: modelField.fieldId,\n type: modelField.type,\n label: modelField.label,\n multipleValues: modelField.multipleValues || false,\n predefinedValues: modelField?.predefinedValues || undefined,\n settings: modelField.settings\n };\n });\n\n return sortBy([...this.defaultFields, ...modelFields], [\"label\"]);\n }\n}\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,eAAe;AAIlC,OAAO,MAAMC,YAAY,CAAC;EACtB,OAAeC,QAAQ,GAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC;EAC5F,OAAeC,aAAa,GAAe,CACvC;IACIC,EAAE,EAAE,QAAQ;IACZC,IAAI,EAAE,MAAM;IACZC,KAAK,EAAE,QAAQ;IACfC,cAAc,EAAE,KAAK;IACrBC,gBAAgB,EAAE;MACdC,OAAO,EAAE,IAAI;MACbC,MAAM,EAAE,CACJ;QACIJ,KAAK,EAAE,OAAO;QACdK,KAAK,EAAE;MACX,CAAC,EACD;QACIL,KAAK,EAAE,WAAW;QAClBK,KAAK,EAAE;MACX,CAAC,EACD;QACIL,KAAK,EAAE,aAAa;QACpBK,KAAK,EAAE;MACX,CAAC;IAET;EACJ,CAAC,EACD;IACIP,EAAE,EAAE,WAAW;IACfC,IAAI,EAAE,UAAU;IAChBC,KAAK,EAAE,YAAY;IACnBM,QAAQ,EAAE;MAAEP,IAAI,EAAE;IAA0B;EAChD,CAAC,EACD;IACID,EAAE,EAAE,SAAS;IACbC,IAAI,EAAE,UAAU;IAChBC,KAAK,EAAE,aAAa;IACpBM,QAAQ,EAAE;MAAEP,IAAI,EAAE;IAA0B;EAChD,CAAC,CACJ;EAED,OAAOQ,KAAKA,CAACC,KAAe,EAAc;IACtC,MAAMC,WAAW,GAAGD,KAAK,CAACE,MAAM,CAC3BC,MAAM,CAACC,UAAU,IAAI,CAAC,IAAI,CAAChB,QAAQ,CAACiB,QAAQ,CAACD,UAAU,CAACb,IAAI,CAAC,CAAC,CAC9De,GAAG,CAACF,UAAU,IAAI;MACf,OAAO;QACHd,EAAE,EAAEc,UAAU,CAACG,OAAO;QACtBhB,IAAI,EAAEa,UAAU,CAACb,IAAI;QACrBC,KAAK,EAAEY,UAAU,CAACZ,KAAK;QACvBC,cAAc,EAAEW,UAAU,CAACX,cAAc,IAAI,KAAK;QAClDC,gBAAgB,EAAEU,UAAU,EAAEV,gBAAgB,IAAIc,SAAS;QAC3DV,QAAQ,EAAEM,UAAU,CAACN;MACzB,CAAC;IACL,CAAC,CAAC;IAEN,OAAOZ,MAAM,CAAC,CAAC,GAAG,IAAI,CAACG,aAAa,EAAE,GAAGY,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;EACrE;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","Select","useBind","plugins","getValidFilterValue","value","undefined","FilterByStatus","bind","name","beforeChange","cb","options","label","filterStatusPlugins","byType","forEach","plugin","push","createElement","Object","assign","size","placeholder"],"sources":["FilterByStatus.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Select } from \"@webiny/admin-ui\";\nimport { useBind } from \"@webiny/form\";\nimport { plugins } from \"@webiny/plugins\";\nimport { CmsEntryFilterStatusPlugin } from \"@webiny/app-headless-cms-common/types\";\n\nconst getValidFilterValue = (value: string): string | undefined => {\n if (value === \"all\" || value === \"\") {\n return undefined;\n }\n return value;\n};\n\nexport const FilterByStatus = () => {\n const bind = useBind({\n name: \"status\",\n beforeChange(value, cb) {\n cb(getValidFilterValue(value));\n }\n });\n\n const options = useMemo(() => {\n const options = [\n { label: \"All\", value: \"all\" },\n { label: \"Draft\", value: \"draft\" },\n { label: \"Published\", value: \"published\" },\n { label: \"Unpublished\", value: \"unpublished\" }\n ];\n\n const filterStatusPlugins =\n plugins.byType<CmsEntryFilterStatusPlugin>(\"cms.entry.filter.status\");\n\n filterStatusPlugins.forEach(plugin => {\n options.push({ label: plugin.label, value: plugin.value });\n });\n\n return options;\n }, []);\n\n return <Select {...bind} size={\"md\"} placeholder={\"Filter by status\"} options={options} />;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,OAAO,QAAQ,cAAc;AACtC,SAASC,OAAO,QAAQ,iBAAiB;AAGzC,MAAMC,mBAAmB,GAAIC,KAAa,IAAyB;EAC/D,IAAIA,KAAK,KAAK,KAAK,IAAIA,KAAK,KAAK,EAAE,EAAE;IACjC,OAAOC,SAAS;EACpB;EACA,OAAOD,KAAK;AAChB,CAAC;AAED,OAAO,MAAME,cAAc,GAAGA,CAAA,KAAM;EAChC,MAAMC,IAAI,GAAGN,OAAO,CAAC;IACjBO,IAAI,EAAE,QAAQ;IACdC,YAAYA,CAACL,KAAK,EAAEM,EAAE,EAAE;MACpBA,EAAE,CAACP,mBAAmB,CAACC,KAAK,CAAC,CAAC;IAClC;EACJ,CAAC,CAAC;EAEF,MAAMO,OAAO,GAAGZ,OAAO,CAAC,MAAM;IAC1B,MAAMY,OAAO,GAAG,CACZ;MAAEC,KAAK,EAAE,KAAK;MAAER,KAAK,EAAE;IAAM,CAAC,EAC9B;MAAEQ,KAAK,EAAE,OAAO;MAAER,KAAK,EAAE;IAAQ,CAAC,EAClC;MAAEQ,KAAK,EAAE,WAAW;MAAER,KAAK,EAAE;IAAY,CAAC,EAC1C;MAAEQ,KAAK,EAAE,aAAa;MAAER,KAAK,EAAE;IAAc,CAAC,CACjD;IAED,MAAMS,mBAAmB,GACrBX,OAAO,CAACY,MAAM,CAA6B,yBAAyB,CAAC;IAEzED,mBAAmB,CAACE,OAAO,CAACC,MAAM,IAAI;MAClCL,OAAO,CAACM,IAAI,CAAC;QAAEL,KAAK,EAAEI,MAAM,CAACJ,KAAK;QAAER,KAAK,EAAEY,MAAM,CAACZ;MAAM,CAAC,CAAC;IAC9D,CAAC,CAAC;IAEF,OAAOO,OAAO;EAClB,CAAC,EAAE,EAAE,CAAC;EAEN,oBAAOb,KAAA,CAAAoB,aAAA,CAAClB,MAAM,EAAAmB,MAAA,CAAAC,MAAA,KAAKb,IAAI;IAAEc,IAAI,EAAE,IAAK;IAACC,WAAW,EAAE,kBAAmB;IAACX,OAAO,EAAEA;EAAQ,EAAE,CAAC;AAC9F,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useMemo","Select","useBind","plugins","getValidFilterValue","value","undefined","FilterByStatus","bind","name","beforeChange","cb","options","label","filterStatusPlugins","byType","forEach","plugin","push","createElement","Object","assign","size","placeholder"],"sources":["FilterByStatus.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Select } from \"@webiny/admin-ui\";\nimport { useBind } from \"@webiny/form\";\nimport { plugins } from \"@webiny/plugins\";\nimport type { CmsEntryFilterStatusPlugin } from \"@webiny/app-headless-cms-common/types\";\n\nconst getValidFilterValue = (value: string): string | undefined => {\n if (value === \"all\" || value === \"\") {\n return undefined;\n }\n return value;\n};\n\nexport const FilterByStatus = () => {\n const bind = useBind({\n name: \"status\",\n beforeChange(value, cb) {\n cb(getValidFilterValue(value));\n }\n });\n\n const options = useMemo(() => {\n const options = [\n { label: \"All\", value: \"all\" },\n { label: \"Draft\", value: \"draft\" },\n { label: \"Published\", value: \"published\" },\n { label: \"Unpublished\", value: \"unpublished\" }\n ];\n\n const filterStatusPlugins =\n plugins.byType<CmsEntryFilterStatusPlugin>(\"cms.entry.filter.status\");\n\n filterStatusPlugins.forEach(plugin => {\n options.push({ label: plugin.label, value: plugin.value });\n });\n\n return options;\n }, []);\n\n return <Select {...bind} size={\"md\"} placeholder={\"Filter by status\"} options={options} />;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,OAAO,QAAQ,cAAc;AACtC,SAASC,OAAO,QAAQ,iBAAiB;AAGzC,MAAMC,mBAAmB,GAAIC,KAAa,IAAyB;EAC/D,IAAIA,KAAK,KAAK,KAAK,IAAIA,KAAK,KAAK,EAAE,EAAE;IACjC,OAAOC,SAAS;EACpB;EACA,OAAOD,KAAK;AAChB,CAAC;AAED,OAAO,MAAME,cAAc,GAAGA,CAAA,KAAM;EAChC,MAAMC,IAAI,GAAGN,OAAO,CAAC;IACjBO,IAAI,EAAE,QAAQ;IACdC,YAAYA,CAACL,KAAK,EAAEM,EAAE,EAAE;MACpBA,EAAE,CAACP,mBAAmB,CAACC,KAAK,CAAC,CAAC;IAClC;EACJ,CAAC,CAAC;EAEF,MAAMO,OAAO,GAAGZ,OAAO,CAAC,MAAM;IAC1B,MAAMY,OAAO,GAAG,CACZ;MAAEC,KAAK,EAAE,KAAK;MAAER,KAAK,EAAE;IAAM,CAAC,EAC9B;MAAEQ,KAAK,EAAE,OAAO;MAAER,KAAK,EAAE;IAAQ,CAAC,EAClC;MAAEQ,KAAK,EAAE,WAAW;MAAER,KAAK,EAAE;IAAY,CAAC,EAC1C;MAAEQ,KAAK,EAAE,aAAa;MAAER,KAAK,EAAE;IAAc,CAAC,CACjD;IAED,MAAMS,mBAAmB,GACrBX,OAAO,CAACY,MAAM,CAA6B,yBAAyB,CAAC;IAEzED,mBAAmB,CAACE,OAAO,CAACC,MAAM,IAAI;MAClCL,OAAO,CAACM,IAAI,CAAC;QAAEL,KAAK,EAAEI,MAAM,CAACJ,KAAK;QAAER,KAAK,EAAEY,MAAM,CAACZ;MAAM,CAAC,CAAC;IAC9D,CAAC,CAAC;IAEF,OAAOO,OAAO;EAClB,CAAC,EAAE,EAAE,CAAC;EAEN,oBAAOb,KAAA,CAAAoB,aAAA,CAAClB,MAAM,EAAAmB,MAAA,CAAAC,MAAA,KAAKb,IAAI;IAAEc,IAAI,EAAE,IAAK;IAACC,WAAW,EAAE,kBAAmB;IAACX,OAAO,EAAEA;EAAQ,EAAE,CAAC;AAC9F,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useState","Filters","BaseFilters","useContentEntryListConfig","useContentEntriesList","AdvancedSearch","GraphQLInputMapper","useFilterRepository","useModel","FieldsMapper","browser","list","model","fields","setFields","repository","modelId","toRaw","applyFilters","data","Object","keys","length","convertedFilters","filtersToWhere","reduce","converter","setFilters","applyAdvancedSearch","toGraphQL","createElement","filters","show","showingFilters","onChange","onApplyFilter"],"sources":["Filters.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { Filters as BaseFilters
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","Filters","BaseFilters","useContentEntryListConfig","useContentEntriesList","AdvancedSearch","GraphQLInputMapper","useFilterRepository","useModel","FieldsMapper","browser","list","model","fields","setFields","repository","modelId","toRaw","applyFilters","data","Object","keys","length","convertedFilters","filtersToWhere","reduce","converter","setFilters","applyAdvancedSearch","toGraphQL","createElement","filters","show","showingFilters","onChange","onApplyFilter"],"sources":["Filters.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport type { FiltersOnSubmit } from \"@webiny/app-admin\";\nimport { Filters as BaseFilters } from \"@webiny/app-admin\";\nimport { useContentEntryListConfig } from \"~/admin/config/contentEntries\";\nimport { useContentEntriesList } from \"~/admin/views/contentEntries/hooks\";\nimport { AdvancedSearch, GraphQLInputMapper, useFilterRepository } from \"@webiny/app-aco\";\nimport { useModel } from \"~/admin/hooks\";\nimport { FieldsMapper } from \"./FieldsMapper\";\nimport type { FieldRaw, FilterDTO } from \"@webiny/app-aco/components/AdvancedSearch/domain\";\n\nexport const Filters = () => {\n const { browser } = useContentEntryListConfig();\n const list = useContentEntriesList();\n const { model } = useModel();\n const [fields, setFields] = useState<FieldRaw[] | undefined>();\n const repository = useFilterRepository(`cms:${model.modelId}`);\n\n useEffect(() => {\n setFields(FieldsMapper.toRaw(model));\n }, [model]);\n\n const applyFilters: FiltersOnSubmit = data => {\n if (!Object.keys(data).length) {\n return;\n }\n\n const convertedFilters = browser.filtersToWhere.reduce(\n (data, converter) => converter(data),\n data\n );\n\n list.setFilters(convertedFilters);\n };\n\n const applyAdvancedSearch = (data: FilterDTO | null) => {\n if (!data) {\n return list.setFilters({});\n }\n\n if (!Object.keys(data).length) {\n return;\n }\n\n list.setFilters(GraphQLInputMapper.toGraphQL(data));\n };\n\n if (!fields) {\n return null;\n }\n\n return (\n <BaseFilters filters={browser.filters} show={list.showingFilters} onChange={applyFilters}>\n <AdvancedSearch\n fields={fields}\n repository={repository}\n onApplyFilter={applyAdvancedSearch}\n />\n </BaseFilters>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAElD,SAASC,OAAO,IAAIC,WAAW,QAAQ,mBAAmB;AAC1D,SAASC,yBAAyB;AAClC,SAASC,qBAAqB;AAC9B,SAASC,cAAc,EAAEC,kBAAkB,EAAEC,mBAAmB,QAAQ,iBAAiB;AACzF,SAASC,QAAQ;AACjB,SAASC,YAAY;AAGrB,OAAO,MAAM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AErB,OAAO,CAACqB,OAAQ;IAACC,IAAI,EAAErB,IAAI,CAACsB,cAAe;IAACC,QAAQ,EAAEhB;EAAa,gBACrFpB,KAAA,CAAAgC,aAAA,CAACzB,cAAc;IACXQ,MAAM,EAAEA,MAAO;IACfE,UAAU,EAAEA,UAAW;IACvBoB,aAAa,EAAEP;EAAoB,CACtC,CACQ,CAAC;AAEtB,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntryReference } from "../domain";
|
|
1
|
+
import type { EntryReference } from "../domain";
|
|
2
2
|
export interface EntriesGatewayInterface {
|
|
3
3
|
list: (modelIds: string[], query: string) => Promise<EntryReference[]>;
|
|
4
4
|
get: (modelId: string, id: string) => Promise<EntryReference>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["EntriesGatewayInterface.ts"],"sourcesContent":["import { EntryReference } from \"../domain\";\n\nexport interface EntriesGatewayInterface {\n list: (modelIds: string[], query: string) => Promise<EntryReference[]>;\n get: (modelId: string, id: string) => Promise<EntryReference>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["EntriesGatewayInterface.ts"],"sourcesContent":["import type { EntryReference } from \"../domain\";\n\nexport interface EntriesGatewayInterface {\n list: (modelIds: string[], query: string) => Promise<EntryReference[]>;\n get: (modelId: string, id: string) => Promise<EntryReference>;\n}\n"],"mappings":"","ignoreList":[]}
|
package/admin/components/ContentEntries/Filters/RefFieldRenderer/adapters/EntriesGraphQLGateway.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApolloClient } from "apollo-client";
|
|
2
|
-
import { EntriesGatewayInterface } from "./EntriesGatewayInterface";
|
|
1
|
+
import type { ApolloClient } from "apollo-client";
|
|
2
|
+
import type { EntriesGatewayInterface } from "./EntriesGatewayInterface";
|
|
3
3
|
export declare class EntriesGraphQLGateway implements EntriesGatewayInterface {
|
|
4
4
|
private client;
|
|
5
5
|
constructor(client: ApolloClient<any>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GET_CONTENT_ENTRY","SEARCH_CONTENT_ENTRIES","EntriesGraphQLGateway","constructor","client","list","modelIds","query","data","response","variables","limit","fetchPolicy","Error","error","searchContentEntries","message","get","modelId","id","entry","getLatestContentEntry"],"sources":["EntriesGraphQLGateway.ts"],"sourcesContent":["import { ApolloClient } from \"apollo-client\";\nimport { EntriesGatewayInterface } from \"./EntriesGatewayInterface\";\nimport { GET_CONTENT_ENTRY, SEARCH_CONTENT_ENTRIES } from \"./entries.gql\";\nimport {\n GetEntryQueryVariables,\n GetEntryResponse,\n ListEntriesQueryVariables,\n ListEntriesResponse\n} from \"./entries.types\";\n\nexport class EntriesGraphQLGateway implements EntriesGatewayInterface {\n private client: ApolloClient<any>;\n\n constructor(client: ApolloClient<any>) {\n this.client = client;\n }\n\n async list(modelIds: string[], query?: string) {\n const { data: response } = await this.client.query<\n ListEntriesResponse,\n ListEntriesQueryVariables\n >({\n query: SEARCH_CONTENT_ENTRIES,\n variables: {\n modelIds,\n query,\n limit: 50\n },\n fetchPolicy: \"network-only\"\n });\n\n if (!response) {\n throw new Error(\"Network error while listing entries.\");\n }\n\n const { data, error } = response.searchContentEntries;\n\n if (!data) {\n throw new Error(error?.message || \"Could not fetch entries.\");\n }\n\n return data;\n }\n\n async get(modelId: string, id: string) {\n const { data: response } = await this.client.query<\n GetEntryResponse,\n GetEntryQueryVariables\n >({\n query: GET_CONTENT_ENTRY,\n variables: {\n entry: {\n modelId,\n id\n }\n },\n fetchPolicy: \"network-only\"\n });\n\n if (!response) {\n throw new Error(\"Network error while getting entries.\");\n }\n\n const { data, error } = response.getLatestContentEntry;\n\n if (!data) {\n throw new Error(error?.message || \"Could not fetch entry.\");\n }\n\n return data;\n }\n}\n"],"mappings":"AAEA,SAASA,iBAAiB,EAAEC,sBAAsB;AAQlD,OAAO,MAAMC,qBAAqB,CAAoC;EAGlEC,WAAWA,CAACC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"version":3,"names":["GET_CONTENT_ENTRY","SEARCH_CONTENT_ENTRIES","EntriesGraphQLGateway","constructor","client","list","modelIds","query","data","response","variables","limit","fetchPolicy","Error","error","searchContentEntries","message","get","modelId","id","entry","getLatestContentEntry"],"sources":["EntriesGraphQLGateway.ts"],"sourcesContent":["import type { ApolloClient } from \"apollo-client\";\nimport type { EntriesGatewayInterface } from \"./EntriesGatewayInterface\";\nimport { GET_CONTENT_ENTRY, SEARCH_CONTENT_ENTRIES } from \"./entries.gql\";\nimport type {\n GetEntryQueryVariables,\n GetEntryResponse,\n ListEntriesQueryVariables,\n ListEntriesResponse\n} from \"./entries.types\";\n\nexport class EntriesGraphQLGateway implements EntriesGatewayInterface {\n private client: ApolloClient<any>;\n\n constructor(client: ApolloClient<any>) {\n this.client = client;\n }\n\n async list(modelIds: string[], query?: string) {\n const { data: response } = await this.client.query<\n ListEntriesResponse,\n ListEntriesQueryVariables\n >({\n query: SEARCH_CONTENT_ENTRIES,\n variables: {\n modelIds,\n query,\n limit: 50\n },\n fetchPolicy: \"network-only\"\n });\n\n if (!response) {\n throw new Error(\"Network error while listing entries.\");\n }\n\n const { data, error } = response.searchContentEntries;\n\n if (!data) {\n throw new Error(error?.message || \"Could not fetch entries.\");\n }\n\n return data;\n }\n\n async get(modelId: string, id: string) {\n const { data: response } = await this.client.query<\n GetEntryResponse,\n GetEntryQueryVariables\n >({\n query: GET_CONTENT_ENTRY,\n variables: {\n entry: {\n modelId,\n id\n }\n },\n fetchPolicy: \"network-only\"\n });\n\n if (!response) {\n throw new Error(\"Network error while getting entries.\");\n }\n\n const { data, error } = response.getLatestContentEntry;\n\n if (!data) {\n throw new Error(error?.message || \"Could not fetch entry.\");\n }\n\n return data;\n }\n}\n"],"mappings":"AAEA,SAASA,iBAAiB,EAAEC,sBAAsB;AAQlD,OAAO,MAAMC,qBAAqB,CAAoC;EAGlEC,WAAWA,CAACC,MAAyB,EAAE;IACnC,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB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5 +1,5 @@
|
|
|
1
|
-
import { CmsErrorResponse } from "../../../../../../types";
|
|
2
|
-
import { EntryReference } from "../domain";
|
|
1
|
+
import type { CmsErrorResponse } from "../../../../../../types";
|
|
2
|
+
import type { EntryReference } from "../domain";
|
|
3
3
|
export interface ListEntriesQueryVariables {
|
|
4
4
|
modelIds: string[];
|
|
5
5
|
query?: string;
|
package/admin/components/ContentEntries/Filters/RefFieldRenderer/adapters/entries.types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["entries.types.ts"],"sourcesContent":["import { CmsErrorResponse } from \"~/types\";\nimport { EntryReference } from \"../domain\";\n\nexport interface ListEntriesQueryVariables {\n modelIds: string[];\n query?: string;\n limit?: number;\n}\n\nexport interface ListEntriesResponse {\n searchContentEntries: {\n data: EntryReference[] | null;\n error: CmsErrorResponse | null;\n };\n}\n\nexport interface GetEntryQueryVariables {\n entry: {\n modelId: string;\n id: string;\n };\n}\n\nexport interface GetEntryResponse {\n getLatestContentEntry: {\n data: EntryReference | null;\n error: CmsErrorResponse | null;\n };\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["entries.types.ts"],"sourcesContent":["import type { CmsErrorResponse } from \"~/types\";\nimport type { EntryReference } from \"../domain\";\n\nexport interface ListEntriesQueryVariables {\n modelIds: string[];\n query?: string;\n limit?: number;\n}\n\nexport interface ListEntriesResponse {\n searchContentEntries: {\n data: EntryReference[] | null;\n error: CmsErrorResponse | null;\n };\n}\n\nexport interface GetEntryQueryVariables {\n entry: {\n modelId: string;\n id: string;\n };\n}\n\nexport interface GetEntryResponse {\n getLatestContentEntry: {\n data: EntryReference | null;\n error: CmsErrorResponse | null;\n };\n}\n"],"mappings":"","ignoreList":[]}
|
package/admin/components/ContentEntries/Filters/RefFieldRenderer/components/AutoComplete.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Bind","AutoComplete","BaseAutocomplete","props","createElement","name","onChange","validation","label","value","vm","selected","_","selection","JSON","stringify","entryId","modelId","onInput","options","loading","valueProp"],"sources":["AutoComplete.tsx"],"sourcesContent":["import React from \"react\";\nimport { Bind } from \"@webiny/form\";\nimport { AutoComplete as BaseAutocomplete } from \"@webiny/ui/AutoComplete\";\nimport { RefPresenterViewModel } from \"./RefPresenter\";\n\nexport interface AutoCompleteProps {\n vm: RefPresenterViewModel;\n name: string;\n onInput(value: string): void;\n}\n\nexport const AutoComplete = (props: AutoCompleteProps) => {\n return (\n <Bind name={props.name}>\n {({ onChange, validation }) => (\n <BaseAutocomplete\n label={\"Value\"}\n value={props.vm.selected}\n validation={validation}\n onChange={(_, selection) => {\n if (!selection) {\n return;\n }\n\n /**\n * We currently store the value of the FieldDTO as a string.\n * For REF fields, we need to save both modelId and entryId to load this back when showing pre-populated options.\n * To achieve this, we'll store them in an object and convert it into a JSON string.\n */\n onChange(\n JSON.stringify({\n entryId: selection.entryId,\n modelId: selection.modelId\n })\n );\n }}\n onInput={props.onInput}\n options={props.vm.options}\n loading={props.vm.loading}\n valueProp={\"entryId\"}\n />\n )}\n </Bind>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,YAAY,IAAIC,gBAAgB,QAAQ,yBAAyB;AAS1E,OAAO,MAAMD,YAAY,GAAIE,KAAwB,IAAK;EACtD,oBACIJ,KAAA,CAAAK,aAAA,CAACJ,IAAI;IAACK,IAAI,EAAEF,KAAK,CAACE;EAAK,GAClB,CAAC;IAAEC,QAAQ;IAAEC;EAAW,CAAC,kBACtBR,KAAA,CAAAK,aAAA,CAACF,gBAAgB;IACbM,KAAK,EAAE,OAAQ;IACfC,KAAK,EAAEN,KAAK,CAACO,EAAE,CAACC,QAAS;IACzBJ,UAAU,EAAEA,UAAW;IACvBD,QAAQ,EAAEA,CAACM,CAAC,EAAEC,SAAS,KAAK;MACxB,IAAI,CAACA,SAAS,EAAE;QACZ;MACJ;;MAEA;AACxB;AACA;AACA;AACA;MACwBP,QAAQ,CACJQ,IAAI,CAACC,SAAS,CAAC;QACXC,OAAO,EAAEH,SAAS,CAACG,OAAO;QAC1BC,OAAO,EAAEJ,SAAS,CAACI;MACvB,CAAC,CACL,CAAC;IACL,CAAE;IACFC,OAAO,EAAEf,KAAK,CAACe,OAAQ;IACvBC,OAAO,EAAEhB,KAAK,CAACO,EAAE,CAACS,OAAQ;IAC1BC,OAAO,EAAEjB,KAAK,CAACO,EAAE,CAACU,OAAQ;IAC1BC,SAAS,EAAE;EAAU,CACxB,CAEH,CAAC;AAEf,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Bind","AutoComplete","BaseAutocomplete","props","createElement","name","onChange","validation","label","value","vm","selected","_","selection","JSON","stringify","entryId","modelId","onInput","options","loading","valueProp"],"sources":["AutoComplete.tsx"],"sourcesContent":["import React from \"react\";\nimport { Bind } from \"@webiny/form\";\nimport { AutoComplete as BaseAutocomplete } from \"@webiny/ui/AutoComplete\";\nimport type { RefPresenterViewModel } from \"./RefPresenter\";\n\nexport interface AutoCompleteProps {\n vm: RefPresenterViewModel;\n name: string;\n onInput(value: string): void;\n}\n\nexport const AutoComplete = (props: AutoCompleteProps) => {\n return (\n <Bind name={props.name}>\n {({ onChange, validation }) => (\n <BaseAutocomplete\n label={\"Value\"}\n value={props.vm.selected}\n validation={validation}\n onChange={(_, selection) => {\n if (!selection) {\n return;\n }\n\n /**\n * We currently store the value of the FieldDTO as a string.\n * For REF fields, we need to save both modelId and entryId to load this back when showing pre-populated options.\n * To achieve this, we'll store them in an object and convert it into a JSON string.\n */\n onChange(\n JSON.stringify({\n entryId: selection.entryId,\n modelId: selection.modelId\n })\n );\n }}\n onInput={props.onInput}\n options={props.vm.options}\n loading={props.vm.loading}\n valueProp={\"entryId\"}\n />\n )}\n </Bind>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,YAAY,IAAIC,gBAAgB,QAAQ,yBAAyB;AAS1E,OAAO,MAAMD,YAAY,GAAIE,KAAwB,IAAK;EACtD,oBACIJ,KAAA,CAAAK,aAAA,CAACJ,IAAI;IAACK,IAAI,EAAEF,KAAK,CAACE;EAAK,GAClB,CAAC;IAAEC,QAAQ;IAAEC;EAAW,CAAC,kBACtBR,KAAA,CAAAK,aAAA,CAACF,gBAAgB;IACbM,KAAK,EAAE,OAAQ;IACfC,KAAK,EAAEN,KAAK,CAACO,EAAE,CAACC,QAAS;IACzBJ,UAAU,EAAEA,UAAW;IACvBD,QAAQ,EAAEA,CAACM,CAAC,EAAEC,SAAS,KAAK;MACxB,IAAI,CAACA,SAAS,EAAE;QACZ;MACJ;;MAEA;AACxB;AACA;AACA;AACA;MACwBP,QAAQ,CACJQ,IAAI,CAACC,SAAS,CAAC;QACXC,OAAO,EAAEH,SAAS,CAACG,OAAO;QAC1BC,OAAO,EAAEJ,SAAS,CAACI;MACvB,CAAC,CACL,CAAC;IACL,CAAE;IACFC,OAAO,EAAEf,KAAK,CAACe,OAAQ;IACvBC,OAAO,EAAEhB,KAAK,CAACO,EAAE,CAACS,OAAQ;IAC1BC,OAAO,EAAEjB,KAAK,CAACO,EAAE,CAACU,OAAQ;IAC1BC,SAAS,EAAE;EAAU,CACxB,CAEH,CAAC;AAEf,CAAC","ignoreList":[]}
|
package/admin/components/ContentEntries/Filters/RefFieldRenderer/components/RefPresenter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["makeAutoObservable","runInAction","RefPresenter","currentEntry","constructor","repository","load","value","entryId","modelId","JSON","parse","entry","getEntryById","error","console","search","query","listEntries","vm","selected","id","name","title","undefined","loading","getLoading","isLoading","options","getEntries","map"],"sources":["RefPresenter.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport { EntryDTO, EntryRepository } from \"../domain\";\n\ninterface EntryOption {\n id: string;\n name: string;\n}\n\nexport interface RefPresenterViewModel {\n selected?: EntryOption;\n options: EntryOption[];\n loading: boolean;\n}\n\ninterface IRefPresenter {\n load(id?: string): Promise<void>;\n search(query: string): Promise<void>;\n get vm(): RefPresenterViewModel;\n}\n\nexport class RefPresenter implements IRefPresenter {\n private repository: EntryRepository;\n private currentEntry: EntryDTO | null = null;\n\n constructor(repository: EntryRepository) {\n this.repository = repository;\n makeAutoObservable(this);\n }\n\n async load(value?: string) {\n try {\n if (!value) {\n return;\n }\n\n /**\n * Currently, the FieldDTO `value` is stored as a string. For REF fields, we save `modelId` and `entryId` in an object and convert it into a JSON string.\n * Here, we parse the string to extract parameters, which we subsequently use to retrieve the entry from the repository.\n */\n const { entryId, modelId } = JSON.parse(value);\n\n const entry = await this.repository.getEntryById(modelId, entryId);\n\n if (!entry) {\n return;\n }\n\n runInAction(() => {\n this.currentEntry = entry;\n });\n } catch (error) {\n console.error(\"Error while loading initial value\", error);\n return;\n }\n }\n\n async search(query: string) {\n await this.repository.listEntries(query);\n }\n\n get vm() {\n return {\n selected: this.currentEntry\n ? {\n id: this.currentEntry.id,\n name: this.currentEntry.title,\n entryId: this.currentEntry.entryId,\n modelId: this.currentEntry.modelId\n }\n : undefined,\n loading: this.repository.getLoading().isLoading,\n options: this.repository.getEntries().map(entry => ({\n id: entry.id,\n name: entry.title,\n entryId: entry.entryId,\n modelId: entry.modelId\n }))\n };\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,WAAW,QAAQ,MAAM;AAoBtD,OAAO,MAAMC,YAAY,CAA0B;EAEvCC,YAAY,GAAoB,IAAI;EAE5CC,WAAWA,CAACC,UAA2B,EAAE;IACrC,IAAI,CAACA,UAAU,GAAGA,UAAU;IAC5BL,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEA,MAAMM,IAAIA,CAACC,KAAc,EAAE;IACvB,IAAI;MACA,IAAI,CAACA,KAAK,EAAE;QACR;MACJ;;MAEA;AACZ;AACA;AACA;MACY,MAAM;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ction","RefPresenter","currentEntry","constructor","repository","load","value","entryId","modelId","JSON","parse","entry","getEntryById","error","console","search","query","listEntries","vm","selected","id","name","title","undefined","loading","getLoading","isLoading","options","getEntries","map"],"sources":["RefPresenter.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport type { EntryDTO, EntryRepository } from \"../domain\";\n\ninterface EntryOption {\n id: string;\n name: string;\n}\n\nexport interface RefPresenterViewModel {\n selected?: EntryOption;\n options: EntryOption[];\n loading: boolean;\n}\n\ninterface IRefPresenter {\n load(id?: string): Promise<void>;\n search(query: string): Promise<void>;\n get vm(): RefPresenterViewModel;\n}\n\nexport class RefPresenter implements IRefPresenter {\n private repository: EntryRepository;\n private currentEntry: EntryDTO | null = null;\n\n constructor(repository: EntryRepository) {\n this.repository = repository;\n makeAutoObservable(this);\n }\n\n async load(value?: string) {\n try {\n if (!value) {\n return;\n }\n\n /**\n * Currently, the FieldDTO `value` is stored as a string. For REF fields, we save `modelId` and `entryId` in an object and convert it into a JSON string.\n * Here, we parse the string to extract parameters, which we subsequently use to retrieve the entry from the repository.\n */\n const { entryId, modelId } = JSON.parse(value);\n\n const entry = await this.repository.getEntryById(modelId, entryId);\n\n if (!entry) {\n return;\n }\n\n runInAction(() => {\n this.currentEntry = entry;\n });\n } catch (error) {\n console.error(\"Error while loading initial value\", error);\n return;\n }\n }\n\n async search(query: string) {\n await this.repository.listEntries(query);\n }\n\n get vm() {\n return {\n selected: this.currentEntry\n ? {\n id: this.currentEntry.id,\n name: this.currentEntry.title,\n entryId: this.currentEntry.entryId,\n modelId: this.currentEntry.modelId\n }\n : undefined,\n loading: this.repository.getLoading().isLoading,\n options: this.repository.getEntries().map(entry => ({\n id: entry.id,\n name: entry.title,\n entryId: entry.entryId,\n modelId: entry.modelId\n }))\n };\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,WAAW,QAAQ,MAAM;AAoBtD,OAAO,MAAMC,YAAY,CAA0B;EAEvCC,YAAY,GAAo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AK,KAAK;QAChDS,EAAE,EAAET,KAAK,CAACS,EAAE;QACZC,IAAI,EAAEV,KAAK,CAACW,KAAK;QACjBf,OAAO,EAAEI,KAAK,CAACJ,OAAO;QACtBC,OAAO,EAAEG,KAAK,CAACH;MACnB,CAAC,CAAC;IACN,CAAC;EACL;AACJ","ignoreList":[]}
|
package/admin/components/ContentEntries/Filters/RefFieldRenderer/components/RefPresenter.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RefPresenter","EntryRepository","mockGateway","list","jest","fn","get","createMockGateway","describe","modelId","entry1","id","entryId","title","model","entry2","entry3","gateway","mockImplementation","Promise","resolve","presenter","beforeEach","clearAllMocks","repository","it","value","JSON","stringify","loadPromise","load","expect","vm","toEqual","selected","undefined","loading","options","toHaveBeenCalledTimes","toHaveBeenCalledWith","name","query","searchPromise","search"],"sources":["RefPresenter.test.ts"],"sourcesContent":["import { RefPresenter } from \"./RefPresenter\";\nimport { EntriesGatewayInterface } from \"../adapters\";\nimport { EntryReference
|
|
1
|
+
{"version":3,"names":["RefPresenter","EntryRepository","mockGateway","list","jest","fn","get","createMockGateway","describe","modelId","entry1","id","entryId","title","model","entry2","entry3","gateway","mockImplementation","Promise","resolve","presenter","beforeEach","clearAllMocks","repository","it","value","JSON","stringify","loadPromise","load","expect","vm","toEqual","selected","undefined","loading","options","toHaveBeenCalledTimes","toHaveBeenCalledWith","name","query","searchPromise","search"],"sources":["RefPresenter.test.ts"],"sourcesContent":["import { RefPresenter } from \"./RefPresenter\";\nimport type { EntriesGatewayInterface } from \"../adapters\";\nimport type { EntryReference } from \"../domain\";\nimport { EntryRepository } from \"../domain\";\n\nconst mockGateway: EntriesGatewayInterface = {\n list: jest.fn(),\n get: jest.fn()\n};\n\nconst createMockGateway = ({\n list,\n get\n}: Partial<EntriesGatewayInterface>): EntriesGatewayInterface => ({\n ...mockGateway,\n ...(list && { list }),\n ...(get && { get })\n});\n\ndescribe(\"RefPresenter\", () => {\n const modelId = \"modelId-demo\";\n\n const entry1: EntryReference = {\n id: \"id-1\",\n entryId: \"entryId-1\",\n title: \"Entry 1\",\n model: {\n modelId\n }\n };\n\n const entry2: EntryReference = {\n id: \"id-2\",\n entryId: \"entryId-2\",\n title: \"Entry 2\",\n model: {\n modelId\n }\n };\n\n const entry3: EntryReference = {\n id: \"id-3\",\n entryId: \"entryId-3\",\n title: \"Entry 3\",\n model: {\n modelId\n }\n };\n\n const gateway = createMockGateway({\n list: jest.fn().mockImplementation(() => {\n return Promise.resolve([entry1, entry2, entry3]);\n }),\n get: jest.fn().mockImplementation(() => {\n return Promise.resolve(entry1);\n })\n });\n\n let presenter: RefPresenter;\n\n beforeEach(() => {\n jest.clearAllMocks();\n const repository = new EntryRepository(gateway, [modelId]);\n presenter = new RefPresenter(repository);\n });\n\n it(\"should load an existing entry by passing a tuple composed by `entryId` and `modelId`\", async () => {\n const entryId = \"entryId-1\";\n const value = JSON.stringify({ entryId, modelId });\n const loadPromise = presenter.load(value);\n\n // Let's check the transition to loading state\n expect(presenter.vm).toEqual({\n selected: undefined,\n loading: true,\n options: []\n });\n\n await loadPromise;\n\n // should fetch the entry from the gateway\n expect(gateway.get).toHaveBeenCalledTimes(1);\n expect(gateway.get).toHaveBeenCalledWith(modelId, entryId);\n\n // should update the `vm` and set the `currentEntry`\n expect(presenter.vm).toEqual({\n selected: {\n id: entry1.id,\n entryId: entry1.entryId,\n name: entry1.title,\n modelId\n },\n loading: false,\n options: [\n {\n id: entry1.id,\n entryId: entry1.entryId,\n name: entry1.title,\n modelId\n }\n ]\n });\n });\n\n it(\"should NOT load an existing entry if `entryId` is undefined\", async () => {\n await presenter.load();\n\n // should NOT fetch the entry from the gateway\n expect(gateway.get).toHaveBeenCalledTimes(0);\n\n // should not update the `vm`\n expect(presenter.vm).toEqual({\n selected: undefined,\n loading: false,\n options: []\n });\n });\n\n it(\"should search entries by listing from the gateway\", async () => {\n const query = \"any query\";\n\n await presenter.load();\n\n // let's check the current `vm`\n expect(presenter.vm).toEqual({\n selected: undefined,\n loading: false,\n options: []\n });\n\n const searchPromise = presenter.search(query);\n\n // Let's check the transition to loading state\n expect(presenter.vm).toEqual({\n selected: undefined,\n loading: true,\n options: []\n });\n\n await searchPromise;\n\n // should fetch the entries from the gateway\n expect(gateway.list).toHaveBeenCalledTimes(1);\n expect(gateway.list).toHaveBeenCalledWith([modelId], query);\n\n // let's check the current `vm`\n // be aware: data comes from the mocked gateway\n expect(presenter.vm).toEqual({\n selected: undefined,\n loading: false,\n options: [\n {\n id: entry1.id,\n entryId: entry1.entryId,\n name: entry1.title,\n modelId\n },\n {\n id: entry2.id,\n entryId: entry2.entryId,\n name: entry2.title,\n modelId\n },\n {\n id: entry3.id,\n entryId: entry3.entryId,\n name: entry3.title,\n modelId\n }\n ]\n });\n });\n});\n"],"mappings":"AAAA,SAASA,YAAY;AAGrB,SAASC,eAAe;AAExB,MAAMC,WAAoC,GAAG;EACzCC,IAAI,EAAEC,IAAI,CAACC,EAAE,CAAC,CAAC;EACfC,GAAG,EAAEF,IAAI,CAACC,EAAE,CAAC;AACjB,CAAC;AAED,MAAME,iBAAiB,GAAGA,CAAC;EACvBJ,IAAI;EACJG;AAC8B,CAAC,MAA+B;EAC9D,GAAGJ,WAAW;EACd,IAAIC,IAAI,IAAI;IAAEA;EAAK,CAAC,CAAC;EACrB,IAAIG,GAAG,IAAI;IAAEA;EAAI,CAAC;AACtB,CAAC,CAAC;AAEFE,QAAQ,CAAC,cAAc,EAAE,MAAM;EAC3B,MAAMC,OAAO,GAAG,cAAc;EAE9B,MAAMC,MAAsB,GAAG;IAC3BC,EAAE,EAAE,MAAM;IACVC,OAAO,EAAE,WAAW;IACpBC,KAAK,EAAE,SAAS;IAChBC,KAAK,EAAE;MACHL;IACJ;EACJ,CAAC;EAED,MAAMM,MAAsB,GAAG;IAC3BJ,EAAE,EAAE,MAAM;IACVC,OAAO,EAAE,WAAW;IACpBC,KAAK,EAAE,SAAS;IAChBC,KAAK,EAAE;MAC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S,CAACsB,MAAM,CAACF,KAAK,CAAC;;IAE7C;IACAV,MAAM,CAACV,SAAS,CAACW,EAAE,CAAC,CAACC,OAAO,CAAC;MACzBC,QAAQ,EAAEC,SAAS;MACnBC,OAAO,EAAE,IAAI;MACbC,OAAO,EAAE;IACb,CAAC,CAAC;IAEF,MAAMK,aAAa;;IAEnB;IACAX,MAAM,CAACd,OAAO,CAACd,IAAI,CAAC,CAACmC,qBAAqB,CAAC,CAAC,CAAC;IAC7CP,MAAM,CAACd,OAAO,CAACd,IAAI,CAAC,CAACoC,oBAAoB,CAAC,CAAC9B,OAAO,CAAC,EAAEgC,KAAK,CAAC;;IAE3D;IACA;IACAV,MAAM,CAACV,SAAS,CAACW,EAAE,CAAC,CAACC,OAAO,CAAC;MACzBC,QAAQ,EAAEC,SAAS;MACnBC,OAAO,EAAE,KAAK;MACdC,OAAO,EAAE,CACL;QACI1B,EAAE,EAAED,MAAM,CAACC,EAAE;QACbC,OAAO,EAAEF,MAAM,CAACE,OAAO;QACvB4B,IAAI,EAAE9B,MAAM,CAACG,KAAK;QAClBJ;MACJ,CAAC,EACD;QACIE,EAAE,EAAEI,MAAM,CAACJ,EAAE;QACbC,OAAO,EAAEG,MAAM,CAACH,OAAO;QACvB4B,IAAI,EAAEzB,MAAM,CAACF,KAAK;QAClBJ;MACJ,CAAC,EACD;QACIE,EAAE,EAAEK,MAAM,CAACL,EAAE;QACbC,OAAO,EAAEI,MAAM,CAACJ,OAAO;QACvB4B,IAAI,EAAExB,MAAM,CAACH,KAAK;QAClBJ;MACJ,CAAC;IAET,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EntryMapper","toDTO","entry","id","entryId","title","modelId","fromStorage","model"],"sources":["EntryMapper.ts"],"sourcesContent":["import { Entry, EntryDTO, EntryReference } from \"./Entry\";\n\nexport class EntryMapper {\n static toDTO(entry: Entry | EntryDTO): EntryDTO {\n return {\n id: entry.id,\n entryId: entry.entryId,\n title: entry.title,\n modelId: entry.modelId\n };\n }\n\n static fromStorage(entry: EntryReference): EntryDTO {\n return {\n id: entry.id,\n entryId: entry.entryId,\n title: entry.title,\n modelId: entry.model.modelId\n };\n }\n}\n"],"mappings":"AAEA,OAAO,MAAMA,WAAW,CAAC;EACrB,OAAOC,KAAKA,CAACC,KAAuB,EAAY;IAC5C,OAAO;MACHC,EAAE,EAAED,KAAK,CAACC,EAAE;MACZC,OAAO,EAAEF,KAAK,CAACE,OAAO;MACtBC,KAAK,EAAEH,KAAK,CAACG,KAAK;MAClBC,OAAO,EAAEJ,KAAK,CAACI;IACnB,CAAC;EACL;EAEA,OAAOC,WAAWA,CAACL,KAAqB,EAAY;IAChD,OAAO;MACHC,EAAE,EAAED,KAAK,CAACC,EAAE;MACZC,OAAO,EAAEF,KAAK,CAACE,OAAO;MACtBC,KAAK,EAAEH,KAAK,CAACG,KAAK;MAClBC,OAAO,EAAEJ,KAAK,CAACM,KAAK,CAACF;IACzB,CAAC;EACL;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["EntryMapper","toDTO","entry","id","entryId","title","modelId","fromStorage","model"],"sources":["EntryMapper.ts"],"sourcesContent":["import type { Entry, EntryDTO, EntryReference } from \"./Entry\";\n\nexport class EntryMapper {\n static toDTO(entry: Entry | EntryDTO): EntryDTO {\n return {\n id: entry.id,\n entryId: entry.entryId,\n title: entry.title,\n modelId: entry.modelId\n };\n }\n\n static fromStorage(entry: EntryReference): EntryDTO {\n return {\n id: entry.id,\n entryId: entry.entryId,\n title: entry.title,\n modelId: entry.model.modelId\n };\n }\n}\n"],"mappings":"AAEA,OAAO,MAAMA,WAAW,CAAC;EACrB,OAAOC,KAAKA,CAACC,KAAuB,EAAY;IAC5C,OAAO;MACHC,EAAE,EAAED,KAAK,CAACC,EAAE;MACZC,OAAO,EAAEF,KAAK,CAACE,OAAO;MACtBC,KAAK,EAAEH,KAAK,CAACG,KAAK;MAClBC,OAAO,EAAEJ,KAAK,CAACI;IACnB,CAAC;EACL;EAEA,OAAOC,WAAWA,CAACL,KAAqB,EAAY;IAChD,OAAO;MACHC,EAAE,EAAED,KAAK,CAACC,EAAE;MACZC,OAAO,EAAEF,KAAK,CAACE,OAAO;MACtBC,KAAK,EAAEH,KAAK,CAACG,KAAK;MAClBC,OAAO,EAAEJ,KAAK,CAACM,KAAK,CAACF;IACzB,CAAC;EACL;AACJ","ignoreList":[]}
|
package/admin/components/ContentEntries/Filters/RefFieldRenderer/domain/EntryRepository.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EntryDTO } from "./Entry";
|
|
2
|
-
import { EntriesGatewayInterface } from "../adapters";
|
|
1
|
+
import type { EntryDTO } from "./Entry";
|
|
2
|
+
import type { EntriesGatewayInterface } from "../adapters";
|
|
3
3
|
export declare class EntryRepository {
|
|
4
4
|
readonly modelIds: string[];
|
|
5
5
|
private gateway;
|
package/admin/components/ContentEntries/Filters/RefFieldRenderer/domain/EntryRepository.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["makeAutoObservable","runInAction","EntryMapper","Loading","EntryRepository","entries","constructor","gateway","modelIds","loading","getEntries","getLoading","isLoading","listEntries","query","response","runWithLoading","list","map","entry","fromStorage","getEntryById","modelId","entryId","entryInCache","find","get","entryDTO","action","runCallbackWithLoading"],"sources":["EntryRepository.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport { EntryDTO, EntryReference } from \"./Entry\";\nimport { EntriesGatewayInterface } from \"../adapters\";\nimport { EntryMapper } from \"./EntryMapper\";\nimport { Loading } from \"./Loading\";\n\nexport class EntryRepository {\n public readonly modelIds: string[];\n private gateway: EntriesGatewayInterface;\n private loading: Loading;\n private entries: EntryDTO[] = [];\n\n constructor(gateway: EntriesGatewayInterface, modelIds: string[]) {\n this.modelIds = modelIds;\n this.gateway = gateway;\n this.loading = new Loading();\n makeAutoObservable(this);\n }\n\n getEntries() {\n return this.entries;\n }\n\n getLoading() {\n return {\n isLoading: this.loading.isLoading\n };\n }\n\n async listEntries(query: string) {\n const response = await this.runWithLoading<EntryReference[]>(\n this.gateway.list(this.modelIds, query)\n );\n\n if (!response) {\n return;\n }\n\n runInAction(() => {\n this.entries = response.map(entry => EntryMapper.fromStorage(entry));\n });\n }\n\n async getEntryById(modelId: string, entryId: string) {\n const entryInCache = this.entries.find(entry => entry.entryId === entryId);\n\n if (entryInCache) {\n return entryInCache;\n }\n\n const response = await this.runWithLoading<EntryReference>(\n this.gateway.get(modelId, entryId)\n );\n\n if (!response) {\n return;\n }\n\n const entryDTO = EntryMapper.fromStorage(response);\n runInAction(() => {\n this.entries = [entryDTO, ...this.entries];\n });\n\n return entryDTO;\n }\n\n private async runWithLoading<T>(action: Promise<T>) {\n return await this.loading.runCallbackWithLoading(action);\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,WAAW,QAAQ,MAAM;AAGtD,SAASC,WAAW;AACpB,SAASC,OAAO;AAEhB,OAAO,MAAMC,eAAe,CAAC;EAIjBC,OAAO,GAAe,EAAE;EAEhCC,WAAWA,CAACC,OAAgC,EAAEC,QAAkB,EAAE;IAC9D,IAAI,CAACA,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACD,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACE,OAAO,GAAG,IAAIN,OAAO,CAAC,CAAC;IAC5BH,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEAU,UAAUA,CAAA,EAAG;IACT,OAAO,IAAI,CAACL,OAAO;EACvB;EAEAM,UAAUA,CAAA,EAAG;IACT,OAAO;MACHC,SAAS,EAAE,IAAI,CAACH,OAAO,CAACG;IAC5B,CAAC;EACL;EAEA,MAAMC,WAAWA,CAACC,KAAa,EAAE;IAC7B,MAAMC,QAAQ,GAAG,MAAM,IAAI,CAACC,cAAc,CACtC,IAAI,CAACT,OAAO,CAACU,IAAI,CAAC,IAAI,CAACT,QAAQ,EAAEM,KAAK,CAC1C,CAAC;IAED,IAAI,CAACC,QAAQ,EAAE;MACX;IACJ;IAEAd,WAAW,CAAC,MAAM;MACd,IAAI,CAACI,OAAO,GAAGU,QAAQ,CAACG,GAAG,CAACC,KAAK,IAAIjB,WAAW,CAACkB,WAAW,CAACD,KAAK,CAAC,CAAC;IACxE,CAAC,CAAC;EACN;EAEA,MAAME,YAAYA,CAACC,OAAe,EAAEC,OAAe,EAAE;IACjD,MAAMC,YAAY,GAAG,IAAI,CAACnB,OAAO,CAACoB,IAAI,CAACN,KAAK,IAAIA,KAAK,CAACI,OAAO,KAAKA,OAAO,CAAC;IAE1E,IAAIC,YAAY,EAAE;MACd,OAAOA,YAAY;IACvB;IAEA,MAAMT,QAAQ,GAAG,MAAM,IAAI,CAACC,cAAc,CACtC,IAAI,CAACT,OAAO,CAACmB,GAAG,CAACJ,OAAO,EAAEC,OAAO,CACrC,CAAC;IAED,IAAI,CAACR,QAAQ,EAAE;MACX;IACJ;IAEA,MAAMY,QAAQ,GAAGzB,WAAW,CAACkB,WAAW,CAACL,QAAQ,CAAC;IAClDd,WAAW,CAAC,MAAM;MACd,IAAI,CAACI,OAAO,GAAG,CAACsB,QAAQ,EAAE,GAAG,IAAI,CAACtB,OAAO,CAAC;IAC9C,CAAC,CAAC;IAEF,OAAOsB,QAAQ;EACnB;EAEA,MAAcX,cAAcA,CAAIY,MAAkB,EAAE;IAChD,OAAO,MAAM,IAAI,CAACnB,OAAO,CAACoB,sBAAsB,CAACD,MAAM,CAAC;EAC5D;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["makeAutoObservable","runInAction","EntryMapper","Loading","EntryRepository","entries","constructor","gateway","modelIds","loading","getEntries","getLoading","isLoading","listEntries","query","response","runWithLoading","list","map","entry","fromStorage","getEntryById","modelId","entryId","entryInCache","find","get","entryDTO","action","runCallbackWithLoading"],"sources":["EntryRepository.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport type { EntryDTO, EntryReference } from \"./Entry\";\nimport type { EntriesGatewayInterface } from \"../adapters\";\nimport { EntryMapper } from \"./EntryMapper\";\nimport { Loading } from \"./Loading\";\n\nexport class EntryRepository {\n public readonly modelIds: string[];\n private gateway: EntriesGatewayInterface;\n private loading: Loading;\n private entries: EntryDTO[] = [];\n\n constructor(gateway: EntriesGatewayInterface, modelIds: string[]) {\n this.modelIds = modelIds;\n this.gateway = gateway;\n this.loading = new Loading();\n makeAutoObservable(this);\n }\n\n getEntries() {\n return this.entries;\n }\n\n getLoading() {\n return {\n isLoading: this.loading.isLoading\n };\n }\n\n async listEntries(query: string) {\n const response = await this.runWithLoading<EntryReference[]>(\n this.gateway.list(this.modelIds, query)\n );\n\n if (!response) {\n return;\n }\n\n runInAction(() => {\n this.entries = response.map(entry => EntryMapper.fromStorage(entry));\n });\n }\n\n async getEntryById(modelId: string, entryId: string) {\n const entryInCache = this.entries.find(entry => entry.entryId === entryId);\n\n if (entryInCache) {\n return entryInCache;\n }\n\n const response = await this.runWithLoading<EntryReference>(\n this.gateway.get(modelId, entryId)\n );\n\n if (!response) {\n return;\n }\n\n const entryDTO = EntryMapper.fromStorage(response);\n runInAction(() => {\n this.entries = [entryDTO, ...this.entries];\n });\n\n return entryDTO;\n }\n\n private async runWithLoading<T>(action: Promise<T>) {\n return await this.loading.runCallbackWithLoading(action);\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,WAAW,QAAQ,MAAM;AAGtD,SAASC,WAAW;AACpB,SAASC,OAAO;AAEhB,OAAO,MAAMC,eAAe,CAAC;EAIjBC,OAAO,GAAe,EAAE;EAEhCC,WAAWA,CAACC,OAAgC,EAAEC,QAAkB,EAAE;IAC9D,IAAI,CAACA,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACD,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACE,OAAO,GAAG,IAAIN,OAAO,CAAC,CAAC;IAC5BH,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEA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AACD,MAAM,CAAC;EAC5D;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EntryRepository","EntryRepositoryFactory","cache","Map","getRepository","gateway","modelIds","cacheKey","getCacheKey","has","set","get","Date","now","toString","join","entryRepositoryFactory"],"sources":["EntryRepositoryFactory.ts"],"sourcesContent":["import { EntriesGatewayInterface } from \"../adapters\";\nimport { EntryRepository } from \"./EntryRepository\";\n\nexport class EntryRepositoryFactory {\n private gateway: EntriesGatewayInterface | undefined;\n private cache: Map<string, EntryRepository> = new Map();\n\n getRepository(gateway: EntriesGatewayInterface, modelIds: string[]) {\n if (!this.gateway) {\n this.gateway = gateway;\n }\n\n const cacheKey = this.getCacheKey(modelIds);\n\n if (!this.cache.has(cacheKey)) {\n this.cache.set(cacheKey, new EntryRepository(this.gateway, modelIds));\n }\n\n return this.cache.get(cacheKey) as EntryRepository;\n }\n\n private getCacheKey(modelIds: string[]) {\n return [Date.now().toString(), ...modelIds].join(\"#\");\n }\n}\n\nexport const entryRepositoryFactory = new EntryRepositoryFactory();\n"],"mappings":"AACA,SAASA,eAAe;AAExB,OAAO,MAAMC,sBAAsB,CAAC;EAExBC,KAAK,GAAiC,IAAIC,GAAG,CAAC,CAAC;EAEvDC,aAAaA,CAACC,OAAgC,EAAEC,QAAkB,EAAE;IAChE,IAAI,CAAC,IAAI,CAACD,OAAO,EAAE;MACf,IAAI,CAACA,OAAO,GAAGA,OAAO;IAC1B;IAEA,MAAME,QAAQ,GAAG,IAAI,CAACC,WAAW,CAACF,QAAQ,CAAC;IAE3C,IAAI,CAAC,IAAI,CAACJ,KAAK,CAACO,GAAG,CAACF,QAAQ,CAAC,EAAE;MAC3B,IAAI,CAACL,KAAK,CAACQ,GAAG,CAACH,QAAQ,EAAE,IAAIP,eAAe,CAAC,IAAI,CAACK,OAAO,EAAEC,QAAQ,CAAC,CAAC;IACzE;IAEA,OAAO,IAAI,CAACJ,KAAK,CAACS,GAAG,CAACJ,QAAQ,CAAC;EACnC;EAEQC,WAAWA,CAACF,QAAkB,EAAE;IACpC,OAAO,CAACM,IAAI,CAACC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAGR,QAAQ,CAAC,CAACS,IAAI,CAAC,GAAG,CAAC;EACzD;AACJ;AAEA,OAAO,MAAMC,sBAAsB,GAAG,IAAIf,sBAAsB,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["EntryRepository","EntryRepositoryFactory","cache","Map","getRepository","gateway","modelIds","cacheKey","getCacheKey","has","set","get","Date","now","toString","join","entryRepositoryFactory"],"sources":["EntryRepositoryFactory.ts"],"sourcesContent":["import type { EntriesGatewayInterface } from \"../adapters\";\nimport { EntryRepository } from \"./EntryRepository\";\n\nexport class EntryRepositoryFactory {\n private gateway: EntriesGatewayInterface | undefined;\n private cache: Map<string, EntryRepository> = new Map();\n\n getRepository(gateway: EntriesGatewayInterface, modelIds: string[]) {\n if (!this.gateway) {\n this.gateway = gateway;\n }\n\n const cacheKey = this.getCacheKey(modelIds);\n\n if (!this.cache.has(cacheKey)) {\n this.cache.set(cacheKey, new EntryRepository(this.gateway, modelIds));\n }\n\n return this.cache.get(cacheKey) as EntryRepository;\n }\n\n private getCacheKey(modelIds: string[]) {\n return [Date.now().toString(), ...modelIds].join(\"#\");\n }\n}\n\nexport const entryRepositoryFactory = new EntryRepositoryFactory();\n"],"mappings":"AACA,SAASA,eAAe;AAExB,OAAO,MAAMC,sBAAsB,CAAC;EAExBC,KAAK,GAAiC,IAAIC,GAAG,CAAC,CAAC;EAEvDC,aAAaA,CAACC,OAAgC,EAAEC,QAAkB,EAAE;IAChE,IAAI,CAAC,IAAI,CAACD,OAAO,EAAE;MACf,IAAI,CAACA,OAAO,GAAGA,OAAO;IAC1B;IAEA,MAAME,QAAQ,GAAG,IAAI,CAACC,WAAW,CAACF,QAAQ,CAAC;IAE3C,IAAI,CAAC,IAAI,CAACJ,KAAK,CAACO,GAAG,CAACF,QAAQ,CAAC,EAAE;MAC3B,IAAI,CAACL,KAAK,CAACQ,GAAG,CAACH,QAAQ,EAAE,IAAIP,eAAe,CAAC,IAAI,CAACK,OAAO,EAAEC,QAAQ,CAAC,CAAC;IACzE;IAEA,OAAO,IAAI,CAACJ,KAAK,CAACS,GAAG,CAACJ,QAAQ,CAAC;EACnC;EAEQC,WAAWA,CAACF,QAAkB,EAAE;IACpC,OAAO,CAACM,IAAI,CAACC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAGR,QAAQ,CAAC,CAACS,IAAI,CAAC,GAAG,CAAC;EACzD;AACJ;AAEA,OAAO,MAAMC,sBAAsB,GAAG,IAAIf,sBAAsB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React, { useCallback, useMemo } from "react";
|
|
2
|
+
import { useContentEntry } from "../../../../views/contentEntries/hooks/index.js";
|
|
3
|
+
import { useApolloClient, usePermission } from "../../../../hooks/index.js";
|
|
4
|
+
import { ContentEntryEditorConfig } from "../../../../config/contentEntries/index.js";
|
|
5
|
+
import { ReactComponent as ScheduleIcon } from "@webiny/icons/cell_tower.svg";
|
|
6
|
+
import { useGetSchedulerItem } from "./hooks/useGetSchedulerItem.js";
|
|
7
|
+
import { SchedulerCancelGraphQLGateway, SchedulerGetGraphQLGateway, SchedulerPublishGraphQLGateway, SchedulerUnpublishGraphQLGateway } from "../adapters/index.js";
|
|
8
|
+
import { ScheduleDialogAction, useScheduleDialog } from "@webiny/app-headless-cms-scheduler";
|
|
9
|
+
export const ScheduleEntryMenuItem = () => {
|
|
10
|
+
const {
|
|
11
|
+
entry,
|
|
12
|
+
loading,
|
|
13
|
+
contentModel
|
|
14
|
+
} = useContentEntry();
|
|
15
|
+
const {
|
|
16
|
+
canPublish,
|
|
17
|
+
canUnpublish
|
|
18
|
+
} = usePermission();
|
|
19
|
+
const client = useApolloClient();
|
|
20
|
+
const {
|
|
21
|
+
showDialog: showSchedulerDialog
|
|
22
|
+
} = useScheduleDialog();
|
|
23
|
+
const getGateway = useMemo(() => {
|
|
24
|
+
return new SchedulerGetGraphQLGateway(client);
|
|
25
|
+
}, [client]);
|
|
26
|
+
const cancelGateway = useMemo(() => {
|
|
27
|
+
return new SchedulerCancelGraphQLGateway(client);
|
|
28
|
+
}, [client]);
|
|
29
|
+
const publishGateway = useMemo(() => {
|
|
30
|
+
return new SchedulerPublishGraphQLGateway(client);
|
|
31
|
+
}, [client]);
|
|
32
|
+
const unpublishGateway = useMemo(() => {
|
|
33
|
+
return new SchedulerUnpublishGraphQLGateway(client);
|
|
34
|
+
}, [client]);
|
|
35
|
+
const scheduleAction = useMemo(() => {
|
|
36
|
+
return new ScheduleDialogAction({
|
|
37
|
+
cancelGateway,
|
|
38
|
+
publishGateway,
|
|
39
|
+
unpublishGateway
|
|
40
|
+
});
|
|
41
|
+
}, [publishGateway, unpublishGateway]);
|
|
42
|
+
const scheduled = useGetSchedulerItem({
|
|
43
|
+
gateway: getGateway,
|
|
44
|
+
id: entry.id,
|
|
45
|
+
modelId: contentModel.modelId
|
|
46
|
+
});
|
|
47
|
+
const {
|
|
48
|
+
OptionsMenuItem
|
|
49
|
+
} = ContentEntryEditorConfig.Actions.MenuItemAction.useOptionsMenuItem();
|
|
50
|
+
const schedulerEntry = useMemo(() => {
|
|
51
|
+
if (scheduled.error) {
|
|
52
|
+
console.error(scheduled.error);
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return scheduled.item;
|
|
56
|
+
}, [scheduled]);
|
|
57
|
+
const showDialog = useCallback(() => {
|
|
58
|
+
showSchedulerDialog({
|
|
59
|
+
entry: {
|
|
60
|
+
id: entry.id,
|
|
61
|
+
title: entry.meta.title,
|
|
62
|
+
modelId: contentModel.modelId,
|
|
63
|
+
status: entry.meta.status
|
|
64
|
+
},
|
|
65
|
+
schedulerEntry,
|
|
66
|
+
action: scheduleAction
|
|
67
|
+
});
|
|
68
|
+
}, [entry, schedulerEntry, scheduleAction, showSchedulerDialog, contentModel]);
|
|
69
|
+
if (!canPublish("cms.contentEntry") && !canUnpublish("cms.contentEntry")) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
const action = entry.meta?.status === "published" ? "unpublish" : "publish";
|
|
73
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(OptionsMenuItem, {
|
|
74
|
+
icon: /*#__PURE__*/React.createElement(ScheduleIcon, null),
|
|
75
|
+
label: `Schedule ${action}`,
|
|
76
|
+
onAction: showDialog,
|
|
77
|
+
disabled: !entry?.meta?.status || loading,
|
|
78
|
+
"data-testid": "cms.content-form.header.schedule"
|
|
79
|
+
}));
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=ScheduleEntryAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","useContentEntry","useApolloClient","usePermission","ContentEntryEditorConfig","ReactComponent","ScheduleIcon","useGetSchedulerItem","SchedulerCancelGraphQLGateway","SchedulerGetGraphQLGateway","SchedulerPublishGraphQLGateway","SchedulerUnpublishGraphQLGateway","ScheduleDialogAction","useScheduleDialog","ScheduleEntryMenuItem","entry","loading","contentModel","canPublish","canUnpublish","client","showDialog","showSchedulerDialog","getGateway","cancelGateway","publishGateway","unpublishGateway","scheduleAction","scheduled","gateway","id","modelId","OptionsMenuItem","Actions","MenuItemAction","useOptionsMenuItem","schedulerEntry","error","console","item","title","meta","status","action","createElement","Fragment","icon","label","onAction","disabled"],"sources":["ScheduleEntryAction.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { useContentEntry } from \"~/admin/views/contentEntries/hooks/index.js\";\nimport { useApolloClient, usePermission } from \"~/admin/hooks/index.js\";\nimport { ContentEntryEditorConfig } from \"~/admin/config/contentEntries/index.js\";\nimport { ReactComponent as ScheduleIcon } from \"@webiny/icons/cell_tower.svg\";\nimport { useGetSchedulerItem } from \"./hooks/useGetSchedulerItem.js\";\nimport {\n SchedulerCancelGraphQLGateway,\n SchedulerGetGraphQLGateway,\n SchedulerPublishGraphQLGateway,\n SchedulerUnpublishGraphQLGateway\n} from \"../adapters/index.js\";\nimport { ScheduleDialogAction, useScheduleDialog } from \"@webiny/app-headless-cms-scheduler\";\n\nexport const ScheduleEntryMenuItem = () => {\n const { entry, loading, contentModel } = useContentEntry();\n const { canPublish, canUnpublish } = usePermission();\n const client = useApolloClient();\n\n const { showDialog: showSchedulerDialog } = useScheduleDialog();\n\n const getGateway = useMemo(() => {\n return new SchedulerGetGraphQLGateway(client);\n }, [client]);\n\n const cancelGateway = useMemo(() => {\n return new SchedulerCancelGraphQLGateway(client);\n }, [client]);\n\n const publishGateway = useMemo(() => {\n return new SchedulerPublishGraphQLGateway(client);\n }, [client]);\n\n const unpublishGateway = useMemo(() => {\n return new SchedulerUnpublishGraphQLGateway(client);\n }, [client]);\n\n const scheduleAction = useMemo(() => {\n return new ScheduleDialogAction({\n cancelGateway,\n publishGateway,\n unpublishGateway\n });\n }, [publishGateway, unpublishGateway]);\n\n const scheduled = useGetSchedulerItem({\n gateway: getGateway,\n id: entry.id,\n modelId: contentModel.modelId\n });\n\n const { OptionsMenuItem } =\n ContentEntryEditorConfig.Actions.MenuItemAction.useOptionsMenuItem();\n\n const schedulerEntry = useMemo(() => {\n if (scheduled.error) {\n console.error(scheduled.error);\n return null;\n }\n return scheduled.item;\n }, [scheduled]);\n\n const showDialog = useCallback(() => {\n showSchedulerDialog({\n entry: {\n id: entry.id,\n title: entry.meta.title,\n modelId: contentModel.modelId,\n status: entry.meta.status\n },\n schedulerEntry,\n action: scheduleAction\n });\n }, [entry, schedulerEntry, scheduleAction, showSchedulerDialog, contentModel]);\n\n if (!canPublish(\"cms.contentEntry\") && !canUnpublish(\"cms.contentEntry\")) {\n return null;\n }\n\n const action = entry.meta?.status === \"published\" ? \"unpublish\" : \"publish\";\n\n return (\n <>\n <OptionsMenuItem\n icon={<ScheduleIcon />}\n label={`Schedule ${action}`}\n onAction={showDialog}\n disabled={!entry?.meta?.status || loading}\n data-testid={\"cms.content-form.header.schedule\"}\n />\n </>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACnD,SAASC,eAAe;AACxB,SAASC,eAAe,EAAEC,aAAa;AACvC,SAASC,wBAAwB;AACjC,SAASC,cAAc,IAAIC,YAAY,QAAQ,8BAA8B;AAC7E,SAASC,mBAAmB;AAC5B,SACIC,6BAA6B,EAC7BC,0BAA0B,EAC1BC,8BAA8B,EAC9BC,gCAAgC;AAEpC,SAASC,oBAAoB,EAAEC,iBAAiB,QAAQ,oCAAoC;AAE5F,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EACvC,MAAM;IAAEC,KAAK;IAAEC,OAAO;IAAEC;EAAa,CAAC,GAAGhB,eAAe,CAAC,CAAC;EAC1D,MAAM;IAAEiB,UAAU;IAAEC;EAAa,CAAC,GAAGhB,aAAa,CAAC,CAAC;EACpD,MAAMiB,MAAM,GAAGlB,eAAe,CAAC,CAAC;EAEhC,MAAM;IAAEmB,UAAU,EAAEC;EAAoB,CAAC,GAAGT,iBAAiB,CAAC,CAAC;EAE/D,MAAMU,UAAU,GAAGvB,OAAO,CAAC,MAAM;IAC7B,OAAO,IAAIS,0BAA0B,CAACW,MAAM,CAAC;EACjD,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZ,MAAMI,aAAa,GAAGxB,OAAO,CAAC,MAAM;IAChC,OAAO,IAAIQ,6BAA6B,CAACY,MAAM,CAAC;EACpD,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZ,MAAMK,cAAc,GAAGzB,OAAO,CAAC,MAAM;IACjC,OAAO,IAAIU,8BAA8B,CAACU,MAAM,CAAC;EACrD,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZ,MAAMM,gBAAgB,GAAG1B,OAAO,CAAC,MAAM;IACnC,OAAO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,IAAI,CAACC,YAAY,CAAC,kBAAkB,CAAC,EAAE;IACtE,OAAO,IAAI;EACf;EAEA,MAAMwB,MAAM,GAAG5B,KAAK,CAAC0B,IAAI,EAAEC,MAAM,KAAK,WAAW,GAAG,WAAW,GAAG,SAAS;EAE3E,oBACI5C,KAAA,CAAA8C,aAAA,CAAA9C,KAAA,CAAA+C,QAAA,qBACI/C,KAAA,CAAA8C,aAAA,CAACZ,eAAe;IACZc,IAAI,eAAEhD,KAAA,CAAA8C,aAAA,CAACtC,YAAY,MAAE,CAAE;IACvByC,KAAK,EAAE,YAAYJ,MAAM,EAAG;IAC5BK,QAAQ,EAAE3B,UAAW;IACrB4B,QAAQ,EAAE,CAAClC,KAAK,EAAE0B,IAAI,EAAEC,MAAM,IAAI1B,OAAQ;IAC1C,eAAa;EAAmC,CACnD,CACH,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SchedulerEntry } from "@webiny/app-headless-cms-scheduler/types.js";
|
|
2
|
+
import type { ISchedulerGetExecuteParams, ISchedulerGetGateway } from "@webiny/app-headless-cms-scheduler";
|
|
3
|
+
export interface IUseGetItemParams extends ISchedulerGetExecuteParams {
|
|
4
|
+
gateway: ISchedulerGetGateway;
|
|
5
|
+
}
|
|
6
|
+
interface IState {
|
|
7
|
+
item: SchedulerEntry | null;
|
|
8
|
+
error: Error | null;
|
|
9
|
+
}
|
|
10
|
+
export declare const useGetSchedulerItem: (params: IUseGetItemParams) => IState;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
export const useGetSchedulerItem = params => {
|
|
3
|
+
const {
|
|
4
|
+
gateway
|
|
5
|
+
} = params;
|
|
6
|
+
const [state, setState] = useState({
|
|
7
|
+
item: null,
|
|
8
|
+
error: null
|
|
9
|
+
});
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (!params.id || !params.modelId) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
(async () => {
|
|
15
|
+
try {
|
|
16
|
+
const result = await gateway.execute({
|
|
17
|
+
id: params.id,
|
|
18
|
+
modelId: params.modelId
|
|
19
|
+
});
|
|
20
|
+
setState({
|
|
21
|
+
item: result,
|
|
22
|
+
error: null
|
|
23
|
+
});
|
|
24
|
+
} catch (ex) {
|
|
25
|
+
setState({
|
|
26
|
+
error: ex,
|
|
27
|
+
item: null
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
})();
|
|
31
|
+
}, [params.id, params.modelId, gateway]);
|
|
32
|
+
return state;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=useGetSchedulerItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useState","useGetSchedulerItem","params","gateway","state","setState","item","error","id","modelId","result","execute","ex"],"sources":["useGetSchedulerItem.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport type { SchedulerEntry } from \"@webiny/app-headless-cms-scheduler/types.js\";\nimport type {\n ISchedulerGetExecuteParams,\n ISchedulerGetGateway\n} from \"@webiny/app-headless-cms-scheduler\";\n\nexport interface IUseGetItemParams extends ISchedulerGetExecuteParams {\n gateway: ISchedulerGetGateway;\n}\n\ninterface IState {\n item: SchedulerEntry | null;\n error: Error | null;\n}\n\nexport const useGetSchedulerItem = (params: IUseGetItemParams) => {\n const { gateway } = params;\n const [state, setState] = useState<IState>({\n item: null,\n error: null\n });\n\n useEffect(() => {\n if (!params.id || !params.modelId) {\n return;\n }\n (async () => {\n try {\n const result = await gateway.execute({\n id: params.id,\n modelId: params.modelId\n });\n setState({\n item: result,\n error: null\n });\n } catch (ex) {\n setState({\n error: ex,\n item: null\n });\n }\n })();\n }, [params.id, params.modelId, gateway]);\n\n return state;\n};\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAgB3C,OAAO,MAAMC,mBAAmB,GAAIC,MAAyB,IAAK;EAC9D,MAAM;IAAEC;EAAQ,CAAC,GAAGD,MAAM;EAC1B,MAAM,CAACE,KAAK,EAAEC,QAAQ,CAAC,GAAGL,QAAQ,CAAS;IACvCM,IAAI,EAAE,IAAI;IACVC,KAAK,EAAE;EACX,CAAC,CAAC;EAEFR,SAAS,CAAC,MAAM;IACZ,IAAI,CAACG,MAAM,CAACM,EAAE,IAAI,CAACN,MAAM,CAACO,OAAO,EAAE;MAC/B;IACJ;IACA,CAAC,YAAY;MACT,IAAI;QACA,MAAMC,MAAM,GAAG,MAAMP,OAAO,CAACQ,OAAO,CAAC;UACjCH,EAAE,EAAEN,MAAM,CAACM,EAAE;UACbC,OAAO,EAAEP,MAAM,CAACO;QACpB,CAAC,CAAC;QACFJ,QAAQ,CAAC;UACLC,IAAI,EAAEI,MAAM;UACZH,KAAK,EAAE;QACX,CAAC,CAAC;MACN,CAAC,CAAC,OAAOK,EAAE,EAAE;QACTP,QAAQ,CAAC;UACLE,KAAK,EAAEK,EAAE;UACTN,IAAI,EAAE;QACV,CAAC,CAAC;MACN;IACJ,CAAC,EAAE,CAAC;EACR,CAAC,EAAE,CAACJ,MAAM,CAACM,EAAE,EAAEN,MAAM,CAACO,OAAO,EAAEN,OAAO,CAAC,CAAC;EAExC,OAAOC,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ApolloClient } from "apollo-client";
|
|
2
|
+
import type { IScheduleCancelExecuteParams, ISchedulerCancelGateway } from "@webiny/app-headless-cms-scheduler/index.js";
|
|
3
|
+
export declare class SchedulerCancelGraphQLGateway implements ISchedulerCancelGateway {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: ApolloClient<any>);
|
|
6
|
+
execute(params: IScheduleCancelExecuteParams): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import gql from "graphql-tag";
|
|
2
|
+
const createSchedulerCancelMutation = () => {
|
|
3
|
+
return gql`
|
|
4
|
+
mutation SchedulerCancel($modelId: String!, $id: ID!) {
|
|
5
|
+
cancelCmsSchedule(modelId: $modelId, id: $id) {
|
|
6
|
+
data
|
|
7
|
+
error {
|
|
8
|
+
message
|
|
9
|
+
code
|
|
10
|
+
data
|
|
11
|
+
stack
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
};
|
|
17
|
+
export class SchedulerCancelGraphQLGateway {
|
|
18
|
+
constructor(client) {
|
|
19
|
+
this.client = client;
|
|
20
|
+
}
|
|
21
|
+
async execute(params) {
|
|
22
|
+
const {
|
|
23
|
+
data: response,
|
|
24
|
+
errors
|
|
25
|
+
} = await this.client.mutate({
|
|
26
|
+
mutation: createSchedulerCancelMutation(),
|
|
27
|
+
variables: {
|
|
28
|
+
modelId: params.modelId,
|
|
29
|
+
id: params.id
|
|
30
|
+
},
|
|
31
|
+
fetchPolicy: "no-cache"
|
|
32
|
+
});
|
|
33
|
+
const result = response?.cancelCmsSchedule;
|
|
34
|
+
if (!result || errors?.length) {
|
|
35
|
+
console.error({
|
|
36
|
+
errors
|
|
37
|
+
});
|
|
38
|
+
throw new Error("Network error while canceling a schedule.");
|
|
39
|
+
}
|
|
40
|
+
if (!result.data) {
|
|
41
|
+
throw new Error(result.error?.message || "Could not cancel schedule entry.");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=SchedulerCancelGraphQLGateway.js.map
|
package/admin/components/ContentEntries/Scheduler/adapters/SchedulerCancelGraphQLGateway.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["gql","createSchedulerCancelMutation","SchedulerCancelGraphQLGateway","constructor","client","execute","params","data","response","errors","mutate","mutation","variables","modelId","id","fetchPolicy","result","cancelCmsSchedule","length","console","error","Error","message"],"sources":["SchedulerCancelGraphQLGateway.ts"],"sourcesContent":["import type { ApolloClient } from \"apollo-client\";\nimport type { CmsErrorResponse } from \"@webiny/app-headless-cms-common/types/index.js\";\nimport gql from \"graphql-tag\";\nimport type {\n IScheduleCancelExecuteParams,\n ISchedulerCancelGateway\n} from \"@webiny/app-headless-cms-scheduler/index.js\";\n\nconst createSchedulerCancelMutation = () => {\n return gql`\n mutation SchedulerCancel($modelId: String!, $id: ID!) {\n cancelCmsSchedule(modelId: $modelId, id: $id) {\n data\n error {\n message\n code\n data\n stack\n }\n }\n }\n `;\n};\n\ninterface SchedulerCancelGraphQLMutationVariables {\n modelId: string;\n id: string;\n}\n\ninterface SchedulerCancelGraphQLMutationResponse {\n cancelCmsSchedule: {\n data: boolean | null;\n error: CmsErrorResponse | null;\n };\n}\n\nexport class SchedulerCancelGraphQLGateway implements ISchedulerCancelGateway {\n private readonly client: ApolloClient<any>;\n\n public constructor(client: ApolloClient<any>) {\n this.client = client;\n }\n\n public async execute(params: IScheduleCancelExecuteParams) {\n const { data: response, errors } = await this.client.mutate<\n SchedulerCancelGraphQLMutationResponse,\n SchedulerCancelGraphQLMutationVariables\n >({\n mutation: createSchedulerCancelMutation(),\n variables: {\n modelId: params.modelId,\n id: params.id\n },\n fetchPolicy: \"no-cache\"\n });\n\n const result = response?.cancelCmsSchedule;\n if (!result || errors?.length) {\n console.error({\n errors\n });\n throw new Error(\"Network error while canceling a schedule.\");\n }\n\n if (!result.data) {\n throw new Error(result.error?.message || \"Could not cancel schedule entry.\");\n }\n }\n}\n"],"mappings":"AAEA,OAAOA,GAAG,MAAM,aAAa;AAM7B,MAAMC,6BAA6B,GAAGA,CAAA,KAAM;EACxC,OAAOD,GAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AAcD,OAAO,MAAME,6BAA6B,CAAoC;EAGnEC,WAAWA,CAACC,MAAyB,EAAE;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEA,MAAaC,OAAOA,CAACC,MAAoC,EAAE;IACvD,MAAM;MAAEC,IAAI,EAAEC,QAAQ;MAAEC;IAAO,CAAC,GAAG,MAAM,IAAI,CAACL,MAAM,CAACM,MAAM,CAGzD;MACEC,QAAQ,EAAEV,6BAA6B,CAAC,CAAC;MACzCW,SAAS,EAAE;QACPC,OAAO,EAAEP,MAAM,CAACO,OAAO;QACvBC,EAAE,EAAER,MAAM,CAACQ;MACf,CAAC;MACDC,WAAW,EAAE;IACjB,CAAC,CAAC;IAEF,MAAMC,MAAM,GAAGR,QAAQ,EAAES,iBAAiB;IAC1C,IAAI,CAACD,MAAM,IAAIP,MAAM,EAAES,MAAM,EAAE;MAC3BC,OAAO,CAACC,KAAK,CAAC;QACVX;MACJ,CAAC,CAAC;MACF,MAAM,IAAIY,KAAK,CAAC,2CAA2C,CAAC;IAChE;IAEA,IAAI,CAACL,MAAM,CAACT,IAAI,EAAE;MACd,MAAM,IAAIc,KAAK,CAACL,MAAM,CAACI,KAAK,EAAEE,OAAO,IAAI,kCAAkC,CAAC;IAChF;EACJ;AACJ","ignoreList":[]}
|