@fieldnotes/core 0.33.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/README.md +648 -620
- package/dist/index.cjs +413 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +413 -73
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -20,6 +20,11 @@ interface BaseElement {
|
|
|
20
20
|
zIndex: number;
|
|
21
21
|
locked: boolean;
|
|
22
22
|
layerId: string;
|
|
23
|
+
/** Optional flat group membership. Elements sharing a groupId select/move/delete as a unit. */
|
|
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;
|
|
23
28
|
}
|
|
24
29
|
interface StrokeElement extends BaseElement {
|
|
25
30
|
type: 'stroke';
|
|
@@ -169,6 +174,7 @@ declare class ElementStore {
|
|
|
169
174
|
getElementsByType<T extends ElementType>(type: T): Extract<CanvasElement, {
|
|
170
175
|
type: T;
|
|
171
176
|
}>[];
|
|
177
|
+
private indexBounds;
|
|
172
178
|
add(element: CanvasElement): void;
|
|
173
179
|
update(id: string, partial: Partial<CanvasElement>): void;
|
|
174
180
|
remove(id: string): void;
|
|
@@ -523,6 +529,8 @@ declare class Viewport {
|
|
|
523
529
|
onSelectionChange(listener: () => void): () => void;
|
|
524
530
|
getSelectionStyle(): ElementStyle | null;
|
|
525
531
|
applyStyleToSelection(style: ElementStyle): void;
|
|
532
|
+
groupSelection(): void;
|
|
533
|
+
ungroupSelection(): void;
|
|
526
534
|
alignSelection(edge: AlignEdge): void;
|
|
527
535
|
distributeSelection(axis: DistributeAxis): void;
|
|
528
536
|
private boundedSelection;
|
|
@@ -778,9 +786,14 @@ declare class SelectTool implements Tool {
|
|
|
778
786
|
private updateHoverCursor;
|
|
779
787
|
private setHovered;
|
|
780
788
|
private handleResize;
|
|
789
|
+
private anchorOffset;
|
|
790
|
+
private handleRotatedResize;
|
|
781
791
|
private hitTestResizeHandle;
|
|
792
|
+
private hitTestRotateHandle;
|
|
782
793
|
private hitTestLineHandles;
|
|
783
794
|
private getHandlePositions;
|
|
795
|
+
private getOverlayLayout;
|
|
796
|
+
private topMidpoint;
|
|
784
797
|
private renderMarquee;
|
|
785
798
|
private renderSelectionBoxes;
|
|
786
799
|
private renderBindingHighlights;
|
|
@@ -988,6 +1001,6 @@ declare class TemplateTool implements Tool {
|
|
|
988
1001
|
private notifyOptionsChange;
|
|
989
1002
|
}
|
|
990
1003
|
|
|
991
|
-
declare const VERSION = "0.
|
|
1004
|
+
declare const VERSION = "0.35.0";
|
|
992
1005
|
|
|
993
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
|
@@ -20,6 +20,11 @@ interface BaseElement {
|
|
|
20
20
|
zIndex: number;
|
|
21
21
|
locked: boolean;
|
|
22
22
|
layerId: string;
|
|
23
|
+
/** Optional flat group membership. Elements sharing a groupId select/move/delete as a unit. */
|
|
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;
|
|
23
28
|
}
|
|
24
29
|
interface StrokeElement extends BaseElement {
|
|
25
30
|
type: 'stroke';
|
|
@@ -169,6 +174,7 @@ declare class ElementStore {
|
|
|
169
174
|
getElementsByType<T extends ElementType>(type: T): Extract<CanvasElement, {
|
|
170
175
|
type: T;
|
|
171
176
|
}>[];
|
|
177
|
+
private indexBounds;
|
|
172
178
|
add(element: CanvasElement): void;
|
|
173
179
|
update(id: string, partial: Partial<CanvasElement>): void;
|
|
174
180
|
remove(id: string): void;
|
|
@@ -523,6 +529,8 @@ declare class Viewport {
|
|
|
523
529
|
onSelectionChange(listener: () => void): () => void;
|
|
524
530
|
getSelectionStyle(): ElementStyle | null;
|
|
525
531
|
applyStyleToSelection(style: ElementStyle): void;
|
|
532
|
+
groupSelection(): void;
|
|
533
|
+
ungroupSelection(): void;
|
|
526
534
|
alignSelection(edge: AlignEdge): void;
|
|
527
535
|
distributeSelection(axis: DistributeAxis): void;
|
|
528
536
|
private boundedSelection;
|
|
@@ -778,9 +786,14 @@ declare class SelectTool implements Tool {
|
|
|
778
786
|
private updateHoverCursor;
|
|
779
787
|
private setHovered;
|
|
780
788
|
private handleResize;
|
|
789
|
+
private anchorOffset;
|
|
790
|
+
private handleRotatedResize;
|
|
781
791
|
private hitTestResizeHandle;
|
|
792
|
+
private hitTestRotateHandle;
|
|
782
793
|
private hitTestLineHandles;
|
|
783
794
|
private getHandlePositions;
|
|
795
|
+
private getOverlayLayout;
|
|
796
|
+
private topMidpoint;
|
|
784
797
|
private renderMarquee;
|
|
785
798
|
private renderSelectionBoxes;
|
|
786
799
|
private renderBindingHighlights;
|
|
@@ -988,6 +1001,6 @@ declare class TemplateTool implements Tool {
|
|
|
988
1001
|
private notifyOptionsChange;
|
|
989
1002
|
}
|
|
990
1003
|
|
|
991
|
-
declare const VERSION = "0.
|
|
1004
|
+
declare const VERSION = "0.35.0";
|
|
992
1005
|
|
|
993
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 };
|