@inditextech/weave-sdk 0.27.0 → 0.27.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/dist/sdk.cjs +11 -7
- package/dist/sdk.js +11 -7
- package/dist/sdk.js.map +1 -1
- package/package.json +2 -2
package/dist/sdk.cjs
CHANGED
|
@@ -18136,7 +18136,7 @@ var WeaveRegisterManager = class {
|
|
|
18136
18136
|
|
|
18137
18137
|
//#endregion
|
|
18138
18138
|
//#region package.json
|
|
18139
|
-
var version = "0.27.
|
|
18139
|
+
var version = "0.27.2";
|
|
18140
18140
|
|
|
18141
18141
|
//#endregion
|
|
18142
18142
|
//#region src/managers/setup.ts
|
|
@@ -19259,7 +19259,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
19259
19259
|
textAreaDomResize(textAreaContainer, textArea, textNode) {
|
|
19260
19260
|
if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL) {
|
|
19261
19261
|
const { width: textAreaWidth } = this.textRenderedSize(textArea.value, textNode);
|
|
19262
|
-
textAreaContainer.style.width = textAreaWidth * textNode.getAbsoluteScale().x +
|
|
19262
|
+
textAreaContainer.style.width = textAreaWidth * textNode.getAbsoluteScale().x + 2 + "px";
|
|
19263
19263
|
}
|
|
19264
19264
|
if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_HEIGHT) textAreaContainer.style.height = "auto";
|
|
19265
19265
|
if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_HEIGHT) {
|
|
@@ -19350,6 +19350,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
19350
19350
|
textArea.style.minHeight = "auto";
|
|
19351
19351
|
textArea.style.margin = "0px";
|
|
19352
19352
|
textArea.style.padding = "0px";
|
|
19353
|
+
textArea.style.boxSizing = "content-box";
|
|
19353
19354
|
textArea.style.overflow = "hidden";
|
|
19354
19355
|
textArea.style.background = "transparent";
|
|
19355
19356
|
textArea.style.border = "none";
|
|
@@ -19399,14 +19400,15 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
19399
19400
|
const rotation = textNode.rotation();
|
|
19400
19401
|
let transform = "";
|
|
19401
19402
|
if (rotation) transform += "rotateZ(" + rotation + "deg)";
|
|
19402
|
-
const
|
|
19403
|
-
const
|
|
19403
|
+
const measures = textNode.measureSize(textNode.text());
|
|
19404
|
+
const px = 0 * stage.scaleX();
|
|
19405
|
+
const py = 2 * (measures.fontBoundingBoxAscent - measures.hangingBaseline - measures.fontBoundingBoxDescent) * stage.scaleY();
|
|
19404
19406
|
transform += "translateX(" + px + "px)";
|
|
19405
19407
|
transform += "translateY(" + py + "px)";
|
|
19406
19408
|
textArea.style.transform = transform;
|
|
19407
19409
|
const handleKeyDown = (e) => {
|
|
19408
|
-
e.stopPropagation();
|
|
19409
19410
|
if (textArea && textNode && e.key === "Escape") {
|
|
19411
|
+
e.stopPropagation();
|
|
19410
19412
|
if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL) {
|
|
19411
19413
|
const { width: textAreaWidth } = this.textRenderedSize(textArea.value, textNode);
|
|
19412
19414
|
textNode.width(textAreaWidth + 3.2);
|
|
@@ -19435,8 +19437,9 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
19435
19437
|
textArea.tabIndex = 1;
|
|
19436
19438
|
textArea.focus();
|
|
19437
19439
|
const handleOutsideClick = (e) => {
|
|
19440
|
+
e.stopPropagation();
|
|
19438
19441
|
let clickedOnCanvas = false;
|
|
19439
|
-
if (e.target?.id
|
|
19442
|
+
if (e.target?.id !== `${textNode.id()}`) clickedOnCanvas = true;
|
|
19440
19443
|
if (clickedOnCanvas) {
|
|
19441
19444
|
textNode.text(textArea.value);
|
|
19442
19445
|
this.removeTextAreaDOM(textNode);
|
|
@@ -19450,7 +19453,8 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
19450
19453
|
setTimeout(() => {
|
|
19451
19454
|
window.addEventListener("click", handleOutsideClick);
|
|
19452
19455
|
window.addEventListener("touchstart", handleOutsideClick);
|
|
19453
|
-
});
|
|
19456
|
+
}, 0);
|
|
19457
|
+
this.editing = true;
|
|
19454
19458
|
}
|
|
19455
19459
|
updateTextAreaDOM(textNode) {
|
|
19456
19460
|
const textAreaContainer = document.getElementById(`${textNode.id()}_container`);
|
package/dist/sdk.js
CHANGED
|
@@ -18136,7 +18136,7 @@ var WeaveRegisterManager = class {
|
|
|
18136
18136
|
|
|
18137
18137
|
//#endregion
|
|
18138
18138
|
//#region package.json
|
|
18139
|
-
var version = "0.27.
|
|
18139
|
+
var version = "0.27.2";
|
|
18140
18140
|
|
|
18141
18141
|
//#endregion
|
|
18142
18142
|
//#region src/managers/setup.ts
|
|
@@ -19259,7 +19259,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
19259
19259
|
textAreaDomResize(textAreaContainer, textArea, textNode) {
|
|
19260
19260
|
if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL) {
|
|
19261
19261
|
const { width: textAreaWidth } = this.textRenderedSize(textArea.value, textNode);
|
|
19262
|
-
textAreaContainer.style.width = textAreaWidth * textNode.getAbsoluteScale().x +
|
|
19262
|
+
textAreaContainer.style.width = textAreaWidth * textNode.getAbsoluteScale().x + 2 + "px";
|
|
19263
19263
|
}
|
|
19264
19264
|
if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_HEIGHT) textAreaContainer.style.height = "auto";
|
|
19265
19265
|
if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_HEIGHT) {
|
|
@@ -19350,6 +19350,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
19350
19350
|
textArea.style.minHeight = "auto";
|
|
19351
19351
|
textArea.style.margin = "0px";
|
|
19352
19352
|
textArea.style.padding = "0px";
|
|
19353
|
+
textArea.style.boxSizing = "content-box";
|
|
19353
19354
|
textArea.style.overflow = "hidden";
|
|
19354
19355
|
textArea.style.background = "transparent";
|
|
19355
19356
|
textArea.style.border = "none";
|
|
@@ -19399,14 +19400,15 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
19399
19400
|
const rotation = textNode.rotation();
|
|
19400
19401
|
let transform = "";
|
|
19401
19402
|
if (rotation) transform += "rotateZ(" + rotation + "deg)";
|
|
19402
|
-
const
|
|
19403
|
-
const
|
|
19403
|
+
const measures = textNode.measureSize(textNode.text());
|
|
19404
|
+
const px = 0 * stage.scaleX();
|
|
19405
|
+
const py = 2 * (measures.fontBoundingBoxAscent - measures.hangingBaseline - measures.fontBoundingBoxDescent) * stage.scaleY();
|
|
19404
19406
|
transform += "translateX(" + px + "px)";
|
|
19405
19407
|
transform += "translateY(" + py + "px)";
|
|
19406
19408
|
textArea.style.transform = transform;
|
|
19407
19409
|
const handleKeyDown = (e) => {
|
|
19408
|
-
e.stopPropagation();
|
|
19409
19410
|
if (textArea && textNode && e.key === "Escape") {
|
|
19411
|
+
e.stopPropagation();
|
|
19410
19412
|
if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL) {
|
|
19411
19413
|
const { width: textAreaWidth } = this.textRenderedSize(textArea.value, textNode);
|
|
19412
19414
|
textNode.width(textAreaWidth + 3.2);
|
|
@@ -19435,8 +19437,9 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
19435
19437
|
textArea.tabIndex = 1;
|
|
19436
19438
|
textArea.focus();
|
|
19437
19439
|
const handleOutsideClick = (e) => {
|
|
19440
|
+
e.stopPropagation();
|
|
19438
19441
|
let clickedOnCanvas = false;
|
|
19439
|
-
if (e.target?.id
|
|
19442
|
+
if (e.target?.id !== `${textNode.id()}`) clickedOnCanvas = true;
|
|
19440
19443
|
if (clickedOnCanvas) {
|
|
19441
19444
|
textNode.text(textArea.value);
|
|
19442
19445
|
this.removeTextAreaDOM(textNode);
|
|
@@ -19450,7 +19453,8 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
19450
19453
|
setTimeout(() => {
|
|
19451
19454
|
window.addEventListener("click", handleOutsideClick);
|
|
19452
19455
|
window.addEventListener("touchstart", handleOutsideClick);
|
|
19453
|
-
});
|
|
19456
|
+
}, 0);
|
|
19457
|
+
this.editing = true;
|
|
19454
19458
|
}
|
|
19455
19459
|
updateTextAreaDOM(textNode) {
|
|
19456
19460
|
const textAreaContainer = document.getElementById(`${textNode.id()}_container`);
|