@ckeditor/ckeditor5-ui 43.3.1 → 44.0.0-alpha.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.
- package/README.md +13 -7
- package/dist/badge/badge.d.ts +133 -0
- package/dist/dropdown/dropdownview.d.ts +6 -0
- package/dist/editorui/bodycollection.d.ts +47 -12
- package/dist/editorui/editorui.d.ts +5 -0
- package/dist/editorui/evaluationbadge.d.ts +37 -0
- package/dist/editorui/poweredby.d.ts +12 -49
- package/dist/index-editor.css +52 -3
- package/dist/index.css +62 -3
- package/dist/index.css.map +1 -1
- package/dist/index.js +351 -144
- package/dist/index.js.map +1 -1
- package/dist/menubar/menubarmenupanelview.d.ts +1 -1
- package/dist/menubar/menubarmenuview.d.ts +5 -0
- package/dist/menubar/utils.d.ts +1 -0
- package/package.json +4 -4
- package/src/badge/badge.d.ts +129 -0
- package/src/badge/badge.js +218 -0
- package/src/dialog/dialogview.js +6 -2
- package/src/dropdown/dropdownview.d.ts +6 -0
- package/src/dropdown/dropdownview.js +9 -1
- package/src/editorui/bodycollection.d.ts +47 -12
- package/src/editorui/bodycollection.js +50 -19
- package/src/editorui/editorui.d.ts +5 -0
- package/src/editorui/editorui.js +3 -0
- package/src/editorui/evaluationbadge.d.ts +33 -0
- package/src/editorui/evaluationbadge.js +99 -0
- package/src/editorui/poweredby.d.ts +12 -49
- package/src/editorui/poweredby.js +36 -194
- package/src/menubar/menubarmenupanelview.d.ts +1 -1
- package/src/menubar/menubarmenuview.d.ts +5 -0
- package/src/menubar/menubarmenuview.js +23 -1
- package/src/menubar/utils.d.ts +1 -0
- package/src/menubar/utils.js +2 -0
- package/theme/globals/_evaluationbadge.css +54 -0
- package/theme/globals/_poweredby.css +15 -3
- package/theme/globals/globals.css +1 -0
package/README.md
CHANGED
|
@@ -3,10 +3,22 @@ CKEditor 5 UI framework
|
|
|
3
3
|
|
|
4
4
|
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-ui)
|
|
5
5
|
[](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
|
|
6
|
-
[](https://app.circleci.com/pipelines/github/ckeditor/ckeditor5?branch=master)
|
|
7
7
|
|
|
8
8
|
This package implements a simple UI framework and CKEditor 5's standard UI library.
|
|
9
9
|
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
This plugin is part of the `ckeditor5` package. Install the whole package to use it.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install ckeditor5
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Create free account
|
|
19
|
+
|
|
20
|
+
If you want to check full CKEditor 5 capabilities, sign up for a [free non-commitment 14-day trial](https://portal.ckeditor.com/signup).
|
|
21
|
+
|
|
10
22
|
## Demo
|
|
11
23
|
|
|
12
24
|
Check out the [editor toolbar demo](https://ckeditor.com/docs/ckeditor5/latest/getting-started/setup/toolbar/toolbar.html#demo) and [block toolbar demo](https://ckeditor.com/docs/ckeditor5/latest/getting-started/setup/toolbar.html#block-toolbar#demo) in CKEditor 5 documentation.
|
|
@@ -15,12 +27,6 @@ Check out the [editor toolbar demo](https://ckeditor.com/docs/ckeditor5/latest/g
|
|
|
15
27
|
|
|
16
28
|
See the [`@ckeditor/ckeditor5-ui` package](https://ckeditor.com/docs/ckeditor5/latest/api/ui.html) page in [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/).
|
|
17
29
|
|
|
18
|
-
## Installation
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
npm install ckeditor5
|
|
22
|
-
```
|
|
23
|
-
|
|
24
30
|
## License
|
|
25
31
|
|
|
26
32
|
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file or [https://ckeditor.com/legal/ckeditor-oss-license](https://ckeditor.com/legal/ckeditor-oss-license).
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module ui/badge/badge
|
|
11
|
+
*/
|
|
12
|
+
import type { Editor } from '@ckeditor/ckeditor5-core';
|
|
13
|
+
import type View from '../view.js';
|
|
14
|
+
declare const Badge_base: {
|
|
15
|
+
new (): import("@ckeditor/ckeditor5-utils").DomEmitter;
|
|
16
|
+
prototype: import("@ckeditor/ckeditor5-utils").DomEmitter;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A helper that enables the badge feature in the editor and renders a custom view next to the bottom of the editable element
|
|
20
|
+
* (editor root, source editing area, etc.) when the editor is focused.
|
|
21
|
+
*
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
export default abstract class Badge extends /* #__PURE__ */ Badge_base {
|
|
25
|
+
/**
|
|
26
|
+
* Editor instance the helper was created for.
|
|
27
|
+
*/
|
|
28
|
+
protected readonly editor: Editor;
|
|
29
|
+
/**
|
|
30
|
+
* A reference to the balloon panel hosting and positioning the badge content.
|
|
31
|
+
*/
|
|
32
|
+
private _balloonView;
|
|
33
|
+
/**
|
|
34
|
+
* A throttled version of the {@link #_showBalloon} method meant for frequent use to avoid performance loss.
|
|
35
|
+
*/
|
|
36
|
+
private _showBalloonThrottled;
|
|
37
|
+
/**
|
|
38
|
+
* A reference to the last editable element (root, source editing area, etc.) focused by the user.
|
|
39
|
+
* Since the focus can move to other focusable elements in the UI, this reference allows positioning the balloon over the
|
|
40
|
+
* right element whether the user is typing or using the UI.
|
|
41
|
+
*/
|
|
42
|
+
private _lastFocusedEditableElement;
|
|
43
|
+
/**
|
|
44
|
+
* An additional CSS class added to the `BalloonView`.
|
|
45
|
+
*/
|
|
46
|
+
private readonly _balloonClass;
|
|
47
|
+
/**
|
|
48
|
+
* Creates a badge for a given editor. The feature is initialized on Editor#ready
|
|
49
|
+
* event.
|
|
50
|
+
*/
|
|
51
|
+
protected constructor(editor: Editor, options?: {
|
|
52
|
+
balloonClass?: string;
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Destroys the badge along with its view.
|
|
56
|
+
*/
|
|
57
|
+
destroy(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Enables badge label once the editor (ui) is ready.
|
|
60
|
+
*/
|
|
61
|
+
protected _handleEditorReady(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Returns normalized configuration for the badge.
|
|
64
|
+
*/
|
|
65
|
+
protected _getNormalizedConfig(): BadgeConfig;
|
|
66
|
+
/**
|
|
67
|
+
* Creates the badge content.
|
|
68
|
+
*/
|
|
69
|
+
protected abstract _createBadgeContent(): View<HTMLElement>;
|
|
70
|
+
/**
|
|
71
|
+
* Enables the badge feature.
|
|
72
|
+
*/
|
|
73
|
+
protected abstract _isEnabled(): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Attempts to display the balloon with the badge view.
|
|
76
|
+
*/
|
|
77
|
+
private _showBalloon;
|
|
78
|
+
/**
|
|
79
|
+
* Hides the badge balloon if already visible.
|
|
80
|
+
*/
|
|
81
|
+
private _hideBalloon;
|
|
82
|
+
/**
|
|
83
|
+
* Creates an instance of the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView balloon panel}
|
|
84
|
+
* with the badge view inside ready for positioning.
|
|
85
|
+
*/
|
|
86
|
+
private _createBalloonView;
|
|
87
|
+
/**
|
|
88
|
+
* Returns the options for attaching the balloon to the focused editable element.
|
|
89
|
+
*/
|
|
90
|
+
private _getBalloonAttachOptions;
|
|
91
|
+
/**
|
|
92
|
+
* Updates the {@link #_lastFocusedEditableElement} based on the state of the global focus tracker.
|
|
93
|
+
*/
|
|
94
|
+
private _updateLastFocusedEditableElement;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The badge configuration options.
|
|
98
|
+
**/
|
|
99
|
+
export interface BadgeConfig {
|
|
100
|
+
/**
|
|
101
|
+
* The position of the badge.
|
|
102
|
+
*
|
|
103
|
+
* * When `'inside'`, the badge will be displayed within the boundaries of the editing area.
|
|
104
|
+
* * When `'border'`, the basge will be displayed over the bottom border of the editing area.
|
|
105
|
+
*
|
|
106
|
+
* @default 'border'
|
|
107
|
+
*/
|
|
108
|
+
position: 'inside' | 'border';
|
|
109
|
+
/**
|
|
110
|
+
* Allows choosing the side of the editing area where the badge will be displayed.
|
|
111
|
+
*
|
|
112
|
+
* **Note:** If {@link module:core/editor/editorconfig~EditorConfig#language `config.language`} is set to an RTL (right-to-left)
|
|
113
|
+
* language, the side switches to `'left'` by default.
|
|
114
|
+
*
|
|
115
|
+
* @default 'right'
|
|
116
|
+
*/
|
|
117
|
+
side: 'left' | 'right';
|
|
118
|
+
/**
|
|
119
|
+
* The vertical distance the badge can be moved away from its default position.
|
|
120
|
+
*
|
|
121
|
+
* **Note:** If `position` is `'border'`, the offset is measured from the (vertical) center of the badge.
|
|
122
|
+
*
|
|
123
|
+
* @default 5
|
|
124
|
+
*/
|
|
125
|
+
verticalOffset: number;
|
|
126
|
+
/**
|
|
127
|
+
* The horizontal distance between the side of the editing root and the nearest side of the badge.
|
|
128
|
+
*
|
|
129
|
+
* @default 5
|
|
130
|
+
*/
|
|
131
|
+
horizontalOffset: number;
|
|
132
|
+
}
|
|
133
|
+
export {};
|
|
@@ -193,6 +193,12 @@ export default class DropdownView extends View<HTMLDivElement> {
|
|
|
193
193
|
* utility considering the direction of the language the UI of the editor is displayed in.
|
|
194
194
|
*/
|
|
195
195
|
private get _panelPositions();
|
|
196
|
+
/**
|
|
197
|
+
* Returns the default position of the dropdown panel based on the direction of the UI language.
|
|
198
|
+
* It is used when the {@link #panelPosition} is set to `'auto'` and the panel has not found a
|
|
199
|
+
* suitable position to fit into the viewport.
|
|
200
|
+
*/
|
|
201
|
+
private get _defaultPanelPositionName();
|
|
196
202
|
/**
|
|
197
203
|
* A set of positioning functions used by the dropdown view to determine
|
|
198
204
|
* the optimal position (i.e. fitting into the browser viewport) of its
|
|
@@ -10,20 +10,51 @@ import ViewCollection from '../viewcollection.js';
|
|
|
10
10
|
import type View from '../view.js';
|
|
11
11
|
import { type Locale } from '@ckeditor/ckeditor5-utils';
|
|
12
12
|
/**
|
|
13
|
-
* This is a special {@link module:ui/viewcollection~ViewCollection} dedicated to elements that are detached
|
|
14
|
-
*
|
|
13
|
+
* This is a special {@link module:ui/viewcollection~ViewCollection} dedicated to elements that are detached from the DOM structure of
|
|
14
|
+
* the editor, like floating panels, floating toolbars, dialogs, etc.
|
|
15
15
|
*
|
|
16
|
-
* The body collection is available
|
|
16
|
+
* The body collection is available under the {@link module:ui/editorui/editoruiview~EditorUIView#body `editor.ui.view.body`} property.
|
|
17
17
|
* Any plugin can add a {@link module:ui/view~View view} to this collection.
|
|
18
|
-
* These views will render in a container placed directly in the `<body>` element.
|
|
19
|
-
* The editor will detach and destroy this collection when the editor will be {@link module:core/editor/editor~Editor#destroy destroyed}.
|
|
20
18
|
*
|
|
21
|
-
*
|
|
19
|
+
* All views added to a body collection render in a dedicated DOM container (`<div class="ck ck-body ...">...</div>`). All body collection
|
|
20
|
+
* containers render in a common shared (`<div class="ck-body-wrapper">...</div>`) in the DOM to limit the pollution of
|
|
21
|
+
* the `<body>` element. The resulting DOM structure is as follows:
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
23
|
+
* ```html
|
|
24
|
+
* <body>
|
|
25
|
+
* <!-- Content of the webpage... -->
|
|
26
|
+
*
|
|
27
|
+
* <!-- The shared wrapper for all body collection containers. -->
|
|
28
|
+
* <div class="ck-body-wrapper">
|
|
29
|
+
* <!-- The container of the first body collection instance. -->
|
|
30
|
+
* <div class="ck ck-body ...">
|
|
31
|
+
* <!-- View elements belonging to the first body collection -->
|
|
32
|
+
* </div>
|
|
33
|
+
*
|
|
34
|
+
* <!-- The container of the second body collection instance. -->
|
|
35
|
+
* <div class="ck ck-body ...">...</div>
|
|
36
|
+
*
|
|
37
|
+
* <!-- More body collection containers for the rest of instances... -->
|
|
38
|
+
* </div>
|
|
39
|
+
* </body>
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* By default, the {@link module:ui/editorui/editoruiview~EditorUIView `editor.ui.view`} manages the life cycle of the
|
|
43
|
+
* {@link module:ui/editorui/editoruiview~EditorUIView#body `editor.ui.view.body`} collection, attaching and detaching it
|
|
44
|
+
* when the editor gets created or {@link module:core/editor/editor~Editor#destroy destroyed}.
|
|
45
|
+
*
|
|
46
|
+
* # Custom body collection instances
|
|
47
|
+
*
|
|
48
|
+
* Even though most editor instances come with a built-in body collection
|
|
49
|
+
* ({@link module:ui/editorui/editoruiview~EditorUIView#body `editor.ui.view.body`}), you can create your own instance of this
|
|
50
|
+
* class if you need to control their life cycle.
|
|
51
|
+
*
|
|
52
|
+
* The life cycle of a custom body collection must be handled manually by the developer using the dedicated API:
|
|
53
|
+
* * A body collection will render itself automatically in the DOM as soon as you call {@link ~BodyCollection#attachToDom}.
|
|
54
|
+
* * Calling {@link ~BodyCollection#detachFromDom} will remove the collection from the DOM.
|
|
55
|
+
*
|
|
56
|
+
* **Note**: The shared collection wrapper (`<div class="ck-body-wrapper">...</div>`) gets automatically removed from DOM when the
|
|
57
|
+
* last body collection is {@link ~BodyCollection#detachFromDom detached} and does not require any special handling.
|
|
27
58
|
*/
|
|
28
59
|
export default class BodyCollection extends ViewCollection {
|
|
29
60
|
/**
|
|
@@ -32,9 +63,13 @@ export default class BodyCollection extends ViewCollection {
|
|
|
32
63
|
*/
|
|
33
64
|
readonly locale: Locale;
|
|
34
65
|
/**
|
|
35
|
-
* The element holding elements of the body
|
|
66
|
+
* The element holding elements of the body collection.
|
|
36
67
|
*/
|
|
37
68
|
private _bodyCollectionContainer?;
|
|
69
|
+
/**
|
|
70
|
+
* The wrapper element that holds all of the {@link #_bodyCollectionContainer} elements.
|
|
71
|
+
*/
|
|
72
|
+
private static _bodyWrapper?;
|
|
38
73
|
/**
|
|
39
74
|
* Creates a new instance of the {@link module:ui/editorui/bodycollection~BodyCollection}.
|
|
40
75
|
*
|
|
@@ -43,7 +78,7 @@ export default class BodyCollection extends ViewCollection {
|
|
|
43
78
|
*/
|
|
44
79
|
constructor(locale: Locale, initialItems?: Iterable<View>);
|
|
45
80
|
/**
|
|
46
|
-
* The element holding elements of the body
|
|
81
|
+
* The element holding elements of the body collection.
|
|
47
82
|
*/
|
|
48
83
|
get bodyCollectionContainer(): HTMLElement | undefined;
|
|
49
84
|
/**
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import ComponentFactory from '../componentfactory.js';
|
|
13
13
|
import TooltipManager from '../tooltipmanager.js';
|
|
14
14
|
import PoweredBy from './poweredby.js';
|
|
15
|
+
import EvaluationBadge from './evaluationbadge.js';
|
|
15
16
|
import AriaLiveAnnouncer from '../arialiveannouncer.js';
|
|
16
17
|
import type EditorUIView from './editoruiview.js';
|
|
17
18
|
import type ToolbarView from '../toolbar/toolbarview.js';
|
|
@@ -48,6 +49,10 @@ export default abstract class EditorUI extends /* #__PURE__ */ EditorUI_base {
|
|
|
48
49
|
* A helper that enables the "powered by" feature in the editor and renders a link to the project's webpage.
|
|
49
50
|
*/
|
|
50
51
|
readonly poweredBy: PoweredBy;
|
|
52
|
+
/**
|
|
53
|
+
* A helper that enables the "evaluation badge" feature in the editor.
|
|
54
|
+
*/
|
|
55
|
+
readonly evaluationBadge: EvaluationBadge;
|
|
51
56
|
/**
|
|
52
57
|
* A helper that manages the content of an `aria-live` regions used by editor features to announce status changes
|
|
53
58
|
* to screen readers.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module ui/editorui/evaluationbadge
|
|
11
|
+
*/
|
|
12
|
+
import type { Editor } from '@ckeditor/ckeditor5-core';
|
|
13
|
+
import View from '../view.js';
|
|
14
|
+
import Badge, { type BadgeConfig } from '../badge/badge.js';
|
|
15
|
+
/**
|
|
16
|
+
* A helper that enables the "evaluation badge" feature in the editor at the bottom of the editable element
|
|
17
|
+
* (editor root, source editing area, etc.) when the editor is focused.
|
|
18
|
+
*
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
21
|
+
export default class EvaluationBadge extends Badge {
|
|
22
|
+
private licenseTypeMessage;
|
|
23
|
+
constructor(editor: Editor);
|
|
24
|
+
/**
|
|
25
|
+
* Enables "evaluation badge" label.
|
|
26
|
+
*/
|
|
27
|
+
protected _isEnabled(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Creates the content of the "evaluation badge".
|
|
30
|
+
*/
|
|
31
|
+
protected _createBadgeContent(): View<HTMLElement>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the normalized configuration for the "evaluation badge".
|
|
34
|
+
* It takes 'ui.poweredBy' configuration into account to determine the badge position and side.
|
|
35
|
+
*/
|
|
36
|
+
protected _getNormalizedConfig(): BadgeConfig;
|
|
37
|
+
}
|
|
@@ -9,67 +9,30 @@
|
|
|
9
9
|
/**
|
|
10
10
|
* @module ui/editorui/poweredby
|
|
11
11
|
*/
|
|
12
|
-
import type { Editor } from '@ckeditor/ckeditor5-core';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
12
|
+
import type { Editor, UiConfig } from '@ckeditor/ckeditor5-core';
|
|
13
|
+
import View from '../view.js';
|
|
14
|
+
import Badge from '../badge/badge.js';
|
|
15
|
+
type PoweredByConfig = Required<UiConfig>['poweredBy'];
|
|
17
16
|
/**
|
|
18
17
|
* A helper that enables the "powered by" feature in the editor and renders a link to the project's
|
|
19
18
|
* webpage next to the bottom of the editable element (editor root, source editing area, etc.) when the editor is focused.
|
|
20
19
|
*
|
|
21
20
|
* @private
|
|
22
21
|
*/
|
|
23
|
-
export default class PoweredBy extends
|
|
24
|
-
/**
|
|
25
|
-
* Editor instance the helper was created for.
|
|
26
|
-
*/
|
|
27
|
-
private readonly editor;
|
|
28
|
-
/**
|
|
29
|
-
* A reference to the balloon panel hosting and positioning the "powered by" link and logo.
|
|
30
|
-
*/
|
|
31
|
-
private _balloonView;
|
|
32
|
-
/**
|
|
33
|
-
* A throttled version of the {@link #_showBalloon} method meant for frequent use to avoid performance loss.
|
|
34
|
-
*/
|
|
35
|
-
private _showBalloonThrottled;
|
|
36
|
-
/**
|
|
37
|
-
* A reference to the last editable element (root, source editing area, etc.) focused by the user.
|
|
38
|
-
* Since the focus can move to other focusable elements in the UI, this reference allows positioning the balloon over the
|
|
39
|
-
* right element whether the user is typing or using the UI.
|
|
40
|
-
*/
|
|
41
|
-
private _lastFocusedEditableElement;
|
|
42
|
-
/**
|
|
43
|
-
* Creates a "powered by" helper for a given editor. The feature is initialized on Editor#ready
|
|
44
|
-
* event.
|
|
45
|
-
*
|
|
46
|
-
* @param editor
|
|
47
|
-
*/
|
|
22
|
+
export default class PoweredBy extends Badge {
|
|
48
23
|
constructor(editor: Editor);
|
|
49
24
|
/**
|
|
50
|
-
*
|
|
51
|
-
*/
|
|
52
|
-
destroy(): void;
|
|
53
|
-
/**
|
|
54
|
-
* Enables "powered by" label once the editor (ui) is ready.
|
|
55
|
-
*/
|
|
56
|
-
private _handleEditorReady;
|
|
57
|
-
/**
|
|
58
|
-
* Creates an instance of the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView balloon panel}
|
|
59
|
-
* with the "powered by" view inside ready for positioning.
|
|
60
|
-
*/
|
|
61
|
-
private _createBalloonView;
|
|
62
|
-
/**
|
|
63
|
-
* Attempts to display the balloon with the "powered by" view.
|
|
25
|
+
* Enables "powered by" label.
|
|
64
26
|
*/
|
|
65
|
-
|
|
27
|
+
protected _isEnabled(): boolean;
|
|
66
28
|
/**
|
|
67
|
-
*
|
|
29
|
+
* Creates a "powered by" badge content.
|
|
68
30
|
*/
|
|
69
|
-
|
|
31
|
+
protected _createBadgeContent(): View<HTMLElement>;
|
|
70
32
|
/**
|
|
71
|
-
*
|
|
33
|
+
* Returns the normalized configuration for the "powered by" badge.
|
|
34
|
+
* It takes the user configuration into account and falls back to the default one.
|
|
72
35
|
*/
|
|
73
|
-
|
|
36
|
+
protected _getNormalizedConfig(): Required<PoweredByConfig>;
|
|
74
37
|
}
|
|
75
38
|
export {};
|
package/dist/index-editor.css
CHANGED
|
@@ -15,13 +15,20 @@
|
|
|
15
15
|
transition:none !important;
|
|
16
16
|
}
|
|
17
17
|
:root{
|
|
18
|
-
--ck-powered-by-
|
|
18
|
+
--ck-powered-by-font-size:calc(var(--ck-font-size-base) * 7.5 / 13);
|
|
19
|
+
--ck-powered-by-line-height:calc(var(--ck-font-size-base) * 10 / 13);
|
|
20
|
+
--ck-powered-by-letter-spacing:calc(var(--ck-font-size-base) * -0.2 / 13);
|
|
19
21
|
--ck-powered-by-padding-vertical:2px;
|
|
20
22
|
--ck-powered-by-padding-horizontal:4px;
|
|
21
23
|
--ck-powered-by-text-color:hsl(0, 0%, 31%);
|
|
22
24
|
--ck-powered-by-border-radius:var(--ck-border-radius);
|
|
23
25
|
--ck-powered-by-background:hsl(0, 0%, 100%);
|
|
24
26
|
--ck-powered-by-border-color:var(--ck-color-focus-border);
|
|
27
|
+
|
|
28
|
+
--ck-powered-by-svg-width:53;
|
|
29
|
+
--ck-powered-by-svg-height:10;
|
|
30
|
+
--ck-powered-by-icon-width:calc(var(--ck-font-size-base) * var(--ck-powered-by-svg-width) / 13);
|
|
31
|
+
--ck-powered-by-icon-height:calc(var(--ck-font-size-base) * var(--ck-powered-by-svg-height) / 13);
|
|
25
32
|
}
|
|
26
33
|
.ck.ck-balloon-panel.ck-powered-by-balloon{
|
|
27
34
|
--ck-border-radius:var(--ck-powered-by-border-radius);
|
|
@@ -44,8 +51,8 @@
|
|
|
44
51
|
padding:var(--ck-powered-by-padding-vertical) var(--ck-powered-by-padding-horizontal);
|
|
45
52
|
}
|
|
46
53
|
.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-powered-by__label{
|
|
47
|
-
font-size:
|
|
48
|
-
letter-spacing
|
|
54
|
+
font-size:var(--ck-powered-by-font-size);
|
|
55
|
+
letter-spacing:var(--ck-powered-by-letter-spacing);
|
|
49
56
|
padding-left:2px;
|
|
50
57
|
text-transform:uppercase;
|
|
51
58
|
font-weight:bold;
|
|
@@ -58,6 +65,8 @@
|
|
|
58
65
|
.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-icon{
|
|
59
66
|
display:block;
|
|
60
67
|
cursor:pointer;
|
|
68
|
+
width:var(--ck-powered-by-icon-width);
|
|
69
|
+
height:var(--ck-powered-by-icon-height);
|
|
61
70
|
}
|
|
62
71
|
.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by:hover a{
|
|
63
72
|
filter:grayscale(0%);
|
|
@@ -70,6 +79,46 @@
|
|
|
70
79
|
border:var(--ck-focus-ring);
|
|
71
80
|
border-color:var(--ck-powered-by-border-color);
|
|
72
81
|
}
|
|
82
|
+
:root{
|
|
83
|
+
--ck-evaluation-badge-font-size:calc(var(--ck-font-size-base) * 7.5 / 13);
|
|
84
|
+
--ck-evaluation-badge-line-height:calc(var(--ck-font-size-base) * 7.5 / 13);
|
|
85
|
+
--ck-evaluation-badge-letter-spacing:calc(var(--ck-font-size-base) * -0.2 / 13);
|
|
86
|
+
--ck-evaluation-badge-padding-vertical:2px;
|
|
87
|
+
--ck-evaluation-badge-padding-horizontal:4px;
|
|
88
|
+
--ck-evaluation-badge-text-color:hsl(0, 0%, 31%);
|
|
89
|
+
--ck-evaluation-badge-border-radius:var(--ck-border-radius);
|
|
90
|
+
--ck-evaluation-badge-background:hsl(0, 0%, 100%);
|
|
91
|
+
--ck-evaluation-badge-border-color:var(--ck-color-focus-border);
|
|
92
|
+
}
|
|
93
|
+
.ck.ck-balloon-panel.ck-evaluation-badge-balloon{
|
|
94
|
+
--ck-border-radius:var(--ck-evaluation-badge-border-radius);
|
|
95
|
+
|
|
96
|
+
box-shadow:none;
|
|
97
|
+
background:var(--ck-evaluation-badge-background);
|
|
98
|
+
min-height:unset;
|
|
99
|
+
z-index:calc( var(--ck-z-panel) - 1);
|
|
100
|
+
}
|
|
101
|
+
.ck.ck-balloon-panel.ck-evaluation-badge-balloon .ck.ck-evaluation-badge{
|
|
102
|
+
line-height:var(--ck-evaluation-badge-line-height);
|
|
103
|
+
padding:var(--ck-evaluation-badge-padding-vertical) var(--ck-evaluation-badge-padding-horizontal);
|
|
104
|
+
}
|
|
105
|
+
.ck.ck-balloon-panel.ck-evaluation-badge-balloon .ck.ck-evaluation-badge .ck-evaluation-badge__label{
|
|
106
|
+
display:block;
|
|
107
|
+
padding:0 2px;
|
|
108
|
+
font-size:var(--ck-evaluation-badge-font-size);
|
|
109
|
+
letter-spacing:var(--ck-evaluation-badge-letter-spacing);
|
|
110
|
+
font-weight:bold;
|
|
111
|
+
line-height:normal;
|
|
112
|
+
text-transform:uppercase;
|
|
113
|
+
color:var(--ck-evaluation-badge-text-color);
|
|
114
|
+
}
|
|
115
|
+
.ck.ck-balloon-panel.ck-evaluation-badge-balloon[class*="position_inside"]{
|
|
116
|
+
border-color:transparent;
|
|
117
|
+
}
|
|
118
|
+
.ck.ck-balloon-panel.ck-evaluation-badge-balloon[class*="position_border"]{
|
|
119
|
+
border:var(--ck-focus-ring);
|
|
120
|
+
border-color:var(--ck-evaluation-badge-border-color);
|
|
121
|
+
}
|
|
73
122
|
|
|
74
123
|
.ck.ck-button,
|
|
75
124
|
a.ck.ck-button{
|
package/dist/index.css
CHANGED
|
@@ -46,13 +46,23 @@
|
|
|
46
46
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
47
47
|
*/
|
|
48
48
|
:root {
|
|
49
|
-
|
|
49
|
+
/* where 7.5(px) is the font size of the powered by label and 13(px) is the base font size. */
|
|
50
|
+
--ck-powered-by-font-size: calc(var(--ck-font-size-base) * 7.5 / 13);
|
|
51
|
+
/* where 10(px) is the line height of the powered by label and 13(px) is the base font size. */
|
|
52
|
+
--ck-powered-by-line-height: calc(var(--ck-font-size-base) * 10 / 13);
|
|
53
|
+
/* where -0.2(px) is the letter spacing of the powered by label and 13(px) is the base font size. */
|
|
54
|
+
--ck-powered-by-letter-spacing: calc(var(--ck-font-size-base) * -0.2 / 13);
|
|
50
55
|
--ck-powered-by-padding-vertical: 2px;
|
|
51
56
|
--ck-powered-by-padding-horizontal: 4px;
|
|
52
57
|
--ck-powered-by-text-color: hsl(0, 0%, 31%);
|
|
53
58
|
--ck-powered-by-border-radius: var(--ck-border-radius);
|
|
54
59
|
--ck-powered-by-background: hsl(0, 0%, 100%);
|
|
55
60
|
--ck-powered-by-border-color: var(--ck-color-focus-border);
|
|
61
|
+
|
|
62
|
+
--ck-powered-by-svg-width: 53;
|
|
63
|
+
--ck-powered-by-svg-height: 10;
|
|
64
|
+
--ck-powered-by-icon-width: calc(var(--ck-font-size-base) * var(--ck-powered-by-svg-width) / 13);
|
|
65
|
+
--ck-powered-by-icon-height: calc(var(--ck-font-size-base) * var(--ck-powered-by-svg-height) / 13);
|
|
56
66
|
}
|
|
57
67
|
.ck.ck-balloon-panel.ck-powered-by-balloon {
|
|
58
68
|
--ck-border-radius: var(--ck-powered-by-border-radius);
|
|
@@ -75,8 +85,8 @@
|
|
|
75
85
|
padding: var(--ck-powered-by-padding-vertical) var(--ck-powered-by-padding-horizontal);
|
|
76
86
|
}
|
|
77
87
|
.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-powered-by__label {
|
|
78
|
-
font-size:
|
|
79
|
-
letter-spacing:
|
|
88
|
+
font-size: var(--ck-powered-by-font-size);
|
|
89
|
+
letter-spacing: var(--ck-powered-by-letter-spacing);
|
|
80
90
|
padding-left: 2px;
|
|
81
91
|
text-transform: uppercase;
|
|
82
92
|
font-weight: bold;
|
|
@@ -89,6 +99,8 @@
|
|
|
89
99
|
.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-icon {
|
|
90
100
|
display: block;
|
|
91
101
|
cursor: pointer;
|
|
102
|
+
width: var(--ck-powered-by-icon-width);
|
|
103
|
+
height: var(--ck-powered-by-icon-height);
|
|
92
104
|
}
|
|
93
105
|
.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by:hover a {
|
|
94
106
|
filter: grayscale(0%);
|
|
@@ -101,6 +113,53 @@
|
|
|
101
113
|
border: var(--ck-focus-ring);
|
|
102
114
|
border-color: var(--ck-powered-by-border-color);
|
|
103
115
|
}
|
|
116
|
+
/*
|
|
117
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
118
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
119
|
+
*/
|
|
120
|
+
:root {
|
|
121
|
+
/* where 7.5(px) is the font size of the evaluation badge label and 13(px) is the base font size. */
|
|
122
|
+
--ck-evaluation-badge-font-size: calc(var(--ck-font-size-base) * 7.5 / 13);
|
|
123
|
+
/* where 7.5(px) is the line height of the evaluation badge label and 13(px) is the base font size. */
|
|
124
|
+
--ck-evaluation-badge-line-height: calc(var(--ck-font-size-base) * 7.5 / 13);
|
|
125
|
+
/* where -0.2(px) is the letter spacing of the evaluation badge label and 13(px) is the base font size. */
|
|
126
|
+
--ck-evaluation-badge-letter-spacing: calc(var(--ck-font-size-base) * -0.2 / 13);
|
|
127
|
+
--ck-evaluation-badge-padding-vertical: 2px;
|
|
128
|
+
--ck-evaluation-badge-padding-horizontal: 4px;
|
|
129
|
+
--ck-evaluation-badge-text-color: hsl(0, 0%, 31%);
|
|
130
|
+
--ck-evaluation-badge-border-radius: var(--ck-border-radius);
|
|
131
|
+
--ck-evaluation-badge-background: hsl(0, 0%, 100%);
|
|
132
|
+
--ck-evaluation-badge-border-color: var(--ck-color-focus-border);
|
|
133
|
+
}
|
|
134
|
+
.ck.ck-balloon-panel.ck-evaluation-badge-balloon {
|
|
135
|
+
--ck-border-radius: var(--ck-evaluation-badge-border-radius);
|
|
136
|
+
|
|
137
|
+
box-shadow: none;
|
|
138
|
+
background: var(--ck-evaluation-badge-background);
|
|
139
|
+
min-height: unset;
|
|
140
|
+
z-index: calc( var(--ck-z-panel) - 1 );
|
|
141
|
+
}
|
|
142
|
+
.ck.ck-balloon-panel.ck-evaluation-badge-balloon .ck.ck-evaluation-badge {
|
|
143
|
+
line-height: var(--ck-evaluation-badge-line-height);
|
|
144
|
+
padding: var(--ck-evaluation-badge-padding-vertical) var(--ck-evaluation-badge-padding-horizontal);
|
|
145
|
+
}
|
|
146
|
+
.ck.ck-balloon-panel.ck-evaluation-badge-balloon .ck.ck-evaluation-badge .ck-evaluation-badge__label {
|
|
147
|
+
display: block;
|
|
148
|
+
padding: 0 2px;
|
|
149
|
+
font-size: var(--ck-evaluation-badge-font-size);
|
|
150
|
+
letter-spacing: var(--ck-evaluation-badge-letter-spacing);
|
|
151
|
+
font-weight: bold;
|
|
152
|
+
line-height: normal;
|
|
153
|
+
text-transform: uppercase;
|
|
154
|
+
color: var(--ck-evaluation-badge-text-color);
|
|
155
|
+
}
|
|
156
|
+
.ck.ck-balloon-panel.ck-evaluation-badge-balloon[class*="position_inside"] {
|
|
157
|
+
border-color: transparent;
|
|
158
|
+
}
|
|
159
|
+
.ck.ck-balloon-panel.ck-evaluation-badge-balloon[class*="position_border"] {
|
|
160
|
+
border: var(--ck-focus-ring);
|
|
161
|
+
border-color: var(--ck-evaluation-badge-border-color);
|
|
162
|
+
}
|
|
104
163
|
|
|
105
164
|
/*
|
|
106
165
|
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|