@inditextech/weave-sdk 4.0.1 → 4.2.0-SNAPSHOT.307.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sdk.js CHANGED
@@ -2,8 +2,11 @@ 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";
9
+ import simplify from "simplify-js";
7
10
  import "konva/lib/types";
8
11
  import "konva/lib/Stage";
9
12
 
@@ -15196,7 +15199,7 @@ var import_lodash = __toESM(require_lodash(), 1);
15196
15199
 
15197
15200
  //#endregion
15198
15201
  //#region src/yjs.ts
15199
- var yjs_default = Y$1;
15202
+ var yjs_default = Y$2;
15200
15203
 
15201
15204
  //#endregion
15202
15205
  //#region src/stores/default-initial-state.ts
@@ -15275,6 +15278,7 @@ var WeaveStore = class {
15275
15278
  return this.document;
15276
15279
  }
15277
15280
  restartDocument() {
15281
+ this.document?.destroy();
15278
15282
  this.latestState = {
15279
15283
  weave: {},
15280
15284
  weaveMetadata: {}
@@ -18951,10 +18955,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18951
18955
  });
18952
18956
  tr.on("mouseover", () => {
18953
18957
  const nodesSelected = tr.nodes();
18954
- if (nodesSelected.length === 1) {
18955
- const node = nodesSelected[0];
18956
- stage.container().style.cursor = (typeof node?.defineMousePointer === "function" ? node.defineMousePointer() : null) ?? "grab";
18957
- } else stage.container().style.cursor = "grab";
18958
+ if (nodesSelected.length > 1) stage.container().style.cursor = "grab";
18958
18959
  });
18959
18960
  tr.on("mouseout", (e) => {
18960
18961
  this.instance.getStage().handleMouseover?.(e);
@@ -20912,16 +20913,16 @@ var WeaveNode = class {
20912
20913
  if ([MOVE_TOOL_ACTION_NAME].includes(activeAction ?? "")) return false;
20913
20914
  let showHover = false;
20914
20915
  let cancelBubble = false;
20915
- if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && (isLocked || isMutexLocked)) {
20916
+ if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && node.hasName("node") && (isLocked || isMutexLocked)) {
20916
20917
  stage.container().style.cursor = "default";
20917
20918
  cancelBubble = true;
20918
20919
  }
20919
- if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && isTargetable && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
20920
+ if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && isTargetable && node.hasName("node") && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
20920
20921
  showHover = true;
20921
20922
  stage.container().style.cursor = (typeof node?.defineMousePointer === "function" ? node.defineMousePointer() : null) ?? "pointer";
20922
20923
  cancelBubble = true;
20923
20924
  }
20924
- if (isNodeSelectionEnabled && this.isSelecting() && this.isNodeSelected(realNode) && !this.isPasting() && isTargetable && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
20925
+ if (isNodeSelectionEnabled && this.isSelecting() && this.isNodeSelected(realNode) && !this.isPasting() && node.hasName("node") && isTargetable && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
20925
20926
  showHover = true;
20926
20927
  stage.container().style.cursor = (typeof node?.defineMousePointer === "function" ? node.defineMousePointer() : null) ?? "grab";
20927
20928
  cancelBubble = true;
@@ -21076,6 +21077,48 @@ var WeaveNode = class {
21076
21077
  getIsAsync() {
21077
21078
  return false;
21078
21079
  }
21080
+ static defaultState(nodeId) {
21081
+ return {
21082
+ key: nodeId,
21083
+ type: "unknown",
21084
+ props: {
21085
+ id: nodeId,
21086
+ nodeType: "unknown",
21087
+ x: 0,
21088
+ y: 0,
21089
+ width: 100,
21090
+ height: 100,
21091
+ rotation: 0,
21092
+ scaleX: 1,
21093
+ scaleY: 1,
21094
+ opacity: 1,
21095
+ zIndex: 1,
21096
+ children: []
21097
+ }
21098
+ };
21099
+ }
21100
+ static getSchema() {
21101
+ const baseNodeSchema = z.object({
21102
+ key: z.string().describe("Unique identifier (uuid) for the node, generate one it if not provided"),
21103
+ type: z.string().describe("Type of the node, must be always provided"),
21104
+ props: z.object({
21105
+ id: z.string().describe("Unique identifier (uuid) for the node instance, is the same as key"),
21106
+ nodeType: z.string().describe("Type of the node, must be always provided"),
21107
+ x: z.number().describe("X position of the node, relative to the parent container"),
21108
+ y: z.number().describe("Y position of the node, relative to the parent container"),
21109
+ width: z.number().describe("Width of the node in pixels"),
21110
+ height: z.number().describe("Height of the node in pixels"),
21111
+ scaleX: z.number().describe("Scale factor on the X axis, default is 1"),
21112
+ scaleY: z.number().describe("Scale factor on the Y axis, default is 1"),
21113
+ rotation: z.number().optional().describe("Rotation of the node in degrees, default is 0"),
21114
+ skewX: z.number().optional().describe("Skew on the X axis in degrees, default is 0"),
21115
+ skewY: z.number().optional().describe("Skew on the Y axis in degrees, default is 0"),
21116
+ opacity: z.number().describe("Opacity of the node, between 0 and 1, default is 1"),
21117
+ children: z.array(z.any()).length(0).describe("Children nodes, always be an empty array for leaf nodes")
21118
+ })
21119
+ });
21120
+ return baseNodeSchema;
21121
+ }
21079
21122
  };
21080
21123
 
21081
21124
  //#endregion
@@ -22187,7 +22230,7 @@ var WeaveRegisterManager = class {
22187
22230
 
22188
22231
  //#endregion
22189
22232
  //#region package.json
22190
- var version = "4.0.1";
22233
+ var version = "4.2.0-SNAPSHOT.307.1";
22191
22234
 
22192
22235
  //#endregion
22193
22236
  //#region src/managers/setup.ts
@@ -23411,6 +23454,9 @@ var WeaveHooksManager = class {
23411
23454
  unregisterHook(hookName) {
23412
23455
  this.registeredHooks.delete(hookName);
23413
23456
  }
23457
+ reset() {
23458
+ this.registeredHooks.clear();
23459
+ }
23414
23460
  };
23415
23461
 
23416
23462
  //#endregion
@@ -23605,8 +23651,13 @@ var Weave = class {
23605
23651
  const nodeHandler = nodeHandlers[nodeHandlerKey];
23606
23652
  nodeHandler?.onDestroyInstance();
23607
23653
  }
23654
+ const mainLayer = this.stageManager.getMainLayer();
23655
+ if (mainLayer) mainLayer.destroy();
23608
23656
  const stage = this.getStage();
23609
- if (stage) stage.destroy();
23657
+ if (stage) {
23658
+ console.log("remove stage");
23659
+ stage.destroy();
23660
+ }
23610
23661
  if (this.eventsController) this.eventsController.abort();
23611
23662
  if (!this.isServerSide()) this.eventsController = new AbortController();
23612
23663
  this.registerManager.reset();
@@ -23619,6 +23670,8 @@ var Weave = class {
23619
23670
  this.status = WEAVE_INSTANCE_STATUS.STARTING;
23620
23671
  this.emitEvent("onInstanceStatus", this.status);
23621
23672
  this.registerManager.reset();
23673
+ this.hooks.removeAllHooks();
23674
+ this.hooksManager.reset();
23622
23675
  this.status = WEAVE_INSTANCE_STATUS.LOADING_FONTS;
23623
23676
  this.emitEvent("onInstanceStatus", this.status);
23624
23677
  await this.fontsManager.loadFonts();
@@ -23636,6 +23689,7 @@ var Weave = class {
23636
23689
  this.emitEvent("onInstanceStatus", this.status);
23637
23690
  const store = this.storeManager.getStore();
23638
23691
  store.disconnect();
23692
+ store.getDocument()?.destroy();
23639
23693
  const nodeHandlers = this.registerManager.getNodesHandlers();
23640
23694
  for (const nodeHandlerKey of Object.keys(nodeHandlers)) {
23641
23695
  const nodeHandler = nodeHandlers[nodeHandlerKey];
@@ -24402,6 +24456,114 @@ const downscaleImageFromURL = (url, options) => {
24402
24456
  });
24403
24457
  };
24404
24458
 
24459
+ //#endregion
24460
+ //#region src/state.manipulation.ts
24461
+ var WeaveStateManipulation = class WeaveStateManipulation {
24462
+ static mapPropsToYjs(props) {
24463
+ const propsMap = new Y$1.Map();
24464
+ for (const propKey of Object.keys(props)) {
24465
+ const propValue = props[propKey];
24466
+ if (Array.isArray(propValue)) {
24467
+ const childrenArray = new Y$1.Array();
24468
+ propValue.forEach((child) => {
24469
+ const childMap = WeaveStateManipulation.mapPropsToYjs(child);
24470
+ childrenArray.push([childMap]);
24471
+ });
24472
+ } else if (typeof propValue === "object" && propValue !== null && !Array.isArray(propValue)) propsMap.set(propKey, WeaveStateManipulation.mapPropsToYjs(propValue));
24473
+ else propsMap.set(propKey, propValue);
24474
+ }
24475
+ return propsMap;
24476
+ }
24477
+ static mapNodeToYjs(node) {
24478
+ const nodeId = node.key;
24479
+ const element = new Y$1.Map();
24480
+ const elementProps = new Y$1.Map();
24481
+ element.set("key", nodeId);
24482
+ element.set("type", node.type);
24483
+ element.set("props", elementProps);
24484
+ for (const propKey of Object.keys(node.props)) {
24485
+ const propValue = node.props[propKey];
24486
+ if (Array.isArray(propValue) && propKey === "children") {
24487
+ const childrenArray = new Y$1.Array();
24488
+ propValue.forEach((child) => {
24489
+ const childMap = WeaveStateManipulation.mapNodeToYjs(child);
24490
+ childrenArray.push([childMap.element]);
24491
+ });
24492
+ elementProps.set(propKey, childrenArray);
24493
+ } else if (Array.isArray(propValue) && propKey !== "children") {
24494
+ const childrenArray = new Y$1.Array();
24495
+ propValue.forEach((child) => {
24496
+ const childMap = WeaveStateManipulation.mapPropsToYjs(child);
24497
+ childrenArray.push([childMap]);
24498
+ });
24499
+ elementProps.set(propKey, childrenArray);
24500
+ } else if (typeof propValue === "object" && propValue !== null && !Array.isArray(propValue)) {
24501
+ const childrenMap = WeaveStateManipulation.mapPropsToYjs(propValue);
24502
+ elementProps.set(propKey, childrenMap);
24503
+ } else elementProps.set(propKey, propValue);
24504
+ }
24505
+ return {
24506
+ nodeId: node.key,
24507
+ element
24508
+ };
24509
+ }
24510
+ static addElements(layerYjsElement, yjsElements) {
24511
+ layerYjsElement.get("props").get("children").push(yjsElements);
24512
+ }
24513
+ static updateElements(layerYjsElement, yjsElements) {
24514
+ for (let i = 0; i < yjsElements.length; i++) {
24515
+ const yjsElement = yjsElements[i];
24516
+ const nodeId = yjsElement.nodeId;
24517
+ const element = yjsElement.element;
24518
+ const childrenArr = JSON.parse(JSON.stringify(layerYjsElement.get("props").get("children")));
24519
+ const index = childrenArr.findIndex((child) => child["key"] === nodeId);
24520
+ if (index !== -1) {
24521
+ layerYjsElement.get("props").get("children").delete(index);
24522
+ layerYjsElement.get("props").get("children").insert(index, [element]);
24523
+ }
24524
+ }
24525
+ }
24526
+ static deleteElements(layerYjsElement, yjsElementsIds) {
24527
+ for (let i = 0; i < yjsElementsIds.length; i++) {
24528
+ const yjsElementId = yjsElementsIds[i];
24529
+ const childrenArr = JSON.parse(JSON.stringify(layerYjsElement.get("props").get("children")));
24530
+ const index = childrenArr.findIndex((child) => child["key"] === yjsElementId);
24531
+ if (index !== -1) layerYjsElement.get("props").get("children").delete(index);
24532
+ }
24533
+ }
24534
+ static getYjsElement(doc, nodeId) {
24535
+ const stage = doc.getMap("weave");
24536
+ const stageProps = stage.get("props");
24537
+ const stageChildren = stageProps.get("children");
24538
+ for (let i = 0; i < stageChildren.length; i++) {
24539
+ const child = stageChildren.get(i);
24540
+ const childProps = child.get("props");
24541
+ if (childProps.get("id") === nodeId) return child;
24542
+ if (childProps.get("children")) {
24543
+ const childChildren = childProps.get("children");
24544
+ for (let j = 0; j < childChildren.length; j++) {
24545
+ const grandChild = childChildren.get(j);
24546
+ const grandChildProps = grandChild.get("props");
24547
+ if (grandChildProps.get("id") === nodeId) return grandChild;
24548
+ }
24549
+ }
24550
+ }
24551
+ return null;
24552
+ }
24553
+ static getNodesBoundingBox(nodes) {
24554
+ const minX = Math.min(...nodes.map((n) => n.props.x));
24555
+ const minY = Math.min(...nodes.map((n) => n.props.y));
24556
+ const maxX = Math.max(...nodes.map((n) => n.props.x + n.props.width));
24557
+ const maxY = Math.max(...nodes.map((n) => n.props.y + n.props.height));
24558
+ return {
24559
+ x: minX,
24560
+ y: minY,
24561
+ width: maxX - minX,
24562
+ height: maxY - minY
24563
+ };
24564
+ }
24565
+ };
24566
+
24405
24567
  //#endregion
24406
24568
  //#region src/internal-utils/upscale.ts
24407
24569
  const setupUpscaleStage = (instance, stage) => {
@@ -24518,10 +24680,11 @@ var WeaveStageNode = class extends WeaveNode {
24518
24680
  const activeAction = this.instance.getActiveAction();
24519
24681
  if ([MOVE_TOOL_ACTION_NAME].includes(activeAction ?? "")) return;
24520
24682
  if (e.target !== stage && !e.target.getAttrs().nodeId) return;
24521
- const parent = e.target.getParent();
24683
+ let parent = e.target.getParent();
24522
24684
  if (parent && parent instanceof Konva.Transformer) return;
24523
24685
  this.hideHoverState();
24524
- if (!this.instance.isServerSide()) stage.container().style.cursor = "default";
24686
+ if (e.target.getAttrs().nodeId) parent = stage.findOne(`#${e.target.getAttrs().nodeId}`);
24687
+ if (!this.instance.isServerSide() && !parent?.hasName("node")) stage.container().style.cursor = "default";
24525
24688
  });
24526
24689
  this.setupEvents();
24527
24690
  return stage;
@@ -24803,6 +24966,65 @@ var WeaveRectangleNode = class extends WeaveNode {
24803
24966
  const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
24804
24967
  if (nodesSelectionPlugin) nodesSelectionPlugin.getTransformer().forceUpdate();
24805
24968
  }
24969
+ static defaultState(nodeId) {
24970
+ return {
24971
+ ...super.defaultState(nodeId),
24972
+ type: WEAVE_RECTANGLE_NODE_TYPE,
24973
+ props: {
24974
+ ...super.defaultState(nodeId).props,
24975
+ nodeType: WEAVE_RECTANGLE_NODE_TYPE,
24976
+ x: 0,
24977
+ y: 0,
24978
+ width: 100,
24979
+ height: 100,
24980
+ stroke: "#000000",
24981
+ fill: "#FFFFFF",
24982
+ strokeWidth: 1,
24983
+ strokeScaleEnabled: true,
24984
+ rotation: 0,
24985
+ zIndex: 1,
24986
+ children: []
24987
+ }
24988
+ };
24989
+ }
24990
+ static addNodeState(defaultNodeState, props) {
24991
+ return mergeExceptArrays(defaultNodeState, { props: {
24992
+ x: props.x,
24993
+ y: props.y,
24994
+ width: props.width,
24995
+ height: props.height,
24996
+ rotation: props.rotation,
24997
+ fill: props.fill,
24998
+ ...props.stroke && { stroke: props.stroke },
24999
+ ...props.strokeWidth && { strokeWidth: props.strokeWidth }
25000
+ } });
25001
+ }
25002
+ static updateNodeState(prevNodeState, nextProps) {
25003
+ return mergeExceptArrays(prevNodeState, { props: {
25004
+ x: nextProps.x,
25005
+ y: nextProps.y,
25006
+ width: nextProps.width,
25007
+ height: nextProps.height,
25008
+ rotation: nextProps.rotation,
25009
+ fill: nextProps.fill,
25010
+ ...nextProps.stroke && { stroke: nextProps.stroke },
25011
+ ...nextProps.strokeWidth && { strokeWidth: nextProps.strokeWidth }
25012
+ } });
25013
+ }
25014
+ static getSchema() {
25015
+ const baseSchema = super.getSchema();
25016
+ const imageNodeSchema = baseSchema.extend({
25017
+ type: z.literal("rectangle").describe("Type of the node, for a rectangle node it will always be \"rectangle\""),
25018
+ props: baseSchema.shape.props.extend({
25019
+ nodeType: z.literal("rectangle").describe("Type of the node, for a rectangle node it will always be \"rectangle\""),
25020
+ fill: z.string().describe("Fill color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
25021
+ stroke: z.string().describe("Stroke color of the rectangle in hex format with alpha channel (e.g. #RRGGBBAA)"),
25022
+ strokeWidth: z.number().describe("Stroke width of the rectangle in pixels"),
25023
+ strokeScaleEnabled: z.boolean().describe("Whether the rectangle stroke width should scale when the node is scaled. Defaults to true.")
25024
+ })
25025
+ });
25026
+ return imageNodeSchema;
25027
+ }
24806
25028
  };
24807
25029
 
24808
25030
  //#endregion
@@ -25974,6 +26196,62 @@ var WeaveTextNode = class extends WeaveNode {
25974
26196
  textNode.width(textAreaWidth);
25975
26197
  this.instance.updateNode(this.serialize(textNode));
25976
26198
  }
26199
+ static defaultState(nodeId, params) {
26200
+ const config = (0, import_lodash.merge)({}, WEAVE_TEXT_NODE_DEFAULT_CONFIG, params?.config ?? {});
26201
+ return {
26202
+ ...super.defaultState(nodeId),
26203
+ type: WEAVE_TEXT_NODE_TYPE,
26204
+ props: {
26205
+ ...super.defaultState(nodeId).props,
26206
+ nodeType: "text",
26207
+ fontFamily: "Arial",
26208
+ fontSize: 32,
26209
+ fontStyle: "normal",
26210
+ fontVariant: "normal",
26211
+ textDecoration: "none",
26212
+ letterSpacing: 0,
26213
+ lineHeight: 1,
26214
+ align: "left",
26215
+ verticalAlign: "top",
26216
+ fill: "#000000ff",
26217
+ text: "This is a text node",
26218
+ ...!config.outline.enabled && { strokeEnabled: false },
26219
+ ...config.outline.enabled && {
26220
+ strokeEnabled: true,
26221
+ stroke: config.outline.color,
26222
+ strokeWidth: config.outline.width,
26223
+ fillAfterStrokeEnabled: true
26224
+ },
26225
+ layout: TEXT_LAYOUT.SMART
26226
+ }
26227
+ };
26228
+ }
26229
+ static getSchema() {
26230
+ const baseSchema = super.getSchema();
26231
+ const textNodeSchema = baseSchema.extend({
26232
+ type: z.literal("text"),
26233
+ props: z.object({
26234
+ nodeType: z.literal("text"),
26235
+ fontFamily: z.string().default("Arial"),
26236
+ fontSize: z.number().default(16),
26237
+ fontStyle: z.string().default("normal"),
26238
+ fontVariant: z.string().default("normal"),
26239
+ textDecoration: z.string().default("none"),
26240
+ letterSpacing: z.number().default(0),
26241
+ lineHeight: z.number().default(1),
26242
+ align: z.string().default("left"),
26243
+ verticalAlign: z.string().default("top"),
26244
+ fill: z.string().default("#000000ff"),
26245
+ text: z.string().default("text"),
26246
+ stroke: z.string().optional().default("#d6d6d6"),
26247
+ strokeWidth: z.number().optional().default(2),
26248
+ strokeScaleEnabled: z.boolean().optional().default(true),
26249
+ fillAfterStrokeEnabled: z.boolean().optional().default(true),
26250
+ layout: z.enum(TEXT_LAYOUT).default(TEXT_LAYOUT.SMART)
26251
+ })
26252
+ });
26253
+ return textNodeSchema;
26254
+ }
25977
26255
  };
25978
26256
 
25979
26257
  //#endregion
@@ -27609,6 +27887,108 @@ var WeaveImageNode = class extends WeaveNode {
27609
27887
  this.getNodesSelectionPlugin()?.setSelectedNodes([image]);
27610
27888
  this.getNodesSelectionPlugin()?.getHoverTransformer().forceUpdate();
27611
27889
  }
27890
+ static defaultState(nodeId) {
27891
+ return {
27892
+ ...super.defaultState(nodeId),
27893
+ props: {
27894
+ ...super.defaultState(nodeId).props,
27895
+ nodeType: WEAVE_IMAGE_NODE_TYPE,
27896
+ width: 800,
27897
+ height: 600,
27898
+ imageURL: "https://picsum.photos/id/10/800/600",
27899
+ adding: false,
27900
+ imageWidth: 800,
27901
+ imageHeight: 600,
27902
+ imageInfo: {
27903
+ width: 800,
27904
+ height: 600
27905
+ },
27906
+ uncroppedImage: {
27907
+ width: 800,
27908
+ height: 600
27909
+ },
27910
+ cropping: false,
27911
+ stroke: "#000000",
27912
+ fill: "#FFFFFF",
27913
+ strokeWidth: 0,
27914
+ strokeScaleEnabled: true,
27915
+ children: []
27916
+ }
27917
+ };
27918
+ }
27919
+ static addNodeState(defaultNodeState, props) {
27920
+ return mergeExceptArrays(defaultNodeState, { props: {
27921
+ x: props.x,
27922
+ y: props.y,
27923
+ width: props.width,
27924
+ height: props.height,
27925
+ rotation: props.rotation,
27926
+ imageURL: props.imageURL,
27927
+ ...props.imageFallback && { imageFallback: props.imageFallback },
27928
+ ...props.imageId && { imageId: props.imageId },
27929
+ adding: props.adding,
27930
+ imageWidth: props.imageWidth,
27931
+ imageHeight: props.imageHeight,
27932
+ imageInfo: {
27933
+ width: props.imageInfo.width,
27934
+ height: props.imageInfo.height
27935
+ },
27936
+ uncroppedImage: {
27937
+ width: props.uncroppedImage.width,
27938
+ height: props.uncroppedImage.height
27939
+ },
27940
+ cropping: props.cropping
27941
+ } });
27942
+ }
27943
+ static updateNodeState(prevNodeState, nextProps) {
27944
+ return mergeExceptArrays(prevNodeState, { props: {
27945
+ x: nextProps.x,
27946
+ y: nextProps.y,
27947
+ width: nextProps.width,
27948
+ height: nextProps.height,
27949
+ rotation: nextProps.rotation,
27950
+ imageURL: nextProps.imageURL,
27951
+ ...nextProps.imageFallback && { imageFallback: nextProps.imageFallback },
27952
+ ...nextProps.imageId && { imageId: nextProps.imageId },
27953
+ adding: nextProps.adding,
27954
+ imageWidth: nextProps.imageWidth,
27955
+ imageHeight: nextProps.imageHeight,
27956
+ ...nextProps.imageInfo && { imageInfo: {
27957
+ width: nextProps.imageInfo.width,
27958
+ height: nextProps.imageInfo.height
27959
+ } },
27960
+ ...nextProps.uncroppedImage && { uncroppedImage: {
27961
+ width: nextProps.uncroppedImage?.width,
27962
+ height: nextProps.uncroppedImage?.height
27963
+ } },
27964
+ cropping: nextProps.cropping
27965
+ } });
27966
+ }
27967
+ static getSchema() {
27968
+ const baseSchema = super.getSchema();
27969
+ const imageNodeSchema = baseSchema.extend({
27970
+ type: z.literal("image").describe("Type of the node, for a image node it will always be \"image\""),
27971
+ props: baseSchema.shape.props.extend({
27972
+ nodeType: z.literal("image").describe("Type of the node, for a image node it will always be \"image\""),
27973
+ imageURL: z.string().describe("The URL of the image to be rendered by the node"),
27974
+ 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}"),
27975
+ adding: z.boolean().default(false),
27976
+ imageId: z.string().optional().describe("The id of the image, used for external management of the node."),
27977
+ imageWidth: z.number().describe("The width of the image in pixels"),
27978
+ imageHeight: z.number().describe("The height of the image in pixels"),
27979
+ imageInfo: z.object({
27980
+ width: z.number().describe("The original width of the image in pixels"),
27981
+ height: z.number().describe("The original height of the image in pixels")
27982
+ }),
27983
+ uncroppedImage: z.object({
27984
+ width: z.number().describe("The width of the image before cropping, used for cropping calculations"),
27985
+ height: z.number().describe("The height of the image before cropping, used for cropping calculations")
27986
+ }),
27987
+ cropping: z.boolean().default(false).describe("Whether the image is currently being cropped")
27988
+ })
27989
+ });
27990
+ return imageNodeSchema;
27991
+ }
27612
27992
  };
27613
27993
 
27614
27994
  //#endregion
@@ -28206,6 +28586,7 @@ var WeaveFrameNode = class extends WeaveNode {
28206
28586
  strokeWidth: 0,
28207
28587
  fill: "transparent",
28208
28588
  nodeId: id,
28589
+ nodeType: void 0,
28209
28590
  id: `${id}-selection-area`,
28210
28591
  listening: true,
28211
28592
  draggable: true,
@@ -28362,6 +28743,79 @@ var WeaveFrameNode = class extends WeaveNode {
28362
28743
  };
28363
28744
  }
28364
28745
  scaleReset() {}
28746
+ static defaultState(nodeId) {
28747
+ return {
28748
+ ...super.defaultState(nodeId),
28749
+ type: WEAVE_FRAME_NODE_TYPE,
28750
+ props: {
28751
+ ...super.defaultState(nodeId).props,
28752
+ nodeType: WEAVE_FRAME_NODE_TYPE,
28753
+ x: 0,
28754
+ y: 0,
28755
+ width: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameWidth,
28756
+ height: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameHeight,
28757
+ title: WEAVE_FRAME_NODE_DEFAULT_PROPS.title,
28758
+ frameWidth: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameWidth,
28759
+ frameHeight: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameHeight,
28760
+ frameBackground: WEAVE_FRAME_NODE_DEFAULT_PROPS.frameBackground,
28761
+ borderWidth: WEAVE_FRAME_NODE_DEFAULT_CONFIG.borderWidth,
28762
+ borderColor: WEAVE_FRAME_NODE_DEFAULT_CONFIG.borderColor,
28763
+ stroke: "transparent",
28764
+ strokeWidth: 0,
28765
+ strokeScaleEnabled: true,
28766
+ rotation: 0,
28767
+ zIndex: 1,
28768
+ children: []
28769
+ }
28770
+ };
28771
+ }
28772
+ static addNodeState(defaultNodeState, props) {
28773
+ return mergeExceptArrays(defaultNodeState, { props: {
28774
+ x: props.props.x,
28775
+ y: props.props.y,
28776
+ width: props.props.width,
28777
+ height: props.props.height,
28778
+ ...props.props.title && { stroke: props.props.title },
28779
+ frameWidth: props.props.frameWidth,
28780
+ frameHeight: props.props.frameHeight,
28781
+ ...props.props.frameBackground && { stroke: props.props.frameBackground },
28782
+ rotation: props.props.rotation,
28783
+ ...props.props.borderColor && { borderColor: props.props.borderColor },
28784
+ ...props.props.borderWidth && { borderWidth: props.props.borderWidth }
28785
+ } });
28786
+ }
28787
+ static updateNodeState(prevNodeState, nextProps) {
28788
+ return mergeExceptArrays(prevNodeState, { props: {
28789
+ x: nextProps.x,
28790
+ y: nextProps.y,
28791
+ width: nextProps.width,
28792
+ height: nextProps.height,
28793
+ rotation: nextProps.rotation,
28794
+ title: nextProps.title,
28795
+ ...nextProps.frameBackground && { frameBackground: nextProps.frameBackground },
28796
+ ...nextProps.borderColor && { stroke: nextProps.borderColor },
28797
+ ...nextProps.borderWidth && { strokeWidth: nextProps.borderWidth }
28798
+ } });
28799
+ }
28800
+ static getSchema() {
28801
+ const baseSchema = super.getSchema();
28802
+ const frameNodeSchema = baseSchema.extend({
28803
+ type: z.literal("frame"),
28804
+ props: baseSchema.shape.props.extend({
28805
+ nodeType: z.literal("frame"),
28806
+ width: z.number().optional(),
28807
+ height: z.number().optional(),
28808
+ borderColor: z.string().default("#000000ff"),
28809
+ borderWidth: z.number().default(1),
28810
+ title: z.string().default("Frame"),
28811
+ frameWidth: z.number(),
28812
+ frameHeight: z.number(),
28813
+ frameBackground: z.string().default(WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR),
28814
+ children: z.array(z.any()).default([])
28815
+ })
28816
+ });
28817
+ return frameNodeSchema;
28818
+ }
28365
28819
  };
28366
28820
 
28367
28821
  //#endregion
@@ -28442,8 +28896,8 @@ var WeaveStrokeNode = class extends WeaveNode {
28442
28896
  const segLen = Math.hypot(dx, dy) || 1;
28443
28897
  const nx = -dy / segLen;
28444
28898
  const ny = dx / segLen;
28445
- const w0 = baseW * p0.pressure / 2;
28446
- const w1 = baseW * p1.pressure / 2;
28899
+ const w0 = Math.max(baseW * p0.pressure / 2, .5);
28900
+ const w1 = Math.max(baseW * p1.pressure / 2, .5);
28447
28901
  let traveled = 0;
28448
28902
  while (traveled < segLen) {
28449
28903
  const step = Math.min(dashRemaining, segLen - traveled);
@@ -28979,6 +29433,7 @@ var WeaveStrokeSingleNode = class extends WeaveNode {
28979
29433
  this.shiftPressed = false;
28980
29434
  }
28981
29435
  initEvents() {
29436
+ if (this.instance.isServerSide()) return;
28982
29437
  if (this.eventsInitialized) return;
28983
29438
  window.addEventListener("keydown", (e) => {
28984
29439
  if (e.key === "Shift") this.shiftPressed = true;
@@ -34521,6 +34976,11 @@ const BRUSH_TOOL_DEFAULT_CONFIG = { interpolationSteps: 10 };
34521
34976
  var WeaveBrushToolAction = class extends WeaveAction {
34522
34977
  initialized = false;
34523
34978
  isSpacePressed = false;
34979
+ penActive = false;
34980
+ lastSmoothedPressure = .5;
34981
+ lastPointerPos = null;
34982
+ lastPointerTime = 0;
34983
+ predictedCount = 0;
34524
34984
  onPropsChange = void 0;
34525
34985
  onInit = void 0;
34526
34986
  constructor(params) {
@@ -34550,11 +35010,29 @@ var WeaveBrushToolAction = class extends WeaveAction {
34550
35010
  };
34551
35011
  }
34552
35012
  getEventPressure(e) {
34553
- if (e.evt.pointerType && e.evt.pointerType === "pen") return e.evt.pressure || .5;
34554
- return .5;
35013
+ const now$2 = performance.now();
35014
+ let velocity = 0;
35015
+ if (this.lastPointerPos && now$2 - this.lastPointerTime > 0) {
35016
+ const dx = e.evt.clientX - this.lastPointerPos.x;
35017
+ const dy = e.evt.clientY - this.lastPointerPos.y;
35018
+ velocity = Math.hypot(dx, dy) / (now$2 - this.lastPointerTime) * 1e3;
35019
+ }
35020
+ this.lastPointerPos = {
35021
+ x: e.evt.clientX,
35022
+ y: e.evt.clientY
35023
+ };
35024
+ this.lastPointerTime = now$2;
35025
+ const alpha = Math.min(Math.max(velocity / 1500, .15), .6);
35026
+ let raw;
35027
+ if (e.evt.pointerType === "pen") raw = e.evt.pressure || .5;
35028
+ else raw = .5;
35029
+ this.lastSmoothedPressure = alpha * raw + (1 - alpha) * this.lastSmoothedPressure;
35030
+ return Math.max(this.lastSmoothedPressure, .15);
34555
35031
  }
34556
35032
  setupEvents() {
34557
35033
  const stage = this.instance.getStage();
35034
+ this.prevTouchAction = stage.container().style.touchAction;
35035
+ stage.container().style.touchAction = "none";
34558
35036
  window.addEventListener("keyup", (e) => {
34559
35037
  if (e.code === "Space" && this.instance.getActiveAction() === BRUSH_TOOL_ACTION_NAME) this.isSpacePressed = false;
34560
35038
  }, { signal: this.instance.getEventsController()?.signal });
@@ -34580,6 +35058,8 @@ var WeaveBrushToolAction = class extends WeaveAction {
34580
35058
  if (this.getZoomPlugin()?.isPinching()) return;
34581
35059
  if (this.isSpacePressed) return;
34582
35060
  if (e?.evt?.button !== 0) return;
35061
+ if (e.evt.pointerType === "touch" && this.penActive) return;
35062
+ if (e.evt.pointerType === "pen") this.penActive = true;
34583
35063
  const pointPressure = this.getEventPressure(e);
34584
35064
  this.handleStartStroke(pointPressure);
34585
35065
  e.evt.stopPropagation();
@@ -34590,12 +35070,27 @@ var WeaveBrushToolAction = class extends WeaveAction {
34590
35070
  this.setCursor();
34591
35071
  if (this.state !== BRUSH_TOOL_STATE.DEFINE_STROKE) return;
34592
35072
  if (this.getZoomPlugin()?.isPinching()) return;
34593
- const pointPressure = this.getEventPressure(e);
34594
- this.handleMovement(pointPressure);
35073
+ const coalescedEvents = e.evt.getCoalescedEvents ? e.evt.getCoalescedEvents() : [];
35074
+ if (coalescedEvents.length > 1) {
35075
+ for (const ce of coalescedEvents) {
35076
+ const pointPressure = ce.pointerType === "pen" && typeof ce.pressure === "number" ? ce.pressure : .5;
35077
+ this.handleMovement(pointPressure, void 0, false);
35078
+ }
35079
+ const predictedEvents = e.evt.getPredictedEvents ? e.evt.getPredictedEvents() : [];
35080
+ if (predictedEvents.length > 0) {
35081
+ const last = predictedEvents[predictedEvents.length - 1];
35082
+ const predPressure = last.pointerType === "pen" && typeof last.pressure === "number" ? last.pressure : .5;
35083
+ this.handleMovement(predPressure, last, true);
35084
+ }
35085
+ } else {
35086
+ const pointPressure = this.getEventPressure(e);
35087
+ this.handleMovement(pointPressure, void 0, false);
35088
+ }
34595
35089
  e.evt.stopPropagation();
34596
35090
  };
34597
35091
  stage.on("pointermove", handlePointerMove);
34598
35092
  const handlePointerUp = (e) => {
35093
+ this.penActive = false;
34599
35094
  if (this.state !== BRUSH_TOOL_STATE.DEFINE_STROKE) return;
34600
35095
  if (this.getZoomPlugin()?.isPinching()) return;
34601
35096
  this.handleEndStroke();
@@ -34632,6 +35127,10 @@ var WeaveBrushToolAction = class extends WeaveAction {
34632
35127
  };
34633
35128
  }
34634
35129
  handleStartStroke(pressure) {
35130
+ this.lastSmoothedPressure = .5;
35131
+ this.lastPointerPos = null;
35132
+ this.lastPointerTime = 0;
35133
+ this.predictedCount = 0;
34635
35134
  const { mousePoint, container, measureContainer } = this.instance.getMousePointer();
34636
35135
  this.clickPoint = mousePoint;
34637
35136
  this.container = container;
@@ -34660,17 +35159,25 @@ var WeaveBrushToolAction = class extends WeaveAction {
34660
35159
  }
34661
35160
  this.setState(BRUSH_TOOL_STATE.DEFINE_STROKE);
34662
35161
  }
34663
- handleMovement(pressure) {
35162
+ handleMovement(pressure, predictedEvent, isPredicted = false) {
34664
35163
  if (this.state !== BRUSH_TOOL_STATE.DEFINE_STROKE) return;
35164
+ const stage = this.instance.getStage();
34665
35165
  const tempStroke = this.instance.getStage().findOne(`#${this.strokeId}`);
34666
35166
  if (this.measureContainer && tempStroke) {
35167
+ if (predictedEvent) stage.setPointersPositions(predictedEvent);
34667
35168
  const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.measureContainer);
34668
35169
  const currentPoint = {
34669
35170
  x: mousePoint.x - tempStroke.x(),
34670
35171
  y: mousePoint.y - tempStroke.y(),
34671
35172
  pressure
34672
35173
  };
34673
- const newStrokeElements = [...tempStroke.getAttrs().strokeElements, currentPoint];
35174
+ let newStrokeElements = [...tempStroke.getAttrs().strokeElements];
35175
+ if (!isPredicted && this.predictedCount > 0) {
35176
+ newStrokeElements = newStrokeElements.slice(0, -1 * this.predictedCount);
35177
+ this.predictedCount = 0;
35178
+ }
35179
+ newStrokeElements.push(currentPoint);
35180
+ if (isPredicted) this.predictedCount++;
34674
35181
  const box = this.getBoundingBox(newStrokeElements);
34675
35182
  tempStroke.setAttrs({
34676
35183
  width: box.width,
@@ -34690,17 +35197,22 @@ var WeaveBrushToolAction = class extends WeaveAction {
34690
35197
  if (nodeHandler) {
34691
35198
  const box = this.getBoundingBox(tempStroke.getAttrs().strokeElements);
34692
35199
  let newStrokeElements = [...tempStroke.getAttrs().strokeElements];
35200
+ if (this.predictedCount > 0) {
35201
+ newStrokeElements = newStrokeElements.slice(0, -1 * this.predictedCount);
35202
+ this.predictedCount = 0;
35203
+ }
34693
35204
  newStrokeElements = newStrokeElements.map((point) => ({
34694
35205
  ...point,
34695
35206
  x: point.x - box.x,
34696
35207
  y: point.y - box.y
34697
35208
  }));
35209
+ const compressedPoints = simplify(newStrokeElements, 1, true);
34698
35210
  tempStroke.setAttrs({
34699
35211
  width: box.width,
34700
35212
  height: box.height,
34701
35213
  x: box.x,
34702
35214
  y: box.y,
34703
- strokeElements: newStrokeElements
35215
+ strokeElements: compressedPoints
34704
35216
  });
34705
35217
  const realNode = this.instance.getStage().findOne(`#${tempStroke.getAttrs().id}`);
34706
35218
  if (realNode) realNode.destroy();
@@ -34736,6 +35248,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
34736
35248
  }
34737
35249
  cleanup() {
34738
35250
  const stage = this.instance.getStage();
35251
+ stage.container().style.touchAction = this.prevTouchAction;
34739
35252
  stage.container().style.cursor = "default";
34740
35253
  this.instance.emitEvent("onAddedBrush");
34741
35254
  const selectionPlugin = this.instance.getPlugin("nodesSelection");
@@ -42905,4 +43418,4 @@ function getJSONFromYjsBinary(actualState) {
42905
43418
  }
42906
43419
 
42907
43420
  //#endregion
42908
- 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 };
43421
+ export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_DEFAULT_CONFIG, BRUSH_TOOL_STATE, CONNECTOR_TOOL_ACTION_NAME, CONNECTOR_TOOL_DEFAULT_CONFIG, CONNECTOR_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, DEFAULT_GUIDE_TOOL_ACTION_CONFIG, DEFAULT_SNAPPING_MANAGER_CONFIG, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_DISTANCE_NAME, GUIDE_DISTANCE_ORIGIN, GUIDE_KIND, GUIDE_NAME, GUIDE_ORIENTATION, GUIDE_STATE, GUIDE_TOOL_ACTION_NAME, GUIDE_TOOL_STATE, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MEASURE_TOOL_ACTION_NAME, MEASURE_TOOL_STATE, MOVE_ORIENTATION, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAGE_MINIMAP_DEFAULT_CONFIG, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, VIDEO_TOOL_ACTION_NAME, VIDEO_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_ARROW_TOOL_ACTION_NAME, WEAVE_ARROW_TOOL_STATE, WEAVE_COMMENTS_RENDERER_KEY, WEAVE_COMMENTS_TOOL_LAYER_ID, WEAVE_COMMENT_CREATE_ACTION, WEAVE_COMMENT_NODE_ACTION, WEAVE_COMMENT_NODE_DEFAULTS, WEAVE_COMMENT_NODE_TYPE, WEAVE_COMMENT_STATUS, WEAVE_COMMENT_TOOL_ACTION_NAME, WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, WEAVE_COMMENT_TOOL_STATE, WEAVE_COMMENT_VIEW_ACTION, WEAVE_CONNECTOR_NODE_ANCHOR_ORIGIN, WEAVE_CONNECTOR_NODE_DECORATOR_TYPE, WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, WEAVE_CONNECTOR_NODE_LINE_ORIGIN, WEAVE_CONNECTOR_NODE_LINE_TYPE, WEAVE_CONNECTOR_NODE_TYPE, WEAVE_COPY_PASTE_CONFIG_DEFAULT, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_CATCHER_ID, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_CONFIG, WEAVE_GRID_DOT_TYPES, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGES_TOOL_ACTION_NAME, WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, WEAVE_IMAGES_TOOL_STATE, WEAVE_IMAGES_TOOL_UPLOAD_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_IMAGE_TOOL_ACTION_NAME, WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, WEAVE_IMAGE_TOOL_STATE, WEAVE_IMAGE_TOOL_UPLOAD_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_MEASURE_NODE_DEFAULT_CONFIG, WEAVE_MEASURE_NODE_TYPE, WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_PLUGIN_KEY, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_DROP_AREA_KEY, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_IMAGE_CROPPING_MODE, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAGE_PANNING_THROTTLE_MS, WEAVE_STAGE_TEXT_EDITION_MODE, WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, WEAVE_STAGE_ZOOM_KEY, WEAVE_STAGE_ZOOM_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_SINGLE_NODE_TIP_SIDE, WEAVE_STROKE_SINGLE_NODE_TIP_TYPE, WEAVE_STROKE_SINGLE_NODE_TYPE, WEAVE_STROKE_TOOL_ACTION_NAME, WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES, WEAVE_STROKE_TOOL_DEFAULT_CONFIG, WEAVE_STROKE_TOOL_STATE, WEAVE_TEXT_NODE_DEFAULT_CONFIG, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, WEAVE_USERS_PRESENCE_PLUGIN_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_PRESENCE_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveConnectorNode, WeaveConnectorToolAction, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveGuideToolAction, WeaveImageNode, WeaveImageToolAction, WeaveImagesToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeaveNodesSnappingPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveRenderer, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStateManipulation, WeaveStore, WeaveStrokeNode, WeaveStrokeSingleNode, WeaveStrokeToolAction, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersPresencePlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, downscaleImageFile, downscaleImageFromURL, getBoundingBox, getDownscaleRatio, getExportBoundingBox, getImageSizeFromFile, getJSONFromYjsBinary, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isObject, isServer, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, weavejsToYjsBinary };