@fieldnotes/core 0.16.0 → 0.17.0

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
@@ -435,6 +435,7 @@ interface InputHandlerOptions {
435
435
  toolContext?: ToolContext;
436
436
  historyRecorder?: HistoryRecorder;
437
437
  historyStack?: HistoryStack;
438
+ fitToContent?: () => void;
438
439
  }
439
440
  declare class InputHandler {
440
441
  private readonly element;
@@ -454,10 +455,10 @@ declare class InputHandler {
454
455
  private readonly inputFilter;
455
456
  private deferredDown;
456
457
  private readonly abortController;
457
- private clipboard;
458
- private pasteCount;
458
+ private readonly actions;
459
459
  constructor(element: HTMLElement, camera: Camera, options?: InputHandlerOptions);
460
460
  setToolManager(toolManager: ToolManager, toolContext: ToolContext): void;
461
+ flushPendingHistory(): void;
461
462
  destroy(): void;
462
463
  private bind;
463
464
  private onWheel;
@@ -476,12 +477,6 @@ declare class InputHandler {
476
477
  private dispatchToolMove;
477
478
  private dispatchToolHover;
478
479
  private dispatchToolUp;
479
- private deleteSelected;
480
- private handleUndo;
481
- private handleRedo;
482
- private handleCopy;
483
- private handlePaste;
484
- private handleZOrder;
485
480
  private cancelToolIfActive;
486
481
  }
487
482
 
@@ -612,6 +607,7 @@ declare class Viewport {
612
607
  get ctx(): CanvasRenderingContext2D | null;
613
608
  get snapToGrid(): boolean;
614
609
  setSnapToGrid(enabled: boolean): void;
610
+ fitToContent(padding?: number): void;
615
611
  requestRender(): void;
616
612
  exportState(): CanvasState;
617
613
  exportJSON(): string;
@@ -976,6 +972,8 @@ declare class SelectTool implements Tool {
976
972
  onPointerUp(_state: PointerState, ctx: ToolContext): void;
977
973
  onHover(state: PointerState, ctx: ToolContext): void;
978
974
  renderOverlay(canvasCtx: CanvasRenderingContext2D): void;
975
+ private updateArrowsBoundTo;
976
+ nudgeSelection(dx: number, dy: number, ctx: ToolContext): boolean;
979
977
  private updateHoverCursor;
980
978
  private handleResize;
981
979
  private hitTestResizeHandle;
@@ -1211,6 +1209,6 @@ declare class UpdateLayerCommand implements Command {
1211
1209
  undo(_store: ElementStore): void;
1212
1210
  }
1213
1211
 
1214
- declare const VERSION = "0.16.0";
1212
+ declare const VERSION = "0.17.0";
1215
1213
 
1216
1214
  export { type ActiveFormats, AddElementCommand, type ArrowElement, ArrowTool, type ArrowToolOptions, AutoSave, type AutoSaveOptions, Background, type BackgroundOptions, type BackgroundPattern, BatchCommand, type Binding, type Bounds, Camera, type CameraChangeInfo, type CameraOptions, type CanvasElement, type CanvasState, type Command, CreateLayerCommand, DEFAULT_FONT_SIZE_PRESETS, DEFAULT_NOTE_FONT_SIZE, DoubleTapDetector, type DoubleTapDetectorOptions, ElementRenderer, ElementStore, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, EventBus, type ExportImageOptions, type FilterAction, type FilteredEvent, type FilteredUpEvent, type FontSizePreset, type GridElement, type GridInfo, HandTool, type HexOrientation, HistoryRecorder, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, InputFilter, InputHandler, type Layer, LayerManager, MeasureTool, type MeasureToolOptions, type Measurement, NoteEditor, type NoteEditorOptions, type NoteElement, NoteTool, type NoteToolOptions, NoteToolbar, PencilTool, type PencilToolOptions, type Point, type PointerState, Quadtree, RemoveElementCommand, RemoveLayerCommand, type RenderStatsSnapshot, SelectTool, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type Size, type StrokeElement, type StrokePoint, type StyledRun, type TemplateElement, type TemplateShape, TemplateTool, type TemplateToolOptions, type TextElement, TextTool, type TextToolOptions, type Tool, type ToolContext, ToolManager, type ToolName, UpdateElementCommand, UpdateLayerCommand, VERSION, Viewport, type ViewportOptions, boundsIntersect, clearStaleBindings, createArrow, createGrid, createHtmlElement, createId, createImage, createNote, createShape, createStroke, createTemplate, createText, drawHexPath, exportImage, exportState, findBindTarget, findBoundArrows, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getEdgeIntersection, getElementBounds, getElementCenter, getElementsBoundingBox, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInSquare, getHexDistance, isBindable, isNearBezier, parseState, sanitizeNoteHtml, setFontSize, smartSnap, snapPoint, snapToHexCenter, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline, unbindArrow, updateBoundArrow };
package/dist/index.d.ts CHANGED
@@ -435,6 +435,7 @@ interface InputHandlerOptions {
435
435
  toolContext?: ToolContext;
436
436
  historyRecorder?: HistoryRecorder;
437
437
  historyStack?: HistoryStack;
438
+ fitToContent?: () => void;
438
439
  }
439
440
  declare class InputHandler {
440
441
  private readonly element;
@@ -454,10 +455,10 @@ declare class InputHandler {
454
455
  private readonly inputFilter;
455
456
  private deferredDown;
456
457
  private readonly abortController;
457
- private clipboard;
458
- private pasteCount;
458
+ private readonly actions;
459
459
  constructor(element: HTMLElement, camera: Camera, options?: InputHandlerOptions);
460
460
  setToolManager(toolManager: ToolManager, toolContext: ToolContext): void;
461
+ flushPendingHistory(): void;
461
462
  destroy(): void;
462
463
  private bind;
463
464
  private onWheel;
@@ -476,12 +477,6 @@ declare class InputHandler {
476
477
  private dispatchToolMove;
477
478
  private dispatchToolHover;
478
479
  private dispatchToolUp;
479
- private deleteSelected;
480
- private handleUndo;
481
- private handleRedo;
482
- private handleCopy;
483
- private handlePaste;
484
- private handleZOrder;
485
480
  private cancelToolIfActive;
486
481
  }
487
482
 
@@ -612,6 +607,7 @@ declare class Viewport {
612
607
  get ctx(): CanvasRenderingContext2D | null;
613
608
  get snapToGrid(): boolean;
614
609
  setSnapToGrid(enabled: boolean): void;
610
+ fitToContent(padding?: number): void;
615
611
  requestRender(): void;
616
612
  exportState(): CanvasState;
617
613
  exportJSON(): string;
@@ -976,6 +972,8 @@ declare class SelectTool implements Tool {
976
972
  onPointerUp(_state: PointerState, ctx: ToolContext): void;
977
973
  onHover(state: PointerState, ctx: ToolContext): void;
978
974
  renderOverlay(canvasCtx: CanvasRenderingContext2D): void;
975
+ private updateArrowsBoundTo;
976
+ nudgeSelection(dx: number, dy: number, ctx: ToolContext): boolean;
979
977
  private updateHoverCursor;
980
978
  private handleResize;
981
979
  private hitTestResizeHandle;
@@ -1211,6 +1209,6 @@ declare class UpdateLayerCommand implements Command {
1211
1209
  undo(_store: ElementStore): void;
1212
1210
  }
1213
1211
 
1214
- declare const VERSION = "0.16.0";
1212
+ declare const VERSION = "0.17.0";
1215
1213
 
1216
1214
  export { type ActiveFormats, AddElementCommand, type ArrowElement, ArrowTool, type ArrowToolOptions, AutoSave, type AutoSaveOptions, Background, type BackgroundOptions, type BackgroundPattern, BatchCommand, type Binding, type Bounds, Camera, type CameraChangeInfo, type CameraOptions, type CanvasElement, type CanvasState, type Command, CreateLayerCommand, DEFAULT_FONT_SIZE_PRESETS, DEFAULT_NOTE_FONT_SIZE, DoubleTapDetector, type DoubleTapDetectorOptions, ElementRenderer, ElementStore, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, EventBus, type ExportImageOptions, type FilterAction, type FilteredEvent, type FilteredUpEvent, type FontSizePreset, type GridElement, type GridInfo, HandTool, type HexOrientation, HistoryRecorder, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, InputFilter, InputHandler, type Layer, LayerManager, MeasureTool, type MeasureToolOptions, type Measurement, NoteEditor, type NoteEditorOptions, type NoteElement, NoteTool, type NoteToolOptions, NoteToolbar, PencilTool, type PencilToolOptions, type Point, type PointerState, Quadtree, RemoveElementCommand, RemoveLayerCommand, type RenderStatsSnapshot, SelectTool, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type Size, type StrokeElement, type StrokePoint, type StyledRun, type TemplateElement, type TemplateShape, TemplateTool, type TemplateToolOptions, type TextElement, TextTool, type TextToolOptions, type Tool, type ToolContext, ToolManager, type ToolName, UpdateElementCommand, UpdateLayerCommand, VERSION, Viewport, type ViewportOptions, boundsIntersect, clearStaleBindings, createArrow, createGrid, createHtmlElement, createId, createImage, createNote, createShape, createStroke, createTemplate, createText, drawHexPath, exportImage, exportState, findBindTarget, findBoundArrows, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getEdgeIntersection, getElementBounds, getElementCenter, getElementsBoundingBox, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInSquare, getHexDistance, isBindable, isNearBezier, parseState, sanitizeNoteHtml, setFontSize, smartSnap, snapPoint, snapToHexCenter, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline, unbindArrow, updateBoundArrow };