@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.
@@ -1,29 +1,12 @@
1
1
  import type { PathStep } from '@quillmark/wasm';
2
2
  import type { DocPath } from '../core/address.js';
3
3
  import type { ReviewAction, ReviewReport, ReviewVia, TextReview } from '../core/codec/index.js';
4
- import { type DeepReview, type FieldChange, type FieldProposal, type ReviewItem, type ReviewUndrawn } from './review.js';
5
- /** How long the pointer or the caret rests on a change before its card rises, in ms. */
6
- export declare const HOVER_MS = 350;
7
- /** How long a card outlasts the pointer's leaving, in ms: the trip from the mark into the card. */
8
- export declare const LEAVE_MS = 200;
9
- /** How long a revealed item with no card stays lit, in ms. */
4
+ import { type DeepReview, type FieldProposal, type ReviewItem, type ReviewUndrawn } from './review.js';
5
+ /** How long a revealed item stays lit, in ms. */
10
6
  export declare const REVEAL_MS = 2400;
11
- /** The card on show: the accepted proposal it is up for, as its change, and what raised it. */
12
- export interface ShownReview {
13
- item: FieldChange | TextChange;
14
- via: ReviewVia | 'reveal';
15
- }
16
- /** A proposal taken in a prose leaf, as the change it made, `before` the text it replaced. */
17
- export type TextChange = {
18
- id: string;
19
- state: 'changed';
20
- before?: string;
21
- };
22
7
  export interface Review {
23
8
  /** The host's list, less what was answered here. */
24
9
  readonly items: readonly ReviewItem[];
25
- /** The proposals accepted and still listed, each as the change it made. */
26
- readonly accepted: ReadonlyMap<string, FieldChange | TextChange>;
27
10
  /** The items the prose leaf at `key` draws, those placed by blocks of its own field. One
28
11
  * identity until the list changes. */
29
12
  textAt(key: string): readonly TextReview[];
@@ -38,11 +21,9 @@ export interface Review {
38
21
  readonly fieldOutdated: ReadonlySet<string>;
39
22
  /** The item under attention. */
40
23
  readonly lit: string | undefined;
41
- readonly shown: ShownReview | undefined;
42
24
  /** The items over the field at leaf `key`: its own, and those naming a place inside it,
43
25
  * each with the steps to the value it names as the field holds it now. */
44
26
  at(key: string): {
45
- changed?: FieldChange;
46
27
  proposed?: FieldProposal;
47
28
  nested?: readonly DeepReview[];
48
29
  };
@@ -62,10 +43,6 @@ export interface Review {
62
43
  heard(id: string, action: ReviewAction, key: string, chord?: boolean): void;
63
44
  /** A leaf is writing an answer, and is done: its edit is the answer's, not the reader's. */
64
45
  writing(on: boolean): void;
65
- /** Hold the card up while the pointer or the focus is in it, and let it go again. */
66
- hold(): void;
67
- release(): void;
68
- dismiss(): void;
69
46
  reveal(id: string): void;
70
47
  }
71
48
  export interface ReviewSource {
@@ -89,14 +66,10 @@ export interface ReviewSource {
89
66
  /** A reader's answer, to make and to pass on: `item` where the list holds it, `key` the
90
67
  * leaf that gave it where one did. `false` where it could not be made, and the item
91
68
  * stands. */
92
- answer(id: string, item: ReviewItem | FieldChange | TextChange | undefined, action: ReviewAction, key?: string): boolean;
69
+ answer(id: string, item: ReviewItem | undefined, action: ReviewAction, key?: string): boolean;
93
70
  /** An answer a chord gave, once it is made. */
94
71
  chorded?(id: string): void;
95
72
  writing?(on: boolean): void;
96
- /** The field proposals accepted here, each as the change it made. */
97
- taken?(): ReadonlyMap<string, FieldChange>;
98
- /** Take back what accepting `id` wrote, so it is open again. */
99
- putBack?(id: string): boolean;
100
73
  }
101
74
  export declare function createReview(source: ReviewSource): Review & {
102
75
  dispose(): void;
@@ -2,28 +2,19 @@
2
2
  // under attention.
3
3
  //
4
4
  // Attention has three sources and one answer. The pointer over an item, the caret in one and a
5
- // host's reveal each name an item; the lit one is the card's where a card is up, else the
6
- // revealed, the caret's, the pointer's, in that order. A card is the before-and-undo surface of an
7
- // accepted proposal: it rises at once for a reveal, and after a beat for the pointer and the caret,
8
- // so neither raises one on its way across a paragraph, and it waits a beat on the pointer's
9
- // leaving so the pointer can travel into it.
5
+ // host's reveal each name an item; the lit one is the revealed, else the caret's, else the
6
+ // pointer's.
10
7
  //
11
- // A dismissed item is drawn no more, from the answer and not from the host's next list: the
8
+ // An answered item is drawn no more, from the answer and not from the host's next list: the
12
9
  // reader's press shows at once however long the host takes to hand over a list without it.
13
10
  import { getContext, setContext } from 'svelte';
14
11
  import { SvelteMap } from 'svelte/reactivity';
15
- import { byBlocks, locate, isChange, onField, sameValue } from './review.js';
16
- /** How long the pointer or the caret rests on a change before its card rises, in ms. */
17
- export const HOVER_MS = 350;
18
- /** How long a card outlasts the pointer's leaving, in ms: the trip from the mark into the card. */
19
- export const LEAVE_MS = 200;
20
- /** How long a revealed item with no card stays lit, in ms. */
12
+ import { byBlocks, locate, onField, sameValue } from './review.js';
13
+ /** How long a revealed item stays lit, in ms. */
21
14
  export const REVEAL_MS = 2400;
22
15
  export function createReview(source) {
23
16
  /** The ids answered, each until a list arrives without it. */
24
17
  const answered = new Set();
25
- /** The field proposals accepted here, drawn while the field still holds what was written. */
26
- const took = new Set();
27
18
  let answers = $state(0);
28
19
  const items = $derived.by(() => {
29
20
  const listed = source.items() ?? [];
@@ -33,30 +24,10 @@ export function createReview(source) {
33
24
  for (const id of answered)
34
25
  if (!ids.has(id))
35
26
  answered.delete(id);
36
- for (const id of took)
37
- if (!ids.has(id))
38
- took.delete(id);
39
- const taken = source.taken?.();
40
- const gone = (id) => answered.has(id) || (took.has(id) && !taken?.has(id));
41
- return answered.size || took.size ? listed.filter((item) => !gone(item.id)) : listed;
27
+ return answered.size ? listed.filter((item) => !answered.has(item.id)) : listed;
42
28
  });
43
29
  const drawn = new SvelteMap();
44
- /** Each accepted proposal still listed, as the change the card and the field draw. */
45
- const accepted = $derived.by(() => {
46
- const out = new Map();
47
- const listed = new Map((source.items() ?? []).map((item) => [item.id, item]));
48
- for (const [id, change] of source.taken?.() ?? [])
49
- if (listed.has(id))
50
- out.set(id, change);
51
- for (const report of drawn.values())
52
- for (const { id, before } of report.accepted ?? []) {
53
- const item = listed.get(id);
54
- if (item && byBlocks(item))
55
- out.set(id, { id, state: 'changed', before });
56
- }
57
- return out;
58
- });
59
- const byId = $derived(new Map(items.map((item) => [item.id, accepted.get(item.id) ?? item])));
30
+ const byId = $derived(new Map(items.map((item) => [item.id, item])));
60
31
  /** The items each prose leaf draws, by leaf key. */
61
32
  const text = $derived.by(() => {
62
33
  const own = new Map();
@@ -79,13 +50,12 @@ export function createReview(source) {
79
50
  /** The nested proposals whose `before` the field no longer holds. */
80
51
  const moved = new Set();
81
52
  const claims = new Map();
82
- for (const listed of items) {
83
- if (byBlocks(listed)) {
84
- if (source.leafFor(listed.field) === undefined)
85
- undrawn.push({ id: listed.id, reason: 'field' });
53
+ for (const item of items) {
54
+ if (byBlocks(item)) {
55
+ if (source.leafFor(item.field) === undefined)
56
+ undrawn.push({ id: item.id, reason: 'field' });
86
57
  continue;
87
58
  }
88
- const item = accepted.get(listed.id) ?? listed;
89
59
  if (!onField(item))
90
60
  continue;
91
61
  if (!source.exact(item.field)) {
@@ -98,12 +68,11 @@ export function createReview(source) {
98
68
  claims.set(deep.key, claimed);
99
69
  const held = out.get(deep.key) ?? {};
100
70
  const { steps, found } = locate(deep.value, deep.steps, item, claimed);
101
- const same = (held.nested ?? []).some((e) => isChange(e.item) === isChange(item) && sameValue(e.steps, steps));
102
- if (same) {
71
+ if ((held.nested ?? []).some((e) => sameValue(e.steps, steps))) {
103
72
  undrawn.push({ id: item.id, reason: 'taken' });
104
73
  continue;
105
74
  }
106
- if (!found && !isChange(item))
75
+ if (!found)
107
76
  moved.add(item.id);
108
77
  held.nested = [...(held.nested ?? []), { steps, item }];
109
78
  out.set(deep.key, held);
@@ -115,14 +84,11 @@ export function createReview(source) {
115
84
  continue;
116
85
  }
117
86
  const held = out.get(key) ?? {};
118
- if ((isChange(item) ? held.changed : held.proposed) !== undefined) {
87
+ if (held.proposed !== undefined) {
119
88
  undrawn.push({ id: item.id, reason: 'taken' });
120
89
  continue;
121
90
  }
122
- if (isChange(item))
123
- held.changed = item;
124
- else
125
- held.proposed = item;
91
+ held.proposed = item;
126
92
  out.set(key, held);
127
93
  }
128
94
  return { fields: out, undrawn, moved };
@@ -142,36 +108,13 @@ export function createReview(source) {
142
108
  let caret = $state();
143
109
  let caretFrom;
144
110
  let revealed = $state();
145
- let card = $state();
146
- let held = false;
147
- let timer;
148
- /** The caret's rest on a change, its own so the pointer's passing does not restart it. */
149
- let rest;
150
111
  let fade;
151
- const wait = (ms, then) => {
152
- clearTimeout(timer);
153
- timer = setTimeout(then, ms);
154
- };
155
- const changed = (id) => id !== undefined && !!byId.get(id) && isChange(byId.get(id));
156
- const shown = $derived.by(() => {
157
- const item = card && byId.get(card.id);
158
- return item && isChange(item) && card ? { item, via: card.via } : undefined;
159
- });
160
- const lit = $derived([shown?.item.id, revealed, caret, pointer].find((id) => id !== undefined && byId.has(id)));
112
+ const lit = $derived([revealed, caret, pointer].find((id) => id !== undefined && byId.has(id)));
161
113
  const answering = (id, action, chord) => {
162
- if (action === 'reopen') {
114
+ if (action === 'reopen')
163
115
  answered.delete(id);
164
- took.delete(id);
165
- }
166
- else {
167
- if (card?.id === id)
168
- card = undefined;
169
- // An accepted proposal stays, drawn as its change, while the list holds it.
170
- if (action !== 'accept')
171
- answered.add(id);
172
- else if (byId.get(id) && onField(byId.get(id)))
173
- took.add(id);
174
- }
116
+ else
117
+ answered.add(id);
175
118
  answers++;
176
119
  if (chord)
177
120
  source.chorded?.(id);
@@ -180,9 +123,6 @@ export function createReview(source) {
180
123
  get items() {
181
124
  return items;
182
125
  },
183
- get accepted() {
184
- return accepted;
185
- },
186
126
  textAt: (key) => text.get(key) ?? NO_ITEMS,
187
127
  get reports() {
188
128
  return drawn;
@@ -196,9 +136,6 @@ export function createReview(source) {
196
136
  get lit() {
197
137
  return lit;
198
138
  },
199
- get shown() {
200
- return shown;
201
- },
202
139
  at: (key) => fields.get(key) ?? {},
203
140
  marks: (key) => fields.has(key) || !!drawn.get(key)?.ids.length,
204
141
  keyOf(id) {
@@ -223,58 +160,18 @@ export function createReview(source) {
223
160
  drawn.delete(key);
224
161
  },
225
162
  point(id, via, from) {
226
- if (via === 'caret') {
227
- if (id === undefined && from !== undefined && caretFrom !== from)
228
- return;
229
- caretFrom = from;
230
- caret = id;
231
- clearTimeout(rest);
232
- if (changed(id)) {
233
- // A card already up for the item is the caret's from here: it stays while
234
- // the caret does. The caret's card takes the pointer's place.
235
- const raise = () => {
236
- clearTimeout(timer);
237
- card = { id, via };
238
- };
239
- if (card?.id === id)
240
- raise();
241
- else
242
- rest = setTimeout(() => {
243
- if (caret === id)
244
- raise();
245
- }, HOVER_MS);
246
- }
247
- else if (card?.via === 'caret' || (id !== undefined && card))
248
- card = undefined;
249
- if (id !== undefined)
250
- revealed = undefined;
163
+ if (via === 'pointer') {
164
+ pointer = id;
251
165
  return;
252
166
  }
253
- pointer = id;
254
- if (changed(id)) {
255
- if (card?.id === id)
256
- return clearTimeout(timer);
257
- if (card && card.via !== 'pointer')
258
- return;
259
- if (card)
260
- card = { id, via };
261
- else
262
- wait(HOVER_MS, () => {
263
- if (pointer === id && (!card || card.via === 'pointer'))
264
- card = { id, via };
265
- });
266
- }
267
- else if (card?.via === 'pointer' && !held)
268
- wait(LEAVE_MS, () => {
269
- if (card?.via === 'pointer' && card.id !== pointer && !held)
270
- card = undefined;
271
- });
272
- else
273
- clearTimeout(timer);
167
+ if (id === undefined && from !== undefined && caretFrom !== from)
168
+ return;
169
+ caretFrom = from;
170
+ caret = id;
171
+ if (id !== undefined)
172
+ revealed = undefined;
274
173
  },
275
174
  act(id, action, chord) {
276
- if (accepted.has(id) && action === 'reopen')
277
- return source.putBack?.(id) ?? false;
278
175
  const item = byId.get(id);
279
176
  if (!item || !source.answer(id, item, action))
280
177
  return false;
@@ -286,28 +183,8 @@ export function createReview(source) {
286
183
  if (source.answer(id, byId.get(id), action, key))
287
184
  answering(id, action, chord);
288
185
  },
289
- hold() {
290
- held = true;
291
- clearTimeout(timer);
292
- },
293
- release() {
294
- held = false;
295
- if (card?.via === 'pointer' && card.id !== pointer)
296
- wait(LEAVE_MS, () => {
297
- if (!held && card?.via === 'pointer' && card.id !== pointer)
298
- card = undefined;
299
- });
300
- },
301
- dismiss() {
302
- clearTimeout(timer);
303
- clearTimeout(rest);
304
- card = undefined;
305
- },
306
186
  reveal(id) {
307
- clearTimeout(timer);
308
- clearTimeout(rest);
309
187
  clearTimeout(fade);
310
- card = changed(id) ? { id, via: 'reveal' } : undefined;
311
188
  revealed = id;
312
189
  fade = setTimeout(() => {
313
190
  if (revealed === id)
@@ -315,8 +192,6 @@ export function createReview(source) {
315
192
  }, REVEAL_MS);
316
193
  },
317
194
  dispose() {
318
- clearTimeout(timer);
319
- clearTimeout(rest);
320
195
  clearTimeout(fade);
321
196
  }
322
197
  };
@@ -330,13 +205,11 @@ const NO_ITEMS = [];
330
205
  /** What a component rendered outside the editor gets: nothing to draw. */
331
206
  const NO_REVIEW = {
332
207
  items: [],
333
- accepted: new Map(),
334
208
  textAt: () => NO_ITEMS,
335
209
  reports: new Map(),
336
210
  fieldUndrawn: [],
337
211
  fieldOutdated: new Set(),
338
212
  lit: undefined,
339
- shown: undefined,
340
213
  at: () => ({}),
341
214
  marks: () => false,
342
215
  keyOf: () => undefined,
@@ -345,9 +218,6 @@ const NO_REVIEW = {
345
218
  act: () => false,
346
219
  heard() { },
347
220
  writing() { },
348
- hold() { },
349
- release() { },
350
- dismiss() { },
351
221
  reveal() { }
352
222
  };
353
223
  /** The editor's review state, or {@link NO_REVIEW} off-tree. */
@@ -26,23 +26,11 @@ export interface VisualStrings extends TableChromeStrings, SlashStrings, Shortcu
26
26
  groupFlagged: string;
27
27
  /** The same header where a field inside holds an item of review. */
28
28
  groupReviewed: string;
29
- /** The card's button, and the row's: takes the change back. */
30
- reviewUndo: string;
31
- /** Its tooltip, which names the chord. */
32
- reviewUndoTitle: string;
33
- /** The card's accessible name. */
34
- reviewChange: string;
35
29
  /** The toast over a field's proposal taken, beside its way back. */
36
30
  reviewAccepted: string;
37
- /** Before what a change replaced: `Was the old words`. */
38
- reviewWas: string;
39
- /** The whole of the card over text that replaced nothing. */
40
- reviewAdded: string;
41
- /** Before the text a change took out, or the whole of the card where the host kept none. */
42
- reviewRemoved: string;
43
- /** A value that was, or would be, nothing: `Was Empty`. */
31
+ /** A value that was, or would be, nothing. */
44
32
  reviewEmpty: string;
45
- /** A switch's two values, as a card and a row word them. */
33
+ /** A switch's two values, as a row words them. */
46
34
  reviewOn: string;
47
35
  reviewOff: string;
48
36
  /** The toast's notice, named for what went: `Authors 2 removed`. */
@@ -52,13 +52,7 @@ export const DEFAULT_VISUAL_STRINGS = {
52
52
  ...DEFAULT_REVIEW_STRINGS,
53
53
  reviewAcceptTitle: `Accept (${chord('↵')})`,
54
54
  reviewDismissTitle: `Dismiss (${chord('.')})`,
55
- reviewUndo: 'Undo',
56
- reviewUndoTitle: `Undo (${chord('.')})`,
57
- reviewChange: 'Change',
58
55
  reviewAccepted: 'Change accepted',
59
- reviewWas: 'Was',
60
- reviewAdded: 'Added',
61
- reviewRemoved: 'Removed',
62
56
  reviewEmpty: 'Empty',
63
57
  reviewOn: 'On',
64
58
  reviewOff: 'Off',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillmark/svelte",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "Editor, live-preview and source surfaces over a Quillmark WASM session.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,179 +0,0 @@
1
- <!--
2
- The card over a change: what the words or the value replaced, and the one button that takes the
3
- change back. One card, shell-owned, up for whichever `changed` item the review state shows
4
- (`review.svelte.ts`), over a mark in a prose leaf or over a field's control.
5
-
6
- Under its anchor, where the format popover rises over a selection: the two can be up at once,
7
- and what the reader is reading is the line above.
8
-
9
- Focus discipline is the format popover's: the card never takes the focus, so the caret that
10
- raised it stays where it was, and its button swallows its own mousedown for the same reason.
11
- The pointer's card ends on a scroll, the page having moved under a pointer that did not; the
12
- caret's and a reveal's follow their mark, and hide while it is scrolled out of the pane.
13
- -->
14
- <script lang="ts" module>
15
- import type { RangeAnchor } from '../core/codec/index.js';
16
- </script>
17
-
18
- <script lang="ts">
19
- import { Popover } from 'bits-ui';
20
- import { spacePx } from '../core/rungs.js';
21
- import { wording } from './strings.js';
22
- import { reviewText } from './review.js';
23
- import type { Review } from './review.svelte.js';
24
- import './controls.css';
25
-
26
- /** Where item `id` is drawn. */
27
- export interface ReviewTarget {
28
- /** What its card hangs off: a field's control, or a live measure of a mark in a leaf. */
29
- anchor: Element | RangeAnchor;
30
- /** The mark is the wedge that stands where text was only removed. */
31
- removed: boolean;
32
- }
33
-
34
- interface Props {
35
- review: Review;
36
- targetFor: (id: string) => ReviewTarget | undefined;
37
- }
38
- let { review, targetFor }: Props = $props();
39
-
40
- const t = wording();
41
-
42
- const shown = $derived(review.shown);
43
- const target = $derived(shown ? targetFor(shown.item.id) : undefined);
44
- const anchor = $derived(target?.anchor);
45
- const open = $derived(!!shown && !!anchor);
46
- const portalTarget = $derived.by(() => {
47
- const el = anchor && 'contextElement' in anchor ? anchor.contextElement : anchor;
48
- return el?.closest<HTMLElement>('[data-qm-root]') ?? undefined;
49
- });
50
-
51
- /** What the card says: a lead word, and the old words or value where there were any. */
52
- const said = $derived.by(() => {
53
- if (!shown) return undefined;
54
- const { item } = shown;
55
- const s = t.strings;
56
- if ('field' in item) {
57
- const was = reviewText(item.before, { on: s.reviewOn, off: s.reviewOff });
58
- return { lead: s.reviewWas, text: was || s.reviewEmpty, empty: !was };
59
- }
60
- const before = item.before ?? '';
61
- if (target?.removed) return { lead: s.reviewRemoved, text: before, empty: false };
62
- return before
63
- ? { lead: s.reviewWas, text: before, empty: false }
64
- : { lead: s.reviewAdded, text: '', empty: false };
65
- });
66
-
67
- function onScroll(): void {
68
- if (review.shown?.via === 'pointer') review.dismiss();
69
- }
70
- </script>
71
-
72
- <svelte:document onscrollcapture={onScroll} />
73
-
74
- <Popover.Root
75
- {open}
76
- onOpenChange={(next) => {
77
- if (!next) review.dismiss();
78
- }}
79
- >
80
- <Popover.Portal to={portalTarget}>
81
- <Popover.Content
82
- customAnchor={anchor ?? null}
83
- collisionBoundary={portalTarget ?? []}
84
- side="bottom"
85
- align="start"
86
- trapFocus={false}
87
- hideWhenDetached
88
- sideOffset={spacePx(portalTarget, 1)}
89
- onOpenAutoFocus={(e: Event) => e.preventDefault()}
90
- onCloseAutoFocus={(e: Event) => e.preventDefault()}
91
- onInteractOutside={(e: Event) => {
92
- // A press on the mark the card is up for is not a press away from it.
93
- const id = review.shown?.item.id;
94
- const on = e.target instanceof Element ? e.target.closest('[data-qm-review]') : null;
95
- if (id !== undefined && on?.getAttribute('data-qm-review') === id) e.preventDefault();
96
- }}
97
- >
98
- {#snippet child({ props, wrapperProps, open: raised })}
99
- <div {...wrapperProps}>
100
- <!-- svelte-ignore a11y_no_static_element_interactions -->
101
- <!-- The handlers hold the card up while it is in use and add no interaction. -->
102
- <div
103
- {...props}
104
- class="qm-review-card qm-popover-surface"
105
- data-qm-root
106
- role="group"
107
- aria-label={t.strings.reviewChange}
108
- inert={!raised}
109
- onpointerenter={() => review.hold()}
110
- onpointerleave={() => review.release()}
111
- >
112
- {#if said}
113
- <span class="qm-review-said">
114
- <span class="qm-review-lead">{said.lead}</span>
115
- {#if said.text}
116
- <span class={['qm-review-before', { 'qm-review-none': said.empty }]}
117
- >{said.text}</span
118
- >
119
- {/if}
120
- </span>
121
- {/if}
122
- <button
123
- type="button"
124
- class="qm-chip qm-review-undo qm-focus-ring"
125
- title={t.strings.reviewUndoTitle}
126
- onmousedown={(e) => e.preventDefault()}
127
- onclick={() => shown && review.act(shown.item.id, 'reopen')}
128
- >{t.strings.reviewUndo}</button
129
- >
130
- </div>
131
- </div>
132
- {/snippet}
133
- </Popover.Content>
134
- </Popover.Portal>
135
- </Popover.Root>
136
-
137
- <style>
138
- /* The lift, the translucency and the scale-in are `.qm-popover-surface`'s (controls.css).
139
- A row: what was, then the way back, the button holding its place at the top of a card
140
- whose old words wrap. The measure caps a long passage at a few lines, which is a
141
- reminder of what stood there rather than a second copy of the page. */
142
- .qm-review-card {
143
- display: flex;
144
- align-items: flex-start;
145
- gap: var(--_qm-space-3);
146
- max-width: min(24rem, 90vw);
147
- padding: var(--_qm-space) var(--_qm-space) var(--_qm-space) var(--_qm-space-3);
148
- font-size: var(--_qm-text-label);
149
- line-height: var(--_qm-leading-tight);
150
- color: var(--_qm-ink);
151
- }
152
- .qm-review-said {
153
- display: -webkit-box;
154
- -webkit-box-orient: vertical;
155
- -webkit-line-clamp: 4;
156
- line-clamp: 4;
157
- overflow: hidden;
158
- min-width: 0;
159
- /* The button's own height less this line's, halved: one line of words centres on it. */
160
- padding-block: calc((var(--_qm-tap-min) - 1lh) / 2);
161
- overflow-wrap: anywhere;
162
- }
163
- .qm-review-lead {
164
- color: var(--_qm-ink-label);
165
- }
166
- .qm-review-before {
167
- margin-inline-start: var(--_qm-space);
168
- white-space: pre-wrap;
169
- }
170
- .qm-review-none {
171
- color: var(--_qm-ink-label);
172
- font-style: italic;
173
- }
174
- .qm-review-undo {
175
- flex-shrink: 0;
176
- font-weight: var(--_qm-weight-mid);
177
- color: var(--_qm-ink);
178
- }
179
- </style>
@@ -1,16 +0,0 @@
1
- import type { RangeAnchor } from '../core/codec/index.js';
2
- import type { Review } from './review.svelte.js';
3
- /** Where item `id` is drawn. */
4
- export interface ReviewTarget {
5
- /** What its card hangs off: a field's control, or a live measure of a mark in a leaf. */
6
- anchor: Element | RangeAnchor;
7
- /** The mark is the wedge that stands where text was only removed. */
8
- removed: boolean;
9
- }
10
- interface Props {
11
- review: Review;
12
- targetFor: (id: string) => ReviewTarget | undefined;
13
- }
14
- declare const ReviewPopover: import("svelte").Component<Props, {}, "">;
15
- type ReviewPopover = ReturnType<typeof ReviewPopover>;
16
- export default ReviewPopover;