@ckeditor/ckeditor5-source-editing 39.0.1 → 40.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +3 -3
  3. package/build/source-editing.js +1 -1
  4. package/build/source-editing.js.map +1 -0
  5. package/lang/translations/ar.po +1 -0
  6. package/lang/translations/bg.po +1 -0
  7. package/lang/translations/bn.po +1 -0
  8. package/lang/translations/ca.po +1 -0
  9. package/lang/translations/cs.po +1 -0
  10. package/lang/translations/da.po +1 -0
  11. package/lang/translations/de.po +1 -0
  12. package/lang/translations/el.po +1 -0
  13. package/lang/translations/en-au.po +1 -0
  14. package/lang/translations/en.po +1 -0
  15. package/lang/translations/es.po +1 -0
  16. package/lang/translations/et.po +1 -0
  17. package/lang/translations/fi.po +1 -0
  18. package/lang/translations/fr.po +1 -0
  19. package/lang/translations/gl.po +1 -0
  20. package/lang/translations/he.po +1 -0
  21. package/lang/translations/hi.po +1 -0
  22. package/lang/translations/hr.po +1 -0
  23. package/lang/translations/hu.po +1 -0
  24. package/lang/translations/id.po +1 -0
  25. package/lang/translations/it.po +1 -0
  26. package/lang/translations/ja.po +1 -0
  27. package/lang/translations/ko.po +1 -0
  28. package/lang/translations/lt.po +1 -0
  29. package/lang/translations/lv.po +1 -0
  30. package/lang/translations/ms.po +1 -0
  31. package/lang/translations/nl.po +1 -0
  32. package/lang/translations/no.po +1 -0
  33. package/lang/translations/pl.po +1 -0
  34. package/lang/translations/pt-br.po +1 -0
  35. package/lang/translations/pt.po +1 -0
  36. package/lang/translations/ro.po +1 -0
  37. package/lang/translations/ru.po +1 -0
  38. package/lang/translations/sk.po +1 -0
  39. package/lang/translations/sr-latn.po +1 -0
  40. package/lang/translations/sr.po +1 -0
  41. package/lang/translations/sv.po +1 -0
  42. package/lang/translations/th.po +1 -0
  43. package/lang/translations/tr.po +1 -0
  44. package/lang/translations/ug.po +1 -0
  45. package/lang/translations/uk.po +1 -0
  46. package/lang/translations/ur.po +1 -0
  47. package/lang/translations/vi.po +1 -0
  48. package/lang/translations/zh-cn.po +1 -0
  49. package/lang/translations/zh.po +1 -0
  50. package/package.json +3 -7
  51. package/src/augmentation.d.ts +10 -10
  52. package/src/augmentation.js +5 -5
  53. package/src/index.d.ts +9 -9
  54. package/src/index.js +9 -9
  55. package/src/sourceediting.d.ts +102 -102
  56. package/src/sourceediting.js +299 -299
  57. package/src/utils/formathtml.d.ts +19 -19
  58. package/src/utils/formathtml.js +128 -130
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Urdu (https://app.transifex.com/ckeditor/teams/11143/ur/)\n"
16
16
  "Language: ur\n"
17
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "The label of the source editing feature toolbar button."
20
21
  msgid "Source"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Vietnamese (https://app.transifex.com/ckeditor/teams/11143/vi/)\n"
16
16
  "Language: vi\n"
17
17
  "Plural-Forms: nplurals=1; plural=0;\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "The label of the source editing feature toolbar button."
20
21
  msgid "Source"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Chinese (China) (https://app.transifex.com/ckeditor/teams/11143/zh_CN/)\n"
16
16
  "Language: zh_CN\n"
17
17
  "Plural-Forms: nplurals=1; plural=0;\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "The label of the source editing feature toolbar button."
20
21
  msgid "Source"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Chinese (Taiwan) (https://app.transifex.com/ckeditor/teams/11143/zh_TW/)\n"
16
16
  "Language: zh_TW\n"
17
17
  "Plural-Forms: nplurals=1; plural=0;\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "The label of the source editing feature toolbar button."
20
21
  msgid "Source"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-source-editing",
3
- "version": "39.0.1",
3
+ "version": "40.0.0",
4
4
  "description": "Source editing feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,12 +12,8 @@
12
12
  ],
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "@ckeditor/ckeditor5-theme-lark": "39.0.1",
16
- "ckeditor5": "39.0.1"
17
- },
18
- "engines": {
19
- "node": ">=16.0.0",
20
- "npm": ">=5.7.1"
15
+ "@ckeditor/ckeditor5-theme-lark": "40.0.0",
16
+ "ckeditor5": "40.0.0"
21
17
  },
22
18
  "author": "CKSource (http://cksource.com/)",
23
19
  "license": "GPL-2.0-or-later",
@@ -1,10 +1,10 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, 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
- import type { SourceEditing } from './index';
6
- declare module '@ckeditor/ckeditor5-core' {
7
- interface PluginsMap {
8
- [SourceEditing.pluginName]: SourceEditing;
9
- }
10
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, 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
+ import type { SourceEditing } from './index';
6
+ declare module '@ckeditor/ckeditor5-core' {
7
+ interface PluginsMap {
8
+ [SourceEditing.pluginName]: SourceEditing;
9
+ }
10
+ }
@@ -1,5 +1,5 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, 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
- export {};
1
+ /**
2
+ * @license Copyright (c) 2003-2023, 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
+ export {};
package/src/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, 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
- * @module source-editing
7
- */
8
- export { default as SourceEditing } from './sourceediting';
9
- import './augmentation';
1
+ /**
2
+ * @license Copyright (c) 2003-2023, 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
+ * @module source-editing
7
+ */
8
+ export { default as SourceEditing } from './sourceediting';
9
+ import './augmentation';
package/src/index.js CHANGED
@@ -1,9 +1,9 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, 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
- * @module source-editing
7
- */
8
- export { default as SourceEditing } from './sourceediting';
9
- import './augmentation';
1
+ /**
2
+ * @license Copyright (c) 2003-2023, 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
+ * @module source-editing
7
+ */
8
+ export { default as SourceEditing } from './sourceediting';
9
+ import './augmentation';
@@ -1,102 +1,102 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, 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
- * @module source-editing/sourceediting
7
- */
8
- import { type Editor, Plugin, PendingActions } from 'ckeditor5/src/core';
9
- import '../theme/sourceediting.css';
10
- /**
11
- * The source editing feature.
12
- *
13
- * It provides the possibility to view and edit the source of the document.
14
- *
15
- * For a detailed overview, check the {@glink features/source-editing source editing feature documentation} and the
16
- * {@glink api/source-editing package page}.
17
- */
18
- export default class SourceEditing extends Plugin {
19
- /**
20
- * @inheritDoc
21
- */
22
- static get pluginName(): "SourceEditing";
23
- /**
24
- * @inheritDoc
25
- */
26
- static get requires(): readonly [typeof PendingActions];
27
- /**
28
- * Flag indicating whether the document source mode is active.
29
- *
30
- * @observable
31
- */
32
- isSourceEditingMode: boolean;
33
- /**
34
- * The element replacer instance used to replace the editing roots with the wrapper elements containing the document source.
35
- */
36
- private _elementReplacer;
37
- /**
38
- * Maps all root names to wrapper elements containing the document source.
39
- */
40
- private _replacedRoots;
41
- /**
42
- * Maps all root names to their document data.
43
- */
44
- private _dataFromRoots;
45
- /**
46
- * @inheritDoc
47
- */
48
- constructor(editor: Editor);
49
- /**
50
- * @inheritDoc
51
- */
52
- init(): void;
53
- /**
54
- * @inheritDoc
55
- */
56
- afterInit(): void;
57
- /**
58
- * Updates the source data in all hidden editing roots.
59
- */
60
- updateEditorData(): void;
61
- /**
62
- * Creates source editing wrappers that replace each editing root. Each wrapper contains the document source from the corresponding
63
- * root.
64
- *
65
- * The wrapper element contains a textarea and it solves the problem, that the textarea element cannot auto expand its height based on
66
- * the content it contains. The solution is to make the textarea more like a plain div element, which expands in height as much as it
67
- * needs to, in order to display the whole document source without scrolling. The wrapper element is a parent for the textarea and for
68
- * the pseudo-element `::after`, that replicates the look, content, and position of the textarea. The pseudo-element replica is hidden,
69
- * but it is styled to be an identical visual copy of the textarea with the same content. Then, the wrapper is a grid container and both
70
- * of its children (the textarea and the `::after` pseudo-element) are positioned within a CSS grid to occupy the same grid cell. The
71
- * content in the pseudo-element `::after` is set in CSS and it stretches the grid to the appropriate size based on the textarea value.
72
- * Since both children occupy the same grid cell, both have always the same height.
73
- */
74
- private _showSourceEditing;
75
- /**
76
- * Restores all hidden editing roots and sets the source data in them.
77
- */
78
- private _hideSourceEditing;
79
- /**
80
- * Focuses the textarea containing document source from the first editing root.
81
- */
82
- private _focusSourceEditing;
83
- /**
84
- * Disables all commands.
85
- */
86
- private _disableCommands;
87
- /**
88
- * Clears forced disable for all commands, that was previously set through {@link #_disableCommands}.
89
- */
90
- private _enableCommands;
91
- /**
92
- * Adds or removes the `readonly` attribute from the textarea from all roots, if document source mode is active.
93
- *
94
- * @param isReadOnly Indicates whether all textarea elements should be read-only.
95
- */
96
- private _handleReadOnlyMode;
97
- /**
98
- * Checks, if the plugin is allowed to handle the source editing mode by itself. Currently, the source editing mode is supported only
99
- * for the {@link module:editor-classic/classiceditor~ClassicEditor classic editor}.
100
- */
101
- private _isAllowedToHandleSourceEditingMode;
102
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, 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
+ * @module source-editing/sourceediting
7
+ */
8
+ import { type Editor, Plugin, PendingActions } from 'ckeditor5/src/core';
9
+ import '../theme/sourceediting.css';
10
+ /**
11
+ * The source editing feature.
12
+ *
13
+ * It provides the possibility to view and edit the source of the document.
14
+ *
15
+ * For a detailed overview, check the {@glink features/source-editing source editing feature documentation} and the
16
+ * {@glink api/source-editing package page}.
17
+ */
18
+ export default class SourceEditing extends Plugin {
19
+ /**
20
+ * @inheritDoc
21
+ */
22
+ static get pluginName(): "SourceEditing";
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ static get requires(): readonly [typeof PendingActions];
27
+ /**
28
+ * Flag indicating whether the document source mode is active.
29
+ *
30
+ * @observable
31
+ */
32
+ isSourceEditingMode: boolean;
33
+ /**
34
+ * The element replacer instance used to replace the editing roots with the wrapper elements containing the document source.
35
+ */
36
+ private _elementReplacer;
37
+ /**
38
+ * Maps all root names to wrapper elements containing the document source.
39
+ */
40
+ private _replacedRoots;
41
+ /**
42
+ * Maps all root names to their document data.
43
+ */
44
+ private _dataFromRoots;
45
+ /**
46
+ * @inheritDoc
47
+ */
48
+ constructor(editor: Editor);
49
+ /**
50
+ * @inheritDoc
51
+ */
52
+ init(): void;
53
+ /**
54
+ * @inheritDoc
55
+ */
56
+ afterInit(): void;
57
+ /**
58
+ * Updates the source data in all hidden editing roots.
59
+ */
60
+ updateEditorData(): void;
61
+ /**
62
+ * Creates source editing wrappers that replace each editing root. Each wrapper contains the document source from the corresponding
63
+ * root.
64
+ *
65
+ * The wrapper element contains a textarea and it solves the problem, that the textarea element cannot auto expand its height based on
66
+ * the content it contains. The solution is to make the textarea more like a plain div element, which expands in height as much as it
67
+ * needs to, in order to display the whole document source without scrolling. The wrapper element is a parent for the textarea and for
68
+ * the pseudo-element `::after`, that replicates the look, content, and position of the textarea. The pseudo-element replica is hidden,
69
+ * but it is styled to be an identical visual copy of the textarea with the same content. Then, the wrapper is a grid container and both
70
+ * of its children (the textarea and the `::after` pseudo-element) are positioned within a CSS grid to occupy the same grid cell. The
71
+ * content in the pseudo-element `::after` is set in CSS and it stretches the grid to the appropriate size based on the textarea value.
72
+ * Since both children occupy the same grid cell, both have always the same height.
73
+ */
74
+ private _showSourceEditing;
75
+ /**
76
+ * Restores all hidden editing roots and sets the source data in them.
77
+ */
78
+ private _hideSourceEditing;
79
+ /**
80
+ * Focuses the textarea containing document source from the first editing root.
81
+ */
82
+ private _focusSourceEditing;
83
+ /**
84
+ * Disables all commands.
85
+ */
86
+ private _disableCommands;
87
+ /**
88
+ * Clears forced disable for all commands, that was previously set through {@link #_disableCommands}.
89
+ */
90
+ private _enableCommands;
91
+ /**
92
+ * Adds or removes the `readonly` attribute from the textarea from all roots, if document source mode is active.
93
+ *
94
+ * @param isReadOnly Indicates whether all textarea elements should be read-only.
95
+ */
96
+ private _handleReadOnlyMode;
97
+ /**
98
+ * Checks, if the plugin is allowed to handle the source editing mode by itself. Currently, the source editing mode is supported only
99
+ * for the {@link module:editor-classic/classiceditor~ClassicEditor classic editor}.
100
+ */
101
+ private _isAllowedToHandleSourceEditingMode;
102
+ }