@scrawl-board/board 0.1.0-beta.1 → 0.1.0-beta.2
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 +25 -14
- package/dist/browser.js +135 -93
- package/dist/core.js +19 -19
- package/dist/index.d.ts +63 -14
- package/dist/index.js +175 -106
- package/dist/react.d.ts +63 -14
- package/dist/react.js +174 -105
- package/package.json +1 -1
package/dist/react.d.ts
CHANGED
|
@@ -685,6 +685,27 @@ interface BoardView {
|
|
|
685
685
|
y: number;
|
|
686
686
|
zoom: number;
|
|
687
687
|
}
|
|
688
|
+
/**
|
|
689
|
+
* The rendered board surface's color, reference grid, and shape stroke
|
|
690
|
+
* width — the subset of {@link ScrawlTheme} that reaches the rendering
|
|
691
|
+
* engine directly (everything else is UI-chrome-only, applied as CSS). Any
|
|
692
|
+
* field left unset keeps its current value.
|
|
693
|
+
*/
|
|
694
|
+
interface BoardThemeOptions {
|
|
695
|
+
/** The board/canvas background color — distinct from UI chrome panels. */
|
|
696
|
+
surface?: string;
|
|
697
|
+
/** `"flat"` (default): a plain, uniform board surface. `"textured"`: a subtle "melamine" micro-noise + satin sheen, like a physical whiteboard. */
|
|
698
|
+
surfaceTexture?: "flat" | "textured";
|
|
699
|
+
/** `"none"` (default) keeps the board a plain surface; `"line"`/`"dot"` draw a zoom-adaptive reference grid. */
|
|
700
|
+
gridMode?: "none" | "line" | "dot";
|
|
701
|
+
gridColor?: string;
|
|
702
|
+
/** Grid spacing in board units at 100% zoom. Ignored when `gridMode` is `"none"`. */
|
|
703
|
+
gridSpacing?: number;
|
|
704
|
+
/** On-screen grid line/dot width in CSS pixels — stays this width at any zoom, since the grid is a reference aid, not content. */
|
|
705
|
+
gridLineWidth?: number;
|
|
706
|
+
/** Shape (rectangle, ellipse, arrow, ...) border width, in board units — scales with zoom like ink, since it's part of the drawn content. */
|
|
707
|
+
shapeStrokeWidth?: number;
|
|
708
|
+
}
|
|
688
709
|
/**
|
|
689
710
|
* A Host-owned comment, summarized for Board-side search and marker
|
|
690
711
|
* rendering. Comments are not Document content — they carry no undo
|
|
@@ -895,12 +916,7 @@ interface CreateBoardControllerOptions {
|
|
|
895
916
|
* changes via `boardTheme.set` below — a headless/browser-tier Host that
|
|
896
917
|
* doesn't use the React theme system can set this directly instead.
|
|
897
918
|
*/
|
|
898
|
-
boardTheme?:
|
|
899
|
-
surface?: string;
|
|
900
|
-
gridMode?: "none" | "line" | "dot";
|
|
901
|
-
gridColor?: string;
|
|
902
|
-
gridSpacing?: number;
|
|
903
|
-
};
|
|
919
|
+
boardTheme?: BoardThemeOptions;
|
|
904
920
|
}
|
|
905
921
|
interface BoardController {
|
|
906
922
|
readonly document: ReadonlyBoardDocument;
|
|
@@ -927,13 +943,8 @@ interface BoardController {
|
|
|
927
943
|
redo(): void;
|
|
928
944
|
};
|
|
929
945
|
readonly boardTheme: {
|
|
930
|
-
/** Live update of the board surface color/grid — the controller's identity stays fixed across theme changes. */
|
|
931
|
-
set(theme:
|
|
932
|
-
surface?: string;
|
|
933
|
-
gridMode?: "none" | "line" | "dot";
|
|
934
|
-
gridColor?: string;
|
|
935
|
-
gridSpacing?: number;
|
|
936
|
-
}): void;
|
|
946
|
+
/** Live update of the board surface color/grid/shape-stroke-width — the controller's identity stays fixed across theme changes. */
|
|
947
|
+
set(theme: BoardThemeOptions): void;
|
|
937
948
|
};
|
|
938
949
|
readonly view: {
|
|
939
950
|
fit(): void;
|
|
@@ -1032,37 +1043,75 @@ type LocalBoard = {
|
|
|
1032
1043
|
type ScrawlThemePreset = "light" | "dark";
|
|
1033
1044
|
type ScrawlDensity = "comfortable" | "compact";
|
|
1034
1045
|
type ScrawlGridMode = "none" | "line" | "dot";
|
|
1046
|
+
type ScrawlSurfaceTexture = "flat" | "textured";
|
|
1047
|
+
/**
|
|
1048
|
+
* Every field is optional — anything you don't set falls back to the
|
|
1049
|
+
* chosen `preset` ("light" or "dark", see {@link resolveScrawlTheme}).
|
|
1050
|
+
* Overrides are semantic, board-local runtime configuration: they never
|
|
1051
|
+
* get written into the Document or into exports, so switching themes is
|
|
1052
|
+
* always non-destructive.
|
|
1053
|
+
*/
|
|
1035
1054
|
interface ScrawlTheme {
|
|
1055
|
+
/** UI chrome background — toolbar/panel base surface. Distinct from `boardSurface` (the canvas itself). */
|
|
1036
1056
|
surface?: string;
|
|
1057
|
+
/** UI chrome background, one step up from `surface` — popovers, dropdowns, elevated panels. */
|
|
1037
1058
|
surfaceRaised?: string;
|
|
1059
|
+
/** UI chrome background, one step down from `surface` — subtle fills, hover states. */
|
|
1038
1060
|
surfaceMuted?: string;
|
|
1061
|
+
/** Primary UI text color. Checked for contrast against `surface`. */
|
|
1039
1062
|
text?: string;
|
|
1063
|
+
/** Secondary/de-emphasized UI text color. Checked for contrast against `surface`. */
|
|
1040
1064
|
textMuted?: string;
|
|
1065
|
+
/** Borders and dividers between UI chrome elements. */
|
|
1041
1066
|
edge?: string;
|
|
1067
|
+
/** Focus ring color. Checked for contrast against `surface`. */
|
|
1042
1068
|
focus?: string;
|
|
1069
|
+
/** Selection highlight color (e.g. selected list items, not board object selection). */
|
|
1043
1070
|
selection?: string;
|
|
1071
|
+
/** Destructive/error state color (delete confirmations, error text). */
|
|
1044
1072
|
danger?: string;
|
|
1073
|
+
/** Warning state color. */
|
|
1045
1074
|
warning?: string;
|
|
1075
|
+
/** Success/confirmation state color. */
|
|
1046
1076
|
success?: string;
|
|
1077
|
+
/** Font stack for UI chrome (toolbar labels, menus, dialogs). */
|
|
1047
1078
|
uiFontFamily?: string;
|
|
1079
|
+
/** Font stack for board content and data (e.g. table cell text). */
|
|
1048
1080
|
dataFontFamily?: string;
|
|
1081
|
+
/** Base UI font size in px. Range: 12–24. */
|
|
1049
1082
|
baseFontSize?: number;
|
|
1083
|
+
/** Regular UI font weight. Range: 300–900. */
|
|
1050
1084
|
regularWeight?: number;
|
|
1085
|
+
/** Emphasized UI font weight (headings, active states). Range: 300–900. */
|
|
1051
1086
|
strongWeight?: number;
|
|
1087
|
+
/** Corner radius for small controls (buttons, inputs) in px. Range: 0–32. */
|
|
1052
1088
|
controlRadius?: number;
|
|
1089
|
+
/** Corner radius for panels/dialogs in px. Range: 0–32. */
|
|
1053
1090
|
panelRadius?: number;
|
|
1091
|
+
/** CSS `box-shadow` value for subtle elevation (e.g. toolbar). */
|
|
1054
1092
|
elevationLow?: string;
|
|
1093
|
+
/** CSS `box-shadow` value for prominent elevation (e.g. modals). */
|
|
1055
1094
|
elevationHigh?: string;
|
|
1095
|
+
/** UI transition duration in ms. Range: 0–500. */
|
|
1056
1096
|
motionDuration?: number;
|
|
1097
|
+
/** CSS easing function for UI transitions. */
|
|
1057
1098
|
motionEasing?: string;
|
|
1099
|
+
/** UI chrome spacing/sizing scale. */
|
|
1058
1100
|
density?: ScrawlDensity;
|
|
1059
1101
|
/** The rendered board/canvas surface color — distinct from `surface` (UI chrome panels). */
|
|
1060
1102
|
boardSurface?: string;
|
|
1103
|
+
/** `"flat"` (default): a plain, uniform board surface. `"textured"`: a subtle "melamine" micro-noise + satin sheen, like a physical whiteboard. */
|
|
1104
|
+
boardSurfaceTexture?: ScrawlSurfaceTexture;
|
|
1061
1105
|
/** `"none"` (default) keeps the board a plain surface; `"line"`/`"dot"` draw a zoom-adaptive reference grid. */
|
|
1062
1106
|
gridMode?: ScrawlGridMode;
|
|
1107
|
+
/** Grid line/dot color. Ignored when `gridMode` is `"none"`. */
|
|
1063
1108
|
gridColor?: string;
|
|
1064
1109
|
/** Grid spacing in board units at 100% zoom. Ignored when `gridMode` is `"none"`. */
|
|
1065
1110
|
gridSpacing?: number;
|
|
1111
|
+
/** On-screen grid line/dot width in CSS pixels. Range: 0.5–8. A reference aid, so unlike shape/ink strokes it stays this width at any zoom. */
|
|
1112
|
+
gridLineWidth?: number;
|
|
1113
|
+
/** Shape (rectangle, ellipse, arrow, ...) border width, in board units. Range: 0.01–5. Scales with zoom like ink, since it's part of the drawn content. */
|
|
1114
|
+
shapeStrokeWidth?: number;
|
|
1066
1115
|
}
|
|
1067
1116
|
type ResolvedScrawlTheme = Required<ScrawlTheme>;
|
|
1068
1117
|
interface ScrawlThemeDiagnostic {
|
|
@@ -1207,4 +1256,4 @@ type ScrawlBoardProps = {
|
|
|
1207
1256
|
declare function ScrawlBoard({ documentId, initialDocument, onReady, className, style }: ScrawlBoardProps): react.JSX.Element;
|
|
1208
1257
|
|
|
1209
1258
|
export { AssetResolutionError, DefaultBoardChrome, InlineEditors, MultiplayerCursors, SUPPORTED_ASSET_MEDIA_TYPES, Scrawl, ScrawlBoard, ScrawlCanvas, ScrawlDefaultUI, ScrawlPortal, ScrawlProvider, StyleShelf, assetRef, clampAssetCacheBytes, cloneCustomObject, isAssetRef, resolveScrawlTheme, scrawlThemePresets, useScrawlController, useScrawlSnapshot, useScrawlTheme, validateScrawlTheme };
|
|
1210
|
-
export type { AssetDiagnostic, AssetIngestRequest, AssetIngestResult, AssetIngestor, AssetKind, AssetPurpose, AssetRef, AssetResolutionErrorCode, AssetResolveRequest, AssetResolveResult, AssetResolver, BoardController, BoardKeyInput, BoardPointerInput, BoardScene, BoardSlotProps, BoardSnapshot, BoardStyle, CommentMarker, CreateBoardControllerOptions, CustomBoardObject, CustomObjectAddInput, CustomObjectDefinition, CustomTool, CustomToolDefinition, DefaultBoardChromeProps, DefaultUIRegion, DefaultUISlot, DefaultUISlots, DialogSlotProps, ExtensionCommand, ExtensionDiagnostic, ExtensionHitResult, ExtensionId, ExtensionRequirement, InlineEditorsProps, InputModifiers, JsonObject, JsonValue, LocalBoard, LocalBoardSnapshot, Mat2x3, MultiplayerCursorsProps, ObjectDescribeContext, ObjectIntent, ObjectType, PresenceCursor, PresenceUser, PresenceView, QueryableBoardObject, ReadonlyCustomObject, SceneEllipse, SceneGroup, SceneImage, ScenePath, SceneRect, SceneText, ScrawlBoardProps, ScrawlCanvasProps, ScrawlDefaultUIProps, ScrawlDensity, ScrawlExtension, ScrawlGridMode, ScrawlProps, ScrawlProviderProps, ScrawlResolvedTheme, ScrawlTheme, ScrawlThemeDiagnostic, ScrawlThemePreset, StyleShelfProps, SupportedAssetMediaType, ToolCancelReason, ToolCapabilities, ToolCursor, ToolId };
|
|
1259
|
+
export type { AssetDiagnostic, AssetIngestRequest, AssetIngestResult, AssetIngestor, AssetKind, AssetPurpose, AssetRef, AssetResolutionErrorCode, AssetResolveRequest, AssetResolveResult, AssetResolver, BoardController, BoardKeyInput, BoardPointerInput, BoardScene, BoardSlotProps, BoardSnapshot, BoardStyle, BoardThemeOptions, CommentMarker, CreateBoardControllerOptions, CustomBoardObject, CustomObjectAddInput, CustomObjectDefinition, CustomTool, CustomToolDefinition, DefaultBoardChromeProps, DefaultUIRegion, DefaultUISlot, DefaultUISlots, DialogSlotProps, ExtensionCommand, ExtensionDiagnostic, ExtensionHitResult, ExtensionId, ExtensionRequirement, InlineEditorsProps, InputModifiers, JsonObject, JsonValue, LocalBoard, LocalBoardSnapshot, Mat2x3, MultiplayerCursorsProps, ObjectDescribeContext, ObjectIntent, ObjectType, PresenceCursor, PresenceUser, PresenceView, QueryableBoardObject, ReadonlyCustomObject, SceneEllipse, SceneGroup, SceneImage, ScenePath, SceneRect, SceneText, ScrawlBoardProps, ScrawlCanvasProps, ScrawlDefaultUIProps, ScrawlDensity, ScrawlExtension, ScrawlGridMode, ScrawlProps, ScrawlProviderProps, ScrawlResolvedTheme, ScrawlSurfaceTexture, ScrawlTheme, ScrawlThemeDiagnostic, ScrawlThemePreset, StyleShelfProps, SupportedAssetMediaType, ToolCancelReason, ToolCapabilities, ToolCursor, ToolId };
|