@opentiny/fluent-editor 4.0.0-alpha.0 → 4.0.0-alpha.10

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 (602) hide show
  1. package/README.md +88 -105
  2. package/es/attributors/line-height.es.js.map +1 -1
  3. package/es/config/base64-image.es.js.map +1 -1
  4. package/es/config/editor.config.es.js +0 -7
  5. package/es/config/editor.config.es.js.map +1 -1
  6. package/es/config/editor.utils.es.js +0 -2
  7. package/es/config/editor.utils.es.js.map +1 -1
  8. package/es/config/i18n/en-us.es.js +0 -13
  9. package/es/config/i18n/en-us.es.js.map +1 -1
  10. package/es/config/i18n/zh-cn.es.js +0 -13
  11. package/es/config/i18n/zh-cn.es.js.map +1 -1
  12. package/es/config/index.es.js +8 -13
  13. package/es/config/index.es.js.map +1 -1
  14. package/es/config/types/index.es.js +0 -20
  15. package/es/config/types/index.es.js.map +1 -1
  16. package/es/core/fluent-editor.es.js +7 -5
  17. package/es/core/fluent-editor.es.js.map +1 -1
  18. package/es/fluent-editor.es.js +38 -22
  19. package/es/fluent-editor.es.js.map +1 -1
  20. package/es/formats/emoji.es.js +14 -0
  21. package/es/formats/emoji.es.js.map +1 -0
  22. package/es/formats/index.es.js +11 -0
  23. package/es/formats/index.es.js.map +1 -0
  24. package/es/formats/soft-break.es.js +12 -5
  25. package/es/formats/soft-break.es.js.map +1 -1
  26. package/es/formats/strike.es.js +8 -5
  27. package/es/formats/strike.es.js.map +1 -1
  28. package/es/formats/video.es.js +14 -10
  29. package/es/formats/video.es.js.map +1 -1
  30. package/es/index.es.js +94 -32
  31. package/es/index.es.js.map +1 -1
  32. package/es/modules/ai/constants.es.js +50 -0
  33. package/es/modules/ai/constants.es.js.map +1 -0
  34. package/es/modules/ai/icons.es.js +319 -0
  35. package/es/modules/ai/icons.es.js.map +1 -0
  36. package/es/modules/ai/index.es.js +670 -0
  37. package/es/modules/ai/index.es.js.map +1 -0
  38. package/es/modules/collaborative-editing/awareness/awareness.es.js +93 -0
  39. package/es/modules/collaborative-editing/awareness/awareness.es.js.map +1 -0
  40. package/es/modules/collaborative-editing/awareness/index.es.js +8 -0
  41. package/es/modules/{emoji/emoji-list → collaborative-editing/awareness}/index.es.js.map +1 -1
  42. package/es/modules/collaborative-editing/awareness/y-indexeddb.es.js +12 -0
  43. package/es/modules/collaborative-editing/awareness/y-indexeddb.es.js.map +1 -0
  44. package/es/modules/collaborative-editing/collaborative-editing.es.js +105 -0
  45. package/es/modules/collaborative-editing/collaborative-editing.es.js.map +1 -0
  46. package/es/modules/collaborative-editing/index.es.js +6 -0
  47. package/es/modules/collaborative-editing/index.es.js.map +1 -0
  48. package/es/modules/collaborative-editing/module.es.js +35 -0
  49. package/es/modules/collaborative-editing/module.es.js.map +1 -0
  50. package/es/modules/collaborative-editing/provider/providerRegistry.es.js +28 -0
  51. package/es/modules/collaborative-editing/provider/providerRegistry.es.js.map +1 -0
  52. package/es/modules/collaborative-editing/provider/webrtc.es.js +99 -0
  53. package/es/modules/collaborative-editing/provider/webrtc.es.js.map +1 -0
  54. package/es/modules/collaborative-editing/provider/websocket.es.js +111 -0
  55. package/es/modules/collaborative-editing/provider/websocket.es.js.map +1 -0
  56. package/es/modules/collaborative-editing/types.es.js +2 -0
  57. package/es/modules/collaborative-editing/types.es.js.map +1 -0
  58. package/es/modules/counter.es.js +8 -3
  59. package/es/modules/counter.es.js.map +1 -1
  60. package/es/modules/custom-clipboard.es.js +23 -27
  61. package/es/modules/custom-clipboard.es.js.map +1 -1
  62. package/es/modules/custom-image/actions/action.es.js +19 -0
  63. package/es/modules/custom-image/actions/action.es.js.map +1 -0
  64. package/es/modules/custom-image/actions/{CustomResizeAction.es.js → custom-resize-action.es.js} +24 -11
  65. package/es/modules/custom-image/actions/custom-resize-action.es.js.map +1 -0
  66. package/es/modules/custom-image/actions/{DeleteAction.es.js → delete-action.es.js} +8 -5
  67. package/es/modules/custom-image/actions/delete-action.es.js.map +1 -0
  68. package/es/modules/custom-image/actions/image-toolbar-buttons.es.js +137 -0
  69. package/es/modules/custom-image/actions/image-toolbar-buttons.es.js.map +1 -0
  70. package/es/modules/custom-image/actions/index.es.js +18 -0
  71. package/es/modules/custom-image/actions/index.es.js.map +1 -0
  72. package/es/modules/custom-image/actions/toolbar-action.es.js +33 -0
  73. package/es/modules/custom-image/actions/toolbar-action.es.js.map +1 -0
  74. package/es/modules/custom-image/actions/toolbar.es.js +110 -0
  75. package/es/modules/custom-image/actions/toolbar.es.js.map +1 -0
  76. package/es/modules/custom-image/{BlotFormatter.es.js → blot-formatter.es.js} +27 -50
  77. package/es/modules/custom-image/blot-formatter.es.js.map +1 -0
  78. package/es/modules/custom-image/image.es.js +41 -21
  79. package/es/modules/custom-image/image.es.js.map +1 -1
  80. package/es/modules/custom-image/index.es.js +9 -0
  81. package/es/modules/custom-image/index.es.js.map +1 -0
  82. package/es/modules/custom-image/options.es.js +88 -0
  83. package/es/modules/custom-image/options.es.js.map +1 -0
  84. package/es/modules/custom-image/specs/blot-spec.es.js +33 -0
  85. package/es/modules/custom-image/specs/blot-spec.es.js.map +1 -0
  86. package/es/modules/custom-image/specs/{CustomImageSpec.es.js → custom-image-spec.es.js} +13 -14
  87. package/es/modules/custom-image/specs/custom-image-spec.es.js.map +1 -0
  88. package/es/modules/custom-image/specs/image-spec.es.js +32 -0
  89. package/es/modules/custom-image/specs/image-spec.es.js.map +1 -0
  90. package/es/modules/custom-image/specs/index.es.js +9 -0
  91. package/es/modules/custom-image/specs/index.es.js.map +1 -0
  92. package/es/modules/custom-uploader.es.js +63 -194
  93. package/es/modules/custom-uploader.es.js.map +1 -1
  94. package/es/modules/divider.es.js +8 -7
  95. package/es/modules/divider.es.js.map +1 -1
  96. package/es/modules/emoji.es.js +167 -0
  97. package/es/modules/emoji.es.js.map +1 -0
  98. package/es/modules/file/formats/file.es.js +13 -13
  99. package/es/modules/file/formats/file.es.js.map +1 -1
  100. package/es/modules/file/index.es.js +6 -29
  101. package/es/modules/file/index.es.js.map +1 -1
  102. package/es/modules/file/modules/file-bar.es.js +11 -3
  103. package/es/modules/file/modules/file-bar.es.js.map +1 -1
  104. package/es/modules/file/modules/file-module.es.js +35 -0
  105. package/es/modules/file/modules/file-module.es.js.map +1 -0
  106. package/es/modules/i18n.es.js +33 -11
  107. package/es/modules/i18n.es.js.map +1 -1
  108. package/es/modules/index.es.js +27 -0
  109. package/es/modules/index.es.js.map +1 -0
  110. package/es/modules/link/formats/link.es.js +14 -10
  111. package/es/modules/link/formats/link.es.js.map +1 -1
  112. package/es/modules/link/index.es.js +4 -12
  113. package/es/modules/link/index.es.js.map +1 -1
  114. package/es/modules/link/modules/tooltip.es.js +31 -21
  115. package/es/modules/link/modules/tooltip.es.js.map +1 -1
  116. package/es/modules/mathlive/formats.es.js +10 -7
  117. package/es/modules/mathlive/formats.es.js.map +1 -1
  118. package/es/modules/mathlive/index.es.js +6 -30
  119. package/es/modules/mathlive/index.es.js.map +1 -1
  120. package/es/modules/mathlive/module.es.js +40 -0
  121. package/es/modules/mathlive/module.es.js.map +1 -0
  122. package/es/modules/mathlive/tooltip.es.js +9 -5
  123. package/es/modules/mathlive/tooltip.es.js.map +1 -1
  124. package/es/modules/mention/constants.es.js.map +1 -1
  125. package/es/modules/mention/index.es.js +7 -0
  126. package/es/modules/mention/index.es.js.map +1 -0
  127. package/es/modules/mention/{MentionLink.es.js → mention-link.es.js} +14 -6
  128. package/es/modules/mention/mention-link.es.js.map +1 -0
  129. package/es/modules/mention/{Mention.es.js → mention.es.js} +28 -20
  130. package/es/modules/mention/mention.es.js.map +1 -0
  131. package/es/modules/shortcut-key/index.es.js +17 -1
  132. package/es/modules/shortcut-key/index.es.js.map +1 -1
  133. package/es/modules/syntax.es.js +4 -0
  134. package/es/modules/syntax.es.js.map +1 -1
  135. package/es/modules/table-up/index.es.js +21 -8
  136. package/es/modules/table-up/index.es.js.map +1 -1
  137. package/es/modules/toolbar/better-picker.es.js +5 -0
  138. package/es/modules/toolbar/better-picker.es.js.map +1 -1
  139. package/es/modules/toolbar/better-toolbar.es.js +138 -0
  140. package/es/modules/toolbar/better-toolbar.es.js.map +1 -0
  141. package/es/modules/toolbar/index.es.js +5 -135
  142. package/es/modules/toolbar/index.es.js.map +1 -1
  143. package/es/modules/toolbar/toolbar-tip.es.js +6 -1
  144. package/es/modules/toolbar/toolbar-tip.es.js.map +1 -1
  145. package/es/themes/snow.es.js +32 -15
  146. package/es/themes/snow.es.js.map +1 -1
  147. package/es/tools/format-painter.es.js +8 -2
  148. package/es/tools/format-painter.es.js.map +1 -1
  149. package/es/tools/fullscreen.es.js.map +1 -1
  150. package/es/tools/screenshot.es.js.map +1 -1
  151. package/es/ui/icons.config.es.js +53 -0
  152. package/es/ui/icons.config.es.js.map +1 -1
  153. package/es/ui/icons.es.js +2 -1
  154. package/es/ui/icons.es.js.map +1 -1
  155. package/es/utils/debounce.es.js.map +1 -1
  156. package/es/utils/is.es.js +4 -0
  157. package/es/utils/is.es.js.map +1 -1
  158. package/es/utils/method.es.js.map +1 -1
  159. package/lib/attributors/line-height.cjs.js.map +1 -1
  160. package/lib/config/base64-image.cjs.js.map +1 -1
  161. package/lib/config/editor.config.cjs.js +0 -7
  162. package/lib/config/editor.config.cjs.js.map +1 -1
  163. package/lib/config/editor.utils.cjs.js +0 -2
  164. package/lib/config/editor.utils.cjs.js.map +1 -1
  165. package/lib/config/i18n/en-us.cjs.js +0 -13
  166. package/lib/config/i18n/en-us.cjs.js.map +1 -1
  167. package/lib/config/i18n/zh-cn.cjs.js +0 -13
  168. package/lib/config/i18n/zh-cn.cjs.js.map +1 -1
  169. package/lib/config/index.cjs.js +6 -11
  170. package/lib/config/index.cjs.js.map +1 -1
  171. package/lib/config/types/index.cjs.js +0 -20
  172. package/lib/config/types/index.cjs.js.map +1 -1
  173. package/lib/core/fluent-editor.cjs.js +6 -4
  174. package/lib/core/fluent-editor.cjs.js.map +1 -1
  175. package/lib/fluent-editor.cjs.js +46 -30
  176. package/lib/fluent-editor.cjs.js.map +1 -1
  177. package/lib/formats/emoji.cjs.js +14 -0
  178. package/lib/formats/emoji.cjs.js.map +1 -0
  179. package/lib/formats/index.cjs.js +11 -0
  180. package/lib/formats/index.cjs.js.map +1 -0
  181. package/lib/formats/soft-break.cjs.js +13 -6
  182. package/lib/formats/soft-break.cjs.js.map +1 -1
  183. package/lib/formats/strike.cjs.js +9 -6
  184. package/lib/formats/strike.cjs.js.map +1 -1
  185. package/lib/formats/video.cjs.js +15 -11
  186. package/lib/formats/video.cjs.js.map +1 -1
  187. package/lib/index.cjs.js +114 -34
  188. package/lib/index.cjs.js.map +1 -1
  189. package/lib/modules/ai/constants.cjs.js +50 -0
  190. package/lib/modules/ai/constants.cjs.js.map +1 -0
  191. package/lib/modules/ai/icons.cjs.js +319 -0
  192. package/lib/modules/ai/icons.cjs.js.map +1 -0
  193. package/lib/modules/ai/index.cjs.js +670 -0
  194. package/lib/modules/ai/index.cjs.js.map +1 -0
  195. package/lib/modules/collaborative-editing/awareness/awareness.cjs.js +110 -0
  196. package/lib/modules/collaborative-editing/awareness/awareness.cjs.js.map +1 -0
  197. package/lib/modules/collaborative-editing/awareness/index.cjs.js +8 -0
  198. package/lib/modules/collaborative-editing/awareness/index.cjs.js.map +1 -0
  199. package/lib/modules/collaborative-editing/awareness/y-indexeddb.cjs.js +12 -0
  200. package/lib/modules/collaborative-editing/awareness/y-indexeddb.cjs.js.map +1 -0
  201. package/lib/modules/collaborative-editing/collaborative-editing.cjs.js +122 -0
  202. package/lib/modules/collaborative-editing/collaborative-editing.cjs.js.map +1 -0
  203. package/lib/modules/collaborative-editing/index.cjs.js +6 -0
  204. package/lib/modules/{emoji/emoji-list → collaborative-editing}/index.cjs.js.map +1 -1
  205. package/lib/modules/collaborative-editing/module.cjs.js +35 -0
  206. package/lib/modules/collaborative-editing/module.cjs.js.map +1 -0
  207. package/lib/modules/collaborative-editing/provider/providerRegistry.cjs.js +28 -0
  208. package/lib/modules/collaborative-editing/provider/providerRegistry.cjs.js.map +1 -0
  209. package/lib/modules/collaborative-editing/provider/webrtc.cjs.js +116 -0
  210. package/lib/modules/collaborative-editing/provider/webrtc.cjs.js.map +1 -0
  211. package/lib/modules/collaborative-editing/provider/websocket.cjs.js +128 -0
  212. package/lib/modules/collaborative-editing/provider/websocket.cjs.js.map +1 -0
  213. package/lib/modules/collaborative-editing/types.cjs.js +2 -0
  214. package/lib/modules/collaborative-editing/types.cjs.js.map +1 -0
  215. package/lib/modules/counter.cjs.js +8 -3
  216. package/lib/modules/counter.cjs.js.map +1 -1
  217. package/lib/modules/custom-clipboard.cjs.js +23 -27
  218. package/lib/modules/custom-clipboard.cjs.js.map +1 -1
  219. package/lib/modules/custom-image/actions/action.cjs.js +19 -0
  220. package/lib/modules/custom-image/actions/action.cjs.js.map +1 -0
  221. package/lib/modules/custom-image/actions/{CustomResizeAction.cjs.js → custom-resize-action.cjs.js} +26 -13
  222. package/lib/modules/custom-image/actions/custom-resize-action.cjs.js.map +1 -0
  223. package/lib/modules/custom-image/actions/{DeleteAction.cjs.js → delete-action.cjs.js} +10 -7
  224. package/lib/modules/custom-image/actions/delete-action.cjs.js.map +1 -0
  225. package/lib/modules/custom-image/actions/image-toolbar-buttons.cjs.js +137 -0
  226. package/lib/modules/custom-image/actions/image-toolbar-buttons.cjs.js.map +1 -0
  227. package/lib/modules/custom-image/actions/index.cjs.js +18 -0
  228. package/lib/modules/custom-image/actions/index.cjs.js.map +1 -0
  229. package/lib/modules/custom-image/actions/toolbar-action.cjs.js +33 -0
  230. package/lib/modules/custom-image/actions/toolbar-action.cjs.js.map +1 -0
  231. package/lib/modules/custom-image/actions/toolbar.cjs.js +110 -0
  232. package/lib/modules/custom-image/actions/toolbar.cjs.js.map +1 -0
  233. package/lib/modules/custom-image/{BlotFormatter.cjs.js → blot-formatter.cjs.js} +28 -51
  234. package/lib/modules/custom-image/blot-formatter.cjs.js.map +1 -0
  235. package/lib/modules/custom-image/image.cjs.js +42 -22
  236. package/lib/modules/custom-image/image.cjs.js.map +1 -1
  237. package/lib/modules/custom-image/index.cjs.js +9 -0
  238. package/lib/modules/custom-image/index.cjs.js.map +1 -0
  239. package/lib/modules/custom-image/options.cjs.js +88 -0
  240. package/lib/modules/custom-image/options.cjs.js.map +1 -0
  241. package/lib/modules/custom-image/specs/blot-spec.cjs.js +33 -0
  242. package/lib/modules/custom-image/specs/blot-spec.cjs.js.map +1 -0
  243. package/lib/modules/custom-image/specs/{CustomImageSpec.cjs.js → custom-image-spec.cjs.js} +14 -15
  244. package/lib/modules/custom-image/specs/custom-image-spec.cjs.js.map +1 -0
  245. package/lib/modules/custom-image/specs/image-spec.cjs.js +32 -0
  246. package/lib/modules/custom-image/specs/image-spec.cjs.js.map +1 -0
  247. package/lib/modules/custom-image/specs/index.cjs.js +9 -0
  248. package/lib/modules/custom-image/specs/index.cjs.js.map +1 -0
  249. package/lib/modules/custom-uploader.cjs.js +64 -195
  250. package/lib/modules/custom-uploader.cjs.js.map +1 -1
  251. package/lib/modules/divider.cjs.js +9 -8
  252. package/lib/modules/divider.cjs.js.map +1 -1
  253. package/lib/modules/emoji.cjs.js +167 -0
  254. package/lib/modules/emoji.cjs.js.map +1 -0
  255. package/lib/modules/file/formats/file.cjs.js +14 -14
  256. package/lib/modules/file/formats/file.cjs.js.map +1 -1
  257. package/lib/modules/file/index.cjs.js +5 -28
  258. package/lib/modules/file/index.cjs.js.map +1 -1
  259. package/lib/modules/file/modules/file-bar.cjs.js +12 -4
  260. package/lib/modules/file/modules/file-bar.cjs.js.map +1 -1
  261. package/lib/modules/file/modules/file-module.cjs.js +35 -0
  262. package/lib/modules/file/modules/file-module.cjs.js.map +1 -0
  263. package/lib/modules/i18n.cjs.js +32 -10
  264. package/lib/modules/i18n.cjs.js.map +1 -1
  265. package/lib/modules/index.cjs.js +27 -0
  266. package/lib/modules/index.cjs.js.map +1 -0
  267. package/lib/modules/link/formats/link.cjs.js +15 -11
  268. package/lib/modules/link/formats/link.cjs.js.map +1 -1
  269. package/lib/modules/link/index.cjs.js +4 -12
  270. package/lib/modules/link/index.cjs.js.map +1 -1
  271. package/lib/modules/link/modules/tooltip.cjs.js +30 -20
  272. package/lib/modules/link/modules/tooltip.cjs.js.map +1 -1
  273. package/lib/modules/mathlive/formats.cjs.js +11 -8
  274. package/lib/modules/mathlive/formats.cjs.js.map +1 -1
  275. package/lib/modules/mathlive/index.cjs.js +5 -29
  276. package/lib/modules/mathlive/index.cjs.js.map +1 -1
  277. package/lib/modules/mathlive/module.cjs.js +40 -0
  278. package/lib/modules/mathlive/module.cjs.js.map +1 -0
  279. package/lib/modules/mathlive/tooltip.cjs.js +10 -6
  280. package/lib/modules/mathlive/tooltip.cjs.js.map +1 -1
  281. package/lib/modules/mention/constants.cjs.js.map +1 -1
  282. package/lib/modules/mention/index.cjs.js +7 -0
  283. package/lib/modules/mention/index.cjs.js.map +1 -0
  284. package/lib/modules/mention/{MentionLink.cjs.js → mention-link.cjs.js} +15 -7
  285. package/lib/modules/mention/mention-link.cjs.js.map +1 -0
  286. package/lib/modules/mention/{Mention.cjs.js → mention.cjs.js} +30 -22
  287. package/lib/modules/mention/mention.cjs.js.map +1 -0
  288. package/lib/modules/shortcut-key/index.cjs.js +16 -0
  289. package/lib/modules/shortcut-key/index.cjs.js.map +1 -1
  290. package/lib/modules/syntax.cjs.js +4 -0
  291. package/lib/modules/syntax.cjs.js.map +1 -1
  292. package/lib/modules/table-up/index.cjs.js +21 -8
  293. package/lib/modules/table-up/index.cjs.js.map +1 -1
  294. package/lib/modules/toolbar/better-picker.cjs.js +5 -0
  295. package/lib/modules/toolbar/better-picker.cjs.js.map +1 -1
  296. package/lib/modules/toolbar/better-toolbar.cjs.js +138 -0
  297. package/lib/modules/toolbar/better-toolbar.cjs.js.map +1 -0
  298. package/lib/modules/toolbar/index.cjs.js +6 -136
  299. package/lib/modules/toolbar/index.cjs.js.map +1 -1
  300. package/lib/modules/toolbar/toolbar-tip.cjs.js +6 -1
  301. package/lib/modules/toolbar/toolbar-tip.cjs.js.map +1 -1
  302. package/lib/themes/snow.cjs.js +33 -16
  303. package/lib/themes/snow.cjs.js.map +1 -1
  304. package/lib/tools/format-painter.cjs.js +8 -2
  305. package/lib/tools/format-painter.cjs.js.map +1 -1
  306. package/lib/tools/fullscreen.cjs.js.map +1 -1
  307. package/lib/tools/screenshot.cjs.js.map +1 -1
  308. package/lib/ui/icons.cjs.js +1 -0
  309. package/lib/ui/icons.cjs.js.map +1 -1
  310. package/lib/ui/icons.config.cjs.js +53 -0
  311. package/lib/ui/icons.config.cjs.js.map +1 -1
  312. package/lib/utils/debounce.cjs.js.map +1 -1
  313. package/lib/utils/is.cjs.js +4 -0
  314. package/lib/utils/is.cjs.js.map +1 -1
  315. package/lib/utils/method.cjs.js.map +1 -1
  316. package/package.json +68 -59
  317. package/style.css +2359 -2251
  318. package/types/attributors/font-size.d.ts +1 -1
  319. package/types/attributors/font-style.d.ts +1 -1
  320. package/types/attributors/index.d.ts +4 -4
  321. package/types/attributors/line-height.d.ts +1 -1
  322. package/types/attributors/text-indent.d.ts +1 -1
  323. package/types/config/base64-image.d.ts +2 -2
  324. package/types/config/editor.config.d.ts +11 -285
  325. package/types/config/editor.utils.d.ts +40 -41
  326. package/types/config/i18n/en-us.d.ts +123 -136
  327. package/types/config/i18n/zh-cn.d.ts +123 -136
  328. package/types/config/index.d.ts +7 -6
  329. package/types/config/types/editor-config.interface.d.ts +11 -35
  330. package/types/config/types/editor-modules.interface.d.ts +41 -31
  331. package/types/config/types/index.d.ts +3 -23
  332. package/types/config/types/type.d.ts +2 -6
  333. package/types/core/fluent-editor.d.ts +11 -11
  334. package/types/fluent-editor.d.ts +1 -2
  335. package/types/formats/emoji.d.ts +8 -0
  336. package/types/formats/index.d.ts +4 -0
  337. package/types/formats/soft-break.d.ts +12 -14
  338. package/types/formats/strike.d.ts +8 -7
  339. package/types/formats/video.d.ts +13 -16
  340. package/types/index.d.ts +7 -6
  341. package/types/modules/ai/constants.d.ts +30 -0
  342. package/types/modules/ai/icons.d.ts +21 -0
  343. package/types/modules/ai/index.d.ts +96 -0
  344. package/types/modules/ai/types.d.ts +16 -0
  345. package/types/modules/collaborative-editing/awareness/awareness.d.ts +28 -0
  346. package/types/modules/collaborative-editing/awareness/index.d.ts +2 -0
  347. package/types/modules/collaborative-editing/awareness/y-indexeddb.d.ts +2 -0
  348. package/types/modules/collaborative-editing/collaborative-editing.d.ts +24 -0
  349. package/types/modules/collaborative-editing/index.d.ts +2 -0
  350. package/types/modules/collaborative-editing/module.d.ts +11 -0
  351. package/types/modules/collaborative-editing/provider/index.d.ts +3 -0
  352. package/types/modules/collaborative-editing/provider/providerRegistry.d.ts +25 -0
  353. package/types/modules/collaborative-editing/provider/webrtc.d.ts +36 -0
  354. package/types/modules/collaborative-editing/provider/websocket.d.ts +40 -0
  355. package/types/modules/collaborative-editing/types.d.ts +37 -0
  356. package/types/modules/counter.d.ts +22 -16
  357. package/types/modules/custom-clipboard.d.ts +23 -27
  358. package/types/modules/custom-image/actions/action.d.ts +8 -0
  359. package/types/modules/custom-image/actions/{CustomResizeAction.d.ts → custom-resize-action.d.ts} +23 -24
  360. package/types/modules/custom-image/actions/delete-action.d.ts +6 -0
  361. package/types/modules/custom-image/actions/image-toolbar-buttons.d.ts +16 -0
  362. package/types/modules/custom-image/actions/index.d.ts +6 -0
  363. package/types/modules/custom-image/actions/toolbar-action.d.ts +11 -0
  364. package/types/modules/custom-image/actions/toolbar.d.ts +19 -0
  365. package/types/modules/custom-image/blot-formatter.d.ts +23 -0
  366. package/types/modules/custom-image/image.d.ts +28 -28
  367. package/types/modules/custom-image/index.d.ts +4 -0
  368. package/types/modules/custom-image/options.d.ts +47 -0
  369. package/types/modules/custom-image/specs/blot-spec.d.ts +12 -0
  370. package/types/modules/custom-image/specs/{CustomImageSpec.d.ts → custom-image-spec.d.ts} +17 -21
  371. package/types/modules/custom-image/specs/image-spec.d.ts +8 -0
  372. package/types/modules/custom-image/specs/index.d.ts +3 -0
  373. package/types/modules/custom-uploader.d.ts +40 -31
  374. package/types/modules/divider.d.ts +8 -7
  375. package/types/modules/emoji.d.ts +39 -0
  376. package/types/modules/file/formats/file.d.ts +18 -15
  377. package/types/modules/file/index.d.ts +3 -11
  378. package/types/modules/file/modules/file-bar.d.ts +14 -14
  379. package/types/modules/file/modules/file-module.d.ts +9 -0
  380. package/types/modules/i18n.d.ts +13 -15
  381. package/types/modules/index.d.ts +16 -0
  382. package/types/modules/link/formats/link.d.ts +14 -15
  383. package/types/modules/link/index.d.ts +2 -6
  384. package/types/modules/link/modules/tooltip.d.ts +26 -32
  385. package/types/modules/mathlive/formats.d.ts +20 -21
  386. package/types/modules/mathlive/index.d.ts +3 -9
  387. package/types/modules/mathlive/module.d.ts +9 -0
  388. package/types/modules/mathlive/tooltip.d.ts +14 -15
  389. package/types/modules/mention/constants.d.ts +3 -3
  390. package/types/modules/mention/index.d.ts +2 -0
  391. package/types/modules/mention/{MentionLink.d.ts → mention-link.d.ts} +15 -15
  392. package/types/modules/mention/{Mention.d.ts → mention.d.ts} +52 -54
  393. package/types/modules/shortcut-key/index.d.ts +67 -93
  394. package/types/modules/syntax.d.ts +12 -13
  395. package/types/modules/table-up/index.d.ts +32 -64
  396. package/types/modules/toolbar/better-picker.d.ts +13 -14
  397. package/types/modules/toolbar/better-toolbar.d.ts +7 -0
  398. package/types/modules/toolbar/index.d.ts +3 -9
  399. package/types/modules/toolbar/toolbar-tip.d.ts +7 -8
  400. package/types/themes/snow.d.ts +9 -10
  401. package/types/tools/format-painter.d.ts +12 -14
  402. package/types/tools/fullscreen.d.ts +6 -3
  403. package/types/tools/screenshot.d.ts +17 -18
  404. package/types/ui/icons.config.d.ts +38 -36
  405. package/types/ui/icons.d.ts +6 -6
  406. package/types/utils/debounce.d.ts +6 -6
  407. package/types/utils/image.d.ts +1 -1
  408. package/types/utils/is.d.ts +6 -4
  409. package/types/utils/method.d.ts +6 -6
  410. package/types/utils/scroll-lock.d.ts +6 -6
  411. package/es/config/types/additional-toolbar-item.interface.es.js +0 -2
  412. package/es/config/types/additional-toolbar-item.interface.es.js.map +0 -1
  413. package/es/config/types/content-change.interface.es.js +0 -2
  414. package/es/config/types/content-change.interface.es.js.map +0 -1
  415. package/es/config/types/content-save.interface.es.js +0 -2
  416. package/es/config/types/content-save.interface.es.js.map +0 -1
  417. package/es/config/types/counter-option.interface.es.js +0 -2
  418. package/es/config/types/counter-option.interface.es.js.map +0 -1
  419. package/es/config/types/editor-toolbar.interface.es.js +0 -2
  420. package/es/config/types/editor-toolbar.interface.es.js.map +0 -1
  421. package/es/config/types/file-operation.interface.es.js +0 -2
  422. package/es/config/types/file-operation.interface.es.js.map +0 -1
  423. package/es/config/types/focus-change.interface.es.js +0 -2
  424. package/es/config/types/focus-change.interface.es.js.map +0 -1
  425. package/es/config/types/fullscreen-module.interface.es.js +0 -2
  426. package/es/config/types/fullscreen-module.interface.es.js.map +0 -1
  427. package/es/config/types/help-panel-item.interface.es.js +0 -2
  428. package/es/config/types/help-panel-item.interface.es.js.map +0 -1
  429. package/es/config/types/help-panel-option.interface.es.js +0 -2
  430. package/es/config/types/help-panel-option.interface.es.js.map +0 -1
  431. package/es/config/types/image-module.interface.es.js +0 -2
  432. package/es/config/types/image-module.interface.es.js.map +0 -1
  433. package/es/config/types/image-upload.interface.es.js +0 -2
  434. package/es/config/types/image-upload.interface.es.js.map +0 -1
  435. package/es/config/types/load-on-demand-module.interface.es.js +0 -2
  436. package/es/config/types/load-on-demand-module.interface.es.js.map +0 -1
  437. package/es/config/types/mention-module.interface.es.js +0 -2
  438. package/es/config/types/mention-module.interface.es.js.map +0 -1
  439. package/es/config/types/paste-change.interface.es.js +0 -2
  440. package/es/config/types/paste-change.interface.es.js.map +0 -1
  441. package/es/config/types/quick-menu-module.interface.es.js +0 -2
  442. package/es/config/types/quick-menu-module.interface.es.js.map +0 -1
  443. package/es/config/types/range.interface.es.js +0 -2
  444. package/es/config/types/range.interface.es.js.map +0 -1
  445. package/es/config/types/registry-options.interface.es.js +0 -2
  446. package/es/config/types/registry-options.interface.es.js.map +0 -1
  447. package/es/config/types/selection-change.interface.es.js +0 -2
  448. package/es/config/types/selection-change.interface.es.js.map +0 -1
  449. package/es/config/types/toolbar-item.interface.es.js +0 -2
  450. package/es/config/types/toolbar-item.interface.es.js.map +0 -1
  451. package/es/config/types/validate-error.interface.es.js +0 -2
  452. package/es/config/types/validate-error.interface.es.js.map +0 -1
  453. package/es/modules/custom-image/BlotFormatter.es.js.map +0 -1
  454. package/es/modules/custom-image/Options.es.js +0 -95
  455. package/es/modules/custom-image/Options.es.js.map +0 -1
  456. package/es/modules/custom-image/actions/Action.es.js +0 -15
  457. package/es/modules/custom-image/actions/Action.es.js.map +0 -1
  458. package/es/modules/custom-image/actions/CustomResizeAction.es.js.map +0 -1
  459. package/es/modules/custom-image/actions/DeleteAction.es.js.map +0 -1
  460. package/es/modules/custom-image/image-bar.es.js +0 -127
  461. package/es/modules/custom-image/image-bar.es.js.map +0 -1
  462. package/es/modules/custom-image/specs/BlotSpec.es.js +0 -27
  463. package/es/modules/custom-image/specs/BlotSpec.es.js.map +0 -1
  464. package/es/modules/custom-image/specs/CustomImageSpec.es.js.map +0 -1
  465. package/es/modules/custom-image/specs/ImageSpec.es.js +0 -29
  466. package/es/modules/custom-image/specs/ImageSpec.es.js.map +0 -1
  467. package/es/modules/emoji/emoji-list/index.es.js +0 -5
  468. package/es/modules/emoji/emoji-list/people.es.js +0 -114
  469. package/es/modules/emoji/emoji-list/people.es.js.map +0 -1
  470. package/es/modules/emoji/emoji-list.es.js +0 -9
  471. package/es/modules/emoji/emoji-list.es.js.map +0 -1
  472. package/es/modules/emoji/emoji-map.es.js +0 -9
  473. package/es/modules/emoji/emoji-map.es.js.map +0 -1
  474. package/es/modules/emoji/emoji-sprite.es.js +0 -5
  475. package/es/modules/emoji/emoji-sprite.es.js.map +0 -1
  476. package/es/modules/emoji/formats/emoji-blot.es.js +0 -41
  477. package/es/modules/emoji/formats/emoji-blot.es.js.map +0 -1
  478. package/es/modules/emoji/index.es.js +0 -8
  479. package/es/modules/emoji/index.es.js.map +0 -1
  480. package/es/modules/emoji/modules/emoji.es.js +0 -248
  481. package/es/modules/emoji/modules/emoji.es.js.map +0 -1
  482. package/es/modules/emoji/modules/toolbar-emoji.es.js +0 -153
  483. package/es/modules/emoji/modules/toolbar-emoji.es.js.map +0 -1
  484. package/es/modules/emoji/utils.es.js +0 -19
  485. package/es/modules/emoji/utils.es.js.map +0 -1
  486. package/es/modules/mention/Mention.es.js.map +0 -1
  487. package/es/modules/mention/MentionLink.es.js.map +0 -1
  488. package/lib/config/types/additional-toolbar-item.interface.cjs.js +0 -2
  489. package/lib/config/types/additional-toolbar-item.interface.cjs.js.map +0 -1
  490. package/lib/config/types/content-change.interface.cjs.js +0 -2
  491. package/lib/config/types/content-change.interface.cjs.js.map +0 -1
  492. package/lib/config/types/content-save.interface.cjs.js +0 -2
  493. package/lib/config/types/content-save.interface.cjs.js.map +0 -1
  494. package/lib/config/types/counter-option.interface.cjs.js +0 -2
  495. package/lib/config/types/counter-option.interface.cjs.js.map +0 -1
  496. package/lib/config/types/editor-toolbar.interface.cjs.js +0 -2
  497. package/lib/config/types/editor-toolbar.interface.cjs.js.map +0 -1
  498. package/lib/config/types/file-operation.interface.cjs.js +0 -2
  499. package/lib/config/types/file-operation.interface.cjs.js.map +0 -1
  500. package/lib/config/types/focus-change.interface.cjs.js +0 -2
  501. package/lib/config/types/focus-change.interface.cjs.js.map +0 -1
  502. package/lib/config/types/fullscreen-module.interface.cjs.js +0 -2
  503. package/lib/config/types/fullscreen-module.interface.cjs.js.map +0 -1
  504. package/lib/config/types/help-panel-item.interface.cjs.js +0 -2
  505. package/lib/config/types/help-panel-item.interface.cjs.js.map +0 -1
  506. package/lib/config/types/help-panel-option.interface.cjs.js +0 -2
  507. package/lib/config/types/help-panel-option.interface.cjs.js.map +0 -1
  508. package/lib/config/types/image-module.interface.cjs.js +0 -2
  509. package/lib/config/types/image-module.interface.cjs.js.map +0 -1
  510. package/lib/config/types/image-upload.interface.cjs.js +0 -2
  511. package/lib/config/types/image-upload.interface.cjs.js.map +0 -1
  512. package/lib/config/types/load-on-demand-module.interface.cjs.js +0 -2
  513. package/lib/config/types/load-on-demand-module.interface.cjs.js.map +0 -1
  514. package/lib/config/types/mention-module.interface.cjs.js +0 -2
  515. package/lib/config/types/mention-module.interface.cjs.js.map +0 -1
  516. package/lib/config/types/paste-change.interface.cjs.js +0 -2
  517. package/lib/config/types/paste-change.interface.cjs.js.map +0 -1
  518. package/lib/config/types/quick-menu-module.interface.cjs.js +0 -2
  519. package/lib/config/types/quick-menu-module.interface.cjs.js.map +0 -1
  520. package/lib/config/types/range.interface.cjs.js +0 -2
  521. package/lib/config/types/range.interface.cjs.js.map +0 -1
  522. package/lib/config/types/registry-options.interface.cjs.js +0 -2
  523. package/lib/config/types/registry-options.interface.cjs.js.map +0 -1
  524. package/lib/config/types/selection-change.interface.cjs.js +0 -2
  525. package/lib/config/types/selection-change.interface.cjs.js.map +0 -1
  526. package/lib/config/types/toolbar-item.interface.cjs.js +0 -2
  527. package/lib/config/types/toolbar-item.interface.cjs.js.map +0 -1
  528. package/lib/config/types/validate-error.interface.cjs.js +0 -2
  529. package/lib/config/types/validate-error.interface.cjs.js.map +0 -1
  530. package/lib/modules/custom-image/BlotFormatter.cjs.js.map +0 -1
  531. package/lib/modules/custom-image/Options.cjs.js +0 -95
  532. package/lib/modules/custom-image/Options.cjs.js.map +0 -1
  533. package/lib/modules/custom-image/actions/Action.cjs.js +0 -15
  534. package/lib/modules/custom-image/actions/Action.cjs.js.map +0 -1
  535. package/lib/modules/custom-image/actions/CustomResizeAction.cjs.js.map +0 -1
  536. package/lib/modules/custom-image/actions/DeleteAction.cjs.js.map +0 -1
  537. package/lib/modules/custom-image/image-bar.cjs.js +0 -127
  538. package/lib/modules/custom-image/image-bar.cjs.js.map +0 -1
  539. package/lib/modules/custom-image/specs/BlotSpec.cjs.js +0 -27
  540. package/lib/modules/custom-image/specs/BlotSpec.cjs.js.map +0 -1
  541. package/lib/modules/custom-image/specs/CustomImageSpec.cjs.js.map +0 -1
  542. package/lib/modules/custom-image/specs/ImageSpec.cjs.js +0 -29
  543. package/lib/modules/custom-image/specs/ImageSpec.cjs.js.map +0 -1
  544. package/lib/modules/emoji/emoji-list/index.cjs.js +0 -5
  545. package/lib/modules/emoji/emoji-list/people.cjs.js +0 -114
  546. package/lib/modules/emoji/emoji-list/people.cjs.js.map +0 -1
  547. package/lib/modules/emoji/emoji-list.cjs.js +0 -9
  548. package/lib/modules/emoji/emoji-list.cjs.js.map +0 -1
  549. package/lib/modules/emoji/emoji-map.cjs.js +0 -9
  550. package/lib/modules/emoji/emoji-map.cjs.js.map +0 -1
  551. package/lib/modules/emoji/emoji-sprite.cjs.js +0 -5
  552. package/lib/modules/emoji/emoji-sprite.cjs.js.map +0 -1
  553. package/lib/modules/emoji/formats/emoji-blot.cjs.js +0 -41
  554. package/lib/modules/emoji/formats/emoji-blot.cjs.js.map +0 -1
  555. package/lib/modules/emoji/index.cjs.js +0 -8
  556. package/lib/modules/emoji/index.cjs.js.map +0 -1
  557. package/lib/modules/emoji/modules/emoji.cjs.js +0 -248
  558. package/lib/modules/emoji/modules/emoji.cjs.js.map +0 -1
  559. package/lib/modules/emoji/modules/toolbar-emoji.cjs.js +0 -153
  560. package/lib/modules/emoji/modules/toolbar-emoji.cjs.js.map +0 -1
  561. package/lib/modules/emoji/utils.cjs.js +0 -19
  562. package/lib/modules/emoji/utils.cjs.js.map +0 -1
  563. package/lib/modules/mention/Mention.cjs.js.map +0 -1
  564. package/lib/modules/mention/MentionLink.cjs.js.map +0 -1
  565. package/types/config/types/additional-toolbar-item.interface.d.ts +0 -8
  566. package/types/config/types/content-change.interface.d.ts +0 -13
  567. package/types/config/types/content-save.interface.d.ts +0 -6
  568. package/types/config/types/counter-option.interface.d.ts +0 -9
  569. package/types/config/types/editor-toolbar.interface.d.ts +0 -6
  570. package/types/config/types/file-operation.interface.d.ts +0 -12
  571. package/types/config/types/focus-change.interface.d.ts +0 -4
  572. package/types/config/types/fullscreen-module.interface.d.ts +0 -4
  573. package/types/config/types/help-panel-item.interface.d.ts +0 -5
  574. package/types/config/types/help-panel-option.interface.d.ts +0 -7
  575. package/types/config/types/image-module.interface.d.ts +0 -3
  576. package/types/config/types/image-upload.interface.d.ts +0 -7
  577. package/types/config/types/load-on-demand-module.interface.d.ts +0 -5
  578. package/types/config/types/mention-module.interface.d.ts +0 -8
  579. package/types/config/types/paste-change.interface.d.ts +0 -6
  580. package/types/config/types/quick-menu-module.interface.d.ts +0 -3
  581. package/types/config/types/range.interface.d.ts +0 -4
  582. package/types/config/types/registry-options.interface.d.ts +0 -5
  583. package/types/config/types/selection-change.interface.d.ts +0 -8
  584. package/types/config/types/toolbar-item.interface.d.ts +0 -13
  585. package/types/config/types/validate-error.interface.d.ts +0 -13
  586. package/types/modules/custom-image/BlotFormatter.d.ts +0 -29
  587. package/types/modules/custom-image/Options.d.ts +0 -36
  588. package/types/modules/custom-image/actions/Action.d.ts +0 -7
  589. package/types/modules/custom-image/actions/DeleteAction.d.ts +0 -7
  590. package/types/modules/custom-image/image-bar.d.ts +0 -15
  591. package/types/modules/custom-image/specs/BlotSpec.d.ts +0 -13
  592. package/types/modules/custom-image/specs/ImageSpec.d.ts +0 -10
  593. package/types/modules/emoji/emoji-list/index.d.ts +0 -1
  594. package/types/modules/emoji/emoji-list/people.d.ts +0 -1
  595. package/types/modules/emoji/emoji-list.d.ts +0 -2
  596. package/types/modules/emoji/emoji-map.d.ts +0 -2
  597. package/types/modules/emoji/emoji-sprite.d.ts +0 -1
  598. package/types/modules/emoji/formats/emoji-blot.d.ts +0 -13
  599. package/types/modules/emoji/index.d.ts +0 -10
  600. package/types/modules/emoji/modules/emoji.d.ts +0 -38
  601. package/types/modules/emoji/modules/toolbar-emoji.d.ts +0 -8
  602. package/types/modules/emoji/utils.d.ts +0 -1
@@ -1,15 +1,7 @@
1
1
  "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const Quill = require("quill");
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
3
  const link = require("./formats/link.cjs.js");
5
- const Module = Quill.import("core/module");
6
- class Link extends Module {
7
- static register() {
8
- Quill.register("blots/link", link.default, true);
9
- }
10
- constructor(quill, options) {
11
- super(quill, options);
12
- }
13
- }
14
- exports.default = Link;
4
+ const tooltip = require("./modules/tooltip.cjs.js");
5
+ exports.LinkBlot = link.LinkBlot;
6
+ exports.LinkTooltip = tooltip.LinkTooltip;
15
7
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../../../src/modules/link/index.ts"],"sourcesContent":["import Quill from 'quill'\r\nimport LinkBlot from './formats/link'\r\n\r\nconst Module = Quill.import('core/module')\r\n\r\n// @dynamic\r\nclass Link extends Module {\r\n static register() {\r\n Quill.register('blots/link', LinkBlot, true)\r\n }\r\n\r\n constructor(quill, options) {\r\n super(quill, options)\r\n }\r\n}\r\n\r\nexport default Link\r\n"],"names":["LinkBlot"],"mappings":";;;;AAGA,MAAM,SAAS,MAAM,OAAO,aAAa;AAGzC,MAAM,aAAa,OAAO;AAAA,EACxB,OAAO,WAAW;AACV,UAAA,SAAS,cAAcA,KAAAA,SAAU,IAAI;AAAA,EAAA;AAAA,EAG7C,YAAY,OAAO,SAAS;AAC1B,UAAM,OAAO,OAAO;AAAA,EAAA;AAExB;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,24 +1,33 @@
1
1
  "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
6
  const Quill = require("quill");
4
7
  const Emitter = require("quill/core/emitter");
5
8
  const base = require("quill/themes/base");
6
9
  require("../../../config/index.cjs.js");
7
10
  const editor_utils = require("../../../config/editor.utils.cjs.js");
11
+ const enUs = require("../../../config/i18n/en-us.cjs.js");
8
12
  const debounce = require("../../../utils/debounce.cjs.js");
9
13
  const link = require("../formats/link.cjs.js");
10
14
  const editor_config = require("../../../config/editor.config.cjs.js");
11
- const _Tooltip = class _Tooltip extends base.BaseTooltip {
15
+ class LinkTooltip extends base.BaseTooltip {
12
16
  constructor(quill, bounds) {
13
17
  super(quill, bounds);
14
- this.options = {
18
+ __publicField(this, "isInputFocus");
19
+ __publicField(this, "isHover");
20
+ __publicField(this, "debouncedHideToolTip");
21
+ __publicField(this, "debouncedShowToolTip");
22
+ __publicField(this, "options", {
15
23
  autoProtocol: "https"
16
- };
24
+ });
25
+ this.quill = quill;
17
26
  this.setTemplate();
18
27
  this.isInputFocus = false;
19
28
  this.isHover = false;
20
29
  this.resolveOptions();
21
- link.default.autoProtocol = this.options.autoProtocol;
30
+ link.LinkBlot.autoProtocol = this.options.autoProtocol;
22
31
  this.debouncedHideToolTip = debounce.debounce(this.hideToolTip, 300);
23
32
  this.debouncedShowToolTip = debounce.debounce(this.showToolTip, 300);
24
33
  this.quill.emitter.on(editor_config.CHANGE_LANGUAGE_EVENT, () => {
@@ -73,14 +82,14 @@ const _Tooltip = class _Tooltip extends base.BaseTooltip {
73
82
  }
74
83
  this.isHover = true;
75
84
  const linkNode = event.target;
76
- const preview = link.default.formats(linkNode);
77
- if (preview.startsWith("#")) {
85
+ const preview = link.LinkBlot.formats(linkNode);
86
+ if (!preview || preview.startsWith("#")) {
78
87
  return;
79
88
  }
80
89
  const linkBlot = Quill.find(linkNode);
81
90
  const index = this.quill.getIndex(linkBlot);
82
91
  const [link$1, offset] = this.quill.scroll.descendant(
83
- link.default,
92
+ link.LinkBlot,
84
93
  index
85
94
  );
86
95
  const length = link$1 && link$1.length();
@@ -102,7 +111,8 @@ const _Tooltip = class _Tooltip extends base.BaseTooltip {
102
111
  this.quill.root.addEventListener(
103
112
  "mouseover",
104
113
  (event) => {
105
- if ((event.target.tagName.toUpperCase() !== "A" || !event.target.classList.contains(link.default.className)) && !event.target.closest(`a.${link.default.className}`)) {
114
+ const target = event.target;
115
+ if ((target.tagName.toUpperCase() !== "A" || !target.classList.contains(link.LinkBlot.className)) && !target.closest(`a.${link.LinkBlot.className}`)) {
106
116
  return;
107
117
  }
108
118
  this.handleMouseEnter(event);
@@ -112,7 +122,8 @@ const _Tooltip = class _Tooltip extends base.BaseTooltip {
112
122
  this.quill.root.addEventListener(
113
123
  "mouseout",
114
124
  (event) => {
115
- if (event.target.tagName.toUpperCase() !== "A" && !event.target.closest(`a.${link.default.className}`)) {
125
+ const target = event.target;
126
+ if (target.tagName.toUpperCase() !== "A" && !target.closest(`a.${link.LinkBlot.className}`)) {
116
127
  return;
117
128
  }
118
129
  this.handleMouseLeave();
@@ -128,7 +139,7 @@ const _Tooltip = class _Tooltip extends base.BaseTooltip {
128
139
  );
129
140
  this.root.addEventListener("mouseleave", this.handleMouseLeave.bind(this), false);
130
141
  this.root.querySelector("a.ql-preview").addEventListener("click", (event) => {
131
- const link$1 = link.default.sanitize(this.textbox.value);
142
+ const link$1 = link.LinkBlot.sanitize(this.textbox.value);
132
143
  window.open(link$1, "_blank");
133
144
  event.preventDefault();
134
145
  });
@@ -145,12 +156,12 @@ const _Tooltip = class _Tooltip extends base.BaseTooltip {
145
156
  if (editor_utils.isNullOrUndefined(range)) return;
146
157
  if (source === Emitter.sources.USER) {
147
158
  const [link$1, offset] = this.quill.scroll.descendant(
148
- link.default,
159
+ link.LinkBlot,
149
160
  range.index
150
161
  );
151
162
  if (!editor_utils.isNullOrUndefined(link$1)) {
152
163
  this.linkRange = new Quill.Range(range.index - offset, link$1.length());
153
- const preview = link.default.formats(link$1.domNode);
164
+ const preview = link.LinkBlot.formats(link$1.domNode);
154
165
  if (!preview.startsWith("#")) {
155
166
  this.edit("link", preview, this.linkRange);
156
167
  }
@@ -169,7 +180,7 @@ const _Tooltip = class _Tooltip extends base.BaseTooltip {
169
180
  const index = selection && selection.index;
170
181
  setTimeout(() => {
171
182
  const link$1 = this.quill.scroll.descendant(
172
- link.default,
183
+ link.LinkBlot,
173
184
  index
174
185
  )[0];
175
186
  if (!link$1) {
@@ -294,13 +305,12 @@ const _Tooltip = class _Tooltip extends base.BaseTooltip {
294
305
  }
295
306
  return result;
296
307
  }
297
- };
298
- _Tooltip.TEMPLATE = [
299
- `<input type="text" data-formula="e=mc^2" data-link="${editor_config.LANG_CONF["en-US"].linkplaceholder}" data-video="Embed URL" style="width: 225px;">`,
308
+ }
309
+ __publicField(LinkTooltip, "TEMPLATE", [
310
+ `<input type="text" data-formula="e=mc^2" data-link="${enUs.EN_US.linkplaceholder}" data-video="Embed URL" style="width: 225px;">`,
300
311
  '<span class="ql-split"></span>',
301
312
  '<a class="ql-preview"><i class="icon-share"></i></a>',
302
313
  '<a class="ql-remove"><i class="icon-delete"></i></a>'
303
- ].join("");
304
- let Tooltip = _Tooltip;
305
- exports.default = Tooltip;
314
+ ].join(""));
315
+ exports.LinkTooltip = LinkTooltip;
306
316
  //# sourceMappingURL=tooltip.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.cjs.js","sources":["../../../../../src/modules/link/modules/tooltip.ts"],"sourcesContent":["import Quill, { Range } from 'quill'\r\nimport Emitter from 'quill/core/emitter'\r\nimport { BaseTooltip } from 'quill/themes/base'\r\nimport { CHANGE_LANGUAGE_EVENT, LANG_CONF } from '../../../config'\r\nimport { hadProtocol, isNullOrUndefined } from '../../../config/editor.utils'\r\nimport { debounce } from '../../../utils/debounce'\r\nimport LinkBlot from '../formats/link'\r\n\r\n// @dynamic\r\nexport default class Tooltip extends BaseTooltip {\r\n static TEMPLATE: string = [\r\n `<input type=\"text\" data-formula=\"e=mc^2\" data-link=\"${LANG_CONF['en-US'].linkplaceholder}\" data-video=\"Embed URL\" style=\"width: 225px;\">`,\r\n '<span class=\"ql-split\"></span>',\r\n '<a class=\"ql-preview\"><i class=\"icon-share\"></i></a>',\r\n '<a class=\"ql-remove\"><i class=\"icon-delete\"></i></a>',\r\n ].join('')\r\n\r\n isInputFocus: boolean\r\n isHover: boolean\r\n debouncedHideToolTip: any\r\n debouncedShowToolTip: any\r\n hide: any\r\n linkRange: any\r\n quill: any\r\n root: any\r\n restoreFocus: any\r\n textbox: any\r\n boundsContainer: any\r\n options: { autoProtocol: string } = {\r\n autoProtocol: 'https',\r\n }\r\n\r\n constructor(quill, bounds) {\r\n super(quill, bounds)\r\n this.setTemplate()\r\n this.isInputFocus = false\r\n this.isHover = false\r\n\r\n this.resolveOptions()\r\n LinkBlot.autoProtocol = this.options.autoProtocol\r\n this.debouncedHideToolTip = debounce(this.hideToolTip, 300)\r\n this.debouncedShowToolTip = debounce(this.showToolTip, 300)\r\n this.quill.emitter.on(CHANGE_LANGUAGE_EVENT, () => {\r\n this.setTemplate()\r\n })\r\n }\r\n\r\n setTemplate() {\r\n this.root.innerHTML = [\r\n `<input type=\"text\" data-formula=\"e=mc^2\" data-link=\"${this.quill.getLangText('linkplaceholder')}\" data-video=\"Embed URL\" style=\"width: 225px;\">`,\r\n '<span class=\"ql-split\"></span>',\r\n '<a class=\"ql-preview\"><i class=\"icon-share\"></i></a>',\r\n '<a class=\"ql-remove\"><i class=\"icon-delete\"></i></a>',\r\n ].join('')\r\n this.textbox = this.root.querySelector('input[type=\"text\"]')\r\n this.listen()\r\n }\r\n\r\n resolveOptions() {\r\n this.options = {\r\n autoProtocol: 'https',\r\n }\r\n const value = this.quill.options.autoProtocol\r\n if (value && typeof value === 'string') {\r\n this.options.autoProtocol = value\r\n }\r\n else if (typeof value === 'boolean' && !value) {\r\n this.options.autoProtocol = ''\r\n }\r\n }\r\n\r\n shouldHide() {\r\n return !this.isHover && !this.isInputFocus\r\n }\r\n\r\n hideToolTip() {\r\n if (this.shouldHide()) {\r\n this.hide()\r\n }\r\n }\r\n\r\n showToolTip(name, value, range) {\r\n if (!this.shouldHide()) {\r\n this.edit(name, value, range)\r\n }\r\n }\r\n\r\n handleMouseLeave() {\r\n this.isHover = false\r\n this.debouncedHideToolTip()\r\n }\r\n\r\n handleMouseEnter(event) {\r\n const isTooltipShow = !this.root.classList.contains('ql-hidden')\r\n if (isTooltipShow) {\r\n return\r\n }\r\n\r\n if (this.isInputFocus) {\r\n this.save()\r\n }\r\n this.isHover = true\r\n const linkNode = event.target\r\n const preview = LinkBlot.formats(linkNode)\r\n if (preview.startsWith('#')) {\r\n return\r\n }\r\n const linkBlot = Quill.find(linkNode)\r\n const index = this.quill.getIndex(linkBlot)\r\n const [link, offset] = this.quill.scroll.descendant(\r\n LinkBlot,\r\n index,\r\n )\r\n const length = link && link.length()\r\n this.linkRange = new Range(index - offset, length)\r\n this.debouncedShowToolTip('link', preview, this.linkRange)\r\n }\r\n\r\n listen() {\r\n super.listen()\r\n this.root.querySelector('a.ql-remove').addEventListener('click', (event) => {\r\n if (!isNullOrUndefined(this.linkRange)) {\r\n const range = this.linkRange\r\n this.restoreFocus()\r\n this.quill.formatText(range, 'link', false, Emitter.sources.API)\r\n delete this.linkRange\r\n }\r\n event.preventDefault()\r\n this.hide()\r\n })\r\n\r\n this.quill.root.addEventListener(\r\n 'mouseover',\r\n (event) => {\r\n if (\r\n (event.target.tagName.toUpperCase() !== 'A'\r\n || !event.target.classList.contains(LinkBlot.className))\r\n && !event.target.closest(`a.${LinkBlot.className}`)\r\n ) {\r\n return\r\n }\r\n this.handleMouseEnter(event)\r\n },\r\n false,\r\n )\r\n\r\n this.quill.root.addEventListener(\r\n 'mouseout',\r\n (event) => {\r\n if (event.target.tagName.toUpperCase() !== 'A' && !event.target.closest(`a.${LinkBlot.className}`)) {\r\n return\r\n }\r\n this.handleMouseLeave()\r\n },\r\n false,\r\n )\r\n\r\n this.root.addEventListener(\r\n 'mouseenter',\r\n () => {\r\n this.isHover = true\r\n },\r\n false,\r\n )\r\n\r\n this.root.addEventListener('mouseleave', this.handleMouseLeave.bind(this), false)\r\n\r\n this.root.querySelector('a.ql-preview').addEventListener('click', (event) => {\r\n const link = LinkBlot.sanitize(this.textbox.value)\r\n window.open(link, '_blank')\r\n event.preventDefault()\r\n })\r\n this.root.querySelector('input[type=\"text\"]').addEventListener('focus', () => {\r\n this.isInputFocus = true\r\n })\r\n this.root.querySelector('input[type=\"text\"]').addEventListener('blur', () => {\r\n this.isInputFocus = false\r\n this.save()\r\n })\r\n this.quill.on(\r\n Emitter.events.SELECTION_CHANGE,\r\n (range, _oldRange, source) => {\r\n if (isNullOrUndefined(range)) return\r\n if (source === Emitter.sources.USER) {\r\n const [link, offset] = this.quill.scroll.descendant(\r\n LinkBlot,\r\n range.index,\r\n )\r\n\r\n if (!isNullOrUndefined(link)) {\r\n this.linkRange = new Range(range.index - offset, link.length())\r\n const preview = LinkBlot.formats(link.domNode)\r\n if (!preview.startsWith('#')) {\r\n this.edit('link', preview, this.linkRange)\r\n }\r\n return\r\n }\r\n }\r\n if (this.shouldHide()) {\r\n this.hide()\r\n }\r\n },\r\n )\r\n this.quill.on(\r\n Emitter.events.TEXT_CHANGE,\r\n () => {\r\n const selection = this.quill.getSelection()\r\n const index = selection && selection.index\r\n setTimeout(() => {\r\n const link = this.quill.scroll.descendant(\r\n LinkBlot,\r\n index,\r\n )[0]\r\n if (!link) {\r\n this.handleMouseLeave()\r\n }\r\n })\r\n },\r\n )\r\n }\r\n\r\n save() {\r\n let value = this.textbox.value\r\n if (!value) return\r\n this.textbox.value = ''\r\n switch (this.root.getAttribute('data-mode')) {\r\n case 'link': {\r\n const { scrollTop } = this.quill.root\r\n if (this.options.autoProtocol) {\r\n value = this.addHttpProtocol(value)\r\n }\r\n\r\n if (this.linkRange) {\r\n this.quill.formatText(\r\n this.linkRange,\r\n 'link',\r\n value,\r\n Emitter.sources.USER,\r\n )\r\n this.restoreFocus()\r\n }\r\n else {\r\n this.restoreFocus()\r\n this.quill.format('link', value, Emitter.sources.USER)\r\n }\r\n this.quill.root.scrollTop = scrollTop\r\n break\r\n }\r\n case 'formula': {\r\n const range = this.quill.getSelection(true)\r\n if (!isNullOrUndefined(range)) {\r\n const index = range.index + range.length\r\n this.quill.insertEmbed(\r\n index,\r\n this.root.getAttribute('data-mode'),\r\n value,\r\n Emitter.sources.USER,\r\n )\r\n if (this.root.getAttribute('data-mode') === 'formula') {\r\n this.quill.insertText(index + 1, ' ', Emitter.sources.USER)\r\n }\r\n this.quill.setSelection(index + 2, Emitter.sources.USER)\r\n }\r\n break\r\n }\r\n case 'video': {\r\n const range = this.quill.getSelection(true)\r\n this.quill.insertText(range.index, '\\n', Emitter.sources.USER)\r\n this.quill.insertEmbed(range.index + 1, 'video', { src: value }, Emitter.sources.USER)\r\n this.quill.insertText(range.index + 2, '\\n', Emitter.sources.USER)\r\n this.quill.setSelection(range.index + 3, Emitter.sources.SILENT)\r\n this.textbox.value = ''\r\n this.hide()\r\n break\r\n }\r\n default:\r\n }\r\n }\r\n\r\n position(reference) {\r\n const left = reference.left\r\n const top = reference.bottom + this.quill.root.scrollTop\r\n this.root.style.left = `${left}px`\r\n this.root.style.top = `${top}px`\r\n this.root.classList.remove('ql-flip')\r\n const containerBounds = this.boundsContainer.getBoundingClientRect()\r\n const rootBounds = this.root.getBoundingClientRect()\r\n let shift = 0\r\n if (rootBounds.right > containerBounds.right) {\r\n shift = containerBounds.right - rootBounds.right\r\n this.root.style.left = `${left + shift}px`\r\n }\r\n if (rootBounds.left < containerBounds.left) {\r\n shift = containerBounds.left - rootBounds.left\r\n this.root.style.left = `${left + shift}px`\r\n }\r\n if (rootBounds.bottom > containerBounds.bottom) {\r\n const height = rootBounds.bottom - rootBounds.top\r\n const verticalShift = reference.bottom - reference.top + height\r\n const fixedTop = top - verticalShift\r\n this.root.style.top = `${fixedTop < 0 ? this.quill.root.scrollTop + reference.top : fixedTop}px`\r\n this.root.classList.add('ql-flip')\r\n }\r\n return shift\r\n }\r\n\r\n // @ts-expect-error\r\n edit(mode: string = 'link', preview = null, range) {\r\n this.linkRange = range || this.quill.selection.savedRange\r\n this.root.classList.remove('ql-hidden')\r\n this.root.classList.add('ql-editing')\r\n if (!isNullOrUndefined(preview)) {\r\n this.textbox.value = preview\r\n }\r\n else if (mode !== this.root.getAttribute('data-mode')) {\r\n this.textbox.value = ''\r\n }\r\n this.position(this.quill.getBounds(range || this.quill.selection.savedRange))\r\n if (this.textbox.value === '') {\r\n this.textbox.focus()\r\n }\r\n this.textbox.setAttribute(\r\n 'placeholder',\r\n this.textbox.getAttribute(`data-${mode}`) || '',\r\n )\r\n this.root.setAttribute('data-mode', mode)\r\n }\r\n\r\n show() {\r\n super.show()\r\n this.root.removeAttribute('data-mode')\r\n }\r\n\r\n addHttpProtocol(url: string) {\r\n let result = url\r\n if (!url) {\r\n return ''\r\n }\r\n if (!hadProtocol(url)) {\r\n result = `${this.options.autoProtocol}://${url}`\r\n }\r\n return result\r\n }\r\n}\r\n"],"names":["BaseTooltip","LinkBlot","debounce","CHANGE_LANGUAGE_EVENT","link","Range","isNullOrUndefined","hadProtocol","LANG_CONF"],"mappings":";;;;;;;;;;AASA,MAAqB,WAArB,MAAqB,iBAAgBA,KAAAA,YAAY;AAAA,EAuB/C,YAAY,OAAO,QAAQ;AACzB,UAAM,OAAO,MAAM;AALe,SAAA,UAAA;AAAA,MAClC,cAAc;AAAA,IAChB;AAIE,SAAK,YAAY;AACjB,SAAK,eAAe;AACpB,SAAK,UAAU;AAEf,SAAK,eAAe;AACXC,SAAAA,QAAA,eAAe,KAAK,QAAQ;AACrC,SAAK,uBAAuBC,SAAAA,SAAS,KAAK,aAAa,GAAG;AAC1D,SAAK,uBAAuBA,SAAAA,SAAS,KAAK,aAAa,GAAG;AAC1D,SAAK,MAAM,QAAQ,GAAGC,cAAA,uBAAuB,MAAM;AACjD,WAAK,YAAY;AAAA,IAAA,CAClB;AAAA,EAAA;AAA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EAAE;AANX,IAAqB,UAArB;;"}
1
+ {"version":3,"file":"tooltip.cjs.js","sources":["../../../../../src/modules/link/modules/tooltip.ts"],"sourcesContent":["import type { Parchment as TypeParchment } from 'quill'\nimport type FluentEditor from '../../../core/fluent-editor'\nimport Quill, { Range } from 'quill'\nimport Emitter from 'quill/core/emitter'\nimport { BaseTooltip } from 'quill/themes/base'\nimport { CHANGE_LANGUAGE_EVENT } from '../../../config'\nimport { hadProtocol, isNullOrUndefined } from '../../../config/editor.utils'\nimport { EN_US } from '../../../config/i18n/en-us'\nimport { debounce } from '../../../utils/debounce'\nimport { LinkBlot } from '../formats/link'\n\nexport class LinkTooltip extends BaseTooltip {\n static TEMPLATE: string = [\n `<input type=\"text\" data-formula=\"e=mc^2\" data-link=\"${EN_US.linkplaceholder}\" data-video=\"Embed URL\" style=\"width: 225px;\">`,\n '<span class=\"ql-split\"></span>',\n '<a class=\"ql-preview\"><i class=\"icon-share\"></i></a>',\n '<a class=\"ql-remove\"><i class=\"icon-delete\"></i></a>',\n ].join('')\n\n isInputFocus: boolean\n isHover: boolean\n debouncedHideToolTip: any\n debouncedShowToolTip: any\n options: { autoProtocol: string } = {\n autoProtocol: 'https',\n }\n\n constructor(public quill: FluentEditor, bounds) {\n super(quill, bounds)\n this.setTemplate()\n this.isInputFocus = false\n this.isHover = false\n\n this.resolveOptions()\n LinkBlot.autoProtocol = this.options.autoProtocol\n this.debouncedHideToolTip = debounce(this.hideToolTip, 300)\n this.debouncedShowToolTip = debounce(this.showToolTip, 300)\n this.quill.emitter.on(CHANGE_LANGUAGE_EVENT, () => {\n this.setTemplate()\n })\n }\n\n setTemplate() {\n this.root.innerHTML = [\n `<input type=\"text\" data-formula=\"e=mc^2\" data-link=\"${this.quill.getLangText('linkplaceholder')}\" data-video=\"Embed URL\" style=\"width: 225px;\">`,\n '<span class=\"ql-split\"></span>',\n '<a class=\"ql-preview\"><i class=\"icon-share\"></i></a>',\n '<a class=\"ql-remove\"><i class=\"icon-delete\"></i></a>',\n ].join('')\n this.textbox = this.root.querySelector('input[type=\"text\"]')\n this.listen()\n }\n\n resolveOptions() {\n this.options = {\n autoProtocol: 'https',\n }\n const value = this.quill.options.autoProtocol\n if (value && typeof value === 'string') {\n this.options.autoProtocol = value\n }\n else if (typeof value === 'boolean' && !value) {\n this.options.autoProtocol = ''\n }\n }\n\n shouldHide() {\n return !this.isHover && !this.isInputFocus\n }\n\n hideToolTip() {\n if (this.shouldHide()) {\n this.hide()\n }\n }\n\n showToolTip(name, value, range) {\n if (!this.shouldHide()) {\n this.edit(name, value, range)\n }\n }\n\n handleMouseLeave() {\n this.isHover = false\n this.debouncedHideToolTip()\n }\n\n handleMouseEnter(event: MouseEvent) {\n const isTooltipShow = !this.root.classList.contains('ql-hidden')\n if (isTooltipShow) {\n return\n }\n\n if (this.isInputFocus) {\n this.save()\n }\n this.isHover = true\n const linkNode = event.target as HTMLElement\n const preview = LinkBlot.formats(linkNode)\n if (!preview || preview.startsWith('#')) {\n return\n }\n const linkBlot = Quill.find(linkNode) as TypeParchment.Blot\n const index = this.quill.getIndex(linkBlot)\n const [link, offset] = this.quill.scroll.descendant(\n LinkBlot,\n index,\n )\n const length = link && link.length()\n this.linkRange = new Range(index - offset, length)\n this.debouncedShowToolTip('link', preview, this.linkRange)\n }\n\n listen() {\n super.listen()\n this.root.querySelector('a.ql-remove').addEventListener('click', (event) => {\n if (!isNullOrUndefined(this.linkRange)) {\n const range = this.linkRange\n this.restoreFocus()\n this.quill.formatText(range, 'link', false, Emitter.sources.API)\n delete this.linkRange\n }\n event.preventDefault()\n this.hide()\n })\n\n this.quill.root.addEventListener(\n 'mouseover',\n (event) => {\n const target = event.target as HTMLElement\n if (\n (target.tagName.toUpperCase() !== 'A'\n || !target.classList.contains(LinkBlot.className))\n && !target.closest(`a.${LinkBlot.className}`)\n ) {\n return\n }\n this.handleMouseEnter(event)\n },\n false,\n )\n\n this.quill.root.addEventListener(\n 'mouseout',\n (event) => {\n const target = event.target as HTMLElement\n if (target.tagName.toUpperCase() !== 'A' && !target.closest(`a.${LinkBlot.className}`)) {\n return\n }\n this.handleMouseLeave()\n },\n false,\n )\n\n this.root.addEventListener(\n 'mouseenter',\n () => {\n this.isHover = true\n },\n false,\n )\n\n this.root.addEventListener('mouseleave', this.handleMouseLeave.bind(this), false)\n\n this.root.querySelector('a.ql-preview').addEventListener('click', (event) => {\n const link = LinkBlot.sanitize(this.textbox.value)\n window.open(link, '_blank')\n event.preventDefault()\n })\n this.root.querySelector('input[type=\"text\"]').addEventListener('focus', () => {\n this.isInputFocus = true\n })\n this.root.querySelector('input[type=\"text\"]').addEventListener('blur', () => {\n this.isInputFocus = false\n this.save()\n })\n this.quill.on(\n Emitter.events.SELECTION_CHANGE,\n (range, _oldRange, source) => {\n if (isNullOrUndefined(range)) return\n if (source === Emitter.sources.USER) {\n const [link, offset] = this.quill.scroll.descendant(\n LinkBlot,\n range.index,\n )\n\n if (!isNullOrUndefined(link)) {\n this.linkRange = new Range(range.index - offset, link.length())\n const preview = LinkBlot.formats(link.domNode)\n if (!preview.startsWith('#')) {\n this.edit('link', preview, this.linkRange)\n }\n return\n }\n }\n if (this.shouldHide()) {\n this.hide()\n }\n },\n )\n this.quill.on(\n Emitter.events.TEXT_CHANGE,\n () => {\n const selection = this.quill.getSelection()\n const index = selection && selection.index\n setTimeout(() => {\n const link = this.quill.scroll.descendant(\n LinkBlot,\n index,\n )[0]\n if (!link) {\n this.handleMouseLeave()\n }\n })\n },\n )\n }\n\n save() {\n let value = this.textbox.value\n if (!value) return\n this.textbox.value = ''\n switch (this.root.getAttribute('data-mode')) {\n case 'link': {\n const { scrollTop } = this.quill.root\n if (this.options.autoProtocol) {\n value = this.addHttpProtocol(value)\n }\n\n if (this.linkRange) {\n this.quill.formatText(\n this.linkRange,\n 'link',\n value,\n Emitter.sources.USER,\n )\n this.restoreFocus()\n }\n else {\n this.restoreFocus()\n this.quill.format('link', value, Emitter.sources.USER)\n }\n this.quill.root.scrollTop = scrollTop\n break\n }\n case 'formula': {\n const range = this.quill.getSelection(true)\n if (!isNullOrUndefined(range)) {\n const index = range.index + range.length\n this.quill.insertEmbed(\n index,\n this.root.getAttribute('data-mode'),\n value,\n Emitter.sources.USER,\n )\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', Emitter.sources.USER)\n }\n this.quill.setSelection(index + 2, Emitter.sources.USER)\n }\n break\n }\n case 'video': {\n const range = this.quill.getSelection(true)\n this.quill.insertText(range.index, '\\n', Emitter.sources.USER)\n this.quill.insertEmbed(range.index + 1, 'video', { src: value }, Emitter.sources.USER)\n this.quill.insertText(range.index + 2, '\\n', Emitter.sources.USER)\n this.quill.setSelection(range.index + 3, Emitter.sources.SILENT)\n this.textbox.value = ''\n this.hide()\n break\n }\n default:\n }\n }\n\n position(reference) {\n const left = reference.left\n const top = reference.bottom + this.quill.root.scrollTop\n this.root.style.left = `${left}px`\n this.root.style.top = `${top}px`\n this.root.classList.remove('ql-flip')\n const containerBounds = this.boundsContainer.getBoundingClientRect()\n const rootBounds = this.root.getBoundingClientRect()\n let shift = 0\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right\n this.root.style.left = `${left + shift}px`\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left\n this.root.style.left = `${left + shift}px`\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n const height = rootBounds.bottom - rootBounds.top\n const verticalShift = reference.bottom - reference.top + height\n const fixedTop = top - verticalShift\n this.root.style.top = `${fixedTop < 0 ? this.quill.root.scrollTop + reference.top : fixedTop}px`\n this.root.classList.add('ql-flip')\n }\n return shift\n }\n\n // @ts-expect-error\n edit(mode: string = 'link', preview = null, range) {\n this.linkRange = range || this.quill.selection.savedRange\n this.root.classList.remove('ql-hidden')\n this.root.classList.add('ql-editing')\n if (!isNullOrUndefined(preview)) {\n this.textbox.value = preview\n }\n else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = ''\n }\n this.position(this.quill.getBounds(range || this.quill.selection.savedRange))\n if (this.textbox.value === '') {\n this.textbox.focus()\n }\n this.textbox.setAttribute(\n 'placeholder',\n this.textbox.getAttribute(`data-${mode}`) || '',\n )\n this.root.setAttribute('data-mode', mode)\n }\n\n show() {\n super.show()\n this.root.removeAttribute('data-mode')\n }\n\n addHttpProtocol(url: string) {\n let result = url\n if (!url) {\n return ''\n }\n if (!hadProtocol(url)) {\n result = `${this.options.autoProtocol}://${url}`\n }\n return result\n }\n}\n"],"names":["BaseTooltip","LinkBlot","debounce","CHANGE_LANGUAGE_EVENT","link","Range","isNullOrUndefined","hadProtocol","EN_US"],"mappings":";;;;;;;;;;;;;;AAWO,MAAM,oBAAoBA,KAAAA,YAAY;AAAA,EAgB3C,YAAmB,OAAqB,QAAQ;AAC9C,UAAM,OAAO,MAAM;AATrB;AACA;AACA;AACA;AACA,mCAAoC;AAAA,MAClC,cAAc;AAAA,IAChB;AAEmB,SAAA,QAAA;AAEjB,SAAK,YAAY;AACjB,SAAK,eAAe;AACpB,SAAK,UAAU;AAEf,SAAK,eAAe;AACXC,SAAAA,SAAA,eAAe,KAAK,QAAQ;AACrC,SAAK,uBAAuBC,SAAAA,SAAS,KAAK,aAAa,GAAG;AAC1D,SAAK,uBAAuBA,SAAAA,SAAS,KAAK,aAAa,GAAG;AAC1D,SAAK,MAAM,QAAQ,GAAGC,cAAA,uBAAuB,MAAM;AACjD,WAAK,YAAY;AAAA,IAAA,CAClB;AAAA,EAAA;AAAA,EAGH,cAAc;AACZ,SAAK,KAAK,YAAY;AAAA,MACpB,uDAAuD,KAAK,MAAM,YAAY,iBAAiB,CAAC;AAAA,MAChG;AAAA,MACA;AAAA,MACA;AAAA,IAAA,EACA,KAAK,EAAE;AACT,SAAK,UAAU,KAAK,KAAK,cAAc,oBAAoB;AAC3D,SAAK,OAAO;AAAA,EAAA;AAAA,EAGd,iBAAiB;AACf,SAAK,UAAU;AAAA,MACb,cAAc;AAAA,IAChB;AACM,UAAA,Q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U;AAC1C,SAAA,KAAK,UAAU,OAAO,WAAW;AACjC,SAAA,KAAK,UAAU,IAAI,YAAY;AAChC,QAAA,CAACA,aAAAA,kBAAkB,OAAO,GAAG;AAC/B,WAAK,QAAQ,QAAQ;AAAA,IAAA,WAEd,SAAS,KAAK,KAAK,aAAa,WAAW,GAAG;AACrD,WAAK,QAAQ,QAAQ;AAAA,IAAA;AAElB,SAAA,SAAS,KAAK,MAAM,UAAU,SAAS,KAAK,MAAM,UAAU,UAAU,CAAC;AACxE,QAAA,KAAK,QAAQ,UAAU,IAAI;AAC7B,WAAK,QAAQ,MAAM;AAAA,IAAA;AAErB,SAAK,QAAQ;AAAA,MACX;AAAA,MACA,KAAK,QAAQ,aAAa,QAAQ,IAAI,EAAE,KAAK;AAAA,IAC/C;AACK,SAAA,KAAK,aAAa,aAAa,IAAI;AAAA,EAAA;AAAA,EAG1C,OAAO;AACL,UAAM,KAAK;AACN,SAAA,KAAK,gBAAgB,WAAW;AAAA,EAAA;AAAA,EAGvC,gBAAgB,KAAa;AAC3B,QAAI,SAAS;AACb,QAAI,CAAC,KAAK;AACD,aAAA;AAAA,IAAA;AAEL,QAAA,CAACC,aAAAA,YAAY,GAAG,GAAG;AACrB,eAAS,GAAG,KAAK,QAAQ,YAAY,MAAM,GAAG;AAAA,IAAA;AAEzC,WAAA;AAAA,EAAA;AAEX;AAxUE,cADW,aACJ,YAAmB;AAAA,EACxB,uDAAuDC,KAAAA,MAAM,eAAe;AAAA,EAC5E;AAAA,EACA;AAAA,EACA;AAAA,EACA,KAAK,EAAE;;"}
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
6
  const Quill = require("quill");
4
7
  const Parchment = Quill.import("parchment");
5
- const _MathliveBlot = class _MathliveBlot extends Parchment.EmbedBlot {
8
+ class MathliveBlot extends Parchment.EmbedBlot {
6
9
  constructor(scroll, domNode) {
7
10
  super(scroll, domNode);
11
+ __publicField(this, "mode");
8
12
  this.domNode = domNode;
9
13
  domNode.setAttribute("contenteditable", "false");
10
14
  this.mode = domNode.getAttribute("mode") || "only-read";
@@ -27,10 +31,9 @@ const _MathliveBlot = class _MathliveBlot extends Parchment.EmbedBlot {
27
31
  const formula = this.domNode.value;
28
32
  return `<math-field class="ql-math-field view" contenteditable="false" mode="${this.mode}">${formula}</math-field>`;
29
33
  }
30
- };
31
- _MathliveBlot.blotName = "mathlive";
32
- _MathliveBlot.tagName = "math-field";
33
- _MathliveBlot.className = "ql-math-field";
34
- let MathliveBlot = _MathliveBlot;
35
- exports.default = MathliveBlot;
34
+ }
35
+ __publicField(MathliveBlot, "blotName", "mathlive");
36
+ __publicField(MathliveBlot, "tagName", "math-field");
37
+ __publicField(MathliveBlot, "className", "ql-math-field");
38
+ exports.MathliveBlot = MathliveBlot;
36
39
  //# sourceMappingURL=formats.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formats.cjs.js","sources":["../../../../src/modules/mathlive/formats.ts"],"sourcesContent":["import type { MathfieldElement } from 'mathlive'\r\nimport type { Root } from 'parchment'\r\nimport Quill from 'quill'\r\n\r\nconst Parchment = Quill.import('parchment')\r\ntype MathliveBlotMode = 'dialog' | 'only-read'\r\nexport default class MathliveBlot extends Parchment.EmbedBlot {\r\n static blotName = 'mathlive'\r\n static tagName = 'math-field'\r\n static className = 'ql-math-field'\r\n mode: MathliveBlotMode\r\n\r\n static create(obj: { value: string, mode: MathliveBlotMode }) {\r\n const el = super.create() as MathfieldElement\r\n el.setAttribute('mode', obj.mode)\r\n el.classList.add('view')\r\n el.innerHTML = obj.value\r\n el.setValue(obj.value)\r\n return el\r\n }\r\n\r\n static value(domNode: MathfieldElement) {\r\n return {\r\n value: domNode.value,\r\n mode: domNode.getAttribute('mode'),\r\n }\r\n }\r\n\r\n constructor(scroll: Root, public domNode: MathfieldElement) {\r\n super(scroll, domNode)\r\n domNode.setAttribute('contenteditable', 'false')\r\n this.mode = (domNode.getAttribute('mode') || 'only-read') as MathliveBlotMode\r\n }\r\n\r\n html() {\r\n const formula = this.domNode.value\r\n return `<math-field class=\"ql-math-field view\" contenteditable=\"false\" mode=\"${this.mode}\">${formula}</math-field>`\r\n }\r\n}\r\n"],"names":[],"mappings":";;;AAIA,MAAM,YAAY,MAAM,OAAO,WAAW;AAErB,MAAA,gBAAA,MAAA,sBAAqB,UAAU,UAAU;AAAA,EAsB5D,YAAY,QAAqB,SAA2B;AAC1D,UAAM,QAAQ,OAAO;AADU,SAAA,UAAA;AAEvB,YAAA,aAAa,mBAAmB,OAAO;AAC/C,SAAK,OAAQ,QAAQ,aAAa,MAAM,KAAK;AAAA,EAAA;AAAA,EAnB/C,OAAO,OAAO,KAAgD;AACtD,UAAA,KAAK,MAAM,OAAO;AACrB,OAAA,aAAa,QAAQ,IAAI,IAAI;AAC7B,OAAA,UAAU,IAAI,MAAM;AACvB,OAAG,YAAY,IAAI;AAChB,OAAA,SAAS,IAAI,KAAK;AACd,WAAA;AAAA,EAAA;AAAA,EAGT,OAAO,MAAM,SAA2B;AAC/B,WAAA;AAAA,MACL,OAAO,QAAQ;AAAA,MACf,MAAM,QAAQ,aAAa,MAAM;AAAA,IACnC;AAAA,EAAA;AAAA,EASF,OAAO;AACC,UAAA,UAAU,KAAK,QAAQ;AAC7B,WAAO,wEAAwE,KAAK,IAAI,KAAK,OAAO;AAAA,EAAA;AAExG;AA/BE,cAAO,WAAW;AAClB,cAAO,UAAU;AACjB,cAAO,YAAY;AAHA,IAAA,eAAA;;"}
1
+ {"version":3,"file":"formats.cjs.js","sources":["../../../../src/modules/mathlive/formats.ts"],"sourcesContent":["import type { MathfieldElement } from 'mathlive'\nimport type { Root } from 'parchment'\nimport Quill from 'quill'\n\nconst Parchment = Quill.import('parchment')\nexport type MathliveBlotMode = 'dialog' | 'only-read'\nexport class MathliveBlot extends Parchment.EmbedBlot {\n static blotName = 'mathlive'\n static tagName = 'math-field'\n static className = 'ql-math-field'\n mode: MathliveBlotMode\n\n static create(obj: { value: string, mode: MathliveBlotMode }) {\n const el = super.create() as MathfieldElement\n el.setAttribute('mode', obj.mode)\n el.classList.add('view')\n el.innerHTML = obj.value\n el.setValue(obj.value)\n return el\n }\n\n static value(domNode: MathfieldElement) {\n return {\n value: domNode.value,\n mode: domNode.getAttribute('mode'),\n }\n }\n\n constructor(scroll: Root, public domNode: MathfieldElement) {\n super(scroll, domNode)\n domNode.setAttribute('contenteditable', 'false')\n this.mode = (domNode.getAttribute('mode') || 'only-read') as MathliveBlotMode\n }\n\n html() {\n const formula = this.domNode.value\n return `<math-field class=\"ql-math-field view\" contenteditable=\"false\" mode=\"${this.mode}\">${formula}</math-field>`\n }\n}\n"],"names":[],"mappings":";;;;;;AAIA,MAAM,YAAY,MAAM,OAAO,WAAW;AAE7B,MAAA,qBAAqB,UAAU,UAAU;AAAA,EAsBpD,YAAY,QAAqB,SAA2B;AAC1D,UAAM,QAAQ,OAAO;AAnBvB;AAkBiC,SAAA,UAAA;AAEvB,YAAA,aAAa,mBAAmB,OAAO;AAC/C,SAAK,OAAQ,QAAQ,aAAa,MAAM,KAAK;AAAA,EAAA;AAAA,EAnB/C,OAAO,OAAO,KAAgD;AACtD,UAAA,KAAK,MAAM,OAAO;AACrB,OAAA,aAAa,QAAQ,IAAI,IAAI;AAC7B,OAAA,UAAU,IAAI,MAAM;AACvB,OAAG,YAAY,IAAI;AAChB,OAAA,SAAS,IAAI,KAAK;AACd,WAAA;AAAA,EAAA;AAAA,EAGT,OAAO,MAAM,SAA2B;AAC/B,WAAA;AAAA,MACL,OAAO,QAAQ;AAAA,MACf,MAAM,QAAQ,aAAa,MAAM;AAAA,IACnC;AAAA,EAAA;AAAA,EASF,OAAO;AACC,UAAA,UAAU,KAAK,QAAQ;AAC7B,WAAO,wEAAwE,KAAK,IAAI,KAAK,OAAO;AAAA,EAAA;AAExG;AA/BE,cADW,cACJ,YAAW;AAClB,cAFW,cAEJ,WAAU;AACjB,cAHW,cAGJ,aAAY;;"}
@@ -1,33 +1,9 @@
1
1
  "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const Quill = require("quill");
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
3
  const formats = require("./formats.cjs.js");
4
+ const module$1 = require("./module.cjs.js");
5
5
  const tooltip = require("./tooltip.cjs.js");
6
- class MathliveModule {
7
- constructor(quill) {
8
- this.quill = quill;
9
- this.tooltip = new tooltip.default(quill);
10
- this.quill.root.addEventListener(
11
- "click",
12
- (e) => {
13
- if (!this.quill.isEnabled()) return;
14
- const path = e.composedPath();
15
- if (!path || path.length <= 0) return;
16
- const mathliveNode = path.find((node) => node.tagName && node.tagName.toUpperCase() === formats.default.tagName.toUpperCase() && node.classList.contains(formats.default.className));
17
- const mathliveBlot = Quill.find(mathliveNode);
18
- if (mathliveBlot) {
19
- const { value, mode } = formats.default.value(mathliveBlot.domNode);
20
- if (mode === "dialog") {
21
- this.createDialog(value);
22
- }
23
- }
24
- },
25
- true
26
- );
27
- }
28
- createDialog(value) {
29
- this.tooltip.edit(value);
30
- }
31
- }
32
- exports.default = MathliveModule;
6
+ exports.MathliveBlot = formats.MathliveBlot;
7
+ exports.MathliveModule = module$1.MathliveModule;
8
+ exports.MathliveTooltip = tooltip.MathliveTooltip;
33
9
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../../../src/modules/mathlive/index.ts"],"sourcesContent":["import Quill from 'quill'\r\nimport MathliveBlot from './formats'\r\nimport MathliveTooltip from './tooltip'\r\n\r\nexport default class MathliveModule {\r\n tooltip: MathliveTooltip\r\n constructor(public quill: Quill) {\r\n this.tooltip = new MathliveTooltip(quill)\r\n\r\n this.quill.root.addEventListener(\r\n 'click',\r\n (e: MouseEvent) => {\r\n if (!this.quill.isEnabled()) return\r\n const path = e.composedPath() as HTMLElement[]\r\n if (!path || path.length <= 0) return\r\n\r\n const mathliveNode = path.find(node => node.tagName && node.tagName.toUpperCase() === MathliveBlot.tagName.toUpperCase() && node.classList.contains(MathliveBlot.className))\r\n const mathliveBlot = Quill.find(mathliveNode) as MathliveBlot | null\r\n if (mathliveBlot) {\r\n const { value, mode } = MathliveBlot.value(mathliveBlot.domNode)\r\n if (mode === 'dialog') {\r\n this.createDialog(value)\r\n }\r\n }\r\n },\r\n true,\r\n )\r\n }\r\n\r\n createDialog(value?: string) {\r\n this.tooltip.edit(value)\r\n }\r\n}\r\n"],"names":["MathliveTooltip","MathliveBlot"],"mappings":";;;;;AAIA,MAAqB,eAAe;AAAA,EAElC,YAAmB,OAAc;AAAd,SAAA,QAAA;AACZ,SAAA,UAAU,IAAIA,QAAA,QAAgB,KAAK;AAExC,SAAK,MAAM,KAAK;AAAA,MACd;AAAA,MACA,CAAC,MAAkB;AACjB,YAAI,CAAC,KAAK,MAAM,YAAa;AACvB,cAAA,OAAO,EAAE,aAAa;AAC5B,YAAI,CAAC,QAAQ,KAAK,UAAU,EAAG;AAE/B,cAAM,eAAe,KAAK,KAAK,UAAQ,KAAK,WAAW,KAAK,QAAQ,kBAAkBC,gBAAa,QAAQ,iBAAiB,KAAK,UAAU,SAASA,gBAAa,SAAS,CAAC;AACrK,cAAA,eAAe,MAAM,KAAK,YAAY;AAC5C,YAAI,cAAc;AAChB,gBAAM,EAAE,OAAO,SAASA,QAAa,QAAA,MAAM,aAAa,OAAO;AAC/D,cAAI,SAAS,UAAU;AACrB,iBAAK,aAAa,KAAK;AAAA,UAAA;AAAA,QACzB;AAAA,MAEJ;AAAA,MACA;AAAA,IACF;AAAA,EAAA;AAAA,EAGF,aAAa,OAAgB;AACtB,SAAA,QAAQ,KAAK,KAAK;AAAA,EAAA;AAE3B;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
6
+ const Quill = require("quill");
7
+ const formats = require("./formats.cjs.js");
8
+ const tooltip = require("./tooltip.cjs.js");
9
+ class MathliveModule {
10
+ constructor(quill) {
11
+ __publicField(this, "tooltip");
12
+ this.quill = quill;
13
+ this.tooltip = new tooltip.MathliveTooltip(quill);
14
+ this.quill.root.addEventListener(
15
+ "click",
16
+ (e) => {
17
+ if (!this.quill.isEnabled()) return;
18
+ const path = e.composedPath();
19
+ if (!path || path.length <= 0) return;
20
+ const mathliveNode = path.find((node) => node.tagName && node.tagName.toUpperCase() === formats.MathliveBlot.tagName.toUpperCase() && node.classList.contains(formats.MathliveBlot.className));
21
+ const mathliveBlot = Quill.find(mathliveNode);
22
+ if (mathliveBlot) {
23
+ const { value, mode } = formats.MathliveBlot.value(mathliveBlot.domNode);
24
+ if (mode === "dialog") {
25
+ this.createDialog(value);
26
+ }
27
+ }
28
+ },
29
+ true
30
+ );
31
+ }
32
+ static register() {
33
+ Quill.register({ [`formats/${formats.MathliveBlot.blotName}`]: formats.MathliveBlot }, true);
34
+ }
35
+ createDialog(value) {
36
+ this.tooltip.edit(value);
37
+ }
38
+ }
39
+ exports.MathliveModule = MathliveModule;
40
+ //# sourceMappingURL=module.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.cjs.js","sources":["../../../../src/modules/mathlive/module.ts"],"sourcesContent":["import Quill from 'quill'\r\nimport { MathliveBlot } from './formats'\r\nimport { MathliveTooltip } from './tooltip'\r\n\r\nexport class MathliveModule {\r\n tooltip: MathliveTooltip\r\n static register() {\r\n Quill.register({ [`formats/${MathliveBlot.blotName}`]: MathliveBlot }, true)\r\n }\r\n\r\n constructor(public quill: Quill) {\r\n this.tooltip = new MathliveTooltip(quill)\r\n\r\n this.quill.root.addEventListener(\r\n 'click',\r\n (e: MouseEvent) => {\r\n if (!this.quill.isEnabled()) return\r\n const path = e.composedPath() as HTMLElement[]\r\n if (!path || path.length <= 0) return\r\n\r\n const mathliveNode = path.find(node => node.tagName && node.tagName.toUpperCase() === MathliveBlot.tagName.toUpperCase() && node.classList.contains(MathliveBlot.className))\r\n const mathliveBlot = Quill.find(mathliveNode) as MathliveBlot | null\r\n if (mathliveBlot) {\r\n const { value, mode } = MathliveBlot.value(mathliveBlot.domNode)\r\n if (mode === 'dialog') {\r\n this.createDialog(value)\r\n }\r\n }\r\n },\r\n true,\r\n )\r\n }\r\n\r\n createDialog(value?: string) {\r\n this.tooltip.edit(value)\r\n }\r\n}\r\n"],"names":["MathliveTooltip","MathliveBlot"],"mappings":";;;;;;;;AAIO,MAAM,eAAe;AAAA,EAM1B,YAAmB,OAAc;AALjC;AAKmB,SAAA,QAAA;AACZ,SAAA,UAAU,IAAIA,QAAA,gBAAgB,KAAK;AAExC,SAAK,MAAM,KAAK;AAAA,MACd;AAAA,MACA,CAAC,MAAkB;AACjB,YAAI,CAAC,KAAK,MAAM,YAAa;AACvB,cAAA,OAAO,EAAE,aAAa;AAC5B,YAAI,CAAC,QAAQ,KAAK,UAAU,EAAG;AAE/B,cAAM,eAAe,KAAK,KAAK,UAAQ,KAAK,WAAW,KAAK,QAAQ,kBAAkBC,qBAAa,QAAQ,iBAAiB,KAAK,UAAU,SAASA,qBAAa,SAAS,CAAC;AACrK,cAAA,eAAe,MAAM,KAAK,YAAY;AAC5C,YAAI,cAAc;AAChB,gBAAM,EAAE,OAAO,SAASA,QAAa,aAAA,MAAM,aAAa,OAAO;AAC/D,cAAI,SAAS,UAAU;AACrB,iBAAK,aAAa,KAAK;AAAA,UAAA;AAAA,QACzB;AAAA,MAEJ;AAAA,MACA;AAAA,IACF;AAAA,EAAA;AAAA,EAxBF,OAAO,WAAW;AACV,UAAA,SAAS,EAAE,CAAC,WAAWA,qBAAa,QAAQ,EAAE,GAAGA,qBAAa,GAAG,IAAI;AAAA,EAAA;AAAA,EA0B7E,aAAa,OAAgB;AACtB,SAAA,QAAQ,KAAK,KAAK;AAAA,EAAA;AAE3B;;"}
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
6
  const Quill = require("quill");
4
7
  const is = require("../../utils/is.cjs.js");
5
8
  const Delta = Quill.import("delta");
6
9
  const Tooltip = Quill.import("ui/tooltip");
7
- const _MathliveTooltip = class _MathliveTooltip extends Tooltip {
10
+ class MathliveTooltip extends Tooltip {
8
11
  constructor(quill, boundsContainer) {
9
12
  super(quill, boundsContainer);
13
+ __publicField(this, "mathliveDom");
14
+ __publicField(this, "editValue");
10
15
  this.mathliveDom = document.createElement("math-field");
11
16
  this.mathliveDom.classList.add("ql-math-field");
12
17
  this.root.appendChild(this.mathliveDom);
@@ -67,8 +72,7 @@ const _MathliveTooltip = class _MathliveTooltip extends Tooltip {
67
72
  adjustedReference.left = reference.left + this.root.offsetWidth / 2 - reference.width / 2;
68
73
  return super.position(adjustedReference);
69
74
  }
70
- };
71
- _MathliveTooltip.TEMPLATE = ``;
72
- let MathliveTooltip = _MathliveTooltip;
73
- exports.default = MathliveTooltip;
75
+ }
76
+ __publicField(MathliveTooltip, "TEMPLATE", ``);
77
+ exports.MathliveTooltip = MathliveTooltip;
74
78
  //# sourceMappingURL=tooltip.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.cjs.js","sources":["../../../../src/modules/mathlive/tooltip.ts"],"sourcesContent":["import type { MathfieldElement } from 'mathlive'\r\nimport type { Bounds } from 'quill/core/selection'\r\nimport type TypeTooltip from 'quill/ui/tooltip'\r\nimport Quill from 'quill'\r\nimport { isString } from '../../utils/is'\r\n\r\nconst Delta = Quill.import('delta')\r\nconst Tooltip = Quill.import('ui/tooltip') as typeof TypeTooltip\r\nexport default class MathliveTooltip extends Tooltip {\r\n static TEMPLATE = ``\r\n\r\n mathliveDom: MathfieldElement\r\n editValue?: string\r\n\r\n constructor(quill: Quill, boundsContainer?: HTMLElement) {\r\n super(quill, boundsContainer)\r\n this.mathliveDom = document.createElement('math-field') as MathfieldElement\r\n this.mathliveDom.classList.add('ql-math-field')\r\n this.root.appendChild(this.mathliveDom)\r\n this.root.classList.add('math-field-tooltip')\r\n this.listen()\r\n }\r\n\r\n listen() {\r\n this.mathliveDom.addEventListener('blur', (event) => {\r\n this.hide()\r\n })\r\n this.root.addEventListener('keydown', (event) => {\r\n if (event.key === 'Enter') {\r\n event.preventDefault()\r\n this.save()\r\n }\r\n else if (event.key === 'Escape') {\r\n event.preventDefault()\r\n this.cancel()\r\n }\r\n })\r\n }\r\n\r\n cancel() {\r\n this.hide()\r\n this.restoreFocus()\r\n }\r\n\r\n edit(value?: string) {\r\n this.editValue = value\r\n this.root.classList.remove('ql-hidden')\r\n this.root.classList.add('ql-editing')\r\n this.mathliveDom.setValue(value || '')\r\n const range = this.quill.getSelection()\r\n const bounds = range ? this.quill.getBounds(range) : null\r\n if (bounds != null) {\r\n this.position(bounds)\r\n }\r\n this.show()\r\n this.mathliveDom.focus()\r\n }\r\n\r\n restoreFocus() {\r\n this.mathliveDom.blur()\r\n this.quill.focus({ preventScroll: true })\r\n }\r\n\r\n save() {\r\n const range = this.quill.getSelection(true)\r\n const inputValue = this.mathliveDom.value\r\n if (!inputValue) return\r\n const contentData = this.quill.getContents(range.index, 1).ops[0].insert\r\n let deleteCount = 0\r\n if (!isString(contentData) && contentData.mathlive) {\r\n deleteCount += 1\r\n }\r\n const delta = new Delta()\r\n .retain(range.index)\r\n .delete(Math.max(deleteCount, range.length))\r\n .insert({ mathlive: { value: inputValue, mode: 'dialog' } })\r\n this.quill.updateContents(delta, Quill.sources.USER)\r\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT)\r\n this.hide()\r\n }\r\n\r\n position(reference: Bounds) {\r\n const adjustedReference = { ...reference }\r\n adjustedReference.left = reference.left + this.root.offsetWidth / 2 - reference.width / 2\r\n return super.position(adjustedReference)\r\n }\r\n}\r\n"],"names":["isString"],"mappings":";;;;AAMA,MAAM,QAAQ,MAAM,OAAO,OAAO;AAClC,MAAM,UAAU,MAAM,OAAO,YAAY;AACzC,MAAqB,mBAArB,MAAqB,yBAAwB,QAAQ;AAAA,EAMnD,YAAY,OAAc,iBAA+B;AACvD,UAAM,OAAO,eAAe;AACvB,SAAA,cAAc,SAAS,cAAc,YAAY;AACjD,SAAA,YAAY,UAAU,IAAI,eAAe;AACzC,SAAA,KAAK,YAAY,KAAK,WAAW;AACjC,SAAA,KAAK,UAAU,IAAI,oBAAoB;AAC5C,SAAK,OAAO;AAAA,EAAA;AAAA,EAGd,SAAS;AACP,SAAK,YAAY,iBAAiB,QAAQ,CAAC,UAAU;AACnD,WAAK,KAAK;AAAA,IAAA,CACX;AACD,SAAK,KAAK,iBAAiB,WAAW,CAAC,UAAU;AAC3C,UAAA,MAAM,QAAQ,SAAS;AACzB,cAAM,eAAe;AACrB,aAAK,KAAK;AAAA,MAAA,WAEH,MAAM,QAAQ,UAAU;AAC/B,cAAM,eAAe;AACrB,aAAK,OAAO;AAAA,MAAA;AAAA,IACd,CACD;AAAA,EAAA;AAAA,EAGH,SAAS;AACP,SAAK,KAAK;AACV,SA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AAS,iBAAiB;AAAA,EAAA;AAE3C;AA7EE,iBAAO,WAAW;AADpB,IAAqB,kBAArB;;"}
1
+ {"version":3,"file":"tooltip.cjs.js","sources":["../../../../src/modules/mathlive/tooltip.ts"],"sourcesContent":["import type { MathfieldElement } from 'mathlive'\nimport type { Bounds } from 'quill/core/selection'\nimport type TypeTooltip from 'quill/ui/tooltip'\nimport Quill from 'quill'\nimport { isString } from '../../utils/is'\n\nconst Delta = Quill.import('delta')\nconst Tooltip = Quill.import('ui/tooltip') as typeof TypeTooltip\nexport class MathliveTooltip extends Tooltip {\n static TEMPLATE = ``\n\n mathliveDom: MathfieldElement\n editValue?: string\n\n constructor(quill: Quill, boundsContainer?: HTMLElement) {\n super(quill, boundsContainer)\n this.mathliveDom = document.createElement('math-field') as MathfieldElement\n this.mathliveDom.classList.add('ql-math-field')\n this.root.appendChild(this.mathliveDom)\n this.root.classList.add('math-field-tooltip')\n this.listen()\n }\n\n listen() {\n this.mathliveDom.addEventListener('blur', (event) => {\n this.hide()\n })\n this.root.addEventListener('keydown', (event) => {\n if (event.key === 'Enter') {\n event.preventDefault()\n this.save()\n }\n else if (event.key === 'Escape') {\n event.preventDefault()\n this.cancel()\n }\n })\n }\n\n cancel() {\n this.hide()\n this.restoreFocus()\n }\n\n edit(value?: string) {\n this.editValue = value\n this.root.classList.remove('ql-hidden')\n this.root.classList.add('ql-editing')\n this.mathliveDom.setValue(value || '')\n const range = this.quill.getSelection()\n const bounds = range ? this.quill.getBounds(range) : null\n if (bounds != null) {\n this.position(bounds)\n }\n this.show()\n this.mathliveDom.focus()\n }\n\n restoreFocus() {\n this.mathliveDom.blur()\n this.quill.focus({ preventScroll: true })\n }\n\n save() {\n const range = this.quill.getSelection(true)\n const inputValue = this.mathliveDom.value\n if (!inputValue) return\n const contentData = this.quill.getContents(range.index, 1).ops[0].insert\n let deleteCount = 0\n if (!isString(contentData) && contentData.mathlive) {\n deleteCount += 1\n }\n const delta = new Delta()\n .retain(range.index)\n .delete(Math.max(deleteCount, range.length))\n .insert({ mathlive: { value: inputValue, mode: 'dialog' } })\n this.quill.updateContents(delta, Quill.sources.USER)\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT)\n this.hide()\n }\n\n position(reference: Bounds) {\n const adjustedReference = { ...reference }\n adjustedReference.left = reference.left + this.root.offsetWidth / 2 - reference.width / 2\n return super.position(adjustedReference)\n }\n}\n"],"names":["isString"],"mappings":";;;;;;;AAMA,MAAM,QAAQ,MAAM,OAAO,OAAO;AAClC,MAAM,UAAU,MAAM,OAAO,YAAY;AAClC,MAAM,wBAAwB,QAAQ;AAAA,EAM3C,YAAY,OAAc,iBAA+B;AACvD,UAAM,OAAO,eAAe;AAJ9B;AACA;AAIO,SAAA,cAAc,SAAS,cAAc,YAAY;AACjD,SAAA,YAAY,UAAU,IAAI,eAAe;AACzC,SAAA,KAAK,YAAY,KAAK,WAAW;AACjC,SAAA,KAAK,UAAU,IAAI,oBAAoB;AAC5C,SAAK,OAAO;AAAA,EAAA;AAAA,EAGd,SAAS;AACP,SAAK,YAAY,iBAAiB,QAAQ,CAAC,UAAU;AACnD,WAAK,KAAK;AAAA,IAAA,CACX;AACD,SAAK,KAAK,iBAAiB,WAAW,CAAC,UAAU;AAC3C,UAAA,MAAM,QAAQ,SAAS;AACzB,cAAM,eAAe;AACrB,aAAK,KAAK;AAAA,MAAA,WAEH,MAAM,QAAQ,UAAU;AAC/B,cAAM,eAAe;AACrB,aAAK,OAAO;AAAA,MAAA;AAAA,IACd,CACD;AAAA,EAAA;AAAA,EAGH,SAAS;AACP,SAAK,KAAK;AACV,SAAK,aAAa;AAAA,EAAA;AAAA,EAGpB,KAAK,OAAgB;AACnB,SAAK,YAAY;AACZ,SAAA,KAAK,UAAU,OAAO,WAAW;AACjC,SAAA,KAAK,UAAU,IAAI,YAAY;AAC/B,SAAA,YAAY,SAAS,SAAS,EAAE;AAC/B,UAAA,QAAQ,KAAK,MAAM,aAAa;AACtC,UAAM,SAAS,QAAQ,KAAK,MAAM,UAAU,KAAK,IAAI;AACrD,QAAI,UAAU,MAAM;AAClB,WAAK,SAAS,MAAM;AAAA,IAAA;AAEtB,SAAK,KAAK;AACV,SAAK,YAAY,MAAM;AAAA,EAAA;AAAA,EAGzB,eAAe;AACb,SAAK,YAAY,KAAK;AACtB,SAAK,MAAM,MAAM,EAAE,eAAe,MAAM;AAAA,EAAA;AAAA,EAG1C,OAAO;AACL,UAAM,QAAQ,KAAK,MAAM,aAAa,IAAI;AACpC,UAAA,aAAa,KAAK,YAAY;AACpC,QAAI,CAAC,WAAY;AACX,UAAA,cAAc,KAAK,MAAM,YAAY,MAAM,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE;AAClE,QAAI,cAAc;AAClB,QAAI,CAACA,GAAAA,SAAS,WAAW,KAAK,YAAY,UAAU;AACnC,qBAAA;AAAA,IAAA;AAEX,UAAA,QAAQ,IAAI,MAAA,EACf,OAAO,MAAM,KAAK,EAClB,OAAO,KAAK,IAAI,aAAa,MAAM,MAAM,CAAC,EAC1C,OAAO,EAAE,UAAU,EAAE,OAAO,YAAY,MAAM,SAAS,GAAG;AAC7D,SAAK,MAAM,eAAe,OAAO,MAAM,QAAQ,IAAI;AACnD,SAAK,MAAM,aAAa,MAAM,QAAQ,GAAG,MAAM,QAAQ,MAAM;AAC7D,SAAK,KAAK;AAAA,EAAA;AAAA,EAGZ,SAAS,WAAmB;AACpB,UAAA,oBAAoB,EAAE,GAAG,UAAU;AACvB,sBAAA,OAAO,UAAU,OAAO,KAAK,KAAK,cAAc,IAAI,UAAU,QAAQ;AACjF,WAAA,MAAM,SAAS,iBAAiB;AAAA,EAAA;AAE3C;AA7EE,cADW,iBACJ,YAAW;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs.js","sources":["../../../../src/modules/mention/constants.ts"],"sourcesContent":["export const ON_MENTION_LINK_REMOVE = 'mention-link/remove'\r\nexport const MENTION_CHAR = 'mentionChar'\r\nexport const DEFAULT_MENTION_CHAR = '@'\r\n"],"names":[],"mappings":";;AAAO,MAAM,yBAAyB;AAC/B,MAAM,eAAe;AACrB,MAAM,uBAAuB;;;;"}
1
+ {"version":3,"file":"constants.cjs.js","sources":["../../../../src/modules/mention/constants.ts"],"sourcesContent":["export const ON_MENTION_LINK_REMOVE = 'mention-link/remove'\nexport const MENTION_CHAR = 'mentionChar'\nexport const DEFAULT_MENTION_CHAR = '@'\n"],"names":[],"mappings":";;AAAO,MAAM,yBAAyB;AAC/B,MAAM,eAAe;AACrB,MAAM,uBAAuB;;;;"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const mention = require("./mention.cjs.js");
4
+ const mentionLink = require("./mention-link.cjs.js");
5
+ exports.Mention = mention.Mention;
6
+ exports.MentionLink = mentionLink.MentionLink;
7
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,9 +1,18 @@
1
1
  "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
6
  const Quill = require("quill");
4
7
  const constants = require("./constants.cjs.js");
5
8
  const Embed = Quill.import("blots/embed");
6
9
  class MentionLink extends Embed {
10
+ constructor(scroll, domNode, data) {
11
+ super(scroll, domNode);
12
+ __publicField(this, "mentionData");
13
+ this.scroll = scroll;
14
+ this.mentionData = data;
15
+ }
7
16
  static create(data) {
8
17
  let node;
9
18
  if (data.link) {
@@ -32,10 +41,6 @@ class MentionLink extends Embed {
32
41
  }
33
42
  return value;
34
43
  }
35
- constructor(scroll, domNode, data) {
36
- super(scroll, domNode);
37
- this.mentionData = data;
38
- }
39
44
  value() {
40
45
  return super.value();
41
46
  }
@@ -44,8 +49,11 @@ class MentionLink extends Embed {
44
49
  return super.remove();
45
50
  }
46
51
  }
52
+ __publicField(MentionLink, "blotName");
53
+ __publicField(MentionLink, "tagName");
54
+ __publicField(MentionLink, "className");
47
55
  MentionLink.blotName = "mention";
48
56
  MentionLink.tagName = "span";
49
57
  MentionLink.className = "ql-mention-link";
50
- exports.default = MentionLink;
51
- //# sourceMappingURL=MentionLink.cjs.js.map
58
+ exports.MentionLink = MentionLink;
59
+ //# sourceMappingURL=mention-link.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mention-link.cjs.js","sources":["../../../../src/modules/mention/mention-link.ts"],"sourcesContent":["import type TypeEmbed from 'quill/blots/embed'\nimport type TypeScroll from 'quill/blots/scroll'\nimport Quill from 'quill'\nimport { DEFAULT_MENTION_CHAR, MENTION_CHAR, ON_MENTION_LINK_REMOVE } from './constants'\n\nconst Embed = Quill.import('blots/embed') as typeof TypeEmbed\n\nexport class MentionLink extends Embed {\n static blotName: string\n static tagName: string\n static className: string\n mentionData: any\n\n static create(data) {\n let node: HTMLElement\n if (data.link) {\n node = document.createElement('a')\n node.setAttribute('href', data.link)\n node.setAttribute('target', data.target)\n }\n else {\n node = document.createElement(this.tagName)\n }\n node.classList.add(this.className)\n node.dataset.mentionId = data.name || (data.mention && data.mention[data.searchKey || 'name']) || ''\n node.setAttribute('title', data.text)\n node.setAttribute(MENTION_CHAR, data.char)\n node.textContent = data.char + data.text\n return node\n }\n\n static value(domNode: HTMLElement) {\n const value: Record<string, any> = {\n char: domNode.getAttribute(MENTION_CHAR) || DEFAULT_MENTION_CHAR,\n text: domNode.getAttribute('title'),\n name: domNode.dataset.mentionId,\n }\n if (domNode.tagName.toLowerCase() === 'a' && domNode.hasAttribute('href')) {\n value.link = domNode.getAttribute('href')\n value.target = domNode.getAttribute('target')\n }\n return value\n }\n\n constructor(public scroll: TypeScroll, domNode, data) {\n super(scroll, domNode)\n this.mentionData = data\n }\n\n value() {\n // fix: 将@提醒内容加入到 Delta 里,以解决输入空格,@提醒内容被删除的问题\n // return ' ';\n return super.value()\n }\n\n remove() {\n this.scroll.emitter.emit(ON_MENTION_LINK_REMOVE, this.mentionData)\n return super.remove()\n }\n}\n\nMentionLink.blotName = 'mention'\nMentionLink.tagName = 'span'\nMentionLink.className = 'ql-mention-link'\n"],"names":["MENTION_CHAR","DEFAULT_MENTION_CHAR","ON_MENTION_LINK_REMOVE"],"mappings":";;;;;;;AAKA,MAAM,QAAQ,MAAM,OAAO,aAAa;AAEjC,MAAM,oBAAoB,MAAM;AAAA,EAqCrC,YAAmB,QAAoB,SAAS,MAAM;AACpD,UAAM,QAAQ,OAAO;AAlCvB;AAiCmB,SAAA,SAAA;AAEjB,SAAK,cAAc;AAAA,EAAA;AAAA,EAjCrB,OAAO,OAAO,MAAM;AACd,QAAA;AACJ,QAAI,KAAK,MAAM;AACN,aAAA,SAAS,cAAc,GAAG;AAC5B,WAAA,aAAa,QAAQ,KAAK,IAAI;AAC9B,WAAA,aAAa,UAAU,KAAK,MAAM;AAAA,IAAA,OAEpC;AACI,aAAA,SAAS,cAAc,KAAK,OAAO;AAAA,IAAA;AAEvC,SAAA,UAAU,IAAI,KAAK,SAAS;AAC5B,SAAA,QAAQ,YAAY,KAAK,QAAS,KAAK,WAAW,KAAK,QAAQ,KAAK,aAAa,MAAM,KAAM;AAC7F,SAAA,aAAa,SAAS,KAAK,IAAI;AAC/B,SAAA,aAAaA,wBAAc,KAAK,IAAI;AACpC,SAAA,cAAc,KAAK,OAAO,KAAK;AAC7B,WAAA;AAAA,EAAA;AAAA,EAGT,OAAO,MAAM,SAAsB;AACjC,UAAM,QAA6B;AAAA,MACjC,MAAM,QAAQ,aAAaA,UAAAA,YAAY,KAAKC,UAAA;AAAA,MAC5C,MAAM,QAAQ,aAAa,OAAO;AAAA,MA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