@fieldnotes/core 0.46.1 → 0.48.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
@@ -107,13 +107,16 @@ interface GridElement extends BaseElement {
107
107
  strokeWidth: number;
108
108
  opacity: number;
109
109
  }
110
- type TemplateShape = 'circle' | 'cone' | 'line' | 'square';
110
+ type TemplateShape = 'circle' | 'cone' | 'line' | 'square' | 'rectangle';
111
111
  type TemplateRenderStyle = 'cells' | 'geometric';
112
112
  interface TemplateElement extends BaseElement {
113
113
  type: 'template';
114
114
  templateShape: TemplateShape;
115
115
  radius: number;
116
116
  angle: number;
117
+ /** Rectangle-only: full perpendicular extent in world units (centered on the aim axis).
118
+ * Absent for other shapes. Distinct from strokeWidth. */
119
+ width?: number;
117
120
  fillColor: string;
118
121
  strokeColor: string;
119
122
  strokeWidth: number;
@@ -745,6 +748,7 @@ interface TemplateInput extends BaseDefaults {
745
748
  templateShape: TemplateShape;
746
749
  radius: number;
747
750
  angle?: number;
751
+ width?: number;
748
752
  fillColor?: string;
749
753
  strokeColor?: string;
750
754
  strokeWidth?: number;
@@ -771,6 +775,7 @@ declare function getHexDistance(a: Point, b: Point, cellSize: number, orientatio
771
775
  declare function getHexCellsInRadius(center: Point, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
772
776
  declare function getHexCellsInCone(center: Point, angle: number, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
773
777
  declare function getHexCellsInLine(center: Point, angle: number, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
778
+ declare function getHexCellsInRectangle(center: Point, angle: number, lengthCells: number, widthCells: number, cellSize: number, orientation: HexOrientation): Point[];
774
779
  declare function getHexCellsInSquare(center: Point, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
775
780
  declare function drawHexPath(ctx: CanvasRenderingContext2D, cx: number, cy: number, cellSize: number, orientation: HexOrientation): void;
776
781
 
@@ -1057,6 +1062,7 @@ declare class TemplateTool implements Tool {
1057
1062
  private gridType;
1058
1063
  private hexOrientation;
1059
1064
  private snapEnabled;
1065
+ private feetScaleUnit;
1060
1066
  private templateShape;
1061
1067
  private fillColor;
1062
1068
  private strokeColor;
@@ -1078,6 +1084,7 @@ declare class TemplateTool implements Tool {
1078
1084
  private renderHexOverlay;
1079
1085
  private computeRadius;
1080
1086
  private computeAngle;
1087
+ private drawFeetLabel;
1081
1088
  private snapToGrid;
1082
1089
  private notifyOptionsChange;
1083
1090
  }
@@ -1113,6 +1120,6 @@ declare class LaserTool implements Tool {
1113
1120
  private notifyOptionsChange;
1114
1121
  }
1115
1122
 
1116
- declare const VERSION = "0.46.1";
1123
+ declare const VERSION = "0.48.0";
1117
1124
 
1118
- 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, 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, getHexCellsInSquare, getHexDistance, isNearBezier, setFontSize, smartSnap, snapPoint, snapToHexCenter, styleToPatch, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline };
1125
+ 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, 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
@@ -107,13 +107,16 @@ interface GridElement extends BaseElement {
107
107
  strokeWidth: number;
108
108
  opacity: number;
109
109
  }
110
- type TemplateShape = 'circle' | 'cone' | 'line' | 'square';
110
+ type TemplateShape = 'circle' | 'cone' | 'line' | 'square' | 'rectangle';
111
111
  type TemplateRenderStyle = 'cells' | 'geometric';
112
112
  interface TemplateElement extends BaseElement {
113
113
  type: 'template';
114
114
  templateShape: TemplateShape;
115
115
  radius: number;
116
116
  angle: number;
117
+ /** Rectangle-only: full perpendicular extent in world units (centered on the aim axis).
118
+ * Absent for other shapes. Distinct from strokeWidth. */
119
+ width?: number;
117
120
  fillColor: string;
118
121
  strokeColor: string;
119
122
  strokeWidth: number;
@@ -745,6 +748,7 @@ interface TemplateInput extends BaseDefaults {
745
748
  templateShape: TemplateShape;
746
749
  radius: number;
747
750
  angle?: number;
751
+ width?: number;
748
752
  fillColor?: string;
749
753
  strokeColor?: string;
750
754
  strokeWidth?: number;
@@ -771,6 +775,7 @@ declare function getHexDistance(a: Point, b: Point, cellSize: number, orientatio
771
775
  declare function getHexCellsInRadius(center: Point, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
772
776
  declare function getHexCellsInCone(center: Point, angle: number, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
773
777
  declare function getHexCellsInLine(center: Point, angle: number, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
778
+ declare function getHexCellsInRectangle(center: Point, angle: number, lengthCells: number, widthCells: number, cellSize: number, orientation: HexOrientation): Point[];
774
779
  declare function getHexCellsInSquare(center: Point, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
775
780
  declare function drawHexPath(ctx: CanvasRenderingContext2D, cx: number, cy: number, cellSize: number, orientation: HexOrientation): void;
776
781
 
@@ -1057,6 +1062,7 @@ declare class TemplateTool implements Tool {
1057
1062
  private gridType;
1058
1063
  private hexOrientation;
1059
1064
  private snapEnabled;
1065
+ private feetScaleUnit;
1060
1066
  private templateShape;
1061
1067
  private fillColor;
1062
1068
  private strokeColor;
@@ -1078,6 +1084,7 @@ declare class TemplateTool implements Tool {
1078
1084
  private renderHexOverlay;
1079
1085
  private computeRadius;
1080
1086
  private computeAngle;
1087
+ private drawFeetLabel;
1081
1088
  private snapToGrid;
1082
1089
  private notifyOptionsChange;
1083
1090
  }
@@ -1113,6 +1120,6 @@ declare class LaserTool implements Tool {
1113
1120
  private notifyOptionsChange;
1114
1121
  }
1115
1122
 
1116
- declare const VERSION = "0.46.1";
1123
+ declare const VERSION = "0.48.0";
1117
1124
 
1118
- 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, 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, getHexCellsInSquare, getHexDistance, isNearBezier, setFontSize, smartSnap, snapPoint, snapToHexCenter, styleToPatch, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline };
1125
+ 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, 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 };