@fieldnotes/core 0.38.2 → 0.38.3

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/index.d.cts CHANGED
@@ -482,9 +482,7 @@ declare class Viewport {
482
482
  private readonly onHtmlElementMount?;
483
483
  private readonly dropHandler?;
484
484
  private readonly gridController;
485
- private readonly doubleTapDetector;
486
- private tapDownX;
487
- private tapDownY;
485
+ private readonly interactions;
488
486
  private contextMenu;
489
487
  constructor(container: HTMLElement, options?: ViewportOptions);
490
488
  get ctx(): CanvasRenderingContext2D | null;
@@ -562,17 +560,7 @@ declare class Viewport {
562
560
  getRenderStats(): RenderStatsSnapshot;
563
561
  logPerformance(intervalMs?: number): () => void;
564
562
  destroy(): void;
565
- private startEditingElement;
566
- private fitNoteHeight;
567
- private onTextEditStop;
568
- private onTapDown;
569
- private onDoubleTap;
570
- private findArrowAt;
571
- private startArrowLabelEdit;
572
- private hitTestWorld;
573
563
  stopInteracting(): void;
574
- private onDragOver;
575
- private onDrop;
576
564
  private unbindArrowsFrom;
577
565
  private applyCameraTransform;
578
566
  private syncCanvasSize;
@@ -1005,6 +993,6 @@ declare class TemplateTool implements Tool {
1005
993
  private notifyOptionsChange;
1006
994
  }
1007
995
 
1008
- declare const VERSION = "0.38.2";
996
+ declare const VERSION = "0.38.3";
1009
997
 
1010
998
  export { type ActiveFormats, type AlignEdge, type ArrowElement, ArrowTool, type ArrowToolOptions, AutoSave, type AutoSaveOptions, type BackgroundOptions, type BackgroundPattern, type Binding, type Bounds, Camera, type CameraChangeInfo, type CameraOptions, type CanvasElement, type CanvasState, type Command, DEFAULT_NOTE_FONT_SIZE, type DistributeAxis, ElementStore, type ElementStyle, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, type ExportImageOptions, type FontSizePreset, type GridElement, type GridInfo, HandTool, type HexOrientation, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, type Layer, LayerManager, MeasureTool, type MeasureToolOptions, type Measurement, type NoteElement, NoteTool, type NoteToolOptions, PencilTool, type PencilToolOptions, type Point, type PointerState, type RenderStatsSnapshot, SelectTool, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type ShortcutBindings, type ShortcutOptions, type ShortcutsApi, type Size, type StrokeElement, type StrokePoint, type TemplateElement, type TemplateShape, TemplateTool, type TemplateToolOptions, type TextElement, TextTool, type TextToolOptions, type Tool, type ToolContext, ToolManager, type ToolName, VERSION, Viewport, type ViewportOptions, boundsIntersect, createArrow, createGrid, createHtmlElement, createImage, createNote, createShape, createStroke, createTemplate, createText, drawHexPath, exportImage, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getElementBounds, getElementStyle, getElementsBoundingBox, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInSquare, getHexDistance, isNearBezier, setFontSize, smartSnap, snapPoint, snapToHexCenter, styleToPatch, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline };
package/dist/index.d.ts CHANGED
@@ -482,9 +482,7 @@ declare class Viewport {
482
482
  private readonly onHtmlElementMount?;
483
483
  private readonly dropHandler?;
484
484
  private readonly gridController;
485
- private readonly doubleTapDetector;
486
- private tapDownX;
487
- private tapDownY;
485
+ private readonly interactions;
488
486
  private contextMenu;
489
487
  constructor(container: HTMLElement, options?: ViewportOptions);
490
488
  get ctx(): CanvasRenderingContext2D | null;
@@ -562,17 +560,7 @@ declare class Viewport {
562
560
  getRenderStats(): RenderStatsSnapshot;
563
561
  logPerformance(intervalMs?: number): () => void;
564
562
  destroy(): void;
565
- private startEditingElement;
566
- private fitNoteHeight;
567
- private onTextEditStop;
568
- private onTapDown;
569
- private onDoubleTap;
570
- private findArrowAt;
571
- private startArrowLabelEdit;
572
- private hitTestWorld;
573
563
  stopInteracting(): void;
574
- private onDragOver;
575
- private onDrop;
576
564
  private unbindArrowsFrom;
577
565
  private applyCameraTransform;
578
566
  private syncCanvasSize;
@@ -1005,6 +993,6 @@ declare class TemplateTool implements Tool {
1005
993
  private notifyOptionsChange;
1006
994
  }
1007
995
 
1008
- declare const VERSION = "0.38.2";
996
+ declare const VERSION = "0.38.3";
1009
997
 
1010
998
  export { type ActiveFormats, type AlignEdge, type ArrowElement, ArrowTool, type ArrowToolOptions, AutoSave, type AutoSaveOptions, type BackgroundOptions, type BackgroundPattern, type Binding, type Bounds, Camera, type CameraChangeInfo, type CameraOptions, type CanvasElement, type CanvasState, type Command, DEFAULT_NOTE_FONT_SIZE, type DistributeAxis, ElementStore, type ElementStyle, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, type ExportImageOptions, type FontSizePreset, type GridElement, type GridInfo, HandTool, type HexOrientation, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, type Layer, LayerManager, MeasureTool, type MeasureToolOptions, type Measurement, type NoteElement, NoteTool, type NoteToolOptions, PencilTool, type PencilToolOptions, type Point, type PointerState, type RenderStatsSnapshot, SelectTool, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type ShortcutBindings, type ShortcutOptions, type ShortcutsApi, type Size, type StrokeElement, type StrokePoint, type TemplateElement, type TemplateShape, TemplateTool, type TemplateToolOptions, type TextElement, TextTool, type TextToolOptions, type Tool, type ToolContext, ToolManager, type ToolName, VERSION, Viewport, type ViewportOptions, boundsIntersect, createArrow, createGrid, createHtmlElement, createImage, createNote, createShape, createStroke, createTemplate, createText, drawHexPath, exportImage, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getElementBounds, getElementStyle, getElementsBoundingBox, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInSquare, getHexDistance, isNearBezier, setFontSize, smartSnap, snapPoint, snapToHexCenter, styleToPatch, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline };
package/dist/index.js CHANGED
@@ -5978,9 +5978,158 @@ var GridController = class {
5978
5978
  }
5979
5979
  };
5980
5980
 
5981
+ // src/canvas/viewport-interactions.ts
5982
+ var ARROW_HIT_THRESHOLD = 10;
5983
+ var ViewportInteractions = class {
5984
+ constructor(deps) {
5985
+ this.deps = deps;
5986
+ }
5987
+ doubleTapDetector = new DoubleTapDetector();
5988
+ tapDownX = 0;
5989
+ tapDownY = 0;
5990
+ startEditingElement(id) {
5991
+ const element = this.deps.store.getById(id);
5992
+ if (!element || element.type !== "note" && element.type !== "text") return;
5993
+ this.deps.renderLoop.flush();
5994
+ const node = this.deps.domNodeManager.getNode(id);
5995
+ if (node) {
5996
+ this.deps.noteEditor.startEditing(node, id, this.deps.store);
5997
+ }
5998
+ }
5999
+ fitNoteHeight(elementId) {
6000
+ const element = this.deps.store.getById(elementId);
6001
+ if (!element || element.type !== "note") return;
6002
+ if (isNoteContentEmpty(element.text)) return;
6003
+ const node = this.deps.domNodeManager.getNode(elementId);
6004
+ if (!node) return;
6005
+ const measured = node.scrollHeight;
6006
+ if (measured > element.size.h) {
6007
+ this.deps.store.update(elementId, { size: { w: element.size.w, h: measured } });
6008
+ }
6009
+ }
6010
+ onTextEditStop(elementId) {
6011
+ const element = this.deps.store.getById(elementId);
6012
+ if (!element) return;
6013
+ if (element.type === "note") {
6014
+ if (isNoteContentEmpty(element.text)) {
6015
+ this.deps.store.remove(elementId);
6016
+ return;
6017
+ }
6018
+ this.fitNoteHeight(elementId);
6019
+ return;
6020
+ }
6021
+ if (element.type !== "text") return;
6022
+ if (!element.text || element.text.trim() === "") {
6023
+ this.deps.store.remove(elementId);
6024
+ return;
6025
+ }
6026
+ const node = this.deps.domNodeManager.getNode(elementId);
6027
+ if (node && "size" in element) {
6028
+ const measured = node.scrollHeight;
6029
+ if (measured !== element.size.h) {
6030
+ this.deps.store.update(elementId, { size: { w: element.size.w, h: measured } });
6031
+ }
6032
+ }
6033
+ }
6034
+ onTapDown = (e) => {
6035
+ this.tapDownX = e.clientX;
6036
+ this.tapDownY = e.clientY;
6037
+ };
6038
+ onDoubleTap = (e) => {
6039
+ const dx = e.clientX - this.tapDownX;
6040
+ const dy = e.clientY - this.tapDownY;
6041
+ const moved = Math.sqrt(dx * dx + dy * dy);
6042
+ if (moved > 10) return;
6043
+ if (!this.doubleTapDetector.feed(e)) return;
6044
+ if (typeof document.elementFromPoint !== "function") return;
6045
+ const el = document.elementFromPoint(e.clientX, e.clientY);
6046
+ const nodeEl = el?.closest("[data-element-id]");
6047
+ if (nodeEl) {
6048
+ const elementId = nodeEl.dataset["elementId"];
6049
+ if (elementId) {
6050
+ const element = this.deps.store.getById(elementId);
6051
+ if (element?.type === "note" || element?.type === "text") {
6052
+ this.startEditingElement(elementId);
6053
+ return;
6054
+ }
6055
+ }
6056
+ }
6057
+ const rect = this.deps.wrapper.getBoundingClientRect();
6058
+ const screen = { x: e.clientX - rect.left, y: e.clientY - rect.top };
6059
+ const world = this.deps.camera.screenToWorld(screen);
6060
+ const hit = this.hitTestWorld(world);
6061
+ if (hit?.type === "html") {
6062
+ this.deps.interactMode.startInteracting(hit.id);
6063
+ return;
6064
+ }
6065
+ const arrow = this.findArrowAt(world);
6066
+ if (arrow) {
6067
+ this.startArrowLabelEdit(arrow);
6068
+ }
6069
+ };
6070
+ findArrowAt(world) {
6071
+ const candidates = this.deps.store.queryPoint(world).reverse();
6072
+ for (const el of candidates) {
6073
+ if (el.type === "arrow" && isNearBezier(world, el.from, el.to, el.bend, ARROW_HIT_THRESHOLD)) {
6074
+ return el;
6075
+ }
6076
+ }
6077
+ return void 0;
6078
+ }
6079
+ startArrowLabelEdit(arrow) {
6080
+ this.deps.arrowLabelEditor.startEditing({
6081
+ arrow,
6082
+ layer: this.deps.domLayer,
6083
+ store: this.deps.store,
6084
+ recorder: this.deps.recorder,
6085
+ onDone: () => {
6086
+ this.deps.renderer.setLabelEditingId(null);
6087
+ this.deps.requestRender();
6088
+ }
6089
+ });
6090
+ this.deps.renderer.setLabelEditingId(arrow.id);
6091
+ }
6092
+ hitTestWorld(world) {
6093
+ const candidates = this.deps.store.queryPoint(world).reverse();
6094
+ for (const el of candidates) {
6095
+ if (!("size" in el)) continue;
6096
+ const { x, y } = el.position;
6097
+ const { w, h } = el.size;
6098
+ if (world.x >= x && world.x <= x + w && world.y >= y && world.y <= y + h) {
6099
+ return el;
6100
+ }
6101
+ }
6102
+ return null;
6103
+ }
6104
+ onDragOver = (e) => {
6105
+ e.preventDefault();
6106
+ };
6107
+ onDrop = (e) => {
6108
+ e.preventDefault();
6109
+ const rect = this.deps.wrapper.getBoundingClientRect();
6110
+ const screenPos = { x: e.clientX - rect.left, y: e.clientY - rect.top };
6111
+ const worldPos = this.deps.camera.screenToWorld(screenPos);
6112
+ if (this.deps.dropHandler) {
6113
+ this.deps.dropHandler(e, worldPos);
6114
+ return;
6115
+ }
6116
+ const files = e.dataTransfer?.files;
6117
+ if (!files) return;
6118
+ for (const file of files) {
6119
+ if (!file.type.startsWith("image/")) continue;
6120
+ const reader = new FileReader();
6121
+ reader.onload = () => {
6122
+ const src = reader.result;
6123
+ if (typeof src !== "string") return;
6124
+ this.deps.addImage(src, worldPos);
6125
+ };
6126
+ reader.readAsDataURL(file);
6127
+ }
6128
+ };
6129
+ };
6130
+
5981
6131
  // src/canvas/viewport.ts
5982
6132
  var EMPTY_IDS = [];
5983
- var ARROW_HIT_THRESHOLD = 10;
5984
6133
  function noop() {
5985
6134
  }
5986
6135
  var Viewport = class {
@@ -6015,7 +6164,7 @@ var Viewport = class {
6015
6164
  toolbar: options.toolbar,
6016
6165
  placeholder: options.placeholder
6017
6166
  });
6018
- this.noteEditor.setOnStop((id) => this.onTextEditStop(id));
6167
+ this.noteEditor.setOnStop((id) => this.interactions.onTextEditStop(id));
6019
6168
  this.arrowLabelEditor = new ArrowLabelEditor();
6020
6169
  this.noteEditor.setHistoryHooks(
6021
6170
  () => this.historyRecorder.begin(),
@@ -6042,8 +6191,8 @@ var Viewport = class {
6042
6191
  store: this.store,
6043
6192
  requestRender: () => this.requestRender(),
6044
6193
  switchTool: (name) => this.toolManager.setTool(name, this.toolContext),
6045
- editElement: (id) => this.startEditingElement(id),
6046
- fitNoteHeight: (id) => this.fitNoteHeight(id),
6194
+ editElement: (id) => this.interactions.startEditingElement(id),
6195
+ fitNoteHeight: (id) => this.interactions.fitNoteHeight(id),
6047
6196
  setCursor: (cursor) => {
6048
6197
  this.wrapper.style.cursor = cursor;
6049
6198
  },
@@ -6079,7 +6228,7 @@ var Viewport = class {
6079
6228
  this.unsubToolChange = this.toolManager.onChange(() => this.contextMenu?.close());
6080
6229
  this.domNodeManager = new DomNodeManager({
6081
6230
  domLayer: this.domLayer,
6082
- onEditRequest: (id) => this.startEditingElement(id),
6231
+ onEditRequest: (id) => this.interactions.startEditingElement(id),
6083
6232
  isEditingElement: (id) => this.noteEditor.isEditing && this.noteEditor.editingElementId === id,
6084
6233
  getVersion: (id) => this.store.getVersion(id)
6085
6234
  });
@@ -6151,10 +6300,26 @@ var Viewport = class {
6151
6300
  this.toolContext.activeLayerId = this.layerManager.activeLayerId;
6152
6301
  this.requestRender();
6153
6302
  });
6154
- this.wrapper.addEventListener("pointerdown", this.onTapDown);
6155
- this.wrapper.addEventListener("pointerup", this.onDoubleTap);
6156
- this.wrapper.addEventListener("dragover", this.onDragOver);
6157
- this.wrapper.addEventListener("drop", this.onDrop);
6303
+ this.interactions = new ViewportInteractions({
6304
+ store: this.store,
6305
+ camera: this.camera,
6306
+ wrapper: this.wrapper,
6307
+ domLayer: this.domLayer,
6308
+ renderLoop: this.renderLoop,
6309
+ domNodeManager: this.domNodeManager,
6310
+ noteEditor: this.noteEditor,
6311
+ arrowLabelEditor: this.arrowLabelEditor,
6312
+ interactMode: this.interactMode,
6313
+ renderer: this.renderer,
6314
+ recorder: this.historyRecorder,
6315
+ requestRender: () => this.requestRender(),
6316
+ addImage: (src, position) => this.addImage(src, position),
6317
+ dropHandler: this.dropHandler
6318
+ });
6319
+ this.wrapper.addEventListener("pointerdown", this.interactions.onTapDown);
6320
+ this.wrapper.addEventListener("pointerup", this.interactions.onDoubleTap);
6321
+ this.wrapper.addEventListener("dragover", this.interactions.onDragOver);
6322
+ this.wrapper.addEventListener("drop", this.interactions.onDrop);
6158
6323
  this.observeResize();
6159
6324
  this.syncCanvasSize();
6160
6325
  this.renderLoop.start();
@@ -6190,9 +6355,7 @@ var Viewport = class {
6190
6355
  onHtmlElementMount;
6191
6356
  dropHandler;
6192
6357
  gridController;
6193
- doubleTapDetector = new DoubleTapDetector();
6194
- tapDownX = 0;
6195
- tapDownY = 0;
6358
+ interactions;
6196
6359
  contextMenu = null;
6197
6360
  get ctx() {
6198
6361
  return this.canvasEl.getContext("2d");
@@ -6453,10 +6616,10 @@ var Viewport = class {
6453
6616
  this.arrowLabelEditor.cancel();
6454
6617
  this.historyRecorder.destroy();
6455
6618
  this.contextMenu?.dispose();
6456
- this.wrapper.removeEventListener("pointerdown", this.onTapDown);
6457
- this.wrapper.removeEventListener("pointerup", this.onDoubleTap);
6458
- this.wrapper.removeEventListener("dragover", this.onDragOver);
6459
- this.wrapper.removeEventListener("drop", this.onDrop);
6619
+ this.wrapper.removeEventListener("pointerdown", this.interactions.onTapDown);
6620
+ this.wrapper.removeEventListener("pointerup", this.interactions.onDoubleTap);
6621
+ this.wrapper.removeEventListener("dragover", this.interactions.onDragOver);
6622
+ this.wrapper.removeEventListener("drop", this.interactions.onDrop);
6460
6623
  this.inputHandler.destroy();
6461
6624
  this.unsubCamera();
6462
6625
  this.unsubToolChange();
@@ -6465,148 +6628,9 @@ var Viewport = class {
6465
6628
  this.resizeObserver = null;
6466
6629
  this.wrapper.remove();
6467
6630
  }
6468
- startEditingElement(id) {
6469
- const element = this.store.getById(id);
6470
- if (!element || element.type !== "note" && element.type !== "text") return;
6471
- this.renderLoop.flush();
6472
- const node = this.domNodeManager.getNode(id);
6473
- if (node) {
6474
- this.noteEditor.startEditing(node, id, this.store);
6475
- }
6476
- }
6477
- fitNoteHeight(elementId) {
6478
- const element = this.store.getById(elementId);
6479
- if (!element || element.type !== "note") return;
6480
- if (isNoteContentEmpty(element.text)) return;
6481
- const node = this.domNodeManager.getNode(elementId);
6482
- if (!node) return;
6483
- const measured = node.scrollHeight;
6484
- if (measured > element.size.h) {
6485
- this.store.update(elementId, { size: { w: element.size.w, h: measured } });
6486
- }
6487
- }
6488
- onTextEditStop(elementId) {
6489
- const element = this.store.getById(elementId);
6490
- if (!element) return;
6491
- if (element.type === "note") {
6492
- if (isNoteContentEmpty(element.text)) {
6493
- this.store.remove(elementId);
6494
- return;
6495
- }
6496
- this.fitNoteHeight(elementId);
6497
- return;
6498
- }
6499
- if (element.type !== "text") return;
6500
- if (!element.text || element.text.trim() === "") {
6501
- this.store.remove(elementId);
6502
- return;
6503
- }
6504
- const node = this.domNodeManager.getNode(elementId);
6505
- if (node && "size" in element) {
6506
- const measured = node.scrollHeight;
6507
- if (measured !== element.size.h) {
6508
- this.store.update(elementId, { size: { w: element.size.w, h: measured } });
6509
- }
6510
- }
6511
- }
6512
- onTapDown = (e) => {
6513
- this.tapDownX = e.clientX;
6514
- this.tapDownY = e.clientY;
6515
- };
6516
- onDoubleTap = (e) => {
6517
- const dx = e.clientX - this.tapDownX;
6518
- const dy = e.clientY - this.tapDownY;
6519
- const moved = Math.sqrt(dx * dx + dy * dy);
6520
- if (moved > 10) return;
6521
- if (!this.doubleTapDetector.feed(e)) return;
6522
- if (typeof document.elementFromPoint !== "function") return;
6523
- const el = document.elementFromPoint(e.clientX, e.clientY);
6524
- const nodeEl = el?.closest("[data-element-id]");
6525
- if (nodeEl) {
6526
- const elementId = nodeEl.dataset["elementId"];
6527
- if (elementId) {
6528
- const element = this.store.getById(elementId);
6529
- if (element?.type === "note" || element?.type === "text") {
6530
- this.startEditingElement(elementId);
6531
- return;
6532
- }
6533
- }
6534
- }
6535
- const rect = this.wrapper.getBoundingClientRect();
6536
- const screen = { x: e.clientX - rect.left, y: e.clientY - rect.top };
6537
- const world = this.camera.screenToWorld(screen);
6538
- const hit = this.hitTestWorld(world);
6539
- if (hit?.type === "html") {
6540
- this.interactMode.startInteracting(hit.id);
6541
- return;
6542
- }
6543
- const arrow = this.findArrowAt(world);
6544
- if (arrow) {
6545
- this.startArrowLabelEdit(arrow);
6546
- }
6547
- };
6548
- findArrowAt(world) {
6549
- const candidates = this.store.queryPoint(world).reverse();
6550
- for (const el of candidates) {
6551
- if (el.type === "arrow" && isNearBezier(world, el.from, el.to, el.bend, ARROW_HIT_THRESHOLD)) {
6552
- return el;
6553
- }
6554
- }
6555
- return void 0;
6556
- }
6557
- startArrowLabelEdit(arrow) {
6558
- this.arrowLabelEditor.startEditing({
6559
- arrow,
6560
- layer: this.domLayer,
6561
- store: this.store,
6562
- recorder: this.historyRecorder,
6563
- onDone: () => {
6564
- this.renderer.setLabelEditingId(null);
6565
- this.requestRender();
6566
- }
6567
- });
6568
- this.renderer.setLabelEditingId(arrow.id);
6569
- }
6570
- hitTestWorld(world) {
6571
- const candidates = this.store.queryPoint(world).reverse();
6572
- for (const el of candidates) {
6573
- if (!("size" in el)) continue;
6574
- const { x, y } = el.position;
6575
- const { w, h } = el.size;
6576
- if (world.x >= x && world.x <= x + w && world.y >= y && world.y <= y + h) {
6577
- return el;
6578
- }
6579
- }
6580
- return null;
6581
- }
6582
6631
  stopInteracting() {
6583
6632
  this.interactMode.stopInteracting();
6584
6633
  }
6585
- onDragOver = (e) => {
6586
- e.preventDefault();
6587
- };
6588
- onDrop = (e) => {
6589
- e.preventDefault();
6590
- const rect = this.wrapper.getBoundingClientRect();
6591
- const screenPos = { x: e.clientX - rect.left, y: e.clientY - rect.top };
6592
- const worldPos = this.camera.screenToWorld(screenPos);
6593
- if (this.dropHandler) {
6594
- this.dropHandler(e, worldPos);
6595
- return;
6596
- }
6597
- const files = e.dataTransfer?.files;
6598
- if (!files) return;
6599
- for (const file of files) {
6600
- if (!file.type.startsWith("image/")) continue;
6601
- const reader = new FileReader();
6602
- reader.onload = () => {
6603
- const src = reader.result;
6604
- if (typeof src !== "string") return;
6605
- this.addImage(src, worldPos);
6606
- };
6607
- reader.readAsDataURL(file);
6608
- }
6609
- };
6610
6634
  unbindArrowsFrom(removedElement) {
6611
6635
  const boundArrows = findBoundArrows(removedElement.id, this.store);
6612
6636
  const bounds = getElementBounds(removedElement);
@@ -8963,7 +8987,7 @@ var TemplateTool = class {
8963
8987
  };
8964
8988
 
8965
8989
  // src/index.ts
8966
- var VERSION = "0.38.2";
8990
+ var VERSION = "0.38.3";
8967
8991
  export {
8968
8992
  ArrowTool,
8969
8993
  AutoSave,