@fieldnotes/core 0.50.5 → 0.50.7
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.cjs +16 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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.
|
|
1126
|
+
declare const VERSION = "0.50.7";
|
|
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.
|
|
1126
|
+
declare const VERSION = "0.50.7";
|
|
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
|
|
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
|
|
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;
|
|
@@ -6409,7 +6415,7 @@ var RenderLoop = class {
|
|
|
6409
6415
|
layerGroups = /* @__PURE__ */ new Map();
|
|
6410
6416
|
gridCacheCanvas = null;
|
|
6411
6417
|
gridCacheCtx = null;
|
|
6412
|
-
|
|
6418
|
+
lastGridRefs = [];
|
|
6413
6419
|
constructor(deps) {
|
|
6414
6420
|
this.canvasEl = deps.canvasEl;
|
|
6415
6421
|
this.camera = deps.camera;
|
|
@@ -6609,8 +6615,8 @@ var RenderLoop = class {
|
|
|
6609
6615
|
}
|
|
6610
6616
|
if (gridElements.length > 0) {
|
|
6611
6617
|
const gridT0 = performance.now();
|
|
6612
|
-
const
|
|
6613
|
-
const gridDirty = this.gridCacheDirty ||
|
|
6618
|
+
const gridsChanged = gridElements.length !== this.lastGridRefs.length || gridElements.some((grid, index) => grid !== this.lastGridRefs[index]);
|
|
6619
|
+
const gridDirty = this.gridCacheDirty || gridsChanged;
|
|
6614
6620
|
if (gridDirty) {
|
|
6615
6621
|
this.ensureGridCache();
|
|
6616
6622
|
if (this.gridCacheCtx && this.gridCacheCanvas) {
|
|
@@ -6638,7 +6644,7 @@ var RenderLoop = class {
|
|
|
6638
6644
|
}
|
|
6639
6645
|
}
|
|
6640
6646
|
this.gridCacheDirty = false;
|
|
6641
|
-
this.
|
|
6647
|
+
this.lastGridRefs = [...gridElements];
|
|
6642
6648
|
}
|
|
6643
6649
|
if (this.gridCacheCanvas) {
|
|
6644
6650
|
const offset = this.marginViewport.compositeOffset(
|
|
@@ -6658,6 +6664,8 @@ var RenderLoop = class {
|
|
|
6658
6664
|
}
|
|
6659
6665
|
}
|
|
6660
6666
|
gridMs = performance.now() - gridT0;
|
|
6667
|
+
} else {
|
|
6668
|
+
this.lastGridRefs = [];
|
|
6661
6669
|
}
|
|
6662
6670
|
const overlayT0 = performance.now();
|
|
6663
6671
|
const activeTool = this.toolManager.activeTool;
|
|
@@ -10631,7 +10639,7 @@ var LaserTool = class {
|
|
|
10631
10639
|
};
|
|
10632
10640
|
|
|
10633
10641
|
// src/index.ts
|
|
10634
|
-
var VERSION = "0.50.
|
|
10642
|
+
var VERSION = "0.50.7";
|
|
10635
10643
|
export {
|
|
10636
10644
|
ArrowTool,
|
|
10637
10645
|
AutoSave,
|