@opentiny/tiny-robot 0.4.2-alpha.6 → 0.4.2-alpha.7
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/index.js +4 -4
- package/dist/anchor/index.js +44 -44
- package/dist/drag-overlay/index.js +1 -1
- package/dist/dropdown-menu/index.js +1 -1
- package/dist/index.d.ts +5018 -49
- package/dist/index.js +3 -3
- package/dist/index2.js +2 -2
- package/dist/index4.js +20 -20
- package/dist/index6.js +142 -143
- package/dist/index7.js +28 -28
- package/dist/index8.js +8 -8
- package/dist/sender/index.js +2 -2
- package/dist/sender-actions/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +1 -1
- package/dist/suggestion-popover/index.js +1 -1
- package/dist/theme-provider/index.js +41 -32
- package/dist/useSlotRefs.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +3 -22
- package/dist/action-group/ActionGroup.vue.d.ts +0 -26
- package/dist/action-group/ActionGroupItem.vue.d.ts +0 -18
- package/dist/action-group/index.d.ts +0 -12
- package/dist/action-group/index.type.d.ts +0 -17
- package/dist/anchor/components/AnchorItem.vue.d.ts +0 -24
- package/dist/anchor/components/AnchorList.vue.d.ts +0 -20
- package/dist/anchor/components/AnchorOverlay.vue.d.ts +0 -33
- package/dist/anchor/components/AnchorSearch.vue.d.ts +0 -7
- package/dist/anchor/composables/index.d.ts +0 -5
- package/dist/anchor/composables/useActiveSync.d.ts +0 -10
- package/dist/anchor/composables/useFloatingOffset.d.ts +0 -6
- package/dist/anchor/composables/useNavController.d.ts +0 -12
- package/dist/anchor/composables/useOverlayInteractions.d.ts +0 -6
- package/dist/anchor/composables/useTargetFeedback.d.ts +0 -5
- package/dist/anchor/defaults.d.ts +0 -16
- package/dist/anchor/index.d.ts +0 -7
- package/dist/anchor/index.type.d.ts +0 -60
- package/dist/anchor/index.vue.d.ts +0 -159
- package/dist/anchor/internal.type.d.ts +0 -103
- package/dist/anchor/utils/scroll.d.ts +0 -7
- package/dist/anchor/utils/target.d.ts +0 -6
- package/dist/attachments/components/FileCard.vue.d.ts +0 -18
- package/dist/attachments/components/ImagePreview.vue.d.ts +0 -17
- package/dist/attachments/components/index.d.ts +0 -2
- package/dist/attachments/composables/index.d.ts +0 -5
- package/dist/attachments/composables/useFileCard.d.ts +0 -15
- package/dist/attachments/composables/useFileType.d.ts +0 -20
- package/dist/attachments/composables/useImagePreview.d.ts +0 -18
- package/dist/attachments/composables/useListType.d.ts +0 -11
- package/dist/attachments/index.d.ts +0 -7
- package/dist/attachments/index.type.d.ts +0 -70
- package/dist/attachments/index.vue.d.ts +0 -27
- package/dist/attachments/utils.d.ts +0 -3
- package/dist/base-popper/components/Popper.vue.d.ts +0 -28
- package/dist/base-popper/index.d.ts +0 -2
- package/dist/base-popper/index.vue.d.ts +0 -41
- package/dist/bubble/Bubble.vue.d.ts +0 -39
- package/dist/bubble/BubbleBoxWrapper.vue.d.ts +0 -22
- package/dist/bubble/BubbleContentWrapper.vue.d.ts +0 -16
- package/dist/bubble/BubbleItem.vue.d.ts +0 -36
- package/dist/bubble/BubbleList.vue.d.ts +0 -41
- package/dist/bubble/BubbleProvider.vue.d.ts +0 -18
- package/dist/bubble/composables/index.d.ts +0 -10
- package/dist/bubble/composables/useBubbleBoxRenderer.d.ts +0 -18
- package/dist/bubble/composables/useBubbleContentRenderer.d.ts +0 -18
- package/dist/bubble/composables/useBubbleStateChange.d.ts +0 -2
- package/dist/bubble/composables/useBubbleStore.d.ts +0 -16
- package/dist/bubble/composables/useContentResolver.d.ts +0 -5
- package/dist/bubble/composables/useCopyCleanup.d.ts +0 -6
- package/dist/bubble/composables/useMessageContent.d.ts +0 -5
- package/dist/bubble/composables/useMessageGroup.d.ts +0 -4
- package/dist/bubble/composables/useOmitMessageFields.d.ts +0 -12
- package/dist/bubble/composables/useToolCall.d.ts +0 -25
- package/dist/bubble/constants.d.ts +0 -42
- package/dist/bubble/index.d.ts +0 -19
- package/dist/bubble/index.type.d.ts +0 -171
- package/dist/bubble/renderers/Box.vue.d.ts +0 -18
- package/dist/bubble/renderers/Image.vue.d.ts +0 -4
- package/dist/bubble/renderers/Loading.vue.d.ts +0 -4
- package/dist/bubble/renderers/Markdown.vue.d.ts +0 -4
- package/dist/bubble/renderers/Reasoning.vue.d.ts +0 -9
- package/dist/bubble/renderers/Text.vue.d.ts +0 -4
- package/dist/bubble/renderers/Tool.vue.d.ts +0 -14
- package/dist/bubble/renderers/ToolRole.vue.d.ts +0 -4
- package/dist/bubble/renderers/Tools.vue.d.ts +0 -4
- package/dist/bubble/renderers/allRenderers.d.ts +0 -93
- package/dist/bubble/renderers/defaultRenderers.d.ts +0 -27
- package/dist/bubble/utils.d.ts +0 -7
- package/dist/chat/components/ChatConversation.vue.d.ts +0 -267
- package/dist/chat/components/ChatLauncherButton.vue.d.ts +0 -12
- package/dist/chat/components/ChatMcpTrigger.vue.d.ts +0 -30
- package/dist/chat/components/ChatThemeToggleButton.vue.d.ts +0 -6
- package/dist/chat/components/ChatWelcome.vue.d.ts +0 -14
- package/dist/chat/components/icons/IconModelAliyunBailian.vue.d.ts +0 -7
- package/dist/chat/components/icons/IconModelDeepseek.vue.d.ts +0 -7
- package/dist/chat/components/icons/index.d.ts +0 -5
- package/dist/chat/composables/useChatConversation.d.ts +0 -37
- package/dist/chat/composables/useChatMcp.d.ts +0 -29
- package/dist/chat/composables/useChatModel.d.ts +0 -27
- package/dist/chat/index.d.ts +0 -9
- package/dist/chat/index.js +0 -13902
- package/dist/chat/index.type.d.ts +0 -92
- package/dist/chat/index.vue.d.ts +0 -51
- package/dist/chat/locale.d.ts +0 -12
- package/dist/chat/mcpServers.d.ts +0 -3
- package/dist/container/index.d.ts +0 -7
- package/dist/container/index.type.d.ts +0 -20
- package/dist/container/index.vue.d.ts +0 -32
- package/dist/conversations/index.d.ts +0 -7
- package/dist/conversations/index.vue.d.ts +0 -2
- package/dist/drag-overlay/constants.d.ts +0 -17
- package/dist/drag-overlay/directives/vDropzone.d.ts +0 -14
- package/dist/drag-overlay/index.d.ts +0 -7
- package/dist/drag-overlay/index.type.d.ts +0 -105
- package/dist/drag-overlay/index.vue.d.ts +0 -20
- package/dist/dropdown-menu/composables/usePopperHover.d.ts +0 -6
- package/dist/dropdown-menu/index.d.ts +0 -7
- package/dist/dropdown-menu/index.type.d.ts +0 -42
- package/dist/dropdown-menu/index.vue.d.ts +0 -217
- package/dist/feedback/components/SourceList.vue.d.ts +0 -11
- package/dist/feedback/components/index.d.ts +0 -1
- package/dist/feedback/index.d.ts +0 -7
- package/dist/feedback/index.type.d.ts +0 -25
- package/dist/feedback/index.vue.d.ts +0 -13
- package/dist/flow-layout-buttons/index.d.ts +0 -7
- package/dist/flow-layout-buttons/index.type.d.ts +0 -35
- package/dist/flow-layout-buttons/index.vue.d.ts +0 -22
- package/dist/history/components/Empty.vue.d.ts +0 -7
- package/dist/history/components/MenuList.vue.d.ts +0 -24
- package/dist/history/composables/useRenameEditor.d.ts +0 -22
- package/dist/history/constants.d.ts +0 -1
- package/dist/history/index.d.ts +0 -7
- package/dist/history/index.type.d.ts +0 -33
- package/dist/history/index.vue.d.ts +0 -18
- package/dist/icon-button/index.d.ts +0 -7
- package/dist/icon-button/index.type.d.ts +0 -7
- package/dist/icon-button/index.vue.d.ts +0 -6
- package/dist/mcp-add-form/components/CodeEditor.vue.d.ts +0 -9
- package/dist/mcp-add-form/components/FormEditor.vue.d.ts +0 -10
- package/dist/mcp-add-form/components/index.d.ts +0 -2
- package/dist/mcp-add-form/index.d.ts +0 -7
- package/dist/mcp-add-form/index.type.d.ts +0 -19
- package/dist/mcp-add-form/index.vue.d.ts +0 -13
- package/dist/mcp-server-picker/components/NoData.vue.d.ts +0 -7
- package/dist/mcp-server-picker/components/PluginCard.vue.d.ts +0 -40
- package/dist/mcp-server-picker/components/PluginModal.vue.d.ts +0 -15
- package/dist/mcp-server-picker/components/index.d.ts +0 -3
- package/dist/mcp-server-picker/index.d.ts +0 -7
- package/dist/mcp-server-picker/index.type.d.ts +0 -99
- package/dist/mcp-server-picker/index.vue.d.ts +0 -71
- package/dist/prompts/index.d.ts +0 -12
- package/dist/prompts/index.type.d.ts +0 -59
- package/dist/prompts/prompt.vue.d.ts +0 -5
- package/dist/prompts/prompts.vue.d.ts +0 -20
- package/dist/sender/components/editor-content/index.vue.d.ts +0 -4
- package/dist/sender/components/footer/index.vue.d.ts +0 -38
- package/dist/sender/components/layouts/MultiLineLayout.vue.d.ts +0 -43
- package/dist/sender/components/layouts/SingleLineLayout.vue.d.ts +0 -32
- package/dist/sender/composables/index.d.ts +0 -7
- package/dist/sender/composables/useAutoSize.d.ts +0 -5
- package/dist/sender/composables/useEditor.d.ts +0 -13
- package/dist/sender/composables/useKeyboardShortcuts.d.ts +0 -7
- package/dist/sender/composables/useModeSwitch.d.ts +0 -4
- package/dist/sender/composables/useSenderCore.d.ts +0 -31
- package/dist/sender/composables/useSlotScope.d.ts +0 -10
- package/dist/sender/context/index.d.ts +0 -6
- package/dist/sender/context/types.d.ts +0 -7
- package/dist/sender/extensions/constants.d.ts +0 -94
- package/dist/sender/extensions/index.d.ts +0 -12
- package/dist/sender/extensions/mention/commands.d.ts +0 -20
- package/dist/sender/extensions/mention/components/mention-list.vue.d.ts +0 -18
- package/dist/sender/extensions/mention/components/mention-view.vue.d.ts +0 -19
- package/dist/sender/extensions/mention/extension.d.ts +0 -6
- package/dist/sender/extensions/mention/index.d.ts +0 -22
- package/dist/sender/extensions/mention/plugin.d.ts +0 -16
- package/dist/sender/extensions/mention/types.d.ts +0 -126
- package/dist/sender/extensions/mention/utils.d.ts +0 -34
- package/dist/sender/extensions/suggestion/extension.d.ts +0 -8
- package/dist/sender/extensions/suggestion/index.d.ts +0 -20
- package/dist/sender/extensions/suggestion/plugin.d.ts +0 -21
- package/dist/sender/extensions/suggestion/suggestion-list.vue.d.ts +0 -46
- package/dist/sender/extensions/suggestion/types.d.ts +0 -254
- package/dist/sender/extensions/suggestion/utils/filter.d.ts +0 -29
- package/dist/sender/extensions/suggestion/utils/highlight.d.ts +0 -73
- package/dist/sender/extensions/template/block/extension.d.ts +0 -6
- package/dist/sender/extensions/template/block/plugins.d.ts +0 -13
- package/dist/sender/extensions/template/block/template-block-view.vue.d.ts +0 -14
- package/dist/sender/extensions/template/commands.d.ts +0 -31
- package/dist/sender/extensions/template/extension.d.ts +0 -6
- package/dist/sender/extensions/template/index.d.ts +0 -21
- package/dist/sender/extensions/template/select/dropdown-manager.d.ts +0 -23
- package/dist/sender/extensions/template/select/extension.d.ts +0 -5
- package/dist/sender/extensions/template/select/plugins.d.ts +0 -34
- package/dist/sender/extensions/template/select/template-select-view.vue.d.ts +0 -20
- package/dist/sender/extensions/template/types.d.ts +0 -100
- package/dist/sender/extensions/template/utils.d.ts +0 -20
- package/dist/sender/extensions/utils/id-generator.d.ts +0 -16
- package/dist/sender/extensions/utils/index.d.ts +0 -7
- package/dist/sender/extensions/utils/keyboard.d.ts +0 -49
- package/dist/sender/extensions/utils/position.d.ts +0 -25
- package/dist/sender/index.d.ts +0 -136
- package/dist/sender/index.type.d.ts +0 -302
- package/dist/sender/index.vue.d.ts +0 -90
- package/dist/sender/types/base.d.ts +0 -239
- package/dist/sender/types/components.d.ts +0 -68
- package/dist/sender/types/composables.d.ts +0 -122
- package/dist/sender/types/context.d.ts +0 -132
- package/dist/sender/types/slots.d.ts +0 -67
- package/dist/sender/utils/countGraphemes.d.ts +0 -1
- package/dist/sender-actions/action-button/index.vue.d.ts +0 -23
- package/dist/sender-actions/clear-button/index.vue.d.ts +0 -2
- package/dist/sender-actions/clear-button/useClearButtonState.d.ts +0 -6
- package/dist/sender-actions/default-actions/index.vue.d.ts +0 -17
- package/dist/sender-actions/index.d.ts +0 -21
- package/dist/sender-actions/index.type.d.ts +0 -7
- package/dist/sender-actions/submit-button/index.vue.d.ts +0 -2
- package/dist/sender-actions/types/common.d.ts +0 -40
- package/dist/sender-actions/types/index.d.ts +0 -5
- package/dist/sender-actions/types/tooltip.d.ts +0 -7
- package/dist/sender-actions/upload-button/index.type.d.ts +0 -57
- package/dist/sender-actions/upload-button/index.vue.d.ts +0 -16
- package/dist/sender-actions/utils/tooltip.d.ts +0 -8
- package/dist/sender-actions/voice-button/index.type.d.ts +0 -78
- package/dist/sender-actions/voice-button/index.vue.d.ts +0 -43
- package/dist/sender-actions/voice-button/speech.types.d.ts +0 -40
- package/dist/sender-actions/voice-button/useSpeechHandler.d.ts +0 -10
- package/dist/sender-actions/voice-button/webSpeechHandler.d.ts +0 -40
- package/dist/sender-actions/word-counter/index.vue.d.ts +0 -2
- package/dist/sender-compat/index.d.ts +0 -7
- package/dist/sender-compat/index.type.d.ts +0 -91
- package/dist/sender-compat/index.vue.d.ts +0 -532
- package/dist/shared/composables/createTeleport.d.ts +0 -2
- package/dist/shared/composables/index.d.ts +0 -5
- package/dist/shared/composables/useAutoScroll.d.ts +0 -25
- package/dist/shared/composables/useSlotRefs.d.ts +0 -12
- package/dist/shared/composables/useTeleportTarget.d.ts +0 -11
- package/dist/shared/composables/useTouchDevice.d.ts +0 -3
- package/dist/shared/utils.d.ts +0 -7
- package/dist/suggestion-pills/components/PillButton.vue.d.ts +0 -16
- package/dist/suggestion-pills/components/index.d.ts +0 -1
- package/dist/suggestion-pills/index.d.ts +0 -13
- package/dist/suggestion-pills/index.type.d.ts +0 -45
- package/dist/suggestion-pills/index.vue.d.ts +0 -44
- package/dist/suggestion-popover/components/Backdrop.vue.d.ts +0 -5
- package/dist/suggestion-popover/components/Header.vue.d.ts +0 -4
- package/dist/suggestion-popover/components/Loading.vue.d.ts +0 -17
- package/dist/suggestion-popover/components/NoData.vue.d.ts +0 -17
- package/dist/suggestion-popover/components/Tooltip.vue.d.ts +0 -19
- package/dist/suggestion-popover/index.d.ts +0 -7
- package/dist/suggestion-popover/index.type.d.ts +0 -80
- package/dist/suggestion-popover/index.vue.d.ts +0 -262
- package/dist/theme-provider/constants.d.ts +0 -6
- package/dist/theme-provider/index.d.ts +0 -9
- package/dist/theme-provider/index.type.d.ts +0 -18
- package/dist/theme-provider/index.vue.d.ts +0 -32
- package/dist/theme-provider/useTheme.d.ts +0 -11
- package/dist/useTheme.js +0 -22
- package/dist/welcome/index.d.ts +0 -7
- package/dist/welcome/index.type.d.ts +0 -10
- package/dist/welcome/index.vue.d.ts +0 -18
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Plugin } from '@tiptap/pm/state';
|
|
2
|
-
/**
|
|
3
|
-
* 零宽字符管理插件
|
|
4
|
-
*/
|
|
5
|
-
export declare function ensureZeroWidthChars(): Plugin<any>;
|
|
6
|
-
/**
|
|
7
|
-
* 键盘导航插件
|
|
8
|
-
*/
|
|
9
|
-
export declare function keyboardNavigationPlugin(): Plugin<any>;
|
|
10
|
-
/**
|
|
11
|
-
* 粘贴处理插件
|
|
12
|
-
*/
|
|
13
|
-
export declare function pasteHandlerPlugin(): Plugin<any>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface NodeAttrs {
|
|
2
|
-
id: string;
|
|
3
|
-
content: string;
|
|
4
|
-
[key: string]: unknown;
|
|
5
|
-
}
|
|
6
|
-
interface Props {
|
|
7
|
-
node: {
|
|
8
|
-
attrs: NodeAttrs;
|
|
9
|
-
textContent?: string;
|
|
10
|
-
[key: string]: unknown;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
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>;
|
|
14
|
-
export default _default;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/core';
|
|
2
|
-
import { TemplateItem, TemplateAttrs, TemplateSelectAttrs } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Template 命令集合
|
|
5
|
-
*/
|
|
6
|
-
export declare const templateCommands: {
|
|
7
|
-
/**
|
|
8
|
-
* 设置模板数据(批量)
|
|
9
|
-
*/
|
|
10
|
-
setTemplateData: (items: TemplateItem[]) => ({ commands }: {
|
|
11
|
-
commands: Editor["commands"];
|
|
12
|
-
}) => boolean;
|
|
13
|
-
/**
|
|
14
|
-
* 插入模板块
|
|
15
|
-
*/
|
|
16
|
-
insertTemplate: (attrs: Partial<TemplateAttrs>) => ({ commands }: {
|
|
17
|
-
commands: Editor["commands"];
|
|
18
|
-
}) => boolean;
|
|
19
|
-
/**
|
|
20
|
-
* 聚焦到第一个模板块
|
|
21
|
-
*/
|
|
22
|
-
focusFirstTemplate: () => ({ editor }: {
|
|
23
|
-
editor: Editor;
|
|
24
|
-
}) => boolean;
|
|
25
|
-
/**
|
|
26
|
-
* 插入选择器
|
|
27
|
-
*/
|
|
28
|
-
insertTemplateSelect: (attrs: Partial<TemplateSelectAttrs>) => ({ commands }: {
|
|
29
|
-
commands: Editor["commands"];
|
|
30
|
-
}) => boolean;
|
|
31
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
|
-
import { TemplateItem, TemplateOptions } from './types';
|
|
3
|
-
export { Template } from './extension';
|
|
4
|
-
export { TemplateSelect } from './select/extension';
|
|
5
|
-
export { templateCommands } from './commands';
|
|
6
|
-
export * from './types';
|
|
7
|
-
export { getTextWithTemplates, getTemplateStructuredData } from './utils';
|
|
8
|
-
export { TemplateSelectDropdownPluginKey } from './select/plugins';
|
|
9
|
-
/**
|
|
10
|
-
* 创建 Template 扩展的便捷函数
|
|
11
|
-
*
|
|
12
|
-
* @param items - 模板项列表
|
|
13
|
-
* @param options - 其他配置项
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```typescript
|
|
17
|
-
* const extensions = [template(templates)]
|
|
18
|
-
* const extensions = [template(templates, { HTMLAttributes: { class: 'custom' } })]
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare function template(items: TemplateItem[] | Ref<TemplateItem[]>, options?: Partial<Omit<TemplateOptions, 'items'>>): import('@tiptap/core').Extension<TemplateOptions, any>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 下拉菜单管理器(单例模式)
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* 打开下拉菜单
|
|
6
|
-
*/
|
|
7
|
-
export declare function openDropdown(selectId: string): void;
|
|
8
|
-
/**
|
|
9
|
-
* 关闭下拉菜单
|
|
10
|
-
*/
|
|
11
|
-
export declare function closeDropdown(selectId: string): void;
|
|
12
|
-
/**
|
|
13
|
-
* 获取当前打开的下拉菜单 ID
|
|
14
|
-
*/
|
|
15
|
-
export declare function getCurrentOpenDropdown(): string | null;
|
|
16
|
-
/**
|
|
17
|
-
* 关闭所有下拉菜单
|
|
18
|
-
*/
|
|
19
|
-
export declare function closeAllDropdowns(): void;
|
|
20
|
-
/**
|
|
21
|
-
* 设置点击外部关闭监听
|
|
22
|
-
*/
|
|
23
|
-
export declare function setupClickOutside(selectElement: HTMLElement, dropdownElement: HTMLElement, onClose: () => void): () => void;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Plugin, PluginKey } from '@tiptap/pm/state';
|
|
2
|
-
/**
|
|
3
|
-
* Template Select 下拉菜单状态
|
|
4
|
-
*/
|
|
5
|
-
interface TemplateSelectDropdownState {
|
|
6
|
-
/**
|
|
7
|
-
* 是否有下拉菜单打开
|
|
8
|
-
*/
|
|
9
|
-
isOpen: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* 当前打开的下拉菜单 ID
|
|
12
|
-
*/
|
|
13
|
-
selectId: string | null;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Template Select 下拉菜单状态插件 Key
|
|
17
|
-
*/
|
|
18
|
-
export declare const TemplateSelectDropdownPluginKey: PluginKey<TemplateSelectDropdownState>;
|
|
19
|
-
/**
|
|
20
|
-
* 下拉菜单状态管理插件
|
|
21
|
-
* 用于在 ProseMirror 插件状态中跟踪下拉菜单的打开/关闭状态
|
|
22
|
-
*/
|
|
23
|
-
export declare function selectDropdownStatePlugin(): Plugin<TemplateSelectDropdownState>;
|
|
24
|
-
/**
|
|
25
|
-
* 零宽字符管理插件
|
|
26
|
-
* 注意:零宽字符现在由 Vue 组件直接渲染,不需要插件动态插入
|
|
27
|
-
* 这个插件保留用于清理孤立的零宽字符
|
|
28
|
-
*/
|
|
29
|
-
export declare function selectZeroWidthPlugin(): Plugin<any>;
|
|
30
|
-
/**
|
|
31
|
-
* 键盘导航插件
|
|
32
|
-
*/
|
|
33
|
-
export declare function selectKeyboardPlugin(): Plugin<any>;
|
|
34
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/core';
|
|
2
|
-
import { SelectOption } from '../types';
|
|
3
|
-
interface NodeAttrs {
|
|
4
|
-
id: string;
|
|
5
|
-
placeholder: string;
|
|
6
|
-
options: SelectOption[];
|
|
7
|
-
value?: string;
|
|
8
|
-
}
|
|
9
|
-
interface Props {
|
|
10
|
-
node: {
|
|
11
|
-
attrs: NodeAttrs;
|
|
12
|
-
};
|
|
13
|
-
updateAttributes: (attrs: Record<string, unknown>) => void;
|
|
14
|
-
editor: Editor;
|
|
15
|
-
}
|
|
16
|
-
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, {
|
|
17
|
-
triggerRef: HTMLSpanElement;
|
|
18
|
-
dropdownRef: HTMLDivElement;
|
|
19
|
-
}, any>;
|
|
20
|
-
export default _default;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
|
-
import { TemplateItem, SelectOption } from '../../index.type';
|
|
3
|
-
export type { TemplateItem, SelectOption };
|
|
4
|
-
/**
|
|
5
|
-
* TemplateSelect 节点属性
|
|
6
|
-
*/
|
|
7
|
-
export interface TemplateSelectAttrs {
|
|
8
|
-
/**
|
|
9
|
-
* 唯一标识
|
|
10
|
-
*/
|
|
11
|
-
id: string;
|
|
12
|
-
/**
|
|
13
|
-
* 占位文字(未选择时显示)
|
|
14
|
-
*/
|
|
15
|
-
placeholder: string;
|
|
16
|
-
/**
|
|
17
|
-
* 选项列表
|
|
18
|
-
*/
|
|
19
|
-
options: SelectOption[];
|
|
20
|
-
/**
|
|
21
|
-
* 当前选中的值(可选)
|
|
22
|
-
*/
|
|
23
|
-
value?: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Template 节点属性
|
|
27
|
-
*/
|
|
28
|
-
export interface TemplateAttrs {
|
|
29
|
-
/**
|
|
30
|
-
* 模板块 ID
|
|
31
|
-
*/
|
|
32
|
-
id: string;
|
|
33
|
-
/**
|
|
34
|
-
* 模板块内容
|
|
35
|
-
*/
|
|
36
|
-
content: string;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Template 配置选项
|
|
40
|
-
*/
|
|
41
|
-
export interface TemplateOptions {
|
|
42
|
-
/**
|
|
43
|
-
* 模板数据列表(推荐使用 ref 实现响应式)
|
|
44
|
-
*
|
|
45
|
-
* 支持两种配置方式:
|
|
46
|
-
* 1. 传入 ref(推荐):自动双向绑定,解决时序问题
|
|
47
|
-
* 2. 传入数组:仅用于静态初始化
|
|
48
|
-
*
|
|
49
|
-
* @example 响应式配置(推荐)
|
|
50
|
-
* ```typescript
|
|
51
|
-
* const items = ref<TemplateItem[]>([
|
|
52
|
-
* { type: 'text', content: '帮我分析' },
|
|
53
|
-
* { type: 'template', content: '' }
|
|
54
|
-
* ])
|
|
55
|
-
* Template.configure({ items }) // 传入 ref,自动双向绑定
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
* @example 静态配置
|
|
59
|
-
* ```typescript
|
|
60
|
-
* Template.configure({
|
|
61
|
-
* items: [
|
|
62
|
-
* { type: 'text', content: '帮我分析' },
|
|
63
|
-
* { type: 'template', content: '' }
|
|
64
|
-
* ]
|
|
65
|
-
* })
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
items?: TemplateItem[] | Ref<TemplateItem[]>;
|
|
69
|
-
/**
|
|
70
|
-
* HTML 属性
|
|
71
|
-
*/
|
|
72
|
-
HTMLAttributes?: Record<string, unknown>;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* 扩展 Tiptap Commands 接口
|
|
76
|
-
*
|
|
77
|
-
* 使 TypeScript 能够识别自定义命令
|
|
78
|
-
*/
|
|
79
|
-
declare module '@tiptap/core' {
|
|
80
|
-
interface Commands<ReturnType> {
|
|
81
|
-
template: {
|
|
82
|
-
/**
|
|
83
|
-
* 设置模板数据(批量)
|
|
84
|
-
*/
|
|
85
|
-
setTemplateData: (items: TemplateItem[]) => ReturnType;
|
|
86
|
-
/**
|
|
87
|
-
* 插入模板块
|
|
88
|
-
*/
|
|
89
|
-
insertTemplate: (attrs: Partial<TemplateAttrs>) => ReturnType;
|
|
90
|
-
/**
|
|
91
|
-
* 聚焦到第一个模板块
|
|
92
|
-
*/
|
|
93
|
-
focusFirstTemplate: () => ReturnType;
|
|
94
|
-
/**
|
|
95
|
-
* 插入选择器
|
|
96
|
-
*/
|
|
97
|
-
insertTemplateSelect: (attrs: Partial<TemplateSelectAttrs>) => ReturnType;
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/core';
|
|
2
|
-
import { TemplateItem } from '../../index.type';
|
|
3
|
-
/**
|
|
4
|
-
* 零宽字符常量
|
|
5
|
-
* Unicode: U+200B (Zero Width Space)
|
|
6
|
-
* HTML Entity: ​
|
|
7
|
-
*/
|
|
8
|
-
export declare const ZERO_WIDTH_CHAR = "\u200B";
|
|
9
|
-
/**
|
|
10
|
-
* 获取包含 template 的完整文本
|
|
11
|
-
*
|
|
12
|
-
* 例如:请帮我分析 [模板内容1] 和 [模板内容2]
|
|
13
|
-
*/
|
|
14
|
-
export declare function getTextWithTemplates(editor: Editor): string;
|
|
15
|
-
/**
|
|
16
|
-
* 获取结构化数据(辅助函数)
|
|
17
|
-
*
|
|
18
|
-
* 返回包含文本和模板块的结构化数组
|
|
19
|
-
*/
|
|
20
|
-
export declare function getTemplateStructuredData(editor: Editor): TemplateItem[];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 生成唯一 ID
|
|
3
|
-
*
|
|
4
|
-
* 用于所有扩展生成唯一标识符
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* 生成唯一 ID
|
|
8
|
-
*
|
|
9
|
-
* @param prefix - ID 前缀
|
|
10
|
-
* @returns 唯一 ID 字符串
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* generateId('mention') // mention_1701234567890_abc123def
|
|
14
|
-
* generateId('template') // template_1701234567890_xyz789uvw
|
|
15
|
-
*/
|
|
16
|
-
export declare function generateId(prefix: string): string;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { KEYBOARD_KEYS } from '../constants';
|
|
2
|
-
/**
|
|
3
|
-
* 键盘按键类型
|
|
4
|
-
*/
|
|
5
|
-
export type KeyboardKey = keyof typeof KEYBOARD_KEYS;
|
|
6
|
-
/**
|
|
7
|
-
* 检查是否按下指定按键
|
|
8
|
-
*
|
|
9
|
-
* @param event - 键盘事件
|
|
10
|
-
* @param key - 按键名称
|
|
11
|
-
* @returns 是否按下指定按键
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* if (isKey(event, 'ENTER')) { ... }
|
|
15
|
-
* if (isKey(event, 'ARROW_UP')) { ... }
|
|
16
|
-
*/
|
|
17
|
-
export declare const isKey: (event: KeyboardEvent, key: KeyboardKey) => boolean;
|
|
18
|
-
/**
|
|
19
|
-
* 检查是否按下多个按键中的任意一个
|
|
20
|
-
*
|
|
21
|
-
* @param event - 键盘事件
|
|
22
|
-
* @param keys - 按键名称数组
|
|
23
|
-
* @returns 是否按下指定按键之一
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* if (isAnyKey(event, ['ARROW_UP', 'ARROW_DOWN'])) { ... }
|
|
27
|
-
* if (isAnyKey(event, ['ENTER', 'TAB'])) { ... }
|
|
28
|
-
*/
|
|
29
|
-
export declare const isAnyKey: (event: KeyboardEvent, keys: KeyboardKey[]) => boolean;
|
|
30
|
-
/**
|
|
31
|
-
* 检查是否按下方向键
|
|
32
|
-
*
|
|
33
|
-
* @param event - 键盘事件
|
|
34
|
-
* @returns 是否按下方向键
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* if (isArrowKey(event)) { ... }
|
|
38
|
-
*/
|
|
39
|
-
export declare const isArrowKey: (event: KeyboardEvent) => boolean;
|
|
40
|
-
/**
|
|
41
|
-
* 检查是否按下删除键(Backspace 或 Delete)
|
|
42
|
-
*
|
|
43
|
-
* @param event - 键盘事件
|
|
44
|
-
* @returns 是否按下删除键
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* if (isDeleteKey(event)) { ... }
|
|
48
|
-
*/
|
|
49
|
-
export declare const isDeleteKey: (event: KeyboardEvent) => boolean;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Selection } from '@tiptap/pm/state';
|
|
2
|
-
/**
|
|
3
|
-
* 查找触发字符的位置和查询文本
|
|
4
|
-
*
|
|
5
|
-
* 用于 mention 和 suggestion 扩展
|
|
6
|
-
*
|
|
7
|
-
* @param selection - 当前光标位置
|
|
8
|
-
* @param char - 触发字符
|
|
9
|
-
* @param allowSpaces - 是否允许空格
|
|
10
|
-
* @returns 触发范围和查询文本,未找到返回 null
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* const result = findTextRange(selection, '@', false)
|
|
14
|
-
* if (result) {
|
|
15
|
-
* console.log(result.range) // { from: 10, to: 20 }
|
|
16
|
-
* console.log(result.query) // 'user'
|
|
17
|
-
* }
|
|
18
|
-
*/
|
|
19
|
-
export declare function findTextRange(selection: Selection, char: string, allowSpaces?: boolean): {
|
|
20
|
-
range: {
|
|
21
|
-
from: number;
|
|
22
|
-
to: number;
|
|
23
|
-
};
|
|
24
|
-
query: string;
|
|
25
|
-
} | null;
|
package/dist/sender/index.d.ts
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { App } from 'vue';
|
|
2
|
-
import { mention, suggestion, template } from './extensions';
|
|
3
|
-
declare const Sender: {
|
|
4
|
-
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./index.type').SenderProps> & Readonly<{
|
|
5
|
-
onClear?: (() => any) | undefined;
|
|
6
|
-
onInput?: ((value: string) => any) | undefined;
|
|
7
|
-
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
8
|
-
onCancel?: (() => any) | undefined;
|
|
9
|
-
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
10
|
-
onSubmit?: ((textContent: string, structuredData?: import('./index.type').StructuredData | undefined) => any) | undefined;
|
|
11
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
12
|
-
}>, {
|
|
13
|
-
submit: () => void;
|
|
14
|
-
clear: () => void;
|
|
15
|
-
cancel: () => void;
|
|
16
|
-
focus: () => void;
|
|
17
|
-
blur: () => void;
|
|
18
|
-
setContent: (content: string) => void;
|
|
19
|
-
getContent: () => string;
|
|
20
|
-
editor: import('./index.type').SenderContext["editor"];
|
|
21
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
22
|
-
clear: () => any;
|
|
23
|
-
input: (value: string) => any;
|
|
24
|
-
blur: (event: FocusEvent) => any;
|
|
25
|
-
cancel: () => any;
|
|
26
|
-
focus: (event: FocusEvent) => any;
|
|
27
|
-
submit: (textContent: string, structuredData?: import('./index.type').StructuredData | undefined) => any;
|
|
28
|
-
"update:modelValue": (value: string) => any;
|
|
29
|
-
}, import('vue').PublicProps, {
|
|
30
|
-
size: "normal" | "small";
|
|
31
|
-
placeholder: string;
|
|
32
|
-
mode: import('./index.type').InputMode;
|
|
33
|
-
enterkeyhint: import('./index.type').EnterKeyHint;
|
|
34
|
-
autoSize: import('./index.type').AutoSize;
|
|
35
|
-
extensions: import('@tiptap/core').Extension[] | any[];
|
|
36
|
-
submitType: import('./index.type').SubmitTrigger;
|
|
37
|
-
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
38
|
-
P: {};
|
|
39
|
-
B: {};
|
|
40
|
-
D: {};
|
|
41
|
-
C: {};
|
|
42
|
-
M: {};
|
|
43
|
-
Defaults: {};
|
|
44
|
-
}, Readonly<import('./index.type').SenderProps> & Readonly<{
|
|
45
|
-
onClear?: (() => any) | undefined;
|
|
46
|
-
onInput?: ((value: string) => any) | undefined;
|
|
47
|
-
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
48
|
-
onCancel?: (() => any) | undefined;
|
|
49
|
-
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
50
|
-
onSubmit?: ((textContent: string, structuredData?: import('./index.type').StructuredData | undefined) => any) | undefined;
|
|
51
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
52
|
-
}>, {
|
|
53
|
-
submit: () => void;
|
|
54
|
-
clear: () => void;
|
|
55
|
-
cancel: () => void;
|
|
56
|
-
focus: () => void;
|
|
57
|
-
blur: () => void;
|
|
58
|
-
setContent: (content: string) => void;
|
|
59
|
-
getContent: () => string;
|
|
60
|
-
editor: import('./index.type').SenderContext["editor"];
|
|
61
|
-
}, {}, {}, {}, {
|
|
62
|
-
size: "normal" | "small";
|
|
63
|
-
placeholder: string;
|
|
64
|
-
mode: import('./index.type').InputMode;
|
|
65
|
-
enterkeyhint: import('./index.type').EnterKeyHint;
|
|
66
|
-
autoSize: import('./index.type').AutoSize;
|
|
67
|
-
extensions: import('@tiptap/core').Extension[] | any[];
|
|
68
|
-
submitType: import('./index.type').SubmitTrigger;
|
|
69
|
-
}>;
|
|
70
|
-
__isFragment?: never;
|
|
71
|
-
__isTeleport?: never;
|
|
72
|
-
__isSuspense?: never;
|
|
73
|
-
} & import('vue').ComponentOptionsBase<Readonly<import('./index.type').SenderProps> & Readonly<{
|
|
74
|
-
onClear?: (() => any) | undefined;
|
|
75
|
-
onInput?: ((value: string) => any) | undefined;
|
|
76
|
-
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
77
|
-
onCancel?: (() => any) | undefined;
|
|
78
|
-
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
79
|
-
onSubmit?: ((textContent: string, structuredData?: import('./index.type').StructuredData | undefined) => any) | undefined;
|
|
80
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
81
|
-
}>, {
|
|
82
|
-
submit: () => void;
|
|
83
|
-
clear: () => void;
|
|
84
|
-
cancel: () => void;
|
|
85
|
-
focus: () => void;
|
|
86
|
-
blur: () => void;
|
|
87
|
-
setContent: (content: string) => void;
|
|
88
|
-
getContent: () => string;
|
|
89
|
-
editor: import('./index.type').SenderContext["editor"];
|
|
90
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
91
|
-
clear: () => any;
|
|
92
|
-
input: (value: string) => any;
|
|
93
|
-
blur: (event: FocusEvent) => any;
|
|
94
|
-
cancel: () => any;
|
|
95
|
-
focus: (event: FocusEvent) => any;
|
|
96
|
-
submit: (textContent: string, structuredData?: import('./index.type').StructuredData | undefined) => any;
|
|
97
|
-
"update:modelValue": (value: string) => any;
|
|
98
|
-
}, string, {
|
|
99
|
-
size: "normal" | "small";
|
|
100
|
-
placeholder: string;
|
|
101
|
-
mode: import('./index.type').InputMode;
|
|
102
|
-
enterkeyhint: import('./index.type').EnterKeyHint;
|
|
103
|
-
autoSize: import('./index.type').AutoSize;
|
|
104
|
-
extensions: import('@tiptap/core').Extension[] | any[];
|
|
105
|
-
submitType: import('./index.type').SubmitTrigger;
|
|
106
|
-
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
107
|
-
$slots: {
|
|
108
|
-
header?(_: {}): any;
|
|
109
|
-
header?(_: {}): any;
|
|
110
|
-
prefix?(_: {}): any;
|
|
111
|
-
prefix?(_: {}): any;
|
|
112
|
-
content?(_: {
|
|
113
|
-
editor: import('@tiptap/vue-3').Editor | undefined;
|
|
114
|
-
}): any;
|
|
115
|
-
content?(_: {
|
|
116
|
-
editor: import('vue').Ref<import('@tiptap/vue-3').Editor | undefined, import('@tiptap/vue-3').Editor | undefined>;
|
|
117
|
-
}): any;
|
|
118
|
-
'actions-inline'?(_: {}): any;
|
|
119
|
-
footer?(_: {}): any;
|
|
120
|
-
'footer-right'?(_: {}): any;
|
|
121
|
-
};
|
|
122
|
-
}) & {
|
|
123
|
-
install: <T>(app: App<T>) => void;
|
|
124
|
-
Mention: import('@tiptap/core').Node<import('./extensions').MentionOptions, any>;
|
|
125
|
-
Suggestion: import('@tiptap/core').Extension<import('./index.type').SuggestionOptions, any>;
|
|
126
|
-
Template: import('@tiptap/core').Extension<import('./extensions').TemplateOptions, any>;
|
|
127
|
-
mention: typeof mention;
|
|
128
|
-
suggestion: typeof suggestion;
|
|
129
|
-
template: typeof template;
|
|
130
|
-
};
|
|
131
|
-
export default Sender;
|
|
132
|
-
export type { SenderProps, SenderEmits, SenderSlots, SenderContext, UseEditorReturn, UseModeSwitchReturn, UseSuggestionReturn, UseKeyboardShortcutsReturn, TemplateItem, MentionItem, DefaultActions, } from './index.type';
|
|
133
|
-
export { useSenderContext } from './context';
|
|
134
|
-
export type { TemplateAttrs, TemplateOptions } from './extensions/template';
|
|
135
|
-
export type { MentionAttrs, MentionOptions } from './extensions/mention';
|
|
136
|
-
export type { SenderSuggestionItem, SuggestionOptions, SuggestionState, SuggestionTextPart, HighlightFunction, } from './extensions/suggestion';
|