@estiva-app/conversation 0.23.0 → 0.24.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/CHANGELOG.md +55 -0
- package/README.md +3 -2
- package/dist/boxCard.d.ts +25 -6
- package/dist/boxCard.d.ts.map +1 -1
- package/dist/boxCard.js +27 -9
- package/dist/boxCard.js.map +1 -1
- package/dist/composer.d.ts.map +1 -1
- package/dist/composer.js +33 -1
- package/dist/composer.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/openingWords.d.ts +45 -1
- package/dist/openingWords.d.ts.map +1 -1
- package/dist/openingWords.js +83 -17
- package/dist/openingWords.js.map +1 -1
- package/dist/references.d.ts +36 -1
- package/dist/references.d.ts.map +1 -1
- package/dist/references.js +39 -2
- package/dist/references.js.map +1 -1
- package/package.json +1 -1
- package/src/boxCard.ts +38 -9
- package/src/composer.ts +34 -1
- package/src/index.ts +6 -2
- package/src/openingWords.ts +109 -17
- package/src/references.ts +69 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,61 @@ none. A change to how an event is read is a MINOR in `0.x` even when no
|
|
|
6
6
|
signature moved, because two apps on different versions would then disagree
|
|
7
7
|
about a conversation.
|
|
8
8
|
|
|
9
|
+
## 0.24.0 — 2026-10-30
|
|
10
|
+
|
|
11
|
+
Three of Katerina's calls from the widget review (30 October), once for
|
|
12
|
+
every app.
|
|
13
|
+
|
|
14
|
+
**`[` lists Files first, and finds a message by its own words** (item 19).
|
|
15
|
+
`referenceSectionsOf(ranked)` gives `rankReferences`' two sections in the
|
|
16
|
+
order every app draws them: Files, then Messages (CON-26's ranking had
|
|
17
|
+
Messages above Files, so typing a file's word picked a message instead).
|
|
18
|
+
`messageCandidate(message, tier, nameOf, { resolveLink })` builds a
|
|
19
|
+
message's row as Peek, Ship and Leaf each built their own: its reference,
|
|
20
|
+
its author, its opening words as the caption, and `messageWords(body,
|
|
21
|
+
nameOf)` to be found by — what its writer wrote, with no URL and no type
|
|
22
|
+
word for a file or message it names, so a message is no longer found by the
|
|
23
|
+
raw text of a link in it. Each app passed the raw body as `search`.
|
|
24
|
+
|
|
25
|
+
**A link in a message preview reads as what it names** (item 20).
|
|
26
|
+
`openingWords(body, nameOf, { resolveLink })` reads a bare app URL the app
|
|
27
|
+
has resolved (§7.7) as the reference it names, "Issue" or "Message", as its
|
|
28
|
+
chip would (§13.6.2, "A bare app link reads as a reference"), never as the
|
|
29
|
+
raw URL. One nothing claims, one not answered yet, one in code and one in a
|
|
30
|
+
link's words stay as written. Without `resolveLink` it reads as before.
|
|
31
|
+
|
|
32
|
+
**An edit box shows the message's card, with its ✕** (item 36). With the
|
|
33
|
+
message's folded `embed` set as `folded`, `boxLinksOf` and `boxReadOf` give
|
|
34
|
+
the edit box the card the message has, while the edit still names its file,
|
|
35
|
+
so it can be seen and taken off there; otherwise, as before, the default
|
|
36
|
+
for a file the edit names first. A value the set holds as `none` (✕ after
|
|
37
|
+
sending) gets no default again, even when its link is taken out and put
|
|
38
|
+
back: a card taken off stays off (SPEC §13.6.2 lets a writer give it one;
|
|
39
|
+
these apps no longer do). `embedsToEdit` follows: the message's own card
|
|
40
|
+
kept leaves the set as it was (`undefined`, where it carried the set with
|
|
41
|
+
that card `detailed`, which draws the same); ✕ on it sets it `none` — which
|
|
42
|
+
also fixes ✕ on a link put back whose card the set still carried, which
|
|
43
|
+
used to keep the card.
|
|
44
|
+
|
|
45
|
+
SPEC: none changed. Nothing is read differently; what an edit writes stays
|
|
46
|
+
within §13.6.2's "The default on an edit".
|
|
47
|
+
|
|
48
|
+
## 0.23.1 — 2026-10-30
|
|
49
|
+
|
|
50
|
+
**A word typed right after a chip is sent a space apart from it.** A chip
|
|
51
|
+
is written as its address: a URL chip as its URL, a person or a message as
|
|
52
|
+
its `nostr:` URI. A word typed straight after it, with no space, was written
|
|
53
|
+
onto that address (`…/p/<id>test`), which names nothing, so every app drew
|
|
54
|
+
it as a plain web link (Katerina, 2026-10-30). `composerText` now puts a space
|
|
55
|
+
between a chip and what follows it when that would read as more of the
|
|
56
|
+
address, by protocol's `continuesUrl` rule: anything but a space, a
|
|
57
|
+
sentence's closing punctuation before a space or the end, or a character an
|
|
58
|
+
address never holds (`<`, `>`, a quote or a backtick). Two chips side by
|
|
59
|
+
side get one too.
|
|
60
|
+
|
|
61
|
+
SPEC: none changed. The reader is as it was; what is written now reads back
|
|
62
|
+
as the chip that was in the box, by a reader of any version.
|
|
63
|
+
|
|
9
64
|
## 0.23.0 — 2026-10-29
|
|
10
65
|
|
|
11
66
|
**A merge that is missing a slot says so** (PEE-68). `fetchReadState`
|
package/README.md
CHANGED
|
@@ -27,8 +27,9 @@ pass, the clock is a `createdAtMs` you pass, and drafts take their storage.
|
|
|
27
27
|
| writing | §6.4, §13.6 | `buildComment`, `buildReply`, `placeOf`, `referenceTagsFor`, `mentionTagsFor` |
|
|
28
28
|
| what a composer's pick writes | §13.1 | `mentionText`, `messageReference`, `urgentTagsFor`, `URGENT_TAG` |
|
|
29
29
|
| what the shared comment box holds, as the message it writes, and back | §13.1 | `composerText`, `composerDocument`, `withoutNewUrgency`, `composerDraft` |
|
|
30
|
-
| what a box shows under itself while a comment is written: the one file's card and each block link's part, and the `embed` a send or an edit writes | §13.6.1, §13.6.2 | `boxReadOf`, `boxLinksOf`, `embedsToSend`, `embedsToEdit`, `namedBefore`, `withoutCard`, `linkTargetOf` |
|
|
31
|
-
| what `[` offers, and in what order | §13.1 | `rankReferences`, `referenceMatch`, `fileReference`, `referenceSearch`, `MESSAGE_TIER`, `FILE_TIER`, `REFERENCE_CAPS` |
|
|
30
|
+
| what a box shows under itself while a comment is written or edited: the one file's card (an edit's own card, with its ✕) and each block link's part, and the `embed` a send or an edit writes | §13.6.1, §13.6.2 | `boxReadOf`, `boxLinksOf`, `embedsToSend`, `embedsToEdit`, `namedBefore`, `withoutCard`, `linkTargetOf` |
|
|
31
|
+
| what `[` offers, and in what order: Files, then Messages, a message found by its own words | §13.1 | `rankReferences`, `referenceSectionsOf`, `messageCandidate`, `referenceMatch`, `fileReference`, `referenceSearch`, `MESSAGE_TIER`, `FILE_TIER`, `REFERENCE_CAPS` |
|
|
32
|
+
| a message as a preview line says it, a link as what it names; the words it is found by | §13.1, §13.6.2 | `openingWords`, `referenceWord`, `messageWords` |
|
|
32
33
|
| ordering | §6.2, §6.3 | `trustedTs`, `orderingMs`, `byOrder` |
|
|
33
34
|
| edits and attachments | §6.8 | `editTargetOf`, `foldEdits`, `foldAttachments` |
|
|
34
35
|
| reactions | §6.6 | `REACTION_HORIZON`, `reactionHorizon`, `reactionTargetOf`, `reactionEmojiOf`, `foldReactions` |
|
package/dist/boxCard.d.ts
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
* a Folder, a person, a message and the file the conversation is on do not
|
|
10
10
|
* count, a link on words counts by its target, and a plain web link counts
|
|
11
11
|
* for nothing. ✕ takes it off (the box's to keep).
|
|
12
|
+
* - **An edit's card.** The message's own card while the edit still names its
|
|
13
|
+
* file, with its ✕, so it can be seen and taken off there; otherwise the
|
|
14
|
+
* default for a file the edit names first. A card taken off before, with ✕
|
|
15
|
+
* on the sent message, never comes back in an edit (Katerina, 2026-10-30,
|
|
16
|
+
* widget review item 36).
|
|
12
17
|
* - **The live part of each block link**, as the `part` the message will
|
|
13
18
|
* carry, one per file. A part counts as its file and draws instead of a card,
|
|
14
19
|
* so linking an issue and a block of a page shows the block and no card. A
|
|
@@ -28,7 +33,12 @@ export interface BoxLinks {
|
|
|
28
33
|
values: string[];
|
|
29
34
|
/** The block links' parts, one per file, the first link's; none of the conversation's own file. */
|
|
30
35
|
parts: PartPointer[];
|
|
31
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* The card under the box, before any ✕: for a new message, the file that
|
|
38
|
+
* gets the default card; for an edit (`folded` given), the message's own
|
|
39
|
+
* card while the edit still names it, else the default for a file the edit
|
|
40
|
+
* names first.
|
|
41
|
+
*/
|
|
32
42
|
card?: string;
|
|
33
43
|
/**
|
|
34
44
|
* Every URL the text names, bare or as a link's target, once each: what the
|
|
@@ -45,6 +55,13 @@ export interface BoxLinkContext {
|
|
|
45
55
|
here?: string;
|
|
46
56
|
/** An edit's: the values the message named before it, which get no default again. */
|
|
47
57
|
previous?: readonly string[];
|
|
58
|
+
/**
|
|
59
|
+
* An edit's: the message's folded `embed` set (`foldEmbeds`). Its card shows
|
|
60
|
+
* under the box while the edit names its file, and a value it holds as
|
|
61
|
+
* `none` — a card taken off with ✕ after sending — gets no default again,
|
|
62
|
+
* even named afresh.
|
|
63
|
+
*/
|
|
64
|
+
folded?: readonly Embed[];
|
|
48
65
|
}
|
|
49
66
|
/**
|
|
50
67
|
* What an app link in the box draws as: the file or message it names, or, for
|
|
@@ -52,7 +69,7 @@ export interface BoxLinkContext {
|
|
|
52
69
|
* file's chip, the block live under the box.
|
|
53
70
|
*/
|
|
54
71
|
export declare function linkTargetOf(url: string, context: Pick<BoxLinkContext, 'resolveLink' | 'blockOf'>): string | undefined;
|
|
55
|
-
/** What a marker text names, and the one
|
|
72
|
+
/** What a marker text names, and the one card it shows under the box. */
|
|
56
73
|
export declare function boxLinksOf(text: string, context: BoxLinkContext): BoxLinks;
|
|
57
74
|
/** {@link boxLinksOf} of a composer's document (`CommentBox`'s JSON), read as {@link composerText} writes it. */
|
|
58
75
|
export declare function boxReadOf(doc: EditorDocument | EditorNode, context: BoxLinkContext): BoxLinks;
|
|
@@ -65,10 +82,12 @@ export declare function namedBefore(text: string, context: Pick<BoxLinkContext,
|
|
|
65
82
|
export declare function embedsToSend(links: Pick<BoxLinks, 'card'>, removed: ReadonlySet<string>): Embed[];
|
|
66
83
|
/**
|
|
67
84
|
* The `embed` set an edit sends, or undefined to leave the message's as it
|
|
68
|
-
* was.
|
|
69
|
-
*
|
|
70
|
-
* set
|
|
71
|
-
*
|
|
85
|
+
* was. `links` is read with `previous` and `folded`, so its card is the
|
|
86
|
+
* message's own or the default for a file the edit names first. The message's
|
|
87
|
+
* own card, kept, leaves the set as it was; taken off with ✕ in the edit box,
|
|
88
|
+
* it is set `none`. A file named first adds its default; ✕ on that one writes
|
|
89
|
+
* nothing. Either way the whole folded set goes with it, since a set replaces
|
|
90
|
+
* (§13.6.2), and a card removed with ✕, before sending or after, stays removed.
|
|
72
91
|
*/
|
|
73
92
|
export declare function embedsToEdit(links: Pick<BoxLinks, 'card'>, removed: ReadonlySet<string>, folded: readonly Embed[] | undefined): Embed[] | undefined;
|
|
74
93
|
/** ✕ on a sent message's card: the folded set, with that card `none` and every other kept. */
|
package/dist/boxCard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boxCard.d.ts","sourceRoot":"","sources":["../src/boxCard.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"boxCard.d.ts","sourceRoot":"","sources":["../src/boxCard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAA;AAG7B,2EAA2E;AAC3E,eAAO,MAAM,SAAS,IAAI,CAAA;AAE1B,MAAM,WAAW,QAAQ;IACvB,iDAAiD;IACjD,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,mGAAmG;IACnG,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,IAAI,EAAE,MAAM,EAAE,CAAA;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,WAAW,EAAE,YAAY,CAAA;IACzB,wEAAwE;IACxE,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,WAAW,GAAG,SAAS,CAAA;IACjD,yFAAyF;IACzF,IAAI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9,11 @@
|
|
|
9
9
|
* a Folder, a person, a message and the file the conversation is on do not
|
|
10
10
|
* count, a link on words counts by its target, and a plain web link counts
|
|
11
11
|
* for nothing. ✕ takes it off (the box's to keep).
|
|
12
|
+
* - **An edit's card.** The message's own card while the edit still names its
|
|
13
|
+
* file, with its ✕, so it can be seen and taken off there; otherwise the
|
|
14
|
+
* default for a file the edit names first. A card taken off before, with ✕
|
|
15
|
+
* on the sent message, never comes back in an edit (Katerina, 2026-10-30,
|
|
16
|
+
* widget review item 36).
|
|
12
17
|
* - **The live part of each block link**, as the `part` the message will
|
|
13
18
|
* carry, one per file. A part counts as its file and draws instead of a card,
|
|
14
19
|
* so linking an issue and a block of a page shows the block and no card. A
|
|
@@ -20,7 +25,7 @@
|
|
|
20
25
|
*
|
|
21
26
|
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-link-on-words-counts-toward-the-card.md
|
|
22
27
|
*/
|
|
23
|
-
import { defaultCardOf, toRenderTree, valuesIn, withCard, } from '@estiva-app/protocol';
|
|
28
|
+
import { cardsIn, defaultCardOf, toRenderTree, valuesIn, withCard, } from '@estiva-app/protocol';
|
|
24
29
|
import { composerText } from './composer.js';
|
|
25
30
|
/** At most this many blocks show live under one message (SPEC §13.6.1). */
|
|
26
31
|
export const MAX_PARTS = 6;
|
|
@@ -32,13 +37,14 @@ export const MAX_PARTS = 6;
|
|
|
32
37
|
export function linkTargetOf(url, context) {
|
|
33
38
|
return context.resolveLink(url) ?? context.blockOf(url)?.address;
|
|
34
39
|
}
|
|
35
|
-
/** What a marker text names, and the one
|
|
40
|
+
/** What a marker text names, and the one card it shows under the box. */
|
|
36
41
|
export function boxLinksOf(text, context) {
|
|
37
42
|
// valuesIn asks the resolver about exactly the URLs a reader counts (not one
|
|
38
43
|
// in a code span, nor one in a link's words), so recording its questions
|
|
39
44
|
// gives the URLs without a second URL finder.
|
|
40
45
|
const urls = [];
|
|
41
|
-
const
|
|
46
|
+
const tree = text ? toRenderTree(text, 'marker') : [];
|
|
47
|
+
const values = valuesIn(tree, (url) => {
|
|
42
48
|
if (!urls.includes(url))
|
|
43
49
|
urls.push(url);
|
|
44
50
|
return context.resolveLink(url);
|
|
@@ -50,7 +56,12 @@ export function boxLinksOf(text, context) {
|
|
|
50
56
|
parts.set(part.address, part);
|
|
51
57
|
}
|
|
52
58
|
const kept = [...parts.values()].slice(0, MAX_PARTS);
|
|
53
|
-
const
|
|
59
|
+
const folded = context.folded ?? [];
|
|
60
|
+
// The card a reader draws under the message once the edit is saved: the first its folded set holds for what the edit names.
|
|
61
|
+
const current = cardsIn(folded, tree, kept, context.resolveLink).find((embed) => embed.layout !== 'none')?.value;
|
|
62
|
+
const takenOff = folded.filter((embed) => embed.layout === 'none').map((embed) => embed.value);
|
|
63
|
+
const previous = takenOff.length > 0 ? [...(context.previous ?? []), ...takenOff] : context.previous;
|
|
64
|
+
const card = current ?? defaultCardOf(values, kept, { here: context.here, previous });
|
|
54
65
|
return { values, parts: kept, card, urls };
|
|
55
66
|
}
|
|
56
67
|
/** {@link boxLinksOf} of a composer's document (`CommentBox`'s JSON), read as {@link composerText} writes it. */
|
|
@@ -72,13 +83,20 @@ export function embedsToSend(links, removed) {
|
|
|
72
83
|
}
|
|
73
84
|
/**
|
|
74
85
|
* The `embed` set an edit sends, or undefined to leave the message's as it
|
|
75
|
-
* was.
|
|
76
|
-
*
|
|
77
|
-
* set
|
|
78
|
-
*
|
|
86
|
+
* was. `links` is read with `previous` and `folded`, so its card is the
|
|
87
|
+
* message's own or the default for a file the edit names first. The message's
|
|
88
|
+
* own card, kept, leaves the set as it was; taken off with ✕ in the edit box,
|
|
89
|
+
* it is set `none`. A file named first adds its default; ✕ on that one writes
|
|
90
|
+
* nothing. Either way the whole folded set goes with it, since a set replaces
|
|
91
|
+
* (§13.6.2), and a card removed with ✕, before sending or after, stays removed.
|
|
79
92
|
*/
|
|
80
93
|
export function embedsToEdit(links, removed, folded) {
|
|
81
|
-
|
|
94
|
+
if (!links.card)
|
|
95
|
+
return undefined;
|
|
96
|
+
const own = (folded ?? []).some((embed) => embed.value === links.card && embed.layout !== 'none');
|
|
97
|
+
if (removed.has(links.card))
|
|
98
|
+
return own ? withCard(folded ?? [], links.card, 'none') : undefined;
|
|
99
|
+
return own ? undefined : withCard(folded ?? [], links.card, 'detailed');
|
|
82
100
|
}
|
|
83
101
|
/** ✕ on a sent message's card: the folded set, with that card `none` and every other kept. */
|
|
84
102
|
export function withoutCard(folded, value) {
|
package/dist/boxCard.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boxCard.js","sourceRoot":"","sources":["../src/boxCard.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"boxCard.js","sourceRoot":"","sources":["../src/boxCard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,QAAQ,GAMT,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C,2EAA2E;AAC3E,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAA;AAuC1B;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,OAAwD;IAChG,OAAO,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,CAAA;AAClE,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,OAAuB;IAC9D,6EAA6E;IAC7E,yEAAyE;IACzE,8CAA8C;IAC9C,MAAM,IAAI,GAAa,EAAE,CAAA;IACzB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IACrD,MAAM,MAAM,GAAG,QAAQ,CAAC,I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AClC,gEAAgE;IAChE,KAAK,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI,CAAA;IAChC,KAAK,IAAI,IAAI,CAAA;CACd;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAE,cAAmB,GAAG,aAAa,CAcxG"}
|
package/dist/composer.js
CHANGED
|
@@ -90,6 +90,38 @@ function chipsAsReferences(node) {
|
|
|
90
90
|
}
|
|
91
91
|
return node.content ? { ...node, content: node.content.map(chipsAsReferences) } : node;
|
|
92
92
|
}
|
|
93
|
+
/** The chips a message writes as an address: a URL chip or a `nostr:` reference, a person, a message. */
|
|
94
|
+
const ADDRESS_CHIPS = new Set(['reference', 'mention', 'urgentMention', 'captionedReference']);
|
|
95
|
+
/**
|
|
96
|
+
* Whether text written right after a chip's address would be read as more of
|
|
97
|
+
* it: anything but a space, a sentence's closing punctuation before a space or
|
|
98
|
+
* the end, or a character an address never holds (protocol's `continuesUrl`).
|
|
99
|
+
*/
|
|
100
|
+
const runsOn = (text) => text !== '' && !/^(\s|[.,;:!?)\]]+(\s|$))/.test(text) && !/^[<>"'`]/.test(text);
|
|
101
|
+
/**
|
|
102
|
+
* A space between a chip and what was typed right after it, where that would
|
|
103
|
+
* run on into its address. "test" typed after a chip with no space was sent as
|
|
104
|
+
* `…/p/<id>test`, which names nothing, and drew as a plain web link (Katerina,
|
|
105
|
+
* 2026-10-30); the box showed the chip, then the word.
|
|
106
|
+
*/
|
|
107
|
+
function spacedAfterChips(node) {
|
|
108
|
+
if (!node.content)
|
|
109
|
+
return node;
|
|
110
|
+
const content = [];
|
|
111
|
+
for (const child of node.content.map(spacedAfterChips)) {
|
|
112
|
+
const last = content[content.length - 1];
|
|
113
|
+
if (last && ADDRESS_CHIPS.has(last.type)) {
|
|
114
|
+
if (child.type === 'text' && child.text !== undefined && runsOn(child.text)) {
|
|
115
|
+
content.push({ ...child, text: ` ${child.text}` });
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (ADDRESS_CHIPS.has(child.type))
|
|
119
|
+
content.push({ type: 'text', text: ' ' });
|
|
120
|
+
}
|
|
121
|
+
content.push(child);
|
|
122
|
+
}
|
|
123
|
+
return { ...node, content };
|
|
124
|
+
}
|
|
93
125
|
/**
|
|
94
126
|
* The message a composer's document writes: its marker text, trimmed, and the
|
|
95
127
|
* keys its urgent chips name. A document with no blocks (an edit of a message
|
|
@@ -109,7 +141,7 @@ export function composerText(doc) {
|
|
|
109
141
|
node.content?.forEach(walk);
|
|
110
142
|
};
|
|
111
143
|
walk(doc);
|
|
112
|
-
const text = doc.content?.length ? blockDocumentToMarkerText(fromEditorDocument(chipsAsReferences(doc))).trim() : '';
|
|
144
|
+
const text = doc.content?.length ? blockDocumentToMarkerText(fromEditorDocument(chipsAsReferences(spacedAfterChips(doc)))).trim() : '';
|
|
113
145
|
return urgent.size > 0 ? { text, urgent: [...urgent] } : { text };
|
|
114
146
|
}
|
|
115
147
|
/** A reference that carries nothing a chip would drop: no marks, no card, no URL. */
|
package/dist/composer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composer.js","sourceRoot":"","sources":["../src/composer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,GAGjB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAU1C,MAAM,OAAO,GAAG,gBAAgB,CAAA;AAEhC,MAAM,KAAK,GAAG,CAAC,IAAgB,EAAiB,EAAE;IAChD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,CAAA;IACjC,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,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AAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAA;AAChH,CAAC;AAWD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAAiB,EAAE,GAAW,EAAE,SAAyB,EAAE;IACvF,OAAO;QACL,IAAI;YACF,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;YAClC,OAAO,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACpG,CAAC;QACD,KAAK,CAAC,GAAG;YACP,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,GAAG,CAAC,CAAA;YAC1C,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;QAChC,CAAC;QACD,KAAK;YACH,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAClB,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* apps: it imports no app's data layer, opens no socket, and takes every
|
|
13
13
|
* environment touch — the relay read, the clock, storage — as a parameter.
|
|
14
14
|
*/
|
|
15
|
-
export declare const CONVERSATION_VERSION = "0.
|
|
15
|
+
export declare const CONVERSATION_VERSION = "0.24.0";
|
|
16
16
|
export { KIND_MESSAGE, KIND_COMMENT, KIND_EDIT, KIND_REACTION, KIND_DELETION, KIND_ASSERTION, isConversationKind, isEventId, } from './kinds.js';
|
|
17
17
|
export { trustedTs, orderingMs, byOrder } from './order.js';
|
|
18
18
|
export { namedInBody, isReply, anchorsOf, isCommentOn, referencesAddress, strengthOn, threadStrength, referenceTagsFor, mentionTagsFor, peopleNamedInBody, MAX_MENTIONED_PEOPLE, type Strength, } from './strength.js';
|
|
@@ -24,13 +24,13 @@ export { buildComment, buildReply, offersEditAndDelete, placeOf, type CommentRef
|
|
|
24
24
|
export { eventsNamedInBody, mentionText, messageReference, quoteTagsFor, URGENT_TAG, urgentTagsFor } from './compose.js';
|
|
25
25
|
export { composerDocument, composerDraft, composerText, withoutNewUrgency, type ComposerDraft, type ComposerLabels, type ComposerText, } from './composer.js';
|
|
26
26
|
export { MAX_PARTS, boxLinksOf, boxReadOf, embedsToEdit, embedsToSend, linkTargetOf, namedBefore, withoutCard, type BoxLinkContext, type BoxLinks, } from './boxCard.js';
|
|
27
|
-
export { FILE_TIER, fileReference, MESSAGE_TIER, rankReferences, REFERENCE_CAPS, referenceMatch, referenceSearch, refMatch, type RankedReferences, type RankReferencesInput, type ReferenceCandidate, type ReferenceSearch, type ReferenceSearchFn, type ReferenceSearchOptions, type ReferenceType, } from './references.js';
|
|
27
|
+
export { FILE_TIER, fileReference, MESSAGE_TIER, messageCandidate, rankReferences, REFERENCE_CAPS, referenceMatch, referenceSearch, referenceSectionsOf, refMatch, type RankedReferences, type RankedSection, type RankReferencesInput, type ReferableMessage, type ReferenceCandidate, type ReferenceSearch, type ReferenceSearchFn, type ReferenceSearchOptions, type ReferenceType, } from './references.js';
|
|
28
28
|
export { KIND_CHANGE, MEMBER_FIELD_PREFIX, memberField, memberOfField, mentions, streamOf, membershipOf, membersOf, membershipFilters, candidateFilesOf, buildMembershipChange, MUTED_D_TAG, APPDATA_TAG, parseMutedBlob, serializeMutedBlob, buildMutedEvent, mutedFilter, mutedFromFollowed, type Membership, type MutedList, } from './membership.js';
|
|
29
29
|
export { READ_STATE_TAG, READ_STATE_D_PREFIX, MAX_CONTEXTS, MAX_CONTEXT_ID_BYTES, MAX_TIMESTAMP, MAX_CLIENT_ID_BYTES, MAX_BLOB_BYTES, MAX_CONTEXTS_BYTES, READ_STATE_HORIZON_DAYS, channelContext, fileContext, threadContext, messageContext, toContextSeconds, isPublishableContextId, loadSlotIdentity, rotateSlotId, readStateDTag, parseReadStateBlob, serializeReadStateBlob, capContextsToBytes, capReadStateContexts, THREAD_RULE_FROM, REPLY_FLOOR_CONTEXT, advanceContexts, buildReadStateEvent, allSlotsFilter, mergeSlots, classifyOwnSlots, effectiveReadAt, threadReadAt, belowReplyFloor, fetchReadState, createSlotCache, publishReadState, type SlotCache, type SlotIdentity, type SlotStorage, type SlotSource, type RandomBytes, type ReadStateBlob, type CappedContexts, type SlotBlob, type OwnSlotVerdict, type Nip44, type FetchedReadState, } from './readState.js';
|
|
30
30
|
export { unreadIn, isUnread, type StreamJudge } from './unread.js';
|
|
31
31
|
export { peopleNamedInText, newlyNamedPeople, mentionAddsFor, type FileText } from './textMentions.js';
|
|
32
32
|
export { KIND_MEMBERSHIP_LIST, namedProfilesOf, rosterOf, byName, mentionablePeople, type NamedProfile } from './people.js';
|
|
33
|
-
export { openingWords, referenceWord } from './openingWords.js';
|
|
33
|
+
export { messageWords, openingWords, referenceWord, type OpeningWordsOptions } from './openingWords.js';
|
|
34
34
|
export { archivedLine } from './archivedLine.js';
|
|
35
35
|
export { createDraftStore, draftKeys, NO_DRAFTS, DRAFT_MAX_AGE_MS, DRAFT_MAX_CHARS, type Draft, type DraftStore, type DraftStorage, } from './drafts.js';
|
|
36
36
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,WAAW,CAAA;AAE5C,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,aAAa,EACb,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,SAAS,GACV,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,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AO,EACL,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,aAAa,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* apps: it imports no app's data layer, opens no socket, and takes every
|
|
13
13
|
* environment touch — the relay read, the clock, storage — as a parameter.
|
|
14
14
|
*/
|
|
15
|
-
export const CONVERSATION_VERSION = '0.
|
|
15
|
+
export const CONVERSATION_VERSION = '0.24.0';
|
|
16
16
|
export { KIND_MESSAGE, KIND_COMMENT, KIND_EDIT, KIND_REACTION, KIND_DELETION, KIND_ASSERTION, isConversationKind, isEventId, } from './kinds.js';
|
|
17
17
|
export { trustedTs, orderingMs, byOrder } from './order.js';
|
|
18
18
|
export { namedInBody, isReply, anchorsOf, isCommentOn, referencesAddress, strengthOn, threadStrength, referenceTagsFor, mentionTagsFor, peopleNamedInBody, MAX_MENTIONED_PEOPLE, } from './strength.js';
|
|
@@ -24,13 +24,13 @@ export { buildComment, buildReply, offersEditAndDelete, placeOf } from './builde
|
|
|
24
24
|
export { eventsNamedInBody, mentionText, messageReference, quoteTagsFor, URGENT_TAG, urgentTagsFor } from './compose.js';
|
|
25
25
|
export { composerDocument, composerDraft, composerText, withoutNewUrgency, } from './composer.js';
|
|
26
26
|
export { MAX_PARTS, boxLinksOf, boxReadOf, embedsToEdit, embedsToSend, linkTargetOf, namedBefore, withoutCard, } from './boxCard.js';
|
|
27
|
-
export { FILE_TIER, fileReference, MESSAGE_TIER, rankReferences, REFERENCE_CAPS, referenceMatch, referenceSearch, refMatch, } from './references.js';
|
|
27
|
+
export { FILE_TIER, fileReference, MESSAGE_TIER, messageCandidate, rankReferences, REFERENCE_CAPS, referenceMatch, referenceSearch, referenceSectionsOf, refMatch, } from './references.js';
|
|
28
28
|
export { KIND_CHANGE, MEMBER_FIELD_PREFIX, memberField, memberOfField, mentions, streamOf, membershipOf, membersOf, membershipFilters, candidateFilesOf, buildMembershipChange, MUTED_D_TAG, APPDATA_TAG, parseMutedBlob, serializeMutedBlob, buildMutedEvent, mutedFilter, mutedFromFollowed, } from './membership.js';
|
|
29
29
|
export { READ_STATE_TAG, READ_STATE_D_PREFIX, MAX_CONTEXTS, MAX_CONTEXT_ID_BYTES, MAX_TIMESTAMP, MAX_CLIENT_ID_BYTES, MAX_BLOB_BYTES, MAX_CONTEXTS_BYTES, READ_STATE_HORIZON_DAYS, channelContext, fileContext, threadContext, messageContext, toContextSeconds, isPublishableContextId, loadSlotIdentity, rotateSlotId, readStateDTag, parseReadStateBlob, serializeReadStateBlob, capContextsToBytes, capReadStateContexts, THREAD_RULE_FROM, REPLY_FLOOR_CONTEXT, advanceContexts, buildReadStateEvent, allSlotsFilter, mergeSlots, classifyOwnSlots, effectiveReadAt, threadReadAt, belowReplyFloor, fetchReadState, createSlotCache, publishReadState, } from './readState.js';
|
|
30
30
|
export { unreadIn, isUnread } from './unread.js';
|
|
31
31
|
export { peopleNamedInText, newlyNamedPeople, mentionAddsFor } from './textMentions.js';
|
|
32
32
|
export { KIND_MEMBERSHIP_LIST, namedProfilesOf, rosterOf, byName, mentionablePeople } from './people.js';
|
|
33
|
-
export { openingWords, referenceWord } from './openingWords.js';
|
|
33
|
+
export { messageWords, openingWords, referenceWord } from './openingWords.js';
|
|
34
34
|
export { archivedLine } from './archivedLine.js';
|
|
35
35
|
export { createDraftStore, draftKeys, NO_DRAFTS, DRAFT_MAX_AGE_MS, DRAFT_MAX_CHARS, } from './drafts.js';
|
|
36
36
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAA;AAE5C,OAAO,EACL,YAAY,EACZ,YAAY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EAA4B,MAAM,mBAAmB,CAAA;AAEvG,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,eAAe,GAIhB,MAAM,aAAa,CAAA"}
|
package/dist/openingWords.d.ts
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A message's opening words, as a caption — what `[`'s row for a comment
|
|
3
|
+
* shows under its author, and any preview of a message, the same in every app
|
|
4
|
+
* (PEEKM-6).
|
|
5
|
+
*
|
|
6
|
+
* One line of plain words: marks and line prefixes gone, a link on words as
|
|
7
|
+
* its words, a fenced code block's fences dropped. A `nostr:` reference reads
|
|
8
|
+
* as its chip would without resolving anything (SPEC §13.1: "the URI's own
|
|
9
|
+
* label or its shortened form, never blank"):
|
|
10
|
+
*
|
|
11
|
+
* - a person as `@Name`, or `@` and the key's shortened form when nobody here
|
|
12
|
+
* can name them;
|
|
13
|
+
* - a message as "Message", a file by its type word ("Issue", "Project",
|
|
14
|
+
* "Topic", "Document"), any other address as "File" — never by its title,
|
|
15
|
+
* so the same comment reads the same in an app that has the file loaded and
|
|
16
|
+
* one that does not (Miky, 27 October, PEEKM-6's kickoff).
|
|
17
|
+
*
|
|
18
|
+
* A bare app URL that names a file or a message reads as that reference would
|
|
19
|
+
* (§13.6.2, "A bare app link reads as a reference"), never as the raw URL
|
|
20
|
+
* (Katerina, 30 October, widget review item 20). A URL nothing claims stays
|
|
21
|
+
* as written (§13.1), and so does one in code.
|
|
22
|
+
*
|
|
23
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-conversation-is-one-shared-thing-and-only-its-colours-are-the-apps.md
|
|
24
|
+
*/
|
|
25
|
+
import { type LinkResolver } from '@estiva-app/protocol';
|
|
26
|
+
export interface OpeningWordsOptions {
|
|
27
|
+
/**
|
|
28
|
+
* What an app link names (§7.7), as answered so far — the resolver the app
|
|
29
|
+
* gives its box (`BoxLinkContext.resolveLink`). A bare app URL it answers
|
|
30
|
+
* reads as the reference it names ("Issue", "Message"); one it does not —
|
|
31
|
+
* nothing claims it, or the answer has not come back yet — stays as
|
|
32
|
+
* written. Without it, every URL stays as written.
|
|
33
|
+
*/
|
|
34
|
+
resolveLink?: LinkResolver;
|
|
35
|
+
}
|
|
1
36
|
/** What a `nostr:` reference reads as in a caption, by its kind alone, or a person by name. */
|
|
2
37
|
export declare function referenceWord(uri: string, nameOf: (pubkey: string) => string | undefined): string;
|
|
3
38
|
/** A message body's opening words on one line, as a caption: see the module's note. */
|
|
4
|
-
export declare function openingWords(body: string, nameOf: (pubkey: string) => string | undefined): string;
|
|
39
|
+
export declare function openingWords(body: string, nameOf: (pubkey: string) => string | undefined, options?: OpeningWordsOptions): string;
|
|
40
|
+
/**
|
|
41
|
+
* The words a message is found by in `[` (Katerina, 30 October, widget review
|
|
42
|
+
* item 19): what its writer wrote, read as {@link openingWords} reads it, but
|
|
43
|
+
* with no link's raw text — no bare URL, resolved or not — and no type word
|
|
44
|
+
* for a file or a message it names, so typing a file's word finds the file,
|
|
45
|
+
* not every message that links to it. A link on words keeps its words, a
|
|
46
|
+
* person reads as `@Name`, and code is kept as written.
|
|
47
|
+
*/
|
|
48
|
+
export declare function messageWords(body: string, nameOf: (pubkey: string) => string | undefined): string;
|
|
5
49
|
//# sourceMappingURL=openingWords.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openingWords.d.ts","sourceRoot":"","sources":["../src/openingWords.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"openingWords.d.ts","sourceRoot":"","sources":["../src/openingWords.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAgF,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAmBtI,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,YAAY,CAAA;CAC3B;AAOD,+FAA+F;AAC/F,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GAAG,MAAM,CAoBjG;AAmFD,uFAAuF;AACvF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,EAAE,OAAO,GAAE,mBAAwB,GAAG,MAAM,CAEpI;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GAAG,MAAM,CAEjG"}
|