@notis_ai/cli 0.2.31 → 0.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -9
- package/config/notis_app_design_rules.json +22 -0
- package/dist/agent-hooks/notis-agent-hook.mjs +4677 -913
- package/dist/base-skills/notis-cli/.notis-base-skill.json +1 -1
- package/dist/base-skills/notis-cli/SKILL.md +7 -3
- package/dist/base-skills/notis-spaces/.notis-base-skill.json +1 -1
- package/dist/base-skills/notis-spaces/SKILL.md +9 -4
- package/dist/base-skills/notis-spaces/references/comments.md +94 -0
- package/dist/base-skills/notis-spaces/references/context.md +20 -19
- package/dist/base-skills/notis-spaces/references/design.md +3 -2
- package/dist/base-skills/notis-spaces/references/fixtures.md +4 -2
- package/dist/base-skills/notis-spaces/references/reading.md +3 -1
- package/dist/base-skills/notis-spaces/references/release.md +3 -1
- package/dist/base-skills/notis-spaces/references/sdk.md +160 -88
- package/dist/base-skills/notis-spaces/references/store.md +24 -1
- package/dist/sdk/src/components/SelectionActionBar.tsx +42 -7
- package/dist/sdk/src/components/SpaceTextComments.tsx +284 -0
- package/dist/sdk/src/config.ts +3 -1
- package/dist/sdk/src/functions.ts +203 -0
- package/dist/sdk/src/hooks/useAgentQueue.ts +17 -28
- package/dist/sdk/src/hooks/useCollectionInteractions.ts +7 -2
- package/dist/sdk/src/hooks/useConnection.ts +102 -0
- package/dist/sdk/src/hooks/useFunction.ts +42 -0
- package/dist/sdk/src/hooks/useNotisSettings.ts +101 -0
- package/dist/sdk/src/index.ts +15 -4
- package/dist/sdk/src/runtime.ts +16 -1
- package/dist/sdk/src/space.ts +333 -33
- package/dist/sdk/src/ui/comments/passageModel.ts +99 -0
- package/dist/sdk/src/ui/comments/textHighlights.ts +33 -0
- package/dist/sdk/src/ui/icons.tsx +17 -1
- package/dist/skill-sync/index.js +239 -30
- package/dist/skill-sync-worker.mjs +453 -124
- package/dist/space-harness/host.js +218 -93
- package/dist/space-sdk/dist/chunk-4GWS2IFO.js +3 -0
- package/dist/space-sdk/dist/index.js +3 -3
- package/dist/space-sdk/dist/ui.js +9 -8
- package/dist/space-sdk/src/config.ts +3 -1
- package/dist/space-sdk/src/functions.ts +203 -0
- package/dist/space-sdk/src/hooks/useAgentQueue.d.ts +2 -13
- package/dist/space-sdk/src/hooks/useCollectionInteractions.d.ts +2 -0
- package/dist/space-sdk/src/hooks/useConnection.d.ts +42 -0
- package/dist/space-sdk/src/hooks/useFunction.d.ts +20 -0
- package/dist/space-sdk/src/hooks/useNotisSettings.d.ts +48 -0
- package/dist/space-sdk/src/index.d.ts +10 -4
- package/dist/space-sdk/src/runtime.d.ts +14 -1
- package/dist/space-sdk/src/space.ts +333 -33
- package/dist/space-sdk/src/tailwind-candidates.d.ts +227 -152
- package/dist/space-sdk/src/ui/blocks/blocks.d.ts +18 -0
- package/dist/space-sdk/src/ui/blocks/index.d.ts +2 -2
- package/dist/space-sdk/src/ui/comments/CommentPane.d.ts +7 -4
- package/dist/space-sdk/src/ui/comments/agentRuntime.d.ts +10 -2
- package/dist/space-sdk/src/ui/comments/commentModel.d.ts +55 -88
- package/dist/space-sdk/src/ui/comments/commentWords.d.ts +9 -0
- package/dist/space-sdk/src/ui/comments/hostComments.d.ts +13 -9
- package/dist/space-sdk/src/ui/comments/index.d.ts +1 -1
- package/dist/space-sdk/src/ui/comments/paneParts.d.ts +27 -5
- package/dist/space-sdk/src/ui/comments/passageModel.d.ts +12 -36
- package/dist/space-sdk/src/ui/comments/useCommentRouting.d.ts +26 -4
- package/dist/space-sdk/src/ui/comments/useComments.d.ts +64 -74
- package/dist/space-sdk/src/ui/comments/usePassageComments.d.ts +8 -4
- package/dist/space-sdk/src/ui/icons.d.ts +6 -0
- package/dist/space-sdk/src/ui/index.d.ts +2 -2
- package/dist/space-sdk/src/ui/layout/SidePane.d.ts +3 -4
- package/dist/space-sdk/src/ui/list/ListReader.d.ts +8 -0
- package/dist/space-sdk/src/ui/period/dateFormat.d.ts +27 -8
- package/dist/view-renderer/dist/host.js +285 -160
- package/package.json +3 -3
- package/skills/notis-cli/AGENT_INSTRUCTIONS.md +2 -2
- package/skills/notis-spaces/cli.md +17 -3
- package/src/cli.js +2 -1
- package/src/command-specs/index.js +3 -0
- package/src/command-specs/repository-secrets.js +171 -0
- package/src/command-specs/spaces.js +70 -3
- package/src/runtime/agent-credential.js +175 -0
- package/src/runtime/agent-identity.js +92 -15
- package/src/runtime/app-boundary-validator.js +248 -3
- package/src/runtime/app-data-literals.js +32 -23
- package/src/runtime/app-platform.js +8 -0
- package/src/runtime/auth-recovery.js +14 -0
- package/src/runtime/profiles.js +15 -0
- package/src/runtime/skill-sync/index.ts +3 -2
- package/src/runtime/skill-sync/symlink-manager.ts +354 -35
- package/src/runtime/skill-sync/types.ts +10 -1
- package/src/runtime/space-functions.js +211 -0
- package/src/runtime/space-platform.js +12 -3
- package/src/runtime/space-source.js +116 -13
- package/src/runtime/space-test-server.js +44 -7
- package/src/runtime/space-verification.js +3 -1
- package/src/runtime/transport.js +15 -0
- package/dist/sdk/src/components/NotisCommentBoundary.tsx +0 -132
- package/dist/space-sdk/dist/chunk-3DFOGU26.js +0 -3
- package/dist/space-sdk/src/components/NotisCommentBoundary.d.ts +0 -26
|
@@ -1,37 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The comment controller: reads
|
|
3
|
-
*
|
|
4
|
-
* the
|
|
2
|
+
* The comment controller: reads the page's comments from the Space's one comment store through the host Comments
|
|
3
|
+
* transport (`runtime.spaceComments`), lists them again whenever the host says they may have changed, writes through
|
|
4
|
+
* the same transport and keeps every change on screen at once (optimistic patches and drafts) until the stored row
|
|
5
|
+
* comes back. `CommentPane`, `CommentPins` and `CommentToolBar` render from it.
|
|
5
6
|
*
|
|
6
|
-
* People archive (
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* and nothing can be sent until the viewer is known (`canWrite`).
|
|
7
|
+
* People archive (shown Done) and delete at once with a 6-second Undo toast and Z (SPC-124, SPC-133); agents never
|
|
8
|
+
* archive through it. Deleting a first comment deletes its thread; a later one leaves a "Comment deleted" line
|
|
9
|
+
* (SPC-127). Rights come from the host's viewer (SPC-128): you edit and delete your own comments, and a whole thread or
|
|
10
|
+
* someone else's comment needs Space edit rights. Without a viewer nothing can be sent, edited or deleted. Without the
|
|
11
|
+
* transport (comments off, a Site, a link, a preview, an older host) there are no comments at all.
|
|
12
12
|
*/
|
|
13
13
|
import { type MouseEvent as ReactMouseEvent, type PointerEvent as ReactPointerEvent } from 'react';
|
|
14
|
-
import { type SpaceCommentViewer } from '../../space';
|
|
14
|
+
import { type SpaceCommentAnchor, type SpaceCommentViewer } from '../../space';
|
|
15
15
|
import { type Locale, type Words } from '../../words';
|
|
16
16
|
import { type ToastController } from '../actions/useToast';
|
|
17
|
-
import { type CommentAnchor, type
|
|
17
|
+
import { type CommentAnchor, type CommentDigestOptions, type CommentGroup, type CommentMode, type CommentPassage, type CommentRecord, type CommentScope, type CommentThread } from './commentModel';
|
|
18
18
|
import { type CommentWordKey, type CommentWords } from './commentWords';
|
|
19
19
|
import { type CommentRouting } from './useCommentRouting';
|
|
20
20
|
/** Which threads the pane lists: the current anchor's, or every thread in the scope. */
|
|
21
21
|
export type CommentAnchorFilter = 'anchor' | 'all';
|
|
22
|
-
/** Open threads (default), archived ones (Done
|
|
22
|
+
/** Open threads (default), archived ones (Done) or both (SPC-126): what the pane shows. */
|
|
23
23
|
export type CommentStatusView = 'open' | 'done' | 'all';
|
|
24
24
|
/** A status filter as `setStatusFilter` takes it: 'resolved' is an older name of 'done' and reads as 'done'. */
|
|
25
25
|
export type CommentStatusFilter = CommentStatusView | 'resolved';
|
|
26
|
-
/**
|
|
27
|
-
* What a new comment points at (SPC-118): words of the text, a point or a box on an anchor, some items (records or
|
|
28
|
-
* rows), a moment of a recording, or the whole page (no anchor).
|
|
29
|
-
*/
|
|
30
|
-
export type CommentMode = 'text' | 'point' | 'box' | 'items' | 'time' | 'page';
|
|
31
26
|
/**
|
|
32
27
|
* A new comment being written: on an anchor, with a pin (x and y, 0 to 1), a zone (w and h too, 0 to 1 of the
|
|
33
28
|
* anchor's size) or neither (on the whole anchor; `anchorKey` null: on the whole page). `items` lists the record keys
|
|
34
|
-
* (records or rows) of an items comment, `time` the seconds of a time comment.
|
|
29
|
+
* (records or rows) of an items comment, `time` the seconds of a time comment, `text` the words of a text comment.
|
|
35
30
|
*/
|
|
36
31
|
export interface CommentDraftPin {
|
|
37
32
|
anchorKey: string | null;
|
|
@@ -41,6 +36,7 @@ export interface CommentDraftPin {
|
|
|
41
36
|
h: number | null;
|
|
42
37
|
items?: readonly CommentAnchor[] | null;
|
|
43
38
|
time?: number | null;
|
|
39
|
+
text?: CommentPassage | null;
|
|
44
40
|
}
|
|
45
41
|
/** The zone being dragged on an anchor, 0 to 1 of its size. */
|
|
46
42
|
export interface CommentDragZone {
|
|
@@ -58,13 +54,16 @@ export interface CommentZoneHandlers {
|
|
|
58
54
|
onPointerCancel(event: ReactPointerEvent<HTMLElement>): void;
|
|
59
55
|
}
|
|
60
56
|
/**
|
|
61
|
-
* A file uploaded for a comment that is not sent yet:
|
|
62
|
-
* shows it until the saved comment is read back.
|
|
57
|
+
* A file uploaded for a comment that is not sent yet: what the host's upload returned (`path`, `type` and `size` go
|
|
58
|
+
* back with the comment), `previewUrl` shows it until the saved comment is read back.
|
|
63
59
|
*/
|
|
64
60
|
export interface CommentFile {
|
|
65
61
|
name: string;
|
|
66
62
|
url: string;
|
|
67
63
|
previewUrl?: string | null;
|
|
64
|
+
path?: string | null;
|
|
65
|
+
type?: string | null;
|
|
66
|
+
size?: number | null;
|
|
68
67
|
}
|
|
69
68
|
/** Whether new comments and replies can carry pictures and files. */
|
|
70
69
|
export type CommentAttachMode = 'on' | 'off' | 'checking';
|
|
@@ -77,7 +76,7 @@ export interface CommentActions {
|
|
|
77
76
|
reply(thread: CommentThread, body: string, files?: readonly CommentFile[], answers?: CommentRecord): Promise<boolean>;
|
|
78
77
|
/** Answers a check or choice ask. */
|
|
79
78
|
answer(root: CommentRecord, answer: string): void;
|
|
80
|
-
/**
|
|
79
|
+
/** Archives (Resolved) or brings back (Open) a thread without a toast. People archive with `archive` and `unarchive`. */
|
|
81
80
|
setStatus(root: CommentRecord, status: 'Open' | 'Resolved'): void;
|
|
82
81
|
/** Archives an open thread (Done) with a 6-second Undo toast; Z undoes. */
|
|
83
82
|
archive(root: CommentRecord): void;
|
|
@@ -90,14 +89,10 @@ export interface CommentActions {
|
|
|
90
89
|
remove(comment: CommentRecord): void;
|
|
91
90
|
/** Same as `remove` on a thread's first comment. */
|
|
92
91
|
askDelete(root: CommentRecord): void;
|
|
93
|
-
/**
|
|
94
|
-
* Saves new text for your own comment and marks it edited (Edited at, which Copy changes reports). Change keeps what
|
|
95
|
-
* it said (an archive or an answer is never overwritten); without an Edited at column Change and Changed at mark the
|
|
96
|
-
* edit unless they say resolved or answered. True once saved (or unchanged).
|
|
97
|
-
*/
|
|
92
|
+
/** Saves new text for your own comment (the server marks it edited, which Copy changes reports). True once saved. */
|
|
98
93
|
edit(comment: CommentRecord, body: string): Promise<boolean>;
|
|
99
94
|
/**
|
|
100
|
-
* Copies the link that opens this page with the thread revealed (`comment=<root
|
|
95
|
+
* Copies the link that opens this page with the thread revealed (`comment=<root id>`, as a push or a chat pill
|
|
101
96
|
* opens it): the host's address for it (`commentLink`), else the page's own address with that param. A toast says
|
|
102
97
|
* Link copied, or that it could not be copied. `host` (the card) holds the selection copy when the clipboard API is
|
|
103
98
|
* refused. True once copied.
|
|
@@ -106,47 +101,35 @@ export interface CommentActions {
|
|
|
106
101
|
notify(words: Words | string): void;
|
|
107
102
|
}
|
|
108
103
|
export interface UseCommentsOptions {
|
|
109
|
-
/**
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
/**
|
|
105
|
+
* The page (record) the comments belong to: they are read from and written on it. Default: the page the host shows
|
|
106
|
+
* (`spaceComments.page`), else the Space home. Null: the Space home, which lists every comment of the Space grouped
|
|
107
|
+
* by page and writes new ones on no page.
|
|
108
|
+
*/
|
|
114
109
|
scope?: CommentScope | null;
|
|
115
110
|
/** The records threads sit on, in order. Empty: comments are not anchored. */
|
|
116
111
|
anchors?: readonly CommentAnchor[];
|
|
117
112
|
/** The anchor on screen (its record key): the pane's "this item" filter and where pins are placed. */
|
|
118
113
|
anchorKey?: string | null;
|
|
119
|
-
/**
|
|
120
|
-
* The person using the Space; their comments count as changes and never as new activity. Default: the viewer's
|
|
121
|
-
* first name from the host, and when the Author column refuses it (a choice list without that name) "Person",
|
|
122
|
-
* then no author. Pass it to sign comments with a fixed name. Ignored under the host Comments panel: the viewer's
|
|
123
|
-
* name is used, for reading and writing.
|
|
124
|
-
*/
|
|
125
|
-
me?: string;
|
|
126
|
-
/** Authors the Author select knows; anyone else reads as `fallbackAuthor`. Default: any name. */
|
|
127
|
-
authors?: readonly string[];
|
|
128
|
-
fallbackAuthor?: string;
|
|
129
|
-
columns?: Partial<CommentColumns>;
|
|
130
114
|
/** Wording of the digest Copy changes puts on the clipboard. */
|
|
131
115
|
digest?: CommentDigestOptions;
|
|
132
116
|
/** Saves the checkpoint after a copy (for example the scope's "Last turn at"). A throw rolls the checkpoint back. */
|
|
133
117
|
onCheckpoint?(at: string): Promise<void>;
|
|
134
118
|
/** The Space's own wording on top of the defaults. */
|
|
135
119
|
words?: Partial<Record<CommentWordKey, Words>>;
|
|
136
|
-
|
|
137
|
-
/** Follow the database's live feed where the host has one. Default true. */
|
|
120
|
+
/** Lists the comments again whenever the host says they may have changed. Default true. */
|
|
138
121
|
live?: boolean;
|
|
139
122
|
/** Called when a thread is picked (a pin, a card): the Space can move to its anchor and open its panel. */
|
|
140
123
|
onSelectThread?(thread: CommentThread): void;
|
|
141
124
|
/**
|
|
142
|
-
* Open this comment's thread (a root or a reply
|
|
125
|
+
* Open this comment's thread (a root or a reply id) once it is read, and scroll to it. Default: the `comment` view
|
|
143
126
|
* param of a link (`useCommentFocusParam`); null turns that off.
|
|
144
127
|
*/
|
|
145
128
|
focusKey?: string | null;
|
|
146
129
|
/**
|
|
147
130
|
* The comment modes the Space offers (SPC-118), in the order the New comment menu and the tool bar list them.
|
|
148
|
-
* Default: point
|
|
149
|
-
*
|
|
131
|
+
* Default: text, then point and box when there are anchors, items and time when their call-backs are given, and the
|
|
132
|
+
* whole page. 'items' needs `onStartItems`, 'time' needs `currentTime`.
|
|
150
133
|
*/
|
|
151
134
|
modes?: readonly CommentMode[];
|
|
152
135
|
/**
|
|
@@ -156,7 +139,7 @@ export interface UseCommentsOptions {
|
|
|
156
139
|
onStartItems?(): void;
|
|
157
140
|
/** Time mode: the current moment of the recording, in seconds. The new comment is written at that moment. */
|
|
158
141
|
currentTime?(): number | null | undefined;
|
|
159
|
-
/** Names of the pages (scope records, by
|
|
142
|
+
/** Names of the pages (scope records, by record key) the Space home groups comments under. */
|
|
160
143
|
scopeNames?: Readonly<Record<string, string>>;
|
|
161
144
|
}
|
|
162
145
|
export interface CommentController {
|
|
@@ -171,8 +154,8 @@ export interface CommentController {
|
|
|
171
154
|
isNew(comment: CommentRecord): boolean;
|
|
172
155
|
threadsOn(anchorKey: string | null | undefined): CommentThread[];
|
|
173
156
|
/**
|
|
174
|
-
* The thread's pin number (1-based), 0 when it has none: per page
|
|
175
|
-
*
|
|
157
|
+
* The thread's pin number (1-based), 0 when it has none: per page, in the order its first comments were written,
|
|
158
|
+
* deleted ones keeping theirs, so a number never moves and reads the same on the page and the Space home.
|
|
176
159
|
*/
|
|
177
160
|
numberOf(thread: CommentThread): number;
|
|
178
161
|
scope: CommentScope | null;
|
|
@@ -191,7 +174,7 @@ export interface CommentController {
|
|
|
191
174
|
scopeCounts: Readonly<Record<CommentAnchorFilter, number>>;
|
|
192
175
|
/** True when the controller covers the whole Space (no scope record): the pane groups threads by page. */
|
|
193
176
|
wholeSpace: boolean;
|
|
194
|
-
/** The page a thread sits on, for grouping on the Space home: its
|
|
177
|
+
/** The page a thread sits on, for grouping on the Space home: its page, else its anchor, else the Space. */
|
|
195
178
|
groupOf(thread: CommentThread): CommentGroup | null;
|
|
196
179
|
threadKey: string | null;
|
|
197
180
|
setThreadKey(key: string | null): void;
|
|
@@ -214,7 +197,7 @@ export interface CommentController {
|
|
|
214
197
|
canEdit(comment: CommentRecord): boolean;
|
|
215
198
|
/** Whether the viewer may delete it: their own comment; a whole thread or someone else's needs Space edit rights. */
|
|
216
199
|
canDelete(comment: CommentRecord): boolean;
|
|
217
|
-
/** False while the host's viewer is not known
|
|
200
|
+
/** False while the host's viewer is not known (or there is no comment store): Send stays off. */
|
|
218
201
|
canWrite: boolean;
|
|
219
202
|
/** Threads, Goes to and the To chip (SPC-113, SPC-114, SPC-117). */
|
|
220
203
|
routing: CommentRouting;
|
|
@@ -227,6 +210,13 @@ export interface CommentController {
|
|
|
227
210
|
cancelMode(): void;
|
|
228
211
|
/** Items mode: starts a new comment on these anchors (records or rows). */
|
|
229
212
|
startItems(items: readonly CommentAnchor[]): void;
|
|
213
|
+
/** Text mode: starts a new comment on these words (of `anchorKey`'s record when given). */
|
|
214
|
+
placeText(passage: CommentPassage, anchorKey?: string | null): void;
|
|
215
|
+
/**
|
|
216
|
+
* Starts a new comment on a place the host names (Comment on a text selection, `SpaceCommentSource.start`). True
|
|
217
|
+
* when this controller took it.
|
|
218
|
+
*/
|
|
219
|
+
startAnchor(anchor: SpaceCommentAnchor): boolean;
|
|
230
220
|
/** Whether the page comment tool bar shows (`CommentToolBar`, C toggles it). */
|
|
231
221
|
toolBar: boolean;
|
|
232
222
|
setToolBar(on: boolean): void;
|
|
@@ -236,8 +226,8 @@ export interface CommentController {
|
|
|
236
226
|
toggleCommenting(): void;
|
|
237
227
|
draftPin: CommentDraftPin | null;
|
|
238
228
|
/**
|
|
239
|
-
* Names this page's comments (the Space
|
|
240
|
-
*
|
|
229
|
+
* Names this page's comments (the Space and the page) for the drafts the boxes keep while they are away
|
|
230
|
+
* (`commentDrafts`): a reply, a new comment and an answer come back with what was typed and attached.
|
|
241
231
|
*/
|
|
242
232
|
draftScope: string;
|
|
243
233
|
/**
|
|
@@ -247,7 +237,7 @@ export interface CommentController {
|
|
|
247
237
|
placePin(anchorKey: string | null, x: number | null, y: number | null, w?: number | null, h?: number | null): void;
|
|
248
238
|
/** In Add comment mode, drops a pin where the anchor element was clicked. True when a pin was placed. */
|
|
249
239
|
placePinFromEvent(event: ReactMouseEvent<HTMLElement>, anchorKey: string | null): boolean;
|
|
250
|
-
/** True
|
|
240
|
+
/** True: a drag in Add comment mode marks a zone instead of dropping a pin. */
|
|
251
241
|
zones: boolean;
|
|
252
242
|
/** The zone being dragged, while the button is held. */
|
|
253
243
|
dragZone: CommentDragZone | null;
|
|
@@ -257,6 +247,11 @@ export interface CommentController {
|
|
|
257
247
|
cancelPin(): void;
|
|
258
248
|
/** Saves the new comment with the files already uploaded for it. True once saved. */
|
|
259
249
|
sendNew(body: string, files?: readonly CommentFile[]): Promise<boolean>;
|
|
250
|
+
/**
|
|
251
|
+
* Saves a new thread on `place` (a passage's own box), selects it and links it to where it goes. The new comment's
|
|
252
|
+
* id once saved, else null (the failure toast showed).
|
|
253
|
+
*/
|
|
254
|
+
sendAt(place: CommentDraftPin, body: string, files?: readonly CommentFile[]): Promise<string | null>;
|
|
260
255
|
/** @deprecated Delete happens at once with Undo (SPC-133): always null. */
|
|
261
256
|
deleting: CommentRecord | null;
|
|
262
257
|
/** @deprecated Nothing to cancel: delete happens at once with Undo. */
|
|
@@ -264,8 +259,8 @@ export interface CommentController {
|
|
|
264
259
|
/** @deprecated Deletes `comment` at once with Undo (`actions.remove`); without one it does nothing. */
|
|
265
260
|
confirmDelete(comment?: CommentRecord): Promise<void>;
|
|
266
261
|
/**
|
|
267
|
-
* 'on' when people can attach pictures and files: the
|
|
268
|
-
*
|
|
262
|
+
* 'on' when people can attach pictures and files: the host uploads files for comments (signed-in people in Notis;
|
|
263
|
+
* never on a Site, a link or a preview). 'off' leaves the pane text only.
|
|
269
264
|
*/
|
|
270
265
|
attach: CommentAttachMode;
|
|
271
266
|
/** The largest file the host takes, in bytes. */
|
|
@@ -280,7 +275,7 @@ export interface CommentController {
|
|
|
280
275
|
/** Copies the digest and records the checkpoint. `host` is the Space's own element, for the selection fallback. */
|
|
281
276
|
copyChanges(host: HTMLElement | null): Promise<boolean>;
|
|
282
277
|
copying: boolean;
|
|
283
|
-
/**
|
|
278
|
+
/** Comment ids with a write in flight. */
|
|
284
279
|
busy: ReadonlySet<string>;
|
|
285
280
|
now: number;
|
|
286
281
|
toaster: ToastController;
|
|
@@ -288,11 +283,9 @@ export interface CommentController {
|
|
|
288
283
|
/** A word in the reader's language, with `{n}`-style values filled. */
|
|
289
284
|
say(key: CommentWordKey, vars?: Readonly<Record<string, string | number>>): string;
|
|
290
285
|
locale: Locale;
|
|
286
|
+
/** The viewer's name ('' while unknown). */
|
|
291
287
|
me: string;
|
|
292
|
-
/**
|
|
293
|
-
* Runs one comment write signed by the viewer: with the default author, a write the Author column refuses as a
|
|
294
|
-
* choice is tried again as "Person", then without an author, and the author that worked is kept for the session.
|
|
295
|
-
*/
|
|
288
|
+
/** @deprecated The server signs every comment with the viewer: runs `write` with the viewer's name. */
|
|
296
289
|
signed<T>(write: (author: string | null) => Promise<T>): Promise<T>;
|
|
297
290
|
/** Opens an agent's thread in the side chat; undefined on hosts without one. */
|
|
298
291
|
openThread?: (threadId: string) => void;
|
|
@@ -305,22 +298,19 @@ export interface CommentController {
|
|
|
305
298
|
export declare const DELETE_UNDO_TOUCH_MS = 8000;
|
|
306
299
|
/**
|
|
307
300
|
* The link that opens the page with one comment thread revealed: the host's (`commentLink`, a full address that names
|
|
308
|
-
* the thread's own page, possibly later as a promise), else the page's own address with `comment=<root
|
|
301
|
+
* the thread's own page, possibly later as a promise), else the page's own address with `comment=<root id>` (any
|
|
309
302
|
* earlier comment param replaced). Null when neither is known.
|
|
310
303
|
*/
|
|
311
304
|
export declare function commentLinkFor(host: {
|
|
312
305
|
commentLink?(input: {
|
|
313
|
-
|
|
314
|
-
database?: string;
|
|
306
|
+
rootId: string;
|
|
315
307
|
}): string | null | Promise<string | null>;
|
|
316
|
-
} | null | undefined, rootKey: string
|
|
317
|
-
/** The neutral author a Comments database's choice list can offer for anyone it does not name. */
|
|
318
|
-
export declare const COMMENT_PERSON_AUTHOR = "Person";
|
|
308
|
+
} | null | undefined, rootKey: string): string | null | Promise<string | null>;
|
|
319
309
|
/**
|
|
320
|
-
*
|
|
321
|
-
*
|
|
310
|
+
* Where a new comment sits, in the store's words, from the draft the box shows: words of the text, items, a moment, a
|
|
311
|
+
* zone, a point, a whole anchor (a page comment on that anchor) or the whole page.
|
|
322
312
|
*/
|
|
323
|
-
export declare function
|
|
324
|
-
/** The
|
|
325
|
-
export declare function
|
|
313
|
+
export declare function commentAnchorOfDraft(pin: CommentDraftPin | null | undefined): SpaceCommentAnchor;
|
|
314
|
+
/** The draft a place named by the host opens (the reverse of `commentAnchorOfDraft`). */
|
|
315
|
+
export declare function commentDraftOfAnchor(anchor: SpaceCommentAnchor, anchors?: readonly CommentAnchor[]): CommentDraftPin;
|
|
326
316
|
export declare function useComments(options?: UseCommentsOptions): CommentController;
|
|
@@ -5,16 +5,15 @@
|
|
|
5
5
|
* the old quote), and the reading order. `CommentableText`, `CommentableRichText` and `PassageCommentPane` render from
|
|
6
6
|
* it. Its modes default to text (a selection) and the whole page.
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import type { SpaceCommentAnchor } from '../../space';
|
|
9
|
+
import type { CommentThread } from './commentModel';
|
|
9
10
|
import { type CommentController, type CommentFile, type UseCommentsOptions } from './useComments';
|
|
10
|
-
import { type PassageAnchor, type
|
|
11
|
+
import { type PassageAnchor, type PassageField } from './passageModel';
|
|
11
12
|
/** Where a thread was opened: its highlight in the text, its card or its quote in the pane, or a link to one comment. */
|
|
12
13
|
export type PassageOpenedFrom = 'passage' | 'pane' | 'quote' | 'link';
|
|
13
14
|
export interface UsePassageCommentsOptions extends Omit<UseCommentsOptions, 'anchors' | 'anchorKey' | 'onSelectThread'> {
|
|
14
15
|
/** The text properties comments can sit on, in reading order. */
|
|
15
16
|
fields: readonly PassageField[];
|
|
16
|
-
/** Column names of the passage (Field, Quote, Prefix, Suffix by default). */
|
|
17
|
-
passageColumns?: Partial<PassageColumns>;
|
|
18
17
|
/**
|
|
19
18
|
* Each field's value as edited on screen, by field key: a thread whose words are no longer there reads Text
|
|
20
19
|
* changed, and threads list in reading order. A field left out is never marked changed.
|
|
@@ -53,6 +52,11 @@ export interface PassageCommentController {
|
|
|
53
52
|
/** The comment being placed or written on the page (the New comment menu): the same as `controller.draftPin`. */
|
|
54
53
|
draftPin: CommentController['draftPin'];
|
|
55
54
|
startDraft(passage: PassageAnchor): void;
|
|
55
|
+
/**
|
|
56
|
+
* Starts a new comment on a place the host names (Comment on a selection): words in one of `fields` open this
|
|
57
|
+
* controller's own box on them, anything else the page's new comment. True when it was taken.
|
|
58
|
+
*/
|
|
59
|
+
startAnchor(anchor: SpaceCommentAnchor): boolean;
|
|
56
60
|
cancelDraft(): void;
|
|
57
61
|
/**
|
|
58
62
|
* Saves the draft with its text and the pictures and files attached to it (SPC-131: paste, drop or the paperclip),
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
* toolkit has no icon dependency. Every `icon` prop also takes any ReactNode (a Phosphor component, for example).
|
|
4
4
|
*/
|
|
5
5
|
import React, { type ReactNode } from 'react';
|
|
6
|
+
/**
|
|
7
|
+
* Every name the set draws, in the order above. `notis spaces build` refuses an `icon` or `<Icon name>` string that is
|
|
8
|
+
* not one of them; the CLI and the server read the same list from `server/config/notis_app_design_rules.json`, kept
|
|
9
|
+
* equal to this one by `icons.test.tsx`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ICON_NAMES: readonly string[];
|
|
6
12
|
export declare function hasIcon(name: string): boolean;
|
|
7
13
|
/** A built-in icon by name; an unknown name renders nothing and warns once. Decorative: the control carries the label. */
|
|
8
14
|
export declare function Icon({ name, className }: {
|
|
@@ -17,13 +17,13 @@ export * from './actions';
|
|
|
17
17
|
export * from './open';
|
|
18
18
|
export * from './blocks';
|
|
19
19
|
export * from './gallery';
|
|
20
|
-
export { Icon, hasIcon, renderIcon } from './icons';
|
|
20
|
+
export { ICON_NAMES, Icon, hasIcon, renderIcon } from './icons';
|
|
21
21
|
export { adoptToolkitStyles, getToolkitStyleSheet, getToolkitStyleText, registerToolkitStyles, toolkitCascadeFor, TOOLKIT_CASCADE_LAYER } from './styles';
|
|
22
22
|
export type { AdoptToolkitOptions, ToolkitCascade } from './styles';
|
|
23
23
|
export { COMPARES, DEFAULT_COMPARE, DEFAULT_PRESET, EXTRA_PRESETS, PRESETS, compareRange, customPeriod, dayCount, formatPeriodParam, fromIsoDay, isCompareId, isPresetId, normalizePeriod, parsePeriodParam, periodRanges, presetRange, samePeriod, toIsoDay, } from './period/periods';
|
|
24
24
|
export type { CompareId, DateRange as PeriodRange, Period, PresetId } from './period/periods';
|
|
25
25
|
export { dayNumberLabel, formatDateRange, formatDayHeading, formatDelta, formatDuration, formatLongDay, formatMonthYear, formatNumber, formatShortDay, formatValue, intlLocale, weekdayNames, } from './period/dateFormat';
|
|
26
|
-
export type { Delta, DeltaTone, FormatDurationOptions } from './period/dateFormat';
|
|
26
|
+
export type { DayHeadingOptions, Delta, DeltaTone, FormatDurationOptions, InSentenceOptions } from './period/dateFormat';
|
|
27
27
|
export { CALENDAR_WORDS, CHART_WORDS, COMPARE_WORDS, HEATMAP_WORDS, PERIOD_WORDS, PRESET_WORDS, TIMELINE_WORDS, VS_WORDS, } from './period/dateWords';
|
|
28
28
|
export { usePeriod } from './period/usePeriod';
|
|
29
29
|
export type { UsePeriodOptions, UsePeriodResult } from './period/usePeriod';
|
|
@@ -24,10 +24,9 @@ export interface SidePaneProps {
|
|
|
24
24
|
/** The page. */
|
|
25
25
|
children: ReactNode;
|
|
26
26
|
/**
|
|
27
|
-
* The pane, always shown: beside the page while both fit, after it otherwise.
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* element or component keeps its pane column like any other pane.
|
|
27
|
+
* The pane, always shown: beside the page while both fit, after it otherwise. Comments are not a pane: they
|
|
28
|
+
* show in the host Comments panel. A direct `<CommentPane />` or `<PassageCommentPane />` passed here (Spaces built
|
|
29
|
+
* before the single comment store) renders nothing, so the page takes the whole row.
|
|
31
30
|
*/
|
|
32
31
|
pane: ReactNode;
|
|
33
32
|
/** The page never gets narrower than this beside the pane. */
|
|
@@ -32,6 +32,7 @@ import { type ActionOption, type ActionRef, type KeySpec, type Words } from '../
|
|
|
32
32
|
import { type TravelDirection } from '../engine/step';
|
|
33
33
|
import { type ActionHandlers, type ActionOutcome, type ResolvedAction } from '../actions/useActions';
|
|
34
34
|
import type { ToastOptions } from '../actions/useToast';
|
|
35
|
+
import { type FilterChipProps } from '../blocks/blocks';
|
|
35
36
|
import { type TabRowProps } from '../blocks/Tabs';
|
|
36
37
|
import type { OpenMode } from '../open/openModeStore';
|
|
37
38
|
import { type ListBoard } from '../board/boardModel';
|
|
@@ -224,6 +225,13 @@ export interface ListReaderProps<T> {
|
|
|
224
225
|
viewMenu?: ViewMenuProps;
|
|
225
226
|
/** One 44px line under the toolbar (a sync state, a notice). */
|
|
226
227
|
infoLine?: ReactNode;
|
|
228
|
+
/**
|
|
229
|
+
* The filters the view applies on top of its tabs ("Podcasts" from a link), each a chip with an x that clears it,
|
|
230
|
+
* at the start of the info line. Chips that do not fit wrap onto another line; a cleared chip gives focus to the list.
|
|
231
|
+
*/
|
|
232
|
+
filters?: readonly (FilterChipProps & {
|
|
233
|
+
id: string;
|
|
234
|
+
})[];
|
|
227
235
|
/** The top bar search for this list. Leave out for a list with no search. */
|
|
228
236
|
search?: ListSearchProps<T>;
|
|
229
237
|
/**
|
|
@@ -17,19 +17,38 @@ export declare function formatDay(fmt: Intl.DateTimeFormat, date: Date, locale:
|
|
|
17
17
|
* share shows once ("Oct 1 to 15, 2026" / "1er au 15 oct. 2026"). One day reads as that day.
|
|
18
18
|
*/
|
|
19
19
|
export declare function formatDateRange(range: DateRange, locale: Locale, options?: Intl.DateTimeFormatOptions): string;
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
export interface InSentenceOptions {
|
|
21
|
+
/**
|
|
22
|
+
* The words sit inside a sentence ("depuis le jeudi 19 novembre 2026"): French keeps its weekdays and months in
|
|
23
|
+
* lower case, English stays capitalised ("since Thursday, November 19, 2026"). Default false: the text starts a
|
|
24
|
+
* heading, a title or a label, so its first letter is upper case in both languages.
|
|
25
|
+
*/
|
|
26
|
+
inSentence?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface DayHeadingOptions extends InSentenceOptions {
|
|
29
|
+
/** The year left out of the heading. Default the current year. */
|
|
30
|
+
thisYear?: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* One day, long: "Monday, January 5, 2026" / "Lundi 5 janvier 2026". Inside a sentence pass `{ inSentence: true }`:
|
|
34
|
+
* "publiée le lundi 5 janvier 2026".
|
|
35
|
+
*/
|
|
36
|
+
export declare function formatLongDay(date: Date, locale: Locale, options?: InSentenceOptions): string;
|
|
22
37
|
/**
|
|
23
38
|
* A day heading (the agenda, meeting days): "Monday, October 19" / "Lundi 19 octobre", with the year when it is not
|
|
24
|
-
* `thisYear` ("Friday, January 1, 2027").
|
|
39
|
+
* `thisYear` ("Friday, January 1, 2027"). The third argument is `thisYear` or `{ thisYear, inSentence }`; inside a
|
|
40
|
+
* sentence it reads "au plus haut le lundi 19 octobre".
|
|
25
41
|
*/
|
|
26
|
-
export declare function formatDayHeading(date: Date, locale: Locale,
|
|
42
|
+
export declare function formatDayHeading(date: Date, locale: Locale, thisYearOrOptions?: number | DayHeadingOptions): string;
|
|
27
43
|
/** One day, short: "Jan 5" / "5 janv.". */
|
|
28
44
|
export declare function formatShortDay(date: Date, locale: Locale): string;
|
|
29
|
-
/** "January 2026" / "Janvier 2026". */
|
|
30
|
-
export declare function formatMonthYear(date: Date, locale: Locale): string;
|
|
31
|
-
/**
|
|
32
|
-
|
|
45
|
+
/** "January 2026" / "Janvier 2026"; inside a sentence (`{ inSentence: true }`) "depuis octobre 2026". */
|
|
46
|
+
export declare function formatMonthYear(date: Date, locale: Locale, options?: InSentenceOptions): string;
|
|
47
|
+
/**
|
|
48
|
+
* Seven weekday names starting Monday. `narrow` for the day picker, `short` for grids, both column heads. A `long`
|
|
49
|
+
* name inside a sentence takes `{ inSentence: true }`: "le mercredi".
|
|
50
|
+
*/
|
|
51
|
+
export declare function weekdayNames(locale: Locale, width?: 'narrow' | 'short' | 'long', options?: InSentenceOptions): string[];
|
|
33
52
|
/** The number in a month cell: the first of a month carries the month name ("Feb 1" / "1er févr."). */
|
|
34
53
|
export declare function dayNumberLabel(date: Date, locale: Locale, short?: boolean): string;
|
|
35
54
|
/** A number in the locale ("1,020" / "1 020"). */
|