@payloadcms/richtext-lexical 3.0.0-beta.9 → 3.0.0-canary.03427d3

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 (971) hide show
  1. package/README.md +1 -1
  2. package/dist/cell/index.d.ts +5 -2
  3. package/dist/cell/index.d.ts.map +1 -1
  4. package/dist/cell/index.js +45 -31
  5. package/dist/cell/index.js.map +1 -1
  6. package/dist/exports/client/Component-6AVANNNR.js +2 -0
  7. package/dist/exports/client/Component-6AVANNNR.js.map +7 -0
  8. package/dist/exports/client/Component-SZVAYRJX.js +2 -0
  9. package/dist/exports/client/Component-SZVAYRJX.js.map +7 -0
  10. package/dist/exports/client/Field-U5PHZTST.js +2 -0
  11. package/dist/exports/client/Field-U5PHZTST.js.map +7 -0
  12. package/dist/exports/client/RelationshipComponent-FGUPLCD2.js +2 -0
  13. package/dist/exports/client/RelationshipComponent-FGUPLCD2.js.map +7 -0
  14. package/dist/exports/client/bundled.css +1 -0
  15. package/dist/exports/client/chunk-35NZOHAF.js +2 -0
  16. package/dist/exports/client/chunk-35NZOHAF.js.map +7 -0
  17. package/dist/exports/client/chunk-3PZ2ZFQG.js +3 -0
  18. package/dist/exports/client/chunk-3PZ2ZFQG.js.map +7 -0
  19. package/dist/exports/client/chunk-FSTRW2TI.js +2 -0
  20. package/dist/exports/client/chunk-FSTRW2TI.js.map +7 -0
  21. package/dist/exports/client/chunk-M6MN4CA5.js +2 -0
  22. package/dist/exports/client/chunk-M6MN4CA5.js.map +7 -0
  23. package/dist/exports/client/chunk-Y5455JF3.js +2 -0
  24. package/dist/exports/client/chunk-Y5455JF3.js.map +7 -0
  25. package/dist/exports/client/component-FFLILIUZ.js +2 -0
  26. package/dist/exports/client/component-FFLILIUZ.js.map +7 -0
  27. package/dist/exports/client/component-RAVN56DE.js +2 -0
  28. package/dist/exports/client/component-RAVN56DE.js.map +7 -0
  29. package/dist/exports/client/component-Z34HXRX3.js +2 -0
  30. package/dist/exports/client/component-Z34HXRX3.js.map +7 -0
  31. package/dist/exports/client/index.d.ts +52 -0
  32. package/dist/exports/client/index.d.ts.map +1 -0
  33. package/dist/exports/client/index.js +36 -0
  34. package/dist/exports/client/index.js.map +7 -0
  35. package/dist/field/Field.d.ts +1 -2
  36. package/dist/field/Field.d.ts.map +1 -1
  37. package/dist/field/Field.js +69 -55
  38. package/dist/field/Field.js.map +1 -1
  39. package/dist/field/bundled.css +0 -0
  40. package/dist/field/features/align/feature.client.d.ts +4 -1
  41. package/dist/field/features/align/feature.client.d.ts.map +1 -1
  42. package/dist/field/features/align/feature.client.js +135 -54
  43. package/dist/field/features/align/feature.client.js.map +1 -1
  44. package/dist/field/features/align/feature.server.d.ts.map +1 -1
  45. package/dist/field/features/align/feature.server.js +4 -1
  46. package/dist/field/features/align/feature.server.js.map +1 -1
  47. package/dist/field/features/align/i18n.d.ts +3 -0
  48. package/dist/field/features/align/i18n.d.ts.map +1 -0
  49. package/dist/field/features/align/i18n.js +196 -0
  50. package/dist/field/features/align/i18n.js.map +1 -0
  51. package/dist/field/features/align/toolbarAlignGroup.d.ts +3 -0
  52. package/dist/field/features/align/toolbarAlignGroup.d.ts.map +1 -0
  53. package/dist/field/features/align/toolbarAlignGroup.js +12 -0
  54. package/dist/field/features/align/toolbarAlignGroup.js.map +1 -0
  55. package/dist/field/features/blockquote/feature.client.d.ts +4 -1
  56. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  57. package/dist/field/features/blockquote/feature.client.js +60 -46
  58. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  59. package/dist/field/features/blockquote/feature.server.d.ts +1 -1
  60. package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
  61. package/dist/field/features/blockquote/feature.server.js +10 -7
  62. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  63. package/dist/field/features/blockquote/i18n.d.ts +3 -0
  64. package/dist/field/features/blockquote/i18n.d.ts.map +1 -0
  65. package/dist/field/features/blockquote/i18n.js +100 -0
  66. package/dist/field/features/blockquote/i18n.js.map +1 -0
  67. package/dist/field/features/blockquote/markdownTransformer.d.ts.map +1 -1
  68. package/dist/field/features/blockquote/markdownTransformer.js +2 -4
  69. package/dist/field/features/blockquote/markdownTransformer.js.map +1 -1
  70. package/dist/field/features/blocks/component/BlockContent.d.ts.map +1 -1
  71. package/dist/field/features/blocks/component/BlockContent.js +77 -67
  72. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  73. package/dist/field/features/blocks/component/FormSavePlugin.d.ts +1 -2
  74. package/dist/field/features/blocks/component/FormSavePlugin.d.ts.map +1 -1
  75. package/dist/field/features/blocks/component/FormSavePlugin.js +2 -2
  76. package/dist/field/features/blocks/component/FormSavePlugin.js.map +1 -1
  77. package/dist/field/features/blocks/component/index.d.ts +0 -1
  78. package/dist/field/features/blocks/component/index.d.ts.map +1 -1
  79. package/dist/field/features/blocks/component/index.js +60 -30
  80. package/dist/field/features/blocks/component/index.js.map +1 -1
  81. package/dist/field/features/blocks/component/removeEmptyArrayValues.d.ts +1 -1
  82. package/dist/field/features/blocks/component/removeEmptyArrayValues.d.ts.map +1 -1
  83. package/dist/field/features/blocks/component/removeEmptyArrayValues.js.map +1 -1
  84. package/dist/field/features/blocks/drawer/index.d.ts.map +1 -1
  85. package/dist/field/features/blocks/drawer/index.js +5 -11
  86. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  87. package/dist/field/features/blocks/feature.client.d.ts +4 -1
  88. package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
  89. package/dist/field/features/blocks/feature.client.js +58 -27
  90. package/dist/field/features/blocks/feature.client.js.map +1 -1
  91. package/dist/field/features/blocks/feature.server.d.ts +2 -5
  92. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  93. package/dist/field/features/blocks/feature.server.js +62 -82
  94. package/dist/field/features/blocks/feature.server.js.map +1 -1
  95. package/dist/field/features/blocks/{populationPromise.d.ts → graphQLPopulationPromise.d.ts} +1 -1
  96. package/dist/field/features/blocks/graphQLPopulationPromise.d.ts.map +1 -0
  97. package/dist/field/features/blocks/graphQLPopulationPromise.js +31 -0
  98. package/dist/field/features/blocks/graphQLPopulationPromise.js.map +1 -0
  99. package/dist/field/features/blocks/i18n.d.ts +3 -0
  100. package/dist/field/features/blocks/i18n.d.ts.map +1 -0
  101. package/dist/field/features/blocks/i18n.js +100 -0
  102. package/dist/field/features/blocks/i18n.js.map +1 -0
  103. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +2 -4
  104. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  105. package/dist/field/features/blocks/nodes/BlocksNode.js +3 -3
  106. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  107. package/dist/field/features/blocks/plugin/commands.d.ts.map +1 -1
  108. package/dist/field/features/blocks/plugin/commands.js +1 -2
  109. package/dist/field/features/blocks/plugin/commands.js.map +1 -1
  110. package/dist/field/features/blocks/plugin/index.d.ts +3 -2
  111. package/dist/field/features/blocks/plugin/index.d.ts.map +1 -1
  112. package/dist/field/features/blocks/plugin/index.js +10 -11
  113. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  114. package/dist/field/features/blocks/validate.d.ts.map +1 -1
  115. package/dist/field/features/blocks/validate.js +22 -36
  116. package/dist/field/features/blocks/validate.js.map +1 -1
  117. package/dist/field/features/converters/html/field/index.d.ts +14 -2
  118. package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
  119. package/dist/field/features/converters/html/field/index.js +97 -57
  120. package/dist/field/features/converters/html/field/index.js.map +1 -1
  121. package/dist/field/features/createFeaturePropComponent.d.ts.map +1 -1
  122. package/dist/field/features/createFeaturePropComponent.js +6 -3
  123. package/dist/field/features/createFeaturePropComponent.js.map +1 -1
  124. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts +4 -1
  125. package/dist/field/features/debug/testRecorder/feature.client.d.ts.map +1 -0
  126. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js.map +1 -1
  127. package/dist/field/features/debug/testRecorder/feature.server.d.ts.map +1 -0
  128. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js +3 -2
  129. package/dist/field/features/debug/testRecorder/feature.server.js.map +1 -0
  130. package/dist/field/features/debug/testRecorder/plugin/index.d.ts +5 -0
  131. package/dist/field/features/debug/testRecorder/plugin/index.d.ts.map +1 -0
  132. package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.js +68 -45
  133. package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -0
  134. package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts +4 -1
  135. package/dist/field/features/debug/treeView/feature.client.d.ts.map +1 -0
  136. package/dist/field/features/debug/{treeview → treeView}/feature.client.js.map +1 -1
  137. package/dist/field/features/debug/treeView/feature.server.d.ts.map +1 -0
  138. package/dist/field/features/debug/{treeview → treeView}/feature.server.js +3 -2
  139. package/dist/field/features/debug/treeView/feature.server.js.map +1 -0
  140. package/dist/field/features/debug/treeView/plugin/index.d.ts +4 -0
  141. package/dist/field/features/debug/treeView/plugin/index.d.ts.map +1 -0
  142. package/dist/field/features/debug/{treeview → treeView}/plugin/index.js +6 -8
  143. package/dist/field/features/debug/treeView/plugin/index.js.map +1 -0
  144. package/dist/field/features/format/bold/feature.client.d.ts +4 -1
  145. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  146. package/dist/field/features/format/bold/feature.client.js +26 -23
  147. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  148. package/dist/field/features/format/bold/feature.server.d.ts.map +1 -1
  149. package/dist/field/features/format/bold/feature.server.js +2 -1
  150. package/dist/field/features/format/bold/feature.server.js.map +1 -1
  151. package/dist/field/features/format/{inlinecode → inlineCode}/feature.client.d.ts +4 -1
  152. package/dist/field/features/format/inlineCode/feature.client.d.ts.map +1 -0
  153. package/dist/field/features/format/inlineCode/feature.client.js +46 -0
  154. package/dist/field/features/format/inlineCode/feature.client.js.map +1 -0
  155. package/dist/field/features/format/inlineCode/feature.server.d.ts.map +1 -0
  156. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js +3 -2
  157. package/dist/field/features/format/inlineCode/feature.server.js.map +1 -0
  158. package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts.map +1 -1
  159. package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js.map +1 -1
  160. package/dist/field/features/format/italic/feature.client.d.ts +4 -1
  161. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  162. package/dist/field/features/format/italic/feature.client.js +27 -24
  163. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  164. package/dist/field/features/format/italic/feature.server.d.ts.map +1 -1
  165. package/dist/field/features/format/italic/feature.server.js +2 -1
  166. package/dist/field/features/format/italic/feature.server.js.map +1 -1
  167. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts +3 -0
  168. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts.map +1 -0
  169. package/dist/field/features/format/shared/toolbarFormatGroup.js +10 -0
  170. package/dist/field/features/format/shared/toolbarFormatGroup.js.map +1 -0
  171. package/dist/field/features/format/strikethrough/feature.client.d.ts +4 -1
  172. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  173. package/dist/field/features/format/strikethrough/feature.client.js +27 -24
  174. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  175. package/dist/field/features/format/strikethrough/feature.server.d.ts.map +1 -1
  176. package/dist/field/features/format/strikethrough/feature.server.js +2 -1
  177. package/dist/field/features/format/strikethrough/feature.server.js.map +1 -1
  178. package/dist/field/features/format/subscript/feature.client.d.ts +4 -1
  179. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  180. package/dist/field/features/format/subscript/feature.client.js +25 -22
  181. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  182. package/dist/field/features/format/subscript/feature.server.d.ts.map +1 -1
  183. package/dist/field/features/format/subscript/feature.server.js +2 -1
  184. package/dist/field/features/format/subscript/feature.server.js.map +1 -1
  185. package/dist/field/features/format/superscript/feature.client.d.ts +4 -1
  186. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  187. package/dist/field/features/format/superscript/feature.client.js +25 -22
  188. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  189. package/dist/field/features/format/superscript/feature.server.d.ts.map +1 -1
  190. package/dist/field/features/format/superscript/feature.server.js +2 -1
  191. package/dist/field/features/format/superscript/feature.server.js.map +1 -1
  192. package/dist/field/features/format/underline/feature.client.d.ts +4 -1
  193. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  194. package/dist/field/features/format/underline/feature.client.js +25 -22
  195. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  196. package/dist/field/features/format/underline/feature.server.d.ts.map +1 -1
  197. package/dist/field/features/format/underline/feature.server.js +2 -1
  198. package/dist/field/features/format/underline/feature.server.js.map +1 -1
  199. package/dist/field/features/heading/feature.client.d.ts +4 -1
  200. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  201. package/dist/field/features/heading/feature.client.js +75 -54
  202. package/dist/field/features/heading/feature.client.js.map +1 -1
  203. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  204. package/dist/field/features/heading/feature.server.js +9 -6
  205. package/dist/field/features/heading/feature.server.js.map +1 -1
  206. package/dist/field/features/heading/i18n.d.ts +3 -0
  207. package/dist/field/features/heading/i18n.d.ts.map +1 -0
  208. package/dist/field/features/heading/i18n.js +100 -0
  209. package/dist/field/features/heading/i18n.js.map +1 -0
  210. package/dist/field/features/heading/markdownTransformer.d.ts.map +1 -1
  211. package/dist/field/features/heading/markdownTransformer.js +1 -2
  212. package/dist/field/features/heading/markdownTransformer.js.map +1 -1
  213. package/dist/field/features/horizontalRule/component/index.d.ts.map +1 -0
  214. package/dist/field/features/{horizontalrule → horizontalRule}/component/index.js +11 -8
  215. package/dist/field/features/horizontalRule/component/index.js.map +1 -0
  216. package/dist/field/features/{horizontalrule → horizontalRule}/feature.client.d.ts +4 -1
  217. package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -0
  218. package/dist/field/features/horizontalRule/feature.client.js +77 -0
  219. package/dist/field/features/horizontalRule/feature.client.js.map +1 -0
  220. package/dist/field/features/horizontalRule/feature.server.d.ts.map +1 -0
  221. package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.js +8 -5
  222. package/dist/field/features/horizontalRule/feature.server.js.map +1 -0
  223. package/dist/field/features/horizontalRule/i18n.d.ts +3 -0
  224. package/dist/field/features/horizontalRule/i18n.d.ts.map +1 -0
  225. package/dist/field/features/horizontalRule/i18n.js +100 -0
  226. package/dist/field/features/horizontalRule/i18n.js.map +1 -0
  227. package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.d.ts.map +1 -1
  228. package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.js.map +1 -1
  229. package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.d.ts +3 -5
  230. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.d.ts.map +1 -0
  231. package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.js +10 -7
  232. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -0
  233. package/dist/field/features/horizontalRule/plugin/index.d.ts +7 -0
  234. package/dist/field/features/horizontalRule/plugin/index.d.ts.map +1 -0
  235. package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.js +5 -9
  236. package/dist/field/features/horizontalRule/plugin/index.js.map +1 -0
  237. package/dist/field/features/indent/feature.client.d.ts +4 -1
  238. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  239. package/dist/field/features/indent/feature.client.js +47 -42
  240. package/dist/field/features/indent/feature.client.js.map +1 -1
  241. package/dist/field/features/indent/feature.server.d.ts.map +1 -1
  242. package/dist/field/features/indent/feature.server.js +4 -1
  243. package/dist/field/features/indent/feature.server.js.map +1 -1
  244. package/dist/field/features/indent/i18n.d.ts +3 -0
  245. package/dist/field/features/indent/i18n.d.ts.map +1 -0
  246. package/dist/field/features/indent/i18n.js +132 -0
  247. package/dist/field/features/indent/i18n.js.map +1 -0
  248. package/dist/field/features/indent/toolbarIndentGroup.d.ts +3 -0
  249. package/dist/field/features/indent/toolbarIndentGroup.d.ts.map +1 -0
  250. package/dist/field/features/indent/toolbarIndentGroup.js +10 -0
  251. package/dist/field/features/indent/toolbarIndentGroup.js.map +1 -0
  252. package/dist/field/features/link/drawer/baseFields.d.ts +2 -3
  253. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  254. package/dist/field/features/link/drawer/baseFields.js +30 -43
  255. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  256. package/dist/field/features/link/drawer/index.d.ts.map +1 -1
  257. package/dist/field/features/link/drawer/index.js +32 -31
  258. package/dist/field/features/link/drawer/index.js.map +1 -1
  259. package/dist/field/features/link/drawer/types.d.ts +5 -3
  260. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  261. package/dist/field/features/link/drawer/types.js.map +1 -1
  262. package/dist/field/features/link/feature.client.d.ts +13 -1
  263. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  264. package/dist/field/features/link/feature.client.js +65 -47
  265. package/dist/field/features/link/feature.client.js.map +1 -1
  266. package/dist/field/features/link/feature.server.d.ts +10 -6
  267. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  268. package/dist/field/features/link/feature.server.js +66 -17
  269. package/dist/field/features/link/feature.server.js.map +1 -1
  270. package/dist/field/features/link/{populationPromise.d.ts → graphQLPopulationPromise.d.ts} +1 -1
  271. package/dist/field/features/link/graphQLPopulationPromise.d.ts.map +1 -0
  272. package/dist/field/features/link/graphQLPopulationPromise.js +31 -0
  273. package/dist/field/features/link/graphQLPopulationPromise.js.map +1 -0
  274. package/dist/field/features/link/i18n.d.ts +3 -0
  275. package/dist/field/features/link/i18n.d.ts.map +1 -0
  276. package/dist/field/features/link/i18n.js +100 -0
  277. package/dist/field/features/link/i18n.js.map +1 -0
  278. package/dist/field/features/link/markdownTransformer.d.ts +6 -0
  279. package/dist/field/features/link/markdownTransformer.d.ts.map +1 -0
  280. package/dist/field/features/link/markdownTransformer.js +50 -0
  281. package/dist/field/features/link/markdownTransformer.js.map +1 -0
  282. package/dist/field/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  283. package/dist/field/features/link/nodes/AutoLinkNode.js +3 -2
  284. package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
  285. package/dist/field/features/link/nodes/LinkNode.d.ts +9 -8
  286. package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
  287. package/dist/field/features/link/nodes/LinkNode.js +28 -11
  288. package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
  289. package/dist/field/features/link/nodes/types.d.ts +2 -1
  290. package/dist/field/features/link/nodes/types.d.ts.map +1 -1
  291. package/dist/field/features/link/nodes/types.js.map +1 -1
  292. package/dist/field/features/link/plugins/autoLink/index.d.ts +3 -2
  293. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  294. package/dist/field/features/link/plugins/autoLink/index.js +11 -12
  295. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  296. package/dist/field/features/link/plugins/clickableLink/index.d.ts +3 -2
  297. package/dist/field/features/link/plugins/clickableLink/index.d.ts.map +1 -1
  298. package/dist/field/features/link/plugins/clickableLink/index.js +5 -6
  299. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  300. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  301. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js +1 -2
  302. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  303. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  304. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +179 -143
  305. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  306. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts +3 -4
  307. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  308. package/dist/field/features/link/plugins/floatingLinkEditor/index.js +2 -2
  309. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  310. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +3 -6
  311. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  312. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +12 -30
  313. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  314. package/dist/field/features/link/plugins/link/index.d.ts +3 -1
  315. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  316. package/dist/field/features/link/plugins/link/index.js +7 -16
  317. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  318. package/dist/field/features/link/validate.d.ts +6 -0
  319. package/dist/field/features/link/validate.d.ts.map +1 -0
  320. package/dist/field/features/link/validate.js +28 -0
  321. package/dist/field/features/link/validate.js.map +1 -0
  322. package/dist/field/features/lists/checklist/feature.client.d.ts +4 -1
  323. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  324. package/dist/field/features/lists/checklist/feature.client.js +69 -44
  325. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  326. package/dist/field/features/lists/checklist/feature.server.d.ts +1 -1
  327. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  328. package/dist/field/features/lists/checklist/feature.server.js +13 -10
  329. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  330. package/dist/field/features/lists/checklist/i18n.d.ts +3 -0
  331. package/dist/field/features/lists/checklist/i18n.d.ts.map +1 -0
  332. package/dist/field/features/lists/checklist/i18n.js +100 -0
  333. package/dist/field/features/lists/checklist/i18n.js.map +1 -0
  334. package/dist/field/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
  335. package/dist/field/features/lists/checklist/markdownTransformers.js +2 -3
  336. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  337. package/dist/field/features/lists/checklist/plugin/index.d.ts +2 -2
  338. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  339. package/dist/field/features/lists/checklist/plugin/index.js +5 -5
  340. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  341. package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
  342. package/dist/field/features/lists/htmlConverter.js +13 -6
  343. package/dist/field/features/lists/htmlConverter.js.map +1 -1
  344. package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.d.ts +4 -1
  345. package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -0
  346. package/dist/field/features/lists/orderedList/feature.client.js +97 -0
  347. package/dist/field/features/lists/orderedList/feature.client.js.map +1 -0
  348. package/dist/field/features/lists/orderedList/feature.server.d.ts.map +1 -0
  349. package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.js +12 -9
  350. package/dist/field/features/lists/orderedList/feature.server.js.map +1 -0
  351. package/dist/field/features/lists/orderedList/i18n.d.ts +3 -0
  352. package/dist/field/features/lists/orderedList/i18n.d.ts.map +1 -0
  353. package/dist/field/features/lists/orderedList/i18n.js +100 -0
  354. package/dist/field/features/lists/orderedList/i18n.js.map +1 -0
  355. package/dist/field/features/lists/orderedList/markdownTransformer.d.ts.map +1 -0
  356. package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.js +2 -3
  357. package/dist/field/features/lists/orderedList/markdownTransformer.js.map +1 -0
  358. package/dist/field/features/lists/plugin/index.d.ts +2 -2
  359. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  360. package/dist/field/features/lists/plugin/index.js +5 -5
  361. package/dist/field/features/lists/plugin/index.js.map +1 -1
  362. package/dist/field/features/lists/{common → shared}/markdown.d.ts.map +1 -1
  363. package/dist/field/features/lists/{common → shared}/markdown.js +1 -2
  364. package/dist/field/features/lists/shared/markdown.js.map +1 -0
  365. package/dist/field/features/lists/shared/slashMenuListGroup.d.ts +3 -0
  366. package/dist/field/features/lists/shared/slashMenuListGroup.d.ts.map +1 -0
  367. package/dist/field/features/lists/shared/slashMenuListGroup.js +11 -0
  368. package/dist/field/features/lists/shared/slashMenuListGroup.js.map +1 -0
  369. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.client.d.ts +4 -1
  370. package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -0
  371. package/dist/field/features/lists/unorderedList/feature.client.js +97 -0
  372. package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -0
  373. package/dist/field/features/lists/unorderedList/feature.server.d.ts.map +1 -0
  374. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.js +11 -8
  375. package/dist/field/features/lists/unorderedList/feature.server.js.map +1 -0
  376. package/dist/field/features/lists/unorderedList/i18n.d.ts +3 -0
  377. package/dist/field/features/lists/unorderedList/i18n.d.ts.map +1 -0
  378. package/dist/field/features/lists/unorderedList/i18n.js +100 -0
  379. package/dist/field/features/lists/unorderedList/i18n.js.map +1 -0
  380. package/dist/field/features/lists/unorderedList/markdownTransformer.d.ts.map +1 -0
  381. package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.js +2 -3
  382. package/dist/field/features/lists/unorderedList/markdownTransformer.js.map +1 -0
  383. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  384. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +2 -4
  385. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  386. package/dist/field/features/migrations/lexicalPluginToLexical/feature.client.d.ts +4 -1
  387. package/dist/field/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +1 -1
  388. package/dist/field/features/migrations/lexicalPluginToLexical/feature.server.d.ts.map +1 -1
  389. package/dist/field/features/migrations/lexicalPluginToLexical/feature.server.js +2 -1
  390. package/dist/field/features/migrations/lexicalPluginToLexical/feature.server.js.map +1 -1
  391. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +9 -2
  392. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  393. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +3 -6
  394. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  395. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +4 -5
  396. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  397. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.d.ts +1 -1
  398. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js +1 -1
  399. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +1 -1
  400. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js +2 -2
  401. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
  402. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +1 -1
  403. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js +2 -4
  404. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  405. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  406. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js +2 -4
  407. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  408. package/dist/field/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  409. package/dist/field/features/migrations/slateToLexical/converter/index.js +2 -1
  410. package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
  411. package/dist/field/features/migrations/slateToLexical/feature.client.d.ts +4 -1
  412. package/dist/field/features/migrations/slateToLexical/feature.client.d.ts.map +1 -1
  413. package/dist/field/features/migrations/slateToLexical/feature.server.d.ts.map +1 -1
  414. package/dist/field/features/migrations/slateToLexical/feature.server.js +2 -1
  415. package/dist/field/features/migrations/slateToLexical/feature.server.js.map +1 -1
  416. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +9 -2
  417. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  418. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +3 -6
  419. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  420. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +4 -5
  421. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  422. package/dist/field/features/paragraph/feature.client.d.ts +4 -1
  423. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  424. package/dist/field/features/paragraph/feature.client.js +54 -41
  425. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  426. package/dist/field/features/paragraph/feature.server.d.ts.map +1 -1
  427. package/dist/field/features/paragraph/feature.server.js +4 -1
  428. package/dist/field/features/paragraph/feature.server.js.map +1 -1
  429. package/dist/field/features/paragraph/i18n.d.ts +3 -0
  430. package/dist/field/features/paragraph/i18n.d.ts.map +1 -0
  431. package/dist/field/features/paragraph/i18n.js +132 -0
  432. package/dist/field/features/paragraph/i18n.js.map +1 -0
  433. package/dist/field/features/relationship/drawer/commands.d.ts.map +1 -1
  434. package/dist/field/features/relationship/drawer/commands.js +1 -2
  435. package/dist/field/features/relationship/drawer/commands.js.map +1 -1
  436. package/dist/field/features/relationship/drawer/index.d.ts.map +1 -1
  437. package/dist/field/features/relationship/drawer/index.js +18 -16
  438. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  439. package/dist/field/features/relationship/feature.client.d.ts +17 -2
  440. package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
  441. package/dist/field/features/relationship/feature.client.js +51 -28
  442. package/dist/field/features/relationship/feature.client.js.map +1 -1
  443. package/dist/field/features/relationship/feature.server.d.ts +10 -1
  444. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  445. package/dist/field/features/relationship/feature.server.js +43 -8
  446. package/dist/field/features/relationship/feature.server.js.map +1 -1
  447. package/dist/field/features/relationship/graphQLPopulationPromise.d.ts +5 -0
  448. package/dist/field/features/relationship/graphQLPopulationPromise.d.ts.map +1 -0
  449. package/dist/field/features/relationship/graphQLPopulationPromise.js +29 -0
  450. package/dist/field/features/relationship/graphQLPopulationPromise.js.map +1 -0
  451. package/dist/field/features/relationship/i18n.d.ts +3 -0
  452. package/dist/field/features/relationship/i18n.d.ts.map +1 -0
  453. package/dist/field/features/relationship/i18n.js +100 -0
  454. package/dist/field/features/relationship/i18n.js.map +1 -0
  455. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +4 -9
  456. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  457. package/dist/field/features/relationship/nodes/RelationshipNode.js +12 -11
  458. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  459. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  460. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +119 -56
  461. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  462. package/dist/field/features/relationship/plugins/index.d.ts +2 -2
  463. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  464. package/dist/field/features/relationship/plugins/index.js +16 -18
  465. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  466. package/dist/field/features/relationship/utils/EnabledRelationshipsCondition.d.ts.map +1 -1
  467. package/dist/field/features/relationship/utils/EnabledRelationshipsCondition.js +1 -3
  468. package/dist/field/features/relationship/utils/EnabledRelationshipsCondition.js.map +1 -1
  469. package/dist/field/features/shared/slashMenu/basicGroup.d.ts +3 -0
  470. package/dist/field/features/shared/slashMenu/basicGroup.d.ts.map +1 -0
  471. package/dist/field/features/shared/slashMenu/basicGroup.js +11 -0
  472. package/dist/field/features/shared/slashMenu/basicGroup.js.map +1 -0
  473. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts +3 -0
  474. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -0
  475. package/dist/field/features/shared/toolbar/addDropdownGroup.js +12 -0
  476. package/dist/field/features/shared/toolbar/addDropdownGroup.js.map +1 -0
  477. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts +3 -0
  478. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -0
  479. package/dist/field/features/shared/toolbar/featureButtonsGroup.js +10 -0
  480. package/dist/field/features/shared/toolbar/featureButtonsGroup.js.map +1 -0
  481. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts +3 -0
  482. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -0
  483. package/dist/field/features/shared/toolbar/textDropdownGroup.js +12 -0
  484. package/dist/field/features/shared/toolbar/textDropdownGroup.js.map +1 -0
  485. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts +5 -0
  486. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -0
  487. package/dist/field/features/toolbars/fixed/Toolbar/index.js +207 -0
  488. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -0
  489. package/dist/field/features/toolbars/fixed/feature.client.d.ts +7 -0
  490. package/dist/field/features/toolbars/fixed/feature.client.d.ts.map +1 -0
  491. package/dist/field/features/toolbars/fixed/feature.client.js +20 -0
  492. package/dist/field/features/toolbars/fixed/feature.client.js.map +1 -0
  493. package/dist/field/features/toolbars/fixed/feature.server.d.ts +19 -0
  494. package/dist/field/features/toolbars/fixed/feature.server.d.ts.map +1 -0
  495. package/dist/field/features/toolbars/fixed/feature.server.js +21 -0
  496. package/dist/field/features/toolbars/fixed/feature.server.js.map +1 -0
  497. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts +4 -0
  498. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts.map +1 -0
  499. package/dist/field/features/toolbars/inline/Toolbar/index.js +319 -0
  500. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -0
  501. package/dist/field/features/toolbars/inline/feature.client.d.ts +6 -0
  502. package/dist/field/features/toolbars/inline/feature.client.d.ts.map +1 -0
  503. package/dist/field/features/toolbars/inline/feature.client.js +20 -0
  504. package/dist/field/features/toolbars/inline/feature.client.js.map +1 -0
  505. package/dist/field/features/toolbars/inline/feature.server.d.ts +3 -0
  506. package/dist/field/features/toolbars/inline/feature.server.d.ts.map +1 -0
  507. package/dist/field/features/toolbars/inline/feature.server.js +16 -0
  508. package/dist/field/features/toolbars/inline/feature.server.js.map +1 -0
  509. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +10 -0
  510. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -0
  511. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.js +34 -23
  512. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -0
  513. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +22 -0
  514. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -0
  515. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/DropDown.js +75 -102
  516. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -0
  517. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +23 -0
  518. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -0
  519. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +141 -0
  520. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -0
  521. package/dist/field/features/toolbars/types.d.ts +48 -0
  522. package/dist/field/features/toolbars/types.d.ts.map +1 -0
  523. package/dist/field/features/toolbars/types.js.map +1 -0
  524. package/dist/field/features/typeUtilities.d.ts +8 -0
  525. package/dist/field/features/typeUtilities.d.ts.map +1 -0
  526. package/dist/field/features/typeUtilities.js +8 -0
  527. package/dist/field/features/typeUtilities.js.map +1 -0
  528. package/dist/field/features/types.d.ts +259 -69
  529. package/dist/field/features/types.d.ts.map +1 -1
  530. package/dist/field/features/types.js.map +1 -1
  531. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts +1 -1
  532. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
  533. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +35 -37
  534. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  535. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  536. package/dist/field/features/upload/component/index.js +160 -85
  537. package/dist/field/features/upload/component/index.js.map +1 -1
  538. package/dist/field/features/upload/drawer/commands.d.ts.map +1 -1
  539. package/dist/field/features/upload/drawer/commands.js +1 -2
  540. package/dist/field/features/upload/drawer/commands.js.map +1 -1
  541. package/dist/field/features/upload/drawer/index.d.ts.map +1 -1
  542. package/dist/field/features/upload/drawer/index.js +17 -18
  543. package/dist/field/features/upload/drawer/index.js.map +1 -1
  544. package/dist/field/features/upload/feature.client.d.ts +4 -1
  545. package/dist/field/features/upload/feature.client.d.ts.map +1 -1
  546. package/dist/field/features/upload/feature.client.js +52 -26
  547. package/dist/field/features/upload/feature.client.js.map +1 -1
  548. package/dist/field/features/upload/feature.server.d.ts +10 -3
  549. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  550. package/dist/field/features/upload/feature.server.js +93 -15
  551. package/dist/field/features/upload/feature.server.js.map +1 -1
  552. package/dist/field/features/upload/{populationPromise.d.ts → graphQLPopulationPromise.d.ts} +1 -1
  553. package/dist/field/features/upload/graphQLPopulationPromise.d.ts.map +1 -0
  554. package/dist/field/features/upload/graphQLPopulationPromise.js +52 -0
  555. package/dist/field/features/upload/graphQLPopulationPromise.js.map +1 -0
  556. package/dist/field/features/upload/i18n.d.ts +3 -0
  557. package/dist/field/features/upload/i18n.d.ts.map +1 -0
  558. package/dist/field/features/upload/i18n.js +100 -0
  559. package/dist/field/features/upload/i18n.js.map +1 -0
  560. package/dist/field/features/upload/nodes/UploadNode.d.ts +7 -19
  561. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  562. package/dist/field/features/upload/nodes/UploadNode.js +45 -15
  563. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  564. package/dist/field/features/upload/plugin/index.d.ts +5 -4
  565. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  566. package/dist/field/features/upload/plugin/index.js +18 -20
  567. package/dist/field/features/upload/plugin/index.js.map +1 -1
  568. package/dist/field/features/upload/validate.d.ts +2 -1
  569. package/dist/field/features/upload/validate.d.ts.map +1 -1
  570. package/dist/field/features/upload/validate.js +37 -10
  571. package/dist/field/features/upload/validate.js.map +1 -1
  572. package/dist/field/index.d.ts +3 -1
  573. package/dist/field/index.d.ts.map +1 -1
  574. package/dist/field/index.js +35 -86
  575. package/dist/field/index.js.map +1 -1
  576. package/dist/field/lexical/EditorPlugin.d.ts +1 -0
  577. package/dist/field/lexical/EditorPlugin.d.ts.map +1 -1
  578. package/dist/field/lexical/EditorPlugin.js +8 -4
  579. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  580. package/dist/field/lexical/LexicalEditor.d.ts +3 -1
  581. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  582. package/dist/field/lexical/LexicalEditor.js +157 -77
  583. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  584. package/dist/field/lexical/LexicalProvider.d.ts +1 -2
  585. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  586. package/dist/field/lexical/LexicalProvider.js +52 -41
  587. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  588. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts +15 -4
  589. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  590. package/dist/field/lexical/config/client/EditorConfigProvider.js +61 -11
  591. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  592. package/dist/field/lexical/config/client/default.d.ts +1 -1
  593. package/dist/field/lexical/config/client/default.d.ts.map +1 -1
  594. package/dist/field/lexical/config/client/default.js.map +1 -1
  595. package/dist/field/lexical/config/client/sanitize.d.ts +3 -2
  596. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  597. package/dist/field/lexical/config/client/sanitize.js +83 -33
  598. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  599. package/dist/field/lexical/config/server/default.d.ts +2 -3
  600. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  601. package/dist/field/lexical/config/server/default.js +11 -11
  602. package/dist/field/lexical/config/server/default.js.map +1 -1
  603. package/dist/field/lexical/config/server/loader.d.ts +5 -2
  604. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  605. package/dist/field/lexical/config/server/loader.js +4 -2
  606. package/dist/field/lexical/config/server/loader.js.map +1 -1
  607. package/dist/field/lexical/config/server/sanitize.d.ts +2 -1
  608. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  609. package/dist/field/lexical/config/server/sanitize.js +39 -9
  610. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  611. package/dist/field/lexical/config/types.d.ts +3 -1
  612. package/dist/field/lexical/config/types.d.ts.map +1 -1
  613. package/dist/field/lexical/config/types.js.map +1 -1
  614. package/dist/field/lexical/nodes/index.d.ts +1 -2
  615. package/dist/field/lexical/nodes/index.d.ts.map +1 -1
  616. package/dist/field/lexical/nodes/index.js.map +1 -1
  617. package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  618. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +3 -3
  619. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  620. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +10 -10
  621. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  622. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +74 -77
  623. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  624. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +5 -5
  625. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  626. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +8 -10
  627. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  628. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +19 -27
  629. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  630. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js +1 -37
  631. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  632. package/dist/field/lexical/plugins/SlashMenu/index.d.ts +2 -2
  633. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  634. package/dist/field/lexical/plugins/SlashMenu/index.js +108 -93
  635. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  636. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +2 -2
  637. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  638. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +39 -123
  639. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  640. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts +1 -1
  641. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -1
  642. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
  643. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +2 -2
  644. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  645. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +109 -65
  646. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  647. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts +8 -1
  648. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  649. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +83 -16
  650. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  651. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts +5 -0
  652. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -0
  653. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js +21 -0
  654. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -0
  655. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.d.ts +5 -1
  656. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -0
  657. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.js +5 -18
  658. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -0
  659. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  660. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +1 -2
  661. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  662. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  663. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +4 -2
  664. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  665. package/dist/field/lexical/theme/EditorTheme.d.ts.map +1 -1
  666. package/dist/field/lexical/theme/EditorTheme.js +1 -1
  667. package/dist/field/lexical/theme/EditorTheme.js.map +1 -1
  668. package/dist/field/lexical/ui/ContentEditable.d.ts +1 -1
  669. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  670. package/dist/field/lexical/ui/ContentEditable.js +3 -4
  671. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  672. package/dist/field/lexical/ui/icons/AI/index.js +26 -17
  673. package/dist/field/lexical/ui/icons/AI/index.js.map +1 -1
  674. package/dist/field/lexical/ui/icons/Add/index.d.ts +3 -0
  675. package/dist/field/lexical/ui/icons/Add/index.d.ts.map +1 -0
  676. package/dist/field/lexical/ui/icons/Add/index.js +21 -0
  677. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -0
  678. package/dist/field/lexical/ui/icons/Add/light.svg +4 -0
  679. package/dist/field/lexical/ui/icons/AlignCenter/index.js +21 -15
  680. package/dist/field/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  681. package/dist/field/lexical/ui/icons/AlignJustify/index.js +21 -15
  682. package/dist/field/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  683. package/dist/field/lexical/ui/icons/AlignLeft/index.js +21 -15
  684. package/dist/field/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  685. package/dist/field/lexical/ui/icons/AlignRight/index.js +21 -15
  686. package/dist/field/lexical/ui/icons/AlignRight/index.js.map +1 -1
  687. package/dist/field/lexical/ui/icons/Block/index.js +30 -24
  688. package/dist/field/lexical/ui/icons/Block/index.js.map +1 -1
  689. package/dist/field/lexical/ui/icons/Blockquote/index.js +8 -6
  690. package/dist/field/lexical/ui/icons/Blockquote/index.js.map +1 -1
  691. package/dist/field/lexical/ui/icons/Bold/index.js +8 -6
  692. package/dist/field/lexical/ui/icons/Bold/index.js.map +1 -1
  693. package/dist/field/lexical/ui/icons/Checklist/index.js +19 -14
  694. package/dist/field/lexical/ui/icons/Checklist/index.js.map +1 -1
  695. package/dist/field/lexical/ui/icons/Code/index.js +14 -9
  696. package/dist/field/lexical/ui/icons/Code/index.js.map +1 -1
  697. package/dist/field/lexical/ui/icons/CodeBlock/index.js +14 -9
  698. package/dist/field/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  699. package/dist/field/lexical/ui/icons/DraggableBlock/light.svg +9 -0
  700. package/dist/field/lexical/ui/icons/H1/index.js +8 -6
  701. package/dist/field/lexical/ui/icons/H1/index.js.map +1 -1
  702. package/dist/field/lexical/ui/icons/H2/index.js +8 -6
  703. package/dist/field/lexical/ui/icons/H2/index.js.map +1 -1
  704. package/dist/field/lexical/ui/icons/H3/index.js +8 -6
  705. package/dist/field/lexical/ui/icons/H3/index.js.map +1 -1
  706. package/dist/field/lexical/ui/icons/H4/index.js +8 -6
  707. package/dist/field/lexical/ui/icons/H4/index.js.map +1 -1
  708. package/dist/field/lexical/ui/icons/H5/index.js +8 -6
  709. package/dist/field/lexical/ui/icons/H5/index.js.map +1 -1
  710. package/dist/field/lexical/ui/icons/H6/index.js +8 -6
  711. package/dist/field/lexical/ui/icons/H6/index.js.map +1 -1
  712. package/dist/field/lexical/ui/icons/HorizontalRule/index.js +11 -9
  713. package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  714. package/dist/field/lexical/ui/icons/IndentDecrease/index.js +25 -18
  715. package/dist/field/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  716. package/dist/field/lexical/ui/icons/IndentIncrease/index.js +25 -18
  717. package/dist/field/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  718. package/dist/field/lexical/ui/icons/Italic/index.js +8 -6
  719. package/dist/field/lexical/ui/icons/Italic/index.js.map +1 -1
  720. package/dist/field/lexical/ui/icons/Link/index.d.ts.map +1 -1
  721. package/dist/field/lexical/ui/icons/Link/index.js +10 -18
  722. package/dist/field/lexical/ui/icons/Link/index.js.map +1 -1
  723. package/dist/field/lexical/ui/icons/OrderedList/index.js +29 -21
  724. package/dist/field/lexical/ui/icons/OrderedList/index.js.map +1 -1
  725. package/dist/field/lexical/ui/icons/Relationship/index.js +26 -17
  726. package/dist/field/lexical/ui/icons/Relationship/index.js.map +1 -1
  727. package/dist/field/lexical/ui/icons/Strikethrough/index.js +14 -9
  728. package/dist/field/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  729. package/dist/field/lexical/ui/icons/Subscript/index.js +8 -6
  730. package/dist/field/lexical/ui/icons/Subscript/index.js.map +1 -1
  731. package/dist/field/lexical/ui/icons/Superscript/index.js +8 -6
  732. package/dist/field/lexical/ui/icons/Superscript/index.js.map +1 -1
  733. package/dist/field/lexical/ui/icons/Text/index.js +8 -6
  734. package/dist/field/lexical/ui/icons/Text/index.js.map +1 -1
  735. package/dist/field/lexical/ui/icons/Underline/index.js +14 -9
  736. package/dist/field/lexical/ui/icons/Underline/index.js.map +1 -1
  737. package/dist/field/lexical/ui/icons/UnorderedList/index.js +45 -36
  738. package/dist/field/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  739. package/dist/field/lexical/ui/icons/Upload/index.js +24 -18
  740. package/dist/field/lexical/ui/icons/Upload/index.js.map +1 -1
  741. package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -1
  742. package/dist/field/lexical/utils/getSelectedNode.js +1 -2
  743. package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
  744. package/dist/field/lexical/utils/nodeFormat.d.ts +2 -2
  745. package/dist/field/lexical/utils/nodeFormat.d.ts.map +1 -1
  746. package/dist/field/lexical/utils/nodeFormat.js +1 -1
  747. package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
  748. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +11 -1
  749. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  750. package/dist/field/lexical/utils/setFloatingElemPosition.js +16 -13
  751. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  752. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  753. package/dist/field/lexical/utils/url.js +13 -2
  754. package/dist/field/lexical/utils/url.js.map +1 -1
  755. package/dist/forEachNodeRecursively.d.ts +10 -0
  756. package/dist/forEachNodeRecursively.d.ts.map +1 -0
  757. package/dist/forEachNodeRecursively.js +24 -0
  758. package/dist/forEachNodeRecursively.js.map +1 -0
  759. package/dist/generateComponentMap.d.ts +1 -1
  760. package/dist/generateComponentMap.d.ts.map +1 -1
  761. package/dist/generateComponentMap.js +21 -29
  762. package/dist/generateComponentMap.js.map +1 -1
  763. package/dist/generateSchemaMap.d.ts +1 -1
  764. package/dist/generateSchemaMap.d.ts.map +1 -1
  765. package/dist/generateSchemaMap.js +4 -12
  766. package/dist/generateSchemaMap.js.map +1 -1
  767. package/dist/i18n.d.ts +3 -0
  768. package/dist/i18n.d.ts.map +1 -0
  769. package/dist/i18n.js +164 -0
  770. package/dist/i18n.js.map +1 -0
  771. package/dist/index.d.ts +21 -36
  772. package/dist/index.d.ts.map +1 -1
  773. package/dist/index.js +619 -200
  774. package/dist/index.js.map +1 -1
  775. package/dist/{populate → populateGraphQL}/defaultValue.d.ts +0 -1
  776. package/dist/populateGraphQL/defaultValue.d.ts.map +1 -0
  777. package/dist/{populate → populateGraphQL}/defaultValue.js +1 -19
  778. package/dist/populateGraphQL/defaultValue.js.map +1 -0
  779. package/dist/populateGraphQL/populate.d.ts +17 -0
  780. package/dist/populateGraphQL/populate.d.ts.map +1 -0
  781. package/dist/populateGraphQL/populate.js +28 -0
  782. package/dist/populateGraphQL/populate.js.map +1 -0
  783. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +12 -0
  784. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -0
  785. package/dist/populateGraphQL/populateLexicalPopulationPromises.js +37 -0
  786. package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -0
  787. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts +28 -0
  788. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -0
  789. package/dist/{populate/recurseNestedFields.js → populateGraphQL/recursivelyPopulateFieldsForGraphQL.js} +7 -5
  790. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js.map +1 -0
  791. package/dist/recurseNodeTree.d.ts +9 -0
  792. package/dist/recurseNodeTree.d.ts.map +1 -0
  793. package/dist/recurseNodeTree.js +27 -0
  794. package/dist/recurseNodeTree.js.map +1 -0
  795. package/dist/types.d.ts +45 -8
  796. package/dist/types.d.ts.map +1 -1
  797. package/dist/types.js.map +1 -1
  798. package/dist/useLexicalFeature.d.ts.map +1 -1
  799. package/dist/useLexicalFeature.js +6 -3
  800. package/dist/useLexicalFeature.js.map +1 -1
  801. package/dist/validate/index.d.ts +2 -2
  802. package/dist/validate/index.d.ts.map +1 -1
  803. package/dist/validate/index.js +3 -2
  804. package/dist/validate/index.js.map +1 -1
  805. package/dist/validate/validateNodes.d.ts +1 -1
  806. package/dist/validate/validateNodes.d.ts.map +1 -1
  807. package/dist/validate/validateNodes.js +1 -1
  808. package/dist/validate/validateNodes.js.map +1 -1
  809. package/package.json +71 -53
  810. package/dist/exports/components.d.ts +0 -6
  811. package/dist/exports/components.d.ts.map +0 -1
  812. package/dist/exports/components.js +0 -7
  813. package/dist/exports/components.js.map +0 -1
  814. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts +0 -3
  815. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts.map +0 -1
  816. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js +0 -12
  817. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js.map +0 -1
  818. package/dist/field/features/blocks/component/index.scss +0 -153
  819. package/dist/field/features/blocks/populationPromise.d.ts.map +0 -1
  820. package/dist/field/features/blocks/populationPromise.js +0 -46
  821. package/dist/field/features/blocks/populationPromise.js.map +0 -1
  822. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts +0 -3
  823. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts.map +0 -1
  824. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js +0 -10
  825. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js.map +0 -1
  826. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts +0 -3
  827. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts.map +0 -1
  828. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js +0 -12
  829. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js.map +0 -1
  830. package/dist/field/features/debug/testrecorder/feature.client.d.ts.map +0 -1
  831. package/dist/field/features/debug/testrecorder/feature.server.d.ts.map +0 -1
  832. package/dist/field/features/debug/testrecorder/feature.server.js.map +0 -1
  833. package/dist/field/features/debug/testrecorder/plugin/index.d.ts +0 -5
  834. package/dist/field/features/debug/testrecorder/plugin/index.d.ts.map +0 -1
  835. package/dist/field/features/debug/testrecorder/plugin/index.js.map +0 -1
  836. package/dist/field/features/debug/testrecorder/plugin/index.scss +0 -49
  837. package/dist/field/features/debug/treeview/feature.client.d.ts.map +0 -1
  838. package/dist/field/features/debug/treeview/feature.server.d.ts.map +0 -1
  839. package/dist/field/features/debug/treeview/feature.server.js.map +0 -1
  840. package/dist/field/features/debug/treeview/plugin/index.d.ts +0 -4
  841. package/dist/field/features/debug/treeview/plugin/index.d.ts.map +0 -1
  842. package/dist/field/features/debug/treeview/plugin/index.js.map +0 -1
  843. package/dist/field/features/debug/treeview/plugin/index.scss +0 -78
  844. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts +0 -3
  845. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts.map +0 -1
  846. package/dist/field/features/format/common/floatingSelectToolbarSection.js +0 -10
  847. package/dist/field/features/format/common/floatingSelectToolbarSection.js.map +0 -1
  848. package/dist/field/features/format/inlinecode/feature.client.d.ts.map +0 -1
  849. package/dist/field/features/format/inlinecode/feature.client.js +0 -43
  850. package/dist/field/features/format/inlinecode/feature.client.js.map +0 -1
  851. package/dist/field/features/format/inlinecode/feature.server.d.ts.map +0 -1
  852. package/dist/field/features/format/inlinecode/feature.server.js.map +0 -1
  853. package/dist/field/features/horizontalrule/component/index.d.ts.map +0 -1
  854. package/dist/field/features/horizontalrule/component/index.js.map +0 -1
  855. package/dist/field/features/horizontalrule/feature.client.d.ts.map +0 -1
  856. package/dist/field/features/horizontalrule/feature.client.js +0 -53
  857. package/dist/field/features/horizontalrule/feature.client.js.map +0 -1
  858. package/dist/field/features/horizontalrule/feature.server.d.ts.map +0 -1
  859. package/dist/field/features/horizontalrule/feature.server.js.map +0 -1
  860. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts.map +0 -1
  861. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js.map +0 -1
  862. package/dist/field/features/horizontalrule/plugin/index.d.ts +0 -6
  863. package/dist/field/features/horizontalrule/plugin/index.d.ts.map +0 -1
  864. package/dist/field/features/horizontalrule/plugin/index.js.map +0 -1
  865. package/dist/field/features/horizontalrule/plugin/index.scss +0 -20
  866. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts +0 -3
  867. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts.map +0 -1
  868. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js +0 -10
  869. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js.map +0 -1
  870. package/dist/field/features/indent/index.scss +0 -4
  871. package/dist/field/features/link/drawer/index.scss +0 -50
  872. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +0 -78
  873. package/dist/field/features/link/populationPromise.d.ts.map +0 -1
  874. package/dist/field/features/link/populationPromise.js +0 -46
  875. package/dist/field/features/link/populationPromise.js.map +0 -1
  876. package/dist/field/features/lists/common/markdown.js.map +0 -1
  877. package/dist/field/features/lists/orderedlist/feature.client.d.ts.map +0 -1
  878. package/dist/field/features/lists/orderedlist/feature.client.js +0 -72
  879. package/dist/field/features/lists/orderedlist/feature.client.js.map +0 -1
  880. package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +0 -1
  881. package/dist/field/features/lists/orderedlist/feature.server.js.map +0 -1
  882. package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +0 -1
  883. package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +0 -1
  884. package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +0 -1
  885. package/dist/field/features/lists/unorderedlist/feature.client.js +0 -72
  886. package/dist/field/features/lists/unorderedlist/feature.client.js.map +0 -1
  887. package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +0 -1
  888. package/dist/field/features/lists/unorderedlist/feature.server.js.map +0 -1
  889. package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +0 -1
  890. package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +0 -1
  891. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.scss +0 -14
  892. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.scss +0 -14
  893. package/dist/field/features/relationship/nodes/components/index.scss +0 -97
  894. package/dist/field/features/relationship/populationPromise.d.ts +0 -4
  895. package/dist/field/features/relationship/populationPromise.d.ts.map +0 -1
  896. package/dist/field/features/relationship/populationPromise.js +0 -24
  897. package/dist/field/features/relationship/populationPromise.js.map +0 -1
  898. package/dist/field/features/upload/component/index.scss +0 -152
  899. package/dist/field/features/upload/populationPromise.d.ts.map +0 -1
  900. package/dist/field/features/upload/populationPromise.js +0 -46
  901. package/dist/field/features/upload/populationPromise.js.map +0 -1
  902. package/dist/field/index.scss +0 -46
  903. package/dist/field/lexical/LexicalEditor.scss +0 -56
  904. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts +0 -8
  905. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +0 -1
  906. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +0 -1
  907. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.scss +0 -37
  908. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts +0 -17
  909. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +0 -1
  910. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +0 -1
  911. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts +0 -18
  912. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts.map +0 -1
  913. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js +0 -42
  914. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js.map +0 -1
  915. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.scss +0 -100
  916. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts +0 -6
  917. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +0 -1
  918. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js +0 -270
  919. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +0 -1
  920. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.scss +0 -57
  921. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts +0 -40
  922. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts.map +0 -1
  923. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.js.map +0 -1
  924. package/dist/field/lexical/plugins/SlashMenu/index.scss +0 -61
  925. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.scss +0 -31
  926. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +0 -1
  927. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +0 -1
  928. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +0 -55
  929. package/dist/field/lexical/theme/EditorTheme.scss +0 -505
  930. package/dist/field/lexical/ui/ContentEditable.scss +0 -25
  931. package/dist/populate/defaultValue.d.ts.map +0 -1
  932. package/dist/populate/defaultValue.js.map +0 -1
  933. package/dist/populate/populate.d.ts +0 -21
  934. package/dist/populate/populate.d.ts.map +0 -1
  935. package/dist/populate/populate.js +0 -21
  936. package/dist/populate/populate.js.map +0 -1
  937. package/dist/populate/recurseNestedFields.d.ts +0 -25
  938. package/dist/populate/recurseNestedFields.d.ts.map +0 -1
  939. package/dist/populate/recurseNestedFields.js.map +0 -1
  940. package/dist/populate/richTextRelationshipPromise.d.ts +0 -23
  941. package/dist/populate/richTextRelationshipPromise.d.ts.map +0 -1
  942. package/dist/populate/richTextRelationshipPromise.js +0 -68
  943. package/dist/populate/richTextRelationshipPromise.js.map +0 -1
  944. package/dist/scss/app.scss +0 -208
  945. package/dist/scss/colors.scss +0 -269
  946. package/dist/scss/queries.scss +0 -27
  947. package/dist/scss/resets.scss +0 -17
  948. package/dist/scss/styles.scss +0 -11
  949. package/dist/scss/svg.scss +0 -10
  950. package/dist/scss/toastify.scss +0 -58
  951. package/dist/scss/type.scss +0 -117
  952. package/dist/scss/vars.scss +0 -213
  953. package/dist/scss/z-index.scss +0 -9
  954. package/src/index.ts +0 -423
  955. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js +0 -0
  956. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts +0 -0
  957. /package/dist/field/features/debug/{treeview → treeView}/feature.client.js +0 -0
  958. /package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts +0 -0
  959. /package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts +0 -0
  960. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts +0 -0
  961. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js +0 -0
  962. /package/dist/field/features/{horizontalrule → horizontalRule}/component/index.d.ts +0 -0
  963. /package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.d.ts +0 -0
  964. /package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.d.ts +0 -0
  965. /package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.js +0 -0
  966. /package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.d.ts +0 -0
  967. /package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.d.ts +0 -0
  968. /package/dist/field/features/lists/{common → shared}/markdown.d.ts +0 -0
  969. /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.d.ts +0 -0
  970. /package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.d.ts +0 -0
  971. /package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars}/types.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/lexical/plugins/handles/DraggableBlockPlugin/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\nimport type { DragEvent as ReactDragEvent } from 'react'\n\nimport lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'\nconst { useLexicalComposerContext } = lexicalComposerContextImport\n\nimport { eventFiles } from '@lexical/rich-text'\nimport lexicalImport from 'lexical'\nconst { $getNearestNodeFromDOMNode, $getNodeByKey } = lexicalImport\nimport * as React from 'react'\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { isHTMLElement } from '../../../utils/guard.js'\nimport { Point } from '../../../utils/point.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 { getNodeCloseToPoint } from './getNodeCloseToPoint.js'\nimport './index.scss'\nimport { setTargetLine } from './setTargetLine.js'\n\nconst SPACE = -24\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 = '1'\n lastTargetBlockElem.style.transform = 'translate(0, 0)'\n //lastTargetBlockElem.style.border = 'none'\n }\n}\n\nfunction useDraggableBlockMenu(\n editor: LexicalEditor,\n anchorElem: HTMLElement,\n isEditable: boolean,\n): JSX.Element {\n const scrollerElem = anchorElem.parentElement\n\n const menuRef = useRef<HTMLDivElement>(null)\n const targetLineRef = useRef<HTMLDivElement>(null)\n const debugHighlightRef = useRef<HTMLDivElement>(null)\n const isDraggingBlockRef = useRef<boolean>(false)\n const [draggableBlockElem, setDraggableBlockElem] = useState<HTMLElement | null>(null)\n const [lastTargetBlockElem, setLastTargetBlockElem] = useState<HTMLElement | null>(null)\n\n const calculateDistanceFromScrollerElem = useCallback(\n (\n pageX: number,\n pageY: number,\n target: HTMLElement,\n horizontalBuffer: number = 50,\n verticalBuffer: number = 25,\n ): number => {\n let distanceFromScrollerElem = 0\n // Calculate distance between scrollerElem and target if target is not in scrollerElem\n if (scrollerElem && !scrollerElem.contains(target)) {\n const { bottom, left, right, top } = scrollerElem.getBoundingClientRect()\n\n const adjustedTop = top + window.scrollY\n const adjustedBottom = bottom + window.scrollY\n\n if (\n pageY < adjustedTop - verticalBuffer ||\n pageY > adjustedBottom + verticalBuffer ||\n pageX < left - horizontalBuffer ||\n pageX > right + horizontalBuffer\n ) {\n setDraggableBlockElem(null)\n return distanceFromScrollerElem\n }\n\n // This is used to allow the _draggableBlockElem to be found when the mouse is in the\n // buffer zone around the scrollerElem.\n if (pageX < left || pageX > right) {\n distanceFromScrollerElem = pageX < left ? pageX - left : pageX - right\n }\n }\n return distanceFromScrollerElem\n },\n [scrollerElem],\n )\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 event.pageX,\n event.pageY,\n target,\n )\n\n if (isOnHandleElement(target, DRAGGABLE_BLOCK_MENU_CLASSNAME)) {\n return\n }\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n const {\n blockElem: _draggableBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n cache_treshold: 0,\n editor,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: false,\n })\n //if (DEBUG && _draggableBlockElem) {\n //targetBlockElem.style.border = '3px solid red'\n // highlightElemOriginalPosition(debugHighlightRef, _draggableBlockElem, anchorElem)\n //}\n prevIndex = foundAtIndex\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 the\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, calculateDistanceFromScrollerElem, draggableBlockElem])\n\n useEffect(() => {\n if (menuRef.current) {\n setHandlePosition(draggableBlockElem, menuRef.current, anchorElem, SPACE)\n }\n }, [anchorElem, draggableBlockElem])\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 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 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 if (draggableBlockElem !== targetBlockElem) {\n setTargetLine(\n SPACE,\n targetLineElem,\n targetBlockElem,\n lastTargetBlockElem,\n pageY,\n anchorElem,\n event,\n debugHighlightRef,\n isFoundNodeEmptyParagraph,\n )\n\n // Prevent default event to be able to trigger onDrop events\n // Calling preventDefault() adds the green plus icon to the cursor,\n // indicating that the drop is allowed.\n event.preventDefault()\n } else {\n hideTargetLine(targetLineElem, lastTargetBlockElem)\n }\n\n setLastTargetBlockElem(targetBlockElem)\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 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\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 }\n }, [\n anchorElem,\n editor,\n lastTargetBlockElem,\n calculateDistanceFromScrollerElem,\n draggableBlockElem,\n ])\n\n function onDragStart(event: ReactDragEvent<HTMLDivElement>): void {\n const dataTransfer = event.dataTransfer\n if (!dataTransfer || !draggableBlockElem) {\n return\n }\n setDragImage(dataTransfer, draggableBlockElem)\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 hideTargetLine(targetLineRef.current, lastTargetBlockElem)\n }\n\n return createPortal(\n <React.Fragment>\n <div\n className=\"icon draggable-block-menu\"\n draggable\n onDragEnd={onDragEnd}\n onDragStart={onDragStart}\n ref={menuRef}\n >\n <div className={isEditable ? 'icon' : ''} />\n </div>\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}): JSX.Element {\n const [editor] = useLexicalComposerContext()\n return useDraggableBlockMenu(editor, anchorElem, editor._editable)\n}\n"],"names":["lexicalComposerContextImport","useLexicalComposerContext","eventFiles","lexicalImport","$getNearestNodeFromDOMNode","$getNodeByKey","React","useCallback","useEffect","useRef","useState","createPortal","isHTMLElement","Point","getTopLevelNodeKeys","isOnHandleElement","setHandlePosition","getBoundingClientRectWithoutTransform","getNodeCloseToPoint","setTargetLine","SPACE","DRAGGABLE_BLOCK_MENU_CLASSNAME","DRAG_DATA_FORMAT","prevIndex","Infinity","getCurrentIndex","keysLength","Math","floor","setDragImage","dataTransfer","draggableBlockElem","transform","style","setTimeout","hideTargetLine","targetLineElem","lastTargetBlockElem","opacity","useDraggableBlockMenu","editor","anchorElem","isEditable","scrollerElem","parentElement","menuRef","targetLineRef","debugHighlightRef","isDraggingBlockRef","setDraggableBlockElem","setLastTargetBlockElem","calculateDistanceFromScrollerElem","pageX","pageY","target","horizontalBuffer","verticalBuffer","distanceFromScrollerElem","contains","bottom","left","right","top","getBoundingClientRect","adjustedTop","window","scrollY","adjustedBottom","onDocumentMouseMove","event","topLevelNodeKeys","blockElem","_draggableBlockElem","foundAtIndex","isFoundNodeEmptyParagraph","cache_treshold","horizontalOffset","point","x","y","startIndex","length","useEdgeAsDefault","document","addEventListener","removeEventListener","current","onDragover","isFileTransfer","targetBlockElem","fuzzy","verbose","preventDefault","onDrop","dragData","getData","update","draggedNode","targetNode","height","targetBlockElemHeight","targetBlockElemTop","mouseY","isBelow","insertAfter","insertBefore","remove","onDragStart","nodeKey","node","getKey","setData","onDragEnd","Fragment","div","className","draggable","ref","DraggableBlockPlugin","body","_editable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,OAAOA,kCAAkC,2CAA0C;AACnF,MAAM,EAAEC,yBAAyB,EAAE,GAAGD;AAEtC,SAASE,UAAU,QAAQ,qBAAoB;AAC/C,OAAOC,mBAAmB,UAAS;AACnC,MAAM,EAAEC,0BAA0B,EAAEC,aAAa,EAAE,GAAGF;AACtD,YAAYG,WAAW,QAAO;AAC9B,SAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAChE,SAASC,YAAY,QAAQ,YAAW;AAExC,SAASC,aAAa,QAAQ,0BAAyB;AACvD,SAASC,KAAK,QAAQ,0BAAyB;AAC/C,SAASC,mBAAmB,QAAQ,kCAAiC;AACrE,SAASC,iBAAiB,QAAQ,gCAA+B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,GAAG;QAC7BnD,eAAeW,cAAcwC,OAAO,EAAEjD;IACxC;IAEA,qBAAO1B,2BACL,oBAACL,MAAM2G,QAAQ,sBACb,oBAACC;QACCC,WAAU;QACVC,WAAAA;QACAJ,WAAWA;QACXL,aAAaA;QACbU,KAAKxE;qBAEL,oBAACqE;QAAIC,WAAWzE,aAAa,SAAS;uBAExC,oBAACwE;QAAIC,WAAU;QAA8BE,KAAKvE;sBAClD,oBAACoE;QAAIC,WAAU;QAAkBE,KAAKtE;SAExCN;AAEJ;AAEA,OAAO,SAAS6E,qBAAqB,EACnC7E,aAAa0C,SAASoC,IAAI,EAG3B;IACC,MAAM,CAAC/E,OAAO,GAAGvC;IACjB,OAAOsC,sBAAsBC,QAAQC,YAAYD,OAAOgF,SAAS;AACnE"}
1
+ {"version":3,"sources":["../../../../../../src/field/lexical/plugins/handles/DraggableBlockPlugin/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\nimport type { JSX, DragEvent as ReactDragEvent } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { eventFiles } from '@lexical/rich-text'\nimport { $getNearestNodeFromDOMNode, $getNodeByKey } 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 { isHTMLElement } from '../../../utils/guard.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.scss'\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<HTMLDivElement>(null)\n const targetLineRef = useRef<HTMLDivElement>(null)\n const debugHighlightRef = useRef<HTMLDivElement>(null)\n const isDraggingBlockRef = useRef<boolean>(false)\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)\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 if (draggableBlockElem !== targetBlockElem) {\n const { isBelow, willStayInSamePosition } = setTargetLine(\n editorConfig?.admin?.hideGutter ? '0px' : '3rem',\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 // Prevent default event to be able to trigger onDrop events\n // Calling preventDefault() adds the green plus icon to the cursor,\n // indicating that the drop is allowed.\n event.preventDefault()\n\n if (!willStayInSamePosition) {\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow,\n })\n }\n } else {\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 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\n const highlightElem = document.createElement('div')\n highlightElem.className = 'lexical-block-highlighter'\n\n // if html data-theme is dark, set the highlighter color to white\n if (document.documentElement.getAttribute('data-theme') === 'dark') {\n highlightElem.style.backgroundColor = 'white'\n } else {\n highlightElem.style.backgroundColor = 'black'\n }\n\n highlightElem.style.transition = 'opacity 0.1s 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 setTimeout(() => {\n highlightElem.style.opacity = '0'\n setTimeout(() => {\n highlightElem.remove()\n }, 1000)\n }, 3000)\n }, 120)\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 }\n }, [\n scrollerElem,\n blockHandleHorizontalOffset,\n anchorElem,\n editor,\n lastTargetBlock,\n draggableBlockElem,\n editorConfig?.admin?.hideGutter,\n ])\n\n function onDragStart(event: ReactDragEvent<HTMLDivElement>): void {\n const dataTransfer = event.dataTransfer\n if (!dataTransfer || !draggableBlockElem) {\n return\n }\n setDragImage(dataTransfer, draggableBlockElem)\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 hideTargetLine(targetLineRef.current, lastTargetBlock?.elem)\n }\n\n return createPortal(\n <React.Fragment>\n <div\n className=\"icon draggable-block-menu\"\n draggable\n onDragEnd={onDragEnd}\n onDragStart={onDragStart}\n ref={menuRef}\n >\n <div className={isEditable ? 'icon' : ''} />\n </div>\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"],"names":["useLexicalComposerContext","eventFiles","$getNearestNodeFromDOMNode","$getNodeByKey","React","useEffect","useRef","useState","createPortal","useEditorConfigContext","isHTMLElement","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","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","isBelow","willStayInSamePosition","getBoundingClientRect","width","preventDefault","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","newInsertedElemRect","highlightElem","createElement","className","documentElement","getAttribute","backgroundColor","transition","zIndex","pointerEvents","boxSizing","borderRadius","position","body","appendChild","left","onDragStart","nodeKey","node","setData","onDragEnd","Fragment","div","draggable","ref","DraggableBlockPlugin","_editable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAIA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,UAAU,QAAQ,qBAAoB;AAC/C,SAASC,0BAA0B,EAAEC,aAAa,QAAQ,UAAS;AACnE,YAAYC,WAAW,QAAO;AAC9B,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AACnD,SAASC,YAAY,QAAQ,YAAW;AAExC,SAASC,sBAAsB,QAAQ,iDAAgD;AACvF,SAASC,aAAa,QAAQ,0BAAyB;AACvD,SAASC,KAAK,QAAQ,0BAAyB;AAC/C,SAASC,iCAAiC,QAAQ,gDAA+C;AACjG,SAASC,mBAAmB,QAAQ,kCAAiC;AACrE,SAASC,mBAAmB,QAAQ,kCAAiC;AACrE,SAASC,iBAAiB,QAAQ,gCAA+B;AACjE,SAASC,iBAAiB,QAAQ,gCAA+B;AACjE,SAASC,qCAAqC,QAAQ,uCAAsC;AAE5F,SAASC,aAAa,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B,OAAO,GAAG;QAC7B9C,eAAea,cAAciC,OAAO,EAAE7B,iBAAiBwC;IACzD;IAEA,qBAAOlF,2BACL,MAACJ,MAAMmI,QAAQ;;0BACb,KAACC;gBACCnB,WAAU;gBACVoB,SAAS;gBACTH,WAAWA;gBACXJ,aAAaA;gBACbQ,KAAK7F;0BAEL,cAAA,KAAC2F;oBAAInB,WAAW3E,aAAa,SAAS;;;0BAExC,KAAC8F;gBAAInB,WAAU;gBAA8BqB,KAAK5F;;0BAClD,KAAC0F;gBAAInB,WAAU;gBAAkBqB,KAAK3F;;;QAExCN;AAEJ;AAEA,OAAO,SAASkG,qBAAqB,EACnClG,aAAamC,SAASmD,IAAI,EAG3B;IACC,MAAM,CAACvF,OAAO,GAAGxC;IACjB,OAAOuC,sBAAsBC,QAAQC,YAAYD,OAAOoG,SAAS;AACnE"}
@@ -1,3 +1,10 @@
1
1
  /// <reference types="react" resolution-mode="require"/>
2
- export declare function setTargetLine(SPACE: number, targetLineElem: HTMLElement, targetBlockElem: HTMLElement, lastTargetBlockElem: HTMLElement | null, mouseY: number, anchorElem: HTMLElement, event: DragEvent, debugHighlightRef: React.RefObject<HTMLDivElement>, isFoundNodeEmptyParagraph?: boolean): void;
2
+ export declare function setTargetLine(offsetWidth: string, offsetLeft: number, targetLineElem: HTMLElement, targetBlockElem: HTMLElement, lastTargetBlock: {
3
+ boundingBox?: DOMRect;
4
+ elem: HTMLElement | null;
5
+ isBelow: boolean;
6
+ }, mouseY: number, anchorElem: HTMLElement, event: DragEvent, debugHighlightRef: React.RefObject<HTMLDivElement | null>, isFoundNodeEmptyParagraph?: boolean): {
7
+ isBelow: boolean;
8
+ willStayInSamePosition: boolean;
9
+ };
3
10
  //# sourceMappingURL=setTargetLine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setTargetLine.d.ts","sourceRoot":"","sources":["../../../../../../src/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.ts"],"names":[],"mappings":";AAOA,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,WAAW,EAC3B,eAAe,EAAE,WAAW,EAC5B,mBAAmB,EAAE,WAAW,GAAG,IAAI,EACvC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,WAAW,EACvB,KAAK,EAAE,SAAS,EAChB,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAClD,yBAAyB,GAAE,OAAe,QAiD3C"}
1
+ {"version":3,"file":"setTargetLine.d.ts","sourceRoot":"","sources":["../../../../../../src/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.ts"],"names":[],"mappings":";AASA,wBAAgB,aAAa,CAC3B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,WAAW,EAC3B,eAAe,EAAE,WAAW,EAC5B,eAAe,EAAE;IACf,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;CACjB,EACD,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,WAAW,EACvB,KAAK,EAAE,SAAS,EAChB,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,EACzD,yBAAyB,GAAE,OAAe;;;EA4I3C"}
@@ -1,16 +1,54 @@
1
1
  import { getCollapsedMargins } from '../utils/getCollapsedMargins.js';
2
- import { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js';
3
2
  import { highlightElemOriginalPosition } from './highlightElemOriginalPosition.js';
4
3
  const TARGET_LINE_HALF_HEIGHT = 25;
5
4
  const TEXT_BOX_HORIZONTAL_PADDING = -24;
6
5
  const DEBUG = false;
7
- export function setTargetLine(SPACE, targetLineElem, targetBlockElem, lastTargetBlockElem, mouseY, anchorElem, event, debugHighlightRef, isFoundNodeEmptyParagraph = false) {
8
- const { height: targetBlockElemHeight, top: targetBlockElemTop } = getBoundingClientRectWithoutTransform(targetBlockElem);
6
+ let animationTimer = 0;
7
+ export function setTargetLine(offsetWidth, offsetLeft, targetLineElem, targetBlockElem, lastTargetBlock, mouseY, anchorElem, event, debugHighlightRef, isFoundNodeEmptyParagraph = false) {
8
+ const { height: targetBlockElemHeight, top: targetBlockElemTop } = targetBlockElem.getBoundingClientRect() // used to be getBoundingClientRectWithoutTransform. Not sure what's better, but the normal getBoundingClientRect seems to work fine
9
+ ;
9
10
  const { top: anchorTop, width: anchorWidth } = anchorElem.getBoundingClientRect();
10
11
  const { marginBottom, marginTop } = getCollapsedMargins(targetBlockElem);
11
12
  let lineTop = targetBlockElemTop;
12
13
  const isBelow = mouseY >= targetBlockElemTop + targetBlockElemHeight / 2 + window.scrollY;
13
- if (!isFoundNodeEmptyParagraph) {
14
+ let willStayInSamePosition = false;
15
+ /**
16
+ * Do not run any transform or changes if the actual new line position would be the same (even if it's now inserted BEFORE rather than AFTER - position would still be the same)
17
+ * This prevents unnecessary flickering.
18
+ *
19
+ * We still need to let it run even if the position (IGNORING the transform) would not change, as the transform animation is not finished yet. This is what animationTimer does. Otherwise, the positioning will be inaccurate
20
+ */ if (lastTargetBlock?.elem) {
21
+ if (targetBlockElem !== lastTargetBlock?.elem) {
22
+ if (isBelow && lastTargetBlock?.elem && lastTargetBlock?.elem === targetBlockElem.nextElementSibling) {
23
+ animationTimer++;
24
+ if (animationTimer < 200) {
25
+ willStayInSamePosition = true;
26
+ }
27
+ } else if (!isBelow && lastTargetBlock?.elem && lastTargetBlock?.elem === targetBlockElem.previousElementSibling) {
28
+ animationTimer++;
29
+ if (animationTimer < 200) {
30
+ willStayInSamePosition = true;
31
+ }
32
+ }
33
+ } else {
34
+ animationTimer++;
35
+ const lastBoundingBoxPosition = lastTargetBlock?.boundingBox?.y;
36
+ const currentBoundingBoxPosition = targetBlockElem.getBoundingClientRect().y;
37
+ if (isBelow === lastTargetBlock?.isBelow && lastBoundingBoxPosition === currentBoundingBoxPosition || animationTimer < 200) {
38
+ willStayInSamePosition = false;
39
+ }
40
+ }
41
+ }
42
+ if (willStayInSamePosition) {
43
+ return {
44
+ isBelow,
45
+ willStayInSamePosition
46
+ };
47
+ }
48
+ /**
49
+ * Paragraphs need no isBelow/above handling,
50
+ */ if (!isFoundNodeEmptyParagraph) {
51
+ //if (!isFoundNodeEmptyParagraph) {
14
52
  if (isBelow) {
15
53
  // below targetBlockElem
16
54
  lineTop += targetBlockElemHeight + marginBottom / 2;
@@ -21,29 +59,58 @@ export function setTargetLine(SPACE, targetLineElem, targetBlockElem, lastTarget
21
59
  } else {
22
60
  lineTop += targetBlockElemHeight / 2;
23
61
  }
24
- const top = lineTop - anchorTop - TARGET_LINE_HALF_HEIGHT;
25
- const left = TEXT_BOX_HORIZONTAL_PADDING - SPACE;
26
- targetLineElem.style.transform = `translate(${left}px, ${top}px)`;
27
- targetLineElem.style.width = `${anchorWidth - (TEXT_BOX_HORIZONTAL_PADDING - SPACE) * 2}px`;
62
+ let targetElemTranslate2 = 0;
63
+ if (!isFoundNodeEmptyParagraph) {
64
+ if (isBelow) {
65
+ targetElemTranslate2 = -TARGET_LINE_HALF_HEIGHT;
66
+ } else {
67
+ targetElemTranslate2 = TARGET_LINE_HALF_HEIGHT;
68
+ }
69
+ }
70
+ const top = lineTop - anchorTop + targetElemTranslate2;
71
+ const left = TEXT_BOX_HORIZONTAL_PADDING - offsetLeft;
72
+ targetLineElem.style.width = `calc(${anchorWidth}px - ${offsetWidth})`;
28
73
  targetLineElem.style.opacity = '.4';
29
- targetBlockElem.style.opacity = '0.4';
74
+ /**
75
+ * Move around element below or above the line (= the target / targetBlockElem). Creates "space" for the targetLineElem
76
+ *
77
+ * Not needed for empty paragraphs, as an empty paragraph is enough space for the targetLineElem anyways.
78
+ */ //targetBlockElem.style.opacity = '0.4'
79
+ const buffer = 12 // creates more spacing/padding so target line is not directly next to the targetBlockElem
80
+ ;
30
81
  if (!isFoundNodeEmptyParagraph) {
31
- // move lastTargetBlockElem down 50px to make space for targetLineElem (which is 50px height)
32
82
  if (isBelow) {
33
- targetBlockElem.style.transform = `translate(0, ${-TARGET_LINE_HALF_HEIGHT / 1.9}px)`;
83
+ targetBlockElem.style.marginBottom = TARGET_LINE_HALF_HEIGHT * 2 + buffer + 'px';
84
+ targetLineElem.style.transform = `translate(${left}px, calc(${top}px - ${'0px'}))`;
34
85
  } else {
35
- targetBlockElem.style.transform = `translate(0, ${TARGET_LINE_HALF_HEIGHT / 1.9}px)`;
86
+ targetBlockElem.style.marginTop = TARGET_LINE_HALF_HEIGHT * 2 + buffer + 'px';
87
+ targetLineElem.style.transform = `translate(${left}px, calc(${top - TARGET_LINE_HALF_HEIGHT * 2}px - ${'0px'}))`;
36
88
  }
89
+ } else {
90
+ targetLineElem.style.transform = `translate(${left}px, ${top - TARGET_LINE_HALF_HEIGHT}px)`;
37
91
  }
38
92
  if (DEBUG) {
39
93
  //targetBlockElem.style.border = '3px solid red'
40
94
  highlightElemOriginalPosition(debugHighlightRef, targetBlockElem, anchorElem);
41
95
  }
42
- if (lastTargetBlockElem && lastTargetBlockElem !== targetBlockElem) {
43
- lastTargetBlockElem.style.opacity = '1';
44
- lastTargetBlockElem.style.transform = 'translate(0, 0)';
45
- //lastTargetBlockElem.style.border = 'none'
96
+ /**
97
+ * Properly reset previous targetBlockElem styles
98
+ */ lastTargetBlock.elem.style.opacity = '';
99
+ if (lastTargetBlock?.elem === targetBlockElem) {
100
+ if (isBelow) {
101
+ lastTargetBlock.elem.style.marginTop = '';
102
+ } else {
103
+ lastTargetBlock.elem.style.marginBottom = '';
104
+ }
105
+ } else {
106
+ lastTargetBlock.elem.style.marginBottom = '';
107
+ lastTargetBlock.elem.style.marginTop = '';
46
108
  }
109
+ animationTimer = 0;
110
+ return {
111
+ isBelow,
112
+ willStayInSamePosition
113
+ };
47
114
  }
48
115
 
49
116
  //# sourceMappingURL=setTargetLine.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.ts"],"sourcesContent":["import { getCollapsedMargins } from '../utils/getCollapsedMargins.js'\nimport { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js'\nimport { highlightElemOriginalPosition } from './highlightElemOriginalPosition.js'\nconst TARGET_LINE_HALF_HEIGHT = 25\nconst TEXT_BOX_HORIZONTAL_PADDING = -24\nconst DEBUG = false\n\nexport function setTargetLine(\n SPACE: number,\n targetLineElem: HTMLElement,\n targetBlockElem: HTMLElement,\n lastTargetBlockElem: HTMLElement | null,\n mouseY: number,\n anchorElem: HTMLElement,\n event: DragEvent,\n debugHighlightRef: React.RefObject<HTMLDivElement>,\n isFoundNodeEmptyParagraph: boolean = false,\n) {\n const { height: targetBlockElemHeight, top: targetBlockElemTop } =\n getBoundingClientRectWithoutTransform(targetBlockElem)\n const { top: anchorTop, width: anchorWidth } = anchorElem.getBoundingClientRect()\n\n const { marginBottom, marginTop } = getCollapsedMargins(targetBlockElem)\n let lineTop = targetBlockElemTop\n\n const isBelow = mouseY >= targetBlockElemTop + targetBlockElemHeight / 2 + window.scrollY\n if (!isFoundNodeEmptyParagraph) {\n if (isBelow) {\n // below targetBlockElem\n lineTop += targetBlockElemHeight + marginBottom / 2\n } else {\n // above targetBlockElem\n lineTop -= marginTop / 2\n }\n } else {\n lineTop += targetBlockElemHeight / 2\n }\n\n const top = lineTop - anchorTop - TARGET_LINE_HALF_HEIGHT\n const left = TEXT_BOX_HORIZONTAL_PADDING - SPACE\n\n targetLineElem.style.transform = `translate(${left}px, ${top}px)`\n targetLineElem.style.width = `${anchorWidth - (TEXT_BOX_HORIZONTAL_PADDING - SPACE) * 2}px`\n targetLineElem.style.opacity = '.4'\n\n targetBlockElem.style.opacity = '0.4'\n if (!isFoundNodeEmptyParagraph) {\n // move lastTargetBlockElem down 50px to make space for targetLineElem (which is 50px height)\n if (isBelow) {\n targetBlockElem.style.transform = `translate(0, ${-TARGET_LINE_HALF_HEIGHT / 1.9}px)`\n } else {\n targetBlockElem.style.transform = `translate(0, ${TARGET_LINE_HALF_HEIGHT / 1.9}px)`\n }\n }\n\n if (DEBUG) {\n //targetBlockElem.style.border = '3px solid red'\n highlightElemOriginalPosition(debugHighlightRef, targetBlockElem, anchorElem)\n }\n\n if (lastTargetBlockElem && lastTargetBlockElem !== targetBlockElem) {\n lastTargetBlockElem.style.opacity = '1'\n lastTargetBlockElem.style.transform = 'translate(0, 0)'\n //lastTargetBlockElem.style.border = 'none'\n }\n}\n"],"names":["getCollapsedMargins","getBoundingClientRectWithoutTransform","highlightElemOriginalPosition","TARGET_LINE_HALF_HEIGHT","TEXT_BOX_HORIZONTAL_PADDING","DEBUG","setTargetLine","SPACE","targetLineElem","targetBlockElem","lastTargetBlockElem","mouseY","anchorElem","event","debugHighlightRef","isFoundNodeEmptyParagraph","height","targetBlockElemHeight","top","targetBlockElemTop","anchorTop","width","anchorWidth","getBoundingClientRect","marginBottom","marginTop","lineTop","isBelow","window","scrollY","left","style","transform","opacity"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,mBAAmB,QAAQ,kCAAiC;AACrE,SAASC,qCAAqC,QAAQ,uCAAsC;AAC5F,SAASC,6BAA6B,QAAQ,qCAAoC;AAClF,MAAMC,0BAA0B;AAChC,MAAMC,8BAA8B,CAAC;AACrC,MAAMC,QAAQ;AAEd,OAAO,SAASC,cACdC,KAAa,EACbC,cAA2B,EAC3BC,eAA4B,EAC5BC,mBAAuC,EACvCC,MAAc,EACdC,UAAuB,EACvBC,KAAgB,EAChBC,iBAAkD,EAClDC,4BAAqC,KAAK;IAE1C,MAAM,EAAEC,QAAQC,qBAAqB,EAAEC,KAAKC,kBAAkB,EAAE,GAC9DlB,sCAAsCQ;IACxC,MAAM,EAAES,KAAKE,SAAS,EAAEC,OAAOC,WAAW,EAAE,GAAGV,WAAWW,qBAAqB;IAE/E,MAAM,EAAEC,YAAY,EAAEC,SAAS,EAAE,GAAGzB,oBAAoBS;IACxD,IAAIiB,UAAUP;IAEd,MAAMQ,UAAUhB,UAAUQ,qBAAqBF,wBAAwB,IAAIW,OAAOC,OAAO;IACzF,IAAI,CAACd,2BAA2B;QAC9B,IAAIY,SAAS;YACX,wBAAwB;YACxBD,WAAWT,wBAAwBO,eAAe;QACpD,OAAO;YACL,wBAAwB;YACxBE,WAAWD,YAAY;QACzB;IACF,OAAO;QACLC,WAAWT,wBAAwB;IACrC;IAEA,MAAMC,MAAMQ,UAAUN,YAAYjB;IAClC,MAAM2B,OAAO1B,8BAA8BG;IAE3CC,eAAeuB,KAAK,CAACC,SAAS,GAAG,CAAC,UAAU,EAAEF,KAAK,IAAI,EAAEZ,IAAI,GAAG,CAAC;IACjEV,eAAeuB,KAAK,CAACV,KAAK,GAAG,CAAC,EAAEC,cAAc,AAAClB,CAAAA,8BAA8BG,KAAI,IAAK,EAAE,EAAE,CAAC;IAC3FC,eAAeuB,KAAK,CAACE,OAAO,GAAG;IAE/BxB,gBAAgBsB,KAAK,CAACE,OAAO,GAAG;IAChC,IAAI,CAAClB,2BAA2B;QAC9B,6FAA6F;QAC7F,IAAIY,SAAS;YACXlB,gBAAgBsB,KAAK,CAACC,SAAS,GAAG,CAAC,aAAa,EAAE,CAAC7B,0BAA0B,IAAI,GAAG,CAAC;QACvF,OAAO;YACLM,gBAAgBsB,KAAK,CAACC,SAAS,GAAG,CAAC,aAAa,EAAE7B,0BAA0B,IAAI,GAAG,CAAC;QACtF;IACF;IAEA,IAAIE,OAAO;QACT,gDAAgD;QAChDH,8BAA8BY,mBAAmBL,iBAAiBG;IACpE;IAEA,IAAIF,uBAAuBA,wBAAwBD,iBAAiB;QAClEC,oBAAoBqB,KAAK,CAACE,OAAO,GAAG;QACpCvB,oBAAoBqB,KAAK,CAACC,SAAS,GAAG;IACtC,2CAA2C;IAC7C;AACF"}
1
+ {"version":3,"sources":["../../../../../../src/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.ts"],"sourcesContent":["import { getCollapsedMargins } from '../utils/getCollapsedMargins.js'\nimport { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js'\nimport { highlightElemOriginalPosition } from './highlightElemOriginalPosition.js'\nconst TARGET_LINE_HALF_HEIGHT = 25\nconst TEXT_BOX_HORIZONTAL_PADDING = -24\nconst DEBUG = false\n\nlet animationTimer = 0\n\nexport function setTargetLine(\n offsetWidth: string,\n offsetLeft: number,\n targetLineElem: HTMLElement,\n targetBlockElem: HTMLElement,\n lastTargetBlock: {\n boundingBox?: DOMRect\n elem: HTMLElement | null\n isBelow: boolean\n },\n mouseY: number,\n anchorElem: HTMLElement,\n event: DragEvent,\n debugHighlightRef: React.RefObject<HTMLDivElement | null>,\n isFoundNodeEmptyParagraph: boolean = false,\n) {\n const { height: targetBlockElemHeight, top: targetBlockElemTop } =\n targetBlockElem.getBoundingClientRect() // used to be getBoundingClientRectWithoutTransform. Not sure what's better, but the normal getBoundingClientRect seems to work fine\n const { top: anchorTop, width: anchorWidth } = anchorElem.getBoundingClientRect()\n\n const { marginBottom, marginTop } = getCollapsedMargins(targetBlockElem)\n let lineTop = targetBlockElemTop\n\n const isBelow = mouseY >= targetBlockElemTop + targetBlockElemHeight / 2 + window.scrollY\n\n let willStayInSamePosition = false\n\n /**\n * Do not run any transform or changes if the actual new line position would be the same (even if it's now inserted BEFORE rather than AFTER - position would still be the same)\n * This prevents unnecessary flickering.\n *\n * We still need to let it run even if the position (IGNORING the transform) would not change, as the transform animation is not finished yet. This is what animationTimer does. Otherwise, the positioning will be inaccurate\n */\n if (lastTargetBlock?.elem) {\n if (targetBlockElem !== lastTargetBlock?.elem) {\n if (\n isBelow &&\n lastTargetBlock?.elem &&\n lastTargetBlock?.elem === targetBlockElem.nextElementSibling\n ) {\n animationTimer++\n\n if (animationTimer < 200) {\n willStayInSamePosition = true\n }\n } else if (\n !isBelow &&\n lastTargetBlock?.elem &&\n lastTargetBlock?.elem === targetBlockElem.previousElementSibling\n ) {\n animationTimer++\n if (animationTimer < 200) {\n willStayInSamePosition = true\n }\n }\n } else {\n animationTimer++\n\n const lastBoundingBoxPosition = lastTargetBlock?.boundingBox?.y\n const currentBoundingBoxPosition = targetBlockElem.getBoundingClientRect().y\n\n if (\n (isBelow === lastTargetBlock?.isBelow &&\n lastBoundingBoxPosition === currentBoundingBoxPosition) ||\n animationTimer < 200\n ) {\n willStayInSamePosition = false\n }\n }\n }\n if (willStayInSamePosition) {\n return {\n isBelow,\n willStayInSamePosition,\n }\n }\n\n /**\n * Paragraphs need no isBelow/above handling,\n */\n if (!isFoundNodeEmptyParagraph) {\n //if (!isFoundNodeEmptyParagraph) {\n if (isBelow) {\n // below targetBlockElem\n lineTop += targetBlockElemHeight + marginBottom / 2\n } else {\n // above targetBlockElem\n lineTop -= marginTop / 2\n }\n } else {\n lineTop += targetBlockElemHeight / 2\n }\n\n let targetElemTranslate2 = 0\n\n if (!isFoundNodeEmptyParagraph) {\n if (isBelow) {\n targetElemTranslate2 = -TARGET_LINE_HALF_HEIGHT\n } else {\n targetElemTranslate2 = TARGET_LINE_HALF_HEIGHT\n }\n }\n\n const top = lineTop - anchorTop + targetElemTranslate2\n\n const left = TEXT_BOX_HORIZONTAL_PADDING - offsetLeft\n\n targetLineElem.style.width = `calc(${anchorWidth}px - ${offsetWidth})`\n targetLineElem.style.opacity = '.4'\n\n /**\n * Move around element below or above the line (= the target / targetBlockElem). Creates \"space\" for the targetLineElem\n *\n * Not needed for empty paragraphs, as an empty paragraph is enough space for the targetLineElem anyways.\n */\n //targetBlockElem.style.opacity = '0.4'\n const buffer = 12 // creates more spacing/padding so target line is not directly next to the targetBlockElem\n if (!isFoundNodeEmptyParagraph) {\n if (isBelow) {\n targetBlockElem.style.marginBottom = TARGET_LINE_HALF_HEIGHT * 2 + buffer + 'px'\n targetLineElem.style.transform = `translate(${left}px, calc(${top}px - ${'0px'}))`\n } else {\n targetBlockElem.style.marginTop = TARGET_LINE_HALF_HEIGHT * 2 + buffer + 'px'\n targetLineElem.style.transform = `translate(${left}px, calc(${top - TARGET_LINE_HALF_HEIGHT * 2}px - ${'0px'}))`\n }\n } else {\n targetLineElem.style.transform = `translate(${left}px, ${top - TARGET_LINE_HALF_HEIGHT}px)`\n }\n\n if (DEBUG) {\n //targetBlockElem.style.border = '3px solid red'\n highlightElemOriginalPosition(debugHighlightRef, targetBlockElem, anchorElem)\n }\n\n /**\n * Properly reset previous targetBlockElem styles\n */\n lastTargetBlock.elem.style.opacity = ''\n\n if (lastTargetBlock?.elem === targetBlockElem) {\n if (isBelow) {\n lastTargetBlock.elem.style.marginTop = ''\n } else {\n lastTargetBlock.elem.style.marginBottom = ''\n }\n } else {\n lastTargetBlock.elem.style.marginBottom = ''\n lastTargetBlock.elem.style.marginTop = ''\n }\n animationTimer = 0\n return {\n isBelow,\n willStayInSamePosition,\n }\n}\n"],"names":["getCollapsedMargins","highlightElemOriginalPosition","TARGET_LINE_HALF_HEIGHT","TEXT_BOX_HORIZONTAL_PADDING","DEBUG","animationTimer","setTargetLine","offsetWidth","offsetLeft","targetLineElem","targetBlockElem","lastTargetBlock","mouseY","anchorElem","event","debugHighlightRef","isFoundNodeEmptyParagraph","height","targetBlockElemHeight","top","targetBlockElemTop","getBoundingClientRect","anchorTop","width","anchorWidth","marginBottom","marginTop","lineTop","isBelow","window","scrollY","willStayInSamePosition","elem","nextElementSibling","previousElementSibling","lastBoundingBoxPosition","boundingBox","y","currentBoundingBoxPosition","targetElemTranslate2","left","style","opacity","buffer","transform"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,mBAAmB,QAAQ,kCAAiC;AAErE,SAASC,6BAA6B,QAAQ,qCAAoC;AAClF,MAAMC,0BAA0B;AAChC,MAAMC,8BAA8B,CAAC;AACrC,MAAMC,QAAQ;AAEd,IAAIC,iBAAiB;AAErB,OA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AAiBG;IACpE;IAEA;;GAEC,GACDF,gBAAgBqB,IAAI,CAACS,KAAK,CAACC,OAAO,GAAG;IAErC,IAAI/B,iBAAiBqB,SAAStB,iBAAiB;QAC7C,IAAIkB,SAAS;YACXjB,gBAAgBqB,IAAI,CAACS,KAAK,CAACf,SAAS,GAAG;QACzC,OAAO;YACLf,gBAAgBqB,IAAI,CAACS,KAAK,CAAChB,YAAY,GAAG;QAC5C;IACF,OAAO;QACLd,gBAAgBqB,IAAI,CAACS,KAAK,CAAChB,YAAY,GAAG;QAC1Cd,gBAAgBqB,IAAI,CAACS,KAAK,CAACf,SAAS,GAAG;IACzC;IACArB,iBAAiB;IACjB,OAAO;QACLuB;QACAG;IACF;AACF"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Calculate distance between scrollerElem and target if target is not in scrollerElem
3
+ */
4
+ export declare const calculateDistanceFromScrollerElem: (scrollerElem: HTMLElement | null, pageX: number, pageY: number, target: HTMLElement, horizontalBuffer?: number, verticalBuffer?: number) => number;
5
+ //# sourceMappingURL=calculateDistanceFromScrollerElem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculateDistanceFromScrollerElem.d.ts","sourceRoot":"","sources":["../../../../../../src/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,iCAAiC,iBAC9B,WAAW,GAAG,IAAI,SACzB,MAAM,SACN,MAAM,UACL,WAAW,qBACD,MAAM,mBACR,MAAM,KACrB,MAwBF,CAAA"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Calculate distance between scrollerElem and target if target is not in scrollerElem
3
+ */ export const calculateDistanceFromScrollerElem = (scrollerElem, pageX, pageY, target, horizontalBuffer = 50, verticalBuffer = 25)=>{
4
+ let distanceFromScrollerElem = 0;
5
+ if (scrollerElem && !scrollerElem.contains(target)) {
6
+ const { bottom, left, right, top } = scrollerElem.getBoundingClientRect();
7
+ const adjustedTop = top + window.scrollY;
8
+ const adjustedBottom = bottom + window.scrollY;
9
+ if (pageY < adjustedTop - verticalBuffer || pageY > adjustedBottom + verticalBuffer || pageX < left - horizontalBuffer || pageX > right + horizontalBuffer) {
10
+ return -1;
11
+ }
12
+ // This is used to allow the _draggableBlockElem to be found when the mouse is in the
13
+ // buffer zone around the scrollerElem.
14
+ if (pageX < left || pageX > right) {
15
+ distanceFromScrollerElem = pageX < left ? pageX - left : pageX - right;
16
+ }
17
+ }
18
+ return distanceFromScrollerElem;
19
+ };
20
+
21
+ //# sourceMappingURL=calculateDistanceFromScrollerElem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.ts"],"sourcesContent":["/**\n * Calculate distance between scrollerElem and target if target is not in scrollerElem\n */\nexport const calculateDistanceFromScrollerElem = (\n scrollerElem: HTMLElement | null,\n pageX: number,\n pageY: number,\n target: HTMLElement,\n horizontalBuffer: number = 50,\n verticalBuffer: number = 25,\n): number => {\n let distanceFromScrollerElem = 0\n if (scrollerElem && !scrollerElem.contains(target)) {\n const { bottom, left, right, top } = scrollerElem.getBoundingClientRect()\n\n const adjustedTop = top + window.scrollY\n const adjustedBottom = bottom + window.scrollY\n\n if (\n pageY < adjustedTop - verticalBuffer ||\n pageY > adjustedBottom + verticalBuffer ||\n pageX < left - horizontalBuffer ||\n pageX > right + horizontalBuffer\n ) {\n return -1\n }\n\n // This is used to allow the _draggableBlockElem to be found when the mouse is in the\n // buffer zone around the scrollerElem.\n if (pageX < left || pageX > right) {\n distanceFromScrollerElem = pageX < left ? pageX - left : pageX - right\n }\n }\n return distanceFromScrollerElem\n}\n"],"names":["calculateDistanceFromScrollerElem","scrollerElem","pageX","pageY","target","horizontalBuffer","verticalBuffer","distanceFromScrollerElem","contains","bottom","left","right","top","getBoundingClientRect","adjustedTop","window","scrollY","adjustedBottom"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAAA;;CAEC,GACD,OAAO,MAAMA,oCAAoC,CAC/CC,cACAC,OACAC,OACAC,QACAC,mBAA2B,EAAE,EAC7BC,iBAAyB,EAAE;IAE3B,IAAIC,2BAA2B;IAC/B,IAAIN,gBAAgB,CAACA,aAAaO,QAAQ,CAACJ,SAAS;QAClD,MAAM,EAAEK,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,GAAG,EAAE,GAAGX,aAAaY,qBAAqB;QAEvE,MAAMC,cAAcF,MAAMG,OAAOC,OAAO;QACxC,MAAMC,iBAAiBR,SAASM,OAAOC,OAAO;QAE9C,IACEb,QAAQW,cAAcR,kBACtBH,QAAQc,iBAAiBX,kBACzBJ,QAAQQ,OAAOL,oBACfH,QAAQS,QAAQN,kBAChB;YACA,OAAO,CAAC;QACV;QAEA,qFAAqF;QACrF,uCAAuC;QACvC,IAAIH,QAAQQ,QAAQR,QAAQS,OAAO;YACjCJ,2BAA2BL,QAAQQ,OAAOR,QAAQQ,OAAOR,QAAQS;QACnE;IACF;IACA,OAAOJ;AACT,EAAC"}
@@ -2,12 +2,16 @@ import type { LexicalEditor, LexicalNode } from 'lexical';
2
2
  import { Point } from '../../../utils/point.js';
3
3
  type Props = {
4
4
  anchorElem: HTMLElement;
5
- cache_treshold?: number;
5
+ cache_threshold?: number;
6
6
  editor: LexicalEditor;
7
7
  /** fuzzy makes the search not exact. If no exact match found, find the closes node instead of returning null */
8
8
  fuzzy?: boolean;
9
9
  horizontalOffset?: number;
10
10
  point: Point;
11
+ /**
12
+ * By default, empty paragraphs are not returned. Set this to true to return empty paragraphs. @default false
13
+ */
14
+ returnEmptyParagraphs?: boolean;
11
15
  /**
12
16
  * The index to start searching from. It can be a considerable performance optimization to start searching from the index of the
13
17
  * previously found node, as the node is likely to be close to the next node.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNodeCloseToPoint.d.ts","sourceRoot":"","sources":["../../../../../../src/field/lexical/plugins/handles/utils/getNodeCloseToPoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAIzD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAW/C,KAAK,KAAK,GAAG;IACX,UAAU,EAAE,WAAW,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,MAAM,EAAE,aAAa,CAAA;IACrB,gHAAgH;IAChH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,KAAK,EAAE,KAAK,CAAA;IACZ;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,SAAS,EAAE,WAAW,GAAG,IAAI,CAAA;IAC7B,SAAS,EAAE,WAAW,GAAG,IAAI,CAAA;IAC7B,YAAY,EAAE,MAAM,CAAA;IACpB,yBAAyB,EAAE,OAAO,CAAA;CACnC,CAAA;AAaD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAmKxD"}
@@ -1,10 +1,9 @@
1
- import lexicalImport from 'lexical';
2
- const { $getNodeByKey } = lexicalImport;
1
+ import { $getNodeByKey } from 'lexical';
3
2
  import { Point } from '../../../utils/point.js';
4
3
  import { Rect } from '../../../utils/rect.js';
4
+ import { getBoundingClientRectWithoutTransform } from '../DraggableBlockPlugin/getBoundingRectWithoutTransform.js';
5
5
  import { getCollapsedMargins } from '../utils/getCollapsedMargins.js';
6
6
  import { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js';
7
- import { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js';
8
7
  // Directions
9
8
  const Downward = 1;
10
9
  const Upward = -1;
@@ -19,12 +18,9 @@ function isPointClose(previous, current, threshold = 20) {
19
18
  return dx * dx + dy * dy <= threshold * threshold;
20
19
  }
21
20
  export function getNodeCloseToPoint(props) {
22
- const { anchorElem, cache_treshold = 20, editor, fuzzy = false, horizontalOffset = 0, point: { x, y }, startIndex = 0, useEdgeAsDefault = false, verbose = false } = props;
21
+ const { anchorElem, cache_threshold = 20, editor, fuzzy = false, horizontalOffset = 0, point: { x, y }, startIndex = 0, useEdgeAsDefault = false, verbose = false } = props;
23
22
  // Use cache
24
- if (cache_treshold > 0 && cache.props && cache.result && cache.props.fuzzy === props.fuzzy && cache.props.horizontalOffset === props.horizontalOffset && cache.props.useEdgeAsDefault === props.useEdgeAsDefault && isPointClose(cache.props.point, props.point, cache_treshold)) {
25
- if (verbose) {
26
- //console.log('Returning cached result')
27
- }
23
+ if (cache_threshold > 0 && cache.props && cache.result && cache.props.fuzzy === props.fuzzy && cache.props.horizontalOffset === props.horizontalOffset && cache.props.useEdgeAsDefault === props.useEdgeAsDefault && isPointClose(cache.props.point, props.point, cache_threshold)) {
28
24
  return cache.result;
29
25
  }
30
26
  const anchorElementRect = anchorElem.getBoundingClientRect();
@@ -60,9 +56,6 @@ export function getNodeCloseToPoint(props) {
60
56
  closestBlockElem.foundAtIndex = topLevelNodeKeys.length - 1;
61
57
  }
62
58
  if (closestBlockElem?.blockElem) {
63
- if (verbose) {
64
- //console.log('useEdgeAsDefault', useEdgeAsDefault)
65
- }
66
59
  return {
67
60
  blockElem: null,
68
61
  isFoundNodeEmptyParagraph: false
@@ -73,9 +66,6 @@ export function getNodeCloseToPoint(props) {
73
66
  // Find matching block element
74
67
  let index = startIndex;
75
68
  let direction = Indeterminate;
76
- if (verbose) {
77
- //console.log('start index', startIndex)
78
- }
79
69
  while(index >= 0 && index < topLevelNodeKeys.length){
80
70
  const key = topLevelNodeKeys[index];
81
71
  const elem = editor.getElementByKey(key);
@@ -94,9 +84,6 @@ export function getNodeCloseToPoint(props) {
94
84
  top: domRect.top - marginTop
95
85
  });
96
86
  const { distance, isOnBottomSide, isOnTopSide } = rect.distanceFromPoint(point);
97
- if (verbose) {
98
- //console.log('distance', distance)
99
- }
100
87
  if (distance === 0) {
101
88
  closestBlockElem.blockElem = elem;
102
89
  closestBlockElem.blockNode = $getNodeByKey(key);
@@ -104,7 +91,7 @@ export function getNodeCloseToPoint(props) {
104
91
  closestBlockElem.distance = distance;
105
92
  // Check if blockNode is an empty text node
106
93
  if (closestBlockElem.blockNode && closestBlockElem.blockNode.getType() === 'paragraph' && closestBlockElem.blockNode.getTextContent() === '') {
107
- if (!fuzzy) {
94
+ if (!fuzzy && !props.returnEmptyParagraphs) {
108
95
  closestBlockElem.blockElem = null;
109
96
  closestBlockElem.blockNode = null;
110
97
  }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/field/lexical/plugins/handles/utils/getNodeCloseToPoint.ts"],"sourcesContent":["import type { LexicalEditor, LexicalNode } from 'lexical'\n\nimport { $getNodeByKey } from 'lexical'\n\nimport { Point } from '../../../utils/point.js'\nimport { Rect } from '../../../utils/rect.js'\nimport { getBoundingClientRectWithoutTransform } from '../DraggableBlockPlugin/getBoundingRectWithoutTransform.js'\nimport { getCollapsedMargins } from '../utils/getCollapsedMargins.js'\nimport { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js'\n\n// Directions\nconst Downward = 1\nconst Upward = -1\nconst Indeterminate = 0\n\ntype Props = {\n anchorElem: HTMLElement\n cache_threshold?: number\n editor: LexicalEditor\n /** fuzzy makes the search not exact. If no exact match found, find the closes node instead of returning null */\n fuzzy?: boolean\n horizontalOffset?: number\n point: Point\n /**\n * By default, empty paragraphs are not returned. Set this to true to return empty paragraphs. @default false\n */\n returnEmptyParagraphs?: boolean\n /**\n * The index to start searching from. It can be a considerable performance optimization to start searching from the index of the\n * previously found node, as the node is likely to be close to the next node.\n */\n startIndex?: number\n useEdgeAsDefault?: boolean\n verbose?: boolean\n}\n\ntype Output = {\n blockElem: HTMLElement | null\n blockNode: LexicalNode | null\n foundAtIndex: number\n isFoundNodeEmptyParagraph: boolean\n}\n\nconst cache = {\n props: null as Props | null,\n result: null as Output | null,\n}\n\nfunction isPointClose(previous: Point, current: Point, threshold: number = 20): boolean {\n const dx = previous.x - current.x\n const dy = previous.y - current.y\n return dx * dx + dy * dy <= threshold * threshold\n}\n\nexport function getNodeCloseToPoint(props: Props): Output {\n const {\n anchorElem,\n cache_threshold = 20,\n editor,\n fuzzy = false,\n horizontalOffset = 0,\n point: { x, y },\n startIndex = 0,\n useEdgeAsDefault = false,\n verbose = false,\n } = props\n\n // Use cache\n if (\n cache_threshold > 0 &&\n cache.props &&\n cache.result &&\n cache.props.fuzzy === props.fuzzy &&\n cache.props.horizontalOffset === props.horizontalOffset &&\n cache.props.useEdgeAsDefault === props.useEdgeAsDefault &&\n isPointClose(cache.props.point, props.point, cache_threshold)\n ) {\n return cache.result\n }\n\n const anchorElementRect = anchorElem.getBoundingClientRect()\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const closestBlockElem: {\n blockElem: HTMLElement | null\n blockNode: LexicalNode | null\n distance: number\n foundAtIndex: number\n isFoundNodeEmptyParagraph: boolean\n } = {\n blockElem: null,\n blockNode: null,\n distance: Infinity,\n foundAtIndex: -1,\n isFoundNodeEmptyParagraph: false,\n }\n\n // Return null if matching block element is the first or last node\n editor.getEditorState().read(() => {\n if (useEdgeAsDefault) {\n const [firstNode, lastNode] = [\n editor.getElementByKey(topLevelNodeKeys[0]),\n editor.getElementByKey(topLevelNodeKeys[topLevelNodeKeys.length - 1]),\n ]\n\n const [firstNodeRect, lastNodeRect] = [\n getBoundingClientRectWithoutTransform(firstNode),\n getBoundingClientRectWithoutTransform(lastNode),\n ]\n\n if (firstNodeRect && lastNodeRect) {\n if (y < firstNodeRect.top) {\n closestBlockElem.blockElem = firstNode\n closestBlockElem.distance = firstNodeRect.top - y\n closestBlockElem.blockNode = $getNodeByKey(topLevelNodeKeys[0])\n closestBlockElem.foundAtIndex = 0\n } else if (y > lastNodeRect.bottom) {\n closestBlockElem.distance = y - lastNodeRect.bottom\n closestBlockElem.blockNode = $getNodeByKey(topLevelNodeKeys[topLevelNodeKeys.length - 1])\n closestBlockElem.blockElem = lastNode\n closestBlockElem.foundAtIndex = topLevelNodeKeys.length - 1\n }\n\n if (closestBlockElem?.blockElem) {\n return {\n blockElem: null,\n isFoundNodeEmptyParagraph: false,\n } as Output\n }\n }\n }\n\n // Find matching block element\n let index = startIndex\n let direction = Indeterminate\n\n while (index >= 0 && index < topLevelNodeKeys.length) {\n const key = topLevelNodeKeys[index]\n const elem = editor.getElementByKey(key)\n if (elem === null) {\n break\n }\n const point = new Point(x + horizontalOffset, y)\n //const domRect = Rect.fromDOM(elem)\n // Do not consider transform of blocks when calculating distance\n const domRect = Rect.fromDOMRect(getBoundingClientRectWithoutTransform(elem))\n\n const { marginBottom, marginTop } = getCollapsedMargins(elem)\n\n const rect = domRect.generateNewRect({\n bottom: domRect.bottom + marginBottom,\n left: anchorElementRect.left,\n right: anchorElementRect.right,\n top: domRect.top - marginTop,\n })\n\n const { distance, isOnBottomSide, isOnTopSide } = rect.distanceFromPoint(point)\n\n if (distance === 0) {\n closestBlockElem.blockElem = elem\n closestBlockElem.blockNode = $getNodeByKey(key)\n closestBlockElem.foundAtIndex = index\n closestBlockElem.distance = distance\n\n // Check if blockNode is an empty text node\n if (\n closestBlockElem.blockNode &&\n closestBlockElem.blockNode.getType() === 'paragraph' &&\n closestBlockElem.blockNode.getTextContent() === ''\n ) {\n if (!fuzzy && !props.returnEmptyParagraphs) {\n closestBlockElem.blockElem = null\n closestBlockElem.blockNode = null\n }\n\n closestBlockElem.isFoundNodeEmptyParagraph = true\n }\n break\n } else if (fuzzy) {\n if (distance < closestBlockElem.distance) {\n closestBlockElem.blockElem = elem\n closestBlockElem.blockNode = $getNodeByKey(key)\n closestBlockElem.distance = distance\n closestBlockElem.foundAtIndex = index\n }\n }\n\n if (direction === Indeterminate) {\n if (isOnTopSide) {\n direction = Upward\n } else if (isOnBottomSide) {\n direction = Downward\n } else {\n // stop search block element\n direction = Infinity\n }\n }\n\n index += direction\n }\n })\n\n // Store in cache before returning\n cache.props = props\n cache.result = {\n blockElem: closestBlockElem.blockElem,\n blockNode: closestBlockElem.blockNode,\n foundAtIndex: closestBlockElem.foundAtIndex,\n isFoundNodeEmptyParagraph: closestBlockElem.isFoundNodeEmptyParagraph,\n }\n\n return {\n blockElem: closestBlockElem.blockElem,\n blockNode: closestBlockElem.blockNode,\n foundAtIndex: closestBlockElem.foundAtIndex,\n isFoundNodeEmptyParagraph: closestBlockElem.isFoundNodeEmptyParagraph,\n }\n}\n"],"names":["$getNodeByKey","Point","Rect","getBoundingClientRectWithoutTransform","getCollapsedMargins","getTopLevelNodeKeys","Downward","Upward","Indeterminate","cache","props","result","isPointClose","previous","current","threshold","dx","x","dy","y","getNodeCloseToPoint","anchorElem","cache_threshold","editor","fuzzy","horizontalOffset","point","startIndex","useEdgeAsDefault","verbose","anchorElementRect","getBoundingClientRect","topLevelNodeKeys","closestBlockElem","blockElem","blockNode","distance","Infinity","foundAtIndex","isFoundNodeEmptyParagraph","getEditorState","read","firstNode","lastNode","getElementByKey","length","firstNodeRect","lastNodeRect","top","bottom","index","direction","key","elem","domRect","fromDOMRect","marginBottom","marginTop","rect","generateNewRect","left","right","isOnBottomSide","isOnTopSide","distanceFromPoint","getType","getTextContent","returnEmptyParagraphs"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,aAAa,QAAQ,UAAS;AAEvC,SAASC,KAAK,QAAQ,0BAAyB;AAC/C,SAASC,IAAI,QAAQ,yBAAwB;AAC7C,SAASC,qCAAqC,QAAQ,6DAA4D;AAClH,SAASC,mBAAmB,QAAQ,kCAAiC;AACrE,SAASC,mBAAmB,QAAQ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YAAYd;gBACd;YACF;YAEAa,SAASC;QACX;IACF;IAEA,kCAAkC;IAClC1C,MAAMC,KAAK,GAAGA;IACdD,MAAME,MAAM,GAAG;QACbuB,WAAWD,iBAAiBC,SAAS;QACrCC,WAAWF,iBAAiBE,SAAS;QACrCG,cAAcL,iBAAiBK,YAAY;QAC3CC,2BAA2BN,iBAAiBM,yBAAyB;IACvE;IAEA,OAAO;QACLL,WAAWD,iBAAiBC,SAAS;QACrCC,WAAWF,iBAAiBE,SAAS;QACrCG,cAAcL,iBAAiBK,YAAY;QAC3CC,2BAA2BN,iBAAiBM,yBAAyB;IACvE;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"getTopLevelNodeKeys.d.ts","sourceRoot":"","sources":["../../../../../../src/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAK5C,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,EAAE,CAEnE"}
1
+ {"version":3,"file":"getTopLevelNodeKeys.d.ts","sourceRoot":"","sources":["../../../../../../src/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,EAAE,CAEnE"}
@@ -1,5 +1,4 @@
1
- import lexicalImport from 'lexical';
2
- const { $getRoot } = lexicalImport;
1
+ import { $getRoot } from 'lexical';
3
2
  export function getTopLevelNodeKeys(editor) {
4
3
  return editor.getEditorState().read(()=>$getRoot().getChildrenKeys());
5
4
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.ts"],"sourcesContent":["import type { LexicalEditor } from 'lexical'\n\nimport lexicalImport from 'lexical'\nconst { $getRoot } = lexicalImport\n\nexport function getTopLevelNodeKeys(editor: LexicalEditor): string[] {\n return editor.getEditorState().read(() => $getRoot().getChildrenKeys())\n}\n"],"names":["lexicalImport","$getRoot","getTopLevelNodeKeys","editor","getEditorState","read","getChildrenKeys"],"rangeMappings":";;;;","mappings":"AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,QAAQ,EAAE,GAAGD;AAErB,OAAO,SAASE,oBAAoBC,MAAqB;IACvD,OAAOA,OAAOC,cAAc,GAAGC,IAAI,CAAC,IAAMJ,WAAWK,eAAe;AACtE"}
1
+ {"version":3,"sources":["../../../../../../src/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.ts"],"sourcesContent":["import type { LexicalEditor } from 'lexical'\n\nimport { $getRoot } from 'lexical'\n\nexport function getTopLevelNodeKeys(editor: LexicalEditor): string[] {\n return editor.getEditorState().read(() => $getRoot().getChildrenKeys())\n}\n"],"names":["$getRoot","getTopLevelNodeKeys","editor","getEditorState","read","getChildrenKeys"],"rangeMappings":";;;","mappings":"AAEA,SAASA,QAAQ,QAAQ,UAAS;AAElC,OAAO,SAASC,oBAAoBC,MAAqB;IACvD,OAAOA,OAAOC,cAAc,GAAGC,IAAI,CAAC,IAAMJ,WAAWK,eAAe;AACtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"setHandlePosition.d.ts","sourceRoot":"","sources":["../../../../../../src/field/lexical/plugins/handles/utils/setHandlePosition.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,WAAW,GAAG,IAAI,EAC9B,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,WAAW,EACvB,UAAU,GAAE,MAAU,QAkCvB"}
1
+ {"version":3,"file":"setHandlePosition.d.ts","sourceRoot":"","sources":["../../../../../../src/field/lexical/plugins/handles/utils/setHandlePosition.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,WAAW,GAAG,IAAI,EAC9B,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,WAAW,EACvB,UAAU,GAAE,MAAU,QAuCvB"}
@@ -15,9 +15,11 @@ export function setHandlePosition(targetElem, handleElem, anchorElem, leftOffset
15
15
  // No need to let line height affect the re-positioning of the floating element if line height has no
16
16
  // visual effect on the element. Otherwise, the floating element will be positioned incorrectly.
17
17
  const actualLineHeight = doesLineHeightAffectElement(targetElem) ? parseInt(targetStyle.lineHeight, 10) : 0;
18
- top = targetRect.top + (actualLineHeight - floatingElemRect.height) / 2 - anchorElementRect.top;
18
+ top = targetRect.top + (actualLineHeight - floatingElemRect.height) / 2 - anchorElementRect.top - 1 // 1px inaccuracy
19
+ ;
19
20
  } else {
20
- top = targetRect.top - floatingElemRect.height / 2 - anchorElementRect.top + targetRect.height / 2;
21
+ top = targetRect.top - floatingElemRect.height / 2 - anchorElementRect.top + targetRect.height / 2 - 1 // 1px inaccuracy
22
+ ;
21
23
  }
22
24
  const left = leftOffset;
23
25
  handleElem.style.opacity = '1';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/lexical/plugins/handles/utils/setHandlePosition.ts"],"sourcesContent":["import { doesLineHeightAffectElement } from './doesLineHeightAffectElement.js'\n\nexport function setHandlePosition(\n targetElem: HTMLElement | null,\n handleElem: HTMLElement,\n anchorElem: HTMLElement,\n leftOffset: number = 0, // SPACE\n) {\n if (!targetElem) {\n handleElem.style.opacity = '0'\n handleElem.style.transform = 'translate(-10000px, -10000px)'\n return\n }\n\n const targetRect = targetElem.getBoundingClientRect()\n const targetStyle = window.getComputedStyle(targetElem)\n const floatingElemRect = handleElem.getBoundingClientRect()\n const anchorElementRect = anchorElem.getBoundingClientRect()\n\n let top: number\n\n const shouldDisplayHandleInCenter = targetRect.height < 60\n\n if (!shouldDisplayHandleInCenter) {\n // No need to let line height affect the re-positioning of the floating element if line height has no\n // visual effect on the element. Otherwise, the floating element will be positioned incorrectly.\n const actualLineHeight = doesLineHeightAffectElement(targetElem)\n ? parseInt(targetStyle.lineHeight, 10)\n : 0\n\n top = targetRect.top + (actualLineHeight - floatingElemRect.height) / 2 - anchorElementRect.top\n } else {\n top =\n targetRect.top - floatingElemRect.height / 2 - anchorElementRect.top + targetRect.height / 2\n }\n\n const left = leftOffset\n\n handleElem.style.opacity = '1'\n handleElem.style.transform = `translate(${left}px, ${top}px)`\n}\n"],"names":["doesLineHeightAffectElement","setHandlePosition","targetElem","handleElem","anchorElem","leftOffset","style","opacity","transform","targetRect","getBoundingClientRect","targetStyle","window","getComputedStyle","floatingElemRect","anchorElementRect","top","shouldDisplayHandleInCenter","height","actualLineHeight","parseInt","lineHeight","left"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,2BAA2B,QAAQ,mCAAkC;AAE9E,OAAO,SAASC,kBACdC,UAA8B,EAC9BC,UAAuB,EACvBC,UAAuB,EACvBC,aAAqB,CAAC;IAEtB,IAAI,CAACH,YAAY;QACfC,WAAWG,KAAK,CAACC,OAAO,GAAG;QAC3BJ,WAAWG,KAAK,CAACE,SAAS,GAAG;QAC7B;IACF;IAEA,MAAMC,aAAaP,WAAWQ,qBAAqB;IACnD,MAAMC,cAAcC,OAAOC,gBAAgB,CAACX;IAC5C,MAAMY,mBAAmBX,WAAWO,qBAAqB;IACzD,MAAMK,oBAAoBX,WAAWM,qBAAqB;IAE1D,IAAIM;IAEJ,MAAMC,8BAA8BR,WAAWS,MAAM,GAAG;IAExD,IAAI,CAACD,6BAA6B;QAChC,qGAAqG;QACrG,gGAAgG;QAChG,MAAME,mBAAmBnB,4BAA4BE,cACjDkB,SAAST,YAAYU,UAAU,EAAE,MACjC;QAEJL,MAAMP,WAAWO,GAAG,GAAG,AAACG,CAAAA,mBAAmBL,iBAAiBI,MAAM,AAAD,IAAK,IAAIH,kBAAkBC,GAAG;IACjG,OAAO;QACLA,MACEP,WAAWO,GAAG,GAAGF,iBAAiBI,MAAM,GAAG,IAAIH,kBAAkBC,GAAG,GAAGP,WAAWS,MAAM,GAAG;IAC/F;IAEA,MAAMI,OAAOjB;IAEbF,WAAWG,KAAK,CAACC,OAAO,GAAG;IAC3BJ,WAAWG,KAAK,CAACE,SAAS,GAAG,CAAC,UAAU,EAAEc,KAAK,IAAI,EAAEN,IAAI,GAAG,CAAC;AAC/D"}
1
+ {"version":3,"sources":["../../../../../../src/field/lexical/plugins/handles/utils/setHandlePosition.ts"],"sourcesContent":["import { doesLineHeightAffectElement } from './doesLineHeightAffectElement.js'\n\nexport function setHandlePosition(\n targetElem: HTMLElement | null,\n handleElem: HTMLElement,\n anchorElem: HTMLElement,\n leftOffset: number = 0, // SPACE\n) {\n if (!targetElem) {\n handleElem.style.opacity = '0'\n handleElem.style.transform = 'translate(-10000px, -10000px)'\n return\n }\n\n const targetRect = targetElem.getBoundingClientRect()\n const targetStyle = window.getComputedStyle(targetElem)\n const floatingElemRect = handleElem.getBoundingClientRect()\n const anchorElementRect = anchorElem.getBoundingClientRect()\n\n let top: number\n\n const shouldDisplayHandleInCenter = targetRect.height < 60\n\n if (!shouldDisplayHandleInCenter) {\n // No need to let line height affect the re-positioning of the floating element if line height has no\n // visual effect on the element. Otherwise, the floating element will be positioned incorrectly.\n const actualLineHeight = doesLineHeightAffectElement(targetElem)\n ? parseInt(targetStyle.lineHeight, 10)\n : 0\n\n top =\n targetRect.top + (actualLineHeight - floatingElemRect.height) / 2 - anchorElementRect.top - 1 // 1px inaccuracy\n } else {\n top =\n targetRect.top -\n floatingElemRect.height / 2 -\n anchorElementRect.top +\n targetRect.height / 2 -\n 1 // 1px inaccuracy\n }\n\n const left = leftOffset\n\n handleElem.style.opacity = '1'\n handleElem.style.transform = `translate(${left}px, ${top}px)`\n}\n"],"names":["doesLineHeightAffectElement","setHandlePosition","targetElem","handleElem","anchorElem","leftOffset","style","opacity","transform","targetRect","getBoundingClientRect","targetStyle","window","getComputedStyle","floatingElemRect","anchorElementRect","top","shouldDisplayHandleInCenter","height","actualLineHeight","parseInt","lineHeight","left"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,2BAA2B,QAAQ,mCAAkC;AAE9E,OAAO,SAASC,kBACdC,UAA8B,EAC9BC,UAAuB,EACvBC,UAAuB,EACvBC,aAAqB,CAAC;IAEtB,IAAI,CAACH,YAAY;QACfC,WAAWG,KAAK,CAACC,OAAO,GAAG;QAC3BJ,WAAWG,KAAK,CAACE,SAAS,GAAG;QAC7B;IACF;IAEA,MAAMC,aAAaP,WAAWQ,qBAAqB;IACnD,MAAMC,cAAcC,OAAOC,gBAAgB,CAACX;IAC5C,MAAMY,mBAAmBX,WAAWO,qBAAqB;IACzD,MAAMK,oBAAoBX,WAAWM,qBAAqB;IAE1D,IAAIM;IAEJ,MAAMC,8BAA8BR,WAAWS,MAAM,GAAG;IAExD,IAAI,CAACD,6BAA6B;QAChC,qGAAqG;QACrG,gGAAgG;QAChG,MAAME,mBAAmBnB,4BAA4BE,cACjDkB,SAAST,YAAYU,UAAU,EAAE,MACjC;QAEJL,MACEP,WAAWO,GAAG,GAAG,AAACG,CAAAA,mBAAmBL,iBAAiBI,MAAM,AAAD,IAAK,IAAIH,kBAAkBC,GAAG,GAAG,EAAE,iBAAiB;;IACnH,OAAO;QACLA,MACEP,WAAWO,GAAG,GACdF,iBAAiBI,MAAM,GAAG,IAC1BH,kBAAkBC,GAAG,GACrBP,WAAWS,MAAM,GAAG,IACpB,EAAE,iBAAiB;;IACvB;IAEA,MAAMI,OAAOjB;IAEbF,WAAWG,KAAK,CAACC,OAAO,GAAG;IAC3BJ,WAAWG,KAAK,CAACE,SAAS,GAAG,CAAC,UAAU,EAAEc,KAAK,IAAI,EAAEN,IAAI,GAAG,CAAC;AAC/D"}
@@ -1 +1 @@
1
- {"version":3,"file":"EditorTheme.d.ts","sourceRoot":"","sources":["../../../../src/field/lexical/theme/EditorTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjD,OAAO,oBAAoB,CAAA;AAE3B,eAAO,MAAM,kBAAkB,EAAE,kBAsGhC,CAAA"}
1
+ {"version":3,"file":"EditorTheme.d.ts","sourceRoot":"","sources":["../../../../src/field/lexical/theme/EditorTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjD,OAAO,oBAAoB,CAAA;AAE3B,eAAO,MAAM,kBAAkB,EAAE,kBAuGhC,CAAA"}
@@ -1,4 +1,3 @@
1
- import './EditorTheme.scss';
2
1
  export const LexicalEditorTheme = {
3
2
  block: 'LexicalEditorTheme__block',
4
3
  blockCursor: 'LexicalEditorTheme__blockCursor',
@@ -49,6 +48,7 @@ export const LexicalEditorTheme = {
49
48
  h5: 'LexicalEditorTheme__h5',
50
49
  h6: 'LexicalEditorTheme__h6'
51
50
  },
51
+ hr: 'LexicalEditorTheme__hr',
52
52
  indent: 'LexicalEditorTheme__indent',
53
53
  inlineImage: 'LexicalEditor__inline-image',
54
54
  link: 'LexicalEditorTheme__link',