@ckeditor/ckeditor5-editor-classic 0.0.0-nightly-20240603.0 → 0.0.0-nightly-20240604.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.
@@ -7,17 +7,34 @@
7
7
  */
8
8
  import ClassicEditorUI from './classiceditorui.js';
9
9
  import ClassicEditorUIView from './classiceditoruiview.js';
10
- import { Editor, ElementApiMixin, attachToForm } from 'ckeditor5/src/core.js';
10
+ import { Editor, Context, ElementApiMixin, attachToForm } from 'ckeditor5/src/core.js';
11
11
  import { getDataFromElement, CKEditorError } from 'ckeditor5/src/utils.js';
12
+ import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog.js';
12
13
  import { isElement as _isElement } from 'lodash-es';
13
14
  /**
14
- * The classic editor implementation. It uses an inline editable and a sticky toolbar, all enclosed in a boxed UI.
15
+ * The {@glink installation/getting-started/predefined-builds#classic-editor classic editor} implementation.
16
+ * It uses an inline editable and a sticky toolbar, all enclosed in a boxed UI.
15
17
  * See the {@glink examples/builds/classic-editor demo}.
16
18
  *
17
19
  * In order to create a classic editor instance, use the static
18
20
  * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method.
21
+ *
22
+ * # Classic editor and classic build
23
+ *
24
+ * The classic editor can be used directly from source (if you installed the
25
+ * [`@ckeditor/ckeditor5-editor-classic`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-classic) package)
26
+ * but it is also available in the {@glink installation/getting-started/predefined-builds#classic-editor classic build}.
27
+ *
28
+ * {@glink installation/getting-started/predefined-builds Builds}
29
+ * are ready-to-use editors with plugins bundled in. When using the editor from
30
+ * source you need to take care of loading all plugins by yourself
31
+ * (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).
32
+ * Using the editor from source gives much better flexibility and allows easier customization.
33
+ *
34
+ * Read more about initializing the editor from source or as a build in
35
+ * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
19
36
  */
20
- export default class ClassicEditor extends /* #__PURE__ */ ElementApiMixin(Editor) {
37
+ class ClassicEditor extends ElementApiMixin(Editor) {
21
38
  /**
22
39
  * Creates an instance of the classic editor.
23
40
  *
@@ -139,6 +156,17 @@ export default class ClassicEditor extends /* #__PURE__ */ ElementApiMixin(Edito
139
156
  * See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about
140
157
  * customizing plugins, toolbar and more.
141
158
  *
159
+ * # Using the editor from source
160
+ *
161
+ * The code samples listed in the previous sections of this documentation assume that you are using an
162
+ * {@glink installation/getting-started/predefined-builds editor build} (for example – `@ckeditor/ckeditor5-build-classic`).
163
+ *
164
+ * If you want to use the classic editor from source (`@ckeditor/ckeditor5-editor-classic/src/classiceditor`),
165
+ * you need to define the list of
166
+ * {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and
167
+ * {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from
168
+ * source in the {@glink installation/advanced/alternative-setups/integrating-from-source-webpack dedicated guide}.
169
+ *
142
170
  * @param sourceElementOrData The DOM element that will be the source for the created editor
143
171
  * or the editor's initial data.
144
172
  *
@@ -168,6 +196,25 @@ export default class ClassicEditor extends /* #__PURE__ */ ElementApiMixin(Edito
168
196
  });
169
197
  }
170
198
  }
199
+ /**
200
+ * The {@link module:core/context~Context} class.
201
+ *
202
+ * Exposed as static editor field for easier access in editor builds.
203
+ */
204
+ ClassicEditor.Context = Context;
205
+ /**
206
+ * The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.
207
+ *
208
+ * Exposed as static editor field for easier access in editor builds.
209
+ */
210
+ ClassicEditor.EditorWatchdog = EditorWatchdog;
211
+ /**
212
+ * The {@link module:watchdog/contextwatchdog~ContextWatchdog} class.
213
+ *
214
+ * Exposed as static editor field for easier access in editor builds.
215
+ */
216
+ ClassicEditor.ContextWatchdog = ContextWatchdog;
217
+ export default ClassicEditor;
171
218
  function getInitialData(sourceElementOrData) {
172
219
  return isElement(sourceElementOrData) ? getDataFromElement(sourceElementOrData) : sourceElementOrData;
173
220
  }