@hkyhy/marsun-components-core 0.1.82 → 0.1.98

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 (285) hide show
  1. package/dist/components/Audit/AuditLogList.d.ts +27 -0
  2. package/dist/components/Audit/AuditLogList.js +272 -0
  3. package/dist/components/Audit/AuditLogList.js.map +1 -0
  4. package/dist/components/Audit/formatAuditCurl.d.ts +27 -0
  5. package/dist/components/Audit/formatAuditCurl.js +115 -0
  6. package/dist/components/Audit/formatAuditCurl.js.map +1 -0
  7. package/dist/components/Audit/formatAuditJson.d.ts +15 -0
  8. package/dist/components/Audit/formatAuditJson.js +135 -0
  9. package/dist/components/Audit/formatAuditJson.js.map +1 -0
  10. package/dist/components/Audit/index.d.ts +3 -0
  11. package/dist/components/Audit/style.module.scss.js +30 -0
  12. package/dist/components/Audit/style.module.scss.js.map +1 -0
  13. package/dist/components/Audit/types.d.ts +39 -0
  14. package/dist/components/Editor/RichTextEditor/RichTextEditor.d.ts +24 -0
  15. package/dist/components/Editor/RichTextEditor/RichTextEditor.js +93 -0
  16. package/dist/components/Editor/RichTextEditor/RichTextEditor.js.map +1 -0
  17. package/dist/components/Editor/RichTextEditor/index.d.ts +2 -0
  18. package/dist/components/Editor/RichTextEditor/style.module.scss.js +11 -0
  19. package/dist/components/Editor/RichTextEditor/style.module.scss.js.map +1 -0
  20. package/dist/components/Editor/VariablePicker.d.ts +19 -0
  21. package/dist/components/Editor/VariablePicker.js +55 -0
  22. package/dist/components/Editor/VariablePicker.js.map +1 -0
  23. package/dist/components/Editor/index.d.ts +7 -0
  24. package/dist/components/Editor/index.js +21 -0
  25. package/dist/components/Editor/index.js.map +1 -0
  26. package/dist/components/Editor/msgVarTokenPlugin.d.ts +13 -0
  27. package/dist/components/Editor/msgVarTokenPlugin.js +94 -0
  28. package/dist/components/Editor/msgVarTokenPlugin.js.map +1 -0
  29. package/dist/components/Editor/variableMention.d.ts +37 -0
  30. package/dist/components/Editor/variableMention.js +64 -0
  31. package/dist/components/Editor/variableMention.js.map +1 -0
  32. package/dist/components/FormInfo/RichTextField/index.d.ts +21 -0
  33. package/dist/components/FormInfo/RichTextField/index.js +82 -0
  34. package/dist/components/FormInfo/RichTextField/index.js.map +1 -0
  35. package/dist/components/FormInfo/RichTextField/style.module.scss.js +9 -0
  36. package/dist/components/FormInfo/RichTextField/style.module.scss.js.map +1 -0
  37. package/dist/components/FormInfo/VariableMentionInput/index.d.ts +17 -0
  38. package/dist/components/FormInfo/VariableMentionInput/index.js +73 -0
  39. package/dist/components/FormInfo/VariableMentionInput/index.js.map +1 -0
  40. package/dist/components/FormInfo/VariableMentionInput/style.module.scss.js +11 -0
  41. package/dist/components/FormInfo/VariableMentionInput/style.module.scss.js.map +1 -0
  42. package/dist/components/FormInfo/fields.d.ts +5 -0
  43. package/dist/components/FormInfo/fields.js +32 -23
  44. package/dist/components/FormInfo/fields.js.map +1 -1
  45. package/dist/components/FormInfo/index.d.ts +4 -0
  46. package/dist/components/StateBar/StateBar.d.ts +19 -6
  47. package/dist/components/StateBar/StateBar.js +87 -50
  48. package/dist/components/StateBar/StateBar.js.map +1 -1
  49. package/dist/components/StateBar/style.module.scss.js +13 -10
  50. package/dist/components/StateBar/style.module.scss.js.map +1 -1
  51. package/dist/components/Table/ResizableHeaderCell.js +37 -38
  52. package/dist/components/Table/ResizableHeaderCell.js.map +1 -1
  53. package/dist/components/Table/Table.js +88 -89
  54. package/dist/components/Table/Table.js.map +1 -1
  55. package/dist/components/Table/columnConfigUtils.d.ts +1 -1
  56. package/dist/components/Table/columnConfigUtils.js.map +1 -1
  57. package/dist/components/Table/style.module.scss.js +34 -34
  58. package/dist/components/Tools/Inbox/InboxBell/InboxBell.d.ts +45 -0
  59. package/dist/components/Tools/Inbox/InboxBell/InboxBell.js +156 -0
  60. package/dist/components/Tools/Inbox/InboxBell/InboxBell.js.map +1 -0
  61. package/dist/components/Tools/Inbox/InboxBell/index.d.ts +2 -0
  62. package/dist/components/Tools/Inbox/InboxBell/style.module.scss.js +30 -0
  63. package/dist/components/Tools/Inbox/InboxBell/style.module.scss.js.map +1 -0
  64. package/dist/components/Tools/Inbox/index.d.ts +2 -0
  65. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/List/columns.d.ts +8 -0
  66. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/List/columns.js +56 -0
  67. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/List/columns.js.map +1 -0
  68. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.d.ts +8 -0
  69. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.js +216 -0
  70. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.js.map +1 -0
  71. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.d.ts +26 -0
  72. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.js +190 -0
  73. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.js.map +1 -0
  74. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/index.d.ts +3 -0
  75. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/style.module.scss.js +12 -0
  76. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/style.module.scss.js.map +1 -0
  77. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.d.ts +76 -0
  78. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.js +26 -0
  79. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.js.map +1 -0
  80. package/dist/components/Tools/MessageCenter/index.d.ts +3 -0
  81. package/dist/components/Tools/MessageCenter/utils/templateCode.d.ts +8 -0
  82. package/dist/components/Tools/MessageCenter/utils/templateCode.js +25 -0
  83. package/dist/components/Tools/MessageCenter/utils/templateCode.js.map +1 -0
  84. package/dist/components/Tools/index.d.ts +5 -0
  85. package/dist/components/index.d.ts +3 -0
  86. package/dist/editor.d.ts +5 -0
  87. package/dist/editor.js +21 -0
  88. package/dist/editor.js.map +1 -0
  89. package/dist/form-info.js +33 -29
  90. package/dist/form-info.js.map +1 -1
  91. package/dist/index.d.ts +5 -0
  92. package/dist/index.js +805 -773
  93. package/dist/index.js.map +1 -1
  94. package/dist/marsun-components-core.css +4 -1
  95. package/dist/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +301 -0
  96. package/dist/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js.map +1 -0
  97. package/dist/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +1256 -0
  98. package/dist/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js.map +1 -0
  99. package/dist/node_modules/@ckeditor/ckeditor5-core/dist/index.js +2107 -0
  100. package/dist/node_modules/@ckeditor/ckeditor5-core/dist/index.js.map +1 -0
  101. package/dist/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +259 -0
  102. package/dist/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js.map +1 -0
  103. package/dist/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +23990 -0
  104. package/dist/node_modules/@ckeditor/ckeditor5-engine/dist/index.js.map +1 -0
  105. package/dist/node_modules/@ckeditor/ckeditor5-enter/dist/index.js +249 -0
  106. package/dist/node_modules/@ckeditor/ckeditor5-enter/dist/index.js.map +1 -0
  107. package/dist/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js +47 -0
  108. package/dist/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js.map +1 -0
  109. package/dist/node_modules/@ckeditor/ckeditor5-font/dist/index.js +100 -0
  110. package/dist/node_modules/@ckeditor/ckeditor5-font/dist/index.js.map +1 -0
  111. package/dist/node_modules/@ckeditor/ckeditor5-icons/dist/index.js +31 -0
  112. package/dist/node_modules/@ckeditor/ckeditor5-icons/dist/index.js.map +1 -0
  113. package/dist/node_modules/@ckeditor/ckeditor5-integrations-common/dist/index.js +194 -0
  114. package/dist/node_modules/@ckeditor/ckeditor5-integrations-common/dist/index.js.map +1 -0
  115. package/dist/node_modules/@ckeditor/ckeditor5-list/dist/index.js +2042 -0
  116. package/dist/node_modules/@ckeditor/ckeditor5-list/dist/index.js.map +1 -0
  117. package/dist/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +9 -0
  118. package/dist/node_modules/@ckeditor/ckeditor5-mention/dist/index.js.map +1 -0
  119. package/dist/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +167 -0
  120. package/dist/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js.map +1 -0
  121. package/dist/node_modules/@ckeditor/ckeditor5-react/dist/index.js +471 -0
  122. package/dist/node_modules/@ckeditor/ckeditor5-react/dist/index.js.map +1 -0
  123. package/dist/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +139 -0
  124. package/dist/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js.map +1 -0
  125. package/dist/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +755 -0
  126. package/dist/node_modules/@ckeditor/ckeditor5-typing/dist/index.js.map +1 -0
  127. package/dist/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +7838 -0
  128. package/dist/node_modules/@ckeditor/ckeditor5-ui/dist/index.js.map +1 -0
  129. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/conversions.js +422 -0
  130. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/conversions.js.map +1 -0
  131. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/index.js +33 -0
  132. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/index.js.map +1 -0
  133. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/route.js +47 -0
  134. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/route.js.map +1 -0
  135. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-name/index.js +156 -0
  136. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-name/index.js.map +1 -0
  137. package/dist/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +313 -0
  138. package/dist/node_modules/@ckeditor/ckeditor5-undo/dist/index.js.map +1 -0
  139. package/dist/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +2942 -0
  140. package/dist/node_modules/@ckeditor/ckeditor5-utils/dist/index.js.map +1 -0
  141. package/dist/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +892 -0
  142. package/dist/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js.map +1 -0
  143. package/dist/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +1047 -0
  144. package/dist/node_modules/@ckeditor/ckeditor5-widget/dist/index.js.map +1 -0
  145. package/dist/node_modules/color-parse/node_modules/color-name/index.js +153 -0
  146. package/dist/node_modules/color-parse/node_modules/color-name/index.js.map +1 -0
  147. package/dist/node_modules/es-toolkit/dist/_internal/globalThis.js +7 -0
  148. package/dist/node_modules/es-toolkit/dist/_internal/globalThis.js.map +1 -0
  149. package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js +7 -0
  150. package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js.map +1 -0
  151. package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeToWriteProperty.js +7 -0
  152. package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeToWriteProperty.js.map +1 -0
  153. package/dist/node_modules/es-toolkit/dist/compat/_internal/assignValue.js +9 -0
  154. package/dist/node_modules/es-toolkit/dist/compat/_internal/assignValue.js.map +1 -0
  155. package/dist/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js +7 -0
  156. package/dist/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js.map +1 -0
  157. package/dist/node_modules/es-toolkit/dist/compat/_internal/getTag.js +7 -0
  158. package/dist/node_modules/es-toolkit/dist/compat/_internal/getTag.js.map +1 -0
  159. package/dist/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js +16 -0
  160. package/dist/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js.map +1 -0
  161. package/dist/node_modules/es-toolkit/dist/compat/_internal/isIndex.js +15 -0
  162. package/dist/node_modules/es-toolkit/dist/compat/_internal/isIndex.js.map +1 -0
  163. package/dist/node_modules/es-toolkit/dist/compat/_internal/isKey.js +9 -0
  164. package/dist/node_modules/es-toolkit/dist/compat/_internal/isKey.js.map +1 -0
  165. package/dist/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js +8 -0
  166. package/dist/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js.map +1 -0
  167. package/dist/node_modules/es-toolkit/dist/compat/_internal/tags.js +30 -0
  168. package/dist/node_modules/es-toolkit/dist/compat/_internal/tags.js.map +1 -0
  169. package/dist/node_modules/es-toolkit/dist/compat/_internal/toKey.js +8 -0
  170. package/dist/node_modules/es-toolkit/dist/compat/_internal/toKey.js.map +1 -0
  171. package/dist/node_modules/es-toolkit/dist/compat/function/debounce.js +17 -0
  172. package/dist/node_modules/es-toolkit/dist/compat/function/debounce.js.map +1 -0
  173. package/dist/node_modules/es-toolkit/dist/compat/function/throttle.js +13 -0
  174. package/dist/node_modules/es-toolkit/dist/compat/function/throttle.js.map +1 -0
  175. package/dist/node_modules/es-toolkit/dist/compat/object/assignIn.js +17 -0
  176. package/dist/node_modules/es-toolkit/dist/compat/object/assignIn.js.map +1 -0
  177. package/dist/node_modules/es-toolkit/dist/compat/object/clone.js +102 -0
  178. package/dist/node_modules/es-toolkit/dist/compat/object/clone.js.map +1 -0
  179. package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +8 -0
  180. package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js.map +1 -0
  181. package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js +33 -0
  182. package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js.map +1 -0
  183. package/dist/node_modules/es-toolkit/dist/compat/object/get.js +39 -0
  184. package/dist/node_modules/es-toolkit/dist/compat/object/get.js.map +1 -0
  185. package/dist/node_modules/es-toolkit/dist/compat/object/has.js +21 -0
  186. package/dist/node_modules/es-toolkit/dist/compat/object/has.js.map +1 -0
  187. package/dist/node_modules/es-toolkit/dist/compat/object/keysIn.js +33 -0
  188. package/dist/node_modules/es-toolkit/dist/compat/object/keysIn.js.map +1 -0
  189. package/dist/node_modules/es-toolkit/dist/compat/object/mapValues.js +10 -0
  190. package/dist/node_modules/es-toolkit/dist/compat/object/mapValues.js.map +1 -0
  191. package/dist/node_modules/es-toolkit/dist/compat/object/merge.js +9 -0
  192. package/dist/node_modules/es-toolkit/dist/compat/object/merge.js.map +1 -0
  193. package/dist/node_modules/es-toolkit/dist/compat/object/mergeWith.js +53 -0
  194. package/dist/node_modules/es-toolkit/dist/compat/object/mergeWith.js.map +1 -0
  195. package/dist/node_modules/es-toolkit/dist/compat/object/property.js +10 -0
  196. package/dist/node_modules/es-toolkit/dist/compat/object/property.js.map +1 -0
  197. package/dist/node_modules/es-toolkit/dist/compat/object/set.js +9 -0
  198. package/dist/node_modules/es-toolkit/dist/compat/object/set.js.map +1 -0
  199. package/dist/node_modules/es-toolkit/dist/compat/object/updateWith.js +31 -0
  200. package/dist/node_modules/es-toolkit/dist/compat/object/updateWith.js.map +1 -0
  201. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArguments.js +8 -0
  202. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArguments.js.map +1 -0
  203. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArray.js +7 -0
  204. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArray.js.map +1 -0
  205. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js +8 -0
  206. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js.map +1 -0
  207. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js +9 -0
  208. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js.map +1 -0
  209. package/dist/node_modules/es-toolkit/dist/compat/predicate/isElement.js +9 -0
  210. package/dist/node_modules/es-toolkit/dist/compat/predicate/isElement.js.map +1 -0
  211. package/dist/node_modules/es-toolkit/dist/compat/predicate/isEqualWith.js +15 -0
  212. package/dist/node_modules/es-toolkit/dist/compat/predicate/isEqualWith.js.map +1 -0
  213. package/dist/node_modules/es-toolkit/dist/compat/predicate/isFunction.js +7 -0
  214. package/dist/node_modules/es-toolkit/dist/compat/predicate/isFunction.js.map +1 -0
  215. package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatch.js +9 -0
  216. package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatch.js.map +1 -0
  217. package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatchWith.js +81 -0
  218. package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatchWith.js.map +1 -0
  219. package/dist/node_modules/es-toolkit/dist/compat/predicate/isObject.js +7 -0
  220. package/dist/node_modules/es-toolkit/dist/compat/predicate/isObject.js.map +1 -0
  221. package/dist/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js +7 -0
  222. package/dist/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js.map +1 -0
  223. package/dist/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js +16 -0
  224. package/dist/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js.map +1 -0
  225. package/dist/node_modules/es-toolkit/dist/compat/predicate/isString.js +7 -0
  226. package/dist/node_modules/es-toolkit/dist/compat/predicate/isString.js.map +1 -0
  227. package/dist/node_modules/es-toolkit/dist/compat/predicate/isSymbol.js +7 -0
  228. package/dist/node_modules/es-toolkit/dist/compat/predicate/isSymbol.js.map +1 -0
  229. package/dist/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js +8 -0
  230. package/dist/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js.map +1 -0
  231. package/dist/node_modules/es-toolkit/dist/compat/predicate/matches.js +9 -0
  232. package/dist/node_modules/es-toolkit/dist/compat/predicate/matches.js.map +1 -0
  233. package/dist/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +23 -0
  234. package/dist/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js.map +1 -0
  235. package/dist/node_modules/es-toolkit/dist/compat/util/eq.js +7 -0
  236. package/dist/node_modules/es-toolkit/dist/compat/util/eq.js.map +1 -0
  237. package/dist/node_modules/es-toolkit/dist/compat/util/iteratee.js +19 -0
  238. package/dist/node_modules/es-toolkit/dist/compat/util/iteratee.js.map +1 -0
  239. package/dist/node_modules/es-toolkit/dist/compat/util/times.js +11 -0
  240. package/dist/node_modules/es-toolkit/dist/compat/util/times.js.map +1 -0
  241. package/dist/node_modules/es-toolkit/dist/compat/util/toFinite.js +8 -0
  242. package/dist/node_modules/es-toolkit/dist/compat/util/toFinite.js.map +1 -0
  243. package/dist/node_modules/es-toolkit/dist/compat/util/toInteger.js +9 -0
  244. package/dist/node_modules/es-toolkit/dist/compat/util/toInteger.js.map +1 -0
  245. package/dist/node_modules/es-toolkit/dist/compat/util/toNumber.js +8 -0
  246. package/dist/node_modules/es-toolkit/dist/compat/util/toNumber.js.map +1 -0
  247. package/dist/node_modules/es-toolkit/dist/compat/util/toPath.js +37 -0
  248. package/dist/node_modules/es-toolkit/dist/compat/util/toPath.js.map +1 -0
  249. package/dist/node_modules/es-toolkit/dist/compat/util/toString.js +15 -0
  250. package/dist/node_modules/es-toolkit/dist/compat/util/toString.js.map +1 -0
  251. package/dist/node_modules/es-toolkit/dist/function/after.js +11 -0
  252. package/dist/node_modules/es-toolkit/dist/function/after.js.map +1 -0
  253. package/dist/node_modules/es-toolkit/dist/function/debounce.js +30 -0
  254. package/dist/node_modules/es-toolkit/dist/function/debounce.js.map +1 -0
  255. package/dist/node_modules/es-toolkit/dist/function/identity.js +7 -0
  256. package/dist/node_modules/es-toolkit/dist/function/identity.js.map +1 -0
  257. package/dist/node_modules/es-toolkit/dist/function/noop.js +6 -0
  258. package/dist/node_modules/es-toolkit/dist/function/noop.js.map +1 -0
  259. package/dist/node_modules/es-toolkit/dist/object/clone.js +27 -0
  260. package/dist/node_modules/es-toolkit/dist/object/clone.js.map +1 -0
  261. package/dist/node_modules/es-toolkit/dist/object/cloneDeep.js +8 -0
  262. package/dist/node_modules/es-toolkit/dist/object/cloneDeep.js.map +1 -0
  263. package/dist/node_modules/es-toolkit/dist/object/cloneDeepWith.js +121 -0
  264. package/dist/node_modules/es-toolkit/dist/object/cloneDeepWith.js.map +1 -0
  265. package/dist/node_modules/es-toolkit/dist/object/mapValues.js +12 -0
  266. package/dist/node_modules/es-toolkit/dist/object/mapValues.js.map +1 -0
  267. package/dist/node_modules/es-toolkit/dist/predicate/isBuffer.js +8 -0
  268. package/dist/node_modules/es-toolkit/dist/predicate/isBuffer.js.map +1 -0
  269. package/dist/node_modules/es-toolkit/dist/predicate/isEqual.js +9 -0
  270. package/dist/node_modules/es-toolkit/dist/predicate/isEqual.js.map +1 -0
  271. package/dist/node_modules/es-toolkit/dist/predicate/isEqualWith.js +110 -0
  272. package/dist/node_modules/es-toolkit/dist/predicate/isEqualWith.js.map +1 -0
  273. package/dist/node_modules/es-toolkit/dist/predicate/isLength.js +7 -0
  274. package/dist/node_modules/es-toolkit/dist/predicate/isLength.js.map +1 -0
  275. package/dist/node_modules/es-toolkit/dist/predicate/isPlainObject.js +9 -0
  276. package/dist/node_modules/es-toolkit/dist/predicate/isPlainObject.js.map +1 -0
  277. package/dist/node_modules/es-toolkit/dist/predicate/isPrimitive.js +7 -0
  278. package/dist/node_modules/es-toolkit/dist/predicate/isPrimitive.js.map +1 -0
  279. package/dist/node_modules/es-toolkit/dist/predicate/isTypedArray.js +7 -0
  280. package/dist/node_modules/es-toolkit/dist/predicate/isTypedArray.js.map +1 -0
  281. package/dist/styles/global.css +4 -1
  282. package/dist/utils/copyText.d.ts +4 -0
  283. package/dist/utils/copyText.js +21 -0
  284. package/dist/utils/copyText.js.map +1 -0
  285. package/package.json +9 -2
@@ -0,0 +1,1256 @@
1
+ var te = Object.defineProperty;
2
+ var re = (a, e, t) => e in a ? te(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
+ var g = (a, e, t) => re(a, typeof e != "symbol" ? e + "" : e, t);
4
+ import { Plugin as b } from "../../ckeditor5-core/dist/index.js";
5
+ import { uid as q, EventInfo as j, delay as H, DomEmitterMixin as A, env as f, global as h, createElement as V, Rect as _, getRangeFromMouseEvent as ne, ResizeObserver as ie, toUnit as oe } from "../../ckeditor5-utils/dist/index.js";
6
+ import { PointerObserver as se, ModelLiveRange as E, DomEventObserver as ae, ViewDataTransfer as le, ModelRange as de } from "../../ckeditor5-engine/dist/index.js";
7
+ import { throttle as B } from "../../../es-toolkit/dist/compat/function/throttle.js";
8
+ import { mapValues as ce } from "../../../es-toolkit/dist/compat/object/mapValues.js";
9
+ import { Widget as ge, isWidget as k } from "../../ckeditor5-widget/dist/index.js";
10
+ import { View as pe } from "../../ckeditor5-ui/dist/index.js";
11
+ /**
12
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
13
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
14
+ */
15
+ /**
16
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
17
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
18
+ */
19
+ function me(a) {
20
+ return a = a.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\r?\n\r?\n/g, "</p><p>").replace(/\r?\n/g, "<br>").replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;").replace(/^\s/, "&nbsp;").replace(/\s$/, "&nbsp;").replace(/\s\s/g, " &nbsp;"), (a.includes("</p><p>") || a.includes("<br>")) && (a = `<p>${a}</p>`), a;
21
+ }
22
+ /**
23
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
24
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
25
+ */
26
+ var v = class extends ae {
27
+ constructor(e) {
28
+ super(e);
29
+ g(this, "domEventType", [
30
+ "paste",
31
+ "copy",
32
+ "cut",
33
+ "drop",
34
+ "dragover",
35
+ "dragstart",
36
+ "dragend",
37
+ "dragenter",
38
+ "dragleave"
39
+ ]);
40
+ const t = this.document;
41
+ this.listenTo(t, "paste", n("clipboardInput"), { priority: "low" }), this.listenTo(t, "drop", n("clipboardInput"), { priority: "low" }), this.listenTo(t, "dragover", n("dragging"), { priority: "low" });
42
+ function n(r) {
43
+ return (i, s) => {
44
+ s.preventDefault();
45
+ const o = s.dropRange ? [s.dropRange] : null, l = s.dataTransfer, d = new j(t, r);
46
+ let c = "";
47
+ l.getData("text/html") ? c = l.getData("text/html") : l.getData("text/plain") && (c = me(l.getData("text/plain"))), t.fire(d, {
48
+ dataTransfer: l,
49
+ content: c,
50
+ method: i.name,
51
+ targetRanges: o,
52
+ target: s.target,
53
+ domEvent: s.domEvent
54
+ }), d.stop.called && s.stopPropagation();
55
+ };
56
+ }
57
+ }
58
+ onDomEvent(e) {
59
+ const t = "clipboardData" in e ? e.clipboardData : e.dataTransfer, n = e.type == "drop" || e.type == "paste", r = { dataTransfer: new le(t, { cacheFiles: n }) };
60
+ if (e.type == "drop" || e.type == "dragover") {
61
+ const i = ne(e);
62
+ r.dropRange = i && this.view.domConverter.domRangeToView(i);
63
+ }
64
+ this.fire(e.type, e, r);
65
+ }
66
+ };
67
+ /**
68
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
69
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
70
+ */
71
+ function ue(a) {
72
+ return a.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g, (e, t) => t.length == 1 ? " " : t).replace(/<!--[\s\S]*?-->/g, "");
73
+ }
74
+ /**
75
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
76
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
77
+ */
78
+ const L = ["figcaption", "li"], U = ["ol", "ul"];
79
+ function G(a, e) {
80
+ if (e.is("$text") || e.is("$textProxy")) return e.data;
81
+ if (e.is("element", "img") && e.hasAttribute("alt")) return e.getAttribute("alt");
82
+ if (e.is("element", "br")) return `
83
+ `;
84
+ let t = "", n = null;
85
+ for (const r of e.getChildren())
86
+ t += he(r, n) + G(a, r), n = r;
87
+ if (e.is("rawElement")) {
88
+ const r = document.implementation.createHTMLDocument("").createElement("div");
89
+ e.render(r, a), t += X(r);
90
+ }
91
+ return t;
92
+ }
93
+ function X(a) {
94
+ let e = "";
95
+ if (a.nodeType === Node.TEXT_NODE) return a.textContent;
96
+ if (a.tagName === "BR") return `
97
+ `;
98
+ for (const t of a.childNodes) e += X(t);
99
+ return e;
100
+ }
101
+ function he(a, e) {
102
+ return e ? a.is("element", "li") && !a.isEmpty && a.getChild(0).is("containerElement") || U.includes(a.name) && U.includes(e.name) ? `
103
+
104
+ ` : !a.is("containerElement") && !e.is("containerElement") ? "" : L.includes(a.name) || L.includes(e.name) ? `
105
+ ` : a.is("element") && a.getCustomProperty("dataPipeline:transparentRendering") || e.is("element") && e.getCustomProperty("dataPipeline:transparentRendering") ? "" : `
106
+
107
+ ` : "";
108
+ }
109
+ /**
110
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
111
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
112
+ */
113
+ var Y = class extends b {
114
+ constructor() {
115
+ super(...arguments);
116
+ /**
117
+ * Map of marker names that can be copied.
118
+ *
119
+ * @internal
120
+ */
121
+ g(this, "_markersToCopy", /* @__PURE__ */ new Map());
122
+ }
123
+ /**
124
+ * @inheritDoc
125
+ */
126
+ static get pluginName() {
127
+ return "ClipboardMarkersUtils";
128
+ }
129
+ /**
130
+ * @inheritDoc
131
+ */
132
+ static get isOfficialPlugin() {
133
+ return !0;
134
+ }
135
+ /**
136
+ * Registers marker name as copyable in clipboard pipeline.
137
+ *
138
+ * @param markerName Name of marker that can be copied.
139
+ * @param config Configuration that describes what can be performed on specified marker.
140
+ * @internal
141
+ */
142
+ _registerMarkerToCopy(e, t) {
143
+ this._markersToCopy.set(e, t);
144
+ }
145
+ /**
146
+ * Performs copy markers on provided selection and paste it to fragment returned from `getCopiedFragment`.
147
+ *
148
+ * 1. Picks all markers in provided selection.
149
+ * 2. Inserts fake markers to document.
150
+ * 3. Gets copied selection fragment from document.
151
+ * 4. Removes fake elements from fragment and document.
152
+ * 5. Inserts markers in the place of removed fake markers.
153
+ *
154
+ * Due to selection modification, when inserting items, `getCopiedFragment` must *always* operate on `writer.model.document.selection'.
155
+ * Do not use any other custom selection object within callback, as this will lead to out-of-bounds exceptions in rare scenarios.
156
+ *
157
+ * @param action Type of clipboard action.
158
+ * @param selection Selection to be checked.
159
+ * @param getCopiedFragment Callback that performs copy of selection and returns it as fragment.
160
+ * @internal
161
+ */
162
+ _copySelectedFragmentWithMarkers(e, t, n = (r) => r.model.getSelectedContent(r.model.document.selection)) {
163
+ return this.editor.model.change((r) => {
164
+ const i = r.model.document.selection;
165
+ r.setSelection(t);
166
+ const s = this._insertFakeMarkersIntoSelection(r, r.model.document.selection, e), o = n(r), l = this._removeFakeMarkersInsideElement(r, o);
167
+ for (const [d, c] of Object.entries(s)) {
168
+ l[d] || (l[d] = r.createRangeIn(o));
169
+ for (const p of c) r.remove(p);
170
+ }
171
+ o.markers.clear();
172
+ for (const [d, c] of Object.entries(l)) o.markers.set(d, c);
173
+ return r.setSelection(i), o;
174
+ });
175
+ }
176
+ /**
177
+ * Performs paste of markers on already pasted element.
178
+ *
179
+ * 1. Inserts fake markers that are present in fragment element (such fragment will be processed in `getPastedDocumentElement`).
180
+ * 2. Calls `getPastedDocumentElement` and gets element that is inserted into root model.
181
+ * 3. Removes all fake markers present in transformed element.
182
+ * 4. Inserts new markers with removed fake markers ranges into pasted fragment.
183
+ *
184
+ * There are multiple edge cases that have to be considered before calling this function:
185
+ *
186
+ * * `markers` are inserted into the same element that must be later transformed inside `getPastedDocumentElement`.
187
+ * * Fake marker elements inside `getPastedDocumentElement` can be cloned, but their ranges cannot overlap.
188
+ * * If `duplicateOnPaste` is `true` in marker config then associated marker ID is regenerated before pasting.
189
+ *
190
+ * @param markers Object that maps marker name to corresponding range.
191
+ * @param getPastedDocumentElement Getter used to get target markers element.
192
+ * @internal
193
+ */
194
+ _pasteMarkersIntoTransformedElement(e, t) {
195
+ const n = this._getPasteMarkersFromRangeMap(e);
196
+ return this.editor.model.change((r) => {
197
+ const i = this._insertFakeMarkersElements(r, n), s = t(r), o = this._removeFakeMarkersInsideElement(r, s);
198
+ for (const l of Object.values(i).flat()) r.remove(l);
199
+ for (const [l, d] of Object.entries(o)) r.model.markers.has(l) || r.addMarker(l, {
200
+ usingOperation: !0,
201
+ affectsData: !0,
202
+ range: d
203
+ });
204
+ return s;
205
+ });
206
+ }
207
+ /**
208
+ * Pastes document fragment with markers to document.
209
+ * If `duplicateOnPaste` is `true` in marker config then associated markers IDs
210
+ * are regenerated before pasting to avoid markers duplications in content.
211
+ *
212
+ * @param fragment Document fragment that should contain already processed by pipeline markers.
213
+ * @internal
214
+ */
215
+ _pasteFragmentWithMarkers(e) {
216
+ const t = this._getPasteMarkersFromRangeMap(e.markers);
217
+ e.markers.clear();
218
+ for (const n of t) e.markers.set(n.name, n.range);
219
+ return this.editor.model.insertContent(e);
220
+ }
221
+ /**
222
+ * In some situations we have to perform copy on selected fragment with certain markers. This function allows to temporarily bypass
223
+ * restrictions on markers that we want to copy.
224
+ *
225
+ * This function executes `executor()` callback. For the duration of the callback, if the clipboard pipeline is used to copy
226
+ * content, markers with the specified name will be copied to the clipboard as well.
227
+ *
228
+ * @param markerName Which markers should be copied.
229
+ * @param executor Callback executed.
230
+ * @param config Optional configuration flags used to copy (such like partial copy flag).
231
+ * @internal
232
+ */
233
+ _forceMarkersCopy(e, t, n = {
234
+ allowedActions: "all",
235
+ copyPartiallySelected: !0,
236
+ duplicateOnPaste: !0
237
+ }) {
238
+ const r = this._markersToCopy.get(e);
239
+ this._markersToCopy.set(e, n), t(), r ? this._markersToCopy.set(e, r) : this._markersToCopy.delete(e);
240
+ }
241
+ /**
242
+ * Checks if marker can be copied.
243
+ *
244
+ * @param markerName Name of checked marker.
245
+ * @param action Type of clipboard action. If null then checks only if marker is registered as copyable.
246
+ * @internal
247
+ */
248
+ _isMarkerCopyable(e, t) {
249
+ const n = this._getMarkerClipboardConfig(e);
250
+ if (!n) return !1;
251
+ if (!t) return !0;
252
+ const { allowedActions: r } = n;
253
+ return r === "all" || r.includes(t);
254
+ }
255
+ /**
256
+ * Checks if marker has any clipboard copy behavior configuration.
257
+ *
258
+ * @param markerName Name of checked marker.
259
+ */
260
+ _hasMarkerConfiguration(e) {
261
+ return !!this._getMarkerClipboardConfig(e);
262
+ }
263
+ /**
264
+ * Returns marker's configuration flags passed during registration.
265
+ *
266
+ * @param markerName Name of marker that should be returned.
267
+ * @internal
268
+ */
269
+ _getMarkerClipboardConfig(e) {
270
+ const [t] = e.split(":");
271
+ return this._markersToCopy.get(t) || null;
272
+ }
273
+ /**
274
+ * First step of copying markers. It looks for markers intersecting with given selection and inserts `$marker` elements
275
+ * at positions where document markers start or end. This way `$marker` elements can be easily copied together with
276
+ * the rest of the content of the selection.
277
+ *
278
+ * @param writer An instance of the model writer.
279
+ * @param selection Selection to be checked.
280
+ * @param action Type of clipboard action.
281
+ */
282
+ _insertFakeMarkersIntoSelection(e, t, n) {
283
+ const r = this._getCopyableMarkersFromSelection(e, t, n);
284
+ return this._insertFakeMarkersElements(e, r);
285
+ }
286
+ /**
287
+ * Returns array of markers that can be copied in specified selection.
288
+ *
289
+ * If marker cannot be copied partially (according to `copyPartiallySelected` configuration flag) and
290
+ * is not present entirely in any selection range then it will be skipped.
291
+ *
292
+ * @param writer An instance of the model writer.
293
+ * @param selection Selection which will be checked.
294
+ * @param action Type of clipboard action. If null then checks only if marker is registered as copyable.
295
+ */
296
+ _getCopyableMarkersFromSelection(e, t, n) {
297
+ const r = Array.from(t.getRanges()), i = new Set(r.flatMap((o) => Array.from(e.model.markers.getMarkersIntersectingRange(o)))), s = (o) => {
298
+ if (!this._isMarkerCopyable(o.name, n)) return !1;
299
+ const { copyPartiallySelected: l } = this._getMarkerClipboardConfig(o.name);
300
+ if (!l) {
301
+ const d = o.getRange();
302
+ return r.some((c) => c.containsRange(d, !0));
303
+ }
304
+ return !0;
305
+ };
306
+ return Array.from(i).filter(s).map((o) => ({
307
+ name: n === "dragstart" ? this._getUniqueMarkerName(o.name) : o.name,
308
+ range: o.getRange()
309
+ }));
310
+ }
311
+ /**
312
+ * Picks all markers from markers map that can be pasted.
313
+ * If `duplicateOnPaste` is `true`, it regenerates their IDs to ensure uniqueness.
314
+ * If marker is not registered, it will be kept in the array anyway.
315
+ *
316
+ * @param markers Object that maps marker name to corresponding range.
317
+ * @param action Type of clipboard action. If null then checks only if marker is registered as copyable.
318
+ */
319
+ _getPasteMarkersFromRangeMap(e, t = null) {
320
+ const { model: n } = this.editor;
321
+ return (e instanceof Map ? Array.from(e.entries()) : Object.entries(e)).flatMap(([r, i]) => {
322
+ if (!this._hasMarkerConfiguration(r)) return [{
323
+ name: r,
324
+ range: i
325
+ }];
326
+ if (this._isMarkerCopyable(r, t)) {
327
+ const s = this._getMarkerClipboardConfig(r), o = n.markers.has(r) && n.markers.get(r).getRange().root.rootName === "$graveyard";
328
+ return (s.duplicateOnPaste || o) && (r = this._getUniqueMarkerName(r)), [{
329
+ name: r,
330
+ range: i
331
+ }];
332
+ }
333
+ return [];
334
+ });
335
+ }
336
+ /**
337
+ * Inserts specified array of fake markers elements to document and assigns them `type` and `name` attributes.
338
+ * Fake markers elements are used to calculate position of markers on pasted fragment that were transformed during
339
+ * steps between copy and paste.
340
+ *
341
+ * @param writer An instance of the model writer.
342
+ * @param markers Array of markers that will be inserted.
343
+ */
344
+ _insertFakeMarkersElements(e, t) {
345
+ const n = {}, r = t.flatMap((i) => {
346
+ const { start: s, end: o } = i.range;
347
+ return [{
348
+ position: s,
349
+ marker: i,
350
+ type: "start"
351
+ }, {
352
+ position: o,
353
+ marker: i,
354
+ type: "end"
355
+ }];
356
+ }).sort(({ position: i }, { position: s }) => i.isBefore(s) ? 1 : -1);
357
+ for (const { position: i, marker: s, type: o } of r) {
358
+ const l = e.createElement("$marker", {
359
+ "data-name": s.name,
360
+ "data-type": o
361
+ });
362
+ n[s.name] || (n[s.name] = []), n[s.name].push(l), e.insert(l, i);
363
+ }
364
+ return n;
365
+ }
366
+ /**
367
+ * Removes all `$marker` elements from the given document fragment.
368
+ *
369
+ * Returns an object where keys are marker names, and values are ranges corresponding to positions
370
+ * where `$marker` elements were inserted.
371
+ *
372
+ * If the document fragment had only one `$marker` element for given marker (start or end) the other boundary is set automatically
373
+ * (to the end or start of the document fragment, respectively).
374
+ *
375
+ * @param writer An instance of the model writer.
376
+ * @param rootElement The element to be checked.
377
+ */
378
+ _removeFakeMarkersInsideElement(e, t) {
379
+ const n = this._getAllFakeMarkersFromElement(e, t).reduce((r, i) => {
380
+ const s = i.markerElement && e.createPositionBefore(i.markerElement);
381
+ let o = r[i.name], l = !1;
382
+ return o != null && o.start && (o != null && o.end) && (this._getMarkerClipboardConfig(i.name).duplicateOnPaste ? r[this._getUniqueMarkerName(i.name)] = r[i.name] : l = !0, o = null), l || (r[i.name] = {
383
+ ...o,
384
+ [i.type]: s
385
+ }), i.markerElement && e.remove(i.markerElement), r;
386
+ }, {});
387
+ return ce(n, (r) => new de(r.start || e.createPositionFromPath(t, [0]), r.end || e.createPositionAt(t, "end")));
388
+ }
389
+ /**
390
+ * Returns array that contains list of fake markers with corresponding `$marker` elements.
391
+ *
392
+ * For each marker, there can be two `$marker` elements or only one (if the document fragment contained
393
+ * only the beginning or only the end of a marker).
394
+ *
395
+ * @param writer An instance of the model writer.
396
+ * @param rootElement The element to be checked.
397
+ */
398
+ _getAllFakeMarkersFromElement(e, t) {
399
+ const n = Array.from(e.createRangeIn(t)).flatMap(({ item: s }) => s.is("element", "$marker") ? [{
400
+ markerElement: s,
401
+ name: s.getAttribute("data-name"),
402
+ type: s.getAttribute("data-type")
403
+ }] : []), r = [], i = [];
404
+ for (const s of n)
405
+ s.type === "end" && (n.some((o) => o.name === s.name && o.type === "start") || r.push({
406
+ markerElement: null,
407
+ name: s.name,
408
+ type: "start"
409
+ })), s.type === "start" && (n.some((o) => o.name === s.name && o.type === "end") || i.unshift({
410
+ markerElement: null,
411
+ name: s.name,
412
+ type: "end"
413
+ }));
414
+ return [
415
+ ...r,
416
+ ...n,
417
+ ...i
418
+ ];
419
+ }
420
+ /**
421
+ * When copy of markers occurs we have to make sure that pasted markers have different names
422
+ * than source markers. This functions helps with assigning unique part to marker name to
423
+ * prevent duplicated markers error.
424
+ *
425
+ * @param name Name of marker
426
+ */
427
+ _getUniqueMarkerName(e) {
428
+ const t = e.split(":"), n = q().substring(1, 6);
429
+ return t.length === 3 ? `${t.slice(0, 2).join(":")}:${n}` : `${t.join(":")}:${n}`;
430
+ }
431
+ };
432
+ /**
433
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
434
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
435
+ */
436
+ var D = class extends b {
437
+ /**
438
+ * @inheritDoc
439
+ */
440
+ static get pluginName() {
441
+ return "ClipboardPipeline";
442
+ }
443
+ /**
444
+ * @inheritDoc
445
+ */
446
+ static get isOfficialPlugin() {
447
+ return !0;
448
+ }
449
+ /**
450
+ * @inheritDoc
451
+ */
452
+ static get requires() {
453
+ return [Y];
454
+ }
455
+ /**
456
+ * @inheritDoc
457
+ */
458
+ init() {
459
+ this.editor.editing.view.addObserver(v), this._setupPasteDrop(), this._setupCopyCut();
460
+ }
461
+ /**
462
+ * Fires Clipboard `'outputTransformation'` event for given parameters.
463
+ *
464
+ * @internal
465
+ */
466
+ _fireOutputTransformationEvent(a, e, t) {
467
+ const n = this.editor.plugins.get("ClipboardMarkersUtils");
468
+ this.editor.model.enqueueChange({ isUndoable: t === "cut" }, () => {
469
+ const r = n._copySelectedFragmentWithMarkers(t, e);
470
+ this.fire("outputTransformation", {
471
+ dataTransfer: a,
472
+ content: r,
473
+ method: t
474
+ });
475
+ });
476
+ }
477
+ /**
478
+ * The clipboard paste pipeline.
479
+ */
480
+ _setupPasteDrop() {
481
+ const a = this.editor, e = a.model, t = a.editing.view, n = t.document, r = this.editor.plugins.get("ClipboardMarkersUtils");
482
+ this.listenTo(n, "clipboardInput", (i, s) => {
483
+ s.method == "paste" && !a.model.canEditAt(a.model.document.selection) && i.stop();
484
+ }, { priority: "highest" }), this.listenTo(n, "clipboardInput", (i, s) => {
485
+ const o = s.dataTransfer, l = new j(this, "inputTransformation"), d = o.getData("application/ckeditor5-editor-id") || null, c = typeof s.content == "string" ? this.editor.data.htmlProcessor.toView(ue(s.content)) : s.content;
486
+ this.fire(l, {
487
+ content: c,
488
+ dataTransfer: o,
489
+ sourceEditorId: d,
490
+ extraContent: s.extraContent,
491
+ targetRanges: s.targetRanges,
492
+ method: s.method
493
+ }), l.stop.called && i.stop(), t.scrollToTheSelection();
494
+ }, { priority: "low" }), this.listenTo(this, "inputTransformation", (i, s) => {
495
+ if (s.content.isEmpty) return;
496
+ const o = this.editor.data.toModel(s.content, "$clipboardHolder");
497
+ o.childCount != 0 && (i.stop(), e.change(() => {
498
+ this.fire("contentInsertion", {
499
+ content: o,
500
+ method: s.method,
501
+ sourceEditorId: s.sourceEditorId,
502
+ dataTransfer: s.dataTransfer,
503
+ targetRanges: s.targetRanges
504
+ });
505
+ }));
506
+ }, { priority: "low" }), this.listenTo(this, "contentInsertion", (i, s) => {
507
+ s.resultRange = r._pasteFragmentWithMarkers(s.content);
508
+ }, { priority: "low" });
509
+ }
510
+ /**
511
+ * The clipboard copy/cut pipeline.
512
+ */
513
+ _setupCopyCut() {
514
+ const a = this.editor, e = a.model.document, t = a.editing.view.document, n = (r, i) => {
515
+ const s = i.dataTransfer;
516
+ i.preventDefault(), this._fireOutputTransformationEvent(s, e.selection, r.name);
517
+ };
518
+ this.listenTo(t, "copy", n, { priority: "low" }), this.listenTo(t, "cut", (r, i) => {
519
+ a.model.canEditAt(a.model.document.selection) ? n(r, i) : i.preventDefault();
520
+ }, { priority: "low" }), this.listenTo(this, "outputTransformation", (r, i) => {
521
+ const s = a.data.toView(i.content, { isClipboardPipeline: !0 });
522
+ t.fire("clipboardOutput", {
523
+ dataTransfer: i.dataTransfer,
524
+ content: s,
525
+ method: i.method
526
+ });
527
+ }, { priority: "low" }), this.listenTo(t, "clipboardOutput", (r, i) => {
528
+ i.content.isEmpty || (i.dataTransfer.setData("text/html", this.editor.data.htmlProcessor.toData(i.content)), i.dataTransfer.setData("text/plain", G(a.data.htmlProcessor.domConverter, i.content)), i.dataTransfer.setData("application/ckeditor5-editor-id", this.editor.id)), i.method == "cut" && a.model.deleteContent(e.selection);
529
+ }, { priority: "low" });
530
+ }
531
+ };
532
+ /**
533
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
534
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
535
+ */
536
+ /* istanbul ignore file -- @preserve */
537
+ const P = /* @__PURE__ */ oe("px");
538
+ var fe = class extends pe {
539
+ /**
540
+ * @inheritDoc
541
+ */
542
+ constructor() {
543
+ super();
544
+ const a = this.bindTemplate;
545
+ this.set({
546
+ isVisible: !1,
547
+ left: null,
548
+ top: null,
549
+ width: null
550
+ }), this.setTemplate({
551
+ tag: "div",
552
+ attributes: {
553
+ class: [
554
+ "ck",
555
+ "ck-clipboard-drop-target-line",
556
+ a.if("isVisible", "ck-hidden", (e) => !e)
557
+ ],
558
+ style: {
559
+ left: a.to("left", (e) => P(e)),
560
+ top: a.to("top", (e) => P(e)),
561
+ width: a.to("width", (e) => P(e))
562
+ }
563
+ }
564
+ });
565
+ }
566
+ };
567
+ /**
568
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
569
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
570
+ */
571
+ var C = class extends b {
572
+ constructor() {
573
+ super(...arguments);
574
+ /**
575
+ * A delayed callback removing the drop marker.
576
+ *
577
+ * @internal
578
+ */
579
+ g(this, "removeDropMarkerDelayed", H(() => this.removeDropMarker(), 40));
580
+ /**
581
+ * A throttled callback updating the drop marker.
582
+ */
583
+ g(this, "_updateDropMarkerThrottled", B((e) => this._updateDropMarker(e), 40));
584
+ /**
585
+ * A throttled callback reconverting the drop parker.
586
+ */
587
+ g(this, "_reconvertMarkerThrottled", B(() => {
588
+ this.editor.model.markers.has("drop-target") && this.editor.editing.reconvertMarker("drop-target");
589
+ }, 0));
590
+ /**
591
+ * The horizontal drop target line view.
592
+ */
593
+ g(this, "_dropTargetLineView", new fe());
594
+ /**
595
+ * DOM Emitter.
596
+ */
597
+ g(this, "_domEmitter", new (A())());
598
+ /**
599
+ * Map of document scrollable elements.
600
+ */
601
+ g(this, "_scrollables", /* @__PURE__ */ new Map());
602
+ }
603
+ /**
604
+ * @inheritDoc
605
+ */
606
+ static get pluginName() {
607
+ return "DragDropTarget";
608
+ }
609
+ /**
610
+ * @inheritDoc
611
+ */
612
+ static get isOfficialPlugin() {
613
+ return !0;
614
+ }
615
+ /**
616
+ * @inheritDoc
617
+ */
618
+ init() {
619
+ this._setupDropMarker();
620
+ }
621
+ /**
622
+ * @inheritDoc
623
+ */
624
+ destroy() {
625
+ this._domEmitter.stopListening();
626
+ for (const { resizeObserver: e } of this._scrollables.values()) e.destroy();
627
+ return this._updateDropMarkerThrottled.cancel(), this.removeDropMarkerDelayed.cancel(), this._reconvertMarkerThrottled.cancel(), super.destroy();
628
+ }
629
+ /**
630
+ * Finds the drop target range and updates the drop marker.
631
+ *
632
+ * @return The updated drop target range or null if no valid range was found.
633
+ * @internal
634
+ */
635
+ updateDropMarker(e, t, n, r, i, s) {
636
+ this.removeDropMarkerDelayed.cancel();
637
+ const o = $(this.editor, e, t, n, r, i, s);
638
+ /* istanbul ignore next -- @preserve */
639
+ return o ? s && s.containsRange(o) ? (this.removeDropMarker(), null) : o && !this.editor.model.canEditAt(o) ? (this.removeDropMarker(), null) : (this._updateDropMarkerThrottled(o), o) : null;
640
+ }
641
+ /**
642
+ * Finds the final drop target range.
643
+ *
644
+ * @internal
645
+ */
646
+ getFinalDropRange(e, t, n, r, i, s) {
647
+ const o = $(this.editor, e, t, n, r, i, s);
648
+ return this.removeDropMarker(), o;
649
+ }
650
+ /**
651
+ * Removes the drop target marker.
652
+ *
653
+ * @internal
654
+ */
655
+ removeDropMarker() {
656
+ const e = this.editor.model;
657
+ this.removeDropMarkerDelayed.cancel(), this._updateDropMarkerThrottled.cancel(), this._dropTargetLineView.isVisible = !1, e.markers.has("drop-target") && e.change((t) => {
658
+ t.removeMarker("drop-target");
659
+ });
660
+ }
661
+ /**
662
+ * Creates downcast conversion for the drop target marker.
663
+ */
664
+ _setupDropMarker() {
665
+ const e = this.editor;
666
+ e.ui.view.body.add(this._dropTargetLineView), e.conversion.for("editingDowncast").markerToHighlight({
667
+ model: "drop-target",
668
+ view: { classes: ["ck-clipboard-drop-target-range"] }
669
+ }), e.conversion.for("editingDowncast").markerToElement({
670
+ model: "drop-target",
671
+ view: (t, { writer: n }) => {
672
+ if (e.model.schema.checkChild(t.markerRange.start, "$text"))
673
+ return this._dropTargetLineView.isVisible = !1, this._createDropTargetPosition(n);
674
+ t.markerRange.isCollapsed ? this._updateDropTargetLine(t.markerRange) : this._dropTargetLineView.isVisible = !1;
675
+ }
676
+ });
677
+ }
678
+ /**
679
+ * Updates the drop target marker to the provided range.
680
+ *
681
+ * @param targetRange The range to set the marker to.
682
+ */
683
+ _updateDropMarker(e) {
684
+ const t = this.editor, n = t.model.markers;
685
+ t.model.change((r) => {
686
+ n.has("drop-target") ? n.get("drop-target").getRange().isEqual(e) || r.updateMarker("drop-target", { range: e }) : r.addMarker("drop-target", {
687
+ range: e,
688
+ usingOperation: !1,
689
+ affectsData: !1
690
+ });
691
+ });
692
+ }
693
+ /**
694
+ * Creates the UI element for vertical (in-line) drop target.
695
+ */
696
+ _createDropTargetPosition(e) {
697
+ return e.createUIElement("span", { class: "ck ck-clipboard-drop-target-position" }, function(t) {
698
+ const n = this.toDomElement(t);
699
+ return n.append("⁠", t.createElement("span"), "⁠"), n;
700
+ });
701
+ }
702
+ /**
703
+ * Updates the horizontal drop target line.
704
+ */
705
+ _updateDropTargetLine(e) {
706
+ const t = this.editor.editing, n = e.start.nodeBefore, r = e.start.nodeAfter, i = e.start.parent, s = n ? t.mapper.toViewElement(n) : null, o = s ? t.view.domConverter.mapViewToDom(s) : null, l = r ? t.mapper.toViewElement(r) : null, d = l ? t.view.domConverter.mapViewToDom(l) : null, c = t.mapper.toViewElement(i);
707
+ if (!c) return;
708
+ const p = t.view.domConverter.mapViewToDom(c), m = this._getScrollableRect(c), { scrollX: u, scrollY: y } = h.window, x = o ? new _(o) : null, S = d ? new _(d) : null, T = new _(p).excludeScrollbarsAndBorders(), O = x ? x.bottom : T.top, M = S ? S.top : T.bottom, I = h.window.getComputedStyle(p), R = O <= M ? (O + M) / 2 : M;
709
+ if (m.top < R && R < m.bottom) {
710
+ const Q = T.left + parseFloat(I.paddingLeft), Z = T.right - parseFloat(I.paddingRight), F = Math.max(Q + u, m.left), ee = Math.min(Z + u, m.right);
711
+ this._dropTargetLineView.set({
712
+ isVisible: !0,
713
+ left: F,
714
+ top: R + y,
715
+ width: ee - F
716
+ });
717
+ } else this._dropTargetLineView.isVisible = !1;
718
+ }
719
+ /**
720
+ * Finds the closest scrollable element rect for the given view element.
721
+ */
722
+ _getScrollableRect(e) {
723
+ const t = e.root.rootName;
724
+ let n;
725
+ if (this._scrollables.has(t)) n = this._scrollables.get(t).domElement;
726
+ else {
727
+ n = _e(this.editor.editing.view.domConverter.mapViewToDom(e)), this._domEmitter.listenTo(n, "scroll", this._reconvertMarkerThrottled, { usePassive: !0 });
728
+ const r = new ie(n, this._reconvertMarkerThrottled);
729
+ this._scrollables.set(t, {
730
+ domElement: n,
731
+ resizeObserver: r
732
+ });
733
+ }
734
+ return new _(n).excludeScrollbarsAndBorders();
735
+ }
736
+ };
737
+ function $(a, e, t, n, r, i, s) {
738
+ const o = a.model, l = a.editing.mapper;
739
+ let d = N(a, e);
740
+ for (; d; ) {
741
+ if (!i) {
742
+ if (o.schema.checkChild(d, "$text")) {
743
+ if (t) {
744
+ const c = t[0].start, p = l.toModelPosition(c);
745
+ if (!s || Array.from(s.getItems({ shallow: !0 })).some((m) => o.schema.checkChild(p, m))) {
746
+ if (o.schema.checkChild(p, "$text")) return o.createRange(p);
747
+ if (c) return w(a, N(a, c.parent), n, r);
748
+ }
749
+ }
750
+ } else if (o.schema.isInline(d)) return w(a, d, n, r);
751
+ }
752
+ if (o.schema.isBlock(d)) return w(a, d, n, r);
753
+ if (o.schema.checkChild(d, "$block")) {
754
+ const c = Array.from(d.getChildren()).filter((u) => u.is("element") && !be(a, u));
755
+ let p = 0, m = c.length;
756
+ if (m == 0) return o.createRange(o.createPositionAt(d, "end"));
757
+ for (; p < m - 1; ) {
758
+ const u = Math.floor((p + m) / 2);
759
+ K(a, c[u], n, r) == "before" ? m = u : p = u;
760
+ }
761
+ return w(a, c[p], n, r);
762
+ }
763
+ d = d.parent;
764
+ }
765
+ return null;
766
+ }
767
+ function be(a, e) {
768
+ const t = a.editing.mapper, n = a.editing.view.domConverter, r = t.toViewElement(e);
769
+ if (!r) return !0;
770
+ const i = n.mapViewToDom(r);
771
+ return h.window.getComputedStyle(i).float != "none";
772
+ }
773
+ function w(a, e, t, n) {
774
+ const r = a.model;
775
+ return r.createRange(r.createPositionAt(e, K(a, e, t, n)));
776
+ }
777
+ function K(a, e, t, n) {
778
+ const r = a.editing.mapper, i = a.editing.view.domConverter, s = r.toViewElement(e), o = i.mapViewToDom(s), l = new _(o);
779
+ return a.model.schema.isInline(e) ? t < (l.left + l.right) / 2 ? "before" : "after" : n < (l.top + l.bottom) / 2 ? "before" : "after";
780
+ }
781
+ function N(a, e) {
782
+ const t = a.editing.mapper, n = a.editing.view, r = t.toModelElement(e);
783
+ if (r) return r;
784
+ const i = n.createPositionBefore(e), s = t.findMappedViewAncestor(i);
785
+ return t.toModelElement(s);
786
+ }
787
+ function _e(a) {
788
+ let e = a;
789
+ do {
790
+ e = e.parentElement;
791
+ const t = h.window.getComputedStyle(e).overflowY;
792
+ if (t == "auto" || t == "scroll") break;
793
+ } while (e.tagName != "BODY");
794
+ return e;
795
+ }
796
+ /**
797
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
798
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
799
+ */
800
+ var ke = class extends b {
801
+ constructor() {
802
+ super(...arguments);
803
+ /**
804
+ * Whether current dragging is started by block toolbar button dragging.
805
+ */
806
+ g(this, "_isBlockDragging", !1);
807
+ /**
808
+ * DOM Emitter.
809
+ */
810
+ g(this, "_domEmitter", new (A())());
811
+ }
812
+ /**
813
+ * @inheritDoc
814
+ */
815
+ static get pluginName() {
816
+ return "DragDropBlockToolbar";
817
+ }
818
+ /**
819
+ * @inheritDoc
820
+ */
821
+ static get isOfficialPlugin() {
822
+ return !0;
823
+ }
824
+ /**
825
+ * @inheritDoc
826
+ */
827
+ init() {
828
+ const e = this.editor;
829
+ if (this.listenTo(e, "change:isReadOnly", (t, n, r) => {
830
+ r ? (this.forceDisabled("readOnlyMode"), this._isBlockDragging = !1) : this.clearForceDisabled("readOnlyMode");
831
+ }), f.isAndroid && this.forceDisabled("noAndroidSupport"), e.plugins.has("BlockToolbar")) {
832
+ const t = e.plugins.get("BlockToolbar").buttonView.element;
833
+ this._domEmitter.listenTo(t, "dragstart", (n, r) => this._handleBlockDragStart(r)), this._domEmitter.listenTo(h.document, "dragover", (n, r) => this._handleBlockDragging(r)), this._domEmitter.listenTo(h.document, "drop", (n, r) => this._handleBlockDragging(r)), this._domEmitter.listenTo(h.document, "dragend", () => this._handleBlockDragEnd(), { useCapture: !0 }), this.isEnabled && t.setAttribute("draggable", "true"), this.on("change:isEnabled", (n, r, i) => {
834
+ t.setAttribute("draggable", i ? "true" : "false");
835
+ });
836
+ }
837
+ }
838
+ /**
839
+ * @inheritDoc
840
+ */
841
+ destroy() {
842
+ return this._domEmitter.stopListening(), super.destroy();
843
+ }
844
+ /**
845
+ * The `dragstart` event handler.
846
+ */
847
+ _handleBlockDragStart(e) {
848
+ if (!this.isEnabled) return;
849
+ const t = this.editor.model, n = t.document.selection, r = this.editor.editing.view, i = Array.from(n.getSelectedBlocks()), s = t.createRange(t.createPositionBefore(i[0]), t.createPositionAfter(i[i.length - 1]));
850
+ t.change((o) => o.setSelection(s)), this._isBlockDragging = !0, r.focus(), r.getObserver(v).onDomEvent(e);
851
+ }
852
+ /**
853
+ * The `dragover` and `drop` event handler.
854
+ */
855
+ _handleBlockDragging(e) {
856
+ if (!this.isEnabled || !this._isBlockDragging) return;
857
+ const t = e.clientX + (this.editor.locale.contentLanguageDirection == "ltr" ? 100 : -100), n = e.clientY, r = document.elementFromPoint(t, n), i = this.editor.editing.view;
858
+ !r || !r.closest(".ck-editor__editable") || i.getObserver(v).onDomEvent({
859
+ ...e,
860
+ type: e.type,
861
+ dataTransfer: e.dataTransfer,
862
+ target: r,
863
+ clientX: t,
864
+ clientY: n,
865
+ preventDefault: () => e.preventDefault(),
866
+ stopPropagation: () => e.stopPropagation()
867
+ });
868
+ }
869
+ /**
870
+ * The `dragend` event handler.
871
+ */
872
+ _handleBlockDragEnd() {
873
+ this._isBlockDragging = !1;
874
+ }
875
+ };
876
+ /**
877
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
878
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
879
+ */
880
+ var ve = class extends b {
881
+ constructor() {
882
+ super(...arguments);
883
+ /**
884
+ * The live range over the original content that is being dragged.
885
+ */
886
+ g(this, "_draggedRange");
887
+ /**
888
+ * The UID of current dragging that is used to verify if the drop started in the same editor as the drag start.
889
+ *
890
+ * **Note**: This is a workaround for broken 'dragend' events (they are not fired if the source text node got removed).
891
+ */
892
+ g(this, "_draggingUid");
893
+ /**
894
+ * The reference to the model element that currently has a `draggable` attribute set (it is set while dragging).
895
+ */
896
+ g(this, "_draggableElement");
897
+ /**
898
+ * A delayed callback removing draggable attributes.
899
+ */
900
+ g(this, "_clearDraggableAttributesDelayed", H(() => this._clearDraggableAttributes(), 40));
901
+ /**
902
+ * Whether the dragged content can be dropped only in block context.
903
+ */
904
+ g(this, "_blockMode", !1);
905
+ /**
906
+ * DOM Emitter.
907
+ */
908
+ g(this, "_domEmitter", new (A())());
909
+ /**
910
+ * The DOM element used to generate dragged preview image.
911
+ */
912
+ g(this, "_previewContainer");
913
+ }
914
+ /**
915
+ * @inheritDoc
916
+ */
917
+ static get pluginName() {
918
+ return "DragDrop";
919
+ }
920
+ /**
921
+ * @inheritDoc
922
+ */
923
+ static get isOfficialPlugin() {
924
+ return !0;
925
+ }
926
+ /**
927
+ * @inheritDoc
928
+ */
929
+ static get requires() {
930
+ return [
931
+ D,
932
+ ge,
933
+ C,
934
+ ke
935
+ ];
936
+ }
937
+ /**
938
+ * @inheritDoc
939
+ */
940
+ init() {
941
+ const e = this.editor, t = e.editing.view;
942
+ this._draggedRange = null, this._draggingUid = "", this._draggableElement = null, t.addObserver(v), t.addObserver(se), this._setupDragging(), this._setupContentInsertionIntegration(), this._setupClipboardInputIntegration(), this._setupDraggableAttributeHandling(), this.listenTo(e, "change:isReadOnly", (n, r, i) => {
943
+ i ? this.forceDisabled("readOnlyMode") : this.clearForceDisabled("readOnlyMode");
944
+ }), this.on("change:isEnabled", (n, r, i) => {
945
+ i || this._finalizeDragging(!1);
946
+ }), f.isAndroid && this.forceDisabled("noAndroidSupport");
947
+ }
948
+ /**
949
+ * @inheritDoc
950
+ */
951
+ destroy() {
952
+ return this._draggedRange && (this._draggedRange.detach(), this._draggedRange = null), this._previewContainer && this._previewContainer.remove(), this._domEmitter.stopListening(), this._clearDraggableAttributesDelayed.cancel(), super.destroy();
953
+ }
954
+ /**
955
+ * Drag and drop events handling.
956
+ */
957
+ _setupDragging() {
958
+ const e = this.editor, t = e.model, n = e.editing.view, r = n.document, i = e.plugins.get(C);
959
+ this.listenTo(r, "dragstart", (s, o) => {
960
+ var y;
961
+ if ((y = o.target) != null && y.is("editableElement")) {
962
+ o.preventDefault();
963
+ return;
964
+ }
965
+ if (this._prepareDraggedRange(o.target), !this._draggedRange) {
966
+ o.preventDefault();
967
+ return;
968
+ }
969
+ this._draggingUid = q();
970
+ const l = this.isEnabled && e.model.canEditAt(this._draggedRange);
971
+ o.dataTransfer.effectAllowed = l ? "copyMove" : "copy", o.dataTransfer.setData("application/ckeditor5-dragging-uid", this._draggingUid);
972
+ const d = t.createSelection(this._draggedRange.toRange());
973
+ this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(o.dataTransfer, d, "dragstart");
974
+ const { dataTransfer: c, domTarget: p, domEvent: m } = o, { clientX: u } = m;
975
+ this._updatePreview({
976
+ dataTransfer: c,
977
+ domTarget: p,
978
+ clientX: u
979
+ }), o.stopPropagation(), l || (this._draggedRange.detach(), this._draggedRange = null, this._draggingUid = "");
980
+ }, { priority: "low" }), this.listenTo(r, "dragend", (s, o) => {
981
+ this._finalizeDragging(!o.dataTransfer.isCanceled && o.dataTransfer.dropEffect == "move");
982
+ }, { priority: "low" }), this._domEmitter.listenTo(h.document, "dragend", () => {
983
+ this._blockMode = !1;
984
+ }, { useCapture: !0 }), this.listenTo(r, "dragenter", () => {
985
+ this.isEnabled && n.focus();
986
+ }), this.listenTo(r, "dragleave", () => {
987
+ i.removeDropMarkerDelayed();
988
+ }), this.listenTo(r, "dragging", (s, o) => {
989
+ if (!this.isEnabled) {
990
+ o.dataTransfer.dropEffect = "none";
991
+ return;
992
+ }
993
+ const { clientX: l, clientY: d } = o.domEvent;
994
+ if (!i.updateDropMarker(o.target, o.targetRanges, l, d, this._blockMode, this._draggedRange)) {
995
+ o.dataTransfer.dropEffect = "none";
996
+ return;
997
+ }
998
+ this._draggedRange || (o.dataTransfer.dropEffect = "copy"), f.isGecko || (o.dataTransfer.effectAllowed == "copy" ? o.dataTransfer.dropEffect = "copy" : ["all", "copyMove"].includes(o.dataTransfer.effectAllowed) && (o.dataTransfer.dropEffect = "move")), s.stop();
999
+ }, { priority: "low" });
1000
+ }
1001
+ /**
1002
+ * Integration with the `clipboardInput` event.
1003
+ */
1004
+ _setupClipboardInputIntegration() {
1005
+ const e = this.editor, t = e.editing.view.document, n = e.plugins.get(C);
1006
+ this.listenTo(t, "clipboardInput", (r, i) => {
1007
+ if (i.method != "drop") return;
1008
+ const { clientX: s, clientY: o } = i.domEvent, l = n.getFinalDropRange(i.target, i.targetRanges, s, o, this._blockMode, this._draggedRange);
1009
+ if (!l) {
1010
+ this._finalizeDragging(!1), r.stop();
1011
+ return;
1012
+ }
1013
+ if (this._draggedRange && this._draggingUid != i.dataTransfer.getData("application/ckeditor5-dragging-uid") && (this._draggedRange.detach(), this._draggedRange = null, this._draggingUid = ""), W(i.dataTransfer) == "move" && this._draggedRange && this._draggedRange.containsRange(l, !0)) {
1014
+ this._finalizeDragging(!1), r.stop();
1015
+ return;
1016
+ }
1017
+ i.targetRanges = [e.editing.mapper.toViewRange(l)];
1018
+ }, { priority: "high" });
1019
+ }
1020
+ /**
1021
+ * Integration with the `contentInsertion` event of the clipboard pipeline.
1022
+ */
1023
+ _setupContentInsertionIntegration() {
1024
+ const e = this.editor.plugins.get(D);
1025
+ e.on("contentInsertion", (t, n) => {
1026
+ if (!this.isEnabled || n.method !== "drop") return;
1027
+ const r = n.targetRanges.map((i) => this.editor.editing.mapper.toModelRange(i));
1028
+ this.editor.model.change((i) => i.setSelection(r));
1029
+ }, { priority: "high" }), e.on("contentInsertion", (t, n) => {
1030
+ if (!this.isEnabled || n.method !== "drop") return;
1031
+ const r = W(n.dataTransfer) == "move", i = !n.resultRange || !n.resultRange.isCollapsed;
1032
+ this._finalizeDragging(i && r);
1033
+ }, { priority: "lowest" });
1034
+ }
1035
+ /**
1036
+ * Adds listeners that add the `draggable` attribute to the elements while the mouse button is down so the dragging could start.
1037
+ */
1038
+ _setupDraggableAttributeHandling() {
1039
+ const e = this.editor, t = e.editing.view, n = t.document;
1040
+ this.listenTo(n, "pointerdown", (r, i) => {
1041
+ if (f.isAndroid || !i) return;
1042
+ this._clearDraggableAttributesDelayed.cancel();
1043
+ let s = z(i.target);
1044
+ if (f.isBlink && !e.isReadOnly && !s && !n.selection.isCollapsed) {
1045
+ const o = n.selection.getSelectedElement();
1046
+ (!o || !k(o)) && (s = n.selection.editableElement);
1047
+ }
1048
+ s && (t.change((o) => {
1049
+ o.setAttribute("draggable", "true", s);
1050
+ }), this._draggableElement = e.editing.mapper.toModelElement(s));
1051
+ }), this.listenTo(n, "pointerup", () => {
1052
+ f.isAndroid || this._clearDraggableAttributesDelayed();
1053
+ });
1054
+ }
1055
+ /**
1056
+ * Removes the `draggable` attribute from the element that was used for dragging.
1057
+ */
1058
+ _clearDraggableAttributes() {
1059
+ const e = this.editor.editing;
1060
+ e.view.change((t) => {
1061
+ this._draggableElement && this._draggableElement.root.rootName != "$graveyard" && t.removeAttribute("draggable", e.mapper.toViewElement(this._draggableElement)), this._draggableElement = null;
1062
+ });
1063
+ }
1064
+ /**
1065
+ * Deletes the dragged content from its original range and clears the dragging state.
1066
+ *
1067
+ * @param moved Whether the move succeeded.
1068
+ */
1069
+ _finalizeDragging(e) {
1070
+ const t = this.editor, n = t.model;
1071
+ t.plugins.get(C).removeDropMarker(), this._clearDraggableAttributes(), t.plugins.has("WidgetToolbarRepository") && t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"), this._draggingUid = "", this._previewContainer && (this._previewContainer.remove(), this._previewContainer = void 0), this._draggedRange && (e && this.isEnabled && n.change((r) => {
1072
+ const i = n.createSelection(this._draggedRange);
1073
+ n.deleteContent(i, { doNotAutoparagraph: !0 });
1074
+ const s = i.getFirstPosition().parent;
1075
+ s.isEmpty && !n.schema.checkChild(s, "$text") && n.schema.checkChild(s, "paragraph") && r.insertElement("paragraph", s, 0);
1076
+ }), this._draggedRange.detach(), this._draggedRange = null);
1077
+ }
1078
+ /**
1079
+ * Sets the dragged source range based on event target and document selection.
1080
+ */
1081
+ _prepareDraggedRange(e) {
1082
+ const t = this.editor, n = t.model, r = n.document.selection, i = e ? z(e) : null;
1083
+ if (i) {
1084
+ const d = t.editing.mapper.toModelElement(i);
1085
+ this._draggedRange = E.fromRange(n.createRangeOn(d)), this._blockMode = n.schema.isBlock(d), t.plugins.has("WidgetToolbarRepository") && t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop");
1086
+ return;
1087
+ }
1088
+ if (r.isCollapsed && !r.getFirstPosition().parent.isEmpty) return;
1089
+ const s = Array.from(r.getSelectedBlocks()), o = r.getFirstRange();
1090
+ if (s.length == 0) {
1091
+ this._draggedRange = E.fromRange(o);
1092
+ return;
1093
+ }
1094
+ const l = J(n, s);
1095
+ if (s.length > 1)
1096
+ this._draggedRange = E.fromRange(l), this._blockMode = !0;
1097
+ else if (s.length == 1) {
1098
+ const d = o.start.isTouching(l.start) && o.end.isTouching(l.end);
1099
+ this._draggedRange = E.fromRange(d ? l : o), this._blockMode = d;
1100
+ }
1101
+ n.change((d) => d.setSelection(this._draggedRange.toRange()));
1102
+ }
1103
+ /**
1104
+ * Updates the dragged preview image.
1105
+ */
1106
+ _updatePreview({ dataTransfer: e, domTarget: t, clientX: n }) {
1107
+ const r = this.editor.editing.view, i = r.document.selection.editableElement, s = r.domConverter.mapViewToDom(i), o = h.window.getComputedStyle(s);
1108
+ this._previewContainer ? this._previewContainer.firstElementChild && this._previewContainer.removeChild(this._previewContainer.firstElementChild) : (this._previewContainer = V(h.document, "div", { style: "position: fixed; left: -999999px;" }), h.document.body.appendChild(this._previewContainer));
1109
+ const l = V(h.document, "div");
1110
+ l.className = "ck ck-content ck-clipboard-preview";
1111
+ const d = new _(s), c = parseFloat(o.paddingLeft), p = parseFloat(o.paddingRight), m = parseFloat(o.width) - c - p;
1112
+ if (s.contains(t)) if (f.isiOS)
1113
+ l.style.maxWidth = `${m}px`, l.style.padding = "10px", l.style.minWidth = "200px", l.style.minHeight = "20px", l.style.boxSizing = "border-box", l.style.backgroundColor = "var(--ck-color-base-background)";
1114
+ else return;
1115
+ else if (f.isiOS)
1116
+ l.style.width = `${m}px`, l.style.backgroundColor = "var(--ck-color-base-background)";
1117
+ else {
1118
+ const u = d.left - n + c;
1119
+ l.style.width = `${m + u}px`, l.style.paddingLeft = `${u}px`;
1120
+ }
1121
+ r.domConverter.setContentOf(l, e.getData("text/html")), e.setDragImage(l, 0, 0), this._previewContainer.appendChild(l);
1122
+ }
1123
+ };
1124
+ function W(a) {
1125
+ return f.isGecko ? a.dropEffect : ["all", "copyMove"].includes(a.effectAllowed) ? "move" : "copy";
1126
+ }
1127
+ function z(a) {
1128
+ if (a.is("editableElement")) return null;
1129
+ if (a.hasClass("ck-widget__selection-handle")) return a.findAncestor(k);
1130
+ if (k(a)) return a;
1131
+ const e = a.findAncestor((t) => k(t) || t.is("editableElement"));
1132
+ return k(e) ? e : null;
1133
+ }
1134
+ function J(a, e) {
1135
+ const t = e[0], n = e[e.length - 1], r = t.getCommonAncestor(n), i = a.createPositionBefore(t), s = a.createPositionAfter(n);
1136
+ if (r && r.is("element") && !a.schema.isLimit(r)) {
1137
+ const o = a.createRangeOn(r), l = i.isTouching(o.start), d = s.isTouching(o.end);
1138
+ if (l && d) return J(a, [r]);
1139
+ }
1140
+ return a.createRange(i, s);
1141
+ }
1142
+ /**
1143
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
1144
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
1145
+ */
1146
+ var De = class extends b {
1147
+ /**
1148
+ * @inheritDoc
1149
+ */
1150
+ static get pluginName() {
1151
+ return "PastePlainText";
1152
+ }
1153
+ /**
1154
+ * @inheritDoc
1155
+ */
1156
+ static get isOfficialPlugin() {
1157
+ return !0;
1158
+ }
1159
+ /**
1160
+ * @inheritDoc
1161
+ */
1162
+ static get requires() {
1163
+ return [D];
1164
+ }
1165
+ /**
1166
+ * @inheritDoc
1167
+ */
1168
+ init() {
1169
+ const a = this.editor, e = a.model, t = a.editing.view, n = e.document.selection;
1170
+ t.addObserver(v), a.plugins.get(D).on("contentInsertion", (r, i) => {
1171
+ ye(i.content, e) && e.change((s) => {
1172
+ const o = Array.from(n.getAttributes()).filter(([d]) => e.schema.getAttributeProperties(d).isFormatting);
1173
+ n.isCollapsed || e.deleteContent(n, { doNotAutoparagraph: !0 }), o.push(...n.getAttributes());
1174
+ const l = s.createRangeIn(i.content);
1175
+ for (const d of l.getItems()) for (const c of o) e.schema.checkAttribute(d, c[0]) && s.setAttribute(c[0], c[1], d);
1176
+ });
1177
+ });
1178
+ }
1179
+ };
1180
+ function ye(a, e) {
1181
+ let t = e.createRangeIn(a);
1182
+ if (a.childCount == 1) {
1183
+ const n = a.getChild(0);
1184
+ n.is("element") && e.schema.isBlock(n) && !e.schema.isObject(n) && !e.schema.isLimit(n) && (t = e.createRangeIn(n));
1185
+ }
1186
+ for (const n of t.getItems())
1187
+ if (!e.schema.isInline(n) || Array.from(n.getAttributeKeys()).find((r) => e.schema.getAttributeProperties(r).isFormatting)) return !1;
1188
+ return !0;
1189
+ }
1190
+ /**
1191
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
1192
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
1193
+ */
1194
+ var xe = class extends b {
1195
+ /**
1196
+ * @inheritDoc
1197
+ */
1198
+ static get pluginName() {
1199
+ return "Clipboard";
1200
+ }
1201
+ /**
1202
+ * @inheritDoc
1203
+ */
1204
+ static get isOfficialPlugin() {
1205
+ return !0;
1206
+ }
1207
+ /**
1208
+ * @inheritDoc
1209
+ */
1210
+ static get requires() {
1211
+ return [
1212
+ Y,
1213
+ D,
1214
+ ve,
1215
+ De
1216
+ ];
1217
+ }
1218
+ /**
1219
+ * @inheritDoc
1220
+ */
1221
+ init() {
1222
+ const a = this.editor, e = this.editor.t;
1223
+ a.accessibility.addKeystrokeInfos({ keystrokes: [
1224
+ {
1225
+ label: e("Copy selected content"),
1226
+ keystroke: "CTRL+C"
1227
+ },
1228
+ {
1229
+ label: e("Paste content"),
1230
+ keystroke: "CTRL+V"
1231
+ },
1232
+ {
1233
+ label: e("Paste content as plain text"),
1234
+ keystroke: "CTRL+SHIFT+V"
1235
+ }
1236
+ ] });
1237
+ }
1238
+ };
1239
+ export {
1240
+ xe as Clipboard,
1241
+ Y as ClipboardMarkersUtils,
1242
+ v as ClipboardObserver,
1243
+ D as ClipboardPipeline,
1244
+ ve as DragDrop,
1245
+ ke as DragDropBlockToolbar,
1246
+ C as DragDropTarget,
1247
+ De as PastePlainText,
1248
+ fe as _ClipboardLineView,
1249
+ ve as _DragDrop,
1250
+ ke as _DragDropBlockToolbar,
1251
+ C as _DragDropTarget,
1252
+ ue as _normalizeClipboardData,
1253
+ me as plainTextToHtml,
1254
+ G as viewToPlainText
1255
+ };
1256
+ //# sourceMappingURL=index.js.map