@homecode/ui 5.6.1 → 5.7.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.
Files changed (54) hide show
  1. package/dist/esm/src/components/Autocomplete/Autocomplete.js +6 -3
  2. package/dist/esm/src/components/InputFile/InputFile.js +4 -1
  3. package/dist/esm/src/components/Popup/Popup.helpers.js +8 -1
  4. package/dist/esm/src/components/Popup/Popup.js +12 -6
  5. package/dist/esm/src/components/PromptComposer/PromptComposer.js +5 -1
  6. package/dist/esm/src/components/PromptComposer/promptComposerInsert.js +2 -1
  7. package/dist/esm/src/components/PromptComposer/usePromptComposerEditor.js +99 -21
  8. package/dist/esm/src/components/Select/Select.helpers.js +28 -1
  9. package/dist/esm/src/components/Select/Select.hooks.js +131 -0
  10. package/dist/esm/src/components/Select/Select2.js +192 -235
  11. package/dist/esm/src/components/Tooltip/Tooltip.styl.js +1 -1
  12. package/dist/esm/src/components/Tooltip/TooltipOverTrigger.js +4 -3
  13. package/dist/esm/src/components/Tooltip/tooltipTextStyles.js +17 -2
  14. package/dist/esm/src/tiptap/slash-mention/createSlashMentionExtension.js +51 -31
  15. package/dist/esm/src/tools/dom.js +6 -8
  16. package/dist/esm/src/tools/resizeObserver.js +1 -1
  17. package/dist/esm/types/src/components/Popup/Popup.d.ts +2 -1
  18. package/dist/esm/types/src/components/Popup/Popup.helpers.d.ts +1 -0
  19. package/dist/esm/types/src/components/Popup/Popup.types.d.ts +1 -0
  20. package/dist/esm/types/src/components/PromptComposer/PromptComposer.d.ts +4 -0
  21. package/dist/esm/types/src/components/PromptComposer/PromptComposer.types.d.ts +17 -3
  22. package/dist/esm/types/src/components/PromptComposer/index.d.ts +1 -1
  23. package/dist/esm/types/src/components/PromptComposer/usePromptComposerEditor.d.ts +6 -2
  24. package/dist/esm/types/src/components/Select/Select.helpers.d.ts +7 -1
  25. package/dist/esm/types/src/components/Select/Select.hooks.d.ts +55 -0
  26. package/dist/esm/types/src/components/Select/Select.types.d.ts +1 -1
  27. package/dist/esm/types/src/components/Select/Select2.test.d.ts +1 -0
  28. package/dist/esm/types/src/tiptap/slash-mention/createSlashMentionExtension.d.ts +1 -1
  29. package/dist/esm/types/src/tiptap/slash-mention/index.d.ts +1 -1
  30. package/dist/esm/types/src/tiptap/slash-mention/types.d.ts +12 -1
  31. package/graphify-out/.graphify_labels.json +18 -25
  32. package/graphify-out/2026-07-26/.graphify_labels.json +216 -0
  33. package/graphify-out/2026-07-26/GRAPH_REPORT.md +1036 -0
  34. package/graphify-out/2026-07-26/cost.json +12 -0
  35. package/graphify-out/2026-07-26/graph.json +71426 -0
  36. package/graphify-out/2026-07-26/manifest.json +2372 -0
  37. package/graphify-out/2026-07-27/.graphify_labels.json +214 -0
  38. package/graphify-out/2026-07-27/GRAPH_REPORT.md +1014 -0
  39. package/graphify-out/2026-07-27/cost.json +12 -0
  40. package/graphify-out/2026-07-27/graph.json +71778 -0
  41. package/graphify-out/2026-07-27/manifest.json +2372 -0
  42. package/graphify-out/2026-07-30/.graphify_labels.json +197 -0
  43. package/graphify-out/2026-07-30/GRAPH_REPORT.md +929 -0
  44. package/graphify-out/2026-07-30/cost.json +12 -0
  45. package/graphify-out/2026-07-30/graph.json +71798 -0
  46. package/graphify-out/2026-07-30/manifest.json +2372 -0
  47. package/graphify-out/GRAPH_REPORT.md +167 -249
  48. package/graphify-out/cache/ast/2690b69f91795ec634393c1fb8d9fd21ec09ec6759eaf6711e3b86c2a8edb385.json +1 -0
  49. package/graphify-out/cache/ast/2ae06c5acabf11eea845c93c2a8486317fbb18dccc1843ecd88077848af2ab29.json +1 -0
  50. package/graphify-out/cache/stat-index.json +1 -1
  51. package/graphify-out/graph.html +4 -4
  52. package/graphify-out/graph.json +3354 -2931
  53. package/graphify-out/manifest.json +47 -47
  54. package/package.json +1 -1
@@ -1,35 +1,43 @@
1
1
  import { mergeAttributes } from '@tiptap/core';
2
2
  import Mention from '@tiptap/extension-mention';
3
+ import { PluginKey } from '@tiptap/pm/state';
3
4
  import { ReactRenderer } from '@tiptap/react';
4
5
  import { SlashSuggestionList } from './SlashSuggestionList.js';
5
6
  import S from './SlashSuggestionList.styl.js';
6
7
  import { filterSlashItems } from './defaultChatSlashItems.js';
7
8
 
8
- const SlashMention = Mention.extend({
9
- addAttributes() {
10
- return {
11
- ...this.parent?.(),
12
- className: {
13
- default: null,
14
- parseHTML: element => element.getAttribute('data-slash-class'),
15
- renderHTML: attributes => {
16
- if (!attributes.className)
17
- return {};
18
- return { 'data-slash-class': attributes.className };
9
+ /** Keep `/` as `mention` for backward-compatible KnowledgeSelector docs. */
10
+ function mentionExtensionName(slashChar) {
11
+ return slashChar === '/' ? 'mention' : `mention_${slashChar.charCodeAt(0)}`;
12
+ }
13
+ function createNamedSlashMention(slashChar) {
14
+ return Mention.extend({
15
+ name: mentionExtensionName(slashChar),
16
+ addAttributes() {
17
+ return {
18
+ ...this.parent?.(),
19
+ className: {
20
+ default: null,
21
+ parseHTML: element => element.getAttribute('data-slash-class'),
22
+ renderHTML: attributes => {
23
+ if (!attributes.className)
24
+ return {};
25
+ return { 'data-slash-class': attributes.className };
26
+ },
19
27
  },
20
- },
21
- color: {
22
- default: null,
23
- parseHTML: element => element.getAttribute('data-slash-color'),
24
- renderHTML: attributes => {
25
- if (!attributes.color)
26
- return {};
27
- return { 'data-slash-color': attributes.color };
28
+ color: {
29
+ default: null,
30
+ parseHTML: element => element.getAttribute('data-slash-color'),
31
+ renderHTML: attributes => {
32
+ if (!attributes.color)
33
+ return {};
34
+ return { 'data-slash-color': attributes.color };
35
+ },
28
36
  },
29
- },
30
- };
31
- },
32
- });
37
+ };
38
+ },
39
+ });
40
+ }
33
41
  const SUGGESTION_GAP_PX = 4;
34
42
  function placeSlashSuggestionPopup(popupElement, clientRect, placement, editorElement) {
35
43
  if (!clientRect)
@@ -109,12 +117,13 @@ function insertDefaultMention(editor, range, item, slashChar) {
109
117
  const nodeAfter = editor.view.state.selection.$to.nodeAfter;
110
118
  const extend = nodeAfter?.text?.startsWith(' ') ? 1 : 0;
111
119
  const adjusted = extend ? { ...range, to: range.to + extend } : range;
120
+ const nodeType = mentionExtensionName(slashChar);
112
121
  editor
113
122
  .chain()
114
123
  .focus()
115
124
  .insertContentAt(adjusted, [
116
125
  {
117
- type: 'mention',
126
+ type: nodeType,
118
127
  attrs: {
119
128
  id: item.id,
120
129
  label: item.label,
@@ -132,8 +141,8 @@ function insertDefaultMention(editor, range, item, slashChar) {
132
141
  ?.collapseToEnd();
133
142
  });
134
143
  }
135
- function allowSlashTrigger({ state, range, }) {
136
- const type = state.schema.nodes['mention'];
144
+ function allowSlashTrigger({ state, range, slashChar, }) {
145
+ const type = state.schema.nodes[mentionExtensionName(slashChar)];
137
146
  const $from = state.doc.resolve(range.from);
138
147
  if (!type || !$from.parent.type.contentMatch.matchType(type))
139
148
  return false;
@@ -142,13 +151,24 @@ function allowSlashTrigger({ state, range, }) {
142
151
  const before = state.doc.textBetween(range.from - 1, range.from);
143
152
  return /\s/.test(before);
144
153
  }
145
- function createSlashMentionExtension({ items: resolvedItems, slashChar = '/', pluginKey, onItemCommand, suggestionPlacement = 'below', onSuggestionUiActiveChange, }) {
154
+ async function resolveSuggestionItems(query, staticItems, getItems) {
155
+ if (getItems) {
156
+ return Promise.resolve(getItems(query));
157
+ }
158
+ return filterSlashItems(staticItems ?? [], query);
159
+ }
160
+ function createSlashMentionExtension({ items: resolvedItems, getItems, slashChar = '/', pluginKey, onItemCommand, suggestionPlacement = 'below', onSuggestionUiActiveChange, }) {
146
161
  const uiRef = {
147
162
  current: null,
148
163
  };
164
+ const SlashMention = createNamedSlashMention(slashChar);
165
+ const resolvedPluginKey = pluginKey ?? new PluginKey(`slashMention${slashChar.charCodeAt(0)}`);
149
166
  return SlashMention.configure({
150
167
  renderText({ node }) {
151
- return `/${node.attrs.id}`;
168
+ const label = typeof node.attrs.label === 'string' && node.attrs.label.trim() !== ''
169
+ ? node.attrs.label
170
+ : String(node.attrs.id ?? '');
171
+ return `${slashChar}${label}`;
152
172
  },
153
173
  renderHTML({ options, node }) {
154
174
  const id = typeof node.attrs.id === 'string'
@@ -175,10 +195,10 @@ function createSlashMentionExtension({ items: resolvedItems, slashChar = '/', pl
175
195
  },
176
196
  suggestion: {
177
197
  char: slashChar,
178
- pluginKey,
198
+ pluginKey: resolvedPluginKey,
179
199
  allowedPrefixes: [' ', '\n', '\t', '\r'],
180
- allow: props => allowSlashTrigger(props),
181
- items: ({ query }) => Promise.resolve(filterSlashItems(resolvedItems, query)),
200
+ allow: props => allowSlashTrigger({ ...props, slashChar }),
201
+ items: ({ query }) => resolveSuggestionItems(query, resolvedItems, getItems),
182
202
  command: ({ editor, range, props }) => {
183
203
  const item = props;
184
204
  if (onItemCommand?.({ editor, range, item }) === true) {
@@ -38,17 +38,15 @@ let interactionMode = INTERACTION_MODE.POINTER;
38
38
  const getInteractionMode = () => interactionMode;
39
39
  function watchControllerFlag() {
40
40
  const classes = document.body.classList;
41
- const onPointerMove = () => {
42
- classes.remove(INTERACTION_MODE.KEYBOARD);
43
- classes.add(INTERACTION_MODE.POINTER);
41
+ const setMode = (mode, prevMode) => {
42
+ interactionMode = mode;
43
+ classes.remove(prevMode);
44
+ classes.add(mode);
44
45
  };
45
46
  ['pointerdown', 'pointermove'].forEach(event => {
46
- document.addEventListener(event, onPointerMove, true);
47
- });
48
- document.addEventListener('keydown', () => {
49
- classes.remove(INTERACTION_MODE.POINTER);
50
- classes.add(INTERACTION_MODE.KEYBOARD);
47
+ document.addEventListener(event, () => setMode(INTERACTION_MODE.POINTER, INTERACTION_MODE.KEYBOARD), true);
51
48
  });
49
+ document.addEventListener('keydown', () => setMode(INTERACTION_MODE.KEYBOARD, INTERACTION_MODE.POINTER));
52
50
  classes.add(interactionMode);
53
51
  }
54
52
  const isTouch = () => isBrowser && 'ontouchstart' in window;
@@ -57,7 +57,7 @@ function unobserve(elem, cb) {
57
57
  return;
58
58
  }
59
59
  const data = ITEMS.get(elem);
60
- if (!cb || data?.listeners.indexOf(cb) === -1)
60
+ if (!data || !cb || data.listeners.indexOf(cb) === -1)
61
61
  return;
62
62
  if (data.listeners.length === 1)
63
63
  ITEMS.delete(elem);
@@ -9,6 +9,7 @@ export declare class Popup extends Component<T.Props, T.State> {
9
9
  containerElem: HTMLDivElement;
10
10
  onContainerElemRef: (elem: any) => void;
11
11
  focused: boolean;
12
+ isOpening: boolean;
12
13
  pointerPressed: boolean;
13
14
  subscribedHoverControl: boolean;
14
15
  subscribedSizeChange: boolean;
@@ -61,7 +62,7 @@ export declare class Popup extends Component<T.Props, T.State> {
61
62
  onBlur: (e: any) => void;
62
63
  onTriggerResize: () => void;
63
64
  onContainerResize: () => void;
64
- open: any;
65
+ open: () => void;
65
66
  close: () => void;
66
67
  changeState(isOpen: boolean, callback: any): void;
67
68
  afterOpen: () => void;
@@ -42,6 +42,7 @@ export declare function shiftMarginsIntoBounds(rect: DOMRectReadOnly, inner: Cli
42
42
  marginTop: number;
43
43
  };
44
44
  export declare function fitRectToBoundary(rect: DOMRectReadOnly, boundary: ClientRectEdges, maxWidth: number | null): BoundaryFit;
45
+ export declare function isEditable(target: EventTarget | null): boolean;
45
46
  export declare const childs: Record<Id, Id[]>;
46
47
  export declare const getId: () => number;
47
48
  export declare const getPopupId: (elem: any, attr?: string) => number;
@@ -3,6 +3,7 @@ import { DetailedHTMLProps, HTMLAttributes, ReactNode } from 'react';
3
3
  import type { BoundaryFit } from './Popup.helpers';
4
4
  export type TriggerPropsType = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
5
5
  className?: string;
6
+ [dataAttribute: `data-${string}`]: unknown;
6
7
  };
7
8
  export type WrapperPropsType = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
8
9
  className?: string;
@@ -6,6 +6,10 @@ export declare const PromptComposer: import("react").ForwardRefExoticComponent<O
6
6
  slashCommandItems?: import(".").SlashCommandItem[];
7
7
  slashSuggestionPlacement?: import(".").SlashSuggestionPlacement;
8
8
  onSlashItemCommand?: import(".").SlashOnItemCommand;
9
+ mentionConfigs?: import(".").PromptMentionConfig[];
10
+ atMentionItems?: import(".").SlashCommandItem[];
11
+ atMentionGetItems?: import(".").SlashGetItems;
12
+ onAtItemCommand?: import(".").SlashOnItemCommand;
9
13
  prefillMessage?: string;
10
14
  attachmentsCount?: number;
11
15
  allowEnterSubmit?: boolean;
@@ -1,6 +1,6 @@
1
1
  import type { Editor } from '@tiptap/core';
2
2
  import type { HTMLAttributes } from 'react';
3
- import type { SlashCommandItem, SlashOnItemCommand, SlashSuggestionPlacement } from '../../tiptap/slash-mention';
3
+ import type { PromptMentionConfig, SlashCommandItem, SlashGetItems, SlashOnItemCommand, SlashSuggestionPlacement } from '../../tiptap/slash-mention';
4
4
  import type { Props as ScrollProps } from '../Scroll/Scroll.types';
5
5
  export type Props = Omit<HTMLAttributes<HTMLDivElement>, 'onSubmit' | 'onChange'> & {
6
6
  disabled?: boolean;
@@ -9,12 +9,26 @@ export type Props = Omit<HTMLAttributes<HTMLDivElement>, 'onSubmit' | 'onChange'
9
9
  /** Slash menu vertical placement; defaults to above chat input. */
10
10
  slashSuggestionPlacement?: SlashSuggestionPlacement;
11
11
  onSlashItemCommand?: SlashOnItemCommand;
12
+ /**
13
+ * Extra mention triggers (e.g. `@` files). `/` still comes from
14
+ * slashCommandItems when provided.
15
+ */
16
+ mentionConfigs?: PromptMentionConfig[];
17
+ /** Convenience for `@` file mentions (merged into mentionConfigs). */
18
+ atMentionItems?: SlashCommandItem[];
19
+ atMentionGetItems?: SlashGetItems;
20
+ onAtItemCommand?: SlashOnItemCommand;
12
21
  prefillMessage?: string | null;
13
22
  /** Staged attachment count - Enter can submit even when text empty. */
14
23
  attachmentsCount?: number;
15
- /** Mobile usually sets false so Enter inserts newline. */
24
+ /**
25
+ * When true (desktop default), Enter submits if content has no newlines yet;
26
+ * once newlines exist, Enter inserts another line and Cmd/Ctrl+Enter submits.
27
+ * Shift+Enter always inserts a newline. Mobile usually sets false so Enter
28
+ * always inserts a newline.
29
+ */
16
30
  allowEnterSubmit?: boolean;
17
- /** Called when user presses Enter to submit. */
31
+ /** Called when user presses Enter (or Cmd/Ctrl+Enter when multiline) to submit. */
18
32
  onSubmit?: (text: string, editor: Editor) => void;
19
33
  /** Called on every transaction with plain text value. */
20
34
  onChange?: (text: string, editor: Editor) => void;
@@ -4,4 +4,4 @@ export { usePromptComposerEditor } from './usePromptComposerEditor';
4
4
  export type { UsePromptComposerEditorOptions } from './usePromptComposerEditor';
5
5
  export { getPromptComposerTokenRangeBeforePos, createPromptComposerHandle, insertPromptComposerContentAtCaret, openPromptComposerSlashSuggestion, promptComposerChipHtml, promptComposerMentionNode, PROMPT_COMPOSER_COMMAND_CHIP_CLASS, } from './promptComposerInsert';
6
6
  export type { PromptComposerHandle, PromptComposerInsertOptions, PromptComposerMentionNodeInput, } from './promptComposerInsert';
7
- export type { SlashCommandItem, SlashItemCommandContext, SlashOnItemCommand, SlashSuggestionPlacement, } from '../../tiptap/slash-mention';
7
+ export type { SlashCommandItem, SlashItemCommandContext, SlashOnItemCommand, SlashSuggestionPlacement, SlashGetItems, PromptMentionConfig, } from '../../tiptap/slash-mention';
@@ -1,11 +1,15 @@
1
1
  import { type Editor } from '@tiptap/core';
2
- import type { SlashCommandItem, SlashOnItemCommand, SlashSuggestionPlacement } from '../../tiptap/slash-mention';
2
+ import type { PromptMentionConfig, SlashCommandItem, SlashGetItems, SlashOnItemCommand, SlashSuggestionPlacement } from '../../tiptap/slash-mention';
3
3
  export type UsePromptComposerEditorOptions = {
4
4
  disabled: boolean;
5
5
  placeholder?: string;
6
6
  slashCommandItems?: SlashCommandItem[];
7
7
  slashSuggestionPlacement?: SlashSuggestionPlacement;
8
8
  onSlashItemCommand?: SlashOnItemCommand;
9
+ mentionConfigs?: PromptMentionConfig[];
10
+ atMentionItems?: SlashCommandItem[];
11
+ atMentionGetItems?: SlashGetItems;
12
+ onAtItemCommand?: SlashOnItemCommand;
9
13
  prefillMessage?: string | null;
10
14
  attachmentsCount?: number;
11
15
  allowEnterSubmit: boolean;
@@ -17,4 +21,4 @@ export type UsePromptComposerEditorResult = {
17
21
  text: string;
18
22
  trimmedText: string;
19
23
  };
20
- export declare function usePromptComposerEditor({ disabled, placeholder, slashCommandItems, slashSuggestionPlacement, onSlashItemCommand, prefillMessage, attachmentsCount, allowEnterSubmit, onSubmit, onChange, }: UsePromptComposerEditorOptions): UsePromptComposerEditorResult;
24
+ export declare function usePromptComposerEditor({ disabled, placeholder, slashCommandItems, slashSuggestionPlacement, onSlashItemCommand, mentionConfigs, atMentionItems, atMentionGetItems, onAtItemCommand, prefillMessage, attachmentsCount, allowEnterSubmit, onSubmit, onChange, }: UsePromptComposerEditorOptions): UsePromptComposerEditorResult;
@@ -1,6 +1,12 @@
1
- import type { Option } from './Select.types';
1
+ import type { Id, Option, Value } from './Select.types';
2
2
  export declare function isMultiple(value: any): boolean;
3
3
  export declare function renderLabel({ label, render }: Option): string;
4
+ /** Selection is always kept as a list of ids, whatever the `value` shape is. */
5
+ export declare function toIds(value: Value | undefined): Id[];
6
+ /** Stable primitive for `useEffect` deps — `value` arrays are often recreated. */
7
+ export declare function idsKey(ids: Id[]): string;
8
+ export declare function matchesSearch(option: Option, query: string): boolean;
9
+ export declare function isSelectable(option: Option | undefined): boolean;
4
10
  export declare function buildOptionsTree(options: Option[], idsMap: IdsMap): Option[];
5
11
  type IdsMap = {
6
12
  items: {
@@ -0,0 +1,55 @@
1
+ import * as T from './Select.types';
2
+ /**
3
+ * Open state contract:
4
+ * - `isOpen` prop is a boolean -> fully controlled, the consumer must react to
5
+ * `onOpen` / `onClose` to change it.
6
+ * - `isOpen` prop is `undefined` -> Select owns the state.
7
+ */
8
+ export declare function useSelectOpenState({ isOpen: isOpenProp, onOpen, onClose, }: {
9
+ isOpen?: boolean;
10
+ onOpen?: () => void;
11
+ onClose?: () => void;
12
+ }): {
13
+ isOpen: boolean;
14
+ open: () => void;
15
+ close: () => void;
16
+ };
17
+ /**
18
+ * Selection contract mirrors the open state one: `value` present -> controlled,
19
+ * `value === undefined` -> Select owns the selection.
20
+ */
21
+ export declare function useSelectedIds(value: T.Value | undefined): {
22
+ selectedIds: T.Id[];
23
+ setSelectedIds: (ids: T.Id[]) => void;
24
+ };
25
+ /** Single source of truth for what the list shows and what can be navigated. */
26
+ export declare function useSelectOptions({ options, additionalOptions, searchQuery, }: {
27
+ options: T.Option[];
28
+ additionalOptions: T.Option[];
29
+ searchQuery: string;
30
+ }): {
31
+ allOptions: T.Option[];
32
+ visibleOptions: T.Option[];
33
+ navigableOptions: T.Option[];
34
+ optionsById: {
35
+ items: {
36
+ [key: string]: T.Option;
37
+ };
38
+ childIds: {
39
+ [key: string]: T.Id[];
40
+ };
41
+ };
42
+ };
43
+ /**
44
+ * Keyboard cursor. It is stored as an option id and always resolved against the
45
+ * currently *visible* list, so filtering can never desync it from the rows.
46
+ */
47
+ export declare function useKeyboardNav({ isOpen, navigableOptions, selectedIds, onSelect, }: {
48
+ isOpen: boolean;
49
+ navigableOptions: T.Option[];
50
+ selectedIds: T.Id[];
51
+ onSelect: (id: T.Id) => void;
52
+ }): {
53
+ focusedId: T.Id;
54
+ setFocusedId: import("react").Dispatch<import("react").SetStateAction<T.Id>>;
55
+ };
@@ -84,6 +84,6 @@ export type State = {
84
84
  };
85
85
  export type OptionElemProps = HTMLAttributes<HTMLDivElement> & {
86
86
  className: string;
87
- ref?: RefObject<HTMLDivElement>;
87
+ ref?: RefObject<HTMLDivElement> | ((elem: HTMLDivElement | null) => void);
88
88
  };
89
89
  export {};
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -18,4 +18,4 @@ export declare function slashMentionSuggestionRender(uiRef: MutableRefObject<Sla
18
18
  export type CreateSlashMentionExtensionConfiguredOptions = CreateSlashMentionExtensionOptions & {
19
19
  onSuggestionUiActiveChange?: (active: boolean) => void;
20
20
  };
21
- export declare function createSlashMentionExtension({ items: resolvedItems, slashChar, pluginKey, onItemCommand, suggestionPlacement, onSuggestionUiActiveChange, }: CreateSlashMentionExtensionConfiguredOptions): import("@tiptap/core").Node<import("@tiptap/extension-mention").MentionOptions<any, import("@tiptap/extension-mention").MentionNodeAttrs>, any>;
21
+ export declare function createSlashMentionExtension({ items: resolvedItems, getItems, slashChar, pluginKey, onItemCommand, suggestionPlacement, onSuggestionUiActiveChange, }: CreateSlashMentionExtensionConfiguredOptions): import("@tiptap/core").Node<import("@tiptap/extension-mention").MentionOptions<any, import("@tiptap/extension-mention").MentionNodeAttrs>, any>;
@@ -1,4 +1,4 @@
1
- export type { SlashCommandItem, SlashOnItemCommand, SlashItemCommandContext, SlashSuggestionPlacement, CreateSlashMentionExtensionOptions, } from './types';
1
+ export type { SlashCommandItem, SlashOnItemCommand, SlashItemCommandContext, SlashSuggestionPlacement, SlashGetItems, PromptMentionConfig, CreateSlashMentionExtensionOptions, } from './types';
2
2
  export { DEFAULT_CHAT_SLASH_ITEMS, filterSlashItems, } from './defaultChatSlashItems';
3
3
  export { createSlashMentionExtension, slashMentionSuggestionRender, } from './createSlashMentionExtension';
4
4
  export type { CreateSlashMentionExtensionConfiguredOptions } from './createSlashMentionExtension';
@@ -19,8 +19,19 @@ export type SlashItemCommandContext = {
19
19
  */
20
20
  export type SlashOnItemCommand = (ctx: SlashItemCommandContext) => boolean;
21
21
  export type SlashSuggestionPlacement = 'below' | 'above' | 'auto';
22
+ export type SlashGetItems = (query: string) => SlashCommandItem[] | Promise<SlashCommandItem[]>;
23
+ export type PromptMentionConfig = {
24
+ slashChar: string;
25
+ /** Static items (client-filtered). Ignored when getItems is set. */
26
+ items?: SlashCommandItem[];
27
+ /** Async/dynamic items (e.g. server search for @files). */
28
+ getItems?: SlashGetItems;
29
+ onItemCommand?: SlashOnItemCommand;
30
+ pluginKey?: import('@tiptap/pm/state').PluginKey;
31
+ };
22
32
  export type CreateSlashMentionExtensionOptions = {
23
- items: SlashCommandItem[];
33
+ items?: SlashCommandItem[];
34
+ getItems?: SlashGetItems;
24
35
  slashChar?: string;
25
36
  pluginKey?: import('@tiptap/pm/state').PluginKey;
26
37
  onItemCommand?: SlashOnItemCommand;
@@ -101,10 +101,10 @@
101
101
  "99": "Render Months Label",
102
102
  "100": "Render Month Label",
103
103
  "101": "Render Weekday Label",
104
- "102": "Render Year Label",
105
- "103": "Start Of Week",
106
- "104": "Weekend ClassName",
107
- "105": "Weekend Styling",
104
+ "102": "Community 102",
105
+ "103": "Community 103",
106
+ "104": "Community 104",
107
+ "105": "Community 105",
108
108
  "106": "Icon Name Helpers",
109
109
  "107": "Media Placeholder Icons",
110
110
  "108": "Utility Icons",
@@ -118,20 +118,20 @@
118
118
  "116": "Docs Scope",
119
119
  "117": "Auto Scroll Props",
120
120
  "118": "Content Props",
121
- "119": "Content ClassName",
121
+ "119": "Community 119",
122
122
  "120": "Footer Props",
123
- "121": "Icon Props",
124
- "122": "Max Height Props",
123
+ "121": "Community 121",
124
+ "122": "Community 122",
125
125
  "123": "No Scroll Props",
126
- "124": "Subtitle Props",
127
- "125": "Subtitle ClassName",
126
+ "124": "Community 124",
127
+ "125": "Community 125",
128
128
  "126": "Title Props",
129
- "127": "Title ClassName",
130
- "128": "Trigger Props",
129
+ "127": "Community 127",
130
+ "128": "Community 128",
131
131
  "129": "Trigger ClassName",
132
- "130": "Width Props",
132
+ "130": "Community 130",
133
133
  "131": "Community 131",
134
- "132": "Expand Types",
134
+ "132": "Community 132",
135
135
  "133": "Brand Avatar Icons",
136
136
  "134": "Communication Action Icons",
137
137
  "135": "Status Action Icons",
@@ -144,7 +144,7 @@
144
144
  "142": "Community 142",
145
145
  "143": "More Docs Examples",
146
146
  "144": "Docs Scope Pages",
147
- "145": "Additional Docs Examples",
147
+ "145": "Community 145",
148
148
  "146": "Brand Logo Assets",
149
149
  "147": "Test Utilities",
150
150
  "148": "PostCSS Config",
@@ -173,14 +173,18 @@
173
173
  "171": "Community 171",
174
174
  "172": "Community 172",
175
175
  "173": "Community 173",
176
+ "174": "Community 174",
176
177
  "175": "Community 175",
177
178
  "176": "Community 176",
178
179
  "177": "Community 177",
179
180
  "178": "Community 178",
180
181
  "179": "Community 179",
182
+ "180": "Community 180",
183
+ "181": "Community 181",
181
184
  "182": "Community 182",
182
185
  "183": "Community 183",
183
186
  "184": "Community 184",
187
+ "185": "Community 185",
184
188
  "186": "Community 186",
185
189
  "187": "Community 187",
186
190
  "188": "Community 188",
@@ -191,23 +195,12 @@
191
195
  "193": "Community 193",
192
196
  "194": "Community 194",
193
197
  "195": "Community 195",
194
- "196": "Community 196",
195
198
  "197": "Community 197",
196
- "198": "Community 198",
197
- "199": "Community 199",
198
199
  "200": "Community 200",
199
200
  "201": "Community 201",
200
- "202": "Community 202",
201
- "203": "Community 203",
202
- "204": "Community 204",
203
201
  "205": "Community 205",
204
- "206": "Community 206",
205
- "207": "Community 207",
206
- "208": "Community 208",
207
- "209": "Community 209",
208
202
  "210": "Community 210",
209
203
  "213": "Community 213",
210
- "214": "Community 214",
211
204
  "216": "Community 216",
212
205
  "218": "Community 218",
213
206
  "220": "Community 220",