@payloadcms/richtext-lexical 3.2.2-canary.451666e → 3.2.2-canary.6fb5cd8
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/exports/react/components/RichText/converter/defaultConverters.d.ts +1 -2
- package/dist/exports/react/components/RichText/converter/defaultConverters.d.ts.map +1 -1
- package/dist/exports/react/components/RichText/converter/defaultConverters.js.map +1 -1
- package/dist/exports/react/components/RichText/converter/types.js.map +1 -1
- package/dist/exports/react/components/RichText/index.d.ts +1 -1
- package/dist/exports/react/components/RichText/index.d.ts.map +1 -1
- package/dist/exports/react/components/RichText/index.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { DefaultNodeTypes } from '../../../../../nodeTypes.js';
|
|
2
1
|
import type { JSXConverters } from './types.js';
|
|
3
|
-
export declare const defaultJSXConverters: JSXConverters
|
|
2
|
+
export declare const defaultJSXConverters: JSXConverters;
|
|
4
3
|
//# sourceMappingURL=defaultConverters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultConverters.d.ts","sourceRoot":"","sources":["../../../../../../src/exports/react/components/RichText/converter/defaultConverters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"defaultConverters.d.ts","sourceRoot":"","sources":["../../../../../../src/exports/react/components/RichText/converter/defaultConverters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAa/C,eAAO,MAAM,oBAAoB,EAAE,aAWlC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultConverters.js","names":["BlockquoteJSXConverter","HeadingJSXConverter","HorizontalRuleJSXConverter","LinebreakJSXConverter","LinkJSXConverter","ListJSXConverter","ParagraphJSXConverter","TableJSXConverter","TextJSXConverter","UploadJSXConverter","defaultJSXConverters"],"sources":["../../../../../../src/exports/react/components/RichText/converter/defaultConverters.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"defaultConverters.js","names":["BlockquoteJSXConverter","HeadingJSXConverter","HorizontalRuleJSXConverter","LinebreakJSXConverter","LinkJSXConverter","ListJSXConverter","ParagraphJSXConverter","TableJSXConverter","TextJSXConverter","UploadJSXConverter","defaultJSXConverters"],"sources":["../../../../../../src/exports/react/components/RichText/converter/defaultConverters.ts"],"sourcesContent":["import type { JSXConverters } from './types.js'\n\nimport { BlockquoteJSXConverter } from './converters/blockquote.js'\nimport { HeadingJSXConverter } from './converters/heading.js'\nimport { HorizontalRuleJSXConverter } from './converters/horizontalRule.js'\nimport { LinebreakJSXConverter } from './converters/linebreak.js'\nimport { LinkJSXConverter } from './converters/link.js'\nimport { ListJSXConverter } from './converters/list.js'\nimport { ParagraphJSXConverter } from './converters/paragraph.js'\nimport { TableJSXConverter } from './converters/table.js'\nimport { TextJSXConverter } from './converters/text.js'\nimport { UploadJSXConverter } from './converters/upload.js'\n\nexport const defaultJSXConverters: JSXConverters = {\n ...ParagraphJSXConverter,\n ...TextJSXConverter,\n ...LinebreakJSXConverter,\n ...BlockquoteJSXConverter,\n ...TableJSXConverter,\n ...HeadingJSXConverter,\n ...HorizontalRuleJSXConverter,\n ...ListJSXConverter,\n ...LinkJSXConverter({}),\n ...UploadJSXConverter,\n}\n"],"mappings":"AAEA,SAASA,sBAAsB,QAAQ;AACvC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,qBAAqB,QAAQ;AACtC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,kBAAkB,QAAQ;AAEnC,OAAO,MAAMC,oBAAA,GAAsC;EACjD,GAAGJ,qBAAqB;EACxB,GAAGE,gBAAgB;EACnB,GAAGL,qBAAqB;EACxB,GAAGH,sBAAsB;EACzB,GAAGO,iBAAiB;EACpB,GAAGN,mBAAmB;EACtB,GAAGC,0BAA0B;EAC7B,GAAGG,gBAAgB;EACnB,GAAGD,gBAAA,CAAiB,CAAC,EAAE;EACvB,GAAGK;AACL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/exports/react/components/RichText/converter/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../../nodeTypes.js'\nexport type JSXConverter<T extends { [key: string]: any; type?: string } = SerializedLexicalNode> =\n (args: {\n childIndex: number\n converters: JSXConverters\n node: T\n nodesToJSX: (args: {\n converters?: JSXConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent?: SerializedLexicalNodeWithParent\n }) => React.ReactNode[]\n parent: SerializedLexicalNodeWithParent\n }) => React.ReactNode\n\nexport type JSXConverters<\n T extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/exports/react/components/RichText/converter/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../../nodeTypes.js'\nexport type JSXConverter<T extends { [key: string]: any; type?: string } = SerializedLexicalNode> =\n (args: {\n childIndex: number\n converters: JSXConverters\n node: T\n nodesToJSX: (args: {\n converters?: JSXConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent?: SerializedLexicalNodeWithParent\n }) => React.ReactNode[]\n parent: SerializedLexicalNodeWithParent\n }) => React.ReactNode\n\nexport type JSXConverters<\n T extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }>\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>,\n> = {\n [key: string]:\n | {\n [blockSlug: string]: JSXConverter<any>\n }\n | JSXConverter<any>\n | undefined\n} & {\n [nodeType in Exclude<NonNullable<T['type']>, 'block' | 'inlineBlock'>]?: JSXConverter<\n Extract<T, { type: nodeType }>\n >\n} & {\n blocks?: {\n [K in Extract<\n T extends { type: 'block' }\n ? T extends SerializedBlockNode<infer B>\n ? B extends { blockType: string }\n ? B['blockType']\n : never\n : never\n : never,\n string\n >]?: JSXConverter<\n T extends SerializedBlockNode<any>\n ? SerializedBlockNode<\n Extract<T extends SerializedBlockNode<infer B> ? B : never, { blockType: K }>\n >\n : SerializedBlockNode\n >\n }\n inlineBlocks?: {\n [K in Extract<\n T extends { type: 'inlineBlock' }\n ? T extends SerializedInlineBlockNode<infer B>\n ? B extends { blockType: string }\n ? B['blockType']\n : never\n : never\n : never,\n string\n >]?: JSXConverter<\n T extends SerializedInlineBlockNode<any>\n ? SerializedInlineBlockNode<\n Extract<T extends SerializedInlineBlockNode<infer B> ? B : never, { blockType: K }>\n >\n : SerializedInlineBlockNode\n >\n }\n}\n\nexport type SerializedLexicalNodeWithParent = {\n parent?: SerializedLexicalNode\n} & SerializedLexicalNode\n"],"mappings":"AA6EA","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@ export type JSXConvertersFunction<T extends {
|
|
|
12
12
|
blockName?: null | string;
|
|
13
13
|
blockType: string;
|
|
14
14
|
}>> = (args: {
|
|
15
|
-
defaultConverters: JSXConverters
|
|
15
|
+
defaultConverters: JSXConverters;
|
|
16
16
|
}) => JSXConverters<T>;
|
|
17
17
|
type Props = {
|
|
18
18
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exports/react/components/RichText/index.tsx"],"names":[],"mappings":"AAA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,MAAM,CAAA;CAAE,CAAC,GACrE,yBAAyB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,IAC7E,CAAC,IAAI,EAAE;IAAE,iBAAiB,EAAE,aAAa,CAAA;CAAE,KAAK,aAAa,CAAC,CAAC,CAAC,CAAA;AAEpE,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,GAAG,qBAAqB,CAAA;IAClD,IAAI,EAAE,qBAAqB,CAAA;IAC3B,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IAClC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAoCpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","defaultJSXConverters","convertLexicalToJSX","RichText","className","converters","data","editorState","disableIndent","disableTextAlign","finalConverters","defaultConverters","_jsx","Array","isArray"],"sources":["../../../../../src/exports/react/components/RichText/index.tsx"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\n\nimport React from 'react'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../nodeTypes.js'\nimport type { JSXConverters } from './converter/types.js'\n\nimport { defaultJSXConverters } from './converter/defaultConverters.js'\nimport { convertLexicalToJSX } from './converter/index.js'\n\nexport type JSXConvertersFunction<\n T extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }>\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>,\n> = (args: { defaultConverters: JSXConverters
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","defaultJSXConverters","convertLexicalToJSX","RichText","className","converters","data","editorState","disableIndent","disableTextAlign","finalConverters","defaultConverters","_jsx","Array","isArray"],"sources":["../../../../../src/exports/react/components/RichText/index.tsx"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\n\nimport React from 'react'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../nodeTypes.js'\nimport type { JSXConverters } from './converter/types.js'\n\nimport { defaultJSXConverters } from './converter/defaultConverters.js'\nimport { convertLexicalToJSX } from './converter/index.js'\n\nexport type JSXConvertersFunction<\n T extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }>\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>,\n> = (args: { defaultConverters: JSXConverters }) => JSXConverters<T>\n\ntype Props = {\n className?: string\n converters?: JSXConverters | JSXConvertersFunction\n data: SerializedEditorState\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n}\n\nexport const RichText: React.FC<Props> = ({\n className,\n converters,\n data: editorState,\n disableIndent,\n disableTextAlign,\n}) => {\n if (!editorState) {\n return null\n }\n\n let finalConverters: JSXConverters = {}\n if (converters) {\n if (typeof converters === 'function') {\n finalConverters = converters({ defaultConverters: defaultJSXConverters })\n } else {\n finalConverters = converters\n }\n } else {\n finalConverters = defaultJSXConverters\n }\n\n return (\n <div className={className}>\n {editorState &&\n !Array.isArray(editorState) &&\n typeof editorState === 'object' &&\n 'root' in editorState &&\n convertLexicalToJSX({\n converters: finalConverters,\n data: editorState,\n disableIndent,\n disableTextAlign,\n })}\n </div>\n )\n}\n"],"mappings":";AAEA,OAAOA,KAAA,MAAW;AASlB,SAASC,oBAAoB,QAAQ;AACrC,SAASC,mBAAmB,QAAQ;AAiBpC,OAAO,MAAMC,QAAA,GAA4BA,CAAC;EACxCC,SAAS;EACTC,UAAU;EACVC,IAAA,EAAMC,WAAW;EACjBC,aAAa;EACbC;AAAgB,CACjB;EACC,IAAI,CAACF,WAAA,EAAa;IAChB,OAAO;EACT;EAEA,IAAIG,eAAA,GAAiC,CAAC;EACtC,IAAIL,UAAA,EAAY;IACd,IAAI,OAAOA,UAAA,KAAe,YAAY;MACpCK,eAAA,GAAkBL,UAAA,CAAW;QAAEM,iBAAA,EAAmBV;MAAqB;IACzE,OAAO;MACLS,eAAA,GAAkBL,UAAA;IACpB;EACF,OAAO;IACLK,eAAA,GAAkBT,oBAAA;EACpB;EAEA,oBACEW,IAAA,CAAC;IAAIR,SAAA,EAAWA,SAAA;cACbG,WAAA,IACC,CAACM,KAAA,CAAMC,OAAO,CAACP,WAAA,KACf,OAAOA,WAAA,KAAgB,YACvB,UAAUA,WAAA,IACVL,mBAAA,CAAoB;MAClBG,UAAA,EAAYK,eAAA;MACZJ,IAAA,EAAMC,WAAA;MACNC,aAAA;MACAC;IACF;;AAGR","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/richtext-lexical",
|
|
3
|
-
"version": "3.2.2-canary.
|
|
3
|
+
"version": "3.2.2-canary.6fb5cd8",
|
|
4
4
|
"description": "The officially supported Lexical richtext adapter for Payload",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -345,8 +345,8 @@
|
|
|
345
345
|
"react-error-boundary": "4.1.1",
|
|
346
346
|
"ts-essentials": "10.0.3",
|
|
347
347
|
"uuid": "10.0.0",
|
|
348
|
-
"@payloadcms/translations": "3.2.2-canary.
|
|
349
|
-
"@payloadcms/ui": "3.2.2-canary.
|
|
348
|
+
"@payloadcms/translations": "3.2.2-canary.6fb5cd8",
|
|
349
|
+
"@payloadcms/ui": "3.2.2-canary.6fb5cd8"
|
|
350
350
|
},
|
|
351
351
|
"devDependencies": {
|
|
352
352
|
"@babel/cli": "^7.24.5",
|
|
@@ -367,7 +367,7 @@
|
|
|
367
367
|
"eslint-plugin-react-compiler": "19.0.0-beta-a7bf2bd-20241110",
|
|
368
368
|
"swc-plugin-transform-remove-imports": "1.15.0",
|
|
369
369
|
"@payloadcms/eslint-config": "3.0.0",
|
|
370
|
-
"payload": "3.2.2-canary.
|
|
370
|
+
"payload": "3.2.2-canary.6fb5cd8"
|
|
371
371
|
},
|
|
372
372
|
"peerDependencies": {
|
|
373
373
|
"@faceless-ui/modal": "3.0.0-beta.2",
|
|
@@ -384,8 +384,8 @@
|
|
|
384
384
|
"lexical": "0.20.0",
|
|
385
385
|
"react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
|
|
386
386
|
"react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
|
|
387
|
-
"@payloadcms/next": "3.2.2-canary.
|
|
388
|
-
"payload": "3.2.2-canary.
|
|
387
|
+
"@payloadcms/next": "3.2.2-canary.6fb5cd8",
|
|
388
|
+
"payload": "3.2.2-canary.6fb5cd8"
|
|
389
389
|
},
|
|
390
390
|
"engines": {
|
|
391
391
|
"node": "^18.20.2 || >=20.9.0"
|