@estiva-app/interop 0.35.0 → 0.37.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 +90 -0
- package/README.md +70 -2
- package/dist/folders.d.ts +21 -0
- package/dist/folders.d.ts.map +1 -1
- package/dist/folders.js +34 -0
- package/dist/folders.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/nesting.d.ts +9 -1
- package/dist/nesting.d.ts.map +1 -1
- package/dist/nesting.js +3 -2
- package/dist/nesting.js.map +1 -1
- package/dist/projection.d.ts +281 -8
- package/dist/projection.d.ts.map +1 -1
- package/dist/projection.js +710 -45
- package/dist/projection.js.map +1 -1
- package/package.json +3 -3
- package/src/folders.ts +39 -0
- package/src/index.ts +10 -0
- package/src/nesting.ts +14 -3
- package/src/projection.ts +941 -47
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,96 @@ how a declaration is read, is a MAJOR — in `0.x`, a MINOR — even when no
|
|
|
6
6
|
TypeScript signature moved. A consumer upgrading must be able to tell whether
|
|
7
7
|
manifests already published still mean what they meant.
|
|
8
8
|
|
|
9
|
+
## 0.37.0 — 2026-09-29
|
|
10
|
+
|
|
11
|
+
**Manifests: nothing new to declare, and one field is now read for every kind
|
|
12
|
+
— `archived`** (FOL-46). A manifest already published means what it meant: a
|
|
13
|
+
Ship project archived through its `hiddenWhen` is hidden exactly as before. What
|
|
14
|
+
moves is that an `archived = 'true'` change now hides *any* file — including one
|
|
15
|
+
whose app declares no `records` (a Folder) — and hides what is under it.
|
|
16
|
+
Needs protocol 0.24.0, unchanged.
|
|
17
|
+
|
|
18
|
+
- **Archive is one concept for every file.** New **`ARCHIVED_FIELD`**,
|
|
19
|
+
**`type Archive`** (`by`, `at`, `resolution?`, `with?`) and
|
|
20
|
+
**`isArchived(file)`**. `ForeignObject.archived` is set by
|
|
21
|
+
`resolveForeignObject(s)` on an archived file, so a link opens it and can say
|
|
22
|
+
so. Read by the file's own `records` rule when it declares one, else by
|
|
23
|
+
SPEC's `kind:1851` `a`/`field`/`value`. Only `'true'` archives, as
|
|
24
|
+
`hiddenWhen` already read it; an empty value restores.
|
|
25
|
+
- **The resolution is the archiving change's `content`.** New
|
|
26
|
+
**`ActionEventArgs.note`** writes a change's `content`, and is refused on a
|
|
27
|
+
comment, a deletion or a creation, which would drop it. Ship's pre-FOL-46
|
|
28
|
+
placeholder note `archived` (twelve on production) is not a resolution.
|
|
29
|
+
- **The cascade is computed when reading, never written.** A file whose parent
|
|
30
|
+
(`parentRef`, walked through everything the Folder lists) is archived is left
|
|
31
|
+
out of `resolveFolderContents` with it — an issue with its project, a
|
|
32
|
+
sub-topic with its topic. A parent in another Folder is read once, one level.
|
|
33
|
+
**New option `resolveForeignObject(…, cache, { archivedWith: true })`** (and
|
|
34
|
+
the same last argument on `resolveForeignObjects`, `type
|
|
35
|
+
ArchiveReadOptions`) marks a file archived **with** its parent
|
|
36
|
+
(`archived.with`), one level, in one more request for the whole set — off by
|
|
37
|
+
default so a refresh tick stays one request. **New option
|
|
38
|
+
`resolveFolderContents(…, cache, { includeArchived })`** returns them marked
|
|
39
|
+
instead of leaving them out. The archives ride in the Folder read's request
|
|
40
|
+
in groups of 25 addresses, so a busy Folder's other changes cannot push them
|
|
41
|
+
off the shared filter's 500.
|
|
42
|
+
- **A Folder is archived the way any file is.** `FolderSummary.channel` is its
|
|
43
|
+
`kind:39000` address and `FolderSummary.archived` its archive;
|
|
44
|
+
`FolderContents` carries both for the Folder read. `listFolders` reads every
|
|
45
|
+
Folder's archive **in the request it already makes for the record roots**
|
|
46
|
+
(one more request only when no state lists a record), and marks a record's
|
|
47
|
+
channel archived with its record when every record naming it is.
|
|
48
|
+
**`topLevelFolders` leaves an archived Folder out**, and
|
|
49
|
+
`resolveFolderContents` leaves out a nested one. New
|
|
50
|
+
**`planArchiveFolder(pubkey, ms, { folder, channel, archived, resolution? })`**
|
|
51
|
+
writes the same change `buildActionEvent` writes for any other file.
|
|
52
|
+
- **The bare file declares `archive`** (`emits: { kind: 1851, field:
|
|
53
|
+
'archived' }`, vocabulary `archived`: `''` Active, `'true'` Archived — Ship's
|
|
54
|
+
`ARCHIVED_STATES`), so a consumer draws Archive on a topic from the
|
|
55
|
+
declaration, as it draws Rename.
|
|
56
|
+
- **New `archiveImpact(address, query, { folders?, cache? })`** — the counts
|
|
57
|
+
behind the warning: `hides` by kind (children, and for a Folder what only it
|
|
58
|
+
lists with their children, not counting what is archived already) and
|
|
59
|
+
`staysVisible` (files another live Folder also lists).
|
|
60
|
+
|
|
61
|
+
## 0.36.0 — 2026-09-29
|
|
62
|
+
|
|
63
|
+
**Manifests: three new declarations, and every manifest already published
|
|
64
|
+
reads as it did** — none declares them (SPEC §7.2–7.3, MAN-1). One behaviour
|
|
65
|
+
moves for the bare file only, and it is the same answer: its `parent` is now
|
|
66
|
+
read from its declaration instead of a constant. Needs protocol 0.24.0.
|
|
67
|
+
|
|
68
|
+
- **`children.movedBy`** — the field whose change moves a child. The folded
|
|
69
|
+
field wins over the `via` tag, an empty value — or one that is not an
|
|
70
|
+
address of the declared parent kind — is a move to no parent, and it is
|
|
71
|
+
ignored with `match: 'identifier'`. `ForeignObject.parentField` is the
|
|
72
|
+
declared field (was: `parent` on a bare file, nothing else), and the new
|
|
73
|
+
**`ForeignObject.parentKind`** is the kind a move may name — absent on a
|
|
74
|
+
bare file, which may sit under any kind. `Nestable` gains `kind` and
|
|
75
|
+
`parentKind`, and `moveTargetsOf` offers only that kind when it is set.
|
|
76
|
+
The bare file declares `movedBy: 'parent'`; `BARE_FILE_PARENT_FIELD` is gone
|
|
77
|
+
(it was never exported).
|
|
78
|
+
- **`emits.placement`** — on a creation, the tag the root names its Folder
|
|
79
|
+
with: `h` (default) or `buzz-channel`. Anything else is refused.
|
|
80
|
+
- **`emits.listed`** — a creation is followed by `kind:1852 add` when the
|
|
81
|
+
Folder has state, a deletion by a `remove` from each Folder with state that
|
|
82
|
+
lists it. **New: `buildActionEvents(args & { folderHasState?, listedIn? })`**
|
|
83
|
+
returns the events in publish order and refuses without the fact it needs;
|
|
84
|
+
**`buildActionEvent` refuses a `listed` creation or deletion** rather than
|
|
85
|
+
build the root alone. `ResolvedAction.listed` marks the actions that need
|
|
86
|
+
it. `ActionEventArgs` is the args type, now named.
|
|
87
|
+
- **`format`** — on a creation's `content` property or a change's input,
|
|
88
|
+
`estiva-blocks-1` says the value may be a block document.
|
|
89
|
+
`ActionFormField.format` and `ResolvedAction.format` carry it when it is a
|
|
90
|
+
format this version writes (`type ProseFormat`). **`buildActionEvent({
|
|
91
|
+
contentFormat })`** tags the root or change with `content-format`, after
|
|
92
|
+
parsing the value, and adds an `imeta` per attached file; without it the
|
|
93
|
+
value is written untagged as marker text, as before. Refused on a comment, a
|
|
94
|
+
deletion, or an action not declaring that format.
|
|
95
|
+
- **`actionProblems`** flags an unknown placement, a `listed` on an action
|
|
96
|
+
that neither creates nor deletes, a format with nowhere to go and an
|
|
97
|
+
unknown format.
|
|
98
|
+
|
|
9
99
|
## 0.35.0 — 2026-09-29
|
|
10
100
|
|
|
11
101
|
**Manifests: nothing.** No declaration is read differently. Additive: a reply
|
package/README.md
CHANGED
|
@@ -278,6 +278,46 @@ names the field in `parentField`, and a consumer drawing property rows keeps
|
|
|
278
278
|
that one out, as it keeps the title's out, and offers the move where it draws
|
|
279
279
|
the tree.
|
|
280
280
|
|
|
281
|
+
### Moves, placement and prose (0.36.0)
|
|
282
|
+
|
|
283
|
+
Three things an owner declares so a consumer can do what the owner does
|
|
284
|
+
(SPEC §7.2–7.3, MAN-1).
|
|
285
|
+
|
|
286
|
+
**A move** is a change to the field the parent's list names as `movedBy`:
|
|
287
|
+
|
|
288
|
+
```jsonc
|
|
289
|
+
"list": { "children": { "kind": 30851, "via": "a", "movedBy": "project" } }
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
The folded field wins over the child's `a` tag, and an empty value is a move to
|
|
293
|
+
no parent. The object carries `parentField` (the bare file's is `parent`, now
|
|
294
|
+
declared rather than hard-coded) and `parentKind`, the kind a move may name —
|
|
295
|
+
`nestingOf(...).moveTargetsOf` offers only that kind.
|
|
296
|
+
|
|
297
|
+
**Placement and listing.** A creation may name its Folder with `buzz-channel`
|
|
298
|
+
instead of `h`, and an action declaring `listed: true` is followed by the
|
|
299
|
+
`kind:1852` that keeps the Folder's listing true. Those are built by
|
|
300
|
+
`buildActionEvents`, which needs what only your read of `kind:30890` knows —
|
|
301
|
+
`buildActionEvent` refuses them rather than publish half:
|
|
302
|
+
|
|
303
|
+
```ts
|
|
304
|
+
const events = buildActionEvents({ /* …as above… */ actionId: 'add-project',
|
|
305
|
+
value: { name: 'Launch' }, newId: crypto.randomUUID(), folderHasState: folder.hasState })
|
|
306
|
+
// [kind:30850 with buzz-channel, kind:1852 add] — publish in order, stop at the first refusal
|
|
307
|
+
|
|
308
|
+
buildActionEvents({ /* … */ actionId: 'delete-project', value: '', listedIn: folders })
|
|
309
|
+
// [kind:5, a kind:1852 remove per Folder with state]
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
A resolved action carrying `listed: true` is one that needs them.
|
|
313
|
+
|
|
314
|
+
**Prose.** A field declared with `"format": "estiva-blocks-1"` — on a
|
|
315
|
+
creation's `content` property, or a change's input — arrives with `format` on
|
|
316
|
+
the resolved field or action, so you can draw a block editor. Pass
|
|
317
|
+
`contentFormat: 'estiva-blocks-1'` with a block document and the event carries
|
|
318
|
+
`content-format` and an `imeta` per attached file; pass plain text without it
|
|
319
|
+
and the value is written as marker text, which is always correct.
|
|
320
|
+
|
|
281
321
|
### Replies
|
|
282
322
|
|
|
283
323
|
A reply is the `comment` action with a parent. Pass `replyTo` and the uppercase
|
|
@@ -503,8 +543,8 @@ explaining a short list should read this field.
|
|
|
503
543
|
```ts
|
|
504
544
|
import { listFolders, topLevelFolders } from '@estiva-app/interop'
|
|
505
545
|
|
|
506
|
-
const folders = await listFolders(query) // { id, name, hasState, listedIn?, addresses? }[]
|
|
507
|
-
const teams = topLevelFolders(folders) // state,
|
|
546
|
+
const folders = await listFolders(query) // { id, name, hasState, listedIn?, addresses?, channel?, archived? }[]
|
|
547
|
+
const teams = topLevelFolders(folders) // state, nothing lists it, not archived
|
|
508
548
|
```
|
|
509
549
|
|
|
510
550
|
Asks for folders by kind rather than walking anything else. Discovering things
|
|
@@ -553,6 +593,34 @@ next state from its current one and a folder with no `kind:30890` has none: a
|
|
|
553
593
|
everything filed in it by `h` stops being listed. So rename, place and unlist
|
|
554
594
|
send no command to such a folder, and a move into or out of one is refused.
|
|
555
595
|
|
|
596
|
+
### Archiving anything (0.37.0)
|
|
597
|
+
|
|
598
|
+
```ts
|
|
599
|
+
import { archiveImpact, isArchived, planArchiveFolder } from '@estiva-app/interop'
|
|
600
|
+
|
|
601
|
+
const impact = await archiveImpact(file.address, query) // { hides: [{ kind, count }], staysVisible }
|
|
602
|
+
// …say what it hides, take a resolution, then publish the declared `archive`
|
|
603
|
+
// action with `value: 'true'` and `note: resolution` — or, for a Folder:
|
|
604
|
+
const [change] = planArchiveFolder(me, Date.now(), { folder: f.id, channel: f.channel!, archived: true, resolution })
|
|
605
|
+
|
|
606
|
+
const opened = await resolveForeignObject(link, query, people, 0, cache, { archivedWith: true })
|
|
607
|
+
if (isArchived(opened)) showBanner(opened.archived) // { by, at, resolution?, with? }
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
One field for every file, whatever its kind: a change setting `archived` to
|
|
611
|
+
`'true'` on the file's address archives it and an empty value restores it. It
|
|
612
|
+
is a change, so anyone who may write in the Folder may, and the change's
|
|
613
|
+
`content` is the resolution a person gave.
|
|
614
|
+
|
|
615
|
+
**The cascade is read, never written.** A Folder's contents leave out an
|
|
616
|
+
archived file and everything under it — an issue with its project, a sub-topic
|
|
617
|
+
with its topic — and `topLevelFolders` leaves out an archived Folder, so its
|
|
618
|
+
subtree goes too. Nothing is written to the children, so unarchiving restores
|
|
619
|
+
exactly what was there, and a file another Folder also lists stays visible in
|
|
620
|
+
that one. A link still opens an archived file, with `archived` set — `with`
|
|
621
|
+
naming the parent when it is archived only with it — so the page can draw the
|
|
622
|
+
resolution first and an Unarchive control.
|
|
623
|
+
|
|
556
624
|
---
|
|
557
625
|
|
|
558
626
|
## What is not in here, deliberately
|
package/dist/folders.d.ts
CHANGED
|
@@ -122,6 +122,27 @@ export type MovePlan = {
|
|
|
122
122
|
*
|
|
123
123
|
* A move to the same Folder plans nothing.
|
|
124
124
|
*/
|
|
125
|
+
/**
|
|
126
|
+
* Archive a Folder, or restore it: `[kind:1851 archived]` — FOL-46.
|
|
127
|
+
*
|
|
128
|
+
* **Not a Folder command.** A Folder is archived the way any file is: a change
|
|
129
|
+
* setting `archived` on its address — its channel's, `FolderSummary.channel` —
|
|
130
|
+
* to `'true'`, or to an empty value to restore it. Its state, its contents and
|
|
131
|
+
* its channel are untouched, which is what makes it reversible: a `kind:9008`
|
|
132
|
+
* hides everything under the Folder's `h` for good (FOL-9), and a `kind:1852`
|
|
133
|
+
* would unlist the Folder from somewhere a person would have to remember.
|
|
134
|
+
*
|
|
135
|
+
* Published into the Folder itself, so anyone who may write there — a member,
|
|
136
|
+
* not only an admin — may archive it. `resolution` is what the person archiving
|
|
137
|
+
* said about it, carried as the change's `content`; readers show it first when
|
|
138
|
+
* the archived Folder is opened. Restoring takes none.
|
|
139
|
+
*/
|
|
140
|
+
export declare function planArchiveFolder(pubkey: string, createdAtMs: number, args: {
|
|
141
|
+
folder: string;
|
|
142
|
+
channel: string;
|
|
143
|
+
archived: boolean;
|
|
144
|
+
resolution?: string;
|
|
145
|
+
}): UnsignedEvent[];
|
|
125
146
|
export declare function planMoveFile(pubkey: string, createdAtMs: number, args: {
|
|
126
147
|
address: string;
|
|
127
148
|
from: FolderRef;
|
package/dist/folders.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folders.d.ts","sourceRoot":"","sources":["../src/fol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HANGED
|
@@ -110,6 +110,40 @@ export function planUnlistFile(pubkey, createdAtMs, args) {
|
|
|
110
110
|
*
|
|
111
111
|
* A move to the same Folder plans nothing.
|
|
112
112
|
*/
|
|
113
|
+
/**
|
|
114
|
+
* Archive a Folder, or restore it: `[kind:1851 archived]` — FOL-46.
|
|
115
|
+
*
|
|
116
|
+
* **Not a Folder command.** A Folder is archived the way any file is: a change
|
|
117
|
+
* setting `archived` on its address — its channel's, `FolderSummary.channel` —
|
|
118
|
+
* to `'true'`, or to an empty value to restore it. Its state, its contents and
|
|
119
|
+
* its channel are untouched, which is what makes it reversible: a `kind:9008`
|
|
120
|
+
* hides everything under the Folder's `h` for good (FOL-9), and a `kind:1852`
|
|
121
|
+
* would unlist the Folder from somewhere a person would have to remember.
|
|
122
|
+
*
|
|
123
|
+
* Published into the Folder itself, so anyone who may write there — a member,
|
|
124
|
+
* not only an admin — may archive it. `resolution` is what the person archiving
|
|
125
|
+
* said about it, carried as the change's `content`; readers show it first when
|
|
126
|
+
* the archived Folder is opened. Restoring takes none.
|
|
127
|
+
*/
|
|
128
|
+
export function planArchiveFolder(pubkey, createdAtMs, args) {
|
|
129
|
+
return [
|
|
130
|
+
{
|
|
131
|
+
pubkey,
|
|
132
|
+
created_at: Math.floor(createdAtMs / 1000),
|
|
133
|
+
kind: 1851,
|
|
134
|
+
// `buildActionEvent`'s order for a change, so the two writers of the one
|
|
135
|
+
// shape produce the same tags.
|
|
136
|
+
tags: [
|
|
137
|
+
['a', args.channel],
|
|
138
|
+
['field', 'archived'],
|
|
139
|
+
['value', args.archived ? 'true' : ''],
|
|
140
|
+
['h', args.folder],
|
|
141
|
+
['ts', String(createdAtMs)],
|
|
142
|
+
],
|
|
143
|
+
content: args.archived ? (args.resolution ?? '') : '',
|
|
144
|
+
},
|
|
145
|
+
];
|
|
146
|
+
}
|
|
113
147
|
export function planMoveFile(pubkey, createdAtMs, args) {
|
|
114
148
|
if (args.from.id === args.to.id)
|
|
115
149
|
return { ok: true,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,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YACrG,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;SAC3G;KACF,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* of every app that installed it, which is the objection that rules out
|
|
25
25
|
* iframes.
|
|
26
26
|
*/
|
|
27
|
-
export { resolveManifest, resolveForeignObject, resolveForeignObjects, resolveForeignEvent, resolveFolderProject, resolveFolderContents, listFolders, topLevelFolders, KIND_FOLDER_STATE, KIND_CHANNEL_METADATA, KIND_BARE_FILE, BARE_FILE_MANIFEST_ADDRESS, ASPECTS, type Aspect, commentKindsOf, conversationCountsOf, conversationsOf, type ConversationMessage, threadsOf, type Threads, CONVERSATION_LIMIT, commentDecorationsOf, editTargetOf, REACTION_HORIZON, type CommentDecoration, type CommentDecorations, type CommentReaction, type CommentResolution, buildActionEvent, pickWidget, widgetChainProblem, actionProblems, folderOf, MIN_ACTION_DESCRIPTION, CLOSED_WIDGETS, contentFormatOf, BODY_SLOT, CONTENT_FORMAT_TAG, BLOCK_DOCUMENT_FORMAT, type ContentFormat, peopleViaRelay, createProjectionCache, createPeopleCache, MANIFEST_TTL_MS, PROFILE_HIT_TTL_MS, PROFILE_MISS_TTL_MS, type PeopleCache, type PeopleCacheOptions, type ProjectionCache, type ResolvedManifest, type QueryFn, type PeopleFn, type People, type ForeignObject, type FolderProject, type FolderContents, type FolderSummary, type ResolvedSlot, type ResolvedAction, type ActionFormField, type ManifestAction, type ActionEffect, ACTION_EFFECTS, type UnsignedActionEvent, } from './projection.js';
|
|
27
|
+
export { resolveManifest, resolveForeignObject, resolveForeignObjects, resolveForeignEvent, resolveFolderProject, resolveFolderContents, listFolders, topLevelFolders, ARCHIVED_FIELD, isArchived, archiveImpact, type Archive, type ArchiveImpact, type ArchiveReadOptions, KIND_FOLDER_STATE, KIND_CHANNEL_METADATA, KIND_BARE_FILE, BARE_FILE_MANIFEST_ADDRESS, ASPECTS, type Aspect, commentKindsOf, conversationCountsOf, conversationsOf, type ConversationMessage, threadsOf, type Threads, CONVERSATION_LIMIT, commentDecorationsOf, editTargetOf, REACTION_HORIZON, type CommentDecoration, type CommentDecorations, type CommentReaction, type CommentResolution, buildActionEvent, buildActionEvents, type ActionEventArgs, pickWidget, widgetChainProblem, actionProblems, folderOf, MIN_ACTION_DESCRIPTION, CLOSED_WIDGETS, contentFormatOf, BODY_SLOT, CONTENT_FORMAT_TAG, BLOCK_DOCUMENT_FORMAT, type ContentFormat, peopleViaRelay, createProjectionCache, createPeopleCache, MANIFEST_TTL_MS, PROFILE_HIT_TTL_MS, PROFILE_MISS_TTL_MS, type PeopleCache, type PeopleCacheOptions, type ProjectionCache, type ResolvedManifest, type QueryFn, type PeopleFn, type People, type ForeignObject, type FolderProject, type FolderContents, type FolderSummary, type ResolvedSlot, type ResolvedAction, type ActionFormField, type ProseFormat, type ManifestAction, type ActionEffect, ACTION_EFFECTS, type UnsignedActionEvent, } from './projection.js';
|
|
28
28
|
/**
|
|
29
29
|
* SPEC §6.7's nesting, drawn from one team listing: roots, children,
|
|
30
30
|
* breadcrumbs and move targets, with cycles cut. No requests.
|
|
@@ -35,7 +35,7 @@ export { nestingOf, type Nestable, type Nesting } from './nesting.js';
|
|
|
35
35
|
* unlist, move. Each takes `hasState` from the caller, because a `kind:1852`
|
|
36
36
|
* against a Folder with no state empties it. No signing, no requests.
|
|
37
37
|
*/
|
|
38
|
-
export { planCreateFolder, planRenameFolder, planPlaceFile, planUnlistFile, planMoveFile, type FolderRef, type MovePlan, type MoveRefusal, } from './folders.js';
|
|
38
|
+
export { planCreateFolder, planRenameFolder, planPlaceFile, planUnlistFile, planMoveFile, planArchiveFolder, type FolderRef, type MovePlan, type MoveRefusal, } from './folders.js';
|
|
39
39
|
/**
|
|
40
40
|
* RFC 0.5 §7's URL grammar — how an object is named in an address bar, and how
|
|
41
41
|
* a pasted link is matched back to one.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,0BAA0B,EAC1B,OAAO,EACP,KAAK,MAAM,EACX,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,KAAK,mBAAmB,EACxB,SAAS,EACT,KAAK,OAAO,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,aAAa,EAClB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAA;AAExB;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAA;AAErE;;;;GAIG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,WAAW,GACjB,MAAM,cAAc,CAAA;AAErB;;;;;;;GAOG;AACH,OAAO,EACL,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,cAAc,EACd,UAAU,EACV,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,0BAA0B,EAC1B,OAAO,EACP,KAAK,MAAM,EACX,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,KAAK,mBAAmB,EACxB,SAAS,EACT,KAAK,OAAO,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,eAAe,EACpB,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,aAAa,EAClB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAA;AAExB;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAA;AAErE;;;;GAIG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,WAAW,GACjB,MAAM,cAAc,CAAA;AAErB;;;;;;;GAOG;AACH,OAAO,EACL,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* of every app that installed it, which is the objection that rules out
|
|
25
25
|
* iframes.
|
|
26
26
|
*/
|
|
27
|
-
export { resolveManifest, resolveForeignObject, resolveForeignObjects, resolveForeignEvent, resolveFolderProject, resolveFolderContents, listFolders, topLevelFolders, KIND_FOLDER_STATE, KIND_CHANNEL_METADATA, KIND_BARE_FILE, BARE_FILE_MANIFEST_ADDRESS, ASPECTS, commentKindsOf, conversationCountsOf, conversationsOf, threadsOf, CONVERSATION_LIMIT, commentDecorationsOf, editTargetOf, REACTION_HORIZON, buildActionEvent, pickWidget, widgetChainProblem, actionProblems, folderOf, MIN_ACTION_DESCRIPTION, CLOSED_WIDGETS, contentFormatOf, BODY_SLOT, CONTENT_FORMAT_TAG, BLOCK_DOCUMENT_FORMAT, peopleViaRelay, createProjectionCache, createPeopleCache, MANIFEST_TTL_MS, PROFILE_HIT_TTL_MS, PROFILE_MISS_TTL_MS, ACTION_EFFECTS, } from './projection.js';
|
|
27
|
+
export { resolveManifest, resolveForeignObject, resolveForeignObjects, resolveForeignEvent, resolveFolderProject, resolveFolderContents, listFolders, topLevelFolders, ARCHIVED_FIELD, isArchived, archiveImpact, KIND_FOLDER_STATE, KIND_CHANNEL_METADATA, KIND_BARE_FILE, BARE_FILE_MANIFEST_ADDRESS, ASPECTS, commentKindsOf, conversationCountsOf, conversationsOf, threadsOf, CONVERSATION_LIMIT, commentDecorationsOf, editTargetOf, REACTION_HORIZON, buildActionEvent, buildActionEvents, pickWidget, widgetChainProblem, actionProblems, folderOf, MIN_ACTION_DESCRIPTION, CLOSED_WIDGETS, contentFormatOf, BODY_SLOT, CONTENT_FORMAT_TAG, BLOCK_DOCUMENT_FORMAT, peopleViaRelay, createProjectionCache, createPeopleCache, MANIFEST_TTL_MS, PROFILE_HIT_TTL_MS, PROFILE_MISS_TTL_MS, ACTION_EFFECTS, } from './projection.js';
|
|
28
28
|
/**
|
|
29
29
|
* SPEC §6.7's nesting, drawn from one team listing: roots, children,
|
|
30
30
|
* breadcrumbs and move targets, with cycles cut. No requests.
|
|
@@ -35,7 +35,7 @@ export { nestingOf } from './nesting.js';
|
|
|
35
35
|
* unlist, move. Each takes `hasState` from the caller, because a `kind:1852`
|
|
36
36
|
* against a Folder with no state empties it. No signing, no requests.
|
|
37
37
|
*/
|
|
38
|
-
export { planCreateFolder, planRenameFolder, planPlaceFile, planUnlistFile, planMoveFile, } from './folders.js';
|
|
38
|
+
export { planCreateFolder, planRenameFolder, planPlaceFile, planUnlistFile, planMoveFile, planArchiveFolder, } from './folders.js';
|
|
39
39
|
/**
|
|
40
40
|
* RFC 0.5 §7's URL grammar — how an object is named in an address bar, and how
|
|
41
41
|
* a pasted link is matched back to one.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,0BAA0B,EAC1B,OAAO,EAEP,cAAc,EACd,oBAAoB,EACpB,eAAe,EAEf,SAAS,EAET,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAKhB,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EAErB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,cAAc,EACd,UAAU,EACV,aAAa,EAIb,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,0BAA0B,EAC1B,OAAO,EAEP,cAAc,EACd,oBAAoB,EACpB,eAAe,EAEf,SAAS,EAET,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAKhB,gBAAgB,EAChB,iBAAiB,EAEjB,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EAErB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EAkBnB,cAAc,GAEf,MAAM,iBAAiB,CAAA;AAExB;;;GAGG;AACH,OAAO,EAAE,SAAS,EAA+B,MAAM,cAAc,CAAA;AAErE;;;;GAIG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,iBAAiB,GAIlB,MAAM,cAAc,CAAA;AAErB;;;;;;;GAOG;AACH,OAAO,EACL,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,GAGf,MAAM,gBAAgB,CAAA"}
|
package/dist/nesting.d.ts
CHANGED
|
@@ -28,11 +28,19 @@
|
|
|
28
28
|
* listing stays reachable and no walk loops. A file merely *under* a cycle
|
|
29
29
|
* keeps its parent.
|
|
30
30
|
*/
|
|
31
|
-
/** The
|
|
31
|
+
/** The fields nesting reads. `ForeignObject` has all of them. */
|
|
32
32
|
export interface Nestable {
|
|
33
33
|
ref: string;
|
|
34
34
|
address?: string;
|
|
35
35
|
parentRef?: string;
|
|
36
|
+
kind?: number;
|
|
37
|
+
/**
|
|
38
|
+
* The only kind this file may be moved under, when its owner says
|
|
39
|
+
* (`ForeignObject.parentKind`, MAN-1). An issue's `project` holds a project,
|
|
40
|
+
* so offering it another issue or a topic is offering a move the owning app
|
|
41
|
+
* cannot read. Absent means any kind, which is a bare file's rule (§6.7).
|
|
42
|
+
*/
|
|
43
|
+
parentKind?: number;
|
|
36
44
|
}
|
|
37
45
|
export interface Nesting<T extends Nestable> {
|
|
38
46
|
/** What the listing draws at the top, in listing order. */
|
package/dist/nesting.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nesting.d.ts","sourceRoot":"","sources":["../src/nesting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,
|
|
1
|
+
{"version":3,"file":"nesting.d.ts","sourceRoot":"","sources":["../src/nesting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,iEAAiE;AACjE,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,OAAO,CAAC,CAAC,SAAS,QAAQ;IACzC,2DAA2D;IAC3D,KAAK,EAAE,CAAC,EAAE,CAAA;IACV,wEAAwE;IACxE,UAAU,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,CAAA;IACxB;;;OAGG;IACH,WAAW,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,CAAA;IACzB,gDAAgD;IAChD,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAAA;IAChC;;;;OAIG;IACH,aAAa,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAAA;CAC1C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAuE7E"}
|
package/dist/nesting.js
CHANGED
|
@@ -94,8 +94,9 @@ export function nestingOf(files) {
|
|
|
94
94
|
stack.push(child);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
// A target needs an address to be named by a
|
|
98
|
-
|
|
97
|
+
// A target needs an address to be named by a move, and must be of the
|
|
98
|
+
// kind the move names when the owner declared one.
|
|
99
|
+
const targets = files.filter((f) => f.address && !below.has(f.ref) && (file.parentKind === undefined || f.kind === file.parentKind));
|
|
99
100
|
return file.parentRef ? [undefined, ...targets.filter((t) => t?.address !== file.parentRef)] : targets;
|
|
100
101
|
};
|
|
101
102
|
return { roots, childrenOf, ancestorsOf, parentOf, moveTargetsOf };
|
package/dist/nesting.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nesting.js","sourceRoot":"","sources":["../src/nesting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;
|
|
1
|
+
{"version":3,"file":"nesting.js","sourceRoot":"","sources":["../src/nesting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAqCH;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAqB,KAAmB;IAC/D,MAAM,SAAS,GAAG,IAAI,GAAG,EAAa,CAAA;IACtC,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAE7G,MAAM,YAAY,GAAG,CAAC,IAAO,EAAiB,EAAE;QAC9C,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACzE,OAAO,MAAM,IAAI,MAAM,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,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