@estiva-app/ui 0.75.0 → 0.77.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/dist/Button.d.ts CHANGED
@@ -26,6 +26,11 @@ import type { ComponentPropsWithRef, ReactNode } from 'react';
26
26
  */
27
27
  export type ButtonVariant = 'primary' | 'outlined' | 'muted' | 'destructive' | 'resolve';
28
28
  export type ButtonSize = 'default' | 'small';
29
+ /** One labelled action a part draws as its own Button: EmptyState's `action`, EntryShell's. */
30
+ export interface ButtonAction {
31
+ label: string;
32
+ onClick: () => void;
33
+ }
29
34
  /**
30
35
  * `ComponentPropsWithRef`, not `ButtonHTMLAttributes`, so a `ref` reaches the
31
36
  * element. React 19 passes `ref` to a function component as an ordinary prop,
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAM7D;;;;;;;;;;;;;;;;;;;GAmBG;AACH;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,aAAa,GAAG,SAAS,CAAA;AACxF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,CAAA;AAE5C;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAY,SAAQ,qBAAqB,CAAC,QAAQ,CAAC;IAClE,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB;6EACyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,MAAM,CAAC,EACrB,OAAiB,EACjB,IAAgB,EAChB,WAAW,EACX,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,IAAe,EACf,GAAG,KAAK,EACT,EAAE,WAAW,+BAsDb"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAM7D;;;;;;;;;;;;;;;;;;;GAmBG;AACH;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,aAAa,GAAG,SAAS,CAAA;AACxF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,CAAA;AAE5C,+FAA+F;AAC/F,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAY,SAAQ,qBAAqB,CAAC,QAAQ,CAAC;IAClE,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB;6EACyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,MAAM,CAAC,EACrB,OAAiB,EACjB,IAAgB,EAChB,WAAW,EACX,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,IAAe,EACf,GAAG,KAAK,EACT,EAAE,WAAW,+BAsDb"}
@@ -0,0 +1,119 @@
1
+ import { type ComponentType, type ReactNode } from 'react';
2
+ import { type AnyExtension } from '@tiptap/core';
3
+ import { type JSONContent } from '@tiptap/react';
4
+ import { type ReferenceViewProps } from './BlockNodes';
5
+ import { type CodeFormat, type MentionPerson, type ReferenceSection, type SlashCommand } from './ComposerTriggers';
6
+ /**
7
+ * The one box every app writes a comment, a reply and a chat line in, from the
8
+ * approved prototype (`concept/comments-everywhere`, Miky 17 October): the
9
+ * package's `ComposeBox` with everything each app built around it — `@`,
10
+ * `!@`, `[` and `/`, the keys, drafts, files, the edit mode, sending and a
11
+ * refused send. An app hands over only its people, its `[` sections, its `/`
12
+ * Insert rows and a send that says whether the relay accepted it.
13
+ *
14
+ * It speaks the editor's document. What that document writes as a message,
15
+ * and the document an edit or a draft opens with, are `@estiva-app/conversation`'s
16
+ * (`composerText`, `composerDocument`, `composerDraft`).
17
+ *
18
+ * why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/every-app-writes-and-reacts-with-one-shared-box.md
19
+ */
20
+ /** What the relay said about a send, an edit or an upload. */
21
+ export type SendAnswer = {
22
+ accepted: true;
23
+ } | {
24
+ accepted: false;
25
+ reason: string;
26
+ };
27
+ /** What an upload answered: the app's own record of the file, or why not. */
28
+ export type UploadAnswer = {
29
+ accepted: true;
30
+ value: unknown;
31
+ } | {
32
+ accepted: false;
33
+ reason: string;
34
+ };
35
+ /** Where a file in the box is: Send waits for one uploading. */
36
+ export type BoxFileState = 'uploading' | 'ready' | 'failed';
37
+ /** A file in the box. */
38
+ export interface BoxFile {
39
+ id: string;
40
+ name: string;
41
+ size?: number;
42
+ contentType?: string;
43
+ state: BoxFileState;
44
+ /** Why it failed, under its name. */
45
+ note?: string;
46
+ /** What `upload` answered for it: the app's own record (an `imeta`, a URL). */
47
+ value?: unknown;
48
+ }
49
+ /** A draft, in the box's terms — `@estiva-app/conversation`'s `composerDraft` is one. */
50
+ export interface CommentBoxDraft {
51
+ read(): JSONContent | undefined;
52
+ write(body: JSONContent): void;
53
+ clear(): void;
54
+ }
55
+ /** Editing something already sent: the same box, with Cancel and Save. */
56
+ export interface CommentBoxEdit {
57
+ /** What it says now, as `composerDocument` opens it. */
58
+ body: JSONContent;
59
+ /** Its files, which can be taken off; none can be added. */
60
+ files?: BoxFile[];
61
+ onCancel: () => void;
62
+ /** Save; the box holds the words until the answer, and a refusal is said under it. */
63
+ onSave: (body: JSONContent, files: BoxFile[]) => Promise<SendAnswer>;
64
+ }
65
+ export interface CommentBoxProps {
66
+ /** Who `@` and `!@` offer. */
67
+ people: readonly MentionPerson[];
68
+ /** What `[` lists for what was typed, already in the app's order. Absent, `[` opens nothing. */
69
+ references?: (query: string) => readonly ReferenceSection[];
70
+ /** Called with a listener while `[` is open; call it when `references` would answer differently (a search landed). */
71
+ referencesChanged?: (listener: () => void) => () => void;
72
+ /** A `[` row's and chip's 16px icon from what it points at; absent, a neutral square. */
73
+ referenceIcon?: (uri: string | null) => ReactNode | undefined;
74
+ /** The app's own `/` Insert rows, after the shared Format section: {@link commentBoxRows} and its own. */
75
+ insert?: readonly SlashCommand[];
76
+ /** `/` → Code: a mark inside the line, or a block. */
77
+ code?: CodeFormat;
78
+ /** Send what is written, with the files that are ready; resolves with the relay's answer. */
79
+ send: (body: JSONContent, files: BoxFile[]) => Promise<SendAnswer>;
80
+ /**
81
+ * The app shows a send before the relay answers: the box empties at once,
82
+ * and a refusal puts the words back. Otherwise the box holds the words, shut,
83
+ * until the answer.
84
+ */
85
+ showsAtOnce?: boolean;
86
+ /** The editor's accessible name: what the box is for. */
87
+ label: string;
88
+ /** Said in the empty box. */
89
+ placeholder: ReactNode;
90
+ /** Keeps what is written when the box goes away. Give the box a React `key` per destination. */
91
+ draft?: CommentBoxDraft;
92
+ /** Editing something already sent. */
93
+ edit?: CommentBoxEdit;
94
+ /** Offers the paperclip, `/` → File, a pasted picture and a dropped file: uploads one, and answers. */
95
+ upload?: (file: File) => Promise<UploadAnswer>;
96
+ /** The file picker's `accept`. */
97
+ accept?: string;
98
+ /** The box cannot write here (an archived file, signed out): a line saying why takes its place. */
99
+ closed?: {
100
+ reason: ReactNode;
101
+ };
102
+ /** How a `nostr:` reference the box holds is drawn — the app's own chip. Absent, as its URI. */
103
+ referenceView?: ComponentType<ReferenceViewProps>;
104
+ /** The app's own extra editor extensions: link chips, highlights. */
105
+ extensions?: readonly AnyExtension[];
106
+ autoFocus?: boolean;
107
+ /** Called with what was sent once it went out: at once when `showsAtOnce`, else on the answer. */
108
+ onSent?: (body: JSONContent, files: BoxFile[]) => void;
109
+ /** Called when a send shown at once was refused, so the app takes it back. */
110
+ onRefused?: () => void;
111
+ className?: string;
112
+ }
113
+ /**
114
+ * The `/` Insert rows the kit offers. Pass the ones an app can perform, in
115
+ * its order, with its own after them; an edit drops File and Urgent itself.
116
+ */
117
+ export declare const commentBoxRows: Readonly<Record<'file' | 'mention' | 'urgent' | 'reference', SlashCommand>>;
118
+ export declare function CommentBox({ people, references, referencesChanged, referenceIcon, insert, code, send, showsAtOnce, label, placeholder, draft, edit, upload, accept, closed, referenceView, extensions, autoFocus, onSent, onRefused, className, }: CommentBoxProps): import("react").JSX.Element;
119
+ //# sourceMappingURL=CommentBox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommentBox.d.ts","sourceRoot":"","sources":["../src/CommentBox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,aAAa,EAAkB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACpH,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAyC,KAAK,WAAW,EAAE,MAAM,eAAe,CAAA;AAIvF,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAKrE,OAAO,EAQL,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAElB,MAAM,oBAAoB,CAAA;AAU3B;;;;;;;;;;;;;GAaG;AAEH,8DAA8D;AAC9D,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAEjF,6EAA6E;AAC7E,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,QAA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M,CAAC,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,EAAE,YAAY,CAAC,CAKtG,CAAA;AAsBD,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,MAAW,EACX,IAAc,EACd,IAAI,EACJ,WAAmB,EACnB,KAAK,EACL,WAAW,EACX,KAAK,EACL,IAAI,EACJ,MAAM,EACN,MAAM,EACN,MAAM,EACN,aAAa,EACb,UAAe,EACf,SAAS,EACT,MAAM,EACN,SAAS,EACT,SAAS,GACV,EAAE,eAAe,+BAqRjB"}
@@ -21,6 +21,8 @@ type ComposeKeysStorage = {
21
21
  * open picks a row instead. `ComposeBox` says what sending does.
22
22
  */
23
23
  export declare const ComposeKeys: Extension<Record<string, never>, ComposeKeysStorage>;
24
+ /** Nothing written: no text, no chip and no picture — empty lines, spaces, lists or quotes only. */
25
+ export declare function isEmptyDoc(editor: Editor): boolean;
24
26
  export interface ComposeBoxProps {
25
27
  /** The app's editor, with `ComposeKeys` in its extensions and `COMPOSE_EDITOR_CLASSES` on it. `null` while it loads. */
26
28
  editor: Editor | null;
@@ -1 +1 @@
1
- {"version":3,"file":"ComposeBox.d.ts","sourceRoot":"","sources":["../src/ComposeBox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AAO1D,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAGjF;;;;;;GAMG;AAEH,8HAA8H;AAC9H,eAAO,MAAM,sBAAsB,QAAgG,CAAA;AAEnI,KAAK,kBAAkB,GAAG;IAAE,IAAI,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,IAAI,CAAA;CAAE,CAAA;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,WAA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,IAAI,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,IAAI,CAAA;CAAE,CAAA;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,WAAW,sDA4BtB,CAAA;AAEF,oGAAoG;AACpG,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CASlD;AAED,MAAM,WAAW,eAAe;IAC9B,wHAAwH;IACxH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB;;;OAGG;IACH,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAA;IAC1C,2FAA2F;IAC3F,WAAW,EAAE,SAAS,CAAA;IACtB,0FAA0F;IAC1F,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,mEAAmE;IACnE,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,wFAAwF;IACxF,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,qFAAqF;IACrF,SAAS,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC,CAAA;IACrE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,KAAa,EAAE,OAAe,EAAE,MAAc,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,eAAe,+BAgFpK"}
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
+ import { type ButtonAction } from './Button';
2
3
  /**
3
4
  * The place where content will be once there is some, in two manners
4
5
  * (Katerina, 2026-09-09):
@@ -30,10 +31,7 @@ export interface EmptyStateProps {
30
31
  * the line as the package's Button, outlined (Katerina, 2026-09-18). A `page`
31
32
  * only: a section's empty line is one line among others, not a stage.
32
33
  */
33
- action?: {
34
- label: string;
35
- onClick: () => void;
36
- };
34
+ action?: ButtonAction;
37
35
  className?: string;
38
36
  }
39
37
  export declare function EmptyState({ icon, message, scope, action, className }: EmptyStateProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../src/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,eAAe;IAC9B,8EAA8E;IAC9E,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAA;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAc,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,eAAe,+BAgB/F"}
1
+ {"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../src/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,UAAU,CAAA;AAGpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,eAAe;IAC9B,8EAA8E;IAC9E,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAc,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,eAAe,+BAgB/F"}
@@ -0,0 +1,50 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ import { type ButtonAction } from './Button';
3
+ /**
4
+ * What an app shows while nobody is signed in to it: its logo, one line saying
5
+ * why, and at most one button. Peek's AuthShell (PEEK-116), moved here so every
6
+ * app draws the same screen (AUT-3, 2026-10-17).
7
+ *
8
+ * The words are the caller's: a shared part has none of its own for why entry
9
+ * stopped.
10
+ */
11
+ export interface EntryShellProps {
12
+ /**
13
+ * The app's own mark, drawn at the top in every state, as given: the app
14
+ * sizes it. An element that takes a `className`, because while `busy` the
15
+ * pulse goes on the mark itself.
16
+ */
17
+ logo: ReactElement<{
18
+ className?: string;
19
+ }>;
20
+ /**
21
+ * Entry is still being decided: the logo alone, faded in after 150ms (as a
22
+ * Skeleton is), so an entry that resolves at once flashes nothing. The
23
+ * message and the action are not drawn. Assistive technology hears a busy
24
+ * status named `busyLabel`. The logo carries the pulse class too, as Peek's
25
+ * did; the reveal overrides it here, and an app that themes the pulse (Peek's
26
+ * Signal shimmer) draws its own instead.
27
+ */
28
+ busy?: boolean;
29
+ /** What a screen reader hears while `busy`; nothing is drawn for it. */
30
+ busyLabel?: string;
31
+ /**
32
+ * The one line saying why nobody is signed in, announced politely when it
33
+ * appears. Nothing is drawn for an empty one.
34
+ */
35
+ message?: ReactNode;
36
+ /**
37
+ * The one thing to do about it, drawn under the line (or alone, with no
38
+ * `message`) as the package's primary Button. Leave it out when nothing the
39
+ * person can do would help: a button that cannot work is worse than none.
40
+ * `onClick` runs from the tap itself, so a prompt that needs the person's
41
+ * gesture may start in it; `disabled` holds the button while that runs, so a
42
+ * second tap starts nothing.
43
+ */
44
+ action?: ButtonAction & {
45
+ disabled?: boolean;
46
+ };
47
+ className?: string;
48
+ }
49
+ export declare function EntryShell({ logo, busy, busyLabel, message, action, className }: EntryShellProps): import("react").JSX.Element;
50
+ //# sourceMappingURL=EntryShell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntryShell.d.ts","sourceRoot":"","sources":["../src/EntryShell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACvE,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,UAAU,CAAA;AAGpD;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,IAAI,EAAE,YAAY,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC1C;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,YAAY,GAAG;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAID,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,IAAY,EAAE,SAAqB,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,eAAe,+BA0BpH"}
@@ -0,0 +1,44 @@
1
+ import { type ReactionOption } from './ReactionPicker';
2
+ /**
3
+ * The one reaction row every app draws under a comment or a chat line, from
4
+ * the approved prototype (`concept/comments-everywhere`, Miky 17 October):
5
+ * `Reaction` pills in the order they were first chosen, each saying who
6
+ * reacted on hover, then the add button with `ReactionPicker`. Nobody reacted:
7
+ * no row; the add button sits with the other actions (`AddReactionButton`).
8
+ *
9
+ * What a reaction writes and how reactions are counted stay in
10
+ * `@estiva-app/conversation` (SPEC §6.6): its `groupReactions` answers the
11
+ * `reactions` this takes, and its `REACTION_EMOJI` the five `options`.
12
+ *
13
+ * why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/every-app-writes-and-reacts-with-one-shared-box.md
14
+ */
15
+ /** One emoji on one target, and who put it there, in the order they reacted. */
16
+ export interface ReactionCount {
17
+ emoji: string;
18
+ by: readonly string[];
19
+ }
20
+ /** "Person one, Person two and you reacted with Makes sense". */
21
+ export declare function whoReacted(reaction: ReactionCount, nameOf: (id: string) => string, options: readonly ReactionOption[], viewer?: string): string;
22
+ export interface AddReactionButtonProps {
23
+ /** The emoji offered, each named. */
24
+ options: readonly ReactionOption[];
25
+ onPick: (emoji: string) => void;
26
+ className?: string;
27
+ }
28
+ /** The add button: `ReactionPicker` opens over it. */
29
+ export declare function AddReactionButton({ options, onPick, className }: AddReactionButtonProps): import("react").JSX.Element;
30
+ export interface ReactionRowProps {
31
+ /** Each emoji and who chose it, in the order first chosen. An emoji nobody holds is not drawn. */
32
+ reactions: readonly ReactionCount[];
33
+ /** The emoji offered, each named; also what a pill's name is read from. */
34
+ options: readonly ReactionOption[];
35
+ /** A reactor's name, as "who reacted" says it. */
36
+ nameOf: (id: string) => string;
37
+ /** Who is looking: their pills are lit, and "who reacted" says "you". */
38
+ viewer?: string;
39
+ /** Your reaction on or off. Absent, the row only shows (read-only, signed out). */
40
+ onToggle?: (emoji: string) => void;
41
+ className?: string;
42
+ }
43
+ export declare function ReactionRow({ reactions, options, nameOf, viewer, onToggle, className }: ReactionRowProps): import("react").JSX.Element | null;
44
+ //# sourceMappingURL=ReactionRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactionRow.d.ts","sourceRoot":"","sources":["../src/ReactionRow.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGtE;;;;;;;;;;;;GAYG;AAEH,gFAAgF;AAChF,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,EAAE,SAAS,MAAM,EAAE,CAAA;CACtB;AAOD,iEAAiE;AACjE,wBAAgB,UAAU,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,EAAE,OAAO,EAAE,SAAS,cAAc,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAS/I;AAED,MAAM,WAAW,sBAAsB;IACrC,qCAAqC;IACrC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAA;IAClC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,sDAAsD;AACtD,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,sBAAsB,+BA2BvF;AAED,MAAM,WAAW,gBAAgB;IAC/B,kGAAkG;IAClG,SAAS,EAAE,SAAS,aAAa,EAAE,CAAA;IACnC,2EAA2E;IAC3E,OAAO,EAAE,SAAS,cAAc,EAAE,CAAA;IAClC,kDAAkD;IAClD,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9B,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mFAAmF;IACnF,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,gBAAgB,sCAoBxG"}
package/dist/editor.d.ts CHANGED
@@ -9,6 +9,7 @@
9
9
  */
10
10
  export { KeptSelection, SelectionToolbar, keepSelection, releaseSelection, normalizeHref, type MarkId, type SelectionAction, type SelectionToolbarProps } from './SelectionToolbar';
11
11
  export { ComposeBox, ComposeKeys, COMPOSE_EDITOR_CLASSES, type ComposeBoxProps } from './ComposeBox';
12
+ export { CommentBox, commentBoxRows, type CommentBoxProps, type CommentBoxDraft, type CommentBoxEdit, type BoxFile, type BoxFileState, type SendAnswer, type UploadAnswer, } from './CommentBox';
12
13
  export { InlineText, type InlineTextProps, type InlineTextHandle } from './InlineText';
13
14
  export { CommentHighlights, setCommentAnchors, commentPlace, commentElement, anchorOfSelection, quoteText, type CommentAnchor, type CommentHighlightsOptions, type CommentPlace, type CommentQuote, type SelectionAnchor, } from './CommentHighlights';
14
15
  export { PastedImages, pastedImages, pastedImageName, type PastedImagesOptions, type ClipboardSource } from './PastedImages';
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,KAAK,MAAM,EAAE,KAAK,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AACnL,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,sBAAsB,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AACpG,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACtF,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC5H,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OA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