@akilli/editor-src 5.3.0 → 5.4.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/base/Alignment.js +2 -2
- package/base/CommandManager.js +0 -9
- package/base/DialogManager.js +0 -9
- package/base/Editor.js +0 -16
- package/base/FilterManager.js +0 -9
- package/base/Key.js +9 -9
- package/base/PluginManager.js +0 -9
- package/base/Sorting.js +2 -2
- package/base/TagGroup.js +2 -2
- package/base/TagManager.js +0 -13
- package/base/TagName.js +2 -2
- package/package.json +1 -1
package/base/Alignment.js
CHANGED
package/base/CommandManager.js
CHANGED
|
@@ -48,13 +48,4 @@ export default class CommandManager {
|
|
|
48
48
|
execute(name) {
|
|
49
49
|
this.get(name).execute();
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @return {void}
|
|
54
|
-
*/
|
|
55
|
-
freeze() {
|
|
56
|
-
this.#items.forEach((command) => Object.freeze(command));
|
|
57
|
-
Object.freeze(this.#items);
|
|
58
|
-
Object.freeze(this);
|
|
59
|
-
}
|
|
60
51
|
}
|
package/base/DialogManager.js
CHANGED
|
@@ -32,13 +32,4 @@ export default class DialogManager {
|
|
|
32
32
|
|
|
33
33
|
this.#items.set(dialog.name, dialog);
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @return {void}
|
|
38
|
-
*/
|
|
39
|
-
freeze() {
|
|
40
|
-
this.#items.forEach((dialog) => Object.freeze(dialog));
|
|
41
|
-
Object.freeze(this.#items);
|
|
42
|
-
Object.freeze(this);
|
|
43
|
-
}
|
|
44
35
|
}
|
package/base/Editor.js
CHANGED
|
@@ -323,21 +323,6 @@ export default class Editor {
|
|
|
323
323
|
this.rootDispatcher.dispatch('init');
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
-
/**
|
|
327
|
-
* Freezes the editor and its configuration
|
|
328
|
-
*
|
|
329
|
-
* @return {void}
|
|
330
|
-
*/
|
|
331
|
-
freeze() {
|
|
332
|
-
Object.freeze(this.config);
|
|
333
|
-
Object.freeze(this.i18n);
|
|
334
|
-
this.tags.freeze();
|
|
335
|
-
this.filters.freeze();
|
|
336
|
-
this.dialogs.freeze();
|
|
337
|
-
this.commands.freeze();
|
|
338
|
-
this.plugins.freeze();
|
|
339
|
-
}
|
|
340
|
-
|
|
341
326
|
/**
|
|
342
327
|
* Loads editor element into DOM
|
|
343
328
|
*
|
|
@@ -440,7 +425,6 @@ export default class Editor {
|
|
|
440
425
|
static create(element, config = {}) {
|
|
441
426
|
const editor = new this(element, config);
|
|
442
427
|
editor.init();
|
|
443
|
-
editor.freeze();
|
|
444
428
|
editor.load();
|
|
445
429
|
|
|
446
430
|
return editor;
|
package/base/FilterManager.js
CHANGED
package/base/Key.js
CHANGED
|
@@ -4,7 +4,7 @@ import Sorting from './Sorting.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* @enum {string}
|
|
6
6
|
*/
|
|
7
|
-
const Key =
|
|
7
|
+
const Key = {
|
|
8
8
|
A: 'a',
|
|
9
9
|
ARROWDOWN: 'ArrowDown',
|
|
10
10
|
ARROWLEFT: 'ArrowLeft',
|
|
@@ -39,44 +39,44 @@ const Key = Object.freeze({
|
|
|
39
39
|
X: 'x',
|
|
40
40
|
Y: 'y',
|
|
41
41
|
Z: 'z',
|
|
42
|
-
}
|
|
42
|
+
};
|
|
43
43
|
|
|
44
44
|
export default Key;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* @type {string[]}
|
|
48
48
|
*/
|
|
49
|
-
export const ArrowKeys =
|
|
49
|
+
export const ArrowKeys = [Key.ARROWLEFT, Key.ARROWRIGHT, Key.ARROWUP, Key.ARROWDOWN];
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* @type {string[]}
|
|
53
53
|
*/
|
|
54
|
-
export const NavKeys =
|
|
54
|
+
export const NavKeys = [Key.HOME, Key.ARROWUP, Key.ARROWDOWN, Key.END];
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* @type {string[]}
|
|
58
58
|
*/
|
|
59
|
-
export const BarNavKeys =
|
|
59
|
+
export const BarNavKeys = [Key.HOME, Key.ARROWLEFT, Key.ARROWRIGHT, Key.END];
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* @type {Object<Key, Alignment>}
|
|
63
63
|
*/
|
|
64
|
-
export const AlignKeyMap =
|
|
64
|
+
export const AlignKeyMap = {
|
|
65
65
|
[Key.ARROWUP]: Alignment.NONE,
|
|
66
66
|
[Key.ARROWLEFT]: Alignment.LEFT,
|
|
67
67
|
[Key.ARROWDOWN]: Alignment.CENTER,
|
|
68
68
|
[Key.ARROWRIGHT]: Alignment.RIGHT,
|
|
69
|
-
}
|
|
69
|
+
};
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* @type {Object<Key, Sorting>}
|
|
73
73
|
*/
|
|
74
|
-
export const SortKeyMap =
|
|
74
|
+
export const SortKeyMap = {
|
|
75
75
|
[Key.HOME]: Sorting.FIRST,
|
|
76
76
|
[Key.ARROWUP]: Sorting.PREV,
|
|
77
77
|
[Key.ARROWDOWN]: Sorting.NEXT,
|
|
78
78
|
[Key.END]: Sorting.LAST,
|
|
79
|
-
}
|
|
79
|
+
};
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* Indicates if keyboard event was triggered for given key combination
|
package/base/PluginManager.js
CHANGED
|
@@ -39,13 +39,4 @@ export default class PluginManager {
|
|
|
39
39
|
init() {
|
|
40
40
|
this.#items.forEach((plugin) => plugin.init());
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @return {void}
|
|
45
|
-
*/
|
|
46
|
-
freeze() {
|
|
47
|
-
this.#items.forEach((plugin) => Object.freeze(plugin));
|
|
48
|
-
Object.freeze(this.#items);
|
|
49
|
-
Object.freeze(this);
|
|
50
|
-
}
|
|
51
42
|
}
|
package/base/Sorting.js
CHANGED
package/base/TagGroup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @enum {string}
|
|
3
3
|
*/
|
|
4
|
-
export default
|
|
4
|
+
export default {
|
|
5
5
|
AUDIO: 'audio',
|
|
6
6
|
BLOCK: 'block',
|
|
7
7
|
BREAK: 'break',
|
|
@@ -28,4 +28,4 @@ export default Object.freeze({
|
|
|
28
28
|
TABLEROW: 'tablerow',
|
|
29
29
|
TABLESECTION: 'tablesection',
|
|
30
30
|
VIDEO: 'video',
|
|
31
|
-
}
|
|
31
|
+
};
|
package/base/TagManager.js
CHANGED
|
@@ -45,17 +45,4 @@ export default class TagManager {
|
|
|
45
45
|
const group = isGroup ? childKey : this.get(childKey)?.group;
|
|
46
46
|
return !!this.get(key)?.children.includes(group);
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* @return {void}
|
|
51
|
-
*/
|
|
52
|
-
freeze() {
|
|
53
|
-
this.#items.forEach((tag) => {
|
|
54
|
-
Object.freeze(tag.children);
|
|
55
|
-
Object.freeze(tag.attributes);
|
|
56
|
-
Object.freeze(tag);
|
|
57
|
-
});
|
|
58
|
-
Object.freeze(this.#items);
|
|
59
|
-
Object.freeze(this);
|
|
60
|
-
}
|
|
61
48
|
}
|
package/base/TagName.js
CHANGED