@q9labsai/chalk-react 5.2.0 → 5.2.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.
Files changed (29) hide show
  1. package/dist/{chunk-CYC2G42K.js → chunk-53ZA776J.js} +8 -4
  2. package/dist/{chunk-G62BKRNX.js → chunk-RQXFFDOS.js} +1220 -2811
  3. package/dist/components/board/Board.d.ts +3 -22
  4. package/dist/components/board/board-draw-policy.d.ts +1 -1
  5. package/dist/components/chalk/Chalk.d.ts +8 -0
  6. package/dist/components/chalk/StatusSurface.d.ts +6 -1
  7. package/dist/components/chalk-ui/index.d.ts +6 -5
  8. package/dist/components/index.js +6 -2
  9. package/dist/components/space-header/space-header-contract.d.ts +1 -0
  10. package/dist/components/space-view/SpaceView.d.ts +8 -1
  11. package/dist/components/space-view/countdown.d.ts +5 -0
  12. package/dist/index.js +2 -2
  13. package/dist/public-surface.contract.d.ts +1 -1
  14. package/dist/test-support/index.js +1 -1
  15. package/package.json +5 -5
  16. package/dist/components/board/BoardCursors.d.ts +0 -21
  17. package/dist/components/board/BoardIcon.d.ts +0 -46
  18. package/dist/components/board/BoardIsland.d.ts +0 -21
  19. package/dist/components/board/BoardMenu.d.ts +0 -18
  20. package/dist/components/board/BoardStyles.d.ts +0 -2
  21. package/dist/components/board/board-engine.d.ts +0 -31
  22. package/dist/components/board/board-history.d.ts +0 -7
  23. package/dist/components/board/board-model.d.ts +0 -90
  24. package/dist/components/board/board-toasts.d.ts +0 -6
  25. package/dist/components/board/board-view-versions.d.ts +0 -1
  26. package/dist/components/chalk-ui/ChalkMenu.d.ts +0 -20
  27. package/dist/components/chalk-ui/ChalkPopover.d.ts +0 -11
  28. package/dist/components/chalk-ui/ChalkTooltip.d.ts +0 -5
  29. package/dist/internal/whiteboard-view-limits.d.ts +0 -1
@@ -1,22 +1,3 @@
1
- import type { ChalkWhiteboardView } from "@q9labsai/chalk-client";
2
- import type { Participant } from "../participant-grid/ParticipantGrid";
3
- import type { WhiteboardViewProps } from "../whiteboard-view/WhiteboardView";
4
- import { type CallTheme } from "./board-model";
5
- export type BoardProps = {
6
- readonly board: WhiteboardViewProps;
7
- /** False for the Grid tile: the live drawing with no controls. */
8
- readonly primary: boolean;
9
- readonly visible: boolean;
10
- readonly colorScheme: CallTheme;
11
- readonly people: readonly Participant[];
12
- readonly following: string | null;
13
- readonly onFollow: (participantId: string | null) => void;
14
- /** Absent, or answering false, when the board service does not share views. */
15
- readonly sendView?: (view: ChalkWhiteboardView) => boolean;
16
- readonly onClose?: () => void;
17
- };
18
- /**
19
- * Chalk's board: Excalidraw draws, and every control around it is the call's own. Each person picks their own
20
- * surface and island place; the drawing, the cursors and the views are shared.
21
- */
22
- export declare function Board({ board, primary, visible, colorScheme, people, following, onFollow, sendView, onClose }: BoardProps): import("react").JSX.Element;
1
+ import { type BoardProps as SharedBoardProps } from "@q9labsai/chalk-whiteboard/react";
2
+ export type BoardProps = Omit<SharedBoardProps, "isHost" | "connectionStatus" | "sceneId" | "sceneStatus" | "ownParticipantId" | "viewBounds" | "renderCursorAvatar" | "onExport" | "participantIds" | "whoCanDraw">;
3
+ export declare function Board(props: BoardProps): import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import type { ChalkWhiteboardDrawPolicy } from "@q9labsai/chalk-client";
2
- import type { BoardToast } from "./board-toasts";
2
+ import type { BoardToast } from "@q9labsai/chalk-whiteboard/react";
3
3
  export type WhoCanDraw = {
4
4
  readonly policy: ChalkWhiteboardDrawPolicy;
5
5
  /** Everyone in the call who is not a host, because hosts can always draw under hosts only and picked people. */
@@ -1,6 +1,7 @@
1
1
  import { type ChatUploadFile, type ClientEventMap, type GetAccess, type SpaceClient } from "@q9labsai/chalk-client";
2
2
  import type React from "react";
3
3
  import { type ChalkColorScheme, type ChalkTheme } from "../../theme";
4
+ import { type SpaceViewProps } from "../space-view/SpaceView";
4
5
  export type SpaceLayout = "focus" | "grid";
5
6
  export type ChalkFeatures = {
6
7
  readonly chat?: boolean;
@@ -58,6 +59,13 @@ export type ChalkProps = SpaceIntegration & SpaceEventCallbacks & {
58
59
  readonly onRejoin?: () => void;
59
60
  /** Home on the pages shown after the call. Without it the page has no Home action. */
60
61
  readonly onHome?: () => void;
62
+ /** App-owned warning copy and actions for a call's duration limit. */
63
+ readonly timeLimit?: SpaceViewProps["timeLimit"] & {
64
+ readonly endAction?: {
65
+ readonly label: string;
66
+ readonly onClick: () => void;
67
+ };
68
+ };
61
69
  /** Host-provided terminal reason when the transport cannot distinguish it. */
62
70
  readonly terminalState?: "removed" | "full" | "elsewhere";
63
71
  };
@@ -6,6 +6,11 @@ export interface StatusSurfaceProps {
6
6
  readonly phase: StatusSurfacePhase;
7
7
  readonly callName?: string;
8
8
  readonly reason?: string;
9
+ readonly episodeEndReason?: string;
10
+ readonly endAction?: {
11
+ readonly label: string;
12
+ readonly onClick: () => void;
13
+ };
9
14
  readonly errorCode?: ErrorCode;
10
15
  readonly sync?: ClientFailure["sync"];
11
16
  readonly theme?: ChalkTheme;
@@ -17,4 +22,4 @@ export interface StatusSurfaceProps {
17
22
  readonly retryPending?: boolean;
18
23
  }
19
24
  /** All terminal call states share the same quiet page and host-owned navigation. */
20
- export declare function StatusSurface({ phase, callName, reason, errorCode, sync, theme, onRejoin, onHome, onRetry, onReportProblem, rejoinDisabled, retryPending }: StatusSurfaceProps): React.JSX.Element;
25
+ export declare function StatusSurface({ phase, callName, reason, episodeEndReason, endAction, errorCode, sync, theme, onRejoin, onHome, onRetry, onReportProblem, rejoinDisabled, retryPending }: StatusSurfaceProps): React.JSX.Element;
@@ -18,8 +18,8 @@ export { ChalkDialogPanel } from "./ChalkDialogPanel";
18
18
  export type { ChalkDialogPanelProps } from "./ChalkDialogPanel";
19
19
  export { ChalkBackdrop } from "./ChalkBackdrop";
20
20
  export type { ChalkBackdropProps } from "./ChalkBackdrop";
21
- export { ChalkMenu, ChalkMenuItem } from "./ChalkMenu";
22
- export type { ChalkMenuItemProps, ChalkMenuProps } from "./ChalkMenu";
21
+ export { ChalkMenu, ChalkMenuItem } from "@q9labsai/chalk-whiteboard/react";
22
+ export type { ChalkMenuItemProps, ChalkMenuProps } from "@q9labsai/chalk-whiteboard/react";
23
23
  export { ChalkAlert } from "./ChalkAlert";
24
24
  export type { ChalkAlertProps } from "./ChalkAlert";
25
25
  export { ChalkEmptyState } from "./ChalkEmptyState";
@@ -27,10 +27,11 @@ export type { ChalkEmptyStateProps } from "./ChalkEmptyState";
27
27
  export { ChalkSpinner } from "./ChalkSpinner";
28
28
  export type { ChalkSpinnerProps } from "./ChalkSpinner";
29
29
  export type { ChalkButtonVariant, ChalkTone } from "./common";
30
- export { ChalkMenuLabel } from "./ChalkMenu";
31
- export { ChalkPopover } from "./ChalkPopover";
30
+ export { ChalkMenuLabel } from "@q9labsai/chalk-whiteboard/react";
31
+ export { ChalkPopover } from "@q9labsai/chalk-whiteboard/react";
32
32
  export { ChalkSegmentedControl } from "./ChalkSegmentedControl";
33
33
  export { ChalkCopyButton } from "./ChalkCopyButton";
34
34
  export { ChalkSheet, type ChalkSheetProps } from "./ChalkSheet";
35
35
  export { ChalkToast, type ChalkToastProps } from "./ChalkToast";
36
- export { ChalkTooltip } from "./ChalkTooltip";
36
+ export { ChalkTooltip } from "@q9labsai/chalk-whiteboard/react";
37
+ export { ChalkMenuPrimitive, ChalkPopoverPrimitive } from "@q9labsai/chalk-whiteboard/react";
@@ -5,7 +5,7 @@ import {
5
5
  RecordingHistoryPanel,
6
6
  RecordingSpaceView,
7
7
  RecordingWhiteboardView
8
- } from "../chunk-CYC2G42K.js";
8
+ } from "../chunk-53ZA776J.js";
9
9
  import {
10
10
  loadRecordingWhiteboardFiles,
11
11
  parseRecordingWhiteboardStateV1,
@@ -29,8 +29,10 @@ import {
29
29
  ChalkMenu,
30
30
  ChalkMenuItem,
31
31
  ChalkMenuLabel,
32
+ ChalkMenuPrimitive,
32
33
  ChalkPanel,
33
34
  ChalkPopover,
35
+ ChalkPopoverPrimitive,
34
36
  ChalkSegmentedControl,
35
37
  ChalkSheet,
36
38
  ChalkSpinner,
@@ -45,7 +47,7 @@ import {
45
47
  ReactionsOverlay,
46
48
  ScreenShareView,
47
49
  Stage
48
- } from "../chunk-G62BKRNX.js";
50
+ } from "../chunk-RQXFFDOS.js";
49
51
  import {
50
52
  buildStageItems
51
53
  } from "../chunk-HWQLW4JR.js";
@@ -67,8 +69,10 @@ export {
67
69
  ChalkMenu,
68
70
  ChalkMenuItem,
69
71
  ChalkMenuLabel,
72
+ ChalkMenuPrimitive,
70
73
  ChalkPanel,
71
74
  ChalkPopover,
75
+ ChalkPopoverPrimitive,
72
76
  ChalkSegmentedControl,
73
77
  ChalkSheet,
74
78
  ChalkSpinner,
@@ -35,6 +35,7 @@ export interface SpaceHeaderProps {
35
35
  colorScheme?: "light" | "dark";
36
36
  onColorSchemeChange?: (colorScheme: "light" | "dark") => void;
37
37
  duration?: number;
38
+ timeLeft?: number | null;
38
39
  isRecording?: boolean;
39
40
  isTranscribing?: boolean;
40
41
  layout?: "grid" | "focus";
@@ -24,6 +24,13 @@ export interface SpaceViewWhiteboard {
24
24
  readonly sendView?: (view: ChalkWhiteboardView) => boolean;
25
25
  }
26
26
  export interface SpaceViewProps {
27
+ readonly timeLimit?: {
28
+ readonly message: string;
29
+ readonly action?: {
30
+ readonly label: string;
31
+ readonly onClick: () => void;
32
+ };
33
+ };
27
34
  readonly colorScheme?: "light" | "dark";
28
35
  readonly onColorSchemeChange?: (colorScheme: "light" | "dark") => void;
29
36
  readonly spaceName: string;
@@ -56,4 +63,4 @@ export interface SpaceViewProps {
56
63
  readonly onEndEpisode?: () => void | Promise<void>;
57
64
  readonly className?: string;
58
65
  }
59
- export declare function SpaceView({ colorScheme, onColorSchemeChange, spaceName, shareUrl, callLinkOpen, onCallLinkToggle, onReportProblem, reportUnavailableReason, onOpenReportProblem, inviteLink, pickChatFiles, stageBackground, layout: controlledLayout, onLayoutChange, initialPanel, features, generatedAvatars, commandError: externalCommandError, commandSource: externalCommandSource, commandAction: externalCommandAction, onDismissCommandError, onToggleWhiteboard, whiteboard, reconnecting, overlay, onLeft, onEndEpisode, className, }: SpaceViewProps): React.JSX.Element;
66
+ export declare function SpaceView({ timeLimit, colorScheme, onColorSchemeChange, spaceName, shareUrl, callLinkOpen, onCallLinkToggle, onReportProblem, reportUnavailableReason, onOpenReportProblem, inviteLink, pickChatFiles, stageBackground, layout: controlledLayout, onLayoutChange, initialPanel, features, generatedAvatars, commandError: externalCommandError, commandSource: externalCommandSource, commandAction: externalCommandAction, onDismissCommandError, onToggleWhiteboard, whiteboard, reconnecting, overlay, onLeft, onEndEpisode, className, }: SpaceViewProps): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ /** The latest warning only: joining late or resuming a hidden tab never queues old warnings. */
2
+ export declare function callCountdown(deadline: string | null | undefined, now: number, previousSeconds?: number | null): {
3
+ seconds: number | null;
4
+ warning: 10 | 5 | 1 | null;
5
+ };
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  RecordingHistoryPanel,
6
6
  RecordingSpaceView,
7
7
  RecordingWhiteboardView
8
- } from "./chunk-CYC2G42K.js";
8
+ } from "./chunk-53ZA776J.js";
9
9
  import {
10
10
  loadRecordingWhiteboardFiles,
11
11
  parseRecordingWhiteboardStateV1,
@@ -59,7 +59,7 @@ import {
59
59
  useSelf,
60
60
  useSpaceClient,
61
61
  useWhiteboard
62
- } from "./chunk-G62BKRNX.js";
62
+ } from "./chunk-RQXFFDOS.js";
63
63
  import "./chunk-HWQLW4JR.js";
64
64
  import "./chunk-4U7QZC72.js";
65
65
 
@@ -8,7 +8,7 @@ type PublicHooks = Extract<keyof typeof bindings, `use${string}`>;
8
8
  type ExpectedHooks = "useSpaceClient" | "useConnection" | "useSelf" | "useParticipants" | "useMedia" | "useScreenShare" | "useOffline" | "useChat" | "useReactions" | "useRecording" | "useWhiteboard" | "useCan";
9
9
  type ExpectedLayout = "focus" | "grid";
10
10
  type ExpectedTokenKeys = "canvas" | "surface" | "raised" | "hover" | "pressed" | "tile" | "popover" | "line" | "lineStrong" | "text" | "textStrong" | "mutedText" | "softText" | "danger" | "dangerHover" | "dangerPressed" | "dangerText" | "positive" | "warning" | "accent" | "wash" | "washStrong" | "chrome" | "stage" | "accentText" | "dangerSurface" | "focus" | "shadow" | "overlay" | "overlayStrong" | "overlayHover" | "onOverlay" | "overlayWarning" | "overlayDanger" | "scrim";
11
- type ExpectedChalkProps = "shareUrl" | "onReportProblem" | "onOpenReportProblem" | "reportUnavailableReason" | "client" | "space" | "getAccess" | "defaults" | "displayName" | "features" | "theme" | "onColorSchemeChange" | "pickChatFiles" | "spaceName" | "layout" | "onLayoutChange" | "onRejoin" | "onHome" | "terminalState" | "inviteLink" | "onJoined" | "onLeft" | "onEpisodeEnded" | "onParticipantJoined" | "onParticipantLeft" | "onScreenShareStarted" | "onScreenShareStopped" | "onError";
11
+ type ExpectedChalkProps = "shareUrl" | "onReportProblem" | "onOpenReportProblem" | "reportUnavailableReason" | "client" | "space" | "getAccess" | "defaults" | "displayName" | "features" | "theme" | "onColorSchemeChange" | "pickChatFiles" | "spaceName" | "layout" | "onLayoutChange" | "onRejoin" | "onHome" | "timeLimit" | "terminalState" | "inviteLink" | "onJoined" | "onLeft" | "onEpisodeEnded" | "onParticipantJoined" | "onParticipantLeft" | "onScreenShareStarted" | "onScreenShareStopped" | "onError";
12
12
  type HooksAreClosed = Assert<Equal<PublicHooks, ExpectedHooks>>;
13
13
  type LayoutIsCanonical = Assert<Equal<SpaceLayout, ExpectedLayout>>;
14
14
  type TokensAreClosed = Assert<Equal<keyof ChalkThemeTokens, ExpectedTokenKeys>>;
@@ -6,7 +6,7 @@ import {
6
6
  SpaceView,
7
7
  ToastStack,
8
8
  WhiteboardView
9
- } from "../chunk-G62BKRNX.js";
9
+ } from "../chunk-RQXFFDOS.js";
10
10
  import "../chunk-HWQLW4JR.js";
11
11
  import "../chunk-4U7QZC72.js";
12
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@q9labsai/chalk-react",
3
- "version": "5.2.0",
3
+ "version": "5.2.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -75,10 +75,10 @@
75
75
  "@base-ui/react": "^1.7.0",
76
76
  "@hugeicons/core-free-icons": "^4.2.3",
77
77
  "@hugeicons/react": "^1.1.9",
78
- "@q9labsai/chalk-client": "^5.2.0",
79
- "@q9labsai/chalk-ui": "^5.2.0",
80
- "@q9labsai/chalk-whiteboard": "^5.2.0",
81
- "@q9labsai/facehash": "^5.2.0",
78
+ "@q9labsai/chalk-client": "^5.2.1",
79
+ "@q9labsai/chalk-ui": "^5.2.1",
80
+ "@q9labsai/chalk-whiteboard": "^5.2.1",
81
+ "@q9labsai/facehash": "^5.2.1",
82
82
  "@q9labsai/recording-presentation": "^0.1.1",
83
83
  "class-variance-authority": "^0.7.1",
84
84
  "clsx": "^2.1.1",
@@ -1,21 +0,0 @@
1
- import { type MutableRefObject } from "react";
2
- import { type Camera } from "./board-model";
3
- export type RemoteCursor = {
4
- readonly participantId: string;
5
- readonly displayName: string;
6
- readonly x: number;
7
- readonly y: number;
8
- readonly occurredAt: string;
9
- };
10
- /** Pruning belongs to receipt too: grid boards do not mount the cursor layer. */
11
- export declare function rememberCursor(cursors: Map<string, RemoteCursor>, cursor: RemoteCursor): void;
12
- /**
13
- * Remote people's cursors over the board: a rounded arrow, the Facehash and the name, in the person's colour.
14
- * Updates arrive about 15 times a second and unevenly, so each shown cursor is a spring chasing the newest one.
15
- */
16
- export declare function BoardCursors({ cursorsRef, cameraRef, colorFor, hidden }: {
17
- readonly cursorsRef: MutableRefObject<Map<string, RemoteCursor>>;
18
- readonly cameraRef: MutableRefObject<Camera>;
19
- readonly colorFor: (participantId: string) => string;
20
- readonly hidden: boolean;
21
- }): import("react").JSX.Element;
@@ -1,46 +0,0 @@
1
- declare const GLYPHS: {
2
- readonly select: import("react").JSX.Element;
3
- readonly hand: import("react").JSX.Element;
4
- readonly pen: import("react").JSX.Element;
5
- readonly highlighter: import("react").JSX.Element;
6
- readonly rectangle: import("react").JSX.Element;
7
- readonly ellipse: import("react").JSX.Element;
8
- readonly diamond: import("react").JSX.Element;
9
- readonly arrow: import("react").JSX.Element;
10
- readonly line: import("react").JSX.Element;
11
- readonly text: import("react").JSX.Element;
12
- readonly note: import("react").JSX.Element;
13
- readonly eraser: import("react").JSX.Element;
14
- readonly laser: import("react").JSX.Element;
15
- readonly undo: import("react").JSX.Element;
16
- readonly redo: import("react").JSX.Element;
17
- readonly minus: import("react").JSX.Element;
18
- readonly plus: import("react").JSX.Element;
19
- readonly fit: import("react").JSX.Element;
20
- readonly download: import("react").JSX.Element;
21
- readonly copy: import("react").JSX.Element;
22
- readonly trash: import("react").JSX.Element;
23
- readonly close: import("react").JSX.Element;
24
- readonly check: import("react").JSX.Element;
25
- readonly target: import("react").JSX.Element;
26
- readonly eye: import("react").JSX.Element;
27
- readonly wifiOff: import("react").JSX.Element;
28
- readonly lock: import("react").JSX.Element;
29
- readonly more: import("react").JSX.Element;
30
- readonly chevron: import("react").JSX.Element;
31
- };
32
- export type BoardGlyph = keyof typeof GLYPHS;
33
- export declare function BoardIcon({ name, size, className }: {
34
- readonly name: BoardGlyph;
35
- readonly size?: number;
36
- readonly className?: string;
37
- }): import("react").JSX.Element;
38
- /** Six dots in two columns: the island's drag handle. */
39
- export declare function GripIcon({ className }: {
40
- readonly className?: string;
41
- }): import("react").JSX.Element;
42
- /** The remote cursor: a rounded arrow with a white outline, filled in the person's colour. */
43
- export declare function CursorArrow({ color }: {
44
- readonly color: string;
45
- }): import("react").JSX.Element;
46
- export {};
@@ -1,21 +0,0 @@
1
- import { type BoardSurface, type BoardTool, type CallTheme, type IslandPlace, type PenColor, type PenWidth, type ShapeTool } from "./board-model";
2
- export type IslandProps = {
3
- readonly tool: BoardTool;
4
- readonly shape: ShapeTool;
5
- readonly onTool: (tool: BoardTool) => void;
6
- readonly color: PenColor;
7
- readonly width: PenWidth;
8
- readonly onColor: (color: PenColor) => void;
9
- readonly onWidth: (width: PenWidth) => void;
10
- readonly surface: BoardSurface;
11
- readonly theme: CallTheme;
12
- readonly canUndo: boolean;
13
- readonly canRedo: boolean;
14
- readonly onUndo: () => void;
15
- readonly onRedo: () => void;
16
- readonly place: IslandPlace;
17
- readonly onPlace: (place: IslandPlace, announce: boolean) => void;
18
- readonly compact: boolean;
19
- };
20
- /** The tool island: a pill of tools that docks at the bottom, the top or the left, or one pen button when compact. */
21
- export declare function BoardIsland(props: IslandProps): import("react").JSX.Element;
@@ -1,18 +0,0 @@
1
- import type { WhoCanDraw } from "./board-draw-policy";
2
- import { type BoardSurface, type IslandPlace } from "./board-model";
3
- export type BoardMenuProps = {
4
- readonly surface: BoardSurface;
5
- readonly onSurface: (surface: BoardSurface) => void;
6
- /** Offered outside a phone, to people who can draw. */
7
- readonly place?: IslandPlace;
8
- readonly onPlace: (place: IslandPlace) => void;
9
- readonly onDownload: () => void;
10
- readonly onCopy: () => void;
11
- /** Offered to hosts. */
12
- readonly whoCanDraw?: WhoCanDraw;
13
- readonly onBring?: () => void;
14
- readonly onClear?: () => void;
15
- readonly onClose?: () => void;
16
- };
17
- /** The board's own menu: export, the person's own appearance, and the host's board actions. */
18
- export declare function BoardMenu({ surface, onSurface, place, onPlace, onDownload, onCopy, whoCanDraw, onBring, onClear, onClose }: BoardMenuProps): import("react").JSX.Element;
@@ -1,2 +0,0 @@
1
- /** The board's look: the mockup's surfaces, island, zoom, chips and cursors, on the call's own tokens. */
2
- export declare function BoardStyles(): import("react").JSX.Element;
@@ -1,31 +0,0 @@
1
- import type { WhiteboardEngineHandle } from "@q9labsai/chalk-whiteboard/react";
2
- import { type BoardSurface, type BoardTool, type CallTheme, type Camera, type PenColor, type PenWidth } from "./board-model";
3
- /** The pen the person has chosen, and the surface it is drawn on. */
4
- export type PenChoice = {
5
- readonly color: PenColor;
6
- readonly width: PenWidth;
7
- readonly surface: BoardSurface;
8
- readonly theme: CallTheme;
9
- };
10
- export declare function applyTool(engine: WhiteboardEngineHandle, tool: BoardTool, pen: PenChoice): void;
11
- type PenChanges = {
12
- readonly color?: PenColor;
13
- readonly width?: PenWidth;
14
- };
15
- /** A colour or width change applies to what is selected, as well as to the next stroke. */
16
- export declare function restyleSelection(engine: WhiteboardEngineHandle, pen: PenChoice, changes: PenChanges): boolean;
17
- /** Places a plain sticky note centred on the board point and opens its text at once. */
18
- export declare function placeNote(engine: WhiteboardEngineHandle, container: HTMLElement, point: {
19
- readonly x: number;
20
- readonly y: number;
21
- }, color: PenColor): void;
22
- /** Text written in a note sits at its top left, like the mockup's notes. */
23
- export declare function settleNoteText(engine: WhiteboardEngineHandle): void;
24
- /** Undo and redo have no engine call, so the board presses the engine's own keys. */
25
- export declare function pressHistory(container: HTMLElement, redo: boolean): void;
26
- export declare function readCamera(engine: WhiteboardEngineHandle): Camera;
27
- export declare function setCamera(engine: WhiteboardEngineHandle, camera: Camera): void;
28
- export declare function hasContent(engine: WhiteboardEngineHandle): boolean;
29
- export declare function boardImage(engine: WhiteboardEngineHandle, background: string): Promise<Blob>;
30
- export declare function sceneSignature(engine: WhiteboardEngineHandle): number;
31
- export {};
@@ -1,7 +0,0 @@
1
- import { type MutableRefObject } from "react";
2
- import { type WhiteboardEngineHandle } from "@q9labsai/chalk-whiteboard/react";
3
- /** Reads the engine's stacks; never counts host mutations. */
4
- export declare function useEngineHistory(root: MutableRefObject<HTMLElement | null>, engine: WhiteboardEngineHandle | null): {
5
- canUndo: boolean;
6
- canRedo: boolean;
7
- };
@@ -1,90 +0,0 @@
1
- import { type ChalkWhiteboardDrawPolicy, type ChalkWhiteboardView } from "@q9labsai/chalk-client";
2
- /** design.md, "The board": every colour, size and key the board's own controls use. */
3
- export type BoardSurface = "chalkboard" | "paper" | "dots";
4
- export type IslandPlace = "bottom" | "top" | "left";
5
- export type CallTheme = "light" | "dark";
6
- export type PenColor = "ink" | "red" | "orange" | "green" | "blue" | "violet";
7
- export type PenWidth = "thin" | "medium" | "thick";
8
- export type ShapeTool = "rectangle" | "ellipse" | "diamond" | "arrow" | "line";
9
- export type BoardTool = "selection" | "hand" | "pen" | "highlighter" | ShapeTool | "text" | "note" | "eraser" | "laser";
10
- export declare const SURFACES: readonly {
11
- readonly id: BoardSurface;
12
- readonly label: string;
13
- }[];
14
- export declare const ISLAND_PLACES: readonly {
15
- readonly id: IslandPlace;
16
- readonly label: string;
17
- }[];
18
- export declare const DRAW_POLICIES: readonly {
19
- readonly id: ChalkWhiteboardDrawPolicy;
20
- readonly label: string;
21
- }[];
22
- export declare const PEN_COLORS: readonly {
23
- readonly id: PenColor;
24
- readonly label: string;
25
- }[];
26
- export declare const NOTE_FILL: Record<PenColor, string>;
27
- /** Note text is a hair off Ink's canonical colour, so it never turns light with the surface. */
28
- export declare const NOTE_TEXT = "#1b1c1e";
29
- export declare const NOTE_SIZE: {
30
- readonly width: 170;
31
- readonly height: 150;
32
- };
33
- /** A 4px corner, as in the mockup; the engine's default rounding is 32px. */
34
- export declare const NOTE_ROUNDNESS: {
35
- readonly type: 3;
36
- readonly value: 4;
37
- };
38
- export declare const PEN_WIDTHS: readonly {
39
- readonly id: PenWidth;
40
- readonly label: string;
41
- readonly units: number;
42
- }[];
43
- export declare const SHAPES: readonly {
44
- readonly id: ShapeTool;
45
- readonly label: string;
46
- readonly key: string;
47
- }[];
48
- export declare const TOOL_KEYS: Readonly<Record<string, BoardTool>>;
49
- export declare function personColor(index: number): string;
50
- export declare function isDarkSurface(surface: BoardSurface, theme: CallTheme): boolean;
51
- /** The surface's own ink, which is what Ink looks like on it. */
52
- export declare function surfaceInk(surface: BoardSurface, theme: CallTheme): string;
53
- /** The fill behind the drawing, also used as the background of an exported image. */
54
- export declare function surfaceFill(surface: BoardSurface, theme: CallTheme): string;
55
- export declare function selectionColor(surface: BoardSurface, theme: CallTheme): string;
56
- export declare function penHex(color: PenColor, surface: BoardSurface, theme: CallTheme): string;
57
- /** The highlighter has no Ink: it draws orange instead, four times as wide at 40% opacity. */
58
- export declare function highlighterStyle(color: PenColor, width: PenWidth): {
59
- readonly strokeColor: string;
60
- readonly strokeWidth: number;
61
- readonly opacity: number;
62
- };
63
- export declare function engineStrokeWidth(px: number, freehand: boolean): number;
64
- export declare function widthUnits(width: PenWidth): number;
65
- export declare const MIN_ZOOM = 0.1;
66
- export declare const MAX_ZOOM = 4;
67
- export declare function clampZoom(zoom: number): number;
68
- export type Camera = {
69
- readonly scrollX: number;
70
- readonly scrollY: number;
71
- readonly zoom: number;
72
- };
73
- export type Viewport = {
74
- readonly width: number;
75
- readonly height: number;
76
- };
77
- /** The part of the board this camera shows, in board coordinates. */
78
- export declare function visibleView(camera: Camera, viewport: Viewport): Omit<ChalkWhiteboardView, "bring">;
79
- /** The camera that fits someone else's view into this viewport, centred. */
80
- export declare function cameraForView(view: Omit<ChalkWhiteboardView, "bring">, viewport: Viewport): Camera;
81
- /** The camera after zooming to `zoom` around the viewport's centre. */
82
- export declare function zoomAroundCentre(camera: Camera, viewport: Viewport, zoom: number): Camera;
83
- export declare function sameCamera(left: Camera, right: Camera): boolean;
84
- export declare function mixCamera(from: Camera, to: Camera, progress: number): Camera;
85
- /** A critically damped spring step, exact for any frame time. Returns the new offset from the target and the new velocity. */
86
- export declare function springStep(offset: number, velocity: number, rate: number, seconds: number): readonly [number, number];
87
- export declare function readStored<T extends string>(key: string, allowed: readonly {
88
- readonly id: T;
89
- }[], fallback: T): T;
90
- export declare function writeStored(key: string, value: string): void;
@@ -1,6 +0,0 @@
1
- import type { Toast } from "../toast-stack/ToastStack";
2
- export type BoardToast = Omit<Toast, "id">;
3
- /** Null drops the board lifetime’s toasts, including their action callbacks.
4
- * Board events join the call's own toast stack, so they look, sit and time out like every other toast. */
5
- export declare const BoardToastContext: import("react").Context<(toast: BoardToast | null) => void>;
6
- export declare function useBoardToast(lifetime: object | null): (toast: BoardToast) => void;
@@ -1 +0,0 @@
1
- export { ChalkWhiteboardViewVersions as ViewVersions } from "@q9labsai/chalk-client";
@@ -1,20 +0,0 @@
1
- import { type ReactElement, type ReactNode } from "react";
2
- export interface ChalkMenuProps {
3
- readonly trigger: ReactElement;
4
- readonly onOpenChange?: (open: boolean) => void;
5
- readonly children: ReactNode;
6
- readonly side?: "top" | "bottom";
7
- readonly className?: string;
8
- }
9
- export declare function ChalkMenu({ trigger, children, side, className, onOpenChange }: ChalkMenuProps): import("react").JSX.Element;
10
- export interface ChalkMenuItemProps {
11
- readonly children: ReactNode;
12
- readonly checked?: boolean;
13
- readonly disabled?: boolean;
14
- readonly onClick?: () => void;
15
- readonly closeOnClick?: boolean;
16
- }
17
- export declare function ChalkMenuItem({ children, checked, disabled, onClick, closeOnClick }: ChalkMenuItemProps): import("react").JSX.Element;
18
- export declare function ChalkMenuLabel({ children }: {
19
- readonly children: ReactNode;
20
- }): import("react").JSX.Element;
@@ -1,11 +0,0 @@
1
- import { type ReactElement, type ReactNode } from "react";
2
- export declare function ChalkPopover({ trigger, children, label, className, alignOffset, tooltip, open, onOpenChange, }: {
3
- readonly open?: boolean;
4
- readonly onOpenChange?: (open: boolean) => void;
5
- readonly trigger: ReactElement;
6
- readonly children: ReactNode;
7
- readonly label: string;
8
- readonly className?: string;
9
- readonly tooltip?: string;
10
- readonly alignOffset?: number;
11
- }): import("react").JSX.Element;
@@ -1,5 +0,0 @@
1
- import { type ReactElement, type ReactNode } from "react";
2
- export declare function ChalkTooltip({ trigger, children }: {
3
- readonly trigger: ReactElement;
4
- readonly children: ReactNode;
5
- }): import("react").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const WHITEBOARD_VIEW_PEOPLE_MAX = 500;