@estiva-app/ui 0.50.4 → 0.52.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/CollapsibleSection.d.ts +7 -1
- package/dist/CollapsibleSection.d.ts.map +1 -1
- package/dist/ComposerTriggers.d.ts +169 -0
- package/dist/ComposerTriggers.d.ts.map +1 -0
- package/dist/NavItem.d.ts +23 -3
- package/dist/NavItem.d.ts.map +1 -1
- package/dist/NavTree.d.ts +49 -0
- package/dist/NavTree.d.ts.map +1 -0
- package/dist/SectionLabel.d.ts +7 -1
- package/dist/SectionLabel.d.ts.map +1 -1
- package/dist/editor.d.ts +1 -0
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +313 -12
- package/dist/editor.js.map +4 -4
- package/dist/eslint/index.js +1 -1
- package/dist/eslint/index.js.map +2 -2
- package/dist/eslint/no-native-title.d.ts +1 -1
- package/dist/eslint/no-native-title.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +332 -212
- package/dist/index.js.map +4 -4
- package/dist/looks.d.ts +7 -0
- package/dist/looks.d.ts.map +1 -1
- package/package.json +6 -1
- package/registry.json +426 -5
- package/src/CollapsibleSection.mdx +6 -0
- package/src/CollapsibleSection.stories.tsx +5 -0
- package/src/CollapsibleSection.tsx +12 -4
- package/src/ComposerTriggers.mdx +108 -0
- package/src/ComposerTriggers.stories.tsx +79 -0
- package/src/ComposerTriggers.test.tsx +207 -0
- package/src/ComposerTriggers.tsx +507 -0
- package/src/NavItem.mdx +30 -0
- package/src/NavItem.stories.tsx +34 -0
- package/src/NavItem.test.tsx +82 -0
- package/src/NavItem.tsx +123 -25
- package/src/NavTree.mdx +83 -0
- package/src/NavTree.stories.tsx +84 -0
- package/src/NavTree.test.tsx +54 -0
- package/src/NavTree.tsx +112 -0
- package/src/SectionHeader.tsx +1 -1
- package/src/SectionLabel.mdx +4 -1
- package/src/SectionLabel.stories.tsx +3 -0
- package/src/SectionLabel.tsx +10 -2
- package/src/editor.ts +29 -0
- package/src/eslint/no-native-title.ts +1 -1
- package/src/index.ts +1 -0
- package/src/looks.ts +8 -0
- package/src/registry/registry.test.ts +9 -8
- package/stories/Choosing.mdx +2 -0
|
@@ -39,6 +39,12 @@ export interface CollapsibleSectionProps {
|
|
|
39
39
|
* its title, past the chevron (`SectionHeader`'s `look`).
|
|
40
40
|
*/
|
|
41
41
|
look?: 'heading' | 'row';
|
|
42
|
+
/**
|
|
43
|
+
* With the `heading` look: the rows start under the title, past the
|
|
44
|
+
* chevron — a folder in a sidebar, its files lightly indented under its
|
|
45
|
+
* name (Katerina, 2 October). The `row` look always indents.
|
|
46
|
+
*/
|
|
47
|
+
indent?: boolean;
|
|
42
48
|
/** The rows. */
|
|
43
49
|
children: ReactNode;
|
|
44
50
|
/** On the section's box: `mt-2` between groups, `shrink-0` in a scrolling column. */
|
|
@@ -46,5 +52,5 @@ export interface CollapsibleSectionProps {
|
|
|
46
52
|
/** On the box the rows sit in: the gap between them. */
|
|
47
53
|
contentClassName?: string;
|
|
48
54
|
}
|
|
49
|
-
export declare function CollapsibleSection({ title, defaultOpen, open: openProp, onOpenChange, storageKey, trailing, actions, showActions, look, children, className, contentClassName }: CollapsibleSectionProps): import("react").JSX.Element;
|
|
55
|
+
export declare function CollapsibleSection({ title, defaultOpen, open: openProp, onOpenChange, storageKey, trailing, actions, showActions, look, indent, children, className, contentClassName }: CollapsibleSectionProps): import("react").JSX.Element;
|
|
50
56
|
//# sourceMappingURL=CollapsibleSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleSection.d.ts","sourceRoot":"","sources":["../src/CollapsibleSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGhD,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"CollapsibleSection.d.ts","sourceRoot":"","sources":["../src/CollapsibleSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGhD,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAGnE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAA;IACb,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,iCAAiC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,wEAAwE;IACxE,OAAO,CAAC,EAAE,aAAa,EAAE,CAAA;IACzB,WAAW,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAChC;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CAAA;IACxB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,gBAAgB;IAChB,QAAQ,EAAE,SAAS,CAAA;IACnB,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAwBD,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,WAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,IAAgB,EAAE,MAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,uBAAuB,+BA2B3O"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { Extension, type Editor } from '@tiptap/core';
|
|
3
|
+
import { type MentionOptions } from '@tiptap/extension-mention';
|
|
4
|
+
import type { SuggestionMenuRow } from './SuggestionMenu';
|
|
5
|
+
import { type SuggestionPopupOptions } from './suggestionPopup';
|
|
6
|
+
/** A person `@` and `!@` offer. */
|
|
7
|
+
export interface MentionPerson {
|
|
8
|
+
/** The app's own key for the person — the row's key and the chip's `id`. */
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
/** The second line of the row: a role, a team. */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Their Nostr key, when they have one — what the body is written with (SPEC §13.1). */
|
|
14
|
+
pubkey?: string | null;
|
|
15
|
+
/** The face at the row's start. Default: the package `Avatar` for the name. */
|
|
16
|
+
avatar?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/** How many people the list shows. */
|
|
19
|
+
export declare const PEOPLE_LIMIT = 6;
|
|
20
|
+
/** The people whose name holds the query, the first {@link PEOPLE_LIMIT} of them. */
|
|
21
|
+
export declare function filterPeople(people: readonly MentionPerson[], query: string): MentionPerson[];
|
|
22
|
+
/**
|
|
23
|
+
* The people list `@` and `!@` open: the face, the name, the second line, and
|
|
24
|
+
* the Enter hint while highlighted — `MenuItem` at its tall size.
|
|
25
|
+
*/
|
|
26
|
+
export declare function peopleMenu(urgent: boolean): SuggestionPopupOptions<MentionPerson>;
|
|
27
|
+
export interface PersonMentionOptions {
|
|
28
|
+
/** Everyone the list can offer, asked each time the query changes. */
|
|
29
|
+
people: () => readonly MentionPerson[];
|
|
30
|
+
}
|
|
31
|
+
type Doc = {
|
|
32
|
+
descendants: (cb: (node: {
|
|
33
|
+
type: {
|
|
34
|
+
name: string;
|
|
35
|
+
};
|
|
36
|
+
attrs: Record<string, unknown>;
|
|
37
|
+
}) => boolean | void) => void;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* `@` — a person, as a chip that writes their key (SPEC §13.1).
|
|
41
|
+
*
|
|
42
|
+
* PersonMention.configure({ people: () => directory })
|
|
43
|
+
*
|
|
44
|
+
* Its `pubkey` and `label` are what `mentionText` takes.
|
|
45
|
+
*/
|
|
46
|
+
export declare const PersonMention: import("@tiptap/core").Node<MentionOptions<MentionPerson, MentionPerson> & PersonMentionOptions, any>;
|
|
47
|
+
/**
|
|
48
|
+
* `!@` — a person, urgently: the same chip in the urgent tone. Its text is an
|
|
49
|
+
* ordinary mention; the urgency travels as a tag (`urgentTagsFor`), so hand the
|
|
50
|
+
* write {@link urgentPubkeys}.
|
|
51
|
+
*/
|
|
52
|
+
export declare const UrgentPersonMention: import("@tiptap/core").Node<MentionOptions<MentionPerson, MentionPerson> & PersonMentionOptions, any>;
|
|
53
|
+
/**
|
|
54
|
+
* The keys the document's urgent mentions name — what the write turns into
|
|
55
|
+
* `["urgent", <pubkey>]` tags. A chip with no key has no tag to carry; its text
|
|
56
|
+
* is the old `!@Name`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function urgentPubkeys(editor: {
|
|
59
|
+
state: {
|
|
60
|
+
doc: Doc;
|
|
61
|
+
};
|
|
62
|
+
}): string[] | undefined;
|
|
63
|
+
/** Something `[` offers: a reference drawn as who said it and how it opens. */
|
|
64
|
+
export interface CaptionedItem {
|
|
65
|
+
/** The referenced thing's id — the row's key and the chip's `id`. */
|
|
66
|
+
id: string;
|
|
67
|
+
/** Who, as the list shows them. */
|
|
68
|
+
label: string;
|
|
69
|
+
/** The opening words, marks stripped: the caption the row and the chip wear. */
|
|
70
|
+
snippet: string;
|
|
71
|
+
/** `nostr:…`, exactly as the body will carry it (`messageReference`). */
|
|
72
|
+
uri: string;
|
|
73
|
+
/** What the query is matched against beside `label`. Default: `snippet`. */
|
|
74
|
+
search?: string;
|
|
75
|
+
}
|
|
76
|
+
/** How many references the list shows. */
|
|
77
|
+
export declare const REFERENCE_LIMIT = 6;
|
|
78
|
+
/**
|
|
79
|
+
* The references whose label or text holds the query — the last
|
|
80
|
+
* {@link REFERENCE_LIMIT}, in the order given: a thread is unbounded, and a
|
|
81
|
+
* list that grew with it would be a hundred rows of prose.
|
|
82
|
+
*/
|
|
83
|
+
export declare function filterReferences(items: readonly CaptionedItem[], query: string): CaptionedItem[];
|
|
84
|
+
export interface CaptionedReferenceOptions {
|
|
85
|
+
/** Drawn before the caption: a 14px icon. */
|
|
86
|
+
icon: ReactNode;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A reference mid-sentence, drawn as `label: snippet` and written as its `uri`
|
|
90
|
+
* verbatim (SPEC §13.1). The caption is the snapshot it was picked with — a
|
|
91
|
+
* caption, never parsed. Inserted by {@link ReferenceTrigger}, a paste or a
|
|
92
|
+
* draft; it opens no list of its own.
|
|
93
|
+
*/
|
|
94
|
+
export declare const CaptionedReference: import("@tiptap/core").Node<MentionOptions<any, import("@tiptap/extension-mention").MentionNodeAttrs> & CaptionedReferenceOptions, any>;
|
|
95
|
+
export interface ReferenceMenuOptions {
|
|
96
|
+
/** Names the list, e.g. what can be referenced. */
|
|
97
|
+
ariaLabel: string;
|
|
98
|
+
/** The section's heading. */
|
|
99
|
+
sectionLabel: string;
|
|
100
|
+
/** At each row's start: a 16px icon. */
|
|
101
|
+
icon: ReactNode;
|
|
102
|
+
}
|
|
103
|
+
/** The list `[` opens: one section of `label: snippet` rows, the same box as the people list. */
|
|
104
|
+
export declare function referenceMenu({ ariaLabel, sectionLabel, icon }: ReferenceMenuOptions): SuggestionPopupOptions<CaptionedItem>;
|
|
105
|
+
export interface ReferenceTriggerOptions extends ReferenceMenuOptions {
|
|
106
|
+
/** Everything `[` can offer, asked each time the query changes. */
|
|
107
|
+
items: () => readonly CaptionedItem[];
|
|
108
|
+
/** The node a pick inserts. Default `captionedReference`. */
|
|
109
|
+
nodeName: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* `[` — reference something, inserted as a {@link CaptionedReference} chip.
|
|
113
|
+
*
|
|
114
|
+
* Its own extension rather than the chip's suggestion, so the chip's text (its
|
|
115
|
+
* `renderText`) does not change with the key that summons the list.
|
|
116
|
+
*/
|
|
117
|
+
export declare const ReferenceTrigger: Extension<ReferenceTriggerOptions, any>;
|
|
118
|
+
/** A row of the `/` list, and what choosing it does. */
|
|
119
|
+
export interface SlashCommand {
|
|
120
|
+
key: string;
|
|
121
|
+
row: SuggestionMenuRow;
|
|
122
|
+
/** Matched beside the row's label: an id, a trigger, a description. */
|
|
123
|
+
keywords?: readonly string[];
|
|
124
|
+
/** Runs once the `/query` that summoned the list has been removed. */
|
|
125
|
+
run: (editor: Editor) => void;
|
|
126
|
+
}
|
|
127
|
+
export interface SlashSection {
|
|
128
|
+
label: string;
|
|
129
|
+
commands: readonly SlashCommand[];
|
|
130
|
+
}
|
|
131
|
+
export type FormatId = 'paragraph' | 'heading' | 'subheading' | 'quote' | 'bulletList' | 'orderedList' | 'code';
|
|
132
|
+
export interface FormatDef {
|
|
133
|
+
id: FormatId;
|
|
134
|
+
label: string;
|
|
135
|
+
/** What you type to get it — the input rule the extension registers. Blank when there is none. */
|
|
136
|
+
trigger?: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The formats `/` offers, in order. The hint is what you would type, not a key
|
|
140
|
+
* chord. Bold, italic and underline are absent: they act on text already
|
|
141
|
+
* written, so they are the selection toolbar's.
|
|
142
|
+
*/
|
|
143
|
+
export declare const FORMATS: readonly FormatDef[];
|
|
144
|
+
/** Code as a mark inside the line, or as a block of its own. */
|
|
145
|
+
export type CodeFormat = 'inline' | 'block';
|
|
146
|
+
/**
|
|
147
|
+
* Apply one format to the current block. `set*` wherever Tiptap has one:
|
|
148
|
+
* choosing Heading should make a heading, not turn one off. `false` means
|
|
149
|
+
* nothing changed, not that anything failed.
|
|
150
|
+
*/
|
|
151
|
+
export declare function applyFormat(editor: Editor, id: FormatId, code?: CodeFormat): boolean;
|
|
152
|
+
/** The Format section every app's `/` opens with. */
|
|
153
|
+
export declare function formatSection(code?: CodeFormat): SlashSection;
|
|
154
|
+
/** A row that types another trigger, so its own list opens — `@` from `/`. */
|
|
155
|
+
export declare function typeTrigger(input: string): SlashCommand['run'];
|
|
156
|
+
/** The sections narrowed to a query — the text typed after the `/`. Empty sections stay. */
|
|
157
|
+
export declare function filterSlashSections(sections: readonly SlashSection[], query: string): SlashSection[];
|
|
158
|
+
export interface SlashCommandsOptions {
|
|
159
|
+
/** The sections, in order: {@link formatSection} first, then the app's own. */
|
|
160
|
+
sections: readonly SlashSection[];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* `/` — format the line or insert something, at the caret, mid-sentence too.
|
|
164
|
+
* A `/` inside a word (`and/or`, a path) opens nothing: the plugin wants a
|
|
165
|
+
* space or the line's start before it.
|
|
166
|
+
*/
|
|
167
|
+
export declare const SlashCommands: Extension<SlashCommandsOptions, any>;
|
|
168
|
+
export {};
|
|
169
|
+
//# sourceMappingURL=ComposerTriggers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComposerTriggers.d.ts","sourceRoot":"","sources":["../src/ComposerTriggers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAA;AAErD,OAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAMxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAmB,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAiBhF,mCAAmC;AACnC,MAAM,WAAW,aAAa;IAC5B,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,SAAS,CAAA;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AAM,WAAW,SAAS;IACxB,EAAE,EAAE,QAAQ,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,kGAAkG;IAClG,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,SAAS,SAAS,EAQvC,CAAA;AAED,gEAAgE;AAChE,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE3C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,GAAE,UAAqB,GAAG,OAAO,CA8B9F;AAED,qDAAqD;AACrD,wBAAgB,aAAa,CAAC,IAAI,GAAE,UAAqB,GAAG,YAAY,CAYvE;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAM9D;AAMD,4FAA4F;AAC5F,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,EAAE,CAGpG;AAED,MAAM,WAAW,oBAAoB;IACnC,+EAA+E;IAC/E,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAA;CAClC;AAID;;;;GAIG;AACH,eAAO,MAAM,aAAa,sCA6BxB,CAAA"}
|
package/dist/NavItem.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* One row of a sidebar: a label, an optional count, an active state
|
|
4
4
|
* (Ship's NavItem, 2026-09-02, verbatim).
|
|
@@ -15,8 +15,19 @@ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
|
15
15
|
* menu is open, in the count's place — the count steps aside rather than
|
|
16
16
|
* sitting under it. The ⋮ is beside the link, not inside it (a button inside
|
|
17
17
|
* an anchor is not a button), and follows it in the Tab order.
|
|
18
|
+
*
|
|
19
|
+
* `children` are rows under this one (Katerina, 2 October: Leaf's folder
|
|
20
|
+
* tree). The row stays a link; while it is pointed at or focused its icon
|
|
21
|
+
* gives way to an arrow that folds the rows, in the icon's own place — so a
|
|
22
|
+
* row with rows under it is as wide as one without. The arrow is beside the
|
|
23
|
+
* link, like the ⋮. The rows slide as `CollapsibleSection`'s do, indented
|
|
24
|
+
* past the icon so their icons start under this row's label.
|
|
25
|
+
*
|
|
26
|
+
* `hint` is shown only while the row is pointed at or focused, left of the
|
|
27
|
+
* count — a neutral `Chip`, typically. It takes its own room while it shows,
|
|
28
|
+
* so the label ends with "…" before it instead of running under it.
|
|
18
29
|
*/
|
|
19
|
-
export interface NavItemProps extends Omit<ComponentPropsWithoutRef<'a'>, 'href'> {
|
|
30
|
+
export interface NavItemProps extends Omit<ComponentPropsWithoutRef<'a'>, 'href' | 'children'> {
|
|
20
31
|
label: string;
|
|
21
32
|
href: string;
|
|
22
33
|
/** `0` or absent renders no counter. */
|
|
@@ -30,7 +41,16 @@ export interface NavItemProps extends Omit<ComponentPropsWithoutRef<'a'>, 'href'
|
|
|
30
41
|
menu?: ReactNode;
|
|
31
42
|
/** The ⋮'s accessible name and tooltip. Default "More options for {label}". */
|
|
32
43
|
menuLabel?: string;
|
|
44
|
+
/** Shown only while the row is pointed at or focused, left of the count: a neutral `Chip`, typically. */
|
|
45
|
+
hint?: ReactNode;
|
|
46
|
+
/** Rows under this one, folding under it: `NavItem`s. While the row is pointed at or focused, its icon becomes the arrow. */
|
|
47
|
+
children?: ReactNode;
|
|
48
|
+
/** With `children`: open unless told otherwise. */
|
|
49
|
+
defaultOpen?: boolean;
|
|
50
|
+
/** With `children`: the caller owns the state. */
|
|
51
|
+
open?: boolean;
|
|
52
|
+
onOpenChange?: (open: boolean) => void;
|
|
33
53
|
className?: string;
|
|
34
54
|
}
|
|
35
|
-
export declare function NavItem({ label, href, count, countLabel, active, icon, menu, menuLabel, className, ...props }: NavItemProps): import("react").JSX.Element;
|
|
55
|
+
export declare function NavItem({ label, href, count, countLabel, active, icon, menu, menuLabel, hint, children, defaultOpen, open: openProp, onOpenChange, className, ...props }: NavItemProps): import("react").JSX.Element;
|
|
36
56
|
//# sourceMappingURL=NavItem.d.ts.map
|
package/dist/NavItem.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavItem.d.ts","sourceRoot":"","sources":["../src/NavItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"NavItem.d.ts","sourceRoot":"","sources":["../src/NavItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAStF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5F,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,wBAAwB;IACxB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,4GAA4G;IAC5G,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,yGAAyG;IACzG,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,6HAA6H;IAC7H,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,mDAAmD;IACnD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,kDAAkD;IAClD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,UAAU,EACV,MAAc,EACd,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,WAAkB,EAClB,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,YAAY,+BA8Hd"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { MouseEvent, ReactNode } from 'react';
|
|
2
|
+
/** One row of the tree, and the rows under it. */
|
|
3
|
+
export interface NavTreeNode {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
href: string;
|
|
7
|
+
/** 16px, stroke 1.5. */
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
/** `0` or absent renders no counter. */
|
|
10
|
+
count?: number;
|
|
11
|
+
/** What the count counts, for the tooltip. */
|
|
12
|
+
countLabel?: string;
|
|
13
|
+
/** Shown only while the row is pointed at or focused, left of the count: a neutral `Chip`, typically. */
|
|
14
|
+
hint?: ReactNode;
|
|
15
|
+
/** The row's "More options" menu: `MenuItem`s. */
|
|
16
|
+
menu?: ReactNode;
|
|
17
|
+
/** Rows under this one. Their row folds them; open unless `defaultOpen` says otherwise. */
|
|
18
|
+
children?: NavTreeNode[];
|
|
19
|
+
defaultOpen?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** A group heading over its rows: the top of the tree. */
|
|
22
|
+
export interface NavTreeGroup {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
nodes: NavTreeNode[];
|
|
26
|
+
}
|
|
27
|
+
export interface NavTreeProps {
|
|
28
|
+
/** The quiet label over the groups. Absent, none is drawn. */
|
|
29
|
+
title?: string;
|
|
30
|
+
/** `null` while the first read is on its way: a skeleton in the rows' place. */
|
|
31
|
+
groups: NavTreeGroup[] | null;
|
|
32
|
+
/** The row that is current: `active`, and its group starts open. */
|
|
33
|
+
selected?: string;
|
|
34
|
+
/** A row was clicked. A router app prevents the default and navigates. */
|
|
35
|
+
onSelect?: (node: NavTreeNode, event: MouseEvent<HTMLAnchorElement>) => void;
|
|
36
|
+
/** What to say when there are no groups. The words are the caller's. */
|
|
37
|
+
emptyMessage: string;
|
|
38
|
+
/** Remember each group open or closed in this browser, under this key and the group's id. The app prefixes it. */
|
|
39
|
+
storageKey?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A sidebar's tree, from one nested list (Katerina, 2 October: Leaf's folder
|
|
43
|
+
* tree): a quiet label, then each group as the standard heading folding its
|
|
44
|
+
* rows, lightly indented under its title; rows under rows to any depth, each
|
|
45
|
+
* row a link whose icon becomes the arrow that folds what is under it. Only
|
|
46
|
+
* the group that holds the current row starts open.
|
|
47
|
+
*/
|
|
48
|
+
export declare function NavTree({ title, groups, selected, onSelect, emptyMessage, storageKey }: NavTreeProps): import("react").JSX.Element;
|
|
49
|
+
//# sourceMappingURL=NavTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavTree.d.ts","sourceRoot":"","sources":["../src/NavTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOlD,kDAAkD;AAClD,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,wBAAwB;IACxB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,yGAAyG;IACzG,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,kDAAkD;IAClD,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAA;IACxB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,0DAA0D;AAC1D,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,WAAW,EAAE,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gFAAgF;IAChF,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAA;IAC7B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAC5E,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAA;IACpB,kHAAkH;IAClH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AA2BD;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,YAAY,+BA8BpG"}
|
package/dist/SectionLabel.d.ts
CHANGED
|
@@ -16,16 +16,22 @@ import type { ReactNode } from 'react';
|
|
|
16
16
|
* long label short with an ellipsis where its row has no room, as a date line in
|
|
17
17
|
* a narrow panel must.
|
|
18
18
|
*
|
|
19
|
+
* `folds` is the title of a group that opens and closes: in Leaf it keeps
|
|
20
|
+
* Ship's type rather than taking Signal's micro-label, so a folder reads as
|
|
21
|
+
* a name (Katerina, 2 October). Every other Leaf label keeps Signal's.
|
|
22
|
+
*
|
|
19
23
|
* Deliberately NOT the same thing as Property's stacked field label (the
|
|
20
24
|
* 9px `menu`-token one): they were merged for a day and unmerged by
|
|
21
25
|
* Katerina's ruling (2026-09-01) — a section title and a field label are
|
|
22
26
|
* different voices, at different sizes, on purpose.
|
|
23
27
|
*/
|
|
24
|
-
export declare function SectionLabel({ children, tone, truncate, className, }: {
|
|
28
|
+
export declare function SectionLabel({ children, tone, truncate, folds, className, }: {
|
|
25
29
|
children: ReactNode;
|
|
26
30
|
tone?: 'primary' | 'secondary' | 'muted';
|
|
27
31
|
/** Cut a long label short with an ellipsis instead of letting it wrap or spill. */
|
|
28
32
|
truncate?: boolean;
|
|
33
|
+
/** The title of a group that opens and closes. In Leaf, Ship's type instead of the micro-label. */
|
|
34
|
+
folds?: boolean;
|
|
29
35
|
className?: string;
|
|
30
36
|
}): import("react").JSX.Element;
|
|
31
37
|
//# sourceMappingURL=SectionLabel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionLabel.d.ts","sourceRoot":"","sources":["../src/SectionLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC
|
|
1
|
+
{"version":3,"file":"SectionLabel.d.ts","sourceRoot":"","sources":["../src/SectionLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,IAAgB,EAChB,QAAgB,EAChB,KAAa,EACb,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,SAAS,CAAA;IACnB,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAA;IACxC,mFAAmF;IACnF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,mGAAmG;IACnG,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,+BAgBA"}
|
package/dist/editor.d.ts
CHANGED
|
@@ -9,5 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export { KeptSelection, SelectionToolbar, normalizeHref, type MarkId, type SelectionToolbarProps } from './SelectionToolbar';
|
|
11
11
|
export { suggestionPopup, isSuggestionActive, isSuggestionOpen, type SuggestionPopupOptions } from './suggestionPopup';
|
|
12
|
+
export { PersonMention, UrgentPersonMention, CaptionedReference, ReferenceTrigger, SlashCommands, peopleMenu, referenceMenu, filterPeople, urgentPubkeys, filterReferences, formatSection, applyFormat, typeTrigger, filterSlashSections, FORMATS, type MentionPerson, type PersonMentionOptions, type CaptionedItem, type CaptionedReferenceOptions, type ReferenceTriggerOptions, type ReferenceMenuOptions, type SlashCommand, type SlashSection, type SlashCommandsOptions, type FormatId, type FormatDef, type CodeFormat, } from './ComposerTriggers';
|
|
12
13
|
export { BlockId, UnknownBlock, ReferenceNode, AttachmentNode, type ReferenceNodeOptions, type ReferenceViewProps, type AttachmentNodeOptions, type AttachmentViewProps, } from './BlockNodes';
|
|
13
14
|
//# sourceMappingURL=editor.d.ts.map
|
package/dist/editor.d.ts.map
CHANGED
|
@@ -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,KAAK,MAAM,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC5H,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AACtH,OAAO,EACL,OAAO,EACP,YAAY,EACZ,aAAa,EACb,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,aAAa,EAAE,gBA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