@ncino/web-components 9.1.0 → 9.2.0-preview.2

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 (101) hide show
  1. package/dist/_virtual/eq.js +1 -0
  2. package/dist/_virtual/getSymbols.js +1 -0
  3. package/dist/_virtual/getTag.js +1 -0
  4. package/dist/_virtual/isEqual.js +1 -0
  5. package/dist/_virtual/isEqual2.js +1 -0
  6. package/dist/_virtual/isEqualWith.js +1 -0
  7. package/dist/_virtual/isPlainObject.js +1 -0
  8. package/dist/_virtual/noop.js +1 -0
  9. package/dist/_virtual/tags.js +1 -0
  10. package/dist/assets/node_modules/.pnpm/{ckeditor5@47.3.0 → ckeditor5@47.4.0}/node_modules/ckeditor5/dist/ckeditor5.css +1 -1
  11. package/dist/components/input/gator/input-file/input-file.gator.js +1 -1
  12. package/dist/components/input-rich-text/ckeditor-config.js +1 -1
  13. package/dist/components/input-rich-text/input-rich-text.slds.js +2 -2
  14. package/dist/components/panel/gator/panel.storybook-test.js +1 -1
  15. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-alignment@47.3.0 → @ckeditor_ckeditor5-alignment@47.4.0}/node_modules/@ckeditor/ckeditor5-alignment/dist/index.js +1 -1
  16. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autoformat@47.3.0 → @ckeditor_ckeditor5-autoformat@47.4.0}/node_modules/@ckeditor/ckeditor5-autoformat/dist/index.js +1 -1
  17. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autosave@47.3.0 → @ckeditor_ckeditor5-autosave@47.4.0}/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js +1 -1
  18. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-basic-styles@47.3.0 → @ckeditor_ckeditor5-basic-styles@47.4.0}/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +1 -1
  19. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-block-quote@47.3.0 → @ckeditor_ckeditor5-block-quote@47.4.0}/node_modules/@ckeditor/ckeditor5-block-quote/dist/index.js +1 -1
  20. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-clipboard@47.3.0 → @ckeditor_ckeditor5-clipboard@47.4.0}/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +1 -1
  21. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-cloud-services@47.3.0 → @ckeditor_ckeditor5-cloud-services@47.4.0}/node_modules/@ckeditor/ckeditor5-cloud-services/dist/index.js +1 -1
  22. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-code-block@47.3.0 → @ckeditor_ckeditor5-code-block@47.4.0}/node_modules/@ckeditor/ckeditor5-code-block/dist/index.js +1 -1
  23. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@47.4.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js +1 -0
  24. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-editor-classic@47.3.0 → @ckeditor_ckeditor5-editor-classic@47.4.0}/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +1 -1
  25. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-engine@47.3.0 → @ckeditor_ckeditor5-engine@47.4.0}/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +2 -2
  26. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-enter@47.3.0 → @ckeditor_ckeditor5-enter@47.4.0}/node_modules/@ckeditor/ckeditor5-enter/dist/index.js +1 -1
  27. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-essentials@47.3.0 → @ckeditor_ckeditor5-essentials@47.4.0}/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js +1 -1
  28. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-find-and-replace@47.3.0 → @ckeditor_ckeditor5-find-and-replace@47.4.0}/node_modules/@ckeditor/ckeditor5-find-and-replace/dist/index.js +1 -1
  29. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-font@47.3.0 → @ckeditor_ckeditor5-font@47.4.0}/node_modules/@ckeditor/ckeditor5-font/dist/index.js +1 -1
  30. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-heading@47.3.0 → @ckeditor_ckeditor5-heading@47.4.0}/node_modules/@ckeditor/ckeditor5-heading/dist/index.js +1 -1
  31. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-highlight@47.3.0 → @ckeditor_ckeditor5-highlight@47.4.0}/node_modules/@ckeditor/ckeditor5-highlight/dist/index.js +1 -1
  32. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-horizontal-line@47.3.0 → @ckeditor_ckeditor5-horizontal-line@47.4.0}/node_modules/@ckeditor/ckeditor5-horizontal-line/dist/index.js +1 -1
  33. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-html-embed@47.3.0 → @ckeditor_ckeditor5-html-embed@47.4.0}/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +1 -1
  34. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-html-support@47.3.0 → @ckeditor_ckeditor5-html-support@47.4.0}/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +1 -1
  35. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@47.4.0/node_modules/@ckeditor/ckeditor5-image/dist/index.js +1 -0
  36. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-indent@47.3.0 → @ckeditor_ckeditor5-indent@47.4.0}/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +1 -1
  37. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-language@47.3.0 → @ckeditor_ckeditor5-language@47.4.0}/node_modules/@ckeditor/ckeditor5-language/dist/index.js +1 -1
  38. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-link@47.3.0 → @ckeditor_ckeditor5-link@47.4.0}/node_modules/@ckeditor/ckeditor5-link/dist/index.js +1 -1
  39. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-list@47.3.0 → @ckeditor_ckeditor5-list@47.4.0}/node_modules/@ckeditor/ckeditor5-list/dist/index.js +1 -1
  40. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-markdown-gfm@47.3.0 → @ckeditor_ckeditor5-markdown-gfm@47.4.0}/node_modules/@ckeditor/ckeditor5-markdown-gfm/dist/index.js +1 -1
  41. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-media-embed@47.4.0/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +1 -0
  42. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-mention@47.3.0 → @ckeditor_ckeditor5-mention@47.4.0}/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +1 -1
  43. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-page-break@47.3.0 → @ckeditor_ckeditor5-page-break@47.4.0}/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js +1 -1
  44. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-paragraph@47.3.0 → @ckeditor_ckeditor5-paragraph@47.4.0}/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +1 -1
  45. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-paste-from-office@47.3.0 → @ckeditor_ckeditor5-paste-from-office@47.4.0}/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +1 -1
  46. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-remove-format@47.3.0 → @ckeditor_ckeditor5-remove-format@47.4.0}/node_modules/@ckeditor/ckeditor5-remove-format/dist/index.js +1 -1
  47. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-select-all@47.3.0 → @ckeditor_ckeditor5-select-all@47.4.0}/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +1 -1
  48. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-show-blocks@47.3.0 → @ckeditor_ckeditor5-show-blocks@47.4.0}/node_modules/@ckeditor/ckeditor5-show-blocks/dist/index.js +1 -1
  49. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-source-editing@47.3.0 → @ckeditor_ckeditor5-source-editing@47.4.0}/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +1 -1
  50. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-special-characters@47.3.0 → @ckeditor_ckeditor5-special-characters@47.4.0}/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +1 -1
  51. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-style@47.3.0 → @ckeditor_ckeditor5-style@47.4.0}/node_modules/@ckeditor/ckeditor5-style/dist/index.js +1 -1
  52. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@47.4.0/node_modules/@ckeditor/ckeditor5-table/dist/index.js +1 -0
  53. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-typing@47.4.0/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +1 -0
  54. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@47.4.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +1 -0
  55. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-undo@47.3.0 → @ckeditor_ckeditor5-undo@47.4.0}/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +1 -1
  56. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-upload@47.3.0 → @ckeditor_ckeditor5-upload@47.4.0}/node_modules/@ckeditor/ckeditor5-upload/dist/index.js +1 -1
  57. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-utils@47.3.0 → @ckeditor_ckeditor5-utils@47.4.0}/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +1 -1
  58. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-widget@47.3.0 → @ckeditor_ckeditor5-widget@47.4.0}/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +1 -1
  59. package/dist/node_modules/.pnpm/@deltablot_dropzone@7.4.3/node_modules/@deltablot/dropzone/dist/dropzone.js +38 -0
  60. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/compat/isEqual.js +1 -0
  61. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/_internal/getSymbols2.js +1 -0
  62. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/_internal/getTag2.js +1 -0
  63. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/_internal/tags2.js +1 -0
  64. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/merge.js +1 -1
  65. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isEqualWith.js +1 -1
  66. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/util/eq2.js +1 -0
  67. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/function/noop.js +1 -1
  68. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/function/noop2.js +1 -0
  69. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/predicate/isEqual.js +1 -1
  70. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/predicate/isEqual2.js +1 -0
  71. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/predicate/isEqualWith.js +1 -1
  72. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/predicate/isEqualWith2.js +1 -0
  73. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/predicate/isPlainObject.js +1 -1
  74. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/predicate/isPlainObject2.js +1 -0
  75. package/dist/node_modules/.pnpm/mdast-util-from-markdown@2.0.2/node_modules/mdast-util-from-markdown/lib/index.js +1 -1
  76. package/dist/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/character-reference.js +1 -1
  77. package/dist/node_modules/.pnpm/micromark-util-decode-string@2.0.1/node_modules/micromark-util-decode-string/index.js +1 -1
  78. package/dist/node_modules/.pnpm/{storybook@10.1.10_@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 → storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/storybook/dist/_browser-chunks/chunk-Q5RYDXT3.js} +19 -19
  79. package/dist/node_modules/.pnpm/storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/storybook/dist/_browser-chunks/chunk-VIJ7SQRO.js +1 -0
  80. package/dist/node_modules/.pnpm/storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/storybook/dist/core-events/index.js +1 -0
  81. package/dist/node_modules/.pnpm/{storybook@10.1.10_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4}/node_modules/storybook/dist/instrumenter/index.js +1 -1
  82. package/dist/node_modules/.pnpm/storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/storybook/dist/test/index.js +156 -0
  83. package/package.json +14 -14
  84. package/web-types.json +1 -1
  85. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js +0 -1
  86. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@47.3.0/node_modules/@ckeditor/ckeditor5-image/dist/index.js +0 -1
  87. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-media-embed@47.3.0/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +0 -1
  88. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@47.3.0/node_modules/@ckeditor/ckeditor5-table/dist/index.js +0 -1
  89. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-typing@47.3.0/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +0 -1
  90. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@47.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +0 -1
  91. package/dist/node_modules/.pnpm/@deltablot_dropzone@7.3.1/node_modules/@deltablot/dropzone/dist/dropzone.js +0 -22
  92. package/dist/node_modules/.pnpm/storybook@10.1.10_@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 -1
  93. package/dist/node_modules/.pnpm/storybook@10.1.10_@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 -1
  94. package/dist/node_modules/.pnpm/storybook@10.1.10_@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 -152
  95. /package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-icons@47.3.0 → @ckeditor_ckeditor5-icons@47.4.0}/node_modules/@ckeditor/ckeditor5-icons/dist/index.js +0 -0
  96. /package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-watchdog@47.3.0 → @ckeditor_ckeditor5-watchdog@47.4.0}/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +0 -0
  97. /package/dist/node_modules/.pnpm/{decode-named-character-reference@1.2.0 → decode-named-character-reference@1.3.0}/node_modules/decode-named-character-reference/index.dom.js +0 -0
  98. /package/dist/node_modules/.pnpm/{storybook@10.1.10_@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 → storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/storybook/dist/_browser-chunks/chunk-3LY4VQVK.js} +0 -0
  99. /package/dist/node_modules/.pnpm/{storybook@10.1.10_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4}/node_modules/storybook/dist/_browser-chunks/chunk-A242L54C.js +0 -0
  100. /package/dist/node_modules/.pnpm/{storybook@10.1.10_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4}/node_modules/storybook/dist/_browser-chunks/chunk-ZUWEVLDX.js +0 -0
  101. /package/dist/node_modules/.pnpm/{storybook@10.1.10_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4}/node_modules/storybook/dist/client-logger/index.js +0 -0
@@ -1,4 +1,4 @@
1
- import{Plugin as v,Command as S}from"../../../../../@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{ShiftEnter as y}from"../../../../../@ckeditor_ckeditor5-enter@47.3.0/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import{UpcastWriter as O}from"../../../../../@ckeditor_ckeditor5-engine@47.3.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{ClipboardPipeline as N}from"../../../../../@ckeditor_ckeditor5-clipboard@47.3.0/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{Collection as M,first as b}from"../../../../../@ckeditor_ckeditor5-utils@47.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{createDropdown as R,addListToDropdown as q,MenuBarMenuView as F,MenuBarMenuListView as $,MenuBarMenuListItemView as z,MenuBarMenuListItemButtonView as W,UIModel as U,SplitButtonView as j}from"../../../../../@ckeditor_ckeditor5-ui@47.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconCodeBlock as L}from"../../../../../@ckeditor_ckeditor5-icons@47.3.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";function h(i){const e=i.t,n=i.config.get("codeBlock.languages");for(const o of n)o.label==="Plain text"&&(o.label=e("Plain text")),o.class===void 0&&(o.class=`language-${o.language}`);return n}function k(i,e,n){const o={};for(const c of i)if(e==="class"){const s=c[e].split(" ").shift();o[s]=c[n]}else o[c[e]]=c[n];return o}function w(i){return i.data.match(/^(\s*)/)[0]}function H(i,e){const n=i.createDocumentFragment(),o=e.split(`
1
+ import{Plugin as v,Command as S}from"../../../../../@ckeditor_ckeditor5-core@47.4.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{ShiftEnter as y}from"../../../../../@ckeditor_ckeditor5-enter@47.4.0/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import{UpcastWriter as O}from"../../../../../@ckeditor_ckeditor5-engine@47.4.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{ClipboardPipeline as N}from"../../../../../@ckeditor_ckeditor5-clipboard@47.4.0/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{Collection as M,first as b}from"../../../../../@ckeditor_ckeditor5-utils@47.4.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{createDropdown as R,addListToDropdown as q,MenuBarMenuView as F,MenuBarMenuListView as $,MenuBarMenuListItemView as z,MenuBarMenuListItemButtonView as W,UIModel as U,SplitButtonView as j}from"../../../../../@ckeditor_ckeditor5-ui@47.4.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconCodeBlock as L}from"../../../../../@ckeditor_ckeditor5-icons@47.4.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";function h(i){const e=i.t,n=i.config.get("codeBlock.languages");for(const o of n)o.label==="Plain text"&&(o.label=e("Plain text")),o.class===void 0&&(o.class=`language-${o.language}`);return n}function k(i,e,n){const o={};for(const c of i)if(e==="class"){const s=c[e].split(" ").shift();o[s]=c[n]}else o[c[e]]=c[n];return o}function w(i){return i.data.match(/^(\s*)/)[0]}function H(i,e){const n=i.createDocumentFragment(),o=e.split(`
2
2
  `),c=o.reduce((s,t,a)=>(s.push(t),a<o.length-1&&s.push(i.createElement("br")),s),[]);return i.appendChild(c,n),n}function C(i){const e=i.document.selection,n=[];if(e.isCollapsed)return[e.anchor];const o=e.getFirstRange().getWalker({ignoreElementEnd:!0,direction:"backward"});for(const{item:c}of o){let s=c.is("$textProxy")?c.textNode:c;const t=s.parent;if(!t.is("element","codeBlock")||s.is("element","softBreak"))continue;for(;s.previousSibling&&!s.previousSibling.is("element","softBreak");)s=s.previousSibling;const a=s.is("$text")?s.startOffset+w(s).length:s.startOffset,l=i.createPositionAt(t,a);n.every(r=>!r.isEqual(l))&&n.push(l)}return n}function T(i){const e=b(i.getSelectedBlocks());return!!e&&e.is("element","codeBlock")}function A(i,e){return e.is("rootElement")||i.isLimit(e)?!1:i.checkChild(e.parent,"codeBlock")}function P(i,e,n,o){const c=k(e,"language","label"),s=n.getAttribute("language");if(s in c){const t=c[s];return i(o==="enter"?"Entering %0 code snippet":"Leaving %0 code snippet",t)}return i(o==="enter"?"Entering code snippet":"Leaving code snippet")}function I(i,e){for(i.textNode&&(i=e.createPositionBefore(i.textNode));i.nodeBefore&&!i.nodeBefore.is("element","softBreak");)i=e.createPositionBefore(i.nodeBefore);const n=i.nodeAfter;return n&&n.is("$text")?n:null}class J extends S{_lastLanguage;constructor(e){super(e),this._lastLanguage=null}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const n=this.editor,o=n.model,c=o.document.selection,t=h(n)[0],a=Array.from(c.getSelectedBlocks()),l=e.forceValue==null?!this.value:e.forceValue,r=K(e,this._lastLanguage,t.language);o.change(u=>{l?this._applyCodeBlock(u,a,r):this._removeCodeBlock(u,a)})}_getValue(){const e=this.editor.model.document.selection,n=b(e.getSelectedBlocks());return!!n?.is("element","codeBlock")?n.getAttribute("language"):!1}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,n=this.editor.model.schema,o=b(e.getSelectedBlocks());return o?A(n,o):!1}_applyCodeBlock(e,n,o){this._lastLanguage=o;const c=this.editor.model.schema,s=n.filter(t=>A(c,t));for(const t of s)e.rename(t,"codeBlock"),e.setAttribute("language",o,t),c.removeDisallowedAttributes([t],e),Array.from(t.getChildren()).filter(a=>!c.checkChild(t,a)).forEach(a=>e.remove(a));s.reverse().forEach((t,a)=>{const l=s[a+1];t.previousSibling===l&&(e.appendElement("softBreak",l),e.merge(e.createPositionBefore(t)))})}_removeCodeBlock(e,n){const o=n.filter(c=>c.is("element","codeBlock"));for(const c of o){const s=e.createRangeOn(c);for(const t of Array.from(s.getItems()).reverse())if(t.is("element","softBreak")&&t.parent.is("element","codeBlock")){const{position:a}=e.split(e.createPositionBefore(t)),l=a.nodeAfter;e.rename(l,"paragraph"),e.removeAttribute("language",l),e.remove(t)}e.rename(c,"paragraph"),e.removeAttribute("language",c)}}}function K(i,e,n){return i.language?i.language:i.usePreviousLanguageChoice&&e?e:n}class G extends S{_indentSequence;constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const n=this.editor.model;n.change(o=>{const c=C(n);for(const s of c){const t=o.createText(this._indentSequence);n.insertContent(t,s)}})}_checkEnabled(){return this._indentSequence?T(this.editor.model.document.selection):!1}}class X extends S{_indentSequence;constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const n=this.editor.model;n.change(()=>{const o=C(n);for(const c of o){const s=E(n,c,this._indentSequence);s&&n.deleteContent(n.createSelection(s))}})}_checkEnabled(){if(!this._indentSequence)return!1;const e=this.editor.model;return T(e.document.selection)?C(e).some(n=>E(e,n,this._indentSequence)):!1}}function E(i,e,n){const o=I(e,i);if(!o)return null;const c=w(o),s=c.lastIndexOf(n);if(s+n.length!==c.length||s===-1)return null;const{parent:t,startOffset:a}=o;return i.createRange(i.createPositionAt(t,a+s),i.createPositionAt(t,a+s+n.length))}function _(i,e,n=!1){const o=k(e,"language","class"),c=k(e,"language","label");return(s,t,a)=>{const{writer:l,mapper:r,consumable:u}=a;if(!u.consume(t.item,"insert"))return;const d=t.item.getAttribute("language"),g=r.toViewPosition(i.createPositionBefore(t.item)),m={};n&&(m["data-language"]=c[d],m.spellcheck="false");const p=o[d]?{class:o[d]}:void 0,x=l.createContainerElement("code",p),V=l.createContainerElement("pre",m,x);l.insert(g,V),r.bindElements(t.item,x)}}function Q(i){return(e,n,o)=>{if(n.item.parent.name!=="codeBlock")return;const{writer:c,mapper:s,consumable:t}=o;if(!t.consume(n.item,"insert"))return;const a=s.toViewPosition(i.createPositionBefore(n.item));c.insert(a,c.createText(`
3
3
  `))}}function Y(i,e){const n=k(e,"class","language"),o=e[0].language;return(c,s,t)=>{const a=s.viewItem,l=a.parent;if(!l||!l.is("element","pre")||s.modelCursor.findAncestor("codeBlock"))return;const{consumable:r,writer:u}=t;if(!r.test(a,{name:!0}))return;const d=u.createElement("codeBlock"),g=[...a.getClassNames()];g.length||g.push("");for(const m of g){const p=n[m];if(p){r.consume(a,{classes:[m]}),u.setAttribute("language",p,d);break}}d.hasAttribute("language")||u.setAttribute("language",o,d),t.convertChildren(a,d),t.safeInsert(d,s.modelCursor)&&(r.consume(a,{name:!0}),t.updateConversionResult(d,s))}}function Z(){return(i,e,{consumable:n,writer:o})=>{let c=e.modelCursor;if(!n.test(e.viewItem)||!c.findAncestor("codeBlock"))return;n.consume(e.viewItem);const t=e.viewItem.data.split(`
4
4
  `).map(l=>o.createText(l)),a=t[t.length-1];for(const l of t)if(o.insert(l,c),c=c.getShiftedBy(l.offsetSize),l!==a){const r=o.createElement("softBreak");o.insert(r,c),c=o.createPositionAfter(r)}e.modelRange=o.createRange(e.modelCursor,c),e.modelCursor=c}}function ee(){return(i,e,{consumable:n})=>{const o=e.viewItem;if(o.findAncestor("pre"))return;const c=Array.from(o.getChildren()),s=c.find(t=>t.is("element","code"));if(s)for(const t of c)t===s||!t.is("$text")||n.consume(t,{name:!0})}}const D="paragraph";class te extends v{static get pluginName(){return"CodeBlockEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[y]}constructor(e){super(e),e.config.define("codeBlock",{languages:[{language:"plaintext",label:"Plain text"},{language:"c",label:"C"},{language:"cs",label:"C#"},{language:"cpp",label:"C++"},{language:"css",label:"CSS"},{language:"diff",label:"Diff"},{language:"go",label:"Go"},{language:"html",label:"HTML"},{language:"java",label:"Java"},{language:"javascript",label:"JavaScript"},{language:"php",label:"PHP"},{language:"python",label:"Python"},{language:"ruby",label:"Ruby"},{language:"typescript",label:"TypeScript"},{language:"xml",label:"XML"}],indentSequence:" "})}init(){const e=this.editor,n=e.model.schema,o=e.model,c=e.editing.view,s=h(e);e.commands.add("codeBlock",new J(e)),e.commands.add("indentCodeBlock",new G(e)),e.commands.add("outdentCodeBlock",new X(e)),this.listenTo(c.document,"tab",(t,a)=>{const l=a.shiftKey?"outdentCodeBlock":"indentCodeBlock";e.commands.get(l).isEnabled&&(e.execute(l),a.stopPropagation(),a.preventDefault(),t.stop())},{context:"pre"}),n.register("codeBlock",{allowWhere:"$block",allowChildren:"$text",disallowChildren:"$inlineObject",allowAttributes:["language"],allowAttributesOf:"$listItem",isBlock:!0}),n.addAttributeCheck((t,a)=>{const l=t.getItem(t.length-2);if(n.getAttributeProperties(a).isFormatting&&l&&l.name=="codeBlock")return!1}),e.editing.downcastDispatcher.on("insert:codeBlock",_(o,s,!0)),e.data.downcastDispatcher.on("insert:codeBlock",_(o,s)),e.data.downcastDispatcher.on("insert:softBreak",Q(o),{priority:"high"}),e.data.upcastDispatcher.on("element:code",Y(c,s)),e.data.upcastDispatcher.on("text",Z()),e.data.upcastDispatcher.on("element:pre",ee(),{priority:"high"}),this.listenTo(e.editing.view.document,"clipboardInput",(t,a)=>{let l=o.createRange(o.document.selection.anchor);if(a.targetRanges&&(l=e.editing.mapper.toModelRange(a.targetRanges[0])),!l.start.parent.is("element","codeBlock"))return;const r=a.dataTransfer.getData("text/plain"),u=new O(e.editing.view.document);a.content=H(u,r)}),e.plugins.has("ClipboardPipeline")&&e.plugins.get(N).on("contentInsertion",(t,a)=>{const l=e.model,r=l.document.selection;r.anchor.parent.is("element","codeBlock")&&l.change(u=>{const d=u.createRangeIn(a.content);for(const g of[...d.getItems()])g.is("node")&&!n.checkChild(r.anchor,g)&&u.remove(g)})}),this.listenTo(o,"getSelectedContent",(t,[a])=>{const l=a.anchor;a.isCollapsed||!l.parent.is("element","codeBlock")||!l.hasSameParentAs(a.focus)||o.change(r=>{const u=t.return;if(l.parent.is("element")&&(u.childCount>1||a.containsEntireContent(l.parent))){const g=r.createElement("codeBlock",l.parent.getAttributes());r.append(u,g);const m=r.createDocumentFragment();r.append(g,m),t.return=m;return}const d=u.getChild(0);n.checkAttribute(d,"code")&&r.setAttribute("code",!0,d)})})}afterInit(){const e=this.editor,n=e.commands,o=n.get("indent"),c=n.get("outdent");o&&o.registerChildCommand(n.get("indentCodeBlock"),{priority:"highest"}),c&&c.registerChildCommand(n.get("outdentCodeBlock")),this.listenTo(e.editing.view.document,"enter",(s,t)=>{e.model.document.selection.getLastPosition().parent.is("element","codeBlock")&&(!oe(e,t.isSoft)&&!ie(e,t.isSoft)&&ne(e),t.preventDefault(),s.stop())},{context:"pre"}),this._initAriaAnnouncements()}_initAriaAnnouncements(){const{model:e,ui:n,t:o}=this.editor,c=h(this.editor);let s=null;e.document.selection.on("change:range",()=>{const t=e.document.selection.focus.parent;!n||s===t||!t.is("element")||(s&&s.is("element","codeBlock")&&n.ariaLiveAnnouncer.announce(P(o,c,s,"leave")),t.is("element","codeBlock")&&n.ariaLiveAnnouncer.announce(P(o,c,t,"enter")),s=t)})}}function ne(i){const e=i.model,n=e.document,o=n.selection.getLastPosition();let c;const s=I(o,e);s&&s.is("$text")&&(c=w(s)),i.model.change(t=>{i.execute("shiftEnter"),c&&t.insertText(c,n.selection.anchor)})}function oe(i,e){const o=i.model.document,c=i.editing.view,s=o.selection.getLastPosition(),t=s.nodeAfter;return e||!o.selection.isCollapsed||!s.isAtStart||!f(t)?!1:(i.model.change(a=>{i.execute("enter");const l=o.selection.anchor.parent.previousSibling;a.rename(l,D),a.setSelection(l,"in"),i.model.schema.removeDisallowedAttributes([l],a),a.remove(t)}),c.scrollToTheSelection(),!0)}function ie(i,e){const n=i.model,o=n.document,c=i.editing.view,s=o.selection.getLastPosition(),t=s.nodeBefore;let a;if(e||!o.selection.isCollapsed||!s.isAtEnd||!t||!t.previousSibling)return!1;if(f(t)&&f(t.previousSibling))a=n.createRange(n.createPositionBefore(t.previousSibling),n.createPositionAfter(t));else if(B(t)&&f(t.previousSibling)&&f(t.previousSibling.previousSibling))a=n.createRange(n.createPositionBefore(t.previousSibling.previousSibling),n.createPositionAfter(t));else if(B(t)&&f(t.previousSibling)&&B(t.previousSibling.previousSibling)&&t.previousSibling.previousSibling&&f(t.previousSibling.previousSibling.previousSibling))a=n.createRange(n.createPositionBefore(t.previousSibling.previousSibling.previousSibling),n.createPositionAfter(t));else return!1;return i.model.change(l=>{l.remove(a),i.execute("enter");const r=o.selection.anchor.parent;l.rename(r,D),i.model.schema.removeDisallowedAttributes([r],l)}),c.scrollToTheSelection(),!0}function B(i){return i&&i.is("$text")&&!i.data.match(/\S/)}function f(i){return i&&i.is("element","softBreak")}class se extends v{static get pluginName(){return"CodeBlockUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.t,o=e.ui.componentFactory,c=h(e),s=this._getLanguageListItemDefinitions(c),t=e.commands.get("codeBlock");o.add("codeBlock",a=>{const l=R(a,j),r=l.buttonView,u=n("Insert code block");return r.set({label:u,tooltip:!0,icon:L,isToggleable:!0}),r.bind("isOn").to(t,"value",d=>!!d),r.on("execute",()=>{e.execute("codeBlock",{usePreviousLanguageChoice:!0}),e.editing.view.focus()}),l.on("execute",d=>{e.execute("codeBlock",{language:d.source._codeBlockLanguage,forceValue:!0}),e.editing.view.focus()}),l.class="ck-code-block-dropdown",l.bind("isEnabled").to(t),q(l,s,{role:"menu",ariaLabel:u}),l}),o.add("menuBar:codeBlock",a=>{const l=new F(a);l.buttonView.set({role:"menuitem",label:n("Code block"),icon:L}),l.bind("isEnabled").to(t);const r=new $(a);r.set({ariaLabel:n("Insert code block")});for(const u of s){const d=new z(a,l),g=new W(a);g.bind(...Object.keys(u.model)).to(u.model),g.set({isToggleable:!0,role:"menuitemcheckbox"}),g.delegate("execute").to(l),g.on("execute",()=>{e.execute("codeBlock",{language:u.model._codeBlockLanguage,forceValue:t.value!=u.model._codeBlockLanguage}),e.editing.view.focus()}),d.children.add(g),r.items.add(d)}return l.panelView.children.add(r),l})}_getLanguageListItemDefinitions(e){const o=this.editor.commands.get("codeBlock"),c=new M;for(const s of e){const t={type:"button",model:new U({_codeBlockLanguage:s.language,label:s.label,role:"menuitemradio",withText:!0})};t.model.bind("isOn").to(o,"value",a=>a===t.model._codeBlockLanguage),c.add(t)}return c}}class me extends v{static get requires(){return[te,se]}static get pluginName(){return"CodeBlock"}static get isOfficialPlugin(){return!0}}export{me as CodeBlock,J as CodeBlockCommand,te as CodeBlockEditing,se as CodeBlockUI,G as IndentCodeBlockCommand,X as OutdentCodeBlockCommand,A as _canBeCodeBlock,Y as _dataViewToModelCodeBlockInsertion,ee as _dataViewToModelCodeBlockOrphanNodeConsumer,Z as _dataViewToModelCodeBlockTextNewlinesInsertion,P as _getCodeBlockAriaAnnouncement,C as _getCodeBlockIndentOutdentPositions,w as _getCodeBlockLeadingWhiteSpaces,k as _getCodeBlockPropertyAssociation,I as _getCodeBlockTextNodeAtLineStart,h as _getNormalizedAndLocalizedCodeBlockLanguageDefinitions,T as _isModelSelectionInCodeBlock,Q as _modelToDataViewCodeBlockSoftBreakInsertion,_ as _modelToViewCodeBlockInsertion,H as _rawCodeBlockSnippetTextToViewDocumentFragment};
@@ -0,0 +1 @@
1
+ import{ObservableMixin as S,Collection as W,CKEditorError as c,insertToPriorityArray as H,setDataInElement as K,Config as z,decodeLicenseKey as U,toArray as V,crc32 as j,releaseDate as Y,uid as R,logError as J,isFeatureBlockedByLicenseKey as Q,Locale as X,EmitterMixin as Z,KeystrokeHandler as ee,global as A,env as k}from"../../../../../@ckeditor_ckeditor5-utils@47.4.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{Model as te,DataController as ie,StylesProcessor as ne,EditingController as se,Conversion as oe}from"../../../../../@ckeditor_ckeditor5-engine@47.4.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{EditorWatchdog as re,ContextWatchdog as ae}from"../../../../../@ckeditor_ckeditor5-watchdog@47.4.0/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js";import{isFunction as M}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isFunction.js";import{get as le}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/get.js";import{set as ce}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/set.js";class Le extends S(){editor;_disableStack=new Set;constructor(e){super(),this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",q,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",q),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}function q(r){r.return=!1,r.stop()}class ue extends S(){editor;_isEnabledBasedOnSelection;_affectsData;_disableStack;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.listenTo(e,"change:isReadOnly",()=>{this.refresh()}),this.on("set:isEnabled",t=>{if(!this.affectsData)return;const i=e.model.document.selection,u=!(i.getFirstPosition().root.rootName=="$graveyard")&&e.model.canEditAt(i);(e.isReadOnly||this._isEnabledBasedOnSelection&&!u)&&(t.return=!1,t.stop())},{priority:"highest"}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",F,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",F),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function F(r){r.return=!1,r.stop()}class Ie extends ue{_childCommandsDefinitions=[];refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return!!t&&t.execute(e)}registerChildCommand(e,t={}){H(this._childCommandsDefinitions,{command:e,priority:t.priority||"normal"}),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const e=this._childCommandsDefinitions.find(({command:t})=>t.isEnabled);return e&&e.command}}class de{_commands;constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const i=this.get(e);if(!i)throw new c("commandcollection-command-not-found",this,{commandName:e});return i.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class $ extends Z(){_context;_plugins=new Map;_availablePlugins;_contextPlugins;constructor(e,t=[],i=[]){super(),this._context=e,this._availablePlugins=new Map;for(const s of t)s.pluginName&&this._availablePlugins.set(s.pluginName,s);this._contextPlugins=new Map;for(const[s,u]of i)this._contextPlugins.set(s,u),this._contextPlugins.set(u,s),s.pluginName&&this._availablePlugins.set(s.pluginName,s)}*[Symbol.iterator](){for(const e of this._plugins)typeof e[0]=="function"&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let i=e;throw typeof e=="function"&&(i=e.pluginName||e.name),new c("plugincollection-plugin-not-loaded",this._context,{plugin:i})}return t}has(e){return this._plugins.has(e)}async init(e,t=[],i=[]){const s=this,u=this._context;w(e),m(e);const g=e.filter(n=>!p(n,t)),h=[...P(g)];x(h,i);const b=d(h);return await I(b,"init"),await I(b,"afterInit"),b;function y(n){return typeof n=="function"}function E(n){return y(n)&&!!n.isContextPlugin}function p(n,a){return a.some(o=>o===n||f(n)===o||f(o)===n)}function f(n){return y(n)?n.pluginName||n.name:n}function w(n,a=new Set){n.forEach(o=>{y(o)&&(a.has(o)||(a.add(o),o.pluginName&&!s._availablePlugins.has(o.pluginName)&&s._availablePlugins.set(o.pluginName,o),o.requires&&w(o.requires,a)))})}function P(n,a=new Set){return n.map(o=>y(o)?o:s._availablePlugins.get(o)).reduce((o,l)=>a.has(l)?o:(a.add(l),l.requires&&(m(l.requires,l),P(l.requires,a).forEach(_=>o.add(_))),o.add(l)),new Set)}function m(n,a=null){n.map(o=>y(o)?o:s._availablePlugins.get(o)||o).forEach(o=>{C(o),O(o,a),D(o,a),L(o,a)})}function C(n){if(typeof n=="function"&&n._throwErrorWhenUsedAsAPlugin)throw new c("plugincollection-plugin-invalid-constructor",u,{name:n.name})}function O(n,a){if(!y(n))throw a?new c("plugincollection-soft-required",u,{missingPlugin:n,requiredBy:f(a)}):new c("plugincollection-plugin-not-found",u,{plugin:n})}function D(n,a){if(E(a)&&!E(n))throw new c("plugincollection-context-required",u,{plugin:f(n),requiredBy:f(a)})}function L(n,a){if(a&&p(n,t))throw new c("plugincollection-required",u,{plugin:f(n),requiredBy:f(a)})}function d(n){return n.map(a=>{let o=s._contextPlugins.get(a);return o=o||new a(u),s._add(a,o),o})}function I(n,a){return n.reduce((o,l)=>!l[a]||s._contextPlugins.has(l)?o:o.then(l[a].bind(l)),Promise.resolve())}function x(n,a){for(const o of a){if(typeof o!="function")throw new c("plugincollection-replace-plugin-invalid-type",null,{pluginItem:o});const l=o.pluginName;if(!l)throw new c("plugincollection-replace-plugin-missing-name",null,{pluginItem:o});if(o.requires&&o.requires.length)throw new c("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:l});const _=s._availablePlugins.get(l);if(!_)throw new c("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:l});const v=n.indexOf(_);if(v===-1){if(s._contextPlugins.has(_))return;throw new c("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:l})}if(_.requires&&_.requires.length)throw new c("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:l});n.splice(v,1,o),s._availablePlugins.set(l,o)}}}destroy(){const e=[];for(const[,t]of this)typeof t.destroy=="function"&&!this._contextPlugins.has(t)&&e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const i=e.pluginName;if(i){if(this._plugins.has(i))throw new c("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e});this._plugins.set(i,t)}}}class G{config;plugins;locale;t;editors;static defaultConfig;static builtinPlugins;_contextOwner=null;constructor(e){const{translations:t,...i}=e||{};this.config=new z(i,this.constructor.defaultConfig);const s=this.constructor.builtinPlugins;this.config.define("plugins",s),this.plugins=new $(this,s);const u=this.config.get("language")||{};this.locale=new X({uiLanguage:typeof u=="string"?u:u.ui,contentLanguage:this.config.get("language.content"),translations:t}),this.t=this.locale.t,this.editors=new W}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const i of e.concat(t)){if(typeof i!="function")throw new c("context-initplugins-constructor-only",null,{Plugin:i});if(i.isContextPlugin!==!0)throw new c("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner)throw new c("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise(t=>{const i=new this(e);t(i.initPlugins().then(()=>i))})}static get _throwErrorWhenUsedAsAPlugin(){return!0}}class he extends S(){context;constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}class fe extends ee{editor;constructor(e){super(),this.editor=e}set(e,t,i={}){if(typeof t=="string"){const s=t;t=(u,g)=>{this.editor.execute(s),g()}}super.set(e,t,i)}}const N="contentEditing",B="common";class ge{keystrokeInfos=new Map;_editor;constructor(e){this._editor=e;const t=e.config.get("menuBar.isVisible"),i=e.locale.t;this.addKeystrokeInfoCategory({id:N,label:i("Content editing keystrokes"),description:i("These keyboard shortcuts allow for quick access to content editing features.")});const s=[{label:i("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:i("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:i("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:i("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:i("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];t&&s.push({label:i("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:i("User interface and content navigation keystrokes"),description:i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:s}]})}addKeystrokeInfoCategory({id:e,label:t,description:i,groups:s}){this.keystrokeInfos.set(e,{id:e,label:t,description:i,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:e,id:B}),s&&s.forEach(u=>{this.addKeystrokeInfoGroup({categoryId:e,...u})})}addKeystrokeInfoGroup({categoryId:e=N,id:t,label:i,keystrokes:s}){const u=this.keystrokeInfos.get(e);if(!u)throw new c("accessibility-unknown-keystroke-info-category",this._editor,{groupId:t,categoryId:e});u.groups.set(t,{id:t,label:i,keystrokes:s||[]})}addKeystrokeInfos({categoryId:e=N,groupId:t=B,keystrokes:i}){if(!this.keystrokeInfos.has(e))throw new c("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:e,keystrokes:i});const s=this.keystrokeInfos.get(e);if(!s.groups.has(t))throw new c("accessibility-unknown-keystroke-info-group",this._editor,{groupId:t,categoryId:e,keystrokes:i});s.groups.get(t).keystrokes.push(...i)}}function me(r){return{sessionId:_e(),pageSessionId:Ee(),hostname:window.location.hostname,version:globalThis.CKEDITOR_VERSION,type:ye(r),plugins:we(r.plugins),distribution:pe(),env:be(),integration:Object.create(null),menuBar:{isVisible:!!r.config.get("menuBar.isVisible")},language:{ui:r.locale.uiLanguage,content:r.locale.contentLanguage},toolbar:{main:T(r.config.get("toolbar")),block:T(r.config.get("blockToolbar")),balloon:T(r.config.get("balloonToolbar"))}}}function ye(r){return Object.getPrototypeOf(r).constructor.editorName}function we(r){return Array.from(r).filter(([e])=>!!e.pluginName).map(([e])=>{const{pluginName:t,isContextPlugin:i,isOfficialPlugin:s,isPremiumPlugin:u}=e;return{isContext:!!i,isOfficial:!!s,isPremium:!!u,name:t}})}function T(r){if(!r)return;const e=Array.isArray(r)?{items:r}:r,t=u(e.items||[]);return{isMultiline:t.includes("-"),shouldNotGroupWhenFull:!!e.shouldNotGroupWhenFull,items:s(t)};function s(g){return g.filter(h=>h!=="|"&&h!=="-")}function u(g){return g.flatMap(h=>typeof h=="string"?[h]:u(h.items))}}function pe(){return{channel:window[Symbol.for("cke distribution")]||"sh"}}function be(){let r="unknown",e="unknown";return k.isMac?r="mac":k.isWindows?r="windows":k.isiOS?r="ios":k.isAndroid&&(r="android"),k.isGecko?e="gecko":k.isBlink?e="blink":k.isSafari&&(e="safari"),{os:r,browser:e}}function _e(){return localStorage.getItem("__ckeditor-session-id")||localStorage.setItem("__ckeditor-session-id",R()),localStorage.getItem("__ckeditor-session-id")}function Ee(){return A.window.CKEDITOR_PAGE_SESSION_ID=A.window.CKEDITOR_PAGE_SESSION_ID||R(),A.window.CKEDITOR_PAGE_SESSION_ID}class Ae extends S(){static get editorName(){return"Editor"}accessibility;commands;config;conversion;data;editing;locale;model;plugins;keystrokes;t;static defaultConfig;static builtinPlugins;_context;_readOnlyLocks;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e={}){if(super(),typeof e!="object"||Array.isArray(e))throw new c("editor-config-invalid-type");if("sanitizeHtml"in e)throw new c("editor-config-sanitizehtml-not-supported");const t=this.constructor,{translations:i,...s}=t.defaultConfig||{},{translations:u=i,...g}=e,h=e.language||s.language;this._context=e.context||new G({language:h,translations:u}),this._context._addEditor(this,!e.context);const b=Array.from(t.builtinPlugins||[]);this.config=new z(g,s),this.config.define("plugins",b),this.config.define(this._context._getEditorConfig()),E(this.config),this.plugins=new $(this,b,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new de,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.model=new te(this.config),this.on("change:isReadOnly",()=>{this.model.document.isReadOnly=this.isReadOnly});const y=new ne;this.data=new ie(this.model,y),this.editing=new se(this.model,y),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new oe([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new fe(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new ge(this),p(this);function E(f){let w=f.get("licenseKey");if(!w&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(w=window.CKEDITOR_GLOBAL_LICENSE_KEY,f.set("licenseKey",w)),!w)throw new c("license-key-missing")}function p(f){const w=f.config.get("licenseKey"),P=window[Symbol.for("cke distribution")]||"sh";function m(n,a){f.enableReadOnlyMode(Symbol("invalidLicense")),f._showLicenseError(n,a)}function C(n){return["exp","jti","vc"].every(o=>o in n)}function O(n){return Object.getOwnPropertyNames(n).sort().filter(l=>l!="vc"&&n[l]!=null).map(l=>n[l])}function D(n){const{hostname:a}=new URL(window.location.href);if(n.includes(a))return!0;const o=a.split(".");return n.filter(l=>l.includes("*")).map(l=>l.split(".")).filter(l=>l.length<=o.length).map(l=>Array(o.length-l.length).fill(l[0]==="*"?"*":"").concat(l)).some(l=>o.every((_,v)=>l[v]===_||l[v]==="*"))}function L(n){const a=n[0].toUpperCase()+n.slice(1),o=n==="evaluation"?"an":"a";console.info(`%cCKEditor 5 ${a} License`,"color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;"),console.warn(`⚠️ You are using ${o} ${n} license of CKEditor 5${n==="trial"?" which is for evaluation purposes only":""}. For production usage, please obtain a production license at https://portal.ckeditor.com/`)}if(w=="GPL"){P=="cloud"&&m("distributionChannel");return}const d=U(w);if(!d){m("invalid");return}if(!C(d)){m("invalid");return}if(d.distributionChannel&&!V(d.distributionChannel).includes(P)){m("distributionChannel");return}if(j(O(d))!=d.vc.toLowerCase()){m("invalid");return}if(new Date(d.exp*1e3)<Y){m("expired");return}const x=d.licensedHosts;if(x&&x.length>0&&!D(x)){m("domainLimit");return}if(["evaluation","trial"].includes(d.licenseType)&&d.exp*1e3<Date.now()){m("expired");return}if(["development","evaluation","trial"].includes(d.licenseType)){const{licenseType:n}=d;window.CKEDITOR_WARNING_SUPPRESSIONS=window.CKEDITOR_WARNING_SUPPRESSIONS||{},window.CKEDITOR_WARNING_SUPPRESSIONS[n]||(L(n),window.CKEDITOR_WARNING_SUPPRESSIONS[n]=!0)}if(["evaluation","trial"].includes(d.licenseType)){const n=d.licenseType,a=setTimeout(()=>{m(`${n}Limit`)},6e5);f.on("destroy",()=>{clearTimeout(a)})}d.usageEndpoint&&f.once("ready",()=>{const n={requestId:R(),requestTime:Math.round(Date.now()/1e3),license:w,editor:ke(f)};f._sendUsageRequest(d.usageEndpoint,n).then(a=>{const{status:o,message:l}=a;l&&console.warn(l),o!="ok"&&m("usageLimit")},()=>{J("license-key-validation-endpoint-not-reachable",{url:d.usageEndpoint})})},{priority:"high"})}}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new c("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new c("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),this._readOnlyLocks.size===1&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new c("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),this._readOnlyLocks.size===0&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}initPlugins(){const e=this.config,t=e.get("plugins"),i=e.get("removePlugins")||[],s=e.get("extraPlugins")||[],u=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(s),i,u).then(h=>(g(this),h));function g(h){const b=h.config.get("licenseKey");if(b==="GPL")return;const y=U(b);if(!y)return;const E=[...h.plugins].map(([p])=>p).find(p=>!p.pluginName||!p.licenseFeatureCode?!1:Q(y,p.licenseFeatureCode));E&&(h.enableReadOnlyMode(Symbol("invalidLicense")),h._showLicenseError("pluginNotAllowed",E.pluginName))}}destroy(){let e=Promise.resolve();return this.state=="initializing"&&(e=new Promise(t=>this.once("ready",t))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(e,...t){try{return this.commands.execute(e,...t)}catch(i){c.rethrowUnexpectedError(i,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}static Context=G;static EditorWatchdog=re;static ContextWatchdog=ae;_showLicenseError(e,t){setTimeout(()=>{if(e=="invalid")throw new c("invalid-license-key");if(e=="expired")throw new c("license-key-expired");if(e=="domainLimit")throw new c("license-key-domain-limit");if(e=="pluginNotAllowed"){const i=t.replace(/(Editing|UI)$/,""),s=this.plugins.has(i);throw new c("license-key-plugin-not-allowed",null,{pluginName:s?i:t})}if(e=="featureNotAllowed")throw new c("license-key-feature-not-allowed",null,{featureName:t});if(e=="evaluationLimit")throw new c("license-key-evaluation-limit");if(e=="trialLimit")throw new c("license-key-trial-limit");if(e=="developmentLimit")throw new c("license-key-development-limit");if(e=="usageLimit")throw new c("license-key-usage-limit");if(e=="distributionChannel")throw new c("license-key-invalid-distribution-channel")},0),this._showLicenseError=()=>{}}async _sendUsageRequest(e,t){const i=new Headers({"Content-Type":"application/json"}),s=await fetch(new URL(e),{method:"POST",headers:i,body:JSON.stringify(t)});if(!s.ok)throw new Error(`HTTP Response: ${s.status}`);return s.json()}}function ke(r){const e=me(r);function t(i,s){if(le(e,i)!==void 0)throw new c("editor-usage-data-path-already-set",{path:i});ce(e,i,s)}return r.fire("collectUsageData",{setUsageData:t}),e}function Ne(r){if(!M(r.updateSourceElement))throw new c("attachtoform-missing-elementapi-interface",r);const e=r.sourceElement;if(Pe(e)&&e.form){let t;const i=e.form,s=()=>r.updateSourceElement();M(i.submit)&&(t=i.submit,i.submit=()=>{s(),t.apply(i)}),i.addEventListener("submit",s),r.on("destroy",()=>{i.removeEventListener("submit",s),t&&(i.submit=t)})}}function Pe(r){return!!r&&r.tagName.toLowerCase()==="textarea"}function Te(r){class e extends r{sourceElement;updateSourceElement(i){if(!this.sourceElement)throw new c("editor-missing-sourceelement",this);const s=this.config.get("updateSourceElementOnDestroy"),u=this.sourceElement instanceof HTMLTextAreaElement;if(!s&&!u){K(this.sourceElement,"");return}const g=typeof i=="string"?i:this.data.get();K(this.sourceElement,g)}}return e}class Re extends he{_actions;static get pluginName(){return"PendingActions"}static get isOfficialPlugin(){return!0}init(){this.set("hasAny",!1),this._actions=new W({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!="string")throw new c("pendingactions-add-invalid-message",this);const t=new(S());return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}export{ge as Accessibility,ue as Command,de as CommandCollection,G as Context,he as ContextPlugin,fe as EditingKeystrokeHandler,Ae as Editor,Te as ElementApiMixin,Ie as MultiCommand,Re as PendingActions,Le as Plugin,B as _DEFAULT_ACCESSIBILITY_GROUP_ID,me as _getEditorUsageData,Ne as attachToForm};
@@ -1 +1 @@
1
- import{BoxedEditorUIView as f,StickyPanelView as w,ToolbarView as m,MenuBarView as p,InlineEditableUIView as b,EditorUI as y,normalizeToolbarConfig as v,DialogView as u}from"../../../../../@ckeditor_ckeditor5-ui@47.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{enableViewPlaceholder as P}from"../../../../../@ckeditor_ckeditor5-engine@47.3.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{CKEditorError as k,getDataFromElement as T,ElementReplacer as V,Rect as a}from"../../../../../@ckeditor_ckeditor5-utils@47.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{ElementApiMixin as C,attachToForm as B,Editor as E}from"../../../../../@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{isElement as S}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isElement.js";class _ extends y{view;_toolbarConfig;_elementReplacer;constructor(t,i){super(t),this.view=i,this._toolbarConfig=v(t.config.get("toolbar")),this._elementReplacer=new V,this.listenTo(t.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(t){const i=this.editor,o=this.view,n=i.editing.view,e=o.editable,s=n.document.getRoot();e.name=s.rootName,o.render();const r=e.element;this.setEditableElement(e.name,r),o.editable.bind("isFocused").to(this.focusTracker),n.attachDomRoot(r),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),o.menuBarView&&this.initMenuBar(o.menuBarView),this._initDialogPluginIntegration(),this._initContextualBalloonIntegration(),this.fire("ready")}destroy(){super.destroy();const t=this.view,i=this.editor.editing.view;this._elementReplacer.restore(),i.getDomRoot(t.editable.name)&&i.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,t.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",({visualTop:i})=>i||0),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){const t=this.editor,i=t.editing.view,o=i.document.getRoot(),n=t.sourceElement;let e;const s=t.config.get("placeholder");s&&(e=typeof s=="string"?s:s[this.view.editable.name]),!e&&n&&n.tagName.toLowerCase()==="textarea"&&(e=n.getAttribute("placeholder")),e&&(o.placeholder=e),P({view:i,element:o,isDirectHost:!1,keepOnFocus:!0})}_initContextualBalloonIntegration(){if(!this.editor.plugins.has("ContextualBalloon"))return;const{stickyPanel:t}=this.view,i=this.editor.plugins.get("ContextualBalloon");i.on("getPositionOptions",n=>{const e=n.return;if(!e||!t.isSticky||!t.element)return;const s=new a(t.element).height,r=typeof e.target=="function"?e.target():e.target,h=typeof e.limiter=="function"?e.limiter():e.limiter;if(r&&h&&new a(r).height>=new a(h).height-s)return;const d={...e.viewportOffsetConfig},g=(d.top||0)+s;n.return={...e,viewportOffsetConfig:{...d,top:g}}},{priority:"low"});const o=()=>{i.visibleView&&i.updatePosition()};this.listenTo(t,"change:isSticky",o),this.listenTo(this.editor.ui,"change:viewportOffset",o)}_handleScrollToTheSelectionWithStickyPanel(t,i,o){const n=this.view.stickyPanel;if(n.isSticky){const e=new a(n.element).height;i.viewportOffset.top+=e}else{const e=()=>{this.editor.editing.view.scrollToTheSelection(o)};this.listenTo(n,"change:isSticky",e),setTimeout(()=>{this.stopListening(n,"change:isSticky",e)},20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const t=this.view.stickyPanel,i=this.editor.plugins.get("Dialog");i.on("show",()=>{const o=i.view;o.on("moveTo",(n,e)=>{if(!t.isSticky||o.wasMoved||o.isModal)return;const s=new a(t.contentPanelElement);e[1]<s.bottom+u.defaultOffset&&(e[1]=s.bottom+u.defaultOffset)},{priority:"high"})},{priority:"low"})}}class R extends f{stickyPanel;toolbar;editable;constructor(t,i,o={}){super(t),this.stickyPanel=new w(t),this.toolbar=new m(t,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),o.useMenuBar&&(this.menuBarView=new p(t)),this.editable=new b(t,i,void 0,{label:o.label})}render(){super.render(),this.menuBarView?this.stickyPanel.content.addMany([this.menuBarView,this.toolbar]):this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class W extends C(E){static get editorName(){return"ClassicEditor"}ui;constructor(t,i={}){if(!c(t)&&i.initialData!==void 0)throw new k("editor-create-initial-data",null);super(i),this.config.define("menuBar.isVisible",!1),this.config.get("initialData")===void 0&&this.config.set("initialData",x(t)),c(t)&&(this.sourceElement=t),this.model.document.createRoot();const o=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=this.config.get("menuBar"),e=new R(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:o,useMenuBar:n.isVisible,label:this.config.get("label")});this.ui=new _(this,e),B(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,i={}){return new Promise(o=>{const n=new this(t,i);o(n.initPlugins().then(()=>n.ui.init(c(t)?t:null)).then(()=>n.data.init(n.config.get("initialData"))).then(()=>n.fire("ready")).then(()=>n))})}}function x(l){return c(l)?T(l):l}function c(l){return S(l)}export{W as ClassicEditor,_ as ClassicEditorUI,R as ClassicEditorUIView};
1
+ import{BoxedEditorUIView as f,StickyPanelView as w,ToolbarView as m,MenuBarView as p,InlineEditableUIView as b,EditorUI as y,normalizeToolbarConfig as v,DialogView as u}from"../../../../../@ckeditor_ckeditor5-ui@47.4.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{enableViewPlaceholder as P}from"../../../../../@ckeditor_ckeditor5-engine@47.4.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{CKEditorError as k,getDataFromElement as T,ElementReplacer as V,Rect as a}from"../../../../../@ckeditor_ckeditor5-utils@47.4.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{ElementApiMixin as C,attachToForm as B,Editor as E}from"../../../../../@ckeditor_ckeditor5-core@47.4.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{isElement as S}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isElement.js";class _ extends y{view;_toolbarConfig;_elementReplacer;constructor(t,i){super(t),this.view=i,this._toolbarConfig=v(t.config.get("toolbar")),this._elementReplacer=new V,this.listenTo(t.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(t){const i=this.editor,o=this.view,n=i.editing.view,e=o.editable,s=n.document.getRoot();e.name=s.rootName,o.render();const r=e.element;this.setEditableElement(e.name,r),o.editable.bind("isFocused").to(this.focusTracker),n.attachDomRoot(r),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),o.menuBarView&&this.initMenuBar(o.menuBarView),this._initDialogPluginIntegration(),this._initContextualBalloonIntegration(),this.fire("ready")}destroy(){super.destroy();const t=this.view,i=this.editor.editing.view;this._elementReplacer.restore(),i.getDomRoot(t.editable.name)&&i.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,t.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",({visualTop:i})=>i||0),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){const t=this.editor,i=t.editing.view,o=i.document.getRoot(),n=t.sourceElement;let e;const s=t.config.get("placeholder");s&&(e=typeof s=="string"?s:s[this.view.editable.name]),!e&&n&&n.tagName.toLowerCase()==="textarea"&&(e=n.getAttribute("placeholder")),e&&(o.placeholder=e),P({view:i,element:o,isDirectHost:!1,keepOnFocus:!0})}_initContextualBalloonIntegration(){if(!this.editor.plugins.has("ContextualBalloon"))return;const{stickyPanel:t}=this.view,i=this.editor.plugins.get("ContextualBalloon");i.on("getPositionOptions",n=>{const e=n.return;if(!e||!t.isSticky||!t.element)return;const s=new a(t.element).height,r=typeof e.target=="function"?e.target():e.target,h=typeof e.limiter=="function"?e.limiter():e.limiter;if(r&&h&&new a(r).height>=new a(h).height-s)return;const d={...e.viewportOffsetConfig},g=(d.top||0)+s;n.return={...e,viewportOffsetConfig:{...d,top:g}}},{priority:"low"});const o=()=>{i.visibleView&&i.updatePosition()};this.listenTo(t,"change:isSticky",o),this.listenTo(this.editor.ui,"change:viewportOffset",o)}_handleScrollToTheSelectionWithStickyPanel(t,i,o){const n=this.view.stickyPanel;if(n.isSticky){const e=new a(n.element).height;i.viewportOffset.top+=e}else{const e=()=>{this.editor.editing.view.scrollToTheSelection(o)};this.listenTo(n,"change:isSticky",e),setTimeout(()=>{this.stopListening(n,"change:isSticky",e)},20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const t=this.view.stickyPanel,i=this.editor.plugins.get("Dialog");i.on("show",()=>{const o=i.view;o.on("moveTo",(n,e)=>{if(!t.isSticky||o.wasMoved||o.isModal)return;const s=new a(t.contentPanelElement);e[1]<s.bottom+u.defaultOffset&&(e[1]=s.bottom+u.defaultOffset)},{priority:"high"})},{priority:"low"})}}class R extends f{stickyPanel;toolbar;editable;constructor(t,i,o={}){super(t),this.stickyPanel=new w(t),this.toolbar=new m(t,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),o.useMenuBar&&(this.menuBarView=new p(t)),this.editable=new b(t,i,void 0,{label:o.label})}render(){super.render(),this.menuBarView?this.stickyPanel.content.addMany([this.menuBarView,this.toolbar]):this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class W extends C(E){static get editorName(){return"ClassicEditor"}ui;constructor(t,i={}){if(!c(t)&&i.initialData!==void 0)throw new k("editor-create-initial-data",null);super(i),this.config.define("menuBar.isVisible",!1),this.config.get("initialData")===void 0&&this.config.set("initialData",x(t)),c(t)&&(this.sourceElement=t),this.model.document.createRoot();const o=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=this.config.get("menuBar"),e=new R(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:o,useMenuBar:n.isVisible,label:this.config.get("label")});this.ui=new _(this,e),B(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,i={}){return new Promise(o=>{const n=new this(t,i);o(n.initPlugins().then(()=>n.ui.init(c(t)?t:null)).then(()=>n.data.init(n.config.get("initialData"))).then(()=>n.fire("ready")).then(()=>n))})}}function x(l){return c(l)?T(l):l}function c(l){return S(l)}export{W as ClassicEditor,_ as ClassicEditorUI,R as ClassicEditorUIView};