@payloadcms/richtext-lexical 3.0.0-beta.34 → 3.0.0-beta.36

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 (251) hide show
  1. package/dist/cell/index.d.ts +2 -0
  2. package/dist/cell/index.d.ts.map +1 -1
  3. package/dist/cell/index.js +24 -15
  4. package/dist/cell/index.js.map +1 -1
  5. package/dist/field/Field.d.ts.map +1 -1
  6. package/dist/field/Field.js +66 -47
  7. package/dist/field/Field.js.map +1 -1
  8. package/dist/field/features/blocks/component/BlockContent.js +62 -45
  9. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  10. package/dist/field/features/blocks/component/index.js +38 -28
  11. package/dist/field/features/blocks/component/index.js.map +1 -1
  12. package/dist/field/features/blocks/component/index.scss +0 -4
  13. package/dist/field/features/blocks/drawer/index.js +2 -1
  14. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  15. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +1 -1
  16. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  17. package/dist/field/features/blocks/nodes/BlocksNode.js +2 -1
  18. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  19. package/dist/field/features/blocks/plugin/index.js +2 -1
  20. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  21. package/dist/field/features/blocks/validate.js +1 -1
  22. package/dist/field/features/blocks/validate.js.map +1 -1
  23. package/dist/field/features/debug/testRecorder/plugin/index.js +65 -39
  24. package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -1
  25. package/dist/field/features/debug/treeView/plugin/index.js +2 -1
  26. package/dist/field/features/debug/treeView/plugin/index.js.map +1 -1
  27. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js +2 -1
  28. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -1
  29. package/dist/field/features/link/drawer/index.js +30 -22
  30. package/dist/field/features/link/drawer/index.js.map +1 -1
  31. package/dist/field/features/link/plugins/clickableLink/index.js +2 -1
  32. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  33. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  34. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +88 -70
  35. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  36. package/dist/field/features/link/plugins/floatingLinkEditor/index.js +2 -1
  37. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  38. package/dist/field/features/link/validate.js +1 -1
  39. package/dist/field/features/link/validate.js.map +1 -1
  40. package/dist/field/features/lists/checklist/plugin/index.js +2 -1
  41. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  42. package/dist/field/features/lists/plugin/index.js +2 -1
  43. package/dist/field/features/lists/plugin/index.js.map +1 -1
  44. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +9 -1
  45. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  46. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
  47. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  48. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -1
  49. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  50. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +9 -1
  51. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  52. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
  53. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  54. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -1
  55. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  56. package/dist/field/features/relationship/drawer/index.js +10 -2
  57. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  58. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +1 -1
  59. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  60. package/dist/field/features/relationship/nodes/RelationshipNode.js +2 -1
  61. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  62. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +64 -44
  63. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  64. package/dist/field/features/relationship/plugins/index.js +2 -1
  65. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  66. package/dist/field/features/toolbars/fixed/Toolbar/index.js +60 -55
  67. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -1
  68. package/dist/field/features/toolbars/fixed/Toolbar/index.scss +16 -2
  69. package/dist/field/features/toolbars/inline/Toolbar/index.js +57 -49
  70. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -1
  71. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
  72. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  73. package/dist/field/features/toolbars/shared/ToolbarButton/index.js +5 -3
  74. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  75. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  76. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js +54 -35
  77. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  78. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
  79. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  80. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +25 -22
  81. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  82. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +30 -22
  83. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  84. package/dist/field/features/upload/component/index.js +104 -71
  85. package/dist/field/features/upload/component/index.js.map +1 -1
  86. package/dist/field/features/upload/drawer/index.js +8 -4
  87. package/dist/field/features/upload/drawer/index.js.map +1 -1
  88. package/dist/field/features/upload/nodes/UploadNode.d.ts +1 -1
  89. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  90. package/dist/field/features/upload/nodes/UploadNode.js +2 -1
  91. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  92. package/dist/field/features/upload/plugin/index.js +2 -1
  93. package/dist/field/features/upload/plugin/index.js.map +1 -1
  94. package/dist/field/features/upload/validate.js +1 -1
  95. package/dist/field/features/upload/validate.js.map +1 -1
  96. package/dist/field/index.d.ts +2 -0
  97. package/dist/field/index.d.ts.map +1 -1
  98. package/dist/field/index.js +29 -21
  99. package/dist/field/index.js.map +1 -1
  100. package/dist/field/index.scss +0 -21
  101. package/dist/field/lexical/EditorFocusProvider.d.ts +1 -2
  102. package/dist/field/lexical/EditorFocusProvider.d.ts.map +1 -1
  103. package/dist/field/lexical/EditorFocusProvider.js +5 -3
  104. package/dist/field/lexical/EditorFocusProvider.js.map +1 -1
  105. package/dist/field/lexical/EditorPlugin.js +3 -2
  106. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  107. package/dist/field/lexical/LexicalEditor.js +113 -81
  108. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  109. package/dist/field/lexical/LexicalEditor.scss +10 -1
  110. package/dist/field/lexical/LexicalProvider.js +16 -10
  111. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  112. package/dist/field/lexical/config/client/EditorConfigProvider.js +5 -3
  113. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  114. package/dist/field/lexical/config/client/sanitize.d.ts +2 -1
  115. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  116. package/dist/field/lexical/config/client/sanitize.js +2 -1
  117. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  118. package/dist/field/lexical/config/types.d.ts +2 -0
  119. package/dist/field/lexical/config/types.d.ts.map +1 -1
  120. package/dist/field/lexical/config/types.js.map +1 -1
  121. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +2 -1
  122. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  123. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +1 -1
  124. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  125. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  126. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +1 -1
  127. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  128. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +2 -1
  129. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  130. package/dist/field/lexical/plugins/SlashMenu/index.js +51 -40
  131. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  132. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +2 -2
  133. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  134. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +38 -119
  135. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  136. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.scss +2 -2
  137. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts +1 -1
  138. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -1
  139. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
  140. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +2 -2
  141. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  142. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +102 -58
  143. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  144. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +12 -3
  145. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts +8 -1
  146. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  147. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +73 -25
  148. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  149. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts +5 -0
  150. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -0
  151. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js +21 -0
  152. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -0
  153. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.d.ts +4 -0
  154. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -0
  155. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.js +2 -14
  156. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -0
  157. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  158. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +4 -2
  159. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  160. package/dist/field/lexical/theme/EditorTheme.scss +5 -0
  161. package/dist/field/lexical/ui/ContentEditable.d.ts +1 -1
  162. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  163. package/dist/field/lexical/ui/ContentEditable.js +2 -1
  164. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  165. package/dist/field/lexical/ui/ContentEditable.scss +50 -2
  166. package/dist/field/lexical/ui/icons/AI/index.js +26 -17
  167. package/dist/field/lexical/ui/icons/AI/index.js.map +1 -1
  168. package/dist/field/lexical/ui/icons/Add/index.js +14 -9
  169. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -1
  170. package/dist/field/lexical/ui/icons/Add/light.svg +4 -0
  171. package/dist/field/lexical/ui/icons/AlignCenter/index.js +21 -15
  172. package/dist/field/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  173. package/dist/field/lexical/ui/icons/AlignJustify/index.js +21 -15
  174. package/dist/field/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  175. package/dist/field/lexical/ui/icons/AlignLeft/index.js +21 -15
  176. package/dist/field/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  177. package/dist/field/lexical/ui/icons/AlignRight/index.js +21 -15
  178. package/dist/field/lexical/ui/icons/AlignRight/index.js.map +1 -1
  179. package/dist/field/lexical/ui/icons/Block/index.js +30 -24
  180. package/dist/field/lexical/ui/icons/Block/index.js.map +1 -1
  181. package/dist/field/lexical/ui/icons/Blockquote/index.js +8 -6
  182. package/dist/field/lexical/ui/icons/Blockquote/index.js.map +1 -1
  183. package/dist/field/lexical/ui/icons/Bold/index.js +8 -6
  184. package/dist/field/lexical/ui/icons/Bold/index.js.map +1 -1
  185. package/dist/field/lexical/ui/icons/Checklist/index.js +19 -14
  186. package/dist/field/lexical/ui/icons/Checklist/index.js.map +1 -1
  187. package/dist/field/lexical/ui/icons/Code/index.js +14 -9
  188. package/dist/field/lexical/ui/icons/Code/index.js.map +1 -1
  189. package/dist/field/lexical/ui/icons/CodeBlock/index.js +14 -9
  190. package/dist/field/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  191. package/dist/field/lexical/ui/icons/DraggableBlock/light.svg +9 -0
  192. package/dist/field/lexical/ui/icons/H1/index.js +8 -6
  193. package/dist/field/lexical/ui/icons/H1/index.js.map +1 -1
  194. package/dist/field/lexical/ui/icons/H2/index.js +8 -6
  195. package/dist/field/lexical/ui/icons/H2/index.js.map +1 -1
  196. package/dist/field/lexical/ui/icons/H3/index.js +8 -6
  197. package/dist/field/lexical/ui/icons/H3/index.js.map +1 -1
  198. package/dist/field/lexical/ui/icons/H4/index.js +8 -6
  199. package/dist/field/lexical/ui/icons/H4/index.js.map +1 -1
  200. package/dist/field/lexical/ui/icons/H5/index.js +8 -6
  201. package/dist/field/lexical/ui/icons/H5/index.js.map +1 -1
  202. package/dist/field/lexical/ui/icons/H6/index.js +8 -6
  203. package/dist/field/lexical/ui/icons/H6/index.js.map +1 -1
  204. package/dist/field/lexical/ui/icons/HorizontalRule/index.js +11 -9
  205. package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  206. package/dist/field/lexical/ui/icons/IndentDecrease/index.js +25 -18
  207. package/dist/field/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  208. package/dist/field/lexical/ui/icons/IndentIncrease/index.js +25 -18
  209. package/dist/field/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  210. package/dist/field/lexical/ui/icons/Italic/index.js +8 -6
  211. package/dist/field/lexical/ui/icons/Italic/index.js.map +1 -1
  212. package/dist/field/lexical/ui/icons/Link/index.js +26 -17
  213. package/dist/field/lexical/ui/icons/Link/index.js.map +1 -1
  214. package/dist/field/lexical/ui/icons/OrderedList/index.js +29 -21
  215. package/dist/field/lexical/ui/icons/OrderedList/index.js.map +1 -1
  216. package/dist/field/lexical/ui/icons/Relationship/index.js +26 -17
  217. package/dist/field/lexical/ui/icons/Relationship/index.js.map +1 -1
  218. package/dist/field/lexical/ui/icons/Strikethrough/index.js +14 -9
  219. package/dist/field/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  220. package/dist/field/lexical/ui/icons/Subscript/index.js +8 -6
  221. package/dist/field/lexical/ui/icons/Subscript/index.js.map +1 -1
  222. package/dist/field/lexical/ui/icons/Superscript/index.js +8 -6
  223. package/dist/field/lexical/ui/icons/Superscript/index.js.map +1 -1
  224. package/dist/field/lexical/ui/icons/Text/index.js +8 -6
  225. package/dist/field/lexical/ui/icons/Text/index.js.map +1 -1
  226. package/dist/field/lexical/ui/icons/Underline/index.js +14 -9
  227. package/dist/field/lexical/ui/icons/Underline/index.js.map +1 -1
  228. package/dist/field/lexical/ui/icons/UnorderedList/index.js +45 -36
  229. package/dist/field/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  230. package/dist/field/lexical/ui/icons/Upload/index.js +24 -18
  231. package/dist/field/lexical/ui/icons/Upload/index.js.map +1 -1
  232. package/dist/generateComponentMap.js +8 -8
  233. package/dist/generateComponentMap.js.map +1 -1
  234. package/dist/index.d.ts.map +1 -1
  235. package/dist/index.js +2 -0
  236. package/dist/index.js.map +1 -1
  237. package/dist/populate/defaultValue.d.ts +0 -1
  238. package/dist/populate/defaultValue.d.ts.map +1 -1
  239. package/dist/populate/defaultValue.js +0 -19
  240. package/dist/populate/defaultValue.js.map +1 -1
  241. package/dist/types.d.ts +7 -0
  242. package/dist/types.d.ts.map +1 -1
  243. package/dist/types.js.map +1 -1
  244. package/dist/validate/index.d.ts.map +1 -1
  245. package/dist/validate/index.js +3 -2
  246. package/dist/validate/index.js.map +1 -1
  247. package/dist/validate/validateNodes.js +1 -1
  248. package/dist/validate/validateNodes.js.map +1 -1
  249. package/package.json +18 -14
  250. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +0 -1
  251. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +0 -1
@@ -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 targetElemTranslate = 0\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 let top = lineTop - anchorTop + targetElemTranslate2\n if (!isBelow) {\n top -= TARGET_LINE_HALF_HEIGHT * 2\n }\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 /**\n * Move around element below or above the line (= the target / targetBlockElem)\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 targetBlockElem.style.transform = `translate(0, ${targetElemTranslate}px)`\n if (isBelow) {\n // add to existing marginBottom plus the height of targetLineElem\n targetBlockElem.style.marginBottom = TARGET_LINE_HALF_HEIGHT * 2 + 'px'\n } else {\n targetBlockElem.style.marginTop = TARGET_LINE_HALF_HEIGHT * 2 + '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 = ''\n lastTargetBlockElem.style.transform = ''\n\n // Delete marginBottom and marginTop values we set\n lastTargetBlockElem.style.marginBottom = ''\n lastTargetBlockElem.style.marginTop = ''\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","targetElemTranslate","targetElemTranslate2","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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AE/B;;GAEC,GACD,uCAAuC;IACvC,IAAI,CAACpB,2BAA2B;QAC9B,6FAA6F;QAC7FN,gBAAgBwB,KAAK,CAACC,SAAS,GAAG,CAAC,aAAa,EAAEJ,oBAAoB,GAAG,CAAC;QAC1E,IAAIH,SAAS;YACX,iEAAiE;YACjElB,gBAAgBwB,KAAK,CAACT,YAAY,GAAGrB,0BAA0B,IAAI;QACrE,OAAO;YACLM,gBAAgBwB,KAAK,CAACR,SAAS,GAAGtB,0BAA0B,IAAI;QAClE;IACF;IAEA,IAAIE,OAAO;QACT,gDAAgD;QAChDH,8BAA8BY,mBAAmBL,iBAAiBG;IACpE;IAEA,IAAIF,uBAAuBA,wBAAwBD,iBAAiB;QAClEC,oBAAoBuB,KAAK,CAACE,OAAO,GAAG;QACpCzB,oBAAoBuB,KAAK,CAACC,SAAS,GAAG;QAEtC,kDAAkD;QAClDxB,oBAAoBuB,KAAK,CAACT,YAAY,GAAG;QACzCd,oBAAoBuB,KAAK,CAACR,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,OAAO,SAASC,cACdC,WAAmB,EACnBC,UAAkB,EAClBC,cAA2B,EAC3BC,eAA4B,EAC5BC,eAIC,EACDC,MAAc,EACdC,UAAuB,EACvBC,KAAgB,EAChBC,iBAAyD,EACzDC,4BAAqC,KAAK;IAE1C,MAAM,EAAEC,QAAQC,qBAAqB,EAAEC,KAAKC,kBAAkB,EAAE,GAC9DV,gBAAgBW,qBAAqB,GAAG,oIAAoI;;IAC9K,MAAM,EAAEF,KAAKG,SAAS,EAAEC,OAAOC,WAAW,EAAE,GAAGX,WAAWQ,qBAAqB;IAE/E,MAAM,EAAEI,YAAY,EAAEC,SAAS,EAAE,GAAG1B,oBAAoBU;IACxD,IAAIiB,UAAUP;IAEd,MAAMQ,UAAUhB,UAAUQ,qBAAqBF,wB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+ * 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"}
@@ -8,6 +8,10 @@ type Props = {
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,9 +1,9 @@
1
1
  import { $getNodeByKey } from 'lexical';
2
2
  import { Point } from '../../../utils/point.js';
3
3
  import { Rect } from '../../../utils/rect.js';
4
+ import { getBoundingClientRectWithoutTransform } from '../DraggableBlockPlugin/getBoundingRectWithoutTransform.js';
4
5
  import { getCollapsedMargins } from '../utils/getCollapsedMargins.js';
5
6
  import { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js';
6
- import { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js';
7
7
  // Directions
8
8
  const Downward = 1;
9
9
  const Upward = -1;
@@ -21,9 +21,6 @@ export function getNodeCloseToPoint(props) {
21
21
  const { anchorElem, cache_threshold = 20, editor, fuzzy = false, horizontalOffset = 0, point: { x, y }, startIndex = 0, useEdgeAsDefault = false, verbose = false } = props;
22
22
  // Use cache
23
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)) {
24
- if (verbose) {
25
- //console.log('Returning cached result')
26
- }
27
24
  return cache.result;
28
25
  }
29
26
  const anchorElementRect = anchorElem.getBoundingClientRect();
@@ -59,9 +56,6 @@ export function getNodeCloseToPoint(props) {
59
56
  closestBlockElem.foundAtIndex = topLevelNodeKeys.length - 1;
60
57
  }
61
58
  if (closestBlockElem?.blockElem) {
62
- if (verbose) {
63
- //console.log('useEdgeAsDefault', useEdgeAsDefault)
64
- }
65
59
  return {
66
60
  blockElem: null,
67
61
  isFoundNodeEmptyParagraph: false
@@ -72,9 +66,6 @@ export function getNodeCloseToPoint(props) {
72
66
  // Find matching block element
73
67
  let index = startIndex;
74
68
  let direction = Indeterminate;
75
- if (verbose) {
76
- //console.log('start index', startIndex)
77
- }
78
69
  while(index >= 0 && index < topLevelNodeKeys.length){
79
70
  const key = topLevelNodeKeys[index];
80
71
  const elem = editor.getElementByKey(key);
@@ -93,9 +84,6 @@ export function getNodeCloseToPoint(props) {
93
84
  top: domRect.top - marginTop
94
85
  });
95
86
  const { distance, isOnBottomSide, isOnTopSide } = rect.distanceFromPoint(point);
96
- if (verbose) {
97
- //console.log('distance', distance)
98
- }
99
87
  if (distance === 0) {
100
88
  closestBlockElem.blockElem = elem;
101
89
  closestBlockElem.blockNode = $getNodeByKey(key);
@@ -103,7 +91,7 @@ export function getNodeCloseToPoint(props) {
103
91
  closestBlockElem.distance = distance;
104
92
  // Check if blockNode is an empty text node
105
93
  if (closestBlockElem.blockNode && closestBlockElem.blockNode.getType() === 'paragraph' && closestBlockElem.blockNode.getTextContent() === '') {
106
- if (!fuzzy) {
94
+ if (!fuzzy && !props.returnEmptyParagraphs) {
107
95
  closestBlockElem.blockElem = null;
108
96
  closestBlockElem.blockNode = null;
109
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,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oBAC5BH,iBAAiBK,YAAY,GAAGY;gBAClC;YACF;YAEA,IAAIC,cAAc3C,eAAe;gBAC/B,IAAIuD,aAAa;oBACfZ,YAAY5C;gBACd,OAAO,IAAIuD,gBAAgB;oBACzBX,YAAY7C;gBACd,OAAO;oBACL,4BAA4B;oBAC5B6C,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":"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"}
@@ -15,6 +15,11 @@
15
15
  position: relative;
16
16
  }
17
17
 
18
+ // No bottom margin for last paragraph in editor. This also created nice animations when adding a new line at the end
19
+ .ContentEditable__root > &__paragraph:last-child {
20
+ margin-bottom: 0;
21
+ }
22
+
18
23
  &__quote {
19
24
  margin: 0 0 10px 20px;
20
25
  font-size: 15px;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" resolution-mode="require"/>
1
+ import type { JSX } from 'react';
2
2
  import './ContentEditable.scss';
3
3
  export declare function LexicalContentEditable({ className }: {
4
4
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ContentEditable.d.ts","sourceRoot":"","sources":["../../../../src/field/lexical/ui/ContentEditable.tsx"],"names":[],"mappings":";AAGA,OAAO,wBAAwB,CAAA;AAE/B,wBAAgB,sBAAsB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAEzF"}
1
+ {"version":3,"file":"ContentEditable.d.ts","sourceRoot":"","sources":["../../../../src/field/lexical/ui/ContentEditable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAKhC,OAAO,wBAAwB,CAAA;AAE/B,wBAAgB,sBAAsB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAEzF"}
@@ -1,8 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { ContentEditable } from '@lexical/react/LexicalContentEditable.js';
2
3
  import * as React from 'react';
3
4
  import './ContentEditable.scss';
4
5
  export function LexicalContentEditable({ className }) {
5
- return /*#__PURE__*/ React.createElement(ContentEditable, {
6
+ return /*#__PURE__*/ _jsx(ContentEditable, {
6
7
  className: className ?? 'ContentEditable__root'
7
8
  });
8
9
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/lexical/ui/ContentEditable.tsx"],"sourcesContent":["import { ContentEditable } from '@lexical/react/LexicalContentEditable.js'\nimport * as React from 'react'\n\nimport './ContentEditable.scss'\n\nexport function LexicalContentEditable({ className }: { className?: string }): JSX.Element {\n return <ContentEditable className={className ?? 'ContentEditable__root'} />\n}\n"],"names":["ContentEditable","React","LexicalContentEditable","className"],"rangeMappings":";;;;;;;","mappings":"AAAA,SAASA,eAAe,QAAQ,2CAA0C;AAC1E,YAAYC,WAAW,QAAO;AAE9B,OAAO,yBAAwB;AAE/B,OAAO,SAASC,uBAAuB,EAAEC,SAAS,EAA0B;IAC1E,qBAAO,oBAACH;QAAgBG,WAAWA,aAAa;;AAClD"}
1
+ {"version":3,"sources":["../../../../src/field/lexical/ui/ContentEditable.tsx"],"sourcesContent":["import type { JSX } from 'react'\n\nimport { ContentEditable } from '@lexical/react/LexicalContentEditable.js'\nimport * as React from 'react'\n\nimport './ContentEditable.scss'\n\nexport function LexicalContentEditable({ className }: { className?: string }): JSX.Element {\n return <ContentEditable className={className ?? 'ContentEditable__root'} />\n}\n"],"names":["ContentEditable","React","LexicalContentEditable","className"],"rangeMappings":";;;;;;;;","mappings":";AAEA,SAASA,eAAe,QAAQ,2CAA0C;AAC1E,YAAYC,WAAW,QAAO;AAE9B,OAAO,yBAAwB;AAE/B,OAAO,SAASC,uBAAuB,EAAEC,SAAS,EAA0B;IAC1E,qBAAO,KAACH;QAAgBG,WAAWA,aAAa;;AAClD"}
@@ -1,5 +1,9 @@
1
1
  @import '../../../scss/styles.scss';
2
2
 
3
+ $lexical-contenteditable-top-padding: 8px;
4
+ $lexical-contenteditable-bottom-padding: 8px;
5
+
6
+
3
7
  .ContentEditable__root {
4
8
  border: 0;
5
9
  font-size: 15px;
@@ -7,8 +11,9 @@
7
11
  position: relative;
8
12
  tab-size: 1;
9
13
  outline: 0;
10
- padding-top: 8px;
11
- min-height: base(10);
14
+ padding-top: $lexical-contenteditable-top-padding;
15
+ padding-bottom: $lexical-contenteditable-bottom-padding;
16
+ //min-height: base(10);
12
17
 
13
18
  &:focus-visible {
14
19
  outline: none !important;
@@ -20,9 +25,52 @@
20
25
  }
21
26
  }
22
27
 
28
+
23
29
  @media (max-width: 1025px) {
24
30
  .ContentEditable__root {
25
31
  padding-left: 0;
26
32
  padding-right: 0;
27
33
  }
28
34
  }
35
+
36
+ @media (min-width: 1026px) {
37
+ .rich-text-lexical--show-gutter > .rich-text-lexical__wrap > .editor-container > .editor-scroller > .editor {
38
+ > .ContentEditable__root {
39
+ padding-left: 3rem;
40
+ }
41
+ > .ContentEditable__root::before {
42
+ content: ' ';
43
+ position: absolute;
44
+ top: $lexical-contenteditable-top-padding;
45
+ left: 0;
46
+ height: calc(100% - #{$lexical-contenteditable-top-padding} - #{$lexical-contenteditable-bottom-padding});
47
+ border-left: 1px solid var(--theme-elevation-100);
48
+ }
49
+ }
50
+ }
51
+
52
+ html[data-theme='light'] {
53
+ .rich-text-lexical.rich-text-lexical--show-gutter {
54
+ &.error:not(:hover) {
55
+ > .rich-text-lexical__wrap > .editor-container > .editor-scroller > .editor > .ContentEditable__root::before {
56
+ border-left: 2px solid var(--theme-error-400);
57
+ }
58
+ }
59
+
60
+ &.error:hover {
61
+ > .rich-text-lexical__wrap > .editor-container > .editor-scroller > .editor > .ContentEditable__root::before {
62
+ border-left: 2px solid var(--theme-error-500);
63
+ }
64
+ }
65
+ }
66
+ }
67
+
68
+ html[data-theme='dark'] {
69
+ .rich-text-lexical.rich-text-lexical--show-gutter {
70
+ &.error {
71
+ > .rich-text-lexical__wrap > .editor-container > .editor-scroller > .editor > .ContentEditable__root::before {
72
+ border-left: 2px solid var(--theme-error-500);
73
+ }
74
+ }
75
+ }
76
+ }
@@ -1,5 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import React from 'react';
2
- export const AIIcon = ()=>/*#__PURE__*/ React.createElement("svg", {
3
+ export const AIIcon = ()=>/*#__PURE__*/ _jsxs("svg", {
3
4
  "aria-hidden": "true",
4
5
  className: "icon",
5
6
  fill: "none",
@@ -7,21 +8,29 @@ export const AIIcon = ()=>/*#__PURE__*/ React.createElement("svg", {
7
8
  height: "20",
8
9
  viewBox: "0 0 20 20",
9
10
  width: "20",
10
- xmlns: "http://www.w3.org/2000/svg"
11
- }, /*#__PURE__*/ React.createElement("g", {
12
- clipPath: "url(#clip0_4393_10389)"
13
- }, /*#__PURE__*/ React.createElement("path", {
14
- d: "M6.25 4.75V7M5.125 5.875L7.375 5.875M6.25 13V14.125M6.25 14.125V15.25M6.25 14.125H5.125M6.25 14.125H7.375M10.75 5.5L11.2171 6.66785C11.7399 7.97466 12.7753 9.01014 14.0822 9.53286L15.25 10L13.686 10.782C12.6191 11.3154 11.7708 12.2032 11.2864 13.2932L10.75 14.5L10.2136 13.2932C9.72919 12.2032 8.8809 11.3154 7.814 10.782L6.25 10L7.41785 9.53286C8.72466 9.01014 9.76014 7.97466 10.2829 6.66785L10.75 5.5Z",
15
- stroke: "currentColor",
16
- strokeLinecap: "round",
17
- strokeLinejoin: "round"
18
- })), /*#__PURE__*/ React.createElement("defs", null, /*#__PURE__*/ React.createElement("clipPath", {
19
- id: "clip0_4393_10389"
20
- }, /*#__PURE__*/ React.createElement("rect", {
21
- fill: "white",
22
- height: "12",
23
- transform: "translate(4 4)",
24
- width: "12"
25
- }))));
11
+ xmlns: "http://www.w3.org/2000/svg",
12
+ children: [
13
+ /*#__PURE__*/ _jsx("g", {
14
+ clipPath: "url(#clip0_4393_10389)",
15
+ children: /*#__PURE__*/ _jsx("path", {
16
+ d: "M6.25 4.75V7M5.125 5.875L7.375 5.875M6.25 13V14.125M6.25 14.125V15.25M6.25 14.125H5.125M6.25 14.125H7.375M10.75 5.5L11.2171 6.66785C11.7399 7.97466 12.7753 9.01014 14.0822 9.53286L15.25 10L13.686 10.782C12.6191 11.3154 11.7708 12.2032 11.2864 13.2932L10.75 14.5L10.2136 13.2932C9.72919 12.2032 8.8809 11.3154 7.814 10.782L6.25 10L7.41785 9.53286C8.72466 9.01014 9.76014 7.97466 10.2829 6.66785L10.75 5.5Z",
17
+ stroke: "currentColor",
18
+ strokeLinecap: "round",
19
+ strokeLinejoin: "round"
20
+ })
21
+ }),
22
+ /*#__PURE__*/ _jsx("defs", {
23
+ children: /*#__PURE__*/ _jsx("clipPath", {
24
+ id: "clip0_4393_10389",
25
+ children: /*#__PURE__*/ _jsx("rect", {
26
+ fill: "white",
27
+ height: "12",
28
+ transform: "translate(4 4)",
29
+ width: "12"
30
+ })
31
+ })
32
+ })
33
+ ]
34
+ });
26
35
 
27
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/lexical/ui/icons/AI/index.tsx"],"sourcesContent":["import React from 'react'\n\nexport const AIIcon: React.FC = () => (\n <svg\n aria-hidden=\"true\"\n className=\"icon\"\n fill=\"none\"\n focusable=\"false\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n width=\"20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g clipPath=\"url(#clip0_4393_10389)\">\n <path\n d=\"M6.25 4.75V7M5.125 5.875L7.375 5.875M6.25 13V14.125M6.25 14.125V15.25M6.25 14.125H5.125M6.25 14.125H7.375M10.75 5.5L11.2171 6.66785C11.7399 7.97466 12.7753 9.01014 14.0822 9.53286L15.25 10L13.686 10.782C12.6191 11.3154 11.7708 12.2032 11.2864 13.2932L10.75 14.5L10.2136 13.2932C9.72919 12.2032 8.8809 11.3154 7.814 10.782L6.25 10L7.41785 9.53286C8.72466 9.01014 9.76014 7.97466 10.2829 6.66785L10.75 5.5Z\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_4393_10389\">\n <rect fill=\"white\" height=\"12\" transform=\"translate(4 4)\" width=\"12\" />\n </clipPath>\n </defs>\n </svg>\n)\n"],"names":["React","AIIcon","svg","aria-hidden","className","fill","focusable","height","viewBox","width","xmlns","g","clipPath","path","d","stroke","strokeLinecap","strokeLinejoin","defs","id","rect","transform"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,WAAW,QAAO;AAEzB,OAAO,MAAMC,SAAmB,kBAC9B,oBAACC;QACCC,eAAY;QACZC,WAAU;QACVC,MAAK;QACLC,WAAU;QACVC,QAAO;QACPC,SAAQ;QACRC,OAAM;QACNC,OAAM;qBAEN,oBAACC;QAAEC,UAAS;qBACV,oBAACC;QACCC,GAAE;QACFC,QAAO;QACPC,eAAc;QACdC,gBAAe;uBAGnB,oBAACC,4BACC,oBAACN;QAASO,IAAG;qBACX,oBAACC;QAAKf,MAAK;QAAQE,QAAO;QAAKc,WAAU;QAAiBZ,OAAM;UAIvE"}
1
+ {"version":3,"sources":["../../../../../../src/field/lexical/ui/icons/AI/index.tsx"],"sourcesContent":["import React from 'react'\n\nexport const AIIcon: React.FC = () => (\n <svg\n aria-hidden=\"true\"\n className=\"icon\"\n fill=\"none\"\n focusable=\"false\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n width=\"20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g clipPath=\"url(#clip0_4393_10389)\">\n <path\n d=\"M6.25 4.75V7M5.125 5.875L7.375 5.875M6.25 13V14.125M6.25 14.125V15.25M6.25 14.125H5.125M6.25 14.125H7.375M10.75 5.5L11.2171 6.66785C11.7399 7.97466 12.7753 9.01014 14.0822 9.53286L15.25 10L13.686 10.782C12.6191 11.3154 11.7708 12.2032 11.2864 13.2932L10.75 14.5L10.2136 13.2932C9.72919 12.2032 8.8809 11.3154 7.814 10.782L6.25 10L7.41785 9.53286C8.72466 9.01014 9.76014 7.97466 10.2829 6.66785L10.75 5.5Z\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_4393_10389\">\n <rect fill=\"white\" height=\"12\" transform=\"translate(4 4)\" width=\"12\" />\n </clipPath>\n </defs>\n </svg>\n)\n"],"names":["React","AIIcon","svg","aria-hidden","className","fill","focusable","height","viewBox","width","xmlns","g","clipPath","path","d","stroke","strokeLinecap","strokeLinejoin","defs","id","rect","transform"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,WAAW,QAAO;AAEzB,OAAO,MAAMC,SAAmB,kBAC9B,MAACC;QACCC,eAAY;QACZC,WAAU;QACVC,MAAK;QACLC,WAAU;QACVC,QAAO;QACPC,SAAQ;QACRC,OAAM;QACNC,OAAM;;0BAEN,KAACC;gBAAEC,UAAS;0BACV,cAAA,KAACC;oBACCC,GAAE;oBACFC,QAAO;oBACPC,eAAc;oBACdC,gBAAe;;;0BAGnB,KAACC;0BACC,cAAA,KAACN;oBAASO,IAAG;8BACX,cAAA,KAACC;wBAAKf,MAAK;wBAAQE,QAAO;wBAAKc,WAAU;wBAAiBZ,OAAM;;;;;OAIvE"}
@@ -1,16 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import React from 'react';
2
- export const AddIcon = ()=>/*#__PURE__*/ React.createElement("svg", {
3
+ export const AddIcon = ()=>/*#__PURE__*/ _jsxs("svg", {
3
4
  fill: "none",
4
5
  height: "20",
5
6
  viewBox: "0 0 20 20",
6
7
  width: "20",
7
- xmlns: "http://www.w3.org/2000/svg"
8
- }, /*#__PURE__*/ React.createElement("path", {
9
- d: "M5 10h10",
10
- stroke: "currentColor"
11
- }), /*#__PURE__*/ React.createElement("path", {
12
- d: "M10 15V5",
13
- stroke: "currentColor"
14
- }));
8
+ xmlns: "http://www.w3.org/2000/svg",
9
+ children: [
10
+ /*#__PURE__*/ _jsx("path", {
11
+ d: "M5 10h10",
12
+ stroke: "currentColor"
13
+ }),
14
+ /*#__PURE__*/ _jsx("path", {
15
+ d: "M10 15V5",
16
+ stroke: "currentColor"
17
+ })
18
+ ]
19
+ });
15
20
 
16
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/lexical/ui/icons/Add/index.tsx"],"sourcesContent":["import React from 'react'\n\nexport const AddIcon: React.FC = () => (\n <svg fill=\"none\" height=\"20\" viewBox=\"0 0 20 20\" width=\"20\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5 10h10\" stroke=\"currentColor\" />\n <path d=\"M10 15V5\" stroke=\"currentColor\" />\n </svg>\n)\n"],"names":["React","AddIcon","svg","fill","height","viewBox","width","xmlns","path","d","stroke"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA,OAAOA,WAAW,QAAO;AAEzB,OAAO,MAAMC,UAAoB,kBAC/B,oBAACC;QAAIC,MAAK;QAAOC,QAAO;QAAKC,SAAQ;QAAYC,OAAM;QAAKC,OAAM;qBAChE,oBAACC;QAAKC,GAAE;QAAWC,QAAO;sBAC1B,oBAACF;QAAKC,GAAE;QAAWC,QAAO;QAE7B"}
1
+ {"version":3,"sources":["../../../../../../src/field/lexical/ui/icons/Add/index.tsx"],"sourcesContent":["import React from 'react'\n\nexport const AddIcon: React.FC = () => (\n <svg fill=\"none\" height=\"20\" viewBox=\"0 0 20 20\" width=\"20\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5 10h10\" stroke=\"currentColor\" />\n <path d=\"M10 15V5\" stroke=\"currentColor\" />\n </svg>\n)\n"],"names":["React","AddIcon","svg","fill","height","viewBox","width","xmlns","path","d","stroke"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,WAAW,QAAO;AAEzB,OAAO,MAAMC,UAAoB,kBAC/B,MAACC;QAAIC,MAAK;QAAOC,QAAO;QAAKC,SAAQ;QAAYC,OAAM;QAAKC,OAAM;;0BAChE,KAACC;gBAAKC,GAAE;gBAAWC,QAAO;;0BAC1B,KAACF;gBAAKC,GAAE;gBAAWC,QAAO;;;OAE7B"}
@@ -0,0 +1,4 @@
1
+ <svg width="18" height="24" viewBox="0 0 18 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M5,12h8" stroke="#ffffff" />
3
+ <path d="M9,16V8" stroke="#ffffff" />
4
+ </svg>
@@ -1,5 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import React from 'react';
2
- export const AlignCenterIcon = ()=>/*#__PURE__*/ React.createElement("svg", {
3
+ export const AlignCenterIcon = ()=>/*#__PURE__*/ _jsxs("svg", {
3
4
  "aria-hidden": "true",
4
5
  className: "icon",
5
6
  fill: "none",
@@ -7,19 +8,24 @@ export const AlignCenterIcon = ()=>/*#__PURE__*/ React.createElement("svg", {
7
8
  height: "20",
8
9
  viewBox: "0 0 20 20",
9
10
  width: "20",
10
- xmlns: "http://www.w3.org/2000/svg"
11
- }, /*#__PURE__*/ React.createElement("path", {
12
- d: "M2.5 5H17.5",
13
- stroke: "currentColor",
14
- strokeWidth: "1.5"
15
- }), /*#__PURE__*/ React.createElement("path", {
16
- d: "M2.5 10H17.5",
17
- stroke: "currentColor",
18
- strokeWidth: "1.5"
19
- }), /*#__PURE__*/ React.createElement("path", {
20
- d: "M5 15H15",
21
- stroke: "currentColor",
22
- strokeWidth: "1.5"
23
- }));
11
+ xmlns: "http://www.w3.org/2000/svg",
12
+ children: [
13
+ /*#__PURE__*/ _jsx("path", {
14
+ d: "M2.5 5H17.5",
15
+ stroke: "currentColor",
16
+ strokeWidth: "1.5"
17
+ }),
18
+ /*#__PURE__*/ _jsx("path", {
19
+ d: "M2.5 10H17.5",
20
+ stroke: "currentColor",
21
+ strokeWidth: "1.5"
22
+ }),
23
+ /*#__PURE__*/ _jsx("path", {
24
+ d: "M5 15H15",
25
+ stroke: "currentColor",
26
+ strokeWidth: "1.5"
27
+ })
28
+ ]
29
+ });
24
30
 
25
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/lexical/ui/icons/AlignCenter/index.tsx"],"sourcesContent":["import React from 'react'\n\nexport const AlignCenterIcon: React.FC = () => (\n <svg\n aria-hidden=\"true\"\n className=\"icon\"\n fill=\"none\"\n focusable=\"false\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n width=\"20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2.5 5H17.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M2.5 10H17.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M5 15H15\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n </svg>\n)\n"],"names":["React","AlignCenterIcon","svg","aria-hidden","className","fill","focusable","height","viewBox","width","xmlns","path","d","stroke","strokeWidth"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,WAAW,QAAO;AAEzB,OAAO,MAAMC,kBAA4B,kBACvC,oBAACC;QACCC,eAAY;QACZC,WAAU;QACVC,MAAK;QACLC,WAAU;QACVC,QAAO;QACPC,SAAQ;QACRC,OAAM;QACNC,OAAM;qBAEN,oBAACC;QAAKC,GAAE;QAAcC,QAAO;QAAeC,aAAY;sBACxD,oBAACH;QAAKC,GAAE;QAAeC,QAAO;QAAeC,aAAY;sBACzD,oBAACH;QAAKC,GAAE;QAAWC,QAAO;QAAeC,aAAY;QAExD"}
1
+ {"version":3,"sources":["../../../../../../src/field/lexical/ui/icons/AlignCenter/index.tsx"],"sourcesContent":["import React from 'react'\n\nexport const AlignCenterIcon: React.FC = () => (\n <svg\n aria-hidden=\"true\"\n className=\"icon\"\n fill=\"none\"\n focusable=\"false\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n width=\"20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2.5 5H17.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M2.5 10H17.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M5 15H15\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n </svg>\n)\n"],"names":["React","AlignCenterIcon","svg","aria-hidden","className","fill","focusable","height","viewBox","width","xmlns","path","d","stroke","strokeWidth"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,WAAW,QAAO;AAEzB,OAAO,MAAMC,kBAA4B,kBACvC,MAACC;QACCC,eAAY;QACZC,WAAU;QACVC,MAAK;QACLC,WAAU;QACVC,QAAO;QACPC,SAAQ;QACRC,OAAM;QACNC,OAAM;;0BAEN,KAACC;gBAAKC,GAAE;gBAAcC,QAAO;gBAAeC,aAAY;;0BACxD,KAACH;gBAAKC,GAAE;gBAAeC,QAAO;gBAAeC,aAAY;;0BACzD,KAACH;gBAAKC,GAAE;gBAAWC,QAAO;gBAAeC,aAAY;;;OAExD"}
@@ -1,5 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import React from 'react';
2
- export const AlignJustifyIcon = ()=>/*#__PURE__*/ React.createElement("svg", {
3
+ export const AlignJustifyIcon = ()=>/*#__PURE__*/ _jsxs("svg", {
3
4
  "aria-hidden": "true",
4
5
  className: "icon",
5
6
  fill: "none",
@@ -7,19 +8,24 @@ export const AlignJustifyIcon = ()=>/*#__PURE__*/ React.createElement("svg", {
7
8
  height: "20",
8
9
  viewBox: "0 0 20 20",
9
10
  width: "20",
10
- xmlns: "http://www.w3.org/2000/svg"
11
- }, /*#__PURE__*/ React.createElement("path", {
12
- d: "M2.5 5H17.5",
13
- stroke: "currentColor",
14
- strokeWidth: "1.5"
15
- }), /*#__PURE__*/ React.createElement("path", {
16
- d: "M2.5 10H17.5",
17
- stroke: "currentColor",
18
- strokeWidth: "1.5"
19
- }), /*#__PURE__*/ React.createElement("path", {
20
- d: "M2.5 15H17.5",
21
- stroke: "currentColor",
22
- strokeWidth: "1.5"
23
- }));
11
+ xmlns: "http://www.w3.org/2000/svg",
12
+ children: [
13
+ /*#__PURE__*/ _jsx("path", {
14
+ d: "M2.5 5H17.5",
15
+ stroke: "currentColor",
16
+ strokeWidth: "1.5"
17
+ }),
18
+ /*#__PURE__*/ _jsx("path", {
19
+ d: "M2.5 10H17.5",
20
+ stroke: "currentColor",
21
+ strokeWidth: "1.5"
22
+ }),
23
+ /*#__PURE__*/ _jsx("path", {
24
+ d: "M2.5 15H17.5",
25
+ stroke: "currentColor",
26
+ strokeWidth: "1.5"
27
+ })
28
+ ]
29
+ });
24
30
 
25
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/lexical/ui/icons/AlignJustify/index.tsx"],"sourcesContent":["import React from 'react'\n\nexport const AlignJustifyIcon: React.FC = () => (\n <svg\n aria-hidden=\"true\"\n className=\"icon\"\n fill=\"none\"\n focusable=\"false\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n width=\"20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2.5 5H17.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M2.5 10H17.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M2.5 15H17.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n </svg>\n)\n"],"names":["React","AlignJustifyIcon","svg","aria-hidden","className","fill","focusable","height","viewBox","width","xmlns","path","d","stroke","strokeWidth"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,WAAW,QAAO;AAEzB,OAAO,MAAMC,mBAA6B,kBACxC,oBAACC;QACCC,eAAY;QACZC,WAAU;QACVC,MAAK;QACLC,WAAU;QACVC,QAAO;QACPC,SAAQ;QACRC,OAAM;QACNC,OAAM;qBAEN,oBAACC;QAAKC,GAAE;QAAcC,QAAO;QAAeC,aAAY;sBACxD,oBAACH;QAAKC,GAAE;QAAeC,QAAO;QAAeC,aAAY;sBACzD,oBAACH;QAAKC,GAAE;QAAeC,QAAO;QAAeC,aAAY;QAE5D"}
1
+ {"version":3,"sources":["../../../../../../src/field/lexical/ui/icons/AlignJustify/index.tsx"],"sourcesContent":["import React from 'react'\n\nexport const AlignJustifyIcon: React.FC = () => (\n <svg\n aria-hidden=\"true\"\n className=\"icon\"\n fill=\"none\"\n focusable=\"false\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n width=\"20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2.5 5H17.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M2.5 10H17.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M2.5 15H17.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n </svg>\n)\n"],"names":["React","AlignJustifyIcon","svg","aria-hidden","className","fill","focusable","height","viewBox","width","xmlns","path","d","stroke","strokeWidth"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,WAAW,QAAO;AAEzB,OAAO,MAAMC,mBAA6B,kBACxC,MAACC;QACCC,eAAY;QACZC,WAAU;QACVC,MAAK;QACLC,WAAU;QACVC,QAAO;QACPC,SAAQ;QACRC,OAAM;QACNC,OAAM;;0BAEN,KAACC;gBAAKC,GAAE;gBAAcC,QAAO;gBAAeC,aAAY;;0BACxD,KAACH;gBAAKC,GAAE;gBAAeC,QAAO;gBAAeC,aAAY;;0BACzD,KAACH;gBAAKC,GAAE;gBAAeC,QAAO;gBAAeC,aAAY;;;OAE5D"}