@fieldnotes/core 0.21.0 → 0.23.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
@@ -574,6 +574,10 @@ interface RenderStatsSnapshot {
574
574
  p95FrameMs: number;
575
575
  lastFrameMs: number;
576
576
  lastGridMs: number;
577
+ layersMs: number;
578
+ backgroundMs: number;
579
+ compositeMs: number;
580
+ overlayMs: number;
577
581
  frameCount: number;
578
582
  }
579
583
 
@@ -599,6 +603,8 @@ interface ViewportOptions {
599
603
  src: string;
600
604
  elementIds: string[];
601
605
  }) => void;
606
+ /** CSS-pixel margin cached beyond the viewport. Default `256`. Set `0` to disable. */
607
+ panBufferMargin?: number;
602
608
  }
603
609
  declare class Viewport {
604
610
  private readonly container;
@@ -618,6 +624,7 @@ declare class Viewport {
618
624
  private readonly noteEditor;
619
625
  private readonly historyRecorder;
620
626
  readonly toolContext: ToolContext;
627
+ private readonly marginViewport;
621
628
  private resizeObserver;
622
629
  private _snapToGrid;
623
630
  private readonly _gridSize;
@@ -704,11 +711,18 @@ declare class ElementRenderer {
704
711
  private canvasSize;
705
712
  private hexTileCache;
706
713
  private hexTileCacheKey;
714
+ private gridBoundsOverride;
707
715
  setStore(store: ElementStore): void;
708
716
  setOnImageLoad(callback: () => void): void;
709
717
  setOnImageError(callback: (src: string) => void): void;
710
718
  setCamera(camera: Camera): void;
711
719
  setCanvasSize(w: number, h: number): void;
720
+ setGridBoundsOverride(bounds: {
721
+ minX: number;
722
+ minY: number;
723
+ maxX: number;
724
+ maxY: number;
725
+ } | null): void;
712
726
  isDomElement(element: CanvasElement): boolean;
713
727
  renderCanvasElement(ctx: CanvasRenderingContext2D, element: CanvasElement): void;
714
728
  private renderStroke;
@@ -1247,6 +1261,6 @@ declare class UpdateLayerCommand implements Command {
1247
1261
  undo(_store: ElementStore): void;
1248
1262
  }
1249
1263
 
1250
- declare const VERSION = "0.21.0";
1264
+ declare const VERSION = "0.23.0";
1251
1265
 
1252
1266
  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 InputHandlerOptions, 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 ShortcutBindings, type ShortcutOptions, type ShortcutsApi, 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, isNoteContentEmpty, parseState, sanitizeNoteHtml, setFontSize, smartSnap, snapPoint, snapToHexCenter, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline, unbindArrow, updateBoundArrow };
package/dist/index.d.ts CHANGED
@@ -574,6 +574,10 @@ interface RenderStatsSnapshot {
574
574
  p95FrameMs: number;
575
575
  lastFrameMs: number;
576
576
  lastGridMs: number;
577
+ layersMs: number;
578
+ backgroundMs: number;
579
+ compositeMs: number;
580
+ overlayMs: number;
577
581
  frameCount: number;
578
582
  }
579
583
 
@@ -599,6 +603,8 @@ interface ViewportOptions {
599
603
  src: string;
600
604
  elementIds: string[];
601
605
  }) => void;
606
+ /** CSS-pixel margin cached beyond the viewport. Default `256`. Set `0` to disable. */
607
+ panBufferMargin?: number;
602
608
  }
603
609
  declare class Viewport {
604
610
  private readonly container;
@@ -618,6 +624,7 @@ declare class Viewport {
618
624
  private readonly noteEditor;
619
625
  private readonly historyRecorder;
620
626
  readonly toolContext: ToolContext;
627
+ private readonly marginViewport;
621
628
  private resizeObserver;
622
629
  private _snapToGrid;
623
630
  private readonly _gridSize;
@@ -704,11 +711,18 @@ declare class ElementRenderer {
704
711
  private canvasSize;
705
712
  private hexTileCache;
706
713
  private hexTileCacheKey;
714
+ private gridBoundsOverride;
707
715
  setStore(store: ElementStore): void;
708
716
  setOnImageLoad(callback: () => void): void;
709
717
  setOnImageError(callback: (src: string) => void): void;
710
718
  setCamera(camera: Camera): void;
711
719
  setCanvasSize(w: number, h: number): void;
720
+ setGridBoundsOverride(bounds: {
721
+ minX: number;
722
+ minY: number;
723
+ maxX: number;
724
+ maxY: number;
725
+ } | null): void;
712
726
  isDomElement(element: CanvasElement): boolean;
713
727
  renderCanvasElement(ctx: CanvasRenderingContext2D, element: CanvasElement): void;
714
728
  private renderStroke;
@@ -1247,6 +1261,6 @@ declare class UpdateLayerCommand implements Command {
1247
1261
  undo(_store: ElementStore): void;
1248
1262
  }
1249
1263
 
1250
- declare const VERSION = "0.21.0";
1264
+ declare const VERSION = "0.23.0";
1251
1265
 
1252
1266
  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 InputHandlerOptions, 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 ShortcutBindings, type ShortcutOptions, type ShortcutsApi, 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, isNoteContentEmpty, parseState, sanitizeNoteHtml, setFontSize, smartSnap, snapPoint, snapToHexCenter, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline, unbindArrow, updateBoundArrow };