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