@textbus/xnote 0.0.1-alpha.26 → 0.0.1-alpha.27

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.
@@ -3582,9 +3582,11 @@ const imageComponentLoader = {
3582
3582
  return element.tagName === 'IMG' || element.dataset.component === ImageComponent.componentName;
3583
3583
  },
3584
3584
  read(element, textbus) {
3585
- var _a;
3585
+ const img = element instanceof HTMLImageElement ? element : (element.querySelector('img') || document.createElement('img'));
3586
3586
  return new ImageComponent(textbus, {
3587
- src: element instanceof HTMLImageElement ? element.src : ((_a = element.querySelector('img')) === null || _a === void 0 ? void 0 : _a.src) || ''
3587
+ src: img.src,
3588
+ width: img.style.width || 'auto',
3589
+ height: img.style.height || 'auto'
3588
3590
  });
3589
3591
  }
3590
3592
  };
package/bundles/index.js CHANGED
@@ -3584,9 +3584,11 @@ const imageComponentLoader = {
3584
3584
  return element.tagName === 'IMG' || element.dataset.component === ImageComponent.componentName;
3585
3585
  },
3586
3586
  read(element, textbus) {
3587
- var _a;
3587
+ const img = element instanceof HTMLImageElement ? element : (element.querySelector('img') || document.createElement('img'));
3588
3588
  return new ImageComponent(textbus, {
3589
- src: element instanceof HTMLImageElement ? element.src : ((_a = element.querySelector('img')) === null || _a === void 0 ? void 0 : _a.src) || ''
3589
+ src: img.src,
3590
+ width: img.style.width || 'auto',
3591
+ height: img.style.height || 'auto'
3590
3592
  });
3591
3593
  }
3592
3594
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/xnote",
3
- "version": "0.0.1-alpha.26",
3
+ "version": "0.0.1-alpha.27",
4
4
  "description": "A high-performance rich text editor that supports multiplayer online collaboration.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",