Skip to content

Extras

BlockEditor

Bit.BlazorUI.ExtrasDocumentEditorBlocksEditor

BitBlockEditor edits a document made of blocks, the way Notion-style editors do: each paragraph, heading, list item, quote or code block is edited in place, Enter splits a block and Backspace at its start joins it to the one before, and Markdown shortcuts (# , - , 1. , [] , > , ```, ---) turn a block into another type as you type, and a slash opens a menu of every block type, images included. Whole blocks are selected, moved, nested and turned into other types from the keyboard or a block menu, and dragged by their grips. The value is a BitBlockDocument, a typed model your app can read, build and store, which converts to and from JSON, Markdown and HTML without the component. The undo history is the editor's own, and an app adds block types of its own with Blazor views.

Notes

To use this component, you need to install the Bit.BlazorUI.Extras(opens in a new tab) nuget package, as described in the Optional steps of the Getting started page.

The text of a block holds the formatting Markdown can express: bold, italic, strikethrough, inline code, links, subscript, superscript, highlight and underline. It is sanitized on every way in, so a document built in code or read from HTML never renders more than that.

Usage

Every example is live. Open its code to see exactly what produced the component running underneath.

Basic

Bind Value to a BitBlockDocument; without one the editor starts with an empty paragraph and shows its Placeholder. Type, press Enter for a new block, and Backspace at the start of a block to join it to the one before.

Blocks: 0

Markdown shortcuts

Typed at the start of a paragraph, a Markdown marker turns it into another block, and Ctrl+Z gives back what you typed: # to ###### and a space for a heading, -, * or + and a space for a bulleted item, 1. and a space for a numbered one, [] or [x] and a space for a task, > and a space for a quote, ``` (and a language) with a space or Enter for code, and --- for a divider. Enter on an empty item ends the list; Enter on an empty last line of code, or Ctrl+Enter, leaves the code block. A Label names the editor.

Shortcuts

Document

A BitBlockDocument is built in code or read with FromMarkdown, FromHtml or FromJson, and written with ToMarkdown, ToHtml or ToJson - JSON being the form to store, since it keeps everything. The bound value follows every edit.

Release notes
The editor reads Markdown, HTML and JSON.
Blocks
nested
Shortcuts
Slash menu
One block at a time.
var doc = BitBlockDocument.FromMarkdown(text);
## Release notes

The editor reads **Markdown**, ~~HTML~~ and JSON.

- Blocks
  - nested
- [x] Shortcuts
- [ ] Slash menu

> One block at a time.

```csharp
var doc = BitBlockDocument.FromMarkdown(text);
```

Commands

The editor's history is its own: UndoAsync, RedoAsync, CanUndo and CanRedo, as well as Ctrl+Z and Ctrl+Y. ExecuteCommandAsync runs a BitBlockEditorCommand on the block that holds the caret: TurnInto with the type to turn it into (heading:2, listItem:task, code:csharp, ...) and InsertBlock with the type of a new block after it.

Put the caret in a block, then press a button.

Inline formatting

Select text to show the inline toolbar: bold, italic, underline, strikethrough, inline code, highlight, subscript, superscript, a link and clearing the formatting. Alt+F10 moves to it, the arrow keys along it, and Escape back to the text. The shortcuts are Ctrl+B, Ctrl+I, Ctrl+U, Ctrl+Shift+X, Ctrl+E, Ctrl+K for a link, Ctrl+Shift+K to unlink and Ctrl+\ to clear; pressed at a caret, a mark is set for what you type next. Markdown works inline too: **bold**, _italic_, ~~strike~~ and `code` become marks as you type the closing delimiter. ExecuteCommandAsync runs the same commands, and CreateLink takes the address (one typed without its scheme is taken as https).

Select some of this text to format it, or type bold with its asterisks.
A link, some code, a highlight, underline, H2O and x2.
Select some of this text to **format** it, or type **bold** with its asterisks.

A [link](https://bitplatform.dev), some `code`, ==a highlight==, ++underline++, H~2~O and x^2^.

Blocks

A block is selected, moved and nested as a whole. Escape selects the block of the caret and Escape again clears the selection; Shift and the arrow keys extend it, Ctrl+A selects the text of the block and then every block, and a drag from one block into another selects the blocks between. Selected blocks are a tree to a screen reader: Home and End go to the first and last block, and Right and Left into a block's first child and out to its parent. On selected blocks, Delete removes them, Ctrl+C and Ctrl+X copy them as Markdown and HTML, Ctrl+V pastes blocks after them and Enter goes back to editing. The grip beside a block, or Ctrl+/, opens the block menu: turn into another type, duplicate, move up or down, delete. Tab nests a list item under the one before it and Shift+Tab brings it out, and Alt+Shift with Up or Down moves the block (or the selection) with what it holds, announcing where it went. The pointer, a finger or a pen drags a block by its grip, into a list or out of one, and drops it where it shows: one step Ctrl+Z takes back. Escape, or a release outside the document, puts it back. ExecuteCommandAsync runs MoveUp, MoveDown, Indent, Outdent, Duplicate and Delete on the selected blocks, or on the block of the caret.

Plan
Press Escape to select a block, or use the grip beside it: click it for the menu, drag it to move the block.
Design
Sketches
Review
Build
Ship
Tab nests an item; Alt+Shift+Up and Down move a block.
## Plan

Press Escape to select a block, or use the grip beside it: click it for the menu, drag it to move the block.

- Design
  - Sketches
  - Review
- Build
- Ship

> Tab nests an item; Alt+Shift+Up and Down move a block.

Slash menu and images

A slash typed at the start of a block, or after a space, opens a menu of every block type: type to filter it, pick with the arrow keys and Enter (or a click), and Escape leaves the slash as text. A text type turns the block into it; an image or a divider goes after the block, or in its place when the block held nothing else. An image asks for its address, or a file to upload, in a panel that also takes its alternative text, its caption and its width; the block menu's Edit image, Enter on a selected image or a click on an empty one opens it again. An image file pasted or dropped on the editor goes in as an image block. OnImageUpload stores each file (the RichTextEditor's BitRichTextEditorImageUpload) and returns the address to show it from - without one, the image goes into the document as a data URL - and MaxImageSize caps how large a file may be.

Trip notes
Type / at the start of a line, or after a space, to pick a block type.
A city street at dusk
Select the image and press Enter to edit it
Paste or drop an image file here too.
## Trip notes

Type / at the start of a line, or after a space, to pick a block type.

![A city street at dusk](_content/Bit.BlazorUI.Demo.Client.Core/images/carousel/img1.jpg "Select the image and press Enter to edit it")

Paste or drop an image file here too.

Custom blocks

BlockTypes adds types of your own. An Atom type is a Blazor view (View), handed the block and a BitBlockContext whose UpdateAsync changes it as one step of the history. Its props are strings, so the document still stores as JSON; ToHtml and ToMarkdown decide how it exports, and SlashLabel, SlashKeywords and Icon put it in the slash menu (type / to see it). A block of a type the editor does not know is kept and shown as such.

Sprint board
Status:
Click the status to move it on.
Unsupported block: poll

ReadOnly & Disabled

A ReadOnly editor shows the document without letting it be changed, and a Disabled one is unavailable altogether.

Read me
This document cannot be changed here.
Checked
Not checked
Read me
This document cannot be changed here.
Checked
Not checked

Style & Class

Style and Class reach the root, and Styles and Classes its parts. The public --bit-BlockEditor-* variables restyle it from :root, an ancestor or Style.

Styled
A quote with its own bar.
Styled
A quote with its own bar.

RTL

Use BitBlockEditor in right-to-left (RTL).

سلام
یک
دو

CSS variables

The public custom properties this component reads off its root, for what no parameter covers.

Every variable is read with a fallback and never declared by the component, so it inherits like any other custom property: set one on :root (or in a [bit-theme] block) to restyle every instance, on any ancestor to restyle the ones inside it, or on the Style of one instance to restyle it - and any instance nested inside it, which inherits the value too; a parameter changes one alone, as does the real CSS property on the instance's Style / Styles when that property does not inherit (opacity: 1 keeps one disabled instance undimmed without undimming a disabled one inside it), while an inherited one such as color or font-family also reaches the nested instances that do not set it themselves. Leave a variable unset and the component falls back to the theme token beside it.

BitBlockEditor CSS variables

Name Default value Description
--bit-BlockEditor-color --bit-clr-fg-pri Text color of the document.
--bit-BlockEditor-background --bit-clr-bg-pri Background of the document.
--bit-BlockEditor-border-color --bit-clr-brd-pri Color of the outer border.
--bit-BlockEditor-border-width --bit-shp-brd-width Width of the outer border.
--bit-BlockEditor-border-radius --bit-shp-radius-surface Corner radius of the document.
--bit-BlockEditor-padding spacing(1.5) spacing(2) Space around the blocks.
--bit-BlockEditor-block-gap spacing(0.5) Space between two blocks.
--bit-BlockEditor-focus-color --bit-clr-pri-focus The ring around the document while a block has focus. While it is unset, the ring is the library's own --bit-shd-focus-ring.
--bit-BlockEditor-placeholder-color --bit-clr-fg-sec Placeholder of an empty block.
--bit-BlockEditor-muted-color --bit-clr-fg-sec List markers, a ticked task, a caption and a block the editor cannot show.
--bit-BlockEditor-quote-border-color --bit-clr-brd-pri The bar beside a quote.
--bit-BlockEditor-code-background --bit-clr-bg-sec Background of a code block and of inline code.
--bit-BlockEditor-code-font-family --bit-tpg-font-family-mono Font of a code block and of inline code.
--bit-BlockEditor-divider-color --bit-clr-brd-sec The line of a divider.
--bit-BlockEditor-label-color --bit-BlockEditor-color Text of the label.
--bit-BlockEditor-highlight-background --bit-clr-wrn-light Background of highlighted text.
--bit-BlockEditor-selection-background --bit-clr-pri-light Background of a selected block.
--bit-BlockEditor-drag-outline-color --bit-clr-pri Dashed outline of the block the pointer drags, in the place it would land, on the background of a selected block (--bit-BlockEditor-selection-background).
--bit-BlockEditor-preview-opacity 0.92 Opacity of the picture of that block that follows the pointer. It is placed above the page, so only a value set on :root reaches it.
--bit-BlockEditor-preview-shadow --bit-shd-popup Shadow of the picture that follows the pointer. Only a value set on :root reaches it.

API

Every parameter, public member, sub-class and enum this component exposes.

BitBlockEditor parameters

Name Type Default value Description
BlockTypes IEnumerable<BitBlockType>? null The app's own block types, added to the built-in ones (BitBlockTypes): paragraph, heading, listItem, quote, code, image and divider. A type named as a built-in replaces it.
Classes BitBlockEditorClassStyles? null Custom CSS classes for different parts of the editor.
Label string? null The label shown above the editor, which names it for screen readers. Without one, the editor is named by the Document string.
MaxImageSize long 10485760 The largest image file, in bytes, the editor takes from an upload, a paste or a drop (10 MB by default). Zero or a negative value restores the default.
OnImageUpload Func<BitRichTextEditorImageUpload, Task<string?>>? null Stores an image file the user uploads, pastes or drops (its name, content type and bytes), and returns the address the image block shows it from. Without one, the image goes into the document itself as a data URL. A null or empty address, or an exception, fails the image, which the editor says.
Placeholder string? null The text shown in an empty document's first block, until something is typed into it.
Strings BitBlockEditorStrings? null The words of the editor that screen readers read out, in English by default: the name of each block's text, the document's name and the announcements.
Styles BitBlockEditorClassStyles? null Custom CSS styles for different parts of the editor.

BitBlockEditor public members

Name Type Default value Description
CanRedo bool false Whether there is a change taken back to put back.
CanUndo bool false Whether there is a change to take back.
Document BitBlockDocument The document the editor shows: the bound value as the editor holds it, every formatted text in its canonical form, with a paragraph to type in after a last block that holds no text.
ExecuteCommandAsync Func<BitBlockEditorCommand, string?, Task> Runs a command on the block that holds the caret, or the last one that held it: an inline command (Bold, Italic, Highlight, ...) on the text selected in it, CreateLink with the address, TurnInto and InsertBlock with the type (heading:2, listItem:task, code:csharp, divider, ...), MoveUp, MoveDown, Indent, Outdent, Duplicate, Delete, Undo and Redo with nothing. While blocks are selected, the block commands act on them.
RedoAsync Func<Task> Puts back the last change taken back.
UndoAsync Func<Task> Takes back the last change: a run of typing, or one command, shortcut or paste.

BitComponentBase parameters

Name Type Default value Description
AriaLabel string? null Gets or sets the accessible label for the component, used by assistive technologies.
Class string? null Gets or sets the CSS class name(s) to apply to the rendered element.
Dir BitDir? null Gets or sets the text directionality for the component's content.
Disabled bool false Gets or sets a value indicating whether the component is disabled and cannot respond to user interaction.
ForceAnimation bool false Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested.
HtmlAttributes Dictionary<string, object> new Dictionary<string, object>() Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters. An attribute written on the component wins over an entry of the same name.
Id string? null Gets or sets the unique identifier for the component's root element.
Style string? null Gets or sets the CSS style string to apply to the rendered element.
TabIndex string? null Gets or sets the tab order index for the component when navigating with the keyboard.
Visibility BitVisibility BitVisibility.Visible Gets or sets the visibility state (visible, hidden, or collapsed) of the component.

BitComponentBase public members

Name Type Default value Description
UniqueId Guid Guid.NewGuid() Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed.
RootElement ElementReference Gets the reference to the root HTML element associated with this component.

BitBlockEditorClassStyles properties

Name Type Default value Description
Root string? null Custom CSS classes/styles for the root element of the BitBlockEditor.
Label string? null Custom CSS classes/styles for the label of the BitBlockEditor.
Document string? null Custom CSS classes/styles for the element holding the blocks of the BitBlockEditor.
Block string? null Custom CSS classes/styles for each block: the shell holding its marker, its text or view, and its children.
Text string? null Custom CSS classes/styles for the editable text of each text and code block.
Marker string? null Custom CSS classes/styles for the marker before a list item: its bullet, its number or its task checkbox.
Children string? null Custom CSS classes/styles for the element holding the children of a nesting block.
Toolbar string? null Custom CSS classes/styles for the toolbar shown over selected text.
ToolbarButton string? null Custom CSS classes/styles for each button of the toolbar.
LinkPanel string? null Custom CSS classes/styles for the panel that asks for a link's address.
SelectedBlock string? null Custom CSS classes/styles for each selected block, added to its Block ones.
DraggedBlock string? null Custom CSS classes/styles for the block the pointer drags, added to its Block ones while it is dragged.
Handle string? null Custom CSS classes/styles for the button beside each block that selects it and opens the block menu.
Menu string? null Custom CSS classes/styles for the block menu.
MenuItem string? null Custom CSS classes/styles for each item of the block menu.
SlashMenu string? null Custom CSS classes/styles for the slash menu: the filter box and the list of block types a slash typed in a text opens.
ImagePanel string? null Custom CSS classes/styles for the panel that edits an image: its address, its upload, its alternative text, its caption and its width.

BitBlockEditorStrings properties

Name Type Default value Description
Document string "Document" The name of the editor when it has no Label.
BlockPosition string "{0}, block {1} of {2}" The name of each block's text: its type ({0}), its position ({1}) and how many blocks there are ({2}).
NestedBlockPosition string "{0}, level {1}, block {2} of {3}" The name of the text of a block nested in another: its type ({0}), how deep it is ({1}), its position ({2}) and how many blocks there are ({3}).
Paragraph string "Paragraph" A paragraph.
Heading string "Heading {0}" A heading, with its level ({0}); also the placeholder of an empty heading.
BulletItem string "Bulleted list item" An item of a bulleted list.
NumberedItem string "Numbered list item" An item of a numbered list.
TaskItem string "Task" An item of a task list.
TaskDone string "Done" The checkbox of a task.
Quote string "Quote" A quote.
Code string "Code" A block of code.
CodeLanguage string "Code, {0}" A block of code with its language ({0}).
Image string "Image" An image.
Divider string "Divider" A divider.
UnknownBlock string "Unsupported block: {0}" A block whose type the editor does not know ({0}), kept and shown read-only.
TurnedInto string "Turned into {0}" What is announced when a block turns into another type ({0}).
TextFormatting string "Text formatting" The name of the toolbar shown over selected text.
Bold string "Bold" The toolbar button that makes text bold.
Italic string "Italic" The toolbar button that makes text italic.
Underline string "Underline" The toolbar button that underlines text.
StrikeThrough string "Strikethrough" The toolbar button that strikes text through.
InlineCode string "Inline code" The toolbar button that makes text inline code.
Highlight string "Highlight" The toolbar button that highlights text.
Subscript string "Subscript" The toolbar button that lowers text.
Superscript string "Superscript" The toolbar button that raises text.
Link string "Link" The toolbar button that links text, and the name of the panel it opens.
ClearFormatting string "Clear formatting" The toolbar button that takes every mark off text.
LinkAddress string "Link address" The field of the link panel that takes the address.
LinkInvalid string "Enter a web, email or phone address." What the link panel says of an address the editor would not keep.
ApplyLink string "Apply" The link panel's button that links the text.
RemoveLink string "Remove link" The link panel's button that takes the link off.
Cancel string "Cancel" The link panel's button that closes it without a change.
BlockHandle string "Actions for {0}" The button beside each block that selects it and opens the block menu, with the name of the block's text ({0}).
BlockMenu string "Block actions" The name of the block menu.
HandleTip string "Drag to move, click for actions" The tooltip of the button beside each block, which the pointer drags the block by and clicks for its menu.
TurnIntoGroup string "Turn into" The group of the block menu that turns the selected blocks into another type.
BulletList string "Bulleted list" The block menu's item that turns blocks into items of a bulleted list.
NumberedList string "Numbered list" The block menu's item that turns blocks into items of a numbered list.
TaskList string "Task list" The block menu's item that turns blocks into tasks.
Duplicate string "Duplicate" The block menu's item that copies the selected blocks to right after them.
MoveUp string "Move up" The block menu's item that moves the selected blocks up.
MoveDown string "Move down" The block menu's item that moves the selected blocks down.
Delete string "Delete" The block menu's item that deletes the selected blocks.
BlockCount string "{0} blocks" How several blocks are named in what is announced, with their number ({0}); one block is named by its type.
Selected string "{0} selected" What is announced when blocks are selected ({0}).
SelectionCleared string "Selection cleared" What is announced when the selection of blocks is cleared.
Moved string "Moved {0} to position {1} of {2}" What is announced when blocks move ({0}), where the first of them is now ({1}) and how many blocks there are ({2}).
Indented string "Indented {0}" What is announced when blocks are nested under the block before them ({0}).
Outdented string "Outdented {0}" What is announced when blocks come out of their parent ({0}).
Duplicated string "Duplicated {0}" What is announced when blocks are copied ({0}).
Deleted string "Deleted {0}" What is announced when blocks are deleted ({0}).
PickedUp string "Picked up {0}" What is announced when the pointer picks a block up by its handle ({0}).
PutBack string "{0} put back" What is announced when a block dragged by the pointer goes back where it was: Escape, or a release outside the document ({0}).
SlashMenu string "Block types" The name of the slash menu's filter box and of its list of block types.
SlashPlaceholder string "Filter block types…" What the slash menu's filter box shows while it is empty.
SlashNoResults string "No matching block type" What the slash menu says when no block type matches its filter.
Inserted string "Inserted {0}" What is announced when the slash menu inserts a block, with its type ({0}).
AddImage string "Add an image" The button an image with no address shows, which opens the image panel.
EditImage string "Edit image" The block menu's item that opens the image panel on a selected image.
ImageAddress string "Image address" The field of the image panel that takes the image's address.
ImageAlt string "Alternative text" The field of the image panel that takes the image's alternative text.
ImageCaption string "Caption" The field of the image panel that takes the caption shown under the image.
ImageWidth string "Width in pixels" The field of the image panel that takes the image's width.
UploadImage string "Upload an image" The image panel's button that picks an image file to upload.
ApplyImage string "Apply" The image panel's button that applies what it holds to the image.
ImageInvalid string "Enter the web address of an image, or upload one." What the image panel says of an address the editor would not show.
ImageTooLarge string "\"{0}\" is larger than {1}." What is said of an image file larger than MaxImageSize, with its name ({0}) and the limit ({1}).
ImageUnsupported string "\"{0}\" is not a PNG, JPEG, GIF, WebP or SVG image." What is said of a file that is not an image the editor takes ({0}).
ImageUploadFailed string "Uploading \"{0}\" failed." What is said when OnImageUpload failed or gave no address ({0}).
ImageUploading string "Uploading \"{0}\"…" What is announced as an image starts uploading ({0}).
ImageAdded string "Image added" What is announced when an image is added to the document.
ImageUpdated string "Image updated" What is announced when the image panel changes an image.

BitBlockDocument properties

An immutable document of blocks. Two documents are equal when their blocks are.

Name Type Default value Description
Blocks IReadOnlyList<BitBlock> The top-level blocks, in order.
Empty BitBlockDocument A document with no blocks (static).
ToJson / FromJson string The lossless JSON form, the one to store: { "v": 1, "blocks": [...] }.
ToMarkdown / FromMarkdown string Markdown with GitHub's task lists and the emphasis extensions. An image's width, an empty paragraph and a line break in a heading are what Markdown cannot say.
ToHtml / FromHtml string The markup a BitRichTextEditor stores, sanitized. Reading takes any HTML: what has no block becomes a paragraph of its text.

BitBlock properties

One block of a document, immutable: change it with with or WithProp.

Name Type Default value Description
Id string a new random id Unique in the document and kept through every edit of the block.
Type string The name of the block's type: paragraph, heading, listItem, quote, code, image, divider or an app's own.
Text string "" Inline HTML of b, i, s, code, a href, sub, sup, mark, ins and br for a text type; plain text for code; nothing for an atom.
Props IReadOnlyDictionary<string, string> empty The block's settings, as strings: a heading's level (1-6), a list item's style (bullet, ordered, task) and checked, code's language, an image's src, alt, width and caption.
Children IReadOnlyList<BitBlock> empty The blocks nested under it, for a type that nests (a list item).

BitBlockType properties

A type of block. The built-ins are in BitBlockTypes.

Name Type Default value Description
Name string The name a block's Type refers to it by.
Kind BitBlockKind What a block of the type holds as its text.
Nests bool false Whether a block of the type may hold children.
SlashLabel string? null The words the slash menu offers the type under.
SlashKeywords string? null More words the slash menu finds the type by.
Icon RenderFragment? null A small decorative glyph the slash menu shows before the type's SlashLabel, drawn in the menu's text color. The built-in types have their own.
ToHtml BitBlockExport? null Writes a block of the type as HTML, handed its children already written.
ToMarkdown BitBlockExport? null Writes a block of the type as Markdown, handed its children already written.
View RenderFragment<BitBlockContext>? null How the editor shows a block of an Atom type: a Blazor view handed the block and the way to change it.

BitBlockContext properties

Name Type Default value Description
Block BitBlock The block the view shows.
ReadOnly bool Whether the editor is read-only or disabled, in which case the view changes nothing.
UpdateAsync Func<BitBlock, Task> Replaces the block with a changed copy of it (same id) as one step of the history, and updates the bound value.

BitBlockEditorCommand enum

Name Value Description
Bold 0 Makes the selected text bold, or takes the bold off where all of it is bold; at a caret, for what is typed next.
Italic 1 Makes the selected text italic, or takes the italic off.
Underline 2 Underlines the selected text, or takes the underline off (ins, Markdown's ++x++).
StrikeThrough 3 Strikes the selected text through, or takes the line off.
InlineCode 4 Makes the selected text inline code, or takes it out of code.
Subscript 5 Lowers the selected text, or takes it back.
Superscript 6 Raises the selected text, or takes it back.
Highlight 7 Highlights the selected text (mark, Markdown's ==x==), or takes the highlight off.
CreateLink 8 Links the selected text to the address the value holds (example.com is taken as https); with no value, opens the link panel.
Unlink 9 Takes off every link the selection touches, keeping their text.
RemoveFormat 10 Takes every mark off the selected text, keeping its links.
TurnInto 11 Turns the block into the type the value names (paragraph, heading:1-6, listItem, listItem:ordered, listItem:task, quote, code, code:language, divider, or an app's type).
MoveUp 12 Moves the block, with what it holds, up past the block before it: into it when that one nests and holds blocks, and out of its parent at the start of a nested list.
MoveDown 13 Moves the block, with what it holds, down past the block after it: into it when that one nests and holds blocks, and out of its parent at the end of a nested list.
Indent 14 Nests the block under the block before it, when that one nests (a list item).
Outdent 15 Brings a nested block out of its parent one level.
Duplicate 16 Copies the block, with what it holds, to right after it.
Delete 17 Deletes the block, with what it holds.
InsertBlock 18 Inserts a new, empty block of the type the value names after the block, and puts the caret in it.
Undo 19 Takes back the last change.
Redo 20 Puts back the last change taken back.

BitBlockKind enum

Name Value Description
Text 0 Formatted text, in the inline vocabulary.
Code 1 Plain text, kept as it is.
Atom 2 No text: the block is its props, shown by the type's View.

BitVisibility enum

Name Value Description
Visible 0 The content of the component is visible.
Hidden 1 The content of the component is hidden, but the space it takes on the page remains (visibility:hidden).
Collapsed 2 The component is hidden (display:none).

BitDir enum

Name Value Description
Ltr 0 Ltr (left to right) is to be used for languages that are written from the left to the right (like English).
Rtl 1 Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic).
Auto 2 Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element.

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.