@fieldnotes/core 0.20.0 → 0.22.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 +9 -0
- package/dist/index.cjs +323 -139
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +323 -139
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -574,6 +574,10 @@ interface RenderStatsSnapshot {
|
|
|
574
574
|
p95FrameMs: number;
|
|
575
575
|
lastFrameMs: number;
|
|
576
576
|
lastGridMs: number;
|
|
577
|
+
layersMs: number;
|
|
578
|
+
backgroundMs: number;
|
|
579
|
+
compositeMs: number;
|
|
580
|
+
overlayMs: number;
|
|
577
581
|
frameCount: number;
|
|
578
582
|
}
|
|
579
583
|
|
|
@@ -595,6 +599,10 @@ interface ViewportOptions {
|
|
|
595
599
|
x: number;
|
|
596
600
|
y: number;
|
|
597
601
|
}) => void;
|
|
602
|
+
onImageError?: (info: {
|
|
603
|
+
src: string;
|
|
604
|
+
elementIds: string[];
|
|
605
|
+
}) => void;
|
|
598
606
|
}
|
|
599
607
|
declare class Viewport {
|
|
600
608
|
private readonly container;
|
|
@@ -695,12 +703,14 @@ declare class ElementRenderer {
|
|
|
695
703
|
private store;
|
|
696
704
|
private imageCache;
|
|
697
705
|
private onImageLoad;
|
|
706
|
+
private onImageError;
|
|
698
707
|
private camera;
|
|
699
708
|
private canvasSize;
|
|
700
709
|
private hexTileCache;
|
|
701
710
|
private hexTileCacheKey;
|
|
702
711
|
setStore(store: ElementStore): void;
|
|
703
712
|
setOnImageLoad(callback: () => void): void;
|
|
713
|
+
setOnImageError(callback: (src: string) => void): void;
|
|
704
714
|
setCamera(camera: Camera): void;
|
|
705
715
|
setCanvasSize(w: number, h: number): void;
|
|
706
716
|
isDomElement(element: CanvasElement): boolean;
|
|
@@ -718,6 +728,7 @@ declare class ElementRenderer {
|
|
|
718
728
|
private renderHexTemplate;
|
|
719
729
|
private renderRadiusMarker;
|
|
720
730
|
private renderImage;
|
|
731
|
+
private renderImagePlaceholder;
|
|
721
732
|
private getHexTile;
|
|
722
733
|
private getImage;
|
|
723
734
|
}
|
|
@@ -1240,6 +1251,6 @@ declare class UpdateLayerCommand implements Command {
|
|
|
1240
1251
|
undo(_store: ElementStore): void;
|
|
1241
1252
|
}
|
|
1242
1253
|
|
|
1243
|
-
declare const VERSION = "0.
|
|
1254
|
+
declare const VERSION = "0.22.0";
|
|
1244
1255
|
|
|
1245
1256
|
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 InputHandlerOptions, 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 ShortcutBindings, type ShortcutOptions, type ShortcutsApi, 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, isNoteContentEmpty, parseState, sanitizeNoteHtml, setFontSize, smartSnap, snapPoint, snapToHexCenter, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline, unbindArrow, updateBoundArrow };
|
package/dist/index.d.ts
CHANGED
|
@@ -574,6 +574,10 @@ interface RenderStatsSnapshot {
|
|
|
574
574
|
p95FrameMs: number;
|
|
575
575
|
lastFrameMs: number;
|
|
576
576
|
lastGridMs: number;
|
|
577
|
+
layersMs: number;
|
|
578
|
+
backgroundMs: number;
|
|
579
|
+
compositeMs: number;
|
|
580
|
+
overlayMs: number;
|
|
577
581
|
frameCount: number;
|
|
578
582
|
}
|
|
579
583
|
|
|
@@ -595,6 +599,10 @@ interface ViewportOptions {
|
|
|
595
599
|
x: number;
|
|
596
600
|
y: number;
|
|
597
601
|
}) => void;
|
|
602
|
+
onImageError?: (info: {
|
|
603
|
+
src: string;
|
|
604
|
+
elementIds: string[];
|
|
605
|
+
}) => void;
|
|
598
606
|
}
|
|
599
607
|
declare class Viewport {
|
|
600
608
|
private readonly container;
|
|
@@ -695,12 +703,14 @@ declare class ElementRenderer {
|
|
|
695
703
|
private store;
|
|
696
704
|
private imageCache;
|
|
697
705
|
private onImageLoad;
|
|
706
|
+
private onImageError;
|
|
698
707
|
private camera;
|
|
699
708
|
private canvasSize;
|
|
700
709
|
private hexTileCache;
|
|
701
710
|
private hexTileCacheKey;
|
|
702
711
|
setStore(store: ElementStore): void;
|
|
703
712
|
setOnImageLoad(callback: () => void): void;
|
|
713
|
+
setOnImageError(callback: (src: string) => void): void;
|
|
704
714
|
setCamera(camera: Camera): void;
|
|
705
715
|
setCanvasSize(w: number, h: number): void;
|
|
706
716
|
isDomElement(element: CanvasElement): boolean;
|
|
@@ -718,6 +728,7 @@ declare class ElementRenderer {
|
|
|
718
728
|
private renderHexTemplate;
|
|
719
729
|
private renderRadiusMarker;
|
|
720
730
|
private renderImage;
|
|
731
|
+
private renderImagePlaceholder;
|
|
721
732
|
private getHexTile;
|
|
722
733
|
private getImage;
|
|
723
734
|
}
|
|
@@ -1240,6 +1251,6 @@ declare class UpdateLayerCommand implements Command {
|
|
|
1240
1251
|
undo(_store: ElementStore): void;
|
|
1241
1252
|
}
|
|
1242
1253
|
|
|
1243
|
-
declare const VERSION = "0.
|
|
1254
|
+
declare const VERSION = "0.22.0";
|
|
1244
1255
|
|
|
1245
1256
|
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 InputHandlerOptions, 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 ShortcutBindings, type ShortcutOptions, type ShortcutsApi, 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, isNoteContentEmpty, parseState, sanitizeNoteHtml, setFontSize, smartSnap, snapPoint, snapToHexCenter, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline, unbindArrow, updateBoundArrow };
|