@scrawl-board/board 0.1.0-beta.1 → 0.1.0-beta.3
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/browser.d.ts +32 -16
- package/dist/browser.js +163 -118
- package/dist/core.d.ts +16 -3
- package/dist/core.js +31 -23
- package/dist/index.d.ts +110 -20
- package/dist/index.js +216 -136
- package/dist/react.d.ts +101 -19
- package/dist/react.js +215 -135
- package/dist/styles.css +2 -1
- package/package.json +1 -1
package/dist/browser.d.ts
CHANGED
|
@@ -368,8 +368,13 @@ interface StrokePoint extends BoardPoint {
|
|
|
368
368
|
*/
|
|
369
369
|
erase?: number;
|
|
370
370
|
}
|
|
371
|
-
/**
|
|
372
|
-
|
|
371
|
+
/**
|
|
372
|
+
* Which drawing tool made a stroke; undefined means marker (back-compat).
|
|
373
|
+
* `"shape"` (rect/ellipse/line/arrow/polygon/star/heart) renders at its
|
|
374
|
+
* exact configured width with no pressure variance or end taper — a
|
|
375
|
+
* geometric outline, not an expressive ink mark.
|
|
376
|
+
*/
|
|
377
|
+
type StrokeTool = "marker" | "highlighter" | "shape";
|
|
373
378
|
interface Stroke extends Lockable {
|
|
374
379
|
id: string;
|
|
375
380
|
color: string;
|
|
@@ -689,6 +694,27 @@ interface BoardView {
|
|
|
689
694
|
y: number;
|
|
690
695
|
zoom: number;
|
|
691
696
|
}
|
|
697
|
+
/**
|
|
698
|
+
* The rendered board surface's color, reference grid, and shape stroke
|
|
699
|
+
* width — the subset of {@link ScrawlTheme} that reaches the rendering
|
|
700
|
+
* engine directly (everything else is UI-chrome-only, applied as CSS). Any
|
|
701
|
+
* field left unset keeps its current value.
|
|
702
|
+
*/
|
|
703
|
+
interface BoardThemeOptions {
|
|
704
|
+
/** The board/canvas background color — distinct from UI chrome panels. */
|
|
705
|
+
surface?: string;
|
|
706
|
+
/** `"flat"` (default): a plain, uniform board surface. `"textured"`: a subtle "melamine" micro-noise + satin sheen, like a physical whiteboard. */
|
|
707
|
+
surfaceTexture?: "flat" | "textured";
|
|
708
|
+
/** `"none"` (default) keeps the board a plain surface; `"line"`/`"dot"` draw a zoom-adaptive reference grid. */
|
|
709
|
+
gridMode?: "none" | "line" | "dot";
|
|
710
|
+
gridColor?: string;
|
|
711
|
+
/** Grid spacing in board units at 100% zoom. Ignored when `gridMode` is `"none"`. */
|
|
712
|
+
gridSpacing?: number;
|
|
713
|
+
/** On-screen grid line/dot width in CSS pixels — stays this width at any zoom, since the grid is a reference aid, not content. */
|
|
714
|
+
gridLineWidth?: number;
|
|
715
|
+
/** Shape (rectangle, ellipse, arrow, ...) border width, in board units — scales with zoom like ink, since it's part of the drawn content. */
|
|
716
|
+
shapeStrokeWidth?: number;
|
|
717
|
+
}
|
|
692
718
|
/**
|
|
693
719
|
* A Host-owned comment, summarized for Board-side search and marker
|
|
694
720
|
* rendering. Comments are not Document content — they carry no undo
|
|
@@ -899,12 +925,7 @@ interface CreateBoardControllerOptions {
|
|
|
899
925
|
* changes via `boardTheme.set` below — a headless/browser-tier Host that
|
|
900
926
|
* doesn't use the React theme system can set this directly instead.
|
|
901
927
|
*/
|
|
902
|
-
boardTheme?:
|
|
903
|
-
surface?: string;
|
|
904
|
-
gridMode?: "none" | "line" | "dot";
|
|
905
|
-
gridColor?: string;
|
|
906
|
-
gridSpacing?: number;
|
|
907
|
-
};
|
|
928
|
+
boardTheme?: BoardThemeOptions;
|
|
908
929
|
}
|
|
909
930
|
interface BoardController {
|
|
910
931
|
readonly document: ReadonlyBoardDocument;
|
|
@@ -931,13 +952,8 @@ interface BoardController {
|
|
|
931
952
|
redo(): void;
|
|
932
953
|
};
|
|
933
954
|
readonly boardTheme: {
|
|
934
|
-
/** Live update of the board surface color/grid — the controller's identity stays fixed across theme changes. */
|
|
935
|
-
set(theme:
|
|
936
|
-
surface?: string;
|
|
937
|
-
gridMode?: "none" | "line" | "dot";
|
|
938
|
-
gridColor?: string;
|
|
939
|
-
gridSpacing?: number;
|
|
940
|
-
}): void;
|
|
955
|
+
/** Live update of the board surface color/grid/shape-stroke-width — the controller's identity stays fixed across theme changes. */
|
|
956
|
+
set(theme: BoardThemeOptions): void;
|
|
941
957
|
};
|
|
942
958
|
readonly view: {
|
|
943
959
|
fit(): void;
|
|
@@ -1040,4 +1056,4 @@ type LocalBoard = {
|
|
|
1040
1056
|
declare function createLocalBoard(options: LocalBoardOptions): LocalBoard;
|
|
1041
1057
|
|
|
1042
1058
|
export { AssetResolutionError, STAMPS, SUPPORTED_ASSET_MEDIA_TYPES, assetRef, clampAssetCacheBytes, cloneCustomObject, createBoardController, createLocalBoard, isAssetRef, isStampKind, stampDataUrl };
|
|
1043
|
-
export type { ApplyOpsResult, AssetDiagnostic, AssetIngestRequest, AssetIngestResult, AssetIngestor, AssetKind, AssetPurpose, AssetRef, AssetResolutionErrorCode, AssetResolveRequest, AssetResolveResult, AssetResolver, BoardController, BoardControllerError, BoardEventMap, BoardKeyInput, BoardObject, BoardObjectInput, BoardObjectPatch, BoardPointerInput, BoardScene, BoardSnapshot, BoardStyle, BoardView, BuiltInTool, CollaborationAdapter, CollaborationReceiver, CollaborationSession, CollaborationSnapshot, CollaboratorIdentity, CommentMarker, ControllerOp, CreateBoardControllerOptions, CustomBoardObject, CustomObjectAddInput, CustomObjectDefinition, CustomTool, CustomToolDefinition, DeepReadonly, DocumentContext, ExtensionCommand, ExtensionDiagnostic, ExtensionHitResult, ExtensionId, ExtensionRequirement, InputModifiers, JsonObject, JsonValue, LoadResult, LocalBoard, LocalBoardOptions, LocalBoardSnapshot, Mat2x3, ObjectDescribeContext, ObjectIntent, ObjectType, PersistenceAdapter, PersistenceDiagnostic, PersistenceSnapshot, PresenceCursor, PresenceUser, PresenceView, QueryableBoardObject, ReadonlyBoardDocument, ReadonlyCustomObject, ReadonlyDocumentChange, SceneEllipse, SceneGroup, SceneImage, ScenePath, SceneRect, SceneText, ScrawlExtension, ScreenPoint, ScreenRect, StampKind, SupportedAssetMediaType, ToolCancelReason, ToolCapabilities, ToolCursor, ToolId };
|
|
1059
|
+
export type { ApplyOpsResult, AssetDiagnostic, AssetIngestRequest, AssetIngestResult, AssetIngestor, AssetKind, AssetPurpose, AssetRef, AssetResolutionErrorCode, AssetResolveRequest, AssetResolveResult, AssetResolver, BoardController, BoardControllerError, BoardEventMap, BoardKeyInput, BoardObject, BoardObjectInput, BoardObjectPatch, BoardPointerInput, BoardScene, BoardSnapshot, BoardStyle, BoardThemeOptions, BoardView, BuiltInTool, CollaborationAdapter, CollaborationReceiver, CollaborationSession, CollaborationSnapshot, CollaboratorIdentity, CommentMarker, ControllerOp, CreateBoardControllerOptions, CustomBoardObject, CustomObjectAddInput, CustomObjectDefinition, CustomTool, CustomToolDefinition, DeepReadonly, DocumentContext, ExtensionCommand, ExtensionDiagnostic, ExtensionHitResult, ExtensionId, ExtensionRequirement, InputModifiers, JsonObject, JsonValue, LoadResult, LocalBoard, LocalBoardOptions, LocalBoardSnapshot, Mat2x3, ObjectDescribeContext, ObjectIntent, ObjectType, PersistenceAdapter, PersistenceDiagnostic, PersistenceSnapshot, PresenceCursor, PresenceUser, PresenceView, QueryableBoardObject, ReadonlyBoardDocument, ReadonlyCustomObject, ReadonlyDocumentChange, SceneEllipse, SceneGroup, SceneImage, ScenePath, SceneRect, SceneText, ScrawlExtension, ScreenPoint, ScreenRect, StampKind, SupportedAssetMediaType, ToolCancelReason, ToolCapabilities, ToolCursor, ToolId };
|