@fieldnotes/core 0.66.0 → 0.68.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
@@ -692,6 +692,42 @@ declare class HtmlPainterRegistry {
692
692
  }
693
693
  declare function resolveHtmlRouting(el: Readonly<HtmlElement>, registry: HtmlPainterRegistry | null, expectedCanvasTypes?: ReadonlySet<string>): HtmlRouting;
694
694
 
695
+ interface FogSolidStyle {
696
+ kind?: 'solid';
697
+ color: string;
698
+ }
699
+ interface FogProceduralStyle {
700
+ kind: 'procedural';
701
+ /** Base fill painted before the noise pattern. Player mode adds an opaque safety layer. */
702
+ backdrop: string;
703
+ /** Canvas-compatible CSS tint mixed into the noise pattern. */
704
+ tint: string;
705
+ /** Overall noise opacity, 0–1. Default `0.6`. */
706
+ opacity?: number;
707
+ /** Pattern scale in world units per tile repeat. 64–1024. Default `256`. */
708
+ scale?: number;
709
+ /** Deterministic seed, 0–65535. Default `0`. */
710
+ seed?: number;
711
+ /** Noise detail / number of octaves, 1–4. Default `2`. */
712
+ detail?: number;
713
+ }
714
+ type FogStyle = FogSolidStyle | FogProceduralStyle;
715
+ interface ResolvedSolidStyle {
716
+ readonly kind: 'solid';
717
+ readonly color: string;
718
+ }
719
+ interface ResolvedProceduralStyle {
720
+ readonly kind: 'procedural';
721
+ readonly backdrop: string;
722
+ readonly tint: string;
723
+ readonly opacity: number;
724
+ readonly scale: number;
725
+ readonly seed: number;
726
+ readonly detail: number;
727
+ }
728
+ type ResolvedFogStyle = ResolvedSolidStyle | ResolvedProceduralStyle;
729
+ declare function resolveFogStyle(style: FogStyle | undefined, legacyColor: string | undefined, defaultColor: string): ResolvedFogStyle;
730
+
695
731
  interface ExportImageOptions extends ExportResourceOptions, HtmlExportOptions {
696
732
  scale?: number;
697
733
  padding?: number;
@@ -741,6 +777,7 @@ interface ExportImageOptions extends ExportResourceOptions, HtmlExportOptions {
741
777
  state: FogStateV1;
742
778
  mode: 'editor' | 'player';
743
779
  color?: string;
780
+ style?: FogStyle;
744
781
  } | false;
745
782
  }
746
783
  type ExportAssetErrorReason = 'load' | 'timeout' | 'encode';
@@ -774,6 +811,7 @@ interface ExportSvgOptions extends ExportResourceOptions, HtmlExportOptions {
774
811
  state: FogStateV1;
775
812
  mode: 'editor' | 'player';
776
813
  color?: string;
814
+ style?: FogStyle;
777
815
  } | false;
778
816
  }
779
817
  declare function exportSvg(store: ElementStore, options?: ExportSvgOptions, layerManager?: LayerManager): Promise<string>;
@@ -803,15 +841,19 @@ interface RenderStatsSnapshot {
803
841
  interface FogRendererOptions {
804
842
  editorColor?: string;
805
843
  playerColor?: string;
844
+ editorStyle?: FogStyle;
845
+ playerStyle?: FogStyle;
806
846
  }
807
847
  declare class FogRenderer {
808
848
  private tileCache;
849
+ private patternCache;
809
850
  private state;
810
851
  private viewMode;
811
852
  private dirty;
812
- private editorColor;
813
- private playerColor;
853
+ private editorStyle;
854
+ private playerStyle;
814
855
  constructor(options?: FogRendererOptions);
856
+ setOptions(options: FogRendererOptions): void;
815
857
  setState(state: FogStateV1 | null): void;
816
858
  setViewMode(mode: FogViewMode): void;
817
859
  getState(): FogStateV1 | null;
@@ -819,9 +861,14 @@ declare class FogRenderer {
819
861
  markDirty(): void;
820
862
  isDirty(): boolean;
821
863
  isVisible(): boolean;
864
+ getResolvedStyle(mode: 'editor' | 'player'): ResolvedFogStyle;
822
865
  render(ctx: CanvasRenderingContext2D, camera: Camera, viewportWidth: number, viewportHeight: number, _dpr: number): void;
823
- renderForExport(ctx: CanvasRenderingContext2D, state: FogStateV1, mode: 'editor' | 'player', color?: string): void;
866
+ renderForExport(ctx: CanvasRenderingContext2D, state: FogStateV1, mode: 'editor' | 'player', color?: string, style?: FogStyle): void;
824
867
  dispose(): void;
868
+ private getOrCreatePattern;
869
+ private createPatternFromTileData;
870
+ private paintProceduralOverlay;
871
+ private renderTileProceduralOverlay;
825
872
  private tileRaster;
826
873
  private renderTile;
827
874
  private renderTileForExport;
@@ -918,10 +965,7 @@ interface ViewportOptions {
918
965
  /** Show an overview minimap (bottom-right) with tap/drag-to-navigate. Default `false`. */
919
966
  minimap?: boolean;
920
967
  /** Fog-of-war presentation options. Enables fog rendering and the `fog` accessor. */
921
- fog?: {
922
- editorColor?: string;
923
- playerColor?: string;
924
- };
968
+ fog?: FogRendererOptions;
925
969
  }
926
970
  interface HitTestOptions {
927
971
  /** Skip elements on locked layers. Default `true` (selection semantics). */
@@ -986,6 +1030,7 @@ declare class Viewport {
986
1030
  constructor(container: HTMLElement, options?: ViewportOptions);
987
1031
  get ctx(): CanvasRenderingContext2D | null;
988
1032
  get fog(): FogManager;
1033
+ setFogStyle(options: FogRendererOptions): void;
989
1034
  get snapToGrid(): boolean;
990
1035
  setSnapToGrid(enabled: boolean): void;
991
1036
  get smartGuides(): boolean;
@@ -1043,6 +1088,11 @@ declare class Viewport {
1043
1088
  * can only add expectations, never shrink the registry's own.
1044
1089
  */
1045
1090
  private withHtmlDefaults;
1091
+ /**
1092
+ * Carry constructor-configured fog presentation into both implicit exports and
1093
+ * explicit state/mode exports. Explicit style and legacy color overrides win.
1094
+ */
1095
+ private withFogDefaults;
1046
1096
  exportImage(options?: ExportImageOptions): Promise<Blob | null>;
1047
1097
  exportSVG(options?: ExportSvgOptions): Promise<string>;
1048
1098
  loadState(state: CanvasState): void;
@@ -3215,6 +3265,6 @@ declare class FogTool implements Tool {
3215
3265
  private renderPolygonPreview;
3216
3266
  }
3217
3267
 
3218
- declare const VERSION = "0.66.0";
3268
+ declare const VERSION = "0.68.0";
3219
3269
 
3220
- export { AWARENESS_MAX_SELECTION, AWARENESS_PRESENCE_KIND, type ActivationOptions, type ActiveFormats, type AlignEdge, type ArrowElement, type ArrowStrokeStyle, ArrowTool, type ArrowToolOptions, type AttachAwarenessOptions, AutoSave, type AutoSaveOptions, type AwarenessFields, type AwarenessHandle, type AwarenessIdentity, type AwarenessPresence, type AwarenessViewport, type BackgroundOptions, type BackgroundPattern, type Binding, type Bounds, Camera, type CameraAnimationEndReason, CameraAnimator, type CameraAnimatorOptions, type CameraChangeInfo, type CameraOptions, type CameraView, type CanvasElement, type CanvasState, type Command, DEFAULT_NOTE_FONT_SIZE, type DiagonalRule, type DistributeAxis, type ElementActivationEvent, type ElementChangeMeta, type ElementRect, type ElementRectMatch, type ElementRectMatchError, ElementRectTracker, type ElementRectTrackerOptions, ElementStore, type ElementStyle, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, type ExportAssetError, type ExportAssetErrorReason, type ExportImageOptions, type ExportResourceOptions, type ExportSvgOptions, FOCUS_PRESENCE_KIND, FOG_MAX_TILES, FOG_STATE_VERSION, FOG_TILE_CELLS, type FocusAudience, type FocusPresence, type FocusRole, type FogBase, type FogChangeEvent, type FogDefinitionV1, type FogIdFactory, FogManager, type FogManagerOptions, type FogOperation, type FogPatch, type FogRegion, FogRenderer, type FogRendererOptions, type FogStateV1, type FogTileV1, FogTool, type FogToolOptions, type FogViewEvent, type FogViewMode, type FontSizePreset, type Footprint, type FrameScheduler, type GridElement, type GridInfo, type GridMetric, HandTool, type HexOrientation, HistoryStack, type HistoryStackOptions, type HitTestOptions, type HtmlElement, type HtmlExportError, type HtmlExportErrorReason, type HtmlExportOptions, type HtmlExportRenderer, type HtmlPaintContext, type HtmlPaintDiagnostic, type HtmlPainter, HtmlPainterMissingError, HtmlPainterRegistry, type HtmlRenderTarget, type HtmlRouting, type ImageElement, ImageTool, type ImageToolOptions, IndexedDBAdapter, type IndexedDBAdapterOptions, LASER_TRAIL_PRESENCE_KIND, LaserTool, type LaserToolOptions, type LaserTrailEmission, type LaserTrailPresence, type Layer, LayerManager, LocalAwareness, type LocalAwarenessHost, type LocalAwarenessOptions, LocalStorageAdapter, MEASURE_PRESENCE_KIND, type MeasureEmission, type MeasurePresence, MeasureTool, type MeasureToolOptions, type Measurement, MemoryAdapter, MinimapController, type MinimapControllerOptions, type NoteElement, NoteTool, type NoteToolOptions, type OverlayRenderer, PATH_PRESENCE_KIND, PATH_PRESENCE_MAX_POINTS, PEER_COLORS, PING_PRESENCE_KIND, type PathAnchor, type PathDistance, type PathEmission, type PathPresence, type PathRangeBand, type PathSegment, PathTool, type PathToolOptions, type Peer, type PeerLeaveReason, PeerRoster, type PeerRosterOptions, PencilTool, type PencilToolOptions, type PingEmission, PingInput, type PingInputHost, type PingInputOptions, type PingPresence, PingTool, type PingToolOptions, type Point, type PointerState, type PresenceChannel, type RectTrackerHost, RemoteCursorOverlay, type RemoteCursorOverlayHost, type RemoteCursorOverlayOptions, RemoteFocusReceiver, type RemoteFocusReceiverHost, type RemoteFocusReceiverOptions, RemoteLaserOverlay, type RemoteLaserOverlayHost, type RemoteLaserOverlayOptions, RemoteMeasureOverlay, type RemoteMeasureOverlayHost, type RemoteMeasureOverlayOptions, RemotePathOverlay, type RemotePathOverlayHost, type RemotePathOverlayOptions, RemotePingOverlay, type RemotePingOverlayHost, type RemotePingOverlayOptions, RemoteSelectionOverlay, type RemoteSelectionOverlayHost, type RemoteSelectionOverlayOptions, type RenderStatsSnapshot, type RotateDirection, SelectTool, type SelectionStyleDetails, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type ShortcutBindings, type ShortcutOptions, type ShortcutsApi, type Size, type StorageAdapter, type StrokeElement, type StrokePoint, type TemplateElement, type TemplateRenderStyle, type TemplateShape, TemplateTool, type TemplateToolOptions, type TextElement, TextTool, type TextToolOptions, type Tool, type ToolContext, ToolManager, type ToolName, VERSION, Viewport, type ViewportOptions, applyCameraView, attachAwareness, boundsIntersect, cameraOriginForView, canonicalizeFogTile, captureCameraView, computeElementRects, createArrow, createGrid, createHtmlElement, createImage, createNote, createShape, createStroke, createTemplate, createText, defaultPeerColor, drawHexPath, elementRectsEqual, exportImage, exportSvg, fitZoomForView, decodeBase64 as fogDecodeBase64, encodeBase64 as fogEncodeBase64, footprintFromSize, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getElementBounds, getElementStyle, getElementsBoundingBox, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInRectangle, getHexCellsInSquare, getHexDistance, gridDistanceCells, isAwarenessPresence, isFocusPresence, isLaserTrailPresence, isMeasurePresence, isNearBezier, isPathPresence, isPingPresence, pathDistanceCells, recommendedFogCellSize, resolveHtmlRouting, setFontSize, smartSnap, snapFootprintCenter, snapPoint, snapToCellCenter, snapToHexCenter, styleToPatch, toFocusPresence, toLaserTrailPresence, toMeasurePresence, toPathPresence, toPingPresence, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline, validateFogDefinition, validateFogState, validateFogTile };
3270
+ export { AWARENESS_MAX_SELECTION, AWARENESS_PRESENCE_KIND, type ActivationOptions, type ActiveFormats, type AlignEdge, type ArrowElement, type ArrowStrokeStyle, ArrowTool, type ArrowToolOptions, type AttachAwarenessOptions, AutoSave, type AutoSaveOptions, type AwarenessFields, type AwarenessHandle, type AwarenessIdentity, type AwarenessPresence, type AwarenessViewport, type BackgroundOptions, type BackgroundPattern, type Binding, type Bounds, Camera, type CameraAnimationEndReason, CameraAnimator, type CameraAnimatorOptions, type CameraChangeInfo, type CameraOptions, type CameraView, type CanvasElement, type CanvasState, type Command, DEFAULT_NOTE_FONT_SIZE, type DiagonalRule, type DistributeAxis, type ElementActivationEvent, type ElementChangeMeta, type ElementRect, type ElementRectMatch, type ElementRectMatchError, ElementRectTracker, type ElementRectTrackerOptions, ElementStore, type ElementStyle, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, type ExportAssetError, type ExportAssetErrorReason, type ExportImageOptions, type ExportResourceOptions, type ExportSvgOptions, FOCUS_PRESENCE_KIND, FOG_MAX_TILES, FOG_STATE_VERSION, FOG_TILE_CELLS, type FocusAudience, type FocusPresence, type FocusRole, type FogBase, type FogChangeEvent, type FogDefinitionV1, type FogIdFactory, FogManager, type FogManagerOptions, type FogOperation, type FogPatch, type FogProceduralStyle, type FogRegion, FogRenderer, type FogRendererOptions, type FogSolidStyle, type FogStateV1, type FogStyle, type FogTileV1, FogTool, type FogToolOptions, type FogViewEvent, type FogViewMode, type FontSizePreset, type Footprint, type FrameScheduler, type GridElement, type GridInfo, type GridMetric, HandTool, type HexOrientation, HistoryStack, type HistoryStackOptions, type HitTestOptions, type HtmlElement, type HtmlExportError, type HtmlExportErrorReason, type HtmlExportOptions, type HtmlExportRenderer, type HtmlPaintContext, type HtmlPaintDiagnostic, type HtmlPainter, HtmlPainterMissingError, HtmlPainterRegistry, type HtmlRenderTarget, type HtmlRouting, type ImageElement, ImageTool, type ImageToolOptions, IndexedDBAdapter, type IndexedDBAdapterOptions, LASER_TRAIL_PRESENCE_KIND, LaserTool, type LaserToolOptions, type LaserTrailEmission, type LaserTrailPresence, type Layer, LayerManager, LocalAwareness, type LocalAwarenessHost, type LocalAwarenessOptions, LocalStorageAdapter, MEASURE_PRESENCE_KIND, type MeasureEmission, type MeasurePresence, MeasureTool, type MeasureToolOptions, type Measurement, MemoryAdapter, MinimapController, type MinimapControllerOptions, type NoteElement, NoteTool, type NoteToolOptions, type OverlayRenderer, PATH_PRESENCE_KIND, PATH_PRESENCE_MAX_POINTS, PEER_COLORS, PING_PRESENCE_KIND, type PathAnchor, type PathDistance, type PathEmission, type PathPresence, type PathRangeBand, type PathSegment, PathTool, type PathToolOptions, type Peer, type PeerLeaveReason, PeerRoster, type PeerRosterOptions, PencilTool, type PencilToolOptions, type PingEmission, PingInput, type PingInputHost, type PingInputOptions, type PingPresence, PingTool, type PingToolOptions, type Point, type PointerState, type PresenceChannel, type RectTrackerHost, RemoteCursorOverlay, type RemoteCursorOverlayHost, type RemoteCursorOverlayOptions, RemoteFocusReceiver, type RemoteFocusReceiverHost, type RemoteFocusReceiverOptions, RemoteLaserOverlay, type RemoteLaserOverlayHost, type RemoteLaserOverlayOptions, RemoteMeasureOverlay, type RemoteMeasureOverlayHost, type RemoteMeasureOverlayOptions, RemotePathOverlay, type RemotePathOverlayHost, type RemotePathOverlayOptions, RemotePingOverlay, type RemotePingOverlayHost, type RemotePingOverlayOptions, RemoteSelectionOverlay, type RemoteSelectionOverlayHost, type RemoteSelectionOverlayOptions, type RenderStatsSnapshot, type ResolvedFogStyle, type ResolvedProceduralStyle, type ResolvedSolidStyle, type RotateDirection, SelectTool, type SelectionStyleDetails, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type ShortcutBindings, type ShortcutOptions, type ShortcutsApi, type Size, type StorageAdapter, type StrokeElement, type StrokePoint, type TemplateElement, type TemplateRenderStyle, type TemplateShape, TemplateTool, type TemplateToolOptions, type TextElement, TextTool, type TextToolOptions, type Tool, type ToolContext, ToolManager, type ToolName, VERSION, Viewport, type ViewportOptions, applyCameraView, attachAwareness, boundsIntersect, cameraOriginForView, canonicalizeFogTile, captureCameraView, computeElementRects, createArrow, createGrid, createHtmlElement, createImage, createNote, createShape, createStroke, createTemplate, createText, defaultPeerColor, drawHexPath, elementRectsEqual, exportImage, exportSvg, fitZoomForView, decodeBase64 as fogDecodeBase64, encodeBase64 as fogEncodeBase64, footprintFromSize, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getElementBounds, getElementStyle, getElementsBoundingBox, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInRectangle, getHexCellsInSquare, getHexDistance, gridDistanceCells, isAwarenessPresence, isFocusPresence, isLaserTrailPresence, isMeasurePresence, isNearBezier, isPathPresence, isPingPresence, pathDistanceCells, recommendedFogCellSize, resolveFogStyle, resolveHtmlRouting, setFontSize, smartSnap, snapFootprintCenter, snapPoint, snapToCellCenter, snapToHexCenter, styleToPatch, toFocusPresence, toLaserTrailPresence, toMeasurePresence, toPathPresence, toPingPresence, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline, validateFogDefinition, validateFogState, validateFogTile };
package/dist/index.d.ts CHANGED
@@ -692,6 +692,42 @@ declare class HtmlPainterRegistry {
692
692
  }
693
693
  declare function resolveHtmlRouting(el: Readonly<HtmlElement>, registry: HtmlPainterRegistry | null, expectedCanvasTypes?: ReadonlySet<string>): HtmlRouting;
694
694
 
695
+ interface FogSolidStyle {
696
+ kind?: 'solid';
697
+ color: string;
698
+ }
699
+ interface FogProceduralStyle {
700
+ kind: 'procedural';
701
+ /** Base fill painted before the noise pattern. Player mode adds an opaque safety layer. */
702
+ backdrop: string;
703
+ /** Canvas-compatible CSS tint mixed into the noise pattern. */
704
+ tint: string;
705
+ /** Overall noise opacity, 0–1. Default `0.6`. */
706
+ opacity?: number;
707
+ /** Pattern scale in world units per tile repeat. 64–1024. Default `256`. */
708
+ scale?: number;
709
+ /** Deterministic seed, 0–65535. Default `0`. */
710
+ seed?: number;
711
+ /** Noise detail / number of octaves, 1–4. Default `2`. */
712
+ detail?: number;
713
+ }
714
+ type FogStyle = FogSolidStyle | FogProceduralStyle;
715
+ interface ResolvedSolidStyle {
716
+ readonly kind: 'solid';
717
+ readonly color: string;
718
+ }
719
+ interface ResolvedProceduralStyle {
720
+ readonly kind: 'procedural';
721
+ readonly backdrop: string;
722
+ readonly tint: string;
723
+ readonly opacity: number;
724
+ readonly scale: number;
725
+ readonly seed: number;
726
+ readonly detail: number;
727
+ }
728
+ type ResolvedFogStyle = ResolvedSolidStyle | ResolvedProceduralStyle;
729
+ declare function resolveFogStyle(style: FogStyle | undefined, legacyColor: string | undefined, defaultColor: string): ResolvedFogStyle;
730
+
695
731
  interface ExportImageOptions extends ExportResourceOptions, HtmlExportOptions {
696
732
  scale?: number;
697
733
  padding?: number;
@@ -741,6 +777,7 @@ interface ExportImageOptions extends ExportResourceOptions, HtmlExportOptions {
741
777
  state: FogStateV1;
742
778
  mode: 'editor' | 'player';
743
779
  color?: string;
780
+ style?: FogStyle;
744
781
  } | false;
745
782
  }
746
783
  type ExportAssetErrorReason = 'load' | 'timeout' | 'encode';
@@ -774,6 +811,7 @@ interface ExportSvgOptions extends ExportResourceOptions, HtmlExportOptions {
774
811
  state: FogStateV1;
775
812
  mode: 'editor' | 'player';
776
813
  color?: string;
814
+ style?: FogStyle;
777
815
  } | false;
778
816
  }
779
817
  declare function exportSvg(store: ElementStore, options?: ExportSvgOptions, layerManager?: LayerManager): Promise<string>;
@@ -803,15 +841,19 @@ interface RenderStatsSnapshot {
803
841
  interface FogRendererOptions {
804
842
  editorColor?: string;
805
843
  playerColor?: string;
844
+ editorStyle?: FogStyle;
845
+ playerStyle?: FogStyle;
806
846
  }
807
847
  declare class FogRenderer {
808
848
  private tileCache;
849
+ private patternCache;
809
850
  private state;
810
851
  private viewMode;
811
852
  private dirty;
812
- private editorColor;
813
- private playerColor;
853
+ private editorStyle;
854
+ private playerStyle;
814
855
  constructor(options?: FogRendererOptions);
856
+ setOptions(options: FogRendererOptions): void;
815
857
  setState(state: FogStateV1 | null): void;
816
858
  setViewMode(mode: FogViewMode): void;
817
859
  getState(): FogStateV1 | null;
@@ -819,9 +861,14 @@ declare class FogRenderer {
819
861
  markDirty(): void;
820
862
  isDirty(): boolean;
821
863
  isVisible(): boolean;
864
+ getResolvedStyle(mode: 'editor' | 'player'): ResolvedFogStyle;
822
865
  render(ctx: CanvasRenderingContext2D, camera: Camera, viewportWidth: number, viewportHeight: number, _dpr: number): void;
823
- renderForExport(ctx: CanvasRenderingContext2D, state: FogStateV1, mode: 'editor' | 'player', color?: string): void;
866
+ renderForExport(ctx: CanvasRenderingContext2D, state: FogStateV1, mode: 'editor' | 'player', color?: string, style?: FogStyle): void;
824
867
  dispose(): void;
868
+ private getOrCreatePattern;
869
+ private createPatternFromTileData;
870
+ private paintProceduralOverlay;
871
+ private renderTileProceduralOverlay;
825
872
  private tileRaster;
826
873
  private renderTile;
827
874
  private renderTileForExport;
@@ -918,10 +965,7 @@ interface ViewportOptions {
918
965
  /** Show an overview minimap (bottom-right) with tap/drag-to-navigate. Default `false`. */
919
966
  minimap?: boolean;
920
967
  /** Fog-of-war presentation options. Enables fog rendering and the `fog` accessor. */
921
- fog?: {
922
- editorColor?: string;
923
- playerColor?: string;
924
- };
968
+ fog?: FogRendererOptions;
925
969
  }
926
970
  interface HitTestOptions {
927
971
  /** Skip elements on locked layers. Default `true` (selection semantics). */
@@ -986,6 +1030,7 @@ declare class Viewport {
986
1030
  constructor(container: HTMLElement, options?: ViewportOptions);
987
1031
  get ctx(): CanvasRenderingContext2D | null;
988
1032
  get fog(): FogManager;
1033
+ setFogStyle(options: FogRendererOptions): void;
989
1034
  get snapToGrid(): boolean;
990
1035
  setSnapToGrid(enabled: boolean): void;
991
1036
  get smartGuides(): boolean;
@@ -1043,6 +1088,11 @@ declare class Viewport {
1043
1088
  * can only add expectations, never shrink the registry's own.
1044
1089
  */
1045
1090
  private withHtmlDefaults;
1091
+ /**
1092
+ * Carry constructor-configured fog presentation into both implicit exports and
1093
+ * explicit state/mode exports. Explicit style and legacy color overrides win.
1094
+ */
1095
+ private withFogDefaults;
1046
1096
  exportImage(options?: ExportImageOptions): Promise<Blob | null>;
1047
1097
  exportSVG(options?: ExportSvgOptions): Promise<string>;
1048
1098
  loadState(state: CanvasState): void;
@@ -3215,6 +3265,6 @@ declare class FogTool implements Tool {
3215
3265
  private renderPolygonPreview;
3216
3266
  }
3217
3267
 
3218
- declare const VERSION = "0.66.0";
3268
+ declare const VERSION = "0.68.0";
3219
3269
 
3220
- export { AWARENESS_MAX_SELECTION, AWARENESS_PRESENCE_KIND, type ActivationOptions, type ActiveFormats, type AlignEdge, type ArrowElement, type ArrowStrokeStyle, ArrowTool, type ArrowToolOptions, type AttachAwarenessOptions, AutoSave, type AutoSaveOptions, type AwarenessFields, type AwarenessHandle, type AwarenessIdentity, type AwarenessPresence, type AwarenessViewport, type BackgroundOptions, type BackgroundPattern, type Binding, type Bounds, Camera, type CameraAnimationEndReason, CameraAnimator, type CameraAnimatorOptions, type CameraChangeInfo, type CameraOptions, type CameraView, type CanvasElement, type CanvasState, type Command, DEFAULT_NOTE_FONT_SIZE, type DiagonalRule, type DistributeAxis, type ElementActivationEvent, type ElementChangeMeta, type ElementRect, type ElementRectMatch, type ElementRectMatchError, ElementRectTracker, type ElementRectTrackerOptions, ElementStore, type ElementStyle, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, type ExportAssetError, type ExportAssetErrorReason, type ExportImageOptions, type ExportResourceOptions, type ExportSvgOptions, FOCUS_PRESENCE_KIND, FOG_MAX_TILES, FOG_STATE_VERSION, FOG_TILE_CELLS, type FocusAudience, type FocusPresence, type FocusRole, type FogBase, type FogChangeEvent, type FogDefinitionV1, type FogIdFactory, FogManager, type FogManagerOptions, type FogOperation, type FogPatch, type FogRegion, FogRenderer, type FogRendererOptions, type FogStateV1, type FogTileV1, FogTool, type FogToolOptions, type FogViewEvent, type FogViewMode, type FontSizePreset, type Footprint, type FrameScheduler, type GridElement, type GridInfo, type GridMetric, HandTool, type HexOrientation, HistoryStack, type HistoryStackOptions, type HitTestOptions, type HtmlElement, type HtmlExportError, type HtmlExportErrorReason, type HtmlExportOptions, type HtmlExportRenderer, type HtmlPaintContext, type HtmlPaintDiagnostic, type HtmlPainter, HtmlPainterMissingError, HtmlPainterRegistry, type HtmlRenderTarget, type HtmlRouting, type ImageElement, ImageTool, type ImageToolOptions, IndexedDBAdapter, type IndexedDBAdapterOptions, LASER_TRAIL_PRESENCE_KIND, LaserTool, type LaserToolOptions, type LaserTrailEmission, type LaserTrailPresence, type Layer, LayerManager, LocalAwareness, type LocalAwarenessHost, type LocalAwarenessOptions, LocalStorageAdapter, MEASURE_PRESENCE_KIND, type MeasureEmission, type MeasurePresence, MeasureTool, type MeasureToolOptions, type Measurement, MemoryAdapter, MinimapController, type MinimapControllerOptions, type NoteElement, NoteTool, type NoteToolOptions, type OverlayRenderer, PATH_PRESENCE_KIND, PATH_PRESENCE_MAX_POINTS, PEER_COLORS, PING_PRESENCE_KIND, type PathAnchor, type PathDistance, type PathEmission, type PathPresence, type PathRangeBand, type PathSegment, PathTool, type PathToolOptions, type Peer, type PeerLeaveReason, PeerRoster, type PeerRosterOptions, PencilTool, type PencilToolOptions, type PingEmission, PingInput, type PingInputHost, type PingInputOptions, type PingPresence, PingTool, type PingToolOptions, type Point, type PointerState, type PresenceChannel, type RectTrackerHost, RemoteCursorOverlay, type RemoteCursorOverlayHost, type RemoteCursorOverlayOptions, RemoteFocusReceiver, type RemoteFocusReceiverHost, type RemoteFocusReceiverOptions, RemoteLaserOverlay, type RemoteLaserOverlayHost, type RemoteLaserOverlayOptions, RemoteMeasureOverlay, type RemoteMeasureOverlayHost, type RemoteMeasureOverlayOptions, RemotePathOverlay, type RemotePathOverlayHost, type RemotePathOverlayOptions, RemotePingOverlay, type RemotePingOverlayHost, type RemotePingOverlayOptions, RemoteSelectionOverlay, type RemoteSelectionOverlayHost, type RemoteSelectionOverlayOptions, type RenderStatsSnapshot, type RotateDirection, SelectTool, type SelectionStyleDetails, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type ShortcutBindings, type ShortcutOptions, type ShortcutsApi, type Size, type StorageAdapter, type StrokeElement, type StrokePoint, type TemplateElement, type TemplateRenderStyle, type TemplateShape, TemplateTool, type TemplateToolOptions, type TextElement, TextTool, type TextToolOptions, type Tool, type ToolContext, ToolManager, type ToolName, VERSION, Viewport, type ViewportOptions, applyCameraView, attachAwareness, boundsIntersect, cameraOriginForView, canonicalizeFogTile, captureCameraView, computeElementRects, createArrow, createGrid, createHtmlElement, createImage, createNote, createShape, createStroke, createTemplate, createText, defaultPeerColor, drawHexPath, elementRectsEqual, exportImage, exportSvg, fitZoomForView, decodeBase64 as fogDecodeBase64, encodeBase64 as fogEncodeBase64, footprintFromSize, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getElementBounds, getElementStyle, getElementsBoundingBox, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInRectangle, getHexCellsInSquare, getHexDistance, gridDistanceCells, isAwarenessPresence, isFocusPresence, isLaserTrailPresence, isMeasurePresence, isNearBezier, isPathPresence, isPingPresence, pathDistanceCells, recommendedFogCellSize, resolveHtmlRouting, setFontSize, smartSnap, snapFootprintCenter, snapPoint, snapToCellCenter, snapToHexCenter, styleToPatch, toFocusPresence, toLaserTrailPresence, toMeasurePresence, toPathPresence, toPingPresence, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline, validateFogDefinition, validateFogState, validateFogTile };
3270
+ export { AWARENESS_MAX_SELECTION, AWARENESS_PRESENCE_KIND, type ActivationOptions, type ActiveFormats, type AlignEdge, type ArrowElement, type ArrowStrokeStyle, ArrowTool, type ArrowToolOptions, type AttachAwarenessOptions, AutoSave, type AutoSaveOptions, type AwarenessFields, type AwarenessHandle, type AwarenessIdentity, type AwarenessPresence, type AwarenessViewport, type BackgroundOptions, type BackgroundPattern, type Binding, type Bounds, Camera, type CameraAnimationEndReason, CameraAnimator, type CameraAnimatorOptions, type CameraChangeInfo, type CameraOptions, type CameraView, type CanvasElement, type CanvasState, type Command, DEFAULT_NOTE_FONT_SIZE, type DiagonalRule, type DistributeAxis, type ElementActivationEvent, type ElementChangeMeta, type ElementRect, type ElementRectMatch, type ElementRectMatchError, ElementRectTracker, type ElementRectTrackerOptions, ElementStore, type ElementStyle, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, type ExportAssetError, type ExportAssetErrorReason, type ExportImageOptions, type ExportResourceOptions, type ExportSvgOptions, FOCUS_PRESENCE_KIND, FOG_MAX_TILES, FOG_STATE_VERSION, FOG_TILE_CELLS, type FocusAudience, type FocusPresence, type FocusRole, type FogBase, type FogChangeEvent, type FogDefinitionV1, type FogIdFactory, FogManager, type FogManagerOptions, type FogOperation, type FogPatch, type FogProceduralStyle, type FogRegion, FogRenderer, type FogRendererOptions, type FogSolidStyle, type FogStateV1, type FogStyle, type FogTileV1, FogTool, type FogToolOptions, type FogViewEvent, type FogViewMode, type FontSizePreset, type Footprint, type FrameScheduler, type GridElement, type GridInfo, type GridMetric, HandTool, type HexOrientation, HistoryStack, type HistoryStackOptions, type HitTestOptions, type HtmlElement, type HtmlExportError, type HtmlExportErrorReason, type HtmlExportOptions, type HtmlExportRenderer, type HtmlPaintContext, type HtmlPaintDiagnostic, type HtmlPainter, HtmlPainterMissingError, HtmlPainterRegistry, type HtmlRenderTarget, type HtmlRouting, type ImageElement, ImageTool, type ImageToolOptions, IndexedDBAdapter, type IndexedDBAdapterOptions, LASER_TRAIL_PRESENCE_KIND, LaserTool, type LaserToolOptions, type LaserTrailEmission, type LaserTrailPresence, type Layer, LayerManager, LocalAwareness, type LocalAwarenessHost, type LocalAwarenessOptions, LocalStorageAdapter, MEASURE_PRESENCE_KIND, type MeasureEmission, type MeasurePresence, MeasureTool, type MeasureToolOptions, type Measurement, MemoryAdapter, MinimapController, type MinimapControllerOptions, type NoteElement, NoteTool, type NoteToolOptions, type OverlayRenderer, PATH_PRESENCE_KIND, PATH_PRESENCE_MAX_POINTS, PEER_COLORS, PING_PRESENCE_KIND, type PathAnchor, type PathDistance, type PathEmission, type PathPresence, type PathRangeBand, type PathSegment, PathTool, type PathToolOptions, type Peer, type PeerLeaveReason, PeerRoster, type PeerRosterOptions, PencilTool, type PencilToolOptions, type PingEmission, PingInput, type PingInputHost, type PingInputOptions, type PingPresence, PingTool, type PingToolOptions, type Point, type PointerState, type PresenceChannel, type RectTrackerHost, RemoteCursorOverlay, type RemoteCursorOverlayHost, type RemoteCursorOverlayOptions, RemoteFocusReceiver, type RemoteFocusReceiverHost, type RemoteFocusReceiverOptions, RemoteLaserOverlay, type RemoteLaserOverlayHost, type RemoteLaserOverlayOptions, RemoteMeasureOverlay, type RemoteMeasureOverlayHost, type RemoteMeasureOverlayOptions, RemotePathOverlay, type RemotePathOverlayHost, type RemotePathOverlayOptions, RemotePingOverlay, type RemotePingOverlayHost, type RemotePingOverlayOptions, RemoteSelectionOverlay, type RemoteSelectionOverlayHost, type RemoteSelectionOverlayOptions, type RenderStatsSnapshot, type ResolvedFogStyle, type ResolvedProceduralStyle, type ResolvedSolidStyle, type RotateDirection, SelectTool, type SelectionStyleDetails, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type ShortcutBindings, type ShortcutOptions, type ShortcutsApi, type Size, type StorageAdapter, type StrokeElement, type StrokePoint, type TemplateElement, type TemplateRenderStyle, type TemplateShape, TemplateTool, type TemplateToolOptions, type TextElement, TextTool, type TextToolOptions, type Tool, type ToolContext, ToolManager, type ToolName, VERSION, Viewport, type ViewportOptions, applyCameraView, attachAwareness, boundsIntersect, cameraOriginForView, canonicalizeFogTile, captureCameraView, computeElementRects, createArrow, createGrid, createHtmlElement, createImage, createNote, createShape, createStroke, createTemplate, createText, defaultPeerColor, drawHexPath, elementRectsEqual, exportImage, exportSvg, fitZoomForView, decodeBase64 as fogDecodeBase64, encodeBase64 as fogEncodeBase64, footprintFromSize, getActiveFormats, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getElementBounds, getElementStyle, getElementsBoundingBox, getHexCellsInCone, getHexCellsInLine, getHexCellsInRadius, getHexCellsInRectangle, getHexCellsInSquare, getHexDistance, gridDistanceCells, isAwarenessPresence, isFocusPresence, isLaserTrailPresence, isMeasurePresence, isNearBezier, isPathPresence, isPingPresence, pathDistanceCells, recommendedFogCellSize, resolveFogStyle, resolveHtmlRouting, setFontSize, smartSnap, snapFootprintCenter, snapPoint, snapToCellCenter, snapToHexCenter, styleToPatch, toFocusPresence, toLaserTrailPresence, toMeasurePresence, toPathPresence, toPingPresence, toggleBold, toggleItalic, toggleStrikethrough, toggleUnderline, validateFogDefinition, validateFogState, validateFogTile };