@opentiny/tiny-robot 0.2.0-alpha.2 → 0.2.0-alpha.4
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/_plugin-vue_export-helper.js +9 -0
- package/dist/action-group/index.js +142 -0
- package/dist/bubble/index.js +3211 -0
- package/dist/{node_modules/.pnpm/@opentiny_vue-icon@3.22.0/node_modules/@opentiny/vue-icon/lib/close.js → close.js} +9 -9
- package/dist/container/index.js +60 -0
- package/dist/conversations/index.js +14 -0
- package/dist/feedback/index.js +192 -0
- package/dist/history/index.js +228 -0
- package/dist/icon-button/index.js +31 -0
- package/dist/index.d.ts +2200 -26
- package/dist/index.js +35 -43
- package/dist/index2.js +376 -0
- package/dist/index3.js +3895 -0
- package/dist/index4.js +637 -0
- package/dist/index5.js +3237 -0
- package/dist/index6.js +4623 -0
- package/dist/prompts/index.js +83 -0
- package/dist/question/index.js +429 -0
- package/dist/sender/index.js +772 -0
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +497 -0
- package/dist/{packages/svgs/dist/tiny-robot-svgs.js → tiny-robot-svgs.js} +107 -107
- package/dist/welcome/index.js +38 -0
- package/package.json +7 -3
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -9
- 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/bubble/BubbleList.vue.d.ts +0 -5
- package/dist/bubble/index.d.ts +0 -12
- package/dist/bubble/index.type.d.ts +0 -51
- package/dist/container/index.d.ts +0 -7
- package/dist/container/index.type.d.ts +0 -16
- package/dist/container/index.vue.d.ts +0 -26
- package/dist/conversations/index.d.ts +0 -7
- package/dist/conversations/index.vue.d.ts +0 -2
- 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/history/components/index.d.ts +0 -2
- package/dist/history/components/item-tag.vue.d.ts +0 -5
- package/dist/history/components/search-empty.vue.d.ts +0 -7
- package/dist/history/composables/index.d.ts +0 -1
- package/dist/history/composables/useEditItemTitle.d.ts +0 -12
- package/dist/history/index.d.ts +0 -6
- package/dist/history/index.type.d.ts +0 -43
- package/dist/history/index.vue.d.ts +0 -2
- package/dist/icon-button/index.d.ts +0 -7
- package/dist/icon-button/index.type.d.ts +0 -6
- package/dist/icon-button/index.vue.d.ts +0 -6
- package/dist/node_modules/.pnpm/@opentiny_utils@1.0.0/node_modules/@opentiny/utils/dist/opentiny-utils.es.js +0 -832
- package/dist/node_modules/.pnpm/@opentiny_utils@3.22.0/node_modules/@opentiny/utils/dist/index.es.js +0 -2116
- package/dist/node_modules/.pnpm/@opentiny_vue-button@3.21.0/node_modules/@opentiny/vue-button/lib/index.js +0 -113
- package/dist/node_modules/.pnpm/@opentiny_vue-button@3.21.0/node_modules/@opentiny/vue-button/lib/pc.js +0 -93
- package/dist/node_modules/.pnpm/@opentiny_vue-common@3.21.0/node_modules/@opentiny/vue-common/lib/index.js +0 -727
- package/dist/node_modules/.pnpm/@opentiny_vue-common@3.22.0/node_modules/@opentiny/vue-common/lib/index.js +0 -710
- package/dist/node_modules/.pnpm/@opentiny_vue-dialog-box@3.21.0/node_modules/@opentiny/vue-dialog-box/lib/index.js +0 -198
- package/dist/node_modules/.pnpm/@opentiny_vue-dialog-box@3.21.0/node_modules/@opentiny/vue-dialog-box/lib/pc.js +0 -204
- package/dist/node_modules/.pnpm/@opentiny_vue-hooks@3.22.0/node_modules/@opentiny/vue-hooks/dist/src/useEventListener.js +0 -10
- package/dist/node_modules/.pnpm/@opentiny_vue-hooks@3.22.0/node_modules/@opentiny/vue-hooks/dist/src/useInstanceSlots.js +0 -14
- package/dist/node_modules/.pnpm/@opentiny_vue-hooks@3.22.0/node_modules/@opentiny/vue-hooks/dist/src/useRelation.js +0 -54
- package/dist/node_modules/.pnpm/@opentiny_vue-hooks@3.22.0/node_modules/@opentiny/vue-hooks/dist/src/vue-popper.js +0 -85
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/close.js +0 -29
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/eyeclose.js +0 -42
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/eyeopen.js +0 -43
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/finish.js +0 -34
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/fullscreen.js +0 -30
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/loading-shadow.js +0 -77
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/minscreen.js +0 -30
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-add-column-after.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-add-column-before.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-add-row-after.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-add-row-before.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-align-center.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-align-left.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-align-right.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-bold.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-code-block.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-code-view.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-color.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-delete-column.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-delete-row.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-delete-table.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-font-size.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-format-clear.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-h1.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-h2.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-h3.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-h4.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-h5.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-h6.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-heading.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-high-light.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-image.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-italic.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-line-height.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-link-unlink.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-link.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-list-ordered.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-list-unordered.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-merge-cells-vertical.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-merge-cells.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-node-delete.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-paragraph.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-quote-text.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-redo.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-split-cells-horizontal.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-split-cells-vertical.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-strike-through.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-subscript.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-superscript.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-table.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-task-list.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-underline.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/rich-text-undo.js +0 -24
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/sub-script.js +0 -29
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/warn.js +0 -26
- package/dist/node_modules/.pnpm/@opentiny_vue-input@3.21.0/node_modules/@opentiny/vue-input/lib/index.js +0 -196
- package/dist/node_modules/.pnpm/@opentiny_vue-input@3.21.0/node_modules/@opentiny/vue-input/lib/pc.js +0 -568
- package/dist/node_modules/.pnpm/@opentiny_vue-locale@3.21.0/node_modules/@opentiny/vue-locale/lib/index.js +0 -1783
- package/dist/node_modules/.pnpm/@opentiny_vue-locale@3.22.0/node_modules/@opentiny/vue-locale/lib/index.js +0 -1783
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/button/index.js +0 -13
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/button/vue.js +0 -34
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/chunk-G2ADBYYC.js +0 -12
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/browser.js +0 -36
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/clickoutside.js +0 -47
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/debounce.js +0 -7
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/dom.js +0 -45
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/popper.js +0 -320
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/popup-manager.js +0 -118
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/throttle.js +0 -23
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/useEventListener.js +0 -9
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/useInstanceSlots.js +0 -14
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/useRelation.js +0 -54
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/vue-popper.js +0 -84
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/vue-popup.js +0 -73
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/event.js +0 -13
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/function.js +0 -5
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/index.js +0 -11
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/object.js +0 -84
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/string.js +0 -28
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/type.js +0 -28
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/dialog-box/index.js +0 -136
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/dialog-box/vue.js +0 -148
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/input/index.js +0 -228
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/input/vue.js +0 -263
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/tall-storage/index.js +0 -63
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/tall-storage/vue-storage-box.js +0 -16
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/tall-storage/vue.js +0 -23
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/tooltip/index.js +0 -78
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/tooltip/vue.js +0 -90
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.22.0/node_modules/@opentiny/vue-renderless/tooltip/index.js +0 -77
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.22.0/node_modules/@opentiny/vue-renderless/tooltip/vue.js +0 -90
- package/dist/node_modules/.pnpm/@opentiny_vue-tooltip@3.21.0/node_modules/@opentiny/vue-tooltip/lib/index.js +0 -173
- package/dist/node_modules/.pnpm/@opentiny_vue-tooltip@3.21.0/node_modules/@opentiny/vue-tooltip/lib/pc.js +0 -248
- package/dist/node_modules/.pnpm/@opentiny_vue-tooltip@3.22.0/node_modules/@opentiny/vue-tooltip/lib/index.js +0 -176
- package/dist/node_modules/.pnpm/@opentiny_vue-tooltip@3.22.0/node_modules/@opentiny/vue-tooltip/lib/pc.js +0 -248
- package/dist/node_modules/.pnpm/@vueuse_core@13.1.0_vue@3.5.13/node_modules/@vueuse/core/index.js +0 -310
- package/dist/node_modules/.pnpm/@vueuse_shared@13.1.0_vue@3.5.13/node_modules/@vueuse/shared/index.js +0 -110
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/decode.js +0 -277
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/decode_codepoint.js +0 -46
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/decode-data-html.js +0 -7
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/decode-data-xml.js +0 -7
- package/dist/node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/index.js +0 -187
- package/dist/node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/lib/re.js +0 -19
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/common/html_blocks.js +0 -67
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/common/html_re.js +0 -5
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/common/utils.js +0 -164
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/helpers/index.js +0 -8
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/helpers/parse_link_destination.js +0 -44
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/helpers/parse_link_label.js +0 -21
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/helpers/parse_link_title.js +0 -37
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/index.js +0 -112
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/parser_block.js +0 -63
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/parser_core.js +0 -34
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/parser_inline.js +0 -96
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/presets/commonmark.js +0 -78
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/presets/default.js +0 -40
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/presets/zero.js +0 -59
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/renderer.js +0 -127
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/ruler.js +0 -95
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/blockquote.js +0 -59
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/code.js +0 -23
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/fence.js +0 -30
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/heading.js +0 -28
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/hr.js +0 -27
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/html_block.js +0 -37
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/lheading.js +0 -43
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/list.js +0 -110
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/paragraph.js +0 -25
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/reference.js +0 -95
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/state_block.js +0 -84
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/table.js +0 -99
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/block.js +0 -7
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/inline.js +0 -10
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/linkify.js +0 -57
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/normalize.js +0 -9
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/replacements.js +0 -31
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/smartquotes.js +0 -80
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/state_core.js +0 -8
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/text_join.js +0 -16
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/autolink.js +0 -46
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/backticks.js +0 -31
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/balance_pairs.js +0 -34
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/emphasis.js +0 -57
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/entity.js +0 -33
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/escape.js +0 -32
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/fragments_join.js +0 -10
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/html_inline.js +0 -32
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/image.js +0 -48
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/link.js +0 -40
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/linkify.js +0 -28
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/newline.js +0 -23
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/state_inline.js +0 -27
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/strikethrough.js +0 -54
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/text.js +0 -39
- package/dist/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/token.js +0 -31
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/index.js +0 -10
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/decode.js +0 -61
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/encode.js +0 -48
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/format.js +0 -7
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/parse.js +0 -74
- package/dist/node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.es6.js +0 -139
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Cc/regex.js +0 -4
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Cf/regex.js +0 -4
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/P/regex.js +0 -4
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/S/regex.js +0 -4
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Z/regex.js +0 -4
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/index.js +0 -14
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/properties/Any/regex.js +0 -4
- package/dist/packages/components/src/action-group/ActionGroup.vue.js +0 -7
- package/dist/packages/components/src/action-group/ActionGroup.vue2.js +0 -121
- package/dist/packages/components/src/action-group/ActionGroupItem.vue.js +0 -14
- package/dist/packages/components/src/action-group/ActionGroupItem.vue2.js +0 -4
- package/dist/packages/components/src/action-group/index.js +0 -17
- package/dist/packages/components/src/assets/icons/accessory.svg.js +0 -4
- package/dist/packages/components/src/assets/icons/loading-speech.svg.js +0 -4
- package/dist/packages/components/src/assets/icons/loading.svg.js +0 -4
- package/dist/packages/components/src/assets/icons/send.svg.js +0 -4
- package/dist/packages/components/src/assets/icons/voice.svg.js +0 -4
- package/dist/packages/components/src/bubble/Bubble.vue.js +0 -7
- package/dist/packages/components/src/bubble/Bubble.vue2.js +0 -76
- package/dist/packages/components/src/bubble/BubbleList.vue.js +0 -7
- package/dist/packages/components/src/bubble/BubbleList.vue2.js +0 -50
- package/dist/packages/components/src/bubble/index.js +0 -18
- package/dist/packages/components/src/container/index.js +0 -9
- package/dist/packages/components/src/container/index.vue.js +0 -7
- package/dist/packages/components/src/container/index.vue2.js +0 -55
- package/dist/packages/components/src/conversations/index.js +0 -9
- package/dist/packages/components/src/conversations/index.vue.js +0 -9
- package/dist/packages/components/src/feedback/components/SourceList.vue.js +0 -7
- package/dist/packages/components/src/feedback/components/SourceList.vue2.js +0 -52
- package/dist/packages/components/src/feedback/index.js +0 -9
- package/dist/packages/components/src/feedback/index.vue.js +0 -7
- package/dist/packages/components/src/feedback/index.vue2.js +0 -143
- package/dist/packages/components/src/history/components/item-tag.vue.js +0 -7
- package/dist/packages/components/src/history/components/item-tag.vue2.js +0 -21
- package/dist/packages/components/src/history/components/search-empty.vue.js +0 -7
- package/dist/packages/components/src/history/components/search-empty.vue2.js +0 -20
- package/dist/packages/components/src/history/composables/useEditItemTitle.js +0 -43
- package/dist/packages/components/src/history/index.js +0 -11
- package/dist/packages/components/src/history/index.vue.js +0 -7
- package/dist/packages/components/src/history/index.vue2.js +0 -130
- package/dist/packages/components/src/icon-button/index.js +0 -9
- package/dist/packages/components/src/icon-button/index.vue.js +0 -7
- package/dist/packages/components/src/icon-button/index.vue2.js +0 -22
- package/dist/packages/components/src/prompts/index.js +0 -18
- package/dist/packages/components/src/prompts/prompt.vue.js +0 -7
- package/dist/packages/components/src/prompts/prompt.vue2.js +0 -39
- package/dist/packages/components/src/prompts/prompts.vue.js +0 -7
- package/dist/packages/components/src/prompts/prompts.vue2.js +0 -36
- package/dist/packages/components/src/question/components/CommonQuestions.vue.js +0 -89
- package/dist/packages/components/src/question/components/CommonQuestions.vue2.js +0 -4
- package/dist/packages/components/src/question/components/HotQuestions.vue.js +0 -140
- package/dist/packages/components/src/question/components/HotQuestions.vue2.js +0 -4
- package/dist/packages/components/src/question/composables/useQuestions.js +0 -48
- package/dist/packages/components/src/question/index.js +0 -9
- package/dist/packages/components/src/question/index.vue.js +0 -113
- package/dist/packages/components/src/question/index.vue2.js +0 -4
- package/dist/packages/components/src/sender/components/ActionButtons.vue.js +0 -143
- package/dist/packages/components/src/sender/components/ActionButtons.vue2.js +0 -4
- package/dist/packages/components/src/sender/components/TemplateEditor.vue.js +0 -7
- package/dist/packages/components/src/sender/components/TemplateEditor.vue2.js +0 -175
- package/dist/packages/components/src/sender/composables/useInputHandler.js +0 -38
- package/dist/packages/components/src/sender/composables/useKeyboardHandler.js +0 -31
- package/dist/packages/components/src/sender/composables/useSpeechHandler.js +0 -67
- package/dist/packages/components/src/sender/index.js +0 -9
- package/dist/packages/components/src/sender/index.vue.js +0 -255
- package/dist/packages/components/src/sender/index.vue2.js +0 -4
- package/dist/packages/components/src/suggestion/components/CategoryNav.vue.js +0 -38
- package/dist/packages/components/src/suggestion/components/CategoryNav.vue2.js +0 -4
- package/dist/packages/components/src/suggestion/components/SuggestionCapsule.vue.js +0 -107
- package/dist/packages/components/src/suggestion/components/SuggestionCapsule.vue2.js +0 -4
- package/dist/packages/components/src/suggestion/components/SuggestionPanel.vue.js +0 -123
- package/dist/packages/components/src/suggestion/components/SuggestionPanel.vue2.js +0 -4
- package/dist/packages/components/src/suggestion/composables/useKeyboardNavigation.js +0 -45
- package/dist/packages/components/src/suggestion/composables/useTriggerDetection.js +0 -17
- package/dist/packages/components/src/suggestion/index.js +0 -9
- package/dist/packages/components/src/suggestion/index.vue.js +0 -179
- package/dist/packages/components/src/suggestion/index.vue2.js +0 -4
- package/dist/packages/components/src/suggestion/utils/dom.js +0 -18
- package/dist/packages/components/src/welcome/index.js +0 -9
- package/dist/packages/components/src/welcome/index.vue.js +0 -7
- package/dist/packages/components/src/welcome/index.vue2.js +0 -32
- package/dist/prompts/index.d.ts +0 -12
- package/dist/prompts/index.type.d.ts +0 -55
- package/dist/prompts/prompt.vue.d.ts +0 -3
- package/dist/prompts/prompts.vue.d.ts +0 -20
- package/dist/question/components/CommonQuestions.vue.d.ts +0 -32
- package/dist/question/components/HotQuestions.vue.d.ts +0 -89
- package/dist/question/composables/useQuestions.d.ts +0 -17
- package/dist/question/index.d.ts +0 -7
- package/dist/question/index.type.d.ts +0 -74
- package/dist/question/index.vue.d.ts +0 -46
- package/dist/sender/components/ActionButtons.vue.d.ts +0 -25
- package/dist/sender/components/TemplateEditor.vue.d.ts +0 -18
- package/dist/sender/composables/useInputHandler.d.ts +0 -17
- package/dist/sender/composables/useKeyboardHandler.d.ts +0 -18
- package/dist/sender/composables/useSpeechHandler.d.ts +0 -8
- package/dist/sender/index.d.ts +0 -7
- package/dist/sender/index.type.d.ts +0 -137
- package/dist/sender/index.vue.d.ts +0 -1012
- package/dist/suggestion/components/CategoryNav.vue.d.ts +0 -45
- package/dist/suggestion/components/SuggestionCapsule.vue.d.ts +0 -32
- package/dist/suggestion/components/SuggestionPanel.vue.d.ts +0 -84
- package/dist/suggestion/composables/useKeyboardNavigation.d.ts +0 -18
- package/dist/suggestion/composables/useSuggestionFilter.d.ts +0 -10
- package/dist/suggestion/composables/useTriggerDetection.d.ts +0 -11
- package/dist/suggestion/index.d.ts +0 -7
- package/dist/suggestion/index.type.d.ts +0 -94
- package/dist/suggestion/index.vue.d.ts +0 -343
- package/dist/suggestion/utils/dom.d.ts +0 -20
- 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
- package/src/action-group/ActionGroup.vue +0 -247
- package/src/action-group/ActionGroupItem.vue +0 -9
- package/src/action-group/index.ts +0 -25
- package/src/action-group/index.type.ts +0 -21
- package/src/assets/icons/accessory.svg +0 -12
- package/src/assets/icons/loading-speech.svg +0 -16
- package/src/assets/icons/loading.svg +0 -17
- package/src/assets/icons/send.svg +0 -21
- package/src/assets/icons/voice.svg +0 -22
- package/src/bubble/Bubble.vue +0 -153
- package/src/bubble/BubbleList.vue +0 -55
- package/src/bubble/index.ts +0 -23
- package/src/bubble/index.type.ts +0 -49
- package/src/container/index.ts +0 -12
- package/src/container/index.type.ts +0 -17
- package/src/container/index.vue +0 -109
- package/src/conversations/index.ts +0 -12
- package/src/conversations/index.vue +0 -3
- package/src/feedback/components/SourceList.vue +0 -112
- package/src/feedback/components/index.ts +0 -1
- package/src/feedback/index.ts +0 -12
- package/src/feedback/index.type.ts +0 -27
- package/src/feedback/index.vue +0 -166
- package/src/history/components/index.ts +0 -2
- package/src/history/components/item-tag.vue +0 -49
- package/src/history/components/search-empty.vue +0 -38
- package/src/history/composables/index.ts +0 -1
- package/src/history/composables/useEditItemTitle.ts +0 -75
- package/src/history/index.ts +0 -12
- package/src/history/index.type.ts +0 -50
- package/src/history/index.vue +0 -292
- package/src/icon-button/index.ts +0 -12
- package/src/icon-button/index.type.ts +0 -7
- package/src/icon-button/index.vue +0 -58
- package/src/index.ts +0 -76
- package/src/prompts/index.ts +0 -25
- package/src/prompts/index.type.ts +0 -59
- package/src/prompts/prompt.vue +0 -101
- package/src/prompts/prompts.vue +0 -50
- package/src/question/components/CommonQuestions.vue +0 -146
- package/src/question/components/HotQuestions.vue +0 -148
- package/src/question/composables/useQuestions.ts +0 -106
- package/src/question/index.less +0 -447
- package/src/question/index.ts +0 -12
- package/src/question/index.type.ts +0 -86
- package/src/question/index.vue +0 -140
- package/src/question/vars.less +0 -135
- package/src/sender/components/ActionButtons.vue +0 -168
- package/src/sender/components/TemplateEditor.vue +0 -465
- package/src/sender/composables/useInputHandler.ts +0 -74
- package/src/sender/composables/useKeyboardHandler.ts +0 -101
- package/src/sender/composables/useSpeechHandler.ts +0 -122
- package/src/sender/index.less +0 -352
- package/src/sender/index.ts +0 -12
- package/src/sender/index.type.ts +0 -162
- package/src/sender/index.vue +0 -338
- package/src/sender/vars.less +0 -84
- package/src/suggestion/components/CategoryNav.vue +0 -38
- package/src/suggestion/components/SuggestionCapsule.vue +0 -183
- package/src/suggestion/components/SuggestionPanel.vue +0 -147
- package/src/suggestion/composables/useKeyboardNavigation.ts +0 -101
- package/src/suggestion/composables/useSuggestionFilter.ts +0 -34
- package/src/suggestion/composables/useTriggerDetection.ts +0 -46
- package/src/suggestion/index.less +0 -497
- package/src/suggestion/index.ts +0 -12
- package/src/suggestion/index.type.ts +0 -101
- package/src/suggestion/index.vue +0 -338
- package/src/suggestion/utils/dom.ts +0 -66
- package/src/suggestion/vars.less +0 -141
- package/src/vite-env.d.ts +0 -1
- package/src/welcome/index.ts +0 -12
- package/src/welcome/index.type.ts +0 -12
- package/src/welcome/index.vue +0 -69
- package/tsconfig.json +0 -37
- package/tsconfig.node.json +0 -10
- package/vite.config.ts +0 -53
package/src/sender/index.vue
DELETED
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, ref, watch } from 'vue'
|
|
3
|
-
import TinyInput from '@opentiny/vue-input'
|
|
4
|
-
import type { SenderProps, SenderEmits, InputHandler, KeyboardHandler } from './index.type'
|
|
5
|
-
import { useInputHandler } from './composables/useInputHandler'
|
|
6
|
-
import { useKeyboardHandler } from './composables/useKeyboardHandler'
|
|
7
|
-
import { useSpeechHandler } from './composables/useSpeechHandler'
|
|
8
|
-
import ActionButtons from './components/ActionButtons.vue'
|
|
9
|
-
import TemplateEditor from './components/TemplateEditor.vue'
|
|
10
|
-
import './index.less'
|
|
11
|
-
|
|
12
|
-
const props = withDefaults(defineProps<SenderProps>(), {
|
|
13
|
-
autofocus: false,
|
|
14
|
-
autoSize: false,
|
|
15
|
-
allowSpeech: true,
|
|
16
|
-
allowFiles: false,
|
|
17
|
-
clearable: false,
|
|
18
|
-
disabled: false,
|
|
19
|
-
loading: false,
|
|
20
|
-
modelValue: '',
|
|
21
|
-
mode: 'single',
|
|
22
|
-
maxLength: Infinity,
|
|
23
|
-
placeholder: '请输入内容...',
|
|
24
|
-
showWordLimit: false,
|
|
25
|
-
submitType: 'enter',
|
|
26
|
-
theme: 'light',
|
|
27
|
-
template: '',
|
|
28
|
-
hasContent: undefined,
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
const emit = defineEmits<SenderEmits>()
|
|
32
|
-
|
|
33
|
-
// 输入引用
|
|
34
|
-
const inputRef = ref<HTMLElement | null>(null)
|
|
35
|
-
const templateEditorRef = ref<InstanceType<typeof TemplateEditor> | null>(null)
|
|
36
|
-
|
|
37
|
-
// 是否显示模板编辑器
|
|
38
|
-
const showTemplateEditor = computed(() => !!props.template)
|
|
39
|
-
|
|
40
|
-
// 输入控制
|
|
41
|
-
const { inputValue, isComposing, clearInput: originalClearInput }: InputHandler = useInputHandler(props, emit)
|
|
42
|
-
|
|
43
|
-
// 清空功能增强:同时处理模板和普通输入,并退出模板编辑模式
|
|
44
|
-
const clearInput = () => {
|
|
45
|
-
// 调用原始清空方法
|
|
46
|
-
originalClearInput()
|
|
47
|
-
|
|
48
|
-
// 如果当前是模板编辑模式,需要退出模板编辑模式
|
|
49
|
-
if (props.template) {
|
|
50
|
-
// 发出一个模板重置事件,通知父组件清除模板
|
|
51
|
-
emit('reset-template')
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// 输入建议
|
|
56
|
-
const showSuggestions = ref(false)
|
|
57
|
-
const filteredSuggestions = computed(() => {
|
|
58
|
-
if (!props.suggestions || !inputValue.value) return []
|
|
59
|
-
return props.suggestions.filter((item) => item.toLowerCase().includes(inputValue.value.toLowerCase()))
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
const selectSuggestion = (value: string) => {
|
|
63
|
-
inputValue.value = value
|
|
64
|
-
showSuggestions.value = false
|
|
65
|
-
emit('suggestion-select', value)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// 模板相关处理
|
|
69
|
-
const handleTemplateInput = (value: string) => {
|
|
70
|
-
inputValue.value = value
|
|
71
|
-
emit('update:modelValue', value)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// 激活第一个模板字段
|
|
75
|
-
const activateTemplateFirstField = () => {
|
|
76
|
-
if (templateEditorRef.value) {
|
|
77
|
-
templateEditorRef.value.activateFirstField()
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// 语音识别
|
|
82
|
-
const speechOptions = computed(() => ({
|
|
83
|
-
...(typeof props.speech === 'object' ? props.speech : {}),
|
|
84
|
-
onStart: () => emit('speech-start'),
|
|
85
|
-
onEnd: (transcript?: string) => emit('speech-end', transcript),
|
|
86
|
-
onInterim: (transcript: string) => emit('speech-interim', transcript),
|
|
87
|
-
onFinal: (text: string) => {
|
|
88
|
-
inputValue.value = text
|
|
89
|
-
emit('speech-end', text)
|
|
90
|
-
},
|
|
91
|
-
onError: (err: Error) => {
|
|
92
|
-
showError(err.message)
|
|
93
|
-
emit('speech-error', err)
|
|
94
|
-
},
|
|
95
|
-
}))
|
|
96
|
-
|
|
97
|
-
const { speechState, start: startSpeech, stop: stopSpeech } = useSpeechHandler(speechOptions.value)
|
|
98
|
-
|
|
99
|
-
// 语音控制
|
|
100
|
-
const toggleSpeech = () => {
|
|
101
|
-
if (speechState.isRecording) {
|
|
102
|
-
stopSpeech()
|
|
103
|
-
} else {
|
|
104
|
-
startSpeech()
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// 键盘处理
|
|
109
|
-
const { handleKeyPress, triggerSubmit }: KeyboardHandler = useKeyboardHandler(
|
|
110
|
-
props,
|
|
111
|
-
emit,
|
|
112
|
-
inputValue,
|
|
113
|
-
isComposing,
|
|
114
|
-
speechState,
|
|
115
|
-
showSuggestions,
|
|
116
|
-
toggleSpeech,
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
// 处理焦点事件
|
|
120
|
-
const handleFocus = (event: FocusEvent) => {
|
|
121
|
-
emit('focus', event)
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const handleBlur = (event: FocusEvent) => {
|
|
125
|
-
emit('blur', event)
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// 初始化自适应对象
|
|
129
|
-
const autoSize = computed(() => (props.mode === 'multiple' ? { minRows: 2, maxRows: 5 } : { maxRows: 1 }))
|
|
130
|
-
|
|
131
|
-
const justifyContent = computed(
|
|
132
|
-
(): {
|
|
133
|
-
display: string
|
|
134
|
-
justifyContent: 'space-between' | 'flex-end'
|
|
135
|
-
alignItems: string
|
|
136
|
-
} => {
|
|
137
|
-
const justifyContent = props.showWordLimit && props.maxLength !== Infinity ? 'space-between' : 'flex-end'
|
|
138
|
-
|
|
139
|
-
return {
|
|
140
|
-
display: 'flex',
|
|
141
|
-
justifyContent,
|
|
142
|
-
alignItems: 'center',
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
)
|
|
146
|
-
|
|
147
|
-
// 状态计算
|
|
148
|
-
const isDisabled = computed(() => props.disabled)
|
|
149
|
-
const isLoading = computed(() => props.loading)
|
|
150
|
-
const hasContent = computed(() => (props.hasContent !== undefined ? props.hasContent : !!inputValue.value))
|
|
151
|
-
|
|
152
|
-
// 样式类
|
|
153
|
-
const senderClasses = computed(() => ({
|
|
154
|
-
'is-disabled': isDisabled.value,
|
|
155
|
-
'is-loading': isLoading.value,
|
|
156
|
-
'has-error': !!errorMessage.value,
|
|
157
|
-
}))
|
|
158
|
-
|
|
159
|
-
// 错误处理
|
|
160
|
-
const errorMessage = ref<string>('')
|
|
161
|
-
const showError = (msg: string) => {
|
|
162
|
-
errorMessage.value = msg
|
|
163
|
-
setTimeout(() => (errorMessage.value = ''), 5000)
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// 输入法结束处理
|
|
167
|
-
const handleCompositionEnd = () => {
|
|
168
|
-
isComposing.value = false
|
|
169
|
-
setTimeout(() => (isComposing.value = false), 50)
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// 监听输入变化
|
|
173
|
-
watch(inputValue, () => {
|
|
174
|
-
showSuggestions.value = !!props.suggestions && !!inputValue.value
|
|
175
|
-
})
|
|
176
|
-
|
|
177
|
-
// 暴露方法
|
|
178
|
-
defineExpose({
|
|
179
|
-
focus: () => {
|
|
180
|
-
if (showTemplateEditor.value && templateEditorRef.value) {
|
|
181
|
-
activateTemplateFirstField()
|
|
182
|
-
} else if (inputRef.value) {
|
|
183
|
-
inputRef.value.focus()
|
|
184
|
-
} else {
|
|
185
|
-
const input = document.querySelector('.tiny-input__inner') as HTMLInputElement
|
|
186
|
-
input?.focus()
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
blur: () => {
|
|
190
|
-
if (inputRef.value) {
|
|
191
|
-
inputRef.value.blur()
|
|
192
|
-
} else {
|
|
193
|
-
const input = document.querySelector('.tiny-input__inner') as HTMLInputElement
|
|
194
|
-
input?.blur()
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
clear: clearInput,
|
|
198
|
-
submit: triggerSubmit,
|
|
199
|
-
startSpeech,
|
|
200
|
-
stopSpeech,
|
|
201
|
-
activateTemplateFirstField,
|
|
202
|
-
})
|
|
203
|
-
</script>
|
|
204
|
-
|
|
205
|
-
<template>
|
|
206
|
-
<div class="tiny-sender" :class="[senderClasses, `theme-${theme}`, `mode-${mode}`]" :data-theme="theme">
|
|
207
|
-
<!-- 输入区域容器 -->
|
|
208
|
-
<div class="tiny-sender__container">
|
|
209
|
-
<div class="tiny-sender__input-wrapper">
|
|
210
|
-
<!-- 头部插槽 -->
|
|
211
|
-
<Transition name="tiny-sender-slide-down">
|
|
212
|
-
<div v-if="$slots.header" class="tiny-sender__header-slot">
|
|
213
|
-
<slot name="header"></slot>
|
|
214
|
-
</div>
|
|
215
|
-
</Transition>
|
|
216
|
-
|
|
217
|
-
<!-- 输入行 - 横向布局 -->
|
|
218
|
-
<div class="tiny-sender__input-row" :class="{ 'has-prefix': $slots.prefix, 'has-header': $slots.header }">
|
|
219
|
-
<!-- 前缀插槽 -->
|
|
220
|
-
<div v-if="$slots.prefix" class="tiny-sender__prefix-slot">
|
|
221
|
-
<slot name="prefix" />
|
|
222
|
-
</div>
|
|
223
|
-
|
|
224
|
-
<!-- 内容区域 - 确保最小宽度,不被挤占 -->
|
|
225
|
-
<div class="tiny-sender__content-area">
|
|
226
|
-
<!-- 模板编辑器 -->
|
|
227
|
-
<template v-if="showTemplateEditor">
|
|
228
|
-
<TemplateEditor
|
|
229
|
-
ref="templateEditorRef"
|
|
230
|
-
:template="template"
|
|
231
|
-
:value="inputValue"
|
|
232
|
-
@update:value="handleTemplateInput"
|
|
233
|
-
@input="handleTemplateInput"
|
|
234
|
-
/>
|
|
235
|
-
</template>
|
|
236
|
-
<!-- 普通输入框 -->
|
|
237
|
-
<tiny-input
|
|
238
|
-
v-else
|
|
239
|
-
ref="inputRef"
|
|
240
|
-
:autosize="autoSize"
|
|
241
|
-
type="textarea"
|
|
242
|
-
:readonly="isLoading"
|
|
243
|
-
resize="none"
|
|
244
|
-
v-model="inputValue"
|
|
245
|
-
:disabled="isDisabled"
|
|
246
|
-
:placeholder="placeholder"
|
|
247
|
-
:maxlength="maxLength"
|
|
248
|
-
:autofocus="autofocus"
|
|
249
|
-
@keydown="handleKeyPress"
|
|
250
|
-
@compositionstart="isComposing = true"
|
|
251
|
-
@compositionend="handleCompositionEnd"
|
|
252
|
-
@focus="handleFocus"
|
|
253
|
-
@blur="handleBlur"
|
|
254
|
-
/>
|
|
255
|
-
</div>
|
|
256
|
-
|
|
257
|
-
<!-- 操作区域/后置插槽 -->
|
|
258
|
-
<div v-if="mode === 'single'" class="tiny-sender__actions-slot">
|
|
259
|
-
<div class="tiny-sender__buttons-container">
|
|
260
|
-
<slot name="actions" />
|
|
261
|
-
<action-buttons
|
|
262
|
-
class="inline-buttons"
|
|
263
|
-
:allow-speech="allowSpeech"
|
|
264
|
-
:allow-files="allowFiles"
|
|
265
|
-
:loading="loading"
|
|
266
|
-
:disabled="isDisabled"
|
|
267
|
-
:show-clear="clearable"
|
|
268
|
-
:has-content="hasContent"
|
|
269
|
-
:speech-status="speechState"
|
|
270
|
-
:submit-type="submitType"
|
|
271
|
-
@clear="clearInput"
|
|
272
|
-
@toggle-speech="toggleSpeech"
|
|
273
|
-
@submit="triggerSubmit"
|
|
274
|
-
@cancel="$emit('cancel')"
|
|
275
|
-
/>
|
|
276
|
-
</div>
|
|
277
|
-
</div>
|
|
278
|
-
</div>
|
|
279
|
-
|
|
280
|
-
<!-- 底部插槽 - 底部工具栏作为默认内容 -->
|
|
281
|
-
<Transition name="tiny-sender-slide-up">
|
|
282
|
-
<div v-if="$slots.footer" class="tiny-sender__footer-slot">
|
|
283
|
-
<slot name="footer"></slot>
|
|
284
|
-
</div>
|
|
285
|
-
<div
|
|
286
|
-
v-else-if="mode !== 'single' || (showWordLimit && maxLength !== Infinity)"
|
|
287
|
-
:style="justifyContent"
|
|
288
|
-
class="tiny-sender__footer-slot tiny-sender__bottom-row"
|
|
289
|
-
>
|
|
290
|
-
<!-- 字数限制 -->
|
|
291
|
-
<div v-if="showWordLimit && maxLength !== Infinity" class="tiny-sender__word-limit">
|
|
292
|
-
{{ inputValue.length }}/{{ maxLength }}
|
|
293
|
-
</div>
|
|
294
|
-
|
|
295
|
-
<!-- 多行模式下的操作按钮 -->
|
|
296
|
-
<div v-if="mode === 'multiple'" class="tiny-sender__toolbar">
|
|
297
|
-
<div class="tiny-sender__buttons-container">
|
|
298
|
-
<action-buttons
|
|
299
|
-
:allow-speech="allowSpeech"
|
|
300
|
-
:allow-files="allowFiles"
|
|
301
|
-
:loading="loading"
|
|
302
|
-
:disabled="isDisabled"
|
|
303
|
-
:show-clear="clearable"
|
|
304
|
-
:has-content="hasContent"
|
|
305
|
-
:speech-status="speechState"
|
|
306
|
-
:submit-type="submitType"
|
|
307
|
-
@clear="clearInput"
|
|
308
|
-
@toggle-speech="toggleSpeech"
|
|
309
|
-
@submit="triggerSubmit"
|
|
310
|
-
@cancel="$emit('cancel')"
|
|
311
|
-
/>
|
|
312
|
-
</div>
|
|
313
|
-
</div>
|
|
314
|
-
</div>
|
|
315
|
-
</Transition>
|
|
316
|
-
</div>
|
|
317
|
-
</div>
|
|
318
|
-
|
|
319
|
-
<!-- 输入建议 -->
|
|
320
|
-
<Transition name="tiny-sender-slide-up">
|
|
321
|
-
<div v-if="showSuggestions && filteredSuggestions.length" class="tiny-sender__suggestions">
|
|
322
|
-
<div
|
|
323
|
-
v-for="(item, index) in filteredSuggestions"
|
|
324
|
-
:key="index"
|
|
325
|
-
class="suggestion-item"
|
|
326
|
-
@click="selectSuggestion(item)"
|
|
327
|
-
>
|
|
328
|
-
{{ item }}
|
|
329
|
-
</div>
|
|
330
|
-
</div>
|
|
331
|
-
</Transition>
|
|
332
|
-
|
|
333
|
-
<!-- 错误提示 -->
|
|
334
|
-
<div v-if="errorMessage" class="tiny-sender__error">
|
|
335
|
-
{{ errorMessage }}
|
|
336
|
-
</div>
|
|
337
|
-
</div>
|
|
338
|
-
</template>
|
package/src/sender/vars.less
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// 主题变量
|
|
2
|
-
:root {
|
|
3
|
-
// 基础颜色
|
|
4
|
-
--tr-sender-border-color: #dcdfe6;
|
|
5
|
-
--tr-sender-bg-color: #fff;
|
|
6
|
-
--tr-sender-text-color: #303133;
|
|
7
|
-
--tr-sender-text-color-secondary: #909399;
|
|
8
|
-
--tr-sender-error-color: #f56c6c;
|
|
9
|
-
--tr-sender-input-disabled-bg-color: #f0f0f0;
|
|
10
|
-
--tr-sender-word-limit-color: #808080;
|
|
11
|
-
--tr-sender-button-icon-color: #5e7ce0;
|
|
12
|
-
|
|
13
|
-
// 尺寸
|
|
14
|
-
--tr-sender-border-radius: 28px;
|
|
15
|
-
--tr-sender-padding-top: 15px;
|
|
16
|
-
--tr-sender-padding-right: 10px;
|
|
17
|
-
--tr-sender-padding-bottom: 10px;
|
|
18
|
-
--tr-sender-padding-left: 24px;
|
|
19
|
-
--tr-sender-gap: 8px;
|
|
20
|
-
--tr-sender-input-height: 26px;
|
|
21
|
-
--tr-sender-input-min-height: 60px;
|
|
22
|
-
--tr-sender-icon-size: 22px;
|
|
23
|
-
--tr-sender-icon-size-small: 18px;
|
|
24
|
-
|
|
25
|
-
// 字体
|
|
26
|
-
--tr-sender-font-size: 14px;
|
|
27
|
-
--tr-sender-font-size-small: 12px;
|
|
28
|
-
|
|
29
|
-
// 动画
|
|
30
|
-
--tr-sender-transition-duration: 0.2s;
|
|
31
|
-
|
|
32
|
-
// 阴影
|
|
33
|
-
--tr-sender-box-shadow: 0 4px 16px 0px rgba(0, 0, 0, 0.08);
|
|
34
|
-
--tr-sender-focus-shadow: 0 0 0 2px rgba(94, 124, 224, 0.3);
|
|
35
|
-
|
|
36
|
-
// 插槽变量
|
|
37
|
-
// 头部插槽 (Header)
|
|
38
|
-
--tr-sender-header-max-height: 120px;
|
|
39
|
-
--tr-sender-header-min-height: 40px;
|
|
40
|
-
--tr-sender-header-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
41
|
-
--tr-sender-header-padding: 10px;
|
|
42
|
-
|
|
43
|
-
// 前缀插槽 (Prefix)
|
|
44
|
-
--tr-sender-prefix-width: 60px;
|
|
45
|
-
--tr-sender-prefix-min-width: 44px;
|
|
46
|
-
--tr-sender-prefix-hover-bg: #f5f5f5;
|
|
47
|
-
--tr-sender-prefix-padding-left: 16px;
|
|
48
|
-
|
|
49
|
-
// 内容区域 (Content)
|
|
50
|
-
--tr-sender-content-min-width: 180px;
|
|
51
|
-
--tr-sender-content-padding: 15px 10px 12px 24px;
|
|
52
|
-
--tr-sender-content-padding-with-prefix: 15px 10px 10px 8px;
|
|
53
|
-
--tr-sender-content-flex-grow: 1;
|
|
54
|
-
|
|
55
|
-
// 操作区域 (Actions)
|
|
56
|
-
--tr-sender-actions-width: auto;
|
|
57
|
-
--tr-sender-actions-min-width: 32px;
|
|
58
|
-
--tr-sender-actions-gap: 8px;
|
|
59
|
-
--tr-sender-actions-icon-size: 20px;
|
|
60
|
-
--tr-sender-actions-padding-right: 10px;
|
|
61
|
-
|
|
62
|
-
// 底部插槽 (Footer)
|
|
63
|
-
--tr-sender-footer-max-height: 200px;
|
|
64
|
-
--tr-sender-footer-min-height: 0;
|
|
65
|
-
--tr-sender-footer-bg: #fff;
|
|
66
|
-
--tr-sender-footer-hover: #f9f9f9;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/* 暗色主题 */
|
|
70
|
-
.theme-dark,
|
|
71
|
-
[data-theme='dark'] {
|
|
72
|
-
--tr-sender-border-color: #4c4d4f;
|
|
73
|
-
--tr-sender-bg-color: #1c1c1c;
|
|
74
|
-
--tr-sender-text-color: #ffffff;
|
|
75
|
-
--tr-sender-text-color-secondary: #a0a0a0;
|
|
76
|
-
--tr-sender-input-disabled-bg-color: #2a2a2a;
|
|
77
|
-
--tr-sender-box-shadow: 0 4px 16px 0px rgba(0, 0, 0, 0.2);
|
|
78
|
-
--tr-sender-button-icon-color: #a0a0a0;
|
|
79
|
-
|
|
80
|
-
// 暗色主题插槽变量
|
|
81
|
-
--tr-sender-prefix-hover-bg: #333;
|
|
82
|
-
--tr-sender-footer-bg: #2c2c2c;
|
|
83
|
-
--tr-sender-footer-hover: #3a3a3a;
|
|
84
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { PropType } from 'vue'
|
|
3
|
-
import { Category } from '../index.type'
|
|
4
|
-
|
|
5
|
-
defineProps({
|
|
6
|
-
categories: {
|
|
7
|
-
type: Array as PropType<Category[]>,
|
|
8
|
-
required: true,
|
|
9
|
-
},
|
|
10
|
-
activeCategory: {
|
|
11
|
-
type: String,
|
|
12
|
-
default: '',
|
|
13
|
-
},
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
const emit = defineEmits(['category-select'])
|
|
17
|
-
|
|
18
|
-
const handleCategorySelect = (categoryId: string) => {
|
|
19
|
-
emit('category-select', categoryId)
|
|
20
|
-
}
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<template>
|
|
24
|
-
<div class="tr-suggestion-categories">
|
|
25
|
-
<div
|
|
26
|
-
v-for="category in categories"
|
|
27
|
-
:key="category.id"
|
|
28
|
-
class="tr-suggestion-categories-item"
|
|
29
|
-
:class="{ active: activeCategory === category.id }"
|
|
30
|
-
@click="handleCategorySelect(category.id)"
|
|
31
|
-
>
|
|
32
|
-
<slot name="category-label" :category="category">
|
|
33
|
-
<div class="category-icon" v-if="category.icon">{{ category.icon }}</div>
|
|
34
|
-
<span>{{ category.label }}</span>
|
|
35
|
-
</slot>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</template>
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref, watch, onMounted, onBeforeUnmount, nextTick, PropType, computed, watchEffect } from 'vue'
|
|
3
|
-
import type { SuggestionItem } from '../index.type'
|
|
4
|
-
import { IconEdit } from '@opentiny/tiny-robot-svgs'
|
|
5
|
-
import { getCachedTextWidth } from '../utils/dom'
|
|
6
|
-
|
|
7
|
-
const props = defineProps({
|
|
8
|
-
suggestions: {
|
|
9
|
-
type: Array as PropType<SuggestionItem[]>,
|
|
10
|
-
required: true,
|
|
11
|
-
},
|
|
12
|
-
isExpanded: {
|
|
13
|
-
type: Boolean,
|
|
14
|
-
default: false,
|
|
15
|
-
},
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
const emit = defineEmits(['suggestion-click', 'show-expand-button'])
|
|
19
|
-
|
|
20
|
-
// eslint-disable-next-line
|
|
21
|
-
const capsuleRef = ref<any>(null)
|
|
22
|
-
const showExpandButton = ref(false)
|
|
23
|
-
const isExpandedRef = ref(false)
|
|
24
|
-
const visibleSuggestions = ref<SuggestionItem[]>([])
|
|
25
|
-
const hiddenSuggestions = ref<SuggestionItem[]>([])
|
|
26
|
-
const maxItemsPerRow = ref(0)
|
|
27
|
-
const resizeObserver = ref<ResizeObserver | null>(null)
|
|
28
|
-
|
|
29
|
-
// 计算每行的胶囊排列,实现从下到上、从左往右的排序
|
|
30
|
-
const arrangedHiddenSuggestions = computed(() => {
|
|
31
|
-
if (maxItemsPerRow.value <= 0 || hiddenSuggestions.value.length === 0) return []
|
|
32
|
-
|
|
33
|
-
// 创建行数组
|
|
34
|
-
const rows = []
|
|
35
|
-
const totalSuggestions = [...hiddenSuggestions.value]
|
|
36
|
-
|
|
37
|
-
// 按照每行最大容量分组
|
|
38
|
-
while (totalSuggestions.length > 0) {
|
|
39
|
-
rows.push(totalSuggestions.splice(0, maxItemsPerRow.value))
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// 返回行的数组,以便从下到上显示
|
|
43
|
-
return rows.reverse()
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
// 检查是否需要显示展开/收起按钮并计算能够容纳的最大胶囊数
|
|
47
|
-
const calculateLayout = async () => {
|
|
48
|
-
await nextTick()
|
|
49
|
-
if (!capsuleRef.value || props.suggestions.length === 0) {
|
|
50
|
-
showExpandButton.value = false
|
|
51
|
-
emit('show-expand-button', false)
|
|
52
|
-
return
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const container = capsuleRef.value
|
|
56
|
-
const containerWidth = container.clientWidth
|
|
57
|
-
|
|
58
|
-
// 重置胶囊分组
|
|
59
|
-
visibleSuggestions.value = []
|
|
60
|
-
hiddenSuggestions.value = []
|
|
61
|
-
|
|
62
|
-
// 计算一行可以容纳多少个胶囊
|
|
63
|
-
let accumulatedWidth = 0
|
|
64
|
-
const margin = 8 // 胶囊之间的间距
|
|
65
|
-
|
|
66
|
-
// 先测量一个平均宽度来估算每行可容纳的胶囊数
|
|
67
|
-
let totalWidth = 0
|
|
68
|
-
const sampleSize = Math.min(3, props.suggestions.length)
|
|
69
|
-
for (let i = 0; i < sampleSize; i++) {
|
|
70
|
-
// 使用缓存测量宽度
|
|
71
|
-
const itemWidth = getCachedTextWidth(props.suggestions[i].text, 'tr-common-suggestions_item') + margin
|
|
72
|
-
totalWidth += itemWidth
|
|
73
|
-
}
|
|
74
|
-
const avgItemWidth = totalWidth / sampleSize
|
|
75
|
-
maxItemsPerRow.value = Math.max(1, Math.floor(containerWidth / avgItemWidth))
|
|
76
|
-
|
|
77
|
-
// 计算每个胶囊的宽度并确定一行能容纳多少个
|
|
78
|
-
for (let i = 0; i < props.suggestions.length; i++) {
|
|
79
|
-
const suggestion = props.suggestions[i]
|
|
80
|
-
// 使用缓存测量宽度
|
|
81
|
-
const itemWidth = getCachedTextWidth(suggestion.text, 'tr-common-suggestions_item') + margin
|
|
82
|
-
|
|
83
|
-
// 检查是否还能容纳下一个胶囊
|
|
84
|
-
if (accumulatedWidth + itemWidth <= containerWidth) {
|
|
85
|
-
accumulatedWidth += itemWidth
|
|
86
|
-
visibleSuggestions.value.push(suggestion)
|
|
87
|
-
} else {
|
|
88
|
-
hiddenSuggestions.value.push(suggestion)
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// 如果有隐藏的胶囊,显示展开按钮
|
|
93
|
-
showExpandButton.value = hiddenSuggestions.value.length > 0
|
|
94
|
-
|
|
95
|
-
// 通知父组件是否需要显示展开按钮
|
|
96
|
-
emit('show-expand-button', showExpandButton.value)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// 处理指令点击
|
|
100
|
-
const handleSuggestionClick = (suggestion: SuggestionItem) => {
|
|
101
|
-
emit('suggestion-click', suggestion)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// 同步外部展开状态
|
|
105
|
-
watch(
|
|
106
|
-
() => props.isExpanded,
|
|
107
|
-
(val) => {
|
|
108
|
-
isExpandedRef.value = val
|
|
109
|
-
},
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
watchEffect(() => {
|
|
113
|
-
if (capsuleRef.value && props.suggestions.length) {
|
|
114
|
-
calculateLayout()
|
|
115
|
-
}
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
// 组件挂载时使用ResizeObserver监听大小变化
|
|
119
|
-
onMounted(() => {
|
|
120
|
-
if (capsuleRef.value) {
|
|
121
|
-
resizeObserver.value = new ResizeObserver(() => {
|
|
122
|
-
calculateLayout()
|
|
123
|
-
})
|
|
124
|
-
resizeObserver.value.observe(capsuleRef.value)
|
|
125
|
-
}
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
// 组件卸载时移除监听器
|
|
129
|
-
onBeforeUnmount(() => {
|
|
130
|
-
if (resizeObserver.value) {
|
|
131
|
-
resizeObserver.value.disconnect()
|
|
132
|
-
}
|
|
133
|
-
})
|
|
134
|
-
</script>
|
|
135
|
-
|
|
136
|
-
<template>
|
|
137
|
-
<!-- 胶囊式指令 -->
|
|
138
|
-
<div class="tr-common-suggestions" ref="capsuleRef" :class="{ expanded: isExpandedRef }">
|
|
139
|
-
<div class="tr-common-suggestions_content">
|
|
140
|
-
<!-- 向上展开的隐藏胶囊 -->
|
|
141
|
-
<div class="tr-common-suggestions_expanded-wrapper">
|
|
142
|
-
<div v-show="isExpandedRef && hiddenSuggestions.length > 0" class="tr-common-suggestions_expanded-area">
|
|
143
|
-
<div
|
|
144
|
-
v-for="(row, rowIndex) in arrangedHiddenSuggestions"
|
|
145
|
-
:key="`row-${rowIndex}`"
|
|
146
|
-
class="tr-common-suggestions_row"
|
|
147
|
-
>
|
|
148
|
-
<div
|
|
149
|
-
v-for="(suggestion, index) in row"
|
|
150
|
-
:key="`hidden-${suggestion.id}-${index}`"
|
|
151
|
-
class="tr-common-suggestions_item"
|
|
152
|
-
@click="handleSuggestionClick(suggestion)"
|
|
153
|
-
>
|
|
154
|
-
<div class="tr-common-suggestions_item_icon">
|
|
155
|
-
<IconEdit />
|
|
156
|
-
</div>
|
|
157
|
-
<div class="tr-common-suggestions_item_text">
|
|
158
|
-
{{ suggestion.text }}
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
|
|
165
|
-
<!-- 固定在底部的可见胶囊 -->
|
|
166
|
-
<div class="tr-common-suggestions_container">
|
|
167
|
-
<div
|
|
168
|
-
v-for="(suggestion, index) in visibleSuggestions"
|
|
169
|
-
:key="`visible-${suggestion.id}-${index}`"
|
|
170
|
-
class="tr-common-suggestions_item"
|
|
171
|
-
@click="handleSuggestionClick(suggestion)"
|
|
172
|
-
>
|
|
173
|
-
<div class="tr-common-suggestions_item_icon">
|
|
174
|
-
<IconEdit />
|
|
175
|
-
</div>
|
|
176
|
-
<div class="tr-common-suggestions_item_text">
|
|
177
|
-
{{ suggestion.text }}
|
|
178
|
-
</div>
|
|
179
|
-
</div>
|
|
180
|
-
</div>
|
|
181
|
-
</div>
|
|
182
|
-
</div>
|
|
183
|
-
</template>
|