@payloadcms/richtext-lexical 3.60.0-canary.2 → 3.60.0-internal.1fe1a87

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 (55) hide show
  1. package/dist/exports/client/{chunk-XNERFY6G.js → chunk-ADWHGDDR.js} +2 -2
  2. package/dist/exports/client/{chunk-XNERFY6G.js.map → chunk-ADWHGDDR.js.map} +2 -2
  3. package/dist/exports/client/componentInline-MIPTDFRK.js +2 -0
  4. package/dist/exports/client/index.d.ts +1 -1
  5. package/dist/exports/client/index.d.ts.map +1 -1
  6. package/dist/exports/client/index.js +13 -13
  7. package/dist/exports/client/index.js.map +3 -3
  8. package/dist/features/blockquote/server/index.d.ts +3 -4
  9. package/dist/features/blockquote/server/index.d.ts.map +1 -1
  10. package/dist/features/blockquote/server/index.js.map +1 -1
  11. package/dist/features/blocks/premade/CodeBlock/index.d.ts +3 -1
  12. package/dist/features/blocks/premade/CodeBlock/index.d.ts.map +1 -1
  13. package/dist/features/blocks/premade/CodeBlock/index.js +7 -2
  14. package/dist/features/blocks/premade/CodeBlock/index.js.map +1 -1
  15. package/dist/features/blocks/server/nodes/BlocksNode.d.ts +4 -5
  16. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  17. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  18. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +4 -5
  19. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  20. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  21. package/dist/features/experimental_table/server/index.d.ts +5 -10
  22. package/dist/features/experimental_table/server/index.d.ts.map +1 -1
  23. package/dist/features/experimental_table/server/index.js.map +1 -1
  24. package/dist/features/heading/server/index.d.ts +3 -4
  25. package/dist/features/heading/server/index.d.ts.map +1 -1
  26. package/dist/features/heading/server/index.js.map +1 -1
  27. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +3 -5
  28. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  29. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  30. package/dist/features/link/nodes/types.d.ts +6 -6
  31. package/dist/features/link/nodes/types.d.ts.map +1 -1
  32. package/dist/features/link/nodes/types.js.map +1 -1
  33. package/dist/features/lists/plugin/index.d.ts +6 -7
  34. package/dist/features/lists/plugin/index.d.ts.map +1 -1
  35. package/dist/features/lists/plugin/index.js.map +1 -1
  36. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +3 -5
  37. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  38. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  39. package/dist/features/upload/server/nodes/UploadNode.d.ts +3 -5
  40. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  41. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  42. package/dist/index.d.ts +1 -1
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +1 -1
  45. package/dist/index.js.map +1 -1
  46. package/dist/nodeTypes.d.ts +46 -20
  47. package/dist/nodeTypes.d.ts.map +1 -1
  48. package/dist/nodeTypes.js.map +1 -1
  49. package/dist/utilities/buildEditorState.d.ts +47 -6
  50. package/dist/utilities/buildEditorState.d.ts.map +1 -1
  51. package/dist/utilities/buildEditorState.js +10 -1
  52. package/dist/utilities/buildEditorState.js.map +1 -1
  53. package/package.json +7 -7
  54. package/dist/exports/client/componentInline-NGTRUSGB.js +0 -2
  55. /package/dist/exports/client/{componentInline-NGTRUSGB.js.map → componentInline-MIPTDFRK.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"nodeTypes.d.ts","sourceRoot":"","sources":["../src/nodeTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,IAAI,wBAAwB,EACnD,iBAAiB,IAAI,kBAAkB,EACvC,kBAAkB,IAAI,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AG,CAAC,GACxF,CAAC,GACL,KAAK,CAAA;AAET,gDAAgD;AAChD,KAAK,cAAc,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAE7D;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,qBAAqB,GAAG,qBAAqB,IAAI;IACtF,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB,GAAG,qBAAqB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;AAE5C;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,sBAAsB,GAEtB,qBAAqB,GACrB,4BAA4B,GAC5B,uBAAuB,GACvB,kBAAkB,GAClB,sBAAsB,GACtB,kBAAkB,GAClB,uBAAuB,GACvB,mBAAmB,GACnB,0BAA0B,GAC1B,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,CAAA;AAExB;;;GAGG;AACH,MAAM,MAAM,uBAAuB,CACjC,oBAAoB,SAAS,IAAI,GAAG,qBAAqB,GAAG,IAAI,IAC9D,CAAC,oBAAoB,CAAC,SAAS,IAAI,GACnC,gBAAgB,CAAC,gBAAgB,CAAC,GAClC,gBAAgB,CAAC,gBAAgB,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"nodeTypes.js","names":[],"sources":["../src/nodeTypes.ts"],"sourcesContent":["import type {\n SerializedLineBreakNode as _SerializedLineBreakNode,\n SerializedTabNode as _SerializedTabNode,\n SerializedTextNode as _SerializedTextNode,\n SerializedEditorState,\n SerializedElementNode,\n SerializedLexicalNode,\n Spread,\n} from 'lexical'\n\nimport type { SerializedQuoteNode } from './features/blockquote/server/index.js'\nimport type { SerializedBlockNode } from './features/blocks/server/nodes/BlocksNode.js'\nimport type { SerializedInlineBlockNode } from './features/blocks/server/nodes/InlineBlocksNode.js'\nimport type {\n SerializedTableCellNode,\n SerializedTableNode,\n SerializedTableRowNode,\n} from './features/experimental_table/server/index.js'\nimport type { SerializedHeadingNode } from './features/heading/server/index.js'\nimport type { SerializedHorizontalRuleNode } from './features/horizontalRule/server/nodes/HorizontalRuleNode.js'\nimport type { SerializedAutoLinkNode, SerializedLinkNode } from './features/link/nodes/types.js'\nimport type { SerializedListItemNode, SerializedListNode } from './features/lists/plugin/index.js'\nimport type { SerializedRelationshipNode } from './features/relationship/server/nodes/RelationshipNode.js'\nimport type { SerializedUploadNode } from './features/upload/server/nodes/UploadNode.js'\n\nexport type {\n SerializedAutoLinkNode,\n SerializedBlockNode,\n SerializedHeadingNode,\n SerializedHorizontalRuleNode,\n SerializedInlineBlockNode,\n SerializedLinkNode,\n SerializedListItemNode,\n SerializedListNode,\n SerializedQuoteNode,\n SerializedRelationshipNode,\n SerializedTableCellNode,\n SerializedTableNode,\n SerializedTableRowNode,\n SerializedUploadNode,\n}\n\nexport type SerializedParagraphNode<T extends SerializedLexicalNode = SerializedLexicalNode> =\n Spread<\n {\n textFormat: number\n type: 'paragraph'\n },\n SerializedElementNode<T>\n >\nexport type SerializedTextNode = Spread<\n {\n children?: never // required so that our typed editor state doesn't automatically add children\n type: 'text'\n },\n _SerializedTextNode\n>\n\nexport type SerializedTabNode = Spread<\n {\n children?: never // required so that our typed editor state doesn't automatically add children\n type: 'tab'\n },\n _SerializedTabNode\n>\n\nexport type SerializedLineBreakNode = Spread<\n {\n children?: never // required so that our typed editor state doesn't automatically add children\n type: 'linebreak'\n },\n _SerializedLineBreakNode\n>\n\ntype RecursiveNodes<T extends SerializedLexicalNode, Depth extends number = 4> = Depth extends 0\n ? T\n : { children?: RecursiveNodes<T, DecrementDepth<Depth>>[] } & T\n\ntype DecrementDepth<N extends number> = [0, 0, 1, 2, 3, 4][N]\n\n/**\n * Alternative type to `SerializedEditorState` that automatically types your nodes\n * more strictly, narrowing down nodes based on the `type` without having to manually\n * type-cast.\n */\nexport type TypedEditorState<T extends SerializedLexicalNode = SerializedLexicalNode> =\n SerializedEditorState<RecursiveNodes<T>>\n\n/**\n * All node types included by default in a lexical editor without configuration.\n */\nexport type DefaultNodeTypes =\n | SerializedAutoLinkNode\n //| SerializedBlockNode // Not included by default\n | SerializedHeadingNode\n | SerializedHorizontalRuleNode\n | SerializedLineBreakNode\n | SerializedLinkNode\n | SerializedListItemNode\n | SerializedListNode\n | SerializedParagraphNode\n | SerializedQuoteNode\n | SerializedRelationshipNode\n | SerializedTabNode\n | SerializedTextNode\n | SerializedUploadNode\n\n/**\n * Like `TypedEditorState` but includes all default node types.\n * You can pass *additional* node types as a generic parameter.\n */\nexport type DefaultTypedEditorState<\n TAdditionalNodeTypes extends null | SerializedLexicalNode = null,\n> = [TAdditionalNodeTypes] extends null\n ? TypedEditorState<DefaultNodeTypes>\n : TypedEditorState<DefaultNodeTypes | NonNullable<TAdditionalNodeTypes>>\n"],"mappings":"AA2GA;;;GAIA","ignoreList":[]}
1
+ {"version":3,"file":"nodeTypes.js","names":[],"sources":["../src/nodeTypes.ts"],"sourcesContent":["import type {\n SerializedLineBreakNode as _SerializedLineBreakNode,\n SerializedTabNode as _SerializedTabNode,\n SerializedTextNode as _SerializedTextNode,\n SerializedEditorState,\n SerializedElementNode,\n SerializedLexicalNode,\n} from 'lexical'\n\nimport type { SerializedQuoteNode } from './features/blockquote/server/index.js'\nimport type { SerializedBlockNode } from './features/blocks/server/nodes/BlocksNode.js'\nimport type { SerializedInlineBlockNode } from './features/blocks/server/nodes/InlineBlocksNode.js'\nimport type {\n SerializedTableCellNode,\n SerializedTableNode,\n SerializedTableRowNode,\n} from './features/experimental_table/server/index.js'\nimport type { SerializedHeadingNode } from './features/heading/server/index.js'\nimport type { SerializedHorizontalRuleNode } from './features/horizontalRule/server/nodes/HorizontalRuleNode.js'\nimport type { SerializedAutoLinkNode, SerializedLinkNode } from './features/link/nodes/types.js'\nimport type { SerializedListItemNode, SerializedListNode } from './features/lists/plugin/index.js'\nimport type { SerializedRelationshipNode } from './features/relationship/server/nodes/RelationshipNode.js'\nimport type { SerializedUploadNode } from './features/upload/server/nodes/UploadNode.js'\n\n/**\n * Helper type to create strongly typed serialized nodes with flexible children types.\n * Omits 'children' and 'type' from the base node type and redeclares them with proper typing.\n *\n * @param TBase - The base Lexical node type (e.g., _SerializedHeadingNode)\n * @param TType - The node type string (e.g., 'heading')\n * @param TChildren - The type for children (defaults to SerializedLexicalNode)\n */\nexport type StronglyTypedNode<\n TBase,\n TType extends string,\n TChildren extends SerializedLexicalNode = SerializedLexicalNode,\n> = {\n children: TChildren[]\n type: TType\n} & Omit<TBase, 'children' | 'type'>\n\n/**\n * Helper type to create strongly typed leaf nodes (nodes without children).\n * Omits 'children' and 'type' from the base node type and redeclares 'type' with a literal.\n *\n * @param TBase - The base Lexical node type (e.g., _SerializedTextNode)\n * @param TType - The node type string (e.g., 'text')\n */\nexport type StronglyTypedLeafNode<TBase, TType extends string> = {\n type: TType\n} & Omit<TBase, 'children' | 'type'>\n\nexport type {\n SerializedAutoLinkNode,\n SerializedBlockNode,\n SerializedHeadingNode,\n SerializedHorizontalRuleNode,\n SerializedInlineBlockNode,\n SerializedLinkNode,\n SerializedListItemNode,\n SerializedListNode,\n SerializedQuoteNode,\n SerializedRelationshipNode,\n SerializedTableCellNode,\n SerializedTableNode,\n SerializedTableRowNode,\n SerializedUploadNode,\n}\n\nexport type SerializedParagraphNode<T extends SerializedLexicalNode = SerializedLexicalNode> = {\n textFormat: number\n} & StronglyTypedNode<SerializedElementNode, 'paragraph', T>\n\nexport type SerializedTextNode = StronglyTypedLeafNode<_SerializedTextNode, 'text'>\n\nexport type SerializedTabNode = StronglyTypedLeafNode<_SerializedTabNode, 'tab'>\n\nexport type SerializedLineBreakNode = StronglyTypedLeafNode<_SerializedLineBreakNode, 'linebreak'>\n\n/**\n * Recursively adds typed children to nodes up to a specified depth.\n *\n * Key behaviors:\n * - `T extends any`: Distributive - processes each union member individually\n * - `OriginalUnion`: Preserves full union so nested children accept all node types, not just parent's type. If we just used `T`, the type would be narrowed to the parent's type and the children would only consist of the parent's type.\n * - `'children' extends keyof T`: Only adds children to container nodes; respects leaf nodes that use `Omit<_, 'children'>`\n * - `Depth`: Limits recursion to prevent infinite types (default: 4 levels)\n *\n * @internal - this type may change or be removed in a minor release\n */\nexport type RecursiveNodes<\n T extends SerializedLexicalNode,\n Depth extends number = 4,\n OriginalUnion extends SerializedLexicalNode = T,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n> = T extends any // Make distributive over unions\n ? Depth extends 0\n ? T\n : 'children' extends keyof T\n ? { children?: RecursiveNodes<OriginalUnion, DecrementDepth<Depth>, OriginalUnion>[] } & T\n : T // Skip leaf nodes\n : never\n\n/** Decrements depth: 4→3, 3→2, 2→1, 1→0, 0→0 */\ntype DecrementDepth<N extends number> = [0, 0, 1, 2, 3, 4][N]\n\n/**\n * Alternative type to `SerializedEditorState` that automatically types your nodes\n * more strictly, narrowing down nodes based on the `type` without having to manually\n * type-cast.\n */\nexport type TypedEditorState<T extends SerializedLexicalNode = SerializedLexicalNode> = {\n [k: string]: unknown\n} & SerializedEditorState<RecursiveNodes<T>>\n\n/**\n * All node types included by default in a lexical editor without configuration.\n */\nexport type DefaultNodeTypes =\n | SerializedAutoLinkNode\n //| SerializedBlockNode // Not included by default\n | SerializedHeadingNode\n | SerializedHorizontalRuleNode\n | SerializedLineBreakNode\n | SerializedLinkNode\n | SerializedListItemNode\n | SerializedListNode\n | SerializedParagraphNode\n | SerializedQuoteNode\n | SerializedRelationshipNode\n | SerializedTabNode\n | SerializedTextNode\n | SerializedUploadNode\n\n/**\n * Like `TypedEditorState` but includes all default node types.\n * You can pass *additional* node types as a generic parameter.\n */\nexport type DefaultTypedEditorState<\n TAdditionalNodeTypes extends null | SerializedLexicalNode = null,\n> = [TAdditionalNodeTypes] extends null\n ? TypedEditorState<DefaultNodeTypes>\n : TypedEditorState<DefaultNodeTypes | NonNullable<TAdditionalNodeTypes>>\n"],"mappings":"AAsIA;;;GAIA","ignoreList":[]}
@@ -1,11 +1,52 @@
1
1
  import type { SerializedLexicalNode } from 'lexical';
2
- import type { DefaultTypedEditorState, TypedEditorState } from '../nodeTypes.js';
3
- export declare function buildEditorState(args: {
4
- nodes?: DefaultTypedEditorState['root']['children'];
5
- text?: string;
6
- }): DefaultTypedEditorState;
7
- export declare function buildEditorState<T extends SerializedLexicalNode>(args: {
2
+ import type { DefaultNodeTypes, TypedEditorState } from '../nodeTypes.js';
3
+ /**
4
+ * Helper to build lexical editor state JSON from text and/or nodes.
5
+ *
6
+ * @param nodes - The nodes to include in the editor state. If you pass the `text` argument, this will append your nodes after the first paragraph node.
7
+ * @param text - The text content to include in the editor state. This will create a paragraph node with a text node for you and set that as the first node.
8
+ * @returns The constructed editor state JSON.
9
+ *
10
+ * @example
11
+ *
12
+ * just passing text:
13
+ *
14
+ * ```ts
15
+ * const editorState = buildEditorState<DefaultNodeTypes>({ text: 'Hello world' }) // result typed as DefaultTypedEditorState
16
+ * ```
17
+ *
18
+ * @example
19
+ *
20
+ * passing nodes:
21
+ *
22
+ * ```ts
23
+ * const editorState = // result typed as TypedEditorState<DefaultNodeTypes | SerializedBlockNode> (or TypedEditorState<SerializedBlockNode>)
24
+ * buildEditorState<DefaultNodeTypes | SerializedBlockNode>({ // or just buildEditorState<SerializedBlockNode> if you *only* want to allow block nodes
25
+ * nodes: [
26
+ * {
27
+ * type: 'block',
28
+ * fields: {
29
+ * id: 'id',
30
+ * blockName: 'Cool block',
31
+ * blockType: 'myBlock',
32
+ * },
33
+ * format: 'left',
34
+ * version: 1,
35
+ * }
36
+ * ],
37
+ * })
38
+ * ```
39
+ */
40
+ export declare function buildEditorState<T extends SerializedLexicalNode>({ nodes, text, }: {
8
41
  nodes?: TypedEditorState<T>['root']['children'];
9
42
  text?: string;
10
43
  }): TypedEditorState<T>;
44
+ /**
45
+ *
46
+ * Alias for `buildEditorState<DefaultNodeTypes>`
47
+ *
48
+ * @experimental this API may change or be removed in a minor release
49
+ * @internal
50
+ */
51
+ export declare const buildDefaultEditorState: typeof buildEditorState<DefaultNodeTypes>;
11
52
  //# sourceMappingURL=buildEditorState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildEditorState.d.ts","sourceRoot":"","sources":["../../src/utilities/buildEditorState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEhF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,KAAK,CAAC,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAA;IACnD,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,GAAG,uBAAuB,CAAA;AAE3B,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,qBAAqB,EAAE,IAAI,EAAE;IAEtE,KAAK,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAA;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"buildEditorState.d.ts","sourceRoot":"","sources":["../../src/utilities/buildEditorState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAA2B,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAElG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,qBAAqB,EAAE,EAChE,KAAK,EACL,IAAI,GACL,EAAE;IACD,KAAK,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAA;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAyCtB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,EAAE,OAAO,gBAAgB,CAAC,gBAAgB,CAC1C,CAAA"}
@@ -10,7 +10,7 @@
10
10
  * just passing text:
11
11
  *
12
12
  * ```ts
13
- * const editorState = buildEditorState({ text: 'Hello world' }) // result typed as DefaultTypedEditorState
13
+ * const editorState = buildEditorState<DefaultNodeTypes>({ text: 'Hello world' }) // result typed as DefaultTypedEditorState
14
14
  * ```
15
15
  *
16
16
  * @example
@@ -69,8 +69,17 @@
69
69
  });
70
70
  }
71
71
  if (nodes?.length) {
72
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
72
73
  editorJSON.root.children.push(...nodes);
73
74
  }
74
75
  return editorJSON;
75
76
  }
77
+ /**
78
+ *
79
+ * Alias for `buildEditorState<DefaultNodeTypes>`
80
+ *
81
+ * @experimental this API may change or be removed in a minor release
82
+ * @internal
83
+ */
84
+ export const buildDefaultEditorState = buildEditorState;
76
85
  //# sourceMappingURL=buildEditorState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildEditorState.js","names":["buildEditorState","nodes","text","editorJSON","root","type","children","direction","format","indent","version","push","detail","mode","style","textFormat","textStyle","length"],"sources":["../../src/utilities/buildEditorState.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type { DefaultTypedEditorState, TypedEditorState } from '../nodeTypes.js'\n\nexport function buildEditorState(args: {\n nodes?: DefaultTypedEditorState['root']['children']\n text?: string\n}): DefaultTypedEditorState\n\nexport function buildEditorState<T extends SerializedLexicalNode>(args: {\n // If you pass children typed for a specific schema T, the return is TypedEditorState<T>\n nodes?: TypedEditorState<T>['root']['children']\n text?: string\n}): TypedEditorState<T>\n\n/**\n * Helper to build lexical editor state JSON from text and/or nodes.\n *\n * @param nodes - The nodes to include in the editor state. If you pass the `text` argument, this will append your nodes after the first paragraph node.\n * @param text - The text content to include in the editor state. This will create a paragraph node with a text node for you and set that as the first node.\n * @returns The constructed editor state JSON.\n *\n * @example\n *\n * just passing text:\n *\n * ```ts\n * const editorState = buildEditorState({ text: 'Hello world' }) // result typed as DefaultTypedEditorState\n * ```\n *\n * @example\n *\n * passing nodes:\n *\n * ```ts\n * const editorState = // result typed as TypedEditorState<DefaultNodeTypes | SerializedBlockNode> (or TypedEditorState<SerializedBlockNode>)\n * buildEditorState<DefaultNodeTypes | SerializedBlockNode>({ // or just buildEditorState<SerializedBlockNode> if you *only* want to allow block nodes\n * nodes: [\n * {\n * type: 'block',\n * fields: {\n * id: 'id',\n * blockName: 'Cool block',\n * blockType: 'myBlock',\n * },\n * format: 'left',\n * version: 1,\n * }\n * ],\n * })\n * ```\n */\nexport function buildEditorState<T extends SerializedLexicalNode>({\n nodes,\n text,\n}: {\n nodes?: DefaultTypedEditorState['root']['children'] | TypedEditorState<T>['root']['children']\n text?: string\n}): DefaultTypedEditorState | TypedEditorState<T> {\n const editorJSON: DefaultTypedEditorState = {\n root: {\n type: 'root',\n children: [],\n direction: 'ltr',\n format: '',\n indent: 0,\n version: 1,\n },\n }\n\n if (text) {\n editorJSON.root.children.push({\n type: 'paragraph',\n children: [\n {\n type: 'text',\n detail: 0,\n format: 0,\n mode: 'normal',\n style: '',\n text,\n version: 1,\n },\n ],\n direction: 'ltr',\n format: '',\n indent: 0,\n textFormat: 0,\n textStyle: '',\n version: 1,\n })\n }\n\n if (nodes?.length) {\n editorJSON.root.children.push(...(nodes as any))\n }\n\n return editorJSON\n}\n"],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCA,OAAO,SAASA,iBAAkD;EAChEC,KAAK;EACLC;AAAI,CAIL;EACC,MAAMC,UAAA,GAAsC;IAC1CC,IAAA,EAAM;MACJC,IAAA,EAAM;MACNC,QAAA,EAAU,EAAE;MACZC,SAAA,EAAW;MACXC,MAAA,EAAQ;MACRC,MAAA,EAAQ;MACRC,OAAA,EAAS;IACX;EACF;EAEA,IAAIR,IAAA,EAAM;IACRC,UAAA,CAAWC,IAAI,CAACE,QAAQ,CAACK,IAAI,CAAC;MAC5BN,IAAA,EAAM;MACNC,QAAA,EAAU,CACR;QACED,IAAA,EAAM;QACNO,MAAA,EAAQ;QACRJ,MAAA,EAAQ;QACRK,IAAA,EAAM;QACNC,KAAA,EAAO;QACPZ,IAAA;QACAQ,OAAA,EAAS;MACX,EACD;MACDH,SAAA,EAAW;MACXC,MAAA,EAAQ;MACRC,MAAA,EAAQ;MACRM,UAAA,EAAY;MACZC,SAAA,EAAW;MACXN,OAAA,EAAS;IACX;EACF;EAEA,IAAIT,KAAA,EAAOgB,MAAA,EAAQ;IACjBd,UAAA,CAAWC,IAAI,CAACE,QAAQ,CAACK,IAAI,IAAKV,KAAA;EACpC;EAEA,OAAOE,UAAA;AACT","ignoreList":[]}
1
+ {"version":3,"file":"buildEditorState.js","names":["buildEditorState","nodes","text","editorJSON","root","type","children","direction","format","indent","version","push","detail","mode","style","textFormat","textStyle","length","buildDefaultEditorState"],"sources":["../../src/utilities/buildEditorState.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type { DefaultNodeTypes, DefaultTypedEditorState, TypedEditorState } from '../nodeTypes.js'\n\n/**\n * Helper to build lexical editor state JSON from text and/or nodes.\n *\n * @param nodes - The nodes to include in the editor state. If you pass the `text` argument, this will append your nodes after the first paragraph node.\n * @param text - The text content to include in the editor state. This will create a paragraph node with a text node for you and set that as the first node.\n * @returns The constructed editor state JSON.\n *\n * @example\n *\n * just passing text:\n *\n * ```ts\n * const editorState = buildEditorState<DefaultNodeTypes>({ text: 'Hello world' }) // result typed as DefaultTypedEditorState\n * ```\n *\n * @example\n *\n * passing nodes:\n *\n * ```ts\n * const editorState = // result typed as TypedEditorState<DefaultNodeTypes | SerializedBlockNode> (or TypedEditorState<SerializedBlockNode>)\n * buildEditorState<DefaultNodeTypes | SerializedBlockNode>({ // or just buildEditorState<SerializedBlockNode> if you *only* want to allow block nodes\n * nodes: [\n * {\n * type: 'block',\n * fields: {\n * id: 'id',\n * blockName: 'Cool block',\n * blockType: 'myBlock',\n * },\n * format: 'left',\n * version: 1,\n * }\n * ],\n * })\n * ```\n */\nexport function buildEditorState<T extends SerializedLexicalNode>({\n nodes,\n text,\n}: {\n nodes?: TypedEditorState<T>['root']['children']\n text?: string\n}): TypedEditorState<T> {\n const editorJSON: DefaultTypedEditorState = {\n root: {\n type: 'root',\n children: [],\n direction: 'ltr',\n format: '',\n indent: 0,\n version: 1,\n },\n }\n\n if (text) {\n editorJSON.root.children.push({\n type: 'paragraph',\n children: [\n {\n type: 'text',\n detail: 0,\n format: 0,\n mode: 'normal',\n style: '',\n text,\n version: 1,\n },\n ],\n direction: 'ltr',\n format: '',\n indent: 0,\n textFormat: 0,\n textStyle: '',\n version: 1,\n })\n }\n\n if (nodes?.length) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n editorJSON.root.children.push(...(nodes as any))\n }\n\n return editorJSON as TypedEditorState<T>\n}\n\n/**\n *\n * Alias for `buildEditorState<DefaultNodeTypes>`\n *\n * @experimental this API may change or be removed in a minor release\n * @internal\n */\nexport const buildDefaultEditorState: typeof buildEditorState<DefaultNodeTypes> =\n buildEditorState<DefaultNodeTypes>\n"],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCA,OAAO,SAASA,iBAAkD;EAChEC,KAAK;EACLC;AAAI,CAIL;EACC,MAAMC,UAAA,GAAsC;IAC1CC,IAAA,EAAM;MACJC,IAAA,EAAM;MACNC,QAAA,EAAU,EAAE;MACZC,SAAA,EAAW;MACXC,MAAA,EAAQ;MACRC,MAAA,EAAQ;MACRC,OAAA,EAAS;IACX;EACF;EAEA,IAAIR,IAAA,EAAM;IACRC,UAAA,CAAWC,IAAI,CAACE,QAAQ,CAACK,IAAI,CAAC;MAC5BN,IAAA,EAAM;MACNC,QAAA,EAAU,CACR;QACED,IAAA,EAAM;QACNO,MAAA,EAAQ;QACRJ,MAAA,EAAQ;QACRK,IAAA,EAAM;QACNC,KAAA,EAAO;QACPZ,IAAA;QACAQ,OAAA,EAAS;MACX,EACD;MACDH,SAAA,EAAW;MACXC,MAAA,EAAQ;MACRC,MAAA,EAAQ;MACRM,UAAA,EAAY;MACZC,SAAA,EAAW;MACXN,OAAA,EAAS;IACX;EACF;EAEA,IAAIT,KAAA,EAAOgB,MAAA,EAAQ;IACjB;IACAd,UAAA,CAAWC,IAAI,CAACE,QAAQ,CAACK,IAAI,IAAKV,KAAA;EACpC;EAEA,OAAOE,UAAA;AACT;AAEA;;;;;;;AAOA,OAAO,MAAMe,uBAAA,GACXlB,gBAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/richtext-lexical",
3
- "version": "3.60.0-canary.2",
3
+ "version": "3.60.0-internal.1fe1a87",
4
4
  "description": "The officially supported Lexical richtext adapter for Payload",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -373,8 +373,8 @@
373
373
  "react-error-boundary": "4.1.2",
374
374
  "ts-essentials": "10.0.3",
375
375
  "uuid": "10.0.0",
376
- "@payloadcms/ui": "3.60.0-canary.2",
377
- "@payloadcms/translations": "3.60.0-canary.2"
376
+ "@payloadcms/ui": "3.60.0-internal.1fe1a87",
377
+ "@payloadcms/translations": "3.60.0-internal.1fe1a87"
378
378
  },
379
379
  "devDependencies": {
380
380
  "@babel/cli": "7.27.2",
@@ -393,16 +393,16 @@
393
393
  "esbuild": "0.25.5",
394
394
  "esbuild-sass-plugin": "3.3.1",
395
395
  "swc-plugin-transform-remove-imports": "4.0.4",
396
- "payload": "3.60.0-canary.2",
397
- "@payloadcms/eslint-config": "3.28.0"
396
+ "@payloadcms/eslint-config": "3.28.0",
397
+ "payload": "3.60.0-internal.1fe1a87"
398
398
  },
399
399
  "peerDependencies": {
400
400
  "@faceless-ui/modal": "3.0.0",
401
401
  "@faceless-ui/scroll-info": "2.0.0",
402
402
  "react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
403
403
  "react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
404
- "@payloadcms/next": "3.60.0-canary.2",
405
- "payload": "3.60.0-canary.2"
404
+ "@payloadcms/next": "3.60.0-internal.1fe1a87",
405
+ "payload": "3.60.0-internal.1fe1a87"
406
406
  },
407
407
  "engines": {
408
408
  "node": "^18.20.2 || >=20.9.0"
@@ -1,2 +0,0 @@
1
- "use client";import{a,b}from"./chunk-XNERFY6G.js";import"./chunk-INBEEENE.js";import"./chunk-BZZVLW4U.js";export{b as InlineBlockComponent,a as useInlineBlockComponentContext};
2
- //# sourceMappingURL=componentInline-NGTRUSGB.js.map