@payloadcms/richtext-lexical 3.0.0 → 3.0.1-canary.d23ede3

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/field/rscEntry.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,UAAU,EAGV,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAGhB,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAOzD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CACzC;IACE,KAAK,EAAE,sBAAsB,CAAA;IAC7B,qBAAqB,EAAE,2BAA2B,CAAA;CACnD,GAAG,oBAAoB,GACtB,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GACxB,oBAAoB,CAiDvB,CAAA"}
1
+ {"version":3,"file":"rscEntry.d.ts","sourceRoot":"","sources":["../../src/field/rscEntry.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,UAAU,EAGV,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAGhB,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAA6B,MAAM,aAAa,CAAA;AAOpF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CACzC;IACE,KAAK,EAAE,sBAAsB,CAAA;IAC7B,qBAAqB,EAAE,2BAA2B,CAAA;CACnD,GAAG,oBAAoB,GACtB,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GACxB,oBAAoB,CAuDvB,CAAA"}
@@ -38,19 +38,27 @@ export const RscEntryLexicalField = async args => {
38
38
  nodeData: args.data?.[field.name]?.root?.children
39
39
  });
40
40
  }
41
- return /*#__PURE__*/_jsx(RichTextField, {
41
+ const props = {
42
42
  admin: args.admin,
43
- clientFeatures: clientFeatures,
44
- featureClientSchemaMap: featureClientSchemaMap,
43
+ clientFeatures,
44
+ featureClientSchemaMap,
45
45
  field: args.clientField,
46
46
  forceRender: args.forceRender,
47
- initialLexicalFormState: initialLexicalFormState,
47
+ initialLexicalFormState,
48
48
  lexicalEditorConfig: args.sanitizedEditorConfig.lexical,
49
- path: path,
49
+ path,
50
50
  permissions: args.permissions,
51
51
  readOnly: args.readOnly,
52
52
  renderedBlocks: args.renderedBlocks,
53
- schemaPath: schemaPath
53
+ schemaPath
54
+ };
55
+ for (const key in props) {
56
+ if (!props[key]) {
57
+ delete props[key];
58
+ }
59
+ }
60
+ return /*#__PURE__*/_jsx(RichTextField, {
61
+ ...props
54
62
  });
55
63
  };
56
64
  //# sourceMappingURL=rscEntry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rscEntry.js","names":["renderField","React","RichTextField","buildInitialState","initLexicalFeatures","RscEntryLexicalField","args","field","path","clientField","name","schemaPath","clientFeatures","featureClientSchemaMap","fieldSchemaMap","i18n","payload","sanitizedEditorConfig","initialLexicalFormState","data","root","children","length","context","id","collectionSlug","lexicalFieldSchemaPath","operation","permissions","preferences","renderFieldFn","req","nodeData","_jsx","admin","forceRender","lexicalEditorConfig","lexical","readOnly","renderedBlocks"],"sources":["../../src/field/rscEntry.tsx"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\nimport type {\n ClientComponentProps,\n FieldPaths,\n RichTextFieldClient,\n RichTextField as RichTextFieldType,\n ServerComponentProps,\n} from 'payload'\n\nimport { renderField } from '@payloadcms/ui/forms/renderField'\nimport React from 'react'\n\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\nimport type { LexicalFieldAdminProps } from '../types.js'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { RichTextField } from '../exports/client/index.js'\nimport { buildInitialState } from '../utilities/buildInitialState.js'\nimport { initLexicalFeatures } from '../utilities/initLexicalFeatures.js'\n\nexport const RscEntryLexicalField: React.FC<\n {\n admin: LexicalFieldAdminProps\n sanitizedEditorConfig: SanitizedServerEditorConfig\n } & ClientComponentProps &\n Pick<FieldPaths, 'path'> &\n ServerComponentProps\n> = async (args) => {\n const field: RichTextFieldType = args.field as RichTextFieldType\n const path = args.path ?? (args.clientField as RichTextFieldClient).name\n const schemaPath = args.schemaPath ?? path\n const { clientFeatures, featureClientSchemaMap } = initLexicalFeatures({\n fieldSchemaMap: args.fieldSchemaMap,\n i18n: args.i18n,\n path,\n payload: args.payload,\n sanitizedEditorConfig: args.sanitizedEditorConfig,\n schemaPath,\n })\n\n let initialLexicalFormState = {}\n if (args.data?.[field.name]?.root?.children?.length) {\n initialLexicalFormState = await buildInitialState({\n context: {\n id: args.id,\n collectionSlug: args.collectionSlug,\n field,\n fieldSchemaMap: args.fieldSchemaMap,\n lexicalFieldSchemaPath: schemaPath,\n operation: args.operation,\n permissions: args.permissions,\n preferences: args.preferences,\n renderFieldFn: renderField,\n req: args.req,\n },\n nodeData: args.data?.[field.name]?.root?.children as SerializedLexicalNode[],\n })\n }\n\n return (\n <RichTextField\n admin={args.admin}\n clientFeatures={clientFeatures}\n featureClientSchemaMap={featureClientSchemaMap}\n field={args.clientField as RichTextFieldClient}\n forceRender={args.forceRender}\n initialLexicalFormState={initialLexicalFormState}\n lexicalEditorConfig={args.sanitizedEditorConfig.lexical}\n path={path}\n permissions={args.permissions}\n readOnly={args.readOnly}\n renderedBlocks={args.renderedBlocks}\n schemaPath={schemaPath}\n />\n )\n}\n"],"mappings":";AASA,SAASA,WAAW,QAAQ;AAC5B,OAAOC,KAAA,MAAW;AAKlB;AACA,SAASC,aAAa,QAAQ;AAC9B,SAASC,iBAAiB,QAAQ;AAClC,SAASC,mBAAmB,QAAQ;AAEpC,OAAO,MAAMC,oBAAA,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tB,cAAA,EAAgBA,cAAA;IAChBC,sBAAA,EAAwBA,sBAAA;IACxBN,KAAA,EAAOD,IAAA,CAAKG,WAAW;IACvB0B,WAAA,EAAa7B,IAAA,CAAK6B,WAAW;IAC7BjB,uBAAA,EAAyBA,uBAAA;IACzBkB,mBAAA,EAAqB9B,IAAA,CAAKW,qBAAqB,CAACoB,OAAO;IACvD7B,IAAA,EAAMA,IAAA;IACNoB,WAAA,EAAatB,IAAA,CAAKsB,WAAW;IAC7BU,QAAA,EAAUhC,IAAA,CAAKgC,QAAQ;IACvBC,cAAA,EAAgBjC,IAAA,CAAKiC,cAAc;IACnC5B,UAAA,EAAYA;;AAGlB","ignoreList":[]}
1
+ {"version":3,"file":"rscEntry.js","names":["renderField","React","RichTextField","buildInitialState","initLexicalFeatures","RscEntryLexicalField","args","field","path","clientField","name","schemaPath","clientFeatures","featureClientSchemaMap","fieldSchemaMap","i18n","payload","sanitizedEditorConfig","initialLexicalFormState","data","root","children","length","context","id","collectionSlug","lexicalFieldSchemaPath","operation","permissions","preferences","renderFieldFn","req","nodeData","props","admin","forceRender","lexicalEditorConfig","lexical","readOnly","renderedBlocks","key","_jsx"],"sources":["../../src/field/rscEntry.tsx"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\nimport type {\n ClientComponentProps,\n FieldPaths,\n RichTextFieldClient,\n RichTextField as RichTextFieldType,\n ServerComponentProps,\n} from 'payload'\n\nimport { renderField } from '@payloadcms/ui/forms/renderField'\nimport React from 'react'\n\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\nimport type { LexicalFieldAdminProps, LexicalRichTextFieldProps } from '../types.js'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { RichTextField } from '../exports/client/index.js'\nimport { buildInitialState } from '../utilities/buildInitialState.js'\nimport { initLexicalFeatures } from '../utilities/initLexicalFeatures.js'\n\nexport const RscEntryLexicalField: React.FC<\n {\n admin: LexicalFieldAdminProps\n sanitizedEditorConfig: SanitizedServerEditorConfig\n } & ClientComponentProps &\n Pick<FieldPaths, 'path'> &\n ServerComponentProps\n> = async (args) => {\n const field: RichTextFieldType = args.field as RichTextFieldType\n const path = args.path ?? (args.clientField as RichTextFieldClient).name\n const schemaPath = args.schemaPath ?? path\n const { clientFeatures, featureClientSchemaMap } = initLexicalFeatures({\n fieldSchemaMap: args.fieldSchemaMap,\n i18n: args.i18n,\n path,\n payload: args.payload,\n sanitizedEditorConfig: args.sanitizedEditorConfig,\n schemaPath,\n })\n\n let initialLexicalFormState = {}\n if (args.data?.[field.name]?.root?.children?.length) {\n initialLexicalFormState = await buildInitialState({\n context: {\n id: args.id,\n collectionSlug: args.collectionSlug,\n field,\n fieldSchemaMap: args.fieldSchemaMap,\n lexicalFieldSchemaPath: schemaPath,\n operation: args.operation,\n permissions: args.permissions,\n preferences: args.preferences,\n renderFieldFn: renderField,\n req: args.req,\n },\n nodeData: args.data?.[field.name]?.root?.children as SerializedLexicalNode[],\n })\n }\n\n const props: LexicalRichTextFieldProps = {\n admin: args.admin,\n clientFeatures,\n featureClientSchemaMap,\n field: args.clientField as RichTextFieldClient,\n forceRender: args.forceRender,\n initialLexicalFormState,\n lexicalEditorConfig: args.sanitizedEditorConfig.lexical,\n path,\n permissions: args.permissions,\n readOnly: args.readOnly,\n renderedBlocks: args.renderedBlocks,\n schemaPath,\n }\n\n for (const key in props) {\n if (!props[key]) {\n delete props[key]\n }\n }\n\n return <RichTextField {...props} />\n}\n"],"mappings":";AASA,SAASA,WAAW,QAAQ;AAC5B,OAAOC,KAAA,MAAW;AAKlB;AACA,SAASC,aAAa,QAAQ;AAC9B,SAASC,iBAAiB,QAAQ;AAClC,SAASC,mBAAmB,QAAQ;AAEpC,OAAO,MAAMC,oBAAA,GAOT,MAAOC,IAAA;EACT,MAAMC,KAAA,GAA2BD,IAAA,CAAKC,KAAK;EAC3C,MAAMC,IAAA,GAAOF,IAAA,CAAKE,IAAI,IAAIF,IAAC,CAAKG,WAAW,CAAyBC,IAAI;EACxE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B,CAACoB,OAAO;IACvD7B,IAAA;IACAoB,WAAA,EAAatB,IAAA,CAAKsB,WAAW;IAC7BU,QAAA,EAAUhC,IAAA,CAAKgC,QAAQ;IACvBC,cAAA,EAAgBjC,IAAA,CAAKiC,cAAc;IACnC5B;EACF;EAEA,KAAK,MAAM6B,GAAA,IAAOP,KAAA,EAAO;IACvB,IAAI,CAACA,KAAK,CAACO,GAAA,CAAI,EAAE;MACf,OAAOP,KAAK,CAACO,GAAA,CAAI;IACnB;EACF;EAEA,oBAAOC,IAAA,CAACvC,aAAA;IAAe,GAAG+B;;AAC5B","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/richtext-lexical",
3
- "version": "3.0.0",
3
+ "version": "3.0.1-canary.d23ede3",
4
4
  "description": "The officially supported Lexical richtext adapter for Payload",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -341,8 +341,8 @@
341
341
  "react-error-boundary": "4.0.13",
342
342
  "ts-essentials": "10.0.3",
343
343
  "uuid": "10.0.0",
344
- "@payloadcms/translations": "3.0.0",
345
- "@payloadcms/ui": "3.0.0"
344
+ "@payloadcms/ui": "3.0.1-canary.d23ede3",
345
+ "@payloadcms/translations": "3.0.1-canary.d23ede3"
346
346
  },
347
347
  "devDependencies": {
348
348
  "@babel/cli": "^7.24.5",
@@ -362,8 +362,8 @@
362
362
  "esbuild-sass-plugin": "3.3.1",
363
363
  "eslint-plugin-react-compiler": "19.0.0-beta-a7bf2bd-20241110",
364
364
  "swc-plugin-transform-remove-imports": "1.15.0",
365
- "@payloadcms/eslint-config": "3.0.0-beta.112",
366
- "payload": "3.0.0"
365
+ "@payloadcms/eslint-config": "3.0.0",
366
+ "payload": "3.0.1-canary.d23ede3"
367
367
  },
368
368
  "peerDependencies": {
369
369
  "@faceless-ui/modal": "3.0.0-beta.2",
@@ -381,8 +381,8 @@
381
381
  "lexical": "0.20.0",
382
382
  "react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
383
383
  "react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
384
- "@payloadcms/next": "3.0.0",
385
- "payload": "3.0.0"
384
+ "@payloadcms/next": "3.0.1-canary.d23ede3",
385
+ "payload": "3.0.1-canary.d23ede3"
386
386
  },
387
387
  "engines": {
388
388
  "node": "^18.20.2 || >=20.9.0"