@ncino/web-components 9.0.0-preview.6 → 9.0.0-preview.9

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 (424) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +1 -1
  2. package/dist/_virtual/index.js +1 -1
  3. package/dist/assets/node_modules/.pnpm/ckeditor5@47.3.0/node_modules/ckeditor5/dist/ckeditor5.css +1 -0
  4. package/dist/components/input/gator/input-phone/input-phone.gator.js +1 -1
  5. package/dist/components/input-rich-text/ckeditor-config.js +1 -1
  6. package/dist/components/input-rich-text/input-rich-text.slds.js +2 -2
  7. package/dist/components/panel/gator/panel.storybook-test.js +1 -1
  8. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-alignment@46.1.1 → @ckeditor_ckeditor5-alignment@47.3.0}/node_modules/@ckeditor/ckeditor5-alignment/dist/index.js +1 -1
  9. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autoformat@46.1.1 → @ckeditor_ckeditor5-autoformat@47.3.0}/node_modules/@ckeditor/ckeditor5-autoformat/dist/index.js +1 -1
  10. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autosave@46.1.1 → @ckeditor_ckeditor5-autosave@47.3.0}/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js +1 -1
  11. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-basic-styles@46.1.1 → @ckeditor_ckeditor5-basic-styles@47.3.0}/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +1 -1
  12. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-block-quote@46.1.1 → @ckeditor_ckeditor5-block-quote@47.3.0}/node_modules/@ckeditor/ckeditor5-block-quote/dist/index.js +1 -1
  13. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-clipboard@47.3.0/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +8 -0
  14. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-cloud-services@46.1.1 → @ckeditor_ckeditor5-cloud-services@47.3.0}/node_modules/@ckeditor/ckeditor5-cloud-services/dist/index.js +1 -1
  15. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-code-block@46.1.1 → @ckeditor_ckeditor5-code-block@47.3.0}/node_modules/@ckeditor/ckeditor5-code-block/dist/index.js +1 -1
  16. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js +1 -0
  17. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-editor-classic@46.1.1 → @ckeditor_ckeditor5-editor-classic@47.3.0}/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +1 -1
  18. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-engine@47.3.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +3 -0
  19. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-enter@46.1.1 → @ckeditor_ckeditor5-enter@47.3.0}/node_modules/@ckeditor/ckeditor5-enter/dist/index.js +1 -1
  20. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-essentials@46.1.1 → @ckeditor_ckeditor5-essentials@47.3.0}/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js +1 -1
  21. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-find-and-replace@46.1.1 → @ckeditor_ckeditor5-find-and-replace@47.3.0}/node_modules/@ckeditor/ckeditor5-find-and-replace/dist/index.js +2 -2
  22. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-font@46.1.1 → @ckeditor_ckeditor5-font@47.3.0}/node_modules/@ckeditor/ckeditor5-font/dist/index.js +1 -1
  23. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-heading@46.1.1 → @ckeditor_ckeditor5-heading@47.3.0}/node_modules/@ckeditor/ckeditor5-heading/dist/index.js +1 -1
  24. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-highlight@46.1.1 → @ckeditor_ckeditor5-highlight@47.3.0}/node_modules/@ckeditor/ckeditor5-highlight/dist/index.js +1 -1
  25. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-horizontal-line@46.1.1 → @ckeditor_ckeditor5-horizontal-line@47.3.0}/node_modules/@ckeditor/ckeditor5-horizontal-line/dist/index.js +1 -1
  26. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-embed@47.3.0/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +1 -0
  27. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-support@47.3.0/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +3 -0
  28. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-icons@46.1.1 → @ckeditor_ckeditor5-icons@47.3.0}/node_modules/@ckeditor/ckeditor5-icons/dist/index.js +1 -1
  29. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@47.3.0/node_modules/@ckeditor/ckeditor5-image/dist/index.js +1 -0
  30. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-indent@46.1.1 → @ckeditor_ckeditor5-indent@47.3.0}/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +1 -1
  31. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-language@46.1.1 → @ckeditor_ckeditor5-language@47.3.0}/node_modules/@ckeditor/ckeditor5-language/dist/index.js +1 -1
  32. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-link@47.3.0/node_modules/@ckeditor/ckeditor5-link/dist/index.js +1 -0
  33. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-list@47.3.0/node_modules/@ckeditor/ckeditor5-list/dist/index.js +1 -0
  34. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-markdown-gfm@46.1.1 → @ckeditor_ckeditor5-markdown-gfm@47.3.0}/node_modules/@ckeditor/ckeditor5-markdown-gfm/dist/index.js +1 -1
  35. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-media-embed@46.1.1 → @ckeditor_ckeditor5-media-embed@47.3.0}/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +1 -1
  36. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-mention@46.1.1 → @ckeditor_ckeditor5-mention@47.3.0}/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +1 -1
  37. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-page-break@47.3.0/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js +1 -0
  38. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-paragraph@46.1.1 → @ckeditor_ckeditor5-paragraph@47.3.0}/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +1 -1
  39. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paste-from-office@47.3.0/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +1 -0
  40. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-remove-format@46.1.1 → @ckeditor_ckeditor5-remove-format@47.3.0}/node_modules/@ckeditor/ckeditor5-remove-format/dist/index.js +1 -1
  41. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-select-all@46.1.1 → @ckeditor_ckeditor5-select-all@47.3.0}/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +1 -1
  42. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-show-blocks@46.1.1 → @ckeditor_ckeditor5-show-blocks@47.3.0}/node_modules/@ckeditor/ckeditor5-show-blocks/dist/index.js +1 -1
  43. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-source-editing@46.1.1 → @ckeditor_ckeditor5-source-editing@47.3.0}/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +1 -1
  44. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-special-characters@47.3.0/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +1 -0
  45. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-style@46.1.1 → @ckeditor_ckeditor5-style@47.3.0}/node_modules/@ckeditor/ckeditor5-style/dist/index.js +1 -1
  46. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@47.3.0/node_modules/@ckeditor/ckeditor5-table/dist/index.js +1 -0
  47. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-typing@46.1.1 → @ckeditor_ckeditor5-typing@47.3.0}/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +1 -1
  48. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@47.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +1 -0
  49. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-undo@46.1.1 → @ckeditor_ckeditor5-undo@47.3.0}/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +1 -1
  50. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-upload@46.1.1 → @ckeditor_ckeditor5-upload@47.3.0}/node_modules/@ckeditor/ckeditor5-upload/dist/index.js +1 -1
  51. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-utils@47.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +8 -0
  52. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-widget@47.3.0/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +1 -0
  53. package/dist/node_modules/.pnpm/@vitest_expect@4.0.15/node_modules/@vitest/expect/dist/index.js +58 -0
  54. package/dist/node_modules/.pnpm/@vitest_pretty-format@4.0.15/node_modules/@vitest/pretty-format/dist/index.js +5 -0
  55. package/dist/node_modules/.pnpm/@vitest_runner@4.0.15/node_modules/@vitest/runner/dist/chunk-tasks.js +2 -0
  56. package/dist/node_modules/.pnpm/@vitest_runner@4.0.15/node_modules/@vitest/runner/dist/index.js +4 -0
  57. package/dist/node_modules/.pnpm/@vitest_snapshot@4.0.15/node_modules/@vitest/snapshot/dist/index.js +21 -0
  58. package/dist/node_modules/.pnpm/@vitest_spy@4.0.15/node_modules/@vitest/spy/dist/index.js +1 -0
  59. package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +1 -0
  60. package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js +1 -0
  61. package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/diff.js +42 -0
  62. package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/display.js +2 -0
  63. package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/error.js +2 -0
  64. package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/helpers.js +1 -0
  65. package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/serialize.js +1 -0
  66. package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/source-map.js +1 -0
  67. package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/timers.js +1 -0
  68. package/dist/node_modules/.pnpm/chai@6.2.1/node_modules/chai/index.js +2 -0
  69. package/dist/node_modules/.pnpm/tinyrainbow@3.0.3/node_modules/tinyrainbow/dist/index.js +1 -0
  70. package/dist/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.js +1 -1
  71. package/dist/node_modules/.pnpm/vitest@4.0.15_@types_node@24.10.1_@vitest_browser-playwright@4.0.15_@vitest_ui@4.0.15_j_0c91d94893276de308eb5b07cced5df8/node_modules/vitest/browser/context.js +1 -0
  72. package/dist/node_modules/.pnpm/vitest@4.0.15_@types_node@24.10.1_@vitest_browser-playwright@4.0.15_@vitest_ui@4.0.15_j_0c91d94893276de308eb5b07cced5df8/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js +1 -0
  73. package/dist/node_modules/.pnpm/vitest@4.0.15_@types_node@24.10.1_@vitest_browser-playwright@4.0.15_@vitest_ui@4.0.15_j_0c91d94893276de308eb5b07cced5df8/node_modules/vitest/dist/chunks/utils.DvEY5TfP.js +8 -0
  74. package/dist/node_modules/.pnpm/vitest@4.0.15_@types_node@24.10.1_@vitest_browser-playwright@4.0.15_@vitest_ui@4.0.15_j_0c91d94893276de308eb5b07cced5df8/node_modules/vitest/dist/chunks/vi.2VT5v0um.js +11 -0
  75. package/dist/utils/vitest-a11y-utils.js +1 -1
  76. package/package.json +22 -21
  77. package/web-types.json +1 -1
  78. package/dist/_virtual/___vite-browser-external.js +0 -1
  79. package/dist/_virtual/__vite-browser-external.js +0 -1
  80. package/dist/_virtual/api-request.js +0 -1
  81. package/dist/_virtual/constants.js +0 -1
  82. package/dist/_virtual/events.js +0 -1
  83. package/dist/_virtual/external.js +0 -1
  84. package/dist/_virtual/external2.js +0 -1
  85. package/dist/_virtual/external3.js +0 -1
  86. package/dist/_virtual/external_types.js +0 -1
  87. package/dist/_virtual/fetch.js +0 -1
  88. package/dist/_virtual/figma_client.js +0 -1
  89. package/dist/_virtual/figma_rest_api.js +0 -1
  90. package/dist/_virtual/helpers.js +0 -1
  91. package/dist/_virtual/index10.js +0 -1
  92. package/dist/_virtual/index11.js +0 -1
  93. package/dist/_virtual/index12.js +0 -1
  94. package/dist/_virtual/index2.js +0 -1
  95. package/dist/_virtual/index3.js +0 -1
  96. package/dist/_virtual/index4.js +0 -1
  97. package/dist/_virtual/index5.js +0 -1
  98. package/dist/_virtual/index6.js +0 -1
  99. package/dist/_virtual/index7.js +0 -1
  100. package/dist/_virtual/index8.js +0 -1
  101. package/dist/_virtual/index9.js +0 -1
  102. package/dist/_virtual/index_common.js +0 -1
  103. package/dist/_virtual/index_html.js +0 -1
  104. package/dist/_virtual/index_html2.js +0 -1
  105. package/dist/_virtual/index_react.js +0 -1
  106. package/dist/_virtual/index_react2.js +0 -1
  107. package/dist/_virtual/inherits_browser.js +0 -1
  108. package/dist/_virtual/logging.js +0 -1
  109. package/dist/_virtual/main.js +0 -1
  110. package/dist/_virtual/main2.js +0 -1
  111. package/dist/_virtual/mock-interceptor.js +0 -1
  112. package/dist/_virtual/react.production.js +0 -1
  113. package/dist/_virtual/string_decoder.js +0 -1
  114. package/dist/_virtual/template_literal.js +0 -1
  115. package/dist/_virtual/types.js +0 -1
  116. package/dist/_virtual/updates.js +0 -1
  117. package/dist/_virtual/util.js +0 -1
  118. package/dist/_virtual/utils.js +0 -1
  119. package/dist/assets/node_modules/.pnpm/ckeditor5@46.1.1/node_modules/ckeditor5/dist/ckeditor5.css +0 -1
  120. package/dist/components/accordion/gator/base/accordion.gator.figma.js +0 -10
  121. package/dist/components/accordion/gator/group/accordion-group.gator.figma.js +0 -3
  122. package/dist/components/alert/alert.gator.figma.js +0 -7
  123. package/dist/components/avatar/gator/avatar.gator.figma.js +0 -9
  124. package/dist/components/banner/gator/banner.gator.figma.js +0 -8
  125. package/dist/components/boolean/boolean.gator.figma.js +0 -11
  126. package/dist/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.figma.js +0 -3
  127. package/dist/components/breadcrumbs/gator/container/breadcrumbs.gator.figma.js +0 -5
  128. package/dist/components/button/gator/button.gator.figma.js +0 -12
  129. package/dist/components/button-group/gator/button-group.gator.figma.js +0 -7
  130. package/dist/components/icon/gator/icon.gator.figma.js +0 -7
  131. package/dist/components/icon/gator/icons.gator.figma.js +0 -1
  132. package/dist/components/text-detail/gator/text-detail.gator.figma.js +0 -30
  133. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-clipboard@46.1.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +0 -8
  134. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js +0 -1
  135. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +0 -3
  136. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-embed@46.1.1/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +0 -1
  137. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-support@46.1.1/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +0 -3
  138. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@46.1.1/node_modules/@ckeditor/ckeditor5-image/dist/index.js +0 -1
  139. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-link@46.1.1/node_modules/@ckeditor/ckeditor5-link/dist/index.js +0 -1
  140. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-list@46.1.1/node_modules/@ckeditor/ckeditor5-list/dist/index.js +0 -1
  141. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-page-break@46.1.1/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js +0 -1
  142. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paste-from-office@46.1.1/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +0 -1
  143. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-special-characters@46.1.1/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +0 -1
  144. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@46.1.1/node_modules/@ckeditor/ckeditor5-table/dist/index.js +0 -1
  145. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +0 -1
  146. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +0 -8
  147. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-widget@46.1.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +0 -1
  148. package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js +0 -3
  149. package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js +0 -3
  150. package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js +0 -1
  151. package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/deps/streamsearch/sbmh.js +0 -1
  152. package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/main.js +0 -1
  153. package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/types/multipart.js +0 -1
  154. package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/types/urlencoded.js +0 -1
  155. package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/Decoder.js +0 -1
  156. package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/basename.js +0 -1
  157. package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/decodeText.js +0 -1
  158. package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/getLimit.js +0 -1
  159. package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/parseParams.js +0 -3
  160. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/client/external.js +0 -1
  161. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/client/figma_client.js +0 -1
  162. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/common/fetch.js +0 -1
  163. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/common/logging.js +0 -1
  164. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/common/updates.js +0 -4
  165. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/connect/external_types.js +0 -1
  166. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/connect/figma_rest_api.js +0 -1
  167. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/connect/helpers.js +0 -1
  168. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/connect/index_common.js +0 -1
  169. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/html/external.js +0 -1
  170. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/html/index_html.js +0 -1
  171. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/html/template_literal.js +0 -1
  172. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/react/external.js +0 -1
  173. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/react/index_react.js +0 -1
  174. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/package.json.js +0 -1
  175. package/dist/node_modules/.pnpm/@vitest_browser@3.2.4_msw@2.7.3_@types_node@24.10.1_typescript@5.9.3__playwright@1.57.0_4c7b68e67853c98910921d3bcdc3c508/node_modules/@vitest/browser/context.js +0 -1
  176. package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js +0 -58
  177. package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +0 -5
  178. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +0 -5
  179. package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +0 -21
  180. package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.js +0 -1
  181. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +0 -1
  182. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js +0 -42
  183. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +0 -2
  184. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js +0 -1
  185. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js +0 -1
  186. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js +0 -1
  187. package/dist/node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +0 -1
  188. package/dist/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/index.js +0 -1
  189. package/dist/node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js +0 -1
  190. package/dist/node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.js +0 -1
  191. package/dist/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js +0 -1
  192. package/dist/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/applyBind.js +0 -1
  193. package/dist/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js +0 -1
  194. package/dist/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js +0 -1
  195. package/dist/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js +0 -1
  196. package/dist/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js +0 -1
  197. package/dist/node_modules/.pnpm/call-bind@1.0.8/node_modules/call-bind/index.js +0 -1
  198. package/dist/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js +0 -1
  199. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +0 -2
  200. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js +0 -2
  201. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js +0 -2
  202. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js +0 -4
  203. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js +0 -1
  204. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js +0 -1
  205. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js +0 -1
  206. package/dist/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js +0 -1
  207. package/dist/node_modules/.pnpm/compare-versions@6.1.1/node_modules/compare-versions/lib/esm/compare.js +0 -1
  208. package/dist/node_modules/.pnpm/compare-versions@6.1.1/node_modules/compare-versions/lib/esm/compareVersions.js +0 -1
  209. package/dist/node_modules/.pnpm/compare-versions@6.1.1/node_modules/compare-versions/lib/esm/index.js +0 -1
  210. package/dist/node_modules/.pnpm/compare-versions@6.1.1/node_modules/compare-versions/lib/esm/satisfies.js +0 -1
  211. package/dist/node_modules/.pnpm/compare-versions@6.1.1/node_modules/compare-versions/lib/esm/utils.js +0 -1
  212. package/dist/node_modules/.pnpm/compare-versions@6.1.1/node_modules/compare-versions/lib/esm/validate.js +0 -1
  213. package/dist/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.js +0 -1
  214. package/dist/node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/lib/main.js +0 -3
  215. package/dist/node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/package.json.js +0 -1
  216. package/dist/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js +0 -1
  217. package/dist/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js +0 -1
  218. package/dist/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js +0 -1
  219. package/dist/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js +0 -1
  220. package/dist/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js +0 -1
  221. package/dist/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js +0 -1
  222. package/dist/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js +0 -1
  223. package/dist/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js +0 -1
  224. package/dist/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js +0 -1
  225. package/dist/node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js +0 -1
  226. package/dist/node_modules/.pnpm/events@3.3.0/node_modules/events/events.js +0 -1
  227. package/dist/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/index.js +0 -1
  228. package/dist/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js +0 -1
  229. package/dist/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js +0 -1
  230. package/dist/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js +0 -1
  231. package/dist/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js +0 -1
  232. package/dist/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -1
  233. package/dist/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js +0 -1
  234. package/dist/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js +0 -1
  235. package/dist/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js +0 -1
  236. package/dist/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.js +0 -1
  237. package/dist/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js +0 -1
  238. package/dist/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js +0 -1
  239. package/dist/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js +0 -1
  240. package/dist/node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js +0 -1
  241. package/dist/node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js +0 -1
  242. package/dist/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js +0 -1
  243. package/dist/node_modules/.pnpm/is-arguments@1.2.0/node_modules/is-arguments/index.js +0 -1
  244. package/dist/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js +0 -1
  245. package/dist/node_modules/.pnpm/is-generator-function@1.1.0/node_modules/is-generator-function/index.js +0 -1
  246. package/dist/node_modules/.pnpm/is-regex@1.2.1/node_modules/is-regex/index.js +0 -1
  247. package/dist/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/index.js +0 -1
  248. package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js +0 -1
  249. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +0 -1
  250. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +0 -1
  251. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +0 -1
  252. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +0 -1
  253. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +0 -1
  254. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +0 -1
  255. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +0 -1
  256. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +0 -1
  257. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +0 -2
  258. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +0 -1
  259. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +0 -1
  260. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +0 -1
  261. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +0 -1
  262. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +0 -1
  263. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +0 -1
  264. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +0 -1
  265. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +0 -1
  266. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +0 -1
  267. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +0 -1
  268. package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js +0 -1
  269. package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js +0 -1
  270. package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js +0 -1
  271. package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js +0 -1
  272. package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js +0 -1
  273. package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js +0 -1
  274. package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js +0 -1
  275. package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js +0 -1
  276. package/dist/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/index.js +0 -1
  277. package/dist/node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react.production.js +0 -1
  278. package/dist/node_modules/.pnpm/react@19.2.0/node_modules/react/index.js +0 -1
  279. package/dist/node_modules/.pnpm/safe-buffer@5.1.2/node_modules/safe-buffer/index.js +0 -1
  280. package/dist/node_modules/.pnpm/safe-regex-test@1.1.0/node_modules/safe-regex-test/index.js +0 -1
  281. package/dist/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.js +0 -1
  282. package/dist/node_modules/.pnpm/string_decoder@1.1.1/node_modules/string_decoder/lib/string_decoder.js +0 -1
  283. package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.js +0 -1
  284. package/dist/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/browser.js +0 -1
  285. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/browser.js +0 -1
  286. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +0 -1
  287. package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.js +0 -1
  288. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/index.js +0 -1
  289. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/agent.js +0 -1
  290. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/abort-signal.js +0 -1
  291. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/api-connect.js +0 -1
  292. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/api-pipeline.js +0 -1
  293. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/api-request.js +0 -1
  294. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/api-stream.js +0 -1
  295. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/api-upgrade.js +0 -1
  296. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/index.js +0 -1
  297. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/readable.js +0 -1
  298. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/util.js +0 -1
  299. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/balanced-pool.js +0 -1
  300. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/cache.js +0 -1
  301. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/cachestorage.js +0 -1
  302. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/symbols.js +0 -1
  303. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/util.js +0 -1
  304. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/client.js +0 -26
  305. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/compat/dispatcher-weakref.js +0 -1
  306. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cookies/constants.js +0 -1
  307. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cookies/index.js +0 -1
  308. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cookies/parse.js +0 -1
  309. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cookies/util.js +0 -1
  310. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/connect.js +0 -1
  311. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/constants.js +0 -1
  312. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/errors.js +0 -1
  313. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/request.js +0 -5
  314. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/symbols.js +0 -1
  315. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/util.js +0 -1
  316. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/dispatcher-base.js +0 -1
  317. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/dispatcher.js +0 -1
  318. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/body.js +0 -9
  319. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/constants.js +0 -1
  320. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/dataURL.js +0 -3
  321. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/file.js +0 -3
  322. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/formdata.js +0 -1
  323. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/global.js +0 -1
  324. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/headers.js +0 -1
  325. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/index.js +0 -1
  326. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/request.js +0 -1
  327. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/response.js +0 -1
  328. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/symbols.js +0 -1
  329. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/util.js +0 -2
  330. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/webidl.js +0 -1
  331. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fileapi/encoding.js +0 -1
  332. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fileapi/filereader.js +0 -1
  333. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fileapi/progressevent.js +0 -1
  334. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fileapi/symbols.js +0 -1
  335. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fileapi/util.js +0 -1
  336. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/global.js +0 -1
  337. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/handler/DecoratorHandler.js +0 -1
  338. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/handler/RedirectHandler.js +0 -1
  339. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/handler/RetryHandler.js +0 -1
  340. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/interceptor/redirectInterceptor.js +0 -1
  341. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/llhttp/constants.js +0 -1
  342. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/llhttp/llhttp-wasm.js +0 -1
  343. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +0 -1
  344. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/llhttp/utils.js +0 -1
  345. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-agent.js +0 -5
  346. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-client.js +0 -1
  347. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-errors.js +0 -1
  348. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-interceptor.js +0 -1
  349. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-pool.js +0 -1
  350. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-symbols.js +0 -1
  351. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-utils.js +0 -1
  352. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/pending-interceptors-formatter.js +0 -1
  353. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/pluralizer.js +0 -1
  354. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/node/fixed-queue.js +0 -1
  355. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/pool-base.js +0 -1
  356. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/pool-stats.js +0 -1
  357. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/pool.js +0 -1
  358. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/proxy-agent.js +0 -1
  359. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/timers.js +0 -1
  360. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/connection.js +0 -1
  361. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/constants.js +0 -1
  362. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/events.js +0 -1
  363. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/frame.js +0 -1
  364. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/receiver.js +0 -1
  365. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/symbols.js +0 -1
  366. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/util.js +0 -1
  367. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/websocket.js +0 -1
  368. package/dist/node_modules/.pnpm/util@0.12.5/node_modules/util/support/isBufferBrowser.js +0 -1
  369. package/dist/node_modules/.pnpm/util@0.12.5/node_modules/util/support/types.js +0 -1
  370. package/dist/node_modules/.pnpm/util@0.12.5/node_modules/util/util.js +0 -10
  371. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.1_@vitest_browser@3.2.4_@vitest_ui@3_6e27007ba0535c26eedf5a22febb1842/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +0 -1
  372. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.1_@vitest_browser@3.2.4_@vitest_ui@3_6e27007ba0535c26eedf5a22febb1842/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +0 -1
  373. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.1_@vitest_browser@3.2.4_@vitest_ui@3_6e27007ba0535c26eedf5a22febb1842/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +0 -8
  374. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.1_@vitest_browser@3.2.4_@vitest_ui@3_6e27007ba0535c26eedf5a22febb1842/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +0 -12
  375. package/dist/node_modules/.pnpm/which-typed-array@1.1.19/node_modules/which-typed-array/index.js +0 -1
  376. /package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-watchdog@46.1.1 → @ckeditor_ckeditor5-watchdog@47.3.0}/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +0 -0
  377. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/ParseError.js +0 -0
  378. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/PhoneNumber.js +0 -0
  379. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/constants.js +0 -0
  380. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/format.js +0 -0
  381. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +0 -0
  382. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +0 -0
  383. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +0 -0
  384. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +0 -0
  385. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js +0 -0
  386. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +0 -0
  387. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +0 -0
  388. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +0 -0
  389. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +0 -0
  390. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +0 -0
  391. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js +0 -0
  392. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +0 -0
  393. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +0 -0
  394. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +0 -0
  395. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js +0 -0
  396. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +0 -0
  397. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +0 -0
  398. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/isObject.js +0 -0
  399. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +0 -0
  400. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js +0 -0
  401. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/parseDigits.js +0 -0
  402. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +0 -0
  403. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/isPossible.js +0 -0
  404. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/isValid.js +0 -0
  405. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/metadata.js +0 -0
  406. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/normalizeArguments.js +0 -0
  407. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/parse.js +0 -0
  408. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +0 -0
  409. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/parsePhoneNumber.js +0 -0
  410. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +0 -0
  411. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +0 -0
  412. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/tools/semver-compare.js +0 -0
  413. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/metadata.min.json.js +0 -0
  414. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js +0 -0
  415. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/min/exports/withMetadataArgument.js +0 -0
  416. /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/_browser-chunks/chunk-A242L54C.js +0 -0
  417. /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/_browser-chunks/chunk-EZSQOHRI.js +0 -0
  418. /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/_browser-chunks/chunk-JP7NCOJX.js +0 -0
  419. /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/_browser-chunks/chunk-RP5RXKFU.js +0 -0
  420. /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/_browser-chunks/chunk-ZUWEVLDX.js +0 -0
  421. /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/client-logger/index.js +0 -0
  422. /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/core-events/index.js +0 -0
  423. /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/instrumenter/index.js +0 -0
  424. /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/test/index.js +0 -0
@@ -1 +1 @@
1
- import{Plugin as m,Command as E}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Observer as b,BubblingEventInfo as v,ViewDocumentDomEventData as k}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{env as S}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";function*p(s,e){for(const t of e)t&&s.getAttributeProperties(t[0]).copyOnEnter&&(yield t)}class y extends E{execute(){this.editor.model.change(e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})})}enterBlock(e){const t=this.editor.model,n=t.document.selection,i=t.schema,o=n.isCollapsed,r=n.getFirstRange(),a=r.start.parent,c=r.end.parent;if(i.isLimit(a)||i.isLimit(c))return!o&&a==c&&t.deleteContent(n),!1;if(o){const l=p(e.model.schema,n.getAttributes());return f(e,r.start),e.setSelectionAttribute(l),!0}else{const l=!(r.start.isAtStart&&r.end.isAtEnd),g=a==c;if(t.deleteContent(n,{leaveUnmerged:l}),l){if(g)return f(e,n.focus),!0;e.setSelection(c,0)}}return!1}}function f(s,e){s.split(e),s.setSelection(e.parent.nextSibling,0)}const C={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class h extends b{constructor(e){super(e);const t=this.document;let n=!1;t.on("keydown",(i,o)=>{n=o.shiftKey}),t.on("beforeinput",(i,o)=>{if(!this.isEnabled)return;let r=o.inputType;S.isSafari&&n&&r=="insertParagraph"&&(r="insertLineBreak");const a=o.domEvent,c=C[r];if(!c)return;const l=new v(t,"enter",o.targetRanges[0]);t.fire(l,new k(e,a,{isSoft:c.isSoft})),l.stop.called&&i.stop()})}observe(){}stopObserving(){}}class D extends m{static get pluginName(){return"Enter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,n=t.document,i=this.editor.t;t.addObserver(h),e.commands.add("enter",new y(e)),this.listenTo(n,"enter",(o,r)=>{n.isComposing||r.preventDefault(),!r.isSoft&&(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}}class T extends E{execute(){const e=this.editor.model,t=e.document;e.change(n=>{A(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=x(e.schema,t.selection)}}function x(s,e){if(e.rangeCount>1)return!1;const t=e.anchor;if(!t||!s.checkChild(t,"softBreak"))return!1;const n=e.getFirstRange(),i=n.start.parent,o=n.end.parent;return!((d(i,s)||d(o,s))&&i!==o)}function A(s,e,t){const n=t.isCollapsed,i=t.getFirstRange(),o=i.start.parent,r=i.end.parent,a=o==r;if(n){const c=p(s.schema,t.getAttributes());u(s,e,i.end),e.removeSelectionAttribute(t.getAttributeKeys()),e.setSelectionAttribute(c)}else{const c=!(i.start.isAtStart&&i.end.isAtEnd);s.deleteContent(t,{leaveUnmerged:c}),a?u(s,e,t.focus):c&&e.setSelection(r,0)}}function u(s,e,t){const n=e.createElement("softBreak");s.insertContent(n,t),e.setSelection(n,"after")}function d(s,e){return s.is("rootElement")?!1:e.isLimit(s)||d(s.parent,e)}class I extends m{static get pluginName(){return"ShiftEnter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,n=e.conversion,i=e.editing.view,o=i.document,r=this.editor.t;t.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(a,{writer:c})=>c.createEmptyElement("br")}),i.addObserver(h),e.commands.add("shiftEnter",new T(e)),this.listenTo(o,"enter",(a,c)=>{o.isComposing||c.preventDefault(),c.isSoft&&(e.execute("shiftEnter"),i.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:r("Insert a soft break (a <code>&lt;br&gt;</code> element)"),keystroke:"Shift+Enter"}]})}}export{D as Enter,y as EnterCommand,h as EnterObserver,I as ShiftEnter,T as ShiftEnterCommand,p as _getCopyOnEnterAttributes};
1
+ import{Plugin as m,Command as E}from"../../../../../@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Observer as b,BubblingEventInfo as v,ViewDocumentDomEventData as k}from"../../../../../@ckeditor_ckeditor5-engine@47.3.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{env as S}from"../../../../../@ckeditor_ckeditor5-utils@47.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";function*p(s,e){for(const t of e)t&&s.getAttributeProperties(t[0]).copyOnEnter&&(yield t)}class y extends E{execute(){this.editor.model.change(e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})})}enterBlock(e){const t=this.editor.model,n=t.document.selection,i=t.schema,o=n.isCollapsed,r=n.getFirstRange(),a=r.start.parent,c=r.end.parent;if(i.isLimit(a)||i.isLimit(c))return!o&&a==c&&t.deleteContent(n),!1;if(o){const l=p(e.model.schema,n.getAttributes());return f(e,r.start),e.setSelectionAttribute(l),!0}else{const l=!(r.start.isAtStart&&r.end.isAtEnd),g=a==c;if(t.deleteContent(n,{leaveUnmerged:l}),l){if(g)return f(e,n.focus),!0;e.setSelection(c,0)}}return!1}}function f(s,e){s.split(e),s.setSelection(e.parent.nextSibling,0)}const C={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class h extends b{constructor(e){super(e);const t=this.document;let n=!1;t.on("keydown",(i,o)=>{n=o.shiftKey}),t.on("beforeinput",(i,o)=>{if(!this.isEnabled)return;let r=o.inputType;S.isSafari&&n&&r=="insertParagraph"&&(r="insertLineBreak");const a=o.domEvent,c=C[r];if(!c)return;const l=new v(t,"enter",o.targetRanges[0]);t.fire(l,new k(e,a,{isSoft:c.isSoft})),l.stop.called&&i.stop()})}observe(){}stopObserving(){}}class D extends m{static get pluginName(){return"Enter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,n=t.document,i=this.editor.t;t.addObserver(h),e.commands.add("enter",new y(e)),this.listenTo(n,"enter",(o,r)=>{n.isComposing||r.preventDefault(),!r.isSoft&&(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}}class T extends E{execute(){const e=this.editor.model,t=e.document;e.change(n=>{A(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=x(e.schema,t.selection)}}function x(s,e){if(e.rangeCount>1)return!1;const t=e.anchor;if(!t||!s.checkChild(t,"softBreak"))return!1;const n=e.getFirstRange(),i=n.start.parent,o=n.end.parent;return!((d(i,s)||d(o,s))&&i!==o)}function A(s,e,t){const n=t.isCollapsed,i=t.getFirstRange(),o=i.start.parent,r=i.end.parent,a=o==r;if(n){const c=p(s.schema,t.getAttributes());u(s,e,i.end),e.removeSelectionAttribute(t.getAttributeKeys()),e.setSelectionAttribute(c)}else{const c=!(i.start.isAtStart&&i.end.isAtEnd);s.deleteContent(t,{leaveUnmerged:c}),a?u(s,e,t.focus):c&&e.setSelection(r,0)}}function u(s,e,t){const n=e.createElement("softBreak");s.insertContent(n,t),e.setSelection(n,"after")}function d(s,e){return s.is("rootElement")?!1:e.isLimit(s)||d(s.parent,e)}class I extends m{static get pluginName(){return"ShiftEnter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,n=e.conversion,i=e.editing.view,o=i.document,r=this.editor.t;t.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(a,{writer:c})=>c.createEmptyElement("br")}),i.addObserver(h),e.commands.add("shiftEnter",new T(e)),this.listenTo(o,"enter",(a,c)=>{o.isComposing||c.preventDefault(),c.isSoft&&(e.execute("shiftEnter"),i.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:r("Insert a soft break (a <code>&lt;br&gt;</code> element)"),keystroke:"Shift+Enter"}]})}}export{D as Enter,y as EnterCommand,h as EnterObserver,I as ShiftEnter,T as ShiftEnterCommand,p as _getCopyOnEnterAttributes};
@@ -1 +1 @@
1
- import{Plugin as t}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Clipboard as r}from"../../../../../@ckeditor_ckeditor5-clipboard@46.1.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{Enter as i,ShiftEnter as e}from"../../../../../@ckeditor_ckeditor5-enter@46.1.1/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import{SelectAll as o}from"../../../../../@ckeditor_ckeditor5-select-all@46.1.1/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js";import{Typing as s}from"../../../../../@ckeditor_ckeditor5-typing@46.1.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{Undo as m}from"../../../../../@ckeditor_ckeditor5-undo@46.1.1/node_modules/@ckeditor/ckeditor5-undo/dist/index.js";import{AccessibilityHelp as l}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";class d extends t{static get requires(){return[l,r,i,o,e,s,m]}static get pluginName(){return"Essentials"}static get isOfficialPlugin(){return!0}}export{d as Essentials};
1
+ import{Plugin as t}from"../../../../../@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Clipboard as r}from"../../../../../@ckeditor_ckeditor5-clipboard@47.3.0/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{Enter as i,ShiftEnter as e}from"../../../../../@ckeditor_ckeditor5-enter@47.3.0/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import{SelectAll as o}from"../../../../../@ckeditor_ckeditor5-select-all@47.3.0/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js";import{Typing as s}from"../../../../../@ckeditor_ckeditor5-typing@47.3.0/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{Undo as m}from"../../../../../@ckeditor_ckeditor5-undo@47.3.0/node_modules/@ckeditor/ckeditor5-undo/dist/index.js";import{AccessibilityHelp as l}from"../../../../../@ckeditor_ckeditor5-ui@47.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";class d extends t{static get requires(){return[l,r,i,o,e,s,m]}static get pluginName(){return"Essentials"}static get isOfficialPlugin(){return!0}}export{d as Essentials};
@@ -1,2 +1,2 @@
1
- import{Plugin as p,Command as _}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconFindReplace as w,IconPreviousArrow as x}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{Dialog as T,DropdownView as F,createDropdown as v,FormHeaderView as B,ButtonView as V,MenuBarMenuListItemButtonView as A,DialogViewPosition as I,CssTransitionDisablerMixin as E,View as g,ViewCollection as D,FocusCycler as O,submitHandler as S,CollapsibleView as P,SwitchButtonView as b,LabeledFieldView as M,createLabeledInputText as N}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{scrollViewportToShowTarget as H,Collection as m,uid as W,ObservableMixin as $,FocusTracker as L,KeystrokeHandler as U,isVisible as q,Rect as G}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{debounce as K}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/debounce.js";import{escapeRegExp as j}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/string/escapeRegExp.js";class z extends g{children;_findInputView;_replaceInputView;_findButtonView;_findPrevButtonView;_findNextButtonView;_advancedOptionsCollapsibleView;_matchCaseSwitchView;_wholeWordsOnlySwitchView;_replaceButtonView;_replaceAllButtonView;_inputsDivView;_actionButtonsDivView;_focusTracker;_keystrokes;_focusables;focusCycler;constructor(t){super(t);const e=t.t;this.children=this.createCollection(),this.set("matchCount",0),this.set("highlightOffset",0),this.set("isDirty",!1),this.set("_areCommandsEnabled",{}),this.set("_resultsCounterText",""),this.set("_matchCase",!1),this.set("_wholeWordsOnly",!1),this.bind("_searchResultsFound").to(this,"matchCount",this,"isDirty",(i,s)=>i>0&&!s),this._findInputView=this._createInputField(e("Find in text…")),this._findPrevButtonView=this._createButton({label:e("Previous result"),class:"ck-button-prev",icon:x,keystroke:"Shift+F3",tooltip:!0}),this._findNextButtonView=this._createButton({label:e("Next result"),class:"ck-button-next",icon:x,keystroke:"F3",tooltip:!0}),this._replaceInputView=this._createInputField(e("Replace with…"),"ck-labeled-field-replace"),this._inputsDivView=this._createInputsDiv(),this._matchCaseSwitchView=this._createMatchCaseSwitch(),this._wholeWordsOnlySwitchView=this._createWholeWordsOnlySwitch(),this._advancedOptionsCollapsibleView=this._createAdvancedOptionsCollapsible(),this._replaceAllButtonView=this._createButton({label:e("Replace all"),class:"ck-button-replaceall",withText:!0}),this._replaceButtonView=this._createButton({label:e("Replace"),class:"ck-button-replace",withText:!0}),this._findButtonView=this._createButton({label:e("Find"),class:"ck-button-find ck-button-action",withText:!0}),this._actionButtonsDivView=this._createActionButtonsDiv(),this._focusTracker=new L,this._keystrokes=new U,this._focusables=new D,this.focusCycler=new O({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this._keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.children.addMany([this._inputsDivView,this._advancedOptionsCollapsibleView,this._actionButtonsDivView]),this.setTemplate({tag:"form",attributes:{class:["ck","ck-find-and-replace-form"],tabindex:"-1"},children:this.children})}render(){super.render(),S({view:this}),this._initFocusCycling(),this._initKeystrokeHandling()}destroy(){super.destroy(),this._focusTracker.destroy(),this._keystrokes.destroy()}focus(t){t===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}reset(){this._findInputView.errorText=null,this.isDirty=!0}get _textToFind(){return this._findInputView.fieldView.element.value}get _textToReplace(){return this._replaceInputView.fieldView.element.value}_createInputsDiv(){const t=this.locale,e=t.t,i=new g(t);return this._findInputView.fieldView.on("input",()=>{this.isDirty=!0}),this._findPrevButtonView.delegate("execute").to(this,"findPrevious"),this._findNextButtonView.delegate("execute").to(this,"findNext"),this._findPrevButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",({findPrevious:s})=>s),this._findNextButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",({findNext:s})=>s),this._injectFindResultsCounter(),this._replaceInputView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replace:s},n)=>s&&n),this._replaceInputView.bind("infoText").to(this._replaceInputView,"isEnabled",this._replaceInputView,"isFocused",(s,n)=>s||!n?"":e("Tip: Find some text first in order to replace it.")),i.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__inputs"]},children:[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView]}),i}_onFindButtonExecute(){if(!this._textToFind){const t=this.t;this._findInputView.errorText=t("Text to find must not be empty.");return}this.isDirty=!1,this.fire("findNext",{searchText:this._textToFind,matchCase:this._matchCase,wholeWords:this._wholeWordsOnly})}_injectFindResultsCounter(){const t=this.locale,e=t.t,i=this.bindTemplate,s=new g(this.locale);this.bind("_resultsCounterText").to(this,"highlightOffset",this,"matchCount",(o,r)=>e("%0 of %1",[o,r])),s.setTemplate({tag:"span",attributes:{class:["ck","ck-results-counter",i.if("isDirty","ck-hidden")]},children:[{text:i.to("_resultsCounterText")}]});const n=()=>{const o=this._findInputView.fieldView.element;if(!o||!q(o))return;const r=new G(s.element).width,h=t.uiLanguageDirection==="ltr"?"paddingRight":"paddingLeft";r?o.style[h]=`calc( 2 * var(--ck-spacing-standard) + ${r}px )`:o.style[h]=""};this.on("change:_resultsCounterText",n,{priority:"low"}),this.on("change:isDirty",n,{priority:"low"}),this._findInputView.template.children[0].children.push(s)}_createAdvancedOptionsCollapsible(){const t=this.locale.t,e=new P(this.locale,[this._matchCaseSwitchView,this._wholeWordsOnlySwitchView]);return e.set({label:t("Advanced options"),isCollapsed:!0}),e}_createActionButtonsDiv(){const t=new g(this.locale);return this._replaceButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replace:e},i)=>e&&i),this._replaceAllButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replaceAll:e},i)=>e&&i),this._replaceButtonView.on("execute",()=>{this.fire("replace",{searchText:this._textToFind,replaceText:this._textToReplace})}),this._replaceAllButtonView.on("execute",()=>{this.fire("replaceAll",{searchText:this._textToFind,replaceText:this._textToReplace}),this.focus()}),this._findButtonView.on("execute",this._onFindButtonExecute.bind(this)),t.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__actions"]},children:[this._replaceAllButtonView,this._replaceButtonView,this._findButtonView]}),t}_createMatchCaseSwitch(){const t=this.locale.t,e=new b(this.locale);return e.set({label:t("Match case"),withText:!0}),e.bind("isOn").to(this,"_matchCase"),e.on("execute",()=>{this._matchCase=!this._matchCase,this.isDirty=!0}),e}_createWholeWordsOnlySwitch(){const t=this.locale.t,e=new b(this.locale);return e.set({label:t("Whole words only"),withText:!0}),e.bind("isOn").to(this,"_wholeWordsOnly"),e.on("execute",()=>{this._wholeWordsOnly=!this._wholeWordsOnly,this.isDirty=!0}),e}_initFocusCycling(){[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView,this._advancedOptionsCollapsibleView.buttonView,this._matchCaseSwitchView,this._wholeWordsOnlySwitchView,this._replaceAllButtonView,this._replaceButtonView,this._findButtonView].forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}_initKeystrokeHandling(){const t=i=>i.stopPropagation(),e=i=>{i.stopPropagation(),i.preventDefault()};this._keystrokes.listenTo(this.element),this._keystrokes.set("f3",i=>{e(i),this._findNextButtonView.fire("execute")}),this._keystrokes.set("shift+f3",i=>{e(i),this._findPrevButtonView.fire("execute")}),this._keystrokes.set("enter",i=>{const s=i.target;s===this._findInputView.fieldView.element?(this._areCommandsEnabled.findNext?this._findNextButtonView.fire("execute"):this._findButtonView.fire("execute"),e(i)):s===this._replaceInputView.fieldView.element&&!this.isDirty&&(this._replaceButtonView.fire("execute"),e(i))}),this._keystrokes.set("shift+enter",i=>{i.target===this._findInputView.fieldView.element&&(this._areCommandsEnabled.findPrevious?this._findPrevButtonView.fire("execute"):this._findButtonView.fire("execute"),e(i))}),this._keystrokes.set("arrowright",t),this._keystrokes.set("arrowleft",t),this._keystrokes.set("arrowup",t),this._keystrokes.set("arrowdown",t)}_createButton(t){const e=new V(this.locale);return e.set(t),e}_createInputField(t,e){const i=new M(this.locale,N);return i.label=t,i.class=e,i}}class Q extends p{static get requires(){return[T]}static get pluginName(){return"FindAndReplaceUI"}static get isOfficialPlugin(){return!0}formView;constructor(t){super(t),t.config.define("findAndReplace.uiType","dialog"),this.formView=null}init(){const t=this.editor,e=t.config.get("findAndReplace.uiType")==="dropdown",i=t.commands.get("find"),s=this.editor.t;t.ui.componentFactory.add("findAndReplace",()=>{let n;return e?(n=this._createDropdown(),n.bind("isEnabled").to(i)):n=this._createDialogButtonForToolbar(),t.keystrokes.set("Ctrl+F",(o,r)=>{if(i.isEnabled){if(n instanceof F){const h=n.buttonView;h.isOn||h.fire("execute")}else n.isOn?t.plugins.get("Dialog").view.focus():n.fire("execute");r()}}),n}),e||t.ui.componentFactory.add("menuBar:findAndReplace",()=>this._createDialogButtonForMenuBar()),t.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Find in the document"),keystroke:"CTRL+F"}]})}_createDropdown(){const t=this.editor,e=t.locale.t,i=v(t.locale);return i.once("change:isOpen",()=>{this.formView=this._createFormView(),this.formView.children.add(new B(t.locale,{label:e("Find and replace")}),0),i.panelView.children.add(this.formView)}),i.on("change:isOpen",(s,n,o)=>{o?this._setupFormView():this.fire("searchReseted")},{priority:"low"}),i.buttonView.set({icon:w,label:e("Find and replace"),keystroke:"CTRL+F",tooltip:!0}),i}_createDialogButtonForToolbar(){const t=this.editor,e=this._createButton(V),i=t.plugins.get("Dialog");return e.set({tooltip:!0}),e.bind("isOn").to(i,"id",s=>s==="findAndReplace"),e.on("execute",()=>{e.isOn?i.hide():this._showDialog()}),e}_createDialogButtonForMenuBar(){const t=this._createButton(A),e=this.editor.plugins.get("Dialog"),i=this.editor.plugins.get("Dialog");return t.set({role:"menuitemcheckbox",isToggleable:!0}),t.bind("isOn").to(i,"id",s=>s==="findAndReplace"),t.on("execute",()=>{if(e.id==="findAndReplace"){e.hide();return}this._showDialog()}),t}_createButton(t){const e=this.editor,i=e.commands.get("find"),s=new t(e.locale),n=e.locale.t;return s.bind("isEnabled").to(i),s.set({icon:w,label:n("Find and replace"),keystroke:"CTRL+F"}),s}_showDialog(){const t=this.editor,e=t.plugins.get("Dialog"),i=t.locale.t;this.formView||(this.formView=this._createFormView()),e.show({id:"findAndReplace",title:i("Find and replace"),content:this.formView,position:I.EDITOR_TOP_SIDE,onShow:()=>{this._setupFormView()},onHide:()=>{this.fire("searchReseted")}})}_createFormView(){const t=this.editor,e=new(E(z))(t.locale),i=t.commands,n=this.editor.plugins.get("FindAndReplaceEditing").state;e.bind("highlightOffset").to(n,"highlightedOffset"),e.listenTo(n.results,"change",()=>{e.matchCount=n.results.length});const o=i.get("findNext"),r=i.get("findPrevious"),h=i.get("replace"),a=i.get("replaceAll");return e.bind("_areCommandsEnabled").to(o,"isEnabled",r,"isEnabled",h,"isEnabled",a,"isEnabled",(l,d,u,f)=>({findNext:l,findPrevious:d,replace:u,replaceAll:f})),e.delegate("findNext","findPrevious","replace","replaceAll").to(this),e.on("change:isDirty",(l,d,u)=>{u&&this.fire("searchReseted")}),e}_setupFormView(){this.formView.disableCssTransitions(),this.formView.reset(),this.formView._findInputView.fieldView.select(),this.formView.enableCssTransitions()}}class Z extends _{_state;constructor(t,e){super(t),this.isEnabled=!0,this.affectsData=!1,this._state=e}execute(t,{matchCase:e,wholeWords:i}={}){const{editor:s}=this,{model:n}=s,o=s.plugins.get("FindAndReplaceUtils");let r,h="";typeof t=="string"?r=(...d)=>({results:o.findByTextCallback(t,{matchCase:e,wholeWords:i})(...d),searchText:t}):r=t;const a=r;r=(...d)=>{const u=a(...d);return u&&"searchText"in u&&(h=u.searchText),u};const l=n.document.getRootNames().reduce((d,u)=>o.updateFindResultFromRange(n.createRangeIn(n.document.getRoot(u)),n,r,d),null);return this._state.clear(n),this._state.results.addMany(l),this._state.highlightedResult=l.get(0),this._state.searchText=h,r&&(this._state.lastSearchCallback=r),this._state.matchCase=!!e,this._state.matchWholeWords=!!i,{results:l,findCallback:r}}}class J extends $(){constructor(t){super(),this.set("results",new m),this.set("highlightedResult",null),this.set("highlightedOffset",0),this.set("searchText",""),this.set("replaceText",""),this.set("lastSearchCallback",null),this.set("matchCase",!1),this.set("matchWholeWords",!1),this.results.on("change",(e,{removed:i,index:s})=>{if(Array.from(i).length){let n=!1;if(t.change(o=>{for(const r of i)this.highlightedResult===r&&(n=!0),t.markers.has(r.marker.name)&&o.removeMarker(r.marker)}),n){const o=s>=this.results.length?0:s;this.highlightedResult=this.results.get(o)}}}),this.on("change:highlightedResult",()=>{this.refreshHighlightOffset(t)})}clear(t){this.searchText="",t.change(e=>{if(this.highlightedResult){const i=this.highlightedResult.marker.name.split(":")[1],s=t.markers.get(`findResultHighlighted:${i}`);s&&e.removeMarker(s)}[...this.results].forEach(({marker:i})=>{e.removeMarker(i)})}),this.results.clear()}refreshHighlightOffset(t){const{highlightedResult:e,results:i}=this;e?this.highlightedOffset=R(t,[...i]).indexOf(e)+1:this.highlightedOffset=0}}function R(c,t){const e={before:-1,same:0,after:1,different:1};return c.document.getRootNames().flatMap(i=>t.filter(s=>s.marker.getStart().root.rootName===i).sort((s,n)=>e[s.marker.getStart().compareWith(n.marker.getStart())]))}class k extends _{_state;constructor(t,e){super(t),this.isEnabled=!0,this._state=e,this._isEnabledBasedOnSelection=!1}_replace(t,e){const{model:i}=this.editor,s=e.marker.getRange();i.canEditAt(s)&&i.change(n=>{if(s.root.rootName==="$graveyard"){this._state.results.remove(e);return}let o={};for(const r of s.getItems())if(r.is("$text")||r.is("$textProxy")){o=r.getAttributes();break}i.insertContent(n.createText(t,o),s),this._state.results.has(e)&&this._state.results.remove(e)})}}class X extends k{execute(t,e){const i=Math.max(this._state.highlightedOffset-1,0);if(this._replace(t,e),this._state.results.length){const s=R(this.editor.model,[...this._state.results]);this._state.highlightedResult=s[i%s.length]}}}class Y extends k{execute(t,e){const{editor:i}=this,{model:s}=i,n=i.plugins.get("FindAndReplaceUtils"),o=e instanceof m?e:s.document.getRootNames().reduce((r,h)=>n.updateFindResultFromRange(s.createRangeIn(s.document.getRoot(h)),s,n.findByTextCallback(e,this._state),r),null);o.length&&s.change(()=>{[...o].forEach(r=>{this._replace(t,r)})})}}class C extends _{_state;constructor(t,e){super(t),this.affectsData=!1,this._state=e,this.isEnabled=!1,this.listenTo(this._state.results,"change",()=>{this.isEnabled=this._state.results.length>1})}refresh(){this.isEnabled=this._state.results.length>1}execute(){const t=this._state.results,e=t.getIndex(this._state.highlightedResult),i=e+1>=t.length?0:e+1;this._state.highlightedResult=this._state.results.get(i)}}class ee extends C{execute(){const e=this._state.results.getIndex(this._state.highlightedResult),i=e-1<0?this._state.results.length-1:e-1;this._state.highlightedResult=this._state.results.get(i)}}class te extends p{static get pluginName(){return"FindAndReplaceUtils"}static get isOfficialPlugin(){return!0}updateFindResultFromRange(t,e,i,s){const n=s||new m,o=r=>n.find(h=>{const{marker:a}=h,l=a.getRange(),d=r.getRange();return l.isEqual(d)});return e.change(r=>{[...t].forEach(({type:h,item:a})=>{if(h==="elementStart"&&e.schema.checkChild(a,"$text")){let l=i({item:a,text:this.rangeToText(e.createRangeIn(a))});if(!l)return;"results"in l&&(l=l.results),l.forEach(d=>{const u=`findResult:${W()}`,f=r.addMarker(u,{usingOperation:!1,affectsData:!1,range:r.createRange(r.createPositionAt(a,d.start),r.createPositionAt(a,d.end))}),y=ie(n,f);o(f)||n.add({id:u,label:d.label,marker:f},y)})}})}),n}rangeToText(t){return Array.from(t.getItems({shallow:!0})).reduce((e,i)=>i.is("$text")||i.is("$textProxy")?e+i.data:`${e}
2
- `,"")}findByTextCallback(t,e){let i="gu";e.matchCase||(i+="i");let s=`(${j(t)})`;if(e.wholeWords){const r="[^a-zA-ZÀ-ɏḀ-ỿ]";new RegExp("^"+r).test(t)||(s=`(^|${r}|_)${s}`),new RegExp(r+"$").test(t)||(s=`${s}(?=_|${r}|$)`)}const n=new RegExp(s,i);function o({text:r}){return[...r.matchAll(n)].map(se)}return o}}function ie(c,t){const e=c.find(({marker:i})=>t.getStart().isBefore(i.getStart()));return e?c.getIndex(e):c.length}function se(c){const t=c.length-1;let e=c.index;return c.length===3&&(e+=c[1].length),{label:c[t],start:e,end:e+c[t].length}}const ne="ck-find-result_selected";class re extends p{static get requires(){return[te]}static get pluginName(){return"FindAndReplaceEditing"}static get isOfficialPlugin(){return!0}state;init(){this.state=new J(this.editor.model),this.set("_isSearchActive",!1),this._defineConverters(),this._defineCommands(),this.listenTo(this.state,"change:highlightedResult",(i,s,n,o)=>{const{model:r}=this.editor;r.change(h=>{if(o){const a=o.marker.name.split(":")[1],l=r.markers.get(`findResultHighlighted:${a}`);l&&h.removeMarker(l)}if(n){const a=n.marker.name.split(":")[1];h.addMarker(`findResultHighlighted:${a}`,{usingOperation:!1,affectsData:!1,range:n.marker.getRange()})}})});const e=K(((i,s,n)=>{if(n){const o=this.editor.editing.view.domConverter,r=this.editor.editing.mapper.toViewRange(n.marker.getRange());H({target:o.viewRangeToDom(r),viewportOffset:40})}}).bind(this),32);this.listenTo(this.state,"change:highlightedResult",e,{priority:"low"}),this.listenTo(this.editor,"destroy",e.cancel),this.on("change:_isSearchActive",(i,s,n)=>{n?this.listenTo(this.editor.model.document,"change:data",this._onDocumentChange):this.stopListening(this.editor.model.document,"change:data",this._onDocumentChange)})}find(t,e){return this._isSearchActive=!0,this.editor.execute("find",t,e),this.state.results}stop(){this.state.clear(this.editor.model),this._isSearchActive=!1}_defineCommands(){this.editor.commands.add("find",new Z(this.editor,this.state)),this.editor.commands.add("findNext",new C(this.editor,this.state)),this.editor.commands.add("findPrevious",new ee(this.editor,this.state)),this.editor.commands.add("replace",new X(this.editor,this.state)),this.editor.commands.add("replaceAll",new Y(this.editor,this.state))}_defineConverters(){const{editor:t}=this;t.conversion.for("editingDowncast").markerToHighlight({model:"findResult",view:({markerName:e})=>{const[,i]=e.split(":");return{name:"span",classes:["ck-find-result"],attributes:{"data-find-result":i}}}}),t.conversion.for("editingDowncast").markerToHighlight({model:"findResultHighlighted",view:({markerName:e})=>{const[,i]=e.split(":");return{name:"span",classes:[ne],attributes:{"data-find-result":i}}}})}_onDocumentChange=()=>{const t=new Set,e=new Set,i=this.editor.model,{results:s}=this.state,n=i.document.differ.getChanges(),o=i.document.differ.getChangedMarkers();n.forEach(a=>{a.position&&(a.name==="$text"||a.position.nodeAfter&&i.schema.isInline(a.position.nodeAfter)?(t.add(a.position.parent),[...i.markers.getMarkersAtPosition(a.position)].forEach(l=>{e.add(l.name)})):a.type==="insert"&&a.position.nodeAfter&&t.add(a.position.nodeAfter))}),o.forEach(({name:a,data:{newRange:l}})=>{l&&l.start.root.rootName==="$graveyard"&&e.add(a)}),t.forEach(a=>{[...i.markers.getMarkersIntersectingRange(i.createRangeIn(a))].forEach(d=>e.add(d.name))}),e.forEach(a=>{s.has(a)&&(s.get(a)===this.state.highlightedResult&&(this.state.highlightedResult=null),s.remove(a))});const r=[],h=this.editor.plugins.get("FindAndReplaceUtils");t.forEach(a=>{const l=h.updateFindResultFromRange(i.createRangeOn(a),i,this.state.lastSearchCallback,s);r.push(...l)}),o.forEach(a=>{if(a.data.newRange){const l=h.updateFindResultFromRange(a.data.newRange,i,this.state.lastSearchCallback,s);r.push(...l)}}),!this.state.highlightedResult&&r.length?this.state.highlightedResult=r[0]:this.state.refreshHighlightOffset(i)}}class ue extends p{static get requires(){return[re,Q]}static get pluginName(){return"FindAndReplace"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.plugins.get("FindAndReplaceUI"),e=this.editor.plugins.get("FindAndReplaceEditing"),i=e.state;t.on("findNext",(s,n)=>{n?(i.searchText=n.searchText,e.find(n.searchText,n)):this.editor.execute("findNext")}),t.on("findPrevious",(s,n)=>{n&&i.searchText!==n.searchText?e.find(n.searchText):this.editor.execute("findPrevious")}),t.on("replace",(s,n)=>{i.searchText!==n.searchText&&e.find(n.searchText);const o=i.highlightedResult;o&&this.editor.execute("replace",n.replaceText,o)}),t.on("replaceAll",(s,n)=>{i.searchText!==n.searchText&&e.find(n.searchText),this.editor.execute("replaceAll",n.replaceText,i.results)}),t.on("searchReseted",()=>{i.clear(this.editor.model),e.stop()})}}export{ue as FindAndReplace,re as FindAndReplaceEditing,z as FindAndReplaceFormView,J as FindAndReplaceState,Q as FindAndReplaceUI,te as FindAndReplaceUtils,Z as FindCommand,C as FindNextCommand,ee as FindPreviousCommand,k as FindReplaceCommandBase,Y as ReplaceAllCommand,X as ReplaceCommand,R as _sortFindResultsByMarkerPositions};
1
+ import{Plugin as p,Command as _}from"../../../../../@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconFindReplace as w,IconPreviousArrow as x}from"../../../../../@ckeditor_ckeditor5-icons@47.3.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{Dialog as F,DropdownView as T,createDropdown as v,FormHeaderView as B,ButtonView as R,MenuBarMenuListItemButtonView as A,DialogViewPosition as I,CssTransitionDisablerMixin as E,View as g,ViewCollection as D,FocusCycler as O,submitHandler as S,CollapsibleView as P,SwitchButtonView as b,LabeledFieldView as M,createLabeledInputText as N}from"../../../../../@ckeditor_ckeditor5-ui@47.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{scrollViewportToShowTarget as H,Collection as m,uid as W,ObservableMixin as $,FocusTracker as L,KeystrokeHandler as U,isVisible as q,Rect as G}from"../../../../../@ckeditor_ckeditor5-utils@47.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{debounce as K}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/debounce.js";import{escapeRegExp as j}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/string/escapeRegExp.js";class z extends g{children;_findInputView;_replaceInputView;_findButtonView;_findPrevButtonView;_findNextButtonView;_advancedOptionsCollapsibleView;_matchCaseSwitchView;_wholeWordsOnlySwitchView;_replaceButtonView;_replaceAllButtonView;_inputsDivView;_actionButtonsDivView;_focusTracker;_keystrokes;_focusables;focusCycler;constructor(t){super(t);const e=t.t;this.children=this.createCollection(),this.set("matchCount",0),this.set("highlightOffset",0),this.set("isDirty",!1),this.set("_areCommandsEnabled",{}),this.set("_resultsCounterText",""),this.set("_matchCase",!1),this.set("_wholeWordsOnly",!1),this.bind("_searchResultsFound").to(this,"matchCount",this,"isDirty",(i,s)=>i>0&&!s),this._findInputView=this._createInputField(e("Find in text…")),this._findPrevButtonView=this._createButton({label:e("Previous result"),class:"ck-button-prev",icon:x,keystroke:"Shift+F3",tooltip:!0}),this._findNextButtonView=this._createButton({label:e("Next result"),class:"ck-button-next",icon:x,keystroke:"F3",tooltip:!0}),this._replaceInputView=this._createInputField(e("Replace with…"),"ck-labeled-field-replace"),this._inputsDivView=this._createInputsDiv(),this._matchCaseSwitchView=this._createMatchCaseSwitch(),this._wholeWordsOnlySwitchView=this._createWholeWordsOnlySwitch(),this._advancedOptionsCollapsibleView=this._createAdvancedOptionsCollapsible(),this._replaceAllButtonView=this._createButton({label:e("Replace all"),class:"ck-button-replaceall",withText:!0}),this._replaceButtonView=this._createButton({label:e("Replace"),class:"ck-button-replace",withText:!0}),this._findButtonView=this._createButton({label:e("Find"),class:"ck-button-find ck-button-action",withText:!0}),this._actionButtonsDivView=this._createActionButtonsDiv(),this._focusTracker=new L,this._keystrokes=new U,this._focusables=new D,this.focusCycler=new O({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this._keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.children.addMany([this._inputsDivView,this._advancedOptionsCollapsibleView,this._actionButtonsDivView]),this.setTemplate({tag:"form",attributes:{class:["ck","ck-find-and-replace-form"],tabindex:"-1"},children:this.children})}render(){super.render(),S({view:this}),this._initFocusCycling(),this._initKeystrokeHandling()}destroy(){super.destroy(),this._focusTracker.destroy(),this._keystrokes.destroy()}focus(t){t===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}reset(){this._findInputView.errorText=null,this.isDirty=!0}get _textToFind(){return this._findInputView.fieldView.element.value}get _textToReplace(){return this._replaceInputView.fieldView.element.value}_createInputsDiv(){const t=this.locale,e=t.t,i=new g(t);return this._findInputView.fieldView.on("input",()=>{this.isDirty=!0}),this._findPrevButtonView.delegate("execute").to(this,"findPrevious"),this._findNextButtonView.delegate("execute").to(this,"findNext"),this._findPrevButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",({findPrevious:s})=>s),this._findNextButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",({findNext:s})=>s),this._injectFindResultsCounter(),this._replaceInputView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replace:s},n)=>s&&n),this._replaceInputView.bind("infoText").to(this._replaceInputView,"isEnabled",this._replaceInputView,"isFocused",(s,n)=>s||!n?"":e("Tip: Find some text first in order to replace it.")),i.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__inputs"]},children:[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView]}),i}_onFindButtonExecute(){if(!this._textToFind){const t=this.t;this._findInputView.errorText=t("Text to find must not be empty.");return}this.isDirty=!1,this.fire("findNext",{searchText:this._textToFind,matchCase:this._matchCase,wholeWords:this._wholeWordsOnly})}_injectFindResultsCounter(){const t=this.locale,e=t.t,i=this.bindTemplate,s=new g(this.locale);this.bind("_resultsCounterText").to(this,"highlightOffset",this,"matchCount",(o,r)=>e("%0 of %1",[o,r])),s.setTemplate({tag:"span",attributes:{class:["ck","ck-results-counter",i.if("isDirty","ck-hidden")]},children:[{text:i.to("_resultsCounterText")}]});const n=()=>{const o=this._findInputView.fieldView.element;if(!o||!q(o))return;const r=new G(s.element).width,h=t.uiLanguageDirection==="ltr"?"paddingRight":"paddingLeft";r?o.style[h]=`calc( 2 * var(--ck-spacing-standard) + ${r}px )`:o.style[h]=""};this.on("change:_resultsCounterText",n,{priority:"low"}),this.on("change:isDirty",n,{priority:"low"}),this._findInputView.template.children[0].children.push(s)}_createAdvancedOptionsCollapsible(){const t=this.locale.t,e=new P(this.locale,[this._matchCaseSwitchView,this._wholeWordsOnlySwitchView]);return e.set({label:t("Advanced options"),isCollapsed:!0}),e}_createActionButtonsDiv(){const t=new g(this.locale);return this._replaceButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replace:e},i)=>e&&i),this._replaceAllButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replaceAll:e},i)=>e&&i),this._replaceButtonView.on("execute",()=>{this.fire("replace",{searchText:this._textToFind,replaceText:this._textToReplace})}),this._replaceAllButtonView.on("execute",()=>{this.fire("replaceAll",{searchText:this._textToFind,replaceText:this._textToReplace}),this.focus()}),this._findButtonView.on("execute",this._onFindButtonExecute.bind(this)),t.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__actions"]},children:[this._replaceAllButtonView,this._replaceButtonView,this._findButtonView]}),t}_createMatchCaseSwitch(){const t=this.locale.t,e=new b(this.locale);return e.set({label:t("Match case"),withText:!0}),e.bind("isOn").to(this,"_matchCase"),e.on("execute",()=>{this._matchCase=!this._matchCase,this.isDirty=!0}),e}_createWholeWordsOnlySwitch(){const t=this.locale.t,e=new b(this.locale);return e.set({label:t("Whole words only"),withText:!0}),e.bind("isOn").to(this,"_wholeWordsOnly"),e.on("execute",()=>{this._wholeWordsOnly=!this._wholeWordsOnly,this.isDirty=!0}),e}_initFocusCycling(){[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView,this._advancedOptionsCollapsibleView.buttonView,this._matchCaseSwitchView,this._wholeWordsOnlySwitchView,this._replaceAllButtonView,this._replaceButtonView,this._findButtonView].forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}_initKeystrokeHandling(){const t=i=>i.stopPropagation(),e=i=>{i.stopPropagation(),i.preventDefault()};this._keystrokes.listenTo(this.element),this._keystrokes.set("f3",i=>{e(i),this._findNextButtonView.fire("execute")}),this._keystrokes.set("shift+f3",i=>{e(i),this._findPrevButtonView.fire("execute")}),this._keystrokes.set("enter",i=>{const s=i.target;s===this._findInputView.fieldView.element?(this._areCommandsEnabled.findNext?this._findNextButtonView.fire("execute"):this._findButtonView.fire("execute"),e(i)):s===this._replaceInputView.fieldView.element&&!this.isDirty&&(this._replaceButtonView.fire("execute"),e(i))}),this._keystrokes.set("shift+enter",i=>{i.target===this._findInputView.fieldView.element&&(this._areCommandsEnabled.findPrevious?this._findPrevButtonView.fire("execute"):this._findButtonView.fire("execute"),e(i))}),this._keystrokes.set("arrowright",t),this._keystrokes.set("arrowleft",t),this._keystrokes.set("arrowup",t),this._keystrokes.set("arrowdown",t)}_createButton(t){const e=new R(this.locale);return e.set(t),e}_createInputField(t,e){const i=new M(this.locale,N);return i.label=t,i.class=e,i}}class Q extends p{static get requires(){return[F]}static get pluginName(){return"FindAndReplaceUI"}static get isOfficialPlugin(){return!0}formView;constructor(t){super(t),t.config.define("findAndReplace.uiType","dialog"),this.formView=null}init(){const t=this.editor,e=t.config.get("findAndReplace.uiType")==="dropdown",i=t.commands.get("find"),s=this.editor.t;t.ui.componentFactory.add("findAndReplace",()=>{let n;return e?(n=this._createDropdown(),n.bind("isEnabled").to(i)):n=this._createDialogButtonForToolbar(),t.keystrokes.set("Ctrl+F",(o,r)=>{if(i.isEnabled){if(n instanceof T){const h=n.buttonView;h.isOn||h.fire("execute")}else n.isOn?t.plugins.get("Dialog").view.focus():n.fire("execute");r()}}),n}),e||t.ui.componentFactory.add("menuBar:findAndReplace",()=>this._createDialogButtonForMenuBar()),t.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Find in the document"),keystroke:"CTRL+F"}]})}_createDropdown(){const t=this.editor,e=t.locale.t,i=v(t.locale);return i.once("change:isOpen",()=>{this.formView=this._createFormView(),this.formView.children.add(new B(t.locale,{label:e("Find and replace")}),0),i.panelView.children.add(this.formView)}),i.on("change:isOpen",(s,n,o)=>{o?this._setupFormView():this.fire("searchReseted")},{priority:"low"}),i.buttonView.set({icon:w,label:e("Find and replace"),keystroke:"CTRL+F",tooltip:!0}),i}_createDialogButtonForToolbar(){const t=this.editor,e=this._createButton(R),i=t.plugins.get("Dialog");return e.set({tooltip:!0}),e.bind("isOn").to(i,"id",s=>s==="findAndReplace"),e.on("execute",()=>{e.isOn?i.hide():this._showDialog()}),e}_createDialogButtonForMenuBar(){const t=this._createButton(A),e=this.editor.plugins.get("Dialog"),i=this.editor.plugins.get("Dialog");return t.set({role:"menuitemcheckbox",isToggleable:!0}),t.bind("isOn").to(i,"id",s=>s==="findAndReplace"),t.on("execute",()=>{if(e.id==="findAndReplace"){e.hide();return}this._showDialog()}),t}_createButton(t){const e=this.editor,i=e.commands.get("find"),s=new t(e.locale),n=e.locale.t;return s.bind("isEnabled").to(i),s.set({icon:w,label:n("Find and replace"),keystroke:"CTRL+F"}),s}_showDialog(){const t=this.editor,e=t.plugins.get("Dialog"),i=t.locale.t;this.formView||(this.formView=this._createFormView()),e.show({id:"findAndReplace",title:i("Find and replace"),content:this.formView,position:I.EDITOR_TOP_SIDE,onShow:()=>{this._setupFormView()},onHide:()=>{this.fire("searchReseted")}})}_createFormView(){const t=this.editor,e=new(E(z))(t.locale),i=t.commands,n=this.editor.plugins.get("FindAndReplaceEditing").state;e.bind("highlightOffset").to(n,"highlightedOffset"),e.listenTo(n.results,"change",()=>{e.matchCount=n.results.length});const o=i.get("findNext"),r=i.get("findPrevious"),h=i.get("replace"),a=i.get("replaceAll");return e.bind("_areCommandsEnabled").to(o,"isEnabled",r,"isEnabled",h,"isEnabled",a,"isEnabled",(l,d,u,f)=>({findNext:l,findPrevious:d,replace:u,replaceAll:f})),e.delegate("findNext","findPrevious","replace","replaceAll").to(this),e.on("change:isDirty",(l,d,u)=>{u&&this.fire("searchReseted")}),e}_setupFormView(){this.formView.disableCssTransitions(),this.formView.reset(),this.formView._findInputView.fieldView.select(),this.formView.enableCssTransitions()}}class Z extends _{_state;constructor(t,e){super(t),this.isEnabled=!0,this.affectsData=!1,this._state=e}execute(t,{matchCase:e,wholeWords:i}={}){const{editor:s}=this,{model:n}=s,o=s.plugins.get("FindAndReplaceUtils");let r,h="";typeof t=="string"?r=(...d)=>({results:o.findByTextCallback(t,{matchCase:e,wholeWords:i})(...d),searchText:t}):r=t;const a=r;r=(...d)=>{const u=a(...d);return u&&"searchText"in u&&(h=u.searchText),u};const l=n.document.getRootNames().reduce((d,u)=>o.updateFindResultFromRange(n.createRangeIn(n.document.getRoot(u)),n,r,d),null);return this._state.clear(n),this._state.results.addMany(l),this._state.highlightedResult=l.get(0),this._state.searchText=h,r&&(this._state.lastSearchCallback=r),this._state.matchCase=!!e,this._state.matchWholeWords=!!i,{results:l,findCallback:r}}}class J extends $(){constructor(t){super(),this.set("results",new m),this.set("highlightedResult",null),this.set("highlightedOffset",0),this.set("searchText",""),this.set("replaceText",""),this.set("lastSearchCallback",null),this.set("matchCase",!1),this.set("matchWholeWords",!1),this.results.on("change",(e,{removed:i,index:s})=>{if(Array.from(i).length){let n=!1;if(t.change(o=>{for(const r of i)this.highlightedResult===r&&(n=!0),t.markers.has(r.marker.name)&&o.removeMarker(r.marker)}),n){const o=s>=this.results.length?0:s;this.highlightedResult=this.results.get(o)}}}),this.on("change:highlightedResult",()=>{this.refreshHighlightOffset(t)})}clear(t){this.searchText="",t.change(e=>{if(this.highlightedResult){const i=this.highlightedResult.marker.name.split(":")[1],s=t.markers.get(`findResultHighlighted:${i}`);s&&e.removeMarker(s)}[...this.results].forEach(({marker:i})=>{e.removeMarker(i)})}),this.results.clear()}refreshHighlightOffset(t){const{highlightedResult:e,results:i}=this;e?this.highlightedOffset=V(t,[...i]).indexOf(e)+1:this.highlightedOffset=0}}function V(c,t){const e={before:-1,same:0,after:1,different:1};return c.document.getRootNames().flatMap(i=>t.filter(s=>s.marker.getStart().root.rootName===i).sort((s,n)=>e[s.marker.getStart().compareWith(n.marker.getStart())]))}class k extends _{_state;constructor(t,e){super(t),this.isEnabled=!0,this._state=e,this._isEnabledBasedOnSelection=!1}_replace(t,e){const{model:i}=this.editor,s=e.marker.getRange();i.canEditAt(s)&&i.change(n=>{if(s.root.rootName==="$graveyard"){this._state.results.remove(e);return}let o={};for(const r of s.getItems())if(r.is("$text")||r.is("$textProxy")){o=r.getAttributes();break}i.insertContent(n.createText(t,o),s),this._state.results.has(e)&&this._state.results.remove(e)})}}class X extends k{execute(t,e){const i=Math.max(this._state.highlightedOffset-1,0);if(this._replace(t,e),this._state.results.length){const s=V(this.editor.model,[...this._state.results]);this._state.highlightedResult=s[i%s.length]}}}class Y extends k{execute(t,e){const{editor:i}=this,{model:s}=i,n=i.plugins.get("FindAndReplaceUtils"),o=e instanceof m?e:s.document.getRootNames().reduce((r,h)=>n.updateFindResultFromRange(s.createRangeIn(s.document.getRoot(h)),s,n.findByTextCallback(e,this._state),r),null);o.length&&s.change(()=>{[...o].forEach(r=>{this._replace(t,r)})})}}class C extends _{_state;constructor(t,e){super(t),this.affectsData=!1,this._state=e,this.isEnabled=!1,this.listenTo(this._state.results,"change",()=>{this.isEnabled=this._state.results.length>1})}refresh(){this.isEnabled=this._state.results.length>1}execute(){const t=this._state.results,e=t.getIndex(this._state.highlightedResult),i=e+1>=t.length?0:e+1;this._state.highlightedResult=this._state.results.get(i)}}class ee extends C{execute(){const e=this._state.results.getIndex(this._state.highlightedResult),i=e-1<0?this._state.results.length-1:e-1;this._state.highlightedResult=this._state.results.get(i)}}class te extends p{static get pluginName(){return"FindAndReplaceUtils"}static get isOfficialPlugin(){return!0}updateFindResultFromRange(t,e,i,s){const n=s||new m,o=r=>n.find(h=>{const{marker:a}=h,l=a.getRange(),d=r.getRange();return l.isEqual(d)});return e.change(r=>{[...t].forEach(({type:h,item:a})=>{if(h==="elementStart"&&e.schema.checkChild(a,"$text")){let l=i({item:a,text:this.rangeToText(e.createRangeIn(a))});if(!l)return;"results"in l&&(l=l.results),l.forEach(d=>{const u=`findResult:${W()}`,f=r.addMarker(u,{usingOperation:!1,affectsData:!1,range:r.createRange(r.createPositionAt(a,d.start),r.createPositionAt(a,d.end))}),y=ie(n,f);o(f)||n.add({id:u,label:d.label,marker:f},y)})}})}),n}rangeToText(t){return Array.from(t.getItems({shallow:!0})).reduce((e,i)=>i.is("$text")||i.is("$textProxy")?e+i.data:`${e}
2
+ `,"")}findByTextCallback(t,e){let i="gu";e.matchCase||(i+="i");let s=`(${j(t)})`;if(e.wholeWords){const r="[^a-zA-ZÀ-ɏḀ-ỿ]";new RegExp("^"+r).test(t)||(s=`(^|${r}|_)${s}`),new RegExp(r+"$").test(t)||(s=`${s}(?=_|${r}|$)`)}const n=new RegExp(s,i);function o({text:r}){return[...r.matchAll(n)].map(se)}return o}}function ie(c,t){const e=c.find(({marker:i})=>t.getStart().isBefore(i.getStart()));return e?c.getIndex(e):c.length}function se(c){const t=c.length-1;let e=c.index;return c.length===3&&(e+=c[1].length),{label:c[t],start:e,end:e+c[t].length}}const ne="ck-find-result_selected";class re extends p{static get requires(){return[te]}static get pluginName(){return"FindAndReplaceEditing"}static get licenseFeatureCode(){return"FAR"}static get isPremiumPlugin(){return!0}static get isOfficialPlugin(){return!0}state;init(){this.state=new J(this.editor.model),this.set("_isSearchActive",!1),this._defineConverters(),this._defineCommands(),this.listenTo(this.state,"change:highlightedResult",(i,s,n,o)=>{const{model:r}=this.editor;r.change(h=>{if(o){const a=o.marker.name.split(":")[1],l=r.markers.get(`findResultHighlighted:${a}`);l&&h.removeMarker(l)}if(n){const a=n.marker.name.split(":")[1];h.addMarker(`findResultHighlighted:${a}`,{usingOperation:!1,affectsData:!1,range:n.marker.getRange()})}})});const e=K(((i,s,n)=>{if(n){const o=this.editor.editing.view.domConverter,r=this.editor.editing.mapper.toViewRange(n.marker.getRange());H({target:o.viewRangeToDom(r),viewportOffset:40})}}).bind(this),32);this.listenTo(this.state,"change:highlightedResult",e,{priority:"low"}),this.listenTo(this.editor,"destroy",e.cancel),this.on("change:_isSearchActive",(i,s,n)=>{n?this.listenTo(this.editor.model.document,"change:data",this._onDocumentChange):this.stopListening(this.editor.model.document,"change:data",this._onDocumentChange)})}find(t,e){return this._isSearchActive=!0,this.editor.execute("find",t,e),this.state.results}stop(){this.state.clear(this.editor.model),this._isSearchActive=!1}_defineCommands(){this.editor.commands.add("find",new Z(this.editor,this.state)),this.editor.commands.add("findNext",new C(this.editor,this.state)),this.editor.commands.add("findPrevious",new ee(this.editor,this.state)),this.editor.commands.add("replace",new X(this.editor,this.state)),this.editor.commands.add("replaceAll",new Y(this.editor,this.state))}_defineConverters(){const{editor:t}=this;t.conversion.for("editingDowncast").markerToHighlight({model:"findResult",view:({markerName:e})=>{const[,i]=e.split(":");return{name:"span",classes:["ck-find-result"],attributes:{"data-find-result":i}}}}),t.conversion.for("editingDowncast").markerToHighlight({model:"findResultHighlighted",view:({markerName:e})=>{const[,i]=e.split(":");return{name:"span",classes:[ne],attributes:{"data-find-result":i}}}})}_onDocumentChange=()=>{const t=new Set,e=new Set,i=this.editor.model,{results:s}=this.state,n=i.document.differ.getChanges(),o=i.document.differ.getChangedMarkers();n.forEach(a=>{a.position&&(a.name==="$text"||a.position.nodeAfter&&i.schema.isInline(a.position.nodeAfter)?(t.add(a.position.parent),[...i.markers.getMarkersAtPosition(a.position)].forEach(l=>{e.add(l.name)})):a.type==="insert"&&a.position.nodeAfter&&t.add(a.position.nodeAfter))}),o.forEach(({name:a,data:{newRange:l}})=>{l&&l.start.root.rootName==="$graveyard"&&e.add(a)}),t.forEach(a=>{[...i.markers.getMarkersIntersectingRange(i.createRangeIn(a))].forEach(d=>e.add(d.name))}),e.forEach(a=>{s.has(a)&&(s.get(a)===this.state.highlightedResult&&(this.state.highlightedResult=null),s.remove(a))});const r=[],h=this.editor.plugins.get("FindAndReplaceUtils");t.forEach(a=>{const l=h.updateFindResultFromRange(i.createRangeOn(a),i,this.state.lastSearchCallback,s);r.push(...l)}),o.forEach(a=>{if(a.data.newRange){const l=h.updateFindResultFromRange(a.data.newRange,i,this.state.lastSearchCallback,s);r.push(...l)}}),!this.state.highlightedResult&&r.length?this.state.highlightedResult=r[0]:this.state.refreshHighlightOffset(i)}}class ue extends p{static get requires(){return[re,Q]}static get pluginName(){return"FindAndReplace"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.plugins.get("FindAndReplaceUI"),e=this.editor.plugins.get("FindAndReplaceEditing"),i=e.state;t.on("findNext",(s,n)=>{n?(i.searchText=n.searchText,e.find(n.searchText,n)):this.editor.execute("findNext")}),t.on("findPrevious",(s,n)=>{n&&i.searchText!==n.searchText?e.find(n.searchText):this.editor.execute("findPrevious")}),t.on("replace",(s,n)=>{i.searchText!==n.searchText&&e.find(n.searchText);const o=i.highlightedResult;o&&this.editor.execute("replace",n.replaceText,o)}),t.on("replaceAll",(s,n)=>{i.searchText!==n.searchText&&e.find(n.searchText),this.editor.execute("replaceAll",n.replaceText,i.results)}),t.on("searchReseted",()=>{i.clear(this.editor.model),e.stop()})}}export{ue as FindAndReplace,re as FindAndReplaceEditing,z as FindAndReplaceFormView,J as FindAndReplaceState,Q as FindAndReplaceUI,te as FindAndReplaceUtils,Z as FindCommand,C as FindNextCommand,ee as FindPreviousCommand,k as FindReplaceCommandBase,Y as ReplaceAllCommand,X as ReplaceCommand,V as _sortFindResultsByMarkerPositions};
@@ -1 +1 @@
1
- import{Plugin as h,Command as q}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{createDropdown as O,addListToDropdown as P,MenuBarMenuView as z,MenuBarMenuListView as L,MenuBarMenuListItemView as T,MenuBarMenuListItemButtonView as E,normalizeColorOptions as j,getLocalizedColorOptions as H,focusChildOnDropdownOpen as Y,ColorSelectorView as _,UIModel as D}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{CKEditorError as I,Collection as $}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{IconFontBackground as W,IconFontColor as Z,IconFontFamily as V,IconFontSize as N}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{addBackgroundStylesRules as J,isLengthStyleValue as Q,isPercentageStyleValue as X}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";class F extends q{attributeKey;constructor(e,o){super(e),this.attributeKey=o}refresh(){const e=this.editor.model,o=e.document;this.value=o.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(o.selection,this.attributeKey)}execute(e={}){const o=this.editor.model,i=o.document.selection,s=e.value,c=e.batch,l=r=>{if(i.isCollapsed)s?r.setSelectionAttribute(this.attributeKey,s):r.removeSelectionAttribute(this.attributeKey);else{const u=o.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const m of u)s?r.setAttribute(this.attributeKey,s,m):r.removeAttribute(this.attributeKey,m)}};c?o.enqueueChange(c,r=>{l(r)}):o.change(r=>{l(r)})}}const p="fontSize",g="fontFamily",w="fontColor",y="fontBackgroundColor";function U(t,e){const o={model:{key:t,values:[]},view:{},upcastAlso:{}};for(const n of e)o.model.values.push(n.model),o.view[n.model]=n.view,n.upcastAlso&&(o.upcastAlso[n.model]=n.upcastAlso);return o}function R(t){return e=>te(e.getStyle(t))}function G(t){return(e,{writer:o})=>o.createAttributeElement("span",{style:`${t}:${e}`},{priority:7})}function ee({dropdownView:t,colors:e,columns:o,removeButtonLabel:n,colorPickerLabel:i,documentColorsLabel:s,documentColorsCount:c,colorPickerViewConfig:l}){const r=t.locale,u=new _(r,{colors:e,columns:o,removeButtonLabel:n,colorPickerLabel:i,documentColorsLabel:s,documentColorsCount:c,colorPickerViewConfig:l});return t.colorSelectorView=u,t.panelView.children.add(u),u}function te(t){return t.replace(/\s/g,"")}class oe extends F{constructor(e){super(e,g)}}function M(t){return t.map(ne).filter(e=>e!==void 0)}function x(t){return t.replace(/["']/g,"").split(",").map(e=>e.trim())}function ne(t){if(typeof t=="object")return t;if(t==="default")return{title:"Default",model:void 0};if(typeof t=="string")return ie(t)}function ie(t){const e=x(t),o=e[0],n=e.map(re).join(", ");return{title:o,model:n,view:{name:"span",styles:{"font-family":n},priority:7}}}function re(t){return t=t.trim(),t.indexOf(" ")>0&&(t=`'${t}'`),t}class se extends h{static get pluginName(){return"FontFamilyEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(g,{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:g}),e.model.schema.setAttributeProperties(g,{isFormatting:!0,copyOnEnter:!0});const o=M(e.config.get("fontFamily.options")).filter(i=>i.model),n=U(g,o);e.config.get("fontFamily.supportAllValues")?(this._prepareAnyValueConverters(),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(n),e.commands.add(g,new oe(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:g,view:(o,{writer:n})=>n.createAttributeElement("span",{style:"font-family:"+o},{priority:7})}),e.conversion.for("upcast").elementToAttribute({model:{key:g,value:o=>o.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{face:/.*/}},model:{key:g,value:o=>o.getAttribute("face")}})}}class le extends h{static get pluginName(){return"FontFamilyUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,o=e.t,n=this._getLocalizedOptions(),i=e.commands.get(g),s=o("Font Family"),c=ae(n,i);e.ui.componentFactory.add(g,l=>{const r=O(l);return P(r,c,{role:"menu",ariaLabel:s}),r.buttonView.set({label:s,icon:V,tooltip:!0}),r.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",u=>{e.execute(u.source.commandName,{value:u.source.commandParam}),e.editing.view.focus()}),r}),e.ui.componentFactory.add(`menuBar:${g}`,l=>{const r=new z(l);r.buttonView.set({label:s,icon:V}),r.bind("isEnabled").to(i);const u=new L(l);for(const m of c){const a=new T(l,r),d=new E(l);d.set({role:"menuitemradio",isToggleable:!0}),d.bind(...Object.keys(m.model)).to(m.model),d.delegate("execute").to(r),d.on("execute",()=>{e.execute(m.model.commandName,{value:m.model.commandParam}),e.editing.view.focus()}),a.children.add(d),u.items.add(a)}return r.panelView.children.add(u),r})}_getLocalizedOptions(){const e=this.editor,o=e.t;return M(e.config.get(g).options).map(i=>(i.title==="Default"&&(i.title=o("Default")),i))}}function ae(t,e){const o=new $;for(const n of t){const i={type:"button",model:new D({commandName:g,commandParam:n.model,label:n.title,role:"menuitemradio",withText:!0})};i.model.bind("isOn").to(e,"value",s=>{if(s===n.model)return!0;if(!s||!n.model)return!1;const c=x(s)[0].toLowerCase(),l=x(n.model)[0].toLowerCase();return c===l}),n.view&&typeof n.view!="string"&&n.view.styles&&i.model.set("labelStyle",`font-family: ${n.view.styles["font-family"]}`),o.add(i)}return o}class Ne extends h{static get requires(){return[se,le]}static get pluginName(){return"FontFamily"}static get isOfficialPlugin(){return!0}}class ce extends F{constructor(e){super(e,p)}}function A(t){return t.map(e=>ue(e)).filter(e=>e!==void 0)}const k={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function ue(t){if(typeof t=="number"&&(t=String(t)),typeof t=="object"&&fe(t))return S(t);const e=de(t);if(e)return S(e);if(t==="default")return{model:void 0,title:"Default"};if(!pe(t))return me(t)}function me(t){return typeof t=="string"&&(t={title:t,model:`${parseFloat(t)}px`}),t.view={name:"span",styles:{"font-size":t.model}},S(t)}function S(t){return t.view&&typeof t.view!="string"&&!t.view.priority&&(t.view.priority=7),t}function de(t){return typeof t=="string"?k[t]:k[t.model]}function fe(t){return t.title&&t.model&&t.view}function pe(t){let e;if(typeof t=="object")if(t.model)e=parseFloat(t.model);else throw new I("font-size-invalid-definition",null,t);else e=parseFloat(t);return isNaN(e)}const B=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class ge extends h{static get pluginName(){return"FontSizeEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(p,{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:p}),e.model.schema.setAttributeProperties(p,{isFormatting:!0,copyOnEnter:!0});const o=e.config.get("fontSize.supportAllValues"),n=A(this.editor.config.get("fontSize.options")).filter(s=>s.model),i=U(p,n);o?(this._prepareAnyValueConverters(i),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(i),e.commands.add(p,new ce(e))}_prepareAnyValueConverters(e){const o=this.editor,n=e.model.values.filter(i=>!Q(String(i))&&!X(String(i)));if(n.length)throw new I("font-size-invalid-use-of-named-presets",null,{presets:n});o.conversion.for("downcast").attributeToElement({model:p,view:(i,{writer:s})=>{if(i)return s.createAttributeElement("span",{style:"font-size:"+i},{priority:7})}}),o.conversion.for("upcast").elementToAttribute({model:{key:p,value:i=>i.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:p,value:o=>{const n=o.getAttribute("size"),i=n[0]==="-"||n[0]==="+";let s=parseInt(n,10);i&&(s=3+s);const c=B.length-1,l=Math.min(Math.max(s,0),c);return B[l]}}})}}class be extends h{static get pluginName(){return"FontSizeUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,o=e.t,n=this._getLocalizedOptions(),i=e.commands.get(p),s=o("Font Size"),c=he(n,i);e.ui.componentFactory.add(p,l=>{const r=O(l);return P(r,c,{role:"menu",ariaLabel:s}),r.buttonView.set({label:s,icon:N,tooltip:!0}),r.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",u=>{e.execute(u.source.commandName,{value:u.source.commandParam}),e.editing.view.focus()}),r}),e.ui.componentFactory.add(`menuBar:${p}`,l=>{const r=new z(l);r.buttonView.set({label:s,icon:N}),r.bind("isEnabled").to(i);const u=new L(l);for(const m of c){const a=new T(l,r),d=new E(l);d.set({role:"menuitemradio",isToggleable:!0}),d.bind(...Object.keys(m.model)).to(m.model),d.delegate("execute").to(r),d.on("execute",()=>{e.execute(m.model.commandName,{value:m.model.commandParam}),e.editing.view.focus()}),a.children.add(d),u.items.add(a)}return r.panelView.children.add(u),r})}_getLocalizedOptions(){const e=this.editor,o=e.t,n={Default:o("Default"),Tiny:o("Tiny"),Small:o("Small"),Big:o("Big"),Huge:o("Huge")};return A(e.config.get(p).options).map(s=>{const c=n[s.title];return c&&c!=s.title&&(s=Object.assign({},s,{title:c})),s})}}function he(t,e){const o=new $;for(const n of t){const i={type:"button",model:new D({commandName:p,commandParam:n.model,label:n.title,class:"ck-fontsize-option",role:"menuitemradio",withText:!0})};n.view&&typeof n.view!="string"&&(n.view.styles&&i.model.set("labelStyle",`font-size:${n.view.styles["font-size"]}`),n.view.classes&&i.model.set("class",`${i.model.class} ${n.view.classes}`)),i.model.bind("isOn").to(e,"value",s=>s===n.model),o.add(i)}return o}class ke extends h{static get requires(){return[ge,be]}static get pluginName(){return"FontSize"}static get isOfficialPlugin(){return!0}normalizeSizeOptions(e){return A(e)}}class we extends F{constructor(e){super(e,w)}}class ye extends h{static get pluginName(){return"FontColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(w,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:w,value:R("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:w,value:o=>o.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:w,view:G("color")}),e.commands.add(w,new we(e)),e.model.schema.extend("$text",{allowAttributes:w}),e.model.schema.setAttributeProperties(w,{isFormatting:!0,copyOnEnter:!0})}}class K extends h{commandName;componentName;icon;dropdownLabel;columns;constructor(e,{commandName:o,componentName:n,icon:i,dropdownLabel:s}){super(e),this.commandName=o,this.componentName=n,this.icon=i,this.dropdownLabel=s,this.columns=e.config.get(`${this.componentName}.columns`)}init(){const e=this.editor,o=e.locale,n=o.t,i=e.commands.get(this.commandName),s=e.config.get(this.componentName),c=j(s.colors),l=H(o,c),r=s.documentColors,u=s.colorPicker!==!1;e.ui.componentFactory.add(this.componentName,m=>{const a=O(m);let d=!1;const f=ee({dropdownView:a,colors:l.map(b=>({label:b.label,color:b.model,options:{hasBorder:b.hasBorder}})),columns:this.columns,removeButtonLabel:n("Remove color"),colorPickerLabel:n("Color picker"),documentColorsLabel:r!==0?n("Document colors"):"",documentColorsCount:r===void 0?this.columns:r,colorPickerViewConfig:u?s.colorPicker||{}:!1});return f.bind("selectedColor").to(i,"value"),a.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),a.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),a.bind("isEnabled").to(i),f.on("execute",(b,v)=>{a.isOpen&&e.execute(this.commandName,{value:v.value,batch:this._undoStepBatch}),v.source!=="colorPicker"&&e.editing.view.focus(),v.source==="colorPickerSaveButton"&&(a.isOpen=!1)}),f.on("colorPicker:show",()=>{this._undoStepBatch=e.model.createBatch()}),f.on("colorPicker:cancel",()=>{this._undoStepBatch.operations.length&&(a.isOpen=!1,e.execute("undo",this._undoStepBatch)),e.editing.view.focus()}),a.on("change:isOpen",(b,v,C)=>{d||(d=!0,a.colorSelectorView.appendUI()),C&&(r!==0&&f.updateDocumentColors(e.model,this.componentName),f.updateSelectedColors(),f.showColorGridsFragment())}),Y(a,()=>a.colorSelectorView.colorGridsFragmentView.staticColorsGrid.items.find(b=>b.isOn)),a}),e.ui.componentFactory.add(`menuBar:${this.componentName}`,m=>{const a=new z(m);a.buttonView.set({label:this.dropdownLabel,icon:this.icon}),a.bind("isEnabled").to(i);let d=!1;const f=new _(m,{colors:l.map(b=>({label:b.label,color:b.model,options:{hasBorder:b.hasBorder}})),columns:this.columns,removeButtonLabel:n("Remove color"),colorPickerLabel:n("Color picker"),documentColorsLabel:r!==0?n("Document colors"):"",documentColorsCount:r===void 0?this.columns:r,colorPickerViewConfig:!1});return f.bind("selectedColor").to(i,"value"),f.delegate("execute").to(a),f.on("execute",(b,v)=>{e.execute(this.commandName,{value:v.value,batch:this._undoStepBatch}),e.editing.view.focus()}),a.on("change:isOpen",(b,v,C)=>{d||(d=!0,f.appendUI()),C&&(r!==0&&f.updateDocumentColors(e.model,this.componentName),f.updateSelectedColors(),f.showColorGridsFragment())}),a.panelView.children.add(f),a})}}class ve extends K{constructor(e){const o=e.locale.t;super(e,{commandName:w,componentName:w,icon:Z,dropdownLabel:o("Font Color")})}static get pluginName(){return"FontColorUI"}}class Be extends h{static get requires(){return[ye,ve]}static get pluginName(){return"FontColor"}static get isOfficialPlugin(){return!0}}class Fe extends F{constructor(e){super(e,y)}}class Ce extends h{static get pluginName(){return"FontBackgroundColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(y,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(J),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:y,value:R("background-color")}}),e.conversion.for("downcast").attributeToElement({model:y,view:G("background-color")}),e.commands.add(y,new Fe(e)),e.model.schema.extend("$text",{allowAttributes:y}),e.model.schema.setAttributeProperties(y,{isFormatting:!0,copyOnEnter:!0})}}class xe extends K{constructor(e){const o=e.locale.t;super(e,{commandName:y,componentName:y,icon:W,dropdownLabel:o("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class Pe extends h{static get requires(){return[Ce,xe]}static get pluginName(){return"FontBackgroundColor"}static get isOfficialPlugin(){return!0}}export{Pe as FontBackgroundColor,Fe as FontBackgroundColorCommand,Ce as FontBackgroundColorEditing,xe as FontBackgroundColorUI,Be as FontColor,we as FontColorCommand,ye as FontColorEditing,ve as FontColorUI,K as FontColorUIBase,F as FontCommand,Ne as FontFamily,oe as FontFamilyCommand,se as FontFamilyEditing,le as FontFamilyUI,ke as FontSize,ce as FontSizeCommand,ge as FontSizeEditing,be as FontSizeUI,ee as _addFontColorSelectorToDropdown,U as _buildFontDefinition,M as _normalizeFontFamilyOptions,A as _normalizeFontSizeOptions,G as _renderDowncastFontElement,R as _renderUpcastFontColorAttribute};
1
+ import{Plugin as h,Command as q}from"../../../../../@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{createDropdown as O,addListToDropdown as P,MenuBarMenuView as z,MenuBarMenuListView as L,MenuBarMenuListItemView as T,MenuBarMenuListItemButtonView as E,normalizeColorOptions as j,getLocalizedColorOptions as H,focusChildOnDropdownOpen as Y,ColorSelectorView as _,UIModel as D}from"../../../../../@ckeditor_ckeditor5-ui@47.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{CKEditorError as I,Collection as $}from"../../../../../@ckeditor_ckeditor5-utils@47.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{IconFontBackground as W,IconFontColor as Z,IconFontFamily as V,IconFontSize as N}from"../../../../../@ckeditor_ckeditor5-icons@47.3.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{addBackgroundStylesRules as J,isLengthStyleValue as Q,isPercentageStyleValue as X}from"../../../../../@ckeditor_ckeditor5-engine@47.3.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";class F extends q{attributeKey;constructor(e,o){super(e),this.attributeKey=o}refresh(){const e=this.editor.model,o=e.document;this.value=o.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(o.selection,this.attributeKey)}execute(e={}){const o=this.editor.model,i=o.document.selection,s=e.value,c=e.batch,l=r=>{if(i.isCollapsed)s?r.setSelectionAttribute(this.attributeKey,s):r.removeSelectionAttribute(this.attributeKey);else{const u=o.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const m of u)s?r.setAttribute(this.attributeKey,s,m):r.removeAttribute(this.attributeKey,m)}};c?o.enqueueChange(c,r=>{l(r)}):o.change(r=>{l(r)})}}const p="fontSize",g="fontFamily",w="fontColor",y="fontBackgroundColor";function U(t,e){const o={model:{key:t,values:[]},view:{},upcastAlso:{}};for(const n of e)o.model.values.push(n.model),o.view[n.model]=n.view,n.upcastAlso&&(o.upcastAlso[n.model]=n.upcastAlso);return o}function R(t){return e=>te(e.getStyle(t))}function G(t){return(e,{writer:o})=>o.createAttributeElement("span",{style:`${t}:${e}`},{priority:7})}function ee({dropdownView:t,colors:e,columns:o,removeButtonLabel:n,colorPickerLabel:i,documentColorsLabel:s,documentColorsCount:c,colorPickerViewConfig:l}){const r=t.locale,u=new _(r,{colors:e,columns:o,removeButtonLabel:n,colorPickerLabel:i,documentColorsLabel:s,documentColorsCount:c,colorPickerViewConfig:l});return t.colorSelectorView=u,t.panelView.children.add(u),u}function te(t){return t.replace(/\s/g,"")}class oe extends F{constructor(e){super(e,g)}}function M(t){return t.map(ne).filter(e=>e!==void 0)}function x(t){return t.replace(/["']/g,"").split(",").map(e=>e.trim())}function ne(t){if(typeof t=="object")return t;if(t==="default")return{title:"Default",model:void 0};if(typeof t=="string")return ie(t)}function ie(t){const e=x(t),o=e[0],n=e.map(re).join(", ");return{title:o,model:n,view:{name:"span",styles:{"font-family":n},priority:7}}}function re(t){return t=t.trim(),t.indexOf(" ")>0&&(t=`'${t}'`),t}class se extends h{static get pluginName(){return"FontFamilyEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(g,{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:g}),e.model.schema.setAttributeProperties(g,{isFormatting:!0,copyOnEnter:!0});const o=M(e.config.get("fontFamily.options")).filter(i=>i.model),n=U(g,o);e.config.get("fontFamily.supportAllValues")?(this._prepareAnyValueConverters(),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(n),e.commands.add(g,new oe(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:g,view:(o,{writer:n})=>n.createAttributeElement("span",{style:"font-family:"+o},{priority:7})}),e.conversion.for("upcast").elementToAttribute({model:{key:g,value:o=>o.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{face:/.*/}},model:{key:g,value:o=>o.getAttribute("face")}})}}class le extends h{static get pluginName(){return"FontFamilyUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,o=e.t,n=this._getLocalizedOptions(),i=e.commands.get(g),s=o("Font Family"),c=ae(n,i);e.ui.componentFactory.add(g,l=>{const r=O(l);return P(r,c,{role:"menu",ariaLabel:s}),r.buttonView.set({label:s,icon:V,tooltip:!0}),r.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",u=>{e.execute(u.source.commandName,{value:u.source.commandParam}),e.editing.view.focus()}),r}),e.ui.componentFactory.add(`menuBar:${g}`,l=>{const r=new z(l);r.buttonView.set({label:s,icon:V}),r.bind("isEnabled").to(i);const u=new L(l);for(const m of c){const a=new T(l,r),d=new E(l);d.set({role:"menuitemradio",isToggleable:!0}),d.bind(...Object.keys(m.model)).to(m.model),d.delegate("execute").to(r),d.on("execute",()=>{e.execute(m.model.commandName,{value:m.model.commandParam}),e.editing.view.focus()}),a.children.add(d),u.items.add(a)}return r.panelView.children.add(u),r})}_getLocalizedOptions(){const e=this.editor,o=e.t;return M(e.config.get(g).options).map(i=>(i.title==="Default"&&(i.title=o("Default")),i))}}function ae(t,e){const o=new $;for(const n of t){const i={type:"button",model:new D({commandName:g,commandParam:n.model,label:n.title,role:"menuitemradio",withText:!0})};i.model.bind("isOn").to(e,"value",s=>{if(s===n.model)return!0;if(!s||!n.model)return!1;const c=x(s)[0].toLowerCase(),l=x(n.model)[0].toLowerCase();return c===l}),n.view&&typeof n.view!="string"&&n.view.styles&&i.model.set("labelStyle",`font-family: ${n.view.styles["font-family"]}`),o.add(i)}return o}class Ne extends h{static get requires(){return[se,le]}static get pluginName(){return"FontFamily"}static get isOfficialPlugin(){return!0}}class ce extends F{constructor(e){super(e,p)}}function A(t){return t.map(e=>ue(e)).filter(e=>e!==void 0)}const k={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function ue(t){if(typeof t=="number"&&(t=String(t)),typeof t=="object"&&fe(t))return S(t);const e=de(t);if(e)return S(e);if(t==="default")return{model:void 0,title:"Default"};if(!pe(t))return me(t)}function me(t){return typeof t=="string"&&(t={title:t,model:`${parseFloat(t)}px`}),t.view={name:"span",styles:{"font-size":t.model}},S(t)}function S(t){return t.view&&typeof t.view!="string"&&!t.view.priority&&(t.view.priority=7),t}function de(t){return typeof t=="string"?k[t]:k[t.model]}function fe(t){return t.title&&t.model&&t.view}function pe(t){let e;if(typeof t=="object")if(t.model)e=parseFloat(t.model);else throw new I("font-size-invalid-definition",null,t);else e=parseFloat(t);return isNaN(e)}const B=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class ge extends h{static get pluginName(){return"FontSizeEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(p,{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:p}),e.model.schema.setAttributeProperties(p,{isFormatting:!0,copyOnEnter:!0});const o=e.config.get("fontSize.supportAllValues"),n=A(this.editor.config.get("fontSize.options")).filter(s=>s.model),i=U(p,n);o?(this._prepareAnyValueConverters(i),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(i),e.commands.add(p,new ce(e))}_prepareAnyValueConverters(e){const o=this.editor,n=e.model.values.filter(i=>!Q(String(i))&&!X(String(i)));if(n.length)throw new I("font-size-invalid-use-of-named-presets",null,{presets:n});o.conversion.for("downcast").attributeToElement({model:p,view:(i,{writer:s})=>{if(i)return s.createAttributeElement("span",{style:"font-size:"+i},{priority:7})}}),o.conversion.for("upcast").elementToAttribute({model:{key:p,value:i=>i.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:p,value:o=>{const n=o.getAttribute("size"),i=n[0]==="-"||n[0]==="+";let s=parseInt(n,10);i&&(s=3+s);const c=B.length-1,l=Math.min(Math.max(s,0),c);return B[l]}}})}}class be extends h{static get pluginName(){return"FontSizeUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,o=e.t,n=this._getLocalizedOptions(),i=e.commands.get(p),s=o("Font Size"),c=he(n,i);e.ui.componentFactory.add(p,l=>{const r=O(l);return P(r,c,{role:"menu",ariaLabel:s}),r.buttonView.set({label:s,icon:N,tooltip:!0}),r.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",u=>{e.execute(u.source.commandName,{value:u.source.commandParam}),e.editing.view.focus()}),r}),e.ui.componentFactory.add(`menuBar:${p}`,l=>{const r=new z(l);r.buttonView.set({label:s,icon:N}),r.bind("isEnabled").to(i);const u=new L(l);for(const m of c){const a=new T(l,r),d=new E(l);d.set({role:"menuitemradio",isToggleable:!0}),d.bind(...Object.keys(m.model)).to(m.model),d.delegate("execute").to(r),d.on("execute",()=>{e.execute(m.model.commandName,{value:m.model.commandParam}),e.editing.view.focus()}),a.children.add(d),u.items.add(a)}return r.panelView.children.add(u),r})}_getLocalizedOptions(){const e=this.editor,o=e.t,n={Default:o("Default"),Tiny:o("Tiny"),Small:o("Small"),Big:o("Big"),Huge:o("Huge")};return A(e.config.get(p).options).map(s=>{const c=n[s.title];return c&&c!=s.title&&(s=Object.assign({},s,{title:c})),s})}}function he(t,e){const o=new $;for(const n of t){const i={type:"button",model:new D({commandName:p,commandParam:n.model,label:n.title,class:"ck-fontsize-option",role:"menuitemradio",withText:!0})};n.view&&typeof n.view!="string"&&(n.view.styles&&i.model.set("labelStyle",`font-size:${n.view.styles["font-size"]}`),n.view.classes&&i.model.set("class",`${i.model.class} ${n.view.classes}`)),i.model.bind("isOn").to(e,"value",s=>s===n.model),o.add(i)}return o}class ke extends h{static get requires(){return[ge,be]}static get pluginName(){return"FontSize"}static get isOfficialPlugin(){return!0}normalizeSizeOptions(e){return A(e)}}class we extends F{constructor(e){super(e,w)}}class ye extends h{static get pluginName(){return"FontColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(w,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:w,value:R("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:w,value:o=>o.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:w,view:G("color")}),e.commands.add(w,new we(e)),e.model.schema.extend("$text",{allowAttributes:w}),e.model.schema.setAttributeProperties(w,{isFormatting:!0,copyOnEnter:!0})}}class K extends h{commandName;componentName;icon;dropdownLabel;columns;constructor(e,{commandName:o,componentName:n,icon:i,dropdownLabel:s}){super(e),this.commandName=o,this.componentName=n,this.icon=i,this.dropdownLabel=s,this.columns=e.config.get(`${this.componentName}.columns`)}init(){const e=this.editor,o=e.locale,n=o.t,i=e.commands.get(this.commandName),s=e.config.get(this.componentName),c=j(s.colors),l=H(o,c),r=s.documentColors,u=s.colorPicker!==!1;e.ui.componentFactory.add(this.componentName,m=>{const a=O(m);let d=!1;const f=ee({dropdownView:a,colors:l.map(b=>({label:b.label,color:b.model,options:{hasBorder:b.hasBorder}})),columns:this.columns,removeButtonLabel:n("Remove color"),colorPickerLabel:n("Color picker"),documentColorsLabel:r!==0?n("Document colors"):"",documentColorsCount:r===void 0?this.columns:r,colorPickerViewConfig:u?s.colorPicker||{}:!1});return f.bind("selectedColor").to(i,"value"),a.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),a.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),a.bind("isEnabled").to(i),f.on("execute",(b,v)=>{a.isOpen&&e.execute(this.commandName,{value:v.value,batch:this._undoStepBatch}),v.source!=="colorPicker"&&e.editing.view.focus(),v.source==="colorPickerSaveButton"&&(a.isOpen=!1)}),f.on("colorPicker:show",()=>{this._undoStepBatch=e.model.createBatch()}),f.on("colorPicker:cancel",()=>{this._undoStepBatch.operations.length&&(a.isOpen=!1,e.execute("undo",this._undoStepBatch)),e.editing.view.focus()}),a.on("change:isOpen",(b,v,C)=>{d||(d=!0,a.colorSelectorView.appendUI()),C&&(r!==0&&f.updateDocumentColors(e.model,this.componentName),f.updateSelectedColors(),f.showColorGridsFragment())}),Y(a,()=>a.colorSelectorView.colorGridsFragmentView.staticColorsGrid.items.find(b=>b.isOn)),a}),e.ui.componentFactory.add(`menuBar:${this.componentName}`,m=>{const a=new z(m);a.buttonView.set({label:this.dropdownLabel,icon:this.icon}),a.bind("isEnabled").to(i);let d=!1;const f=new _(m,{colors:l.map(b=>({label:b.label,color:b.model,options:{hasBorder:b.hasBorder}})),columns:this.columns,removeButtonLabel:n("Remove color"),colorPickerLabel:n("Color picker"),documentColorsLabel:r!==0?n("Document colors"):"",documentColorsCount:r===void 0?this.columns:r,colorPickerViewConfig:!1});return f.bind("selectedColor").to(i,"value"),f.delegate("execute").to(a),f.on("execute",(b,v)=>{e.execute(this.commandName,{value:v.value,batch:this._undoStepBatch}),e.editing.view.focus()}),a.on("change:isOpen",(b,v,C)=>{d||(d=!0,f.appendUI()),C&&(r!==0&&f.updateDocumentColors(e.model,this.componentName),f.updateSelectedColors(),f.showColorGridsFragment())}),a.panelView.children.add(f),a})}}class ve extends K{constructor(e){const o=e.locale.t;super(e,{commandName:w,componentName:w,icon:Z,dropdownLabel:o("Font Color")})}static get pluginName(){return"FontColorUI"}}class Be extends h{static get requires(){return[ye,ve]}static get pluginName(){return"FontColor"}static get isOfficialPlugin(){return!0}}class Fe extends F{constructor(e){super(e,y)}}class Ce extends h{static get pluginName(){return"FontBackgroundColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(y,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(J),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:y,value:R("background-color")}}),e.conversion.for("downcast").attributeToElement({model:y,view:G("background-color")}),e.commands.add(y,new Fe(e)),e.model.schema.extend("$text",{allowAttributes:y}),e.model.schema.setAttributeProperties(y,{isFormatting:!0,copyOnEnter:!0})}}class xe extends K{constructor(e){const o=e.locale.t;super(e,{commandName:y,componentName:y,icon:W,dropdownLabel:o("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class Pe extends h{static get requires(){return[Ce,xe]}static get pluginName(){return"FontBackgroundColor"}static get isOfficialPlugin(){return!0}}export{Pe as FontBackgroundColor,Fe as FontBackgroundColorCommand,Ce as FontBackgroundColorEditing,xe as FontBackgroundColorUI,Be as FontColor,we as FontColorCommand,ye as FontColorEditing,ve as FontColorUI,K as FontColorUIBase,F as FontCommand,Ne as FontFamily,oe as FontFamilyCommand,se as FontFamilyEditing,le as FontFamilyUI,ke as FontSize,ce as FontSizeCommand,ge as FontSizeEditing,be as FontSizeUI,ee as _addFontColorSelectorToDropdown,U as _buildFontDefinition,M as _normalizeFontFamilyOptions,A as _normalizeFontSizeOptions,G as _renderDowncastFontElement,R as _renderUpcastFontColorAttribute};
@@ -1 +1 @@
1
- import{Plugin as f,Command as H}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Paragraph as v}from"../../../../../@ckeditor_ckeditor5-paragraph@46.1.1/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js";import{priorities as E,Collection as V,first as x}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{UIModel as C,createDropdown as M,addListToDropdown as k,MenuBarMenuView as L,MenuBarMenuListView as O,MenuBarMenuListItemView as P,MenuBarMenuListItemButtonView as T}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";class y extends H{modelElements;constructor(e,t){super(e),this.modelElements=t}refresh(){const e=x(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>b(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,r=t.document,s=e.value;t.change(c=>{const l=Array.from(r.selection.getSelectedBlocks()).filter(a=>b(a,s,t.schema));for(const a of l)a.is("element",s)||c.rename(a,s)})}}function b(m,e,t){return t.checkChild(m.parent,e)&&!t.isObject(m)}const w="paragraph";class B extends f{static get pluginName(){return"HeadingEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[v]}init(){const e=this.editor,t=e.config.get("heading.options"),r=[];for(const s of t)s.model!=="paragraph"&&(e.model.schema.register(s.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(s),r.push(s.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new y(e,r))}afterInit(){const e=this.editor,t=e.commands.get("enter"),r=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(s,c)=>{const l=e.model.document.selection.getFirstPosition().parent;r.some(g=>l.is("element",g.model))&&!l.is("element",w)&&l.childCount===0&&c.writer.rename(l,w)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:E.low+1})}}function I(m){const e=m.t,t={Paragraph:e("Paragraph"),"Heading 1":e("Heading 1"),"Heading 2":e("Heading 2"),"Heading 3":e("Heading 3"),"Heading 4":e("Heading 4"),"Heading 5":e("Heading 5"),"Heading 6":e("Heading 6")};return m.config.get("heading.options").map(r=>{const s=t[r.title];return s&&s!=r.title&&(r.title=s),r})}class N extends f{static get pluginName(){return"HeadingUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,r=I(e),s=t("Choose heading"),c=t("Heading");e.ui.componentFactory.add("heading",l=>{const a={},g=new V,u=e.commands.get("heading"),h=e.commands.get("paragraph"),p=[u];for(const n of r){const i={type:"button",model:new C({label:n.title,class:n.class,role:"menuitemradio",withText:!0})};n.model==="paragraph"?(i.model.bind("isOn").to(h,"value"),i.model.set("commandName","paragraph"),p.push(h)):(i.model.bind("isOn").to(u,"value",d=>d===n.model),i.model.set({commandName:"heading",commandValue:n.model})),g.add(i),a[n.model]=n.title}const o=M(l);return k(o,g,{ariaLabel:c,role:"menu"}),o.buttonView.set({ariaLabel:c,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:c}),o.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),o.bind("isEnabled").toMany(p,"isEnabled",(...n)=>n.some(i=>i)),o.buttonView.bind("label").to(u,"value",h,"value",(n,i)=>{const d=i?"paragraph":n;return typeof d=="boolean"||!a[d]?s:a[d]}),o.buttonView.bind("ariaLabel").to(u,"value",h,"value",(n,i)=>{const d=i?"paragraph":n;return typeof d=="boolean"||!a[d]?c:`${a[d]}, ${c}`}),this.listenTo(o,"execute",n=>{const{commandName:i,commandValue:d}=n.source;e.execute(i,d?{value:d}:void 0),e.editing.view.focus()}),o}),e.ui.componentFactory.add("menuBar:heading",l=>{const a=new L(l),g=e.commands.get("heading"),u=e.commands.get("paragraph"),h=[g],p=new O(l);a.set({class:"ck-heading-dropdown"}),p.set({ariaLabel:t("Heading"),role:"menu"}),a.buttonView.set({label:t("Heading")}),a.panelView.children.add(p);for(const o of r){const n=new P(l,a),i=new T(l);n.children.add(i),p.items.add(n),i.set({isToggleable:!0,label:o.title,role:"menuitemradio",class:o.class}),i.delegate("execute").to(a),i.on("execute",()=>{const d=o.model==="paragraph"?"paragraph":"heading";e.execute(d,{value:o.model}),e.editing.view.focus()}),o.model==="paragraph"?(i.bind("isOn").to(u,"value"),h.push(u)):i.bind("isOn").to(g,"value",d=>d===o.model)}return a.bind("isEnabled").toMany(h,"isEnabled",(...o)=>o.some(n=>n)),a})}}class $ extends f{static get requires(){return[B,N]}static get pluginName(){return"Heading"}static get isOfficialPlugin(){return!0}}export{$ as Heading,y as HeadingCommand,B as HeadingEditing,N as HeadingUI,I as _getLocalizedHeadingOptions};
1
+ import{Plugin as f,Command as H}from"../../../../../@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Paragraph as v}from"../../../../../@ckeditor_ckeditor5-paragraph@47.3.0/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js";import{priorities as E,Collection as V,first as x}from"../../../../../@ckeditor_ckeditor5-utils@47.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{UIModel as C,createDropdown as M,addListToDropdown as k,MenuBarMenuView as L,MenuBarMenuListView as O,MenuBarMenuListItemView as P,MenuBarMenuListItemButtonView as T}from"../../../../../@ckeditor_ckeditor5-ui@47.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import"../../../../../@ckeditor_ckeditor5-engine@47.3.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";class y extends H{modelElements;constructor(e,t){super(e),this.modelElements=t}refresh(){const e=x(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>b(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,r=t.document,s=e.value;t.change(c=>{const l=Array.from(r.selection.getSelectedBlocks()).filter(a=>b(a,s,t.schema));for(const a of l)a.is("element",s)||c.rename(a,s)})}}function b(m,e,t){return t.checkChild(m.parent,e)&&!t.isObject(m)}const w="paragraph";class B extends f{static get pluginName(){return"HeadingEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[v]}init(){const e=this.editor,t=e.config.get("heading.options"),r=[];for(const s of t)s.model!=="paragraph"&&(e.model.schema.register(s.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(s),r.push(s.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new y(e,r))}afterInit(){const e=this.editor,t=e.commands.get("enter"),r=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(s,c)=>{const l=e.model.document.selection.getFirstPosition().parent;r.some(g=>l.is("element",g.model))&&!l.is("element",w)&&l.childCount===0&&c.writer.rename(l,w)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:E.low+1})}}function I(m){const e=m.t,t={Paragraph:e("Paragraph"),"Heading 1":e("Heading 1"),"Heading 2":e("Heading 2"),"Heading 3":e("Heading 3"),"Heading 4":e("Heading 4"),"Heading 5":e("Heading 5"),"Heading 6":e("Heading 6")};return m.config.get("heading.options").map(r=>{const s=t[r.title];return s&&s!=r.title&&(r.title=s),r})}class N extends f{static get pluginName(){return"HeadingUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,r=I(e),s=t("Choose heading"),c=t("Heading");e.ui.componentFactory.add("heading",l=>{const a={},g=new V,u=e.commands.get("heading"),h=e.commands.get("paragraph"),p=[u];for(const n of r){const i={type:"button",model:new C({label:n.title,class:n.class,role:"menuitemradio",withText:!0})};n.model==="paragraph"?(i.model.bind("isOn").to(h,"value"),i.model.set("commandName","paragraph"),p.push(h)):(i.model.bind("isOn").to(u,"value",d=>d===n.model),i.model.set({commandName:"heading",commandValue:n.model})),g.add(i),a[n.model]=n.title}const o=M(l);return k(o,g,{ariaLabel:c,role:"menu"}),o.buttonView.set({ariaLabel:c,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:c}),o.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),o.bind("isEnabled").toMany(p,"isEnabled",(...n)=>n.some(i=>i)),o.buttonView.bind("label").to(u,"value",h,"value",(n,i)=>{const d=i?"paragraph":n;return typeof d=="boolean"||!a[d]?s:a[d]}),o.buttonView.bind("ariaLabel").to(u,"value",h,"value",(n,i)=>{const d=i?"paragraph":n;return typeof d=="boolean"||!a[d]?c:`${a[d]}, ${c}`}),this.listenTo(o,"execute",n=>{const{commandName:i,commandValue:d}=n.source;e.execute(i,d?{value:d}:void 0),e.editing.view.focus()}),o}),e.ui.componentFactory.add("menuBar:heading",l=>{const a=new L(l),g=e.commands.get("heading"),u=e.commands.get("paragraph"),h=[g],p=new O(l);a.set({class:"ck-heading-dropdown"}),p.set({ariaLabel:t("Heading"),role:"menu"}),a.buttonView.set({label:t("Heading")}),a.panelView.children.add(p);for(const o of r){const n=new P(l,a),i=new T(l);n.children.add(i),p.items.add(n),i.set({isToggleable:!0,label:o.title,role:"menuitemradio",class:o.class}),i.delegate("execute").to(a),i.on("execute",()=>{const d=o.model==="paragraph"?"paragraph":"heading";e.execute(d,{value:o.model}),e.editing.view.focus()}),o.model==="paragraph"?(i.bind("isOn").to(u,"value"),h.push(u)):i.bind("isOn").to(g,"value",d=>d===o.model)}return a.bind("isEnabled").toMany(h,"isEnabled",(...o)=>o.some(n=>n)),a})}}class $ extends f{static get requires(){return[B,N]}static get pluginName(){return"Heading"}static get isOfficialPlugin(){return!0}}export{$ as Heading,y as HeadingCommand,B as HeadingEditing,N as HeadingUI,I as _getLocalizedHeadingOptions};
@@ -1 +1 @@
1
- import{Plugin as w,Command as V}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconEraser as k,IconMarker as x,IconPen as B}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as y,createDropdown as E,addToolbarToDropdown as H,MenuBarMenuView as M,MenuBarMenuListView as A,MenuBarMenuListItemView as f,MenuBarMenuListItemButtonView as v,ListSeparatorView as T,SplitButtonView as I,ToolbarSeparatorView as P}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";class O extends V{refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute("highlight"),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"highlight")}execute(e={}){const t=this.editor.model,r=t.document.selection,o=e.value;t.change(i=>{if(r.isCollapsed){const s=r.getFirstPosition();if(r.hasAttribute("highlight")){const n=c=>c.item.hasAttribute("highlight")&&c.item.getAttribute("highlight")===this.value,h=s.getLastMatchingPosition(n,{direction:"backward"}),l=s.getLastMatchingPosition(n),u=i.createRange(h,l);!o||this.value===o?(s.isEqual(l)||i.removeAttribute("highlight",u),i.removeSelectionAttribute("highlight")):(s.isEqual(l)||i.setAttribute("highlight",o,u),i.setSelectionAttribute("highlight",o))}else o&&i.setSelectionAttribute("highlight",o)}else{const s=t.schema.getValidRanges(r.getRanges(),"highlight");for(const n of s)o?i.setAttribute("highlight",o,n):i.removeAttribute("highlight",n)}})}}class _ extends w{static get pluginName(){return"HighlightEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("highlight",{options:[{model:"yellowMarker",class:"marker-yellow",title:"Yellow marker",color:"var(--ck-content-highlight-marker-yellow)",type:"marker"},{model:"greenMarker",class:"marker-green",title:"Green marker",color:"var(--ck-content-highlight-marker-green)",type:"marker"},{model:"pinkMarker",class:"marker-pink",title:"Pink marker",color:"var(--ck-content-highlight-marker-pink)",type:"marker"},{model:"blueMarker",class:"marker-blue",title:"Blue marker",color:"var(--ck-content-highlight-marker-blue)",type:"marker"},{model:"redPen",class:"pen-red",title:"Red pen",color:"var(--ck-content-highlight-pen-red)",type:"pen"},{model:"greenPen",class:"pen-green",title:"Green pen",color:"var(--ck-content-highlight-pen-green)",type:"pen"}]})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"highlight"});const t=e.config.get("highlight.options");e.conversion.attributeToElement(R(t)),e.commands.add("highlight",new O(e))}}function R(d){const e={model:{key:"highlight",values:[]},view:{}};for(const t of d)e.model.values.push(t.model),e.view[t.model]={name:"mark",classes:t.class};return e}class S extends w{get localizedOptionTitles(){const e=this.editor.t;return{"Yellow marker":e("Yellow marker"),"Green marker":e("Green marker"),"Pink marker":e("Pink marker"),"Blue marker":e("Blue marker"),"Red pen":e("Red pen"),"Green pen":e("Green pen")}}static get pluginName(){return"HighlightUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.config.get("highlight.options");for(const t of e)this._addHighlighterButton(t);this._addRemoveHighlightButton(),this._addDropdown(e),this._addMenuBarButton(e)}_addRemoveHighlightButton(){const e=this.editor.t,t=this.editor.commands.get("highlight");this._addButton("removeHighlight",e("Remove highlight"),k,null,g=>{g.bind("isEnabled").to(t,"isEnabled")})}_addHighlighterButton(e){const t=this.editor.commands.get("highlight");this._addButton("highlight:"+e.model,e.title,b(e.type),e.model,g);function g(r){r.bind("isEnabled").to(t,"isEnabled"),r.bind("isOn").to(t,"value",o=>o===e.model),r.iconView.fillColor=e.color,r.isToggleable=!0}}_addButton(e,t,g,r,o){const i=this.editor;i.ui.componentFactory.add(e,s=>{const n=new y(s),h=this.localizedOptionTitles[t]?this.localizedOptionTitles[t]:t;return n.set({label:h,icon:g,tooltip:!0}),n.on("execute",()=>{i.execute("highlight",{value:r}),i.editing.view.focus()}),o(n),n})}_addDropdown(e){const t=this.editor,g=t.t,r=t.ui.componentFactory,o=e[0],i=e.reduce((s,n)=>(s[n.model]=n,s),{});r.add("highlight",s=>{const n=t.commands.get("highlight"),h=E(s,I),l=h.buttonView;l.set({label:g("Highlight"),tooltip:!0,lastExecuted:o.model,commandValue:o.model,isToggleable:!0}),l.bind("icon").to(n,"value",a=>b(c(a,"type"))),l.bind("color").to(n,"value",a=>c(a,"color")),l.bind("commandValue").to(n,"value",a=>c(a,"model")),l.bind("isOn").to(n,"value",a=>!!a),l.delegate("execute").to(h);const u=()=>{const a=e.map(m=>{const p=r.create("highlight:"+m.model);return this.listenTo(p,"execute",()=>{h.buttonView.set({lastExecuted:m.model})}),p});return a.push(new P),a.push(r.create("removeHighlight")),a};h.bind("isEnabled").to(n,"isEnabled"),H(h,u,{enableActiveItemFocusOnDropdownOpen:!0,ariaLabel:g("Text highlight toolbar")}),C(h),l.on("execute",()=>{t.execute("highlight",{value:l.commandValue})}),this.listenTo(h,"execute",()=>{t.editing.view.focus()});function c(a,m){const p=!a||a===l.lastExecuted?l.lastExecuted:a;return i[p][m]}return h})}_addMenuBarButton(e){const t=this.editor,g=t.t,r=t.commands.get("highlight");t.ui.componentFactory.add("menuBar:highlight",o=>{const i=new M(o);i.buttonView.set({label:g("Highlight"),icon:b("marker")}),i.bind("isEnabled").to(r),i.buttonView.iconView.fillColor="transparent";const s=new A(o);for(const l of e){const u=new f(o,i),c=new v(o);c.set({label:l.title,icon:b(l.type),role:"menuitemradio",isToggleable:!0}),c.iconView.fillColor=l.color,c.delegate("execute").to(i),c.bind("isOn").to(r,"value",a=>a===l.model),c.on("execute",()=>{t.execute("highlight",{value:l.model}),t.editing.view.focus()}),u.children.add(c),s.items.add(u)}s.items.add(new T(o));const n=new f(o,i),h=new v(o);return h.set({label:g("Remove highlight"),icon:k}),h.delegate("execute").to(i),h.on("execute",()=>{t.execute("highlight",{value:null}),t.editing.view.focus()}),n.children.add(h),s.items.add(n),i.panelView.children.add(s),i})}}function C(d){d.buttonView.actionView.iconView.bind("fillColor").to(d.buttonView,"color")}function b(d){return d==="marker"?x:B}class G extends w{static get requires(){return[_,S]}static get pluginName(){return"Highlight"}static get isOfficialPlugin(){return!0}}export{G as Highlight,O as HighlightCommand,_ as HighlightEditing,S as HighlightUI};
1
+ import{Plugin as w,Command as V}from"../../../../../@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconEraser as k,IconMarker as x,IconPen as B}from"../../../../../@ckeditor_ckeditor5-icons@47.3.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as y,createDropdown as E,addToolbarToDropdown as H,MenuBarMenuView as M,MenuBarMenuListView as A,MenuBarMenuListItemView as f,MenuBarMenuListItemButtonView as v,ListSeparatorView as T,SplitButtonView as I,ToolbarSeparatorView as P}from"../../../../../@ckeditor_ckeditor5-ui@47.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";class O extends V{refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute("highlight"),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"highlight")}execute(e={}){const t=this.editor.model,r=t.document.selection,o=e.value;t.change(i=>{if(r.isCollapsed){const s=r.getFirstPosition();if(r.hasAttribute("highlight")){const n=c=>c.item.hasAttribute("highlight")&&c.item.getAttribute("highlight")===this.value,h=s.getLastMatchingPosition(n,{direction:"backward"}),l=s.getLastMatchingPosition(n),u=i.createRange(h,l);!o||this.value===o?(s.isEqual(l)||i.removeAttribute("highlight",u),i.removeSelectionAttribute("highlight")):(s.isEqual(l)||i.setAttribute("highlight",o,u),i.setSelectionAttribute("highlight",o))}else o&&i.setSelectionAttribute("highlight",o)}else{const s=t.schema.getValidRanges(r.getRanges(),"highlight");for(const n of s)o?i.setAttribute("highlight",o,n):i.removeAttribute("highlight",n)}})}}class _ extends w{static get pluginName(){return"HighlightEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("highlight",{options:[{model:"yellowMarker",class:"marker-yellow",title:"Yellow marker",color:"var(--ck-content-highlight-marker-yellow)",type:"marker"},{model:"greenMarker",class:"marker-green",title:"Green marker",color:"var(--ck-content-highlight-marker-green)",type:"marker"},{model:"pinkMarker",class:"marker-pink",title:"Pink marker",color:"var(--ck-content-highlight-marker-pink)",type:"marker"},{model:"blueMarker",class:"marker-blue",title:"Blue marker",color:"var(--ck-content-highlight-marker-blue)",type:"marker"},{model:"redPen",class:"pen-red",title:"Red pen",color:"var(--ck-content-highlight-pen-red)",type:"pen"},{model:"greenPen",class:"pen-green",title:"Green pen",color:"var(--ck-content-highlight-pen-green)",type:"pen"}]})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"highlight"});const t=e.config.get("highlight.options");e.conversion.attributeToElement(R(t)),e.commands.add("highlight",new O(e))}}function R(d){const e={model:{key:"highlight",values:[]},view:{}};for(const t of d)e.model.values.push(t.model),e.view[t.model]={name:"mark",classes:t.class};return e}class S extends w{get localizedOptionTitles(){const e=this.editor.t;return{"Yellow marker":e("Yellow marker"),"Green marker":e("Green marker"),"Pink marker":e("Pink marker"),"Blue marker":e("Blue marker"),"Red pen":e("Red pen"),"Green pen":e("Green pen")}}static get pluginName(){return"HighlightUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.config.get("highlight.options");for(const t of e)this._addHighlighterButton(t);this._addRemoveHighlightButton(),this._addDropdown(e),this._addMenuBarButton(e)}_addRemoveHighlightButton(){const e=this.editor.t,t=this.editor.commands.get("highlight");this._addButton("removeHighlight",e("Remove highlight"),k,null,g=>{g.bind("isEnabled").to(t,"isEnabled")})}_addHighlighterButton(e){const t=this.editor.commands.get("highlight");this._addButton("highlight:"+e.model,e.title,b(e.type),e.model,g);function g(r){r.bind("isEnabled").to(t,"isEnabled"),r.bind("isOn").to(t,"value",o=>o===e.model),r.iconView.fillColor=e.color,r.isToggleable=!0}}_addButton(e,t,g,r,o){const i=this.editor;i.ui.componentFactory.add(e,s=>{const n=new y(s),h=this.localizedOptionTitles[t]?this.localizedOptionTitles[t]:t;return n.set({label:h,icon:g,tooltip:!0}),n.on("execute",()=>{i.execute("highlight",{value:r}),i.editing.view.focus()}),o(n),n})}_addDropdown(e){const t=this.editor,g=t.t,r=t.ui.componentFactory,o=e[0],i=e.reduce((s,n)=>(s[n.model]=n,s),{});r.add("highlight",s=>{const n=t.commands.get("highlight"),h=E(s,I),l=h.buttonView;l.set({label:g("Highlight"),tooltip:!0,lastExecuted:o.model,commandValue:o.model,isToggleable:!0}),l.bind("icon").to(n,"value",a=>b(c(a,"type"))),l.bind("color").to(n,"value",a=>c(a,"color")),l.bind("commandValue").to(n,"value",a=>c(a,"model")),l.bind("isOn").to(n,"value",a=>!!a),l.delegate("execute").to(h);const u=()=>{const a=e.map(m=>{const p=r.create("highlight:"+m.model);return this.listenTo(p,"execute",()=>{h.buttonView.set({lastExecuted:m.model})}),p});return a.push(new P),a.push(r.create("removeHighlight")),a};h.bind("isEnabled").to(n,"isEnabled"),H(h,u,{enableActiveItemFocusOnDropdownOpen:!0,ariaLabel:g("Text highlight toolbar")}),C(h),l.on("execute",()=>{t.execute("highlight",{value:l.commandValue})}),this.listenTo(h,"execute",()=>{t.editing.view.focus()});function c(a,m){const p=!a||a===l.lastExecuted?l.lastExecuted:a;return i[p][m]}return h})}_addMenuBarButton(e){const t=this.editor,g=t.t,r=t.commands.get("highlight");t.ui.componentFactory.add("menuBar:highlight",o=>{const i=new M(o);i.buttonView.set({label:g("Highlight"),icon:b("marker")}),i.bind("isEnabled").to(r),i.buttonView.iconView.fillColor="transparent";const s=new A(o);for(const l of e){const u=new f(o,i),c=new v(o);c.set({label:l.title,icon:b(l.type),role:"menuitemradio",isToggleable:!0}),c.iconView.fillColor=l.color,c.delegate("execute").to(i),c.bind("isOn").to(r,"value",a=>a===l.model),c.on("execute",()=>{t.execute("highlight",{value:l.model}),t.editing.view.focus()}),u.children.add(c),s.items.add(u)}s.items.add(new T(o));const n=new f(o,i),h=new v(o);return h.set({label:g("Remove highlight"),icon:k}),h.delegate("execute").to(i),h.on("execute",()=>{t.execute("highlight",{value:null}),t.editing.view.focus()}),n.children.add(h),s.items.add(n),i.panelView.children.add(s),i})}}function C(d){d.buttonView.actionView.iconView.bind("fillColor").to(d.buttonView,"color")}function b(d){return d==="marker"?x:B}class G extends w{static get requires(){return[_,S]}static get pluginName(){return"Highlight"}static get isOfficialPlugin(){return!0}}export{G as Highlight,O as HighlightCommand,_ as HighlightEditing,S as HighlightUI};
@@ -1 +1 @@
1
- import{Plugin as s,Command as m}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Widget as u,toWidget as d,findOptimalInsertionRange as h}from"../../../../../@ckeditor_ckeditor5-widget@46.1.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{IconHorizontalLine as g}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as z,MenuBarMenuListItemButtonView as L}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";class p extends m{refresh(){const t=this.editor.model,e=t.schema,n=t.document.selection;this.isEnabled=f(n,e,t)}execute(){const t=this.editor.model;t.change(e=>{const n=e.createElement("horizontalLine");t.insertObject(n,null,null,{setSelection:"after"})})}}function f(o,t,e){const n=E(o,e);return t.checkChild(n,"horizontalLine")}function E(o,t){const n=h(o,t).start.parent;return n.isEmpty&&!n.is("element","$root")?n.parent:n}class H extends s{static get pluginName(){return"HorizontalLineEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.model.schema,n=t.t,a=t.conversion;e.register("horizontalLine",{inheritAllFrom:"$blockObject"}),a.for("dataDowncast").elementToElement({model:"horizontalLine",view:(r,{writer:i})=>i.createEmptyElement("hr")}),a.for("editingDowncast").elementToStructure({model:"horizontalLine",view:(r,{writer:i})=>{const c=n("Horizontal line"),l=i.createContainerElement("div",null,i.createEmptyElement("hr"));return i.addClass("ck-horizontal-line",l),i.setCustomProperty("hr",!0,l),b(l,i,c)}}),a.for("upcast").elementToElement({view:"hr",model:"horizontalLine"}),t.commands.add("horizontalLine",new p(t))}}function b(o,t,e){return t.setCustomProperty("horizontalLine",!0,o),d(o,t,{label:e})}class v extends s{static get pluginName(){return"HorizontalLineUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.ui.componentFactory.add("horizontalLine",()=>{const e=this._createButton(z);return e.set({tooltip:!0}),e}),t.ui.componentFactory.add("menuBar:horizontalLine",()=>this._createButton(L))}_createButton(t){const e=this.editor,n=e.locale,a=e.commands.get("horizontalLine"),r=new t(e.locale),i=n.t;return r.set({label:i("Horizontal line"),icon:g}),r.bind("isEnabled").to(a,"isEnabled"),this.listenTo(r,"execute",()=>{e.execute("horizontalLine"),e.editing.view.focus()}),r}}class B extends s{static get requires(){return[H,v,u]}static get pluginName(){return"HorizontalLine"}static get isOfficialPlugin(){return!0}}export{B as HorizontalLine,p as HorizontalLineCommand,H as HorizontalLineEditing,v as HorizontalLineUI};
1
+ import{Plugin as s,Command as m}from"../../../../../@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Widget as u,toWidget as d,findOptimalInsertionRange as h}from"../../../../../@ckeditor_ckeditor5-widget@47.3.0/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{IconHorizontalLine as g}from"../../../../../@ckeditor_ckeditor5-icons@47.3.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as z,MenuBarMenuListItemButtonView as L}from"../../../../../@ckeditor_ckeditor5-ui@47.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";class p extends m{refresh(){const t=this.editor.model,e=t.schema,n=t.document.selection;this.isEnabled=f(n,e,t)}execute(){const t=this.editor.model;t.change(e=>{const n=e.createElement("horizontalLine");t.insertObject(n,null,null,{setSelection:"after"})})}}function f(o,t,e){const n=E(o,e);return t.checkChild(n,"horizontalLine")}function E(o,t){const n=h(o,t).start.parent;return n.isEmpty&&!n.is("element","$root")?n.parent:n}class H extends s{static get pluginName(){return"HorizontalLineEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.model.schema,n=t.t,a=t.conversion;e.register("horizontalLine",{inheritAllFrom:"$blockObject"}),a.for("dataDowncast").elementToElement({model:"horizontalLine",view:(r,{writer:i})=>i.createEmptyElement("hr")}),a.for("editingDowncast").elementToStructure({model:"horizontalLine",view:(r,{writer:i})=>{const c=n("Horizontal line"),l=i.createContainerElement("div",null,i.createEmptyElement("hr"));return i.addClass("ck-horizontal-line",l),i.setCustomProperty("hr",!0,l),b(l,i,c)}}),a.for("upcast").elementToElement({view:"hr",model:"horizontalLine"}),t.commands.add("horizontalLine",new p(t))}}function b(o,t,e){return t.setCustomProperty("horizontalLine",!0,o),d(o,t,{label:e})}class v extends s{static get pluginName(){return"HorizontalLineUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.ui.componentFactory.add("horizontalLine",()=>{const e=this._createButton(z);return e.set({tooltip:!0}),e}),t.ui.componentFactory.add("menuBar:horizontalLine",()=>this._createButton(L))}_createButton(t){const e=this.editor,n=e.locale,a=e.commands.get("horizontalLine"),r=new t(e.locale),i=n.t;return r.set({label:i("Horizontal line"),icon:g}),r.bind("isEnabled").to(a,"isEnabled"),this.listenTo(r,"execute",()=>{e.execute("horizontalLine"),e.editing.view.focus()}),r}}class B extends s{static get requires(){return[H,v,u]}static get pluginName(){return"HorizontalLine"}static get isOfficialPlugin(){return!0}}export{B as HorizontalLine,p as HorizontalLineCommand,H as HorizontalLineEditing,v as HorizontalLineUI};
@@ -0,0 +1 @@
1
+ import{Plugin as f,Command as B}from"../../../../../@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Widget as V,toWidget as S,findOptimalInsertionRange as A}from"../../../../../@ckeditor_ckeditor5-widget@47.3.0/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{ButtonView as P,MenuBarMenuListItemButtonView as T}from"../../../../../@ckeditor_ckeditor5-ui@47.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{logWarning as I,createElement as b}from"../../../../../@ckeditor_ckeditor5-utils@47.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{IconHtml as L,IconPencil as C,IconCheck as D,IconCancel as M}from"../../../../../@ckeditor_ckeditor5-icons@47.3.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";class y extends B{refresh(){const e=this.editor.model,i=e.schema,a=e.document.selection,t=H(a);this.isEnabled=O(a,i,e),this.value=t?t.getAttribute("value")||"":null}execute(e){const i=this.editor.model,a=i.document.selection;i.change(t=>{let w;this.value!==null?w=H(a):(w=t.createElement("rawHtml"),i.insertObject(w,null,null,{setSelection:"on"})),t.setAttribute("value",e,w)})}}function O(m,e,i){const a=W(m,i);return e.checkChild(a,"rawHtml")}function W(m,e){const a=A(m,e).start.parent;return a.isEmpty&&!a.is("rootElement")?a.parent:a}function H(m){const e=m.getSelectedElement();return e&&e.is("element","rawHtml")?e:null}class z extends f{_widgetButtonViewReferences=new Set;static get pluginName(){return"HtmlEmbedEditing"}static get licenseFeatureCode(){return"HE"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}constructor(e){super(e),e.config.define("htmlEmbed",{showPreviews:!1,sanitizeHtml:i=>(I("html-embed-provide-sanitize-function"),{html:i,hasChanged:!1})})}init(){const e=this.editor;e.model.schema.register("rawHtml",{inheritAllFrom:"$blockObject",allowAttributes:["value"]}),e.commands.add("htmlEmbed",new y(e)),this._setupConversion()}_setupConversion(){const e=this.editor,i=e.t,a=e.editing.view,t=this._widgetButtonViewReferences,w=e.config.get("htmlEmbed");this.editor.editing.view.on("render",()=>{for(const o of t){if(o.element&&o.element.isConnected)return;o.destroy(),t.delete(o)}},{priority:"lowest"}),e.data.registerRawContentMatcher({name:"div",classes:"raw-html-embed"}),e.conversion.for("upcast").elementToElement({view:{name:"div",classes:"raw-html-embed"},model:(o,{writer:l})=>l.createElement("rawHtml",{value:o.getCustomProperty("$rawContent")})}),e.conversion.for("dataDowncast").elementToElement({model:"rawHtml",view:(o,{writer:l})=>l.createRawElement("div",{class:"raw-html-embed"},function(s){s.innerHTML=o.getAttribute("value")||""})}),e.conversion.for("editingDowncast").elementToStructure({model:{name:"rawHtml",attributes:["value"]},view:(o,{writer:l})=>{let s,n,r;const c=l.createRawElement("div",{class:"raw-html-embed__content-wrapper"},function(u){s=u,h({editor:e,domElement:u,state:n,props:r}),s.addEventListener("mousedown",()=>{if(n.isEditable){const g=e.model;g.document.selection.getSelectedElement()!==o&&g.change(R=>R.setSelection(o,"on"))}},!0)}),p={makeEditable(){n=Object.assign({},n,{isEditable:!0}),h({domElement:s,editor:e,state:n,props:r}),a.change(u=>{u.setAttribute("data-cke-ignore-events","true",c)}),s.querySelector("textarea").focus()},save(u){u!==n.getRawHtmlValue()?(e.execute("htmlEmbed",u),e.editing.view.focus()):this.cancel()},cancel(){n=Object.assign({},n,{isEditable:!1}),h({domElement:s,editor:e,state:n,props:r}),e.editing.view.focus(),a.change(u=>{u.removeAttribute("data-cke-ignore-events",c)})}};n={showPreviews:w.showPreviews,isEditable:!1,getRawHtmlValue:()=>o.getAttribute("value")||""},r={sanitizeHtml:w.sanitizeHtml,textareaPlaceholder:i("Paste raw HTML here..."),onEditClick(){p.makeEditable()},onSaveClick(u){p.save(u)},onCancelClick(){p.cancel()}};const d=l.createContainerElement("div",{class:"raw-html-embed","data-html-embed-label":i("HTML snippet"),dir:e.locale.uiLanguageDirection},c);return l.setCustomProperty("rawHtmlApi",p,d),l.setCustomProperty("rawHtml",!0,d),S(d,l,{label:i("HTML snippet"),hasSelectionHandle:!0})}});function h({editor:o,domElement:l,state:s,props:n}){l.textContent="";const r=l.ownerDocument;let c;if(s.isEditable){const d={isDisabled:!1,placeholder:n.textareaPlaceholder};c=E({domDocument:r,state:s,props:d}),l.append(c)}else if(s.showPreviews){const d={sanitizeHtml:n.sanitizeHtml};l.append(x({domDocument:r,state:s,props:d,editor:o}))}else{const d={isDisabled:!0,placeholder:n.textareaPlaceholder};l.append(E({domDocument:r,state:s,props:d}))}const p={onEditClick:n.onEditClick,onSaveClick:()=>{n.onSaveClick(c.value)},onCancelClick:n.onCancelClick};l.prepend(k({editor:o,domDocument:r,state:s,props:p}))}function k({editor:o,domDocument:l,state:s,props:n}){const r=b(l,"div",{class:"raw-html-embed__buttons-wrapper"});if(s.isEditable){const c=v(o,"save",n.onSaveClick),p=v(o,"cancel",n.onCancelClick);r.append(c.element,p.element),t.add(c).add(p)}else{const c=v(o,"edit",n.onEditClick);r.append(c.element),t.add(c)}return r}function E({domDocument:o,state:l,props:s}){const n=b(o,"textarea",{placeholder:s.placeholder,class:"ck ck-reset ck-input ck-input-text raw-html-embed__source"});return n.disabled=s.isDisabled,n.value=l.getRawHtmlValue(),n}function x({editor:o,domDocument:l,state:s,props:n}){const r=n.sanitizeHtml(s.getRawHtmlValue()),c=s.getRawHtmlValue().length>0?i("No preview available"):i("Empty snippet content"),p=b(l,"div",{class:"ck ck-reset_all raw-html-embed__preview-placeholder"},c),d=b(l,"div",{class:"raw-html-embed__preview-content",dir:o.locale.contentLanguageDirection}),g=l.createRange().createContextualFragment(r.html);return d.appendChild(g),b(l,"div",{class:"raw-html-embed__preview"},[p,d])}}}function v(m,e,i){const{t:a}=m.locale,t=new P(m.locale),w=m.commands.get("htmlEmbed");return t.set({class:`raw-html-embed__${e}-button`,icon:C,tooltip:!0,tooltipPosition:m.locale.uiLanguageDirection==="rtl"?"e":"w"}),t.render(),e==="edit"?(t.set({icon:C,label:a("Edit source")}),t.bind("isEnabled").to(w)):e==="save"?(t.set({icon:D,label:a("Save changes")}),t.bind("isEnabled").to(w)):t.set({icon:M,label:a("Cancel")}),t.on("execute",i),t}class F extends f{static get pluginName(){return"HtmlEmbedUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,a=e.locale.t;e.ui.componentFactory.add("htmlEmbed",()=>{const t=this._createButton(P);return t.set({tooltip:!0,label:a("Insert HTML")}),t}),e.ui.componentFactory.add("menuBar:htmlEmbed",()=>{const t=this._createButton(T);return t.set({label:a("HTML snippet")}),t})}_createButton(e){const i=this.editor,a=i.commands.get("htmlEmbed"),t=new e(i.locale);return t.set({icon:L}),t.bind("isEnabled").to(a,"isEnabled"),this.listenTo(t,"execute",()=>{i.execute("htmlEmbed"),i.editing.view.focus(),i.editing.view.document.selection.getSelectedElement().getCustomProperty("rawHtmlApi").makeEditable()}),t}}class G extends f{static get requires(){return[z,F,V]}static get pluginName(){return"HtmlEmbed"}static get isOfficialPlugin(){return!0}}export{G as HtmlEmbed,y as HtmlEmbedCommand,z as HtmlEmbedEditing,F as HtmlEmbedUI};
@@ -0,0 +1,3 @@
1
+ import{Plugin as f}from"../../../../../@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{logWarning as X,global as R,uid as x,priorities as S,CKEditorError as Q,toArray as k,isValidAttributeName as Y}from"../../../../../@ckeditor_ckeditor5-utils@47.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{UpcastWriter as B,HtmlDataProcessor as J,Matcher as M,StylesMap as Z}from"../../../../../@ckeditor_ckeditor5-engine@47.3.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{Widget as ee,toWidget as K}from"../../../../../@ckeditor_ckeditor5-widget@47.3.0/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{Enter as te}from"../../../../../@ckeditor_ckeditor5-enter@47.3.0/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import{isEqual as N}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/predicate/isEqual.js";import{mergeWith as re}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/mergeWith.js";import{startCase as ie}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/string/startCase.js";import{isPlainObject as oe}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js";import{cloneDeep as le}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/cloneDeep.js";function p(s,e,r,i){e&&ne(s,e,i),r&&w(s,r,i)}function w(s,e,r){if(e.attributes)for(const[i,t]of Object.entries(e.attributes))s.setAttribute(i,t,r);e.styles&&s.setStyle(e.styles,r),e.classes&&s.addClass(e.classes,r)}function ne(s,e,r){if(e.attributes)for(const[i]of Object.entries(e.attributes))s.removeAttribute(i,r);if(e.styles)for(const i of Object.keys(e.styles))s.removeStyle(i,r);e.classes&&s.removeClass(e.classes,r)}function se(s,e){const r=le(s);let i="attributes";for(i in e)i=="classes"?r[i]=Array.from(new Set([...s[i]||[],...e[i]])):r[i]={...s[i],...e[i]};return r}function v(s,e,r,i,t){const o=e.getAttribute(r),l={};for(const n of["attributes","styles","classes"]){if(n!=i){o&&o[n]&&(l[n]=o[n]);continue}if(i=="classes"){const a=new Set(o&&o.classes||[]);t(a),a.size&&(l[n]=Array.from(a));continue}const m=new Map(Object.entries(o&&o[n]||{}));t(m),m.size&&(l[n]=Object.fromEntries(m))}Object.keys(l).length?e.is("documentSelection")?s.setSelectionAttribute(r,l):s.setAttribute(r,l,e):o&&(e.is("documentSelection")?s.removeSelectionAttribute(r):s.removeAttribute(r,e))}function me(s,e,r){for(const i of e.getItems({shallow:!0})){const t=i.getAttribute(s);t&&t.attributes&&Object.keys(t.attributes).length?Object.keys(t).length>1&&r.setAttribute(s,{attributes:t.attributes},i):r.removeAttribute(s,i)}}function ae(s){return ie(s).replace(/ /g,"")}function b(s){return`html${ae(s)}Attributes`}function V({model:s}){return(e,r)=>r.writer.createElement(s,{htmlContent:e.getCustomProperty("$rawContent")})}function ue(s,{view:e,isInline:r}){const i=s.t;return(t,{writer:o})=>{const l=i("HTML object"),n=P(e,t,o),m=t.getAttribute(b(e));o.addClass("html-object-embed__content",n),m&&w(o,m,n);const a=o.createContainerElement(r?"span":"div",{class:"html-object-embed","data-html-object-embed-label":l},n);return K(a,o,{label:l})}}function P(s,e,r){return r.createRawElement(s,null,(i,t)=>{t.setContentOf(i,e.getAttribute("htmlContent"))})}function ce({view:s,model:e,allowEmpty:r},i){return o=>{o.on(`element:${s}`,(l,n,m)=>{let a=i.processViewAttributes(n.viewItem,m);if(!(!a&&!m.consumable.test(n.viewItem,{name:!0}))){if(a=a||{},m.consumable.consume(n.viewItem,{name:!0}),n.modelRange||(n=Object.assign(n,m.convertChildren(n.viewItem,n.modelCursor))),r&&n.modelRange.isCollapsed&&Object.keys(a).length){const u=m.writer.createElement("htmlEmptyElement");if(!m.safeInsert(u,n.modelCursor))return;const c=m.getSplitParts(u);n.modelRange=m.writer.createRange(n.modelRange.start,m.writer.createPositionAfter(c[c.length-1])),m.updateConversionResult(u,n),t(u,a,m);return}for(const u of n.modelRange.getItems())t(u,a,m)}},{priority:"low"})};function t(o,l,n){if(n.schema.checkAttribute(o,e)){const m=o.getAttribute(e),a=se(l,m||{});n.writer.setAttribute(e,a,o)}}}function j({model:s,view:e},r){return(i,{writer:t,consumable:o})=>{if(!i.hasAttribute(s))return null;const l=t.createContainerElement(e),n=i.getAttribute(s);return o.consume(i,`attribute:${s}`),w(t,n,l),l.getFillerOffset=()=>null,r?K(l,t):l}}function de({priority:s,view:e}){return(r,i)=>{if(!r)return;const{writer:t}=i,o=t.createAttributeElement(e,null,{priority:s});return w(t,r,o),o}}function E({view:s},e){return r=>{r.on(`element:${s}`,(i,t,o)=>{if(!t.modelRange||t.modelRange.isCollapsed)return;const l=e.processViewAttributes(t.viewItem,o);l&&o.writer.setAttribute(b(t.viewItem.name),l,t.modelRange)},{priority:"low"})}}function F({view:s,model:e}){return r=>{r.on(`attribute:${b(s)}:${e}`,(i,t,o)=>{if(!o.consumable.consume(t.item,i.name))return;const{attributeOldValue:l,attributeNewValue:n}=t,m=o.writer,a=o.mapper.toViewElement(t.item);p(m,l,n,a)})}}const L={block:[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"tableColumnGroup",view:"colgroup"},{model:"tableColumn",view:"col"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"horizontalLine",view:"hr"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!1}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:!1}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:!1}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!1}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6","$text"],allowIn:"htmlDetails",isBlock:!1}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowIn:["$root","$container"],allowChildren:["paragraph","htmlP","htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!1}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:!1}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:!1}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDivDl",view:"div",modelSchema:{allowChildren:["htmlDt","htmlDd"],allowIn:"htmlDl"}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd","htmlDivDl"],isBlock:!1}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlHr",view:"hr",isEmpty:!0,modelSchema:{inheritAllFrom:"$blockObject"}}],inline:[{model:"htmlLiAttributes",view:"li",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlOlAttributes",view:"ol",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlUlAttributes",view:"ul",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"table"},{model:"htmlTheadAttributes",view:"thead",appliesToBlock:"table"},{model:"htmlTbodyAttributes",view:"tbody",appliesToBlock:"table"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"imageBlock"},{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref",attributeProperties:{isFormatting:!0}},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],allowAttributesOf:"$inlineObject",isInline:!0}}]};class C extends f{_definitions=[];static get pluginName(){return"DataSchema"}static get isOfficialPlugin(){return!0}init(){for(const e of L.block)this.registerBlockElement(e);for(const e of L.inline)this.registerInlineElement(e)}registerBlockElement(e){this._definitions.push({...e,isBlock:!0})}registerInlineElement(e){this._definitions.push({...e,isInline:!0})}extendBlockElement(e){this._extendDefinition({...e,isBlock:!0})}extendInlineElement(e){this._extendDefinition({...e,isInline:!0})}getDefinitionsForView(e,r=!1){const i=new Set;for(const t of this._getMatchingViewDefinitions(e)){if(r)for(const o of this._getReferences(t.model))i.add(o);i.add(t)}return i}getDefinitionsForModel(e){return this._definitions.filter(r=>r.model==e)}_getMatchingViewDefinitions(e){return this._definitions.filter(r=>r.view&&he(e,r.view))}*_getReferences(e){const r=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"],i=this._definitions.filter(t=>t.model==e);for(const{modelSchema:t}of i)if(t)for(const o of r)for(const l of k(t[o]||[])){const n=this._definitions.filter(m=>m.model==l);for(const m of n)l!==e&&(yield*this._getReferences(m.model),yield m)}}_extendDefinition(e){const r=Array.from(this._definitions.entries()).filter(([,i])=>i.model==e.model);if(r.length==0){this._definitions.push(e);return}for(const[i,t]of r)this._definitions[i]=re({},t,e,(o,l)=>Array.isArray(o)?o.concat(l):void 0)}}function he(s,e){return typeof s=="string"?s===e:s instanceof RegExp?s.test(e):!1}class h extends f{_dataSchema;_allowedAttributes;_disallowedAttributes;_allowedElements;_disallowedElements;_dataInitialized;_coupledAttributes;constructor(e){super(e),this._dataSchema=e.plugins.get("DataSchema"),this._allowedAttributes=new M,this._disallowedAttributes=new M,this._allowedElements=new Set,this._disallowedElements=new Set,this._dataInitialized=!1,this._coupledAttributes=null,this._registerElementsAfterInit(),this._registerElementHandlers(),this._registerCoupledAttributesPostFixer(),this._registerAssociatedHtmlAttributesPostFixer()}static get pluginName(){return"DataFilter"}static get isOfficialPlugin(){return!0}static get requires(){return[C,ee]}loadAllowedConfig(e){for(const r of e){const i=r.name||/[\s\S]+/,t=U(r);this.allowElement(i),t.forEach(o=>this.allowAttributes(o))}}loadDisallowedConfig(e){for(const r of e){const i=r.name||/[\s\S]+/,t=U(r);t.length==0?this.disallowElement(i):t.forEach(o=>this.disallowAttributes(o))}}loadAllowedEmptyElementsConfig(e){for(const r of e)this.allowEmptyElement(r)}allowElement(e){for(const r of this._dataSchema.getDefinitionsForView(e,!0))this._addAllowedElement(r),this._coupledAttributes=null}disallowElement(e){for(const r of this._dataSchema.getDefinitionsForView(e,!1))this._disallowedElements.add(r.view)}allowEmptyElement(e){for(const r of this._dataSchema.getDefinitionsForView(e,!0))r.isInline&&this._dataSchema.extendInlineElement({...r,allowEmpty:!0})}allowAttributes(e){this._allowedAttributes.add(e)}disallowAttributes(e){this._disallowedAttributes.add(e)}processViewAttributes(e,r){const{consumable:i}=r;return W(e,this._disallowedAttributes,i),fe(e,W(e,this._allowedAttributes,i))}_addAllowedElement(e){if(!this._allowedElements.has(e)){if(this._allowedElements.add(e),"appliesToBlock"in e&&typeof e.appliesToBlock=="string")for(const r of this._dataSchema.getDefinitionsForModel(e.appliesToBlock))r.isBlock&&this._addAllowedElement(r);this._dataInitialized&&this.editor.data.once("set",()=>{this._fireRegisterEvent(e)},{priority:S.highest+1})}}_registerElementsAfterInit(){this.editor.data.on("init",()=>{this._dataInitialized=!0;for(const e of this._allowedElements)this._fireRegisterEvent(e)},{priority:S.highest+1})}_registerElementHandlers(){this.on("register",(e,r)=>{const i=this.editor.model.schema;if(r.isObject&&!i.isRegistered(r.model))this._registerObjectElement(r);else if(r.isBlock)this._registerBlockElement(r);else if(r.isInline)this._registerInlineElement(r);else throw new Q("data-filter-invalid-definition",null,r);e.stop()},{priority:"lowest"})}_registerCoupledAttributesPostFixer(){const e=this.editor.model,r=e.document.selection;e.document.registerPostFixer(i=>{const t=e.document.differ.getChanges();let o=!1;const l=this._getCoupledAttributesMap();for(const n of t){if(n.type!="attribute"||n.attributeNewValue!==null)continue;const m=l.get(n.attributeKey);if(m)for(const{item:a}of n.range.getWalker())for(const u of m)a.hasAttribute(u)&&(i.removeAttribute(u,a),o=!0)}return o}),this.listenTo(r,"change:attribute",(i,{attributeKeys:t})=>{const o=new Set,l=this._getCoupledAttributesMap();for(const n of t){if(r.hasAttribute(n))continue;const m=l.get(n);if(m)for(const a of m)r.hasAttribute(a)&&o.add(a)}o.size!=0&&e.change(n=>{for(const m of o)n.removeSelectionAttribute(m)})})}_registerAssociatedHtmlAttributesPostFixer(){const e=this.editor.model;e.document.registerPostFixer(r=>{const i=e.document.differ.getChanges();let t=!1;for(const o of i)if(!(o.type!=="insert"||o.name==="$text"))for(const l of o.attributes.keys())!l.startsWith("html")||!l.endsWith("Attributes")||e.schema.checkAttribute(o.name,l)||(r.removeAttribute(l,o.position.nodeAfter),t=!0);return t})}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const e of this._allowedElements)if(e.coupledAttribute&&e.model){const r=this._coupledAttributes.get(e.coupledAttribute);r?r.push(e.model):this._coupledAttributes.set(e.coupledAttribute,[e.model])}return this._coupledAttributes}_fireRegisterEvent(e){e.view&&this._disallowedElements.has(e.view)||this.fire(e.view?`register:${e.view}`:"register",e)}_registerObjectElement(e){const r=this.editor,i=r.model.schema,t=r.conversion,{view:o,model:l}=e;i.register(l,e.modelSchema);o&&(i.extend(e.model,{allowAttributes:[b(o),"htmlContent"]}),r.data.registerRawContentMatcher({name:o}),t.for("upcast").elementToElement({view:o,model:V(e),converterPriority:S.low+2}),t.for("upcast").add(E(e,this)),t.for("editingDowncast").elementToStructure({model:{name:l,attributes:[b(o)]},view:ue(r,e)}),t.for("dataDowncast").elementToElement({model:l,view:(n,{writer:m})=>P(o,n,m)}),t.for("dataDowncast").add(F(e)))}_registerBlockElement(e){const r=this.editor,i=r.model.schema,t=r.conversion,{view:o,model:l}=e;if(!i.isRegistered(e.model)){if(!e.modelSchema||(i.register(e.model,e.modelSchema),!o))return;t.for("upcast").elementToElement({model:l,view:o,converterPriority:S.low+2}),t.for("downcast").elementToElement({model:l,view:(n,{writer:m})=>e.isEmpty?m.createEmptyElement(o):m.createContainerElement(o)})}o&&(i.extend(e.model,{allowAttributes:b(o)}),t.for("upcast").add(E(e,this)),t.for("downcast").add(F(e)))}_registerInlineElement(e){const r=this.editor,i=r.model.schema,t=r.conversion,o=e.model;if(!e.appliesToBlock&&(i.extend("$text",{allowAttributes:o}),e.attributeProperties&&i.setAttributeProperties(o,e.attributeProperties),t.for("upcast").add(ce(e,this)),t.for("downcast").attributeToElement({model:o,view:de(e)}),!!e.allowEmpty)){if(i.setAttributeProperties(o,{copyFromObject:!1}),!i.isRegistered("htmlEmptyElement")){i.register("htmlEmptyElement",{inheritAllFrom:"$inlineObject"});const l=n=>Array.from(n.getAttributeKeys()).some(m=>m.startsWith("html"));r.model.document.registerPostFixer(n=>{const m=r.model.document.differ.getChanges(),a=new Set;for(const u of m)if(u.type!=="remove"){if(u.type==="attribute"&&u.attributeNewValue===null)for(const{item:c}of u.range)c.is("element","htmlEmptyElement")&&!l(c)&&a.add(c);if(u.type==="insert"&&u.position.nodeAfter){const c=u.position.nodeAfter;for(const{item:d}of n.createRangeOn(c))d.is("element","htmlEmptyElement")&&!l(d)&&a.add(d)}}for(const u of a)n.remove(u);return a.size>0})}r.data.htmlProcessor.domConverter.registerInlineObjectMatcher(l=>l.name==e.view&&l.isEmpty&&Array.from(l.getAttributeKeys()).length?{name:!0}:null),t.for("editingDowncast").elementToElement({model:"htmlEmptyElement",view:j(e,!0)}),t.for("dataDowncast").elementToElement({model:"htmlEmptyElement",view:j(e)})}}}function W(s,e,r){const i=e.matchAll(s)||[],t=s.document.stylesProcessor;return i.reduce((o,{match:l})=>{for(const[n,m]of l.attributes||[])if(n=="style"){const a=m,u=t.getRelatedStyles(a).filter(c=>c.split("-").length>a.split("-").length).sort((c,d)=>d.split("-").length-c.split("-").length);for(const c of u)r.consume(s,{styles:[c]})&&o.styles.push(c);r.consume(s,{styles:[a]})&&o.styles.push(a)}else if(n=="class"){const a=m;r.consume(s,{classes:[a]})&&o.classes.push(a)}else r.consume(s,{attributes:[n]})&&o.attributes.push(n);return o},{attributes:[],classes:[],styles:[]})}function fe(s,{attributes:e,classes:r,styles:i}){return!e.length&&!r.length&&!i.length?null:{...e.length&&{attributes:ge(s,e)},...i.length&&{styles:be(s,i)},...r.length&&{classes:r}}}function ge(s,e){const r={};for(const i of e){const t=s.getAttribute(i);t!==void 0&&Y(i)&&(r[i]=t)}return r}function be(s,e){const r=new Z(s.document.stylesProcessor);for(const i of e){const t=s.getStyle(i);t!==void 0&&r.set(i,t)}return Object.fromEntries(r.getStylesEntries())}function D(s,e){const{name:r}=s,i=s[e];return oe(i)?Object.entries(i).map(([t,o])=>({name:r,[e]:{[t]:o}})):Array.isArray(i)?i.map(t=>({name:r,[e]:[t]})):[s]}function U(s){const{name:e,attributes:r,classes:i,styles:t}=s,o=[];return r&&o.push(...D({name:e,attributes:r},"attributes")),i&&o.push(...D({name:e,classes:i},"classes")),t&&o.push(...D({name:e,styles:t},"styles")),o}class pe extends f{static get requires(){return[h]}static get pluginName(){return"CodeBlockElementSupport"}static get isOfficialPlugin(){return!0}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const e=this.editor.plugins.get(h);e.on("register:pre",(r,i)=>{if(i.model!=="codeBlock")return;const t=this.editor,o=t.model.schema,l=t.conversion;o.extend("codeBlock",{allowAttributes:["htmlPreAttributes","htmlContentAttributes"]}),l.for("upcast").add(we(e)),l.for("downcast").add(Ae()),r.stop()})}}function we(s){return e=>{e.on("element:code",(r,i,t)=>{const o=i.viewItem,l=o.parent;if(!l||!l.is("element","pre"))return;n(l,"htmlPreAttributes"),n(o,"htmlContentAttributes");function n(m,a){const u=s.processViewAttributes(m,t);u&&t.writer.setAttribute(a,u,i.modelRange)}},{priority:"low"})}}function Ae(){return s=>{s.on("attribute:htmlPreAttributes:codeBlock",(e,r,i)=>{if(!i.consumable.consume(r.item,e.name))return;const{attributeOldValue:t,attributeNewValue:o}=r,n=i.mapper.toViewElement(r.item).parent;p(i.writer,t,o,n)}),s.on("attribute:htmlContentAttributes:codeBlock",(e,r,i)=>{if(!i.consumable.consume(r.item,e.name))return;const{attributeOldValue:t,attributeNewValue:o}=r,l=i.mapper.toViewElement(r.item);p(i.writer,t,o,l)})}}class ve extends f{static get requires(){return[h]}static get pluginName(){return"DualContentModelElementSupport"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(h).on("register",(r,i)=>{const t=i,o=this.editor,l=o.model.schema,n=o.conversion;if(!t.paragraphLikeModel||l.isRegistered(t.model)||l.isRegistered(t.paragraphLikeModel))return;const m={model:t.paragraphLikeModel,view:t.view};l.register(t.model,t.modelSchema),l.register(m.model,{inheritAllFrom:"$block"}),n.for("upcast").elementToElement({view:t.view,model:(a,{writer:u})=>this._hasBlockContent(a)?u.createElement(t.model):u.createElement(m.model),converterPriority:S.low+.5}),n.for("downcast").elementToElement({view:t.view,model:t.model}),this._addAttributeConversion(t),n.for("downcast").elementToElement({view:m.view,model:m.model}),this._addAttributeConversion(m),r.stop()})}_hasBlockContent(e){const r=this.editor.editing.view,i=r.domConverter.blockElements;for(const t of r.createRangeIn(e).getItems())if(t.is("element")&&i.includes(t.name))return!0;return!1}_addAttributeConversion(e){const r=this.editor,i=r.conversion,t=r.plugins.get(h);r.model.schema.extend(e.model,{allowAttributes:b(e.view)}),i.for("upcast").add(E(e,t)),i.for("downcast").add(F(e))}}class ye extends f{static get requires(){return[C,te]}static get pluginName(){return"HeadingElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("HeadingEditing"))return;const r=e.config.get("heading.options");this.registerHeadingElements(e,r)}registerHeadingElements(e,r){const i=e.plugins.get(C),t=[];for(const o of r)"model"in o&&"view"in o&&(i.registerBlockElement({view:o.view,model:o.model}),t.push(o.model));i.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:t}}),i.extendBlockElement({model:"htmlSummary",modelSchema:{allowChildren:t}})}}function O(s,e,r){const i=s.createRangeOn(e);for(const{item:t}of i.getWalker())if(t.is("element",r))return t}class Ee extends f{static get requires(){return[h]}static get pluginName(){return"ImageElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("ImageInlineEditing")&&!e.plugins.has("ImageBlockEditing"))return;const r=e.model.schema,i=e.conversion,t=e.plugins.get(h);t.on("register:figure",()=>{i.for("upcast").add(ke(t))}),t.on("register:img",(o,l)=>{l.model!=="imageBlock"&&l.model!=="imageInline"||(r.isRegistered("imageBlock")&&r.extend("imageBlock",{allowAttributes:["htmlImgAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),r.isRegistered("imageInline")&&r.extend("imageInline",{allowAttributes:["htmlA","htmlImgAttributes"]}),i.for("upcast").add(Ce(t)),i.for("downcast").add(Fe()),e.plugins.has("LinkImage")&&i.for("upcast").add(Se(t,e)),o.stop())})}}function Ce(s){return e=>{e.on("element:img",(r,i,t)=>{if(!i.modelRange)return;const o=i.viewItem,l=s.processViewAttributes(o,t);l&&t.writer.setAttribute("htmlImgAttributes",l,i.modelRange)},{priority:"low"})}}function Se(s,e){const r=e.plugins.get("ImageUtils");return i=>{i.on("element:a",(t,o,l)=>{const n=o.viewItem;if(!r.findViewImgElement(n))return;const a=o.modelCursor.parent;if(!a.is("element","imageBlock"))return;const u=s.processViewAttributes(n,l);u&&l.writer.setAttribute("htmlLinkAttributes",u,a)},{priority:"low"})}}function ke(s){return e=>{e.on("element:figure",(r,i,t)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("image"))return;const l=s.processViewAttributes(o,t);l&&t.writer.setAttribute("htmlFigureAttributes",l,i.modelRange)},{priority:"low"})}}function Fe(){return s=>{e("htmlImgAttributes"),r("img","htmlImgAttributes"),r("figure","htmlFigureAttributes"),r("a","htmlLinkAttributes");function e(i){s.on(`attribute:${i}:imageInline`,(t,o,l)=>{if(!l.consumable.consume(o.item,t.name))return;const{attributeOldValue:n,attributeNewValue:m}=o,a=l.mapper.toViewElement(o.item);p(l.writer,n,m,a)},{priority:"low"})}function r(i,t){s.on(`attribute:${t}:imageBlock`,(o,l,n)=>{if(!n.consumable.test(l.item,o.name))return;const{attributeOldValue:m,attributeNewValue:a}=l,u=n.mapper.toViewElement(l.item),c=O(n.writer,u,i);c&&(p(n.writer,m,a,c),n.consumable.consume(l.item,o.name))},{priority:"low"}),i==="a"&&s.on("attribute:linkHref:imageBlock",(o,l,n)=>{if(!n.consumable.consume(l.item,"attribute:htmlLinkAttributes:imageBlock"))return;const m=n.mapper.toViewElement(l.item),a=O(n.writer,m,"a");w(n.writer,l.item.getAttribute("htmlLinkAttributes"),a)},{priority:"low"})}}}class Oe extends f{static get requires(){return[h]}static get pluginName(){return"MediaEmbedElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("MediaEmbed")||e.config.get("mediaEmbed.previewsInData"))return;const r=e.model.schema,i=e.conversion,t=this.editor.plugins.get(h),o=this.editor.plugins.get(C),l=e.config.get("mediaEmbed.elementName");o.registerBlockElement({model:"media",view:l}),t.on("register:figure",()=>{i.for("upcast").add(Pe(t))}),t.on(`register:${l}`,(n,m)=>{m.model==="media"&&(r.extend("media",{allowAttributes:[b(l),"htmlFigureAttributes"]}),i.for("upcast").add(Te(t,l)),i.for("dataDowncast").add(Ie(l)),n.stop())})}}function Te(s,e){const r=(i,t,o)=>{const l=t.viewItem;n(l,b(e));function n(m,a){const u=s.processViewAttributes(m,o);u&&o.writer.setAttribute(a,u,t.modelRange)}};return i=>{i.on(`element:${e}`,r,{priority:"low"})}}function Pe(s){return e=>{e.on("element:figure",(r,i,t)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("media"))return;const l=s.processViewAttributes(o,t);l&&t.writer.setAttribute("htmlFigureAttributes",l,i.modelRange)},{priority:"low"})}}function Ie(s){return e=>{r(s,b(s)),r("figure","htmlFigureAttributes");function r(i,t){e.on(`attribute:${t}:media`,(o,l,n)=>{if(!n.consumable.consume(l.item,o.name))return;const{attributeOldValue:m,attributeNewValue:a}=l,u=n.mapper.toViewElement(l.item),c=O(n.writer,u,i);p(n.writer,m,a,c)})}}}class $e extends f{static get requires(){return[h]}static get pluginName(){return"ScriptElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(h);e.on("register:script",(r,i)=>{const t=this.editor,o=t.model.schema,l=t.conversion;o.register("htmlScript",i.modelSchema),o.extend("htmlScript",{allowAttributes:["htmlScriptAttributes","htmlContent"],isContent:!0}),t.data.registerRawContentMatcher({name:"script"}),l.for("upcast").elementToElement({view:"script",model:V(i)}),l.for("upcast").add(E(i,e)),l.for("downcast").elementToElement({model:"htmlScript",view:(n,{writer:m})=>P("script",n,m)}),l.for("downcast").add(F(i)),r.stop()})}}const _e=["width","max-width","min-width","height","min-height","max-height"];class De extends f{static get requires(){return[h]}static get pluginName(){return"TableElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("TableEditing"))return;const r=e.model.schema,i=e.conversion,t=e.plugins.get(h),o=e.plugins.get("TableUtils");t.on("register:figure",()=>{i.for("upcast").add(Ve(t))}),t.on("register:table",(l,n)=>{n.model==="table"&&(r.extend("table",{allowAttributes:["htmlTableAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),i.for("upcast").add(Be(t)),i.for("downcast").add(Re()),e.model.document.registerPostFixer(He(e.model,o)),l.stop())})}}function He(s,e){return r=>{const i=s.document.differ.getChanges();let t=!1;for(const o of i){if(o.type!="attribute"||o.attributeKey!="headingRows")continue;const l=o.range.start.nodeAfter,n=l.getAttribute("htmlTheadAttributes"),m=l.getAttribute("htmlTbodyAttributes");n&&!o.attributeNewValue?(r.removeAttribute("htmlTheadAttributes",l),t=!0):m&&o.attributeNewValue==e.getRows(l)&&(r.removeAttribute("htmlTbodyAttributes",l),t=!0)}return t}}function Be(s){return e=>{e.on("element:table",(r,i,t)=>{if(!i.modelRange)return;const o=i.viewItem;t.consumable.consume(o,{classes:"table"}),l(o,"htmlTableAttributes");for(const n of o.getChildren())n.is("element","thead")&&l(n,"htmlTheadAttributes"),n.is("element","tbody")&&l(n,"htmlTbodyAttributes");function l(n,m){const a=s.processViewAttributes(n,t);a&&t.writer.setAttribute(m,a,i.modelRange)}},{priority:"low"})}}function Ve(s){return e=>{e.on("element:figure",(r,i,t)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("table"))return;const l=s.processViewAttributes(o,t);l&&t.writer.setAttribute("htmlFigureAttributes",l,i.modelRange)},{priority:"low"})}}function Re(){return s=>{e("table","htmlTableAttributes"),e("figure","htmlFigureAttributes"),e("thead","htmlTheadAttributes"),e("tbody","htmlTbodyAttributes");function e(r,i){s.on(`attribute:${i}:table`,(t,o,l)=>{if(!l.consumable.test(o.item,t.name))return;const n=l.mapper.toViewElement(o.item),m=O(l.writer,n,r);if(m)if(l.consumable.consume(o.item,t.name),i==="htmlTableAttributes"&&n!==m){const a=q(o.attributeOldValue),u=q(o.attributeNewValue);p(l.writer,a.tableAttributes,u.tableAttributes,m),p(l.writer,a.figureAttributes,u.figureAttributes,n)}else p(l.writer,o.attributeOldValue,o.attributeNewValue,m)})}}}function q(s){const e={},r={...s};if(!s||!("styles"in s))return{figureAttributes:e,tableAttributes:r};r.styles={};for(const[i,t]of Object.entries(s.styles))_e.includes(i)?e.styles={...e.styles,[i]:t}:r.styles={...r.styles,[i]:t};return{figureAttributes:e,tableAttributes:r}}class xe extends f{static get requires(){return[h]}static get pluginName(){return"StyleElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(h);e.on("register:style",(r,i)=>{const t=this.editor,o=t.model.schema,l=t.conversion;o.register("htmlStyle",i.modelSchema),o.extend("htmlStyle",{allowAttributes:["htmlStyleAttributes","htmlContent"],isContent:!0}),t.data.registerRawContentMatcher({name:"style"}),l.for("upcast").elementToElement({view:"style",model:V(i)}),l.for("upcast").add(E(i,e)),l.for("downcast").elementToElement({model:"htmlStyle",view:(n,{writer:m})=>P("style",n,m)}),l.for("downcast").add(F(i)),r.stop()})}}class Me extends f{static get requires(){return[h]}static get pluginName(){return"ListElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("ListEditing"))return;const r=e.model.schema,i=e.conversion,t=e.plugins.get(h),o=e.plugins.get("ListEditing"),l=e.plugins.get("ListUtils"),n=["ul","ol","li"];o.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast:w}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlUlAttributes",setAttributeOnDowncast:w}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlOlAttributes",setAttributeOnDowncast:w}),t.on("register",(m,a)=>{if(!n.includes(a.view)||(m.stop(),r.checkAttribute("$block","htmlLiAttributes")))return;const u=n.map(c=>b(c));r.extend("$listItem",{allowAttributes:u}),i.for("upcast").add(c=>{c.on("element:ul",H("htmlUlAttributes",t),{priority:"low"}),c.on("element:ol",H("htmlOlAttributes",t),{priority:"low"}),c.on("element:li",H("htmlLiAttributes",t),{priority:"low"})})}),o.on("postFixer",(m,{listNodes:a,writer:u})=>{for(const{node:c,previousNodeInList:d}of a)if(d){if(d.getAttribute("listType")==c.getAttribute("listType")){const g=z(d.getAttribute("listType")),A=d.getAttribute(g);!N(c.getAttribute(g),A)&&u.model.schema.checkAttribute(c,g)&&(u.setAttribute(g,A,c),m.return=!0)}if(d.getAttribute("listItemId")==c.getAttribute("listItemId")){const g=d.getAttribute("htmlLiAttributes");!N(c.getAttribute("htmlLiAttributes"),g)&&u.model.schema.checkAttribute(c,"htmlLiAttributes")&&(u.setAttribute("htmlLiAttributes",g,c),m.return=!0)}}}),o.on("postFixer",(m,{listNodes:a,writer:u})=>{for(const{node:c}of a){const d=c.getAttribute("listType");!l.isNumberedListType(d)&&c.getAttribute("htmlOlAttributes")&&(u.removeAttribute("htmlOlAttributes",c),m.return=!0),l.isNumberedListType(d)&&c.getAttribute("htmlUlAttributes")&&(u.removeAttribute("htmlUlAttributes",c),m.return=!0)}})}afterInit(){const e=this.editor;if(!e.commands.get("indentList"))return;const r=e.commands.get("indentList");this.listenTo(r,"afterExecute",(i,t)=>{e.model.change(o=>{for(const l of t){const n=z(l.getAttribute("listType"));e.model.schema.checkAttribute(l,n)&&o.setAttribute(n,{},l)}})})}}function H(s,e){return(r,i,t)=>{const o=i.viewItem;i.modelRange||Object.assign(i,t.convertChildren(i.viewItem,i.modelCursor));const l=e.processViewAttributes(o,t);for(const n of i.modelRange.getItems({shallow:!0}))n.hasAttribute("listItemId")&&(n.hasAttribute("htmlUlAttributes")||n.hasAttribute("htmlOlAttributes")||t.writer.model.schema.checkAttribute(n,s)&&t.writer.setAttribute(s,l||{},n))}}function z(s){return s==="numbered"||s=="customNumbered"?"htmlOlAttributes":"htmlUlAttributes"}class Ne extends f{static get requires(){return[h]}static get pluginName(){return"HorizontalLineElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("HorizontalLineEditing"))return;const r=e.model.schema,i=e.conversion,t=e.plugins.get(h);t.on("register:hr",(o,l)=>{l.model==="horizontalLine"&&(r.extend("horizontalLine",{allowAttributes:["htmlHrAttributes"]}),i.for("upcast").add(E(l,t)),i.for("downcast").add(je()),o.stop())})}}function je(){return s=>{s.on("attribute:htmlHrAttributes:horizontalLine",(e,r,i)=>{if(!i.consumable.test(r.item,e.name))return;const{attributeOldValue:t,attributeNewValue:o}=r,l=i.mapper.toViewElement(r.item),n=O(i.writer,l,"hr");n&&(p(i.writer,t,o,n),i.consumable.consume(r.item,e.name))},{priority:"low"})}}class Le extends f{static get requires(){return[h,C]}static get pluginName(){return"CustomElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(h),r=this.editor.plugins.get(C);e.on("register:$customElement",(i,t)=>{i.stop();const o=this.editor,l=o.model.schema,n=o.conversion,m=o.editing.view.domConverter.unsafeElements,a=o.data.htmlProcessor.domConverter.preElements;l.register(t.model,t.modelSchema),l.extend(t.model,{allowAttributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"],isContent:!0}),o.data.htmlProcessor.domConverter.registerRawContentMatcher({name:"template"}),n.for("upcast").elementToElement({view:/.*/,model:(u,c)=>{if(u.name=="$comment")return null;if(!We(u.name)||r.getDefinitionsForView(u.name).size)return null;m.includes(u.name)||m.push(u.name),a.includes(u.name)||a.push(u.name);const d=c.writer.createElement(t.model,{htmlElementName:u.name}),g=e.processViewAttributes(u,c);g&&c.writer.setAttribute("htmlCustomElementAttributes",g,d);let A;if(u.is("element","template")&&u.getCustomProperty("$rawContent"))A=u.getCustomProperty("$rawContent");else{const I=new B(u.document).createDocumentFragment(u),$=o.data.htmlProcessor.domConverter.viewToDom(I),_=$.firstChild;for(;_.firstChild;)$.appendChild(_.firstChild);_.remove(),A=o.data.htmlProcessor.htmlWriter.getHtml($)}c.writer.setAttribute("htmlContent",A,d);for(const{item:T}of o.editing.view.createRangeIn(u))c.consumable.consume(T,{name:!0});return d},converterPriority:"low"}),n.for("editingDowncast").elementToElement({model:{name:t.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(u,{writer:c})=>{const d=u.getAttribute("htmlElementName"),g=c.createRawElement(d);return u.hasAttribute("htmlCustomElementAttributes")&&w(c,u.getAttribute("htmlCustomElementAttributes"),g),g}}),n.for("dataDowncast").elementToElement({model:{name:t.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(u,{writer:c})=>{const d=u.getAttribute("htmlElementName"),g=u.getAttribute("htmlContent"),A=c.createRawElement(d,null,(T,I)=>{I.setContentOf(T,g)});return u.hasAttribute("htmlCustomElementAttributes")&&w(c,u.getAttribute("htmlCustomElementAttributes"),A),A}})})}}function We(s){try{document.createElement(s)}catch{return!1}return!0}class rt extends f{static get pluginName(){return"GeneralHtmlSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[h,pe,ve,ye,Ee,Oe,$e,De,xe,Me,Ne,Le]}init(){const e=this.editor,r=e.plugins.get(h);r.loadAllowedEmptyElementsConfig(e.config.get("htmlSupport.allowEmpty")||[]),r.loadAllowedConfig(e.config.get("htmlSupport.allow")||[]),r.loadDisallowedConfig(e.config.get("htmlSupport.disallow")||[])}afterInit(){this.editor.commands.get("removeFormat")?.registerCustomAttribute(r=>r.startsWith("html")&&r.endsWith("Attributes"),me)}getGhsAttributeNameForElement(e){const r=this.editor.plugins.get("DataSchema"),i=Array.from(r.getDefinitionsForView(e,!1)),t=i.find(o=>o.isInline&&!i[0].isObject);return t?t.model:b(e)}addModelHtmlClass(e,r,i){const t=this.editor.model,o=this.getGhsAttributeNameForElement(e);t.change(l=>{for(const n of y(t,i,o))v(l,n,o,"classes",m=>{for(const a of k(r))m.add(a)})})}removeModelHtmlClass(e,r,i){const t=this.editor.model,o=this.getGhsAttributeNameForElement(e);t.change(l=>{for(const n of y(t,i,o))v(l,n,o,"classes",m=>{for(const a of k(r))m.delete(a)})})}setModelHtmlAttributes(e,r,i){const t=this.editor.model,o=this.getGhsAttributeNameForElement(e);t.change(l=>{for(const n of y(t,i,o))v(l,n,o,"attributes",m=>{for(const[a,u]of Object.entries(r))m.set(a,u)})})}removeModelHtmlAttributes(e,r,i){const t=this.editor.model,o=this.getGhsAttributeNameForElement(e);t.change(l=>{for(const n of y(t,i,o))v(l,n,o,"attributes",m=>{for(const a of k(r))m.delete(a)})})}setModelHtmlStyles(e,r,i){const t=this.editor.model,o=this.getGhsAttributeNameForElement(e);t.change(l=>{for(const n of y(t,i,o))v(l,n,o,"styles",m=>{for(const[a,u]of Object.entries(r))m.set(a,u)})})}removeModelHtmlStyles(e,r,i){const t=this.editor.model,o=this.getGhsAttributeNameForElement(e);t.change(l=>{for(const n of y(t,i,o))v(l,n,o,"styles",m=>{for(const a of k(r))m.delete(a)})})}}function*y(s,e,r){if(e)if(!(Symbol.iterator in e)&&e.is("documentSelection")&&e.isCollapsed)s.schema.checkAttributeInSelection(e,r)&&(yield e);else for(const i of Ue(s,e,r))yield*i.getItems({shallow:!0})}function Ue(s,e,r){return!(Symbol.iterator in e)&&(e.is("node")||e.is("$text")||e.is("$textProxy"))?s.schema.checkAttribute(e,r)?[s.createRangeOn(e)]:[]:s.schema.getValidRanges(s.createSelection(e).getRanges(),r)}class it extends f{static get pluginName(){return"HtmlComment"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,r=new Map;e.data.processor.skipComments=!1,e.model.schema.addAttributeCheck((i,t)=>{if(i.endsWith("$root")&&t.startsWith("$comment"))return!0}),e.conversion.for("upcast").elementToMarker({view:"$comment",model:i=>{const o=`$comment:${x()}`,l=i.getCustomProperty("$rawContent");return r.set(o,l),o}}),e.conversion.for("dataDowncast").markerToElement({model:"$comment",view:(i,{writer:t})=>{let o;for(const a of this.editor.model.document.getRootNames())if(o=this.editor.model.document.getRoot(a),o.hasAttribute(i.markerName))break;const l=i.markerName,n=o.getAttribute(l),m=t.createUIElement("$comment");return t.setCustomProperty("$rawContent",n,m),m}}),e.model.document.registerPostFixer(i=>{let t=!1;const o=e.model.document.differ.getChangedMarkers().filter(l=>l.name.startsWith("$comment:"));for(const l of o){const{oldRange:n,newRange:m}=l.data;if(!(n&&m&&n.root==m.root)){if(n){const a=n.root;a.hasAttribute(l.name)&&(i.removeAttribute(l.name,a),t=!0)}if(m){const a=m.root;a.rootName=="$graveyard"?(i.removeMarker(l.name),t=!0):a.hasAttribute(l.name)||(i.setAttribute(l.name,r.get(l.name)||"",a),t=!0)}}}return t}),e.data.on("set",()=>{for(const i of e.model.markers.getMarkersGroup("$comment"))this.removeHtmlComment(i.name)},{priority:"high"}),e.model.on("deleteContent",(i,[t])=>{for(const o of t.getRanges()){const l=e.model.schema.getLimitElement(o),n=e.model.createPositionAt(l,0),m=e.model.createPositionAt(l,"end");let a;n.isTouching(o.start)&&m.isTouching(o.end)?a=this.getHtmlCommentsInRange(e.model.createRange(n,m)):a=this.getHtmlCommentsInRange(o,{skipBoundaries:!0});for(const u of a)this.removeHtmlComment(u)}},{priority:"high"})}createHtmlComment(e,r){const i=x(),o=this.editor.model,l=o.document.getRoot(e.root.rootName),n=`$comment:${i}`;return o.change(m=>{const a=m.createRange(e);return m.addMarker(n,{usingOperation:!0,affectsData:!0,range:a}),m.setAttribute(n,r,l),n})}removeHtmlComment(e){const r=this.editor,i=r.model.markers.get(e);return i?(r.model.change(t=>{t.removeMarker(i)}),!0):!1}getHtmlCommentData(e){const i=this.editor.model.markers.get(e);if(!i)return null;let t="";for(const o of this.editor.model.document.getRoots())if(o.hasAttribute(e)){t=o.getAttribute(e);break}return{content:t,position:i.getStart()}}getHtmlCommentsInRange(e,{skipBoundaries:r=!1}={}){const i=!r;return Array.from(this.editor.model.markers.getMarkersGroup("$comment")).filter(o=>t(o,e)).map(o=>o.name);function t(o,l){const n=o.getRange().start;return(n.isAfter(l.start)||i&&n.isEqual(l.start))&&(n.isBefore(l.end)||i&&n.isEqual(l.end))}}}class qe extends J{toView(e){if(!/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(e.trim().slice(0,1e4)))return super.toView(e);let r="",i="";e=e.trim().replace(/<\?xml\s[^?]*\?>/i,m=>(i=m,"")),e=e.trim().replace(/^<!DOCTYPE\s[^>]*?>/i,m=>(r=m,""));const t=this._toDom(e),o=this.domConverter.domToView(t,{skipComments:this.skipComments}),l=new B(o.document);l.setCustomProperty("$fullPageDocument",t.ownerDocument.documentElement.outerHTML,o);const n=Array.from(t.ownerDocument.querySelectorAll("head style"));return l.setCustomProperty("$fullPageHeadStyles",n,o),r&&l.setCustomProperty("$fullPageDocType",r,o),i&&l.setCustomProperty("$fullPageXmlDeclaration",i,o),o}toData(e){let r=super.toData(e);const i=e.getCustomProperty("$fullPageDocument"),t=e.getCustomProperty("$fullPageDocType"),o=e.getCustomProperty("$fullPageXmlDeclaration");return i&&(r=i.replace(/<\/body\s*>/,r+"$&"),t&&(r=t+`
2
+ `+r),o&&(r=o+`
3
+ `+r)),r}}class ot extends f{static get pluginName(){return"FullPage"}static get licenseFeatureCode(){return"FPH"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}constructor(e){super(e),e.config.define("htmlSupport.fullPage",{allowRenderStylesFromHead:!1,sanitizeCss:r=>(X("css-full-page-provide-sanitize-function"),{css:r,hasChanged:!1})}),e.data.processor=new qe(e.data.viewDocument)}init(){const e=this.editor,r=["$fullPageDocument","$fullPageDocType","$fullPageXmlDeclaration","$fullPageHeadStyles"];e.model.schema.extend("$root",{allowAttributes:r}),e.data.on("toModel",(i,[t])=>{const o=e.model.document.getRoot();e.model.change(l=>{for(const n of r){const m=t.getCustomProperty(n);m&&l.setAttribute(n,m,o)}}),G(e)&&this._renderStylesFromHead(o)},{priority:"low"}),e.data.on("toView",(i,[t])=>{if(!t.is("rootElement"))return;const o=t,l=i.return;if(!o.hasAttribute("$fullPageDocument"))return;const n=new B(l.document);for(const m of r){const a=o.getAttribute(m);a&&n.setCustomProperty(m,a,l)}},{priority:"low"}),e.data.on("set",()=>{const i=e.model.document.getRoot();e.model.change(t=>{for(const o of r)i.hasAttribute(o)&&t.removeAttribute(o,i)})},{priority:"high"}),e.data.on("get",(i,t)=>{t[0]||(t[0]={}),t[0].trim=!1},{priority:"high"})}destroy(){super.destroy(),G(this.editor)&&this._removeStyleElementsFromDom()}_removeStyleElementsFromDom(){const e=Array.from(R.document.querySelectorAll(`[data-full-page-style-id="${this.editor.id}"]`));for(const r of e)r.remove()}_renderStyleElementsInDom(e){const r=this.editor,i=e.getAttribute("$fullPageHeadStyles");if(!i)return;const t=r.config.get("htmlSupport.fullPage.sanitizeCss");for(const o of i){o.setAttribute("data-full-page-style-id",r.id);const l=t(o.innerText);l.hasChanged&&(o.innerText=l.css),R.document.head.append(o)}}_renderStylesFromHead(e){this._removeStyleElementsFromDom(),this._renderStyleElementsInDom(e)}}function G(s){return s.config.get("htmlSupport.fullPage.allowRenderStylesFromHead")}export{pe as CodeBlockElementSupport,Le as CustomElementSupport,h as DataFilter,C as DataSchema,ve as DualContentModelElementSupport,ot as FullPage,rt as GeneralHtmlSupport,ye as HeadingElementSupport,Ne as HorizontalLineElementSupport,it as HtmlComment,qe as HtmlPageDataProcessor,Ee as ImageElementSupport,Me as ListElementSupport,Oe as MediaEmbedElementSupport,$e as ScriptElementSupport,xe as StyleElementSupport,De as TableElementSupport,L as _HTML_SUPPORT_SCHEMA_DEFINITIONS,de as _attributeToInlineHtmlSupportConverter,P as _createObjectHtmlSupportView,j as _emptyInlineModelElementToViewHtmlSupportConverter,b as _getHtmlSupportAttributeName,O as _getHtmlSupportDescendantElement,se as _mergeHtmlSupportViewElementAttributes,F as _modelToViewBlockAttributeHtmlSupportConverter,v as _modifyHtmlSupportGhsAttribute,ne as _removeHtmlSupportViewAttributes,w as _setHtmlSupportViewAttributes,ae as _toHtmlSupportPascalCase,ue as _toObjectWidgetHtmlSupportConverter,p as _updateHtmlSupportViewAttributes,ce as _viewToAttributeInlineHtmlSupportConverter,E as _viewToModelBlockAttributeHtmlSupportConverter,V as _viewToModelObjectContentHtmlSupportConverter};