@ckeditor/ckeditor5-editor-balloon 41.3.0-alpha.3 → 41.3.0

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-editor-balloon",
3
- "version": "41.3.0-alpha.3",
3
+ "version": "41.3.0",
4
4
  "description": "Balloon editor implementation for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,7 +12,7 @@
12
12
  "type": "module",
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "ckeditor5": "41.3.0-alpha.3",
15
+ "ckeditor5": "41.3.0",
16
16
  "lodash-es": "4.17.21"
17
17
  },
18
18
  "author": "CKSource (http://cksource.com/)",
@@ -25,7 +25,6 @@
25
25
  "directory": "packages/ckeditor5-editor-balloon"
26
26
  },
27
27
  "files": [
28
- "dist",
29
28
  "lang",
30
29
  "src/**/*.js",
31
30
  "src/**/*.d.ts",
@@ -1,4 +0,0 @@
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
- */
@@ -1,4 +0,0 @@
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
- */
package/dist/index.css DELETED
@@ -1,4 +0,0 @@
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
- */
@@ -1,181 +0,0 @@
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 editor-balloon/ballooneditor
11
- */
12
- import { Editor, Context, type EditorConfig } from 'ckeditor5/src/core.js';
13
- import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog.js';
14
- import BalloonEditorUI from './ballooneditorui.js';
15
- declare const BalloonEditor_base: import("ckeditor5/src/utils.js").Mixed<typeof Editor, import("ckeditor5/src/core.js").ElementApi>;
16
- /**
17
- * The {@glink installation/getting-started/predefined-builds#balloon-editor balloon editor}
18
- * implementation (Medium-like editor).
19
- * It uses an inline editable and a toolbar based on the {@link module:ui/toolbar/balloon/balloontoolbar~BalloonToolbar}.
20
- * See the {@glink examples/builds/balloon-editor demo}.
21
- *
22
- * In order to create a balloon editor instance, use the static
23
- * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`} method.
24
- *
25
- * # Balloon editor and balloon build
26
- *
27
- * The balloon editor can be used directly from source (if you installed the
28
- * [`@ckeditor/ckeditor5-editor-balloon`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-balloon) package)
29
- * but it is also available in the {@glink installation/getting-started/predefined-builds#balloon-editor balloon build}.
30
- *
31
- * {@glink installation/getting-started/predefined-builds Builds}
32
- * are ready-to-use editors with plugins bundled in. When using the editor from
33
- * source you need to take care of loading all plugins by yourself
34
- * (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).
35
- * Using the editor from source gives much better flexibility and allows easier customization.
36
- *
37
- * Read more about initializing the editor from source or as a build in
38
- * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}.
39
- */
40
- export default class BalloonEditor extends BalloonEditor_base {
41
- /**
42
- * @inheritDoc
43
- */
44
- readonly ui: BalloonEditorUI;
45
- /**
46
- * Creates an instance of the balloon editor.
47
- *
48
- * **Note:** do not use the constructor to create editor instances. Use the static
49
- * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`} method instead.
50
- *
51
- * @param sourceElementOrData The DOM element that will be the source for the created editor
52
- * (on which the editor will be initialized) or initial data for the editor. For more information see
53
- * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}.
54
- * @param config The editor configuration.
55
- */
56
- protected constructor(sourceElementOrData: HTMLElement | string, config?: EditorConfig);
57
- /**
58
- * Destroys the editor instance, releasing all resources used by it.
59
- *
60
- * Updates the original editor element with the data if the
61
- * {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy `updateSourceElementOnDestroy`}
62
- * configuration option is set to `true`.
63
- */
64
- destroy(): Promise<unknown>;
65
- /**
66
- * Creates a new balloon editor instance.
67
- *
68
- * There are three general ways how the editor can be initialized.
69
- *
70
- * # Using an existing DOM element (and loading data from it)
71
- *
72
- * You can initialize the editor using an existing DOM element:
73
- *
74
- * ```ts
75
- * BalloonEditor
76
- * .create( document.querySelector( '#editor' ) )
77
- * .then( editor => {
78
- * console.log( 'Editor was initialized', editor );
79
- * } )
80
- * .catch( err => {
81
- * console.error( err.stack );
82
- * } );
83
- * ```
84
- *
85
- * The element's content will be used as the editor data and the element will become the editable element.
86
- *
87
- * # Creating a detached editor
88
- *
89
- * Alternatively, you can initialize the editor by passing the initial data directly as a string.
90
- * In this case, the editor will render an element that must be inserted into the DOM for the editor to work properly:
91
- *
92
- * ```ts
93
- * BalloonEditor
94
- * .create( '<p>Hello world!</p>' )
95
- * .then( editor => {
96
- * console.log( 'Editor was initialized', editor );
97
- *
98
- * // Initial data was provided so the editor UI element needs to be added manually to the DOM.
99
- * document.body.appendChild( editor.ui.element );
100
- * } )
101
- * .catch( err => {
102
- * console.error( err.stack );
103
- * } );
104
- * ```
105
- *
106
- * This lets you dynamically append the editor to your web page whenever it is convenient for you. You may use this method if your
107
- * web page content is generated on the client side and the DOM structure is not ready at the moment when you initialize the editor.
108
- *
109
- * # Using an existing DOM element (and data provided in `config.initialData`)
110
- *
111
- * You can also mix these two ways by providing a DOM element to be used and passing the initial data through the configuration:
112
- *
113
- * ```ts
114
- * BalloonEditor
115
- * .create( document.querySelector( '#editor' ), {
116
- * initialData: '<h2>Initial data</h2><p>Foo bar.</p>'
117
- * } )
118
- * .then( editor => {
119
- * console.log( 'Editor was initialized', editor );
120
- * } )
121
- * .catch( err => {
122
- * console.error( err.stack );
123
- * } );
124
- * ```
125
- *
126
- * This method can be used to initialize the editor on an existing element with the specified content in case if your integration
127
- * makes it difficult to set the content of the source element.
128
- *
129
- * Note that an error will be thrown if you pass the initial data both as the first parameter and also in the configuration.
130
- *
131
- * # Configuring the editor
132
- *
133
- * See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about
134
- * customizing plugins, toolbar and more.
135
- *
136
- * # Using the editor from source
137
- *
138
- * The code samples listed in the previous sections of this documentation assume that you are using an
139
- * {@glink installation/getting-started/predefined-builds editor build} (for example – `@ckeditor/ckeditor5-build-balloon`).
140
- *
141
- * If you want to use the balloon editor from source (`@ckeditor/ckeditor5-editor-balloon/src/ballooneditor`),
142
- * you need to define the list of
143
- * {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and
144
- * {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from
145
- * source in the {@glink installation/advanced/alternative-setups/integrating-from-source-webpack dedicated guide}.
146
- *
147
- * @param sourceElementOrData The DOM element that will be the source for the created editor
148
- * or the editor's initial data.
149
- *
150
- * If a DOM element is passed, its content will be automatically loaded to the editor upon initialization.
151
- * The editor data will be set back to the original element once the editor is destroyed only if the
152
- * {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy updateSourceElementOnDestroy}
153
- * option is set to `true`.
154
- *
155
- * If the initial data is passed, a detached editor will be created. In this case you need to insert it into the DOM manually.
156
- * It is available under the {@link module:editor-balloon/ballooneditorui~BalloonEditorUI#element `editor.ui.element`} property.
157
- *
158
- * @param config The editor configuration.
159
- * @returns A promise resolved once the editor is ready. The promise resolves with the created editor instance.
160
- */
161
- static create(sourceElementOrData: HTMLElement | string, config?: EditorConfig): Promise<BalloonEditor>;
162
- /**
163
- * The {@link module:core/context~Context} class.
164
- *
165
- * Exposed as static editor field for easier access in editor builds.
166
- */
167
- static Context: typeof Context;
168
- /**
169
- * The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.
170
- *
171
- * Exposed as static editor field for easier access in editor builds.
172
- */
173
- static EditorWatchdog: typeof EditorWatchdog;
174
- /**
175
- * The {@link module:watchdog/contextwatchdog~ContextWatchdog} class.
176
- *
177
- * Exposed as static editor field for easier access in editor builds.
178
- */
179
- static ContextWatchdog: typeof ContextWatchdog;
180
- }
181
- export {};
@@ -1,46 +0,0 @@
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 editor-balloon/ballooneditorui
11
- */
12
- import { type Editor } from 'ckeditor5/src/core.js';
13
- import { EditorUI } from 'ckeditor5/src/ui.js';
14
- import type BalloonEditorUIView from './ballooneditoruiview.js';
15
- /**
16
- * The balloon editor UI class.
17
- */
18
- export default class BalloonEditorUI extends EditorUI {
19
- /**
20
- * The main (top–most) view of the editor UI.
21
- */
22
- readonly view: BalloonEditorUIView;
23
- /**
24
- * Creates an instance of the balloon editor UI class.
25
- *
26
- * @param editor The editor instance.
27
- * @param view The view of the UI.
28
- */
29
- constructor(editor: Editor, view: BalloonEditorUIView);
30
- /**
31
- * @inheritDoc
32
- */
33
- get element(): HTMLElement | null;
34
- /**
35
- * Initializes the UI.
36
- */
37
- init(): void;
38
- /**
39
- * @inheritDoc
40
- */
41
- destroy(): void;
42
- /**
43
- * Enable the placeholder text on the editing root.
44
- */
45
- private _initPlaceholder;
46
- }
@@ -1,36 +0,0 @@
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 editor-balloon/ballooneditoruiview
11
- */
12
- import { EditorUIView, InlineEditableUIView } from 'ckeditor5/src/ui.js';
13
- import type { Locale } from 'ckeditor5/src/utils.js';
14
- import type { EditingView } from 'ckeditor5/src/engine.js';
15
- /**
16
- * Contextual editor UI view. Uses the {@link module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}.
17
- */
18
- export default class BalloonEditorUIView extends EditorUIView {
19
- /**
20
- * Editable UI view.
21
- */
22
- readonly editable: InlineEditableUIView;
23
- /**
24
- * Creates an instance of the balloon editor UI view.
25
- *
26
- * @param locale The {@link module:core/editor/editor~Editor#locale} instance.
27
- * @param editingView The editing view instance this view is related to.
28
- * @param editableElement The editable element. If not specified, it will be automatically created by
29
- * {@link module:ui/editableui/editableuiview~EditableUIView}. Otherwise, the given element will be used.
30
- */
31
- constructor(locale: Locale, editingView: EditingView, editableElement?: HTMLElement);
32
- /**
33
- * @inheritDoc
34
- */
35
- render(): void;
36
- }
@@ -1,12 +0,0 @@
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 editor-balloon
11
- */
12
- export { default as BalloonEditor } from './ballooneditor.js';