diff --git a/packages/ckeditor5-alignment/src/alignmentui.ts b/packages/ckeditor5-alignment/src/alignmentui.ts index f80ab0af498..4b5eae58df1 100644 --- a/packages/ckeditor5-alignment/src/alignmentui.ts +++ b/packages/ckeditor5-alignment/src/alignmentui.ts @@ -24,12 +24,12 @@ import { isSupported, normalizeAlignmentOptions } from './utils.js'; import type { AlignmentFormat, SupportedOption } from './alignmentconfig.js'; import type AlignmentCommand from './alignmentcommand.js'; -const iconsMap = new Map( [ +const iconsMap = /* #__PURE__ */ ( () => new Map( [ [ 'left', icons.alignLeft ], [ 'right', icons.alignRight ], [ 'center', icons.alignCenter ], [ 'justify', icons.alignJustify ] -] ); +] ) )(); /** * The default alignment UI plugin. diff --git a/packages/ckeditor5-heading/src/headingbuttonsui.ts b/packages/ckeditor5-heading/src/headingbuttonsui.ts index 83b15c3b6e0..37357ebf9b7 100644 --- a/packages/ckeditor5-heading/src/headingbuttonsui.ts +++ b/packages/ckeditor5-heading/src/headingbuttonsui.ts @@ -14,14 +14,14 @@ import { getLocalizedOptions } from './utils.js'; import type { HeadingOption } from './headingconfig.js'; import type HeadingCommand from './headingcommand.js'; -const defaultIcons: Record = { +const defaultIcons: Record = /* #__PURE__ */ ( () => ( { heading1: icons.heading1, heading2: icons.heading2, heading3: icons.heading3, heading4: icons.heading4, heading5: icons.heading5, heading6: icons.heading6 -}; +} ) )(); /** * The `HeadingButtonsUI` plugin defines a set of UI buttons that can be used instead of the diff --git a/packages/ckeditor5-image/src/imageresize/imageresizebuttons.ts b/packages/ckeditor5-image/src/imageresize/imageresizebuttons.ts index 38217149eaf..b649c84e938 100644 --- a/packages/ckeditor5-image/src/imageresize/imageresizebuttons.ts +++ b/packages/ckeditor5-image/src/imageresize/imageresizebuttons.ts @@ -24,13 +24,13 @@ import ImageResizeEditing from './imageresizeediting.js'; import type ResizeImageCommand from './resizeimagecommand.js'; import type { ImageResizeOption } from '../imageconfig.js'; -const RESIZE_ICONS = { +const RESIZE_ICONS = /* #__PURE__ */ ( () => ( { small: icons.objectSizeSmall, medium: icons.objectSizeMedium, large: icons.objectSizeLarge, custom: icons.objectSizeCustom, original: icons.objectSizeFull -}; +} ) )(); /** * The image resize buttons plugin. diff --git a/packages/ckeditor5-image/src/imagestyle/utils.ts b/packages/ckeditor5-image/src/imagestyle/utils.ts index 5ed95fc2186..ad7d9086d51 100644 --- a/packages/ckeditor5-image/src/imagestyle/utils.ts +++ b/packages/ckeditor5-image/src/imagestyle/utils.ts @@ -11,13 +11,6 @@ import { type Editor, icons, type PluginCollection } from 'ckeditor5/src/core.js import { logWarning } from 'ckeditor5/src/utils.js'; import type { ImageStyleConfig, ImageStyleDropdownDefinition, ImageStyleOptionDefinition } from '../imageconfig.js'; -const { - objectFullWidth, - objectInline, - objectLeft, objectRight, objectCenter, - objectBlockLeft, objectBlockRight -} = icons; - /** * Default image style options provided by the plugin that can be referred in the {@link module:image/imageconfig~ImageConfig#styles} * configuration. @@ -42,7 +35,7 @@ export const DEFAULT_OPTIONS: Record = { return { name: 'inline', title: 'In line', - icon: objectInline, + icon: icons.objectInline, modelElements: [ 'imageInline' ], isDefault: true }; @@ -53,7 +46,7 @@ export const DEFAULT_OPTIONS: Record = { return { name: 'alignLeft', title: 'Left aligned image', - icon: objectLeft, + icon: icons.objectLeft, modelElements: [ 'imageBlock', 'imageInline' ], className: 'image-style-align-left' }; @@ -64,7 +57,7 @@ export const DEFAULT_OPTIONS: Record = { return { name: 'alignBlockLeft', title: 'Left aligned image', - icon: objectBlockLeft, + icon: icons.objectBlockLeft, modelElements: [ 'imageBlock' ], className: 'image-style-block-align-left' }; @@ -75,7 +68,7 @@ export const DEFAULT_OPTIONS: Record = { return { name: 'alignCenter', title: 'Centered image', - icon: objectCenter, + icon: icons.objectCenter, modelElements: [ 'imageBlock' ], className: 'image-style-align-center' }; @@ -86,7 +79,7 @@ export const DEFAULT_OPTIONS: Record = { return { name: 'alignRight', title: 'Right aligned image', - icon: objectRight, + icon: icons.objectRight, modelElements: [ 'imageBlock', 'imageInline' ], className: 'image-style-align-right' }; @@ -97,7 +90,7 @@ export const DEFAULT_OPTIONS: Record = { return { name: 'alignBlockRight', title: 'Right aligned image', - icon: objectBlockRight, + icon: icons.objectBlockRight, modelElements: [ 'imageBlock' ], className: 'image-style-block-align-right' }; @@ -108,7 +101,7 @@ export const DEFAULT_OPTIONS: Record = { return { name: 'block', title: 'Centered image', - icon: objectCenter, + icon: icons.objectCenter, modelElements: [ 'imageBlock' ], isDefault: true }; @@ -119,7 +112,7 @@ export const DEFAULT_OPTIONS: Record = { return { name: 'side', title: 'Side image', - icon: objectRight, + icon: icons.objectRight, modelElements: [ 'imageBlock' ], className: 'image-style-side' }; @@ -134,15 +127,15 @@ export const DEFAULT_OPTIONS: Record = { * * There are 7 default icons available: `'full'`, `'left'`, `'inlineLeft'`, `'center'`, `'right'`, `'inlineRight'`, and `'inline'`. */ -export const DEFAULT_ICONS: Record = { - full: objectFullWidth, - left: objectBlockLeft, - right: objectBlockRight, - center: objectCenter, - inlineLeft: objectLeft, - inlineRight: objectRight, - inline: objectInline -}; +export const DEFAULT_ICONS: Record = /* #__PURE__ */ ( () => ( { + full: icons.objectFullWidth, + left: icons.objectBlockLeft, + right: icons.objectBlockRight, + center: icons.objectCenter, + inlineLeft: icons.objectLeft, + inlineRight: icons.objectRight, + inline: icons.objectInline +} ) )(); /** * Default drop-downs provided by the plugin that can be referred in the {@link module:image/imageconfig~ImageConfig#toolbar} diff --git a/packages/ckeditor5-table/src/tablecellproperties/ui/tablecellpropertiesview.ts b/packages/ckeditor5-table/src/tablecellproperties/ui/tablecellpropertiesview.ts index 25e45cbffac..51cf1173fb1 100644 --- a/packages/ckeditor5-table/src/tablecellproperties/ui/tablecellpropertiesview.ts +++ b/packages/ckeditor5-table/src/tablecellproperties/ui/tablecellpropertiesview.ts @@ -48,16 +48,6 @@ import '../../../theme/form.css'; import '../../../theme/tableform.css'; import '../../../theme/tablecellproperties.css'; -const ALIGNMENT_ICONS = { - left: icons.alignLeft, - center: icons.alignCenter, - right: icons.alignRight, - justify: icons.alignJustify, - top: icons.alignTop, - middle: icons.alignMiddle, - bottom: icons.alignBottom -}; - export interface TableCellPropertiesViewOptions { borderColors: Array; backgroundColors: Array; @@ -716,6 +706,16 @@ export default class TableCellPropertiesView extends View { const alignmentLabel = new LabelView( locale ); + const ALIGNMENT_ICONS = { + left: icons.alignLeft, + center: icons.alignCenter, + right: icons.alignRight, + justify: icons.alignJustify, + top: icons.alignTop, + middle: icons.alignMiddle, + bottom: icons.alignBottom + }; + alignmentLabel.text = t( 'Table cell text alignment' ); // -- Horizontal --------------------------------------------------- diff --git a/packages/ckeditor5-table/src/tableproperties/ui/tablepropertiesview.ts b/packages/ckeditor5-table/src/tableproperties/ui/tablepropertiesview.ts index 36f76719e25..210d08e040f 100644 --- a/packages/ckeditor5-table/src/tableproperties/ui/tablepropertiesview.ts +++ b/packages/ckeditor5-table/src/tableproperties/ui/tablepropertiesview.ts @@ -45,12 +45,6 @@ import '../../../theme/tableproperties.css'; import type ColorInputView from '../../ui/colorinputview.js'; import type { TablePropertiesOptions } from '../../tableconfig.js'; -const ALIGNMENT_ICONS = { - left: icons.objectLeft, - center: icons.objectCenter, - right: icons.objectRight -}; - /** * Additional configuration of the view. */ @@ -661,7 +655,11 @@ export default class TablePropertiesView extends View { fillToolbar( { view: this, - icons: ALIGNMENT_ICONS, + icons: { + left: icons.objectLeft, + center: icons.objectCenter, + right: icons.objectRight + }, toolbar: alignmentToolbar, labels: this._alignmentLabels, propertyName: 'alignment', diff --git a/packages/ckeditor5-table/src/utils/ui/contextualballoon.ts b/packages/ckeditor5-table/src/utils/ui/contextualballoon.ts index 59d6966fe7c..372263d93d4 100644 --- a/packages/ckeditor5-table/src/utils/ui/contextualballoon.ts +++ b/packages/ckeditor5-table/src/utils/ui/contextualballoon.ts @@ -15,17 +15,15 @@ import type { Element, Position, Range } from 'ckeditor5/src/engine.js'; import { getSelectionAffectedTableWidget, getTableWidgetAncestor } from './widget.js'; import { getSelectionAffectedTable } from '../common.js'; -const DEFAULT_BALLOON_POSITIONS = BalloonPanelView.defaultPositions; - -const BALLOON_POSITIONS = [ - DEFAULT_BALLOON_POSITIONS.northArrowSouth, - DEFAULT_BALLOON_POSITIONS.northArrowSouthWest, - DEFAULT_BALLOON_POSITIONS.northArrowSouthEast, - DEFAULT_BALLOON_POSITIONS.southArrowNorth, - DEFAULT_BALLOON_POSITIONS.southArrowNorthWest, - DEFAULT_BALLOON_POSITIONS.southArrowNorthEast, - DEFAULT_BALLOON_POSITIONS.viewportStickyNorth -]; +const BALLOON_POSITIONS = /* #__PURE__ */ ( () => [ + BalloonPanelView.defaultPositions.northArrowSouth, + BalloonPanelView.defaultPositions.northArrowSouthWest, + BalloonPanelView.defaultPositions.northArrowSouthEast, + BalloonPanelView.defaultPositions.southArrowNorth, + BalloonPanelView.defaultPositions.southArrowNorthWest, + BalloonPanelView.defaultPositions.southArrowNorthEast, + BalloonPanelView.defaultPositions.viewportStickyNorth +] )(); /** * A helper utility that positions the diff --git a/packages/ckeditor5-ui/src/colorselector/colorgridsfragmentview.ts b/packages/ckeditor5-ui/src/colorselector/colorgridsfragmentview.ts index 6cd3c757260..a1b5be48f63 100644 --- a/packages/ckeditor5-ui/src/colorselector/colorgridsfragmentview.ts +++ b/packages/ckeditor5-ui/src/colorselector/colorgridsfragmentview.ts @@ -23,8 +23,6 @@ import type { FocusableView } from '../focuscycler.js'; import type { ColorSelectorExecuteEvent, ColorSelectorColorPickerShowEvent } from './colorselectorview.js'; import { icons } from '@ckeditor/ckeditor5-core'; -const { eraser: removeButtonIcon, colorPalette: colorPaletteIcon } = icons; - /** * One of the fragments of {@link module:ui/colorselector/colorselectorview~ColorSelectorView}. * @@ -334,7 +332,7 @@ export default class ColorGridsFragmentView extends View { this.colorPickerButtonView.set( { label: this._colorPickerLabel, withText: true, - icon: colorPaletteIcon, + icon: icons.colorPalette, class: 'ck-color-selector__color-picker' } ); @@ -351,7 +349,7 @@ export default class ColorGridsFragmentView extends View { buttonView.set( { withText: true, - icon: removeButtonIcon, + icon: icons.eraser, label: this._removeButtonLabel } ); diff --git a/packages/ckeditor5-ui/src/toolbar/toolbarview.ts b/packages/ckeditor5-ui/src/toolbar/toolbarview.ts index d3d918d225c..728b49fa645 100644 --- a/packages/ckeditor5-ui/src/toolbar/toolbarview.ts +++ b/packages/ckeditor5-ui/src/toolbar/toolbarview.ts @@ -45,7 +45,7 @@ import { isObject } from 'lodash-es'; import '../../theme/components/toolbar/toolbar.css'; -export const NESTED_TOOLBAR_ICONS: Record = { +export const NESTED_TOOLBAR_ICONS: Record = /* #__PURE__ */ ( () => ( { alignLeft: icons.alignLeft, bold: icons.bold, importExport: icons.importExport, @@ -55,7 +55,7 @@ export const NESTED_TOOLBAR_ICONS: Record = { threeVerticalDots: icons.threeVerticalDots, pilcrow: icons.pilcrow, dragIndicator: icons.dragIndicator -}; +} ) )(); /** * The toolbar view class.