@innovastudio/contentbuilder 1.4.136 → 1.4.138

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.4.136",
4
+ "version": "1.4.138",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "files": [
@@ -159,6 +159,7 @@ class Util {
159
159
  e.preventDefault();
160
160
  e.stopImmediatePropagation();
161
161
  });
162
+ if (buttonok) buttonok.focus();
162
163
  }
163
164
  showRtePop(pop, onShow, btn) {
164
165
  const dom = this.dom;
@@ -45836,6 +45837,7 @@ class Image$1 {
45836
45837
 
45837
45838
  //Check if image is part of module snippet. If so, refresh the (active) module (hide imageTool). If not, refresh imageTool position
45838
45839
  this.refreshIfIsModule(img);
45840
+ this.startImageMonitor(img);
45839
45841
 
45840
45842
  //Trigger Change event
45841
45843
  this.builder.opts.onChange();
@@ -46370,6 +46372,30 @@ class Image$1 {
46370
46372
  this.builder.imgs = [];
46371
46373
  } //constructor
46372
46374
 
46375
+ startImageMonitor(target) {
46376
+ let observer;
46377
+ const config = {
46378
+ attributes: true
46379
+ };
46380
+ observer = new MutationObserver(mutations => {
46381
+ mutations.forEach(mutation => {
46382
+ if (mutation.attributeName === 'src') {
46383
+ // console.log('Image Changed:' + target.src);
46384
+
46385
+ if (this.builder.onImageSrcChange) this.builder.onImageSrcChange();
46386
+ stopImageMonitor(); // Stop the monitor when the image changes
46387
+ }
46388
+ });
46389
+ });
46390
+
46391
+ observer.observe(target, config);
46392
+ function stopImageMonitor() {
46393
+ if (observer) {
46394
+ observer.disconnect();
46395
+ // console.log('Monitor Stopped');
46396
+ }
46397
+ }
46398
+ }
46373
46399
  open() {
46374
46400
  const movControlBox = document.querySelector('.moveable-control-box');
46375
46401
  if (movControlBox) movControlBox.style.display = 'none'; //needed by Safari (prevent z-index problem)