@ncino/web-components 5.0.0-preview.1 → 5.0.0-preview.3

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 (168) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +1 -1
  2. package/dist/_virtual/index_html.js +1 -1
  3. package/dist/_virtual/index_react.js +1 -1
  4. package/dist/_virtual/preload-helper.js +1 -1
  5. package/dist/assets/node_modules/.pnpm/ckeditor5@45.2.1/node_modules/ckeditor5/dist/ckeditor5.css +1 -1
  6. package/dist/components/accordion/gator/base/accordion.gator.js +6 -6
  7. package/dist/components/avatar/gator/avatar.gator.js +2 -2
  8. package/dist/components/badge/gator/badge.gator.js +2 -2
  9. package/dist/components/boolean/boolean.gator.js +6 -6
  10. package/dist/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.js +2 -2
  11. package/dist/components/button/gator/button.gator.js +4 -4
  12. package/dist/components/button-group/gator/button-group.gator.js +2 -2
  13. package/dist/components/checkbox/checkbox.gator.js +5 -5
  14. package/dist/components/checkbox-group/checkbox-group.gator.js +8 -8
  15. package/dist/components/combobox/base/combobox.js +1 -1
  16. package/dist/components/combobox/base/combobox.slds.js +13 -13
  17. package/dist/components/date-picker/base/gator/datepicker.gator.js +18 -18
  18. package/dist/components/date-picker/year-month-selector/year-month-selector.gator.js +2 -2
  19. package/dist/components/headline-card/gator/headline-card.gator.js +2 -2
  20. package/dist/components/icon/gator/icon.gator.js +2 -2
  21. package/dist/components/illustration/gator/illustration.gator.js +2 -2
  22. package/dist/components/input/base/input-base.gator.js +1 -1
  23. package/dist/components/input/gator/dropdown/input-dropdown.gator.js +11 -11
  24. package/dist/components/input/gator/input-currency/input-currency.gator.js +2 -2
  25. package/dist/components/input/gator/input-date/input-date.gator.js +15 -15
  26. package/dist/components/input/gator/input-file/input-file.gator.js +3 -3
  27. package/dist/components/input/gator/input-masked/input-masked.gator.js +1 -1
  28. package/dist/components/input/gator/input-phone/input-phone.gator.js +2 -2
  29. package/dist/components/input/gator/input-search/input-search.gator.js +2 -2
  30. package/dist/components/input/gator/input-text/input-text.gator.js +1 -1
  31. package/dist/components/input/gator/input-time/input-time.gator.js +2 -2
  32. package/dist/components/list/gator/list/list.gator.js +2 -2
  33. package/dist/components/list/gator/list-item/list-item.gator.js +6 -6
  34. package/dist/components/menu/base/gator/menu.gator.js +3 -3
  35. package/dist/components/menu/base/slds/menu.slds.js +2 -2
  36. package/dist/components/menu/menu-item/gator/menu-item.gator.js +2 -2
  37. package/dist/components/menu/menu-submenu/menu-submenu.js +1 -1
  38. package/dist/components/modal/gator/modal.gator.js +38 -39
  39. package/dist/components/page-header/gator/page-header.gator.js +2 -2
  40. package/dist/components/panel/gator/panel.gator.js +13 -13
  41. package/dist/components/panel/gator/panel.storybook-test.js +1 -1
  42. package/dist/components/pill/pill.slds.js +3 -3
  43. package/dist/components/popover/gator/popover.gator.js +10 -10
  44. package/dist/components/popover/popover.js +1 -1
  45. package/dist/components/radio/radio.gator.js +2 -2
  46. package/dist/components/radio-group/radio-group.gator.js +2 -2
  47. package/dist/components/selection-box-group/selection-box-group.gator.js +5 -5
  48. package/dist/components/selector/gator/selector.gator.js +2 -2
  49. package/dist/components/switch/gator/switch.gator.js +2 -2
  50. package/dist/components/tabs/gator/tabset/tabset.gator.js +3 -3
  51. package/dist/components/text-detail/gator/text-detail.gator.js +17 -18
  52. package/dist/components/time-picker/gator/time-picker.gator.js +19 -19
  53. package/dist/components/tooltip/tooltip.js +1 -1
  54. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-autosave@45.2.1/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js +2 -2
  55. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-basic-styles@45.2.1/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +2 -2
  56. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-clipboard@45.2.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +10 -10
  57. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-cloud-services@45.2.1/node_modules/@ckeditor/ckeditor5-cloud-services/dist/index.js +2 -2
  58. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-code-block@45.2.1/node_modules/@ckeditor/ckeditor5-code-block/dist/index.js +5 -5
  59. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js +2 -2
  60. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-editor-classic@45.2.1/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +2 -2
  61. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +12 -12
  62. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-find-and-replace@45.2.1/node_modules/@ckeditor/ckeditor5-find-and-replace/dist/index.js +3 -3
  63. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-font@45.2.1/node_modules/@ckeditor/ckeditor5-font/dist/index.js +3 -3
  64. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-heading@45.2.1/node_modules/@ckeditor/ckeditor5-heading/dist/index.js +3 -3
  65. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-embed@45.2.1/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +2 -2
  66. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-support@45.2.1/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +6 -6
  67. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@45.2.1/node_modules/@ckeditor/ckeditor5-image/dist/index.js +4 -4
  68. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-indent@45.2.1/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +4 -4
  69. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-link@45.2.1/node_modules/@ckeditor/ckeditor5-link/dist/index.js +2 -2
  70. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-list@45.2.1/node_modules/@ckeditor/ckeditor5-list/dist/index.js +5 -5
  71. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-markdown-gfm@45.2.1/node_modules/@ckeditor/ckeditor5-markdown-gfm/dist/index.js +4 -4
  72. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-media-embed@45.2.1/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +2 -2
  73. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paragraph@45.2.1/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +2 -2
  74. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paste-from-office@45.2.1/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +9 -9
  75. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-source-editing@45.2.1/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +2 -2
  76. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-special-characters@45.2.1/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +2 -2
  77. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-style@45.2.1/node_modules/@ckeditor/ckeditor5-style/dist/index.js +2 -2
  78. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@45.2.1/node_modules/@ckeditor/ckeditor5-table/dist/index.js +6 -6
  79. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-typing@45.2.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +4 -4
  80. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +10 -10
  81. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-undo@45.2.1/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +2 -2
  82. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-upload@45.2.1/node_modules/@ckeditor/ckeditor5-upload/dist/index.js +2 -2
  83. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +38 -38
  84. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-watchdog@45.2.1/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +3 -3
  85. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-widget@45.2.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +2 -2
  86. package/dist/node_modules/.pnpm/@deltablot_dropzone@7.3.1/node_modules/@deltablot/dropzone/dist/dropzone.js +1 -1
  87. package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/main.js +1 -1
  88. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.4/node_modules/@figma/code-connect/dist/common/fetch.js +1 -0
  89. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.4/node_modules/@figma/code-connect/dist/connect/figma_rest_api.js +1 -0
  90. package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/connect/helpers.js +1 -1
  91. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.4/node_modules/@figma/code-connect/package.json.js +1 -0
  92. package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +1 -1
  93. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/reactive-element.js +2 -2
  94. package/dist/node_modules/.pnpm/@storybook_core@8.6.14_prettier@3.6.2_storybook@8.6.14_prettier@3.6.2_/node_modules/@storybook/core/dist/channels/index.js +9 -9
  95. package/dist/node_modules/.pnpm/@storybook_core@8.6.14_prettier@3.6.2_storybook@8.6.14_prettier@3.6.2_/node_modules/@storybook/core/dist/csf/index.js +1 -1
  96. package/dist/node_modules/.pnpm/@storybook_core@8.6.14_prettier@3.6.2_storybook@8.6.14_prettier@3.6.2_/node_modules/@storybook/core/dist/preview-api/index.js +22 -22
  97. package/dist/node_modules/.pnpm/@storybook_instrumenter@8.6.14_storybook@8.6.14_prettier@3.6.2_/node_modules/@storybook/instrumenter/dist/index.js +36 -36
  98. package/dist/node_modules/.pnpm/@storybook_test@8.6.14_storybook@8.6.14_prettier@3.6.2_/node_modules/@storybook/test/dist/index.js +111 -111
  99. package/dist/node_modules/.pnpm/@vitest_browser@3.2.4_msw@2.7.3_@types_node@24.0.10_typescript@5.8.3__playwright@1.53.2_77c47ac19cbe97978028e1e5ac862536/node_modules/@vitest/browser/context.js +1 -0
  100. package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js +8 -8
  101. package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +2 -2
  102. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +5 -5
  103. package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +11 -11
  104. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js +21 -21
  105. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +2 -2
  106. package/dist/node_modules/.pnpm/axe-core@4.10.3/node_modules/axe-core/axe.js +4 -4
  107. package/dist/node_modules/.pnpm/chai@5.2.0/node_modules/chai/chai.js +3 -3
  108. package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js +1 -1
  109. package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js +1 -1
  110. package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/get.js +1 -1
  111. package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/unset.js +1 -1
  112. package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js +1 -1
  113. package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/function/debounce.js +1 -1
  114. package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/object/cloneDeepWith.js +1 -1
  115. package/dist/node_modules/.pnpm/lit-element@4.2.0/node_modules/lit-element/lit-element.js +2 -2
  116. package/dist/node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/async-directive.js +1 -1
  117. package/dist/node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/class-map.js +2 -2
  118. package/dist/node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/ref.js +2 -2
  119. package/dist/node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/lit-html.js +3 -3
  120. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +1 -1
  121. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/cache.js +1 -1
  122. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/cachestorage.js +1 -1
  123. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cookies/parse.js +1 -1
  124. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/constants.js +1 -1
  125. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/headers.js +1 -1
  126. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/index.js +1 -1
  127. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/request.js +1 -1
  128. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/response.js +1 -1
  129. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/util.js +2 -2
  130. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/webidl.js +1 -1
  131. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/connection.js +1 -1
  132. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/events.js +1 -1
  133. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/frame.js +1 -1
  134. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/receiver.js +1 -1
  135. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/util.js +1 -1
  136. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/websocket.js +1 -1
  137. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.10_@vitest_browser@3.2.4_@vitest_ui@3_8c34ee540b1f52c214debce201d1e515/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +1 -1
  138. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.10_@vitest_browser@3.2.4_@vitest_ui@3_8c34ee540b1f52c214debce201d1e515/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +8 -8
  139. package/dist/packages/web-components/src/components/button/gator/button.gator.scss.js +1 -1
  140. package/dist/packages/web-components/src/components/chip/gator/chip.gator.scss.js +1 -1
  141. package/dist/packages/web-components/src/components/modal/gator/modal.gator.scss.js +1 -1
  142. package/dist/packages/web-components/src/components/switch/gator/switch.gator.scss.js +1 -1
  143. package/dist/packages/web-components/src/components/text-detail/gator/text-detail.gator.scss.js +1 -1
  144. package/dist/packages/web-components/src/index.slds.scss.js +1 -1
  145. package/dist/types/components/modal/gator/modal.gator.d.ts +1 -1
  146. package/dist/types/components/text-detail/gator/text-detail.gator.d.ts +4 -2
  147. package/dist/utils/accessibility-utils.js +1 -1
  148. package/dist/utils/datatestid-utils.js +1 -1
  149. package/dist/utils/lightdom-utils.js +1 -1
  150. package/dist/utils/vitest-a11y-utils.js +1 -1
  151. package/dist/utils/vitest-utils.js +1 -1
  152. package/package.json +10 -10
  153. package/web-types.json +2 -3
  154. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/dist/common/fetch.js +0 -1
  155. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/dist/connect/figma_rest_api.js +0 -1
  156. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/package.json.js +0 -1
  157. package/dist/node_modules/.pnpm/@vitest_browser@3.2.4_msw@2.7.3_@types_node@24.0.10_typescript@5.8.3__playwright@1.53.1_5fd2997ee9a97429a51e07bc2023c338/node_modules/@vitest/browser/context.js +0 -1
  158. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/client/external.js +0 -0
  159. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/client/figma_client.js +0 -0
  160. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/common/logging.js +0 -0
  161. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/common/updates.js +0 -0
  162. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/connect/external_types.js +0 -0
  163. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/connect/index_common.js +0 -0
  164. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/html/external.js +0 -0
  165. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/html/index_html.js +0 -0
  166. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/html/template_literal.js +0 -0
  167. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/react/external.js +0 -0
  168. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/react/index_react.js +0 -0
@@ -1,6 +1,6 @@
1
- var g=Object.defineProperty;var w=(o,e,t)=>e in o?g(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var c=(o,e,t)=>w(o,typeof e!="symbol"?e+"":e,t);import{Plugin as u}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{HtmlDataProcessor as _}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{marked as p}from"../../../../../marked@4.0.12/node_modules/marked/lib/marked.esm.js";import k from"../../../../../turndown@7.2.0/node_modules/turndown/lib/turndown.browser.es.js";import{gfm as T}from"../../../../../turndown-plugin-gfm@1.0.2/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.js";import{ClipboardPipeline as P}from"../../../../../@ckeditor_ckeditor5-clipboard@45.2.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";/**
1
+ import{Plugin as h}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{HtmlDataProcessor as d}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{marked as m}from"../../../../../marked@4.0.12/node_modules/marked/lib/marked.esm.js";import f from"../../../../../turndown@7.2.0/node_modules/turndown/lib/turndown.browser.es.js";import{gfm as g}from"../../../../../turndown-plugin-gfm@1.0.2/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.js";import{ClipboardPipeline as w}from"../../../../../@ckeditor_ckeditor5-clipboard@45.2.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";/**
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */class b{constructor(){c(this,"_parser");c(this,"_options",{gfm:!0,breaks:!0,tables:!0,xhtml:!0,headerIds:!1});p.use({tokenizer:{autolink:()=>null,url:()=>null},renderer:{checkbox(...e){return Object.getPrototypeOf(this).checkbox.call(this,...e).trimRight()},code(...e){return Object.getPrototypeOf(this).code.call(this,...e).replace(`
5
- </code>`,"</code>")}}}),this._parser=p}parse(e){return this._parser.parse(e,this._options)}}const x=new RegExp(/\b(?:(?:https?|ftp):\/\/|www\.)/.source+/(?![-_])(?:[-_a-z0-9\u00a1-\uffff]{1,63}\.)+(?:[a-z\u00a1-\uffff]{2,63})/.source+/(?:[^\s<>]*)/.source,"gi");class y extends k{escape(e){const t=super.escape;function s(n){return n=t(n),n=n.replace(/</g,"\\<"),n}let r="",a=0;for(const n of this._matchAutolink(e)){const l=n.index;l>a&&(r+=s(e.substring(a,l)));const i=n[0];r+=i,a=l+i.length}return a<e.length&&(r+=s(e.substring(a,e.length))),r}*_matchAutolink(e){for(const t of e.matchAll(x)){const s=t[0],r=this._autolinkFindEnd(s);yield Object.assign([s.substring(0,r)],{index:t.index})}}_autolinkFindEnd(e){let t=e.length;for(;t>0;){const s=e[t-1];if(`?!.,:*_~'"`.includes(s))t--;else if(s==")"){let r=0;for(let a=0;a<t;a++)e[a]=="("?r++:e[a]==")"&&r--;if(r<0)t--;else break}else break}return t}}class D{constructor(){c(this,"_parser");this._parser=this._createParser()}parse(e){return this._parser.turndown(e)}keep(e){this._parser.keep(e)}_createParser(){const e=new y({codeBlockStyle:"fenced",hr:"---",headingStyle:"atx"});return e.use([T,this._todoList]),e}_todoList(e){e.addRule("taskListItems",{filter(t){return t.type==="checkbox"&&(t.parentNode.nodeName==="LI"||t.parentNode.parentNode.nodeName==="LI")},replacement(t,s){return(s.checked?"[x]":"[ ]")+" "}})}}class d{constructor(e){c(this,"_htmlDP");c(this,"_markdown2html");c(this,"_html2markdown");this._htmlDP=new _(e),this._markdown2html=new b,this._html2markdown=new D}keepHtml(e){this._html2markdown.keep([e])}toView(e){const t=this._markdown2html.parse(e);return this._htmlDP.toView(t)}toData(e){const t=this._htmlDP.toData(e);return this._html2markdown.parse(t)}registerRawContentMatcher(e){this._htmlDP.registerRawContentMatcher(e)}useFillerType(){}}class R extends u{constructor(e){super(e),e.data.processor=new d(e.data.viewDocument)}static get pluginName(){return"Markdown"}static get isOfficialPlugin(){return!0}}const v=["SPAN","BR","PRE","CODE"];class N extends u{constructor(t){super(t);c(this,"_gfmDataProcessor");this._gfmDataProcessor=new d(t.data.viewDocument)}static get pluginName(){return"PasteFromMarkdownExperimental"}static get isOfficialPlugin(){return!0}static get requires(){return[P]}init(){const t=this.editor,r=t.editing.view.document,a=t.plugins.get("ClipboardPipeline");let n=!1;this.listenTo(r,"keydown",(l,i)=>{n=i.shiftKey}),this.listenTo(a,"inputTransformation",(l,i)=>{if(n)return;const m=i.dataTransfer.getData("text/html");if(!m){const f=i.dataTransfer.getData("text/plain");i.content=this._gfmDataProcessor.toView(f);return}const h=this._parseMarkdownFromHtml(m);h&&(i.content=this._gfmDataProcessor.toView(h))})}_parseMarkdownFromHtml(t){const s=this._removeOsSpecificTags(t);if(!this._containsOnlyAllowedFirstLevelTags(s))return null;const r=this._removeFirstLevelWrapperTagsAndBrs(s);return this._containsAnyRemainingHtmlTags(r)?null:this._replaceHtmlReservedEntitiesWithCharacters(r)}_removeOsSpecificTags(t){return t.replace(/^<meta\b[^>]*>/,"").trim().replace(/^<html>/,"").replace(/<\/html>$/,"").trim().replace(/^<body>/,"").replace(/<\/body>$/,"").trim().replace(/^<!--StartFragment-->/,"").replace(/<!--EndFragment-->$/,"").trim()}_containsOnlyAllowedFirstLevelTags(t){const s=new DOMParser,{body:r}=s.parseFromString(t,"text/html");return Array.from(r.children).map(n=>n.tagName).every(n=>v.includes(n))}_removeFirstLevelWrapperTagsAndBrs(t){const s=new DOMParser,{body:r}=s.parseFromString(t,"text/html"),a=r.querySelectorAll("br");for(const l of a)l.replaceWith(`
6
- `);const n=r.querySelectorAll(":scope > *");for(const l of n){const i=l.cloneNode(!0);l.replaceWith(...i.childNodes)}return r.innerHTML}_containsAnyRemainingHtmlTags(t){return t.includes("<")}_replaceHtmlReservedEntitiesWithCharacters(t){return t.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&nbsp;/g," ")}}export{d as GFMDataProcessor,R as Markdown,b as MarkdownToHtml,N as PasteFromMarkdownExperimental};
4
+ */class _{_parser;_options={gfm:!0,breaks:!0,tables:!0,xhtml:!0,headerIds:!1};constructor(){m.use({tokenizer:{autolink:()=>null,url:()=>null},renderer:{checkbox(...e){return Object.getPrototypeOf(this).checkbox.call(this,...e).trimRight()},code(...e){return Object.getPrototypeOf(this).code.call(this,...e).replace(`
5
+ </code>`,"</code>")}}}),this._parser=m}parse(e){return this._parser.parse(e,this._options)}}const k=new RegExp(/\b(?:(?:https?|ftp):\/\/|www\.)/.source+/(?![-_])(?:[-_a-z0-9\u00a1-\uffff]{1,63}\.)+(?:[a-z\u00a1-\uffff]{2,63})/.source+/(?:[^\s<>]*)/.source,"gi");class T extends f{escape(e){const t=super.escape;function r(a){return a=t(a),a=a.replace(/</g,"\\<"),a}let n="",s=0;for(const a of this._matchAutolink(e)){const o=a.index;o>s&&(n+=r(e.substring(s,o)));const l=a[0];n+=l,s=o+l.length}return s<e.length&&(n+=r(e.substring(s,e.length))),n}*_matchAutolink(e){for(const t of e.matchAll(k)){const r=t[0],n=this._autolinkFindEnd(r);yield Object.assign([r.substring(0,n)],{index:t.index})}}_autolinkFindEnd(e){let t=e.length;for(;t>0;){const r=e[t-1];if(`?!.,:*_~'"`.includes(r))t--;else if(r==")"){let n=0;for(let s=0;s<t;s++)e[s]=="("?n++:e[s]==")"&&n--;if(n<0)t--;else break}else break}return t}}class P{_parser;constructor(){this._parser=this._createParser()}parse(e){return this._parser.turndown(e)}keep(e){this._parser.keep(e)}_createParser(){const e=new T({codeBlockStyle:"fenced",hr:"---",headingStyle:"atx"});return e.use([g,this._todoList]),e}_todoList(e){e.addRule("taskListItems",{filter(t){return t.type==="checkbox"&&(t.parentNode.nodeName==="LI"||t.parentNode.parentNode.nodeName==="LI")},replacement(t,r){return(r.checked?"[x]":"[ ]")+" "}})}}class p{_htmlDP;_markdown2html;_html2markdown;constructor(e){this._htmlDP=new d(e),this._markdown2html=new _,this._html2markdown=new P}keepHtml(e){this._html2markdown.keep([e])}toView(e){const t=this._markdown2html.parse(e);return this._htmlDP.toView(t)}toData(e){const t=this._htmlDP.toData(e);return this._html2markdown.parse(t)}registerRawContentMatcher(e){this._htmlDP.registerRawContentMatcher(e)}useFillerType(){}}class F extends h{constructor(e){super(e),e.data.processor=new p(e.data.viewDocument)}static get pluginName(){return"Markdown"}static get isOfficialPlugin(){return!0}}const b=["SPAN","BR","PRE","CODE"];class M extends h{_gfmDataProcessor;constructor(e){super(e),this._gfmDataProcessor=new p(e.data.viewDocument)}static get pluginName(){return"PasteFromMarkdownExperimental"}static get isOfficialPlugin(){return!0}static get requires(){return[w]}init(){const e=this.editor,r=e.editing.view.document,n=e.plugins.get("ClipboardPipeline");let s=!1;this.listenTo(r,"keydown",(a,o)=>{s=o.shiftKey}),this.listenTo(n,"inputTransformation",(a,o)=>{if(s)return;const l=o.dataTransfer.getData("text/html");if(!l){const u=o.dataTransfer.getData("text/plain");o.content=this._gfmDataProcessor.toView(u);return}const c=this._parseMarkdownFromHtml(l);c&&(o.content=this._gfmDataProcessor.toView(c))})}_parseMarkdownFromHtml(e){const t=this._removeOsSpecificTags(e);if(!this._containsOnlyAllowedFirstLevelTags(t))return null;const r=this._removeFirstLevelWrapperTagsAndBrs(t);return this._containsAnyRemainingHtmlTags(r)?null:this._replaceHtmlReservedEntitiesWithCharacters(r)}_removeOsSpecificTags(e){return e.replace(/^<meta\b[^>]*>/,"").trim().replace(/^<html>/,"").replace(/<\/html>$/,"").trim().replace(/^<body>/,"").replace(/<\/body>$/,"").trim().replace(/^<!--StartFragment-->/,"").replace(/<!--EndFragment-->$/,"").trim()}_containsOnlyAllowedFirstLevelTags(e){const t=new DOMParser,{body:r}=t.parseFromString(e,"text/html");return Array.from(r.children).map(s=>s.tagName).every(s=>b.includes(s))}_removeFirstLevelWrapperTagsAndBrs(e){const t=new DOMParser,{body:r}=t.parseFromString(e,"text/html"),n=r.querySelectorAll("br");for(const a of n)a.replaceWith(`
6
+ `);const s=r.querySelectorAll(":scope > *");for(const a of s){const o=a.cloneNode(!0);a.replaceWith(...o.childNodes)}return r.innerHTML}_containsAnyRemainingHtmlTags(e){return e.includes("<")}_replaceHtmlReservedEntitiesWithCharacters(e){return e.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&nbsp;/g," ")}}export{p as GFMDataProcessor,F as Markdown,_ as MarkdownToHtml,M as PasteFromMarkdownExperimental};
@@ -1,7 +1,7 @@
1
- var P=Object.defineProperty;var k=(r,i,e)=>i in r?P(r,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[i]=e;var m=(r,i,e)=>k(r,typeof i!="symbol"?i+"":i,e);import{Plugin as f,Command as x}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Widget as R,toWidget as D,findOptimalInsertionRange as C}from"../../../../../@ckeditor_ckeditor5-widget@45.2.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{global as v,first as F,logWarning as U,toArray as S,FocusTracker as L,KeystrokeHandler as B}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{Dialog as A,ButtonView as N,MenuBarMenuListItemButtonView as O,CssTransitionDisablerMixin as $,IconView as H,Template as W,View as q,submitHandler as j,LabeledFieldView as z,createLabeledInputText as G}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconMedia as K,IconMediaPlaceholder as X}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{LivePosition as w,LiveRange as J}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{Clipboard as Q}from"../../../../../@ckeditor_ckeditor5-clipboard@45.2.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{Delete as _}from"../../../../../@ckeditor_ckeditor5-typing@45.2.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{Undo as Y}from"../../../../../@ckeditor_ckeditor5-undo@45.2.1/node_modules/@ckeditor/ckeditor5-undo/dist/index.js";/**
1
+ import{Plugin as h,Command as M}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Widget as T,toWidget as P,findOptimalInsertionRange as k}from"../../../../../@ckeditor_ckeditor5-widget@45.2.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{global as w,first as x,logWarning as R,toArray as D,FocusTracker as C,KeystrokeHandler as F}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{Dialog as U,ButtonView as S,MenuBarMenuListItemButtonView as L,CssTransitionDisablerMixin as B,IconView as A,Template as N,View as O,submitHandler as $,LabeledFieldView as H,createLabeledInputText as W}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconMedia as q,IconMediaPlaceholder as j}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{LivePosition as f,LiveRange as z}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{Clipboard as G}from"../../../../../@ckeditor_ckeditor5-clipboard@45.2.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{Delete as b}from"../../../../../@ckeditor_ckeditor5-typing@45.2.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{Undo as K}from"../../../../../@ckeditor_ckeditor5-undo@45.2.1/node_modules/@ckeditor/ckeditor5-undo/dist/index.js";/**
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  *//**
5
5
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
6
6
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
7
- */function E(r,i){const e=(t,o,n)=>{if(!n.consumable.consume(o.item,t.name))return;const s=o.attributeNewValue,a=n.writer,l=n.mapper.toViewElement(o.item),c=[...l.getChildren()].find(u=>u.getCustomProperty("media-content"));a.remove(c);const d=r.getMediaViewElement(a,s,i);a.insert(a.createPositionAt(l,0),d)};return t=>{t.on("attribute:url:media",e)}}function Z(r,i,e){return i.setCustomProperty("media",!0,r),D(r,i,{label:e})}function I(r,i,e,t){return r.createContainerElement("figure",{class:"media"},[i.getMediaViewElement(r,e,t),r.createSlot()])}function y(r){const i=r.getSelectedElement();return i&&i.is("element","media")?i:null}function M(r,i,e,t){r.change(o=>{const n=o.createElement("media",{url:i});r.insertObject(n,e,null,{setSelection:"on",findOptimalPosition:t?"auto":void 0})})}class ee extends x{refresh(){const i=this.editor.model,e=i.document.selection,t=y(e);this.value=t?t.getAttribute("url"):void 0,this.isEnabled=ie(e)||te(e,i)}execute(i){const e=this.editor.model,t=e.document.selection,o=y(t);o?e.change(n=>{n.setAttribute("url",i,o)}):M(e,i,t,!0)}}function te(r,i){let t=C(r,i).start.parent;return t.isEmpty&&!i.schema.isLimit(t)&&(t=t.parent),i.schema.checkChild(t,"media")}function ie(r){const i=r.getSelectedElement();return!!i&&i.name==="media"}const oe="0 0 64 42";class re{constructor(i,e){m(this,"locale");m(this,"providerDefinitions");const t=e.providers,o=e.extraProviders||[],n=new Set(e.removeProviders),s=t.concat(o).filter(a=>{const l=a.name;return l?!n.has(l):(U("media-embed-no-provider-name",{provider:a}),!1)});this.locale=i,this.providerDefinitions=s}hasMedia(i){return!!this._getMedia(i)}getMediaViewElement(i,e,t){return this._getMedia(e).getViewElement(i,t)}_getMedia(i){if(!i)return new V(this.locale);i=i.trim();for(const e of this.providerDefinitions){const t=e.html,o=S(e.url);for(const n of o){const s=this._getUrlMatches(i,n);if(s)return new V(this.locale,i,s,t)}}return null}_getUrlMatches(i,e){let t=i.match(e);if(t)return t;let o=i.replace(/^https?:\/\//,"");return t=o.match(e),t||(o=o.replace(/^www\./,""),t=o.match(e),t)?t:null}}class V{constructor(i,e,t,o){m(this,"url");m(this,"_locale");m(this,"_match");m(this,"_previewRenderer");this.url=this._getValidUrl(e),this._locale=i,this._match=t,this._previewRenderer=o}getViewElement(i,e){const t={};let o;if(e.renderForEditingView||e.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(t["data-oembed-url"]=this.url),e.renderForEditingView&&(t.class="ck-media__wrapper");const n=this._getPreviewHtml(e);o=i.createRawElement("div",t,(s,a)=>{a.setContentOf(s,n)})}else this.url&&(t.url=this.url),o=i.createEmptyElement(e.elementName,t);return i.setCustomProperty("media-content",!0,o),o}_getPreviewHtml(i){return this._previewRenderer?this._previewRenderer(this._match):this.url&&i.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const i=new H,e=this._locale.t;return i.content=X,i.viewBox=oe,new W({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[i]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":e("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(i){return i?i.match(/^https?/)?i:"https://"+i:null}}class g extends f{constructor(e){super(e);m(this,"registry");e.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; "><iframe src="https://www.dailymotion.com/embed/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" width="480" height="270" allowfullscreen allow="autoplay"></iframe></div>`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;"><iframe src="https://open.spotify.com/embed/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe></div>`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/shorts\/([\w-]+)(?:\?t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:t=>{const o=t[1],n=t[2];return`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://www.youtube.com/embed/${o}${n?`?start=${n}`:""}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>`}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://player.vimeo.com/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>`},{name:"instagram",url:[/^instagram\.com\/p\/(\w+)/,/^instagram\.com\/reel\/(\w+)/]},{name:"twitter",url:[/^twitter\.com/,/^x\.com/]},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new re(e.locale,e.config.get("mediaEmbed"))}static get pluginName(){return"MediaEmbedEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,o=e.t,n=e.conversion,s=e.config.get("mediaEmbed.previewsInData"),a=e.config.get("mediaEmbed.elementName"),l=this.registry;e.commands.add("mediaEmbed",new ee(e)),t.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),n.for("dataDowncast").elementToStructure({model:"media",view:(c,{writer:d})=>{const u=c.getAttribute("url");return I(d,l,u,{elementName:a,renderMediaPreview:!!u&&s})}}),n.for("dataDowncast").add(E(l,{elementName:a,renderMediaPreview:s})),n.for("editingDowncast").elementToStructure({model:"media",view:(c,{writer:d})=>{const u=c.getAttribute("url"),h=I(d,l,u,{elementName:a,renderForEditingView:!0});return Z(h,d,o("media widget"))}}),n.for("editingDowncast").add(E(l,{elementName:a,renderForEditingView:!0})),n.for("upcast").elementToElement({view:c=>["oembed",a].includes(c.name)&&c.getAttribute("url")?{name:!0}:null,model:(c,{writer:d})=>{const u=c.getAttribute("url");return l.hasMedia(u)?d.createElement("media",{url:u}):null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(c,{writer:d})=>{const u=c.getAttribute("data-oembed-url");return l.hasMedia(u)?d.createElement("media",{url:u}):null}}).add(c=>{const d=(u,h,p)=>{if(!p.consumable.consume(h.viewItem,{name:!0,classes:"media"}))return;const{modelRange:b,modelCursor:T}=p.convertChildren(h.viewItem,h.modelCursor);h.modelRange=b,h.modelCursor=T,F(b.getItems())||p.consumable.revert(h.viewItem,{name:!0,classes:"media"})};c.on("element:figure",d)})}}const ne=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class se extends f{constructor(e){super(e);m(this,"_timeoutId");m(this,"_positionToInsert");this._timeoutId=null,this._positionToInsert=null}static get requires(){return[Q,_,Y]}static get pluginName(){return"AutoMediaEmbed"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.document,o=e.plugins.get("ClipboardPipeline");this.listenTo(o,"inputTransformation",()=>{const s=t.selection.getFirstRange(),a=w.fromPosition(s.start);a.stickiness="toPrevious";const l=w.fromPosition(s.end);l.stickiness="toNext",t.once("change:data",()=>{this._embedMediaBetweenPositions(a,l),a.detach(),l.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&(v.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(e,t){const o=this.editor,n=o.plugins.get(g).registry,s=new J(e,t),a=s.getWalker({ignoreElementEnd:!0});let l="";for(const d of a)d.item.is("$textProxy")&&(l+=d.item.data);if(l=l.trim(),!l.match(ne)){s.detach();return}if(!n.hasMedia(l)){s.detach();return}if(!o.commands.get("mediaEmbed").isEnabled){s.detach();return}this._positionToInsert=w.fromPosition(e),this._timeoutId=v.window.setTimeout(()=>{o.model.change(d=>{this._timeoutId=null,d.remove(s),s.detach();let u=null;this._positionToInsert.root.rootName!=="$graveyard"&&(u=this._positionToInsert),M(o.model,l,u,!1),this._positionToInsert.detach(),this._positionToInsert=null}),o.plugins.get(_).requestUndoOnBackspace()},100)}}class ae extends q{constructor(e,t){super(t);m(this,"focusTracker");m(this,"keystrokes");m(this,"urlInputView");m(this,"_validators");m(this,"_urlInputViewInfoDefault");m(this,"_urlInputViewInfoTip");this.focusTracker=new L,this.keystrokes=new B,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this._validators=e,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView]})}render(){super.render(),j({view:this}),this.focusTracker.add(this.urlInputView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.urlInputView.focus()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,t=new z(this.locale,G),o=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,o.inputMode="url",o.on("input",()=>{t.infoText=o.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=o.element.value.trim()}),t}}class le extends f{constructor(){super(...arguments);m(this,"_formView")}static get requires(){return[g,A]}static get pluginName(){return"MediaEmbedUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("mediaEmbed",()=>{const t=this.editor.locale.t,o=this._createDialogButton(N);return o.tooltip=!0,o.label=t("Insert media"),o}),e.ui.componentFactory.add("menuBar:mediaEmbed",()=>{const t=this.editor.locale.t,o=this._createDialogButton(O);return o.label=t("Media"),o})}_createDialogButton(e){const t=this.editor,o=new e(t.locale),n=t.commands.get("mediaEmbed"),s=this.editor.plugins.get("Dialog");return o.icon=K,o.bind("isEnabled").to(n,"isEnabled"),o.on("execute",()=>{s.id==="mediaEmbed"?s.hide():this._showDialog()}),o}_showDialog(){const e=this.editor,t=e.plugins.get("Dialog"),o=e.commands.get("mediaEmbed"),n=e.locale.t,s=o.value!==void 0;if(!this._formView){const a=e.plugins.get(g).registry;this._formView=new($(ae))(de(e.t,a),e.locale),this._formView.on("submit",()=>this._handleSubmitForm())}t.show({id:"mediaEmbed",title:n("Media embed"),content:this._formView,isModal:!0,onShow:()=>{this._formView.url=o.value||"",this._formView.resetFormStatus(),this._formView.urlInputView.fieldView.select()},actionButtons:[{label:n("Cancel"),withText:!0,onExecute:()=>t.hide()},{label:n(s?"Save":"Insert"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSubmitForm()}]})}_handleSubmitForm(){const e=this.editor,t=e.plugins.get("Dialog");this._formView.isValid()&&(e.execute("mediaEmbed",this._formView.url),t.hide(),e.editing.view.focus())}}function de(r,i){return[e=>{if(!e.url.length)return r("The URL must not be empty.")},e=>{if(!i.hasMedia(e.url))return r("This media URL is not supported.")}]}class Ee extends f{static get requires(){return[g,le,se,R]}static get pluginName(){return"MediaEmbed"}static get isOfficialPlugin(){return!0}}export{se as AutoMediaEmbed,Ee as MediaEmbed,g as MediaEmbedEditing,le as MediaEmbedUI};
7
+ */function v(n,e){const t=(i,o,r)=>{if(!r.consumable.consume(o.item,i.name))return;const a=o.attributeNewValue,s=r.writer,l=r.mapper.toViewElement(o.item),d=[...l.getChildren()].find(u=>u.getCustomProperty("media-content"));s.remove(d);const m=n.getMediaViewElement(s,a,e);s.insert(s.createPositionAt(l,0),m)};return i=>{i.on("attribute:url:media",t)}}function X(n,e,t){return e.setCustomProperty("media",!0,n),P(n,e,{label:t})}function _(n,e,t,i){return n.createContainerElement("figure",{class:"media"},[e.getMediaViewElement(n,t,i),n.createSlot()])}function E(n){const e=n.getSelectedElement();return e&&e.is("element","media")?e:null}function y(n,e,t,i){n.change(o=>{const r=o.createElement("media",{url:e});n.insertObject(r,t,null,{setSelection:"on",findOptimalPosition:i?"auto":void 0})})}class J extends M{refresh(){const e=this.editor.model,t=e.document.selection,i=E(t);this.value=i?i.getAttribute("url"):void 0,this.isEnabled=Y(t)||Q(t,e)}execute(e){const t=this.editor.model,i=t.document.selection,o=E(i);o?t.change(r=>{r.setAttribute("url",e,o)}):y(t,e,i,!0)}}function Q(n,e){let i=k(n,e).start.parent;return i.isEmpty&&!e.schema.isLimit(i)&&(i=i.parent),e.schema.checkChild(i,"media")}function Y(n){const e=n.getSelectedElement();return!!e&&e.name==="media"}const Z="0 0 64 42";class ee{locale;providerDefinitions;constructor(e,t){const i=t.providers,o=t.extraProviders||[],r=new Set(t.removeProviders),a=i.concat(o).filter(s=>{const l=s.name;return l?!r.has(l):(R("media-embed-no-provider-name",{provider:s}),!1)});this.locale=e,this.providerDefinitions=a}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,i){return this._getMedia(t).getViewElement(e,i)}_getMedia(e){if(!e)return new I(this.locale);e=e.trim();for(const t of this.providerDefinitions){const i=t.html,o=D(t.url);for(const r of o){const a=this._getUrlMatches(e,r);if(a)return new I(this.locale,e,a,i)}}return null}_getUrlMatches(e,t){let i=e.match(t);if(i)return i;let o=e.replace(/^https?:\/\//,"");return i=o.match(t),i||(o=o.replace(/^www\./,""),i=o.match(t),i)?i:null}}class I{url;_locale;_match;_previewRenderer;constructor(e,t,i,o){this.url=this._getValidUrl(t),this._locale=e,this._match=i,this._previewRenderer=o}getViewElement(e,t){const i={};let o;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(i["data-oembed-url"]=this.url),t.renderForEditingView&&(i.class="ck-media__wrapper");const r=this._getPreviewHtml(t);o=e.createRawElement("div",i,(a,s)=>{s.setContentOf(a,r)})}else this.url&&(i.url=this.url),o=e.createEmptyElement(t.elementName,i);return e.setCustomProperty("media-content",!0,o),o}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new A,t=this._locale.t;return e.content=j,e.viewBox=Z,new N({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":t("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(e){return e?e.match(/^https?/)?e:"https://"+e:null}}class c extends h{static get pluginName(){return"MediaEmbedEditing"}static get isOfficialPlugin(){return!0}registry;constructor(e){super(e),e.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; "><iframe src="https://www.dailymotion.com/embed/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" width="480" height="270" allowfullscreen allow="autoplay"></iframe></div>`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;"><iframe src="https://open.spotify.com/embed/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe></div>`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/shorts\/([\w-]+)(?:\?t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:t=>{const i=t[1],o=t[2];return`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://www.youtube.com/embed/${i}${o?`?start=${o}`:""}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>`}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://player.vimeo.com/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>`},{name:"instagram",url:[/^instagram\.com\/p\/(\w+)/,/^instagram\.com\/reel\/(\w+)/]},{name:"twitter",url:[/^twitter\.com/,/^x\.com/]},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new ee(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor,t=e.model.schema,i=e.t,o=e.conversion,r=e.config.get("mediaEmbed.previewsInData"),a=e.config.get("mediaEmbed.elementName"),s=this.registry;e.commands.add("mediaEmbed",new J(e)),t.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),o.for("dataDowncast").elementToStructure({model:"media",view:(l,{writer:d})=>{const m=l.getAttribute("url");return _(d,s,m,{elementName:a,renderMediaPreview:!!m&&r})}}),o.for("dataDowncast").add(v(s,{elementName:a,renderMediaPreview:r})),o.for("editingDowncast").elementToStructure({model:"media",view:(l,{writer:d})=>{const m=l.getAttribute("url"),u=_(d,s,m,{elementName:a,renderForEditingView:!0});return X(u,d,i("media widget"))}}),o.for("editingDowncast").add(v(s,{elementName:a,renderForEditingView:!0})),o.for("upcast").elementToElement({view:l=>["oembed",a].includes(l.name)&&l.getAttribute("url")?{name:!0}:null,model:(l,{writer:d})=>{const m=l.getAttribute("url");return s.hasMedia(m)?d.createElement("media",{url:m}):null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(l,{writer:d})=>{const m=l.getAttribute("data-oembed-url");return s.hasMedia(m)?d.createElement("media",{url:m}):null}}).add(l=>{const d=(m,u,g)=>{if(!g.consumable.consume(u.viewItem,{name:!0,classes:"media"}))return;const{modelRange:p,modelCursor:V}=g.convertChildren(u.viewItem,u.modelCursor);u.modelRange=p,u.modelCursor=V,x(p.getItems())||g.consumable.revert(u.viewItem,{name:!0,classes:"media"})};l.on("element:figure",d)})}}const te=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class ie extends h{static get requires(){return[G,b,K]}static get pluginName(){return"AutoMediaEmbed"}static get isOfficialPlugin(){return!0}_timeoutId;_positionToInsert;constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,t=e.model.document,i=e.plugins.get("ClipboardPipeline");this.listenTo(i,"inputTransformation",()=>{const r=t.selection.getFirstRange(),a=f.fromPosition(r.start);a.stickiness="toPrevious";const s=f.fromPosition(r.end);s.stickiness="toNext",t.once("change:data",()=>{this._embedMediaBetweenPositions(a,s),a.detach(),s.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&(w.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(e,t){const i=this.editor,o=i.plugins.get(c).registry,r=new z(e,t),a=r.getWalker({ignoreElementEnd:!0});let s="";for(const d of a)d.item.is("$textProxy")&&(s+=d.item.data);if(s=s.trim(),!s.match(te)){r.detach();return}if(!o.hasMedia(s)){r.detach();return}if(!i.commands.get("mediaEmbed").isEnabled){r.detach();return}this._positionToInsert=f.fromPosition(e),this._timeoutId=w.window.setTimeout(()=>{i.model.change(d=>{this._timeoutId=null,d.remove(r),r.detach();let m=null;this._positionToInsert.root.rootName!=="$graveyard"&&(m=this._positionToInsert),y(i.model,s,m,!1),this._positionToInsert.detach(),this._positionToInsert=null}),i.plugins.get(b).requestUndoOnBackspace()},100)}}class oe extends O{focusTracker;keystrokes;urlInputView;_validators;_urlInputViewInfoDefault;_urlInputViewInfoTip;constructor(e,t){super(t),this.focusTracker=new C,this.keystrokes=new F,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this._validators=e,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView]})}render(){super.render(),$({view:this}),this.focusTracker.add(this.urlInputView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.urlInputView.focus()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,t=new H(this.locale,W),i=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,i.inputMode="url",i.on("input",()=>{t.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=i.element.value.trim()}),t}}class re extends h{static get requires(){return[c,U]}static get pluginName(){return"MediaEmbedUI"}static get isOfficialPlugin(){return!0}_formView;init(){const e=this.editor;e.ui.componentFactory.add("mediaEmbed",()=>{const t=this.editor.locale.t,i=this._createDialogButton(S);return i.tooltip=!0,i.label=t("Insert media"),i}),e.ui.componentFactory.add("menuBar:mediaEmbed",()=>{const t=this.editor.locale.t,i=this._createDialogButton(L);return i.label=t("Media"),i})}_createDialogButton(e){const t=this.editor,i=new e(t.locale),o=t.commands.get("mediaEmbed"),r=this.editor.plugins.get("Dialog");return i.icon=q,i.bind("isEnabled").to(o,"isEnabled"),i.on("execute",()=>{r.id==="mediaEmbed"?r.hide():this._showDialog()}),i}_showDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.commands.get("mediaEmbed"),o=e.locale.t,r=i.value!==void 0;if(!this._formView){const a=e.plugins.get(c).registry;this._formView=new(B(oe))(ne(e.t,a),e.locale),this._formView.on("submit",()=>this._handleSubmitForm())}t.show({id:"mediaEmbed",title:o("Media embed"),content:this._formView,isModal:!0,onShow:()=>{this._formView.url=i.value||"",this._formView.resetFormStatus(),this._formView.urlInputView.fieldView.select()},actionButtons:[{label:o("Cancel"),withText:!0,onExecute:()=>t.hide()},{label:o(r?"Save":"Insert"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSubmitForm()}]})}_handleSubmitForm(){const e=this.editor,t=e.plugins.get("Dialog");this._formView.isValid()&&(e.execute("mediaEmbed",this._formView.url),t.hide(),e.editing.view.focus())}}function ne(n,e){return[t=>{if(!t.url.length)return n("The URL must not be empty.")},t=>{if(!e.hasMedia(t.url))return n("This media URL is not supported.")}]}class pe extends h{static get requires(){return[c,re,ie,T]}static get pluginName(){return"MediaEmbed"}static get isOfficialPlugin(){return!0}}export{ie as AutoMediaEmbed,pe as MediaEmbed,c as MediaEmbedEditing,re as MediaEmbedUI};
@@ -1,4 +1,4 @@
1
- var p=Object.defineProperty;var u=(s,e,t)=>e in s?p(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var l=(s,e,t)=>u(s,typeof e!="symbol"?e+"":e,t);import{Plugin as g,Command as m}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{first as f}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";/**
1
+ import{Plugin as h,Command as l}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{first as m}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";/**
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */class P extends m{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,t=e.document,r=f(t.selection.getSelectedBlocks());this.value=!!r&&r.is("element","paragraph"),this.isEnabled=!!r&&d(r,e.schema)}execute(e={}){const t=this.editor.model,r=t.document,n=e.selection||r.selection;t.canEditAt(n)&&t.change(a=>{const o=n.getSelectedBlocks();for(const c of o)!c.is("element","paragraph")&&d(c,t.schema)&&a.rename(c,"paragraph")})}}function d(s,e){return e.checkChild(s.parent,"paragraph")&&!e.isObject(s)}class E extends m{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const t=this.editor.model,r=e.attributes;let n=e.position;return t.canEditAt(n)?t.change(a=>{if(n=this._findPositionToInsertParagraph(n,a),!n)return null;const o=a.createElement("paragraph");return r&&t.schema.setAllowedAttributes(o,r,a),t.insertContent(o,n),a.setSelection(o,"in"),a.createPositionAt(o,0)}):null}_findPositionToInsertParagraph(e,t){const r=this.editor.model;if(r.schema.checkChild(e,"paragraph"))return e;const n=r.schema.findAllowedParent(e,"paragraph");if(!n)return null;const a=e.parent,o=r.schema.checkChild(a,"$text");return a.isEmpty||o&&e.isAtEnd?r.createPositionAfter(a):!a.isEmpty&&o&&e.isAtStart?r.createPositionBefore(a):t.split(e,n).position}}const i=class i extends g{static get pluginName(){return"Paragraph"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new P(e)),e.commands.add("insertParagraph",new E(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(r,{writer:n})=>!i.paragraphLikeElements.has(r.name)||r.isEmpty?null:n.createElement("paragraph"),view:/.+/,converterPriority:"low"})}};l(i,"paragraphLikeElements",new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]));let h=i;export{h as Paragraph};
4
+ */class p extends l{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,r=e.document,t=m(r.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&c(t,e.schema)}execute(e={}){const r=this.editor.model,t=r.document,a=e.selection||t.selection;r.canEditAt(a)&&r.change(n=>{const s=a.getSelectedBlocks();for(const i of s)!i.is("element","paragraph")&&c(i,r.schema)&&n.rename(i,"paragraph")})}}function c(o,e){return e.checkChild(o.parent,"paragraph")&&!e.isObject(o)}class u extends l{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const r=this.editor.model,t=e.attributes;let a=e.position;return r.canEditAt(a)?r.change(n=>{if(a=this._findPositionToInsertParagraph(a,n),!a)return null;const s=n.createElement("paragraph");return t&&r.schema.setAllowedAttributes(s,t,n),r.insertContent(s,a),n.setSelection(s,"in"),n.createPositionAt(s,0)}):null}_findPositionToInsertParagraph(e,r){const t=this.editor.model;if(t.schema.checkChild(e,"paragraph"))return e;const a=t.schema.findAllowedParent(e,"paragraph");if(!a)return null;const n=e.parent,s=t.schema.checkChild(n,"$text");return n.isEmpty||s&&e.isAtEnd?t.createPositionAfter(n):!n.isEmpty&&s&&e.isAtStart?t.createPositionBefore(n):r.split(e,a).position}}class d extends h{static get pluginName(){return"Paragraph"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,r=e.model;e.commands.add("paragraph",new p(e)),e.commands.add("insertParagraph",new u(e)),r.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(t,{writer:a})=>!d.paragraphLikeElements.has(t.name)||t.isEmpty?null:a.createElement("paragraph"),view:/.+/,converterPriority:"low"})}static paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"])}export{d as Paragraph};
@@ -1,28 +1,28 @@
1
- var M=Object.defineProperty;var T=(t,e,n)=>e in t?M(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var b=(t,e,n)=>T(t,typeof e!="symbol"?e+"":e,n);import{Plugin as P}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{ClipboardPipeline as R}from"../../../../../@ckeditor_ckeditor5-clipboard@45.2.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{UpcastWriter as y,ViewDocument as L,DomConverter as E,Matcher as x}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";/**
1
+ import{Plugin as w}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{ClipboardPipeline as M}from"../../../../../@ckeditor_ckeditor5-clipboard@45.2.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{UpcastWriter as y,ViewDocument as A,DomConverter as L,Matcher as b}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";/**
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  *//**
5
5
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
6
6
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
7
- */function W(t,e){const n=[];for(const s of e.createRangeIn(t)){const i=s.item;i.is("element","a")&&!i.hasAttribute("href")&&(i.hasAttribute("id")||i.hasAttribute("name"))&&n.push(i)}for(const s of n){const i=s.parent.getChildIndex(s)+1,r=s.getChildren();e.insertChild(i,r,s.parent)}}/**
7
+ */function T(e,t){const n=[];for(const s of t.createRangeIn(e)){const i=s.item;i.is("element","a")&&!i.hasAttribute("href")&&(i.hasAttribute("id")||i.hasAttribute("name"))&&n.push(i)}for(const s of n){const i=s.parent.getChildIndex(s)+1,r=s.getChildren();t.insertChild(i,r,s.parent)}}/**
8
8
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
9
9
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
10
- */function w(t){const e=parseFloat(t);return t.endsWith("pt")?h(e*96/72):t.endsWith("pc")?h(e*12*96/72):t.endsWith("in")?h(e*96):t.endsWith("cm")?h(e*96/2.54):t.endsWith("mm")?h(e/10*96/2.54):t}function v(t){return t!==void 0&&t.endsWith("px")}function h(t){return Math.round(t)+"px"}function k(t,e,n){if(!t.childCount)return;const s=new y(t.document),i=D(t,s);if(!i.length)return;const r={},l=[];for(const o of i)if(o.indent!==void 0){N(o)||(l.length=0);const a=`${o.id}:${o.indent}`,c=Math.min(o.indent-1,l.length);if(c<l.length&&l[c].id!==o.id&&(l.length=c),c<l.length-1)l.length=c+1;else{const m=B(o,e);if(c>l.length-1||l[c].listElement.name!=m.type){c==0&&m.type=="ol"&&o.id!==void 0&&r[a]&&(m.startIndex=r[a]);const d=_(m,s,n);if(v(o.marginLeft)&&(c==0||v(l[c-1].marginLeft))){let u=o.marginLeft;c>0&&(u=h(parseFloat(u)-parseFloat(l[c-1].marginLeft))),s.setStyle("padding-left",u,d)}if(l.length==0){const u=o.element.parent,g=u.getChildIndex(o.element)+1;s.insertChild(g,d,u)}else{const u=l[c-1].listItemElements;s.appendChild(d,u[u.length-1])}l[c]={...o,listElement:d,listItemElements:[]},c==0&&o.id!==void 0&&(r[a]=m.startIndex||1)}}const f=o.element.name=="li"?o.element:s.createElement("li");s.appendChild(f,l[c].listElement),l[c].listItemElements.push(f),c==0&&o.id!==void 0&&r[a]++,o.element!=f&&s.appendChild(o.element,f),H(o.element,s),s.removeStyle("text-indent",o.element),s.removeStyle("margin-left",o.element)}else{const a=l.find(c=>c.marginLeft==o.marginLeft);if(a){const c=a.listItemElements;s.appendChild(o.element,c[c.length-1]),s.removeStyle("margin-left",o.element)}else l.length=0}}function $(t,e){for(const n of e.createRangeIn(t)){const s=n.item;if(s.is("element","li")){const i=s.getChild(0);i&&i.is("element","p")&&e.unwrapElement(i)}}}function D(t,e){const n=e.createRangeIn(t),s=[],i=new Set;for(const r of n.getItems()){if(!r.is("element")||!r.name.match(/^(p|h\d+|li|div)$/))continue;let l=V(r);if(l!==void 0&&parseFloat(l)==0&&!Array.from(r.getClassNames()).find(o=>o.startsWith("MsoList"))&&(l=void 0),r.hasStyle("mso-list")||l!==void 0&&i.has(l)){const o=F(r);s.push({element:r,id:o.id,order:o.order,indent:o.indent,marginLeft:l}),l!==void 0&&i.add(l)}else i.clear()}return s}function N(t){const e=t.element.previousSibling;return S(e||t.element.parent)}function S(t){return t.is("element","ol")||t.is("element","ul")}function B(t,e){const n=new RegExp(`@list l${t.id}:level${t.indent}\\s*({[^}]*)`,"gi"),s=/mso-level-number-format:([^;]{0,100});/gi,i=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,r=new RegExp(`@list\\s+l${t.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),l=new RegExp(`@list l${t.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),o=r.exec(e),a=l.exec(e),c=o&&!a,f=n.exec(e);let m="decimal",d="ol",u=null;if(f&&f[1]){const g=s.exec(f[1]);if(g&&g[1]&&(m=g[1].trim(),d=m!=="bullet"&&m!=="image"?"ol":"ul"),m==="bullet"){const p=O(t.element);p&&(m=p)}else{const p=i.exec(f[1]);p&&p[1]&&(u=parseInt(p[1]))}c&&(d="ol")}return{type:d,startIndex:u,style:j(m),isLegalStyleList:c}}function O(t){if(t.name=="li"&&t.parent.name=="ul"&&t.parent.hasAttribute("type"))return t.parent.getAttribute("type");const e=z(t);if(!e)return null;const n=e._data;return n==="o"?"circle":n==="·"?"disc":n==="§"?"square":null}function z(t){if(t.getChild(0).is("$text"))return null;for(const e of t.getChildren()){if(!e.is("element","span"))continue;const n=e.getChild(0);if(n)return n.is("$text")?n:n.getChild(0)}/* istanbul ignore next -- @preserve */return null}function j(t){if(t.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(t){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return t;default:return null}}function _(t,e,n){const s=e.createElement(t.type);return t.style&&e.setStyle("list-style-type",t.style,s),t.startIndex&&t.startIndex>1&&e.setAttribute("start",t.startIndex,s),t.isLegalStyleList&&n&&e.addClass("legal-list",s),s}function F(t){const e=t.getStyle("mso-list");if(e===void 0)return{};const n=e.match(/(^|\s{1,100})l(\d+)/i),s=e.match(/\s{0,100}lfo(\d+)/i),i=e.match(/\s{0,100}level(\d+)/i);return n&&s&&i?{id:n[2],order:s[1],indent:parseInt(i[1])}:{indent:1}}function H(t,e){const n=new x({name:"span",styles:{"mso-list":"Ignore"}}),s=e.createRangeIn(t);for(const i of s)i.type==="elementStart"&&n.match(i.item)&&e.remove(i.item)}function V(t){const e=t.getStyle("margin-left");return e===void 0||e.endsWith("px")?e:w(e)}function q(t,e){if(!t.childCount)return;const n=new y(t.document),s=U(t,n);X(s,t,n),K(s,t,n),J(t,n);const i=Q(t,n);i.length&&Z(i,Y(e),n)}function G(t){return btoa(t.match(/\w{2}/g).map(e=>String.fromCharCode(parseInt(e,16))).join(""))}function U(t,e){const n=e.createRangeIn(t),s=new x({name:/v:(.+)/}),i=[];for(const r of n){if(r.type!="elementStart")continue;const l=r.item,o=l.previousSibling,a=o&&o.is("element")?o.name:null,c=["Chart"],f=s.match(l),m=l.getAttribute("o:gfxdata"),d=a==="v:shapetype",u=m&&c.some(g=>l.getAttribute("id").includes(g));f&&m&&!d&&!u&&i.push(r.item.getAttribute("id"))}return i}function X(t,e,n){const s=n.createRangeIn(e),i=new x({name:"img"}),r=[];for(const l of s)if(l.item.is("element")&&i.match(l.item)){const o=l.item,a=o.getAttribute("v:shapes")?o.getAttribute("v:shapes").split(" "):[];a.length&&a.every(c=>t.indexOf(c)>-1)?r.push(o):o.getAttribute("src")||r.push(o)}for(const l of r)n.remove(l)}function J(t,e){const n=e.createRangeIn(t),s=new x({name:/v:(.+)/}),i=[];for(const r of n)r.type=="elementStart"&&s.match(r.item)&&i.push(r.item);for(const r of i)e.remove(r)}function K(t,e,n){const s=n.createRangeIn(e),i=[];for(const o of s)if(o.type=="elementStart"&&o.item.is("element","v:shape")){const a=o.item.getAttribute("id");if(t.includes(a))continue;r(o.item.parent.getChildren(),a)||i.push(o.item)}for(const o of i){const a={src:l(o)};o.hasAttribute("alt")&&(a.alt=o.getAttribute("alt"));const c=n.createElement("img",a);n.insertChild(o.index+1,c,o.parent)}function r(o,a){for(const c of o){/* istanbul ignore else -- @preserve */if(c.is("element")&&(c.name=="img"&&c.getAttribute("v:shapes")==a||r(c.getChildren(),a)))return!0}return!1}function l(o){for(const a of o.getChildren()){/* istanbul ignore else -- @preserve */if(a.is("element")&&a.getAttribute("src"))return a.getAttribute("src")}}}function Q(t,e){const n=e.createRangeIn(t),s=new x({name:"img"}),i=[];let r=0;for(const l of n)l.item.is("element")&&s.match(l.item)&&(l.item.getAttribute("src").startsWith("file://")&&i.push({element:l.item,imageIndex:r}),r++);return i}function Y(t){if(!t)return[];const e=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,n=new RegExp("(?:("+e.source+"))([\\da-fA-F\\s]+)\\}","g"),s=t.match(n),i=[];if(s)for(const r of s){let l=!1;r.includes("\\pngblip")?l="image/png":r.includes("\\jpegblip")&&(l="image/jpeg"),l&&i.push({hex:r.replace(e,"").replace(/[^\da-fA-F]/g,""),type:l})}return i}function Z(t,e,n){for(let s=0;s<t.length;s++){const{element:i,imageIndex:r}=t[s],l=e[r];if(l){const o=`data:${l.type};base64,${G(l.hex)}`;n.setAttribute("src",o,i)}}}function ee(t){const e=[],n=new y(t.document);for(const{item:s}of n.createRangeIn(t))if(s.is("element")){for(const i of s.getClassNames())/\bmso/gi.exec(i)&&n.removeClass(i,s);for(const i of s.getStyleNames())/\bmso/gi.exec(i)&&n.removeStyle(i,s);(s.is("element","w:sdt")||s.is("element","w:sdtpr")&&s.isEmpty||s.is("element","o:p")&&s.isEmpty)&&e.push(s)}for(const s of e){const i=s.parent,r=i.getChildIndex(s);n.insertChild(r,s.getChildren(),i),n.remove(s)}}function te(t,e){for(const n of e.createRangeIn(t).getItems()){if(!n.is("element","table")&&!n.is("element","td")&&!n.is("element","th"))continue;const s=["left","top","right","bottom"];if(s.every(r=>!n.hasStyle(`border-${r}-style`)))e.setStyle("border-style","none",n);else for(const r of s)n.hasStyle(`border-${r}-style`)||e.setStyle(`border-${r}-style`,"none",n);const i=["width","height",...s.map(r=>`border-${r}-width`),...s.map(r=>`padding-${r}`)];for(const r of i)n.hasStyle(r)&&e.setStyle(r,w(n.getStyle(r)),n)}}const ne=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,se=/xmlns:o="urn:schemas-microsoft-com/i;class ie{constructor(e,n=!1){b(this,"document");b(this,"hasMultiLevelListPlugin");this.document=e,this.hasMultiLevelListPlugin=n}isActive(e){return ne.test(e)||se.test(e)}execute(e){const n=new y(this.document),{body:s,stylesString:i}=e._parsedData;W(s,n),k(s,i,this.hasMultiLevelListPlugin),q(s,e.dataTransfer.getData("text/rtf")),te(s,n),ee(s),e.content=s}}/**
10
+ */function E(e){const t=parseFloat(e);return e.endsWith("pt")?h(t*96/72):e.endsWith("pc")?h(t*12*96/72):e.endsWith("in")?h(t*96):e.endsWith("cm")?h(t*96/2.54):e.endsWith("mm")?h(t/10*96/2.54):e}function x(e){return e!==void 0&&e.endsWith("px")}function h(e){return Math.round(e)+"px"}function P(e,t,n){if(!e.childCount)return;const s=new y(e.document),i=W(e,s);if(!i.length)return;const r={},l=[];for(const o of i)if(o.indent!==void 0){k(o)||(l.length=0);const a=`${o.id}:${o.indent}`,c=Math.min(o.indent-1,l.length);if(c<l.length&&l[c].id!==o.id&&(l.length=c),c<l.length-1)l.length=c+1;else{const m=$(o,t);if(c>l.length-1||l[c].listElement.name!=m.type){c==0&&m.type=="ol"&&o.id!==void 0&&r[a]&&(m.startIndex=r[a]);const d=O(m,s,n);if(x(o.marginLeft)&&(c==0||x(l[c-1].marginLeft))){let u=o.marginLeft;c>0&&(u=h(parseFloat(u)-parseFloat(l[c-1].marginLeft))),s.setStyle("padding-left",u,d)}if(l.length==0){const u=o.element.parent,g=u.getChildIndex(o.element)+1;s.insertChild(g,d,u)}else{const u=l[c-1].listItemElements;s.appendChild(d,u[u.length-1])}l[c]={...o,listElement:d,listItemElements:[]},c==0&&o.id!==void 0&&(r[a]=m.startIndex||1)}}const f=o.element.name=="li"?o.element:s.createElement("li");s.appendChild(f,l[c].listElement),l[c].listItemElements.push(f),c==0&&o.id!==void 0&&r[a]++,o.element!=f&&s.appendChild(o.element,f),j(o.element,s),s.removeStyle("text-indent",o.element),s.removeStyle("margin-left",o.element)}else{const a=l.find(c=>c.marginLeft==o.marginLeft);if(a){const c=a.listItemElements;s.appendChild(o.element,c[c.length-1]),s.removeStyle("margin-left",o.element)}else l.length=0}}function R(e,t){for(const n of t.createRangeIn(e)){const s=n.item;if(s.is("element","li")){const i=s.getChild(0);i&&i.is("element","p")&&t.unwrapElement(i)}}}function W(e,t){const n=t.createRangeIn(e),s=[],i=new Set;for(const r of n.getItems()){if(!r.is("element")||!r.name.match(/^(p|h\d+|li|div)$/))continue;let l=_(r);if(l!==void 0&&parseFloat(l)==0&&!Array.from(r.getClassNames()).find(o=>o.startsWith("MsoList"))&&(l=void 0),r.hasStyle("mso-list")||l!==void 0&&i.has(l)){const o=z(r);s.push({element:r,id:o.id,order:o.order,indent:o.indent,marginLeft:l}),l!==void 0&&i.add(l)}else i.clear()}return s}function k(e){const t=e.element.previousSibling;return v(t||e.element.parent)}function v(e){return e.is("element","ol")||e.is("element","ul")}function $(e,t){const n=new RegExp(`@list l${e.id}:level${e.indent}\\s*({[^}]*)`,"gi"),s=/mso-level-number-format:([^;]{0,100});/gi,i=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,r=new RegExp(`@list\\s+l${e.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),l=new RegExp(`@list l${e.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),o=r.exec(t),a=l.exec(t),c=o&&!a,f=n.exec(t);let m="decimal",d="ol",u=null;if(f&&f[1]){const g=s.exec(f[1]);if(g&&g[1]&&(m=g[1].trim(),d=m!=="bullet"&&m!=="image"?"ol":"ul"),m==="bullet"){const p=D(e.element);p&&(m=p)}else{const p=i.exec(f[1]);p&&p[1]&&(u=parseInt(p[1]))}c&&(d="ol")}return{type:d,startIndex:u,style:B(m),isLegalStyleList:c}}function D(e){if(e.name=="li"&&e.parent.name=="ul"&&e.parent.hasAttribute("type"))return e.parent.getAttribute("type");const t=N(e);if(!t)return null;const n=t._data;return n==="o"?"circle":n==="·"?"disc":n==="§"?"square":null}function N(e){if(e.getChild(0).is("$text"))return null;for(const t of e.getChildren()){if(!t.is("element","span"))continue;const n=t.getChild(0);if(n)return n.is("$text")?n:n.getChild(0)}/* istanbul ignore next -- @preserve */return null}function B(e){if(e.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(e){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return e;default:return null}}function O(e,t,n){const s=t.createElement(e.type);return e.style&&t.setStyle("list-style-type",e.style,s),e.startIndex&&e.startIndex>1&&t.setAttribute("start",e.startIndex,s),e.isLegalStyleList&&n&&t.addClass("legal-list",s),s}function z(e){const t=e.getStyle("mso-list");if(t===void 0)return{};const n=t.match(/(^|\s{1,100})l(\d+)/i),s=t.match(/\s{0,100}lfo(\d+)/i),i=t.match(/\s{0,100}level(\d+)/i);return n&&s&&i?{id:n[2],order:s[1],indent:parseInt(i[1])}:{indent:1}}function j(e,t){const n=new b({name:"span",styles:{"mso-list":"Ignore"}}),s=t.createRangeIn(e);for(const i of s)i.type==="elementStart"&&n.match(i.item)&&t.remove(i.item)}function _(e){const t=e.getStyle("margin-left");return t===void 0||t.endsWith("px")?t:E(t)}function F(e,t){if(!e.childCount)return;const n=new y(e.document),s=V(e,n);q(s,e,n),U(s,e,n),G(e,n);const i=X(e,n);i.length&&K(i,J(t),n)}function H(e){return btoa(e.match(/\w{2}/g).map(t=>String.fromCharCode(parseInt(t,16))).join(""))}function V(e,t){const n=t.createRangeIn(e),s=new b({name:/v:(.+)/}),i=[];for(const r of n){if(r.type!="elementStart")continue;const l=r.item,o=l.previousSibling,a=o&&o.is("element")?o.name:null,c=["Chart"],f=s.match(l),m=l.getAttribute("o:gfxdata"),d=a==="v:shapetype",u=m&&c.some(g=>l.getAttribute("id").includes(g));f&&m&&!d&&!u&&i.push(r.item.getAttribute("id"))}return i}function q(e,t,n){const s=n.createRangeIn(t),i=new b({name:"img"}),r=[];for(const l of s)if(l.item.is("element")&&i.match(l.item)){const o=l.item,a=o.getAttribute("v:shapes")?o.getAttribute("v:shapes").split(" "):[];a.length&&a.every(c=>e.indexOf(c)>-1)?r.push(o):o.getAttribute("src")||r.push(o)}for(const l of r)n.remove(l)}function G(e,t){const n=t.createRangeIn(e),s=new b({name:/v:(.+)/}),i=[];for(const r of n)r.type=="elementStart"&&s.match(r.item)&&i.push(r.item);for(const r of i)t.remove(r)}function U(e,t,n){const s=n.createRangeIn(t),i=[];for(const o of s)if(o.type=="elementStart"&&o.item.is("element","v:shape")){const a=o.item.getAttribute("id");if(e.includes(a))continue;r(o.item.parent.getChildren(),a)||i.push(o.item)}for(const o of i){const a={src:l(o)};o.hasAttribute("alt")&&(a.alt=o.getAttribute("alt"));const c=n.createElement("img",a);n.insertChild(o.index+1,c,o.parent)}function r(o,a){for(const c of o){/* istanbul ignore else -- @preserve */if(c.is("element")&&(c.name=="img"&&c.getAttribute("v:shapes")==a||r(c.getChildren(),a)))return!0}return!1}function l(o){for(const a of o.getChildren()){/* istanbul ignore else -- @preserve */if(a.is("element")&&a.getAttribute("src"))return a.getAttribute("src")}}}function X(e,t){const n=t.createRangeIn(e),s=new b({name:"img"}),i=[];let r=0;for(const l of n)l.item.is("element")&&s.match(l.item)&&(l.item.getAttribute("src").startsWith("file://")&&i.push({element:l.item,imageIndex:r}),r++);return i}function J(e){if(!e)return[];const t=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,n=new RegExp("(?:("+t.source+"))([\\da-fA-F\\s]+)\\}","g"),s=e.match(n),i=[];if(s)for(const r of s){let l=!1;r.includes("\\pngblip")?l="image/png":r.includes("\\jpegblip")&&(l="image/jpeg"),l&&i.push({hex:r.replace(t,"").replace(/[^\da-fA-F]/g,""),type:l})}return i}function K(e,t,n){for(let s=0;s<e.length;s++){const{element:i,imageIndex:r}=e[s],l=t[r];if(l){const o=`data:${l.type};base64,${H(l.hex)}`;n.setAttribute("src",o,i)}}}function Q(e){const t=[],n=new y(e.document);for(const{item:s}of n.createRangeIn(e))if(s.is("element")){for(const i of s.getClassNames())/\bmso/gi.exec(i)&&n.removeClass(i,s);for(const i of s.getStyleNames())/\bmso/gi.exec(i)&&n.removeStyle(i,s);(s.is("element","w:sdt")||s.is("element","w:sdtpr")&&s.isEmpty||s.is("element","o:p")&&s.isEmpty)&&t.push(s)}for(const s of t){const i=s.parent,r=i.getChildIndex(s);n.insertChild(r,s.getChildren(),i),n.remove(s)}}function Y(e,t){for(const n of t.createRangeIn(e).getItems()){if(!n.is("element","table")&&!n.is("element","td")&&!n.is("element","th"))continue;const s=["left","top","right","bottom"];if(s.every(r=>!n.hasStyle(`border-${r}-style`)))t.setStyle("border-style","none",n);else for(const r of s)n.hasStyle(`border-${r}-style`)||t.setStyle(`border-${r}-style`,"none",n);const i=["width","height",...s.map(r=>`border-${r}-width`),...s.map(r=>`padding-${r}`)];for(const r of i)n.hasStyle(r)&&t.setStyle(r,E(n.getStyle(r)),n)}}const Z=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,ee=/xmlns:o="urn:schemas-microsoft-com/i;class te{document;hasMultiLevelListPlugin;constructor(t,n=!1){this.document=t,this.hasMultiLevelListPlugin=n}isActive(t){return Z.test(t)||ee.test(t)}execute(t){const n=new y(this.document),{body:s,stylesString:i}=t._parsedData;T(s,n),P(s,i,this.hasMultiLevelListPlugin),F(s,t.dataTransfer.getData("text/rtf")),Y(s,n),Q(s),t.content=s}}/**
11
11
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
12
12
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
13
- */function oe(t,e){for(const n of t.getChildren())if(n.is("element","b")&&n.getStyle("font-weight")==="normal"){const s=t.getChildIndex(n);e.remove(n),e.insertChild(s,n.getChildren(),t)}}function re(t,e){const n=new L(e.document.stylesProcessor),s=new E(n,{renderingMode:"data"}),i=s.blockElements,r=s.inlineObjectElements,l=[];for(const o of e.createRangeIn(t)){const a=o.item;if(a.is("element","br")){const c=I(a,"forward",e,{blockElements:i,inlineObjectElements:r}),f=I(a,"backward",e,{blockElements:i,inlineObjectElements:r}),m=C(c,i);(C(f,i)||m)&&l.push(a)}}for(const o of l)o.hasClass("Apple-interchange-newline")?e.remove(o):e.replace(o,e.createElement("p"))}function I(t,e,n,{blockElements:s,inlineObjectElements:i}){let r=n.createPositionAt(t,e=="forward"?"after":"before");return r=r.getLastMatchingPosition(({item:l})=>l.is("element")&&!s.includes(l.name)&&!i.includes(l.name),{direction:e}),e=="forward"?r.nodeAfter:r.nodeBefore}function C(t,e){return!!t&&t.is("element")&&e.includes(t.name)}const le=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class ce{constructor(e){b(this,"document");this.document=e}isActive(e){return le.test(e)}execute(e){const n=new y(this.document),{body:s}=e._parsedData;oe(s,n),$(s,n),re(s,n),e.content=s}}/**
13
+ */function ne(e,t){for(const n of e.getChildren())if(n.is("element","b")&&n.getStyle("font-weight")==="normal"){const s=e.getChildIndex(n);t.remove(n),t.insertChild(s,n.getChildren(),e)}}function se(e,t){const n=new A(t.document.stylesProcessor),s=new L(n,{renderingMode:"data"}),i=s.blockElements,r=s.inlineObjectElements,l=[];for(const o of t.createRangeIn(e)){const a=o.item;if(a.is("element","br")){const c=S(a,"forward",t,{blockElements:i,inlineObjectElements:r}),f=S(a,"backward",t,{blockElements:i,inlineObjectElements:r}),m=I(c,i);(I(f,i)||m)&&l.push(a)}}for(const o of l)o.hasClass("Apple-interchange-newline")?t.remove(o):t.replace(o,t.createElement("p"))}function S(e,t,n,{blockElements:s,inlineObjectElements:i}){let r=n.createPositionAt(e,t=="forward"?"after":"before");return r=r.getLastMatchingPosition(({item:l})=>l.is("element")&&!s.includes(l.name)&&!i.includes(l.name),{direction:t}),t=="forward"?r.nodeAfter:r.nodeBefore}function I(e,t){return!!e&&e.is("element")&&t.includes(e.name)}const ie=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class oe{document;constructor(t){this.document=t}isActive(t){return ie.test(t)}execute(t){const n=new y(this.document),{body:s}=t._parsedData;ne(s,n),R(s,n),se(s,n),t.content=s}}/**
14
14
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
15
15
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
16
- */function ae(t,e){for(const n of t.getChildren())n.is("element","table")&&n.hasAttribute("xmlns")&&e.removeAttribute("xmlns",n)}/**
16
+ */function re(e,t){for(const n of e.getChildren())n.is("element","table")&&n.hasAttribute("xmlns")&&t.removeAttribute("xmlns",n)}/**
17
17
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
18
18
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
19
- */function me(t,e){for(const n of t.getChildren())if(n.is("element","google-sheets-html-origin")){const s=t.getChildIndex(n);e.remove(n),e.insertChild(s,n.getChildren(),t)}}/**
19
+ */function le(e,t){for(const n of e.getChildren())if(n.is("element","google-sheets-html-origin")){const s=e.getChildIndex(n);t.remove(n),t.insertChild(s,n.getChildren(),e)}}/**
20
20
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
21
21
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
22
- */function fe(t,e){for(const n of t.getChildren())n.is("element","table")&&n.getStyle("width")==="0px"&&e.removeStyle("width",n)}/**
22
+ */function ce(e,t){for(const n of e.getChildren())n.is("element","table")&&n.getStyle("width")==="0px"&&t.removeStyle("width",n)}/**
23
23
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
24
24
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
25
- */function ue(t,e){for(const n of Array.from(t.getChildren()))n.is("element","style")&&e.remove(n)}const de=/<google-sheets-html-origin/i;class ge{constructor(e){b(this,"document");this.document=e}isActive(e){return de.test(e)}execute(e){const n=new y(this.document),{body:s}=e._parsedData;me(s,n),ae(s,n),fe(s,n),ue(s,n),e.content=s}}/**
25
+ */function ae(e,t){for(const n of Array.from(e.getChildren()))n.is("element","style")&&t.remove(n)}const me=/<google-sheets-html-origin/i;class fe{document;constructor(t){this.document=t}isActive(t){return me.test(t)}execute(t){const n=new y(this.document),{body:s}=t._parsedData;le(s,n),re(s,n),ce(s,n),ae(s,n),t.content=s}}/**
26
26
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
27
27
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
28
- */function pe(t){return A(A(t)).replace(/(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g,"").replace(/(<span\s+style=['"]letter-spacing:[^'"]+?['"]>)[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," </").replace(/ <o:p><\/o:p>/g," <o:p></o:p>").replace(/<o:p>(&nbsp;|\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)</g,"><")}function he(t){t.querySelectorAll("span[style*=spacerun]").forEach(e=>{const n=e,s=n.innerText.length||0;n.innerText=Array(s+1).join("  ").substr(0,s)})}function A(t){return t.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,n)=>n.length===1?" ":Array(n.length+1).join("  ").substr(0,n.length))}function ye(t,e){const n=new DOMParser;t=t.replace(/<!--\[if gte vml 1]>/g,""),t=t.replace(/<o:SmartTagType(?:\s+[^\s>=]+(?:="[^"]*")?)*\s*\/?>/gi,"");const s=pe(ve(t)),i=n.parseFromString(s,"text/html");he(i);const r=i.body.innerHTML,l=be(i,e),o=xe(i);return{body:l,bodyString:r,styles:o.styles,stylesString:o.stylesString}}function be(t,e){const n=new L(e),s=new E(n,{renderingMode:"data"}),i=t.createDocumentFragment(),r=t.body.childNodes;for(;r.length>0;)i.appendChild(r[0]);return s.domToView(i,{skipComments:!0})}function xe(t){const e=[],n=[],s=Array.from(t.getElementsByTagName("style"));for(const i of s)i.sheet&&i.sheet.cssRules&&i.sheet.cssRules.length&&(e.push(i.sheet),n.push(i.innerHTML));return{styles:e,stylesString:n.join(" ")}}function ve(t){const e="</body>",n="</html>",s=t.indexOf(e);if(s<0)return t;const i=t.indexOf(n,s+e.length);return t.substring(0,s+e.length)+(i>=0?t.substring(i):"")}class Le extends P{static get pluginName(){return"PasteFromOffice"}static get isOfficialPlugin(){return!0}static get requires(){return[R]}init(){const e=this.editor,n=e.plugins.get("ClipboardPipeline"),s=e.editing.view.document,i=[],r=this.editor.plugins.has("MultiLevelList");i.push(new ie(s,r)),i.push(new ce(s)),i.push(new ge(s)),n.on("inputTransformation",(l,o)=>{if(o._isTransformedWithPasteFromOffice||e.model.document.selection.getFirstPosition().parent.is("element","codeBlock"))return;const c=o.dataTransfer.getData("text/html"),f=i.find(m=>m.isActive(c));f&&(o._parsedData||(o._parsedData=ye(c,s.stylesProcessor)),f.execute(o),o._isTransformedWithPasteFromOffice=!0)},{priority:"high"})}}export{ie as MSWordNormalizer,Le as PasteFromOffice,ye as parseHtml};
28
+ */function ue(e){return C(C(e)).replace(/(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g,"").replace(/(<span\s+style=['"]letter-spacing:[^'"]+?['"]>)[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," </").replace(/ <o:p><\/o:p>/g," <o:p></o:p>").replace(/<o:p>(&nbsp;|\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)</g,"><")}function de(e){e.querySelectorAll("span[style*=spacerun]").forEach(t=>{const n=t,s=n.innerText.length||0;n.innerText=Array(s+1).join("  ").substr(0,s)})}function C(e){return e.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(t,n)=>n.length===1?" ":Array(n.length+1).join("  ").substr(0,n.length))}function ge(e,t){const n=new DOMParser;e=e.replace(/<!--\[if gte vml 1]>/g,""),e=e.replace(/<o:SmartTagType(?:\s+[^\s>=]+(?:="[^"]*")?)*\s*\/?>/gi,"");const s=ue(ye(e)),i=n.parseFromString(s,"text/html");de(i);const r=i.body.innerHTML,l=pe(i,t),o=he(i);return{body:l,bodyString:r,styles:o.styles,stylesString:o.stylesString}}function pe(e,t){const n=new A(t),s=new L(n,{renderingMode:"data"}),i=e.createDocumentFragment(),r=e.body.childNodes;for(;r.length>0;)i.appendChild(r[0]);return s.domToView(i,{skipComments:!0})}function he(e){const t=[],n=[],s=Array.from(e.getElementsByTagName("style"));for(const i of s)i.sheet&&i.sheet.cssRules&&i.sheet.cssRules.length&&(t.push(i.sheet),n.push(i.innerHTML));return{styles:t,stylesString:n.join(" ")}}function ye(e){const t="</body>",n="</html>",s=e.indexOf(t);if(s<0)return e;const i=e.indexOf(n,s+t.length);return e.substring(0,s+t.length)+(i>=0?e.substring(i):"")}class Se extends w{static get pluginName(){return"PasteFromOffice"}static get isOfficialPlugin(){return!0}static get requires(){return[M]}init(){const t=this.editor,n=t.plugins.get("ClipboardPipeline"),s=t.editing.view.document,i=[],r=this.editor.plugins.has("MultiLevelList");i.push(new te(s,r)),i.push(new oe(s)),i.push(new fe(s)),n.on("inputTransformation",(l,o)=>{if(o._isTransformedWithPasteFromOffice||t.model.document.selection.getFirstPosition().parent.is("element","codeBlock"))return;const c=o.dataTransfer.getData("text/html"),f=i.find(m=>m.isActive(c));f&&(o._parsedData||(o._parsedData=ge(c,s.stylesProcessor)),f.execute(o),o._isTransformedWithPasteFromOffice=!0)},{priority:"high"})}}export{te as MSWordNormalizer,Se as PasteFromOffice,ge as parseHtml};
@@ -1,4 +1,4 @@
1
- var p=Object.defineProperty;var E=(s,r,e)=>r in s?p(s,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[r]=e;var c=(s,r,e)=>E(s,typeof r!="symbol"?r+"":r,e);import{Plugin as b,PendingActions as h}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconSource as _}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as w,MenuBarMenuListItemButtonView as R}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{ElementReplacer as S,CKEditorError as y,createElement as m,formatHtml as v}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";/**
1
+ import{Plugin as g,PendingActions as l}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconSource as f}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as p,MenuBarMenuListItemButtonView as E}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{ElementReplacer as b,CKEditorError as _,createElement as u,formatHtml as w}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";/**
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */const l="SourceEditingMode";class I extends b{constructor(e){super(e);c(this,"_elementReplacer");c(this,"_replacedRoots");c(this,"_dataFromRoots");this.set("isSourceEditingMode",!1),this._elementReplacer=new S,this._replacedRoots=new Map,this._dataFromRoots=new Map,e.config.define("sourceEditing.allowCollaborationFeatures",!1)}static get pluginName(){return"SourceEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[h]}init(){this._checkCompatibility();const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("sourceEditing",()=>{const i=this._createButton(w);return i.set({label:t("Source"),icon:_,tooltip:!0,class:"ck-source-editing-button"}),i}),e.ui.componentFactory.add("menuBar:sourceEditing",()=>{const i=this._createButton(R);return i.set({label:t("Show source"),role:"menuitemcheckbox"}),i}),this._isAllowedToHandleSourceEditingMode()&&(this.on("change:isSourceEditingMode",(i,o,n)=>{n?(this._hideVisibleDialog(),this._showSourceEditing(),this._disableCommands()):(this._hideSourceEditing(),this._enableCommands())}),this.on("change:isEnabled",(i,o,n)=>this._handleReadOnlyMode(!n)),this.listenTo(e,"change:isReadOnly",(i,o,n)=>this._handleReadOnlyMode(n))),e.data.on("get",()=>{this.isSourceEditingMode&&this.updateEditorData()},{priority:"high"})}updateEditorData(){const e=this.editor,t={};for(const[i,o]of this._replacedRoots){const n=this._dataFromRoots.get(i),a=o.dataset.value;n!==a&&(t[i]=a,this._dataFromRoots.set(i,a))}Object.keys(t).length&&e.data.set(t,{batchType:{isUndoable:!0},suppressErrorInCollaboration:!0})}_checkCompatibility(){const e=this.editor,t=e.config.get("sourceEditing.allowCollaborationFeatures");if(!t&&e.plugins.has("RealTimeCollaborativeEditing"))throw new y("source-editing-incompatible-with-real-time-collaboration",null);!t&&["CommentsEditing","TrackChangesEditing","RevisionHistory"].some(o=>e.plugins.has(o))&&console.warn("You initialized the editor with the source editing feature and at least one of the collaboration features. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the collaboration features."),e.plugins.has("RestrictedEditingModeEditing")&&console.warn("You initialized the editor with the source editing feature and restricted editing feature. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the restricted editing feature.")}_showSourceEditing(){const e=this.editor,t=e.editing.view,i=e.model;i.change(o=>{o.setSelection(null),o.removeSelectionAttribute(i.document.selection.getAttributeKeys())});for(const[o,n]of t.domRoots){const a=D(e.data.get({rootName:o})),d=m(n.ownerDocument,"textarea",{rows:"1","aria-label":"Source code editing area"}),u=m(n.ownerDocument,"div",{class:"ck-source-editing-area","data-value":a},[d]);d.value=a,d.setSelectionRange(0,0),d.addEventListener("input",()=>{u.dataset.value=d.value,e.ui.update()}),t.change(g=>{const f=t.document.getRoot(o);g.addClass("ck-hidden",f)}),e.ui.setEditableElement("sourceEditing:"+o,d),this._replacedRoots.set(o,u),this._elementReplacer.replace(n,u),this._dataFromRoots.set(o,a)}this._hideDocumentOutline(),this._refreshAnnotationsVisibility(),this._focusSourceEditing()}_hideSourceEditing(){const t=this.editor.editing.view;this.updateEditorData(),t.change(i=>{for(const[o]of this._replacedRoots)i.removeClass("ck-hidden",t.document.getRoot(o))}),this._elementReplacer.restore(),this._replacedRoots.clear(),this._dataFromRoots.clear(),this._showDocumentOutline(),this._refreshAnnotationsVisibility(),t.focus()}_hideDocumentOutline(){this.editor.plugins.has("DocumentOutlineUI")&&(this.editor.plugins.get("DocumentOutlineUI").view.element.style.display="none")}_showDocumentOutline(){this.editor.plugins.has("DocumentOutlineUI")&&(this.editor.plugins.get("DocumentOutlineUI").view.element.style.display="")}_refreshAnnotationsVisibility(){this.editor.plugins.has("Annotations")&&this.editor.plugins.get("Annotations").refreshVisibility()}_focusSourceEditing(){const e=this.editor,[t]=this._replacedRoots.values(),i=t.querySelector("textarea");e.editing.view.document.isFocused=!1,i.focus()}_disableCommands(){const e=this.editor;for(const t of e.commands.commands())t.forceDisabled(l);e.plugins.has("CommentsArchiveUI")&&e.plugins.get("CommentsArchiveUI").forceDisabled(l)}_enableCommands(){const e=this.editor;for(const t of e.commands.commands())t.clearForceDisabled(l);e.plugins.has("CommentsArchiveUI")&&e.plugins.get("CommentsArchiveUI").clearForceDisabled(l)}_handleReadOnlyMode(e){if(this.isSourceEditingMode)for(const[,t]of this._replacedRoots)t.querySelector("textarea").readOnly=e}_isAllowedToHandleSourceEditingMode(){const t=this.editor.ui.view.editable;return t&&!t.hasExternalElement}_hideVisibleDialog(){if(this.editor.plugins.has("Dialog")){const e=this.editor.plugins.get("Dialog");e.isOpen&&e.hide()}}_createButton(e){const t=this.editor,i=new e(t.locale);return i.set({withText:!0,isToggleable:!0}),i.bind("isOn").to(this,"isSourceEditingMode"),i.bind("isEnabled").to(this,"isEnabled",t,"isReadOnly",t.plugins.get(h),"hasAny",(o,n,a)=>!(!o||n||a)),this.listenTo(i,"execute",()=>{this.isSourceEditingMode=!this.isSourceEditingMode}),i}}function D(s){return C(s)?v(s):s}function C(s){return s.startsWith("<")}export{I as SourceEditing};
4
+ */const d="SourceEditingMode";class M extends g{static get pluginName(){return"SourceEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[l]}_elementReplacer;_replacedRoots;_dataFromRoots;constructor(e){super(e),this.set("isSourceEditingMode",!1),this._elementReplacer=new b,this._replacedRoots=new Map,this._dataFromRoots=new Map,e.config.define("sourceEditing.allowCollaborationFeatures",!1)}init(){this._checkCompatibility();const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("sourceEditing",()=>{const i=this._createButton(p);return i.set({label:t("Source"),icon:f,tooltip:!0,class:"ck-source-editing-button"}),i}),e.ui.componentFactory.add("menuBar:sourceEditing",()=>{const i=this._createButton(E);return i.set({label:t("Show source"),role:"menuitemcheckbox"}),i}),this._isAllowedToHandleSourceEditingMode()&&(this.on("change:isSourceEditingMode",(i,o,n)=>{n?(this._hideVisibleDialog(),this._showSourceEditing(),this._disableCommands()):(this._hideSourceEditing(),this._enableCommands())}),this.on("change:isEnabled",(i,o,n)=>this._handleReadOnlyMode(!n)),this.listenTo(e,"change:isReadOnly",(i,o,n)=>this._handleReadOnlyMode(n))),e.data.on("get",()=>{this.isSourceEditingMode&&this.updateEditorData()},{priority:"high"})}updateEditorData(){const e=this.editor,t={};for(const[i,o]of this._replacedRoots){const n=this._dataFromRoots.get(i),s=o.dataset.value;n!==s&&(t[i]=s,this._dataFromRoots.set(i,s))}Object.keys(t).length&&e.data.set(t,{batchType:{isUndoable:!0},suppressErrorInCollaboration:!0})}_checkCompatibility(){const e=this.editor,t=e.config.get("sourceEditing.allowCollaborationFeatures");if(!t&&e.plugins.has("RealTimeCollaborativeEditing"))throw new _("source-editing-incompatible-with-real-time-collaboration",null);!t&&["CommentsEditing","TrackChangesEditing","RevisionHistory"].some(o=>e.plugins.has(o))&&console.warn("You initialized the editor with the source editing feature and at least one of the collaboration features. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the collaboration features."),e.plugins.has("RestrictedEditingModeEditing")&&console.warn("You initialized the editor with the source editing feature and restricted editing feature. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the restricted editing feature.")}_showSourceEditing(){const e=this.editor,t=e.editing.view,i=e.model;i.change(o=>{o.setSelection(null),o.removeSelectionAttribute(i.document.selection.getAttributeKeys())});for(const[o,n]of t.domRoots){const s=R(e.data.get({rootName:o})),r=u(n.ownerDocument,"textarea",{rows:"1","aria-label":"Source code editing area"}),c=u(n.ownerDocument,"div",{class:"ck-source-editing-area","data-value":s},[r]);r.value=s,r.setSelectionRange(0,0),r.addEventListener("input",()=>{c.dataset.value=r.value,e.ui.update()}),t.change(h=>{const m=t.document.getRoot(o);h.addClass("ck-hidden",m)}),e.ui.setEditableElement("sourceEditing:"+o,r),this._replacedRoots.set(o,c),this._elementReplacer.replace(n,c),this._dataFromRoots.set(o,s)}this._hideDocumentOutline(),this._refreshAnnotationsVisibility(),this._focusSourceEditing()}_hideSourceEditing(){const t=this.editor.editing.view;this.updateEditorData(),t.change(i=>{for(const[o]of this._replacedRoots)i.removeClass("ck-hidden",t.document.getRoot(o))}),this._elementReplacer.restore(),this._replacedRoots.clear(),this._dataFromRoots.clear(),this._showDocumentOutline(),this._refreshAnnotationsVisibility(),t.focus()}_hideDocumentOutline(){this.editor.plugins.has("DocumentOutlineUI")&&(this.editor.plugins.get("DocumentOutlineUI").view.element.style.display="none")}_showDocumentOutline(){this.editor.plugins.has("DocumentOutlineUI")&&(this.editor.plugins.get("DocumentOutlineUI").view.element.style.display="")}_refreshAnnotationsVisibility(){this.editor.plugins.has("Annotations")&&this.editor.plugins.get("Annotations").refreshVisibility()}_focusSourceEditing(){const e=this.editor,[t]=this._replacedRoots.values(),i=t.querySelector("textarea");e.editing.view.document.isFocused=!1,i.focus()}_disableCommands(){const e=this.editor;for(const t of e.commands.commands())t.forceDisabled(d);e.plugins.has("CommentsArchiveUI")&&e.plugins.get("CommentsArchiveUI").forceDisabled(d)}_enableCommands(){const e=this.editor;for(const t of e.commands.commands())t.clearForceDisabled(d);e.plugins.has("CommentsArchiveUI")&&e.plugins.get("CommentsArchiveUI").clearForceDisabled(d)}_handleReadOnlyMode(e){if(this.isSourceEditingMode)for(const[,t]of this._replacedRoots)t.querySelector("textarea").readOnly=e}_isAllowedToHandleSourceEditingMode(){const t=this.editor.ui.view.editable;return t&&!t.hasExternalElement}_hideVisibleDialog(){if(this.editor.plugins.has("Dialog")){const e=this.editor.plugins.get("Dialog");e.isOpen&&e.hide()}}_createButton(e){const t=this.editor,i=new e(t.locale);return i.set({withText:!0,isToggleable:!0}),i.bind("isOn").to(this,"isSourceEditingMode"),i.bind("isEnabled").to(this,"isEnabled",t,"isReadOnly",t.plugins.get(l),"hasAny",(o,n,s)=>!(!o||n||s)),this.listenTo(i,"execute",()=>{this.isSourceEditingMode=!this.isSourceEditingMode}),i}}function R(a){return S(a)?w(a):a}function S(a){return a.startsWith("<")}export{M as SourceEditing};
@@ -1,4 +1,4 @@
1
- var k=Object.defineProperty;var C=(c,i,t)=>i in c?k(c,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[i]=t;var s=(c,i,t)=>C(c,typeof i!="symbol"?i+"":i,t);import{Plugin as u}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Typing as _}from"../../../../../@ckeditor_ckeditor5-typing@45.2.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{IconSpecialCharacters as y}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{Dialog as x,ButtonView as m,MenuBarMenuListItemButtonView as v,DialogViewPosition as T,View as d,LabeledFieldView as V,createLabeledDropdown as S,ViewModel as D,addListToDropdown as P,addKeyboardHandlingForGrid as G,FocusCycler as q}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{CKEditorError as p,Collection as N,FocusTracker as L,KeystrokeHandler as f,global as I}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";/**
1
+ import{Plugin as o}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Typing as f}from"../../../../../@ckeditor_ckeditor5-typing@45.2.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{IconSpecialCharacters as b}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{Dialog as k,ButtonView as g,MenuBarMenuListItemButtonView as C,DialogViewPosition as _,View as h,LabeledFieldView as y,createLabeledDropdown as x,ViewModel as v,addListToDropdown as T,addKeyboardHandlingForGrid as V,FocusCycler as S}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{CKEditorError as w,Collection as D,FocusTracker as p,KeystrokeHandler as m,global as P}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";/**
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */class A extends d{constructor(t){super(t);s(this,"tiles");s(this,"focusTracker");s(this,"keystrokes");this.tiles=this.createCollection(),this.setTemplate({tag:"div",children:[{tag:"div",attributes:{class:["ck","ck-character-grid__tiles"]},children:this.tiles}],attributes:{class:["ck","ck-character-grid"]}}),this.focusTracker=new L,this.keystrokes=new f,G({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.tiles,numberOfColumns:()=>I.window.getComputedStyle(this.element.firstChild).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}createTile(t,e){const a=new m(this.locale);return a.set({label:t,withText:!0,class:"ck-character-grid__tile"}),a.extendTemplate({attributes:{title:e},on:{mouseover:a.bindTemplate.to("mouseover"),focus:a.bindTemplate.to("focus")}}),a.on("mouseover",()=>{this.fire("tileHover",{name:e,character:t})}),a.on("focus",()=>{this.fire("tileFocus",{name:e,character:t})}),a.on("execute",()=>{this.fire("execute",{name:e,character:t})}),a}render(){super.render();for(const t of this.tiles)this.focusTracker.add(t.element);this.tiles.on("change",(t,{added:e,removed:a})=>{if(e.length>0)for(const r of e)this.focusTracker.add(r.element);if(a.length>0)for(const r of a)this.focusTracker.remove(r.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.keystrokes.destroy()}focus(){this.tiles.first.focus()}}class E extends d{constructor(i){super(i);const t=this.bindTemplate;this.set("character",null),this.set("name",null),this.bind("code").to(this,"character",M),this.setTemplate({tag:"div",children:[{tag:"span",attributes:{class:["ck-character-info__name"]},children:[{text:t.to("name",e=>e||"​")}]},{tag:"span",attributes:{class:["ck-character-info__code"]},children:[{text:t.to("code")}]}],attributes:{class:["ck","ck-character-info"]}})}}function M(c){return c===null?"":"U+"+("0000"+c.codePointAt(0).toString(16)).slice(-4)}class O extends d{constructor(t,e,a,r){super(t);s(this,"items");s(this,"focusTracker");s(this,"keystrokes");s(this,"_focusCycler");s(this,"categoriesView");s(this,"gridView");s(this,"infoView");this.categoriesView=e,this.gridView=a,this.infoView=r,this.items=this.createCollection(),this.focusTracker=new L,this.keystrokes=new f,this._focusCycler=new q({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",children:[this.categoriesView,this.gridView,this.infoView],attributes:{tabindex:"-1"}}),this.items.add(this.categoriesView),this.items.add(this.gridView)}render(){super.render(),this.focusTracker.add(this.categoriesView.element),this.focusTracker.add(this.gridView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}class F extends d{constructor(t,e){super(t);s(this,"_groupNames");s(this,"_dropdownView");this.set("currentGroupName",Array.from(e.entries())[0][0]),this._groupNames=e,this._dropdownView=new V(t,S),this.setTemplate({tag:"div",attributes:{class:["ck","ck-character-categories"]},children:[this._dropdownView]})}render(){super.render(),this._setupDropdown()}focus(){this._dropdownView.focus()}_setupDropdown(){const t=new N;for(const[r,l]of this._groupNames){const o={type:"button",model:new D({name:r,label:l,role:"menuitemradio",withText:!0})};o.model.bind("isOn").to(this,"currentGroupName",n=>n===r),t.add(o)}const e=this.locale.t,a=e("Category");this._dropdownView.set({label:a,isEmpty:!1}),this._dropdownView.fieldView.panelPosition=this.locale.uiLanguageDirection==="rtl"?"se":"sw",this._dropdownView.fieldView.buttonView.set({withText:!0,tooltip:a,ariaLabel:a,ariaLabelledBy:void 0,isOn:!1}),this._dropdownView.fieldView.buttonView.bind("label").to(this,"currentGroupName",r=>this._groupNames.get(r)),this._dropdownView.fieldView.on("execute",({source:r})=>{this.currentGroupName=r.name}),P(this._dropdownView.fieldView,t,{ariaLabel:a,role:"menu"})}}const w="All";class J extends u{constructor(t){super(t);s(this,"_characters");s(this,"_groups");s(this,"_allSpecialCharactersGroupLabel");const e=t.t;this._characters=new Map,this._groups=new Map,this._allSpecialCharactersGroupLabel=e("All")}static get requires(){return[_,x]}static get pluginName(){return"SpecialCharacters"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.ui.componentFactory.add("specialCharacters",()=>{const e=this._createDialogButton(m);return e.set({tooltip:!0}),e}),t.ui.componentFactory.add("menuBar:specialCharacters",()=>this._createDialogButton(v))}addItems(t,e,a={label:t}){if(t===w)throw new p("special-character-invalid-group-name",null);const r=this._getGroup(t,a.label);for(const l of e)r.items.add(l.title),this._characters.set(l.title,l.character)}getGroups(){const t=Array.from(this._groups.keys()),e=this.editor.config.get("specialCharacters.order")||[],a=e.find(r=>!t.includes(r));if(a)throw new p("special-character-invalid-order-group-name",null,{invalidGroup:a});return new Set([...e,...t])}getCharactersForGroup(t){if(t===w)return new Set(this._characters.keys());const e=this._groups.get(t);if(e)return e.items}getCharacter(t){return this._characters.get(t)}_getGroup(t,e){return this._groups.has(t)||this._groups.set(t,{items:new Set,label:e}),this._groups.get(t)}_updateGrid(t,e){e.tiles.clear();const a=this.getCharactersForGroup(t);for(const r of a){const l=this.getCharacter(r);e.tiles.add(e.createTile(l,r))}}_createDropdownPanelContent(t){const e=Array.from(this.getGroups()).map(n=>[n,this._groups.get(n).label]),a=new Map([[w,this._allSpecialCharactersGroupLabel],...e]),r=new F(t,a),l=new A(t),o=new E(t);return l.on("tileHover",(n,h)=>{o.set(h)}),l.on("tileFocus",(n,h)=>{o.set(h)}),r.on("change:currentGroupName",(n,h,g)=>{this._updateGrid(g,l)}),this._updateGrid(r.currentGroupName,l),{categoriesView:r,gridView:l,infoView:o}}_createDialogButton(t){const e=this.editor,a=e.locale,r=new t(e.locale),l=e.commands.get("insertText"),o=a.t,n=this.editor.plugins.get("Dialog");return r.set({label:o("Special characters"),icon:y,isToggleable:!0}),r.bind("isOn").to(n,"id",h=>h==="specialCharacters"),r.bind("isEnabled").to(l,"isEnabled"),r.on("execute",()=>{if(n.id==="specialCharacters"){n.hide();return}this._showDialog()}),r}_showDialog(){const t=this.editor,e=t.plugins.get("Dialog"),a=t.locale,r=a.t,{categoriesView:l,gridView:o,infoView:n}=this._createDropdownPanelContent(a),h=new O(a,l,o,n);o.on("execute",(g,b)=>{t.execute("insertText",{text:b.character})}),e.show({id:"specialCharacters",title:r("Special characters"),className:"ck-special-characters",content:h,position:T.EDITOR_TOP_SIDE})}}class R extends u{static get pluginName(){return"SpecialCharactersArrows"}static get isOfficialPlugin(){return!0}init(){const i=this.editor,t=i.t;i.plugins.get("SpecialCharacters").addItems("Arrows",[{title:t("leftwards simple arrow"),character:"←"},{title:t("rightwards simple arrow"),character:"→"},{title:t("upwards simple arrow"),character:"↑"},{title:t("downwards simple arrow"),character:"↓"},{title:t("leftwards double arrow"),character:"⇐"},{title:t("rightwards double arrow"),character:"⇒"},{title:t("upwards double arrow"),character:"⇑"},{title:t("downwards double arrow"),character:"⇓"},{title:t("leftwards dashed arrow"),character:"⇠"},{title:t("rightwards dashed arrow"),character:"⇢"},{title:t("upwards dashed arrow"),character:"⇡"},{title:t("downwards dashed arrow"),character:"⇣"},{title:t("leftwards arrow to bar"),character:"⇤"},{title:t("rightwards arrow to bar"),character:"⇥"},{title:t("upwards arrow to bar"),character:"⤒"},{title:t("downwards arrow to bar"),character:"⤓"},{title:t("up down arrow with base"),character:"↨"},{title:t("back with leftwards arrow above"),character:"🔙"},{title:t("end with leftwards arrow above"),character:"🔚"},{title:t("on with exclamation mark with left right arrow above"),character:"🔛"},{title:t("soon with rightwards arrow above"),character:"🔜"},{title:t("top with upwards arrow above"),character:"🔝"}],{label:t("Arrows")})}}class B extends u{static get pluginName(){return"SpecialCharactersText"}static get isOfficialPlugin(){return!0}init(){const i=this.editor,t=i.t;i.plugins.get("SpecialCharacters").addItems("Text",[{character:"‹",title:t("Single left-pointing angle quotation mark")},{character:"›",title:t("Single right-pointing angle quotation mark")},{character:"«",title:t("Left-pointing double angle quotation mark")},{character:"»",title:t("Right-pointing double angle quotation mark")},{character:"‘",title:t("Left single quotation mark")},{character:"’",title:t("Right single quotation mark")},{character:"“",title:t("Left double quotation mark")},{character:"”",title:t("Right double quotation mark")},{character:"‚",title:t("Single low-9 quotation mark")},{character:"„",title:t("Double low-9 quotation mark")},{character:"¡",title:t("Inverted exclamation mark")},{character:"¿",title:t("Inverted question mark")},{character:"‥",title:t("Two dot leader")},{character:"…",title:t("Horizontal ellipsis")},{character:"‡",title:t("Double dagger")},{character:"‰",title:t("Per mille sign")},{character:"‱",title:t("Per ten thousand sign")},{character:"‼",title:t("Double exclamation mark")},{character:"⁈",title:t("Question exclamation mark")},{character:"⁉",title:t("Exclamation question mark")},{character:"⁇",title:t("Double question mark")},{character:"©",title:t("Copyright sign")},{character:"®",title:t("Registered sign")},{character:"™",title:t("Trade mark sign")},{character:"§",title:t("Section sign")},{character:"¶",title:t("Paragraph sign")},{character:"⁋",title:t("Reversed paragraph sign")}],{label:t("Text")})}}class H extends u{static get pluginName(){return"SpecialCharactersMathematical"}static get isOfficialPlugin(){return!0}init(){const i=this.editor,t=i.t;i.plugins.get("SpecialCharacters").addItems("Mathematical",[{character:"<",title:t("Less-than sign")},{character:">",title:t("Greater-than sign")},{character:"≤",title:t("Less-than or equal to")},{character:"≥",title:t("Greater-than or equal to")},{character:"–",title:t("En dash")},{character:"—",title:t("Em dash")},{character:"¯",title:t("Macron")},{character:"‾",title:t("Overline")},{character:"°",title:t("Degree sign")},{character:"−",title:t("Minus sign")},{character:"±",title:t("Plus-minus sign")},{character:"÷",title:t("Division sign")},{character:"⁄",title:t("Fraction slash")},{character:"×",title:t("Multiplication sign")},{character:"ƒ",title:t("Latin small letter f with hook")},{character:"∫",title:t("Integral")},{character:"∑",title:t("N-ary summation")},{character:"∞",title:t("Infinity")},{character:"√",title:t("Square root")},{character:"∼",title:t("Tilde operator")},{character:"≅",title:t("Approximately equal to")},{character:"≈",title:t("Almost equal to")},{character:"≠",title:t("Not equal to")},{character:"≡",title:t("Identical to")},{character:"∈",title:t("Element of")},{character:"∉",title:t("Not an element of")},{character:"∋",title:t("Contains as member")},{character:"∏",title:t("N-ary product")},{character:"∧",title:t("Logical and")},{character:"∨",title:t("Logical or")},{character:"¬",title:t("Not sign")},{character:"∩",title:t("Intersection")},{character:"∪",title:t("Union")},{character:"∂",title:t("Partial differential")},{character:"∀",title:t("For all")},{character:"∃",title:t("There exists")},{character:"∅",title:t("Empty set")},{character:"∇",title:t("Nabla")},{character:"∗",title:t("Asterisk operator")},{character:"∝",title:t("Proportional to")},{character:"∠",title:t("Angle")},{character:"¼",title:t("Vulgar fraction one quarter")},{character:"½",title:t("Vulgar fraction one half")},{character:"¾",title:t("Vulgar fraction three quarters")}],{label:t("Mathematical")})}}class z extends u{static get pluginName(){return"SpecialCharactersLatin"}static get isOfficialPlugin(){return!0}init(){const i=this.editor,t=i.t;i.plugins.get("SpecialCharacters").addItems("Latin",[{character:"Ā",title:t("Latin capital letter a with macron")},{character:"ā",title:t("Latin small letter a with macron")},{character:"Ă",title:t("Latin capital letter a with breve")},{character:"ă",title:t("Latin small letter a with breve")},{character:"Ą",title:t("Latin capital letter a with ogonek")},{character:"ą",title:t("Latin small letter a with ogonek")},{character:"Ć",title:t("Latin capital letter c with acute")},{character:"ć",title:t("Latin small letter c with acute")},{character:"Ĉ",title:t("Latin capital letter c with circumflex")},{character:"ĉ",title:t("Latin small letter c with circumflex")},{character:"Ċ",title:t("Latin capital letter c with dot above")},{character:"ċ",title:t("Latin small letter c with dot above")},{character:"Č",title:t("Latin capital letter c with caron")},{character:"č",title:t("Latin small letter c with caron")},{character:"Ď",title:t("Latin capital letter d with caron")},{character:"ď",title:t("Latin small letter d with caron")},{character:"Đ",title:t("Latin capital letter d with stroke")},{character:"đ",title:t("Latin small letter d with stroke")},{character:"Ē",title:t("Latin capital letter e with macron")},{character:"ē",title:t("Latin small letter e with macron")},{character:"Ĕ",title:t("Latin capital letter e with breve")},{character:"ĕ",title:t("Latin small letter e with breve")},{character:"Ė",title:t("Latin capital letter e with dot above")},{character:"ė",title:t("Latin small letter e with dot above")},{character:"Ę",title:t("Latin capital letter e with ogonek")},{character:"ę",title:t("Latin small letter e with ogonek")},{character:"Ě",title:t("Latin capital letter e with caron")},{character:"ě",title:t("Latin small letter e with caron")},{character:"Ĝ",title:t("Latin capital letter g with circumflex")},{character:"ĝ",title:t("Latin small letter g with circumflex")},{character:"Ğ",title:t("Latin capital letter g with breve")},{character:"ğ",title:t("Latin small letter g with breve")},{character:"Ġ",title:t("Latin capital letter g with dot above")},{character:"ġ",title:t("Latin small letter g with dot above")},{character:"Ģ",title:t("Latin capital letter g with cedilla")},{character:"ģ",title:t("Latin small letter g with cedilla")},{character:"Ĥ",title:t("Latin capital letter h with circumflex")},{character:"ĥ",title:t("Latin small letter h with circumflex")},{character:"Ħ",title:t("Latin capital letter h with stroke")},{character:"ħ",title:t("Latin small letter h with stroke")},{character:"Ĩ",title:t("Latin capital letter i with tilde")},{character:"ĩ",title:t("Latin small letter i with tilde")},{character:"Ī",title:t("Latin capital letter i with macron")},{character:"ī",title:t("Latin small letter i with macron")},{character:"Ĭ",title:t("Latin capital letter i with breve")},{character:"ĭ",title:t("Latin small letter i with breve")},{character:"Į",title:t("Latin capital letter i with ogonek")},{character:"į",title:t("Latin small letter i with ogonek")},{character:"İ",title:t("Latin capital letter i with dot above")},{character:"ı",title:t("Latin small letter dotless i")},{character:"IJ",title:t("Latin capital ligature ij")},{character:"ij",title:t("Latin small ligature ij")},{character:"Ĵ",title:t("Latin capital letter j with circumflex")},{character:"ĵ",title:t("Latin small letter j with circumflex")},{character:"Ķ",title:t("Latin capital letter k with cedilla")},{character:"ķ",title:t("Latin small letter k with cedilla")},{character:"ĸ",title:t("Latin small letter kra")},{character:"Ĺ",title:t("Latin capital letter l with acute")},{character:"ĺ",title:t("Latin small letter l with acute")},{character:"Ļ",title:t("Latin capital letter l with cedilla")},{character:"ļ",title:t("Latin small letter l with cedilla")},{character:"Ľ",title:t("Latin capital letter l with caron")},{character:"ľ",title:t("Latin small letter l with caron")},{character:"Ŀ",title:t("Latin capital letter l with middle dot")},{character:"ŀ",title:t("Latin small letter l with middle dot")},{character:"Ł",title:t("Latin capital letter l with stroke")},{character:"ł",title:t("Latin small letter l with stroke")},{character:"Ń",title:t("Latin capital letter n with acute")},{character:"ń",title:t("Latin small letter n with acute")},{character:"Ņ",title:t("Latin capital letter n with cedilla")},{character:"ņ",title:t("Latin small letter n with cedilla")},{character:"Ň",title:t("Latin capital letter n with caron")},{character:"ň",title:t("Latin small letter n with caron")},{character:"ʼn",title:t("Latin small letter n preceded by apostrophe")},{character:"Ŋ",title:t("Latin capital letter eng")},{character:"ŋ",title:t("Latin small letter eng")},{character:"Ō",title:t("Latin capital letter o with macron")},{character:"ō",title:t("Latin small letter o with macron")},{character:"Ŏ",title:t("Latin capital letter o with breve")},{character:"ŏ",title:t("Latin small letter o with breve")},{character:"Ő",title:t("Latin capital letter o with double acute")},{character:"ő",title:t("Latin small letter o with double acute")},{character:"Œ",title:t("Latin capital ligature oe")},{character:"œ",title:t("Latin small ligature oe")},{character:"Ŕ",title:t("Latin capital letter r with acute")},{character:"ŕ",title:t("Latin small letter r with acute")},{character:"Ŗ",title:t("Latin capital letter r with cedilla")},{character:"ŗ",title:t("Latin small letter r with cedilla")},{character:"Ř",title:t("Latin capital letter r with caron")},{character:"ř",title:t("Latin small letter r with caron")},{character:"Ś",title:t("Latin capital letter s with acute")},{character:"ś",title:t("Latin small letter s with acute")},{character:"Ŝ",title:t("Latin capital letter s with circumflex")},{character:"ŝ",title:t("Latin small letter s with circumflex")},{character:"Ş",title:t("Latin capital letter s with cedilla")},{character:"ş",title:t("Latin small letter s with cedilla")},{character:"Š",title:t("Latin capital letter s with caron")},{character:"š",title:t("Latin small letter s with caron")},{character:"Ţ",title:t("Latin capital letter t with cedilla")},{character:"ţ",title:t("Latin small letter t with cedilla")},{character:"Ť",title:t("Latin capital letter t with caron")},{character:"ť",title:t("Latin small letter t with caron")},{character:"Ŧ",title:t("Latin capital letter t with stroke")},{character:"ŧ",title:t("Latin small letter t with stroke")},{character:"Ũ",title:t("Latin capital letter u with tilde")},{character:"ũ",title:t("Latin small letter u with tilde")},{character:"Ū",title:t("Latin capital letter u with macron")},{character:"ū",title:t("Latin small letter u with macron")},{character:"Ŭ",title:t("Latin capital letter u with breve")},{character:"ŭ",title:t("Latin small letter u with breve")},{character:"Ů",title:t("Latin capital letter u with ring above")},{character:"ů",title:t("Latin small letter u with ring above")},{character:"Ű",title:t("Latin capital letter u with double acute")},{character:"ű",title:t("Latin small letter u with double acute")},{character:"Ų",title:t("Latin capital letter u with ogonek")},{character:"ų",title:t("Latin small letter u with ogonek")},{character:"Ŵ",title:t("Latin capital letter w with circumflex")},{character:"ŵ",title:t("Latin small letter w with circumflex")},{character:"Ŷ",title:t("Latin capital letter y with circumflex")},{character:"ŷ",title:t("Latin small letter y with circumflex")},{character:"Ÿ",title:t("Latin capital letter y with diaeresis")},{character:"Ź",title:t("Latin capital letter z with acute")},{character:"ź",title:t("Latin small letter z with acute")},{character:"Ż",title:t("Latin capital letter z with dot above")},{character:"ż",title:t("Latin small letter z with dot above")},{character:"Ž",title:t("Latin capital letter z with caron")},{character:"ž",title:t("Latin small letter z with caron")},{character:"ſ",title:t("Latin small letter long s")}],{label:t("Latin")})}}class j extends u{static get pluginName(){return"SpecialCharactersCurrency"}static get isOfficialPlugin(){return!0}init(){const i=this.editor,t=i.t;i.plugins.get("SpecialCharacters").addItems("Currency",[{character:"$",title:t("Dollar sign")},{character:"€",title:t("Euro sign")},{character:"¥",title:t("Yen sign")},{character:"£",title:t("Pound sign")},{character:"¢",title:t("Cent sign")},{character:"₠",title:t("Euro-currency sign")},{character:"₡",title:t("Colon sign")},{character:"₢",title:t("Cruzeiro sign")},{character:"₣",title:t("French franc sign")},{character:"₤",title:t("Lira sign")},{character:"¤",title:t("Currency sign")},{character:"₿",title:t("Bitcoin sign")},{character:"₥",title:t("Mill sign")},{character:"₦",title:t("Naira sign")},{character:"₧",title:t("Peseta sign")},{character:"₨",title:t("Rupee sign")},{character:"₩",title:t("Won sign")},{character:"₪",title:t("New sheqel sign")},{character:"₫",title:t("Dong sign")},{character:"₭",title:t("Kip sign")},{character:"₮",title:t("Tugrik sign")},{character:"₯",title:t("Drachma sign")},{character:"₰",title:t("German penny sign")},{character:"₱",title:t("Peso sign")},{character:"₲",title:t("Guarani sign")},{character:"₳",title:t("Austral sign")},{character:"₴",title:t("Hryvnia sign")},{character:"₵",title:t("Cedi sign")},{character:"₶",title:t("Livre tournois sign")},{character:"₷",title:t("Spesmilo sign")},{character:"₸",title:t("Tenge sign")},{character:"₹",title:t("Indian rupee sign")},{character:"₺",title:t("Turkish lira sign")},{character:"₻",title:t("Nordic mark sign")},{character:"₼",title:t("Manat sign")},{character:"₽",title:t("Ruble sign")}],{label:t("Currency")})}}class X extends u{static get pluginName(){return"SpecialCharactersEssentials"}static get isOfficialPlugin(){return!0}static get requires(){return[j,B,H,R,z]}}export{J as SpecialCharacters,R as SpecialCharactersArrows,j as SpecialCharactersCurrency,X as SpecialCharactersEssentials,z as SpecialCharactersLatin,H as SpecialCharactersMathematical,B as SpecialCharactersText};
4
+ */class G extends h{tiles;focusTracker;keystrokes;constructor(e){super(e),this.tiles=this.createCollection(),this.setTemplate({tag:"div",children:[{tag:"div",attributes:{class:["ck","ck-character-grid__tiles"]},children:this.tiles}],attributes:{class:["ck","ck-character-grid"]}}),this.focusTracker=new p,this.keystrokes=new m,V({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.tiles,numberOfColumns:()=>P.window.getComputedStyle(this.element.firstChild).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}createTile(e,t){const a=new g(this.locale);return a.set({label:e,withText:!0,class:"ck-character-grid__tile"}),a.extendTemplate({attributes:{title:t},on:{mouseover:a.bindTemplate.to("mouseover"),focus:a.bindTemplate.to("focus")}}),a.on("mouseover",()=>{this.fire("tileHover",{name:t,character:e})}),a.on("focus",()=>{this.fire("tileFocus",{name:t,character:e})}),a.on("execute",()=>{this.fire("execute",{name:t,character:e})}),a}render(){super.render();for(const e of this.tiles)this.focusTracker.add(e.element);this.tiles.on("change",(e,{added:t,removed:a})=>{if(t.length>0)for(const r of t)this.focusTracker.add(r.element);if(a.length>0)for(const r of a)this.focusTracker.remove(r.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.keystrokes.destroy()}focus(){this.tiles.first.focus()}}class q extends h{constructor(e){super(e);const t=this.bindTemplate;this.set("character",null),this.set("name",null),this.bind("code").to(this,"character",N),this.setTemplate({tag:"div",children:[{tag:"span",attributes:{class:["ck-character-info__name"]},children:[{text:t.to("name",a=>a||"​")}]},{tag:"span",attributes:{class:["ck-character-info__code"]},children:[{text:t.to("code")}]}],attributes:{class:["ck","ck-character-info"]}})}}function N(c){return c===null?"":"U+"+("0000"+c.codePointAt(0).toString(16)).slice(-4)}class I extends h{items;focusTracker;keystrokes;_focusCycler;categoriesView;gridView;infoView;constructor(e,t,a,r){super(e),this.categoriesView=t,this.gridView=a,this.infoView=r,this.items=this.createCollection(),this.focusTracker=new p,this.keystrokes=new m,this._focusCycler=new S({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",children:[this.categoriesView,this.gridView,this.infoView],attributes:{tabindex:"-1"}}),this.items.add(this.categoriesView),this.items.add(this.gridView)}render(){super.render(),this.focusTracker.add(this.categoriesView.element),this.focusTracker.add(this.gridView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}class A extends h{_groupNames;_dropdownView;constructor(e,t){super(e),this.set("currentGroupName",Array.from(t.entries())[0][0]),this._groupNames=t,this._dropdownView=new y(e,x),this.setTemplate({tag:"div",attributes:{class:["ck","ck-character-categories"]},children:[this._dropdownView]})}render(){super.render(),this._setupDropdown()}focus(){this._dropdownView.focus()}_setupDropdown(){const e=new D;for(const[r,i]of this._groupNames){const s={type:"button",model:new v({name:r,label:i,role:"menuitemradio",withText:!0})};s.model.bind("isOn").to(this,"currentGroupName",l=>l===r),e.add(s)}const t=this.locale.t,a=t("Category");this._dropdownView.set({label:a,isEmpty:!1}),this._dropdownView.fieldView.panelPosition=this.locale.uiLanguageDirection==="rtl"?"se":"sw",this._dropdownView.fieldView.buttonView.set({withText:!0,tooltip:a,ariaLabel:a,ariaLabelledBy:void 0,isOn:!1}),this._dropdownView.fieldView.buttonView.bind("label").to(this,"currentGroupName",r=>this._groupNames.get(r)),this._dropdownView.fieldView.on("execute",({source:r})=>{this.currentGroupName=r.name}),T(this._dropdownView.fieldView,e,{ariaLabel:a,role:"menu"})}}const u="All";class U extends o{_characters;_groups;_allSpecialCharactersGroupLabel;static get requires(){return[f,k]}static get pluginName(){return"SpecialCharacters"}static get isOfficialPlugin(){return!0}constructor(e){super(e);const t=e.t;this._characters=new Map,this._groups=new Map,this._allSpecialCharactersGroupLabel=t("All")}init(){const e=this.editor;e.ui.componentFactory.add("specialCharacters",()=>{const t=this._createDialogButton(g);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:specialCharacters",()=>this._createDialogButton(C))}addItems(e,t,a={label:e}){if(e===u)throw new w("special-character-invalid-group-name",null);const r=this._getGroup(e,a.label);for(const i of t)r.items.add(i.title),this._characters.set(i.title,i.character)}getGroups(){const e=Array.from(this._groups.keys()),t=this.editor.config.get("specialCharacters.order")||[],a=t.find(r=>!e.includes(r));if(a)throw new w("special-character-invalid-order-group-name",null,{invalidGroup:a});return new Set([...t,...e])}getCharactersForGroup(e){if(e===u)return new Set(this._characters.keys());const t=this._groups.get(e);if(t)return t.items}getCharacter(e){return this._characters.get(e)}_getGroup(e,t){return this._groups.has(e)||this._groups.set(e,{items:new Set,label:t}),this._groups.get(e)}_updateGrid(e,t){t.tiles.clear();const a=this.getCharactersForGroup(e);for(const r of a){const i=this.getCharacter(r);t.tiles.add(t.createTile(i,r))}}_createDropdownPanelContent(e){const t=Array.from(this.getGroups()).map(l=>[l,this._groups.get(l).label]),a=new Map([[u,this._allSpecialCharactersGroupLabel],...t]),r=new A(e,a),i=new G(e),s=new q(e);return i.on("tileHover",(l,n)=>{s.set(n)}),i.on("tileFocus",(l,n)=>{s.set(n)}),r.on("change:currentGroupName",(l,n,d)=>{this._updateGrid(d,i)}),this._updateGrid(r.currentGroupName,i),{categoriesView:r,gridView:i,infoView:s}}_createDialogButton(e){const t=this.editor,a=t.locale,r=new e(t.locale),i=t.commands.get("insertText"),s=a.t,l=this.editor.plugins.get("Dialog");return r.set({label:s("Special characters"),icon:b,isToggleable:!0}),r.bind("isOn").to(l,"id",n=>n==="specialCharacters"),r.bind("isEnabled").to(i,"isEnabled"),r.on("execute",()=>{if(l.id==="specialCharacters"){l.hide();return}this._showDialog()}),r}_showDialog(){const e=this.editor,t=e.plugins.get("Dialog"),a=e.locale,r=a.t,{categoriesView:i,gridView:s,infoView:l}=this._createDropdownPanelContent(a),n=new I(a,i,s,l);s.on("execute",(d,L)=>{e.execute("insertText",{text:L.character})}),t.show({id:"specialCharacters",title:r("Special characters"),className:"ck-special-characters",content:n,position:_.EDITOR_TOP_SIDE})}}class E extends o{static get pluginName(){return"SpecialCharactersArrows"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Arrows",[{title:t("leftwards simple arrow"),character:"←"},{title:t("rightwards simple arrow"),character:"→"},{title:t("upwards simple arrow"),character:"↑"},{title:t("downwards simple arrow"),character:"↓"},{title:t("leftwards double arrow"),character:"⇐"},{title:t("rightwards double arrow"),character:"⇒"},{title:t("upwards double arrow"),character:"⇑"},{title:t("downwards double arrow"),character:"⇓"},{title:t("leftwards dashed arrow"),character:"⇠"},{title:t("rightwards dashed arrow"),character:"⇢"},{title:t("upwards dashed arrow"),character:"⇡"},{title:t("downwards dashed arrow"),character:"⇣"},{title:t("leftwards arrow to bar"),character:"⇤"},{title:t("rightwards arrow to bar"),character:"⇥"},{title:t("upwards arrow to bar"),character:"⤒"},{title:t("downwards arrow to bar"),character:"⤓"},{title:t("up down arrow with base"),character:"↨"},{title:t("back with leftwards arrow above"),character:"🔙"},{title:t("end with leftwards arrow above"),character:"🔚"},{title:t("on with exclamation mark with left right arrow above"),character:"🔛"},{title:t("soon with rightwards arrow above"),character:"🔜"},{title:t("top with upwards arrow above"),character:"🔝"}],{label:t("Arrows")})}}class M extends o{static get pluginName(){return"SpecialCharactersText"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Text",[{character:"‹",title:t("Single left-pointing angle quotation mark")},{character:"›",title:t("Single right-pointing angle quotation mark")},{character:"«",title:t("Left-pointing double angle quotation mark")},{character:"»",title:t("Right-pointing double angle quotation mark")},{character:"‘",title:t("Left single quotation mark")},{character:"’",title:t("Right single quotation mark")},{character:"“",title:t("Left double quotation mark")},{character:"”",title:t("Right double quotation mark")},{character:"‚",title:t("Single low-9 quotation mark")},{character:"„",title:t("Double low-9 quotation mark")},{character:"¡",title:t("Inverted exclamation mark")},{character:"¿",title:t("Inverted question mark")},{character:"‥",title:t("Two dot leader")},{character:"…",title:t("Horizontal ellipsis")},{character:"‡",title:t("Double dagger")},{character:"‰",title:t("Per mille sign")},{character:"‱",title:t("Per ten thousand sign")},{character:"‼",title:t("Double exclamation mark")},{character:"⁈",title:t("Question exclamation mark")},{character:"⁉",title:t("Exclamation question mark")},{character:"⁇",title:t("Double question mark")},{character:"©",title:t("Copyright sign")},{character:"®",title:t("Registered sign")},{character:"™",title:t("Trade mark sign")},{character:"§",title:t("Section sign")},{character:"¶",title:t("Paragraph sign")},{character:"⁋",title:t("Reversed paragraph sign")}],{label:t("Text")})}}class O extends o{static get pluginName(){return"SpecialCharactersMathematical"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Mathematical",[{character:"<",title:t("Less-than sign")},{character:">",title:t("Greater-than sign")},{character:"≤",title:t("Less-than or equal to")},{character:"≥",title:t("Greater-than or equal to")},{character:"–",title:t("En dash")},{character:"—",title:t("Em dash")},{character:"¯",title:t("Macron")},{character:"‾",title:t("Overline")},{character:"°",title:t("Degree sign")},{character:"−",title:t("Minus sign")},{character:"±",title:t("Plus-minus sign")},{character:"÷",title:t("Division sign")},{character:"⁄",title:t("Fraction slash")},{character:"×",title:t("Multiplication sign")},{character:"ƒ",title:t("Latin small letter f with hook")},{character:"∫",title:t("Integral")},{character:"∑",title:t("N-ary summation")},{character:"∞",title:t("Infinity")},{character:"√",title:t("Square root")},{character:"∼",title:t("Tilde operator")},{character:"≅",title:t("Approximately equal to")},{character:"≈",title:t("Almost equal to")},{character:"≠",title:t("Not equal to")},{character:"≡",title:t("Identical to")},{character:"∈",title:t("Element of")},{character:"∉",title:t("Not an element of")},{character:"∋",title:t("Contains as member")},{character:"∏",title:t("N-ary product")},{character:"∧",title:t("Logical and")},{character:"∨",title:t("Logical or")},{character:"¬",title:t("Not sign")},{character:"∩",title:t("Intersection")},{character:"∪",title:t("Union")},{character:"∂",title:t("Partial differential")},{character:"∀",title:t("For all")},{character:"∃",title:t("There exists")},{character:"∅",title:t("Empty set")},{character:"∇",title:t("Nabla")},{character:"∗",title:t("Asterisk operator")},{character:"∝",title:t("Proportional to")},{character:"∠",title:t("Angle")},{character:"¼",title:t("Vulgar fraction one quarter")},{character:"½",title:t("Vulgar fraction one half")},{character:"¾",title:t("Vulgar fraction three quarters")}],{label:t("Mathematical")})}}class F extends o{static get pluginName(){return"SpecialCharactersLatin"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Latin",[{character:"Ā",title:t("Latin capital letter a with macron")},{character:"ā",title:t("Latin small letter a with macron")},{character:"Ă",title:t("Latin capital letter a with breve")},{character:"ă",title:t("Latin small letter a with breve")},{character:"Ą",title:t("Latin capital letter a with ogonek")},{character:"ą",title:t("Latin small letter a with ogonek")},{character:"Ć",title:t("Latin capital letter c with acute")},{character:"ć",title:t("Latin small letter c with acute")},{character:"Ĉ",title:t("Latin capital letter c with circumflex")},{character:"ĉ",title:t("Latin small letter c with circumflex")},{character:"Ċ",title:t("Latin capital letter c with dot above")},{character:"ċ",title:t("Latin small letter c with dot above")},{character:"Č",title:t("Latin capital letter c with caron")},{character:"č",title:t("Latin small letter c with caron")},{character:"Ď",title:t("Latin capital letter d with caron")},{character:"ď",title:t("Latin small letter d with caron")},{character:"Đ",title:t("Latin capital letter d with stroke")},{character:"đ",title:t("Latin small letter d with stroke")},{character:"Ē",title:t("Latin capital letter e with macron")},{character:"ē",title:t("Latin small letter e with macron")},{character:"Ĕ",title:t("Latin capital letter e with breve")},{character:"ĕ",title:t("Latin small letter e with breve")},{character:"Ė",title:t("Latin capital letter e with dot above")},{character:"ė",title:t("Latin small letter e with dot above")},{character:"Ę",title:t("Latin capital letter e with ogonek")},{character:"ę",title:t("Latin small letter e with ogonek")},{character:"Ě",title:t("Latin capital letter e with caron")},{character:"ě",title:t("Latin small letter e with caron")},{character:"Ĝ",title:t("Latin capital letter g with circumflex")},{character:"ĝ",title:t("Latin small letter g with circumflex")},{character:"Ğ",title:t("Latin capital letter g with breve")},{character:"ğ",title:t("Latin small letter g with breve")},{character:"Ġ",title:t("Latin capital letter g with dot above")},{character:"ġ",title:t("Latin small letter g with dot above")},{character:"Ģ",title:t("Latin capital letter g with cedilla")},{character:"ģ",title:t("Latin small letter g with cedilla")},{character:"Ĥ",title:t("Latin capital letter h with circumflex")},{character:"ĥ",title:t("Latin small letter h with circumflex")},{character:"Ħ",title:t("Latin capital letter h with stroke")},{character:"ħ",title:t("Latin small letter h with stroke")},{character:"Ĩ",title:t("Latin capital letter i with tilde")},{character:"ĩ",title:t("Latin small letter i with tilde")},{character:"Ī",title:t("Latin capital letter i with macron")},{character:"ī",title:t("Latin small letter i with macron")},{character:"Ĭ",title:t("Latin capital letter i with breve")},{character:"ĭ",title:t("Latin small letter i with breve")},{character:"Į",title:t("Latin capital letter i with ogonek")},{character:"į",title:t("Latin small letter i with ogonek")},{character:"İ",title:t("Latin capital letter i with dot above")},{character:"ı",title:t("Latin small letter dotless i")},{character:"IJ",title:t("Latin capital ligature ij")},{character:"ij",title:t("Latin small ligature ij")},{character:"Ĵ",title:t("Latin capital letter j with circumflex")},{character:"ĵ",title:t("Latin small letter j with circumflex")},{character:"Ķ",title:t("Latin capital letter k with cedilla")},{character:"ķ",title:t("Latin small letter k with cedilla")},{character:"ĸ",title:t("Latin small letter kra")},{character:"Ĺ",title:t("Latin capital letter l with acute")},{character:"ĺ",title:t("Latin small letter l with acute")},{character:"Ļ",title:t("Latin capital letter l with cedilla")},{character:"ļ",title:t("Latin small letter l with cedilla")},{character:"Ľ",title:t("Latin capital letter l with caron")},{character:"ľ",title:t("Latin small letter l with caron")},{character:"Ŀ",title:t("Latin capital letter l with middle dot")},{character:"ŀ",title:t("Latin small letter l with middle dot")},{character:"Ł",title:t("Latin capital letter l with stroke")},{character:"ł",title:t("Latin small letter l with stroke")},{character:"Ń",title:t("Latin capital letter n with acute")},{character:"ń",title:t("Latin small letter n with acute")},{character:"Ņ",title:t("Latin capital letter n with cedilla")},{character:"ņ",title:t("Latin small letter n with cedilla")},{character:"Ň",title:t("Latin capital letter n with caron")},{character:"ň",title:t("Latin small letter n with caron")},{character:"ʼn",title:t("Latin small letter n preceded by apostrophe")},{character:"Ŋ",title:t("Latin capital letter eng")},{character:"ŋ",title:t("Latin small letter eng")},{character:"Ō",title:t("Latin capital letter o with macron")},{character:"ō",title:t("Latin small letter o with macron")},{character:"Ŏ",title:t("Latin capital letter o with breve")},{character:"ŏ",title:t("Latin small letter o with breve")},{character:"Ő",title:t("Latin capital letter o with double acute")},{character:"ő",title:t("Latin small letter o with double acute")},{character:"Œ",title:t("Latin capital ligature oe")},{character:"œ",title:t("Latin small ligature oe")},{character:"Ŕ",title:t("Latin capital letter r with acute")},{character:"ŕ",title:t("Latin small letter r with acute")},{character:"Ŗ",title:t("Latin capital letter r with cedilla")},{character:"ŗ",title:t("Latin small letter r with cedilla")},{character:"Ř",title:t("Latin capital letter r with caron")},{character:"ř",title:t("Latin small letter r with caron")},{character:"Ś",title:t("Latin capital letter s with acute")},{character:"ś",title:t("Latin small letter s with acute")},{character:"Ŝ",title:t("Latin capital letter s with circumflex")},{character:"ŝ",title:t("Latin small letter s with circumflex")},{character:"Ş",title:t("Latin capital letter s with cedilla")},{character:"ş",title:t("Latin small letter s with cedilla")},{character:"Š",title:t("Latin capital letter s with caron")},{character:"š",title:t("Latin small letter s with caron")},{character:"Ţ",title:t("Latin capital letter t with cedilla")},{character:"ţ",title:t("Latin small letter t with cedilla")},{character:"Ť",title:t("Latin capital letter t with caron")},{character:"ť",title:t("Latin small letter t with caron")},{character:"Ŧ",title:t("Latin capital letter t with stroke")},{character:"ŧ",title:t("Latin small letter t with stroke")},{character:"Ũ",title:t("Latin capital letter u with tilde")},{character:"ũ",title:t("Latin small letter u with tilde")},{character:"Ū",title:t("Latin capital letter u with macron")},{character:"ū",title:t("Latin small letter u with macron")},{character:"Ŭ",title:t("Latin capital letter u with breve")},{character:"ŭ",title:t("Latin small letter u with breve")},{character:"Ů",title:t("Latin capital letter u with ring above")},{character:"ů",title:t("Latin small letter u with ring above")},{character:"Ű",title:t("Latin capital letter u with double acute")},{character:"ű",title:t("Latin small letter u with double acute")},{character:"Ų",title:t("Latin capital letter u with ogonek")},{character:"ų",title:t("Latin small letter u with ogonek")},{character:"Ŵ",title:t("Latin capital letter w with circumflex")},{character:"ŵ",title:t("Latin small letter w with circumflex")},{character:"Ŷ",title:t("Latin capital letter y with circumflex")},{character:"ŷ",title:t("Latin small letter y with circumflex")},{character:"Ÿ",title:t("Latin capital letter y with diaeresis")},{character:"Ź",title:t("Latin capital letter z with acute")},{character:"ź",title:t("Latin small letter z with acute")},{character:"Ż",title:t("Latin capital letter z with dot above")},{character:"ż",title:t("Latin small letter z with dot above")},{character:"Ž",title:t("Latin capital letter z with caron")},{character:"ž",title:t("Latin small letter z with caron")},{character:"ſ",title:t("Latin small letter long s")}],{label:t("Latin")})}}class R extends o{static get pluginName(){return"SpecialCharactersCurrency"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Currency",[{character:"$",title:t("Dollar sign")},{character:"€",title:t("Euro sign")},{character:"¥",title:t("Yen sign")},{character:"£",title:t("Pound sign")},{character:"¢",title:t("Cent sign")},{character:"₠",title:t("Euro-currency sign")},{character:"₡",title:t("Colon sign")},{character:"₢",title:t("Cruzeiro sign")},{character:"₣",title:t("French franc sign")},{character:"₤",title:t("Lira sign")},{character:"¤",title:t("Currency sign")},{character:"₿",title:t("Bitcoin sign")},{character:"₥",title:t("Mill sign")},{character:"₦",title:t("Naira sign")},{character:"₧",title:t("Peseta sign")},{character:"₨",title:t("Rupee sign")},{character:"₩",title:t("Won sign")},{character:"₪",title:t("New sheqel sign")},{character:"₫",title:t("Dong sign")},{character:"₭",title:t("Kip sign")},{character:"₮",title:t("Tugrik sign")},{character:"₯",title:t("Drachma sign")},{character:"₰",title:t("German penny sign")},{character:"₱",title:t("Peso sign")},{character:"₲",title:t("Guarani sign")},{character:"₳",title:t("Austral sign")},{character:"₴",title:t("Hryvnia sign")},{character:"₵",title:t("Cedi sign")},{character:"₶",title:t("Livre tournois sign")},{character:"₷",title:t("Spesmilo sign")},{character:"₸",title:t("Tenge sign")},{character:"₹",title:t("Indian rupee sign")},{character:"₺",title:t("Turkish lira sign")},{character:"₻",title:t("Nordic mark sign")},{character:"₼",title:t("Manat sign")},{character:"₽",title:t("Ruble sign")}],{label:t("Currency")})}}class Q extends o{static get pluginName(){return"SpecialCharactersEssentials"}static get isOfficialPlugin(){return!0}static get requires(){return[R,M,O,E,F]}}export{U as SpecialCharacters,E as SpecialCharactersArrows,R as SpecialCharactersCurrency,Q as SpecialCharactersEssentials,F as SpecialCharactersLatin,O as SpecialCharactersMathematical,M as SpecialCharactersText};
@@ -1,4 +1,4 @@
1
- var w=Object.defineProperty;var A=(n,r,t)=>r in n?w(n,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[r]=t;var u=(n,r,t)=>A(n,typeof r!="symbol"?r+"":r,t);import{Plugin as g,Command as B}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{createDropdown as F,View as m,ViewCollection as V,FocusCycler as T,LabelView as v,addKeyboardHandlingForGrid as U,ButtonView as E}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{first as x,logWarning as C,FocusTracker as k,KeystrokeHandler as _}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{findAttributeRange as D,findAttributeRangeBound as G}from"../../../../../@ckeditor_ckeditor5-typing@45.2.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{isObject as H}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isObject.js";/**
1
+ import{Plugin as d,Command as k}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{createDropdown as _,View as g,ViewCollection as w,FocusCycler as A,LabelView as B,addKeyboardHandlingForGrid as F,ButtonView as V}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{first as T,logWarning as v,FocusTracker as b,KeystrokeHandler as S}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{findAttributeRange as U,findAttributeRangeBound as E}from"../../../../../@ckeditor_ckeditor5-typing@45.2.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{isObject as x}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isObject.js";/**
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */class N extends E{constructor(t,e){super(t);u(this,"styleDefinition");u(this,"previewView");this.styleDefinition=e,this.previewView=this._createPreview(),this.set({label:e.name,class:"ck-style-grid__button",withText:!0}),this.extendTemplate({attributes:{role:"option"}}),this.children.add(this.previewView,0)}_createPreview(){const t=new m(this.locale);return t.setTemplate({tag:"div",attributes:{class:["ck","ck-reset_all-excluded","ck-style-grid__button__preview","ck-content"],"aria-hidden":"true"},children:[this.styleDefinition.previewTemplate]}),t}}class P extends m{constructor(t,e){super(t);u(this,"focusTracker");u(this,"keystrokes");u(this,"children");this.focusTracker=new k,this.keystrokes=new _,this.set("activeStyles",[]),this.set("enabledStyles",[]),this.children=this.createCollection(),this.children.delegate("execute").to(this);for(const s of e){const i=new N(t,s);this.children.add(i)}this.on("change:activeStyles",()=>{for(const s of this.children)s.isOn=this.activeStyles.includes(s.styleDefinition.name)}),this.on("change:enabledStyles",()=>{for(const s of this.children)s.isEnabled=this.enabledStyles.includes(s.styleDefinition.name)}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-style-grid"],role:"listbox"},children:this.children})}render(){super.render();for(const t of this.children)this.focusTracker.add(t.element);U({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.children,numberOfColumns:3,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection}),this.keystrokes.listenTo(this.element)}focus(){this.children.first.focus()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}class p extends m{constructor(t,e,s){super(t);u(this,"gridView");u(this,"labelView");this.labelView=new v(t),this.labelView.text=e,this.gridView=new P(t,s),this.setTemplate({tag:"div",attributes:{class:["ck","ck-style-panel__style-group"],role:"group","aria-labelledby":this.labelView.id},children:[this.labelView,this.gridView]})}}class I extends m{constructor(t,e){super(t);u(this,"focusTracker");u(this,"keystrokes");u(this,"children");u(this,"blockStylesGroupView");u(this,"inlineStylesGroupView");u(this,"_focusables");u(this,"_focusCycler");const s=t.t;this.focusTracker=new k,this.keystrokes=new _,this.children=this.createCollection(),this.blockStylesGroupView=new p(t,s("Block styles"),e.block),this.inlineStylesGroupView=new p(t,s("Text styles"),e.inline),this.set("activeStyles",[]),this.set("enabledStyles",[]),this._focusables=new V,this._focusCycler=new T({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:["shift + tab"],focusNext:["tab"]}}),e.block.length&&this.children.add(this.blockStylesGroupView),e.inline.length&&this.children.add(this.inlineStylesGroupView),this.blockStylesGroupView.gridView.delegate("execute").to(this),this.inlineStylesGroupView.gridView.delegate("execute").to(this),this.blockStylesGroupView.gridView.bind("activeStyles","enabledStyles").to(this,"activeStyles","enabledStyles"),this.inlineStylesGroupView.gridView.bind("activeStyles","enabledStyles").to(this,"activeStyles","enabledStyles"),this.setTemplate({tag:"div",attributes:{class:["ck","ck-style-panel"]},children:this.children})}render(){super.render(),this._focusables.add(this.blockStylesGroupView.gridView),this._focusables.add(this.inlineStylesGroupView.gridView),this.focusTracker.add(this.blockStylesGroupView.gridView.element),this.focusTracker.add(this.inlineStylesGroupView.gridView.element),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}const L=["caption","colgroup","dd","dt","figcaption","legend","li","optgroup","option","rp","rt","summary","tbody","td","tfoot","th","thead","tr"];class f extends g{constructor(t){super(t);u(this,"_htmlSupport");this.decorate("isStyleEnabledForBlock"),this.decorate("isStyleActiveForBlock"),this.decorate("getAffectedBlocks"),this.decorate("isStyleEnabledForInlineSelection"),this.decorate("isStyleActiveForInlineSelection"),this.decorate("getAffectedInlineSelectable"),this.decorate("getStylePreview"),this.decorate("configureGHSDataFilter")}static get pluginName(){return"StyleUtils"}static get isOfficialPlugin(){return!0}init(){this._htmlSupport=this.editor.plugins.get("GeneralHtmlSupport")}normalizeConfig(t,e=[]){const s={block:[],inline:[]};for(const i of e){const l=[],o=[];for(const c of t.getDefinitionsForView(i.element)){const h="appliesToBlock"in c?c.appliesToBlock:!1;if(c.isBlock||h){if(typeof h=="string")l.push(h);else if(c.isBlock){const d=c;l.push(c.model),d.paragraphLikeModel&&l.push(d.paragraphLikeModel)}}else o.push(c.model)}const a=this.getStylePreview(i,[{text:"AaBbCcDdEeFfGgHhIiJj"}]);l.length?s.block.push({...i,previewTemplate:a,modelElements:l,isBlock:!0}):s.inline.push({...i,previewTemplate:a,ghsAttributes:o})}return s}isStyleEnabledForBlock(t,e){const s=this.editor.model,i=this._htmlSupport.getGhsAttributeNameForElement(t.element);return s.schema.checkAttribute(e,i)?t.modelElements.includes(e.name):!1}isStyleActiveForBlock(t,e){const s=this._htmlSupport.getGhsAttributeNameForElement(t.element),i=e.getAttribute(s);return this.hasAllClasses(i,t.classes)}getAffectedBlocks(t,e){return t.modelElements.includes(e.name)?[e]:null}isStyleEnabledForInlineSelection(t,e){const s=this.editor.model;for(const i of t.ghsAttributes)if(s.schema.checkAttributeInSelection(e,i))return!0;return!1}isStyleActiveForInlineSelection(t,e){for(const s of t.ghsAttributes){const i=this._getValueFromFirstAllowedNode(e,s);if(this.hasAllClasses(i,t.classes))return!0}return!1}getAffectedInlineSelectable(t,e){return e}getStylePreview(t,e){const{element:s,classes:i}=t;return{tag:O(s)?s:"div",attributes:{class:i},children:e}}hasAllClasses(t,e){return H(t)&&R(t)&&e.every(s=>t.classes.includes(s))}configureGHSDataFilter({block:t,inline:e}){const s=this.editor.plugins.get("DataFilter");s.loadAllowedConfig(t.map(b)),s.loadAllowedConfig(e.map(b))}_getValueFromFirstAllowedNode(t,e){const i=this.editor.model.schema;if(t.isCollapsed)return t.getAttribute(e);for(const l of t.getRanges())for(const o of l.getItems())if(i.checkAttribute(o,e))return o.getAttribute(e);return null}}function R(n){return!!n.classes&&Array.isArray(n.classes)}function O(n){return!L.includes(n)}function b({element:n,classes:r}){return{name:n,classes:r}}class z extends g{static get pluginName(){return"StyleUI"}static get isOfficialPlugin(){return!0}static get requires(){return[f]}init(){const r=this.editor,t=r.plugins.get("DataSchema"),e=r.plugins.get("StyleUtils"),s=r.config.get("style.definitions"),i=e.normalizeConfig(t,s);r.ui.componentFactory.add("style",l=>{const o=l.t,a=F(l),c=r.commands.get("style");return a.once("change:isOpen",()=>{const h=new I(l,i);a.panelView.children.add(h),h.delegate("execute").to(a),h.bind("activeStyles").to(c,"value"),h.bind("enabledStyles").to(c,"enabledStyles")}),a.bind("isEnabled").to(c),a.buttonView.withText=!0,a.buttonView.bind("label").to(c,"value",h=>h.length>1?o("Multiple styles"):h.length===1?h[0]:o("Styles")),a.bind("class").to(c,"value",h=>{const d=["ck-style-dropdown"];return h.length>1&&d.push("ck-style-dropdown_multiple-active"),d.join(" ")}),a.on("execute",h=>{r.execute("style",{styleName:h.source.styleDefinition.name}),r.editing.view.focus()}),a})}}class M extends B{constructor(t,e){super(t);u(this,"_styleDefinitions");u(this,"_styleUtils");this.set("value",[]),this.set("enabledStyles",[]),this._styleDefinitions=e,this._styleUtils=this.editor.plugins.get(f)}refresh(){const t=this.editor.model,e=t.document.selection,s=new Set,i=new Set;for(const o of this._styleDefinitions.inline)this._styleUtils.isStyleEnabledForInlineSelection(o,e)&&i.add(o.name),this._styleUtils.isStyleActiveForInlineSelection(o,e)&&s.add(o.name);const l=x(e.getSelectedBlocks())||e.getFirstPosition().parent;if(l){const o=l.getAncestors({includeSelf:!0,parentFirst:!0});for(const a of o){if(a.is("rootElement"))break;for(const c of this._styleDefinitions.block)this._styleUtils.isStyleEnabledForBlock(c,a)&&(i.add(c.name),this._styleUtils.isStyleActiveForBlock(c,a)&&s.add(c.name));if(t.schema.isObject(a))break}}this.enabledStyles=Array.from(i).sort(),this.isEnabled=this.enabledStyles.length>0,this.value=this.isEnabled?Array.from(s).sort():[]}execute({styleName:t,forceValue:e}){if(!this.enabledStyles.includes(t)){C("style-command-executed-with-incorrect-style-name");return}const s=this.editor.model,i=s.document.selection,l=this.editor.plugins.get("GeneralHtmlSupport"),o=[...this._styleDefinitions.inline,...this._styleDefinitions.block],a=o.filter(({name:d})=>this.value.includes(d)),c=o.find(({name:d})=>d==t),h=e===void 0?!this.value.includes(c.name):e;s.change(()=>{let d;j(c)?d=this._findAffectedBlocks($(i),c):d=[this._styleUtils.getAffectedInlineSelectable(c,i)];for(const y of d)h?l.addModelHtmlClass(c.element,c.classes,y):l.removeModelHtmlClass(c.element,q(a,c),y)})}_findAffectedBlocks(t,e){const s=new Set;for(const i of t){const l=i.getAncestors({includeSelf:!0,parentFirst:!0});for(const o of l){if(o.is("rootElement"))break;const a=this._styleUtils.getAffectedBlocks(e,o);if(a){for(const c of a)s.add(c);break}}}return s}}function q(n,r){return n.reduce((t,e)=>e.name===r.name?t:t.filter(s=>!e.classes.includes(s)),r.classes)}function j(n){return"isBlock"in n}function $(n){const r=Array.from(n.getSelectedBlocks());return r.length?r:[n.getFirstPosition().parent]}class J extends g{constructor(){super(...arguments);u(this,"_listUtils");u(this,"_styleUtils");u(this,"_htmlSupport")}static get pluginName(){return"ListStyleSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[f,"GeneralHtmlSupport"]}init(){const t=this.editor;t.plugins.has("ListEditing")&&(this._styleUtils=t.plugins.get(f),this._listUtils=this.editor.plugins.get("ListUtils"),this._htmlSupport=this.editor.plugins.get("GeneralHtmlSupport"),this.listenTo(this._styleUtils,"isStyleEnabledForBlock",(e,[s,i])=>{this._isStyleEnabledForBlock(s,i)&&(e.return=!0,e.stop())},{priority:"high"}),this.listenTo(this._styleUtils,"isStyleActiveForBlock",(e,[s,i])=>{this._isStyleActiveForBlock(s,i)&&(e.return=!0,e.stop())},{priority:"high"}),this.listenTo(this._styleUtils,"getAffectedBlocks",(e,[s,i])=>{const l=this._getAffectedBlocks(s,i);l&&(e.return=l,e.stop())},{priority:"high"}),this.listenTo(this._styleUtils,"getStylePreview",(e,[s,i])=>{const l=this._getStylePreview(s,i);l&&(e.return=l,e.stop())},{priority:"high"}))}_isStyleEnabledForBlock(t,e){const s=this.editor.model;if(!["ol","ul","li"].includes(t.element)||!this._listUtils.isListItemBlock(e))return!1;const i=this._htmlSupport.getGhsAttributeNameForElement(t.element);if(t.element=="ol"||t.element=="ul"){if(!s.schema.checkAttribute(e,i))return!1;const o=this._listUtils.isNumberedListType(e.getAttribute("listType"))?"ol":"ul";return t.element==o}else return s.schema.checkAttribute(e,i)}_isStyleActiveForBlock(t,e){const s=this._htmlSupport.getGhsAttributeNameForElement(t.element),i=e.getAttribute(s);return this._styleUtils.hasAllClasses(i,t.classes)}_getAffectedBlocks(t,e){return this._isStyleEnabledForBlock(t,e)?t.element=="li"?this._listUtils.expandListBlocksToCompleteItems(e,{withNested:!1}):this._listUtils.expandListBlocksToCompleteList(e):null}_getStylePreview(t,e){const{element:s,classes:i}=t;return s=="ol"||s=="ul"?{tag:s,attributes:{class:i},children:[{tag:"li",children:e}]}:s=="li"?{tag:"ol",children:[{tag:s,attributes:{class:i},children:e}]}:null}}class K extends g{constructor(){super(...arguments);u(this,"_tableUtils");u(this,"_styleUtils")}static get pluginName(){return"TableStyleSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[f]}init(){const t=this.editor;t.plugins.has("TableEditing")&&(this._styleUtils=t.plugins.get(f),this._tableUtils=this.editor.plugins.get("TableUtils"),this.listenTo(this._styleUtils,"isStyleEnabledForBlock",(e,[s,i])=>{this._isApplicable(s,i)&&(e.return=this._isStyleEnabledForBlock(s,i),e.stop())},{priority:"high"}),this.listenTo(this._styleUtils,"getAffectedBlocks",(e,[s,i])=>{this._isApplicable(s,i)&&(e.return=this._getAffectedBlocks(s,i),e.stop())},{priority:"high"}),this.listenTo(this._styleUtils,"configureGHSDataFilter",(e,[{block:s}])=>{this.editor.plugins.get("DataFilter").loadAllowedConfig(s.filter(l=>l.element=="figcaption").map(l=>({name:"caption",classes:l.classes})))}))}_isApplicable(t,e){return["td","th"].includes(t.element)?e.name=="tableCell":["thead","tbody"].includes(t.element)?e.name=="table":!1}_isStyleEnabledForBlock(t,e){if(["td","th"].includes(t.element)){const s=this._tableUtils.getCellLocation(e),l=e.parent.parent,o=l.getAttribute("headingRows")||0,a=l.getAttribute("headingColumns")||0,c=s.row<o||s.column<a;return t.element=="th"?c:!c}if(["thead","tbody"].includes(t.element)){const s=e.getAttribute("headingRows")||0;return t.element=="thead"?s>0:s<this._tableUtils.getRows(e)}/* istanbul ignore next -- @preserve */return!1}_getAffectedBlocks(t,e){return this._isStyleEnabledForBlock(t,e)?[e]:null}}class W extends g{constructor(){super(...arguments);u(this,"_styleUtils");u(this,"_htmlSupport")}static get pluginName(){return"LinkStyleSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[f,"GeneralHtmlSupport"]}init(){const t=this.editor;t.plugins.has("LinkEditing")&&(this._styleUtils=t.plugins.get(f),this._htmlSupport=this.editor.plugins.get("GeneralHtmlSupport"),this.listenTo(this._styleUtils,"isStyleEnabledForInlineSelection",(e,[s,i])=>{s.element=="a"&&(e.return=this._isStyleEnabled(s,i),e.stop())},{priority:"high"}),this.listenTo(this._styleUtils,"isStyleActiveForInlineSelection",(e,[s,i])=>{s.element=="a"&&(e.return=this._isStyleActive(s,i),e.stop())},{priority:"high"}),this.listenTo(this._styleUtils,"getAffectedInlineSelectable",(e,[s,i])=>{if(s.element!="a")return;const l=this._getAffectedSelectable(s,i);l&&(e.return=l,e.stop())},{priority:"high"}))}_isStyleEnabled(t,e){const s=this.editor.model;if(e.isCollapsed)return e.hasAttribute("linkHref");for(const i of e.getRanges())for(const l of i.getItems())if((l.is("$textProxy")||s.schema.isInline(l))&&l.hasAttribute("linkHref"))return!0;return!1}_isStyleActive(t,e){const s=this.editor.model,i=this._htmlSupport.getGhsAttributeNameForElement(t.element);if(e.isCollapsed){if(e.hasAttribute("linkHref")){const l=e.getAttribute(i);if(this._styleUtils.hasAllClasses(l,t.classes))return!0}return!1}for(const l of e.getRanges())for(const o of l.getItems())if((o.is("$textProxy")||s.schema.isInline(o))&&o.hasAttribute("linkHref")){const a=o.getAttribute(i);return this._styleUtils.hasAllClasses(a,t.classes)}return!1}_getAffectedSelectable(t,e){const s=this.editor.model;if(e.isCollapsed){const l=e.getAttribute("linkHref");return D(e.getFirstPosition(),"linkHref",l,s)}const i=[];for(const l of e.getRanges()){const o=s.createRange(S(l.start,"linkHref",!0,s),S(l.end,"linkHref",!1,s));for(const a of o.getItems())(a.is("$textProxy")||s.schema.isInline(a))&&a.hasAttribute("linkHref")&&i.push(this.editor.model.createRangeOn(a))}return Q(i)}}function S(n,r,t,e){const s=n.textNode||(t?n.nodeAfter:n.nodeBefore);if(!s||!s.hasAttribute(r))return n;const i=s.getAttribute(r);return G(n,r,i,t,e)}function Q(n){for(let r=1;r<n.length;r++){const t=n[r-1].getJoined(n[r]);t&&n.splice(--r,2,t)}return n}class X extends g{static get pluginName(){return"StyleEditing"}static get isOfficialPlugin(){return!0}static get requires(){return["GeneralHtmlSupport",f,J,K,W]}init(){const r=this.editor,t=r.plugins.get("DataSchema"),e=r.plugins.get("StyleUtils"),s=r.config.get("style.definitions"),i=e.normalizeConfig(t,s);r.commands.add("style",new M(r,i)),e.configureGHSDataFilter(i)}}class le extends g{static get pluginName(){return"Style"}static get isOfficialPlugin(){return!0}static get requires(){return[X,z]}}export{le as Style,X as StyleEditing,z as StyleUI,f as StyleUtils};
4
+ */class C extends V{styleDefinition;previewView;constructor(e,t){super(e),this.styleDefinition=t,this.previewView=this._createPreview(),this.set({label:t.name,class:"ck-style-grid__button",withText:!0}),this.extendTemplate({attributes:{role:"option"}}),this.children.add(this.previewView,0)}_createPreview(){const e=new g(this.locale);return e.setTemplate({tag:"div",attributes:{class:["ck","ck-reset_all-excluded","ck-style-grid__button__preview","ck-content"],"aria-hidden":"true"},children:[this.styleDefinition.previewTemplate]}),e}}class D extends g{focusTracker;keystrokes;children;constructor(e,t){super(e),this.focusTracker=new b,this.keystrokes=new S,this.set("activeStyles",[]),this.set("enabledStyles",[]),this.children=this.createCollection(),this.children.delegate("execute").to(this);for(const s of t){const i=new C(e,s);this.children.add(i)}this.on("change:activeStyles",()=>{for(const s of this.children)s.isOn=this.activeStyles.includes(s.styleDefinition.name)}),this.on("change:enabledStyles",()=>{for(const s of this.children)s.isEnabled=this.enabledStyles.includes(s.styleDefinition.name)}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-style-grid"],role:"listbox"},children:this.children})}render(){super.render();for(const e of this.children)this.focusTracker.add(e.element);F({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.children,numberOfColumns:3,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection}),this.keystrokes.listenTo(this.element)}focus(){this.children.first.focus()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}class m extends g{gridView;labelView;constructor(e,t,s){super(e),this.labelView=new B(e),this.labelView.text=t,this.gridView=new D(e,s),this.setTemplate({tag:"div",attributes:{class:["ck","ck-style-panel__style-group"],role:"group","aria-labelledby":this.labelView.id},children:[this.labelView,this.gridView]})}}class G extends g{focusTracker;keystrokes;children;blockStylesGroupView;inlineStylesGroupView;_focusables;_focusCycler;constructor(e,t){super(e);const s=e.t;this.focusTracker=new b,this.keystrokes=new S,this.children=this.createCollection(),this.blockStylesGroupView=new m(e,s("Block styles"),t.block),this.inlineStylesGroupView=new m(e,s("Text styles"),t.inline),this.set("activeStyles",[]),this.set("enabledStyles",[]),this._focusables=new w,this._focusCycler=new A({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:["shift + tab"],focusNext:["tab"]}}),t.block.length&&this.children.add(this.blockStylesGroupView),t.inline.length&&this.children.add(this.inlineStylesGroupView),this.blockStylesGroupView.gridView.delegate("execute").to(this),this.inlineStylesGroupView.gridView.delegate("execute").to(this),this.blockStylesGroupView.gridView.bind("activeStyles","enabledStyles").to(this,"activeStyles","enabledStyles"),this.inlineStylesGroupView.gridView.bind("activeStyles","enabledStyles").to(this,"activeStyles","enabledStyles"),this.setTemplate({tag:"div",attributes:{class:["ck","ck-style-panel"]},children:this.children})}render(){super.render(),this._focusables.add(this.blockStylesGroupView.gridView),this._focusables.add(this.inlineStylesGroupView.gridView),this.focusTracker.add(this.blockStylesGroupView.gridView.element),this.focusTracker.add(this.inlineStylesGroupView.gridView.element),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}const H=["caption","colgroup","dd","dt","figcaption","legend","li","optgroup","option","rp","rt","summary","tbody","td","tfoot","th","thead","tr"];class h extends d{_htmlSupport;static get pluginName(){return"StyleUtils"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.decorate("isStyleEnabledForBlock"),this.decorate("isStyleActiveForBlock"),this.decorate("getAffectedBlocks"),this.decorate("isStyleEnabledForInlineSelection"),this.decorate("isStyleActiveForInlineSelection"),this.decorate("getAffectedInlineSelectable"),this.decorate("getStylePreview"),this.decorate("configureGHSDataFilter")}init(){this._htmlSupport=this.editor.plugins.get("GeneralHtmlSupport")}normalizeConfig(e,t=[]){const s={block:[],inline:[]};for(const i of t){const l=[],o=[];for(const n of e.getDefinitionsForView(i.element)){const u="appliesToBlock"in n?n.appliesToBlock:!1;if(n.isBlock||u){if(typeof u=="string")l.push(u);else if(n.isBlock){const a=n;l.push(n.model),a.paragraphLikeModel&&l.push(a.paragraphLikeModel)}}else o.push(n.model)}const c=this.getStylePreview(i,[{text:"AaBbCcDdEeFfGgHhIiJj"}]);l.length?s.block.push({...i,previewTemplate:c,modelElements:l,isBlock:!0}):s.inline.push({...i,previewTemplate:c,ghsAttributes:o})}return s}isStyleEnabledForBlock(e,t){const s=this.editor.model,i=this._htmlSupport.getGhsAttributeNameForElement(e.element);return s.schema.checkAttribute(t,i)?e.modelElements.includes(t.name):!1}isStyleActiveForBlock(e,t){const s=this._htmlSupport.getGhsAttributeNameForElement(e.element),i=t.getAttribute(s);return this.hasAllClasses(i,e.classes)}getAffectedBlocks(e,t){return e.modelElements.includes(t.name)?[t]:null}isStyleEnabledForInlineSelection(e,t){const s=this.editor.model;for(const i of e.ghsAttributes)if(s.schema.checkAttributeInSelection(t,i))return!0;return!1}isStyleActiveForInlineSelection(e,t){for(const s of e.ghsAttributes){const i=this._getValueFromFirstAllowedNode(t,s);if(this.hasAllClasses(i,e.classes))return!0}return!1}getAffectedInlineSelectable(e,t){return t}getStylePreview(e,t){const{element:s,classes:i}=e;return{tag:P(s)?s:"div",attributes:{class:i},children:t}}hasAllClasses(e,t){return x(e)&&N(e)&&t.every(s=>e.classes.includes(s))}configureGHSDataFilter({block:e,inline:t}){const s=this.editor.plugins.get("DataFilter");s.loadAllowedConfig(e.map(y)),s.loadAllowedConfig(t.map(y))}_getValueFromFirstAllowedNode(e,t){const i=this.editor.model.schema;if(e.isCollapsed)return e.getAttribute(t);for(const l of e.getRanges())for(const o of l.getItems())if(i.checkAttribute(o,t))return o.getAttribute(t);return null}}function N(r){return!!r.classes&&Array.isArray(r.classes)}function P(r){return!H.includes(r)}function y({element:r,classes:e}){return{name:r,classes:e}}class I extends d{static get pluginName(){return"StyleUI"}static get isOfficialPlugin(){return!0}static get requires(){return[h]}init(){const e=this.editor,t=e.plugins.get("DataSchema"),s=e.plugins.get("StyleUtils"),i=e.config.get("style.definitions"),l=s.normalizeConfig(t,i);e.ui.componentFactory.add("style",o=>{const c=o.t,n=_(o),u=e.commands.get("style");return n.once("change:isOpen",()=>{const a=new G(o,l);n.panelView.children.add(a),a.delegate("execute").to(n),a.bind("activeStyles").to(u,"value"),a.bind("enabledStyles").to(u,"enabledStyles")}),n.bind("isEnabled").to(u),n.buttonView.withText=!0,n.buttonView.bind("label").to(u,"value",a=>a.length>1?c("Multiple styles"):a.length===1?a[0]:c("Styles")),n.bind("class").to(u,"value",a=>{const f=["ck-style-dropdown"];return a.length>1&&f.push("ck-style-dropdown_multiple-active"),f.join(" ")}),n.on("execute",a=>{e.execute("style",{styleName:a.source.styleDefinition.name}),e.editing.view.focus()}),n})}}class L extends k{_styleDefinitions;_styleUtils;constructor(e,t){super(e),this.set("value",[]),this.set("enabledStyles",[]),this._styleDefinitions=t,this._styleUtils=this.editor.plugins.get(h)}refresh(){const e=this.editor.model,t=e.document.selection,s=new Set,i=new Set;for(const o of this._styleDefinitions.inline)this._styleUtils.isStyleEnabledForInlineSelection(o,t)&&i.add(o.name),this._styleUtils.isStyleActiveForInlineSelection(o,t)&&s.add(o.name);const l=T(t.getSelectedBlocks())||t.getFirstPosition().parent;if(l){const o=l.getAncestors({includeSelf:!0,parentFirst:!0});for(const c of o){if(c.is("rootElement"))break;for(const n of this._styleDefinitions.block)this._styleUtils.isStyleEnabledForBlock(n,c)&&(i.add(n.name),this._styleUtils.isStyleActiveForBlock(n,c)&&s.add(n.name));if(e.schema.isObject(c))break}}this.enabledStyles=Array.from(i).sort(),this.isEnabled=this.enabledStyles.length>0,this.value=this.isEnabled?Array.from(s).sort():[]}execute({styleName:e,forceValue:t}){if(!this.enabledStyles.includes(e)){v("style-command-executed-with-incorrect-style-name");return}const s=this.editor.model,i=s.document.selection,l=this.editor.plugins.get("GeneralHtmlSupport"),o=[...this._styleDefinitions.inline,...this._styleDefinitions.block],c=o.filter(({name:a})=>this.value.includes(a)),n=o.find(({name:a})=>a==e),u=t===void 0?!this.value.includes(n.name):t;s.change(()=>{let a;O(n)?a=this._findAffectedBlocks(z(i),n):a=[this._styleUtils.getAffectedInlineSelectable(n,i)];for(const f of a)u?l.addModelHtmlClass(n.element,n.classes,f):l.removeModelHtmlClass(n.element,R(c,n),f)})}_findAffectedBlocks(e,t){const s=new Set;for(const i of e){const l=i.getAncestors({includeSelf:!0,parentFirst:!0});for(const o of l){if(o.is("rootElement"))break;const c=this._styleUtils.getAffectedBlocks(t,o);if(c){for(const n of c)s.add(n);break}}}return s}}function R(r,e){return r.reduce((t,s)=>s.name===e.name?t:t.filter(i=>!s.classes.includes(i)),e.classes)}function O(r){return"isBlock"in r}function z(r){const e=Array.from(r.getSelectedBlocks());return e.length?e:[r.getFirstPosition().parent]}class M extends d{_listUtils;_styleUtils;_htmlSupport;static get pluginName(){return"ListStyleSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[h,"GeneralHtmlSupport"]}init(){const e=this.editor;e.plugins.has("ListEditing")&&(this._styleUtils=e.plugins.get(h),this._listUtils=this.editor.plugins.get("ListUtils"),this._htmlSupport=this.editor.plugins.get("GeneralHtmlSupport"),this.listenTo(this._styleUtils,"isStyleEnabledForBlock",(t,[s,i])=>{this._isStyleEnabledForBlock(s,i)&&(t.return=!0,t.stop())},{priority:"high"}),this.listenTo(this._styleUtils,"isStyleActiveForBlock",(t,[s,i])=>{this._isStyleActiveForBlock(s,i)&&(t.return=!0,t.stop())},{priority:"high"}),this.listenTo(this._styleUtils,"getAffectedBlocks",(t,[s,i])=>{const l=this._getAffectedBlocks(s,i);l&&(t.return=l,t.stop())},{priority:"high"}),this.listenTo(this._styleUtils,"getStylePreview",(t,[s,i])=>{const l=this._getStylePreview(s,i);l&&(t.return=l,t.stop())},{priority:"high"}))}_isStyleEnabledForBlock(e,t){const s=this.editor.model;if(!["ol","ul","li"].includes(e.element)||!this._listUtils.isListItemBlock(t))return!1;const i=this._htmlSupport.getGhsAttributeNameForElement(e.element);if(e.element=="ol"||e.element=="ul"){if(!s.schema.checkAttribute(t,i))return!1;const o=this._listUtils.isNumberedListType(t.getAttribute("listType"))?"ol":"ul";return e.element==o}else return s.schema.checkAttribute(t,i)}_isStyleActiveForBlock(e,t){const s=this._htmlSupport.getGhsAttributeNameForElement(e.element),i=t.getAttribute(s);return this._styleUtils.hasAllClasses(i,e.classes)}_getAffectedBlocks(e,t){return this._isStyleEnabledForBlock(e,t)?e.element=="li"?this._listUtils.expandListBlocksToCompleteItems(t,{withNested:!1}):this._listUtils.expandListBlocksToCompleteList(t):null}_getStylePreview(e,t){const{element:s,classes:i}=e;return s=="ol"||s=="ul"?{tag:s,attributes:{class:i},children:[{tag:"li",children:t}]}:s=="li"?{tag:"ol",children:[{tag:s,attributes:{class:i},children:t}]}:null}}class q extends d{_tableUtils;_styleUtils;static get pluginName(){return"TableStyleSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[h]}init(){const e=this.editor;e.plugins.has("TableEditing")&&(this._styleUtils=e.plugins.get(h),this._tableUtils=this.editor.plugins.get("TableUtils"),this.listenTo(this._styleUtils,"isStyleEnabledForBlock",(t,[s,i])=>{this._isApplicable(s,i)&&(t.return=this._isStyleEnabledForBlock(s,i),t.stop())},{priority:"high"}),this.listenTo(this._styleUtils,"getAffectedBlocks",(t,[s,i])=>{this._isApplicable(s,i)&&(t.return=this._getAffectedBlocks(s,i),t.stop())},{priority:"high"}),this.listenTo(this._styleUtils,"configureGHSDataFilter",(t,[{block:s}])=>{this.editor.plugins.get("DataFilter").loadAllowedConfig(s.filter(l=>l.element=="figcaption").map(l=>({name:"caption",classes:l.classes})))}))}_isApplicable(e,t){return["td","th"].includes(e.element)?t.name=="tableCell":["thead","tbody"].includes(e.element)?t.name=="table":!1}_isStyleEnabledForBlock(e,t){if(["td","th"].includes(e.element)){const s=this._tableUtils.getCellLocation(t),l=t.parent.parent,o=l.getAttribute("headingRows")||0,c=l.getAttribute("headingColumns")||0,n=s.row<o||s.column<c;return e.element=="th"?n:!n}if(["thead","tbody"].includes(e.element)){const s=t.getAttribute("headingRows")||0;return e.element=="thead"?s>0:s<this._tableUtils.getRows(t)}/* istanbul ignore next -- @preserve */return!1}_getAffectedBlocks(e,t){return this._isStyleEnabledForBlock(e,t)?[t]:null}}class j extends d{_styleUtils;_htmlSupport;static get pluginName(){return"LinkStyleSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[h,"GeneralHtmlSupport"]}init(){const e=this.editor;e.plugins.has("LinkEditing")&&(this._styleUtils=e.plugins.get(h),this._htmlSupport=this.editor.plugins.get("GeneralHtmlSupport"),this.listenTo(this._styleUtils,"isStyleEnabledForInlineSelection",(t,[s,i])=>{s.element=="a"&&(t.return=this._isStyleEnabled(s,i),t.stop())},{priority:"high"}),this.listenTo(this._styleUtils,"isStyleActiveForInlineSelection",(t,[s,i])=>{s.element=="a"&&(t.return=this._isStyleActive(s,i),t.stop())},{priority:"high"}),this.listenTo(this._styleUtils,"getAffectedInlineSelectable",(t,[s,i])=>{if(s.element!="a")return;const l=this._getAffectedSelectable(s,i);l&&(t.return=l,t.stop())},{priority:"high"}))}_isStyleEnabled(e,t){const s=this.editor.model;if(t.isCollapsed)return t.hasAttribute("linkHref");for(const i of t.getRanges())for(const l of i.getItems())if((l.is("$textProxy")||s.schema.isInline(l))&&l.hasAttribute("linkHref"))return!0;return!1}_isStyleActive(e,t){const s=this.editor.model,i=this._htmlSupport.getGhsAttributeNameForElement(e.element);if(t.isCollapsed){if(t.hasAttribute("linkHref")){const l=t.getAttribute(i);if(this._styleUtils.hasAllClasses(l,e.classes))return!0}return!1}for(const l of t.getRanges())for(const o of l.getItems())if((o.is("$textProxy")||s.schema.isInline(o))&&o.hasAttribute("linkHref")){const c=o.getAttribute(i);return this._styleUtils.hasAllClasses(c,e.classes)}return!1}_getAffectedSelectable(e,t){const s=this.editor.model;if(t.isCollapsed){const l=t.getAttribute("linkHref");return U(t.getFirstPosition(),"linkHref",l,s)}const i=[];for(const l of t.getRanges()){const o=s.createRange(p(l.start,"linkHref",!0,s),p(l.end,"linkHref",!1,s));for(const c of o.getItems())(c.is("$textProxy")||s.schema.isInline(c))&&c.hasAttribute("linkHref")&&i.push(this.editor.model.createRangeOn(c))}return $(i)}}function p(r,e,t,s){const i=r.textNode||(t?r.nodeAfter:r.nodeBefore);if(!i||!i.hasAttribute(e))return r;const l=i.getAttribute(e);return E(r,e,l,t,s)}function $(r){for(let e=1;e<r.length;e++){const t=r[e-1].getJoined(r[e]);t&&r.splice(--e,2,t)}return r}class J extends d{static get pluginName(){return"StyleEditing"}static get isOfficialPlugin(){return!0}static get requires(){return["GeneralHtmlSupport",h,M,q,j]}init(){const e=this.editor,t=e.plugins.get("DataSchema"),s=e.plugins.get("StyleUtils"),i=e.config.get("style.definitions"),l=s.normalizeConfig(t,i);e.commands.add("style",new L(e,l)),s.configureGHSDataFilter(l)}}class Z extends d{static get pluginName(){return"Style"}static get isOfficialPlugin(){return!0}static get requires(){return[J,I]}}export{Z as Style,J as StyleEditing,I as StyleUI,h as StyleUtils};