@plannotator/ui 0.43.0 → 0.43.2
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/HANDOFF.md +116 -2
- package/README.md +16 -2
- package/components/AnnotationToolbar.tsx +12 -3
- package/components/CommentPopover.tsx +2 -0
- package/components/MentionPicker.tsx +43 -0
- package/components/Viewer.tsx +37 -2
- package/components/html-viewer/HtmlViewer.tsx +17 -1
- package/components/html-viewer/useHtmlAnnotation.ts +4 -1
- package/hooks/useAnnotationHighlighter.ts +22 -3
- package/hooks/useMentionAutocomplete.ts +3 -1
- package/package.json +1 -1
- package/styles.css +1 -1
- package/types.ts +1 -0
- package/utils/mentions.ts +8 -0
|
@@ -15,6 +15,7 @@ export interface MentionMenuState {
|
|
|
15
15
|
items: readonly MentionPerson[];
|
|
16
16
|
/** Shown as one non-selectable row when `items` is empty. */
|
|
17
17
|
emptyNotice: string | null;
|
|
18
|
+
heading: string | null;
|
|
18
19
|
/** Explicitly activated row, or null — the menu opens with NOTHING active. */
|
|
19
20
|
activeIndex: number | null;
|
|
20
21
|
/** Measured textarea rect the portaled picker is placed from. */
|
|
@@ -112,6 +113,7 @@ export function useMentionAutocomplete(options: {
|
|
|
112
113
|
);
|
|
113
114
|
|
|
114
115
|
const emptyNotice = source?.emptyNotice ?? null;
|
|
116
|
+
const heading = source?.heading ?? null;
|
|
115
117
|
const open =
|
|
116
118
|
trigger !== null
|
|
117
119
|
&& trigger.from !== dismissedStart
|
|
@@ -236,7 +238,7 @@ export function useMentionAutocomplete(options: {
|
|
|
236
238
|
|
|
237
239
|
return {
|
|
238
240
|
menu: open && trigger
|
|
239
|
-
? { items, emptyNotice, activeIndex: boundedActive, anchor, query: trigger.query }
|
|
241
|
+
? { items, emptyNotice, heading, activeIndex: boundedActive, anchor, query: trigger.query }
|
|
240
242
|
: null,
|
|
241
243
|
onKeyDown,
|
|
242
244
|
onSelect: readCaret,
|