Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@payloadcms/ui

Package Overview
Dependencies
Maintainers
0
Versions
366
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@payloadcms/ui - npm Package Compare versions

Comparing version 3.0.0-beta.130 to 3.0.0-beta.131

dist/exports/client/chunk-PELL3UMP.js

8

dist/elements/AddNewRelation/index.js

@@ -117,5 +117,5 @@ 'use client';

if (relatedCollections.length === 1) {
setShow(permissions.collections[relatedCollections[0]?.slug]?.create?.permission);
setShow(permissions.collections[relatedCollections[0]?.slug]?.create);
} else {
setShow(relatedCollections.some(collection => permissions.collections[collection?.slug]?.create?.permission));
setShow(relatedCollections.some(collection => permissions.collections[collection?.slug]?.create));
}

@@ -237,3 +237,3 @@ }

children: relatedCollections.map(relatedCollection => {
if (permissions.collections[relatedCollection?.slug].create.permission) {
if (permissions.collections[relatedCollection?.slug].create) {
return _jsx(PopupList.Button, {

@@ -253,3 +253,3 @@ className: `${baseClass}__relation-button--${relatedCollection?.slug}`,

size: "medium"
}), collectionConfig && permissions.collections[collectionConfig?.slug]?.create?.permission && _jsx(DocumentDrawer, {
}), collectionConfig && permissions.collections[collectionConfig?.slug]?.create && _jsx(DocumentDrawer, {
onSave

@@ -256,0 +256,0 @@ })]

@@ -1,2 +0,2 @@

import type { Data, DocumentPermissions, DocumentSlots } from 'payload';
import type { Data, DocumentSlots, SanitizedDocumentPermissions } from 'payload';
import React from 'react';

@@ -8,3 +8,3 @@ import type { State } from './reducer.js';

readonly collectionSlug: string;
readonly docPermissions?: DocumentPermissions;
readonly docPermissions?: SanitizedDocumentPermissions;
readonly documentSlots: DocumentSlots;

@@ -11,0 +11,0 @@ readonly forms: State['forms'];

@@ -159,3 +159,3 @@ 'use client';

}));
setHasPublishPermission(publishedAccessJSON?.update?.permission);
setHasPublishPermission(publishedAccessJSON?.update);
setHasInitializedDocPermissions(true);

@@ -162,0 +162,0 @@ }, [api, code, collectionSlug, i18n.language, serverURL]);

@@ -63,2 +63,3 @@ 'use client';

onClick,
onMouseDown,
round,

@@ -91,2 +92,3 @@ size = 'medium',

onClick: !disabled ? handleClick : undefined,
onMouseDown: !disabled ? onMouseDown : undefined,
onPointerEnter: tooltip ? () => setShowTooltip(true) : undefined,

@@ -93,0 +95,0 @@ onPointerLeave: tooltip ? () => setShowTooltip(false) : undefined,

@@ -22,2 +22,3 @@ import type { ElementType, MouseEvent } from 'react';

onClick?: (event: MouseEvent) => void;
onMouseDown?: (event: MouseEvent) => void;
round?: boolean;

@@ -24,0 +25,0 @@ secondaryActions?: secondaryAction | secondaryAction[];

@@ -63,3 +63,3 @@ 'use client';

const collectionPermissions = permissions?.collections?.[slug];
const hasDeletePermission = collectionPermissions?.delete?.permission;
const hasDeletePermission = collectionPermissions?.delete;
const modalSlug = `delete-${slug}`;

@@ -66,0 +66,0 @@ const addDefaultError = useCallback(() => {

@@ -1,2 +0,2 @@

import type { ClientUser, CollectionPermission, GlobalPermission, SanitizedCollectionConfig } from 'payload';
import type { ClientUser, SanitizedCollectionConfig, SanitizedCollectionPermission, SanitizedGlobalPermission } from 'payload';
import React from 'react';

@@ -26,3 +26,3 @@ import type { DocumentDrawerContextType } from '../DocumentDrawer/Provider.js';

readonly onTakeOver?: () => void;
readonly permissions: CollectionPermission | GlobalPermission | null;
readonly permissions: null | SanitizedCollectionPermission | SanitizedGlobalPermission;
readonly readOnlyForIncomingUser?: boolean;

@@ -29,0 +29,0 @@ readonly redirectAfterDelete?: boolean;

@@ -120,4 +120,4 @@ 'use client';

useEffect(t4, t5);
const hasCreatePermission = permissions && "create" in permissions && permissions.create?.permission;
const hasDeletePermission = permissions && "delete" in permissions && permissions.delete?.permission;
const hasCreatePermission = permissions && "create" in permissions && permissions.create;
const hasDeletePermission = permissions && "delete" in permissions && permissions.delete;
const showDotMenu = Boolean(collectionConfig && id && !disableActions && (hasCreatePermission || hasDeletePermission));

@@ -124,0 +124,0 @@ const unsavedDraftWithValidations = !id && collectionConfig?.versions?.drafts && collectionConfig.versions?.drafts.validate;

@@ -1,2 +0,2 @@

import type { ClientField, DocumentPermissions } from 'payload';
import type { ClientField, SanitizedDocumentPermissions } from 'payload';
import React from 'react';

@@ -8,3 +8,3 @@ import './index.scss';

readonly Description?: React.ReactNode;
readonly docPermissions: DocumentPermissions;
readonly docPermissions: SanitizedDocumentPermissions;
readonly fields: ClientField[];

@@ -11,0 +11,0 @@ readonly forceSidebarWrap?: boolean;

@@ -221,3 +221,3 @@ 'use client';

const collectionPermissions = permissions?.collections?.[slug];
const hasUpdatePermission = collectionPermissions?.update?.permission;
const hasUpdatePermission = collectionPermissions?.update;
const drawerSlug = `edit-${slug}`;

@@ -344,3 +344,3 @@ React.useEffect(() => {

parentSchemaPath: slug,
permissions: permissions?.collections?.[slug]?.fields,
permissions: collectionPermissions?.fields,
readOnly: false

@@ -347,0 +347,0 @@ }), /*#__PURE__*/_jsx("div", {

import type { TFunction } from '@payloadcms/translations';
import type { FieldPermissions, LoginWithUsernameOptions } from 'payload';
import type { LoginWithUsernameOptions, SanitizedFieldPermissions } from 'payload';
import React from 'react';

@@ -9,4 +9,4 @@ type RenderEmailAndUsernameFieldsProps = {

permissions?: {
[fieldName: string]: FieldPermissions;
};
[fieldName: string]: SanitizedFieldPermissions;
} | true;
readOnly: boolean;

@@ -13,0 +13,0 @@ t: TFunction;

@@ -1,2 +0,2 @@

import type { Permissions } from 'payload';
import type { SanitizedPermissions } from 'payload';
/**

@@ -9,3 +9,3 @@ * The Auth Provider wraps the entire app

type Props = {
permissions: Permissions;
permissions: SanitizedPermissions;
};

@@ -12,0 +12,0 @@ export declare function HydrateAuthProvider({ permissions }: Props): any;

@@ -7,3 +7,3 @@ import type { FilterOptionsResult, SanitizedCollectionConfig } from 'payload';

readonly allowCreate?: boolean;
readonly collectionSlugs: string[];
readonly collectionSlugs: SanitizedCollectionConfig['slug'][];
readonly drawerSlug?: string;

@@ -21,5 +21,5 @@ readonly enableRowSelections?: boolean;

export type UseListDrawer = (args: {
collectionSlugs?: string[];
collectionSlugs?: SanitizedCollectionConfig['slug'][];
filterOptions?: FilterOptionsResult;
selectedCollection?: string;
selectedCollection?: SanitizedCollectionConfig['slug'];
uploads?: boolean;

@@ -26,0 +26,0 @@ }) => [

@@ -62,3 +62,3 @@ 'use client';

const collectionPermissions = permissions?.collections?.[slug];
const hasPermission = collectionPermissions?.update?.permission;
const hasPermission = collectionPermissions?.update;
const modalSlug = `publish-${slug}`;

@@ -65,0 +65,0 @@ const addDefaultError = useCallback(() => {

@@ -127,3 +127,3 @@ 'use client';

const preferenceKey = `${relationTo}-list`;
const canCreate = allowCreate !== false && permissions?.collections?.[relationTo]?.create?.permission;
const canCreate = allowCreate !== false && permissions?.collections?.[relationTo]?.create;
return /*#__PURE__*/_jsxs("div", {

@@ -130,0 +130,0 @@ className: baseClass,

import { jsx as _jsx } from "react/jsx-runtime";
import { isPlainObject, isReactServerComponentOrFunction, parsePayloadComponent } from 'payload/shared';
import React from 'react';
import { removeUndefined } from '../../utilities/removeUndefined.js';
export const getFromImportMap = args => {

@@ -47,6 +48,10 @@ const {

const isRSC = isReactServerComponentOrFunction(Component);
return /*#__PURE__*/_jsx(Component, {
// prevent $undefined from being passed through the rsc requests
const sanitizedProps = removeUndefined({
...clientProps,
...(isRSC ? serverProps : {})
});
return /*#__PURE__*/_jsx(Component, {
...sanitizedProps
});
}

@@ -61,3 +66,4 @@ if (typeof Component === 'string' || isPlainObject(Component)) {

const isRSC = isReactServerComponentOrFunction(ResolvedComponent);
return /*#__PURE__*/_jsx(ResolvedComponent, {
// prevent $undefined from being passed through rsc requests
const sanitizedProps = removeUndefined({
...clientProps,

@@ -68,2 +74,5 @@ ...(isRSC ? serverProps : {}),

});
return /*#__PURE__*/_jsx(ResolvedComponent, {
...sanitizedProps
});
}

@@ -70,0 +79,0 @@ }

@@ -144,3 +144,3 @@ 'use client';

const performAction = t2;
const canUpdate = docPermissions?.update?.permission;
const canUpdate = docPermissions?.update;
if (statusToRender) {

@@ -147,0 +147,0 @@ const t3 = `${t("version:status")}: ${t(`version:${statusToRender}`)}`;

import type { ArrayFieldClient, DefaultCellComponentProps } from 'payload';
import React from 'react';
export interface ArrayCellProps extends DefaultCellComponentProps<Record<string, unknown>[], ArrayFieldClient> {
export interface ArrayCellProps extends DefaultCellComponentProps<ArrayFieldClient> {
}
export declare const ArrayCell: React.FC<ArrayCellProps>;
//# sourceMappingURL=index.d.ts.map
import type { BlocksFieldClient, DefaultCellComponentProps } from 'payload';
import React from 'react';
export interface BlocksCellProps extends DefaultCellComponentProps<any, BlocksFieldClient> {
export interface BlocksCellProps extends DefaultCellComponentProps<BlocksFieldClient> {
}
export declare const BlocksCell: React.FC<BlocksCellProps>;
//# sourceMappingURL=index.d.ts.map
import type { CheckboxFieldClient, DefaultCellComponentProps } from 'payload';
import React from 'react';
import './index.scss';
export declare const CheckboxCell: React.FC<DefaultCellComponentProps<boolean, CheckboxFieldClient>>;
export declare const CheckboxCell: React.FC<DefaultCellComponentProps<CheckboxFieldClient>>;
//# sourceMappingURL=index.d.ts.map
import type { CodeFieldClient, DefaultCellComponentProps } from 'payload';
import React from 'react';
import './index.scss';
export interface CodeCellProps extends DefaultCellComponentProps<string, CodeFieldClient> {
export interface CodeCellProps extends DefaultCellComponentProps<CodeFieldClient> {
readonly nowrap?: boolean;

@@ -6,0 +6,0 @@ }

import type { DateFieldClient, DefaultCellComponentProps } from 'payload';
import React from 'react';
export declare const DateCell: React.FC<DefaultCellComponentProps<Date | number | string, DateFieldClient>>;
export declare const DateCell: React.FC<DefaultCellComponentProps<DateFieldClient>>;
//# sourceMappingURL=index.d.ts.map
import type { DefaultCellComponentProps, TextFieldClient, UploadFieldClient } from 'payload';
import React from 'react';
import './index.scss';
export interface FileCellProps extends DefaultCellComponentProps<any, TextFieldClient | UploadFieldClient> {
export interface FileCellProps extends DefaultCellComponentProps<TextFieldClient | UploadFieldClient> {
}
export declare const FileCell: React.FC<FileCellProps>;
//# sourceMappingURL=index.d.ts.map
export declare const cellComponents: {
array: import("react").FC<import("./Array/index.js").ArrayCellProps>;
blocks: import("react").FC<import("./Blocks/index.js").BlocksCellProps>;
checkbox: import("react").FC<import("packages/payload/src/index.js").DefaultCellComponentProps<boolean, import("packages/payload/src/index.js").CheckboxFieldClient>>;
checkbox: import("react").FC<import("packages/payload/src/index.js").DefaultCellComponentProps<import("packages/payload/src/index.js").CheckboxFieldClient>>;
code: import("react").FC<import("./Code/index.js").CodeCellProps>;
date: import("react").FC<import("packages/payload/src/index.js").DefaultCellComponentProps<string | number | Date, import("packages/payload/src/index.js").DateFieldClient>>;
date: import("react").FC<import("packages/payload/src/index.js").DefaultCellComponentProps<import("packages/payload/src/index.js").DateFieldClient>>;
File: import("react").FC<import("./File/index.js").FileCellProps>;
join: import("react").FC<import("./Relationship/index.js").RelationshipCellProps>;
json: import("react").FC<import("packages/payload/src/index.js").DefaultCellComponentProps<string, import("packages/payload/src/index.js").JSONFieldClient>>;
json: import("react").FC<import("packages/payload/src/index.js").DefaultCellComponentProps<import("packages/payload/src/index.js").JSONFieldClient>>;
radio: import("react").FC<import("./Select/index.js").SelectCellProps>;
relationship: import("react").FC<import("./Relationship/index.js").RelationshipCellProps>;
select: import("react").FC<import("./Select/index.js").SelectCellProps>;
textarea: import("react").FC<import("packages/payload/src/index.js").DefaultCellComponentProps<string, import("packages/payload/src/index.js").TextareaFieldClient>>;
textarea: import("react").FC<import("packages/payload/src/index.js").DefaultCellComponentProps<import("packages/payload/src/index.js").TextareaFieldClient>>;
upload: import("react").FC<import("./Relationship/index.js").RelationshipCellProps>;
};
//# sourceMappingURL=index.d.ts.map
import type { DefaultCellComponentProps, JSONFieldClient } from 'payload';
import React from 'react';
import './index.scss';
export declare const JSONCell: React.FC<DefaultCellComponentProps<string, JSONFieldClient>>;
export declare const JSONCell: React.FC<DefaultCellComponentProps<JSONFieldClient>>;
//# sourceMappingURL=index.d.ts.map
import type { DefaultCellComponentProps, JoinFieldClient, RelationshipFieldClient, UploadFieldClient } from 'payload';
import React from 'react';
import './index.scss';
export type RelationshipCellProps = DefaultCellComponentProps<any, JoinFieldClient | RelationshipFieldClient | UploadFieldClient>;
export type RelationshipCellProps = DefaultCellComponentProps<JoinFieldClient | RelationshipFieldClient | UploadFieldClient>;
export declare const RelationshipCell: React.FC<RelationshipCellProps>;
//# sourceMappingURL=index.d.ts.map
import type { DefaultCellComponentProps, SelectFieldClient } from 'payload';
import React from 'react';
export interface SelectCellProps extends DefaultCellComponentProps<any, SelectFieldClient> {
export interface SelectCellProps extends DefaultCellComponentProps<SelectFieldClient> {
}
export declare const SelectCell: React.FC<SelectCellProps>;
//# sourceMappingURL=index.d.ts.map
import type { DefaultCellComponentProps, TextareaFieldClient } from 'payload';
import React from 'react';
export declare const TextareaCell: React.FC<DefaultCellComponentProps<string, TextareaFieldClient>>;
export declare const TextareaCell: React.FC<DefaultCellComponentProps<TextareaFieldClient>>;
//# sourceMappingURL=index.d.ts.map
import type { I18nClient } from '@payloadcms/translations';
import { type ClientCollectionConfig, type DefaultCellComponentProps, type Field, type PaginatedDocs, type Payload, type SanitizedCollectionConfig } from 'payload';
import type { ClientCollectionConfig, DefaultCellComponentProps, Field, PaginatedDocs, Payload, SanitizedCollectionConfig } from 'payload';
import type { ColumnPreferences } from '../../providers/ListQuery/index.js';

@@ -4,0 +4,0 @@ import type { SortColumnProps } from '../SortColumn/index.js';

@@ -8,2 +8,3 @@ 'use client';

import { useServerFunctions } from '../../providers/ServerFunctions/index.js';
import { abortAndIgnore } from '../../utilities/abortAndIgnore.js';
export const TableColumnContext = /*#__PURE__*/createContext({});

@@ -58,3 +59,5 @@ export const useTableColumns = () => {

const [tableColumns, setTableColumns] = React.useState(columnState);
const tableStateControllerRef = React.useRef(null);
const moveColumn = useCallback(async args => {
abortAndIgnore(tableStateControllerRef.current);
const {

@@ -67,6 +70,6 @@ fromIndex,

withMovedColumn.splice(toIndex, 0, columnToMove);
const {
state: columnState_0,
Table
} = await getTableState({
setTableColumns(withMovedColumn);
const controller = new AbortController();
tableStateControllerRef.current = controller;
const result = await getTableState({
collectionSlug,

@@ -77,18 +80,42 @@ columns: sanitizeColumns(withMovedColumn),

renderRowTypes,
signal: controller.signal,
tableAppearance
});
setTableColumns(columnState_0);
setTable(Table);
if (result) {
setTableColumns(result.state);
setTable(result.Table);
}
}, [tableColumns, collectionSlug, docs, getTableState, setTable, enableRowSelections, renderRowTypes, tableAppearance]);
const toggleColumn = useCallback(async column => {
const toggledColumns = tableColumns.map(col => {
return {
accessor: col.accessor,
active: col.accessor === column ? !col.active : col.active
};
abortAndIgnore(tableStateControllerRef.current);
const {
newColumnState,
toggledColumns
} = tableColumns.reduce((acc, col) => {
if (col.accessor === column) {
acc.newColumnState.push({
...col,
accessor: col.accessor,
active: !col.active
});
acc.toggledColumns.push({
accessor: col.accessor,
active: !col.active
});
} else {
acc.newColumnState.push(col);
acc.toggledColumns.push({
accessor: col.accessor,
active: col.active
});
}
return acc;
}, {
newColumnState: [],
toggledColumns: []
});
const {
state: columnState_1,
Table: Table_0
} = await getTableState({
setTableColumns(newColumnState);
const controller_0 = new AbortController();
tableStateControllerRef.current = controller_0;
const result_0 = await getTableState({
collectionSlug,

@@ -99,6 +126,9 @@ columns: toggledColumns,

renderRowTypes,
signal: controller_0.signal,
tableAppearance
});
setTableColumns(columnState_1);
setTable(Table_0);
if (result_0) {
setTableColumns(result_0.state);
setTable(result_0.Table);
}
}, [tableColumns, getTableState, setTable, collectionSlug, docs, enableRowSelections, renderRowTypes, tableAppearance]);

@@ -120,4 +150,4 @@ const setActiveColumns = React.useCallback(async activeColumnAccessors => {

const {
state: columnState_2,
Table: Table_1
state: columnState_0,
Table
} = await getTableState({

@@ -131,4 +161,4 @@ collectionSlug,

});
setTableColumns(columnState_2);
setTable(Table_1);
setTableColumns(columnState_0);
setTable(Table);
}, [tableColumns, getTableState, setTable, collectionSlug, docs, enableRowSelections, renderRowTypes, tableAppearance]);

@@ -163,2 +193,7 @@ const resetColumnsState = React.useCallback(async () => {

}, [preferenceKey, getPreference, collectionSlug, fields, defaultColumns, useAsTitle, listPreferences, enableRowSelections, sortColumnProps]);
React.useEffect(() => {
return () => {
abortAndIgnore(tableStateControllerRef.current);
};
}, []);
return /*#__PURE__*/_jsx(TableColumnContext.Provider, {

@@ -165,0 +200,0 @@ value: {

@@ -62,3 +62,3 @@ 'use client';

const collectionPermissions = permissions?.collections?.[slug];
const hasPermission = collectionPermissions?.update?.permission;
const hasPermission = collectionPermissions?.update;
const modalSlug = `unpublish-${slug}`;

@@ -65,0 +65,0 @@ const addDefaultError = useCallback(() => {

@@ -203,3 +203,3 @@ 'use client';

}, [showUrlInput]);
const canRemoveUpload = docPermissions?.update?.permission && 'delete' in docPermissions && docPermissions?.delete?.permission;
const canRemoveUpload = docPermissions?.update && 'delete' in docPermissions && docPermissions?.delete;
const hasImageSizes = uploadConfig?.imageSizes?.length > 0;

@@ -206,0 +206,0 @@ const hasResizeOptions = Boolean(uploadConfig?.resizeOptions);

@@ -138,2 +138,3 @@ export { fieldComponents } from '../../fields/index.js';

export { DefaultBlockImage } from '../../graphics/DefaultBlockImage/index.js';
export { ExternalLinkIcon } from '../../graphics/ExternalLink/index.js';
export { File } from '../../graphics/File/index.js';

@@ -195,2 +196,3 @@ export { CalendarIcon } from '../../icons/Calendar/index.js';

export type { ListComponentClientProps, ListComponentServerProps, ListPreferences, } from '../../views/List/types.js';
export type { ListHeaderProps } from '../../views/List/ListHeader/index.js';
export { DefaultEditView } from '../../views/Edit/index.js';

@@ -197,0 +199,0 @@ export { SetDocumentStepNav } from '../../views/Edit/SetDocumentStepNav/index.js';

@@ -1,6 +0,6 @@

var R=t=>{let e=o=>o.type!=="ui"&&o.admin?.disabled===!0||o?.admin?.disableListColumn===!0;return t?.reduce((o,n)=>{if(e(n))return o;let i=n.type==="tabs"&&"tabs"in n?{...n,tabs:n.tabs.map(s=>({...s,fields:s.fields.filter(a=>!e(a))}))}:n;return[...o,i]},[])};import{fieldAffectsData as b}from"payload/shared";var f=(t,e)=>t?.reduce((r,o)=>b(o)&&o.name===e?r:!b(o)&&"fields"in o?[...r,...f(o.fields,e)]:o.type==="tabs"&&"tabs"in o?[...r,...o.tabs.reduce((n,i)=>[...n,..."name"in i?[i.name]:f(i.fields,e)],[])]:[...r,o.name],[]),L=(t,e,r)=>{let o=[];if(Array.isArray(r)&&r.length>=1)o=r;else{e&&o.push(e);let n=f(t,e);o=o.concat(n),o=o.slice(0,4)}return o.map(n=>({accessor:n,active:!0}))};import*as c from"react";var x=({elements:t,translationString:e})=>{let r=/(<[^>]+>.*?<\/[^>]+>)/g,o=e.split(r);return c.createElement("span",null,o.map((n,i)=>{if(t&&n.startsWith("<")&&n.endsWith(">")){let s=n[1],a=t[s];if(a){let l=new RegExp(`<${s}>(.*?)</${s}>`,"g"),d=n.replace(l,(m,v)=>v);return c.createElement(a,{key:i},c.createElement(x,{translationString:d}))}}return n}))},T=({elements:t,i18nKey:e,t:r,variables:o})=>{let n=r(e,o||{});return t?c.createElement(x,{elements:t,translationString:n}):n};import{isReactServerComponentOrFunction as I,serverProps as k}from"payload/shared";import M from"react";function w({Component:t,sanitizeServerOnlyProps:e,toMergeIntoProps:r}){return e===void 0&&(e=!I(t)),n=>{let i=A(n,r);return e&&k.forEach(s=>{delete i[s]}),M.createElement(t,{...i})}}function A(t,e){return{...t,...e}}import{isReactServerComponentOrFunction as D}from"payload/shared";import P from"react";var H=({Component:t,serverOnlyProps:e,...r})=>t?P.createElement(n=>{let i={...n,...D(t)?e??{}:{}};return P.createElement(t,{...i})},{...r}):null;import{deepCopyObjectComplex as V}from"payload/shared";var O=["validate","customComponents"],N=t=>{let e=V(t);return O.forEach(r=>{delete e[r]}),e},$=t=>Object.keys(t).reduce((e,r)=>(e[r]=N(t[r]),e),{});import g from"react";var B=({fill:t})=>{let e=t||"var(--theme-elevation-1000)";return g.createElement("svg",{className:"graphic-icon",height:"100%",viewBox:"0 0 25 25",width:"100%",xmlns:"http://www.w3.org/2000/svg"},g.createElement("path",{d:"M11.5293 0L23 6.90096V19.9978L14.3608 25V11.9032L2.88452 5.00777L11.5293 0Z",fill:e}),g.createElement("path",{d:"M10.6559 24.2727V14.0518L2 19.0651L10.6559 24.2727Z",fill:e}))};import p from"react";var E=`
var R=t=>{let e=o=>o.type!=="ui"&&o.admin?.disabled===!0||o?.admin?.disableListColumn===!0;return t?.reduce((o,n)=>{if(e(n))return o;let i=n.type==="tabs"&&"tabs"in n?{...n,tabs:n.tabs.map(s=>({...s,fields:s.fields.filter(a=>!e(a))}))}:n;return[...o,i]},[])};import{fieldAffectsData as b}from"payload/shared";var f=(t,e)=>t?.reduce((r,o)=>b(o)&&o.name===e?r:!b(o)&&"fields"in o?[...r,...f(o.fields,e)]:o.type==="tabs"&&"tabs"in o?[...r,...o.tabs.reduce((n,i)=>[...n,..."name"in i?[i.name]:f(i.fields,e)],[])]:[...r,o.name],[]),L=(t,e,r)=>{let o=[];if(Array.isArray(r)&&r.length>=1)o=r;else{e&&o.push(e);let n=f(t,e);o=o.concat(n),o=o.slice(0,4)}return o.map(n=>({accessor:n,active:!0}))};import*as c from"react";var x=({elements:t,translationString:e})=>{let r=/(<[^>]+>.*?<\/[^>]+>)/g,o=e.split(r);return c.createElement("span",null,o.map((n,i)=>{if(t&&n.startsWith("<")&&n.endsWith(">")){let s=n[1],a=t[s];if(a){let l=new RegExp(`<${s}>(.*?)</${s}>`,"g"),d=n.replace(l,(m,v)=>v);return c.createElement(a,{key:i},c.createElement(x,{translationString:d}))}}return n}))},T=({elements:t,i18nKey:e,t:r,variables:o})=>{let n=r(e,o||{});return t?c.createElement(x,{elements:t,translationString:n}):n};import{isReactServerComponentOrFunction as I,serverProps as k}from"payload/shared";import M from"react";function w({Component:t,sanitizeServerOnlyProps:e,toMergeIntoProps:r}){return e===void 0&&(e=!I(t)),n=>{let i=A(n,r);return e&&k.forEach(s=>{delete i[s]}),M.createElement(t,{...i})}}function A(t,e){return{...t,...e}}import{isReactServerComponentOrFunction as D}from"payload/shared";import S from"react";var z=({Component:t,serverOnlyProps:e,...r})=>t?S.createElement(n=>{let i={...n,...D(t)?e??{}:{}};return S.createElement(t,{...i})},{...r}):null;import{deepCopyObjectComplex as H}from"payload/shared";var V=["validate","customComponents"],O=t=>{let e=H(t);return V.forEach(r=>{delete e[r]}),e},N=t=>Object.keys(t).reduce((e,r)=>(e[r]=O(t[r]),e),{});import g from"react";var $=({fill:t})=>{let e=t||"var(--theme-elevation-1000)";return g.createElement("svg",{className:"graphic-icon",height:"100%",viewBox:"0 0 25 25",width:"100%",xmlns:"http://www.w3.org/2000/svg"},g.createElement("path",{d:"M11.5293 0L23 6.90096V19.9978L14.3608 25V11.9032L2.88452 5.00777L11.5293 0Z",fill:e}),g.createElement("path",{d:"M10.6559 24.2727V14.0518L2 19.0651L10.6559 24.2727Z",fill:e}))};import p from"react";var B=`
.graphic-logo path {
fill: var(--theme-elevation-1000);
}
`,Z=()=>p.createElement("svg",{className:"graphic-logo",fill:"none",height:"50",viewBox:"0 0 180 50",width:"180",xmlns:"http://www.w3.org/2000/svg"},p.createElement("style",null,E),p.createElement("path",{d:"M65.922 13.8685C71.1075 13.8685 77.0257 14.6014 77.0257 22.2185C77.0257 28.6587 71.8736 30.2243 66.0664 30.2243H62.2689V39.0961H57.2944V13.8685H65.922ZM62.2689 17.7659V26.3602H66.3773C69.4752 26.3602 71.9069 25.594 71.9069 22.2518C71.9069 18.1101 68.7424 17.7659 66.022 17.7659H62.2689Z"}),p.createElement("path",{d:"M84.3209 39.5514C80.7344 39.5514 77.5698 37.4639 77.5698 34.0884C77.5698 29.6358 82.5443 28.3145 89.8949 27.4706V27.1264C89.8949 24.2394 88.3626 23.2623 86.3084 23.2623C84.2542 23.2623 82.7219 24.2394 82.622 26.2936H78.1361C78.4803 22.6072 81.7226 19.8867 86.4861 19.8867C91.1163 19.8867 94.7028 21.7633 94.7028 28.1035C94.7028 28.692 94.6362 31.2014 94.6362 32.9114C94.6362 35.865 94.8472 37.5416 95.1914 39.1073H90.7721C90.6278 38.5188 90.4945 37.6083 90.4279 36.7089C89.0844 38.6853 87.1412 39.5514 84.3209 39.5514ZM90.0282 30.5463C84.6651 31.1015 82.511 31.7344 82.511 33.8219C82.511 35.1766 83.588 36.298 85.7532 36.298C88.7512 36.298 90.0393 34.5547 90.0393 31.4901V30.5463H90.0282Z"}),p.createElement("path",{d:"M97.2899 45.1921V41.5057H99.0998C100.699 41.5057 101.432 41.539 102.231 39.5514L102.442 39.0295L95.269 20.3753H100.521L104.763 33.8774L109.115 20.3753H113.99L107.139 38.541C104.951 44.3593 103.974 45.1921 99.3108 45.1921H97.2899Z"}),p.createElement("path",{d:"M120.263 39.1073H115.456V13.8685H120.263V39.1073Z"}),p.createElement("path",{d:"M122.406 29.7801C122.406 23.2067 126.826 19.9645 131.7 19.9645C136.575 19.9645 140.994 23.2067 140.994 29.7801C140.994 36.3535 136.575 39.5625 131.7 39.5625C126.826 39.5514 122.406 36.3535 122.406 29.7801ZM127.281 29.7801C127.281 33.6775 128.913 35.7984 131.7 35.7984C134.487 35.7984 136.119 33.6775 136.119 29.7801C136.119 25.8494 134.487 23.7286 131.7 23.7286C128.913 23.7286 127.281 25.8383 127.281 29.7801Z"}),p.createElement("path",{d:"M149.167 39.5514C145.58 39.5514 142.416 37.4639 142.416 34.0884C142.416 29.6358 147.39 28.3145 154.741 27.4706V27.1264C154.741 24.2394 153.208 23.2623 151.154 23.2623C149.1 23.2623 147.568 24.2394 147.468 26.2936H142.982C143.326 22.6072 146.568 19.8867 151.332 19.8867C155.962 19.8867 159.549 21.7633 159.549 28.1035C159.549 28.692 159.482 31.2014 159.482 32.9114C159.482 35.865 159.693 37.5416 160.037 39.1073H155.618C155.473 38.5188 155.34 37.6083 155.274 36.7089C153.941 38.6853 151.987 39.5514 149.167 39.5514ZM154.874 30.5463C149.511 31.1015 147.357 31.7344 147.357 33.8219C147.357 35.1766 148.434 36.298 150.599 36.298C153.597 36.298 154.885 34.5547 154.885 31.4901V30.5463H154.874Z"}),p.createElement("path",{d:"M175.06 39.1073V36.7422C173.872 38.7964 171.618 39.5625 169.664 39.5625C165.067 39.5625 161.625 35.7317 161.625 29.7468C161.625 23.8619 165 19.9645 169.664 19.9645C172.029 19.9645 174.05 21.0415 175.06 22.7848V13.8796H179.868V39.1073H175.06ZM175.238 29.7357C175.238 25.9716 173.494 23.6398 170.852 23.6398C168.242 23.6398 166.677 26.1159 166.677 29.7691C166.677 33.4222 168.242 35.865 170.852 35.865C173.494 35.865 175.238 33.5665 175.238 29.7357Z"}),p.createElement("path",{d:"M19.1531 0L42.049 13.8019V39.9956L24.8049 50V23.8064L1.89795 10.0155L19.1531 0Z"}),p.createElement("path",{d:"M17.4097 48.5454V28.1035L0.132324 38.1301L17.4097 48.5454Z"}));function U(t){if(t)try{t.abort()}catch{}}import*as F from"qs-esm";var q={delete:(t,e={headers:{}})=>{let r=e&&e.headers?{...e.headers}:{},o={...e,credentials:"include",headers:{...r},method:"delete"};return fetch(t,o)},get:(t,e={headers:{}})=>{let r="";return e.params&&(r=F.stringify(e.params,{addQueryPrefix:!0})),fetch(`${t}${r}`,{credentials:"include",...e})},patch:(t,e={headers:{}})=>{let r=e&&e.headers?{...e.headers}:{},o={...e,credentials:"include",headers:{...r},method:"PATCH"};return fetch(t,o)},post:(t,e={headers:{}})=>{let r=e&&e.headers?{...e.headers}:{},o={...e,credentials:"include",headers:{...r},method:"post"};return fetch(`${t}`,o)},put:(t,e={headers:{}})=>{let r=e&&e.headers?{...e.headers}:{},o={...e,credentials:"include",headers:{...r},method:"put"};return fetch(t,o)}};var j=(t,e)=>!t?.locales||t.locales.length===0?null:t.locales.find(r=>r?.code===e);var u=t=>{let{adminRoute:e,basePath:r="",path:o,serverURL:n}=t;if(e)if(e==="/"){if(!o)return`${n||""}${r}${e}`}else return`${n||""}${r}${e}${o}`;return`${n||""}${r}${o}`};import{format as z,formatDistanceToNow as ve}from"date-fns";var C=({date:t,i18n:e,pattern:r})=>{let o=new Date(t);return z(o,r,{locale:e.dateFNS})};import{getTranslation as K}from"@payloadcms/translations";var G=({collectionConfig:t,data:e,dateFormat:r,fallback:o,globalConfig:n,i18n:i})=>{let s;if(t){let a=t?.admin?.useAsTitle;if(a&&(s=e?.[a]||s,s)){let l=t.fields.find(m=>"name"in m&&m.name===a);if(l?.type==="date"){let m="date"in l.admin&&l?.admin?.date?.displayFormat||r;s=C({date:s,i18n:i,pattern:m})||s}}}return n&&(s=K(n?.label,i)||n?.slug),s||(s=o||`[${i.t("general:untitled")}]`),s};import{getTranslation as h}from"@payloadcms/translations";var S=(r=>(r.collection="collections",r.global="globals",r))(S||{});function W(t,e,r){return t.reduce((n,i)=>{if(e?.[i.type.toLowerCase()]?.[i.entity.slug]?.read.permission){let s=h(i.entity.admin.group,r);if(i.entity.admin.group){let a=n.find(d=>h(d.label,r)===s),l=a;a||(l={entities:[],label:s},n.push(l)),l.entities.push({slug:i.entity.slug,type:i.type,label:"labels"in i.entity?typeof i.entity.labels.plural=="function"?i.entity.labels.plural({t:r.t}):i.entity.labels.plural:i.entity.label})}else n.find(l=>h(l.label,r)===r.t(`general:${i.type}`)).entities.push({slug:i.entity.slug,type:i.type,label:"labels"in i.entity?typeof i.entity.labels.plural=="function"?i.entity.labels.plural({t:r.t}):i.entity.labels.plural:i.entity.label})}return n},[{entities:[],label:r.t("general:collections")},{entities:[],label:r.t("general:globals")}]).filter(n=>n.entities.length>0)}var Q=({adminRoute:t,router:e})=>{let r=u({adminRoute:t,path:"/"});e.push(r)};var _=({adminRoute:t,collectionSlug:e,router:r})=>{let o=u({adminRoute:t,path:e?`/collections/${e}`:"/"});r.push(o)};var J=(t,e,r,o,n,i,s,a,l,d)=>{if(l)try{i(t,e??r,o),n||(a.current.hasShownLockedModal=!0),a.current={hasShownLockedModal:a.current?.hasShownLockedModal,isLocked:!0,user:o},s(o),n&&d&&d(!1)}catch(m){console.error("Error during document takeover:",m)}};var X=t=>{let{collectionSlug:e,docPermissions:r,globalSlug:o,isEditing:n}=t;return e?!!(n&&r?.update?.permission||!n&&r?.create?.permission):o?!!r?.update?.permission:!1};var Y=t=>t&&typeof t=="object";var ee=({id:t,collectionSlug:e,globalSlug:r})=>!!(r||e&&t);var y=t=>Object.keys(t).length===0,te=(t,e)=>y(e)?t:y(t)?e:("and"in t?t.and.push(e):"or"in t?t={and:[t,e]}:t={and:[t,e]},t),re=({collectionConfig:t,search:e,where:r})=>{if(e){let o={...r||{}},n=(t.admin.listSearchableFields||[t.admin?.useAsTitle||"id"]).map(i=>({[i]:{like:e}}));n.length>0&&(o=te(o,{or:n})),y(o)||(r=o)}return r};export{S as EntityType,B as PayloadIcon,Z as PayloadLogo,T as Translation,H as WithServerSideProps,U as abortAndIgnore,R as filterFields,j as findLocaleFromCode,u as formatAdminURL,C as formatDate,G as formatDocTitle,L as getInitialColumns,W as groupNavItems,Q as handleBackToDashboard,_ as handleGoBack,J as handleTakeOver,X as hasSavePermission,Y as isClientUserObject,ee as isEditing,re as mergeListSearchAndWhere,$ as reduceToSerializableFields,q as requests,w as withMergedProps};
`,E=()=>p.createElement("svg",{className:"graphic-logo",fill:"none",height:"50",viewBox:"0 0 180 50",width:"180",xmlns:"http://www.w3.org/2000/svg"},p.createElement("style",null,B),p.createElement("path",{d:"M65.922 13.8685C71.1075 13.8685 77.0257 14.6014 77.0257 22.2185C77.0257 28.6587 71.8736 30.2243 66.0664 30.2243H62.2689V39.0961H57.2944V13.8685H65.922ZM62.2689 17.7659V26.3602H66.3773C69.4752 26.3602 71.9069 25.594 71.9069 22.2518C71.9069 18.1101 68.7424 17.7659 66.022 17.7659H62.2689Z"}),p.createElement("path",{d:"M84.3209 39.5514C80.7344 39.5514 77.5698 37.4639 77.5698 34.0884C77.5698 29.6358 82.5443 28.3145 89.8949 27.4706V27.1264C89.8949 24.2394 88.3626 23.2623 86.3084 23.2623C84.2542 23.2623 82.7219 24.2394 82.622 26.2936H78.1361C78.4803 22.6072 81.7226 19.8867 86.4861 19.8867C91.1163 19.8867 94.7028 21.7633 94.7028 28.1035C94.7028 28.692 94.6362 31.2014 94.6362 32.9114C94.6362 35.865 94.8472 37.5416 95.1914 39.1073H90.7721C90.6278 38.5188 90.4945 37.6083 90.4279 36.7089C89.0844 38.6853 87.1412 39.5514 84.3209 39.5514ZM90.0282 30.5463C84.6651 31.1015 82.511 31.7344 82.511 33.8219C82.511 35.1766 83.588 36.298 85.7532 36.298C88.7512 36.298 90.0393 34.5547 90.0393 31.4901V30.5463H90.0282Z"}),p.createElement("path",{d:"M97.2899 45.1921V41.5057H99.0998C100.699 41.5057 101.432 41.539 102.231 39.5514L102.442 39.0295L95.269 20.3753H100.521L104.763 33.8774L109.115 20.3753H113.99L107.139 38.541C104.951 44.3593 103.974 45.1921 99.3108 45.1921H97.2899Z"}),p.createElement("path",{d:"M120.263 39.1073H115.456V13.8685H120.263V39.1073Z"}),p.createElement("path",{d:"M122.406 29.7801C122.406 23.2067 126.826 19.9645 131.7 19.9645C136.575 19.9645 140.994 23.2067 140.994 29.7801C140.994 36.3535 136.575 39.5625 131.7 39.5625C126.826 39.5514 122.406 36.3535 122.406 29.7801ZM127.281 29.7801C127.281 33.6775 128.913 35.7984 131.7 35.7984C134.487 35.7984 136.119 33.6775 136.119 29.7801C136.119 25.8494 134.487 23.7286 131.7 23.7286C128.913 23.7286 127.281 25.8383 127.281 29.7801Z"}),p.createElement("path",{d:"M149.167 39.5514C145.58 39.5514 142.416 37.4639 142.416 34.0884C142.416 29.6358 147.39 28.3145 154.741 27.4706V27.1264C154.741 24.2394 153.208 23.2623 151.154 23.2623C149.1 23.2623 147.568 24.2394 147.468 26.2936H142.982C143.326 22.6072 146.568 19.8867 151.332 19.8867C155.962 19.8867 159.549 21.7633 159.549 28.1035C159.549 28.692 159.482 31.2014 159.482 32.9114C159.482 35.865 159.693 37.5416 160.037 39.1073H155.618C155.473 38.5188 155.34 37.6083 155.274 36.7089C153.941 38.6853 151.987 39.5514 149.167 39.5514ZM154.874 30.5463C149.511 31.1015 147.357 31.7344 147.357 33.8219C147.357 35.1766 148.434 36.298 150.599 36.298C153.597 36.298 154.885 34.5547 154.885 31.4901V30.5463H154.874Z"}),p.createElement("path",{d:"M175.06 39.1073V36.7422C173.872 38.7964 171.618 39.5625 169.664 39.5625C165.067 39.5625 161.625 35.7317 161.625 29.7468C161.625 23.8619 165 19.9645 169.664 19.9645C172.029 19.9645 174.05 21.0415 175.06 22.7848V13.8796H179.868V39.1073H175.06ZM175.238 29.7357C175.238 25.9716 173.494 23.6398 170.852 23.6398C168.242 23.6398 166.677 26.1159 166.677 29.7691C166.677 33.4222 168.242 35.865 170.852 35.865C173.494 35.865 175.238 33.5665 175.238 29.7357Z"}),p.createElement("path",{d:"M19.1531 0L42.049 13.8019V39.9956L24.8049 50V23.8064L1.89795 10.0155L19.1531 0Z"}),p.createElement("path",{d:"M17.4097 48.5454V28.1035L0.132324 38.1301L17.4097 48.5454Z"}));function Z(t){if(t)try{t.abort()}catch{}}import*as P from"qs-esm";var U={delete:(t,e={headers:{}})=>{let r=e&&e.headers?{...e.headers}:{},o={...e,credentials:"include",headers:{...r},method:"delete"};return fetch(t,o)},get:(t,e={headers:{}})=>{let r="";return e.params&&(r=P.stringify(e.params,{addQueryPrefix:!0})),fetch(`${t}${r}`,{credentials:"include",...e})},patch:(t,e={headers:{}})=>{let r=e&&e.headers?{...e.headers}:{},o={...e,credentials:"include",headers:{...r},method:"PATCH"};return fetch(t,o)},post:(t,e={headers:{}})=>{let r=e&&e.headers?{...e.headers}:{},o={...e,credentials:"include",headers:{...r},method:"post"};return fetch(`${t}`,o)},put:(t,e={headers:{}})=>{let r=e&&e.headers?{...e.headers}:{},o={...e,credentials:"include",headers:{...r},method:"put"};return fetch(t,o)}};var q=(t,e)=>!t?.locales||t.locales.length===0?null:t.locales.find(r=>r?.code===e);var u=t=>{let{adminRoute:e,basePath:r="",path:o,serverURL:n}=t;if(e)if(e==="/"){if(!o)return`${n||""}${r}${e}`}else return`${n||""}${r}${e}${o}`;return`${n||""}${r}${o}`};import{format as j,formatDistanceToNow as ve}from"date-fns";var C=({date:t,i18n:e,pattern:r})=>{let o=new Date(t);return j(o,r,{locale:e.dateFNS})};import{getTranslation as K}from"@payloadcms/translations";var G=({collectionConfig:t,data:e,dateFormat:r,fallback:o,globalConfig:n,i18n:i})=>{let s;if(t){let a=t?.admin?.useAsTitle;if(a&&(s=e?.[a]||s,s)){let l=t.fields.find(m=>"name"in m&&m.name===a);if(l?.type==="date"){let m="date"in l.admin&&l?.admin?.date?.displayFormat||r;s=C({date:s,i18n:i,pattern:m})||s}}}return n&&(s=K(n?.label,i)||n?.slug),s||(s=o||`[${i.t("general:untitled")}]`),s};import{getTranslation as h}from"@payloadcms/translations";var F=(r=>(r.collection="collections",r.global="globals",r))(F||{});function W(t,e,r){return t.reduce((n,i)=>{if(e?.[i.type.toLowerCase()]?.[i.entity.slug]?.read){let s=h(i.entity.admin.group,r);if(i.entity.admin.group){let a=n.find(d=>h(d.label,r)===s),l=a;a||(l={entities:[],label:s},n.push(l)),l.entities.push({slug:i.entity.slug,type:i.type,label:"labels"in i.entity?typeof i.entity.labels.plural=="function"?i.entity.labels.plural({t:r.t}):i.entity.labels.plural:i.entity.label})}else n.find(l=>h(l.label,r)===r.t(`general:${i.type}`)).entities.push({slug:i.entity.slug,type:i.type,label:"labels"in i.entity?typeof i.entity.labels.plural=="function"?i.entity.labels.plural({t:r.t}):i.entity.labels.plural:i.entity.label})}return n},[{entities:[],label:r.t("general:collections")},{entities:[],label:r.t("general:globals")}]).filter(n=>n.entities.length>0)}var Q=({adminRoute:t,router:e})=>{let r=u({adminRoute:t,path:"/"});e.push(r)};var _=({adminRoute:t,collectionSlug:e,router:r})=>{let o=u({adminRoute:t,path:e?`/collections/${e}`:"/"});r.push(o)};var J=(t,e,r,o,n,i,s,a,l,d)=>{if(l)try{i(t,e??r,o),n||(a.current.hasShownLockedModal=!0),a.current={hasShownLockedModal:a.current?.hasShownLockedModal,isLocked:!0,user:o},s(o),n&&d&&d(!1)}catch(m){console.error("Error during document takeover:",m)}};var X=t=>{let{collectionSlug:e,docPermissions:r,globalSlug:o,isEditing:n}=t;return e?!!(n&&r?.update||!n&&r?.create):o?!!r?.update:!1};var Y=t=>t&&typeof t=="object";var ee=({id:t,collectionSlug:e,globalSlug:r})=>!!(r||e&&t);var y=t=>Object.keys(t).length===0,te=(t,e)=>y(e)?t:y(t)?e:("and"in t?t.and.push(e):"or"in t?t={and:[t,e]}:t={and:[t,e]},t),re=({collectionConfig:t,search:e,where:r})=>{if(e){let o={...r||{}},n=(t.admin.listSearchableFields||[t.admin?.useAsTitle||"id"]).map(i=>({[i]:{like:e}}));n.length>0&&(o=te(o,{or:n})),y(o)||(r=o)}return r};export{F as EntityType,$ as PayloadIcon,E as PayloadLogo,T as Translation,z as WithServerSideProps,Z as abortAndIgnore,R as filterFields,q as findLocaleFromCode,u as formatAdminURL,C as formatDate,G as formatDocTitle,L as getInitialColumns,W as groupNavItems,Q as handleBackToDashboard,_ as handleGoBack,J as handleTakeOver,X as hasSavePermission,Y as isClientUserObject,ee as isEditing,re as mergeListSearchAndWhere,N as reduceToSerializableFields,U as requests,w as withMergedProps};
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import type { ArrayField, ClientField, FieldPermissions, Row } from 'payload';
import type { ArrayField, ClientField, Row, SanitizedFieldPermissions } from 'payload';
import React from 'react';

@@ -18,3 +18,3 @@ import type { UseDraggableSortableReturn } from '../../elements/DraggableSortable/useDraggableSortable/types.js';

readonly path: string;
readonly permissions: FieldPermissions;
readonly permissions: SanitizedFieldPermissions;
readonly readOnly?: boolean;

@@ -21,0 +21,0 @@ readonly removeRow: (rowIndex: number) => void;

@@ -66,3 +66,3 @@ 'use client';

let t6;
if ($[2] !== transform || $[3] !== transition || $[4] !== t5 || $[5] !== readOnly || $[6] !== addRow || $[7] !== duplicateRow || $[8] !== hasMaxRows || $[9] !== rowIndex || $[10] !== isSortable || $[11] !== moveRow || $[12] !== removeRow || $[13] !== rowCount || $[14] !== fieldHasErrors || $[15] !== row.id || $[16] !== row.collapsed || $[17] !== attributes || $[18] !== listeners || $[19] !== CustomRowLabel || $[20] !== fallbackLabel || $[21] !== path || $[22] !== errorCount || $[23] !== i18n || $[24] !== setCollapse || $[25] !== permissions?.fields || $[26] !== fields || $[27] !== forceRender || $[28] !== schemaPath || $[29] !== classNames || $[30] !== t4 || $[31] !== setNodeRef || $[32] !== parentPath) {
if ($[2] !== transform || $[3] !== transition || $[4] !== t5 || $[5] !== readOnly || $[6] !== addRow || $[7] !== duplicateRow || $[8] !== hasMaxRows || $[9] !== rowIndex || $[10] !== isSortable || $[11] !== moveRow || $[12] !== removeRow || $[13] !== rowCount || $[14] !== fieldHasErrors || $[15] !== row.id || $[16] !== row.collapsed || $[17] !== attributes || $[18] !== listeners || $[19] !== CustomRowLabel || $[20] !== fallbackLabel || $[21] !== path || $[22] !== errorCount || $[23] !== i18n || $[24] !== setCollapse || $[25] !== permissions || $[26] !== fields || $[27] !== forceRender || $[28] !== schemaPath || $[29] !== classNames || $[30] !== t4 || $[31] !== setNodeRef || $[32] !== parentPath) {
let t7;

@@ -136,3 +136,3 @@ if ($[34] !== fieldHasErrors || $[35] !== errorCount || $[36] !== i18n) {

parentSchemaPath: schemaPath,
permissions: permissions?.fields,
permissions: permissions === true ? permissions : permissions?.fields,
readOnly

@@ -165,3 +165,3 @@ })

$[24] = setCollapse;
$[25] = permissions?.fields;
$[25] = permissions;
$[26] = fields;

@@ -168,0 +168,0 @@ $[27] = forceRender;

@@ -488,5 +488,6 @@ 'use client';

})]
}), !readOnly && !hasMaxRows && _jsx(Button, {
}), !hasMaxRows && _jsx(Button, {
buttonStyle: "icon-label",
className: `${baseClass}__add-row`,
disabled: readOnly,
icon: "plus",

@@ -493,0 +494,0 @@ iconPosition: "left",

@@ -1,2 +0,2 @@

import type { ClientBlock, ClientField, FieldPermissions, Labels, Row } from 'payload';
import type { ClientBlock, ClientField, Labels, Row, SanitizedFieldPermissions } from 'payload';
import React from 'react';

@@ -18,3 +18,3 @@ import type { UseDraggableSortableReturn } from '../../elements/DraggableSortable/useDraggableSortable/types.js';

path: string;
permissions: FieldPermissions;
permissions: SanitizedFieldPermissions;
readOnly: boolean;

@@ -21,0 +21,0 @@ removeRow: (rowIndex: number) => void;

@@ -62,3 +62,3 @@ 'use client';

let t4;
if ($[2] !== transform || $[3] !== readOnly || $[4] !== addRow || $[5] !== blocks || $[6] !== row || $[7] !== duplicateRow || $[8] !== block || $[9] !== hasMaxRows || $[10] !== isSortable || $[11] !== labels || $[12] !== moveRow || $[13] !== removeRow || $[14] !== rowCount || $[15] !== rowIndex || $[16] !== fieldHasErrors || $[17] !== attributes || $[18] !== listeners || $[19] !== Label || $[20] !== i18n || $[21] !== path || $[22] !== errorCount || $[23] !== setCollapse || $[24] !== permissions?.blocks || $[25] !== fields || $[26] !== schemaPath || $[27] !== classNames || $[28] !== t3 || $[29] !== setNodeRef || $[30] !== parentPath) {
if ($[2] !== transform || $[3] !== readOnly || $[4] !== addRow || $[5] !== blocks || $[6] !== row || $[7] !== duplicateRow || $[8] !== block || $[9] !== hasMaxRows || $[10] !== isSortable || $[11] !== labels || $[12] !== moveRow || $[13] !== removeRow || $[14] !== rowCount || $[15] !== rowIndex || $[16] !== fieldHasErrors || $[17] !== attributes || $[18] !== listeners || $[19] !== Label || $[20] !== i18n || $[21] !== path || $[22] !== errorCount || $[23] !== setCollapse || $[24] !== permissions || $[25] !== fields || $[26] !== schemaPath || $[27] !== classNames || $[28] !== t3 || $[29] !== setNodeRef || $[30] !== parentPath) {
let t5;

@@ -144,3 +144,3 @@ if ($[32] !== Label || $[33] !== rowIndex || $[34] !== row || $[35] !== block || $[36] !== i18n || $[37] !== path || $[38] !== readOnly || $[39] !== fieldHasErrors || $[40] !== errorCount) {

parentSchemaPath: schemaPath,
permissions: permissions?.blocks?.[block.slug]?.fields,
permissions: permissions === true ? permissions : permissions?.blocks?.[block.slug]?.fields,
readOnly

@@ -172,3 +172,3 @@ })

$[23] = setCollapse;
$[24] = permissions?.blocks;
$[24] = permissions;
$[25] = fields;

@@ -175,0 +175,0 @@ $[26] = schemaPath;

@@ -469,3 +469,3 @@ 'use client';

})]
}), !readOnly && !hasMaxRows && _jsxs(Fragment, {
}), !hasMaxRows && _jsxs(Fragment, {
children: [_jsx(DrawerToggler, {

@@ -476,2 +476,3 @@ className: `${baseClass}__drawer-toggler`,

buttonStyle: "icon-label",
disabled: readOnly,
el: "span",

@@ -478,0 +479,0 @@ icon: "plus",

@@ -118,3 +118,3 @@ 'use client';

let t16;
if ($[15] !== style || $[16] !== width || $[17] !== Label || $[18] !== Description || $[19] !== label || $[20] !== i18n || $[21] !== path || $[22] !== description || $[23] !== fieldHasErrors || $[24] !== errorCount || $[25] !== permissions?.fields || $[26] !== fields || $[27] !== schemaPath || $[28] !== readOnly || $[29] !== t14 || $[30] !== t15) {
if ($[15] !== style || $[16] !== width || $[17] !== Label || $[18] !== Description || $[19] !== label || $[20] !== i18n || $[21] !== path || $[22] !== description || $[23] !== fieldHasErrors || $[24] !== errorCount || $[25] !== permissions || $[26] !== fields || $[27] !== schemaPath || $[28] !== readOnly || $[29] !== t14 || $[30] !== t15) {
let t17;

@@ -172,3 +172,3 @@ if ($[32] !== fieldHasErrors || $[33] !== errorCount || $[34] !== i18n) {

parentSchemaPath: schemaPath,
permissions: permissions?.fields,
permissions: permissions === true ? permissions : permissions?.fields,
readOnly

@@ -189,3 +189,3 @@ })]

$[24] = errorCount;
$[25] = permissions?.fields;
$[25] = permissions;
$[26] = fields;

@@ -192,0 +192,0 @@ $[27] = schemaPath;

@@ -13,31 +13,18 @@ 'use client';

const HiddenFieldComponent = props => {
const $ = _c(14);
const $ = _c(12);
const {
disableModifyingForm: t0,
field: t1,
path: pathFromProps,
path,
value: valueFromProps
} = props;
const disableModifyingForm = t0 === undefined ? true : t0;
let t2;
if ($[0] !== t1) {
t2 = t1 === undefined ? {} : t1;
$[0] = t1;
$[1] = t2;
} else {
t2 = $[1];
}
const {
name
} = t2;
const path = pathFromProps ?? (name || "");
let t3;
if ($[2] !== path) {
t3 = {
let t1;
if ($[0] !== path) {
t1 = {
path
};
$[2] = path;
$[3] = t3;
$[0] = path;
$[1] = t1;
} else {
t3 = $[3];
t1 = $[1];
}

@@ -47,7 +34,7 @@ const {

value
} = useField(t3);
let t4;
let t5;
if ($[4] !== valueFromProps || $[5] !== setValue || $[6] !== disableModifyingForm) {
t4 = () => {
} = useField(t1);
let t2;
let t3;
if ($[2] !== valueFromProps || $[3] !== setValue || $[4] !== disableModifyingForm) {
t2 = () => {
if (valueFromProps !== undefined) {

@@ -57,35 +44,35 @@ setValue(valueFromProps, disableModifyingForm);

};
t5 = [valueFromProps, setValue, disableModifyingForm];
$[4] = valueFromProps;
$[5] = setValue;
$[6] = disableModifyingForm;
$[7] = t4;
$[8] = t5;
t3 = [valueFromProps, setValue, disableModifyingForm];
$[2] = valueFromProps;
$[3] = setValue;
$[4] = disableModifyingForm;
$[5] = t2;
$[6] = t3;
} else {
t4 = $[7];
t5 = $[8];
t2 = $[5];
t3 = $[6];
}
useEffect(t4, t5);
const t6 = `field-${path?.replace(/\./g, "__")}`;
const t7 = value || "";
let t8;
if ($[9] !== t6 || $[10] !== path || $[11] !== setValue || $[12] !== t7) {
t8 = _jsx("input", {
id: t6,
useEffect(t2, t3);
const t4 = `field-${path?.replace(/\./g, "__")}`;
const t5 = value || "";
let t6;
if ($[7] !== t4 || $[8] !== path || $[9] !== setValue || $[10] !== t5) {
t6 = _jsx("input", {
id: t4,
name: path,
onChange: setValue,
type: "hidden",
value: t7
value: t5
});
$[9] = t6;
$[10] = path;
$[11] = setValue;
$[12] = t7;
$[13] = t8;
$[7] = t4;
$[8] = path;
$[9] = setValue;
$[10] = t5;
$[11] = t6;
} else {
t8 = $[13];
t6 = $[11];
}
return t8;
return t6;
};
export const HiddenField = withCondition(HiddenFieldComponent);
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import type { ClientFieldBase, FieldTypes, GenericDescriptionProps, GenericErrorProps, GenericLabelProps } from 'payload';
import type { ClientFieldBase, FieldTypes, GenericDescriptionProps, GenericErrorProps, GenericLabelProps, HiddenFieldProps } from 'payload';
import type React from 'react';

@@ -6,5 +6,6 @@ import type { ConfirmPasswordFieldProps } from './ConfirmPassword/index.js';

export type FieldTypesComponents = {
[K in 'hidden' | 'password' | FieldTypes]: React.FC<ClientFieldBase>;
[K in 'password' | FieldTypes]: React.FC<ClientFieldBase>;
} & {
confirmPassword: React.FC<ConfirmPasswordFieldProps>;
hidden: React.FC<HiddenFieldProps>;
};

@@ -11,0 +12,0 @@ export declare const fieldComponents: FieldTypesComponents;

@@ -55,3 +55,3 @@ 'use client';

} = useTranslation();
const hasReadPermission = Boolean(permissions?.collections?.[relationTo]?.read?.permission);
const hasReadPermission = Boolean(permissions?.collections?.[relationTo]?.read);
let t5;

@@ -58,0 +58,0 @@ if ($[4] !== draggableProps) {

@@ -55,3 +55,3 @@ 'use client';

} = useAuth();
const hasReadPermission = Boolean(permissions?.collections?.[relationTo]?.read?.permission);
const hasReadPermission = Boolean(permissions?.collections?.[relationTo]?.read);
let t5;

@@ -58,0 +58,0 @@ if ($[4] !== children || $[5] !== relationTo || $[6] !== hasReadPermission || $[7] !== allowEdit || $[8] !== label || $[9] !== t || $[10] !== onDocumentDrawerOpen || $[11] !== value || $[12] !== showTooltip || $[13] !== props) {

@@ -98,3 +98,3 @@ 'use client';

return _jsx(DraggableSortableItem, {
disabled: !isSortable,
disabled: !isSortable || readonly,
id,

@@ -111,3 +111,3 @@ children: draggableSortableItemProps => _jsx("div", {

size: "small",
children: [isSortable && draggableSortableItemProps && _jsx("div", {
children: [draggableSortableItemProps && _jsx("div", {
className: `${baseClass}__drag`,

@@ -114,0 +114,0 @@ ...draggableSortableItemProps.attributes,

@@ -196,3 +196,3 @@ 'use client';

bb0: {
if (readOnly || !allowCreate) {
if (!allowCreate) {
t13 = false;

@@ -203,6 +203,4 @@ break bb0;

if (permissions?.collections && permissions.collections?.[activeRelationTo]?.create) {
if (permissions.collections[activeRelationTo].create?.permission === true) {
t13 = true;
break bb0;
}
t13 = true;
break bb0;
}

@@ -629,3 +627,3 @@ }

})]
}), canCreate && _jsxs("p", {
}), canCreate && !readOnly && _jsxs("p", {
className: `${baseClass}__dragAndDropText`,

@@ -632,0 +630,0 @@ children: [t("general:or"), " ", t("upload:dragAndDrop")]

@@ -1,2 +0,2 @@

import type { Data, DocumentPermissions, DocumentPreferences, Field, FieldSchemaMap, FormState, FormStateWithoutComponents, PayloadRequest } from 'payload';
import type { Data, DocumentPreferences, Field, FieldSchemaMap, FormState, FormStateWithoutComponents, PayloadRequest, SanitizedFieldPermissions } from 'payload';
import type { RenderFieldMethod } from './types.js';

@@ -37,3 +37,5 @@ export type AddFieldStatePromiseArgs = {

passesCondition: boolean;
permissions: DocumentPermissions['fields'];
permissions: {
[fieldName: string]: SanitizedFieldPermissions;
} | null | SanitizedFieldPermissions;
preferences: DocumentPreferences;

@@ -40,0 +42,0 @@ previousFormState: FormState;

@@ -55,3 +55,4 @@ import ObjectIdImport from 'bson-objectid';

if (fieldAffectsData(field) && !(isHiddenField || disabledFromAdmin)) {
let hasPermission = typeof permissions?.[field.name]?.read === 'boolean' ? permissions[field.name].read : true;
const fieldPermissions = permissions[field.name];
let hasPermission = fieldPermissions === true || fieldPermissions?.read;
if (typeof field?.access?.read === 'function') {

@@ -153,3 +154,3 @@ hasPermission = await field.access.read({

parentSchemaPath: schemaPath,
permissions: permissions?.[field.name]?.fields || {},
permissions: fieldPermissions === true ? fieldPermissions : fieldPermissions?.fields || {},
preferences,

@@ -156,0 +157,0 @@ previousFormState,

@@ -1,2 +0,2 @@

import type { Data, DocumentPermissions, DocumentPreferences, Field, FieldSchemaMap, FormState, PayloadRequest } from 'payload';
import type { Data, DocumentPreferences, Field, FieldSchemaMap, FormState, PayloadRequest, SanitizedDocumentPermissions } from 'payload';
import type { RenderFieldMethod } from './types.js';

@@ -16,3 +16,3 @@ import { iterateFields } from './iterateFields.js';

operation?: 'create' | 'update';
permissions: DocumentPermissions['fields'];
permissions: SanitizedDocumentPermissions['fields'];
preferences: DocumentPreferences;

@@ -19,0 +19,0 @@ /**

@@ -1,2 +0,2 @@

import type { Data, DocumentPermissions, DocumentPreferences, Field as FieldSchema, FieldSchemaMap, FormState, FormStateWithoutComponents, PayloadRequest } from 'payload';
import type { Data, DocumentPreferences, Field as FieldSchema, FieldSchemaMap, FormState, FormStateWithoutComponents, PayloadRequest, SanitizedFieldPermissions } from 'payload';
import type { AddFieldStatePromiseArgs } from './addFieldStatePromise.js';

@@ -37,3 +37,5 @@ import type { RenderFieldMethod } from './types.js';

parentSchemaPath: string;
permissions: DocumentPermissions['fields'];
permissions: {
[fieldName: string]: SanitizedFieldPermissions;
} | null | SanitizedFieldPermissions;
preferences?: DocumentPreferences;

@@ -40,0 +42,0 @@ previousFormState: FormState;

@@ -32,3 +32,3 @@ import { jsx as _jsx } from "react/jsx-runtime";

});
const permissions = fieldAffectsData(fieldConfig) ? incomingPermissions?.[fieldConfig.name] : {};
const permissions = incomingPermissions === true ? true : fieldAffectsData(fieldConfig) ? incomingPermissions?.[fieldConfig.name] : {};
const clientProps = {

@@ -38,3 +38,3 @@ customComponents: fieldState?.customComponents || {},

path,
readOnly: permissions?.[operation]?.permission === false,
readOnly: permissions !== true && !permissions?.[operation],
schemaPath

@@ -41,0 +41,0 @@ };

@@ -1,2 +0,2 @@

import type { Data, DocumentPermissions, Field, FieldSchemaMap, FieldState, FormState, Operation, PayloadRequest } from 'payload';
import type { Data, Field, FieldSchemaMap, FieldState, FormState, Operation, PayloadRequest, SanitizedFieldPermissions } from 'payload';
export type RenderFieldArgs = {

@@ -13,3 +13,5 @@ data: Data;

path: string;
permissions: DocumentPermissions['fields'];
permissions: {
[fieldName: string]: SanitizedFieldPermissions;
} | null | SanitizedFieldPermissions;
previousFieldState: FieldState;

@@ -16,0 +18,0 @@ req: PayloadRequest;

@@ -48,5 +48,4 @@ 'use client';

}
const fieldPermissions = "name" in field ? permissions?.[field.name] : permissions;
const lacksReadPermission = fieldPermissions && "read" in fieldPermissions && "permission" in fieldPermissions.read && fieldPermissions?.read?.permission === false;
if (lacksReadPermission) {
const hasReadPermission = permissions === true || "name" in field && typeof permissions === "object" && permissions?.[field.name] && (permissions[field.name] === true || "read" in permissions[field.name] && permissions[field.name].read);
if ("name" in field && !hasReadPermission) {
return null;

@@ -58,4 +57,4 @@ }

}
const lacksOperationPermission = fieldPermissions && operation in fieldPermissions && "permission" in fieldPermissions[operation] && fieldPermissions[operation]?.permission === false;
if (lacksOperationPermission) {
const hasOperationPermission = permissions === true || "name" in field && typeof permissions === "object" && permissions?.[field.name] && (permissions[field.name] === true || operation in permissions[field.name] && permissions[field.name][operation]);
if ("name" in field && !hasOperationPermission) {
isReadOnly = true;

@@ -81,3 +80,3 @@ }

path,
permissions: fieldPermissions,
permissions: permissions === null || permissions === true ? true : "name" in field ? permissions?.[field.name] : permissions,
readOnly: isReadOnly,

@@ -84,0 +83,0 @@ schemaPath

@@ -1,6 +0,6 @@

import type { ClientComponentProps, ClientField, FieldPaths, FieldPermissions } from 'payload';
import type { ClientComponentProps, ClientField, FieldPaths, SanitizedFieldPermissions } from 'payload';
import React from 'react';
type RenderFieldProps = {
clientFieldConfig: ClientField;
permissions: FieldPermissions;
permissions: SanitizedFieldPermissions;
} & FieldPaths & Pick<ClientComponentProps, 'forceRender' | 'readOnly' | 'schemaPath'>;

@@ -7,0 +7,0 @@ export declare function RenderField({ clientFieldConfig, forceRender, indexPath, parentPath, parentSchemaPath, path, permissions, readOnly, schemaPath, }: RenderFieldProps): string | number | bigint | true | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>> | React.JSX.Element;

@@ -77,3 +77,2 @@ 'use client';

...baseFieldProps,
field: clientFieldConfig,
path

@@ -80,0 +79,0 @@ });

@@ -1,2 +0,2 @@

import type { ClientField, FieldPermissions } from 'payload';
import type { ClientField, SanitizedFieldPermissions } from 'payload';
export type Props = {

@@ -18,6 +18,6 @@ readonly className?: string;

readonly permissions: {
[fieldName: string]: FieldPermissions;
} | FieldPermissions | null;
[fieldName: string]: SanitizedFieldPermissions;
} | SanitizedFieldPermissions;
readonly readOnly?: boolean;
};
//# sourceMappingURL=types.d.ts.map

@@ -1,5 +0,5 @@

import type { ClientFieldProps, FieldPaths } from 'payload';
import type { FieldPaths } from 'payload';
import type { MarkOptional } from 'ts-essentials';
import React from 'react';
export declare const withCondition: <P extends MarkOptional<FieldPaths & Pick<ClientFieldProps, "field">, "indexPath" | "path">>(Field: React.ComponentType<P>) => React.FC<P>;
export declare const withCondition: <P extends MarkOptional<FieldPaths, "indexPath" | "path">>(Field: React.ComponentType<P>) => React.FC<P>;
//# sourceMappingURL=index.d.ts.map

@@ -9,15 +9,8 @@ 'use client';

const {
field: {
type
},
indexPath,
path: pathFromProps
path
} = props;
const name = 'name' in props.field ? props.field.name : undefined;
const path = pathFromProps ?? name;
return /*#__PURE__*/_jsx(WatchCondition, {
indexPath: indexPath,
name: name,
path: path,
type: type,
children: /*#__PURE__*/_jsx(Field, {

@@ -24,0 +17,0 @@ ...props

@@ -1,2 +0,1 @@

import type { FieldTypes } from 'payload';
import React from 'react';

@@ -6,6 +5,4 @@ export declare const WatchCondition: React.FC<{

indexPath: string;
name?: string;
path?: string;
type: FieldTypes;
path: string;
}>;
//# sourceMappingURL=WatchCondition.d.ts.map

@@ -10,7 +10,5 @@ 'use client';

const {
name,
children,
path: pathFromProps
path
} = props;
const path = typeof pathFromProps === "string" ? pathFromProps : name;
let t0;

@@ -17,0 +15,0 @@ if ($[0] !== path) {

import React from 'react';
import './index.scss';
export declare const ExternalLinkIcon: React.FC<{

@@ -3,0 +4,0 @@ className?: string;

import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
import './index.scss';
export const ExternalLinkIcon = props => {

@@ -8,13 +9,9 @@ const {

return /*#__PURE__*/_jsx("svg", {
className: className,
clipRule: "evenodd",
fillRule: "evenodd",
height: "100%",
viewBox: "0 0 24 24",
width: "100%",
className: [className, 'icon icon--externalLink'].filter(Boolean).join(' '),
viewBox: "0 0 20 20",
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/_jsx("path", {
d: "M14 4h-13v18h20v-11h1v12h-22v-20h14v1zm10 5h-1v-6.293l-11.646 11.647-.708-.708 11.647-11.646h-6.293v-1h8v8z",
fill: "none",
stroke: "currentColor"
className: "stroke",
d: "M16 10.6667V14.6667C16 15.0203 15.8595 15.3594 15.6095 15.6095C15.3594 15.8595 15.0203 16 14.6667 16H5.33333C4.97971 16 4.64057 15.8595 4.39052 15.6095C4.14048 15.3594 4 15.0203 4 14.6667V5.33333C4 4.97971 4.14048 4.64057 4.39052 4.39052C4.64057 4.14048 4.97971 4 5.33333 4H9.33333M16 4L10 10M16 4H12M16 4V8",
strokeLinecap: "square"
})

@@ -21,0 +18,0 @@ });

@@ -1,2 +0,2 @@

import type { ClientUser, Permissions, User } from 'payload';
import type { ClientUser, SanitizedPermissions, User } from 'payload';
import React from 'react';

@@ -11,7 +11,7 @@ export type UserWithToken<T = ClientUser> = {

logOut: () => Promise<boolean>;
permissions?: Permissions;
permissions?: SanitizedPermissions;
refreshCookie: (forceRefresh?: boolean) => void;
refreshCookieAsync: () => Promise<ClientUser>;
refreshPermissions: () => Promise<void>;
setPermissions: (permissions: Permissions) => void;
setPermissions: (permissions: SanitizedPermissions) => void;
setUser: (user: null | UserWithToken<T>) => void;

@@ -25,3 +25,3 @@ strategy?: string;

children: React.ReactNode;
permissions?: Permissions;
permissions?: SanitizedPermissions;
user?: ClientUser | null;

@@ -28,0 +28,0 @@ };

@@ -1,2 +0,2 @@

import type { ClientCollectionConfig, ClientGlobalConfig, ClientUser, Data, DocumentPermissions, DocumentPreferences, FormState, InsideFieldsPreferences, SanitizedCollectionConfig, SanitizedGlobalConfig, TypedUser } from 'payload';
import type { ClientCollectionConfig, ClientGlobalConfig, ClientUser, Data, DocumentPreferences, FormState, InsideFieldsPreferences, SanitizedCollectionConfig, SanitizedDocumentPermissions, SanitizedGlobalConfig, TypedUser } from 'payload';
import type React from 'react';

@@ -14,3 +14,3 @@ export type DocumentInfoProps = {

readonly disableLeaveWithoutSaving?: boolean;
readonly docPermissions?: DocumentPermissions;
readonly docPermissions?: SanitizedDocumentPermissions;
readonly globalSlug?: SanitizedGlobalConfig['slug'];

@@ -17,0 +17,0 @@ readonly hasPublishedDoc: boolean;

@@ -1,2 +0,2 @@

import type { Data, DocumentPermissions, Permissions } from 'payload';
import type { Data, SanitizedDocumentPermissions, SanitizedPermissions } from 'payload';
import React from 'react';

@@ -10,5 +10,5 @@ export declare const useGetDocPermissions: ({ id, api, collectionSlug, globalSlug, i18n, locale, permissions, serverURL, setDocPermissions, setHasPublishPermission, setHasSavePermission, }: {

locale: string;
permissions: Permissions;
permissions: SanitizedPermissions;
serverURL: string;
setDocPermissions: React.Dispatch<React.SetStateAction<DocumentPermissions>>;
setDocPermissions: React.Dispatch<React.SetStateAction<SanitizedDocumentPermissions>>;
setHasPublishPermission: React.Dispatch<React.SetStateAction<boolean>>;

@@ -15,0 +15,0 @@ setHasSavePermission: React.Dispatch<React.SetStateAction<boolean>>;

@@ -62,3 +62,3 @@ import * as qs from 'qs-esm';

}));
setHasPublishPermission(publishedAccessJSON?.update?.permission);
setHasPublishPermission(publishedAccessJSON?.update);
}

@@ -65,0 +65,0 @@ } else {

import type { I18nClient, Language } from '@payloadcms/translations';
import type { ClientConfig, LanguageOptions, Permissions, ServerFunctionClient, User } from 'payload';
import type { ClientConfig, LanguageOptions, SanitizedPermissions, ServerFunctionClient, User } from 'payload';
import React from 'react';

@@ -13,3 +13,3 @@ import type { Theme } from '../Theme/index.js';

readonly languageOptions: LanguageOptions;
readonly permissions: Permissions;
readonly permissions: SanitizedPermissions;
readonly serverFunction: ServerFunctionClient;

@@ -16,0 +16,0 @@ readonly switchLanguageServerAction?: (lang: string) => Promise<void>;

@@ -109,2 +109,3 @@ import { dequal } from 'dequal';

limit: 1,
pagination: false,
where: {

@@ -125,5 +126,8 @@ and: [{

}
}).then(res => res.docs[0]?.value);
let newPrefs = preferencesResult;
if (!preferencesResult || !dequal(columns, preferencesResult?.columns)) {
}).then(res => res.docs[0] ?? {
id: null,
value: {}
});
let newPrefs = preferencesResult.value;
if (!preferencesResult.id || !dequal(columns, preferencesResult?.columns)) {
const mergedPrefs = {

@@ -133,3 +137,3 @@ ...(preferencesResult || {}),

};
newPrefs = await payload.create({
const preferencesArgs = {
collection: 'payload-preferences',

@@ -144,7 +148,15 @@ data: {

},
depth: 0,
req
})?.then(res => res.value);
};
if (preferencesResult.id) {
newPrefs = await payload.update({
...preferencesArgs,
id: preferencesResult.id
})?.then(res => res.value);
} else {
newPrefs = await payload.create(preferencesArgs)?.then(res => res.value);
}
}
const fields = collectionConfig.fields;
const clientFields = clientCollectionConfig?.fields || [];
let docs = docsFromArgs;

@@ -151,0 +163,0 @@ let data;

import type { I18nClient } from '@payloadcms/translations';
import type { Permissions, SanitizedCollectionConfig, SanitizedGlobalConfig, StaticLabel } from 'payload';
import type { SanitizedCollectionConfig, SanitizedGlobalConfig, SanitizedPermissions, StaticLabel } from 'payload';
export declare enum EntityType {

@@ -22,3 +22,3 @@ collection = "collections",

};
export declare function groupNavItems(entities: EntityToGroup[], permissions: Permissions, i18n: I18nClient): NavGroupType[];
export declare function groupNavItems(entities: EntityToGroup[], permissions: SanitizedPermissions, i18n: I18nClient): NavGroupType[];
//# sourceMappingURL=groupNavItems.d.ts.map

@@ -9,3 +9,3 @@ import { getTranslation } from '@payloadcms/translations';

const result = entities.reduce((groups, entityToGroup) => {
if (permissions?.[entityToGroup.type.toLowerCase()]?.[entityToGroup.entity.slug]?.read.permission) {
if (permissions?.[entityToGroup.type.toLowerCase()]?.[entityToGroup.entity.slug]?.read) {
const translatedGroup = getTranslation(entityToGroup.entity.admin.group, i18n);

@@ -12,0 +12,0 @@ if (entityToGroup.entity.admin.group) {

@@ -1,5 +0,5 @@

import type { DocumentPermissions } from 'payload';
import type { SanitizedDocumentPermissions } from 'payload';
export declare const hasSavePermission: (args: {
collectionSlug?: string;
docPermissions: DocumentPermissions;
docPermissions: SanitizedDocumentPermissions;
globalSlug?: string;

@@ -6,0 +6,0 @@ isEditing: boolean;

@@ -9,6 +9,6 @@ export const hasSavePermission = args => {

if (collectionSlug) {
return Boolean(isEditing && docPermissions?.update?.permission || !isEditing && docPermissions?.create?.permission);
return Boolean(isEditing && docPermissions?.update || !isEditing && docPermissions?.create);
}
if (globalSlug) {
return Boolean(docPermissions?.update?.permission);
return Boolean(docPermissions?.update);
}

@@ -15,0 +15,0 @@ return false;

@@ -67,7 +67,4 @@ 'use client';

if (collection) {
const unlock = "unlock" in collection ? collection.unlock : undefined;
if (unlock) {
t2 = unlock.permission;
break bb0;
}
t2 = Boolean("unlock" in collection ? collection.unlock : undefined);
break bb0;
}

@@ -77,6 +74,7 @@ t2 = false;

const hasPermissionToUnlock = t2;
const apiKeyReadOnly = readOnly || !docPermissions?.fields?.apiKey?.update?.permission;
const enableAPIKeyReadOnly = readOnly || !docPermissions?.fields?.enableAPIKey?.update?.permission;
const canReadApiKey = docPermissions?.fields?.apiKey?.read?.permission;
const canReadEnableAPIKey = docPermissions?.fields?.enableAPIKey?.read?.permission;
const apiKeyPermissions = docPermissions?.fields === true ? true : docPermissions?.fields?.enableAPIKey;
const apiKeyReadOnly = readOnly || apiKeyPermissions === true || apiKeyPermissions && typeof apiKeyPermissions === "object" && !apiKeyPermissions?.update;
const enableAPIKeyReadOnly = readOnly || apiKeyPermissions !== true && !apiKeyPermissions?.update;
const canReadApiKey = apiKeyPermissions === true || apiKeyPermissions?.read;
const canReadEnableAPIKey = apiKeyPermissions === true || apiKeyPermissions?.read;
let t3;

@@ -159,3 +157,3 @@ if ($[0] !== setValidateBeforeSubmit || $[1] !== setSchemaPathSegments || $[2] !== collectionSlug || $[3] !== dispatchFields || $[4] !== t) {

}
const unlock_0 = t4;
const unlock = t4;
let t5;

@@ -193,3 +191,3 @@ let t6;

let t9;
if ($[20] !== disableLocalStrategy || $[21] !== docPermissions || $[22] !== loginWithUsername || $[23] !== operation || $[24] !== readOnly || $[25] !== t || $[26] !== showPasswordFields_0 || $[27] !== requirePassword || $[28] !== disabled || $[29] !== handleChangePassword || $[30] !== hasPermissionToUnlock || $[31] !== unlock_0 || $[32] !== useAPIKey || $[33] !== canReadEnableAPIKey || $[34] !== enableAPIKeyReadOnly || $[35] !== collectionSlug || $[36] !== canReadApiKey || $[37] !== enableAPIKey || $[38] !== apiKeyReadOnly || $[39] !== verify || $[40] !== t8) {
if ($[20] !== disableLocalStrategy || $[21] !== docPermissions || $[22] !== loginWithUsername || $[23] !== operation || $[24] !== readOnly || $[25] !== t || $[26] !== showPasswordFields_0 || $[27] !== requirePassword || $[28] !== disabled || $[29] !== handleChangePassword || $[30] !== hasPermissionToUnlock || $[31] !== unlock || $[32] !== useAPIKey || $[33] !== canReadEnableAPIKey || $[34] !== enableAPIKeyReadOnly || $[35] !== collectionSlug || $[36] !== canReadApiKey || $[37] !== enableAPIKey || $[38] !== apiKeyReadOnly || $[39] !== verify || $[40] !== t8) {
let t10;

@@ -298,3 +296,3 @@ if ($[42] !== useAPIKey || $[43] !== canReadEnableAPIKey || $[44] !== disabled || $[45] !== enableAPIKeyReadOnly || $[46] !== t || $[47] !== collectionSlug || $[48] !== canReadApiKey || $[49] !== enableAPIKey || $[50] !== apiKeyReadOnly) {

disabled,
onClick: () => void unlock_0(),
onClick: () => void unlock(),
size: "medium",

@@ -317,3 +315,3 @@ children: t("authentication:forceUnlock")

$[30] = hasPermissionToUnlock;
$[31] = unlock_0;
$[31] = unlock;
$[32] = useAPIKey;

@@ -320,0 +318,0 @@ $[33] = canReadEnableAPIKey;

@@ -5,3 +5,3 @@ import type { I18nClient, TFunction } from '@payloadcms/translations';

import './index.scss';
type Props = {
export type ListHeaderProps = {
className?: string;

@@ -18,4 +18,3 @@ collectionConfig: ClientCollectionConfig;

};
export declare const ListHeader: React.FC<Props>;
export {};
export declare const ListHeader: React.FC<ListHeaderProps>;
//# sourceMappingURL=index.d.ts.map
import type { I18n } from '@payloadcms/translations';
import type { AdminViewProps, Locale, Payload, Permissions, SanitizedCollectionConfig, User } from 'payload';
import type { AdminViewProps, Locale, Payload, SanitizedCollectionConfig, SanitizedPermissions, User } from 'payload';
import type { ColumnPreferences } from '../../providers/ListQuery/index.js';

@@ -28,3 +28,3 @@ export type DefaultListViewProps = {

payload: Payload;
permissions: Permissions;
permissions: SanitizedPermissions;
searchParams: AdminViewProps['searchParams'];

@@ -31,0 +31,0 @@ user: User;

{
"name": "@payloadcms/ui",
"version": "3.0.0-beta.130",
"version": "3.0.0-beta.131",
"homepage": "https://payloadcms.com",

@@ -112,3 +112,3 @@ "repository": {

"bson-objectid": "2.0.4",
"date-fns": "3.3.1",
"date-fns": "4.1.0",
"dequal": "2.0.3",

@@ -127,3 +127,3 @@ "md5": "2.3.0",

"uuid": "10.0.0",
"@payloadcms/translations": "3.0.0-beta.130"
"@payloadcms/translations": "3.0.0-beta.131"
},

@@ -147,3 +147,3 @@ "devDependencies": {

"@payloadcms/eslint-config": "3.0.0-beta.112",
"payload": "3.0.0-beta.130"
"payload": "3.0.0-beta.131"
},

@@ -154,3 +154,3 @@ "peerDependencies": {

"react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
"payload": "3.0.0-beta.130"
"payload": "3.0.0-beta.131"
},

@@ -157,0 +157,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc