@fieldnotes/core 0.13.0 → 0.15.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 +523 -50
- package/dist/index.d.cts +74 -4
- package/dist/index.d.ts +74 -4
- package/dist/index.js +520 -50
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -85,6 +85,7 @@ interface HtmlElement extends BaseElement {
|
|
|
85
85
|
type: 'html';
|
|
86
86
|
size: Size;
|
|
87
87
|
domId?: string;
|
|
88
|
+
interactive?: boolean;
|
|
88
89
|
}
|
|
89
90
|
interface TextElement extends BaseElement {
|
|
90
91
|
type: 'text';
|
|
@@ -146,11 +147,12 @@ interface CanvasState {
|
|
|
146
147
|
};
|
|
147
148
|
elements: CanvasElement[];
|
|
148
149
|
layers?: Layer[];
|
|
150
|
+
activeLayerId?: string;
|
|
149
151
|
}
|
|
150
152
|
declare function exportState(elements: CanvasElement[], camera: {
|
|
151
153
|
position: Point;
|
|
152
154
|
zoom: number;
|
|
153
|
-
}, layers?: Layer[]): CanvasState;
|
|
155
|
+
}, layers?: Layer[], activeLayerId?: string): CanvasState;
|
|
154
156
|
declare function parseState(json: string): CanvasState;
|
|
155
157
|
|
|
156
158
|
interface CameraOptions {
|
|
@@ -178,6 +180,7 @@ declare class Camera {
|
|
|
178
180
|
screenToWorld(screen: Point): Point;
|
|
179
181
|
worldToScreen(world: Point): Point;
|
|
180
182
|
getVisibleRect(canvasWidth: number, canvasHeight: number): Bounds;
|
|
183
|
+
fitToContent(boundingBox: Bounds, canvasWidth: number, canvasHeight: number, padding?: number): void;
|
|
181
184
|
toCSSTransform(): string;
|
|
182
185
|
onChange(listener: (info: CameraChangeInfo) => void): () => void;
|
|
183
186
|
private notifyPan;
|
|
@@ -200,7 +203,10 @@ declare class ElementStore {
|
|
|
200
203
|
private bus;
|
|
201
204
|
private layerOrderMap;
|
|
202
205
|
private spatialIndex;
|
|
206
|
+
private sortedCache;
|
|
207
|
+
private _versions;
|
|
203
208
|
get count(): number;
|
|
209
|
+
getVersion(id: string): number;
|
|
204
210
|
setLayerOrder(order: Map<string, number>): void;
|
|
205
211
|
getAll(): CanvasElement[];
|
|
206
212
|
getById(id: string): CanvasElement | undefined;
|
|
@@ -213,6 +219,10 @@ declare class ElementStore {
|
|
|
213
219
|
clear(): void;
|
|
214
220
|
snapshot(): CanvasElement[];
|
|
215
221
|
loadSnapshot(elements: CanvasElement[]): void;
|
|
222
|
+
bringToFront(id: string): void;
|
|
223
|
+
sendToBack(id: string): void;
|
|
224
|
+
bringForward(id: string): void;
|
|
225
|
+
sendBackward(id: string): void;
|
|
216
226
|
queryRect(rect: Bounds): CanvasElement[];
|
|
217
227
|
queryPoint(point: Point): CanvasElement[];
|
|
218
228
|
on<K extends keyof ElementStoreEvents>(event: K, listener: (data: ElementStoreEvents[K]) => void): () => void;
|
|
@@ -238,6 +248,8 @@ interface PointerState {
|
|
|
238
248
|
x: number;
|
|
239
249
|
y: number;
|
|
240
250
|
pressure: number;
|
|
251
|
+
pointerType: 'mouse' | 'touch' | 'pen';
|
|
252
|
+
shiftKey: boolean;
|
|
241
253
|
}
|
|
242
254
|
interface Tool {
|
|
243
255
|
readonly name: string;
|
|
@@ -293,6 +305,7 @@ interface AutoSaveOptions {
|
|
|
293
305
|
key?: string;
|
|
294
306
|
debounceMs?: number;
|
|
295
307
|
layerManager?: LayerManager;
|
|
308
|
+
onError?: (error: Error) => void;
|
|
296
309
|
}
|
|
297
310
|
declare class AutoSave {
|
|
298
311
|
private readonly store;
|
|
@@ -302,6 +315,7 @@ declare class AutoSave {
|
|
|
302
315
|
private readonly layerManager?;
|
|
303
316
|
private timerId;
|
|
304
317
|
private unsubscribers;
|
|
318
|
+
private readonly onError?;
|
|
305
319
|
constructor(store: ElementStore, camera: Camera, options?: AutoSaveOptions);
|
|
306
320
|
start(): void;
|
|
307
321
|
stop(): void;
|
|
@@ -423,7 +437,12 @@ declare class InputHandler {
|
|
|
423
437
|
private historyRecorder;
|
|
424
438
|
private historyStack;
|
|
425
439
|
private isToolActive;
|
|
440
|
+
private lastPointerEvent;
|
|
441
|
+
private readonly inputFilter;
|
|
442
|
+
private deferredDown;
|
|
426
443
|
private readonly abortController;
|
|
444
|
+
private clipboard;
|
|
445
|
+
private pasteCount;
|
|
427
446
|
constructor(element: HTMLElement, camera: Camera, options?: InputHandlerOptions);
|
|
428
447
|
setToolManager(toolManager: ToolManager, toolContext: ToolContext): void;
|
|
429
448
|
destroy(): void;
|
|
@@ -447,9 +466,49 @@ declare class InputHandler {
|
|
|
447
466
|
private deleteSelected;
|
|
448
467
|
private handleUndo;
|
|
449
468
|
private handleRedo;
|
|
469
|
+
private handleCopy;
|
|
470
|
+
private handlePaste;
|
|
471
|
+
private handleZOrder;
|
|
450
472
|
private cancelToolIfActive;
|
|
451
473
|
}
|
|
452
474
|
|
|
475
|
+
type FilterAction = 'dispatch' | 'suppress' | 'defer';
|
|
476
|
+
interface FilteredEvent {
|
|
477
|
+
event: PointerEvent;
|
|
478
|
+
action: FilterAction;
|
|
479
|
+
}
|
|
480
|
+
interface FilteredUpEvent extends FilteredEvent {
|
|
481
|
+
pendingTap?: {
|
|
482
|
+
x: number;
|
|
483
|
+
y: number;
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
declare class InputFilter {
|
|
487
|
+
private activePenId;
|
|
488
|
+
private pendingTap;
|
|
489
|
+
static readonly MIN_MOVE_DISTANCE = 3;
|
|
490
|
+
filterDown(e: PointerEvent): FilteredEvent;
|
|
491
|
+
filterMove(e: PointerEvent): FilteredEvent;
|
|
492
|
+
filterUp(e: PointerEvent): FilteredUpEvent;
|
|
493
|
+
reset(): void;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
interface DoubleTapDetectorOptions {
|
|
497
|
+
timeout?: number;
|
|
498
|
+
maxDistance?: number;
|
|
499
|
+
}
|
|
500
|
+
declare class DoubleTapDetector {
|
|
501
|
+
private readonly timeout;
|
|
502
|
+
private readonly maxDistance;
|
|
503
|
+
private lastTapTime;
|
|
504
|
+
private lastTapX;
|
|
505
|
+
private lastTapY;
|
|
506
|
+
private hasPendingTap;
|
|
507
|
+
constructor(options?: DoubleTapDetectorOptions);
|
|
508
|
+
feed(e: PointerEvent): boolean;
|
|
509
|
+
reset(): void;
|
|
510
|
+
}
|
|
511
|
+
|
|
453
512
|
interface FontSizePreset {
|
|
454
513
|
label: string;
|
|
455
514
|
size: number;
|
|
@@ -526,6 +585,9 @@ declare class Viewport {
|
|
|
526
585
|
private readonly domNodeManager;
|
|
527
586
|
private readonly interactMode;
|
|
528
587
|
private readonly gridChangeListeners;
|
|
588
|
+
private readonly doubleTapDetector;
|
|
589
|
+
private tapDownX;
|
|
590
|
+
private tapDownY;
|
|
529
591
|
constructor(container: HTMLElement, options?: ViewportOptions);
|
|
530
592
|
get ctx(): CanvasRenderingContext2D | null;
|
|
531
593
|
get snapToGrid(): boolean;
|
|
@@ -569,7 +631,8 @@ declare class Viewport {
|
|
|
569
631
|
destroy(): void;
|
|
570
632
|
private startEditingElement;
|
|
571
633
|
private onTextEditStop;
|
|
572
|
-
private
|
|
634
|
+
private onTapDown;
|
|
635
|
+
private onDoubleTap;
|
|
573
636
|
private hitTestWorld;
|
|
574
637
|
stopInteracting(): void;
|
|
575
638
|
private onDragOver;
|
|
@@ -706,6 +769,7 @@ interface HtmlInput extends BaseDefaults {
|
|
|
706
769
|
position: Point;
|
|
707
770
|
size: Size;
|
|
708
771
|
domId?: string;
|
|
772
|
+
interactive?: boolean;
|
|
709
773
|
}
|
|
710
774
|
interface TextInput extends BaseDefaults {
|
|
711
775
|
position: Point;
|
|
@@ -772,6 +836,8 @@ declare function unbindArrow(arrow: ArrowElement, store: ElementStore): Partial<
|
|
|
772
836
|
declare function getElementBounds(element: CanvasElement): Bounds | null;
|
|
773
837
|
declare function boundsIntersect(a: Bounds, b: Bounds): boolean;
|
|
774
838
|
|
|
839
|
+
declare function getElementsBoundingBox(elements: CanvasElement[]): Bounds | null;
|
|
840
|
+
|
|
775
841
|
declare function getHexDistance(a: Point, b: Point, cellSize: number, orientation: HexOrientation): number;
|
|
776
842
|
declare function getHexCellsInRadius(center: Point, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
|
|
777
843
|
declare function getHexCellsInCone(center: Point, angle: number, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
|
|
@@ -874,7 +940,11 @@ declare class SelectTool implements Tool {
|
|
|
874
940
|
private lastWorld;
|
|
875
941
|
private currentWorld;
|
|
876
942
|
private ctx;
|
|
943
|
+
private pendingSingleSelectId;
|
|
944
|
+
private hasDragged;
|
|
945
|
+
private resizeAspectRatio;
|
|
877
946
|
get selectedIds(): string[];
|
|
947
|
+
setSelection(ids: string[]): void;
|
|
878
948
|
get isMarqueeActive(): boolean;
|
|
879
949
|
onActivate(ctx: ToolContext): void;
|
|
880
950
|
onDeactivate(ctx: ToolContext): void;
|
|
@@ -1119,6 +1189,6 @@ declare class UpdateLayerCommand implements Command {
|
|
|
1119
1189
|
undo(_store: ElementStore): void;
|
|
1120
1190
|
}
|
|
1121
1191
|
|
|
1122
|
-
declare const VERSION = "0.
|
|
1192
|
+
declare const VERSION = "0.15.0";
|
|
1123
1193
|
|
|
1124
|
-
export { type ActiveFormats, AddElementCommand, type ArrowElement, ArrowTool, type ArrowToolOptions, AutoSave, type AutoSaveOptions, Background, type BackgroundOptions, type BackgroundPattern, BatchCommand, type Binding, type Bounds, Camera, type CameraChangeInfo, type CameraOptions, type CanvasElement, type CanvasState, type Command, CreateLayerCommand, DEFAULT_FONT_SIZE_PRESETS, DEFAULT_NOTE_FONT_SIZE, ElementRenderer, ElementStore, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, EventBus, type ExportImageOptions, type FontSizePreset, type GridElement, type GridInfo, HandTool, type HexOrientation, HistoryRecorder, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, InputHandler, type Layer, LayerManager, MeasureTool, type MeasureToolOptions, type Measurement, NoteEditor, type NoteEditorOptions, type NoteElement, NoteTool, type NoteToolOptions, NoteToolbar, PencilTool, type PencilToolOptions, type Point, type PointerState, Quadtree, RemoveElementCommand, RemoveLayerCommand, type RenderStatsSnapshot, SelectTool, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type Size, type StrokeElement, type StrokePoint, type StyledRun, type TemplateElement, type TemplateShape, TemplateTool, type TemplateToolOptions, type TextElement, TextTool, type TextToolOptions, type Tool, type ToolContext, ToolManager, type ToolName, UpdateElementCommand, UpdateLayerCommand, VERSION, Viewport, type ViewportOptions, boundsIntersect, clearStaleBindings, createArrow, createGrid, createHtmlElement, createId, createImage, createNote, createShape, createStroke, createTemplate, createText, drawHexPath, exportImage, exportState, findBindTarget, findBoundArrows, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getEdgeIntersection, getElementBounds, getElementCenter, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInSquare, getHexDistance, isBindable, isNearBezier, parseState, sanitizeNoteHtml, setFontSize, smartSnap, snapPoint, snapToHexCenter, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline, unbindArrow, updateBoundArrow };
|
|
1194
|
+
export { type ActiveFormats, AddElementCommand, type ArrowElement, ArrowTool, type ArrowToolOptions, AutoSave, type AutoSaveOptions, Background, type BackgroundOptions, type BackgroundPattern, BatchCommand, type Binding, type Bounds, Camera, type CameraChangeInfo, type CameraOptions, type CanvasElement, type CanvasState, type Command, CreateLayerCommand, DEFAULT_FONT_SIZE_PRESETS, DEFAULT_NOTE_FONT_SIZE, DoubleTapDetector, type DoubleTapDetectorOptions, ElementRenderer, ElementStore, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, EventBus, type ExportImageOptions, type FilterAction, type FilteredEvent, type FilteredUpEvent, type FontSizePreset, type GridElement, type GridInfo, HandTool, type HexOrientation, HistoryRecorder, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, InputFilter, InputHandler, type Layer, LayerManager, MeasureTool, type MeasureToolOptions, type Measurement, NoteEditor, type NoteEditorOptions, type NoteElement, NoteTool, type NoteToolOptions, NoteToolbar, PencilTool, type PencilToolOptions, type Point, type PointerState, Quadtree, RemoveElementCommand, RemoveLayerCommand, type RenderStatsSnapshot, SelectTool, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type Size, type StrokeElement, type StrokePoint, type StyledRun, type TemplateElement, type TemplateShape, TemplateTool, type TemplateToolOptions, type TextElement, TextTool, type TextToolOptions, type Tool, type ToolContext, ToolManager, type ToolName, UpdateElementCommand, UpdateLayerCommand, VERSION, Viewport, type ViewportOptions, boundsIntersect, clearStaleBindings, createArrow, createGrid, createHtmlElement, createId, createImage, createNote, createShape, createStroke, createTemplate, createText, drawHexPath, exportImage, exportState, findBindTarget, findBoundArrows, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getEdgeIntersection, getElementBounds, getElementCenter, getElementsBoundingBox, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInSquare, getHexDistance, isBindable, isNearBezier, parseState, sanitizeNoteHtml, setFontSize, smartSnap, snapPoint, snapToHexCenter, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline, unbindArrow, updateBoundArrow };
|
package/dist/index.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ interface HtmlElement extends BaseElement {
|
|
|
85
85
|
type: 'html';
|
|
86
86
|
size: Size;
|
|
87
87
|
domId?: string;
|
|
88
|
+
interactive?: boolean;
|
|
88
89
|
}
|
|
89
90
|
interface TextElement extends BaseElement {
|
|
90
91
|
type: 'text';
|
|
@@ -146,11 +147,12 @@ interface CanvasState {
|
|
|
146
147
|
};
|
|
147
148
|
elements: CanvasElement[];
|
|
148
149
|
layers?: Layer[];
|
|
150
|
+
activeLayerId?: string;
|
|
149
151
|
}
|
|
150
152
|
declare function exportState(elements: CanvasElement[], camera: {
|
|
151
153
|
position: Point;
|
|
152
154
|
zoom: number;
|
|
153
|
-
}, layers?: Layer[]): CanvasState;
|
|
155
|
+
}, layers?: Layer[], activeLayerId?: string): CanvasState;
|
|
154
156
|
declare function parseState(json: string): CanvasState;
|
|
155
157
|
|
|
156
158
|
interface CameraOptions {
|
|
@@ -178,6 +180,7 @@ declare class Camera {
|
|
|
178
180
|
screenToWorld(screen: Point): Point;
|
|
179
181
|
worldToScreen(world: Point): Point;
|
|
180
182
|
getVisibleRect(canvasWidth: number, canvasHeight: number): Bounds;
|
|
183
|
+
fitToContent(boundingBox: Bounds, canvasWidth: number, canvasHeight: number, padding?: number): void;
|
|
181
184
|
toCSSTransform(): string;
|
|
182
185
|
onChange(listener: (info: CameraChangeInfo) => void): () => void;
|
|
183
186
|
private notifyPan;
|
|
@@ -200,7 +203,10 @@ declare class ElementStore {
|
|
|
200
203
|
private bus;
|
|
201
204
|
private layerOrderMap;
|
|
202
205
|
private spatialIndex;
|
|
206
|
+
private sortedCache;
|
|
207
|
+
private _versions;
|
|
203
208
|
get count(): number;
|
|
209
|
+
getVersion(id: string): number;
|
|
204
210
|
setLayerOrder(order: Map<string, number>): void;
|
|
205
211
|
getAll(): CanvasElement[];
|
|
206
212
|
getById(id: string): CanvasElement | undefined;
|
|
@@ -213,6 +219,10 @@ declare class ElementStore {
|
|
|
213
219
|
clear(): void;
|
|
214
220
|
snapshot(): CanvasElement[];
|
|
215
221
|
loadSnapshot(elements: CanvasElement[]): void;
|
|
222
|
+
bringToFront(id: string): void;
|
|
223
|
+
sendToBack(id: string): void;
|
|
224
|
+
bringForward(id: string): void;
|
|
225
|
+
sendBackward(id: string): void;
|
|
216
226
|
queryRect(rect: Bounds): CanvasElement[];
|
|
217
227
|
queryPoint(point: Point): CanvasElement[];
|
|
218
228
|
on<K extends keyof ElementStoreEvents>(event: K, listener: (data: ElementStoreEvents[K]) => void): () => void;
|
|
@@ -238,6 +248,8 @@ interface PointerState {
|
|
|
238
248
|
x: number;
|
|
239
249
|
y: number;
|
|
240
250
|
pressure: number;
|
|
251
|
+
pointerType: 'mouse' | 'touch' | 'pen';
|
|
252
|
+
shiftKey: boolean;
|
|
241
253
|
}
|
|
242
254
|
interface Tool {
|
|
243
255
|
readonly name: string;
|
|
@@ -293,6 +305,7 @@ interface AutoSaveOptions {
|
|
|
293
305
|
key?: string;
|
|
294
306
|
debounceMs?: number;
|
|
295
307
|
layerManager?: LayerManager;
|
|
308
|
+
onError?: (error: Error) => void;
|
|
296
309
|
}
|
|
297
310
|
declare class AutoSave {
|
|
298
311
|
private readonly store;
|
|
@@ -302,6 +315,7 @@ declare class AutoSave {
|
|
|
302
315
|
private readonly layerManager?;
|
|
303
316
|
private timerId;
|
|
304
317
|
private unsubscribers;
|
|
318
|
+
private readonly onError?;
|
|
305
319
|
constructor(store: ElementStore, camera: Camera, options?: AutoSaveOptions);
|
|
306
320
|
start(): void;
|
|
307
321
|
stop(): void;
|
|
@@ -423,7 +437,12 @@ declare class InputHandler {
|
|
|
423
437
|
private historyRecorder;
|
|
424
438
|
private historyStack;
|
|
425
439
|
private isToolActive;
|
|
440
|
+
private lastPointerEvent;
|
|
441
|
+
private readonly inputFilter;
|
|
442
|
+
private deferredDown;
|
|
426
443
|
private readonly abortController;
|
|
444
|
+
private clipboard;
|
|
445
|
+
private pasteCount;
|
|
427
446
|
constructor(element: HTMLElement, camera: Camera, options?: InputHandlerOptions);
|
|
428
447
|
setToolManager(toolManager: ToolManager, toolContext: ToolContext): void;
|
|
429
448
|
destroy(): void;
|
|
@@ -447,9 +466,49 @@ declare class InputHandler {
|
|
|
447
466
|
private deleteSelected;
|
|
448
467
|
private handleUndo;
|
|
449
468
|
private handleRedo;
|
|
469
|
+
private handleCopy;
|
|
470
|
+
private handlePaste;
|
|
471
|
+
private handleZOrder;
|
|
450
472
|
private cancelToolIfActive;
|
|
451
473
|
}
|
|
452
474
|
|
|
475
|
+
type FilterAction = 'dispatch' | 'suppress' | 'defer';
|
|
476
|
+
interface FilteredEvent {
|
|
477
|
+
event: PointerEvent;
|
|
478
|
+
action: FilterAction;
|
|
479
|
+
}
|
|
480
|
+
interface FilteredUpEvent extends FilteredEvent {
|
|
481
|
+
pendingTap?: {
|
|
482
|
+
x: number;
|
|
483
|
+
y: number;
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
declare class InputFilter {
|
|
487
|
+
private activePenId;
|
|
488
|
+
private pendingTap;
|
|
489
|
+
static readonly MIN_MOVE_DISTANCE = 3;
|
|
490
|
+
filterDown(e: PointerEvent): FilteredEvent;
|
|
491
|
+
filterMove(e: PointerEvent): FilteredEvent;
|
|
492
|
+
filterUp(e: PointerEvent): FilteredUpEvent;
|
|
493
|
+
reset(): void;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
interface DoubleTapDetectorOptions {
|
|
497
|
+
timeout?: number;
|
|
498
|
+
maxDistance?: number;
|
|
499
|
+
}
|
|
500
|
+
declare class DoubleTapDetector {
|
|
501
|
+
private readonly timeout;
|
|
502
|
+
private readonly maxDistance;
|
|
503
|
+
private lastTapTime;
|
|
504
|
+
private lastTapX;
|
|
505
|
+
private lastTapY;
|
|
506
|
+
private hasPendingTap;
|
|
507
|
+
constructor(options?: DoubleTapDetectorOptions);
|
|
508
|
+
feed(e: PointerEvent): boolean;
|
|
509
|
+
reset(): void;
|
|
510
|
+
}
|
|
511
|
+
|
|
453
512
|
interface FontSizePreset {
|
|
454
513
|
label: string;
|
|
455
514
|
size: number;
|
|
@@ -526,6 +585,9 @@ declare class Viewport {
|
|
|
526
585
|
private readonly domNodeManager;
|
|
527
586
|
private readonly interactMode;
|
|
528
587
|
private readonly gridChangeListeners;
|
|
588
|
+
private readonly doubleTapDetector;
|
|
589
|
+
private tapDownX;
|
|
590
|
+
private tapDownY;
|
|
529
591
|
constructor(container: HTMLElement, options?: ViewportOptions);
|
|
530
592
|
get ctx(): CanvasRenderingContext2D | null;
|
|
531
593
|
get snapToGrid(): boolean;
|
|
@@ -569,7 +631,8 @@ declare class Viewport {
|
|
|
569
631
|
destroy(): void;
|
|
570
632
|
private startEditingElement;
|
|
571
633
|
private onTextEditStop;
|
|
572
|
-
private
|
|
634
|
+
private onTapDown;
|
|
635
|
+
private onDoubleTap;
|
|
573
636
|
private hitTestWorld;
|
|
574
637
|
stopInteracting(): void;
|
|
575
638
|
private onDragOver;
|
|
@@ -706,6 +769,7 @@ interface HtmlInput extends BaseDefaults {
|
|
|
706
769
|
position: Point;
|
|
707
770
|
size: Size;
|
|
708
771
|
domId?: string;
|
|
772
|
+
interactive?: boolean;
|
|
709
773
|
}
|
|
710
774
|
interface TextInput extends BaseDefaults {
|
|
711
775
|
position: Point;
|
|
@@ -772,6 +836,8 @@ declare function unbindArrow(arrow: ArrowElement, store: ElementStore): Partial<
|
|
|
772
836
|
declare function getElementBounds(element: CanvasElement): Bounds | null;
|
|
773
837
|
declare function boundsIntersect(a: Bounds, b: Bounds): boolean;
|
|
774
838
|
|
|
839
|
+
declare function getElementsBoundingBox(elements: CanvasElement[]): Bounds | null;
|
|
840
|
+
|
|
775
841
|
declare function getHexDistance(a: Point, b: Point, cellSize: number, orientation: HexOrientation): number;
|
|
776
842
|
declare function getHexCellsInRadius(center: Point, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
|
|
777
843
|
declare function getHexCellsInCone(center: Point, angle: number, radiusCells: number, cellSize: number, orientation: HexOrientation): Point[];
|
|
@@ -874,7 +940,11 @@ declare class SelectTool implements Tool {
|
|
|
874
940
|
private lastWorld;
|
|
875
941
|
private currentWorld;
|
|
876
942
|
private ctx;
|
|
943
|
+
private pendingSingleSelectId;
|
|
944
|
+
private hasDragged;
|
|
945
|
+
private resizeAspectRatio;
|
|
877
946
|
get selectedIds(): string[];
|
|
947
|
+
setSelection(ids: string[]): void;
|
|
878
948
|
get isMarqueeActive(): boolean;
|
|
879
949
|
onActivate(ctx: ToolContext): void;
|
|
880
950
|
onDeactivate(ctx: ToolContext): void;
|
|
@@ -1119,6 +1189,6 @@ declare class UpdateLayerCommand implements Command {
|
|
|
1119
1189
|
undo(_store: ElementStore): void;
|
|
1120
1190
|
}
|
|
1121
1191
|
|
|
1122
|
-
declare const VERSION = "0.
|
|
1192
|
+
declare const VERSION = "0.15.0";
|
|
1123
1193
|
|
|
1124
|
-
export { type ActiveFormats, AddElementCommand, type ArrowElement, ArrowTool, type ArrowToolOptions, AutoSave, type AutoSaveOptions, Background, type BackgroundOptions, type BackgroundPattern, BatchCommand, type Binding, type Bounds, Camera, type CameraChangeInfo, type CameraOptions, type CanvasElement, type CanvasState, type Command, CreateLayerCommand, DEFAULT_FONT_SIZE_PRESETS, DEFAULT_NOTE_FONT_SIZE, ElementRenderer, ElementStore, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, EventBus, type ExportImageOptions, type FontSizePreset, type GridElement, type GridInfo, HandTool, type HexOrientation, HistoryRecorder, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, InputHandler, type Layer, LayerManager, MeasureTool, type MeasureToolOptions, type Measurement, NoteEditor, type NoteEditorOptions, type NoteElement, NoteTool, type NoteToolOptions, NoteToolbar, PencilTool, type PencilToolOptions, type Point, type PointerState, Quadtree, RemoveElementCommand, RemoveLayerCommand, type RenderStatsSnapshot, SelectTool, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type Size, type StrokeElement, type StrokePoint, type StyledRun, type TemplateElement, type TemplateShape, TemplateTool, type TemplateToolOptions, type TextElement, TextTool, type TextToolOptions, type Tool, type ToolContext, ToolManager, type ToolName, UpdateElementCommand, UpdateLayerCommand, VERSION, Viewport, type ViewportOptions, boundsIntersect, clearStaleBindings, createArrow, createGrid, createHtmlElement, createId, createImage, createNote, createShape, createStroke, createTemplate, createText, drawHexPath, exportImage, exportState, findBindTarget, findBoundArrows, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getEdgeIntersection, getElementBounds, getElementCenter, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInSquare, getHexDistance, isBindable, isNearBezier, parseState, sanitizeNoteHtml, setFontSize, smartSnap, snapPoint, snapToHexCenter, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline, unbindArrow, updateBoundArrow };
|
|
1194
|
+
export { type ActiveFormats, AddElementCommand, type ArrowElement, ArrowTool, type ArrowToolOptions, AutoSave, type AutoSaveOptions, Background, type BackgroundOptions, type BackgroundPattern, BatchCommand, type Binding, type Bounds, Camera, type CameraChangeInfo, type CameraOptions, type CanvasElement, type CanvasState, type Command, CreateLayerCommand, DEFAULT_FONT_SIZE_PRESETS, DEFAULT_NOTE_FONT_SIZE, DoubleTapDetector, type DoubleTapDetectorOptions, ElementRenderer, ElementStore, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, EventBus, type ExportImageOptions, type FilterAction, type FilteredEvent, type FilteredUpEvent, type FontSizePreset, type GridElement, type GridInfo, HandTool, type HexOrientation, HistoryRecorder, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, InputFilter, InputHandler, type Layer, LayerManager, MeasureTool, type MeasureToolOptions, type Measurement, NoteEditor, type NoteEditorOptions, type NoteElement, NoteTool, type NoteToolOptions, NoteToolbar, PencilTool, type PencilToolOptions, type Point, type PointerState, Quadtree, RemoveElementCommand, RemoveLayerCommand, type RenderStatsSnapshot, SelectTool, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type Size, type StrokeElement, type StrokePoint, type StyledRun, type TemplateElement, type TemplateShape, TemplateTool, type TemplateToolOptions, type TextElement, TextTool, type TextToolOptions, type Tool, type ToolContext, ToolManager, type ToolName, UpdateElementCommand, UpdateLayerCommand, VERSION, Viewport, type ViewportOptions, boundsIntersect, clearStaleBindings, createArrow, createGrid, createHtmlElement, createId, createImage, createNote, createShape, createStroke, createTemplate, createText, drawHexPath, exportImage, exportState, findBindTarget, findBoundArrows, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getEdgeIntersection, getElementBounds, getElementCenter, getElementsBoundingBox, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInSquare, getHexDistance, isBindable, isNearBezier, parseState, sanitizeNoteHtml, setFontSize, smartSnap, snapPoint, snapToHexCenter, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline, unbindArrow, updateBoundArrow };
|