powerpagestoolkit 2.0.1 → 2.0.101

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.
@@ -40,6 +40,7 @@ export declare const _init: unique symbol;
40
40
  [_init](): Promise<void>;
41
41
  private _initValueSync;
42
42
  updateValue(): void;
43
+ private _observeValueChanges;
43
44
  private _attachVisibilityController;
44
45
  private _attachRadioButtons;
45
46
  /**
package/dist/bundle.js CHANGED
@@ -253,7 +253,6 @@ var DOMNodeReference = class {
253
253
  if (elementType === "checkbox" || elementType === "radio") {
254
254
  this.element.addEventListener("click", this.updateValue.bind(this));
255
255
  } else if (elementType === "select-one" || elementType === "select" || elementType === "select-multiple") {
256
- this.element.addEventListener("input", this.updateValue.bind(this));
257
256
  this.element.addEventListener("change", this.updateValue.bind(this));
258
257
  } else {
259
258
  this.element.addEventListener("input", this.updateValue.bind(this));
@@ -282,6 +281,17 @@ var DOMNodeReference = class {
282
281
  this.yesRadio.updateValue();
283
282
  this.noRadio.updateValue();
284
283
  }
284
+ this._observeValueChanges();
285
+ }
286
+ // Add a method to observe value changes using MutationObserver
287
+ _observeValueChanges() {
288
+ const observer = new MutationObserver(() => {
289
+ this.updateValue();
290
+ });
291
+ observer.observe(this.element, {
292
+ attributes: true,
293
+ attributeFilter: ["value"]
294
+ });
285
295
  }
286
296
  _attachVisibilityController() {
287
297
  this.visibilityController = this.element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powerpagestoolkit",
3
- "version": "2.0.1",
3
+ "version": "2.0.101",
4
4
  "description": "Reference, manipulate, and engage with Power Pages sites through the nodes in the DOM; use a variety of custom methods that allow customizing your power pages site quicker and easier. ",
5
5
  "main": "./dist/bundle.js",
6
6
  "types": "./dist/@types",