Reference · 1,241 exports · mocanvas 4.11.2
The flagship: the canvas component, the built-in shapes and tools, and the default UI.
Read out of the type declarations inside the published package, so a name here is a name in the version above — and its description is the one written next to the code.
1241 of 1241
Marks the anchor each bound terminal of the selected arrow is attached to.
class
Keeps arrows attached to the shapes their terminals are bound to.
class
Outlines the shape an arrow terminal is about to bind to.
class
class
Drag to draw an arrow; dropping the end on a shape binds it to that shape.
class
Drag out a box shape, or click to place a default-sized one.
class
The half a brush painter shares with the other one: read a rectangle off the instance record, name it, stroke it in page space.
class
Bookmarks: a link with a title, description and preview image.
class
class
Paints the select tool's brush.
class
The shared half of the three utils below.
Another person's selection brush, in their colour.
Other people's pointers, with their names beside them.
The marker on the viewport edge that says a collaborator is off screen, and which way they are.
The half every collaborator painter shares: who to draw, and how faded.
Another person's live scribbles — their laser, their eraser trail.
Outlines round the shapes another person has selected.
class
class
Freehand drawing.
class
class
Delete shapes by dragging over them.
class
class
Drag out a frame, or click to place a default-sized one.
class
class
Draw a geo shape (rectangle, ellipse, ...) by dragging.
class
A container with no visuals of its own; its bounds are the union of its children.
class
Pan the camera by dragging.
class
Draw a translucent marker stroke over what is already on the canvas.
class
A translucent marker stroke, drawn behind the shapes it marks.
class
Image files: raster and SVG, downsized to the configured maximum.
class
class
Point at things: a fading trail that never becomes a shape.
class
class
Drag for a straight line, or click repeatedly for a multi-segment one.
class
class
Click to place a sticky note.
class
One run of a path, as a `Geometry2d` the editor can hit-test, snap to and export.
class
Paints every live scribble.
Paints, and hit-tests, the selection box and its handles.
class
Selection, brush select, drag-to-move, resize, rotate, and shape handle dragging.
Paints, and hit-tests, the handles of the single selected shape.
Paints every selection, hover and drop-target outline onto the canvas overlay in a single pass.
Paints the snap guides `editor.snaps` published for the drag in flight.
class
Measures runs of text with a hidden DOM element, mirroring the CSS the `<TextLabel>` component uses (pre-wrap + break-word, border-box padding).
class
class
Click to place a text shape and start typing.
class
Video files.
class
class
The zoom tool's brush: the rectangle you drag to zoom to a region.
class
Click, alt-click or drag a box to move the camera.
function
The accessibility preferences.
function
`{ normalized binding: actionId }` for every action that declares one.
function
Component form, so the hook can be mounted from inside the UI provider.
function
The six alignment items.
function
function
function
Fold a plain-text edit back into a rich-text document.
function
function
Approximate a circular arc with `count` cubic béziers.
function
Align, distribute, stack, stretch and flip, as one submenu.
function
The rich-text document form of any label source; a string is converted, a document passed through.
function
Geometry for the body: a polyline (straight or elbow) or a cubic approximation of the arc.
function
A rectangle at an offset, for a geometry whose bounds do not start at the origin.
function
Measures the editor's container and publishes its breakpoint.
function
Build the default action list for an editor.
function
Build the default tool list for an editor.
function
Every binding in the table, indexed by its normalized form.
function
Whether canvas paths can be built at all.
function
Whether there is anything on the current page to print.
function
Whether this environment can decode an image into a texture source at all.
function
Convert a polyline into a smooth cubic spline that passes through every point (uniform Catmull-Rom, tension 0.5, converted to bézier handles).
function
Centres a panel across the top, between whatever is docked left and right.
function
Move the selection so its centre sits at `position`.
function
Classify pasted or dropped plain text as our own clipboard JSON (`null`), a url, svg markup, or text.
function
Forget the current target.
function
Cut / copy / paste, as one group.
function
Extra height a box needs so its label fits: `labelHeight - boxHeight`, never negative.
function
Fit `box` inside `container` without changing its aspect ratio.
function
Copy-as and export-as, as one group.
function
Put a rendered copy of the shapes on the system clipboard.
function
"Copy as" — the rendered formats, plus mocanvas's own content JSON.
function
Copy `blob` to the system clipboard.
function
Copy the selection.
function
Copy the selection.
function
Create a bookmark shape for `url`, centred on `center`.
function
Create the `bookmark` card for a url, storing `asset` when the unfurl produced one.
function
Create a boolean flag.
function
Create a flag of any type.
function
Create the `embed` shape for an already-matched url, centered on `point`.
function
Create a bookmark card for `url` with no asset behind it yet.
function
Register a feature flag.
function
Build (without storing) an image asset for a file; `undefined` for non-image files.
function
Build (without storing) an image asset from SVG markup.
function
Store `assets` and create one image shape per asset, centered on `point` and stacked by `stackOffset`.
function
Store `assets` and create the shape each one calls for, centred on `position` and stacked so several dropped files do not land exactly on top of one another.
function
Create a text shape whose bounds are centered on `point`.
function
The cursor-chat entry field.
function
Cut the selection.
function
Copy the selection, then delete it.
function
`stroke-dasharray` for an engine dash id (0 solid, 1 dashed, 2 dotted, 3 draw).
function
The debug flag list.
function
The live region itself: two of them, one per priority, because a region's politeness cannot change after it is announced into.
function
The selection-actions menu: a grid of icon buttons.
function
The actions menu's items: alignment, distribution, reordering.
function
The built-in rich-text font visitor: work out which face a node needs, register it, and pass the resulting state to the node's children.
function
The right-click menu.
function
The right-click menu's items.
function
The debug menu.
function
The debug menu's items.
function
Renders the dialog stack into the editor's container.
A url the caller has already decided to embed, skipping the bookmark negotiation.
The default handler for Excalidraw content arriving on the clipboard.
function
Build an asset record for a file, without creating any shape.
function
Files: turn each one into an asset through the util that claims its type, then create the shapes those assets call for.
Replace the asset behind an existing shape with one built from `file`.
SVG markup: one image shape backed by an inline SVG asset.
function
Plain text: one text shape, centred where it was dropped.
mocanvas's own clipboard content: shapes, bindings and assets, put back onto the current page.
function
Build a bookmark asset for a url, without creating any shape.
function
Handle a url that arrived from outside the editor.
function
The strip of contextual helper buttons above the toolbar.
function
The helper buttons' items: "back to content", shown only when there is content and none of it is on screen.
function
The help menu.
function
The help menu's items.
function
The image bar's buttons: aspect ratio, and replace.
function
The dialog frame.
Every shortcut the editor is listening for, grouped.
function
The top-left menu.
function
The main menu's items.
function
The top-left plate: the main menu, the page picker, and — where there is room for them — the common actions.
function
The zoom cluster, and the minimap above it on wide layouts.
function
One person's avatar: their colour, and their initials.
function
The overlapping avatars on the people menu's trigger.
function
One row in the collaborator list; clicking it follows that person's camera.
function
The always-visible row of common actions, and the row the actions menu rides at the end of.
function
The quick-actions row's items.
function
The formatting buttons.
function
The pickers, in the order the panel shows them.
function
The toast stack.
function
The toolbar plate.
function
The default set of toolbar buttons, in order.
function
The toolbar, with the mobile style trigger beside it on narrow layouts.
function
mocanvas's chrome, and the context every part of it reads.
function
The video bar's buttons: play/pause and loop, written onto the shape.
function
The zoom menu; its trigger shows the current zoom level.
function
The zoom menu's items.
function
Delete the selection.
function
The two distribute items.
function
Trigger a download of `blob` as `filename`.
function
Scale `size` down — never up — so neither side exceeds `max`, keeping the aspect ratio.
function
Re-encode an image blob at `width`×`height`.
function
function
Duplicate the selection.
function
The edit submenu's items, without the submenu frame.
function
The `allow` attribute for an iframe, built from a permissions map.
function
The `allow` attribute for `permissions`, or `undefined` when nothing is granted.
function
Escape text for insertion into HTML/XML character data or an attribute value.
function
Escape text for use inside an element or a double-quoted attribute.
function
Estimate the box a run of text occupies at `fontSize`, wrapping each paragraph at `maxWidth` using an average character width.
function
A confirm/cancel dialog, complete.
function
Render the shapes and hand the file to the browser's downloader.
function
"Export as" — writes a file through the browser's downloader.
function
Export the whole document as a `.mocanvas` file.
function
Render the export to a `Blob`.
function
The odds and ends at the bottom of the main menu.
function
The feature flag list.
function
Resize a frame — or any frame-like container — so it fits its children, with `padding` around them.
function
Scale `size` down (never up) so both sides fit within `max`, keeping the aspect ratio.
function
Affinely stretch points so their bounding box becomes exactly [0,w]×[0,h].
function
A positioned, dismissable layer portalled into the editor's container.
function
Outline drawn with the render style, or a hairline in the theme text colour when the shape has none.
function
One `<path>` per leaf geometry, filled only where the leaf is a closed, filled outline and stroked with the shape's stroke.
function
Map a normalized anchor `(0..1, 0..1)` into a shape's geometry bounds (shape-local space).
function
The arrow's terminal bindings, keyed by terminal.
function
The topmost shape an arrow terminal dropped at `pagePoint` should bind to, or `undefined`.
function
Describe the body running from `start` to `end`, bowed by `bend`.
function
Resolve an arrow's display values; see {@link ArrowShapeUtilDisplayValues}.
function
Arrowhead geometry with its tip at `tip`, pointing along unit `dir` (from the body outward).
function
How far the body must retreat from the tip so it ends at the head's base.
function
Arrowhead length for a stroke width, capped so two heads never overlap.
function
Resolve an arrow to the geometry everything downstream draws from.
function
What the arrow is currently pointing at, or `null` when it is over empty canvas.
function
The gap in page units for an arrow of a given size style.
function
Resolve both terminals of an arrow in arrow-local space.
function
The size and mime type of an asset, for a shape that is placing it.
function
Signed bend for a dragged midpoint handle at `point`.
function
function
The shape's `bookmark` asset, or `null` when it has none (or one of another type).
function
function
The host a bookmark points at, without a `www.` prefix — the one line of a link card that is always available, since it comes from the shape's own url rather than from a scrape.
function
function
For each bound terminal, the axis of the normal of the bound shape's nearest edge: `"x"` on a left or right edge, `"y"` on a top or bottom one.
function
The breakpoint a container of `width` CSS px is in.
function
Serialize the given shapes (default: the selection) as clipboard text.
function
A ring of round bumps around an inner ellipse, fitted to the box.
function
The colour choices, with their light-theme swatches.
function
The shape update one step of a crop drag produces, or `undefined` when the drag would change nothing.
function
Engine dash pattern id for a dash style (see `mocanvas-render::dash`).
function
Every registered flag.
function
The best match for a browser locale among {@link LANGUAGES}, falling back to English.
function
The axis a free terminal leaves on: the one the terminals are further apart on.
function
Resolve a draw shape's display values against a theme.
function
Flatten a draw shape's segments to one outline, smoothing freehand runs.
function
The four sides of `box` as the router sees them.
function
The two ends and their union; see {@link ElbowArrowBoxes}.
function
Route an elbow arrow between two ends, and report everything the routing was derived from.
function
The axis a leg attached to `side` runs along.
function
Which side of `box` the point `to` sits off, or `null` when it is inside.
function
One end of an arrow as a target box.
function
The elbow body for an arrow: the rounded route as a polyline body.
function
`elbowMidPoint` for a midpoint handle dragged to `point`: how far along `axis` it sits between the terminals, clamped to `0..1`.
function
Route an elbow from `start` to `end`.
function
The permit-list entry for `url`, with the url to actually put in the iframe, or `null` when the url is not one we embed.
function
Resolve an embed's display values; see {@link EmbedShapeUtilDisplayValues}.
function
Resolve a url against a permit list, in both directions.
function
Common page bounds of the shapes, or `undefined` when there are none.
function
The shapes an export covers: the given ids (or the selection, or the whole page when nothing is selected) together with all of their descendants, in page draw order.
function
Engine RGBA for a shape's interior.
function
The CSS font stack a font style resolves to, in `theme`.
function
The font choices.
function
Resolve a frame's display values; see {@link FrameShapeUtilDisplayValues}.
function
Open polylines drawn inside the outline (the X of an x-box, the tick of a check-box).
function
Resolve a geo shape's display values; see {@link GeoShapeUtilDisplayValues}.
function
Build the outline geometry for a geo kind inside a w×h box.
function
`growY` a geo shape needs so its label fits inside `h`.
function
The box a geo icon's outline is fitted into, in grid units.
function
Polygon vertices for the polygonal geo kinds, or `null` for the curved kinds (ellipse, oval, cloud, heart).
function
The definition for a geo type, or `undefined` when nothing defines it.
function
Engine RGBA for a fill style's hatch, or 0 when that style has no hatch.
function
Classic two-lobed heart, six cubics, bounds exactly w×h.
function
Resolve a highlight's display values against a theme.
function
The stroke as one polyline, freehand runs smoothed.
function
The shape under the pointer, as a click should resolve it.
function
CSS for the `<img>` so the crop window fills the shape's box; `null` crop shows the whole image.
function
Resolve an image shape's display values; see {@link ImageShapeUtilDisplayValues}.
function
Texture cache key for the shape's pixels, or `null` when it must stay on the DOM overlay.
function
The source the shape's pixels come from: the asset's `src` (a URL or data URL), or `null` when the shape has no asset yet or the asset is still uploading.
function
The typefaces a label in `font` needs: the four `[style][weight]` faces of that family.
function
The lift in px for a label, given the same options `measureLabel` takes.
function
Resolve a line's display values; see {@link LineShapeUtilDisplayValues}.
function
The line's points in drawing order, skipping any entry that is not a point.
function
Normalize a page point into a shape's geometry bounds, clamped to `[0, 1]`.
function
The label's size before any shrinking: the size style, scaled.
function
CSS `background` for a note body: the vertical gradient, top to bottom.
function
Resolve a note's display values against a theme.
function
CSS colour at the bottom of a note's body gradient (the palette's note fill).
function
Engine RGBA for a sticky note's background.
function
Effective font size: the size style, shrunk by `fontSizeAdjustment`.
function
CSS colour at the top of a note's body gradient.
function
Top of a note's body gradient, derived from the colour at its bottom.
function
`growY` a note needs so its (centered) text fits; the note keeps its square width.
function
CSS `box-shadow` for a note body, in shape-local units at `scale`.
function
The note shadow's geometry for an SVG export, in shape-local units.
function
CSS color string for text on a sticky note.
function
Flattened outline of a geometry as line segments, in the geometry's own space.
function
Point at parameter `t` in [0, 1] along the body.
function
The points of one segment, scaled by `scaleX`/`scaleY`, appended to `points`.
function
Every point of a stroke, in order, scaled to the shape's current size.
function
The registered rich-text editor factory, or `null` when labels edit as plain text.
function
The rich-text extension list an editor is configured with, or the default set.
function
Stadium / capsule: two semicircles joined by straight sides.
function
The polygon surrounding `points` — {@link getStrokePoints} then {@link getStrokeOutlinePoints}.
function
Walk the stroke points and produce the polygon that surrounds them.
function
Resample and smooth raw input into the points the outline is built from.
function
Engine RGBA for a shape's stroke.
function
Choices built from an enum style prop, labelled by title-casing its values.
function
Decide which rows the style panel shows for the editor's current state.
function
The centreline of a stroke as an SVG `d`, drawn with quadratic curves through the midpoints between samples.
function
Serialize shapes to an SVG string.
function
Pixel size declared by an SVG's root `width`/`height` or `viewBox`, or `null` when neither is usable.
function
Unit direction of travel at parameter `t`.
function
CSS color string for text drawn in the DOM overlay.
function
Resolve a text shape's display values; see {@link TextShapeUtilDisplayValues}.
function
The shared measurer.
function
The box `getGeometry` produces: what a texture for this shape must cover.
function
Height of the text block at its current width.
function
Width and height of a text shape: measured (auto-size) or wrapped at `w`.
function
Measured size of a text shape: intrinsic when `autoSize`, else wrapped at `w`.
function
The rasterization spec for a text shape at the editor's current resolution bucket.
function
Cache key for a spec.
function
Effective resolution after clamping the canvas to `MAX_TEXT_TEXTURE_PX`.
function
The theme `source` is currently painting with, or the built-in one.
function
The ramp `source` is currently painting with; see {@link getTheme}.
function
mocanvas's default TipTap extension set, with `StarterKit` configured.
function
Resolve a video shape's display values; see {@link VideoShapeUtilDisplayValues}.
function
The play triangle's points, centred in a `w`×`h` box.
function
The file the shape plays: the asset's `src`, or `null` when there is no asset yet, the asset is still uploading, or it is not a video.
function
The table's rows, in the order the sections are shown.
function
Group the selection.
function
A width given in CSS pixels, expressed in the page units the camera transform is about to scale.
function
Write the current selection to the clipboard, from either a native copy event or a menu item.
function
Whether any row at all is on.
function
Whether `flip` asks for anything at all.
function
`#rrggbb` as a CSS `rgba()` string at `alpha`.
function
Dismiss whatever tooltip is on screen.
function
function
function
Provides {@link ActionRowIsHosted}.
function
Renders one icon from the set.
function
Intersection point of segments `a1-a2` and `b1-b2`, or `null` when they do not cross.
function
function
Whether `content` looks like an Excalidraw clipboard payload.
function
function
Whether `value` lies inside `span`, inclusive.
function
Save the paint state, run `draw`, restore.
function
Whether `value` is a rich-text document rather than a string or junk.
function
Whether a locale is written right to left.
function
function
Whether a video may start itself.
function
Split a shortcut into the keys to draw.
function
The form the dialog stack wants: a component taking `onClose`.
function
Open the keyboard shortcuts dialog.
function
The label's font style token, from either spelling.
function
The label's font style token, from either spelling, defaulting to `draw`.
function
The stretch of `body`, as a parameter range, that runs inside `box` — the gap the *selection outline* leaves around a label.
function
The label's horizontal alignment, from either spelling.
function
A straight line expressed as a cubic (control points at 1/3 and 2/3).
function
Decode an image `src` (URL or data URL) into something the GPU can sample.
function
Load a `.tldr` file (text or parsed JSON) into the editor, replacing the document.
function
Load TipTap's `StarterKit` so {@link getTipTapDefaultExtensions} can return real extensions.
function
Load TipTap's own starter extensions, for an app that has the optional peer dependency installed and wants the standard set rather than mocanvas's descriptions.
function
Lock, and unlock-all, as one group.
function
function
function
`matrix(a b c d e f)` for a `transform` attribute.
function
Measured size of a geo label (padding included), wrapped at the shape width.
function
Measure a shape label with the shared measurer using the default label typography.
function
Measure a rich-text value directly: render it, then hand it to the shared measurer.
function
Mirror `points` about the centre of the `w × h` box on the requested axes.
function
{@link mirrorPointsInBox} for cubic segments: every control point moves with its anchors.
function
The bottom group of the context menu.
function
function
One UI item rendered as a button — the thing a toolbar is made of.
function
Normalize an authored binding into the same shape {@link bindingString} makes.
function
Whether `file` may be turned into an asset — and if not, say so on screen.
function
The "you are offline" chip.
function
Create a shape at the end of a drag that started on the toolbar.
function
A toolbar that moves whatever will not fit into a "more" popover.
function
The rename field on a page row.
function
The per-page actions: rename, duplicate, delete.
function
Parse `.tldr` JSON text without loading it into an editor.
function
Put whatever mocanvas content is on the clipboard onto the current page.
function
Paste at the viewport centre, or at the pointer when that mode is on.
function
Convert the engine's flat path encoding to an SVG `d` attribute (for indicators).
function
Place `box` next to `anchor`, on the preferred side if it fits there and on the other side if it does not, then clamp the result inside the viewport.
function
The editable surface behind a plain-text label.
function
A shape's label, as plain text.
function
Evaluate a cubic segment at `t`.
function
An open or closed polyline through `points`.
function
A dismissable floating grid anchored to a button.
function
The preferences, behind one row of the main menu.
function
Load a font into a document and register it under `id`.
function
Print the drawing: the selection if there is one, otherwise the page.
function
A shape's props as a bag of unknowns, tolerating a missing or non-object `props`.
function
Put Excalidraw clipboard content onto the current page, centred on `point`.
function
An array prop; a missing or non-array value reads as empty.
function
function
The shape with every declared prop present and of the declared type.
function
function
The shape's segments in a usable form.
function
A string prop constrained to a known set; anything else falls back.
function
Read a file into a `data:` URL, via `FileReader` where present and `arrayBuffer()` elsewhere.
function
function
The pixel size of an image from its source.
function
function
function
A `{ x, y }` prop, with each coordinate falling back independently.
function
A record-of-objects prop (a line's points, say); anything else reads as empty.
function
A shape's label as a rich-text document — the reader every other label read goes through.
function
function
A style prop's value, validated against the style's own set of values.
function
A shape's label as plain text.
function
function
A rectangle, optionally rounded.
function
Puts `data-reduce-motion` on the editor's container while motion is reduced, so `ui.css` can switch off the chrome's transitions.
Install the default drop/paste behaviour: image files become image assets + image shapes, SVG markup becomes an image asset, text and urls become text shapes.
function
Install the default side effects and return a function that removes them.
function
Tool ids the editor currently has registered.
function
Install the WYSIWYG editing surface used when a label is being edited.
function
Register (or replace) the SVG renderer for a shape type.
function
Remove the frames among `ids`, keeping what was inside them.
function
A rich-text document as HTML.
Render a rich-text value to the HTML the text measurer sizes.
Render a rich-text value to HTML with an **explicit** extension list.
function
A rich-text document as plain text.
function
Parse HTML into a rich-text document.
function
Draw the label onto a canvas covering the whole `width × height` box, so the engine's uv `0..1` quad over the shape's local bounds lands pixel-for-pixel.
function
The four reorder items.
function
Reordering, as a submenu.
function
Resolve one scribble's colour.
function
The style panel in whichever form the layout calls for.
function
Convert an engine `0xRRGGBBAA` word to `#rrggbb` (opaque) or `#rrggbbaa`.
function
The editable surface behind a rich-text label.
function
Structural equality of two documents, by value.
function
A shape's label, as a rich-text document.
function
A rich-text label as SVG markup.
function
Flatten a document to the blocks the renderers draw: one block per top-level block node (a paragraph, a heading, a list item), each a list of styled runs.
function
Serialize a rich-text document to HTML.
function
The plain string a label reads as, whatever it was given.
function
Rotate the selection a quarter turn clockwise.
function
`corners` with every interior corner replaced by a fillet of `radius`.
function
A link `href` that is safe to render, or `null` when the scheme is not allowed.
function
Sanitize an SVG document, returning the cleaned markup — or `null` when the input was not SVG at all, or when nothing survived.
function
Select everything on the page.
function
Runs {@link useSelectedShapesAnnouncer}.
function
function
The editor's document as `.tldr` JSON text.
function
The same document as a `Blob`, ready to hand to a downloader or an upload.
function
A shape's backdrop in shape-local space, drawn behind *every* exported shape.
function
Render a shape to SVG markup in shape-local space.
function
Trim `startBy` / `endBy` page units from either end of the body.
function
One pass of a light 1-2-1 moving average over a freehand stroke.
function
The two stack items.
function
Put a shape into text-editing mode from outside the label.
function
The two arrowheads.
function
How an arrow's body is routed.
function
{@link StylePanelButtonPickerInline} with its label row.
function
A row of buttons, one per value: the shape for a style with four or five choices that each have a glyph — fill, dash, size, alignment.
function
Shape colour.
function
Dash style.
function
{@link StylePanelDoubleDropdownPickerInline} with its label row.
Two dropdowns under one label: the arrowheads, which are two styles but one decision, and which read as unrelated when split into two rows.
function
{@link StylePanelDropdownPickerInline} with its label row.
function
A button that opens a grid of choices: the shape for a style with too many values to sit in a row — the twenty geo kinds, most obviously.
function
Fill style.
function
Font family.
function
The geo kind.
function
Where the label sits inside its shape.
function
A band of related rows, ruled off from its neighbours.
function
Stroke size.
function
How a line interpolates between its points.
function
A row's label, with the "mixed" marker when the selection disagrees.
function
function
A path from SVG path data.
function
Markup for a value returned by `toSvg` / `toBackgroundSvg`: a string is used verbatim, a React node is serialized, and React's empty values become `undefined` so the caller can fall through to the next renderer.
function
A `data:` URL for an SVG document string.
function
A shape's text label.
function
Horizontal alignment of a spec, from either spelling.
function
The plain text of a spec: the document's text when it has one, else `text`.
function
Render `source` inside `box`.
function
A snapshot as an inline SVG.
function
mocanvas's chrome, and every context it reads.
function
Holds the announcement queue.
function
Publishes an action list to its subtree.
function
A button.
function
The tick at the end of a checkbox menu row.
function
The icon slot inside a {@link TldrawUiButton}.
function
The text slot inside a {@link TldrawUiButton}.
function
A vertical stack of controls.
function
Publishes the UI chrome map.
function
Mounts the UI contexts.
function
A floating toolbar anchored to a page-space box.
function
A dialog's scrollable middle.
function
The dialog's close affordance.
function
A dialog's button row.
function
A dialog's title bar.
function
Holds the dialog stack.
function
A dialog's title.
function
A row that toggles.
function
The menu panel.
function
A run of related rows.
function
The dot marking the chosen entry in a radio group.
function
A plain row.
function
The pair's root.
function
A nested menu's root.
function
A nested menu's panel.
function
The row that opens a nested menu.
function
The control that opens the menu.
function
Publishes `onEvent` to {@link useUiEvents}.
function
A fixed-column grid: colour swatches, geo kinds, the shortcuts dialog.
function
An icon, from the built-in set, from a URL, or as a fallback initial.
function
A slot for whatever an app wants drawn over the canvas but under the panels.
function
A labelled text input that commits on Enter and reverts on Escape.
function
A shortcut as a row of `<kbd>` elements.
function
A checkbox menu item driven by the action list.
function
A menu item driven by the action list.
function
A menu item that toggles.
function
Tells the items inside it what shape to take.
function
A run of related items, with a rule between it and the next.
function
One menu item, in whatever shape its context calls for.
function
A nested menu.
function
A menu item driven by the tool list, showing whether its tool is active.
function
Publishes an orientation to everything inside it.
function
The pair's root.
function
The panel.
function
The control that opens the panel.
function
A horizontal run of controls.
function
The picker's root.
function
The option list.
function
One option.
function
The control showing the current value.
function
The current value, rendered from whichever item registered it.
function
A range input.
function
Holds the toast list.
function
A `role="toolbar"` container with roving focus.
function
A button inside a {@link TldrawUiToolbar}.
function
A run of mutually-exclusive (or multi-select) toolbar buttons.
function
One entry in a {@link TldrawUiToolbarToggleGroup}.
function
Publishes a tool list to its subtree.
function
Attaches a tooltip to its child.
function
Hosts the shared tooltip layer.
function
Resolves the editor's current locale into a {@link TLUiTranslation} and publishes it.
function
Text exactly as the static label / measuring element must render it to occupy the right box.
function
Lift the polyline `elbow-helpers` produced into the documented route shape.
function
Show the frame-statistics chip and the debug menu.
function
Scale new shapes so they look the same size at any zoom.
function
Scroll the camera when dragging past the viewport edge.
function
Hide the chrome.
function
Show the grid.
function
Keyboard shortcuts on or off.
function
Lock or unlock the selection.
function
Paste at the pointer rather than at the viewport centre.
function
Turn off animation: the chrome's transitions and the camera's easing.
function
Snap to other shapes while dragging.
function
Keep the current tool after drawing a shape.
function
Export with a transparent background.
function
Wrap long text instead of growing the shape.
function
`{ key: toolId }` for every plain single-key binding in the list.
function
Component form, so the hook can be mounted from inside the UI provider.
function
Convert a plain string into a rich-text document.
function
An `×` centred on a point, as the snap layer marks an aligned edge.
function
Trace a polyline.
function
Trace a rectangle with rounded corners.
function
Trace a scribble as a *tapered* ribbon rather than a stroked line.
function
A copy of a flat path with `mat` applied to every point.
function
Trim whitespace at the end of a label (kept inside the run, e.g.
function
Shorten a string with an ellipsis, on a grapheme boundary.
function
The single tooltip for the whole UI.
function
Undo and redo, as one group.
function
Ungroup the selection.
function
Unlock every locked shape on the page.
function
The plain text of a label that may carry markup.
function
Recompute the target state from the current pointer position, publish it, and return it.
function
The announcer.
function
Binds the action list's shortcuts for as long as the calling component is mounted.
function
The action list published by the nearest {@link TldrawUiActionsProvider}, if any.
function
Whether an action can run right now, and whether it is on.
function
Position an element beside `anchor` once it has been measured.
function
Whether any menu at all is open.
function
The languages this editor can actually be shown in.
function
The actions that really answer to a key right now, in action-list order.
function
The tools that really answer to a key right now, in tool-list order.
function
The current breakpoint.
function
Whether an action that edits the selection can run: the editor is writable and at least one selected shape is unlocked.
function
Whether there is anything to redo.
function
Whether there is anything to undo.
function
A coarse status for the collaboration chrome.
function
"Copy as PNG/SVG/JSON", with the toast the menu item is expected to raise.
function
The resolved dictionary.
function
Everything a menu item's `onSelect` normally reaches for, in one object.
function
The dialog stack.
function
The writing direction of the current locale; `"ltr"` outside a provider.
function
Close on Escape or on a pointer press outside both the layer and its anchor.
function
The handle for a label that stores a plain string.
function
The handle for a label that stores a rich-text document.
function
"Export as PNG/SVG", with the same error toast.
function
Drop and paste support for the canvas container: files, images, svg markup, urls and plain text are routed to `editor.putExternalContent`.
function
Whether the current page has any locked shapes to unlock.
function
Resolve a chrome slot the way the surrounding chrome resolves it.
function
Resolve an image or video asset to a URL that can be put in a `src`.
function
Whether the editor is in dark mode right now.
function
Whether the grid is on.
function
Default keyboard shortcuts: {@link KEYBOARD_SHORTCUTS}, plus tool switching.
function
A value kept in `localStorage`, as React state.
function
The resolved dictionary, or `null` outside a provider.
function
Cut, copy and paste for the menus and the action list.
function
Whether a menu is open, tracked on the editor's instance state.
function
Roving focus inside a menu: Up/Down move, Home/End jump, and focus lands on the first item when the menu opens.
function
The native `copy`, `cut` and `paste` listeners on the container.
function
The ids of everyone else on this page.
function
Everyone else on this page.
function
Whether the *operating system* asks for reduced motion.
function
One person's presence record, or `null` when they have left.
function
Whether the editor refuses document edits.
function
Whether motion is reduced right now: the user's `animationSpeed` preference, or — while they have expressed none — the operating system's.
function
The styles the style panel should offer, and their shared values.
function
Announce the selection whenever it changes.
function
Whether to show collaboration chrome at all.
function
The style panel's context.
function
The UI chrome map.
function
The menu context an item is in.
function
The current orientation, plus the two keys that move focus along it.
function
The toast list.
function
Binds the tool list's shortcuts for as long as the calling component is mounted.
function
The tool list published by the nearest {@link TldrawUiToolsProvider}, if any.
function
Suppress tooltips for as long as the caller says.
function
Look a string id up.
function
Report a UI event.
function
Whether the editor is in a state where the UI lists are worth reading at all — an editor that has been disposed still renders, but nothing it lists can be acted on.
function
How many of the selected shapes can actually be changed.
function
function
function
The view submenu: zoom and grid.
function
Run `draw` with the camera installed, so everything inside is in **page** coordinates.
function
Split `text` into rendered lines: hard breaks on `\n`, soft wraps at `maxWidth` when given.
function
Break `spec.text` into the lines the label renders as: hard newlines always, plus greedy word wrapping at `maxWidth` (breaking inside a word only when a single word does not fit), mirroring `overflow-wrap: break-word`.
function
Break a spec's label into the lines the raster draws, keeping each run's formatting.
function
Zoom to fit, or rotate — whichever the pointer device suggests.
function
Reset the camera to 100%.
function
Fit the whole page in the viewport.
function
Fit the selection in the viewport.
interface
interface
interface
A {@link Placement} with the room the layer has to fit in.
interface
The paint a bound-terminal marker is drawn with.
interface
How the anchor dot is drawn.
interface
Props of an `arrow` binding.
interface
interface
The paint an arrow hint is drawn with.
interface
How the "will bind" outline is drawn.
interface
`ArrowShapeUtil`'s settings; see {@link ShapeUtil.configure}.
interface
interface
What an arrow paints with.
interface
One of the four side handles the hint overlay draws on a target.
interface
The shape an arrow terminal is currently over, and everything derived from that.
interface
interface
One entry in the aspect-ratio picker.
interface
Constructor form, matching what `<Mocanvas assetUtils={…}>` accepts.
interface
What every asset util can be configured with; a subclass adds its own.
interface
Where content should land, when it says.
interface
What every rendering of a path needs, whatever its style.
interface
Everything the card draws, with each field falling back to something renderable.
interface
Where each part of the card sits, in shape-local space.
interface
A rectangle in shape-local space.
interface
`BookmarkShapeUtil`'s settings; see {@link ShapeUtil.configure}.
interface
interface
A `w`/`h` pair in page units.
interface
The bars that appear over a selected image or video.
interface
interface
The paint a brush is drawn with, resolved against the live theme.
interface
Everything about a brush that is not a colour.
interface
A camera, as {@link Editor.getCamera} returns it.
interface
interface
Shared configuration for the collaborator painters.
interface
interface
Limits {@link getCropBox} respects.
interface
interface
Flags an app adds of its own.
interface
An embed definition supplied by the app.
interface
Draw the path as evenly spaced dashes or dots.
interface
One flag: a name, a default, and the signal holding its current value.
interface
interface
Settings for the built-in services, keyed by service id.
interface
interface
interface
interface
The formatting bar over a text shape that is being edited.
interface
interface
interface
interface
The inputs {@link PathBuilder.toDrawD} needs to reproduce one hand-drawn pass.
interface
Draw the path with a hand-drawn wobble.
interface
interface
interface
`DrawShapeUtil`'s settings; see {@link ShapeUtil.configure}.
interface
interface
What a draw shape paints with.
interface
Everything a label component needs, from either hook.
interface
A box the router works with, in both the sizes it needs: the shape's own bounds, and those bounds grown by the clearance an arrow keeps from them.
interface
A box's four sides, keyed by side.
interface
The two ends and the space they share.
interface
One side of a box, as the router sees it.
interface
{@link ElbowArrowInfoWithoutRoute} plus the route that was picked.
interface
Everything the router derived, before it picked a route.
interface
The handle that slides an elbow's middle leg.
interface
How much room an elbow arrow gives itself.
interface
A closed span on one axis, in page units.
interface
A routed elbow: the polyline, and everything a caller needs to describe it.
interface
One end of an elbow arrow: the box it attaches to, plus how it may attach.
interface
A body made of straight runs: the elbow arrow's axis-aligned route with its corners already rounded.
interface
interface
interface
Which axis an elbow arrow leaves a terminal on, when that terminal is bound.
interface
One embeddable service: the exact hosts it is recognised by, and how one of its page urls becomes an embeddable one.
interface
What {@link getEmbedInfo} resolved a url to.
interface
A url that matched the permit list.
interface
interface
interface
What an embed shape paints with.
interface
interface
interface
interface
interface
interface
Options for {@link defaultHandleExternalUrlContent}.
interface
A toast surface, as much of one as this module needs.
interface
interface
interface
`FrameShapeUtil`'s settings; see {@link ShapeUtil.configure}.
interface
interface
What a frame paints with.
interface
Which axes a silhouette is mirrored about, inside its own `w × h` box.
interface
Options {@link GeoTypeDefinition.getPath} is given beyond the box.
interface
`GeoShapeUtil`'s settings.
interface
interface
What a geo shape paints with.
interface
One geo silhouette.
interface
Google Maps needs a key to embed anything beyond a basic map, so it is the one built-in with settings worth naming.
interface
`HighlightShapeUtil`'s settings; see {@link ShapeUtil.configure}.
interface
interface
What a highlight paints with.
interface
interface
Normalized crop window: both corners in [0, 1] of the source image.
interface
Pixel dimensions of an image.
interface
`ImageShapeUtil`'s settings; see {@link ShapeUtil.configure}.
interface
interface
What an image shape paints with.
interface
interface
interface
interface
interface
`LineShapeUtil`'s settings; see {@link ShapeUtil.configure}.
interface
interface
What a line paints with.
interface
interface
interface
Do not stroke the path at all; a fill (when the run asked for one) still paints.
interface
`NoteShapeUtil`'s settings; see {@link ShapeUtil.configure}.
interface
interface
What a note paints with, once its style props have been resolved.
interface
What {@link onDragFromToolbarToCreateShape} needs from the toolbar button.
interface
interface
A page-space rectangle.
interface
The page picker.
interface
interface
An SVG-style elliptical arc to `(x, y)`.
interface
Per-command settings shared by every command that draws a line.
interface
Settings for a command that *starts* a run — `moveTo`, and the two static builders.
interface
Which part of a path {@link PathBuilder.toD} should write.
interface
Closes the run in progress, joining its end back to its `moveTo`.
interface
A cubic bézier to `(x, y)` through two control points.
interface
A straight segment to `(x, y)`.
interface
A `moveTo`: lifts the pen and starts a new run.
interface
The half-open command range of one run, and whether that run is filled.
interface
interface
Shape labels, in the three forms a shape needs them.
interface
interface
A rich-text document — the value stored in a shape's `richText` prop.
interface
interface
A block of the document flattened to styled runs.
interface
A mounted rich-text editor.
interface
What mocanvas hands a rich-text editor when the user starts editing a label.
interface
The minimum an entry of the extension list has to be.
interface
The font a rich-text node is drawn in, carried down the document tree.
interface
interface
interface
A formatting mark on a text node: `{ type: "bold" }`, `{ type: "link", attrs: { href } }`.
interface
A formatting mark mocanvas knows how to render, measure and export.
interface
One node of a rich-text document.
interface
A node type mocanvas knows how to render, measure and export.
interface
A run of text sharing one style — the unit the canvas raster and SVG export draw.
interface
The typographic effect of the marks on one run of text.
interface
interface
The paint a scribble falls back to when its record does not name a colour.
interface
How scribbles are drawn.
The paint the selection box and its handles are drawn with.
Selection chrome geometry, in CSS pixels.
interface
The paint a shape handle is drawn with.
interface
Handle geometry, all in CSS pixels so handles are one size at every zoom.
interface
A shape util's options, including how it resolves its style props into the concrete values it paints with.
interface
One row: a label and the key that reaches it.
The paint a snap guide is drawn with.
interface
How snap guides are drawn.
interface
Draw the path as one continuous stroke.
interface
interface
Everything the stroke pipeline can be tuned by.
interface
One resampled point of a stroke: where it is, how wide, and how far along.
interface
How a stroke's start or end is shaped.
interface
interface
What every picker needs: the styles in play, and how to change one.
interface
interface
interface
interface
interface
The style rows the panel renders, in order, grouped as the panel groups them.
interface
interface
One choice in a picker: the value, and how to draw it.
interface
Export-wide settings a renderer may consult.
interface
interface
interface
interface
interface
Affine transform components as returned by `Editor.getShapePageTransform`.
interface
interface
interface
interface
interface
interface
interface
`TextShapeUtil`'s settings; see {@link ShapeUtil.configure}.
interface
interface
interface
What a text shape paints with.
interface
interface
One rendered line of a rich-text raster: the styled runs it is made of, and their total width.
interface
interface
What a ramp can be read off: the editor, or anything else theme-shaped.
interface
The `StarterKit` options an app may override.
interface
A bowed arrow, resolved.
interface
A circular arc, in the form an SVG `A` command and a length query both need.
interface
The anchor dot at an arrow terminal that is *already* bound.
interface
The hint drawn on a shape an arrow terminal is about to bind to.
interface
One end of an arrow: where the handle sits, where the line stops, and what is drawn there.
interface
The selection brush dragged by the select tool.
interface
Another person's selection brush.
interface
Another person's pointer.
interface
The marker that says a collaborator is off screen, and which way to look.
interface
What every collaborator overlay carries: who it belongs to, and their colour.
interface
One of another person's live scribbles.
interface
An outline around a shape another person has selected.
interface
{@link TLExternalContentProps} plus the two UI contexts a handler needs to talk to the user.
interface
The four faces of one family: upright and italic, each normal and bold.
interface
The built-in families, keyed by the `font-family` a shape's `font` prop resolves to.
interface
A snapshot, rendered as a static picture.
interface
Which way a container of controls runs.
interface
interface
The whole chrome, laid out.
interface
interface
interface
The elbow member of the arrow-info union — what `getArrowInfo` returns for an arrow whose `kind` is `"elbow"`, alongside the arc and straight members.
interface
The file limits an app configures on the component.
interface
One binding this hook installs.
interface
A language mocanvas knows how to name and lay out.
interface
One live scribble — a laser trail, an eraser stroke.
interface
The selection box and one of its resize/rotate handles.
interface
One of a shape's own handles — an arrow terminal, a line vertex.
interface
One snap guide: the aligned edge or centre, plus the points it aligned.
interface
A straight arrow, resolved.
interface
A font file to load, as {@link preloadFont} takes it.
interface
One thing to say.
interface
What {@link useA11y} hands back.
interface
interface
interface
interface
interface
interface
What both clipboard hooks hand back.
interface
The UI half of the chrome override map.
interface
interface
interface
One provider that mounts every UI context in the right order.
interface
interface
interface
One entry on the dialog stack.
interface
interface
interface
interface
What a dialog component is rendered with.
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
The common half of every reported event: where the user did it.
interface
The events the default chrome reports, and what each one carries beyond the common `{ source }`.
interface
interface
interface
interface
The icon element the UI primitives use.
interface
interface
The text field the chrome uses: a page name, a link, a numeric style value.
interface
A keyboard shortcut, rendered.
interface
interface
How a layer learns about the layers opened from inside it.
interface
The three layout boxes the chrome is assembled from.
interface
The props each panel slot is rendered with.
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
interface
The chrome's slider — opacity, and anything else an app puts in the style panel.
interface
interface
One message.
interface
A button on a toast.
interface
interface
interface
interface
The toolbar primitive, and the buttons that go in it.
interface
interface
interface
interface
One locale's dictionary: string id to display text.
interface
interface
interface
interface
The brush dragged by the zoom tool.
interface
interface
The default toolbar's contents, as data.
interface
The toolbar's buttons, one exported component per tool.
interface
Affine transform components as returned by `Editor.getShapePageTransform`.
interface
Everything {@link updateArrowTargetState} needs to work out the answer.
interface
interface
`VideoShapeUtil`'s settings; see {@link ShapeUtil.configure}.
interface
interface
What a video shape paints with: the placeholder frame and the play glyph drawn over it.
interface
The subset of a ProseMirror node this visitor reads.
type
How urgently an announcement interrupts.
type
How loud a message is.
type
type
type
How an arrow's terminal is drawn.
type
type
type
One aspect-ratio option's value.
type
What a bookmark card paints with.
Either the shape that was created, or why it was not.
type
A boolean debug flag.
The services recognised out of the box, by their stable ids.
Everything {@link registerDefaultExternalContentHandlers} accepts.
type
A name with its own artwork.
type
type
Which side of a box an elbow arrow attaches to.
type
Which coordinate a leg varies: `"x"` for a horizontal leg, `"y"` for a vertical one.
type
Per-service settings, keyed by {@link EmbedDefinition.type}.
type
Settings for one embeddable service, as the app supplies them: an api key, a player option, a locale.
type
One of {@link EMBED_SHAPE_PERMISSION_NAMES}.
type
type
type
type
How other shapes snap to this silhouette.
type
type
A group's props: none.
type
type
An alias for a drawn icon.
type
Any name the set answers to, drawn or aliased.
type
type
Resolves an image's pixel size from its source; injectable so tests can run without a DOM.
type
The parse result plus whatever the load could not read cleanly.
type
Either the records a file held, or why it could not be read.
One entry of a {@link PathBuilder}'s command list.
type
Every way a path can be rendered, as a discriminated union on `style`.
type
How a dashed run starts or ends.
type
{@link ArrowShapeProps} with the *derived* label filled in as well.
type
{@link GeoShapeProps} with the *derived* label filled in as well.
{@link NoteShapeProps} with the *derived* label filled in as well.
{@link TextShapeProps} with the *derived* label filled in as well.
Creates a rich-text editing surface — a TipTap editor, in practice.
type
Anything a label may be given: a rich-text document, a plain string, or nothing.
type
Renders one shape to SVG markup in shape-local coordinates.
type
Where a floating layer sits: over, under, or beside its anchor.
type
type
type
A resolved arrow, discriminated by how its body is routed.
type
The formats "copy as" can write.
type
The documented name for the props `<Mocanvas />` takes.
type
A parsed `.tldr` file: the schema it was written under, and its records.
Why a file could not be read.
type
What resolving a url against the permit list produced, or `undefined` when the url is not one that gets embedded.
Which features an embedded page is granted: present and `true` grants, absent or `false` withholds.
The `@tldraw/tlschema` spelling of {@link GroupShapeProps}.
type
The `@tldraw/tlschema` spelling of {@link HighlightShape}.
The `@tldraw/tlschema` spelling of {@link HighlightShapeProps}.
The sections the shortcuts dialog groups its rows under.
type
The `@tldraw/tlschema` spelling of {@link LinePoint}.
type
What `onMount` is: called once with the editor as soon as it exists, and on nothing else.
One resolved indicator: the paths to stroke, the page transform to stroke them under, and the paint to use.
A partial override of the self-hosted asset urls, as an app supplies one.
type
One of the {@link PORTRAIT_BREAKPOINT} values.
type
How a button reads: its size, its emphasis, and whether it is a menu row.
The UI chrome map after defaults and overrides: every slot present.
What {@link useDefaultHelpers} hands back.
The value {@link useUiEvents} returns — the handler an app passed as `onUiEvent`, or a no-op.
type
What a host supplies as `onUiEvent`.
type
A ready-made element used in place of a named icon.
type
A built-in icon name, or any string.
Where a menu item is being rendered.
Read for its side effect on the type checker only; keeps `useEditor` imported.
Read for its side effect on the type checker only.
type
Read for its side effect on the type checker only.
The value {@link useCurrentTranslation} returns: the active locale's strings.
A UI string id.
type
constant
Every built-in face as a flat list.
constant
Routing kinds an arrow can have.
constant
constant
How far a bound arrow stops short of the shape it points at, as a multiple of its stroke width.
constant
The arrow binding's props migrations.
constant
`ArrowBindingUtil`'s props.
constant
Arrow pointing down.
constant
Arrow pointing left.
constant
Arrow pointing right.
constant
The arrow shape's props migrations.
constant
`ArrowShapeUtil`'s props.
constant
Named versions of the arrow shape's props; see {@link arrowShapeMigrations}.
constant
The arrow tool.
constant
Arrow pointing up.
constant
The aspect ratios the image bar offers.
constant
The width-over-height each named ratio means.
constant
The image / media placer.
constant
Average glyph advance as a fraction of the font size.
constant
constant
The banner strip behind the asset's preview image (and its colour when there is none).
constant
constant
constant
constant
constant
constant
constant
constant
Body left under the banner even on a short card, so the text never disappears.
constant
constant
constant
constant
constant
constant
constant
constant
constant
constant
The toast id used when a link could not be unfurled.
constant
constant
The bookmark shape's props migrations; see the module comment.
constant
`BookmarkShapeUtil`'s props.
constant
Check box.
constant
Cloud.
constant
Light, dark, or follow the system.
constant
The commenting tool.
constant
Turn an embed into a bookmark.
constant
Turn a bookmark into an embed.
constant
What every flag resolves to before anything has been changed.
constant
The flags mocanvas itself reads.
constant
Compact frame-statistics chip.
constant
Whether the frame-statistics chip is visible.
A small hint-coloured dot with a paper-coloured ring.
The theme's `hint` colour, not `selectStroke`.
constant
The default brush geometry and paint, shared by both brushes.
The dials every collaborator overlay has.
constant
The defaults, in page units.
constant
The services recognised out of the box.
constant
The box a click places a built-in silhouette at.
constant
The built-in table: one entry per {@link GeoShapeKind}.
constant
The largest file the drop and paste paths will turn into an asset, in bytes.
constant
constant
The default scribble paint: taper on, colours from the theme.
The v5 defaults: a 9px square handle, a 5.5px rotate dot, 1.5px strokes.
Solid handles at 6px, virtual ones at 4px and half-transparent.
Thin lines and small crosses, in the theme's hint colour.
constant
Image types every browser that runs the canvas can decode.
constant
Video types every browser that runs the canvas can play.
constant
The default set of toolbar buttons, in order.
constant
The built-in asset utils, in registration order.
constant
The built-in binding utils, in the order they are registered.
constant
The chrome mocanvas renders when an app overrides nothing.
constant
The frame-statistics chip.
constant
The editor's default asset urls: none.
constant
The banner shown while the camera is following someone.
constant
The built-in families, as {@link TLDefaultFonts}.
constant
The built-in geo forms, keyed by their `geo` prop value.
constant
The bar over a selected image.
constant
A scaled-down view of the page, with the viewport drawn on it.
constant
Pass to `Editor`/`<Mocanvas>` as `overlayUtils`, or spread it to add one:
constant
The page menu.
constant
The people menu.
constant
The collaborator list, plus the local person's own name and colour.
constant
The rich-text bar.
constant
Fallback renderer applied to shape types without a registry entry.
constant
The tools that *place a shape*: one entry per built-in shape type that has a tool of its own.
constant
constant
The top-right panel: who is here.
constant
The docked style panel.
constant
Every built-in tool: the canvas tools plus {@link defaultShapeTools}.
constant
The local person's name and cursor colour.
constant
The bar over a selected video.
constant
Diamond.
constant
The draw shape's props migrations; see the module comment.
constant
`DrawShapeUtil`'s props.
constant
The freehand draw tool.
constant
Edit the selected shape's link.
constant
Alias of {@link EditMenuSubmenu}, under its other documented name.
constant
The four sides, in clockwise order from the top.
constant
Corner radius as a multiple of the stroke width.
constant
Ellipse.
constant
constant
constant
constant
constant
constant
constant
constant
The sandbox an embedded page runs in.
constant
The powerful features an embedded page may be granted, as the iframe `allow` attribute names them.
constant
constant
The permit list `getEmbedDefinition` consults.
constant
The embed shape's props migrations; see the module comment.
constant
The permissions an embedded page is granted by default, as iframe permissions-policy features.
constant
`EmbedShapeUtil`'s props.
constant
The eraser.
constant
The ramp a caller that has no editor resolves against: the built-in theme's light half.
constant
Longer-lived switches for work in progress.
constant
Shrink a frame to fit what is inside it.
constant
A frame's body.
constant
The frame's name, drawn in the strip above it.
constant
constant
Gap between the bottom of that strip and the frame's top edge.
constant
Box the frame name is laid out in: the strip above the frame, minus the gap.
constant
Height of the strip above the frame that the name is laid out in.
constant
A frame's border.
constant
Width of that border, in page units.
constant
The frame shape's props migrations; see the module comment.
constant
`FrameShapeUtil`'s props.
constant
The frame tool.
constant
Longest side of the box a geo outline is fitted into, centred in the grid.
constant
The box a click (rather than a drag) places a geo shape at.
constant
`d` attribute for each geo kind, fitted to its icon box.
constant
constant
The geo shape's props migrations.
constant
`GeoShapeUtil`'s props; see the module comment.
constant
Named versions of the geo shape's props, for {@link geoShapeMigrations}.
constant
A geo-kind button: selects the geo tool *and* the kind.
constant
Group, or ungroup — whichever applies.
constant
The group shape's props migrations.
constant
`GroupShapeUtil`'s props: a group is a container and carries none.
constant
The hand (pan) tool.
constant
Heart.
constant
Fraction of the box height spanned by the hexagon's two vertical sides.
constant
Hexagon.
constant
How see-through a highlight is.
constant
How wide a highlight is drawn, per `size`, at `scale: 1`.
constant
The highlight shape's props migrations; see the module comment.
constant
`HighlightShapeUtil`'s props: a draw stroke with no fill and no dash.
constant
The highlighter.
constant
Second spellings for icons that already exist.
constant
Side of the drawing grid.
constant
All icon names, aliases included, sorted — handy for tests and galleries.
constant
Every icon that has artwork of its own, keyed by name.
constant
Every icon name mocanvas ships, sorted.
constant
constant
constant
The image shape's props migrations; see the module comment.
constant
`ImageShapeUtil`'s props.
constant
Which pointer devices draw.
constant
Every shortcut the editor binds, as data.
constant
Makes Shift+Enter insert a line break instead of splitting the block.
constant
Pick the UI locale — when there is more than one to pick from.
constant
The languages offered in the language menu.
constant
The laser pointer.
constant
Cheap text metrics used until real measurement lands (phase 2 text layout).
constant
The line shape's props migrations; see the module comment.
constant
`LineShapeUtil`'s props.
constant
The line tool.
constant
Default size loader: `createImageBitmap` when available, else an `Image` element.
constant
Hard cap on either canvas dimension, so a huge label cannot blow up the GPU.
constant
The style panel as a popover, for narrow layouts.
constant
The MIME-ish tag mocanvas content is written under.
constant
Accelerator prefix for tooltips: `⌘` on Apple platforms, `Ctrl+` elsewhere.
constant
Geo kinds that live behind the "more shapes" popover.
constant
Move the selection to another page.
constant
A note body is not flat.
constant
constant
constant
The soft shadow that falls below a note.
constant
A note's shadow falls almost entirely *below* it.
constant
constant
constant
constant
The note shape's props migrations.
constant
`NoteShapeUtil`'s props.
constant
Named versions of the note shape's props; see {@link noteShapeMigrations}.
constant
The sticky-note tool.
constant
Oval.
constant
The breakpoints, smallest first.
constant
Geo kinds with a toolbar button of their own.
constant
Print the drawing — the selection if there is one, otherwise the page.
constant
Rectangle.
constant
Delete a frame but keep its children.
constant
Rhombus.
constant
The CSS a rich-text label lays out under, in both the measuring probe and the DOM overlay.
constant
The formatting marks a mocanvas label understands out of the box.
constant
The block and inline node types a mocanvas label understands out of the box.
constant
A rich-text document, as a shape's `richText` prop holds it.
constant
Base languages written right to left.
constant
The select tool.
constant
Registry of per-type renderers.
constant
Inner radius of the five-pointed star, as a fraction of the outer radius.
constant
Star.
constant
Style controls for the selection (or, with nothing selected, for the next shape the active drawing tool creates).
constant
Publishes the style panel's context.
constant
Shape opacity.
constant
constant
constant
constant
Minimum width of an auto-sized text shape so an empty one still shows a caret area.
constant
The text shape's props migrations; see the module comment.
constant
`TextShapeUtil`'s props.
constant
The text tool.
constant
The default extension set the canvas text editor uses.
constant
The extension a saved document is written under, including the dot.
constant
One toolbar button, driven by the tool list.
constant
Let a text shape size itself to its content again.
constant
Announce more than the minimum to a screen reader.
constant
Invert the scroll direction of zooming.
constant
The padlock at the end of the toolbar: keep the current tool after drawing.
constant
The default tool bar: the grouped tools, plus a popover holding the geo kinds that have no button of their own.
constant
Toolbar entries, grouped; groups are separated by a divider.
constant
Trapezoid.
constant
Triangle.
The permissions applied to an embed whose url matched no definition.
constant
Alias of {@link useTranslation}, spelled as the value it returns.
constant
constant
constant
constant
The play triangle drawn on the placeholder (and in an SVG export).
constant
constant
Seeking to within this many seconds of the stored time is treated as already there.
constant
constant
The video shape's props migrations; see the module comment.
constant
`VideoShapeUtil`'s props.
constant
X box.
constant
Zoom controls and undo/redo.
mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.