Skip to content

Commit

Permalink
Fix issues caused by targeting ES2022 (and dropping some polyfills)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipsobol committed May 7, 2024
1 parent cf1cc7c commit 505cb30
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
16 changes: 10 additions & 6 deletions packages/ckeditor5-ui/src/panel/balloon/balloonpanelview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ import {
import { isElement } from 'lodash-es';
import '../../../theme/components/panel/balloonpanel.css';

const ARROW_SIDE_OFFSET = 25;
const ARROW_HEIGHT_OFFSET = 10;
const STICKY_VERTICAL_OFFSET = 20;

const toPx = toUnit( 'px' );
const defaultLimiterElement = global.document.body;

Expand Down Expand Up @@ -416,7 +420,7 @@ export default class BalloonPanelView extends View {
*
* @default 25
*/
public static arrowSideOffset = 25;
public static arrowSideOffset = ARROW_SIDE_OFFSET;

/**
* A height offset of the arrow from the edge of the balloon. Controlled by CSS.
Expand Down Expand Up @@ -448,7 +452,7 @@ export default class BalloonPanelView extends View {
*
* @default 10
*/
public static arrowHeightOffset = 10;
public static arrowHeightOffset = ARROW_HEIGHT_OFFSET;

/**
* A vertical offset of the balloon panel from the edge of the viewport if sticky.
Expand All @@ -473,7 +477,7 @@ export default class BalloonPanelView extends View {
*
* @default 20
*/
public static stickyVerticalOffset = 20;
public static stickyVerticalOffset = STICKY_VERTICAL_OFFSET;

/**
* Function used to calculate the optimal position for the balloon.
Expand Down Expand Up @@ -899,9 +903,9 @@ export function generatePositions( options: {
config?: object;
} = {} ): Record<string, PositioningFunction> {
const {
sideOffset = BalloonPanelView.arrowSideOffset,
heightOffset = BalloonPanelView.arrowHeightOffset,
stickyVerticalOffset = BalloonPanelView.stickyVerticalOffset,
sideOffset = ARROW_SIDE_OFFSET,
heightOffset = ARROW_HEIGHT_OFFSET,
stickyVerticalOffset = STICKY_VERTICAL_OFFSET,
config
} = options;

Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5-ui/src/viewcollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import type View from './view.js';
* of a {@link module:ui/template~Template template}.
*/
export default class ViewCollection<TView extends View = View> extends Collection<TView> {
public id?: string;
public declare id?: string;

/**
* A parent element within which child views are rendered and managed in DOM.
Expand Down
1 change: 1 addition & 0 deletions tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"noEmitOnError": false
},
"include": [
"**/*.ts",
"./typings/",
"./packages/*/src/augmentation.ts",
"./external/ckeditor5-commercial/packages/*/src/augmentation.ts"
Expand Down

0 comments on commit 505cb30

Please sign in to comment.