@payloadcms/ui 3.60.0-internal.8e20fed → 3.60.0-internal.c277fd4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/elements/Link/index.d.ts +2 -27
- package/dist/elements/Link/index.d.ts.map +1 -1
- package/dist/exports/client/index.d.ts +1 -0
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +12 -12
- package/dist/exports/client/index.js.map +4 -4
- package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.d.ts +2 -2
- package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js.map +1 -1
- package/dist/icons/Gear/index.d.ts +7 -0
- package/dist/icons/Gear/index.d.ts.map +1 -0
- package/dist/icons/Gear/index.js +25 -0
- package/dist/icons/Gear/index.js.map +1 -0
- package/dist/icons/Gear/index.scss +15 -0
- package/dist/styles.css +1 -1
- package/package.json +5 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type Field, type FieldState, type ServerFunction } from 'payload';
|
|
2
|
-
export type RenderFieldServerFnArgs = {
|
|
2
|
+
export type RenderFieldServerFnArgs<TField = Field> = {
|
|
3
3
|
/**
|
|
4
4
|
* Override field config pulled from schemaPath lookup
|
|
5
5
|
*/
|
|
6
|
-
field?: Partial<
|
|
6
|
+
field?: Partial<TField>;
|
|
7
7
|
/**
|
|
8
8
|
* Pass the value this field will receive when rendering it on the server.
|
|
9
9
|
* For richText, this helps provide initial state for sub-fields that are immediately rendered (like blocks)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderFieldServerFn.d.ts","sourceRoot":"","sources":["../../../../src/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAA;AAOrF,MAAM,MAAM,uBAAuB,GAAG;
|
|
1
|
+
{"version":3,"file":"renderFieldServerFn.d.ts","sourceRoot":"","sources":["../../../../src/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAA;AAOrF,MAAM,MAAM,uBAAuB,CAAC,MAAM,GAAG,KAAK,IAAI;IACpD;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;IACvB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;;;;;OASG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AACD,MAAM,MAAM,6BAA6B,GAAG,EAAE,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAA;AAE/E;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,cAAc,CACvD,uBAAuB,EACvB,OAAO,CAAC,6BAA6B,CAAC,CA8EvC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderFieldServerFn.js","names":["deepMerge","getClientConfig","getClientSchemaMap","getSchemaMap","renderField","_internal_renderFieldHandler","field","fieldArg","initialValue","path","req","schemaPath","user","Error","entityType","entitySlug","fieldPath","split","schemaMap","collectionSlug","undefined","config","payload","globalSlug","i18n","clientSchemaMap","importMap","targetField","get","join","clone","data","name","fieldState","clientFieldSchemaMap","fieldConfig","fieldSchemaMap","formState","indexPath","lastRenderedPath","operation","parentPath","parentSchemaPath","permissions","preferences","fields","forceCreateClientField","previousFieldState","renderAllFields","siblingData","customComponents"],"sources":["../../../../src/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.ts"],"sourcesContent":["import { deepMerge, type Field, type FieldState, type ServerFunction } from 'payload'\n\nimport { getClientConfig } from '../../../utilities/getClientConfig.js'\nimport { getClientSchemaMap } from '../../../utilities/getClientSchemaMap.js'\nimport { getSchemaMap } from '../../../utilities/getSchemaMap.js'\nimport { renderField } from '../renderField.js'\n\nexport type RenderFieldServerFnArgs = {\n /**\n * Override field config pulled from schemaPath lookup\n */\n field?: Partial<
|
|
1
|
+
{"version":3,"file":"renderFieldServerFn.js","names":["deepMerge","getClientConfig","getClientSchemaMap","getSchemaMap","renderField","_internal_renderFieldHandler","field","fieldArg","initialValue","path","req","schemaPath","user","Error","entityType","entitySlug","fieldPath","split","schemaMap","collectionSlug","undefined","config","payload","globalSlug","i18n","clientSchemaMap","importMap","targetField","get","join","clone","data","name","fieldState","clientFieldSchemaMap","fieldConfig","fieldSchemaMap","formState","indexPath","lastRenderedPath","operation","parentPath","parentSchemaPath","permissions","preferences","fields","forceCreateClientField","previousFieldState","renderAllFields","siblingData","customComponents"],"sources":["../../../../src/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.ts"],"sourcesContent":["import { deepMerge, type Field, type FieldState, type ServerFunction } from 'payload'\n\nimport { getClientConfig } from '../../../utilities/getClientConfig.js'\nimport { getClientSchemaMap } from '../../../utilities/getClientSchemaMap.js'\nimport { getSchemaMap } from '../../../utilities/getSchemaMap.js'\nimport { renderField } from '../renderField.js'\n\nexport type RenderFieldServerFnArgs<TField = Field> = {\n /**\n * Override field config pulled from schemaPath lookup\n */\n field?: Partial<TField>\n /**\n * Pass the value this field will receive when rendering it on the server.\n * For richText, this helps provide initial state for sub-fields that are immediately rendered (like blocks)\n * so that we can avoid multiple waterfall requests for each block that renders on the client.\n */\n initialValue?: unknown\n /**\n * Path to the field to render\n * @default field name\n */\n path?: string\n /**\n * Dot schema path to a richText field declared in your config.\n * Format:\n * \"collection.<collectionSlug>.<fieldPath>\"\n * \"global.<globalSlug>.<fieldPath>\"\n *\n * Examples:\n * \"collection.posts.richText\"\n * \"global.siteSettings.content\"\n */\n schemaPath: string\n}\nexport type RenderFieldServerFnReturnType = {} & FieldState['customComponents']\n\n/**\n * @experimental - may break in minor releases\n */\nexport const _internal_renderFieldHandler: ServerFunction<\n RenderFieldServerFnArgs,\n Promise<RenderFieldServerFnReturnType>\n // eslint-disable-next-line @typescript-eslint/require-await\n> = async ({ field: fieldArg, initialValue, path, req, schemaPath }) => {\n if (!req.user) {\n throw new Error('Unauthorized')\n }\n\n const [entityType, entitySlug, ...fieldPath] = schemaPath.split('.')\n\n const schemaMap = getSchemaMap({\n collectionSlug: entityType === 'collection' ? entitySlug : undefined,\n config: req.payload.config,\n globalSlug: entityType === 'global' ? entitySlug : undefined,\n i18n: req.i18n,\n })\n\n // Provide client schema map as it would have been provided if the target editor field would have been rendered.\n // For lexical, only then will it contain all the lexical-internal entries\n const clientSchemaMap = getClientSchemaMap({\n collectionSlug: entityType === 'collection' ? entitySlug : undefined,\n config: getClientConfig({\n config: req.payload.config,\n i18n: req.i18n,\n importMap: req.payload.importMap,\n user: req.user,\n }),\n globalSlug: entityType === 'global' ? entitySlug : undefined,\n i18n: req.i18n,\n payload: req.payload,\n schemaMap,\n })\n\n const targetField = schemaMap.get(`${entitySlug}.${fieldPath.join('.')}`) as Field | undefined\n\n if (!targetField) {\n throw new Error(`Could not find target field at schemaPath: ${schemaPath}`)\n }\n\n const field: Field = fieldArg ? deepMerge(targetField, fieldArg, { clone: false }) : targetField\n\n let data = {}\n if (typeof initialValue !== 'undefined') {\n if ('name' in field) {\n data[field.name] = initialValue\n } else {\n data = initialValue\n }\n }\n\n const fieldState: FieldState = {}\n renderField({\n clientFieldSchemaMap: clientSchemaMap,\n collectionSlug: entityType === 'collection' && entitySlug ? entitySlug : '-',\n data,\n fieldConfig: field,\n fieldSchemaMap: schemaMap,\n fieldState, // TODO,\n formState: {}, // TODO,\n indexPath: '',\n lastRenderedPath: '',\n operation: 'create',\n parentPath: '',\n parentSchemaPath: '',\n path: path ?? ('name' in field ? field.name : ''),\n permissions: true,\n preferences: {\n fields: {},\n },\n // If we are passed a field override, we want to ensure we create a new client field based on that override\n forceCreateClientField: fieldArg ? true : false,\n previousFieldState: undefined,\n renderAllFields: true,\n req,\n schemaPath: `${entitySlug}.${fieldPath.join('.')}`,\n siblingData: data,\n })\n\n return fieldState.customComponents ?? {}\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAA0D;AAE5E,SAASC,eAAe,QAAQ;AAChC,SAASC,kBAAkB,QAAQ;AACnC,SAASC,YAAY,QAAQ;AAC7B,SAASC,WAAW,QAAQ;AAgC5B;;;AAGA,OAAO,MAAMC,4BAAA,GAIT,MAAAA,CAAO;EAAEC,KAAA,EAAOC,QAAQ;EAAEC,YAAY;EAAEC,IAAI;EAAEC,GAAG;EAAEC;AAAU,CAAE;EACjE,IAAI,CAACD,GAAA,CAAIE,IAAI,EAAE;IACb,MAAM,IAAIC,KAAA,CAAM;EAClB;EAEA,MAAM,CAACC,UAAA,EAAYC,UAAA,EAAY,GAAGC,SAAA,CAAU,GAAGL,UAAA,CAAWM,KAAK,CAAC;EAEhE,MAAMC,SAAA,GAAYf,YAAA,CAAa;IAC7BgB,cAAA,EAAgBL,UAAA,KAAe,eAAeC,UAAA,GAAaK,SAAA;IAC3DC,MAAA,EAAQX,GAAA,CAAIY,OAAO,CAACD,MAAM;IAC1BE,UAAA,EAAYT,UAAA,KAAe,WAAWC,UAAA,GAAaK,SAAA;IACnDI,IAAA,EAAMd,GAAA,CAAIc;EACZ;EAEA;EACA;EACA,MAAMC,eAAA,GAAkBvB,kBAAA,CAAmB;IACzCiB,cAAA,EAAgBL,UAAA,KAAe,eAAeC,UAAA,GAAaK,SAAA;IAC3DC,MAAA,EAAQpB,eAAA,CAAgB;MACtBoB,MAAA,EAAQX,GAAA,CAAIY,OAAO,CAACD,MAAM;MAC1BG,IAAA,EAAMd,GAAA,CAAIc,IAAI;MACdE,SAAA,EAAWhB,GAAA,CAAIY,OAAO,CAACI,SAAS;MAChCd,IAAA,EAAMF,GAAA,CAAIE;IACZ;IACAW,UAAA,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EAAoB3B,SAAA;IACpB4B,eAAA,EAAiB;IACjBtC,GAAA;IACAC,UAAA,EAAY,GAAGI,UAAA,IAAcC,SAAA,CAAUa,IAAI,CAAC,MAAM;IAClDoB,WAAA,EAAalB;EACf;EAEA,OAAOE,UAAA,CAAWiB,gBAAgB,IAAI,CAAC;AACzC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/icons/Gear/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAiBA,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './index.scss';
|
|
4
|
+
const baseClass = 'gear';
|
|
5
|
+
export const GearIcon = ({
|
|
6
|
+
ariaLabel,
|
|
7
|
+
className
|
|
8
|
+
}) => /*#__PURE__*/_jsx("div", {
|
|
9
|
+
"aria-label": ariaLabel,
|
|
10
|
+
className: [className, baseClass].filter(Boolean).join(' '),
|
|
11
|
+
children: /*#__PURE__*/_jsx("svg", {
|
|
12
|
+
className: "icon icon--gear",
|
|
13
|
+
fill: "none",
|
|
14
|
+
height: "20",
|
|
15
|
+
viewBox: "0 0 20 20",
|
|
16
|
+
width: "20",
|
|
17
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
19
|
+
d: "M9.33337 8.84671L6.66671 4.22671M9.33337 11.1534L6.66671 15.7734M10 16.6667V15.3334M10 15.3334C12.9456 15.3334 15.3334 12.9456 15.3334 10C15.3334 7.05452 12.9456 4.66671 10 4.66671M10 15.3334C7.05452 15.3334 4.66671 12.9456 4.66671 10M10 3.33337V4.66671M10 4.66671C7.05452 4.66671 4.66671 7.05452 4.66671 10M11.3334 10H16.6667M11.3334 10C11.3334 10.7364 10.7364 11.3334 10 11.3334C9.26366 11.3334 8.66671 10.7364 8.66671 10C8.66671 9.26366 9.26366 8.66671 10 8.66671C10.7364 8.66671 11.3334 9.26366 11.3334 10ZM13.3334 15.7734L12.6667 14.62M13.3334 4.22671L12.6667 5.38004M3.33337 10H4.66671M15.7734 13.3334L14.62 12.6667M15.7734 6.66671L14.62 7.33337M4.22671 13.3334L5.38004 12.6667M4.22671 6.66671L5.38004 7.33337",
|
|
20
|
+
strokeLinecap: "round",
|
|
21
|
+
strokeLinejoin: "round"
|
|
22
|
+
})
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","baseClass","GearIcon","ariaLabel","className","_jsx","filter","Boolean","join","fill","height","viewBox","width","xmlns","d","strokeLinecap","strokeLinejoin"],"sources":["../../../src/icons/Gear/index.tsx"],"sourcesContent":["import React from 'react'\n\nimport './index.scss'\n\nconst baseClass = 'gear'\n\nexport const GearIcon: React.FC<{\n ariaLabel?: string\n className?: string\n}> = ({ ariaLabel, className }) => (\n <div aria-label={ariaLabel} className={[className, baseClass].filter(Boolean).join(' ')}>\n <svg\n className=\"icon icon--gear\"\n fill=\"none\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n width=\"20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M9.33337 8.84671L6.66671 4.22671M9.33337 11.1534L6.66671 15.7734M10 16.6667V15.3334M10 15.3334C12.9456 15.3334 15.3334 12.9456 15.3334 10C15.3334 7.05452 12.9456 4.66671 10 4.66671M10 15.3334C7.05452 15.3334 4.66671 12.9456 4.66671 10M10 3.33337V4.66671M10 4.66671C7.05452 4.66671 4.66671 7.05452 4.66671 10M11.3334 10H16.6667M11.3334 10C11.3334 10.7364 10.7364 11.3334 10 11.3334C9.26366 11.3334 8.66671 10.7364 8.66671 10C8.66671 9.26366 9.26366 8.66671 10 8.66671C10.7364 8.66671 11.3334 9.26366 11.3334 10ZM13.3334 15.7734L12.6667 14.62M13.3334 4.22671L12.6667 5.38004M3.33337 10H4.66671M15.7734 13.3334L14.62 12.6667M15.7734 6.66671L14.62 7.33337M4.22671 13.3334L5.38004 12.6667M4.22671 6.66671L5.38004 7.33337\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n)\n"],"mappings":";AAAA,OAAOA,KAAA,MAAW;AAElB,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,QAAA,GAGRA,CAAC;EAAEC,SAAS;EAAEC;AAAS,CAAE,kBAC5BC,IAAA,CAAC;EAAI,cAAYF,SAAA;EAAWC,SAAA,EAAW,CAACA,SAAA,EAAWH,SAAA,CAAU,CAACK,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;YACjF,aAAAH,IAAA,CAAC;IACCD,SAAA,EAAU;IACVK,IAAA,EAAK;IACLC,MAAA,EAAO;IACPC,OAAA,EAAQ;IACRC,KAAA,EAAM;IACNC,KAAA,EAAM;cAEN,aAAAR,IAAA,CAAC;MACCS,CAAA,EAAE;MACFC,aAAA,EAAc;MACdC,cAAA,EAAe","ignoreList":[]}
|