microboard-ui-temp 0.1.58 → 0.1.59

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.
Files changed (2) hide show
  1. package/dist/index.js +35 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -256631,6 +256631,41 @@ class Dice extends BaseItem {
256631
256631
  this.drawingContext = null;
256632
256632
  }
256633
256633
  }
256634
+ renderHTML(documentFactory) {
256635
+ const div = super.renderHTML(documentFactory);
256636
+ const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
256637
+ const mbr = this.getMbr();
256638
+ const width2 = mbr.getWidth();
256639
+ const height3 = mbr.getHeight();
256640
+ const unscaledWidth = width2 / scaleX;
256641
+ const unscaledHeight = height3 / scaleY;
256642
+ const svg3 = documentFactory.createElementNS("http://www.w3.org/2000/svg", "svg");
256643
+ svg3.setAttribute("width", `${unscaledWidth}px`);
256644
+ svg3.setAttribute("height", `${unscaledHeight}px`);
256645
+ svg3.setAttribute("viewBox", `0 0 ${unscaledWidth} ${unscaledHeight}`);
256646
+ svg3.setAttribute("transform-origin", "0 0");
256647
+ svg3.setAttribute("transform", `scale(${1 / scaleX}, ${1 / scaleY})`);
256648
+ svg3.setAttribute("style", "position: absolute; overflow: visible;");
256649
+ const pathElement = Shapes["RoundedRectangle"].path.copy().renderHTML(documentFactory);
256650
+ const paths = Array.isArray(pathElement) ? pathElement : [pathElement];
256651
+ paths.forEach((element4) => {
256652
+ element4.setAttribute("fill", this.backgroundColor);
256653
+ element4.setAttribute("stroke", this.borderColor);
256654
+ element4.setAttribute("stroke-dasharray", LinePatterns[this.borderStyle].join(", "));
256655
+ element4.setAttribute("stroke-width", this.borderWidth.toString());
256656
+ element4.setAttribute("transform-origin", "0 0");
256657
+ element4.setAttribute("transform", `scale(${scaleX}, ${scaleY})`);
256658
+ });
256659
+ svg3.append(...paths);
256660
+ div.appendChild(svg3);
256661
+ div.id = this.getId();
256662
+ div.style.width = unscaledWidth + "px";
256663
+ div.style.height = unscaledHeight + "px";
256664
+ div.style.transformOrigin = "left top";
256665
+ div.style.transform = `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})`;
256666
+ div.style.position = "absolute";
256667
+ return div;
256668
+ }
256634
256669
  }
256635
256670
  registerItem({
256636
256671
  item: Dice,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-ui-temp",
3
- "version": "0.1.58",
3
+ "version": "0.1.59",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "type": "module",
@@ -60,7 +60,7 @@
60
60
  "i18next-browser-languagedetector": "^8.2.0",
61
61
  "js-cookie": "^3.0.5",
62
62
  "jwt-decode": "^4.0.0",
63
- "microboard-temp": "^0.5.18",
63
+ "microboard-temp": "^0.5.19",
64
64
  "nanoid": "^5.1.5",
65
65
  "prop-types": "^15.8.1",
66
66
  "react-hot-toast": "2.4.1",