@payloadcms/richtext-lexical 4.0.0-canary.38 → 4.0.0-canary.39

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 (107) hide show
  1. package/dist/exports/client/chunk-E6LSRRP2.js +2 -0
  2. package/dist/exports/client/{chunk-ATPSL6IX.js.map → chunk-E6LSRRP2.js.map} +3 -3
  3. package/dist/exports/client/chunk-ZQX5HXUL.js +2 -0
  4. package/dist/exports/client/{chunk-43E5QYAA.js.map → chunk-ZQX5HXUL.js.map} +3 -3
  5. package/dist/exports/client/{component-D5QLYS7W.js → component-6DQLENIE.js} +2 -2
  6. package/dist/exports/client/{componentInline-ZEP5JPTC.js → componentInline-HNE5G4TE.js} +2 -2
  7. package/dist/exports/client/index.js +28 -28
  8. package/dist/exports/client/index.js.map +4 -4
  9. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  10. package/dist/features/blocks/client/nodes/BlocksNode.js +0 -10
  11. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  12. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  13. package/dist/features/blocks/server/nodes/BlocksNode.js +1 -12
  14. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  15. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +2 -2
  16. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  17. package/dist/features/blocks/server/schema.d.ts +2 -0
  18. package/dist/features/blocks/server/schema.d.ts.map +1 -1
  19. package/dist/features/blocks/server/schema.js +7 -9
  20. package/dist/features/blocks/server/schema.js.map +1 -1
  21. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  22. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  23. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  24. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +0 -1
  25. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  26. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +11 -1
  27. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  28. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +17 -0
  29. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  30. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +2 -2
  31. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  32. package/dist/features/horizontalRule/server/schema.d.ts +1 -0
  33. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -1
  34. package/dist/features/horizontalRule/server/schema.js +6 -5
  35. package/dist/features/horizontalRule/server/schema.js.map +1 -1
  36. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  37. package/dist/features/link/nodes/AutoLinkNode.js +2 -10
  38. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  39. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  40. package/dist/features/link/nodes/LinkNode.js +2 -15
  41. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  42. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  43. package/dist/features/relationship/client/nodes/RelationshipNode.js +0 -3
  44. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  45. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  46. package/dist/features/relationship/server/nodes/RelationshipNode.js +1 -5
  47. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  48. package/dist/features/relationship/server/schema.d.ts +1 -0
  49. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  50. package/dist/features/relationship/server/schema.js +4 -2
  51. package/dist/features/relationship/server/schema.js.map +1 -1
  52. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  53. package/dist/features/toolbars/fixed/client/Toolbar/index.js +15 -0
  54. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  55. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  56. package/dist/features/toolbars/inline/client/Toolbar/index.js +15 -0
  57. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  58. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts +5 -0
  59. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts.map +1 -0
  60. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js +79 -0
  61. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js.map +1 -0
  62. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  63. package/dist/features/upload/client/nodes/UploadNode.js +0 -7
  64. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  65. package/dist/features/upload/server/index.d.ts +1 -1
  66. package/dist/features/upload/server/index.d.ts.map +1 -1
  67. package/dist/features/upload/server/index.js.map +1 -1
  68. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  69. package/dist/features/upload/server/nodes/UploadNode.js +1 -9
  70. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  71. package/dist/features/upload/server/schema.d.ts +2 -14
  72. package/dist/features/upload/server/schema.d.ts.map +1 -1
  73. package/dist/features/upload/server/schema.js +4 -2
  74. package/dist/features/upload/server/schema.js.map +1 -1
  75. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  76. package/dist/field/Diff/index.d.ts.map +1 -1
  77. package/dist/field/Diff/index.js +2 -2
  78. package/dist/field/Diff/index.js.map +1 -1
  79. package/dist/field/bundled.css +1 -1
  80. package/dist/field/rscEntry.d.ts +2 -2
  81. package/dist/field/rscEntry.d.ts.map +1 -1
  82. package/dist/field/rscEntry.js.map +1 -1
  83. package/dist/index.d.ts +3 -3
  84. package/dist/index.d.ts.map +1 -1
  85. package/dist/index.js.map +1 -1
  86. package/dist/types/builtInNodes.d.ts +1 -1
  87. package/dist/types/builtInNodes.d.ts.map +1 -1
  88. package/dist/types/builtInNodes.js +8 -3
  89. package/dist/types/builtInNodes.js.map +1 -1
  90. package/dist/types/index.d.ts +1 -4
  91. package/dist/types/index.d.ts.map +1 -1
  92. package/dist/types/index.js.map +1 -1
  93. package/dist/types/jsonSchemaHelpers.d.ts +5 -1
  94. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
  95. package/dist/types/jsonSchemaHelpers.js +7 -2
  96. package/dist/types/jsonSchemaHelpers.js.map +1 -1
  97. package/dist/types/nodeTypes.d.ts +5 -0
  98. package/dist/types/nodeTypes.d.ts.map +1 -1
  99. package/dist/types/nodeTypes.js.map +1 -1
  100. package/dist/utilities/generateImportMap.d.ts +2 -2
  101. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  102. package/dist/utilities/generateImportMap.js.map +1 -1
  103. package/package.json +5 -5
  104. package/dist/exports/client/chunk-43E5QYAA.js +0 -2
  105. package/dist/exports/client/chunk-ATPSL6IX.js +0 -2
  106. /package/dist/exports/client/{component-D5QLYS7W.js.map → component-6DQLENIE.js.map} +0 -0
  107. /package/dist/exports/client/{componentInline-ZEP5JPTC.js.map → componentInline-HNE5G4TE.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"jsonSchemaHelpers.js","names":["formatSchema","type","description","enum","tsType","directionSchema","oneOf","versionSchema","elementNodeSchema","nodeType","nodeUnionRef","properties","required","additionalProperties","const","children","items","direction","format","indent","version"],"sources":["../../src/types/jsonSchemaHelpers.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\n\n/** `format` property shared by every element node (Lexical `ElementFormatType`). */\nexport const formatSchema: JSONSchema4 = {\n type: 'string',\n description: 'How this element is aligned. Empty string means no explicit alignment.',\n enum: ['left', 'start', 'center', 'right', 'end', 'justify', ''],\n tsType: 'LexicalElementFormat',\n}\n\n/** `direction` property shared by every element node. */\nexport const directionSchema: JSONSchema4 = {\n oneOf: [{ type: 'string', enum: ['ltr', 'rtl'] }, { type: 'null' }],\n tsType: 'LexicalElementDirection',\n}\n\n/** `version` property shared by every Lexical node. */\nexport const versionSchema: JSONSchema4 = {\n type: 'integer',\n description: \"Lexical's internal serialization version for this node type.\",\n}\n\ntype ElementNodeSchemaOptions = {\n nodeType: string\n properties?: { [k: string]: JSONSchema4 }\n required?: string[]\n /** TS helper-type expression — emitted verbatim by json-schema-to-typescript. */\n tsType?: string\n}\n\n/**\n * Builds the JSON Schema for a Lexical element node - merges the shared\n * element-base shape (children/direction/format/indent/version) with the\n * node-specific bits a feature provides.\n */\nexport const elementNodeSchema = ({\n nodeType,\n nodeUnionRef,\n properties = {},\n required = [],\n tsType,\n}: { nodeUnionRef: JSONSchema4 } & ElementNodeSchemaOptions): JSONSchema4 => ({\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: nodeType },\n children: { type: 'array', items: nodeUnionRef },\n direction: directionSchema,\n format: formatSchema,\n indent: { type: 'integer' },\n version: versionSchema,\n ...properties,\n },\n required: ['children', 'direction', 'format', 'indent', 'type', 'version', ...required],\n ...(tsType ? { tsType } : {}),\n})\n\n/**\n * `elementNodeSchema` HOC type, so that features don't have to pass `nodeUnionRef` every time.\n */\nexport type ElementNodeSchemaFn = (opts: ElementNodeSchemaOptions) => JSONSchema4\n"],"mappings":"AAEA,oFACA,OAAO,MAAMA,YAAA,GAA4B;EACvCC,IAAA,EAAM;EACNC,WAAA,EAAa;EACbC,IAAA,EAAM,CAAC,QAAQ,SAAS,UAAU,SAAS,OAAO,WAAW,GAAG;EAChEC,MAAA,EAAQ;AACV;AAEA;AACA,OAAO,MAAMC,eAAA,GAA+B;EAC1CC,KAAA,EAAO,CAAC;IAAEL,IAAA,EAAM;IAAUE,IAAA,EAAM,CAAC,OAAO;EAAO,GAAG;IAAEF,IAAA,EAAM;EAAO,EAAE;EACnEG,MAAA,EAAQ;AACV;AAEA;AACA,OAAO,MAAMG,aAAA,GAA6B;EACxCN,IAAA,EAAM;EACNC,WAAA,EAAa;AACf;AAUA;;;;;AAKA,OAAO,MAAMM,iBAAA,GAAoBA,CAAC;EAChCC,QAAQ;EACRC,YAAY;EACZC,UAAA,GAAa,CAAC,CAAC;EACfC,QAAA,GAAW,EAAE;EACbR;AAAM,CACmD,MAAmB;EAC5EH,IAAA,EAAM;EACNY,oBAAA,EAAsB;EACtBF,UAAA,EAAY;IACVV,IAAA,EAAM;MAAEA,IAAA,EAAM;MAAUa,KAAA,EAAOL;IAAS;IACxCM,QAAA,EAAU;MAAEd,IAAA,EAAM;MAASe,KAAA,EAAON;IAAa;IAC/CO,SAAA,EAAWZ,eAAA;IACXa,MAAA,EAAQlB,YAAA;IACRmB,MAAA,EAAQ;MAAElB,IAAA,EAAM;IAAU;IAC1BmB,OAAA,EAASb,aAAA;IACT,GAAGI;EACL;EACAC,QAAA,EAAU,CAAC,YAAY,aAAa,UAAU,UAAU,QAAQ,W,GAAcA,QAAA,CAAS;EACvF,IAAIR,MAAA,GAAS;IAAEA;EAAO,IAAI,CAAC,CAAC;AAC9B","ignoreList":[]}
1
+ {"version":3,"file":"jsonSchemaHelpers.js","names":["formatSchema","type","description","enum","tsType","directionSchema","oneOf","versionSchema","deprecated","elementNodeSchema","nodeType","nodeUnionRef","properties","required","additionalProperties","const","children","items","direction","format","indent","version"],"sources":["../../src/types/jsonSchemaHelpers.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\n\n/** `format` property shared by every element node (Lexical `ElementFormatType`). */\nexport const formatSchema: JSONSchema4 = {\n type: 'string',\n description: 'How this element is aligned. Empty string means no explicit alignment.',\n enum: ['left', 'start', 'center', 'right', 'end', 'justify', ''],\n tsType: 'LexicalElementFormat',\n}\n\n/** `direction` property shared by every element node. */\nexport const directionSchema: JSONSchema4 = {\n oneOf: [{ type: 'string', enum: ['ltr', 'rtl'] }, { type: 'null' }],\n tsType: 'LexicalElementDirection',\n}\n\n/**\n * `version` property shared by every Lexical node. Lexical deprecated it and ignores it when it\n * loads a document. It stays optional so existing documents remain valid input, and `deprecated`\n * hides it from the schema shown to agents (see `sanitizeEntitySchema` in `payload`).\n */\nexport const versionSchema: JSONSchema4 = {\n type: 'integer',\n deprecated: true,\n description: \"Lexical's internal serialization version for this node type.\",\n}\n\ntype ElementNodeSchemaOptions = {\n nodeType: string\n properties?: { [k: string]: JSONSchema4 }\n required?: string[]\n /** TS helper-type expression — emitted verbatim by json-schema-to-typescript. */\n tsType?: string\n}\n\n/**\n * Builds the JSON Schema for a Lexical element node - merges the shared\n * element-base shape (children/direction/format/indent/version) with the\n * node-specific bits a feature provides.\n */\nexport const elementNodeSchema = ({\n nodeType,\n nodeUnionRef,\n properties = {},\n required = [],\n tsType,\n}: { nodeUnionRef: JSONSchema4 } & ElementNodeSchemaOptions): JSONSchema4 => ({\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: nodeType },\n children: { type: 'array', items: nodeUnionRef },\n direction: directionSchema,\n format: formatSchema,\n indent: { type: 'integer' },\n version: versionSchema,\n ...properties,\n },\n required: ['children', 'direction', 'format', 'indent', 'type', ...required],\n ...(tsType ? { tsType } : {}),\n})\n\n/**\n * `elementNodeSchema` HOC type, so that features don't have to pass `nodeUnionRef` every time.\n */\nexport type ElementNodeSchemaFn = (opts: ElementNodeSchemaOptions) => JSONSchema4\n"],"mappings":"AAEA,oFACA,OAAO,MAAMA,YAAA,GAA4B;EACvCC,IAAA,EAAM;EACNC,WAAA,EAAa;EACbC,IAAA,EAAM,CAAC,QAAQ,SAAS,UAAU,SAAS,OAAO,WAAW,GAAG;EAChEC,MAAA,EAAQ;AACV;AAEA;AACA,OAAO,MAAMC,eAAA,GAA+B;EAC1CC,KAAA,EAAO,CAAC;IAAEL,IAAA,EAAM;IAAUE,IAAA,EAAM,CAAC,OAAO;EAAO,GAAG;IAAEF,IAAA,EAAM;EAAO,EAAE;EACnEG,MAAA,EAAQ;AACV;AAEA;;;;;AAKA,OAAO,MAAMG,aAAA,GAA6B;EACxCN,IAAA,EAAM;EACNO,UAAA,EAAY;EACZN,WAAA,EAAa;AACf;AAUA;;;;;AAKA,OAAO,MAAMO,iBAAA,GAAoBA,CAAC;EAChCC,QAAQ;EACRC,YAAY;EACZC,UAAA,GAAa,CAAC,CAAC;EACfC,QAAA,GAAW,EAAE;EACbT;AAAM,CACmD,MAAmB;EAC5EH,IAAA,EAAM;EACNa,oBAAA,EAAsB;EACtBF,UAAA,EAAY;IACVX,IAAA,EAAM;MAAEA,IAAA,EAAM;MAAUc,KAAA,EAAOL;IAAS;IACxCM,QAAA,EAAU;MAAEf,IAAA,EAAM;MAASgB,KAAA,EAAON;IAAa;IAC/CO,SAAA,EAAWb,eAAA;IACXc,MAAA,EAAQnB,YAAA;IACRoB,MAAA,EAAQ;MAAEnB,IAAA,EAAM;IAAU;IAC1BoB,OAAA,EAASd,aAAA;IACT,GAAGK;EACL;EACAC,QAAA,EAAU,CAAC,YAAY,aAAa,UAAU,UAAU,Q,GAAWA,QAAA,CAAS;EAC5E,IAAIT,MAAA,GAAS;IAAEA;EAAO,IAAI,CAAC,CAAC;AAC9B","ignoreList":[]}
@@ -18,6 +18,7 @@ export interface SerializedLexicalElementBase<TChildren> {
18
18
  indent: number;
19
19
  textFormat?: number;
20
20
  textStyle?: string;
21
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
21
22
  version: number;
22
23
  }
23
24
  export type LexicalTextMode = 'normal' | 'segmented' | 'token';
@@ -28,6 +29,7 @@ export interface SerializedTextNode {
28
29
  style: string;
29
30
  text: string;
30
31
  type: 'text';
32
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
31
33
  version: number;
32
34
  }
33
35
  export interface SerializedTabNode {
@@ -37,10 +39,12 @@ export interface SerializedTabNode {
37
39
  style: string;
38
40
  text: string;
39
41
  type: 'tab';
42
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
40
43
  version: number;
41
44
  }
42
45
  export interface SerializedLineBreakNode {
43
46
  type: 'linebreak';
47
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
44
48
  version: number;
45
49
  }
46
50
  export interface SerializedParagraphNode<TChildren extends SerializedLexicalNode = SerializedLexicalNode> extends SerializedLexicalElementBase<TChildren> {
@@ -56,6 +60,7 @@ export interface LexicalRichText<TNode> {
56
60
  format: LexicalElementFormat;
57
61
  indent: number;
58
62
  type: 'root';
63
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
59
64
  version: number;
60
65
  };
61
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nodeTypes.d.ts","sourceRoot":"","sources":["../../src/types/nodeTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAClF,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,qCAAqC,CAAA;AAC5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AACjF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAA;AAC/F,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACnG,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AACpG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAA;AAC3F,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAM/E,uEAAuE;AACvE,MAAM,MAAM,oBAAoB,GAAG,EAAE,GAAG,QAAQ,GAAG,KAAK,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version":3,"file":"nodeTypes.js","names":[],"sources":["../../src/types/nodeTypes.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type { SerializedQuoteNode } from '../features/blockquote/server/schema.js'\nimport type {\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../features/blocks/server/schema.js'\nimport type { SerializedHeadingNode } from '../features/heading/server/schema.js'\nimport type { SerializedHorizontalRuleNode } from '../features/horizontalRule/server/schema.js'\nimport type { SerializedAutoLinkNode, SerializedLinkNode } from '../features/link/server/schema.js'\nimport type { SerializedListItemNode, SerializedListNode } from '../features/lists/shared/schema.js'\nimport type { SerializedRelationshipNode } from '../features/relationship/server/schema.js'\nimport type {\n SerializedTableCellNode,\n SerializedTableNode,\n SerializedTableRowNode,\n} from '../features/table/server/schema.js'\nimport type { SerializedUploadNode } from '../features/upload/server/schema.js'\n\n// The declarations below must stay byte-for-byte aligned with the TS source\n// strings Payload appends to `payload-types.ts` — twins live in\n// `types/builtInNodes.ts` and per-feature `schema.ts`.\n\n/** @internal Core Lexical types — see @payloadcms/richtext-lexical. */\nexport type LexicalElementFormat = '' | 'center' | 'end' | 'justify' | 'left' | 'right' | 'start'\nexport type LexicalElementDirection = ('ltr' | 'rtl') | null\n\nexport interface SerializedLexicalElementBase<TChildren> {\n children: TChildren[]\n direction: LexicalElementDirection\n format: LexicalElementFormat\n indent: number\n textFormat?: number\n textStyle?: string\n version: number\n}\n\nexport type LexicalTextMode = 'normal' | 'segmented' | 'token'\n\nexport interface SerializedTextNode {\n detail: number\n format: number\n mode: LexicalTextMode\n style: string\n text: string\n type: 'text'\n version: number\n}\n\nexport interface SerializedTabNode {\n detail: number\n format: number\n mode: LexicalTextMode\n style: string\n text: string\n type: 'tab'\n version: number\n}\n\nexport interface SerializedLineBreakNode {\n type: 'linebreak'\n version: number\n}\n\nexport interface SerializedParagraphNode<\n TChildren extends SerializedLexicalNode = SerializedLexicalNode,\n> extends SerializedLexicalElementBase<TChildren> {\n textFormat: number\n textStyle: string\n type: 'paragraph'\n}\n\n/** Shape of a Lexical `richText` field. */\nexport interface LexicalRichText<TNode> {\n root: {\n children: TNode[]\n direction: LexicalElementDirection\n format: LexicalElementFormat\n indent: number\n type: 'root'\n version: number\n }\n}\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\n/** `SerializedEditorState` with nodes narrowed by `type`. No type-casting needed. */\nexport type TypedEditorState<TNode extends SerializedLexicalNode = SerializedLexicalNode> =\n LexicalRichText<TNode>\n\n/**\n * The node union of a generated `richText` field. Pass the field type — e.g.\n * `RichTextNodes<Post['richText']>` — to type an individual node you build for that editor (for\n * example a single block, or a `.map()` of nodes). To build a whole editor state, prefer passing\n * the field type straight to {@link buildEditorState}.\n */\nexport type RichTextNodes<TRichText> =\n NonNullable<TRichText> extends LexicalRichText<infer TNode> ? TNode : never\n\n/**\n * All node types included by default in a lexical editor. Self-recursive —\n * each element node's `children` is `DefaultNodeTypes` again, no depth limit.\n * To compose your own union including the defaults, see {@link WithDefaultNodes}.\n */\nexport type DefaultNodeTypes =\n | SerializedAutoLinkNode<DefaultNodeTypes>\n //| SerializedBlockNode // Not included by default\n | SerializedHeadingNode<DefaultNodeTypes>\n | SerializedHorizontalRuleNode\n | SerializedLineBreakNode\n | SerializedLinkNode<DefaultNodeTypes>\n | SerializedListItemNode<DefaultNodeTypes>\n | SerializedListNode<DefaultNodeTypes>\n | SerializedParagraphNode<DefaultNodeTypes>\n | SerializedQuoteNode<DefaultNodeTypes>\n | SerializedRelationshipNode\n | SerializedTabNode\n | SerializedTextNode\n | SerializedUploadNode\n\n/**\n * The built-in lexical nodes, plus your own - with your nodes threaded into every container's\n * `children`, not just the top level. Pass your custom node(s) as the generic:\n *\n * ```ts\n * type MyNodes = WithDefaultNodes<SerializedBlockNode<MyBlockData>>\n * ```\n *\n * Built by flattening {@link DefaultNodeRegistry} (`Registry[keyof Registry]`); see that interface\n * for why the node set lives in a registry instead of being written as a plain union type.\n */\nexport type WithDefaultNodes<TCustom extends SerializedLexicalNode = never> =\n DefaultNodeRegistry<TCustom>[keyof DefaultNodeRegistry<TCustom>]\n\n/** @internal Re-types an element node's `children` to the recursive node union. */\ntype WithRecursiveChildren<TNode, TCustom extends SerializedLexicalNode> = {\n children: WithDefaultNodes<TCustom>[]\n} & Omit<TNode, 'children'>\n\n/**\n * @internal The set of default nodes, generic over the user's custom node(s). {@link WithDefaultNodes}\n * flattens it into the node union with `Registry[keyof Registry]`.\n *\n * Why a registry interface instead of writing the union directly? The union has to be self-referential:\n * every element node's `children` is the same node union (so custom nodes nest inside containers too).\n * A generic *type alias* can't reference itself that way - `type N<T> = SerializedParagraphNode<N<T>> | ...`\n * is a `TS2456` circular reference, because instantiating a type alias resolves its type argument\n * eagerly. An *interface* resolves its members lazily, so the self-reference inside `children: ...[]`\n * is allowed - the recursion is legal precisely because it lives inside this interface. Reusing the\n * real node interfaces (re-typing only `children`) keeps each entry in sync with its node's real shape.\n */\ninterface DefaultNodeRegistry<TCustom extends SerializedLexicalNode> {\n autolink: WithRecursiveChildren<SerializedAutoLinkNode<SerializedLexicalNode>, TCustom>\n custom: TCustom\n heading: WithRecursiveChildren<SerializedHeadingNode<SerializedLexicalNode>, TCustom>\n horizontalrule: SerializedHorizontalRuleNode\n linebreak: SerializedLineBreakNode\n link: WithRecursiveChildren<SerializedLinkNode<SerializedLexicalNode>, TCustom>\n list: WithRecursiveChildren<SerializedListNode<SerializedLexicalNode>, TCustom>\n listitem: WithRecursiveChildren<SerializedListItemNode<SerializedLexicalNode>, TCustom>\n paragraph: WithRecursiveChildren<SerializedParagraphNode<SerializedLexicalNode>, TCustom>\n quote: WithRecursiveChildren<SerializedQuoteNode<SerializedLexicalNode>, TCustom>\n relationship: SerializedRelationshipNode\n tab: SerializedTabNode\n text: SerializedTextNode\n upload: SerializedUploadNode\n}\n\n/**\n * Like `TypedEditorState`, but pre-filled with every default node type. Pass extra node types as a\n * generic to add your own; they're threaded into every container's `children` (via\n * {@link WithDefaultNodes}), not just allowed at the top level.\n */\nexport type DefaultTypedEditorState<\n TAdditionalNodeTypes extends null | SerializedLexicalNode = null,\n> = TypedEditorState<WithDefaultNodes<NonNullable<TAdditionalNodeTypes>>>\n"],"mappings":"AAuLA;;;;GAKA","ignoreList":[]}
1
+ {"version":3,"file":"nodeTypes.js","names":[],"sources":["../../src/types/nodeTypes.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type { SerializedQuoteNode } from '../features/blockquote/server/schema.js'\nimport type {\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../features/blocks/server/schema.js'\nimport type { SerializedHeadingNode } from '../features/heading/server/schema.js'\nimport type { SerializedHorizontalRuleNode } from '../features/horizontalRule/server/schema.js'\nimport type { SerializedAutoLinkNode, SerializedLinkNode } from '../features/link/server/schema.js'\nimport type { SerializedListItemNode, SerializedListNode } from '../features/lists/shared/schema.js'\nimport type { SerializedRelationshipNode } from '../features/relationship/server/schema.js'\nimport type {\n SerializedTableCellNode,\n SerializedTableNode,\n SerializedTableRowNode,\n} from '../features/table/server/schema.js'\nimport type { SerializedUploadNode } from '../features/upload/server/schema.js'\n\n// The declarations below must stay byte-for-byte aligned with the TS source\n// strings Payload appends to `payload-types.ts` — twins live in\n// `types/builtInNodes.ts` and per-feature `schema.ts`.\n\n/** @internal Core Lexical types — see @payloadcms/richtext-lexical. */\nexport type LexicalElementFormat = '' | 'center' | 'end' | 'justify' | 'left' | 'right' | 'start'\nexport type LexicalElementDirection = ('ltr' | 'rtl') | null\n\nexport interface SerializedLexicalElementBase<TChildren> {\n children: TChildren[]\n direction: LexicalElementDirection\n format: LexicalElementFormat\n indent: number\n textFormat?: number\n textStyle?: string\n /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\n version: number\n}\n\nexport type LexicalTextMode = 'normal' | 'segmented' | 'token'\n\nexport interface SerializedTextNode {\n detail: number\n format: number\n mode: LexicalTextMode\n style: string\n text: string\n type: 'text'\n /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\n version: number\n}\n\nexport interface SerializedTabNode {\n detail: number\n format: number\n mode: LexicalTextMode\n style: string\n text: string\n type: 'tab'\n /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\n version: number\n}\n\nexport interface SerializedLineBreakNode {\n type: 'linebreak'\n /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\n version: number\n}\n\nexport interface SerializedParagraphNode<\n TChildren extends SerializedLexicalNode = SerializedLexicalNode,\n> extends SerializedLexicalElementBase<TChildren> {\n textFormat: number\n textStyle: string\n type: 'paragraph'\n}\n\n/** Shape of a Lexical `richText` field. */\nexport interface LexicalRichText<TNode> {\n root: {\n children: TNode[]\n direction: LexicalElementDirection\n format: LexicalElementFormat\n indent: number\n type: 'root'\n /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\n version: number\n }\n}\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\n/** `SerializedEditorState` with nodes narrowed by `type`. No type-casting needed. */\nexport type TypedEditorState<TNode extends SerializedLexicalNode = SerializedLexicalNode> =\n LexicalRichText<TNode>\n\n/**\n * The node union of a generated `richText` field. Pass the field type — e.g.\n * `RichTextNodes<Post['richText']>` — to type an individual node you build for that editor (for\n * example a single block, or a `.map()` of nodes). To build a whole editor state, prefer passing\n * the field type straight to {@link buildEditorState}.\n */\nexport type RichTextNodes<TRichText> =\n NonNullable<TRichText> extends LexicalRichText<infer TNode> ? TNode : never\n\n/**\n * All node types included by default in a lexical editor. Self-recursive —\n * each element node's `children` is `DefaultNodeTypes` again, no depth limit.\n * To compose your own union including the defaults, see {@link WithDefaultNodes}.\n */\nexport type DefaultNodeTypes =\n | SerializedAutoLinkNode<DefaultNodeTypes>\n //| SerializedBlockNode // Not included by default\n | SerializedHeadingNode<DefaultNodeTypes>\n | SerializedHorizontalRuleNode\n | SerializedLineBreakNode\n | SerializedLinkNode<DefaultNodeTypes>\n | SerializedListItemNode<DefaultNodeTypes>\n | SerializedListNode<DefaultNodeTypes>\n | SerializedParagraphNode<DefaultNodeTypes>\n | SerializedQuoteNode<DefaultNodeTypes>\n | SerializedRelationshipNode\n | SerializedTabNode\n | SerializedTextNode\n | SerializedUploadNode\n\n/**\n * The built-in lexical nodes, plus your own - with your nodes threaded into every container's\n * `children`, not just the top level. Pass your custom node(s) as the generic:\n *\n * ```ts\n * type MyNodes = WithDefaultNodes<SerializedBlockNode<MyBlockData>>\n * ```\n *\n * Built by flattening {@link DefaultNodeRegistry} (`Registry[keyof Registry]`); see that interface\n * for why the node set lives in a registry instead of being written as a plain union type.\n */\nexport type WithDefaultNodes<TCustom extends SerializedLexicalNode = never> =\n DefaultNodeRegistry<TCustom>[keyof DefaultNodeRegistry<TCustom>]\n\n/** @internal Re-types an element node's `children` to the recursive node union. */\ntype WithRecursiveChildren<TNode, TCustom extends SerializedLexicalNode> = {\n children: WithDefaultNodes<TCustom>[]\n} & Omit<TNode, 'children'>\n\n/**\n * @internal The set of default nodes, generic over the user's custom node(s). {@link WithDefaultNodes}\n * flattens it into the node union with `Registry[keyof Registry]`.\n *\n * Why a registry interface instead of writing the union directly? The union has to be self-referential:\n * every element node's `children` is the same node union (so custom nodes nest inside containers too).\n * A generic *type alias* can't reference itself that way - `type N<T> = SerializedParagraphNode<N<T>> | ...`\n * is a `TS2456` circular reference, because instantiating a type alias resolves its type argument\n * eagerly. An *interface* resolves its members lazily, so the self-reference inside `children: ...[]`\n * is allowed - the recursion is legal precisely because it lives inside this interface. Reusing the\n * real node interfaces (re-typing only `children`) keeps each entry in sync with its node's real shape.\n */\ninterface DefaultNodeRegistry<TCustom extends SerializedLexicalNode> {\n autolink: WithRecursiveChildren<SerializedAutoLinkNode<SerializedLexicalNode>, TCustom>\n custom: TCustom\n heading: WithRecursiveChildren<SerializedHeadingNode<SerializedLexicalNode>, TCustom>\n horizontalrule: SerializedHorizontalRuleNode\n linebreak: SerializedLineBreakNode\n link: WithRecursiveChildren<SerializedLinkNode<SerializedLexicalNode>, TCustom>\n list: WithRecursiveChildren<SerializedListNode<SerializedLexicalNode>, TCustom>\n listitem: WithRecursiveChildren<SerializedListItemNode<SerializedLexicalNode>, TCustom>\n paragraph: WithRecursiveChildren<SerializedParagraphNode<SerializedLexicalNode>, TCustom>\n quote: WithRecursiveChildren<SerializedQuoteNode<SerializedLexicalNode>, TCustom>\n relationship: SerializedRelationshipNode\n tab: SerializedTabNode\n text: SerializedTextNode\n upload: SerializedUploadNode\n}\n\n/**\n * Like `TypedEditorState`, but pre-filled with every default node type. Pass extra node types as a\n * generic to add your own; they're threaded into every container's `children` (via\n * {@link WithDefaultNodes}), not just allowed at the top level.\n */\nexport type DefaultTypedEditorState<\n TAdditionalNodeTypes extends null | SerializedLexicalNode = null,\n> = TypedEditorState<WithDefaultNodes<NonNullable<TAdditionalNodeTypes>>>\n"],"mappings":"AA4LA;;;;GAKA","ignoreList":[]}
@@ -1,8 +1,8 @@
1
1
  import type { RichTextAdapter } from 'payload';
2
2
  import type { ResolvedServerFeatureMap } from '../features/typesServer.js';
3
- import type { LexicalEditorProps } from '../types/index.js';
3
+ import type { LexicalEditorArgs } from '../types/index.js';
4
4
  export declare const getGenerateImportMap: (args: {
5
- lexicalEditorArgs?: LexicalEditorProps;
5
+ lexicalEditorArgs?: LexicalEditorArgs;
6
6
  resolvedFeatureMap: ResolvedServerFeatureMap;
7
7
  }) => RichTextAdapter['generateImportMap'];
8
8
  //# sourceMappingURL=generateImportMap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateImportMap.d.ts","sourceRoot":"","sources":["../../src/utilities/generateImportMap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,eAAO,MAAM,oBAAoB,SACxB;IACL,iBAAiB,CAAC,EAAE,kBAAkB,CAAA;IACtC,kBAAkB,EAAE,wBAAwB,CAAA;CAC7C,KAAG,eAAe,CAAC,mBAAmB,CAiDtC,CAAA"}
1
+ {"version":3,"file":"generateImportMap.d.ts","sourceRoot":"","sources":["../../src/utilities/generateImportMap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE1D,eAAO,MAAM,oBAAoB,SACxB;IACL,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC,kBAAkB,EAAE,wBAAwB,CAAA;CAC7C,KAAG,eAAe,CAAC,mBAAmB,CAiDtC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"generateImportMap.js","names":["genImportMapIterateFields","getGenerateImportMap","args","addToImportMap","baseDir","config","importMap","imports","lexicalEditorArgs","views","resolvedFeature","resolvedFeatureMap","values","componentImports","Array","isArray","Object","ClientFeature","nodes","length","node","getSubFields","subFields","fields"],"sources":["../../src/utilities/generateImportMap.tsx"],"sourcesContent":["import type { RichTextAdapter } from 'payload'\n\nimport { genImportMapIterateFields } from 'payload'\n\nimport type { ResolvedServerFeatureMap } from '../features/typesServer.js'\nimport type { LexicalEditorProps } from '../types/index.js'\n\nexport const getGenerateImportMap =\n (args: {\n lexicalEditorArgs?: LexicalEditorProps\n resolvedFeatureMap: ResolvedServerFeatureMap\n }): RichTextAdapter['generateImportMap'] =>\n ({ addToImportMap, baseDir, config, importMap, imports }) => {\n addToImportMap('@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell')\n addToImportMap('@payloadcms/richtext-lexical/rsc#RscEntryLexicalField')\n addToImportMap('@payloadcms/richtext-lexical/rsc#LexicalDiffComponent')\n\n addToImportMap(args.lexicalEditorArgs?.views)\n\n for (const resolvedFeature of args.resolvedFeatureMap.values()) {\n if ('componentImports' in resolvedFeature) {\n if (typeof resolvedFeature.componentImports === 'function') {\n resolvedFeature.componentImports({\n addToImportMap,\n baseDir,\n config,\n importMap,\n imports,\n })\n } else if (Array.isArray(resolvedFeature.componentImports)) {\n addToImportMap(resolvedFeature.componentImports)\n } else if (typeof resolvedFeature.componentImports === 'object') {\n addToImportMap(Object.values(resolvedFeature.componentImports))\n }\n }\n\n addToImportMap(resolvedFeature.ClientFeature)\n\n /*\n * Now run for all possible sub-fields\n */\n if (resolvedFeature.nodes?.length) {\n for (const node of resolvedFeature.nodes) {\n if (typeof node?.getSubFields !== 'function') {\n continue\n }\n const subFields = node.getSubFields({})\n if (subFields?.length) {\n genImportMapIterateFields({\n addToImportMap,\n baseDir,\n config,\n fields: subFields,\n importMap,\n imports,\n })\n }\n }\n }\n }\n }\n"],"mappings":"AAEA,SAASA,yBAAyB,QAAQ;AAK1C,OAAO,MAAMC,oBAAA,GACVC,IAAA,IAID,CAAC;EAAEC,cAAc;EAAEC,OAAO;EAAEC,MAAM;EAAEC,SAAS;EAAEC;AAAO,CAAE;EACtDJ,cAAA,CAAe;EACfA,cAAA,CAAe;EACfA,cAAA,CAAe;EAEfA,cAAA,CAAeD,IAAA,CAAKM,iBAAiB,EAAEC,KAAA;EAEvC,KAAK,MAAMC,eAAA,IAAmBR,IAAA,CAAKS,kBAAkB,CAACC,MAAM,IAAI;IAC9D,IAAI,sBAAsBF,eAAA,EAAiB;MACzC,IAAI,OAAOA,eAAA,CAAgBG,gBAAgB,KAAK,YAAY;QAC1DH,eAAA,CAAgBG,gBAAgB,CAAC;UAC/BV,cAAA;UACAC,OAAA;UACAC,MAAA;UACAC,SAAA;UACAC;QACF;MACF,OAAO,IAAIO,KAAA,CAAMC,OAAO,CAACL,eAAA,CAAgBG,gBAAgB,GAAG;QAC1DV,cAAA,CAAeO,eAAA,CAAgBG,gBAAgB;MACjD,OAAO,IAAI,OAAOH,eAAA,CAAgBG,gBAAgB,KAAK,UAAU;QAC/DV,cAAA,CAAea,MAAA,CAAOJ,MAAM,CAACF,eAAA,CAAgBG,gBAAgB;MAC/D;IACF;IAEAV,cAAA,CAAeO,eAAA,CAAgBO,aAAa;IAE5C;;;IAGA,IAAIP,eAAA,CAAgBQ,KAAK,EAAEC,MAAA,EAAQ;MACjC,KAAK,MAAMC,IAAA,IAAQV,eAAA,CAAgBQ,KAAK,EAAE;QACxC,IAAI,OAAOE,IAAA,EAAMC,YAAA,KAAiB,YAAY;UAC5C;QACF;QACA,MAAMC,SAAA,GAAYF,IAAA,CAAKC,YAAY,CAAC,CAAC;QACrC,IAAIC,SAAA,EAAWH,MAAA,EAAQ;UACrBnB,yBAAA,CAA0B;YACxBG,cAAA;YACAC,OAAA;YACAC,MAAA;YACAkB,MAAA,EAAQD,SAAA;YACRhB,SAAA;YACAC;UACF;QACF;MACF;IACF;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"generateImportMap.js","names":["genImportMapIterateFields","getGenerateImportMap","args","addToImportMap","baseDir","config","importMap","imports","lexicalEditorArgs","views","resolvedFeature","resolvedFeatureMap","values","componentImports","Array","isArray","Object","ClientFeature","nodes","length","node","getSubFields","subFields","fields"],"sources":["../../src/utilities/generateImportMap.tsx"],"sourcesContent":["import type { RichTextAdapter } from 'payload'\n\nimport { genImportMapIterateFields } from 'payload'\n\nimport type { ResolvedServerFeatureMap } from '../features/typesServer.js'\nimport type { LexicalEditorArgs } from '../types/index.js'\n\nexport const getGenerateImportMap =\n (args: {\n lexicalEditorArgs?: LexicalEditorArgs\n resolvedFeatureMap: ResolvedServerFeatureMap\n }): RichTextAdapter['generateImportMap'] =>\n ({ addToImportMap, baseDir, config, importMap, imports }) => {\n addToImportMap('@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell')\n addToImportMap('@payloadcms/richtext-lexical/rsc#RscEntryLexicalField')\n addToImportMap('@payloadcms/richtext-lexical/rsc#LexicalDiffComponent')\n\n addToImportMap(args.lexicalEditorArgs?.views)\n\n for (const resolvedFeature of args.resolvedFeatureMap.values()) {\n if ('componentImports' in resolvedFeature) {\n if (typeof resolvedFeature.componentImports === 'function') {\n resolvedFeature.componentImports({\n addToImportMap,\n baseDir,\n config,\n importMap,\n imports,\n })\n } else if (Array.isArray(resolvedFeature.componentImports)) {\n addToImportMap(resolvedFeature.componentImports)\n } else if (typeof resolvedFeature.componentImports === 'object') {\n addToImportMap(Object.values(resolvedFeature.componentImports))\n }\n }\n\n addToImportMap(resolvedFeature.ClientFeature)\n\n /*\n * Now run for all possible sub-fields\n */\n if (resolvedFeature.nodes?.length) {\n for (const node of resolvedFeature.nodes) {\n if (typeof node?.getSubFields !== 'function') {\n continue\n }\n const subFields = node.getSubFields({})\n if (subFields?.length) {\n genImportMapIterateFields({\n addToImportMap,\n baseDir,\n config,\n fields: subFields,\n importMap,\n imports,\n })\n }\n }\n }\n }\n }\n"],"mappings":"AAEA,SAASA,yBAAyB,QAAQ;AAK1C,OAAO,MAAMC,oBAAA,GACVC,IAAA,IAID,CAAC;EAAEC,cAAc;EAAEC,OAAO;EAAEC,MAAM;EAAEC,SAAS;EAAEC;AAAO,CAAE;EACtDJ,cAAA,CAAe;EACfA,cAAA,CAAe;EACfA,cAAA,CAAe;EAEfA,cAAA,CAAeD,IAAA,CAAKM,iBAAiB,EAAEC,KAAA;EAEvC,KAAK,MAAMC,eAAA,IAAmBR,IAAA,CAAKS,kBAAkB,CAACC,MAAM,IAAI;IAC9D,IAAI,sBAAsBF,eAAA,EAAiB;MACzC,IAAI,OAAOA,eAAA,CAAgBG,gBAAgB,KAAK,YAAY;QAC1DH,eAAA,CAAgBG,gBAAgB,CAAC;UAC/BV,cAAA;UACAC,OAAA;UACAC,MAAA;UACAC,SAAA;UACAC;QACF;MACF,OAAO,IAAIO,KAAA,CAAMC,OAAO,CAACL,eAAA,CAAgBG,gBAAgB,GAAG;QAC1DV,cAAA,CAAeO,eAAA,CAAgBG,gBAAgB;MACjD,OAAO,IAAI,OAAOH,eAAA,CAAgBG,gBAAgB,KAAK,UAAU;QAC/DV,cAAA,CAAea,MAAA,CAAOJ,MAAM,CAACF,eAAA,CAAgBG,gBAAgB;MAC/D;IACF;IAEAV,cAAA,CAAeO,eAAA,CAAgBO,aAAa;IAE5C;;;IAGA,IAAIP,eAAA,CAAgBQ,KAAK,EAAEC,MAAA,EAAQ;MACjC,KAAK,MAAMC,IAAA,IAAQV,eAAA,CAAgBQ,KAAK,EAAE;QACxC,IAAI,OAAOE,IAAA,EAAMC,YAAA,KAAiB,YAAY;UAC5C;QACF;QACA,MAAMC,SAAA,GAAYF,IAAA,CAAKC,YAAY,CAAC,CAAC;QACrC,IAAIC,SAAA,EAAWH,MAAA,EAAQ;UACrBnB,yBAAA,CAA0B;YACxBG,cAAA;YACAC,OAAA;YACAC,MAAA;YACAkB,MAAA,EAAQD,SAAA;YACRhB,SAAA;YACAC;UACF;QACF;MACF;IACF;EACF;AACF","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/richtext-lexical",
3
- "version": "4.0.0-canary.38",
3
+ "version": "4.0.0-canary.39",
4
4
  "description": "The officially supported Lexical richtext adapter for Payload",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -443,8 +443,8 @@
443
443
  "react-error-boundary": "6.1.1",
444
444
  "ts-essentials": "10.0.3",
445
445
  "uuid": "14.0.0",
446
- "@payloadcms/translations": "4.0.0-canary.38",
447
- "@payloadcms/ui": "4.0.0-canary.38"
446
+ "@payloadcms/ui": "4.0.0-canary.39",
447
+ "@payloadcms/translations": "4.0.0-canary.39"
448
448
  },
449
449
  "devDependencies": {
450
450
  "@babel/cli": "7.27.2",
@@ -464,14 +464,14 @@
464
464
  "esbuild-sass-plugin": "3.3.1",
465
465
  "swc-plugin-transform-remove-imports": "8.3.0",
466
466
  "@payloadcms/eslint-config": "3.28.0",
467
- "payload": "4.0.0-canary.38"
467
+ "payload": "4.0.0-canary.39"
468
468
  },
469
469
  "peerDependencies": {
470
470
  "@faceless-ui/modal": "3.0.2",
471
471
  "@faceless-ui/scroll-info": "2.0.0",
472
472
  "react": "^19.0.1 || ^19.1.2 || ^19.2.1",
473
473
  "react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
474
- "payload": "4.0.0-canary.38"
474
+ "payload": "4.0.0-canary.39"
475
475
  },
476
476
  "engines": {
477
477
  "node": ">=24.15.0"
@@ -1,2 +0,0 @@
1
- import{a as P,b as T}from"./chunk-5VIL27GI.js";import{b as I}from"./chunk-RJ5MAOKZ.js";import{c as rt}from"react/compiler-runtime";import{jsx as R}from"react/jsx-runtime";import{Drawer as nt,EditDepthProvider as ot,useModal as at}from"@payloadcms/ui";import"react";import{jsx as F,jsxs as G}from"react/jsx-runtime";import{useLexicalEditable as V}from"@lexical/react/useLexicalEditable";import{Form as q,RenderFields as Q,useDocumentForm as X,useDocumentInfo as Y,useServerFunctions as Z}from"@payloadcms/ui";import{abortAndIgnore as y}from"@payloadcms/ui/shared";import{deepCopyObjectSimpleWithoutReactComponents as j}from"payload/shared";import{useCallback as N,useEffect as M,useRef as z,useState as tt}from"react";import{v4 as et}from"uuid";var U=({data:r,featureKey:t,fieldMapOverride:e,handleDrawerSubmit:n,schemaFieldsPathOverride:o,schemaPath:D,schemaPathSuffix:f,submitRef:b})=>{let{id:i,collectionSlug:s,getDocPreferences:l,globalSlug:c}=Y(),{fields:u}=X(),a=V(),d=z(new AbortController),[g,m]=tt(!1),{fieldProps:{featureClientSchemaMap:x}}=I(),{getFormState:h}=Z(),p=o??`${D}.lexical_internal_feature.${t}${f?`.${f}`:""}`,v=e??x[t]?.[p];M(()=>{let S=new AbortController;return(async()=>{let{state:w}=await h({id:i,collectionSlug:s,data:r??{},docPermissions:{fields:!0},docPreferences:await l(),documentFormState:j(u,{excludeFiles:!0}),globalSlug:c,initialBlockData:r,operation:"update",readOnly:!a,renderAllFields:!0,schemaPath:p,signal:S.signal});m(w)})(),()=>{y(S)}},[p,i,r,h,s,a,c,l,u]);let E=N(async({formState:S})=>{y(d.current);let C=new AbortController;d.current=C;let{state:w}=await h({id:i,collectionSlug:s,docPermissions:{fields:!0},docPreferences:await l(),documentFormState:j(u,{excludeFiles:!0}),formState:S,globalSlug:c,initialBlockFormState:S,operation:"update",readOnly:!a,schemaPath:p,signal:C.signal});return w||S},[h,i,a,s,l,u,c,p]);return M(()=>()=>{y(d.current)},[]),g===!1?null:G(q,{beforeSubmit:[E],className:"fields-drawer",disableValidationOnSubmit:!0,fields:Array.isArray(v)?v:[],initialState:g,onChange:[E],onSubmit:n,uuid:et(),children:[F(Q,{fields:Array.isArray(v)?v:[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:p,permissions:!0,readOnly:!a}),F(T,{submitRef:b})]})};var Tt=r=>{let t=rt(17),{className:e,data:n,drawerSlug:o,drawerTitle:D,featureKey:f,fieldMapOverride:b,handleDrawerSubmit:i,schemaFieldsPathOverride:s,schemaPath:l,schemaPathSuffix:c}=r,{closeModal:u}=at(),{headerActions:a,submitRef:d}=P(),g=D??"",m;t[0]!==u||t[1]!==o||t[2]!==i?(m=(h,p)=>{u(o),setTimeout(()=>{i(h,p)},1)},t[0]=u,t[1]=o,t[2]=i,t[3]=m):m=t[3];let x;return t[4]!==e||t[5]!==n||t[6]!==o||t[7]!==f||t[8]!==b||t[9]!==a||t[10]!==s||t[11]!==l||t[12]!==c||t[13]!==d||t[14]!==g||t[15]!==m?(x=R(ot,{children:R(nt,{className:e,headerActions:a,slug:o,title:g,children:R(U,{data:n,featureKey:f,fieldMapOverride:b,handleDrawerSubmit:m,schemaFieldsPathOverride:s,schemaPath:l,schemaPathSuffix:c,submitRef:d})})}),t[4]=e,t[5]=n,t[6]=o,t[7]=f,t[8]=b,t[9]=a,t[10]=s,t[11]=l,t[12]=c,t[13]=d,t[14]=g,t[15]=m,t[16]=x):x=t[16],x};import{createCommand as it}from"lexical";var Mt=it("INSERT_UPLOAD_WITH_DRAWER_COMMAND");import{jsx as L}from"react/jsx-runtime";import B from"bson-objectid";import{$applyNodeReplacement as pt}from"lexical";import*as K from"react";import st from"bson-objectid";function A(r,t){if(r.hasAttribute("data-lexical-pending-upload-form-id")){let n=r.getAttribute("data-lexical-pending-upload-form-id");if(n!=null)return{node:t({data:{pending:{formID:n,src:r.getAttribute("src")||""}}})}}if(r.hasAttribute("data-lexical-upload-relation-to")&&r.hasAttribute("data-lexical-upload-id")){let n=r.getAttribute("data-lexical-upload-id"),o=r.getAttribute("data-lexical-upload-relation-to");if(n!=null&&o!=null)return{node:t({data:{fields:{},relationTo:o,value:n}})}}return{node:t({data:{pending:{formID:new st.default().toHexString(),src:r.getAttribute("src")||""}}})}}import{DecoratorBlockNode as lt}from"@lexical/react/LexicalDecoratorBlockNode.js";import{addClassNamesToElement as ct}from"@lexical/utils";import k from"bson-objectid";import{$applyNodeReplacement as ut}from"lexical";var _=class extends lt{__data;constructor({data:t,format:e,key:n}){super(e,n),this.__data=t}static clone(t){return new this({data:t.__data,format:t.__format,key:t.__key})}static getType(){return"upload"}static importDOM(){return{img:t=>({conversion:e=>A(e,$),priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new k.default().toHexString(),t.version=3);let e={id:t.id,fields:t.fields,pending:t.pending,relationTo:t.relationTo,value:t.value},n=$({data:e});return n.setFormat(t.format),n}static isInline(){return!1}createDOM(t){let e=document.createElement("div");return ct(e,t?.theme?.upload),e}decorate(){return null}exportDOM(){let t=document.createElement("img"),e=this.__data;return e.pending?(t.setAttribute("data-lexical-pending-upload-form-id",String(e?.pending?.formID)),t.setAttribute("src",e?.pending?.src||"")):(t.setAttribute("data-lexical-upload-id",String(e?.value)),t.setAttribute("data-lexical-upload-relation-to",e?.relationTo)),{element:t}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"upload",version:3}}getData(){return this.getLatest().__data}setData(t){let e=this.getWritable();e.__data=t}updateDOM(){return!1}};function $({data:r}){return r?.id||(r.id=new k.default().toHexString()),ut(new _({data:r}))}import{jsx as H}from"react/jsx-runtime";import{ShimmerEffect as mt}from"@payloadcms/ui";var J=()=>H("div",{className:"lexical-upload",children:H(mt,{height:"95px",width:"203px"})});var dt=K.lazy(()=>import("./component-D5QLYS7W.js").then(r=>({default:r.UploadComponent}))),O=class extends _{static clone(t){return super.clone(t)}static getType(){return super.getType()}static importDOM(){return{img:t=>({conversion:e=>A(e,W),priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new B.default().toHexString(),t.version=3);let e={id:t.id,fields:t.fields,pending:t.pending,relationTo:t.relationTo,value:t.value},n=W({data:e});return n.setFormat(t.format),n}decorate(t,e){return this.__data.pending?L(J,{}):L(dt,{className:e?.theme?.upload??"LexicalEditorTheme__upload",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function W({data:r}){return r?.id||(r.id=new B.default().toHexString()),pt(new O({data:r}))}function te(r){return r instanceof O}export{Tt as a,Mt as b,O as c,W as d,te as e};
2
- //# sourceMappingURL=chunk-43E5QYAA.js.map
@@ -1,2 +0,0 @@
1
- import{a as pe,b as be,c as he}from"./chunk-5VIL27GI.js";import{b as fe}from"./chunk-RJ5MAOKZ.js";import{jsx as c,jsxs as D}from"react/jsx-runtime";import{useLexicalComposerContext as Ye}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as Ze}from"@lexical/react/useLexicalEditable";import{getTranslation as Ce}from"@payloadcms/translations";import{Button as ge,Drawer as et,EditDepthProvider as tt,Form as ot,formatDrawerSlug as nt,RenderFields as rt,ShimmerEffect as st,useConfig as it,useDocumentForm as lt,useDocumentInfo as ct,useEditDepth as at,useServerFunctions as ut,useTranslation as dt}from"@payloadcms/ui";import{abortAndIgnore as X}from"@payloadcms/ui/shared";import{$getNodeByKey as q,SKIP_DOM_SELECTION_TAG as xe}from"lexical";import{deepCopyObjectSimpleWithoutReactComponents as j}from"payload/shared";import F,{createContext as mt,useCallback as G,useEffect as v,useMemo as g,useRef as x}from"react";import{v4 as ft}from"uuid";import{dequal as je}from"dequal/lite";import{reduceFieldsToValues as ve}from"payload/shared";var Be=({cachedFormState:n,cachedSchemaPath:t,currentSchemaPath:e,formData:o})=>{if(t!==e)return!1;let r=_(n),s=A({data:o,rowFieldPaths:Re(n)});return je(ke(r),ke(s))?n:!1},_=(n,t)=>{let e=Object.fromEntries(Object.entries(n).map(([o,r])=>!r||!Array.isArray(r.rows)?[o,r]:r.value===void 0||r.disableFormData!==!1&&r.isModified!==!0&&r.rows.length===0&&Le(t,o)===null?[o,{...r,value:null}]:[o,r.value===null?r:{...r,disableFormData:!0}]));return A({data:ve(e,!0),rowFieldPaths:new Set})},Le=(n,t)=>t.split(".").reduce((e,o)=>{if(!(!e||typeof e!="object"))return e[o]},n),Re=n=>new Set(Object.entries(n).filter(([,t])=>Array.isArray(t?.rows)&&t.value!==null&&t.value!==void 0).map(([t])=>t)),A=({data:n,parentPath:t="",rowFieldPaths:e})=>{let o={};for(let[r,s]of Object.entries(n)){let a=t?`${t}.${r}`:r,p=Me({parentPath:a,rowFieldPaths:e,value:s});p!==void 0&&(o[r]=p)}return o},Me=({parentPath:n,rowFieldPaths:t,value:e})=>{if(!(e===void 0||Array.isArray(e)&&e.length===0&&t.has(n)))return Array.isArray(e)?e.map((o,r)=>o&&typeof o=="object"&&!Array.isArray(o)?A({data:o,parentPath:`${n}.${r}`,rowFieldPaths:t}):o):e&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype?A({data:e,parentPath:n,rowFieldPaths:t}):e},ke=({blockName:n,blockType:t,...e})=>e;import{jsx as He}from"react/jsx-runtime";import Xe from"bson-objectid";import{$applyNodeReplacement as qe}from"lexical";import Ge from"react";import{addClassNamesToElement as Ke}from"@lexical/utils";import ze from"bson-objectid";import{$applyNodeReplacement as Je,DecoratorNode as Ve}from"lexical";var S=class extends Ve{__cacheBuster;__fields;constructor({cacheBuster:t,fields:e,key:o}){super(o),this.__fields=e,this.__cacheBuster=t||0}static clone(t){return new this({cacheBuster:t.__cacheBuster,fields:t.__fields,key:t.__key})}static getType(){return"inlineBlock"}static importDOM(){return{}}static importJSON(t){return We(t.fields)}static isInline(){return!1}canIndent(){return!0}createDOM(t){let e=document.createElement("span");return Ke(e,t?.theme?.inlineBlock),e}decorate(t,e){return null}exportDOM(){let t=document.createElement("span");t.classList.add("inline-block-container");let e=document.createTextNode(this.getTextContent());return t.append(e),{element:t}}exportJSON(){return{type:"inlineBlock",fields:this.getFields(),version:1}}getCacheBuster(){return this.getLatest().__cacheBuster}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}isInline(){return!0}setFields(t,e){let o=this.getWritable();o.__fields=t,e||o.__cacheBuster++}updateDOM(){return!1}};function We(n){return Je(new S({fields:{...n,id:n?.id||new ze.default().toHexString()}}))}var Ue=Ge.lazy(()=>import("./componentInline-ZEP5JPTC.js").then(n=>({default:n.InlineBlockComponent}))),E=class extends S{static clone(t){return super.clone(t)}static getType(){return super.getType()}static importJSON(t){return Qe(t.fields)}decorate(...[t,e,o,r]){return He(Ue,{cacheBuster:this.getCacheBuster(),className:e.theme.inlineBlock??"LexicalEditorTheme__inlineBlock",CustomBlock:o,CustomLabel:r,formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Qe(n){return qe(new E({fields:{...n,id:n?.id||new Xe.default().toHexString()}}))}function H(n){return n instanceof E}var _e=mt({initialState:!1}),ye=()=>F.use(_e),Vt=n=>{let{cacheBuster:t,className:e,CustomBlock:o,CustomLabel:r,formData:s,nodeKey:a}=n,[p]=Ye(),u=Ze(),{i18n:L,t:B}=dt(),{createdInlineBlock:U,fieldProps:{featureClientSchemaMap:Se,initialLexicalFormState:De,schemaPath:Q},setCreatedInlineBlock:Y,uuid:Fe}=fe(),{fields:w}=lt(),{getFormState:I}=ut(),we=at(),Z=x(!1),N=s.blockType,R=x(s);R.current=s;let C=`${Q}.lexical_internal_feature.blocks.lexical_inline_blocks.${N}.fields`,[f,M]=F.useState(()=>{let i=De?.[s.id],d=i?.formState;return d?Be({cachedFormState:d,cachedSchemaPath:i.schemaPath,currentSchemaPath:C,formData:s}):!1}),ee=x(!1),te=x(t);v(()=>{ee.current?(te.current!==t&&M(!1),te.current=t):ee.current=!0},[t]);let[Ie]=F.useState(()=>ft()),[oe,ne]=F.useState(()=>{if(!r)return f?._components?.customComponents?.BlockLabel??void 0}),[re,se]=F.useState(()=>{if(!o)return f?._components?.customComponents?.Block??void 0}),ie=g(()=>o?c(o,{className:e,formData:s,isEditor:!0,isJSXConverter:!1,nodeKey:a,useInlineBlockComponentContext:ye}):re,[o,e,s,a,re]),K=g(()=>r?c(r,{className:e,formData:s,isEditor:!0,isJSXConverter:!1,nodeKey:a,useInlineBlockComponentContext:ye}):oe,[r,e,s,a,oe]),le=nt({slug:`lexical-inlineBlocks-create-${Fe}-${s.id}`,depth:we}),{toggleDrawer:b}=he(le,!0),Ne=x(null),{id:O,collectionSlug:T,getDocPreferences:$,globalSlug:P}=ct(),{config:Oe}=it(),Te=`${Q}.lexical_internal_feature.blocks.lexical_inline_blocks.${N}`,z=Se.blocks?.[Te]?.[0]?.blocks?.[0],m=typeof z=="string"?Oe.blocksMap[z]:z,ce=m?.fields??[];v(()=>{!Z.current&&U?.getKey()===a&&(ce.length>2&&b(),Y?.(void 0),Z.current=!0)},[ce.length,U,a,Y,b]);let ae=G(()=>{p.update(()=>{q(a)?.remove()})},[p,a]),y=m?.labels?.singular?Ce(m?.labels.singular,L):m?.slug,J=x(new AbortController);v(()=>{let i=new AbortController;return m&&s&&!f&&(async()=>{let{state:l}=await I({id:O,collectionSlug:T,data:s,docPermissions:{fields:!0},docPreferences:await $(),documentFormState:j(w,{excludeFiles:!0}),globalSlug:P,initialBlockData:s,operation:"update",readOnly:!u,renderAllFields:!0,schemaPath:C,signal:i.signal});if(l){let h=_(j(l,{excludeFiles:!0}));p.update(()=>{let k=q(a);if(k&&H(k)){let me=h;me.blockType=s.blockType,k.setFields(me,!0)}},{tag:xe}),M(l),r||ne(l._components?.customComponents?.BlockLabel),o||se(l._components?.customComponents?.Block)}})(),()=>{X(i)}},[I,p,a,u,r,o,C,O,s,f,T,P,$,w,m]);let ue=G(async({formState:i,submit:d})=>{X(J.current);let l=new AbortController;J.current=l;let h=_(j(i,{excludeFiles:!0}),R.current),{state:k}=await I({id:O,collectionSlug:T,data:h,docPermissions:{fields:!0},docPreferences:await $(),documentFormState:j(w,{excludeFiles:!0}),formState:i,globalSlug:P,initialBlockData:h,operation:"update",readOnly:!u,renderAllFields:!!d,schemaPath:C,signal:l.signal});return k?(d&&(r||ne(k._components?.customComponents?.BlockLabel),o||se(k._components?.customComponents?.Block)),k):i},[I,O,T,$,w,P,u,C,o,r]);v(()=>{let i=(d,l)=>Object.keys(l).some(h=>l[h]&&d[h]!==l[h].value);return()=>{f&&i(s,f)&&M(!1),X(J.current)}},[s,f]);let $e=G(i=>{let d=_(i,R.current);d.blockType=N,p.update(()=>{let l=q(a);l&&H(l)&&l.setFields(d,!0)},{tag:xe})},[N,p,a]),{headerActions:Pe,submitRef:Ae}=pe(),V=g(()=>()=>c(ge,{buttonStyle:"ghost",className:`${e}__removeButton`,disabled:!u,icon:"x",onClick:i=>{i.preventDefault(),i.stopPropagation(),ae()},round:!0,size:"medium",tooltip:B("lexical:blocks:inlineBlocks:remove",{label:y})}),[e,y,u,ae,B]),Ee=g(()=>()=>c(ge,{buttonStyle:"ghost",className:`${e}__editButton`,disabled:!u,el:"button",icon:"edit",onClick:()=>{b()},round:!0,size:"medium",tooltip:B("lexical:blocks:inlineBlocks:edit",{label:y})}),[e,y,u,B,b]),W=g(()=>({children:i,className:d})=>c("div",{className:[`${e}__container`,e+"-"+s.blockType,d].filter(Boolean).join(" "),...u?{onClick:()=>b(),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),b())},role:"button",tabIndex:0}:{},ref:Ne,children:i}),[e,s.blockType,u,b]),de=g(()=>K?()=>K:()=>c("div",{children:m?.labels?Ce(m?.labels.singular,L):""}),[K,m?.labels,L]);return m?D(ot,{beforeSubmit:[async({formState:i})=>await ue({formState:i,submit:!0})],disableValidationOnSubmit:!0,el:"div",fields:m?.fields,initialState:f||{},onChange:[ue],onSubmit:i=>{$e(i),b()},uuid:Ie,children:[c(tt,{children:c(et,{className:"",headerActions:Pe,slug:le,title:B(`lexical:blocks:inlineBlocks:${s?.id?"edit":"create"}`,{label:y??B("lexical:blocks:inlineBlocks:label")}),children:f?D("div",{className:"fields-drawer",children:[c(rt,{fields:m?.fields,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:C,permissions:!0,readOnly:!u}),c(be,{submitRef:Ae})]}):null})}),ie?c(_e,{value:{EditButton:Ee,initialState:f,InlineBlockContainer:W,Label:de,nodeKey:a,RemoveButton:V},children:ie}):D(W,{children:[f?c(de,{}):c(st,{height:"15px",width:"40px"}),u?c("div",{className:`${e}__actions`,children:c(V,{})}):null]})]}):D(W,{className:`${e}-not-found`,children:[D("span",{children:["Error: Block '",s.blockType,"' not found"]}),u?c("div",{className:`${e}__actions`,children:c(V,{})}):null]})};export{Be as a,_ as b,ye as c,Vt as d,E as e,Qe as f,H as g};
2
- //# sourceMappingURL=chunk-ATPSL6IX.js.map