@payloadcms/richtext-lexical 4.0.0-canary.2 → 4.0.0-canary.4

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 (261) hide show
  1. package/dist/exports/client/Field-XH5C4HFU.js +2 -0
  2. package/dist/exports/client/Field-XH5C4HFU.js.map +7 -0
  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.d.ts +0 -1
  7. package/dist/exports/client/index.d.ts.map +1 -1
  8. package/dist/exports/client/index.js +19 -20
  9. package/dist/exports/client/index.js.map +4 -4
  10. package/dist/features/blockquote/client/index.js +2 -2
  11. package/dist/features/blockquote/client/index.js.map +1 -1
  12. package/dist/features/blockquote/server/index.js +2 -2
  13. package/dist/features/blockquote/server/index.js.map +1 -1
  14. package/dist/features/blocks/client/component/index.css +2 -2
  15. package/dist/features/blocks/client/componentInline/index.css +8 -8
  16. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts +1 -1
  17. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts.map +1 -1
  18. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js +1 -1
  19. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js.map +1 -1
  20. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts +1 -1
  21. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts.map +1 -1
  22. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js +5 -2
  23. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js.map +1 -1
  24. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts +1 -2
  25. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  26. package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
  27. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.css +1 -1
  28. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +2 -4
  29. package/dist/features/blocks/premade/CodeBlock/Component/index.css +5 -5
  30. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts +1 -1
  31. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  32. package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
  33. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  34. package/dist/features/converters/lexicalToMarkdown/index.js +1 -1
  35. package/dist/features/converters/lexicalToMarkdown/index.js.map +1 -1
  36. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  37. package/dist/features/converters/markdownToLexical/index.js +5 -2
  38. package/dist/features/converters/markdownToLexical/index.js.map +1 -1
  39. package/dist/features/debug/jsxConverter/client/plugin/style.css +2 -2
  40. package/dist/features/experimental_table/client/index.js +2 -2
  41. package/dist/features/experimental_table/client/index.js.map +1 -1
  42. package/dist/features/experimental_table/markdownTransformer.d.ts +2 -2
  43. package/dist/features/experimental_table/markdownTransformer.d.ts.map +1 -1
  44. package/dist/features/experimental_table/markdownTransformer.js +6 -3
  45. package/dist/features/experimental_table/markdownTransformer.js.map +1 -1
  46. package/dist/features/experimental_table/server/index.js +2 -2
  47. package/dist/features/experimental_table/server/index.js.map +1 -1
  48. package/dist/features/format/bold/feature.client.js +1 -1
  49. package/dist/features/format/bold/feature.client.js.map +1 -1
  50. package/dist/features/format/bold/feature.server.d.ts.map +1 -1
  51. package/dist/features/format/bold/feature.server.js +1 -1
  52. package/dist/features/format/bold/feature.server.js.map +1 -1
  53. package/dist/features/format/inlineCode/feature.client.js +1 -1
  54. package/dist/features/format/inlineCode/feature.client.js.map +1 -1
  55. package/dist/features/format/inlineCode/feature.server.d.ts.map +1 -1
  56. package/dist/features/format/inlineCode/feature.server.js +1 -1
  57. package/dist/features/format/inlineCode/feature.server.js.map +1 -1
  58. package/dist/features/format/italic/feature.client.js +1 -1
  59. package/dist/features/format/italic/feature.client.js.map +1 -1
  60. package/dist/features/format/italic/feature.server.d.ts.map +1 -1
  61. package/dist/features/format/italic/feature.server.js +1 -1
  62. package/dist/features/format/italic/feature.server.js.map +1 -1
  63. package/dist/features/format/strikethrough/feature.client.js +1 -1
  64. package/dist/features/format/strikethrough/feature.client.js.map +1 -1
  65. package/dist/features/format/strikethrough/feature.server.d.ts.map +1 -1
  66. package/dist/features/format/strikethrough/feature.server.js +1 -1
  67. package/dist/features/format/strikethrough/feature.server.js.map +1 -1
  68. package/dist/features/heading/client/index.js +2 -2
  69. package/dist/features/heading/client/index.js.map +1 -1
  70. package/dist/features/heading/markdownTransformer.d.ts +2 -2
  71. package/dist/features/heading/markdownTransformer.d.ts.map +1 -1
  72. package/dist/features/heading/markdownTransformer.js +6 -19
  73. package/dist/features/heading/markdownTransformer.js.map +1 -1
  74. package/dist/features/heading/server/index.js +2 -2
  75. package/dist/features/heading/server/index.js.map +1 -1
  76. package/dist/features/horizontalRule/client/index.js +2 -2
  77. package/dist/features/horizontalRule/client/index.js.map +1 -1
  78. package/dist/features/horizontalRule/client/markdownTransformer.d.ts +2 -2
  79. package/dist/features/horizontalRule/client/markdownTransformer.d.ts.map +1 -1
  80. package/dist/features/horizontalRule/client/markdownTransformer.js +1 -1
  81. package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
  82. package/dist/features/horizontalRule/client/plugin/index.css +2 -2
  83. package/dist/features/horizontalRule/server/index.js +2 -2
  84. package/dist/features/horizontalRule/server/index.js.map +1 -1
  85. package/dist/features/horizontalRule/server/markdownTransformer.d.ts +2 -2
  86. package/dist/features/horizontalRule/server/markdownTransformer.d.ts.map +1 -1
  87. package/dist/features/horizontalRule/server/markdownTransformer.js +1 -1
  88. package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -1
  89. package/dist/features/link/client/index.js +2 -2
  90. package/dist/features/link/client/index.js.map +1 -1
  91. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +3 -3
  92. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  93. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +7 -11
  94. package/dist/features/link/markdownTransformer.d.ts +4 -4
  95. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  96. package/dist/features/link/markdownTransformer.js +2 -2
  97. package/dist/features/link/markdownTransformer.js.map +1 -1
  98. package/dist/features/link/markdownTransformer.spec.js +10 -10
  99. package/dist/features/link/markdownTransformer.spec.js.map +1 -1
  100. package/dist/features/link/server/index.js +2 -2
  101. package/dist/features/link/server/index.js.map +1 -1
  102. package/dist/features/lists/checklist/client/index.js +1 -1
  103. package/dist/features/lists/checklist/client/index.js.map +1 -1
  104. package/dist/features/lists/checklist/server/index.js +1 -1
  105. package/dist/features/lists/checklist/server/index.js.map +1 -1
  106. package/dist/features/lists/orderedList/client/index.js +1 -1
  107. package/dist/features/lists/orderedList/client/index.js.map +1 -1
  108. package/dist/features/lists/orderedList/server/index.js +1 -1
  109. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  110. package/dist/features/lists/unorderedList/client/index.js +1 -1
  111. package/dist/features/lists/unorderedList/client/index.js.map +1 -1
  112. package/dist/features/lists/unorderedList/server/index.js +1 -1
  113. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  114. package/dist/features/textState/feature.client.js +1 -1
  115. package/dist/features/textState/feature.client.js.map +1 -1
  116. package/dist/features/toolbars/fixed/client/Toolbar/index.css +2 -2
  117. package/dist/features/toolbars/inline/client/Toolbar/index.css +2 -13
  118. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +8 -12
  119. package/dist/features/toolbars/shared/useToolbarStates.d.ts.map +1 -1
  120. package/dist/features/toolbars/shared/useToolbarStates.js +3 -1
  121. package/dist/features/toolbars/shared/useToolbarStates.js.map +1 -1
  122. package/dist/features/typesClient.d.ts +1 -1
  123. package/dist/features/typesClient.d.ts.map +1 -1
  124. package/dist/features/typesClient.js.map +1 -1
  125. package/dist/features/typesServer.d.ts +1 -1
  126. package/dist/features/typesServer.d.ts.map +1 -1
  127. package/dist/features/typesServer.js.map +1 -1
  128. package/dist/features/upload/client/component/index.css +9 -9
  129. package/dist/features/upload/client/plugin/index.js +5 -5
  130. package/dist/features/upload/client/plugin/index.js.map +1 -1
  131. package/dist/features/upload/server/index.js +2 -2
  132. package/dist/features/upload/server/index.js.map +1 -1
  133. package/dist/features/upload/server/markdownTransformer.d.ts +2 -2
  134. package/dist/features/upload/server/markdownTransformer.d.ts.map +1 -1
  135. package/dist/features/upload/server/markdownTransformer.js +1 -1
  136. package/dist/features/upload/server/markdownTransformer.js.map +1 -1
  137. package/dist/field/Diff/converters/unknown/index.css +1 -1
  138. package/dist/field/Field.js +1 -1
  139. package/dist/field/Field.js.map +1 -1
  140. package/dist/field/ViewSelector.css +1 -1
  141. package/dist/field/bundled.css +1 -1
  142. package/dist/field/index.css +5 -9
  143. package/dist/index.d.ts +2 -2
  144. package/dist/index.d.ts.map +1 -1
  145. package/dist/index.js +3 -3
  146. package/dist/index.js.map +1 -1
  147. package/dist/lexical/LexicalEditor.css +2 -2
  148. package/dist/lexical/plugins/DecoratorPlugin/index.css +1 -1
  149. package/dist/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  150. package/dist/lexical/plugins/MarkdownShortcut/index.js +1 -1
  151. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  152. package/dist/lexical/plugins/SlashMenu/index.css +1 -5
  153. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -1
  154. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +3 -3
  155. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +1 -1
  156. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  157. package/dist/lexical/theme/EditorTheme.css +18 -19
  158. package/dist/lexical/ui/ContentEditable.css +5 -5
  159. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts +17 -0
  160. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts.map +1 -0
  161. package/dist/lexical/utils/markdown/convertFromMarkdownString.js +27 -0
  162. package/dist/lexical/utils/markdown/convertFromMarkdownString.js.map +1 -0
  163. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +88 -0
  164. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +1 -0
  165. package/dist/lexical/utils/markdown/createBlockNode.d.ts +1 -1
  166. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  167. package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
  168. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts +25 -0
  169. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts.map +1 -0
  170. package/dist/lexical/utils/markdown/normalizeMarkdown.js +91 -0
  171. package/dist/lexical/utils/markdown/normalizeMarkdown.js.map +1 -0
  172. package/dist/lexical-proxy/@lexical-markdown.d.ts +1 -1
  173. package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -1
  174. package/dist/lexical-proxy/@lexical-markdown.js +1 -1
  175. package/dist/lexical-proxy/@lexical-markdown.js.map +1 -1
  176. package/dist/utilities/fieldsDrawer/index.css +0 -4
  177. package/package.json +21 -25
  178. package/dist/exports/client/Field-G5Z2HM5Y.js +0 -2
  179. package/dist/exports/client/Field-G5Z2HM5Y.js.map +0 -7
  180. package/dist/exports/client/chunk-LH634DPU.js +0 -12
  181. package/dist/exports/client/chunk-LH634DPU.js.map +0 -7
  182. package/dist/features/blockquote/markdownTransformer.d.ts +0 -3
  183. package/dist/features/blockquote/markdownTransformer.d.ts.map +0 -1
  184. package/dist/features/blockquote/markdownTransformer.js +0 -33
  185. package/dist/features/blockquote/markdownTransformer.js.map +0 -1
  186. package/dist/features/format/bold/markdownTransformers.d.ts +0 -6
  187. package/dist/features/format/bold/markdownTransformers.d.ts.map +0 -1
  188. package/dist/features/format/bold/markdownTransformers.js +0 -23
  189. package/dist/features/format/bold/markdownTransformers.js.map +0 -1
  190. package/dist/features/format/inlineCode/markdownTransformers.d.ts +0 -3
  191. package/dist/features/format/inlineCode/markdownTransformers.d.ts.map +0 -1
  192. package/dist/features/format/inlineCode/markdownTransformers.js +0 -6
  193. package/dist/features/format/inlineCode/markdownTransformers.js.map +0 -1
  194. package/dist/features/format/italic/markdownTransformers.d.ts +0 -4
  195. package/dist/features/format/italic/markdownTransformers.d.ts.map +0 -1
  196. package/dist/features/format/italic/markdownTransformers.js +0 -12
  197. package/dist/features/format/italic/markdownTransformers.js.map +0 -1
  198. package/dist/features/format/strikethrough/markdownTransformers.d.ts +0 -3
  199. package/dist/features/format/strikethrough/markdownTransformers.d.ts.map +0 -1
  200. package/dist/features/format/strikethrough/markdownTransformers.js +0 -6
  201. package/dist/features/format/strikethrough/markdownTransformers.js.map +0 -1
  202. package/dist/features/lists/checklist/markdownTransformers.d.ts +0 -3
  203. package/dist/features/lists/checklist/markdownTransformers.d.ts.map +0 -1
  204. package/dist/features/lists/checklist/markdownTransformers.js +0 -12
  205. package/dist/features/lists/checklist/markdownTransformers.js.map +0 -1
  206. package/dist/features/lists/orderedList/markdownTransformer.d.ts +0 -3
  207. package/dist/features/lists/orderedList/markdownTransformer.d.ts.map +0 -1
  208. package/dist/features/lists/orderedList/markdownTransformer.js +0 -12
  209. package/dist/features/lists/orderedList/markdownTransformer.js.map +0 -1
  210. package/dist/features/lists/shared/markdown.d.ts +0 -6
  211. package/dist/features/lists/shared/markdown.d.ts.map +0 -1
  212. package/dist/features/lists/shared/markdown.js +0 -57
  213. package/dist/features/lists/shared/markdown.js.map +0 -1
  214. package/dist/features/lists/unorderedList/markdownTransformer.d.ts +0 -3
  215. package/dist/features/lists/unorderedList/markdownTransformer.d.ts.map +0 -1
  216. package/dist/features/lists/unorderedList/markdownTransformer.js +0 -12
  217. package/dist/features/lists/unorderedList/markdownTransformer.js.map +0 -1
  218. package/dist/lexical/utils/guard.d.ts +0 -5
  219. package/dist/lexical/utils/guard.d.ts.map +0 -1
  220. package/dist/lexical/utils/guard.js +0 -9
  221. package/dist/lexical/utils/guard.js.map +0 -1
  222. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +0 -2
  223. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +0 -1
  224. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +0 -2
  225. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +0 -1
  226. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts +0 -14
  227. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts.map +0 -1
  228. package/dist/packages/@lexical/markdown/MarkdownExport.js +0 -213
  229. package/dist/packages/@lexical/markdown/MarkdownExport.js.map +0 -1
  230. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts +0 -19
  231. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts.map +0 -1
  232. package/dist/packages/@lexical/markdown/MarkdownImport.js +0 -198
  233. package/dist/packages/@lexical/markdown/MarkdownImport.js.map +0 -1
  234. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts +0 -11
  235. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts.map +0 -1
  236. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js +0 -304
  237. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js.map +0 -1
  238. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts +0 -147
  239. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts.map +0 -1
  240. package/dist/packages/@lexical/markdown/MarkdownTransformers.js +0 -268
  241. package/dist/packages/@lexical/markdown/MarkdownTransformers.js.map +0 -1
  242. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts +0 -22
  243. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts.map +0 -1
  244. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js +0 -91
  245. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js.map +0 -1
  246. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts +0 -21
  247. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts.map +0 -1
  248. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js +0 -54
  249. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js.map +0 -1
  250. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts +0 -18
  251. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts.map +0 -1
  252. package/dist/packages/@lexical/markdown/importTextTransformers.js +0 -54
  253. package/dist/packages/@lexical/markdown/importTextTransformers.js.map +0 -1
  254. package/dist/packages/@lexical/markdown/index.d.ts +0 -29
  255. package/dist/packages/@lexical/markdown/index.d.ts.map +0 -1
  256. package/dist/packages/@lexical/markdown/index.js +0 -39
  257. package/dist/packages/@lexical/markdown/index.js.map +0 -1
  258. package/dist/packages/@lexical/markdown/utils.d.ts +0 -34
  259. package/dist/packages/@lexical/markdown/utils.d.ts.map +0 -1
  260. package/dist/packages/@lexical/markdown/utils.js +0 -267
  261. package/dist/packages/@lexical/markdown/utils.js.map +0 -1
@@ -7,7 +7,7 @@
7
7
  }
8
8
 
9
9
  & > .field-error.tooltip {
10
- right: auto;
10
+ inset-inline-end: auto;
11
11
  position: static;
12
12
  margin-bottom: 0.2em;
13
13
  max-width: fit-content;
@@ -27,7 +27,7 @@
27
27
  gap: var(--spacer-2);
28
28
 
29
29
  label.field-label:not(.unstyled) {
30
- margin-right: unset;
30
+ margin-inline-end: unset;
31
31
  padding-bottom: unset;
32
32
  }
33
33
  }
@@ -35,10 +35,9 @@
35
35
  .rich-text-lexical__wrap {
36
36
  width: 100%;
37
37
  position: relative;
38
-
39
- > .field-description {
40
- margin-top: var(--spacer-2);
41
- }
38
+ display: flex;
39
+ flex-direction: column;
40
+ gap: var(--spacer-2);
42
41
  }
43
42
 
44
43
  .rich-text-lexical--read-only {
@@ -51,9 +50,6 @@
51
50
  to {
52
51
  background-color: var(--color-bg-hover);
53
52
  }
54
- to {
55
- background-color: var(--color-bg-hover);
56
- }
57
53
  }
58
54
 
59
55
  animation: fadeInBackground 0.5s ease forwards;
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';
@@ -60,9 +60,9 @@ export type { ClientEditorConfig, SanitizedClientEditorConfig, SanitizedServerEd
60
60
  export type { AdapterProps };
61
61
  export { getEnabledNodes, getEnabledNodesFromServerNodes } from './lexical/nodes/index.js';
62
62
  export type { SlashMenuGroup, SlashMenuItem, } from './lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
63
+ export { $convertFromMarkdownString } from './lexical/utils/markdown/convertFromMarkdownString.js';
63
64
  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
65
  export { sanitizeUrl, validateUrl } from './lexical/utils/url.js';
65
- export { $convertFromMarkdownString } from './packages/@lexical/markdown/index.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","sour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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,14 +10,14 @@ 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;
17
17
  void checkDependencies({
18
18
  dependencyGroups: [{
19
19
  name: 'lexical',
20
- dependencies: ['lexical', '@lexical/headless', '@lexical/link', '@lexical/list', '@lexical/mark', '@lexical/react', '@lexical/rich-text', '@lexical/selection', '@lexical/utils'],
20
+ dependencies: ['lexical', '@lexical/headless', '@lexical/link', '@lexical/list', '@lexical/mark', '@lexical/markdown', '@lexical/react', '@lexical/rich-text', '@lexical/selection', '@lexical/utils'],
21
21
  targetVersion: lexicalTargetVersion
22
22
  }]
23
23
  });
@@ -180,9 +180,9 @@ export { defaultEditorConfig, defaultEditorFeatures, defaultEditorLexicalConfig
180
180
  export { loadFeatures, sortFeaturesForOptimalLoading } from './lexical/config/server/loader.js';
181
181
  export { sanitizeServerEditorConfig, sanitizeServerFeatures } from './lexical/config/server/sanitize.js';
182
182
  export { getEnabledNodes, getEnabledNodesFromServerNodes } from './lexical/nodes/index.js';
183
+ export { $convertFromMarkdownString } from './lexical/utils/markdown/convertFromMarkdownString.js';
183
184
  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
185
  export { sanitizeUrl, validateUrl } from './lexical/utils/url.js';
185
- export { $convertFromMarkdownString } from './packages/@lexical/markdown/index.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"],"mapp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,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
+ {"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","$convertFromMarkdownString","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","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/markdown',\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 { $convertFromMarkdownString } from './lexical/utils/markdown/convertFromMarkdownString.js'\n\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 { 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;A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;AAE/C,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,mBAAmB,EACnBC,gBAAgB,QACX;AACP,SAASC,kBAAkB,QAAQ","ignoreList":[]}
@@ -35,7 +35,7 @@
35
35
  > .editor
36
36
  > div
37
37
  > .LexicalEditorTheme__placeholder {
38
- left: var(--spacer-5);
38
+ inset-inline-start: var(--spacer-5);
39
39
  }
40
40
 
41
41
  .rich-text-lexical:not(.rich-text-lexical--show-gutter)
@@ -45,6 +45,6 @@
45
45
  > .editor
46
46
  > div
47
47
  > .LexicalEditorTheme__placeholder {
48
- left: 0;
48
+ inset-inline-start: 0;
49
49
  }
50
50
  }
@@ -5,7 +5,7 @@
5
5
  }
6
6
 
7
7
  .decorator-selected {
8
- box-shadow: 0 0 0 2px var(--color-border-selected) !important;
8
+ box-shadow: 0 0 0 var(--stroke-width-medium) var(--color-border-selected) !important;
9
9
  outline: none !important;
10
10
  }
11
11
  }
@@ -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":[]}
@@ -16,11 +16,7 @@
16
16
  overflow-y: auto;
17
17
  z-index: 10;
18
18
  position: absolute;
19
- box-shadow:
20
- 0 2px 6px 0 rgba(0, 0, 0, 0.12),
21
- 0 10px 16px 0 rgba(0, 0, 0, 0.08),
22
- 0 0 0.5px 0 rgba(0, 0, 0, 0.12),
23
- 0 0 0 1px rgba(0, 0, 0, 0.04);
19
+ box-shadow: var(--elevation-400-menu-panel);
24
20
  }
25
21
 
26
22
  .slash-menu-popup__group {
@@ -6,7 +6,7 @@
6
6
  cursor: pointer;
7
7
  opacity: 0;
8
8
  position: absolute;
9
- left: 0;
9
+ inset-inline-start: 0;
10
10
  top: 0;
11
11
  will-change: transform;
12
12
 
@@ -6,7 +6,7 @@
6
6
  cursor: grab;
7
7
  opacity: 0;
8
8
  position: absolute;
9
- left: 0;
9
+ inset-inline-start: 0;
10
10
  top: 0;
11
11
  will-change: transform;
12
12
  background-color: var(--color-bg);
@@ -50,7 +50,7 @@
50
50
  > .editor-scroller
51
51
  > .editor {
52
52
  > .draggable-block-target-line {
53
- left: var(--spacer-5);
53
+ inset-inline-start: var(--spacer-5);
54
54
  }
55
55
  }
56
56
 
@@ -60,7 +60,7 @@
60
60
  border-radius: var(--radius-small);
61
61
  height: var(--spacer-1);
62
62
  position: absolute;
63
- left: 0;
63
+ inset-inline-start: 0;
64
64
  top: 0;
65
65
  opacity: 0;
66
66
  will-change: transform;
@@ -271,7 +271,7 @@ function useDraggableBlockMenu(editor, anchorElem, isEditable) {
271
271
  }
272
272
  const highlightElem = document.createElement('div');
273
273
  highlightElem.className = 'lexical-block-highlighter';
274
- highlightElem.style.backgroundColor = 'var(--theme-elevation-1000';
274
+ highlightElem.style.backgroundColor = 'var(--color-bg-inverse)';
275
275
  highlightElem.style.transition = 'opacity 0.5s ease-in-out';
276
276
  highlightElem.style.zIndex = '1';
277
277
  highlightElem.style.pointerEvents = 'none';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useLexicalComposerContext","eventFiles","$getNearestNodeFromDOMNode","$getNodeByKey","isHTMLElement","React","useEffect","useRef","useState","createPortal","useEditorConfigContext","Point","calculateDistanceFromScrollerElem","getNodeCloseToPoint","getTopLevelNodeKeys","isOnHandleElement","setHandlePosition","getBoundingClientRectWithoutTransform","setTargetLine","DRAGGABLE_BLOCK_MENU_CLASSNAME","DRAG_DATA_FORMAT","prevIndex","Infinity","getCurrentIndex","keysLength","Math","floor","setDragImage","dataTransfer","draggableBlockElem","transform","style","setTimeout","hideTargetLine","targetLineElem","lastTargetBlockElem","opacity","marginBottom","marginTop","useDraggableBlockMenu","editor","anchorElem","isEditable","scrollerElem","parentElement","menuRef","targetLineRef","debugHighlightRef","isDraggingBlockRef","highlightTimersRef","setDraggableBlockElem","lastTargetBlock","setLastTargetBlock","editorConfig","blockHandleHorizontalOffset","admin","hideGutter","onDocumentMouseMove","event","target","distanceFromScrollerElem","pageX","pageY","topLevelNodeKeys","blockElem","_draggableBlockElem","foundAtIndex","isFoundNodeEmptyParagraph","cache_threshold","horizontalOffset","point","x","y","startIndex","length","useEdgeAsDefault","verbose","document","addEventListener","removeEventListener","current","onDragover","isFileTransfer","targetBlockElem","fuzzy","preventDefault","dropEffect","isBelow","willStayInSamePosition","getBoundingClientRect","width","boundingBox","elem","onDrop","dragData","getData","update","draggedNode","targetNode","height","targetBlockElemHeight","top","targetBlockElemTop","mouseY","window","scrollY","insertAfter","insertBefore","remove","allPrevHighlighters","querySelectorAll","forEach","highlighter","newInsertedElem","getElementByKey","getKey","highlightTimer","newInsertedElemRect","highlightElem","createElement","className","backgroundColor","transition","zIndex","pointerEvents","boxSizing","borderRadius","position","body","appendChild","left","fadeTimer","removeTimer","push","clearTimeout","onDragStart","effectAllowed","nodeKey","node","setData","onDragEnd","_jsxs","Fragment","_jsx","draggable","ref","type","DraggableBlockPlugin","t0","t1","undefined","_editable"],"sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\nimport type { DragEvent as ReactDragEvent } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { eventFiles } from '@lexical/rich-text'\nimport { $getNearestNodeFromDOMNode, $getNodeByKey, isHTMLElement } from 'lexical'\nimport * as React from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEditorConfigContext } from '../../../config/client/EditorConfigProvider.js'\nimport { Point } from '../../../utils/point.js'\nimport { calculateDistanceFromScrollerElem } from '../utils/calculateDistanceFromScrollerElem.js'\nimport { getNodeCloseToPoint } from '../utils/getNodeCloseToPoint.js'\nimport { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js'\nimport { isOnHandleElement } from '../utils/isOnHandleElement.js'\nimport { setHandlePosition } from '../utils/setHandlePosition.js'\nimport { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js'\nimport './index.css'\nimport { setTargetLine } from './setTargetLine.js'\n\nconst DRAGGABLE_BLOCK_MENU_CLASSNAME = 'draggable-block-menu'\nconst DRAG_DATA_FORMAT = 'application/x-lexical-drag-block'\n\nlet prevIndex = Infinity\n\nfunction getCurrentIndex(keysLength: number): number {\n if (keysLength === 0) {\n return Infinity\n }\n if (prevIndex >= 0 && prevIndex < keysLength) {\n return prevIndex\n }\n\n return Math.floor(keysLength / 2)\n}\n\nfunction setDragImage(dataTransfer: DataTransfer, draggableBlockElem: HTMLElement) {\n const { transform } = draggableBlockElem.style\n\n // Remove dragImage borders\n dataTransfer.setDragImage(draggableBlockElem, 0, 0)\n\n setTimeout(() => {\n draggableBlockElem.style.transform = transform\n })\n}\n\nfunction hideTargetLine(\n targetLineElem: HTMLElement | null,\n lastTargetBlockElem: HTMLElement | null,\n) {\n if (targetLineElem) {\n targetLineElem.style.opacity = '0'\n }\n if (lastTargetBlockElem) {\n lastTargetBlockElem.style.opacity = ''\n // Delete marginBottom and marginTop values we set\n lastTargetBlockElem.style.marginBottom = ''\n lastTargetBlockElem.style.marginTop = ''\n //lastTargetBlock.style.border = 'none'\n }\n}\n\nfunction useDraggableBlockMenu(\n editor: LexicalEditor,\n anchorElem: HTMLElement,\n isEditable: boolean,\n): React.ReactElement {\n const scrollerElem = anchorElem.parentElement\n\n const menuRef = useRef<HTMLButtonElement>(null)\n const targetLineRef = useRef<HTMLDivElement>(null)\n const debugHighlightRef = useRef<HTMLDivElement>(null)\n const isDraggingBlockRef = useRef<boolean>(false)\n const highlightTimersRef = useRef<ReturnType<typeof setTimeout>[]>([])\n const [draggableBlockElem, setDraggableBlockElem] = useState<HTMLElement | null>(null)\n const [lastTargetBlock, setLastTargetBlock] = useState<{\n boundingBox?: DOMRect\n elem: HTMLElement | null\n isBelow: boolean\n } | null>(null)\n\n const { editorConfig } = useEditorConfigContext()\n\n const blockHandleHorizontalOffset = editorConfig?.admin?.hideGutter ? -44 : -8\n\n useEffect(() => {\n /**\n * Handles positioning of the drag handle\n */\n function onDocumentMouseMove(event: MouseEvent) {\n const target = event.target\n if (!isHTMLElement(target)) {\n return\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n )\n if (distanceFromScrollerElem === -1) {\n setDraggableBlockElem(null)\n return\n }\n\n if (isOnHandleElement(target, DRAGGABLE_BLOCK_MENU_CLASSNAME)) {\n return\n }\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: _draggableBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n cache_threshold: 0,\n editor,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: false,\n verbose: false,\n })\n\n prevIndex = foundAtIndex\n\n //if (DEBUG && _draggableBlockElem) {\n //targetBlockElem.style.border = '3px solid red'\n // highlightElemOriginalPosition(debugHighlightRef, _draggableBlockElem, anchorElem)\n //}\n\n if (!_draggableBlockElem && !isFoundNodeEmptyParagraph) {\n return\n }\n\n if (draggableBlockElem !== _draggableBlockElem) {\n setDraggableBlockElem(_draggableBlockElem)\n }\n }\n\n // Since the draggableBlockElem is outside the actual editor, we need to listen to the document\n // to be able to detect when the mouse is outside the editor and respect a buffer around\n // the scrollerElem to avoid the draggableBlockElem disappearing too early.\n document?.addEventListener('mousemove', onDocumentMouseMove)\n\n return () => {\n document?.removeEventListener('mousemove', onDocumentMouseMove)\n }\n }, [scrollerElem, anchorElem, editor, draggableBlockElem])\n\n useEffect(() => {\n if (menuRef.current) {\n setHandlePosition(\n draggableBlockElem,\n menuRef.current,\n anchorElem,\n blockHandleHorizontalOffset,\n )\n }\n }, [anchorElem, draggableBlockElem, blockHandleHorizontalOffset])\n\n useEffect(() => {\n function onDragover(event: DragEvent): boolean {\n if (!isDraggingBlockRef.current) {\n return false\n }\n const [isFileTransfer] = eventFiles(event)\n if (isFileTransfer) {\n return false\n }\n\n const { pageY, target } = event\n if (!isHTMLElement(target)) {\n return false\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n 100,\n 50,\n )\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: targetBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n editor,\n fuzzy: true,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: true,\n verbose: true,\n })\n\n prevIndex = foundAtIndex\n\n const targetLineElem = targetLineRef.current\n // targetBlockElem === null shouldn't happen\n if (targetBlockElem === null || targetLineElem === null) {\n return false\n }\n\n // Always prevent default and set dropEffect during drag to maintain the move cursor\n event.preventDefault()\n event.dataTransfer!.dropEffect = 'move'\n\n if (draggableBlockElem !== targetBlockElem) {\n const { isBelow, willStayInSamePosition } = setTargetLine(\n editorConfig?.admin?.hideGutter ? '0px' : 'var(--spacer-5)',\n blockHandleHorizontalOffset +\n (editorConfig?.admin?.hideGutter\n ? (menuRef?.current?.getBoundingClientRect()?.width ?? 0)\n : -(menuRef?.current?.getBoundingClientRect()?.width ?? 0)),\n targetLineElem,\n targetBlockElem,\n lastTargetBlock!,\n pageY,\n anchorElem,\n event,\n debugHighlightRef,\n isFoundNodeEmptyParagraph,\n )\n\n if (!willStayInSamePosition) {\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow,\n })\n }\n } else if (lastTargetBlock?.elem) {\n hideTargetLine(targetLineElem, lastTargetBlock.elem)\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow: false,\n })\n }\n\n return true\n }\n\n function onDrop(event: DragEvent): boolean {\n if (!isDraggingBlockRef.current) {\n return false\n }\n const [isFileTransfer] = eventFiles(event)\n if (isFileTransfer) {\n return false\n }\n const { dataTransfer, pageY, target } = event\n const dragData = dataTransfer?.getData(DRAG_DATA_FORMAT) || ''\n\n editor.update(() => {\n const draggedNode = $getNodeByKey(dragData)\n if (!draggedNode) {\n return false\n }\n if (!isHTMLElement(target)) {\n return false\n }\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n 100,\n 50,\n )\n\n const { blockElem: targetBlockElem, isFoundNodeEmptyParagraph } = getNodeCloseToPoint({\n anchorElem,\n editor,\n fuzzy: true,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n useEdgeAsDefault: true,\n })\n\n if (!targetBlockElem) {\n return false\n }\n const targetNode = $getNearestNodeFromDOMNode(targetBlockElem)\n if (!targetNode) {\n return false\n }\n if (targetNode === draggedNode) {\n return true\n }\n\n const { height: targetBlockElemHeight, top: targetBlockElemTop } =\n getBoundingClientRectWithoutTransform(targetBlockElem)\n\n const mouseY = pageY\n const isBelow = mouseY >= targetBlockElemTop + targetBlockElemHeight / 2 + window.scrollY\n\n if (!isFoundNodeEmptyParagraph) {\n if (isBelow) {\n // below targetBlockElem\n targetNode.insertAfter(draggedNode)\n } else {\n // above targetBlockElem\n targetNode.insertBefore(draggedNode)\n }\n } else {\n //\n targetNode.insertBefore(draggedNode)\n targetNode.remove()\n }\n\n /*\n if (pageY >= targetBlockElemTop + targetBlockElemHeight / 2) {\n targetNode.insertAfter(draggedNode)\n } else {\n targetNode.insertBefore(draggedNode)\n }*/\n if (draggableBlockElem !== null) {\n setDraggableBlockElem(null)\n }\n\n // find all previous elements with lexical-block-highlighter class and remove them\n const allPrevHighlighters = document.querySelectorAll('.lexical-block-highlighter')\n allPrevHighlighters.forEach((highlighter) => {\n highlighter.remove()\n })\n\n const newInsertedElem = editor.getElementByKey(draggedNode.getKey())\n const highlightTimer = setTimeout(() => {\n // add new temp html element to newInsertedElem with the same height and width and the class block-selected\n // to highlight the new inserted element\n const newInsertedElemRect = newInsertedElem?.getBoundingClientRect()\n if (!newInsertedElemRect) {\n return\n }\n const highlightElem = document.createElement('div')\n highlightElem.className = 'lexical-block-highlighter'\n\n highlightElem.style.backgroundColor = 'var(--theme-elevation-1000'\n highlightElem.style.transition = 'opacity 0.5s ease-in-out'\n highlightElem.style.zIndex = '1'\n highlightElem.style.pointerEvents = 'none'\n highlightElem.style.boxSizing = 'border-box'\n highlightElem.style.borderRadius = '4px'\n highlightElem.style.position = 'absolute'\n document.body.appendChild(highlightElem)\n\n highlightElem.style.opacity = '0.1'\n\n highlightElem.style.height = `${newInsertedElemRect.height + 8}px`\n highlightElem.style.width = `${newInsertedElemRect.width + 8}px`\n highlightElem.style.top = `${newInsertedElemRect.top + window.scrollY - 4}px`\n highlightElem.style.left = `${newInsertedElemRect.left - 4}px`\n\n const fadeTimer = setTimeout(() => {\n highlightElem.style.opacity = '0'\n const removeTimer = setTimeout(() => {\n highlightElem.remove()\n }, 500)\n highlightTimersRef.current.push(removeTimer)\n }, 1000)\n highlightTimersRef.current.push(fadeTimer)\n }, 120)\n highlightTimersRef.current.push(highlightTimer)\n })\n\n return true\n }\n\n // register onDragover event listeners:\n document.addEventListener('dragover', onDragover)\n // register onDrop event listeners:\n document.addEventListener('drop', onDrop)\n\n return () => {\n document.removeEventListener('dragover', onDragover)\n document.removeEventListener('drop', onDrop)\n highlightTimersRef.current.forEach(clearTimeout)\n highlightTimersRef.current = []\n }\n }, [\n scrollerElem,\n blockHandleHorizontalOffset,\n anchorElem,\n editor,\n lastTargetBlock,\n draggableBlockElem,\n editorConfig?.admin?.hideGutter,\n ])\n\n function onDragStart(event: ReactDragEvent<HTMLButtonElement>): void {\n const dataTransfer = event.dataTransfer\n if (!dataTransfer || !draggableBlockElem) {\n return\n }\n setDragImage(dataTransfer, draggableBlockElem)\n dataTransfer.effectAllowed = 'move'\n let nodeKey = ''\n editor.update(() => {\n const node = $getNearestNodeFromDOMNode(draggableBlockElem)\n if (node) {\n nodeKey = node.getKey()\n }\n })\n isDraggingBlockRef.current = true\n dataTransfer.setData(DRAG_DATA_FORMAT, nodeKey)\n }\n\n function onDragEnd(): void {\n isDraggingBlockRef.current = false\n if (lastTargetBlock?.elem) {\n hideTargetLine(targetLineRef.current, lastTargetBlock?.elem)\n }\n }\n\n return createPortal(\n <React.Fragment>\n <button\n aria-label=\"Drag to move\"\n className=\"icon draggable-block-menu\"\n draggable\n onDragEnd={onDragEnd}\n onDragStart={onDragStart}\n ref={menuRef}\n type=\"button\"\n >\n <div className={isEditable ? 'icon' : ''} />\n </button>\n <div className=\"draggable-block-target-line\" ref={targetLineRef} />\n <div className=\"debug-highlight\" ref={debugHighlightRef} />\n </React.Fragment>,\n anchorElem,\n )\n}\n\nexport function DraggableBlockPlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): React.ReactElement {\n const [editor] = useLexicalComposerContext()\n return useDraggableBlockMenu(editor, anchorElem, editor._editable)\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,UAAU,QAAQ;AAC3B,SAASC,0BAA0B,EAAEC,aAAa,EAAEC,aAAa,QAAQ;AACzE,YAAYC,KAAA,MAAW;AACvB,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAC5C,SAASC,YAAY,QAAQ;AAE7B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,KAAK,QAAQ;AACtB,SAASC,iCAAiC,QAAQ;AAClD,SAASC,mBAAmB,QAAQ;AACpC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,qCAAqC,QAAQ;AACtD,OAAO;AACP,SAASC,aAAa,QAAQ;AAE9B,MAAMC,8BAAA,GAAiC;AACvC,MAAMC,gBAAA,GAAmB;AAEzB,IAAIC,SAAA,GAAYC,QAAA;AAEhB,SAASC,gBAAgBC,UAAkB;EACzC,IAAIA,UAAA,KAAe,GAAG;IACpB,OAAOF,QAAA;EACT;EACA,IAAID,SAAA,IAAa,KAAKA,SAAA,GAAYG,UAAA,EAAY;IAC5C,OAAOH,SAAA;EACT;EAEA,OAAOI,IAAA,CAAKC,KAAK,CAACF,UAAA,GAAa;A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I1B,OAAA7G,MAAA,IAAiBxC,yBAAA;EAAA,OACVuC,qBAAA,CAAsBC,MAAA,EAAQC,UAAA,EAAYD,MAAA,CAAA+G,SAAgB;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["useLexicalComposerContext","eventFiles","$getNearestNodeFromDOMNode","$getNodeByKey","isHTMLElement","React","useEffect","useRef","useState","createPortal","useEditorConfigContext","Point","calculateDistanceFromScrollerElem","getNodeCloseToPoint","getTopLevelNodeKeys","isOnHandleElement","setHandlePosition","getBoundingClientRectWithoutTransform","setTargetLine","DRAGGABLE_BLOCK_MENU_CLASSNAME","DRAG_DATA_FORMAT","prevIndex","Infinity","getCurrentIndex","keysLength","Math","floor","setDragImage","dataTransfer","draggableBlockElem","transform","style","setTimeout","hideTargetLine","targetLineElem","lastTargetBlockElem","opacity","marginBottom","marginTop","useDraggableBlockMenu","editor","anchorElem","isEditable","scrollerElem","parentElement","menuRef","targetLineRef","debugHighlightRef","isDraggingBlockRef","highlightTimersRef","setDraggableBlockElem","lastTargetBlock","setLastTargetBlock","editorConfig","blockHandleHorizontalOffset","admin","hideGutter","onDocumentMouseMove","event","target","distanceFromScrollerElem","pageX","pageY","topLevelNodeKeys","blockElem","_draggableBlockElem","foundAtIndex","isFoundNodeEmptyParagraph","cache_threshold","horizontalOffset","point","x","y","startIndex","length","useEdgeAsDefault","verbose","document","addEventListener","removeEventListener","current","onDragover","isFileTransfer","targetBlockElem","fuzzy","preventDefault","dropEffect","isBelow","willStayInSamePosition","getBoundingClientRect","width","boundingBox","elem","onDrop","dragData","getData","update","draggedNode","targetNode","height","targetBlockElemHeight","top","targetBlockElemTop","mouseY","window","scrollY","insertAfter","insertBefore","remove","allPrevHighlighters","querySelectorAll","forEach","highlighter","newInsertedElem","getElementByKey","getKey","highlightTimer","newInsertedElemRect","highlightElem","createElement","className","backgroundColor","transition","zIndex","pointerEvents","boxSizing","borderRadius","position","body","appendChild","left","fadeTimer","removeTimer","push","clearTimeout","onDragStart","effectAllowed","nodeKey","node","setData","onDragEnd","_jsxs","Fragment","_jsx","draggable","ref","type","DraggableBlockPlugin","t0","t1","undefined","_editable"],"sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\nimport type { DragEvent as ReactDragEvent } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { eventFiles } from '@lexical/rich-text'\nimport { $getNearestNodeFromDOMNode, $getNodeByKey, isHTMLElement } from 'lexical'\nimport * as React from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEditorConfigContext } from '../../../config/client/EditorConfigProvider.js'\nimport { Point } from '../../../utils/point.js'\nimport { calculateDistanceFromScrollerElem } from '../utils/calculateDistanceFromScrollerElem.js'\nimport { getNodeCloseToPoint } from '../utils/getNodeCloseToPoint.js'\nimport { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js'\nimport { isOnHandleElement } from '../utils/isOnHandleElement.js'\nimport { setHandlePosition } from '../utils/setHandlePosition.js'\nimport { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js'\nimport './index.css'\nimport { setTargetLine } from './setTargetLine.js'\n\nconst DRAGGABLE_BLOCK_MENU_CLASSNAME = 'draggable-block-menu'\nconst DRAG_DATA_FORMAT = 'application/x-lexical-drag-block'\n\nlet prevIndex = Infinity\n\nfunction getCurrentIndex(keysLength: number): number {\n if (keysLength === 0) {\n return Infinity\n }\n if (prevIndex >= 0 && prevIndex < keysLength) {\n return prevIndex\n }\n\n return Math.floor(keysLength / 2)\n}\n\nfunction setDragImage(dataTransfer: DataTransfer, draggableBlockElem: HTMLElement) {\n const { transform } = draggableBlockElem.style\n\n // Remove dragImage borders\n dataTransfer.setDragImage(draggableBlockElem, 0, 0)\n\n setTimeout(() => {\n draggableBlockElem.style.transform = transform\n })\n}\n\nfunction hideTargetLine(\n targetLineElem: HTMLElement | null,\n lastTargetBlockElem: HTMLElement | null,\n) {\n if (targetLineElem) {\n targetLineElem.style.opacity = '0'\n }\n if (lastTargetBlockElem) {\n lastTargetBlockElem.style.opacity = ''\n // Delete marginBottom and marginTop values we set\n lastTargetBlockElem.style.marginBottom = ''\n lastTargetBlockElem.style.marginTop = ''\n //lastTargetBlock.style.border = 'none'\n }\n}\n\nfunction useDraggableBlockMenu(\n editor: LexicalEditor,\n anchorElem: HTMLElement,\n isEditable: boolean,\n): React.ReactElement {\n const scrollerElem = anchorElem.parentElement\n\n const menuRef = useRef<HTMLButtonElement>(null)\n const targetLineRef = useRef<HTMLDivElement>(null)\n const debugHighlightRef = useRef<HTMLDivElement>(null)\n const isDraggingBlockRef = useRef<boolean>(false)\n const highlightTimersRef = useRef<ReturnType<typeof setTimeout>[]>([])\n const [draggableBlockElem, setDraggableBlockElem] = useState<HTMLElement | null>(null)\n const [lastTargetBlock, setLastTargetBlock] = useState<{\n boundingBox?: DOMRect\n elem: HTMLElement | null\n isBelow: boolean\n } | null>(null)\n\n const { editorConfig } = useEditorConfigContext()\n\n const blockHandleHorizontalOffset = editorConfig?.admin?.hideGutter ? -44 : -8\n\n useEffect(() => {\n /**\n * Handles positioning of the drag handle\n */\n function onDocumentMouseMove(event: MouseEvent) {\n const target = event.target\n if (!isHTMLElement(target)) {\n return\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n )\n if (distanceFromScrollerElem === -1) {\n setDraggableBlockElem(null)\n return\n }\n\n if (isOnHandleElement(target, DRAGGABLE_BLOCK_MENU_CLASSNAME)) {\n return\n }\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: _draggableBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n cache_threshold: 0,\n editor,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: false,\n verbose: false,\n })\n\n prevIndex = foundAtIndex\n\n //if (DEBUG && _draggableBlockElem) {\n //targetBlockElem.style.border = '3px solid red'\n // highlightElemOriginalPosition(debugHighlightRef, _draggableBlockElem, anchorElem)\n //}\n\n if (!_draggableBlockElem && !isFoundNodeEmptyParagraph) {\n return\n }\n\n if (draggableBlockElem !== _draggableBlockElem) {\n setDraggableBlockElem(_draggableBlockElem)\n }\n }\n\n // Since the draggableBlockElem is outside the actual editor, we need to listen to the document\n // to be able to detect when the mouse is outside the editor and respect a buffer around\n // the scrollerElem to avoid the draggableBlockElem disappearing too early.\n document?.addEventListener('mousemove', onDocumentMouseMove)\n\n return () => {\n document?.removeEventListener('mousemove', onDocumentMouseMove)\n }\n }, [scrollerElem, anchorElem, editor, draggableBlockElem])\n\n useEffect(() => {\n if (menuRef.current) {\n setHandlePosition(\n draggableBlockElem,\n menuRef.current,\n anchorElem,\n blockHandleHorizontalOffset,\n )\n }\n }, [anchorElem, draggableBlockElem, blockHandleHorizontalOffset])\n\n useEffect(() => {\n function onDragover(event: DragEvent): boolean {\n if (!isDraggingBlockRef.current) {\n return false\n }\n const [isFileTransfer] = eventFiles(event)\n if (isFileTransfer) {\n return false\n }\n\n const { pageY, target } = event\n if (!isHTMLElement(target)) {\n return false\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n 100,\n 50,\n )\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: targetBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n editor,\n fuzzy: true,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: true,\n verbose: true,\n })\n\n prevIndex = foundAtIndex\n\n const targetLineElem = targetLineRef.current\n // targetBlockElem === null shouldn't happen\n if (targetBlockElem === null || targetLineElem === null) {\n return false\n }\n\n // Always prevent default and set dropEffect during drag to maintain the move cursor\n event.preventDefault()\n event.dataTransfer!.dropEffect = 'move'\n\n if (draggableBlockElem !== targetBlockElem) {\n const { isBelow, willStayInSamePosition } = setTargetLine(\n editorConfig?.admin?.hideGutter ? '0px' : 'var(--spacer-5)',\n blockHandleHorizontalOffset +\n (editorConfig?.admin?.hideGutter\n ? (menuRef?.current?.getBoundingClientRect()?.width ?? 0)\n : -(menuRef?.current?.getBoundingClientRect()?.width ?? 0)),\n targetLineElem,\n targetBlockElem,\n lastTargetBlock!,\n pageY,\n anchorElem,\n event,\n debugHighlightRef,\n isFoundNodeEmptyParagraph,\n )\n\n if (!willStayInSamePosition) {\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow,\n })\n }\n } else if (lastTargetBlock?.elem) {\n hideTargetLine(targetLineElem, lastTargetBlock.elem)\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow: false,\n })\n }\n\n return true\n }\n\n function onDrop(event: DragEvent): boolean {\n if (!isDraggingBlockRef.current) {\n return false\n }\n const [isFileTransfer] = eventFiles(event)\n if (isFileTransfer) {\n return false\n }\n const { dataTransfer, pageY, target } = event\n const dragData = dataTransfer?.getData(DRAG_DATA_FORMAT) || ''\n\n editor.update(() => {\n const draggedNode = $getNodeByKey(dragData)\n if (!draggedNode) {\n return false\n }\n if (!isHTMLElement(target)) {\n return false\n }\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n 100,\n 50,\n )\n\n const { blockElem: targetBlockElem, isFoundNodeEmptyParagraph } = getNodeCloseToPoint({\n anchorElem,\n editor,\n fuzzy: true,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n useEdgeAsDefault: true,\n })\n\n if (!targetBlockElem) {\n return false\n }\n const targetNode = $getNearestNodeFromDOMNode(targetBlockElem)\n if (!targetNode) {\n return false\n }\n if (targetNode === draggedNode) {\n return true\n }\n\n const { height: targetBlockElemHeight, top: targetBlockElemTop } =\n getBoundingClientRectWithoutTransform(targetBlockElem)\n\n const mouseY = pageY\n const isBelow = mouseY >= targetBlockElemTop + targetBlockElemHeight / 2 + window.scrollY\n\n if (!isFoundNodeEmptyParagraph) {\n if (isBelow) {\n // below targetBlockElem\n targetNode.insertAfter(draggedNode)\n } else {\n // above targetBlockElem\n targetNode.insertBefore(draggedNode)\n }\n } else {\n //\n targetNode.insertBefore(draggedNode)\n targetNode.remove()\n }\n\n /*\n if (pageY >= targetBlockElemTop + targetBlockElemHeight / 2) {\n targetNode.insertAfter(draggedNode)\n } else {\n targetNode.insertBefore(draggedNode)\n }*/\n if (draggableBlockElem !== null) {\n setDraggableBlockElem(null)\n }\n\n // find all previous elements with lexical-block-highlighter class and remove them\n const allPrevHighlighters = document.querySelectorAll('.lexical-block-highlighter')\n allPrevHighlighters.forEach((highlighter) => {\n highlighter.remove()\n })\n\n const newInsertedElem = editor.getElementByKey(draggedNode.getKey())\n const highlightTimer = setTimeout(() => {\n // add new temp html element to newInsertedElem with the same height and width and the class block-selected\n // to highlight the new inserted element\n const newInsertedElemRect = newInsertedElem?.getBoundingClientRect()\n if (!newInsertedElemRect) {\n return\n }\n const highlightElem = document.createElement('div')\n highlightElem.className = 'lexical-block-highlighter'\n\n highlightElem.style.backgroundColor = 'var(--color-bg-inverse)'\n highlightElem.style.transition = 'opacity 0.5s ease-in-out'\n highlightElem.style.zIndex = '1'\n highlightElem.style.pointerEvents = 'none'\n highlightElem.style.boxSizing = 'border-box'\n highlightElem.style.borderRadius = '4px'\n highlightElem.style.position = 'absolute'\n document.body.appendChild(highlightElem)\n\n highlightElem.style.opacity = '0.1'\n\n highlightElem.style.height = `${newInsertedElemRect.height + 8}px`\n highlightElem.style.width = `${newInsertedElemRect.width + 8}px`\n highlightElem.style.top = `${newInsertedElemRect.top + window.scrollY - 4}px`\n highlightElem.style.left = `${newInsertedElemRect.left - 4}px`\n\n const fadeTimer = setTimeout(() => {\n highlightElem.style.opacity = '0'\n const removeTimer = setTimeout(() => {\n highlightElem.remove()\n }, 500)\n highlightTimersRef.current.push(removeTimer)\n }, 1000)\n highlightTimersRef.current.push(fadeTimer)\n }, 120)\n highlightTimersRef.current.push(highlightTimer)\n })\n\n return true\n }\n\n // register onDragover event listeners:\n document.addEventListener('dragover', onDragover)\n // register onDrop event listeners:\n document.addEventListener('drop', onDrop)\n\n return () => {\n document.removeEventListener('dragover', onDragover)\n document.removeEventListener('drop', onDrop)\n highlightTimersRef.current.forEach(clearTimeout)\n highlightTimersRef.current = []\n }\n }, [\n scrollerElem,\n blockHandleHorizontalOffset,\n anchorElem,\n editor,\n lastTargetBlock,\n draggableBlockElem,\n editorConfig?.admin?.hideGutter,\n ])\n\n function onDragStart(event: ReactDragEvent<HTMLButtonElement>): void {\n const dataTransfer = event.dataTransfer\n if (!dataTransfer || !draggableBlockElem) {\n return\n }\n setDragImage(dataTransfer, draggableBlockElem)\n dataTransfer.effectAllowed = 'move'\n let nodeKey = ''\n editor.update(() => {\n const node = $getNearestNodeFromDOMNode(draggableBlockElem)\n if (node) {\n nodeKey = node.getKey()\n }\n })\n isDraggingBlockRef.current = true\n dataTransfer.setData(DRAG_DATA_FORMAT, nodeKey)\n }\n\n function onDragEnd(): void {\n isDraggingBlockRef.current = false\n if (lastTargetBlock?.elem) {\n hideTargetLine(targetLineRef.current, lastTargetBlock?.elem)\n }\n }\n\n return createPortal(\n <React.Fragment>\n <button\n aria-label=\"Drag to move\"\n className=\"icon draggable-block-menu\"\n draggable\n onDragEnd={onDragEnd}\n onDragStart={onDragStart}\n ref={menuRef}\n type=\"button\"\n >\n <div className={isEditable ? 'icon' : ''} />\n </button>\n <div className=\"draggable-block-target-line\" ref={targetLineRef} />\n <div className=\"debug-highlight\" ref={debugHighlightRef} />\n </React.Fragment>,\n anchorElem,\n )\n}\n\nexport function DraggableBlockPlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): React.ReactElement {\n const [editor] = useLexicalComposerContext()\n return useDraggableBlockMenu(editor, anchorElem, editor._editable)\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,UAAU,QAAQ;AAC3B,SAASC,0BAA0B,EAAEC,aAAa,EAAEC,aAAa,QAAQ;AACzE,YAAYC,KAAA,MAAW;AACvB,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAC5C,SAASC,YAAY,QAAQ;AAE7B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,KAAK,QAAQ;AACtB,SAASC,iCAAiC,QAAQ;AAClD,SAASC,mBAAmB,QAAQ;AACpC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,qCAAqC,QAAQ;AACtD,OAAO;AACP,SAASC,aAAa,QAAQ;AAE9B,MAAMC,8BAAA,GAAiC;AACvC,MAAMC,gBAAA,GAAmB;AAEzB,IAAIC,SAAA,GAAYC,QAAA;AAEhB,SAASC,gBAAgBC,UAAkB;EACzC,IAAIA,UAAA,KAAe,GAAG;IACpB,OAAOF,QAAA;EACT;EACA,IAAID,SAAA,IAAa,KAAKA,SAAA,GAAYG,UAAA,EAAY;IAC5C,OAAOH,SAAA;EACT;EAEA,OAAOI,IAAA,CAAKC,KAAK,CAACF,UAAA,GAAa;AACjC;AAEA,SAASG,aAAaC,YAA0B,EAAEC,kBAA+B;EAC/E,MAAM;IAAEC;EAAS,CAAE,GAAGD,kBAAA,CAAmBE,KAAK;EAE9C;EACAH,YAAA,CAAaD,YAAY,CAACE,kBAAA,EAAoB,GAAG;EAEjDG,UAAA,CAAW;IACTH,kBAAA,CAAmBE,KAAK,CAACD,SAAS,GAAGA,SAAA;EACvC;AACF;AAEA,SAASG,eACPC,cAAkC,EAClCC,m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A,GAAUC,IAAA,CAAKvB,MAAM;MACvB;IACF;IACAnE,kBAAA,CAAmBgC,OAAO,GAAG;IAC7BpD,cAAA,CAAa+G,OAAO,CAACvH,gBAAA,EAAkBqH,OAAA;EACzC;EAEA,SAASG,UAAA;IACP5F,kBAAA,CAAmBgC,OAAO,GAAG;IAC7B,IAAI7B,eAAA,EAAiByC,IAAA,EAAM;MACzB3D,cAAA,CAAea,aAAA,CAAckC,OAAO,EAAE7B,eAAA,EAAiByC,IAAA;IACzD;EACF;EAEA,oBAAOnF,YAAA,cACLoI,KAAA,CAACxI,KAAA,CAAMyI,QAAQ;4BACbC,IAAA,CAAC;MACC,cAAW;MACXvB,SAAA,EAAU;MACVwB,SAAS;MACTJ,SAAA,EAAWA,SAAA;MACXL,WAAA,EAAaA,WAAA;MACbU,GAAA,EAAKpG,OAAA;MACLqG,IAAA,EAAK;gBAEL,aAAAH,IAAA,CAAC;QAAIvB,SAAA,EAAW9E,UAAA,GAAa,SAAS;;qBAExCqG,IAAA,CAAC;MAAIvB,SAAA,EAAU;MAA8ByB,GAAA,EAAKnG;qBAClDiG,IAAA,CAAC;MAAIvB,SAAA,EAAU;MAAkByB,GAAA,EAAKlG;;MAExCN,UAAA;AAEJ;AAEA,OAAO,SAAA0G,qBAAAC,EAAA;EAA8B;IAAA3G,UAAA,EAAA4G;EAAA,IAAAD,EAIpC;EAHC,MAAA3G,UAAA,GAAA4G,EAA0B,KAAAC,SAAA,GAAAzE,QAAA,CAAAmD,IAAA,GAA1BqB,EAA0B;EAI1B,OAAA7G,MAAA,IAAiBxC,yBAAA;EAAA,OACVuC,qBAAA,CAAsBC,MAAA,EAAQC,UAAA,EAAYD,MAAA,CAAA+G,SAAgB;AAAA","ignoreList":[]}
@@ -131,8 +131,7 @@
131
131
  .LexicalEditorTheme__tabNode.LexicalEditorTheme__textUnderline::after {
132
132
  content: '';
133
133
  position: absolute;
134
- left: 0;
135
- right: 0;
134
+ inset-inline: 0;
136
135
  bottom: 0.15em;
137
136
  border-bottom: 0.1em solid currentColor;
138
137
  }
@@ -140,8 +139,7 @@
140
139
  .LexicalEditorTheme__tabNode.LexicalEditorTheme__textStrikethrough::before {
141
140
  content: '';
142
141
  position: absolute;
143
- left: 0;
144
- right: 0;
142
+ inset-inline: 0;
145
143
  top: 0.69em;
146
144
  border-top: 0.1em solid currentColor;
147
145
  }
@@ -150,8 +148,7 @@
150
148
  .LexicalEditorTheme__tabNode.LexicalEditorTheme__textUnderlineStrikethrough::after {
151
149
  content: '';
152
150
  position: absolute;
153
- left: 0;
154
- right: 0;
151
+ inset-inline: 0;
155
152
  }
156
153
 
157
154
  .LexicalEditorTheme__tabNode.LexicalEditorTheme__textUnderlineStrikethrough::before {
@@ -201,7 +198,7 @@
201
198
  content: '';
202
199
  display: block;
203
200
  position: absolute;
204
- top: -2px;
201
+ top: calc(var(--stroke-width-medium) * -1);
205
202
  width: var(--spacer-3);
206
203
  border-top: var(--stroke-width-small) solid var(--color-text);
207
204
  animation: CursorBlink 1.1s steps(2, start) infinite;
@@ -263,7 +260,8 @@
263
260
  .LexicalEditorTheme__listItem {
264
261
  font-family: var(--text-body-large-font-family);
265
262
  font-size: var(--text-body-large-font-size);
266
- margin: 0 0 var(--spacer-3) var(--spacer-6);
263
+ margin-block-end: var(--spacer-3);
264
+ margin-inline-start: var(--spacer-6);
267
265
  }
268
266
 
269
267
  .LexicalEditorTheme__listItem[style*='text-align: center'],
@@ -280,24 +278,25 @@
280
278
  }
281
279
 
282
280
  .LexicalEditorTheme__listItem[dir='rtl'] {
283
- margin: 0 var(--spacer-6) 0.4em 0;
281
+ margin-block-end: 0.4em;
282
+ margin-inline-end: var(--spacer-6);
284
283
  }
285
284
 
286
285
  .LexicalEditorTheme__listItemChecked,
287
286
  .LexicalEditorTheme__listItemUnchecked {
288
287
  position: relative;
289
- padding-left: var(--spacer-4);
290
- margin-left: var(--spacer-3);
288
+ padding-inline-start: var(--spacer-4);
289
+ margin-inline-start: var(--spacer-3);
291
290
  list-style-type: none;
292
291
  outline: none;
293
292
  }
294
293
 
295
294
  .LexicalEditorTheme__listItemUnchecked[dir='rtl'],
296
295
  .LexicalEditorTheme__listItemChecked[dir='rtl'] {
297
- margin-left: 0;
298
- padding-left: 0;
299
- padding-right: var(--spacer-4);
300
- margin-right: var(--spacer-3);
296
+ margin-inline-start: 0;
297
+ padding-inline-start: 0;
298
+ padding-inline-end: var(--spacer-4);
299
+ margin-inline-end: var(--spacer-3);
301
300
  }
302
301
 
303
302
  .LexicalEditorTheme__listItemChecked {
@@ -310,7 +309,7 @@
310
309
  width: var(--spacer-3);
311
310
  height: var(--spacer-3);
312
311
  top: 0;
313
- left: 0;
312
+ inset-inline-start: 0;
314
313
  cursor: pointer;
315
314
  display: block;
316
315
  position: absolute;
@@ -320,14 +319,14 @@
320
319
 
321
320
  .LexicalEditorTheme__listItemUnchecked[dir='rtl']:before,
322
321
  .LexicalEditorTheme__listItemChecked[dir='rtl']:before {
323
- left: auto;
324
- right: 0;
322
+ inset-inline-start: auto;
323
+ inset-inline-end: 0;
325
324
  }
326
325
 
327
326
  .LexicalEditorTheme__listItemUnchecked:focus:before,
328
327
  .LexicalEditorTheme__listItemChecked:focus:before {
329
328
  outline: 0;
330
- box-shadow: 0 0 0 2px var(--color-border-selected);
329
+ box-shadow: 0 0 0 var(--stroke-width-medium) var(--color-border-selected);
331
330
  }
332
331
 
333
332
  .LexicalEditorTheme__listItemUnchecked:before {