@ncino/web-components 9.2.0-preview.4 → 9.2.0

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 (100) hide show
  1. package/dist/components/accordion/gator/base/accordion.gator.js +1 -1
  2. package/dist/components/accordion/gator/group/accordion-group.gator.js +1 -1
  3. package/dist/components/alert/gator/base/alert.gator.js +1 -1
  4. package/dist/components/banner/gator/banner.gator.js +1 -1
  5. package/dist/components/button/gator/button.gator.js +1 -1
  6. package/dist/components/display-card/gator/display-card.gator.js +1 -1
  7. package/dist/components/headline-card/gator/headline-card.gator.js +1 -1
  8. package/dist/components/icon/gator/icon.gator.js +2 -2
  9. package/dist/components/icon/gator/index.js +1 -1
  10. package/dist/components/icon/gator/templates/arrows-down-up.js +8 -0
  11. package/dist/components/icon/gator/templates/index.js +1 -1
  12. package/dist/components/image-card/gator/image-card.gator.js +1 -1
  13. package/dist/components/input/base/input-base.gator.js +1 -1
  14. package/dist/components/input/gator/dropdown/input-dropdown.gator.js +1 -1
  15. package/dist/components/input/gator/help-text/help-text.gator.js +1 -1
  16. package/dist/components/input/gator/input-file/file-uploaded-preview/file-upload-preview.gator.js +1 -1
  17. package/dist/components/input/gator/input-file/input-file.gator.js +1 -1
  18. package/dist/components/input/gator/input-textarea/input-textarea.gator.js +1 -1
  19. package/dist/components/input/gator/input-time/input-time.gator.js +1 -1
  20. package/dist/components/input-rich-text/ckeditor-config.js +1 -1
  21. package/dist/components/input-rich-text/input-rich-text.slds.js +2 -2
  22. package/dist/components/list/gator/list-item/list-item.gator.js +1 -1
  23. package/dist/components/popover/popover.js +1 -1
  24. package/dist/components/selection-box/selection-box.gator.js +1 -1
  25. package/dist/components/table/gator/table-pagination/table-pagination.gator.js +1 -1
  26. package/dist/components/table/gator/table.gator.js +135 -45
  27. package/dist/design-tokens.source.json +1 -0
  28. package/dist/generated/locale-codes.js +1 -0
  29. package/dist/generated/locales/es-419.js +10 -0
  30. package/dist/generated/locales/fr-CA.js +10 -0
  31. package/dist/generated/locales/zh-Hans.js +11 -0
  32. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-alignment@47.5.0 → @ckeditor_ckeditor5-alignment@47.6.0}/node_modules/@ckeditor/ckeditor5-alignment/dist/index.js +1 -1
  33. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autoformat@47.5.0 → @ckeditor_ckeditor5-autoformat@47.6.0}/node_modules/@ckeditor/ckeditor5-autoformat/dist/index.js +1 -1
  34. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autosave@47.5.0 → @ckeditor_ckeditor5-autosave@47.6.0}/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js +1 -1
  35. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-basic-styles@47.5.0 → @ckeditor_ckeditor5-basic-styles@47.6.0}/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +1 -1
  36. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-block-quote@47.5.0 → @ckeditor_ckeditor5-block-quote@47.6.0}/node_modules/@ckeditor/ckeditor5-block-quote/dist/index.js +1 -1
  37. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-clipboard@47.5.0 → @ckeditor_ckeditor5-clipboard@47.6.0}/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +1 -1
  38. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-cloud-services@47.5.0 → @ckeditor_ckeditor5-cloud-services@47.6.0}/node_modules/@ckeditor/ckeditor5-cloud-services/dist/index.js +1 -1
  39. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-code-block@47.5.0 → @ckeditor_ckeditor5-code-block@47.6.0}/node_modules/@ckeditor/ckeditor5-code-block/dist/index.js +1 -1
  40. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-core@47.5.0 → @ckeditor_ckeditor5-core@47.6.0}/node_modules/@ckeditor/ckeditor5-core/dist/index.js +1 -1
  41. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-editor-classic@47.5.0 → @ckeditor_ckeditor5-editor-classic@47.6.0}/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +1 -1
  42. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-engine@47.5.0 → @ckeditor_ckeditor5-engine@47.6.0}/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +1 -1
  43. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-enter@47.5.0 → @ckeditor_ckeditor5-enter@47.6.0}/node_modules/@ckeditor/ckeditor5-enter/dist/index.js +1 -1
  44. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-essentials@47.5.0 → @ckeditor_ckeditor5-essentials@47.6.0}/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js +1 -1
  45. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-find-and-replace@47.5.0 → @ckeditor_ckeditor5-find-and-replace@47.6.0}/node_modules/@ckeditor/ckeditor5-find-and-replace/dist/index.js +1 -1
  46. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-font@47.5.0 → @ckeditor_ckeditor5-font@47.6.0}/node_modules/@ckeditor/ckeditor5-font/dist/index.js +1 -1
  47. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-heading@47.5.0 → @ckeditor_ckeditor5-heading@47.6.0}/node_modules/@ckeditor/ckeditor5-heading/dist/index.js +1 -1
  48. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-highlight@47.5.0 → @ckeditor_ckeditor5-highlight@47.6.0}/node_modules/@ckeditor/ckeditor5-highlight/dist/index.js +1 -1
  49. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-horizontal-line@47.5.0 → @ckeditor_ckeditor5-horizontal-line@47.6.0}/node_modules/@ckeditor/ckeditor5-horizontal-line/dist/index.js +1 -1
  50. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-html-embed@47.5.0 → @ckeditor_ckeditor5-html-embed@47.6.0}/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +1 -1
  51. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-support@47.6.0/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +3 -0
  52. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-icons@47.5.0 → @ckeditor_ckeditor5-icons@47.6.0}/node_modules/@ckeditor/ckeditor5-icons/dist/index.js +3 -3
  53. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-image@47.5.0 → @ckeditor_ckeditor5-image@47.6.0}/node_modules/@ckeditor/ckeditor5-image/dist/index.js +1 -1
  54. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-indent@47.6.0/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +1 -0
  55. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-language@47.5.0 → @ckeditor_ckeditor5-language@47.6.0}/node_modules/@ckeditor/ckeditor5-language/dist/index.js +1 -1
  56. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-link@47.6.0/node_modules/@ckeditor/ckeditor5-link/dist/index.js +1 -0
  57. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-list@47.6.0/node_modules/@ckeditor/ckeditor5-list/dist/index.js +1 -0
  58. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-markdown-gfm@47.5.0 → @ckeditor_ckeditor5-markdown-gfm@47.6.0}/node_modules/@ckeditor/ckeditor5-markdown-gfm/dist/index.js +1 -1
  59. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-media-embed@47.5.0 → @ckeditor_ckeditor5-media-embed@47.6.0}/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +1 -1
  60. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-mention@47.5.0 → @ckeditor_ckeditor5-mention@47.6.0}/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +1 -1
  61. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-page-break@47.5.0 → @ckeditor_ckeditor5-page-break@47.6.0}/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js +1 -1
  62. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-paragraph@47.5.0 → @ckeditor_ckeditor5-paragraph@47.6.0}/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +1 -1
  63. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paste-from-office@47.6.0/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +1 -0
  64. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-remove-format@47.5.0 → @ckeditor_ckeditor5-remove-format@47.6.0}/node_modules/@ckeditor/ckeditor5-remove-format/dist/index.js +1 -1
  65. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-select-all@47.5.0 → @ckeditor_ckeditor5-select-all@47.6.0}/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +1 -1
  66. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-show-blocks@47.5.0 → @ckeditor_ckeditor5-show-blocks@47.6.0}/node_modules/@ckeditor/ckeditor5-show-blocks/dist/index.js +1 -1
  67. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-source-editing@47.5.0 → @ckeditor_ckeditor5-source-editing@47.6.0}/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +1 -1
  68. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-special-characters@47.5.0 → @ckeditor_ckeditor5-special-characters@47.6.0}/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +1 -1
  69. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-style@47.5.0 → @ckeditor_ckeditor5-style@47.6.0}/node_modules/@ckeditor/ckeditor5-style/dist/index.js +1 -1
  70. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@47.6.0/node_modules/@ckeditor/ckeditor5-table/dist/index.js +1 -0
  71. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-typing@47.5.0 → @ckeditor_ckeditor5-typing@47.6.0}/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +1 -1
  72. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-ui@47.5.0 → @ckeditor_ckeditor5-ui@47.6.0}/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +1 -1
  73. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-undo@47.5.0 → @ckeditor_ckeditor5-undo@47.6.0}/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +1 -1
  74. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-upload@47.5.0 → @ckeditor_ckeditor5-upload@47.6.0}/node_modules/@ckeditor/ckeditor5-upload/dist/index.js +1 -1
  75. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-utils@47.6.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +8 -0
  76. package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-widget@47.5.0 → @ckeditor_ckeditor5-widget@47.6.0}/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +1 -1
  77. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/pick.js +1 -0
  78. package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isNil.js +1 -0
  79. package/dist/packages/web-components/src/components/popover/gator/popover.gator.scss.js +1 -1
  80. package/dist/packages/web-components/src/components/table/gator/table.gator.scss.js +1 -1
  81. package/dist/types/components/icon/gator/templates/arrows-down-up.d.ts +1 -0
  82. package/dist/types/components/icon/gator/templates/index.d.ts +1 -0
  83. package/dist/types/components/popover/popover.d.ts +2 -0
  84. package/dist/types/components/table/gator/table.gator.d.ts +27 -0
  85. package/dist/types/components/table/table-column-definition.d.ts +8 -0
  86. package/dist/types/generated/locale-codes.d.ts +13 -0
  87. package/dist/types/generated/locales/es-419.d.ts +65 -0
  88. package/dist/types/generated/locales/fr-CA.d.ts +65 -0
  89. package/dist/types/generated/locales/zh-Hans.d.ts +65 -0
  90. package/package.json +5 -5
  91. package/web-types.json +4 -413
  92. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-support@47.5.0/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +0 -3
  93. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-indent@47.5.0/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +0 -1
  94. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-link@47.5.0/node_modules/@ckeditor/ckeditor5-link/dist/index.js +0 -1
  95. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-list@47.5.0/node_modules/@ckeditor/ckeditor5-list/dist/index.js +0 -1
  96. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paste-from-office@47.5.0/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +0 -1
  97. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@47.5.0/node_modules/@ckeditor/ckeditor5-table/dist/index.js +0 -1
  98. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-utils@47.5.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +0 -8
  99. /package/dist/assets/node_modules/.pnpm/{ckeditor5@47.5.0 → ckeditor5@47.6.0}/node_modules/ckeditor5/dist/ckeditor5.css +0 -0
  100. /package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-watchdog@47.5.0 → @ckeditor_ckeditor5-watchdog@47.6.0}/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +0 -0
@@ -0,0 +1 @@
1
+ const e="en",s=["es-419","fr-CA","zh-Hans"],o=["en","es-419","fr-CA","zh-Hans"];export{o as allLocales,e as sourceLocale,s as targetLocales};
@@ -0,0 +1,10 @@
1
+ import"../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as e}from"../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{str as a}from"../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/str-tag.js";import"../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";const i={hedb4de867a13d461:e`Mostrando
2
+ ${0}
3
+ resultados. Refina tu búsqueda para ver más.
4
+ `,hf4332945d84c7c82:e`
5
+ ${0}
6
+ archivos subidos
7
+ `,s023f114f575b5bd5:"Página actual",s0379fc73608ab971:"Listo",s03c44f5a1b0581d4:"seleccionados",s06963fd6fbd255b6:"Mes siguiente",s0778ff3bbb3af675:"Saltar a las acciones de la tabla",s08b06007b5567108:"de",s10ff4dbbcf74dacb:"Selección de mes",s129df71274160e17:"Abrir selector de fecha",s13f20cb257e12fac:"Este campo es obligatorio",s14b6da16c2cf9e83:"Por favor, complete los campos obligatorios marcados en los pasos anteriores antes de pasar al siguiente paso.",s15ba5784a11e0b88:"Mes actual",s354acc936af915f2:"Cerrar notificación",s3763f519c347a9f7:"Ahora",s3b5fd0df6b2757e8:"Cancelar subida",s4269a31ccd0d376d:"Opciones de hora",s4c4e33c8c5ffe216:"Mes anterior",s4dabcaab8d268abf:"Elementos por página:",s5153faf0f82adea0:"Minuto anterior",s542ffff558768ea3:"Página siguiente",s56360c5f24cfd4ff:"Elementos por página",s5b6a1140834aa043:"Página anterior",s5e8250fb85d64c23:"Cerrar",s619be8edc061ca50:a`Entrada no válida. El valor debe ser mayor o igual a ${0}.`,s61b843c1ec9cd933:"Tipos de archivos aceptados",s63d040e37887f17e:"Hoy",s6f666d1fa690e523:"Año actual",s7354997f3dd083ef:"Opciones de minuto",s77c72f12bcbded71:"Opciones de momento del día",s7ce8c87fe40f71a6:"Seleccionar hora",s8093bb763f0f674e:"Hora anterior",s952111f801940b59:"Entrada no válida. Por favor, ingrese un valor numérico válido.",s9aac493d4233f302:"Botones de desbordamiento",sa9fa88323c514ded:a`Entrada no válida. El valor debe ser menor o igual a ${0}.`,sae5d87e99fe081e0:"Obligatorio",saef0626ba9eedd25:"o suéltalos aquí",sb2603c25b6a6abb0:a`${0} de ${1} caracteres`,sb4f1dffbb6be6302:"Limpiar",sbaace8219b5f4612:"Seleccionar todo",sbe8fd5b7d4adb0fa:"Selección de año",scb0eac431437616e:"Hora siguiente",scc6256ab113cc5f9:"Eliminar archivo",scc7a3682dd25ae19:"Opcional",sd107e22f86ada16a:"Entrada no válida. Solo se permite un carácter decimal.",sd3d0433825a79e44:"Tipo de archivo no compatible.",sd7d49bcfca1d1989:a`Entrada no válida. Solo se permiten hasta
8
+ ${0}
9
+ lugares decimales.
10
+ `,sd7ec34bc086265cc:"No se encontraron resultados. Refina tu búsqueda.",se1a5dde03a87bc2f:"Por favor, sube un solo archivo.",se763ab80d9e379d3:"Saltar a:",se7692167f1edeef2:"Subiendo...",se791c4ae5355aebb:"Entrada no válida. Solo se permiten números, comas o puntos.",sf1e34cc91709c487:"No se subieron archivos",sf2b7951c086832dd:"Entrada no válida. No se permiten decimales para esta moneda.",sf993bb199fefbe04:"Todos",sf999d4199ff4542d:"Cualquiera",sff52d71181e316c0:"Minuto siguiente",s96668830629e0dfc:"Upload",s36572e28ab087b68:"Completed: ",s6a76576b7734ddbd:"Warning: ",s5e2e9d5a6f7e69c3:"Error: ",sa970bae947058eb7:"Incomplete: ",s4c87c534136a2b45:"AI Assisted: "};export{i as templates};
@@ -0,0 +1,10 @@
1
+ import"../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as s}from"../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{str as e}from"../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/str-tag.js";import"../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";const f={hedb4de867a13d461:s`Affichage de
2
+ ${0}
3
+ résultats. Affinez votre recherche pour en voir plus.
4
+ `,hf4332945d84c7c82:s`
5
+ ${0}
6
+ fichiers téléversés
7
+ `,s023f114f575b5bd5:"Page actuelle",s0379fc73608ab971:"Terminé",s03c44f5a1b0581d4:"sélectionné",s06963fd6fbd255b6:"Mois suivant",s0778ff3bbb3af675:"Aller aux actions du tableau",s08b06007b5567108:"de",s10ff4dbbcf74dacb:"Sélection du mois",s129df71274160e17:"Ouvrir le sélecteur de date",s13f20cb257e12fac:"Ce champ est obligatoire",s14b6da16c2cf9e83:"Veuillez remplir les champs obligatoires indiqués dans les étapes précédentes avant de passer à l'étape suivante.",s15ba5784a11e0b88:"Mois en cours",s354acc936af915f2:"Fermer la notification",s3763f519c347a9f7:"Maintenant",s3b5fd0df6b2757e8:"Annuler le téléversement",s4269a31ccd0d376d:"Options d’heure",s4c4e33c8c5ffe216:"Mois précédent",s4dabcaab8d268abf:"Articles par page:",s5153faf0f82adea0:"Minute précédente",s542ffff558768ea3:"Page suivante",s56360c5f24cfd4ff:"Articles par page",s5b6a1140834aa043:"Page précédente",s5e8250fb85d64c23:"Fermer",s619be8edc061ca50:e`Entrée invalide. Le valeur doit être supérieure ou égale à ${0}.`,s61b843c1ec9cd933:"Types de fichiers acceptés",s63d040e37887f17e:"Aujourd'hui",s6f666d1fa690e523:"Année en cours",s7354997f3dd083ef:"Options de minute",s77c72f12bcbded71:"Options de moment de la journée",s7ce8c87fe40f71a6:"Sélectionner l'heure",s8093bb763f0f674e:"Heure précédente",s952111f801940b59:"Entrée invalide. Veuillez entrer une valeur numérique valide.",s9aac493d4233f302:"Boutons de débordement",sa9fa88323c514ded:e`Entrée invalide. Le valeur doit être inférieure ou égale à ${0}.`,sae5d87e99fe081e0:"Obligatoire",saef0626ba9eedd25:"ou déposez-les ici",sb2603c25b6a6abb0:e`${0} sur ${1} caractères`,sb4f1dffbb6be6302:"Effacer",sbaace8219b5f4612:"Tout sélectionner",sbe8fd5b7d4adb0fa:"Sélection de l'année",scb0eac431437616e:"Heure suivante",scc6256ab113cc5f9:"Supprimer le fichier",scc7a3682dd25ae19:"Facultatif",sd107e22f86ada16a:"Entrée invalide. Un seul caractère décimal est autorisé.",sd3d0433825a79e44:"Type de fichier non pris en charge.",sd7d49bcfca1d1989:e`Entrée invalide. Seulement
8
+ ${0}
9
+ décimales sont autorisées.
10
+ `,sd7ec34bc086265cc:"Aucun résultat trouvé. Affinez votre recherche.",se1a5dde03a87bc2f:"Veuillez téléverser un seul fichier.",se763ab80d9e379d3:"Aller à:",se7692167f1edeef2:"Téléversement...",se791c4ae5355aebb:"Entrée invalide. Seuls les chiffres, les virgules ou les points sont autorisés.",sf1e34cc91709c487:"Aucun fichier téléversé",sf2b7951c086832dd:"Entrée invalide. Aucun chiffre décimal n'est autorisé pour cette devise.",sf993bb199fefbe04:"Tous",sf999d4199ff4542d:"Tous",sff52d71181e316c0:"Minute suivante",s96668830629e0dfc:"Upload",s36572e28ab087b68:"Completed: ",s6a76576b7734ddbd:"Warning: ",s5e2e9d5a6f7e69c3:"Error: ",sa970bae947058eb7:"Incomplete: ",s4c87c534136a2b45:"AI Assisted: "};export{f as templates};
@@ -0,0 +1,11 @@
1
+ import"../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as e}from"../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{str as f}from"../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/str-tag.js";import"../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";const t={hedb4de867a13d461:e`显示
2
+ ${0}
3
+ 个结果。请优化您的搜索以查看更多。
4
+ `,hf4332945d84c7c82:e`
5
+ 已上传
6
+ ${0}
7
+ 个文件
8
+ `,s023f114f575b5bd5:"当前页",s0379fc73608ab971:"完成",s03c44f5a1b0581d4:"已选",s06963fd6fbd255b6:"下个月",s0778ff3bbb3af675:"跳转到表格操作",s08b06007b5567108:"的",s10ff4dbbcf74dacb:"月份选择",s129df71274160e17:"打开日期选择器",s13f20cb257e12fac:"此字段为必填项",s14b6da16c2cf9e83:"请完成前面步骤中标记的必填字段,然后再进行下一步。",s15ba5784a11e0b88:"本月",s354acc936af915f2:"关闭通知",s3763f519c347a9f7:"现在",s3b5fd0df6b2757e8:"取消上传",s4269a31ccd0d376d:"小时选项",s4c4e33c8c5ffe216:"上个月",s4dabcaab8d268abf:"每页项目数:",s5153faf0f82adea0:"上一分钟",s542ffff558768ea3:"下一页",s56360c5f24cfd4ff:"每页项目数",s5b6a1140834aa043:"上一页",s5e8250fb85d64c23:"关闭",s619be8edc061ca50:f`输入无效。值必须大于或等于 ${0}。`,s61b843c1ec9cd933:"接受的文件类型",s63d040e37887f17e:"今天",s6f666d1fa690e523:"今年",s7354997f3dd083ef:"分钟选项",s77c72f12bcbded71:"时间段选项",s7ce8c87fe40f71a6:"选择时间",s8093bb763f0f674e:"上一小时",s952111f801940b59:"输入无效。请输入有效的数字值。",s9aac493d4233f302:"溢出按钮",sa9fa88323c514ded:f`输入无效。值必须小于或等于 ${0}。`,sae5d87e99fe081e0:"必填",saef0626ba9eedd25:"或拖放到这里",sb2603c25b6a6abb0:f`${0} / ${1} 字符`,sb4f1dffbb6be6302:"清除",sbaace8219b5f4612:"全选",sbe8fd5b7d4adb0fa:"年份选择",scb0eac431437616e:"下一小时",scc6256ab113cc5f9:"删除文件",scc7a3682dd25ae19:"可选",sd107e22f86ada16a:"输入无效。只允许一个小数点字符。",sd3d0433825a79e44:"不支持的文件类型。",sd7d49bcfca1d1989:f`输入无效。最多允许
9
+ ${0}
10
+ 位小数。
11
+ `,sd7ec34bc086265cc:"未找到结果。请优化您的搜索。",se1a5dde03a87bc2f:"请上传一个文件。",se763ab80d9e379d3:"跳转至:",se7692167f1edeef2:"正在上传...",se791c4ae5355aebb:"输入无效。只允许数字、逗号或句号。",sf1e34cc91709c487:"未上传文件",sf2b7951c086832dd:"输入无效。此货币不允许使用小数。",sf993bb199fefbe04:"全部",sf999d4199ff4542d:"任何",sff52d71181e316c0:"下一分钟",s96668830629e0dfc:"Upload",s36572e28ab087b68:"Completed: ",s6a76576b7734ddbd:"Warning: ",s5e2e9d5a6f7e69c3:"Error: ",sa970bae947058eb7:"Incomplete: ",s4c87c534136a2b45:"AI Assisted: "};export{t as templates};
@@ -1 +1 @@
1
- import{Plugin as f,Command as v}from"../../../../../@ckeditor_ckeditor5-core@47.5.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{logWarning as y,CKEditorError as g,first as x}from"../../../../../@ckeditor_ckeditor5-utils@47.5.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{ButtonView as T,createDropdown as B,addToolbarToDropdown as E,MenuBarMenuView as D,MenuBarMenuListView as k,MenuBarMenuListItemView as N,MenuBarMenuListItemButtonView as _}from"../../../../../@ckeditor_ckeditor5-ui@47.5.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconAlignLeft as I,IconAlignRight as V,IconAlignCenter as M,IconAlignJustify as O}from"../../../../../@ckeditor_ckeditor5-icons@47.5.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";const b=["left","right","center","justify"];function p(i){return b.includes(i)}function A(i,e){return e.contentLanguageDirection=="rtl"?i==="right":i==="left"}function w(i){const e=i.map(t=>{let o;return typeof t=="string"?o={name:t}:o=t,o}).filter(t=>{const o=b.includes(t.name);return o||y("alignment-config-name-not-recognized",{option:t}),o}),n=e.filter(t=>!!t.className).length;if(n&&n<e.length)throw new g("alignment-config-classnames-are-missing",{configuredOptions:i});return e.forEach((t,o,a)=>{const s=a.slice(o+1);if(s.some(r=>r.name==t.name))throw new g("alignment-config-name-already-defined",{option:t,configuredOptions:i});if(t.className&&s.some(l=>l.className==t.className))throw new g("alignment-config-classname-already-defined",{option:t,configuredOptions:i})}),e}const h="alignment";class L extends v{refresh(){const n=this.editor.locale,t=x(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!t&&this._canBeAligned(t),this.isEnabled&&t.hasAttribute("alignment")?this.value=t.getAttribute("alignment"):this.value=n.contentLanguageDirection==="rtl"?"right":"left"}execute(e={}){const n=this.editor,t=n.locale,o=n.model,a=o.document,s=e.value;o.change(c=>{const r=Array.from(a.selection.getSelectedBlocks()).filter(d=>this._canBeAligned(d)),l=r[0].getAttribute("alignment");A(s,t)||l===s||!s?C(r,c):P(r,c,s)})}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,h)}}function C(i,e){for(const n of i)e.removeAttribute(h,n)}function P(i,e,n){for(const t of i)e.setAttribute(h,n,t)}class S extends f{static get pluginName(){return"AlignmentEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("alignment",{options:b.map(n=>({name:n}))})}init(){const e=this.editor,n=e.locale,t=e.model.schema,a=w(e.config.get("alignment.options")).filter(l=>p(l.name)&&!A(l.name,n)),s=a.some(l=>!!l.className);t.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),s?e.conversion.attributeToAttribute(j(a)):e.conversion.for("downcast").attributeToAttribute(z(a));const c=F(a);for(const l of c)e.conversion.for("upcast").attributeToAttribute(l);const r=U(a);for(const l of r)e.conversion.for("upcast").attributeToAttribute(l);e.commands.add("alignment",new L(e))}}function z(i){const e={};for(const{name:t}of i)e[t]={key:"style",value:{"text-align":t}};return{model:{key:"alignment",values:i.map(t=>t.name)},view:e}}function F(i){const e=[];for(const{name:n}of i)e.push({view:{key:"style",value:{"text-align":n}},model:{key:"alignment",value:n}});return e}function U(i){const e=[];for(const{name:n}of i)e.push({view:{key:"align",value:n},model:{key:"alignment",value:n}});return e}function j(i){const e={};for(const t of i)e[t.name]={key:"class",value:t.className};return{model:{key:"alignment",values:i.map(t=>t.name)},view:e}}const u=new Map([["left",I],["right",V],["center",M],["justify",O]]);class J extends f{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=w(e.config.get("alignment.options"));n.map(t=>t.name).filter(p).forEach(t=>this._addButton(t)),this._addToolbarDropdown(n),this._addMenuBarMenu(n)}_addButton(e){this.editor.ui.componentFactory.add(`alignment:${e}`,t=>this._createButton(t,e))}_createButton(e,n,t={}){const o=this.editor,a=o.commands.get("alignment"),s=new T(e);return s.set({label:this.localizedOptionTitles[n],icon:u.get(n),tooltip:!0,isToggleable:!0,...t}),s.bind("isEnabled").to(a),s.bind("isOn").to(a,"value",c=>c===n),this.listenTo(s,"execute",()=>{o.execute("alignment",{value:n}),o.editing.view.focus()}),s}_addToolbarDropdown(e){const n=this.editor;n.ui.componentFactory.add("alignment",o=>{const a=B(o),s=o.uiLanguageDirection==="rtl"?"w":"e",c=o.t;E(a,()=>e.map(m=>this._createButton(o,m.name,{tooltipPosition:s})),{enableActiveItemFocusOnDropdownOpen:!0,isVertical:!0,ariaLabel:c("Text alignment toolbar")}),a.buttonView.set({label:c("Text alignment"),tooltip:!0}),a.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const r=o.contentLanguageDirection==="rtl"?u.get("right"):u.get("left"),l=n.commands.get("alignment");return a.buttonView.bind("icon").to(l,"value",m=>u.get(m)||r),a.bind("isEnabled").to(l,"isEnabled"),this.listenTo(a,"execute",()=>{n.editing.view.focus()}),a})}_addMenuBarMenu(e){const n=this.editor;n.ui.componentFactory.add("menuBar:alignment",t=>{const o=n.commands.get("alignment"),a=t.t,s=new D(t),c=new k(t);s.bind("isEnabled").to(o),c.set({ariaLabel:a("Text alignment"),role:"menu"}),s.buttonView.set({label:a("Text alignment")});for(const r of e){const l=new N(t,s),m=new _(t);m.delegate("execute").to(s),m.set({label:this.localizedOptionTitles[r.name],icon:u.get(r.name),role:"menuitemcheckbox",isToggleable:!0}),m.on("execute",()=>{n.execute("alignment",{value:r.name}),n.editing.view.focus()}),m.bind("isOn").to(o,"value",d=>d===r.name),m.bind("isEnabled").to(o,"isEnabled"),l.children.add(m),c.items.add(l)}return s.panelView.children.add(c),s})}}class K extends f{static get requires(){return[S,J]}static get pluginName(){return"Alignment"}static get isOfficialPlugin(){return!0}}export{K as Alignment,L as AlignmentCommand,S as AlignmentEditing,J as AlignmentUI,b as _ALIGNMENT_SUPPORTED_OPTIONS,p as _isAlignmentSupported,A as _isDefaultAlignment,w as _normalizeAlignmentOptions};
1
+ import{Plugin as f,Command as v}from"../../../../../@ckeditor_ckeditor5-core@47.6.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{logWarning as y,CKEditorError as g,first as x}from"../../../../../@ckeditor_ckeditor5-utils@47.6.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{ButtonView as T,createDropdown as B,addToolbarToDropdown as E,MenuBarMenuView as D,MenuBarMenuListView as k,MenuBarMenuListItemView as N,MenuBarMenuListItemButtonView as _}from"../../../../../@ckeditor_ckeditor5-ui@47.6.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconAlignLeft as I,IconAlignRight as V,IconAlignCenter as M,IconAlignJustify as O}from"../../../../../@ckeditor_ckeditor5-icons@47.6.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";const b=["left","right","center","justify"];function p(i){return b.includes(i)}function A(i,e){return e.contentLanguageDirection=="rtl"?i==="right":i==="left"}function w(i){const e=i.map(t=>{let o;return typeof t=="string"?o={name:t}:o=t,o}).filter(t=>{const o=b.includes(t.name);return o||y("alignment-config-name-not-recognized",{option:t}),o}),n=e.filter(t=>!!t.className).length;if(n&&n<e.length)throw new g("alignment-config-classnames-are-missing",{configuredOptions:i});return e.forEach((t,o,a)=>{const s=a.slice(o+1);if(s.some(r=>r.name==t.name))throw new g("alignment-config-name-already-defined",{option:t,configuredOptions:i});if(t.className&&s.some(l=>l.className==t.className))throw new g("alignment-config-classname-already-defined",{option:t,configuredOptions:i})}),e}const h="alignment";class L extends v{refresh(){const n=this.editor.locale,t=x(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!t&&this._canBeAligned(t),this.isEnabled&&t.hasAttribute("alignment")?this.value=t.getAttribute("alignment"):this.value=n.contentLanguageDirection==="rtl"?"right":"left"}execute(e={}){const n=this.editor,t=n.locale,o=n.model,a=o.document,s=e.value;o.change(c=>{const r=Array.from(a.selection.getSelectedBlocks()).filter(d=>this._canBeAligned(d)),l=r[0].getAttribute("alignment");A(s,t)||l===s||!s?C(r,c):P(r,c,s)})}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,h)}}function C(i,e){for(const n of i)e.removeAttribute(h,n)}function P(i,e,n){for(const t of i)e.setAttribute(h,n,t)}class S extends f{static get pluginName(){return"AlignmentEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("alignment",{options:b.map(n=>({name:n}))})}init(){const e=this.editor,n=e.locale,t=e.model.schema,a=w(e.config.get("alignment.options")).filter(l=>p(l.name)&&!A(l.name,n)),s=a.some(l=>!!l.className);t.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),s?e.conversion.attributeToAttribute(j(a)):e.conversion.for("downcast").attributeToAttribute(z(a));const c=F(a);for(const l of c)e.conversion.for("upcast").attributeToAttribute(l);const r=U(a);for(const l of r)e.conversion.for("upcast").attributeToAttribute(l);e.commands.add("alignment",new L(e))}}function z(i){const e={};for(const{name:t}of i)e[t]={key:"style",value:{"text-align":t}};return{model:{key:"alignment",values:i.map(t=>t.name)},view:e}}function F(i){const e=[];for(const{name:n}of i)e.push({view:{key:"style",value:{"text-align":n}},model:{key:"alignment",value:n}});return e}function U(i){const e=[];for(const{name:n}of i)e.push({view:{key:"align",value:n},model:{key:"alignment",value:n}});return e}function j(i){const e={};for(const t of i)e[t.name]={key:"class",value:t.className};return{model:{key:"alignment",values:i.map(t=>t.name)},view:e}}const u=new Map([["left",I],["right",V],["center",M],["justify",O]]);class J extends f{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=w(e.config.get("alignment.options"));n.map(t=>t.name).filter(p).forEach(t=>this._addButton(t)),this._addToolbarDropdown(n),this._addMenuBarMenu(n)}_addButton(e){this.editor.ui.componentFactory.add(`alignment:${e}`,t=>this._createButton(t,e))}_createButton(e,n,t={}){const o=this.editor,a=o.commands.get("alignment"),s=new T(e);return s.set({label:this.localizedOptionTitles[n],icon:u.get(n),tooltip:!0,isToggleable:!0,...t}),s.bind("isEnabled").to(a),s.bind("isOn").to(a,"value",c=>c===n),this.listenTo(s,"execute",()=>{o.execute("alignment",{value:n}),o.editing.view.focus()}),s}_addToolbarDropdown(e){const n=this.editor;n.ui.componentFactory.add("alignment",o=>{const a=B(o),s=o.uiLanguageDirection==="rtl"?"w":"e",c=o.t;E(a,()=>e.map(m=>this._createButton(o,m.name,{tooltipPosition:s})),{enableActiveItemFocusOnDropdownOpen:!0,isVertical:!0,ariaLabel:c("Text alignment toolbar")}),a.buttonView.set({label:c("Text alignment"),tooltip:!0}),a.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const r=o.contentLanguageDirection==="rtl"?u.get("right"):u.get("left"),l=n.commands.get("alignment");return a.buttonView.bind("icon").to(l,"value",m=>u.get(m)||r),a.bind("isEnabled").to(l,"isEnabled"),this.listenTo(a,"execute",()=>{n.editing.view.focus()}),a})}_addMenuBarMenu(e){const n=this.editor;n.ui.componentFactory.add("menuBar:alignment",t=>{const o=n.commands.get("alignment"),a=t.t,s=new D(t),c=new k(t);s.bind("isEnabled").to(o),c.set({ariaLabel:a("Text alignment"),role:"menu"}),s.buttonView.set({label:a("Text alignment")});for(const r of e){const l=new N(t,s),m=new _(t);m.delegate("execute").to(s),m.set({label:this.localizedOptionTitles[r.name],icon:u.get(r.name),role:"menuitemcheckbox",isToggleable:!0}),m.on("execute",()=>{n.execute("alignment",{value:r.name}),n.editing.view.focus()}),m.bind("isOn").to(o,"value",d=>d===r.name),m.bind("isEnabled").to(o,"isEnabled"),l.children.add(m),c.items.add(l)}return s.panelView.children.add(c),s})}}class K extends f{static get requires(){return[S,J]}static get pluginName(){return"Alignment"}static get isOfficialPlugin(){return!0}}export{K as Alignment,L as AlignmentCommand,S as AlignmentEditing,J as AlignmentUI,b as _ALIGNMENT_SUPPORTED_OPTIONS,p as _isAlignmentSupported,A as _isDefaultAlignment,w as _normalizeAlignmentOptions};
@@ -1 +1 @@
1
- import{Plugin as y}from"../../../../../@ckeditor_ckeditor5-core@47.5.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Delete as P}from"../../../../../@ckeditor_ckeditor5-typing@47.5.0/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{ModelLiveRange as B,ModelSchemaContext as S}from"../../../../../@ckeditor_ckeditor5-engine@47.5.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{first as q}from"../../../../../@ckeditor_ckeditor5-utils@47.5.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";function m(o,t,e,s){let a,n=null;typeof s=="function"?a=s:(n=o.commands.get(s),a=()=>{o.execute(s)}),o.model.document.on("change:data",(g,l)=>{if(n&&!n.isEnabled||!t.isEnabled)return;const r=q(o.model.document.selection.getRanges());if(!r.isCollapsed||l.isUndo||!l.isLocal)return;const h=Array.from(o.model.document.differ.getChanges()),c=h[0];if(h.length!=1||c.type!=="insert"||c.name!="$text"||c.length!=1)return;const i=c.position.parent;if(i.is("element","codeBlock")||i.is("element","listItem")&&typeof s!="function"&&!["numberedList","bulletedList","todoList"].includes(s)||n&&n.value===!0)return;const u=i.getChild(0),A=o.model.createRangeOn(u);if(!A.containsRange(r)&&!r.end.isEqual(A.end))return;const p=e.exec(u.data.substr(0,r.end.offset));p&&o.model.enqueueChange(d=>{const f=o.model.document.selection,L=d.createPositionAt(i,0),$=d.createPositionAt(i,p[0].length),k=new B(L,$);if(a({match:p})!==!1){const x=Array.from(f.getAttributes());d.remove(k);const C=f.getFirstRange(),v=d.createRangeIn(i);i.isEmpty&&!v.isEqual(C)&&!v.containsRange(C,!0)&&d.remove(i),F(d,f,x)}k.detach(),o.model.enqueueChange(()=>{o.plugins.get("Delete").requestUndoOnBackspace()})})})}function F(o,t,e){const s=o.model.schema,a=t.getFirstPosition();let n=new S(a);s.checkChild(n,"$text")&&(n=n.push("$text"));for(const[g,l]of e)s.checkAttribute(n,g)&&o.setSelectionAttribute(g,l)}function b(o,t,e,s){let a,n;e instanceof RegExp?a=e:n=e,n=n||(g=>{let l;const r=[],h=[];for(;(l=a.exec(g))!==null&&!(l&&l.length<4);){let{index:c,"1":i,"2":u,"3":A}=l;const p=i+u+A;c+=l[0].length-p.length;const d=[c,c+i.length],f=[c+i.length+u.length,c+i.length+u.length+A.length];r.push(d),r.push(f),h.push([c+i.length,c+i.length+u.length])}return{remove:r,format:h}}),o.model.document.on("change:data",(g,l)=>{if(l.isUndo||!l.isLocal||!t.isEnabled)return;const r=o.model,h=r.document.selection;if(!h.isCollapsed)return;const c=Array.from(r.document.differ.getChanges()),i=c[0];if(c.length!=1||i.type!=="insert"||i.name!="$text"||i.length!=1)return;const u=h.focus,A=u.parent,{text:p,range:d}=I(r.createRange(r.createPositionAt(A,0),u),r),f=n(p),L=R(d.start,f.format,r),$=R(d.start,f.remove,r);L.length&&$.length&&r.enqueueChange(k=>{if(s(k,L)!==!1){for(const x of $.reverse())k.remove(x);r.enqueueChange(()=>{o.plugins.get("Delete").requestUndoOnBackspace()})}})})}function R(o,t,e){return t.filter(s=>s[0]!==void 0&&s[1]!==void 0).map(s=>e.createRange(o.getShiftedBy(s[0]),o.getShiftedBy(s[1])))}function I(o,t){let e=o.start;return{text:Array.from(o.getItems()).reduce((a,n)=>!(n.is("$text")||n.is("$textProxy"))||n.getAttribute("code")?(e=t.createPositionAfter(n),""):a+n.data,""),range:t.createRange(e,o.end)}}class Q extends y{static get requires(){return[P]}static get pluginName(){return"Autoformat"}static get isOfficialPlugin(){return!0}afterInit(){const t=this.editor,e=this.editor.t;this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats(),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Revert autoformatting action"),keystroke:"Backspace"}]})}_addListAutoformats(){const t=this.editor.commands;t.get("bulletedList")&&m(this.editor,this,/^[*-]\s$/,"bulletedList"),t.get("numberedList")&&m(this.editor,this,/^1[.|)]\s$/,"numberedList"),t.get("todoList")&&m(this.editor,this,/^\[\s?\]\s$/,"todoList"),t.get("checkTodoList")&&m(this.editor,this,/^\[\s?x\s?\]\s$/,()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")})}_addBasicStylesAutoformats(){const t=this.editor.commands;if(t.get("bold")){const e=_(this.editor,"bold");b(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,e),b(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,e)}if(t.get("italic")){const e=_(this.editor,"italic");b(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,e),b(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,e)}if(t.get("code")){const e=_(this.editor,"code");b(this.editor,this,/(`)([^`]+)(`)$/g,e)}if(t.get("strikethrough")){const e=_(this.editor,"strikethrough");b(this.editor,this,/(~~)([^~]+)(~~)$/g,e)}}_addHeadingAutoformats(){const t=this.editor.commands.get("heading");t&&t.modelElements.filter(e=>e.match(/^heading[1-6]$/)).forEach(e=>{const s=e[7],a=new RegExp(`^(#{${s}})\\s$`);m(this.editor,this,a,()=>{if(!t.isEnabled||t.value===e)return!1;this.editor.execute("heading",{value:e})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&m(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const t=this.editor,e=t.model.document.selection;t.commands.get("codeBlock")&&m(t,this,/^```$/,()=>{if(e.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})})}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&m(this.editor,this,/^---$/,"horizontalLine")}}function _(o,t){return(e,s)=>{if(!o.commands.get(t).isEnabled)return!1;const n=o.model.schema.getValidRanges(s,t);for(const g of n)e.setAttribute(t,!0,g);e.removeSelectionAttribute(t)}}export{Q as Autoformat,m as blockAutoformatEditing,b as inlineAutoformatEditing};
1
+ import{Plugin as y}from"../../../../../@ckeditor_ckeditor5-core@47.6.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Delete as P}from"../../../../../@ckeditor_ckeditor5-typing@47.6.0/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{ModelLiveRange as B,ModelSchemaContext as S}from"../../../../../@ckeditor_ckeditor5-engine@47.6.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{first as q}from"../../../../../@ckeditor_ckeditor5-utils@47.6.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";function m(o,t,e,s){let a,n=null;typeof s=="function"?a=s:(n=o.commands.get(s),a=()=>{o.execute(s)}),o.model.document.on("change:data",(g,l)=>{if(n&&!n.isEnabled||!t.isEnabled)return;const r=q(o.model.document.selection.getRanges());if(!r.isCollapsed||l.isUndo||!l.isLocal)return;const h=Array.from(o.model.document.differ.getChanges()),c=h[0];if(h.length!=1||c.type!=="insert"||c.name!="$text"||c.length!=1)return;const i=c.position.parent;if(i.is("element","codeBlock")||i.is("element","listItem")&&typeof s!="function"&&!["numberedList","bulletedList","todoList"].includes(s)||n&&n.value===!0)return;const u=i.getChild(0),A=o.model.createRangeOn(u);if(!A.containsRange(r)&&!r.end.isEqual(A.end))return;const p=e.exec(u.data.substr(0,r.end.offset));p&&o.model.enqueueChange(d=>{const f=o.model.document.selection,L=d.createPositionAt(i,0),$=d.createPositionAt(i,p[0].length),k=new B(L,$);if(a({match:p})!==!1){const x=Array.from(f.getAttributes());d.remove(k);const C=f.getFirstRange(),v=d.createRangeIn(i);i.isEmpty&&!v.isEqual(C)&&!v.containsRange(C,!0)&&d.remove(i),F(d,f,x)}k.detach(),o.model.enqueueChange(()=>{o.plugins.get("Delete").requestUndoOnBackspace()})})})}function F(o,t,e){const s=o.model.schema,a=t.getFirstPosition();let n=new S(a);s.checkChild(n,"$text")&&(n=n.push("$text"));for(const[g,l]of e)s.checkAttribute(n,g)&&o.setSelectionAttribute(g,l)}function b(o,t,e,s){let a,n;e instanceof RegExp?a=e:n=e,n=n||(g=>{let l;const r=[],h=[];for(;(l=a.exec(g))!==null&&!(l&&l.length<4);){let{index:c,"1":i,"2":u,"3":A}=l;const p=i+u+A;c+=l[0].length-p.length;const d=[c,c+i.length],f=[c+i.length+u.length,c+i.length+u.length+A.length];r.push(d),r.push(f),h.push([c+i.length,c+i.length+u.length])}return{remove:r,format:h}}),o.model.document.on("change:data",(g,l)=>{if(l.isUndo||!l.isLocal||!t.isEnabled)return;const r=o.model,h=r.document.selection;if(!h.isCollapsed)return;const c=Array.from(r.document.differ.getChanges()),i=c[0];if(c.length!=1||i.type!=="insert"||i.name!="$text"||i.length!=1)return;const u=h.focus,A=u.parent,{text:p,range:d}=I(r.createRange(r.createPositionAt(A,0),u),r),f=n(p),L=R(d.start,f.format,r),$=R(d.start,f.remove,r);L.length&&$.length&&r.enqueueChange(k=>{if(s(k,L)!==!1){for(const x of $.reverse())k.remove(x);r.enqueueChange(()=>{o.plugins.get("Delete").requestUndoOnBackspace()})}})})}function R(o,t,e){return t.filter(s=>s[0]!==void 0&&s[1]!==void 0).map(s=>e.createRange(o.getShiftedBy(s[0]),o.getShiftedBy(s[1])))}function I(o,t){let e=o.start;return{text:Array.from(o.getItems()).reduce((a,n)=>!(n.is("$text")||n.is("$textProxy"))||n.getAttribute("code")?(e=t.createPositionAfter(n),""):a+n.data,""),range:t.createRange(e,o.end)}}class Q extends y{static get requires(){return[P]}static get pluginName(){return"Autoformat"}static get isOfficialPlugin(){return!0}afterInit(){const t=this.editor,e=this.editor.t;this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats(),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Revert autoformatting action"),keystroke:"Backspace"}]})}_addListAutoformats(){const t=this.editor.commands;t.get("bulletedList")&&m(this.editor,this,/^[*-]\s$/,"bulletedList"),t.get("numberedList")&&m(this.editor,this,/^1[.|)]\s$/,"numberedList"),t.get("todoList")&&m(this.editor,this,/^\[\s?\]\s$/,"todoList"),t.get("checkTodoList")&&m(this.editor,this,/^\[\s?x\s?\]\s$/,()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")})}_addBasicStylesAutoformats(){const t=this.editor.commands;if(t.get("bold")){const e=_(this.editor,"bold");b(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,e),b(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,e)}if(t.get("italic")){const e=_(this.editor,"italic");b(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,e),b(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,e)}if(t.get("code")){const e=_(this.editor,"code");b(this.editor,this,/(`)([^`]+)(`)$/g,e)}if(t.get("strikethrough")){const e=_(this.editor,"strikethrough");b(this.editor,this,/(~~)([^~]+)(~~)$/g,e)}}_addHeadingAutoformats(){const t=this.editor.commands.get("heading");t&&t.modelElements.filter(e=>e.match(/^heading[1-6]$/)).forEach(e=>{const s=e[7],a=new RegExp(`^(#{${s}})\\s$`);m(this.editor,this,a,()=>{if(!t.isEnabled||t.value===e)return!1;this.editor.execute("heading",{value:e})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&m(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const t=this.editor,e=t.model.document.selection;t.commands.get("codeBlock")&&m(t,this,/^```$/,()=>{if(e.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})})}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&m(this.editor,this,/^---$/,"horizontalLine")}}function _(o,t){return(e,s)=>{if(!o.commands.get(t).isEnabled)return!1;const n=o.model.schema.getValidRanges(s,t);for(const g of n)e.setAttribute(t,!0,g);e.removeSelectionAttribute(t)}}export{Q as Autoformat,m as blockAutoformatEditing,b as inlineAutoformatEditing};
@@ -1 +1 @@
1
- import{Plugin as a,PendingActions as n}from"../../../../../@ckeditor_ckeditor5-core@47.5.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{DomEmitterMixin as o}from"../../../../../@ckeditor_ckeditor5-utils@47.5.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{debounce as r}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/debounce.js";class _ extends a{adapter;_debouncedSave;_lastDocumentVersion;_savePromise;_domEmitter;_config;_pendingActions;_makeImmediateSave;_action=null;static get pluginName(){return"Autosave"}static get isOfficialPlugin(){return!0}static get requires(){return[n]}constructor(t){super(t);const e=t.config.get("autosave")||{},i=e.waitingTime||1e3;this.set("state","synchronized"),this._debouncedSave=r(this._save.bind(this),i),this._lastDocumentVersion=t.model.document.version,this._savePromise=null,this._domEmitter=new(o()),this._config=e,this._pendingActions=t.plugins.get(n),this._makeImmediateSave=!1}init(){const t=this.editor,e=t.model.document;this.listenTo(t,"ready",()=>{this.listenTo(e,"change:data",(i,s)=>{this._saveCallbacks.length&&s.isLocal&&(this.state==="synchronized"&&(this.state="waiting",this._setPendingAction()),this.state==="waiting"&&this._debouncedSave())})}),this.listenTo(t,"destroy",()=>this._flush(),{priority:"highest"});this._domEmitter.listenTo(window,"beforeunload",(i,s)=>{this._pendingActions.hasAny&&(s.returnValue=this._pendingActions.first.message)})}destroy(){this._domEmitter.stopListening(),super.destroy()}save(){return this._debouncedSave.cancel(),this._save()}_flush(){this._debouncedSave.flush()}_save(){return this._savePromise?(this._makeImmediateSave=this.editor.model.document.version>this._lastDocumentVersion,this._savePromise):(this._setPendingAction(),this.state="saving",this._lastDocumentVersion=this.editor.model.document.version,this._savePromise=Promise.resolve().then(()=>Promise.all(this._saveCallbacks.map(t=>t(this.editor)))).finally(()=>{this._savePromise=null}).then(()=>{if(this._makeImmediateSave)return this._makeImmediateSave=!1,this._save();this.editor.model.document.version>this._lastDocumentVersion?(this.state="waiting",this._debouncedSave()):(this.state="synchronized",this._pendingActions.remove(this._action),this._action=null)}).catch(t=>{throw this.state="error",this.state="saving",this._debouncedSave(),t}),this._savePromise)}_setPendingAction(){const t=this.editor.t;this._action||(this._action=this._pendingActions.add(t("Saving changes")))}get _saveCallbacks(){const t=[];return this.adapter&&this.adapter.save&&t.push(this.adapter.save),this._config.save&&t.push(this._config.save),t}}export{_ as Autosave};
1
+ import{Plugin as a,PendingActions as n}from"../../../../../@ckeditor_ckeditor5-core@47.6.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{DomEmitterMixin as o}from"../../../../../@ckeditor_ckeditor5-utils@47.6.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{debounce as r}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/debounce.js";class _ extends a{adapter;_debouncedSave;_lastDocumentVersion;_savePromise;_domEmitter;_config;_pendingActions;_makeImmediateSave;_action=null;static get pluginName(){return"Autosave"}static get isOfficialPlugin(){return!0}static get requires(){return[n]}constructor(t){super(t);const e=t.config.get("autosave")||{},i=e.waitingTime||1e3;this.set("state","synchronized"),this._debouncedSave=r(this._save.bind(this),i),this._lastDocumentVersion=t.model.document.version,this._savePromise=null,this._domEmitter=new(o()),this._config=e,this._pendingActions=t.plugins.get(n),this._makeImmediateSave=!1}init(){const t=this.editor,e=t.model.document;this.listenTo(t,"ready",()=>{this.listenTo(e,"change:data",(i,s)=>{this._saveCallbacks.length&&s.isLocal&&(this.state==="synchronized"&&(this.state="waiting",this._setPendingAction()),this.state==="waiting"&&this._debouncedSave())})}),this.listenTo(t,"destroy",()=>this._flush(),{priority:"highest"});this._domEmitter.listenTo(window,"beforeunload",(i,s)=>{this._pendingActions.hasAny&&(s.returnValue=this._pendingActions.first.message)})}destroy(){this._domEmitter.stopListening(),super.destroy()}save(){return this._debouncedSave.cancel(),this._save()}_flush(){this._debouncedSave.flush()}_save(){return this._savePromise?(this._makeImmediateSave=this.editor.model.document.version>this._lastDocumentVersion,this._savePromise):(this._setPendingAction(),this.state="saving",this._lastDocumentVersion=this.editor.model.document.version,this._savePromise=Promise.resolve().then(()=>Promise.all(this._saveCallbacks.map(t=>t(this.editor)))).finally(()=>{this._savePromise=null}).then(()=>{if(this._makeImmediateSave)return this._makeImmediateSave=!1,this._save();this.editor.model.document.version>this._lastDocumentVersion?(this.state="waiting",this._debouncedSave()):(this.state="synchronized",this._pendingActions.remove(this._action),this._action=null)}).catch(t=>{throw this.state="error",this.state="saving",this._debouncedSave(),t}),this._savePromise)}_setPendingAction(){const t=this.editor.t;this._action||(this._action=this._pendingActions.add(t("Saving changes")))}get _saveCallbacks(){const t=[];return this.adapter&&this.adapter.save&&t.push(this.adapter.save),this._config.save&&t.push(this._config.save),t}}export{_ as Autosave};
@@ -1 +1 @@
1
- import{Plugin as r,Command as U}from"../../../../../@ckeditor_ckeditor5-core@47.5.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{ModelDocumentSelection as w}from"../../../../../@ckeditor_ckeditor5-engine@47.5.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{IconBold as R,IconCode as F,IconItalic as v,IconStrikethrough as L,IconSubscript as K,IconSuperscript as $,IconUnderline as H}from"../../../../../@ckeditor_ckeditor5-icons@47.5.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as l,MenuBarMenuListItemButtonView as a}from"../../../../../@ckeditor_ckeditor5-ui@47.5.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{TwoStepCaretMovement as N,inlineHighlight as q}from"../../../../../@ckeditor_ckeditor5-typing@47.5.0/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";class d extends U{attributeKey;constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,o=e.document.selection,c=t.forceValue===void 0?!this.value:t.forceValue;e.change(m=>{if(o.isCollapsed)c?m.setSelectionAttribute(this.attributeKey,!0):m.removeSelectionAttribute(this.attributeKey);else{const I=e.schema.getValidRanges(o.getRanges(),this.attributeKey,{includeEmptyRanges:!0});for(const n of I){let S=n,x=this.attributeKey;n.isCollapsed&&(S=n.start.parent,x=w._getStoreAttributeKey(this.attributeKey)),c?m.setAttribute(x,c,S):m.removeAttribute(x,S)}}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,i=t.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const o of i.getRanges())for(const c of o.getItems())if(e.checkAttribute(c,this.attributeKey))return c.hasAttribute(this.attributeKey);return!1}}const p="bold";class D extends r{static get pluginName(){return"BoldEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:p}),t.model.schema.setAttributeProperties(p,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:p,view:"strong",upcastAlso:["b",i=>{const o=i.getStyle("font-weight");return o&&(o=="bold"||Number(o)>=600)?{name:!0,styles:["font-weight"]}:null}]}),t.commands.add(p,new d(t,p)),t.keystrokes.set("CTRL+B",p),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Bold text"),keystroke:"CTRL+B"}]})}}function g({editor:s,commandName:t,plugin:e,icon:i,label:o,keystroke:c}){return m=>{const I=s.commands.get(t),n=new m(s.locale);return n.set({label:o,icon:i,keystroke:c,isToggleable:!0}),n.bind("isEnabled").to(I,"isEnabled"),n.bind("isOn").to(I,"value"),n instanceof a?n.set({role:"menuitemcheckbox"}):n.set({tooltip:!0}),e.listenTo(n,"execute",()=>{s.execute(t),s.editing.view.focus()}),n}}const E="bold";class V extends r{static get pluginName(){return"BoldUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=g({editor:t,commandName:E,plugin:this,icon:R,label:e("Bold"),keystroke:"CTRL+B"});t.ui.componentFactory.add(E,()=>i(l)),t.ui.componentFactory.add("menuBar:"+E,()=>i(a))}}class ct extends r{static get requires(){return[D,V]}static get pluginName(){return"Bold"}static get isOfficialPlugin(){return!0}}const u="code",_="ck-code_selected";class M extends r{static get pluginName(){return"CodeEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[N]}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:u}),t.model.schema.setAttributeProperties(u,{isFormatting:!0,copyOnEnter:!1}),t.conversion.attributeToElement({model:u,view:"code"}),t.commands.add(u,new d(t,u)),t.plugins.get(N).registerAttribute(u),q(t,u,"code",_),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Move out of an inline code style"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}}const C="code";class G extends r{static get pluginName(){return"CodeUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=g({editor:t,commandName:C,plugin:this,icon:F,label:e("Code")});t.ui.componentFactory.add(C,()=>i(l)),t.ui.componentFactory.add("menuBar:"+C,()=>i(a))}}class at extends r{static get requires(){return[M,G]}static get pluginName(){return"Code"}static get isOfficialPlugin(){return!0}}const h="italic";class X extends r{static get pluginName(){return"ItalicEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:h}),t.model.schema.setAttributeProperties(h,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:h,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add(h,new d(t,h)),t.keystrokes.set("CTRL+I",h),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Italic text"),keystroke:"CTRL+I"}]})}}const A="italic";class W extends r{static get pluginName(){return"ItalicUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=g({editor:t,commandName:A,plugin:this,icon:v,keystroke:"CTRL+I",label:e("Italic")});t.ui.componentFactory.add(A,()=>i(l)),t.ui.componentFactory.add("menuBar:"+A,()=>i(a))}}class ut extends r{static get requires(){return[X,W]}static get pluginName(){return"Italic"}static get isOfficialPlugin(){return!0}}const b="strikethrough";class j extends r{static get pluginName(){return"StrikethroughEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:b}),t.model.schema.setAttributeProperties(b,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:b,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),t.commands.add(b,new d(t,b)),t.keystrokes.set("CTRL+SHIFT+X","strikethrough"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Strikethrough text"),keystroke:"CTRL+SHIFT+X"}]})}}const B="strikethrough";class z extends r{static get pluginName(){return"StrikethroughUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=g({editor:t,commandName:B,plugin:this,icon:L,keystroke:"CTRL+SHIFT+X",label:e("Strikethrough")});t.ui.componentFactory.add(B,()=>i(l)),t.ui.componentFactory.add("menuBar:"+B,()=>i(a))}}class lt extends r{static get requires(){return[j,z]}static get pluginName(){return"Strikethrough"}static get isOfficialPlugin(){return!0}}const f="subscript";class J extends r{static get pluginName(){return"SubscriptEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:f}),t.model.schema.setAttributeProperties(f,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:f,view:"sub",upcastAlso:[{styles:{"vertical-align":"sub"}}]}),t.commands.add(f,new d(t,f))}}const O="subscript";class Q extends r{static get pluginName(){return"SubscriptUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=g({editor:t,commandName:O,plugin:this,icon:K,label:e("Subscript")});t.ui.componentFactory.add(O,()=>i(l)),t.ui.componentFactory.add("menuBar:"+O,()=>i(a))}}class dt extends r{static get requires(){return[J,Q]}static get pluginName(){return"Subscript"}static get isOfficialPlugin(){return!0}}const y="superscript";class Y extends r{static get pluginName(){return"SuperscriptEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:y}),t.model.schema.setAttributeProperties(y,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:y,view:"sup",upcastAlso:[{styles:{"vertical-align":"super"}}]}),t.commands.add(y,new d(t,y))}}const T="superscript";class Z extends r{static get pluginName(){return"SuperscriptUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=g({editor:t,commandName:T,plugin:this,icon:$,label:e("Superscript")});t.ui.componentFactory.add(T,()=>i(l)),t.ui.componentFactory.add("menuBar:"+T,()=>i(a))}}class gt extends r{static get requires(){return[Y,Z]}static get pluginName(){return"Superscript"}static get isOfficialPlugin(){return!0}}const k="underline";class tt extends r{static get pluginName(){return"UnderlineEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:k}),t.model.schema.setAttributeProperties(k,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:k,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),t.commands.add(k,new d(t,k)),t.keystrokes.set("CTRL+U","underline"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Underline text"),keystroke:"CTRL+U"}]})}}const P="underline";class et extends r{static get pluginName(){return"UnderlineUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=g({editor:t,commandName:P,plugin:this,icon:H,label:e("Underline"),keystroke:"CTRL+U"});t.ui.componentFactory.add(P,()=>i(l)),t.ui.componentFactory.add("menuBar:"+P,()=>i(a))}}class mt extends r{static get requires(){return[tt,et]}static get pluginName(){return"Underline"}static get isOfficialPlugin(){return!0}}export{d as AttributeCommand,ct as Bold,D as BoldEditing,V as BoldUI,at as Code,M as CodeEditing,G as CodeUI,ut as Italic,X as ItalicEditing,W as ItalicUI,lt as Strikethrough,j as StrikethroughEditing,z as StrikethroughUI,dt as Subscript,J as SubscriptEditing,Q as SubscriptUI,gt as Superscript,Y as SuperscriptEditing,Z as SuperscriptUI,mt as Underline,tt as UnderlineEditing,et as UnderlineUI,g as _getBasicStylesButtonCreator};
1
+ import{Plugin as r,Command as U}from"../../../../../@ckeditor_ckeditor5-core@47.6.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{ModelDocumentSelection as w}from"../../../../../@ckeditor_ckeditor5-engine@47.6.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{IconBold as R,IconCode as F,IconItalic as v,IconStrikethrough as L,IconSubscript as K,IconSuperscript as $,IconUnderline as H}from"../../../../../@ckeditor_ckeditor5-icons@47.6.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as l,MenuBarMenuListItemButtonView as a}from"../../../../../@ckeditor_ckeditor5-ui@47.6.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{TwoStepCaretMovement as N,inlineHighlight as q}from"../../../../../@ckeditor_ckeditor5-typing@47.6.0/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";class d extends U{attributeKey;constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,o=e.document.selection,c=t.forceValue===void 0?!this.value:t.forceValue;e.change(m=>{if(o.isCollapsed)c?m.setSelectionAttribute(this.attributeKey,!0):m.removeSelectionAttribute(this.attributeKey);else{const I=e.schema.getValidRanges(o.getRanges(),this.attributeKey,{includeEmptyRanges:!0});for(const n of I){let S=n,x=this.attributeKey;n.isCollapsed&&(S=n.start.parent,x=w._getStoreAttributeKey(this.attributeKey)),c?m.setAttribute(x,c,S):m.removeAttribute(x,S)}}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,i=t.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const o of i.getRanges())for(const c of o.getItems())if(e.checkAttribute(c,this.attributeKey))return c.hasAttribute(this.attributeKey);return!1}}const p="bold";class D extends r{static get pluginName(){return"BoldEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:p}),t.model.schema.setAttributeProperties(p,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:p,view:"strong",upcastAlso:["b",i=>{const o=i.getStyle("font-weight");return o&&(o=="bold"||Number(o)>=600)?{name:!0,styles:["font-weight"]}:null}]}),t.commands.add(p,new d(t,p)),t.keystrokes.set("CTRL+B",p),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Bold text"),keystroke:"CTRL+B"}]})}}function g({editor:s,commandName:t,plugin:e,icon:i,label:o,keystroke:c}){return m=>{const I=s.commands.get(t),n=new m(s.locale);return n.set({label:o,icon:i,keystroke:c,isToggleable:!0}),n.bind("isEnabled").to(I,"isEnabled"),n.bind("isOn").to(I,"value"),n instanceof a?n.set({role:"menuitemcheckbox"}):n.set({tooltip:!0}),e.listenTo(n,"execute",()=>{s.execute(t),s.editing.view.focus()}),n}}const E="bold";class V extends r{static get pluginName(){return"BoldUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=g({editor:t,commandName:E,plugin:this,icon:R,label:e("Bold"),keystroke:"CTRL+B"});t.ui.componentFactory.add(E,()=>i(l)),t.ui.componentFactory.add("menuBar:"+E,()=>i(a))}}class ct extends r{static get requires(){return[D,V]}static get pluginName(){return"Bold"}static get isOfficialPlugin(){return!0}}const u="code",_="ck-code_selected";class M extends r{static get pluginName(){return"CodeEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[N]}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:u}),t.model.schema.setAttributeProperties(u,{isFormatting:!0,copyOnEnter:!1}),t.conversion.attributeToElement({model:u,view:"code"}),t.commands.add(u,new d(t,u)),t.plugins.get(N).registerAttribute(u),q(t,u,"code",_),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Move out of an inline code style"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}}const C="code";class G extends r{static get pluginName(){return"CodeUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=g({editor:t,commandName:C,plugin:this,icon:F,label:e("Code")});t.ui.componentFactory.add(C,()=>i(l)),t.ui.componentFactory.add("menuBar:"+C,()=>i(a))}}class at extends r{static get requires(){return[M,G]}static get pluginName(){return"Code"}static get isOfficialPlugin(){return!0}}const h="italic";class X extends r{static get pluginName(){return"ItalicEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:h}),t.model.schema.setAttributeProperties(h,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:h,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add(h,new d(t,h)),t.keystrokes.set("CTRL+I",h),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Italic text"),keystroke:"CTRL+I"}]})}}const A="italic";class W extends r{static get pluginName(){return"ItalicUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=g({editor:t,commandName:A,plugin:this,icon:v,keystroke:"CTRL+I",label:e("Italic")});t.ui.componentFactory.add(A,()=>i(l)),t.ui.componentFactory.add("menuBar:"+A,()=>i(a))}}class ut extends r{static get requires(){return[X,W]}static get pluginName(){return"Italic"}static get isOfficialPlugin(){return!0}}const b="strikethrough";class j extends r{static get pluginName(){return"StrikethroughEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:b}),t.model.schema.setAttributeProperties(b,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:b,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),t.commands.add(b,new d(t,b)),t.keystrokes.set("CTRL+SHIFT+X","strikethrough"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Strikethrough text"),keystroke:"CTRL+SHIFT+X"}]})}}const B="strikethrough";class z extends r{static get pluginName(){return"StrikethroughUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=g({editor:t,commandName:B,plugin:this,icon:L,keystroke:"CTRL+SHIFT+X",label:e("Strikethrough")});t.ui.componentFactory.add(B,()=>i(l)),t.ui.componentFactory.add("menuBar:"+B,()=>i(a))}}class lt extends r{static get requires(){return[j,z]}static get pluginName(){return"Strikethrough"}static get isOfficialPlugin(){return!0}}const f="subscript";class J extends r{static get pluginName(){return"SubscriptEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:f}),t.model.schema.setAttributeProperties(f,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:f,view:"sub",upcastAlso:[{styles:{"vertical-align":"sub"}}]}),t.commands.add(f,new d(t,f))}}const O="subscript";class Q extends r{static get pluginName(){return"SubscriptUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=g({editor:t,commandName:O,plugin:this,icon:K,label:e("Subscript")});t.ui.componentFactory.add(O,()=>i(l)),t.ui.componentFactory.add("menuBar:"+O,()=>i(a))}}class dt extends r{static get requires(){return[J,Q]}static get pluginName(){return"Subscript"}static get isOfficialPlugin(){return!0}}const y="superscript";class Y extends r{static get pluginName(){return"SuperscriptEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:y}),t.model.schema.setAttributeProperties(y,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:y,view:"sup",upcastAlso:[{styles:{"vertical-align":"super"}}]}),t.commands.add(y,new d(t,y))}}const T="superscript";class Z extends r{static get pluginName(){return"SuperscriptUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=g({editor:t,commandName:T,plugin:this,icon:$,label:e("Superscript")});t.ui.componentFactory.add(T,()=>i(l)),t.ui.componentFactory.add("menuBar:"+T,()=>i(a))}}class gt extends r{static get requires(){return[Y,Z]}static get pluginName(){return"Superscript"}static get isOfficialPlugin(){return!0}}const k="underline";class tt extends r{static get pluginName(){return"UnderlineEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:k}),t.model.schema.setAttributeProperties(k,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:k,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),t.commands.add(k,new d(t,k)),t.keystrokes.set("CTRL+U","underline"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Underline text"),keystroke:"CTRL+U"}]})}}const P="underline";class et extends r{static get pluginName(){return"UnderlineUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=g({editor:t,commandName:P,plugin:this,icon:H,label:e("Underline"),keystroke:"CTRL+U"});t.ui.componentFactory.add(P,()=>i(l)),t.ui.componentFactory.add("menuBar:"+P,()=>i(a))}}class mt extends r{static get requires(){return[tt,et]}static get pluginName(){return"Underline"}static get isOfficialPlugin(){return!0}}export{d as AttributeCommand,ct as Bold,D as BoldEditing,V as BoldUI,at as Code,M as CodeEditing,G as CodeUI,ut as Italic,X as ItalicEditing,W as ItalicUI,lt as Strikethrough,j as StrikethroughEditing,z as StrikethroughUI,dt as Subscript,J as SubscriptEditing,Q as SubscriptUI,gt as Superscript,Y as SuperscriptEditing,Z as SuperscriptUI,mt as Underline,tt as UnderlineEditing,et as UnderlineUI,g as _getBasicStylesButtonCreator};
@@ -1 +1 @@
1
- import{Plugin as m,Command as b}from"../../../../../@ckeditor_ckeditor5-core@47.5.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Enter as Q}from"../../../../../@ckeditor_ckeditor5-enter@47.5.0/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import{Delete as g}from"../../../../../@ckeditor_ckeditor5-typing@47.5.0/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{first as f}from"../../../../../@ckeditor_ckeditor5-utils@47.5.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{IconQuote as B}from"../../../../../@ckeditor_ckeditor5-icons@47.5.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as v,MenuBarMenuListItemButtonView as E}from"../../../../../@ckeditor_ckeditor5-ui@47.5.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";class x extends b{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,o=t.schema,i=t.document.selection,n=Array.from(i.getSelectedBlocks()),s=e.forceValue===void 0?!this.value:e.forceValue;t.change(u=>{if(!s)this._removeQuote(u,n.filter(d));else{const r=n.filter(c=>d(c)||k(o,c));this._applyQuote(u,r)}})}_getValue(){const e=this.editor.model.document.selection,t=f(e.getSelectedBlocks());return!!(t&&d(t))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,o=f(e.getSelectedBlocks());return o?k(t,o):!1}_removeQuote(e,t){h(e,t).reverse().forEach(o=>{if(o.start.isAtStart&&o.end.isAtEnd){e.unwrap(o.start.parent);return}if(o.start.isAtStart){const n=e.createPositionBefore(o.start.parent);e.move(o,n);return}o.end.isAtEnd||e.split(o.end);const i=e.createPositionAfter(o.end.parent);e.move(o,i)})}_applyQuote(e,t){const o=[];h(e,t).reverse().forEach(i=>{let n=d(i.start);n||(n=e.createElement("blockQuote"),e.wrap(i,n)),o.push(n)}),o.reverse().reduce((i,n)=>i.nextSibling==n?(e.merge(e.createPositionAfter(i)),i):n)}}function d(l){return l.parent.name=="blockQuote"?l.parent:null}function h(l,e){let t,o=0;const i=[];for(;o<e.length;){const n=e[o],s=e[o+1];t||(t=l.createPositionBefore(n)),(!s||n.nextSibling!=s)&&(i.push(l.createRange(t,l.createPositionAfter(n))),t=null),o++}return i}function k(l,e){const t=l.checkChild(e.parent,"blockQuote"),o=l.checkChild(["$root","blockQuote"],e);return t&&o}class P extends m{static get pluginName(){return"BlockQuoteEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Q,g]}init(){const e=this.editor,t=e.model.schema;e.commands.add("blockQuote",new x(e)),t.register("blockQuote",{inheritAllFrom:"$container"}),e.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),e.model.document.registerPostFixer(s=>{const u=e.model.document.differ.getChanges();for(const r of u)if(r.type=="insert"){const c=r.position.nodeAfter;if(!c)continue;if(c.is("element","blockQuote")&&c.isEmpty)return s.remove(c),!0;if(c.is("element","blockQuote")&&!t.checkChild(r.position,c))return s.unwrap(c),!0;if(c.is("element")){const p=s.createRangeIn(c);for(const a of p.getItems())if(a.is("element","blockQuote")&&!t.checkChild(s.createPositionBefore(a),a))return s.unwrap(a),!0}}else if(r.type=="remove"){const c=r.position.parent;if(c.is("element","blockQuote")&&c.isEmpty)return s.remove(c),!0}return!1});const o=this.editor.editing.view.document,i=e.model.document.selection,n=e.commands.get("blockQuote");this.listenTo(o,"enter",(s,u)=>{if(!i.isCollapsed||!n.value)return;i.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),u.preventDefault(),s.stop())},{context:"blockquote"}),this.listenTo(o,"delete",(s,u)=>{if(u.direction!="backward"||!i.isCollapsed||!n.value)return;const r=i.getLastPosition().parent;r.isEmpty&&!r.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),u.preventDefault(),s.stop())},{context:"blockquote"})}}class A extends m{static get pluginName(){return"BlockQuoteUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("blockQuote",()=>{const t=this._createButton(v);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:blockQuote",()=>{const t=this._createButton(E);return t.set({role:"menuitemcheckbox"}),t})}_createButton(e){const t=this.editor,o=t.locale,i=t.commands.get("blockQuote"),n=new e(t.locale),s=o.t;return n.set({label:s("Block quote"),icon:B,isToggleable:!0}),n.bind("isEnabled").to(i,"isEnabled"),n.bind("isOn").to(i,"value"),this.listenTo(n,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),n}}class V extends m{static get requires(){return[P,A]}static get pluginName(){return"BlockQuote"}static get isOfficialPlugin(){return!0}}export{V as BlockQuote,x as BlockQuoteCommand,P as BlockQuoteEditing,A as BlockQuoteUI};
1
+ import{Plugin as m,Command as b}from"../../../../../@ckeditor_ckeditor5-core@47.6.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Enter as Q}from"../../../../../@ckeditor_ckeditor5-enter@47.6.0/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import{Delete as g}from"../../../../../@ckeditor_ckeditor5-typing@47.6.0/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{first as f}from"../../../../../@ckeditor_ckeditor5-utils@47.6.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{IconQuote as B}from"../../../../../@ckeditor_ckeditor5-icons@47.6.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as v,MenuBarMenuListItemButtonView as E}from"../../../../../@ckeditor_ckeditor5-ui@47.6.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";class x extends b{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,o=t.schema,i=t.document.selection,n=Array.from(i.getSelectedBlocks()),s=e.forceValue===void 0?!this.value:e.forceValue;t.change(u=>{if(!s)this._removeQuote(u,n.filter(d));else{const r=n.filter(c=>d(c)||k(o,c));this._applyQuote(u,r)}})}_getValue(){const e=this.editor.model.document.selection,t=f(e.getSelectedBlocks());return!!(t&&d(t))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,o=f(e.getSelectedBlocks());return o?k(t,o):!1}_removeQuote(e,t){h(e,t).reverse().forEach(o=>{if(o.start.isAtStart&&o.end.isAtEnd){e.unwrap(o.start.parent);return}if(o.start.isAtStart){const n=e.createPositionBefore(o.start.parent);e.move(o,n);return}o.end.isAtEnd||e.split(o.end);const i=e.createPositionAfter(o.end.parent);e.move(o,i)})}_applyQuote(e,t){const o=[];h(e,t).reverse().forEach(i=>{let n=d(i.start);n||(n=e.createElement("blockQuote"),e.wrap(i,n)),o.push(n)}),o.reverse().reduce((i,n)=>i.nextSibling==n?(e.merge(e.createPositionAfter(i)),i):n)}}function d(l){return l.parent.name=="blockQuote"?l.parent:null}function h(l,e){let t,o=0;const i=[];for(;o<e.length;){const n=e[o],s=e[o+1];t||(t=l.createPositionBefore(n)),(!s||n.nextSibling!=s)&&(i.push(l.createRange(t,l.createPositionAfter(n))),t=null),o++}return i}function k(l,e){const t=l.checkChild(e.parent,"blockQuote"),o=l.checkChild(["$root","blockQuote"],e);return t&&o}class P extends m{static get pluginName(){return"BlockQuoteEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Q,g]}init(){const e=this.editor,t=e.model.schema;e.commands.add("blockQuote",new x(e)),t.register("blockQuote",{inheritAllFrom:"$container"}),e.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),e.model.document.registerPostFixer(s=>{const u=e.model.document.differ.getChanges();for(const r of u)if(r.type=="insert"){const c=r.position.nodeAfter;if(!c)continue;if(c.is("element","blockQuote")&&c.isEmpty)return s.remove(c),!0;if(c.is("element","blockQuote")&&!t.checkChild(r.position,c))return s.unwrap(c),!0;if(c.is("element")){const p=s.createRangeIn(c);for(const a of p.getItems())if(a.is("element","blockQuote")&&!t.checkChild(s.createPositionBefore(a),a))return s.unwrap(a),!0}}else if(r.type=="remove"){const c=r.position.parent;if(c.is("element","blockQuote")&&c.isEmpty)return s.remove(c),!0}return!1});const o=this.editor.editing.view.document,i=e.model.document.selection,n=e.commands.get("blockQuote");this.listenTo(o,"enter",(s,u)=>{if(!i.isCollapsed||!n.value)return;i.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),u.preventDefault(),s.stop())},{context:"blockquote"}),this.listenTo(o,"delete",(s,u)=>{if(u.direction!="backward"||!i.isCollapsed||!n.value)return;const r=i.getLastPosition().parent;r.isEmpty&&!r.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),u.preventDefault(),s.stop())},{context:"blockquote"})}}class A extends m{static get pluginName(){return"BlockQuoteUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("blockQuote",()=>{const t=this._createButton(v);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:blockQuote",()=>{const t=this._createButton(E);return t.set({role:"menuitemcheckbox"}),t})}_createButton(e){const t=this.editor,o=t.locale,i=t.commands.get("blockQuote"),n=new e(t.locale),s=o.t;return n.set({label:s("Block quote"),icon:B,isToggleable:!0}),n.bind("isEnabled").to(i,"isEnabled"),n.bind("isOn").to(i,"value"),this.listenTo(n,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),n}}class V extends m{static get requires(){return[P,A]}static get pluginName(){return"BlockQuote"}static get isOfficialPlugin(){return!0}}export{V as BlockQuote,x as BlockQuoteCommand,P as BlockQuoteEditing,A as BlockQuoteUI};
@@ -1,4 +1,4 @@
1
- import{Plugin as b}from"../../../../../@ckeditor_ckeditor5-core@47.5.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{EventInfo as z,uid as q,delay as j,DomEmitterMixin as A,env as f,global as h,createElement as I,Rect as _,getRangeFromMouseEvent as ee,ResizeObserver as te,toUnit as re}from"../../../../../@ckeditor_ckeditor5-utils@47.5.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{PointerObserver as ne,ModelLiveRange as T,DomEventObserver as ie,ViewDataTransfer as oe,ModelRange as se}from"../../../../../@ckeditor_ckeditor5-engine@47.5.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{Widget as ae,isWidget as k}from"../../../../../@ckeditor_ckeditor5-widget@47.5.0/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{View as le}from"../../../../../@ckeditor_ckeditor5-ui@47.5.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{mapValues as ce}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/mapValues.js";import{throttle as V}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/throttle.js";class v extends ie{domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"];constructor(e){super(e);const t=this.document;this.listenTo(t,"paste",r("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",r("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",r("dragging"),{priority:"low"});function r(i){return(s,o)=>{o.preventDefault();const n=o.dropRange?[o.dropRange]:null,a=new z(t,i);t.fire(a,{dataTransfer:o.dataTransfer,method:s.name,targetRanges:n,target:o.target,domEvent:o.domEvent}),a.stop.called&&o.stopPropagation()}}}onDomEvent(e){const t="clipboardData"in e?e.clipboardData:e.dataTransfer,r=e.type=="drop"||e.type=="paste",i={dataTransfer:new oe(t,{cacheFiles:r})};if(e.type=="drop"||e.type=="dragover"){const s=ee(e);i.dropRange=s&&this.view.domConverter.domRangeToView(s)}this.fire(e.type,e,i)}}function de(l){return l=l.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br>").replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/^\s/,"&nbsp;").replace(/\s$/,"&nbsp;").replace(/\s\s/g," &nbsp;"),(l.includes("</p><p>")||l.includes("<br>"))&&(l=`<p>${l}</p>`),l}function ge(l){return l.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,t)=>t.length==1?" ":t).replace(/<!--[\s\S]*?-->/g,"")}const B=["figcaption","li"],L=["ol","ul"];function H(l,e){if(e.is("$text")||e.is("$textProxy"))return e.data;if(e.is("element","img")&&e.hasAttribute("alt"))return e.getAttribute("alt");if(e.is("element","br"))return`
1
+ import{Plugin as b}from"../../../../../@ckeditor_ckeditor5-core@47.6.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{EventInfo as z,uid as q,delay as j,DomEmitterMixin as A,env as f,global as h,createElement as I,Rect as _,getRangeFromMouseEvent as ee,ResizeObserver as te,toUnit as re}from"../../../../../@ckeditor_ckeditor5-utils@47.6.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{PointerObserver as ne,ModelLiveRange as T,DomEventObserver as ie,ViewDataTransfer as oe,ModelRange as se}from"../../../../../@ckeditor_ckeditor5-engine@47.6.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{Widget as ae,isWidget as k}from"../../../../../@ckeditor_ckeditor5-widget@47.6.0/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{View as le}from"../../../../../@ckeditor_ckeditor5-ui@47.6.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{mapValues as ce}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/mapValues.js";import{throttle as V}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/throttle.js";class v extends ie{domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"];constructor(e){super(e);const t=this.document;this.listenTo(t,"paste",r("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",r("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",r("dragging"),{priority:"low"});function r(i){return(s,o)=>{o.preventDefault();const n=o.dropRange?[o.dropRange]:null,a=new z(t,i);t.fire(a,{dataTransfer:o.dataTransfer,method:s.name,targetRanges:n,target:o.target,domEvent:o.domEvent}),a.stop.called&&o.stopPropagation()}}}onDomEvent(e){const t="clipboardData"in e?e.clipboardData:e.dataTransfer,r=e.type=="drop"||e.type=="paste",i={dataTransfer:new oe(t,{cacheFiles:r})};if(e.type=="drop"||e.type=="dragover"){const s=ee(e);i.dropRange=s&&this.view.domConverter.domRangeToView(s)}this.fire(e.type,e,i)}}function de(l){return l=l.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br>").replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/^\s/,"&nbsp;").replace(/\s$/,"&nbsp;").replace(/\s\s/g," &nbsp;"),(l.includes("</p><p>")||l.includes("<br>"))&&(l=`<p>${l}</p>`),l}function ge(l){return l.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,t)=>t.length==1?" ":t).replace(/<!--[\s\S]*?-->/g,"")}const B=["figcaption","li"],L=["ol","ul"];function H(l,e){if(e.is("$text")||e.is("$textProxy"))return e.data;if(e.is("element","img")&&e.hasAttribute("alt"))return e.getAttribute("alt");if(e.is("element","br"))return`
2
2
  `;let t="",r=null;for(const i of e.getChildren())t+=pe(i,r)+H(l,i),r=i;if(e.is("rawElement")){const s=document.implementation.createHTMLDocument("").createElement("div");e.render(s,l),t+=K(s)}return t}function K(l){let e="";if(l.nodeType===Node.TEXT_NODE)return l.textContent;if(l.tagName==="BR")return`
3
3
  `;for(const t of l.childNodes)e+=K(t);return e}function pe(l,e){return e?l.is("element","li")&&!l.isEmpty&&l.getChild(0).is("containerElement")||L.includes(l.name)&&L.includes(e.name)?`
4
4
 
@@ -1 +1 @@
1
- import{ContextPlugin as f}from"../../../../../@ckeditor_ckeditor5-core@47.5.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{CKEditorError as i,ObservableMixin as p,logWarning as g,EmitterMixin as _}from"../../../../../@ckeditor_ckeditor5-utils@47.5.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";const T={autoRefresh:!0},d=36e5,k=5e3;class l extends p(){_refresh;_options;_tokenRefreshTimeout;_isDestroyed=!1;constructor(e,t={}){if(super(),!e)throw new i("token-missing-token-url",this);t.initValue&&this._validateTokenValue(t.initValue),this.set("value",t.initValue),typeof e=="function"?this._refresh=e:this._refresh=()=>w(e),this._options={...T,...t}}init(){return new Promise((e,t)=>{if(!this.value){this.refreshToken().then(e).catch(t);return}this._options.autoRefresh&&this._registerRefreshTokenTimeout(),e(this)})}refreshToken(){const e=this._options.autoRefresh;return this._refresh().then(t=>(this._validateTokenValue(t),this.set("value",t),e&&this._registerRefreshTokenTimeout(),this)).catch(t=>{throw g("token-refresh-failed",{autoRefresh:e}),e&&this._registerRefreshTokenTimeout(k),t})}destroy(){this._isDestroyed=!0,clearTimeout(this._tokenRefreshTimeout)}_validateTokenValue(e){const t=typeof e=="string",r=!/^".*"$/.test(e),s=t&&e.split(".").length===3;if(!(r&&s))throw new i("token-not-in-jwt-format",this)}_registerRefreshTokenTimeout(e){if(clearTimeout(this._tokenRefreshTimeout),this._isDestroyed)return;const t=e||this._getTokenRefreshTimeoutTime();this._tokenRefreshTimeout=setTimeout(()=>{this.refreshToken()},t)}_getTokenRefreshTimeoutTime(){try{const[,e]=this.value.split("."),{exp:t}=JSON.parse(atob(e));return t?(t>2147483647&&console.warn("Token expiration time exceeds 32-bit integer range. This might cause unpredictable token refresh timing. Token expiration time should always be provided in seconds.",{tokenExpireTime:t}),Math.floor((t*1e3-Date.now())/2)):d}catch{return d}}static create(e,t={}){return new l(e,t).init()}}function w(n){return new Promise((e,t)=>{const r=new XMLHttpRequest;r.open("GET",n),r.addEventListener("load",()=>{const s=r.status,o=r.response;return s<200||s>299?t(new i("token-cannot-download-new-token",null)):e(o)}),r.addEventListener("error",()=>t(new Error("Network Error"))),r.addEventListener("abort",()=>t(new Error("Abort"))),r.send()})}const h=/^data:(\S*?);base64,/;class m extends _(){file;xhr;_token;_apiAddress;constructor(e,t,r){if(super(),!e)throw new i("fileuploader-missing-file",null);if(!t)throw new i("fileuploader-missing-token",null);if(!r)throw new i("fileuploader-missing-api-address",null);this.file=R(e)?E(e):e,this._token=t,this._apiAddress=r}onProgress(e){return this.on("progress",(t,r)=>e(r)),this}onError(e){return this.once("error",(t,r)=>e(r)),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){const e=new XMLHttpRequest;e.open("POST",this._apiAddress),e.setRequestHeader("Authorization",this._token.value),e.responseType="json",this.xhr=e}_attachXHRListeners(){const e=this.xhr,t=r=>()=>this.fire("error",r);e.addEventListener("error",t("Network Error")),e.addEventListener("abort",t("Abort"));e.upload&&e.upload.addEventListener("progress",r=>{r.lengthComputable&&this.fire("progress",{total:r.total,uploaded:r.loaded})}),e.addEventListener("load",()=>{const r=e.status,s=e.response;if(r<200||r>299)return this.fire("error",s.message||s.error)})}_sendRequest(){const e=new FormData,t=this.xhr;return e.append("file",this.file),new Promise((r,s)=>{t.addEventListener("load",()=>{const o=t.status,a=t.response;return o<200||o>299?a.message?s(new i("fileuploader-uploading-data-failed",this,{message:a.message})):s(a.error):r(a)}),t.addEventListener("error",()=>s(new Error("Network Error"))),t.addEventListener("abort",()=>s(new Error("Abort"))),t.send(e)})}}function E(n,e=512){try{const t=n.match(h)[1],r=atob(n.replace(h,"")),s=[];for(let o=0;o<r.length;o+=e){const a=r.slice(o,o+e),c=new Array(a.length);for(let u=0;u<a.length;u++)c[u]=a.charCodeAt(u);s.push(new Uint8Array(c))}return new Blob(s,{type:t})}catch{throw new i("fileuploader-decoding-image-data-error",null)}}function R(n){return typeof n!="string"?!1:!!n.match(h)?.length}class v{_token;_apiAddress;constructor(e,t){if(!e)throw new i("uploadgateway-missing-token",null);if(!t)throw new i("uploadgateway-missing-api-address",null);this._token=e,this._apiAddress=t}upload(e){return new m(e,this._token,this._apiAddress)}}class y extends f{static get pluginName(){return"CloudServicesCore"}static get isOfficialPlugin(){return!0}createToken(e,t){return new l(e,t)}createUploadGateway(e,t){return new v(e,t)}}class C extends f{tokenUrl;uploadUrl;webSocketUrl;bundleVersion;autoRefresh=!0;token=null;_tokens=new Map;static get pluginName(){return"CloudServices"}static get isOfficialPlugin(){return!0}static get requires(){return[y]}async init(){const t=this.context.config.get("cloudServices")||{};for(const[o,a]of Object.entries(t))this[o]=a;if(!this.tokenUrl){this.token=null;return}const s=this.context.plugins.get("CloudServicesCore").createToken(this.tokenUrl,{autoRefresh:this.autoRefresh});try{this.token=await s.init(),this._tokens.set(this.tokenUrl,this.token)}catch(o){throw s.destroy(),o}}async registerTokenUrl(e){if(this._tokens.has(e))return this.getTokenFor(e);const r=await this.context.plugins.get("CloudServicesCore").createToken(e,{autoRefresh:this.autoRefresh}).init();return this._tokens.set(e,r),r}getTokenFor(e){const t=this._tokens.get(e);if(!t)throw new i("cloudservices-token-not-registered",this);return t}destroy(){super.destroy();for(const e of this._tokens.values())e.destroy()}}export{C as CloudServices,y as CloudServicesCore,l as Token};
1
+ import{ContextPlugin as f}from"../../../../../@ckeditor_ckeditor5-core@47.6.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{CKEditorError as i,ObservableMixin as p,logWarning as g,EmitterMixin as _}from"../../../../../@ckeditor_ckeditor5-utils@47.6.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";const T={autoRefresh:!0},d=36e5,k=5e3;class l extends p(){_refresh;_options;_tokenRefreshTimeout;_isDestroyed=!1;constructor(e,t={}){if(super(),!e)throw new i("token-missing-token-url",this);t.initValue&&this._validateTokenValue(t.initValue),this.set("value",t.initValue),typeof e=="function"?this._refresh=e:this._refresh=()=>w(e),this._options={...T,...t}}init(){return new Promise((e,t)=>{if(!this.value){this.refreshToken().then(e).catch(t);return}this._options.autoRefresh&&this._registerRefreshTokenTimeout(),e(this)})}refreshToken(){const e=this._options.autoRefresh;return this._refresh().then(t=>(this._validateTokenValue(t),this.set("value",t),e&&this._registerRefreshTokenTimeout(),this)).catch(t=>{throw g("token-refresh-failed",{autoRefresh:e}),e&&this._registerRefreshTokenTimeout(k),t})}destroy(){this._isDestroyed=!0,clearTimeout(this._tokenRefreshTimeout)}_validateTokenValue(e){const t=typeof e=="string",r=!/^".*"$/.test(e),s=t&&e.split(".").length===3;if(!(r&&s))throw new i("token-not-in-jwt-format",this)}_registerRefreshTokenTimeout(e){if(clearTimeout(this._tokenRefreshTimeout),this._isDestroyed)return;const t=e||this._getTokenRefreshTimeoutTime();this._tokenRefreshTimeout=setTimeout(()=>{this.refreshToken()},t)}_getTokenRefreshTimeoutTime(){try{const[,e]=this.value.split("."),{exp:t}=JSON.parse(atob(e));return t?(t>2147483647&&console.warn("Token expiration time exceeds 32-bit integer range. This might cause unpredictable token refresh timing. Token expiration time should always be provided in seconds.",{tokenExpireTime:t}),Math.floor((t*1e3-Date.now())/2)):d}catch{return d}}static create(e,t={}){return new l(e,t).init()}}function w(n){return new Promise((e,t)=>{const r=new XMLHttpRequest;r.open("GET",n),r.addEventListener("load",()=>{const s=r.status,o=r.response;return s<200||s>299?t(new i("token-cannot-download-new-token",null)):e(o)}),r.addEventListener("error",()=>t(new Error("Network Error"))),r.addEventListener("abort",()=>t(new Error("Abort"))),r.send()})}const h=/^data:(\S*?);base64,/;class m extends _(){file;xhr;_token;_apiAddress;constructor(e,t,r){if(super(),!e)throw new i("fileuploader-missing-file",null);if(!t)throw new i("fileuploader-missing-token",null);if(!r)throw new i("fileuploader-missing-api-address",null);this.file=R(e)?E(e):e,this._token=t,this._apiAddress=r}onProgress(e){return this.on("progress",(t,r)=>e(r)),this}onError(e){return this.once("error",(t,r)=>e(r)),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){const e=new XMLHttpRequest;e.open("POST",this._apiAddress),e.setRequestHeader("Authorization",this._token.value),e.responseType="json",this.xhr=e}_attachXHRListeners(){const e=this.xhr,t=r=>()=>this.fire("error",r);e.addEventListener("error",t("Network Error")),e.addEventListener("abort",t("Abort"));e.upload&&e.upload.addEventListener("progress",r=>{r.lengthComputable&&this.fire("progress",{total:r.total,uploaded:r.loaded})}),e.addEventListener("load",()=>{const r=e.status,s=e.response;if(r<200||r>299)return this.fire("error",s.message||s.error)})}_sendRequest(){const e=new FormData,t=this.xhr;return e.append("file",this.file),new Promise((r,s)=>{t.addEventListener("load",()=>{const o=t.status,a=t.response;return o<200||o>299?a.message?s(new i("fileuploader-uploading-data-failed",this,{message:a.message})):s(a.error):r(a)}),t.addEventListener("error",()=>s(new Error("Network Error"))),t.addEventListener("abort",()=>s(new Error("Abort"))),t.send(e)})}}function E(n,e=512){try{const t=n.match(h)[1],r=atob(n.replace(h,"")),s=[];for(let o=0;o<r.length;o+=e){const a=r.slice(o,o+e),c=new Array(a.length);for(let u=0;u<a.length;u++)c[u]=a.charCodeAt(u);s.push(new Uint8Array(c))}return new Blob(s,{type:t})}catch{throw new i("fileuploader-decoding-image-data-error",null)}}function R(n){return typeof n!="string"?!1:!!n.match(h)?.length}class v{_token;_apiAddress;constructor(e,t){if(!e)throw new i("uploadgateway-missing-token",null);if(!t)throw new i("uploadgateway-missing-api-address",null);this._token=e,this._apiAddress=t}upload(e){return new m(e,this._token,this._apiAddress)}}class y extends f{static get pluginName(){return"CloudServicesCore"}static get isOfficialPlugin(){return!0}createToken(e,t){return new l(e,t)}createUploadGateway(e,t){return new v(e,t)}}class C extends f{tokenUrl;uploadUrl;webSocketUrl;bundleVersion;autoRefresh=!0;token=null;_tokens=new Map;static get pluginName(){return"CloudServices"}static get isOfficialPlugin(){return!0}static get requires(){return[y]}async init(){const t=this.context.config.get("cloudServices")||{};for(const[o,a]of Object.entries(t))this[o]=a;if(!this.tokenUrl){this.token=null;return}const s=this.context.plugins.get("CloudServicesCore").createToken(this.tokenUrl,{autoRefresh:this.autoRefresh});try{this.token=await s.init(),this._tokens.set(this.tokenUrl,this.token)}catch(o){throw s.destroy(),o}}async registerTokenUrl(e){if(this._tokens.has(e))return this.getTokenFor(e);const r=await this.context.plugins.get("CloudServicesCore").createToken(e,{autoRefresh:this.autoRefresh}).init();return this._tokens.set(e,r),r}getTokenFor(e){const t=this._tokens.get(e);if(!t)throw new i("cloudservices-token-not-registered",this);return t}destroy(){super.destroy();for(const e of this._tokens.values())e.destroy()}}export{C as CloudServices,y as CloudServicesCore,l as Token};
@@ -1,4 +1,4 @@
1
- import{Plugin as v,Command as S}from"../../../../../@ckeditor_ckeditor5-core@47.5.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{ShiftEnter as y}from"../../../../../@ckeditor_ckeditor5-enter@47.5.0/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import{UpcastWriter as O}from"../../../../../@ckeditor_ckeditor5-engine@47.5.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{ClipboardPipeline as N}from"../../../../../@ckeditor_ckeditor5-clipboard@47.5.0/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{Collection as M,first as b}from"../../../../../@ckeditor_ckeditor5-utils@47.5.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.5.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconCodeBlock as L}from"../../../../../@ckeditor_ckeditor5-icons@47.5.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.6.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{ShiftEnter as y}from"../../../../../@ckeditor_ckeditor5-enter@47.6.0/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import{UpcastWriter as O}from"../../../../../@ckeditor_ckeditor5-engine@47.6.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{ClipboardPipeline as N}from"../../../../../@ckeditor_ckeditor5-clipboard@47.6.0/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{Collection as M,first as b}from"../../../../../@ckeditor_ckeditor5-utils@47.6.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.6.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconCodeBlock as L}from"../../../../../@ckeditor_ckeditor5-icons@47.6.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};
@@ -1 +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.5.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.5.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{EditorWatchdog as re,ContextWatchdog as ae}from"../../../../../@ckeditor_ckeditor5-watchdog@47.5.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
+ import{ObservableMixin as S,Collection as W,CKEditorError as c,insertToPriorityArray as V,setDataInElement as K,Config as z,decodeLicenseKey as U,toArray as $,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.6.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.6.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{EditorWatchdog as re,ContextWatchdog as ae}from"../../../../../@ckeditor_ckeditor5-watchdog@47.6.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={}){V(this._childCommandsDefinitions,{command:e,priority:t.priority||"normal"}),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const e=this._childCommandsDefinitions.find(({command:t})=>t.isEnabled);return e&&e.command}}class 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 H 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)),d=[...P(g)];x(d,i);const b=f(d);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||h(n)===o||h(o)===n)}function h(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:h(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:h(n),requiredBy:h(a)})}function L(n,a){if(a&&p(n,t))throw new c("plugincollection-required",u,{plugin:h(n),requiredBy:h(a)})}function f(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 H(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(d=>d!=="|"&&d!=="-")}function u(g){return g.flatMap(d=>typeof d=="string"?[d]:u(d.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,d=e.language||s.language;this._context=e.context||new G({language:d,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 H(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(h){let w=h.get("licenseKey");if(!w&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(w=window.CKEDITOR_GLOBAL_LICENSE_KEY,h.set("licenseKey",w)),!w)throw new c("license-key-missing")}function p(h){const w=h.config.get("licenseKey"),P=window[Symbol.for("cke distribution")]||"sh";function m(n,a){h.enableReadOnlyMode(Symbol("invalidLicense")),h._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 f=U(w);if(!f){m("invalid");return}if(!C(f)){m("invalid");return}if(f.distributionChannel&&!$(f.distributionChannel).includes(P)){m("distributionChannel");return}if(j(O(f))!=f.vc.toLowerCase()){m("invalid");return}if(new Date(f.exp*1e3)<Y){m("expired");return}const x=f.licensedHosts;if(x&&x.length>0&&!D(x)){m("domainLimit");return}if(["evaluation","trial"].includes(f.licenseType)&&f.exp*1e3<Date.now()){m("expired");return}if(["development","evaluation","trial"].includes(f.licenseType)){const{licenseType:n}=f;window.CKEDITOR_WARNING_SUPPRESSIONS=window.CKEDITOR_WARNING_SUPPRESSIONS||{},window.CKEDITOR_WARNING_SUPPRESSIONS[n]||(L(n),window.CKEDITOR_WARNING_SUPPRESSIONS[n]=!0)}if(f.licenseType==="evaluation"){const n=setTimeout(()=>{m("evaluationLimit")},6e5);h.on("destroy",()=>{clearTimeout(n)})}f.usageEndpoint&&h.once("ready",()=>{const n={requestId:R(),requestTime:Math.round(Date.now()/1e3),license:w,editor:ke(h)};h._sendUsageRequest(f.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:f.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(d=>(g(this),d));function g(d){const b=d.config.get("licenseKey");if(b==="GPL")return;const y=U(b);if(!y)return;const E=[...d.plugins].map(([p])=>p).find(p=>!p.pluginName||!p.licenseFeatureCode?!1:Q(y,p.licenseFeatureCode));E&&(d.enableReadOnlyMode(Symbol("invalidLicense")),d._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.5.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{enableViewPlaceholder as P}from"../../../../../@ckeditor_ckeditor5-engine@47.5.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.5.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{ElementApiMixin as C,attachToForm as B,Editor as E}from"../../../../../@ckeditor_ckeditor5-core@47.5.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.6.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{enableViewPlaceholder as P}from"../../../../../@ckeditor_ckeditor5-engine@47.6.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.6.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{ElementApiMixin as C,attachToForm as B,Editor as E}from"../../../../../@ckeditor_ckeditor5-core@47.6.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};