quietmark 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -238,6 +238,7 @@ is dropped.
238
238
  | `images` | A picture on a line of its own draws. |
239
239
  | `html` | A paired tag such as `<kbd>` styles what it holds, `<br>` breaks the line, a block such as `<details>` draws whole, and a comment dims. |
240
240
  | `blocks` | Fences and `:::` containers that match a rule draw whole. `{ fence: "mermaid" }` matches a fence whose info string starts with those words, and `{ directive: "cloze" }` matches a `:::cloze` container. |
241
+ | `maxBlock` | Nothing past it: a block longer than this many characters stays plain, all but a fence it starts with, which reads from its lines. A block reads again on every change in it, so this keeps typing quick in a very long one. Both presets set 50,000. |
241
242
 
242
243
  `noteOptions()` turns everything on. `messageOptions()` is for a message
243
244
  box, where every line stays where it is and markers only hide: folding,
package/dist/types.d.ts CHANGED
@@ -217,5 +217,10 @@ export interface Options {
217
217
  html: boolean;
218
218
  /** Blocks the app draws itself. */
219
219
  blocks: BlockRule[];
220
+ /**
221
+ * The longest block, in characters, that reads as Markdown. A longer one
222
+ * stays plain, all but a fence it starts with.
223
+ */
224
+ maxBlock: number;
220
225
  }
221
226
  export {};
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,gCAAgC","sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Max Boksem\n\n// The shapes the core hands a page. Every offset counts UTF-16 code units,\n// as a JavaScript string does, and every line counts from 0.\n\n/** A run of the text, from `from` up to but not including `to`. */\nexport interface Range {\n from: number;\n to: number;\n}\n\n/**\n * An inline style. `tag` is what a paired HTML tag such as `<kbd>` holds,\n * with the tag's name in the span's `tag`.\n */\nexport type SpanStyle =\n | \"strong\"\n | \"emphasis\"\n | \"strike\"\n | \"code\"\n | \"link\"\n | \"done\"\n | \"comment\"\n | \"tag\";\n\nexport interface Span {\n range: Range;\n style: SpanStyle;\n /** The tag's name, for a `tag` span. */\n tag?: string;\n}\n\n/** A line of a fence or a formula block. */\nexport interface CodeLine {\n first: boolean;\n last: boolean;\n /** One of the block's own fence lines, not its code. */\n fence: boolean;\n}\n\n/** A line's block style. A line can be in a quote and a fence at once. */\nexport interface LineLook {\n line: number;\n /** A heading's level as written, 1 through 6. */\n heading?: number;\n /** How many quotes deep the line is. */\n quote: number;\n code?: CodeLine;\n /** A thematic break on a line of its own. */\n rule: boolean;\n /** A ticked task's line. */\n taskDone: boolean;\n /** A callout's kind in lower case, such as `note` for `> [!NOTE]`. */\n callout?: string;\n table: boolean;\n}\n\ninterface DrawnBlockBase {\n /** What it draws from, such as the formula without its `$$` lines. */\n source: string;\n /** Its first line. */\n first: number;\n /** Its last line. */\n last: number;\n /** Where the caret goes to edit it. */\n caret: number;\n}\n\n/** A block on lines of its own, drawn whole while the selection is off it. */\nexport type DrawnBlock = DrawnBlockBase &\n (\n | { kind: \"math\" }\n | { kind: \"image\"; url: string; alt: string }\n | { kind: \"callout\"; callout: string }\n | { kind: \"html\" }\n | { kind: \"fence\"; info: string }\n | { kind: \"directive\"; name: string; attributes: string }\n );\n\n/** What draws in a hidden marker's place. */\nexport type Glyph =\n | { kind: \"bullet\" }\n | { kind: \"taskBox\"; checked: boolean }\n | { kind: \"rule\" }\n | { kind: \"cellBorder\" }\n | { kind: \"lineBreak\" }\n | { kind: \"footnote\"; id: string; number: number }\n | { kind: \"formula\"; source: string }\n | { kind: \"block\"; block: DrawnBlock };\n\n/**\n * Syntax that hides while the selection is off `reveal`, and may draw\n * something in its place. With no `reveal` it always shows, as an ordered\n * list's number does.\n */\nexport interface Marker {\n range: Range;\n reveal?: Range;\n glyph?: Glyph;\n /** A line that folds away while the marker hides. */\n fold?: number;\n}\n\n/** A fence's lines, from the first through the last. */\nexport interface Fence {\n first: number;\n last: number;\n}\n\n/** The code of a top-level fence that names its language. */\nexport interface FenceCode {\n lang: string;\n range: Range;\n}\n\nexport type Align = \"none\" | \"left\" | \"center\" | \"right\";\n\nexport interface Row {\n range: Range;\n /** Each cell's text without the spaces around it. */\n cells: Range[];\n}\n\n/** A table, which a view lays out as a grid around its cells' text. */\nexport interface Table {\n range: Range;\n align: Align[];\n delimiter: Range;\n /** The header row first. */\n rows: Row[];\n}\n\n/** A link: `url` for an inline target, `ref` for a reference link's id. */\nexport interface Link {\n range: Range;\n url?: string;\n ref?: string;\n}\n\nexport interface LinkDefinition {\n /** The normalized label a reference matches on. */\n id: string;\n /** The label as written. */\n label: string;\n url: string;\n}\n\nexport interface NoteDefinition {\n id: string;\n label: string;\n}\n\nexport interface Definitions {\n links: LinkDefinition[];\n notes: NoteDefinition[];\n}\n\n/** How a text looks. Only which markers show depends on the selection. */\nexport interface Look {\n spans: Span[];\n lines: LineLook[];\n markers: Marker[];\n fences: Fence[];\n code: FenceCode[];\n tables: Table[];\n links: Link[];\n defines: Definitions;\n}\n\n/**\n * One block's look. `range` is where the block is in the whole text, and\n * the look counts from the block's start: offsets from `range.from`, lines\n * from `line`.\n */\nexport interface BlockLook {\n range: Range;\n line: number;\n look: Look;\n}\n\n/**\n * Which blocks a change drew differently, by index. The blocks from `at`\n * up to `at + removed` before the change are gone, the ones from `at` up to\n * `at + added` after it stand in their place, and the ones in `reread` kept\n * their text but read differently.\n */\nexport interface Changed {\n at: number;\n removed: number;\n added: number;\n reread: number[];\n}\n\n/** One replacement, by its range in the text before the edit. */\nexport interface Change {\n range: Range;\n insert: string;\n}\n\n/**\n * What a key does: changes that don't overlap, in text order, and where the\n * selection goes in the text after them.\n */\nexport interface Edit {\n changes: Change[];\n selection: Range;\n}\n\n/** A key that means something in Markdown. */\nexport type Key = \"Enter\" | \"Tab\" | \"ShiftTab\" | \"Backspace\";\n\n/** A block the app draws itself: `{ fence: \"mermaid\" }` or `{ directive: \"note\" }`. */\nexport type BlockRule = { fence: string } | { directive: string };\n\n/** What the look draws. */\nexport interface Options {\n /** Fence lines, a heading's underline and a table's delimiter row fold. */\n foldLines: boolean;\n /** A list's `-`, `*` or `+` draws as a bullet. */\n bullets: boolean;\n /** A task's `[ ]` or `[x]` draws as a box. */\n tasks: boolean;\n /** `$x$` and `$$` blocks draw as formulas. */\n math: boolean;\n /** A picture on a line of its own draws. */\n images: boolean;\n /** Raw HTML that a rendered reply would draw draws. */\n html: boolean;\n /** Blocks the app draws itself. */\n blocks: BlockRule[];\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,gCAAgC","sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Max Boksem\n\n// The shapes the core hands a page. Every offset counts UTF-16 code units,\n// as a JavaScript string does, and every line counts from 0.\n\n/** A run of the text, from `from` up to but not including `to`. */\nexport interface Range {\n from: number;\n to: number;\n}\n\n/**\n * An inline style. `tag` is what a paired HTML tag such as `<kbd>` holds,\n * with the tag's name in the span's `tag`.\n */\nexport type SpanStyle =\n | \"strong\"\n | \"emphasis\"\n | \"strike\"\n | \"code\"\n | \"link\"\n | \"done\"\n | \"comment\"\n | \"tag\";\n\nexport interface Span {\n range: Range;\n style: SpanStyle;\n /** The tag's name, for a `tag` span. */\n tag?: string;\n}\n\n/** A line of a fence or a formula block. */\nexport interface CodeLine {\n first: boolean;\n last: boolean;\n /** One of the block's own fence lines, not its code. */\n fence: boolean;\n}\n\n/** A line's block style. A line can be in a quote and a fence at once. */\nexport interface LineLook {\n line: number;\n /** A heading's level as written, 1 through 6. */\n heading?: number;\n /** How many quotes deep the line is. */\n quote: number;\n code?: CodeLine;\n /** A thematic break on a line of its own. */\n rule: boolean;\n /** A ticked task's line. */\n taskDone: boolean;\n /** A callout's kind in lower case, such as `note` for `> [!NOTE]`. */\n callout?: string;\n table: boolean;\n}\n\ninterface DrawnBlockBase {\n /** What it draws from, such as the formula without its `$$` lines. */\n source: string;\n /** Its first line. */\n first: number;\n /** Its last line. */\n last: number;\n /** Where the caret goes to edit it. */\n caret: number;\n}\n\n/** A block on lines of its own, drawn whole while the selection is off it. */\nexport type DrawnBlock = DrawnBlockBase &\n (\n | { kind: \"math\" }\n | { kind: \"image\"; url: string; alt: string }\n | { kind: \"callout\"; callout: string }\n | { kind: \"html\" }\n | { kind: \"fence\"; info: string }\n | { kind: \"directive\"; name: string; attributes: string }\n );\n\n/** What draws in a hidden marker's place. */\nexport type Glyph =\n | { kind: \"bullet\" }\n | { kind: \"taskBox\"; checked: boolean }\n | { kind: \"rule\" }\n | { kind: \"cellBorder\" }\n | { kind: \"lineBreak\" }\n | { kind: \"footnote\"; id: string; number: number }\n | { kind: \"formula\"; source: string }\n | { kind: \"block\"; block: DrawnBlock };\n\n/**\n * Syntax that hides while the selection is off `reveal`, and may draw\n * something in its place. With no `reveal` it always shows, as an ordered\n * list's number does.\n */\nexport interface Marker {\n range: Range;\n reveal?: Range;\n glyph?: Glyph;\n /** A line that folds away while the marker hides. */\n fold?: number;\n}\n\n/** A fence's lines, from the first through the last. */\nexport interface Fence {\n first: number;\n last: number;\n}\n\n/** The code of a top-level fence that names its language. */\nexport interface FenceCode {\n lang: string;\n range: Range;\n}\n\nexport type Align = \"none\" | \"left\" | \"center\" | \"right\";\n\nexport interface Row {\n range: Range;\n /** Each cell's text without the spaces around it. */\n cells: Range[];\n}\n\n/** A table, which a view lays out as a grid around its cells' text. */\nexport interface Table {\n range: Range;\n align: Align[];\n delimiter: Range;\n /** The header row first. */\n rows: Row[];\n}\n\n/** A link: `url` for an inline target, `ref` for a reference link's id. */\nexport interface Link {\n range: Range;\n url?: string;\n ref?: string;\n}\n\nexport interface LinkDefinition {\n /** The normalized label a reference matches on. */\n id: string;\n /** The label as written. */\n label: string;\n url: string;\n}\n\nexport interface NoteDefinition {\n id: string;\n label: string;\n}\n\nexport interface Definitions {\n links: LinkDefinition[];\n notes: NoteDefinition[];\n}\n\n/** How a text looks. Only which markers show depends on the selection. */\nexport interface Look {\n spans: Span[];\n lines: LineLook[];\n markers: Marker[];\n fences: Fence[];\n code: FenceCode[];\n tables: Table[];\n links: Link[];\n defines: Definitions;\n}\n\n/**\n * One block's look. `range` is where the block is in the whole text, and\n * the look counts from the block's start: offsets from `range.from`, lines\n * from `line`.\n */\nexport interface BlockLook {\n range: Range;\n line: number;\n look: Look;\n}\n\n/**\n * Which blocks a change drew differently, by index. The blocks from `at`\n * up to `at + removed` before the change are gone, the ones from `at` up to\n * `at + added` after it stand in their place, and the ones in `reread` kept\n * their text but read differently.\n */\nexport interface Changed {\n at: number;\n removed: number;\n added: number;\n reread: number[];\n}\n\n/** One replacement, by its range in the text before the edit. */\nexport interface Change {\n range: Range;\n insert: string;\n}\n\n/**\n * What a key does: changes that don't overlap, in text order, and where the\n * selection goes in the text after them.\n */\nexport interface Edit {\n changes: Change[];\n selection: Range;\n}\n\n/** A key that means something in Markdown. */\nexport type Key = \"Enter\" | \"Tab\" | \"ShiftTab\" | \"Backspace\";\n\n/** A block the app draws itself: `{ fence: \"mermaid\" }` or `{ directive: \"note\" }`. */\nexport type BlockRule = { fence: string } | { directive: string };\n\n/** What the look draws. */\nexport interface Options {\n /** Fence lines, a heading's underline and a table's delimiter row fold. */\n foldLines: boolean;\n /** A list's `-`, `*` or `+` draws as a bullet. */\n bullets: boolean;\n /** A task's `[ ]` or `[x]` draws as a box. */\n tasks: boolean;\n /** `$x$` and `$$` blocks draw as formulas. */\n math: boolean;\n /** A picture on a line of its own draws. */\n images: boolean;\n /** Raw HTML that a rendered reply would draw draws. */\n html: boolean;\n /** Blocks the app draws itself. */\n blocks: BlockRule[];\n /**\n * The longest block, in characters, that reads as Markdown. A longer one\n * stays plain, all but a fence it starts with.\n */\n maxBlock: number;\n}\n"]}