@limetech/lime-elements 37.45.1 → 37.45.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [37.45.2](https://github.com/Lundalogik/lime-elements/compare/v37.45.1...v37.45.2) (2024-05-31)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+
7
+ * **text-editor:** do not emit event for pointer transactions ([18f6d1c](https://github.com/Lundalogik/lime-elements/commit/18f6d1caf27622f3f8a5e8273d64194a139ea629))
8
+ * **text-editor:** never emit change event as result of getting updated value from consumer ([e4a52d0](https://github.com/Lundalogik/lime-elements/commit/e4a52d0db5f2401cbd9d6a9df38bce1f27fab84a))
9
+
1
10
  ## [37.45.1](https://github.com/Lundalogik/lime-elements/compare/v37.45.0...v37.45.1) (2024-05-31)
2
11
 
3
12
 
@@ -25560,6 +25560,7 @@ const ProsemirrorAdapter = class {
25560
25560
  constructor(hostRef) {
25561
25561
  index.registerInstance(this, hostRef);
25562
25562
  this.change = index.createEvent(this, "change", 7);
25563
+ this.suppressChangeEvent = false;
25563
25564
  this.getActionBarItems = () => {
25564
25565
  this.actionBarItems = getTextEditorMenuItems().map(this.getTranslatedItem);
25565
25566
  };
@@ -25576,6 +25577,12 @@ const ProsemirrorAdapter = class {
25576
25577
  this.handleTransaction = (transaction) => {
25577
25578
  const newState = this.view.state.apply(transaction);
25578
25579
  this.view.updateState(newState);
25580
+ if (this.suppressChangeEvent) {
25581
+ return;
25582
+ }
25583
+ if (transaction.getMeta('pointer')) {
25584
+ return;
25585
+ }
25579
25586
  this.change.emit(this.contentConverter.serialize(this.view, this.schema));
25580
25587
  };
25581
25588
  this.handleActionBarItem = (event) => {
@@ -25702,6 +25709,7 @@ const ProsemirrorAdapter = class {
25702
25709
  });
25703
25710
  }
25704
25711
  async updateView(content) {
25712
+ this.suppressChangeEvent = true;
25705
25713
  const html = await this.contentConverter.parseAsHTML(content, this.schema);
25706
25714
  const prosemirrorDOMparser = DOMParser.fromSchema(this.view.state.schema);
25707
25715
  const domParser = new window.DOMParser();
@@ -25710,6 +25718,7 @@ const ProsemirrorAdapter = class {
25710
25718
  const tr = this.view.state.tr;
25711
25719
  tr.replaceWith(0, tr.doc.content.size, prosemirrorDoc.content);
25712
25720
  this.view.dispatch(tr);
25721
+ this.suppressChangeEvent = false;
25713
25722
  }
25714
25723
  dispatchMenuCommand(command) {
25715
25724
  const { state } = this.view;