@payloadcms/ui 3.29.0-canary.6 → 3.29.0-canary.7

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 (51) hide show
  1. package/dist/elements/Autosave/index.js +1 -1
  2. package/dist/elements/Autosave/index.js.map +1 -1
  3. package/dist/elements/BulkUpload/FileSidebar/index.d.ts.map +1 -1
  4. package/dist/elements/BulkUpload/FileSidebar/index.js +5 -5
  5. package/dist/elements/BulkUpload/FileSidebar/index.js.map +1 -1
  6. package/dist/elements/BulkUpload/FormsManager/index.js +1 -1
  7. package/dist/elements/BulkUpload/FormsManager/index.js.map +1 -1
  8. package/dist/elements/DocumentControls/index.js +1 -1
  9. package/dist/elements/DocumentControls/index.js.map +1 -1
  10. package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingColumns.js +1 -1
  11. package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingColumns.js.map +1 -1
  12. package/dist/elements/Table/DefaultCell/fields/Date/index.js +1 -1
  13. package/dist/elements/Table/DefaultCell/fields/Date/index.js.map +1 -1
  14. package/dist/elements/Table/DefaultCell/fields/Relationship/index.js +1 -1
  15. package/dist/elements/Table/DefaultCell/fields/Relationship/index.js.map +1 -1
  16. package/dist/elements/Thumbnail/index.js +1 -1
  17. package/dist/elements/Thumbnail/index.js.map +1 -1
  18. package/dist/elements/ThumbnailCard/index.js +1 -1
  19. package/dist/elements/ThumbnailCard/index.js.map +1 -1
  20. package/dist/exports/client/index.js +11 -11
  21. package/dist/exports/client/index.js.map +4 -4
  22. package/dist/exports/shared/index.d.ts +2 -2
  23. package/dist/exports/shared/index.d.ts.map +1 -1
  24. package/dist/exports/shared/index.js +2 -2
  25. package/dist/exports/shared/index.js.map +4 -4
  26. package/dist/fields/Group/index.scss +12 -6
  27. package/dist/fields/Relationship/optionsReducer.js +1 -1
  28. package/dist/fields/Relationship/optionsReducer.js.map +1 -1
  29. package/dist/providers/DocumentInfo/index.d.ts.map +1 -1
  30. package/dist/providers/DocumentInfo/index.js +1 -1
  31. package/dist/providers/DocumentInfo/index.js.map +1 -1
  32. package/dist/styles.css +1 -1
  33. package/dist/utilities/{formatDate.d.ts → formatDocTitle/formatDateTitle.d.ts} +1 -1
  34. package/dist/utilities/formatDocTitle/formatDateTitle.d.ts.map +1 -0
  35. package/dist/utilities/{formatDate.js → formatDocTitle/formatDateTitle.js} +1 -1
  36. package/dist/utilities/formatDocTitle/formatDateTitle.js.map +1 -0
  37. package/dist/utilities/formatDocTitle/formatLexicalDocTitle.d.ts +19 -0
  38. package/dist/utilities/formatDocTitle/formatLexicalDocTitle.d.ts.map +1 -0
  39. package/dist/utilities/formatDocTitle/formatLexicalDocTitle.js +19 -0
  40. package/dist/utilities/formatDocTitle/formatLexicalDocTitle.js.map +1 -0
  41. package/dist/utilities/{formatDocTitle.d.ts → formatDocTitle/index.d.ts} +2 -2
  42. package/dist/utilities/formatDocTitle/index.d.ts.map +1 -0
  43. package/dist/utilities/{formatDocTitle.js → formatDocTitle/index.js} +11 -3
  44. package/dist/utilities/formatDocTitle/index.js.map +1 -0
  45. package/dist/views/Edit/SetDocumentTitle/index.js +1 -1
  46. package/dist/views/Edit/SetDocumentTitle/index.js.map +1 -1
  47. package/package.json +5 -5
  48. package/dist/utilities/formatDate.d.ts.map +0 -1
  49. package/dist/utilities/formatDate.js.map +0 -1
  50. package/dist/utilities/formatDocTitle.d.ts.map +0 -1
  51. package/dist/utilities/formatDocTitle.js.map +0 -1
@@ -12,4 +12,4 @@ type FormatTimeToNowArgs = {
12
12
  };
13
13
  export declare const formatTimeToNow: ({ date, i18n }: FormatTimeToNowArgs) => string;
14
14
  export {};
15
- //# sourceMappingURL=formatDate.d.ts.map
15
+ //# sourceMappingURL=formatDateTitle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatDateTitle.d.ts","sourceRoot":"","sources":["../../../src/utilities/formatDocTitle/formatDateTitle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAKpD,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACxC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,UAAU,sCAAuC,cAAc,KAAG,MAoB9E,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACxC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,eAAe,mBAAoB,mBAAmB,KAAG,MAKrE,CAAA"}
@@ -30,4 +30,4 @@ export const formatTimeToNow = ({
30
30
  locale: i18n.dateFNS
31
31
  }) : `${i18n.t('general:loading')}...`;
32
32
  };
33
- //# sourceMappingURL=formatDate.js.map
33
+ //# sourceMappingURL=formatDateTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatDateTitle.js","names":["TZDateMini","TZDate","format","formatDistanceToNow","transpose","formatDate","date","i18n","pattern","timezone","theDate","Date","DateWithOriginalTz","tz","modifiedDate","withTimeZone","dateWithTimezone","dateFNS","locale","t","formatTimeToNow"],"sources":["../../../src/utilities/formatDocTitle/formatDateTitle.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\n\nimport { TZDateMini as TZDate } from '@date-fns/tz/date/mini'\nimport { format, formatDistanceToNow, transpose } from 'date-fns'\n\ntype FormatDateArgs = {\n date: Date | number | string | undefined\n i18n: I18n<any, any>\n pattern: string\n timezone?: string\n}\n\nexport const formatDate = ({ date, i18n, pattern, timezone }: FormatDateArgs): string => {\n const theDate = new TZDate(new Date(date))\n\n if (timezone) {\n const DateWithOriginalTz = TZDate.tz(timezone)\n\n const modifiedDate = theDate.withTimeZone(timezone)\n\n // Transpose the date to the selected timezone\n const dateWithTimezone = transpose(modifiedDate, DateWithOriginalTz)\n\n // Transpose the date to the user's timezone - this is necessary because the react-datepicker component insists on displaying the date in the user's timezone\n return i18n.dateFNS\n ? format(dateWithTimezone, pattern, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n }\n\n return i18n.dateFNS\n ? format(theDate, pattern, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n}\n\ntype FormatTimeToNowArgs = {\n date: Date | number | string | undefined\n i18n: I18n<any, any>\n}\n\nexport const formatTimeToNow = ({ date, i18n }: FormatTimeToNowArgs): string => {\n const theDate = new Date(date)\n return i18n?.dateFNS\n ? formatDistanceToNow(theDate, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n}\n"],"mappings":"AAEA,SAASA,UAAA,IAAcC,MAAM,QAAQ;AACrC,SAASC,MAAM,EAAEC,mBAAmB,EAAEC,SAAS,QAAQ;AASvD,OAAO,MAAMC,UAAA,GAAaA,CAAC;EAAEC,IAAI;EAAEC,IAAI;EAAEC,OAAO;EAAEC;AAAQ,CAAkB;EAC1E,MAAMC,OAAA,GAAU,IAAIT,MAAA,CAAO,IAAIU,IAAA,CAAKL,IAAA;EAEpC,IAAIG,QAAA,EAAU;IACZ,MAAMG,kBAAA,GAAqBX,MAAA,CAAOY,EAAE,CAACJ,QAAA;IAErC,MAAMK,YAAA,GAAeJ,OAAA,CAAQK,YAAY,CAACN,QAAA;IAE1C;IACA,MAAMO,gBAAA,GAAmBZ,SAAA,CAAUU,YAAA,EAAcF,kBAAA;IAEjD;IACA,OAAOL,IAAA,CAAKU,OAAO,GACff,MAAA,CAAOc,gBAAA,EAAkBR,OAAA,EAAS;MAAEU,MAAA,EAAQX,IAAA,CAAKU;IAAQ,KACzD,GAAGV,IAAA,CAAKY,CAAC,CAAC,uBAAuB;EACvC;EAEA,OAAOZ,IAAA,CAAKU,OAAO,GACff,MAAA,CAAOQ,OAAA,EAASF,OAAA,EAAS;IAAEU,MAAA,EAAQX,IAAA,CAAKU;EAAQ,KAChD,GAAGV,IAAA,CAAKY,CAAC,CAAC,uBAAuB;AACvC;AAOA,OAAO,MAAMC,eAAA,GAAkBA,CAAC;EAAEd,IAAI;EAAEC;AAAI,CAAuB;EACjE,MAAMG,OAAA,GAAU,IAAIC,IAAA,CAAKL,IAAA;EACzB,OAAOC,IAAA,EAAMU,OAAA,GACTd,mBAAA,CAAoBO,OAAA,EAAS;IAAEQ,MAAA,EAAQX,IAAA,CAAKU;EAAQ,KACpD,GAAGV,IAAA,CAAKY,CAAC,CAAC,uBAAuB;AACvC","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ type SerializedLexicalEditor = {
2
+ root: {
3
+ children: Array<{
4
+ children?: Array<{
5
+ type: string;
6
+ }>;
7
+ type: string;
8
+ }>;
9
+ };
10
+ };
11
+ export declare function isSerializedLexicalEditor(value: unknown): value is SerializedLexicalEditor;
12
+ export declare function formatLexicalDocTitle(editorState: Array<{
13
+ children?: Array<{
14
+ type: string;
15
+ }>;
16
+ type: string;
17
+ }>, textContent: string): string;
18
+ export {};
19
+ //# sourceMappingURL=formatLexicalDocTitle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatLexicalDocTitle.d.ts","sourceRoot":"","sources":["../../../src/utilities/formatDocTitle/formatLexicalDocTitle.ts"],"names":[],"mappings":"AAAA,KAAK,uBAAuB,GAAG;IAC7B,IAAI,EAAE;QACJ,QAAQ,EAAE,KAAK,CAAC;YAAE,QAAQ,CAAC,EAAE,KAAK,CAAC;gBAAE,IAAI,EAAE,MAAM,CAAA;aAAE,CAAC,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KACtE,CAAA;CACF,CAAA;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,uBAAuB,CAE1F;AAED,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,KAAK,CAAC;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EACxE,WAAW,EAAE,MAAM,GAClB,MAAM,CAcR"}
@@ -0,0 +1,19 @@
1
+ export function isSerializedLexicalEditor(value) {
2
+ return typeof value === 'object' && 'root' in value;
3
+ }
4
+ export function formatLexicalDocTitle(editorState, textContent) {
5
+ for (const node of editorState) {
6
+ if ('text' in node && node.text) {
7
+ textContent += node.text;
8
+ } else {
9
+ if (!('children' in node)) {
10
+ textContent += `[${node.type}]`;
11
+ }
12
+ }
13
+ if ('children' in node && node.children) {
14
+ textContent += formatLexicalDocTitle(node.children, textContent);
15
+ }
16
+ }
17
+ return textContent;
18
+ }
19
+ //# sourceMappingURL=formatLexicalDocTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatLexicalDocTitle.js","names":["isSerializedLexicalEditor","value","formatLexicalDocTitle","editorState","textContent","node","text","type","children"],"sources":["../../../src/utilities/formatDocTitle/formatLexicalDocTitle.ts"],"sourcesContent":["type SerializedLexicalEditor = {\n root: {\n children: Array<{ children?: Array<{ type: string }>; type: string }>\n }\n}\n\nexport function isSerializedLexicalEditor(value: unknown): value is SerializedLexicalEditor {\n return typeof value === 'object' && 'root' in value\n}\n\nexport function formatLexicalDocTitle(\n editorState: Array<{ children?: Array<{ type: string }>; type: string }>,\n textContent: string,\n): string {\n for (const node of editorState) {\n if ('text' in node && node.text) {\n textContent += node.text as string\n } else {\n if (!('children' in node)) {\n textContent += `[${node.type}]`\n }\n }\n if ('children' in node && node.children) {\n textContent += formatLexicalDocTitle(node.children as Array<{ type: string }>, textContent)\n }\n }\n return textContent\n}\n"],"mappings":"AAMA,OAAO,SAASA,0BAA0BC,KAAc;EACtD,OAAO,OAAOA,KAAA,KAAU,YAAY,UAAUA,KAAA;AAChD;AAEA,OAAO,SAASC,sBACdC,WAAwE,EACxEC,WAAmB;EAEnB,KAAK,MAAMC,IAAA,IAAQF,WAAA,EAAa;IAC9B,IAAI,UAAUE,IAAA,IAAQA,IAAA,CAAKC,IAAI,EAAE;MAC/BF,WAAA,IAAeC,IAAA,CAAKC,IAAI;IAC1B,OAAO;MACL,IAAI,EAAE,cAAcD,IAAG,GAAI;QACzBD,WAAA,IAAe,IAAIC,IAAA,CAAKE,IAAI,GAAG;MACjC;IACF;IACA,IAAI,cAAcF,IAAA,IAAQA,IAAA,CAAKG,QAAQ,EAAE;MACvCJ,WAAA,IAAeF,qBAAA,CAAsBG,IAAA,CAAKG,QAAQ,EAA6BJ,WAAA;IACjF;EACF;EACA,OAAOA,WAAA;AACT","ignoreList":[]}
@@ -4,8 +4,8 @@ export declare const formatDocTitle: ({ collectionConfig, data, dateFormat: date
4
4
  collectionConfig?: ClientCollectionConfig;
5
5
  data: TypeWithID;
6
6
  dateFormat: SanitizedConfig["admin"]["dateFormat"];
7
- fallback?: string;
7
+ fallback?: object | string;
8
8
  globalConfig?: ClientGlobalConfig;
9
9
  i18n: I18n<any, any>;
10
10
  }) => string;
11
- //# sourceMappingURL=formatDocTitle.d.ts.map
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/formatDocTitle/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACX,MAAM,SAAS,CAAA;AAOhB,eAAO,MAAM,cAAc,gGAOxB;IACD,gBAAgB,CAAC,EAAE,sBAAsB,CAAA;IACzC,IAAI,EAAE,UAAU,CAAA;IAChB,UAAU,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAA;IAClD,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CACrB,KAAG,MA2CH,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import { getTranslation } from '@payloadcms/translations';
2
- import { formatDate } from '../utilities/formatDate.js';
2
+ import { formatDate } from './formatDateTitle.js';
3
+ import { formatLexicalDocTitle, isSerializedLexicalEditor } from './formatLexicalDocTitle.js';
3
4
  export const formatDocTitle = ({
4
5
  collectionConfig,
5
6
  data,
@@ -30,9 +31,16 @@ export const formatDocTitle = ({
30
31
  if (globalConfig) {
31
32
  title = getTranslation(globalConfig?.label, i18n) || globalConfig?.slug;
32
33
  }
34
+ // richtext lexical case. We convert the first child of root to plain text
35
+ if (isSerializedLexicalEditor(title)) {
36
+ title = formatLexicalDocTitle(title.root.children?.[0]?.children || [], '');
37
+ }
38
+ if (!title && isSerializedLexicalEditor(fallback)) {
39
+ title = formatLexicalDocTitle(fallback.root.children?.[0]?.children || [], '');
40
+ }
33
41
  if (!title) {
34
- title = fallback || `[${i18n.t('general:untitled')}]`;
42
+ title = typeof fallback === 'string' ? fallback : `[${i18n.t('general:untitled')}]`;
35
43
  }
36
44
  return title;
37
45
  };
38
- //# sourceMappingURL=formatDocTitle.js.map
46
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["getTranslation","formatDate","formatLexicalDocTitle","isSerializedLexicalEditor","formatDocTitle","collectionConfig","data","dateFormat","dateFormatFromConfig","fallback","globalConfig","i18n","title","useAsTitle","admin","fieldConfig","fields","find","f","name","isDate","type","date","displayFormat","pattern","label","slug","root","children","t"],"sources":["../../../src/utilities/formatDocTitle/index.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type {\n ClientCollectionConfig,\n ClientGlobalConfig,\n SanitizedConfig,\n TypeWithID,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport { formatDate } from './formatDateTitle.js'\nimport { formatLexicalDocTitle, isSerializedLexicalEditor } from './formatLexicalDocTitle.js'\n\nexport const formatDocTitle = ({\n collectionConfig,\n data,\n dateFormat: dateFormatFromConfig,\n fallback,\n globalConfig,\n i18n,\n}: {\n collectionConfig?: ClientCollectionConfig\n data: TypeWithID\n dateFormat: SanitizedConfig['admin']['dateFormat']\n fallback?: object | string\n globalConfig?: ClientGlobalConfig\n i18n: I18n<any, any>\n}): string => {\n let title: string\n\n if (collectionConfig) {\n const useAsTitle = collectionConfig?.admin?.useAsTitle\n\n if (useAsTitle) {\n title = data?.[useAsTitle] || title\n\n if (title) {\n const fieldConfig = collectionConfig.fields.find(\n (f) => 'name' in f && f.name === useAsTitle,\n )\n\n const isDate = fieldConfig?.type === 'date'\n\n if (isDate) {\n const dateFormat =\n ('date' in fieldConfig.admin && fieldConfig?.admin?.date?.displayFormat) ||\n dateFormatFromConfig\n title = formatDate({ date: title, i18n, pattern: dateFormat }) || title\n }\n }\n }\n }\n\n if (globalConfig) {\n title = getTranslation(globalConfig?.label, i18n) || globalConfig?.slug\n }\n\n // richtext lexical case. We convert the first child of root to plain text\n if (isSerializedLexicalEditor(title)) {\n title = formatLexicalDocTitle(title.root.children?.[0]?.children || [], '')\n }\n if (!title && isSerializedLexicalEditor(fallback)) {\n title = formatLexicalDocTitle(fallback.root.children?.[0]?.children || [], '')\n }\n\n if (!title) {\n title = typeof fallback === 'string' ? fallback : `[${i18n.t('general:untitled')}]`\n }\n\n return title\n}\n"],"mappings":"AAQA,SAASA,cAAc,QAAQ;AAE/B,SAASC,UAAU,QAAQ;AAC3B,SAASC,qBAAqB,EAAEC,yBAAyB,QAAQ;AAEjE,OAAO,MAAMC,cAAA,GAAiBA,CAAC;EAC7BC,gBAAgB;EAChBC,IAAI;EACJC,UAAA,EAAYC,oBAAoB;EAChCC,QAAQ;EACRC,YAAY;EACZC;AAAI,CAQL;EACC,IAAIC,KAAA;EAEJ,IAAIP,gBAAA,EAAkB;IAC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AAsB;EACrF;EAEA,OAAOjB,KAAA;AACT","ignoreList":[]}
@@ -5,7 +5,7 @@ import { useEffect, useRef } from 'react';
5
5
  import { useFormFields } from '../../../forms/Form/context.js';
6
6
  import { useDocumentInfo } from '../../../providers/DocumentInfo/index.js';
7
7
  import { useTranslation } from '../../../providers/Translation/index.js';
8
- import { formatDocTitle } from '../../../utilities/formatDocTitle.js';
8
+ import { formatDocTitle } from '../../../utilities/formatDocTitle/index.js';
9
9
  export const SetDocumentTitle = props => {
10
10
  const $ = _c(13);
11
11
  const {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","useEffect","useRef","useFormFields","useDocumentInfo","useTranslation","formatDocTitle","SetDocumentTitle","props","$","collectionConfig","config","fallback","globalConfig","useAsTitle","admin","t0","t1","fields","field","hasInitialized","i18n","setDocumentTitle","dateFormatFromConfig","dateFormat","data","id","String","value","title","t2","t3","current"],"sources":["../../../../src/views/Edit/SetDocumentTitle/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, ClientConfig, ClientGlobalConfig } from 'payload'\n\nimport { useEffect, useRef } from 'react'\n\nimport { useFormFields } from '../../../forms/Form/context.js'\nimport { useDocumentInfo } from '../../../providers/DocumentInfo/index.js'\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport { formatDocTitle } from '../../../utilities/formatDocTitle.js'\n\nexport const SetDocumentTitle: React.FC<{\n collectionConfig?: ClientCollectionConfig\n config?: ClientConfig\n fallback: string\n globalConfig?: ClientGlobalConfig\n}> = (props) => {\n const { collectionConfig, config, fallback, globalConfig } = props\n\n const useAsTitle = collectionConfig?.admin?.useAsTitle\n\n const field = useFormFields(([fields]) => (useAsTitle && fields && fields?.[useAsTitle]) || null)\n\n const hasInitialized = useRef(false)\n\n const { i18n } = useTranslation()\n\n const { setDocumentTitle } = useDocumentInfo()\n\n const dateFormatFromConfig = config?.admin?.dateFormat\n\n const title = formatDocTitle({\n collectionConfig,\n data: { id: '' },\n dateFormat: dateFormatFromConfig,\n fallback:\n typeof field === 'string'\n ? field\n : typeof field === 'number'\n ? String(field)\n : (field?.value as string) || fallback,\n globalConfig,\n i18n,\n })\n\n useEffect(() => {\n if (!hasInitialized.current) {\n hasInitialized.current = true\n return\n }\n\n setDocumentTitle(title)\n }, [setDocumentTitle, title])\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AAGA,SAASC,SAAS,EAAEC,MAAM,QAAQ;AAElC,SAASC,aAAa,QAAQ;AAC9B,SAASC,eAAe,QAAQ;AAChC,SAASC,cAAc,QAAQ;AAC/B,SAASC,cAAc,QAAQ;AAE/B,OAAO,MAAMC,gBAAA,GAKRC,KAAA;EAAA,MAAAC,CAAA,GAAAT,EAAA;EACH;IAAAU,gBAAA;IAAAC,MAAA;IAAAC,QAAA;IAAAC;EAAA,IAA6DL,KAAA;EAE7D,MAAAM,UAAA,GAAmBJ,gBAAA,EAAAK,KAAA,EAAAD,UAAA;EAAyB,IAAAE,EAAA;EAAA,IAAAP,CAAA,QAAAK,UAAA;IAEhBE,EAAA,GAAAC,EAAA;MAAC,OAAAC,MAAA,IAAAD,EAAQ;MAAA,OAAKH,UAAC,IAAcI,MAAA,IAAUA,MAAA,GAASJ,UAAA,CAAW,QAAK;IAAA;IAAAL,CAAA,MAAAK,UAAA;IAAAL,CAAA,MAAAO,EAAA;EAAA;IAAAA,EAAA,GAAAP,CAAA;EAAA;EAA5F,MAAAU,KAAA,GAAchB,aAAA,CAAca,EAAgE;EAE5F,MAAAI,cAAA,GAAuBlB,MAAA,MAAO;EAE9B;IAAAmB;EAAA,IAAiBhB,cAAA;EAEjB;IAAAiB;EAAA,IAA6BlB,eAAA;EAE7B,MAAAmB,oBAAA,GAA6BZ,MAAA,EAAAI,KAAA,EAAAS,UAAA;EAAe,IAAAP,EAAA;EAAA,IAAAR,CAAA,QAAAC,gBAAA,IAAAD,CAAA,QAAAc,oBAAA,IAAAd,CAAA,QAAAG,QAAA,IAAAH,CA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entTitle","props","$","collectionConfig","config","fallback","globalConfig","useAsTitle","admin","t0","t1","fields","field","hasInitialized","i18n","setDocumentTitle","dateFormatFromConfig","dateFormat","data","id","String","value","title","t2","t3","current"],"sources":["../../../../src/views/Edit/SetDocumentTitle/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, ClientConfig, ClientGlobalConfig } from 'payload'\n\nimport { useEffect, useRef } from 'react'\n\nimport { useFormFields } from '../../../forms/Form/context.js'\nimport { useDocumentInfo } from '../../../providers/DocumentInfo/index.js'\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport { formatDocTitle } from '../../../utilities/formatDocTitle/index.js'\n\nexport const SetDocumentTitle: React.FC<{\n collectionConfig?: ClientCollectionConfig\n config?: ClientConfig\n fallback: string\n globalConfig?: ClientGlobalConfig\n}> = (props) => {\n const { collectionConfig, config, fallback, globalConfig } = props\n\n const useAsTitle = collectionConfig?.admin?.useAsTitle\n\n const field = useFormFields(([fields]) => (useAsTitle && fields && fields?.[useAsTitle]) || null)\n\n const hasInitialized = useRef(false)\n\n const { i18n } = useTranslation()\n\n const { setDocumentTitle } = useDocumentInfo()\n\n const dateFormatFromConfig = config?.admin?.dateFormat\n\n const title = formatDocTitle({\n collectionConfig,\n data: { id: '' },\n dateFormat: dateFormatFromConfig,\n fallback:\n typeof field === 'string'\n ? field\n : typeof field === 'number'\n ? String(field)\n : (field?.value as string) || fallback,\n globalConfig,\n i18n,\n })\n\n useEffect(() => {\n if (!hasInitialized.current) {\n hasInitialized.current = true\n return\n }\n\n setDocumentTitle(title)\n }, [setDocumentTitle, title])\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AAGA,SAASC,SAAS,EAAEC,MAAM,QAAQ;AAElC,SAASC,aAAa,QAAQ;AAC9B,SAASC,eAAe,QAAQ;AAChC,SAASC,cAAc,QAAQ;AAC/B,SAASC,cAAc,QAAQ;AAE/B,OAAO,MAAMC,gBAAA,GAKRC,KAAA;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AAA;IAAAH,CAAA,MAAAU,KAAA;IAAAV,CAAA,MAAAI,YAAA;IAAAJ,CAAA,MAAAY,IAAA;IAAAZ,CAAA,MAAAQ,EAAA;EAAA;IAAAA,EAAA,GAAAR,CAAA;EAAA;EAZA,MAAAoB,KAAA,GAAcZ,EAYd;EAAA,IAAAa,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAtB,CAAA,QAAAa,gBAAA,IAAAb,CAAA,SAAAoB,KAAA;IAEUC,EAAA,GAAAA,CAAA;MAAA,KACHV,cAAA,CAAAY,OAAA;QACHZ,cAAA,CAAAY,OAAA;QAAA;MAAA;MAIFV,gBAAA,CAAiBO,KAAA;IAAA;IAChBE,EAAA,IAACT,gBAAA,EAAkBO,KAAA;IAAMpB,CAAA,MAAAa,gBAAA;IAAAb,CAAA,OAAAoB,KAAA;IAAApB,CAAA,OAAAqB,EAAA;IAAArB,CAAA,OAAAsB,EAAA;EAAA;IAAAD,EAAA,GAAArB,CAAA;IAAAsB,EAAA,GAAAtB,CAAA;EAAA;EAP5BR,SAAA,CAAU6B,EAOV,EAAGC,EAAyB;EAAA;AAAA,CAG9B","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/ui",
3
- "version": "3.29.0-canary.6",
3
+ "version": "3.29.0-canary.7",
4
4
  "homepage": "https://payloadcms.com",
5
5
  "repository": {
6
6
  "type": "git",
@@ -132,7 +132,7 @@
132
132
  "ts-essentials": "10.0.3",
133
133
  "use-context-selector": "2.0.0",
134
134
  "uuid": "10.0.0",
135
- "@payloadcms/translations": "3.29.0-canary.6"
135
+ "@payloadcms/translations": "3.29.0-canary.7"
136
136
  },
137
137
  "devDependencies": {
138
138
  "@babel/cli": "7.26.4",
@@ -148,14 +148,14 @@
148
148
  "esbuild": "0.24.2",
149
149
  "esbuild-sass-plugin": "3.3.1",
150
150
  "eslint-plugin-react-compiler": "19.0.0-beta-714736e-20250131",
151
- "@payloadcms/eslint-config": "3.28.0",
152
- "payload": "3.29.0-canary.6"
151
+ "payload": "3.29.0-canary.7",
152
+ "@payloadcms/eslint-config": "3.28.0"
153
153
  },
154
154
  "peerDependencies": {
155
155
  "next": "^15.0.0",
156
156
  "react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
157
157
  "react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
158
- "payload": "3.29.0-canary.6"
158
+ "payload": "3.29.0-canary.7"
159
159
  },
160
160
  "engines": {
161
161
  "node": "^18.20.2 || >=20.9.0"
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatDate.d.ts","sourceRoot":"","sources":["../../src/utilities/formatDate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAKpD,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACxC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,UAAU,sCAAuC,cAAc,KAAG,MAoB9E,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACxC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,eAAe,mBAAoB,mBAAmB,KAAG,MAKrE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatDate.js","names":["TZDateMini","TZDate","format","formatDistanceToNow","transpose","formatDate","date","i18n","pattern","timezone","theDate","Date","DateWithOriginalTz","tz","modifiedDate","withTimeZone","dateWithTimezone","dateFNS","locale","t","formatTimeToNow"],"sources":["../../src/utilities/formatDate.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\n\nimport { TZDateMini as TZDate } from '@date-fns/tz/date/mini'\nimport { format, formatDistanceToNow, transpose } from 'date-fns'\n\ntype FormatDateArgs = {\n date: Date | number | string | undefined\n i18n: I18n<any, any>\n pattern: string\n timezone?: string\n}\n\nexport const formatDate = ({ date, i18n, pattern, timezone }: FormatDateArgs): string => {\n const theDate = new TZDate(new Date(date))\n\n if (timezone) {\n const DateWithOriginalTz = TZDate.tz(timezone)\n\n const modifiedDate = theDate.withTimeZone(timezone)\n\n // Transpose the date to the selected timezone\n const dateWithTimezone = transpose(modifiedDate, DateWithOriginalTz)\n\n // Transpose the date to the user's timezone - this is necessary because the react-datepicker component insists on displaying the date in the user's timezone\n return i18n.dateFNS\n ? format(dateWithTimezone, pattern, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n }\n\n return i18n.dateFNS\n ? format(theDate, pattern, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n}\n\ntype FormatTimeToNowArgs = {\n date: Date | number | string | undefined\n i18n: I18n<any, any>\n}\n\nexport const formatTimeToNow = ({ date, i18n }: FormatTimeToNowArgs): string => {\n const theDate = new Date(date)\n return i18n?.dateFNS\n ? formatDistanceToNow(theDate, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n}\n"],"mappings":"AAEA,SAASA,UAAA,IAAcC,MAAM,QAAQ;AACrC,SAASC,MAAM,EAAEC,mBAAmB,EAAEC,SAAS,QAAQ;AASvD,OAAO,MAAMC,UAAA,GAAaA,CAAC;EAAEC,IAAI;EAAEC,IAAI;EAAEC,OAAO;EAAEC;AAAQ,CAAkB;EAC1E,MAAMC,OAAA,GAAU,IAAIT,MAAA,CAAO,IAAIU,IAAA,CAAKL,IAAA;EAEpC,IAAIG,QAAA,EAAU;IACZ,MAAMG,kBAAA,GAAqBX,MAAA,CAAOY,EAAE,CAACJ,QAAA;IAErC,MAAMK,YAAA,GAAeJ,OAAA,CAAQK,YAAY,CAACN,QAAA;IAE1C;IACA,M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G,EAAE,GAAG,CAAC,CAAA;CACrB,KAAG,MAmCH,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatDocTitle.js","names":["getTranslation","formatDate","formatDocTitle","collectionConfig","data","dateFormat","dateFormatFromConfig","fallback","globalConfig","i18n","title","useAsTitle","admin","fieldConfig","fields","find","f","name","isDate","type","date","displayFormat","pattern","label","slug","t"],"sources":["../../src/utilities/formatDocTitle.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type {\n ClientCollectionConfig,\n ClientGlobalConfig,\n SanitizedConfig,\n TypeWithID,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport { formatDate } from '../utilities/formatDate.js'\n\nexport const formatDocTitle = ({\n collectionConfig,\n data,\n dateFormat: dateFormatFromConfig,\n fallback,\n globalConfig,\n i18n,\n}: {\n collectionConfig?: ClientCollectionConfig\n data: TypeWithID\n dateFormat: SanitizedConfig['admin']['dateFormat']\n fallback?: string\n globalConfig?: ClientGlobalConfig\n i18n: I18n<any, any>\n}): string => {\n let title: string\n\n if (collectionConfig) {\n const useAsTitle = collectionConfig?.admin?.useAsTitle\n\n if (useAsTitle) {\n title = data?.[useAsTitle] || title\n\n if (title) {\n const fieldConfig = collectionConfig.fields.find(\n (f) => 'name' in f && f.name === useAsTitle,\n )\n\n const isDate = fieldConfig?.type === 'date'\n\n if (isDate) {\n const dateFormat =\n ('date' in fieldConfig.admin && fieldConfig?.admin?.date?.displayFormat) ||\n dateFormatFromConfig\n title = formatDate({ date: title, i18n, pattern: dateFormat }) || title\n }\n }\n }\n }\n\n if (globalConfig) {\n title = getTranslation(globalConfig?.label, i18n) || globalConfig?.slug\n }\n\n if (!title) {\n title = fallback || `[${i18n.t('general:untitled')}]`\n }\n\n return title\n}\n"],"mappings":"AAQA,SAASA,cAAc,QAAQ;AAE/B,SAASC,UAAU,QAAQ;AAE3B,OAAO,MAAMC,cAAA,GAAiBA,CAAC;EAC7BC,gBAAgB;EAChBC,IAA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