@hkyhy/marsun-components-core 0.1.89 → 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 (278) 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/Tools/Inbox/InboxBell/InboxBell.d.ts +45 -0
  52. package/dist/components/Tools/Inbox/InboxBell/InboxBell.js +156 -0
  53. package/dist/components/Tools/Inbox/InboxBell/InboxBell.js.map +1 -0
  54. package/dist/components/Tools/Inbox/InboxBell/index.d.ts +2 -0
  55. package/dist/components/Tools/Inbox/InboxBell/style.module.scss.js +30 -0
  56. package/dist/components/Tools/Inbox/InboxBell/style.module.scss.js.map +1 -0
  57. package/dist/components/Tools/Inbox/index.d.ts +2 -0
  58. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/List/columns.d.ts +8 -0
  59. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/List/columns.js +56 -0
  60. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/List/columns.js.map +1 -0
  61. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.d.ts +8 -0
  62. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.js +216 -0
  63. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.js.map +1 -0
  64. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.d.ts +26 -0
  65. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.js +190 -0
  66. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.js.map +1 -0
  67. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/index.d.ts +3 -0
  68. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/style.module.scss.js +12 -0
  69. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/style.module.scss.js.map +1 -0
  70. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.d.ts +76 -0
  71. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.js +26 -0
  72. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.js.map +1 -0
  73. package/dist/components/Tools/MessageCenter/index.d.ts +3 -0
  74. package/dist/components/Tools/MessageCenter/utils/templateCode.d.ts +8 -0
  75. package/dist/components/Tools/MessageCenter/utils/templateCode.js +25 -0
  76. package/dist/components/Tools/MessageCenter/utils/templateCode.js.map +1 -0
  77. package/dist/components/Tools/index.d.ts +5 -0
  78. package/dist/components/index.d.ts +3 -0
  79. package/dist/editor.d.ts +5 -0
  80. package/dist/editor.js +21 -0
  81. package/dist/editor.js.map +1 -0
  82. package/dist/form-info.js +33 -29
  83. package/dist/form-info.js.map +1 -1
  84. package/dist/index.d.ts +5 -0
  85. package/dist/index.js +805 -773
  86. package/dist/index.js.map +1 -1
  87. package/dist/marsun-components-core.css +4 -1
  88. package/dist/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +301 -0
  89. package/dist/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js.map +1 -0
  90. package/dist/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +1256 -0
  91. package/dist/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js.map +1 -0
  92. package/dist/node_modules/@ckeditor/ckeditor5-core/dist/index.js +2107 -0
  93. package/dist/node_modules/@ckeditor/ckeditor5-core/dist/index.js.map +1 -0
  94. package/dist/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +259 -0
  95. package/dist/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js.map +1 -0
  96. package/dist/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +23990 -0
  97. package/dist/node_modules/@ckeditor/ckeditor5-engine/dist/index.js.map +1 -0
  98. package/dist/node_modules/@ckeditor/ckeditor5-enter/dist/index.js +249 -0
  99. package/dist/node_modules/@ckeditor/ckeditor5-enter/dist/index.js.map +1 -0
  100. package/dist/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js +47 -0
  101. package/dist/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js.map +1 -0
  102. package/dist/node_modules/@ckeditor/ckeditor5-font/dist/index.js +100 -0
  103. package/dist/node_modules/@ckeditor/ckeditor5-font/dist/index.js.map +1 -0
  104. package/dist/node_modules/@ckeditor/ckeditor5-icons/dist/index.js +31 -0
  105. package/dist/node_modules/@ckeditor/ckeditor5-icons/dist/index.js.map +1 -0
  106. package/dist/node_modules/@ckeditor/ckeditor5-integrations-common/dist/index.js +194 -0
  107. package/dist/node_modules/@ckeditor/ckeditor5-integrations-common/dist/index.js.map +1 -0
  108. package/dist/node_modules/@ckeditor/ckeditor5-list/dist/index.js +2042 -0
  109. package/dist/node_modules/@ckeditor/ckeditor5-list/dist/index.js.map +1 -0
  110. package/dist/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +9 -0
  111. package/dist/node_modules/@ckeditor/ckeditor5-mention/dist/index.js.map +1 -0
  112. package/dist/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +167 -0
  113. package/dist/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js.map +1 -0
  114. package/dist/node_modules/@ckeditor/ckeditor5-react/dist/index.js +471 -0
  115. package/dist/node_modules/@ckeditor/ckeditor5-react/dist/index.js.map +1 -0
  116. package/dist/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +139 -0
  117. package/dist/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js.map +1 -0
  118. package/dist/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +755 -0
  119. package/dist/node_modules/@ckeditor/ckeditor5-typing/dist/index.js.map +1 -0
  120. package/dist/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +7838 -0
  121. package/dist/node_modules/@ckeditor/ckeditor5-ui/dist/index.js.map +1 -0
  122. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/conversions.js +422 -0
  123. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/conversions.js.map +1 -0
  124. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/index.js +33 -0
  125. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/index.js.map +1 -0
  126. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/route.js +47 -0
  127. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/route.js.map +1 -0
  128. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-name/index.js +156 -0
  129. package/dist/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-name/index.js.map +1 -0
  130. package/dist/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +313 -0
  131. package/dist/node_modules/@ckeditor/ckeditor5-undo/dist/index.js.map +1 -0
  132. package/dist/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +2942 -0
  133. package/dist/node_modules/@ckeditor/ckeditor5-utils/dist/index.js.map +1 -0
  134. package/dist/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +892 -0
  135. package/dist/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js.map +1 -0
  136. package/dist/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +1047 -0
  137. package/dist/node_modules/@ckeditor/ckeditor5-widget/dist/index.js.map +1 -0
  138. package/dist/node_modules/color-parse/node_modules/color-name/index.js +153 -0
  139. package/dist/node_modules/color-parse/node_modules/color-name/index.js.map +1 -0
  140. package/dist/node_modules/es-toolkit/dist/_internal/globalThis.js +7 -0
  141. package/dist/node_modules/es-toolkit/dist/_internal/globalThis.js.map +1 -0
  142. package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js +7 -0
  143. package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js.map +1 -0
  144. package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeToWriteProperty.js +7 -0
  145. package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeToWriteProperty.js.map +1 -0
  146. package/dist/node_modules/es-toolkit/dist/compat/_internal/assignValue.js +9 -0
  147. package/dist/node_modules/es-toolkit/dist/compat/_internal/assignValue.js.map +1 -0
  148. package/dist/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js +7 -0
  149. package/dist/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js.map +1 -0
  150. package/dist/node_modules/es-toolkit/dist/compat/_internal/getTag.js +7 -0
  151. package/dist/node_modules/es-toolkit/dist/compat/_internal/getTag.js.map +1 -0
  152. package/dist/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js +16 -0
  153. package/dist/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js.map +1 -0
  154. package/dist/node_modules/es-toolkit/dist/compat/_internal/isIndex.js +15 -0
  155. package/dist/node_modules/es-toolkit/dist/compat/_internal/isIndex.js.map +1 -0
  156. package/dist/node_modules/es-toolkit/dist/compat/_internal/isKey.js +9 -0
  157. package/dist/node_modules/es-toolkit/dist/compat/_internal/isKey.js.map +1 -0
  158. package/dist/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js +8 -0
  159. package/dist/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js.map +1 -0
  160. package/dist/node_modules/es-toolkit/dist/compat/_internal/tags.js +30 -0
  161. package/dist/node_modules/es-toolkit/dist/compat/_internal/tags.js.map +1 -0
  162. package/dist/node_modules/es-toolkit/dist/compat/_internal/toKey.js +8 -0
  163. package/dist/node_modules/es-toolkit/dist/compat/_internal/toKey.js.map +1 -0
  164. package/dist/node_modules/es-toolkit/dist/compat/function/debounce.js +17 -0
  165. package/dist/node_modules/es-toolkit/dist/compat/function/debounce.js.map +1 -0
  166. package/dist/node_modules/es-toolkit/dist/compat/function/throttle.js +13 -0
  167. package/dist/node_modules/es-toolkit/dist/compat/function/throttle.js.map +1 -0
  168. package/dist/node_modules/es-toolkit/dist/compat/object/assignIn.js +17 -0
  169. package/dist/node_modules/es-toolkit/dist/compat/object/assignIn.js.map +1 -0
  170. package/dist/node_modules/es-toolkit/dist/compat/object/clone.js +102 -0
  171. package/dist/node_modules/es-toolkit/dist/compat/object/clone.js.map +1 -0
  172. package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +8 -0
  173. package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js.map +1 -0
  174. package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js +33 -0
  175. package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js.map +1 -0
  176. package/dist/node_modules/es-toolkit/dist/compat/object/get.js +39 -0
  177. package/dist/node_modules/es-toolkit/dist/compat/object/get.js.map +1 -0
  178. package/dist/node_modules/es-toolkit/dist/compat/object/has.js +21 -0
  179. package/dist/node_modules/es-toolkit/dist/compat/object/has.js.map +1 -0
  180. package/dist/node_modules/es-toolkit/dist/compat/object/keysIn.js +33 -0
  181. package/dist/node_modules/es-toolkit/dist/compat/object/keysIn.js.map +1 -0
  182. package/dist/node_modules/es-toolkit/dist/compat/object/mapValues.js +10 -0
  183. package/dist/node_modules/es-toolkit/dist/compat/object/mapValues.js.map +1 -0
  184. package/dist/node_modules/es-toolkit/dist/compat/object/merge.js +9 -0
  185. package/dist/node_modules/es-toolkit/dist/compat/object/merge.js.map +1 -0
  186. package/dist/node_modules/es-toolkit/dist/compat/object/mergeWith.js +53 -0
  187. package/dist/node_modules/es-toolkit/dist/compat/object/mergeWith.js.map +1 -0
  188. package/dist/node_modules/es-toolkit/dist/compat/object/property.js +10 -0
  189. package/dist/node_modules/es-toolkit/dist/compat/object/property.js.map +1 -0
  190. package/dist/node_modules/es-toolkit/dist/compat/object/set.js +9 -0
  191. package/dist/node_modules/es-toolkit/dist/compat/object/set.js.map +1 -0
  192. package/dist/node_modules/es-toolkit/dist/compat/object/updateWith.js +31 -0
  193. package/dist/node_modules/es-toolkit/dist/compat/object/updateWith.js.map +1 -0
  194. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArguments.js +8 -0
  195. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArguments.js.map +1 -0
  196. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArray.js +7 -0
  197. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArray.js.map +1 -0
  198. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js +8 -0
  199. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js.map +1 -0
  200. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js +9 -0
  201. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js.map +1 -0
  202. package/dist/node_modules/es-toolkit/dist/compat/predicate/isElement.js +9 -0
  203. package/dist/node_modules/es-toolkit/dist/compat/predicate/isElement.js.map +1 -0
  204. package/dist/node_modules/es-toolkit/dist/compat/predicate/isEqualWith.js +15 -0
  205. package/dist/node_modules/es-toolkit/dist/compat/predicate/isEqualWith.js.map +1 -0
  206. package/dist/node_modules/es-toolkit/dist/compat/predicate/isFunction.js +7 -0
  207. package/dist/node_modules/es-toolkit/dist/compat/predicate/isFunction.js.map +1 -0
  208. package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatch.js +9 -0
  209. package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatch.js.map +1 -0
  210. package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatchWith.js +81 -0
  211. package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatchWith.js.map +1 -0
  212. package/dist/node_modules/es-toolkit/dist/compat/predicate/isObject.js +7 -0
  213. package/dist/node_modules/es-toolkit/dist/compat/predicate/isObject.js.map +1 -0
  214. package/dist/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js +7 -0
  215. package/dist/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js.map +1 -0
  216. package/dist/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js +16 -0
  217. package/dist/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js.map +1 -0
  218. package/dist/node_modules/es-toolkit/dist/compat/predicate/isString.js +7 -0
  219. package/dist/node_modules/es-toolkit/dist/compat/predicate/isString.js.map +1 -0
  220. package/dist/node_modules/es-toolkit/dist/compat/predicate/isSymbol.js +7 -0
  221. package/dist/node_modules/es-toolkit/dist/compat/predicate/isSymbol.js.map +1 -0
  222. package/dist/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js +8 -0
  223. package/dist/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js.map +1 -0
  224. package/dist/node_modules/es-toolkit/dist/compat/predicate/matches.js +9 -0
  225. package/dist/node_modules/es-toolkit/dist/compat/predicate/matches.js.map +1 -0
  226. package/dist/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +23 -0
  227. package/dist/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js.map +1 -0
  228. package/dist/node_modules/es-toolkit/dist/compat/util/eq.js +7 -0
  229. package/dist/node_modules/es-toolkit/dist/compat/util/eq.js.map +1 -0
  230. package/dist/node_modules/es-toolkit/dist/compat/util/iteratee.js +19 -0
  231. package/dist/node_modules/es-toolkit/dist/compat/util/iteratee.js.map +1 -0
  232. package/dist/node_modules/es-toolkit/dist/compat/util/times.js +11 -0
  233. package/dist/node_modules/es-toolkit/dist/compat/util/times.js.map +1 -0
  234. package/dist/node_modules/es-toolkit/dist/compat/util/toFinite.js +8 -0
  235. package/dist/node_modules/es-toolkit/dist/compat/util/toFinite.js.map +1 -0
  236. package/dist/node_modules/es-toolkit/dist/compat/util/toInteger.js +9 -0
  237. package/dist/node_modules/es-toolkit/dist/compat/util/toInteger.js.map +1 -0
  238. package/dist/node_modules/es-toolkit/dist/compat/util/toNumber.js +8 -0
  239. package/dist/node_modules/es-toolkit/dist/compat/util/toNumber.js.map +1 -0
  240. package/dist/node_modules/es-toolkit/dist/compat/util/toPath.js +37 -0
  241. package/dist/node_modules/es-toolkit/dist/compat/util/toPath.js.map +1 -0
  242. package/dist/node_modules/es-toolkit/dist/compat/util/toString.js +15 -0
  243. package/dist/node_modules/es-toolkit/dist/compat/util/toString.js.map +1 -0
  244. package/dist/node_modules/es-toolkit/dist/function/after.js +11 -0
  245. package/dist/node_modules/es-toolkit/dist/function/after.js.map +1 -0
  246. package/dist/node_modules/es-toolkit/dist/function/debounce.js +30 -0
  247. package/dist/node_modules/es-toolkit/dist/function/debounce.js.map +1 -0
  248. package/dist/node_modules/es-toolkit/dist/function/identity.js +7 -0
  249. package/dist/node_modules/es-toolkit/dist/function/identity.js.map +1 -0
  250. package/dist/node_modules/es-toolkit/dist/function/noop.js +6 -0
  251. package/dist/node_modules/es-toolkit/dist/function/noop.js.map +1 -0
  252. package/dist/node_modules/es-toolkit/dist/object/clone.js +27 -0
  253. package/dist/node_modules/es-toolkit/dist/object/clone.js.map +1 -0
  254. package/dist/node_modules/es-toolkit/dist/object/cloneDeep.js +8 -0
  255. package/dist/node_modules/es-toolkit/dist/object/cloneDeep.js.map +1 -0
  256. package/dist/node_modules/es-toolkit/dist/object/cloneDeepWith.js +121 -0
  257. package/dist/node_modules/es-toolkit/dist/object/cloneDeepWith.js.map +1 -0
  258. package/dist/node_modules/es-toolkit/dist/object/mapValues.js +12 -0
  259. package/dist/node_modules/es-toolkit/dist/object/mapValues.js.map +1 -0
  260. package/dist/node_modules/es-toolkit/dist/predicate/isBuffer.js +8 -0
  261. package/dist/node_modules/es-toolkit/dist/predicate/isBuffer.js.map +1 -0
  262. package/dist/node_modules/es-toolkit/dist/predicate/isEqual.js +9 -0
  263. package/dist/node_modules/es-toolkit/dist/predicate/isEqual.js.map +1 -0
  264. package/dist/node_modules/es-toolkit/dist/predicate/isEqualWith.js +110 -0
  265. package/dist/node_modules/es-toolkit/dist/predicate/isEqualWith.js.map +1 -0
  266. package/dist/node_modules/es-toolkit/dist/predicate/isLength.js +7 -0
  267. package/dist/node_modules/es-toolkit/dist/predicate/isLength.js.map +1 -0
  268. package/dist/node_modules/es-toolkit/dist/predicate/isPlainObject.js +9 -0
  269. package/dist/node_modules/es-toolkit/dist/predicate/isPlainObject.js.map +1 -0
  270. package/dist/node_modules/es-toolkit/dist/predicate/isPrimitive.js +7 -0
  271. package/dist/node_modules/es-toolkit/dist/predicate/isPrimitive.js.map +1 -0
  272. package/dist/node_modules/es-toolkit/dist/predicate/isTypedArray.js +7 -0
  273. package/dist/node_modules/es-toolkit/dist/predicate/isTypedArray.js.map +1 -0
  274. package/dist/styles/global.css +4 -1
  275. package/dist/utils/copyText.d.ts +4 -0
  276. package/dist/utils/copyText.js +21 -0
  277. package/dist/utils/copyText.js.map +1 -0
  278. package/package.json +9 -2
@@ -0,0 +1,2107 @@
1
+ var X = Object.defineProperty;
2
+ var tt = (e, t, i) => t in e ? X(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
+ var u = (e, t, i) => tt(e, typeof t != "symbol" ? t + "" : t, i);
4
+ import { ObservableMixin as j, CKEditorError as a, logWarning as Y, getDataFromElement as et, setDataInElement as q, toArray as Z, Config as J, decodeLicenseKey as z, crc32 as it, releaseDate as nt, uid as M, logError as st, isFeatureBlockedByLicenseKey as ot, Locale as rt, Collection as at, KeystrokeHandler as lt, EmitterMixin as ct, global as N, env as P } from "../../ckeditor5-utils/dist/index.js";
5
+ import { isPlainObject as ut } from "../../../es-toolkit/dist/compat/predicate/isPlainObject.js";
6
+ import { get as dt } from "../../../es-toolkit/dist/compat/object/get.js";
7
+ import { set as ft } from "../../../es-toolkit/dist/compat/object/set.js";
8
+ import { isFunction as B } from "../../../es-toolkit/dist/compat/predicate/isFunction.js";
9
+ import { isElement as ht } from "../../../es-toolkit/dist/compat/predicate/isElement.js";
10
+ import { Model as gt, DataController as mt, StylesProcessor as wt, EditingController as yt, Conversion as pt } from "../../ckeditor5-engine/dist/index.js";
11
+ import { EditorWatchdog as bt, ContextWatchdog as _t } from "../../ckeditor5-watchdog/dist/index.js";
12
+ /**
13
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
14
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
15
+ */
16
+ /**
17
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
18
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
19
+ */
20
+ const kt = /* @__PURE__ */ j();
21
+ var Jt = class extends kt {
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ constructor(t) {
26
+ super();
27
+ /**
28
+ * The editor instance.
29
+ *
30
+ * Note that most editors implement the {@link module:core/editor/editor~Editor#ui} property.
31
+ * However, editors with an external UI (i.e. Bootstrap-based) or a headless editor may not have this property or
32
+ * throw an error when accessing it.
33
+ *
34
+ * Because of above, to make plugins more universal, it is recommended to split features into:
35
+ * - The "editing" part that uses the {@link module:core/editor/editor~Editor} class without `ui` property.
36
+ * - The "UI" part that uses the {@link module:core/editor/editor~Editor} class and accesses `ui` property.
37
+ */
38
+ u(this, "editor");
39
+ /**
40
+ * Holds identifiers for {@link #forceDisabled} mechanism.
41
+ */
42
+ u(this, "_disableStack", /* @__PURE__ */ new Set());
43
+ this.editor = t, this.set("isEnabled", !0);
44
+ }
45
+ /**
46
+ * Disables the plugin.
47
+ *
48
+ * Plugin may be disabled by multiple features or algorithms (at once). When disabling a plugin, unique id should be passed
49
+ * (e.g. feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the plugin.
50
+ * The plugin becomes enabled only after all features {@link #clearForceDisabled enabled it back}.
51
+ *
52
+ * Disabling and enabling a plugin:
53
+ *
54
+ * ```ts
55
+ * plugin.isEnabled; // -> true
56
+ * plugin.forceDisabled( 'MyFeature' );
57
+ * plugin.isEnabled; // -> false
58
+ * plugin.clearForceDisabled( 'MyFeature' );
59
+ * plugin.isEnabled; // -> true
60
+ * ```
61
+ *
62
+ * Plugin disabled by multiple features:
63
+ *
64
+ * ```ts
65
+ * plugin.forceDisabled( 'MyFeature' );
66
+ * plugin.forceDisabled( 'OtherFeature' );
67
+ * plugin.clearForceDisabled( 'MyFeature' );
68
+ * plugin.isEnabled; // -> false
69
+ * plugin.clearForceDisabled( 'OtherFeature' );
70
+ * plugin.isEnabled; // -> true
71
+ * ```
72
+ *
73
+ * Multiple disabling with the same identifier is redundant:
74
+ *
75
+ * ```ts
76
+ * plugin.forceDisabled( 'MyFeature' );
77
+ * plugin.forceDisabled( 'MyFeature' );
78
+ * plugin.clearForceDisabled( 'MyFeature' );
79
+ * plugin.isEnabled; // -> true
80
+ * ```
81
+ *
82
+ * **Note:** some plugins or algorithms may have more complex logic when it comes to enabling or disabling certain plugins,
83
+ * so the plugin might be still disabled after {@link #clearForceDisabled} was used.
84
+ *
85
+ * @param id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the plugin.
86
+ */
87
+ forceDisabled(t) {
88
+ this._disableStack.add(t), this._disableStack.size == 1 && (this.on("set:isEnabled", F, { priority: "highest" }), this.isEnabled = !1);
89
+ }
90
+ /**
91
+ * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.
92
+ *
93
+ * @param id Unique identifier, equal to the one passed in {@link #forceDisabled} call.
94
+ */
95
+ clearForceDisabled(t) {
96
+ this._disableStack.delete(t), this._disableStack.size == 0 && (this.off("set:isEnabled", F), this.isEnabled = !0);
97
+ }
98
+ /**
99
+ * @inheritDoc
100
+ */
101
+ destroy() {
102
+ this.stopListening();
103
+ }
104
+ /**
105
+ * @inheritDoc
106
+ */
107
+ static get isContextPlugin() {
108
+ return !1;
109
+ }
110
+ /**
111
+ * @inheritDoc
112
+ * @internal
113
+ */
114
+ static get isOfficialPlugin() {
115
+ return !1;
116
+ }
117
+ /**
118
+ * @inheritDoc
119
+ * @internal
120
+ */
121
+ static get isPremiumPlugin() {
122
+ return !1;
123
+ }
124
+ };
125
+ function F(e) {
126
+ e.return = !1, e.stop();
127
+ }
128
+ /**
129
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
130
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
131
+ */
132
+ const Et = /* @__PURE__ */ j();
133
+ var Qt = class extends Et {
134
+ /**
135
+ * Creates a new `Command` instance.
136
+ *
137
+ * @param editor The editor on which this command will be used.
138
+ */
139
+ constructor(t) {
140
+ super();
141
+ /**
142
+ * The editor on which this command will be used.
143
+ */
144
+ u(this, "editor");
145
+ /**
146
+ * A flag indicating whether a command's `isEnabled` state should be changed depending on where the document
147
+ * selection is placed.
148
+ *
149
+ * By default, it is set to `true`. If the document selection is placed in a
150
+ * {@link module:engine/model/model~Model#canEditAt non-editable} place (such as non-editable root), the command becomes disabled.
151
+ *
152
+ * The flag should be changed to `false` in a concrete command's constructor if the command should not change its `isEnabled`
153
+ * accordingly to the document selection.
154
+ */
155
+ u(this, "_isEnabledBasedOnSelection");
156
+ /**
157
+ * A flag indicating whether a command execution changes the editor data or not.
158
+ *
159
+ * @see #affectsData
160
+ */
161
+ u(this, "_affectsData");
162
+ /**
163
+ * Holds identifiers for {@link #forceDisabled} mechanism.
164
+ */
165
+ u(this, "_disableStack");
166
+ this.editor = t, this.set("value", void 0), this.set("isEnabled", !1), this._affectsData = !0, this._isEnabledBasedOnSelection = !0, this._disableStack = /* @__PURE__ */ new Set(), this.decorate("execute"), this.listenTo(this.editor.model.document, "change", () => {
167
+ this.refresh();
168
+ }), this.listenTo(t, "change:isReadOnly", () => {
169
+ this.refresh();
170
+ }), this.on("set:isEnabled", (i) => {
171
+ if (!this.affectsData) return;
172
+ const n = t.model.document.selection, s = n.getFirstPosition().root.rootName != "$graveyard" && t.model.canEditAt(n);
173
+ (t.isReadOnly || this._isEnabledBasedOnSelection && !s) && (i.return = !1, i.stop());
174
+ }, { priority: "highest" }), this.on("execute", (i) => {
175
+ this.isEnabled || i.stop();
176
+ }, { priority: "high" });
177
+ }
178
+ /**
179
+ * `Command` class is commonly put in `config.plugins` array.
180
+ *
181
+ * This property helps with better error detection.
182
+ *
183
+ * @internal
184
+ */
185
+ static get _throwErrorWhenUsedAsAPlugin() {
186
+ return !0;
187
+ }
188
+ /**
189
+ * A flag indicating whether a command execution changes the editor data or not.
190
+ *
191
+ * Commands with `affectsData` set to `false` will not be automatically disabled in
192
+ * the {@link module:core/editor/editor~Editor#isReadOnly read-only mode} and
193
+ * {@glink features/read-only#related-features other editor modes} with restricted user write permissions.
194
+ *
195
+ * **Note:** You do not have to set it for your every command. It is `true` by default.
196
+ *
197
+ * @default true
198
+ */
199
+ get affectsData() {
200
+ return this._affectsData;
201
+ }
202
+ set affectsData(t) {
203
+ this._affectsData = t;
204
+ }
205
+ /**
206
+ * Refreshes the command. The command should update its {@link #isEnabled} and {@link #value} properties
207
+ * in this method.
208
+ *
209
+ * This method is automatically called when
210
+ * {@link module:engine/model/document~ModelDocument#event:change any changes are applied to the document}.
211
+ */
212
+ refresh() {
213
+ this.isEnabled = !0;
214
+ }
215
+ /**
216
+ * Disables the command.
217
+ *
218
+ * Command may be disabled by multiple features or algorithms (at once). When disabling a command, unique id should be passed
219
+ * (e.g. the feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the command.
220
+ * The command becomes enabled only after all features {@link #clearForceDisabled enabled it back}.
221
+ *
222
+ * Disabling and enabling a command:
223
+ *
224
+ * ```ts
225
+ * command.isEnabled; // -> true
226
+ * command.forceDisabled( 'MyFeature' );
227
+ * command.isEnabled; // -> false
228
+ * command.clearForceDisabled( 'MyFeature' );
229
+ * command.isEnabled; // -> true
230
+ * ```
231
+ *
232
+ * Command disabled by multiple features:
233
+ *
234
+ * ```ts
235
+ * command.forceDisabled( 'MyFeature' );
236
+ * command.forceDisabled( 'OtherFeature' );
237
+ * command.clearForceDisabled( 'MyFeature' );
238
+ * command.isEnabled; // -> false
239
+ * command.clearForceDisabled( 'OtherFeature' );
240
+ * command.isEnabled; // -> true
241
+ * ```
242
+ *
243
+ * Multiple disabling with the same identifier is redundant:
244
+ *
245
+ * ```ts
246
+ * command.forceDisabled( 'MyFeature' );
247
+ * command.forceDisabled( 'MyFeature' );
248
+ * command.clearForceDisabled( 'MyFeature' );
249
+ * command.isEnabled; // -> true
250
+ * ```
251
+ *
252
+ * **Note:** some commands or algorithms may have more complex logic when it comes to enabling or disabling certain commands,
253
+ * so the command might be still disabled after {@link #clearForceDisabled} was used.
254
+ *
255
+ * @param id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the command.
256
+ */
257
+ forceDisabled(t) {
258
+ this._disableStack.add(t), this._disableStack.size == 1 && (this.on("set:isEnabled", G, { priority: "highest" }), this.isEnabled = !1);
259
+ }
260
+ /**
261
+ * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.
262
+ *
263
+ * @param id Unique identifier, equal to the one passed in {@link #forceDisabled} call.
264
+ */
265
+ clearForceDisabled(t) {
266
+ this._disableStack.delete(t), this._disableStack.size == 0 && (this.off("set:isEnabled", G), this.refresh());
267
+ }
268
+ /**
269
+ * Executes the command.
270
+ *
271
+ * A command may accept parameters. They will be passed from {@link module:core/editor/editor~Editor#execute `editor.execute()`}
272
+ * to the command.
273
+ *
274
+ * The `execute()` method will automatically abort when the command is disabled ({@link #isEnabled} is `false`).
275
+ * This behavior is implemented by a high priority listener to the {@link #event:execute} event.
276
+ *
277
+ * In order to see how to disable a command from "outside" see the {@link #isEnabled} documentation.
278
+ *
279
+ * This method may return a value, which would be forwarded all the way down to the
280
+ * {@link module:core/editor/editor~Editor#execute `editor.execute()`}.
281
+ *
282
+ * @fires execute
283
+ */
284
+ execute(...t) {
285
+ }
286
+ /**
287
+ * Destroys the command.
288
+ */
289
+ destroy() {
290
+ this.stopListening();
291
+ }
292
+ };
293
+ function G(e) {
294
+ e.return = !1, e.stop();
295
+ }
296
+ /**
297
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
298
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
299
+ */
300
+ var vt = class {
301
+ /**
302
+ * Creates collection instance.
303
+ */
304
+ constructor() {
305
+ /**
306
+ * Command map.
307
+ */
308
+ u(this, "_commands");
309
+ this._commands = /* @__PURE__ */ new Map();
310
+ }
311
+ /**
312
+ * Registers a new command.
313
+ *
314
+ * @param commandName The name of the command.
315
+ */
316
+ add(e, t) {
317
+ this._commands.set(e, t);
318
+ }
319
+ /**
320
+ * Retrieves a command from the collection.
321
+ *
322
+ * @param commandName The name of the command.
323
+ */
324
+ get(e) {
325
+ return this._commands.get(e);
326
+ }
327
+ /**
328
+ * Executes a command.
329
+ *
330
+ * @param commandName The name of the command.
331
+ * @param commandParams Command parameters.
332
+ * @returns The value returned by the {@link module:core/command~Command#execute `command.execute()`}.
333
+ */
334
+ execute(e, ...t) {
335
+ const i = this.get(e);
336
+ if (!i)
337
+ throw new a("commandcollection-command-not-found", this, { commandName: e });
338
+ return i.execute(...t);
339
+ }
340
+ /**
341
+ * Returns iterator of command names.
342
+ */
343
+ *names() {
344
+ yield* this._commands.keys();
345
+ }
346
+ /**
347
+ * Returns iterator of command instances.
348
+ */
349
+ *commands() {
350
+ yield* this._commands.values();
351
+ }
352
+ /**
353
+ * Iterable interface.
354
+ *
355
+ * Returns `[ commandName, commandInstance ]` pairs.
356
+ */
357
+ [Symbol.iterator]() {
358
+ return this._commands[Symbol.iterator]();
359
+ }
360
+ /**
361
+ * Destroys all collection commands.
362
+ */
363
+ destroy() {
364
+ for (const e of this.commands()) e.destroy();
365
+ }
366
+ };
367
+ /**
368
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
369
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
370
+ */
371
+ const Pt = /* @__PURE__ */ ct();
372
+ var Q = class extends Pt {
373
+ /**
374
+ * Creates an instance of the plugin collection class.
375
+ * Allows loading and initializing plugins and their dependencies.
376
+ * Allows providing a list of already loaded plugins. These plugins will not be destroyed along with this collection.
377
+ *
378
+ * @param availablePlugins Plugins (constructors) which the collection will be able to use
379
+ * when {@link module:core/plugincollection~PluginCollection#init} is used with the plugin names (strings, instead of constructors).
380
+ * Usually, the editor will pass its built-in plugins to the collection so they can later be
381
+ * used in `config.plugins` or `config.removePlugins` by names.
382
+ * @param contextPlugins A list of already initialized plugins represented by a `[ PluginConstructor, pluginInstance ]` pair.
383
+ */
384
+ constructor(t, i = [], n = []) {
385
+ super();
386
+ u(this, "_context");
387
+ u(this, "_plugins", /* @__PURE__ */ new Map());
388
+ /**
389
+ * A map of plugin constructors that can be retrieved by their names.
390
+ */
391
+ u(this, "_availablePlugins");
392
+ /**
393
+ * Map of {@link module:core/contextplugin~ContextPlugin context plugins} which can be retrieved by their constructors or instances.
394
+ */
395
+ u(this, "_contextPlugins");
396
+ this._context = t, this._availablePlugins = /* @__PURE__ */ new Map();
397
+ for (const s of i) s.pluginName && this._availablePlugins.set(s.pluginName, s);
398
+ this._contextPlugins = /* @__PURE__ */ new Map();
399
+ for (const [s, c] of n)
400
+ this._contextPlugins.set(s, c), this._contextPlugins.set(c, s), s.pluginName && this._availablePlugins.set(s.pluginName, s);
401
+ }
402
+ /**
403
+ * Iterable interface.
404
+ *
405
+ * Returns `[ PluginConstructor, pluginInstance ]` pairs.
406
+ */
407
+ *[Symbol.iterator]() {
408
+ for (const t of this._plugins) typeof t[0] == "function" && (yield t);
409
+ }
410
+ /**
411
+ * Gets the plugin instance by its constructor or name.
412
+ *
413
+ * ```ts
414
+ * // Check if 'Clipboard' plugin was loaded.
415
+ * if ( editor.plugins.has( 'ClipboardPipeline' ) ) {
416
+ * // Get clipboard plugin instance
417
+ * const clipboard = editor.plugins.get( 'ClipboardPipeline' );
418
+ *
419
+ * this.listenTo( clipboard, 'inputTransformation', ( evt, data ) => {
420
+ * // Do something on clipboard input.
421
+ * } );
422
+ * }
423
+ * ```
424
+ *
425
+ * **Note**: This method will throw an error if a plugin is not loaded. Use `{@link #has editor.plugins.has()}`
426
+ * to check if a plugin is available.
427
+ *
428
+ * @param key The plugin constructor or {@link module:core/plugin~PluginStaticMembers#pluginName name}.
429
+ */
430
+ get(t) {
431
+ const i = this._plugins.get(t);
432
+ if (!i) {
433
+ let n = t;
434
+ throw typeof t == "function" && (n = t.pluginName || t.name), new a("plugincollection-plugin-not-loaded", this._context, { plugin: n });
435
+ }
436
+ return i;
437
+ }
438
+ /**
439
+ * Checks if a plugin is loaded.
440
+ *
441
+ * ```ts
442
+ * // Check if the 'Clipboard' plugin was loaded.
443
+ * if ( editor.plugins.has( 'ClipboardPipeline' ) ) {
444
+ * // Now use the clipboard plugin instance:
445
+ * const clipboard = editor.plugins.get( 'ClipboardPipeline' );
446
+ *
447
+ * // ...
448
+ * }
449
+ * ```
450
+ *
451
+ * @param key The plugin constructor or {@link module:core/plugin~PluginStaticMembers#pluginName name}.
452
+ */
453
+ has(t) {
454
+ return this._plugins.has(t);
455
+ }
456
+ /**
457
+ * Initializes a set of plugins and adds them to the collection.
458
+ *
459
+ * @param plugins An array of {@link module:core/plugin~PluginInterface plugin constructors}
460
+ * or {@link module:core/plugin~PluginStaticMembers#pluginName plugin names}.
461
+ * @param pluginsToRemove Names of the plugins or plugin constructors
462
+ * that should not be loaded (despite being specified in the `plugins` array).
463
+ * @param pluginsSubstitutions An array of {@link module:core/plugin~PluginInterface plugin constructors}
464
+ * that will be used to replace plugins of the same names that were passed in `plugins` or that are in their dependency tree.
465
+ * A useful option for replacing built-in plugins while creating tests (for mocking their APIs). Plugins that will be replaced
466
+ * must follow these rules:
467
+ * * The new plugin must be a class.
468
+ * * The new plugin must be named.
469
+ * * Both plugins must not depend on other plugins.
470
+ * @returns A promise which gets resolved once all plugins are loaded and available in the collection.
471
+ */
472
+ async init(t, i = [], n = []) {
473
+ const s = this, c = this._context;
474
+ g(t), x(t);
475
+ const f = [...k(t.filter((o) => !h(o, i)))];
476
+ A(f, n);
477
+ const p = R(f);
478
+ return await b(p, "init"), await b(p, "afterInit"), p;
479
+ function m(o) {
480
+ return typeof o == "function";
481
+ }
482
+ function w(o) {
483
+ return m(o) && !!o.isContextPlugin;
484
+ }
485
+ function h(o, l) {
486
+ return l.some((r) => r === o || y(o) === r || y(r) === o);
487
+ }
488
+ function y(o) {
489
+ return m(o) ? o.pluginName || o.name : o;
490
+ }
491
+ function g(o, l = /* @__PURE__ */ new Set()) {
492
+ o.forEach((r) => {
493
+ m(r) && (l.has(r) || (l.add(r), r.pluginName && !s._availablePlugins.has(r.pluginName) && s._availablePlugins.set(r.pluginName, r), r.requires && g(r.requires, l)));
494
+ });
495
+ }
496
+ function k(o, l = /* @__PURE__ */ new Set()) {
497
+ return o.map((r) => m(r) ? r : s._availablePlugins.get(r)).reduce((r, d) => l.has(d) ? r : (l.add(d), d.requires && (x(d.requires, d), k(d.requires, l).forEach((v) => r.add(v))), r.add(d)), /* @__PURE__ */ new Set());
498
+ }
499
+ function x(o, l = null) {
500
+ o.map((r) => m(r) ? r : s._availablePlugins.get(r) || r).forEach((r) => {
501
+ _(r), D(r, l), I(r, l), L(r, l);
502
+ });
503
+ }
504
+ function _(o) {
505
+ if (typeof o == "function" && o._throwErrorWhenUsedAsAPlugin)
506
+ throw new a("plugincollection-plugin-invalid-constructor", c, { name: o.name });
507
+ }
508
+ function D(o, l) {
509
+ if (!m(o))
510
+ throw l ? new a("plugincollection-soft-required", c, {
511
+ missingPlugin: o,
512
+ requiredBy: y(l)
513
+ }) : new a("plugincollection-plugin-not-found", c, { plugin: o });
514
+ }
515
+ function I(o, l) {
516
+ if (w(l) && !w(o))
517
+ throw new a("plugincollection-context-required", c, {
518
+ plugin: y(o),
519
+ requiredBy: y(l)
520
+ });
521
+ }
522
+ function L(o, l) {
523
+ if (l && h(o, i))
524
+ throw new a("plugincollection-required", c, {
525
+ plugin: y(o),
526
+ requiredBy: y(l)
527
+ });
528
+ }
529
+ function R(o) {
530
+ return o.map((l) => {
531
+ let r = s._contextPlugins.get(l);
532
+ return r = r || new l(c), s._add(l, r), r;
533
+ });
534
+ }
535
+ function b(o, l) {
536
+ return o.reduce((r, d) => !d[l] || s._contextPlugins.has(d) ? r : r.then(d[l].bind(d)), Promise.resolve());
537
+ }
538
+ function A(o, l) {
539
+ for (const r of l) {
540
+ if (typeof r != "function")
541
+ throw new a("plugincollection-replace-plugin-invalid-type", null, { pluginItem: r });
542
+ const d = r.pluginName;
543
+ if (!d)
544
+ throw new a("plugincollection-replace-plugin-missing-name", null, { pluginItem: r });
545
+ if (r.requires && r.requires.length)
546
+ throw new a("plugincollection-plugin-for-replacing-cannot-have-dependencies", null, { pluginName: d });
547
+ const v = s._availablePlugins.get(d);
548
+ if (!v)
549
+ throw new a("plugincollection-plugin-for-replacing-not-exist", null, { pluginName: d });
550
+ const O = o.indexOf(v);
551
+ if (O === -1) {
552
+ if (s._contextPlugins.has(v)) return;
553
+ throw new a("plugincollection-plugin-for-replacing-not-loaded", null, { pluginName: d });
554
+ }
555
+ if (v.requires && v.requires.length)
556
+ throw new a("plugincollection-replaced-plugin-cannot-have-dependencies", null, { pluginName: d });
557
+ o.splice(O, 1, r), s._availablePlugins.set(d, r);
558
+ }
559
+ }
560
+ }
561
+ /**
562
+ * Destroys all loaded plugins.
563
+ */
564
+ destroy() {
565
+ const t = [];
566
+ for (const [, i] of this) typeof i.destroy == "function" && !this._contextPlugins.has(i) && t.push(i.destroy());
567
+ return Promise.all(t);
568
+ }
569
+ /**
570
+ * Adds the plugin to the collection. Exposed mainly for testing purposes.
571
+ *
572
+ * @param PluginConstructor The plugin constructor.
573
+ * @param plugin The instance of the plugin.
574
+ */
575
+ _add(t, i) {
576
+ this._plugins.set(t, i);
577
+ const n = t.pluginName;
578
+ if (n) {
579
+ if (this._plugins.has(n))
580
+ throw new a("plugincollection-plugin-name-conflict", null, {
581
+ pluginName: n,
582
+ plugin1: this._plugins.get(n).constructor,
583
+ plugin2: t
584
+ });
585
+ this._plugins.set(n, i);
586
+ }
587
+ }
588
+ };
589
+ /**
590
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
591
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
592
+ */
593
+ var C, W = (C = class {
594
+ /**
595
+ * Creates a context instance with a given configuration.
596
+ *
597
+ * Usually not to be used directly. See the static {@link module:core/context~Context.create `create()`} method.
598
+ *
599
+ * @param config The context configuration.
600
+ */
601
+ constructor(e) {
602
+ /**
603
+ * Stores all the configurations specific to this context instance.
604
+ */
605
+ u(this, "config");
606
+ /**
607
+ * The plugins loaded and in use by this context instance.
608
+ */
609
+ u(this, "plugins");
610
+ u(this, "locale");
611
+ /**
612
+ * Shorthand for {@link module:utils/locale~Locale#t}.
613
+ */
614
+ u(this, "t");
615
+ /**
616
+ * A list of editors that this context instance is injected to.
617
+ */
618
+ u(this, "editors");
619
+ /**
620
+ * Reference to the editor which created the context.
621
+ * Null when the context was created outside of the editor.
622
+ *
623
+ * It is used to destroy the context when removing the editor that has created the context.
624
+ */
625
+ u(this, "_contextOwner", null);
626
+ const { translations: t, ...i } = e || {};
627
+ this.config = new J(i, this.constructor.defaultConfig);
628
+ const n = this.constructor.builtinPlugins;
629
+ this.config.define("plugins", n), this.plugins = new Q(this, n);
630
+ const s = this.config.get("language") || {};
631
+ this.locale = new rt({
632
+ uiLanguage: typeof s == "string" ? s : s.ui,
633
+ contentLanguage: this.config.get("language.content"),
634
+ translations: t
635
+ }), this.t = this.locale.t, this.editors = new at();
636
+ }
637
+ /**
638
+ * Loads and initializes plugins specified in the configuration.
639
+ *
640
+ * @returns A promise which resolves once the initialization is completed, providing an array of loaded plugins.
641
+ */
642
+ initPlugins() {
643
+ const e = this.config.get("plugins") || [], t = this.config.get("substitutePlugins") || [];
644
+ for (const i of e.concat(t)) {
645
+ if (typeof i != "function")
646
+ throw new a("context-initplugins-constructor-only", null, { Plugin: i });
647
+ if (i.isContextPlugin !== !0)
648
+ throw new a("context-initplugins-invalid-plugin", null, { Plugin: i });
649
+ }
650
+ return this.plugins.init(e, [], t);
651
+ }
652
+ /**
653
+ * Destroys the context instance and all editors used with the context,
654
+ * releasing all resources used by the context.
655
+ *
656
+ * @returns A promise that resolves once the context instance is fully destroyed.
657
+ */
658
+ destroy() {
659
+ return Promise.all(Array.from(this.editors, (e) => e.destroy())).then(() => this.plugins.destroy());
660
+ }
661
+ /**
662
+ * Adds a reference to the editor which is used with this context.
663
+ *
664
+ * When the given editor has created the context, the reference to this editor will be stored
665
+ * as a {@link ~Context#_contextOwner}.
666
+ *
667
+ * This method should only be used by the editor.
668
+ *
669
+ * @internal
670
+ * @param isContextOwner Stores the given editor as a context owner.
671
+ */
672
+ _addEditor(e, t) {
673
+ if (this._contextOwner)
674
+ throw new a("context-addeditor-private-context");
675
+ this.editors.add(e), t && (this._contextOwner = e);
676
+ }
677
+ /**
678
+ * Removes a reference to the editor which was used with this context.
679
+ * When the context was created by the given editor, the context will be destroyed.
680
+ *
681
+ * This method should only be used by the editor.
682
+ *
683
+ * @internal
684
+ * @return A promise that resolves once the editor is removed from the context or when the context was destroyed.
685
+ */
686
+ _removeEditor(e) {
687
+ return this.editors.has(e) && this.editors.remove(e), this._contextOwner === e ? this.destroy() : Promise.resolve();
688
+ }
689
+ /**
690
+ * Returns the context configuration which will be copied to the editors created using this context.
691
+ *
692
+ * The configuration returned by this method has the plugins configuration removed – plugins are shared with all editors
693
+ * through another mechanism.
694
+ *
695
+ * This method should only be used by the editor.
696
+ *
697
+ * @internal
698
+ * @returns Configuration as a plain object.
699
+ */
700
+ _getEditorConfig() {
701
+ const e = {};
702
+ for (const t of this.config.names()) [
703
+ "plugins",
704
+ "removePlugins",
705
+ "extraPlugins"
706
+ ].includes(t) || (e[t] = this.config.get(t));
707
+ return e;
708
+ }
709
+ /**
710
+ * Creates and initializes a new context instance.
711
+ *
712
+ * ```ts
713
+ * const commonConfig = { ... }; // Configuration for all the plugins and editors.
714
+ * const editorPlugins = [ ... ]; // Regular plugins here.
715
+ *
716
+ * Context
717
+ * .create( {
718
+ * // Only context plugins here.
719
+ * plugins: [ ... ],
720
+ *
721
+ * // Configure the language for all the editors (it cannot be overwritten).
722
+ * language: { ... },
723
+ *
724
+ * // Configuration for context plugins.
725
+ * comments: { ... },
726
+ * ...
727
+ *
728
+ * // Default configuration for editor plugins.
729
+ * toolbar: { ... },
730
+ * image: { ... },
731
+ * ...
732
+ * } )
733
+ * .then( context => {
734
+ * const promises = [];
735
+ *
736
+ * promises.push( ClassicEditor.create(
737
+ * document.getElementById( 'editor1' ),
738
+ * {
739
+ * editorPlugins,
740
+ * context
741
+ * }
742
+ * ) );
743
+ *
744
+ * promises.push( ClassicEditor.create(
745
+ * document.getElementById( 'editor2' ),
746
+ * {
747
+ * editorPlugins,
748
+ * context,
749
+ * toolbar: { ... } // You can overwrite the configuration of the context.
750
+ * }
751
+ * ) );
752
+ *
753
+ * return Promise.all( promises );
754
+ * } );
755
+ * ```
756
+ *
757
+ * @param config The context configuration.
758
+ * @returns A promise resolved once the context is ready. The promise resolves with the created context instance.
759
+ */
760
+ static create(e) {
761
+ return new Promise((t) => {
762
+ const i = new this(e);
763
+ t(i.initPlugins().then(() => i));
764
+ });
765
+ }
766
+ /**
767
+ * `Context` class is commonly put in `config.plugins` array.
768
+ *
769
+ * This property helps with better error detection.
770
+ *
771
+ * @internal
772
+ */
773
+ static get _throwErrorWhenUsedAsAPlugin() {
774
+ return !0;
775
+ }
776
+ }, /**
777
+ * The default configuration which is built into the `Context` class.
778
+ *
779
+ * It was used in the now deprecated CKEditor 5 builds featuring `Context` to provide the default configuration options
780
+ * which are later used during the context initialization.
781
+ *
782
+ * ```ts
783
+ * Context.defaultConfig = {
784
+ * foo: 1,
785
+ * bar: 2
786
+ * };
787
+ *
788
+ * Context
789
+ * .create()
790
+ * .then( context => {
791
+ * context.config.get( 'foo' ); // -> 1
792
+ * context.config.get( 'bar' ); // -> 2
793
+ * } );
794
+ *
795
+ * // The default options can be overridden by the configuration passed to create().
796
+ * Context
797
+ * .create( { bar: 3 } )
798
+ * .then( context => {
799
+ * context.config.get( 'foo' ); // -> 1
800
+ * context.config.get( 'bar' ); // -> 3
801
+ * } );
802
+ * ```
803
+ *
804
+ * See also {@link module:core/context~Context.builtinPlugins `Context.builtinPlugins`}
805
+ * and {@link module:core/editor/editor~Editor.defaultConfig `Editor.defaultConfig`}.
806
+ */
807
+ u(C, "defaultConfig"), /**
808
+ * An array of plugins built into the `Context` class.
809
+ *
810
+ * It was used in the now deprecated CKEditor 5 builds featuring `Context` to provide the default configuration options
811
+ * which are later used during the context initialization.
812
+ *
813
+ * They will be automatically initialized by `Context` unless `config.plugins` is passed.
814
+ *
815
+ * ```ts
816
+ * // Build some context plugins into the Context class first.
817
+ * Context.builtinPlugins = [ FooPlugin, BarPlugin ];
818
+ *
819
+ * // Normally, you need to define config.plugins, but since Context.builtinPlugins was
820
+ * // defined, now you can call create() without any configuration.
821
+ * Context
822
+ * .create()
823
+ * .then( context => {
824
+ * context.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
825
+ * context.plugins.get( BarPlugin ); // -> An instance of the Bar plugin.
826
+ * } );
827
+ * ```
828
+ *
829
+ * See also {@link module:core/context~Context.defaultConfig `Context.defaultConfig`}
830
+ * and {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}.
831
+ */
832
+ u(C, "builtinPlugins"), C);
833
+ /**
834
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
835
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
836
+ */
837
+ var St = class extends lt {
838
+ /**
839
+ * Creates an instance of the keystroke handler.
840
+ */
841
+ constructor(t) {
842
+ super();
843
+ /**
844
+ * The editor instance.
845
+ */
846
+ u(this, "editor");
847
+ this.editor = t;
848
+ }
849
+ /**
850
+ * Registers a handler for the specified keystroke.
851
+ *
852
+ * The handler can be specified as a command name or a callback.
853
+ *
854
+ * @param keystroke Keystroke defined in a format accepted by
855
+ * the {@link module:utils/keyboard~parseKeystroke} function.
856
+ * @param callback If a string is passed, then the keystroke will
857
+ * {@link module:core/editor/editor~Editor#execute execute a command}.
858
+ * If a function, then it will be called with the
859
+ * {@link module:engine/view/observer/keyobserver~ViewDocumentKeyEventData key event data} object and
860
+ * a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.
861
+ * @param options Additional options.
862
+ * @param options.priority The priority of the keystroke callback. The higher the priority value
863
+ * the sooner the callback will be executed. Keystrokes having the same priority
864
+ * are called in the order they were added.
865
+ */
866
+ set(t, i, n = {}) {
867
+ if (typeof i == "string") {
868
+ const s = i;
869
+ i = (c, f) => {
870
+ this.editor.execute(s), f();
871
+ };
872
+ }
873
+ super.set(t, i, n);
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
+ const T = "contentEditing", $ = "common";
881
+ var xt = class {
882
+ /**
883
+ * @inheritDoc
884
+ */
885
+ constructor(e) {
886
+ /**
887
+ * Stores information about keystrokes brought by editor features for the users to interact with the editor, mainly
888
+ * keystroke combinations and their accessible labels.
889
+ *
890
+ * This information is particularly useful for screen reader and other assistive technology users. It gets displayed
891
+ * by the {@link module:ui/editorui/accessibilityhelp/accessibilityhelp~AccessibilityHelp Accessibility help} dialog.
892
+ *
893
+ * Keystrokes are organized in categories and groups. They can be added using ({@link #addKeystrokeInfoCategory},
894
+ * {@link #addKeystrokeInfoGroup}, and {@link #addKeystrokeInfos}) methods.
895
+ *
896
+ * Please note that:
897
+ * * two categories are always available:
898
+ * * `'contentEditing'` for keystrokes related to content creation,
899
+ * * `'navigation'` for keystrokes related to navigation in the UI and the content.
900
+ * * unless specified otherwise, new keystrokes are added into the `'contentEditing'` category and the `'common'`
901
+ * keystroke group within that category while using the {@link #addKeystrokeInfos} method.
902
+ */
903
+ u(this, "keystrokeInfos", /* @__PURE__ */ new Map());
904
+ /**
905
+ * The editor instance.
906
+ */
907
+ u(this, "_editor");
908
+ this._editor = e;
909
+ const t = e.config.get("menuBar.isVisible"), i = e.locale.t;
910
+ this.addKeystrokeInfoCategory({
911
+ id: T,
912
+ label: i("Content editing keystrokes"),
913
+ description: i("These keyboard shortcuts allow for quick access to content editing features.")
914
+ });
915
+ const n = [
916
+ {
917
+ label: i("Close contextual balloons, dropdowns, and dialogs"),
918
+ keystroke: "Esc"
919
+ },
920
+ {
921
+ label: i("Open the accessibility help dialog"),
922
+ keystroke: "Alt+0"
923
+ },
924
+ {
925
+ label: i("Move focus between form fields (inputs, buttons, etc.)"),
926
+ keystroke: [["Tab"], ["Shift+Tab"]]
927
+ },
928
+ {
929
+ label: i("Move focus to the toolbar, navigate between toolbars"),
930
+ keystroke: "Alt+F10",
931
+ mayRequireFn: !0
932
+ },
933
+ {
934
+ label: i("Navigate through the toolbar or menu bar"),
935
+ keystroke: [
936
+ ["arrowup"],
937
+ ["arrowright"],
938
+ ["arrowdown"],
939
+ ["arrowleft"]
940
+ ]
941
+ },
942
+ {
943
+ label: i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),
944
+ keystroke: [["Enter"], ["Space"]]
945
+ }
946
+ ];
947
+ t && n.push({
948
+ label: i("Move focus to the menu bar, navigate between menu bars"),
949
+ keystroke: "Alt+F9",
950
+ mayRequireFn: !0
951
+ }), this.addKeystrokeInfoCategory({
952
+ id: "navigation",
953
+ label: i("User interface and content navigation keystrokes"),
954
+ description: i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),
955
+ groups: [{
956
+ id: "common",
957
+ keystrokes: n
958
+ }]
959
+ });
960
+ }
961
+ /**
962
+ * Adds a top-level category in the {@link #keystrokeInfos keystroke information database} with a label and optional description.
963
+ *
964
+ * Categories organize keystrokes and help users to find the right keystroke. Each category can have multiple groups
965
+ * of keystrokes that narrow down the context in which the keystrokes are available. Every keystroke category comes
966
+ * with a `'common'` group by default.
967
+ *
968
+ * By default, two categories are available:
969
+ * * `'contentEditing'` for keystrokes related to content creation,
970
+ * * `'navigation'` for keystrokes related to navigation in the UI and the content.
971
+ *
972
+ * To create a new keystroke category with new groups, use the following code:
973
+ *
974
+ * ```js
975
+ * class MyPlugin extends Plugin {
976
+ * // ...
977
+ * init() {
978
+ * const editor = this.editor;
979
+ * const t = editor.t;
980
+ *
981
+ * // ...
982
+ *
983
+ * editor.accessibility.addKeystrokeInfoCategory( {
984
+ * id: 'myCategory',
985
+ * label: t( 'My category' ),
986
+ * description: t( 'My category description.' ),
987
+ * groups: [
988
+ * {
989
+ * id: 'myGroup',
990
+ * label: t( 'My keystroke group' ),
991
+ * keystrokes: [
992
+ * {
993
+ * label: t( 'Keystroke label 1' ),
994
+ * keystroke: 'Ctrl+Shift+N'
995
+ * },
996
+ * {
997
+ * label: t( 'Keystroke label 2' ),
998
+ * keystroke: 'Ctrl+Shift+M'
999
+ * }
1000
+ * ]
1001
+ * }
1002
+ * ]
1003
+ * };
1004
+ * }
1005
+ * }
1006
+ * ```
1007
+ *
1008
+ * See {@link #keystrokeInfos}, {@link #addKeystrokeInfoGroup}, and {@link #addKeystrokeInfos}.
1009
+ */
1010
+ addKeystrokeInfoCategory({ id: e, label: t, description: i, groups: n }) {
1011
+ this.keystrokeInfos.set(e, {
1012
+ id: e,
1013
+ label: t,
1014
+ description: i,
1015
+ groups: /* @__PURE__ */ new Map()
1016
+ }), this.addKeystrokeInfoGroup({
1017
+ categoryId: e,
1018
+ id: $
1019
+ }), n && n.forEach((s) => {
1020
+ this.addKeystrokeInfoGroup({
1021
+ categoryId: e,
1022
+ ...s
1023
+ });
1024
+ });
1025
+ }
1026
+ /**
1027
+ * Adds a group of keystrokes in a specific category to the {@link #keystrokeInfos keystroke information database}.
1028
+ *
1029
+ * Groups narrow down the context in which the keystrokes are available. When `categoryId` is not specified,
1030
+ * the group goes to the `'contentEditing'` category (default).
1031
+ *
1032
+ * To create a new group within an existing category, use the following code:
1033
+ *
1034
+ * ```js
1035
+ * class MyPlugin extends Plugin {
1036
+ * // ...
1037
+ * init() {
1038
+ * const editor = this.editor;
1039
+ * const t = editor.t;
1040
+ *
1041
+ * // ...
1042
+ *
1043
+ * editor.accessibility.addKeystrokeInfoGroup( {
1044
+ * id: 'myGroup',
1045
+ * categoryId: 'navigation',
1046
+ * label: t( 'My keystroke group' ),
1047
+ * keystrokes: [
1048
+ * {
1049
+ * label: t( 'Keystroke label 1' ),
1050
+ * keystroke: 'Ctrl+Shift+N'
1051
+ * },
1052
+ * {
1053
+ * label: t( 'Keystroke label 2' ),
1054
+ * keystroke: 'Ctrl+Shift+M'
1055
+ * }
1056
+ * ]
1057
+ * } );
1058
+ * }
1059
+ * }
1060
+ * ```
1061
+ *
1062
+ * See {@link #keystrokeInfos}, {@link #addKeystrokeInfoCategory}, and {@link #addKeystrokeInfos}.
1063
+ */
1064
+ addKeystrokeInfoGroup({ categoryId: e = T, id: t, label: i, keystrokes: n }) {
1065
+ const s = this.keystrokeInfos.get(e);
1066
+ if (!s) throw new a("accessibility-unknown-keystroke-info-category", this._editor, {
1067
+ groupId: t,
1068
+ categoryId: e
1069
+ });
1070
+ s.groups.set(t, {
1071
+ id: t,
1072
+ label: i,
1073
+ keystrokes: n || []
1074
+ });
1075
+ }
1076
+ /**
1077
+ * Adds information about keystrokes to the {@link #keystrokeInfos keystroke information database}.
1078
+ *
1079
+ * Keystrokes without specified `groupId` or `categoryId` go to the `'common'` group in the `'contentEditing'` category (default).
1080
+ *
1081
+ * To add a keystroke brought by your plugin (using default group and category), use the following code:
1082
+ *
1083
+ * ```js
1084
+ * class MyPlugin extends Plugin {
1085
+ * // ...
1086
+ * init() {
1087
+ * const editor = this.editor;
1088
+ * const t = editor.t;
1089
+ *
1090
+ * // ...
1091
+ *
1092
+ * editor.accessibility.addKeystrokeInfos( {
1093
+ * keystrokes: [
1094
+ * {
1095
+ * label: t( 'Keystroke label' ),
1096
+ * keystroke: 'CTRL+B'
1097
+ * }
1098
+ * ]
1099
+ * } );
1100
+ * }
1101
+ * }
1102
+ * ```
1103
+ * To add a keystroke in a specific existing `'widget'` group in the default `'contentEditing'` category:
1104
+ *
1105
+ * ```js
1106
+ * class MyPlugin extends Plugin {
1107
+ * // ...
1108
+ * init() {
1109
+ * const editor = this.editor;
1110
+ * const t = editor.t;
1111
+ *
1112
+ * // ...
1113
+ *
1114
+ * editor.accessibility.addKeystrokeInfos( {
1115
+ * // Add a keystroke to the existing "widget" group.
1116
+ * groupId: 'widget',
1117
+ * keystrokes: [
1118
+ * {
1119
+ * label: t( 'A an action on a selected widget' ),
1120
+ * keystroke: 'Ctrl+D',
1121
+ * }
1122
+ * ]
1123
+ * } );
1124
+ * }
1125
+ * }
1126
+ * ```
1127
+ *
1128
+ * To add a keystroke to another existing category (using default group):
1129
+ *
1130
+ * ```js
1131
+ * class MyPlugin extends Plugin {
1132
+ * // ...
1133
+ * init() {
1134
+ * const editor = this.editor;
1135
+ * const t = editor.t;
1136
+ *
1137
+ * // ...
1138
+ *
1139
+ * editor.accessibility.addKeystrokeInfos( {
1140
+ * // Add keystrokes to the "navigation" category (one of defaults).
1141
+ * categoryId: 'navigation',
1142
+ * keystrokes: [
1143
+ * {
1144
+ * label: t( 'Keystroke label' ),
1145
+ * keystroke: 'CTRL+B'
1146
+ * }
1147
+ * ]
1148
+ * } );
1149
+ * }
1150
+ * }
1151
+ * ```
1152
+ *
1153
+ * See {@link #keystrokeInfos}, {@link #addKeystrokeInfoGroup}, and {@link #addKeystrokeInfoCategory}.
1154
+ */
1155
+ addKeystrokeInfos({ categoryId: e = T, groupId: t = $, keystrokes: i }) {
1156
+ if (!this.keystrokeInfos.has(e))
1157
+ throw new a("accessibility-unknown-keystroke-info-category", this._editor, {
1158
+ categoryId: e,
1159
+ keystrokes: i
1160
+ });
1161
+ const n = this.keystrokeInfos.get(e);
1162
+ if (!n.groups.has(t))
1163
+ throw new a("accessibility-unknown-keystroke-info-group", this._editor, {
1164
+ groupId: t,
1165
+ categoryId: e,
1166
+ keystrokes: i
1167
+ });
1168
+ n.groups.get(t).keystrokes.push(...i);
1169
+ }
1170
+ };
1171
+ /**
1172
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
1173
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
1174
+ */
1175
+ function At(e) {
1176
+ return {
1177
+ sessionId: Lt(),
1178
+ pageSessionId: Rt(),
1179
+ hostname: window.location.hostname,
1180
+ version: globalThis.CKEDITOR_VERSION,
1181
+ type: Ot(e),
1182
+ plugins: Ct(e.plugins),
1183
+ distribution: Dt(),
1184
+ env: It(),
1185
+ integration: /* @__PURE__ */ Object.create(null),
1186
+ menuBar: { isVisible: !!e.config.get("menuBar.isVisible") },
1187
+ language: {
1188
+ ui: e.locale.uiLanguage,
1189
+ content: e.locale.contentLanguage
1190
+ },
1191
+ toolbar: {
1192
+ main: K(e.config.get("toolbar")),
1193
+ block: K(e.config.get("blockToolbar")),
1194
+ balloon: K(e.config.get("balloonToolbar"))
1195
+ }
1196
+ };
1197
+ }
1198
+ function Ot(e) {
1199
+ return Object.getPrototypeOf(e).constructor.editorName;
1200
+ }
1201
+ function Ct(e) {
1202
+ return Array.from(e).filter(([t]) => !!t.pluginName).map(([t]) => {
1203
+ const { pluginName: i, isContextPlugin: n, isOfficialPlugin: s, isPremiumPlugin: c } = t;
1204
+ return {
1205
+ isContext: !!n,
1206
+ isOfficial: !!s,
1207
+ isPremium: !!c,
1208
+ name: i
1209
+ };
1210
+ });
1211
+ }
1212
+ function K(e) {
1213
+ if (!e) return;
1214
+ const t = Array.isArray(e) ? { items: e } : e, i = s(t.items || []);
1215
+ return {
1216
+ isMultiline: i.includes("-"),
1217
+ shouldNotGroupWhenFull: !!t.shouldNotGroupWhenFull,
1218
+ items: n(i)
1219
+ };
1220
+ function n(c) {
1221
+ return c.filter((f) => f !== "|" && f !== "-");
1222
+ }
1223
+ function s(c) {
1224
+ return c.flatMap((f) => typeof f == "string" ? [f] : s(f.items));
1225
+ }
1226
+ }
1227
+ function Dt() {
1228
+ return { channel: window[Symbol.for("cke distribution")] || "sh" };
1229
+ }
1230
+ function It() {
1231
+ let e = "unknown", t = "unknown";
1232
+ return P.isMac ? e = "mac" : P.isWindows ? e = "windows" : P.isiOS ? e = "ios" : P.isAndroid && (e = "android"), P.isGecko ? t = "gecko" : P.isBlink ? t = "blink" : P.isSafari && (t = "safari"), {
1233
+ os: e,
1234
+ browser: t
1235
+ };
1236
+ }
1237
+ function Lt() {
1238
+ return localStorage.getItem("__ckeditor-session-id") || localStorage.setItem("__ckeditor-session-id", M()), localStorage.getItem("__ckeditor-session-id");
1239
+ }
1240
+ function Rt() {
1241
+ return N.window.CKEDITOR_PAGE_SESSION_ID = N.window.CKEDITOR_PAGE_SESSION_ID || M(), N.window.CKEDITOR_PAGE_SESSION_ID;
1242
+ }
1243
+ /**
1244
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
1245
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
1246
+ */
1247
+ const Nt = /* @__PURE__ */ j();
1248
+ var S, Xt = (S = class extends Nt {
1249
+ /**
1250
+ * Creates a new instance of the editor class.
1251
+ *
1252
+ * Usually, not to be used directly. See the static {@link module:core/editor/editor~Editor.create `create()`} method.
1253
+ *
1254
+ * @param config The editor configuration.
1255
+ */
1256
+ constructor(t = {}) {
1257
+ super();
1258
+ /**
1259
+ * A namespace for the accessibility features of the editor.
1260
+ */
1261
+ u(this, "accessibility");
1262
+ /**
1263
+ * Commands registered to the editor.
1264
+ *
1265
+ * Use the shorthand {@link #execute `editor.execute()`} method to execute commands:
1266
+ *
1267
+ * ```ts
1268
+ * // Execute the bold command:
1269
+ * editor.execute( 'bold' );
1270
+ *
1271
+ * // Check the state of the bold command:
1272
+ * editor.commands.get( 'bold' ).value;
1273
+ * ```
1274
+ */
1275
+ u(this, "commands");
1276
+ /**
1277
+ * Stores all configurations specific to this editor instance.
1278
+ *
1279
+ * ```ts
1280
+ * editor.config.get( 'image.toolbar' );
1281
+ * // -> [ 'imageStyle:block', 'imageStyle:side', '|', 'toggleImageCaption', 'imageTextAlternative' ]
1282
+ * ```
1283
+ */
1284
+ u(this, "config");
1285
+ /**
1286
+ * Conversion manager through which you can register model-to-view and view-to-model converters.
1287
+ *
1288
+ * See the {@link module:engine/conversion/conversion~Conversion} documentation to learn how to add converters.
1289
+ */
1290
+ u(this, "conversion");
1291
+ /**
1292
+ * The {@link module:engine/controller/datacontroller~DataController data controller}.
1293
+ * Used e.g. for setting and retrieving the editor data.
1294
+ */
1295
+ u(this, "data");
1296
+ /**
1297
+ * The {@link module:engine/controller/editingcontroller~EditingController editing controller}.
1298
+ * Controls user input and rendering the content for editing.
1299
+ */
1300
+ u(this, "editing");
1301
+ /**
1302
+ * The locale instance.
1303
+ */
1304
+ u(this, "locale");
1305
+ /**
1306
+ * The editor's model.
1307
+ *
1308
+ * The central point of the editor's abstract data model.
1309
+ */
1310
+ u(this, "model");
1311
+ /**
1312
+ * The plugins loaded and in use by this editor instance.
1313
+ *
1314
+ * ```ts
1315
+ * editor.plugins.get( 'ClipboardPipeline' ); // -> An instance of the clipboard pipeline plugin.
1316
+ * ```
1317
+ */
1318
+ u(this, "plugins");
1319
+ /**
1320
+ * An instance of the {@link module:core/editingkeystrokehandler~EditingKeystrokeHandler}.
1321
+ *
1322
+ * It allows setting simple keystrokes:
1323
+ *
1324
+ * ```ts
1325
+ * // Execute the bold command on Ctrl+E:
1326
+ * editor.keystrokes.set( 'Ctrl+E', 'bold' );
1327
+ *
1328
+ * // Execute your own callback:
1329
+ * editor.keystrokes.set( 'Ctrl+E', ( data, cancel ) => {
1330
+ * console.log( data.keyCode );
1331
+ *
1332
+ * // Prevent the default (native) action and stop the underlying keydown event
1333
+ * // so no other editor feature will interfere.
1334
+ * cancel();
1335
+ * } );
1336
+ * ```
1337
+ *
1338
+ * Note: Certain typing-oriented keystrokes (like <kbd>Backspace</kbd> or <kbd>Enter</kbd>) are handled
1339
+ * by a low-level mechanism and trying to listen to them via the keystroke handler will not work reliably.
1340
+ * To handle these specific keystrokes, see the events fired by the
1341
+ * {@link module:engine/view/document~ViewDocument editing view document} (`editor.editing.view.document`).
1342
+ */
1343
+ u(this, "keystrokes");
1344
+ /**
1345
+ * Shorthand for {@link module:utils/locale~Locale#t}.
1346
+ *
1347
+ * @see module:utils/locale~Locale#t
1348
+ */
1349
+ u(this, "t");
1350
+ /**
1351
+ * The editor context.
1352
+ * When it is not provided through the configuration, the editor creates it.
1353
+ */
1354
+ u(this, "_context");
1355
+ /**
1356
+ * A set of lock IDs for the {@link #isReadOnly} getter.
1357
+ */
1358
+ u(this, "_readOnlyLocks");
1359
+ /**
1360
+ * Holds attributes keys that were passed in
1361
+ * {@link module:core/editor/editorconfig~EditorConfig#roots `config.roots.<rootName>.modelAttributes`}
1362
+ * or {@link module:core/editor/editorconfig~EditorConfig#root `config.root.modelAttributes`}.
1363
+ */
1364
+ u(this, "_registeredRootsAttributesKeys", /* @__PURE__ */ new Set());
1365
+ if (typeof t != "object" || Array.isArray(t))
1366
+ throw new a("editor-config-invalid-type");
1367
+ if ("sanitizeHtml" in t)
1368
+ throw new a("editor-config-sanitizehtml-not-supported");
1369
+ const i = this.constructor, { translations: n, ...s } = i.defaultConfig || {}, { translations: c = n, ...f } = t, p = t.language || s.language;
1370
+ this._context = t.context || new W({
1371
+ language: p,
1372
+ translations: c
1373
+ }), this._context._addEditor(this, !t.context);
1374
+ const m = Array.from(i.builtinPlugins || []);
1375
+ this.config = new J(f, s), this.config.define("plugins", m), this.config.define(this._context._getEditorConfig()), h(this.config), this.plugins = new Q(this, m, this._context.plugins), this.locale = this._context.locale, this.t = this.locale.t, this._readOnlyLocks = /* @__PURE__ */ new Set(), this.commands = new vt(), this.set("state", "initializing"), this.once("ready", () => this.state = "ready", { priority: "high" }), this.once("destroy", () => this.state = "destroyed", { priority: "high" }), this.model = new gt(this.config), this.on("change:isReadOnly", () => {
1376
+ this.model.document.isReadOnly = this.isReadOnly;
1377
+ });
1378
+ const w = new wt();
1379
+ this.data = new mt(this.model, w), this.editing = new yt(this.model, w), this.editing.view.document.bind("isReadOnly").to(this), this.conversion = new pt([this.editing.downcastDispatcher, this.data.downcastDispatcher], this.data.upcastDispatcher), this.conversion.addAlias("dataDowncast", this.data.downcastDispatcher), this.conversion.addAlias("editingDowncast", this.editing.downcastDispatcher), this.keystrokes = new St(this), this.keystrokes.listenTo(this.editing.view.document), this.accessibility = new xt(this), y(this);
1380
+ function h(g) {
1381
+ let k = g.get("licenseKey");
1382
+ if (!k && window.CKEDITOR_GLOBAL_LICENSE_KEY && (k = window.CKEDITOR_GLOBAL_LICENSE_KEY, g.set("licenseKey", k)), !k)
1383
+ throw new a("license-key-missing");
1384
+ }
1385
+ function y(g) {
1386
+ const k = g.config.get("licenseKey"), x = window[Symbol.for("cke distribution")] || "sh";
1387
+ function _(o, l) {
1388
+ g.enableReadOnlyMode(Symbol("invalidLicense")), g._showLicenseError(o, l);
1389
+ }
1390
+ function D(o) {
1391
+ return [
1392
+ "exp",
1393
+ "jti",
1394
+ "vc"
1395
+ ].every((l) => l in o);
1396
+ }
1397
+ function I(o) {
1398
+ return Object.getOwnPropertyNames(o).sort().filter((l) => l != "vc" && o[l] != null).map((l) => o[l]);
1399
+ }
1400
+ function L(o) {
1401
+ const { hostname: l } = new URL(window.location.href);
1402
+ if (o.includes(l)) return !0;
1403
+ const r = l.split(".");
1404
+ return o.filter((d) => d.includes("*")).map((d) => d.split(".")).filter((d) => d.length <= r.length).map((d) => Array(r.length - d.length).fill(d[0] === "*" ? "*" : "").concat(d)).some((d) => r.every((v, O) => d[O] === v || d[O] === "*"));
1405
+ }
1406
+ function R(o) {
1407
+ const l = o[0].toUpperCase() + o.slice(1), r = o === "evaluation" ? "an" : "a";
1408
+ console.info(`%cCKEditor 5 ${l} License`, "color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;"), console.warn(`⚠️ You are using ${r} ${o} license of CKEditor 5${o === "trial" ? " which is for evaluation purposes only" : ""}. For production usage, please obtain a production license at https://portal.ckeditor.com/`);
1409
+ }
1410
+ if (k == "GPL") {
1411
+ x == "cloud" && _("distributionChannel");
1412
+ return;
1413
+ }
1414
+ const b = z(k);
1415
+ if (!b) {
1416
+ _("invalid");
1417
+ return;
1418
+ }
1419
+ if (!D(b)) {
1420
+ _("invalid");
1421
+ return;
1422
+ }
1423
+ if (b.distributionChannel && !Z(b.distributionChannel).includes(x)) {
1424
+ _("distributionChannel");
1425
+ return;
1426
+ }
1427
+ if (it(I(b)) != b.vc.toLowerCase()) {
1428
+ _("invalid");
1429
+ return;
1430
+ }
1431
+ if (/* @__PURE__ */ new Date(b.exp * 1e3) < nt) {
1432
+ _("expired");
1433
+ return;
1434
+ }
1435
+ const A = b.licensedHosts;
1436
+ if (A && A.length > 0 && !L(A)) {
1437
+ _("domainLimit");
1438
+ return;
1439
+ }
1440
+ if (["evaluation", "trial"].includes(b.licenseType) && b.exp * 1e3 < Date.now()) {
1441
+ _("expired");
1442
+ return;
1443
+ }
1444
+ if ([
1445
+ "development",
1446
+ "evaluation",
1447
+ "trial"
1448
+ ].includes(b.licenseType)) {
1449
+ const { licenseType: o } = b;
1450
+ window.CKEDITOR_WARNING_SUPPRESSIONS = window.CKEDITOR_WARNING_SUPPRESSIONS || {}, window.CKEDITOR_WARNING_SUPPRESSIONS[o] || (R(o), window.CKEDITOR_WARNING_SUPPRESSIONS[o] = !0);
1451
+ }
1452
+ if (b.licenseType === "evaluation") {
1453
+ const o = setTimeout(() => {
1454
+ _("evaluationLimit");
1455
+ }, 6e5);
1456
+ g.on("destroy", () => {
1457
+ clearTimeout(o);
1458
+ });
1459
+ }
1460
+ b.usageEndpoint && g.once("ready", () => {
1461
+ const o = {
1462
+ requestId: M(),
1463
+ requestTime: Math.round(Date.now() / 1e3),
1464
+ license: k,
1465
+ editor: Tt(g)
1466
+ };
1467
+ g._sendUsageRequest(b.usageEndpoint, o).then((l) => {
1468
+ const { status: r, message: d } = l;
1469
+ d && console.warn(d), r != "ok" && _("usageLimit");
1470
+ }, () => {
1471
+ st("license-key-validation-endpoint-not-reachable", { url: b.usageEndpoint });
1472
+ });
1473
+ }, { priority: "high" });
1474
+ }
1475
+ }
1476
+ /**
1477
+ * A required name of the editor class. The name should reflect the constructor name.
1478
+ */
1479
+ static get editorName() {
1480
+ return "Editor";
1481
+ }
1482
+ /**
1483
+ * `Editor` class is commonly put in `config.plugins` array.
1484
+ *
1485
+ * This property helps with better error detection.
1486
+ *
1487
+ * @internal
1488
+ */
1489
+ static get _throwErrorWhenUsedAsAPlugin() {
1490
+ return !0;
1491
+ }
1492
+ /**
1493
+ * Defines whether the editor is in the read-only mode.
1494
+ *
1495
+ * In read-only mode the editor {@link #commands commands} are disabled so it is not possible
1496
+ * to modify the document by using them. Also, the editable element(s) become non-editable.
1497
+ *
1498
+ * In order to make the editor read-only, you need to call the {@link #enableReadOnlyMode} method:
1499
+ *
1500
+ * ```ts
1501
+ * editor.enableReadOnlyMode( 'feature-id' );
1502
+ * ```
1503
+ *
1504
+ * Later, to turn off the read-only mode, call {@link #disableReadOnlyMode}:
1505
+ *
1506
+ * ```ts
1507
+ * editor.disableReadOnlyMode( 'feature-id' );
1508
+ * ```
1509
+ *
1510
+ * @readonly
1511
+ * @observable
1512
+ */
1513
+ get isReadOnly() {
1514
+ return this._readOnlyLocks.size > 0;
1515
+ }
1516
+ set isReadOnly(t) {
1517
+ throw new a("editor-isreadonly-has-no-setter");
1518
+ }
1519
+ /**
1520
+ * Turns on the read-only mode in the editor.
1521
+ *
1522
+ * Editor can be switched to or out of the read-only mode by many features, under various circumstances. The editor supports locking
1523
+ * mechanism for the read-only mode. It enables easy control over the read-only mode when many features wants to turn it on or off at
1524
+ * the same time, without conflicting with each other. It guarantees that you will not make the editor editable accidentally (which
1525
+ * could lead to errors).
1526
+ *
1527
+ * Each read-only mode request is identified by a unique id (also called "lock"). If multiple plugins requested to turn on the
1528
+ * read-only mode, then, the editor will become editable only after all these plugins turn the read-only mode off (using the same ids).
1529
+ *
1530
+ * Note, that you cannot force the editor to disable the read-only mode if other plugins set it.
1531
+ *
1532
+ * After the first `enableReadOnlyMode()` call, the {@link #isReadOnly `isReadOnly` property} will be set to `true`:
1533
+ *
1534
+ * ```ts
1535
+ * editor.isReadOnly; // `false`.
1536
+ * editor.enableReadOnlyMode( 'my-feature-id' );
1537
+ * editor.isReadOnly; // `true`.
1538
+ * ```
1539
+ *
1540
+ * You can turn off the read-only mode ("clear the lock") using the {@link #disableReadOnlyMode `disableReadOnlyMode()`} method:
1541
+ *
1542
+ * ```ts
1543
+ * editor.enableReadOnlyMode( 'my-feature-id' );
1544
+ * // ...
1545
+ * editor.disableReadOnlyMode( 'my-feature-id' );
1546
+ * editor.isReadOnly; // `false`.
1547
+ * ```
1548
+ *
1549
+ * All "locks" need to be removed to enable editing:
1550
+ *
1551
+ * ```ts
1552
+ * editor.enableReadOnlyMode( 'my-feature-id' );
1553
+ * editor.enableReadOnlyMode( 'my-other-feature-id' );
1554
+ * // ...
1555
+ * editor.disableReadOnlyMode( 'my-feature-id' );
1556
+ * editor.isReadOnly; // `true`.
1557
+ * editor.disableReadOnlyMode( 'my-other-feature-id' );
1558
+ * editor.isReadOnly; // `false`.
1559
+ * ```
1560
+ *
1561
+ * @param lockId A unique ID for setting the editor to the read-only state.
1562
+ */
1563
+ enableReadOnlyMode(t) {
1564
+ if (typeof t != "string" && typeof t != "symbol")
1565
+ throw new a("editor-read-only-lock-id-invalid", null, { lockId: t });
1566
+ this._readOnlyLocks.has(t) || (this._readOnlyLocks.add(t), this._readOnlyLocks.size === 1 && this.fire("change:isReadOnly", "isReadOnly", !0, !1));
1567
+ }
1568
+ /**
1569
+ * Removes the read-only lock from the editor with given lock ID.
1570
+ *
1571
+ * When no lock is present on the editor anymore, then the {@link #isReadOnly `isReadOnly` property} will be set to `false`.
1572
+ *
1573
+ * @param lockId The lock ID for setting the editor to the read-only state.
1574
+ */
1575
+ disableReadOnlyMode(t) {
1576
+ if (typeof t != "string" && typeof t != "symbol") throw new a("editor-read-only-lock-id-invalid", null, { lockId: t });
1577
+ this._readOnlyLocks.has(t) && (this._readOnlyLocks.delete(t), this._readOnlyLocks.size === 0 && this.fire("change:isReadOnly", "isReadOnly", !1, !0));
1578
+ }
1579
+ /**
1580
+ * Sets the data in the editor.
1581
+ *
1582
+ * ```ts
1583
+ * editor.setData( '<p>This is editor!</p>' );
1584
+ * ```
1585
+ *
1586
+ * If your editor implementation uses multiple roots, you should pass an object with keys corresponding
1587
+ * to the editor root names and values equal to the data that should be set in each root:
1588
+ *
1589
+ * ```ts
1590
+ * editor.setData( {
1591
+ * header: '<p>Content for header part.</p>',
1592
+ * content: '<p>Content for main part.</p>',
1593
+ * footer: '<p>Content for footer part.</p>'
1594
+ * } );
1595
+ * ```
1596
+ *
1597
+ * By default the editor accepts HTML. This can be controlled by injecting a different data processor.
1598
+ * See the {@glink features/markdown Markdown output} guide for more details.
1599
+ *
1600
+ * @param data Input data.
1601
+ */
1602
+ setData(t) {
1603
+ this.data.set(t);
1604
+ }
1605
+ /**
1606
+ * Gets the data from the editor.
1607
+ *
1608
+ * ```ts
1609
+ * editor.getData(); // -> '<p>This is editor!</p>'
1610
+ * ```
1611
+ *
1612
+ * If your editor implementation uses multiple roots, you should pass root name as one of the options:
1613
+ *
1614
+ * ```ts
1615
+ * editor.getData( { rootName: 'header' } ); // -> '<p>Content for header part.</p>'
1616
+ * ```
1617
+ *
1618
+ * By default, the editor outputs HTML. This can be controlled by injecting a different data processor.
1619
+ * See the {@glink features/markdown Markdown output} guide for more details.
1620
+ *
1621
+ * A warning is logged when you try to retrieve data for a detached root, as most probably this is a mistake. A detached root should
1622
+ * be treated like it is removed, and you should not save its data. Note, that the detached root data is always an empty string.
1623
+ *
1624
+ * @param options Additional configuration for the retrieved data.
1625
+ * Editor features may introduce more configuration options that can be set through this parameter.
1626
+ * @param options.rootName Root name. Defaults to `'main'`.
1627
+ * @param options.trim Whether returned data should be trimmed. This option is set to `'empty'` by default,
1628
+ * which means that whenever editor content is considered empty, an empty string is returned. To turn off trimming
1629
+ * use `'none'`. In such cases exact content will be returned (for example `'<p>&nbsp;</p>'` for an empty editor).
1630
+ * @returns Output data.
1631
+ */
1632
+ getData(t) {
1633
+ return this.data.get(t);
1634
+ }
1635
+ /**
1636
+ * Loads and initializes plugins specified in the configuration.
1637
+ *
1638
+ * @returns A promise which resolves once the initialization is completed, providing an array of loaded plugins.
1639
+ */
1640
+ async initPlugins() {
1641
+ const t = this.config, i = t.get("plugins"), n = t.get("removePlugins") || [], s = t.get("extraPlugins") || [], c = t.get("substitutePlugins") || [], f = await this.plugins.init(i.concat(s), n, c);
1642
+ return p(this), f;
1643
+ function p(m) {
1644
+ const w = m.config.get("licenseKey");
1645
+ if (w === "GPL") return;
1646
+ const h = z(w);
1647
+ if (!h) return;
1648
+ const y = [...m.plugins].map(([g]) => g).find((g) => !g.pluginName || !g.licenseFeatureCode ? !1 : ot(h, g.licenseFeatureCode));
1649
+ y && (m.enableReadOnlyMode(Symbol("invalidLicense")), m._showLicenseError("pluginNotAllowed", y.pluginName));
1650
+ }
1651
+ }
1652
+ /**
1653
+ * Destroys the editor instance, releasing all resources used by it.
1654
+ *
1655
+ * **Note** The editor cannot be destroyed during the initialization phase so if it is called
1656
+ * while the editor {@link #state is being initialized}, it will wait for the editor initialization before destroying it.
1657
+ *
1658
+ * @fires destroy
1659
+ * @returns A promise that resolves once the editor instance is fully destroyed.
1660
+ */
1661
+ async destroy() {
1662
+ this.state == "initializing" && await new Promise((t) => this.once("ready", t)), this.fire("destroy"), this.stopListening(), this.commands.destroy(), await this.plugins.destroy(), this.model.destroy(), this.data.destroy(), this.editing.destroy(), this.keystrokes.destroy(), await this._context._removeEditor(this);
1663
+ }
1664
+ /**
1665
+ * Executes the specified command with given parameters.
1666
+ *
1667
+ * Shorthand for:
1668
+ *
1669
+ * ```ts
1670
+ * editor.commands.get( commandName ).execute( ... );
1671
+ * ```
1672
+ *
1673
+ * @param commandName The name of the command to execute.
1674
+ * @param commandParams Command parameters.
1675
+ * @returns The value returned by the {@link module:core/commandcollection~CommandCollection#execute `commands.execute()`}.
1676
+ */
1677
+ execute(t, ...i) {
1678
+ try {
1679
+ return this.commands.execute(t, ...i);
1680
+ } catch (n) {
1681
+ /* v8 ignore next -- @preserve */
1682
+ a.rethrowUnexpectedError(n, this);
1683
+ }
1684
+ }
1685
+ /**
1686
+ * Focuses the editor.
1687
+ *
1688
+ * **Note** To explicitly focus the editing area of the editor, use the
1689
+ * {@link module:engine/view/view~EditingView#focus `editor.editing.view.focus()`} method of the editing view.
1690
+ *
1691
+ * Check out the {@glink framework/deep-dive/ui/focus-tracking#focus-in-the-editor-ui Focus in the editor UI} section
1692
+ * of the {@glink framework/deep-dive/ui/focus-tracking Deep dive into focus tracking} guide to learn more.
1693
+ */
1694
+ focus() {
1695
+ this.editing.view.focus();
1696
+ }
1697
+ /**
1698
+ * Registers a given string as a root attribute key. Registered root attributes are added to
1699
+ * the {@link module:engine/model/schema~ModelSchema schema}.
1700
+ *
1701
+ * **Note:** Attributes passed in the configuration for multi-root editors
1702
+ * ({@link module:core/editor/editorconfig~EditorConfig#roots `config.roots.<rootName>.modelAttributes`}) or
1703
+ * single-root editors ({@link module:core/editor/editorconfig~EditorConfig#root `config.root.modelAttributes`})
1704
+ * are automatically registered when the editor is initialized. However, registering the same attribute twice
1705
+ * does not have any negative impact, so it is recommended to use this method in any feature that uses
1706
+ * root attributes.
1707
+ *
1708
+ * **Note:** Registered attributes are attached only to the generic `$root` schema element. A custom root
1709
+ * {@link module:core/editor/editorconfig~RootConfig#modelElement `modelElement`} must opt into the `$root`
1710
+ * attribute chain via `allowAttributesOf: '$root'` to inherit these attributes.
1711
+ * See the {@glink framework/deep-dive/schema#custom-root-elements Custom root elements} section of the
1712
+ * {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.
1713
+ */
1714
+ registerRootAttribute(t) {
1715
+ this._registeredRootsAttributesKeys.has(t) || (this._registeredRootsAttributesKeys.add(t), this.editing.model.schema.extend("$root", { allowAttributes: t }));
1716
+ }
1717
+ /**
1718
+ * Returns attributes for the specified root.
1719
+ * If no root name is provided, it returns attributes for the 'main' root by default.
1720
+ *
1721
+ * Note: all and only {@link ~Editor#registerRootAttribute registered} roots attributes will be returned.
1722
+ * If a registered root attribute is not set for a given root, `null` will be returned.
1723
+ */
1724
+ getRootAttributes(t = "main") {
1725
+ const i = this.model.document.getRoot(t);
1726
+ if (!i)
1727
+ throw new a("get-root-attributes-missing-root", this, { rootName: t });
1728
+ const n = {};
1729
+ for (const s of this._registeredRootsAttributesKeys) n[s] = i.hasAttribute(s) ? i.getAttribute(s) : null;
1730
+ return n;
1731
+ }
1732
+ /**
1733
+ * Creates and initializes a new editor instance.
1734
+ *
1735
+ * This is an abstract method. Every editor type needs to implement its own initialization logic.
1736
+ *
1737
+ * See the `create()` methods of the existing editor types to learn how to use them:
1738
+ *
1739
+ * * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}
1740
+ * * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}
1741
+ * * {@link module:editor-decoupled/decouplededitor~DecoupledEditor.create `DecoupledEditor.create()`}
1742
+ * * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`}
1743
+ */
1744
+ static create(...t) {
1745
+ throw new Error("This is an abstract method.");
1746
+ }
1747
+ _showLicenseError(t, i) {
1748
+ setTimeout(() => {
1749
+ if (t == "invalid")
1750
+ throw new a("invalid-license-key");
1751
+ if (t == "expired")
1752
+ throw new a("license-key-expired");
1753
+ if (t == "domainLimit")
1754
+ throw new a("license-key-domain-limit");
1755
+ if (t == "pluginNotAllowed") {
1756
+ const n = i.replace(/(Editing|UI)$/, ""), s = this.plugins.has(n);
1757
+ throw new a("license-key-plugin-not-allowed", null, { pluginName: s ? n : i });
1758
+ }
1759
+ if (t == "featureNotAllowed")
1760
+ throw new a("license-key-feature-not-allowed", null, { featureName: i });
1761
+ if (t == "evaluationLimit")
1762
+ throw new a("license-key-evaluation-limit");
1763
+ if (t == "trialLimit")
1764
+ throw new a("license-key-trial-limit");
1765
+ if (t == "developmentLimit")
1766
+ throw new a("license-key-development-limit");
1767
+ if (t == "usageLimit")
1768
+ throw new a("license-key-usage-limit");
1769
+ /* v8 ignore else -- @preserve */
1770
+ if (t == "distributionChannel")
1771
+ throw new a("license-key-invalid-distribution-channel");
1772
+ }, 0), this._showLicenseError = () => {
1773
+ };
1774
+ }
1775
+ /**
1776
+ * This part of the code is _not_ executed in installations under the GPL license (with `config.licenseKey = 'GPL'`).
1777
+ *
1778
+ * It is only executed when a specific license key is provided. If you are uncertain whether
1779
+ * this applies to your installation, please contact our support team.
1780
+ */
1781
+ async _sendUsageRequest(t, i) {
1782
+ const n = new Headers({ "Content-Type": "application/json" }), s = await fetch(new URL(t), {
1783
+ method: "POST",
1784
+ headers: n,
1785
+ body: JSON.stringify(i)
1786
+ });
1787
+ if (!s.ok) throw new Error(`HTTP Response: ${s.status}`);
1788
+ return s.json();
1789
+ }
1790
+ }, /**
1791
+ * The default configuration which is built into the editor class.
1792
+ *
1793
+ * It was used in the now deprecated CKEditor 5 builds to provide the default configuration options
1794
+ * which are later used during the editor initialization.
1795
+ *
1796
+ * ```ts
1797
+ * ClassicEditor.defaultConfig = {
1798
+ * foo: 1,
1799
+ * bar: 2
1800
+ * };
1801
+ *
1802
+ * ClassicEditor
1803
+ * .create( sourceElement )
1804
+ * .then( editor => {
1805
+ * editor.config.get( 'foo' ); // -> 1
1806
+ * editor.config.get( 'bar' ); // -> 2
1807
+ * } );
1808
+ *
1809
+ * // The default options can be overridden by the configuration passed to create().
1810
+ * ClassicEditor
1811
+ * .create( { bar: 3 } )
1812
+ * .then( editor => {
1813
+ * editor.config.get( 'foo' ); // -> 1
1814
+ * editor.config.get( 'bar' ); // -> 3
1815
+ * } );
1816
+ * ```
1817
+ *
1818
+ * See also {@link module:core/editor/editor~Editor.builtinPlugins}.
1819
+ */
1820
+ u(S, "defaultConfig"), /**
1821
+ * An array of plugins built into this editor class.
1822
+ *
1823
+ * It is used in the now deprecated CKEditor 5 builds to provide a list of plugins which are later automatically initialized
1824
+ * during the editor initialization.
1825
+ *
1826
+ * They will be automatically initialized by the editor, unless listed in `config.removePlugins` and
1827
+ * unless `config.plugins` is passed.
1828
+ *
1829
+ * ```ts
1830
+ * // Build some plugins into the editor class first.
1831
+ * ClassicEditor.builtinPlugins = [ FooPlugin, BarPlugin ];
1832
+ *
1833
+ * // Normally, you need to define config.plugins, but since ClassicEditor.builtinPlugins was
1834
+ * // defined, now you can call create() without any configuration.
1835
+ * ClassicEditor
1836
+ * .create( sourceElement )
1837
+ * .then( editor => {
1838
+ * editor.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
1839
+ * editor.plugins.get( BarPlugin ); // -> An instance of the Bar plugin.
1840
+ * } );
1841
+ *
1842
+ * ClassicEditor
1843
+ * .create( {
1844
+ * // Do not initialize these plugins (note: it is defined by a string):
1845
+ * removePlugins: [ 'Foo' ]
1846
+ * } )
1847
+ * .then( editor => {
1848
+ * editor.plugins.get( FooPlugin ); // -> Undefined.
1849
+ * editor.config.get( BarPlugin ); // -> An instance of the Bar plugin.
1850
+ * } );
1851
+ *
1852
+ * ClassicEditor
1853
+ * .create( {
1854
+ * // Load only this plugin. It can also be defined by a string if
1855
+ * // this plugin was built into the editor class.
1856
+ * plugins: [ FooPlugin ]
1857
+ * } )
1858
+ * .then( editor => {
1859
+ * editor.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
1860
+ * editor.config.get( BarPlugin ); // -> Undefined.
1861
+ * } );
1862
+ * ```
1863
+ *
1864
+ * See also {@link module:core/editor/editor~Editor.defaultConfig}.
1865
+ */
1866
+ u(S, "builtinPlugins"), /**
1867
+ * The {@link module:core/context~Context} class.
1868
+ *
1869
+ * Exposed as static editor field for easier access in editor builds.
1870
+ */
1871
+ u(S, "Context", W), /**
1872
+ * The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.
1873
+ *
1874
+ * Exposed as static editor field for easier access in editor builds.
1875
+ */
1876
+ u(S, "EditorWatchdog", bt), /**
1877
+ * The {@link module:watchdog/contextwatchdog~ContextWatchdog} class.
1878
+ *
1879
+ * Exposed as static editor field for easier access in editor builds.
1880
+ */
1881
+ u(S, "ContextWatchdog", _t), S);
1882
+ function Tt(e) {
1883
+ const t = At(e);
1884
+ function i(n, s) {
1885
+ if (dt(t, n) !== void 0)
1886
+ throw new a("editor-usage-data-path-already-set", { path: n });
1887
+ ft(t, n, s);
1888
+ }
1889
+ return e.fire("collectUsageData", { setUsageData: i }), t;
1890
+ }
1891
+ /**
1892
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
1893
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
1894
+ */
1895
+ function te(e) {
1896
+ if (!B(e.updateSourceElement))
1897
+ throw new a("attachtoform-missing-elementapi-interface", e);
1898
+ const t = e.sourceElement;
1899
+ if (Kt(t) && t.form) {
1900
+ let i;
1901
+ const n = t.form, s = () => e.updateSourceElement();
1902
+ B(n.submit) && (i = n.submit, n.submit = () => {
1903
+ s(), i.apply(n);
1904
+ }), n.addEventListener("submit", s), e.on("destroy", () => {
1905
+ n.removeEventListener("submit", s), i && (n.submit = i);
1906
+ });
1907
+ }
1908
+ }
1909
+ function Kt(e) {
1910
+ return !!e && e.tagName.toLowerCase() === "textarea";
1911
+ }
1912
+ /**
1913
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
1914
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
1915
+ */
1916
+ function ee(e) {
1917
+ class t extends e {
1918
+ constructor() {
1919
+ super(...arguments);
1920
+ u(this, "sourceElement");
1921
+ }
1922
+ updateSourceElement(s) {
1923
+ if (!this.sourceElement)
1924
+ throw new a("editor-missing-sourceelement", this);
1925
+ const c = this.config.get("updateSourceElementOnDestroy"), f = this.sourceElement instanceof HTMLTextAreaElement;
1926
+ if (!c && !f) {
1927
+ q(this.sourceElement, "");
1928
+ return;
1929
+ }
1930
+ const p = typeof s == "string" ? s : this.data.get();
1931
+ q(this.sourceElement, p);
1932
+ }
1933
+ }
1934
+ return t;
1935
+ }
1936
+ /**
1937
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
1938
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
1939
+ */
1940
+ const Ut = [["description", "$description"], ["title", "$title"]];
1941
+ function ie(e) {
1942
+ const t = e.config.get("roots");
1943
+ for (const [s, c] of Object.entries(t)) {
1944
+ let f = null;
1945
+ for (const [p, m] of Ut)
1946
+ c[p] == null || c.modelAttributes && m in c.modelAttributes || (f = f || { ...c.modelAttributes }, f[m] = c[p]);
1947
+ f && e.config.set(`roots.${s}.modelAttributes`, f);
1948
+ }
1949
+ const i = e.config.get("roots");
1950
+ let n = !1;
1951
+ for (const s of Object.values(i)) for (const c of Object.keys(s.modelAttributes || {}))
1952
+ e.registerRootAttribute(c), n = !0;
1953
+ n && e.data.once("init", () => {
1954
+ e.model.enqueueChange({ isUndoable: !1 }, (s) => {
1955
+ for (const [c, f] of Object.entries(i)) {
1956
+ const p = e.model.document.getRoot(c);
1957
+ if (p)
1958
+ for (const [m, w] of Object.entries(f.modelAttributes || {})) w !== null && s.setAttribute(m, w, p);
1959
+ }
1960
+ });
1961
+ });
1962
+ }
1963
+ /**
1964
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
1965
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
1966
+ */
1967
+ function ne(e, t, i = "main", n = !1) {
1968
+ const s = t.get("root"), c = t.get("roots") || /* @__PURE__ */ Object.create(null);
1969
+ if (!ut(c))
1970
+ throw new a("editor-create-roots-not-plain-object", null);
1971
+ if (s)
1972
+ if (i) {
1973
+ if (i in c)
1974
+ throw new a("editor-create-roots-with-main", null);
1975
+ } else throw new a("editor-create-multi-root-with-main", null);
1976
+ i && !c[i] && (c[i] = s || /* @__PURE__ */ Object.create(null));
1977
+ const f = jt(e), p = qt(t, f, i), m = Array.from(/* @__PURE__ */ new Set([
1978
+ ...f ? Object.keys(e) : [],
1979
+ ...Object.keys(c),
1980
+ ...Object.keys(p)
1981
+ ]));
1982
+ for (const w of m) {
1983
+ const h = c[w] || /* @__PURE__ */ Object.create(null), y = f ? e[w] : e;
1984
+ if (!n && E(y)) {
1985
+ if (h.element)
1986
+ throw new a("editor-create-root-element-overspecified", null);
1987
+ h.element = y;
1988
+ }
1989
+ if (n && E(h.element) && (Y("editor-create-root-element-not-supported"), h.element = void 0), h.initialData === void 0) if (p[w] === void 0) {
1990
+ const g = E(h.element) ? h.element : void 0;
1991
+ h.initialData = Mt(y || g || n && t.get("attachTo") || "");
1992
+ } else {
1993
+ if (y && !E(y))
1994
+ throw new a("editor-create-initial-data-overspecified", null);
1995
+ h.initialData = p[w];
1996
+ }
1997
+ else {
1998
+ if (y && !E(y))
1999
+ throw new a("editor-create-root-initial-data-overspecified", null);
2000
+ if (p[w] !== void 0)
2001
+ throw new a("editor-create-legacy-initial-data-overspecified", null);
2002
+ }
2003
+ h.placeholder ?? (h.placeholder = V(t, "placeholder", w)), h.label ?? (h.label = V(t, "label", w)), h.modelElement || (h.modelElement = "$root"), h.element = zt(h.element), c[w] = h;
2004
+ }
2005
+ if (n && E(e)) {
2006
+ if (t.get("attachTo"))
2007
+ throw new a("editor-create-attachto-overspecified", null);
2008
+ t.set("attachTo", e);
2009
+ }
2010
+ if (!n && t.get("attachTo"))
2011
+ throw new a("editor-create-attachto-ignored", null);
2012
+ t.set("roots", c);
2013
+ }
2014
+ function se(e, t) {
2015
+ return typeof e == "string" || E(e) || t && Object.keys(t).length ? {
2016
+ sourceElementOrData: e,
2017
+ editorConfig: t
2018
+ } : {
2019
+ sourceElementOrData: "",
2020
+ editorConfig: e
2021
+ };
2022
+ }
2023
+ function jt(e) {
2024
+ return !!e && typeof e == "object" && !Array.isArray(e) && !E(e);
2025
+ }
2026
+ function Mt(e) {
2027
+ return E(e) ? et(e) : e;
2028
+ }
2029
+ function qt(e, t, i) {
2030
+ return t || !i ? e.get("initialData") || /* @__PURE__ */ Object.create(null) : { [i]: e.get("initialData") };
2031
+ }
2032
+ function V(e, t, i) {
2033
+ const n = e.get(t);
2034
+ if (n) return typeof n == "string" ? n : n[i];
2035
+ }
2036
+ function zt(e) {
2037
+ if (e == null) return;
2038
+ if (E(e))
2039
+ return U(e.tagName), e;
2040
+ if (typeof e == "string")
2041
+ return U(e), { name: e };
2042
+ const { name: t, classes: i, styles: n, attributes: s } = e;
2043
+ t !== void 0 && U(t);
2044
+ const { class: c, style: f, ...p } = s || {}, m = !!s && "class" in s, w = !!n && Object.keys(n).length > 0, h = w && !!f;
2045
+ h && Y("editor-root-element-styles-overspecified");
2046
+ const y = [...H(i), ...H(c)], g = { ...p };
2047
+ return m && (g.class = ""), h ? g.style = "" : f && (g.style = f), {
2048
+ ...t !== void 0 && { name: t },
2049
+ ...y.length && { classes: y },
2050
+ ...w && { styles: n },
2051
+ ...Object.keys(g).length && { attributes: g }
2052
+ };
2053
+ }
2054
+ function H(e) {
2055
+ return e ? Z(e).flatMap((t) => t.split(/\s+/)).filter(Boolean) : [];
2056
+ }
2057
+ function U(e) {
2058
+ if (typeof e != "string" || !/^[A-Za-z][A-Za-z0-9_-]*$/.test(e))
2059
+ throw new a("editor-wrong-element-name", null, { name: e });
2060
+ if (["textarea", "input"].includes(e.toLowerCase()))
2061
+ throw new a("editor-wrong-element", null);
2062
+ }
2063
+ function E(e) {
2064
+ return ht(e);
2065
+ }
2066
+ /**
2067
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2068
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2069
+ */
2070
+ function oe(e) {
2071
+ const t = e.model.schema, i = e.model.document;
2072
+ for (const n of i.roots)
2073
+ if (!(n === i.graveyard || !n.isAttached()) && !t.isLimit(n))
2074
+ throw new a("editor-root-element-is-not-limit", null, {
2075
+ rootName: n.rootName,
2076
+ elementName: n.name
2077
+ });
2078
+ }
2079
+ /**
2080
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2081
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2082
+ */
2083
+ function re(e, t) {
2084
+ const i = e.model.document.getRoot(t);
2085
+ return e.model.schema.checkChild(i, "$block");
2086
+ }
2087
+ export {
2088
+ xt as Accessibility,
2089
+ Qt as Command,
2090
+ vt as CommandCollection,
2091
+ W as Context,
2092
+ St as EditingKeystrokeHandler,
2093
+ Xt as Editor,
2094
+ ee as ElementApiMixin,
2095
+ Jt as Plugin,
2096
+ Q as PluginCollection,
2097
+ $ as _DEFAULT_ACCESSIBILITY_GROUP_ID,
2098
+ At as _getEditorUsageData,
2099
+ te as attachToForm,
2100
+ ne as normalizeRootsConfig,
2101
+ se as normalizeSingleRootEditorConstructorParams,
2102
+ zt as normalizeViewRootElementDefinition,
2103
+ ie as registerAndInitializeRootConfigAttributes,
2104
+ re as rootAcceptsBlocks,
2105
+ oe as verifyRootElements
2106
+ };
2107
+ //# sourceMappingURL=index.js.map