cosey 0.9.4 → 0.10.0

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 (431) hide show
  1. package/README.md +8 -1
  2. package/components/audio-card/audio-card.js +1 -1
  3. package/components/close/close.js +1 -1
  4. package/components/col/col.api.d.ts +1 -1
  5. package/components/context-menu/content.js +1 -1
  6. package/components/dnd-sort/dnd-sort-item.js +1 -1
  7. package/components/editor/button-group.d.ts +2 -0
  8. package/components/editor/button-group.js +20 -0
  9. package/components/editor/button-select.d.ts +14 -0
  10. package/components/editor/button-select.js +51 -0
  11. package/components/editor/button-split.d.ts +25 -0
  12. package/components/editor/button-split.js +68 -0
  13. package/components/editor/button.d.ts +19 -0
  14. package/components/editor/button.js +40 -0
  15. package/components/editor/contents/content-code-block.d.ts +18 -0
  16. package/components/editor/contents/content-code-block.js +47 -0
  17. package/components/editor/contents/content-formula.d.ts +12 -0
  18. package/components/editor/contents/content-formula.js +48 -0
  19. package/components/editor/contents/content-formula.style.js +14 -0
  20. package/components/editor/contents/content-image.d.ts +29 -0
  21. package/components/editor/contents/content-image.js +89 -0
  22. package/components/editor/{components/list/list.style.d.ts → contents/content-image.style.d.ts} +1 -1
  23. package/components/editor/contents/content-image.style.js +20 -0
  24. package/components/editor/contents/content-link.d.ts +16 -0
  25. package/components/editor/contents/content-link.js +74 -0
  26. package/components/editor/contents/content-link.stye.d.ts +4 -0
  27. package/components/editor/contents/content-link.stye.js +17 -0
  28. package/components/editor/contents/content-list-item.d.ts +21 -0
  29. package/components/editor/contents/content-list-item.js +41 -0
  30. package/components/editor/contents/content-list-item.style.d.ts +4 -0
  31. package/components/editor/contents/content-list-item.style.js +52 -0
  32. package/components/editor/contents/content-placeholder.d.ts +2 -0
  33. package/components/editor/contents/content-placeholder.js +24 -0
  34. package/components/editor/contents/content-placeholder.style.d.ts +4 -0
  35. package/components/editor/contents/content-placeholder.style.js +19 -0
  36. package/components/editor/contents/content-table.d.ts +2 -0
  37. package/components/editor/contents/content-table.js +133 -0
  38. package/components/editor/contents/content-table.style.d.ts +4 -0
  39. package/components/editor/contents/content-table.style.js +21 -0
  40. package/components/editor/contents/content-video.d.ts +26 -0
  41. package/components/editor/contents/content-video.js +73 -0
  42. package/components/editor/contents/content-video.style.d.ts +4 -0
  43. package/components/editor/contents/content-video.style.js +20 -0
  44. package/components/editor/contents/resize.d.ts +37 -0
  45. package/components/editor/contents/resize.js +133 -0
  46. package/components/editor/{components/resize → contents}/resize.style.d.ts +1 -1
  47. package/components/editor/{components/resize → contents}/resize.style.js +14 -34
  48. package/components/editor/contents/upload.d.ts +17 -0
  49. package/components/editor/contents/upload.js +80 -0
  50. package/components/editor/contents/upload.style.d.ts +4 -0
  51. package/components/editor/contents/upload.style.js +38 -0
  52. package/components/editor/contents/widget-popover.d.ts +389 -0
  53. package/components/editor/contents/widget-popover.js +36 -0
  54. package/components/editor/contents/widget-popover.style.d.ts +4 -0
  55. package/components/editor/contents/widget-popover.style.js +15 -0
  56. package/components/editor/editor.api.d.ts +14 -6
  57. package/components/editor/editor.api.js +10 -6
  58. package/components/editor/editor.d.ts +15 -8
  59. package/components/editor/editor.js +178 -76
  60. package/components/editor/editor.style.d.ts +5 -1
  61. package/components/editor/editor.style.js +120 -253
  62. package/components/editor/{components/color-picker/color-picker.js → formats/color-picker.api.js} +3 -3
  63. package/components/editor/formats/color-picker.d.ts +20 -0
  64. package/components/editor/formats/color-picker.js +154 -0
  65. package/components/editor/{components/color-picker → formats}/color-picker.style.d.ts +1 -1
  66. package/components/editor/{components/color-picker → formats}/color-picker.style.js +1 -1
  67. package/components/editor/formats/format-align.d.ts +22 -0
  68. package/components/editor/formats/format-align.js +38 -0
  69. package/components/editor/formats/format-background.d.ts +2 -0
  70. package/components/editor/formats/format-background.js +60 -0
  71. package/components/editor/formats/format-block-quote.d.ts +2 -0
  72. package/components/editor/formats/format-block-quote.js +27 -0
  73. package/components/editor/formats/format-clear.d.ts +2 -0
  74. package/components/editor/formats/format-clear.js +25 -0
  75. package/components/editor/formats/format-code-block.d.ts +2 -0
  76. package/components/editor/formats/format-code-block.js +27 -0
  77. package/components/editor/formats/format-color.d.ts +2 -0
  78. package/components/editor/formats/format-color.js +59 -0
  79. package/components/editor/formats/format-font.d.ts +2 -0
  80. package/components/editor/formats/format-font.js +46 -0
  81. package/components/editor/formats/format-formula.d.ts +2 -0
  82. package/components/editor/formats/format-formula.js +133 -0
  83. package/components/editor/formats/format-heading.d.ts +2 -0
  84. package/components/editor/formats/format-heading.js +52 -0
  85. package/components/editor/formats/format-image.d.ts +2 -0
  86. package/components/editor/formats/format-image.js +140 -0
  87. package/components/editor/formats/format-indent.d.ts +20 -0
  88. package/components/editor/formats/format-indent.js +35 -0
  89. package/components/editor/formats/format-link.d.ts +2 -0
  90. package/components/editor/formats/format-link.js +114 -0
  91. package/components/editor/formats/format-list.d.ts +22 -0
  92. package/components/editor/formats/format-list.js +39 -0
  93. package/components/editor/formats/format-mark.d.ts +20 -0
  94. package/components/editor/formats/format-mark.js +38 -0
  95. package/components/editor/formats/format-size-delta.d.ts +24 -0
  96. package/components/editor/formats/format-size-delta.js +43 -0
  97. package/components/editor/formats/format-size.d.ts +2 -0
  98. package/components/editor/formats/format-size.js +51 -0
  99. package/components/editor/formats/format-source.d.ts +2 -0
  100. package/components/editor/formats/format-source.js +69 -0
  101. package/components/editor/formats/format-table.d.ts +2 -0
  102. package/components/editor/formats/format-table.js +85 -0
  103. package/components/editor/formats/format-table.style.d.ts +4 -0
  104. package/components/editor/{components/toolbar/formats/table.style.js → formats/format-table.style.js} +2 -2
  105. package/components/editor/formats/format-video.d.ts +2 -0
  106. package/components/editor/formats/format-video.js +117 -0
  107. package/components/editor/formats/picker.d.ts +45 -0
  108. package/components/editor/formats/picker.js +91 -0
  109. package/components/editor/{components/picker → formats}/picker.style.d.ts +1 -1
  110. package/components/editor/{components/picker → formats}/picker.style.js +1 -1
  111. package/components/editor/formats/select-list.d.ts +28 -0
  112. package/components/editor/formats/select-list.js +47 -0
  113. package/components/editor/formats/select-list.style.d.ts +4 -0
  114. package/components/editor/{components/list/list.style.js → formats/select-list.style.js} +2 -2
  115. package/components/editor/formats/select.d.ts +32 -0
  116. package/components/editor/formats/select.js +61 -0
  117. package/components/editor/hooks/useBlockValueActive.d.ts +1 -0
  118. package/components/editor/hooks/useBlockValueActive.js +21 -0
  119. package/components/editor/hooks/useFocus.d.ts +5 -0
  120. package/components/editor/hooks/useFocus.js +18 -0
  121. package/components/editor/{components/color-picker → hooks}/useHistoryColor.js +1 -1
  122. package/components/editor/hooks/useMarkActive.d.ts +1 -0
  123. package/components/editor/hooks/useMarkActive.js +13 -0
  124. package/components/editor/hooks/useMarkValue.d.ts +1 -0
  125. package/components/editor/hooks/useMarkValue.js +21 -0
  126. package/components/editor/index.d.ts +25 -13
  127. package/components/editor/index.js +3 -21
  128. package/components/editor/plugins/align.d.ts +8 -0
  129. package/components/editor/plugins/align.js +13 -0
  130. package/components/editor/plugins/background.d.ts +7 -0
  131. package/components/editor/plugins/background.js +19 -0
  132. package/components/editor/plugins/block-quote.d.ts +8 -0
  133. package/components/editor/plugins/block-quote.js +34 -0
  134. package/components/editor/plugins/clear.d.ts +7 -0
  135. package/components/editor/plugins/clear.js +53 -0
  136. package/components/editor/plugins/code-block.d.ts +13 -0
  137. package/components/editor/plugins/code-block.js +348 -0
  138. package/components/editor/plugins/color.d.ts +7 -0
  139. package/components/editor/plugins/color.js +21 -0
  140. package/components/editor/plugins/font.d.ts +7 -0
  141. package/components/editor/plugins/font.js +17 -0
  142. package/components/editor/plugins/formula.d.ts +11 -0
  143. package/components/editor/{components/toolbar/formats → plugins}/formula.js +50 -1
  144. package/components/editor/plugins/heading.d.ts +9 -0
  145. package/components/editor/plugins/heading.js +70 -0
  146. package/components/editor/plugins/html.d.ts +7 -0
  147. package/components/editor/plugins/html.js +30 -0
  148. package/components/editor/plugins/image.d.ts +8 -0
  149. package/components/editor/plugins/image.js +63 -0
  150. package/components/editor/plugins/indent.d.ts +7 -0
  151. package/components/editor/plugins/indent.js +47 -0
  152. package/components/editor/plugins/index.d.ts +2 -0
  153. package/components/editor/plugins/index.js +50 -0
  154. package/components/editor/plugins/keyboard.d.ts +41 -0
  155. package/components/editor/plugins/keyboard.js +120 -0
  156. package/components/editor/plugins/link.d.ts +8 -0
  157. package/components/editor/plugins/link.js +56 -0
  158. package/components/editor/plugins/list/deserialize.d.ts +3 -0
  159. package/components/editor/plugins/list/deserialize.js +106 -0
  160. package/components/editor/plugins/list/format.d.ts +3 -0
  161. package/components/editor/plugins/list/format.js +155 -0
  162. package/components/editor/plugins/list/indent.d.ts +2 -0
  163. package/components/editor/plugins/list/indent.js +38 -0
  164. package/components/editor/plugins/list/index.d.ts +10 -0
  165. package/components/editor/plugins/list/index.js +61 -0
  166. package/components/editor/plugins/list/insert-break.d.ts +2 -0
  167. package/components/editor/plugins/list/insert-break.js +19 -0
  168. package/components/editor/plugins/list/normalize.d.ts +3 -0
  169. package/components/editor/plugins/list/normalize.js +168 -0
  170. package/components/editor/plugins/list/serialize.d.ts +3 -0
  171. package/components/editor/plugins/list/serialize.js +63 -0
  172. package/components/editor/plugins/list/utils.d.ts +6 -0
  173. package/components/editor/plugins/list/utils.js +24 -0
  174. package/components/editor/plugins/mark.d.ts +7 -0
  175. package/components/editor/plugins/mark.js +27 -0
  176. package/components/editor/plugins/render.d.ts +11 -0
  177. package/components/editor/plugins/render.js +54 -0
  178. package/components/editor/plugins/serialize.d.ts +10 -0
  179. package/components/editor/plugins/serialize.js +342 -0
  180. package/components/editor/plugins/size.d.ts +8 -0
  181. package/components/editor/plugins/size.js +47 -0
  182. package/components/editor/plugins/table.d.ts +21 -0
  183. package/components/editor/plugins/table.js +702 -0
  184. package/components/editor/plugins/video.d.ts +8 -0
  185. package/components/editor/plugins/video.js +40 -0
  186. package/components/editor/toolbar.d.ts +2 -0
  187. package/components/editor/toolbar.js +20 -0
  188. package/components/editor/types.d.ts +194 -0
  189. package/components/editor/types.js +55 -0
  190. package/components/editor/usePopoverContainer.d.ts +8 -0
  191. package/components/editor/usePopoverContainer.js +31 -0
  192. package/components/editor/utils.d.ts +77 -0
  193. package/components/editor/utils.js +165 -0
  194. package/components/field/components/checkbox-group/checkbox-group.vue.js +1 -1
  195. package/components/field/components/editor/editor.d.ts +16 -0
  196. package/components/field/components/editor/editor.vue.d.ts +4 -0
  197. package/components/field/components/editor/editor.vue.js +21 -0
  198. package/components/field/components/password/password.vue.js +1 -1
  199. package/components/field/components/select/select.vue.js +1 -1
  200. package/components/field/field.api.d.ts +3 -0
  201. package/components/field/field.api.js +18 -16
  202. package/components/file-card/file-card.js +1 -1
  203. package/components/form/form-item.vue.js +2 -2
  204. package/components/form/form.api.d.ts +3 -3
  205. package/components/form/form.api.js +1 -1
  206. package/components/form/form.d.ts +6 -6
  207. package/components/form/index.d.ts +17 -17
  208. package/components/form/useBubbleTemplate.js +1 -1
  209. package/components/form-dialog/form-dialog.api.js +1 -1
  210. package/components/form-dialog/form-dialog.d.ts +5 -5
  211. package/components/form-drawer/form-drawer.d.ts +5 -5
  212. package/components/form-drawer/index.d.ts +15 -15
  213. package/components/form-group/form-group.api.d.ts +9 -4
  214. package/components/form-group/form-group.api.js +4 -1
  215. package/components/form-group/form-group.d.ts +8 -2
  216. package/components/form-group/form-group.js +13 -3
  217. package/components/form-group/form-group.style.js +5 -0
  218. package/components/form-group/index.d.ts +12 -3
  219. package/components/form-list/index.d.ts +5 -5
  220. package/components/form-query/form-query.d.ts +5 -5
  221. package/components/form-query/form-query.js +1 -1
  222. package/components/form-query/index.d.ts +15 -15
  223. package/components/highlight/highlight.api.d.ts +30 -12
  224. package/components/highlight/highlight.api.js +3 -19
  225. package/components/highlight/highlight.d.ts +7 -3
  226. package/components/highlight/highlight.js +4 -5
  227. package/components/highlight/highlight.style.js +285 -50
  228. package/components/highlight/index.d.ts +15 -6
  229. package/components/highlight/index.js +1 -1
  230. package/components/icon/icon.api.d.ts +11 -0
  231. package/components/icon/icon.api.js +10 -0
  232. package/components/icon/icon.d.ts +16 -5
  233. package/components/icon/icon.js +59 -0
  234. package/components/icon/icon.style.d.ts +4 -0
  235. package/components/icon/{style/index.js → icon.style.js} +1 -1
  236. package/components/icon/index.d.ts +24 -7
  237. package/components/icon/index.js +2 -1
  238. package/components/iconify-icon/iconify-icon.api.d.ts +15 -0
  239. package/components/iconify-icon/iconify-icon.api.js +20 -0
  240. package/components/iconify-icon/iconify-icon.d.ts +21 -6
  241. package/components/iconify-icon/iconify-icon.js +22 -8
  242. package/components/iconify-icon/index.d.ts +37 -4
  243. package/components/iconify-icon/index.js +2 -2
  244. package/components/index.d.ts +1 -0
  245. package/components/index.js +5 -4
  246. package/components/input-number-range/index.d.ts +39 -30
  247. package/components/input-number-range/input-number-range.api.d.ts +10 -10
  248. package/components/input-number-range/input-number-range.d.ts +23 -20
  249. package/components/input-number-range/input-number-range.js +1 -1
  250. package/components/snug-menu/snug-menu-item.vue.js +2 -2
  251. package/components/stack-dialog/index.d.ts +3 -3
  252. package/components/stack-dialog/stack-dialog.d.ts +1 -1
  253. package/components/svg-icon/index.d.ts +16 -4
  254. package/components/svg-icon/index.js +2 -1
  255. package/components/svg-icon/svg-icon.api.d.ts +7 -0
  256. package/components/svg-icon/svg-icon.api.js +7 -0
  257. package/components/svg-icon/svg-icon.d.ts +10 -3
  258. package/components/svg-icon/svg-icon.js +18 -0
  259. package/components/table/index.d.ts +12 -12
  260. package/components/table/table-column/table-column.js +1 -1
  261. package/components/table/table-export/table-export.d.ts +5 -5
  262. package/components/table/table-query/table-query.d.ts +5 -5
  263. package/components/table/table.d.ts +5 -5
  264. package/components/table/table.js +1 -1
  265. package/components/table/table.vue.d.ts +7 -7
  266. package/components/table/table.vue.js +5 -5
  267. package/components/table-action/item.js +1 -1
  268. package/components/toggle/toggle.js +1 -1
  269. package/components/upload/index.d.ts +3 -4
  270. package/components/upload/index.js +0 -1
  271. package/components/upload/upload-item.js +1 -1
  272. package/components/upload/upload.api.d.ts +2 -2
  273. package/components/upload/upload.d.ts +2 -2
  274. package/components/upload/upload.js +4 -4
  275. package/components/video-card/video-card.js +1 -1
  276. package/config/root-config-provider.js +2 -2
  277. package/{components/upload-context.d.ts → config/upload.d.ts} +2 -2
  278. package/{components/upload-context.js → config/upload.js} +3 -3
  279. package/hooks/index.d.ts +2 -0
  280. package/hooks/index.js +2 -0
  281. package/hooks/useObjectUrl.d.ts +2 -0
  282. package/hooks/useObjectUrl.js +27 -0
  283. package/hooks/useSingleUpload.d.ts +15 -0
  284. package/hooks/useSingleUpload.js +64 -0
  285. package/layout/layout-menu/style/index.js +1 -1
  286. package/locale/lang/ar.d.ts +2 -0
  287. package/locale/lang/ar.js +3 -1
  288. package/locale/lang/en.d.ts +2 -0
  289. package/locale/lang/en.js +3 -1
  290. package/locale/lang/zh-cn.d.ts +2 -0
  291. package/locale/lang/zh-cn.js +3 -1
  292. package/package.json +11 -7
  293. package/utils/array.d.ts +1 -1
  294. package/utils/browser.d.ts +1 -0
  295. package/utils/browser.js +3 -2
  296. package/utils/file.d.ts +5 -0
  297. package/utils/file.js +24 -1
  298. package/utils/index.js +2 -2
  299. package/utils/url.d.ts +4 -0
  300. package/utils/url.js +10 -0
  301. package/components/editor/components/button-group.vue.d.ts +0 -12
  302. package/components/editor/components/button-group.vue.js +0 -19
  303. package/components/editor/components/button.vue.d.ts +0 -17
  304. package/components/editor/components/button.vue.js +0 -35
  305. package/components/editor/components/color-picker/color-picker.vue.d.ts +0 -23
  306. package/components/editor/components/color-picker/color-picker.vue.js +0 -181
  307. package/components/editor/components/list/list.d.ts +0 -6
  308. package/components/editor/components/list/list.vue.d.ts +0 -11
  309. package/components/editor/components/list/list.vue.js +0 -51
  310. package/components/editor/components/picker/picker.vue.d.ts +0 -25
  311. package/components/editor/components/picker/picker.vue.js +0 -95
  312. package/components/editor/components/resize/resize.d.ts +0 -23
  313. package/components/editor/components/resize/resize.js +0 -88
  314. package/components/editor/components/resize/resize.vue.d.ts +0 -2
  315. package/components/editor/components/resize/resize.vue.js +0 -204
  316. package/components/editor/components/select-button.vue.d.ts +0 -15
  317. package/components/editor/components/select-button.vue.js +0 -46
  318. package/components/editor/components/select.vue.d.ts +0 -14
  319. package/components/editor/components/select.vue.js +0 -67
  320. package/components/editor/components/split-button.vue.d.ts +0 -22
  321. package/components/editor/components/split-button.vue.js +0 -69
  322. package/components/editor/components/table-toolbar/table-toolbar.style.d.ts +0 -4
  323. package/components/editor/components/table-toolbar/table-toolbar.style.js +0 -22
  324. package/components/editor/components/table-toolbar/table-toolbar.vue.d.ts +0 -2
  325. package/components/editor/components/table-toolbar/table-toolbar.vue.js +0 -182
  326. package/components/editor/components/toolbar/formats/align.vue.d.ts +0 -5
  327. package/components/editor/components/toolbar/formats/align.vue.js +0 -52
  328. package/components/editor/components/toolbar/formats/background.vue.d.ts +0 -2
  329. package/components/editor/components/toolbar/formats/background.vue.js +0 -70
  330. package/components/editor/components/toolbar/formats/blockquote.vue.d.ts +0 -2
  331. package/components/editor/components/toolbar/formats/blockquote.vue.js +0 -39
  332. package/components/editor/components/toolbar/formats/bold.vue.d.ts +0 -2
  333. package/components/editor/components/toolbar/formats/bold.vue.js +0 -39
  334. package/components/editor/components/toolbar/formats/clean.vue.d.ts +0 -2
  335. package/components/editor/components/toolbar/formats/clean.vue.js +0 -26
  336. package/components/editor/components/toolbar/formats/code-block.vue.d.ts +0 -2
  337. package/components/editor/components/toolbar/formats/code-block.vue.js +0 -39
  338. package/components/editor/components/toolbar/formats/code.vue.d.ts +0 -2
  339. package/components/editor/components/toolbar/formats/code.vue.js +0 -39
  340. package/components/editor/components/toolbar/formats/color.vue.d.ts +0 -2
  341. package/components/editor/components/toolbar/formats/color.vue.js +0 -69
  342. package/components/editor/components/toolbar/formats/font.vue.d.ts +0 -2
  343. package/components/editor/components/toolbar/formats/font.vue.js +0 -59
  344. package/components/editor/components/toolbar/formats/formula.d.ts +0 -4
  345. package/components/editor/components/toolbar/formats/formula.vue.d.ts +0 -2
  346. package/components/editor/components/toolbar/formats/formula.vue.js +0 -154
  347. package/components/editor/components/toolbar/formats/header.vue.d.ts +0 -2
  348. package/components/editor/components/toolbar/formats/header.vue.js +0 -68
  349. package/components/editor/components/toolbar/formats/image.vue.d.ts +0 -2
  350. package/components/editor/components/toolbar/formats/image.vue.js +0 -26
  351. package/components/editor/components/toolbar/formats/indent.vue.d.ts +0 -5
  352. package/components/editor/components/toolbar/formats/indent.vue.js +0 -36
  353. package/components/editor/components/toolbar/formats/italic.vue.d.ts +0 -2
  354. package/components/editor/components/toolbar/formats/italic.vue.js +0 -39
  355. package/components/editor/components/toolbar/formats/link.vue.d.ts +0 -2
  356. package/components/editor/components/toolbar/formats/link.vue.js +0 -218
  357. package/components/editor/components/toolbar/formats/list.vue.d.ts +0 -5
  358. package/components/editor/components/toolbar/formats/list.vue.js +0 -50
  359. package/components/editor/components/toolbar/formats/script.vue.d.ts +0 -5
  360. package/components/editor/components/toolbar/formats/script.vue.js +0 -50
  361. package/components/editor/components/toolbar/formats/size-delta.vue.d.ts +0 -5
  362. package/components/editor/components/toolbar/formats/size-delta.vue.js +0 -79
  363. package/components/editor/components/toolbar/formats/size.vue.d.ts +0 -2
  364. package/components/editor/components/toolbar/formats/size.vue.js +0 -56
  365. package/components/editor/components/toolbar/formats/source.vue.d.ts +0 -2
  366. package/components/editor/components/toolbar/formats/source.vue.js +0 -78
  367. package/components/editor/components/toolbar/formats/strike.vue.d.ts +0 -2
  368. package/components/editor/components/toolbar/formats/strike.vue.js +0 -39
  369. package/components/editor/components/toolbar/formats/strikethrough.vue.d.ts +0 -2
  370. package/components/editor/components/toolbar/formats/strikethrough.vue.js +0 -39
  371. package/components/editor/components/toolbar/formats/table.style.d.ts +0 -4
  372. package/components/editor/components/toolbar/formats/table.vue.d.ts +0 -2
  373. package/components/editor/components/toolbar/formats/table.vue.js +0 -100
  374. package/components/editor/components/toolbar/formats/underline.vue.d.ts +0 -2
  375. package/components/editor/components/toolbar/formats/underline.vue.js +0 -39
  376. package/components/editor/components/toolbar/formats/video.vue.d.ts +0 -2
  377. package/components/editor/components/toolbar/formats/video.vue.js +0 -123
  378. package/components/editor/components/toolbar/toolbar.d.ts +0 -36
  379. package/components/editor/components/toolbar/toolbar.js +0 -137
  380. package/components/editor/components/toolbar/toolbar.vue.d.ts +0 -3
  381. package/components/editor/components/toolbar/toolbar.vue.js +0 -130
  382. package/components/editor/components/toolbar/toolbarContext.d.ts +0 -8
  383. package/components/editor/components/toolbar/toolbarContext.js +0 -3
  384. package/components/editor/formats/align.d.ts +0 -2
  385. package/components/editor/formats/align.js +0 -6
  386. package/components/editor/formats/font.d.ts +0 -7
  387. package/components/editor/formats/font.js +0 -36
  388. package/components/editor/formats/formula.d.ts +0 -9
  389. package/components/editor/formats/formula.js +0 -29
  390. package/components/editor/formats/image.d.ts +0 -13
  391. package/components/editor/formats/image.js +0 -46
  392. package/components/editor/formats/indent.d.ts +0 -10
  393. package/components/editor/formats/indent.js +0 -37
  394. package/components/editor/formats/kbd.d.ts +0 -7
  395. package/components/editor/formats/kbd.js +0 -13
  396. package/components/editor/formats/link.d.ts +0 -28
  397. package/components/editor/formats/link.js +0 -51
  398. package/components/editor/formats/list.d.ts +0 -13
  399. package/components/editor/formats/list.js +0 -57
  400. package/components/editor/formats/size.d.ts +0 -3
  401. package/components/editor/formats/size.js +0 -9
  402. package/components/editor/formats/video.d.ts +0 -16
  403. package/components/editor/formats/video.js +0 -44
  404. package/components/editor/modules/custom-list.d.ts +0 -5
  405. package/components/editor/modules/custom-list.js +0 -23
  406. package/components/editor/modules/image-uploader/formats/image-loading.d.ts +0 -16
  407. package/components/editor/modules/image-uploader/formats/image-loading.js +0 -31
  408. package/components/editor/modules/image-uploader/formats/image-loading.style.d.ts +0 -2
  409. package/components/editor/modules/image-uploader/formats/image-loading.style.js +0 -46
  410. package/components/editor/modules/image-uploader/image-uploader.d.ts +0 -18
  411. package/components/editor/modules/image-uploader/image-uploader.js +0 -134
  412. package/components/editor/modules/syntax/index.d.ts +0 -2
  413. package/components/editor/modules/syntax/index.js +0 -1
  414. package/components/editor/modules/syntax/syntaxOptions.d.ts +0 -8
  415. package/components/editor/modules/syntax/syntaxOptions.js +0 -23
  416. package/components/editor/quill.d.ts +0 -1
  417. package/components/editor/quill.js +0 -33
  418. package/components/editor/quillContext.d.ts +0 -6
  419. package/components/editor/quillContext.js +0 -3
  420. package/components/icon/icon.vue.d.ts +0 -13
  421. package/components/icon/icon.vue.js +0 -76
  422. package/components/iconify-icon/iconify-icon.vue.d.ts +0 -3
  423. package/components/iconify-icon/iconify-icon.vue.js +0 -38
  424. package/components/svg-icon/svg-icon.vue.d.ts +0 -3
  425. package/components/svg-icon/svg-icon.vue.js +0 -29
  426. /package/components/{icon/style/index.d.ts → editor/contents/content-formula.style.d.ts} +0 -0
  427. /package/components/editor/{components/color-picker/color-picker.d.ts → formats/color-picker.api.d.ts} +0 -0
  428. /package/components/editor/{components/picker/picker.d.ts → formats/picker.api.d.ts} +0 -0
  429. /package/components/editor/{components/picker/picker.js → formats/picker.api.js} +0 -0
  430. /package/components/editor/{components/color-picker → hooks}/useHistoryColor.d.ts +0 -0
  431. /package/components/{editor/components/list/list.js → field/components/editor/editor.js} +0 -0
@@ -1,78 +0,0 @@
1
- import { defineComponent, inject, ref, createElementBlock, openBlock, Fragment, createVNode, withCtx, unref, createTextVNode, toDisplayString } from 'vue';
2
- import { toolbarContextKey } from '../toolbarContext.js';
3
- import stdin_default$1 from '../../button.vue.js';
4
- import { ElDialog, ElInput, ElButton } from 'element-plus';
5
- import stdin_default$2 from '../../../../icon/index.js';
6
- import { useLocale } from '../../../../../hooks/useLocale.js';
7
-
8
- var stdin_default = /* @__PURE__ */defineComponent({
9
- __name: "source",
10
- setup(__props) {
11
- const {
12
- t
13
- } = useLocale();
14
- const {
15
- quill
16
- } = inject(toolbarContextKey);
17
- const visible = ref(false);
18
- const value = ref("");
19
- const onShow = () => {
20
- value.value = quill.value?.getSemanticHTML() || "";
21
- visible.value = true;
22
- };
23
- const onCancel = () => {
24
- visible.value = false;
25
- };
26
- const onConfirm = () => {
27
- quill.value?.clipboard.dangerouslyPasteHTML(value.value);
28
- visible.value = false;
29
- };
30
- return (_ctx, _cache) => {
31
- return openBlock(), createElementBlock(Fragment, null, [createVNode(stdin_default$1, {
32
- onClick: onShow
33
- }, {
34
- default: withCtx(() => [createVNode(unref(stdin_default$2), {
35
- name: "co:repo-source-code"
36
- })]),
37
- _: 1
38
- /* STABLE */
39
- }), createVNode(unref(ElDialog), {
40
- title: unref(t)("co.editor.sourceCode"),
41
- modelValue: visible.value,
42
- "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => visible.value = $event),
43
- width: "992px",
44
- style: {
45
- "max-width": "calc(100vw - 32px)"
46
- }
47
- }, {
48
- footer: withCtx(() => [createVNode(unref(ElButton), {
49
- onClick: onCancel
50
- }, {
51
- default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.common.cancel")), 1
52
- /* TEXT */)]),
53
- _: 1
54
- /* STABLE */
55
- }), createVNode(unref(ElButton), {
56
- type: "primary",
57
- onClick: onConfirm
58
- }, {
59
- default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.common.confirm")), 1
60
- /* TEXT */)]),
61
- _: 1
62
- /* STABLE */
63
- })]),
64
- default: withCtx(() => [createVNode(unref(ElInput), {
65
- modelValue: value.value,
66
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => value.value = $event),
67
- type: "textarea",
68
- rows: 26
69
- }, null, 8, ["modelValue"])]),
70
- _: 1
71
- /* STABLE */
72
- }, 8, ["title", "modelValue"])], 64
73
- /* STABLE_FRAGMENT */);
74
- };
75
- }
76
- });
77
-
78
- export { stdin_default as default };
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- export default _default;
@@ -1,39 +0,0 @@
1
- import { defineComponent, inject, ref, watch, createBlock, openBlock, unref, withCtx, createVNode } from 'vue';
2
- import { toolbarContextKey } from '../toolbarContext.js';
3
- import stdin_default$1 from '../../button.vue.js';
4
- import stdin_default$2 from '../../../../icon/index.js';
5
- import { Toolbar } from '../toolbar.js';
6
-
7
- var stdin_default = /* @__PURE__ */defineComponent({
8
- __name: "strike",
9
- setup(__props) {
10
- const {
11
- toolbar
12
- } = inject(toolbarContextKey);
13
- const isActive = ref(false);
14
- watch(toolbar, toolbar2 => {
15
- if (toolbar2) {
16
- toolbar2.on(Toolbar.events.EDITOR_CHANGE, event => {
17
- const formats = event.detail.formats;
18
- isActive.value = formats["strike"] != null;
19
- });
20
- }
21
- }, {
22
- immediate: true
23
- });
24
- return (_ctx, _cache) => {
25
- return openBlock(), createBlock(stdin_default$1, {
26
- active: isActive.value,
27
- onClick: _cache[0] || (_cache[0] = $event => unref(toolbar)?.strike(!isActive.value))
28
- }, {
29
- default: withCtx(() => [createVNode(unref(stdin_default$2), {
30
- name: "co:text-strikethrough"
31
- })]),
32
- _: 1
33
- /* STABLE */
34
- }, 8, ["active"]);
35
- };
36
- }
37
- });
38
-
39
- export { stdin_default as default };
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- export default _default;
@@ -1,39 +0,0 @@
1
- import { defineComponent, inject, ref, watch, createBlock, openBlock, unref, withCtx, createVNode } from 'vue';
2
- import { toolbarContextKey } from '../toolbarContext.js';
3
- import stdin_default$1 from '../../button.vue.js';
4
- import stdin_default$2 from '../../../../icon/index.js';
5
- import { Toolbar } from '../toolbar.js';
6
-
7
- var stdin_default = /* @__PURE__ */defineComponent({
8
- __name: "strikethrough",
9
- setup(__props) {
10
- const {
11
- toolbar
12
- } = inject(toolbarContextKey);
13
- const isActive = ref(false);
14
- watch(toolbar, toolbar2 => {
15
- if (toolbar2) {
16
- toolbar2.on(Toolbar.events.EDITOR_CHANGE, event => {
17
- const formats = event.detail.formats;
18
- isActive.value = formats["strike"] != null;
19
- });
20
- }
21
- }, {
22
- immediate: true
23
- });
24
- return (_ctx, _cache) => {
25
- return openBlock(), createBlock(stdin_default$1, {
26
- active: isActive.value,
27
- onClick: _cache[0] || (_cache[0] = $event => unref(toolbar)?.strike(!isActive.value))
28
- }, {
29
- default: withCtx(() => [createVNode(unref(stdin_default$2), {
30
- name: "bi:type-strikethrough"
31
- })]),
32
- _: 1
33
- /* STABLE */
34
- }, 8, ["active"]);
35
- };
36
- }
37
- });
38
-
39
- export { stdin_default as default };
@@ -1,4 +0,0 @@
1
- declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../../../../theme/theme-context").ThemeManager) => {
2
- hashId: import("vue").Ref<string, string>;
3
- };
4
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- export default _default;
@@ -1,100 +0,0 @@
1
- import { defineComponent, inject, ref, useTemplateRef, shallowRef, reactive, onMounted, createBlock, openBlock, unref, withCtx, createVNode, createElementVNode, normalizeClass, createElementBlock, Fragment, renderList, toDisplayString } from 'vue';
2
- import { toolbarContextKey } from '../toolbarContext.js';
3
- import stdin_default$2 from '../../picker/picker.vue.js';
4
- import stdin_default$3 from '../../button.vue.js';
5
- import { Icon as _Icon } from '../../../../icon/index.js';
6
- import stdin_default$1 from './table.style.js';
7
- import { useComponentConfig } from '../../../../config-provider/config-provider.api.js';
8
-
9
- const _hoisted_1 = ["onPointerover", "onClick"];
10
- const count = 10;
11
- var stdin_default = /* @__PURE__ */defineComponent({
12
- __name: "table",
13
- setup(__props) {
14
- const {
15
- prefixCls
16
- } = useComponentConfig("editor-table");
17
- const {
18
- hashId
19
- } = stdin_default$1(prefixCls);
20
- const {
21
- toolbar
22
- } = inject(toolbarContextKey);
23
- const visible = ref(false);
24
- const buttonRef = useTemplateRef("button");
25
- const triggerTarget = shallowRef();
26
- const grid = reactive({
27
- row: 0,
28
- col: 0
29
- });
30
- onMounted(() => {
31
- triggerTarget.value = buttonRef.value?.el;
32
- });
33
- const onBtnClick = () => {
34
- if (!visible.value) {
35
- grid.row = 0;
36
- grid.col = 0;
37
- }
38
- visible.value = !visible.value;
39
- };
40
- const onCellPointerOver = (row, col) => {
41
- grid.row = row;
42
- grid.col = col;
43
- };
44
- const onCellClick = (row, col) => {
45
- visible.value = false;
46
- const table = toolbar.value.quill.getModule("table");
47
- toolbar.value.quill.focus();
48
- table.insertTable(row, col);
49
- };
50
- return (_ctx, _cache) => {
51
- return openBlock(), createBlock(stdin_default$2, {
52
- "popper-class": [unref(hashId), unref(prefixCls)],
53
- visible: visible.value,
54
- "onUpdate:visible": _cache[0] || (_cache[0] = $event => visible.value = $event),
55
- "trigger-target": triggerTarget.value,
56
- nopadding: ""
57
- }, {
58
- content: withCtx(() => [createElementVNode("div", {
59
- class: normalizeClass(`${unref(prefixCls)}-grid`)
60
- }, [(openBlock(), createElementBlock(Fragment, null, renderList(count, row => {
61
- return createElementVNode("div", {
62
- key: row,
63
- class: normalizeClass(`${unref(prefixCls)}-row`)
64
- }, [(openBlock(), createElementBlock(Fragment, null, renderList(count, col => {
65
- return createElementVNode("div", {
66
- key: col,
67
- class: normalizeClass([`${unref(prefixCls)}-cell`, {
68
- "is-selected": col <= grid.col && row <= grid.row
69
- }]),
70
- onPointerover: $event => onCellPointerOver(row, col),
71
- onClick: $event => onCellClick(row, col)
72
- }, null, 42, _hoisted_1);
73
- }), 64
74
- /* STABLE_FRAGMENT */))], 2
75
- /* CLASS */);
76
- }), 64
77
- /* STABLE_FRAGMENT */))], 2
78
- /* CLASS */), createElementVNode("div", {
79
- class: normalizeClass(`${unref(prefixCls)}-count`)
80
- }, toDisplayString(`${grid.col}x${grid.row}`), 3
81
- /* TEXT, CLASS */)]),
82
- default: withCtx(() => [createVNode(stdin_default$3, {
83
- ref: "button",
84
- onClick: onBtnClick
85
- }, {
86
- default: withCtx(() => [createVNode(unref(_Icon), {
87
- name: "co:table"
88
- })]),
89
- _: 1
90
- /* STABLE */
91
- }, 512
92
- /* NEED_PATCH */)]),
93
- _: 1
94
- /* STABLE */
95
- }, 8, ["popper-class", "visible", "trigger-target"]);
96
- };
97
- }
98
- });
99
-
100
- export { stdin_default as default };
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- export default _default;
@@ -1,39 +0,0 @@
1
- import { defineComponent, inject, ref, watch, createBlock, openBlock, unref, withCtx, createVNode } from 'vue';
2
- import { toolbarContextKey } from '../toolbarContext.js';
3
- import stdin_default$1 from '../../button.vue.js';
4
- import stdin_default$2 from '../../../../icon/index.js';
5
- import { Toolbar } from '../toolbar.js';
6
-
7
- var stdin_default = /* @__PURE__ */defineComponent({
8
- __name: "underline",
9
- setup(__props) {
10
- const {
11
- toolbar
12
- } = inject(toolbarContextKey);
13
- const isActive = ref(false);
14
- watch(toolbar, toolbar2 => {
15
- if (toolbar2) {
16
- toolbar2.on(Toolbar.events.EDITOR_CHANGE, event => {
17
- const formats = event.detail.formats;
18
- isActive.value = formats["underline"] != null;
19
- });
20
- }
21
- }, {
22
- immediate: true
23
- });
24
- return (_ctx, _cache) => {
25
- return openBlock(), createBlock(stdin_default$1, {
26
- active: isActive.value,
27
- onClick: _cache[0] || (_cache[0] = $event => unref(toolbar)?.underline(!isActive.value))
28
- }, {
29
- default: withCtx(() => [createVNode(unref(stdin_default$2), {
30
- name: "co:text-underline"
31
- })]),
32
- _: 1
33
- /* STABLE */
34
- }, 8, ["active"]);
35
- };
36
- }
37
- });
38
-
39
- export { stdin_default as default };
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- export default _default;
@@ -1,123 +0,0 @@
1
- import { defineComponent, inject, ref, computed, reactive, createElementBlock, openBlock, Fragment, createVNode, withCtx, unref } from 'vue';
2
- import { toolbarContextKey } from '../toolbarContext.js';
3
- import stdin_default$1 from '../../button.vue.js';
4
- import stdin_default$2 from '../../../../icon/index.js';
5
- import { FormDialog as _FormDialog } from '../../../../form-dialog/index.js';
6
- import { Form as _Form, FormItem as _FormItem } from '../../../../form/index.js';
7
- import Quill from 'quill';
8
- import { useLocale } from '../../../../../hooks/useLocale.js';
9
-
10
- var stdin_default = /* @__PURE__ */defineComponent({
11
- __name: "video",
12
- setup(__props) {
13
- const {
14
- t
15
- } = useLocale();
16
- const {
17
- quill
18
- } = inject(toolbarContextKey);
19
- const visible = ref(false);
20
- let currentTarget = null;
21
- const actionType = ref("insert");
22
- const title = computed(() => `${actionType.value === "update" ? t("co.editor.edit") : t("co.editor.insert")}${t("co.editor.video")}`);
23
- const formModel = reactive({
24
- url: "",
25
- width: "300",
26
- height: "150"
27
- });
28
- const onBtnClick = () => {
29
- const range = quill.value.getSelection(true);
30
- const [blot] = quill.value.getLeaf(range.index - 1);
31
- if (blot && blot.domNode instanceof Element && blot.domNode.tagName === "VIDEO") {
32
- const el = currentTarget = blot.domNode;
33
- Object.assign(formModel, {
34
- url: el.getAttribute("src"),
35
- width: el.getAttribute("width"),
36
- height: el.getAttribute("height")
37
- });
38
- actionType.value = "update";
39
- } else {
40
- currentTarget = null;
41
- actionType.value = "insert";
42
- }
43
- visible.value = true;
44
- };
45
- const onSubmit = () => {
46
- if (!formModel.url) {
47
- return;
48
- }
49
- if (actionType.value === "insert") {
50
- const value = {
51
- url: formModel.url,
52
- width: formModel.width,
53
- height: formModel.height
54
- };
55
- const range = quill.value.getSelection(true);
56
- quill.value.insertEmbed(range.index + range.length, "video", value, Quill.sources.USER);
57
- } else if (currentTarget) {
58
- currentTarget.setAttribute("src", formModel.url);
59
- currentTarget.setAttribute("width", formModel.width);
60
- currentTarget.setAttribute("height", formModel.height);
61
- }
62
- };
63
- return (_ctx, _cache) => {
64
- return openBlock(), createElementBlock(Fragment, null, [createVNode(stdin_default$1, {
65
- onClick: onBtnClick
66
- }, {
67
- default: withCtx(() => [createVNode(unref(stdin_default$2), {
68
- name: "co:video-player"
69
- })]),
70
- _: 1
71
- /* STABLE */
72
- }), createVNode(unref(_FormDialog), {
73
- modelValue: visible.value,
74
- "onUpdate:modelValue": _cache[3] || (_cache[3] = $event => visible.value = $event),
75
- title: title.value,
76
- width: "sm"
77
- }, {
78
- default: withCtx(() => [createVNode(unref(_Form), {
79
- model: formModel,
80
- "label-width": "auto",
81
- grid: "",
82
- "row-props": {
83
- gutter: 16
84
- },
85
- submit: onSubmit
86
- }, {
87
- default: withCtx(() => [createVNode(unref(_FormItem), {
88
- modelValue: formModel.url,
89
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => formModel.url = $event),
90
- prop: "url",
91
- label: "URL",
92
- "field-type": "input"
93
- }, null, 8, ["modelValue"]), createVNode(unref(_FormItem), {
94
- modelValue: formModel.width,
95
- "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => formModel.width = $event),
96
- prop: "width",
97
- label: unref(t)("co.editor.width"),
98
- "field-type": "input",
99
- "col-props": {
100
- span: 12
101
- }
102
- }, null, 8, ["modelValue", "label"]), createVNode(unref(_FormItem), {
103
- modelValue: formModel.height,
104
- "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => formModel.height = $event),
105
- prop: "height",
106
- label: unref(t)("co.editor.height"),
107
- "field-type": "input",
108
- "col-props": {
109
- span: 12
110
- }
111
- }, null, 8, ["modelValue", "label"])]),
112
- _: 1
113
- /* STABLE */
114
- }, 8, ["model"])]),
115
- _: 1
116
- /* STABLE */
117
- }, 8, ["modelValue", "title"])], 64
118
- /* STABLE_FRAGMENT */);
119
- };
120
- }
121
- });
122
-
123
- export { stdin_default as default };
@@ -1,36 +0,0 @@
1
- import Quill from 'quill';
2
- export declare class Toolbar extends EventTarget {
3
- quill: Quill;
4
- static events: {
5
- readonly EDITOR_CHANGE: "editor-change";
6
- };
7
- constructor(quill: Quill);
8
- on(event: typeof Toolbar.events.EDITOR_CHANGE, handler: (event: CustomEvent<{
9
- formats: {
10
- [format: string]: unknown;
11
- };
12
- }>) => void): void;
13
- off(event: string, handler: (event: CustomEvent) => void): void;
14
- emit(event: string, payload?: unknown): void;
15
- font(value: string): void;
16
- size(value: string): void;
17
- header(value: number | false): void;
18
- align(value: 'left' | 'center' | 'right' | 'justify', isActive?: boolean): void;
19
- bold(value?: boolean): void;
20
- italic(value?: boolean): void;
21
- underline(value?: boolean): void;
22
- strike(value?: boolean): void;
23
- script(value: 'super' | 'sub', isActive?: boolean): void;
24
- indentStyle(value: string): void;
25
- indent(value: string): void;
26
- list(value: string): void;
27
- blockquote(value?: boolean): void;
28
- codeBlock(value?: boolean): void;
29
- code(value?: boolean): void;
30
- link(value: string): void;
31
- image(): void;
32
- formula(value: string): void;
33
- color(value: string | false): void;
34
- background(value: string | false): void;
35
- clean(): void;
36
- }
@@ -1,137 +0,0 @@
1
- import Quill, { Parchment } from 'quill';
2
- import { INDENT_STEP } from '../../formats/indent.js';
3
-
4
- class Toolbar extends EventTarget {
5
- quill;
6
- static events = {
7
- EDITOR_CHANGE: "editor-change"
8
- };
9
- constructor(quill) {
10
- super();
11
- this.quill = quill;
12
- quill.on(Quill.events.EDITOR_CHANGE, () => {
13
- const [range] = this.quill.selection.getRange();
14
- const formats = range == null ? {} : this.quill.getFormat(range);
15
- this.emit(Toolbar.events.EDITOR_CHANGE, { formats });
16
- });
17
- }
18
- on(event, handler) {
19
- this.addEventListener(event, handler);
20
- }
21
- off(event, handler) {
22
- this.removeEventListener(event, handler);
23
- }
24
- emit(event, payload) {
25
- this.dispatchEvent(
26
- new CustomEvent(event, {
27
- detail: payload
28
- })
29
- );
30
- }
31
- font(value) {
32
- this.quill.format("font", value, Quill.sources.USER);
33
- }
34
- size(value) {
35
- this.quill.format("size", value, Quill.sources.USER);
36
- }
37
- header(value) {
38
- this.quill.format("header", value, Quill.sources.USER);
39
- }
40
- align(value, isActive) {
41
- this.quill.format("align", isActive ? false : value, Quill.sources.USER);
42
- }
43
- bold(value) {
44
- this.quill.format("bold", value, Quill.sources.USER);
45
- }
46
- italic(value) {
47
- this.quill.format("italic", value, Quill.sources.USER);
48
- }
49
- underline(value) {
50
- this.quill.format("underline", value, Quill.sources.USER);
51
- }
52
- strike(value) {
53
- this.quill.format("strike", value, Quill.sources.USER);
54
- }
55
- script(value, isActive) {
56
- this.quill.format("script", isActive ? false : value, Quill.sources.USER);
57
- }
58
- indentStyle(value) {
59
- const range = this.quill.getSelection(true);
60
- const formats = this.quill.getFormat(range);
61
- const indent = parseInt(formats.indent || "0", 10);
62
- if (value === "+1" || value === "-1") {
63
- const modifier = value === "+1" ? INDENT_STEP : -INDENT_STEP;
64
- this.quill.format("indent", indent + modifier, Quill.sources.USER);
65
- }
66
- }
67
- indent(value) {
68
- const range = this.quill.getSelection(true);
69
- const formats = this.quill.getFormat(range);
70
- const indent = parseInt(formats.indent || "0", 10);
71
- if (value === "+1" || value === "-1") {
72
- let modifier = value === "+1" ? 1 : -1;
73
- if (formats.direction === "rtl") modifier *= -1;
74
- this.quill.format("indent", indent + modifier, Quill.sources.USER);
75
- }
76
- }
77
- list(value) {
78
- const range = this.quill.getSelection(true);
79
- const formats = this.quill.getFormat(range);
80
- if (value === "check") {
81
- if (formats.list === "checked" || formats.list === "unchecked") {
82
- this.quill.format("list", false, Quill.sources.USER);
83
- } else {
84
- this.quill.format("list", "unchecked", Quill.sources.USER);
85
- }
86
- } else {
87
- this.quill.format("list", value, Quill.sources.USER);
88
- }
89
- }
90
- blockquote(value) {
91
- this.quill.format("blockquote", value, Quill.sources.USER);
92
- }
93
- codeBlock(value) {
94
- this.quill.format("code-block", value, Quill.sources.USER);
95
- }
96
- code(value) {
97
- this.quill.format("code", value, Quill.sources.USER);
98
- }
99
- link(value) {
100
- this.quill.format("link", value, Quill.sources.USER);
101
- }
102
- image() {
103
- const imageUploader = this.quill.getModule("imageUploader");
104
- imageUploader.selectLocalImage();
105
- }
106
- formula(value) {
107
- const range = this.quill.getSelection(true);
108
- if (range != null) {
109
- const index = range.index + range.length;
110
- this.quill.insertEmbed(index, "formula", value, Quill.sources.USER);
111
- this.quill.insertText(index + 1, " ", Quill.sources.USER);
112
- this.quill.setSelection(index + 2, Quill.sources.USER);
113
- }
114
- }
115
- color(value) {
116
- this.quill.format("color", value, Quill.sources.USER);
117
- }
118
- background(value) {
119
- this.quill.format("background", value, Quill.sources.USER);
120
- }
121
- clean() {
122
- const range = this.quill.getSelection(true);
123
- if (range == null) return;
124
- if (range.length === 0) {
125
- const formats = this.quill.getFormat();
126
- Object.keys(formats).forEach((name) => {
127
- if (this.quill.scroll.query(name, Parchment.Scope.INLINE) != null) {
128
- this.quill.format(name, false, Quill.sources.USER);
129
- }
130
- });
131
- } else {
132
- this.quill.removeFormat(range.index, range.length, Quill.sources.USER);
133
- }
134
- }
135
- }
136
-
137
- export { Toolbar };
@@ -1,3 +0,0 @@
1
- type __VLS_Props = {};
2
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
- export default _default;