@quillmark/svelte 0.34.0 → 0.35.0

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
@@ -188,9 +188,9 @@ type ReviewItem =
188
188
 
189
189
  - **A proposal in text** reads the blocks `replace` names as rewritten to `after`, Markdown: the words that would go are struck, the words that would come are tinted, and blocks it adds stand in flow where they would land, with **Accept** and **Dismiss** at the end of its last line. `''` proposes the blocks' removal. `insert` proposes new blocks after or before the block it names, or at the field's end; in a field holding one empty paragraph it proposes that paragraph's text. A paragraph takes one proposal that rewrites it and one that adds after it, the first of each, whole. A word the proposal keeps and formats anew is drawn as a word it changes. The proposal is an edit of `before`, the blocks as its writer read them, or without one of the paragraph as it stood when the item arrived: what the reader writes in the paragraph meanwhile and while it stands is theirs, neither struck nor lost when the proposal is taken. Where the reader's writing meets the proposal's own words, the chip says **Edited since** and `onReviewDrawn` names the item `outdated`; where it reaches past them, the proposal reads as the whole paragraph as it now stands giving way to the whole of `after`. A block `replace` names that is gone, or that `before` does not read as, makes the proposal outdated too; a block an undo puts back under a new id is still the block it named. A proposal that would write nothing, its paragraph already reading as proposed, draws nothing.
190
190
  - **A proposal for a field** stands under the control as the value that would go and the value that would come, with the same two answers, and is outdated where the field no longer holds its `before`. Two lines of words differ by their words. Two lists differ by their members: a member both hold is kept, one that goes is struck, one that comes is tinted. A record differs by the keys that change, each as `key:` with its old and new value, and in a list of records only the records that differ show, each named by its first value when that stays. Accept writes the whole value.
191
- - **A proposal for a place inside a field** names it by its path, `main.contact.email` or `main.signature_block[2]`, and stands under the control of that place: a record's cell, a list's row, or for a member past the last, the list's foot, led by its number. Where no control of its own is drawn, inside a closed row or a matrix, it stands under the nearest one, led by where it is. Accept writes the field's whole value with that place alone changed, down the lane an edit of the place takes, and its Undo writes that place alone back, so another place taken since keeps its change. In a list, `after` absent takes the member out, and an index past the last appends one. A member's `before` finds it: where the member at the index no longer holds it, the nearest that does and that no other open proposal of the list has found, so taking one member out does not move the next proposal onto the wrong row. One whose `before` nothing holds is outdated. An item in a closed group marks the group's header, and stepping to it opens the group.
191
+ - **A proposal for a place inside a field** names it by its path, `main.contact.email` or `main.signature_block[2]`, and stands under the control of that place: a record's cell, a list's row, or for a member past the last, the list's foot, led by its number. Where no control of its own is drawn, inside a closed row or a matrix, it stands under the nearest one, led by where it is. Accept writes the field's whole value with that place alone changed, down the lane an edit of the place takes. In a list, `after` absent takes the member out, and an index past the last appends one. A member's `before` finds it: where the member at the index no longer holds it, the nearest that does and that no other open proposal of the list has found, so taking one member out does not move the next proposal onto the wrong row. One whose `before` nothing holds is outdated. An item in a closed group marks the group's header, and stepping to it opens the group.
192
192
 
193
- `proposalsBetween(quill, base, answer)`, from `@quillmark/svelte/visual`, makes the list from an assistant's answer. `base` is the document as the assistant read it, a snapshot taken when it was asked, and `answer` a copy of it the assistant edited; neither is the live document, which the editor compares each item with as it draws, so what the reader typed meanwhile is theirs and a place both changed is `outdated`. It returns `{ items, cards }`: `items` with `before` filled in, one `replace` per block the answer rewrote or took out and one `insert` per run of blocks it added, and an item per record cell and list member that changed elsewhere, at the paths of `base`; `cards`, the cards it added (`{ type: 'add', card, after }`, `after` the id of the card it follows) and took out (`{ type: 'remove', id, kind }`), which no item draws and the host lists and answers itself. A path names its card by index, so a card added, removed or moved between the snapshot and the answer, or while the review is open, puts an item's path on another card: a block item then names no block there and goes `undrawn` as `block`, and a field item with `before` mostly goes `outdated`, but one can land on the wrong card where that card's field holds the same value. A host either holds adding, removing and moving cards while an answer is pending and its review is open, or clears the review when the card list changes.
193
+ `proposalsBetween(quill, base, answer)`, from `@quillmark/svelte/visual`, makes the list from an assistant's answer. `base` is the document as the assistant read it, a snapshot taken when it was asked, and `answer` a copy of it the assistant edited; neither is the live document, which the editor compares each item with as it draws, so what the reader typed meanwhile is theirs and a place both changed is `outdated`. It returns `{ items, cards }`: `items` with `before` filled in, one `replace` per block the answer rewrote or took out and one `insert` per run of blocks it added, and an item per record cell and list member that changed elsewhere, at the paths of `base`; `cards`, the cards it added (`{ type: 'add', card, after }`, `after` the id of the card it follows) and took out (`{ type: 'remove', id, kind }`), which no item draws and the host lists and answers itself. A path names its card by index, read against the cards as they stood when the list was set: the editor carries each item through every card added, removed or moved since, by `applyCardOps` or by the reader, so it stays on its card, and an item whose card is gone goes `undrawn` as `field`. A host accepting a card the answer added writes it and calls `applyCardOps` at once, with the review still open. A card added, removed or moved between the snapshot and the answer is not carried: a block item then names no block where its path lands and goes `undrawn` as `block`, and a field item with `before` mostly goes `outdated`, so a host sets the list over the cards the snapshot held, or clears it when they move before the answer lands.
194
194
 
195
195
  ```ts
196
196
  const base = doc.clone(); // when the assistant is asked
@@ -201,23 +201,23 @@ review = items;
201
201
 
202
202
  The editor makes every write an answer asks for:
203
203
 
204
- | `action` | What the reader did | What is written |
205
- | --------- | ------------------------------- | --------------------------------------------------------------------------------------------------------- |
206
- | `accept` | Took a proposal. | Before the event, the proposal as it was drawn, as an edit of the reader's. `onChange` reports it. |
207
- | `dismiss` | Turned a proposal down. | Nothing. |
208
- | `reopen` | Undid an accept or a dismissal. | Before the event, what an accept wrote is taken back, as an edit of the reader's. The item is open again. |
204
+ | `action` | What the reader did | What is written |
205
+ | --------- | --------------------------------------- | -------------------------------------------------------------------------------------------------- |
206
+ | `accept` | Took a proposal. | Before the event, the proposal as it was drawn, as an edit of the reader's. `onChange` reports it. |
207
+ | `dismiss` | Turned a proposal down. | Nothing. |
208
+ | `reopen` | Undid an accept or a dismissal with ⌘Z. | Before the event, what an accept wrote is taken back by its own undo. The item is open again. |
209
209
 
210
- An accepted proposal the list still holds is drawn as the change it made: the words it wrote underlined, a wedge where it only removed words, and a field's control marked along its foot, each with the card that shows what stood there and **Undo**, raised by the pointer or the caret resting on it and lowered by Escape. Undo takes back what the accept wrote, the old words with their formatting or the old value, as an edit of the reader's, out of order and past whatever the reader has typed beside it, and reports `reopen`: the item is a proposal again. Words the reader typed inside the accepted ones go with them, and a mark whose words are all gone, or a field set to another value since, drops without a report. With the caret in the mark, ⌘/Ctrl+. does what Undo does. The marks are the mounted editor's and are not stored: a leaf that mounts again shows the text as it stands, and the item reports as `applied`.
210
+ An answered item is drawn no more from the moment of the answer: a dismissed one wrote nothing, and an accepted one is plain text in the document, the reader's like any other. The editor keeps no record of what an accept replaced; a host that offers to take a whole answer back keeps its own snapshot of the document from before it.
211
211
 
212
- A dismissed item is drawn no more from the moment of the answer. ⌘Z/Ctrl+Z from anywhere in the editor takes back the answers given since the reader's last edit, newest first, one answer or one `answerReview` call at a time, and each comes back as `reopen`; past that edit a taken proposal is still undone in its own text field, with its `reopen`, and a field's value and a dismissal are final. A field's accept stands on the toast with its way back; a host's `answerReview` batch raises no toast, and ⌘Z takes it back whole.
212
+ ⌘Z/Ctrl+Z from anywhere in the editor takes back the answers given since the reader's last edit, newest first, one answer or one `answerReview` call at a time, and each comes back as `reopen`; past that edit a taken proposal is still undone in its own text field, with its `reopen`, and a field's value and a dismissal are final. A field's accept stands on the toast with its way back; a host's `answerReview` batch raises no toast, and ⌘Z takes it back whole.
213
213
 
214
- The host sets the list once and clears it once. It sets it when an answer arrives, and clears it when the reader keeps the result or asks again, or the document closes; between the two it does not touch the list. The editor draws every answer while the list holds the item: a dismissed item goes, an accepted proposal is drawn as its change, and an item reopened by Undo or ⌘Z is drawn open again. A host that accepts on arrival waits for the first `onReviewDrawn` that lists the new ids, which arrives before the browser paints them, and accepts the ids of `order` that are in neither `outdated` nor `undrawn`, so a proposal the reader's writing meets stays open; an item the reader then reopens it turns down with `answerReview([id], 'dismiss')`, so Undo is the one press. Clearing the list keeps the accepted changes unmarked. A field's proposal the schema refuses stays, unanswered, and the field says why as it does for any refused value.
214
+ The host sets the list once and clears it once. It sets it when an answer arrives, and clears it when the reader keeps the result or asks again, or the document closes; between the two it does not touch the list. The editor draws every answer while the list holds the item: an answered item goes, and an item reopened by ⌘Z is drawn open again. A host that accepts on arrival waits for the first `onReviewDrawn` that lists the new ids, which arrives before the browser paints them, and accepts the ids of `open` that are in neither `outdated` nor `undrawn`, so a proposal the reader's writing meets stays open; an item the reader then reopens with ⌘Z it turns down with `answerReview([id], 'dismiss')`, so ⌘Z is the one press. A field's proposal the schema refuses stays, unanswered, and the field says why as it does for any refused value.
215
215
 
216
- `onReviewDrawn` reports what the editor draws of the list, on each change once the leaves have drawn: `order`, the items drawn in document order; `accepted`, those of them drawn as accepted changes; `open`, the rest of `order`, still waiting for an answer, so a host's bar shows Keep once it is empty; `outdated`, the open proposals the reader's own writing meets, which a host accepting on arrival leaves open; and `undrawn`, every listed item it does not draw, each with why: `block` (no block it names stands in its field, or no leaf of the field is mounted), `field` (the path names no field the editor holds, or a place inside one its schema does not declare), `parse` (`after` is not Markdown the leaf reads), `taken` (an earlier item has the paragraph or the field) or `applied` (the text already reads as proposed). A host's count and its next and previous read `order`, so they agree with the page.
216
+ `onReviewDrawn` reports what the editor draws of the list, on each change once the leaves have drawn: `open`, the items drawn in document order, each still waiting for an answer, so a host's bar shows Keep once it is empty; `outdated`, the open proposals the reader's own writing meets, which a host accepting on arrival leaves open; and `undrawn`, every listed item it does not draw, each with why: `block` (no block it names stands in its field, or no leaf of the field is mounted), `field` (the path names no field the editor holds, or a place inside one its schema does not declare), `parse` (`after` is not Markdown the leaf reads), `taken` (an earlier item has the paragraph or the field) or `applied` (the text already reads as proposed). A host's count and its next and previous read `open`, so they agree with the page.
217
217
 
218
- The verbs complete it. `answerReview(ids | 'all', 'accept' | 'dismiss' | 'reopen')` answers items as their buttons would, in document order, and returns the ids answered: `onReview` hears each, an accept and a dismissal pass over a proposal already accepted, `'reopen'` takes back each accepted one as its Undo does, an item that cannot be answered stands, neither the focus nor the caret moves, and no toast is raised. `stepReview(1 | -1)` brings the next or previous drawn item to the reader, round from either end, with the caret in it or the focus in its field (`{ focus: false }` only lights it), and resolves its id; it scrolls the item's own scroller only as far as it must to show it, so an editor in a pane that scrolls on its own steps within that pane. `revealReview(id)` brings one item to the reader: it opens the group holding the item, scrolls it to the middle of the pane, lights it and raises its card, and resolves `false` for an item the editor does not draw; `{ focus: true }` also puts the caret in it.
218
+ The verbs complete it. `answerReview(ids | 'all', 'accept' | 'dismiss')` answers items as their buttons would, in document order, and returns the ids answered: `onReview` hears each, an item that cannot be answered stands, neither the focus nor the caret moves, and no toast is raised. `stepReview(1 | -1)` brings the next or previous drawn item to the reader, round from either end, with the caret in it or the focus in its field (`{ focus: false }` only lights it), and resolves its id; it scrolls the item's own scroller only as far as it must to show it, so an editor in a pane that scrolls on its own steps within that pane. `revealReview(id)` brings one item to the reader: it opens the group holding the item, scrolls it to the middle of the pane and lights it, and resolves `false` for an item the editor does not draw; `{ focus: true }` also puts the caret in it.
219
219
 
220
- With the caret in an item, or the focus in its field, `REVIEW_KEYS` answer it: ⌘/Ctrl+Enter accepts a proposal, and ⌘/Ctrl+. dismisses one or takes an accepted one back. From anywhere in the editor ⌘/Ctrl+⌥/Alt+↓ and ↑ step to the next and previous item, as `stepReview` does. An answer given by a chord goes on to the next item, so ⌘/Ctrl+Enter pressed down a batch walks it; `reviewAdvance={false}` keeps the caret where the answer was given, and an answer by pointer never moves it. The caret is in the item that holds it closest, so in an accepted change inside another proposal's paragraph ⌘/Ctrl+. takes the change back, and ⌘/Ctrl+Enter takes the proposal still. A proposal that only adds blocks answers from anywhere in the paragraph it adds after; where a proposal also rewrites that paragraph, the caret answers the rewrite, and `revealReview(id, { focus: true })` puts it in the one asked for. Every word the review draws is a `strings` key, and its one hue is `--qm-review` ([THEMING.md](THEMING.md)).
220
+ With the caret in an item, or the focus in its field, `REVIEW_KEYS` answer it: ⌘/Ctrl+Enter accepts a proposal, and ⌘/Ctrl+. dismisses one. From anywhere in the editor ⌘/Ctrl+⌥/Alt+↓ and ↑ step to the next and previous item, as `stepReview` does. An answer given by a chord goes on to the next item, so ⌘/Ctrl+Enter pressed down a batch walks it; `reviewAdvance={false}` keeps the caret where the answer was given, and an answer by pointer never moves it. A proposal that only adds blocks answers from anywhere in the paragraph it adds after; where a proposal also rewrites that paragraph, the caret answers the rewrite, and `revealReview(id, { focus: true })` puts it in the one asked for. Every word the review draws is a `strings` key, and its one hue is `--qm-review` ([THEMING.md](THEMING.md)).
221
221
 
222
222
  ### Wording
223
223
 
package/THEMING.md CHANGED
@@ -59,7 +59,7 @@ The poles take a colour, not `transparent` or `inherit`: the raised surfaces, th
59
59
  | `--qm-fg` | `#1c1c1c` / `#d7dadc` | Base ink. Body text, labels, and borders step off it. |
60
60
  | `--qm-accent` | `#71717a` / `#a1a1aa` | Focus rings, active marks, the preview's active field box. Outside error and review the surface spends no hue of its own, so this is the one it wears. |
61
61
  | `--qm-danger` | `#9e1518` / `#f9786c` | Error diagnostics and the delete glyph. |
62
- | `--qm-review` | `#4f46e5` / `#a5b4fc` | Review: the line under a change someone else made, and the tint under the words a proposal would add. Give it the hue your app gives its reviewer. |
62
+ | `--qm-review` | `#4f46e5` / `#a5b4fc` | Review: the line through the words a proposal would take, and the tint under the words it would add. Give it the hue your app gives its reviewer. |
63
63
  | `--qm-font` | `ui-sans-serif, system-ui, sans-serif` | The editor surface's font family. Controls and buttons take it too, in place of the UA face. |
64
64
  | `--qm-font-mono` | `ui-monospace, monospace` | The monospace face: the JSON array control, the tips card. |
65
65
  | `--qm-font-size` | `0.875rem` | Chrome text: every control's size, the anchor the ramp derives up (title) and down (label/meta) from, and the anchor a document body sits one small step over. |
@@ -80,3 +80,9 @@ export interface NestedAddr {
80
80
  field: Addr;
81
81
  steps: PathStep[];
82
82
  }
83
+ /**
84
+ * `path` with the card it names moved: its index read into `was`, the card keys as they stood,
85
+ * and written as that key's index in `now`. A card no longer in `now` is named past the last, so
86
+ * the path resolves to nothing. `path` itself where it names no card, or a card past `was`.
87
+ */
88
+ export declare function cardMoved(path: DocPath, was: readonly string[], now: readonly string[]): DocPath;
@@ -83,6 +83,22 @@ export function nestedAddrForFieldPath(path) {
83
83
  }
84
84
  return { field, steps };
85
85
  }
86
+ /**
87
+ * `path` with the card it names moved: its index read into `was`, the card keys as they stood,
88
+ * and written as that key's index in `now`. A card no longer in `now` is named past the last, so
89
+ * the path resolves to nothing. `path` itself where it names no card, or a card past `was`.
90
+ */
91
+ export function cardMoved(path, was, now) {
92
+ const segs = segsOf(path);
93
+ const head = segs?.[0];
94
+ if (!segs || head?.seg !== 'card' || head.index >= was.length)
95
+ return path;
96
+ const at = now.indexOf(was[head.index]);
97
+ const index = at < 0 ? now.length : at;
98
+ if (index === head.index)
99
+ return path;
100
+ return core().formatDocPath([{ ...head, index }, ...segs.slice(1)]);
101
+ }
86
102
  /**
87
103
  * `parseDocPath`, with a malformed path as `undefined` rather than a throw. The gate is read
88
104
  * outside the try: an uninitialized core is not a malformed path.
@@ -89,11 +89,8 @@ export interface CreateFieldOpts {
89
89
  emptyUnsets?: boolean;
90
90
  /** The review layer's wording, read per decoration pass (`review.ts`). */
91
91
  reviewStrings?: () => ReviewStrings;
92
- /** The review item whose card is up, and the reader's Escape lowering it. */
93
- reviewShown?: () => string | undefined;
94
- onReviewDismiss?(): void;
95
- /** A reader answered the review item `id`: a proposal's button or its chord, or the chord
96
- * that takes a change back, `chord` where a key gave it. A proposal taken is written by
92
+ /** A reader answered the review item `id`: a proposal's button or its chord, or an undo
93
+ * that took the answer back, `chord` where a key gave it. A proposal taken is written by
97
94
  * then. */
98
95
  onReview?(id: string, action: ReviewAction, chord?: boolean): void;
99
96
  /** The leaf is writing a taken proposal, and is done: the commit between is the answer's. */
@@ -164,7 +161,7 @@ export interface FieldController {
164
161
  enterReview(id: string): boolean;
165
162
  /** Answer the review item `id` as its button would, moving neither the caret nor the
166
163
  * focus; false for one not drawn, or a proposal that can no longer be written. */
167
- answerReview(id: string, action: ReviewAction): boolean;
164
+ answerReview(id: string, action: 'accept' | 'dismiss'): boolean;
168
165
  /** Open the review item `id` this leaf dismissed again, reported as `reopen`, whether or
169
166
  * not the host still lists it. */
170
167
  reopenReview(id: string): void;
@@ -46,7 +46,6 @@ import { taskPlugin } from './tasks.js';
46
46
  import { DEFAULT_TABLE_STRINGS, tableNodeView } from './table-view.js';
47
47
  import { DEFAULT_SLASH_STRINGS, focusSlashItem, runSlashItem, slashPlugin } from './slash.js';
48
48
  const anchorKey = new PluginKey('quill-anchors');
49
- const NO_ANCHORS = [];
50
49
  const GHOSTS = 100;
51
50
  /**
52
51
  * Plugin-held anchors (PM coords), mapped through every edit's `StepMap` and mutated by an {@link
@@ -77,11 +76,6 @@ function anchorPlugin(seed) {
77
76
  }
78
77
  else if (edit?.op === 'reset')
79
78
  anchors = edit.anchors;
80
- else if (edit?.op === 'restore') {
81
- const back = new Set(edit.anchors.map((a) => a.id));
82
- anchors = [...anchors.filter((a) => !back.has(a.id)), ...edit.anchors];
83
- ghosts = ghosts.filter((g) => !back.has(g.id));
84
- }
85
79
  return { anchors, ghosts: ghosts.slice(-GHOSTS) };
86
80
  }
87
81
  },
@@ -271,8 +265,6 @@ export function createField(opts) {
271
265
  items: () => reviewItems,
272
266
  lit: () => reviewLit,
273
267
  strings: () => opts.reviewStrings?.() ?? DEFAULT_REVIEW_STRINGS,
274
- anchors: (state) => anchorKey.getState(state)?.anchors ?? NO_ANCHORS,
275
- restore: (tr, anchors) => tr.setMeta(anchorKey, { op: 'restore', anchors }),
276
268
  parse: (markdown) => {
277
269
  if (!parsed.has(markdown)) {
278
270
  let node;
@@ -286,8 +278,6 @@ export function createField(opts) {
286
278
  }
287
279
  return parsed.get(markdown);
288
280
  },
289
- shown: () => opts.reviewShown?.(),
290
- dismiss: () => opts.onReviewDismiss?.(),
291
281
  act: (id, action, chord) => opts.onReview?.(id, action, chord),
292
282
  writing: (on) => opts.onReviewWriting?.(on),
293
283
  point: (id, via) => opts.onReviewPoint?.(id, via),
@@ -788,52 +788,7 @@ li.ProseMirror-selectednode::after {
788
788
 
789
789
  /* ── Review (`review.ts`) ────────────────────────────────────────────────────
790
790
  Drawn in the leaf's own flow and at the leaf's own type, so a reviewed paragraph still
791
- reads as the paragraph. One hue throughout (`--_qm-review`), and three strengths of it.
792
-
793
- A change someone else made is a line under the words that were written: quieter than a
794
- link's, which is the ink's, and absent from the page the document prints. The tint
795
- arrives with attention. */
796
- .ProseMirror .qm-review-changed {
797
- text-decoration: underline;
798
- text-decoration-color: var(--_qm-review-line);
799
- text-decoration-thickness: var(--_qm-vertical-width);
800
- text-underline-offset: 0.2em;
801
- border-radius: var(--_qm-radius-inner);
802
- transition: background-color var(--_qm-duration-fast) var(--_qm-ease-reverse);
803
- }
804
- .ProseMirror .qm-review-changed.qm-review-lit {
805
- background: var(--_qm-review-tint);
806
- }
807
- /* Where text was only taken out there are no words to underline, so a wedge stands at the
808
- join, under the baseline the way a proofreader's caret does. It takes no width: the
809
- line reads as the document has it. What the pointer and a finger find is the join's
810
- whole line, a letter to either side, since the wedge alone is too small to hit. */
811
- .ProseMirror .qm-review-gone {
812
- position: relative;
813
- display: inline-block;
814
- width: 0;
815
- height: 1em;
816
- vertical-align: text-bottom;
817
- }
818
- .ProseMirror .qm-review-gone::before {
819
- content: '';
820
- position: absolute;
821
- inset: -0.15em -0.45em -0.4em;
822
- }
823
- .ProseMirror .qm-review-gone::after {
824
- content: '';
825
- position: absolute;
826
- left: -0.35em;
827
- bottom: -0.3em;
828
- width: 0.7em;
829
- height: 0.45em;
830
- background: var(--_qm-review-line);
831
- clip-path: polygon(50% 0, 100% 100%, 0 100%);
832
- transition: background-color var(--_qm-duration-fast) var(--_qm-ease-reverse);
833
- }
834
- .ProseMirror .qm-review-gone.qm-review-lit::after {
835
- background: var(--_qm-review);
836
- }
791
+ reads as the paragraph. One hue throughout (`--_qm-review`). */
837
792
 
838
793
  /* A proposal is its paragraph read as an edit of itself. The words that would go step back
839
794
  to the label ink under a line; the words that would come stand at the ink on the tint,
@@ -1,7 +1,6 @@
1
1
  import { type Node as PMNode } from 'prosemirror-model';
2
- import { Plugin, type EditorState, type Transaction } from 'prosemirror-state';
2
+ import { Plugin, type Transaction } from 'prosemirror-state';
3
3
  import { type EditorView } from 'prosemirror-view';
4
- import type { AnchorPos } from './marks.js';
5
4
  /**
6
5
  * One proposal over a prose leaf, by the blocks that place it.
7
6
  *
@@ -36,7 +35,7 @@ export type BlockPlace = {
36
35
  } | 'end';
37
36
  /** What a reader did with a proposal: took it, which the leaf has written by the time it says
38
37
  * so, turned it down, or undid an answer, so the item is open again with whatever was written
39
- * for it taken back. */
38
+ * for it taken back by the leaf's own undo. */
40
39
  export type ReviewAction = 'accept' | 'dismiss' | 'reopen';
41
40
  /** What brought an item under attention: the pointer over it, or the caret in it. */
42
41
  export type ReviewVia = 'pointer' | 'caret';
@@ -49,8 +48,6 @@ export interface ReviewStrings {
49
48
  reviewDismissTitle: string;
50
49
  /** The accessible name of a proposal's two buttons as a group. */
51
50
  reviewProposal: string;
52
- /** The accessible name of the wedge standing where text was removed. */
53
- reviewGone: string;
54
51
  /** The label before the buttons of a proposal whose paragraph the reader rewrote since. */
55
52
  reviewOutdated: string;
56
53
  }
@@ -61,14 +58,8 @@ export interface ReviewChannel {
61
58
  /** The item under attention, drawn a step stronger. */
62
59
  lit(): string | undefined;
63
60
  strings(): ReviewStrings;
64
- anchors(state: EditorState): readonly AnchorPos[];
65
- /** Lay `anchors` again in the transaction that puts their text back. */
66
- restore?(tr: Transaction, anchors: readonly AnchorPos[]): void;
67
61
  /** `after` as a document under the leaf's schema; `undefined` where it does not parse. */
68
62
  parse(markdown: string): PMNode | undefined;
69
- /** The item whose card is up, and the way to lower it. */
70
- shown(): string | undefined;
71
- dismiss(): void;
72
63
  /** A reader's answer, `chord` where a key gave it. */
73
64
  act(id: string, action: ReviewAction, chord?: boolean): void;
74
65
  /** The leaf is writing a taken proposal, and is done. */
@@ -95,12 +86,6 @@ export interface ReviewReport {
95
86
  id: string;
96
87
  reason: LeafUndrawn;
97
88
  }[];
98
- /** The drawn proposals taken here and still listed, drawn as changes, each with the text
99
- * that stood where it wrote. */
100
- accepted: readonly {
101
- id: string;
102
- before: string;
103
- }[];
104
89
  }
105
90
  /** Tell the review layer the store took blocks under new ids, each `[was, now]`. */
106
91
  export declare function renameBlocks(tr: Transaction, renamed: readonly (readonly [string, string])[]): void;
@@ -116,7 +101,7 @@ export interface ReviewLayer {
116
101
  enter(view: EditorView, id: string): boolean;
117
102
  /** Answer item `id` as its button would, moving neither the caret nor the focus. False
118
103
  * where the leaf does not draw it or cannot write it. */
119
- answer(id: string, action: ReviewAction): boolean;
104
+ answer(id: string, action: 'accept' | 'dismiss'): boolean;
120
105
  /** Open a dismissal of item `id` again and say so, the dismissal still held here or
121
106
  * already pruned by the host taking the item off its list. */
122
107
  reopen(view: EditorView, id: string): void;
@@ -124,8 +109,8 @@ export interface ReviewLayer {
124
109
  undo(view: EditorView): boolean;
125
110
  }
126
111
  /**
127
- * The leaf's review layer. The decorations are a function of the document, the anchors and the
128
- * channel's items, kept until one of them moves. The caret's report holds off while the reader
112
+ * The leaf's review layer. The decorations are a function of the document and the channel's
113
+ * items, kept until one of them moves. The caret's report holds off while the reader
129
114
  * types inside an item: an item is news on arriving in it, and noise under every keystroke.
130
115
  */
131
116
  export declare function reviewLayer(channel: ReviewChannel): ReviewLayer;