@canvas-harness/core 0.1.12 → 0.1.14
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 +37 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -6
- package/dist/index.d.ts +59 -6
- package/dist/index.js +35 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2192,6 +2192,35 @@ type Opts = {
|
|
|
2192
2192
|
};
|
|
2193
2193
|
declare const createFrameLoop: ({ draw, historySize }: Opts) => FrameLoop;
|
|
2194
2194
|
|
|
2195
|
+
type AssetCacheOptions = {
|
|
2196
|
+
/** Called when a pending entry transitions to ready or error. */
|
|
2197
|
+
onReady?: () => void;
|
|
2198
|
+
};
|
|
2199
|
+
type AssetCache = {
|
|
2200
|
+
/** Returns a loaded HTMLImageElement or null if still loading. */
|
|
2201
|
+
getImage(src: string): HTMLImageElement | null;
|
|
2202
|
+
/**
|
|
2203
|
+
* Returns a rasterized ImageBitmap for the given SVG markup at the
|
|
2204
|
+
* given on-device pixel size + tint color, or null if pending.
|
|
2205
|
+
*/
|
|
2206
|
+
getIcon(markup: string, color: string | undefined, devicePixelSize: number): ImageBitmap | null;
|
|
2207
|
+
/** Frees decoded bitmaps. Call from renderer.dispose(). */
|
|
2208
|
+
dispose(): void;
|
|
2209
|
+
};
|
|
2210
|
+
declare const createAssetCache: (opts?: AssetCacheOptions) => AssetCache;
|
|
2211
|
+
|
|
2212
|
+
/**
|
|
2213
|
+
* Paint helpers for `image` and `icon` node types. Caller is already
|
|
2214
|
+
* inside `drawWithNodeTransform` (origin at the node's top-left,
|
|
2215
|
+
* rotation applied), so we paint into local space `(0, 0, w, h)`.
|
|
2216
|
+
*
|
|
2217
|
+
* Both helpers return true when a bitmap was blitted, false when the
|
|
2218
|
+
* bitmap is still loading (caller may paint a placeholder).
|
|
2219
|
+
*/
|
|
2220
|
+
|
|
2221
|
+
declare const paintImageNode: (ctx: CanvasRenderingContext2D, node: Node, cache: AssetCache, theme?: ThemeResolver) => void;
|
|
2222
|
+
declare const paintIconNode: (ctx: CanvasRenderingContext2D, node: Node, cache: AssetCache, scale: number, theme?: ThemeResolver) => void;
|
|
2223
|
+
|
|
2195
2224
|
/**
|
|
2196
2225
|
* Generic primitive paint pass.
|
|
2197
2226
|
*
|
|
@@ -2294,6 +2323,13 @@ type Renderer = {
|
|
|
2294
2323
|
lastDrawCount(): number;
|
|
2295
2324
|
/** Current overlay-mounted custom-node ids. */
|
|
2296
2325
|
getOverlaySet(): NodeId[];
|
|
2326
|
+
/**
|
|
2327
|
+
* Renderer-owned asset cache (decoded image bitmaps + rasterized
|
|
2328
|
+
* SVG icons). Pass to {@link exportSelection} / {@link exportViewport}
|
|
2329
|
+
* so PNG export paints image + icon nodes from the same bitmaps the
|
|
2330
|
+
* live canvas uses.
|
|
2331
|
+
*/
|
|
2332
|
+
getAssetCache(): AssetCache;
|
|
2297
2333
|
/** Detach event listeners. The store is left untouched. */
|
|
2298
2334
|
dispose(): void;
|
|
2299
2335
|
};
|
|
@@ -2499,10 +2535,14 @@ type Hit = NodeHit | EdgeHit;
|
|
|
2499
2535
|
declare const hitTestPoint: (store: CanvasStore, worldPoint: Vec2, cameraZ: number, selectedIds?: ReadonlySet<NodeId>) => NodeHit | null;
|
|
2500
2536
|
/**
|
|
2501
2537
|
* Combined node + edge hit testing. Order: node handles > edge endpoint
|
|
2502
|
-
* handles > node
|
|
2538
|
+
* handles > visually-topmost body (node or edge, compared by z).
|
|
2503
2539
|
*
|
|
2504
|
-
*
|
|
2505
|
-
*
|
|
2540
|
+
* For bodies, the rule is paint-order: whichever of (node body, edge
|
|
2541
|
+
* body) has the higher z wins, with ties going to edges (edges paint
|
|
2542
|
+
* over nodes by convention). This lets users click an edge that runs
|
|
2543
|
+
* visually over a large background-style node — the 8px polyline slop
|
|
2544
|
+
* keeps the edge's hit zone narrow, so clicks far from the polyline
|
|
2545
|
+
* still land on the node underneath.
|
|
2506
2546
|
*/
|
|
2507
2547
|
declare const hitTestAny: (store: CanvasStore, worldPoint: Vec2, cameraZ: number, selectedNodes?: ReadonlySet<NodeId>, selectedEdges?: ReadonlySet<EdgeId>) => Hit | null;
|
|
2508
2548
|
/**
|
|
@@ -2652,6 +2692,14 @@ type ExportOptions = {
|
|
|
2652
2692
|
backgroundColor?: string;
|
|
2653
2693
|
/** Theme resolver, same one passed to the live renderer. */
|
|
2654
2694
|
theme?: ThemeResolver;
|
|
2695
|
+
/**
|
|
2696
|
+
* Renderer-owned asset cache. When provided, `image` and `icon`
|
|
2697
|
+
* nodes paint from the same decoded bitmaps the live canvas uses.
|
|
2698
|
+
* When omitted, those node types are skipped (back-compat).
|
|
2699
|
+
*
|
|
2700
|
+
* Usage: `exportSelection(store, { assetCache: renderer.getAssetCache() })`.
|
|
2701
|
+
*/
|
|
2702
|
+
assetCache?: AssetCache;
|
|
2655
2703
|
};
|
|
2656
2704
|
/**
|
|
2657
2705
|
* Renders the current selection to a PNG. Returns a `Blob` you can
|
|
@@ -2693,8 +2741,13 @@ declare const exportViewport: (store: CanvasStore, viewport: {
|
|
|
2693
2741
|
/**
|
|
2694
2742
|
* SVG export — see ARCHITECTURE.md §13.
|
|
2695
2743
|
*
|
|
2696
|
-
* **Scope**: matches PNG export for shape geometry + edge geometry
|
|
2697
|
-
*
|
|
2744
|
+
* **Scope**: matches PNG export for shape geometry + edge geometry.
|
|
2745
|
+
* Image nodes are inlined as `<image href="…">` (data URI passes
|
|
2746
|
+
* through verbatim). Icon nodes nest their sanitized SVG markup inside
|
|
2747
|
+
* a `<g transform>`, preserving vector quality and the `iconColor`
|
|
2748
|
+
* recolor knob.
|
|
2749
|
+
*
|
|
2750
|
+
* Markdown content is emitted as **plain text** (no inline bold /
|
|
2698
2751
|
* italic / highlight). SVG `<text>` doesn't support our markdown
|
|
2699
2752
|
* dialect without tspan positioning math; deferred to v2. PNG export
|
|
2700
2753
|
* preserves all markdown styling via the bitmap pipeline.
|
|
@@ -3485,4 +3538,4 @@ declare const installedExtensions: (store: CanvasStore) => string[];
|
|
|
3485
3538
|
*/
|
|
3486
3539
|
declare const VERSION = "0.0.0";
|
|
3487
3540
|
|
|
3488
|
-
export { type AnthropicToolDef, type Arrowhead, BEZIER_SEGMENTS, type BatchId, type BitmapCacheEntry, type BitmapCacheRequest, type BuiltInNodeType, CODE_BG_COLOR, CODE_BLOCK_MARGIN_Y, CODE_BLOCK_PADDING_X, CONTENT_HEIGHT_BUFFER, CONTENT_PADDING, type CameraState, type CanvasBackground, type CanvasBackgroundPattern, type CanvasStore, type CanvasSurface, type ClientId, type ClipResult, type ConflictRecord, type ContextEdge, type ContextNode, DEFAULT_BACKGROUND, DEFAULT_CAMERA, DEFAULT_HIGHLIGHT_COLOR, DEFAULT_HIGHLIGHT_COLOR_DARK, DEFAULT_MINIMAP_MAX_NODES, DEFAULT_STYLE, DEFAULT_TEXT_COLOR, type DeserializeOptions, type DragOriginal, type DrawTextOptions, EDGE_HANDLE_SLOP_PX, EDGE_HIT_SLOP_PX, type Edge, type EdgeEnd, type EdgeGeometry, EdgeGeometryCache, type EdgeHit, type EdgeId, type EdgeStyle, type EditorAdapter, type EditorAdapterFactory, type EditorAdapterMountOptions, type EstimateOptions, type ExportOptions, type Extension, type ExtensionApi, FONT_FAMILY_MAP, FONT_SIZE_MAP, type FontFamily, type FontSize, type FrameLoop, type FrameStats, type GetContextOptions, type Group, type GroupId, type Hit, type IconNodeData, type IdGenerator, type ImageNodeData, type InlineType, type InteractionMode, type InteractionState, LINE_HEIGHT_MAP, LINK_COLOR, type LayoutLine, type LayoutOptions, MAX_IMAGE_BYTES, MAX_SVG_BYTES, MAX_ZOOM, MIN_ZOOM, type MathBitmap, type Migrator, type MinimapContentOptions, type Node, type NodeHit, type NodeId, type NodeType, type NodeTypeDef, type NodeTypeDefOptions, type Op, type OpBatch, type OpOrigin, PALM_REJECTION_GRACE_MS, type PalmRejectionState, type PathStyle, type PointerInfo, type PresenceEvent, type PresencePatch, type PresenceSlice, type PresenceState, type PrimitiveType, RESIZE_HANDLES, RESIZE_HANDLE_SIZE_PX, ROTATE_HANDLE_OFFSET_PX, ROTATE_HANDLE_RADIUS_PX, type RenderEnv, type Renderer, type RendererOptions, type ResizeHandle, SCHEMA_VERSION, type Scene, type SceneContextJson, type SchemaVersion, type SerializedClipboard, type SerializedScene, type Side, type SnapshotEnv, type SpatialId, type SpatialQuery, type SpatialResult, type StoreEventHandler, type StoreEventName, type StoreEvents, type StoreOptions, type StrokeStyle, type Style, type StyledRun, type SvgExportOptions, type SyncAdapter, type SyncAdapterCapabilities, type TextAlign, type TextStyle, type ThemeResolver, type Token, type Transform, UniformGrid, type Unsubscribe, VERSION, type Vec2, type WorldRect, applyCameraTransform, applySvgColor, arrowheadLength, asBatchId, asClientId, asEdgeId, asGroupId, asNodeId, attachSync, autoRouteControls, blobToDataUri, clampEffectiveScale, clampZoom, clearMathCache, clearMeasureCache, clearSurface, clearTextBitmapCache, clipSamples, computeAutoFitHeight, computeEdgeGeometry, copy, createCanvasStore, createDefaultTextareaEditor, createFrameLoop, createPalmRejectionState, createRenderer, cubicBezier, cubicBezierTangent, cut, defineExtension, defineNode, deserializeClipboard, detectConflicts, downscaleImageBlob, drawArrowhead, drawEdge, drawMinimapViewport, drawShape, drawTextToCanvas, drawWithNodeTransform, edgeAABBFromSamples, edgeLabelBoundsWorld, emptyPresenceState, estimateMarkdownContentHeight, exportSelection, exportSelectionSvg, exportViewport, extractSvgDimensions, fromSerialized, fullVisibleClipResult, getCanvasFont, getContentHeight, getContext, getDpr, getFontEpoch, getMarkdownLineHeightPx, getMathBitmap, getMathCacheSize, getMathEpoch, getMathJax, getOrRenderTextBitmap, getPointAndTangentAtArcLength, getTextBitmapCacheSize, handleEnter, handleWorldPositions, hitTestAny, hitTestEdge, hitTestHandles, hitTestPoint, hitTestRotateHandle, idleInteractionState, inflateRect, insertLink, installExtension, installedExtensions, inverseBatch, inverseOp, isAttached, isCanvasHarnessClipboard, isDrawablePrimitive, isMoving, isNodeRemoteEditing, layoutTokens, makeIdGenerator, marqueeNodes, measureText, midpointToCubicControls, minimapScreenToWorld, nodeAABB, nodeIntersectsRect, nodeLocalToWorld, notePenActive, notePenInactive, onMathJaxReady, opSchemas, opSchemasAsAnthropicTools, paintBackground, panByScreen, paste, pointInNode, projectEndToWorld, projectToNodeBoundary, quantizeDpr, quantizeZoom, randomClientId, rectContainsPoint, rectFromPoints, rectsIntersect, registerMigrator, renderMinimapContent, resolveColor, resolveOpacity, resolveRenderScale, resolveStrokeWidth, rotateHandleWorldPosition, rotateVecByAngle, sampleBezier, sampleSelfLoop, samplesFor, sanitizeSvg, sceneBounds, screenToWorld, selfLoopGeometry, serializeSelection, setupSurface, shouldAutoFit, shouldRejectTouch, sideNormalLocal, sideOf, sideToward, sizeSurface, storeToJSON, subscribeFontEpoch, subscribeMathEpoch, tangentAtArcLength, toImageBlob, toSerialized, toggleBold, toggleCode, toggleItalic, toggleStrike, toggleUnderline, tokenize, unionRects, validateImageInput, validateSvgMarkup, viewportWorldRect, withAutoFitHeight, worldToNodeLocal, worldToScreen, worldViewport, worldViewportFromCamera, zoomAtScreenPoint };
|
|
3541
|
+
export { type AnthropicToolDef, type Arrowhead, type AssetCache, type AssetCacheOptions, BEZIER_SEGMENTS, type BatchId, type BitmapCacheEntry, type BitmapCacheRequest, type BuiltInNodeType, CODE_BG_COLOR, CODE_BLOCK_MARGIN_Y, CODE_BLOCK_PADDING_X, CONTENT_HEIGHT_BUFFER, CONTENT_PADDING, type CameraState, type CanvasBackground, type CanvasBackgroundPattern, type CanvasStore, type CanvasSurface, type ClientId, type ClipResult, type ConflictRecord, type ContextEdge, type ContextNode, DEFAULT_BACKGROUND, DEFAULT_CAMERA, DEFAULT_HIGHLIGHT_COLOR, DEFAULT_HIGHLIGHT_COLOR_DARK, DEFAULT_MINIMAP_MAX_NODES, DEFAULT_STYLE, DEFAULT_TEXT_COLOR, type DeserializeOptions, type DragOriginal, type DrawTextOptions, EDGE_HANDLE_SLOP_PX, EDGE_HIT_SLOP_PX, type Edge, type EdgeEnd, type EdgeGeometry, EdgeGeometryCache, type EdgeHit, type EdgeId, type EdgeStyle, type EditorAdapter, type EditorAdapterFactory, type EditorAdapterMountOptions, type EstimateOptions, type ExportOptions, type Extension, type ExtensionApi, FONT_FAMILY_MAP, FONT_SIZE_MAP, type FontFamily, type FontSize, type FrameLoop, type FrameStats, type GetContextOptions, type Group, type GroupId, type Hit, type IconNodeData, type IdGenerator, type ImageNodeData, type InlineType, type InteractionMode, type InteractionState, LINE_HEIGHT_MAP, LINK_COLOR, type LayoutLine, type LayoutOptions, MAX_IMAGE_BYTES, MAX_SVG_BYTES, MAX_ZOOM, MIN_ZOOM, type MathBitmap, type Migrator, type MinimapContentOptions, type Node, type NodeHit, type NodeId, type NodeType, type NodeTypeDef, type NodeTypeDefOptions, type Op, type OpBatch, type OpOrigin, PALM_REJECTION_GRACE_MS, type PalmRejectionState, type PathStyle, type PointerInfo, type PresenceEvent, type PresencePatch, type PresenceSlice, type PresenceState, type PrimitiveType, RESIZE_HANDLES, RESIZE_HANDLE_SIZE_PX, ROTATE_HANDLE_OFFSET_PX, ROTATE_HANDLE_RADIUS_PX, type RenderEnv, type Renderer, type RendererOptions, type ResizeHandle, SCHEMA_VERSION, type Scene, type SceneContextJson, type SchemaVersion, type SerializedClipboard, type SerializedScene, type Side, type SnapshotEnv, type SpatialId, type SpatialQuery, type SpatialResult, type StoreEventHandler, type StoreEventName, type StoreEvents, type StoreOptions, type StrokeStyle, type Style, type StyledRun, type SvgExportOptions, type SyncAdapter, type SyncAdapterCapabilities, type TextAlign, type TextStyle, type ThemeResolver, type Token, type Transform, UniformGrid, type Unsubscribe, VERSION, type Vec2, type WorldRect, applyCameraTransform, applySvgColor, arrowheadLength, asBatchId, asClientId, asEdgeId, asGroupId, asNodeId, attachSync, autoRouteControls, blobToDataUri, clampEffectiveScale, clampZoom, clearMathCache, clearMeasureCache, clearSurface, clearTextBitmapCache, clipSamples, computeAutoFitHeight, computeEdgeGeometry, copy, createAssetCache, createCanvasStore, createDefaultTextareaEditor, createFrameLoop, createPalmRejectionState, createRenderer, cubicBezier, cubicBezierTangent, cut, defineExtension, defineNode, deserializeClipboard, detectConflicts, downscaleImageBlob, drawArrowhead, drawEdge, drawMinimapViewport, drawShape, drawTextToCanvas, drawWithNodeTransform, edgeAABBFromSamples, edgeLabelBoundsWorld, emptyPresenceState, estimateMarkdownContentHeight, exportSelection, exportSelectionSvg, exportViewport, extractSvgDimensions, fromSerialized, fullVisibleClipResult, getCanvasFont, getContentHeight, getContext, getDpr, getFontEpoch, getMarkdownLineHeightPx, getMathBitmap, getMathCacheSize, getMathEpoch, getMathJax, getOrRenderTextBitmap, getPointAndTangentAtArcLength, getTextBitmapCacheSize, handleEnter, handleWorldPositions, hitTestAny, hitTestEdge, hitTestHandles, hitTestPoint, hitTestRotateHandle, idleInteractionState, inflateRect, insertLink, installExtension, installedExtensions, inverseBatch, inverseOp, isAttached, isCanvasHarnessClipboard, isDrawablePrimitive, isMoving, isNodeRemoteEditing, layoutTokens, makeIdGenerator, marqueeNodes, measureText, midpointToCubicControls, minimapScreenToWorld, nodeAABB, nodeIntersectsRect, nodeLocalToWorld, notePenActive, notePenInactive, onMathJaxReady, opSchemas, opSchemasAsAnthropicTools, paintBackground, paintIconNode, paintImageNode, panByScreen, paste, pointInNode, projectEndToWorld, projectToNodeBoundary, quantizeDpr, quantizeZoom, randomClientId, rectContainsPoint, rectFromPoints, rectsIntersect, registerMigrator, renderMinimapContent, resolveColor, resolveOpacity, resolveRenderScale, resolveStrokeWidth, rotateHandleWorldPosition, rotateVecByAngle, sampleBezier, sampleSelfLoop, samplesFor, sanitizeSvg, sceneBounds, screenToWorld, selfLoopGeometry, serializeSelection, setupSurface, shouldAutoFit, shouldRejectTouch, sideNormalLocal, sideOf, sideToward, sizeSurface, storeToJSON, subscribeFontEpoch, subscribeMathEpoch, tangentAtArcLength, toImageBlob, toSerialized, toggleBold, toggleCode, toggleItalic, toggleStrike, toggleUnderline, tokenize, unionRects, validateImageInput, validateSvgMarkup, viewportWorldRect, withAutoFitHeight, worldToNodeLocal, worldToScreen, worldViewport, worldViewportFromCamera, zoomAtScreenPoint };
|
package/dist/index.d.ts
CHANGED
|
@@ -2192,6 +2192,35 @@ type Opts = {
|
|
|
2192
2192
|
};
|
|
2193
2193
|
declare const createFrameLoop: ({ draw, historySize }: Opts) => FrameLoop;
|
|
2194
2194
|
|
|
2195
|
+
type AssetCacheOptions = {
|
|
2196
|
+
/** Called when a pending entry transitions to ready or error. */
|
|
2197
|
+
onReady?: () => void;
|
|
2198
|
+
};
|
|
2199
|
+
type AssetCache = {
|
|
2200
|
+
/** Returns a loaded HTMLImageElement or null if still loading. */
|
|
2201
|
+
getImage(src: string): HTMLImageElement | null;
|
|
2202
|
+
/**
|
|
2203
|
+
* Returns a rasterized ImageBitmap for the given SVG markup at the
|
|
2204
|
+
* given on-device pixel size + tint color, or null if pending.
|
|
2205
|
+
*/
|
|
2206
|
+
getIcon(markup: string, color: string | undefined, devicePixelSize: number): ImageBitmap | null;
|
|
2207
|
+
/** Frees decoded bitmaps. Call from renderer.dispose(). */
|
|
2208
|
+
dispose(): void;
|
|
2209
|
+
};
|
|
2210
|
+
declare const createAssetCache: (opts?: AssetCacheOptions) => AssetCache;
|
|
2211
|
+
|
|
2212
|
+
/**
|
|
2213
|
+
* Paint helpers for `image` and `icon` node types. Caller is already
|
|
2214
|
+
* inside `drawWithNodeTransform` (origin at the node's top-left,
|
|
2215
|
+
* rotation applied), so we paint into local space `(0, 0, w, h)`.
|
|
2216
|
+
*
|
|
2217
|
+
* Both helpers return true when a bitmap was blitted, false when the
|
|
2218
|
+
* bitmap is still loading (caller may paint a placeholder).
|
|
2219
|
+
*/
|
|
2220
|
+
|
|
2221
|
+
declare const paintImageNode: (ctx: CanvasRenderingContext2D, node: Node, cache: AssetCache, theme?: ThemeResolver) => void;
|
|
2222
|
+
declare const paintIconNode: (ctx: CanvasRenderingContext2D, node: Node, cache: AssetCache, scale: number, theme?: ThemeResolver) => void;
|
|
2223
|
+
|
|
2195
2224
|
/**
|
|
2196
2225
|
* Generic primitive paint pass.
|
|
2197
2226
|
*
|
|
@@ -2294,6 +2323,13 @@ type Renderer = {
|
|
|
2294
2323
|
lastDrawCount(): number;
|
|
2295
2324
|
/** Current overlay-mounted custom-node ids. */
|
|
2296
2325
|
getOverlaySet(): NodeId[];
|
|
2326
|
+
/**
|
|
2327
|
+
* Renderer-owned asset cache (decoded image bitmaps + rasterized
|
|
2328
|
+
* SVG icons). Pass to {@link exportSelection} / {@link exportViewport}
|
|
2329
|
+
* so PNG export paints image + icon nodes from the same bitmaps the
|
|
2330
|
+
* live canvas uses.
|
|
2331
|
+
*/
|
|
2332
|
+
getAssetCache(): AssetCache;
|
|
2297
2333
|
/** Detach event listeners. The store is left untouched. */
|
|
2298
2334
|
dispose(): void;
|
|
2299
2335
|
};
|
|
@@ -2499,10 +2535,14 @@ type Hit = NodeHit | EdgeHit;
|
|
|
2499
2535
|
declare const hitTestPoint: (store: CanvasStore, worldPoint: Vec2, cameraZ: number, selectedIds?: ReadonlySet<NodeId>) => NodeHit | null;
|
|
2500
2536
|
/**
|
|
2501
2537
|
* Combined node + edge hit testing. Order: node handles > edge endpoint
|
|
2502
|
-
* handles > node
|
|
2538
|
+
* handles > visually-topmost body (node or edge, compared by z).
|
|
2503
2539
|
*
|
|
2504
|
-
*
|
|
2505
|
-
*
|
|
2540
|
+
* For bodies, the rule is paint-order: whichever of (node body, edge
|
|
2541
|
+
* body) has the higher z wins, with ties going to edges (edges paint
|
|
2542
|
+
* over nodes by convention). This lets users click an edge that runs
|
|
2543
|
+
* visually over a large background-style node — the 8px polyline slop
|
|
2544
|
+
* keeps the edge's hit zone narrow, so clicks far from the polyline
|
|
2545
|
+
* still land on the node underneath.
|
|
2506
2546
|
*/
|
|
2507
2547
|
declare const hitTestAny: (store: CanvasStore, worldPoint: Vec2, cameraZ: number, selectedNodes?: ReadonlySet<NodeId>, selectedEdges?: ReadonlySet<EdgeId>) => Hit | null;
|
|
2508
2548
|
/**
|
|
@@ -2652,6 +2692,14 @@ type ExportOptions = {
|
|
|
2652
2692
|
backgroundColor?: string;
|
|
2653
2693
|
/** Theme resolver, same one passed to the live renderer. */
|
|
2654
2694
|
theme?: ThemeResolver;
|
|
2695
|
+
/**
|
|
2696
|
+
* Renderer-owned asset cache. When provided, `image` and `icon`
|
|
2697
|
+
* nodes paint from the same decoded bitmaps the live canvas uses.
|
|
2698
|
+
* When omitted, those node types are skipped (back-compat).
|
|
2699
|
+
*
|
|
2700
|
+
* Usage: `exportSelection(store, { assetCache: renderer.getAssetCache() })`.
|
|
2701
|
+
*/
|
|
2702
|
+
assetCache?: AssetCache;
|
|
2655
2703
|
};
|
|
2656
2704
|
/**
|
|
2657
2705
|
* Renders the current selection to a PNG. Returns a `Blob` you can
|
|
@@ -2693,8 +2741,13 @@ declare const exportViewport: (store: CanvasStore, viewport: {
|
|
|
2693
2741
|
/**
|
|
2694
2742
|
* SVG export — see ARCHITECTURE.md §13.
|
|
2695
2743
|
*
|
|
2696
|
-
* **Scope**: matches PNG export for shape geometry + edge geometry
|
|
2697
|
-
*
|
|
2744
|
+
* **Scope**: matches PNG export for shape geometry + edge geometry.
|
|
2745
|
+
* Image nodes are inlined as `<image href="…">` (data URI passes
|
|
2746
|
+
* through verbatim). Icon nodes nest their sanitized SVG markup inside
|
|
2747
|
+
* a `<g transform>`, preserving vector quality and the `iconColor`
|
|
2748
|
+
* recolor knob.
|
|
2749
|
+
*
|
|
2750
|
+
* Markdown content is emitted as **plain text** (no inline bold /
|
|
2698
2751
|
* italic / highlight). SVG `<text>` doesn't support our markdown
|
|
2699
2752
|
* dialect without tspan positioning math; deferred to v2. PNG export
|
|
2700
2753
|
* preserves all markdown styling via the bitmap pipeline.
|
|
@@ -3485,4 +3538,4 @@ declare const installedExtensions: (store: CanvasStore) => string[];
|
|
|
3485
3538
|
*/
|
|
3486
3539
|
declare const VERSION = "0.0.0";
|
|
3487
3540
|
|
|
3488
|
-
export { type AnthropicToolDef, type Arrowhead, BEZIER_SEGMENTS, type BatchId, type BitmapCacheEntry, type BitmapCacheRequest, type BuiltInNodeType, CODE_BG_COLOR, CODE_BLOCK_MARGIN_Y, CODE_BLOCK_PADDING_X, CONTENT_HEIGHT_BUFFER, CONTENT_PADDING, type CameraState, type CanvasBackground, type CanvasBackgroundPattern, type CanvasStore, type CanvasSurface, type ClientId, type ClipResult, type ConflictRecord, type ContextEdge, type ContextNode, DEFAULT_BACKGROUND, DEFAULT_CAMERA, DEFAULT_HIGHLIGHT_COLOR, DEFAULT_HIGHLIGHT_COLOR_DARK, DEFAULT_MINIMAP_MAX_NODES, DEFAULT_STYLE, DEFAULT_TEXT_COLOR, type DeserializeOptions, type DragOriginal, type DrawTextOptions, EDGE_HANDLE_SLOP_PX, EDGE_HIT_SLOP_PX, type Edge, type EdgeEnd, type EdgeGeometry, EdgeGeometryCache, type EdgeHit, type EdgeId, type EdgeStyle, type EditorAdapter, type EditorAdapterFactory, type EditorAdapterMountOptions, type EstimateOptions, type ExportOptions, type Extension, type ExtensionApi, FONT_FAMILY_MAP, FONT_SIZE_MAP, type FontFamily, type FontSize, type FrameLoop, type FrameStats, type GetContextOptions, type Group, type GroupId, type Hit, type IconNodeData, type IdGenerator, type ImageNodeData, type InlineType, type InteractionMode, type InteractionState, LINE_HEIGHT_MAP, LINK_COLOR, type LayoutLine, type LayoutOptions, MAX_IMAGE_BYTES, MAX_SVG_BYTES, MAX_ZOOM, MIN_ZOOM, type MathBitmap, type Migrator, type MinimapContentOptions, type Node, type NodeHit, type NodeId, type NodeType, type NodeTypeDef, type NodeTypeDefOptions, type Op, type OpBatch, type OpOrigin, PALM_REJECTION_GRACE_MS, type PalmRejectionState, type PathStyle, type PointerInfo, type PresenceEvent, type PresencePatch, type PresenceSlice, type PresenceState, type PrimitiveType, RESIZE_HANDLES, RESIZE_HANDLE_SIZE_PX, ROTATE_HANDLE_OFFSET_PX, ROTATE_HANDLE_RADIUS_PX, type RenderEnv, type Renderer, type RendererOptions, type ResizeHandle, SCHEMA_VERSION, type Scene, type SceneContextJson, type SchemaVersion, type SerializedClipboard, type SerializedScene, type Side, type SnapshotEnv, type SpatialId, type SpatialQuery, type SpatialResult, type StoreEventHandler, type StoreEventName, type StoreEvents, type StoreOptions, type StrokeStyle, type Style, type StyledRun, type SvgExportOptions, type SyncAdapter, type SyncAdapterCapabilities, type TextAlign, type TextStyle, type ThemeResolver, type Token, type Transform, UniformGrid, type Unsubscribe, VERSION, type Vec2, type WorldRect, applyCameraTransform, applySvgColor, arrowheadLength, asBatchId, asClientId, asEdgeId, asGroupId, asNodeId, attachSync, autoRouteControls, blobToDataUri, clampEffectiveScale, clampZoom, clearMathCache, clearMeasureCache, clearSurface, clearTextBitmapCache, clipSamples, computeAutoFitHeight, computeEdgeGeometry, copy, createCanvasStore, createDefaultTextareaEditor, createFrameLoop, createPalmRejectionState, createRenderer, cubicBezier, cubicBezierTangent, cut, defineExtension, defineNode, deserializeClipboard, detectConflicts, downscaleImageBlob, drawArrowhead, drawEdge, drawMinimapViewport, drawShape, drawTextToCanvas, drawWithNodeTransform, edgeAABBFromSamples, edgeLabelBoundsWorld, emptyPresenceState, estimateMarkdownContentHeight, exportSelection, exportSelectionSvg, exportViewport, extractSvgDimensions, fromSerialized, fullVisibleClipResult, getCanvasFont, getContentHeight, getContext, getDpr, getFontEpoch, getMarkdownLineHeightPx, getMathBitmap, getMathCacheSize, getMathEpoch, getMathJax, getOrRenderTextBitmap, getPointAndTangentAtArcLength, getTextBitmapCacheSize, handleEnter, handleWorldPositions, hitTestAny, hitTestEdge, hitTestHandles, hitTestPoint, hitTestRotateHandle, idleInteractionState, inflateRect, insertLink, installExtension, installedExtensions, inverseBatch, inverseOp, isAttached, isCanvasHarnessClipboard, isDrawablePrimitive, isMoving, isNodeRemoteEditing, layoutTokens, makeIdGenerator, marqueeNodes, measureText, midpointToCubicControls, minimapScreenToWorld, nodeAABB, nodeIntersectsRect, nodeLocalToWorld, notePenActive, notePenInactive, onMathJaxReady, opSchemas, opSchemasAsAnthropicTools, paintBackground, panByScreen, paste, pointInNode, projectEndToWorld, projectToNodeBoundary, quantizeDpr, quantizeZoom, randomClientId, rectContainsPoint, rectFromPoints, rectsIntersect, registerMigrator, renderMinimapContent, resolveColor, resolveOpacity, resolveRenderScale, resolveStrokeWidth, rotateHandleWorldPosition, rotateVecByAngle, sampleBezier, sampleSelfLoop, samplesFor, sanitizeSvg, sceneBounds, screenToWorld, selfLoopGeometry, serializeSelection, setupSurface, shouldAutoFit, shouldRejectTouch, sideNormalLocal, sideOf, sideToward, sizeSurface, storeToJSON, subscribeFontEpoch, subscribeMathEpoch, tangentAtArcLength, toImageBlob, toSerialized, toggleBold, toggleCode, toggleItalic, toggleStrike, toggleUnderline, tokenize, unionRects, validateImageInput, validateSvgMarkup, viewportWorldRect, withAutoFitHeight, worldToNodeLocal, worldToScreen, worldViewport, worldViewportFromCamera, zoomAtScreenPoint };
|
|
3541
|
+
export { type AnthropicToolDef, type Arrowhead, type AssetCache, type AssetCacheOptions, BEZIER_SEGMENTS, type BatchId, type BitmapCacheEntry, type BitmapCacheRequest, type BuiltInNodeType, CODE_BG_COLOR, CODE_BLOCK_MARGIN_Y, CODE_BLOCK_PADDING_X, CONTENT_HEIGHT_BUFFER, CONTENT_PADDING, type CameraState, type CanvasBackground, type CanvasBackgroundPattern, type CanvasStore, type CanvasSurface, type ClientId, type ClipResult, type ConflictRecord, type ContextEdge, type ContextNode, DEFAULT_BACKGROUND, DEFAULT_CAMERA, DEFAULT_HIGHLIGHT_COLOR, DEFAULT_HIGHLIGHT_COLOR_DARK, DEFAULT_MINIMAP_MAX_NODES, DEFAULT_STYLE, DEFAULT_TEXT_COLOR, type DeserializeOptions, type DragOriginal, type DrawTextOptions, EDGE_HANDLE_SLOP_PX, EDGE_HIT_SLOP_PX, type Edge, type EdgeEnd, type EdgeGeometry, EdgeGeometryCache, type EdgeHit, type EdgeId, type EdgeStyle, type EditorAdapter, type EditorAdapterFactory, type EditorAdapterMountOptions, type EstimateOptions, type ExportOptions, type Extension, type ExtensionApi, FONT_FAMILY_MAP, FONT_SIZE_MAP, type FontFamily, type FontSize, type FrameLoop, type FrameStats, type GetContextOptions, type Group, type GroupId, type Hit, type IconNodeData, type IdGenerator, type ImageNodeData, type InlineType, type InteractionMode, type InteractionState, LINE_HEIGHT_MAP, LINK_COLOR, type LayoutLine, type LayoutOptions, MAX_IMAGE_BYTES, MAX_SVG_BYTES, MAX_ZOOM, MIN_ZOOM, type MathBitmap, type Migrator, type MinimapContentOptions, type Node, type NodeHit, type NodeId, type NodeType, type NodeTypeDef, type NodeTypeDefOptions, type Op, type OpBatch, type OpOrigin, PALM_REJECTION_GRACE_MS, type PalmRejectionState, type PathStyle, type PointerInfo, type PresenceEvent, type PresencePatch, type PresenceSlice, type PresenceState, type PrimitiveType, RESIZE_HANDLES, RESIZE_HANDLE_SIZE_PX, ROTATE_HANDLE_OFFSET_PX, ROTATE_HANDLE_RADIUS_PX, type RenderEnv, type Renderer, type RendererOptions, type ResizeHandle, SCHEMA_VERSION, type Scene, type SceneContextJson, type SchemaVersion, type SerializedClipboard, type SerializedScene, type Side, type SnapshotEnv, type SpatialId, type SpatialQuery, type SpatialResult, type StoreEventHandler, type StoreEventName, type StoreEvents, type StoreOptions, type StrokeStyle, type Style, type StyledRun, type SvgExportOptions, type SyncAdapter, type SyncAdapterCapabilities, type TextAlign, type TextStyle, type ThemeResolver, type Token, type Transform, UniformGrid, type Unsubscribe, VERSION, type Vec2, type WorldRect, applyCameraTransform, applySvgColor, arrowheadLength, asBatchId, asClientId, asEdgeId, asGroupId, asNodeId, attachSync, autoRouteControls, blobToDataUri, clampEffectiveScale, clampZoom, clearMathCache, clearMeasureCache, clearSurface, clearTextBitmapCache, clipSamples, computeAutoFitHeight, computeEdgeGeometry, copy, createAssetCache, createCanvasStore, createDefaultTextareaEditor, createFrameLoop, createPalmRejectionState, createRenderer, cubicBezier, cubicBezierTangent, cut, defineExtension, defineNode, deserializeClipboard, detectConflicts, downscaleImageBlob, drawArrowhead, drawEdge, drawMinimapViewport, drawShape, drawTextToCanvas, drawWithNodeTransform, edgeAABBFromSamples, edgeLabelBoundsWorld, emptyPresenceState, estimateMarkdownContentHeight, exportSelection, exportSelectionSvg, exportViewport, extractSvgDimensions, fromSerialized, fullVisibleClipResult, getCanvasFont, getContentHeight, getContext, getDpr, getFontEpoch, getMarkdownLineHeightPx, getMathBitmap, getMathCacheSize, getMathEpoch, getMathJax, getOrRenderTextBitmap, getPointAndTangentAtArcLength, getTextBitmapCacheSize, handleEnter, handleWorldPositions, hitTestAny, hitTestEdge, hitTestHandles, hitTestPoint, hitTestRotateHandle, idleInteractionState, inflateRect, insertLink, installExtension, installedExtensions, inverseBatch, inverseOp, isAttached, isCanvasHarnessClipboard, isDrawablePrimitive, isMoving, isNodeRemoteEditing, layoutTokens, makeIdGenerator, marqueeNodes, measureText, midpointToCubicControls, minimapScreenToWorld, nodeAABB, nodeIntersectsRect, nodeLocalToWorld, notePenActive, notePenInactive, onMathJaxReady, opSchemas, opSchemasAsAnthropicTools, paintBackground, paintIconNode, paintImageNode, panByScreen, paste, pointInNode, projectEndToWorld, projectToNodeBoundary, quantizeDpr, quantizeZoom, randomClientId, rectContainsPoint, rectFromPoints, rectsIntersect, registerMigrator, renderMinimapContent, resolveColor, resolveOpacity, resolveRenderScale, resolveStrokeWidth, rotateHandleWorldPosition, rotateVecByAngle, sampleBezier, sampleSelfLoop, samplesFor, sanitizeSvg, sceneBounds, screenToWorld, selfLoopGeometry, serializeSelection, setupSurface, shouldAutoFit, shouldRejectTouch, sideNormalLocal, sideOf, sideToward, sizeSurface, storeToJSON, subscribeFontEpoch, subscribeMathEpoch, tangentAtArcLength, toImageBlob, toSerialized, toggleBold, toggleCode, toggleItalic, toggleStrike, toggleUnderline, tokenize, unionRects, validateImageInput, validateSvgMarkup, viewportWorldRect, withAutoFitHeight, worldToNodeLocal, worldToScreen, worldViewport, worldViewportFromCamera, zoomAtScreenPoint };
|
package/dist/index.js
CHANGED
|
@@ -5517,6 +5517,7 @@ var createRenderer = (opts) => {
|
|
|
5517
5517
|
stats: () => loop.stats(),
|
|
5518
5518
|
lastDrawCount: () => lastDrawn,
|
|
5519
5519
|
getOverlaySet: () => [...overlaySet],
|
|
5520
|
+
getAssetCache: () => assetCache,
|
|
5520
5521
|
dispose() {
|
|
5521
5522
|
loop.stop();
|
|
5522
5523
|
unsubChange();
|
|
@@ -5851,8 +5852,13 @@ var hitTestAny = (store, worldPoint, cameraZ, selectedNodes = /* @__PURE__ */ ne
|
|
|
5851
5852
|
}
|
|
5852
5853
|
}
|
|
5853
5854
|
const nodeHit = hitTestPoint(store, worldPoint, cameraZ, selectedNodes);
|
|
5854
|
-
|
|
5855
|
-
|
|
5855
|
+
const edgeHit = hitTestEdge(store, worldPoint, cameraZ);
|
|
5856
|
+
if (nodeHit && edgeHit && "edgeId" in edgeHit) {
|
|
5857
|
+
const nodeZ = store.getNode(nodeHit.nodeId)?.z ?? 0;
|
|
5858
|
+
const edgeZ = store.getEdge(edgeHit.edgeId)?.z ?? 0;
|
|
5859
|
+
return edgeZ >= nodeZ ? edgeHit : nodeHit;
|
|
5860
|
+
}
|
|
5861
|
+
return nodeHit ?? edgeHit;
|
|
5856
5862
|
};
|
|
5857
5863
|
var marqueeNodes = (store, rect) => {
|
|
5858
5864
|
const candidates = store.querySpatial({ rect }).nodes;
|
|
@@ -6107,9 +6113,14 @@ var makeContext = (cssW, cssH, scale, opts) => {
|
|
|
6107
6113
|
};
|
|
6108
6114
|
var paintScene = (ctx, store, nodes, scale, opts, edges) => {
|
|
6109
6115
|
const theme = opts.theme;
|
|
6116
|
+
const assetCache = opts.assetCache;
|
|
6110
6117
|
for (const node of nodes) {
|
|
6111
6118
|
drawWithNodeTransform(ctx, node, () => {
|
|
6112
6119
|
if (isDrawablePrimitive(node.type)) drawShape(ctx, node, scale, theme);
|
|
6120
|
+
if (assetCache) {
|
|
6121
|
+
if (node.type === "image") paintImageNode(ctx, node, assetCache, theme);
|
|
6122
|
+
else if (node.type === "icon") paintIconNode(ctx, node, assetCache, scale, theme);
|
|
6123
|
+
}
|
|
6113
6124
|
paintContent(ctx, node);
|
|
6114
6125
|
});
|
|
6115
6126
|
}
|
|
@@ -6221,10 +6232,30 @@ var renderNodeSvg = (node) => {
|
|
|
6221
6232
|
const strokeWidth = node.style?.strokeWidth ?? 1.5;
|
|
6222
6233
|
const opacity = node.style?.opacity ?? 1;
|
|
6223
6234
|
const rotate = node.angle !== 0 ? ` transform="rotate(${node.angle * 180 / Math.PI} ${node.x + node.w / 2} ${node.y + node.h / 2})"` : "";
|
|
6224
|
-
const shape = renderShapeSvg(node, fill, stroke, strokeWidth, opacity);
|
|
6225
6235
|
const text = renderTextSvg(node);
|
|
6236
|
+
if (node.type === "image") {
|
|
6237
|
+
return `<g${rotate}>${renderImageNodeSvg(node, opacity)}${text}</g>`;
|
|
6238
|
+
}
|
|
6239
|
+
if (node.type === "icon") {
|
|
6240
|
+
return `<g${rotate}>${renderIconNodeSvg(node, opacity)}${text}</g>`;
|
|
6241
|
+
}
|
|
6242
|
+
const shape = renderShapeSvg(node, fill, stroke, strokeWidth, opacity);
|
|
6226
6243
|
return `<g${rotate}>${shape}${text}</g>`;
|
|
6227
6244
|
};
|
|
6245
|
+
var renderImageNodeSvg = (node, opacity) => {
|
|
6246
|
+
const data = node.data;
|
|
6247
|
+
if (!data?.src) return "";
|
|
6248
|
+
return `<image href="${escapeAttr(data.src)}" x="${node.x}" y="${node.y}" width="${node.w}" height="${node.h}" preserveAspectRatio="none" opacity="${opacity}" />`;
|
|
6249
|
+
};
|
|
6250
|
+
var renderIconNodeSvg = (node, opacity) => {
|
|
6251
|
+
const data = node.data;
|
|
6252
|
+
if (!data?.src) return "";
|
|
6253
|
+
const colored = node.style?.iconColor ? applySvgColor(data.src, node.style.iconColor) : data.src;
|
|
6254
|
+
const dim = extractSvgDimensions(colored);
|
|
6255
|
+
const sx = node.w / dim.w;
|
|
6256
|
+
const sy = node.h / dim.h;
|
|
6257
|
+
return `<g transform="translate(${node.x} ${node.y}) scale(${sx} ${sy})" opacity="${opacity}">${colored}</g>`;
|
|
6258
|
+
};
|
|
6228
6259
|
var renderShapeSvg = (node, fill, stroke, strokeWidth, opacity) => {
|
|
6229
6260
|
const attrs = (extra) => `fill="${escapeAttr(fill)}" stroke="${escapeAttr(stroke)}" stroke-width="${strokeWidth}" opacity="${opacity}"${extra}`;
|
|
6230
6261
|
switch (node.type) {
|
|
@@ -6593,6 +6624,6 @@ var installedExtensions = (store) => {
|
|
|
6593
6624
|
// src/index.ts
|
|
6594
6625
|
var VERSION = "0.0.0";
|
|
6595
6626
|
|
|
6596
|
-
export { BEZIER_SEGMENTS, CODE_BG_COLOR, CODE_BLOCK_MARGIN_Y, CODE_BLOCK_PADDING_X, CONTENT_HEIGHT_BUFFER, CONTENT_PADDING, DEFAULT_BACKGROUND, DEFAULT_CAMERA, DEFAULT_HIGHLIGHT_COLOR, DEFAULT_HIGHLIGHT_COLOR_DARK, DEFAULT_MINIMAP_MAX_NODES, DEFAULT_STYLE, DEFAULT_TEXT_COLOR, EDGE_HANDLE_SLOP_PX, EDGE_HIT_SLOP_PX, EdgeGeometryCache, FONT_FAMILY_MAP, FONT_SIZE_MAP, LINE_HEIGHT_MAP, LINK_COLOR, MAX_IMAGE_BYTES, MAX_SVG_BYTES, MAX_ZOOM, MIN_ZOOM, PALM_REJECTION_GRACE_MS, RESIZE_HANDLES, RESIZE_HANDLE_SIZE_PX, ROTATE_HANDLE_OFFSET_PX, ROTATE_HANDLE_RADIUS_PX, SCHEMA_VERSION, UniformGrid, VERSION, applyCameraTransform, applySvgColor, arrowheadLength, asBatchId, asClientId, asEdgeId, asGroupId, asNodeId, attachSync, autoRouteControls, blobToDataUri, clampEffectiveScale, clampZoom, clearMathCache, clearMeasureCache, clearSurface, clearTextBitmapCache, clipSamples, computeAutoFitHeight, computeEdgeGeometry, copy, createCanvasStore, createDefaultTextareaEditor, createFrameLoop, createPalmRejectionState, createRenderer, cubicBezier, cubicBezierTangent, cut, defineExtension, defineNode, deserializeClipboard, detectConflicts, downscaleImageBlob, drawArrowhead, drawEdge, drawMinimapViewport, drawShape, drawTextToCanvas, drawWithNodeTransform, edgeAABBFromSamples, edgeLabelBoundsWorld, emptyPresenceState, estimateMarkdownContentHeight, exportSelection, exportSelectionSvg, exportViewport, extractSvgDimensions, fromSerialized, fullVisibleClipResult, getCanvasFont, getContentHeight, getContext, getDpr, getFontEpoch, getMarkdownLineHeightPx, getMathBitmap, getMathCacheSize, getMathEpoch, getMathJax, getOrRenderTextBitmap, getPointAndTangentAtArcLength, getTextBitmapCacheSize, handleEnter, handleWorldPositions, hitTestAny, hitTestEdge, hitTestHandles, hitTestPoint, hitTestRotateHandle, idleInteractionState, inflateRect, insertLink, installExtension, installedExtensions, inverseBatch, inverseOp, isAttached, isCanvasHarnessClipboard, isDrawablePrimitive, isMoving, isNodeRemoteEditing, layoutTokens, makeIdGenerator, marqueeNodes, measureText, midpointToCubicControls, minimapScreenToWorld, nodeAABB, nodeIntersectsRect, nodeLocalToWorld, notePenActive, notePenInactive, onMathJaxReady, opSchemas, opSchemasAsAnthropicTools, paintBackground, panByScreen, paste, pointInNode, projectEndToWorld, projectToNodeBoundary, quantizeDpr, quantizeZoom, randomClientId, rectContainsPoint, rectFromPoints, rectsIntersect, registerMigrator, renderMinimapContent, resolveColor, resolveOpacity, resolveRenderScale, resolveStrokeWidth, rotateHandleWorldPosition, rotateVecByAngle, sampleBezier, sampleSelfLoop, samplesFor, sanitizeSvg, sceneBounds, screenToWorld, selfLoopGeometry, serializeSelection, setupSurface, shouldAutoFit, shouldRejectTouch, sideNormalLocal, sideOf, sideToward, sizeSurface, storeToJSON, subscribeFontEpoch, subscribeMathEpoch, tangentAtArcLength, toImageBlob, toSerialized, toggleBold, toggleCode, toggleItalic, toggleStrike, toggleUnderline, tokenize, unionRects, validateImageInput, validateSvgMarkup, viewportWorldRect, withAutoFitHeight, worldToNodeLocal, worldToScreen, worldViewport, worldViewportFromCamera, zoomAtScreenPoint };
|
|
6627
|
+
export { BEZIER_SEGMENTS, CODE_BG_COLOR, CODE_BLOCK_MARGIN_Y, CODE_BLOCK_PADDING_X, CONTENT_HEIGHT_BUFFER, CONTENT_PADDING, DEFAULT_BACKGROUND, DEFAULT_CAMERA, DEFAULT_HIGHLIGHT_COLOR, DEFAULT_HIGHLIGHT_COLOR_DARK, DEFAULT_MINIMAP_MAX_NODES, DEFAULT_STYLE, DEFAULT_TEXT_COLOR, EDGE_HANDLE_SLOP_PX, EDGE_HIT_SLOP_PX, EdgeGeometryCache, FONT_FAMILY_MAP, FONT_SIZE_MAP, LINE_HEIGHT_MAP, LINK_COLOR, MAX_IMAGE_BYTES, MAX_SVG_BYTES, MAX_ZOOM, MIN_ZOOM, PALM_REJECTION_GRACE_MS, RESIZE_HANDLES, RESIZE_HANDLE_SIZE_PX, ROTATE_HANDLE_OFFSET_PX, ROTATE_HANDLE_RADIUS_PX, SCHEMA_VERSION, UniformGrid, VERSION, applyCameraTransform, applySvgColor, arrowheadLength, asBatchId, asClientId, asEdgeId, asGroupId, asNodeId, attachSync, autoRouteControls, blobToDataUri, clampEffectiveScale, clampZoom, clearMathCache, clearMeasureCache, clearSurface, clearTextBitmapCache, clipSamples, computeAutoFitHeight, computeEdgeGeometry, copy, createAssetCache, createCanvasStore, createDefaultTextareaEditor, createFrameLoop, createPalmRejectionState, createRenderer, cubicBezier, cubicBezierTangent, cut, defineExtension, defineNode, deserializeClipboard, detectConflicts, downscaleImageBlob, drawArrowhead, drawEdge, drawMinimapViewport, drawShape, drawTextToCanvas, drawWithNodeTransform, edgeAABBFromSamples, edgeLabelBoundsWorld, emptyPresenceState, estimateMarkdownContentHeight, exportSelection, exportSelectionSvg, exportViewport, extractSvgDimensions, fromSerialized, fullVisibleClipResult, getCanvasFont, getContentHeight, getContext, getDpr, getFontEpoch, getMarkdownLineHeightPx, getMathBitmap, getMathCacheSize, getMathEpoch, getMathJax, getOrRenderTextBitmap, getPointAndTangentAtArcLength, getTextBitmapCacheSize, handleEnter, handleWorldPositions, hitTestAny, hitTestEdge, hitTestHandles, hitTestPoint, hitTestRotateHandle, idleInteractionState, inflateRect, insertLink, installExtension, installedExtensions, inverseBatch, inverseOp, isAttached, isCanvasHarnessClipboard, isDrawablePrimitive, isMoving, isNodeRemoteEditing, layoutTokens, makeIdGenerator, marqueeNodes, measureText, midpointToCubicControls, minimapScreenToWorld, nodeAABB, nodeIntersectsRect, nodeLocalToWorld, notePenActive, notePenInactive, onMathJaxReady, opSchemas, opSchemasAsAnthropicTools, paintBackground, paintIconNode, paintImageNode, panByScreen, paste, pointInNode, projectEndToWorld, projectToNodeBoundary, quantizeDpr, quantizeZoom, randomClientId, rectContainsPoint, rectFromPoints, rectsIntersect, registerMigrator, renderMinimapContent, resolveColor, resolveOpacity, resolveRenderScale, resolveStrokeWidth, rotateHandleWorldPosition, rotateVecByAngle, sampleBezier, sampleSelfLoop, samplesFor, sanitizeSvg, sceneBounds, screenToWorld, selfLoopGeometry, serializeSelection, setupSurface, shouldAutoFit, shouldRejectTouch, sideNormalLocal, sideOf, sideToward, sizeSurface, storeToJSON, subscribeFontEpoch, subscribeMathEpoch, tangentAtArcLength, toImageBlob, toSerialized, toggleBold, toggleCode, toggleItalic, toggleStrike, toggleUnderline, tokenize, unionRects, validateImageInput, validateSvgMarkup, viewportWorldRect, withAutoFitHeight, worldToNodeLocal, worldToScreen, worldViewport, worldViewportFromCamera, zoomAtScreenPoint };
|
|
6597
6628
|
//# sourceMappingURL=index.js.map
|
|
6598
6629
|
//# sourceMappingURL=index.js.map
|