@inditextech/weave-sdk 4.1.1 → 4.2.0-SNAPSHOT.318.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sdk.js 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 "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
@@ -22199,7 +22242,7 @@ var WeaveRegisterManager = class {
22199
22242
 
22200
22243
  //#endregion
22201
22244
  //#region package.json
22202
- var version = "4.1.1";
22245
+ var version = "4.2.0-SNAPSHOT.318.1";
22203
22246
 
22204
22247
  //#endregion
22205
22248
  //#region src/managers/setup.ts
@@ -23423,6 +23466,9 @@ var WeaveHooksManager = class {
23423
23466
  unregisterHook(hookName) {
23424
23467
  this.registeredHooks.delete(hookName);
23425
23468
  }
23469
+ reset() {
23470
+ this.registeredHooks.clear();
23471
+ }
23426
23472
  };
23427
23473
 
23428
23474
  //#endregion
@@ -23617,6 +23663,8 @@ var Weave = class {
23617
23663
  const nodeHandler = nodeHandlers[nodeHandlerKey];
23618
23664
  nodeHandler?.onDestroyInstance();
23619
23665
  }
23666
+ const mainLayer = this.stageManager.getMainLayer();
23667
+ if (mainLayer) mainLayer.destroy();
23620
23668
  const stage = this.getStage();
23621
23669
  if (stage) stage.destroy();
23622
23670
  if (this.eventsController) this.eventsController.abort();
@@ -23631,6 +23679,8 @@ var Weave = class {
23631
23679
  this.status = WEAVE_INSTANCE_STATUS.STARTING;
23632
23680
  this.emitEvent("onInstanceStatus", this.status);
23633
23681
  this.registerManager.reset();
23682
+ this.hooks.removeAllHooks();
23683
+ this.hooksManager.reset();
23634
23684
  this.status = WEAVE_INSTANCE_STATUS.LOADING_FONTS;
23635
23685
  this.emitEvent("onInstanceStatus", this.status);
23636
23686
  await this.fontsManager.loadFonts();
@@ -23648,6 +23698,7 @@ var Weave = class {
23648
23698
  this.emitEvent("onInstanceStatus", this.status);
23649
23699
  const store = this.storeManager.getStore();
23650
23700
  store.disconnect();
23701
+ store.getDocument()?.destroy();
23651
23702
  const nodeHandlers = this.registerManager.getNodesHandlers();
23652
23703
  for (const nodeHandlerKey of Object.keys(nodeHandlers)) {
23653
23704
  const nodeHandler = nodeHandlers[nodeHandlerKey];
@@ -24417,6 +24468,114 @@ const downscaleImageFromURL = (url, options) => {
24417
24468
  });
24418
24469
  };
24419
24470
 
24471
+ //#endregion
24472
+ //#region src/state.manipulation.ts
24473
+ var WeaveStateManipulation = class WeaveStateManipulation {
24474
+ static mapPropsToYjs(props) {
24475
+ const propsMap = new Y$1.Map();
24476
+ for (const propKey of Object.keys(props)) {
24477
+ const propValue = props[propKey];
24478
+ if (Array.isArray(propValue)) {
24479
+ const childrenArray = new Y$1.Array();
24480
+ propValue.forEach((child) => {
24481
+ const childMap = WeaveStateManipulation.mapPropsToYjs(child);
24482
+ childrenArray.push([childMap]);
24483
+ });
24484
+ } else if (typeof propValue === "object" && propValue !== null && !Array.isArray(propValue)) propsMap.set(propKey, WeaveStateManipulation.mapPropsToYjs(propValue));
24485
+ else propsMap.set(propKey, propValue);
24486
+ }
24487
+ return propsMap;
24488
+ }
24489
+ static mapNodeToYjs(node) {
24490
+ const nodeId = node.key;
24491
+ const element = new Y$1.Map();
24492
+ const elementProps = new Y$1.Map();
24493
+ element.set("key", nodeId);
24494
+ element.set("type", node.type);
24495
+ element.set("props", elementProps);
24496
+ for (const propKey of Object.keys(node.props)) {
24497
+ const propValue = node.props[propKey];
24498
+ if (Array.isArray(propValue) && propKey === "children") {
24499
+ const childrenArray = new Y$1.Array();
24500
+ propValue.forEach((child) => {
24501
+ const childMap = WeaveStateManipulation.mapNodeToYjs(child);
24502
+ childrenArray.push([childMap.element]);
24503
+ });
24504
+ elementProps.set(propKey, childrenArray);
24505
+ } else if (Array.isArray(propValue) && propKey !== "children") {
24506
+ const childrenArray = new Y$1.Array();
24507
+ propValue.forEach((child) => {
24508
+ const childMap = WeaveStateManipulation.mapPropsToYjs(child);
24509
+ childrenArray.push([childMap]);
24510
+ });
24511
+ elementProps.set(propKey, childrenArray);
24512
+ } else if (typeof propValue === "object" && propValue !== null && !Array.isArray(propValue)) {
24513
+ const childrenMap = WeaveStateManipulation.mapPropsToYjs(propValue);
24514
+ elementProps.set(propKey, childrenMap);
24515
+ } else elementProps.set(propKey, propValue);
24516
+ }
24517
+ return {
24518
+ nodeId: node.key,
24519
+ element
24520
+ };
24521
+ }
24522
+ static addElements(layerYjsElement, yjsElements) {
24523
+ layerYjsElement.get("props").get("children").push(yjsElements);
24524
+ }
24525
+ static updateElements(layerYjsElement, yjsElements) {
24526
+ for (let i = 0; i < yjsElements.length; i++) {
24527
+ const yjsElement = yjsElements[i];
24528
+ const nodeId = yjsElement.nodeId;
24529
+ const element = yjsElement.element;
24530
+ const childrenArr = JSON.parse(JSON.stringify(layerYjsElement.get("props").get("children")));
24531
+ const index = childrenArr.findIndex((child) => child["key"] === nodeId);
24532
+ if (index !== -1) {
24533
+ layerYjsElement.get("props").get("children").delete(index);
24534
+ layerYjsElement.get("props").get("children").insert(index, [element]);
24535
+ }
24536
+ }
24537
+ }
24538
+ static deleteElements(layerYjsElement, yjsElementsIds) {
24539
+ for (let i = 0; i < yjsElementsIds.length; i++) {
24540
+ const yjsElementId = yjsElementsIds[i];
24541
+ const childrenArr = JSON.parse(JSON.stringify(layerYjsElement.get("props").get("children")));
24542
+ const index = childrenArr.findIndex((child) => child["key"] === yjsElementId);
24543
+ if (index !== -1) layerYjsElement.get("props").get("children").delete(index);
24544
+ }
24545
+ }
24546
+ static getYjsElement(doc, nodeId) {
24547
+ const stage = doc.getMap("weave");
24548
+ const stageProps = stage.get("props");
24549
+ const stageChildren = stageProps.get("children");
24550
+ for (let i = 0; i < stageChildren.length; i++) {
24551
+ const child = stageChildren.get(i);
24552
+ const childProps = child.get("props");
24553
+ if (childProps.get("id") === nodeId) return child;
24554
+ if (childProps.get("children")) {
24555
+ const childChildren = childProps.get("children");
24556
+ for (let j = 0; j < childChildren.length; j++) {
24557
+ const grandChild = childChildren.get(j);
24558
+ const grandChildProps = grandChild.get("props");
24559
+ if (grandChildProps.get("id") === nodeId) return grandChild;
24560
+ }
24561
+ }
24562
+ }
24563
+ return null;
24564
+ }
24565
+ static getNodesBoundingBox(nodes) {
24566
+ const minX = Math.min(...nodes.map((n) => n.props.x));
24567
+ const minY = Math.min(...nodes.map((n) => n.props.y));
24568
+ const maxX = Math.max(...nodes.map((n) => n.props.x + n.props.width));
24569
+ const maxY = Math.max(...nodes.map((n) => n.props.y + n.props.height));
24570
+ return {
24571
+ x: minX,
24572
+ y: minY,
24573
+ width: maxX - minX,
24574
+ height: maxY - minY
24575
+ };
24576
+ }
24577
+ };
24578
+
24420
24579
  //#endregion
24421
24580
  //#region src/internal-utils/upscale.ts
24422
24581
  const setupUpscaleStage = (instance, stage) => {
@@ -24534,10 +24693,11 @@ var WeaveStageNode = class extends WeaveNode {
24534
24693
  const activeAction = this.instance.getActiveAction();
24535
24694
  if ([MOVE_TOOL_ACTION_NAME].includes(activeAction ?? "")) return;
24536
24695
  if (e.target !== stage && !e.target.getAttrs().nodeId) return;
24537
- const parent = e.target.getParent();
24696
+ let parent = e.target.getParent();
24538
24697
  if (parent && parent instanceof Konva.Transformer) return;
24539
24698
  this.hideHoverState();
24540
- if (!this.instance.isServerSide()) stage.container().style.cursor = "default";
24699
+ if (e.target.getAttrs().nodeId) parent = stage.findOne(`#${e.target.getAttrs().nodeId}`);
24700
+ if (!this.instance.isServerSide() && !parent?.hasName("node")) stage.container().style.cursor = "default";
24541
24701
  });
24542
24702
  this.setupEvents();
24543
24703
  return stage;
@@ -24819,6 +24979,67 @@ var WeaveRectangleNode = class extends WeaveNode {
24819
24979
  const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
24820
24980
  if (nodesSelectionPlugin) nodesSelectionPlugin.getTransformer().forceUpdate();
24821
24981
  }
24982
+ static defaultState(nodeId) {
24983
+ return {
24984
+ ...super.defaultState(nodeId),
24985
+ type: WEAVE_RECTANGLE_NODE_TYPE,
24986
+ props: {
24987
+ ...super.defaultState(nodeId).props,
24988
+ nodeType: WEAVE_RECTANGLE_NODE_TYPE,
24989
+ x: 0,
24990
+ y: 0,
24991
+ width: 100,
24992
+ height: 100,
24993
+ stroke: "#000000",
24994
+ fill: "#FFFFFF",
24995
+ strokeWidth: 1,
24996
+ strokeScaleEnabled: true,
24997
+ rotation: 0,
24998
+ zIndex: 1,
24999
+ children: []
25000
+ }
25001
+ };
25002
+ }
25003
+ static addNodeState(defaultNodeState, props) {
25004
+ return mergeExceptArrays(defaultNodeState, { props: {
25005
+ x: props.x,
25006
+ y: props.y,
25007
+ width: props.width,
25008
+ height: props.height,
25009
+ rotation: props.rotation,
25010
+ fill: props.fill,
25011
+ ...props.stroke && { stroke: props.stroke },
25012
+ ...props.strokeWidth && { strokeWidth: props.strokeWidth }
25013
+ } });
25014
+ }
25015
+ static updateNodeState(prevNodeState, nextProps) {
25016
+ return mergeExceptArrays(prevNodeState, { props: {
25017
+ x: nextProps.x,
25018
+ y: nextProps.y,
25019
+ width: nextProps.width,
25020
+ height: nextProps.height,
25021
+ rotation: nextProps.rotation,
25022
+ fill: nextProps.fill,
25023
+ ...nextProps.stroke && { stroke: nextProps.stroke },
25024
+ ...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
25025
+ } });
25026
+ }
25027
+ static getSchema() {
25028
+ const baseSchema = super.getSchema();
25029
+ const nodeSchema = baseSchema.extend({
25030
+ type: z.literal(WEAVE_RECTANGLE_NODE_TYPE).describe(`Type of the node, for a rectangle node it will always be "${WEAVE_RECTANGLE_NODE_TYPE}"`),
25031
+ props: baseSchema.shape.props.extend({
25032
+ nodeType: z.literal(WEAVE_RECTANGLE_NODE_TYPE).describe(`Type of the node, for a rectangle node it will always be "${WEAVE_RECTANGLE_NODE_TYPE}"`),
25033
+ width: z.number().describe("Width of the rectangle in pixels"),
25034
+ height: z.number().describe("Height of the rectangle in pixels"),
25035
+ fill: z.string().describe("Fill color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
25036
+ stroke: z.string().describe("Stroke color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
25037
+ strokeWidth: z.number().describe("Stroke width of the rectangle in pixels"),
25038
+ strokeScaleEnabled: z.boolean().describe("Whether the rectangle stroke width should scale when the node is scaled. Defaults to true.")
25039
+ })
25040
+ });
25041
+ return nodeSchema;
25042
+ }
24822
25043
  };
24823
25044
 
24824
25045
  //#endregion
@@ -24978,6 +25199,67 @@ var WeaveEllipseNode = class extends WeaveNode {
24978
25199
  node.x(node.x() + dx);
24979
25200
  node.y(node.y() + dy);
24980
25201
  }
25202
+ static defaultState(nodeId) {
25203
+ return {
25204
+ ...super.defaultState(nodeId),
25205
+ type: WEAVE_ELLIPSE_NODE_TYPE,
25206
+ props: {
25207
+ ...super.defaultState(nodeId).props,
25208
+ nodeType: WEAVE_ELLIPSE_NODE_TYPE,
25209
+ x: 0,
25210
+ y: 0,
25211
+ radiusX: 100,
25212
+ radiusY: 100,
25213
+ stroke: "#000000",
25214
+ fill: "#FFFFFF",
25215
+ strokeWidth: 1,
25216
+ strokeScaleEnabled: true,
25217
+ rotation: 0,
25218
+ zIndex: 1,
25219
+ children: []
25220
+ }
25221
+ };
25222
+ }
25223
+ static addNodeState(defaultNodeState, props) {
25224
+ return mergeExceptArrays(defaultNodeState, { props: {
25225
+ x: props.x,
25226
+ y: props.y,
25227
+ radiusX: props.radiusX,
25228
+ radiusY: props.radiusY,
25229
+ rotation: props.rotation,
25230
+ fill: props.fill,
25231
+ ...props.stroke && { stroke: props.stroke },
25232
+ ...props.strokeWidth && { strokeWidth: props.strokeWidth }
25233
+ } });
25234
+ }
25235
+ static updateNodeState(prevNodeState, nextProps) {
25236
+ return mergeExceptArrays(prevNodeState, { props: {
25237
+ x: nextProps.x,
25238
+ y: nextProps.y,
25239
+ radiusX: nextProps.radiusX,
25240
+ radiusY: nextProps.radiusY,
25241
+ rotation: nextProps.rotation,
25242
+ fill: nextProps.fill,
25243
+ ...nextProps.stroke && { stroke: nextProps.stroke },
25244
+ ...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
25245
+ } });
25246
+ }
25247
+ static getSchema() {
25248
+ const baseSchema = super.getSchema();
25249
+ const nodeSchema = baseSchema.extend({
25250
+ type: z.literal(WEAVE_ELLIPSE_NODE_TYPE).describe(`Type of the node, for a ellipse node it will always be "${WEAVE_ELLIPSE_NODE_TYPE}"`),
25251
+ props: baseSchema.shape.props.extend({
25252
+ nodeType: z.literal(WEAVE_ELLIPSE_NODE_TYPE).describe(`Type of the node, for a ellipse node it will always be "${WEAVE_ELLIPSE_NODE_TYPE}"`),
25253
+ radiusX: z.number().describe("Radius on the X axis of the ellipse in pixels"),
25254
+ radiusY: z.number().describe("Radius on the Y axis of the ellipse in pixels"),
25255
+ fill: z.string().describe("Fill color of the ellipse in hex format with alpha channel (e.g. #RRGGBBAA)"),
25256
+ stroke: z.string().describe("Stroke color of the ellipse in hex format with alpha channel (e.g. #RRGGBBAA)"),
25257
+ strokeWidth: z.number().describe("Stroke width of the ellipse in pixels"),
25258
+ strokeScaleEnabled: z.boolean().describe("Whether the ellipse stroke width should scale when the node is scaled. Defaults to true.")
25259
+ })
25260
+ });
25261
+ return nodeSchema;
25262
+ }
24981
25263
  };
24982
25264
 
24983
25265
  //#endregion
@@ -25350,7 +25632,8 @@ const WEAVE_TEXT_NODE_TYPE = "text";
25350
25632
  const WEAVE_STAGE_TEXT_EDITION_MODE = "text-edition";
25351
25633
  const WEAVE_TEXT_NODE_DEFAULT_CONFIG = {
25352
25634
  transform: { ...WEAVE_NODES_SELECTION_DEFAULT_CONFIG.selection },
25353
- outline: { enabled: false }
25635
+ outline: { enabled: false },
25636
+ cursor: { color: "#000000" }
25354
25637
  };
25355
25638
  const TEXT_LAYOUT = {
25356
25639
  ["SMART"]: "smart",
@@ -25684,6 +25967,7 @@ var WeaveTextNode = class extends WeaveNode {
25684
25967
  }
25685
25968
  mimicTextNode(textNode) {
25686
25969
  if (!this.textArea) return;
25970
+ this.textArea.style.caretColor = this.config.cursor.color;
25687
25971
  this.textArea.style.fontSize = textNode.fontSize() * textNode.getAbsoluteScale().x + "px";
25688
25972
  this.textArea.rows = textNode.text().split("\n").length;
25689
25973
  this.textArea.style.letterSpacing = `${textNode.letterSpacing()}`;
@@ -25692,7 +25976,9 @@ var WeaveTextNode = class extends WeaveNode {
25692
25976
  this.textArea.style.fontFamily = textNode.fontFamily();
25693
25977
  let fontWeight = "normal";
25694
25978
  let fontStyle = "normal";
25979
+ const matchNumber = textNode.fontStyle().match(/\d+/);
25695
25980
  if ((textNode.fontStyle() ?? "normal").indexOf("bold") !== -1) fontWeight = "bold";
25981
+ if (matchNumber) fontWeight = matchNumber[0].toString();
25696
25982
  if ((textNode.fontStyle() ?? "normal").indexOf("italic") !== -1) fontStyle = "italic";
25697
25983
  this.textArea.style.fontWeight = fontWeight;
25698
25984
  this.textArea.style.backgroundColor = "transparent";
@@ -25990,6 +26276,128 @@ var WeaveTextNode = class extends WeaveNode {
25990
26276
  textNode.width(textAreaWidth);
25991
26277
  this.instance.updateNode(this.serialize(textNode));
25992
26278
  }
26279
+ static defaultState(nodeId, params) {
26280
+ const config = (0, import_lodash.merge)({}, WEAVE_TEXT_NODE_DEFAULT_CONFIG, params?.config ?? {});
26281
+ return {
26282
+ ...super.defaultState(nodeId),
26283
+ type: WEAVE_TEXT_NODE_TYPE,
26284
+ props: {
26285
+ ...super.defaultState(nodeId).props,
26286
+ nodeType: "text",
26287
+ fontFamily: "Arial",
26288
+ fontSize: 32,
26289
+ fontStyle: "normal",
26290
+ fontVariant: "normal",
26291
+ textDecoration: "none",
26292
+ letterSpacing: 0,
26293
+ lineHeight: 1,
26294
+ align: "left",
26295
+ verticalAlign: "top",
26296
+ fill: "#000000ff",
26297
+ text: "This is a text node",
26298
+ layout: TEXT_LAYOUT.SMART,
26299
+ ...!config.outline.enabled && { strokeEnabled: false },
26300
+ ...config.outline.enabled && {
26301
+ strokeEnabled: true,
26302
+ stroke: config.outline.color,
26303
+ strokeWidth: config.outline.width,
26304
+ fillAfterStrokeEnabled: true
26305
+ }
26306
+ }
26307
+ };
26308
+ }
26309
+ static addNodeState(defaultNodeState, props) {
26310
+ return mergeExceptArrays(defaultNodeState, { props: {
26311
+ x: props.x,
26312
+ y: props.y,
26313
+ width: props.width,
26314
+ ...props.height && { height: props.height },
26315
+ FontFamily: props.fontFamily,
26316
+ fontSize: props.fontSize,
26317
+ fontStyle: props.fontStyle,
26318
+ fontVariant: props.fontVariant,
26319
+ textDecoration: props.textDecoration,
26320
+ letterSpacing: props.letterSpacing,
26321
+ lineHeight: props.lineHeight,
26322
+ align: props.align,
26323
+ verticalAlign: props.verticalAlign,
26324
+ rotation: props.rotation,
26325
+ fill: props.fill,
26326
+ text: props.text,
26327
+ layout: props.layout,
26328
+ ...props.strokeEnabled && { strokeEnabled: props.strokeEnabled },
26329
+ ...props.stroke && { stroke: props.stroke },
26330
+ ...props.strokeWidth && { strokeWidth: props.strokeWidth },
26331
+ ...props.fillAfterStrokeEnabled && { fillAfterStrokeEnabled: props.fillAfterStrokeEnabled }
26332
+ } });
26333
+ }
26334
+ static updateNodeState(prevNodeState, nextProps) {
26335
+ return mergeExceptArrays(prevNodeState, { props: {
26336
+ x: nextProps.x,
26337
+ y: nextProps.y,
26338
+ width: nextProps.width,
26339
+ ...nextProps.height && { height: nextProps.height },
26340
+ FontFamily: nextProps.fontFamily,
26341
+ fontSize: nextProps.fontSize,
26342
+ fontStyle: nextProps.fontStyle,
26343
+ fontVariant: nextProps.fontVariant,
26344
+ textDecoration: nextProps.textDecoration,
26345
+ letterSpacing: nextProps.letterSpacing,
26346
+ lineHeight: nextProps.lineHeight,
26347
+ align: nextProps.align,
26348
+ verticalAlign: nextProps.verticalAlign,
26349
+ rotation: nextProps.rotation,
26350
+ fill: nextProps.fill,
26351
+ text: nextProps.text,
26352
+ layout: nextProps.layout,
26353
+ ...nextProps.strokeEnabled && { strokeEnabled: nextProps.strokeEnabled },
26354
+ ...nextProps.stroke && { stroke: nextProps.stroke },
26355
+ ...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth },
26356
+ ...nextProps.fillAfterStrokeEnabled && { fillAfterStrokeEnabled: nextProps.fillAfterStrokeEnabled }
26357
+ } });
26358
+ }
26359
+ static getSchema() {
26360
+ const baseSchema = super.getSchema();
26361
+ const nodeSchema = baseSchema.extend({
26362
+ type: z.literal(WEAVE_TEXT_NODE_TYPE).describe(`Type of the node, for a text node it will always be "${WEAVE_TEXT_NODE_TYPE}"`),
26363
+ props: z.object({
26364
+ nodeType: z.literal(WEAVE_TEXT_NODE_TYPE).describe(`Type of the node, for a text node it will always be "${WEAVE_TEXT_NODE_TYPE}"`),
26365
+ width: z.number().describe("Width of the text in pixels"),
26366
+ height: z.number().optional().describe("Height of the text in pixels. Optional if layout is auto-height or smart."),
26367
+ fontFamily: z.string().default("Arial").describe("Font family of the text, e.g. Arial, Helvetica, etc."),
26368
+ fontSize: z.number().default(16).describe("Font size of the text in pixels."),
26369
+ 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\"."),
26370
+ fontVariant: z.enum(["normal", "small-caps"]).describe("Font variant of the text, can be \"normal\" or \"small-caps\"."),
26371
+ textDecoration: z.enum([
26372
+ "line-through",
26373
+ "underline",
26374
+ ""
26375
+ ]).default("").describe("Text decoration can be \"line-through\", \"underline\" or empty string for none."),
26376
+ letterSpacing: z.number().default(0).describe("Spacing between letters in pixels."),
26377
+ lineHeight: z.number().default(1).describe("Line height of the text, as a multiplier of font size."),
26378
+ align: z.enum([
26379
+ "left",
26380
+ "center",
26381
+ "right",
26382
+ "justify"
26383
+ ]).default("left").describe("Text alignment, can be \"left\", \"center\", \"right\" or \"justify\"."),
26384
+ verticalAlign: z.enum([
26385
+ "top",
26386
+ "middle",
26387
+ "bottom"
26388
+ ]).default("top").describe("Vertical alignment of the text, can be 'top', 'middle' or 'bottom'."),
26389
+ fill: z.string().default("#000000ff").describe("Fill color of the text in hex format with alpha channel (e.g. #RRGGBBAA)."),
26390
+ text: z.string().default("text").describe("The actual text content of the node."),
26391
+ strokeEnabled: z.boolean().default(false).describe("Whether the text outline is enabled."),
26392
+ stroke: z.string().optional().default("#d6d6d6").describe("Color of the text outline in hex format with alpha channel (e.g. #RRGGBBAA)."),
26393
+ strokeWidth: z.number().optional().default(2).describe("Width of the text outline in pixels."),
26394
+ strokeScaleEnabled: z.boolean().default(true).describe("Whether the stroke width should scale when the node is scaled."),
26395
+ 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."),
26396
+ 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.")
26397
+ })
26398
+ });
26399
+ return nodeSchema;
26400
+ }
25993
26401
  };
25994
26402
 
25995
26403
  //#endregion
@@ -27626,6 +28034,111 @@ var WeaveImageNode = class extends WeaveNode {
27626
28034
  this.getNodesSelectionPlugin()?.setSelectedNodes([image]);
27627
28035
  this.getNodesSelectionPlugin()?.getHoverTransformer().forceUpdate();
27628
28036
  }
28037
+ static defaultState(nodeId) {
28038
+ return {
28039
+ ...super.defaultState(nodeId),
28040
+ type: WEAVE_IMAGE_NODE_TYPE,
28041
+ props: {
28042
+ ...super.defaultState(nodeId).props,
28043
+ nodeType: WEAVE_IMAGE_NODE_TYPE,
28044
+ width: 800,
28045
+ height: 600,
28046
+ imageURL: "https://picsum.photos/id/10/800/600",
28047
+ adding: false,
28048
+ imageWidth: 800,
28049
+ imageHeight: 600,
28050
+ imageInfo: {
28051
+ width: 800,
28052
+ height: 600
28053
+ },
28054
+ uncroppedImage: {
28055
+ width: 800,
28056
+ height: 600
28057
+ },
28058
+ cropping: false,
28059
+ stroke: "#000000",
28060
+ fill: "#FFFFFF",
28061
+ strokeWidth: 0,
28062
+ strokeScaleEnabled: true,
28063
+ children: []
28064
+ }
28065
+ };
28066
+ }
28067
+ static addNodeState(defaultNodeState, props) {
28068
+ return mergeExceptArrays(defaultNodeState, { props: {
28069
+ x: props.x,
28070
+ y: props.y,
28071
+ width: props.width,
28072
+ height: props.height,
28073
+ rotation: props.rotation,
28074
+ imageURL: props.imageURL,
28075
+ ...props.imageFallback && { imageFallback: props.imageFallback },
28076
+ ...props.imageId && { imageId: props.imageId },
28077
+ adding: props.adding,
28078
+ imageWidth: props.imageWidth,
28079
+ imageHeight: props.imageHeight,
28080
+ imageInfo: {
28081
+ width: props.imageInfo.width,
28082
+ height: props.imageInfo.height
28083
+ },
28084
+ uncroppedImage: {
28085
+ width: props.uncroppedImage.width,
28086
+ height: props.uncroppedImage.height
28087
+ },
28088
+ cropping: props.cropping
28089
+ } });
28090
+ }
28091
+ static updateNodeState(prevNodeState, nextProps) {
28092
+ return mergeExceptArrays(prevNodeState, { props: {
28093
+ x: nextProps.x,
28094
+ y: nextProps.y,
28095
+ width: nextProps.width,
28096
+ height: nextProps.height,
28097
+ rotation: nextProps.rotation,
28098
+ imageURL: nextProps.imageURL,
28099
+ ...nextProps.imageFallback && { imageFallback: nextProps.imageFallback },
28100
+ ...nextProps.imageId && { imageId: nextProps.imageId },
28101
+ adding: nextProps.adding,
28102
+ imageWidth: nextProps.imageWidth,
28103
+ imageHeight: nextProps.imageHeight,
28104
+ ...nextProps.imageInfo && { imageInfo: {
28105
+ width: nextProps.imageInfo.width,
28106
+ height: nextProps.imageInfo.height
28107
+ } },
28108
+ ...nextProps.uncroppedImage && { uncroppedImage: {
28109
+ width: nextProps.uncroppedImage?.width,
28110
+ height: nextProps.uncroppedImage?.height
28111
+ } },
28112
+ cropping: nextProps.cropping
28113
+ } });
28114
+ }
28115
+ static getSchema() {
28116
+ const baseSchema = super.getSchema();
28117
+ const nodeSchema = baseSchema.extend({
28118
+ type: z.literal(WEAVE_IMAGE_NODE_TYPE).describe(`Type of the node, for a image node it will always be "${WEAVE_IMAGE_NODE_TYPE}"`),
28119
+ props: baseSchema.shape.props.extend({
28120
+ nodeType: z.literal("image").describe(`Type of the node, for a image node it will always be "${WEAVE_IMAGE_NODE_TYPE}"`),
28121
+ width: z.number().describe("Width of the image in pixels"),
28122
+ height: z.number().describe("Height of the image in pixels"),
28123
+ imageURL: z.string().describe("The URL of the image to be rendered by the node"),
28124
+ 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}"),
28125
+ adding: z.boolean().default(false),
28126
+ imageId: z.string().optional().describe("The id of the image, used for external management of the node."),
28127
+ imageWidth: z.number().describe("The width of the image in pixels"),
28128
+ imageHeight: z.number().describe("The height of the image in pixels"),
28129
+ imageInfo: z.object({
28130
+ width: z.number().describe("The original width of the image in pixels"),
28131
+ height: z.number().describe("The original height of the image in pixels")
28132
+ }),
28133
+ uncroppedImage: z.object({
28134
+ width: z.number().describe("The width of the image before cropping, used for cropping calculations"),
28135
+ height: z.number().describe("The height of the image before cropping, used for cropping calculations")
28136
+ }),
28137
+ cropping: z.boolean().default(false).describe("Whether the image is currently being cropped")
28138
+ })
28139
+ });
28140
+ return nodeSchema;
28141
+ }
27629
28142
  };
27630
28143
 
27631
28144
  //#endregion
@@ -27797,6 +28310,71 @@ var WeaveStarNode = class extends WeaveNode {
27797
28310
  y: element.props.outerRadius
27798
28311
  };
27799
28312
  }
28313
+ static defaultState(nodeId) {
28314
+ return {
28315
+ ...super.defaultState(nodeId),
28316
+ type: WEAVE_STAR_NODE_TYPE,
28317
+ props: {
28318
+ ...super.defaultState(nodeId).props,
28319
+ nodeType: WEAVE_STAR_NODE_TYPE,
28320
+ x: 0,
28321
+ y: 0,
28322
+ numPoints: 5,
28323
+ innerRadius: 50,
28324
+ outerRadius: 100,
28325
+ stroke: "#000000",
28326
+ fill: "#FFFFFF",
28327
+ strokeWidth: 1,
28328
+ strokeScaleEnabled: true,
28329
+ rotation: 0,
28330
+ zIndex: 1,
28331
+ children: []
28332
+ }
28333
+ };
28334
+ }
28335
+ static addNodeState(defaultNodeState, props) {
28336
+ return mergeExceptArrays(defaultNodeState, { props: {
28337
+ x: props.x,
28338
+ y: props.y,
28339
+ numPoints: props.numPoints,
28340
+ innerRadius: props.innerRadius,
28341
+ outerRadius: props.outerRadius,
28342
+ rotation: props.rotation,
28343
+ fill: props.fill,
28344
+ ...props.stroke && { stroke: props.stroke },
28345
+ ...props.strokeWidth && { strokeWidth: props.strokeWidth }
28346
+ } });
28347
+ }
28348
+ static updateNodeState(prevNodeState, nextProps) {
28349
+ return mergeExceptArrays(prevNodeState, { props: {
28350
+ x: nextProps.x,
28351
+ y: nextProps.y,
28352
+ numPoints: nextProps.numPoints,
28353
+ innerRadius: nextProps.innerRadius,
28354
+ outerRadius: nextProps.outerRadius,
28355
+ rotation: nextProps.rotation,
28356
+ fill: nextProps.fill,
28357
+ ...nextProps.stroke && { stroke: nextProps.stroke },
28358
+ ...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
28359
+ } });
28360
+ }
28361
+ static getSchema() {
28362
+ const baseSchema = super.getSchema();
28363
+ const nodeSchema = baseSchema.extend({
28364
+ type: z.literal(WEAVE_STAR_NODE_TYPE).describe(`Type of the node, for a start node it will always be "${WEAVE_STAR_NODE_TYPE}"`),
28365
+ props: baseSchema.shape.props.extend({
28366
+ nodeType: z.literal(WEAVE_STAR_NODE_TYPE).describe(`Type of the node, for a rectangle node it will always be "${WEAVE_STAR_NODE_TYPE}"`),
28367
+ numPoints: z.number().describe("Number of points of the star, must be greater than or equal to 3"),
28368
+ innerRadius: z.number().describe("Inner radius of the star, must be greater than or equal to 0"),
28369
+ outerRadius: z.number().describe("Outer radius of the star, must be greater than or equal to 0"),
28370
+ fill: z.string().describe("Fill color of the star in hex format with alpha channel (e.g. #RRGGBBAA)"),
28371
+ stroke: z.string().describe("Stroke color of the star in hex format with alpha channel (e.g. #RRGGBBAA)"),
28372
+ strokeWidth: z.number().describe("Stroke width of the star in pixels"),
28373
+ strokeScaleEnabled: z.boolean().describe("Whether the star stroke width should scale when the node is scaled. Defaults to true.")
28374
+ })
28375
+ });
28376
+ return nodeSchema;
28377
+ }
27800
28378
  };
27801
28379
 
27802
28380
  //#endregion
@@ -28012,6 +28590,67 @@ var WeaveRegularPolygonNode = class extends WeaveNode {
28012
28590
  y: element.props.radius
28013
28591
  };
28014
28592
  }
28593
+ static defaultState(nodeId) {
28594
+ return {
28595
+ ...super.defaultState(nodeId),
28596
+ type: WEAVE_REGULAR_POLYGON_NODE_TYPE,
28597
+ props: {
28598
+ ...super.defaultState(nodeId).props,
28599
+ nodeType: WEAVE_REGULAR_POLYGON_NODE_TYPE,
28600
+ x: 0,
28601
+ y: 0,
28602
+ sides: 5,
28603
+ radius: 100,
28604
+ stroke: "#000000",
28605
+ fill: "#FFFFFF",
28606
+ strokeWidth: 1,
28607
+ strokeScaleEnabled: true,
28608
+ rotation: 0,
28609
+ zIndex: 1,
28610
+ children: []
28611
+ }
28612
+ };
28613
+ }
28614
+ static addNodeState(defaultNodeState, props) {
28615
+ return mergeExceptArrays(defaultNodeState, { props: {
28616
+ x: props.x,
28617
+ y: props.y,
28618
+ sides: props.sides,
28619
+ radius: props.radius,
28620
+ rotation: props.rotation,
28621
+ fill: props.fill,
28622
+ ...props.stroke && { stroke: props.stroke },
28623
+ ...props.strokeWidth && { strokeWidth: props.strokeWidth }
28624
+ } });
28625
+ }
28626
+ static updateNodeState(prevNodeState, nextProps) {
28627
+ return mergeExceptArrays(prevNodeState, { props: {
28628
+ x: nextProps.x,
28629
+ y: nextProps.y,
28630
+ sides: nextProps.sides,
28631
+ radius: nextProps.radius,
28632
+ rotation: nextProps.rotation,
28633
+ fill: nextProps.fill,
28634
+ ...nextProps.stroke && { stroke: nextProps.stroke },
28635
+ ...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
28636
+ } });
28637
+ }
28638
+ static getSchema() {
28639
+ const baseSchema = super.getSchema();
28640
+ const nodeSchema = baseSchema.extend({
28641
+ 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}"`),
28642
+ props: baseSchema.shape.props.extend({
28643
+ 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}"`),
28644
+ sides: z.number().describe("Number of sides of the regular polygon, must be 3 or more"),
28645
+ radius: z.number().describe("Radius of the regular polygon in pixels, distance from the center to any vertex"),
28646
+ fill: z.string().describe("Fill color of the regular polygon in hex format with alpha channel (e.g. #RRGGBBAA)"),
28647
+ stroke: z.string().describe("Stroke color of the regular polygon in hex format with alpha channel (e.g. #RRGGBBAA)"),
28648
+ strokeWidth: z.number().describe("Stroke width of the regular polygon in pixels"),
28649
+ strokeScaleEnabled: z.boolean().describe("Whether the regular polygon stroke width should scale when the node is scaled. Defaults to true.")
28650
+ })
28651
+ });
28652
+ return nodeSchema;
28653
+ }
28015
28654
  };
28016
28655
 
28017
28656
  //#endregion
@@ -28223,6 +28862,7 @@ var WeaveFrameNode = class extends WeaveNode {
28223
28862
  strokeWidth: 0,
28224
28863
  fill: "transparent",
28225
28864
  nodeId: id,
28865
+ nodeType: void 0,
28226
28866
  id: `${id}-selection-area`,
28227
28867
  listening: true,
28228
28868
  draggable: true,
@@ -28379,6 +29019,77 @@ var WeaveFrameNode = class extends WeaveNode {
28379
29019
  };
28380
29020
  }
28381
29021
  scaleReset() {}
29022
+ static defaultState(nodeId) {
29023
+ return {
29024
+ ...super.defaultState(nodeId),
29025
+ type: WEAVE_FRAME_NODE_TYPE,
29026
+ props: {
29027
+ ...super.defaultState(nodeId).props,
29028
+ nodeType: WEAVE_FRAME_NODE_TYPE,
29029
+ x: 0,
29030
+ y: 0,
29031
+ width: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameWidth,
29032
+ height: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameHeight,
29033
+ title: WEAVE_FRAME_NODE_DEFAULT_PROPS.title,
29034
+ frameWidth: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameWidth,
29035
+ frameHeight: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameHeight,
29036
+ frameBackground: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameBackground,
29037
+ borderWidth: WEAVE_FRAME_NODE_DEFAULT_CONFIG.borderWidth,
29038
+ borderColor: WEAVE_FRAME_NODE_DEFAULT_CONFIG.borderColor,
29039
+ stroke: "transparent",
29040
+ strokeWidth: 0,
29041
+ strokeScaleEnabled: true,
29042
+ rotation: 0,
29043
+ zIndex: 1,
29044
+ children: []
29045
+ }
29046
+ };
29047
+ }
29048
+ static addNodeState(defaultNodeState, props) {
29049
+ return mergeExceptArrays(defaultNodeState, { props: {
29050
+ x: props.x,
29051
+ y: props.y,
29052
+ width: props.width,
29053
+ height: props.height,
29054
+ ...props.title && { stroke: props.title },
29055
+ frameWidth: props.frameWidth,
29056
+ frameHeight: props.frameHeight,
29057
+ ...props.frameBackground && { stroke: props.frameBackground },
29058
+ rotation: props.rotation,
29059
+ ...props.borderColor && { borderColor: props.borderColor },
29060
+ ...props.borderWidth && { borderWidth: props.borderWidth }
29061
+ } });
29062
+ }
29063
+ static updateNodeState(prevNodeState, nextProps) {
29064
+ return mergeExceptArrays(prevNodeState, { props: {
29065
+ x: nextProps.x,
29066
+ y: nextProps.y,
29067
+ width: nextProps.width,
29068
+ height: nextProps.height,
29069
+ rotation: nextProps.rotation,
29070
+ title: nextProps.title,
29071
+ ...nextProps.frameBackground && { frameBackground: nextProps.frameBackground },
29072
+ ...nextProps.borderColor && { stroke: nextProps.borderColor },
29073
+ ...nextProps.borderWidth && { strokeWidth: nextProps.borderWidth }
29074
+ } });
29075
+ }
29076
+ static getSchema() {
29077
+ const baseSchema = super.getSchema();
29078
+ const nodeSchema = baseSchema.extend({
29079
+ type: z.literal(WEAVE_FRAME_NODE_TYPE).describe(`Type of the node, for a frame node it will always be "${WEAVE_FRAME_NODE_TYPE}"`),
29080
+ props: baseSchema.shape.props.extend({
29081
+ nodeType: z.literal(WEAVE_FRAME_NODE_TYPE).describe(`Type of the node, for a frame node it will always be "${WEAVE_FRAME_NODE_TYPE}"`),
29082
+ borderColor: z.string().default("#000000ff").describe("Border color of the frame in hex format with alpha channel (e.g. #RRGGBBAA)"),
29083
+ borderWidth: z.number().default(1).describe("Border width of the frame in hex format with alpha channel (e.g. #RRGGBBAA)"),
29084
+ title: z.string().default("Frame").describe("Title of the frame"),
29085
+ frameWidth: z.number().describe("Width of the frame in pixels"),
29086
+ frameHeight: z.number().describe("Height of the frame in pixels"),
29087
+ frameBackground: z.string().default(WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR).describe("Background color of the frame in hex format with alpha channel (e.g. #RRGGBBAA)"),
29088
+ children: z.array(z.any()).default([])
29089
+ })
29090
+ });
29091
+ return nodeSchema;
29092
+ }
28382
29093
  };
28383
29094
 
28384
29095
  //#endregion
@@ -28996,6 +29707,7 @@ var WeaveStrokeSingleNode = class extends WeaveNode {
28996
29707
  this.shiftPressed = false;
28997
29708
  }
28998
29709
  initEvents() {
29710
+ if (this.instance.isServerSide()) return;
28999
29711
  if (this.eventsInitialized) return;
29000
29712
  window.addEventListener("keydown", (e) => {
29001
29713
  if (e.key === "Shift") this.shiftPressed = true;
@@ -29347,6 +30059,70 @@ var WeaveStrokeSingleNode = class extends WeaveNode {
29347
30059
  }
29348
30060
  return pos;
29349
30061
  }
30062
+ static defaultState(nodeId) {
30063
+ return {
30064
+ ...super.defaultState(nodeId),
30065
+ type: WEAVE_STROKE_SINGLE_NODE_TYPE,
30066
+ props: {
30067
+ ...super.defaultState(nodeId).props,
30068
+ nodeType: WEAVE_STROKE_SINGLE_NODE_TYPE,
30069
+ x: 0,
30070
+ y: 0,
30071
+ strokeElements: [
30072
+ 0,
30073
+ 0,
30074
+ 100,
30075
+ 100
30076
+ ],
30077
+ stroke: "#000000",
30078
+ fill: "#FFFFFF",
30079
+ strokeWidth: 1,
30080
+ strokeScaleEnabled: true,
30081
+ rotation: 0,
30082
+ zIndex: 1,
30083
+ children: []
30084
+ }
30085
+ };
30086
+ }
30087
+ static addNodeState(defaultNodeState, props) {
30088
+ return mergeExceptArrays(defaultNodeState, { props: {
30089
+ x: props.x,
30090
+ y: props.y,
30091
+ strokeElements: props.strokeElements,
30092
+ rotation: props.rotation,
30093
+ fill: props.fill,
30094
+ ...props.stroke && { stroke: props.stroke },
30095
+ ...props.strokeWidth && { strokeWidth: props.strokeWidth }
30096
+ } });
30097
+ }
30098
+ static updateNodeState(prevNodeState, nextProps) {
30099
+ return mergeExceptArrays(prevNodeState, { props: {
30100
+ x: nextProps.x,
30101
+ y: nextProps.y,
30102
+ strokeElements: nextProps.strokeElements,
30103
+ rotation: nextProps.rotation,
30104
+ fill: nextProps.fill,
30105
+ ...nextProps.stroke && { stroke: nextProps.stroke },
30106
+ ...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
30107
+ } });
30108
+ }
30109
+ static getSchema() {
30110
+ const baseSchema = super.getSchema();
30111
+ const nodeSchema = baseSchema.extend({
30112
+ 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}"`),
30113
+ props: baseSchema.shape.props.extend({
30114
+ 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}"`),
30115
+ 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]"),
30116
+ 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".`),
30117
+ 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".`),
30118
+ fill: z.string().describe("Fill color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
30119
+ stroke: z.string().describe("Stroke color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
30120
+ strokeWidth: z.number().describe("Stroke width of the rectangle in pixels"),
30121
+ strokeScaleEnabled: z.boolean().describe("Whether the rectangle stroke width should scale when the node is scaled. Defaults to true.")
30122
+ })
30123
+ });
30124
+ return nodeSchema;
30125
+ }
29350
30126
  };
29351
30127
 
29352
30128
  //#endregion
@@ -39747,7 +40523,6 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
39747
40523
  if (this.initialized) return;
39748
40524
  const container = this.config.getContainer();
39749
40525
  if (!container) return;
39750
- console.log("setup minimap");
39751
40526
  let preview = document.getElementById(this.config.id);
39752
40527
  const windowAspectRatio = window.innerWidth / window.innerHeight;
39753
40528
  if (!preview) {
@@ -39768,7 +40543,6 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
39768
40543
  this.initialized = true;
39769
40544
  this.minimapLayer = new Konva.Layer();
39770
40545
  this.minimapStage.add(this.minimapLayer);
39771
- console.log("aqui?");
39772
40546
  this.minimapViewportReference = new Konva.Rect({
39773
40547
  ...this.config.style.viewportReference,
39774
40548
  id: "minimapViewportReference",
@@ -39780,10 +40554,8 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
39780
40554
  }
39781
40555
  const stage = this.instance.getStage();
39782
40556
  stage.on("dragmove wheel dragend scaleXChange scaleYChange xChange yChange", () => {
39783
- console.log("update minimap viewport");
39784
40557
  this.updateMinimapViewportReference();
39785
40558
  });
39786
- console.log("aqui initialized");
39787
40559
  }
39788
40560
  async updateMinimapContent() {
39789
40561
  const stage = this.instance.getStage();
@@ -39848,9 +40620,7 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
39848
40620
  this.setupMinimap();
39849
40621
  }
39850
40622
  onInit() {
39851
- console.log("init minimap");
39852
40623
  const throttledUpdateMinimap = (0, import_lodash.throttle)(async () => {
39853
- console.log("throttle update minimap");
39854
40624
  await this.updateMinimapContent();
39855
40625
  this.updateMinimapViewportReference();
39856
40626
  }, DEFAULT_THROTTLE_MS);
@@ -42978,4 +43748,4 @@ function getJSONFromYjsBinary(actualState) {
42978
43748
  }
42979
43749
 
42980
43750
  //#endregion
42981
- 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, weavejsToYjsBinary };
43751
+ 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, weavejsToYjsBinary };