@fieldnotes/core 0.50.4 → 0.50.6

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
@@ -1123,6 +1123,6 @@ declare class LaserTool implements Tool {
1123
1123
  private notifyOptionsChange;
1124
1124
  }
1125
1125
 
1126
- declare const VERSION = "0.50.4";
1126
+ declare const VERSION = "0.50.6";
1127
1127
 
1128
1128
  export { type ActiveFormats, type AlignEdge, type ArrowElement, type ArrowStrokeStyle, 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, type ElementChangeMeta, ElementStore, type ElementStyle, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, type ExportImageOptions, type ExportSvgOptions, type FontSizePreset, type GridElement, type GridInfo, HandTool, type HexOrientation, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, IndexedDBAdapter, type IndexedDBAdapterOptions, LaserTool, type LaserToolOptions, type Layer, LayerManager, LocalStorageAdapter, MeasureTool, type MeasureToolOptions, type Measurement, MemoryAdapter, type NoteElement, NoteTool, type NoteToolOptions, PencilTool, type PencilToolOptions, type Point, type PointerState, type RenderStatsSnapshot, type RotateDirection, SelectTool, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type ShortcutBindings, type ShortcutOptions, type ShortcutsApi, type Size, type StorageAdapter, type StrokeElement, type StrokePoint, type TemplateElement, type TemplateRenderStyle, 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, exportSvg, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getElementBounds, getElementStyle, getElementsBoundingBox, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInRectangle, getHexCellsInSquare, getHexDistance, isNearBezier, setFontSize, smartSnap, snapPoint, snapToHexCenter, styleToPatch, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline };
package/dist/index.d.ts CHANGED
@@ -1123,6 +1123,6 @@ declare class LaserTool implements Tool {
1123
1123
  private notifyOptionsChange;
1124
1124
  }
1125
1125
 
1126
- declare const VERSION = "0.50.4";
1126
+ declare const VERSION = "0.50.6";
1127
1127
 
1128
1128
  export { type ActiveFormats, type AlignEdge, type ArrowElement, type ArrowStrokeStyle, 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, type ElementChangeMeta, ElementStore, type ElementStyle, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, type ExportImageOptions, type ExportSvgOptions, type FontSizePreset, type GridElement, type GridInfo, HandTool, type HexOrientation, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, IndexedDBAdapter, type IndexedDBAdapterOptions, LaserTool, type LaserToolOptions, type Layer, LayerManager, LocalStorageAdapter, MeasureTool, type MeasureToolOptions, type Measurement, MemoryAdapter, type NoteElement, NoteTool, type NoteToolOptions, PencilTool, type PencilToolOptions, type Point, type PointerState, type RenderStatsSnapshot, type RotateDirection, SelectTool, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type ShortcutBindings, type ShortcutOptions, type ShortcutsApi, type Size, type StorageAdapter, type StrokeElement, type StrokePoint, type TemplateElement, type TemplateRenderStyle, 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, exportSvg, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getElementBounds, getElementStyle, getElementsBoundingBox, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInRectangle, getHexCellsInSquare, getHexDistance, isNearBezier, setFontSize, smartSnap, snapPoint, snapToHexCenter, styleToPatch, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline };
package/dist/index.js CHANGED
@@ -1867,7 +1867,7 @@ var InputHandler = class {
1867
1867
  if (this.activePointers.has(e.pointerId)) {
1868
1868
  this.activePointers.set(e.pointerId, { x: e.clientX, y: e.clientY });
1869
1869
  }
1870
- if (this.activePointers.size === 2) {
1870
+ if (this.activePointers.size >= 2) {
1871
1871
  this.handlePinchMove();
1872
1872
  return;
1873
1873
  }
@@ -1901,9 +1901,15 @@ var InputHandler = class {
1901
1901
  this.element.releasePointerCapture(e.pointerId);
1902
1902
  } catch {
1903
1903
  }
1904
- this.activePointers.delete(e.pointerId);
1905
- if (this.activePointers.size < 2) {
1904
+ const removedActivePointer = this.activePointers.delete(e.pointerId);
1905
+ if (removedActivePointer && this.activePointers.size >= 2) {
1906
+ this.startPinch();
1907
+ } else if (this.activePointers.size < 2) {
1906
1908
  this.lastPinchDistance = 0;
1909
+ const remainingPointer = this.activePointers.values().next().value;
1910
+ if (remainingPointer && this.isPanning) {
1911
+ this.lastPointer = { ...remainingPointer };
1912
+ }
1907
1913
  }
1908
1914
  if (this.isPanning && this.activePointers.size === 0) {
1909
1915
  this.isPanning = false;
@@ -1945,7 +1951,11 @@ var InputHandler = class {
1945
1951
  if (this.lastPinchDistance > 0) {
1946
1952
  const scale = dist / this.lastPinchDistance;
1947
1953
  const newZoom = this.camera.zoom * scale;
1948
- this.camera.zoomAt(newZoom, center2);
1954
+ const rect = this.element.getBoundingClientRect();
1955
+ this.camera.zoomAt(newZoom, {
1956
+ x: center2.x - rect.left,
1957
+ y: center2.y - rect.top
1958
+ });
1949
1959
  }
1950
1960
  const dx = center2.x - this.lastPointer.x;
1951
1961
  const dy = center2.y - this.lastPointer.y;
@@ -10627,7 +10637,7 @@ var LaserTool = class {
10627
10637
  };
10628
10638
 
10629
10639
  // src/index.ts
10630
- var VERSION = "0.50.4";
10640
+ var VERSION = "0.50.6";
10631
10641
  export {
10632
10642
  ArrowTool,
10633
10643
  AutoSave,