@opentiny/tiny-robot 0.2.10 → 0.2.11

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
@@ -10,6 +10,7 @@ import { ComponentOptionsBase } from 'vue';
10
10
  import { ComponentOptionsMixin } from 'vue';
11
11
  import { ComponentProvideOptions } from 'vue';
12
12
  import { ComponentPublicInstance } from 'vue';
13
+ import { ComputedRef } from 'vue';
13
14
  import { CreateComponentPublicInstanceWithMixins } from 'vue';
14
15
  import { CSSProperties } from 'vue';
15
16
  import { DebuggerEvent } from 'vue';
@@ -18,6 +19,7 @@ import { ExtractPropTypes } from 'vue';
18
19
  import { GlobalComponents } from 'vue';
19
20
  import { GlobalDirectives } from 'vue';
20
21
  import { InputMode as InputMode_2 } from './index.type';
22
+ import { MaybeElement } from '@vueuse/core';
21
23
  import { nextTick } from 'vue';
22
24
  import { OnCleanup } from '@vue/reactivity';
23
25
  import { Options } from 'markdown-it';
@@ -33,6 +35,7 @@ import { SubmitTrigger as SubmitTrigger_2 } from './index.type';
33
35
  import { TemplateEditorProps as TemplateEditorProps_2 } from './index.type';
34
36
  import { ThemeType as ThemeType_2 } from './index.type';
35
37
  import { TooltipContentProps } from './components/Tooltip.vue';
38
+ import { TransitionProps } from 'vue';
36
39
  import { VNode } from 'vue';
37
40
  import { VNodeProps } from 'vue';
38
41
  import { WatchOptions } from 'vue';
@@ -85,10 +88,10 @@ onOpen?: (() => any) | undefined;
85
88
  }>, {
86
89
  title: string;
87
90
  trigger: "click" | "manual";
88
- topOffset: string | number;
89
91
  groupShowMoreTrigger: "click" | "hover";
90
92
  popoverWidth: string | number;
91
93
  popoverHeight: string | number;
94
+ topOffset: string | number;
92
95
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
93
96
  popoverTriggerRef: HTMLDivElement;
94
97
  popoverRef: HTMLDivElement;
@@ -128,12 +131,102 @@ declare const __VLS_component_3: DefineComponent<DropdownMenuProps, {}, {}, {},
128
131
  "onItem-click"?: ((item: DropdownMenuItem) => any) | undefined;
129
132
  "onClick-outside"?: ((event: MouseEvent) => any) | undefined;
130
133
  }>, {
131
- trigger: "click" | "manual";
132
- minWidth: string | number;
133
- topOffset: string | number;
134
+ trigger: "click" | "hover" | "manual";
134
135
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
135
- dropDownTriggerRef: HTMLDivElement;
136
- dropdownMenuRef: HTMLDivElement;
136
+ basePopperRef: ({
137
+ $: ComponentInternalInstance;
138
+ $data: {};
139
+ $props: {
140
+ readonly offset?: number | {
141
+ mainAxis?: number;
142
+ crossAxis?: number;
143
+ } | undefined;
144
+ readonly placement?: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
145
+ readonly preventOverflow?: boolean | undefined;
146
+ readonly renderAllTriggers?: boolean | undefined;
147
+ readonly show?: boolean | undefined;
148
+ readonly transitionProps?: TransitionProps | undefined;
149
+ readonly triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>> | undefined;
150
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
151
+ $attrs: {
152
+ [x: string]: unknown;
153
+ };
154
+ $refs: {
155
+ [x: string]: unknown;
156
+ } & {
157
+ popperRef: HTMLDivElement;
158
+ };
159
+ $slots: Readonly<{
160
+ [name: string]: Slot<any> | undefined;
161
+ }>;
162
+ $root: ComponentPublicInstance | null;
163
+ $parent: ComponentPublicInstance | null;
164
+ $host: Element | null;
165
+ $emit: (event: string, ...args: any[]) => void;
166
+ $el: any;
167
+ $options: ComponentOptionsBase<Readonly<{
168
+ offset?: number | {
169
+ mainAxis?: number;
170
+ crossAxis?: number;
171
+ };
172
+ placement?: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
173
+ preventOverflow?: boolean;
174
+ renderAllTriggers?: boolean;
175
+ show?: boolean;
176
+ transitionProps?: TransitionProps;
177
+ triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
178
+ }> & Readonly<{}>, {
179
+ triggerRef: ComputedRef<MaybeElement>;
180
+ triggerRefs: Ref<MaybeElement[], MaybeElement[]>;
181
+ popperRef: Ref<HTMLDivElement | null, HTMLDivElement | null>;
182
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
183
+ placement: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
184
+ }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
185
+ beforeCreate?: (() => void) | (() => void)[];
186
+ created?: (() => void) | (() => void)[];
187
+ beforeMount?: (() => void) | (() => void)[];
188
+ mounted?: (() => void) | (() => void)[];
189
+ beforeUpdate?: (() => void) | (() => void)[];
190
+ updated?: (() => void) | (() => void)[];
191
+ activated?: (() => void) | (() => void)[];
192
+ deactivated?: (() => void) | (() => void)[];
193
+ beforeDestroy?: (() => void) | (() => void)[];
194
+ beforeUnmount?: (() => void) | (() => void)[];
195
+ destroyed?: (() => void) | (() => void)[];
196
+ unmounted?: (() => void) | (() => void)[];
197
+ renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
198
+ renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
199
+ errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
200
+ };
201
+ $forceUpdate: () => void;
202
+ $nextTick: nextTick;
203
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
204
+ } & Readonly<{
205
+ placement: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
206
+ }> & Omit<Readonly<{
207
+ offset?: number | {
208
+ mainAxis?: number;
209
+ crossAxis?: number;
210
+ };
211
+ placement?: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
212
+ preventOverflow?: boolean;
213
+ renderAllTriggers?: boolean;
214
+ show?: boolean;
215
+ transitionProps?: TransitionProps;
216
+ triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
217
+ }> & Readonly<{}>, "placement" | "triggerRef" | "triggerRefs" | "popperRef"> & ShallowUnwrapRef< {
218
+ triggerRef: ComputedRef<MaybeElement>;
219
+ triggerRefs: Ref<MaybeElement[], MaybeElement[]>;
220
+ popperRef: Ref<HTMLDivElement | null, HTMLDivElement | null>;
221
+ }> & {} & ComponentCustomProperties & {} & {
222
+ $slots: Readonly<{
223
+ trigger?: () => VNode | VNode[];
224
+ content?: () => VNode | VNode[];
225
+ }> & {
226
+ trigger?: () => VNode | VNode[];
227
+ content?: () => VNode | VNode[];
228
+ };
229
+ }) | null;
137
230
  }, any>;
138
231
 
139
232
  declare const __VLS_component_4: DefineComponent<PromptsProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
@@ -874,9 +967,11 @@ declare const __VLS_component_8: DefineComponent<__VLS_PublicProps_2, {}, {}, {}
874
967
  "onUpdate:showAll"?: ((value: boolean | undefined) => any) | undefined;
875
968
  }>, {
876
969
  showAllButtonOn: "hover" | "always";
970
+ overflowMode: "expand" | "scroll";
877
971
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
878
972
  containerWrapperRef: HTMLDivElement;
879
973
  containerRef: HTMLDivElement;
974
+ floatingItemsRef: HTMLDivElement;
880
975
  }, HTMLDivElement>;
881
976
 
882
977
  declare const __VLS_component_9: DefineComponent<SuggestionPillButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<SuggestionPillButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
@@ -960,10 +1055,104 @@ declare function __VLS_template_2(): {
960
1055
 
961
1056
  declare function __VLS_template_3(): {
962
1057
  attrs: Partial<{}>;
963
- slots: Readonly<DropdownMenuSlots> & DropdownMenuSlots;
1058
+ slots: {
1059
+ trigger?(_: {}): any;
1060
+ };
964
1061
  refs: {
965
- dropDownTriggerRef: HTMLDivElement;
966
- dropdownMenuRef: HTMLDivElement;
1062
+ basePopperRef: ({
1063
+ $: ComponentInternalInstance;
1064
+ $data: {};
1065
+ $props: {
1066
+ readonly offset?: number | {
1067
+ mainAxis?: number;
1068
+ crossAxis?: number;
1069
+ } | undefined;
1070
+ readonly placement?: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
1071
+ readonly preventOverflow?: boolean | undefined;
1072
+ readonly renderAllTriggers?: boolean | undefined;
1073
+ readonly show?: boolean | undefined;
1074
+ readonly transitionProps?: TransitionProps | undefined;
1075
+ readonly triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>> | undefined;
1076
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
1077
+ $attrs: {
1078
+ [x: string]: unknown;
1079
+ };
1080
+ $refs: {
1081
+ [x: string]: unknown;
1082
+ } & {
1083
+ popperRef: HTMLDivElement;
1084
+ };
1085
+ $slots: Readonly<{
1086
+ [name: string]: Slot<any> | undefined;
1087
+ }>;
1088
+ $root: ComponentPublicInstance | null;
1089
+ $parent: ComponentPublicInstance | null;
1090
+ $host: Element | null;
1091
+ $emit: (event: string, ...args: any[]) => void;
1092
+ $el: any;
1093
+ $options: ComponentOptionsBase<Readonly<{
1094
+ offset?: number | {
1095
+ mainAxis?: number;
1096
+ crossAxis?: number;
1097
+ };
1098
+ placement?: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
1099
+ preventOverflow?: boolean;
1100
+ renderAllTriggers?: boolean;
1101
+ show?: boolean;
1102
+ transitionProps?: TransitionProps;
1103
+ triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
1104
+ }> & Readonly<{}>, {
1105
+ triggerRef: ComputedRef<MaybeElement>;
1106
+ triggerRefs: Ref<MaybeElement[], MaybeElement[]>;
1107
+ popperRef: Ref<HTMLDivElement | null, HTMLDivElement | null>;
1108
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
1109
+ placement: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
1110
+ }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
1111
+ beforeCreate?: (() => void) | (() => void)[];
1112
+ created?: (() => void) | (() => void)[];
1113
+ beforeMount?: (() => void) | (() => void)[];
1114
+ mounted?: (() => void) | (() => void)[];
1115
+ beforeUpdate?: (() => void) | (() => void)[];
1116
+ updated?: (() => void) | (() => void)[];
1117
+ activated?: (() => void) | (() => void)[];
1118
+ deactivated?: (() => void) | (() => void)[];
1119
+ beforeDestroy?: (() => void) | (() => void)[];
1120
+ beforeUnmount?: (() => void) | (() => void)[];
1121
+ destroyed?: (() => void) | (() => void)[];
1122
+ unmounted?: (() => void) | (() => void)[];
1123
+ renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
1124
+ renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
1125
+ errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
1126
+ };
1127
+ $forceUpdate: () => void;
1128
+ $nextTick: nextTick;
1129
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
1130
+ } & Readonly<{
1131
+ placement: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
1132
+ }> & Omit<Readonly<{
1133
+ offset?: number | {
1134
+ mainAxis?: number;
1135
+ crossAxis?: number;
1136
+ };
1137
+ placement?: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
1138
+ preventOverflow?: boolean;
1139
+ renderAllTriggers?: boolean;
1140
+ show?: boolean;
1141
+ transitionProps?: TransitionProps;
1142
+ triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
1143
+ }> & Readonly<{}>, "placement" | "triggerRef" | "triggerRefs" | "popperRef"> & ShallowUnwrapRef< {
1144
+ triggerRef: ComputedRef<MaybeElement>;
1145
+ triggerRefs: Ref<MaybeElement[], MaybeElement[]>;
1146
+ popperRef: Ref<HTMLDivElement | null, HTMLDivElement | null>;
1147
+ }> & {} & ComponentCustomProperties & {} & {
1148
+ $slots: Readonly<{
1149
+ trigger?: () => VNode | VNode[];
1150
+ content?: () => VNode | VNode[];
1151
+ }> & {
1152
+ trigger?: () => VNode | VNode[];
1153
+ content?: () => VNode | VNode[];
1154
+ };
1155
+ }) | null;
967
1156
  };
968
1157
  rootEl: any;
969
1158
  };
@@ -1672,6 +1861,7 @@ declare function __VLS_template_8(): {
1672
1861
  refs: {
1673
1862
  containerWrapperRef: HTMLDivElement;
1674
1863
  containerRef: HTMLDivElement;
1864
+ floatingItemsRef: HTMLDivElement;
1675
1865
  };
1676
1866
  rootEl: HTMLDivElement;
1677
1867
  };
@@ -2038,11 +2228,25 @@ export { _default_9 as Welcome }
2038
2228
 
2039
2229
  export declare interface DropdownMenuEmits {
2040
2230
  (e: 'item-click', item: DropdownMenuItem): void;
2231
+ /**
2232
+ * 点击外部区域时触发, 仅在 trigger 为 'click' 或 'manual' 时有效
2233
+ */
2041
2234
  (e: 'click-outside', event: MouseEvent): void;
2042
2235
  }
2043
2236
 
2237
+ export declare interface DropdownMenuEventProps {
2238
+ onItemClick?: (item: DropdownMenuItem) => void;
2239
+ onClickOutside?: (event: MouseEvent) => void;
2240
+ }
2241
+
2044
2242
  export declare interface DropdownMenuEvents {
2243
+ /**
2244
+ * @deprecated
2245
+ */
2045
2246
  itemClick?: (item: DropdownMenuItem) => void;
2247
+ /**
2248
+ * @deprecated
2249
+ */
2046
2250
  clickOutside?: (event: MouseEvent) => void;
2047
2251
  }
2048
2252
 
@@ -2060,13 +2264,11 @@ export declare interface DropdownMenuProps {
2060
2264
  /**
2061
2265
  * 触发方式。默认值为 'click'
2062
2266
  */
2063
- trigger?: 'click' | 'manual';
2064
- minWidth?: string | number;
2065
- topOffset?: string | number;
2267
+ trigger?: 'click' | 'hover' | 'manual';
2066
2268
  }
2067
2269
 
2068
2270
  export declare interface DropdownMenuSlots {
2069
- default?: () => unknown;
2271
+ trigger?: () => VNode | VNode[];
2070
2272
  }
2071
2273
 
2072
2274
  export declare interface FeedbackEvents {
@@ -2440,16 +2642,7 @@ export declare interface SuggestionItem {
2440
2642
 
2441
2643
  declare type SuggestionItem_2<T = Record<string, unknown>> = SuggestionBaseItem & T;
2442
2644
 
2443
- export declare type SuggestionPillAction = {
2444
- type: 'popover';
2445
- props: SuggestionPopoverProps;
2446
- slots?: Omit<SuggestionPopoverSlots, 'default'>;
2447
- events?: SuggestionPopoverEvents;
2448
- } | {
2449
- type: 'menu';
2450
- props: DropdownMenuProps;
2451
- events?: DropdownMenuEvents;
2452
- };
2645
+ export declare type SuggestionPillAction = SuggestionPillPopoverAction | SuggestionPillMenuAction;
2453
2646
 
2454
2647
  export declare type SuggestionPillBaseItem<T> = {
2455
2648
  id: string;
@@ -2479,6 +2672,25 @@ export declare type SuggestionPillItem<T = Record<string, unknown>> = Suggestion
2479
2672
  icon: VNode | Component;
2480
2673
  });
2481
2674
 
2675
+ export declare type SuggestionPillMenuAction = {
2676
+ type: 'menu';
2677
+ props: DropdownMenuProps & DropdownMenuEventProps;
2678
+ /**
2679
+ * @deprecated use onXXX in props instead
2680
+ */
2681
+ events?: DropdownMenuEvents;
2682
+ };
2683
+
2684
+ export declare type SuggestionPillPopoverAction = {
2685
+ type: 'popover';
2686
+ props: SuggestionPopoverProps & SuggestionPopoverEventProps;
2687
+ slots?: Omit<SuggestionPopoverSlots, 'default'>;
2688
+ /**
2689
+ * @deprecated use onXXX in props instead
2690
+ */
2691
+ events?: SuggestionPopoverEvents;
2692
+ };
2693
+
2482
2694
  export declare interface SuggestionPillsEmits {
2483
2695
  (e: 'item-click', item: SuggestionPillItem): void;
2484
2696
  (e: 'click-outside', event: MouseEvent): void;
@@ -2497,6 +2709,18 @@ export declare interface SuggestionPillsProps {
2497
2709
  * @default 'hover'
2498
2710
  */
2499
2711
  showAllButtonOn?: 'hover' | 'always';
2712
+ /**
2713
+ * 控制多余按钮如何展示
2714
+ * - expand: 点击更多按钮展开所有项
2715
+ * - scroll: 横向滚动显示多余项
2716
+ * @default 'expand'
2717
+ */
2718
+ overflowMode?: 'expand' | 'scroll';
2719
+ /**
2720
+ * 鼠标悬停时是否自动滚动到可见区域
2721
+ * @default false
2722
+ */
2723
+ autoScrollOnHover?: boolean;
2500
2724
  }
2501
2725
 
2502
2726
  /**
@@ -2506,11 +2730,34 @@ export declare interface SuggestionPillsSlots {
2506
2730
  default?: () => VNode | VNode[];
2507
2731
  }
2508
2732
 
2733
+ declare interface SuggestionPopoverEventProps {
2734
+ onItemClick?: (item: SuggestionItem_2) => void;
2735
+ onGroupClick?: (group: SuggestionGroup) => void;
2736
+ onOpen?: () => void;
2737
+ onClose?: () => void;
2738
+ onClickOutside?: (event: MouseEvent) => void;
2739
+ }
2740
+
2509
2741
  declare interface SuggestionPopoverEvents {
2742
+ /**
2743
+ * @deprecated use onItemClick in props instead
2744
+ */
2510
2745
  itemClick?: (item: SuggestionItem_2) => void;
2746
+ /**
2747
+ * @deprecated use onGroupClick in props instead
2748
+ */
2511
2749
  groupClick?: (group: SuggestionGroup) => void;
2750
+ /**
2751
+ * @deprecated use onOpen in props instead
2752
+ */
2512
2753
  open?: () => void;
2754
+ /**
2755
+ * @deprecated use onClose in props instead
2756
+ */
2513
2757
  close?: () => void;
2758
+ /**
2759
+ * @deprecated use onClickOutside in props instead
2760
+ */
2514
2761
  clickOutside?: (event: MouseEvent) => void;
2515
2762
  }
2516
2763