@inditextech/weave-sdk 4.1.0 → 4.2.0-SNAPSHOT.307.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 +467 -13
- package/dist/sdk.node.js +467 -13
- package/dist/sdk.node.stats.html +1 -1
- package/dist/sdk.stats.html +1 -1
- package/dist/types.d.ts +99 -21
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +513 -59
- package/dist/types.js.map +1 -1
- package/dist/types.stats.html +1 -1
- package/package.json +2 -3
package/dist/types.js
CHANGED
|
@@ -2,8 +2,10 @@ import Konva from "konva";
|
|
|
2
2
|
import pino from "pino";
|
|
3
3
|
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";
|
|
4
4
|
import { getYjsDoc, getYjsValue, observeDeep, syncedStore } from "@syncedstore/core";
|
|
5
|
+
import * as Y$2 from "yjs";
|
|
5
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 { Stage } from "konva/lib/Stage";
|
|
@@ -15197,7 +15199,7 @@ var import_lodash = __toESM(require_lodash(), 1);
|
|
|
15197
15199
|
|
|
15198
15200
|
//#endregion
|
|
15199
15201
|
//#region src/yjs.ts
|
|
15200
|
-
var yjs_default = Y$
|
|
15202
|
+
var yjs_default = Y$2;
|
|
15201
15203
|
|
|
15202
15204
|
//#endregion
|
|
15203
15205
|
//#region src/stores/default-initial-state.ts
|
|
@@ -15276,6 +15278,7 @@ var WeaveStore = class {
|
|
|
15276
15278
|
return this.document;
|
|
15277
15279
|
}
|
|
15278
15280
|
restartDocument() {
|
|
15281
|
+
this.document?.destroy();
|
|
15279
15282
|
this.latestState = {
|
|
15280
15283
|
weave: {},
|
|
15281
15284
|
weaveMetadata: {}
|
|
@@ -18952,10 +18955,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
18952
18955
|
});
|
|
18953
18956
|
tr.on("mouseover", () => {
|
|
18954
18957
|
const nodesSelected = tr.nodes();
|
|
18955
|
-
if (nodesSelected.length
|
|
18956
|
-
const node = nodesSelected[0];
|
|
18957
|
-
stage.container().style.cursor = (typeof node?.defineMousePointer === "function" ? node.defineMousePointer() : null) ?? "grab";
|
|
18958
|
-
} else stage.container().style.cursor = "grab";
|
|
18958
|
+
if (nodesSelected.length > 1) stage.container().style.cursor = "grab";
|
|
18959
18959
|
});
|
|
18960
18960
|
tr.on("mouseout", (e) => {
|
|
18961
18961
|
this.instance.getStage().handleMouseover?.(e);
|
|
@@ -20913,16 +20913,16 @@ var WeaveNode = class {
|
|
|
20913
20913
|
if ([MOVE_TOOL_ACTION_NAME].includes(activeAction ?? "")) return false;
|
|
20914
20914
|
let showHover = false;
|
|
20915
20915
|
let cancelBubble = false;
|
|
20916
|
-
if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && (isLocked || isMutexLocked)) {
|
|
20916
|
+
if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && node.hasName("node") && (isLocked || isMutexLocked)) {
|
|
20917
20917
|
stage.container().style.cursor = "default";
|
|
20918
20918
|
cancelBubble = true;
|
|
20919
20919
|
}
|
|
20920
|
-
if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && isTargetable && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
|
|
20920
|
+
if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && isTargetable && node.hasName("node") && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
|
|
20921
20921
|
showHover = true;
|
|
20922
20922
|
stage.container().style.cursor = (typeof node?.defineMousePointer === "function" ? node.defineMousePointer() : null) ?? "pointer";
|
|
20923
20923
|
cancelBubble = true;
|
|
20924
20924
|
}
|
|
20925
|
-
if (isNodeSelectionEnabled && this.isSelecting() && this.isNodeSelected(realNode) && !this.isPasting() && isTargetable && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
|
|
20925
|
+
if (isNodeSelectionEnabled && this.isSelecting() && this.isNodeSelected(realNode) && !this.isPasting() && node.hasName("node") && isTargetable && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
|
|
20926
20926
|
showHover = true;
|
|
20927
20927
|
stage.container().style.cursor = (typeof node?.defineMousePointer === "function" ? node.defineMousePointer() : null) ?? "grab";
|
|
20928
20928
|
cancelBubble = true;
|
|
@@ -21077,6 +21077,48 @@ var WeaveNode = class {
|
|
|
21077
21077
|
getIsAsync() {
|
|
21078
21078
|
return false;
|
|
21079
21079
|
}
|
|
21080
|
+
static defaultState(nodeId) {
|
|
21081
|
+
return {
|
|
21082
|
+
key: nodeId,
|
|
21083
|
+
type: "unknown",
|
|
21084
|
+
props: {
|
|
21085
|
+
id: nodeId,
|
|
21086
|
+
nodeType: "unknown",
|
|
21087
|
+
x: 0,
|
|
21088
|
+
y: 0,
|
|
21089
|
+
width: 100,
|
|
21090
|
+
height: 100,
|
|
21091
|
+
rotation: 0,
|
|
21092
|
+
scaleX: 1,
|
|
21093
|
+
scaleY: 1,
|
|
21094
|
+
opacity: 1,
|
|
21095
|
+
zIndex: 1,
|
|
21096
|
+
children: []
|
|
21097
|
+
}
|
|
21098
|
+
};
|
|
21099
|
+
}
|
|
21100
|
+
static getSchema() {
|
|
21101
|
+
const baseNodeSchema = z.object({
|
|
21102
|
+
key: z.string().describe("Unique identifier (uuid) for the node, generate one it if not provided"),
|
|
21103
|
+
type: z.string().describe("Type of the node, must be always provided"),
|
|
21104
|
+
props: z.object({
|
|
21105
|
+
id: z.string().describe("Unique identifier (uuid) for the node instance, is the same as key"),
|
|
21106
|
+
nodeType: z.string().describe("Type of the node, must be always provided"),
|
|
21107
|
+
x: z.number().describe("X position of the node, relative to the parent container"),
|
|
21108
|
+
y: z.number().describe("Y position of the node, relative to the parent container"),
|
|
21109
|
+
width: z.number().describe("Width of the node in pixels"),
|
|
21110
|
+
height: z.number().describe("Height of the node in pixels"),
|
|
21111
|
+
scaleX: z.number().describe("Scale factor on the X axis, default is 1"),
|
|
21112
|
+
scaleY: z.number().describe("Scale factor on the Y axis, default is 1"),
|
|
21113
|
+
rotation: z.number().optional().describe("Rotation of the node in degrees, default is 0"),
|
|
21114
|
+
skewX: z.number().optional().describe("Skew on the X axis in degrees, default is 0"),
|
|
21115
|
+
skewY: z.number().optional().describe("Skew on the Y axis in degrees, default is 0"),
|
|
21116
|
+
opacity: z.number().describe("Opacity of the node, between 0 and 1, default is 1"),
|
|
21117
|
+
children: z.array(z.any()).length(0).describe("Children nodes, always be an empty array for leaf nodes")
|
|
21118
|
+
})
|
|
21119
|
+
});
|
|
21120
|
+
return baseNodeSchema;
|
|
21121
|
+
}
|
|
21080
21122
|
};
|
|
21081
21123
|
|
|
21082
21124
|
//#endregion
|
|
@@ -22199,7 +22241,7 @@ var WeaveRegisterManager = class {
|
|
|
22199
22241
|
|
|
22200
22242
|
//#endregion
|
|
22201
22243
|
//#region package.json
|
|
22202
|
-
var version = "4.
|
|
22244
|
+
var version = "4.2.0-SNAPSHOT.307.1";
|
|
22203
22245
|
|
|
22204
22246
|
//#endregion
|
|
22205
22247
|
//#region src/managers/setup.ts
|
|
@@ -23423,6 +23465,9 @@ var WeaveHooksManager = class {
|
|
|
23423
23465
|
unregisterHook(hookName) {
|
|
23424
23466
|
this.registeredHooks.delete(hookName);
|
|
23425
23467
|
}
|
|
23468
|
+
reset() {
|
|
23469
|
+
this.registeredHooks.clear();
|
|
23470
|
+
}
|
|
23426
23471
|
};
|
|
23427
23472
|
|
|
23428
23473
|
//#endregion
|
|
@@ -23617,8 +23662,13 @@ var Weave = class {
|
|
|
23617
23662
|
const nodeHandler = nodeHandlers[nodeHandlerKey];
|
|
23618
23663
|
nodeHandler?.onDestroyInstance();
|
|
23619
23664
|
}
|
|
23665
|
+
const mainLayer = this.stageManager.getMainLayer();
|
|
23666
|
+
if (mainLayer) mainLayer.destroy();
|
|
23620
23667
|
const stage = this.getStage();
|
|
23621
|
-
if (stage)
|
|
23668
|
+
if (stage) {
|
|
23669
|
+
console.log("remove stage");
|
|
23670
|
+
stage.destroy();
|
|
23671
|
+
}
|
|
23622
23672
|
if (this.eventsController) this.eventsController.abort();
|
|
23623
23673
|
if (!this.isServerSide()) this.eventsController = new AbortController();
|
|
23624
23674
|
this.registerManager.reset();
|
|
@@ -23631,6 +23681,8 @@ var Weave = class {
|
|
|
23631
23681
|
this.status = WEAVE_INSTANCE_STATUS.STARTING;
|
|
23632
23682
|
this.emitEvent("onInstanceStatus", this.status);
|
|
23633
23683
|
this.registerManager.reset();
|
|
23684
|
+
this.hooks.removeAllHooks();
|
|
23685
|
+
this.hooksManager.reset();
|
|
23634
23686
|
this.status = WEAVE_INSTANCE_STATUS.LOADING_FONTS;
|
|
23635
23687
|
this.emitEvent("onInstanceStatus", this.status);
|
|
23636
23688
|
await this.fontsManager.loadFonts();
|
|
@@ -23648,6 +23700,7 @@ var Weave = class {
|
|
|
23648
23700
|
this.emitEvent("onInstanceStatus", this.status);
|
|
23649
23701
|
const store = this.storeManager.getStore();
|
|
23650
23702
|
store.disconnect();
|
|
23703
|
+
store.getDocument()?.destroy();
|
|
23651
23704
|
const nodeHandlers = this.registerManager.getNodesHandlers();
|
|
23652
23705
|
for (const nodeHandlerKey of Object.keys(nodeHandlers)) {
|
|
23653
23706
|
const nodeHandler = nodeHandlers[nodeHandlerKey];
|
|
@@ -24414,6 +24467,114 @@ const downscaleImageFromURL = (url, options) => {
|
|
|
24414
24467
|
});
|
|
24415
24468
|
};
|
|
24416
24469
|
|
|
24470
|
+
//#endregion
|
|
24471
|
+
//#region src/state.manipulation.ts
|
|
24472
|
+
var WeaveStateManipulation = class WeaveStateManipulation {
|
|
24473
|
+
static mapPropsToYjs(props) {
|
|
24474
|
+
const propsMap = new Y$1.Map();
|
|
24475
|
+
for (const propKey of Object.keys(props)) {
|
|
24476
|
+
const propValue = props[propKey];
|
|
24477
|
+
if (Array.isArray(propValue)) {
|
|
24478
|
+
const childrenArray = new Y$1.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$1.Map();
|
|
24491
|
+
const elementProps = new Y$1.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$1.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$1.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
|
+
|
|
24417
24578
|
//#endregion
|
|
24418
24579
|
//#region src/internal-utils/upscale.ts
|
|
24419
24580
|
const setupUpscaleStage = (instance, stage) => {
|
|
@@ -24530,10 +24691,11 @@ var WeaveStageNode = class extends WeaveNode {
|
|
|
24530
24691
|
const activeAction = this.instance.getActiveAction();
|
|
24531
24692
|
if ([MOVE_TOOL_ACTION_NAME].includes(activeAction ?? "")) return;
|
|
24532
24693
|
if (e.target !== stage && !e.target.getAttrs().nodeId) return;
|
|
24533
|
-
|
|
24694
|
+
let parent = e.target.getParent();
|
|
24534
24695
|
if (parent && parent instanceof Konva.Transformer) return;
|
|
24535
24696
|
this.hideHoverState();
|
|
24536
|
-
if (
|
|
24697
|
+
if (e.target.getAttrs().nodeId) parent = stage.findOne(`#${e.target.getAttrs().nodeId}`);
|
|
24698
|
+
if (!this.instance.isServerSide() && !parent?.hasName("node")) stage.container().style.cursor = "default";
|
|
24537
24699
|
});
|
|
24538
24700
|
this.setupEvents();
|
|
24539
24701
|
return stage;
|
|
@@ -24716,6 +24878,52 @@ var WeaveGroupNode = class extends WeaveNode {
|
|
|
24716
24878
|
//#region src/nodes/rectangle/constants.ts
|
|
24717
24879
|
const WEAVE_RECTANGLE_NODE_TYPE = "rectangle";
|
|
24718
24880
|
|
|
24881
|
+
//#endregion
|
|
24882
|
+
//#region src/internal-utils/mapping.ts
|
|
24883
|
+
const isArray = (val) => {
|
|
24884
|
+
return Array.isArray(val);
|
|
24885
|
+
};
|
|
24886
|
+
const isObject = (val) => {
|
|
24887
|
+
return val !== null && typeof val === "object" && !Array.isArray(val);
|
|
24888
|
+
};
|
|
24889
|
+
const mapJsonToYjsMap = (jsonData) => {
|
|
24890
|
+
const map = new Y.Map();
|
|
24891
|
+
const keys = Object.keys(jsonData);
|
|
24892
|
+
for (const key of keys) {
|
|
24893
|
+
const value = jsonData[key];
|
|
24894
|
+
if (isArray(value)) map.set(key, mapJsonToYjsArray(value));
|
|
24895
|
+
else if (isObject(value)) map.set(key, mapJsonToYjsMap(value));
|
|
24896
|
+
else map.set(key, value);
|
|
24897
|
+
}
|
|
24898
|
+
return map;
|
|
24899
|
+
};
|
|
24900
|
+
const mapJsonToYjsArray = (jsonData) => {
|
|
24901
|
+
const array = new Y.Array();
|
|
24902
|
+
for (const item of jsonData) if (isArray(item)) array.push([mapJsonToYjsArray(item)]);
|
|
24903
|
+
else if (isObject(item)) array.push([mapJsonToYjsMap(item)]);
|
|
24904
|
+
else array.push(item);
|
|
24905
|
+
return array;
|
|
24906
|
+
};
|
|
24907
|
+
const mapJsonToYjsElements = (jsonData) => {
|
|
24908
|
+
if (isArray(jsonData)) return mapJsonToYjsArray(jsonData);
|
|
24909
|
+
else if (isObject(jsonData)) return mapJsonToYjsMap(jsonData);
|
|
24910
|
+
};
|
|
24911
|
+
const weavejsToYjsBinary = (weavejsData) => {
|
|
24912
|
+
const doc = new Y.Doc();
|
|
24913
|
+
doc.getMap("weave").set("key", weavejsData.weave.key);
|
|
24914
|
+
doc.getMap("weave").set("type", weavejsData.weave.type);
|
|
24915
|
+
doc.getMap("weave").set("props", mapJsonToYjsElements(weavejsData.weave.props));
|
|
24916
|
+
const actualState = Y.encodeStateAsUpdate(doc);
|
|
24917
|
+
return actualState;
|
|
24918
|
+
};
|
|
24919
|
+
function getJSONFromYjsBinary(actualState) {
|
|
24920
|
+
const document$1 = new Y.Doc();
|
|
24921
|
+
Y.applyUpdate(document$1, actualState);
|
|
24922
|
+
const actualStateString = JSON.stringify(document$1.getMap("weave").toJSON());
|
|
24923
|
+
const actualStateJson = JSON.parse(actualStateString);
|
|
24924
|
+
return actualStateJson;
|
|
24925
|
+
}
|
|
24926
|
+
|
|
24719
24927
|
//#endregion
|
|
24720
24928
|
//#region src/nodes/rectangle/rectangle.ts
|
|
24721
24929
|
var WeaveRectangleNode = class extends WeaveNode {
|
|
@@ -24815,6 +25023,65 @@ var WeaveRectangleNode = class extends WeaveNode {
|
|
|
24815
25023
|
const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
24816
25024
|
if (nodesSelectionPlugin) nodesSelectionPlugin.getTransformer().forceUpdate();
|
|
24817
25025
|
}
|
|
25026
|
+
static defaultState(nodeId) {
|
|
25027
|
+
return {
|
|
25028
|
+
...super.defaultState(nodeId),
|
|
25029
|
+
type: WEAVE_RECTANGLE_NODE_TYPE,
|
|
25030
|
+
props: {
|
|
25031
|
+
...super.defaultState(nodeId).props,
|
|
25032
|
+
nodeType: WEAVE_RECTANGLE_NODE_TYPE,
|
|
25033
|
+
x: 0,
|
|
25034
|
+
y: 0,
|
|
25035
|
+
width: 100,
|
|
25036
|
+
height: 100,
|
|
25037
|
+
stroke: "#000000",
|
|
25038
|
+
fill: "#FFFFFF",
|
|
25039
|
+
strokeWidth: 1,
|
|
25040
|
+
strokeScaleEnabled: true,
|
|
25041
|
+
rotation: 0,
|
|
25042
|
+
zIndex: 1,
|
|
25043
|
+
children: []
|
|
25044
|
+
}
|
|
25045
|
+
};
|
|
25046
|
+
}
|
|
25047
|
+
static addNodeState(defaultNodeState, props) {
|
|
25048
|
+
return mergeExceptArrays(defaultNodeState, { props: {
|
|
25049
|
+
x: props.x,
|
|
25050
|
+
y: props.y,
|
|
25051
|
+
width: props.width,
|
|
25052
|
+
height: props.height,
|
|
25053
|
+
rotation: props.rotation,
|
|
25054
|
+
fill: props.fill,
|
|
25055
|
+
...props.stroke && { stroke: props.stroke },
|
|
25056
|
+
...props.strokeWidth && { strokeWidth: props.strokeWidth }
|
|
25057
|
+
} });
|
|
25058
|
+
}
|
|
25059
|
+
static updateNodeState(prevNodeState, nextProps) {
|
|
25060
|
+
return mergeExceptArrays(prevNodeState, { props: {
|
|
25061
|
+
x: nextProps.x,
|
|
25062
|
+
y: nextProps.y,
|
|
25063
|
+
width: nextProps.width,
|
|
25064
|
+
height: nextProps.height,
|
|
25065
|
+
rotation: nextProps.rotation,
|
|
25066
|
+
fill: nextProps.fill,
|
|
25067
|
+
...nextProps.stroke && { stroke: nextProps.stroke },
|
|
25068
|
+
...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
|
|
25069
|
+
} });
|
|
25070
|
+
}
|
|
25071
|
+
static getSchema() {
|
|
25072
|
+
const baseSchema = super.getSchema();
|
|
25073
|
+
const imageNodeSchema = baseSchema.extend({
|
|
25074
|
+
type: z.literal("rectangle").describe("Type of the node, for a rectangle node it will always be \"rectangle\""),
|
|
25075
|
+
props: baseSchema.shape.props.extend({
|
|
25076
|
+
nodeType: z.literal("rectangle").describe("Type of the node, for a rectangle node it will always be \"rectangle\""),
|
|
25077
|
+
fill: z.string().describe("Fill color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
25078
|
+
stroke: z.string().describe("Stroke color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
|
|
25079
|
+
strokeWidth: z.number().describe("Stroke width of the rectangle in pixels"),
|
|
25080
|
+
strokeScaleEnabled: z.boolean().describe("Whether the rectangle stroke width should scale when the node is scaled. Defaults to true.")
|
|
25081
|
+
})
|
|
25082
|
+
});
|
|
25083
|
+
return imageNodeSchema;
|
|
25084
|
+
}
|
|
24818
25085
|
};
|
|
24819
25086
|
|
|
24820
25087
|
//#endregion
|
|
@@ -25986,6 +26253,62 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25986
26253
|
textNode.width(textAreaWidth);
|
|
25987
26254
|
this.instance.updateNode(this.serialize(textNode));
|
|
25988
26255
|
}
|
|
26256
|
+
static defaultState(nodeId, params) {
|
|
26257
|
+
const config = (0, import_lodash.merge)({}, WEAVE_TEXT_NODE_DEFAULT_CONFIG, params?.config ?? {});
|
|
26258
|
+
return {
|
|
26259
|
+
...super.defaultState(nodeId),
|
|
26260
|
+
type: WEAVE_TEXT_NODE_TYPE,
|
|
26261
|
+
props: {
|
|
26262
|
+
...super.defaultState(nodeId).props,
|
|
26263
|
+
nodeType: "text",
|
|
26264
|
+
fontFamily: "Arial",
|
|
26265
|
+
fontSize: 32,
|
|
26266
|
+
fontStyle: "normal",
|
|
26267
|
+
fontVariant: "normal",
|
|
26268
|
+
textDecoration: "none",
|
|
26269
|
+
letterSpacing: 0,
|
|
26270
|
+
lineHeight: 1,
|
|
26271
|
+
align: "left",
|
|
26272
|
+
verticalAlign: "top",
|
|
26273
|
+
fill: "#000000ff",
|
|
26274
|
+
text: "This is a text node",
|
|
26275
|
+
...!config.outline.enabled && { strokeEnabled: false },
|
|
26276
|
+
...config.outline.enabled && {
|
|
26277
|
+
strokeEnabled: true,
|
|
26278
|
+
stroke: config.outline.color,
|
|
26279
|
+
strokeWidth: config.outline.width,
|
|
26280
|
+
fillAfterStrokeEnabled: true
|
|
26281
|
+
},
|
|
26282
|
+
layout: TEXT_LAYOUT.SMART
|
|
26283
|
+
}
|
|
26284
|
+
};
|
|
26285
|
+
}
|
|
26286
|
+
static getSchema() {
|
|
26287
|
+
const baseSchema = super.getSchema();
|
|
26288
|
+
const textNodeSchema = baseSchema.extend({
|
|
26289
|
+
type: z.literal("text"),
|
|
26290
|
+
props: z.object({
|
|
26291
|
+
nodeType: z.literal("text"),
|
|
26292
|
+
fontFamily: z.string().default("Arial"),
|
|
26293
|
+
fontSize: z.number().default(16),
|
|
26294
|
+
fontStyle: z.string().default("normal"),
|
|
26295
|
+
fontVariant: z.string().default("normal"),
|
|
26296
|
+
textDecoration: z.string().default("none"),
|
|
26297
|
+
letterSpacing: z.number().default(0),
|
|
26298
|
+
lineHeight: z.number().default(1),
|
|
26299
|
+
align: z.string().default("left"),
|
|
26300
|
+
verticalAlign: z.string().default("top"),
|
|
26301
|
+
fill: z.string().default("#000000ff"),
|
|
26302
|
+
text: z.string().default("text"),
|
|
26303
|
+
stroke: z.string().optional().default("#d6d6d6"),
|
|
26304
|
+
strokeWidth: z.number().optional().default(2),
|
|
26305
|
+
strokeScaleEnabled: z.boolean().optional().default(true),
|
|
26306
|
+
fillAfterStrokeEnabled: z.boolean().optional().default(true),
|
|
26307
|
+
layout: z.enum(TEXT_LAYOUT).default(TEXT_LAYOUT.SMART)
|
|
26308
|
+
})
|
|
26309
|
+
});
|
|
26310
|
+
return textNodeSchema;
|
|
26311
|
+
}
|
|
25989
26312
|
};
|
|
25990
26313
|
|
|
25991
26314
|
//#endregion
|
|
@@ -27621,6 +27944,108 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
27621
27944
|
this.getNodesSelectionPlugin()?.setSelectedNodes([image]);
|
|
27622
27945
|
this.getNodesSelectionPlugin()?.getHoverTransformer().forceUpdate();
|
|
27623
27946
|
}
|
|
27947
|
+
static defaultState(nodeId) {
|
|
27948
|
+
return {
|
|
27949
|
+
...super.defaultState(nodeId),
|
|
27950
|
+
props: {
|
|
27951
|
+
...super.defaultState(nodeId).props,
|
|
27952
|
+
nodeType: WEAVE_IMAGE_NODE_TYPE,
|
|
27953
|
+
width: 800,
|
|
27954
|
+
height: 600,
|
|
27955
|
+
imageURL: "https://picsum.photos/id/10/800/600",
|
|
27956
|
+
adding: false,
|
|
27957
|
+
imageWidth: 800,
|
|
27958
|
+
imageHeight: 600,
|
|
27959
|
+
imageInfo: {
|
|
27960
|
+
width: 800,
|
|
27961
|
+
height: 600
|
|
27962
|
+
},
|
|
27963
|
+
uncroppedImage: {
|
|
27964
|
+
width: 800,
|
|
27965
|
+
height: 600
|
|
27966
|
+
},
|
|
27967
|
+
cropping: false,
|
|
27968
|
+
stroke: "#000000",
|
|
27969
|
+
fill: "#FFFFFF",
|
|
27970
|
+
strokeWidth: 0,
|
|
27971
|
+
strokeScaleEnabled: true,
|
|
27972
|
+
children: []
|
|
27973
|
+
}
|
|
27974
|
+
};
|
|
27975
|
+
}
|
|
27976
|
+
static addNodeState(defaultNodeState, props) {
|
|
27977
|
+
return mergeExceptArrays(defaultNodeState, { props: {
|
|
27978
|
+
x: props.x,
|
|
27979
|
+
y: props.y,
|
|
27980
|
+
width: props.width,
|
|
27981
|
+
height: props.height,
|
|
27982
|
+
rotation: props.rotation,
|
|
27983
|
+
imageURL: props.imageURL,
|
|
27984
|
+
...props.imageFallback && { imageFallback: props.imageFallback },
|
|
27985
|
+
...props.imageId && { imageId: props.imageId },
|
|
27986
|
+
adding: props.adding,
|
|
27987
|
+
imageWidth: props.imageWidth,
|
|
27988
|
+
imageHeight: props.imageHeight,
|
|
27989
|
+
imageInfo: {
|
|
27990
|
+
width: props.imageInfo.width,
|
|
27991
|
+
height: props.imageInfo.height
|
|
27992
|
+
},
|
|
27993
|
+
uncroppedImage: {
|
|
27994
|
+
width: props.uncroppedImage.width,
|
|
27995
|
+
height: props.uncroppedImage.height
|
|
27996
|
+
},
|
|
27997
|
+
cropping: props.cropping
|
|
27998
|
+
} });
|
|
27999
|
+
}
|
|
28000
|
+
static updateNodeState(prevNodeState, nextProps) {
|
|
28001
|
+
return mergeExceptArrays(prevNodeState, { props: {
|
|
28002
|
+
x: nextProps.x,
|
|
28003
|
+
y: nextProps.y,
|
|
28004
|
+
width: nextProps.width,
|
|
28005
|
+
height: nextProps.height,
|
|
28006
|
+
rotation: nextProps.rotation,
|
|
28007
|
+
imageURL: nextProps.imageURL,
|
|
28008
|
+
...nextProps.imageFallback && { imageFallback: nextProps.imageFallback },
|
|
28009
|
+
...nextProps.imageId && { imageId: nextProps.imageId },
|
|
28010
|
+
adding: nextProps.adding,
|
|
28011
|
+
imageWidth: nextProps.imageWidth,
|
|
28012
|
+
imageHeight: nextProps.imageHeight,
|
|
28013
|
+
...nextProps.imageInfo && { imageInfo: {
|
|
28014
|
+
width: nextProps.imageInfo.width,
|
|
28015
|
+
height: nextProps.imageInfo.height
|
|
28016
|
+
} },
|
|
28017
|
+
...nextProps.uncroppedImage && { uncroppedImage: {
|
|
28018
|
+
width: nextProps.uncroppedImage?.width,
|
|
28019
|
+
height: nextProps.uncroppedImage?.height
|
|
28020
|
+
} },
|
|
28021
|
+
cropping: nextProps.cropping
|
|
28022
|
+
} });
|
|
28023
|
+
}
|
|
28024
|
+
static getSchema() {
|
|
28025
|
+
const baseSchema = super.getSchema();
|
|
28026
|
+
const imageNodeSchema = baseSchema.extend({
|
|
28027
|
+
type: z.literal("image").describe("Type of the node, for a image node it will always be \"image\""),
|
|
28028
|
+
props: baseSchema.shape.props.extend({
|
|
28029
|
+
nodeType: z.literal("image").describe("Type of the node, for a image node it will always be \"image\""),
|
|
28030
|
+
imageURL: z.string().describe("The URL of the image to be rendered by the node"),
|
|
28031
|
+
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}"),
|
|
28032
|
+
adding: z.boolean().default(false),
|
|
28033
|
+
imageId: z.string().optional().describe("The id of the image, used for external management of the node."),
|
|
28034
|
+
imageWidth: z.number().describe("The width of the image in pixels"),
|
|
28035
|
+
imageHeight: z.number().describe("The height of the image in pixels"),
|
|
28036
|
+
imageInfo: z.object({
|
|
28037
|
+
width: z.number().describe("The original width of the image in pixels"),
|
|
28038
|
+
height: z.number().describe("The original height of the image in pixels")
|
|
28039
|
+
}),
|
|
28040
|
+
uncroppedImage: z.object({
|
|
28041
|
+
width: z.number().describe("The width of the image before cropping, used for cropping calculations"),
|
|
28042
|
+
height: z.number().describe("The height of the image before cropping, used for cropping calculations")
|
|
28043
|
+
}),
|
|
28044
|
+
cropping: z.boolean().default(false).describe("Whether the image is currently being cropped")
|
|
28045
|
+
})
|
|
28046
|
+
});
|
|
28047
|
+
return imageNodeSchema;
|
|
28048
|
+
}
|
|
27624
28049
|
};
|
|
27625
28050
|
|
|
27626
28051
|
//#endregion
|
|
@@ -28218,6 +28643,7 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
28218
28643
|
strokeWidth: 0,
|
|
28219
28644
|
fill: "transparent",
|
|
28220
28645
|
nodeId: id,
|
|
28646
|
+
nodeType: void 0,
|
|
28221
28647
|
id: `${id}-selection-area`,
|
|
28222
28648
|
listening: true,
|
|
28223
28649
|
draggable: true,
|
|
@@ -28374,6 +28800,79 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
28374
28800
|
};
|
|
28375
28801
|
}
|
|
28376
28802
|
scaleReset() {}
|
|
28803
|
+
static defaultState(nodeId) {
|
|
28804
|
+
return {
|
|
28805
|
+
...super.defaultState(nodeId),
|
|
28806
|
+
type: WEAVE_FRAME_NODE_TYPE,
|
|
28807
|
+
props: {
|
|
28808
|
+
...super.defaultState(nodeId).props,
|
|
28809
|
+
nodeType: WEAVE_FRAME_NODE_TYPE,
|
|
28810
|
+
x: 0,
|
|
28811
|
+
y: 0,
|
|
28812
|
+
width: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameWidth,
|
|
28813
|
+
height: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameHeight,
|
|
28814
|
+
title: WEAVE_FRAME_NODE_DEFAULT_PROPS.title,
|
|
28815
|
+
frameWidth: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameWidth,
|
|
28816
|
+
frameHeight: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameHeight,
|
|
28817
|
+
frameBackground: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameBackground,
|
|
28818
|
+
borderWidth: WEAVE_FRAME_NODE_DEFAULT_CONFIG.borderWidth,
|
|
28819
|
+
borderColor: WEAVE_FRAME_NODE_DEFAULT_CONFIG.borderColor,
|
|
28820
|
+
stroke: "transparent",
|
|
28821
|
+
strokeWidth: 0,
|
|
28822
|
+
strokeScaleEnabled: true,
|
|
28823
|
+
rotation: 0,
|
|
28824
|
+
zIndex: 1,
|
|
28825
|
+
children: []
|
|
28826
|
+
}
|
|
28827
|
+
};
|
|
28828
|
+
}
|
|
28829
|
+
static addNodeState(defaultNodeState, props) {
|
|
28830
|
+
return mergeExceptArrays(defaultNodeState, { props: {
|
|
28831
|
+
x: props.props.x,
|
|
28832
|
+
y: props.props.y,
|
|
28833
|
+
width: props.props.width,
|
|
28834
|
+
height: props.props.height,
|
|
28835
|
+
...props.props.title && { stroke: props.props.title },
|
|
28836
|
+
frameWidth: props.props.frameWidth,
|
|
28837
|
+
frameHeight: props.props.frameHeight,
|
|
28838
|
+
...props.props.frameBackground && { stroke: props.props.frameBackground },
|
|
28839
|
+
rotation: props.props.rotation,
|
|
28840
|
+
...props.props.borderColor && { borderColor: props.props.borderColor },
|
|
28841
|
+
...props.props.borderWidth && { borderWidth: props.props.borderWidth }
|
|
28842
|
+
} });
|
|
28843
|
+
}
|
|
28844
|
+
static updateNodeState(prevNodeState, nextProps) {
|
|
28845
|
+
return mergeExceptArrays(prevNodeState, { props: {
|
|
28846
|
+
x: nextProps.x,
|
|
28847
|
+
y: nextProps.y,
|
|
28848
|
+
width: nextProps.width,
|
|
28849
|
+
height: nextProps.height,
|
|
28850
|
+
rotation: nextProps.rotation,
|
|
28851
|
+
title: nextProps.title,
|
|
28852
|
+
...nextProps.frameBackground && { frameBackground: nextProps.frameBackground },
|
|
28853
|
+
...nextProps.borderColor && { stroke: nextProps.borderColor },
|
|
28854
|
+
...nextProps.borderWidth && { strokeWidth: nextProps.borderWidth }
|
|
28855
|
+
} });
|
|
28856
|
+
}
|
|
28857
|
+
static getSchema() {
|
|
28858
|
+
const baseSchema = super.getSchema();
|
|
28859
|
+
const frameNodeSchema = baseSchema.extend({
|
|
28860
|
+
type: z.literal("frame"),
|
|
28861
|
+
props: baseSchema.shape.props.extend({
|
|
28862
|
+
nodeType: z.literal("frame"),
|
|
28863
|
+
width: z.number().optional(),
|
|
28864
|
+
height: z.number().optional(),
|
|
28865
|
+
borderColor: z.string().default("#000000ff"),
|
|
28866
|
+
borderWidth: z.number().default(1),
|
|
28867
|
+
title: z.string().default("Frame"),
|
|
28868
|
+
frameWidth: z.number(),
|
|
28869
|
+
frameHeight: z.number(),
|
|
28870
|
+
frameBackground: z.string().default(WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR),
|
|
28871
|
+
children: z.array(z.any()).default([])
|
|
28872
|
+
})
|
|
28873
|
+
});
|
|
28874
|
+
return frameNodeSchema;
|
|
28875
|
+
}
|
|
28377
28876
|
};
|
|
28378
28877
|
|
|
28379
28878
|
//#endregion
|
|
@@ -28991,6 +29490,7 @@ var WeaveStrokeSingleNode = class extends WeaveNode {
|
|
|
28991
29490
|
this.shiftPressed = false;
|
|
28992
29491
|
}
|
|
28993
29492
|
initEvents() {
|
|
29493
|
+
if (this.instance.isServerSide()) return;
|
|
28994
29494
|
if (this.eventsInitialized) return;
|
|
28995
29495
|
window.addEventListener("keydown", (e) => {
|
|
28996
29496
|
if (e.key === "Shift") this.shiftPressed = true;
|
|
@@ -37745,52 +38245,6 @@ const MEASURE_TOOL_STATE = {
|
|
|
37745
38245
|
};
|
|
37746
38246
|
const WEAVE_MEASURE_TOOL_DEFAULT_CONFIG = { style: { stroke: "#FF3366" } };
|
|
37747
38247
|
|
|
37748
|
-
//#endregion
|
|
37749
|
-
//#region src/internal-utils/mapping.ts
|
|
37750
|
-
const isArray = (val) => {
|
|
37751
|
-
return Array.isArray(val);
|
|
37752
|
-
};
|
|
37753
|
-
const isObject = (val) => {
|
|
37754
|
-
return val !== null && typeof val === "object" && !Array.isArray(val);
|
|
37755
|
-
};
|
|
37756
|
-
const mapJsonToYjsMap = (jsonData) => {
|
|
37757
|
-
const map = new Y.Map();
|
|
37758
|
-
const keys = Object.keys(jsonData);
|
|
37759
|
-
for (const key of keys) {
|
|
37760
|
-
const value = jsonData[key];
|
|
37761
|
-
if (isArray(value)) map.set(key, mapJsonToYjsArray(value));
|
|
37762
|
-
else if (isObject(value)) map.set(key, mapJsonToYjsMap(value));
|
|
37763
|
-
else map.set(key, value);
|
|
37764
|
-
}
|
|
37765
|
-
return map;
|
|
37766
|
-
};
|
|
37767
|
-
const mapJsonToYjsArray = (jsonData) => {
|
|
37768
|
-
const array = new Y.Array();
|
|
37769
|
-
for (const item of jsonData) if (isArray(item)) array.push([mapJsonToYjsArray(item)]);
|
|
37770
|
-
else if (isObject(item)) array.push([mapJsonToYjsMap(item)]);
|
|
37771
|
-
else array.push(item);
|
|
37772
|
-
return array;
|
|
37773
|
-
};
|
|
37774
|
-
const mapJsonToYjsElements = (jsonData) => {
|
|
37775
|
-
if (isArray(jsonData)) return mapJsonToYjsArray(jsonData);
|
|
37776
|
-
else if (isObject(jsonData)) return mapJsonToYjsMap(jsonData);
|
|
37777
|
-
};
|
|
37778
|
-
const weavejsToYjsBinary = (weavejsData) => {
|
|
37779
|
-
const doc = new Y.Doc();
|
|
37780
|
-
doc.getMap("weave").set("key", weavejsData.weave.key);
|
|
37781
|
-
doc.getMap("weave").set("type", weavejsData.weave.type);
|
|
37782
|
-
doc.getMap("weave").set("props", mapJsonToYjsElements(weavejsData.weave.props));
|
|
37783
|
-
const actualState = Y.encodeStateAsUpdate(doc);
|
|
37784
|
-
return actualState;
|
|
37785
|
-
};
|
|
37786
|
-
function getJSONFromYjsBinary(actualState) {
|
|
37787
|
-
const document$1 = new Y.Doc();
|
|
37788
|
-
Y.applyUpdate(document$1, actualState);
|
|
37789
|
-
const actualStateString = JSON.stringify(document$1.getMap("weave").toJSON());
|
|
37790
|
-
const actualStateJson = JSON.parse(actualStateString);
|
|
37791
|
-
return actualStateJson;
|
|
37792
|
-
}
|
|
37793
|
-
|
|
37794
38248
|
//#endregion
|
|
37795
38249
|
//#region src/actions/measure-tool/measure-tool.ts
|
|
37796
38250
|
var WeaveMeasureToolAction = class extends WeaveAction {
|
|
@@ -42975,5 +43429,5 @@ var WeaveNodesSnappingPlugin = class extends WeavePlugin {
|
|
|
42975
43429
|
};
|
|
42976
43430
|
|
|
42977
43431
|
//#endregion
|
|
42978
|
-
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, getJSONFromYjsBinary, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isObject, isServer, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend, weavejsToYjsBinary };
|
|
43432
|
+
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, getJSONFromYjsBinary, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isObject, isServer, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend, weavejsToYjsBinary };
|
|
42979
43433
|
//# sourceMappingURL=types.js.map
|