@payloadcms/ui 4.0.0-internal.e387174 → 4.0.0-internal.e55ccef
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/z-index.css +9 -0
- package/dist/elements/AnimateHeight/usePatchAnimateHeight.d.ts.map +1 -1
- package/dist/elements/Button/index.d.ts.map +1 -1
- package/dist/elements/ClipboardAction/ClipboardActionLabel.d.ts.map +1 -1
- package/dist/elements/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/elements/CodeEditor/index.css +5 -0
- package/dist/elements/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/elements/DatePicker/getFormattedLocale.d.ts.map +1 -1
- package/dist/elements/Dialog/DialogTitle/index.d.ts.map +1 -1
- package/dist/elements/DocumentControls/index.d.ts +2 -2
- package/dist/elements/DocumentControls/index.d.ts.map +1 -1
- package/dist/elements/DocumentControls/index.js.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerHeader/index.d.ts +2 -2
- package/dist/elements/DocumentDrawer/DrawerHeader/index.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerHeader/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts.map +1 -1
- package/dist/elements/DocumentLocked/index.d.ts +2 -2
- package/dist/elements/DocumentLocked/index.d.ts.map +1 -1
- package/dist/elements/DocumentLocked/index.js.map +1 -1
- package/dist/elements/DraggableSortable/useDraggableSortable/index.d.ts.map +1 -1
- package/dist/elements/Drawer/index.d.ts.map +1 -1
- package/dist/elements/Drawer/index.js +1 -0
- package/dist/elements/Drawer/index.js.map +1 -1
- package/dist/elements/Drawer/useDrawerSlug.d.ts.map +1 -1
- package/dist/elements/DrawerActionHeader/index.d.ts.map +1 -1
- package/dist/elements/FieldSelect/reduceFieldOptions.d.ts.map +1 -1
- package/dist/elements/HTMLDiff/diff/index.d.ts.map +1 -1
- package/dist/elements/HTMLDiff/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Modal/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Modal/useHierarchyModal.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Search/useHierarchySearch.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/TreeFocusContext.d.ts +1 -1
- package/dist/elements/Hierarchy/Tree/TreeFocusContext.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/TreeNode/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/useChildren.d.ts.map +1 -1
- package/dist/elements/LeaveWithoutSaving/index.d.ts.map +1 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts.map +1 -1
- package/dist/elements/ListDrawer/index.d.ts.map +1 -1
- package/dist/elements/LoadingOverlay/reducer.d.ts.map +1 -1
- package/dist/elements/Locked/index.d.ts +2 -2
- package/dist/elements/Locked/index.d.ts.map +1 -1
- package/dist/elements/Locked/index.js.map +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingColumns.d.ts.map +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.d.ts.map +1 -1
- package/dist/elements/ReactSelect/DefaultMenuPortal.d.ts +7 -0
- package/dist/elements/ReactSelect/DefaultMenuPortal.d.ts.map +1 -0
- package/dist/elements/ReactSelect/DefaultMenuPortal.js +120 -0
- package/dist/elements/ReactSelect/DefaultMenuPortal.js.map +1 -0
- package/dist/elements/ReactSelect/getCaptureMenuScroll.d.ts.map +1 -1
- package/dist/elements/ReactSelect/getMenuListStyles.d.ts +1 -1
- package/dist/elements/ReactSelect/getMenuListStyles.d.ts.map +1 -1
- package/dist/elements/ReactSelect/getMenuListStyles.js +13 -5
- package/dist/elements/ReactSelect/getMenuListStyles.js.map +1 -1
- package/dist/elements/ReactSelect/getMenuStyles.d.ts +10 -0
- package/dist/elements/ReactSelect/getMenuStyles.d.ts.map +1 -0
- package/dist/elements/ReactSelect/getMenuStyles.js +21 -0
- package/dist/elements/ReactSelect/getMenuStyles.js.map +1 -0
- package/dist/elements/ReactSelect/index.css +7 -0
- package/dist/elements/ReactSelect/index.d.ts.map +1 -1
- package/dist/elements/ReactSelect/index.js +24 -101
- package/dist/elements/ReactSelect/index.js.map +1 -1
- package/dist/elements/ReactSelect/types.d.ts +1 -2
- package/dist/elements/ReactSelect/types.d.ts.map +1 -1
- package/dist/elements/ReactSelect/types.js.map +1 -1
- package/dist/elements/RelationshipTable/AddNewButton.d.ts +2 -2
- package/dist/elements/RelationshipTable/AddNewButton.d.ts.map +1 -1
- package/dist/elements/SelectAll/index.css +3 -1
- package/dist/elements/SelectRow/index.d.ts +2 -2
- package/dist/elements/SelectRow/index.d.ts.map +1 -1
- package/dist/elements/SelectRow/index.js.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/index.d.ts +1 -1
- package/dist/elements/Table/DefaultCell/fields/index.d.ts.map +1 -1
- package/dist/elements/Table/OrderableRow.d.ts.map +1 -1
- package/dist/elements/Table/OrderableRowDragPreview.d.ts.map +1 -1
- package/dist/elements/Table/index.css +6 -0
- package/dist/elements/Tabs/index.d.ts.map +1 -1
- package/dist/elements/Thumbnail/createThumbnail.d.ts.map +1 -1
- package/dist/elements/Upload/index.d.ts.map +1 -1
- package/dist/elements/WhereBuilder/Condition/Relationship/optionsReducer.d.ts.map +1 -1
- package/dist/elements/WhereBuilder/Condition/Select/formatOptions.d.ts.map +1 -1
- package/dist/elements/WhereBuilder/Condition/validOperators.d.ts.map +1 -1
- package/dist/elements/WhereBuilder/field-types.d.ts.map +1 -1
- package/dist/exports/layouts.d.ts +1 -0
- package/dist/exports/layouts.d.ts.map +1 -1
- package/dist/exports/layouts.js +1 -0
- package/dist/exports/layouts.js.map +1 -1
- package/dist/exports/shared/index.d.ts +1 -0
- package/dist/exports/shared/index.d.ts.map +1 -1
- package/dist/exports/shared/index.js +2 -2
- package/dist/exports/shared/index.js.map +4 -4
- package/dist/fields/Array/index.d.ts +1 -1
- package/dist/fields/Blocks/index.d.ts +1 -1
- package/dist/fields/Checkbox/index.d.ts +1 -1
- package/dist/fields/Code/index.css +1 -1
- package/dist/fields/Code/index.d.ts +2 -2
- package/dist/fields/Collapsible/index.d.ts +1 -1
- package/dist/fields/DateTime/index.d.ts +1 -1
- package/dist/fields/Email/index.d.ts +1 -1
- package/dist/fields/Group/index.d.ts +2 -2
- package/dist/fields/JSON/index.d.ts +1 -1
- package/dist/fields/Join/index.d.ts +1 -1
- package/dist/fields/Number/index.d.ts +1 -1
- package/dist/fields/Point/index.d.ts +1 -1
- package/dist/fields/Relationship/findOptionsByValue.d.ts.map +1 -1
- package/dist/fields/Relationship/index.d.ts +1 -1
- package/dist/fields/Relationship/optionsReducer.d.ts.map +1 -1
- package/dist/fields/Row/index.d.ts +1 -1
- package/dist/fields/Select/index.d.ts +1 -1
- package/dist/fields/Select/index.d.ts.map +1 -1
- package/dist/fields/Tabs/index.d.ts +1 -1
- package/dist/fields/Text/index.d.ts +1 -1
- package/dist/fields/Textarea/index.d.ts +1 -1
- package/dist/fields/mergeFieldStyles.d.ts +1 -1
- package/dist/fields/mergeFieldStyles.d.ts.map +1 -1
- package/dist/forms/Form/context.d.ts.map +1 -1
- package/dist/forms/Form/createNestedClientFieldPath.d.ts.map +1 -1
- package/dist/forms/Form/errorMessages.d.ts.map +1 -1
- package/dist/forms/Form/mergeServerFormState.d.ts.map +1 -1
- package/dist/forms/Form/reduceToSerializableFields.d.ts.map +1 -1
- package/dist/forms/Form/rowHelpers.d.ts.map +1 -1
- package/dist/forms/Form/rows.d.ts.map +1 -1
- package/dist/forms/RenderFields/RenderField.d.ts +1 -1
- package/dist/forms/WatchChildErrors/buildPathSegments.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/index.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/iterateFields.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/promise.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/index.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/iterateFields.d.ts.map +1 -1
- package/dist/forms/useField/index.d.ts.map +1 -1
- package/dist/forms/withCondition/index.d.ts +1 -1
- package/dist/forms/withCondition/index.d.ts.map +1 -1
- package/dist/hooks/useDebouncedCallback.d.ts.map +1 -1
- package/dist/hooks/useDelay.d.ts.map +1 -1
- package/dist/hooks/useElementHeightVariable.d.ts.map +1 -1
- package/dist/hooks/useHotkey.d.ts.map +1 -1
- package/dist/hooks/useIntersect.d.ts.map +1 -1
- package/dist/hooks/usePopupWindow.d.ts +1 -1
- package/dist/hooks/usePopupWindow.d.ts.map +1 -1
- package/dist/hooks/useRelatedCollections.d.ts.map +1 -1
- package/dist/hooks/useResize.d.ts.map +1 -1
- package/dist/hooks/useUseAsTitle.d.ts.map +1 -1
- package/dist/layouts/Root/index.d.ts.map +1 -1
- package/dist/layouts/Root/index.js +4 -2
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/layouts/Root/viewport.d.ts +1 -0
- package/dist/layouts/Root/viewport.d.ts.map +1 -1
- package/dist/layouts/Root/viewport.js +4 -1
- package/dist/layouts/Root/viewport.js.map +1 -1
- package/dist/providers/Auth/index.d.ts +6 -6
- package/dist/providers/Auth/index.d.ts.map +1 -1
- package/dist/providers/Auth/index.js.map +1 -1
- package/dist/providers/ClientFunction/index.d.ts.map +1 -1
- package/dist/providers/DocumentInfo/index.js.map +1 -1
- package/dist/providers/DocumentInfo/types.d.ts +5 -5
- package/dist/providers/DocumentInfo/types.d.ts.map +1 -1
- package/dist/providers/DocumentInfo/types.js.map +1 -1
- package/dist/providers/DocumentInfo/useGetDocPermissions.d.ts.map +1 -1
- package/dist/providers/ListQuery/mergeQuery.d.ts.map +1 -1
- package/dist/providers/ListQuery/sanitizeQuery.d.ts.map +1 -1
- package/dist/providers/LivePreview/sizeReducer.d.ts +1 -1
- package/dist/providers/LivePreview/sizeReducer.d.ts.map +1 -1
- package/dist/providers/TableColumns/buildColumnState/filterFields.d.ts.map +1 -1
- package/dist/providers/TableColumns/buildColumnState/filterFieldsWithPermissions.d.ts.map +1 -1
- package/dist/providers/TableColumns/buildColumnState/findValueFromPath.d.ts.map +1 -1
- package/dist/providers/TableColumns/buildColumnState/index.d.ts.map +1 -1
- package/dist/providers/TableColumns/getInitialColumns.d.ts +1 -1
- package/dist/providers/TableColumns/getInitialColumns.d.ts.map +1 -1
- package/dist/providers/Theme/index.d.ts +2 -2
- package/dist/providers/Theme/index.d.ts.map +1 -1
- package/dist/providers/Theme/index.js +2 -1
- package/dist/providers/Theme/index.js.map +1 -1
- package/dist/providers/Theme/shared.d.ts +3 -0
- package/dist/providers/Theme/shared.d.ts.map +1 -0
- package/dist/providers/Theme/shared.js +2 -0
- package/dist/providers/Theme/shared.js.map +1 -0
- package/dist/providers/UploadEdits/index.d.ts.map +1 -1
- package/dist/providers/UploadHandlers/index.d.ts.map +1 -1
- package/dist/styles.css +11 -1
- package/dist/utilities/api.d.ts.map +1 -1
- package/dist/utilities/buildClientFieldSchemaMap/index.d.ts.map +1 -1
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.d.ts.map +1 -1
- package/dist/utilities/buildFieldSchemaMap/index.d.ts.map +1 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts.map +1 -1
- package/dist/utilities/buildFormState.d.ts +2 -2
- package/dist/utilities/buildFormState.d.ts.map +1 -1
- package/dist/utilities/buildFormState.js.map +1 -1
- package/dist/utilities/checkDependencies.d.ts.map +1 -1
- package/dist/utilities/combineFieldLabel.d.ts.map +1 -1
- package/dist/utilities/copyDataFromLocale.d.ts.map +1 -1
- package/dist/utilities/filterOutUploadFields.d.ts.map +1 -1
- package/dist/utilities/findLocaleFromCode.d.ts.map +1 -1
- package/dist/utilities/formatAbsoluteURL.d.ts.map +1 -1
- package/dist/utilities/formatDocTitle/formatDateTitle.d.ts.map +1 -1
- package/dist/utilities/formatDocTitle/formatRelationshipTitle.d.ts.map +1 -1
- package/dist/utilities/formatDocTitle/index.d.ts +1 -1
- package/dist/utilities/formatDocTitle/index.d.ts.map +1 -1
- package/dist/utilities/formatFields.d.ts.map +1 -1
- package/dist/utilities/formatMetadata.d.ts.map +1 -1
- package/dist/utilities/generateFieldID.d.ts.map +1 -1
- package/dist/utilities/getColumns.d.ts.map +1 -1
- package/dist/utilities/getDisplayedFieldValue.d.ts.map +1 -1
- package/dist/utilities/getDocPreferences.d.ts.map +1 -1
- package/dist/utilities/getDocumentData.d.ts.map +1 -1
- package/dist/utilities/getDocumentPermissions.d.ts.map +1 -1
- package/dist/utilities/getGlobalData.d.ts +2 -2
- package/dist/utilities/getGlobalData.d.ts.map +1 -1
- package/dist/utilities/getGlobalData.js.map +1 -1
- package/dist/utilities/getHasScheduledPublish.d.ts.map +1 -1
- package/dist/utilities/getIsLocked.d.ts.map +1 -1
- package/dist/utilities/getLanguageDir.d.ts +12 -0
- package/dist/utilities/getLanguageDir.d.ts.map +1 -0
- package/dist/utilities/getLanguageDir.js +12 -0
- package/dist/utilities/getLanguageDir.js.map +1 -0
- package/dist/utilities/getOffsetTop.d.ts.map +1 -1
- package/dist/utilities/getRequestHighContrast.d.ts.map +1 -1
- package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
- package/dist/utilities/getRequestTheme.d.ts +1 -1
- package/dist/utilities/getRequestTheme.d.ts.map +1 -1
- package/dist/utilities/getRequestTheme.js +1 -1
- package/dist/utilities/getRequestTheme.js.map +1 -1
- package/dist/utilities/getRouteWithoutAdmin.d.ts.map +1 -1
- package/dist/utilities/getSupportedMonacoLocale.d.ts.map +1 -1
- package/dist/utilities/getVersions.d.ts.map +1 -1
- package/dist/utilities/handleAuthRedirect.d.ts.map +1 -1
- package/dist/utilities/handleBackToDashboard.d.ts.map +1 -1
- package/dist/utilities/handleFormStateLocking.d.ts.map +1 -1
- package/dist/utilities/handleGoBack.d.ts.map +1 -1
- package/dist/utilities/handleLivePreview.d.ts.map +1 -1
- package/dist/utilities/handlePreview.d.ts.map +1 -1
- package/dist/utilities/handleServerFunctions.d.ts.map +1 -1
- package/dist/utilities/handleStaleDataCheck.d.ts.map +1 -1
- package/dist/utilities/handleTakeOver.d.ts +5 -5
- package/dist/utilities/handleTakeOver.d.ts.map +1 -1
- package/dist/utilities/handleTakeOver.js.map +1 -1
- package/dist/utilities/hasOptionLabelJSXElement.d.ts.map +1 -1
- package/dist/utilities/hasSavePermission.d.ts.map +1 -1
- package/dist/utilities/initReq.d.ts.map +1 -1
- package/dist/utilities/isClientUserObject.d.ts +2 -2
- package/dist/utilities/isClientUserObject.d.ts.map +1 -1
- package/dist/utilities/isClientUserObject.js.map +1 -1
- package/dist/utilities/isCustomAdminView.d.ts.map +1 -1
- package/dist/utilities/isEditing.d.ts.map +1 -1
- package/dist/utilities/isPathMatchingRoute.d.ts.map +1 -1
- package/dist/utilities/isPublicAdminRoute.d.ts.map +1 -1
- package/dist/utilities/isURLAllowed.d.ts.map +1 -1
- package/dist/utilities/recentlyViewed.d.ts.map +1 -1
- package/dist/utilities/reduceFieldsToOptions.d.ts.map +1 -1
- package/dist/utilities/reduceFieldsToValuesWithValidation.d.ts.map +1 -1
- package/dist/utilities/renderTable.d.ts +2 -2
- package/dist/utilities/renderTable.d.ts.map +1 -1
- package/dist/utilities/resolveFilterOptions.d.ts +1 -1
- package/dist/utilities/resolveFilterOptions.d.ts.map +1 -1
- package/dist/utilities/sanitizeFilterOptionsQuery.d.ts.map +1 -1
- package/dist/utilities/scrollToID.d.ts.map +1 -1
- package/dist/utilities/selectiveCache.d.ts.map +1 -1
- package/dist/utilities/setsAreEqual.d.ts.map +1 -1
- package/dist/utilities/traverseForLocalizedFields.d.ts.map +1 -1
- package/dist/utilities/upsertPreferences.d.ts.map +1 -1
- package/dist/views/CollectionTrash/generateCollectionTrashMetadata.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/index.d.ts +2 -2
- package/dist/views/Dashboard/Default/index.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/index.js.map +1 -1
- package/dist/views/Document/getCustomDocumentViewByKey.d.ts +1 -1
- package/dist/views/Document/getCustomDocumentViewByKey.d.ts.map +1 -1
- package/dist/views/Document/getCustomViewByRoute.d.ts +1 -1
- package/dist/views/Document/getCustomViewByRoute.d.ts.map +1 -1
- package/dist/views/Document/getDocumentView.d.ts.map +1 -1
- package/dist/views/Document/getMetaBySegment.d.ts.map +1 -1
- package/dist/views/Document/index.d.ts +1 -1
- package/dist/views/Document/index.d.ts.map +1 -1
- package/dist/views/Document/recordRecentlyViewed.d.ts.map +1 -1
- package/dist/views/Edit/index.d.ts.map +1 -1
- package/dist/views/Edit/index.js.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.d.ts +2 -2
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.d.ts.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.js.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/types.d.ts +2 -2
- package/dist/views/HierarchyList/HierarchyTable/types.d.ts.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/types.js.map +1 -1
- package/dist/views/List/createSerializableValue.d.ts.map +1 -1
- package/dist/views/List/extractRelationshipDisplayValue.d.ts.map +1 -1
- package/dist/views/List/extractValueOrRelationshipID.d.ts.map +1 -1
- package/dist/views/List/generateListViewMetadata.d.ts.map +1 -1
- package/dist/views/List/handleGroupBy.d.ts.map +1 -1
- package/dist/views/List/handleHierarchy.d.ts +1 -1
- package/dist/views/List/handleHierarchy.d.ts.map +1 -1
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/renderListViewSlots.d.ts.map +1 -1
- package/dist/views/List/resolveAllFilterOptions.d.ts.map +1 -1
- package/dist/views/List/transformColumnsToSelect.d.ts.map +1 -1
- package/dist/views/NotFound/page.d.ts.map +1 -1
- package/dist/views/Root/generateCustomViewMetadata.d.ts.map +1 -1
- package/dist/views/Root/generatePageMetadata.d.ts.map +1 -1
- package/dist/views/Root/getCustomCollectionViewByRoute.d.ts +1 -1
- package/dist/views/Root/getCustomCollectionViewByRoute.d.ts.map +1 -1
- package/dist/views/Root/getCustomGlobalViewByRoute.d.ts +1 -1
- package/dist/views/Root/getCustomGlobalViewByRoute.d.ts.map +1 -1
- package/dist/views/Root/getCustomViewByKey.d.ts.map +1 -1
- package/dist/views/Root/getCustomViewByRoute.d.ts.map +1 -1
- package/dist/views/Root/getRouteData.d.ts.map +1 -1
- package/dist/views/Root/index.d.ts.map +1 -1
- package/dist/views/Unauthorized/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.d.ts.map +1 -1
- package/dist/views/Version/SelectComparison/VersionDrawer/index.d.ts.map +1 -1
- package/dist/views/Versions/buildColumns.d.ts +1 -1
- package/dist/views/Versions/buildColumns.d.ts.map +1 -1
- package/dist/views/Versions/fetchVersions.d.ts +4 -4
- package/dist/views/Versions/fetchVersions.d.ts.map +1 -1
- package/dist/widgets/CollectionCards/getCollectionCardsData.d.ts +2 -2
- package/dist/widgets/CollectionCards/getCollectionCardsData.d.ts.map +1 -1
- package/dist/widgets/CollectionCards/getCollectionCardsData.js.map +1 -1
- package/dist/widgets/CollectionCards/index.client.js.map +1 -1
- package/dist/widgets/WidgetCard/index.css +1 -1
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/utilities/api.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,GAAG;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC,GAAG,WAAW,CAAA;AAEf,eAAO,MAAM,QAAQ;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/utilities/api.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,GAAG;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC,GAAG,WAAW,CAAA;AAEf,eAAO,MAAM,QAAQ;IACnB,MAAM,QAAQ,MAAM,YAAW,WAAW,KAAqB,OAAO,CAAC,QAAQ,CAAC;IAehF,GAAG,QAAQ,MAAM,YAAW,UAAU,KAAqB,OAAO,CAAC,QAAQ,CAAC;IAW5E,KAAK,QAAQ,MAAM,YAAW,WAAW,KAAqB,OAAO,CAAC,QAAQ,CAAC;IAe/E,IAAI,QAAQ,MAAM,YAAW,WAAW,KAAqB,OAAO,CAAC,QAAQ,CAAC;IAe9E,GAAG,QAAQ,MAAM,YAAW,WAAW,KAAqB,OAAO,CAAC,QAAQ,CAAC;CAc9E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/buildClientFieldSchemaMap/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EACV,YAAY,EAEZ,oBAAoB,EACpB,cAAc,EACd,OAAO,EAER,MAAM,SAAS,CAAA;AAiBhB;;GAEG;AACH,eAAO,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/buildClientFieldSchemaMap/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EACV,YAAY,EAEZ,oBAAoB,EACpB,cAAc,EACd,OAAO,EAER,MAAM,SAAS,CAAA;AAiBhB;;GAEG;AACH,eAAO,MAAM,yBAAyB,SAAU;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,YAAY,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,cAAc,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,KAAG;IAAE,oBAAoB,EAAE,oBAAoB,CAAA;CA8E/C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../../src/utilities/buildClientFieldSchemaMap/traverseFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAEV,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,OAAO,EACP,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAKhB,KAAK,IAAI,GAAG;IACV,eAAe,EAAE,oBAAoB,CAAA;IACrC,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,CAAC,WAAW,GAAG,gBAAgB,CAAC,EAAE,CAAA;IAC1C,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,cAAc,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../../src/utilities/buildClientFieldSchemaMap/traverseFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAEV,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,OAAO,EACP,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAKhB,KAAK,IAAI,GAAG;IACV,eAAe,EAAE,oBAAoB,CAAA;IACrC,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,CAAC,WAAW,GAAG,gBAAgB,CAAC,EAAE,CAAA;IAC1C,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,cAAc,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,cAAc,sGASxB,IAAI,SA+LN,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/buildFieldSchemaMap/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAS,cAAc,EAAE,eAAe,EAAa,MAAM,SAAS,CAAA;AAqBhF;;GAEG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/buildFieldSchemaMap/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAS,cAAc,EAAE,eAAe,EAAa,MAAM,SAAS,CAAA;AAqBhF;;GAEG;AACH,eAAO,MAAM,mBAAmB,SAAU;IACxC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,eAAe,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,IAAI,CAAA;IACV,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,KAAG;IAAE,cAAc,EAAE,cAAc,CAAA;CAyEnC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../../src/utilities/buildFieldSchemaMap/traverseFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAKjF,KAAK,IAAI,GAAG;IACV,MAAM,EAAE,eAAe,CAAA;IACvB,MAAM,EAAE,CAAC,KAAK,GAAG,UAAU,CAAC,EAAE,CAAA;IAC9B,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,cAAc,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../../src/utilities/buildFieldSchemaMap/traverseFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAKjF,KAAK,IAAI,GAAG;IACV,MAAM,EAAE,eAAe,CAAA;IACvB,MAAM,EAAE,CAAC,KAAK,GAAG,UAAU,CAAC,EAAE,CAAA;IAC9B,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,cAAc,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,cAAc,4EAOxB,IAAI,SAoIN,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { BuildFormStateArgs, ClientConfig,
|
|
1
|
+
import type { BuildFormStateArgs, ClientConfig, ErrorResult, FormState, ServerFunction, User } from 'payload';
|
|
2
2
|
export type LockedState = {
|
|
3
3
|
isLocked: boolean;
|
|
4
4
|
lastEditedAt: string;
|
|
5
|
-
user?:
|
|
5
|
+
user?: number | string | User;
|
|
6
6
|
};
|
|
7
7
|
export type StaleDataState = {
|
|
8
8
|
currentUpdatedAt: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildFormState.d.ts","sourceRoot":"","sources":["../../src/utilities/buildFormState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"buildFormState.d.ts","sourceRoot":"","sources":["../../src/utilities/buildFormState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,SAAS,EACT,cAAc,EACd,IAAI,EACL,MAAM,SAAS,CAAA;AAehB,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,KAAK,2BAA2B,GAAG;IACjC,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,cAAc,CAAC,EAAE,KAAK,CAAA;IACtB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,cAAc,CAAC,EAAE,KAAK,CAAA;IACtB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GAAG,CACA;IACE,OAAO,EAAE,MAAM,CAAA;CAChB,GACD,WAAW,CACd,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAAG,2BAA2B,CAAA;AAE1F,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAChD,kBAAkB,EAClB,OAAO,CAAC,oBAAoB,CAAC,CAwB9B,CAAA;AAED,eAAO,MAAM,cAAc,SACnB,kBAAkB,KACvB,OAAO,CAAC,2BAA2B,CAuNrC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildFormState.js","names":["canAccessAdmin","formatErrors","UnauthorizedError","getSelectMode","reduceFieldsToValues","fieldSchemasToFormState","renderField","getClientConfig","getClientSchemaMap","getSchemaMap","handleFormStateLocking","handleLivePreview","handlePreview","handleStaleDataCheck","buildFormStateHandler","args","req","res","buildFormState","err","payload","logger","error","msg","message","id","idFromArgs","checkForStaleData","collectionSlug","data","incomingData","docPermissions","docPreferences","documentFormState","formState","globalSlug","initialBlockData","initialBlockFormState","mockRSCs","operation","originalUpdatedAt","readOnly","renderAllFields","i18n","config","returnLivePreviewURL","returnLockStatus","returnPreviewURL","widgetSlug","schemaPath","select","skipClientConfigAuth","skipValidation","updateLastEdited","selectMode","undefined","Error","schemaMap","clientSchemaMap","importMap","user","fieldOrEntityConfig","get","fields","length","type","documentData","blockData","Array","isArray","formStateResult","clientFieldSchemaMap","fieldSchemaMap","permissions","preferences","previousFormState","renderFieldFn","collections","upload","file","lockedStateResult","staleDataStateResult","lockedState","staleDataState","state","livePreviewURL","previewURL"],"sources":["../../src/utilities/buildFormState.ts"],"sourcesContent":["import type {\n BuildFormStateArgs,\n ClientConfig,\n ClientUser,\n ErrorResult,\n FormState,\n ServerFunction,\n} from 'payload'\n\nimport { canAccessAdmin, formatErrors, UnauthorizedError } from 'payload'\nimport { getSelectMode, reduceFieldsToValues } from 'payload/shared'\n\nimport { fieldSchemasToFormState } from '../forms/fieldSchemasToFormState/index.js'\nimport { renderField } from '../forms/fieldSchemasToFormState/renderField.js'\nimport { getClientConfig } from './getClientConfig.js'\nimport { getClientSchemaMap } from './getClientSchemaMap.js'\nimport { getSchemaMap } from './getSchemaMap.js'\nimport { handleFormStateLocking } from './handleFormStateLocking.js'\nimport { handleLivePreview } from './handleLivePreview.js'\nimport { handlePreview } from './handlePreview.js'\nimport { handleStaleDataCheck } from './handleStaleDataCheck.js'\n\nexport type LockedState = {\n isLocked: boolean\n lastEditedAt: string\n user?: ClientUser | number | string\n}\n\nexport type StaleDataState = {\n currentUpdatedAt: string\n isStale: boolean\n}\n\ntype BuildFormStateSuccessResult = {\n clientConfig?: ClientConfig\n errors?: never\n indexPath?: string\n livePreviewURL?: string\n lockedState?: LockedState\n previewURL?: string\n staleDataState?: StaleDataState\n state: FormState\n}\n\ntype BuildFormStateErrorResult = {\n livePreviewURL?: never\n lockedState?: never\n previewURL?: never\n staleDataState?: never\n state?: never\n} & (\n | {\n message: string\n }\n | ErrorResult\n)\n\nexport type BuildFormStateResult = BuildFormStateErrorResult | BuildFormStateSuccessResult\n\nexport const buildFormStateHandler: ServerFunction<\n BuildFormStateArgs,\n Promise<BuildFormStateResult>\n> = async (args) => {\n const { req } = args\n\n try {\n await canAccessAdmin({ req })\n const res = await buildFormState(args)\n\n return res\n } catch (err) {\n req.payload.logger.error({ err, msg: `There was an error building form state` })\n\n if (err.message === 'Could not find field schema for given path') {\n return {\n message: err.message,\n }\n }\n\n if (err.message === 'Unauthorized') {\n throw new UnauthorizedError()\n }\n\n return formatErrors(err)\n }\n}\n\nexport const buildFormState = async (\n args: BuildFormStateArgs,\n): Promise<BuildFormStateSuccessResult> => {\n const {\n id: idFromArgs,\n checkForStaleData,\n collectionSlug,\n data: incomingData,\n docPermissions,\n docPreferences,\n documentFormState,\n formState,\n globalSlug,\n initialBlockData,\n initialBlockFormState,\n mockRSCs,\n operation,\n originalUpdatedAt,\n readOnly,\n renderAllFields,\n req,\n req: {\n i18n,\n payload,\n payload: { config },\n },\n returnLivePreviewURL,\n returnLockStatus,\n returnPreviewURL,\n widgetSlug,\n schemaPath = collectionSlug || globalSlug || widgetSlug,\n select,\n skipClientConfigAuth,\n skipValidation,\n updateLastEdited,\n } = args\n\n const selectMode = select ? getSelectMode(select) : undefined\n\n if (!collectionSlug && !globalSlug && !widgetSlug) {\n throw new Error('Either collectionSlug, globalSlug, or widgetSlug must be provided')\n }\n\n const schemaMap = getSchemaMap({\n collectionSlug,\n config,\n globalSlug,\n i18n,\n widgetSlug,\n })\n\n const clientSchemaMap = getClientSchemaMap({\n collectionSlug,\n config: getClientConfig({\n config,\n i18n,\n importMap: req.payload.importMap,\n user: skipClientConfigAuth ? true : req.user,\n }),\n globalSlug,\n i18n,\n payload,\n schemaMap,\n widgetSlug,\n })\n\n const id = collectionSlug ? idFromArgs : undefined\n const fieldOrEntityConfig = schemaMap.get(schemaPath)\n\n if (!fieldOrEntityConfig) {\n throw new Error(`Could not find \"${schemaPath}\" in the fieldSchemaMap`)\n }\n\n if (\n (!('fields' in fieldOrEntityConfig) ||\n !fieldOrEntityConfig.fields ||\n !fieldOrEntityConfig.fields.length) &&\n 'type' in fieldOrEntityConfig &&\n fieldOrEntityConfig.type !== 'blocks'\n ) {\n throw new Error(\n `The field found in fieldSchemaMap for \"${schemaPath}\" does not contain any subfields.`,\n )\n }\n\n // If there is form state but no data, deduce data from that form state, e.g. on initial load\n // Otherwise, use the incoming data as the source of truth, e.g. on subsequent saves\n const data = incomingData || reduceFieldsToValues(formState, true)\n\n let documentData = undefined\n\n if (documentFormState) {\n documentData = reduceFieldsToValues(documentFormState, true)\n }\n\n let blockData = initialBlockData\n\n if (initialBlockFormState) {\n blockData = reduceFieldsToValues(initialBlockFormState, true)\n }\n\n /**\n * When building state for sub schemas we need to adjust:\n * - `fields`\n * - `parentSchemaPath`\n * - `parentPath`\n *\n * Type assertion is fine because we wrap sub schemas in an array\n * so we can safely map over them within `fieldSchemasToFormState`\n */\n const fields = Array.isArray(fieldOrEntityConfig)\n ? fieldOrEntityConfig\n : 'fields' in fieldOrEntityConfig\n ? fieldOrEntityConfig.fields\n : [fieldOrEntityConfig]\n\n // Ensure data.id is present during form state requests, where the data\n // is passed from the client as an argument, without the ID\n if (!data.id && id) {\n data.id = id\n }\n\n const formStateResult = await fieldSchemasToFormState({\n id,\n clientFieldSchemaMap: clientSchemaMap,\n collectionSlug,\n data,\n documentData,\n fields,\n fieldSchemaMap: schemaMap,\n globalSlug,\n initialBlockData: blockData,\n mockRSCs,\n operation,\n permissions: docPermissions?.fields || {},\n preferences: docPreferences || { fields: {} },\n previousFormState: formState,\n readOnly,\n renderAllFields,\n renderFieldFn: renderField,\n req,\n schemaPath,\n select,\n selectMode,\n skipValidation,\n })\n\n // Maintain form state of auth / upload fields\n if (collectionSlug && formState) {\n if (payload.collections[collectionSlug]?.config?.upload && formState.file) {\n formStateResult.file = formState.file\n }\n }\n\n let lockedStateResult: LockedState | undefined\n\n if (returnLockStatus) {\n lockedStateResult = await handleFormStateLocking({\n id,\n collectionSlug,\n globalSlug,\n req,\n updateLastEdited,\n })\n }\n\n let staleDataStateResult: StaleDataState | undefined\n\n if (checkForStaleData && originalUpdatedAt && ((collectionSlug && id) || globalSlug)) {\n staleDataStateResult = await handleStaleDataCheck({\n id,\n collectionSlug,\n globalSlug,\n originalUpdatedAt,\n req,\n })\n }\n\n const res: BuildFormStateSuccessResult = {\n lockedState: lockedStateResult,\n staleDataState: staleDataStateResult,\n state: formStateResult,\n }\n\n if (returnLivePreviewURL) {\n const { livePreviewURL } = await handleLivePreview({\n collectionSlug,\n config,\n data,\n globalSlug,\n req,\n })\n\n // Important: only set this when not undefined,\n // Otherwise it will travel through the network as `$undefined`\n if (livePreviewURL) {\n res.livePreviewURL = livePreviewURL\n }\n }\n\n if (returnPreviewURL) {\n const { previewURL } = await handlePreview({\n collectionSlug,\n config,\n data,\n globalSlug,\n req,\n })\n\n // Important: only set this when not undefined,\n // Otherwise it will travel through the network as `$undefined`\n if (previewURL) {\n res.previewURL = previewURL\n }\n }\n\n return res\n}\n"],"mappings":"AASA,SAASA,cAAc,EAAEC,YAAY,EAAEC,iBAAiB,QAAQ;AAChE,SAASC,aAAa,EAAEC,oBAAoB,QAAQ;AAEpD,SAASC,uBAAuB,QAAQ;AACxC,SAASC,WAAW,QAAQ;AAC5B,SAASC,eAAe,QAAQ;AAChC,SAASC,kBAAkB,QAAQ;AACnC,SAASC,YAAY,QAAQ;AAC7B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,aAAa,QAAQ;AAC9B,SAASC,oBAAoB,QAAQ;AAuCrC,OAAO,MAAMC,qBAAA,GAGT,MAAOC,IAAA;EACT,MAAM;IAAEC;EAAG,CAAE,GAAGD,IAAA;EAEhB,IAAI;IACF,MAAMf,cAAA,CAAe;MAAEgB;IAAI;IAC3B,MAAMC,GAAA,GAAM,MAAMC,cAAA,CAAeH,IAAA;IAEjC,OAAOE,GAAA;EACT,EAAE,OAAOE,GAAA,EAAK;IACZH,GAAA,CAAII,OAAO,CAACC,MAAM,CAACC,KAAK,CAAC;MAAEH,GAAA;MAAKI,GAAA,EAAK;IAAyC;IAE9E,IAAIJ,GAAA,CAAIK,OAAO,KAAK,8CAA8C;MAChE,OAAO;QACLA,OAAA,EAASL,GAAA,CAAIK;MACf;IACF;IAEA,IAAIL,GAAA,CAAIK,OAAO,KAAK,gBAAgB;MAClC,MAAM,IAAItB,iBAAA;IACZ;IAEA,OAAOD,YAAA,CAAakB,GAAA;EACtB;AACF;AAEA,OAAO,MAAMD,cAAA,GAAiB,MAC5BH,IAAA;EAEA,MAAM;IACJU,EAAA,EAAIC,UAAU;IACdC,iBAAiB;IACjBC,cAAc;IACdC,IAAA,EAAMC,YAAY;IAClBC,cAAc;IACdC,cAAc;IACdC,iBAAiB;IACjBC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;IAEA;IACA;IACA,IAAIsE,UAAA,EAAY;MACdrE,GAAA,CAAIqE,UAAU,GAAGA,UAAA;IACnB;EACF;EAEA,OAAOrE,GAAA;AACT","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"buildFormState.js","names":["canAccessAdmin","formatErrors","UnauthorizedError","getSelectMode","reduceFieldsToValues","fieldSchemasToFormState","renderField","getClientConfig","getClientSchemaMap","getSchemaMap","handleFormStateLocking","handleLivePreview","handlePreview","handleStaleDataCheck","buildFormStateHandler","args","req","res","buildFormState","err","payload","logger","error","msg","message","id","idFromArgs","checkForStaleData","collectionSlug","data","incomingData","docPermissions","docPreferences","documentFormState","formState","globalSlug","initialBlockData","initialBlockFormState","mockRSCs","operation","originalUpdatedAt","readOnly","renderAllFields","i18n","config","returnLivePreviewURL","returnLockStatus","returnPreviewURL","widgetSlug","schemaPath","select","skipClientConfigAuth","skipValidation","updateLastEdited","selectMode","undefined","Error","schemaMap","clientSchemaMap","importMap","user","fieldOrEntityConfig","get","fields","length","type","documentData","blockData","Array","isArray","formStateResult","clientFieldSchemaMap","fieldSchemaMap","permissions","preferences","previousFormState","renderFieldFn","collections","upload","file","lockedStateResult","staleDataStateResult","lockedState","staleDataState","state","livePreviewURL","previewURL"],"sources":["../../src/utilities/buildFormState.ts"],"sourcesContent":["import type {\n BuildFormStateArgs,\n ClientConfig,\n ErrorResult,\n FormState,\n ServerFunction,\n User,\n} from 'payload'\n\nimport { canAccessAdmin, formatErrors, UnauthorizedError } from 'payload'\nimport { getSelectMode, reduceFieldsToValues } from 'payload/shared'\n\nimport { fieldSchemasToFormState } from '../forms/fieldSchemasToFormState/index.js'\nimport { renderField } from '../forms/fieldSchemasToFormState/renderField.js'\nimport { getClientConfig } from './getClientConfig.js'\nimport { getClientSchemaMap } from './getClientSchemaMap.js'\nimport { getSchemaMap } from './getSchemaMap.js'\nimport { handleFormStateLocking } from './handleFormStateLocking.js'\nimport { handleLivePreview } from './handleLivePreview.js'\nimport { handlePreview } from './handlePreview.js'\nimport { handleStaleDataCheck } from './handleStaleDataCheck.js'\n\nexport type LockedState = {\n isLocked: boolean\n lastEditedAt: string\n user?: number | string | User\n}\n\nexport type StaleDataState = {\n currentUpdatedAt: string\n isStale: boolean\n}\n\ntype BuildFormStateSuccessResult = {\n clientConfig?: ClientConfig\n errors?: never\n indexPath?: string\n livePreviewURL?: string\n lockedState?: LockedState\n previewURL?: string\n staleDataState?: StaleDataState\n state: FormState\n}\n\ntype BuildFormStateErrorResult = {\n livePreviewURL?: never\n lockedState?: never\n previewURL?: never\n staleDataState?: never\n state?: never\n} & (\n | {\n message: string\n }\n | ErrorResult\n)\n\nexport type BuildFormStateResult = BuildFormStateErrorResult | BuildFormStateSuccessResult\n\nexport const buildFormStateHandler: ServerFunction<\n BuildFormStateArgs,\n Promise<BuildFormStateResult>\n> = async (args) => {\n const { req } = args\n\n try {\n await canAccessAdmin({ req })\n const res = await buildFormState(args)\n\n return res\n } catch (err) {\n req.payload.logger.error({ err, msg: `There was an error building form state` })\n\n if (err.message === 'Could not find field schema for given path') {\n return {\n message: err.message,\n }\n }\n\n if (err.message === 'Unauthorized') {\n throw new UnauthorizedError()\n }\n\n return formatErrors(err)\n }\n}\n\nexport const buildFormState = async (\n args: BuildFormStateArgs,\n): Promise<BuildFormStateSuccessResult> => {\n const {\n id: idFromArgs,\n checkForStaleData,\n collectionSlug,\n data: incomingData,\n docPermissions,\n docPreferences,\n documentFormState,\n formState,\n globalSlug,\n initialBlockData,\n initialBlockFormState,\n mockRSCs,\n operation,\n originalUpdatedAt,\n readOnly,\n renderAllFields,\n req,\n req: {\n i18n,\n payload,\n payload: { config },\n },\n returnLivePreviewURL,\n returnLockStatus,\n returnPreviewURL,\n widgetSlug,\n schemaPath = collectionSlug || globalSlug || widgetSlug,\n select,\n skipClientConfigAuth,\n skipValidation,\n updateLastEdited,\n } = args\n\n const selectMode = select ? getSelectMode(select) : undefined\n\n if (!collectionSlug && !globalSlug && !widgetSlug) {\n throw new Error('Either collectionSlug, globalSlug, or widgetSlug must be provided')\n }\n\n const schemaMap = getSchemaMap({\n collectionSlug,\n config,\n globalSlug,\n i18n,\n widgetSlug,\n })\n\n const clientSchemaMap = getClientSchemaMap({\n collectionSlug,\n config: getClientConfig({\n config,\n i18n,\n importMap: req.payload.importMap,\n user: skipClientConfigAuth ? true : req.user,\n }),\n globalSlug,\n i18n,\n payload,\n schemaMap,\n widgetSlug,\n })\n\n const id = collectionSlug ? idFromArgs : undefined\n const fieldOrEntityConfig = schemaMap.get(schemaPath)\n\n if (!fieldOrEntityConfig) {\n throw new Error(`Could not find \"${schemaPath}\" in the fieldSchemaMap`)\n }\n\n if (\n (!('fields' in fieldOrEntityConfig) ||\n !fieldOrEntityConfig.fields ||\n !fieldOrEntityConfig.fields.length) &&\n 'type' in fieldOrEntityConfig &&\n fieldOrEntityConfig.type !== 'blocks'\n ) {\n throw new Error(\n `The field found in fieldSchemaMap for \"${schemaPath}\" does not contain any subfields.`,\n )\n }\n\n // If there is form state but no data, deduce data from that form state, e.g. on initial load\n // Otherwise, use the incoming data as the source of truth, e.g. on subsequent saves\n const data = incomingData || reduceFieldsToValues(formState, true)\n\n let documentData = undefined\n\n if (documentFormState) {\n documentData = reduceFieldsToValues(documentFormState, true)\n }\n\n let blockData = initialBlockData\n\n if (initialBlockFormState) {\n blockData = reduceFieldsToValues(initialBlockFormState, true)\n }\n\n /**\n * When building state for sub schemas we need to adjust:\n * - `fields`\n * - `parentSchemaPath`\n * - `parentPath`\n *\n * Type assertion is fine because we wrap sub schemas in an array\n * so we can safely map over them within `fieldSchemasToFormState`\n */\n const fields = Array.isArray(fieldOrEntityConfig)\n ? fieldOrEntityConfig\n : 'fields' in fieldOrEntityConfig\n ? fieldOrEntityConfig.fields\n : [fieldOrEntityConfig]\n\n // Ensure data.id is present during form state requests, where the data\n // is passed from the client as an argument, without the ID\n if (!data.id && id) {\n data.id = id\n }\n\n const formStateResult = await fieldSchemasToFormState({\n id,\n clientFieldSchemaMap: clientSchemaMap,\n collectionSlug,\n data,\n documentData,\n fields,\n fieldSchemaMap: schemaMap,\n globalSlug,\n initialBlockData: blockData,\n mockRSCs,\n operation,\n permissions: docPermissions?.fields || {},\n preferences: docPreferences || { fields: {} },\n previousFormState: formState,\n readOnly,\n renderAllFields,\n renderFieldFn: renderField,\n req,\n schemaPath,\n select,\n selectMode,\n skipValidation,\n })\n\n // Maintain form state of auth / upload fields\n if (collectionSlug && formState) {\n if (payload.collections[collectionSlug]?.config?.upload && formState.file) {\n formStateResult.file = formState.file\n }\n }\n\n let lockedStateResult: LockedState | undefined\n\n if (returnLockStatus) {\n lockedStateResult = await handleFormStateLocking({\n id,\n collectionSlug,\n globalSlug,\n req,\n updateLastEdited,\n })\n }\n\n let staleDataStateResult: StaleDataState | undefined\n\n if (checkForStaleData && originalUpdatedAt && ((collectionSlug && id) || globalSlug)) {\n staleDataStateResult = await handleStaleDataCheck({\n id,\n collectionSlug,\n globalSlug,\n originalUpdatedAt,\n req,\n })\n }\n\n const res: BuildFormStateSuccessResult = {\n lockedState: lockedStateResult,\n staleDataState: staleDataStateResult,\n state: formStateResult,\n }\n\n if (returnLivePreviewURL) {\n const { livePreviewURL } = await handleLivePreview({\n collectionSlug,\n config,\n data,\n globalSlug,\n req,\n })\n\n // Important: only set this when not undefined,\n // Otherwise it will travel through the network as `$undefined`\n if (livePreviewURL) {\n res.livePreviewURL = livePreviewURL\n }\n }\n\n if (returnPreviewURL) {\n const { previewURL } = await handlePreview({\n collectionSlug,\n config,\n data,\n globalSlug,\n req,\n })\n\n // Important: only set this when not undefined,\n // Otherwise it will travel through the network as `$undefined`\n if (previewURL) {\n res.previewURL = previewURL\n }\n }\n\n return res\n}\n"],"mappings":"AASA,SAASA,cAAc,EAAEC,YAAY,EAAEC,iBAAiB,QAAQ;AAChE,SAASC,aAAa,EAAEC,oBAAoB,QAAQ;AAEpD,SAASC,uBAAuB,QAAQ;AACxC,SAASC,WAAW,QAAQ;AAC5B,SAASC,eAAe,QAAQ;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AU6C,IAAI;IACvC;EACF;EAEA,IAAIC,iBAAA;EAEJ,IAAIlC,gBAAA,EAAkB;IACpBkC,iBAAA,GAAoB,MAAMtE,sBAAA,CAAuB;MAC/Ce,EAAA;MACAG,cAAA;MACAO,UAAA;MACAnB,GAAA;MACAqC;IACF;EACF;EAEA,IAAI4B,oBAAA;EAEJ,IAAItD,iBAAA,IAAqBa,iBAAA,KAAsBZ,cAAC,IAAkBH,EAAA,IAAOU,UAAS,GAAI;IACpF8C,oBAAA,GAAuB,MAAMpE,oBAAA,CAAqB;MAChDY,EAAA;MACAG,cAAA;MACAO,UAAA;MACAK,iBAAA;MACAxB;IACF;EACF;EAEA,MAAMC,GAAA,GAAmC;IACvCiE,WAAA,EAAaF,iBAAA;IACbG,cAAA,EAAgBF,oBAAA;IAChBG,KAAA,EAAOd;EACT;EAEA,IAAIzB,oBAAA,EAAsB;IACxB,MAAM;MAAEwC;IAAc,CAAE,GAAG,MAAM1E,iBAAA,CAAkB;MACjDiB,cAAA;MACAgB,MAAA;MACAf,IAAA;MACAM,UAAA;MACAnB;IACF;IAEA;IACA;IACA,IAAIqE,cAAA,EAAgB;MAClBpE,GAAA,CAAIoE,cAAc,GAAGA,cAAA;IACvB;EACF;EAEA,IAAItC,gBAAA,EAAkB;IACpB,MAAM;MAAEuC;IAAU,CAAE,GAAG,MAAM1E,aAAA,CAAc;MACzCgB,cAAA;MACAgB,MAAA;MACAf,IAAA;MACAM,UAAA;MACAnB;IACF;IAEA;IACA;IACA,IAAIsE,UAAA,EAAY;MACdrE,GAAA,CAAIqE,UAAU,GAAGA,UAAA;IACnB;EACF;EAEA,OAAOrE,GAAA;AACT","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkDependencies.d.ts","sourceRoot":"","sources":["../../src/utilities/checkDependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,iBAAiB,IAAI,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAmBjG,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAA;AAElF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"checkDependencies.d.ts","sourceRoot":"","sources":["../../src/utilities/checkDependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,iBAAiB,IAAI,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAmBjG,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAA;AAElF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,gBAAgB,qBAAqB,SAkClE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combineFieldLabel.d.ts","sourceRoot":"","sources":["../../src/utilities/combineFieldLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAO1C,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"combineFieldLabel.d.ts","sourceRoot":"","sources":["../../src/utilities/combineFieldLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAO1C,eAAO,MAAM,iBAAiB,oCAI3B;IACD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB,KAAG,KAAK,CAAC,SAiBT,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyDataFromLocale.d.ts","sourceRoot":"","sources":["../../src/utilities/copyDataFromLocale.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,cAAc,EAInB,KAAK,cAAc,EACnB,KAAK,cAAc,EAEpB,MAAM,SAAS,CAAA;AAKhB,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,GAAG,EAAE,cAAc,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AA8LD,eAAO,MAAM,yBAAyB,EAAE,cAAc,CAAC,sBAAsB,CAc5E,CAAA;AAED,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"copyDataFromLocale.d.ts","sourceRoot":"","sources":["../../src/utilities/copyDataFromLocale.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,cAAc,EAInB,KAAK,cAAc,EACnB,KAAK,cAAc,EAEpB,MAAM,SAAS,CAAA;AAKhB,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,GAAG,EAAE,cAAc,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AA8LD,eAAO,MAAM,yBAAyB,EAAE,cAAc,CAAC,sBAAsB,CAc5E,CAAA;AAED,eAAO,MAAM,kBAAkB,SAAgB,sBAAsB,0CAwGpE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterOutUploadFields.d.ts","sourceRoot":"","sources":["../../src/utilities/filterOutUploadFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElD,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"filterOutUploadFields.d.ts","sourceRoot":"","sources":["../../src/utilities/filterOutUploadFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElD,eAAO,MAAM,qBAAqB,WAAY,mBAAmB,EAAE,KAAG,mBAAmB,EAiBxF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findLocaleFromCode.d.ts","sourceRoot":"","sources":["../../src/utilities/findLocaleFromCode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAIlE,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"findLocaleFromCode.d.ts","sourceRoot":"","sources":["../../src/utilities/findLocaleFromCode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAIlE,eAAO,MAAM,kBAAkB,uBACT,2BAA2B,UACvC,MAAM,KACb,MAAM,GAAG,IAMX,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatAbsoluteURL.d.ts","sourceRoot":"","sources":["../../src/utilities/formatAbsoluteURL.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"formatAbsoluteURL.d.ts","sourceRoot":"","sources":["../../src/utilities/formatAbsoluteURL.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,gBAAiB,MAAM,QAGpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatDateTitle.d.ts","sourceRoot":"","sources":["../../../src/utilities/formatDocTitle/formatDateTitle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAKhE,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACxC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAClD,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"formatDateTitle.d.ts","sourceRoot":"","sources":["../../../src/utilities/formatDocTitle/formatDateTitle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAKhE,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACxC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAClD,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,UAAU,sCAAuC,cAAc,KAAG,MAoB9E,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACxC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;CACnD,CAAA;AAED,eAAO,MAAM,eAAe,mBAAoB,mBAAmB,KAAG,MAGrE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatRelationshipTitle.d.ts","sourceRoot":"","sources":["../../../src/utilities/formatDocTitle/formatRelationshipTitle.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"formatRelationshipTitle.d.ts","sourceRoot":"","sources":["../../../src/utilities/formatDocTitle/formatRelationshipTitle.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,iBAAW,MAkB9C,CAAA"}
|
|
@@ -3,7 +3,7 @@ import type { ClientCollectionConfig, ClientGlobalConfig, SanitizedConfig, TypeW
|
|
|
3
3
|
export declare const formatDocTitle: ({ collectionConfig, data, dateFormat: dateFormatFromConfig, fallback, globalConfig, i18n, }: {
|
|
4
4
|
collectionConfig?: ClientCollectionConfig;
|
|
5
5
|
data: TypeWithID;
|
|
6
|
-
dateFormat: SanitizedConfig[
|
|
6
|
+
dateFormat: SanitizedConfig['admin']['dateFormat'];
|
|
7
7
|
fallback?: object | string;
|
|
8
8
|
globalConfig?: ClientGlobalConfig;
|
|
9
9
|
i18n: I18n<any, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/formatDocTitle/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACX,MAAM,SAAS,CAAA;AAQhB,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/formatDocTitle/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACX,MAAM,SAAS,CAAA;AAQhB,eAAO,MAAM,cAAc,gGAOxB;IACD,gBAAgB,CAAC,EAAE,sBAAsB,CAAA;IACzC,IAAI,EAAE,UAAU,CAAA;IAChB,UAAU,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAA;IAClD,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CACrB,KAAG,MAmDH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatFields.d.ts","sourceRoot":"","sources":["../../src/utilities/formatFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAIpC,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"formatFields.d.ts","sourceRoot":"","sources":["../../src/utilities/formatFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAIpC,eAAO,MAAM,YAAY,WAAY,KAAK,EAAE,cAAc,OAAO,KAAG,KAAK,EACqB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatMetadata.d.ts","sourceRoot":"","sources":["../../src/utilities/formatMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AA4DzC,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"formatMetadata.d.ts","sourceRoot":"","sources":["../../src/utilities/formatMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AA4DzC,eAAO,MAAM,cAAc,SACnB;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,KACxC,OAAO,CAAC,UAAU,CA2FpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateFieldID.d.ts","sourceRoot":"","sources":["../../src/utilities/generateFieldID.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"generateFieldID.d.ts","sourceRoot":"","sources":["../../src/utilities/generateFieldID.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,SAAU,MAAM,aAAa,MAAM,QAAQ,MAAM,WAK5E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getColumns.d.ts","sourceRoot":"","sources":["../../src/utilities/getColumns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAOhB,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"getColumns.d.ts","sourceRoot":"","sources":["../../src/utilities/getColumns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAOhB,eAAO,MAAM,UAAU,oFAOpB;IACD,YAAY,EAAE,YAAY,CAAA;IAC1B,gBAAgB,CAAC,EAAE,sBAAsB,CAAA;IACzC,cAAc,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACjC,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,IAAI,EAAE,UAAU,CAAA;IAChB,WAAW,CAAC,EAAE,oBAAoB,CAAA;CACnC,uBAoDA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDisplayedFieldValue.d.ts","sourceRoot":"","sources":["../../src/utilities/getDisplayedFieldValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAM1C;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"getDisplayedFieldValue.d.ts","sourceRoot":"","sources":["../../src/utilities/getDisplayedFieldValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAM1C;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,aAAc,GAAG,SAAS,WAAW,QAAQ,UAAU,QAgBzF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDocPreferences.d.ts","sourceRoot":"","sources":["../../src/utilities/getDocPreferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAIjE,KAAK,IAAI,GAAG;IACV,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAED,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"getDocPreferences.d.ts","sourceRoot":"","sources":["../../src/utilities/getDocPreferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAIjE,KAAK,IAAI,GAAG;IACV,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAED,eAAO,MAAM,iBAAiB,uDAM3B,IAAI,KAAG,OAAO,CAAC,mBAAmB,CA2CpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDocumentData.d.ts","sourceRoot":"","sources":["../../src/utilities/getDocumentData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAEX,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,IAAI,EACV,MAAM,SAAS,CAAA;AAIhB,KAAK,IAAI,GAAG;IACV,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ,CAAA;AAED,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"getDocumentData.d.ts","sourceRoot":"","sources":["../../src/utilities/getDocumentData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAEX,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,IAAI,EACV,MAAM,SAAS,CAAA;AAIhB,KAAK,IAAI,GAAG;IACV,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ,CAAA;AAED,eAAO,MAAM,eAAe,qFASzB,IAAI,KAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CA4C5D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDocumentPermissions.d.ts","sourceRoot":"","sources":["../../src/utilities/getDocumentPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,yBAAyB,EACzB,4BAA4B,EAC5B,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAQhB,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"getDocumentPermissions.d.ts","sourceRoot":"","sources":["../../src/utilities/getDocumentPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,yBAAyB,EACzB,4BAA4B,EAC5B,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAQhB,eAAO,MAAM,sBAAsB,SAAgB;IACjD,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,GAAG,EAAE,cAAc,CAAA;CACpB,KAAG,OAAO,CAAC;IACV,cAAc,EAAE,4BAA4B,CAAA;IAC5C,mBAAmB,EAAE,OAAO,CAAA;IAC5B,oBAAoB,EAAE,OAAO,CAAA;IAC7B,iBAAiB,EAAE,OAAO,CAAA;IAC1B,kBAAkB,EAAE,OAAO,CAAA;CAC5B,CA0HA,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PayloadRequest, User } from 'payload';
|
|
2
2
|
export declare function getGlobalData(req: PayloadRequest): Promise<{
|
|
3
3
|
data: {
|
|
4
4
|
_isLocked: boolean;
|
|
5
5
|
_lastEditedAt: string;
|
|
6
|
-
_userEditing:
|
|
6
|
+
_userEditing: number | string | User;
|
|
7
7
|
};
|
|
8
8
|
lockDuration?: number;
|
|
9
9
|
slug: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGlobalData.d.ts","sourceRoot":"","sources":["../../src/utilities/getGlobalData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"getGlobalData.d.ts","sourceRoot":"","sources":["../../src/utilities/getGlobalData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAInD,wBAAsB,aAAa,CAAC,GAAG,EAAE,cAAc;UAU7C;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;KAAE;mBAC1E,MAAM;UACf,MAAM;KAgEf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGlobalData.js","names":["globalLockDurationDefault","getGlobalData","req","payload","config","globalData","globals","length","collections","lockedDocuments","find","collection","depth","overrideAccess","pagination","select","globalSlug","updatedAt","user","where","exists","map","global","lockDuration","lockDocuments","duration","lockedDoc","docs","doc","slug","data","_isLocked","_lastEditedAt","_userEditing","value"],"sources":["../../src/utilities/getGlobalData.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"getGlobalData.js","names":["globalLockDurationDefault","getGlobalData","req","payload","config","globalData","globals","length","collections","lockedDocuments","find","collection","depth","overrideAccess","pagination","select","globalSlug","updatedAt","user","where","exists","map","global","lockDuration","lockDocuments","duration","lockedDoc","docs","doc","slug","data","_isLocked","_lastEditedAt","_userEditing","value"],"sources":["../../src/utilities/getGlobalData.ts"],"sourcesContent":["import type { PayloadRequest, User } from 'payload'\n\nconst globalLockDurationDefault = 300\n\nexport async function getGlobalData(req: PayloadRequest) {\n const {\n payload: { config },\n payload,\n } = req\n // Query locked global documents only if there are globals in the config\n // This type is repeated from DashboardViewServerPropsOnly['globalData'].\n // I thought about moving it to a payload to share it, but we're already\n // exporting all the views props from the next package.\n let globalData: Array<{\n data: { _isLocked: boolean; _lastEditedAt: string; _userEditing: number | string | User }\n lockDuration?: number\n slug: string\n }> = []\n\n if (config.globals.length > 0) {\n if (payload.collections?.['payload-locked-documents']) {\n const lockedDocuments = await payload.find({\n collection: 'payload-locked-documents',\n depth: 1,\n overrideAccess: false,\n pagination: false,\n req,\n select: {\n globalSlug: true,\n updatedAt: true,\n user: true,\n },\n where: {\n globalSlug: {\n exists: true,\n },\n },\n })\n\n // Map over globals to include `lockDuration` and lock data for each global slug\n globalData = config.globals.map((global) => {\n const lockDuration =\n typeof global.lockDocuments === 'object'\n ? global.lockDocuments.duration\n : globalLockDurationDefault\n\n const lockedDoc = lockedDocuments.docs.find((doc) => doc.globalSlug === global.slug)\n\n return {\n slug: global.slug,\n data: {\n _isLocked: !!lockedDoc,\n _lastEditedAt: (lockedDoc?.updatedAt as string) ?? null,\n _userEditing: (lockedDoc?.user as { value?: User })?.value ?? null,\n },\n lockDuration,\n }\n })\n } else {\n // If locked-documents collection doesn't exist, return globals without lock data\n globalData = config.globals.map((global) => {\n const lockDuration =\n typeof global.lockDocuments === 'object'\n ? global.lockDocuments.duration\n : globalLockDurationDefault\n\n return {\n slug: global.slug,\n data: {\n _isLocked: false,\n _lastEditedAt: null,\n _userEditing: null,\n },\n lockDuration,\n }\n })\n }\n }\n\n return globalData\n}\n"],"mappings":"AAEA,MAAMA,yBAAA,GAA4B;AAElC,OAAO,eAAeC,cAAcC,GAAmB;EACrD,MAAM;IACJC,OAAA,EAAS;MAAEC;IAAM,CAAE;IACnBD;EAAO,CACR,GAAGD,GAAA;EACJ;EACA;EACA;EACA;EACA,IAAIG,UAAA,GAIC,EAAE;EAEP,IAAID,MAAA,CAAOE,OAAO,CAACC,MAAM,GAAG,GAAG;IAC7B,IAAIJ,OAAA,CAAQK,WAAW,GAAG,2BAA2B,EAAE;MACrD,MAAMC,eAAA,GAAkB,MAAMN,OAAA,CAAQO,IAAI,CAAC;QACzCC,UAAA,EAAY;QACZC,KAAA,EAAO;QACPC,cAAA,EAAgB;QAChBC,UAAA,EAAY;QACZZ,GAAA;QACAa,MAAA,EAAQ;UACNC,UAAA,EAAY;UACZC,SAAA,EAAW;UACXC,IAAA,EAAM;QACR;QACAC,KAAA,EAAO;UACLH,UAAA,EAAY;YACVI,MAAA,EAAQ;UACV;QACF;MACF;MAEA;MACAf,UAAA,GAAaD,MAAA,CAAOE,OAAO,CAACe,GAAG,CAAEC,MAAA;QAC/B,MAAMC,YAAA,GACJ,OAAOD,MAAA,CAAOE,aAAa,KAAK,WAC5BF,MAAA,CAAOE,aAAa,CAACC,QAAQ,GAC7BzB,yBAAA;QAEN,MAAM0B,SAAA,GAAYjB,eAAA,CAAgBkB,IAAI,CAACjB,IAAI,CAAEkB,GAAA,IAAQA,GAAA,CAAIZ,UAAU,KAAKM,MAAA,CAAOO,IAAI;QAEnF,OAAO;UACLA,IAAA,EAAMP,MAAA,CAAOO,IAAI;UACjBC,IAAA,EAAM;YACJC,SAAA,EAAW,CAAC,CAACL,SAAA;YACbM,aAAA,EAAeN,SAAC,EAAWT,SAAA,IAAwB;YACnDgB,YAAA,EAAcP,SAAC,EAAWR,IAAA,EAA2BgB,KAAA,IAAS;UAChE;UACAX;QACF;MACF;IACF,OAAO;MACL;MACAlB,UAAA,GAAaD,MAAA,CAAOE,OAAO,CAACe,GAAG,CAAEC,MAAA;QAC/B,MAAMC,YAAA,GACJ,OAAOD,MAAA,CAAOE,aAAa,KAAK,WAC5BF,MAAA,CAAOE,aAAa,CAACC,QAAQ,GAC7BzB,yBAAA;QAEN,OAAO;UACL6B,IAAA,EAAMP,MAAA,CAAOO,IAAI;UACjBC,IAAA,EAAM;YACJC,SAAA,EAAW;YACXC,aAAA,EAAe;YACfC,YAAA,EAAc;UAChB;UACAV;QACF;MACF;IACF;EACF;EAEA,OAAOlB,UAAA;AACT","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getHasScheduledPublish.d.ts","sourceRoot":"","sources":["../../src/utilities/getHasScheduledPublish.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAO9F,KAAK,IAAI,GAAG;IACV,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAED,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"getHasScheduledPublish.d.ts","sourceRoot":"","sources":["../../src/utilities/getHasScheduledPublish.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAO9F,KAAK,IAAI,GAAG;IACV,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAED,eAAO,MAAM,sBAAsB,wFAOhC,IAAI,KAAG,OAAO,CAAC,OAAO,CA4BxB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIsLocked.d.ts","sourceRoot":"","sources":["../../src/utilities/getIsLocked.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,yBAAyB,EACzB,qBAAqB,EACrB,IAAI,EAEL,MAAM,SAAS,CAAA;AAMhB,KAAK,IAAI,GAAG;IACV,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,SAAS,EAAE,OAAO,CAAA;IAClB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,KAAK,MAAM,GAAG,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,IAAI,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"getIsLocked.d.ts","sourceRoot":"","sources":["../../src/utilities/getIsLocked.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,yBAAyB,EACzB,qBAAqB,EACrB,IAAI,EAEL,MAAM,SAAS,CAAA;AAMhB,KAAK,IAAI,GAAG;IACV,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,SAAS,EAAE,OAAO,CAAA;IAClB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,KAAK,MAAM,GAAG,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,IAAI,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF,eAAO,MAAM,WAAW,4DAMrB,IAAI,KAAG,MAwFT,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type Direction = 'ltr' | 'rtl';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the `<html dir>` value for a language code. Returns lowercase
|
|
4
|
+
* `'ltr'`/`'rtl'` to match the `[dir='ltr']`/`[dir='rtl']` selectors the admin
|
|
5
|
+
* stylesheet scopes its layout rules under (e.g. the document sidebar divider).
|
|
6
|
+
* Single source of truth shared across framework adapters so the SSR'd `dir`
|
|
7
|
+
* never diverges from what the CSS expects.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getLanguageDir: ({ languageCode }: {
|
|
10
|
+
languageCode: string;
|
|
11
|
+
}) => Direction;
|
|
12
|
+
//# sourceMappingURL=getLanguageDir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLanguageDir.d.ts","sourceRoot":"","sources":["../../src/utilities/getLanguageDir.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,CAAA;AAErC;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,qBAAsB;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,KAAG,SACA,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { rtlLanguages } from '@payloadcms/translations';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the `<html dir>` value for a language code. Returns lowercase
|
|
4
|
+
* `'ltr'`/`'rtl'` to match the `[dir='ltr']`/`[dir='rtl']` selectors the admin
|
|
5
|
+
* stylesheet scopes its layout rules under (e.g. the document sidebar divider).
|
|
6
|
+
* Single source of truth shared across framework adapters so the SSR'd `dir`
|
|
7
|
+
* never diverges from what the CSS expects.
|
|
8
|
+
*/
|
|
9
|
+
export const getLanguageDir = ({
|
|
10
|
+
languageCode
|
|
11
|
+
}) => rtlLanguages.includes(languageCode) ? 'rtl' : 'ltr';
|
|
12
|
+
//# sourceMappingURL=getLanguageDir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLanguageDir.js","names":["rtlLanguages","getLanguageDir","languageCode","includes"],"sources":["../../src/utilities/getLanguageDir.ts"],"sourcesContent":["import { rtlLanguages } from '@payloadcms/translations'\n\nexport type Direction = 'ltr' | 'rtl'\n\n/**\n * Resolves the `<html dir>` value for a language code. Returns lowercase\n * `'ltr'`/`'rtl'` to match the `[dir='ltr']`/`[dir='rtl']` selectors the admin\n * stylesheet scopes its layout rules under (e.g. the document sidebar divider).\n * Single source of truth shared across framework adapters so the SSR'd `dir`\n * never diverges from what the CSS expects.\n */\nexport const getLanguageDir = ({ languageCode }: { languageCode: string }): Direction =>\n (rtlLanguages as readonly string[]).includes(languageCode) ? 'rtl' : 'ltr'\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ;AAI7B;;;;;;;AAOA,OAAO,MAAMC,cAAA,GAAiBA,CAAC;EAAEC;AAAY,CAA4B,KACvEF,YAAC,CAAmCG,QAAQ,CAACD,YAAA,IAAgB,QAAQ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOffsetTop.d.ts","sourceRoot":"","sources":["../../src/utilities/getOffsetTop.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"getOffsetTop.d.ts","sourceRoot":"","sources":["../../src/utilities/getOffsetTop.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,YAAa,WAAW,KAAG,MAenD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRequestHighContrast.d.ts","sourceRoot":"","sources":["../../src/utilities/getRequestHighContrast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,KAAK,0BAA0B,GAAG;IAChC,MAAM,EAAE,eAAe,CAAA;IACvB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"getRequestHighContrast.d.ts","sourceRoot":"","sources":["../../src/utilities/getRequestHighContrast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,KAAK,0BAA0B,GAAG;IAChC,MAAM,EAAE,eAAe,CAAA;IACvB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,sBAAsB,kCAIhC,0BAA0B,KAAG,OAc/B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRequestLanguage.d.ts","sourceRoot":"","sources":["../../src/utilities/getRequestLanguage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1C,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"getRequestLanguage.d.ts","sourceRoot":"","sources":["../../src/utilities/getRequestLanguage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1C,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,kBAAkB,2CAI5B,sBAAsB,KAAG,MAS3B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRequestTheme.d.ts","sourceRoot":"","sources":["../../src/utilities/getRequestTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAgB,KAAK,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"getRequestTheme.d.ts","sourceRoot":"","sources":["../../src/utilities/getRequestTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAgB,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAEvE,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,eAAe,CAAA;IACvB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;CAC5B,CAAA;AAID,eAAO,MAAM,eAAe,iCAAkC,mBAAmB,KAAG,KAkBnF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRequestTheme.js","names":["defaultTheme","acceptedThemes","getRequestTheme","config","cookies","headers","admin","theme","includes","themeFromCookie","get","cookiePrefix","themeFromHeader"],"sources":["../../src/utilities/getRequestTheme.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport { defaultTheme, type Theme } from '../providers/Theme/
|
|
1
|
+
{"version":3,"file":"getRequestTheme.js","names":["defaultTheme","acceptedThemes","getRequestTheme","config","cookies","headers","admin","theme","includes","themeFromCookie","get","cookiePrefix","themeFromHeader"],"sources":["../../src/utilities/getRequestTheme.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport { defaultTheme, type Theme } from '../providers/Theme/shared.js'\n\ntype GetRequestThemeArgs = {\n config: SanitizedConfig\n cookies: Map<string, string>\n headers: Request['headers']\n}\n\nconst acceptedThemes: Theme[] = ['dark', 'light']\n\nexport const getRequestTheme = ({ config, cookies, headers }: GetRequestThemeArgs): Theme => {\n if (config.admin.theme !== 'all' && acceptedThemes.includes(config.admin.theme)) {\n return config.admin.theme\n }\n\n const themeFromCookie = cookies.get(`${config.cookiePrefix || 'payload'}-theme`) as Theme\n\n if (themeFromCookie && acceptedThemes.includes(themeFromCookie)) {\n return themeFromCookie\n }\n\n const themeFromHeader = headers.get('Sec-CH-Prefers-Color-Scheme') as Theme\n\n if (themeFromHeader && acceptedThemes.includes(themeFromHeader)) {\n return themeFromHeader\n }\n\n return defaultTheme\n}\n"],"mappings":"AAEA,SAASA,YAAY,QAAoB;AAQzC,MAAMC,cAAA,GAA0B,CAAC,QAAQ,QAAQ;AAEjD,OAAO,MAAMC,eAAA,GAAkBA,CAAC;EAAEC,MAAM;EAAEC,OAAO;EAAEC;AAAO,CAAuB;EAC/E,IAAIF,MAAA,CAAOG,KAAK,CAACC,KAAK,KAAK,SAASN,cAAA,CAAeO,QAAQ,CAACL,MAAA,CAAOG,KAAK,CAACC,KAAK,GAAG;IAC/E,OAAOJ,MAAA,CAAOG,KAAK,CAACC,KAAK;EAC3B;EAEA,MAAME,eAAA,GAAkBL,OAAA,CAAQM,GAAG,CAAC,GAAGP,MAAA,CAAOQ,YAAY,IAAI,iBAAiB;EAE/E,IAAIF,eAAA,IAAmBR,cAAA,CAAeO,QAAQ,CAACC,eAAA,GAAkB;IAC/D,OAAOA,eAAA;EACT;EAEA,MAAMG,eAAA,GAAkBP,OAAA,CAAQK,GAAG,CAAC;EAEpC,IAAIE,eAAA,IAAmBX,cAAA,CAAeO,QAAQ,CAACI,eAAA,GAAkB;IAC/D,OAAOA,eAAA;EACT;EAEA,OAAOZ,YAAA;AACT","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRouteWithoutAdmin.d.ts","sourceRoot":"","sources":["../../src/utilities/getRouteWithoutAdmin.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"getRouteWithoutAdmin.d.ts","sourceRoot":"","sources":["../../src/utilities/getRouteWithoutAdmin.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,2BAG9B;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;CACd,KAAG,MAEH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSupportedMonacoLocale.d.ts","sourceRoot":"","sources":["../../src/utilities/getSupportedMonacoLocale.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"getSupportedMonacoLocale.d.ts","sourceRoot":"","sources":["../../src/utilities/getSupportedMonacoLocale.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,WAAY,MAAM,KAAG,MAczD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVersions.d.ts","sourceRoot":"","sources":["../../src/utilities/getVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,yBAAyB,EACzB,4BAA4B,EAC5B,qBAAqB,EACrB,IAAI,EACL,MAAM,SAAS,CAAA;AAQhB,KAAK,IAAI,GAAG;IACV,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,cAAc,EAAE,4BAA4B,CAAA;IAC5C,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAED,KAAK,MAAM,GAAG,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,4BAA4B,EAAE,OAAO,CAAA;IACrC,uBAAuB,EAAE,MAAM,CAAA;IAC/B,YAAY,EAAE,MAAM,CAAA;CACrB,CAAC,CAAA;AAKF,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"getVersions.d.ts","sourceRoot":"","sources":["../../src/utilities/getVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,yBAAyB,EACzB,4BAA4B,EAC5B,qBAAqB,EACrB,IAAI,EACL,MAAM,SAAS,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
|
1
|
+
{"version":3,"file":"handleAuthRedirect.d.ts","sourceRoot":"","sources":["../../src/utilities/handleAuthRedirect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAKnC,KAAK,IAAI,GAAG;IACV,MAAM,EAAE;QACN,KAAK,EAAE;YACL,MAAM,EAAE;gBACN,KAAK,EAAE,MAAM,CAAA;gBACb,YAAY,EAAE,MAAM,CAAA;aACrB,CAAA;SACF,CAAA;QACD,MAAM,EAAE;YACN,KAAK,EAAE,MAAM,CAAA;SACd,CAAA;KACF,CAAA;IACD,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAA;IAClD,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ,CAAA;AAED,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,0CAA2C,IAAI,KAAG,MAkChF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleBackToDashboard.d.ts","sourceRoot":"","sources":["../../src/utilities/handleBackToDashboard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAIlD,KAAK,oBAAoB,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,mBAAmB,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"handleBackToDashboard.d.ts","sourceRoot":"","sources":["../../src/utilities/handleBackToDashboard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAIlD,KAAK,oBAAoB,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,mBAAmB,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,qBAAqB,sCAAuC,oBAAoB,SAO5F,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleFormStateLocking.d.ts","sourceRoot":"","sources":["../../src/utilities/handleFormStateLocking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEnD,KAAK,IAAI,GAAG;IACV,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAID,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"handleFormStateLocking.d.ts","sourceRoot":"","sources":["../../src/utilities/handleFormStateLocking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEnD,KAAK,IAAI,GAAG;IACV,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAID,eAAO,MAAM,sBAAsB,+DAMhC,IAAI,KAAG,OAAO,CAAC,MAAM,CAsIvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleGoBack.d.ts","sourceRoot":"","sources":["../../src/utilities/handleGoBack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAIlD,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,mBAAmB,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"handleGoBack.d.ts","sourceRoot":"","sources":["../../src/utilities/handleGoBack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAIlD,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,mBAAmB,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,YAAY,sDAAuD,WAAW,SAM1F,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleLivePreview.d.ts","sourceRoot":"","sources":["../../src/utilities/handleLivePreview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,eAAe,EAChB,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"handleLivePreview.d.ts","sourceRoot":"","sources":["../../src/utilities/handleLivePreview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,eAAe,EAChB,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,oBAAoB,sEAK9B;IACD,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,MAAM,EAAE,eAAe,CAAA;IACvB,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,oBAAoB,EAAE,OAAO,CAAA;CAC9B;;;;;;;;;;;;;;;;;;CAIC,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,gDAI9B;IACD,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,MAAM,EAAE,eAAe,CAAA;IACvB,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B,KAAG,OAcH,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,kEAO3B;IACD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,eAAe,CAAA;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,GAAG,EAAE,cAAc,CAAA;CACpB,KAAG,OAAO,CAAC;IACV,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC,cAAc,CAAC,EAAE,kBAAkB,CAAA;CACpC,CAqDA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlePreview.d.ts","sourceRoot":"","sources":["../../src/utilities/handlePreview.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,SAAS,CAAA;AAEhB;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"handlePreview.d.ts","sourceRoot":"","sources":["../../src/utilities/handlePreview.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,SAAS,CAAA;AAEhB;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,wCAG1B;IACD,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B,KAAG,OAQH,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,kEAOvB;IACD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,eAAe,CAAA;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,GAAG,EAAE,cAAc,CAAA;CACpB,KAAG,OAAO,CAAC;IACV,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAoCA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleServerFunctions.d.ts","sourceRoot":"","sources":["../../src/utilities/handleServerFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EAEb,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAgChB;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"handleServerFunctions.d.ts","sourceRoot":"","sources":["../../src/utilities/handleServerFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EAEb,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAgChB;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,uBAErC;IACD,aAAa,EAAE,aAAa,CAAA;CAC7B,KAAG,qBAkCH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleStaleDataCheck.d.ts","sourceRoot":"","sources":["../../src/utilities/handleStaleDataCheck.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,KAAK,IAAI,GAAG;IACV,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,iBAAiB,EAAE,MAAM,CAAA;IACzB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"handleStaleDataCheck.d.ts","sourceRoot":"","sources":["../../src/utilities/handleStaleDataCheck.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,KAAK,IAAI,GAAG;IACV,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,iBAAiB,EAAE,MAAM,CAAA;IACzB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,oBAAoB,gEAM9B,IAAI,KAAG,OAAO,CAAC,MAAM,CAwDvB,CAAA"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AuthenticatedUser, User } from 'payload';
|
|
2
2
|
export interface HandleTakeOverParams {
|
|
3
3
|
clearRouteCache?: () => void;
|
|
4
4
|
collectionSlug?: string;
|
|
5
5
|
documentLockStateRef: React.RefObject<{
|
|
6
6
|
hasShownLockedModal: boolean;
|
|
7
7
|
isLocked: boolean;
|
|
8
|
-
user:
|
|
8
|
+
user: number | string | User;
|
|
9
9
|
}>;
|
|
10
10
|
globalSlug?: string;
|
|
11
11
|
id: number | string;
|
|
12
12
|
isLockingEnabled: boolean;
|
|
13
13
|
isWithinDoc: boolean;
|
|
14
|
-
setCurrentEditor: (value: React.SetStateAction<
|
|
14
|
+
setCurrentEditor: (value: React.SetStateAction<number | string | User>) => void;
|
|
15
15
|
setIsReadOnlyForIncomingUser?: (value: React.SetStateAction<boolean>) => void;
|
|
16
|
-
updateDocumentEditor: (docID: number | string, slug: string, user:
|
|
17
|
-
user:
|
|
16
|
+
updateDocumentEditor: (docID: number | string, slug: string, user: number | string | User) => Promise<void>;
|
|
17
|
+
user: AuthenticatedUser | number | string;
|
|
18
18
|
}
|
|
19
19
|
export declare const handleTakeOver: ({ id, clearRouteCache, collectionSlug, documentLockStateRef, globalSlug, isLockingEnabled, isWithinDoc, setCurrentEditor, setIsReadOnlyForIncomingUser, updateDocumentEditor, user, }: HandleTakeOverParams) => Promise<void>;
|
|
20
20
|
//# sourceMappingURL=handleTakeOver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleTakeOver.d.ts","sourceRoot":"","sources":["../../src/utilities/handleTakeOver.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"handleTakeOver.d.ts","sourceRoot":"","sources":["../../src/utilities/handleTakeOver.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEtD,MAAM,WAAW,oBAAoB;IACnC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,oBAAoB,EAAE,KAAK,CAAC,SAAS,CAAC;QACpC,mBAAmB,EAAE,OAAO,CAAA;QAC5B,QAAQ,EAAE,OAAO,CAAA;QACjB,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;KAC7B,CAAC,CAAA;IACF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,gBAAgB,EAAE,OAAO,CAAA;IACzB,WAAW,EAAE,OAAO,CAAA;IACpB,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,KAAK,IAAI,CAAA;IAC/E,4BAA4B,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;IAC7E,oBAAoB,EAAE,CACpB,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,KACzB,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAA;CAC1C;AAED,eAAO,MAAM,cAAc,0LAYxB,oBAAoB,KAAG,OAAO,CAAC,IAAI,CAkCrC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleTakeOver.js","names":["handleTakeOver","id","clearRouteCache","collectionSlug","documentLockStateRef","globalSlug","isLockingEnabled","isWithinDoc","setCurrentEditor","setIsReadOnlyForIncomingUser","updateDocumentEditor","user","current","hasShownLockedModal","isLocked","error","console"],"sources":["../../src/utilities/handleTakeOver.tsx"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"handleTakeOver.js","names":["handleTakeOver","id","clearRouteCache","collectionSlug","documentLockStateRef","globalSlug","isLockingEnabled","isWithinDoc","setCurrentEditor","setIsReadOnlyForIncomingUser","updateDocumentEditor","user","current","hasShownLockedModal","isLocked","error","console"],"sources":["../../src/utilities/handleTakeOver.tsx"],"sourcesContent":["import type { AuthenticatedUser, User } from 'payload'\n\nexport interface HandleTakeOverParams {\n clearRouteCache?: () => void\n collectionSlug?: string\n documentLockStateRef: React.RefObject<{\n hasShownLockedModal: boolean\n isLocked: boolean\n user: number | string | User\n }>\n globalSlug?: string\n id: number | string\n isLockingEnabled: boolean\n isWithinDoc: boolean\n setCurrentEditor: (value: React.SetStateAction<number | string | User>) => void\n setIsReadOnlyForIncomingUser?: (value: React.SetStateAction<boolean>) => void\n updateDocumentEditor: (\n docID: number | string,\n slug: string,\n user: number | string | User,\n ) => Promise<void>\n user: AuthenticatedUser | number | string\n}\n\nexport const handleTakeOver = async ({\n id,\n clearRouteCache,\n collectionSlug,\n documentLockStateRef,\n globalSlug,\n isLockingEnabled,\n isWithinDoc,\n setCurrentEditor,\n setIsReadOnlyForIncomingUser,\n updateDocumentEditor,\n user,\n}: HandleTakeOverParams): Promise<void> => {\n if (!isLockingEnabled) {\n return\n }\n\n try {\n // Call updateDocumentEditor to update the document's owner to the current user\n await updateDocumentEditor(id, collectionSlug ?? globalSlug, user)\n\n if (!isWithinDoc) {\n documentLockStateRef.current.hasShownLockedModal = true\n }\n\n // Update the locked state to reflect the current user as the owner\n documentLockStateRef.current = {\n hasShownLockedModal: documentLockStateRef.current?.hasShownLockedModal,\n isLocked: true,\n user,\n }\n setCurrentEditor(user)\n\n // If this is a takeover within the document, ensure the document is editable\n if (isWithinDoc && setIsReadOnlyForIncomingUser) {\n setIsReadOnlyForIncomingUser(false)\n }\n\n // Need to clear the route cache to refresh the page and update readOnly state for server rendered components\n if (clearRouteCache) {\n clearRouteCache()\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error during document takeover:', error)\n }\n}\n"],"mappings":"AAwBA,OAAO,MAAMA,cAAA,GAAiB,MAAAA,CAAO;EACnCC,EAAE;EACFC,eAAe;EACfC,cAAc;EACdC,oBAAoB;EACpBC,UAAU;EACVC,gBAAgB;EAChBC,WAAW;EACXC,gBAAgB;EAChBC,4BAA4B;EAC5BC,oBAAoB;EACpBC;AAAI,CACiB;EACrB,IAAI,CAACL,gBAAA,EAAkB;IACrB;EACF;EAEA,IAAI;IACF;IACA,MAAMI,oBAAA,CAAqBT,EAAA,EAAIE,cAAA,IAAkBE,UAAA,EAAYM,IAAA;IAE7D,IAAI,CAACJ,WAAA,EAAa;MAChBH,oBAAA,CAAqBQ,OAAO,CAACC,mBAAmB,GAAG;IACrD;IAEA;IACAT,oBAAA,CAAqBQ,OAAO,GAAG;MAC7BC,mBAAA,EAAqBT,oBAAA,CAAqBQ,OAAO,EAAEC,mBAAA;MACnDC,QAAA,EAAU;MACVH;IACF;IACAH,gBAAA,CAAiBG,IAAA;IAEjB;IACA,IAAIJ,WAAA,IAAeE,4BAAA,EAA8B;MAC/CA,4BAAA,CAA6B;IAC/B;IAEA;IACA,IAAIP,eAAA,EAAiB;MACnBA,eAAA;IACF;EACF,EAAE,OAAOa,KAAA,EAAO;IACd;IACAC,OAAA,CAAQD,KAAK,CAAC,mCAAmCA,KAAA;EACnD;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasOptionLabelJSXElement.d.ts","sourceRoot":"","sources":["../../src/utilities/hasOptionLabelJSXElement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAIxD,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"hasOptionLabelJSXElement.d.ts","sourceRoot":"","sources":["../../src/utilities/hasOptionLabelJSXElement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAIxD,eAAO,MAAM,wBAAwB,oBAAqB,yBAAyB,YAkBlF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasSavePermission.d.ts","sourceRoot":"","sources":["../../src/utilities/hasSavePermission.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,4BAA4B,EAE7B,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"hasSavePermission.d.ts","sourceRoot":"","sources":["../../src/utilities/hasSavePermission.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,4BAA4B,EAE7B,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,iBAAiB,SAAU;IAItC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,4BAA4B,CAAA;IAI5C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;CACnB,YAeA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initReq.d.ts","sourceRoot":"","sources":["../../src/utilities/initReq.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EAEb,eAAe,EACf,aAAa,EACd,MAAM,SAAS,CAAA;AAGhB,OAAO,EACL,cAAc,EAMf,MAAM,SAAS,CAAA;AAahB;;;;GAIG;AACH,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"initReq.d.ts","sourceRoot":"","sources":["../../src/utilities/initReq.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EAEb,eAAe,EACf,aAAa,EACd,MAAM,SAAS,CAAA;AAGhB,OAAO,EACL,cAAc,EAMf,MAAM,SAAS,CAAA;AAahB;;;;GAIG;AACH,eAAO,MAAM,OAAO,gFAOjB;IACD,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,aAAa,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAAA;IACzD,SAAS,EAAE,SAAS,CAAA;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAChD,aAAa,EAAE,aAAa,CAAA;CAC7B,KAAG,OAAO,CAAC,aAAa,CA2FxB,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const isClientUserObject: (user: any) => user is
|
|
1
|
+
import type { User } from 'payload';
|
|
2
|
+
export declare const isClientUserObject: (user: any) => user is User;
|
|
3
3
|
//# sourceMappingURL=isClientUserObject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isClientUserObject.d.ts","sourceRoot":"","sources":["../../src/utilities/isClientUserObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"isClientUserObject.d.ts","sourceRoot":"","sources":["../../src/utilities/isClientUserObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEnC,eAAO,MAAM,kBAAkB,iBAAW,IAAI,IAAI,IAEjD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isClientUserObject.js","names":["isClientUserObject","user"],"sources":["../../src/utilities/isClientUserObject.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"isClientUserObject.js","names":["isClientUserObject","user"],"sources":["../../src/utilities/isClientUserObject.ts"],"sourcesContent":["import type { User } from 'payload'\n\nexport const isClientUserObject = (user): user is User => {\n return user && typeof user === 'object'\n}\n"],"mappings":"AAEA,OAAO,MAAMA,kBAAA,GAAsBC,IAAA;EACjC,OAAOA,IAAA,IAAQ,OAAOA,IAAA,KAAS;AACjC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isCustomAdminView.d.ts","sourceRoot":"","sources":["../../src/utilities/isCustomAdminView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,yFAAyF;AACzF,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"isCustomAdminView.d.ts","sourceRoot":"","sources":["../../src/utilities/isCustomAdminView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,yFAAyF;AACzF,eAAO,MAAM,iBAAiB,mCAI3B;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;CACd,KAAG,OAiBH,CAAA"}
|