@ncino/web-components 4.3.0-preview.9 → 5.0.0-preview.10

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 (248) 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.figma.js +10 -0
  7. package/dist/components/accordion/gator/base/accordion.gator.js +11 -9
  8. package/dist/components/accordion/gator/group/accordion-group.gator.figma.js +3 -0
  9. package/dist/components/accordion/gator/group/accordion-group.gator.js +2 -2
  10. package/dist/components/alert/gator/base/alert.gator.js +2 -2
  11. package/dist/components/alert/gator/subtitle/alert-subtitle.gator.js +2 -2
  12. package/dist/components/alert/gator/title/alert-title.gator.js +2 -2
  13. package/dist/components/avatar/gator/avatar.gator.js +5 -5
  14. package/dist/components/badge/gator/badge.gator.js +2 -2
  15. package/dist/components/banner/gator/banner.gator.figma.js +8 -0
  16. package/dist/components/banner/gator/banner.gator.js +6 -5
  17. package/dist/components/boolean/boolean.gator.figma.js +11 -0
  18. package/dist/components/boolean/boolean.gator.js +6 -6
  19. package/dist/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.figma.js +3 -0
  20. package/dist/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.js +2 -2
  21. package/dist/components/breadcrumbs/gator/container/breadcrumbs.gator.figma.js +5 -0
  22. package/dist/components/button/gator/button.gator.js +4 -4
  23. package/dist/components/button-group/gator/button-group.gator.js +2 -2
  24. package/dist/components/card/gator/footer/card-footer.gator.js +2 -2
  25. package/dist/components/card/gator/header/card-header.gator.js +2 -2
  26. package/dist/components/checkbox/checkbox.gator.js +5 -5
  27. package/dist/components/checkbox-group/checkbox-group.gator.js +8 -8
  28. package/dist/components/chip/chip.js +1 -1
  29. package/dist/components/chip/gator/chip.gator.js +15 -5
  30. package/dist/components/combobox/base/combobox.js +1 -1
  31. package/dist/components/combobox/base/combobox.slds.js +13 -13
  32. package/dist/components/date-picker/base/gator/datepicker.gator.js +18 -18
  33. package/dist/components/date-picker/year-month-selector/year-month-selector.gator.js +2 -2
  34. package/dist/components/headline-card/gator/headline-card.gator.js +2 -2
  35. package/dist/components/icon/gator/icon.gator.js +2 -2
  36. package/dist/components/illustration/gator/illustration.gator.js +2 -2
  37. package/dist/components/input/base/input-base.gator.js +1 -1
  38. package/dist/components/input/gator/dropdown/input-dropdown.gator.js +11 -11
  39. package/dist/components/input/gator/input-currency/input-currency.gator.js +2 -2
  40. package/dist/components/input/gator/input-date/input-date.gator.js +15 -15
  41. package/dist/components/input/gator/input-file/input-file.gator.js +3 -3
  42. package/dist/components/input/gator/input-masked/input-masked.gator.js +1 -1
  43. package/dist/components/input/gator/input-phone/input-phone.gator.js +2 -2
  44. package/dist/components/input/gator/input-search/input-search.gator.js +2 -2
  45. package/dist/components/input/gator/input-text/input-text.gator.js +1 -1
  46. package/dist/components/input/gator/input-time/input-time.gator.js +2 -2
  47. package/dist/components/list/gator/list/list.gator.js +2 -2
  48. package/dist/components/list/gator/list-item/list-item.gator.js +6 -6
  49. package/dist/components/menu/base/gator/menu.gator.js +3 -3
  50. package/dist/components/menu/base/slds/menu.slds.js +2 -2
  51. package/dist/components/menu/menu-item/gator/menu-item.gator.js +2 -2
  52. package/dist/components/menu/menu-submenu/menu-submenu.js +1 -1
  53. package/dist/components/modal/gator/modal.gator.js +38 -39
  54. package/dist/components/page-header/gator/page-header.gator.js +2 -2
  55. package/dist/components/panel/gator/panel.gator.js +13 -13
  56. package/dist/components/panel/gator/panel.storybook-test.js +1 -1
  57. package/dist/components/pill/pill.slds.js +3 -3
  58. package/dist/components/popover/gator/popover.gator.js +10 -10
  59. package/dist/components/popover/popover.js +1 -1
  60. package/dist/components/radio/radio.gator.js +2 -2
  61. package/dist/components/radio-group/radio-group.gator.js +2 -2
  62. package/dist/components/selection-box-group/selection-box-group.gator.js +5 -5
  63. package/dist/components/selector/gator/selector.gator.js +2 -2
  64. package/dist/components/switch/gator/switch.gator.js +2 -2
  65. package/dist/components/table/gator/table-bulk-controls/table-bulk-controls.gator.js +16 -0
  66. package/dist/components/table/gator/table.gator.js +55 -36
  67. package/dist/components/tabs/gator/tabset/tabset.gator.js +3 -3
  68. package/dist/components/text-detail/gator/text-detail.gator.figma.js +30 -0
  69. package/dist/components/text-detail/gator/text-detail.gator.js +17 -18
  70. package/dist/components/time-picker/gator/time-picker.gator.js +19 -19
  71. package/dist/components/toast/gator/base/toast.gator.js +8 -9
  72. package/dist/components/toast/gator/subtitle/toast-subtitle.gator.js +2 -2
  73. package/dist/components/toast/gator/title/toast-title.gator.js +2 -2
  74. package/dist/components/toast/toast.js +1 -1
  75. package/dist/components/toast-container/gator/toast-container.gator.js +18 -0
  76. package/dist/components/toast-container/index.js +1 -0
  77. package/dist/components/toaster/gator/toaster.gator.js +5 -0
  78. package/dist/components/toaster/index.js +1 -0
  79. package/dist/components/tooltip/tooltip.js +1 -1
  80. package/dist/index.gator.js +1 -1
  81. package/dist/index.js +1 -1
  82. package/dist/index.services.js +1 -0
  83. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-autosave@45.2.1/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js +2 -2
  84. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-basic-styles@45.2.1/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +2 -2
  85. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-clipboard@45.2.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +10 -10
  86. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-cloud-services@45.2.1/node_modules/@ckeditor/ckeditor5-cloud-services/dist/index.js +2 -2
  87. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-code-block@45.2.1/node_modules/@ckeditor/ckeditor5-code-block/dist/index.js +5 -5
  88. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js +2 -2
  89. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-editor-classic@45.2.1/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +2 -2
  90. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +12 -12
  91. 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
  92. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-font@45.2.1/node_modules/@ckeditor/ckeditor5-font/dist/index.js +3 -3
  93. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-heading@45.2.1/node_modules/@ckeditor/ckeditor5-heading/dist/index.js +3 -3
  94. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-embed@45.2.1/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +2 -2
  95. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-support@45.2.1/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +6 -6
  96. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@45.2.1/node_modules/@ckeditor/ckeditor5-image/dist/index.js +4 -4
  97. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-indent@45.2.1/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +4 -4
  98. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-link@45.2.1/node_modules/@ckeditor/ckeditor5-link/dist/index.js +2 -2
  99. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-list@45.2.1/node_modules/@ckeditor/ckeditor5-list/dist/index.js +5 -5
  100. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-markdown-gfm@45.2.1/node_modules/@ckeditor/ckeditor5-markdown-gfm/dist/index.js +4 -4
  101. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-media-embed@45.2.1/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +2 -2
  102. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paragraph@45.2.1/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +2 -2
  103. 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
  104. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-source-editing@45.2.1/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +2 -2
  105. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-special-characters@45.2.1/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +2 -2
  106. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-style@45.2.1/node_modules/@ckeditor/ckeditor5-style/dist/index.js +2 -2
  107. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@45.2.1/node_modules/@ckeditor/ckeditor5-table/dist/index.js +6 -6
  108. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-typing@45.2.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +4 -4
  109. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +10 -10
  110. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-undo@45.2.1/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +2 -2
  111. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-upload@45.2.1/node_modules/@ckeditor/ckeditor5-upload/dist/index.js +2 -2
  112. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +38 -38
  113. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-watchdog@45.2.1/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +3 -3
  114. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-widget@45.2.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +2 -2
  115. package/dist/node_modules/.pnpm/@deltablot_dropzone@7.3.1/node_modules/@deltablot/dropzone/dist/dropzone.js +1 -1
  116. package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/main.js +1 -1
  117. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.4/node_modules/@figma/code-connect/dist/common/fetch.js +1 -0
  118. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.4/node_modules/@figma/code-connect/dist/connect/figma_rest_api.js +1 -0
  119. 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
  120. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.4/node_modules/@figma/code-connect/package.json.js +1 -0
  121. package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +1 -1
  122. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.4/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +1 -0
  123. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/reactive-element.js +2 -2
  124. 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
  125. 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
  126. 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
  127. 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
  128. 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
  129. 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
  130. package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js +8 -8
  131. package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +2 -2
  132. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +5 -5
  133. package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +12 -12
  134. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js +21 -21
  135. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +2 -2
  136. package/dist/node_modules/.pnpm/axe-core@4.10.3/node_modules/axe-core/axe.js +4 -4
  137. package/dist/node_modules/.pnpm/chai@5.2.0/node_modules/chai/chai.js +3 -3
  138. package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js +1 -1
  139. package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js +1 -1
  140. package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/get.js +1 -1
  141. package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/unset.js +1 -1
  142. package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js +1 -1
  143. package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/function/debounce.js +1 -1
  144. package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/object/cloneDeepWith.js +1 -1
  145. package/dist/node_modules/.pnpm/lit-element@4.2.0/node_modules/lit-element/lit-element.js +2 -2
  146. package/dist/node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/async-directive.js +1 -1
  147. package/dist/node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directive-helpers.js +2 -2
  148. package/dist/node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/class-map.js +2 -2
  149. package/dist/node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/ref.js +2 -2
  150. package/dist/node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/repeat.js +5 -0
  151. package/dist/node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/lit-html.js +3 -3
  152. package/dist/node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.es.js +1 -1
  153. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +1 -1
  154. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/cache.js +1 -1
  155. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/cachestorage.js +1 -1
  156. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cookies/parse.js +1 -1
  157. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/constants.js +1 -1
  158. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/headers.js +1 -1
  159. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/index.js +1 -1
  160. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/request.js +1 -1
  161. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/response.js +1 -1
  162. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/util.js +2 -2
  163. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/webidl.js +1 -1
  164. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/connection.js +1 -1
  165. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/events.js +1 -1
  166. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/frame.js +1 -1
  167. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/receiver.js +1 -1
  168. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/util.js +1 -1
  169. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/websocket.js +1 -1
  170. 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 +8 -0
  171. 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 +12 -0
  172. package/dist/packages/web-components/src/components/accordion/gator/base/accordion.gator.scss.js +1 -1
  173. package/dist/packages/web-components/src/components/accordion/gator/group/accordion-group.gator.scss.js +1 -1
  174. package/dist/packages/web-components/src/components/banner/gator/banner.gator.scss.js +1 -1
  175. package/dist/packages/web-components/src/components/button/gator/button.gator.scss.js +1 -1
  176. package/dist/packages/web-components/src/components/button-card/gator/button-card.gator.scss.js +1 -1
  177. package/dist/packages/web-components/src/components/card/gator/base/card.gator.scss.js +1 -1
  178. package/dist/packages/web-components/src/components/chip/gator/chip.gator.scss.js +1 -1
  179. package/dist/packages/web-components/src/components/modal/gator/modal.gator.scss.js +1 -1
  180. package/dist/packages/web-components/src/components/switch/gator/switch.gator.scss.js +1 -1
  181. package/dist/packages/web-components/src/components/table/gator/table-bulk-controls/table-bulk-controls.gator.scss.js +1 -0
  182. package/dist/packages/web-components/src/components/text-detail/gator/text-detail.gator.scss.js +1 -1
  183. package/dist/packages/web-components/src/components/toast/gator/base/toast.gator.scss.js +1 -1
  184. package/dist/packages/web-components/src/components/toast-container/gator/toast-container.gator.scss.js +1 -0
  185. package/dist/packages/web-components/src/components/toaster/gator/toaster.gator.scss.js +1 -0
  186. package/dist/packages/web-components/src/index.slds.scss.js +1 -1
  187. package/dist/services/toaster-service.js +1 -0
  188. package/dist/types/components/accordion/gator/base/accordion.gator.d.ts +13 -3
  189. package/dist/types/components/accordion/gator/base/accordion.gator.figma.d.ts +1 -0
  190. package/dist/types/components/accordion/gator/group/accordion-group.gator.d.ts +5 -0
  191. package/dist/types/components/accordion/gator/group/accordion-group.gator.figma.d.ts +1 -0
  192. package/dist/types/components/avatar/gator/avatar.gator.d.ts +1 -0
  193. package/dist/types/components/banner/gator/banner.gator.d.ts +5 -0
  194. package/dist/types/components/banner/gator/banner.gator.figma.d.ts +1 -0
  195. package/dist/types/components/boolean/boolean.gator.figma.d.ts +1 -0
  196. package/dist/types/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.figma.d.ts +1 -0
  197. package/dist/types/components/breadcrumbs/gator/container/breadcrumbs.gator.figma.d.ts +1 -0
  198. package/dist/types/components/chip/chip.d.ts +10 -0
  199. package/dist/types/components/chip/gator/chip.gator.d.ts +1 -0
  200. package/dist/types/components/modal/gator/modal.gator.d.ts +1 -1
  201. package/dist/types/components/table/gator/table-bulk-controls/table-bulk-controls.gator.d.ts +29 -0
  202. package/dist/types/components/table/gator/table-bulk-controls/table-bulk-controls.gator.test.d.ts +0 -0
  203. package/dist/types/components/table/gator/table.gator.d.ts +9 -0
  204. package/dist/types/components/text-detail/gator/text-detail.gator.d.ts +4 -2
  205. package/dist/types/components/text-detail/gator/text-detail.gator.figma.d.ts +1 -0
  206. package/dist/types/components/toast/toast.d.ts +14 -0
  207. package/dist/types/components/toast-container/gator/toast-container.gator.d.ts +15 -0
  208. package/dist/types/components/toast-container/gator/toast-container.gator.test.d.ts +0 -0
  209. package/dist/types/components/toast-container/index.d.ts +1 -0
  210. package/dist/types/components/toaster/gator/toaster.gator.d.ts +32 -0
  211. package/dist/types/components/toaster/gator/toaster.gator.test.d.ts +0 -0
  212. package/dist/types/components/toaster/index.d.ts +1 -0
  213. package/dist/types/index.d.ts +2 -0
  214. package/dist/types/index.gator.d.ts +2 -0
  215. package/dist/types/index.services.d.ts +1 -0
  216. package/dist/types/services/toaster-service.d.ts +117 -0
  217. package/dist/types/services/toaster-service.test.d.ts +1 -0
  218. package/dist/utils/accessibility-utils.js +1 -1
  219. package/dist/utils/datatestid-utils.js +1 -1
  220. package/dist/utils/lightdom-utils.js +1 -1
  221. package/dist/utils/vitest-a11y-utils.js +1 -1
  222. package/dist/utils/vitest-utils.js +1 -1
  223. package/package.json +16 -12
  224. package/web-types.json +293 -114
  225. package/dist/_virtual/sourcemap-codec.umd.js +0 -1
  226. package/dist/_virtual/sourcemap-codec.umd2.js +0 -1
  227. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/dist/common/fetch.js +0 -1
  228. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/dist/connect/figma_rest_api.js +0 -1
  229. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/package.json.js +0 -1
  230. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js +0 -1
  231. package/dist/node_modules/.pnpm/@vitest_browser@3.2.4_msw@2.7.3_@types_node@24.0.7_typescript@5.8.3__playwright@1.53.1__894c207534f0ba223b8299d9f5ff1049/node_modules/@vitest/browser/context.js +0 -1
  232. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.7_@vitest_browser@3.2.4_@vitest_ui@3._93f645c93c51b497c065da8f21fff0a5/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +0 -8
  233. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.7_@vitest_browser@3.2.4_@vitest_ui@3._93f645c93c51b497c065da8f21fff0a5/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +0 -12
  234. package/dist/packages/web-components/src/components/accordion/gator/base/accordion.gator.tokens.scss.js +0 -1
  235. package/dist/packages/web-components/src/components/accordion/gator/group/accordion-group.gator.tokens.scss.js +0 -1
  236. /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
  237. /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
  238. /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
  239. /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
  240. /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
  241. /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
  242. /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
  243. /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
  244. /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
  245. /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
  246. /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
  247. /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.7_@vitest_browser@3.2.4_@vitest_ui@3._93f645c93c51b497c065da8f21fff0a5 → 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/_commonjsHelpers.BFTU3MAI.js +0 -0
  248. /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.7_@vitest_browser@3.2.4_@vitest_ui@3._93f645c93c51b497c065da8f21fff0a5 → 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/date.Bq6ZW5rf.js +0 -0
@@ -1,7 +1,7 @@
1
- var O=Object.defineProperty;var R=(i,t,e)=>t in i?O(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var h=(i,t,e)=>R(i,typeof t!="symbol"?t+"":t,e);import{Plugin as S,Command as x}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{ShiftEnter as M}from"../../../../../@ckeditor_ckeditor5-enter@45.2.1/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import{UpcastWriter as N}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{ClipboardPipeline as q}from"../../../../../@ckeditor_ckeditor5-clipboard@45.2.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{Collection as F,first as v}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{createDropdown as $,addListToDropdown as z,MenuBarMenuView as W,MenuBarMenuListView as j,MenuBarMenuListItemView as U,MenuBarMenuListItemButtonView as H,ViewModel as J,SplitButtonView as K}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconCodeBlock as A}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";/**
1
+ import{Plugin as C,Command as S}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{ShiftEnter as y}from"../../../../../@ckeditor_ckeditor5-enter@45.2.1/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import{UpcastWriter as O}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{ClipboardPipeline as R}from"../../../../../@ckeditor_ckeditor5-clipboard@45.2.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{Collection as M,first as B}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{createDropdown as N,addListToDropdown as q,MenuBarMenuView as F,MenuBarMenuListView as $,MenuBarMenuListItemView as z,MenuBarMenuListItemButtonView as W,ViewModel as j,SplitButtonView as U}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconCodeBlock as w}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
- */function b(i){const t=i.t,e=i.config.get("codeBlock.languages");for(const o of e)o.label==="Plain text"&&(o.label=t("Plain text")),o.class===void 0&&(o.class=`language-${o.language}`);return e}function k(i,t,e){const o={};for(const a of i)if(t==="class"){const s=a[t].split(" ").shift();o[s]=a[e]}else o[a[t]]=a[e];return o}function L(i){return i.data.match(/^(\s*)/)[0]}function G(i,t){const e=i.createDocumentFragment(),o=t.split(`
5
- `),a=o.reduce((s,n,c)=>(s.push(n),c<o.length-1&&s.push(i.createElement("br")),s),[]);return i.appendChild(a,e),e}function C(i){const t=i.document.selection,e=[];if(t.isCollapsed)return[t.anchor];const o=t.getFirstRange().getWalker({ignoreElementEnd:!0,direction:"backward"});for(const{item:a}of o){let s=a.is("$textProxy")?a.textNode:a;const n=s.parent;if(!n.is("element","codeBlock")||s.is("element","softBreak"))continue;for(;s.previousSibling&&!s.previousSibling.is("element","softBreak");)s=s.previousSibling;const c=s.is("$text")?s.startOffset+L(s).length:s.startOffset,r=i.createPositionAt(n,c);e.every(l=>!l.isEqual(r))&&e.push(r)}return e}function D(i){const t=v(i.getSelectedBlocks());return!!t&&t.is("element","codeBlock")}function P(i,t){return t.is("rootElement")||i.isLimit(t)?!1:i.checkChild(t.parent,"codeBlock")}function E(i,t,e,o){const a=k(t,"language","label"),s=e.getAttribute("language");if(s in a){const n=a[s];return i(o==="enter"?"Entering %0 code snippet":"Leaving %0 code snippet",n)}return i(o==="enter"?"Entering code snippet":"Leaving code snippet")}function I(i,t){for(i.textNode&&(i=t.createPositionBefore(i.textNode));i.nodeBefore&&!i.nodeBefore.is("element","softBreak");)i=t.createPositionBefore(i.nodeBefore);const e=i.nodeAfter;return e&&e.is("$text")?e:null}class X extends x{constructor(e){super(e);h(this,"_lastLanguage");this._lastLanguage=null}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const o=this.editor,a=o.model,s=a.document.selection,c=b(o)[0],r=Array.from(s.getSelectedBlocks()),l=e.forceValue==null?!this.value:e.forceValue,d=Q(e,this._lastLanguage,c.language);a.change(u=>{l?this._applyCodeBlock(u,r,d):this._removeCodeBlock(u,r)})}_getValue(){const e=this.editor.model.document.selection,o=v(e.getSelectedBlocks());return!!(o!=null&&o.is("element","codeBlock"))?o.getAttribute("language"):!1}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,o=this.editor.model.schema,a=v(e.getSelectedBlocks());return a?P(o,a):!1}_applyCodeBlock(e,o,a){this._lastLanguage=a;const s=this.editor.model.schema,n=o.filter(c=>P(s,c));for(const c of n)e.rename(c,"codeBlock"),e.setAttribute("language",a,c),s.removeDisallowedAttributes([c],e),Array.from(c.getChildren()).filter(r=>!s.checkChild(c,r)).forEach(r=>e.remove(r));n.reverse().forEach((c,r)=>{const l=n[r+1];c.previousSibling===l&&(e.appendElement("softBreak",l),e.merge(e.createPositionBefore(c)))})}_removeCodeBlock(e,o){const a=o.filter(s=>s.is("element","codeBlock"));for(const s of a){const n=e.createRangeOn(s);for(const c of Array.from(n.getItems()).reverse())if(c.is("element","softBreak")&&c.parent.is("element","codeBlock")){const{position:r}=e.split(e.createPositionBefore(c)),l=r.nodeAfter;e.rename(l,"paragraph"),e.removeAttribute("language",l),e.remove(c)}e.rename(s,"paragraph"),e.removeAttribute("language",s)}}}function Q(i,t,e){return i.language?i.language:i.usePreviousLanguageChoice&&t?t:e}class Y extends x{constructor(e){super(e);h(this,"_indentSequence");this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const o=this.editor.model;o.change(a=>{const s=C(o);for(const n of s){const c=a.createText(this._indentSequence);o.insertContent(c,n)}})}_checkEnabled(){return this._indentSequence?D(this.editor.model.document.selection):!1}}class Z extends x{constructor(e){super(e);h(this,"_indentSequence");this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const o=this.editor.model;o.change(()=>{const a=C(o);for(const s of a){const n=T(o,s,this._indentSequence);n&&o.deleteContent(o.createSelection(n))}})}_checkEnabled(){if(!this._indentSequence)return!1;const e=this.editor.model;return D(e.document.selection)?C(e).some(o=>T(e,o,this._indentSequence)):!1}}function T(i,t,e){const o=I(t,i);if(!o)return null;const a=L(o),s=a.lastIndexOf(e);if(s+e.length!==a.length||s===-1)return null;const{parent:n,startOffset:c}=o;return i.createRange(i.createPositionAt(n,c+s),i.createPositionAt(n,c+s+e.length))}function _(i,t,e=!1){const o=k(t,"language","class"),a=k(t,"language","label");return(s,n,c)=>{const{writer:r,mapper:l,consumable:d}=c;if(!d.consume(n.item,"insert"))return;const u=n.item.getAttribute("language"),g=l.toViewPosition(i.createPositionBefore(n.item)),m={};e&&(m["data-language"]=a[u],m.spellcheck="false");const p=o[u]?{class:o[u]}:void 0,w=r.createContainerElement("code",p),y=r.createContainerElement("pre",m,w);r.insert(g,y),l.bindElements(n.item,w)}}function ee(i){return(t,e,o)=>{if(e.item.parent.name!=="codeBlock")return;const{writer:a,mapper:s,consumable:n}=o;if(!n.consume(e.item,"insert"))return;const c=s.toViewPosition(i.createPositionBefore(e.item));a.insert(c,a.createText(`
6
- `))}}function te(i,t){const e=k(t,"class","language"),o=t[0].language;return(a,s,n)=>{const c=s.viewItem,r=c.parent;if(!r||!r.is("element","pre")||s.modelCursor.findAncestor("codeBlock"))return;const{consumable:l,writer:d}=n;if(!l.test(c,{name:!0}))return;const u=d.createElement("codeBlock"),g=[...c.getClassNames()];g.length||g.push("");for(const m of g){const p=e[m];if(p){d.setAttribute("language",p,u);break}}u.hasAttribute("language")||d.setAttribute("language",o,u),n.convertChildren(c,u),n.safeInsert(u,s.modelCursor)&&(l.consume(c,{name:!0}),n.updateConversionResult(u,s))}}function ne(){return(i,t,{consumable:e,writer:o})=>{let a=t.modelCursor;if(!e.test(t.viewItem)||!a.findAncestor("codeBlock"))return;e.consume(t.viewItem);const n=t.viewItem.data.split(`
7
- `).map(r=>o.createText(r)),c=n[n.length-1];for(const r of n)if(o.insert(r,a),a=a.getShiftedBy(r.offsetSize),r!==c){const l=o.createElement("softBreak");o.insert(l,a),a=o.createPositionAfter(l)}t.modelRange=o.createRange(t.modelCursor,a),t.modelCursor=a}}function oe(){return(i,t,{consumable:e})=>{const o=t.viewItem;if(o.findAncestor("pre"))return;const a=Array.from(o.getChildren()),s=a.find(n=>n.is("element","code"));if(s)for(const n of a)n===s||!n.is("$text")||e.consume(n,{name:!0})}}const V="paragraph";class ie extends S{static get pluginName(){return"CodeBlockEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[M]}constructor(t){super(t),t.config.define("codeBlock",{languages:[{language:"plaintext",label:"Plain text"},{language:"c",label:"C"},{language:"cs",label:"C#"},{language:"cpp",label:"C++"},{language:"css",label:"CSS"},{language:"diff",label:"Diff"},{language:"go",label:"Go"},{language:"html",label:"HTML"},{language:"java",label:"Java"},{language:"javascript",label:"JavaScript"},{language:"php",label:"PHP"},{language:"python",label:"Python"},{language:"ruby",label:"Ruby"},{language:"typescript",label:"TypeScript"},{language:"xml",label:"XML"}],indentSequence:" "})}init(){const t=this.editor,e=t.model.schema,o=t.model,a=t.editing.view,s=b(t);t.commands.add("codeBlock",new X(t)),t.commands.add("indentCodeBlock",new Y(t)),t.commands.add("outdentCodeBlock",new Z(t)),this.listenTo(a.document,"tab",(n,c)=>{const r=c.shiftKey?"outdentCodeBlock":"indentCodeBlock";t.commands.get(r).isEnabled&&(t.execute(r),c.stopPropagation(),c.preventDefault(),n.stop())},{context:"pre"}),e.register("codeBlock",{allowWhere:"$block",allowChildren:"$text",disallowChildren:"$inlineObject",allowAttributes:["language"],allowAttributesOf:"$listItem",isBlock:!0}),e.addAttributeCheck((n,c)=>{const r=n.getItem(n.length-2);if(e.getAttributeProperties(c).isFormatting&&r&&r.name=="codeBlock")return!1}),t.editing.downcastDispatcher.on("insert:codeBlock",_(o,s,!0)),t.data.downcastDispatcher.on("insert:codeBlock",_(o,s)),t.data.downcastDispatcher.on("insert:softBreak",ee(o),{priority:"high"}),t.data.upcastDispatcher.on("element:code",te(a,s)),t.data.upcastDispatcher.on("text",ne()),t.data.upcastDispatcher.on("element:pre",oe(),{priority:"high"}),this.listenTo(t.editing.view.document,"clipboardInput",(n,c)=>{let r=o.createRange(o.document.selection.anchor);if(c.targetRanges&&(r=t.editing.mapper.toModelRange(c.targetRanges[0])),!r.start.parent.is("element","codeBlock"))return;const l=c.dataTransfer.getData("text/plain"),d=new N(t.editing.view.document);c.content=G(d,l)}),t.plugins.has("ClipboardPipeline")&&t.plugins.get(q).on("contentInsertion",(n,c)=>{const r=t.model,l=r.document.selection;l.anchor.parent.is("element","codeBlock")&&r.change(d=>{const u=d.createRangeIn(c.content);for(const g of[...u.getItems()])g.is("node")&&!e.checkChild(l.anchor,g)&&d.remove(g)})}),this.listenTo(o,"getSelectedContent",(n,[c])=>{const r=c.anchor;c.isCollapsed||!r.parent.is("element","codeBlock")||!r.hasSameParentAs(c.focus)||o.change(l=>{const d=n.return;if(r.parent.is("element")&&(d.childCount>1||c.containsEntireContent(r.parent))){const g=l.createElement("codeBlock",r.parent.getAttributes());l.append(d,g);const m=l.createDocumentFragment();l.append(g,m),n.return=m;return}const u=d.getChild(0);e.checkAttribute(u,"code")&&l.setAttribute("code",!0,u)})})}afterInit(){const t=this.editor,e=t.commands,o=e.get("indent"),a=e.get("outdent");o&&o.registerChildCommand(e.get("indentCodeBlock"),{priority:"highest"}),a&&a.registerChildCommand(e.get("outdentCodeBlock")),this.listenTo(t.editing.view.document,"enter",(s,n)=>{t.model.document.selection.getLastPosition().parent.is("element","codeBlock")&&(!ce(t,n.isSoft)&&!ae(t,n.isSoft)&&se(t),n.preventDefault(),s.stop())},{context:"pre"}),this._initAriaAnnouncements()}_initAriaAnnouncements(){const{model:t,ui:e,t:o}=this.editor,a=b(this.editor);let s=null;t.document.selection.on("change:range",()=>{const n=t.document.selection.focus.parent;!e||s===n||!n.is("element")||(s&&s.is("element","codeBlock")&&e.ariaLiveAnnouncer.announce(E(o,a,s,"leave")),n.is("element","codeBlock")&&e.ariaLiveAnnouncer.announce(E(o,a,n,"enter")),s=n)})}}function se(i){const t=i.model,e=t.document,o=e.selection.getLastPosition();let a;const s=I(o,t);s&&s.is("$text")&&(a=L(s)),i.model.change(n=>{i.execute("shiftEnter"),a&&n.insertText(a,e.selection.anchor)})}function ce(i,t){const o=i.model.document,a=i.editing.view,s=o.selection.getLastPosition(),n=s.nodeAfter;return t||!o.selection.isCollapsed||!s.isAtStart||!f(n)?!1:(i.model.change(c=>{i.execute("enter");const r=o.selection.anchor.parent.previousSibling;c.rename(r,V),c.setSelection(r,"in"),i.model.schema.removeDisallowedAttributes([r],c),c.remove(n)}),a.scrollToTheSelection(),!0)}function ae(i,t){const e=i.model,o=e.document,a=i.editing.view,s=o.selection.getLastPosition(),n=s.nodeBefore;let c;if(t||!o.selection.isCollapsed||!s.isAtEnd||!n||!n.previousSibling)return!1;if(f(n)&&f(n.previousSibling))c=e.createRange(e.createPositionBefore(n.previousSibling),e.createPositionAfter(n));else if(B(n)&&f(n.previousSibling)&&f(n.previousSibling.previousSibling))c=e.createRange(e.createPositionBefore(n.previousSibling.previousSibling),e.createPositionAfter(n));else if(B(n)&&f(n.previousSibling)&&B(n.previousSibling.previousSibling)&&n.previousSibling.previousSibling&&f(n.previousSibling.previousSibling.previousSibling))c=e.createRange(e.createPositionBefore(n.previousSibling.previousSibling.previousSibling),e.createPositionAfter(n));else return!1;return i.model.change(r=>{r.remove(c),i.execute("enter");const l=o.selection.anchor.parent;r.rename(l,V),i.model.schema.removeDisallowedAttributes([l],r)}),a.scrollToTheSelection(),!0}function B(i){return i&&i.is("$text")&&!i.data.match(/\S/)}function f(i){return i&&i.is("element","softBreak")}class re extends S{static get pluginName(){return"CodeBlockUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.t,o=t.ui.componentFactory,a=b(t),s=this._getLanguageListItemDefinitions(a),n=t.commands.get("codeBlock");o.add("codeBlock",c=>{const r=$(c,K),l=r.buttonView,d=e("Insert code block");return l.set({label:d,tooltip:!0,icon:A,isToggleable:!0}),l.bind("isOn").to(n,"value",u=>!!u),l.on("execute",()=>{t.execute("codeBlock",{usePreviousLanguageChoice:!0}),t.editing.view.focus()}),r.on("execute",u=>{t.execute("codeBlock",{language:u.source._codeBlockLanguage,forceValue:!0}),t.editing.view.focus()}),r.class="ck-code-block-dropdown",r.bind("isEnabled").to(n),z(r,s,{role:"menu",ariaLabel:d}),r}),o.add("menuBar:codeBlock",c=>{const r=new W(c);r.buttonView.set({role:"menuitem",label:e("Code block"),icon:A}),r.bind("isEnabled").to(n);const l=new j(c);l.set({ariaLabel:e("Insert code block")});for(const d of s){const u=new U(c,r),g=new H(c);g.bind(...Object.keys(d.model)).to(d.model),g.set({isToggleable:!0,role:"menuitemcheckbox"}),g.delegate("execute").to(r),g.on("execute",()=>{t.execute("codeBlock",{language:d.model._codeBlockLanguage,forceValue:n.value!=d.model._codeBlockLanguage}),t.editing.view.focus()}),u.children.add(g),l.items.add(u)}return r.panelView.children.add(l),r})}_getLanguageListItemDefinitions(t){const o=this.editor.commands.get("codeBlock"),a=new F;for(const s of t){const n={type:"button",model:new J({_codeBlockLanguage:s.language,label:s.label,role:"menuitemradio",withText:!0})};n.model.bind("isOn").to(o,"value",c=>c===n.model._codeBlockLanguage),a.add(n)}return a}}class be extends S{static get requires(){return[ie,re]}static get pluginName(){return"CodeBlock"}static get isOfficialPlugin(){return!0}}export{be as CodeBlock,ie as CodeBlockEditing,re as CodeBlockUI};
4
+ */function h(i){const e=i.t,n=i.config.get("codeBlock.languages");for(const o of n)o.label==="Plain text"&&(o.label=e("Plain text")),o.class===void 0&&(o.class=`language-${o.language}`);return n}function k(i,e,n){const o={};for(const c of i)if(e==="class"){const s=c[e].split(" ").shift();o[s]=c[n]}else o[c[e]]=c[n];return o}function x(i){return i.data.match(/^(\s*)/)[0]}function H(i,e){const n=i.createDocumentFragment(),o=e.split(`
5
+ `),c=o.reduce((s,t,r)=>(s.push(t),r<o.length-1&&s.push(i.createElement("br")),s),[]);return i.appendChild(c,n),n}function v(i){const e=i.document.selection,n=[];if(e.isCollapsed)return[e.anchor];const o=e.getFirstRange().getWalker({ignoreElementEnd:!0,direction:"backward"});for(const{item:c}of o){let s=c.is("$textProxy")?c.textNode:c;const t=s.parent;if(!t.is("element","codeBlock")||s.is("element","softBreak"))continue;for(;s.previousSibling&&!s.previousSibling.is("element","softBreak");)s=s.previousSibling;const r=s.is("$text")?s.startOffset+x(s).length:s.startOffset,a=i.createPositionAt(t,r);n.every(l=>!l.isEqual(a))&&n.push(a)}return n}function _(i){const e=B(i.getSelectedBlocks());return!!e&&e.is("element","codeBlock")}function A(i,e){return e.is("rootElement")||i.isLimit(e)?!1:i.checkChild(e.parent,"codeBlock")}function P(i,e,n,o){const c=k(e,"language","label"),s=n.getAttribute("language");if(s in c){const t=c[s];return i(o==="enter"?"Entering %0 code snippet":"Leaving %0 code snippet",t)}return i(o==="enter"?"Entering code snippet":"Leaving code snippet")}function D(i,e){for(i.textNode&&(i=e.createPositionBefore(i.textNode));i.nodeBefore&&!i.nodeBefore.is("element","softBreak");)i=e.createPositionBefore(i.nodeBefore);const n=i.nodeAfter;return n&&n.is("$text")?n:null}class J extends S{_lastLanguage;constructor(e){super(e),this._lastLanguage=null}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const n=this.editor,o=n.model,c=o.document.selection,t=h(n)[0],r=Array.from(c.getSelectedBlocks()),a=e.forceValue==null?!this.value:e.forceValue,l=K(e,this._lastLanguage,t.language);o.change(u=>{a?this._applyCodeBlock(u,r,l):this._removeCodeBlock(u,r)})}_getValue(){const e=this.editor.model.document.selection,n=B(e.getSelectedBlocks());return!!n?.is("element","codeBlock")?n.getAttribute("language"):!1}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,n=this.editor.model.schema,o=B(e.getSelectedBlocks());return o?A(n,o):!1}_applyCodeBlock(e,n,o){this._lastLanguage=o;const c=this.editor.model.schema,s=n.filter(t=>A(c,t));for(const t of s)e.rename(t,"codeBlock"),e.setAttribute("language",o,t),c.removeDisallowedAttributes([t],e),Array.from(t.getChildren()).filter(r=>!c.checkChild(t,r)).forEach(r=>e.remove(r));s.reverse().forEach((t,r)=>{const a=s[r+1];t.previousSibling===a&&(e.appendElement("softBreak",a),e.merge(e.createPositionBefore(t)))})}_removeCodeBlock(e,n){const o=n.filter(c=>c.is("element","codeBlock"));for(const c of o){const s=e.createRangeOn(c);for(const t of Array.from(s.getItems()).reverse())if(t.is("element","softBreak")&&t.parent.is("element","codeBlock")){const{position:r}=e.split(e.createPositionBefore(t)),a=r.nodeAfter;e.rename(a,"paragraph"),e.removeAttribute("language",a),e.remove(t)}e.rename(c,"paragraph"),e.removeAttribute("language",c)}}}function K(i,e,n){return i.language?i.language:i.usePreviousLanguageChoice&&e?e:n}class G extends S{_indentSequence;constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const n=this.editor.model;n.change(o=>{const c=v(n);for(const s of c){const t=o.createText(this._indentSequence);n.insertContent(t,s)}})}_checkEnabled(){return this._indentSequence?_(this.editor.model.document.selection):!1}}class X extends S{_indentSequence;constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const n=this.editor.model;n.change(()=>{const o=v(n);for(const c of o){const s=E(n,c,this._indentSequence);s&&n.deleteContent(n.createSelection(s))}})}_checkEnabled(){if(!this._indentSequence)return!1;const e=this.editor.model;return _(e.document.selection)?v(e).some(n=>E(e,n,this._indentSequence)):!1}}function E(i,e,n){const o=D(e,i);if(!o)return null;const c=x(o),s=c.lastIndexOf(n);if(s+n.length!==c.length||s===-1)return null;const{parent:t,startOffset:r}=o;return i.createRange(i.createPositionAt(t,r+s),i.createPositionAt(t,r+s+n.length))}function T(i,e,n=!1){const o=k(e,"language","class"),c=k(e,"language","label");return(s,t,r)=>{const{writer:a,mapper:l,consumable:u}=r;if(!u.consume(t.item,"insert"))return;const d=t.item.getAttribute("language"),g=l.toViewPosition(i.createPositionBefore(t.item)),m={};n&&(m["data-language"]=c[d],m.spellcheck="false");const p=o[d]?{class:o[d]}:void 0,L=a.createContainerElement("code",p),V=a.createContainerElement("pre",m,L);a.insert(g,V),l.bindElements(t.item,L)}}function Q(i){return(e,n,o)=>{if(n.item.parent.name!=="codeBlock")return;const{writer:c,mapper:s,consumable:t}=o;if(!t.consume(n.item,"insert"))return;const r=s.toViewPosition(i.createPositionBefore(n.item));c.insert(r,c.createText(`
6
+ `))}}function Y(i,e){const n=k(e,"class","language"),o=e[0].language;return(c,s,t)=>{const r=s.viewItem,a=r.parent;if(!a||!a.is("element","pre")||s.modelCursor.findAncestor("codeBlock"))return;const{consumable:l,writer:u}=t;if(!l.test(r,{name:!0}))return;const d=u.createElement("codeBlock"),g=[...r.getClassNames()];g.length||g.push("");for(const m of g){const p=n[m];if(p){u.setAttribute("language",p,d);break}}d.hasAttribute("language")||u.setAttribute("language",o,d),t.convertChildren(r,d),t.safeInsert(d,s.modelCursor)&&(l.consume(r,{name:!0}),t.updateConversionResult(d,s))}}function Z(){return(i,e,{consumable:n,writer:o})=>{let c=e.modelCursor;if(!n.test(e.viewItem)||!c.findAncestor("codeBlock"))return;n.consume(e.viewItem);const t=e.viewItem.data.split(`
7
+ `).map(a=>o.createText(a)),r=t[t.length-1];for(const a of t)if(o.insert(a,c),c=c.getShiftedBy(a.offsetSize),a!==r){const l=o.createElement("softBreak");o.insert(l,c),c=o.createPositionAfter(l)}e.modelRange=o.createRange(e.modelCursor,c),e.modelCursor=c}}function ee(){return(i,e,{consumable:n})=>{const o=e.viewItem;if(o.findAncestor("pre"))return;const c=Array.from(o.getChildren()),s=c.find(t=>t.is("element","code"));if(s)for(const t of c)t===s||!t.is("$text")||n.consume(t,{name:!0})}}const I="paragraph";class te extends C{static get pluginName(){return"CodeBlockEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[y]}constructor(e){super(e),e.config.define("codeBlock",{languages:[{language:"plaintext",label:"Plain text"},{language:"c",label:"C"},{language:"cs",label:"C#"},{language:"cpp",label:"C++"},{language:"css",label:"CSS"},{language:"diff",label:"Diff"},{language:"go",label:"Go"},{language:"html",label:"HTML"},{language:"java",label:"Java"},{language:"javascript",label:"JavaScript"},{language:"php",label:"PHP"},{language:"python",label:"Python"},{language:"ruby",label:"Ruby"},{language:"typescript",label:"TypeScript"},{language:"xml",label:"XML"}],indentSequence:" "})}init(){const e=this.editor,n=e.model.schema,o=e.model,c=e.editing.view,s=h(e);e.commands.add("codeBlock",new J(e)),e.commands.add("indentCodeBlock",new G(e)),e.commands.add("outdentCodeBlock",new X(e)),this.listenTo(c.document,"tab",(t,r)=>{const a=r.shiftKey?"outdentCodeBlock":"indentCodeBlock";e.commands.get(a).isEnabled&&(e.execute(a),r.stopPropagation(),r.preventDefault(),t.stop())},{context:"pre"}),n.register("codeBlock",{allowWhere:"$block",allowChildren:"$text",disallowChildren:"$inlineObject",allowAttributes:["language"],allowAttributesOf:"$listItem",isBlock:!0}),n.addAttributeCheck((t,r)=>{const a=t.getItem(t.length-2);if(n.getAttributeProperties(r).isFormatting&&a&&a.name=="codeBlock")return!1}),e.editing.downcastDispatcher.on("insert:codeBlock",T(o,s,!0)),e.data.downcastDispatcher.on("insert:codeBlock",T(o,s)),e.data.downcastDispatcher.on("insert:softBreak",Q(o),{priority:"high"}),e.data.upcastDispatcher.on("element:code",Y(c,s)),e.data.upcastDispatcher.on("text",Z()),e.data.upcastDispatcher.on("element:pre",ee(),{priority:"high"}),this.listenTo(e.editing.view.document,"clipboardInput",(t,r)=>{let a=o.createRange(o.document.selection.anchor);if(r.targetRanges&&(a=e.editing.mapper.toModelRange(r.targetRanges[0])),!a.start.parent.is("element","codeBlock"))return;const l=r.dataTransfer.getData("text/plain"),u=new O(e.editing.view.document);r.content=H(u,l)}),e.plugins.has("ClipboardPipeline")&&e.plugins.get(R).on("contentInsertion",(t,r)=>{const a=e.model,l=a.document.selection;l.anchor.parent.is("element","codeBlock")&&a.change(u=>{const d=u.createRangeIn(r.content);for(const g of[...d.getItems()])g.is("node")&&!n.checkChild(l.anchor,g)&&u.remove(g)})}),this.listenTo(o,"getSelectedContent",(t,[r])=>{const a=r.anchor;r.isCollapsed||!a.parent.is("element","codeBlock")||!a.hasSameParentAs(r.focus)||o.change(l=>{const u=t.return;if(a.parent.is("element")&&(u.childCount>1||r.containsEntireContent(a.parent))){const g=l.createElement("codeBlock",a.parent.getAttributes());l.append(u,g);const m=l.createDocumentFragment();l.append(g,m),t.return=m;return}const d=u.getChild(0);n.checkAttribute(d,"code")&&l.setAttribute("code",!0,d)})})}afterInit(){const e=this.editor,n=e.commands,o=n.get("indent"),c=n.get("outdent");o&&o.registerChildCommand(n.get("indentCodeBlock"),{priority:"highest"}),c&&c.registerChildCommand(n.get("outdentCodeBlock")),this.listenTo(e.editing.view.document,"enter",(s,t)=>{e.model.document.selection.getLastPosition().parent.is("element","codeBlock")&&(!oe(e,t.isSoft)&&!ie(e,t.isSoft)&&ne(e),t.preventDefault(),s.stop())},{context:"pre"}),this._initAriaAnnouncements()}_initAriaAnnouncements(){const{model:e,ui:n,t:o}=this.editor,c=h(this.editor);let s=null;e.document.selection.on("change:range",()=>{const t=e.document.selection.focus.parent;!n||s===t||!t.is("element")||(s&&s.is("element","codeBlock")&&n.ariaLiveAnnouncer.announce(P(o,c,s,"leave")),t.is("element","codeBlock")&&n.ariaLiveAnnouncer.announce(P(o,c,t,"enter")),s=t)})}}function ne(i){const e=i.model,n=e.document,o=n.selection.getLastPosition();let c;const s=D(o,e);s&&s.is("$text")&&(c=x(s)),i.model.change(t=>{i.execute("shiftEnter"),c&&t.insertText(c,n.selection.anchor)})}function oe(i,e){const o=i.model.document,c=i.editing.view,s=o.selection.getLastPosition(),t=s.nodeAfter;return e||!o.selection.isCollapsed||!s.isAtStart||!f(t)?!1:(i.model.change(r=>{i.execute("enter");const a=o.selection.anchor.parent.previousSibling;r.rename(a,I),r.setSelection(a,"in"),i.model.schema.removeDisallowedAttributes([a],r),r.remove(t)}),c.scrollToTheSelection(),!0)}function ie(i,e){const n=i.model,o=n.document,c=i.editing.view,s=o.selection.getLastPosition(),t=s.nodeBefore;let r;if(e||!o.selection.isCollapsed||!s.isAtEnd||!t||!t.previousSibling)return!1;if(f(t)&&f(t.previousSibling))r=n.createRange(n.createPositionBefore(t.previousSibling),n.createPositionAfter(t));else if(b(t)&&f(t.previousSibling)&&f(t.previousSibling.previousSibling))r=n.createRange(n.createPositionBefore(t.previousSibling.previousSibling),n.createPositionAfter(t));else if(b(t)&&f(t.previousSibling)&&b(t.previousSibling.previousSibling)&&t.previousSibling.previousSibling&&f(t.previousSibling.previousSibling.previousSibling))r=n.createRange(n.createPositionBefore(t.previousSibling.previousSibling.previousSibling),n.createPositionAfter(t));else return!1;return i.model.change(a=>{a.remove(r),i.execute("enter");const l=o.selection.anchor.parent;a.rename(l,I),i.model.schema.removeDisallowedAttributes([l],a)}),c.scrollToTheSelection(),!0}function b(i){return i&&i.is("$text")&&!i.data.match(/\S/)}function f(i){return i&&i.is("element","softBreak")}class se extends C{static get pluginName(){return"CodeBlockUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.t,o=e.ui.componentFactory,c=h(e),s=this._getLanguageListItemDefinitions(c),t=e.commands.get("codeBlock");o.add("codeBlock",r=>{const a=N(r,U),l=a.buttonView,u=n("Insert code block");return l.set({label:u,tooltip:!0,icon:w,isToggleable:!0}),l.bind("isOn").to(t,"value",d=>!!d),l.on("execute",()=>{e.execute("codeBlock",{usePreviousLanguageChoice:!0}),e.editing.view.focus()}),a.on("execute",d=>{e.execute("codeBlock",{language:d.source._codeBlockLanguage,forceValue:!0}),e.editing.view.focus()}),a.class="ck-code-block-dropdown",a.bind("isEnabled").to(t),q(a,s,{role:"menu",ariaLabel:u}),a}),o.add("menuBar:codeBlock",r=>{const a=new F(r);a.buttonView.set({role:"menuitem",label:n("Code block"),icon:w}),a.bind("isEnabled").to(t);const l=new $(r);l.set({ariaLabel:n("Insert code block")});for(const u of s){const d=new z(r,a),g=new W(r);g.bind(...Object.keys(u.model)).to(u.model),g.set({isToggleable:!0,role:"menuitemcheckbox"}),g.delegate("execute").to(a),g.on("execute",()=>{e.execute("codeBlock",{language:u.model._codeBlockLanguage,forceValue:t.value!=u.model._codeBlockLanguage}),e.editing.view.focus()}),d.children.add(g),l.items.add(d)}return a.panelView.children.add(l),a})}_getLanguageListItemDefinitions(e){const o=this.editor.commands.get("codeBlock"),c=new M;for(const s of e){const t={type:"button",model:new j({_codeBlockLanguage:s.language,label:s.label,role:"menuitemradio",withText:!0})};t.model.bind("isOn").to(o,"value",r=>r===t.model._codeBlockLanguage),c.add(t)}return c}}class me extends C{static get requires(){return[te,se]}static get pluginName(){return"CodeBlock"}static get isOfficialPlugin(){return!0}}export{me as CodeBlock,te as CodeBlockEditing,se as CodeBlockUI};
@@ -1,4 +1,4 @@
1
- var Q=Object.defineProperty;var X=(n,i,e)=>i in n?Q(n,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[i]=e;var c=(n,i,e)=>X(n,typeof i!="symbol"?i+"":i,e);import{ObservableMixin as v,Collection as $,CKEditorError as u,insertToPriorityArray as Z,setDataInElement as G,Config as V,parseBase64EncodedObject as ee,toArray as te,crc32 as ie,releaseDate as ne,uid as U,logError as se,Locale as oe,EmitterMixin as re,KeystrokeHandler as ae,global as K,env as E}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{Model as le,DataController as ce,StylesProcessor as ue,EditingController as de,Conversion as he}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{EditorWatchdog as fe,ContextWatchdog as ge}from"../../../../../@ckeditor_ckeditor5-watchdog@45.2.1/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js";import{isFunction as z}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/predicate/isFunction.js";import{get as me}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/get.js";import{set as ye}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/set.js";/**
1
+ import{ObservableMixin as P,Collection as W,CKEditorError as l,insertToPriorityArray as V,setDataInElement as q,Config as j,parseBase64EncodedObject as Y,toArray as J,crc32 as Q,releaseDate as X,uid as A,logError as Z,Locale as ee,EmitterMixin as te,KeystrokeHandler as ie,global as T,env as _}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{Model as ne,DataController as se,StylesProcessor as oe,EditingController as re,Conversion as ae}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{EditorWatchdog as le,ContextWatchdog as ce}from"../../../../../@ckeditor_ckeditor5-watchdog@45.2.1/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js";import{isFunction as M}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/predicate/isFunction.js";import{get as ue}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/get.js";import{set as de}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/set.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 Me extends v(){constructor(e){super();c(this,"editor");c(this,"_disableStack",new Set);this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",B,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",B),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}function B(n){n.return=!1,n.stop()}class pe extends v(){constructor(e){super();c(this,"editor");c(this,"_isEnabledBasedOnSelection");c(this,"_affectsData");c(this,"_disableStack");this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.listenTo(e,"change:isReadOnly",()=>{this.refresh()}),this.on("set:isEnabled",t=>{if(!this.affectsData)return;const o=e.model.document.selection,h=!(o.getFirstPosition().root.rootName=="$graveyard")&&e.model.canEditAt(o);(e.isReadOnly||this._isEnabledBasedOnSelection&&!h)&&(t.return=!1,t.stop())},{priority:"highest"}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",W,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",W),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function W(n){n.return=!1,n.stop()}class Ue extends pe{constructor(){super(...arguments);c(this,"_childCommandsDefinitions",[])}refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return!!t&&t.execute(e)}registerChildCommand(e,t={}){Z(this._childCommandsDefinitions,{command:e,priority:t.priority||"normal"}),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const e=this._childCommandsDefinitions.find(({command:t})=>t.isEnabled);return e&&e.command}}class Y extends re(){constructor(e,t=[],o=[]){super();c(this,"_context");c(this,"_plugins",new Map);c(this,"_availablePlugins");c(this,"_contextPlugins");this._context=e,this._availablePlugins=new Map;for(const a of t)a.pluginName&&this._availablePlugins.set(a.pluginName,a);this._contextPlugins=new Map;for(const[a,h]of o)this._contextPlugins.set(a,h),this._contextPlugins.set(h,a),a.pluginName&&this._availablePlugins.set(a.pluginName,a)}*[Symbol.iterator](){for(const e of this._plugins)typeof e[0]=="function"&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let o=e;throw typeof e=="function"&&(o=e.pluginName||e.name),new u("plugincollection-plugin-not-loaded",this._context,{plugin:o})}return t}has(e){return this._plugins.has(e)}init(e,t=[],o=[]){const a=this,h=this._context;b(e),p(e);const y=e.filter(s=>!C(s,t)),S=[...P(y)];I(S,o);const k=A(S);return D(k,"init").then(()=>D(k,"afterInit")).then(()=>k);function _(s){return typeof s=="function"}function O(s){return _(s)&&!!s.isContextPlugin}function C(s,d){return d.some(r=>r===s||m(s)===r||m(r)===s)}function m(s){return _(s)?s.pluginName||s.name:s}function b(s,d=new Set){s.forEach(r=>{_(r)&&(d.has(r)||(d.add(r),r.pluginName&&!a._availablePlugins.has(r.pluginName)&&a._availablePlugins.set(r.pluginName,r),r.requires&&b(r.requires,d)))})}function P(s,d=new Set){return s.map(r=>_(r)?r:a._availablePlugins.get(r)).reduce((r,l)=>d.has(l)?r:(d.add(l),l.requires&&(p(l.requires,l),P(l.requires,d).forEach(f=>r.add(f))),r.add(l)),new Set)}function p(s,d=null){s.map(r=>_(r)?r:a._availablePlugins.get(r)||r).forEach(r=>{T(r,d),N(r,d),R(r,d)})}function T(s,d){if(!_(s))throw d?new u("plugincollection-soft-required",h,{missingPlugin:s,requiredBy:m(d)}):new u("plugincollection-plugin-not-found",h,{plugin:s})}function N(s,d){if(O(d)&&!O(s))throw new u("plugincollection-context-required",h,{plugin:m(s),requiredBy:m(d)})}function R(s,d){if(d&&C(s,t))throw new u("plugincollection-required",h,{plugin:m(s),requiredBy:m(d)})}function A(s){return s.map(d=>{let r=a._contextPlugins.get(d);return r=r||new d(h),a._add(d,r),r})}function D(s,d){return s.reduce((r,l)=>!l[d]||a._contextPlugins.has(l)?r:r.then(l[d].bind(l)),Promise.resolve())}function I(s,d){for(const r of d){if(typeof r!="function")throw new u("plugincollection-replace-plugin-invalid-type",null,{pluginItem:r});const l=r.pluginName;if(!l)throw new u("plugincollection-replace-plugin-missing-name",null,{pluginItem:r});if(r.requires&&r.requires.length)throw new u("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:l});const f=a._availablePlugins.get(l);if(!f)throw new u("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:l});const w=s.indexOf(f);if(w===-1){if(a._contextPlugins.has(f))return;throw new u("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:l})}if(f.requires&&f.requires.length)throw new u("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:l});s.splice(w,1,r),a._availablePlugins.set(l,r)}}}destroy(){const e=[];for(const[,t]of this)typeof t.destroy=="function"&&!this._contextPlugins.has(t)&&e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const o=e.pluginName;if(o){if(this._plugins.has(o))throw new u("plugincollection-plugin-name-conflict",null,{pluginName:o,plugin1:this._plugins.get(o).constructor,plugin2:e});this._plugins.set(o,t)}}}class L{constructor(i){c(this,"config");c(this,"plugins");c(this,"locale");c(this,"t");c(this,"editors");c(this,"_contextOwner",null);const{translations:e,...t}=i||{};this.config=new V(t,this.constructor.defaultConfig);const o=this.constructor.builtinPlugins;this.config.define("plugins",o),this.plugins=new Y(this,o);const a=this.config.get("language")||{};this.locale=new oe({uiLanguage:typeof a=="string"?a:a.ui,contentLanguage:this.config.get("language.content"),translations:e}),this.t=this.locale.t,this.editors=new $}initPlugins(){const i=this.config.get("plugins")||[],e=this.config.get("substitutePlugins")||[];for(const t of i.concat(e)){if(typeof t!="function")throw new u("context-initplugins-constructor-only",null,{Plugin:t});if(t.isContextPlugin!==!0)throw new u("context-initplugins-invalid-plugin",null,{Plugin:t})}return this.plugins.init(i,[],e)}destroy(){return Promise.all(Array.from(this.editors,i=>i.destroy())).then(()=>this.plugins.destroy())}_addEditor(i,e){if(this._contextOwner)throw new u("context-addeditor-private-context");this.editors.add(i),e&&(this._contextOwner=i)}_removeEditor(i){return this.editors.has(i)&&this.editors.remove(i),this._contextOwner===i?this.destroy():Promise.resolve()}_getEditorConfig(){const i={};for(const e of this.config.names())["plugins","removePlugins","extraPlugins"].includes(e)||(i[e]=this.config.get(e));return i}static create(i){return new Promise(e=>{const t=new this(i);e(t.initPlugins().then(()=>t))})}}c(L,"defaultConfig"),c(L,"builtinPlugins");class we extends v(){constructor(e){super();c(this,"context");this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}class be{constructor(){c(this,"_commands");this._commands=new Map}add(i,e){this._commands.set(i,e)}get(i){return this._commands.get(i)}execute(i,...e){const t=this.get(i);if(!t)throw new u("commandcollection-command-not-found",this,{commandName:i});return t.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const i of this.commands())i.destroy()}}class _e extends ae{constructor(e){super();c(this,"editor");this.editor=e}set(e,t,o={}){if(typeof t=="string"){const a=t;t=(h,y)=>{this.editor.execute(a),y()}}super.set(e,t,o)}}const q="contentEditing",j="common";class Ee{constructor(i){c(this,"keystrokeInfos",new Map);c(this,"_editor");this._editor=i;const e=i.config.get("menuBar.isVisible"),t=i.locale.t;this.addKeystrokeInfoCategory({id:q,label:t("Content editing keystrokes"),description:t("These keyboard shortcuts allow for quick access to content editing features.")});const o=[{label:t("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:t("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:t("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:t("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:t("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:t("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];e&&o.push({label:t("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:t("User interface and content navigation keystrokes"),description:t("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:o}]})}addKeystrokeInfoCategory({id:i,label:e,description:t,groups:o}){this.keystrokeInfos.set(i,{id:i,label:e,description:t,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:i,id:j}),o&&o.forEach(a=>{this.addKeystrokeInfoGroup({categoryId:i,...a})})}addKeystrokeInfoGroup({categoryId:i=q,id:e,label:t,keystrokes:o}){const a=this.keystrokeInfos.get(i);if(!a)throw new u("accessibility-unknown-keystroke-info-category",this._editor,{groupId:e,categoryId:i});a.groups.set(e,{id:e,label:t,keystrokes:o||[]})}addKeystrokeInfos({categoryId:i=q,groupId:e=j,keystrokes:t}){if(!this.keystrokeInfos.has(i))throw new u("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:i,keystrokes:t});const o=this.keystrokeInfos.get(i);if(!o.groups.has(e))throw new u("accessibility-unknown-keystroke-info-group",this._editor,{groupId:e,categoryId:i,keystrokes:t});o.groups.get(e).keystrokes.push(...t)}}function ke(n){return{sessionId:Oe(),pageSessionId:Ce(),hostname:window.location.hostname,version:globalThis.CKEDITOR_VERSION,type:Pe(n),plugins:xe(n.plugins),distribution:ve(),env:Se(),integration:Object.create(null),menuBar:{isVisible:!!n.config.get("menuBar.isVisible")},language:{ui:n.locale.uiLanguage,content:n.locale.contentLanguage},toolbar:{main:M(n.config.get("toolbar")),block:M(n.config.get("blockToolbar")),balloon:M(n.config.get("balloonToolbar"))}}}function Pe(n){return Object.getPrototypeOf(n).constructor.editorName}function xe(n){return Array.from(n).filter(([i])=>!!i.pluginName).map(([i])=>{const{pluginName:e,isContextPlugin:t,isOfficialPlugin:o,isPremiumPlugin:a}=i;return{isContext:!!t,isOfficial:!!o,isPremium:!!a,name:e}})}function M(n){if(!n)return;const i=Array.isArray(n)?{items:n}:n,e=a(i.items||[]);return{isMultiline:e.includes("-"),shouldNotGroupWhenFull:!!i.shouldNotGroupWhenFull,items:o(e)};function o(h){return h.filter(y=>y!=="|"&&y!=="-")}function a(h){return h.flatMap(y=>typeof y=="string"?[y]:a(y.items))}}function ve(){return{channel:window[Symbol.for("cke distribution")]||"sh"}}function Se(){let n="unknown",i="unknown";return E.isMac?n="mac":E.isWindows?n="windows":E.isiOS?n="ios":E.isAndroid&&(n="android"),E.isGecko?i="gecko":E.isBlink?i="blink":E.isSafari&&(i="safari"),{os:n,browser:i}}function Oe(){return localStorage.getItem("__ckeditor-session-id")||localStorage.setItem("__ckeditor-session-id",U()),localStorage.getItem("__ckeditor-session-id")}function Ce(){return K.window.CKEDITOR_PAGE_SESSION_ID=K.window.CKEDITOR_PAGE_SESSION_ID||U(),K.window.CKEDITOR_PAGE_SESSION_ID}class x extends v(){constructor(e={}){super();c(this,"accessibility");c(this,"commands");c(this,"config");c(this,"conversion");c(this,"data");c(this,"editing");c(this,"locale");c(this,"model");c(this,"plugins");c(this,"keystrokes");c(this,"t");c(this,"_context");c(this,"_readOnlyLocks");if("sanitizeHtml"in e)throw new u("editor-config-sanitizehtml-not-supported");const t=this.constructor,{translations:o,...a}=t.defaultConfig||{},{translations:h=o,...y}=e,S=e.language||a.language;this._context=e.context||new L({language:S,translations:h}),this._context._addEditor(this,!e.context);const k=Array.from(t.builtinPlugins||[]);this.config=new V(y,a),this.config.define("plugins",k),this.config.define(this._context._getEditorConfig()),O(this.config),this.plugins=new Y(this,k,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new be,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.model=new le,this.on("change:isReadOnly",()=>{this.model.document.isReadOnly=this.isReadOnly});const _=new ue;this.data=new ce(this.model,_),this.editing=new de(this.model,_),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new he([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new _e(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new Ee(this),C(this);function O(m){let b=m.get("licenseKey");if(!b&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(b=window.CKEDITOR_GLOBAL_LICENSE_KEY,m.set("licenseKey",b)),!b)throw new u("license-key-missing")}function C(m){const b=m.config.get("licenseKey"),P=window[Symbol.for("cke distribution")]||"sh";function p(l){m.enableReadOnlyMode(Symbol("invalidLicense")),m._showLicenseError(l)}function T(l){const f=l.split(".");return f.length!=3?null:f[1]}function N(l){return["exp","jti","vc"].every(w=>w in l)}function R(l){return Object.getOwnPropertyNames(l).sort().filter(g=>g!="vc"&&l[g]!=null).map(g=>l[g])}function A(l){const{hostname:f}=new URL(window.location.href);if(l.includes(f))return!0;const w=f.split(".");return l.filter(g=>g.includes("*")).map(g=>g.split(".")).filter(g=>g.length<=w.length).map(g=>Array(w.length-g.length).fill(g[0]==="*"?"*":"").concat(g)).some(g=>w.every((J,F)=>g[F]===J||g[F]==="*"))}function D(l){const f=l[0].toUpperCase()+l.slice(1),w=l==="evaluation"?"an":"a";console.info(`%cCKEditor 5 ${f} License`,"color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;"),console.warn(`⚠️ You are using ${w} ${l} license of CKEditor 5${l==="trial"?" which is for evaluation purposes only":""}. For production usage, please obtain a production license at https://portal.ckeditor.com/`)}if(b=="GPL"){P=="cloud"&&p("distributionChannel");return}const I=T(b);if(!I){p("invalid");return}const s=ee(I);if(!s){p("invalid");return}if(!N(s)){p("invalid");return}if(s.distributionChannel&&!te(s.distributionChannel).includes(P)){p("distributionChannel");return}if(ie(R(s))!=s.vc.toLowerCase()){p("invalid");return}if(new Date(s.exp*1e3)<ne){p("expired");return}const r=s.licensedHosts;if(r&&r.length>0&&!A(r)){p("domainLimit");return}if(["evaluation","trial"].includes(s.licenseType)&&s.exp*1e3<Date.now()){p("expired");return}if(["development","evaluation","trial"].includes(s.licenseType)){const{licenseType:l}=s;window.CKEDITOR_WARNING_SUPPRESSIONS=window.CKEDITOR_WARNING_SUPPRESSIONS||{},window.CKEDITOR_WARNING_SUPPRESSIONS[l]||(D(l),window.CKEDITOR_WARNING_SUPPRESSIONS[l]=!0)}if(["evaluation","trial"].includes(s.licenseType)){const l=s.licenseType,f=setTimeout(()=>{p(`${l}Limit`)},6e5);m.on("destroy",()=>{clearTimeout(f)})}s.usageEndpoint&&m.once("ready",()=>{const l={requestId:U(),requestTime:Math.round(Date.now()/1e3),license:b,editor:De(m)};m._sendUsageRequest(s.usageEndpoint,l).then(f=>{const{status:w,message:g}=f;g&&console.warn(g),w!="ok"&&p("usageLimit")},()=>{se("license-key-validation-endpoint-not-reachable",{url:s.usageEndpoint})})},{priority:"high"})}}static get editorName(){return"Editor"}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new u("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new u("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),this._readOnlyLocks.size===1&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new u("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),this._readOnlyLocks.size===0&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}initPlugins(){const e=this.config,t=e.get("plugins"),o=e.get("removePlugins")||[],a=e.get("extraPlugins")||[],h=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(a),o,h)}destroy(){let e=Promise.resolve();return this.state=="initializing"&&(e=new Promise(t=>this.once("ready",t))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(e,...t){try{return this.commands.execute(e,...t)}catch(o){/* istanbul ignore next -- @preserve */u.rethrowUnexpectedError(o,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}_showLicenseError(e,t){setTimeout(()=>{if(e=="invalid")throw new u("invalid-license-key");if(e=="expired")throw new u("license-key-expired");if(e=="domainLimit")throw new u("license-key-domain-limit");if(e=="featureNotAllowed")throw new u("license-key-plugin-not-allowed",null,{pluginName:t});if(e=="evaluationLimit")throw new u("license-key-evaluation-limit");if(e=="trialLimit")throw new u("license-key-trial-limit");if(e=="developmentLimit")throw new u("license-key-development-limit");if(e=="usageLimit")throw new u("license-key-usage-limit");if(e=="distributionChannel")throw new u("license-key-invalid-distribution-channel")},0),this._showLicenseError=()=>{}}async _sendUsageRequest(e,t){const o=new Headers({"Content-Type":"application/json"}),a=await fetch(new URL(e),{method:"POST",headers:o,body:JSON.stringify(t)});if(!a.ok)throw new Error(`HTTP Response: ${a.status}`);return a.json()}}c(x,"defaultConfig"),c(x,"builtinPlugins"),c(x,"Context",L),c(x,"EditorWatchdog",fe),c(x,"ContextWatchdog",ge);function De(n){const i=ke(n);function e(t,o){if(me(i,t)!==void 0)throw new u("editor-usage-data-path-already-set",{path:t});ye(i,t,o)}return n.fire("collectUsageData",{setUsageData:e}),i}function Fe(n){if(!z(n.updateSourceElement))throw new u("attachtoform-missing-elementapi-interface",n);const i=n.sourceElement;if(Ie(i)&&i.form){let e;const t=i.form,o=()=>n.updateSourceElement();z(t.submit)&&(e=t.submit,t.submit=()=>{o(),e.apply(t)}),t.addEventListener("submit",o),n.on("destroy",()=>{t.removeEventListener("submit",o),e&&(t.submit=e)})}}function Ie(n){return!!n&&n.tagName.toLowerCase()==="textarea"}function H(n){class i extends n{constructor(){super(...arguments);c(this,"sourceElement")}updateSourceElement(o){if(!this.sourceElement)throw new u("editor-missing-sourceelement",this);const a=this.config.get("updateSourceElementOnDestroy"),h=this.sourceElement instanceof HTMLTextAreaElement;if(!a&&!h){G(this.sourceElement,"");return}const y=typeof o=="string"?o:this.data.get();G(this.sourceElement,y)}}return i}H.updateSourceElement=H(Object).prototype.updateSourceElement;class Ge extends we{constructor(){super(...arguments);c(this,"_actions")}static get pluginName(){return"PendingActions"}static get isOfficialPlugin(){return!0}init(){this.set("hasAny",!1),this._actions=new $({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!="string")throw new u("pendingactions-add-invalid-message",this);const t=new(v());return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}export{pe as Command,L as Context,we as ContextPlugin,x as Editor,H as ElementApiMixin,Ue as MultiCommand,Ge as PendingActions,Me as Plugin,Fe as attachToForm};
4
+ */class Te extends P(){editor;_disableStack=new Set;constructor(e){super(),this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",U,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",U),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}function U(o){o.return=!1,o.stop()}class he extends P(){editor;_isEnabledBasedOnSelection;_affectsData;_disableStack;constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.listenTo(e,"change:isReadOnly",()=>{this.refresh()}),this.on("set:isEnabled",t=>{if(!this.affectsData)return;const i=e.model.document.selection,u=!(i.getFirstPosition().root.rootName=="$graveyard")&&e.model.canEditAt(i);(e.isReadOnly||this._isEnabledBasedOnSelection&&!u)&&(t.return=!1,t.stop())},{priority:"highest"}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",F,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",F),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function F(o){o.return=!1,o.stop()}class Ne extends he{_childCommandsDefinitions=[];refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return!!t&&t.execute(e)}registerChildCommand(e,t={}){V(this._childCommandsDefinitions,{command:e,priority:t.priority||"normal"}),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const e=this._childCommandsDefinitions.find(({command:t})=>t.isEnabled);return e&&e.command}}class H extends te(){_context;_plugins=new Map;_availablePlugins;_contextPlugins;constructor(e,t=[],i=[]){super(),this._context=e,this._availablePlugins=new Map;for(const n of t)n.pluginName&&this._availablePlugins.set(n.pluginName,n);this._contextPlugins=new Map;for(const[n,u]of i)this._contextPlugins.set(n,u),this._contextPlugins.set(u,n),n.pluginName&&this._availablePlugins.set(n.pluginName,n)}*[Symbol.iterator](){for(const e of this._plugins)typeof e[0]=="function"&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let i=e;throw typeof e=="function"&&(i=e.pluginName||e.name),new l("plugincollection-plugin-not-loaded",this._context,{plugin:i})}return t}has(e){return this._plugins.has(e)}init(e,t=[],i=[]){const n=this,u=this._context;w(e),g(e);const y=e.filter(s=>!v(s,t)),p=[...k(y)];C(p,i);const E=L(p);return S(E,"init").then(()=>S(E,"afterInit")).then(()=>E);function b(s){return typeof s=="function"}function x(s){return b(s)&&!!s.isContextPlugin}function v(s,c){return c.some(r=>r===s||f(s)===r||f(r)===s)}function f(s){return b(s)?s.pluginName||s.name:s}function w(s,c=new Set){s.forEach(r=>{b(r)&&(c.has(r)||(c.add(r),r.pluginName&&!n._availablePlugins.has(r.pluginName)&&n._availablePlugins.set(r.pluginName,r),r.requires&&w(r.requires,c)))})}function k(s,c=new Set){return s.map(r=>b(r)?r:n._availablePlugins.get(r)).reduce((r,a)=>c.has(a)?r:(c.add(a),a.requires&&(g(a.requires,a),k(a.requires,c).forEach(d=>r.add(d))),r.add(a)),new Set)}function g(s,c=null){s.map(r=>b(r)?r:n._availablePlugins.get(r)||r).forEach(r=>{O(r,c),D(r,c),I(r,c)})}function O(s,c){if(!b(s))throw c?new l("plugincollection-soft-required",u,{missingPlugin:s,requiredBy:f(c)}):new l("plugincollection-plugin-not-found",u,{plugin:s})}function D(s,c){if(x(c)&&!x(s))throw new l("plugincollection-context-required",u,{plugin:f(s),requiredBy:f(c)})}function I(s,c){if(c&&v(s,t))throw new l("plugincollection-required",u,{plugin:f(s),requiredBy:f(c)})}function L(s){return s.map(c=>{let r=n._contextPlugins.get(c);return r=r||new c(u),n._add(c,r),r})}function S(s,c){return s.reduce((r,a)=>!a[c]||n._contextPlugins.has(a)?r:r.then(a[c].bind(a)),Promise.resolve())}function C(s,c){for(const r of c){if(typeof r!="function")throw new l("plugincollection-replace-plugin-invalid-type",null,{pluginItem:r});const a=r.pluginName;if(!a)throw new l("plugincollection-replace-plugin-missing-name",null,{pluginItem:r});if(r.requires&&r.requires.length)throw new l("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:a});const d=n._availablePlugins.get(a);if(!d)throw new l("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:a});const m=s.indexOf(d);if(m===-1){if(n._contextPlugins.has(d))return;throw new l("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:a})}if(d.requires&&d.requires.length)throw new l("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:a});s.splice(m,1,r),n._availablePlugins.set(a,r)}}}destroy(){const e=[];for(const[,t]of this)typeof t.destroy=="function"&&!this._contextPlugins.has(t)&&e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const i=e.pluginName;if(i){if(this._plugins.has(i))throw new l("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e});this._plugins.set(i,t)}}}class G{config;plugins;locale;t;editors;static defaultConfig;static builtinPlugins;_contextOwner=null;constructor(e){const{translations:t,...i}=e||{};this.config=new j(i,this.constructor.defaultConfig);const n=this.constructor.builtinPlugins;this.config.define("plugins",n),this.plugins=new H(this,n);const u=this.config.get("language")||{};this.locale=new ee({uiLanguage:typeof u=="string"?u:u.ui,contentLanguage:this.config.get("language.content"),translations:t}),this.t=this.locale.t,this.editors=new W}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const i of e.concat(t)){if(typeof i!="function")throw new l("context-initplugins-constructor-only",null,{Plugin:i});if(i.isContextPlugin!==!0)throw new l("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner)throw new l("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise(t=>{const i=new this(e);t(i.initPlugins().then(()=>i))})}}class fe extends P(){context;constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}class ge{_commands;constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const i=this.get(e);if(!i)throw new l("commandcollection-command-not-found",this,{commandName:e});return i.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class me extends ie{editor;constructor(e){super(),this.editor=e}set(e,t,i={}){if(typeof t=="string"){const n=t;t=(u,y)=>{this.editor.execute(n),y()}}super.set(e,t,i)}}const N="contentEditing",z="common";class ye{keystrokeInfos=new Map;_editor;constructor(e){this._editor=e;const t=e.config.get("menuBar.isVisible"),i=e.locale.t;this.addKeystrokeInfoCategory({id:N,label:i("Content editing keystrokes"),description:i("These keyboard shortcuts allow for quick access to content editing features.")});const n=[{label:i("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:i("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:i("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:i("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:i("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];t&&n.push({label:i("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:i("User interface and content navigation keystrokes"),description:i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:n}]})}addKeystrokeInfoCategory({id:e,label:t,description:i,groups:n}){this.keystrokeInfos.set(e,{id:e,label:t,description:i,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:e,id:z}),n&&n.forEach(u=>{this.addKeystrokeInfoGroup({categoryId:e,...u})})}addKeystrokeInfoGroup({categoryId:e=N,id:t,label:i,keystrokes:n}){const u=this.keystrokeInfos.get(e);if(!u)throw new l("accessibility-unknown-keystroke-info-category",this._editor,{groupId:t,categoryId:e});u.groups.set(t,{id:t,label:i,keystrokes:n||[]})}addKeystrokeInfos({categoryId:e=N,groupId:t=z,keystrokes:i}){if(!this.keystrokeInfos.has(e))throw new l("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:e,keystrokes:i});const n=this.keystrokeInfos.get(e);if(!n.groups.has(t))throw new l("accessibility-unknown-keystroke-info-group",this._editor,{groupId:t,categoryId:e,keystrokes:i});n.groups.get(t).keystrokes.push(...i)}}function pe(o){return{sessionId:ke(),pageSessionId:Pe(),hostname:window.location.hostname,version:globalThis.CKEDITOR_VERSION,type:we(o),plugins:be(o.plugins),distribution:_e(),env:Ee(),integration:Object.create(null),menuBar:{isVisible:!!o.config.get("menuBar.isVisible")},language:{ui:o.locale.uiLanguage,content:o.locale.contentLanguage},toolbar:{main:R(o.config.get("toolbar")),block:R(o.config.get("blockToolbar")),balloon:R(o.config.get("balloonToolbar"))}}}function we(o){return Object.getPrototypeOf(o).constructor.editorName}function be(o){return Array.from(o).filter(([e])=>!!e.pluginName).map(([e])=>{const{pluginName:t,isContextPlugin:i,isOfficialPlugin:n,isPremiumPlugin:u}=e;return{isContext:!!i,isOfficial:!!n,isPremium:!!u,name:t}})}function R(o){if(!o)return;const e=Array.isArray(o)?{items:o}:o,t=u(e.items||[]);return{isMultiline:t.includes("-"),shouldNotGroupWhenFull:!!e.shouldNotGroupWhenFull,items:n(t)};function n(y){return y.filter(p=>p!=="|"&&p!=="-")}function u(y){return y.flatMap(p=>typeof p=="string"?[p]:u(p.items))}}function _e(){return{channel:window[Symbol.for("cke distribution")]||"sh"}}function Ee(){let o="unknown",e="unknown";return _.isMac?o="mac":_.isWindows?o="windows":_.isiOS?o="ios":_.isAndroid&&(o="android"),_.isGecko?e="gecko":_.isBlink?e="blink":_.isSafari&&(e="safari"),{os:o,browser:e}}function ke(){return localStorage.getItem("__ckeditor-session-id")||localStorage.setItem("__ckeditor-session-id",A()),localStorage.getItem("__ckeditor-session-id")}function Pe(){return T.window.CKEDITOR_PAGE_SESSION_ID=T.window.CKEDITOR_PAGE_SESSION_ID||A(),T.window.CKEDITOR_PAGE_SESSION_ID}class Re extends P(){static get editorName(){return"Editor"}accessibility;commands;config;conversion;data;editing;locale;model;plugins;keystrokes;t;static defaultConfig;static builtinPlugins;_context;_readOnlyLocks;constructor(e={}){if(super(),"sanitizeHtml"in e)throw new l("editor-config-sanitizehtml-not-supported");const t=this.constructor,{translations:i,...n}=t.defaultConfig||{},{translations:u=i,...y}=e,p=e.language||n.language;this._context=e.context||new G({language:p,translations:u}),this._context._addEditor(this,!e.context);const E=Array.from(t.builtinPlugins||[]);this.config=new j(y,n),this.config.define("plugins",E),this.config.define(this._context._getEditorConfig()),x(this.config),this.plugins=new H(this,E,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new ge,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.model=new ne,this.on("change:isReadOnly",()=>{this.model.document.isReadOnly=this.isReadOnly});const b=new oe;this.data=new se(this.model,b),this.editing=new re(this.model,b),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new ae([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new me(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new ye(this),v(this);function x(f){let w=f.get("licenseKey");if(!w&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(w=window.CKEDITOR_GLOBAL_LICENSE_KEY,f.set("licenseKey",w)),!w)throw new l("license-key-missing")}function v(f){const w=f.config.get("licenseKey"),k=window[Symbol.for("cke distribution")]||"sh";function g(a){f.enableReadOnlyMode(Symbol("invalidLicense")),f._showLicenseError(a)}function O(a){const d=a.split(".");return d.length!=3?null:d[1]}function D(a){return["exp","jti","vc"].every(m=>m in a)}function I(a){return Object.getOwnPropertyNames(a).sort().filter(h=>h!="vc"&&a[h]!=null).map(h=>a[h])}function L(a){const{hostname:d}=new URL(window.location.href);if(a.includes(d))return!0;const m=d.split(".");return a.filter(h=>h.includes("*")).map(h=>h.split(".")).filter(h=>h.length<=m.length).map(h=>Array(m.length-h.length).fill(h[0]==="*"?"*":"").concat(h)).some(h=>m.every(($,K)=>h[K]===$||h[K]==="*"))}function S(a){const d=a[0].toUpperCase()+a.slice(1),m=a==="evaluation"?"an":"a";console.info(`%cCKEditor 5 ${d} License`,"color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;"),console.warn(`⚠️ You are using ${m} ${a} license of CKEditor 5${a==="trial"?" which is for evaluation purposes only":""}. For production usage, please obtain a production license at https://portal.ckeditor.com/`)}if(w=="GPL"){k=="cloud"&&g("distributionChannel");return}const C=O(w);if(!C){g("invalid");return}const s=Y(C);if(!s){g("invalid");return}if(!D(s)){g("invalid");return}if(s.distributionChannel&&!J(s.distributionChannel).includes(k)){g("distributionChannel");return}if(Q(I(s))!=s.vc.toLowerCase()){g("invalid");return}if(new Date(s.exp*1e3)<X){g("expired");return}const r=s.licensedHosts;if(r&&r.length>0&&!L(r)){g("domainLimit");return}if(["evaluation","trial"].includes(s.licenseType)&&s.exp*1e3<Date.now()){g("expired");return}if(["development","evaluation","trial"].includes(s.licenseType)){const{licenseType:a}=s;window.CKEDITOR_WARNING_SUPPRESSIONS=window.CKEDITOR_WARNING_SUPPRESSIONS||{},window.CKEDITOR_WARNING_SUPPRESSIONS[a]||(S(a),window.CKEDITOR_WARNING_SUPPRESSIONS[a]=!0)}if(["evaluation","trial"].includes(s.licenseType)){const a=s.licenseType,d=setTimeout(()=>{g(`${a}Limit`)},6e5);f.on("destroy",()=>{clearTimeout(d)})}s.usageEndpoint&&f.once("ready",()=>{const a={requestId:A(),requestTime:Math.round(Date.now()/1e3),license:w,editor:xe(f)};f._sendUsageRequest(s.usageEndpoint,a).then(d=>{const{status:m,message:h}=d;h&&console.warn(h),m!="ok"&&g("usageLimit")},()=>{Z("license-key-validation-endpoint-not-reachable",{url:s.usageEndpoint})})},{priority:"high"})}}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new l("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new l("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),this._readOnlyLocks.size===1&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new l("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),this._readOnlyLocks.size===0&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}initPlugins(){const e=this.config,t=e.get("plugins"),i=e.get("removePlugins")||[],n=e.get("extraPlugins")||[],u=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(n),i,u)}destroy(){let e=Promise.resolve();return this.state=="initializing"&&(e=new Promise(t=>this.once("ready",t))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(e,...t){try{return this.commands.execute(e,...t)}catch(i){/* istanbul ignore next -- @preserve */l.rethrowUnexpectedError(i,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}static Context=G;static EditorWatchdog=le;static ContextWatchdog=ce;_showLicenseError(e,t){setTimeout(()=>{if(e=="invalid")throw new l("invalid-license-key");if(e=="expired")throw new l("license-key-expired");if(e=="domainLimit")throw new l("license-key-domain-limit");if(e=="featureNotAllowed")throw new l("license-key-plugin-not-allowed",null,{pluginName:t});if(e=="evaluationLimit")throw new l("license-key-evaluation-limit");if(e=="trialLimit")throw new l("license-key-trial-limit");if(e=="developmentLimit")throw new l("license-key-development-limit");if(e=="usageLimit")throw new l("license-key-usage-limit");if(e=="distributionChannel")throw new l("license-key-invalid-distribution-channel")},0),this._showLicenseError=()=>{}}async _sendUsageRequest(e,t){const i=new Headers({"Content-Type":"application/json"}),n=await fetch(new URL(e),{method:"POST",headers:i,body:JSON.stringify(t)});if(!n.ok)throw new Error(`HTTP Response: ${n.status}`);return n.json()}}function xe(o){const e=pe(o);function t(i,n){if(ue(e,i)!==void 0)throw new l("editor-usage-data-path-already-set",{path:i});de(e,i,n)}return o.fire("collectUsageData",{setUsageData:t}),e}function Ae(o){if(!M(o.updateSourceElement))throw new l("attachtoform-missing-elementapi-interface",o);const e=o.sourceElement;if(ve(e)&&e.form){let t;const i=e.form,n=()=>o.updateSourceElement();M(i.submit)&&(t=i.submit,i.submit=()=>{n(),t.apply(i)}),i.addEventListener("submit",n),o.on("destroy",()=>{i.removeEventListener("submit",n),t&&(i.submit=t)})}}function ve(o){return!!o&&o.tagName.toLowerCase()==="textarea"}function B(o){class e extends o{sourceElement;updateSourceElement(i){if(!this.sourceElement)throw new l("editor-missing-sourceelement",this);const n=this.config.get("updateSourceElementOnDestroy"),u=this.sourceElement instanceof HTMLTextAreaElement;if(!n&&!u){q(this.sourceElement,"");return}const y=typeof i=="string"?i:this.data.get();q(this.sourceElement,y)}}return e}B.updateSourceElement=B(Object).prototype.updateSourceElement;class Ke extends fe{_actions;static get pluginName(){return"PendingActions"}static get isOfficialPlugin(){return!0}init(){this.set("hasAny",!1),this._actions=new W({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!="string")throw new l("pendingactions-add-invalid-message",this);const t=new(P());return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}export{he as Command,G as Context,fe as ContextPlugin,Re as Editor,B as ElementApiMixin,Ne as MultiCommand,Ke as PendingActions,Te as Plugin,Ae as attachToForm};
@@ -1,4 +1,4 @@
1
- var m=Object.defineProperty;var p=(s,r,t)=>r in s?m(s,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[r]=t;var a=(s,r,t)=>p(s,typeof r!="symbol"?r+"":r,t);import{BoxedEditorUIView as b,StickyPanelView as y,ToolbarView as v,MenuBarView as P,InlineEditableUIView as k,EditorUI as T,normalizeToolbarConfig as V,DialogView as f}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{enablePlaceholder as C}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{CKEditorError as B,getDataFromElement as E,ElementReplacer as S,Rect as h}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{ElementApiMixin as _,attachToForm as R,Editor as x}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{isElement as F}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isElement.js";/**
1
+ import{BoxedEditorUIView as f,StickyPanelView as w,ToolbarView as m,MenuBarView as p,InlineEditableUIView as b,EditorUI as y,normalizeToolbarConfig as v,DialogView as u}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{enablePlaceholder as P}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{CKEditorError as k,getDataFromElement as T,ElementReplacer as V,Rect as a}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{ElementApiMixin as C,attachToForm as B,Editor as E}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{isElement as S}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isElement.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 T{constructor(t,i){super(t);a(this,"view");a(this,"_toolbarConfig");a(this,"_elementReplacer");this.view=i,this._toolbarConfig=V(t.config.get("toolbar")),this._elementReplacer=new S,this.listenTo(t.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(t){const i=this.editor,o=this.view,n=i.editing.view,e=o.editable,l=n.document.getRoot();e.name=l.rootName,o.render();const c=e.element;this.setEditableElement(e.name,c),o.editable.bind("isFocused").to(this.focusTracker),n.attachDomRoot(c),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),o.menuBarView&&this.initMenuBar(o.menuBarView),this._initDialogPluginIntegration(),this._initContextualBalloonIntegration(),this.fire("ready")}destroy(){super.destroy();const t=this.view,i=this.editor.editing.view;this._elementReplacer.restore(),i.getDomRoot(t.editable.name)&&i.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,t.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",({visualTop:i})=>i||0),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){const t=this.editor,i=t.editing.view,o=i.document.getRoot(),n=t.sourceElement;let e;const l=t.config.get("placeholder");l&&(e=typeof l=="string"?l:l[this.view.editable.name]),!e&&n&&n.tagName.toLowerCase()==="textarea"&&(e=n.getAttribute("placeholder")),e&&(o.placeholder=e),C({view:i,element:o,isDirectHost:!1,keepOnFocus:!0})}_initContextualBalloonIntegration(){if(!this.editor.plugins.has("ContextualBalloon"))return;const{stickyPanel:t}=this.view,i=this.editor.plugins.get("ContextualBalloon");i.on("getPositionOptions",n=>{const e=n.return;if(!e||!t.isSticky||!t.element)return;const l=new h(t.element).height,c=typeof e.target=="function"?e.target():e.target,u=typeof e.limiter=="function"?e.limiter():e.limiter;if(c&&u&&new h(c).height>=new h(u).height-l)return;const g={...e.viewportOffsetConfig},w=(g.top||0)+l;n.return={...e,viewportOffsetConfig:{...g,top:w}}},{priority:"low"});const o=()=>{i.visibleView&&i.updatePosition()};this.listenTo(t,"change:isSticky",o),this.listenTo(this.editor.ui,"change:viewportOffset",o)}_handleScrollToTheSelectionWithStickyPanel(t,i,o){const n=this.view.stickyPanel;if(n.isSticky){const e=new h(n.element).height;i.viewportOffset.top+=e}else{const e=()=>{this.editor.editing.view.scrollToTheSelection(o)};this.listenTo(n,"change:isSticky",e),setTimeout(()=>{this.stopListening(n,"change:isSticky",e)},20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const t=this.view.stickyPanel,i=this.editor.plugins.get("Dialog");i.on("show",()=>{const o=i.view;o.on("moveTo",(n,e)=>{if(!t.isSticky||o.wasMoved||o.isModal)return;const l=new h(t.contentPanelElement);e[1]<l.bottom+f.defaultOffset&&(e[1]=l.bottom+f.defaultOffset)},{priority:"high"})},{priority:"low"})}}class D extends b{constructor(t,i,o={}){super(t);a(this,"stickyPanel");a(this,"toolbar");a(this,"editable");this.stickyPanel=new y(t),this.toolbar=new v(t,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),o.useMenuBar&&(this.menuBarView=new P(t)),this.editable=new k(t,i,void 0,{label:o.label})}render(){super.render(),this.menuBarView?this.stickyPanel.content.addMany([this.menuBarView,this.toolbar]):this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class H extends _(x){constructor(t,i={}){if(!d(t)&&i.initialData!==void 0)throw new B("editor-create-initial-data",null);super(i);a(this,"ui");this.config.define("menuBar.isVisible",!1),this.config.get("initialData")===void 0&&this.config.set("initialData",M(t)),d(t)&&(this.sourceElement=t),this.model.document.createRoot();const o=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=this.config.get("menuBar"),e=new D(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:o,useMenuBar:n.isVisible,label:this.config.get("label")});this.ui=new I(this,e),R(this)}static get editorName(){return"ClassicEditor"}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,i={}){return new Promise(o=>{const n=new this(t,i);o(n.initPlugins().then(()=>n.ui.init(d(t)?t:null)).then(()=>n.data.init(n.config.get("initialData"))).then(()=>n.fire("ready")).then(()=>n))})}}function M(s){return d(s)?E(s):s}function d(s){return F(s)}export{H as ClassicEditor,D as ClassicEditorUIView};
4
+ */class _ extends y{view;_toolbarConfig;_elementReplacer;constructor(t,i){super(t),this.view=i,this._toolbarConfig=v(t.config.get("toolbar")),this._elementReplacer=new V,this.listenTo(t.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(t){const i=this.editor,o=this.view,n=i.editing.view,e=o.editable,s=n.document.getRoot();e.name=s.rootName,o.render();const r=e.element;this.setEditableElement(e.name,r),o.editable.bind("isFocused").to(this.focusTracker),n.attachDomRoot(r),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),o.menuBarView&&this.initMenuBar(o.menuBarView),this._initDialogPluginIntegration(),this._initContextualBalloonIntegration(),this.fire("ready")}destroy(){super.destroy();const t=this.view,i=this.editor.editing.view;this._elementReplacer.restore(),i.getDomRoot(t.editable.name)&&i.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,t.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",({visualTop:i})=>i||0),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){const t=this.editor,i=t.editing.view,o=i.document.getRoot(),n=t.sourceElement;let e;const s=t.config.get("placeholder");s&&(e=typeof s=="string"?s:s[this.view.editable.name]),!e&&n&&n.tagName.toLowerCase()==="textarea"&&(e=n.getAttribute("placeholder")),e&&(o.placeholder=e),P({view:i,element:o,isDirectHost:!1,keepOnFocus:!0})}_initContextualBalloonIntegration(){if(!this.editor.plugins.has("ContextualBalloon"))return;const{stickyPanel:t}=this.view,i=this.editor.plugins.get("ContextualBalloon");i.on("getPositionOptions",n=>{const e=n.return;if(!e||!t.isSticky||!t.element)return;const s=new a(t.element).height,r=typeof e.target=="function"?e.target():e.target,h=typeof e.limiter=="function"?e.limiter():e.limiter;if(r&&h&&new a(r).height>=new a(h).height-s)return;const d={...e.viewportOffsetConfig},g=(d.top||0)+s;n.return={...e,viewportOffsetConfig:{...d,top:g}}},{priority:"low"});const o=()=>{i.visibleView&&i.updatePosition()};this.listenTo(t,"change:isSticky",o),this.listenTo(this.editor.ui,"change:viewportOffset",o)}_handleScrollToTheSelectionWithStickyPanel(t,i,o){const n=this.view.stickyPanel;if(n.isSticky){const e=new a(n.element).height;i.viewportOffset.top+=e}else{const e=()=>{this.editor.editing.view.scrollToTheSelection(o)};this.listenTo(n,"change:isSticky",e),setTimeout(()=>{this.stopListening(n,"change:isSticky",e)},20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const t=this.view.stickyPanel,i=this.editor.plugins.get("Dialog");i.on("show",()=>{const o=i.view;o.on("moveTo",(n,e)=>{if(!t.isSticky||o.wasMoved||o.isModal)return;const s=new a(t.contentPanelElement);e[1]<s.bottom+u.defaultOffset&&(e[1]=s.bottom+u.defaultOffset)},{priority:"high"})},{priority:"low"})}}class R extends f{stickyPanel;toolbar;editable;constructor(t,i,o={}){super(t),this.stickyPanel=new w(t),this.toolbar=new m(t,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),o.useMenuBar&&(this.menuBarView=new p(t)),this.editable=new b(t,i,void 0,{label:o.label})}render(){super.render(),this.menuBarView?this.stickyPanel.content.addMany([this.menuBarView,this.toolbar]):this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class W extends C(E){static get editorName(){return"ClassicEditor"}ui;constructor(t,i={}){if(!c(t)&&i.initialData!==void 0)throw new k("editor-create-initial-data",null);super(i),this.config.define("menuBar.isVisible",!1),this.config.get("initialData")===void 0&&this.config.set("initialData",x(t)),c(t)&&(this.sourceElement=t),this.model.document.createRoot();const o=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=this.config.get("menuBar"),e=new R(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:o,useMenuBar:n.isVisible,label:this.config.get("label")});this.ui=new _(this,e),B(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,i={}){return new Promise(o=>{const n=new this(t,i);o(n.initPlugins().then(()=>n.ui.init(c(t)?t:null)).then(()=>n.data.init(n.config.get("initialData"))).then(()=>n.fire("ready")).then(()=>n))})}}function x(l){return c(l)?T(l):l}function c(l){return S(l)}export{W as ClassicEditor,R as ClassicEditorUIView};