@payloadcms/richtext-slate 3.26.0 → 3.27.0-canary.ecc3f49
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/cell/rscEntry.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getTranslation } from '@payloadcms/translations';
|
|
3
3
|
import { Link } from '@payloadcms/ui';
|
|
4
|
-
import { formatAdminURL } from '
|
|
4
|
+
import { formatAdminURL } from 'payload/shared';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
export const RscEntrySlateCell = (props)=>{
|
|
7
7
|
const { cellData, className: classNameFromProps, collectionConfig, field: { admin }, field, i18n, link, onClick: onClickFromProps, payload, rowData } = props;
|
|
@@ -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 '
|
|
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\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,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,GAA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4
4
|
"description": "The officially supported Slate richtext adapter for Payload",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -46,20 +46,20 @@
|
|
|
46
46
|
"slate-history": "0.86.0",
|
|
47
47
|
"slate-hyperscript": "0.81.3",
|
|
48
48
|
"slate-react": "0.92.0",
|
|
49
|
-
"@payloadcms/
|
|
50
|
-
"@payloadcms/
|
|
49
|
+
"@payloadcms/translations": "3.27.0-canary.ecc3f49",
|
|
50
|
+
"@payloadcms/ui": "3.27.0-canary.ecc3f49"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/is-hotkey": "^0.1.10",
|
|
54
54
|
"@types/node": "22.5.4",
|
|
55
55
|
"@types/react": "19.0.10",
|
|
56
56
|
"@types/react-dom": "19.0.4",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
57
|
+
"@payloadcms/eslint-config": "3.9.0",
|
|
58
|
+
"payload": "3.27.0-canary.ecc3f49"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
|
|
62
|
-
"payload": "3.
|
|
62
|
+
"payload": "3.27.0-canary.ecc3f49"
|
|
63
63
|
},
|
|
64
64
|
"engines": {
|
|
65
65
|
"node": "^18.20.2 || >=20.9.0"
|