@scrawl-board/board 0.1.0-beta.0 → 0.1.0-beta.1
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 +38 -7
- package/dist/browser.js +128 -19
- package/dist/core.d.ts +96 -25
- package/dist/core.js +44 -4
- package/dist/index.d.ts +69 -30
- package/dist/index.js +178 -23
- package/dist/react.d.ts +46 -7
- package/dist/react.js +170 -23
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -1,8 +1,42 @@
|
|
|
1
1
|
//#region src/core-internal/assets.ts
|
|
2
2
|
var ASSET_REF_PATTERN = /^asset:[a-z0-9](?:[a-z0-9.-]{0,61}[a-z0-9])?:[A-Za-z0-9._~-]+$/;
|
|
3
|
+
/** Hard ceiling on a reference's own wire length — independent of any resource limit below. */
|
|
4
|
+
var ASSET_REF_MAX_BYTES = 512;
|
|
3
5
|
function isAssetRef(value) {
|
|
4
6
|
return typeof value === "string" && ASSET_REF_PATTERN.test(value) && new TextEncoder().encode(value).length <= 512;
|
|
5
7
|
}
|
|
8
|
+
/** Throws on malformed input; use `isAssetRef` where a boolean is wanted instead. */
|
|
9
|
+
function assetRef(value) {
|
|
10
|
+
if (!isAssetRef(value)) throw new TypeError(`Not a well-formed AssetRef: ${JSON.stringify(value)}`);
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
var AssetResolutionError = class extends Error {
|
|
14
|
+
constructor(code, retryable, message, ref) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.code = code;
|
|
17
|
+
this.retryable = retryable;
|
|
18
|
+
this.ref = ref;
|
|
19
|
+
this.name = "AssetResolutionError";
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var ASSET_MAX_ENCODED_BYTES = 20 * 1024 * 1024;
|
|
23
|
+
var ASSET_MAX_DIMENSION_PX = 8192;
|
|
24
|
+
var ASSET_MAX_DECODED_MEGAPIXELS = 40;
|
|
25
|
+
var ASSET_MAX_CONCURRENT_RESOLUTIONS = 6;
|
|
26
|
+
var ASSET_CACHE_BYTES_DEFAULT = 256 * 1024 * 1024;
|
|
27
|
+
var ASSET_CACHE_BYTES_MIN = 64 * 1024 * 1024;
|
|
28
|
+
var ASSET_CACHE_BYTES_MAX = 512 * 1024 * 1024;
|
|
29
|
+
var ASSET_EXPORT_MAX_ENCODED_BYTES = 100 * 1024 * 1024;
|
|
30
|
+
var ASSET_EXPORT_MAX_DECODED_MEGAPIXELS = 100;
|
|
31
|
+
var SUPPORTED_ASSET_MEDIA_TYPES = [
|
|
32
|
+
"image/png",
|
|
33
|
+
"image/jpeg",
|
|
34
|
+
"image/webp"
|
|
35
|
+
];
|
|
36
|
+
function clampAssetCacheBytes(value) {
|
|
37
|
+
if (value === void 0 || !Number.isFinite(value)) return ASSET_CACHE_BYTES_DEFAULT;
|
|
38
|
+
return Math.min(ASSET_CACHE_BYTES_MAX, Math.max(ASSET_CACHE_BYTES_MIN, Math.floor(value)));
|
|
39
|
+
}
|
|
6
40
|
//#endregion
|
|
7
41
|
//#region src/core-internal/identifiers.ts
|
|
8
42
|
function documentId(value) {
|
|
@@ -442,7 +476,6 @@ function measureTable(table) {
|
|
|
442
476
|
height: table.rowHeights.reduce((sum, h) => sum + h, 0)
|
|
443
477
|
};
|
|
444
478
|
}
|
|
445
|
-
var BOARD_COLOR = "#FFFFFF";
|
|
446
479
|
var FOG_COLOR = "#FFFFFF";
|
|
447
480
|
function cloneImage(img) {
|
|
448
481
|
return { ...img };
|
|
@@ -1896,12 +1929,19 @@ var LIGHT = {
|
|
|
1896
1929
|
var MARGIN = 4;
|
|
1897
1930
|
var NOTE_FONT_RATIO = 44 / 512;
|
|
1898
1931
|
var NOTE_PAD_RATIO = 40 / 512;
|
|
1932
|
+
/** Matches the theme system's light-preset `boardSurface` default (theme.ts) — kept in sync manually, since core-internal stays decoupled from the theme layer. */
|
|
1933
|
+
var DEFAULT_BACKGROUND_COLOR = "#f5f5f3";
|
|
1899
1934
|
/**
|
|
1900
1935
|
* `registry` is optional and only enables rendering Custom objects through
|
|
1901
1936
|
* their own `describe()` — without it (or for an object whose extension
|
|
1902
1937
|
* isn't in it), Custom objects still export via the standard fallback
|
|
1903
1938
|
* placeholder (`fallback.bounds`/`label`), never silently dropped.
|
|
1904
1939
|
*
|
|
1940
|
+
* `backgroundColor` should be the Host's actual resolved `boardTheme.surface`
|
|
1941
|
+
* so an export matches what was on screen; defaults to the theme system's
|
|
1942
|
+
* own light-preset default when the caller doesn't have one on hand. The
|
|
1943
|
+
* board's reference grid, if any, is a screen-only aid and never exported.
|
|
1944
|
+
*
|
|
1905
1945
|
* `resolvedAssets` (ticket #23) maps an Asset reference to an already-
|
|
1906
1946
|
* resolved `data:` URI — see `assetExport.ts`'s `exportDocumentSVGWithAssets`,
|
|
1907
1947
|
* which is the only intended caller that ever passes one. Without it, every
|
|
@@ -1909,7 +1949,7 @@ var NOTE_PAD_RATIO = 40 / 512;
|
|
|
1909
1949
|
* placeholder instead of guessing at a URL; a legacy `src`-backed image is
|
|
1910
1950
|
* unaffected either way.
|
|
1911
1951
|
*/
|
|
1912
|
-
function documentToSVG(doc, now = 0, registry, resolvedAssets) {
|
|
1952
|
+
function documentToSVG(doc, now = 0, registry, backgroundColor = DEFAULT_BACKGROUND_COLOR, resolvedAssets) {
|
|
1913
1953
|
const notes = doc.notes ?? [];
|
|
1914
1954
|
const texts = doc.textBlocks ?? [];
|
|
1915
1955
|
const tables = doc.tables ?? [];
|
|
@@ -1922,7 +1962,7 @@ function documentToSVG(doc, now = 0, registry, resolvedAssets) {
|
|
|
1922
1962
|
const highlights = doc.strokes.filter((s) => s.tool === "highlighter");
|
|
1923
1963
|
const ink = doc.strokes.filter((s) => s.tool !== "highlighter");
|
|
1924
1964
|
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${view}">\n<defs>\n${defs}\n</defs>\n${[
|
|
1925
|
-
`<rect x="${fmt(bounds.minX)}" y="${fmt(bounds.minY)}" width="${fmt(bounds.width)}" height="${fmt(bounds.height)}" fill="${
|
|
1965
|
+
`<rect x="${fmt(bounds.minX)}" y="${fmt(bounds.minY)}" width="${fmt(bounds.width)}" height="${fmt(bounds.height)}" fill="${backgroundColor}"/>`,
|
|
1926
1966
|
...images.map((image) => imageToElement(image, resolvedAssets)),
|
|
1927
1967
|
...tables.map(tableToGroup),
|
|
1928
1968
|
...highlights.flatMap(strokeToPaths),
|
|
@@ -2250,4 +2290,4 @@ function fmt(n) {
|
|
|
2250
2290
|
var SDK_PACKAGE_NAME = "@scrawl-board/board";
|
|
2251
2291
|
var SDK_DEVELOPMENT_VERSION = "0.0.0-development";
|
|
2252
2292
|
//#endregion
|
|
2253
|
-
export { AddImageCommand, AddNoteCommand, AddStrokesCommand, AddTableCommand, AddTextCommand, AddTimerCommand,
|
|
2293
|
+
export { ASSET_CACHE_BYTES_DEFAULT, ASSET_CACHE_BYTES_MAX, ASSET_CACHE_BYTES_MIN, ASSET_EXPORT_MAX_DECODED_MEGAPIXELS, ASSET_EXPORT_MAX_ENCODED_BYTES, ASSET_MAX_CONCURRENT_RESOLUTIONS, ASSET_MAX_DECODED_MEGAPIXELS, ASSET_MAX_DIMENSION_PX, ASSET_MAX_ENCODED_BYTES, ASSET_REF_MAX_BYTES, ASSET_REF_PATTERN, AddImageCommand, AddNoteCommand, AddStrokesCommand, AddTableCommand, AddTextCommand, AddTimerCommand, AssetResolutionError, BEACON_INSET, BoardDocument, CURRENT_DOCUMENT_SCHEMA_VERSION, ClusterStore, DeleteImageCommand, DeleteNoteCommand, DeleteStrokesCommand, DeleteTableCommand, DeleteTextCommand, DeleteTimerCommand, DocumentRecoveryError, END_TAPER, ERASE_THRESHOLD, EraseCommand, FOG_COLOR, HIGHLIGHT_COLORS, History, IDENTITY, INK_COLORS, LockItemsCommand, MIN_WIDTH_FACTOR, NOTE_COLORS, NOTE_DEFAULT_SIZE, NOTE_DEFAULT_Z, NOTE_MAX_Z, NOTE_MIN_Z, NOTE_PEEL_STEP, SDK_DEVELOPMENT_VERSION, SDK_PACKAGE_NAME, STAMPS, STAMP_SIZE, SUPPORTED_ASSET_MEDIA_TYPES, SpatialIndex, TABLE_DEFAULT_CELL_HEIGHT, TABLE_DEFAULT_CELL_WIDTH, TABLE_DEFAULT_FONT_SIZE, TEXT_DEFAULT_SIZE, TIMER_DEFAULT_DURATION_MS, TIMER_DEFAULT_SIZE, TIMER_PRESETS_MS, TransformCommand, UpdateImageCommand, UpdateNoteCommand, UpdateTableCommand, UpdateTextCommand, UpdateTimerCommand, apply, applyItemLock, assetRef, avgScale, canUnlockItem, changeToOps, clampAssetCacheBytes, cloneCustomObject, cloneImage, cloneNote, cloneStroke, cloneTable, cloneText, cloneTimer, documentId, documentToSVG, formatTimer, invert, isAssetRef, isIdentity, isStampKind, loadDocumentBytes, measureTable, measureTextBlock, migrateDocument, mul, pauseTimer, placePresenceBeacon, ribbonEdges, rotationAbout, scalingAbout, searchBoard, serializeDocument, serializeLock, serializeStroke, setTimerDuration, stampDataUrl, startTimer, strokeId, timerExpired, timerRemaining, toggleTimer, translation };
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,12 @@ declare function strokeId(value: string): StrokeId;
|
|
|
14
14
|
|
|
15
15
|
/** Wire grammar: `asset:<namespace>:<opaque-id>`. Interpreted only by the Host. */
|
|
16
16
|
type AssetRef = string;
|
|
17
|
+
declare const ASSET_REF_PATTERN: RegExp;
|
|
18
|
+
/** Hard ceiling on a reference's own wire length — independent of any resource limit below. */
|
|
19
|
+
declare const ASSET_REF_MAX_BYTES = 512;
|
|
20
|
+
declare function isAssetRef(value: unknown): value is AssetRef;
|
|
21
|
+
/** Throws on malformed input; use `isAssetRef` where a boolean is wanted instead. */
|
|
22
|
+
declare function assetRef(value: string): AssetRef;
|
|
17
23
|
type AssetKind = "image";
|
|
18
24
|
type AssetPurpose = "render" | "thumbnail" | "export";
|
|
19
25
|
interface AssetResolveRequest {
|
|
@@ -55,6 +61,12 @@ interface AssetIngestor {
|
|
|
55
61
|
ingest(request: AssetIngestRequest): Promise<AssetIngestResult>;
|
|
56
62
|
}
|
|
57
63
|
type AssetResolutionErrorCode = "resolver-unavailable" | "not-found" | "forbidden" | "offline" | "unsupported-type" | "too-large" | "invalid-content" | "decode-failed" | "budget-exceeded" | "aborted" | "unknown";
|
|
64
|
+
declare class AssetResolutionError extends Error {
|
|
65
|
+
readonly code: AssetResolutionErrorCode;
|
|
66
|
+
readonly retryable: boolean;
|
|
67
|
+
readonly ref?: AssetRef | undefined;
|
|
68
|
+
constructor(code: AssetResolutionErrorCode, retryable: boolean, message: string, ref?: AssetRef | undefined);
|
|
69
|
+
}
|
|
58
70
|
/** Runtime event for a resolution/ingestion failure — never carries credentials or a fetchable location. */
|
|
59
71
|
interface AssetDiagnostic {
|
|
60
72
|
code: AssetResolutionErrorCode;
|
|
@@ -63,6 +75,18 @@ interface AssetDiagnostic {
|
|
|
63
75
|
objectKind: "image" | "custom";
|
|
64
76
|
retryable: boolean;
|
|
65
77
|
}
|
|
78
|
+
declare const ASSET_MAX_ENCODED_BYTES: number;
|
|
79
|
+
declare const ASSET_MAX_DIMENSION_PX = 8192;
|
|
80
|
+
declare const ASSET_MAX_DECODED_MEGAPIXELS = 40;
|
|
81
|
+
declare const ASSET_MAX_CONCURRENT_RESOLUTIONS = 6;
|
|
82
|
+
declare const ASSET_CACHE_BYTES_DEFAULT: number;
|
|
83
|
+
declare const ASSET_CACHE_BYTES_MIN: number;
|
|
84
|
+
declare const ASSET_CACHE_BYTES_MAX: number;
|
|
85
|
+
declare const ASSET_EXPORT_MAX_ENCODED_BYTES: number;
|
|
86
|
+
declare const ASSET_EXPORT_MAX_DECODED_MEGAPIXELS = 100;
|
|
87
|
+
declare const SUPPORTED_ASSET_MEDIA_TYPES: readonly ["image/png", "image/jpeg", "image/webp"];
|
|
88
|
+
type SupportedAssetMediaType = (typeof SUPPORTED_ASSET_MEDIA_TYPES)[number];
|
|
89
|
+
declare function clampAssetCacheBytes(value: number | undefined): number;
|
|
66
90
|
|
|
67
91
|
type Mat2x3 = [number, number, number, number, number, number];
|
|
68
92
|
declare const IDENTITY: Mat2x3;
|
|
@@ -121,6 +145,7 @@ interface CustomBoardObject {
|
|
|
121
145
|
};
|
|
122
146
|
props: JsonValue;
|
|
123
147
|
}
|
|
148
|
+
declare function cloneCustomObject(object: CustomBoardObject): CustomBoardObject;
|
|
124
149
|
/**
|
|
125
150
|
* The read-only view handed to `describe`. Deep-readonly by construction
|
|
126
151
|
* (not derived via a shallow `Readonly<>`) because `describe` must treat its
|
|
@@ -158,7 +183,7 @@ interface CustomObjectDefinition<Props extends JsonValue = JsonValue> {
|
|
|
158
183
|
parse(input: unknown, schemaVersion: number): Props;
|
|
159
184
|
/** One pure, synchronous step per consecutive schema version. */
|
|
160
185
|
migrate?: Readonly<Record<number, (oldProps: JsonValue) => JsonValue>>;
|
|
161
|
-
describe(object: ReadonlyCustomObject<Props>, context: ObjectDescribeContext): BoardScene
|
|
186
|
+
describe(object: ReadonlyCustomObject<Props>, context: ObjectDescribeContext): BoardScene;
|
|
162
187
|
}
|
|
163
188
|
interface SceneNodeBase {
|
|
164
189
|
key: string;
|
|
@@ -190,9 +215,9 @@ interface SceneText extends SceneNodeBase {
|
|
|
190
215
|
}
|
|
191
216
|
interface SceneGroup extends SceneNodeBase {
|
|
192
217
|
kind: "group";
|
|
193
|
-
children: readonly BoardScene
|
|
218
|
+
children: readonly BoardScene[];
|
|
194
219
|
}
|
|
195
|
-
interface ScenePath
|
|
220
|
+
interface ScenePath extends SceneNodeBase {
|
|
196
221
|
kind: "path";
|
|
197
222
|
/** SVG-style path data, board-local coordinates. */
|
|
198
223
|
d: string;
|
|
@@ -225,7 +250,7 @@ interface SceneEllipse extends SceneNodeBase {
|
|
|
225
250
|
stroke?: string;
|
|
226
251
|
strokeWidth?: number;
|
|
227
252
|
}
|
|
228
|
-
type BoardScene
|
|
253
|
+
type BoardScene = SceneGroup | ScenePath | SceneText | SceneImage | SceneRect | SceneEllipse;
|
|
229
254
|
type ToolCursor = "default" | "crosshair" | "pointer" | "grab" | "grabbing" | "text";
|
|
230
255
|
type ToolCancelReason = "escape-key" | "tool-switched" | "pointer-lost" | "error";
|
|
231
256
|
interface InputModifiers {
|
|
@@ -321,7 +346,7 @@ interface ToolCapabilities {
|
|
|
321
346
|
};
|
|
322
347
|
/** Session-only geometry — never enters Document/history/persistence/collaboration. */
|
|
323
348
|
preview: {
|
|
324
|
-
set(scene: BoardScene
|
|
349
|
+
set(scene: BoardScene): void;
|
|
325
350
|
clear(): void;
|
|
326
351
|
};
|
|
327
352
|
/** Constructs, validates, and commits one atomic command; controller derives Ops. */
|
|
@@ -550,7 +575,6 @@ declare function measureTable(table: TableBlock): {
|
|
|
550
575
|
width: number;
|
|
551
576
|
height: number;
|
|
552
577
|
};
|
|
553
|
-
declare const BOARD_COLOR = "#FFFFFF";
|
|
554
578
|
declare const FOG_COLOR = "#FFFFFF";
|
|
555
579
|
/**
|
|
556
580
|
* An imported image block on the board plane.
|
|
@@ -1109,6 +1133,11 @@ interface ExtensionRegistry {
|
|
|
1109
1133
|
* isn't in it), Custom objects still export via the standard fallback
|
|
1110
1134
|
* placeholder (`fallback.bounds`/`label`), never silently dropped.
|
|
1111
1135
|
*
|
|
1136
|
+
* `backgroundColor` should be the Host's actual resolved `boardTheme.surface`
|
|
1137
|
+
* so an export matches what was on screen; defaults to the theme system's
|
|
1138
|
+
* own light-preset default when the caller doesn't have one on hand. The
|
|
1139
|
+
* board's reference grid, if any, is a screen-only aid and never exported.
|
|
1140
|
+
*
|
|
1112
1141
|
* `resolvedAssets` (ticket #23) maps an Asset reference to an already-
|
|
1113
1142
|
* resolved `data:` URI — see `assetExport.ts`'s `exportDocumentSVGWithAssets`,
|
|
1114
1143
|
* which is the only intended caller that ever passes one. Without it, every
|
|
@@ -1116,27 +1145,11 @@ interface ExtensionRegistry {
|
|
|
1116
1145
|
* placeholder instead of guessing at a URL; a legacy `src`-backed image is
|
|
1117
1146
|
* unaffected either way.
|
|
1118
1147
|
*/
|
|
1119
|
-
declare function documentToSVG(doc: SerializedDocument, now?: number, registry?: ExtensionRegistry, resolvedAssets?: ReadonlyMap<AssetRef, string>): string;
|
|
1148
|
+
declare function documentToSVG(doc: SerializedDocument, now?: number, registry?: ExtensionRegistry, backgroundColor?: string, resolvedAssets?: ReadonlyMap<AssetRef, string>): string;
|
|
1120
1149
|
|
|
1121
1150
|
declare const SDK_PACKAGE_NAME = "@scrawl-board/board";
|
|
1122
1151
|
declare const SDK_DEVELOPMENT_VERSION = "0.0.0-development";
|
|
1123
1152
|
|
|
1124
|
-
type BoardBounds = {
|
|
1125
|
-
minX: number;
|
|
1126
|
-
minY: number;
|
|
1127
|
-
maxX: number;
|
|
1128
|
-
maxY: number;
|
|
1129
|
-
};
|
|
1130
|
-
type ScenePath = {
|
|
1131
|
-
id: string;
|
|
1132
|
-
color: string;
|
|
1133
|
-
width: number;
|
|
1134
|
-
points: readonly BoardPoint[];
|
|
1135
|
-
};
|
|
1136
|
-
type BoardScene = {
|
|
1137
|
-
bounds: BoardBounds;
|
|
1138
|
-
paths: readonly ScenePath[];
|
|
1139
|
-
};
|
|
1140
1153
|
type BoardStroke = Stroke;
|
|
1141
1154
|
type SerializedBoardStroke = SerializedStroke;
|
|
1142
1155
|
type SerializedBoardDocument = CurrentSerializedDocument;
|
|
@@ -1483,22 +1496,31 @@ interface CreateBoardControllerOptions {
|
|
|
1483
1496
|
* Trusted Custom tool/object registrations (ticket #22, design:
|
|
1484
1497
|
* docs/research/extension-contracts.md). Validated atomically at
|
|
1485
1498
|
* construction; registration failure throws before any controller is
|
|
1486
|
-
* returned.
|
|
1487
|
-
* internal-only until the reference Extension proves the seam.
|
|
1499
|
+
* returned.
|
|
1488
1500
|
*/
|
|
1489
1501
|
extensions?: readonly ScrawlExtension[];
|
|
1490
1502
|
/**
|
|
1491
1503
|
* Optional Host-managed Asset capabilities (ticket #23, design:
|
|
1492
1504
|
* docs/research/asset-resolution-resource-policy.md). Without a
|
|
1493
1505
|
* resolver, referenced Assets preserve their Document geometry and
|
|
1494
|
-
* render an accessible placeholder.
|
|
1495
|
-
* package entry point — internal-only until the reference resolver
|
|
1496
|
-
* proves the seam, matching how `extensions` is scoped.
|
|
1506
|
+
* render an accessible placeholder.
|
|
1497
1507
|
*/
|
|
1498
1508
|
assetResolver?: AssetResolver;
|
|
1499
1509
|
assetIngestor?: AssetIngestor;
|
|
1500
1510
|
/** Clamped to 64–512MiB; defaults to 256MiB. */
|
|
1501
1511
|
assetCacheBytes?: number;
|
|
1512
|
+
/**
|
|
1513
|
+
* The rendered board surface's color and reference grid. Defaults to the
|
|
1514
|
+
* light theme preset's values; `<Scrawl>` keeps this current across theme
|
|
1515
|
+
* changes via `boardTheme.set` below — a headless/browser-tier Host that
|
|
1516
|
+
* doesn't use the React theme system can set this directly instead.
|
|
1517
|
+
*/
|
|
1518
|
+
boardTheme?: {
|
|
1519
|
+
surface?: string;
|
|
1520
|
+
gridMode?: "none" | "line" | "dot";
|
|
1521
|
+
gridColor?: string;
|
|
1522
|
+
gridSpacing?: number;
|
|
1523
|
+
};
|
|
1502
1524
|
}
|
|
1503
1525
|
interface BoardController {
|
|
1504
1526
|
readonly document: ReadonlyBoardDocument;
|
|
@@ -1524,6 +1546,15 @@ interface BoardController {
|
|
|
1524
1546
|
undo(): void;
|
|
1525
1547
|
redo(): void;
|
|
1526
1548
|
};
|
|
1549
|
+
readonly boardTheme: {
|
|
1550
|
+
/** Live update of the board surface color/grid — the controller's identity stays fixed across theme changes. */
|
|
1551
|
+
set(theme: {
|
|
1552
|
+
surface?: string;
|
|
1553
|
+
gridMode?: "none" | "line" | "dot";
|
|
1554
|
+
gridColor?: string;
|
|
1555
|
+
gridSpacing?: number;
|
|
1556
|
+
}): void;
|
|
1557
|
+
};
|
|
1527
1558
|
readonly view: {
|
|
1528
1559
|
fit(): void;
|
|
1529
1560
|
zoomTo(value: number): void;
|
|
@@ -1626,6 +1657,7 @@ declare function createLocalBoard(options: LocalBoardOptions): LocalBoard;
|
|
|
1626
1657
|
|
|
1627
1658
|
type ScrawlThemePreset = "light" | "dark";
|
|
1628
1659
|
type ScrawlDensity = "comfortable" | "compact";
|
|
1660
|
+
type ScrawlGridMode = "none" | "line" | "dot";
|
|
1629
1661
|
interface ScrawlTheme {
|
|
1630
1662
|
surface?: string;
|
|
1631
1663
|
surfaceRaised?: string;
|
|
@@ -1650,6 +1682,13 @@ interface ScrawlTheme {
|
|
|
1650
1682
|
motionDuration?: number;
|
|
1651
1683
|
motionEasing?: string;
|
|
1652
1684
|
density?: ScrawlDensity;
|
|
1685
|
+
/** The rendered board/canvas surface color — distinct from `surface` (UI chrome panels). */
|
|
1686
|
+
boardSurface?: string;
|
|
1687
|
+
/** `"none"` (default) keeps the board a plain surface; `"line"`/`"dot"` draw a zoom-adaptive reference grid. */
|
|
1688
|
+
gridMode?: ScrawlGridMode;
|
|
1689
|
+
gridColor?: string;
|
|
1690
|
+
/** Grid spacing in board units at 100% zoom. Ignored when `gridMode` is `"none"`. */
|
|
1691
|
+
gridSpacing?: number;
|
|
1653
1692
|
}
|
|
1654
1693
|
type ResolvedScrawlTheme = Required<ScrawlTheme>;
|
|
1655
1694
|
interface ScrawlThemeDiagnostic {
|
|
@@ -1793,5 +1832,5 @@ type ScrawlBoardProps = {
|
|
|
1793
1832
|
};
|
|
1794
1833
|
declare function ScrawlBoard({ documentId, initialDocument, onReady, className, style }: ScrawlBoardProps): react.JSX.Element;
|
|
1795
1834
|
|
|
1796
|
-
export { AddImageCommand, AddNoteCommand, AddStrokesCommand, AddTableCommand, AddTextCommand, AddTimerCommand,
|
|
1797
|
-
export type { ApplyOpsResult,
|
|
1835
|
+
export { ASSET_CACHE_BYTES_DEFAULT, ASSET_CACHE_BYTES_MAX, ASSET_CACHE_BYTES_MIN, ASSET_EXPORT_MAX_DECODED_MEGAPIXELS, ASSET_EXPORT_MAX_ENCODED_BYTES, ASSET_MAX_CONCURRENT_RESOLUTIONS, ASSET_MAX_DECODED_MEGAPIXELS, ASSET_MAX_DIMENSION_PX, ASSET_MAX_ENCODED_BYTES, ASSET_REF_MAX_BYTES, ASSET_REF_PATTERN, AddImageCommand, AddNoteCommand, AddStrokesCommand, AddTableCommand, AddTextCommand, AddTimerCommand, AssetResolutionError, BEACON_INSET, BoardDocument, CURRENT_DOCUMENT_SCHEMA_VERSION, ClusterStore, DefaultBoardChrome, DeleteImageCommand, DeleteNoteCommand, DeleteStrokesCommand, DeleteTableCommand, DeleteTextCommand, DeleteTimerCommand, DocumentRecoveryError, END_TAPER, ERASE_THRESHOLD, EraseCommand, FOG_COLOR, HIGHLIGHT_COLORS, History, IDENTITY, INK_COLORS, InlineEditors, LockItemsCommand, MIN_WIDTH_FACTOR, MultiplayerCursors, NOTE_COLORS, NOTE_DEFAULT_SIZE, NOTE_DEFAULT_Z, NOTE_MAX_Z, NOTE_MIN_Z, NOTE_PEEL_STEP, SDK_DEVELOPMENT_VERSION, SDK_PACKAGE_NAME, STAMPS, STAMP_SIZE, SUPPORTED_ASSET_MEDIA_TYPES, Scrawl, ScrawlBoard, ScrawlCanvas, ScrawlDefaultUI, ScrawlPortal, ScrawlProvider, SpatialIndex, StyleShelf, TABLE_DEFAULT_CELL_HEIGHT, TABLE_DEFAULT_CELL_WIDTH, TABLE_DEFAULT_FONT_SIZE, TEXT_DEFAULT_SIZE, TIMER_DEFAULT_DURATION_MS, TIMER_DEFAULT_SIZE, TIMER_PRESETS_MS, TransformCommand, UpdateImageCommand, UpdateNoteCommand, UpdateTableCommand, UpdateTextCommand, UpdateTimerCommand, apply, applyItemLock, assetRef, avgScale, canUnlockItem, changeToOps, clampAssetCacheBytes, cloneCustomObject, cloneImage, cloneNote, cloneStroke, cloneTable, cloneText, cloneTimer, createBoardController, createLocalBoard, documentId, documentToSVG, formatTimer, invert, isAssetRef, isIdentity, isStampKind, loadDocumentBytes, measureTable, measureTextBlock, migrateDocument, mul, pauseTimer, placePresenceBeacon, resolveScrawlTheme, ribbonEdges, rotationAbout, scalingAbout, scrawlThemePresets, searchBoard, serializeDocument, serializeLock, serializeStroke, setTimerDuration, stampDataUrl, startTimer, strokeId, timerExpired, timerRemaining, toggleTimer, translation, useScrawlController, useScrawlSnapshot, useScrawlTheme, validateScrawlTheme };
|
|
1836
|
+
export type { ApplyOpsResult, AssetDiagnostic, AssetIngestRequest, AssetIngestResult, AssetIngestor, AssetKind, AssetPurpose, AssetRef, AssetResolutionErrorCode, AssetResolveRequest, AssetResolveResult, AssetResolver, BBox, BoardController, BoardControllerError, BoardEventMap, BoardKeyInput, BoardObject, BoardObjectInput, BoardObjectPatch, BoardPoint, BoardPointerInput, BoardScene, BoardSlotProps, BoardSnapshot, BoardStroke, BoardStyle, BoardView, BuiltInTool, ClusterIdFactory, CollaborationAdapter, CollaborationReceiver, CollaborationSession, CollaborationSnapshot, CollaboratorIdentity, Command, CommandKind, CommentMarker, ControllerOp, CreateBoardControllerOptions, CurrentSerializedDocument, CurrentSerializedStroke, CustomBoardObject, CustomObjectAddInput, CustomObjectDefinition, CustomTool, CustomToolDefinition, DeepReadonly, DefaultBoardChromeProps, DefaultUIRegion, DefaultUISlot, DefaultUISlots, DialogSlotProps, DocumentChange, DocumentContext, DocumentId, DocumentLoadResult, DocumentRecoveryCode, ExtensionCommand, ExtensionDiagnostic, ExtensionHitResult, ExtensionId, ExtensionRequirement, ImageBlock, InlineEditorsProps, InputModifiers, JsonObject, JsonValue, KitchenTimer, LoadResult, LocalBoard, LocalBoardOptions, LocalBoardSnapshot, LockHolder, LockTarget, Lockable, Mat2x3, MultiplayerCursorsProps, NoteVote, ObjectDescribeContext, ObjectIntent, ObjectType, Op, OpCollection, PersistenceAdapter, PersistenceDiagnostic, PersistenceSnapshot, PresenceCursor, PresencePlacement, PresenceUser, PresenceView, QueryableBoardObject, ReadonlyBoardDocument, ReadonlyCustomObject, ReadonlyDocumentChange, RibbonEdgePoint, SceneEllipse, SceneGroup, SceneImage, ScenePath, SceneRect, SceneText, ScrawlBoardProps, ScrawlCanvasProps, ScrawlDefaultUIProps, ScrawlDensity, ScrawlExtension, ScrawlGridMode, ScrawlProps, ScrawlProviderProps, ScrawlResolvedTheme, ScrawlTheme, ScrawlThemeDiagnostic, ScrawlThemePreset, ScreenPoint, ScreenRect, SearchHit, SearchHitKind, SearchableBoard, SearchableComment, SerializedBoardDocument, SerializedBoardStroke, SerializedPoint, SerializedStroke, StampKind, StickyNote, Stroke, StrokeId, StrokePoint, StrokeTool, StyleShelfProps, SupportedAssetMediaType, TableBlock, TextBlock, ToolCancelReason, ToolCapabilities, ToolCursor, ToolId, ViewportInset };
|