@opentiny/tiny-robot 0.4.2-alpha.4 → 0.4.2-alpha.5
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/action-group/ActionGroup.vue.d.ts +26 -0
- package/dist/action-group/ActionGroupItem.vue.d.ts +18 -0
- package/dist/action-group/index.d.ts +12 -0
- package/dist/action-group/index.type.d.ts +17 -0
- package/dist/anchor/components/AnchorItem.vue.d.ts +24 -0
- package/dist/anchor/components/AnchorList.vue.d.ts +20 -0
- package/dist/anchor/components/AnchorOverlay.vue.d.ts +33 -0
- package/dist/anchor/components/AnchorSearch.vue.d.ts +7 -0
- package/dist/anchor/composables/index.d.ts +5 -0
- package/dist/anchor/composables/useActiveSync.d.ts +10 -0
- package/dist/anchor/composables/useFloatingOffset.d.ts +6 -0
- package/dist/anchor/composables/useNavController.d.ts +12 -0
- package/dist/anchor/composables/useOverlayInteractions.d.ts +6 -0
- package/dist/anchor/composables/useTargetFeedback.d.ts +5 -0
- package/dist/anchor/defaults.d.ts +16 -0
- package/dist/anchor/index.d.ts +7 -0
- package/dist/anchor/index.type.d.ts +60 -0
- package/dist/anchor/index.vue.d.ts +159 -0
- package/dist/anchor/internal.type.d.ts +103 -0
- package/dist/anchor/utils/scroll.d.ts +7 -0
- package/dist/anchor/utils/target.d.ts +6 -0
- package/dist/attachments/components/FileCard.vue.d.ts +18 -0
- package/dist/attachments/components/ImagePreview.vue.d.ts +17 -0
- package/dist/attachments/components/index.d.ts +2 -0
- package/dist/attachments/composables/index.d.ts +5 -0
- package/dist/attachments/composables/useFileCard.d.ts +15 -0
- package/dist/attachments/composables/useFileType.d.ts +20 -0
- package/dist/attachments/composables/useImagePreview.d.ts +18 -0
- package/dist/attachments/composables/useListType.d.ts +11 -0
- package/dist/attachments/index.d.ts +7 -0
- package/dist/attachments/index.js +2 -2
- package/dist/attachments/index.type.d.ts +70 -0
- package/dist/attachments/index.vue.d.ts +27 -0
- package/dist/attachments/utils.d.ts +3 -0
- package/dist/base-popper/components/Popper.vue.d.ts +28 -0
- package/dist/base-popper/index.d.ts +2 -0
- package/dist/base-popper/index.vue.d.ts +41 -0
- package/dist/bubble/Bubble.vue.d.ts +39 -0
- package/dist/bubble/BubbleBoxWrapper.vue.d.ts +22 -0
- package/dist/bubble/BubbleContentWrapper.vue.d.ts +16 -0
- package/dist/bubble/BubbleItem.vue.d.ts +36 -0
- package/dist/bubble/BubbleList.vue.d.ts +41 -0
- package/dist/bubble/BubbleProvider.vue.d.ts +18 -0
- package/dist/bubble/composables/index.d.ts +10 -0
- package/dist/bubble/composables/useBubbleBoxRenderer.d.ts +18 -0
- package/dist/bubble/composables/useBubbleContentRenderer.d.ts +18 -0
- package/dist/bubble/composables/useBubbleStateChange.d.ts +2 -0
- package/dist/bubble/composables/useBubbleStore.d.ts +16 -0
- package/dist/bubble/composables/useContentResolver.d.ts +5 -0
- package/dist/bubble/composables/useCopyCleanup.d.ts +6 -0
- package/dist/bubble/composables/useMessageContent.d.ts +5 -0
- package/dist/bubble/composables/useMessageGroup.d.ts +4 -0
- package/dist/bubble/composables/useOmitMessageFields.d.ts +12 -0
- package/dist/bubble/composables/useToolCall.d.ts +25 -0
- package/dist/bubble/constants.d.ts +42 -0
- package/dist/bubble/index.d.ts +19 -0
- package/dist/bubble/index.type.d.ts +171 -0
- package/dist/bubble/renderers/Box.vue.d.ts +18 -0
- package/dist/bubble/renderers/Image.vue.d.ts +4 -0
- package/dist/bubble/renderers/Loading.vue.d.ts +4 -0
- package/dist/bubble/renderers/Markdown.vue.d.ts +4 -0
- package/dist/bubble/renderers/Reasoning.vue.d.ts +9 -0
- package/dist/bubble/renderers/Text.vue.d.ts +4 -0
- package/dist/bubble/renderers/Tool.vue.d.ts +14 -0
- package/dist/bubble/renderers/ToolRole.vue.d.ts +4 -0
- package/dist/bubble/renderers/Tools.vue.d.ts +4 -0
- package/dist/bubble/renderers/allRenderers.d.ts +93 -0
- package/dist/bubble/renderers/defaultRenderers.d.ts +27 -0
- package/dist/bubble/utils.d.ts +7 -0
- package/dist/chat/components/ChatConversation.vue.d.ts +70 -0
- package/dist/chat/components/ChatLauncherButton.vue.d.ts +12 -0
- package/dist/chat/components/ChatMcpTrigger.vue.d.ts +30 -0
- package/dist/chat/components/ChatThemeToggleButton.vue.d.ts +2 -0
- package/dist/chat/components/ChatWelcome.vue.d.ts +13 -0
- package/dist/chat/composables/useChatConversation.d.ts +37 -0
- package/dist/chat/composables/useChatMcp.d.ts +29 -0
- package/dist/chat/composables/useChatModel.d.ts +27 -0
- package/dist/chat/index.d.ts +9 -0
- package/dist/chat/index.js +13701 -0
- package/dist/chat/index.type.d.ts +88 -0
- package/dist/chat/index.vue.d.ts +58 -0
- package/dist/container/index.d.ts +7 -0
- package/dist/container/index.type.d.ts +20 -0
- package/dist/container/index.vue.d.ts +32 -0
- package/dist/conversations/index.d.ts +7 -0
- package/dist/conversations/index.vue.d.ts +2 -0
- package/dist/drag-overlay/constants.d.ts +17 -0
- package/dist/drag-overlay/directives/vDropzone.d.ts +14 -0
- package/dist/drag-overlay/index.d.ts +7 -0
- package/dist/drag-overlay/index.type.d.ts +105 -0
- package/dist/drag-overlay/index.vue.d.ts +20 -0
- package/dist/dropdown-menu/composables/usePopperHover.d.ts +6 -0
- package/dist/dropdown-menu/index.d.ts +7 -0
- package/dist/dropdown-menu/index.js +17 -17
- package/dist/dropdown-menu/index.type.d.ts +42 -0
- package/dist/dropdown-menu/index.vue.d.ts +217 -0
- package/dist/feedback/components/SourceList.vue.d.ts +11 -0
- package/dist/feedback/components/index.d.ts +1 -0
- package/dist/feedback/index.d.ts +7 -0
- package/dist/feedback/index.type.d.ts +25 -0
- package/dist/feedback/index.vue.d.ts +13 -0
- package/dist/flow-layout-buttons/index.d.ts +7 -0
- package/dist/flow-layout-buttons/index.js +1 -1
- package/dist/flow-layout-buttons/index.type.d.ts +35 -0
- package/dist/flow-layout-buttons/index.vue.d.ts +22 -0
- package/dist/history/components/Empty.vue.d.ts +7 -0
- package/dist/history/components/MenuList.vue.d.ts +24 -0
- package/dist/history/composables/useRenameEditor.d.ts +22 -0
- package/dist/history/constants.d.ts +1 -0
- package/dist/history/index.d.ts +7 -0
- package/dist/history/index.type.d.ts +33 -0
- package/dist/history/index.vue.d.ts +18 -0
- package/dist/icon-button/index.d.ts +7 -0
- package/dist/icon-button/index.type.d.ts +7 -0
- package/dist/icon-button/index.vue.d.ts +6 -0
- package/dist/index.d.ts +49 -5018
- package/dist/index.js +1 -1
- package/dist/mcp-add-form/components/CodeEditor.vue.d.ts +9 -0
- package/dist/mcp-add-form/components/FormEditor.vue.d.ts +10 -0
- package/dist/mcp-add-form/components/index.d.ts +2 -0
- package/dist/mcp-add-form/index.d.ts +7 -0
- package/dist/mcp-add-form/index.type.d.ts +19 -0
- package/dist/mcp-add-form/index.vue.d.ts +13 -0
- package/dist/mcp-server-picker/components/NoData.vue.d.ts +7 -0
- package/dist/mcp-server-picker/components/PluginCard.vue.d.ts +40 -0
- package/dist/mcp-server-picker/components/PluginModal.vue.d.ts +15 -0
- package/dist/mcp-server-picker/components/index.d.ts +3 -0
- package/dist/mcp-server-picker/index.d.ts +7 -0
- package/dist/mcp-server-picker/index.js +83 -80
- package/dist/mcp-server-picker/index.type.d.ts +99 -0
- package/dist/mcp-server-picker/index.vue.d.ts +71 -0
- package/dist/prompts/index.d.ts +12 -0
- package/dist/prompts/index.type.d.ts +59 -0
- package/dist/prompts/prompt.vue.d.ts +5 -0
- package/dist/prompts/prompts.vue.d.ts +20 -0
- package/dist/sender/components/editor-content/index.vue.d.ts +4 -0
- package/dist/sender/components/footer/index.vue.d.ts +38 -0
- package/dist/sender/components/layouts/MultiLineLayout.vue.d.ts +43 -0
- package/dist/sender/components/layouts/SingleLineLayout.vue.d.ts +32 -0
- package/dist/sender/composables/index.d.ts +7 -0
- package/dist/sender/composables/useAutoSize.d.ts +5 -0
- package/dist/sender/composables/useEditor.d.ts +13 -0
- package/dist/sender/composables/useKeyboardShortcuts.d.ts +7 -0
- package/dist/sender/composables/useModeSwitch.d.ts +4 -0
- package/dist/sender/composables/useSenderCore.d.ts +31 -0
- package/dist/sender/composables/useSlotScope.d.ts +10 -0
- package/dist/sender/context/index.d.ts +6 -0
- package/dist/sender/context/types.d.ts +7 -0
- package/dist/sender/extensions/constants.d.ts +94 -0
- package/dist/sender/extensions/index.d.ts +12 -0
- package/dist/sender/extensions/mention/commands.d.ts +20 -0
- package/dist/sender/extensions/mention/components/mention-list.vue.d.ts +18 -0
- package/dist/sender/extensions/mention/components/mention-view.vue.d.ts +19 -0
- package/dist/sender/extensions/mention/extension.d.ts +6 -0
- package/dist/sender/extensions/mention/index.d.ts +22 -0
- package/dist/sender/extensions/mention/plugin.d.ts +16 -0
- package/dist/sender/extensions/mention/types.d.ts +126 -0
- package/dist/sender/extensions/mention/utils.d.ts +34 -0
- package/dist/sender/extensions/suggestion/extension.d.ts +8 -0
- package/dist/sender/extensions/suggestion/index.d.ts +20 -0
- package/dist/sender/extensions/suggestion/plugin.d.ts +21 -0
- package/dist/sender/extensions/suggestion/suggestion-list.vue.d.ts +46 -0
- package/dist/sender/extensions/suggestion/types.d.ts +254 -0
- package/dist/sender/extensions/suggestion/utils/filter.d.ts +29 -0
- package/dist/sender/extensions/suggestion/utils/highlight.d.ts +73 -0
- package/dist/sender/extensions/template/block/extension.d.ts +6 -0
- package/dist/sender/extensions/template/block/plugins.d.ts +13 -0
- package/dist/sender/extensions/template/block/template-block-view.vue.d.ts +14 -0
- package/dist/sender/extensions/template/commands.d.ts +31 -0
- package/dist/sender/extensions/template/extension.d.ts +6 -0
- package/dist/sender/extensions/template/index.d.ts +21 -0
- package/dist/sender/extensions/template/select/dropdown-manager.d.ts +23 -0
- package/dist/sender/extensions/template/select/extension.d.ts +5 -0
- package/dist/sender/extensions/template/select/plugins.d.ts +34 -0
- package/dist/sender/extensions/template/select/template-select-view.vue.d.ts +20 -0
- package/dist/sender/extensions/template/types.d.ts +100 -0
- package/dist/sender/extensions/template/utils.d.ts +20 -0
- package/dist/sender/extensions/utils/id-generator.d.ts +16 -0
- package/dist/sender/extensions/utils/index.d.ts +7 -0
- package/dist/sender/extensions/utils/keyboard.d.ts +49 -0
- package/dist/sender/extensions/utils/position.d.ts +25 -0
- package/dist/sender/index.d.ts +136 -0
- package/dist/sender/index.type.d.ts +302 -0
- package/dist/sender/index.vue.d.ts +90 -0
- package/dist/sender/types/base.d.ts +239 -0
- package/dist/sender/types/components.d.ts +68 -0
- package/dist/sender/types/composables.d.ts +122 -0
- package/dist/sender/types/context.d.ts +132 -0
- package/dist/sender/types/slots.d.ts +67 -0
- package/dist/sender/utils/countGraphemes.d.ts +1 -0
- package/dist/sender-actions/action-button/index.vue.d.ts +23 -0
- package/dist/sender-actions/clear-button/index.vue.d.ts +2 -0
- package/dist/sender-actions/clear-button/useClearButtonState.d.ts +6 -0
- package/dist/sender-actions/default-actions/index.vue.d.ts +17 -0
- package/dist/sender-actions/index.d.ts +21 -0
- package/dist/sender-actions/index.type.d.ts +7 -0
- package/dist/sender-actions/submit-button/index.vue.d.ts +2 -0
- package/dist/sender-actions/types/common.d.ts +40 -0
- package/dist/sender-actions/types/index.d.ts +5 -0
- package/dist/sender-actions/types/tooltip.d.ts +7 -0
- package/dist/sender-actions/upload-button/index.type.d.ts +57 -0
- package/dist/sender-actions/upload-button/index.vue.d.ts +16 -0
- package/dist/sender-actions/utils/tooltip.d.ts +8 -0
- package/dist/sender-actions/voice-button/index.type.d.ts +78 -0
- package/dist/sender-actions/voice-button/index.vue.d.ts +43 -0
- package/dist/sender-actions/voice-button/speech.types.d.ts +40 -0
- package/dist/sender-actions/voice-button/useSpeechHandler.d.ts +10 -0
- package/dist/sender-actions/voice-button/webSpeechHandler.d.ts +40 -0
- package/dist/sender-actions/word-counter/index.vue.d.ts +2 -0
- package/dist/sender-compat/index.d.ts +7 -0
- package/dist/sender-compat/index.type.d.ts +91 -0
- package/dist/sender-compat/index.vue.d.ts +532 -0
- package/dist/shared/composables/createTeleport.d.ts +2 -0
- package/dist/shared/composables/index.d.ts +5 -0
- package/dist/shared/composables/useAutoScroll.d.ts +25 -0
- package/dist/shared/composables/useSlotRefs.d.ts +12 -0
- package/dist/shared/composables/useTeleportTarget.d.ts +11 -0
- package/dist/shared/composables/useTouchDevice.d.ts +3 -0
- package/dist/shared/utils.d.ts +7 -0
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/components/PillButton.vue.d.ts +16 -0
- package/dist/suggestion-pills/components/index.d.ts +1 -0
- package/dist/suggestion-pills/index.d.ts +13 -0
- package/dist/suggestion-pills/index.js +12 -12
- package/dist/suggestion-pills/index.type.d.ts +45 -0
- package/dist/suggestion-pills/index.vue.d.ts +44 -0
- package/dist/suggestion-popover/components/Backdrop.vue.d.ts +5 -0
- package/dist/suggestion-popover/components/Header.vue.d.ts +4 -0
- package/dist/suggestion-popover/components/Loading.vue.d.ts +17 -0
- package/dist/suggestion-popover/components/NoData.vue.d.ts +17 -0
- package/dist/suggestion-popover/components/Tooltip.vue.d.ts +19 -0
- package/dist/suggestion-popover/index.d.ts +7 -0
- package/dist/suggestion-popover/index.js +35 -35
- package/dist/suggestion-popover/index.type.d.ts +80 -0
- package/dist/suggestion-popover/index.vue.d.ts +262 -0
- package/dist/theme-provider/constants.d.ts +6 -0
- package/dist/theme-provider/index.d.ts +9 -0
- package/dist/theme-provider/index.js +32 -41
- package/dist/theme-provider/index.type.d.ts +18 -0
- package/dist/theme-provider/index.vue.d.ts +32 -0
- package/dist/theme-provider/useTheme.d.ts +11 -0
- package/dist/useTheme.js +22 -0
- package/dist/welcome/index.d.ts +7 -0
- package/dist/welcome/index.type.d.ts +10 -0
- package/dist/welcome/index.vue.d.ts +18 -0
- package/package.json +22 -3
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export interface PluginTool {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type PluginAddState = 'idle' | 'loading' | 'added';
|
|
8
|
+
export interface PluginInfo {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
description: string;
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
expanded?: boolean;
|
|
15
|
+
tools: PluginTool[];
|
|
16
|
+
addState?: PluginAddState;
|
|
17
|
+
category?: string;
|
|
18
|
+
}
|
|
19
|
+
export type PluginCardMode = 'installed' | 'market';
|
|
20
|
+
export interface PluginCardProps {
|
|
21
|
+
plugin: PluginInfo;
|
|
22
|
+
mode?: PluginCardMode;
|
|
23
|
+
showToolCount?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface PluginCardEmits {
|
|
26
|
+
(e: 'toggle-plugin', enabled: boolean): void;
|
|
27
|
+
(e: 'toggle-tool', toolId: string, enabled: boolean): void;
|
|
28
|
+
(e: 'add-plugin', plugin: PluginInfo): void;
|
|
29
|
+
(e: 'delete-plugin'): void;
|
|
30
|
+
}
|
|
31
|
+
export interface MarketCategoryOption {
|
|
32
|
+
value: string;
|
|
33
|
+
label: string;
|
|
34
|
+
}
|
|
35
|
+
export interface PopupConfig {
|
|
36
|
+
type: 'fixed' | 'drawer';
|
|
37
|
+
position?: {
|
|
38
|
+
top?: string | number;
|
|
39
|
+
left?: string | number;
|
|
40
|
+
right?: string | number;
|
|
41
|
+
bottom?: string | number;
|
|
42
|
+
};
|
|
43
|
+
drawer?: {
|
|
44
|
+
direction: 'left' | 'right';
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export interface PluginFormData {
|
|
48
|
+
name: string;
|
|
49
|
+
description: string;
|
|
50
|
+
type: 'sse' | 'streamableHttp';
|
|
51
|
+
url: string;
|
|
52
|
+
headers: string;
|
|
53
|
+
thumbnail?: File | null;
|
|
54
|
+
}
|
|
55
|
+
export type PluginCreationData = PluginFormData | string;
|
|
56
|
+
export interface PluginModalEmits {
|
|
57
|
+
(e: 'update:visible', value: boolean): void;
|
|
58
|
+
(e: 'confirm', type: 'form' | 'code', data: PluginCreationData): void;
|
|
59
|
+
}
|
|
60
|
+
export interface McpServerPickerProps {
|
|
61
|
+
installedPlugins?: PluginInfo[];
|
|
62
|
+
marketPlugins?: PluginInfo[];
|
|
63
|
+
searchPlaceholder?: string;
|
|
64
|
+
enableSearch?: boolean;
|
|
65
|
+
installedSearchFn?: (query: string, item: PluginInfo) => boolean;
|
|
66
|
+
marketSearchFn?: (query: string, item: PluginInfo) => boolean;
|
|
67
|
+
marketCategoryOptions?: MarketCategoryOption[];
|
|
68
|
+
marketCategoryPlaceholder?: string;
|
|
69
|
+
enableMarketCategoryFilter?: boolean;
|
|
70
|
+
defaultActiveTab?: 'installed' | 'market';
|
|
71
|
+
showInstalledTab?: boolean;
|
|
72
|
+
showMarketTab?: boolean;
|
|
73
|
+
visible?: boolean;
|
|
74
|
+
popupConfig?: PopupConfig;
|
|
75
|
+
activeCount?: number;
|
|
76
|
+
installedTabTitle?: string;
|
|
77
|
+
marketTabTitle?: string;
|
|
78
|
+
title?: string;
|
|
79
|
+
showCustomAddButton?: boolean;
|
|
80
|
+
customAddButtonText?: string;
|
|
81
|
+
allowPluginToggle?: boolean;
|
|
82
|
+
allowToolToggle?: boolean;
|
|
83
|
+
allowPluginDelete?: boolean;
|
|
84
|
+
allowPluginAdd?: boolean;
|
|
85
|
+
loading?: boolean;
|
|
86
|
+
marketLoading?: boolean;
|
|
87
|
+
}
|
|
88
|
+
export interface McpServerPickerEmits {
|
|
89
|
+
(e: 'market-category-change', category: string): void;
|
|
90
|
+
(e: 'tab-change', activeTab: 'installed' | 'market'): void;
|
|
91
|
+
(e: 'plugin-toggle', plugin: PluginInfo, enabled: boolean): void;
|
|
92
|
+
(e: 'plugin-delete', plugin: PluginInfo): void;
|
|
93
|
+
(e: 'plugin-add', plugin: PluginInfo): void;
|
|
94
|
+
(e: 'plugin-create', type: 'form' | 'code', data: PluginCreationData): void;
|
|
95
|
+
(e: 'tool-toggle', plugin: PluginInfo, toolId: string, enabled: boolean): void;
|
|
96
|
+
(e: 'refresh', tab: 'installed' | 'market'): void;
|
|
97
|
+
(e: 'update:activeCount', count: number): void;
|
|
98
|
+
(e: 'update:visible', visible: boolean): void;
|
|
99
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { PluginInfo, McpServerPickerProps, PluginCreationData, PopupConfig } from './index.type';
|
|
2
|
+
type __VLS_Props = McpServerPickerProps;
|
|
3
|
+
type __VLS_PublicProps = {
|
|
4
|
+
'visible': boolean;
|
|
5
|
+
} & __VLS_Props;
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
'header-actions'?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
refs: {};
|
|
12
|
+
rootEl: any;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
|
+
"update:visible": (value: boolean) => any;
|
|
17
|
+
} & {
|
|
18
|
+
refresh: (tab: "installed" | "market") => any;
|
|
19
|
+
"update:visible": (visible: boolean) => any;
|
|
20
|
+
"market-category-change": (category: string) => any;
|
|
21
|
+
"tab-change": (activeTab: "installed" | "market") => any;
|
|
22
|
+
"plugin-toggle": (plugin: PluginInfo, enabled: boolean) => any;
|
|
23
|
+
"plugin-delete": (plugin: PluginInfo) => any;
|
|
24
|
+
"plugin-add": (plugin: PluginInfo) => any;
|
|
25
|
+
"plugin-create": (type: "code" | "form", data: PluginCreationData) => any;
|
|
26
|
+
"tool-toggle": (plugin: PluginInfo, toolId: string, enabled: boolean) => any;
|
|
27
|
+
"update:activeCount": (count: number) => any;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
29
|
+
onRefresh?: ((tab: "installed" | "market") => any) | undefined;
|
|
30
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
31
|
+
"onMarket-category-change"?: ((category: string) => any) | undefined;
|
|
32
|
+
"onTab-change"?: ((activeTab: "installed" | "market") => any) | undefined;
|
|
33
|
+
"onPlugin-toggle"?: ((plugin: PluginInfo, enabled: boolean) => any) | undefined;
|
|
34
|
+
"onPlugin-delete"?: ((plugin: PluginInfo) => any) | undefined;
|
|
35
|
+
"onPlugin-add"?: ((plugin: PluginInfo) => any) | undefined;
|
|
36
|
+
"onPlugin-create"?: ((type: "code" | "form", data: PluginCreationData) => any) | undefined;
|
|
37
|
+
"onTool-toggle"?: ((plugin: PluginInfo, toolId: string, enabled: boolean) => any) | undefined;
|
|
38
|
+
"onUpdate:activeCount"?: ((count: number) => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
title: string;
|
|
41
|
+
loading: boolean;
|
|
42
|
+
installedPlugins: PluginInfo[];
|
|
43
|
+
marketPlugins: PluginInfo[];
|
|
44
|
+
searchPlaceholder: string;
|
|
45
|
+
enableSearch: boolean;
|
|
46
|
+
installedSearchFn: (query: string, item: PluginInfo) => boolean;
|
|
47
|
+
marketSearchFn: (query: string, item: PluginInfo) => boolean;
|
|
48
|
+
marketCategoryOptions: import('./index.type').MarketCategoryOption[];
|
|
49
|
+
marketCategoryPlaceholder: string;
|
|
50
|
+
enableMarketCategoryFilter: boolean;
|
|
51
|
+
defaultActiveTab: "installed" | "market";
|
|
52
|
+
showInstalledTab: boolean;
|
|
53
|
+
showMarketTab: boolean;
|
|
54
|
+
popupConfig: PopupConfig;
|
|
55
|
+
installedTabTitle: string;
|
|
56
|
+
marketTabTitle: string;
|
|
57
|
+
showCustomAddButton: boolean;
|
|
58
|
+
customAddButtonText: string;
|
|
59
|
+
allowPluginToggle: boolean;
|
|
60
|
+
allowToolToggle: boolean;
|
|
61
|
+
allowPluginDelete: boolean;
|
|
62
|
+
allowPluginAdd: boolean;
|
|
63
|
+
marketLoading: boolean;
|
|
64
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
65
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
66
|
+
export default _default;
|
|
67
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
68
|
+
new (): {
|
|
69
|
+
$slots: S;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { default as PromptComp } from './prompt.vue';
|
|
3
|
+
import { default as PromptsComp } from './prompts.vue';
|
|
4
|
+
declare const installPrompt: <T>(app: App<T>) => void;
|
|
5
|
+
export declare const Prompt: typeof PromptComp & {
|
|
6
|
+
install: typeof installPrompt;
|
|
7
|
+
};
|
|
8
|
+
declare const installPrompts: <T>(app: App<T>) => void;
|
|
9
|
+
export declare const Prompts: typeof PromptsComp & {
|
|
10
|
+
install: typeof installPrompts;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CSSProperties, VNode } from 'vue';
|
|
2
|
+
export interface PromptProps {
|
|
3
|
+
/**
|
|
4
|
+
* 提示标签,显示提示的主要内容
|
|
5
|
+
*/
|
|
6
|
+
label: string;
|
|
7
|
+
/**
|
|
8
|
+
* 唯一标识用于区分每个提示项,用于 Prompts 列表。如果不传此参数,则使用 index 作为 key
|
|
9
|
+
*/
|
|
10
|
+
id?: string;
|
|
11
|
+
/**
|
|
12
|
+
* 提示描述,提供额外的信息
|
|
13
|
+
*/
|
|
14
|
+
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 提示图标,显示在提示项的左侧
|
|
17
|
+
*/
|
|
18
|
+
icon?: VNode;
|
|
19
|
+
/**
|
|
20
|
+
* 是否禁用。默认 false
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 提示徽章,显示在提示项的右上角
|
|
25
|
+
*/
|
|
26
|
+
badge?: string | VNode;
|
|
27
|
+
/**
|
|
28
|
+
* 提示项大小。默认 medium
|
|
29
|
+
*/
|
|
30
|
+
size?: 'small' | 'medium' | 'large';
|
|
31
|
+
}
|
|
32
|
+
export interface PromptsProps {
|
|
33
|
+
/**
|
|
34
|
+
* 包含多个提示项的列表
|
|
35
|
+
*/
|
|
36
|
+
items: PromptProps[];
|
|
37
|
+
/**
|
|
38
|
+
* 自定义样式,用于各个提示项的不同部分
|
|
39
|
+
*/
|
|
40
|
+
itemStyle?: string | CSSProperties;
|
|
41
|
+
/**
|
|
42
|
+
* 自定义类名,用于各个提示项的不同部分
|
|
43
|
+
*/
|
|
44
|
+
itemClass?: string | string[];
|
|
45
|
+
/**
|
|
46
|
+
* 提示列表是否垂直排列。默认 false
|
|
47
|
+
*/
|
|
48
|
+
vertical?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 提示列表是否折行。默认 false
|
|
51
|
+
*/
|
|
52
|
+
wrap?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface PromptsEvents {
|
|
55
|
+
(e: 'item-click', ev: MouseEvent, item: PromptProps): void;
|
|
56
|
+
}
|
|
57
|
+
export interface PromptsSlots {
|
|
58
|
+
footer?: () => unknown;
|
|
59
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PromptProps } from './index.type';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<PromptProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<PromptProps> & Readonly<{}>, {
|
|
3
|
+
size: "small" | "medium" | "large";
|
|
4
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PromptProps, PromptsProps, PromptsSlots } from './index.type';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: Readonly<PromptsSlots> & PromptsSlots;
|
|
5
|
+
refs: {};
|
|
6
|
+
rootEl: HTMLDivElement;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
9
|
+
declare const __VLS_component: import('vue').DefineComponent<PromptsProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
10
|
+
"item-click": (ev: MouseEvent, item: PromptProps) => any;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<PromptsProps> & Readonly<{
|
|
12
|
+
"onItem-click"?: ((ev: MouseEvent, item: PromptProps) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
14
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
2
|
+
editorRef: HTMLDivElement;
|
|
3
|
+
}, HTMLDivElement>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
footer?(_: {
|
|
5
|
+
editor: import('@tiptap/core').Editor | undefined;
|
|
6
|
+
focus: () => void;
|
|
7
|
+
blur: () => void;
|
|
8
|
+
insert: (content: string) => void;
|
|
9
|
+
append: (content: string) => void;
|
|
10
|
+
replace: (content: string) => void;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
hasContent: boolean;
|
|
14
|
+
}): any;
|
|
15
|
+
'footer-right'?(_: {
|
|
16
|
+
editor: import('@tiptap/core').Editor | undefined;
|
|
17
|
+
focus: () => void;
|
|
18
|
+
blur: () => void;
|
|
19
|
+
insert: (content: string) => void;
|
|
20
|
+
append: (content: string) => void;
|
|
21
|
+
replace: (content: string) => void;
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
loading: boolean;
|
|
24
|
+
hasContent: boolean;
|
|
25
|
+
}): any;
|
|
26
|
+
};
|
|
27
|
+
refs: {};
|
|
28
|
+
rootEl: any;
|
|
29
|
+
};
|
|
30
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
31
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
32
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
header?(_: {}): any;
|
|
5
|
+
prefix?(_: {}): any;
|
|
6
|
+
content?(_: {
|
|
7
|
+
editor: import('vue').Ref<import('@tiptap/vue-3').Editor | undefined, import('@tiptap/vue-3').Editor | undefined>;
|
|
8
|
+
}): any;
|
|
9
|
+
footer?(_: {
|
|
10
|
+
editor: import('@tiptap/core').Editor | undefined;
|
|
11
|
+
focus: () => void;
|
|
12
|
+
blur: () => void;
|
|
13
|
+
insert: (content: string) => void;
|
|
14
|
+
append: (content: string) => void;
|
|
15
|
+
replace: (content: string) => void;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
hasContent: boolean;
|
|
19
|
+
}): any;
|
|
20
|
+
'footer-right'?(_: {
|
|
21
|
+
editor: import('@tiptap/core').Editor | undefined;
|
|
22
|
+
focus: () => void;
|
|
23
|
+
blur: () => void;
|
|
24
|
+
insert: (content: string) => void;
|
|
25
|
+
append: (content: string) => void;
|
|
26
|
+
replace: (content: string) => void;
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
loading: boolean;
|
|
29
|
+
hasContent: boolean;
|
|
30
|
+
}): any;
|
|
31
|
+
};
|
|
32
|
+
refs: {};
|
|
33
|
+
rootEl: HTMLDivElement;
|
|
34
|
+
};
|
|
35
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
36
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
37
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
header?(_: {}): any;
|
|
5
|
+
prefix?(_: {}): any;
|
|
6
|
+
content?(_: {
|
|
7
|
+
editor: import('@tiptap/vue-3').Editor | undefined;
|
|
8
|
+
}): any;
|
|
9
|
+
'actions-inline'?(_: {
|
|
10
|
+
editor: import('@tiptap/core').Editor | undefined;
|
|
11
|
+
focus: () => void;
|
|
12
|
+
blur: () => void;
|
|
13
|
+
insert: (content: string) => void;
|
|
14
|
+
append: (content: string) => void;
|
|
15
|
+
replace: (content: string) => void;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
hasContent: boolean;
|
|
19
|
+
}): any;
|
|
20
|
+
};
|
|
21
|
+
refs: {};
|
|
22
|
+
rootEl: HTMLDivElement;
|
|
23
|
+
};
|
|
24
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
25
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
26
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SenderEmits, UseEditorReturn } from '../index.type';
|
|
2
|
+
import { SenderPropsWithDefaults } from '../index.vue';
|
|
3
|
+
/**
|
|
4
|
+
* 编辑器 Hook
|
|
5
|
+
*
|
|
6
|
+
* 职责:
|
|
7
|
+
* - 初始化编辑器
|
|
8
|
+
* - 管理编辑器状态
|
|
9
|
+
* - 处理编辑器事件
|
|
10
|
+
* - 提供编辑器实例
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
export declare function useEditor(props: SenderPropsWithDefaults, emit: SenderEmits): UseEditorReturn;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { Editor } from '@tiptap/vue-3';
|
|
3
|
+
import { SenderProps, UseModeSwitchReturn } from '../index.type';
|
|
4
|
+
export declare function useModeSwitch(props: SenderProps, editor: Ref<Editor | undefined>, editorRef: Ref<HTMLElement | null>): UseModeSwitchReturn;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SenderEmits } from '../index.type';
|
|
2
|
+
import { SenderPropsWithDefaults } from '../index.vue';
|
|
3
|
+
import { SenderContext } from '../types/context';
|
|
4
|
+
/**
|
|
5
|
+
* useSenderCore 返回类型
|
|
6
|
+
*/
|
|
7
|
+
export interface UseSenderCoreReturn {
|
|
8
|
+
/**
|
|
9
|
+
* Context 对象(用于 provide)
|
|
10
|
+
*/
|
|
11
|
+
context: SenderContext;
|
|
12
|
+
/**
|
|
13
|
+
* 需要暴露给父组件的方法(用于 defineExpose)
|
|
14
|
+
*/
|
|
15
|
+
expose: {
|
|
16
|
+
submit: () => void;
|
|
17
|
+
clear: () => void;
|
|
18
|
+
cancel: () => void;
|
|
19
|
+
focus: () => void;
|
|
20
|
+
blur: () => void;
|
|
21
|
+
setContent: (content: string) => void;
|
|
22
|
+
getContent: () => string;
|
|
23
|
+
editor: SenderContext['editor'];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sender 核心逻辑 Hook
|
|
28
|
+
*
|
|
29
|
+
* 一键获取完整的 context 和 expose 对象
|
|
30
|
+
*/
|
|
31
|
+
export declare function useSenderCore(props: SenderPropsWithDefaults, emit: SenderEmits): UseSenderCoreReturn;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 扩展名称常量
|
|
3
|
+
*
|
|
4
|
+
* 用于 TipTap 扩展定义中的 name 属性
|
|
5
|
+
* 这些是注册到编辑器的扩展名称
|
|
6
|
+
*/
|
|
7
|
+
export declare const EXTENSION_NAMES: {
|
|
8
|
+
/** Template 扩展(包含 TemplateBlock 和 TemplateSelect 子扩展) */
|
|
9
|
+
readonly TEMPLATE: "template";
|
|
10
|
+
/** Mention 扩展 */
|
|
11
|
+
readonly MENTION: "mention";
|
|
12
|
+
/** Suggestion 扩展 */
|
|
13
|
+
readonly SUGGESTION: "suggestion";
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* ProseMirror 节点类型名称常量
|
|
17
|
+
*
|
|
18
|
+
* 用于 node.type.name 检查和节点创建
|
|
19
|
+
* 这些是 ProseMirror Schema 中注册的节点类型名称
|
|
20
|
+
*/
|
|
21
|
+
export declare const NODE_TYPE_NAMES: {
|
|
22
|
+
/** TemplateBlock 节点类型(可编辑块) */
|
|
23
|
+
readonly TEMPLATE_BLOCK: "templateBlock";
|
|
24
|
+
/** TemplateSelect 节点类型(下拉选择) */
|
|
25
|
+
readonly TEMPLATE_SELECT: "templateSelect";
|
|
26
|
+
/** Mention 节点类型 */
|
|
27
|
+
readonly MENTION: "mention";
|
|
28
|
+
/** Paragraph 节点类型(ProseMirror 内置) */
|
|
29
|
+
readonly PARAGRAPH: "paragraph";
|
|
30
|
+
/** Text 节点类型(ProseMirror 内置) */
|
|
31
|
+
readonly TEXT: "text";
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* ProseMirror 插件 Key 名称常量
|
|
35
|
+
*/
|
|
36
|
+
export declare const PLUGIN_KEY_NAMES: {
|
|
37
|
+
/** Mention 插件 */
|
|
38
|
+
readonly MENTION: "mention";
|
|
39
|
+
/** Suggestion 插件 */
|
|
40
|
+
readonly SUGGESTION: "suggestion";
|
|
41
|
+
/** Template Select 下拉菜单插件 */
|
|
42
|
+
readonly TEMPLATE_SELECT_DROPDOWN: "templateSelectDropdown";
|
|
43
|
+
/** Template Select 零宽字符插件 */
|
|
44
|
+
readonly TEMPLATE_SELECT_ZERO_WIDTH: "templateSelectZeroWidth";
|
|
45
|
+
/** Template Select 键盘导航插件 */
|
|
46
|
+
readonly TEMPLATE_SELECT_KEYBOARD: "templateSelectKeyboard";
|
|
47
|
+
/** Template Block 零宽字符插件 */
|
|
48
|
+
readonly TEMPLATE_BLOCK_ZERO_WIDTH: "templateBlockZeroWidth";
|
|
49
|
+
/** Template Block 键盘导航插件 */
|
|
50
|
+
readonly TEMPLATE_BLOCK_KEYBOARD: "templateBlockKeyboard";
|
|
51
|
+
/** Template Block 粘贴处理插件 */
|
|
52
|
+
readonly TEMPLATE_BLOCK_PASTE: "templateBlockPaste";
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* 用户 API 类型常量
|
|
56
|
+
*
|
|
57
|
+
* 用于 TemplateItem 等用户 API 中的 type 字段
|
|
58
|
+
* 这些是暴露给用户的类型名称,与内部节点类型可能不同
|
|
59
|
+
*/
|
|
60
|
+
export declare const USER_API_TYPES: {
|
|
61
|
+
/** 文本类型 */
|
|
62
|
+
readonly TEXT: "text";
|
|
63
|
+
/** 模板块类型(对应内部的 TemplateBlock 节点) */
|
|
64
|
+
readonly BLOCK: "block";
|
|
65
|
+
/** 选择器类型(对应内部的 TemplateSelect 节点) */
|
|
66
|
+
readonly SELECT: "select";
|
|
67
|
+
/** Mention 类型 */
|
|
68
|
+
readonly MENTION: "mention";
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* 键盘按键常量
|
|
72
|
+
*/
|
|
73
|
+
export declare const KEYBOARD_KEYS: {
|
|
74
|
+
/** Enter 键 */
|
|
75
|
+
readonly ENTER: "Enter";
|
|
76
|
+
/** Escape 键 */
|
|
77
|
+
readonly ESCAPE: "Escape";
|
|
78
|
+
/** Tab 键 */
|
|
79
|
+
readonly TAB: "Tab";
|
|
80
|
+
/** Backspace 键 */
|
|
81
|
+
readonly BACKSPACE: "Backspace";
|
|
82
|
+
/** Delete 键 */
|
|
83
|
+
readonly DELETE: "Delete";
|
|
84
|
+
/** 上箭头键 */
|
|
85
|
+
readonly ARROW_UP: "ArrowUp";
|
|
86
|
+
/** 下箭头键 */
|
|
87
|
+
readonly ARROW_DOWN: "ArrowDown";
|
|
88
|
+
/** 左箭头键 */
|
|
89
|
+
readonly ARROW_LEFT: "ArrowLeft";
|
|
90
|
+
/** 右箭头键 */
|
|
91
|
+
readonly ARROW_RIGHT: "ArrowRight";
|
|
92
|
+
/** 空格键 */
|
|
93
|
+
readonly SPACE: " ";
|
|
94
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tiptap 扩展统一导出
|
|
3
|
+
*/
|
|
4
|
+
export { Mention, mention, MentionPluginKey } from './mention';
|
|
5
|
+
export { getMentions, getTextWithMentions, getMentionStructuredData } from './mention';
|
|
6
|
+
export type { MentionAttrs, MentionOptions, MentionItem, MentionStructuredItem } from './mention';
|
|
7
|
+
export { Suggestion, suggestion, SuggestionPluginKey } from './suggestion';
|
|
8
|
+
export { syncAutoComplete, processHighlights, highlightSuggestionText } from './suggestion';
|
|
9
|
+
export type { SenderSuggestionItem, SuggestionOptions, SuggestionState, SuggestionTextPart, HighlightFunction, } from './suggestion';
|
|
10
|
+
export { Template, template } from './template';
|
|
11
|
+
export { getTemplateStructuredData, getTextWithTemplates, TemplateSelectDropdownPluginKey } from './template';
|
|
12
|
+
export type { TemplateAttrs, TemplateOptions } from './template';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
import { MentionAttrs } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Mention 命令集合
|
|
5
|
+
*/
|
|
6
|
+
export declare const mentionCommands: {
|
|
7
|
+
/**
|
|
8
|
+
* 插入 mention 节点
|
|
9
|
+
*/
|
|
10
|
+
insertMention: (attrs: Partial<MentionAttrs>) => ({ commands }: {
|
|
11
|
+
commands: Editor["commands"];
|
|
12
|
+
}) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 删除 mention 节点
|
|
15
|
+
*/
|
|
16
|
+
deleteMention: (id: string) => ({ tr, state }: {
|
|
17
|
+
tr: Editor["state"]["tr"];
|
|
18
|
+
state: Editor["state"];
|
|
19
|
+
}) => boolean;
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MentionItem } from '../types';
|
|
2
|
+
interface Props {
|
|
3
|
+
items: MentionItem[];
|
|
4
|
+
command: (props: {
|
|
5
|
+
id?: string;
|
|
6
|
+
label: string;
|
|
7
|
+
value?: string;
|
|
8
|
+
}) => void;
|
|
9
|
+
}
|
|
10
|
+
declare function onKeyDown({ event }: {
|
|
11
|
+
event: KeyboardEvent;
|
|
12
|
+
}): boolean;
|
|
13
|
+
declare const _default: import('vue').DefineComponent<Props, {
|
|
14
|
+
onKeyDown: typeof onKeyDown;
|
|
15
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
16
|
+
listRef: HTMLDivElement;
|
|
17
|
+
}, HTMLDivElement>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface NodeAttrs {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
interface Props {
|
|
8
|
+
node: {
|
|
9
|
+
attrs: NodeAttrs;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
extension: {
|
|
13
|
+
options: {
|
|
14
|
+
char: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
export default _default;
|