@payloadcms/richtext-slate 3.68.1 → 3.68.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"rscEntry.d.ts","sourceRoot":"","sources":["../../src/cell/rscEntry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEvE,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAG1E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CACtC;IACE,IAAI,EAAE,UAAU,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,+BAA+B,CAyEpC,CAAA"}
1
+ {"version":3,"file":"rscEntry.d.ts","sourceRoot":"","sources":["../../src/cell/rscEntry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEvE,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAG1E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CACtC;IACE,IAAI,EAAE,UAAU,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,+BAA+B,CA2EpC,CAAA"}
@@ -10,6 +10,7 @@ import React from 'react';
10
10
  const classNameFromConfigContext = admin && 'className' in admin ? admin.className : undefined;
11
11
  const className = classNameFromProps || (field.admin && 'className' in field.admin ? field.admin.className : null) || classNameFromConfigContext;
12
12
  const adminRoute = payload.config.routes.admin;
13
+ const serverURL = payload.config.serverURL;
13
14
  const onClick = onClickFromProps;
14
15
  let WrapElement = 'span';
15
16
  const wrapElementProps = {
@@ -20,7 +21,8 @@ import React from 'react';
20
21
  WrapElement = Link;
21
22
  wrapElementProps.href = collectionConfig?.slug ? formatAdminURL({
22
23
  adminRoute,
23
- path: `/collections/${collectionConfig?.slug}/${rowData.id}`
24
+ path: `/collections/${collectionConfig?.slug}/${rowData.id}`,
25
+ serverURL
24
26
  }) : '';
25
27
  }
26
28
  if (typeof onClick === 'function') {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cell/rscEntry.tsx"],"sourcesContent":["import type { DefaultServerCellComponentProps, Payload } from 'payload'\n\nimport { getTranslation, type I18nClient } from '@payloadcms/translations'\nimport { Link } from '@payloadcms/ui'\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\n/**\n * @deprecated - slate will be removed in 4.0. Please [migrate our new, lexical-based rich text editor](https://payloadcms.com/docs/rich-text/migration#migrating-from-slate).\n */\nexport const RscEntrySlateCell: React.FC<\n {\n i18n: I18nClient\n payload: Payload\n } & DefaultServerCellComponentProps\n> = (props) => {\n const {\n cellData,\n className: classNameFromProps,\n collectionConfig,\n field: { admin },\n field,\n i18n,\n link,\n onClick: onClickFromProps,\n payload,\n rowData,\n } = props\n\n const classNameFromConfigContext = admin && 'className' in admin ? admin.className : undefined\n\n const className =\n classNameFromProps ||\n (field.admin && 'className' in field.admin ? field.admin.className : null) ||\n classNameFromConfigContext\n const adminRoute = payload.config.routes.admin\n\n const onClick = onClickFromProps\n\n let WrapElement: React.ComponentType<any> | string = 'span'\n\n const wrapElementProps: {\n className?: string\n href?: string\n onClick?: () => void\n prefetch?: false\n type?: 'button'\n } = {\n className,\n }\n\n if (link) {\n wrapElementProps.prefetch = false\n WrapElement = Link\n wrapElementProps.href = collectionConfig?.slug\n ? formatAdminURL({\n adminRoute,\n path: `/collections/${collectionConfig?.slug}/${rowData.id}`,\n })\n : ''\n }\n\n if (typeof onClick === 'function') {\n WrapElement = 'button'\n wrapElementProps.type = 'button'\n wrapElementProps.onClick = () => {\n onClick({\n cellData,\n collectionSlug: collectionConfig?.slug,\n rowData,\n })\n }\n }\n\n let textContent = ''\n\n if (cellData) {\n textContent = cellData?.map((i) => i?.children?.map((c) => c.text)).join(' ')\n }\n\n if (!cellData || !textContent?.length) {\n textContent = i18n.t('general:noLabel', {\n label: getTranslation(('label' in field ? field.label : null) || 'data', i18n),\n })\n }\n\n return <WrapElement {...wrapElementProps}>{textContent}</WrapElement>\n}\n"],"names":["getTranslation","Link","formatAdminURL","React","RscEntrySlateCell","props","cellData","className","classNameFromProps","collectionConfig","field","admin","i18n","link","onClick","onClickFromProps","payload","rowData","classNameFromConfigContext","undefined","adminRoute","config","routes","WrapElement","wrapElementProps","prefetch","href","slug","path","id","type","collectionSlug","textContent","map","i","children","c","text","join","length","t","label"],"mappings":";AAEA,SAASA,cAAc,QAAyB,2BAA0B;AAC1E,SAASC,IAAI,QAAQ,iBAAgB;AACrC,SAASC,cAAc,QAAQ,iBAAgB;AAC/C,OAAOC,WAAW,QAAO;AAEzB;;CAEC,GACD,OAAO,MAAMC,oBAKT,CAACC;IACH,MAAM,EACJC,QAAQ,EACRC,WAAWC,kBAAkB,EAC7BC,gBAAgB,EAChBC,OAAO,EAAEC,KAAK,EAAE,EAChBD,KAAK,EACLE,IAAI,EACJC,IAAI,EACJC,SAASC,gBAAgB,EACzBC,OAAO,EACPC,OAAO,EACR,GAAGZ;IAEJ,MAAMa,6BAA6BP,SAAS,eAAeA,QAAQA,MAAMJ,SAAS,GAAGY;IAErF,MAAMZ,YACJC,sBACCE,CAAAA,MAAMC,KAAK,IAAI,eAAeD,MAAMC,KAAK,GAAGD,MAAMC,KAAK,CAACJ,SAAS,GAAG,IAAG,KACxEW;IACF,MAAME,aAAaJ,QAAQK,MAAM,CAACC,MAAM,CAACX,KAAK;IAE9C,MAAMG,UAAUC;IAEhB,IAAIQ,cAAiD;IAErD,MAAMC,mBAMF;QACFjB;IACF;IAEA,IAAIM,MAAM;QACRW,iBAAiBC,QAAQ,GAAG;QAC5BF,cAActB;QACduB,iBAAiBE,IAAI,GAAGjB,kBAAkBkB,OACtCzB,eAAe;YACbkB;YACAQ,MAAM,CAAC,aAAa,EAAEnB,kBAAkBkB,KAAK,CAAC,EAAEV,QAAQY,EAAE,EAAE;QAC9D,KACA;IACN;IAEA,IAAI,OAAOf,YAAY,YAAY;QACjCS,cAAc;QACdC,iBAAiBM,IAAI,GAAG;QACxBN,iBAAiBV,OAAO,GAAG;YACzBA,QAAQ;gBACNR;gBACAyB,gBAAgBtB,kBAAkBkB;gBAClCV;YACF;QACF;IACF;IAEA,IAAIe,cAAc;IAElB,IAAI1B,UAAU;QACZ0B,cAAc1B,UAAU2B,IAAI,CAACC,IAAMA,GAAGC,UAAUF,IAAI,CAACG,IAAMA,EAAEC,IAAI,GAAGC,KAAK;IAC3E;IAEA,IAAI,CAAChC,YAAY,CAAC0B,aAAaO,QAAQ;QACrCP,cAAcpB,KAAK4B,CAAC,CAAC,mBAAmB;YACtCC,OAAOzC,eAAe,AAAC,CAAA,WAAWU,QAAQA,MAAM+B,KAAK,GAAG,IAAG,KAAM,QAAQ7B;QAC3E;IACF;IAEA,qBAAO,KAACW;QAAa,GAAGC,gBAAgB;kBAAGQ;;AAC7C,EAAC"}
1
+ {"version":3,"sources":["../../src/cell/rscEntry.tsx"],"sourcesContent":["import type { DefaultServerCellComponentProps, Payload } from 'payload'\n\nimport { getTranslation, type I18nClient } from '@payloadcms/translations'\nimport { Link } from '@payloadcms/ui'\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\n/**\n * @deprecated - slate will be removed in 4.0. Please [migrate our new, lexical-based rich text editor](https://payloadcms.com/docs/rich-text/migration#migrating-from-slate).\n */\nexport const RscEntrySlateCell: React.FC<\n {\n i18n: I18nClient\n payload: Payload\n } & DefaultServerCellComponentProps\n> = (props) => {\n const {\n cellData,\n className: classNameFromProps,\n collectionConfig,\n field: { admin },\n field,\n i18n,\n link,\n onClick: onClickFromProps,\n payload,\n rowData,\n } = props\n\n const classNameFromConfigContext = admin && 'className' in admin ? admin.className : undefined\n\n const className =\n classNameFromProps ||\n (field.admin && 'className' in field.admin ? field.admin.className : null) ||\n classNameFromConfigContext\n const adminRoute = payload.config.routes.admin\n const serverURL = payload.config.serverURL\n\n const onClick = onClickFromProps\n\n let WrapElement: React.ComponentType<any> | string = 'span'\n\n const wrapElementProps: {\n className?: string\n href?: string\n onClick?: () => void\n prefetch?: false\n type?: 'button'\n } = {\n className,\n }\n\n if (link) {\n wrapElementProps.prefetch = false\n WrapElement = Link\n wrapElementProps.href = collectionConfig?.slug\n ? formatAdminURL({\n adminRoute,\n path: `/collections/${collectionConfig?.slug}/${rowData.id}`,\n serverURL,\n })\n : ''\n }\n\n if (typeof onClick === 'function') {\n WrapElement = 'button'\n wrapElementProps.type = 'button'\n wrapElementProps.onClick = () => {\n onClick({\n cellData,\n collectionSlug: collectionConfig?.slug,\n rowData,\n })\n }\n }\n\n let textContent = ''\n\n if (cellData) {\n textContent = cellData?.map((i) => i?.children?.map((c) => c.text)).join(' ')\n }\n\n if (!cellData || !textContent?.length) {\n textContent = i18n.t('general:noLabel', {\n label: getTranslation(('label' in field ? field.label : null) || 'data', i18n),\n })\n }\n\n return <WrapElement {...wrapElementProps}>{textContent}</WrapElement>\n}\n"],"names":["getTranslation","Link","formatAdminURL","React","RscEntrySlateCell","props","cellData","className","classNameFromProps","collectionConfig","field","admin","i18n","link","onClick","onClickFromProps","payload","rowData","classNameFromConfigContext","undefined","adminRoute","config","routes","serverURL","WrapElement","wrapElementProps","prefetch","href","slug","path","id","type","collectionSlug","textContent","map","i","children","c","text","join","length","t","label"],"mappings":";AAEA,SAASA,cAAc,QAAyB,2BAA0B;AAC1E,SAASC,IAAI,QAAQ,iBAAgB;AACrC,SAASC,cAAc,QAAQ,iBAAgB;AAC/C,OAAOC,WAAW,QAAO;AAEzB;;CAEC,GACD,OAAO,MAAMC,oBAKT,CAACC;IACH,MAAM,EACJC,QAAQ,EACRC,WAAWC,kBAAkB,EAC7BC,gBAAgB,EAChBC,OAAO,EAAEC,KAAK,EAA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A,qBAAO,KAACY;QAAa,GAAGC,gBAAgB;kBAAGQ;;AAC7C,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/richtext-slate",
3
- "version": "3.68.1",
3
+ "version": "3.68.3",
4
4
  "description": "The officially supported Slate richtext adapter for Payload",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -50,21 +50,21 @@
50
50
  "slate-history": "0.86.0",
51
51
  "slate-hyperscript": "0.81.3",
52
52
  "slate-react": "0.92.0",
53
- "@payloadcms/translations": "3.68.1",
54
- "@payloadcms/ui": "3.68.1"
53
+ "@payloadcms/translations": "3.68.3",
54
+ "@payloadcms/ui": "3.68.3"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/is-hotkey": "^0.1.10",
58
58
  "@types/node": "22.15.30",
59
59
  "@types/react": "19.2.1",
60
60
  "@types/react-dom": "19.2.1",
61
- "@payloadcms/eslint-config": "3.28.0",
62
- "payload": "3.68.1"
61
+ "payload": "3.68.3",
62
+ "@payloadcms/eslint-config": "3.28.0"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "react": "^19.0.1 || ^19.1.2 || ^19.2.1",
66
66
  "react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
67
- "payload": "3.68.1"
67
+ "payload": "3.68.3"
68
68
  },
69
69
  "engines": {
70
70
  "node": "^18.20.2 || >=20.9.0"