@opentiny/tiny-robot 0.2.4 → 0.2.6
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 +38 -25
- package/dist/index6.js +414 -411
- package/dist/sender/index.js +947 -895
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +101 -98
- package/dist/suggestion-popover/index.js +106 -116
- package/dist/utils.js +15 -4
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -70,14 +70,14 @@ theme: ThemeType_2;
|
|
|
70
70
|
declare const __VLS_component_11: DefineComponent<__VLS_PublicProps_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
71
71
|
"update:selectedGroup": (value: string) => any;
|
|
72
72
|
} & {
|
|
73
|
-
"item-click": (item: SuggestionItem_2<Record<string, unknown>>) => any;
|
|
74
73
|
close: () => any;
|
|
75
74
|
open: () => any;
|
|
75
|
+
"item-click": (item: SuggestionItem_2<Record<string, unknown>>) => any;
|
|
76
76
|
"group-click": (group: SuggestionGroup<Record<string, unknown>>) => any;
|
|
77
77
|
}, string, PublicProps, Readonly<__VLS_PublicProps_3> & Readonly<{
|
|
78
|
-
"onItem-click"?: ((item: SuggestionItem_2<Record<string, unknown>>) => any) | undefined;
|
|
79
78
|
onClose?: (() => any) | undefined;
|
|
80
79
|
onOpen?: (() => any) | undefined;
|
|
80
|
+
"onItem-click"?: ((item: SuggestionItem_2<Record<string, unknown>>) => any) | undefined;
|
|
81
81
|
"onGroup-click"?: ((group: SuggestionGroup<Record<string, unknown>>) => any) | undefined;
|
|
82
82
|
"onUpdate:selectedGroup"?: ((value: string) => any) | undefined;
|
|
83
83
|
}>, {
|
|
@@ -178,9 +178,9 @@ inputWrapperRef: HTMLDivElement;
|
|
|
178
178
|
templateEditorRef: CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
179
179
|
value?: string;
|
|
180
180
|
} & TemplateEditorProps_2> & Readonly<{
|
|
181
|
-
onInput?: ((value: string) => any) | undefined;
|
|
182
181
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
183
182
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
183
|
+
onInput?: ((value: string) => any) | undefined;
|
|
184
184
|
onSubmit?: ((value: string) => any) | undefined;
|
|
185
185
|
"onContent-status"?: ((hasContent: boolean) => any) | undefined;
|
|
186
186
|
"onEmpty-content"?: (() => any) | undefined;
|
|
@@ -194,9 +194,9 @@ setTemplate: (params: SetTemplateParams_2) => void;
|
|
|
194
194
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
195
195
|
"update:value": (value: string) => any;
|
|
196
196
|
} & {
|
|
197
|
-
input: (value: string) => any;
|
|
198
197
|
blur: (event: FocusEvent) => any;
|
|
199
198
|
focus: (event: FocusEvent) => any;
|
|
199
|
+
input: (value: string) => any;
|
|
200
200
|
submit: (value: string) => any;
|
|
201
201
|
"content-status": (hasContent: boolean) => any;
|
|
202
202
|
"empty-content": () => any;
|
|
@@ -212,9 +212,9 @@ Defaults: {};
|
|
|
212
212
|
}, Readonly<{
|
|
213
213
|
value?: string;
|
|
214
214
|
} & TemplateEditorProps_2> & Readonly<{
|
|
215
|
-
onInput?: ((value: string) => any) | undefined;
|
|
216
215
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
217
216
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
217
|
+
onInput?: ((value: string) => any) | undefined;
|
|
218
218
|
onSubmit?: ((value: string) => any) | undefined;
|
|
219
219
|
"onContent-status"?: ((hasContent: boolean) => any) | undefined;
|
|
220
220
|
"onEmpty-content"?: (() => any) | undefined;
|
|
@@ -407,6 +407,7 @@ tiny_mode_root: BooleanConstructor;
|
|
|
407
407
|
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
408
408
|
tiny_renderless: FunctionConstructor;
|
|
409
409
|
tiny_theme: StringConstructor;
|
|
410
|
+
tiny_mcp_config: ObjectConstructor;
|
|
410
411
|
tiny_chart_theme: ObjectConstructor;
|
|
411
412
|
}>>, () => VNode<RendererNode, RendererElement, {
|
|
412
413
|
[key: string]: any;
|
|
@@ -634,6 +635,7 @@ tiny_mode_root: BooleanConstructor;
|
|
|
634
635
|
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
635
636
|
tiny_renderless: FunctionConstructor;
|
|
636
637
|
tiny_theme: StringConstructor;
|
|
638
|
+
tiny_mcp_config: ObjectConstructor;
|
|
637
639
|
tiny_chart_theme: ObjectConstructor;
|
|
638
640
|
}>>, () => VNode<RendererNode, RendererElement, {
|
|
639
641
|
[key: string]: any;
|
|
@@ -688,8 +690,8 @@ keyDown: (e: KeyboardEvent) => void;
|
|
|
688
690
|
input: (event: Event, text: string) => boolean;
|
|
689
691
|
toggleExpand: () => void;
|
|
690
692
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
691
|
-
select: (value: string, context?: TriggerContext | undefined) => any;
|
|
692
693
|
close: () => any;
|
|
694
|
+
select: (value: string, context?: TriggerContext | undefined) => any;
|
|
693
695
|
"suggestion-select": (item: SuggestionItem) => any;
|
|
694
696
|
"update:open": (value: boolean) => any;
|
|
695
697
|
trigger: (handler: TriggerHandler) => any;
|
|
@@ -697,8 +699,8 @@ trigger: (handler: TriggerHandler) => any;
|
|
|
697
699
|
"update:expanded": (expanded: boolean) => any;
|
|
698
700
|
"fill-template": (template: string) => any;
|
|
699
701
|
}, string, PublicProps, Readonly<SuggestionProps> & Readonly<{
|
|
700
|
-
onSelect?: ((value: string, context?: TriggerContext | undefined) => any) | undefined;
|
|
701
702
|
onClose?: (() => any) | undefined;
|
|
703
|
+
onSelect?: ((value: string, context?: TriggerContext | undefined) => any) | undefined;
|
|
702
704
|
"onSuggestion-select"?: ((item: SuggestionItem) => any) | undefined;
|
|
703
705
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
704
706
|
onTrigger?: ((handler: TriggerHandler) => any) | undefined;
|
|
@@ -706,6 +708,7 @@ onTrigger?: ((handler: TriggerHandler) => any) | undefined;
|
|
|
706
708
|
"onUpdate:expanded"?: ((expanded: boolean) => any) | undefined;
|
|
707
709
|
"onFill-template"?: ((template: string) => any) | undefined;
|
|
708
710
|
}>, {
|
|
711
|
+
open: boolean;
|
|
709
712
|
loading: boolean;
|
|
710
713
|
title: string;
|
|
711
714
|
items: SuggestionItem[];
|
|
@@ -713,7 +716,6 @@ categories: Category[];
|
|
|
713
716
|
theme: "light" | "dark";
|
|
714
717
|
maxVisibleItems: number;
|
|
715
718
|
triggerKeys: string[];
|
|
716
|
-
open: boolean;
|
|
717
719
|
closeOnOutsideClick: boolean;
|
|
718
720
|
defaultExpanded: boolean;
|
|
719
721
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
@@ -732,8 +734,8 @@ readonly title: string;
|
|
|
732
734
|
readonly items: SuggestionItem[];
|
|
733
735
|
readonly categories: Category[];
|
|
734
736
|
readonly maxVisibleItems: number;
|
|
735
|
-
readonly onSelect?: ((...args: any[]) => any) | undefined;
|
|
736
737
|
readonly onClose?: ((...args: any[]) => any) | undefined;
|
|
738
|
+
readonly onSelect?: ((...args: any[]) => any) | undefined;
|
|
737
739
|
readonly "onCategory-select"?: ((...args: any[]) => any) | undefined;
|
|
738
740
|
readonly "onItem-hover"?: ((...args: any[]) => any) | undefined;
|
|
739
741
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, "loading" | "title" | "categories" | "maxVisibleItems">;
|
|
@@ -749,7 +751,7 @@ $slots: Readonly<{
|
|
|
749
751
|
$root: ComponentPublicInstance | null;
|
|
750
752
|
$parent: ComponentPublicInstance | null;
|
|
751
753
|
$host: Element | null;
|
|
752
|
-
$emit: ((event: "
|
|
754
|
+
$emit: ((event: "close", ...args: any[]) => void) & ((event: "select", ...args: any[]) => void) & ((event: "category-select", ...args: any[]) => void) & ((event: "item-hover", ...args: any[]) => void);
|
|
753
755
|
$el: HTMLDivElement;
|
|
754
756
|
$options: ComponentOptionsBase<Readonly<ExtractPropTypes< {
|
|
755
757
|
items: {
|
|
@@ -773,15 +775,15 @@ type: NumberConstructor;
|
|
|
773
775
|
default: number;
|
|
774
776
|
};
|
|
775
777
|
}>> & Readonly<{
|
|
776
|
-
onSelect?: ((...args: any[]) => any) | undefined;
|
|
777
778
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
779
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
778
780
|
"onCategory-select"?: ((...args: any[]) => any) | undefined;
|
|
779
781
|
"onItem-hover"?: ((...args: any[]) => any) | undefined;
|
|
780
782
|
}>, {
|
|
781
783
|
handleKeyDown: (e: KeyboardEvent) => void;
|
|
782
784
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
783
|
-
select: (...args: any[]) => void;
|
|
784
785
|
close: (...args: any[]) => void;
|
|
786
|
+
select: (...args: any[]) => void;
|
|
785
787
|
"category-select": (...args: any[]) => void;
|
|
786
788
|
"item-hover": (...args: any[]) => void;
|
|
787
789
|
}, string, {
|
|
@@ -836,8 +838,8 @@ type: NumberConstructor;
|
|
|
836
838
|
default: number;
|
|
837
839
|
};
|
|
838
840
|
}>> & Readonly<{
|
|
839
|
-
onSelect?: ((...args: any[]) => any) | undefined;
|
|
840
841
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
842
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
841
843
|
"onCategory-select"?: ((...args: any[]) => any) | undefined;
|
|
842
844
|
"onItem-hover"?: ((...args: any[]) => any) | undefined;
|
|
843
845
|
}>, "handleKeyDown" | ("loading" | "title" | "categories" | "maxVisibleItems")> & ShallowUnwrapRef< {
|
|
@@ -859,12 +861,14 @@ declare const __VLS_component_8: DefineComponent<__VLS_PublicProps_2, {}, {}, {}
|
|
|
859
861
|
"update:showAll": (value: boolean | undefined) => any;
|
|
860
862
|
} & {
|
|
861
863
|
"item-click": (item: SuggestionPillItem<Record<string, unknown>>) => any;
|
|
862
|
-
"click-outside": () => any;
|
|
864
|
+
"click-outside": (event: MouseEvent) => any;
|
|
863
865
|
}, string, PublicProps, Readonly<__VLS_PublicProps_2> & Readonly<{
|
|
864
866
|
"onItem-click"?: ((item: SuggestionPillItem<Record<string, unknown>>) => any) | undefined;
|
|
865
|
-
"onClick-outside"?: (() => any) | undefined;
|
|
867
|
+
"onClick-outside"?: ((event: MouseEvent) => any) | undefined;
|
|
866
868
|
"onUpdate:showAll"?: ((value: boolean | undefined) => any) | undefined;
|
|
867
|
-
}>, {
|
|
869
|
+
}>, {
|
|
870
|
+
showAllButtonOn: "hover" | "always";
|
|
871
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
868
872
|
containerWrapperRef: HTMLDivElement;
|
|
869
873
|
containerRef: HTMLDivElement;
|
|
870
874
|
}, HTMLDivElement>;
|
|
@@ -982,9 +986,9 @@ declare function __VLS_template_5(): {
|
|
|
982
986
|
templateEditorRef: CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
983
987
|
value?: string;
|
|
984
988
|
} & TemplateEditorProps_2> & Readonly<{
|
|
985
|
-
onInput?: ((value: string) => any) | undefined;
|
|
986
989
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
987
990
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
991
|
+
onInput?: ((value: string) => any) | undefined;
|
|
988
992
|
onSubmit?: ((value: string) => any) | undefined;
|
|
989
993
|
"onContent-status"?: ((hasContent: boolean) => any) | undefined;
|
|
990
994
|
"onEmpty-content"?: (() => any) | undefined;
|
|
@@ -998,9 +1002,9 @@ declare function __VLS_template_5(): {
|
|
|
998
1002
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
999
1003
|
"update:value": (value: string) => any;
|
|
1000
1004
|
} & {
|
|
1001
|
-
input: (value: string) => any;
|
|
1002
1005
|
blur: (event: FocusEvent) => any;
|
|
1003
1006
|
focus: (event: FocusEvent) => any;
|
|
1007
|
+
input: (value: string) => any;
|
|
1004
1008
|
submit: (value: string) => any;
|
|
1005
1009
|
"content-status": (hasContent: boolean) => any;
|
|
1006
1010
|
"empty-content": () => any;
|
|
@@ -1016,9 +1020,9 @@ declare function __VLS_template_5(): {
|
|
|
1016
1020
|
}, Readonly<{
|
|
1017
1021
|
value?: string;
|
|
1018
1022
|
} & TemplateEditorProps_2> & Readonly<{
|
|
1019
|
-
onInput?: ((value: string) => any) | undefined;
|
|
1020
1023
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
1021
1024
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
1025
|
+
onInput?: ((value: string) => any) | undefined;
|
|
1022
1026
|
onSubmit?: ((value: string) => any) | undefined;
|
|
1023
1027
|
"onContent-status"?: ((hasContent: boolean) => any) | undefined;
|
|
1024
1028
|
"onEmpty-content"?: (() => any) | undefined;
|
|
@@ -1211,6 +1215,7 @@ declare function __VLS_template_5(): {
|
|
|
1211
1215
|
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
1212
1216
|
tiny_renderless: FunctionConstructor;
|
|
1213
1217
|
tiny_theme: StringConstructor;
|
|
1218
|
+
tiny_mcp_config: ObjectConstructor;
|
|
1214
1219
|
tiny_chart_theme: ObjectConstructor;
|
|
1215
1220
|
}>>, () => VNode<RendererNode, RendererElement, {
|
|
1216
1221
|
[key: string]: any;
|
|
@@ -1438,6 +1443,7 @@ declare function __VLS_template_5(): {
|
|
|
1438
1443
|
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
1439
1444
|
tiny_renderless: FunctionConstructor;
|
|
1440
1445
|
tiny_theme: StringConstructor;
|
|
1446
|
+
tiny_mcp_config: ObjectConstructor;
|
|
1441
1447
|
tiny_chart_theme: ObjectConstructor;
|
|
1442
1448
|
}>>, () => VNode<RendererNode, RendererElement, {
|
|
1443
1449
|
[key: string]: any;
|
|
@@ -1529,8 +1535,8 @@ declare function __VLS_template_7(): {
|
|
|
1529
1535
|
readonly items: SuggestionItem[];
|
|
1530
1536
|
readonly categories: Category[];
|
|
1531
1537
|
readonly maxVisibleItems: number;
|
|
1532
|
-
readonly onSelect?: ((...args: any[]) => any) | undefined;
|
|
1533
1538
|
readonly onClose?: ((...args: any[]) => any) | undefined;
|
|
1539
|
+
readonly onSelect?: ((...args: any[]) => any) | undefined;
|
|
1534
1540
|
readonly "onCategory-select"?: ((...args: any[]) => any) | undefined;
|
|
1535
1541
|
readonly "onItem-hover"?: ((...args: any[]) => any) | undefined;
|
|
1536
1542
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, "loading" | "title" | "categories" | "maxVisibleItems">;
|
|
@@ -1546,7 +1552,7 @@ declare function __VLS_template_7(): {
|
|
|
1546
1552
|
$root: ComponentPublicInstance | null;
|
|
1547
1553
|
$parent: ComponentPublicInstance | null;
|
|
1548
1554
|
$host: Element | null;
|
|
1549
|
-
$emit: ((event: "
|
|
1555
|
+
$emit: ((event: "close", ...args: any[]) => void) & ((event: "select", ...args: any[]) => void) & ((event: "category-select", ...args: any[]) => void) & ((event: "item-hover", ...args: any[]) => void);
|
|
1550
1556
|
$el: HTMLDivElement;
|
|
1551
1557
|
$options: ComponentOptionsBase<Readonly<ExtractPropTypes< {
|
|
1552
1558
|
items: {
|
|
@@ -1570,15 +1576,15 @@ declare function __VLS_template_7(): {
|
|
|
1570
1576
|
default: number;
|
|
1571
1577
|
};
|
|
1572
1578
|
}>> & Readonly<{
|
|
1573
|
-
onSelect?: ((...args: any[]) => any) | undefined;
|
|
1574
1579
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
1580
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
1575
1581
|
"onCategory-select"?: ((...args: any[]) => any) | undefined;
|
|
1576
1582
|
"onItem-hover"?: ((...args: any[]) => any) | undefined;
|
|
1577
1583
|
}>, {
|
|
1578
1584
|
handleKeyDown: (e: KeyboardEvent) => void;
|
|
1579
1585
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
1580
|
-
select: (...args: any[]) => void;
|
|
1581
1586
|
close: (...args: any[]) => void;
|
|
1587
|
+
select: (...args: any[]) => void;
|
|
1582
1588
|
"category-select": (...args: any[]) => void;
|
|
1583
1589
|
"item-hover": (...args: any[]) => void;
|
|
1584
1590
|
}, string, {
|
|
@@ -1633,8 +1639,8 @@ declare function __VLS_template_7(): {
|
|
|
1633
1639
|
default: number;
|
|
1634
1640
|
};
|
|
1635
1641
|
}>> & Readonly<{
|
|
1636
|
-
onSelect?: ((...args: any[]) => any) | undefined;
|
|
1637
1642
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
1643
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
1638
1644
|
"onCategory-select"?: ((...args: any[]) => any) | undefined;
|
|
1639
1645
|
"onItem-hover"?: ((...args: any[]) => any) | undefined;
|
|
1640
1646
|
}>, "handleKeyDown" | ("loading" | "title" | "categories" | "maxVisibleItems")> & ShallowUnwrapRef< {
|
|
@@ -2457,7 +2463,7 @@ export declare type SuggestionPillItem<T = Record<string, unknown>> = Suggestion
|
|
|
2457
2463
|
|
|
2458
2464
|
export declare interface SuggestionPillsEmits {
|
|
2459
2465
|
(e: 'item-click', item: SuggestionPillItem): void;
|
|
2460
|
-
(e: 'click-outside'): void;
|
|
2466
|
+
(e: 'click-outside', event: MouseEvent): void;
|
|
2461
2467
|
}
|
|
2462
2468
|
|
|
2463
2469
|
export declare interface SuggestionPillsProps {
|
|
@@ -2466,6 +2472,13 @@ export declare interface SuggestionPillsProps {
|
|
|
2466
2472
|
* model:showAll
|
|
2467
2473
|
*/
|
|
2468
2474
|
showAll?: boolean;
|
|
2475
|
+
/**
|
|
2476
|
+
* 显示更多按钮的时机
|
|
2477
|
+
* - hover: 鼠标悬停时显示
|
|
2478
|
+
* - always: 总是显示
|
|
2479
|
+
* @default 'hover'
|
|
2480
|
+
*/
|
|
2481
|
+
showAllButtonOn?: 'hover' | 'always';
|
|
2469
2482
|
}
|
|
2470
2483
|
|
|
2471
2484
|
/**
|