@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
@@ -0,0 +1,670 @@
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 constants = require("./constants.cjs.js");
7
+ const icons = require("./icons.cjs.js");
8
+ class AI {
9
+ constructor(quill, options) {
10
+ __publicField(this, "toolbar");
11
+ __publicField(this, "host");
12
+ __publicField(this, "apiKey");
13
+ __publicField(this, "model");
14
+ __publicField(this, "message");
15
+ __publicField(this, "isBreak", false);
16
+ // 打断标记
17
+ __publicField(this, "textNumber");
18
+ // 文本字数限制
19
+ __publicField(this, "_isSelectRangeMode", false);
20
+ // 选择/点击模式
21
+ __publicField(this, "_charCount", 0);
22
+ // 文本字数
23
+ __publicField(this, "_debounceTimer", null);
24
+ __publicField(this, "_inputPlaceholder", "");
25
+ __publicField(this, "_showOperationMenu", false);
26
+ __publicField(this, "_isThinking", false);
27
+ // 思考中
28
+ __publicField(this, "_showResultPopupEl", false);
29
+ // 结果弹窗
30
+ __publicField(this, "selectedText", "");
31
+ // 选择的文本
32
+ __publicField(this, "inputValue", "");
33
+ // 存储输入框的值
34
+ __publicField(this, "resultMenuList", []);
35
+ __publicField(this, "operationMenuList", []);
36
+ __publicField(this, "_operationMenuItemList", []);
37
+ __publicField(this, "alertEl", null);
38
+ __publicField(this, "alertTimer", null);
39
+ __publicField(this, "selectionBubbleEl", null);
40
+ __publicField(this, "selectionRange", null);
41
+ __publicField(this, "dialogContainerEl", null);
42
+ __publicField(this, "wrapContainerEl", null);
43
+ __publicField(this, "aiIconEl", null);
44
+ __publicField(this, "inputContainerEl", null);
45
+ __publicField(this, "inputEl", null);
46
+ __publicField(this, "menuContainerEl", null);
47
+ __publicField(this, "subMenuEl", null);
48
+ __publicField(this, "subMenuEditorEl", null);
49
+ __publicField(this, "subMenuToneEl", null);
50
+ __publicField(this, "subMenuAdjustEl", null);
51
+ __publicField(this, "inputRightEl", null);
52
+ __publicField(this, "inputSendBtnEl", null);
53
+ __publicField(this, "inputCloseBtnEl", null);
54
+ __publicField(this, "thinkContainerEl", null);
55
+ // 思考元素
56
+ __publicField(this, "thinkBtnEl", null);
57
+ __publicField(this, "resultPopupEl", null);
58
+ __publicField(this, "resultPopupHeaderEl", null);
59
+ __publicField(this, "resultPopupContentEl", null);
60
+ __publicField(this, "resultPopupFooterEl", null);
61
+ __publicField(this, "resultPopupFooterTextEl", null);
62
+ __publicField(this, "resultRefreshBtnEl", null);
63
+ __publicField(this, "resultCopyBtnEl", null);
64
+ // 分享和朗读功能待放开
65
+ // private resultShareBtnEl: HTMLSpanElement | null = null
66
+ // private resultVoiceBtnEl: HTMLSpanElement | null = null
67
+ __publicField(this, "actionMenuEl", null);
68
+ this.quill = quill;
69
+ this.options = options;
70
+ this.quill = quill;
71
+ this.toolbar = quill.getModule("toolbar");
72
+ if (typeof this.toolbar !== "undefined") {
73
+ this.toolbar.addHandler("ai", this.showAIInput.bind(this));
74
+ }
75
+ this.quill.on("selection-change", this.handleSelectionChange.bind(this));
76
+ this.host = options.host || "https://api.deepseek.com/v1";
77
+ this.apiKey = options.apiKey;
78
+ this.model = options.model || "deepseek-chat";
79
+ this.textNumber = options.contentMaxLength || 5e3;
80
+ this.resultMenuList = [
81
+ { text: constants.REPLACE_SELECT, icon: icons.REPLACE_SELECT_ICON },
82
+ { text: constants.INSERT_TEXT, icon: icons.INSERT_ICON, selectText: constants.INSERT_SUB_CONTENT_TEXT },
83
+ { text: constants.REGENERATE, icon: icons.REBUILD_ICON },
84
+ { text: constants.CLOSE, icon: icons.MENU_CLOSE_ICON }
85
+ ];
86
+ this.operationMenuList = [
87
+ { id: "editor", text: "编辑调整内容", icon: icons.EDITOR_ICON },
88
+ { id: "tone", text: "改写口吻", icon: icons.CALL_ICON },
89
+ { id: "adjust", text: "整理选区内容", icon: icons.ADJUST_ICON }
90
+ ];
91
+ }
92
+ // 工具栏启动
93
+ showAIInput() {
94
+ this.create();
95
+ this.selectionRange = this.quill.getSelection();
96
+ if (this.selectionRange.length) {
97
+ this.isSelectRangeMode = true;
98
+ } else {
99
+ this.isSelectRangeMode = false;
100
+ }
101
+ this.positionElements();
102
+ const handleKeyDown = (e) => {
103
+ if (e.key === "Escape") {
104
+ this.closeAIPanel();
105
+ this.quill.container.removeEventListener("keydown", handleKeyDown);
106
+ }
107
+ };
108
+ this.quill.container.addEventListener("keydown", handleKeyDown);
109
+ }
110
+ // 气泡启动
111
+ selectTextEvent() {
112
+ if (!this.selectionRange) return;
113
+ this.create();
114
+ this.positionElements();
115
+ this.isSelectRangeMode = true;
116
+ }
117
+ create() {
118
+ this.createResultElement();
119
+ this.createOperationMenuElements();
120
+ this.createInputBoxElements();
121
+ this.addInputEvent();
122
+ this.addResultEvent();
123
+ this.handleActionMenuDisplay();
124
+ this.quill.container.appendChild(this.dialogContainerEl);
125
+ }
126
+ // 创建结果弹窗
127
+ createResultElement() {
128
+ if (!this.resultPopupEl) {
129
+ this.resultPopupEl = document.createElement("div");
130
+ this.resultPopupEl.className = "ql-ai-result";
131
+ this.resultPopupHeaderEl = document.createElement("div");
132
+ this.resultPopupHeaderEl.className = "ql-ai-result-header";
133
+ this.resultPopupHeaderEl.textContent = constants.RESULT_HEADER_TEXT;
134
+ this.resultPopupContentEl = document.createElement("div");
135
+ this.resultPopupContentEl.className = "ql-ai-result-content";
136
+ this.resultPopupFooterEl = document.createElement("div");
137
+ this.resultPopupFooterEl.className = "ql-ai-result-footer";
138
+ this.resultPopupFooterTextEl = document.createElement("span");
139
+ this.resultPopupFooterTextEl.className = "ql-ai-result-footer-text";
140
+ this.resultPopupFooterTextEl.textContent = `0`;
141
+ this.resultRefreshBtnEl = document.createElement("span");
142
+ this.resultRefreshBtnEl.className = "ql-ai-result-footer-refresh";
143
+ this.resultRefreshBtnEl.innerHTML = icons.REFRESH_ICON;
144
+ this.resultCopyBtnEl = document.createElement("span");
145
+ this.resultCopyBtnEl.className = "ql-ai-result-footer-copy";
146
+ this.resultCopyBtnEl.innerHTML = icons.COPY_ICON;
147
+ const resultFooterRightEl = document.createElement("div");
148
+ resultFooterRightEl.className = "ql-ai-result-footer-right";
149
+ resultFooterRightEl.appendChild(this.resultRefreshBtnEl);
150
+ resultFooterRightEl.appendChild(this.resultCopyBtnEl);
151
+ this.resultPopupFooterEl.appendChild(this.resultPopupFooterTextEl);
152
+ this.resultPopupFooterEl.appendChild(resultFooterRightEl);
153
+ this.resultPopupEl.appendChild(this.resultPopupHeaderEl);
154
+ this.resultPopupEl.appendChild(this.resultPopupContentEl);
155
+ this.resultPopupEl.appendChild(this.resultPopupFooterEl);
156
+ }
157
+ this.showResultPopupEl = false;
158
+ }
159
+ createOperationMenuElements() {
160
+ if (!this.menuContainerEl) {
161
+ this.menuContainerEl = document.createElement("div");
162
+ this.menuContainerEl.className = "ql-ai-menu-container";
163
+ const mainMenu = document.createElement("div");
164
+ mainMenu.className = "ql-ai-main-menu";
165
+ this.operationMenuList.forEach(({ text, icon, id }) => {
166
+ const menuItem = document.createElement("div");
167
+ menuItem.className = "ql-ai-menu-item";
168
+ menuItem.innerHTML = `${icon}<span>${text}</span>${icons.RIGHT_ARROW_ICON}`;
169
+ menuItem.addEventListener("mouseenter", (e) => {
170
+ e.stopPropagation();
171
+ this.subMenuEl.style.display = "block";
172
+ this.subMenuEl.className = `ql-ai-sub-menu ${id}`;
173
+ this.createOperationMenuItem(id);
174
+ });
175
+ mainMenu.appendChild(menuItem);
176
+ });
177
+ if (!this.subMenuEl) {
178
+ this.subMenuEl = document.createElement("div");
179
+ this.subMenuEl.className = "ql-ai-sub-menu";
180
+ this.subMenuEl.style.display = "none";
181
+ }
182
+ this.menuContainerEl.appendChild(mainMenu);
183
+ this.menuContainerEl.appendChild(this.subMenuEl);
184
+ }
185
+ this.showOperationMenu = false;
186
+ }
187
+ createOperationMenuItem(id) {
188
+ let menuItemBox = this[constants.MENU_ID_MAP[id]];
189
+ if (!menuItemBox) {
190
+ menuItemBox = document.createElement("div");
191
+ }
192
+ while (this.subMenuEl.firstChild) {
193
+ this.subMenuEl.removeChild(this.subMenuEl.firstChild);
194
+ }
195
+ constants.MENU_TITLE_DATA[id].forEach(({ text, icon, id: id2 }) => {
196
+ const menuItem = document.createElement("div");
197
+ menuItem.className = "ql-ai-menu-item";
198
+ menuItem.innerHTML = `${icon || ""}<span>${text}</span>`;
199
+ menuItem.addEventListener("click", (e) => {
200
+ e.stopPropagation();
201
+ this.handleOperationMenuItemClick(text, id2);
202
+ });
203
+ menuItemBox.appendChild(menuItem);
204
+ });
205
+ this.subMenuEl.appendChild(menuItemBox);
206
+ }
207
+ createInputBoxElements() {
208
+ if (!this.dialogContainerEl) {
209
+ this.dialogContainerEl = document.createElement("div");
210
+ this.dialogContainerEl.className = "ql-ai-dialog";
211
+ this.wrapContainerEl = document.createElement("div");
212
+ this.wrapContainerEl.className = "ql-ai-wrapper";
213
+ this.wrapContainerEl.style.width = `${this.quill.container.clientWidth - 30}px`;
214
+ this.createAIInputIcon();
215
+ this.inputEl = document.createElement("input");
216
+ this.inputEl.type = "text";
217
+ this.inputPlaceholder = this._isSelectRangeMode ? constants.SELECT_PLACEHOLDER : constants.INPUT_PLACEHOLDER;
218
+ this.inputSendBtnEl = document.createElement("span");
219
+ this.inputSendBtnEl.className = "ql-ai-input-right-send";
220
+ this.inputSendBtnEl.innerHTML = icons.SEND_BTN_ICON;
221
+ this.inputCloseBtnEl = document.createElement("span");
222
+ this.inputCloseBtnEl.className = "ql-ai-input-right-close";
223
+ this.inputCloseBtnEl.innerHTML = icons.CLOSE_ICON;
224
+ this.inputRightEl = document.createElement("div");
225
+ this.inputRightEl.className = "ql-ai-input-right";
226
+ this.inputContainerEl = document.createElement("div");
227
+ this.inputContainerEl.className = "ql-ai-input";
228
+ this.inputContainerEl.appendChild(this.aiIconEl);
229
+ this.inputContainerEl.appendChild(this.inputEl);
230
+ this.inputRightEl.appendChild(this.inputSendBtnEl);
231
+ this.inputRightEl.appendChild(this.inputCloseBtnEl);
232
+ this.inputContainerEl.appendChild(this.inputRightEl);
233
+ this.wrapContainerEl.appendChild(this.resultPopupEl);
234
+ this.wrapContainerEl.appendChild(this.inputContainerEl);
235
+ this.wrapContainerEl.appendChild(this.menuContainerEl);
236
+ this.dialogContainerEl.appendChild(this.wrapContainerEl);
237
+ } else {
238
+ this.dialogContainerEl.style.display = "block";
239
+ }
240
+ this.hiddenInputSendBtnEl();
241
+ }
242
+ hiddenInputSendBtnEl(display = "none") {
243
+ if (this.inputEl && this.inputSendBtnEl) {
244
+ this.inputSendBtnEl.style.display = display;
245
+ }
246
+ }
247
+ copyResult() {
248
+ if (!this.resultPopupContentEl) return;
249
+ try {
250
+ const textToCopy = this.resultPopupContentEl.textContent || "";
251
+ navigator.clipboard.writeText(textToCopy).then(() => {
252
+ this.showAlert("内容已复制到剪贴板");
253
+ }).catch((err) => {
254
+ this.showAlert(`复制失败:${err}`);
255
+ });
256
+ } catch (err) {
257
+ this.showAlert(`复制失败:${err}`);
258
+ const textarea = document.createElement("textarea");
259
+ textarea.value = this.resultPopupContentEl.textContent || "";
260
+ document.body.appendChild(textarea);
261
+ textarea.select();
262
+ document.execCommand("copy");
263
+ document.body.removeChild(textarea);
264
+ }
265
+ }
266
+ // 分享和朗读功能待放开
267
+ // private shareResult() {
268
+ // if (!this.resultPopupContentEl) return
269
+ // const textToShare = this.resultPopupContentEl.textContent || ''
270
+ // const title = 'AI生成内容分享'
271
+ // if (navigator.share) {
272
+ // navigator.share({
273
+ // title,
274
+ // text: textToShare,
275
+ // })
276
+ // .catch((err) => {
277
+ // this.showAlert(`分享失败:${err}`)
278
+ // })
279
+ // }
280
+ // else {
281
+ // // 兼容不支持Web Share API的浏览器
282
+ // const shareUrl = `mailto:?subject=${encodeURIComponent(title)}&body=${encodeURIComponent(textToShare)}`
283
+ // window.open(shareUrl, '_blank')
284
+ // }
285
+ // }
286
+ // private voiceResult() {
287
+ // if (!this.resultPopupContentEl) return
288
+ // const textToSpeak = this.resultPopupContentEl.textContent || ''
289
+ // if ('speechSynthesis' in window) {
290
+ // const utterance = new SpeechSynthesisUtterance(textToSpeak)
291
+ // utterance.lang = 'zh-CN' // 设置中文语音
292
+ // speechSynthesis.speak(utterance)
293
+ // }
294
+ // else {
295
+ // this.showAlert('当前浏览器不支持语音合成API')
296
+ // // 可以在这里添加不支持语音的提示
297
+ // }
298
+ // }
299
+ addResultEvent() {
300
+ if (this.resultRefreshBtnEl) {
301
+ this.resultRefreshBtnEl.addEventListener("click", () => {
302
+ this.regenerateResponse();
303
+ });
304
+ }
305
+ if (this.resultCopyBtnEl) {
306
+ this.resultCopyBtnEl.addEventListener("click", () => {
307
+ this.copyResult();
308
+ });
309
+ }
310
+ }
311
+ // 显示选中文本的气泡
312
+ showSelectionBubble() {
313
+ if (!this.selectionBubbleEl) {
314
+ this.selectionBubbleEl = document.createElement("div");
315
+ this.selectionBubbleEl.className = "ql-ai-selection-bubble";
316
+ const icon = icons.AI_ICON.replaceAll("paint_linear_2", "paint_linear_bubble");
317
+ this.selectionBubbleEl.innerHTML = `${icon}<span>AI 智能</span>`;
318
+ this.selectionBubbleEl.addEventListener("click", () => this.selectTextEvent());
319
+ document.body.appendChild(this.selectionBubbleEl);
320
+ }
321
+ const { left, top } = this.quill.getBounds(this.selectionRange.index);
322
+ const { left: endLeft } = this.quill.getBounds(this.selectionRange.index + this.selectionRange.length);
323
+ const width = (endLeft - left) / 2;
324
+ const editorRect = this.quill.container.getBoundingClientRect();
325
+ this.selectionBubbleEl.style.display = "flex";
326
+ this.selectionBubbleEl.style.left = `${left + editorRect.left + width - 45}px`;
327
+ this.selectionBubbleEl.style.top = `${top + editorRect.top - 40}px`;
328
+ }
329
+ // 隐藏选中文本的气泡
330
+ hideSelectionBubble() {
331
+ if (this.selectionBubbleEl) {
332
+ this.selectionBubbleEl.style.display = "none";
333
+ }
334
+ }
335
+ // 处理文本选中变化
336
+ handleSelectionChange(range) {
337
+ if (range && range.length > 0) {
338
+ this.selectionRange = range;
339
+ this.showSelectionBubble();
340
+ this.selectedText = this.quill.getText(range.index, range.length);
341
+ } else {
342
+ if (range && range.index !== null) {
343
+ this.selectedText = "";
344
+ this.closeAIPanel();
345
+ } else {
346
+ this.hideSelectionBubble();
347
+ }
348
+ }
349
+ }
350
+ addInputEvent() {
351
+ if (this.inputContainerEl) {
352
+ this.inputContainerEl.addEventListener("click", () => {
353
+ });
354
+ }
355
+ if (this.inputEl) {
356
+ this.inputEl.addEventListener("input", () => {
357
+ this.hiddenInputSendBtnEl(this.inputEl.value.trim() ? "flex" : "none");
358
+ if (this.menuContainerEl && this._isSelectRangeMode) {
359
+ this.showOperationMenu = !this.inputEl.value.trim() && !this._showResultPopupEl;
360
+ }
361
+ });
362
+ }
363
+ if (this.inputSendBtnEl) {
364
+ this.inputSendBtnEl.addEventListener("click", async () => {
365
+ await this.queryAI();
366
+ });
367
+ }
368
+ this.inputEl.addEventListener("keydown", async (e) => {
369
+ if (e.key === "Enter") {
370
+ await this.queryAI();
371
+ }
372
+ });
373
+ if (this.inputCloseBtnEl) {
374
+ this.inputCloseBtnEl.addEventListener("click", () => {
375
+ this.closeAIPanel();
376
+ });
377
+ }
378
+ }
379
+ positionElements() {
380
+ if (!this.dialogContainerEl) return;
381
+ const range = this.selectionRange;
382
+ if (range) {
383
+ const bounds = this.quill.getBounds(range.index);
384
+ this.dialogContainerEl.style.position = "absolute";
385
+ this.dialogContainerEl.style.top = `${bounds.top + bounds.height + 20}px`;
386
+ }
387
+ }
388
+ // 添加创建alert元素的方法
389
+ createAlertElement() {
390
+ if (!this.alertEl) {
391
+ this.alertEl = document.createElement("div");
392
+ this.alertEl.className = "ql-ai-alert";
393
+ this.alertEl.style.display = "none";
394
+ document.body.appendChild(this.alertEl);
395
+ }
396
+ }
397
+ // 添加显示alert的方法
398
+ showAlert(message, duration = 3e3) {
399
+ this.createAlertElement();
400
+ if (!this.alertEl) return;
401
+ if (this.alertTimer) {
402
+ clearTimeout(this.alertTimer);
403
+ this.alertTimer = null;
404
+ }
405
+ this.alertEl.textContent = message;
406
+ this.alertEl.style.display = "block";
407
+ this.alertTimer = setTimeout(() => {
408
+ if (this.alertEl) {
409
+ this.alertEl.style.display = "none";
410
+ }
411
+ this.alertTimer = null;
412
+ }, duration);
413
+ }
414
+ createAIInputIcon() {
415
+ if (!this.aiIconEl) {
416
+ this.aiIconEl = document.createElement("span");
417
+ this.aiIconEl.className = "ql-ai-input-pre-icon";
418
+ const icon = icons.AI_ICON.replaceAll("paint_linear_2", "paint_linear_ai_input");
419
+ this.aiIconEl.innerHTML = icon;
420
+ }
421
+ }
422
+ // 添加处理子菜单点击的方法
423
+ handleOperationMenuItemClick(text, id = "") {
424
+ let quetion = "";
425
+ if (id.startsWith("1-") || id.startsWith("3-")) {
426
+ quetion = `将目标文字${text},目标文字为:${this.selectedText}`;
427
+ } else if (id.startsWith("2-")) {
428
+ quetion = `改写目标文字的口吻,让其变得${text},目标文字为:${this.selectedText}`;
429
+ }
430
+ this.showOperationMenu = false;
431
+ this.queryAI(quetion);
432
+ }
433
+ createActionMenu() {
434
+ if (!this.actionMenuEl) {
435
+ this.actionMenuEl = document.createElement("div");
436
+ this.actionMenuEl.className = "ql-ai-actions";
437
+ this.resultMenuList.forEach(({ text, icon }) => {
438
+ const menuItem = document.createElement("div");
439
+ menuItem.className = "ql-ai-action-item";
440
+ menuItem.innerHTML = `${icon}<span class="ql-ai-result-menu-text">${text}</span>`;
441
+ menuItem.addEventListener("click", () => this.handleAction(text));
442
+ this.actionMenuEl.appendChild(menuItem);
443
+ });
444
+ this.wrapContainerEl.appendChild(this.actionMenuEl);
445
+ }
446
+ const secondMenuItemText = this.actionMenuEl.children[1].querySelector(".ql-ai-result-menu-text");
447
+ const firstChild = this.actionMenuEl.firstChild;
448
+ if (!this._isSelectRangeMode) {
449
+ if (firstChild instanceof Element) {
450
+ firstChild.classList.add("hidden");
451
+ }
452
+ secondMenuItemText.textContent = constants.INSERT_TEXT;
453
+ } else {
454
+ if (firstChild instanceof Element) {
455
+ firstChild.classList.remove("hidden");
456
+ }
457
+ secondMenuItemText.textContent = constants.INSERT_SUB_CONTENT_TEXT;
458
+ }
459
+ this.isThinking = false;
460
+ }
461
+ handleActionMenuDisplay(value = "none") {
462
+ if (this.actionMenuEl) {
463
+ this.actionMenuEl.style.display = value;
464
+ }
465
+ }
466
+ switchInputEl(showInput = true) {
467
+ if (this.inputContainerEl) {
468
+ this.inputContainerEl.style.display = showInput ? "flex" : "none";
469
+ }
470
+ this.handleActionMenuDisplay(showInput ? "block" : "none");
471
+ if (this.thinkContainerEl) {
472
+ this.thinkContainerEl.style.display = showInput ? "none" : "flex";
473
+ }
474
+ }
475
+ // 创建思考元素
476
+ createThinkElements() {
477
+ if (!this.thinkContainerEl) {
478
+ this.thinkContainerEl = document.createElement("div");
479
+ this.thinkContainerEl.className = "ql-ai-input";
480
+ this.thinkContainerEl.innerHTML = `<span class="ql-ai-input-pre-icon ql-ai-think-icon">${icons.THINK_ICON}</span><span class="ql-ai-think-text">${constants.THINK_TEXT}</span>`;
481
+ this.thinkBtnEl = document.createElement("div");
482
+ this.thinkBtnEl.className = "ql-ai-think-btn";
483
+ this.thinkBtnEl.innerHTML = `${icons.STOP_ICON}<span>${constants.STOP_ANSWER}</span>`;
484
+ this.thinkContainerEl.appendChild(this.thinkBtnEl);
485
+ this.wrapContainerEl.appendChild(this.thinkContainerEl);
486
+ this.thinkBtnEl.addEventListener("click", () => {
487
+ this.isBreak = true;
488
+ this.isThinking = false;
489
+ });
490
+ }
491
+ this.isThinking = true;
492
+ }
493
+ // AI查询
494
+ async queryAI(question) {
495
+ this.createThinkElements();
496
+ this.inputValue = question || this.inputEl.value;
497
+ if (this.inputValue.trim() === "") {
498
+ return;
499
+ }
500
+ this.isBreak = false;
501
+ try {
502
+ const response = await fetch(`${this.host}`, {
503
+ method: "POST",
504
+ headers: {
505
+ "Content-Type": "application/json",
506
+ "Authorization": `Bearer ${this.apiKey}`
507
+ },
508
+ body: JSON.stringify({
509
+ model: this.model,
510
+ prompt: this.inputValue,
511
+ stream: true
512
+ })
513
+ });
514
+ if (!response.ok) {
515
+ throw new Error(`HTTP error! status: ${response.status}`);
516
+ }
517
+ const reader = response.body.getReader();
518
+ const decoder = new TextDecoder();
519
+ let content = "";
520
+ while (true) {
521
+ if (this.isBreak) {
522
+ this.isBreak = false;
523
+ break;
524
+ }
525
+ const { done, value } = await reader.read();
526
+ if (done) break;
527
+ const chunk = decoder.decode(value);
528
+ const lines = chunk.split("\n").filter((line) => line.trim() !== "");
529
+ for (const line of lines) {
530
+ try {
531
+ const data = JSON.parse(line);
532
+ content += data.response || "";
533
+ this.showAIResponse(content);
534
+ } catch (e) {
535
+ console.error("解析错误:", e);
536
+ }
537
+ }
538
+ }
539
+ this.createActionMenu();
540
+ this.inputEl.value = "";
541
+ this.hiddenInputSendBtnEl();
542
+ return content;
543
+ } catch (error) {
544
+ console.error("AI查询失败:", error);
545
+ return "AI查询失败,请重试";
546
+ }
547
+ }
548
+ showAIResponse(response) {
549
+ if (!this.resultPopupEl) return;
550
+ if (this._charCount <= this.textNumber) {
551
+ this.resultPopupContentEl.innerHTML = response;
552
+ this.charCount = this.resultPopupContentEl.textContent.replace(/\s+/g, "").length;
553
+ } else {
554
+ this.isBreak = true;
555
+ this.charCount = 0;
556
+ }
557
+ this.showResultPopupEl = true;
558
+ }
559
+ handleAction(action) {
560
+ switch (action) {
561
+ case constants.REPLACE_SELECT:
562
+ this.replaceSelectText();
563
+ break;
564
+ case constants.INSERT_TEXT:
565
+ this.insertAIResponse();
566
+ break;
567
+ case constants.REGENERATE:
568
+ this.regenerateResponse();
569
+ break;
570
+ case constants.CLOSE:
571
+ this.closeAIPanel();
572
+ break;
573
+ }
574
+ }
575
+ replaceSelectText() {
576
+ if (!this.resultPopupContentEl) return;
577
+ const range = this.quill.getSelection(true);
578
+ if (range && range.length > 0) {
579
+ this.quill.deleteText(range.index, range.length);
580
+ this.quill.clipboard.dangerouslyPasteHTML(range.index, this.resultPopupContentEl.innerHTML);
581
+ }
582
+ this.closeAIPanel();
583
+ }
584
+ insertAIResponse() {
585
+ if (!this.resultPopupContentEl) return;
586
+ const range = this.quill.getSelection(true);
587
+ if (range) {
588
+ this.quill.clipboard.dangerouslyPasteHTML(range.index + range.length, this.resultPopupContentEl.innerHTML);
589
+ }
590
+ this.closeAIPanel();
591
+ }
592
+ async regenerateResponse() {
593
+ await this.queryAI(this.inputValue);
594
+ }
595
+ closeAIPanel() {
596
+ this.isBreak = true;
597
+ if (this.dialogContainerEl) {
598
+ this.dialogContainerEl.style.display = "none";
599
+ }
600
+ if (this.actionMenuEl) {
601
+ this.actionMenuEl.style.display = "none";
602
+ }
603
+ this.showResultPopupEl = false;
604
+ if (this.inputEl && this.inputEl.value.trim() !== "") {
605
+ this.inputEl.value = "";
606
+ }
607
+ this.hideSelectionBubble();
608
+ }
609
+ set charCount(value) {
610
+ if (this._debounceTimer) {
611
+ clearTimeout(this._debounceTimer);
612
+ }
613
+ this._debounceTimer = setTimeout(() => {
614
+ this._charCount = value;
615
+ if (this.resultPopupFooterTextEl) {
616
+ this.resultPopupFooterTextEl.textContent = `${this._charCount}/${this.textNumber}`;
617
+ }
618
+ clearTimeout(this._debounceTimer);
619
+ this._debounceTimer = null;
620
+ }, 210);
621
+ }
622
+ get charCount() {
623
+ return this._charCount;
624
+ }
625
+ set inputPlaceholder(value) {
626
+ this._inputPlaceholder = value;
627
+ if (this.inputEl) {
628
+ this.inputEl.placeholder = value;
629
+ }
630
+ }
631
+ get inputPlaceholder() {
632
+ return this._inputPlaceholder;
633
+ }
634
+ set showOperationMenu(value) {
635
+ this._showOperationMenu = value;
636
+ if (this.menuContainerEl) {
637
+ this.menuContainerEl.style.display = value ? "flex" : "none";
638
+ }
639
+ }
640
+ get showOperationMenu() {
641
+ return this._showOperationMenu;
642
+ }
643
+ set isSelectRangeMode(value) {
644
+ this._isSelectRangeMode = value;
645
+ this.showOperationMenu = value;
646
+ this.inputPlaceholder = value ? constants.SELECT_PLACEHOLDER : constants.INPUT_PLACEHOLDER;
647
+ this.hideSelectionBubble();
648
+ }
649
+ get isSelectRangeMode() {
650
+ return this._isSelectRangeMode;
651
+ }
652
+ set isThinking(value) {
653
+ this._isThinking = value;
654
+ this.switchInputEl(!value);
655
+ }
656
+ get isThinking() {
657
+ return this._isThinking;
658
+ }
659
+ set showResultPopupEl(value) {
660
+ this._showResultPopupEl = value;
661
+ if (this.resultPopupEl) {
662
+ this.resultPopupEl.style.display = value ? "block" : "none";
663
+ }
664
+ }
665
+ get showResultPopupEl() {
666
+ return this._showResultPopupEl;
667
+ }
668
+ }
669
+ exports.AI = AI;
670
+ //# sourceMappingURL=index.cjs.js.map