@inditextech/weave-sdk 0.21.0 → 0.21.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 +55 -24
- package/dist/sdk.d.cts.map +1 -1
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +55 -24
- package/dist/sdk.js.map +1 -1
- package/package.json +2 -2
package/dist/sdk.js
CHANGED
|
@@ -626,6 +626,7 @@ var require_browser = __commonJS({ "../../node_modules/pino/browser.js"(exports,
|
|
|
626
626
|
transmit: transmit$1,
|
|
627
627
|
serialize,
|
|
628
628
|
asObject: opts.browser.asObject,
|
|
629
|
+
asObjectBindingsOnly: opts.browser.asObjectBindingsOnly,
|
|
629
630
|
formatters: opts.browser.formatters,
|
|
630
631
|
levels,
|
|
631
632
|
timestamp: getTimeFunction(opts),
|
|
@@ -634,6 +635,10 @@ var require_browser = __commonJS({ "../../node_modules/pino/browser.js"(exports,
|
|
|
634
635
|
};
|
|
635
636
|
logger.levels = getLevels(opts);
|
|
636
637
|
logger.level = level;
|
|
638
|
+
logger.isLevelEnabled = function(level$1) {
|
|
639
|
+
if (!this.levels.values[level$1]) return false;
|
|
640
|
+
return this.levels.values[level$1] >= this.levels.values[this.level];
|
|
641
|
+
};
|
|
637
642
|
logger.setMaxListeners = logger.getMaxListeners = logger.emit = logger.addListener = logger.on = logger.prependListener = logger.once = logger.prependOnceListener = logger.removeListener = logger.removeAllListeners = logger.listeners = logger.listenerCount = logger.eventNames = logger.write = logger.flush = noop;
|
|
638
643
|
logger.serializers = serializers;
|
|
639
644
|
logger._serialize = serialize;
|
|
@@ -780,7 +785,7 @@ var require_browser = __commonJS({ "../../node_modules/pino/browser.js"(exports,
|
|
|
780
785
|
applySerializers(args, this._serialize, this.serializers, this._stdErrSerialize);
|
|
781
786
|
argsIsSerialized = true;
|
|
782
787
|
}
|
|
783
|
-
if (opts.asObject || opts.formatters) write.call(proto, asObject(this, level, args, ts, opts));
|
|
788
|
+
if (opts.asObject || opts.formatters) write.call(proto, ...asObject(this, level, args, ts, opts));
|
|
784
789
|
else write.apply(proto, args);
|
|
785
790
|
if (opts.transmit) {
|
|
786
791
|
const transmitLevel = opts.transmit.level || self$1._level;
|
|
@@ -805,20 +810,26 @@ var require_browser = __commonJS({ "../../node_modules/pino/browser.js"(exports,
|
|
|
805
810
|
const argsCloned = args.slice();
|
|
806
811
|
let msg = argsCloned[0];
|
|
807
812
|
const logObject = {};
|
|
813
|
+
let lvl = (logger._childLevel | 0) + 1;
|
|
814
|
+
if (lvl < 1) lvl = 1;
|
|
808
815
|
if (ts) logObject.time = ts;
|
|
809
816
|
if (levelFormatter) {
|
|
810
817
|
const formattedLevel = levelFormatter(level, logger.levels.values[level]);
|
|
811
818
|
Object.assign(logObject, formattedLevel);
|
|
812
819
|
} else logObject.level = logger.levels.values[level];
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
820
|
+
if (opts.asObjectBindingsOnly) {
|
|
821
|
+
if (msg !== null && typeof msg === "object") while (lvl-- && typeof argsCloned[0] === "object") Object.assign(logObject, argsCloned.shift());
|
|
822
|
+
const formattedLogObject = logObjectFormatter(logObject);
|
|
823
|
+
return [formattedLogObject, ...argsCloned];
|
|
824
|
+
} else {
|
|
825
|
+
if (msg !== null && typeof msg === "object") {
|
|
826
|
+
while (lvl-- && typeof argsCloned[0] === "object") Object.assign(logObject, argsCloned.shift());
|
|
827
|
+
msg = argsCloned.length ? format(argsCloned.shift(), argsCloned) : void 0;
|
|
828
|
+
} else if (typeof msg === "string") msg = format(argsCloned.shift(), argsCloned);
|
|
829
|
+
if (msg !== void 0) logObject[opts.messageKey] = msg;
|
|
830
|
+
const formattedLogObject = logObjectFormatter(logObject);
|
|
831
|
+
return [formattedLogObject];
|
|
832
|
+
}
|
|
822
833
|
}
|
|
823
834
|
function applySerializers(args, serialize, serializers, stdErrSerialize) {
|
|
824
835
|
for (const i in args) if (stdErrSerialize && args[i] instanceof Error) args[i] = pino.stdSerializers.err(args[i]);
|
|
@@ -15968,14 +15979,14 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
15968
15979
|
tr.on("dragmove", (0, import_lodash.throttle)(handleDragMove, 50));
|
|
15969
15980
|
tr.on("dragend", (e) => {
|
|
15970
15981
|
e.cancelBubble = true;
|
|
15971
|
-
const actualCursor = stage.container().style.cursor;
|
|
15972
|
-
stage.container().style.cursor = "wait";
|
|
15973
15982
|
const selectedNodes = tr.nodes();
|
|
15974
15983
|
for (let i = 0; i < selectedNodes.length; i++) {
|
|
15975
15984
|
const node = selectedNodes[i];
|
|
15976
15985
|
node.updatePosition(e.target.getAbsolutePosition());
|
|
15977
15986
|
}
|
|
15978
15987
|
if (this.isSelecting() && tr.nodes().length > 1) {
|
|
15988
|
+
const actualCursor = stage.container().style.cursor;
|
|
15989
|
+
stage.container().style.cursor = "wait";
|
|
15979
15990
|
clearContainerTargets(this.instance);
|
|
15980
15991
|
const toUpdate = [];
|
|
15981
15992
|
const nodeUpdatePromise = (node) => {
|
|
@@ -16539,12 +16550,18 @@ var WeaveNode = class {
|
|
|
16539
16550
|
}
|
|
16540
16551
|
lineNode.points(newPoints);
|
|
16541
16552
|
}
|
|
16553
|
+
const widthNotNormalized = node.width();
|
|
16554
|
+
const heightNotNormalized = node.height();
|
|
16542
16555
|
node.width(Math.max(5, node.width() * node.scaleX()));
|
|
16543
16556
|
node.height(Math.max(5, node.height() * node.scaleY()));
|
|
16544
|
-
if (node.getAttrs().nodeType === "image")
|
|
16545
|
-
|
|
16546
|
-
|
|
16547
|
-
|
|
16557
|
+
if (node.getAttrs().nodeType === "image") {
|
|
16558
|
+
const uncroppedWidth = node.getAttrs().uncroppedImage ? node.getAttrs().uncroppedImage.width : widthNotNormalized;
|
|
16559
|
+
const uncroppedHeight = node.getAttrs().uncroppedImage ? node.getAttrs().uncroppedImage.height : heightNotNormalized;
|
|
16560
|
+
node.setAttrs({ uncroppedImage: {
|
|
16561
|
+
width: uncroppedWidth * node.scaleX(),
|
|
16562
|
+
height: uncroppedHeight * node.scaleY()
|
|
16563
|
+
} });
|
|
16564
|
+
}
|
|
16548
16565
|
node.scaleX(1);
|
|
16549
16566
|
node.scaleY(1);
|
|
16550
16567
|
}
|
|
@@ -16569,6 +16586,8 @@ var WeaveNode = class {
|
|
|
16569
16586
|
if (nodesSnappingPlugin && transforming && this.isSelecting() && this.isNodeSelected(node$1)) nodesSnappingPlugin.evaluateGuidelines(e);
|
|
16570
16587
|
if (this.isSelecting() && this.isNodeSelected(node$1)) {
|
|
16571
16588
|
this.scaleReset(node$1);
|
|
16589
|
+
const nodeHandler = this.instance.getNodeHandler(node$1.getAttrs().nodeType);
|
|
16590
|
+
this.instance.updateNode(nodeHandler.serialize(node$1));
|
|
16572
16591
|
e.cancelBubble = true;
|
|
16573
16592
|
}
|
|
16574
16593
|
};
|
|
@@ -18072,7 +18091,7 @@ var WeaveRegisterManager = class {
|
|
|
18072
18091
|
|
|
18073
18092
|
//#endregion
|
|
18074
18093
|
//#region package.json
|
|
18075
|
-
var version = "0.21.
|
|
18094
|
+
var version = "0.21.2";
|
|
18076
18095
|
|
|
18077
18096
|
//#endregion
|
|
18078
18097
|
//#region src/managers/setup.ts
|
|
@@ -20085,12 +20104,19 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
20085
20104
|
width: imageObj.width,
|
|
20086
20105
|
height: imageObj.height
|
|
20087
20106
|
});
|
|
20107
|
+
this.scaleReset(image);
|
|
20088
20108
|
const imageRect = image.getClientRect({ relativeTo: this.instance.getStage() });
|
|
20089
|
-
image.setAttr("uncroppedImage", {
|
|
20090
|
-
width: imageProps.uncroppedImage
|
|
20091
|
-
height: imageProps.uncroppedImage
|
|
20109
|
+
if (imageProps.cropInfo && imageProps.uncroppedImage) image.setAttr("uncroppedImage", {
|
|
20110
|
+
width: imageProps.uncroppedImage.width,
|
|
20111
|
+
height: imageProps.uncroppedImage.height
|
|
20112
|
+
});
|
|
20113
|
+
if (!imageProps.cropInfo) image.setAttr("uncroppedImage", {
|
|
20114
|
+
width: imageRect.width,
|
|
20115
|
+
height: imageRect.height
|
|
20092
20116
|
});
|
|
20093
20117
|
this.updateCrop(imageProps);
|
|
20118
|
+
const nodeHandler = this.instance.getNodeHandler(image.getAttrs().nodeType);
|
|
20119
|
+
this.instance.updateNode(nodeHandler.serialize(image));
|
|
20094
20120
|
}
|
|
20095
20121
|
};
|
|
20096
20122
|
if (imageProps.imageURL) imageObj.src = imageProps.imageURL;
|
|
@@ -20271,7 +20297,8 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
20271
20297
|
width: props.frameWidth,
|
|
20272
20298
|
height: props.frameHeight,
|
|
20273
20299
|
fill: "transparent",
|
|
20274
|
-
draggable: false
|
|
20300
|
+
draggable: false,
|
|
20301
|
+
clip: void 0
|
|
20275
20302
|
});
|
|
20276
20303
|
const frameInternalGroup = new Konva.Group({
|
|
20277
20304
|
id: `${id}-selector`,
|
|
@@ -20438,11 +20465,15 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
20438
20465
|
const frameNode = nodeInstance;
|
|
20439
20466
|
const newProps = { ...nextProps };
|
|
20440
20467
|
const { titleHeight } = this.config;
|
|
20441
|
-
nodeInstance.setAttrs({
|
|
20468
|
+
nodeInstance.setAttrs({
|
|
20469
|
+
...newProps,
|
|
20470
|
+
clip: void 0
|
|
20471
|
+
});
|
|
20442
20472
|
const selectorArea = frameNode.findOne(`#${id}-selector-area`);
|
|
20443
20473
|
if (selectorArea) {
|
|
20444
|
-
const
|
|
20445
|
-
const
|
|
20474
|
+
const resizable = this.config.transform?.resizeEnabled ?? false;
|
|
20475
|
+
const width = !resizable ? nextProps.frameWidth : nextProps.width;
|
|
20476
|
+
const height = !resizable ? nextProps.frameHeight : nextProps.height;
|
|
20446
20477
|
selectorArea.setAttrs({
|
|
20447
20478
|
x: 0,
|
|
20448
20479
|
y: 0,
|