@fieldnotes/core 0.37.0 → 0.38.1
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/README.md +19 -0
- package/dist/index.cjs +564 -509
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -18
- package/dist/index.d.ts +16 -18
- package/dist/index.js +564 -509
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -514,6 +514,21 @@ declare class Viewport {
|
|
|
514
514
|
w: number;
|
|
515
515
|
h: number;
|
|
516
516
|
}): string;
|
|
517
|
+
addShape(opts?: {
|
|
518
|
+
shape?: ShapeKind;
|
|
519
|
+
size?: {
|
|
520
|
+
w: number;
|
|
521
|
+
h: number;
|
|
522
|
+
};
|
|
523
|
+
position?: {
|
|
524
|
+
x: number;
|
|
525
|
+
y: number;
|
|
526
|
+
};
|
|
527
|
+
strokeColor?: string;
|
|
528
|
+
fillColor?: string;
|
|
529
|
+
strokeWidth?: number;
|
|
530
|
+
}): string;
|
|
531
|
+
private centeredPosition;
|
|
517
532
|
removeLayer(id: string): void;
|
|
518
533
|
updateHtmlElement(id: string, newContent: HTMLElement): void;
|
|
519
534
|
addGrid(input: {
|
|
@@ -789,31 +804,14 @@ declare class SelectTool implements Tool {
|
|
|
789
804
|
onPointerUp(_state: PointerState, ctx: ToolContext): void;
|
|
790
805
|
onHover(state: PointerState, ctx: ToolContext): void;
|
|
791
806
|
renderOverlay(canvasCtx: CanvasRenderingContext2D): void;
|
|
792
|
-
private renderGuideLines;
|
|
793
807
|
private updateArrowsBoundTo;
|
|
794
808
|
nudgeSelection(dx: number, dy: number, ctx: ToolContext): boolean;
|
|
795
809
|
private updateHoverCursor;
|
|
796
810
|
private setHovered;
|
|
797
811
|
private handleResize;
|
|
798
|
-
private anchorOffset;
|
|
799
|
-
private handleRotatedResize;
|
|
800
|
-
private hitTestResizeHandle;
|
|
801
|
-
private hitTestRotateHandle;
|
|
802
|
-
private hitTestLineHandles;
|
|
803
|
-
private getHandlePositions;
|
|
804
812
|
private getOverlayLayout;
|
|
805
|
-
private topMidpoint;
|
|
806
|
-
private renderMarquee;
|
|
807
|
-
private renderSelectionBoxes;
|
|
808
|
-
private drawLockBadge;
|
|
809
|
-
private renderBindingHighlights;
|
|
810
|
-
private hitTestTemplateResizeHandle;
|
|
811
813
|
private handleTemplateResize;
|
|
812
814
|
private getMarqueeRect;
|
|
813
|
-
private findElementsInRect;
|
|
814
|
-
private rectsOverlap;
|
|
815
|
-
private hitTest;
|
|
816
|
-
private isInsideBounds;
|
|
817
815
|
}
|
|
818
816
|
|
|
819
817
|
interface ArrowToolOptions {
|
|
@@ -1011,6 +1009,6 @@ declare class TemplateTool implements Tool {
|
|
|
1011
1009
|
private notifyOptionsChange;
|
|
1012
1010
|
}
|
|
1013
1011
|
|
|
1014
|
-
declare const VERSION = "0.
|
|
1012
|
+
declare const VERSION = "0.38.0";
|
|
1015
1013
|
|
|
1016
1014
|
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
|
@@ -514,6 +514,21 @@ declare class Viewport {
|
|
|
514
514
|
w: number;
|
|
515
515
|
h: number;
|
|
516
516
|
}): string;
|
|
517
|
+
addShape(opts?: {
|
|
518
|
+
shape?: ShapeKind;
|
|
519
|
+
size?: {
|
|
520
|
+
w: number;
|
|
521
|
+
h: number;
|
|
522
|
+
};
|
|
523
|
+
position?: {
|
|
524
|
+
x: number;
|
|
525
|
+
y: number;
|
|
526
|
+
};
|
|
527
|
+
strokeColor?: string;
|
|
528
|
+
fillColor?: string;
|
|
529
|
+
strokeWidth?: number;
|
|
530
|
+
}): string;
|
|
531
|
+
private centeredPosition;
|
|
517
532
|
removeLayer(id: string): void;
|
|
518
533
|
updateHtmlElement(id: string, newContent: HTMLElement): void;
|
|
519
534
|
addGrid(input: {
|
|
@@ -789,31 +804,14 @@ declare class SelectTool implements Tool {
|
|
|
789
804
|
onPointerUp(_state: PointerState, ctx: ToolContext): void;
|
|
790
805
|
onHover(state: PointerState, ctx: ToolContext): void;
|
|
791
806
|
renderOverlay(canvasCtx: CanvasRenderingContext2D): void;
|
|
792
|
-
private renderGuideLines;
|
|
793
807
|
private updateArrowsBoundTo;
|
|
794
808
|
nudgeSelection(dx: number, dy: number, ctx: ToolContext): boolean;
|
|
795
809
|
private updateHoverCursor;
|
|
796
810
|
private setHovered;
|
|
797
811
|
private handleResize;
|
|
798
|
-
private anchorOffset;
|
|
799
|
-
private handleRotatedResize;
|
|
800
|
-
private hitTestResizeHandle;
|
|
801
|
-
private hitTestRotateHandle;
|
|
802
|
-
private hitTestLineHandles;
|
|
803
|
-
private getHandlePositions;
|
|
804
812
|
private getOverlayLayout;
|
|
805
|
-
private topMidpoint;
|
|
806
|
-
private renderMarquee;
|
|
807
|
-
private renderSelectionBoxes;
|
|
808
|
-
private drawLockBadge;
|
|
809
|
-
private renderBindingHighlights;
|
|
810
|
-
private hitTestTemplateResizeHandle;
|
|
811
813
|
private handleTemplateResize;
|
|
812
814
|
private getMarqueeRect;
|
|
813
|
-
private findElementsInRect;
|
|
814
|
-
private rectsOverlap;
|
|
815
|
-
private hitTest;
|
|
816
|
-
private isInsideBounds;
|
|
817
815
|
}
|
|
818
816
|
|
|
819
817
|
interface ArrowToolOptions {
|
|
@@ -1011,6 +1009,6 @@ declare class TemplateTool implements Tool {
|
|
|
1011
1009
|
private notifyOptionsChange;
|
|
1012
1010
|
}
|
|
1013
1011
|
|
|
1014
|
-
declare const VERSION = "0.
|
|
1012
|
+
declare const VERSION = "0.38.0";
|
|
1015
1013
|
|
|
1016
1014
|
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 };
|