@ckeditor/ckeditor5-ui 28.0.0 → 30.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 (71) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +6 -2
  3. package/ckeditor5-metadata.json +11 -0
  4. package/lang/contexts.json +0 -2
  5. package/lang/translations/ar.po +0 -8
  6. package/lang/translations/ast.po +0 -8
  7. package/lang/translations/az.po +0 -8
  8. package/lang/translations/cs.po +0 -8
  9. package/lang/translations/da.po +0 -8
  10. package/lang/translations/de-ch.po +0 -8
  11. package/lang/translations/de.po +0 -8
  12. package/lang/translations/el.po +0 -8
  13. package/lang/translations/en-au.po +0 -8
  14. package/lang/translations/en-gb.po +0 -8
  15. package/lang/translations/en.po +0 -8
  16. package/lang/translations/eo.po +0 -8
  17. package/lang/translations/es.po +0 -8
  18. package/lang/translations/et.po +0 -8
  19. package/lang/translations/eu.po +0 -8
  20. package/lang/translations/fa.po +0 -8
  21. package/lang/translations/fi.po +0 -8
  22. package/lang/translations/fr.po +0 -8
  23. package/lang/translations/gl.po +0 -8
  24. package/lang/translations/he.po +0 -8
  25. package/lang/translations/hi.po +0 -8
  26. package/lang/translations/hr.po +0 -8
  27. package/lang/translations/hu.po +0 -8
  28. package/lang/translations/id.po +0 -8
  29. package/lang/translations/it.po +0 -8
  30. package/lang/translations/ja.po +0 -8
  31. package/lang/translations/km.po +0 -8
  32. package/lang/translations/kn.po +0 -8
  33. package/lang/translations/ko.po +0 -8
  34. package/lang/translations/ku.po +0 -8
  35. package/lang/translations/lt.po +0 -8
  36. package/lang/translations/lv.po +0 -8
  37. package/lang/translations/nb.po +0 -8
  38. package/lang/translations/ne.po +0 -8
  39. package/lang/translations/nl.po +0 -8
  40. package/lang/translations/no.po +0 -8
  41. package/lang/translations/pl.po +0 -8
  42. package/lang/translations/pt-br.po +0 -8
  43. package/lang/translations/pt.po +0 -8
  44. package/lang/translations/ro.po +0 -8
  45. package/lang/translations/ru.po +0 -8
  46. package/lang/translations/sk.po +0 -8
  47. package/lang/translations/sl.po +0 -8
  48. package/lang/translations/sq.po +0 -8
  49. package/lang/translations/sr-latn.po +0 -8
  50. package/lang/translations/sr.po +0 -8
  51. package/lang/translations/sv.po +0 -8
  52. package/lang/translations/th.po +0 -8
  53. package/lang/translations/tk.po +0 -8
  54. package/lang/translations/tr.po +0 -8
  55. package/lang/translations/ug.po +0 -8
  56. package/lang/translations/uk.po +0 -8
  57. package/lang/translations/vi.po +0 -8
  58. package/lang/translations/zh-cn.po +0 -8
  59. package/lang/translations/zh.po +0 -8
  60. package/package.json +21 -21
  61. package/src/button/buttonview.js +1 -1
  62. package/src/dropdown/button/splitbuttonview.js +2 -0
  63. package/src/index.js +2 -0
  64. package/src/notification/notification.js +1 -1
  65. package/src/panel/balloon/balloonpanelview.js +69 -7
  66. package/src/panel/balloon/contextualballoon.js +11 -4
  67. package/src/panel/sticky/stickypanelview.js +5 -1
  68. package/src/toolbar/balloon/balloontoolbar.js +1 -1
  69. package/src/toolbar/block/blocktoolbar.js +3 -2
  70. package/src/toolbar/toolbarview.js +2 -2
  71. package/CHANGELOG.md +0 -542
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-ui",
3
- "version": "28.0.0",
3
+ "version": "30.0.0",
4
4
  "description": "The UI framework and standard UI library of CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -11,28 +11,27 @@
11
11
  ],
12
12
  "main": "src/index.js",
13
13
  "dependencies": {
14
- "@ckeditor/ckeditor5-utils": "^28.0.0",
15
- "ckeditor5": "^28.0.0",
14
+ "@ckeditor/ckeditor5-utils": "^30.0.0",
15
+ "@ckeditor/ckeditor5-core": "^30.0.0",
16
16
  "lodash-es": "^4.17.15"
17
17
  },
18
18
  "devDependencies": {
19
- "@ckeditor/ckeditor5-basic-styles": "^28.0.0",
20
- "@ckeditor/ckeditor5-block-quote": "^28.0.0",
21
- "@ckeditor/ckeditor5-core": "^28.0.0",
22
- "@ckeditor/ckeditor5-editor-balloon": "^28.0.0",
23
- "@ckeditor/ckeditor5-editor-classic": "^28.0.0",
24
- "@ckeditor/ckeditor5-engine": "^28.0.0",
25
- "@ckeditor/ckeditor5-enter": "^28.0.0",
26
- "@ckeditor/ckeditor5-essentials": "^28.0.0",
27
- "@ckeditor/ckeditor5-heading": "^28.0.0",
28
- "@ckeditor/ckeditor5-image": "^28.0.0",
29
- "@ckeditor/ckeditor5-link": "^28.0.0",
30
- "@ckeditor/ckeditor5-list": "^28.0.0",
31
- "@ckeditor/ckeditor5-mention": "^28.0.0",
32
- "@ckeditor/ckeditor5-paragraph": "^28.0.0",
33
- "@ckeditor/ckeditor5-horizontal-line": "^28.0.0",
34
- "@ckeditor/ckeditor5-table": "^28.0.0",
35
- "@ckeditor/ckeditor5-typing": "^28.0.0"
19
+ "@ckeditor/ckeditor5-basic-styles": "^30.0.0",
20
+ "@ckeditor/ckeditor5-block-quote": "^30.0.0",
21
+ "@ckeditor/ckeditor5-editor-balloon": "^30.0.0",
22
+ "@ckeditor/ckeditor5-editor-classic": "^30.0.0",
23
+ "@ckeditor/ckeditor5-engine": "^30.0.0",
24
+ "@ckeditor/ckeditor5-enter": "^30.0.0",
25
+ "@ckeditor/ckeditor5-essentials": "^30.0.0",
26
+ "@ckeditor/ckeditor5-heading": "^30.0.0",
27
+ "@ckeditor/ckeditor5-image": "^30.0.0",
28
+ "@ckeditor/ckeditor5-link": "^30.0.0",
29
+ "@ckeditor/ckeditor5-list": "^30.0.0",
30
+ "@ckeditor/ckeditor5-mention": "^30.0.0",
31
+ "@ckeditor/ckeditor5-paragraph": "^30.0.0",
32
+ "@ckeditor/ckeditor5-horizontal-line": "^30.0.0",
33
+ "@ckeditor/ckeditor5-table": "^30.0.0",
34
+ "@ckeditor/ckeditor5-typing": "^30.0.0"
36
35
  },
37
36
  "engines": {
38
37
  "node": ">=12.0.0",
@@ -50,6 +49,7 @@
50
49
  "files": [
51
50
  "lang",
52
51
  "src",
53
- "theme"
52
+ "theme",
53
+ "ckeditor5-metadata.json"
54
54
  ]
55
55
  }
@@ -184,7 +184,7 @@ export default class ButtonView extends View {
184
184
  this.children.add( this.tooltipView );
185
185
  this.children.add( this.labelView );
186
186
 
187
- if ( this.withKeystroke ) {
187
+ if ( this.withKeystroke && this.keystroke ) {
188
188
  this.children.add( this.keystrokeView );
189
189
  }
190
190
  }
@@ -47,6 +47,7 @@ export default class SplitButtonView extends View {
47
47
  const bind = this.bindTemplate;
48
48
 
49
49
  // Implement the Button interface.
50
+ this.set( 'class' );
50
51
  this.set( 'icon' );
51
52
  this.set( 'isEnabled', true );
52
53
  this.set( 'isOn', false );
@@ -111,6 +112,7 @@ export default class SplitButtonView extends View {
111
112
  class: [
112
113
  'ck',
113
114
  'ck-splitbutton',
115
+ bind.to( 'class' ),
114
116
  bind.if( 'isVisible', 'ck-hidden', value => !value ),
115
117
  this.arrowView.bindTemplate.if( 'isOn', 'ck-splitbutton_open' )
116
118
  ]
package/src/index.js CHANGED
@@ -34,6 +34,8 @@ export { default as FocusCycler } from './focuscycler';
34
34
  export { default as IconView } from './icon/iconview';
35
35
  export { default as InputTextView } from './inputtext/inputtextview';
36
36
 
37
+ export { default as IframeView } from './iframe/iframeview';
38
+
37
39
  export { default as LabelView } from './label/labelview';
38
40
  export { default as LabeledFieldView } from './labeledfield/labeledfieldview';
39
41
  export * from './labeledfield/utils';
@@ -9,7 +9,7 @@
9
9
 
10
10
  /* globals window */
11
11
 
12
- import { ContextPlugin } from 'ckeditor5/src/core';
12
+ import ContextPlugin from '@ckeditor/ckeditor5-core/src/contextplugin';
13
13
 
14
14
  /**
15
15
  * The Notification plugin.
@@ -232,7 +232,8 @@ export default class BalloonPanelView extends View {
232
232
  defaultPositions.northArrowSouthMiddleWest,
233
233
  defaultPositions.northArrowSouthMiddleEast,
234
234
  defaultPositions.northArrowSouthWest,
235
- defaultPositions.northArrowSouthEast
235
+ defaultPositions.northArrowSouthEast,
236
+ defaultPositions.viewportStickyNorth
236
237
  ],
237
238
  limiter: defaultLimiterElement,
238
239
  fitInViewport: true
@@ -244,9 +245,11 @@ export default class BalloonPanelView extends View {
244
245
  // so it is better to use int values.
245
246
  const left = parseInt( optimalPosition.left );
246
247
  const top = parseInt( optimalPosition.top );
247
- const position = optimalPosition.name;
248
248
 
249
- Object.assign( this, { top, left, position } );
249
+ const { name: position, config = {} } = optimalPosition;
250
+ const { withArrow = true } = config;
251
+
252
+ Object.assign( this, { top, left, position, withArrow } );
250
253
  }
251
254
 
252
255
  /**
@@ -401,7 +404,7 @@ function getDomElement( object ) {
401
404
  * \|/
402
405
  * >|-----|<---------------- horizontal offset
403
406
  *
404
- * @default 30
407
+ * @default 25
405
408
  * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowHorizontalOffset
406
409
  */
407
410
  BalloonPanelView.arrowHorizontalOffset = 25;
@@ -420,11 +423,35 @@ BalloonPanelView.arrowHorizontalOffset = 25;
420
423
  * -------------------------------
421
424
  * ^
422
425
  *
423
- * @default 15
426
+ * @default 10
424
427
  * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowVerticalOffset
425
428
  */
426
429
  BalloonPanelView.arrowVerticalOffset = 10;
427
430
 
431
+ /**
432
+ * A vertical offset of the balloon panel from the edge of the viewport if sticky.
433
+ * It helps in accessing toolbar buttons underneath the balloon panel.
434
+ *
435
+ * +---------------------------------------------------+
436
+ * | Target |
437
+ * | |
438
+ * | /-- vertical offset |
439
+ * +-----------------------------V-------------------------+
440
+ * | Toolbar +-------------+ |
441
+ * +--------------------| Balloon |--------------------+
442
+ * | | +-------------+ | |
443
+ * | | | |
444
+ * | | | |
445
+ * | | | |
446
+ * | +---------------------------------------------------+ |
447
+ * | Viewport |
448
+ * +-------------------------------------------------------+
449
+ *
450
+ * @default 20
451
+ * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.stickyVerticalOffset
452
+ */
453
+ BalloonPanelView.stickyVerticalOffset = 20;
454
+
428
455
  /**
429
456
  * Function used to calculate the optimal position for the balloon.
430
457
  *
@@ -702,6 +729,22 @@ BalloonPanelView._getOptimalPosition = getOptimalPosition;
702
729
  * | Balloon |
703
730
  * +-----------------+
704
731
  *
732
+ * * `viewportStickyNorth`
733
+ *
734
+ * +---------------------------+
735
+ * | [ Target ] |
736
+ * | |
737
+ * +-----------------------------------+
738
+ * | | +-----------------+ | |
739
+ * | | | Balloon | | |
740
+ * | | +-----------------+ | |
741
+ * | | | |
742
+ * | | | |
743
+ * | | | |
744
+ * | | | |
745
+ * | +---------------------------+ |
746
+ * | Viewport |
747
+ * +-----------------------------------+
705
748
  *
706
749
  * See {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo}.
707
750
  *
@@ -710,7 +753,8 @@ BalloonPanelView._getOptimalPosition = getOptimalPosition;
710
753
  * The name that the position function returns will be reflected in the balloon panel's class that
711
754
  * controls the placement of the "arrow". See {@link #position} to learn more.
712
755
  *
713
- * @member {Object} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions
756
+ * @member {Object.<String,module:utils/dom/position~positioningFunction>}
757
+ * module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions
714
758
  */
715
759
  BalloonPanelView.defaultPositions = {
716
760
 
@@ -791,6 +835,7 @@ BalloonPanelView.defaultPositions = {
791
835
  left: targetRect.right - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
792
836
  name: 'arrow_smw'
793
837
  } ),
838
+
794
839
  northEastArrowSouth: ( targetRect, balloonRect ) => ( {
795
840
  top: getNorthTop( targetRect, balloonRect ),
796
841
  left: targetRect.right - balloonRect.width / 2,
@@ -808,6 +853,7 @@ BalloonPanelView.defaultPositions = {
808
853
  left: targetRect.right - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
809
854
  name: 'arrow_se'
810
855
  } ),
856
+
811
857
  // ------- South west
812
858
 
813
859
  southWestArrowNorthWest: ( targetRect, balloonRect ) => ( {
@@ -901,8 +947,24 @@ BalloonPanelView.defaultPositions = {
901
947
  top: getSouthTop( targetRect, balloonRect ),
902
948
  left: targetRect.right - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
903
949
  name: 'arrow_ne'
904
- } )
950
+ } ),
951
+
952
+ // ------- Sticky
953
+
954
+ viewportStickyNorth: ( targetRect, balloonRect, viewportRect ) => {
955
+ if ( !targetRect.getIntersection( viewportRect ) ) {
956
+ return null;
957
+ }
905
958
 
959
+ return {
960
+ top: viewportRect.top + BalloonPanelView.stickyVerticalOffset,
961
+ left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
962
+ name: 'arrowless',
963
+ config: {
964
+ withArrow: false
965
+ }
966
+ };
967
+ }
906
968
  };
907
969
 
908
970
  // Returns the top coordinate for positions starting with `north*`.
@@ -7,7 +7,7 @@
7
7
  * @module ui/panel/balloon/contextualballoon
8
8
  */
9
9
 
10
- import { Plugin } from 'ckeditor5/src/core';
10
+ import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
11
11
  import BalloonPanelView from './balloonpanelview';
12
12
  import View from '../../view';
13
13
  import ButtonView from '../../button/buttonview';
@@ -498,11 +498,18 @@ export default class ContextualBalloon extends Plugin {
498
498
  _getBalloonPosition() {
499
499
  let position = Array.from( this._visibleStack.values() ).pop().position;
500
500
 
501
- // Use the default limiter if none has been specified.
502
- if ( position && !position.limiter ) {
501
+ if ( position ) {
502
+ // Use the default limiter if none has been specified.
503
+ if ( !position.limiter ) {
504
+ // Don't modify the original options object.
505
+ position = Object.assign( {}, position, {
506
+ limiter: this.positionLimiter
507
+ } );
508
+ }
509
+
503
510
  // Don't modify the original options object.
504
511
  position = Object.assign( {}, position, {
505
- limiter: this.positionLimiter
512
+ viewportOffsetConfig: this.editor.config.get( 'ui.viewportOffset' )
506
513
  } );
507
514
  }
508
515
 
@@ -80,7 +80,11 @@ export default class StickyPanelView extends View {
80
80
  * either using `position: fixed` or `position: sticky`, which would cover the
81
81
  * sticky panel or vice–versa (depending on the `z-index` hierarchy).
82
82
  *
83
- * @readonly
83
+ * Bound to {@link module:core/editor/editorui~EditorUI#viewportOffset `EditorUI#viewportOffset`}.
84
+ *
85
+ * If {@link module:core/editor/editorconfig~EditorConfig#ui `EditorConfig#ui.viewportOffset.top`} is defined, then
86
+ * it will override the default value.
87
+ *
84
88
  * @observable
85
89
  * @default 0
86
90
  * @member {Number} #viewportTopOffset
@@ -7,7 +7,7 @@
7
7
  * @module ui/toolbar/balloon/balloontoolbar
8
8
  */
9
9
 
10
- import { Plugin } from 'ckeditor5/src/core';
10
+ import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
11
11
  import ContextualBalloon from '../../panel/balloon/contextualballoon';
12
12
  import ToolbarView from '../toolbarview';
13
13
  import BalloonPanelView from '../../panel/balloon/balloonpanelview.js';
@@ -9,7 +9,8 @@
9
9
 
10
10
  /* global window */
11
11
 
12
- import { Plugin, icons } from 'ckeditor5/src/core';
12
+ import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
13
+ import pilcrow from '@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg';
13
14
 
14
15
  import BlockButtonView from './blockbuttonview';
15
16
  import BalloonPanelView from '../../panel/balloon/balloonpanelview';
@@ -273,7 +274,7 @@ export default class BlockToolbar extends Plugin {
273
274
 
274
275
  buttonView.set( {
275
276
  label: t( 'Edit block' ),
276
- icon: icons.pilcrow,
277
+ icon: pilcrow,
277
278
  withText: false
278
279
  } );
279
280
 
@@ -20,7 +20,7 @@ import global from '@ckeditor/ckeditor5-utils/src/dom/global';
20
20
  import { createDropdown, addToolbarToDropdown } from '../dropdown/utils';
21
21
  import { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
22
22
  import normalizeToolbarConfig from './normalizetoolbarconfig';
23
- import { icons } from 'ckeditor5/src/core';
23
+ import threeVerticalDots from '@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg';
24
24
 
25
25
  import '../../theme/components/toolbar/toolbar.css';
26
26
 
@@ -935,7 +935,7 @@ class DynamicGrouping {
935
935
  label: t( 'Show more items' ),
936
936
  tooltip: true,
937
937
  tooltipPosition: locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw',
938
- icon: icons.threeVerticalDots
938
+ icon: threeVerticalDots
939
939
  } );
940
940
 
941
941
  // 1:1 pass–through binding.