@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.DropDown = exports.DropDownItem = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const lexical_1 = require("lexical");
7
+ const react_dom_1 = require("react-dom");
8
+ const DropDownContext = (0, react_1.createContext)(null);
9
+ const dropDownPadding = 4;
10
+ const DropDownItem = ({ children, className, onClick, title, }) => {
11
+ const ref = (0, react_1.useRef)(null);
12
+ const dropDownContext = (0, react_1.useContext)(DropDownContext);
13
+ if (dropDownContext === null) {
14
+ throw new Error("DropDownItem must be used within a DropDown");
15
+ }
16
+ const { registerItem } = dropDownContext;
17
+ (0, react_1.useEffect)(() => {
18
+ if (ref) {
19
+ registerItem(ref);
20
+ }
21
+ return;
22
+ }, [ref, registerItem]);
23
+ return ((0, jsx_runtime_1.jsx)("button", { className: className, onClick: onClick, ref: ref, title: title, type: "button", children: children }));
24
+ };
25
+ exports.DropDownItem = DropDownItem;
26
+ const DropDownItems = ({ children, dropDownRef, onClose, }) => {
27
+ const [items, setItems] = (0, react_1.useState)();
28
+ const [highlightedItem, setHighlightedItem] = (0, react_1.useState)();
29
+ const registerItem = (0, react_1.useCallback)((itemRef) => {
30
+ setItems(prev => (prev ? [...prev, itemRef] : [itemRef]));
31
+ }, [setItems]);
32
+ const handleKeyDown = (event) => {
33
+ if (!items) {
34
+ return;
35
+ }
36
+ const key = event.key;
37
+ if (["Escape", "ArrowUp", "ArrowDown", "Tab"].includes(key)) {
38
+ event.preventDefault();
39
+ }
40
+ if (key === "Escape" || key === "Tab") {
41
+ onClose();
42
+ }
43
+ else if (key === "ArrowUp") {
44
+ setHighlightedItem(prev => {
45
+ if (!prev) {
46
+ return items[0];
47
+ }
48
+ const index = items.indexOf(prev) - 1;
49
+ return items[index === -1 ? items.length - 1 : index];
50
+ });
51
+ }
52
+ else if (key === "ArrowDown") {
53
+ setHighlightedItem(prev => {
54
+ if (!prev) {
55
+ return items[0];
56
+ }
57
+ return items[items.indexOf(prev) + 1];
58
+ });
59
+ }
60
+ };
61
+ const contextValue = (0, react_1.useMemo)(() => ({
62
+ registerItem,
63
+ }), [registerItem]);
64
+ (0, react_1.useEffect)(() => {
65
+ if (items && !highlightedItem) {
66
+ setHighlightedItem(items[0]);
67
+ }
68
+ if (highlightedItem === null || highlightedItem === void 0 ? void 0 : highlightedItem.current) {
69
+ highlightedItem.current.focus();
70
+ }
71
+ }, [items, highlightedItem]);
72
+ return ((0, jsx_runtime_1.jsx)(DropDownContext.Provider, { value: contextValue, children: (0, jsx_runtime_1.jsx)("div", { className: "dropdown", ref: dropDownRef, onKeyDown: handleKeyDown, children: children }) }));
73
+ };
74
+ const DropDown = ({ disabled = false, buttonLabel, buttonAriaLabel, buttonClassName, icon, children, stopCloseOnClickSelf, }) => {
75
+ const dropDownRef = (0, react_1.useRef)(null);
76
+ const buttonRef = (0, react_1.useRef)(null);
77
+ const [showDropDown, setShowDropDown] = (0, react_1.useState)(false);
78
+ const handleClose = () => {
79
+ setShowDropDown(false);
80
+ if (buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) {
81
+ buttonRef.current.focus();
82
+ }
83
+ };
84
+ (0, react_1.useEffect)(() => {
85
+ const button = buttonRef.current;
86
+ const dropDown = dropDownRef.current;
87
+ if (showDropDown && button !== null && dropDown !== null) {
88
+ const { top, left } = button.getBoundingClientRect();
89
+ dropDown.style.top = `${top + button.offsetHeight + dropDownPadding}px`;
90
+ dropDown.style.left = `${Math.min(left, window.innerWidth - dropDown.offsetWidth - 20)}px`;
91
+ }
92
+ }, [dropDownRef, buttonRef, showDropDown]);
93
+ (0, react_1.useEffect)(() => {
94
+ const button = buttonRef.current;
95
+ if (button !== null && showDropDown) {
96
+ const handle = (event) => {
97
+ var _a;
98
+ const target = event.target;
99
+ if (!(0, lexical_1.isDOMNode)(target)) {
100
+ return;
101
+ }
102
+ if (stopCloseOnClickSelf) {
103
+ if ((_a = dropDownRef.current) === null || _a === void 0 ? void 0 : _a.contains(target)) {
104
+ return;
105
+ }
106
+ }
107
+ if (!button.contains(target)) {
108
+ setShowDropDown(false);
109
+ }
110
+ };
111
+ document.addEventListener("click", handle);
112
+ return () => {
113
+ document.removeEventListener("click", handle);
114
+ };
115
+ }
116
+ return;
117
+ }, [dropDownRef, buttonRef, showDropDown, stopCloseOnClickSelf]);
118
+ (0, react_1.useEffect)(() => {
119
+ const handleButtonPositionUpdate = () => {
120
+ if (showDropDown) {
121
+ const button = buttonRef.current;
122
+ const dropDown = dropDownRef.current;
123
+ if (button !== null && dropDown !== null) {
124
+ const { top } = button.getBoundingClientRect();
125
+ const newPosition = top + button.offsetHeight + dropDownPadding;
126
+ if (newPosition !== dropDown.getBoundingClientRect().top) {
127
+ dropDown.style.top = `${newPosition}px`;
128
+ }
129
+ }
130
+ }
131
+ };
132
+ document.addEventListener("scroll", handleButtonPositionUpdate);
133
+ return () => {
134
+ document.removeEventListener("scroll", handleButtonPositionUpdate);
135
+ };
136
+ }, [buttonRef, dropDownRef, showDropDown]);
137
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", disabled: disabled, "aria-label": buttonAriaLabel || buttonLabel, className: buttonClassName, onClick: () => setShowDropDown(!showDropDown), ref: buttonRef, children: [icon, buttonLabel && (0, jsx_runtime_1.jsx)("span", { className: "text dropdown-button-text", children: buttonLabel }), (0, jsx_runtime_1.jsx)("i", { className: "chevron-down" })] }), showDropDown &&
138
+ (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(DropDownItems, { dropDownRef: dropDownRef, onClose: handleClose, children: children }), document.body)] }));
139
+ };
140
+ exports.DropDown = DropDown;
141
+ //# sourceMappingURL=DropDown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropDown.js","sourceRoot":"","sources":["../../../src/editor/ui/DropDown.tsx"],"names":[],"mappings":";;;;AACA,iCAAqG;AACrG,qCAAoC;AACpC,yCAAyC;AAMzC,MAAM,eAAe,GAAG,IAAA,qBAAa,EAA8B,IAAI,CAAC,CAAC;AAEzE,MAAM,eAAe,GAAG,CAAC,CAAC;AAEnB,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,GAMN,EAAE,EAAE;IACH,MAAM,GAAG,GAAG,IAAA,cAAM,EAAoB,IAAI,CAAC,CAAC;IAE5C,MAAM,eAAe,GAAG,IAAA,kBAAU,EAAC,eAAe,CAAC,CAAC;IAEpD,IAAI,eAAe,KAAK,IAAI,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,EAAE,YAAY,EAAE,GAAG,eAAe,CAAC;IAEzC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,GAAG,EAAE,CAAC;YACR,YAAY,CAAC,GAAmC,CAAC,CAAC;QACpD,CAAC;QACD,OAAO;IACT,CAAC,EAAE,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;IAExB,OAAO,CACL,mCAAQ,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE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qBAAqB,EAAE,CAAC;oBAC/C,MAAM,WAAW,GAAG,GAAG,GAAG,MAAM,CAAC,YAAY,GAAG,eAAe,CAAC;oBAChE,IAAI,WAAW,KAAK,QAAQ,CAAC,qBAAqB,EAAE,CAAC,GAAG,EAAE,CAAC;wBACzD,QAAQ,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,WAAW,IAAI,CAAC;oBAC1C,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,0BAA0B,CAAC,CAAC;QAEhE,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,0BAA0B,CAAC,CAAC;QACrE,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC;IAE3C,OAAO,CACL,6DACE,oCACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,QAAQ,gBACN,eAAe,IAAI,WAAW,EAC1C,SAAS,EAAE,eAAe,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC,EAC7C,GAAG,EAAE,SAAS,aAEb,IAAI,EACJ,WAAW,IAAI,iCAAM,SAAS,EAAC,2BAA2B,YAAE,WAAW,GAAQ,EAChF,8BAAG,SAAS,EAAC,cAAc,GAAG,IACvB,EAER,YAAY;gBACX,IAAA,wBAAY,EACV,uBAAC,aAAa,IAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,YAC1D,QAAQ,GACK,EAChB,QAAQ,CAAC,IAAI,CACd,IACF,CACJ,CAAC;AACJ,CAAC,CAAC;AAhHW,QAAA,QAAQ,YAgHnB"}
@@ -0,0 +1,6 @@
1
+ import { ReactNode, type JSX } from "react";
2
+ export interface IFlashMessageProps {
3
+ children: ReactNode;
4
+ }
5
+ export declare const FlashMessage: ({ children }: IFlashMessageProps) => JSX.Element;
6
+ export declare const lexicalFlashMessageStyles: import("@emotion/utils").SerializedStyles;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lexicalFlashMessageStyles = exports.FlashMessage = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_dom_1 = require("react-dom");
6
+ const material_1 = require("@mui/material");
7
+ const FlashMessage = ({ children }) => {
8
+ return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)("div", { className: "FlashMessage__overlay", role: "dialog", children: (0, jsx_runtime_1.jsx)("p", { className: "FlashMessage__alert", role: "alert", children: children }) }), document.body);
9
+ };
10
+ exports.FlashMessage = FlashMessage;
11
+ exports.lexicalFlashMessageStyles = (0, material_1.css) `
12
+ .FlashMessage__overlay {
13
+ display: flex;
14
+ justify-content: center;
15
+ align-items: center;
16
+ position: fixed;
17
+ pointer-events: none;
18
+ top: 0px;
19
+ bottom: 0px;
20
+ left: 0px;
21
+ right: 0px;
22
+ }
23
+
24
+ .FlashMessage__alert {
25
+ background-color: rgba(0, 0, 0, 0.8);
26
+ color: white;
27
+ font-size: 1.5rem;
28
+ border-radius: 1em;
29
+ padding: 0.5em 1.5em;
30
+ }
31
+ `;
32
+ //# sourceMappingURL=FlashMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlashMessage.js","sourceRoot":"","sources":["../../../src/editor/ui/FlashMessage.tsx"],"names":[],"mappings":";;;;AACA,yCAAyC;AACzC,4CAAoC;AAM7B,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAsB,EAAe,EAAE;IAC5E,OAAO,IAAA,wBAAY,EACjB,gCAAK,SAAS,EAAC,uBAAuB,EAAC,IAAI,EAAC,QAAQ,YAClD,8BAAG,SAAS,EAAC,qBAAqB,EAAC,IAAI,EAAC,OAAO,YAC5C,QAAQ,GACP,GACA,EACN,QAAQ,CAAC,IAAI,CACd,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,YAAY,gBASvB;AAEW,QAAA,yBAAyB,GAAG,IAAA,cAAG,EAAA;;;;;;;;;;;;;;;;;;;;CAoB3C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { FC } from "react";
2
+ import { IToolbarComponentProps } from "../../../common";
3
+ export declare const HorizontalRuleButton: FC<IToolbarComponentProps>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HorizontalRuleButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const LexicalHorizontalRuleNode_1 = require("@lexical/react/LexicalHorizontalRuleNode");
6
+ const icons_1 = require("../../images/icons");
7
+ const HorizontalRuleButton = ({ activeEditor }) => {
8
+ return ((0, jsx_runtime_1.jsx)("button", { onClick: () => {
9
+ activeEditor.dispatchCommand(LexicalHorizontalRuleNode_1.INSERT_HORIZONTAL_RULE_COMMAND, undefined);
10
+ }, className: "toolbar-item spaced", title: "Horizontal Rule", type: "button", "aria-label": "Horizontal Rule", children: (0, jsx_runtime_1.jsx)(icons_1.HorizontalRuleIcon, {}) }));
11
+ };
12
+ exports.HorizontalRuleButton = HorizontalRuleButton;
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/ui/HorizontalRuleButton/index.tsx"],"names":[],"mappings":";;;;AACA,wFAA0F;AAG1F,8CAAwD;AAEjD,MAAM,oBAAoB,GAA+B,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;IACnF,OAAO,CACL,mCACE,OAAO,EAAE,GAAG,EAAE;YACZ,YAAY,CAAC,eAAe,CAAC,0DAA8B,EAAE,SAAS,CAAC,CAAC;QAC1E,CAAC,EACD,SAAS,EAAE,qBAAqB,EAChC,KAAK,EAAC,iBAAiB,EACvB,IAAI,EAAC,QAAQ,gBACF,iBAAiB,YAE5B,uBAAC,0BAAkB,KAAG,GACf,CACV,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,oBAAoB,wBAc/B"}
@@ -0,0 +1,8 @@
1
+ import { FC } from "react";
2
+ import { IToolbarComponentProps } from "../../../common";
3
+ import { useModal } from "../../hooks";
4
+ interface IImageButtonProps extends Omit<IToolbarComponentProps, "disabled"> {
5
+ showModal: ReturnType<typeof useModal>[1];
6
+ }
7
+ export declare const ImageButton: FC<IImageButtonProps>;
8
+ export {};
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImageButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const plugins_1 = require("../../plugins");
6
+ const icons_1 = require("../../images/icons");
7
+ const ImageButton = ({ activeEditor, showModal }) => {
8
+ return ((0, jsx_runtime_1.jsx)("button", { onClick: () => {
9
+ showModal("Insert Image", onClose => (0, jsx_runtime_1.jsx)(plugins_1.InsertImageDialog, { activeEditor: activeEditor, onClose: onClose }));
10
+ }, className: "toolbar-item spaced", title: "Image", type: "button", "aria-label": "Image", children: (0, jsx_runtime_1.jsx)(icons_1.FileImageIcon, {}) }));
11
+ };
12
+ exports.ImageButton = ImageButton;
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/ui/ImageButton/index.tsx"],"names":[],"mappings":";;;;AAGA,2CAAkD;AAElD,8CAAmD;AAM5C,MAAM,WAAW,GAA0B,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE;IAChF,OAAO,CACL,mCACE,OAAO,EAAE,GAAG,EAAE;YACZ,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE,CAAC,uBAAC,2BAAiB,IAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC,CAAC;QAC5G,CAAC,EACD,SAAS,EAAE,qBAAqB,EAChC,KAAK,EAAC,OAAO,EACb,IAAI,EAAC,QAAQ,gBACF,OAAO,YAElB,uBAAC,qBAAa,KAAG,GACV,CACV,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,WAAW,eActB"}
@@ -0,0 +1,17 @@
1
+ import type { JSX } from "react";
2
+ import type { LexicalEditor } from "lexical";
3
+ export declare const ImageResizer: ({ onResizeStart, onResizeEnd, buttonRef, imageRef, maxWidth, editor, showCaption, setShowCaption, captionsEnabled, }: {
4
+ editor: LexicalEditor;
5
+ buttonRef: {
6
+ current: null | HTMLButtonElement;
7
+ };
8
+ imageRef: {
9
+ current: null | HTMLElement;
10
+ };
11
+ maxWidth?: number;
12
+ onResizeEnd: (width: "inherit" | number, height: "inherit" | number) => void;
13
+ onResizeStart: () => void;
14
+ setShowCaption: (show: boolean) => void;
15
+ showCaption: boolean;
16
+ captionsEnabled: boolean;
17
+ }) => JSX.Element;
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImageResizer = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const utils_1 = require("@lexical/utils");
7
+ function clamp(value, min, max) {
8
+ return Math.min(Math.max(value, min), max);
9
+ }
10
+ const Direction = {
11
+ east: 1 << 0,
12
+ north: 1 << 3,
13
+ south: 1 << 1,
14
+ west: 1 << 2,
15
+ };
16
+ const ImageResizer = ({ onResizeStart, onResizeEnd, buttonRef, imageRef, maxWidth, editor, showCaption, setShowCaption, captionsEnabled, }) => {
17
+ const controlWrapperRef = (0, react_1.useRef)(null);
18
+ const userSelect = (0, react_1.useRef)({
19
+ priority: "",
20
+ value: "default",
21
+ });
22
+ const positioningRef = (0, react_1.useRef)({
23
+ currentHeight: 0,
24
+ currentWidth: 0,
25
+ direction: 0,
26
+ isResizing: false,
27
+ ratio: 0,
28
+ startHeight: 0,
29
+ startWidth: 0,
30
+ startX: 0,
31
+ startY: 0,
32
+ });
33
+ const editorRootElement = editor.getRootElement();
34
+ // Find max width, accounting for editor padding.
35
+ const maxWidthContainer = maxWidth
36
+ ? maxWidth
37
+ : editorRootElement !== null
38
+ ? editorRootElement.getBoundingClientRect().width - 20
39
+ : 100;
40
+ const maxHeightContainer = editorRootElement !== null ? editorRootElement.getBoundingClientRect().height - 20 : 100;
41
+ const minWidth = 100;
42
+ const minHeight = 100;
43
+ const setStartCursor = (direction) => {
44
+ const ew = direction === Direction.east || direction === Direction.west;
45
+ const ns = direction === Direction.north || direction === Direction.south;
46
+ const nwse = (direction & Direction.north && direction & Direction.west) ||
47
+ (direction & Direction.south && direction & Direction.east);
48
+ const cursorDir = ew ? "ew" : ns ? "ns" : nwse ? "nwse" : "nesw";
49
+ if (editorRootElement !== null) {
50
+ editorRootElement.style.setProperty("cursor", `${cursorDir}-resize`, "important");
51
+ }
52
+ if (document.body !== null) {
53
+ document.body.style.setProperty("cursor", `${cursorDir}-resize`, "important");
54
+ userSelect.current.value = document.body.style.getPropertyValue("-webkit-user-select");
55
+ userSelect.current.priority = document.body.style.getPropertyPriority("-webkit-user-select");
56
+ document.body.style.setProperty("-webkit-user-select", `none`, "important");
57
+ }
58
+ };
59
+ const setEndCursor = () => {
60
+ if (editorRootElement !== null) {
61
+ editorRootElement.style.setProperty("cursor", "text");
62
+ }
63
+ if (document.body !== null) {
64
+ document.body.style.setProperty("cursor", "default");
65
+ document.body.style.setProperty("-webkit-user-select", userSelect.current.value, userSelect.current.priority);
66
+ }
67
+ };
68
+ const handlePointerDown = (event, direction) => {
69
+ if (!editor.isEditable()) {
70
+ return;
71
+ }
72
+ const image = imageRef.current;
73
+ const controlWrapper = controlWrapperRef.current;
74
+ if (image !== null && controlWrapper !== null) {
75
+ event.preventDefault();
76
+ const { width, height } = image.getBoundingClientRect();
77
+ const zoom = (0, utils_1.calculateZoomLevel)(image);
78
+ const positioning = positioningRef.current;
79
+ positioning.startWidth = width;
80
+ positioning.startHeight = height;
81
+ positioning.ratio = width / height;
82
+ positioning.currentWidth = width;
83
+ positioning.currentHeight = height;
84
+ positioning.startX = event.clientX / zoom;
85
+ positioning.startY = event.clientY / zoom;
86
+ positioning.isResizing = true;
87
+ positioning.direction = direction;
88
+ setStartCursor(direction);
89
+ onResizeStart();
90
+ controlWrapper.classList.add("image-control-wrapper--resizing");
91
+ image.style.height = `${height}px`;
92
+ image.style.width = `${width}px`;
93
+ document.addEventListener("pointermove", handlePointerMove);
94
+ document.addEventListener("pointerup", handlePointerUp);
95
+ }
96
+ };
97
+ const handlePointerMove = (event) => {
98
+ const image = imageRef.current;
99
+ const positioning = positioningRef.current;
100
+ const isHorizontal = positioning.direction & (Direction.east | Direction.west);
101
+ const isVertical = positioning.direction & (Direction.south | Direction.north);
102
+ if (image !== null && positioning.isResizing) {
103
+ const zoom = (0, utils_1.calculateZoomLevel)(image);
104
+ // Corner cursor
105
+ if (isHorizontal && isVertical) {
106
+ let diff = Math.floor(positioning.startX - event.clientX / zoom);
107
+ diff = positioning.direction & Direction.east ? -diff : diff;
108
+ const width = clamp(positioning.startWidth + diff, minWidth, maxWidthContainer);
109
+ const height = width / positioning.ratio;
110
+ image.style.width = `${width}px`;
111
+ image.style.height = `${height}px`;
112
+ positioning.currentHeight = height;
113
+ positioning.currentWidth = width;
114
+ }
115
+ else if (isVertical) {
116
+ let diff = Math.floor(positioning.startY - event.clientY / zoom);
117
+ diff = positioning.direction & Direction.south ? -diff : diff;
118
+ const height = clamp(positioning.startHeight + diff, minHeight, maxHeightContainer);
119
+ image.style.height = `${height}px`;
120
+ positioning.currentHeight = height;
121
+ }
122
+ else {
123
+ let diff = Math.floor(positioning.startX - event.clientX / zoom);
124
+ diff = positioning.direction & Direction.east ? -diff : diff;
125
+ const width = clamp(positioning.startWidth + diff, minWidth, maxWidthContainer);
126
+ image.style.width = `${width}px`;
127
+ positioning.currentWidth = width;
128
+ }
129
+ }
130
+ };
131
+ const handlePointerUp = () => {
132
+ const image = imageRef.current;
133
+ const positioning = positioningRef.current;
134
+ const controlWrapper = controlWrapperRef.current;
135
+ if (image !== null && controlWrapper !== null && positioning.isResizing) {
136
+ const width = positioning.currentWidth;
137
+ const height = positioning.currentHeight;
138
+ positioning.startWidth = 0;
139
+ positioning.startHeight = 0;
140
+ positioning.ratio = 0;
141
+ positioning.startX = 0;
142
+ positioning.startY = 0;
143
+ positioning.currentWidth = 0;
144
+ positioning.currentHeight = 0;
145
+ positioning.isResizing = false;
146
+ controlWrapper.classList.remove("image-control-wrapper--resizing");
147
+ setEndCursor();
148
+ onResizeEnd(width, height);
149
+ document.removeEventListener("pointermove", handlePointerMove);
150
+ document.removeEventListener("pointerup", handlePointerUp);
151
+ }
152
+ };
153
+ return ((0, jsx_runtime_1.jsxs)("div", { ref: controlWrapperRef, children: [!showCaption && captionsEnabled && ((0, jsx_runtime_1.jsx)("button", { className: "image-caption-button", ref: buttonRef, onClick: () => {
154
+ setShowCaption(!showCaption);
155
+ }, children: "Add Caption" })), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-n", onPointerDown: event => {
156
+ handlePointerDown(event, Direction.north);
157
+ } }), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-ne", onPointerDown: event => {
158
+ handlePointerDown(event, Direction.north | Direction.east);
159
+ } }), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-e", onPointerDown: event => {
160
+ handlePointerDown(event, Direction.east);
161
+ } }), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-se", onPointerDown: event => {
162
+ handlePointerDown(event, Direction.south | Direction.east);
163
+ } }), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-s", onPointerDown: event => {
164
+ handlePointerDown(event, Direction.south);
165
+ } }), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-sw", onPointerDown: event => {
166
+ handlePointerDown(event, Direction.south | Direction.west);
167
+ } }), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-w", onPointerDown: event => {
168
+ handlePointerDown(event, Direction.west);
169
+ } }), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-nw", onPointerDown: event => {
170
+ handlePointerDown(event, Direction.north | Direction.west);
171
+ } })] }));
172
+ };
173
+ exports.ImageResizer = ImageResizer;
174
+ //# sourceMappingURL=ImageResizer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageResizer.js","sourceRoot":"","sources":["../../../src/editor/ui/ImageResizer.tsx"],"names":[],"mappings":";;;;AACA,iCAA+B;AAE/B,0CAAoD;AAEpD,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW;IACpD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,CAAC,IAAI,CAAC;IACZ,KAAK,EAAE,CAAC,IAAI,CAAC;IACb,KAAK,EAAE,CAAC,IAAI,CAAC;IACb,IAAI,EAAE,CAAC,IAAI,CAAC;CACb,CAAC;AAEK,MAAM,YAAY,GAAG,CAAC,EAC3B,aAAa,EACb,WAAW,EACX,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,WAAW,EACX,cAAc,EACd,eAAe,GAWhB,EAAe,EAAE;IAChB,MAAM,iBAAiB,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IACvD,MAAM,UAAU,GAAG,IAAA,cAAM,EAAC;QACxB,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,IAAA,cAAM,EAU1B;QACD,aAAa,EAAE,CAAC;QAChB,YAAY,EAAE,CAAC;QACf,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,CAAC;QACR,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,CAAC;QACb,MAAM,EAAE,CAAC;QACT,MAAM,EAAE,CAAC;KACV,CAAC,CAAC;IACH,MAAM,iBAAiB,GAAG,MAAM,CAAC,c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,IAAI,CAAC,CAAC;gBAC7D,CAAC,GACD,EACF,gCACE,SAAS,EAAC,+BAA+B,EACzC,aAAa,EAAE,KAAK,CAAC,EAAE;oBACrB,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;gBAC3C,CAAC,GACD,EACF,gCACE,SAAS,EAAC,gCAAgC,EAC1C,aAAa,EAAE,KAAK,CAAC,EAAE;oBACrB,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;gBAC7D,CAAC,GACD,EACF,gCACE,SAAS,EAAC,+BAA+B,EACzC,aAAa,EAAE,KAAK,CAAC,EAAE;oBACrB,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;gBAC5C,CAAC,GACD,EACF,gCACE,SAAS,EAAC,gCAAgC,EAC1C,aAAa,EAAE,KAAK,CAAC,EAAE;oBACrB,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;gBAC7D,CAAC,GACD,EACF,gCACE,SAAS,EAAC,+BAA+B,EACzC,aAAa,EAAE,KAAK,CAAC,EAAE;oBACrB,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;gBAC3C,CAAC,GACD,EACF,gCACE,SAAS,EAAC,gCAAgC,EAC1C,aAAa,EAAE,KAAK,CAAC,EAAE;oBACrB,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;gBAC7D,CAAC,GACD,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AA3PW,QAAA,YAAY,gBA2PvB"}
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ import { IToolbarComponentProps } from "../../../common";
3
+ interface IItalicButtonProps extends IToolbarComponentProps {
4
+ isItalic: boolean;
5
+ }
6
+ export declare const ItalicButton: FC<IItalicButtonProps>;
7
+ export {};
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ItalicButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const lexical_1 = require("lexical");
6
+ const shortcuts_1 = require("../../plugins/ShortcutsPlugin/shortcuts");
7
+ const icons_1 = require("../../images/icons");
8
+ const ItalicButton = ({ activeEditor, isItalic, disabled }) => {
9
+ return ((0, jsx_runtime_1.jsx)("button", { disabled: disabled, onClick: () => {
10
+ activeEditor.dispatchCommand(lexical_1.FORMAT_TEXT_COMMAND, "italic");
11
+ }, className: "toolbar-item spaced " + (isItalic ? "active" : ""), title: `Italic (${shortcuts_1.SHORTCUTS.ITALIC})`, type: "button", "aria-label": `Format text as italics. Shortcut: ${shortcuts_1.SHORTCUTS.ITALIC}`, children: (0, jsx_runtime_1.jsx)(icons_1.TypeItalicIcon, {}) }));
12
+ };
13
+ exports.ItalicButton = ItalicButton;
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/ui/ItalicButton/index.tsx"],"names":[],"mappings":";;;;AACA,qCAA8C;AAE9C,uEAAoE;AAEpE,8CAAoD;AAM7C,MAAM,YAAY,GAA2B,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3F,OAAO,CACL,mCACE,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE;YACZ,YAAY,CAAC,eAAe,CAAC,6BAAmB,EAAE,QAAQ,CAAC,CAAC;QAC9D,CAAC,EACD,SAAS,EAAE,sBAAsB,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAC9D,KAAK,EAAE,WAAW,qBAAS,CAAC,MAAM,GAAG,EACrC,IAAI,EAAC,QAAQ,gBACD,qCAAqC,qBAAS,CAAC,MAAM,EAAE,YAEnE,uBAAC,sBAAc,KAAG,GACX,CACV,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,YAAY,gBAevB"}
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ import { IToolbarComponentProps } from "../../../common";
3
+ interface ILeftAlignButtonProps extends IToolbarComponentProps {
4
+ isLeftAlign: boolean;
5
+ }
6
+ export declare const LeftAlignButton: FC<ILeftAlignButtonProps>;
7
+ export {};
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LeftAlignButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const lexical_1 = require("lexical");
6
+ const shortcuts_1 = require("../../plugins/ShortcutsPlugin/shortcuts");
7
+ const icons_1 = require("../../images/icons");
8
+ const LeftAlignButton = ({ activeEditor, isLeftAlign, disabled }) => {
9
+ return ((0, jsx_runtime_1.jsx)("button", { disabled: disabled, onClick: () => {
10
+ activeEditor.dispatchCommand(lexical_1.FORMAT_ELEMENT_COMMAND, "left");
11
+ }, className: "toolbar-item spaced " + (isLeftAlign ? "active" : ""), title: `Left Align (${shortcuts_1.SHORTCUTS.LEFT_ALIGN})`, type: "button", "aria-label": `Format text as left align. Shortcut: ${shortcuts_1.SHORTCUTS.LEFT_ALIGN}`, children: (0, jsx_runtime_1.jsx)(icons_1.TextLeftIcon, {}) }));
12
+ };
13
+ exports.LeftAlignButton = LeftAlignButton;
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/ui/LeftAlignButton/index.tsx"],"names":[],"mappings":";;;;AACA,qCAAiD;AAEjD,uEAAoE;AAEpE,8CAAkD;AAM3C,MAAM,eAAe,GAA8B,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpG,OAAO,CACL,mCACE,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE;YACZ,YAAY,CAAC,eAAe,CAAC,gCAAsB,EAAE,MAAM,CAAC,CAAC;QAC/D,CAAC,EACD,SAAS,EAAE,sBAAsB,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EACjE,KAAK,EAAE,eAAe,qBAAS,CAAC,UAAU,GAAG,EAC7C,IAAI,EAAC,QAAQ,gBACD,wCAAwC,qBAAS,CAAC,UAAU,EAAE,YAE1E,uBAAC,oBAAY,KAAG,GACT,CACV,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,eAAe,mBAe1B"}
@@ -0,0 +1,8 @@
1
+ import { FC } from "react";
2
+ import { IToolbarComponentProps } from "../../../common";
3
+ interface ILinkButtonProps extends Omit<IToolbarComponentProps, "activeEditor"> {
4
+ isLink: boolean;
5
+ insertLink: () => void;
6
+ }
7
+ export declare const LinkButton: FC<ILinkButtonProps>;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LinkButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const shortcuts_1 = require("../../plugins/ShortcutsPlugin/shortcuts");
6
+ const icons_1 = require("../../images/icons");
7
+ const LinkButton = ({ insertLink, isLink, disabled }) => {
8
+ return ((0, jsx_runtime_1.jsx)("button", { disabled: disabled, onClick: insertLink, className: "toolbar-item spaced " + (isLink ? "active" : ""), "aria-label": "Insert link", title: `Insert link (${shortcuts_1.SHORTCUTS.INSERT_LINK})`, type: "button", children: (0, jsx_runtime_1.jsx)(icons_1.LinkIcon, {}) }));
9
+ };
10
+ exports.LinkButton = LinkButton;
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/ui/LinkButton/index.tsx"],"names":[],"mappings":";;;;AAEA,uEAAoE;AAEpE,8CAA8C;AAOvC,MAAM,UAAU,GAAyB,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE;IACnF,OAAO,CACL,mCACE,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,sBAAsB,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,gBACjD,aAAa,EACxB,KAAK,EAAE,gBAAgB,qBAAS,CAAC,WAAW,GAAG,EAC/C,IAAI,EAAC,QAAQ,YAEb,uBAAC,gBAAQ,KAAG,GACL,CACV,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,UAAU,cAarB"}
@@ -0,0 +1,9 @@
1
+ import type { JSX } from "react";
2
+ import { ReactNode } from "react";
3
+ export declare const Modal: ({ onClose, children, title, closeOnClickOutside, }: {
4
+ children: ReactNode;
5
+ closeOnClickOutside?: boolean;
6
+ onClose: () => void;
7
+ title: string;
8
+ }) => JSX.Element;
9
+ export declare const lexicalModalStyles: import("@emotion/utils").SerializedStyles;