@inditextech/weave-sdk 0.24.1 → 0.25.0
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 +24 -14
- package/dist/sdk.d.cts +10 -0
- package/dist/sdk.d.cts.map +1 -1
- package/dist/sdk.d.ts +10 -0
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +24 -14
- package/dist/sdk.js.map +1 -1
- package/package.json +2 -2
package/dist/sdk.js
CHANGED
|
@@ -18132,7 +18132,7 @@ var WeaveRegisterManager = class {
|
|
|
18132
18132
|
|
|
18133
18133
|
//#endregion
|
|
18134
18134
|
//#region package.json
|
|
18135
|
-
var version = "0.
|
|
18135
|
+
var version = "0.25.0";
|
|
18136
18136
|
|
|
18137
18137
|
//#endregion
|
|
18138
18138
|
//#region src/managers/setup.ts
|
|
@@ -19316,6 +19316,14 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
19316
19316
|
textArea.style.resize = "none";
|
|
19317
19317
|
textArea.style.lineHeight = `${textNode.lineHeight()}`;
|
|
19318
19318
|
textArea.style.fontFamily = textNode.fontFamily();
|
|
19319
|
+
let fontWeight = "normal";
|
|
19320
|
+
let fontStyle = "normal";
|
|
19321
|
+
if ((textNode.fontStyle() ?? "normal").indexOf("bold") !== -1) fontWeight = "bold";
|
|
19322
|
+
if ((textNode.fontStyle() ?? "normal").indexOf("italic") !== -1) fontStyle = "italic";
|
|
19323
|
+
textArea.style.fontWeight = fontWeight;
|
|
19324
|
+
textArea.style.fontStyle = fontStyle;
|
|
19325
|
+
textArea.style.fontVariant = textNode.fontVariant();
|
|
19326
|
+
textArea.style.textDecoration = textNode.textDecoration();
|
|
19319
19327
|
textAreaContainer.style.transformOrigin = "left top";
|
|
19320
19328
|
textArea.style.textAlign = textNode.align();
|
|
19321
19329
|
textArea.style.color = `${textNode.fill()}`;
|
|
@@ -22285,10 +22293,23 @@ var WeaveTextToolAction = class extends WeaveAction {
|
|
|
22285
22293
|
this.textId = null;
|
|
22286
22294
|
this.container = void 0;
|
|
22287
22295
|
this.clickPoint = null;
|
|
22296
|
+
this.props = this.initProps();
|
|
22288
22297
|
}
|
|
22289
22298
|
getName() {
|
|
22290
22299
|
return TEXT_TOOL_ACTION_NAME;
|
|
22291
22300
|
}
|
|
22301
|
+
initProps() {
|
|
22302
|
+
return {
|
|
22303
|
+
text: "",
|
|
22304
|
+
layout: TEXT_LAYOUT.AUTO_ALL,
|
|
22305
|
+
fontSize: 20,
|
|
22306
|
+
fontFamily: "Arial, sans-serif",
|
|
22307
|
+
fill: "#000000",
|
|
22308
|
+
align: "left",
|
|
22309
|
+
verticalAlign: "top",
|
|
22310
|
+
strokeEnabled: false
|
|
22311
|
+
};
|
|
22312
|
+
}
|
|
22292
22313
|
setupEvents() {
|
|
22293
22314
|
const stage = this.instance.getStage();
|
|
22294
22315
|
stage.container().addEventListener("keydown", (e) => {
|
|
@@ -22331,21 +22352,9 @@ var WeaveTextToolAction = class extends WeaveAction {
|
|
|
22331
22352
|
this.textId = v4_default();
|
|
22332
22353
|
const nodeHandler = this.instance.getNodeHandler("text");
|
|
22333
22354
|
const node = nodeHandler.create(this.textId, {
|
|
22355
|
+
...this.props,
|
|
22334
22356
|
x: this.clickPoint?.x ?? 0,
|
|
22335
22357
|
y: this.clickPoint?.y ?? 0,
|
|
22336
|
-
text: "",
|
|
22337
|
-
layout: TEXT_LAYOUT.AUTO_ALL,
|
|
22338
|
-
width: 10,
|
|
22339
|
-
fontSize: 20,
|
|
22340
|
-
fontFamily: "Arial, sans-serif",
|
|
22341
|
-
fill: "#000000ff",
|
|
22342
|
-
strokeEnabled: false,
|
|
22343
|
-
stroke: "#000000ff",
|
|
22344
|
-
strokeWidth: 1,
|
|
22345
|
-
strokeScaleEnabled: true,
|
|
22346
|
-
align: "left",
|
|
22347
|
-
verticalAlign: "top",
|
|
22348
|
-
opacity: 1,
|
|
22349
22358
|
draggable: true
|
|
22350
22359
|
});
|
|
22351
22360
|
this.instance.addNode(node, this.container?.getAttrs().id);
|
|
@@ -22358,6 +22367,7 @@ var WeaveTextToolAction = class extends WeaveAction {
|
|
|
22358
22367
|
this.cancelAction = cancelAction;
|
|
22359
22368
|
const selectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
22360
22369
|
if (selectionPlugin) selectionPlugin.setSelectedNodes([]);
|
|
22370
|
+
this.props = this.initProps();
|
|
22361
22371
|
this.addText();
|
|
22362
22372
|
}
|
|
22363
22373
|
cleanup() {
|