@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 CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @enum {string}
3
3
  */
4
- export default Object.freeze({
4
+ export default {
5
5
  NONE: 'none',
6
6
  LEFT: 'left',
7
7
  CENTER: 'center',
8
8
  RIGHT: 'right',
9
- });
9
+ };
@@ -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
  }
@@ -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;
@@ -32,13 +32,4 @@ export default class FilterManager {
32
32
  filter.filter(element);
33
33
  });
34
34
  }
35
-
36
- /**
37
- * @return {void}
38
- */
39
- freeze() {
40
- this.#items.forEach((filter) => Object.freeze(filter));
41
- Object.freeze(this.#items);
42
- Object.freeze(this);
43
- }
44
35
  }
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 = Object.freeze({
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 = Object.freeze([Key.ARROWLEFT, Key.ARROWRIGHT, Key.ARROWUP, Key.ARROWDOWN]);
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 = Object.freeze([Key.HOME, Key.ARROWUP, Key.ARROWDOWN, Key.END]);
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 = Object.freeze([Key.HOME, Key.ARROWLEFT, Key.ARROWRIGHT, Key.END]);
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 = Object.freeze({
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 = Object.freeze({
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
@@ -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
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @enum {string}
3
3
  */
4
- export default Object.freeze({
4
+ export default {
5
5
  FIRST: 'first',
6
6
  PREV: 'prev',
7
7
  NEXT: 'next',
8
8
  LAST: 'last',
9
- });
9
+ };
package/base/TagGroup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @enum {string}
3
3
  */
4
- export default Object.freeze({
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
+ };
@@ -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
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @enum {string}
3
3
  */
4
- export default Object.freeze({
4
+ export default {
5
5
  A: 'a',
6
6
  ABBR: 'abbr',
7
7
  ALL: '*',
@@ -69,4 +69,4 @@ export default Object.freeze({
69
69
  UL: 'ul',
70
70
  VAR: 'var',
71
71
  VIDEO: 'video',
72
- });
72
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akilli/editor-src",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "description": "Source files for @akilli/editor",
5
5
  "keywords": [
6
6
  "contenteditable",