@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/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";
@@ -10481,7 +10483,7 @@ var require_lodash = __commonJS({ "../../node_modules/lodash/lodash.js"(exports,
10481
10483
  * // => false
10482
10484
  */
10483
10485
  function isNaN$1(value) {
10484
- return isNumber(value) && value != +value;
10486
+ return isNumber$1(value) && value != +value;
10485
10487
  }
10486
10488
  /**
10487
10489
  * Checks if `value` is a pristine native function.
@@ -10582,7 +10584,7 @@ var require_lodash = __commonJS({ "../../node_modules/lodash/lodash.js"(exports,
10582
10584
  * _.isNumber('3');
10583
10585
  * // => false
10584
10586
  */
10585
- function isNumber(value) {
10587
+ function isNumber$1(value) {
10586
10588
  return typeof value == "number" || isObjectLike$7(value) && baseGetTag$6(value) == numberTag$1;
10587
10589
  }
10588
10590
  /**
@@ -14917,7 +14919,7 @@ var require_lodash = __commonJS({ "../../node_modules/lodash/lodash.js"(exports,
14917
14919
  lodash.isNative = isNative;
14918
14920
  lodash.isNil = isNil;
14919
14921
  lodash.isNull = isNull;
14920
- lodash.isNumber = isNumber;
14922
+ lodash.isNumber = isNumber$1;
14921
14923
  lodash.isObject = isObject$12;
14922
14924
  lodash.isObjectLike = isObjectLike$7;
14923
14925
  lodash.isPlainObject = isPlainObject$2;
@@ -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$1;
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: {}
@@ -18142,6 +18145,9 @@ function getStageClickPoint(instance, pointerPos) {
18142
18145
  };
18143
18146
  return stageClickPoint;
18144
18147
  }
18148
+ function isNumber(value) {
18149
+ return typeof value === "number" && !Number.isNaN(value);
18150
+ }
18145
18151
 
18146
18152
  //#endregion
18147
18153
  //#region src/actions/selection-tool/constants.ts
@@ -18950,10 +18956,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18950
18956
  });
18951
18957
  tr.on("mouseover", () => {
18952
18958
  const nodesSelected = tr.nodes();
18953
- if (nodesSelected.length === 1) {
18954
- const node = nodesSelected[0];
18955
- stage.container().style.cursor = (typeof node?.defineMousePointer === "function" ? node.defineMousePointer() : null) ?? "grab";
18956
- } else stage.container().style.cursor = "grab";
18959
+ if (nodesSelected.length > 1) stage.container().style.cursor = "grab";
18957
18960
  });
18958
18961
  tr.on("mouseout", (e) => {
18959
18962
  this.instance.getStage().handleMouseover?.(e);
@@ -21088,6 +21091,46 @@ var WeaveNode = class {
21088
21091
  getIsAsync() {
21089
21092
  return false;
21090
21093
  }
21094
+ static defaultState(nodeId) {
21095
+ return {
21096
+ key: nodeId,
21097
+ type: "unknown",
21098
+ props: {
21099
+ id: nodeId,
21100
+ nodeType: "unknown",
21101
+ x: 0,
21102
+ y: 0,
21103
+ width: 100,
21104
+ height: 100,
21105
+ rotation: 0,
21106
+ scaleX: 1,
21107
+ scaleY: 1,
21108
+ opacity: 1,
21109
+ zIndex: 1,
21110
+ children: []
21111
+ }
21112
+ };
21113
+ }
21114
+ static getSchema() {
21115
+ const baseNodeSchema = z.object({
21116
+ key: z.string().describe("Unique identifier (uuid) for the node, generate one it if not provided"),
21117
+ type: z.string().describe("Type of the node, must be always provided"),
21118
+ props: z.object({
21119
+ id: z.string().describe("Unique identifier (uuid) for the node instance, is the same as key"),
21120
+ nodeType: z.string().describe("Type of the node, must be always provided"),
21121
+ x: z.number().describe("X position of the node, relative to the parent container"),
21122
+ y: z.number().describe("Y position of the node, relative to the parent container"),
21123
+ scaleX: z.number().describe("Scale factor on the X axis, default is 1"),
21124
+ scaleY: z.number().describe("Scale factor on the Y axis, default is 1"),
21125
+ rotation: z.number().optional().describe("Rotation of the node in degrees, default is 0"),
21126
+ skewX: z.number().optional().describe("Skew on the X axis in degrees, default is 0"),
21127
+ skewY: z.number().optional().describe("Skew on the Y axis in degrees, default is 0"),
21128
+ opacity: z.number().describe("Opacity of the node, between 0 and 1, default is 1"),
21129
+ children: z.array(z.any()).length(0).describe("Children nodes, always be an empty array for leaf nodes")
21130
+ })
21131
+ });
21132
+ return baseNodeSchema;
21133
+ }
21091
21134
  };
21092
21135
 
21093
21136
  //#endregion
@@ -22210,7 +22253,7 @@ var WeaveRegisterManager = class {
22210
22253
 
22211
22254
  //#endregion
22212
22255
  //#region package.json
22213
- var version = "4.1.1";
22256
+ var version = "4.2.0-SNAPSHOT.318.1";
22214
22257
 
22215
22258
  //#endregion
22216
22259
  //#region src/managers/setup.ts
@@ -23434,6 +23477,9 @@ var WeaveHooksManager = class {
23434
23477
  unregisterHook(hookName) {
23435
23478
  this.registeredHooks.delete(hookName);
23436
23479
  }
23480
+ reset() {
23481
+ this.registeredHooks.clear();
23482
+ }
23437
23483
  };
23438
23484
 
23439
23485
  //#endregion
@@ -23628,6 +23674,8 @@ var Weave = class {
23628
23674
  const nodeHandler = nodeHandlers[nodeHandlerKey];
23629
23675
  nodeHandler?.onDestroyInstance();
23630
23676
  }
23677
+ const mainLayer = this.stageManager.getMainLayer();
23678
+ if (mainLayer) mainLayer.destroy();
23631
23679
  const stage = this.getStage();
23632
23680
  if (stage) stage.destroy();
23633
23681
  if (this.eventsController) this.eventsController.abort();
@@ -23642,6 +23690,8 @@ var Weave = class {
23642
23690
  this.status = WEAVE_INSTANCE_STATUS.STARTING;
23643
23691
  this.emitEvent("onInstanceStatus", this.status);
23644
23692
  this.registerManager.reset();
23693
+ this.hooks.removeAllHooks();
23694
+ this.hooksManager.reset();
23645
23695
  this.status = WEAVE_INSTANCE_STATUS.LOADING_FONTS;
23646
23696
  this.emitEvent("onInstanceStatus", this.status);
23647
23697
  await this.fontsManager.loadFonts();
@@ -23659,6 +23709,7 @@ var Weave = class {
23659
23709
  this.emitEvent("onInstanceStatus", this.status);
23660
23710
  const store = this.storeManager.getStore();
23661
23711
  store.disconnect();
23712
+ store.getDocument()?.destroy();
23662
23713
  const nodeHandlers = this.registerManager.getNodesHandlers();
23663
23714
  for (const nodeHandlerKey of Object.keys(nodeHandlers)) {
23664
23715
  const nodeHandler = nodeHandlers[nodeHandlerKey];
@@ -24428,6 +24479,114 @@ const downscaleImageFromURL = (url, options) => {
24428
24479
  });
24429
24480
  };
24430
24481
 
24482
+ //#endregion
24483
+ //#region src/state.manipulation.ts
24484
+ var WeaveStateManipulation = class WeaveStateManipulation {
24485
+ static mapPropsToYjs(props) {
24486
+ const propsMap = new Y$1.Map();
24487
+ for (const propKey of Object.keys(props)) {
24488
+ const propValue = props[propKey];
24489
+ if (Array.isArray(propValue)) {
24490
+ const childrenArray = new Y$1.Array();
24491
+ propValue.forEach((child) => {
24492
+ const childMap = WeaveStateManipulation.mapPropsToYjs(child);
24493
+ childrenArray.push([childMap]);
24494
+ });
24495
+ } else if (typeof propValue === "object" && propValue !== null && !Array.isArray(propValue)) propsMap.set(propKey, WeaveStateManipulation.mapPropsToYjs(propValue));
24496
+ else propsMap.set(propKey, propValue);
24497
+ }
24498
+ return propsMap;
24499
+ }
24500
+ static mapNodeToYjs(node) {
24501
+ const nodeId = node.key;
24502
+ const element = new Y$1.Map();
24503
+ const elementProps = new Y$1.Map();
24504
+ element.set("key", nodeId);
24505
+ element.set("type", node.type);
24506
+ element.set("props", elementProps);
24507
+ for (const propKey of Object.keys(node.props)) {
24508
+ const propValue = node.props[propKey];
24509
+ if (Array.isArray(propValue) && propKey === "children") {
24510
+ const childrenArray = new Y$1.Array();
24511
+ propValue.forEach((child) => {
24512
+ const childMap = WeaveStateManipulation.mapNodeToYjs(child);
24513
+ childrenArray.push([childMap.element]);
24514
+ });
24515
+ elementProps.set(propKey, childrenArray);
24516
+ } else if (Array.isArray(propValue) && propKey !== "children") {
24517
+ const childrenArray = new Y$1.Array();
24518
+ propValue.forEach((child) => {
24519
+ const childMap = WeaveStateManipulation.mapPropsToYjs(child);
24520
+ childrenArray.push([childMap]);
24521
+ });
24522
+ elementProps.set(propKey, childrenArray);
24523
+ } else if (typeof propValue === "object" && propValue !== null && !Array.isArray(propValue)) {
24524
+ const childrenMap = WeaveStateManipulation.mapPropsToYjs(propValue);
24525
+ elementProps.set(propKey, childrenMap);
24526
+ } else elementProps.set(propKey, propValue);
24527
+ }
24528
+ return {
24529
+ nodeId: node.key,
24530
+ element
24531
+ };
24532
+ }
24533
+ static addElements(layerYjsElement, yjsElements) {
24534
+ layerYjsElement.get("props").get("children").push(yjsElements);
24535
+ }
24536
+ static updateElements(layerYjsElement, yjsElements) {
24537
+ for (let i = 0; i < yjsElements.length; i++) {
24538
+ const yjsElement = yjsElements[i];
24539
+ const nodeId = yjsElement.nodeId;
24540
+ const element = yjsElement.element;
24541
+ const childrenArr = JSON.parse(JSON.stringify(layerYjsElement.get("props").get("children")));
24542
+ const index = childrenArr.findIndex((child) => child["key"] === nodeId);
24543
+ if (index !== -1) {
24544
+ layerYjsElement.get("props").get("children").delete(index);
24545
+ layerYjsElement.get("props").get("children").insert(index, [element]);
24546
+ }
24547
+ }
24548
+ }
24549
+ static deleteElements(layerYjsElement, yjsElementsIds) {
24550
+ for (let i = 0; i < yjsElementsIds.length; i++) {
24551
+ const yjsElementId = yjsElementsIds[i];
24552
+ const childrenArr = JSON.parse(JSON.stringify(layerYjsElement.get("props").get("children")));
24553
+ const index = childrenArr.findIndex((child) => child["key"] === yjsElementId);
24554
+ if (index !== -1) layerYjsElement.get("props").get("children").delete(index);
24555
+ }
24556
+ }
24557
+ static getYjsElement(doc, nodeId) {
24558
+ const stage = doc.getMap("weave");
24559
+ const stageProps = stage.get("props");
24560
+ const stageChildren = stageProps.get("children");
24561
+ for (let i = 0; i < stageChildren.length; i++) {
24562
+ const child = stageChildren.get(i);
24563
+ const childProps = child.get("props");
24564
+ if (childProps.get("id") === nodeId) return child;
24565
+ if (childProps.get("children")) {
24566
+ const childChildren = childProps.get("children");
24567
+ for (let j = 0; j < childChildren.length; j++) {
24568
+ const grandChild = childChildren.get(j);
24569
+ const grandChildProps = grandChild.get("props");
24570
+ if (grandChildProps.get("id") === nodeId) return grandChild;
24571
+ }
24572
+ }
24573
+ }
24574
+ return null;
24575
+ }
24576
+ static getNodesBoundingBox(nodes) {
24577
+ const minX = Math.min(...nodes.map((n) => n.props.x));
24578
+ const minY = Math.min(...nodes.map((n) => n.props.y));
24579
+ const maxX = Math.max(...nodes.map((n) => n.props.x + n.props.width));
24580
+ const maxY = Math.max(...nodes.map((n) => n.props.y + n.props.height));
24581
+ return {
24582
+ x: minX,
24583
+ y: minY,
24584
+ width: maxX - minX,
24585
+ height: maxY - minY
24586
+ };
24587
+ }
24588
+ };
24589
+
24431
24590
  //#endregion
24432
24591
  //#region src/internal-utils/upscale.ts
24433
24592
  const setupUpscaleStage = (instance, stage) => {
@@ -24545,10 +24704,11 @@ var WeaveStageNode = class extends WeaveNode {
24545
24704
  const activeAction = this.instance.getActiveAction();
24546
24705
  if ([MOVE_TOOL_ACTION_NAME].includes(activeAction ?? "")) return;
24547
24706
  if (e.target !== stage && !e.target.getAttrs().nodeId) return;
24548
- const parent = e.target.getParent();
24707
+ let parent = e.target.getParent();
24549
24708
  if (parent && parent instanceof Konva.Transformer) return;
24550
24709
  this.hideHoverState();
24551
- if (!this.instance.isServerSide()) stage.container().style.cursor = "default";
24710
+ if (e.target.getAttrs().nodeId) parent = stage.findOne(`#${e.target.getAttrs().nodeId}`);
24711
+ if (!this.instance.isServerSide() && !parent?.hasName("node")) stage.container().style.cursor = "default";
24552
24712
  });
24553
24713
  this.setupEvents();
24554
24714
  return stage;
@@ -24731,6 +24891,52 @@ var WeaveGroupNode = class extends WeaveNode {
24731
24891
  //#region src/nodes/rectangle/constants.ts
24732
24892
  const WEAVE_RECTANGLE_NODE_TYPE = "rectangle";
24733
24893
 
24894
+ //#endregion
24895
+ //#region src/internal-utils/mapping.ts
24896
+ const isArray = (val) => {
24897
+ return Array.isArray(val);
24898
+ };
24899
+ const isObject = (val) => {
24900
+ return val !== null && typeof val === "object" && !Array.isArray(val);
24901
+ };
24902
+ const mapJsonToYjsMap = (jsonData) => {
24903
+ const map = new Y.Map();
24904
+ const keys = Object.keys(jsonData);
24905
+ for (const key of keys) {
24906
+ const value = jsonData[key];
24907
+ if (isArray(value)) map.set(key, mapJsonToYjsArray(value));
24908
+ else if (isObject(value)) map.set(key, mapJsonToYjsMap(value));
24909
+ else map.set(key, value);
24910
+ }
24911
+ return map;
24912
+ };
24913
+ const mapJsonToYjsArray = (jsonData) => {
24914
+ const array = new Y.Array();
24915
+ for (const item of jsonData) if (isArray(item)) array.push([mapJsonToYjsArray(item)]);
24916
+ else if (isObject(item)) array.push([mapJsonToYjsMap(item)]);
24917
+ else array.push(item);
24918
+ return array;
24919
+ };
24920
+ const mapJsonToYjsElements = (jsonData) => {
24921
+ if (isArray(jsonData)) return mapJsonToYjsArray(jsonData);
24922
+ else if (isObject(jsonData)) return mapJsonToYjsMap(jsonData);
24923
+ };
24924
+ const weavejsToYjsBinary = (weavejsData) => {
24925
+ const doc = new Y.Doc();
24926
+ doc.getMap("weave").set("key", weavejsData.weave.key);
24927
+ doc.getMap("weave").set("type", weavejsData.weave.type);
24928
+ doc.getMap("weave").set("props", mapJsonToYjsElements(weavejsData.weave.props));
24929
+ const actualState = Y.encodeStateAsUpdate(doc);
24930
+ return actualState;
24931
+ };
24932
+ function getJSONFromYjsBinary(actualState) {
24933
+ const document$1 = new Y.Doc();
24934
+ Y.applyUpdate(document$1, actualState);
24935
+ const actualStateString = JSON.stringify(document$1.getMap("weave").toJSON());
24936
+ const actualStateJson = JSON.parse(actualStateString);
24937
+ return actualStateJson;
24938
+ }
24939
+
24734
24940
  //#endregion
24735
24941
  //#region src/nodes/rectangle/rectangle.ts
24736
24942
  var WeaveRectangleNode = class extends WeaveNode {
@@ -24830,6 +25036,67 @@ var WeaveRectangleNode = class extends WeaveNode {
24830
25036
  const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
24831
25037
  if (nodesSelectionPlugin) nodesSelectionPlugin.getTransformer().forceUpdate();
24832
25038
  }
25039
+ static defaultState(nodeId) {
25040
+ return {
25041
+ ...super.defaultState(nodeId),
25042
+ type: WEAVE_RECTANGLE_NODE_TYPE,
25043
+ props: {
25044
+ ...super.defaultState(nodeId).props,
25045
+ nodeType: WEAVE_RECTANGLE_NODE_TYPE,
25046
+ x: 0,
25047
+ y: 0,
25048
+ width: 100,
25049
+ height: 100,
25050
+ stroke: "#000000",
25051
+ fill: "#FFFFFF",
25052
+ strokeWidth: 1,
25053
+ strokeScaleEnabled: true,
25054
+ rotation: 0,
25055
+ zIndex: 1,
25056
+ children: []
25057
+ }
25058
+ };
25059
+ }
25060
+ static addNodeState(defaultNodeState, props) {
25061
+ return mergeExceptArrays(defaultNodeState, { props: {
25062
+ x: props.x,
25063
+ y: props.y,
25064
+ width: props.width,
25065
+ height: props.height,
25066
+ rotation: props.rotation,
25067
+ fill: props.fill,
25068
+ ...props.stroke && { stroke: props.stroke },
25069
+ ...props.strokeWidth && { strokeWidth: props.strokeWidth }
25070
+ } });
25071
+ }
25072
+ static updateNodeState(prevNodeState, nextProps) {
25073
+ return mergeExceptArrays(prevNodeState, { props: {
25074
+ x: nextProps.x,
25075
+ y: nextProps.y,
25076
+ width: nextProps.width,
25077
+ height: nextProps.height,
25078
+ rotation: nextProps.rotation,
25079
+ fill: nextProps.fill,
25080
+ ...nextProps.stroke && { stroke: nextProps.stroke },
25081
+ ...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
25082
+ } });
25083
+ }
25084
+ static getSchema() {
25085
+ const baseSchema = super.getSchema();
25086
+ const nodeSchema = baseSchema.extend({
25087
+ type: z.literal(WEAVE_RECTANGLE_NODE_TYPE).describe(`Type of the node, for a rectangle node it will always be "${WEAVE_RECTANGLE_NODE_TYPE}"`),
25088
+ props: baseSchema.shape.props.extend({
25089
+ nodeType: z.literal(WEAVE_RECTANGLE_NODE_TYPE).describe(`Type of the node, for a rectangle node it will always be "${WEAVE_RECTANGLE_NODE_TYPE}"`),
25090
+ width: z.number().describe("Width of the rectangle in pixels"),
25091
+ height: z.number().describe("Height of the rectangle in pixels"),
25092
+ fill: z.string().describe("Fill color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
25093
+ stroke: z.string().describe("Stroke color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
25094
+ strokeWidth: z.number().describe("Stroke width of the rectangle in pixels"),
25095
+ strokeScaleEnabled: z.boolean().describe("Whether the rectangle stroke width should scale when the node is scaled. Defaults to true.")
25096
+ })
25097
+ });
25098
+ return nodeSchema;
25099
+ }
24833
25100
  };
24834
25101
 
24835
25102
  //#endregion
@@ -24989,6 +25256,67 @@ var WeaveEllipseNode = class extends WeaveNode {
24989
25256
  node.x(node.x() + dx);
24990
25257
  node.y(node.y() + dy);
24991
25258
  }
25259
+ static defaultState(nodeId) {
25260
+ return {
25261
+ ...super.defaultState(nodeId),
25262
+ type: WEAVE_ELLIPSE_NODE_TYPE,
25263
+ props: {
25264
+ ...super.defaultState(nodeId).props,
25265
+ nodeType: WEAVE_ELLIPSE_NODE_TYPE,
25266
+ x: 0,
25267
+ y: 0,
25268
+ radiusX: 100,
25269
+ radiusY: 100,
25270
+ stroke: "#000000",
25271
+ fill: "#FFFFFF",
25272
+ strokeWidth: 1,
25273
+ strokeScaleEnabled: true,
25274
+ rotation: 0,
25275
+ zIndex: 1,
25276
+ children: []
25277
+ }
25278
+ };
25279
+ }
25280
+ static addNodeState(defaultNodeState, props) {
25281
+ return mergeExceptArrays(defaultNodeState, { props: {
25282
+ x: props.x,
25283
+ y: props.y,
25284
+ radiusX: props.radiusX,
25285
+ radiusY: props.radiusY,
25286
+ rotation: props.rotation,
25287
+ fill: props.fill,
25288
+ ...props.stroke && { stroke: props.stroke },
25289
+ ...props.strokeWidth && { strokeWidth: props.strokeWidth }
25290
+ } });
25291
+ }
25292
+ static updateNodeState(prevNodeState, nextProps) {
25293
+ return mergeExceptArrays(prevNodeState, { props: {
25294
+ x: nextProps.x,
25295
+ y: nextProps.y,
25296
+ radiusX: nextProps.radiusX,
25297
+ radiusY: nextProps.radiusY,
25298
+ rotation: nextProps.rotation,
25299
+ fill: nextProps.fill,
25300
+ ...nextProps.stroke && { stroke: nextProps.stroke },
25301
+ ...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
25302
+ } });
25303
+ }
25304
+ static getSchema() {
25305
+ const baseSchema = super.getSchema();
25306
+ const nodeSchema = baseSchema.extend({
25307
+ type: z.literal(WEAVE_ELLIPSE_NODE_TYPE).describe(`Type of the node, for a ellipse node it will always be "${WEAVE_ELLIPSE_NODE_TYPE}"`),
25308
+ props: baseSchema.shape.props.extend({
25309
+ nodeType: z.literal(WEAVE_ELLIPSE_NODE_TYPE).describe(`Type of the node, for a ellipse node it will always be "${WEAVE_ELLIPSE_NODE_TYPE}"`),
25310
+ radiusX: z.number().describe("Radius on the X axis of the ellipse in pixels"),
25311
+ radiusY: z.number().describe("Radius on the Y axis of the ellipse in pixels"),
25312
+ fill: z.string().describe("Fill color of the ellipse in hex format with alpha channel (e.g. #RRGGBBAA)"),
25313
+ stroke: z.string().describe("Stroke color of the ellipse in hex format with alpha channel (e.g. #RRGGBBAA)"),
25314
+ strokeWidth: z.number().describe("Stroke width of the ellipse in pixels"),
25315
+ strokeScaleEnabled: z.boolean().describe("Whether the ellipse stroke width should scale when the node is scaled. Defaults to true.")
25316
+ })
25317
+ });
25318
+ return nodeSchema;
25319
+ }
24992
25320
  };
24993
25321
 
24994
25322
  //#endregion
@@ -25361,7 +25689,8 @@ const WEAVE_TEXT_NODE_TYPE = "text";
25361
25689
  const WEAVE_STAGE_TEXT_EDITION_MODE = "text-edition";
25362
25690
  const WEAVE_TEXT_NODE_DEFAULT_CONFIG = {
25363
25691
  transform: { ...WEAVE_NODES_SELECTION_DEFAULT_CONFIG.selection },
25364
- outline: { enabled: false }
25692
+ outline: { enabled: false },
25693
+ cursor: { color: "#000000" }
25365
25694
  };
25366
25695
  const TEXT_LAYOUT = {
25367
25696
  ["SMART"]: "smart",
@@ -25695,6 +26024,7 @@ var WeaveTextNode = class extends WeaveNode {
25695
26024
  }
25696
26025
  mimicTextNode(textNode) {
25697
26026
  if (!this.textArea) return;
26027
+ this.textArea.style.caretColor = this.config.cursor.color;
25698
26028
  this.textArea.style.fontSize = textNode.fontSize() * textNode.getAbsoluteScale().x + "px";
25699
26029
  this.textArea.rows = textNode.text().split("\n").length;
25700
26030
  this.textArea.style.letterSpacing = `${textNode.letterSpacing()}`;
@@ -25703,7 +26033,9 @@ var WeaveTextNode = class extends WeaveNode {
25703
26033
  this.textArea.style.fontFamily = textNode.fontFamily();
25704
26034
  let fontWeight = "normal";
25705
26035
  let fontStyle = "normal";
26036
+ const matchNumber = textNode.fontStyle().match(/\d+/);
25706
26037
  if ((textNode.fontStyle() ?? "normal").indexOf("bold") !== -1) fontWeight = "bold";
26038
+ if (matchNumber) fontWeight = matchNumber[0].toString();
25707
26039
  if ((textNode.fontStyle() ?? "normal").indexOf("italic") !== -1) fontStyle = "italic";
25708
26040
  this.textArea.style.fontWeight = fontWeight;
25709
26041
  this.textArea.style.backgroundColor = "transparent";
@@ -26001,6 +26333,128 @@ var WeaveTextNode = class extends WeaveNode {
26001
26333
  textNode.width(textAreaWidth);
26002
26334
  this.instance.updateNode(this.serialize(textNode));
26003
26335
  }
26336
+ static defaultState(nodeId, params) {
26337
+ const config = (0, import_lodash.merge)({}, WEAVE_TEXT_NODE_DEFAULT_CONFIG, params?.config ?? {});
26338
+ return {
26339
+ ...super.defaultState(nodeId),
26340
+ type: WEAVE_TEXT_NODE_TYPE,
26341
+ props: {
26342
+ ...super.defaultState(nodeId).props,
26343
+ nodeType: "text",
26344
+ fontFamily: "Arial",
26345
+ fontSize: 32,
26346
+ fontStyle: "normal",
26347
+ fontVariant: "normal",
26348
+ textDecoration: "none",
26349
+ letterSpacing: 0,
26350
+ lineHeight: 1,
26351
+ align: "left",
26352
+ verticalAlign: "top",
26353
+ fill: "#000000ff",
26354
+ text: "This is a text node",
26355
+ layout: TEXT_LAYOUT.SMART,
26356
+ ...!config.outline.enabled && { strokeEnabled: false },
26357
+ ...config.outline.enabled && {
26358
+ strokeEnabled: true,
26359
+ stroke: config.outline.color,
26360
+ strokeWidth: config.outline.width,
26361
+ fillAfterStrokeEnabled: true
26362
+ }
26363
+ }
26364
+ };
26365
+ }
26366
+ static addNodeState(defaultNodeState, props) {
26367
+ return mergeExceptArrays(defaultNodeState, { props: {
26368
+ x: props.x,
26369
+ y: props.y,
26370
+ width: props.width,
26371
+ ...props.height && { height: props.height },
26372
+ FontFamily: props.fontFamily,
26373
+ fontSize: props.fontSize,
26374
+ fontStyle: props.fontStyle,
26375
+ fontVariant: props.fontVariant,
26376
+ textDecoration: props.textDecoration,
26377
+ letterSpacing: props.letterSpacing,
26378
+ lineHeight: props.lineHeight,
26379
+ align: props.align,
26380
+ verticalAlign: props.verticalAlign,
26381
+ rotation: props.rotation,
26382
+ fill: props.fill,
26383
+ text: props.text,
26384
+ layout: props.layout,
26385
+ ...props.strokeEnabled && { strokeEnabled: props.strokeEnabled },
26386
+ ...props.stroke && { stroke: props.stroke },
26387
+ ...props.strokeWidth && { strokeWidth: props.strokeWidth },
26388
+ ...props.fillAfterStrokeEnabled && { fillAfterStrokeEnabled: props.fillAfterStrokeEnabled }
26389
+ } });
26390
+ }
26391
+ static updateNodeState(prevNodeState, nextProps) {
26392
+ return mergeExceptArrays(prevNodeState, { props: {
26393
+ x: nextProps.x,
26394
+ y: nextProps.y,
26395
+ width: nextProps.width,
26396
+ ...nextProps.height && { height: nextProps.height },
26397
+ FontFamily: nextProps.fontFamily,
26398
+ fontSize: nextProps.fontSize,
26399
+ fontStyle: nextProps.fontStyle,
26400
+ fontVariant: nextProps.fontVariant,
26401
+ textDecoration: nextProps.textDecoration,
26402
+ letterSpacing: nextProps.letterSpacing,
26403
+ lineHeight: nextProps.lineHeight,
26404
+ align: nextProps.align,
26405
+ verticalAlign: nextProps.verticalAlign,
26406
+ rotation: nextProps.rotation,
26407
+ fill: nextProps.fill,
26408
+ text: nextProps.text,
26409
+ layout: nextProps.layout,
26410
+ ...nextProps.strokeEnabled && { strokeEnabled: nextProps.strokeEnabled },
26411
+ ...nextProps.stroke && { stroke: nextProps.stroke },
26412
+ ...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth },
26413
+ ...nextProps.fillAfterStrokeEnabled && { fillAfterStrokeEnabled: nextProps.fillAfterStrokeEnabled }
26414
+ } });
26415
+ }
26416
+ static getSchema() {
26417
+ const baseSchema = super.getSchema();
26418
+ const nodeSchema = baseSchema.extend({
26419
+ type: z.literal(WEAVE_TEXT_NODE_TYPE).describe(`Type of the node, for a text node it will always be "${WEAVE_TEXT_NODE_TYPE}"`),
26420
+ props: z.object({
26421
+ nodeType: z.literal(WEAVE_TEXT_NODE_TYPE).describe(`Type of the node, for a text node it will always be "${WEAVE_TEXT_NODE_TYPE}"`),
26422
+ width: z.number().describe("Width of the text in pixels"),
26423
+ height: z.number().optional().describe("Height of the text in pixels. Optional if layout is auto-height or smart."),
26424
+ fontFamily: z.string().default("Arial").describe("Font family of the text, e.g. Arial, Helvetica, etc."),
26425
+ fontSize: z.number().default(16).describe("Font size of the text in pixels."),
26426
+ 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\"."),
26427
+ fontVariant: z.enum(["normal", "small-caps"]).describe("Font variant of the text, can be \"normal\" or \"small-caps\"."),
26428
+ textDecoration: z.enum([
26429
+ "line-through",
26430
+ "underline",
26431
+ ""
26432
+ ]).default("").describe("Text decoration can be \"line-through\", \"underline\" or empty string for none."),
26433
+ letterSpacing: z.number().default(0).describe("Spacing between letters in pixels."),
26434
+ lineHeight: z.number().default(1).describe("Line height of the text, as a multiplier of font size."),
26435
+ align: z.enum([
26436
+ "left",
26437
+ "center",
26438
+ "right",
26439
+ "justify"
26440
+ ]).default("left").describe("Text alignment, can be \"left\", \"center\", \"right\" or \"justify\"."),
26441
+ verticalAlign: z.enum([
26442
+ "top",
26443
+ "middle",
26444
+ "bottom"
26445
+ ]).default("top").describe("Vertical alignment of the text, can be 'top', 'middle' or 'bottom'."),
26446
+ fill: z.string().default("#000000ff").describe("Fill color of the text in hex format with alpha channel (e.g. #RRGGBBAA)."),
26447
+ text: z.string().default("text").describe("The actual text content of the node."),
26448
+ strokeEnabled: z.boolean().default(false).describe("Whether the text outline is enabled."),
26449
+ stroke: z.string().optional().default("#d6d6d6").describe("Color of the text outline in hex format with alpha channel (e.g. #RRGGBBAA)."),
26450
+ strokeWidth: z.number().optional().default(2).describe("Width of the text outline in pixels."),
26451
+ strokeScaleEnabled: z.boolean().default(true).describe("Whether the stroke width should scale when the node is scaled."),
26452
+ 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."),
26453
+ 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.")
26454
+ })
26455
+ });
26456
+ return nodeSchema;
26457
+ }
26004
26458
  };
26005
26459
 
26006
26460
  //#endregion
@@ -27637,6 +28091,111 @@ var WeaveImageNode = class extends WeaveNode {
27637
28091
  this.getNodesSelectionPlugin()?.setSelectedNodes([image]);
27638
28092
  this.getNodesSelectionPlugin()?.getHoverTransformer().forceUpdate();
27639
28093
  }
28094
+ static defaultState(nodeId) {
28095
+ return {
28096
+ ...super.defaultState(nodeId),
28097
+ type: WEAVE_IMAGE_NODE_TYPE,
28098
+ props: {
28099
+ ...super.defaultState(nodeId).props,
28100
+ nodeType: WEAVE_IMAGE_NODE_TYPE,
28101
+ width: 800,
28102
+ height: 600,
28103
+ imageURL: "https://picsum.photos/id/10/800/600",
28104
+ adding: false,
28105
+ imageWidth: 800,
28106
+ imageHeight: 600,
28107
+ imageInfo: {
28108
+ width: 800,
28109
+ height: 600
28110
+ },
28111
+ uncroppedImage: {
28112
+ width: 800,
28113
+ height: 600
28114
+ },
28115
+ cropping: false,
28116
+ stroke: "#000000",
28117
+ fill: "#FFFFFF",
28118
+ strokeWidth: 0,
28119
+ strokeScaleEnabled: true,
28120
+ children: []
28121
+ }
28122
+ };
28123
+ }
28124
+ static addNodeState(defaultNodeState, props) {
28125
+ return mergeExceptArrays(defaultNodeState, { props: {
28126
+ x: props.x,
28127
+ y: props.y,
28128
+ width: props.width,
28129
+ height: props.height,
28130
+ rotation: props.rotation,
28131
+ imageURL: props.imageURL,
28132
+ ...props.imageFallback && { imageFallback: props.imageFallback },
28133
+ ...props.imageId && { imageId: props.imageId },
28134
+ adding: props.adding,
28135
+ imageWidth: props.imageWidth,
28136
+ imageHeight: props.imageHeight,
28137
+ imageInfo: {
28138
+ width: props.imageInfo.width,
28139
+ height: props.imageInfo.height
28140
+ },
28141
+ uncroppedImage: {
28142
+ width: props.uncroppedImage.width,
28143
+ height: props.uncroppedImage.height
28144
+ },
28145
+ cropping: props.cropping
28146
+ } });
28147
+ }
28148
+ static updateNodeState(prevNodeState, nextProps) {
28149
+ return mergeExceptArrays(prevNodeState, { props: {
28150
+ x: nextProps.x,
28151
+ y: nextProps.y,
28152
+ width: nextProps.width,
28153
+ height: nextProps.height,
28154
+ rotation: nextProps.rotation,
28155
+ imageURL: nextProps.imageURL,
28156
+ ...nextProps.imageFallback && { imageFallback: nextProps.imageFallback },
28157
+ ...nextProps.imageId && { imageId: nextProps.imageId },
28158
+ adding: nextProps.adding,
28159
+ imageWidth: nextProps.imageWidth,
28160
+ imageHeight: nextProps.imageHeight,
28161
+ ...nextProps.imageInfo && { imageInfo: {
28162
+ width: nextProps.imageInfo.width,
28163
+ height: nextProps.imageInfo.height
28164
+ } },
28165
+ ...nextProps.uncroppedImage && { uncroppedImage: {
28166
+ width: nextProps.uncroppedImage?.width,
28167
+ height: nextProps.uncroppedImage?.height
28168
+ } },
28169
+ cropping: nextProps.cropping
28170
+ } });
28171
+ }
28172
+ static getSchema() {
28173
+ const baseSchema = super.getSchema();
28174
+ const nodeSchema = baseSchema.extend({
28175
+ type: z.literal(WEAVE_IMAGE_NODE_TYPE).describe(`Type of the node, for a image node it will always be "${WEAVE_IMAGE_NODE_TYPE}"`),
28176
+ props: baseSchema.shape.props.extend({
28177
+ nodeType: z.literal("image").describe(`Type of the node, for a image node it will always be "${WEAVE_IMAGE_NODE_TYPE}"`),
28178
+ width: z.number().describe("Width of the image in pixels"),
28179
+ height: z.number().describe("Height of the image in pixels"),
28180
+ imageURL: z.string().describe("The URL of the image to be rendered by the node"),
28181
+ 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}"),
28182
+ adding: z.boolean().default(false),
28183
+ imageId: z.string().optional().describe("The id of the image, used for external management of the node."),
28184
+ imageWidth: z.number().describe("The width of the image in pixels"),
28185
+ imageHeight: z.number().describe("The height of the image in pixels"),
28186
+ imageInfo: z.object({
28187
+ width: z.number().describe("The original width of the image in pixels"),
28188
+ height: z.number().describe("The original height of the image in pixels")
28189
+ }),
28190
+ uncroppedImage: z.object({
28191
+ width: z.number().describe("The width of the image before cropping, used for cropping calculations"),
28192
+ height: z.number().describe("The height of the image before cropping, used for cropping calculations")
28193
+ }),
28194
+ cropping: z.boolean().default(false).describe("Whether the image is currently being cropped")
28195
+ })
28196
+ });
28197
+ return nodeSchema;
28198
+ }
27640
28199
  };
27641
28200
 
27642
28201
  //#endregion
@@ -27808,6 +28367,71 @@ var WeaveStarNode = class extends WeaveNode {
27808
28367
  y: element.props.outerRadius
27809
28368
  };
27810
28369
  }
28370
+ static defaultState(nodeId) {
28371
+ return {
28372
+ ...super.defaultState(nodeId),
28373
+ type: WEAVE_STAR_NODE_TYPE,
28374
+ props: {
28375
+ ...super.defaultState(nodeId).props,
28376
+ nodeType: WEAVE_STAR_NODE_TYPE,
28377
+ x: 0,
28378
+ y: 0,
28379
+ numPoints: 5,
28380
+ innerRadius: 50,
28381
+ outerRadius: 100,
28382
+ stroke: "#000000",
28383
+ fill: "#FFFFFF",
28384
+ strokeWidth: 1,
28385
+ strokeScaleEnabled: true,
28386
+ rotation: 0,
28387
+ zIndex: 1,
28388
+ children: []
28389
+ }
28390
+ };
28391
+ }
28392
+ static addNodeState(defaultNodeState, props) {
28393
+ return mergeExceptArrays(defaultNodeState, { props: {
28394
+ x: props.x,
28395
+ y: props.y,
28396
+ numPoints: props.numPoints,
28397
+ innerRadius: props.innerRadius,
28398
+ outerRadius: props.outerRadius,
28399
+ rotation: props.rotation,
28400
+ fill: props.fill,
28401
+ ...props.stroke && { stroke: props.stroke },
28402
+ ...props.strokeWidth && { strokeWidth: props.strokeWidth }
28403
+ } });
28404
+ }
28405
+ static updateNodeState(prevNodeState, nextProps) {
28406
+ return mergeExceptArrays(prevNodeState, { props: {
28407
+ x: nextProps.x,
28408
+ y: nextProps.y,
28409
+ numPoints: nextProps.numPoints,
28410
+ innerRadius: nextProps.innerRadius,
28411
+ outerRadius: nextProps.outerRadius,
28412
+ rotation: nextProps.rotation,
28413
+ fill: nextProps.fill,
28414
+ ...nextProps.stroke && { stroke: nextProps.stroke },
28415
+ ...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
28416
+ } });
28417
+ }
28418
+ static getSchema() {
28419
+ const baseSchema = super.getSchema();
28420
+ const nodeSchema = baseSchema.extend({
28421
+ type: z.literal(WEAVE_STAR_NODE_TYPE).describe(`Type of the node, for a start node it will always be "${WEAVE_STAR_NODE_TYPE}"`),
28422
+ props: baseSchema.shape.props.extend({
28423
+ nodeType: z.literal(WEAVE_STAR_NODE_TYPE).describe(`Type of the node, for a rectangle node it will always be "${WEAVE_STAR_NODE_TYPE}"`),
28424
+ numPoints: z.number().describe("Number of points of the star, must be greater than or equal to 3"),
28425
+ innerRadius: z.number().describe("Inner radius of the star, must be greater than or equal to 0"),
28426
+ outerRadius: z.number().describe("Outer radius of the star, must be greater than or equal to 0"),
28427
+ fill: z.string().describe("Fill color of the star in hex format with alpha channel (e.g. #RRGGBBAA)"),
28428
+ stroke: z.string().describe("Stroke color of the star in hex format with alpha channel (e.g. #RRGGBBAA)"),
28429
+ strokeWidth: z.number().describe("Stroke width of the star in pixels"),
28430
+ strokeScaleEnabled: z.boolean().describe("Whether the star stroke width should scale when the node is scaled. Defaults to true.")
28431
+ })
28432
+ });
28433
+ return nodeSchema;
28434
+ }
27811
28435
  };
27812
28436
 
27813
28437
  //#endregion
@@ -28023,6 +28647,67 @@ var WeaveRegularPolygonNode = class extends WeaveNode {
28023
28647
  y: element.props.radius
28024
28648
  };
28025
28649
  }
28650
+ static defaultState(nodeId) {
28651
+ return {
28652
+ ...super.defaultState(nodeId),
28653
+ type: WEAVE_REGULAR_POLYGON_NODE_TYPE,
28654
+ props: {
28655
+ ...super.defaultState(nodeId).props,
28656
+ nodeType: WEAVE_REGULAR_POLYGON_NODE_TYPE,
28657
+ x: 0,
28658
+ y: 0,
28659
+ sides: 5,
28660
+ radius: 100,
28661
+ stroke: "#000000",
28662
+ fill: "#FFFFFF",
28663
+ strokeWidth: 1,
28664
+ strokeScaleEnabled: true,
28665
+ rotation: 0,
28666
+ zIndex: 1,
28667
+ children: []
28668
+ }
28669
+ };
28670
+ }
28671
+ static addNodeState(defaultNodeState, props) {
28672
+ return mergeExceptArrays(defaultNodeState, { props: {
28673
+ x: props.x,
28674
+ y: props.y,
28675
+ sides: props.sides,
28676
+ radius: props.radius,
28677
+ rotation: props.rotation,
28678
+ fill: props.fill,
28679
+ ...props.stroke && { stroke: props.stroke },
28680
+ ...props.strokeWidth && { strokeWidth: props.strokeWidth }
28681
+ } });
28682
+ }
28683
+ static updateNodeState(prevNodeState, nextProps) {
28684
+ return mergeExceptArrays(prevNodeState, { props: {
28685
+ x: nextProps.x,
28686
+ y: nextProps.y,
28687
+ sides: nextProps.sides,
28688
+ radius: nextProps.radius,
28689
+ rotation: nextProps.rotation,
28690
+ fill: nextProps.fill,
28691
+ ...nextProps.stroke && { stroke: nextProps.stroke },
28692
+ ...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
28693
+ } });
28694
+ }
28695
+ static getSchema() {
28696
+ const baseSchema = super.getSchema();
28697
+ const nodeSchema = baseSchema.extend({
28698
+ 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}"`),
28699
+ props: baseSchema.shape.props.extend({
28700
+ 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}"`),
28701
+ sides: z.number().describe("Number of sides of the regular polygon, must be 3 or more"),
28702
+ radius: z.number().describe("Radius of the regular polygon in pixels, distance from the center to any vertex"),
28703
+ fill: z.string().describe("Fill color of the regular polygon in hex format with alpha channel (e.g. #RRGGBBAA)"),
28704
+ stroke: z.string().describe("Stroke color of the regular polygon in hex format with alpha channel (e.g. #RRGGBBAA)"),
28705
+ strokeWidth: z.number().describe("Stroke width of the regular polygon in pixels"),
28706
+ strokeScaleEnabled: z.boolean().describe("Whether the regular polygon stroke width should scale when the node is scaled. Defaults to true.")
28707
+ })
28708
+ });
28709
+ return nodeSchema;
28710
+ }
28026
28711
  };
28027
28712
 
28028
28713
  //#endregion
@@ -28234,6 +28919,7 @@ var WeaveFrameNode = class extends WeaveNode {
28234
28919
  strokeWidth: 0,
28235
28920
  fill: "transparent",
28236
28921
  nodeId: id,
28922
+ nodeType: void 0,
28237
28923
  id: `${id}-selection-area`,
28238
28924
  listening: true,
28239
28925
  draggable: true,
@@ -28390,6 +29076,77 @@ var WeaveFrameNode = class extends WeaveNode {
28390
29076
  };
28391
29077
  }
28392
29078
  scaleReset() {}
29079
+ static defaultState(nodeId) {
29080
+ return {
29081
+ ...super.defaultState(nodeId),
29082
+ type: WEAVE_FRAME_NODE_TYPE,
29083
+ props: {
29084
+ ...super.defaultState(nodeId).props,
29085
+ nodeType: WEAVE_FRAME_NODE_TYPE,
29086
+ x: 0,
29087
+ y: 0,
29088
+ width: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameWidth,
29089
+ height: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameHeight,
29090
+ title: WEAVE_FRAME_NODE_DEFAULT_PROPS.title,
29091
+ frameWidth: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameWidth,
29092
+ frameHeight: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameHeight,
29093
+ frameBackground: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameBackground,
29094
+ borderWidth: WEAVE_FRAME_NODE_DEFAULT_CONFIG.borderWidth,
29095
+ borderColor: WEAVE_FRAME_NODE_DEFAULT_CONFIG.borderColor,
29096
+ stroke: "transparent",
29097
+ strokeWidth: 0,
29098
+ strokeScaleEnabled: true,
29099
+ rotation: 0,
29100
+ zIndex: 1,
29101
+ children: []
29102
+ }
29103
+ };
29104
+ }
29105
+ static addNodeState(defaultNodeState, props) {
29106
+ return mergeExceptArrays(defaultNodeState, { props: {
29107
+ x: props.x,
29108
+ y: props.y,
29109
+ width: props.width,
29110
+ height: props.height,
29111
+ ...props.title && { stroke: props.title },
29112
+ frameWidth: props.frameWidth,
29113
+ frameHeight: props.frameHeight,
29114
+ ...props.frameBackground && { stroke: props.frameBackground },
29115
+ rotation: props.rotation,
29116
+ ...props.borderColor && { borderColor: props.borderColor },
29117
+ ...props.borderWidth && { borderWidth: props.borderWidth }
29118
+ } });
29119
+ }
29120
+ static updateNodeState(prevNodeState, nextProps) {
29121
+ return mergeExceptArrays(prevNodeState, { props: {
29122
+ x: nextProps.x,
29123
+ y: nextProps.y,
29124
+ width: nextProps.width,
29125
+ height: nextProps.height,
29126
+ rotation: nextProps.rotation,
29127
+ title: nextProps.title,
29128
+ ...nextProps.frameBackground && { frameBackground: nextProps.frameBackground },
29129
+ ...nextProps.borderColor && { stroke: nextProps.borderColor },
29130
+ ...nextProps.borderWidth && { strokeWidth: nextProps.borderWidth }
29131
+ } });
29132
+ }
29133
+ static getSchema() {
29134
+ const baseSchema = super.getSchema();
29135
+ const nodeSchema = baseSchema.extend({
29136
+ type: z.literal(WEAVE_FRAME_NODE_TYPE).describe(`Type of the node, for a frame node it will always be "${WEAVE_FRAME_NODE_TYPE}"`),
29137
+ props: baseSchema.shape.props.extend({
29138
+ nodeType: z.literal(WEAVE_FRAME_NODE_TYPE).describe(`Type of the node, for a frame node it will always be "${WEAVE_FRAME_NODE_TYPE}"`),
29139
+ borderColor: z.string().default("#000000ff").describe("Border color of the frame in hex format with alpha channel (e.g. #RRGGBBAA)"),
29140
+ borderWidth: z.number().default(1).describe("Border width of the frame in hex format with alpha channel (e.g. #RRGGBBAA)"),
29141
+ title: z.string().default("Frame").describe("Title of the frame"),
29142
+ frameWidth: z.number().describe("Width of the frame in pixels"),
29143
+ frameHeight: z.number().describe("Height of the frame in pixels"),
29144
+ frameBackground: z.string().default(WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR).describe("Background color of the frame in hex format with alpha channel (e.g. #RRGGBBAA)"),
29145
+ children: z.array(z.any()).default([])
29146
+ })
29147
+ });
29148
+ return nodeSchema;
29149
+ }
28393
29150
  };
28394
29151
 
28395
29152
  //#endregion
@@ -29007,6 +29764,7 @@ var WeaveStrokeSingleNode = class extends WeaveNode {
29007
29764
  this.shiftPressed = false;
29008
29765
  }
29009
29766
  initEvents() {
29767
+ if (this.instance.isServerSide()) return;
29010
29768
  if (this.eventsInitialized) return;
29011
29769
  window.addEventListener("keydown", (e) => {
29012
29770
  if (e.key === "Shift") this.shiftPressed = true;
@@ -29358,6 +30116,70 @@ var WeaveStrokeSingleNode = class extends WeaveNode {
29358
30116
  }
29359
30117
  return pos;
29360
30118
  }
30119
+ static defaultState(nodeId) {
30120
+ return {
30121
+ ...super.defaultState(nodeId),
30122
+ type: WEAVE_STROKE_SINGLE_NODE_TYPE,
30123
+ props: {
30124
+ ...super.defaultState(nodeId).props,
30125
+ nodeType: WEAVE_STROKE_SINGLE_NODE_TYPE,
30126
+ x: 0,
30127
+ y: 0,
30128
+ strokeElements: [
30129
+ 0,
30130
+ 0,
30131
+ 100,
30132
+ 100
30133
+ ],
30134
+ stroke: "#000000",
30135
+ fill: "#FFFFFF",
30136
+ strokeWidth: 1,
30137
+ strokeScaleEnabled: true,
30138
+ rotation: 0,
30139
+ zIndex: 1,
30140
+ children: []
30141
+ }
30142
+ };
30143
+ }
30144
+ static addNodeState(defaultNodeState, props) {
30145
+ return mergeExceptArrays(defaultNodeState, { props: {
30146
+ x: props.x,
30147
+ y: props.y,
30148
+ strokeElements: props.strokeElements,
30149
+ rotation: props.rotation,
30150
+ fill: props.fill,
30151
+ ...props.stroke && { stroke: props.stroke },
30152
+ ...props.strokeWidth && { strokeWidth: props.strokeWidth }
30153
+ } });
30154
+ }
30155
+ static updateNodeState(prevNodeState, nextProps) {
30156
+ return mergeExceptArrays(prevNodeState, { props: {
30157
+ x: nextProps.x,
30158
+ y: nextProps.y,
30159
+ strokeElements: nextProps.strokeElements,
30160
+ rotation: nextProps.rotation,
30161
+ fill: nextProps.fill,
30162
+ ...nextProps.stroke && { stroke: nextProps.stroke },
30163
+ ...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
30164
+ } });
30165
+ }
30166
+ static getSchema() {
30167
+ const baseSchema = super.getSchema();
30168
+ const nodeSchema = baseSchema.extend({
30169
+ 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}"`),
30170
+ props: baseSchema.shape.props.extend({
30171
+ 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}"`),
30172
+ 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]"),
30173
+ 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".`),
30174
+ 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".`),
30175
+ fill: z.string().describe("Fill color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
30176
+ stroke: z.string().describe("Stroke color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
30177
+ strokeWidth: z.number().describe("Stroke width of the rectangle in pixels"),
30178
+ strokeScaleEnabled: z.boolean().describe("Whether the rectangle stroke width should scale when the node is scaled. Defaults to true.")
30179
+ })
30180
+ });
30181
+ return nodeSchema;
30182
+ }
29361
30183
  };
29362
30184
 
29363
30185
  //#endregion
@@ -37761,52 +38583,6 @@ const MEASURE_TOOL_STATE = {
37761
38583
  };
37762
38584
  const WEAVE_MEASURE_TOOL_DEFAULT_CONFIG = { style: { stroke: "#FF3366" } };
37763
38585
 
37764
- //#endregion
37765
- //#region src/internal-utils/mapping.ts
37766
- const isArray = (val) => {
37767
- return Array.isArray(val);
37768
- };
37769
- const isObject = (val) => {
37770
- return val !== null && typeof val === "object" && !Array.isArray(val);
37771
- };
37772
- const mapJsonToYjsMap = (jsonData) => {
37773
- const map = new Y.Map();
37774
- const keys = Object.keys(jsonData);
37775
- for (const key of keys) {
37776
- const value = jsonData[key];
37777
- if (isArray(value)) map.set(key, mapJsonToYjsArray(value));
37778
- else if (isObject(value)) map.set(key, mapJsonToYjsMap(value));
37779
- else map.set(key, value);
37780
- }
37781
- return map;
37782
- };
37783
- const mapJsonToYjsArray = (jsonData) => {
37784
- const array = new Y.Array();
37785
- for (const item of jsonData) if (isArray(item)) array.push([mapJsonToYjsArray(item)]);
37786
- else if (isObject(item)) array.push([mapJsonToYjsMap(item)]);
37787
- else array.push(item);
37788
- return array;
37789
- };
37790
- const mapJsonToYjsElements = (jsonData) => {
37791
- if (isArray(jsonData)) return mapJsonToYjsArray(jsonData);
37792
- else if (isObject(jsonData)) return mapJsonToYjsMap(jsonData);
37793
- };
37794
- const weavejsToYjsBinary = (weavejsData) => {
37795
- const doc = new Y.Doc();
37796
- doc.getMap("weave").set("key", weavejsData.weave.key);
37797
- doc.getMap("weave").set("type", weavejsData.weave.type);
37798
- doc.getMap("weave").set("props", mapJsonToYjsElements(weavejsData.weave.props));
37799
- const actualState = Y.encodeStateAsUpdate(doc);
37800
- return actualState;
37801
- };
37802
- function getJSONFromYjsBinary(actualState) {
37803
- const document$1 = new Y.Doc();
37804
- Y.applyUpdate(document$1, actualState);
37805
- const actualStateString = JSON.stringify(document$1.getMap("weave").toJSON());
37806
- const actualStateJson = JSON.parse(actualStateString);
37807
- return actualStateJson;
37808
- }
37809
-
37810
38586
  //#endregion
37811
38587
  //#region src/actions/measure-tool/measure-tool.ts
37812
38588
  var WeaveMeasureToolAction = class extends WeaveAction {
@@ -39804,7 +40580,6 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
39804
40580
  if (this.initialized) return;
39805
40581
  const container = this.config.getContainer();
39806
40582
  if (!container) return;
39807
- console.log("setup minimap");
39808
40583
  let preview = document.getElementById(this.config.id);
39809
40584
  const windowAspectRatio = window.innerWidth / window.innerHeight;
39810
40585
  if (!preview) {
@@ -39825,7 +40600,6 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
39825
40600
  this.initialized = true;
39826
40601
  this.minimapLayer = new Konva.Layer();
39827
40602
  this.minimapStage.add(this.minimapLayer);
39828
- console.log("aqui?");
39829
40603
  this.minimapViewportReference = new Konva.Rect({
39830
40604
  ...this.config.style.viewportReference,
39831
40605
  id: "minimapViewportReference",
@@ -39837,10 +40611,8 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
39837
40611
  }
39838
40612
  const stage = this.instance.getStage();
39839
40613
  stage.on("dragmove wheel dragend scaleXChange scaleYChange xChange yChange", () => {
39840
- console.log("update minimap viewport");
39841
40614
  this.updateMinimapViewportReference();
39842
40615
  });
39843
- console.log("aqui initialized");
39844
40616
  }
39845
40617
  async updateMinimapContent() {
39846
40618
  const stage = this.instance.getStage();
@@ -39905,9 +40677,7 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
39905
40677
  this.setupMinimap();
39906
40678
  }
39907
40679
  onInit() {
39908
- console.log("init minimap");
39909
40680
  const throttledUpdateMinimap = (0, import_lodash.throttle)(async () => {
39910
- console.log("throttle update minimap");
39911
40681
  await this.updateMinimapContent();
39912
40682
  this.updateMinimapViewportReference();
39913
40683
  }, DEFAULT_THROTTLE_MS);
@@ -42989,5 +43759,5 @@ var WeaveNodesSnappingPlugin = class extends WeavePlugin {
42989
43759
  };
42990
43760
 
42991
43761
  //#endregion
42992
- 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 };
43762
+ 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, isNumber, isObject, isServer, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend, weavejsToYjsBinary };
42993
43763
  //# sourceMappingURL=types.js.map