@stesura/core/constants
Shared constant values: defaults, presets and reserved attr names.
The global-attribute default lists and predicates (FORMATTED_NODES, isFormattedType, getFormattedNodeNames, …) are also exported here; they are documented on core/schema.
Functions & values
DEFAULT_BULLET_LEVEL_FORMAT
DEFAULT_BULLET_LIST
| Name | Type | Default |
|---|---|---|
reference | string | |
levels | ILevelsOptions[] |
DEFAULT_FORMATTING
| Name | Type | Default |
|---|---|---|
start | number | |
end | number | |
special | NonNullable<IndentationSpecials | null | undefined> | |
by | number |
DEFAULT_LINE_NUMBERS_ATTRS
DEFAULT_NUMBER_LIST
| Name | Type | Default |
|---|---|---|
reference | string | |
levels | ILevelsOptions[] |
DEFAULT_NUMBERED_LEVEL_FORMAT
DEFAULT_NUMBERING_ATTRIBUTES
DEFAULT_PAGE_MARGINS
| Name | Type | Default |
|---|---|---|
top | number | |
right | number | |
bottom | number | |
left | number | |
label | string | |
value | string | |
default | boolean |
DEFAULT_PAGE_SIZE
| Name | Type | Default |
|---|---|---|
width | number | |
height | number |
DEFAULT_SPACING
DEFAULT_TEXT_STYLE
| Name | Type | Default |
|---|---|---|
color | string | null | |
fontSize | number | |
fontFamily | string | |
caps | null | |
bgColor | string | |
off | null |
defaultList1
| Name | Type | Default |
|---|---|---|
reference | string | |
levels | ILevelsOptions[] |
defaultList2
| Name | Type | Default |
|---|---|---|
reference | string | |
levels | ILevelsOptions[] |
defaultListBullet
| Name | Type | Default |
|---|---|---|
reference | string | |
levels | ILevelsOptions[] |
findFontFamily
Parameters:| Name | Type | Default |
|---|---|---|
raw | string |
{ label: string; value: string; ms: string; googleFont: string; group: "Sans Serif" | "Serif" | "Monospace" | "Script"; spaceDot: "SpaceDotArimo" | "SpaceDotArchivoBlack" | "SpaceDotCarlito" | ... 10 more ... | "SpaceDotCousine"; } | nullfontFamilyToCssStack
Parameters:| Name | Type | Default |
|---|---|---|
name | string |
isPrivateUseGlyph
Parameters:| Name | Type | Default |
|---|---|---|
text | string |
LINE_NUMBERS_BOUNDS
normalizeFontFamily
Parameters:| Name | Type | Default |
|---|---|---|
raw | string |
resolveDisplayFont
Parameters:| Name | Type | Default |
|---|---|---|
raw | string |
{ label: string; value: string; ms: string; googleFont: string; group: "Sans Serif" | "Serif" | "Monospace" | "Script"; spaceDot: "SpaceDotArimo" | "SpaceDotArchivoBlack" | "SpaceDotCarlito" | ... 10 more ... | "SpaceDotCousine"; }spaceDotFontFamily
Parameters:| Name | Type | Default |
|---|---|---|
name | string |
"SpaceDotArimo" | "SpaceDotArchivoBlack" | "SpaceDotCarlito" | "SpaceDotNotoSans" | "SpaceDotFiraSans" | "SpaceDotPTSans" | "SpaceDotAnton" | "SpaceDotComicNeue" | "SpaceDotInter" | ... 4 more ... | "SpaceDotCousine"symbolFontBullet
Parameters:| Name | Type | Default |
|---|---|---|
text | string | |
font | string |
UnderlineType
| Name | Type | Default |
|---|---|---|
SINGLE | "single" | |
DOUBLE | "double" | |
THICK | "thick" | |
DOTTED | "dotted" | |
DOTTEDHEAVY | "dottedHeavy" | |
DASH | "dash" | |
DASHEDHEAVY | "dashedHeavy" | |
WAVE | "wave" | |
WAVYHEAVY | "wavyHeavy" |
Types
ProofingLanguageOption
| Name | Type | Default |
|---|---|---|
value | string | |
label | string |
Other exports
| Export | Type | Description |
|---|---|---|
AUTO_COLOR | "auto" | Sentinel for Word’s “automatic” font color (w:color w:val="auto"): an EXPLICIT value that overrides an inherited color and resolves at render time to whichever of black/white contrasts with the nearest background. Stored verbatim in the color slot of textStyle marks and character styles so it round-trips through DOCX; never valid in any other color slot. |
BLOCK_STYLE_ATTR | "styleId" | The block styleId attr (DOC_STYLE_SHEET_ATTR is the doc-level sheet). Spelled once each because a step.attr === … handler that matches the wrong one fails SILENTLY: a cache stops invalidating, a heal stops running. satisfies forces a rename back through here. |
BORDER_POSITIONS | ["top", "bottom", "left", "right"] | Block border sides. |
BORDER_STYLES | BorderStyle[] | Supported border styles. |
CAPS_VALUES | ["all", "small", "none"] | The two casing formats plus an explicit off. |
CASE_CHANGES | ["sentence", "uppercase", "lowercase", "capitalize"] | changeCase modes, in menu order. |
CODE_LANGUAGES | readonly [{ readonly value: ""; readonly label: "Plain text"; }, { readonly v… | Supported code-block languages, as value / label pairs. |
DEFAULT_AFTER_PARAGRAPH_SPACING | `number | undefined` |
DEFAULT_BULLET_CIRCLE_SYMBOL | "\u25CB" | |
DEFAULT_BULLET_SQUARE_SYMBOL | "\u25AA" | |
DEFAULT_BULLET_SYMBOL | "\u2022" | |
DEFAULT_FONT | "Arial" | |
DEFAULT_FONT_SIZE | 12 | |
DEFAULT_INDENT_STEP | number | |
DEFAULT_LINE_HEIGHT | 1.5 | |
DEFAULT_LINE_SPACING | number | |
DEFAULT_PAGE_FORMAT | `PageFormats | undefined` |
DEFAULT_PROOFING_LANGUAGE | "en-GB" | The default doc.attrs.language, and the fallback when it is empty: the language a block is proofed in when nothing declares one. |
DEFAULT_SECTION_EDGE_DISTANCE | 40 | Default header/footer distance from the page edge (px). |
DEFAULT_STYLE_SHEET | StyleSheet | The built-in stylesheet. |
DEFAULT_TAB_STOP | `number | undefined` |
DEFAULT_TEXT_DIRECTION | "ltr" | The text direction a document resolves to when neither the paragraph nor the section declares one. Hosts override it per document via the dir doc attr (setDocDirection), not by editing this. |
defaultLists | { [x: string]: ILevelsOptions[]; } | Levels of the built-in lists, keyed by list reference. |
DOC_STYLE_SHEET_ATTR | "styleSheet" | The doc’s styleSheet attr; see BLOCK_STYLE_ATTR. |
FONT_FAMILIES | { label: string; value: string; ms: string; googleFont: string; group: (typeof FONT_FAMILY_GROUPS)[number]; spaceDot: (typeof SPACE_DOT_FONTS)[number]; }[] | The font picker’s fonts. Each maps a Word font (label, ms) to the open substitute the editor renders (value, fetched from Google Fonts as googleFont), plus its picker group and SpaceDot face. From @stesura/fonts. |
FONT_FAMILY_GROUPS | readonly ["Sans Serif", "Serif", "Monospace", "Script"] | Font picker groups, in order. From @stesura/fonts. |
FONT_SIZES | number[] | Preset font sizes, in points. |
FORMAT_PAINTER_CURSOR | string (SVG data URI) | |
FORMAT_PAINTER_EXCLUDED_MARKS | string[] | Marks the format painter never copies: link and the track-changes marks. |
HIGHLIGHT_COLORS | `([“yellow”, string] | [“lime”, string] |
HIGHLIGHT_CURSOR | string (SVG data URI) | |
HighlightColors | "yellow" | "lime" | "aqua" | "fuchsia" | "red" | |
HYPHEN_BULLET_SYMBOL | "-" | The ”- ” input rule and the bullet library both offer a plain hyphen. |
INDENT_ATTR | "indent" | The indentation attr, spelled once for the setNodeAttribute sites. |
INHERIT_LIST_REF | "__inherit" | Reserved numbering.listRef meaning “the list comes from the paragraph’s style; the other fields on this attr are per-paragraph overrides”. Stamped by the numbering plugin, never a real key in doc.attrs.listConfigs — writers and guards reject it. |
LINE_HEIGHTS | { label: string; value: number; }[] | Preset line-height multipliers. |
MARGINS | PageMargins[] | Page margin presets, in px. Narrow is the default. |
MAX_INDENT_LEVEL | 8 | |
MIN_TEXTBLOCK_WIDTH | 100 | |
NODE_TYPE_ATTRS_MODIFICATION_KEY | "__nodeTypeAttrs" | Reserved key holding the attrs a tracked node TYPE change DROPPED: keys the target type doesn’t declare, which setNodeMarkup discards and the attr diff can’t see. Lets reject restore e.g. a heading’s level. Written and cleared with NODE_TYPE_MODIFICATION_KEY. |
NODE_TYPE_MODIFICATION_KEY | "__nodeType" | Reserved key inside trackChangesModificationAttrs.attrs that records a pending node TYPE change (e.g. paragraph → heading) rather than a node attribute change. The value is the PREVIOUS node type name, so reject can restore it via setNodeMarkup. Double-underscored so it can never collide with a real schema attribute name. |
PAGE_FORMATS | PageFormats[] | Page size presets, in px. A4 is the default. |
PANEL_HEIGHT_BOTTOM | "clamp(160px, 28vh, 320px)" | |
PANEL_HEIGHT_TOP | "clamp(160px, 28vh, 320px)" | Heights of the edge panels (header/footer editor, note editor) as clamped viewport fractions; fixed px heights ate most of a laptop screen (MT-9). |
SPACE_DOT_FONTS | readonly ["SpaceDotArimo", "SpaceDotArchivoBlack", "SpaceDotCarlito", "SpaceD… | SpaceDot font families, one per editor font: space-only faces that draw a dot for spaces when invisible characters are shown. From @stesura/fonts. |
SUPPORTED_LANGUAGES | readonly ProofingLanguageOption[] | The proofing languages the UI offers, each checkable by the packaged LanguageTool backend. Hosts with another backend pass their own list to the language selectors. |
SYMBOL_FONT_BULLETS | Readonly<Record<string, string>> | Word Symbol/Wingdings bullet characters mapped to the Unicode glyph the editor renders. |
UNDERLINE_TYPES | Underline[] | CSS rendering for each UnderlineType. |
UNTRACKED_ATTRS | readonly string[] | Node attrs track changes applies without recording a suggestion (id, nodeComments). |
UNTRACKED_MARKS | readonly string[] | Marks track changes applies without recording a suggestion (proofReadIgnore). |
ZOOM_DEFAULT | 100 | |
ZOOM_MAX | 200 | |
ZOOM_MIN | 50 |
Last updated on