@payloadcms/ui 3.0.0-beta.81 → 3.0.0-beta.82

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.
Files changed (42) hide show
  1. package/dist/elements/Hamburger/index.d.ts +2 -2
  2. package/dist/elements/Hamburger/index.d.ts.map +1 -1
  3. package/dist/elements/Hamburger/index.js +2 -1
  4. package/dist/elements/Hamburger/index.js.map +1 -1
  5. package/dist/elements/ListControls/index.d.ts +7 -7
  6. package/dist/elements/ListControls/index.d.ts.map +1 -1
  7. package/dist/elements/ListControls/index.js +1 -1
  8. package/dist/elements/ListControls/index.js.map +1 -1
  9. package/dist/elements/ReactSelect/DropdownIndicator/index.d.ts.map +1 -1
  10. package/dist/elements/ReactSelect/DropdownIndicator/index.js +1 -1
  11. package/dist/elements/ReactSelect/DropdownIndicator/index.js.map +1 -1
  12. package/dist/elements/StepNav/index.d.ts.map +1 -1
  13. package/dist/elements/StepNav/index.js +1 -1
  14. package/dist/elements/StepNav/index.js.map +1 -1
  15. package/dist/elements/Table/DefaultCell/fields/Date/index.d.ts.map +1 -1
  16. package/dist/elements/Table/DefaultCell/fields/Date/index.js +1 -1
  17. package/dist/elements/Table/DefaultCell/fields/Date/index.js.map +1 -1
  18. package/dist/elements/TableColumns/buildColumnState.d.ts.map +1 -1
  19. package/dist/elements/TableColumns/buildColumnState.js +1 -1
  20. package/dist/elements/TableColumns/buildColumnState.js.map +1 -1
  21. package/dist/elements/Upload/index.d.ts +9 -9
  22. package/dist/elements/Upload/index.d.ts.map +1 -1
  23. package/dist/elements/Upload/index.js +5 -2
  24. package/dist/elements/Upload/index.js.map +1 -1
  25. package/dist/exports/client/index.js +7 -7
  26. package/dist/exports/client/index.js.map +4 -4
  27. package/dist/fields/Password/index.d.ts.map +1 -1
  28. package/dist/fields/Password/index.js +3 -1
  29. package/dist/fields/Password/index.js.map +1 -1
  30. package/dist/forms/RenderFields/RenderField.d.ts.map +1 -1
  31. package/dist/forms/RenderFields/RenderField.js +2 -1
  32. package/dist/forms/RenderFields/RenderField.js.map +1 -1
  33. package/dist/graphics/Account/index.js +3 -3
  34. package/dist/graphics/Account/index.js.map +1 -1
  35. package/dist/providers/Actions/index.d.ts +3 -3
  36. package/dist/providers/Actions/index.d.ts.map +1 -1
  37. package/dist/providers/Actions/index.js +1 -1
  38. package/dist/providers/Actions/index.js.map +1 -1
  39. package/dist/styles.css +1 -1
  40. package/dist/utilities/reduceFieldsToValuesWithValidation.js +1 -1
  41. package/dist/utilities/reduceFieldsToValuesWithValidation.js.map +1 -1
  42. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Password/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAKpD,OAAO,cAAc,CAAA;AAoGrB,eAAO,MAAM,aAAa,8BAAwC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Password/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAQpD,OAAO,cAAc,CAAA;AAoGrB,eAAO,MAAM,aAAa,8BAAwC,CAAA"}
@@ -1,10 +1,12 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useConfig, useLocale, useTranslation } from '@payloadcms/ui';
4
3
  import { password } from 'payload/shared';
5
4
  import React, { useCallback } from 'react';
6
5
  import { useField } from '../../forms/useField/index.js';
7
6
  import { withCondition } from '../../forms/withCondition/index.js';
7
+ import { useConfig } from '../../providers/Config/index.js';
8
+ import { useLocale } from '../../providers/Locale/index.js';
9
+ import { useTranslation } from '../../providers/Translation/index.js';
8
10
  import { isFieldRTL } from '../shared/index.js';
9
11
  import './index.scss';
10
12
  import { PasswordInput } from './input.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/Password/index.tsx"],"sourcesContent":["'use client'\nimport type { PasswordFieldValidation, PayloadRequest } from 'payload'\n\nimport { useConfig, useLocale, useTranslation } from '@payloadcms/ui'\nimport { password } from 'payload/shared'\nimport React, { useCallback } from 'react'\n\nimport type { PasswordFieldProps } from './types.js'\n\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { isFieldRTL } from '../shared/index.js'\nimport './index.scss'\nimport { PasswordInput } from './input.js'\n\nconst PasswordFieldComponent: React.FC<PasswordFieldProps> = (props) => {\n const {\n autoComplete,\n errorProps,\n field,\n field: {\n name,\n _path: pathFromProps,\n admin: {\n className,\n description,\n disabled: disabledFromProps,\n placeholder,\n rtl,\n style,\n width,\n } = {} as PasswordFieldProps['field']['admin'],\n label,\n required,\n } = {} as PasswordFieldProps['field'],\n inputRef,\n labelProps,\n validate,\n } = props\n\n const { t } = useTranslation()\n const locale = useLocale()\n const { config } = useConfig()\n\n const memoizedValidate: PasswordFieldValidation = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n\n return password(value, {\n name: 'password',\n type: 'text',\n data: {},\n preferences: { fields: {} },\n req: {\n payload: {\n config,\n },\n t,\n } as unknown as PayloadRequest,\n required: true,\n siblingData: {},\n })\n },\n [validate, config, t, required],\n )\n\n const { formInitializing, formProcessing, path, setValue, showError, value } = useField({\n path: pathFromProps || name,\n validate: memoizedValidate,\n })\n\n const disabled = disabledFromProps || formInitializing || formProcessing\n\n const renderRTL = isFieldRTL({\n fieldLocalized: false,\n fieldRTL: rtl,\n locale,\n localizationConfig: config.localization || undefined,\n })\n\n return (\n <PasswordInput\n Description={field?.admin?.components?.Description}\n Error={field?.admin?.components?.Error}\n Label={field?.admin?.components?.Label}\n afterInput={field?.admin?.components?.afterInput}\n autoComplete={autoComplete}\n beforeInput={field?.admin?.components?.beforeInput}\n className={className}\n description={description}\n errorProps={errorProps}\n inputRef={inputRef}\n label={label}\n labelProps={labelProps}\n onChange={(e) => {\n setValue(e.target.value)\n }}\n path={path}\n placeholder={placeholder}\n readOnly={disabled}\n required={required}\n rtl={renderRTL}\n showError={showError}\n style={style}\n value={(value as string) || ''}\n width={width}\n />\n )\n}\n\nexport const PasswordField = withCondition(PasswordFieldComponent)\n"],"names":["useConfig","useLocale","useTranslation","password","React","useCallback","useField","withCondition","isFieldRTL","PasswordInput","PasswordFieldComponent","props","autoComplete","errorProps","field","name","_path","pathFromProps","admin","className","description","disabled","disabledFromProps","placeholder","rtl","style","width","label","required","inputRef","labelProps","validate","t","locale","config","memoizedValidate","value","options","type","data","preferences","fields","req","payload","siblingData","formInitializing","formProcessing","path","setValue","showError","renderRTL","fieldLocalized","fieldRTL","localizationConfig","localization","undefined","Description","components","Error","Label","afterInput","beforeInput","onChange","e","target","readOnly","PasswordField"],"mappings":"AAAA;;AAGA,SAASA,SAAS,EAAEC,SAAS,EAAEC,cAAc,QAAQ,iBAAgB;AACrE,SAASC,QAAQ,QAAQ,iBAAgB;AACzC,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAI1C,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,UAAU,QAAQ,qBAAoB;AAC/C,OAAO,eAAc;AACrB,SAASC,aAAa,QAAQ,aAAY;AAE1C,MAAMC,yBAAuD,CAACC;IAC5D,MAAM,EACJC,YAAY,EACZC,UAAU,EACVC,KAAK,EACLA,OAAO,EACLC,IAAI,EACJC,OAAOC,aAAa,EACpBC,OAAO,EACLC,SAAS,EACTC,WAAW,EACXC,UAAUC,iBAAiB,EAC3BC,WAAW,EACXC,GAAG,EACHC,KAAK,EACLC,KAAK,EACN,GAAG,CAAC,CAAyC,EAC9CC,KAAK,EACLC,QAAQ,EACT,GAAG,CAAC,CAAgC,EACrCC,QAAQ,EACRC,UAAU,EACVC,QAAQ,EACT,GA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UAAU5C;QACVO,UAAUA;QACVJ,KAAK0B;QACLD,WAAWA;QACXxB,OAAOA;QACPW,OAAO,AAACA,SAAoB;QAC5BV,OAAOA;;AAGb;AAEA,OAAO,MAAMwC,gBAAgB3D,cAAcG,wBAAuB"}
1
+ {"version":3,"sources":["../../../src/fields/Password/index.tsx"],"sourcesContent":["'use client'\nimport type { PasswordFieldValidation, PayloadRequest } from 'payload'\n\nimport { password } from 'payload/shared'\nimport React, { useCallback } from 'react'\n\nimport type { PasswordFieldProps } from './types.js'\n\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useLocale } from '../../providers/Locale/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { isFieldRTL } from '../shared/index.js'\nimport './index.scss'\nimport { PasswordInput } from './input.js'\n\nconst PasswordFieldComponent: React.FC<PasswordFieldProps> = (props) => {\n const {\n autoComplete,\n errorProps,\n field,\n field: {\n name,\n _path: pathFromProps,\n admin: {\n className,\n description,\n disabled: disabledFromProps,\n placeholder,\n rtl,\n style,\n width,\n } = {} as PasswordFieldProps['field']['admin'],\n label,\n required,\n } = {} as PasswordFieldProps['field'],\n inputRef,\n labelProps,\n validate,\n } = props\n\n const { t } = useTranslation()\n const locale = useLocale()\n const { config } = useConfig()\n\n const memoizedValidate: PasswordFieldValidation = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n\n return password(value, {\n name: 'password',\n type: 'text',\n data: {},\n preferences: { fields: {} },\n req: {\n payload: {\n config,\n },\n t,\n } as unknown as PayloadRequest,\n required: true,\n siblingData: {},\n })\n },\n [validate, config, t, required],\n )\n\n const { formInitializing, formProcessing, path, setValue, showError, value } = useField({\n path: pathFromProps || name,\n validate: memoizedValidate,\n })\n\n const disabled = disabledFromProps || formInitializing || formProcessing\n\n const renderRTL = isFieldRTL({\n fieldLocalized: false,\n fieldRTL: rtl,\n locale,\n localizationConfig: config.localization || undefined,\n })\n\n return (\n <PasswordInput\n Description={field?.admin?.components?.Description}\n Error={field?.admin?.components?.Error}\n Label={field?.admin?.components?.Label}\n afterInput={field?.admin?.components?.afterInput}\n autoComplete={autoComplete}\n beforeInput={field?.admin?.components?.beforeInput}\n className={className}\n description={description}\n errorProps={errorProps}\n inputRef={inputRef}\n label={label}\n labelProps={labelProps}\n onChange={(e) => {\n setValue(e.target.value)\n }}\n path={path}\n placeholder={placeholder}\n readOnly={disabled}\n required={required}\n rtl={renderRTL}\n showError={showError}\n style={style}\n value={(value as string) || ''}\n width={width}\n />\n )\n}\n\nexport const PasswordField = withCondition(PasswordFieldComponent)\n"],"names":["password","React","useCallback","useField","withCondition","useConfig","useLocale","useTranslation","isFieldRTL","PasswordInput","PasswordFieldComponent","props","autoComplete","errorProps","field","name","_path","pathFromProps","admin","className","description","disabled","disabledFromProps","placeholder","rtl","style","width","label","required","inputRef","labelProps","validate","t","locale","config","memoizedValidate","value","options","type","data","preferences","fields","req","payload","siblingData","formInitializing","formProcessing","path","setValue","showError","renderRTL","fieldLocalized","fieldRTL","localizationConfig","localization","undefined","Description","components","Error","Label","afterInput","beforeInput","onChange","e","target","readOnly","PasswordField"],"mappings":"AAAA;;AAGA,SAASA,QAAQ,QAAQ,iBAAgB;AACzC,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAI1C,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,UAAU,QAAQ,qBAAoB;AAC/C,OAAO,eAAc;AACrB,SAASC,aAAa,QAAQ,aAAY;AAE1C,MAAMC,yBAAuD,CAACC;IAC5D,MAAM,EACJC,YAAY,EACZC,UAAU,EACVC,KAAK,EACLA,OAAO,EACLC,IAAI,EACJC,OAAOC,aAAa,EACpBC,OAA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vC,CAAA"}
1
+ {"version":3,"file":"RenderField.d.ts","sourceRoot":"","sources":["../../../src/forms/RenderFields/RenderField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE5D,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,mBAAmB,CAAC,EAAE;QAC7B,KAAK,EAAE,WAAW,CAAA;QAClB,WAAW,CAAC,EAAE,OAAO,CAAA;QACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,CAAA;IACD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAA;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,kBAAkB,EAAE;QAC3B,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;KACtC,CAAA;CACF,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAqFvC,CAAA"}
@@ -1,8 +1,9 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { HiddenField, useFieldComponents } from '@payloadcms/ui';
4
3
  import React from 'react';
4
+ import { HiddenField } from '../../fields/Hidden/index.js';
5
5
  import { RenderComponent } from '../../providers/Config/RenderComponent.js';
6
+ import { useFieldComponents } from '../../providers/FieldComponents/index.js';
6
7
  import { useOperation } from '../../providers/Operation/index.js';
7
8
  import { FieldPropsProvider, useFieldProps } from '../FieldPropsProvider/index.js';
8
9
  export const RenderField = ({ name, fieldComponentProps, indexPath, path: pathFromProps, permissions, schemaPath: schemaPathFromProps, siblingPermissions })=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/forms/RenderFields/RenderField.tsx"],"sourcesContent":["'use client'\n\nimport type { ClientField, FieldPermissions } from 'payload'\n\nimport { HiddenField, useFieldComponents } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { RenderComponent } from '../../providers/Config/RenderComponent.js'\nimport { useOperation } from '../../providers/Operation/index.js'\nimport { FieldPropsProvider, useFieldProps } from '../FieldPropsProvider/index.js'\n\ntype Props = {\n readonly fieldComponentProps?: {\n field: ClientField\n forceRender?: boolean\n readOnly?: boolean\n }\n readonly indexPath?: string\n readonly isHidden?: boolean\n readonly name?: string\n readonly path: string\n readonly permissions?: FieldPermissions\n readonly schemaPath: string\n readonly siblingPermissions: {\n [fieldName: string]: FieldPermissions\n }\n}\n\nexport const RenderField: React.FC<Props> = ({\n name,\n fieldComponentProps,\n indexPath,\n path: pathFromProps,\n permissions,\n schemaPath: schemaPathFromProps,\n siblingPermissions,\n}) => {\n const fieldComponents = useFieldComponents()\n const operation = useOperation()\n const { readOnly: readOnlyFromContext } = useFieldProps()\n\n if (!fieldComponents) {\n return null\n }\n\n const path = [pathFromProps, name].filter(Boolean).join('.')\n const schemaPath = [schemaPathFromProps, name].filter(Boolean).join('.')\n\n // if the user cannot read the field, then filter it out\n // this is different from `admin.readOnly` which is executed based on `operation`\n if (permissions?.read?.permission === false || fieldComponentProps?.field?.admin?.disabled) {\n return null\n }\n\n // `admin.readOnly` displays the value but prevents the field from being edited\n fieldComponentProps.readOnly = fieldComponentProps?.field?.admin?.readOnly\n\n // if parent field is `readOnly: true`, but this field is `readOnly: false`, the field should still be editable\n if (readOnlyFromContext && fieldComponentProps.readOnly !== false)\n fieldComponentProps.readOnly = true\n\n // if the user does not have access control to begin with, force it to be read-only\n if (permissions?.[operation]?.permission === false) {\n fieldComponentProps.readOnly = true\n }\n\n let RenderedField: React.ReactElement\n\n if (fieldComponentProps?.field?.admin?.components?.Field === null) {\n return null\n }\n\n // hide from admin if field is `admin.hidden: true`\n if (\n 'admin' in fieldComponentProps.field &&\n 'hidden' in fieldComponentProps.field.admin &&\n fieldComponentProps.field.admin.hidden\n ) {\n RenderedField = (\n <HiddenField\n field={fieldComponentProps.field}\n forceRender={fieldComponentProps.forceRender}\n readOnly={fieldComponentProps.readOnly}\n />\n )\n } else {\n RenderedField = (\n <RenderComponent\n Component={fieldComponents?.[fieldComponentProps?.field?.type]}\n clientProps={{\n field: fieldComponentProps.field,\n forceRender: fieldComponentProps.forceRender,\n readOnly: fieldComponentProps.readOnly,\n }}\n mappedComponent={fieldComponentProps?.field?.admin?.components?.Field}\n />\n )\n }\n\n return (\n <FieldPropsProvider\n custom={fieldComponentProps?.field?.admin?.custom}\n indexPath={indexPath}\n path={path}\n permissions={permissions}\n readOnly={fieldComponentProps.readOnly}\n schemaPath={schemaPath}\n siblingPermissions={siblingPermissions}\n type={fieldComponentProps?.field?.type}\n >\n {RenderedField}\n </FieldPropsProvider>\n )\n}\n"],"names":["HiddenField","useFieldComponents","React","RenderComponent","useOperation","FieldPropsProvider","useFieldProps","RenderField","name","fieldComponentProps","indexPath","path","pathFromProps","permissions","schemaPath","schemaPathFromProps","siblingPermissions","fieldComponents","operation","readOnly","readOnlyFromContext","filter","Boolean","join","read","permission","field","admin","disabled","RenderedField","components","Field","hidden","forceRender","Component","type","clientProps","mappedComponent","custom"],"mappings":"AAAA;;AAIA,SAASA,WAAW,EAAEC,kBAAkB,QAAQ,iBAAgB;AAChE,OAAOC,WAAW,QAAO;AAEzB,SAASC,eAAe,QAAQ,4CAA2C;AAC3E,SAASC,YAAY,QAAQ,qCAAoC;AACjE,SAASC,kBAAkB,EAAEC,aAAa,QAAQ,iCAAgC;AAmBlF,OAAO,MAAMC,cAA+B,CAAC,EAC3CC,IAAI,EACJC,mBAAmB,EACnBC,SAAS,EACTC,MAAMC,aAAa,EACnBC,WAAW,EACXC,YAAYC,mBAAmB,EAC/BC,kBAAkB,EACnB;IACC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QAAQ;YACxC;YACAkB,iBAAiB5B,qBAAqBiB,OAAOC,OAAOG,YAAYC;;IAGtE;IAEA,qBACE,KAAC1B;QACCiC,QAAQ7B,qBAAqBiB,OAAOC,OAAOW;QAC3C5B,WAAWA;QACXC,MAAMA;QACNE,aAAaA;QACbM,UAAUV,oBAAoBU,QAAQ;QACtCL,YAAYA;QACZE,oBAAoBA;QACpBmB,MAAM1B,qBAAqBiB,OAAOS;kBAEjCN;;AAGP,EAAC"}
1
+ {"version":3,"sources":["../../../src/forms/RenderFields/RenderField.tsx"],"sourcesContent":["'use client'\n\nimport type { ClientField, FieldPermissions } from 'payload'\n\nimport React from 'react'\n\nimport { HiddenField } from '../../fields/Hidden/index.js'\nimport { RenderComponent } from '../../providers/Config/RenderComponent.js'\nimport { useFieldComponents } from '../../providers/FieldComponents/index.js'\nimport { useOperation } from '../../providers/Operation/index.js'\nimport { FieldPropsProvider, useFieldProps } from '../FieldPropsProvider/index.js'\n\ntype Props = {\n readonly fieldComponentProps?: {\n field: ClientField\n forceRender?: boolean\n readOnly?: boolean\n }\n readonly indexPath?: string\n readonly isHidden?: boolean\n readonly name?: string\n readonly path: string\n readonly permissions?: FieldPermissions\n readonly schemaPath: string\n readonly siblingPermissions: {\n [fieldName: string]: FieldPermissions\n }\n}\n\nexport const RenderField: React.FC<Props> = ({\n name,\n fieldComponentProps,\n indexPath,\n path: pathFromProps,\n permissions,\n schemaPath: schemaPathFromProps,\n siblingPermissions,\n}) => {\n const fieldComponents = useFieldComponents()\n const operation = useOperation()\n const { readOnly: readOnlyFromContext } = useFieldProps()\n\n if (!fieldComponents) {\n return null\n }\n\n const path = [pathFromProps, name].filter(Boolean).join('.')\n const schemaPath = [schemaPathFromProps, name].filter(Boolean).join('.')\n\n // if the user cannot read the field, then filter it out\n // this is different from `admin.readOnly` which is executed based on `operation`\n if (permissions?.read?.permission === false || fieldComponentProps?.field?.admin?.disabled) {\n return null\n }\n\n // `admin.readOnly` displays the value but prevents the field from being edited\n fieldComponentProps.readOnly = fieldComponentProps?.field?.admin?.readOnly\n\n // if parent field is `readOnly: true`, but this field is `readOnly: false`, the field should still be editable\n if (readOnlyFromContext && fieldComponentProps.readOnly !== false)\n fieldComponentProps.readOnly = true\n\n // if the user does not have access control to begin with, force it to be read-only\n if (permissions?.[operation]?.permission === false) {\n fieldComponentProps.readOnly = true\n }\n\n let RenderedField: React.ReactElement\n\n if (fieldComponentProps?.field?.admin?.components?.Field === null) {\n return null\n }\n\n // hide from admin if field is `admin.hidden: true`\n if (\n 'admin' in fieldComponentProps.field &&\n 'hidden' in fieldComponentProps.field.admin &&\n fieldComponentProps.field.admin.hidden\n ) {\n RenderedField = (\n <HiddenField\n field={fieldComponentProps.field}\n forceRender={fieldComponentProps.forceRender}\n readOnly={fieldComponentProps.readOnly}\n />\n )\n } else {\n RenderedField = (\n <RenderComponent\n Component={fieldComponents?.[fieldComponentProps?.field?.type]}\n clientProps={{\n field: fieldComponentProps.field,\n forceRender: fieldComponentProps.forceRender,\n readOnly: fieldComponentProps.readOnly,\n }}\n mappedComponent={fieldComponentProps?.field?.admin?.components?.Field}\n />\n )\n }\n\n return (\n <FieldPropsProvider\n custom={fieldComponentProps?.field?.admin?.custom}\n indexPath={indexPath}\n path={path}\n permissions={permissions}\n readOnly={fieldComponentProps.readOnly}\n schemaPath={schemaPath}\n siblingPermissions={siblingPermissions}\n type={fieldComponentProps?.field?.type}\n >\n {RenderedField}\n </FieldPropsProvider>\n )\n}\n"],"names":["React","HiddenField","RenderComponent","useFieldComponents","useOperation","FieldPropsProvider","useFieldProps","RenderField","name","fieldComponentProps","indexPath","path","pathFromProps","permissions","schemaPath","schemaPathFromProps","siblingPermissions","fieldComponents","operation","readOnly","readOnlyFromContext","filter","Boolean","join","read","permission","field","admin","disabled","RenderedField","components","Field","hidden","forceRender","Component","type","clientProps","mappedComponent","custom"],"mappings":"AAAA;;AAIA,OAAOA,WAAW,QAAO;AAEzB,SAASC,WAAW,QAAQ,+BAA8B;AAC1D,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KAAC5B;YACCyB,OAAOjB,oBAAoBiB,KAAK;YAChCO,aAAaxB,oBAAoBwB,WAAW;YAC5Cd,UAAUV,oBAAoBU,QAAQ;;IAG5C,OAAO;QACLU,8BACE,KAAC3B;YACCgC,WAAWjB,iBAAiB,CAACR,qBAAqBiB,OAAOS,KAAK;YAC9DC,aAAa;gBACXV,OAAOjB,oBAAoBiB,KAAK;gBAChCO,aAAaxB,oBAAoBwB,WAAW;gBAC5Cd,UAAUV,oBAAoBU,QAAQ;YACxC;YACAkB,iBAAiB5B,qBAAqBiB,OAAOC,OAAOG,YAAYC;;IAGtE;IAEA,qBACE,KAAC1B;QACCiC,QAAQ7B,qBAAqBiB,OAAOC,OAAOW;QAC3C5B,WAAWA;QACXC,MAAMA;QACNE,aAAaA;QACbM,UAAUV,oBAAoBU,QAAQ;QACtCL,YAAYA;QACZE,oBAAoBA;QACpBmB,MAAM1B,qBAAqBiB,OAAOS;kBAEjCN;;AAGP,EAAC"}
@@ -2,14 +2,14 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { usePathname } from 'next/navigation.js';
4
4
  import React from 'react';
5
+ import { useAuth } from '../../providers/Auth/index.js';
5
6
  import { RenderComponent } from '../../providers/Config/RenderComponent.js';
6
7
  import { useConfig } from '../../providers/Config/index.js';
7
8
  import { formatAdminURL } from '../../utilities/formatAdminURL.js';
8
- import { GravatarAccountIcon } from './Gravatar/index.js';
9
- import { useAuth } from '@payloadcms/ui';
10
9
  import { DefaultAccountIcon } from './Default/index.js';
10
+ import { GravatarAccountIcon } from './Gravatar/index.js';
11
11
  export const Account = ()=>{
12
- const { config: { admin: { avatar, routes: { account: accountRoute }, components: { Avatar: CustomAvatar } }, routes: { admin: adminRoute } } } = useConfig();
12
+ const { config: { admin: { avatar, components: { Avatar: CustomAvatar }, routes: { account: accountRoute } }, routes: { admin: adminRoute } } } = useConfig();
13
13
  const { user } = useAuth();
14
14
  const pathname = usePathname();
15
15
  const isOnAccountPage = pathname === formatAdminURL({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/graphics/Account/index.tsx"],"sourcesContent":["'use client'\nimport { usePathname } from 'next/navigation.js'\nimport React from 'react'\n\nimport { RenderComponent } from '../../providers/Config/RenderComponent.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { formatAdminURL } from '../../utilities/formatAdminURL.js'\nimport { GravatarAccountIcon } from './Gravatar/index.js'\nimport { useAuth } from '@payloadcms/ui'\nimport { DefaultAccountIcon } from './Default/index.js'\n\nexport const Account = () => {\n const {\n config: {\n admin: {\n avatar,\n routes: { account: accountRoute },\n components: { Avatar: CustomAvatar },\n },\n routes: { admin: adminRoute },\n },\n } = useConfig()\n\n const { user } = useAuth()\n const pathname = usePathname()\n const isOnAccountPage = pathname === formatAdminURL({ adminRoute, path: accountRoute })\n\n if (CustomAvatar) {\n return (\n <RenderComponent\n clientProps={{\n active: isOnAccountPage,\n }}\n mappedComponent={CustomAvatar}\n />\n )\n }\n\n if (!user?.email || avatar === 'default') return <DefaultAccountIcon active={isOnAccountPage} />\n if (avatar === 'gravatar') return <GravatarAccountIcon />\n}\n"],"names":["usePathname","React","RenderComponent","useConfig","formatAdminURL","GravatarAccountIcon","useAuth","DefaultAccountIcon","Account","config","admin","avatar","routes","account","accountRoute","components","Avatar","CustomAvatar","adminRoute","user","pathname","isOnAccountPage","path","clientProps","active","mappedComponent","email"],"mappings":"AAAA;;AACA,SAASA,WAAW,QAAQ,qBAAoB;AAChD,OAAOC,WAAW,QAAO;AAEzB,SAASC,eAAe,QAAQ,4CAA2C;AAC3E,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,cAAc,QAAQ,oCAAmC;AAClE,SAASC,mBAAmB,QAAQ,sBAAqB;AACzD,SAASC,OAAO,QAAQ,iBAAgB;AACxC,SAASC,kBAAkB,QAAQ,qBAAoB;AAEvD,OAAO,MAAMC,UAAU;IACrB,MAAM,EACJC,QAAQ,EACNC,OAAO,EACLC,MAAM,EACNC,QAAQ,EAAEC,SAASC,YAAY,EAAE,EACjCC,YAAY,EAAEC,QAAQC,YAAY,EAAE,EACrC,EACDL,QAAQ,EAAEF,OAAOQ,UAAU,EAAE,EAC9B,EACF,GAAGf;IAEJ,MAAM,EAAEgB,IAAI,EAAE,GAAGb;IACjB,MAAMc,WAAWpB;IACjB,MAAMqB,kBAAkBD,aAAahB,eAAe;QAAEc;QAAYI,MAAMR;IAAa;IAErF,IAAIG,cAAc;QAChB,qBACE,KAACf;YACCqB,aAAa;gBACXC,QAAQH;YACV;YACAI,iBAAiBR;;IAGvB;IAEA,IAAI,CAACE,MAAMO,SAASf,WAAW,WAAW,qBAAO,KAACJ;QAAmBiB,QAAQH;;IAC7E,IAAIV,WAAW,YAAY,qBAAO,KAACN;AACrC,EAAC"}
1
+ {"version":3,"sources":["../../../src/graphics/Account/index.tsx"],"sourcesContent":["'use client'\nimport { usePathname } from 'next/navigation.js'\nimport React from 'react'\n\nimport { useAuth } from '../../providers/Auth/index.js'\nimport { RenderComponent } from '../../providers/Config/RenderComponent.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { formatAdminURL } from '../../utilities/formatAdminURL.js'\nimport { DefaultAccountIcon } from './Default/index.js'\nimport { GravatarAccountIcon } from './Gravatar/index.js'\n\nexport const Account = () => {\n const {\n config: {\n admin: {\n avatar,\n components: { Avatar: CustomAvatar },\n routes: { account: accountRoute },\n },\n routes: { admin: adminRoute },\n },\n } = useConfig()\n\n const { user } = useAuth()\n const pathname = usePathname()\n const isOnAccountPage = pathname === formatAdminURL({ adminRoute, path: accountRoute })\n\n if (CustomAvatar) {\n return (\n <RenderComponent\n clientProps={{\n active: isOnAccountPage,\n }}\n mappedComponent={CustomAvatar}\n />\n )\n }\n\n if (!user?.email || avatar === 'default') return <DefaultAccountIcon active={isOnAccountPage} />\n if (avatar === 'gravatar') return <GravatarAccountIcon />\n}\n"],"names":["usePathname","React","useAuth","RenderComponent","useConfig","formatAdminURL","DefaultAccountIcon","GravatarAccountIcon","Account","config","admin","avatar","components","Avatar","CustomAvatar","routes","account","accountRoute","adminRoute","user","pathname","isOnAccountPage","path","clientProps","active","mappedComponent","email"],"mappings":"AAAA;;AACA,SAASA,WAAW,QAAQ,qBAAoB;AAChD,OAAOC,WAAW,QAAO;AAEzB,SAASC,OAAO,QAAQ,gCAA+B;AACvD,SAASC,eAAe,QAAQ,4CAA2C;AAC3E,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,cAAc,QAAQ,oCAAmC;AAClE,SAASC,kBAAkB,QAAQ,qBAAoB;AACvD,SAASC,mBAAmB,QAAQ,sBAAqB;AAEzD,OAAO,MAAMC,UAAU;IACrB,MAAM,EACJC,QAAQ,EACNC,OAAO,EACLC,MAAM,EACNC,YAAY,EAAEC,QAAQC,YAAY,EAAE,EACpCC,QAAQ,EAAEC,SAASC,YAAY,EAAE,EAClC,EACDF,QAAQ,EAAEL,OAAOQ,UAAU,EAAE,EAC9B,EACF,GAAGd;IAEJ,MAAM,EAAEe,IAAI,EAAE,GAAGjB;IACjB,MAAMkB,WAAWpB;IACjB,MAAMqB,kBAAkBD,aAAaf,eAAe;QAAEa;QAAYI,MAAML;IAAa;IAErF,IAAIH,cAAc;QAChB,qBACE,KAACX;YACCoB,aAAa;gBACXC,QAAQH;YACV;YACAI,iBAAiBX;;IAGvB;IAEA,IAAI,CAACK,MAAMO,SAASf,WAAW,WAAW,qBAAO,KAACL;QAAmBkB,QAAQH;;IAC7E,IAAIV,WAAW,YAAY,qBAAO,KAACJ;AACrC,EAAC"}
@@ -6,7 +6,7 @@ type ActionsContextType = {
6
6
  setViewActions: (actions: MappedComponent[]) => void;
7
7
  };
8
8
  export declare const useActions: () => ActionsContextType;
9
- export declare const ActionsProvider: ({ children }: {
10
- children: any;
11
- }) => React.JSX.Element;
9
+ export declare const ActionsProvider: React.FC<{
10
+ readonly children: React.ReactNode;
11
+ }>;
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/Actions/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAG9C,OAAO,KAAyD,MAAM,OAAO,CAAA;AAE7E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE1D,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE,eAAe,EAAE,CAAA;IAC1B,cAAc,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAA;CACrD,CAAA;AAOD,eAAO,MAAM,UAAU,0BAAmC,CAAA;AAE1D,eAAO,MAAM,eAAe;;uBAuB3B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/Actions/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAyD,MAAM,OAAO,CAAA;AAI7E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE1D,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE,eAAe,EAAE,CAAA;IAC1B,cAAc,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAA;CACrD,CAAA;AAOD,eAAO,MAAM,UAAU,0BAAmC,CAAA;AAE1D,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACnC,CAuBA,CAAA"}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useConfig } from '@payloadcms/ui';
4
3
  import React, { createContext, useContext, useEffect, useState } from 'react';
4
+ import { useConfig } from '../../providers/Config/index.js';
5
5
  export { SetViewActions } from './SetViewActions/index.js';
6
6
  const ActionsContext = /*#__PURE__*/ createContext({
7
7
  actions: [],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/providers/Actions/index.tsx"],"sourcesContent":["'use client'\nimport type { MappedComponent } from 'payload'\n\nimport { useConfig } from '@payloadcms/ui'\nimport React, { createContext, useContext, useEffect, useState } from 'react'\n\nexport { SetViewActions } from './SetViewActions/index.js'\n\ntype ActionsContextType = {\n actions: MappedComponent[]\n setViewActions: (actions: MappedComponent[]) => void\n}\n\nconst ActionsContext = createContext<ActionsContextType>({\n actions: [],\n setViewActions: () => {},\n})\n\nexport const useActions = () => useContext(ActionsContext)\n\nexport const ActionsProvider = ({ children }) => {\n const [viewActions, setViewActions] = useState([])\n const [adminActions, setAdminActions] = useState([])\n\n const {\n config: {\n admin: {\n components: { actions },\n },\n },\n } = useConfig()\n\n useEffect(() => {\n setAdminActions(actions || [])\n }, [actions])\n\n const combinedActions = [...(viewActions || []), ...(adminActions || [])]\n\n return (\n <ActionsContext.Provider value={{ actions: combinedActions, setViewActions }}>\n {children}\n </ActionsContext.Provider>\n )\n}\n"],"names":["useConfig","React","createContext","useContext","useEffect","useState","SetViewActions","ActionsContext","actions","setViewActions","useActions","ActionsProvider","children","viewActions","adminActions","setAdminActions","config","admin","components","combinedActions","Provider","value"],"mappings":"AAAA;;AAGA,SAASA,SAAS,QAAQ,iBAAgB;AAC1C,OAAOC,SAASC,aAAa,EAAEC,UAAU,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAE7E,SAASC,cAAc,QAAQ,4BAA2B;AAO1D,MAAMC,+BAAiBL,cAAkC;IACvDM,SAAS,EAAE;IACXC,gBAAgB,KAAO;AACzB;AAEA,OAAO,MAAMC,aAAa,IAAMP,WAAWI,gBAAe;AAE1D,OAAO,MAAMI,kBAAkB,CAAC,EAAEC,QAAQ,EAAE;IAC1C,MAAM,CAACC,aAAaJ,eAAe,GAAGJ,SAAS,EAAE;IACjD,MAAM,CAACS,cAAcC,gBAAgB,GAAGV,SAAS,EAAE;IAEnD,MAAM,EACJW,QAAQ,EACNC,OAAO,EACLC,YAAY,EAAEV,OAAO,EAAE,EACxB,EACF,EACF,GAAGR;IAEJI,UAAU;QACRW,gBAAgBP,WAAW,EAAE;IAC/B,GAAG;QAACA;KAAQ;IAEZ,MAAMW,kBAAkB;WAAKN,eAAe,EAAE;WAAOC,gBAAgB,EAAE;KAAE;IAEzE,qBACE,KAACP,eAAea,QAAQ;QAACC,OAAO;YAAEb,SAASW;YAAiBV;QAAe;kBACxEG;;AAGP,EAAC"}
1
+ {"version":3,"sources":["../../../src/providers/Actions/index.tsx"],"sourcesContent":["'use client'\nimport type { MappedComponent } from 'payload'\n\nimport React, { createContext, useContext, useEffect, useState } from 'react'\n\nimport { useConfig } from '../../providers/Config/index.js'\n\nexport { SetViewActions } from './SetViewActions/index.js'\n\ntype ActionsContextType = {\n actions: MappedComponent[]\n setViewActions: (actions: MappedComponent[]) => void\n}\n\nconst ActionsContext = createContext<ActionsContextType>({\n actions: [],\n setViewActions: () => {},\n})\n\nexport const useActions = () => useContext(ActionsContext)\n\nexport const ActionsProvider: React.FC<{\n readonly children: React.ReactNode\n}> = ({ children }) => {\n const [viewActions, setViewActions] = useState([])\n const [adminActions, setAdminActions] = useState([])\n\n const {\n config: {\n admin: {\n components: { actions },\n },\n },\n } = useConfig()\n\n useEffect(() => {\n setAdminActions(actions || [])\n }, [actions])\n\n const combinedActions = [...(viewActions || []), ...(adminActions || [])]\n\n return (\n <ActionsContext.Provider value={{ actions: combinedActions, setViewActions }}>\n {children}\n </ActionsContext.Provider>\n )\n}\n"],"names":["React","createContext","useContext","useEffect","useState","useConfig","SetViewActions","ActionsContext","actions","setViewActions","useActions","ActionsProvider","children","viewActions","adminActions","setAdminActions","config","admin","components","combinedActions","Provider","value"],"mappings":"AAAA;;AAGA,OAAOA,SAASC,aAAa,EAAEC,UAAU,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAE7E,SAASC,SAAS,QAAQ,kCAAiC;AAE3D,SAASC,cAAc,QAAQ,4BAA2B;AAO1D,MAAMC,+BAAiBN,cAAkC;IACvDO,SAAS,EAAE;IACXC,gBAAgB,KAAO;AACzB;AAEA,OAAO,MAAMC,aAAa,IAAMR,WAAWK,gBAAe;AAE1D,OAAO,MAAMI,kBAER,CAAC,EAAEC,QAAQ,EAAE;IAChB,MAAM,CAACC,aAAaJ,eAAe,GAAGL,SAAS,EAAE;IACjD,MAAM,CAACU,cAAcC,gBAAgB,GAAGX,SAAS,EAAE;IAEnD,MAAM,EACJY,QAAQ,EACNC,OAAO,EACLC,YAAY,EAAEV,OAAO,EAAE,EACxB,EACF,EACF,GAAGH;IAEJF,UAAU;QACRY,gBAAgBP,WAAW,EAAE;IAC/B,GAAG;QAACA;KAAQ;IAEZ,MAAMW,kBAAkB;WAAKN,eAAe,EAAE;WAAOC,gBAAgB,EAAE;KAAE;IAEzE,qBACE,KAACP,eAAea,QAAQ;QAACC,OAAO;YAAEb,SAASW;YAAiBV;QAAe;kBACxEG;;AAGP,EAAC"}