@ckeditor/ckeditor5-ui 31.0.0 → 33.0.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 (145) hide show
  1. package/LICENSE.md +2 -2
  2. package/lang/translations/ar.po +2 -2
  3. package/lang/translations/ast.po +1 -1
  4. package/lang/translations/az.po +1 -1
  5. package/lang/translations/cs.po +1 -1
  6. package/lang/translations/da.po +1 -1
  7. package/lang/translations/de-ch.po +1 -1
  8. package/lang/translations/de.po +1 -1
  9. package/lang/translations/el.po +23 -23
  10. package/lang/translations/en-au.po +1 -1
  11. package/lang/translations/en-gb.po +1 -1
  12. package/lang/translations/en.po +1 -1
  13. package/lang/translations/eo.po +1 -1
  14. package/lang/translations/es.po +1 -1
  15. package/lang/translations/et.po +1 -1
  16. package/lang/translations/eu.po +1 -1
  17. package/lang/translations/fa.po +1 -1
  18. package/lang/translations/fi.po +4 -4
  19. package/lang/translations/fr.po +1 -1
  20. package/lang/translations/gl.po +1 -1
  21. package/lang/translations/he.po +1 -1
  22. package/lang/translations/hi.po +1 -1
  23. package/lang/translations/hr.po +1 -1
  24. package/lang/translations/hu.po +1 -1
  25. package/lang/translations/id.po +1 -1
  26. package/lang/translations/it.po +1 -1
  27. package/lang/translations/ja.po +1 -1
  28. package/lang/translations/km.po +1 -1
  29. package/lang/translations/kn.po +1 -1
  30. package/lang/translations/ko.po +1 -1
  31. package/lang/translations/ku.po +1 -1
  32. package/lang/translations/lt.po +1 -1
  33. package/lang/translations/lv.po +1 -1
  34. package/lang/translations/nb.po +1 -1
  35. package/lang/translations/ne.po +1 -1
  36. package/lang/translations/nl.po +2 -2
  37. package/lang/translations/no.po +1 -1
  38. package/lang/translations/pl.po +1 -1
  39. package/lang/translations/pt-br.po +1 -1
  40. package/lang/translations/pt.po +1 -1
  41. package/lang/translations/ro.po +1 -1
  42. package/lang/translations/ru.po +1 -1
  43. package/lang/translations/sk.po +1 -1
  44. package/lang/translations/sl.po +1 -1
  45. package/lang/translations/sq.po +1 -1
  46. package/lang/translations/sr-latn.po +1 -1
  47. package/lang/translations/sr.po +1 -1
  48. package/lang/translations/sv.po +1 -1
  49. package/lang/translations/th.po +1 -1
  50. package/lang/translations/tk.po +1 -1
  51. package/lang/translations/tr.po +1 -1
  52. package/lang/translations/ug.po +2 -2
  53. package/lang/translations/uk.po +1 -1
  54. package/lang/translations/uz.po +105 -0
  55. package/lang/translations/vi.po +1 -1
  56. package/lang/translations/zh-cn.po +1 -1
  57. package/lang/translations/zh.po +1 -1
  58. package/package.json +20 -20
  59. package/src/bindings/clickoutsidehandler.js +1 -1
  60. package/src/bindings/injectcsstransitiondisabler.js +1 -1
  61. package/src/bindings/preventdefault.js +1 -1
  62. package/src/bindings/submithandler.js +1 -1
  63. package/src/button/button.jsdoc +1 -1
  64. package/src/button/buttonview.js +1 -1
  65. package/src/button/switchbuttonview.js +1 -1
  66. package/src/colorgrid/colorgridview.js +11 -1
  67. package/src/colorgrid/colortileview.js +1 -1
  68. package/src/colorgrid/utils.js +1 -1
  69. package/src/componentfactory.js +1 -1
  70. package/src/dropdown/button/dropdownbutton.jsdoc +1 -1
  71. package/src/dropdown/button/dropdownbuttonview.js +1 -1
  72. package/src/dropdown/button/splitbuttonview.js +11 -1
  73. package/src/dropdown/dropdownpanelfocusable.jsdoc +1 -1
  74. package/src/dropdown/dropdownpanelview.js +1 -1
  75. package/src/dropdown/dropdownview.js +1 -1
  76. package/src/dropdown/utils.js +1 -1
  77. package/src/editableui/editableuiview.js +1 -1
  78. package/src/editableui/inline/inlineeditableuiview.js +1 -1
  79. package/src/editorui/bodycollection.js +1 -1
  80. package/src/editorui/boxed/boxededitoruiview.js +1 -1
  81. package/src/editorui/editoruiview.js +1 -1
  82. package/src/focuscycler.js +19 -4
  83. package/src/formheader/formheaderview.js +1 -1
  84. package/src/icon/iconview.js +1 -1
  85. package/src/iframe/iframeview.js +1 -1
  86. package/src/index.js +3 -1
  87. package/src/input/inputview.js +216 -0
  88. package/src/inputnumber/inputnumberview.js +71 -0
  89. package/src/inputtext/inputtextview.js +7 -172
  90. package/src/label/labelview.js +1 -1
  91. package/src/labeledfield/labeledfieldview.js +1 -1
  92. package/src/labeledfield/utils.js +54 -5
  93. package/src/labeledinput/labeledinputview.js +1 -1
  94. package/src/list/listitemview.js +1 -1
  95. package/src/list/listseparatorview.js +1 -1
  96. package/src/list/listview.js +11 -1
  97. package/src/model.js +1 -1
  98. package/src/notification/notification.js +1 -1
  99. package/src/panel/balloon/balloonpanelview.js +289 -225
  100. package/src/panel/balloon/contextualballoon.js +21 -1
  101. package/src/panel/sticky/stickypanelview.js +1 -1
  102. package/src/template.js +1 -1
  103. package/src/toolbar/balloon/balloontoolbar.js +48 -35
  104. package/src/toolbar/block/blockbuttonview.js +1 -1
  105. package/src/toolbar/block/blocktoolbar.js +1 -1
  106. package/src/toolbar/enabletoolbarkeyboardfocus.js +1 -1
  107. package/src/toolbar/normalizetoolbarconfig.js +1 -1
  108. package/src/toolbar/toolbarlinebreakview.js +1 -1
  109. package/src/toolbar/toolbarseparatorview.js +1 -1
  110. package/src/toolbar/toolbarview.js +5 -2
  111. package/src/tooltip/tooltipview.js +1 -1
  112. package/src/view.js +1 -1
  113. package/src/viewcollection.js +1 -1
  114. package/theme/components/button/button.css +1 -1
  115. package/theme/components/button/switchbutton.css +1 -1
  116. package/theme/components/colorgrid/colorgrid.css +1 -1
  117. package/theme/components/dropdown/dropdown.css +1 -1
  118. package/theme/components/dropdown/listdropdown.css +1 -1
  119. package/theme/components/dropdown/splitbutton.css +1 -1
  120. package/theme/components/dropdown/toolbardropdown.css +1 -1
  121. package/theme/components/editorui/editorui.css +1 -1
  122. package/theme/components/formheader/formheader.css +1 -1
  123. package/theme/components/icon/icon.css +1 -1
  124. package/theme/components/{inputtext/inputtext.css → input/input.css} +1 -1
  125. package/theme/components/label/label.css +1 -1
  126. package/theme/components/labeledfield/labeledfieldview.css +1 -1
  127. package/theme/components/labeledinput/labeledinput.css +1 -1
  128. package/theme/components/list/list.css +1 -1
  129. package/theme/components/panel/balloonpanel.css +1 -1
  130. package/theme/components/panel/balloonrotator.css +1 -1
  131. package/theme/components/panel/fakepanel.css +1 -1
  132. package/theme/components/panel/stickypanel.css +1 -1
  133. package/theme/components/responsive-form/responsiveform.css +1 -1
  134. package/theme/components/toolbar/blocktoolbar.css +1 -1
  135. package/theme/components/toolbar/toolbar.css +1 -1
  136. package/theme/components/tooltip/mixins/_tooltip.css +1 -1
  137. package/theme/components/tooltip/tooltip.css +1 -1
  138. package/theme/globals/_hidden.css +1 -1
  139. package/theme/globals/_reset.css +1 -1
  140. package/theme/globals/_transition.css +1 -1
  141. package/theme/globals/_zindex.css +1 -1
  142. package/theme/globals/globals.css +1 -1
  143. package/theme/mixins/_dir.css +1 -1
  144. package/theme/mixins/_rwd.css +1 -1
  145. package/theme/mixins/_unselectable.css +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md.
4
4
  */
5
5
 
@@ -750,239 +750,303 @@ BalloonPanelView._getOptimalPosition = getOptimalPosition;
750
750
  *
751
751
  * Positioning functions must be compatible with {@link module:utils/dom/position~Position}.
752
752
  *
753
+ * Default positioning functions with customized offsets can be generated using
754
+ * {@link module:ui/panel/balloon/balloonpanelview~generatePositions}.
755
+ *
753
756
  * The name that the position function returns will be reflected in the balloon panel's class that
754
757
  * controls the placement of the "arrow". See {@link #position} to learn more.
755
758
  *
756
759
  * @member {Object.<String,module:utils/dom/position~positioningFunction>}
757
760
  * module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions
758
761
  */
759
- BalloonPanelView.defaultPositions = {
760
-
761
- // ------- North west
762
-
763
- northWestArrowSouthWest: ( targetRect, balloonRect ) => ( {
764
- top: getNorthTop( targetRect, balloonRect ),
765
- left: targetRect.left - BalloonPanelView.arrowHorizontalOffset,
766
- name: 'arrow_sw'
767
- } ),
768
-
769
- northWestArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
770
- top: getNorthTop( targetRect, balloonRect ),
771
- left: targetRect.left - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
772
- name: 'arrow_smw'
773
- } ),
774
-
775
- northWestArrowSouth: ( targetRect, balloonRect ) => ( {
776
- top: getNorthTop( targetRect, balloonRect ),
777
- left: targetRect.left - balloonRect.width / 2,
778
- name: 'arrow_s'
779
- } ),
780
-
781
- northWestArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
782
- top: getNorthTop( targetRect, balloonRect ),
783
- left: targetRect.left - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
784
- name: 'arrow_sme'
785
- } ),
786
-
787
- northWestArrowSouthEast: ( targetRect, balloonRect ) => ( {
788
- top: getNorthTop( targetRect, balloonRect ),
789
- left: targetRect.left - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
790
- name: 'arrow_se'
791
- } ),
792
-
793
- // ------- North
794
-
795
- northArrowSouthWest: ( targetRect, balloonRect ) => ( {
796
- top: getNorthTop( targetRect, balloonRect ),
797
- left: targetRect.left + targetRect.width / 2 - BalloonPanelView.arrowHorizontalOffset,
798
- name: 'arrow_sw'
799
- } ),
800
-
801
- northArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
802
- top: getNorthTop( targetRect, balloonRect ),
803
- left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
804
- name: 'arrow_smw'
805
- } ),
806
-
807
- northArrowSouth: ( targetRect, balloonRect ) => ( {
808
- top: getNorthTop( targetRect, balloonRect ),
809
- left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
810
- name: 'arrow_s'
811
- } ),
812
-
813
- northArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
814
- top: getNorthTop( targetRect, balloonRect ),
815
- left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
816
- name: 'arrow_sme'
817
- } ),
818
-
819
- northArrowSouthEast: ( targetRect, balloonRect ) => ( {
820
- top: getNorthTop( targetRect, balloonRect ),
821
- left: targetRect.left + targetRect.width / 2 - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
822
- name: 'arrow_se'
823
- } ),
824
-
825
- // ------- North east
826
-
827
- northEastArrowSouthWest: ( targetRect, balloonRect ) => ( {
828
- top: getNorthTop( targetRect, balloonRect ),
829
- left: targetRect.right - BalloonPanelView.arrowHorizontalOffset,
830
- name: 'arrow_sw'
831
- } ),
832
-
833
- northEastArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
834
- top: getNorthTop( targetRect, balloonRect ),
835
- left: targetRect.right - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
836
- name: 'arrow_smw'
837
- } ),
838
-
839
- northEastArrowSouth: ( targetRect, balloonRect ) => ( {
840
- top: getNorthTop( targetRect, balloonRect ),
841
- left: targetRect.right - balloonRect.width / 2,
842
- name: 'arrow_s'
843
- } ),
844
-
845
- northEastArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
846
- top: getNorthTop( targetRect, balloonRect ),
847
- left: targetRect.right - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
848
- name: 'arrow_sme'
849
- } ),
850
-
851
- northEastArrowSouthEast: ( targetRect, balloonRect ) => ( {
852
- top: getNorthTop( targetRect, balloonRect ),
853
- left: targetRect.right - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
854
- name: 'arrow_se'
855
- } ),
856
-
857
- // ------- South west
858
-
859
- southWestArrowNorthWest: ( targetRect, balloonRect ) => ( {
860
- top: getSouthTop( targetRect, balloonRect ),
861
- left: targetRect.left - BalloonPanelView.arrowHorizontalOffset,
862
- name: 'arrow_nw'
863
- } ),
864
-
865
- southWestArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
866
- top: getSouthTop( targetRect, balloonRect ),
867
- left: targetRect.left - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
868
- name: 'arrow_nmw'
869
- } ),
870
-
871
- southWestArrowNorth: ( targetRect, balloonRect ) => ( {
872
- top: getSouthTop( targetRect, balloonRect ),
873
- left: targetRect.left - balloonRect.width / 2,
874
- name: 'arrow_n'
875
- } ),
876
-
877
- southWestArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
878
- top: getSouthTop( targetRect, balloonRect ),
879
- left: targetRect.left - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
880
- name: 'arrow_nme'
881
- } ),
882
-
883
- southWestArrowNorthEast: ( targetRect, balloonRect ) => ( {
884
- top: getSouthTop( targetRect, balloonRect ),
885
- left: targetRect.left - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
886
- name: 'arrow_ne'
887
- } ),
888
-
889
- // ------- South
890
-
891
- southArrowNorthWest: ( targetRect, balloonRect ) => ( {
892
- top: getSouthTop( targetRect, balloonRect ),
893
- left: targetRect.left + targetRect.width / 2 - BalloonPanelView.arrowHorizontalOffset,
894
- name: 'arrow_nw'
895
- } ),
896
- southArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
897
- top: getSouthTop( targetRect, balloonRect ),
898
- left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * 0.25 ) - BalloonPanelView.arrowHorizontalOffset,
899
- name: 'arrow_nmw'
900
- } ),
901
-
902
- southArrowNorth: ( targetRect, balloonRect ) => ( {
903
- top: getSouthTop( targetRect, balloonRect ),
904
- left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
905
- name: 'arrow_n'
906
- } ),
907
-
908
- southArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
909
- top: getSouthTop( targetRect, balloonRect ),
910
- left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * 0.75 ) + BalloonPanelView.arrowHorizontalOffset,
911
- name: 'arrow_nme'
912
- } ),
913
-
914
- southArrowNorthEast: ( targetRect, balloonRect ) => ( {
915
- top: getSouthTop( targetRect, balloonRect ),
916
- left: targetRect.left + targetRect.width / 2 - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
917
- name: 'arrow_ne'
918
- } ),
919
-
920
- // ------- South east
921
-
922
- southEastArrowNorthWest: ( targetRect, balloonRect ) => ( {
923
- top: getSouthTop( targetRect, balloonRect ),
924
- left: targetRect.right - BalloonPanelView.arrowHorizontalOffset,
925
- name: 'arrow_nw'
926
- } ),
927
-
928
- southEastArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
929
- top: getSouthTop( targetRect, balloonRect ),
930
- left: targetRect.right - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
931
- name: 'arrow_nmw'
932
- } ),
933
-
934
- southEastArrowNorth: ( targetRect, balloonRect ) => ( {
935
- top: getSouthTop( targetRect, balloonRect ),
936
- left: targetRect.right - balloonRect.width / 2,
937
- name: 'arrow_n'
938
- } ),
939
-
940
- southEastArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
941
- top: getSouthTop( targetRect, balloonRect ),
942
- left: targetRect.right - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
943
- name: 'arrow_nme'
944
- } ),
945
-
946
- southEastArrowNorthEast: ( targetRect, balloonRect ) => ( {
947
- top: getSouthTop( targetRect, balloonRect ),
948
- left: targetRect.right - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
949
- name: 'arrow_ne'
950
- } ),
951
-
952
- // ------- Sticky
953
-
954
- viewportStickyNorth: ( targetRect, balloonRect, viewportRect ) => {
955
- if ( !targetRect.getIntersection( viewportRect ) ) {
956
- return null;
957
- }
762
+ BalloonPanelView.defaultPositions = generatePositions();
958
763
 
959
- return {
960
- top: viewportRect.top + BalloonPanelView.stickyVerticalOffset,
764
+ /**
765
+ * Returns available {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
766
+ * {@link module:utils/dom/position~positioningFunction positioning functions} adjusted by the specific offsets.
767
+ *
768
+ * @protected
769
+ * @param {Object} [options] Options to generate positions. If not specified, this helper will simply return
770
+ * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
771
+ * @param {Number} [options.horizontalOffset] A custom horizontal offset (in pixels) of each position. If
772
+ * not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowHorizontalOffset the default value}
773
+ * will be used.
774
+ * @param {Number} [options.verticalOffset] A custom vertical offset (in pixels) of each position. If
775
+ * not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowVerticalOffset the default value}
776
+ * will be used.
777
+ * @param {Number} [options.stickyVerticalOffset] A custom offset (in pixels) of the `viewportStickyNorth` positioning function.
778
+ * If not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.stickyVerticalOffset the default value}
779
+ * will be used.
780
+ * @param {Object} [options.config] Additional configuration of the balloon balloon panel view.
781
+ * Currently only {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#withArrow} is supported. Learn more
782
+ * about {@link module:utils/dom/position~positioningFunction positioning functions}.
783
+ * @returns {Object.<String,module:utils/dom/position~positioningFunction>}
784
+ */
785
+ export function generatePositions( {
786
+ horizontalOffset = BalloonPanelView.arrowHorizontalOffset,
787
+ verticalOffset = BalloonPanelView.arrowVerticalOffset,
788
+ stickyVerticalOffset = BalloonPanelView.stickyVerticalOffset,
789
+ config
790
+ } = {} ) {
791
+ return {
792
+ // ------- North west
793
+
794
+ northWestArrowSouthWest: ( targetRect, balloonRect ) => ( {
795
+ top: getNorthTop( targetRect, balloonRect ),
796
+ left: targetRect.left - horizontalOffset,
797
+ name: 'arrow_sw',
798
+ ...( config && { config } )
799
+ } ),
800
+
801
+ northWestArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
802
+ top: getNorthTop( targetRect, balloonRect ),
803
+ left: targetRect.left - ( balloonRect.width * .25 ) - horizontalOffset,
804
+ name: 'arrow_smw',
805
+ ...( config && { config } )
806
+ } ),
807
+
808
+ northWestArrowSouth: ( targetRect, balloonRect ) => ( {
809
+ top: getNorthTop( targetRect, balloonRect ),
810
+ left: targetRect.left - balloonRect.width / 2,
811
+ name: 'arrow_s',
812
+ ...( config && { config } )
813
+ } ),
814
+
815
+ northWestArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
816
+ top: getNorthTop( targetRect, balloonRect ),
817
+ left: targetRect.left - ( balloonRect.width * .75 ) + horizontalOffset,
818
+ name: 'arrow_sme',
819
+ ...( config && { config } )
820
+ } ),
821
+
822
+ northWestArrowSouthEast: ( targetRect, balloonRect ) => ( {
823
+ top: getNorthTop( targetRect, balloonRect ),
824
+ left: targetRect.left - balloonRect.width + horizontalOffset,
825
+ name: 'arrow_se',
826
+ ...( config && { config } )
827
+ } ),
828
+
829
+ // ------- North
830
+
831
+ northArrowSouthWest: ( targetRect, balloonRect ) => ( {
832
+ top: getNorthTop( targetRect, balloonRect ),
833
+ left: targetRect.left + targetRect.width / 2 - horizontalOffset,
834
+ name: 'arrow_sw',
835
+ ...( config && { config } )
836
+ } ),
837
+
838
+ northArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
839
+ top: getNorthTop( targetRect, balloonRect ),
840
+ left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * .25 ) - horizontalOffset,
841
+ name: 'arrow_smw',
842
+ ...( config && { config } )
843
+ } ),
844
+
845
+ northArrowSouth: ( targetRect, balloonRect ) => ( {
846
+ top: getNorthTop( targetRect, balloonRect ),
847
+ left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
848
+ name: 'arrow_s',
849
+ ...( config && { config } )
850
+ } ),
851
+
852
+ northArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
853
+ top: getNorthTop( targetRect, balloonRect ),
854
+ left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * .75 ) + horizontalOffset,
855
+ name: 'arrow_sme',
856
+ ...( config && { config } )
857
+ } ),
858
+
859
+ northArrowSouthEast: ( targetRect, balloonRect ) => ( {
860
+ top: getNorthTop( targetRect, balloonRect ),
861
+ left: targetRect.left + targetRect.width / 2 - balloonRect.width + horizontalOffset,
862
+ name: 'arrow_se',
863
+ ...( config && { config } )
864
+ } ),
865
+
866
+ // ------- North east
867
+
868
+ northEastArrowSouthWest: ( targetRect, balloonRect ) => ( {
869
+ top: getNorthTop( targetRect, balloonRect ),
870
+ left: targetRect.right - horizontalOffset,
871
+ name: 'arrow_sw',
872
+ ...( config && { config } )
873
+ } ),
874
+
875
+ northEastArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
876
+ top: getNorthTop( targetRect, balloonRect ),
877
+ left: targetRect.right - ( balloonRect.width * .25 ) - horizontalOffset,
878
+ name: 'arrow_smw',
879
+ ...( config && { config } )
880
+ } ),
881
+
882
+ northEastArrowSouth: ( targetRect, balloonRect ) => ( {
883
+ top: getNorthTop( targetRect, balloonRect ),
884
+ left: targetRect.right - balloonRect.width / 2,
885
+ name: 'arrow_s',
886
+ ...( config && { config } )
887
+ } ),
888
+
889
+ northEastArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
890
+ top: getNorthTop( targetRect, balloonRect ),
891
+ left: targetRect.right - ( balloonRect.width * .75 ) + horizontalOffset,
892
+ name: 'arrow_sme',
893
+ ...( config && { config } )
894
+ } ),
895
+
896
+ northEastArrowSouthEast: ( targetRect, balloonRect ) => ( {
897
+ top: getNorthTop( targetRect, balloonRect ),
898
+ left: targetRect.right - balloonRect.width + horizontalOffset,
899
+ name: 'arrow_se',
900
+ ...( config && { config } )
901
+ } ),
902
+
903
+ // ------- South west
904
+
905
+ southWestArrowNorthWest: ( targetRect, balloonRect ) => ( {
906
+ top: getSouthTop( targetRect, balloonRect ),
907
+ left: targetRect.left - horizontalOffset,
908
+ name: 'arrow_nw',
909
+ ...( config && { config } )
910
+ } ),
911
+
912
+ southWestArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
913
+ top: getSouthTop( targetRect, balloonRect ),
914
+ left: targetRect.left - ( balloonRect.width * .25 ) - horizontalOffset,
915
+ name: 'arrow_nmw',
916
+ ...( config && { config } )
917
+ } ),
918
+
919
+ southWestArrowNorth: ( targetRect, balloonRect ) => ( {
920
+ top: getSouthTop( targetRect, balloonRect ),
921
+ left: targetRect.left - balloonRect.width / 2,
922
+ name: 'arrow_n',
923
+ ...( config && { config } )
924
+ } ),
925
+
926
+ southWestArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
927
+ top: getSouthTop( targetRect, balloonRect ),
928
+ left: targetRect.left - ( balloonRect.width * .75 ) + horizontalOffset,
929
+ name: 'arrow_nme',
930
+ ...( config && { config } )
931
+ } ),
932
+
933
+ southWestArrowNorthEast: ( targetRect, balloonRect ) => ( {
934
+ top: getSouthTop( targetRect, balloonRect ),
935
+ left: targetRect.left - balloonRect.width + horizontalOffset,
936
+ name: 'arrow_ne',
937
+ ...( config && { config } )
938
+ } ),
939
+
940
+ // ------- South
941
+
942
+ southArrowNorthWest: ( targetRect, balloonRect ) => ( {
943
+ top: getSouthTop( targetRect, balloonRect ),
944
+ left: targetRect.left + targetRect.width / 2 - horizontalOffset,
945
+ name: 'arrow_nw',
946
+ ...( config && { config } )
947
+ } ),
948
+
949
+ southArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
950
+ top: getSouthTop( targetRect, balloonRect ),
951
+ left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * 0.25 ) - horizontalOffset,
952
+ name: 'arrow_nmw',
953
+ ...( config && { config } )
954
+ } ),
955
+
956
+ southArrowNorth: ( targetRect, balloonRect ) => ( {
957
+ top: getSouthTop( targetRect, balloonRect ),
961
958
  left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
962
- name: 'arrowless',
963
- config: {
964
- withArrow: false
959
+ name: 'arrow_n',
960
+ ...( config && { config } )
961
+ } ),
962
+
963
+ southArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
964
+ top: getSouthTop( targetRect, balloonRect ),
965
+ left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * 0.75 ) + horizontalOffset,
966
+ name: 'arrow_nme',
967
+ ...( config && { config } )
968
+ } ),
969
+
970
+ southArrowNorthEast: ( targetRect, balloonRect ) => ( {
971
+ top: getSouthTop( targetRect, balloonRect ),
972
+ left: targetRect.left + targetRect.width / 2 - balloonRect.width + horizontalOffset,
973
+ name: 'arrow_ne',
974
+ ...( config && { config } )
975
+ } ),
976
+
977
+ // ------- South east
978
+
979
+ southEastArrowNorthWest: ( targetRect, balloonRect ) => ( {
980
+ top: getSouthTop( targetRect, balloonRect ),
981
+ left: targetRect.right - horizontalOffset,
982
+ name: 'arrow_nw',
983
+ ...( config && { config } )
984
+ } ),
985
+
986
+ southEastArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
987
+ top: getSouthTop( targetRect, balloonRect ),
988
+ left: targetRect.right - ( balloonRect.width * .25 ) - horizontalOffset,
989
+ name: 'arrow_nmw',
990
+ ...( config && { config } )
991
+ } ),
992
+
993
+ southEastArrowNorth: ( targetRect, balloonRect ) => ( {
994
+ top: getSouthTop( targetRect, balloonRect ),
995
+ left: targetRect.right - balloonRect.width / 2,
996
+ name: 'arrow_n',
997
+ ...( config && { config } )
998
+ } ),
999
+
1000
+ southEastArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
1001
+ top: getSouthTop( targetRect, balloonRect ),
1002
+ left: targetRect.right - ( balloonRect.width * .75 ) + horizontalOffset,
1003
+ name: 'arrow_nme',
1004
+ ...( config && { config } )
1005
+ } ),
1006
+
1007
+ southEastArrowNorthEast: ( targetRect, balloonRect ) => ( {
1008
+ top: getSouthTop( targetRect, balloonRect ),
1009
+ left: targetRect.right - balloonRect.width + horizontalOffset,
1010
+ name: 'arrow_ne',
1011
+ ...( config && { config } )
1012
+ } ),
1013
+
1014
+ // ------- Sticky
1015
+
1016
+ viewportStickyNorth: ( targetRect, balloonRect, viewportRect ) => {
1017
+ if ( !targetRect.getIntersection( viewportRect ) ) {
1018
+ return null;
965
1019
  }
966
- };
967
- }
968
- };
969
1020
 
970
- // Returns the top coordinate for positions starting with `north*`.
971
- //
972
- // @private
973
- // @param {utils/dom/rect~Rect} targetRect A rect of the target.
974
- // @param {utils/dom/rect~Rect} elementRect A rect of the balloon.
975
- // @returns {Number}
976
- function getNorthTop( targetRect, balloonRect ) {
977
- return targetRect.top - balloonRect.height - BalloonPanelView.arrowVerticalOffset;
978
- }
1021
+ return {
1022
+ top: viewportRect.top + stickyVerticalOffset,
1023
+ left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
1024
+ name: 'arrowless',
1025
+ config: {
1026
+ withArrow: false,
1027
+ ...config
1028
+ }
1029
+ };
1030
+ }
1031
+ };
1032
+
1033
+ // Returns the top coordinate for positions starting with `north*`.
1034
+ //
1035
+ // @private
1036
+ // @param {utils/dom/rect~Rect} targetRect A rect of the target.
1037
+ // @param {utils/dom/rect~Rect} elementRect A rect of the balloon.
1038
+ // @returns {Number}
1039
+ function getNorthTop( targetRect, balloonRect ) {
1040
+ return targetRect.top - balloonRect.height - verticalOffset;
1041
+ }
979
1042
 
980
- // Returns the top coordinate for positions starting with `south*`.
981
- //
982
- // @private
983
- // @param {utils/dom/rect~Rect} targetRect A rect of the target.
984
- // @param {utils/dom/rect~Rect} elementRect A rect of the balloon.
985
- // @returns {Number}
986
- function getSouthTop( targetRect ) {
987
- return targetRect.bottom + BalloonPanelView.arrowVerticalOffset;
1043
+ // Returns the top coordinate for positions starting with `south*`.
1044
+ //
1045
+ // @private
1046
+ // @param {utils/dom/rect~Rect} targetRect A rect of the target.
1047
+ // @param {utils/dom/rect~Rect} elementRect A rect of the balloon.
1048
+ // @returns {Number}
1049
+ function getSouthTop( targetRect ) {
1050
+ return targetRect.bottom + verticalOffset;
1051
+ }
988
1052
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -170,6 +170,17 @@ export default class ContextualBalloon extends Plugin {
170
170
  this._fakePanelsView = this._createFakePanelsView();
171
171
  }
172
172
 
173
+ /**
174
+ * @inheritDoc
175
+ */
176
+ destroy() {
177
+ super.destroy();
178
+
179
+ this.view.destroy();
180
+ this._rotatorView.destroy();
181
+ this._fakePanelsView.destroy();
182
+ }
183
+
173
184
  /**
174
185
  * Returns `true` when the given view is in one of the stacks. Otherwise returns `false`.
175
186
  *
@@ -628,6 +639,15 @@ class RotatorView extends View {
628
639
  this.focusTracker.add( this.element );
629
640
  }
630
641
 
642
+ /**
643
+ * @inheritDoc
644
+ */
645
+ destroy() {
646
+ super.destroy();
647
+
648
+ this.focusTracker.destroy();
649
+ }
650
+
631
651
  /**
632
652
  * Shows a given view.
633
653
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/template.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5