@fieldnotes/core 0.47.0 → 0.49.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.cjs +369 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.js +368 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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;
|
|
@@ -484,6 +487,8 @@ interface ElementStyle {
|
|
|
484
487
|
declare function styleToPatch(element: CanvasElement, style: ElementStyle): Partial<CanvasElement>;
|
|
485
488
|
declare function getElementStyle(element: CanvasElement): ElementStyle;
|
|
486
489
|
|
|
490
|
+
type RotateDirection = 'cw' | 'ccw';
|
|
491
|
+
|
|
487
492
|
type AlignEdge = 'left' | 'center-x' | 'right' | 'top' | 'middle' | 'bottom';
|
|
488
493
|
type DistributeAxis = 'horizontal' | 'vertical';
|
|
489
494
|
|
|
@@ -638,6 +643,7 @@ declare class Viewport {
|
|
|
638
643
|
toggleLockSelection(): void;
|
|
639
644
|
alignSelection(edge: AlignEdge): void;
|
|
640
645
|
distributeSelection(axis: DistributeAxis): void;
|
|
646
|
+
rotateSelection(direction: RotateDirection): void;
|
|
641
647
|
getRenderStats(): RenderStatsSnapshot;
|
|
642
648
|
logPerformance(intervalMs?: number): () => void;
|
|
643
649
|
destroy(): void;
|
|
@@ -745,6 +751,7 @@ interface TemplateInput extends BaseDefaults {
|
|
|
745
751
|
templateShape: TemplateShape;
|
|
746
752
|
radius: number;
|
|
747
753
|
angle?: number;
|
|
754
|
+
width?: number;
|
|
748
755
|
fillColor?: string;
|
|
749
756
|
strokeColor?: string;
|
|
750
757
|
strokeWidth?: number;
|
|
@@ -771,6 +778,7 @@ declare function getHexDistance(a: Point, b: Point, cellSize: number, orientatio
|
|
|
771
778
|
declare function getHexCellsInRadius(center: Point, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
|
|
772
779
|
declare function getHexCellsInCone(center: Point, angle: number, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
|
|
773
780
|
declare function getHexCellsInLine(center: Point, angle: number, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
|
|
781
|
+
declare function getHexCellsInRectangle(center: Point, angle: number, lengthCells: number, widthCells: number, cellSize: number, orientation: HexOrientation): Point[];
|
|
774
782
|
declare function getHexCellsInSquare(center: Point, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
|
|
775
783
|
declare function drawHexPath(ctx: CanvasRenderingContext2D, cx: number, cy: number, cellSize: number, orientation: HexOrientation): void;
|
|
776
784
|
|
|
@@ -1115,6 +1123,6 @@ declare class LaserTool implements Tool {
|
|
|
1115
1123
|
private notifyOptionsChange;
|
|
1116
1124
|
}
|
|
1117
1125
|
|
|
1118
|
-
declare const VERSION = "0.
|
|
1126
|
+
declare const VERSION = "0.49.0";
|
|
1119
1127
|
|
|
1120
|
-
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 };
|
|
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
|
@@ -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;
|
|
@@ -484,6 +487,8 @@ interface ElementStyle {
|
|
|
484
487
|
declare function styleToPatch(element: CanvasElement, style: ElementStyle): Partial<CanvasElement>;
|
|
485
488
|
declare function getElementStyle(element: CanvasElement): ElementStyle;
|
|
486
489
|
|
|
490
|
+
type RotateDirection = 'cw' | 'ccw';
|
|
491
|
+
|
|
487
492
|
type AlignEdge = 'left' | 'center-x' | 'right' | 'top' | 'middle' | 'bottom';
|
|
488
493
|
type DistributeAxis = 'horizontal' | 'vertical';
|
|
489
494
|
|
|
@@ -638,6 +643,7 @@ declare class Viewport {
|
|
|
638
643
|
toggleLockSelection(): void;
|
|
639
644
|
alignSelection(edge: AlignEdge): void;
|
|
640
645
|
distributeSelection(axis: DistributeAxis): void;
|
|
646
|
+
rotateSelection(direction: RotateDirection): void;
|
|
641
647
|
getRenderStats(): RenderStatsSnapshot;
|
|
642
648
|
logPerformance(intervalMs?: number): () => void;
|
|
643
649
|
destroy(): void;
|
|
@@ -745,6 +751,7 @@ interface TemplateInput extends BaseDefaults {
|
|
|
745
751
|
templateShape: TemplateShape;
|
|
746
752
|
radius: number;
|
|
747
753
|
angle?: number;
|
|
754
|
+
width?: number;
|
|
748
755
|
fillColor?: string;
|
|
749
756
|
strokeColor?: string;
|
|
750
757
|
strokeWidth?: number;
|
|
@@ -771,6 +778,7 @@ declare function getHexDistance(a: Point, b: Point, cellSize: number, orientatio
|
|
|
771
778
|
declare function getHexCellsInRadius(center: Point, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
|
|
772
779
|
declare function getHexCellsInCone(center: Point, angle: number, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
|
|
773
780
|
declare function getHexCellsInLine(center: Point, angle: number, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
|
|
781
|
+
declare function getHexCellsInRectangle(center: Point, angle: number, lengthCells: number, widthCells: number, cellSize: number, orientation: HexOrientation): Point[];
|
|
774
782
|
declare function getHexCellsInSquare(center: Point, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
|
|
775
783
|
declare function drawHexPath(ctx: CanvasRenderingContext2D, cx: number, cy: number, cellSize: number, orientation: HexOrientation): void;
|
|
776
784
|
|
|
@@ -1115,6 +1123,6 @@ declare class LaserTool implements Tool {
|
|
|
1115
1123
|
private notifyOptionsChange;
|
|
1116
1124
|
}
|
|
1117
1125
|
|
|
1118
|
-
declare const VERSION = "0.
|
|
1126
|
+
declare const VERSION = "0.49.0";
|
|
1119
1127
|
|
|
1120
|
-
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 };
|
|
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 };
|