@payloadcms/richtext-lexical 4.0.0-canary.3 → 4.0.0-internal.011fd46

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 (148) hide show
  1. package/dist/exports/client/Field-VQX3RNMF.js +2 -0
  2. package/dist/exports/client/{Field-G5Z2HM5Y.js.map → Field-VQX3RNMF.js.map} +3 -3
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/chunk-X3D4LZS7.js +2 -0
  5. package/dist/exports/client/chunk-X3D4LZS7.js.map +7 -0
  6. package/dist/exports/client/index.js +22 -20
  7. package/dist/exports/client/index.js.map +4 -4
  8. package/dist/features/blockquote/markdownTransformer.d.ts +1 -1
  9. package/dist/features/blockquote/markdownTransformer.d.ts.map +1 -1
  10. package/dist/features/blockquote/markdownTransformer.js.map +1 -1
  11. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts +1 -1
  12. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts.map +1 -1
  13. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js +1 -1
  14. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js.map +1 -1
  15. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts +1 -1
  16. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts.map +1 -1
  17. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js +1 -1
  18. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js.map +1 -1
  19. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts +1 -2
  20. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  21. package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
  22. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts +1 -1
  23. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  24. package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
  25. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  26. package/dist/features/converters/lexicalToMarkdown/index.js +1 -1
  27. package/dist/features/converters/lexicalToMarkdown/index.js.map +1 -1
  28. package/dist/features/converters/markdownToLexical/index.js +1 -1
  29. package/dist/features/converters/markdownToLexical/index.js.map +1 -1
  30. package/dist/features/experimental_table/markdownTransformer.d.ts +1 -1
  31. package/dist/features/experimental_table/markdownTransformer.d.ts.map +1 -1
  32. package/dist/features/experimental_table/markdownTransformer.js +1 -1
  33. package/dist/features/experimental_table/markdownTransformer.js.map +1 -1
  34. package/dist/features/format/bold/markdownTransformers.d.ts +1 -1
  35. package/dist/features/format/bold/markdownTransformers.d.ts.map +1 -1
  36. package/dist/features/format/bold/markdownTransformers.js.map +1 -1
  37. package/dist/features/format/inlineCode/markdownTransformers.d.ts +1 -1
  38. package/dist/features/format/inlineCode/markdownTransformers.d.ts.map +1 -1
  39. package/dist/features/format/inlineCode/markdownTransformers.js.map +1 -1
  40. package/dist/features/format/italic/markdownTransformers.d.ts +1 -1
  41. package/dist/features/format/italic/markdownTransformers.d.ts.map +1 -1
  42. package/dist/features/format/italic/markdownTransformers.js.map +1 -1
  43. package/dist/features/format/strikethrough/markdownTransformers.d.ts +1 -1
  44. package/dist/features/format/strikethrough/markdownTransformers.d.ts.map +1 -1
  45. package/dist/features/format/strikethrough/markdownTransformers.js.map +1 -1
  46. package/dist/features/heading/markdownTransformer.d.ts +1 -1
  47. package/dist/features/heading/markdownTransformer.d.ts.map +1 -1
  48. package/dist/features/heading/markdownTransformer.js.map +1 -1
  49. package/dist/features/horizontalRule/client/markdownTransformer.d.ts +1 -1
  50. package/dist/features/horizontalRule/client/markdownTransformer.d.ts.map +1 -1
  51. package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
  52. package/dist/features/horizontalRule/server/markdownTransformer.d.ts +1 -1
  53. package/dist/features/horizontalRule/server/markdownTransformer.d.ts.map +1 -1
  54. package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -1
  55. package/dist/features/link/markdownTransformer.d.ts +1 -1
  56. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  57. package/dist/features/link/markdownTransformer.js.map +1 -1
  58. package/dist/features/link/markdownTransformer.spec.js +1 -1
  59. package/dist/features/link/markdownTransformer.spec.js.map +1 -1
  60. package/dist/features/lists/checklist/markdownTransformers.d.ts +1 -1
  61. package/dist/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
  62. package/dist/features/lists/checklist/markdownTransformers.js.map +1 -1
  63. package/dist/features/lists/orderedList/markdownTransformer.d.ts +1 -1
  64. package/dist/features/lists/orderedList/markdownTransformer.d.ts.map +1 -1
  65. package/dist/features/lists/orderedList/markdownTransformer.js.map +1 -1
  66. package/dist/features/lists/shared/markdown.d.ts +1 -1
  67. package/dist/features/lists/shared/markdown.d.ts.map +1 -1
  68. package/dist/features/lists/shared/markdown.js.map +1 -1
  69. package/dist/features/lists/unorderedList/markdownTransformer.d.ts +1 -1
  70. package/dist/features/lists/unorderedList/markdownTransformer.d.ts.map +1 -1
  71. package/dist/features/lists/unorderedList/markdownTransformer.js.map +1 -1
  72. package/dist/features/toolbars/shared/useToolbarStates.d.ts.map +1 -1
  73. package/dist/features/toolbars/shared/useToolbarStates.js +3 -1
  74. package/dist/features/toolbars/shared/useToolbarStates.js.map +1 -1
  75. package/dist/features/typesClient.d.ts +1 -1
  76. package/dist/features/typesClient.d.ts.map +1 -1
  77. package/dist/features/typesClient.js.map +1 -1
  78. package/dist/features/typesServer.d.ts +1 -1
  79. package/dist/features/typesServer.d.ts.map +1 -1
  80. package/dist/features/typesServer.js.map +1 -1
  81. package/dist/features/upload/server/markdownTransformer.d.ts +1 -1
  82. package/dist/features/upload/server/markdownTransformer.d.ts.map +1 -1
  83. package/dist/features/upload/server/markdownTransformer.js.map +1 -1
  84. package/dist/field/bundled.css +1 -1
  85. package/dist/index.d.ts +2 -2
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +2 -2
  88. package/dist/index.js.map +1 -1
  89. package/dist/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  90. package/dist/lexical/plugins/MarkdownShortcut/index.js +1 -1
  91. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  92. package/dist/lexical/utils/markdown/createBlockNode.d.ts +1 -1
  93. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  94. package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
  95. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts +28 -0
  96. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts.map +1 -0
  97. package/dist/lexical/utils/markdown/normalizeMarkdown.js +95 -0
  98. package/dist/lexical/utils/markdown/normalizeMarkdown.js.map +1 -0
  99. package/dist/lexical-proxy/@lexical-markdown.d.ts +40 -1
  100. package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -1
  101. package/dist/lexical-proxy/@lexical-markdown.js +56 -1
  102. package/dist/lexical-proxy/@lexical-markdown.js.map +1 -1
  103. package/dist/lexical-proxy/@lexical-markdown.spec.js +89 -0
  104. package/dist/lexical-proxy/@lexical-markdown.spec.js.map +1 -0
  105. package/package.json +20 -24
  106. package/dist/exports/client/Field-G5Z2HM5Y.js +0 -2
  107. package/dist/exports/client/chunk-LH634DPU.js +0 -12
  108. package/dist/exports/client/chunk-LH634DPU.js.map +0 -7
  109. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +0 -2
  110. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +0 -1
  111. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +0 -2
  112. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +0 -1
  113. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts +0 -14
  114. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts.map +0 -1
  115. package/dist/packages/@lexical/markdown/MarkdownExport.js +0 -213
  116. package/dist/packages/@lexical/markdown/MarkdownExport.js.map +0 -1
  117. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts +0 -19
  118. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts.map +0 -1
  119. package/dist/packages/@lexical/markdown/MarkdownImport.js +0 -198
  120. package/dist/packages/@lexical/markdown/MarkdownImport.js.map +0 -1
  121. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts +0 -11
  122. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts.map +0 -1
  123. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js +0 -304
  124. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js.map +0 -1
  125. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts +0 -147
  126. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts.map +0 -1
  127. package/dist/packages/@lexical/markdown/MarkdownTransformers.js +0 -268
  128. package/dist/packages/@lexical/markdown/MarkdownTransformers.js.map +0 -1
  129. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts +0 -22
  130. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts.map +0 -1
  131. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js +0 -91
  132. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js.map +0 -1
  133. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts +0 -21
  134. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts.map +0 -1
  135. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js +0 -54
  136. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js.map +0 -1
  137. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts +0 -18
  138. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts.map +0 -1
  139. package/dist/packages/@lexical/markdown/importTextTransformers.js +0 -54
  140. package/dist/packages/@lexical/markdown/importTextTransformers.js.map +0 -1
  141. package/dist/packages/@lexical/markdown/index.d.ts +0 -29
  142. package/dist/packages/@lexical/markdown/index.d.ts.map +0 -1
  143. package/dist/packages/@lexical/markdown/index.js +0 -39
  144. package/dist/packages/@lexical/markdown/index.js.map +0 -1
  145. package/dist/packages/@lexical/markdown/utils.d.ts +0 -34
  146. package/dist/packages/@lexical/markdown/utils.d.ts.map +0 -1
  147. package/dist/packages/@lexical/markdown/utils.js +0 -267
  148. package/dist/packages/@lexical/markdown/utils.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { AdapterProps, LexicalEditorProps, LexicalRichTextAdapterProvider } from './types/index.js';
2
- export declare const lexicalTargetVersion = "0.41.0";
2
+ export declare const lexicalTargetVersion = "0.45.0";
3
3
  export declare function lexicalEditor(args?: LexicalEditorProps): LexicalRichTextAdapterProvider;
4
4
  export { AlignFeature } from './features/align/server/index.js';
5
5
  export { BlockquoteFeature } from './features/blockquote/server/index.js';
@@ -62,7 +62,7 @@ export { getEnabledNodes, getEnabledNodesFromServerNodes } from './lexical/nodes
62
62
  export type { SlashMenuGroup, SlashMenuItem, } from './lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
63
63
  export { DETAIL_TYPE_TO_DETAIL, DOUBLE_LINE_BREAK, ELEMENT_FORMAT_TO_TYPE, ELEMENT_TYPE_TO_FORMAT, IS_ALL_FORMATTING, LTR_REGEX, NodeFormat, NON_BREAKING_SPACE, RTL_REGEX, TEXT_MODE_TO_TYPE, TEXT_TYPE_TO_FORMAT, TEXT_TYPE_TO_MODE, } from './lexical/utils/nodeFormat.js';
64
64
  export { sanitizeUrl, validateUrl } from './lexical/utils/url.js';
65
- export { $convertFromMarkdownString } from './packages/@lexical/markdown/index.js';
65
+ export { $convertFromMarkdownString } from './lexical-proxy/@lexical-markdown.js';
66
66
  export { defaultRichTextValue } from './populateGraphQL/defaultValue.js';
67
67
  export { populate } from './populateGraphQL/populate.js';
68
68
  export type { ClientFeaturesMap, LexicalEditorNodeMap, LexicalEditorProps, LexicalEditorViewMap, LexicalFieldAdminProps, LexicalRichTextAdapter, NodeMapValue, SerializedNodeBase, ViewMapBlockComponentProps, } from './types/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,8BAA8B,EAC/B,MAAM,kBAAkB,CAAA;AAezB,eAAO,MAAM,oBAAoB,WAAW,CAAA;AAE5C,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,kBAAkB,GAAG,8BAA8B,CA8IvF;AAED,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAA;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AACjE,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,4BAA4B,EAC5B,4BAA4B,EAC5B,uBAAuB,EACvB,6BAA6B,EAC7B,kCAAkC,EAClC,kCAAkC,EAClC,6BAA6B,GAC9B,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,GAChB,MAAM,8CAA8C,CAAA;AACrD,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,oDAAoD,CAAA;AAE3D,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAExF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAA;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAA;AAE3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAA;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAA;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAA;AAE3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDA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AE,MAAM,+BAA+B,CAAA;AACxD,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,YAAY,EACZ,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,kBAAkB,CAAA;AAEzB,mBAAmB,sBAAsB,CAAA;AAEzC,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAExE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAE3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAA;AAElG,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA"}
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import { getGenerateSchemaMap } from './utilities/generateSchemaMap.js';
10
10
  import { getDefaultSanitizedEditorConfig } from './utilities/getDefaultSanitizedEditorConfig.js';
11
11
  import { richTextValidateHOC } from './validate/index.js';
12
12
  let checkedDependencies = false;
13
- export const lexicalTargetVersion = '0.41.0';
13
+ export const lexicalTargetVersion = '0.45.0';
14
14
  export function lexicalEditor(args) {
15
15
  if (process.env.NODE_ENV !== 'production' && process.env.PAYLOAD_DISABLE_DEPENDENCY_CHECKER !== 'true' && !checkedDependencies) {
16
16
  checkedDependencies = true;
@@ -182,7 +182,7 @@ export { sanitizeServerEditorConfig, sanitizeServerFeatures } from './lexical/co
182
182
  export { getEnabledNodes, getEnabledNodesFromServerNodes } from './lexical/nodes/index.js';
183
183
  export { DETAIL_TYPE_TO_DETAIL, DOUBLE_LINE_BREAK, ELEMENT_FORMAT_TO_TYPE, ELEMENT_TYPE_TO_FORMAT, IS_ALL_FORMATTING, LTR_REGEX, NodeFormat, NON_BREAKING_SPACE, RTL_REGEX, TEXT_MODE_TO_TYPE, TEXT_TYPE_TO_FORMAT, TEXT_TYPE_TO_MODE } from './lexical/utils/nodeFormat.js';
184
184
  export { sanitizeUrl, validateUrl } from './lexical/utils/url.js';
185
- export { $convertFromMarkdownString } from './packages/@lexical/markdown/index.js';
185
+ export { $convertFromMarkdownString } from './lexical-proxy/@lexical-markdown.js';
186
186
  export { defaultRichTextValue } from './populateGraphQL/defaultValue.js';
187
187
  export { populate } from './populateGraphQL/populate.js';
188
188
  export { buildDefaultEditorState, buildEditorState } from './utilities/buildEditorState.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["checkDependencies","deepMergeSimple","getLexicalHooks","i18n","defaultEditorFeatures","populateLexicalPopulationPromises","getFieldToJSONSchema","featuresInputToEditorConfig","getGenerateImportMap","getGenerateSchemaMap","getDefaultSanitizedEditorConfig","richTextValidateHOC","checkedDependencies","lexicalTargetVersion","lexicalEditor","args","process","env","NODE_ENV","PAYLOAD_DISABLE_DEPENDENCY_CHECKER","dependencyGroups","name","dependencies","targetVersion","config","isRoot","parentIsLocalized","features","resolvedFeatureMap","finalSanitizedEditorConfig","lexical","result","sanitizedConfig","featureI18n","supportedLanguages","supportedLanguagesToMerge","_lang","lang","lexicalI18nForLang","general","translations","CellComponent","DiffComponent","editorConfig","FieldComponent","path","serverProps","admin","views","generateImportMap","lexicalEditorArgs","generateSchemaMap","graphQLPopulationPromises","context","currentDepth","depth","draft","field","fieldPromises","findMany","flattenLocales","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","size","editorPopulationPromises","hooks","jsonSchema","validate","AlignFeature","BlockquoteFeature","CodeBlock","BlocksFeature","$createServerBlockNode","$isServerBlockNode","ServerBlockNode","$createServerInlineBlockNode","$isServerInlineBlockNode","ServerInlineBlockNode","convertHTMLToLexical","lexicalHTMLField","convertLexicalToMarkdown","convertMarkdownToLexical","getPayloadPopulateFn","getRestPopulateFn","DebugJsxConverterFeature","TestRecorderFeature","TreeViewFeature","EXPERIMENTAL_TableFeature","BoldFeature","InlineCodeFeature","ItalicFeature","StrikethroughFeature","SubscriptFeature","SuperscriptFeature","UnderlineFeature","HeadingFeature","HorizontalRuleFeature","IndentFeature","$createAutoLinkNode","$isAutoLinkNode","AutoLinkNode","$createLinkNode","$isLinkNode","LinkNode","LinkFeature","ChecklistFeature","OrderedListFeature","UnorderedListFeature","ParagraphFeature","RelationshipFeature","RelationshipServerNode","defaultColors","TextStateFeature","FixedToolbarFeature","InlineToolbarFeature","createNode","UploadFeature","UploadServerNode","defaultEditorConfig","defaultEditorLexicalConfig","loadFeatures","sortFeaturesForOptimalLoading","sanitizeServerEditorConfig","sanitizeServerFeatures","getEnabledNodes","getEnabledNodesFromServerNodes","DETAIL_TYPE_TO_DETAIL","DOUBLE_LINE_BREAK","ELEMENT_FORMAT_TO_TYPE","ELEMENT_TYPE_TO_FORMAT","IS_ALL_FORMATTING","LTR_REGEX","NodeFormat","NON_BREAKING_SPACE","RTL_REGEX","TEXT_MODE_TO_TYPE","TEXT_TYPE_TO_FORMAT","TEXT_TYPE_TO_MODE","sanitizeUrl","validateUrl","$convertFromMarkdownString","defaultRichTextValue","populate","buildDefaultEditorState","buildEditorState","createServerFeature","editorConfigFactory","extractPropsFromJSXPropsString","extractFrontmatter","frontmatterToObject","objectToFrontmatter","propsToJSXString","upgradeLexicalData"],"sources":["../src/index.ts"],"sourcesContent":["import type { GenericLanguages, GenericTranslationsObject } from '@payloadcms/translations'\n\nimport { checkDependencies, deepMergeSimple } from 'payload'\n\nimport type { FeatureProviderServer, ResolvedServerFeatureMap } from './features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from './lexical/config/types.js'\nimport type {\n AdapterProps,\n LexicalEditorProps,\n LexicalRichTextAdapterProvider,\n} from './types/index.js'\n\nimport { getLexicalHooks } from './hooks.js'\nimport { i18n } from './i18n.js'\nimport { defaultEditorFeatures } from './lexical/config/server/default.js'\nimport { populateLexicalPopulationPromises } from './populateGraphQL/populateLexicalPopulationPromises.js'\nimport { getFieldToJSONSchema } from './types/schema.js'\nimport { featuresInputToEditorConfig } from './utilities/editorConfigFactory.js'\nimport { getGenerateImportMap } from './utilities/generateImportMap.js'\nimport { getGenerateSchemaMap } from './utilities/generateSchemaMap.js'\nimport { getDefaultSanitizedEditorConfig } from './utilities/getDefaultSanitizedEditorConfig.js'\nimport { richTextValidateHOC } from './validate/index.js'\n\nlet checkedDependencies = false\n\nexport const lexicalTargetVersion = '0.41.0'\n\nexport function lexicalEditor(args?: LexicalEditorProps): LexicalRichTextAdapterProvider {\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.PAYLOAD_DISABLE_DEPENDENCY_CHECKER !== 'true' &&\n !checkedDependencies\n ) {\n checkedDependencies = true\n void checkDependencies({\n dependencyGroups: [\n {\n name: 'lexical',\n dependencies: [\n 'lexical',\n '@lexical/headless',\n '@lexical/link',\n '@lexical/list',\n '@lexical/mark',\n '@lexical/react',\n '@lexical/rich-text',\n '@lexical/selection',\n '@lexical/utils',\n ],\n targetVersion: lexicalTargetVersion,\n },\n ],\n })\n }\n return async ({ config, isRoot, parentIsLocalized }) => {\n let features: FeatureProviderServer<unknown, unknown, unknown>[] = []\n let resolvedFeatureMap: ResolvedServerFeatureMap\n\n let finalSanitizedEditorConfig: SanitizedServerEditorConfig // For server only\n if (!args || (!args.features && !args.lexical)) {\n finalSanitizedEditorConfig = await getDefaultSanitizedEditorConfig({\n config,\n parentIsLocalized,\n })\n\n features = defaultEditorFeatures\n\n resolvedFeatureMap = finalSanitizedEditorConfig.resolvedFeatureMap\n } else {\n const result = await featuresInputToEditorConfig({\n config,\n features: args?.features,\n isRoot,\n lexical: args?.lexical,\n parentIsLocalized,\n })\n finalSanitizedEditorConfig = result.sanitizedConfig\n features = result.features\n resolvedFeatureMap = result.resolvedFeatureMap\n }\n\n const featureI18n: Partial<GenericLanguages> = finalSanitizedEditorConfig.features.i18n\n const supportedLanguages = config.i18n?.supportedLanguages\n const supportedLanguagesToMerge: Partial<GenericLanguages> = {}\n for (const _lang in supportedLanguages) {\n if (!(_lang in i18n)) {\n if (featureI18n[_lang as keyof typeof i18n]) {\n supportedLanguagesToMerge[_lang as keyof typeof i18n] =\n featureI18n[_lang as keyof typeof i18n]\n }\n continue\n }\n const lang = _lang as keyof typeof i18n\n const lexicalI18nForLang = ((featureI18n[lang] ??= {}).lexical ??=\n {}) as GenericTranslationsObject\n\n lexicalI18nForLang.general = i18n[lang] ?? {}\n supportedLanguagesToMerge[lang] = featureI18n[lang]\n }\n\n config.i18n.translations = deepMergeSimple(config.i18n.translations, supportedLanguagesToMerge)\n\n return {\n CellComponent: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell',\n DiffComponent: '@payloadcms/richtext-lexical/rsc#LexicalDiffComponent',\n editorConfig: finalSanitizedEditorConfig,\n features,\n FieldComponent: {\n path: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalField',\n serverProps: {\n admin: args?.admin,\n views: args?.views,\n // SanitizedEditorConfig is manually passed by `renderField` in `fieldSchemasToFormState/renderField.tsx`\n // in order to reduce the size of the field schema\n },\n },\n generateImportMap: getGenerateImportMap({\n lexicalEditorArgs: args,\n resolvedFeatureMap,\n }),\n generateSchemaMap: getGenerateSchemaMap({\n resolvedFeatureMap,\n }),\n graphQLPopulationPromises({\n context,\n currentDepth,\n depth,\n draft,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n }) {\n // check if there are any features with nodes which have populationPromises for this field\n if (finalSanitizedEditorConfig?.features?.graphQLPopulationPromises?.size) {\n populateLexicalPopulationPromises({\n context,\n currentDepth: currentDepth ?? 0,\n depth,\n draft,\n editorPopulationPromises: finalSanitizedEditorConfig.features.graphQLPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n })\n }\n },\n hooks: getLexicalHooks({\n editorConfig: finalSanitizedEditorConfig,\n }),\n jsonSchema: getFieldToJSONSchema({ editorConfig: finalSanitizedEditorConfig }),\n validate: richTextValidateHOC({\n editorConfig: finalSanitizedEditorConfig,\n }),\n }\n }\n}\n\nexport { AlignFeature } from './features/align/server/index.js'\nexport { BlockquoteFeature } from './features/blockquote/server/index.js'\nexport { CodeBlock } from './features/blocks/premade/CodeBlock/index.js'\nexport { BlocksFeature } from './features/blocks/server/index.js'\nexport type {\n BlocksFeatureProps,\n LexicalBlockClientProps,\n LexicalBlockLabelClientProps,\n LexicalBlockLabelServerProps,\n LexicalBlockServerProps,\n LexicalInlineBlockClientProps,\n LexicalInlineBlockLabelClientProps,\n LexicalInlineBlockLabelServerProps,\n LexicalInlineBlockServerProps,\n} from './features/blocks/server/index.js'\n\nexport {\n $createServerBlockNode,\n $isServerBlockNode,\n ServerBlockNode,\n} from './features/blocks/server/nodes/BlocksNode.js'\nexport {\n $createServerInlineBlockNode,\n $isServerInlineBlockNode,\n ServerInlineBlockNode,\n} from './features/blocks/server/nodes/InlineBlocksNode.js'\n\nexport type { BlockFields, InlineBlockFields } from './features/blocks/server/schema.js'\n\nexport { convertHTMLToLexical } from './features/converters/htmlToLexical/index.js'\n\nexport { lexicalHTMLField } from './features/converters/lexicalToHtml/async/field/index.js'\n\nexport { convertLexicalToMarkdown } from './features/converters/lexicalToMarkdown/index.js'\nexport { convertMarkdownToLexical } from './features/converters/markdownToLexical/index.js'\nexport { getPayloadPopulateFn } from './features/converters/utilities/payloadPopulateFn.js'\n\nexport { getRestPopulateFn } from './features/converters/utilities/restPopulateFn.js'\nexport { DebugJsxConverterFeature } from './features/debug/jsxConverter/server/index.js'\nexport { TestRecorderFeature } from './features/debug/testRecorder/server/index.js'\nexport { TreeViewFeature } from './features/debug/treeView/server/index.js'\nexport { EXPERIMENTAL_TableFeature } from './features/experimental_table/server/index.js'\nexport { BoldFeature } from './features/format/bold/feature.server.js'\nexport { InlineCodeFeature } from './features/format/inlineCode/feature.server.js'\n\nexport { ItalicFeature } from './features/format/italic/feature.server.js'\nexport { StrikethroughFeature } from './features/format/strikethrough/feature.server.js'\nexport { SubscriptFeature } from './features/format/subscript/feature.server.js'\nexport { SuperscriptFeature } from './features/format/superscript/feature.server.js'\nexport { UnderlineFeature } from './features/format/underline/feature.server.js'\nexport { HeadingFeature, type HeadingFeatureProps } from './features/heading/server/index.js'\nexport { HorizontalRuleFeature } from './features/horizontalRule/server/index.js'\n\nexport { IndentFeature } from './features/indent/server/index.js'\nexport {\n $createAutoLinkNode,\n $isAutoLinkNode,\n AutoLinkNode,\n} from './features/link/nodes/AutoLinkNode.js'\nexport { $createLinkNode, $isLinkNode, LinkNode } from './features/link/nodes/LinkNode.js'\n\nexport { LinkFeature, type LinkFeatureServerProps } from './features/link/server/index.js'\nexport type { LinkFields } from './features/link/server/schema.js'\n\nexport { ChecklistFeature } from './features/lists/checklist/server/index.js'\nexport { OrderedListFeature } from './features/lists/orderedList/server/index.js'\n\nexport { UnorderedListFeature } from './features/lists/unorderedList/server/index.js'\n\nexport { ParagraphFeature } from './features/paragraph/server/index.js'\n\nexport {\n RelationshipFeature,\n type RelationshipFeatureProps,\n} from './features/relationship/server/index.js'\n\nexport { RelationshipServerNode } from './features/relationship/server/nodes/RelationshipNode.js'\nexport type { RelationshipData } from './features/relationship/server/schema.js'\nexport { defaultColors } from './features/textState/defaultColors.js'\nexport { TextStateFeature } from './features/textState/feature.server.js'\n\nexport { FixedToolbarFeature } from './features/toolbars/fixed/server/index.js'\n\nexport { InlineToolbarFeature } from './features/toolbars/inline/server/index.js'\nexport type { ToolbarGroup, ToolbarGroupItem } from './features/toolbars/types.js'\nexport type {\n BaseClientFeatureProps,\n ClientFeature,\n ClientFeatureProviderMap,\n FeatureProviderClient,\n FeatureProviderProviderClient,\n PluginComponent,\n PluginComponentWithAnchor,\n ResolvedClientFeature,\n ResolvedClientFeatureMap,\n SanitizedClientFeatures,\n SanitizedPlugin,\n} from './features/typesClient.js'\n\nexport type {\n AfterChangeNodeHook,\n AfterChangeNodeHookArgs,\n AfterReadNodeHook,\n AfterReadNodeHookArgs,\n BaseNodeHookArgs,\n BeforeChangeNodeHook,\n BeforeChangeNodeHookArgs,\n BeforeValidateNodeHook,\n BeforeValidateNodeHookArgs,\n FeatureProviderProviderServer,\n FeatureProviderServer,\n NodeValidation,\n NodeWithHooks,\n PopulationPromise,\n ResolvedServerFeature,\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n ServerFeature,\n ServerFeatureProviderMap,\n} from './features/typesServer.js'\n\nexport { createNode } from './features/typeUtilities.js' // Only useful in feature.server.ts\n\nexport { UploadFeature } from './features/upload/server/index.js'\nexport type { UploadFeatureProps } from './features/upload/server/index.js'\n\nexport { UploadServerNode } from './features/upload/server/nodes/UploadNode.js'\nexport type { UploadData } from './features/upload/server/schema.js'\nexport type { EditorConfigContextType } from './lexical/config/client/EditorConfigProvider.js'\n\nexport {\n defaultEditorConfig,\n defaultEditorFeatures,\n defaultEditorLexicalConfig,\n} from './lexical/config/server/default.js'\nexport { loadFeatures, sortFeaturesForOptimalLoading } from './lexical/config/server/loader.js'\n\nexport {\n sanitizeServerEditorConfig,\n sanitizeServerFeatures,\n} from './lexical/config/server/sanitize.js'\nexport type {\n ClientEditorConfig,\n SanitizedClientEditorConfig,\n SanitizedServerEditorConfig,\n ServerEditorConfig,\n} from './lexical/config/types.js'\nexport type { AdapterProps }\n\nexport { getEnabledNodes, getEnabledNodesFromServerNodes } from './lexical/nodes/index.js'\n\nexport type {\n SlashMenuGroup,\n SlashMenuItem,\n} from './lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nexport {\n DETAIL_TYPE_TO_DETAIL,\n DOUBLE_LINE_BREAK,\n ELEMENT_FORMAT_TO_TYPE,\n ELEMENT_TYPE_TO_FORMAT,\n IS_ALL_FORMATTING,\n LTR_REGEX,\n NodeFormat,\n NON_BREAKING_SPACE,\n RTL_REGEX,\n TEXT_MODE_TO_TYPE,\n TEXT_TYPE_TO_FORMAT,\n TEXT_TYPE_TO_MODE,\n} from './lexical/utils/nodeFormat.js'\n\nexport { sanitizeUrl, validateUrl } from './lexical/utils/url.js'\n\nexport { $convertFromMarkdownString } from './packages/@lexical/markdown/index.js'\n\nexport { defaultRichTextValue } from './populateGraphQL/defaultValue.js'\nexport { populate } from './populateGraphQL/populate.js'\nexport type {\n ClientFeaturesMap,\n LexicalEditorNodeMap,\n LexicalEditorProps,\n LexicalEditorViewMap,\n LexicalFieldAdminProps,\n LexicalRichTextAdapter,\n NodeMapValue,\n SerializedNodeBase,\n ViewMapBlockComponentProps,\n} from './types/index.js'\n\nexport type * from './types/nodeTypes.js'\n\nexport { buildDefaultEditorState, buildEditorState } from './utilities/buildEditorState.js'\nexport { createServerFeature } from './utilities/createServerFeature.js'\n\nexport { editorConfigFactory } from './utilities/editorConfigFactory.js'\nexport type { FieldsDrawerProps } from './utilities/fieldsDrawer/Drawer.js'\n\nexport { extractPropsFromJSXPropsString } from './utilities/jsx/extractPropsFromJSXPropsString.js'\n\nexport {\n extractFrontmatter,\n frontmatterToObject,\n objectToFrontmatter,\n propsToJSXString,\n} from './utilities/jsx/jsx.js'\nexport { upgradeLexicalData } from './utilities/upgradeLexicalData/index.js'\n"],"mappings":"AAEA,SAASA,iBAAiB,EAAEC,eAAe,QAAQ;AAUnD,SAASC,eAAe,QAAQ;AAChC,SAASC,IAAI,QAAQ;AACrB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,iCAAiC,QAAQ;AAClD,SAASC,oBAAoB,QAAQ;AACrC,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,oBAAoB,QAAQ;AACrC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,+BAA+B,QAAQ;AAChD,SAASC,mBAAmB,QAAQ;AAEpC,IAAIC,mBAAA,GAAsB;AAE1B,OAAO,MAAM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,EAClBC,mBAAmB,EACnBC,mBAAmB,EACnBC,gBAAgB,QACX;AACP,SAASC,kBAAkB,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["checkDependencies","deepMergeSimple","getLexicalHooks","i18n","defaultEditorFeatures","populateLexicalPopulationPromises","getFieldToJSONSchema","featuresInputToEditorConfig","getGenerateImportMap","getGenerateSchemaMap","getDefaultSanitizedEditorConfig","richTextValidateHOC","checkedDependencies","lexicalTargetVersion","lexicalEditor","args","process","env","NODE_ENV","PAYLOAD_DISABLE_DEPENDENCY_CHECKER","dependencyGroups","name","dependencies","targetVersion","config","isRoot","parentIsLocalized","features","resolvedFeatureMap","finalSanitizedEditorConfig","lexical","result","sanitizedConfig","featureI18n","supportedLanguages","supportedLanguagesToMerge","_lang","lang","lexicalI18nForLang","general","translations","CellComponent","DiffComponent","editorConfig","FieldComponent","path","serverProps","admin","views","generateImportMap","lexicalEditorArgs","generateSchemaMap","graphQLPopulationPromises","context","currentDepth","depth","draft","field","fieldPromises","findMany","flattenLocales","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","size","editorPopulationPromises","hooks","jsonSchema","validate","AlignFeature","BlockquoteFeature","CodeBlock","BlocksFeature","$createServerBlockNode","$isServerBlockNode","ServerBlockNode","$createServerInlineBlockNode","$isServerInlineBlockNode","ServerInlineBlockNode","convertHTMLToLexical","lexicalHTMLField","convertLexicalToMarkdown","convertMarkdownToLexical","getPayloadPopulateFn","getRestPopulateFn","DebugJsxConverterFeature","TestRecorderFeature","TreeViewFeature","EXPERIMENTAL_TableFeature","BoldFeature","InlineCodeFeature","ItalicFeature","StrikethroughFeature","SubscriptFeature","SuperscriptFeature","UnderlineFeature","HeadingFeature","HorizontalRuleFeature","IndentFeature","$createAutoLinkNode","$isAutoLinkNode","AutoLinkNode","$createLinkNode","$isLinkNode","LinkNode","LinkFeature","ChecklistFeature","OrderedListFeature","UnorderedListFeature","ParagraphFeature","RelationshipFeature","RelationshipServerNode","defaultColors","TextStateFeature","FixedToolbarFeature","InlineToolbarFeature","createNode","UploadFeature","UploadServerNode","defaultEditorConfig","defaultEditorLexicalConfig","loadFeatures","sortFeaturesForOptimalLoading","sanitizeServerEditorConfig","sanitizeServerFeatures","getEnabledNodes","getEnabledNodesFromServerNodes","DETAIL_TYPE_TO_DETAIL","DOUBLE_LINE_BREAK","ELEMENT_FORMAT_TO_TYPE","ELEMENT_TYPE_TO_FORMAT","IS_ALL_FORMATTING","LTR_REGEX","NodeFormat","NON_BREAKING_SPACE","RTL_REGEX","TEXT_MODE_TO_TYPE","TEXT_TYPE_TO_FORMAT","TEXT_TYPE_TO_MODE","sanitizeUrl","validateUrl","$convertFromMarkdownString","defaultRichTextValue","populate","buildDefaultEditorState","buildEditorState","createServerFeature","editorConfigFactory","extractPropsFromJSXPropsString","extractFrontmatter","frontmatterToObject","objectToFrontmatter","propsToJSXString","upgradeLexicalData"],"sources":["../src/index.ts"],"sourcesContent":["import type { GenericLanguages, GenericTranslationsObject } from '@payloadcms/translations'\n\nimport { checkDependencies, deepMergeSimple } from 'payload'\n\nimport type { FeatureProviderServer, ResolvedServerFeatureMap } from './features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from './lexical/config/types.js'\nimport type {\n AdapterProps,\n LexicalEditorProps,\n LexicalRichTextAdapterProvider,\n} from './types/index.js'\n\nimport { getLexicalHooks } from './hooks.js'\nimport { i18n } from './i18n.js'\nimport { defaultEditorFeatures } from './lexical/config/server/default.js'\nimport { populateLexicalPopulationPromises } from './populateGraphQL/populateLexicalPopulationPromises.js'\nimport { getFieldToJSONSchema } from './types/schema.js'\nimport { featuresInputToEditorConfig } from './utilities/editorConfigFactory.js'\nimport { getGenerateImportMap } from './utilities/generateImportMap.js'\nimport { getGenerateSchemaMap } from './utilities/generateSchemaMap.js'\nimport { getDefaultSanitizedEditorConfig } from './utilities/getDefaultSanitizedEditorConfig.js'\nimport { richTextValidateHOC } from './validate/index.js'\n\nlet checkedDependencies = false\n\nexport const lexicalTargetVersion = '0.45.0'\n\nexport function lexicalEditor(args?: LexicalEditorProps): LexicalRichTextAdapterProvider {\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.PAYLOAD_DISABLE_DEPENDENCY_CHECKER !== 'true' &&\n !checkedDependencies\n ) {\n checkedDependencies = true\n void checkDependencies({\n dependencyGroups: [\n {\n name: 'lexical',\n dependencies: [\n 'lexical',\n '@lexical/headless',\n '@lexical/link',\n '@lexical/list',\n '@lexical/mark',\n '@lexical/react',\n '@lexical/rich-text',\n '@lexical/selection',\n '@lexical/utils',\n ],\n targetVersion: lexicalTargetVersion,\n },\n ],\n })\n }\n return async ({ config, isRoot, parentIsLocalized }) => {\n let features: FeatureProviderServer<unknown, unknown, unknown>[] = []\n let resolvedFeatureMap: ResolvedServerFeatureMap\n\n let finalSanitizedEditorConfig: SanitizedServerEditorConfig // For server only\n if (!args || (!args.features && !args.lexical)) {\n finalSanitizedEditorConfig = await getDefaultSanitizedEditorConfig({\n config,\n parentIsLocalized,\n })\n\n features = defaultEditorFeatures\n\n resolvedFeatureMap = finalSanitizedEditorConfig.resolvedFeatureMap\n } else {\n const result = await featuresInputToEditorConfig({\n config,\n features: args?.features,\n isRoot,\n lexical: args?.lexical,\n parentIsLocalized,\n })\n finalSanitizedEditorConfig = result.sanitizedConfig\n features = result.features\n resolvedFeatureMap = result.resolvedFeatureMap\n }\n\n const featureI18n: Partial<GenericLanguages> = finalSanitizedEditorConfig.features.i18n\n const supportedLanguages = config.i18n?.supportedLanguages\n const supportedLanguagesToMerge: Partial<GenericLanguages> = {}\n for (const _lang in supportedLanguages) {\n if (!(_lang in i18n)) {\n if (featureI18n[_lang as keyof typeof i18n]) {\n supportedLanguagesToMerge[_lang as keyof typeof i18n] =\n featureI18n[_lang as keyof typeof i18n]\n }\n continue\n }\n const lang = _lang as keyof typeof i18n\n const lexicalI18nForLang = ((featureI18n[lang] ??= {}).lexical ??=\n {}) as GenericTranslationsObject\n\n lexicalI18nForLang.general = i18n[lang] ?? {}\n supportedLanguagesToMerge[lang] = featureI18n[lang]\n }\n\n config.i18n.translations = deepMergeSimple(config.i18n.translations, supportedLanguagesToMerge)\n\n return {\n CellComponent: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell',\n DiffComponent: '@payloadcms/richtext-lexical/rsc#LexicalDiffComponent',\n editorConfig: finalSanitizedEditorConfig,\n features,\n FieldComponent: {\n path: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalField',\n serverProps: {\n admin: args?.admin,\n views: args?.views,\n // SanitizedEditorConfig is manually passed by `renderField` in `fieldSchemasToFormState/renderField.tsx`\n // in order to reduce the size of the field schema\n },\n },\n generateImportMap: getGenerateImportMap({\n lexicalEditorArgs: args,\n resolvedFeatureMap,\n }),\n generateSchemaMap: getGenerateSchemaMap({\n resolvedFeatureMap,\n }),\n graphQLPopulationPromises({\n context,\n currentDepth,\n depth,\n draft,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n }) {\n // check if there are any features with nodes which have populationPromises for this field\n if (finalSanitizedEditorConfig?.features?.graphQLPopulationPromises?.size) {\n populateLexicalPopulationPromises({\n context,\n currentDepth: currentDepth ?? 0,\n depth,\n draft,\n editorPopulationPromises: finalSanitizedEditorConfig.features.graphQLPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n })\n }\n },\n hooks: getLexicalHooks({\n editorConfig: finalSanitizedEditorConfig,\n }),\n jsonSchema: getFieldToJSONSchema({ editorConfig: finalSanitizedEditorConfig }),\n validate: richTextValidateHOC({\n editorConfig: finalSanitizedEditorConfig,\n }),\n }\n }\n}\n\nexport { AlignFeature } from './features/align/server/index.js'\nexport { BlockquoteFeature } from './features/blockquote/server/index.js'\nexport { CodeBlock } from './features/blocks/premade/CodeBlock/index.js'\nexport { BlocksFeature } from './features/blocks/server/index.js'\nexport type {\n BlocksFeatureProps,\n LexicalBlockClientProps,\n LexicalBlockLabelClientProps,\n LexicalBlockLabelServerProps,\n LexicalBlockServerProps,\n LexicalInlineBlockClientProps,\n LexicalInlineBlockLabelClientProps,\n LexicalInlineBlockLabelServerProps,\n LexicalInlineBlockServerProps,\n} from './features/blocks/server/index.js'\n\nexport {\n $createServerBlockNode,\n $isServerBlockNode,\n ServerBlockNode,\n} from './features/blocks/server/nodes/BlocksNode.js'\nexport {\n $createServerInlineBlockNode,\n $isServerInlineBlockNode,\n ServerInlineBlockNode,\n} from './features/blocks/server/nodes/InlineBlocksNode.js'\n\nexport type { BlockFields, InlineBlockFields } from './features/blocks/server/schema.js'\n\nexport { convertHTMLToLexical } from './features/converters/htmlToLexical/index.js'\n\nexport { lexicalHTMLField } from './features/converters/lexicalToHtml/async/field/index.js'\n\nexport { convertLexicalToMarkdown } from './features/converters/lexicalToMarkdown/index.js'\nexport { convertMarkdownToLexical } from './features/converters/markdownToLexical/index.js'\nexport { getPayloadPopulateFn } from './features/converters/utilities/payloadPopulateFn.js'\n\nexport { getRestPopulateFn } from './features/converters/utilities/restPopulateFn.js'\nexport { DebugJsxConverterFeature } from './features/debug/jsxConverter/server/index.js'\nexport { TestRecorderFeature } from './features/debug/testRecorder/server/index.js'\nexport { TreeViewFeature } from './features/debug/treeView/server/index.js'\nexport { EXPERIMENTAL_TableFeature } from './features/experimental_table/server/index.js'\nexport { BoldFeature } from './features/format/bold/feature.server.js'\nexport { InlineCodeFeature } from './features/format/inlineCode/feature.server.js'\n\nexport { ItalicFeature } from './features/format/italic/feature.server.js'\nexport { StrikethroughFeature } from './features/format/strikethrough/feature.server.js'\nexport { SubscriptFeature } from './features/format/subscript/feature.server.js'\nexport { SuperscriptFeature } from './features/format/superscript/feature.server.js'\nexport { UnderlineFeature } from './features/format/underline/feature.server.js'\nexport { HeadingFeature, type HeadingFeatureProps } from './features/heading/server/index.js'\nexport { HorizontalRuleFeature } from './features/horizontalRule/server/index.js'\n\nexport { IndentFeature } from './features/indent/server/index.js'\nexport {\n $createAutoLinkNode,\n $isAutoLinkNode,\n AutoLinkNode,\n} from './features/link/nodes/AutoLinkNode.js'\nexport { $createLinkNode, $isLinkNode, LinkNode } from './features/link/nodes/LinkNode.js'\n\nexport { LinkFeature, type LinkFeatureServerProps } from './features/link/server/index.js'\nexport type { LinkFields } from './features/link/server/schema.js'\n\nexport { ChecklistFeature } from './features/lists/checklist/server/index.js'\nexport { OrderedListFeature } from './features/lists/orderedList/server/index.js'\n\nexport { UnorderedListFeature } from './features/lists/unorderedList/server/index.js'\n\nexport { ParagraphFeature } from './features/paragraph/server/index.js'\n\nexport {\n RelationshipFeature,\n type RelationshipFeatureProps,\n} from './features/relationship/server/index.js'\n\nexport { RelationshipServerNode } from './features/relationship/server/nodes/RelationshipNode.js'\nexport type { RelationshipData } from './features/relationship/server/schema.js'\nexport { defaultColors } from './features/textState/defaultColors.js'\nexport { TextStateFeature } from './features/textState/feature.server.js'\n\nexport { FixedToolbarFeature } from './features/toolbars/fixed/server/index.js'\n\nexport { InlineToolbarFeature } from './features/toolbars/inline/server/index.js'\nexport type { ToolbarGroup, ToolbarGroupItem } from './features/toolbars/types.js'\nexport type {\n BaseClientFeatureProps,\n ClientFeature,\n ClientFeatureProviderMap,\n FeatureProviderClient,\n FeatureProviderProviderClient,\n PluginComponent,\n PluginComponentWithAnchor,\n ResolvedClientFeature,\n ResolvedClientFeatureMap,\n SanitizedClientFeatures,\n SanitizedPlugin,\n} from './features/typesClient.js'\n\nexport type {\n AfterChangeNodeHook,\n AfterChangeNodeHookArgs,\n AfterReadNodeHook,\n AfterReadNodeHookArgs,\n BaseNodeHookArgs,\n BeforeChangeNodeHook,\n BeforeChangeNodeHookArgs,\n BeforeValidateNodeHook,\n BeforeValidateNodeHookArgs,\n FeatureProviderProviderServer,\n FeatureProviderServer,\n NodeValidation,\n NodeWithHooks,\n PopulationPromise,\n ResolvedServerFeature,\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n ServerFeature,\n ServerFeatureProviderMap,\n} from './features/typesServer.js'\n\nexport { createNode } from './features/typeUtilities.js' // Only useful in feature.server.ts\n\nexport { UploadFeature } from './features/upload/server/index.js'\nexport type { UploadFeatureProps } from './features/upload/server/index.js'\n\nexport { UploadServerNode } from './features/upload/server/nodes/UploadNode.js'\nexport type { UploadData } from './features/upload/server/schema.js'\nexport type { EditorConfigContextType } from './lexical/config/client/EditorConfigProvider.js'\n\nexport {\n defaultEditorConfig,\n defaultEditorFeatures,\n defaultEditorLexicalConfig,\n} from './lexical/config/server/default.js'\nexport { loadFeatures, sortFeaturesForOptimalLoading } from './lexical/config/server/loader.js'\n\nexport {\n sanitizeServerEditorConfig,\n sanitizeServerFeatures,\n} from './lexical/config/server/sanitize.js'\nexport type {\n ClientEditorConfig,\n SanitizedClientEditorConfig,\n SanitizedServerEditorConfig,\n ServerEditorConfig,\n} from './lexical/config/types.js'\nexport type { AdapterProps }\n\nexport { getEnabledNodes, getEnabledNodesFromServerNodes } from './lexical/nodes/index.js'\n\nexport type {\n SlashMenuGroup,\n SlashMenuItem,\n} from './lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nexport {\n DETAIL_TYPE_TO_DETAIL,\n DOUBLE_LINE_BREAK,\n ELEMENT_FORMAT_TO_TYPE,\n ELEMENT_TYPE_TO_FORMAT,\n IS_ALL_FORMATTING,\n LTR_REGEX,\n NodeFormat,\n NON_BREAKING_SPACE,\n RTL_REGEX,\n TEXT_MODE_TO_TYPE,\n TEXT_TYPE_TO_FORMAT,\n TEXT_TYPE_TO_MODE,\n} from './lexical/utils/nodeFormat.js'\n\nexport { sanitizeUrl, validateUrl } from './lexical/utils/url.js'\n\nexport { $convertFromMarkdownString } from './lexical-proxy/@lexical-markdown.js'\n\nexport { defaultRichTextValue } from './populateGraphQL/defaultValue.js'\nexport { populate } from './populateGraphQL/populate.js'\nexport type {\n ClientFeaturesMap,\n LexicalEditorNodeMap,\n LexicalEditorProps,\n LexicalEditorViewMap,\n LexicalFieldAdminProps,\n LexicalRichTextAdapter,\n NodeMapValue,\n SerializedNodeBase,\n ViewMapBlockComponentProps,\n} from './types/index.js'\n\nexport type * from './types/nodeTypes.js'\n\nexport { buildDefaultEditorState, buildEditorState } from './utilities/buildEditorState.js'\nexport { createServerFeature } from './utilities/createServerFeature.js'\n\nexport { editorConfigFactory } from './utilities/editorConfigFactory.js'\nexport type { FieldsDrawerProps } from './utilities/fieldsDrawer/Drawer.js'\n\nexport { extractPropsFromJSXPropsString } from './utilities/jsx/extractPropsFromJSXPropsString.js'\n\nexport {\n extractFrontmatter,\n frontmatterToObject,\n objectToFrontmatter,\n propsToJSXString,\n} from './utilities/jsx/jsx.js'\nexport { upgradeLexicalData } from './utilities/upgradeLexicalData/index.js'\n"],"mappings":"AAEA,SAASA,iBAAiB,EAAEC,eAAe,QAAQ;AAUnD,SAASC,eAAe,QAAQ;AAChC,SAASC,IAAI,QAAQ;AACrB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,iCAAiC,QAAQ;AAClD,SAASC,oBAAoB,QAAQ;AACrC,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,oBAAoB,QAAQ;AACrC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,+BAA+B,QAAQ;AAChD,SAASC,mBAAmB,QAAQ;AAEpC,IAAIC,mBAAA,GAAsB;AAE1B,OAAO,MAAMC,oBAAA,GAAuB;AAEpC,OAAO,SAASC,cAAcC,IAAyB;EACrD,IACEC,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,gBACzBF,OAAA,CAAQC,GAAG,CAACE,kCAAkC,KAAK,UACnD,CAACP,mBAAA,EACD;IACAA,mBAAA,GAAsB;IACtB,KAAKZ,iBAAA,CAAkB;MACrBoB,gBAAA,EAAkB,CAChB;QACEC,IAAA,EAAM;QACNC,YAAA,EAAc,CACZ,WACA,qBACA,iBACA,iBACA,iBACA,kBACA,sBACA,sBACA,iBACD;QACDC,aAAA,EAAeV;MACj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AQ;AAEvC,SAASC,aAAa,QAAQ;AAC9B,SAASC,gBAAgB,QAAQ;AAEjC,SAASC,mBAAmB,QAAQ;AAEpC,SAASC,oBAAoB,QAAQ;AAsCrC,SAASC,UAAU,QAAQ,8BAA6B,CAAC;AAEzD,SAASC,aAAa,QAAQ;AAG9B,SAASC,gBAAgB,QAAQ;AAIjC,SACEC,mBAAmB,EACnBrH,qBAAqB,EACrBsH,0BAA0B,QACrB;AACP,SAASC,YAAY,EAAEC,6BAA6B,QAAQ;AAE5D,SACEC,0BAA0B,EAC1BC,sBAAsB,QACjB;AASP,SAASC,eAAe,EAAEC,8BAA8B,QAAQ;AAMhE,SACEC,qBAAqB,EACrBC,iBAAiB,EACjBC,sBAAsB,EACtBC,sBAAsB,EACtBC,iBAAiB,EACjBC,SAAS,EACTC,UAAU,EACVC,kBAAkB,EAClBC,SAAS,EACTC,iBAAiB,EACjBC,mBAAmB,EACnBC,iBAAiB,QACZ;AAEP,SAASC,WAAW,EAAEC,WAAW,QAAQ;AAEzC,SAASC,0BAA0B,QAAQ;AAE3C,SAASC,oBAAoB,QAAQ;AACrC,SAASC,QAAQ,QAAQ;AAezB,SAASC,uBAAuB,EAAEC,gBAAgB,QAAQ;AAC1D,SAASC,mBAAmB,QAAQ;AAEpC,SAASC,mBAAmB,QAAQ;AAGpC,SAASC,8BAA8B,QAAQ;AAE/C,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,mBAAmB,EACnBC,gBAAgB,QACX;AACP,SAASC,kBAAkB,QAAQ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lexical/plugins/MarkdownShortcut/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAS1C,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lexical/plugins/MarkdownShortcut/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAS1C,CAAA"}
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
 
3
3
  import { c as _c } from "react/compiler-runtime";
4
+ import { registerMarkdownShortcuts } from '@lexical/markdown';
4
5
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
5
6
  import * as React from 'react';
6
- import { registerMarkdownShortcuts } from '../../../packages/@lexical/markdown/MarkdownShortcuts.js';
7
7
  import { useEditorConfigContext } from '../../config/client/EditorConfigProvider.js';
8
8
  export const MarkdownShortcutPlugin = () => {
9
9
  const $ = _c(4);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","React","registerMarkdownShortcuts","useEditorConfigContext","MarkdownShortcutPlugin","$","editorConfig","editor","t0","t1","features","markdownTransformers","useEffect"],"sources":["../../../../src/lexical/plugins/MarkdownShortcut/index.tsx"],"sourcesContent":["'use client'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport * as React from 'react'\n\nimport { registerMarkdownShortcuts } from '../../../packages/@lexical/markdown/MarkdownShortcuts.js'\nimport { useEditorConfigContext } from '../../config/client/EditorConfigProvider.js'\n\nexport const MarkdownShortcutPlugin: React.FC = () => {\n const { editorConfig } = useEditorConfigContext()\n const [editor] = useLexicalComposerContext()\n\n React.useEffect(() => {\n return registerMarkdownShortcuts(editor, editorConfig.features.markdownTransformers ?? [])\n }, [editor, editorConfig.features.markdownTransformers])\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AAEA,SAASC,yBAAyB,QAAQ;AAC1C,YAAYC,KAAA,MAAW;AAEvB,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,sBAAsB,QAAQ;AAEvC,OAAO,MAAMC,sBAAA,GAAmCA,CAAA;EAAA,MAAAC,CAAA,GAAAN,EAAA;EAC9C;IAAAO;EAAA,IAAyBH,sBAAA;EACzB,OAAAI,MAAA,IAAiBP,yBAAA;EAAA,IAAAQ,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAJ,CAAA,QAAAE,MAAA,IAAAF,CAAA,QAAAC,YAAA,CAAAI,QAAA,CAAAC,oBAAA;IAEDH,EAAA,GAAAA,CAAA,KACPN,yBAAA,CAA0BK,MAAA,EAAQD,YAAA,CAAAI,QAAA,CAAAC,oBAAA,MAAgD;IACxFF,EAAA,IAACF,MAAA,EAAQD,YAAA,CAAAI,QAAA,CAAAC,oBAAA;IAA2CN,CAAA,MAAAE,MAAA;IAAAF,CAAA,MAAAC,YAAA,CAAAI,QAAA,CAAAC,oBAAA;IAAAN,CAAA,MAAAG,EAAA;IAAAH,CAAA,MAAAI,EAAA;EAAA;IAAAD,EAAA,GAAAH,CAAA;IAAAI,EAAA,GAAAJ,CAAA;EAAA;EAFvDJ,KAAA,CAAAW,SAAA,CAAgBJ,EAEhB,EAAGC,EAAoD;EAAA;AAAA,CAGzD","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["c","_c","registerMarkdownShortcuts","useLexicalComposerContext","React","useEditorConfigContext","MarkdownShortcutPlugin","$","editorConfig","editor","t0","t1","features","markdownTransformers","useEffect"],"sources":["../../../../src/lexical/plugins/MarkdownShortcut/index.tsx"],"sourcesContent":["'use client'\n\nimport { registerMarkdownShortcuts } from '@lexical/markdown'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport * as React from 'react'\n\nimport { useEditorConfigContext } from '../../config/client/EditorConfigProvider.js'\n\nexport const MarkdownShortcutPlugin: React.FC = () => {\n const { editorConfig } = useEditorConfigContext()\n const [editor] = useLexicalComposerContext()\n\n React.useEffect(() => {\n return registerMarkdownShortcuts(editor, editorConfig.features.markdownTransformers ?? [])\n }, [editor, editorConfig.features.markdownTransformers])\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AAEA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,yBAAyB,QAAQ;AAC1C,YAAYC,KAAA,MAAW;AAEvB,SAASC,sBAAsB,QAAQ;AAEvC,OAAO,MAAMC,sBAAA,GAAmCA,CAAA;EAAA,MAAAC,CAAA,GAAAN,EAAA;EAC9C;IAAAO;EAAA,IAAyBH,sBAAA;EACzB,OAAAI,MAAA,IAAiBN,yBAAA;EAAA,IAAAO,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAJ,CAAA,QAAAE,MAAA,IAAAF,CAAA,QAAAC,YAAA,CAAAI,QAAA,CAAAC,oBAAA;IAEDH,EAAA,GAAAA,CAAA,KACPR,yBAAA,CAA0BO,MAAA,EAAQD,YAAA,CAAAI,QAAA,CAAAC,oBAAA,MAAgD;IACxFF,EAAA,IAACF,MAAA,EAAQD,YAAA,CAAAI,QAAA,CAAAC,oBAAA;IAA2CN,CAAA,MAAAE,MAAA;IAAAF,CAAA,MAAAC,YAAA,CAAAI,QAAA,CAAAC,oBAAA;IAAAN,CAAA,MAAAG,EAAA;IAAAH,CAAA,MAAAI,EAAA;EAAA;IAAAD,EAAA,GAAAH,CAAA;IAAAI,EAAA,GAAAJ,CAAA;EAAA;EAFvDH,KAAA,CAAAU,SAAA,CAAgBJ,EAEhB,EAAGC,EAAoD;EAAA;AAAA,CAGzD","ignoreList":[]}
@@ -1,4 +1,4 @@
1
+ import type { ElementTransformer } from '@lexical/markdown';
1
2
  import type { ElementNode } from 'lexical';
2
- import type { ElementTransformer } from '../../../packages/@lexical/markdown/MarkdownTransformers.js';
3
3
  export declare const createBlockNode: (createNode: (match: Array<string>) => ElementNode) => ElementTransformer["replace"];
4
4
  //# sourceMappingURL=createBlockNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createBlockNode.d.ts","sourceRoot":"","sources":["../../../../src/lexical/utils/markdown/createBlockNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6DAA6D,CAAA;AAErG,eAAO,MAAM,eAAe,GAC1B,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,WAAW,KAChD,kBAAkB,CAAC,SAAS,CAS9B,CAAA"}
1
+ {"version":3,"file":"createBlockNode.d.ts","sourceRoot":"","sources":["../../../../src/lexical/utils/markdown/createBlockNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,eAAO,MAAM,eAAe,GAC1B,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,WAAW,KAChD,kBAAkB,CAAC,SAAS,CAS9B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"createBlockNode.js","names":["createBlockNode","createNode","parentNode","children","match","node","append","replace","select"],"sources":["../../../../src/lexical/utils/markdown/createBlockNode.ts"],"sourcesContent":["import type { ElementNode } from 'lexical'\n\nimport type { ElementTransformer } from '../../../packages/@lexical/markdown/MarkdownTransformers.js'\n\nexport const createBlockNode = (\n createNode: (match: Array<string>) => ElementNode,\n): ElementTransformer['replace'] => {\n return (parentNode, children, match) => {\n const node = createNode(match)\n if (node) {\n node.append(...children)\n parentNode.replace(node)\n node.select(0, 0)\n }\n }\n}\n"],"mappings":"AAIA,OAAO,MAAMA,eAAA,GACXC,UAAA;EAEA,OAAO,CAACC,UAAA,EAAYC,QAAA,EAAUC,KAAA;IAC5B,MAAMC,IAAA,GAAOJ,UAAA,CAAWG,KAAA;IACxB,IAAIC,IAAA,EAAM;MACRA,IAAA,CAAKC,MAAM,IAAIH,QAAA;MACfD,UAAA,CAAWK,OAAO,CAACF,IAAA;MACnBA,IAAA,CAAKG,MAAM,CAAC,GAAG;IACjB;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"createBlockNode.js","names":["createBlockNode","createNode","parentNode","children","match","node","append","replace","select"],"sources":["../../../../src/lexical/utils/markdown/createBlockNode.ts"],"sourcesContent":["import type { ElementTransformer } from '@lexical/markdown'\nimport type { ElementNode } from 'lexical'\n\nexport const createBlockNode = (\n createNode: (match: Array<string>) => ElementNode,\n): ElementTransformer['replace'] => {\n return (parentNode, children, match) => {\n const node = createNode(match)\n if (node) {\n node.append(...children)\n parentNode.replace(node)\n node.select(0, 0)\n }\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,eAAA,GACXC,UAAA;EAEA,OAAO,CAACC,UAAA,EAAYC,QAAA,EAAUC,KAAA;IAC5B,MAAMC,IAAA,GAAOJ,UAAA,CAAWG,KAAA;IACxB,IAAIC,IAAA,EAAM;MACRA,IAAA,CAAKC,MAAM,IAAIH,QAAA;MACfD,UAAA,CAAWK,OAAO,CAACF,IAAA;MACnBA,IAAA,CAAKG,MAAM,CAAC,GAAG;IACjB;EACF;AACF","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Payload-specific markdown normalization.
3
+ *
4
+ * This is the one piece of Payload's former `@lexical/markdown` fork that could
5
+ * not be replaced by the upstream package: upstream's `normalizeMarkdown` (not
6
+ * publicly exported) does not handle nested code fences and trims trailing
7
+ * whitespace from table rows, both of which Payload relies on for round
8
+ * tripping MDX documents. The rest of the markdown machinery (import, export,
9
+ * shortcuts and transformers) now comes from `@lexical/markdown` directly.
10
+ *
11
+ * `$convertFromMarkdownString` runs this before delegating the actual import to
12
+ * the upstream package.
13
+ */
14
+ /**
15
+ * Represents a CommonMark hard line break marker: either a trailing backslash
16
+ * or two-or-more trailing spaces.
17
+ *
18
+ * See https://spec.commonmark.org/0.31.2/#hard-line-breaks
19
+ */
20
+ export type MarkdownHardLineBreak = string;
21
+ /**
22
+ * Detects a CommonMark hard line break marker at the end of a raw line.
23
+ *
24
+ * @returns a tuple of `[textWithoutMarker, marker]` when a marker is found, otherwise null.
25
+ */
26
+ export declare function parseMarkdownHardLineBreak(line: string): [string, MarkdownHardLineBreak] | null;
27
+ export declare function normalizeMarkdown(input: string, shouldMergeAdjacentLines: boolean): string;
28
+ //# sourceMappingURL=normalizeMarkdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizeMarkdown.d.ts","sourceRoot":"","sources":["../../../../src/lexical/utils/markdown/normalizeMarkdown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAqBH;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAA;AAE1C;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,GAAG,IAAI,CAO/F;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,wBAAwB,EAAE,OAAO,GAAG,MAAM,CAgF1F"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Payload-specific markdown normalization.
3
+ *
4
+ * This is the one piece of Payload's former `@lexical/markdown` fork that could
5
+ * not be replaced by the upstream package: upstream's `normalizeMarkdown` (not
6
+ * publicly exported) does not handle nested code fences and trims trailing
7
+ * whitespace from table rows, both of which Payload relies on for round
8
+ * tripping MDX documents. The rest of the markdown machinery (import, export,
9
+ * shortcuts and transformers) now comes from `@lexical/markdown` directly.
10
+ *
11
+ * `$convertFromMarkdownString` runs this before delegating the actual import to
12
+ * the upstream package.
13
+ */ // These regexes are copied verbatim from `@lexical/markdown` so their matching
14
+ // semantics stay identical. They are only used with `.test()` here, so their
15
+ // capturing groups are unused in this module.
16
+ /* eslint-disable regexp/no-unused-capturing-group */const EMPTY_OR_WHITESPACE_ONLY = /^[\t ]*$/;
17
+ const ORDERED_LIST_REGEX = /^(\s*)(\d+)\.\s/;
18
+ const UNORDERED_LIST_REGEX = /^(\s*)[-*+]\s/;
19
+ const CHECK_LIST_REGEX = /^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i;
20
+ const HEADING_REGEX = /^(#{1,6})\s/;
21
+ const QUOTE_REGEX = /^>\s/;
22
+ const CODE_START_REGEX = /^[ \t]*(\\`\\`\\`|```)(\w+)?/;
23
+ const CODE_END_REGEX = /[ \t]*(\\`\\`\\`|```)$/;
24
+ const CODE_SINGLE_LINE_REGEX = /^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/;
25
+ const TABLE_ROW_REG_EXP = /^\|(.+)\|\s?$/;
26
+ const TABLE_ROW_DIVIDER_REG_EXP = /^(\| ?:?-*:? ?)+\|\s?$/;
27
+ const TAG_START_REGEX = /^[ \t]*<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i;
28
+ const TAG_END_REGEX = /^[ \t]*<\/[a-z_][\w-]*\s*>/i;
29
+ /**
30
+ * Detects a CommonMark hard line break marker at the end of a raw line.
31
+ *
32
+ * @returns a tuple of `[textWithoutMarker, marker]` when a marker is found, otherwise null.
33
+ */
34
+ export function parseMarkdownHardLineBreak(line) {
35
+ if (line.endsWith('\\')) {
36
+ return [line.slice(0, -1), '\\'];
37
+ }
38
+ const spaces = line.match(/^(.*?\S)( {2,})$/);
39
+ return spaces ? [spaces[1], spaces[2]] : null;
40
+ }
41
+ export function normalizeMarkdown(input, shouldMergeAdjacentLines) {
42
+ const lines = input.split('\n');
43
+ let inCodeBlock = false;
44
+ const sanitizedLines = [];
45
+ let nestedDeepCodeBlock = 0;
46
+ for (let i = 0; i < lines.length; i++) {
47
+ const line = lines[i];
48
+ const lastLine = sanitizedLines[sanitizedLines.length - 1];
49
+ // A hard line break marker on the current line only matters if another line follows it.
50
+ const hardLineBreak = i < lines.length - 1 ? parseMarkdownHardLineBreak(line) : null;
51
+ const lastLineHasHardLineBreak = lastLine !== undefined && parseMarkdownHardLineBreak(lastLine) !== null;
52
+ // Code blocks of ```single line``` don't toggle the inCodeBlock flag
53
+ if (CODE_SINGLE_LINE_REGEX.test(line)) {
54
+ sanitizedLines.push(line);
55
+ continue;
56
+ }
57
+ if (CODE_END_REGEX.test(line)) {
58
+ if (nestedDeepCodeBlock === 0) {
59
+ inCodeBlock = true;
60
+ }
61
+ if (nestedDeepCodeBlock === 1) {
62
+ inCodeBlock = false;
63
+ }
64
+ if (nestedDeepCodeBlock > 0) {
65
+ nestedDeepCodeBlock--;
66
+ }
67
+ sanitizedLines.push(line);
68
+ continue;
69
+ }
70
+ // Toggle inCodeBlock state when encountering start or end of a code block
71
+ if (CODE_START_REGEX.test(line)) {
72
+ inCodeBlock = true;
73
+ nestedDeepCodeBlock++;
74
+ sanitizedLines.push(line);
75
+ continue;
76
+ }
77
+ // If we are inside a code block, keep the line unchanged
78
+ if (inCodeBlock) {
79
+ sanitizedLines.push(line);
80
+ continue;
81
+ }
82
+ // In markdown the concept of "empty paragraphs" does not exist.
83
+ // Blocks must be separated by an empty line. Non-empty adjacent lines must be merged.
84
+ if (EMPTY_OR_WHITESPACE_ONLY.test(line) || EMPTY_OR_WHITESPACE_ONLY.test(lastLine) || !lastLine || HEADING_REGEX.test(lastLine) || HEADING_REGEX.test(line) || QUOTE_REGEX.test(line) || ORDERED_LIST_REGEX.test(line) || UNORDERED_LIST_REGEX.test(line) || CHECK_LIST_REGEX.test(line) || TABLE_ROW_REG_EXP.test(line) || TABLE_ROW_DIVIDER_REG_EXP.test(line) ||
85
+ // Don't merge the next line into a line that ends with a hard line break marker.
86
+ lastLineHasHardLineBreak || !shouldMergeAdjacentLines || TAG_START_REGEX.test(line) || TAG_END_REGEX.test(line) || TAG_START_REGEX.test(lastLine) || TAG_END_REGEX.test(lastLine) || CODE_END_REGEX.test(lastLine)) {
87
+ sanitizedLines.push(line);
88
+ } else {
89
+ // Preserve a trailing hard line break marker on the merged line so it survives import.
90
+ sanitizedLines[sanitizedLines.length - 1] = lastLine + ' ' + (hardLineBreak === null ? line.trim() : line.trimStart());
91
+ }
92
+ }
93
+ return sanitizedLines.join('\n');
94
+ }
95
+ //# sourceMappingURL=normalizeMarkdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizeMarkdown.js","names":["EMPTY_OR_WHITESPACE_ONLY","ORDERED_LIST_REGEX","UNORDERED_LIST_REGEX","CHECK_LIST_REGEX","HEADING_REGEX","QUOTE_REGEX","CODE_START_REGEX","CODE_END_REGEX","CODE_SINGLE_LINE_REGEX","TABLE_ROW_REG_EXP","TABLE_ROW_DIVIDER_REG_EXP","TAG_START_REGEX","TAG_END_REGEX","parseMarkdownHardLineBreak","line","endsWith","slice","spaces","match","normalizeMarkdown","input","shouldMergeAdjacentLines","lines","split","inCodeBlock","sanitizedLines","nestedDeepCodeBlock","i","length","lastLine","hardLineBreak","lastLineHasHardLineBreak","undefined","test","push","trim","trimStart","join"],"sources":["../../../../src/lexical/utils/markdown/normalizeMarkdown.ts"],"sourcesContent":["/**\n * Payload-specific markdown normalization.\n *\n * This is the one piece of Payload's former `@lexical/markdown` fork that could\n * not be replaced by the upstream package: upstream's `normalizeMarkdown` (not\n * publicly exported) does not handle nested code fences and trims trailing\n * whitespace from table rows, both of which Payload relies on for round\n * tripping MDX documents. The rest of the markdown machinery (import, export,\n * shortcuts and transformers) now comes from `@lexical/markdown` directly.\n *\n * `$convertFromMarkdownString` runs this before delegating the actual import to\n * the upstream package.\n */\n\n// These regexes are copied verbatim from `@lexical/markdown` so their matching\n// semantics stay identical. They are only used with `.test()` here, so their\n// capturing groups are unused in this module.\n/* eslint-disable regexp/no-unused-capturing-group */\n\nconst EMPTY_OR_WHITESPACE_ONLY = /^[\\t ]*$/\nconst ORDERED_LIST_REGEX = /^(\\s*)(\\d+)\\.\\s/\nconst UNORDERED_LIST_REGEX = /^(\\s*)[-*+]\\s/\nconst CHECK_LIST_REGEX = /^(\\s*)(?:-\\s)?\\s?(\\[(\\s|x)?\\])\\s/i\nconst HEADING_REGEX = /^(#{1,6})\\s/\nconst QUOTE_REGEX = /^>\\s/\nconst CODE_START_REGEX = /^[ \\t]*(\\\\`\\\\`\\\\`|```)(\\w+)?/\nconst CODE_END_REGEX = /[ \\t]*(\\\\`\\\\`\\\\`|```)$/\nconst CODE_SINGLE_LINE_REGEX = /^[ \\t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/\nconst TABLE_ROW_REG_EXP = /^\\|(.+)\\|\\s?$/\nconst TABLE_ROW_DIVIDER_REG_EXP = /^(\\| ?:?-*:? ?)+\\|\\s?$/\nconst TAG_START_REGEX = /^[ \\t]*<[a-z_][\\w-]*(?:\\s[^<>]*)?\\/?>/i\nconst TAG_END_REGEX = /^[ \\t]*<\\/[a-z_][\\w-]*\\s*>/i\n\n/**\n * Represents a CommonMark hard line break marker: either a trailing backslash\n * or two-or-more trailing spaces.\n *\n * See https://spec.commonmark.org/0.31.2/#hard-line-breaks\n */\nexport type MarkdownHardLineBreak = string\n\n/**\n * Detects a CommonMark hard line break marker at the end of a raw line.\n *\n * @returns a tuple of `[textWithoutMarker, marker]` when a marker is found, otherwise null.\n */\nexport function parseMarkdownHardLineBreak(line: string): [string, MarkdownHardLineBreak] | null {\n if (line.endsWith('\\\\')) {\n return [line.slice(0, -1), '\\\\']\n }\n\n const spaces = line.match(/^(.*?\\S)( {2,})$/)\n return spaces ? [spaces[1]!, spaces[2]!] : null\n}\n\nexport function normalizeMarkdown(input: string, shouldMergeAdjacentLines: boolean): string {\n const lines = input.split('\\n')\n let inCodeBlock = false\n const sanitizedLines: string[] = []\n let nestedDeepCodeBlock = 0\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]!\n const lastLine = sanitizedLines[sanitizedLines.length - 1]\n // A hard line break marker on the current line only matters if another line follows it.\n const hardLineBreak = i < lines.length - 1 ? parseMarkdownHardLineBreak(line) : null\n const lastLineHasHardLineBreak =\n lastLine !== undefined && parseMarkdownHardLineBreak(lastLine) !== null\n\n // Code blocks of ```single line``` don't toggle the inCodeBlock flag\n if (CODE_SINGLE_LINE_REGEX.test(line)) {\n sanitizedLines.push(line)\n continue\n }\n\n if (CODE_END_REGEX.test(line)) {\n if (nestedDeepCodeBlock === 0) {\n inCodeBlock = true\n }\n if (nestedDeepCodeBlock === 1) {\n inCodeBlock = false\n }\n if (nestedDeepCodeBlock > 0) {\n nestedDeepCodeBlock--\n }\n sanitizedLines.push(line)\n continue\n }\n\n // Toggle inCodeBlock state when encountering start or end of a code block\n if (CODE_START_REGEX.test(line)) {\n inCodeBlock = true\n nestedDeepCodeBlock++\n sanitizedLines.push(line)\n continue\n }\n\n // If we are inside a code block, keep the line unchanged\n if (inCodeBlock) {\n sanitizedLines.push(line)\n continue\n }\n\n // In markdown the concept of \"empty paragraphs\" does not exist.\n // Blocks must be separated by an empty line. Non-empty adjacent lines must be merged.\n if (\n EMPTY_OR_WHITESPACE_ONLY.test(line) ||\n EMPTY_OR_WHITESPACE_ONLY.test(lastLine!) ||\n !lastLine ||\n HEADING_REGEX.test(lastLine) ||\n HEADING_REGEX.test(line) ||\n QUOTE_REGEX.test(line) ||\n ORDERED_LIST_REGEX.test(line) ||\n UNORDERED_LIST_REGEX.test(line) ||\n CHECK_LIST_REGEX.test(line) ||\n TABLE_ROW_REG_EXP.test(line) ||\n TABLE_ROW_DIVIDER_REG_EXP.test(line) ||\n // Don't merge the next line into a line that ends with a hard line break marker.\n lastLineHasHardLineBreak ||\n !shouldMergeAdjacentLines ||\n TAG_START_REGEX.test(line) ||\n TAG_END_REGEX.test(line) ||\n TAG_START_REGEX.test(lastLine) ||\n TAG_END_REGEX.test(lastLine) ||\n CODE_END_REGEX.test(lastLine)\n ) {\n sanitizedLines.push(line)\n } else {\n // Preserve a trailing hard line break marker on the merged line so it survives import.\n sanitizedLines[sanitizedLines.length - 1] =\n lastLine + ' ' + (hardLineBreak === null ? line.trim() : line.trimStart())\n }\n }\n\n return sanitizedLines.join('\\n')\n}\n"],"mappings":"AAAA;;;;;;;;;;;;GAAA,CAcA;AACA;AACA;AACA,qDAEA,MAAMA,wBAAA,GAA2B;AACjC,MAAMC,kBAAA,GAAqB;AAC3B,MAAMC,oBAAA,GAAuB;AAC7B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AAe0B,IAAI,CAACJ,QAAA,GACpB;MACAJ,cAAA,CAAeS,IAAI,CAACpB,IAAA;IACtB,OAAO;MACL;MACAW,cAAc,CAACA,cAAA,CAAeG,MAAM,GAAG,EAAE,GACvCC,QAAA,GAAW,OAAOC,aAAA,KAAkB,OAAOhB,IAAA,CAAKqB,IAAI,KAAKrB,IAAA,CAAKsB,SAAS,EAAC;IAC5E;EACF;EAEA,OAAOX,cAAA,CAAeY,IAAI,CAAC;AAC7B","ignoreList":[]}
@@ -1,2 +1,41 @@
1
- export * from '../packages/@lexical/markdown/index.js';
1
+ /**
2
+ * Payload's markdown entrypoint.
3
+ *
4
+ * Previously Payload vendored a full copy of `@lexical/markdown` (it could not
5
+ * depend on the published package because, prior to lexical 0.42, importing it
6
+ * transitively pulled in `@lexical/code` and its `prismjs` dependency, which
7
+ * broke type generation). Since lexical 0.42 the markdown package depends on
8
+ * `@lexical/code-core` (no prism), so the vendored copy is no longer needed.
9
+ *
10
+ * This module re-exports the upstream package and only keeps the Payload
11
+ * specific behaviors that the fork added on top of it:
12
+ * - `$convertFromMarkdownString` merges adjacent lines by default
13
+ * (`shouldMergeAdjacentLines = true`), whereas upstream defaults to `false`.
14
+ * - The default transformer set excludes the upstream `CODE` and `LINK`
15
+ * transformers, since Payload provides those as features with its own node
16
+ * types.
17
+ * - Markdown is normalized with Payload's own `normalizeMarkdown` (handles
18
+ * nested code fences and preserves table-row whitespace) instead of the
19
+ * upstream normalizer, which is not exported and lacks those behaviors.
20
+ */
21
+ import type { ElementNode } from 'lexical';
22
+ import { type ElementTransformer, type MultilineElementTransformer, type TextFormatTransformer, type TextMatchTransformer, type Transformer } from '@lexical/markdown';
23
+ declare const ELEMENT_TRANSFORMERS: Array<ElementTransformer>;
24
+ declare const MULTILINE_ELEMENT_TRANSFORMERS: Array<MultilineElementTransformer>;
25
+ declare const TEXT_FORMAT_TRANSFORMERS: Array<TextFormatTransformer>;
26
+ declare const TEXT_MATCH_TRANSFORMERS: Array<TextMatchTransformer>;
27
+ declare const TRANSFORMERS: Array<Transformer>;
28
+ /**
29
+ * Renders markdown from a string. The selection is moved to the start after the operation.
30
+ *
31
+ * @param {boolean} [shouldPreserveNewLines] By setting this to true, new lines will be preserved between conversions
32
+ * @param {boolean} [shouldMergeAdjacentLines] By setting this to true, adjacent non empty lines will be merged according to commonmark spec: https://spec.commonmark.org/0.24/#example-177. Not applicable if shouldPreserveNewLines = true.
33
+ */
34
+ declare function $convertFromMarkdownString(markdown: string, transformers?: Array<Transformer>, node?: ElementNode, shouldPreserveNewLines?: boolean, shouldMergeAdjacentLines?: boolean): void;
35
+ /**
36
+ * Renders string from markdown. The selection is moved to the start after the operation.
37
+ */
38
+ declare function $convertToMarkdownString(transformers?: Array<Transformer>, node?: ElementNode, shouldPreserveNewLines?: boolean): string;
39
+ export { BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, CHECK_LIST, type ElementTransformer, HEADING, HIGHLIGHT, INLINE_CODE, ITALIC_STAR, ITALIC_UNDERSCORE, type MultilineElementTransformer, ORDERED_LIST, QUOTE, registerMarkdownShortcuts, STRIKETHROUGH, type TextFormatTransformer, type TextMatchTransformer, type Transformer, UNORDERED_LIST, } from '@lexical/markdown';
40
+ export { $convertFromMarkdownString, $convertToMarkdownString, ELEMENT_TRANSFORMERS, MULTILINE_ELEMENT_TRANSFORMERS, TEXT_FORMAT_TRANSFORMERS, TEXT_MATCH_TRANSFORMERS, TRANSFORMERS, };
2
41
  //# sourceMappingURL=@lexical-markdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"@lexical-markdown.d.ts","sourceRoot":"","sources":["../../src/lexical-proxy/@lexical-markdown.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAA"}
1
+ {"version":3,"file":"@lexical-markdown.d.ts","sourceRoot":"","sources":["../../src/lexical-proxy/@lexical-markdown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG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ACxB,oBAAoB,EACpB,8BAA8B,EAC9B,wBAAwB,EACxB,uBAAuB,EACvB,YAAY,GACb,CAAA"}
@@ -1,2 +1,57 @@
1
- export * from '../packages/@lexical/markdown/index.js';
1
+ /**
2
+ * Payload's markdown entrypoint.
3
+ *
4
+ * Previously Payload vendored a full copy of `@lexical/markdown` (it could not
5
+ * depend on the published package because, prior to lexical 0.42, importing it
6
+ * transitively pulled in `@lexical/code` and its `prismjs` dependency, which
7
+ * broke type generation). Since lexical 0.42 the markdown package depends on
8
+ * `@lexical/code-core` (no prism), so the vendored copy is no longer needed.
9
+ *
10
+ * This module re-exports the upstream package and only keeps the Payload
11
+ * specific behaviors that the fork added on top of it:
12
+ * - `$convertFromMarkdownString` merges adjacent lines by default
13
+ * (`shouldMergeAdjacentLines = true`), whereas upstream defaults to `false`.
14
+ * - The default transformer set excludes the upstream `CODE` and `LINK`
15
+ * transformers, since Payload provides those as features with its own node
16
+ * types.
17
+ * - Markdown is normalized with Payload's own `normalizeMarkdown` (handles
18
+ * nested code fences and preserves table-row whitespace) instead of the
19
+ * upstream normalizer, which is not exported and lacks those behaviors.
20
+ */import { $convertFromMarkdownString as $convertFromMarkdownStringUpstream, $convertToMarkdownString as $convertToMarkdownStringUpstream, BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, HEADING, HIGHLIGHT, INLINE_CODE, ITALIC_STAR, ITALIC_UNDERSCORE, ORDERED_LIST, QUOTE, STRIKETHROUGH, UNORDERED_LIST } from '@lexical/markdown';
21
+ import { normalizeMarkdown } from '../lexical/utils/markdown/normalizeMarkdown.js';
22
+ const ELEMENT_TRANSFORMERS = [HEADING, QUOTE, UNORDERED_LIST, ORDERED_LIST];
23
+ const MULTILINE_ELEMENT_TRANSFORMERS = [];
24
+ // Order of text format transformers matters:
25
+ //
26
+ // - code should go first as it prevents any transformations inside
27
+ // - then longer tags match (e.g. ** or __ should go before * or _)
28
+ const TEXT_FORMAT_TRANSFORMERS = [INLINE_CODE, BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, HIGHLIGHT, ITALIC_STAR, ITALIC_UNDERSCORE, STRIKETHROUGH];
29
+ const TEXT_MATCH_TRANSFORMERS = [];
30
+ const TRANSFORMERS = [...ELEMENT_TRANSFORMERS, ...MULTILINE_ELEMENT_TRANSFORMERS, ...TEXT_FORMAT_TRANSFORMERS, ...TEXT_MATCH_TRANSFORMERS];
31
+ /**
32
+ * Renders markdown from a string. The selection is moved to the start after the operation.
33
+ *
34
+ * @param {boolean} [shouldPreserveNewLines] By setting this to true, new lines will be preserved between conversions
35
+ * @param {boolean} [shouldMergeAdjacentLines] By setting this to true, adjacent non empty lines will be merged according to commonmark spec: https://spec.commonmark.org/0.24/#example-177. Not applicable if shouldPreserveNewLines = true.
36
+ */
37
+ function $convertFromMarkdownString(markdown, transformers = TRANSFORMERS, node, shouldPreserveNewLines = false, shouldMergeAdjacentLines = true) {
38
+ if (shouldPreserveNewLines) {
39
+ return $convertFromMarkdownStringUpstream(markdown, transformers, node, true);
40
+ }
41
+ // Normalize with Payload's normalizer, then let upstream import the result.
42
+ // Passing shouldMergeAdjacentLines = false stops upstream's internal
43
+ // normalizer from re-merging the already normalized markdown; for non empty
44
+ // lines it preserves trailing whitespace and hard line breaks, so the only
45
+ // observable difference is that whitespace-only lines collapse to empty.
46
+ const sanitizedMarkdown = normalizeMarkdown(markdown, shouldMergeAdjacentLines);
47
+ return $convertFromMarkdownStringUpstream(sanitizedMarkdown, transformers, node, false, false);
48
+ }
49
+ /**
50
+ * Renders string from markdown. The selection is moved to the start after the operation.
51
+ */
52
+ function $convertToMarkdownString(transformers = TRANSFORMERS, node, shouldPreserveNewLines = false) {
53
+ return $convertToMarkdownStringUpstream(transformers, node, shouldPreserveNewLines);
54
+ }
55
+ export { BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, CHECK_LIST, HEADING, HIGHLIGHT, INLINE_CODE, ITALIC_STAR, ITALIC_UNDERSCORE, ORDERED_LIST, QUOTE, registerMarkdownShortcuts, STRIKETHROUGH, UNORDERED_LIST } from '@lexical/markdown';
56
+ export { $convertFromMarkdownString, $convertToMarkdownString, ELEMENT_TRANSFORMERS, MULTILINE_ELEMENT_TRANSFORMERS, TEXT_FORMAT_TRANSFORMERS, TEXT_MATCH_TRANSFORMERS, TRANSFORMERS };
2
57
  //# sourceMappingURL=@lexical-markdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"@lexical-markdown.js","names":[],"sources":["../../src/lexical-proxy/@lexical-markdown.ts"],"sourcesContent":["export * from '../packages/@lexical/markdown/index.js'\n"],"mappings":"AAAA,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"@lexical-markdown.js","names":["$convertFromMarkdownString","$convertFromMarkdownStringUpstream","$convertToMarkdownString","$convertToMarkdownStringUpstream","BOLD_ITALIC_STAR","BOLD_ITALIC_UNDERSCORE","BOLD_STAR","BOLD_UNDERSCORE","HEADING","HIGHLIGHT","INLINE_CODE","ITALIC_STAR","ITALIC_UNDERSCORE","ORDERED_LIST","QUOTE","STRIKETHROUGH","UNORDERED_LIST","normalizeMarkdown","ELEMENT_TRANSFORMERS","MULTILINE_ELEMENT_TRANSFORMERS","TEXT_FORMAT_TRANSFORMERS","TEXT_MATCH_TRANSFORMERS","TRANSFORMERS","markdown","transformers","node","shouldPreserveNewLines","shouldMergeAdjacentLines","sanitizedMarkdown","CHECK_LIST","registerMarkdownShortcuts"],"sources":["../../src/lexical-proxy/@lexical-markdown.ts"],"sourcesContent":["/**\n * Payload's markdown entrypoint.\n *\n * Previously Payload vendored a full copy of `@lexical/markdown` (it could not\n * depend on the published package because, prior to lexical 0.42, importing it\n * transitively pulled in `@lexical/code` and its `prismjs` dependency, which\n * broke type generation). Since lexical 0.42 the markdown package depends on\n * `@lexical/code-core` (no prism), so the vendored copy is no longer needed.\n *\n * This module re-exports the upstream package and only keeps the Payload\n * specific behaviors that the fork added on top of it:\n * - `$convertFromMarkdownString` merges adjacent lines by default\n * (`shouldMergeAdjacentLines = true`), whereas upstream defaults to `false`.\n * - The default transformer set excludes the upstream `CODE` and `LINK`\n * transformers, since Payload provides those as features with its own node\n * types.\n * - Markdown is normalized with Payload's own `normalizeMarkdown` (handles\n * nested code fences and preserves table-row whitespace) instead of the\n * upstream normalizer, which is not exported and lacks those behaviors.\n */\nimport type { ElementNode } from 'lexical'\n\nimport {\n $convertFromMarkdownString as $convertFromMarkdownStringUpstream,\n $convertToMarkdownString as $convertToMarkdownStringUpstream,\n BOLD_ITALIC_STAR,\n BOLD_ITALIC_UNDERSCORE,\n BOLD_STAR,\n BOLD_UNDERSCORE,\n type ElementTransformer,\n HEADING,\n HIGHLIGHT,\n INLINE_CODE,\n ITALIC_STAR,\n ITALIC_UNDERSCORE,\n type MultilineElementTransformer,\n ORDERED_LIST,\n QUOTE,\n STRIKETHROUGH,\n type TextFormatTransformer,\n type TextMatchTransformer,\n type Transformer,\n UNORDERED_LIST,\n} from '@lexical/markdown'\n\nimport { normalizeMarkdown } from '../lexical/utils/markdown/normalizeMarkdown.js'\n\nconst ELEMENT_TRANSFORMERS: Array<ElementTransformer> = [\n HEADING,\n QUOTE,\n UNORDERED_LIST,\n ORDERED_LIST,\n]\n\nconst MULTILINE_ELEMENT_TRANSFORMERS: Array<MultilineElementTransformer> = []\n\n// Order of text format transformers matters:\n//\n// - code should go first as it prevents any transformations inside\n// - then longer tags match (e.g. ** or __ should go before * or _)\nconst TEXT_FORMAT_TRANSFORMERS: Array<TextFormatTransformer> = [\n INLINE_CODE,\n BOLD_ITALIC_STAR,\n BOLD_ITALIC_UNDERSCORE,\n BOLD_STAR,\n BOLD_UNDERSCORE,\n HIGHLIGHT,\n ITALIC_STAR,\n ITALIC_UNDERSCORE,\n STRIKETHROUGH,\n]\n\nconst TEXT_MATCH_TRANSFORMERS: Array<TextMatchTransformer> = []\n\nconst TRANSFORMERS: Array<Transformer> = [\n ...ELEMENT_TRANSFORMERS,\n ...MULTILINE_ELEMENT_TRANSFORMERS,\n ...TEXT_FORMAT_TRANSFORMERS,\n ...TEXT_MATCH_TRANSFORMERS,\n]\n\n/**\n * Renders markdown from a string. The selection is moved to the start after the operation.\n *\n * @param {boolean} [shouldPreserveNewLines] By setting this to true, new lines will be preserved between conversions\n * @param {boolean} [shouldMergeAdjacentLines] By setting this to true, adjacent non empty lines will be merged according to commonmark spec: https://spec.commonmark.org/0.24/#example-177. Not applicable if shouldPreserveNewLines = true.\n */\nfunction $convertFromMarkdownString(\n markdown: string,\n transformers: Array<Transformer> = TRANSFORMERS,\n node?: ElementNode,\n shouldPreserveNewLines = false,\n shouldMergeAdjacentLines = true,\n): void {\n if (shouldPreserveNewLines) {\n return $convertFromMarkdownStringUpstream(markdown, transformers, node, true)\n }\n\n // Normalize with Payload's normalizer, then let upstream import the result.\n // Passing shouldMergeAdjacentLines = false stops upstream's internal\n // normalizer from re-merging the already normalized markdown; for non empty\n // lines it preserves trailing whitespace and hard line breaks, so the only\n // observable difference is that whitespace-only lines collapse to empty.\n const sanitizedMarkdown = normalizeMarkdown(markdown, shouldMergeAdjacentLines)\n return $convertFromMarkdownStringUpstream(sanitizedMarkdown, transformers, node, false, false)\n}\n\n/**\n * Renders string from markdown. The selection is moved to the start after the operation.\n */\nfunction $convertToMarkdownString(\n transformers: Array<Transformer> = TRANSFORMERS,\n node?: ElementNode,\n shouldPreserveNewLines: boolean = false,\n): string {\n return $convertToMarkdownStringUpstream(transformers, node, shouldPreserveNewLines)\n}\n\nexport {\n BOLD_ITALIC_STAR,\n BOLD_ITALIC_UNDERSCORE,\n BOLD_STAR,\n BOLD_UNDERSCORE,\n CHECK_LIST,\n type ElementTransformer,\n HEADING,\n HIGHLIGHT,\n INLINE_CODE,\n ITALIC_STAR,\n ITALIC_UNDERSCORE,\n type MultilineElementTransformer,\n ORDERED_LIST,\n QUOTE,\n registerMarkdownShortcuts,\n STRIKETHROUGH,\n type TextFormatTransformer,\n type TextMatchTransformer,\n type Transformer,\n UNORDERED_LIST,\n} from '@lexical/markdown'\n\nexport {\n $convertFromMarkdownString,\n $convertToMarkdownString,\n ELEMENT_TRANSFORMERS,\n MULTILINE_ELEMENT_TRANSFORMERS,\n TEXT_FORMAT_TRANSFORMERS,\n TEXT_MATCH_TRANSFORMERS,\n TRANSFORMERS,\n}\n"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAsBA,SACEA,0BAAA,IAA8BC,kCAAkC,EAChEC,wBAAA,IAA4BC,gCAAgC,EAC5DC,gBAAgB,EAChBC,sBAAsB,EACtBC,SAAS,EACTC,eAAe,EAEfC,OAAO,EACPC,SAAS,EACTC,WAAW,EACXC,WAAW,EACXC,iBAAiB,EAEjBC,YAAY,EACZC,KAAK,EACLC,aAAa,EAIbC,cAAc,QACT;AAEP,SAASC,iBAAiB,QAAQ;AAElC,MAAMC,oBAAA,GAAkD,CACtDV,OAAA,EACAM,KAAA,EACAE,cAAA,EACAH,YAAA,CACD;AAED,MAAMM,8BAAA,GAAqE,EAAE;AAE7E;AACA;AACA;AACA;AACA,MAAMC,wBAAA,GAAyD,CAC7DV,WAAA,EACAN,gBAAA,EACAC,sBAAA,EACAC,SAAA,EACAC,eAAA,EACAE,SAAA,EACAE,WAAA,EACAC,iBAAA,EACAG,aAAA,CACD;AAED,MAAMM,uBAAA,GAAuD,EAAE;AAE/D,MAAMC,YAAA,GAAmC,C,GACpCJ,oBAAA,E,GACAC,8BAAA,E,GACAC,wBAAA,E,GACAC,uBAAA,CACJ;AAED;;;;;;AAMA,SAASrB,2BACPuB,QAAgB,EAChBC,YAAA,GAAmCF,YAAY,EAC/CG,IAAkB,EAClBC,sBAAA,GAAyB,KAAK,EAC9BC,wBAAA,GAA2B,IAAI;EAE/B,IAAID,sBAAA,EAAwB;IAC1B,OAAOzB,kCAAA,CAAmCsB,QAAA,EAAUC,YAAA,EAAcC,IAAA,EAAM;EAC1E;EAEA;EACA;EACA;EACA;EACA;EACA,MAAMG,iBAAA,GAAoBX,iBAAA,CAAkBM,QAAA,EAAUI,wBAAA;EACtD,OAAO1B,kCAAA,CAAmC2B,iBAAA,EAAmBJ,YAAA,EAAcC,IAAA,EAAM,OAAO;AAC1F;AAEA;;;AAGA,SAASvB,yBACPsB,YAAA,GAAmCF,YAAY,EAC/CG,IAAkB,EAClBC,sBAAA,GAAkC,KAAK;EAEvC,OAAOvB,gCAAA,CAAiCqB,YAAA,EAAcC,IAAA,EAAMC,sBAAA;AAC9D;AAEA,SACEtB,gBAAgB,EAChBC,sBAAsB,EACtBC,SAAS,EACTC,eAAe,EACfsB,UAAU,EAEVrB,OAAO,EACPC,SAAS,EACTC,WAAW,EACXC,WAAW,EACXC,iBAAiB,EAEjBC,YAAY,EACZC,KAAK,EACLgB,yBAAyB,EACzBf,aAAa,EAIbC,cAAc,QACT;AAEP,SACEhB,0BAA0B,EAC1BE,wBAAwB,EACxBgB,oBAAoB,EACpBC,8BAA8B,EAC9BC,wBAAwB,EACxBC,uBAAuB,EACvBC,YAAY","ignoreList":[]}
@@ -0,0 +1,89 @@
1
+ import { createHeadlessEditor } from '@lexical/headless';
2
+ import { LinkNode } from '@lexical/link';
3
+ import { ListItemNode, ListNode } from '@lexical/list';
4
+ import { HeadingNode, QuoteNode } from '@lexical/rich-text';
5
+ import { $getRoot, $isElementNode, $isLineBreakNode } from 'lexical';
6
+ import { describe, expect, it } from 'vitest';
7
+ import { $convertFromMarkdownString, $convertToMarkdownString } from './@lexical-markdown.js';
8
+ function createEditor() {
9
+ return createHeadlessEditor({
10
+ nodes: [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode]
11
+ });
12
+ }
13
+ function importMarkdown(markdown) {
14
+ const editor = createEditor();
15
+ editor.update(() => $convertFromMarkdownString(markdown), {
16
+ discrete: true
17
+ });
18
+ let result = {
19
+ hasLineBreak: false,
20
+ textContent: ''
21
+ };
22
+ editor.getEditorState().read(() => {
23
+ const firstChild = $getRoot().getFirstChild();
24
+ if (!$isElementNode(firstChild)) {
25
+ throw new Error('Expected an element block');
26
+ }
27
+ result = {
28
+ hasLineBreak: firstChild.getChildren().some(child => $isLineBreakNode(child)),
29
+ textContent: firstChild.getTextContent()
30
+ };
31
+ });
32
+ return result;
33
+ }
34
+ function roundTrip(markdown) {
35
+ const editor = createEditor();
36
+ editor.update(() => $convertFromMarkdownString(markdown), {
37
+ discrete: true
38
+ });
39
+ let output = '';
40
+ editor.getEditorState().read(() => {
41
+ output = $convertToMarkdownString();
42
+ });
43
+ return output;
44
+ }
45
+ // These tests guard the behavior that originally motivated dropping Payload's
46
+ // vendored @lexical/markdown fork: hard line breaks must survive markdown
47
+ // import (and round trip) even when adjacent lines are merged by default. The
48
+ // fix now lives in the upstream package (lexical 0.45, facebook/lexical#8402);
49
+ // these assert it still holds through Payload's wrapper.
50
+ describe('markdown hard line break import', () => {
51
+ it('should import a trailing-space hard break as a line break node with the marker stripped', () => {
52
+ const {
53
+ hasLineBreak,
54
+ textContent
55
+ } = importMarkdown(['foo ', 'bar'].join('\n'));
56
+ expect(hasLineBreak).toBe(true);
57
+ expect(textContent).toBe('foo\nbar');
58
+ });
59
+ it('should import a backslash hard break as a line break node with the marker stripped', () => {
60
+ const {
61
+ hasLineBreak,
62
+ textContent
63
+ } = importMarkdown('foo\\\nbar');
64
+ expect(hasLineBreak).toBe(true);
65
+ expect(textContent).toBe('foo\nbar');
66
+ });
67
+ });
68
+ describe('markdown hard line break round trip', () => {
69
+ it('should round trip a trailing-space hard break', () => {
70
+ const md = ['foo ', 'bar'].join('\n');
71
+ expect(roundTrip(md)).toBe(md);
72
+ });
73
+ it('should round trip a backslash hard break', () => {
74
+ const md = 'foo\\\nbar';
75
+ expect(roundTrip(md)).toBe(md);
76
+ });
77
+ it('should not introduce a hard break for a soft wrap', () => {
78
+ expect(roundTrip(['foo', 'bar'].join('\n'))).toBe('foo bar');
79
+ });
80
+ it('should round trip a hard break after formatted text', () => {
81
+ const md = '**foo** \nbar';
82
+ expect(roundTrip(md)).toBe(md);
83
+ });
84
+ it('should round trip a hard break after a link', () => {
85
+ const md = '[foo](https://payloadcms.com) \nbar';
86
+ expect(roundTrip(md)).toBe(md);
87
+ });
88
+ });
89
+ //# sourceMappingURL=@lexical-markdown.spec.js.map