@fieldnotes/core 0.34.0 → 0.35.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
@@ -22,6 +22,9 @@ interface BaseElement {
22
22
  layerId: string;
23
23
  /** Optional flat group membership. Elements sharing a groupId select/move/delete as a unit. */
24
24
  groupId?: string;
25
+ /** Rotation in radians (clockwise) about the element's center. Absent = 0 (unrotated).
26
+ * Applied to note/text/image/html/shape/stroke; ignored for arrow/grid/template. */
27
+ rotation?: number;
25
28
  }
26
29
  interface StrokeElement extends BaseElement {
27
30
  type: 'stroke';
@@ -171,6 +174,7 @@ declare class ElementStore {
171
174
  getElementsByType<T extends ElementType>(type: T): Extract<CanvasElement, {
172
175
  type: T;
173
176
  }>[];
177
+ private indexBounds;
174
178
  add(element: CanvasElement): void;
175
179
  update(id: string, partial: Partial<CanvasElement>): void;
176
180
  remove(id: string): void;
@@ -782,9 +786,14 @@ declare class SelectTool implements Tool {
782
786
  private updateHoverCursor;
783
787
  private setHovered;
784
788
  private handleResize;
789
+ private anchorOffset;
790
+ private handleRotatedResize;
785
791
  private hitTestResizeHandle;
792
+ private hitTestRotateHandle;
786
793
  private hitTestLineHandles;
787
794
  private getHandlePositions;
795
+ private getOverlayLayout;
796
+ private topMidpoint;
788
797
  private renderMarquee;
789
798
  private renderSelectionBoxes;
790
799
  private renderBindingHighlights;
@@ -992,6 +1001,6 @@ declare class TemplateTool implements Tool {
992
1001
  private notifyOptionsChange;
993
1002
  }
994
1003
 
995
- declare const VERSION = "0.34.0";
1004
+ declare const VERSION = "0.35.0";
996
1005
 
997
1006
  export { type ActiveFormats, type AlignEdge, type ArrowElement, 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, ElementStore, type ElementStyle, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, type ExportImageOptions, type FontSizePreset, type GridElement, type GridInfo, HandTool, type HexOrientation, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, type Layer, LayerManager, MeasureTool, type MeasureToolOptions, type Measurement, 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 StrokeElement, type StrokePoint, type TemplateElement, 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, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getElementBounds, getElementStyle, getElementsBoundingBox, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInSquare, getHexDistance, isNearBezier, setFontSize, smartSnap, snapPoint, snapToHexCenter, styleToPatch, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline };
package/dist/index.d.ts CHANGED
@@ -22,6 +22,9 @@ interface BaseElement {
22
22
  layerId: string;
23
23
  /** Optional flat group membership. Elements sharing a groupId select/move/delete as a unit. */
24
24
  groupId?: string;
25
+ /** Rotation in radians (clockwise) about the element's center. Absent = 0 (unrotated).
26
+ * Applied to note/text/image/html/shape/stroke; ignored for arrow/grid/template. */
27
+ rotation?: number;
25
28
  }
26
29
  interface StrokeElement extends BaseElement {
27
30
  type: 'stroke';
@@ -171,6 +174,7 @@ declare class ElementStore {
171
174
  getElementsByType<T extends ElementType>(type: T): Extract<CanvasElement, {
172
175
  type: T;
173
176
  }>[];
177
+ private indexBounds;
174
178
  add(element: CanvasElement): void;
175
179
  update(id: string, partial: Partial<CanvasElement>): void;
176
180
  remove(id: string): void;
@@ -782,9 +786,14 @@ declare class SelectTool implements Tool {
782
786
  private updateHoverCursor;
783
787
  private setHovered;
784
788
  private handleResize;
789
+ private anchorOffset;
790
+ private handleRotatedResize;
785
791
  private hitTestResizeHandle;
792
+ private hitTestRotateHandle;
786
793
  private hitTestLineHandles;
787
794
  private getHandlePositions;
795
+ private getOverlayLayout;
796
+ private topMidpoint;
788
797
  private renderMarquee;
789
798
  private renderSelectionBoxes;
790
799
  private renderBindingHighlights;
@@ -992,6 +1001,6 @@ declare class TemplateTool implements Tool {
992
1001
  private notifyOptionsChange;
993
1002
  }
994
1003
 
995
- declare const VERSION = "0.34.0";
1004
+ declare const VERSION = "0.35.0";
996
1005
 
997
1006
  export { type ActiveFormats, type AlignEdge, type ArrowElement, 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, ElementStore, type ElementStyle, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, type ExportImageOptions, type FontSizePreset, type GridElement, type GridInfo, HandTool, type HexOrientation, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, type Layer, LayerManager, MeasureTool, type MeasureToolOptions, type Measurement, 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 StrokeElement, type StrokePoint, type TemplateElement, 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, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getElementBounds, getElementStyle, getElementsBoundingBox, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInSquare, getHexDistance, isNearBezier, setFontSize, smartSnap, snapPoint, snapToHexCenter, styleToPatch, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline };