@inditextech/weave-sdk 4.1.1 → 4.2.0-SNAPSHOT.318.1
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.js +789 -19
- package/dist/sdk.node.js +789 -19
- package/dist/sdk.node.stats.html +1 -1
- package/dist/sdk.stats.html +1 -1
- package/dist/stage-minimap.worker.js +0 -1
- package/dist/stage-minimap.worker.stats.html +1 -1
- package/dist/types.d.ts +166 -30
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +835 -65
- package/dist/types.js.map +1 -1
- package/dist/types.stats.html +1 -1
- package/package.json +2 -3
package/dist/sdk.node.js
CHANGED
|
@@ -3,7 +3,9 @@ import crypto, { randomFillSync, randomUUID } from "crypto";
|
|
|
3
3
|
import pino from "pino";
|
|
4
4
|
import { WEAVE_ASYNC_STATUS, WEAVE_AWARENESS_LAYER_ID, WEAVE_EXPORT_BACKGROUND_COLOR, WEAVE_EXPORT_FORMATS, WEAVE_EXPORT_RETURN_FORMAT, WEAVE_INSTANCE_STATUS, WEAVE_KONVA_BACKEND, WEAVE_LOG_LEVEL, WEAVE_NODE_CHANGE_TYPE, WEAVE_NODE_CUSTOM_EVENTS, WEAVE_NODE_LAYER_ID, WEAVE_NODE_POSITION, WEAVE_STORE_CONNECTION_STATUS, WEAVE_UTILITY_LAYER_ID } from "@inditextech/weave-types";
|
|
5
5
|
import { getYjsDoc, getYjsValue, observeDeep, syncedStore } from "@syncedstore/core";
|
|
6
|
+
import * as Y$1 from "yjs";
|
|
6
7
|
import * as Y from "yjs";
|
|
8
|
+
import { z } from "zod";
|
|
7
9
|
import simplify from "simplify-js";
|
|
8
10
|
import "konva/lib/types";
|
|
9
11
|
import "konva/lib/Stage";
|
|
@@ -10480,7 +10482,7 @@ var require_lodash = __commonJS({ "../../node_modules/lodash/lodash.js"(exports,
|
|
|
10480
10482
|
* // => false
|
|
10481
10483
|
*/
|
|
10482
10484
|
function isNaN$1(value) {
|
|
10483
|
-
return isNumber(value) && value != +value;
|
|
10485
|
+
return isNumber$1(value) && value != +value;
|
|
10484
10486
|
}
|
|
10485
10487
|
/**
|
|
10486
10488
|
* Checks if `value` is a pristine native function.
|
|
@@ -10581,7 +10583,7 @@ var require_lodash = __commonJS({ "../../node_modules/lodash/lodash.js"(exports,
|
|
|
10581
10583
|
* _.isNumber('3');
|
|
10582
10584
|
* // => false
|
|
10583
10585
|
*/
|
|
10584
|
-
function isNumber(value) {
|
|
10586
|
+
function isNumber$1(value) {
|
|
10585
10587
|
return typeof value == "number" || isObjectLike$7(value) && baseGetTag$6(value) == numberTag$1;
|
|
10586
10588
|
}
|
|
10587
10589
|
/**
|
|
@@ -14916,7 +14918,7 @@ var require_lodash = __commonJS({ "../../node_modules/lodash/lodash.js"(exports,
|
|
|
14916
14918
|
lodash.isNative = isNative;
|
|
14917
14919
|
lodash.isNil = isNil;
|
|
14918
14920
|
lodash.isNull = isNull;
|
|
14919
|
-
lodash.isNumber = isNumber;
|
|
14921
|
+
lodash.isNumber = isNumber$1;
|
|
14920
14922
|
lodash.isObject = isObject$11;
|
|
14921
14923
|
lodash.isObjectLike = isObjectLike$7;
|
|
14922
14924
|
lodash.isPlainObject = isPlainObject$2;
|
|
@@ -15196,7 +15198,7 @@ var import_lodash = __toESM(require_lodash(), 1);
|
|
|
15196
15198
|
|
|
15197
15199
|
//#endregion
|
|
15198
15200
|
//#region src/yjs.ts
|
|
15199
|
-
var yjs_default = Y;
|
|
15201
|
+
var yjs_default = Y$1;
|
|
15200
15202
|
|
|
15201
15203
|
//#endregion
|
|
15202
15204
|
//#region src/stores/default-initial-state.ts
|
|
@@ -15275,6 +15277,7 @@ var WeaveStore = class {
|
|
|
15275
15277
|
return this.document;
|
|
15276
15278
|
}
|
|
15277
15279
|
restartDocument() {
|
|
15280
|
+
this.document?.destroy();
|
|
15278
15281
|
this.latestState = {
|
|
15279
15282
|
weave: {},
|
|
15280
15283
|
weaveMetadata: {}
|
|
@@ -18141,6 +18144,9 @@ function getStageClickPoint(instance, pointerPos) {
|
|
|
18141
18144
|
};
|
|
18142
18145
|
return stageClickPoint;
|
|
18143
18146
|
}
|
|
18147
|
+
function isNumber(value) {
|
|
18148
|
+
return typeof value === "number" && !Number.isNaN(value);
|
|
18149
|
+
}
|
|
18144
18150
|
|
|
18145
18151
|
//#endregion
|
|
18146
18152
|
//#region src/actions/selection-tool/constants.ts
|
|
@@ -18949,10 +18955,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
18949
18955
|
});
|
|
18950
18956
|
tr.on("mouseover", () => {
|
|
18951
18957
|
const nodesSelected = tr.nodes();
|
|
18952
|
-
if (nodesSelected.length
|
|
18953
|
-
const node = nodesSelected[0];
|
|
18954
|
-
stage.container().style.cursor = (typeof node?.defineMousePointer === "function" ? node.defineMousePointer() : null) ?? "grab";
|
|
18955
|
-
} else stage.container().style.cursor = "grab";
|
|
18958
|
+
if (nodesSelected.length > 1) stage.container().style.cursor = "grab";
|
|
18956
18959
|
});
|
|
18957
18960
|
tr.on("mouseout", (e) => {
|
|
18958
18961
|
this.instance.getStage().handleMouseover?.(e);
|
|
@@ -21087,6 +21090,46 @@ var WeaveNode = class {
|
|
|
21087
21090
|
getIsAsync() {
|
|
21088
21091
|
return false;
|
|
21089
21092
|
}
|
|
21093
|
+
static defaultState(nodeId) {
|
|
21094
|
+
return {
|
|
21095
|
+
key: nodeId,
|
|
21096
|
+
type: "unknown",
|
|
21097
|
+
props: {
|
|
21098
|
+
id: nodeId,
|
|
21099
|
+
nodeType: "unknown",
|
|
21100
|
+
x: 0,
|
|
21101
|
+
y: 0,
|
|
21102
|
+
width: 100,
|
|
21103
|
+
height: 100,
|
|
21104
|
+
rotation: 0,
|
|
21105
|
+
scaleX: 1,
|
|
21106
|
+
scaleY: 1,
|
|
21107
|
+
opacity: 1,
|
|
21108
|
+
zIndex: 1,
|
|
21109
|
+
children: []
|
|
21110
|
+
}
|
|
21111
|
+
};
|
|
21112
|
+
}
|
|
21113
|
+
static getSchema() {
|
|
21114
|
+
const baseNodeSchema = z.object({
|
|
21115
|
+
key: z.string().describe("Unique identifier (uuid) for the node, generate one it if not provided"),
|
|
21116
|
+
type: z.string().describe("Type of the node, must be always provided"),
|
|
21117
|
+
props: z.object({
|
|
21118
|
+
id: z.string().describe("Unique identifier (uuid) for the node instance, is the same as key"),
|
|
21119
|
+
nodeType: z.string().describe("Type of the node, must be always provided"),
|
|
21120
|
+
x: z.number().describe("X position of the node, relative to the parent container"),
|
|
21121
|
+
y: z.number().describe("Y position of the node, relative to the parent container"),
|
|
21122
|
+
scaleX: z.number().describe("Scale factor on the X axis, default is 1"),
|
|
21123
|
+
scaleY: z.number().describe("Scale factor on the Y axis, default is 1"),
|
|
21124
|
+
rotation: z.number().optional().describe("Rotation of the node in degrees, default is 0"),
|
|
21125
|
+
skewX: z.number().optional().describe("Skew on the X axis in degrees, default is 0"),
|
|
21126
|
+
skewY: z.number().optional().describe("Skew on the Y axis in degrees, default is 0"),
|
|
21127
|
+
opacity: z.number().describe("Opacity of the node, between 0 and 1, default is 1"),
|
|
21128
|
+
children: z.array(z.any()).length(0).describe("Children nodes, always be an empty array for leaf nodes")
|
|
21129
|
+
})
|
|
21130
|
+
});
|
|
21131
|
+
return baseNodeSchema;
|
|
21132
|
+
}
|
|
21090
21133
|
};
|
|
21091
21134
|
|
|
21092
21135
|
//#endregion
|
|
@@ -22198,7 +22241,7 @@ var WeaveRegisterManager = class {
|
|
|
22198
22241
|
|
|
22199
22242
|
//#endregion
|
|
22200
22243
|
//#region package.json
|
|
22201
|
-
var version = "4.
|
|
22244
|
+
var version = "4.2.0-SNAPSHOT.318.1";
|
|
22202
22245
|
|
|
22203
22246
|
//#endregion
|
|
22204
22247
|
//#region src/managers/setup.ts
|
|
@@ -23422,6 +23465,9 @@ var WeaveHooksManager = class {
|
|
|
23422
23465
|
unregisterHook(hookName) {
|
|
23423
23466
|
this.registeredHooks.delete(hookName);
|
|
23424
23467
|
}
|
|
23468
|
+
reset() {
|
|
23469
|
+
this.registeredHooks.clear();
|
|
23470
|
+
}
|
|
23425
23471
|
};
|
|
23426
23472
|
|
|
23427
23473
|
//#endregion
|
|
@@ -23616,6 +23662,8 @@ var Weave = class {
|
|
|
23616
23662
|
const nodeHandler = nodeHandlers[nodeHandlerKey];
|
|
23617
23663
|
nodeHandler?.onDestroyInstance();
|
|
23618
23664
|
}
|
|
23665
|
+
const mainLayer = this.stageManager.getMainLayer();
|
|
23666
|
+
if (mainLayer) mainLayer.destroy();
|
|
23619
23667
|
const stage = this.getStage();
|
|
23620
23668
|
if (stage) stage.destroy();
|
|
23621
23669
|
if (this.eventsController) this.eventsController.abort();
|
|
@@ -23630,6 +23678,8 @@ var Weave = class {
|
|
|
23630
23678
|
this.status = WEAVE_INSTANCE_STATUS.STARTING;
|
|
23631
23679
|
this.emitEvent("onInstanceStatus", this.status);
|
|
23632
23680
|
this.registerManager.reset();
|
|
23681
|
+
this.hooks.removeAllHooks();
|
|
23682
|
+
this.hooksManager.reset();
|
|
23633
23683
|
this.status = WEAVE_INSTANCE_STATUS.LOADING_FONTS;
|
|
23634
23684
|
this.emitEvent("onInstanceStatus", this.status);
|
|
23635
23685
|
await this.fontsManager.loadFonts();
|
|
@@ -23647,6 +23697,7 @@ var Weave = class {
|
|
|
23647
23697
|
this.emitEvent("onInstanceStatus", this.status);
|
|
23648
23698
|
const store = this.storeManager.getStore();
|
|
23649
23699
|
store.disconnect();
|
|
23700
|
+
store.getDocument()?.destroy();
|
|
23650
23701
|
const nodeHandlers = this.registerManager.getNodesHandlers();
|
|
23651
23702
|
for (const nodeHandlerKey of Object.keys(nodeHandlers)) {
|
|
23652
23703
|
const nodeHandler = nodeHandlers[nodeHandlerKey];
|
|
@@ -24416,6 +24467,114 @@ const downscaleImageFromURL = (url, options) => {
|
|
|
24416
24467
|
});
|
|
24417
24468
|
};
|
|
24418
24469
|
|
|
24470
|
+
//#endregion
|
|
24471
|
+
//#region src/state.manipulation.ts
|
|
24472
|
+
var WeaveStateManipulation = class WeaveStateManipulation {
|
|
24473
|
+
static mapPropsToYjs(props) {
|
|
24474
|
+
const propsMap = new Y.Map();
|
|
24475
|
+
for (const propKey of Object.keys(props)) {
|
|
24476
|
+
const propValue = props[propKey];
|
|
24477
|
+
if (Array.isArray(propValue)) {
|
|
24478
|
+
const childrenArray = new Y.Array();
|
|
24479
|
+
propValue.forEach((child) => {
|
|
24480
|
+
const childMap = WeaveStateManipulation.mapPropsToYjs(child);
|
|
24481
|
+
childrenArray.push([childMap]);
|
|
24482
|
+
});
|
|
24483
|
+
} else if (typeof propValue === "object" && propValue !== null && !Array.isArray(propValue)) propsMap.set(propKey, WeaveStateManipulation.mapPropsToYjs(propValue));
|
|
24484
|
+
else propsMap.set(propKey, propValue);
|
|
24485
|
+
}
|
|
24486
|
+
return propsMap;
|
|
24487
|
+
}
|
|
24488
|
+
static mapNodeToYjs(node) {
|
|
24489
|
+
const nodeId = node.key;
|
|
24490
|
+
const element = new Y.Map();
|
|
24491
|
+
const elementProps = new Y.Map();
|
|
24492
|
+
element.set("key", nodeId);
|
|
24493
|
+
element.set("type", node.type);
|
|
24494
|
+
element.set("props", elementProps);
|
|
24495
|
+
for (const propKey of Object.keys(node.props)) {
|
|
24496
|
+
const propValue = node.props[propKey];
|
|
24497
|
+
if (Array.isArray(propValue) && propKey === "children") {
|
|
24498
|
+
const childrenArray = new Y.Array();
|
|
24499
|
+
propValue.forEach((child) => {
|
|
24500
|
+
const childMap = WeaveStateManipulation.mapNodeToYjs(child);
|
|
24501
|
+
childrenArray.push([childMap.element]);
|
|
24502
|
+
});
|
|
24503
|
+
elementProps.set(propKey, childrenArray);
|
|
24504
|
+
} else if (Array.isArray(propValue) && propKey !== "children") {
|
|
24505
|
+
const childrenArray = new Y.Array();
|
|
24506
|
+
propValue.forEach((child) => {
|
|
24507
|
+
const childMap = WeaveStateManipulation.mapPropsToYjs(child);
|
|
24508
|
+
childrenArray.push([childMap]);
|
|
24509
|
+
});
|
|
24510
|
+
elementProps.set(propKey, childrenArray);
|
|
24511
|
+
} else if (typeof propValue === "object" && propValue !== null && !Array.isArray(propValue)) {
|
|
24512
|
+
const childrenMap = WeaveStateManipulation.mapPropsToYjs(propValue);
|
|
24513
|
+
elementProps.set(propKey, childrenMap);
|
|
24514
|
+
} else elementProps.set(propKey, propValue);
|
|
24515
|
+
}
|
|
24516
|
+
return {
|
|
24517
|
+
nodeId: node.key,
|
|
24518
|
+
element
|
|
24519
|
+
};
|
|
24520
|
+
}
|
|
24521
|
+
static addElements(layerYjsElement, yjsElements) {
|
|
24522
|
+
layerYjsElement.get("props").get("children").push(yjsElements);
|
|
24523
|
+
}
|
|
24524
|
+
static updateElements(layerYjsElement, yjsElements) {
|
|
24525
|
+
for (let i = 0; i < yjsElements.length; i++) {
|
|
24526
|
+
const yjsElement = yjsElements[i];
|
|
24527
|
+
const nodeId = yjsElement.nodeId;
|
|
24528
|
+
const element = yjsElement.element;
|
|
24529
|
+
const childrenArr = JSON.parse(JSON.stringify(layerYjsElement.get("props").get("children")));
|
|
24530
|
+
const index = childrenArr.findIndex((child) => child["key"] === nodeId);
|
|
24531
|
+
if (index !== -1) {
|
|
24532
|
+
layerYjsElement.get("props").get("children").delete(index);
|
|
24533
|
+
layerYjsElement.get("props").get("children").insert(index, [element]);
|
|
24534
|
+
}
|
|
24535
|
+
}
|
|
24536
|
+
}
|
|
24537
|
+
static deleteElements(layerYjsElement, yjsElementsIds) {
|
|
24538
|
+
for (let i = 0; i < yjsElementsIds.length; i++) {
|
|
24539
|
+
const yjsElementId = yjsElementsIds[i];
|
|
24540
|
+
const childrenArr = JSON.parse(JSON.stringify(layerYjsElement.get("props").get("children")));
|
|
24541
|
+
const index = childrenArr.findIndex((child) => child["key"] === yjsElementId);
|
|
24542
|
+
if (index !== -1) layerYjsElement.get("props").get("children").delete(index);
|
|
24543
|
+
}
|
|
24544
|
+
}
|
|
24545
|
+
static getYjsElement(doc, nodeId) {
|
|
24546
|
+
const stage = doc.getMap("weave");
|
|
24547
|
+
const stageProps = stage.get("props");
|
|
24548
|
+
const stageChildren = stageProps.get("children");
|
|
24549
|
+
for (let i = 0; i < stageChildren.length; i++) {
|
|
24550
|
+
const child = stageChildren.get(i);
|
|
24551
|
+
const childProps = child.get("props");
|
|
24552
|
+
if (childProps.get("id") === nodeId) return child;
|
|
24553
|
+
if (childProps.get("children")) {
|
|
24554
|
+
const childChildren = childProps.get("children");
|
|
24555
|
+
for (let j = 0; j < childChildren.length; j++) {
|
|
24556
|
+
const grandChild = childChildren.get(j);
|
|
24557
|
+
const grandChildProps = grandChild.get("props");
|
|
24558
|
+
if (grandChildProps.get("id") === nodeId) return grandChild;
|
|
24559
|
+
}
|
|
24560
|
+
}
|
|
24561
|
+
}
|
|
24562
|
+
return null;
|
|
24563
|
+
}
|
|
24564
|
+
static getNodesBoundingBox(nodes) {
|
|
24565
|
+
const minX = Math.min(...nodes.map((n) => n.props.x));
|
|
24566
|
+
const minY = Math.min(...nodes.map((n) => n.props.y));
|
|
24567
|
+
const maxX = Math.max(...nodes.map((n) => n.props.x + n.props.width));
|
|
24568
|
+
const maxY = Math.max(...nodes.map((n) => n.props.y + n.props.height));
|
|
24569
|
+
return {
|
|
24570
|
+
x: minX,
|
|
24571
|
+
y: minY,
|
|
24572
|
+
width: maxX - minX,
|
|
24573
|
+
height: maxY - minY
|
|
24574
|
+
};
|
|
24575
|
+
}
|
|
24576
|
+
};
|
|
24577
|
+
|
|
24419
24578
|
//#endregion
|
|
24420
24579
|
//#region src/internal-utils/upscale.ts
|
|
24421
24580
|
const setupUpscaleStage = (instance, stage) => {
|
|
@@ -24533,10 +24692,11 @@ var WeaveStageNode = class extends WeaveNode {
|
|
|
24533
24692
|
const activeAction = this.instance.getActiveAction();
|
|
24534
24693
|
if ([MOVE_TOOL_ACTION_NAME].includes(activeAction ?? "")) return;
|
|
24535
24694
|
if (e.target !== stage && !e.target.getAttrs().nodeId) return;
|
|
24536
|
-
|
|
24695
|
+
let parent = e.target.getParent();
|
|
24537
24696
|
if (parent && parent instanceof Konva.Transformer) return;
|
|
24538
24697
|
this.hideHoverState();
|
|
24539
|
-
if (
|
|
24698
|
+
if (e.target.getAttrs().nodeId) parent = stage.findOne(`#${e.target.getAttrs().nodeId}`);
|
|
24699
|
+
if (!this.instance.isServerSide() && !parent?.hasName("node")) stage.container().style.cursor = "default";
|
|
24540
24700
|
});
|
|
24541
24701
|
this.setupEvents();
|
|
24542
24702
|
return stage;
|
|
@@ -24818,6 +24978,67 @@ var WeaveRectangleNode = class extends WeaveNode {
|
|
|
24818
24978
|
const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
24819
24979
|
if (nodesSelectionPlugin) nodesSelectionPlugin.getTransformer().forceUpdate();
|
|
24820
24980
|
}
|
|
24981
|
+
static defaultState(nodeId) {
|
|
24982
|
+
return {
|
|
24983
|
+
...super.defaultState(nodeId),
|
|
24984
|
+
type: WEAVE_RECTANGLE_NODE_TYPE,
|
|
24985
|
+
props: {
|
|
24986
|
+
...super.defaultState(nodeId).props,
|
|
24987
|
+
nodeType: WEAVE_RECTANGLE_NODE_TYPE,
|
|
24988
|
+
x: 0,
|
|
24989
|
+
y: 0,
|
|
24990
|
+
width: 100,
|
|
24991
|
+
height: 100,
|
|
24992
|
+
stroke: "#000000",
|
|
24993
|
+
fill: "#FFFFFF",
|
|
24994
|
+
strokeWidth: 1,
|
|
24995
|
+
strokeScaleEnabled: true,
|
|
24996
|
+
rotation: 0,
|
|
24997
|
+
zIndex: 1,
|
|
24998
|
+
children: []
|
|
24999
|
+
}
|
|
25000
|
+
};
|
|
25001
|
+
}
|
|
25002
|
+
static addNodeState(defaultNodeState, props) {
|
|
25003
|
+
return mergeExceptArrays(defaultNodeState, { props: {
|
|
25004
|
+
x: props.x,
|
|
25005
|
+
y: props.y,
|
|
25006
|
+
width: props.width,
|
|
25007
|
+
height: props.height,
|
|
25008
|
+
rotation: props.rotation,
|
|
25009
|
+
fill: props.fill,
|
|
25010
|
+
...props.stroke && { stroke: props.stroke },
|
|
25011
|
+
...props.strokeWidth && { strokeWidth: props.strokeWidth }
|
|
25012
|
+
} });
|
|
25013
|
+
}
|
|
25014
|
+
static updateNodeState(prevNodeState, nextProps) {
|
|
25015
|
+
return mergeExceptArrays(prevNodeState, { props: {
|
|
25016
|
+
x: nextProps.x,
|
|
25017
|
+
y: nextProps.y,
|
|
25018
|
+
width: nextProps.width,
|
|
25019
|
+
height: nextProps.height,
|
|
25020
|
+
rotation: nextProps.rotation,
|
|
25021
|
+
fill: nextProps.fill,
|
|
25022
|
+
...nextProps.stroke && { stroke: nextProps.stroke },
|
|
25023
|
+
...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
|
|
25024
|
+
} });
|
|
25025
|
+
}
|
|
25026
|
+
static getSchema() {
|
|
25027
|
+
const baseSchema = super.getSchema();
|
|
25028
|
+
const nodeSchema = baseSchema.extend({
|
|
25029
|
+
type: z.literal(WEAVE_RECTANGLE_NODE_TYPE).describe(`Type of the node, for a rectangle node it will always be "${WEAVE_RECTANGLE_NODE_TYPE}"`),
|
|
25030
|
+
props: baseSchema.shape.props.extend({
|
|
25031
|
+
nodeType: z.literal(WEAVE_RECTANGLE_NODE_TYPE).describe(`Type of the node, for a rectangle node it will always be "${WEAVE_RECTANGLE_NODE_TYPE}"`),
|
|
25032
|
+
width: z.number().describe("Width of the rectangle in pixels"),
|
|
25033
|
+
height: z.number().describe("Height of the rectangle in pixels"),
|
|
25034
|
+
fill: z.string().describe("Fill color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
25035
|
+
stroke: z.string().describe("Stroke color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
25036
|
+
strokeWidth: z.number().describe("Stroke width of the rectangle in pixels"),
|
|
25037
|
+
strokeScaleEnabled: z.boolean().describe("Whether the rectangle stroke width should scale when the node is scaled. Defaults to true.")
|
|
25038
|
+
})
|
|
25039
|
+
});
|
|
25040
|
+
return nodeSchema;
|
|
25041
|
+
}
|
|
24821
25042
|
};
|
|
24822
25043
|
|
|
24823
25044
|
//#endregion
|
|
@@ -24977,6 +25198,67 @@ var WeaveEllipseNode = class extends WeaveNode {
|
|
|
24977
25198
|
node.x(node.x() + dx);
|
|
24978
25199
|
node.y(node.y() + dy);
|
|
24979
25200
|
}
|
|
25201
|
+
static defaultState(nodeId) {
|
|
25202
|
+
return {
|
|
25203
|
+
...super.defaultState(nodeId),
|
|
25204
|
+
type: WEAVE_ELLIPSE_NODE_TYPE,
|
|
25205
|
+
props: {
|
|
25206
|
+
...super.defaultState(nodeId).props,
|
|
25207
|
+
nodeType: WEAVE_ELLIPSE_NODE_TYPE,
|
|
25208
|
+
x: 0,
|
|
25209
|
+
y: 0,
|
|
25210
|
+
radiusX: 100,
|
|
25211
|
+
radiusY: 100,
|
|
25212
|
+
stroke: "#000000",
|
|
25213
|
+
fill: "#FFFFFF",
|
|
25214
|
+
strokeWidth: 1,
|
|
25215
|
+
strokeScaleEnabled: true,
|
|
25216
|
+
rotation: 0,
|
|
25217
|
+
zIndex: 1,
|
|
25218
|
+
children: []
|
|
25219
|
+
}
|
|
25220
|
+
};
|
|
25221
|
+
}
|
|
25222
|
+
static addNodeState(defaultNodeState, props) {
|
|
25223
|
+
return mergeExceptArrays(defaultNodeState, { props: {
|
|
25224
|
+
x: props.x,
|
|
25225
|
+
y: props.y,
|
|
25226
|
+
radiusX: props.radiusX,
|
|
25227
|
+
radiusY: props.radiusY,
|
|
25228
|
+
rotation: props.rotation,
|
|
25229
|
+
fill: props.fill,
|
|
25230
|
+
...props.stroke && { stroke: props.stroke },
|
|
25231
|
+
...props.strokeWidth && { strokeWidth: props.strokeWidth }
|
|
25232
|
+
} });
|
|
25233
|
+
}
|
|
25234
|
+
static updateNodeState(prevNodeState, nextProps) {
|
|
25235
|
+
return mergeExceptArrays(prevNodeState, { props: {
|
|
25236
|
+
x: nextProps.x,
|
|
25237
|
+
y: nextProps.y,
|
|
25238
|
+
radiusX: nextProps.radiusX,
|
|
25239
|
+
radiusY: nextProps.radiusY,
|
|
25240
|
+
rotation: nextProps.rotation,
|
|
25241
|
+
fill: nextProps.fill,
|
|
25242
|
+
...nextProps.stroke && { stroke: nextProps.stroke },
|
|
25243
|
+
...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
|
|
25244
|
+
} });
|
|
25245
|
+
}
|
|
25246
|
+
static getSchema() {
|
|
25247
|
+
const baseSchema = super.getSchema();
|
|
25248
|
+
const nodeSchema = baseSchema.extend({
|
|
25249
|
+
type: z.literal(WEAVE_ELLIPSE_NODE_TYPE).describe(`Type of the node, for a ellipse node it will always be "${WEAVE_ELLIPSE_NODE_TYPE}"`),
|
|
25250
|
+
props: baseSchema.shape.props.extend({
|
|
25251
|
+
nodeType: z.literal(WEAVE_ELLIPSE_NODE_TYPE).describe(`Type of the node, for a ellipse node it will always be "${WEAVE_ELLIPSE_NODE_TYPE}"`),
|
|
25252
|
+
radiusX: z.number().describe("Radius on the X axis of the ellipse in pixels"),
|
|
25253
|
+
radiusY: z.number().describe("Radius on the Y axis of the ellipse in pixels"),
|
|
25254
|
+
fill: z.string().describe("Fill color of the ellipse in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
25255
|
+
stroke: z.string().describe("Stroke color of the ellipse in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
25256
|
+
strokeWidth: z.number().describe("Stroke width of the ellipse in pixels"),
|
|
25257
|
+
strokeScaleEnabled: z.boolean().describe("Whether the ellipse stroke width should scale when the node is scaled. Defaults to true.")
|
|
25258
|
+
})
|
|
25259
|
+
});
|
|
25260
|
+
return nodeSchema;
|
|
25261
|
+
}
|
|
24980
25262
|
};
|
|
24981
25263
|
|
|
24982
25264
|
//#endregion
|
|
@@ -25349,7 +25631,8 @@ const WEAVE_TEXT_NODE_TYPE = "text";
|
|
|
25349
25631
|
const WEAVE_STAGE_TEXT_EDITION_MODE = "text-edition";
|
|
25350
25632
|
const WEAVE_TEXT_NODE_DEFAULT_CONFIG = {
|
|
25351
25633
|
transform: { ...WEAVE_NODES_SELECTION_DEFAULT_CONFIG.selection },
|
|
25352
|
-
outline: { enabled: false }
|
|
25634
|
+
outline: { enabled: false },
|
|
25635
|
+
cursor: { color: "#000000" }
|
|
25353
25636
|
};
|
|
25354
25637
|
const TEXT_LAYOUT = {
|
|
25355
25638
|
["SMART"]: "smart",
|
|
@@ -25683,6 +25966,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25683
25966
|
}
|
|
25684
25967
|
mimicTextNode(textNode) {
|
|
25685
25968
|
if (!this.textArea) return;
|
|
25969
|
+
this.textArea.style.caretColor = this.config.cursor.color;
|
|
25686
25970
|
this.textArea.style.fontSize = textNode.fontSize() * textNode.getAbsoluteScale().x + "px";
|
|
25687
25971
|
this.textArea.rows = textNode.text().split("\n").length;
|
|
25688
25972
|
this.textArea.style.letterSpacing = `${textNode.letterSpacing()}`;
|
|
@@ -25691,7 +25975,9 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25691
25975
|
this.textArea.style.fontFamily = textNode.fontFamily();
|
|
25692
25976
|
let fontWeight = "normal";
|
|
25693
25977
|
let fontStyle = "normal";
|
|
25978
|
+
const matchNumber = textNode.fontStyle().match(/\d+/);
|
|
25694
25979
|
if ((textNode.fontStyle() ?? "normal").indexOf("bold") !== -1) fontWeight = "bold";
|
|
25980
|
+
if (matchNumber) fontWeight = matchNumber[0].toString();
|
|
25695
25981
|
if ((textNode.fontStyle() ?? "normal").indexOf("italic") !== -1) fontStyle = "italic";
|
|
25696
25982
|
this.textArea.style.fontWeight = fontWeight;
|
|
25697
25983
|
this.textArea.style.backgroundColor = "transparent";
|
|
@@ -25989,6 +26275,128 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25989
26275
|
textNode.width(textAreaWidth);
|
|
25990
26276
|
this.instance.updateNode(this.serialize(textNode));
|
|
25991
26277
|
}
|
|
26278
|
+
static defaultState(nodeId, params) {
|
|
26279
|
+
const config = (0, import_lodash.merge)({}, WEAVE_TEXT_NODE_DEFAULT_CONFIG, params?.config ?? {});
|
|
26280
|
+
return {
|
|
26281
|
+
...super.defaultState(nodeId),
|
|
26282
|
+
type: WEAVE_TEXT_NODE_TYPE,
|
|
26283
|
+
props: {
|
|
26284
|
+
...super.defaultState(nodeId).props,
|
|
26285
|
+
nodeType: "text",
|
|
26286
|
+
fontFamily: "Arial",
|
|
26287
|
+
fontSize: 32,
|
|
26288
|
+
fontStyle: "normal",
|
|
26289
|
+
fontVariant: "normal",
|
|
26290
|
+
textDecoration: "none",
|
|
26291
|
+
letterSpacing: 0,
|
|
26292
|
+
lineHeight: 1,
|
|
26293
|
+
align: "left",
|
|
26294
|
+
verticalAlign: "top",
|
|
26295
|
+
fill: "#000000ff",
|
|
26296
|
+
text: "This is a text node",
|
|
26297
|
+
layout: TEXT_LAYOUT.SMART,
|
|
26298
|
+
...!config.outline.enabled && { strokeEnabled: false },
|
|
26299
|
+
...config.outline.enabled && {
|
|
26300
|
+
strokeEnabled: true,
|
|
26301
|
+
stroke: config.outline.color,
|
|
26302
|
+
strokeWidth: config.outline.width,
|
|
26303
|
+
fillAfterStrokeEnabled: true
|
|
26304
|
+
}
|
|
26305
|
+
}
|
|
26306
|
+
};
|
|
26307
|
+
}
|
|
26308
|
+
static addNodeState(defaultNodeState, props) {
|
|
26309
|
+
return mergeExceptArrays(defaultNodeState, { props: {
|
|
26310
|
+
x: props.x,
|
|
26311
|
+
y: props.y,
|
|
26312
|
+
width: props.width,
|
|
26313
|
+
...props.height && { height: props.height },
|
|
26314
|
+
FontFamily: props.fontFamily,
|
|
26315
|
+
fontSize: props.fontSize,
|
|
26316
|
+
fontStyle: props.fontStyle,
|
|
26317
|
+
fontVariant: props.fontVariant,
|
|
26318
|
+
textDecoration: props.textDecoration,
|
|
26319
|
+
letterSpacing: props.letterSpacing,
|
|
26320
|
+
lineHeight: props.lineHeight,
|
|
26321
|
+
align: props.align,
|
|
26322
|
+
verticalAlign: props.verticalAlign,
|
|
26323
|
+
rotation: props.rotation,
|
|
26324
|
+
fill: props.fill,
|
|
26325
|
+
text: props.text,
|
|
26326
|
+
layout: props.layout,
|
|
26327
|
+
...props.strokeEnabled && { strokeEnabled: props.strokeEnabled },
|
|
26328
|
+
...props.stroke && { stroke: props.stroke },
|
|
26329
|
+
...props.strokeWidth && { strokeWidth: props.strokeWidth },
|
|
26330
|
+
...props.fillAfterStrokeEnabled && { fillAfterStrokeEnabled: props.fillAfterStrokeEnabled }
|
|
26331
|
+
} });
|
|
26332
|
+
}
|
|
26333
|
+
static updateNodeState(prevNodeState, nextProps) {
|
|
26334
|
+
return mergeExceptArrays(prevNodeState, { props: {
|
|
26335
|
+
x: nextProps.x,
|
|
26336
|
+
y: nextProps.y,
|
|
26337
|
+
width: nextProps.width,
|
|
26338
|
+
...nextProps.height && { height: nextProps.height },
|
|
26339
|
+
FontFamily: nextProps.fontFamily,
|
|
26340
|
+
fontSize: nextProps.fontSize,
|
|
26341
|
+
fontStyle: nextProps.fontStyle,
|
|
26342
|
+
fontVariant: nextProps.fontVariant,
|
|
26343
|
+
textDecoration: nextProps.textDecoration,
|
|
26344
|
+
letterSpacing: nextProps.letterSpacing,
|
|
26345
|
+
lineHeight: nextProps.lineHeight,
|
|
26346
|
+
align: nextProps.align,
|
|
26347
|
+
verticalAlign: nextProps.verticalAlign,
|
|
26348
|
+
rotation: nextProps.rotation,
|
|
26349
|
+
fill: nextProps.fill,
|
|
26350
|
+
text: nextProps.text,
|
|
26351
|
+
layout: nextProps.layout,
|
|
26352
|
+
...nextProps.strokeEnabled && { strokeEnabled: nextProps.strokeEnabled },
|
|
26353
|
+
...nextProps.stroke && { stroke: nextProps.stroke },
|
|
26354
|
+
...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth },
|
|
26355
|
+
...nextProps.fillAfterStrokeEnabled && { fillAfterStrokeEnabled: nextProps.fillAfterStrokeEnabled }
|
|
26356
|
+
} });
|
|
26357
|
+
}
|
|
26358
|
+
static getSchema() {
|
|
26359
|
+
const baseSchema = super.getSchema();
|
|
26360
|
+
const nodeSchema = baseSchema.extend({
|
|
26361
|
+
type: z.literal(WEAVE_TEXT_NODE_TYPE).describe(`Type of the node, for a text node it will always be "${WEAVE_TEXT_NODE_TYPE}"`),
|
|
26362
|
+
props: z.object({
|
|
26363
|
+
nodeType: z.literal(WEAVE_TEXT_NODE_TYPE).describe(`Type of the node, for a text node it will always be "${WEAVE_TEXT_NODE_TYPE}"`),
|
|
26364
|
+
width: z.number().describe("Width of the text in pixels"),
|
|
26365
|
+
height: z.number().optional().describe("Height of the text in pixels. Optional if layout is auto-height or smart."),
|
|
26366
|
+
fontFamily: z.string().default("Arial").describe("Font family of the text, e.g. Arial, Helvetica, etc."),
|
|
26367
|
+
fontSize: z.number().default(16).describe("Font size of the text in pixels."),
|
|
26368
|
+
fontStyle: z.string().regex(/^(?:normal|bold|\d+)(?: italic)?$/).default("normal").describe("Font style of the text, can be \"normal\", \"bold\", \"400\", \"italic\" or a combination like \"bold italic\" or \"700 italic\"."),
|
|
26369
|
+
fontVariant: z.enum(["normal", "small-caps"]).describe("Font variant of the text, can be \"normal\" or \"small-caps\"."),
|
|
26370
|
+
textDecoration: z.enum([
|
|
26371
|
+
"line-through",
|
|
26372
|
+
"underline",
|
|
26373
|
+
""
|
|
26374
|
+
]).default("").describe("Text decoration can be \"line-through\", \"underline\" or empty string for none."),
|
|
26375
|
+
letterSpacing: z.number().default(0).describe("Spacing between letters in pixels."),
|
|
26376
|
+
lineHeight: z.number().default(1).describe("Line height of the text, as a multiplier of font size."),
|
|
26377
|
+
align: z.enum([
|
|
26378
|
+
"left",
|
|
26379
|
+
"center",
|
|
26380
|
+
"right",
|
|
26381
|
+
"justify"
|
|
26382
|
+
]).default("left").describe("Text alignment, can be \"left\", \"center\", \"right\" or \"justify\"."),
|
|
26383
|
+
verticalAlign: z.enum([
|
|
26384
|
+
"top",
|
|
26385
|
+
"middle",
|
|
26386
|
+
"bottom"
|
|
26387
|
+
]).default("top").describe("Vertical alignment of the text, can be 'top', 'middle' or 'bottom'."),
|
|
26388
|
+
fill: z.string().default("#000000ff").describe("Fill color of the text in hex format with alpha channel (e.g. #RRGGBBAA)."),
|
|
26389
|
+
text: z.string().default("text").describe("The actual text content of the node."),
|
|
26390
|
+
strokeEnabled: z.boolean().default(false).describe("Whether the text outline is enabled."),
|
|
26391
|
+
stroke: z.string().optional().default("#d6d6d6").describe("Color of the text outline in hex format with alpha channel (e.g. #RRGGBBAA)."),
|
|
26392
|
+
strokeWidth: z.number().optional().default(2).describe("Width of the text outline in pixels."),
|
|
26393
|
+
strokeScaleEnabled: z.boolean().default(true).describe("Whether the stroke width should scale when the node is scaled."),
|
|
26394
|
+
fillAfterStrokeEnabled: z.boolean().default(true).describe("Whether the fill should be drawn after the stroke. If false, the stroke will be drawn on top of the fill."),
|
|
26395
|
+
layout: z.enum(TEXT_LAYOUT).default(TEXT_LAYOUT.SMART).describe("Layout mode of the text node. Can be:\n- 'fixed': the text node will have fixed width and height, and the text will be scaled to fit the node.\n- 'auto-height': the width of the text node will be fixed, but the height will adjust to fit the text content.\n- 'auto-all': both width and height of the text node will adjust to fit the text content.\n- 'smart': the text node will try to adjust its size based on the content and layout, but it will not exceed the initial width and height set on the node.")
|
|
26396
|
+
})
|
|
26397
|
+
});
|
|
26398
|
+
return nodeSchema;
|
|
26399
|
+
}
|
|
25992
26400
|
};
|
|
25993
26401
|
|
|
25994
26402
|
//#endregion
|
|
@@ -27625,6 +28033,111 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
27625
28033
|
this.getNodesSelectionPlugin()?.setSelectedNodes([image]);
|
|
27626
28034
|
this.getNodesSelectionPlugin()?.getHoverTransformer().forceUpdate();
|
|
27627
28035
|
}
|
|
28036
|
+
static defaultState(nodeId) {
|
|
28037
|
+
return {
|
|
28038
|
+
...super.defaultState(nodeId),
|
|
28039
|
+
type: WEAVE_IMAGE_NODE_TYPE,
|
|
28040
|
+
props: {
|
|
28041
|
+
...super.defaultState(nodeId).props,
|
|
28042
|
+
nodeType: WEAVE_IMAGE_NODE_TYPE,
|
|
28043
|
+
width: 800,
|
|
28044
|
+
height: 600,
|
|
28045
|
+
imageURL: "https://picsum.photos/id/10/800/600",
|
|
28046
|
+
adding: false,
|
|
28047
|
+
imageWidth: 800,
|
|
28048
|
+
imageHeight: 600,
|
|
28049
|
+
imageInfo: {
|
|
28050
|
+
width: 800,
|
|
28051
|
+
height: 600
|
|
28052
|
+
},
|
|
28053
|
+
uncroppedImage: {
|
|
28054
|
+
width: 800,
|
|
28055
|
+
height: 600
|
|
28056
|
+
},
|
|
28057
|
+
cropping: false,
|
|
28058
|
+
stroke: "#000000",
|
|
28059
|
+
fill: "#FFFFFF",
|
|
28060
|
+
strokeWidth: 0,
|
|
28061
|
+
strokeScaleEnabled: true,
|
|
28062
|
+
children: []
|
|
28063
|
+
}
|
|
28064
|
+
};
|
|
28065
|
+
}
|
|
28066
|
+
static addNodeState(defaultNodeState, props) {
|
|
28067
|
+
return mergeExceptArrays(defaultNodeState, { props: {
|
|
28068
|
+
x: props.x,
|
|
28069
|
+
y: props.y,
|
|
28070
|
+
width: props.width,
|
|
28071
|
+
height: props.height,
|
|
28072
|
+
rotation: props.rotation,
|
|
28073
|
+
imageURL: props.imageURL,
|
|
28074
|
+
...props.imageFallback && { imageFallback: props.imageFallback },
|
|
28075
|
+
...props.imageId && { imageId: props.imageId },
|
|
28076
|
+
adding: props.adding,
|
|
28077
|
+
imageWidth: props.imageWidth,
|
|
28078
|
+
imageHeight: props.imageHeight,
|
|
28079
|
+
imageInfo: {
|
|
28080
|
+
width: props.imageInfo.width,
|
|
28081
|
+
height: props.imageInfo.height
|
|
28082
|
+
},
|
|
28083
|
+
uncroppedImage: {
|
|
28084
|
+
width: props.uncroppedImage.width,
|
|
28085
|
+
height: props.uncroppedImage.height
|
|
28086
|
+
},
|
|
28087
|
+
cropping: props.cropping
|
|
28088
|
+
} });
|
|
28089
|
+
}
|
|
28090
|
+
static updateNodeState(prevNodeState, nextProps) {
|
|
28091
|
+
return mergeExceptArrays(prevNodeState, { props: {
|
|
28092
|
+
x: nextProps.x,
|
|
28093
|
+
y: nextProps.y,
|
|
28094
|
+
width: nextProps.width,
|
|
28095
|
+
height: nextProps.height,
|
|
28096
|
+
rotation: nextProps.rotation,
|
|
28097
|
+
imageURL: nextProps.imageURL,
|
|
28098
|
+
...nextProps.imageFallback && { imageFallback: nextProps.imageFallback },
|
|
28099
|
+
...nextProps.imageId && { imageId: nextProps.imageId },
|
|
28100
|
+
adding: nextProps.adding,
|
|
28101
|
+
imageWidth: nextProps.imageWidth,
|
|
28102
|
+
imageHeight: nextProps.imageHeight,
|
|
28103
|
+
...nextProps.imageInfo && { imageInfo: {
|
|
28104
|
+
width: nextProps.imageInfo.width,
|
|
28105
|
+
height: nextProps.imageInfo.height
|
|
28106
|
+
} },
|
|
28107
|
+
...nextProps.uncroppedImage && { uncroppedImage: {
|
|
28108
|
+
width: nextProps.uncroppedImage?.width,
|
|
28109
|
+
height: nextProps.uncroppedImage?.height
|
|
28110
|
+
} },
|
|
28111
|
+
cropping: nextProps.cropping
|
|
28112
|
+
} });
|
|
28113
|
+
}
|
|
28114
|
+
static getSchema() {
|
|
28115
|
+
const baseSchema = super.getSchema();
|
|
28116
|
+
const nodeSchema = baseSchema.extend({
|
|
28117
|
+
type: z.literal(WEAVE_IMAGE_NODE_TYPE).describe(`Type of the node, for a image node it will always be "${WEAVE_IMAGE_NODE_TYPE}"`),
|
|
28118
|
+
props: baseSchema.shape.props.extend({
|
|
28119
|
+
nodeType: z.literal("image").describe(`Type of the node, for a image node it will always be "${WEAVE_IMAGE_NODE_TYPE}"`),
|
|
28120
|
+
width: z.number().describe("Width of the image in pixels"),
|
|
28121
|
+
height: z.number().describe("Height of the image in pixels"),
|
|
28122
|
+
imageURL: z.string().describe("The URL of the image to be rendered by the node"),
|
|
28123
|
+
imageFallback: z.string().optional().describe("The fallback image to display while the image to loads, it must be a base64 string with the format: data:image/{format};base64,{data}"),
|
|
28124
|
+
adding: z.boolean().default(false),
|
|
28125
|
+
imageId: z.string().optional().describe("The id of the image, used for external management of the node."),
|
|
28126
|
+
imageWidth: z.number().describe("The width of the image in pixels"),
|
|
28127
|
+
imageHeight: z.number().describe("The height of the image in pixels"),
|
|
28128
|
+
imageInfo: z.object({
|
|
28129
|
+
width: z.number().describe("The original width of the image in pixels"),
|
|
28130
|
+
height: z.number().describe("The original height of the image in pixels")
|
|
28131
|
+
}),
|
|
28132
|
+
uncroppedImage: z.object({
|
|
28133
|
+
width: z.number().describe("The width of the image before cropping, used for cropping calculations"),
|
|
28134
|
+
height: z.number().describe("The height of the image before cropping, used for cropping calculations")
|
|
28135
|
+
}),
|
|
28136
|
+
cropping: z.boolean().default(false).describe("Whether the image is currently being cropped")
|
|
28137
|
+
})
|
|
28138
|
+
});
|
|
28139
|
+
return nodeSchema;
|
|
28140
|
+
}
|
|
27628
28141
|
};
|
|
27629
28142
|
|
|
27630
28143
|
//#endregion
|
|
@@ -27796,6 +28309,71 @@ var WeaveStarNode = class extends WeaveNode {
|
|
|
27796
28309
|
y: element.props.outerRadius
|
|
27797
28310
|
};
|
|
27798
28311
|
}
|
|
28312
|
+
static defaultState(nodeId) {
|
|
28313
|
+
return {
|
|
28314
|
+
...super.defaultState(nodeId),
|
|
28315
|
+
type: WEAVE_STAR_NODE_TYPE,
|
|
28316
|
+
props: {
|
|
28317
|
+
...super.defaultState(nodeId).props,
|
|
28318
|
+
nodeType: WEAVE_STAR_NODE_TYPE,
|
|
28319
|
+
x: 0,
|
|
28320
|
+
y: 0,
|
|
28321
|
+
numPoints: 5,
|
|
28322
|
+
innerRadius: 50,
|
|
28323
|
+
outerRadius: 100,
|
|
28324
|
+
stroke: "#000000",
|
|
28325
|
+
fill: "#FFFFFF",
|
|
28326
|
+
strokeWidth: 1,
|
|
28327
|
+
strokeScaleEnabled: true,
|
|
28328
|
+
rotation: 0,
|
|
28329
|
+
zIndex: 1,
|
|
28330
|
+
children: []
|
|
28331
|
+
}
|
|
28332
|
+
};
|
|
28333
|
+
}
|
|
28334
|
+
static addNodeState(defaultNodeState, props) {
|
|
28335
|
+
return mergeExceptArrays(defaultNodeState, { props: {
|
|
28336
|
+
x: props.x,
|
|
28337
|
+
y: props.y,
|
|
28338
|
+
numPoints: props.numPoints,
|
|
28339
|
+
innerRadius: props.innerRadius,
|
|
28340
|
+
outerRadius: props.outerRadius,
|
|
28341
|
+
rotation: props.rotation,
|
|
28342
|
+
fill: props.fill,
|
|
28343
|
+
...props.stroke && { stroke: props.stroke },
|
|
28344
|
+
...props.strokeWidth && { strokeWidth: props.strokeWidth }
|
|
28345
|
+
} });
|
|
28346
|
+
}
|
|
28347
|
+
static updateNodeState(prevNodeState, nextProps) {
|
|
28348
|
+
return mergeExceptArrays(prevNodeState, { props: {
|
|
28349
|
+
x: nextProps.x,
|
|
28350
|
+
y: nextProps.y,
|
|
28351
|
+
numPoints: nextProps.numPoints,
|
|
28352
|
+
innerRadius: nextProps.innerRadius,
|
|
28353
|
+
outerRadius: nextProps.outerRadius,
|
|
28354
|
+
rotation: nextProps.rotation,
|
|
28355
|
+
fill: nextProps.fill,
|
|
28356
|
+
...nextProps.stroke && { stroke: nextProps.stroke },
|
|
28357
|
+
...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
|
|
28358
|
+
} });
|
|
28359
|
+
}
|
|
28360
|
+
static getSchema() {
|
|
28361
|
+
const baseSchema = super.getSchema();
|
|
28362
|
+
const nodeSchema = baseSchema.extend({
|
|
28363
|
+
type: z.literal(WEAVE_STAR_NODE_TYPE).describe(`Type of the node, for a start node it will always be "${WEAVE_STAR_NODE_TYPE}"`),
|
|
28364
|
+
props: baseSchema.shape.props.extend({
|
|
28365
|
+
nodeType: z.literal(WEAVE_STAR_NODE_TYPE).describe(`Type of the node, for a rectangle node it will always be "${WEAVE_STAR_NODE_TYPE}"`),
|
|
28366
|
+
numPoints: z.number().describe("Number of points of the star, must be greater than or equal to 3"),
|
|
28367
|
+
innerRadius: z.number().describe("Inner radius of the star, must be greater than or equal to 0"),
|
|
28368
|
+
outerRadius: z.number().describe("Outer radius of the star, must be greater than or equal to 0"),
|
|
28369
|
+
fill: z.string().describe("Fill color of the star in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
28370
|
+
stroke: z.string().describe("Stroke color of the star in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
28371
|
+
strokeWidth: z.number().describe("Stroke width of the star in pixels"),
|
|
28372
|
+
strokeScaleEnabled: z.boolean().describe("Whether the star stroke width should scale when the node is scaled. Defaults to true.")
|
|
28373
|
+
})
|
|
28374
|
+
});
|
|
28375
|
+
return nodeSchema;
|
|
28376
|
+
}
|
|
27799
28377
|
};
|
|
27800
28378
|
|
|
27801
28379
|
//#endregion
|
|
@@ -28011,6 +28589,67 @@ var WeaveRegularPolygonNode = class extends WeaveNode {
|
|
|
28011
28589
|
y: element.props.radius
|
|
28012
28590
|
};
|
|
28013
28591
|
}
|
|
28592
|
+
static defaultState(nodeId) {
|
|
28593
|
+
return {
|
|
28594
|
+
...super.defaultState(nodeId),
|
|
28595
|
+
type: WEAVE_REGULAR_POLYGON_NODE_TYPE,
|
|
28596
|
+
props: {
|
|
28597
|
+
...super.defaultState(nodeId).props,
|
|
28598
|
+
nodeType: WEAVE_REGULAR_POLYGON_NODE_TYPE,
|
|
28599
|
+
x: 0,
|
|
28600
|
+
y: 0,
|
|
28601
|
+
sides: 5,
|
|
28602
|
+
radius: 100,
|
|
28603
|
+
stroke: "#000000",
|
|
28604
|
+
fill: "#FFFFFF",
|
|
28605
|
+
strokeWidth: 1,
|
|
28606
|
+
strokeScaleEnabled: true,
|
|
28607
|
+
rotation: 0,
|
|
28608
|
+
zIndex: 1,
|
|
28609
|
+
children: []
|
|
28610
|
+
}
|
|
28611
|
+
};
|
|
28612
|
+
}
|
|
28613
|
+
static addNodeState(defaultNodeState, props) {
|
|
28614
|
+
return mergeExceptArrays(defaultNodeState, { props: {
|
|
28615
|
+
x: props.x,
|
|
28616
|
+
y: props.y,
|
|
28617
|
+
sides: props.sides,
|
|
28618
|
+
radius: props.radius,
|
|
28619
|
+
rotation: props.rotation,
|
|
28620
|
+
fill: props.fill,
|
|
28621
|
+
...props.stroke && { stroke: props.stroke },
|
|
28622
|
+
...props.strokeWidth && { strokeWidth: props.strokeWidth }
|
|
28623
|
+
} });
|
|
28624
|
+
}
|
|
28625
|
+
static updateNodeState(prevNodeState, nextProps) {
|
|
28626
|
+
return mergeExceptArrays(prevNodeState, { props: {
|
|
28627
|
+
x: nextProps.x,
|
|
28628
|
+
y: nextProps.y,
|
|
28629
|
+
sides: nextProps.sides,
|
|
28630
|
+
radius: nextProps.radius,
|
|
28631
|
+
rotation: nextProps.rotation,
|
|
28632
|
+
fill: nextProps.fill,
|
|
28633
|
+
...nextProps.stroke && { stroke: nextProps.stroke },
|
|
28634
|
+
...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
|
|
28635
|
+
} });
|
|
28636
|
+
}
|
|
28637
|
+
static getSchema() {
|
|
28638
|
+
const baseSchema = super.getSchema();
|
|
28639
|
+
const nodeSchema = baseSchema.extend({
|
|
28640
|
+
type: z.literal(WEAVE_REGULAR_POLYGON_NODE_TYPE).describe(`Type of the node, for a regular polygon node it will always be "${WEAVE_REGULAR_POLYGON_NODE_TYPE}"`),
|
|
28641
|
+
props: baseSchema.shape.props.extend({
|
|
28642
|
+
nodeType: z.literal(WEAVE_REGULAR_POLYGON_NODE_TYPE).describe(`Type of the node, for a regular polygon node it will always be "${WEAVE_REGULAR_POLYGON_NODE_TYPE}"`),
|
|
28643
|
+
sides: z.number().describe("Number of sides of the regular polygon, must be 3 or more"),
|
|
28644
|
+
radius: z.number().describe("Radius of the regular polygon in pixels, distance from the center to any vertex"),
|
|
28645
|
+
fill: z.string().describe("Fill color of the regular polygon in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
28646
|
+
stroke: z.string().describe("Stroke color of the regular polygon in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
28647
|
+
strokeWidth: z.number().describe("Stroke width of the regular polygon in pixels"),
|
|
28648
|
+
strokeScaleEnabled: z.boolean().describe("Whether the regular polygon stroke width should scale when the node is scaled. Defaults to true.")
|
|
28649
|
+
})
|
|
28650
|
+
});
|
|
28651
|
+
return nodeSchema;
|
|
28652
|
+
}
|
|
28014
28653
|
};
|
|
28015
28654
|
|
|
28016
28655
|
//#endregion
|
|
@@ -28222,6 +28861,7 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
28222
28861
|
strokeWidth: 0,
|
|
28223
28862
|
fill: "transparent",
|
|
28224
28863
|
nodeId: id,
|
|
28864
|
+
nodeType: void 0,
|
|
28225
28865
|
id: `${id}-selection-area`,
|
|
28226
28866
|
listening: true,
|
|
28227
28867
|
draggable: true,
|
|
@@ -28378,6 +29018,77 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
28378
29018
|
};
|
|
28379
29019
|
}
|
|
28380
29020
|
scaleReset() {}
|
|
29021
|
+
static defaultState(nodeId) {
|
|
29022
|
+
return {
|
|
29023
|
+
...super.defaultState(nodeId),
|
|
29024
|
+
type: WEAVE_FRAME_NODE_TYPE,
|
|
29025
|
+
props: {
|
|
29026
|
+
...super.defaultState(nodeId).props,
|
|
29027
|
+
nodeType: WEAVE_FRAME_NODE_TYPE,
|
|
29028
|
+
x: 0,
|
|
29029
|
+
y: 0,
|
|
29030
|
+
width: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameWidth,
|
|
29031
|
+
height: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameHeight,
|
|
29032
|
+
title: WEAVE_FRAME_NODE_DEFAULT_PROPS.title,
|
|
29033
|
+
frameWidth: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameWidth,
|
|
29034
|
+
frameHeight: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameHeight,
|
|
29035
|
+
frameBackground: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameBackground,
|
|
29036
|
+
borderWidth: WEAVE_FRAME_NODE_DEFAULT_CONFIG.borderWidth,
|
|
29037
|
+
borderColor: WEAVE_FRAME_NODE_DEFAULT_CONFIG.borderColor,
|
|
29038
|
+
stroke: "transparent",
|
|
29039
|
+
strokeWidth: 0,
|
|
29040
|
+
strokeScaleEnabled: true,
|
|
29041
|
+
rotation: 0,
|
|
29042
|
+
zIndex: 1,
|
|
29043
|
+
children: []
|
|
29044
|
+
}
|
|
29045
|
+
};
|
|
29046
|
+
}
|
|
29047
|
+
static addNodeState(defaultNodeState, props) {
|
|
29048
|
+
return mergeExceptArrays(defaultNodeState, { props: {
|
|
29049
|
+
x: props.x,
|
|
29050
|
+
y: props.y,
|
|
29051
|
+
width: props.width,
|
|
29052
|
+
height: props.height,
|
|
29053
|
+
...props.title && { stroke: props.title },
|
|
29054
|
+
frameWidth: props.frameWidth,
|
|
29055
|
+
frameHeight: props.frameHeight,
|
|
29056
|
+
...props.frameBackground && { stroke: props.frameBackground },
|
|
29057
|
+
rotation: props.rotation,
|
|
29058
|
+
...props.borderColor && { borderColor: props.borderColor },
|
|
29059
|
+
...props.borderWidth && { borderWidth: props.borderWidth }
|
|
29060
|
+
} });
|
|
29061
|
+
}
|
|
29062
|
+
static updateNodeState(prevNodeState, nextProps) {
|
|
29063
|
+
return mergeExceptArrays(prevNodeState, { props: {
|
|
29064
|
+
x: nextProps.x,
|
|
29065
|
+
y: nextProps.y,
|
|
29066
|
+
width: nextProps.width,
|
|
29067
|
+
height: nextProps.height,
|
|
29068
|
+
rotation: nextProps.rotation,
|
|
29069
|
+
title: nextProps.title,
|
|
29070
|
+
...nextProps.frameBackground && { frameBackground: nextProps.frameBackground },
|
|
29071
|
+
...nextProps.borderColor && { stroke: nextProps.borderColor },
|
|
29072
|
+
...nextProps.borderWidth && { strokeWidth: nextProps.borderWidth }
|
|
29073
|
+
} });
|
|
29074
|
+
}
|
|
29075
|
+
static getSchema() {
|
|
29076
|
+
const baseSchema = super.getSchema();
|
|
29077
|
+
const nodeSchema = baseSchema.extend({
|
|
29078
|
+
type: z.literal(WEAVE_FRAME_NODE_TYPE).describe(`Type of the node, for a frame node it will always be "${WEAVE_FRAME_NODE_TYPE}"`),
|
|
29079
|
+
props: baseSchema.shape.props.extend({
|
|
29080
|
+
nodeType: z.literal(WEAVE_FRAME_NODE_TYPE).describe(`Type of the node, for a frame node it will always be "${WEAVE_FRAME_NODE_TYPE}"`),
|
|
29081
|
+
borderColor: z.string().default("#000000ff").describe("Border color of the frame in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
29082
|
+
borderWidth: z.number().default(1).describe("Border width of the frame in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
29083
|
+
title: z.string().default("Frame").describe("Title of the frame"),
|
|
29084
|
+
frameWidth: z.number().describe("Width of the frame in pixels"),
|
|
29085
|
+
frameHeight: z.number().describe("Height of the frame in pixels"),
|
|
29086
|
+
frameBackground: z.string().default(WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR).describe("Background color of the frame in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
29087
|
+
children: z.array(z.any()).default([])
|
|
29088
|
+
})
|
|
29089
|
+
});
|
|
29090
|
+
return nodeSchema;
|
|
29091
|
+
}
|
|
28381
29092
|
};
|
|
28382
29093
|
|
|
28383
29094
|
//#endregion
|
|
@@ -28995,6 +29706,7 @@ var WeaveStrokeSingleNode = class extends WeaveNode {
|
|
|
28995
29706
|
this.shiftPressed = false;
|
|
28996
29707
|
}
|
|
28997
29708
|
initEvents() {
|
|
29709
|
+
if (this.instance.isServerSide()) return;
|
|
28998
29710
|
if (this.eventsInitialized) return;
|
|
28999
29711
|
window.addEventListener("keydown", (e) => {
|
|
29000
29712
|
if (e.key === "Shift") this.shiftPressed = true;
|
|
@@ -29346,6 +30058,70 @@ var WeaveStrokeSingleNode = class extends WeaveNode {
|
|
|
29346
30058
|
}
|
|
29347
30059
|
return pos;
|
|
29348
30060
|
}
|
|
30061
|
+
static defaultState(nodeId) {
|
|
30062
|
+
return {
|
|
30063
|
+
...super.defaultState(nodeId),
|
|
30064
|
+
type: WEAVE_STROKE_SINGLE_NODE_TYPE,
|
|
30065
|
+
props: {
|
|
30066
|
+
...super.defaultState(nodeId).props,
|
|
30067
|
+
nodeType: WEAVE_STROKE_SINGLE_NODE_TYPE,
|
|
30068
|
+
x: 0,
|
|
30069
|
+
y: 0,
|
|
30070
|
+
strokeElements: [
|
|
30071
|
+
0,
|
|
30072
|
+
0,
|
|
30073
|
+
100,
|
|
30074
|
+
100
|
|
30075
|
+
],
|
|
30076
|
+
stroke: "#000000",
|
|
30077
|
+
fill: "#FFFFFF",
|
|
30078
|
+
strokeWidth: 1,
|
|
30079
|
+
strokeScaleEnabled: true,
|
|
30080
|
+
rotation: 0,
|
|
30081
|
+
zIndex: 1,
|
|
30082
|
+
children: []
|
|
30083
|
+
}
|
|
30084
|
+
};
|
|
30085
|
+
}
|
|
30086
|
+
static addNodeState(defaultNodeState, props) {
|
|
30087
|
+
return mergeExceptArrays(defaultNodeState, { props: {
|
|
30088
|
+
x: props.x,
|
|
30089
|
+
y: props.y,
|
|
30090
|
+
strokeElements: props.strokeElements,
|
|
30091
|
+
rotation: props.rotation,
|
|
30092
|
+
fill: props.fill,
|
|
30093
|
+
...props.stroke && { stroke: props.stroke },
|
|
30094
|
+
...props.strokeWidth && { strokeWidth: props.strokeWidth }
|
|
30095
|
+
} });
|
|
30096
|
+
}
|
|
30097
|
+
static updateNodeState(prevNodeState, nextProps) {
|
|
30098
|
+
return mergeExceptArrays(prevNodeState, { props: {
|
|
30099
|
+
x: nextProps.x,
|
|
30100
|
+
y: nextProps.y,
|
|
30101
|
+
strokeElements: nextProps.strokeElements,
|
|
30102
|
+
rotation: nextProps.rotation,
|
|
30103
|
+
fill: nextProps.fill,
|
|
30104
|
+
...nextProps.stroke && { stroke: nextProps.stroke },
|
|
30105
|
+
...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
|
|
30106
|
+
} });
|
|
30107
|
+
}
|
|
30108
|
+
static getSchema() {
|
|
30109
|
+
const baseSchema = super.getSchema();
|
|
30110
|
+
const nodeSchema = baseSchema.extend({
|
|
30111
|
+
type: z.literal(WEAVE_STROKE_SINGLE_NODE_TYPE).describe(`Type of the node, for a stroke node it will always be "${WEAVE_STROKE_SINGLE_NODE_TYPE}"`),
|
|
30112
|
+
props: baseSchema.shape.props.extend({
|
|
30113
|
+
nodeType: z.literal(WEAVE_STROKE_SINGLE_NODE_TYPE).describe(`Type of the node, for a stroke node it will always be "${WEAVE_STROKE_SINGLE_NODE_TYPE}"`),
|
|
30114
|
+
strokeElements: z.array(z.number()).length(4).describe("Array of 4 numbers representing the start and end points of the stroke in the format [startX, startY, endX, endY]"),
|
|
30115
|
+
tipStartStyle: z.string().describe(`Style of the line tip at the start of the stroke. Can be "none", "arrow", "circle" or "square". Defaults to "none".`),
|
|
30116
|
+
tipEndStyle: z.string().describe(`Style of the line tip at the end of the stroke. Can be "none", "arrow", "circle" or "square". Defaults to "none".`),
|
|
30117
|
+
fill: z.string().describe("Fill color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
30118
|
+
stroke: z.string().describe("Stroke color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
30119
|
+
strokeWidth: z.number().describe("Stroke width of the rectangle in pixels"),
|
|
30120
|
+
strokeScaleEnabled: z.boolean().describe("Whether the rectangle stroke width should scale when the node is scaled. Defaults to true.")
|
|
30121
|
+
})
|
|
30122
|
+
});
|
|
30123
|
+
return nodeSchema;
|
|
30124
|
+
}
|
|
29349
30125
|
};
|
|
29350
30126
|
|
|
29351
30127
|
//#endregion
|
|
@@ -39762,7 +40538,6 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
|
|
|
39762
40538
|
if (this.initialized) return;
|
|
39763
40539
|
const container = this.config.getContainer();
|
|
39764
40540
|
if (!container) return;
|
|
39765
|
-
console.log("setup minimap");
|
|
39766
40541
|
let preview = document.getElementById(this.config.id);
|
|
39767
40542
|
const windowAspectRatio = window.innerWidth / window.innerHeight;
|
|
39768
40543
|
if (!preview) {
|
|
@@ -39783,7 +40558,6 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
|
|
|
39783
40558
|
this.initialized = true;
|
|
39784
40559
|
this.minimapLayer = new Konva.Layer();
|
|
39785
40560
|
this.minimapStage.add(this.minimapLayer);
|
|
39786
|
-
console.log("aqui?");
|
|
39787
40561
|
this.minimapViewportReference = new Konva.Rect({
|
|
39788
40562
|
...this.config.style.viewportReference,
|
|
39789
40563
|
id: "minimapViewportReference",
|
|
@@ -39795,10 +40569,8 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
|
|
|
39795
40569
|
}
|
|
39796
40570
|
const stage = this.instance.getStage();
|
|
39797
40571
|
stage.on("dragmove wheel dragend scaleXChange scaleYChange xChange yChange", () => {
|
|
39798
|
-
console.log("update minimap viewport");
|
|
39799
40572
|
this.updateMinimapViewportReference();
|
|
39800
40573
|
});
|
|
39801
|
-
console.log("aqui initialized");
|
|
39802
40574
|
}
|
|
39803
40575
|
async updateMinimapContent() {
|
|
39804
40576
|
const stage = this.instance.getStage();
|
|
@@ -39863,9 +40635,7 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
|
|
|
39863
40635
|
this.setupMinimap();
|
|
39864
40636
|
}
|
|
39865
40637
|
onInit() {
|
|
39866
|
-
console.log("init minimap");
|
|
39867
40638
|
const throttledUpdateMinimap = (0, import_lodash.throttle)(async () => {
|
|
39868
|
-
console.log("throttle update minimap");
|
|
39869
40639
|
await this.updateMinimapContent();
|
|
39870
40640
|
this.updateMinimapViewportReference();
|
|
39871
40641
|
}, DEFAULT_THROTTLE_MS);
|
|
@@ -42958,4 +43728,4 @@ const setupCanvasBackend = async () => {
|
|
|
42958
43728
|
};
|
|
42959
43729
|
|
|
42960
43730
|
//#endregion
|
|
42961
|
-
export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_DEFAULT_CONFIG, BRUSH_TOOL_STATE, CONNECTOR_TOOL_ACTION_NAME, CONNECTOR_TOOL_DEFAULT_CONFIG, CONNECTOR_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, DEFAULT_GUIDE_TOOL_ACTION_CONFIG, DEFAULT_SNAPPING_MANAGER_CONFIG, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_DISTANCE_NAME, GUIDE_DISTANCE_ORIGIN, GUIDE_KIND, GUIDE_NAME, GUIDE_ORIENTATION, GUIDE_STATE, GUIDE_TOOL_ACTION_NAME, GUIDE_TOOL_STATE, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MEASURE_TOOL_ACTION_NAME, MEASURE_TOOL_STATE, MOVE_ORIENTATION, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAGE_MINIMAP_DEFAULT_CONFIG, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, VIDEO_TOOL_ACTION_NAME, VIDEO_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_ARROW_TOOL_ACTION_NAME, WEAVE_ARROW_TOOL_STATE, WEAVE_COMMENTS_RENDERER_KEY, WEAVE_COMMENTS_TOOL_LAYER_ID, WEAVE_COMMENT_CREATE_ACTION, WEAVE_COMMENT_NODE_ACTION, WEAVE_COMMENT_NODE_DEFAULTS, WEAVE_COMMENT_NODE_TYPE, WEAVE_COMMENT_STATUS, WEAVE_COMMENT_TOOL_ACTION_NAME, WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, WEAVE_COMMENT_TOOL_STATE, WEAVE_COMMENT_VIEW_ACTION, WEAVE_CONNECTOR_NODE_ANCHOR_ORIGIN, WEAVE_CONNECTOR_NODE_DECORATOR_TYPE, WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, WEAVE_CONNECTOR_NODE_LINE_ORIGIN, WEAVE_CONNECTOR_NODE_LINE_TYPE, WEAVE_CONNECTOR_NODE_TYPE, WEAVE_COPY_PASTE_CONFIG_DEFAULT, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_CATCHER_ID, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_CONFIG, WEAVE_GRID_DOT_TYPES, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGES_TOOL_ACTION_NAME, WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, WEAVE_IMAGES_TOOL_STATE, WEAVE_IMAGES_TOOL_UPLOAD_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_IMAGE_TOOL_ACTION_NAME, WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, WEAVE_IMAGE_TOOL_STATE, WEAVE_IMAGE_TOOL_UPLOAD_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_MEASURE_NODE_DEFAULT_CONFIG, WEAVE_MEASURE_NODE_TYPE, WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_PLUGIN_KEY, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_DROP_AREA_KEY, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_IMAGE_CROPPING_MODE, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAGE_PANNING_THROTTLE_MS, WEAVE_STAGE_TEXT_EDITION_MODE, WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, WEAVE_STAGE_ZOOM_KEY, WEAVE_STAGE_ZOOM_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_SINGLE_NODE_TIP_SIDE, WEAVE_STROKE_SINGLE_NODE_TIP_TYPE, WEAVE_STROKE_SINGLE_NODE_TYPE, WEAVE_STROKE_TOOL_ACTION_NAME, WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES, WEAVE_STROKE_TOOL_DEFAULT_CONFIG, WEAVE_STROKE_TOOL_STATE, WEAVE_TEXT_NODE_DEFAULT_CONFIG, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, WEAVE_USERS_PRESENCE_PLUGIN_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_PRESENCE_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveConnectorNode, WeaveConnectorToolAction, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveGuideToolAction, WeaveImageNode, WeaveImageToolAction, WeaveImagesToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeaveNodesSnappingPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveRenderer, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveStrokeSingleNode, WeaveStrokeToolAction, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersPresencePlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, downscaleImageFile, downscaleImageFromURL, getBoundingBox, getDownscaleRatio, getExportBoundingBox, getImageSizeFromFile, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isIOS, isInShadowDOM, isNodeInSelection, isServer, loadImageSource, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend };
|
|
43731
|
+
export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_DEFAULT_CONFIG, BRUSH_TOOL_STATE, CONNECTOR_TOOL_ACTION_NAME, CONNECTOR_TOOL_DEFAULT_CONFIG, CONNECTOR_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, DEFAULT_GUIDE_TOOL_ACTION_CONFIG, DEFAULT_SNAPPING_MANAGER_CONFIG, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_DISTANCE_NAME, GUIDE_DISTANCE_ORIGIN, GUIDE_KIND, GUIDE_NAME, GUIDE_ORIENTATION, GUIDE_STATE, GUIDE_TOOL_ACTION_NAME, GUIDE_TOOL_STATE, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MEASURE_TOOL_ACTION_NAME, MEASURE_TOOL_STATE, MOVE_ORIENTATION, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAGE_MINIMAP_DEFAULT_CONFIG, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, VIDEO_TOOL_ACTION_NAME, VIDEO_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_ARROW_TOOL_ACTION_NAME, WEAVE_ARROW_TOOL_STATE, WEAVE_COMMENTS_RENDERER_KEY, WEAVE_COMMENTS_TOOL_LAYER_ID, WEAVE_COMMENT_CREATE_ACTION, WEAVE_COMMENT_NODE_ACTION, WEAVE_COMMENT_NODE_DEFAULTS, WEAVE_COMMENT_NODE_TYPE, WEAVE_COMMENT_STATUS, WEAVE_COMMENT_TOOL_ACTION_NAME, WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, WEAVE_COMMENT_TOOL_STATE, WEAVE_COMMENT_VIEW_ACTION, WEAVE_CONNECTOR_NODE_ANCHOR_ORIGIN, WEAVE_CONNECTOR_NODE_DECORATOR_TYPE, WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, WEAVE_CONNECTOR_NODE_LINE_ORIGIN, WEAVE_CONNECTOR_NODE_LINE_TYPE, WEAVE_CONNECTOR_NODE_TYPE, WEAVE_COPY_PASTE_CONFIG_DEFAULT, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_CATCHER_ID, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_CONFIG, WEAVE_GRID_DOT_TYPES, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGES_TOOL_ACTION_NAME, WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, WEAVE_IMAGES_TOOL_STATE, WEAVE_IMAGES_TOOL_UPLOAD_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_IMAGE_TOOL_ACTION_NAME, WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, WEAVE_IMAGE_TOOL_STATE, WEAVE_IMAGE_TOOL_UPLOAD_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_MEASURE_NODE_DEFAULT_CONFIG, WEAVE_MEASURE_NODE_TYPE, WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_PLUGIN_KEY, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_DROP_AREA_KEY, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_IMAGE_CROPPING_MODE, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAGE_PANNING_THROTTLE_MS, WEAVE_STAGE_TEXT_EDITION_MODE, WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, WEAVE_STAGE_ZOOM_KEY, WEAVE_STAGE_ZOOM_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_SINGLE_NODE_TIP_SIDE, WEAVE_STROKE_SINGLE_NODE_TIP_TYPE, WEAVE_STROKE_SINGLE_NODE_TYPE, WEAVE_STROKE_TOOL_ACTION_NAME, WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES, WEAVE_STROKE_TOOL_DEFAULT_CONFIG, WEAVE_STROKE_TOOL_STATE, WEAVE_TEXT_NODE_DEFAULT_CONFIG, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, WEAVE_USERS_PRESENCE_PLUGIN_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_PRESENCE_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveConnectorNode, WeaveConnectorToolAction, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveGuideToolAction, WeaveImageNode, WeaveImageToolAction, WeaveImagesToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeaveNodesSnappingPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveRenderer, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStateManipulation, WeaveStore, WeaveStrokeNode, WeaveStrokeSingleNode, WeaveStrokeToolAction, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersPresencePlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, downscaleImageFile, downscaleImageFromURL, getBoundingBox, getDownscaleRatio, getExportBoundingBox, getImageSizeFromFile, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isIOS, isInShadowDOM, isNodeInSelection, isNumber, isServer, loadImageSource, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend };
|