@ckeditor/ckeditor5-core 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 CHANGED
@@ -3,22 +3,28 @@ CKEditor 5 core editor architecture
3
3
 
4
4
  [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-core.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-core)
5
5
  [![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
6
- [![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://app.travis-ci.com/github/ckeditor/ckeditor5)
6
+ [![CircleCI](https://circleci.com/gh/ckeditor/ckeditor5.svg?style=shield)](https://app.circleci.com/pipelines/github/ckeditor/ckeditor5?branch=master)
7
7
 
8
8
  This package implements CKEditor 5's core editor architecture – a set of classes and interfaces which glue everything together.
9
9
 
10
- ## Documentation
11
-
12
- For general introduction see the [Overview of CKEditor 5 framework](https://ckeditor.com/docs/ckeditor5/latest/framework/index.html) guide and then the [core editor architecture guide](https://ckeditor.com/docs/ckeditor5/latest/framework/architecture/core-editor-architecture.html).
13
-
14
- Additionally, see the [`@ckeditor/ckeditor5-core` package](https://ckeditor.com/docs/ckeditor5/latest/api/core.html) page in [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/) for even more information.
15
-
16
10
  ## Installation
17
11
 
12
+ This plugin is part of the `ckeditor5` package. Install the whole package to use it.
13
+
18
14
  ```bash
19
15
  npm install ckeditor5
20
16
  ```
21
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
+
22
+ ## Documentation
23
+
24
+ For general introduction see the [Overview of CKEditor 5 framework](https://ckeditor.com/docs/ckeditor5/latest/framework/index.html) guide and then the [core editor architecture guide](https://ckeditor.com/docs/ckeditor5/latest/framework/architecture/core-editor-architecture.html).
25
+
26
+ Additionally, see the [`@ckeditor/ckeditor5-core` package](https://ckeditor.com/docs/ckeditor5/latest/api/core.html) page in [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/) for even more information.
27
+
22
28
  ## License
23
29
 
24
30
  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).
@@ -6,9 +6,6 @@
6
6
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
7
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
8
  */
9
- /**
10
- * @module core/editor/editor
11
- */
12
9
  import { Config, type Locale, type LocaleTranslate } from '@ckeditor/ckeditor5-utils';
13
10
  import { Conversion, DataController, EditingController, Model } from '@ckeditor/ckeditor5-engine';
14
11
  import type { EditorUI } from '@ckeditor/ckeditor5-ui';
@@ -20,6 +17,9 @@ import EditingKeystrokeHandler from '../editingkeystrokehandler.js';
20
17
  import Accessibility from '../accessibility.js';
21
18
  import type { LoadedPlugins, PluginConstructor } from '../plugin.js';
22
19
  import type { EditorConfig } from './editorconfig.js';
20
+ declare global {
21
+ var CKEDITOR_GLOBAL_LICENSE_KEY: string | undefined;
22
+ }
23
23
  declare const Editor_base: {
24
24
  new (): import("@ckeditor/ckeditor5-utils").Observable;
25
25
  prototype: import("@ckeditor/ckeditor5-utils").Observable;
@@ -43,6 +43,10 @@ declare const Editor_base: {
43
43
  * (as most editor implementations do).
44
44
  */
45
45
  export default abstract class Editor extends /* #__PURE__ */ Editor_base {
46
+ /**
47
+ * A required name of the editor class. The name should reflect the constructor name.
48
+ */
49
+ static get editorName(): `${string}Editor`;
46
50
  /**
47
51
  * A namespace for the accessibility features of the editor.
48
52
  */
@@ -451,6 +455,14 @@ export default abstract class Editor extends /* #__PURE__ */ Editor_base {
451
455
  * Exposed as static editor field for easier access in editor builds.
452
456
  */
453
457
  static ContextWatchdog: typeof ContextWatchdog;
458
+ private _showLicenseError;
459
+ /**
460
+ * This part of the code is _not_ executed in installations under the GPL license (with `config.licenseKey = 'GPL'`).
461
+ *
462
+ * It is only executed when a specific license key is provided. If you are uncertain whether
463
+ * this applies to your installation, please contact our support team.
464
+ */
465
+ private _sendUsageRequest;
454
466
  }
455
467
  /**
456
468
  * Fired when the {@link module:engine/controller/datacontroller~DataController#event:ready data} and all additional
@@ -470,6 +482,23 @@ export type EditorReadyEvent = {
470
482
  name: 'ready';
471
483
  args: [];
472
484
  };
485
+ /**
486
+ * Fired when the editor is about to collect usage data.
487
+ *
488
+ * This event is fired when the editor is about to collect usage data. It allows plugins to provide additional data for
489
+ * the usage statistics. The usage data is collected by the editor and sent to the usage tracking server. All plugins are
490
+ * expected to be ready at this point.
491
+ *
492
+ * @eventName ~Editor#collectUsageData
493
+ */
494
+ export type EditorCollectUsageDataEvent = {
495
+ name: 'collectUsageData';
496
+ args: [
497
+ {
498
+ setUsageData(path: string, value: unknown): void;
499
+ }
500
+ ];
501
+ };
473
502
  /**
474
503
  * Fired when this editor instance is destroyed. The editor at this point is not usable and this event should be used to
475
504
  * perform the clean-up in any plugin.
@@ -799,10 +799,12 @@ export interface EditorConfig {
799
799
  */
800
800
  updateSourceElementOnDestroy?: boolean;
801
801
  /**
802
- * The license key for the CKEditor 5 commercial license and the premium features.
802
+ * The CKEditor 5 license key. If you want to obtain a license key, please do one of the following:
803
803
  *
804
- * If you do not have a key yet, please [contact us](https://ckeditor.com/contact/) or
805
- * [order a trial](https://orders.ckeditor.com/trial/premium-features).
804
+ * * Create a free account, and test the premium features with a [14-day free trial](https://portal.ckeditor.com/checkout?plan=free).
805
+ * * [Contact us](https://ckeditor.com/contact/) for a commercial license.
806
+ * * If you are using the editor under a GPL license or another license from our Open Source Initiative,
807
+ * use the 'GPL' license key instead.
806
808
  */
807
809
  licenseKey?: string;
808
810
  /**
@@ -914,7 +916,7 @@ export interface PoweredByConfig {
914
916
  *
915
917
  * @default 'border'
916
918
  */
917
- position: 'inside' | 'border';
919
+ position?: 'inside' | 'border';
918
920
  /**
919
921
  * Allows choosing the side of the editing area where the logo will be displayed.
920
922
  *
@@ -923,7 +925,7 @@ export interface PoweredByConfig {
923
925
  *
924
926
  * @default 'right'
925
927
  */
926
- side: 'left' | 'right';
928
+ side?: 'left' | 'right';
927
929
  /**
928
930
  * Allows changing the label displayed next to the CKEditor logo.
929
931
  *
@@ -931,7 +933,7 @@ export interface PoweredByConfig {
931
933
  *
932
934
  * @default 'Powered by'
933
935
  */
934
- label: string | null;
936
+ label?: string | null;
935
937
  /**
936
938
  * The vertical distance the logo can be moved away from its default position.
937
939
  *
@@ -939,13 +941,13 @@ export interface PoweredByConfig {
939
941
  *
940
942
  * @default 5
941
943
  */
942
- verticalOffset: number;
944
+ verticalOffset?: number;
943
945
  /**
944
946
  * The horizontal distance between the side of the editing root and the nearest side of the logo.
945
947
  *
946
948
  * @default 5
947
949
  */
948
- horizontalOffset: number;
950
+ horizontalOffset?: number;
949
951
  /**
950
952
  * Allows to show the logo even if the valid commercial license is configured using
951
953
  * the {@link module:core/editor/editorconfig~EditorConfig#licenseKey `config.licenseKey`} setting.
@@ -0,0 +1,72 @@
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
+ import type Editor from '../editor.js';
10
+ /**
11
+ * This part of the code is not executed in open-source implementations using a GPL key.
12
+ * It only runs when a specific license key is provided. If you are uncertain whether
13
+ * this applies to your installation, please contact our support team.
14
+ *
15
+ * @internal
16
+ */
17
+ export declare function getEditorUsageData(editor: Editor): EditorUsageData;
18
+ declare global {
19
+ interface Window {
20
+ CKEDITOR_PAGE_SESSION_ID?: string;
21
+ }
22
+ }
23
+ /**
24
+ * @internal
25
+ */
26
+ export type EditorUsageData = {
27
+ sessionId: string;
28
+ pageSessionId: string;
29
+ hostname: string;
30
+ version: string;
31
+ type: `${string}Editor`;
32
+ plugins: Array<PluginUsageData>;
33
+ toolbar: {
34
+ main?: ToolbarUsageData;
35
+ block?: ToolbarUsageData;
36
+ balloon?: ToolbarUsageData;
37
+ };
38
+ menuBar: {
39
+ isVisible: boolean;
40
+ };
41
+ language: {
42
+ ui: string;
43
+ content: string;
44
+ };
45
+ distribution: {
46
+ channel: string;
47
+ };
48
+ env: EnvUsageData;
49
+ integration: {
50
+ [integrationName: string]: IntegrationUsageData;
51
+ };
52
+ };
53
+ type IntegrationUsageData = {
54
+ version: string;
55
+ frameworkVersion?: string;
56
+ };
57
+ type EnvUsageData = {
58
+ os: 'mac' | 'windows' | 'ios' | 'android' | 'unknown';
59
+ browser: 'safari' | 'gecko' | 'blink' | 'unknown';
60
+ };
61
+ type ToolbarUsageData = {
62
+ items: Array<string>;
63
+ isMultiline: boolean;
64
+ shouldNotGroupWhenFull: boolean;
65
+ };
66
+ type PluginUsageData = {
67
+ name: string;
68
+ isPremium: boolean;
69
+ isOfficial: boolean;
70
+ isContext: boolean;
71
+ };
72
+ export {};
package/dist/index.d.ts CHANGED
@@ -90,5 +90,8 @@ export declare const icons: {
90
90
  indent: string;
91
91
  outdent: string;
92
92
  table: string;
93
+ remove: string;
94
+ bookmark: string;
95
+ bookmarkInline: string;
93
96
  };
94
97
  import './augmentation.js';