@ncino/web-components 5.0.0-preview.2 → 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 (167) 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/modal/gator/modal.gator.scss.js +1 -1
  141. package/dist/packages/web-components/src/components/switch/gator/switch.gator.scss.js +1 -1
  142. package/dist/packages/web-components/src/components/text-detail/gator/text-detail.gator.scss.js +1 -1
  143. package/dist/packages/web-components/src/index.slds.scss.js +1 -1
  144. package/dist/types/components/modal/gator/modal.gator.d.ts +1 -1
  145. package/dist/types/components/text-detail/gator/text-detail.gator.d.ts +4 -2
  146. package/dist/utils/accessibility-utils.js +1 -1
  147. package/dist/utils/datatestid-utils.js +1 -1
  148. package/dist/utils/lightdom-utils.js +1 -1
  149. package/dist/utils/vitest-a11y-utils.js +1 -1
  150. package/dist/utils/vitest-utils.js +1 -1
  151. package/package.json +10 -10
  152. package/web-types.json +2 -3
  153. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/dist/common/fetch.js +0 -1
  154. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/dist/connect/figma_rest_api.js +0 -1
  155. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/package.json.js +0 -1
  156. 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
  157. /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
  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/figma_client.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/common/logging.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/updates.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/connect/external_types.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/index_common.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/html/external.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/index_html.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/template_literal.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/react/external.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/index_react.js +0 -0
@@ -1,5 +1,5 @@
1
- var v=Object.defineProperty;var F=(c,r,t)=>r in c?v(c,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[r]=t;var u=(c,r,t)=>F(c,typeof r!="symbol"?r+"":r,t);import{Plugin as _,Command as w}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconFindReplace as b,IconPreviousArrow as V}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{Dialog as B,DropdownView as A,createDropdown as I,FormHeaderView as E,ButtonView as k,MenuBarMenuListItemButtonView as D,DialogViewPosition as O,CssTransitionDisablerMixin as S,View as p,ViewCollection as P,FocusCycler as N,submitHandler as M,CollapsibleView as H,SwitchButtonView as R,LabeledFieldView as W,createLabeledInputText as $}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{scrollViewportToShowTarget as L,Collection as x,uid as U,ObservableMixin as q,FocusTracker as G,KeystrokeHandler as K,isVisible as j,Rect as z}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{debounce as Q}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/function/debounce.js";import{escapeRegExp as Z}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/string/escapeRegExp.js";/**
1
+ import{Plugin as p,Command as _}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconFindReplace as w,IconPreviousArrow as x}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{Dialog as T,DropdownView as v,createDropdown as F,FormHeaderView as B,ButtonView as V,MenuBarMenuListItemButtonView as A,DialogViewPosition as I,CssTransitionDisablerMixin as E,View as g,ViewCollection as D,FocusCycler as O,submitHandler as S,CollapsibleView as P,SwitchButtonView as b,LabeledFieldView as N,createLabeledInputText as M}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{scrollViewportToShowTarget as H,Collection as m,uid as W,ObservableMixin as $,FocusTracker as L,KeystrokeHandler as U,isVisible as q,Rect as G}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{debounce as K}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/function/debounce.js";import{escapeRegExp as j}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/string/escapeRegExp.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 J extends p{constructor(t){super(t);u(this,"children");u(this,"_findInputView");u(this,"_replaceInputView");u(this,"_findButtonView");u(this,"_findPrevButtonView");u(this,"_findNextButtonView");u(this,"_advancedOptionsCollapsibleView");u(this,"_matchCaseSwitchView");u(this,"_wholeWordsOnlySwitchView");u(this,"_replaceButtonView");u(this,"_replaceAllButtonView");u(this,"_inputsDivView");u(this,"_actionButtonsDivView");u(this,"_focusTracker");u(this,"_keystrokes");u(this,"_focusables");u(this,"focusCycler");const e=t.t;this.children=this.createCollection(),this.set("matchCount",0),this.set("highlightOffset",0),this.set("isDirty",!1),this.set("_areCommandsEnabled",{}),this.set("_resultsCounterText",""),this.set("_matchCase",!1),this.set("_wholeWordsOnly",!1),this.bind("_searchResultsFound").to(this,"matchCount",this,"isDirty",(i,s)=>i>0&&!s),this._findInputView=this._createInputField(e("Find in text…")),this._findPrevButtonView=this._createButton({label:e("Previous result"),class:"ck-button-prev",icon:V,keystroke:"Shift+F3",tooltip:!0}),this._findNextButtonView=this._createButton({label:e("Next result"),class:"ck-button-next",icon:V,keystroke:"F3",tooltip:!0}),this._replaceInputView=this._createInputField(e("Replace with…"),"ck-labeled-field-replace"),this._inputsDivView=this._createInputsDiv(),this._matchCaseSwitchView=this._createMatchCaseSwitch(),this._wholeWordsOnlySwitchView=this._createWholeWordsOnlySwitch(),this._advancedOptionsCollapsibleView=this._createAdvancedOptionsCollapsible(),this._replaceAllButtonView=this._createButton({label:e("Replace all"),class:"ck-button-replaceall",withText:!0}),this._replaceButtonView=this._createButton({label:e("Replace"),class:"ck-button-replace",withText:!0}),this._findButtonView=this._createButton({label:e("Find"),class:"ck-button-find ck-button-action",withText:!0}),this._actionButtonsDivView=this._createActionButtonsDiv(),this._focusTracker=new G,this._keystrokes=new K,this._focusables=new P,this.focusCycler=new N({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this._keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.children.addMany([this._inputsDivView,this._advancedOptionsCollapsibleView,this._actionButtonsDivView]),this.setTemplate({tag:"form",attributes:{class:["ck","ck-find-and-replace-form"],tabindex:"-1"},children:this.children})}render(){super.render(),M({view:this}),this._initFocusCycling(),this._initKeystrokeHandling()}destroy(){super.destroy(),this._focusTracker.destroy(),this._keystrokes.destroy()}focus(t){t===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}reset(){this._findInputView.errorText=null,this.isDirty=!0}get _textToFind(){return this._findInputView.fieldView.element.value}get _textToReplace(){return this._replaceInputView.fieldView.element.value}_createInputsDiv(){const t=this.locale,e=t.t,i=new p(t);return this._findInputView.fieldView.on("input",()=>{this.isDirty=!0}),this._findPrevButtonView.delegate("execute").to(this,"findPrevious"),this._findNextButtonView.delegate("execute").to(this,"findNext"),this._findPrevButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",({findPrevious:s})=>s),this._findNextButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",({findNext:s})=>s),this._injectFindResultsCounter(),this._replaceInputView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replace:s},n)=>s&&n),this._replaceInputView.bind("infoText").to(this._replaceInputView,"isEnabled",this._replaceInputView,"isFocused",(s,n)=>s||!n?"":e("Tip: Find some text first in order to replace it.")),i.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__inputs"]},children:[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView]}),i}_onFindButtonExecute(){if(!this._textToFind){const t=this.t;this._findInputView.errorText=t("Text to find must not be empty.");return}this.isDirty=!1,this.fire("findNext",{searchText:this._textToFind,matchCase:this._matchCase,wholeWords:this._wholeWordsOnly})}_injectFindResultsCounter(){const t=this.locale,e=t.t,i=this.bindTemplate,s=new p(this.locale);this.bind("_resultsCounterText").to(this,"highlightOffset",this,"matchCount",(o,a)=>e("%0 of %1",[o,a])),s.setTemplate({tag:"span",attributes:{class:["ck","ck-results-counter",i.if("isDirty","ck-hidden")]},children:[{text:i.to("_resultsCounterText")}]});const n=()=>{const o=this._findInputView.fieldView.element;if(!o||!j(o))return;const a=new z(s.element).width,d=t.uiLanguageDirection==="ltr"?"paddingRight":"paddingLeft";a?o.style[d]=`calc( 2 * var(--ck-spacing-standard) + ${a}px )`:o.style[d]=""};this.on("change:_resultsCounterText",n,{priority:"low"}),this.on("change:isDirty",n,{priority:"low"}),this._findInputView.template.children[0].children.push(s)}_createAdvancedOptionsCollapsible(){const t=this.locale.t,e=new H(this.locale,[this._matchCaseSwitchView,this._wholeWordsOnlySwitchView]);return e.set({label:t("Advanced options"),isCollapsed:!0}),e}_createActionButtonsDiv(){const t=new p(this.locale);return this._replaceButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replace:e},i)=>e&&i),this._replaceAllButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replaceAll:e},i)=>e&&i),this._replaceButtonView.on("execute",()=>{this.fire("replace",{searchText:this._textToFind,replaceText:this._textToReplace})}),this._replaceAllButtonView.on("execute",()=>{this.fire("replaceAll",{searchText:this._textToFind,replaceText:this._textToReplace}),this.focus()}),this._findButtonView.on("execute",this._onFindButtonExecute.bind(this)),t.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__actions"]},children:[this._replaceAllButtonView,this._replaceButtonView,this._findButtonView]}),t}_createMatchCaseSwitch(){const t=this.locale.t,e=new R(this.locale);return e.set({label:t("Match case"),withText:!0}),e.bind("isOn").to(this,"_matchCase"),e.on("execute",()=>{this._matchCase=!this._matchCase,this.isDirty=!0}),e}_createWholeWordsOnlySwitch(){const t=this.locale.t,e=new R(this.locale);return e.set({label:t("Whole words only"),withText:!0}),e.bind("isOn").to(this,"_wholeWordsOnly"),e.on("execute",()=>{this._wholeWordsOnly=!this._wholeWordsOnly,this.isDirty=!0}),e}_initFocusCycling(){[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView,this._advancedOptionsCollapsibleView.buttonView,this._matchCaseSwitchView,this._wholeWordsOnlySwitchView,this._replaceAllButtonView,this._replaceButtonView,this._findButtonView].forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}_initKeystrokeHandling(){const t=i=>i.stopPropagation(),e=i=>{i.stopPropagation(),i.preventDefault()};this._keystrokes.listenTo(this.element),this._keystrokes.set("f3",i=>{e(i),this._findNextButtonView.fire("execute")}),this._keystrokes.set("shift+f3",i=>{e(i),this._findPrevButtonView.fire("execute")}),this._keystrokes.set("enter",i=>{const s=i.target;s===this._findInputView.fieldView.element?(this._areCommandsEnabled.findNext?this._findNextButtonView.fire("execute"):this._findButtonView.fire("execute"),e(i)):s===this._replaceInputView.fieldView.element&&!this.isDirty&&(this._replaceButtonView.fire("execute"),e(i))}),this._keystrokes.set("shift+enter",i=>{i.target===this._findInputView.fieldView.element&&(this._areCommandsEnabled.findPrevious?this._findPrevButtonView.fire("execute"):this._findButtonView.fire("execute"),e(i))}),this._keystrokes.set("arrowright",t),this._keystrokes.set("arrowleft",t),this._keystrokes.set("arrowup",t),this._keystrokes.set("arrowdown",t)}_createButton(t){const e=new k(this.locale);return e.set(t),e}_createInputField(t,e){const i=new W(this.locale,$);return i.label=t,i.class=e,i}}class X extends _{constructor(t){super(t);u(this,"formView");t.config.define("findAndReplace.uiType","dialog"),this.formView=null}static get requires(){return[B]}static get pluginName(){return"FindAndReplaceUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.config.get("findAndReplace.uiType")==="dropdown",i=t.commands.get("find"),s=this.editor.t;t.ui.componentFactory.add("findAndReplace",()=>{let n;return e?(n=this._createDropdown(),n.bind("isEnabled").to(i)):n=this._createDialogButtonForToolbar(),t.keystrokes.set("Ctrl+F",(o,a)=>{if(i.isEnabled){if(n instanceof A){const d=n.buttonView;d.isOn||d.fire("execute")}else n.isOn?t.plugins.get("Dialog").view.focus():n.fire("execute");a()}}),n}),e||t.ui.componentFactory.add("menuBar:findAndReplace",()=>this._createDialogButtonForMenuBar()),t.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Find in the document"),keystroke:"CTRL+F"}]})}_createDropdown(){const t=this.editor,e=t.locale.t,i=I(t.locale);return i.once("change:isOpen",()=>{this.formView=this._createFormView(),this.formView.children.add(new E(t.locale,{label:e("Find and replace")}),0),i.panelView.children.add(this.formView)}),i.on("change:isOpen",(s,n,o)=>{o?this._setupFormView():this.fire("searchReseted")},{priority:"low"}),i.buttonView.set({icon:b,label:e("Find and replace"),keystroke:"CTRL+F",tooltip:!0}),i}_createDialogButtonForToolbar(){const t=this.editor,e=this._createButton(k),i=t.plugins.get("Dialog");return e.set({tooltip:!0}),e.bind("isOn").to(i,"id",s=>s==="findAndReplace"),e.on("execute",()=>{e.isOn?i.hide():this._showDialog()}),e}_createDialogButtonForMenuBar(){const t=this._createButton(D),e=this.editor.plugins.get("Dialog"),i=this.editor.plugins.get("Dialog");return t.set({role:"menuitemcheckbox",isToggleable:!0}),t.bind("isOn").to(i,"id",s=>s==="findAndReplace"),t.on("execute",()=>{if(e.id==="findAndReplace"){e.hide();return}this._showDialog()}),t}_createButton(t){const e=this.editor,i=e.commands.get("find"),s=new t(e.locale),n=e.locale.t;return s.bind("isEnabled").to(i),s.set({icon:b,label:n("Find and replace"),keystroke:"CTRL+F"}),s}_showDialog(){const t=this.editor,e=t.plugins.get("Dialog"),i=t.locale.t;this.formView||(this.formView=this._createFormView()),e.show({id:"findAndReplace",title:i("Find and replace"),content:this.formView,position:O.EDITOR_TOP_SIDE,onShow:()=>{this._setupFormView()},onHide:()=>{this.fire("searchReseted")}})}_createFormView(){const t=this.editor,e=new(S(J))(t.locale),i=t.commands,n=this.editor.plugins.get("FindAndReplaceEditing").state;e.bind("highlightOffset").to(n,"highlightedOffset"),e.listenTo(n.results,"change",()=>{e.matchCount=n.results.length});const o=i.get("findNext"),a=i.get("findPrevious"),d=i.get("replace"),l=i.get("replaceAll");return e.bind("_areCommandsEnabled").to(o,"isEnabled",a,"isEnabled",d,"isEnabled",l,"isEnabled",(h,g,f,m)=>({findNext:h,findPrevious:g,replace:f,replaceAll:m})),e.delegate("findNext","findPrevious","replace","replaceAll").to(this),e.on("change:isDirty",(h,g,f)=>{f&&this.fire("searchReseted")}),e}_setupFormView(){this.formView.disableCssTransitions(),this.formView.reset(),this.formView._findInputView.fieldView.select(),this.formView.enableCssTransitions()}}class Y extends w{constructor(t,e){super(t);u(this,"_state");this.isEnabled=!0,this.affectsData=!1,this._state=e}execute(t,{matchCase:e,wholeWords:i}={}){const{editor:s}=this,{model:n}=s,o=s.plugins.get("FindAndReplaceUtils");let a,d="";typeof t=="string"?a=(...g)=>({results:o.findByTextCallback(t,{matchCase:e,wholeWords:i})(...g),searchText:t}):a=t;const l=a;a=(...g)=>{const f=l(...g);return f&&"searchText"in f&&(d=f.searchText),f};const h=n.document.getRootNames().reduce((g,f)=>o.updateFindResultFromRange(n.createRangeIn(n.document.getRoot(f)),n,a,g),null);return this._state.clear(n),this._state.results.addMany(h),this._state.highlightedResult=h.get(0),this._state.searchText=d,a&&(this._state.lastSearchCallback=a),this._state.matchCase=!!e,this._state.matchWholeWords=!!i,{results:h,findCallback:a}}}class ee extends q(){constructor(r){super(),this.set("results",new x),this.set("highlightedResult",null),this.set("highlightedOffset",0),this.set("searchText",""),this.set("replaceText",""),this.set("lastSearchCallback",null),this.set("matchCase",!1),this.set("matchWholeWords",!1),this.results.on("change",(t,{removed:e,index:i})=>{if(Array.from(e).length){let s=!1;if(r.change(n=>{for(const o of e)this.highlightedResult===o&&(s=!0),r.markers.has(o.marker.name)&&n.removeMarker(o.marker)}),s){const n=i>=this.results.length?0:i;this.highlightedResult=this.results.get(n)}}}),this.on("change:highlightedResult",()=>{this.refreshHighlightOffset(r)})}clear(r){this.searchText="",r.change(t=>{if(this.highlightedResult){const e=this.highlightedResult.marker.name.split(":")[1],i=r.markers.get(`findResultHighlighted:${e}`);i&&t.removeMarker(i)}[...this.results].forEach(({marker:e})=>{t.removeMarker(e)})}),this.results.clear()}refreshHighlightOffset(r){const{highlightedResult:t,results:e}=this;t?this.highlightedOffset=C(r,[...e]).indexOf(t)+1:this.highlightedOffset=0}}function C(c,r){const t={before:-1,same:0,after:1,different:1};return c.document.getRootNames().flatMap(e=>r.filter(i=>i.marker.getStart().root.rootName===e).sort((i,s)=>t[i.marker.getStart().compareWith(s.marker.getStart())]))}class y extends w{constructor(t,e){super(t);u(this,"_state");this.isEnabled=!0,this._state=e,this._isEnabledBasedOnSelection=!1}_replace(t,e){const{model:i}=this.editor,s=e.marker.getRange();i.canEditAt(s)&&i.change(n=>{if(s.root.rootName==="$graveyard"){this._state.results.remove(e);return}let o={};for(const a of s.getItems())if(a.is("$text")||a.is("$textProxy")){o=a.getAttributes();break}i.insertContent(n.createText(t,o),s),this._state.results.has(e)&&this._state.results.remove(e)})}}class te extends y{execute(r,t){const e=Math.max(this._state.highlightedOffset-1,0);if(this._replace(r,t),this._state.results.length){const i=C(this.editor.model,[...this._state.results]);this._state.highlightedResult=i[e%i.length]}}}class ie extends y{execute(r,t){const{editor:e}=this,{model:i}=e,s=e.plugins.get("FindAndReplaceUtils"),n=t instanceof x?t:i.document.getRootNames().reduce((o,a)=>s.updateFindResultFromRange(i.createRangeIn(i.document.getRoot(a)),i,s.findByTextCallback(t,this._state),o),null);n.length&&i.change(()=>{[...n].forEach(o=>{this._replace(r,o)})})}}class T extends w{constructor(t,e){super(t);u(this,"_state");this.affectsData=!1,this._state=e,this.isEnabled=!1,this.listenTo(this._state.results,"change",()=>{this.isEnabled=this._state.results.length>1})}refresh(){this.isEnabled=this._state.results.length>1}execute(){const t=this._state.results,e=t.getIndex(this._state.highlightedResult),i=e+1>=t.length?0:e+1;this._state.highlightedResult=this._state.results.get(i)}}class se extends T{execute(){const t=this._state.results.getIndex(this._state.highlightedResult),e=t-1<0?this._state.results.length-1:t-1;this._state.highlightedResult=this._state.results.get(e)}}class ne extends _{static get pluginName(){return"FindAndReplaceUtils"}static get isOfficialPlugin(){return!0}updateFindResultFromRange(r,t,e,i){const s=i||new x,n=o=>s.find(a=>{const{marker:d}=a,l=d.getRange(),h=o.getRange();return l.isEqual(h)});return t.change(o=>{[...r].forEach(({type:a,item:d})=>{if(a==="elementStart"&&t.schema.checkChild(d,"$text")){let l=e({item:d,text:this.rangeToText(t.createRangeIn(d))});if(!l)return;"results"in l&&(l=l.results),l.forEach(h=>{const g=`findResult:${U()}`,f=o.addMarker(g,{usingOperation:!1,affectsData:!1,range:o.createRange(o.createPositionAt(d,h.start),o.createPositionAt(d,h.end))}),m=re(s,f);n(f)||s.add({id:g,label:h.label,marker:f},m)})}})}),s}rangeToText(r){return Array.from(r.getItems({shallow:!0})).reduce((t,e)=>e.is("$text")||e.is("$textProxy")?t+e.data:`${t}
5
- `,"")}findByTextCallback(r,t){let e="gu";t.matchCase||(e+="i");let i=`(${Z(r)})`;if(t.wholeWords){const o="[^a-zA-ZÀ-ɏḀ-ỿ]";new RegExp("^"+o).test(r)||(i=`(^|${o}|_)${i}`),new RegExp(o+"$").test(r)||(i=`${i}(?=_|${o}|$)`)}const s=new RegExp(i,e);function n({text:o}){return[...o.matchAll(s)].map(oe)}return n}}function re(c,r){const t=c.find(({marker:e})=>r.getStart().isBefore(e.getStart()));return t?c.getIndex(t):c.length}function oe(c){const r=c.length-1;let t=c.index;return c.length===3&&(t+=c[1].length),{label:c[r],start:t,end:t+c[r].length}}const ae="ck-find-result_selected";class le extends _{constructor(){super(...arguments);u(this,"state");u(this,"_onDocumentChange",()=>{const t=new Set,e=new Set,i=this.editor.model,{results:s}=this.state,n=i.document.differ.getChanges(),o=i.document.differ.getChangedMarkers();n.forEach(l=>{l.position&&(l.name==="$text"||l.position.nodeAfter&&i.schema.isInline(l.position.nodeAfter)?(t.add(l.position.parent),[...i.markers.getMarkersAtPosition(l.position)].forEach(h=>{e.add(h.name)})):l.type==="insert"&&l.position.nodeAfter&&t.add(l.position.nodeAfter))}),o.forEach(({name:l,data:{newRange:h}})=>{h&&h.start.root.rootName==="$graveyard"&&e.add(l)}),t.forEach(l=>{[...i.markers.getMarkersIntersectingRange(i.createRangeIn(l))].forEach(g=>e.add(g.name))}),e.forEach(l=>{s.has(l)&&(s.get(l)===this.state.highlightedResult&&(this.state.highlightedResult=null),s.remove(l))});const a=[],d=this.editor.plugins.get("FindAndReplaceUtils");t.forEach(l=>{const h=d.updateFindResultFromRange(i.createRangeOn(l),i,this.state.lastSearchCallback,s);a.push(...h)}),o.forEach(l=>{if(l.data.newRange){const h=d.updateFindResultFromRange(l.data.newRange,i,this.state.lastSearchCallback,s);a.push(...h)}}),!this.state.highlightedResult&&a.length?this.state.highlightedResult=a[0]:this.state.refreshHighlightOffset(i)})}static get requires(){return[ne]}static get pluginName(){return"FindAndReplaceEditing"}static get isOfficialPlugin(){return!0}init(){this.state=new ee(this.editor.model),this.set("_isSearchActive",!1),this._defineConverters(),this._defineCommands(),this.listenTo(this.state,"change:highlightedResult",(i,s,n,o)=>{const{model:a}=this.editor;a.change(d=>{if(o){const l=o.marker.name.split(":")[1],h=a.markers.get(`findResultHighlighted:${l}`);h&&d.removeMarker(h)}if(n){const l=n.marker.name.split(":")[1];d.addMarker(`findResultHighlighted:${l}`,{usingOperation:!1,affectsData:!1,range:n.marker.getRange()})}})});/* istanbul ignore next -- @preserve */const e=Q(((i,s,n)=>{if(n){const o=this.editor.editing.view.domConverter,a=this.editor.editing.mapper.toViewRange(n.marker.getRange());L({target:o.viewRangeToDom(a),viewportOffset:40})}}).bind(this),32);this.listenTo(this.state,"change:highlightedResult",e,{priority:"low"}),this.listenTo(this.editor,"destroy",e.cancel),this.on("change:_isSearchActive",(i,s,n)=>{n?this.listenTo(this.editor.model.document,"change:data",this._onDocumentChange):this.stopListening(this.editor.model.document,"change:data",this._onDocumentChange)})}find(t,e){return this._isSearchActive=!0,this.editor.execute("find",t,e),this.state.results}stop(){this.state.clear(this.editor.model),this._isSearchActive=!1}_defineCommands(){this.editor.commands.add("find",new Y(this.editor,this.state)),this.editor.commands.add("findNext",new T(this.editor,this.state)),this.editor.commands.add("findPrevious",new se(this.editor,this.state)),this.editor.commands.add("replace",new te(this.editor,this.state)),this.editor.commands.add("replaceAll",new ie(this.editor,this.state))}_defineConverters(){const{editor:t}=this;t.conversion.for("editingDowncast").markerToHighlight({model:"findResult",view:({markerName:e})=>{const[,i]=e.split(":");return{name:"span",classes:["ck-find-result"],attributes:{"data-find-result":i}}}}),t.conversion.for("editingDowncast").markerToHighlight({model:"findResultHighlighted",view:({markerName:e})=>{const[,i]=e.split(":");return{name:"span",classes:[ae],attributes:{"data-find-result":i}}}})}}class _e extends _{static get requires(){return[le,X]}static get pluginName(){return"FindAndReplace"}static get isOfficialPlugin(){return!0}init(){const r=this.editor.plugins.get("FindAndReplaceUI"),t=this.editor.plugins.get("FindAndReplaceEditing"),e=t.state;r.on("findNext",(i,s)=>{s?(e.searchText=s.searchText,t.find(s.searchText,s)):this.editor.execute("findNext")}),r.on("findPrevious",(i,s)=>{s&&e.searchText!==s.searchText?t.find(s.searchText):this.editor.execute("findPrevious")}),r.on("replace",(i,s)=>{e.searchText!==s.searchText&&t.find(s.searchText);const n=e.highlightedResult;n&&this.editor.execute("replace",s.replaceText,n)}),r.on("replaceAll",(i,s)=>{e.searchText!==s.searchText&&t.find(s.searchText),this.editor.execute("replaceAll",s.replaceText,e.results)}),r.on("searchReseted",()=>{e.clear(this.editor.model),t.stop()})}}export{_e as FindAndReplace,le as FindAndReplaceEditing,X as FindAndReplaceUI,ne as FindAndReplaceUtils,Y as FindCommand,T as FindNextCommand,se as FindPreviousCommand,ie as ReplaceAllCommand,te as ReplaceCommand};
4
+ */class z extends g{children;_findInputView;_replaceInputView;_findButtonView;_findPrevButtonView;_findNextButtonView;_advancedOptionsCollapsibleView;_matchCaseSwitchView;_wholeWordsOnlySwitchView;_replaceButtonView;_replaceAllButtonView;_inputsDivView;_actionButtonsDivView;_focusTracker;_keystrokes;_focusables;focusCycler;constructor(t){super(t);const e=t.t;this.children=this.createCollection(),this.set("matchCount",0),this.set("highlightOffset",0),this.set("isDirty",!1),this.set("_areCommandsEnabled",{}),this.set("_resultsCounterText",""),this.set("_matchCase",!1),this.set("_wholeWordsOnly",!1),this.bind("_searchResultsFound").to(this,"matchCount",this,"isDirty",(i,s)=>i>0&&!s),this._findInputView=this._createInputField(e("Find in text…")),this._findPrevButtonView=this._createButton({label:e("Previous result"),class:"ck-button-prev",icon:x,keystroke:"Shift+F3",tooltip:!0}),this._findNextButtonView=this._createButton({label:e("Next result"),class:"ck-button-next",icon:x,keystroke:"F3",tooltip:!0}),this._replaceInputView=this._createInputField(e("Replace with…"),"ck-labeled-field-replace"),this._inputsDivView=this._createInputsDiv(),this._matchCaseSwitchView=this._createMatchCaseSwitch(),this._wholeWordsOnlySwitchView=this._createWholeWordsOnlySwitch(),this._advancedOptionsCollapsibleView=this._createAdvancedOptionsCollapsible(),this._replaceAllButtonView=this._createButton({label:e("Replace all"),class:"ck-button-replaceall",withText:!0}),this._replaceButtonView=this._createButton({label:e("Replace"),class:"ck-button-replace",withText:!0}),this._findButtonView=this._createButton({label:e("Find"),class:"ck-button-find ck-button-action",withText:!0}),this._actionButtonsDivView=this._createActionButtonsDiv(),this._focusTracker=new L,this._keystrokes=new U,this._focusables=new D,this.focusCycler=new O({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this._keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.children.addMany([this._inputsDivView,this._advancedOptionsCollapsibleView,this._actionButtonsDivView]),this.setTemplate({tag:"form",attributes:{class:["ck","ck-find-and-replace-form"],tabindex:"-1"},children:this.children})}render(){super.render(),S({view:this}),this._initFocusCycling(),this._initKeystrokeHandling()}destroy(){super.destroy(),this._focusTracker.destroy(),this._keystrokes.destroy()}focus(t){t===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}reset(){this._findInputView.errorText=null,this.isDirty=!0}get _textToFind(){return this._findInputView.fieldView.element.value}get _textToReplace(){return this._replaceInputView.fieldView.element.value}_createInputsDiv(){const t=this.locale,e=t.t,i=new g(t);return this._findInputView.fieldView.on("input",()=>{this.isDirty=!0}),this._findPrevButtonView.delegate("execute").to(this,"findPrevious"),this._findNextButtonView.delegate("execute").to(this,"findNext"),this._findPrevButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",({findPrevious:s})=>s),this._findNextButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",({findNext:s})=>s),this._injectFindResultsCounter(),this._replaceInputView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replace:s},n)=>s&&n),this._replaceInputView.bind("infoText").to(this._replaceInputView,"isEnabled",this._replaceInputView,"isFocused",(s,n)=>s||!n?"":e("Tip: Find some text first in order to replace it.")),i.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__inputs"]},children:[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView]}),i}_onFindButtonExecute(){if(!this._textToFind){const t=this.t;this._findInputView.errorText=t("Text to find must not be empty.");return}this.isDirty=!1,this.fire("findNext",{searchText:this._textToFind,matchCase:this._matchCase,wholeWords:this._wholeWordsOnly})}_injectFindResultsCounter(){const t=this.locale,e=t.t,i=this.bindTemplate,s=new g(this.locale);this.bind("_resultsCounterText").to(this,"highlightOffset",this,"matchCount",(o,r)=>e("%0 of %1",[o,r])),s.setTemplate({tag:"span",attributes:{class:["ck","ck-results-counter",i.if("isDirty","ck-hidden")]},children:[{text:i.to("_resultsCounterText")}]});const n=()=>{const o=this._findInputView.fieldView.element;if(!o||!q(o))return;const r=new G(s.element).width,h=t.uiLanguageDirection==="ltr"?"paddingRight":"paddingLeft";r?o.style[h]=`calc( 2 * var(--ck-spacing-standard) + ${r}px )`:o.style[h]=""};this.on("change:_resultsCounterText",n,{priority:"low"}),this.on("change:isDirty",n,{priority:"low"}),this._findInputView.template.children[0].children.push(s)}_createAdvancedOptionsCollapsible(){const t=this.locale.t,e=new P(this.locale,[this._matchCaseSwitchView,this._wholeWordsOnlySwitchView]);return e.set({label:t("Advanced options"),isCollapsed:!0}),e}_createActionButtonsDiv(){const t=new g(this.locale);return this._replaceButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replace:e},i)=>e&&i),this._replaceAllButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replaceAll:e},i)=>e&&i),this._replaceButtonView.on("execute",()=>{this.fire("replace",{searchText:this._textToFind,replaceText:this._textToReplace})}),this._replaceAllButtonView.on("execute",()=>{this.fire("replaceAll",{searchText:this._textToFind,replaceText:this._textToReplace}),this.focus()}),this._findButtonView.on("execute",this._onFindButtonExecute.bind(this)),t.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__actions"]},children:[this._replaceAllButtonView,this._replaceButtonView,this._findButtonView]}),t}_createMatchCaseSwitch(){const t=this.locale.t,e=new b(this.locale);return e.set({label:t("Match case"),withText:!0}),e.bind("isOn").to(this,"_matchCase"),e.on("execute",()=>{this._matchCase=!this._matchCase,this.isDirty=!0}),e}_createWholeWordsOnlySwitch(){const t=this.locale.t,e=new b(this.locale);return e.set({label:t("Whole words only"),withText:!0}),e.bind("isOn").to(this,"_wholeWordsOnly"),e.on("execute",()=>{this._wholeWordsOnly=!this._wholeWordsOnly,this.isDirty=!0}),e}_initFocusCycling(){[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView,this._advancedOptionsCollapsibleView.buttonView,this._matchCaseSwitchView,this._wholeWordsOnlySwitchView,this._replaceAllButtonView,this._replaceButtonView,this._findButtonView].forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}_initKeystrokeHandling(){const t=i=>i.stopPropagation(),e=i=>{i.stopPropagation(),i.preventDefault()};this._keystrokes.listenTo(this.element),this._keystrokes.set("f3",i=>{e(i),this._findNextButtonView.fire("execute")}),this._keystrokes.set("shift+f3",i=>{e(i),this._findPrevButtonView.fire("execute")}),this._keystrokes.set("enter",i=>{const s=i.target;s===this._findInputView.fieldView.element?(this._areCommandsEnabled.findNext?this._findNextButtonView.fire("execute"):this._findButtonView.fire("execute"),e(i)):s===this._replaceInputView.fieldView.element&&!this.isDirty&&(this._replaceButtonView.fire("execute"),e(i))}),this._keystrokes.set("shift+enter",i=>{i.target===this._findInputView.fieldView.element&&(this._areCommandsEnabled.findPrevious?this._findPrevButtonView.fire("execute"):this._findButtonView.fire("execute"),e(i))}),this._keystrokes.set("arrowright",t),this._keystrokes.set("arrowleft",t),this._keystrokes.set("arrowup",t),this._keystrokes.set("arrowdown",t)}_createButton(t){const e=new V(this.locale);return e.set(t),e}_createInputField(t,e){const i=new N(this.locale,M);return i.label=t,i.class=e,i}}class Q extends p{static get requires(){return[T]}static get pluginName(){return"FindAndReplaceUI"}static get isOfficialPlugin(){return!0}formView;constructor(t){super(t),t.config.define("findAndReplace.uiType","dialog"),this.formView=null}init(){const t=this.editor,e=t.config.get("findAndReplace.uiType")==="dropdown",i=t.commands.get("find"),s=this.editor.t;t.ui.componentFactory.add("findAndReplace",()=>{let n;return e?(n=this._createDropdown(),n.bind("isEnabled").to(i)):n=this._createDialogButtonForToolbar(),t.keystrokes.set("Ctrl+F",(o,r)=>{if(i.isEnabled){if(n instanceof v){const h=n.buttonView;h.isOn||h.fire("execute")}else n.isOn?t.plugins.get("Dialog").view.focus():n.fire("execute");r()}}),n}),e||t.ui.componentFactory.add("menuBar:findAndReplace",()=>this._createDialogButtonForMenuBar()),t.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Find in the document"),keystroke:"CTRL+F"}]})}_createDropdown(){const t=this.editor,e=t.locale.t,i=F(t.locale);return i.once("change:isOpen",()=>{this.formView=this._createFormView(),this.formView.children.add(new B(t.locale,{label:e("Find and replace")}),0),i.panelView.children.add(this.formView)}),i.on("change:isOpen",(s,n,o)=>{o?this._setupFormView():this.fire("searchReseted")},{priority:"low"}),i.buttonView.set({icon:w,label:e("Find and replace"),keystroke:"CTRL+F",tooltip:!0}),i}_createDialogButtonForToolbar(){const t=this.editor,e=this._createButton(V),i=t.plugins.get("Dialog");return e.set({tooltip:!0}),e.bind("isOn").to(i,"id",s=>s==="findAndReplace"),e.on("execute",()=>{e.isOn?i.hide():this._showDialog()}),e}_createDialogButtonForMenuBar(){const t=this._createButton(A),e=this.editor.plugins.get("Dialog"),i=this.editor.plugins.get("Dialog");return t.set({role:"menuitemcheckbox",isToggleable:!0}),t.bind("isOn").to(i,"id",s=>s==="findAndReplace"),t.on("execute",()=>{if(e.id==="findAndReplace"){e.hide();return}this._showDialog()}),t}_createButton(t){const e=this.editor,i=e.commands.get("find"),s=new t(e.locale),n=e.locale.t;return s.bind("isEnabled").to(i),s.set({icon:w,label:n("Find and replace"),keystroke:"CTRL+F"}),s}_showDialog(){const t=this.editor,e=t.plugins.get("Dialog"),i=t.locale.t;this.formView||(this.formView=this._createFormView()),e.show({id:"findAndReplace",title:i("Find and replace"),content:this.formView,position:I.EDITOR_TOP_SIDE,onShow:()=>{this._setupFormView()},onHide:()=>{this.fire("searchReseted")}})}_createFormView(){const t=this.editor,e=new(E(z))(t.locale),i=t.commands,n=this.editor.plugins.get("FindAndReplaceEditing").state;e.bind("highlightOffset").to(n,"highlightedOffset"),e.listenTo(n.results,"change",()=>{e.matchCount=n.results.length});const o=i.get("findNext"),r=i.get("findPrevious"),h=i.get("replace"),a=i.get("replaceAll");return e.bind("_areCommandsEnabled").to(o,"isEnabled",r,"isEnabled",h,"isEnabled",a,"isEnabled",(l,d,u,f)=>({findNext:l,findPrevious:d,replace:u,replaceAll:f})),e.delegate("findNext","findPrevious","replace","replaceAll").to(this),e.on("change:isDirty",(l,d,u)=>{u&&this.fire("searchReseted")}),e}_setupFormView(){this.formView.disableCssTransitions(),this.formView.reset(),this.formView._findInputView.fieldView.select(),this.formView.enableCssTransitions()}}class Z extends _{_state;constructor(t,e){super(t),this.isEnabled=!0,this.affectsData=!1,this._state=e}execute(t,{matchCase:e,wholeWords:i}={}){const{editor:s}=this,{model:n}=s,o=s.plugins.get("FindAndReplaceUtils");let r,h="";typeof t=="string"?r=(...d)=>({results:o.findByTextCallback(t,{matchCase:e,wholeWords:i})(...d),searchText:t}):r=t;const a=r;r=(...d)=>{const u=a(...d);return u&&"searchText"in u&&(h=u.searchText),u};const l=n.document.getRootNames().reduce((d,u)=>o.updateFindResultFromRange(n.createRangeIn(n.document.getRoot(u)),n,r,d),null);return this._state.clear(n),this._state.results.addMany(l),this._state.highlightedResult=l.get(0),this._state.searchText=h,r&&(this._state.lastSearchCallback=r),this._state.matchCase=!!e,this._state.matchWholeWords=!!i,{results:l,findCallback:r}}}class J extends $(){constructor(t){super(),this.set("results",new m),this.set("highlightedResult",null),this.set("highlightedOffset",0),this.set("searchText",""),this.set("replaceText",""),this.set("lastSearchCallback",null),this.set("matchCase",!1),this.set("matchWholeWords",!1),this.results.on("change",(e,{removed:i,index:s})=>{if(Array.from(i).length){let n=!1;if(t.change(o=>{for(const r of i)this.highlightedResult===r&&(n=!0),t.markers.has(r.marker.name)&&o.removeMarker(r.marker)}),n){const o=s>=this.results.length?0:s;this.highlightedResult=this.results.get(o)}}}),this.on("change:highlightedResult",()=>{this.refreshHighlightOffset(t)})}clear(t){this.searchText="",t.change(e=>{if(this.highlightedResult){const i=this.highlightedResult.marker.name.split(":")[1],s=t.markers.get(`findResultHighlighted:${i}`);s&&e.removeMarker(s)}[...this.results].forEach(({marker:i})=>{e.removeMarker(i)})}),this.results.clear()}refreshHighlightOffset(t){const{highlightedResult:e,results:i}=this;e?this.highlightedOffset=R(t,[...i]).indexOf(e)+1:this.highlightedOffset=0}}function R(c,t){const e={before:-1,same:0,after:1,different:1};return c.document.getRootNames().flatMap(i=>t.filter(s=>s.marker.getStart().root.rootName===i).sort((s,n)=>e[s.marker.getStart().compareWith(n.marker.getStart())]))}class k extends _{_state;constructor(t,e){super(t),this.isEnabled=!0,this._state=e,this._isEnabledBasedOnSelection=!1}_replace(t,e){const{model:i}=this.editor,s=e.marker.getRange();i.canEditAt(s)&&i.change(n=>{if(s.root.rootName==="$graveyard"){this._state.results.remove(e);return}let o={};for(const r of s.getItems())if(r.is("$text")||r.is("$textProxy")){o=r.getAttributes();break}i.insertContent(n.createText(t,o),s),this._state.results.has(e)&&this._state.results.remove(e)})}}class X extends k{execute(t,e){const i=Math.max(this._state.highlightedOffset-1,0);if(this._replace(t,e),this._state.results.length){const s=R(this.editor.model,[...this._state.results]);this._state.highlightedResult=s[i%s.length]}}}class Y extends k{execute(t,e){const{editor:i}=this,{model:s}=i,n=i.plugins.get("FindAndReplaceUtils"),o=e instanceof m?e:s.document.getRootNames().reduce((r,h)=>n.updateFindResultFromRange(s.createRangeIn(s.document.getRoot(h)),s,n.findByTextCallback(e,this._state),r),null);o.length&&s.change(()=>{[...o].forEach(r=>{this._replace(t,r)})})}}class C extends _{_state;constructor(t,e){super(t),this.affectsData=!1,this._state=e,this.isEnabled=!1,this.listenTo(this._state.results,"change",()=>{this.isEnabled=this._state.results.length>1})}refresh(){this.isEnabled=this._state.results.length>1}execute(){const t=this._state.results,e=t.getIndex(this._state.highlightedResult),i=e+1>=t.length?0:e+1;this._state.highlightedResult=this._state.results.get(i)}}class ee extends C{execute(){const e=this._state.results.getIndex(this._state.highlightedResult),i=e-1<0?this._state.results.length-1:e-1;this._state.highlightedResult=this._state.results.get(i)}}class te extends p{static get pluginName(){return"FindAndReplaceUtils"}static get isOfficialPlugin(){return!0}updateFindResultFromRange(t,e,i,s){const n=s||new m,o=r=>n.find(h=>{const{marker:a}=h,l=a.getRange(),d=r.getRange();return l.isEqual(d)});return e.change(r=>{[...t].forEach(({type:h,item:a})=>{if(h==="elementStart"&&e.schema.checkChild(a,"$text")){let l=i({item:a,text:this.rangeToText(e.createRangeIn(a))});if(!l)return;"results"in l&&(l=l.results),l.forEach(d=>{const u=`findResult:${W()}`,f=r.addMarker(u,{usingOperation:!1,affectsData:!1,range:r.createRange(r.createPositionAt(a,d.start),r.createPositionAt(a,d.end))}),y=ie(n,f);o(f)||n.add({id:u,label:d.label,marker:f},y)})}})}),n}rangeToText(t){return Array.from(t.getItems({shallow:!0})).reduce((e,i)=>i.is("$text")||i.is("$textProxy")?e+i.data:`${e}
5
+ `,"")}findByTextCallback(t,e){let i="gu";e.matchCase||(i+="i");let s=`(${j(t)})`;if(e.wholeWords){const r="[^a-zA-ZÀ-ɏḀ-ỿ]";new RegExp("^"+r).test(t)||(s=`(^|${r}|_)${s}`),new RegExp(r+"$").test(t)||(s=`${s}(?=_|${r}|$)`)}const n=new RegExp(s,i);function o({text:r}){return[...r.matchAll(n)].map(se)}return o}}function ie(c,t){const e=c.find(({marker:i})=>t.getStart().isBefore(i.getStart()));return e?c.getIndex(e):c.length}function se(c){const t=c.length-1;let e=c.index;return c.length===3&&(e+=c[1].length),{label:c[t],start:e,end:e+c[t].length}}const ne="ck-find-result_selected";class re extends p{static get requires(){return[te]}static get pluginName(){return"FindAndReplaceEditing"}static get isOfficialPlugin(){return!0}state;init(){this.state=new J(this.editor.model),this.set("_isSearchActive",!1),this._defineConverters(),this._defineCommands(),this.listenTo(this.state,"change:highlightedResult",(i,s,n,o)=>{const{model:r}=this.editor;r.change(h=>{if(o){const a=o.marker.name.split(":")[1],l=r.markers.get(`findResultHighlighted:${a}`);l&&h.removeMarker(l)}if(n){const a=n.marker.name.split(":")[1];h.addMarker(`findResultHighlighted:${a}`,{usingOperation:!1,affectsData:!1,range:n.marker.getRange()})}})});/* istanbul ignore next -- @preserve */const e=K(((i,s,n)=>{if(n){const o=this.editor.editing.view.domConverter,r=this.editor.editing.mapper.toViewRange(n.marker.getRange());H({target:o.viewRangeToDom(r),viewportOffset:40})}}).bind(this),32);this.listenTo(this.state,"change:highlightedResult",e,{priority:"low"}),this.listenTo(this.editor,"destroy",e.cancel),this.on("change:_isSearchActive",(i,s,n)=>{n?this.listenTo(this.editor.model.document,"change:data",this._onDocumentChange):this.stopListening(this.editor.model.document,"change:data",this._onDocumentChange)})}find(t,e){return this._isSearchActive=!0,this.editor.execute("find",t,e),this.state.results}stop(){this.state.clear(this.editor.model),this._isSearchActive=!1}_defineCommands(){this.editor.commands.add("find",new Z(this.editor,this.state)),this.editor.commands.add("findNext",new C(this.editor,this.state)),this.editor.commands.add("findPrevious",new ee(this.editor,this.state)),this.editor.commands.add("replace",new X(this.editor,this.state)),this.editor.commands.add("replaceAll",new Y(this.editor,this.state))}_defineConverters(){const{editor:t}=this;t.conversion.for("editingDowncast").markerToHighlight({model:"findResult",view:({markerName:e})=>{const[,i]=e.split(":");return{name:"span",classes:["ck-find-result"],attributes:{"data-find-result":i}}}}),t.conversion.for("editingDowncast").markerToHighlight({model:"findResultHighlighted",view:({markerName:e})=>{const[,i]=e.split(":");return{name:"span",classes:[ne],attributes:{"data-find-result":i}}}})}_onDocumentChange=()=>{const t=new Set,e=new Set,i=this.editor.model,{results:s}=this.state,n=i.document.differ.getChanges(),o=i.document.differ.getChangedMarkers();n.forEach(a=>{a.position&&(a.name==="$text"||a.position.nodeAfter&&i.schema.isInline(a.position.nodeAfter)?(t.add(a.position.parent),[...i.markers.getMarkersAtPosition(a.position)].forEach(l=>{e.add(l.name)})):a.type==="insert"&&a.position.nodeAfter&&t.add(a.position.nodeAfter))}),o.forEach(({name:a,data:{newRange:l}})=>{l&&l.start.root.rootName==="$graveyard"&&e.add(a)}),t.forEach(a=>{[...i.markers.getMarkersIntersectingRange(i.createRangeIn(a))].forEach(d=>e.add(d.name))}),e.forEach(a=>{s.has(a)&&(s.get(a)===this.state.highlightedResult&&(this.state.highlightedResult=null),s.remove(a))});const r=[],h=this.editor.plugins.get("FindAndReplaceUtils");t.forEach(a=>{const l=h.updateFindResultFromRange(i.createRangeOn(a),i,this.state.lastSearchCallback,s);r.push(...l)}),o.forEach(a=>{if(a.data.newRange){const l=h.updateFindResultFromRange(a.data.newRange,i,this.state.lastSearchCallback,s);r.push(...l)}}),!this.state.highlightedResult&&r.length?this.state.highlightedResult=r[0]:this.state.refreshHighlightOffset(i)}}class ue extends p{static get requires(){return[re,Q]}static get pluginName(){return"FindAndReplace"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.plugins.get("FindAndReplaceUI"),e=this.editor.plugins.get("FindAndReplaceEditing"),i=e.state;t.on("findNext",(s,n)=>{n?(i.searchText=n.searchText,e.find(n.searchText,n)):this.editor.execute("findNext")}),t.on("findPrevious",(s,n)=>{n&&i.searchText!==n.searchText?e.find(n.searchText):this.editor.execute("findPrevious")}),t.on("replace",(s,n)=>{i.searchText!==n.searchText&&e.find(n.searchText);const o=i.highlightedResult;o&&this.editor.execute("replace",n.replaceText,o)}),t.on("replaceAll",(s,n)=>{i.searchText!==n.searchText&&e.find(n.searchText),this.editor.execute("replaceAll",n.replaceText,i.results)}),t.on("searchReseted",()=>{i.clear(this.editor.model),e.stop()})}}export{ue as FindAndReplace,re as FindAndReplaceEditing,Q as FindAndReplaceUI,te as FindAndReplaceUtils,Z as FindCommand,C as FindNextCommand,ee as FindPreviousCommand,Y as ReplaceAllCommand,X as ReplaceCommand};
@@ -1,7 +1,7 @@
1
- var j=Object.defineProperty;var H=(t,e,o)=>e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var C=(t,e,o)=>H(t,typeof e!="symbol"?e+"":e,o);import{Plugin as h,Command as Y}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{createDropdown as A,addListToDropdown as L,MenuBarMenuView as V,MenuBarMenuListView as T,MenuBarMenuListItemView as E,MenuBarMenuListItemButtonView as D,normalizeColorOptions as W,getLocalizedColorOptions as Z,focusChildOnDropdownOpen as J,ColorSelectorView as I,ViewModel as _}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{CKEditorError as $,Collection as R}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{IconFontBackground as Q,IconFontColor as X,IconFontFamily as N,IconFontSize as z}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{addBackgroundRules as ee,isLength as te,isPercentage as oe}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";/**
1
+ import{Plugin as h,Command as K}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{createDropdown as S,addListToDropdown as B,MenuBarMenuView as O,MenuBarMenuListView as P,MenuBarMenuListItemView as L,MenuBarMenuListItemButtonView as T,normalizeColorOptions as q,getLocalizedColorOptions as j,focusChildOnDropdownOpen as H,ColorSelectorView as E,ViewModel as D}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{CKEditorError as I,Collection as _}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{IconFontBackground as Y,IconFontColor as W,IconFontFamily as V,IconFontSize as k}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{addBackgroundRules as Z,isLength as J,isPercentage as Q}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
- */class x extends Y{constructor(o,n){super(o);C(this,"attributeKey");this.attributeKey=n}refresh(){const o=this.editor.model,n=o.document;this.value=n.selection.getAttribute(this.attributeKey),this.isEnabled=o.schema.checkAttributeInSelection(n.selection,this.attributeKey)}execute(o={}){const n=this.editor.model,r=n.document.selection,c=o.value,u=o.batch,s=l=>{if(r.isCollapsed)c?l.setSelectionAttribute(this.attributeKey,c):l.removeSelectionAttribute(this.attributeKey);else{const p=n.schema.getValidRanges(r.getRanges(),this.attributeKey);for(const g of p)c?l.setAttribute(this.attributeKey,c,g):l.removeAttribute(this.attributeKey,g)}};u?n.enqueueChange(u,l=>{s(l)}):n.change(l=>{s(l)})}}const d="fontSize",f="fontFamily",w="fontColor",y="fontBackgroundColor";function M(t,e){const o={model:{key:t,values:[]},view:{},upcastAlso:{}};for(const n of e)o.model.values.push(n.model),o.view[n.model]=n.view,n.upcastAlso&&(o.upcastAlso[n.model]=n.upcastAlso);return o}function U(t){return e=>ie(e.getStyle(t))}function G(t){return(e,{writer:o})=>o.createAttributeElement("span",{style:`${t}:${e}`},{priority:7})}function ne({dropdownView:t,colors:e,columns:o,removeButtonLabel:n,colorPickerLabel:i,documentColorsLabel:r,documentColorsCount:c,colorPickerViewConfig:u}){const s=t.locale,l=new I(s,{colors:e,columns:o,removeButtonLabel:n,colorPickerLabel:i,documentColorsLabel:r,documentColorsCount:c,colorPickerViewConfig:u});return t.colorSelectorView=l,t.panelView.children.add(l),l}function ie(t){return t.replace(/\s/g,"")}class re extends x{constructor(e){super(e,f)}}/**
4
+ */class C extends K{attributeKey;constructor(e,o){super(e),this.attributeKey=o}refresh(){const e=this.editor.model,o=e.document;this.value=o.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(o.selection,this.attributeKey)}execute(e={}){const o=this.editor.model,i=o.document.selection,s=e.value,u=e.batch,a=r=>{if(i.isCollapsed)s?r.setSelectionAttribute(this.attributeKey,s):r.removeSelectionAttribute(this.attributeKey);else{const c=o.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const m of c)s?r.setAttribute(this.attributeKey,s,m):r.removeAttribute(this.attributeKey,m)}};u?o.enqueueChange(u,r=>{a(r)}):o.change(r=>{a(r)})}}const p="fontSize",g="fontFamily",w="fontColor",y="fontBackgroundColor";function $(t,e){const o={model:{key:t,values:[]},view:{},upcastAlso:{}};for(const n of e)o.model.values.push(n.model),o.view[n.model]=n.view,n.upcastAlso&&(o.upcastAlso[n.model]=n.upcastAlso);return o}function R(t){return e=>ee(e.getStyle(t))}function M(t){return(e,{writer:o})=>o.createAttributeElement("span",{style:`${t}:${e}`},{priority:7})}function X({dropdownView:t,colors:e,columns:o,removeButtonLabel:n,colorPickerLabel:i,documentColorsLabel:s,documentColorsCount:u,colorPickerViewConfig:a}){const r=t.locale,c=new E(r,{colors:e,columns:o,removeButtonLabel:n,colorPickerLabel:i,documentColorsLabel:s,documentColorsCount:u,colorPickerViewConfig:a});return t.colorSelectorView=c,t.panelView.children.add(c),c}function ee(t){return t.replace(/\s/g,"")}class te extends C{constructor(e){super(e,g)}}/**
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 K(t){return t.map(se).filter(e=>e!==void 0)}function se(t){if(typeof t=="object")return t;if(t==="default")return{title:"Default",model:void 0};if(typeof t=="string")return le(t)}function le(t){const e=t.replace(/"|'/g,"").split(","),o=e[0],n=e.map(ae).join(", ");return{title:o,model:n,view:{name:"span",styles:{"font-family":n},priority:7}}}function ae(t){return t=t.trim(),t.indexOf(" ")>0&&(t=`'${t}'`),t}class ce extends h{static get pluginName(){return"FontFamilyEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(f,{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:f}),e.model.schema.setAttributeProperties(f,{isFormatting:!0,copyOnEnter:!0});const o=K(e.config.get("fontFamily.options")).filter(i=>i.model),n=M(f,o);e.config.get("fontFamily.supportAllValues")?(this._prepareAnyValueConverters(),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(n),e.commands.add(f,new re(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:f,view:(o,{writer:n})=>n.createAttributeElement("span",{style:"font-family:"+o},{priority:7})}),e.conversion.for("upcast").elementToAttribute({model:{key:f,value:o=>o.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{face:/.*/}},model:{key:f,value:o=>o.getAttribute("face")}})}}class ue extends h{static get pluginName(){return"FontFamilyUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,o=e.t,n=this._getLocalizedOptions(),i=e.commands.get(f),r=o("Font Family"),c=me(n,i);e.ui.componentFactory.add(f,u=>{const s=A(u);return L(s,c,{role:"menu",ariaLabel:r}),s.buttonView.set({label:r,icon:N,tooltip:!0}),s.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),s.bind("isEnabled").to(i),this.listenTo(s,"execute",l=>{e.execute(l.source.commandName,{value:l.source.commandParam}),e.editing.view.focus()}),s}),e.ui.componentFactory.add(`menuBar:${f}`,u=>{const s=new V(u);s.buttonView.set({label:r,icon:N}),s.bind("isEnabled").to(i);const l=new T(u);for(const p of c){const g=new E(u,s),a=new D(u);a.set({role:"menuitemradio",isToggleable:!0}),a.bind(...Object.keys(p.model)).to(p.model),a.delegate("execute").to(s),a.on("execute",()=>{e.execute(p.model.commandName,{value:p.model.commandParam}),e.editing.view.focus()}),g.children.add(a),l.items.add(g)}return s.panelView.children.add(l),s})}_getLocalizedOptions(){const e=this.editor,o=e.t;return K(e.config.get(f).options).map(i=>(i.title==="Default"&&(i.title=o("Default")),i))}}function me(t,e){const o=new R;for(const n of t){const i={type:"button",model:new _({commandName:f,commandParam:n.model,label:n.title,role:"menuitemradio",withText:!0})};i.model.bind("isOn").to(e,"value",r=>r===n.model?!0:!r||!n.model?!1:r.split(",")[0].replace(/'/g,"").toLowerCase()===n.model.toLowerCase()),n.view&&typeof n.view!="string"&&n.view.styles&&i.model.set("labelStyle",`font-family: ${n.view.styles["font-family"]}`),o.add(i)}return o}class Le extends h{static get requires(){return[ce,ue]}static get pluginName(){return"FontFamily"}static get isOfficialPlugin(){return!0}}class de extends x{constructor(e){super(e,d)}}function k(t){return t.map(e=>fe(e)).filter(e=>e!==void 0)}const B={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function fe(t){if(typeof t=="number"&&(t=String(t)),typeof t=="object"&&be(t))return O(t);const e=ge(t);if(e)return O(e);if(t==="default")return{model:void 0,title:"Default"};if(!he(t))return pe(t)}function pe(t){return typeof t=="string"&&(t={title:t,model:`${parseFloat(t)}px`}),t.view={name:"span",styles:{"font-size":t.model}},O(t)}function O(t){return t.view&&typeof t.view!="string"&&!t.view.priority&&(t.view.priority=7),t}function ge(t){return typeof t=="string"?B[t]:B[t.model]}function be(t){return t.title&&t.model&&t.view}function he(t){let e;if(typeof t=="object")if(t.model)e=parseFloat(t.model);else throw new $("font-size-invalid-definition",null,t);else e=parseFloat(t);return isNaN(e)}const P=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class we extends h{static get pluginName(){return"FontSizeEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(d,{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:d}),e.model.schema.setAttributeProperties(d,{isFormatting:!0,copyOnEnter:!0});const o=e.config.get("fontSize.supportAllValues"),n=k(this.editor.config.get("fontSize.options")).filter(r=>r.model),i=M(d,n);o?(this._prepareAnyValueConverters(i),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(i),e.commands.add(d,new de(e))}_prepareAnyValueConverters(e){const o=this.editor,n=e.model.values.filter(i=>!te(String(i))&&!oe(String(i)));if(n.length)throw new $("font-size-invalid-use-of-named-presets",null,{presets:n});o.conversion.for("downcast").attributeToElement({model:d,view:(i,{writer:r})=>{if(i)return r.createAttributeElement("span",{style:"font-size:"+i},{priority:7})}}),o.conversion.for("upcast").elementToAttribute({model:{key:d,value:i=>i.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:d,value:o=>{const n=o.getAttribute("size"),i=n[0]==="-"||n[0]==="+";let r=parseInt(n,10);i&&(r=3+r);const c=P.length-1,u=Math.min(Math.max(r,0),c);return P[u]}}})}}class ye extends h{static get pluginName(){return"FontSizeUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,o=e.t,n=this._getLocalizedOptions(),i=e.commands.get(d),r=o("Font Size"),c=ve(n,i);e.ui.componentFactory.add(d,u=>{const s=A(u);return L(s,c,{role:"menu",ariaLabel:r}),s.buttonView.set({label:r,icon:z,tooltip:!0}),s.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),s.bind("isEnabled").to(i),this.listenTo(s,"execute",l=>{e.execute(l.source.commandName,{value:l.source.commandParam}),e.editing.view.focus()}),s}),e.ui.componentFactory.add(`menuBar:${d}`,u=>{const s=new V(u);s.buttonView.set({label:r,icon:z}),s.bind("isEnabled").to(i);const l=new T(u);for(const p of c){const g=new E(u,s),a=new D(u);a.set({role:"menuitemradio",isToggleable:!0}),a.bind(...Object.keys(p.model)).to(p.model),a.delegate("execute").to(s),a.on("execute",()=>{e.execute(p.model.commandName,{value:p.model.commandParam}),e.editing.view.focus()}),g.children.add(a),l.items.add(g)}return s.panelView.children.add(l),s})}_getLocalizedOptions(){const e=this.editor,o=e.t,n={Default:o("Default"),Tiny:o("Tiny"),Small:o("Small"),Big:o("Big"),Huge:o("Huge")};return k(e.config.get(d).options).map(r=>{const c=n[r.title];return c&&c!=r.title&&(r=Object.assign({},r,{title:c})),r})}}function ve(t,e){const o=new R;for(const n of t){const i={type:"button",model:new _({commandName:d,commandParam:n.model,label:n.title,class:"ck-fontsize-option",role:"menuitemradio",withText:!0})};n.view&&typeof n.view!="string"&&(n.view.styles&&i.model.set("labelStyle",`font-size:${n.view.styles["font-size"]}`),n.view.classes&&i.model.set("class",`${i.model.class} ${n.view.classes}`)),i.model.bind("isOn").to(e,"value",r=>r===n.model),o.add(i)}return o}class Te extends h{static get requires(){return[we,ye]}static get pluginName(){return"FontSize"}static get isOfficialPlugin(){return!0}normalizeSizeOptions(e){return k(e)}}class Ce extends x{constructor(e){super(e,w)}}class Fe extends h{static get pluginName(){return"FontColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(w,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:w,value:U("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:w,value:o=>o.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:w,view:G("color")}),e.commands.add(w,new Ce(e)),e.model.schema.extend("$text",{allowAttributes:w}),e.model.schema.setAttributeProperties(w,{isFormatting:!0,copyOnEnter:!0})}}class q extends h{constructor(o,{commandName:n,componentName:i,icon:r,dropdownLabel:c}){super(o);C(this,"commandName");C(this,"componentName");C(this,"icon");C(this,"dropdownLabel");C(this,"columns");this.commandName=n,this.componentName=i,this.icon=r,this.dropdownLabel=c,this.columns=o.config.get(`${this.componentName}.columns`)}init(){const o=this.editor,n=o.locale,i=n.t,r=o.commands.get(this.commandName),c=o.config.get(this.componentName),u=W(c.colors),s=Z(n,u),l=c.documentColors,p=c.colorPicker!==!1;o.ui.componentFactory.add(this.componentName,g=>{const a=A(g);let F=!1;const m=ne({dropdownView:a,colors:s.map(b=>({label:b.label,color:b.model,options:{hasBorder:b.hasBorder}})),columns:this.columns,removeButtonLabel:i("Remove color"),colorPickerLabel:i("Color picker"),documentColorsLabel:l!==0?i("Document colors"):"",documentColorsCount:l===void 0?this.columns:l,colorPickerViewConfig:p?c.colorPicker||{}:!1});return m.bind("selectedColor").to(r,"value"),a.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),a.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),a.bind("isEnabled").to(r),m.on("execute",(b,v)=>{a.isOpen&&o.execute(this.commandName,{value:v.value,batch:this._undoStepBatch}),v.source!=="colorPicker"&&o.editing.view.focus(),v.source==="colorPickerSaveButton"&&(a.isOpen=!1)}),m.on("colorPicker:show",()=>{this._undoStepBatch=o.model.createBatch()}),m.on("colorPicker:cancel",()=>{this._undoStepBatch.operations.length&&(a.isOpen=!1,o.execute("undo",this._undoStepBatch)),o.editing.view.focus()}),a.on("change:isOpen",(b,v,S)=>{F||(F=!0,a.colorSelectorView.appendUI()),S&&(l!==0&&m.updateDocumentColors(o.model,this.componentName),m.updateSelectedColors(),m.showColorGridsFragment())}),J(a,()=>a.colorSelectorView.colorGridsFragmentView.staticColorsGrid.items.find(b=>b.isOn)),a}),o.ui.componentFactory.add(`menuBar:${this.componentName}`,g=>{const a=new V(g);a.buttonView.set({label:this.dropdownLabel,icon:this.icon}),a.bind("isEnabled").to(r);let F=!1;const m=new I(g,{colors:s.map(b=>({label:b.label,color:b.model,options:{hasBorder:b.hasBorder}})),columns:this.columns,removeButtonLabel:i("Remove color"),colorPickerLabel:i("Color picker"),documentColorsLabel:l!==0?i("Document colors"):"",documentColorsCount:l===void 0?this.columns:l,colorPickerViewConfig:!1});return m.bind("selectedColor").to(r,"value"),m.delegate("execute").to(a),m.on("execute",(b,v)=>{o.execute(this.commandName,{value:v.value,batch:this._undoStepBatch}),o.editing.view.focus()}),a.on("change:isOpen",(b,v,S)=>{F||(F=!0,m.appendUI()),S&&(l!==0&&m.updateDocumentColors(o.model,this.componentName),m.updateSelectedColors(),m.showColorGridsFragment())}),a.panelView.children.add(m),a})}}class xe extends q{constructor(e){const o=e.locale.t;super(e,{commandName:w,componentName:w,icon:X,dropdownLabel:o("Font Color")})}static get pluginName(){return"FontColorUI"}}class Ee extends h{static get requires(){return[Fe,xe]}static get pluginName(){return"FontColor"}static get isOfficialPlugin(){return!0}}class Se extends x{constructor(e){super(e,y)}}class Oe extends h{static get pluginName(){return"FontBackgroundColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(y,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(ee),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:y,value:U("background-color")}}),e.conversion.for("downcast").attributeToElement({model:y,view:G("background-color")}),e.commands.add(y,new Se(e)),e.model.schema.extend("$text",{allowAttributes:y}),e.model.schema.setAttributeProperties(y,{isFormatting:!0,copyOnEnter:!0})}}class Ae extends q{constructor(e){const o=e.locale.t;super(e,{commandName:y,componentName:y,icon:Q,dropdownLabel:o("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class De extends h{static get requires(){return[Oe,Ae]}static get pluginName(){return"FontBackgroundColor"}static get isOfficialPlugin(){return!0}}export{De as FontBackgroundColor,Oe as FontBackgroundColorEditing,Ae as FontBackgroundColorUI,Ee as FontColor,Fe as FontColorEditing,xe as FontColorUI,Le as FontFamily,ce as FontFamilyEditing,ue as FontFamilyUI,Te as FontSize,we as FontSizeEditing,ye as FontSizeUI};
7
+ */function U(t){return t.map(oe).filter(e=>e!==void 0)}function oe(t){if(typeof t=="object")return t;if(t==="default")return{title:"Default",model:void 0};if(typeof t=="string")return ne(t)}function ne(t){const e=t.replace(/"|'/g,"").split(","),o=e[0],n=e.map(ie).join(", ");return{title:o,model:n,view:{name:"span",styles:{"font-family":n},priority:7}}}function ie(t){return t=t.trim(),t.indexOf(" ")>0&&(t=`'${t}'`),t}class re extends h{static get pluginName(){return"FontFamilyEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(g,{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:g}),e.model.schema.setAttributeProperties(g,{isFormatting:!0,copyOnEnter:!0});const o=U(e.config.get("fontFamily.options")).filter(i=>i.model),n=$(g,o);e.config.get("fontFamily.supportAllValues")?(this._prepareAnyValueConverters(),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(n),e.commands.add(g,new te(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:g,view:(o,{writer:n})=>n.createAttributeElement("span",{style:"font-family:"+o},{priority:7})}),e.conversion.for("upcast").elementToAttribute({model:{key:g,value:o=>o.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{face:/.*/}},model:{key:g,value:o=>o.getAttribute("face")}})}}class se extends h{static get pluginName(){return"FontFamilyUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,o=e.t,n=this._getLocalizedOptions(),i=e.commands.get(g),s=o("Font Family"),u=le(n,i);e.ui.componentFactory.add(g,a=>{const r=S(a);return B(r,u,{role:"menu",ariaLabel:s}),r.buttonView.set({label:s,icon:V,tooltip:!0}),r.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",c=>{e.execute(c.source.commandName,{value:c.source.commandParam}),e.editing.view.focus()}),r}),e.ui.componentFactory.add(`menuBar:${g}`,a=>{const r=new O(a);r.buttonView.set({label:s,icon:V}),r.bind("isEnabled").to(i);const c=new P(a);for(const m of u){const l=new L(a,r),d=new T(a);d.set({role:"menuitemradio",isToggleable:!0}),d.bind(...Object.keys(m.model)).to(m.model),d.delegate("execute").to(r),d.on("execute",()=>{e.execute(m.model.commandName,{value:m.model.commandParam}),e.editing.view.focus()}),l.children.add(d),c.items.add(l)}return r.panelView.children.add(c),r})}_getLocalizedOptions(){const e=this.editor,o=e.t;return U(e.config.get(g).options).map(i=>(i.title==="Default"&&(i.title=o("Default")),i))}}function le(t,e){const o=new _;for(const n of t){const i={type:"button",model:new D({commandName:g,commandParam:n.model,label:n.title,role:"menuitemradio",withText:!0})};i.model.bind("isOn").to(e,"value",s=>s===n.model?!0:!s||!n.model?!1:s.split(",")[0].replace(/'/g,"").toLowerCase()===n.model.toLowerCase()),n.view&&typeof n.view!="string"&&n.view.styles&&i.model.set("labelStyle",`font-family: ${n.view.styles["font-family"]}`),o.add(i)}return o}class ke extends h{static get requires(){return[re,se]}static get pluginName(){return"FontFamily"}static get isOfficialPlugin(){return!0}}class ae extends C{constructor(e){super(e,p)}}function A(t){return t.map(e=>ce(e)).filter(e=>e!==void 0)}const N={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function ce(t){if(typeof t=="number"&&(t=String(t)),typeof t=="object"&&de(t))return x(t);const e=me(t);if(e)return x(e);if(t==="default")return{model:void 0,title:"Default"};if(!fe(t))return ue(t)}function ue(t){return typeof t=="string"&&(t={title:t,model:`${parseFloat(t)}px`}),t.view={name:"span",styles:{"font-size":t.model}},x(t)}function x(t){return t.view&&typeof t.view!="string"&&!t.view.priority&&(t.view.priority=7),t}function me(t){return typeof t=="string"?N[t]:N[t.model]}function de(t){return t.title&&t.model&&t.view}function fe(t){let e;if(typeof t=="object")if(t.model)e=parseFloat(t.model);else throw new I("font-size-invalid-definition",null,t);else e=parseFloat(t);return isNaN(e)}const z=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class pe extends h{static get pluginName(){return"FontSizeEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(p,{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:p}),e.model.schema.setAttributeProperties(p,{isFormatting:!0,copyOnEnter:!0});const o=e.config.get("fontSize.supportAllValues"),n=A(this.editor.config.get("fontSize.options")).filter(s=>s.model),i=$(p,n);o?(this._prepareAnyValueConverters(i),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(i),e.commands.add(p,new ae(e))}_prepareAnyValueConverters(e){const o=this.editor,n=e.model.values.filter(i=>!J(String(i))&&!Q(String(i)));if(n.length)throw new I("font-size-invalid-use-of-named-presets",null,{presets:n});o.conversion.for("downcast").attributeToElement({model:p,view:(i,{writer:s})=>{if(i)return s.createAttributeElement("span",{style:"font-size:"+i},{priority:7})}}),o.conversion.for("upcast").elementToAttribute({model:{key:p,value:i=>i.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:p,value:o=>{const n=o.getAttribute("size"),i=n[0]==="-"||n[0]==="+";let s=parseInt(n,10);i&&(s=3+s);const u=z.length-1,a=Math.min(Math.max(s,0),u);return z[a]}}})}}class ge extends h{static get pluginName(){return"FontSizeUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,o=e.t,n=this._getLocalizedOptions(),i=e.commands.get(p),s=o("Font Size"),u=be(n,i);e.ui.componentFactory.add(p,a=>{const r=S(a);return B(r,u,{role:"menu",ariaLabel:s}),r.buttonView.set({label:s,icon:k,tooltip:!0}),r.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",c=>{e.execute(c.source.commandName,{value:c.source.commandParam}),e.editing.view.focus()}),r}),e.ui.componentFactory.add(`menuBar:${p}`,a=>{const r=new O(a);r.buttonView.set({label:s,icon:k}),r.bind("isEnabled").to(i);const c=new P(a);for(const m of u){const l=new L(a,r),d=new T(a);d.set({role:"menuitemradio",isToggleable:!0}),d.bind(...Object.keys(m.model)).to(m.model),d.delegate("execute").to(r),d.on("execute",()=>{e.execute(m.model.commandName,{value:m.model.commandParam}),e.editing.view.focus()}),l.children.add(d),c.items.add(l)}return r.panelView.children.add(c),r})}_getLocalizedOptions(){const e=this.editor,o=e.t,n={Default:o("Default"),Tiny:o("Tiny"),Small:o("Small"),Big:o("Big"),Huge:o("Huge")};return A(e.config.get(p).options).map(s=>{const u=n[s.title];return u&&u!=s.title&&(s=Object.assign({},s,{title:u})),s})}}function be(t,e){const o=new _;for(const n of t){const i={type:"button",model:new D({commandName:p,commandParam:n.model,label:n.title,class:"ck-fontsize-option",role:"menuitemradio",withText:!0})};n.view&&typeof n.view!="string"&&(n.view.styles&&i.model.set("labelStyle",`font-size:${n.view.styles["font-size"]}`),n.view.classes&&i.model.set("class",`${i.model.class} ${n.view.classes}`)),i.model.bind("isOn").to(e,"value",s=>s===n.model),o.add(i)}return o}class Ne extends h{static get requires(){return[pe,ge]}static get pluginName(){return"FontSize"}static get isOfficialPlugin(){return!0}normalizeSizeOptions(e){return A(e)}}class he extends C{constructor(e){super(e,w)}}class we extends h{static get pluginName(){return"FontColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(w,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:w,value:R("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:w,value:o=>o.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:w,view:M("color")}),e.commands.add(w,new he(e)),e.model.schema.extend("$text",{allowAttributes:w}),e.model.schema.setAttributeProperties(w,{isFormatting:!0,copyOnEnter:!0})}}class G extends h{commandName;componentName;icon;dropdownLabel;columns;constructor(e,{commandName:o,componentName:n,icon:i,dropdownLabel:s}){super(e),this.commandName=o,this.componentName=n,this.icon=i,this.dropdownLabel=s,this.columns=e.config.get(`${this.componentName}.columns`)}init(){const e=this.editor,o=e.locale,n=o.t,i=e.commands.get(this.commandName),s=e.config.get(this.componentName),u=q(s.colors),a=j(o,u),r=s.documentColors,c=s.colorPicker!==!1;e.ui.componentFactory.add(this.componentName,m=>{const l=S(m);let d=!1;const f=X({dropdownView:l,colors:a.map(b=>({label:b.label,color:b.model,options:{hasBorder:b.hasBorder}})),columns:this.columns,removeButtonLabel:n("Remove color"),colorPickerLabel:n("Color picker"),documentColorsLabel:r!==0?n("Document colors"):"",documentColorsCount:r===void 0?this.columns:r,colorPickerViewConfig:c?s.colorPicker||{}:!1});return f.bind("selectedColor").to(i,"value"),l.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),l.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),l.bind("isEnabled").to(i),f.on("execute",(b,v)=>{l.isOpen&&e.execute(this.commandName,{value:v.value,batch:this._undoStepBatch}),v.source!=="colorPicker"&&e.editing.view.focus(),v.source==="colorPickerSaveButton"&&(l.isOpen=!1)}),f.on("colorPicker:show",()=>{this._undoStepBatch=e.model.createBatch()}),f.on("colorPicker:cancel",()=>{this._undoStepBatch.operations.length&&(l.isOpen=!1,e.execute("undo",this._undoStepBatch)),e.editing.view.focus()}),l.on("change:isOpen",(b,v,F)=>{d||(d=!0,l.colorSelectorView.appendUI()),F&&(r!==0&&f.updateDocumentColors(e.model,this.componentName),f.updateSelectedColors(),f.showColorGridsFragment())}),H(l,()=>l.colorSelectorView.colorGridsFragmentView.staticColorsGrid.items.find(b=>b.isOn)),l}),e.ui.componentFactory.add(`menuBar:${this.componentName}`,m=>{const l=new O(m);l.buttonView.set({label:this.dropdownLabel,icon:this.icon}),l.bind("isEnabled").to(i);let d=!1;const f=new E(m,{colors:a.map(b=>({label:b.label,color:b.model,options:{hasBorder:b.hasBorder}})),columns:this.columns,removeButtonLabel:n("Remove color"),colorPickerLabel:n("Color picker"),documentColorsLabel:r!==0?n("Document colors"):"",documentColorsCount:r===void 0?this.columns:r,colorPickerViewConfig:!1});return f.bind("selectedColor").to(i,"value"),f.delegate("execute").to(l),f.on("execute",(b,v)=>{e.execute(this.commandName,{value:v.value,batch:this._undoStepBatch}),e.editing.view.focus()}),l.on("change:isOpen",(b,v,F)=>{d||(d=!0,f.appendUI()),F&&(r!==0&&f.updateDocumentColors(e.model,this.componentName),f.updateSelectedColors(),f.showColorGridsFragment())}),l.panelView.children.add(f),l})}}class ye extends G{constructor(e){const o=e.locale.t;super(e,{commandName:w,componentName:w,icon:W,dropdownLabel:o("Font Color")})}static get pluginName(){return"FontColorUI"}}class ze extends h{static get requires(){return[we,ye]}static get pluginName(){return"FontColor"}static get isOfficialPlugin(){return!0}}class ve extends C{constructor(e){super(e,y)}}class Ce extends h{static get pluginName(){return"FontBackgroundColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(y,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(Z),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:y,value:R("background-color")}}),e.conversion.for("downcast").attributeToElement({model:y,view:M("background-color")}),e.commands.add(y,new ve(e)),e.model.schema.extend("$text",{allowAttributes:y}),e.model.schema.setAttributeProperties(y,{isFormatting:!0,copyOnEnter:!0})}}class Fe extends G{constructor(e){const o=e.locale.t;super(e,{commandName:y,componentName:y,icon:Y,dropdownLabel:o("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class Be extends h{static get requires(){return[Ce,Fe]}static get pluginName(){return"FontBackgroundColor"}static get isOfficialPlugin(){return!0}}export{Be as FontBackgroundColor,Ce as FontBackgroundColorEditing,Fe as FontBackgroundColorUI,ze as FontColor,we as FontColorEditing,ye as FontColorUI,ke as FontFamily,re as FontFamilyEditing,se as FontFamilyUI,Ne as FontSize,pe as FontSizeEditing,ge as FontSizeUI};
@@ -1,7 +1,7 @@
1
- var v=Object.defineProperty;var E=(r,e,t)=>e in r?v(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var w=(r,e,t)=>E(r,typeof e!="symbol"?e+"":e,t);import{Plugin as f,Command as V}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Paragraph as x}from"../../../../../@ckeditor_ckeditor5-paragraph@45.2.1/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js";import{priorities as M,Collection as C,first as k}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{ViewModel as L,createDropdown as P,addListToDropdown as T,MenuBarMenuView as y,MenuBarMenuListView as B,MenuBarMenuListItemView as O,MenuBarMenuListItemButtonView as N}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";/**
1
+ import{Plugin as f,Command as H}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Paragraph as v}from"../../../../../@ckeditor_ckeditor5-paragraph@45.2.1/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js";import{priorities as E,Collection as V,first as x}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{ViewModel as M,createDropdown as C,addListToDropdown as k,MenuBarMenuView as L,MenuBarMenuListView as P,MenuBarMenuListItemView as T,MenuBarMenuListItemButtonView as y}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import"../../../../../@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
- */class I extends V{constructor(t,n){super(t);w(this,"modelElements");this.modelElements=n}refresh(){const t=k(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(n=>b(t,n,this.editor.model.schema))}execute(t){const n=this.editor.model,l=n.document,m=t.value;n.change(c=>{const s=Array.from(l.selection.getSelectedBlocks()).filter(g=>b(g,m,n.schema));for(const g of s)g.is("element",m)||c.rename(g,m)})}}function b(r,e,t){return t.checkChild(r.parent,e)&&!t.isObject(r)}const H="paragraph";class _ extends f{static get pluginName(){return"HeadingEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[x]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const l of t)l.model!=="paragraph"&&(e.model.schema.register(l.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(l),n.push(l.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new I(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(l,m)=>{const c=e.model.document.selection.getFirstPosition().parent;n.some(g=>c.is("element",g.model))&&!c.is("element",H)&&c.childCount===0&&m.writer.rename(c,H)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:M.low+1})}}/**
4
+ */class B extends H{modelElements;constructor(e,t){super(e),this.modelElements=t}refresh(){const e=x(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>w(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,r=t.document,s=e.value;t.change(c=>{const l=Array.from(r.selection.getSelectedBlocks()).filter(a=>w(a,s,t.schema));for(const a of l)a.is("element",s)||c.rename(a,s)})}}function w(m,e,t){return t.checkChild(m.parent,e)&&!t.isObject(m)}const b="paragraph";class O extends f{static get pluginName(){return"HeadingEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[v]}init(){const e=this.editor,t=e.config.get("heading.options"),r=[];for(const s of t)s.model!=="paragraph"&&(e.model.schema.register(s.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(s),r.push(s.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new B(e,r))}afterInit(){const e=this.editor,t=e.commands.get("enter"),r=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(s,c)=>{const l=e.model.document.selection.getFirstPosition().parent;r.some(g=>l.is("element",g.model))&&!l.is("element",b)&&l.childCount===0&&c.writer.rename(l,b)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:E.low+1})}}/**
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 D(r){const e=r.t,t={Paragraph:e("Paragraph"),"Heading 1":e("Heading 1"),"Heading 2":e("Heading 2"),"Heading 3":e("Heading 3"),"Heading 4":e("Heading 4"),"Heading 5":e("Heading 5"),"Heading 6":e("Heading 6")};return r.config.get("heading.options").map(n=>{const l=t[n.title];return l&&l!=n.title&&(n.title=l),n})}class F extends f{static get pluginName(){return"HeadingUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,n=D(e),l=t("Choose heading"),m=t("Heading");e.ui.componentFactory.add("heading",c=>{const s={},g=new C,u=e.commands.get("heading"),h=e.commands.get("paragraph"),p=[u];for(const i of n){const a={type:"button",model:new L({label:i.title,class:i.class,role:"menuitemradio",withText:!0})};i.model==="paragraph"?(a.model.bind("isOn").to(h,"value"),a.model.set("commandName","paragraph"),p.push(h)):(a.model.bind("isOn").to(u,"value",d=>d===i.model),a.model.set({commandName:"heading",commandValue:i.model})),g.add(a),s[i.model]=i.title}const o=P(c);return T(o,g,{ariaLabel:m,role:"menu"}),o.buttonView.set({ariaLabel:m,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:m}),o.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),o.bind("isEnabled").toMany(p,"isEnabled",(...i)=>i.some(a=>a)),o.buttonView.bind("label").to(u,"value",h,"value",(i,a)=>{const d=a?"paragraph":i;return typeof d=="boolean"||!s[d]?l:s[d]}),o.buttonView.bind("ariaLabel").to(u,"value",h,"value",(i,a)=>{const d=a?"paragraph":i;return typeof d=="boolean"||!s[d]?m:`${s[d]}, ${m}`}),this.listenTo(o,"execute",i=>{const{commandName:a,commandValue:d}=i.source;e.execute(a,d?{value:d}:void 0),e.editing.view.focus()}),o}),e.ui.componentFactory.add("menuBar:heading",c=>{const s=new y(c),g=e.commands.get("heading"),u=e.commands.get("paragraph"),h=[g],p=new B(c);s.set({class:"ck-heading-dropdown"}),p.set({ariaLabel:t("Heading"),role:"menu"}),s.buttonView.set({label:t("Heading")}),s.panelView.children.add(p);for(const o of n){const i=new O(c,s),a=new N(c);i.children.add(a),p.items.add(i),a.set({isToggleable:!0,label:o.title,role:"menuitemradio",class:o.class}),a.delegate("execute").to(s),a.on("execute",()=>{const d=o.model==="paragraph"?"paragraph":"heading";e.execute(d,{value:o.model}),e.editing.view.focus()}),o.model==="paragraph"?(a.bind("isOn").to(u,"value"),h.push(u)):a.bind("isOn").to(g,"value",d=>d===o.model)}return s.bind("isEnabled").toMany(h,"isEnabled",(...o)=>o.some(i=>i)),s})}}class j extends f{static get requires(){return[_,F]}static get pluginName(){return"Heading"}static get isOfficialPlugin(){return!0}}export{j as Heading,_ as HeadingEditing,F as HeadingUI};
7
+ */function N(m){const e=m.t,t={Paragraph:e("Paragraph"),"Heading 1":e("Heading 1"),"Heading 2":e("Heading 2"),"Heading 3":e("Heading 3"),"Heading 4":e("Heading 4"),"Heading 5":e("Heading 5"),"Heading 6":e("Heading 6")};return m.config.get("heading.options").map(r=>{const s=t[r.title];return s&&s!=r.title&&(r.title=s),r})}class I extends f{static get pluginName(){return"HeadingUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,r=N(e),s=t("Choose heading"),c=t("Heading");e.ui.componentFactory.add("heading",l=>{const a={},g=new V,u=e.commands.get("heading"),h=e.commands.get("paragraph"),p=[u];for(const n of r){const i={type:"button",model:new M({label:n.title,class:n.class,role:"menuitemradio",withText:!0})};n.model==="paragraph"?(i.model.bind("isOn").to(h,"value"),i.model.set("commandName","paragraph"),p.push(h)):(i.model.bind("isOn").to(u,"value",d=>d===n.model),i.model.set({commandName:"heading",commandValue:n.model})),g.add(i),a[n.model]=n.title}const o=C(l);return k(o,g,{ariaLabel:c,role:"menu"}),o.buttonView.set({ariaLabel:c,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:c}),o.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),o.bind("isEnabled").toMany(p,"isEnabled",(...n)=>n.some(i=>i)),o.buttonView.bind("label").to(u,"value",h,"value",(n,i)=>{const d=i?"paragraph":n;return typeof d=="boolean"||!a[d]?s:a[d]}),o.buttonView.bind("ariaLabel").to(u,"value",h,"value",(n,i)=>{const d=i?"paragraph":n;return typeof d=="boolean"||!a[d]?c:`${a[d]}, ${c}`}),this.listenTo(o,"execute",n=>{const{commandName:i,commandValue:d}=n.source;e.execute(i,d?{value:d}:void 0),e.editing.view.focus()}),o}),e.ui.componentFactory.add("menuBar:heading",l=>{const a=new L(l),g=e.commands.get("heading"),u=e.commands.get("paragraph"),h=[g],p=new P(l);a.set({class:"ck-heading-dropdown"}),p.set({ariaLabel:t("Heading"),role:"menu"}),a.buttonView.set({label:t("Heading")}),a.panelView.children.add(p);for(const o of r){const n=new T(l,a),i=new y(l);n.children.add(i),p.items.add(n),i.set({isToggleable:!0,label:o.title,role:"menuitemradio",class:o.class}),i.delegate("execute").to(a),i.on("execute",()=>{const d=o.model==="paragraph"?"paragraph":"heading";e.execute(d,{value:o.model}),e.editing.view.focus()}),o.model==="paragraph"?(i.bind("isOn").to(u,"value"),h.push(u)):i.bind("isOn").to(g,"value",d=>d===o.model)}return a.bind("isEnabled").toMany(h,"isEnabled",(...o)=>o.some(n=>n)),a})}}class z extends f{static get requires(){return[O,I]}static get pluginName(){return"Heading"}static get isOfficialPlugin(){return!0}}export{z as Heading,O as HeadingEditing,I as HeadingUI};
@@ -1,4 +1,4 @@
1
- var S=Object.defineProperty;var A=(c,t,e)=>t in c?S(c,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):c[t]=e;var H=(c,t,e)=>A(c,typeof t!="symbol"?t+"":t,e);import{Plugin as f,Command as T}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Widget as I,toWidget as L,findOptimalInsertionRange as D}from"../../../../../@ckeditor_ckeditor5-widget@45.2.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{ButtonView as x,MenuBarMenuListItemButtonView as M}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{logWarning as y,createElement as b}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{IconHtml as O,IconPencil as P,IconCheck as W,IconCancel as z}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";/**
1
+ import{Plugin as f,Command as B}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Widget as V,toWidget as S,findOptimalInsertionRange as A}from"../../../../../@ckeditor_ckeditor5-widget@45.2.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{ButtonView as P,MenuBarMenuListItemButtonView as T}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{logWarning as I,createElement as b}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{IconHtml as L,IconPencil as C,IconCheck as D,IconCancel as M}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/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 F extends T{refresh(){const t=this.editor.model,e=t.schema,n=t.document.selection,i=k(n);this.isEnabled=j(n,e,t),this.value=i?i.getAttribute("value")||"":null}execute(t){const e=this.editor.model,n=e.document.selection;e.change(i=>{let d;this.value!==null?d=k(n):(d=i.createElement("rawHtml"),e.insertObject(d,null,null,{setSelection:"on"})),i.setAttribute("value",t,d)})}}function j(c,t,e){const n=N(c,e);return t.checkChild(n,"rawHtml")}function N(c,t){const n=D(c,t).start.parent;return n.isEmpty&&!n.is("rootElement")?n.parent:n}function k(c){const t=c.getSelectedElement();return t&&t.is("element","rawHtml")?t:null}class U extends f{constructor(e){super(e);H(this,"_widgetButtonViewReferences",new Set);e.config.define("htmlEmbed",{showPreviews:!1,sanitizeHtml:n=>(y("html-embed-provide-sanitize-function"),{html:n,hasChanged:!1})})}static get pluginName(){return"HtmlEmbedEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.register("rawHtml",{inheritAllFrom:"$blockObject",allowAttributes:["value"]}),e.commands.add("htmlEmbed",new F(e)),this._setupConversion()}_setupConversion(){const e=this.editor,n=e.t,i=e.editing.view,d=this._widgetButtonViewReferences,E=e.config.get("htmlEmbed");this.editor.editing.view.on("render",()=>{for(const o of d){if(o.element&&o.element.isConnected)return;o.destroy(),d.delete(o)}},{priority:"lowest"}),e.data.registerRawContentMatcher({name:"div",classes:"raw-html-embed"}),e.conversion.for("upcast").elementToElement({view:{name:"div",classes:"raw-html-embed"},model:(o,{writer:a})=>a.createElement("rawHtml",{value:o.getCustomProperty("$rawContent")})}),e.conversion.for("dataDowncast").elementToElement({model:"rawHtml",view:(o,{writer:a})=>a.createRawElement("div",{class:"raw-html-embed"},function(s){s.innerHTML=o.getAttribute("value")||""})}),e.conversion.for("editingDowncast").elementToStructure({model:{name:"rawHtml",attributes:["value"]},view:(o,{writer:a})=>{let s,l,r;const m=a.createRawElement("div",{class:"raw-html-embed__content-wrapper"},function(w){s=w,g({editor:e,domElement:w,state:l,props:r}),s.addEventListener("mousedown",()=>{if(l.isEditable){const h=e.model;h.document.selection.getSelectedElement()!==o&&h.change(V=>V.setSelection(o,"on"))}},!0)}),p={makeEditable(){l=Object.assign({},l,{isEditable:!0}),g({domElement:s,editor:e,state:l,props:r}),i.change(w=>{w.setAttribute("data-cke-ignore-events","true",m)}),s.querySelector("textarea").focus()},save(w){w!==l.getRawHtmlValue()?(e.execute("htmlEmbed",w),e.editing.view.focus()):this.cancel()},cancel(){l=Object.assign({},l,{isEditable:!1}),g({domElement:s,editor:e,state:l,props:r}),e.editing.view.focus(),i.change(w=>{w.removeAttribute("data-cke-ignore-events",m)})}};l={showPreviews:E.showPreviews,isEditable:!1,getRawHtmlValue:()=>o.getAttribute("value")||""},r={sanitizeHtml:E.sanitizeHtml,textareaPlaceholder:n("Paste raw HTML here..."),onEditClick(){p.makeEditable()},onSaveClick(w){p.save(w)},onCancelClick(){p.cancel()}};const u=a.createContainerElement("div",{class:"raw-html-embed","data-html-embed-label":n("HTML snippet"),dir:e.locale.uiLanguageDirection},m);return a.setCustomProperty("rawHtmlApi",p,u),a.setCustomProperty("rawHtml",!0,u),L(u,a,{label:n("HTML snippet"),hasSelectionHandle:!0})}});function g({editor:o,domElement:a,state:s,props:l}){a.textContent="";const r=a.ownerDocument;let m;if(s.isEditable){const u={isDisabled:!1,placeholder:l.textareaPlaceholder};m=C({domDocument:r,state:s,props:u}),a.append(m)}else if(s.showPreviews){const u={sanitizeHtml:l.sanitizeHtml};a.append(R({domDocument:r,state:s,props:u,editor:o}))}else{const u={isDisabled:!0,placeholder:l.textareaPlaceholder};a.append(C({domDocument:r,state:s,props:u}))}const p={onEditClick:l.onEditClick,onSaveClick:()=>{l.onSaveClick(m.value)},onCancelClick:l.onCancelClick};a.prepend(_({editor:o,domDocument:r,state:s,props:p}))}function _({editor:o,domDocument:a,state:s,props:l}){const r=b(a,"div",{class:"raw-html-embed__buttons-wrapper"});if(s.isEditable){const m=v(o,"save",l.onSaveClick),p=v(o,"cancel",l.onCancelClick);r.append(m.element,p.element),d.add(m).add(p)}else{const m=v(o,"edit",l.onEditClick);r.append(m.element),d.add(m)}return r}function C({domDocument:o,state:a,props:s}){const l=b(o,"textarea",{placeholder:s.placeholder,class:"ck ck-reset ck-input ck-input-text raw-html-embed__source"});return l.disabled=s.isDisabled,l.value=a.getRawHtmlValue(),l}function R({editor:o,domDocument:a,state:s,props:l}){const r=l.sanitizeHtml(s.getRawHtmlValue()),m=s.getRawHtmlValue().length>0?n("No preview available"):n("Empty snippet content"),p=b(a,"div",{class:"ck ck-reset_all raw-html-embed__preview-placeholder"},m),u=b(a,"div",{class:"raw-html-embed__preview-content",dir:o.locale.contentLanguageDirection}),h=a.createRange().createContextualFragment(r.html);return u.appendChild(h),b(a,"div",{class:"raw-html-embed__preview"},[p,u])}}}function v(c,t,e){const{t:n}=c.locale,i=new x(c.locale),d=c.commands.get("htmlEmbed");return i.set({class:`raw-html-embed__${t}-button`,icon:P,tooltip:!0,tooltipPosition:c.locale.uiLanguageDirection==="rtl"?"e":"w"}),i.render(),t==="edit"?(i.set({icon:P,label:n("Edit source")}),i.bind("isEnabled").to(d)):t==="save"?(i.set({icon:W,label:n("Save changes")}),i.bind("isEnabled").to(d)):i.set({icon:z,label:n("Cancel")}),i.on("execute",e),i}class $ extends f{static get pluginName(){return"HtmlEmbedUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,n=t.locale.t;t.ui.componentFactory.add("htmlEmbed",()=>{const i=this._createButton(x);return i.set({tooltip:!0,label:n("Insert HTML")}),i}),t.ui.componentFactory.add("menuBar:htmlEmbed",()=>{const i=this._createButton(M);return i.set({label:n("HTML snippet")}),i})}_createButton(t){const e=this.editor,n=e.commands.get("htmlEmbed"),i=new t(e.locale);return i.set({icon:O}),i.bind("isEnabled").to(n,"isEnabled"),this.listenTo(i,"execute",()=>{e.execute("htmlEmbed"),e.editing.view.focus(),e.editing.view.document.selection.getSelectedElement().getCustomProperty("rawHtmlApi").makeEditable()}),i}}class Y extends f{static get requires(){return[U,$,I]}static get pluginName(){return"HtmlEmbed"}static get isOfficialPlugin(){return!0}}export{Y as HtmlEmbed,U as HtmlEmbedEditing,$ as HtmlEmbedUI};
4
+ */class y extends B{refresh(){const e=this.editor.model,i=e.schema,a=e.document.selection,t=H(a);this.isEnabled=O(a,i,e),this.value=t?t.getAttribute("value")||"":null}execute(e){const i=this.editor.model,a=i.document.selection;i.change(t=>{let w;this.value!==null?w=H(a):(w=t.createElement("rawHtml"),i.insertObject(w,null,null,{setSelection:"on"})),t.setAttribute("value",e,w)})}}function O(m,e,i){const a=W(m,i);return e.checkChild(a,"rawHtml")}function W(m,e){const a=A(m,e).start.parent;return a.isEmpty&&!a.is("rootElement")?a.parent:a}function H(m){const e=m.getSelectedElement();return e&&e.is("element","rawHtml")?e:null}class z extends f{_widgetButtonViewReferences=new Set;static get pluginName(){return"HtmlEmbedEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("htmlEmbed",{showPreviews:!1,sanitizeHtml:i=>(I("html-embed-provide-sanitize-function"),{html:i,hasChanged:!1})})}init(){const e=this.editor;e.model.schema.register("rawHtml",{inheritAllFrom:"$blockObject",allowAttributes:["value"]}),e.commands.add("htmlEmbed",new y(e)),this._setupConversion()}_setupConversion(){const e=this.editor,i=e.t,a=e.editing.view,t=this._widgetButtonViewReferences,w=e.config.get("htmlEmbed");this.editor.editing.view.on("render",()=>{for(const o of t){if(o.element&&o.element.isConnected)return;o.destroy(),t.delete(o)}},{priority:"lowest"}),e.data.registerRawContentMatcher({name:"div",classes:"raw-html-embed"}),e.conversion.for("upcast").elementToElement({view:{name:"div",classes:"raw-html-embed"},model:(o,{writer:l})=>l.createElement("rawHtml",{value:o.getCustomProperty("$rawContent")})}),e.conversion.for("dataDowncast").elementToElement({model:"rawHtml",view:(o,{writer:l})=>l.createRawElement("div",{class:"raw-html-embed"},function(s){s.innerHTML=o.getAttribute("value")||""})}),e.conversion.for("editingDowncast").elementToStructure({model:{name:"rawHtml",attributes:["value"]},view:(o,{writer:l})=>{let s,n,c;const r=l.createRawElement("div",{class:"raw-html-embed__content-wrapper"},function(u){s=u,g({editor:e,domElement:u,state:n,props:c}),s.addEventListener("mousedown",()=>{if(n.isEditable){const h=e.model;h.document.selection.getSelectedElement()!==o&&h.change(R=>R.setSelection(o,"on"))}},!0)}),p={makeEditable(){n=Object.assign({},n,{isEditable:!0}),g({domElement:s,editor:e,state:n,props:c}),a.change(u=>{u.setAttribute("data-cke-ignore-events","true",r)}),s.querySelector("textarea").focus()},save(u){u!==n.getRawHtmlValue()?(e.execute("htmlEmbed",u),e.editing.view.focus()):this.cancel()},cancel(){n=Object.assign({},n,{isEditable:!1}),g({domElement:s,editor:e,state:n,props:c}),e.editing.view.focus(),a.change(u=>{u.removeAttribute("data-cke-ignore-events",r)})}};n={showPreviews:w.showPreviews,isEditable:!1,getRawHtmlValue:()=>o.getAttribute("value")||""},c={sanitizeHtml:w.sanitizeHtml,textareaPlaceholder:i("Paste raw HTML here..."),onEditClick(){p.makeEditable()},onSaveClick(u){p.save(u)},onCancelClick(){p.cancel()}};const d=l.createContainerElement("div",{class:"raw-html-embed","data-html-embed-label":i("HTML snippet"),dir:e.locale.uiLanguageDirection},r);return l.setCustomProperty("rawHtmlApi",p,d),l.setCustomProperty("rawHtml",!0,d),S(d,l,{label:i("HTML snippet"),hasSelectionHandle:!0})}});function g({editor:o,domElement:l,state:s,props:n}){l.textContent="";const c=l.ownerDocument;let r;if(s.isEditable){const d={isDisabled:!1,placeholder:n.textareaPlaceholder};r=E({domDocument:c,state:s,props:d}),l.append(r)}else if(s.showPreviews){const d={sanitizeHtml:n.sanitizeHtml};l.append(x({domDocument:c,state:s,props:d,editor:o}))}else{const d={isDisabled:!0,placeholder:n.textareaPlaceholder};l.append(E({domDocument:c,state:s,props:d}))}const p={onEditClick:n.onEditClick,onSaveClick:()=>{n.onSaveClick(r.value)},onCancelClick:n.onCancelClick};l.prepend(k({editor:o,domDocument:c,state:s,props:p}))}function k({editor:o,domDocument:l,state:s,props:n}){const c=b(l,"div",{class:"raw-html-embed__buttons-wrapper"});if(s.isEditable){const r=v(o,"save",n.onSaveClick),p=v(o,"cancel",n.onCancelClick);c.append(r.element,p.element),t.add(r).add(p)}else{const r=v(o,"edit",n.onEditClick);c.append(r.element),t.add(r)}return c}function E({domDocument:o,state:l,props:s}){const n=b(o,"textarea",{placeholder:s.placeholder,class:"ck ck-reset ck-input ck-input-text raw-html-embed__source"});return n.disabled=s.isDisabled,n.value=l.getRawHtmlValue(),n}function x({editor:o,domDocument:l,state:s,props:n}){const c=n.sanitizeHtml(s.getRawHtmlValue()),r=s.getRawHtmlValue().length>0?i("No preview available"):i("Empty snippet content"),p=b(l,"div",{class:"ck ck-reset_all raw-html-embed__preview-placeholder"},r),d=b(l,"div",{class:"raw-html-embed__preview-content",dir:o.locale.contentLanguageDirection}),h=l.createRange().createContextualFragment(c.html);return d.appendChild(h),b(l,"div",{class:"raw-html-embed__preview"},[p,d])}}}function v(m,e,i){const{t:a}=m.locale,t=new P(m.locale),w=m.commands.get("htmlEmbed");return t.set({class:`raw-html-embed__${e}-button`,icon:C,tooltip:!0,tooltipPosition:m.locale.uiLanguageDirection==="rtl"?"e":"w"}),t.render(),e==="edit"?(t.set({icon:C,label:a("Edit source")}),t.bind("isEnabled").to(w)):e==="save"?(t.set({icon:D,label:a("Save changes")}),t.bind("isEnabled").to(w)):t.set({icon:M,label:a("Cancel")}),t.on("execute",i),t}class F extends f{static get pluginName(){return"HtmlEmbedUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,a=e.locale.t;e.ui.componentFactory.add("htmlEmbed",()=>{const t=this._createButton(P);return t.set({tooltip:!0,label:a("Insert HTML")}),t}),e.ui.componentFactory.add("menuBar:htmlEmbed",()=>{const t=this._createButton(T);return t.set({label:a("HTML snippet")}),t})}_createButton(e){const i=this.editor,a=i.commands.get("htmlEmbed"),t=new e(i.locale);return t.set({icon:L}),t.bind("isEnabled").to(a,"isEnabled"),this.listenTo(t,"execute",()=>{i.execute("htmlEmbed"),i.editing.view.focus(),i.editing.view.document.selection.getSelectedElement().getCustomProperty("rawHtmlApi").makeEditable()}),t}}class G extends f{static get requires(){return[z,F,V]}static get pluginName(){return"HtmlEmbed"}static get isOfficialPlugin(){return!0}}export{G as HtmlEmbed,z as HtmlEmbedEditing,F as HtmlEmbedUI};