@vaadin/rich-text-editor 23.1.0-alpha1 → 23.1.0-alpha4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/rich-text-editor",
3
- "version": "23.1.0-alpha1",
3
+ "version": "23.1.0-alpha4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,14 +38,14 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@polymer/polymer": "^3.0.0",
41
- "@vaadin/button": "23.1.0-alpha1",
42
- "@vaadin/component-base": "23.1.0-alpha1",
43
- "@vaadin/confirm-dialog": "23.1.0-alpha1",
44
- "@vaadin/text-field": "23.1.0-alpha1",
41
+ "@vaadin/button": "23.1.0-alpha4",
42
+ "@vaadin/component-base": "23.1.0-alpha4",
43
+ "@vaadin/confirm-dialog": "23.1.0-alpha4",
44
+ "@vaadin/text-field": "23.1.0-alpha4",
45
45
  "@vaadin/vaadin-license-checker": "^2.1.0",
46
- "@vaadin/vaadin-lumo-styles": "23.1.0-alpha1",
47
- "@vaadin/vaadin-material-styles": "23.1.0-alpha1",
48
- "@vaadin/vaadin-themable-mixin": "23.1.0-alpha1"
46
+ "@vaadin/vaadin-lumo-styles": "23.1.0-alpha4",
47
+ "@vaadin/vaadin-material-styles": "23.1.0-alpha4",
48
+ "@vaadin/vaadin-themable-mixin": "23.1.0-alpha4"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@esm-bundle/chai": "^4.3.4",
@@ -53,7 +53,7 @@
53
53
  "gulp": "^4.0.2",
54
54
  "gulp-cli": "^2.3.0",
55
55
  "gulp-iconfont": "^11.0.0",
56
- "sinon": "^9.2.1"
56
+ "sinon": "^13.0.2"
57
57
  },
58
- "gitHead": "5d0cdee069f866037c507265fafb4d0476795333"
58
+ "gitHead": "aacdb7fe09811894751f0378ff7fb66071892c71"
59
59
  }
@@ -181,13 +181,13 @@ declare class RichTextEditor extends ElementMixin(ThemableMixin(HTMLElement)) {
181
181
  addEventListener<K extends keyof RichTextEditorEventMap>(
182
182
  type: K,
183
183
  listener: (this: RichTextEditor, ev: RichTextEditorEventMap[K]) => void,
184
- options?: boolean | AddEventListenerOptions
184
+ options?: boolean | AddEventListenerOptions,
185
185
  ): void;
186
186
 
187
187
  removeEventListener<K extends keyof RichTextEditorEventMap>(
188
188
  type: K,
189
189
  listener: (this: RichTextEditor, ev: RichTextEditorEventMap[K]) => void,
190
- options?: boolean | EventListenerOptions
190
+ options?: boolean | EventListenerOptions,
191
191
  ): void;
192
192
  }
193
193
 
@@ -31,19 +31,19 @@ const HANDLERS = [
31
31
  'list',
32
32
  'align',
33
33
  'blockquote',
34
- 'code-block'
34
+ 'code-block',
35
35
  ];
36
36
 
37
37
  const SOURCE = {
38
38
  API: 'api',
39
39
  USER: 'user',
40
- SILENT: 'silent'
40
+ SILENT: 'silent',
41
41
  };
42
42
 
43
43
  const STATE = {
44
44
  DEFAULT: 0,
45
45
  FOCUSED: 1,
46
- CLICKED: 2
46
+ CLICKED: 2,
47
47
  };
48
48
 
49
49
  const TAB_KEY = 9;
@@ -382,7 +382,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
382
382
  value: {
383
383
  type: String,
384
384
  notify: true,
385
- value: ''
385
+ value: '',
386
386
  },
387
387
 
388
388
  /**
@@ -391,7 +391,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
391
391
  htmlValue: {
392
392
  type: String,
393
393
  notify: true,
394
- readOnly: true
394
+ readOnly: true,
395
395
  },
396
396
 
397
397
  /**
@@ -401,7 +401,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
401
401
  disabled: {
402
402
  type: Boolean,
403
403
  value: false,
404
- reflectToAttribute: true
404
+ reflectToAttribute: true,
405
405
  },
406
406
 
407
407
  /**
@@ -411,7 +411,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
411
411
  readonly: {
412
412
  type: Boolean,
413
413
  value: false,
414
- reflectToAttribute: true
414
+ reflectToAttribute: true,
415
415
  },
416
416
 
417
417
  /**
@@ -449,14 +449,14 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
449
449
  linkDialogTitle: 'Link address',
450
450
  ok: 'OK',
451
451
  cancel: 'Cancel',
452
- remove: 'Remove'
452
+ remove: 'Remove',
453
453
  };
454
- }
454
+ },
455
455
  },
456
456
 
457
457
  /** @private */
458
458
  _editor: {
459
- type: Object
459
+ type: Object,
460
460
  },
461
461
 
462
462
  /**
@@ -468,31 +468,31 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
468
468
  /** @private */
469
469
  __lastCommittedChange: {
470
470
  type: String,
471
- value: ''
471
+ value: '',
472
472
  },
473
473
 
474
474
  /** @private */
475
475
  _linkEditing: {
476
- type: Boolean
476
+ type: Boolean,
477
477
  },
478
478
 
479
479
  /** @private */
480
480
  _linkRange: {
481
481
  type: Object,
482
- value: null
482
+ value: null,
483
483
  },
484
484
 
485
485
  /** @private */
486
486
  _linkIndex: {
487
487
  type: Number,
488
- value: null
488
+ value: null,
489
489
  },
490
490
 
491
491
  /** @private */
492
492
  _linkUrl: {
493
493
  type: String,
494
- value: ''
495
- }
494
+ value: '',
495
+ },
496
496
  };
497
497
  }
498
498
 
@@ -558,8 +558,8 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
558
558
 
559
559
  this._editor = new Quill(editor, {
560
560
  modules: {
561
- toolbar: toolbarConfig
562
- }
561
+ toolbar: toolbarConfig,
562
+ },
563
563
  });
564
564
 
565
565
  this.__patchToolbar();
@@ -616,8 +616,8 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
616
616
  clean: function () {
617
617
  self._markToolbarClicked();
618
618
  clean.call(this);
619
- }
620
- }
619
+ },
620
+ },
621
621
  };
622
622
 
623
623
  HANDLERS.forEach((handler) => {
@@ -687,7 +687,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
687
687
 
688
688
  /** @private */
689
689
  __createFakeFocusTarget() {
690
- const isRTL = document.documentElement.getAttribute('dir') == 'rtl';
690
+ const isRTL = document.documentElement.getAttribute('dir') === 'rtl';
691
691
  const elem = document.createElement('textarea');
692
692
  // Reset box model
693
693
  elem.style.border = '0';
@@ -912,7 +912,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
912
912
  [this.__dir === 'rtl' ? 'left' : 'right', 'center', 'justify'].forEach((align) => {
913
913
  content = content.replace(
914
914
  new RegExp(` class=[\\\\]?"\\s?ql-align-${align}[\\\\]?"`, 'g'),
915
- ` style="text-align: ${align}"`
915
+ ` style="text-align: ${align}"`,
916
916
  );
917
917
  });
918
918
 
@@ -951,7 +951,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
951
951
  .map((button) => button.getAttribute('title'))
952
952
  .join(', ');
953
953
  announcer.textContent = formatting;
954
- }
954
+ },
955
955
  );
956
956
  }
957
957
 
@@ -1017,7 +1017,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
1017
1017
  const range = this._editor.getSelection(true);
1018
1018
  this._editor.updateContents(
1019
1019
  new Quill.imports.delta().retain(range.index).delete(range.length).insert({ image }),
1020
- SOURCE.USER
1020
+ SOURCE.USER,
1021
1021
  );
1022
1022
  this._markToolbarClicked();
1023
1023
  this._editor.setSelection(range.index + 1, SOURCE.SILENT);
@@ -1056,7 +1056,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
1056
1056
  return;
1057
1057
  }
1058
1058
 
1059
- if (value == null || value == '[{"insert":"\\n"}]') {
1059
+ if (value == null || value === '[{"insert":"\\n"}]') {
1060
1060
  this.value = '';
1061
1061
  return;
1062
1062
  }
@@ -1072,7 +1072,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
1072
1072
  if (Array.isArray(parsedValue)) {
1073
1073
  this.__oldValue = value;
1074
1074
  } else {
1075
- throw new Error('expected JSON string with array of objects, got: ' + value);
1075
+ throw new Error(`expected JSON string with array of objects, got: ${value}`);
1076
1076
  }
1077
1077
  } catch (err) {
1078
1078
  // Use old value in case new one is not suitable
@@ -217,5 +217,5 @@ const richTextEditor = css`
217
217
  `;
218
218
 
219
219
  registerStyles('vaadin-rich-text-editor', [color, typography, richTextEditor], {
220
- moduleId: 'lumo-rich-text-editor'
220
+ moduleId: 'lumo-rich-text-editor',
221
221
  });
@@ -94,5 +94,5 @@ const richTextEditor = css`
94
94
  `;
95
95
 
96
96
  registerStyles('vaadin-rich-text-editor', [typography, richTextEditor], {
97
- moduleId: 'material-rich-text-editor'
97
+ moduleId: 'material-rich-text-editor',
98
98
  });