@ethberry/mui-lexical 1.0.7

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 (605) hide show
  1. package/LICENSE +16 -0
  2. package/README.md +1 -0
  3. package/dist/common/hooks/index.d.ts +1 -0
  4. package/dist/common/hooks/index.js +18 -0
  5. package/dist/common/hooks/index.js.map +1 -0
  6. package/dist/common/hooks/useModal.d.ts +2 -0
  7. package/dist/common/hooks/useModal.js +28 -0
  8. package/dist/common/hooks/useModal.js.map +1 -0
  9. package/dist/common/index.d.ts +2 -0
  10. package/dist/common/index.js +19 -0
  11. package/dist/common/index.js.map +1 -0
  12. package/dist/common/types/index.d.ts +5 -0
  13. package/dist/common/types/index.js +3 -0
  14. package/dist/common/types/index.js.map +1 -0
  15. package/dist/components/index.d.ts +1 -0
  16. package/dist/components/index.js +18 -0
  17. package/dist/components/index.js.map +1 -0
  18. package/dist/components/ui/Modal/index.d.ts +6 -0
  19. package/dist/components/ui/Modal/index.js +18 -0
  20. package/dist/components/ui/Modal/index.js.map +1 -0
  21. package/dist/components/ui/index.d.ts +1 -0
  22. package/dist/components/ui/index.js +18 -0
  23. package/dist/components/ui/index.js.map +1 -0
  24. package/dist/config/lexicalEditorConfig.d.ts +78 -0
  25. package/dist/config/lexicalEditorConfig.js +33 -0
  26. package/dist/config/lexicalEditorConfig.js.map +1 -0
  27. package/dist/config/lexicalEditorTheme.d.ts +68 -0
  28. package/dist/config/lexicalEditorTheme.js +71 -0
  29. package/dist/config/lexicalEditorTheme.js.map +1 -0
  30. package/dist/display/index.d.ts +6 -0
  31. package/dist/display/index.js +47 -0
  32. package/dist/display/index.js.map +1 -0
  33. package/dist/display/styled.d.ts +1 -0
  34. package/dist/display/styled.js +67 -0
  35. package/dist/display/styled.js.map +1 -0
  36. package/dist/editor/Editor.d.ts +16 -0
  37. package/dist/editor/Editor.js +95 -0
  38. package/dist/editor/Editor.js.map +1 -0
  39. package/dist/editor/Editor.stories.d.ts +13 -0
  40. package/dist/editor/Editor.stories.js +135 -0
  41. package/dist/editor/Editor.stories.js.map +1 -0
  42. package/dist/editor/commands/index.d.ts +4 -0
  43. package/dist/editor/commands/index.js +6 -0
  44. package/dist/editor/commands/index.js.map +1 -0
  45. package/dist/editor/constants/index.d.ts +2 -0
  46. package/dist/editor/constants/index.js +40 -0
  47. package/dist/editor/constants/index.js.map +1 -0
  48. package/dist/editor/context/SharedHistoryContext.d.ts +11 -0
  49. package/dist/editor/context/SharedHistoryContext.js +17 -0
  50. package/dist/editor/context/SharedHistoryContext.js.map +1 -0
  51. package/dist/editor/context/ToolbarContext.d.ts +56 -0
  52. package/dist/editor/context/ToolbarContext.js +67 -0
  53. package/dist/editor/context/ToolbarContext.js.map +1 -0
  54. package/dist/editor/context/index.d.ts +2 -0
  55. package/dist/editor/context/index.js +19 -0
  56. package/dist/editor/context/index.js.map +1 -0
  57. package/dist/editor/editorStyles.d.ts +1 -0
  58. package/dist/editor/editorStyles.js +1273 -0
  59. package/dist/editor/editorStyles.js.map +1 -0
  60. package/dist/editor/hooks/index.d.ts +1 -0
  61. package/dist/editor/hooks/index.js +18 -0
  62. package/dist/editor/hooks/index.js.map +1 -0
  63. package/dist/editor/hooks/useModal.d.ts +2 -0
  64. package/dist/editor/hooks/useModal.js +29 -0
  65. package/dist/editor/hooks/useModal.js.map +1 -0
  66. package/dist/editor/images/icons/3-columns.d.ts +1 -0
  67. package/dist/editor/images/icons/3-columns.js +9 -0
  68. package/dist/editor/images/icons/3-columns.js.map +1 -0
  69. package/dist/editor/images/icons/add-sign.d.ts +1 -0
  70. package/dist/editor/images/icons/add-sign.js +9 -0
  71. package/dist/editor/images/icons/add-sign.js.map +1 -0
  72. package/dist/editor/images/icons/arrow-clockwise.d.ts +1 -0
  73. package/dist/editor/images/icons/arrow-clockwise.js +9 -0
  74. package/dist/editor/images/icons/arrow-clockwise.js.map +1 -0
  75. package/dist/editor/images/icons/arrow-counterclockwise.d.ts +1 -0
  76. package/dist/editor/images/icons/arrow-counterclockwise.js +9 -0
  77. package/dist/editor/images/icons/arrow-counterclockwise.js.map +1 -0
  78. package/dist/editor/images/icons/bg-color.d.ts +1 -0
  79. package/dist/editor/images/icons/bg-color.js +9 -0
  80. package/dist/editor/images/icons/bg-color.js.map +1 -0
  81. package/dist/editor/images/icons/camera.d.ts +1 -0
  82. package/dist/editor/images/icons/camera.js +9 -0
  83. package/dist/editor/images/icons/camera.js.map +1 -0
  84. package/dist/editor/images/icons/card-checklist.d.ts +1 -0
  85. package/dist/editor/images/icons/card-checklist.js +9 -0
  86. package/dist/editor/images/icons/card-checklist.js.map +1 -0
  87. package/dist/editor/images/icons/caret-right-fill.d.ts +1 -0
  88. package/dist/editor/images/icons/caret-right-fill.js +9 -0
  89. package/dist/editor/images/icons/caret-right-fill.js.map +1 -0
  90. package/dist/editor/images/icons/chat-left-text.d.ts +1 -0
  91. package/dist/editor/images/icons/chat-left-text.js +9 -0
  92. package/dist/editor/images/icons/chat-left-text.js.map +1 -0
  93. package/dist/editor/images/icons/chat-right-dots.d.ts +1 -0
  94. package/dist/editor/images/icons/chat-right-dots.js +9 -0
  95. package/dist/editor/images/icons/chat-right-dots.js.map +1 -0
  96. package/dist/editor/images/icons/chat-right-text.d.ts +1 -0
  97. package/dist/editor/images/icons/chat-right-text.js +9 -0
  98. package/dist/editor/images/icons/chat-right-text.js.map +1 -0
  99. package/dist/editor/images/icons/chat-right.d.ts +1 -0
  100. package/dist/editor/images/icons/chat-right.js +9 -0
  101. package/dist/editor/images/icons/chat-right.js.map +1 -0
  102. package/dist/editor/images/icons/chat-square-quote.d.ts +1 -0
  103. package/dist/editor/images/icons/chat-square-quote.js +9 -0
  104. package/dist/editor/images/icons/chat-square-quote.js.map +1 -0
  105. package/dist/editor/images/icons/chevron-down.d.ts +1 -0
  106. package/dist/editor/images/icons/chevron-down.js +9 -0
  107. package/dist/editor/images/icons/chevron-down.js.map +1 -0
  108. package/dist/editor/images/icons/clipboard.d.ts +1 -0
  109. package/dist/editor/images/icons/clipboard.js +9 -0
  110. package/dist/editor/images/icons/clipboard.js.map +1 -0
  111. package/dist/editor/images/icons/close.d.ts +1 -0
  112. package/dist/editor/images/icons/close.js +9 -0
  113. package/dist/editor/images/icons/close.js.map +1 -0
  114. package/dist/editor/images/icons/code.d.ts +1 -0
  115. package/dist/editor/images/icons/code.js +9 -0
  116. package/dist/editor/images/icons/code.js.map +1 -0
  117. package/dist/editor/images/icons/comments.d.ts +1 -0
  118. package/dist/editor/images/icons/comments.js +9 -0
  119. package/dist/editor/images/icons/comments.js.map +1 -0
  120. package/dist/editor/images/icons/copy.d.ts +1 -0
  121. package/dist/editor/images/icons/copy.js +9 -0
  122. package/dist/editor/images/icons/copy.js.map +1 -0
  123. package/dist/editor/images/icons/diagram-2.d.ts +1 -0
  124. package/dist/editor/images/icons/diagram-2.js +9 -0
  125. package/dist/editor/images/icons/diagram-2.js.map +1 -0
  126. package/dist/editor/images/icons/download.d.ts +1 -0
  127. package/dist/editor/images/icons/download.js +9 -0
  128. package/dist/editor/images/icons/download.js.map +1 -0
  129. package/dist/editor/images/icons/draggable-block-menu.d.ts +1 -0
  130. package/dist/editor/images/icons/draggable-block-menu.js +9 -0
  131. package/dist/editor/images/icons/draggable-block-menu.js.map +1 -0
  132. package/dist/editor/images/icons/dropdown-more.d.ts +1 -0
  133. package/dist/editor/images/icons/dropdown-more.js +9 -0
  134. package/dist/editor/images/icons/dropdown-more.js.map +1 -0
  135. package/dist/editor/images/icons/figma.d.ts +1 -0
  136. package/dist/editor/images/icons/figma.js +9 -0
  137. package/dist/editor/images/icons/figma.js.map +1 -0
  138. package/dist/editor/images/icons/file-earmark-text.d.ts +1 -0
  139. package/dist/editor/images/icons/file-earmark-text.js +9 -0
  140. package/dist/editor/images/icons/file-earmark-text.js.map +1 -0
  141. package/dist/editor/images/icons/file-image.d.ts +1 -0
  142. package/dist/editor/images/icons/file-image.js +9 -0
  143. package/dist/editor/images/icons/file-image.js.map +1 -0
  144. package/dist/editor/images/icons/filetype-gif.d.ts +1 -0
  145. package/dist/editor/images/icons/filetype-gif.js +9 -0
  146. package/dist/editor/images/icons/filetype-gif.js.map +1 -0
  147. package/dist/editor/images/icons/font-color.d.ts +1 -0
  148. package/dist/editor/images/icons/font-color.js +9 -0
  149. package/dist/editor/images/icons/font-color.js.map +1 -0
  150. package/dist/editor/images/icons/font-family.d.ts +1 -0
  151. package/dist/editor/images/icons/font-family.js +9 -0
  152. package/dist/editor/images/icons/font-family.js.map +1 -0
  153. package/dist/editor/images/icons/format-clear.d.ts +1 -0
  154. package/dist/editor/images/icons/format-clear.js +9 -0
  155. package/dist/editor/images/icons/format-clear.js.map +1 -0
  156. package/dist/editor/images/icons/highlighter.d.ts +1 -0
  157. package/dist/editor/images/icons/highlighter.js +9 -0
  158. package/dist/editor/images/icons/highlighter.js.map +1 -0
  159. package/dist/editor/images/icons/horizontal-rule.d.ts +1 -0
  160. package/dist/editor/images/icons/horizontal-rule.js +9 -0
  161. package/dist/editor/images/icons/horizontal-rule.js.map +1 -0
  162. package/dist/editor/images/icons/indent.d.ts +1 -0
  163. package/dist/editor/images/icons/indent.js +9 -0
  164. package/dist/editor/images/icons/indent.js.map +1 -0
  165. package/dist/editor/images/icons/index.d.ts +88 -0
  166. package/dist/editor/images/icons/index.js +105 -0
  167. package/dist/editor/images/icons/index.js.map +1 -0
  168. package/dist/editor/images/icons/journal-text.d.ts +1 -0
  169. package/dist/editor/images/icons/journal-text.js +9 -0
  170. package/dist/editor/images/icons/journal-text.js.map +1 -0
  171. package/dist/editor/images/icons/justify.d.ts +1 -0
  172. package/dist/editor/images/icons/justify.js +9 -0
  173. package/dist/editor/images/icons/justify.js.map +1 -0
  174. package/dist/editor/images/icons/link.d.ts +1 -0
  175. package/dist/editor/images/icons/link.js +9 -0
  176. package/dist/editor/images/icons/link.js.map +1 -0
  177. package/dist/editor/images/icons/list-ol.d.ts +1 -0
  178. package/dist/editor/images/icons/list-ol.js +9 -0
  179. package/dist/editor/images/icons/list-ol.js.map +1 -0
  180. package/dist/editor/images/icons/list-ul.d.ts +1 -0
  181. package/dist/editor/images/icons/list-ul.js +9 -0
  182. package/dist/editor/images/icons/list-ul.js.map +1 -0
  183. package/dist/editor/images/icons/lock-fill.d.ts +1 -0
  184. package/dist/editor/images/icons/lock-fill.js +9 -0
  185. package/dist/editor/images/icons/lock-fill.js.map +1 -0
  186. package/dist/editor/images/icons/lock.d.ts +1 -0
  187. package/dist/editor/images/icons/lock.js +9 -0
  188. package/dist/editor/images/icons/lock.js.map +1 -0
  189. package/dist/editor/images/icons/markdown.d.ts +1 -0
  190. package/dist/editor/images/icons/markdown.js +9 -0
  191. package/dist/editor/images/icons/markdown.js.map +1 -0
  192. package/dist/editor/images/icons/mic.d.ts +1 -0
  193. package/dist/editor/images/icons/mic.js +9 -0
  194. package/dist/editor/images/icons/mic.js.map +1 -0
  195. package/dist/editor/images/icons/minus-sign.d.ts +1 -0
  196. package/dist/editor/images/icons/minus-sign.js +9 -0
  197. package/dist/editor/images/icons/minus-sign.js.map +1 -0
  198. package/dist/editor/images/icons/outdent.d.ts +1 -0
  199. package/dist/editor/images/icons/outdent.js +9 -0
  200. package/dist/editor/images/icons/outdent.js.map +1 -0
  201. package/dist/editor/images/icons/paint-bucket.d.ts +1 -0
  202. package/dist/editor/images/icons/paint-bucket.js +9 -0
  203. package/dist/editor/images/icons/paint-bucket.js.map +1 -0
  204. package/dist/editor/images/icons/palette.d.ts +1 -0
  205. package/dist/editor/images/icons/palette.js +9 -0
  206. package/dist/editor/images/icons/palette.js.map +1 -0
  207. package/dist/editor/images/icons/pencil-fill.d.ts +1 -0
  208. package/dist/editor/images/icons/pencil-fill.js +9 -0
  209. package/dist/editor/images/icons/pencil-fill.js.map +1 -0
  210. package/dist/editor/images/icons/plug-fill.d.ts +1 -0
  211. package/dist/editor/images/icons/plug-fill.js +9 -0
  212. package/dist/editor/images/icons/plug-fill.js.map +1 -0
  213. package/dist/editor/images/icons/plug.d.ts +1 -0
  214. package/dist/editor/images/icons/plug.js +9 -0
  215. package/dist/editor/images/icons/plug.js.map +1 -0
  216. package/dist/editor/images/icons/plus-slash-minus.d.ts +1 -0
  217. package/dist/editor/images/icons/plus-slash-minus.js +9 -0
  218. package/dist/editor/images/icons/plus-slash-minus.js.map +1 -0
  219. package/dist/editor/images/icons/plus.d.ts +1 -0
  220. package/dist/editor/images/icons/plus.js +9 -0
  221. package/dist/editor/images/icons/plus.js.map +1 -0
  222. package/dist/editor/images/icons/prettier-error.d.ts +1 -0
  223. package/dist/editor/images/icons/prettier-error.js +9 -0
  224. package/dist/editor/images/icons/prettier-error.js.map +1 -0
  225. package/dist/editor/images/icons/prettier.d.ts +1 -0
  226. package/dist/editor/images/icons/prettier.js +9 -0
  227. package/dist/editor/images/icons/prettier.js.map +1 -0
  228. package/dist/editor/images/icons/scissors.d.ts +1 -0
  229. package/dist/editor/images/icons/scissors.js +9 -0
  230. package/dist/editor/images/icons/scissors.js.map +1 -0
  231. package/dist/editor/images/icons/send.d.ts +1 -0
  232. package/dist/editor/images/icons/send.js +9 -0
  233. package/dist/editor/images/icons/send.js.map +1 -0
  234. package/dist/editor/images/icons/square-check.d.ts +1 -0
  235. package/dist/editor/images/icons/square-check.js +9 -0
  236. package/dist/editor/images/icons/square-check.js.map +1 -0
  237. package/dist/editor/images/icons/sticky.d.ts +1 -0
  238. package/dist/editor/images/icons/sticky.js +9 -0
  239. package/dist/editor/images/icons/sticky.js.map +1 -0
  240. package/dist/editor/images/icons/success-alt.d.ts +1 -0
  241. package/dist/editor/images/icons/success-alt.js +9 -0
  242. package/dist/editor/images/icons/success-alt.js.map +1 -0
  243. package/dist/editor/images/icons/success.d.ts +1 -0
  244. package/dist/editor/images/icons/success.js +9 -0
  245. package/dist/editor/images/icons/success.js.map +1 -0
  246. package/dist/editor/images/icons/table.d.ts +1 -0
  247. package/dist/editor/images/icons/table.js +9 -0
  248. package/dist/editor/images/icons/table.js.map +1 -0
  249. package/dist/editor/images/icons/text-center.d.ts +1 -0
  250. package/dist/editor/images/icons/text-center.js +9 -0
  251. package/dist/editor/images/icons/text-center.js.map +1 -0
  252. package/dist/editor/images/icons/text-left.d.ts +1 -0
  253. package/dist/editor/images/icons/text-left.js +9 -0
  254. package/dist/editor/images/icons/text-left.js.map +1 -0
  255. package/dist/editor/images/icons/text-paragraph.d.ts +1 -0
  256. package/dist/editor/images/icons/text-paragraph.js +9 -0
  257. package/dist/editor/images/icons/text-paragraph.js.map +1 -0
  258. package/dist/editor/images/icons/text-right.d.ts +1 -0
  259. package/dist/editor/images/icons/text-right.js +9 -0
  260. package/dist/editor/images/icons/text-right.js.map +1 -0
  261. package/dist/editor/images/icons/trash.d.ts +1 -0
  262. package/dist/editor/images/icons/trash.js +9 -0
  263. package/dist/editor/images/icons/trash.js.map +1 -0
  264. package/dist/editor/images/icons/trash3.d.ts +1 -0
  265. package/dist/editor/images/icons/trash3.js +9 -0
  266. package/dist/editor/images/icons/trash3.js.map +1 -0
  267. package/dist/editor/images/icons/type-bold.d.ts +1 -0
  268. package/dist/editor/images/icons/type-bold.js +9 -0
  269. package/dist/editor/images/icons/type-bold.js.map +1 -0
  270. package/dist/editor/images/icons/type-capitalize.d.ts +1 -0
  271. package/dist/editor/images/icons/type-capitalize.js +9 -0
  272. package/dist/editor/images/icons/type-capitalize.js.map +1 -0
  273. package/dist/editor/images/icons/type-h1.d.ts +1 -0
  274. package/dist/editor/images/icons/type-h1.js +9 -0
  275. package/dist/editor/images/icons/type-h1.js.map +1 -0
  276. package/dist/editor/images/icons/type-h2.d.ts +1 -0
  277. package/dist/editor/images/icons/type-h2.js +9 -0
  278. package/dist/editor/images/icons/type-h2.js.map +1 -0
  279. package/dist/editor/images/icons/type-h3.d.ts +1 -0
  280. package/dist/editor/images/icons/type-h3.js +9 -0
  281. package/dist/editor/images/icons/type-h3.js.map +1 -0
  282. package/dist/editor/images/icons/type-h4.d.ts +1 -0
  283. package/dist/editor/images/icons/type-h4.js +9 -0
  284. package/dist/editor/images/icons/type-h4.js.map +1 -0
  285. package/dist/editor/images/icons/type-h5.d.ts +1 -0
  286. package/dist/editor/images/icons/type-h5.js +9 -0
  287. package/dist/editor/images/icons/type-h5.js.map +1 -0
  288. package/dist/editor/images/icons/type-h6.d.ts +1 -0
  289. package/dist/editor/images/icons/type-h6.js +9 -0
  290. package/dist/editor/images/icons/type-h6.js.map +1 -0
  291. package/dist/editor/images/icons/type-italic.d.ts +1 -0
  292. package/dist/editor/images/icons/type-italic.js +9 -0
  293. package/dist/editor/images/icons/type-italic.js.map +1 -0
  294. package/dist/editor/images/icons/type-lowercase.d.ts +1 -0
  295. package/dist/editor/images/icons/type-lowercase.js +9 -0
  296. package/dist/editor/images/icons/type-lowercase.js.map +1 -0
  297. package/dist/editor/images/icons/type-strikethrough.d.ts +1 -0
  298. package/dist/editor/images/icons/type-strikethrough.js +9 -0
  299. package/dist/editor/images/icons/type-strikethrough.js.map +1 -0
  300. package/dist/editor/images/icons/type-subscript.d.ts +1 -0
  301. package/dist/editor/images/icons/type-subscript.js +9 -0
  302. package/dist/editor/images/icons/type-subscript.js.map +1 -0
  303. package/dist/editor/images/icons/type-superscript.d.ts +1 -0
  304. package/dist/editor/images/icons/type-superscript.js +9 -0
  305. package/dist/editor/images/icons/type-superscript.js.map +1 -0
  306. package/dist/editor/images/icons/type-underline.d.ts +1 -0
  307. package/dist/editor/images/icons/type-underline.js +9 -0
  308. package/dist/editor/images/icons/type-underline.js.map +1 -0
  309. package/dist/editor/images/icons/type-uppercase.d.ts +1 -0
  310. package/dist/editor/images/icons/type-uppercase.js +9 -0
  311. package/dist/editor/images/icons/type-uppercase.js.map +1 -0
  312. package/dist/editor/images/icons/upload.d.ts +1 -0
  313. package/dist/editor/images/icons/upload.js +9 -0
  314. package/dist/editor/images/icons/upload.js.map +1 -0
  315. package/dist/editor/images/icons/user.d.ts +1 -0
  316. package/dist/editor/images/icons/user.js +9 -0
  317. package/dist/editor/images/icons/user.js.map +1 -0
  318. package/dist/editor/images/icons/vertical-bottom.d.ts +1 -0
  319. package/dist/editor/images/icons/vertical-bottom.js +9 -0
  320. package/dist/editor/images/icons/vertical-bottom.js.map +1 -0
  321. package/dist/editor/images/icons/vertical-middle.d.ts +1 -0
  322. package/dist/editor/images/icons/vertical-middle.js +9 -0
  323. package/dist/editor/images/icons/vertical-middle.js.map +1 -0
  324. package/dist/editor/images/icons/vertical-top.d.ts +1 -0
  325. package/dist/editor/images/icons/vertical-top.js +9 -0
  326. package/dist/editor/images/icons/vertical-top.js.map +1 -0
  327. package/dist/editor/images/icons/x.d.ts +1 -0
  328. package/dist/editor/images/icons/x.js +9 -0
  329. package/dist/editor/images/icons/x.js.map +1 -0
  330. package/dist/editor/images/icons/youtube.d.ts +1 -0
  331. package/dist/editor/images/icons/youtube.js +9 -0
  332. package/dist/editor/images/icons/youtube.js.map +1 -0
  333. package/dist/editor/index.d.ts +1 -0
  334. package/dist/editor/index.js +6 -0
  335. package/dist/editor/index.js.map +1 -0
  336. package/dist/editor/nodes/Image/ImageComponent.d.ts +15 -0
  337. package/dist/editor/nodes/Image/ImageComponent.js +248 -0
  338. package/dist/editor/nodes/Image/ImageComponent.js.map +1 -0
  339. package/dist/editor/nodes/Image/ImageNode.d.ts +50 -0
  340. package/dist/editor/nodes/Image/ImageNode.js +128 -0
  341. package/dist/editor/nodes/Image/ImageNode.js.map +1 -0
  342. package/dist/editor/nodes/Image/imageNodeStyles.d.ts +1 -0
  343. package/dist/editor/nodes/Image/imageNodeStyles.js +41 -0
  344. package/dist/editor/nodes/Image/imageNodeStyles.js.map +1 -0
  345. package/dist/editor/nodes/Image/index.d.ts +3 -0
  346. package/dist/editor/nodes/Image/index.js +10 -0
  347. package/dist/editor/nodes/Image/index.js.map +1 -0
  348. package/dist/editor/nodes/InlineImage/InlineImageComponent.d.ts +18 -0
  349. package/dist/editor/nodes/InlineImage/InlineImageComponent.js +160 -0
  350. package/dist/editor/nodes/InlineImage/InlineImageComponent.js.map +1 -0
  351. package/dist/editor/nodes/InlineImage/InlineImageNode.d.ts +59 -0
  352. package/dist/editor/nodes/InlineImage/InlineImageNode.js +149 -0
  353. package/dist/editor/nodes/InlineImage/InlineImageNode.js.map +1 -0
  354. package/dist/editor/nodes/InlineImage/index.d.ts +3 -0
  355. package/dist/editor/nodes/InlineImage/index.js +10 -0
  356. package/dist/editor/nodes/InlineImage/index.js.map +1 -0
  357. package/dist/editor/nodes/InlineImage/inlineImageNodeStyles.d.ts +1 -0
  358. package/dist/editor/nodes/InlineImage/inlineImageNodeStyles.js +90 -0
  359. package/dist/editor/nodes/InlineImage/inlineImageNodeStyles.js.map +1 -0
  360. package/dist/editor/nodes/PlaygroundNodes.d.ts +2 -0
  361. package/dist/editor/nodes/PlaygroundNodes.js +32 -0
  362. package/dist/editor/nodes/PlaygroundNodes.js.map +1 -0
  363. package/dist/editor/nodes/Video/VideoComponent.d.ts +9 -0
  364. package/dist/editor/nodes/Video/VideoComponent.js +15 -0
  365. package/dist/editor/nodes/Video/VideoComponent.js.map +1 -0
  366. package/dist/editor/nodes/Video/VideoNode.d.ts +34 -0
  367. package/dist/editor/nodes/Video/VideoNode.js +129 -0
  368. package/dist/editor/nodes/Video/VideoNode.js.map +1 -0
  369. package/dist/editor/nodes/Video/index.d.ts +3 -0
  370. package/dist/editor/nodes/Video/index.js +10 -0
  371. package/dist/editor/nodes/Video/index.js.map +1 -0
  372. package/dist/editor/nodes/Video/videoNodeStyles.d.ts +1 -0
  373. package/dist/editor/nodes/Video/videoNodeStyles.js +44 -0
  374. package/dist/editor/nodes/Video/videoNodeStyles.js.map +1 -0
  375. package/dist/editor/nodes/index.d.ts +4 -0
  376. package/dist/editor/nodes/index.js +21 -0
  377. package/dist/editor/nodes/index.js.map +1 -0
  378. package/dist/editor/plugins/CodeActionMenuPlugin/codeActionMenuPluginStyles.d.ts +1 -0
  379. package/dist/editor/plugins/CodeActionMenuPlugin/codeActionMenuPluginStyles.js +68 -0
  380. package/dist/editor/plugins/CodeActionMenuPlugin/codeActionMenuPluginStyles.js.map +1 -0
  381. package/dist/editor/plugins/CodeActionMenuPlugin/components/CopyButton/index.d.ts +7 -0
  382. package/dist/editor/plugins/CodeActionMenuPlugin/components/CopyButton/index.js +48 -0
  383. package/dist/editor/plugins/CodeActionMenuPlugin/components/CopyButton/index.js.map +1 -0
  384. package/dist/editor/plugins/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +9 -0
  385. package/dist/editor/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js +136 -0
  386. package/dist/editor/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js.map +1 -0
  387. package/dist/editor/plugins/CodeActionMenuPlugin/components/index.d.ts +2 -0
  388. package/dist/editor/plugins/CodeActionMenuPlugin/components/index.js +19 -0
  389. package/dist/editor/plugins/CodeActionMenuPlugin/components/index.js.map +1 -0
  390. package/dist/editor/plugins/CodeActionMenuPlugin/index.d.ts +12 -0
  391. package/dist/editor/plugins/CodeActionMenuPlugin/index.js +118 -0
  392. package/dist/editor/plugins/CodeActionMenuPlugin/index.js.map +1 -0
  393. package/dist/editor/plugins/CodeActionMenuPlugin/utils.d.ts +1 -0
  394. package/dist/editor/plugins/CodeActionMenuPlugin/utils.js +15 -0
  395. package/dist/editor/plugins/CodeActionMenuPlugin/utils.js.map +1 -0
  396. package/dist/editor/plugins/CodeHighlightPlugin/index.d.ts +2 -0
  397. package/dist/editor/plugins/CodeHighlightPlugin/index.js +15 -0
  398. package/dist/editor/plugins/CodeHighlightPlugin/index.js.map +1 -0
  399. package/dist/editor/plugins/ComponentPickerPlugin/index.d.ts +9 -0
  400. package/dist/editor/plugins/ComponentPickerPlugin/index.js +217 -0
  401. package/dist/editor/plugins/ComponentPickerPlugin/index.js.map +1 -0
  402. package/dist/editor/plugins/ContextMenuPlugin/index.d.ts +18 -0
  403. package/dist/editor/plugins/ContextMenuPlugin/index.js +190 -0
  404. package/dist/editor/plugins/ContextMenuPlugin/index.js.map +1 -0
  405. package/dist/editor/plugins/FloatingLinkEditorPlugin/floatLinkEditorPluginStyles.d.ts +1 -0
  406. package/dist/editor/plugins/FloatingLinkEditorPlugin/floatLinkEditorPluginStyles.js +48 -0
  407. package/dist/editor/plugins/FloatingLinkEditorPlugin/floatLinkEditorPluginStyles.js.map +1 -0
  408. package/dist/editor/plugins/FloatingLinkEditorPlugin/index.d.ts +14 -0
  409. package/dist/editor/plugins/FloatingLinkEditorPlugin/index.js +275 -0
  410. package/dist/editor/plugins/FloatingLinkEditorPlugin/index.js.map +1 -0
  411. package/dist/editor/plugins/FloatingTextFormatToolbarPlugin/floatTextFormatToolbarPluginStyles.d.ts +1 -0
  412. package/dist/editor/plugins/FloatingTextFormatToolbarPlugin/floatTextFormatToolbarPluginStyles.js +141 -0
  413. package/dist/editor/plugins/FloatingTextFormatToolbarPlugin/floatTextFormatToolbarPluginStyles.js.map +1 -0
  414. package/dist/editor/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +15 -0
  415. package/dist/editor/plugins/FloatingTextFormatToolbarPlugin/index.js +214 -0
  416. package/dist/editor/plugins/FloatingTextFormatToolbarPlugin/index.js.map +1 -0
  417. package/dist/editor/plugins/ImagesPlugin/index.d.ts +28 -0
  418. package/dist/editor/plugins/ImagesPlugin/index.js +175 -0
  419. package/dist/editor/plugins/ImagesPlugin/index.js.map +1 -0
  420. package/dist/editor/plugins/LinkPlugin/index.d.ts +9 -0
  421. package/dist/editor/plugins/LinkPlugin/index.js +14 -0
  422. package/dist/editor/plugins/LinkPlugin/index.js.map +1 -0
  423. package/dist/editor/plugins/MarkdownShortcutPlugin/index.d.ts +9 -0
  424. package/dist/editor/plugins/MarkdownShortcutPlugin/index.js +11 -0
  425. package/dist/editor/plugins/MarkdownShortcutPlugin/index.js.map +1 -0
  426. package/dist/editor/plugins/MarkdownTransformers/index.d.ts +5 -0
  427. package/dist/editor/plugins/MarkdownTransformers/index.js +181 -0
  428. package/dist/editor/plugins/MarkdownTransformers/index.js.map +1 -0
  429. package/dist/editor/plugins/MaxLengthPlugin/index.d.ts +10 -0
  430. package/dist/editor/plugins/MaxLengthPlugin/index.js +48 -0
  431. package/dist/editor/plugins/MaxLengthPlugin/index.js.map +1 -0
  432. package/dist/editor/plugins/ShortcutsPlugin/index.d.ts +13 -0
  433. package/dist/editor/plugins/ShortcutsPlugin/index.js +102 -0
  434. package/dist/editor/plugins/ShortcutsPlugin/index.js.map +1 -0
  435. package/dist/editor/plugins/ShortcutsPlugin/shortcuts.d.ts +56 -0
  436. package/dist/editor/plugins/ShortcutsPlugin/shortcuts.js +145 -0
  437. package/dist/editor/plugins/ShortcutsPlugin/shortcuts.js.map +1 -0
  438. package/dist/editor/plugins/TabFocusPlugin/index.d.ts +8 -0
  439. package/dist/editor/plugins/TabFocusPlugin/index.js +46 -0
  440. package/dist/editor/plugins/TabFocusPlugin/index.js.map +1 -0
  441. package/dist/editor/plugins/TableActionMenuPlugin/index.d.ts +12 -0
  442. package/dist/editor/plugins/TableActionMenuPlugin/index.js +371 -0
  443. package/dist/editor/plugins/TableActionMenuPlugin/index.js.map +1 -0
  444. package/dist/editor/plugins/TableCellResizer/index.d.ts +3 -0
  445. package/dist/editor/plugins/TableCellResizer/index.js +301 -0
  446. package/dist/editor/plugins/TableCellResizer/index.js.map +1 -0
  447. package/dist/editor/plugins/TableCellResizer/tableCellResizerPluginStyles.d.ts +1 -0
  448. package/dist/editor/plugins/TableCellResizer/tableCellResizerPluginStyles.js +18 -0
  449. package/dist/editor/plugins/TableCellResizer/tableCellResizerPluginStyles.js.map +1 -0
  450. package/dist/editor/plugins/TableHoverActionsPlugin/index.d.ts +11 -0
  451. package/dist/editor/plugins/TableHoverActionsPlugin/index.js +193 -0
  452. package/dist/editor/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  453. package/dist/editor/plugins/TablePlugin.d.ts +38 -0
  454. package/dist/editor/plugins/TablePlugin.js +77 -0
  455. package/dist/editor/plugins/TablePlugin.js.map +1 -0
  456. package/dist/editor/plugins/ToolbarPlugin/index.d.ts +19 -0
  457. package/dist/editor/plugins/ToolbarPlugin/index.js +199 -0
  458. package/dist/editor/plugins/ToolbarPlugin/index.js.map +1 -0
  459. package/dist/editor/plugins/ToolbarPlugin/utils.d.ts +22 -0
  460. package/dist/editor/plugins/ToolbarPlugin/utils.js +224 -0
  461. package/dist/editor/plugins/ToolbarPlugin/utils.js.map +1 -0
  462. package/dist/editor/plugins/VideoPlugin/index.d.ts +7 -0
  463. package/dist/editor/plugins/VideoPlugin/index.js +61 -0
  464. package/dist/editor/plugins/VideoPlugin/index.js.map +1 -0
  465. package/dist/editor/plugins/index.d.ts +19 -0
  466. package/dist/editor/plugins/index.js +36 -0
  467. package/dist/editor/plugins/index.js.map +1 -0
  468. package/dist/editor/themes/index.d.ts +1 -0
  469. package/dist/editor/themes/index.js +6 -0
  470. package/dist/editor/themes/index.js.map +1 -0
  471. package/dist/editor/themes/playgroundEditorTheme.d.ts +2 -0
  472. package/dist/editor/themes/playgroundEditorTheme.js +116 -0
  473. package/dist/editor/themes/playgroundEditorTheme.js.map +1 -0
  474. package/dist/editor/themes/playgroundEditorThemeStyles.d.ts +1 -0
  475. package/dist/editor/themes/playgroundEditorThemeStyles.js +702 -0
  476. package/dist/editor/themes/playgroundEditorThemeStyles.js.map +1 -0
  477. package/dist/editor/types/index.d.ts +19 -0
  478. package/dist/editor/types/index.js +3 -0
  479. package/dist/editor/types/index.js.map +1 -0
  480. package/dist/editor/ui/BlockFormatDropdown/index.d.ts +18 -0
  481. package/dist/editor/ui/BlockFormatDropdown/index.js +73 -0
  482. package/dist/editor/ui/BlockFormatDropdown/index.js.map +1 -0
  483. package/dist/editor/ui/BoldButton/index.d.ts +7 -0
  484. package/dist/editor/ui/BoldButton/index.js +14 -0
  485. package/dist/editor/ui/BoldButton/index.js.map +1 -0
  486. package/dist/editor/ui/Button.d.ts +12 -0
  487. package/dist/editor/ui/Button.js +38 -0
  488. package/dist/editor/ui/Button.js.map +1 -0
  489. package/dist/editor/ui/CenterAlignButton/index.d.ts +7 -0
  490. package/dist/editor/ui/CenterAlignButton/index.js +14 -0
  491. package/dist/editor/ui/CenterAlignButton/index.js.map +1 -0
  492. package/dist/editor/ui/ClearEditorButton/index.d.ts +7 -0
  493. package/dist/editor/ui/ClearEditorButton/index.js +10 -0
  494. package/dist/editor/ui/ClearEditorButton/index.js.map +1 -0
  495. package/dist/editor/ui/ClearFormattingButton/index.d.ts +7 -0
  496. package/dist/editor/ui/ClearFormattingButton/index.js +10 -0
  497. package/dist/editor/ui/ClearFormattingButton/index.js.map +1 -0
  498. package/dist/editor/ui/CodeButton/index.d.ts +7 -0
  499. package/dist/editor/ui/CodeButton/index.js +14 -0
  500. package/dist/editor/ui/CodeButton/index.js.map +1 -0
  501. package/dist/editor/ui/CodeLanguageDropdown/index.d.ts +10 -0
  502. package/dist/editor/ui/CodeLanguageDropdown/index.js +26 -0
  503. package/dist/editor/ui/CodeLanguageDropdown/index.js.map +1 -0
  504. package/dist/editor/ui/ContentEditable.d.ts +9 -0
  505. package/dist/editor/ui/ContentEditable.js +63 -0
  506. package/dist/editor/ui/ContentEditable.js.map +1 -0
  507. package/dist/editor/ui/Dialog.d.ts +10 -0
  508. package/dist/editor/ui/Dialog.js +33 -0
  509. package/dist/editor/ui/Dialog.js.map +1 -0
  510. package/dist/editor/ui/Divider/index.d.ts +2 -0
  511. package/dist/editor/ui/Divider/index.js +9 -0
  512. package/dist/editor/ui/Divider/index.js.map +1 -0
  513. package/dist/editor/ui/DropDown.d.ts +16 -0
  514. package/dist/editor/ui/DropDown.js +141 -0
  515. package/dist/editor/ui/DropDown.js.map +1 -0
  516. package/dist/editor/ui/FlashMessage.d.ts +6 -0
  517. package/dist/editor/ui/FlashMessage.js +32 -0
  518. package/dist/editor/ui/FlashMessage.js.map +1 -0
  519. package/dist/editor/ui/HorizontalRuleButton/index.d.ts +3 -0
  520. package/dist/editor/ui/HorizontalRuleButton/index.js +13 -0
  521. package/dist/editor/ui/HorizontalRuleButton/index.js.map +1 -0
  522. package/dist/editor/ui/ImageButton/index.d.ts +8 -0
  523. package/dist/editor/ui/ImageButton/index.js +13 -0
  524. package/dist/editor/ui/ImageButton/index.js.map +1 -0
  525. package/dist/editor/ui/ImageResizer.d.ts +17 -0
  526. package/dist/editor/ui/ImageResizer.js +174 -0
  527. package/dist/editor/ui/ImageResizer.js.map +1 -0
  528. package/dist/editor/ui/ItalicButton/index.d.ts +7 -0
  529. package/dist/editor/ui/ItalicButton/index.js +14 -0
  530. package/dist/editor/ui/ItalicButton/index.js.map +1 -0
  531. package/dist/editor/ui/LeftAlignButton/index.d.ts +7 -0
  532. package/dist/editor/ui/LeftAlignButton/index.js +14 -0
  533. package/dist/editor/ui/LeftAlignButton/index.js.map +1 -0
  534. package/dist/editor/ui/LinkButton/index.d.ts +8 -0
  535. package/dist/editor/ui/LinkButton/index.js +11 -0
  536. package/dist/editor/ui/LinkButton/index.js.map +1 -0
  537. package/dist/editor/ui/Modal.d.ts +9 -0
  538. package/dist/editor/ui/Modal.js +110 -0
  539. package/dist/editor/ui/Modal.js.map +1 -0
  540. package/dist/editor/ui/RedoButton/index.d.ts +3 -0
  541. package/dist/editor/ui/RedoButton/index.js +14 -0
  542. package/dist/editor/ui/RedoButton/index.js.map +1 -0
  543. package/dist/editor/ui/RightAlignButton/index.d.ts +7 -0
  544. package/dist/editor/ui/RightAlignButton/index.js +14 -0
  545. package/dist/editor/ui/RightAlignButton/index.js.map +1 -0
  546. package/dist/editor/ui/Select.d.ts +8 -0
  547. package/dist/editor/ui/Select.js +52 -0
  548. package/dist/editor/ui/Select.js.map +1 -0
  549. package/dist/editor/ui/StrikethroughButton/index.d.ts +7 -0
  550. package/dist/editor/ui/StrikethroughButton/index.js +14 -0
  551. package/dist/editor/ui/StrikethroughButton/index.js.map +1 -0
  552. package/dist/editor/ui/TableButton/index.d.ts +8 -0
  553. package/dist/editor/ui/TableButton/index.js +13 -0
  554. package/dist/editor/ui/TableButton/index.js.map +1 -0
  555. package/dist/editor/ui/TextInput.d.ts +13 -0
  556. package/dist/editor/ui/TextInput.js +36 -0
  557. package/dist/editor/ui/TextInput.js.map +1 -0
  558. package/dist/editor/ui/UnderlineButton/index.d.ts +7 -0
  559. package/dist/editor/ui/UnderlineButton/index.js +14 -0
  560. package/dist/editor/ui/UnderlineButton/index.js.map +1 -0
  561. package/dist/editor/ui/UndoButton/index.d.ts +3 -0
  562. package/dist/editor/ui/UndoButton/index.js +14 -0
  563. package/dist/editor/ui/UndoButton/index.js.map +1 -0
  564. package/dist/editor/ui/VideoButton/index.d.ts +8 -0
  565. package/dist/editor/ui/VideoButton/index.js +13 -0
  566. package/dist/editor/ui/VideoButton/index.js.map +1 -0
  567. package/dist/editor/ui/index.d.ts +30 -0
  568. package/dist/editor/ui/index.js +74 -0
  569. package/dist/editor/ui/index.js.map +1 -0
  570. package/dist/editor/utils/dropDownActiveClass.d.ts +1 -0
  571. package/dist/editor/utils/dropDownActiveClass.js +12 -0
  572. package/dist/editor/utils/dropDownActiveClass.js.map +1 -0
  573. package/dist/editor/utils/getDOMRangeRect.d.ts +1 -0
  574. package/dist/editor/utils/getDOMRangeRect.js +19 -0
  575. package/dist/editor/utils/getDOMRangeRect.js.map +1 -0
  576. package/dist/editor/utils/getSelectedNode.d.ts +2 -0
  577. package/dist/editor/utils/getSelectedNode.js +21 -0
  578. package/dist/editor/utils/getSelectedNode.js.map +1 -0
  579. package/dist/editor/utils/getThemeSelector.d.ts +2 -0
  580. package/dist/editor/utils/getThemeSelector.js +15 -0
  581. package/dist/editor/utils/getThemeSelector.js.map +1 -0
  582. package/dist/editor/utils/index.d.ts +9 -0
  583. package/dist/editor/utils/index.js +26 -0
  584. package/dist/editor/utils/index.js.map +1 -0
  585. package/dist/editor/utils/joinClasses.d.ts +1 -0
  586. package/dist/editor/utils/joinClasses.js +8 -0
  587. package/dist/editor/utils/joinClasses.js.map +1 -0
  588. package/dist/editor/utils/parseVideoUrl.d.ts +15 -0
  589. package/dist/editor/utils/parseVideoUrl.js +115 -0
  590. package/dist/editor/utils/parseVideoUrl.js.map +1 -0
  591. package/dist/editor/utils/setFloatingElemPosition.d.ts +1 -0
  592. package/dist/editor/utils/setFloatingElemPosition.js +47 -0
  593. package/dist/editor/utils/setFloatingElemPosition.js.map +1 -0
  594. package/dist/editor/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -0
  595. package/dist/editor/utils/setFloatingElemPositionForLinkEditor.js +29 -0
  596. package/dist/editor/utils/setFloatingElemPositionForLinkEditor.js.map +1 -0
  597. package/dist/editor/utils/url.d.ts +2 -0
  598. package/dist/editor/utils/url.js +25 -0
  599. package/dist/editor/utils/url.js.map +1 -0
  600. package/dist/index.d.ts +3 -0
  601. package/dist/index.js +37 -0
  602. package/dist/index.js.map +1 -0
  603. package/eslint.config.mjs +27 -0
  604. package/package.json +110 -0
  605. package/tsconfig.eslint.json +10 -0
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.floatTextFormatToolbarPluginStyles = void 0;
4
+ const material_1 = require("@mui/material");
5
+ exports.floatTextFormatToolbarPluginStyles = (0, material_1.css) `
6
+ .floating-text-format-popup {
7
+ display: flex;
8
+ align-items: center;
9
+ background: #fff;
10
+ padding: 4px;
11
+ vertical-align: middle;
12
+ position: absolute;
13
+ top: 0;
14
+ left: 0;
15
+ z-index: 10;
16
+ opacity: 0;
17
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
18
+ border-radius: 8px;
19
+ transition: opacity 0.5s;
20
+ height: 35px;
21
+ will-change: transform;
22
+ }
23
+
24
+ .floating-text-format-popup button.popup-item {
25
+ border: 0;
26
+ display: flex;
27
+ background: none;
28
+ border-radius: 10px;
29
+ padding: 8px;
30
+ cursor: pointer;
31
+ vertical-align: middle;
32
+ }
33
+
34
+ .floating-text-format-popup button.popup-item:disabled {
35
+ cursor: not-allowed;
36
+ }
37
+
38
+ .floating-text-format-popup button.popup-item.spaced {
39
+ margin-right: 2px;
40
+ }
41
+
42
+ .floating-text-format-popup button.popup-item i.format {
43
+ background-size: contain;
44
+ height: 18px;
45
+ width: 18px;
46
+ margin-top: 2px;
47
+ vertical-align: -0.25em;
48
+ display: flex;
49
+ opacity: 0.6;
50
+ }
51
+
52
+ .floating-text-format-popup button.popup-item:disabled i.format {
53
+ opacity: 0.2;
54
+ }
55
+
56
+ .floating-text-format-popup button.popup-item.active {
57
+ background-color: rgba(223, 232, 250, 0.3);
58
+ }
59
+
60
+ .floating-text-format-popup button.popup-item.active i {
61
+ opacity: 1;
62
+ }
63
+
64
+ .floating-text-format-popup .popup-item:hover:not([disabled]) {
65
+ background-color: #eee;
66
+ }
67
+
68
+ .floating-text-format-popup select.popup-item {
69
+ border: 0;
70
+ display: flex;
71
+ background: none;
72
+ border-radius: 10px;
73
+ padding: 8px;
74
+ vertical-align: middle;
75
+ -webkit-appearance: none;
76
+ -moz-appearance: none;
77
+ width: 70px;
78
+ font-size: 14px;
79
+ color: #777;
80
+ text-overflow: ellipsis;
81
+ }
82
+
83
+ .floating-text-format-popup select.code-language {
84
+ text-transform: capitalize;
85
+ width: 130px;
86
+ }
87
+
88
+ .floating-text-format-popup .popup-item .text {
89
+ display: flex;
90
+ line-height: 20px;
91
+ vertical-align: middle;
92
+ font-size: 14px;
93
+ color: #777;
94
+ text-overflow: ellipsis;
95
+ width: 70px;
96
+ overflow: hidden;
97
+ height: 20px;
98
+ text-align: left;
99
+ }
100
+
101
+ .floating-text-format-popup .popup-item .icon {
102
+ display: flex;
103
+ width: 20px;
104
+ height: 20px;
105
+ user-select: none;
106
+ margin-right: 8px;
107
+ line-height: 16px;
108
+ background-size: contain;
109
+ }
110
+
111
+ .floating-text-format-popup i.chevron-down {
112
+ margin-top: 3px;
113
+ width: 16px;
114
+ height: 16px;
115
+ display: flex;
116
+ user-select: none;
117
+ }
118
+
119
+ .floating-text-format-popup i.chevron-down.inside {
120
+ width: 16px;
121
+ height: 16px;
122
+ display: flex;
123
+ margin-left: -25px;
124
+ margin-top: 11px;
125
+ margin-right: 10px;
126
+ pointer-events: none;
127
+ }
128
+
129
+ .floating-text-format-popup .divider {
130
+ width: 1px;
131
+ background-color: #eee;
132
+ margin: 0 4px;
133
+ }
134
+
135
+ @media (max-width: 1024px) {
136
+ .floating-text-format-popup button.insert-comment {
137
+ display: none;
138
+ }
139
+ }
140
+ `;
141
+ //# sourceMappingURL=floatTextFormatToolbarPluginStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"floatTextFormatToolbarPluginStyles.js","sourceRoot":"","sources":["../../../../src/editor/plugins/FloatingTextFormatToolbarPlugin/floatTextFormatToolbarPluginStyles.ts"],"names":[],"mappings":";;;AAAA,4CAAoC;AAEvB,QAAA,kCAAkC,GAAG,IAAA,cAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuIpD,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import { Dispatch, JSX } from "react";
9
+ import { TToolbarTextFormatControl } from "../../types";
10
+ export declare const FloatingTextFormatToolbarPlugin: ({ anchorElem, setIsLinkEditMode, controls, }: {
11
+ anchorElem?: HTMLElement;
12
+ setIsLinkEditMode: Dispatch<boolean>;
13
+ controls?: Array<TToolbarTextFormatControl>;
14
+ }) => JSX.Element | null;
15
+ export { floatTextFormatToolbarPluginStyles } from "./floatTextFormatToolbarPluginStyles";
@@ -0,0 +1,214 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.floatTextFormatToolbarPluginStyles = exports.FloatingTextFormatToolbarPlugin = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ /**
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ *
11
+ */
12
+ const react_1 = require("react");
13
+ const code_1 = require("@lexical/code");
14
+ const link_1 = require("@lexical/link");
15
+ const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
16
+ const utils_1 = require("@lexical/utils");
17
+ const lexical_1 = require("lexical");
18
+ const react_dom_1 = require("react-dom");
19
+ const utils_2 = require("../../utils");
20
+ const ui_1 = require("../../ui");
21
+ const constants_1 = require("../../constants");
22
+ function TextFormatFloatingToolbar({ editor, anchorElem, isLink, isBold, isItalic, isUnderline, isCode, isStrikethrough, isLeftAlign, isCenterAlign, isRightAlign, setIsLinkEditMode, controls = constants_1.toolbarDefaultControls.textFormat, }) {
23
+ const popupCharStylesEditorRef = (0, react_1.useRef)(null);
24
+ const insertLink = (0, react_1.useCallback)(() => {
25
+ if (!isLink) {
26
+ setIsLinkEditMode(true);
27
+ editor.dispatchCommand(link_1.TOGGLE_LINK_COMMAND, "https://");
28
+ }
29
+ else {
30
+ setIsLinkEditMode(false);
31
+ editor.dispatchCommand(link_1.TOGGLE_LINK_COMMAND, null);
32
+ }
33
+ }, [editor, isLink, setIsLinkEditMode]);
34
+ function mouseMoveListener(e) {
35
+ if ((popupCharStylesEditorRef === null || popupCharStylesEditorRef === void 0 ? void 0 : popupCharStylesEditorRef.current) && (e.buttons === 1 || e.buttons === 3)) {
36
+ if (popupCharStylesEditorRef.current.style.pointerEvents !== "none") {
37
+ const x = e.clientX;
38
+ const y = e.clientY;
39
+ const elementUnderMouse = document.elementFromPoint(x, y);
40
+ if (!popupCharStylesEditorRef.current.contains(elementUnderMouse)) {
41
+ // Mouse is not over the target element => not a normal click, but probably a drag
42
+ popupCharStylesEditorRef.current.style.pointerEvents = "none";
43
+ }
44
+ }
45
+ }
46
+ }
47
+ function mouseUpListener(_e) {
48
+ if (popupCharStylesEditorRef === null || popupCharStylesEditorRef === void 0 ? void 0 : popupCharStylesEditorRef.current) {
49
+ if (popupCharStylesEditorRef.current.style.pointerEvents !== "auto") {
50
+ popupCharStylesEditorRef.current.style.pointerEvents = "auto";
51
+ }
52
+ }
53
+ }
54
+ (0, react_1.useEffect)(() => {
55
+ if (popupCharStylesEditorRef === null || popupCharStylesEditorRef === void 0 ? void 0 : popupCharStylesEditorRef.current) {
56
+ document.addEventListener("mousemove", mouseMoveListener);
57
+ document.addEventListener("mouseup", mouseUpListener);
58
+ return () => {
59
+ document.removeEventListener("mousemove", mouseMoveListener);
60
+ document.removeEventListener("mouseup", mouseUpListener);
61
+ };
62
+ }
63
+ return;
64
+ }, [popupCharStylesEditorRef]);
65
+ const $updateTextFormatFloatingToolbar = (0, react_1.useCallback)(() => {
66
+ const selection = (0, lexical_1.$getSelection)();
67
+ const popupCharStylesEditorElem = popupCharStylesEditorRef.current;
68
+ const nativeSelection = (0, lexical_1.getDOMSelection)(editor._window);
69
+ if (popupCharStylesEditorElem === null) {
70
+ return;
71
+ }
72
+ const rootElement = editor.getRootElement();
73
+ if (selection !== null &&
74
+ nativeSelection !== null &&
75
+ !nativeSelection.isCollapsed &&
76
+ !!rootElement &&
77
+ rootElement.contains(nativeSelection.anchorNode)) {
78
+ const rangeRect = (0, utils_2.getDOMRangeRect)(nativeSelection, rootElement);
79
+ (0, utils_2.setFloatingElemPosition)(rangeRect, popupCharStylesEditorElem, anchorElem, isLink);
80
+ }
81
+ }, [editor, anchorElem, isLink]);
82
+ (0, react_1.useEffect)(() => {
83
+ const scrollerElem = anchorElem.parentElement;
84
+ const update = () => {
85
+ editor.getEditorState().read(() => {
86
+ $updateTextFormatFloatingToolbar();
87
+ });
88
+ };
89
+ window.addEventListener("resize", update);
90
+ if (scrollerElem) {
91
+ scrollerElem.addEventListener("scroll", update);
92
+ }
93
+ return () => {
94
+ window.removeEventListener("resize", update);
95
+ if (scrollerElem) {
96
+ scrollerElem.removeEventListener("scroll", update);
97
+ }
98
+ };
99
+ }, [editor, $updateTextFormatFloatingToolbar, anchorElem]);
100
+ (0, react_1.useEffect)(() => {
101
+ editor.getEditorState().read(() => {
102
+ $updateTextFormatFloatingToolbar();
103
+ });
104
+ return (0, utils_1.mergeRegister)(editor.registerUpdateListener(({ editorState }) => {
105
+ editorState.read(() => {
106
+ $updateTextFormatFloatingToolbar();
107
+ });
108
+ }), editor.registerCommand(lexical_1.SELECTION_CHANGE_COMMAND, () => {
109
+ $updateTextFormatFloatingToolbar();
110
+ return false;
111
+ }, lexical_1.COMMAND_PRIORITY_LOW));
112
+ }, [editor, $updateTextFormatFloatingToolbar]);
113
+ const controlsMap = {
114
+ bold: (0, jsx_runtime_1.jsx)(ui_1.BoldButton, { activeEditor: editor, isBold: isBold }),
115
+ italic: (0, jsx_runtime_1.jsx)(ui_1.ItalicButton, { activeEditor: editor, isItalic: isItalic }),
116
+ underline: (0, jsx_runtime_1.jsx)(ui_1.UnderlineButton, { activeEditor: editor, isUnderline: isUnderline }),
117
+ strikethrough: (0, jsx_runtime_1.jsx)(ui_1.StrikethroughButton, { activeEditor: editor, isStrikethrough: isStrikethrough }),
118
+ code: (0, jsx_runtime_1.jsx)(ui_1.CodeButton, { activeEditor: editor, isCode: isCode }),
119
+ link: (0, jsx_runtime_1.jsx)(ui_1.LinkButton, { insertLink: insertLink, isLink: isLink }),
120
+ leftAlign: (0, jsx_runtime_1.jsx)(ui_1.LeftAlignButton, { activeEditor: editor, isLeftAlign: isLeftAlign }),
121
+ centerAlign: (0, jsx_runtime_1.jsx)(ui_1.CenterAlignButton, { activeEditor: editor, isCenterAlign: isCenterAlign }),
122
+ rightAlign: (0, jsx_runtime_1.jsx)(ui_1.RightAlignButton, { activeEditor: editor, isRightAlign: isRightAlign }),
123
+ };
124
+ return ((0, jsx_runtime_1.jsx)("div", { ref: popupCharStylesEditorRef, className: "floating-text-format-popup", children: editor.isEditable() && !!(controls === null || controls === void 0 ? void 0 : controls.length) && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: controls.map(c => controlsMap[c]) }) }));
125
+ }
126
+ function useFloatingTextFormatToolbar(editor, anchorElem, setIsLinkEditMode, controls) {
127
+ const [isText, setIsText] = (0, react_1.useState)(false);
128
+ const [isLink, setIsLink] = (0, react_1.useState)(false);
129
+ const [isBold, setIsBold] = (0, react_1.useState)(false);
130
+ const [isItalic, setIsItalic] = (0, react_1.useState)(false);
131
+ const [isUnderline, setIsUnderline] = (0, react_1.useState)(false);
132
+ const [isStrikethrough, setIsStrikethrough] = (0, react_1.useState)(false);
133
+ const [isCode, setIsCode] = (0, react_1.useState)(false);
134
+ const [isLeftAlign, setIsLeftAlign] = (0, react_1.useState)(false);
135
+ const [isCenterAlign, setIsCenterAlign] = (0, react_1.useState)(false);
136
+ const [isRightAlign, setIsRightAlign] = (0, react_1.useState)(false);
137
+ const updatePopup = (0, react_1.useCallback)(() => {
138
+ editor.getEditorState().read(() => {
139
+ // Should not to pop up the floating toolbar when using IME input
140
+ if (editor.isComposing()) {
141
+ return;
142
+ }
143
+ const selection = (0, lexical_1.$getSelection)();
144
+ const nativeSelection = (0, lexical_1.getDOMSelection)(editor._window);
145
+ const rootElement = editor.getRootElement();
146
+ if (nativeSelection !== null &&
147
+ (!(0, lexical_1.$isRangeSelection)(selection) || !(rootElement === null || rootElement === void 0 ? void 0 : rootElement.contains(nativeSelection.anchorNode)))) {
148
+ setIsText(false);
149
+ return;
150
+ }
151
+ if (!(0, lexical_1.$isRangeSelection)(selection)) {
152
+ return;
153
+ }
154
+ const node = (0, utils_2.getSelectedNode)(selection);
155
+ const element = node.getTopLevelElementOrThrow();
156
+ const align = element.getFormatType();
157
+ // Update text format
158
+ setIsBold(selection.hasFormat("bold"));
159
+ setIsItalic(selection.hasFormat("italic"));
160
+ setIsUnderline(selection.hasFormat("underline"));
161
+ setIsStrikethrough(selection.hasFormat("strikethrough"));
162
+ setIsCode(selection.hasFormat("code"));
163
+ setIsLeftAlign(align === "left");
164
+ setIsCenterAlign(align === "center");
165
+ setIsRightAlign(align === "right");
166
+ // Update links
167
+ const parent = node.getParent();
168
+ if ((0, link_1.$isLinkNode)(parent) || (0, link_1.$isLinkNode)(node)) {
169
+ setIsLink(true);
170
+ }
171
+ else {
172
+ setIsLink(false);
173
+ }
174
+ if (!(0, code_1.$isCodeHighlightNode)(selection.anchor.getNode()) && selection.getTextContent() !== "") {
175
+ setIsText((0, lexical_1.$isTextNode)(node) || (0, lexical_1.$isParagraphNode)(node));
176
+ }
177
+ else {
178
+ setIsText(false);
179
+ }
180
+ const rawTextContent = selection.getTextContent().replace(/\n/g, "");
181
+ if (!selection.isCollapsed() && rawTextContent === "") {
182
+ setIsText(false);
183
+ return;
184
+ }
185
+ });
186
+ }, [editor]);
187
+ (0, react_1.useEffect)(() => {
188
+ document.addEventListener("selectionchange", updatePopup);
189
+ return () => {
190
+ document.removeEventListener("selectionchange", updatePopup);
191
+ };
192
+ }, [updatePopup]);
193
+ (0, react_1.useEffect)(() => {
194
+ return (0, utils_1.mergeRegister)(editor.registerUpdateListener(() => {
195
+ updatePopup();
196
+ }), editor.registerRootListener(() => {
197
+ if (editor.getRootElement() === null) {
198
+ setIsText(false);
199
+ }
200
+ }));
201
+ }, [editor, updatePopup]);
202
+ if (!isText) {
203
+ return null;
204
+ }
205
+ return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(TextFormatFloatingToolbar, { editor: editor, anchorElem: anchorElem, isLink: isLink, isBold: isBold, isItalic: isItalic, isStrikethrough: isStrikethrough, isUnderline: isUnderline, isCode: isCode, isLeftAlign: isLeftAlign, isCenterAlign: isCenterAlign, isRightAlign: isRightAlign, setIsLinkEditMode: setIsLinkEditMode, controls: controls }), anchorElem);
206
+ }
207
+ const FloatingTextFormatToolbarPlugin = ({ anchorElem = document.body, setIsLinkEditMode, controls, }) => {
208
+ const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
209
+ return useFloatingTextFormatToolbar(editor, anchorElem, setIsLinkEditMode, controls);
210
+ };
211
+ exports.FloatingTextFormatToolbarPlugin = FloatingTextFormatToolbarPlugin;
212
+ var floatTextFormatToolbarPluginStyles_1 = require("./floatTextFormatToolbarPluginStyles");
213
+ Object.defineProperty(exports, "floatTextFormatToolbarPluginStyles", { enumerable: true, get: function () { return floatTextFormatToolbarPluginStyles_1.floatTextFormatToolbarPluginStyles; } });
214
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx"],"names":[],"mappings":";;;;AAAA;;;;;;GAMG;AAEH,iCAA0F;AAC1F,wCAAqD;AACrD,wCAAiE;AACjE,kFAAkF;AAClF,0CAA+C;AAC/C,qCASiB;AACjB,yCAAyC;AAEzC,uCAAwF;AACxF,iCAUkB;AAElB,+CAAyD;AAEzD,SAAS,yBAAyB,CAAC,EACjC,MAAM,EACN,UAAU,EACV,MAAM,EACN,MAAM,EACN,QAAQ,EACR,WAAW,EACX,MAAM,EACN,eAAe,EACf,WAAW,EACX,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,QAAQ,GAAG,kCAAsB,CAAC,UAAU,GAe7C;IACC,MAAM,wBAAwB,GAAG,IAAA,cAAM,EAAwB,IAAI,CAAC,CAAC;IAErE,MAAM,UAAU,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAClC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,iBAAiB,CAAC,IAAI,CAAC,CAAC;YACxB,MAAM,CAAC,eAAe,CAAC,0BAAmB,EAAE,UAAU,CAAC,CAAC;QAC1D,CAAC;aAAM,CAAC;YACN,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,MAAM,CAAC,eAAe,CAAC,0BAAmB,EAAE,IAAI,CAAC,CAAC;QACpD,CAAC;IACH,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAExC,SAAS,iBAAiB,CAAC,CAAa;QACtC,IAAI,CAAA,wBAAw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,EACtB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,EAAE,QAAQ,GAClB,EACF,UAAU,CACX,CAAC;AACJ,CAAC;AAEM,MAAM,+BAA+B,GAAG,CAAC,EAC9C,UAAU,GAAG,QAAQ,CAAC,IAAI,EAC1B,iBAAiB,EACjB,QAAQ,GAKT,EAAsB,EAAE;IACvB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,kDAAyB,GAAE,CAAC;IAC7C,OAAO,4BAA4B,CAAC,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,CAAC,CAAC;AACvF,CAAC,CAAC;AAXW,QAAA,+BAA+B,mCAW1C;AAEF,2FAA0F;AAAjF,wJAAA,kCAAkC,OAAA"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import { type JSX } from "react";
9
+ import { LexicalCommand, LexicalEditor } from "lexical";
10
+ import { IImagePayload } from "../../nodes/Image/ImageNode";
11
+ export type InsertImagePayload = Readonly<IImagePayload>;
12
+ export declare const INSERT_IMAGE_COMMAND: LexicalCommand<InsertImagePayload>;
13
+ export declare function InsertImageUriDialogBody({ onClick }: {
14
+ onClick: (payload: InsertImagePayload) => void;
15
+ }): import("react/jsx-runtime").JSX.Element;
16
+ export declare function InsertImageDialog({ activeEditor, onClose, }: {
17
+ activeEditor: LexicalEditor;
18
+ onClose: () => void;
19
+ }): JSX.Element;
20
+ export declare const ImagesPlugin: ({ captionsEnabled }: {
21
+ captionsEnabled?: boolean;
22
+ }) => JSX.Element | null;
23
+ declare global {
24
+ interface DragEvent {
25
+ rangeOffset?: number;
26
+ rangeParent?: Node;
27
+ }
28
+ }
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImagesPlugin = exports.INSERT_IMAGE_COMMAND = void 0;
4
+ exports.InsertImageUriDialogBody = InsertImageUriDialogBody;
5
+ exports.InsertImageDialog = InsertImageDialog;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ /**
8
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ *
13
+ */
14
+ const react_1 = require("react");
15
+ const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
16
+ const utils_1 = require("@lexical/utils");
17
+ const lexical_1 = require("lexical");
18
+ const ImageNode_1 = require("../../nodes/Image/ImageNode");
19
+ const Button_1 = require("../../ui/Button");
20
+ const Dialog_1 = require("../../ui/Dialog");
21
+ const TextInput_1 = require("../../ui/TextInput");
22
+ exports.INSERT_IMAGE_COMMAND = (0, lexical_1.createCommand)("INSERT_IMAGE_COMMAND");
23
+ function InsertImageUriDialogBody({ onClick }) {
24
+ const [src, setSrc] = (0, react_1.useState)("");
25
+ const [altText, setAltText] = (0, react_1.useState)("");
26
+ const isDisabled = src === "";
27
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextInput_1.TextInput, { label: "Image URL", placeholder: "i.e. https://source.unsplash.com/random", onChange: setSrc, value: src, "data-test-id": "image-modal-url-input" }), (0, jsx_runtime_1.jsx)(TextInput_1.TextInput, { label: "Alt Text", placeholder: "Random unsplash image", onChange: setAltText, value: altText, "data-test-id": "image-modal-alt-text-input" }), (0, jsx_runtime_1.jsx)(Dialog_1.DialogActions, { children: (0, jsx_runtime_1.jsx)(Button_1.Button, { "data-test-id": "image-modal-confirm-btn", disabled: isDisabled, onClick: () => onClick({ altText, src }), children: "Confirm" }) })] }));
28
+ }
29
+ function InsertImageDialog({ activeEditor, onClose, }) {
30
+ const hasModifier = (0, react_1.useRef)(false);
31
+ (0, react_1.useEffect)(() => {
32
+ hasModifier.current = false;
33
+ const handler = (e) => {
34
+ hasModifier.current = e.altKey;
35
+ };
36
+ document.addEventListener("keydown", handler);
37
+ return () => {
38
+ document.removeEventListener("keydown", handler);
39
+ };
40
+ }, [activeEditor]);
41
+ const onClick = (payload) => {
42
+ activeEditor.dispatchCommand(exports.INSERT_IMAGE_COMMAND, payload);
43
+ onClose();
44
+ };
45
+ return (0, jsx_runtime_1.jsx)(InsertImageUriDialogBody, { onClick: onClick });
46
+ }
47
+ const ImagesPlugin = ({ captionsEnabled }) => {
48
+ const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
49
+ (0, react_1.useEffect)(() => {
50
+ if (!editor.hasNodes([ImageNode_1.ImageNode])) {
51
+ throw new Error("ImagesPlugin: ImageNode not registered on editor");
52
+ }
53
+ return (0, utils_1.mergeRegister)(editor.registerCommand(exports.INSERT_IMAGE_COMMAND, payload => {
54
+ const imageNode = (0, ImageNode_1.$createImageNode)(payload);
55
+ (0, lexical_1.$insertNodes)([imageNode]);
56
+ if ((0, lexical_1.$isRootOrShadowRoot)(imageNode.getParentOrThrow())) {
57
+ (0, utils_1.$wrapNodeInElement)(imageNode, lexical_1.$createParagraphNode).selectEnd();
58
+ }
59
+ return true;
60
+ }, lexical_1.COMMAND_PRIORITY_EDITOR), editor.registerCommand(lexical_1.DRAGSTART_COMMAND, event => {
61
+ return $onDragStart(event);
62
+ }, lexical_1.COMMAND_PRIORITY_HIGH), editor.registerCommand(lexical_1.DRAGOVER_COMMAND, event => {
63
+ return $onDragover(event);
64
+ }, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.DROP_COMMAND, event => {
65
+ return $onDrop(event, editor);
66
+ }, lexical_1.COMMAND_PRIORITY_HIGH));
67
+ }, [captionsEnabled, editor]);
68
+ return null;
69
+ };
70
+ exports.ImagesPlugin = ImagesPlugin;
71
+ const TRANSPARENT_IMAGE = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
72
+ const img = document.createElement("img");
73
+ img.src = TRANSPARENT_IMAGE;
74
+ function $onDragStart(event) {
75
+ const node = $getImageNodeInSelection();
76
+ if (!node) {
77
+ return false;
78
+ }
79
+ const dataTransfer = event.dataTransfer;
80
+ if (!dataTransfer) {
81
+ return false;
82
+ }
83
+ dataTransfer.setData("text/plain", "_");
84
+ dataTransfer.setDragImage(img, 0, 0);
85
+ dataTransfer.setData("application/x-lexical-drag", JSON.stringify({
86
+ data: {
87
+ altText: node.__altText,
88
+ caption: node.__caption,
89
+ height: node.__height,
90
+ key: node.getKey(),
91
+ maxWidth: node.__maxWidth,
92
+ showCaption: node.__showCaption,
93
+ src: node.__src,
94
+ width: node.__width,
95
+ },
96
+ type: "image",
97
+ }));
98
+ return true;
99
+ }
100
+ function $onDragover(event) {
101
+ const node = $getImageNodeInSelection();
102
+ if (!node) {
103
+ return false;
104
+ }
105
+ if (!canDropImage(event)) {
106
+ event.preventDefault();
107
+ }
108
+ return true;
109
+ }
110
+ function $onDrop(event, editor) {
111
+ const node = $getImageNodeInSelection();
112
+ if (!node) {
113
+ return false;
114
+ }
115
+ const data = getDragImageData(event);
116
+ if (!data) {
117
+ return false;
118
+ }
119
+ event.preventDefault();
120
+ if (canDropImage(event)) {
121
+ const range = getDragSelection(event);
122
+ node.remove();
123
+ const rangeSelection = (0, lexical_1.$createRangeSelection)();
124
+ if (range !== null && range !== undefined) {
125
+ rangeSelection.applyDOMRange(range);
126
+ }
127
+ (0, lexical_1.$setSelection)(rangeSelection);
128
+ editor.dispatchCommand(exports.INSERT_IMAGE_COMMAND, data);
129
+ }
130
+ return true;
131
+ }
132
+ function $getImageNodeInSelection() {
133
+ const selection = (0, lexical_1.$getSelection)();
134
+ if (!(0, lexical_1.$isNodeSelection)(selection)) {
135
+ return null;
136
+ }
137
+ const nodes = selection.getNodes();
138
+ const node = nodes[0];
139
+ return (0, ImageNode_1.$isImageNode)(node) ? node : null;
140
+ }
141
+ function getDragImageData(event) {
142
+ var _a;
143
+ const dragData = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData("application/x-lexical-drag");
144
+ if (!dragData) {
145
+ return null;
146
+ }
147
+ const { type, data } = JSON.parse(dragData);
148
+ if (type !== "image") {
149
+ return null;
150
+ }
151
+ return data;
152
+ }
153
+ function canDropImage(event) {
154
+ const target = event.target;
155
+ return !!((0, lexical_1.isHTMLElement)(target) &&
156
+ !target.closest("code, span.editor-image") &&
157
+ (0, lexical_1.isHTMLElement)(target.parentElement) &&
158
+ target.parentElement.closest("div.ContentEditable__root"));
159
+ }
160
+ function getDragSelection(event) {
161
+ let range;
162
+ const domSelection = (0, lexical_1.getDOMSelectionFromTarget)(event.target);
163
+ if (document.caretRangeFromPoint) {
164
+ range = document.caretRangeFromPoint(event.clientX, event.clientY);
165
+ }
166
+ else if (event.rangeParent && domSelection !== null) {
167
+ domSelection.collapse(event.rangeParent, event.rangeOffset || 0);
168
+ range = domSelection.getRangeAt(0);
169
+ }
170
+ else {
171
+ throw Error(`Cannot get the selection when dragging`);
172
+ }
173
+ return range;
174
+ }
175
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/plugins/ImagesPlugin/index.tsx"],"names":[],"mappings":";;;AAyCA,4DA6BC;AAED,8CA0BC;;AAlGD;;;;;;GAMG;AAEH,iCAA8D;AAC9D,kFAAkF;AAClF,0CAAmE;AACnE,qCAmBiB;AAEjB,2DAAuG;AACvG,4CAAyC;AACzC,4CAAgD;AAChD,kDAA+C;AAIlC,QAAA,oBAAoB,GAAuC,IAAA,uBAAa,EAAC,sBAAsB,CAAC,CAAC;AAE9G,SAAgB,w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mBAAmB,EAAE,CAAC;QACjC,KAAK,GAAG,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;SAAM,IAAI,KAAK,CAAC,WAAW,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QACtD,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;QACjE,KAAK,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,CAAC,wCAAwC,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import type { JSX } from "react";
9
+ export declare const LinkPlugin: () => JSX.Element;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LinkPlugin = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const LexicalLinkPlugin_1 = require("@lexical/react/LexicalLinkPlugin");
6
+ const url_1 = require("../../utils/url");
7
+ const LinkPlugin = () => {
8
+ return ((0, jsx_runtime_1.jsx)(LexicalLinkPlugin_1.LinkPlugin, { validateUrl: url_1.validateUrl, attributes: {
9
+ rel: "noopener noreferrer",
10
+ target: "_blank",
11
+ } }));
12
+ };
13
+ exports.LinkPlugin = LinkPlugin;
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/plugins/LinkPlugin/index.tsx"],"names":[],"mappings":";;;;AASA,wEAAmF;AAEnF,yCAA8C;AAEvC,MAAM,UAAU,GAAG,GAAgB,EAAE;IAC1C,OAAO,CACL,uBAAC,8BAAiB,IAChB,WAAW,EAAE,iBAAW,EACxB,UAAU,EAAE;YACV,GAAG,EAAE,qBAAqB;YAC1B,MAAM,EAAE,QAAQ;SACjB,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,UAAU,cAUrB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import type { JSX } from "react";
9
+ export declare const MarkdownPlugin: () => JSX.Element;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MarkdownPlugin = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const LexicalMarkdownShortcutPlugin_1 = require("@lexical/react/LexicalMarkdownShortcutPlugin");
6
+ const MarkdownTransformers_1 = require("../MarkdownTransformers");
7
+ const MarkdownPlugin = () => {
8
+ return (0, jsx_runtime_1.jsx)(LexicalMarkdownShortcutPlugin_1.MarkdownShortcutPlugin, { transformers: MarkdownTransformers_1.PLAYGROUND_TRANSFORMERS });
9
+ };
10
+ exports.MarkdownPlugin = MarkdownPlugin;
11
+ //# sourceMappingURL=index.js.map