@opentiny/tiny-robot 0.3.0-alpha.14 → 0.3.0-alpha.15

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/index.d.ts CHANGED
@@ -23,11 +23,11 @@ import { FileTypeMatcher as FileTypeMatcher_2 } from './index.type';
23
23
  import { GlobalComponents } from 'vue';
24
24
  import { GlobalDirectives } from 'vue';
25
25
  import { InputMode as InputMode_2 } from './index.type';
26
+ import { ISuggestionItem as ISuggestionItem_2 } from './index.type';
26
27
  import { MarketCategoryOption as MarketCategoryOption_2 } from './index.type';
27
28
  import { nextTick } from 'vue';
28
29
  import { OnCleanup } from '@vue/reactivity';
29
30
  import { Options } from 'markdown-it';
30
- import { Props } from './components/SuggestionList.vue';
31
31
  import { PropType } from 'vue';
32
32
  import { PublicProps } from 'vue';
33
33
  import { Ref } from 'vue';
@@ -346,7 +346,7 @@ allowSpeech: boolean;
346
346
  allowFiles: boolean;
347
347
  submitType: SubmitTrigger_2;
348
348
  stopText: string;
349
- suggestions: string[];
349
+ suggestions: ISuggestionItem_2[];
350
350
  autoSize: AutoSize_2;
351
351
  maxLength: number;
352
352
  suggestionPopupWidth: string | number;
@@ -836,28 +836,6 @@ showTooltip: boolean;
836
836
  inputBoxType: string;
837
837
  }> | null;
838
838
  buttonsContainerRef: HTMLDivElement;
839
- suggestionsListRef: CreateComponentPublicInstanceWithMixins<Readonly<Props> & Readonly<{
840
- onSelect?: ((item: string) => any) | undefined;
841
- "onItem-hover"?: ((index: number) => any) | undefined;
842
- "onItem-leave"?: (() => any) | undefined;
843
- }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
844
- select: (item: string) => any;
845
- "item-hover": (index: number) => any;
846
- "item-leave": () => any;
847
- }, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
848
- suggestionsListRef: HTMLDivElement;
849
- }, any, ComponentProvideOptions, {
850
- P: {};
851
- B: {};
852
- D: {};
853
- C: {};
854
- M: {};
855
- Defaults: {};
856
- }, Readonly<Props> & Readonly<{
857
- onSelect?: ((item: string) => any) | undefined;
858
- "onItem-hover"?: ((index: number) => any) | undefined;
859
- "onItem-leave"?: (() => any) | undefined;
860
- }>, {}, {}, {}, {}, {}> | null;
861
839
  }, HTMLDivElement>;
862
840
 
863
841
  declare const __VLS_component_8: DefineComponent<SuggestionPillButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<SuggestionPillButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
@@ -1679,28 +1657,6 @@ declare function __VLS_template_7(): {
1679
1657
  inputBoxType: string;
1680
1658
  }> | null;
1681
1659
  buttonsContainerRef: HTMLDivElement;
1682
- suggestionsListRef: CreateComponentPublicInstanceWithMixins<Readonly<Props> & Readonly<{
1683
- onSelect?: ((item: string) => any) | undefined;
1684
- "onItem-hover"?: ((index: number) => any) | undefined;
1685
- "onItem-leave"?: (() => any) | undefined;
1686
- }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
1687
- select: (item: string) => any;
1688
- "item-hover": (index: number) => any;
1689
- "item-leave": () => any;
1690
- }, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
1691
- suggestionsListRef: HTMLDivElement;
1692
- }, any, ComponentProvideOptions, {
1693
- P: {};
1694
- B: {};
1695
- D: {};
1696
- C: {};
1697
- M: {};
1698
- Defaults: {};
1699
- }, Readonly<Props> & Readonly<{
1700
- onSelect?: ((item: string) => any) | undefined;
1701
- "onItem-hover"?: ((index: number) => any) | undefined;
1702
- "onItem-leave"?: (() => any) | undefined;
1703
- }>, {}, {}, {}, {}, {}> | null;
1704
1660
  };
1705
1661
  rootEl: HTMLDivElement;
1706
1662
  };
@@ -2468,6 +2424,8 @@ export declare interface Handlers {
2468
2424
  handleDrop: (e: DragEvent) => void;
2469
2425
  }
2470
2426
 
2427
+ declare type HighlightFunction = (suggestionText: string, inputText: string) => SuggestionTextPart[];
2428
+
2471
2429
  export declare type HistoryData = HistoryItem[] | HistoryGroup[];
2472
2430
 
2473
2431
  export declare interface HistoryEvents {
@@ -2542,6 +2500,11 @@ declare const installPrompt: <T>(app: App<T>) => void;
2542
2500
 
2543
2501
  declare const installPrompts: <T>(app: App<T>) => void;
2544
2502
 
2503
+ export declare interface ISuggestionItem {
2504
+ content: string;
2505
+ highlights?: string[] | HighlightFunction;
2506
+ }
2507
+
2545
2508
  export declare interface KeyboardHandler {
2546
2509
  handleKeyPress: (e: KeyboardEvent) => void;
2547
2510
  triggerSubmit: () => void;
@@ -2782,7 +2745,7 @@ export declare interface SenderProps {
2782
2745
  speech?: boolean | SpeechConfig;
2783
2746
  placeholder?: string;
2784
2747
  showWordLimit?: boolean;
2785
- suggestions?: string[];
2748
+ suggestions?: ISuggestionItem[];
2786
2749
  suggestionPopupWidth?: string | number;
2787
2750
  theme?: ThemeType;
2788
2751
  templateData?: UserItem[];
@@ -2997,9 +2960,13 @@ export declare interface UrlAttachment extends BaseAttachment {
2997
2960
 
2998
2961
  export declare type UserItem = UserTextItem | UserTemplateItem;
2999
2962
 
3000
- export declare type UserTemplateItem = Pick<TemplateItem, 'type' | 'content'>;
2963
+ export declare type UserTemplateItem = Omit<Pick<TemplateItem, 'type' | 'content'>, 'id'> & {
2964
+ id?: TemplateItem['id'];
2965
+ };
3001
2966
 
3002
- export declare type UserTextItem = Omit<TextItem, 'id'>;
2967
+ export declare type UserTextItem = Omit<TextItem, 'id'> & {
2968
+ id?: TextItem['id'];
2969
+ };
3003
2970
 
3004
2971
  /**
3005
2972
  * 拖拽区域指令