@astryx-vue/core 0.2.0 → 0.2.2
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/AppShell/index.js +1 -1
- package/dist/{AppShell-EiGyPFbA.js → AppShell-Cb41gIAj.js} +2 -2
- package/dist/Avatar/index.d.ts +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/Avatar-jmHInHwj.js +244 -0
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-CZcgAMjM.js → AvatarGroup-QyzSrpYA.js} +8 -7
- package/dist/Badge/index.d.ts +2 -1
- package/dist/Badge/index.js +1 -1
- package/dist/Badge-CjDQPF5g.js +30 -0
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +1 -1
- package/dist/{Breadcrumbs-C3YZFQ9w.js → Breadcrumbs-CTQ7fjDn.js} +45 -11
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +2 -2
- package/dist/Calendar/index.js +1 -1
- package/dist/Calendar-BFaI5AMv.js +352 -0
- package/dist/Card/index.d.ts +1 -1
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-BTtHkKea.js → Carousel-X0cuQkvg.js} +2 -2
- package/dist/Chat/index.d.ts +2 -2
- package/dist/Chat/index.js +2 -2
- package/dist/Chat-M0tiGrNT.js +3148 -0
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-DijdbUUu.js → Citation-C1veUk5p.js} +2 -2
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/Code/index.js +1 -1
- package/dist/{CodeBlock-CxTb6j9_.js → CodeBlock-DesTJAkm.js} +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-9MC08X39.js → Collapsible-BestK35V.js} +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-BD2iODF5.js → CommandPalette-BArt97V8.js} +1 -1
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-D9iXd5cH.js → ComplexSelector-CAoig1RK.js} +2 -2
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +1 -1
- package/dist/{ContextMenu-HS_WqYIg.js → ContextMenu-9Im6i43E.js} +101 -63
- package/dist/DateInput/index.d.ts +2 -2
- package/dist/DateInput/index.js +1 -1
- package/dist/DateInput-BLocxqC3.js +376 -0
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-1bhPGG2s.js → DateRangeInput-DwDy3eRo.js} +2 -2
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-SnPdgk6P.js → DateTimeInput-BYiaC9bn.js} +5 -3
- package/dist/DropdownMenu/index.d.ts +3 -2
- package/dist/DropdownMenu/index.js +3 -2
- package/dist/DropdownMenu-Ddfr-aEC.js +164 -0
- package/dist/{DropdownMenu-UJGych6v.js → DropdownMenu-Dh-WAHKb.js} +63 -16
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-BQiwE-GB.js → FileInput-DLO6V12n.js} +2 -2
- package/dist/Icon/index.d.ts +4 -3
- package/dist/Icon/index.js +3 -2
- package/dist/Icon/plugin.d.ts +45 -0
- package/dist/Icon/plugin.js +177 -0
- package/dist/Icon-CJKjdJy-.js +198 -0
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-CshKoB0r.js → Lightbox-CdFCS_EA.js} +2 -2
- package/dist/Link/index.d.ts +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/Link-DqdQZ37C.js +141 -0
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-D-Ua055V.js → Markdown-BqKloI3w.js} +3 -3
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-sYph_d8Q.js → MetadataList-CvZkmisf.js} +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-DD9D01aj.js → MobileNavToggle-Bwi0qXXM.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-BVrK5kkk.js → MoreMenu-BwJaJrkB.js} +2 -2
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-DiYov9sF.js → MultiSelector-C-ETfFy_.js} +2 -2
- package/dist/NumberInput/index.d.ts +2 -2
- package/dist/NumberInput/index.js +1 -1
- package/dist/NumberInput-DjetVB8O.js +210 -0
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-DQfEBxlc.js → Outline-Bz9c-u5y.js} +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-BU5VCntl.js → OverflowList-ED-KN9Y5.js} +1 -1
- package/dist/Overlay/index.d.ts +1 -1
- package/dist/Pagination/index.d.ts +2 -2
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-HdhtykeF.js → Pagination-Cb66HMEf.js} +76 -22
- package/dist/PowerSearch/index.d.ts +2 -0
- package/dist/PowerSearch/index.js +2 -0
- package/dist/PowerSearch-CjU8y4mi.js +2386 -0
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-ChDp-7oe.js → ProgressBar-DO9Chic6.js} +31 -11
- package/dist/Radio/index.d.ts +1 -1
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{Resizable-BhSMfO5B.js → Resizable-D-TBCg0Y.js} +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/Selector/index.d.ts +2 -2
- package/dist/Selector/index.js +1 -1
- package/dist/Selector-DE2IEFML.js +468 -0
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-B-Om6Bz3.js → SideNav-DonEfiAx.js} +17 -17
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-BZ_8SEZt.js → Stepper-D2ZIcUNx.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/TabList/index.d.ts +1 -1
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-Cnc2Hs1H.js → TabList-D3F-stq-.js} +10 -3
- package/dist/Table/index.d.ts +3 -3
- package/dist/Table/index.js +2 -2
- package/dist/Table-CrP2Uffq.js +1982 -0
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-Cv9UVbzS.js → TextArea-CPwSytdO.js} +12 -6
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-Dc1UpykG.js → Thumbnail-BC5JGPGZ.js} +11 -11
- package/dist/{TimeField-C7t9Knq9.js → TimeField-DpHFrNv0.js} +2 -2
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-BXxCOY98.js → TimeInput-DJLV0_4z.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +2 -1
- package/dist/{Timestamp-DlZSmgCJ.js → Timestamp-GKNjjt5g.js} +4 -121
- package/dist/Toast/index.d.ts +2 -2
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-BKXPvEMp.js → Toast-C2ML-bmi.js} +37 -7
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-wt4e80IM.js → Token-Chu_eCVs.js} +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-nmTqdS9n.js → Tokenizer-DRDpvQ_l.js} +3 -3
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-notp-mJx.js → TopNav-CEyWddtA.js} +3 -3
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-s1xBQ0qq.js → TreeList-COS8US8e.js} +3 -3
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead-VAuiCurV.js → Typeahead-P7cCqtaQ.js} +3 -3
- package/dist/{useTypeaheadMenu-Ba7XpcZl.js → TypeaheadMenu-CGvo0Tud.js} +107 -107
- package/dist/composables/index.d.ts +3 -3
- package/dist/{context-Dbo22sck.js → context-CiKncNSH.js} +184 -6
- package/dist/formatInstant-BDWUIxS7.js +119 -0
- package/dist/{index-SMh42NI8.d.ts → index-B1TG2GPS.d.ts} +2 -2
- package/dist/{index-DRmb-oUa.d.ts → index-B9WzWqzk.d.ts} +3 -29
- package/dist/{index-BuubzuE8.d.ts → index-BDZCJ9ri.d.ts} +2 -2
- package/dist/{index-z4p2k9VR.d.ts → index-Bgv4ZmBl.d.ts} +20 -2
- package/dist/{index-BoRIw-bP.d.ts → index-Bt7ewoz2.d.ts} +32 -2
- package/dist/{index-uQrLBZfF.d.ts → index-Bu3oXIIS.d.ts} +24 -0
- package/dist/index-CJlBAXwj.d.ts +100 -0
- package/dist/{index-DT9S92sh.d.ts → index-CNjbOgty.d.ts} +15 -0
- package/dist/{index-DXSs3rwa.d.ts → index-CngORuiq.d.ts} +137 -2
- package/dist/index-Cs5pcwY3.d.ts +416 -0
- package/dist/{index-NzLDrOkk.d.ts → index-D4I_obqR.d.ts} +14 -1
- package/dist/{index-BtPZKO20.d.ts → index-DGXviOlp.d.ts} +49 -7
- package/dist/{index-CTolyeii.d.ts → index-DN7MXPHM.d.ts} +15 -1
- package/dist/{index-C6iJwTL0.d.ts → index-DNRBbwp_.d.ts} +165 -55
- package/dist/{index-C59PdX9L.d.ts → index-DWH_HzXi.d.ts} +1 -1
- package/dist/{index-BfOtLyNH.d.ts → index-D_nYxnNv.d.ts} +1 -1
- package/dist/{index-Bn_odHQ9.d.ts → index-Dg3ZmwEg.d.ts} +12 -1
- package/dist/{index-BiMGXtD-.d.ts → index-DimuSES0.d.ts} +14 -1
- package/dist/{index-DEeJowZf.d.ts → index-cGagYM1g.d.ts} +15 -2
- package/dist/{index-Ck8qy6Rf.d.ts → index-c_TaW8mM.d.ts} +24 -2
- package/dist/index-kVhSuA9t.d.ts +902 -0
- package/dist/{index-1uRMrk63.d.ts → index-nCEmW6wa.d.ts} +1 -1
- package/dist/{index-DoFCm2Q2.d.ts → index-qiZtHnGK.d.ts} +26 -0
- package/dist/{index-Bainr_3n.d.ts → index-u5ozu0G7.d.ts} +2 -2
- package/dist/index.d.ts +79 -76
- package/dist/index.js +111 -100
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +1 -1
- package/dist/power-search-DrDfcoL1.d.ts +68 -0
- package/dist/registry-B1ObuP--.d.ts +45 -0
- package/dist/registry-C7OZb0PJ.js +135 -0
- package/dist/{types-JktRxujg.d.ts → types-Cp4liug-.d.ts} +66 -3
- package/dist/{index-B8MbfMwV.d.ts → types-DDAAT1Xd.d.ts} +36 -82
- package/dist/types-DIYwbkpe.d.ts +33 -0
- package/dist/{types-DZoEm_DG.d.ts → types-pnljWjEE.d.ts} +23 -6
- package/dist/{useResizable-CeESZS1v.d.ts → useResizable-CUoNPmUw.d.ts} +1 -1
- package/package.json +10 -1
- package/styles/avatar.css +14 -0
- package/styles/badge.css +8 -0
- package/styles/breadcrumbs.css +6 -1
- package/styles/button.css +13 -0
- package/styles/calendar.css +16 -0
- package/styles/card.css +2 -0
- package/styles/chat.css +474 -3
- package/styles/dropdown-menu.css +11 -0
- package/styles/icon.css +58 -8
- package/styles/link.css +5 -0
- package/styles/number-input.css +22 -0
- package/styles/pagination.css +45 -1
- package/styles/power-search.css +303 -0
- package/styles/progress-bar.css +4 -0
- package/styles/selector.css +58 -0
- package/styles/tab-list.css +15 -0
- package/styles/table.css +304 -1
- package/styles/text-area.css +17 -0
- package/styles/text-input.css +5 -0
- package/styles/toast.css +7 -0
- package/styles/toolbar.css +11 -0
- package/styles.css +1 -0
- package/dist/Avatar-5s3HSrtN.js +0 -136
- package/dist/Badge-Ba0EwsTj.js +0 -19
- package/dist/Calendar-BG7wEsro.js +0 -277
- package/dist/Chat-DjNxw5gv.js +0 -1051
- package/dist/DateInput-DE2TN1Rq.js +0 -250
- package/dist/Icon-Dfr4k6-S.js +0 -86
- package/dist/Link-CprjOuTI.js +0 -92
- package/dist/NumberInput-CTYiQxHq.js +0 -147
- package/dist/Selector-Da-2BO3q.js +0 -325
- package/dist/Table-D-LhAy_J.js +0 -967
- package/dist/index-DJo-BmXZ.d.ts +0 -431
- package/dist/index-DtjAdYEc.d.ts +0 -68
- package/dist/{CheckboxList-EsIEXjK_.js → CheckboxList-BbCPiend.js} +1 -1
package/dist/Chat-DjNxw5gv.js
DELETED
|
@@ -1,1051 +0,0 @@
|
|
|
1
|
-
import { t as _sfc_main$14 } from "./VisuallyHidden-C7NN3VEP.js";
|
|
2
|
-
import { t as _sfc_main$15 } from "./Button-DrqeomlE.js";
|
|
3
|
-
import { t as useAnnounce } from "./announce-Cnio10Wk.js";
|
|
4
|
-
import { r as useChatNewMessages, t as useChatStreamScroll } from "./useChatStreamScroll-oDfybEos.js";
|
|
5
|
-
import { a as useAstryxMessages, i as useAstryxLocale } from "./context-Dbo22sck.js";
|
|
6
|
-
import { t as _sfc_main$16 } from "./Badge-Ba0EwsTj.js";
|
|
7
|
-
import { t as _sfc_main$17 } from "./Icon-Dfr4k6-S.js";
|
|
8
|
-
import { t as _sfc_main$18 } from "./Spinner-9cYUCnDy.js";
|
|
9
|
-
import { t as _sfc_main$19 } from "./Divider-BtwnL18I.js";
|
|
10
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, inject, mergeModels, mergeProps, normalizeClass, normalizeStyle, openBlock, provide, ref, renderList, renderSlot, toDisplayString, unref, useId, useModel, useSlots, useTemplateRef, watch, withCtx } from "vue";
|
|
11
|
-
import "../styles/chat.css";
|
|
12
|
-
//#region src/Chat/ChatLayoutScrollButton.vue
|
|
13
|
-
const _hoisted_1$12 = [
|
|
14
|
-
"data-visible",
|
|
15
|
-
"data-labeled",
|
|
16
|
-
"inert"
|
|
17
|
-
];
|
|
18
|
-
const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
19
|
-
name: "AstryxChatLayoutScrollButton",
|
|
20
|
-
inheritAttrs: false,
|
|
21
|
-
__name: "ChatLayoutScrollButton",
|
|
22
|
-
props: {
|
|
23
|
-
isVisible: { type: Boolean },
|
|
24
|
-
label: {}
|
|
25
|
-
},
|
|
26
|
-
emits: ["click"],
|
|
27
|
-
setup(__props, { emit: __emit }) {
|
|
28
|
-
const props = __props;
|
|
29
|
-
const emit = __emit;
|
|
30
|
-
const messages = useAstryxMessages();
|
|
31
|
-
const accessibleLabel = computed(() => props.label ?? messages.value.chat.scrollToBottom);
|
|
32
|
-
return (_ctx, _cache) => {
|
|
33
|
-
return openBlock(), createElementBlock("div", mergeProps(_ctx.$attrs, { class: "astryx-chat-scroll-button" }), [createElementVNode("div", {
|
|
34
|
-
class: "astryx-chat-scroll-button__pill",
|
|
35
|
-
"data-visible": __props.isVisible || void 0,
|
|
36
|
-
"data-labeled": __props.label ? "" : void 0,
|
|
37
|
-
inert: !__props.isVisible
|
|
38
|
-
}, [createVNode(_sfc_main$15, {
|
|
39
|
-
class: "astryx-chat-scroll-button__control",
|
|
40
|
-
label: accessibleLabel.value,
|
|
41
|
-
variant: "ghost",
|
|
42
|
-
size: "md",
|
|
43
|
-
"is-icon-only": !__props.label,
|
|
44
|
-
onClick: _cache[0] || (_cache[0] = ($event) => emit("click"))
|
|
45
|
-
}, {
|
|
46
|
-
icon: withCtx(() => [createVNode(_sfc_main$17, {
|
|
47
|
-
icon: "chevronDown",
|
|
48
|
-
size: "md"
|
|
49
|
-
})]),
|
|
50
|
-
_: 1
|
|
51
|
-
}, 8, ["label", "is-icon-only"])], 8, _hoisted_1$12)], 16);
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/Chat/context.ts
|
|
57
|
-
const chatMessageContextKey = Symbol("astryx-chat-message");
|
|
58
|
-
function useChatMessageContext() {
|
|
59
|
-
return inject(chatMessageContextKey, void 0);
|
|
60
|
-
}
|
|
61
|
-
const chatListContextKey = Symbol("astryx-chat-list");
|
|
62
|
-
function useChatListContext() {
|
|
63
|
-
return inject(chatListContextKey, void 0);
|
|
64
|
-
}
|
|
65
|
-
const chatLayoutContextKey = Symbol("astryx-chat-layout");
|
|
66
|
-
function useChatLayoutContext() {
|
|
67
|
-
return inject(chatLayoutContextKey, void 0);
|
|
68
|
-
}
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region src/Chat/ChatLayout.vue
|
|
71
|
-
const _hoisted_1$11 = ["data-density", "data-scroll"];
|
|
72
|
-
const _hoisted_2$9 = ["data-density"];
|
|
73
|
-
const _hoisted_3$7 = {
|
|
74
|
-
key: 0,
|
|
75
|
-
class: "astryx-chat-layout__empty"
|
|
76
|
-
};
|
|
77
|
-
const _hoisted_4$7 = ["data-density"];
|
|
78
|
-
const _hoisted_5$5 = ["data-density"];
|
|
79
|
-
const _hoisted_6$4 = ["data-density"];
|
|
80
|
-
const _hoisted_7$3 = ["data-density"];
|
|
81
|
-
const _sfc_main$12 = /*@__PURE__*/ defineComponent({
|
|
82
|
-
name: "AstryxChatLayout",
|
|
83
|
-
inheritAttrs: false,
|
|
84
|
-
__name: "ChatLayout",
|
|
85
|
-
props: {
|
|
86
|
-
density: { default: "balanced" },
|
|
87
|
-
scrollRef: {},
|
|
88
|
-
showScrollButton: {
|
|
89
|
-
type: Boolean,
|
|
90
|
-
default: true
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
setup(__props, { expose: __expose }) {
|
|
94
|
-
const props = __props;
|
|
95
|
-
const messages = useAstryxMessages();
|
|
96
|
-
const announce = useAnnounce();
|
|
97
|
-
const root = useTemplateRef("root");
|
|
98
|
-
const scrollTarget = computed(() => props.scrollRef ?? root.value);
|
|
99
|
-
const isSelfScrolling = computed(() => props.scrollRef == null);
|
|
100
|
-
const scroll = useChatStreamScroll({ scrollRef: scrollTarget });
|
|
101
|
-
const newMessages = useChatNewMessages({
|
|
102
|
-
isLocked: scroll.isLocked,
|
|
103
|
-
onResize: scroll.scrollIfLocked
|
|
104
|
-
});
|
|
105
|
-
const buttonVisible = computed(() => scroll.isScrolledUp.value || newMessages.hasNewMessages.value);
|
|
106
|
-
const buttonLabel = computed(() => newMessages.hasNewMessages.value ? messages.value.chat.newMessages : void 0);
|
|
107
|
-
function scrollToBottom() {
|
|
108
|
-
newMessages.dismiss();
|
|
109
|
-
scroll.scrollToBottom();
|
|
110
|
-
}
|
|
111
|
-
watch(() => newMessages.hasNewMessages.value, (hasNew) => {
|
|
112
|
-
if (hasNew) announce(messages.value.chat.newMessages);
|
|
113
|
-
});
|
|
114
|
-
provide(chatLayoutContextKey, {
|
|
115
|
-
scrollContainer: scrollTarget,
|
|
116
|
-
contentRef: newMessages.contentRef
|
|
117
|
-
});
|
|
118
|
-
__expose({
|
|
119
|
-
element: root,
|
|
120
|
-
scrollToBottom
|
|
121
|
-
});
|
|
122
|
-
return (_ctx, _cache) => {
|
|
123
|
-
return openBlock(), createElementBlock("div", mergeProps({
|
|
124
|
-
ref_key: "root",
|
|
125
|
-
ref: root
|
|
126
|
-
}, _ctx.$attrs, {
|
|
127
|
-
class: "astryx-chat-layout",
|
|
128
|
-
"data-density": __props.density,
|
|
129
|
-
"data-scroll": isSelfScrolling.value ? "self" : "external"
|
|
130
|
-
}), [createElementVNode("div", {
|
|
131
|
-
class: "astryx-chat-layout__messages",
|
|
132
|
-
"data-density": __props.density
|
|
133
|
-
}, [!_ctx.$slots.default && _ctx.$slots.empty ? (openBlock(), createElementBlock("div", _hoisted_3$7, [renderSlot(_ctx.$slots, "empty")])) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 8, _hoisted_2$9), createElementVNode("div", {
|
|
134
|
-
class: "astryx-chat-layout__dock",
|
|
135
|
-
"data-density": __props.density
|
|
136
|
-
}, [
|
|
137
|
-
renderSlot(_ctx.$slots, "scrollButton", {
|
|
138
|
-
isVisible: buttonVisible.value,
|
|
139
|
-
label: buttonLabel.value,
|
|
140
|
-
scrollToBottom
|
|
141
|
-
}, () => [__props.showScrollButton ? (openBlock(), createBlock(_sfc_main$13, {
|
|
142
|
-
key: 0,
|
|
143
|
-
"is-visible": buttonVisible.value,
|
|
144
|
-
label: buttonLabel.value,
|
|
145
|
-
onClick: scrollToBottom
|
|
146
|
-
}, null, 8, ["is-visible", "label"])) : createCommentVNode("v-if", true)]),
|
|
147
|
-
createElementVNode("div", {
|
|
148
|
-
class: "astryx-chat-layout__blur",
|
|
149
|
-
"data-density": __props.density
|
|
150
|
-
}, null, 8, _hoisted_5$5),
|
|
151
|
-
createElementVNode("div", {
|
|
152
|
-
class: "astryx-chat-layout__composer",
|
|
153
|
-
"data-density": __props.density
|
|
154
|
-
}, [createElementVNode("div", {
|
|
155
|
-
class: "astryx-chat-layout__composer-inner",
|
|
156
|
-
"data-density": __props.density
|
|
157
|
-
}, [renderSlot(_ctx.$slots, "composer")], 8, _hoisted_7$3)], 8, _hoisted_6$4)
|
|
158
|
-
], 8, _hoisted_4$7)], 16, _hoisted_1$11);
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region src/Chat/ChatMessage.vue
|
|
164
|
-
const _hoisted_1$10 = [
|
|
165
|
-
"data-sender",
|
|
166
|
-
"data-density",
|
|
167
|
-
"aria-label",
|
|
168
|
-
"aria-labelledby"
|
|
169
|
-
];
|
|
170
|
-
const _hoisted_2$8 = {
|
|
171
|
-
key: 0,
|
|
172
|
-
class: "astryx-chat-message__avatar"
|
|
173
|
-
};
|
|
174
|
-
const _hoisted_3$6 = ["data-sender"];
|
|
175
|
-
const _hoisted_4$6 = ["data-sender", "data-density"];
|
|
176
|
-
const _hoisted_5$4 = {
|
|
177
|
-
key: 1,
|
|
178
|
-
class: "astryx-chat-message__metadata"
|
|
179
|
-
};
|
|
180
|
-
const _sfc_main$11 = /*@__PURE__*/ defineComponent({
|
|
181
|
-
name: "AstryxChatMessage",
|
|
182
|
-
inheritAttrs: false,
|
|
183
|
-
__name: "ChatMessage",
|
|
184
|
-
props: {
|
|
185
|
-
sender: {},
|
|
186
|
-
name: {},
|
|
187
|
-
density: {}
|
|
188
|
-
},
|
|
189
|
-
setup(__props, { expose: __expose }) {
|
|
190
|
-
const props = __props;
|
|
191
|
-
const slots = useSlots();
|
|
192
|
-
const messages = useAstryxMessages();
|
|
193
|
-
const list = useChatListContext();
|
|
194
|
-
const root = useTemplateRef("root");
|
|
195
|
-
const nameId = `astryx-chat-message-${useId()}`;
|
|
196
|
-
const density = computed(() => props.density ?? list?.density.value ?? "balanced");
|
|
197
|
-
const isSystem = computed(() => props.sender === "system");
|
|
198
|
-
const hasName = computed(() => !isSystem.value && (Boolean(props.name) || Boolean(slots.name)));
|
|
199
|
-
const senderName = computed(() => {
|
|
200
|
-
const chat = messages.value.chat;
|
|
201
|
-
if (props.sender === "user") return chat.senderUser;
|
|
202
|
-
if (props.sender === "system") return chat.senderSystem;
|
|
203
|
-
return chat.senderAssistant;
|
|
204
|
-
});
|
|
205
|
-
provide(chatMessageContextKey, {
|
|
206
|
-
sender: computed(() => props.sender),
|
|
207
|
-
density
|
|
208
|
-
});
|
|
209
|
-
__expose({ element: root });
|
|
210
|
-
return (_ctx, _cache) => {
|
|
211
|
-
return openBlock(), createElementBlock("article", mergeProps({
|
|
212
|
-
ref_key: "root",
|
|
213
|
-
ref: root
|
|
214
|
-
}, _ctx.$attrs, {
|
|
215
|
-
class: "astryx-chat-message",
|
|
216
|
-
"data-sender": __props.sender,
|
|
217
|
-
"data-density": density.value,
|
|
218
|
-
"aria-label": hasName.value ? void 0 : unref(messages).chat.messageFrom(senderName.value),
|
|
219
|
-
"aria-labelledby": hasName.value ? nameId : void 0
|
|
220
|
-
}), [_ctx.$slots.avatar && !isSystem.value ? (openBlock(), createElementBlock("div", _hoisted_2$8, [renderSlot(_ctx.$slots, "avatar")])) : createCommentVNode("v-if", true), createElementVNode("div", {
|
|
221
|
-
class: "astryx-chat-message__column",
|
|
222
|
-
"data-sender": __props.sender
|
|
223
|
-
}, [
|
|
224
|
-
hasName.value ? (openBlock(), createElementBlock("div", {
|
|
225
|
-
key: 0,
|
|
226
|
-
id: nameId,
|
|
227
|
-
class: "astryx-chat-message__name",
|
|
228
|
-
"data-chat-name": ""
|
|
229
|
-
}, [renderSlot(_ctx.$slots, "name", {}, () => [createTextVNode(toDisplayString(__props.name), 1)])])) : createCommentVNode("v-if", true),
|
|
230
|
-
createElementVNode("div", {
|
|
231
|
-
class: "astryx-chat-message__body",
|
|
232
|
-
"data-sender": __props.sender,
|
|
233
|
-
"data-density": density.value
|
|
234
|
-
}, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_4$6),
|
|
235
|
-
!isSystem.value && _ctx.$slots.metadata ? (openBlock(), createElementBlock("div", _hoisted_5$4, [renderSlot(_ctx.$slots, "metadata")])) : createCommentVNode("v-if", true)
|
|
236
|
-
], 8, _hoisted_3$6)], 16, _hoisted_1$10);
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
//#endregion
|
|
241
|
-
//#region src/Chat/ChatMessageBubble.vue
|
|
242
|
-
const _hoisted_1$9 = [
|
|
243
|
-
"data-sender",
|
|
244
|
-
"data-variant",
|
|
245
|
-
"data-density"
|
|
246
|
-
];
|
|
247
|
-
const _hoisted_2$7 = ["data-sender", "data-density"];
|
|
248
|
-
const _hoisted_3$5 = [
|
|
249
|
-
"data-sender",
|
|
250
|
-
"data-variant",
|
|
251
|
-
"data-density",
|
|
252
|
-
"data-group"
|
|
253
|
-
];
|
|
254
|
-
const _hoisted_4$5 = ["data-sender", "data-density"];
|
|
255
|
-
const _sfc_main$10 = /*@__PURE__*/ defineComponent({
|
|
256
|
-
name: "AstryxChatMessageBubble",
|
|
257
|
-
inheritAttrs: false,
|
|
258
|
-
__name: "ChatMessageBubble",
|
|
259
|
-
props: {
|
|
260
|
-
variant: { default: "filled" },
|
|
261
|
-
name: {},
|
|
262
|
-
group: {},
|
|
263
|
-
width: {}
|
|
264
|
-
},
|
|
265
|
-
setup(__props, { expose: __expose }) {
|
|
266
|
-
const props = __props;
|
|
267
|
-
const context = useChatMessageContext();
|
|
268
|
-
const root = useTemplateRef("root");
|
|
269
|
-
const sender = computed(() => context?.sender.value ?? "assistant");
|
|
270
|
-
const density = computed(() => context?.density.value ?? "balanced");
|
|
271
|
-
const frameStyle = computed(() => props.width ? {
|
|
272
|
-
width: props.width,
|
|
273
|
-
maxWidth: props.width
|
|
274
|
-
} : void 0);
|
|
275
|
-
__expose({ element: root });
|
|
276
|
-
return (_ctx, _cache) => {
|
|
277
|
-
return openBlock(), createElementBlock("div", {
|
|
278
|
-
class: "astryx-chat-message-bubble__frame",
|
|
279
|
-
"data-sender": sender.value,
|
|
280
|
-
"data-variant": __props.variant,
|
|
281
|
-
"data-density": density.value,
|
|
282
|
-
style: normalizeStyle(frameStyle.value)
|
|
283
|
-
}, [
|
|
284
|
-
__props.name || _ctx.$slots.name ? (openBlock(), createElementBlock("div", {
|
|
285
|
-
key: 0,
|
|
286
|
-
class: "astryx-chat-message-bubble__name",
|
|
287
|
-
"data-chat-name": "",
|
|
288
|
-
"data-sender": sender.value,
|
|
289
|
-
"data-density": density.value
|
|
290
|
-
}, [renderSlot(_ctx.$slots, "name", {}, () => [createTextVNode(toDisplayString(__props.name), 1)])], 8, _hoisted_2$7)) : createCommentVNode("v-if", true),
|
|
291
|
-
createElementVNode("div", mergeProps({
|
|
292
|
-
ref_key: "root",
|
|
293
|
-
ref: root
|
|
294
|
-
}, _ctx.$attrs, {
|
|
295
|
-
class: "astryx-chat-message-bubble",
|
|
296
|
-
"data-sender": sender.value,
|
|
297
|
-
"data-variant": __props.variant,
|
|
298
|
-
"data-density": density.value,
|
|
299
|
-
"data-group": __props.group
|
|
300
|
-
}), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_3$5),
|
|
301
|
-
_ctx.$slots.metadata ? (openBlock(), createElementBlock("div", {
|
|
302
|
-
key: 1,
|
|
303
|
-
class: "astryx-chat-message-bubble__meta",
|
|
304
|
-
"data-sender": sender.value,
|
|
305
|
-
"data-density": density.value
|
|
306
|
-
}, [renderSlot(_ctx.$slots, "metadata")], 8, _hoisted_4$5)) : createCommentVNode("v-if", true)
|
|
307
|
-
], 12, _hoisted_1$9);
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
});
|
|
311
|
-
//#endregion
|
|
312
|
-
//#region src/Chat/ChatMessageList.vue
|
|
313
|
-
const _hoisted_1$8 = [
|
|
314
|
-
"aria-busy",
|
|
315
|
-
"aria-label",
|
|
316
|
-
"data-density"
|
|
317
|
-
];
|
|
318
|
-
const _hoisted_2$6 = ["data-density", "data-gap"];
|
|
319
|
-
const _hoisted_3$4 = {
|
|
320
|
-
key: 1,
|
|
321
|
-
class: "astryx-chat-message-list__loading"
|
|
322
|
-
};
|
|
323
|
-
const _hoisted_4$4 = {
|
|
324
|
-
key: 3,
|
|
325
|
-
class: "astryx-chat-message-list__empty"
|
|
326
|
-
};
|
|
327
|
-
const _sfc_main$9 = /*@__PURE__*/ defineComponent({
|
|
328
|
-
name: "AstryxChatMessageList",
|
|
329
|
-
inheritAttrs: false,
|
|
330
|
-
__name: "ChatMessageList",
|
|
331
|
-
props: {
|
|
332
|
-
density: { default: "balanced" },
|
|
333
|
-
gap: {},
|
|
334
|
-
scrollToTopAction: {},
|
|
335
|
-
isStreaming: {
|
|
336
|
-
type: Boolean,
|
|
337
|
-
default: false
|
|
338
|
-
},
|
|
339
|
-
label: {}
|
|
340
|
-
},
|
|
341
|
-
setup(__props) {
|
|
342
|
-
const props = __props;
|
|
343
|
-
const messages = useAstryxMessages();
|
|
344
|
-
const layout = useChatLayoutContext();
|
|
345
|
-
const inner = useTemplateRef("inner");
|
|
346
|
-
const sentinel = useTemplateRef("sentinel");
|
|
347
|
-
const isLoadingTop = ref(false);
|
|
348
|
-
const accessibleName = computed(() => props.label ?? messages.value.chat.log);
|
|
349
|
-
provide(chatListContextKey, { density: computed(() => props.density) });
|
|
350
|
-
watch(inner, (el, _, onCleanup) => {
|
|
351
|
-
if (!layout) return;
|
|
352
|
-
layout.contentRef(el);
|
|
353
|
-
onCleanup(() => layout.contentRef(null));
|
|
354
|
-
});
|
|
355
|
-
watch(() => [
|
|
356
|
-
props.scrollToTopAction,
|
|
357
|
-
sentinel.value,
|
|
358
|
-
layout?.scrollContainer.value
|
|
359
|
-
], ([action, sentinelEl], _, onCleanup) => {
|
|
360
|
-
if (!action || !sentinelEl || typeof IntersectionObserver === "undefined") return;
|
|
361
|
-
let pending = false;
|
|
362
|
-
const observer = new IntersectionObserver((entries) => {
|
|
363
|
-
if (!entries[0]?.isIntersecting || pending) return;
|
|
364
|
-
pending = true;
|
|
365
|
-
isLoadingTop.value = true;
|
|
366
|
-
Promise.resolve(action()).finally(() => {
|
|
367
|
-
pending = false;
|
|
368
|
-
isLoadingTop.value = false;
|
|
369
|
-
});
|
|
370
|
-
}, {
|
|
371
|
-
root: layout?.scrollContainer.value ?? null,
|
|
372
|
-
threshold: 0
|
|
373
|
-
});
|
|
374
|
-
observer.observe(sentinelEl);
|
|
375
|
-
onCleanup(() => observer.disconnect());
|
|
376
|
-
});
|
|
377
|
-
return (_ctx, _cache) => {
|
|
378
|
-
return openBlock(), createElementBlock("div", mergeProps(_ctx.$attrs, {
|
|
379
|
-
class: "astryx-chat-message-list",
|
|
380
|
-
role: "log",
|
|
381
|
-
"aria-live": "polite",
|
|
382
|
-
"aria-busy": __props.isStreaming || void 0,
|
|
383
|
-
"aria-label": accessibleName.value,
|
|
384
|
-
tabindex: "0",
|
|
385
|
-
"data-density": __props.density
|
|
386
|
-
}), [createElementVNode("div", {
|
|
387
|
-
ref_key: "inner",
|
|
388
|
-
ref: inner,
|
|
389
|
-
class: "astryx-chat-message-list__inner",
|
|
390
|
-
"data-density": __props.density,
|
|
391
|
-
"data-gap": __props.gap
|
|
392
|
-
}, [
|
|
393
|
-
__props.scrollToTopAction ? (openBlock(), createElementBlock("div", {
|
|
394
|
-
key: 0,
|
|
395
|
-
ref_key: "sentinel",
|
|
396
|
-
ref: sentinel,
|
|
397
|
-
class: "astryx-chat-message-list__sentinel",
|
|
398
|
-
"aria-hidden": "true"
|
|
399
|
-
}, null, 512)) : createCommentVNode("v-if", true),
|
|
400
|
-
isLoadingTop.value ? (openBlock(), createElementBlock("div", _hoisted_3$4, [createVNode(_sfc_main$18, {
|
|
401
|
-
size: "md",
|
|
402
|
-
"aria-label": unref(messages).chat.toolRunning
|
|
403
|
-
}, null, 8, ["aria-label"])])) : createCommentVNode("v-if", true),
|
|
404
|
-
_cache[0] || (_cache[0] = createElementVNode("div", {
|
|
405
|
-
class: "astryx-chat-message-list__spacer",
|
|
406
|
-
"aria-hidden": "true"
|
|
407
|
-
}, null, -1)),
|
|
408
|
-
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 2) : _ctx.$slots.empty ? (openBlock(), createElementBlock("div", _hoisted_4$4, [renderSlot(_ctx.$slots, "empty")])) : createCommentVNode("v-if", true)
|
|
409
|
-
], 8, _hoisted_2$6)], 16, _hoisted_1$8);
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
});
|
|
413
|
-
//#endregion
|
|
414
|
-
//#region src/Chat/ChatIcon.vue
|
|
415
|
-
const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
416
|
-
__name: "ChatIcon",
|
|
417
|
-
props: {
|
|
418
|
-
name: {},
|
|
419
|
-
size: { default: "sm" }
|
|
420
|
-
},
|
|
421
|
-
setup(__props) {
|
|
422
|
-
return (_ctx, _cache) => {
|
|
423
|
-
return openBlock(), createBlock(_sfc_main$17, {
|
|
424
|
-
size: __props.size,
|
|
425
|
-
color: "inherit"
|
|
426
|
-
}, {
|
|
427
|
-
default: withCtx(() => [createElementVNode("span", { class: normalizeClass(["astryx-icon__glyph", `astryx-chat-icon--${__props.name}`]) }, null, 2)]),
|
|
428
|
-
_: 1
|
|
429
|
-
}, 8, ["size"]);
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
});
|
|
433
|
-
//#endregion
|
|
434
|
-
//#region src/Chat/ChatMessageMetadata.vue
|
|
435
|
-
const _hoisted_1$7 = ["data-sender"];
|
|
436
|
-
const _hoisted_2$5 = {
|
|
437
|
-
key: 0,
|
|
438
|
-
class: "astryx-chat-metadata__timestamp"
|
|
439
|
-
};
|
|
440
|
-
const _hoisted_3$3 = {
|
|
441
|
-
key: 1,
|
|
442
|
-
class: "astryx-chat-metadata__dot",
|
|
443
|
-
"aria-hidden": "true"
|
|
444
|
-
};
|
|
445
|
-
const _hoisted_4$3 = {
|
|
446
|
-
key: 2,
|
|
447
|
-
class: "astryx-chat-metadata__footer"
|
|
448
|
-
};
|
|
449
|
-
const _hoisted_5$3 = {
|
|
450
|
-
key: 3,
|
|
451
|
-
class: "astryx-chat-metadata__dot",
|
|
452
|
-
"aria-hidden": "true"
|
|
453
|
-
};
|
|
454
|
-
const _hoisted_6$3 = [
|
|
455
|
-
"data-status",
|
|
456
|
-
"title",
|
|
457
|
-
"aria-label"
|
|
458
|
-
];
|
|
459
|
-
const _sfc_main$7 = /*@__PURE__*/ defineComponent({
|
|
460
|
-
name: "AstryxChatMessageMetadata",
|
|
461
|
-
inheritAttrs: false,
|
|
462
|
-
__name: "ChatMessageMetadata",
|
|
463
|
-
props: {
|
|
464
|
-
timestamp: {},
|
|
465
|
-
footer: {},
|
|
466
|
-
status: {}
|
|
467
|
-
},
|
|
468
|
-
setup(__props) {
|
|
469
|
-
const props = __props;
|
|
470
|
-
const slots = useSlots();
|
|
471
|
-
const messages = useAstryxMessages();
|
|
472
|
-
const locale = useAstryxLocale();
|
|
473
|
-
const context = useChatMessageContext();
|
|
474
|
-
const sender = computed(() => context?.sender.value ?? "assistant");
|
|
475
|
-
const statusLabel = computed(() => {
|
|
476
|
-
const chat = messages.value.chat;
|
|
477
|
-
const labels = {
|
|
478
|
-
sending: chat.statusSending,
|
|
479
|
-
sent: chat.statusSent,
|
|
480
|
-
delivered: chat.statusDelivered,
|
|
481
|
-
read: chat.statusRead,
|
|
482
|
-
error: chat.statusFailed
|
|
483
|
-
};
|
|
484
|
-
return props.status ? labels[props.status] : "";
|
|
485
|
-
});
|
|
486
|
-
const spokenStatus = computed(() => {
|
|
487
|
-
if (locale.value === "en") return statusLabel.value.toLowerCase();
|
|
488
|
-
return statusLabel.value;
|
|
489
|
-
});
|
|
490
|
-
const hasContent = computed(() => Boolean(props.timestamp) || Boolean(slots.timestamp) || Boolean(props.footer) || Boolean(slots.footer) || props.status != null);
|
|
491
|
-
const showTimestampDot = computed(() => (Boolean(props.timestamp) || Boolean(slots.timestamp)) && (Boolean(props.footer) || Boolean(slots.footer) || props.status != null));
|
|
492
|
-
const showFooterDot = computed(() => (Boolean(props.footer) || Boolean(slots.footer)) && props.status != null);
|
|
493
|
-
return (_ctx, _cache) => {
|
|
494
|
-
return hasContent.value ? (openBlock(), createElementBlock("div", mergeProps({ key: 0 }, _ctx.$attrs, {
|
|
495
|
-
class: "astryx-chat-metadata",
|
|
496
|
-
"data-sender": sender.value
|
|
497
|
-
}), [
|
|
498
|
-
__props.timestamp || _ctx.$slots.timestamp ? (openBlock(), createElementBlock("span", _hoisted_2$5, [renderSlot(_ctx.$slots, "timestamp", {}, () => [createTextVNode(toDisplayString(__props.timestamp), 1)])])) : createCommentVNode("v-if", true),
|
|
499
|
-
showTimestampDot.value ? (openBlock(), createElementBlock("span", _hoisted_3$3, "·")) : createCommentVNode("v-if", true),
|
|
500
|
-
__props.footer || _ctx.$slots.footer ? (openBlock(), createElementBlock("span", _hoisted_4$3, [renderSlot(_ctx.$slots, "footer", {}, () => [createTextVNode(toDisplayString(__props.footer), 1)])])) : createCommentVNode("v-if", true),
|
|
501
|
-
showFooterDot.value ? (openBlock(), createElementBlock("span", _hoisted_5$3, "·")) : createCommentVNode("v-if", true),
|
|
502
|
-
__props.status ? (openBlock(), createElementBlock("span", {
|
|
503
|
-
key: 4,
|
|
504
|
-
class: "astryx-chat-metadata__status",
|
|
505
|
-
"data-status": __props.status,
|
|
506
|
-
title: statusLabel.value,
|
|
507
|
-
"aria-label": unref(messages).chat.messageStatus(spokenStatus.value)
|
|
508
|
-
}, [__props.status === "sending" ? (openBlock(), createBlock(_sfc_main$8, {
|
|
509
|
-
key: 0,
|
|
510
|
-
name: "clock",
|
|
511
|
-
size: "xsm"
|
|
512
|
-
})) : __props.status === "sent" ? (openBlock(), createBlock(_sfc_main$17, {
|
|
513
|
-
key: 1,
|
|
514
|
-
icon: "check",
|
|
515
|
-
size: "xsm",
|
|
516
|
-
color: "inherit"
|
|
517
|
-
})) : __props.status === "delivered" || __props.status === "read" ? (openBlock(), createBlock(_sfc_main$8, {
|
|
518
|
-
key: 2,
|
|
519
|
-
name: "check-double",
|
|
520
|
-
size: "xsm"
|
|
521
|
-
})) : (openBlock(), createBlock(_sfc_main$8, {
|
|
522
|
-
key: 3,
|
|
523
|
-
name: "error",
|
|
524
|
-
size: "xsm"
|
|
525
|
-
})), createElementVNode("span", null, toDisplayString(statusLabel.value), 1)], 8, _hoisted_6$3)) : createCommentVNode("v-if", true)
|
|
526
|
-
], 16, _hoisted_1$7)) : createCommentVNode("v-if", true);
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
});
|
|
530
|
-
//#endregion
|
|
531
|
-
//#region src/Chat/ChatReasoning.vue
|
|
532
|
-
const _hoisted_1$6 = ["data-streaming", "data-open"];
|
|
533
|
-
const _hoisted_2$4 = ["aria-expanded"];
|
|
534
|
-
const _hoisted_3$2 = { class: "astryx-chat-reasoning__icon" };
|
|
535
|
-
const _hoisted_4$2 = { class: "astryx-chat-reasoning__label-row" };
|
|
536
|
-
const _hoisted_5$2 = ["data-streaming"];
|
|
537
|
-
const _hoisted_6$2 = { class: "astryx-chat-reasoning__duration" };
|
|
538
|
-
const _hoisted_7$2 = { class: "astryx-chat-reasoning__preview" };
|
|
539
|
-
const _hoisted_8$2 = ["data-open"];
|
|
540
|
-
const _hoisted_9$2 = ["data-open", "inert"];
|
|
541
|
-
const _hoisted_10$2 = { class: "astryx-chat-reasoning__panel-inner" };
|
|
542
|
-
const _hoisted_11$1 = { class: "astryx-chat-reasoning__body" };
|
|
543
|
-
const _sfc_main$6 = /*@__PURE__*/ defineComponent({
|
|
544
|
-
name: "AstryxChatReasoning",
|
|
545
|
-
inheritAttrs: false,
|
|
546
|
-
__name: "ChatReasoning",
|
|
547
|
-
props: /*@__PURE__*/ mergeModels({
|
|
548
|
-
label: {},
|
|
549
|
-
duration: {},
|
|
550
|
-
isStreaming: {
|
|
551
|
-
type: Boolean,
|
|
552
|
-
default: false
|
|
553
|
-
},
|
|
554
|
-
defaultIsExpanded: {
|
|
555
|
-
type: Boolean,
|
|
556
|
-
default: false
|
|
557
|
-
}
|
|
558
|
-
}, {
|
|
559
|
-
"isExpanded": {
|
|
560
|
-
type: Boolean,
|
|
561
|
-
default: void 0
|
|
562
|
-
},
|
|
563
|
-
"isExpandedModifiers": {}
|
|
564
|
-
}),
|
|
565
|
-
emits: /*@__PURE__*/ mergeModels(["expandedChange"], ["update:isExpanded"]),
|
|
566
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
567
|
-
const props = __props;
|
|
568
|
-
const emit = __emit;
|
|
569
|
-
const slots = useSlots();
|
|
570
|
-
const messages = useAstryxMessages();
|
|
571
|
-
const model = useModel(__props, "isExpanded");
|
|
572
|
-
const internalExpanded = ref(props.defaultIsExpanded);
|
|
573
|
-
const isExpanded = computed(() => model.value ?? internalExpanded.value);
|
|
574
|
-
const contentId = `astryx-chat-reasoning-${useId()}`;
|
|
575
|
-
const root = useTemplateRef("root");
|
|
576
|
-
const heading = computed(() => props.label ?? messages.value.chat.thinking);
|
|
577
|
-
function slotPreview() {
|
|
578
|
-
const nodes = slots.default?.();
|
|
579
|
-
if (!nodes || nodes.length !== 1) return null;
|
|
580
|
-
const text = textOf(nodes[0]);
|
|
581
|
-
return text.trim() === "" ? null : text.trim();
|
|
582
|
-
}
|
|
583
|
-
function textOf(node) {
|
|
584
|
-
if (typeof node.children === "string") return node.children;
|
|
585
|
-
return "";
|
|
586
|
-
}
|
|
587
|
-
function toggle() {
|
|
588
|
-
const next = !isExpanded.value;
|
|
589
|
-
internalExpanded.value = next;
|
|
590
|
-
model.value = next;
|
|
591
|
-
emit("expandedChange", next);
|
|
592
|
-
}
|
|
593
|
-
__expose({ element: root });
|
|
594
|
-
return (_ctx, _cache) => {
|
|
595
|
-
return openBlock(), createElementBlock("div", mergeProps({
|
|
596
|
-
ref_key: "root",
|
|
597
|
-
ref: root
|
|
598
|
-
}, _ctx.$attrs, {
|
|
599
|
-
class: "astryx-chat-reasoning",
|
|
600
|
-
"data-streaming": __props.isStreaming || void 0,
|
|
601
|
-
"data-open": isExpanded.value || void 0
|
|
602
|
-
}), [createElementVNode("button", {
|
|
603
|
-
type: "button",
|
|
604
|
-
class: "astryx-chat-reasoning__header",
|
|
605
|
-
"aria-expanded": isExpanded.value,
|
|
606
|
-
"aria-controls": contentId,
|
|
607
|
-
onClick: toggle
|
|
608
|
-
}, [
|
|
609
|
-
createElementVNode("span", _hoisted_3$2, [createVNode(_sfc_main$8, {
|
|
610
|
-
name: "thinking",
|
|
611
|
-
size: "sm"
|
|
612
|
-
})]),
|
|
613
|
-
createElementVNode("span", _hoisted_4$2, [
|
|
614
|
-
createElementVNode("span", {
|
|
615
|
-
class: "astryx-chat-reasoning__label",
|
|
616
|
-
"data-streaming": __props.isStreaming || void 0
|
|
617
|
-
}, toDisplayString(heading.value), 9, _hoisted_5$2),
|
|
618
|
-
__props.duration && !__props.isStreaming ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[0] || (_cache[0] = createElementVNode("span", {
|
|
619
|
-
class: "astryx-chat-reasoning__separator",
|
|
620
|
-
"aria-hidden": "true"
|
|
621
|
-
}, "·", -1)), createElementVNode("span", _hoisted_6$2, toDisplayString(__props.duration), 1)], 64)) : createCommentVNode("v-if", true),
|
|
622
|
-
!isExpanded.value && !__props.isStreaming && slotPreview() ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [_cache[1] || (_cache[1] = createElementVNode("span", {
|
|
623
|
-
class: "astryx-chat-reasoning__separator",
|
|
624
|
-
"aria-hidden": "true"
|
|
625
|
-
}, "—", -1)), createElementVNode("span", _hoisted_7$2, toDisplayString(slotPreview()), 1)], 64)) : createCommentVNode("v-if", true)
|
|
626
|
-
]),
|
|
627
|
-
createElementVNode("span", {
|
|
628
|
-
class: "astryx-chat-tool-calls__chevron",
|
|
629
|
-
"data-open": isExpanded.value || void 0
|
|
630
|
-
}, [createVNode(_sfc_main$17, {
|
|
631
|
-
icon: "chevronDown",
|
|
632
|
-
size: "xsm",
|
|
633
|
-
color: "inherit"
|
|
634
|
-
})], 8, _hoisted_8$2)
|
|
635
|
-
], 8, _hoisted_2$4), createElementVNode("div", {
|
|
636
|
-
id: contentId,
|
|
637
|
-
class: "astryx-chat-reasoning__panel",
|
|
638
|
-
"data-open": isExpanded.value || void 0,
|
|
639
|
-
inert: !isExpanded.value
|
|
640
|
-
}, [createElementVNode("div", _hoisted_10$2, [createElementVNode("div", _hoisted_11$1, [renderSlot(_ctx.$slots, "default")])])], 8, _hoisted_9$2)], 16, _hoisted_1$6);
|
|
641
|
-
};
|
|
642
|
-
}
|
|
643
|
-
});
|
|
644
|
-
//#endregion
|
|
645
|
-
//#region src/Chat/ChatSystemMessage.vue
|
|
646
|
-
const _hoisted_1$5 = { class: "astryx-chat-system-message__content" };
|
|
647
|
-
const _hoisted_2$3 = {
|
|
648
|
-
key: 0,
|
|
649
|
-
class: "astryx-chat-system-message__icon"
|
|
650
|
-
};
|
|
651
|
-
const _sfc_main$5 = /*@__PURE__*/ defineComponent({
|
|
652
|
-
name: "AstryxChatSystemMessage",
|
|
653
|
-
inheritAttrs: false,
|
|
654
|
-
__name: "ChatSystemMessage",
|
|
655
|
-
props: { variant: { default: "default" } },
|
|
656
|
-
setup(__props) {
|
|
657
|
-
return (_ctx, _cache) => {
|
|
658
|
-
return __props.variant === "divider" ? (openBlock(), createElementBlock("div", mergeProps({ key: 0 }, _ctx.$attrs, {
|
|
659
|
-
class: "astryx-chat-system-message",
|
|
660
|
-
"data-variant": "divider",
|
|
661
|
-
role: "status"
|
|
662
|
-
}), [createVNode(_sfc_main$19, null, {
|
|
663
|
-
label: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
664
|
-
_: 3
|
|
665
|
-
})], 16)) : (openBlock(), createElementBlock("div", mergeProps({ key: 1 }, _ctx.$attrs, {
|
|
666
|
-
class: "astryx-chat-system-message",
|
|
667
|
-
"data-variant": "default",
|
|
668
|
-
role: "status"
|
|
669
|
-
}), [createElementVNode("span", _hoisted_1$5, [_ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_2$3, [renderSlot(_ctx.$slots, "icon")])) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default")])], 16));
|
|
670
|
-
};
|
|
671
|
-
}
|
|
672
|
-
});
|
|
673
|
-
//#endregion
|
|
674
|
-
//#region src/Chat/ChatStatusMark.vue
|
|
675
|
-
const _hoisted_1$4 = ["data-status", "title"];
|
|
676
|
-
const _sfc_main$4 = /*@__PURE__*/ defineComponent({
|
|
677
|
-
__name: "ChatStatusMark",
|
|
678
|
-
props: {
|
|
679
|
-
status: {},
|
|
680
|
-
errorMessage: {}
|
|
681
|
-
},
|
|
682
|
-
setup(__props) {
|
|
683
|
-
const props = __props;
|
|
684
|
-
const messages = useAstryxMessages();
|
|
685
|
-
const label = computed(() => {
|
|
686
|
-
const chat = messages.value.chat;
|
|
687
|
-
if (props.status === "pending") return chat.toolPending;
|
|
688
|
-
if (props.status === "running") return chat.toolRunning;
|
|
689
|
-
if (props.status === "error") return props.errorMessage ? chat.toolError(props.errorMessage) : chat.statusFailed;
|
|
690
|
-
return chat.statusSent;
|
|
691
|
-
});
|
|
692
|
-
return (_ctx, _cache) => {
|
|
693
|
-
return openBlock(), createElementBlock("span", {
|
|
694
|
-
class: "astryx-chat-status",
|
|
695
|
-
"data-status": __props.status,
|
|
696
|
-
title: __props.status === "error" ? __props.errorMessage : void 0
|
|
697
|
-
}, [__props.status === "pending" || __props.status === "running" ? (openBlock(), createBlock(_sfc_main$18, {
|
|
698
|
-
key: 0,
|
|
699
|
-
size: "sm",
|
|
700
|
-
shade: "inherit",
|
|
701
|
-
"aria-label": label.value
|
|
702
|
-
}, null, 8, ["aria-label"])) : __props.status === "complete" ? (openBlock(), createBlock(_sfc_main$8, {
|
|
703
|
-
key: 1,
|
|
704
|
-
name: "circle-check",
|
|
705
|
-
size: "xsm"
|
|
706
|
-
})) : (openBlock(), createBlock(_sfc_main$8, {
|
|
707
|
-
key: 2,
|
|
708
|
-
name: "circle-x",
|
|
709
|
-
size: "xsm"
|
|
710
|
-
})), __props.status !== "pending" && __props.status !== "running" ? (openBlock(), createBlock(_sfc_main$14, { key: 3 }, {
|
|
711
|
-
default: withCtx(() => [createTextVNode(toDisplayString(label.value), 1)]),
|
|
712
|
-
_: 1
|
|
713
|
-
})) : createCommentVNode("v-if", true)], 8, _hoisted_1$4);
|
|
714
|
-
};
|
|
715
|
-
}
|
|
716
|
-
});
|
|
717
|
-
//#endregion
|
|
718
|
-
//#region src/Chat/ChatToolCallRow.vue
|
|
719
|
-
const _hoisted_1$3 = { class: "astryx-chat-tool-calls__entry" };
|
|
720
|
-
const _hoisted_2$2 = ["aria-expanded", "aria-controls"];
|
|
721
|
-
const _hoisted_3$1 = { class: "astryx-chat-tool-calls__name" };
|
|
722
|
-
const _hoisted_4$1 = {
|
|
723
|
-
key: 1,
|
|
724
|
-
class: "astryx-chat-tool-calls__target"
|
|
725
|
-
};
|
|
726
|
-
const _hoisted_5$1 = {
|
|
727
|
-
key: 2,
|
|
728
|
-
class: "astryx-chat-tool-calls__stats"
|
|
729
|
-
};
|
|
730
|
-
const _hoisted_6$1 = {
|
|
731
|
-
key: 0,
|
|
732
|
-
class: "astryx-chat-tool-calls__additions"
|
|
733
|
-
};
|
|
734
|
-
const _hoisted_7$1 = {
|
|
735
|
-
key: 1,
|
|
736
|
-
class: "astryx-chat-tool-calls__deletions"
|
|
737
|
-
};
|
|
738
|
-
const _hoisted_8$1 = { key: 2 };
|
|
739
|
-
const _hoisted_9$1 = {
|
|
740
|
-
key: 3,
|
|
741
|
-
class: "astryx-chat-tool-calls__duration"
|
|
742
|
-
};
|
|
743
|
-
const _hoisted_10$1 = ["data-open"];
|
|
744
|
-
const _hoisted_11 = {
|
|
745
|
-
key: 1,
|
|
746
|
-
class: "astryx-chat-tool-calls__row"
|
|
747
|
-
};
|
|
748
|
-
const _hoisted_12 = { class: "astryx-chat-tool-calls__name" };
|
|
749
|
-
const _hoisted_13 = {
|
|
750
|
-
key: 1,
|
|
751
|
-
class: "astryx-chat-tool-calls__target"
|
|
752
|
-
};
|
|
753
|
-
const _hoisted_14 = {
|
|
754
|
-
key: 2,
|
|
755
|
-
class: "astryx-chat-tool-calls__stats"
|
|
756
|
-
};
|
|
757
|
-
const _hoisted_15 = {
|
|
758
|
-
key: 0,
|
|
759
|
-
class: "astryx-chat-tool-calls__additions"
|
|
760
|
-
};
|
|
761
|
-
const _hoisted_16 = {
|
|
762
|
-
key: 1,
|
|
763
|
-
class: "astryx-chat-tool-calls__deletions"
|
|
764
|
-
};
|
|
765
|
-
const _hoisted_17 = { key: 2 };
|
|
766
|
-
const _hoisted_18 = {
|
|
767
|
-
key: 3,
|
|
768
|
-
class: "astryx-chat-tool-calls__duration"
|
|
769
|
-
};
|
|
770
|
-
const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
771
|
-
__name: "ChatToolCallRow",
|
|
772
|
-
props: {
|
|
773
|
-
call: {},
|
|
774
|
-
expandable: { type: Boolean }
|
|
775
|
-
},
|
|
776
|
-
setup(__props) {
|
|
777
|
-
const props = __props;
|
|
778
|
-
const isDetailOpen = ref(false);
|
|
779
|
-
const detailId = `astryx-chat-tool-detail-${useId()}`;
|
|
780
|
-
const status = computed(() => props.call.status ?? "complete");
|
|
781
|
-
function toggle() {
|
|
782
|
-
isDetailOpen.value = !isDetailOpen.value;
|
|
783
|
-
}
|
|
784
|
-
return (_ctx, _cache) => {
|
|
785
|
-
return openBlock(), createElementBlock("div", _hoisted_1$3, [__props.expandable ? (openBlock(), createElementBlock("button", {
|
|
786
|
-
key: 0,
|
|
787
|
-
type: "button",
|
|
788
|
-
class: "astryx-chat-tool-calls__row",
|
|
789
|
-
"data-expandable": "",
|
|
790
|
-
"aria-expanded": isDetailOpen.value,
|
|
791
|
-
"aria-controls": isDetailOpen.value ? detailId : void 0,
|
|
792
|
-
onClick: toggle
|
|
793
|
-
}, [
|
|
794
|
-
createVNode(_sfc_main$4, {
|
|
795
|
-
status: status.value,
|
|
796
|
-
"error-message": __props.call.errorMessage
|
|
797
|
-
}, null, 8, ["status", "error-message"]),
|
|
798
|
-
createElementVNode("span", _hoisted_3$1, toDisplayString(__props.call.name), 1),
|
|
799
|
-
__props.call.node ? (openBlock(), createBlock(_sfc_main$16, {
|
|
800
|
-
key: 0,
|
|
801
|
-
class: "astryx-chat-tool-calls__node",
|
|
802
|
-
variant: "neutral"
|
|
803
|
-
}, {
|
|
804
|
-
default: withCtx(() => [createTextVNode(toDisplayString(__props.call.node), 1)]),
|
|
805
|
-
_: 1
|
|
806
|
-
})) : createCommentVNode("v-if", true),
|
|
807
|
-
__props.call.target ? (openBlock(), createElementBlock("span", _hoisted_4$1, toDisplayString(__props.call.target), 1)) : createCommentVNode("v-if", true),
|
|
808
|
-
__props.call.additions != null || __props.call.deletions != null || __props.call.stats ? (openBlock(), createElementBlock("span", _hoisted_5$1, [
|
|
809
|
-
__props.call.additions != null ? (openBlock(), createElementBlock("span", _hoisted_6$1, "+" + toDisplayString(__props.call.additions), 1)) : createCommentVNode("v-if", true),
|
|
810
|
-
__props.call.deletions != null ? (openBlock(), createElementBlock("span", _hoisted_7$1, "-" + toDisplayString(__props.call.deletions), 1)) : createCommentVNode("v-if", true),
|
|
811
|
-
__props.call.stats ? (openBlock(), createElementBlock("span", _hoisted_8$1, toDisplayString(__props.call.stats), 1)) : createCommentVNode("v-if", true)
|
|
812
|
-
])) : createCommentVNode("v-if", true),
|
|
813
|
-
__props.call.duration && status.value === "complete" ? (openBlock(), createElementBlock("span", _hoisted_9$1, toDisplayString(__props.call.duration), 1)) : createCommentVNode("v-if", true),
|
|
814
|
-
createElementVNode("span", {
|
|
815
|
-
class: "astryx-chat-tool-calls__chevron",
|
|
816
|
-
"data-open": isDetailOpen.value || void 0
|
|
817
|
-
}, [createVNode(_sfc_main$17, {
|
|
818
|
-
icon: "chevronDown",
|
|
819
|
-
size: "xsm",
|
|
820
|
-
color: "inherit"
|
|
821
|
-
})], 8, _hoisted_10$1)
|
|
822
|
-
], 8, _hoisted_2$2)) : (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
823
|
-
createVNode(_sfc_main$4, {
|
|
824
|
-
status: status.value,
|
|
825
|
-
"error-message": __props.call.errorMessage
|
|
826
|
-
}, null, 8, ["status", "error-message"]),
|
|
827
|
-
createElementVNode("span", _hoisted_12, toDisplayString(__props.call.name), 1),
|
|
828
|
-
__props.call.node ? (openBlock(), createBlock(_sfc_main$16, {
|
|
829
|
-
key: 0,
|
|
830
|
-
class: "astryx-chat-tool-calls__node",
|
|
831
|
-
variant: "neutral"
|
|
832
|
-
}, {
|
|
833
|
-
default: withCtx(() => [createTextVNode(toDisplayString(__props.call.node), 1)]),
|
|
834
|
-
_: 1
|
|
835
|
-
})) : createCommentVNode("v-if", true),
|
|
836
|
-
__props.call.target ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(__props.call.target), 1)) : createCommentVNode("v-if", true),
|
|
837
|
-
__props.call.additions != null || __props.call.deletions != null || __props.call.stats ? (openBlock(), createElementBlock("span", _hoisted_14, [
|
|
838
|
-
__props.call.additions != null ? (openBlock(), createElementBlock("span", _hoisted_15, "+" + toDisplayString(__props.call.additions), 1)) : createCommentVNode("v-if", true),
|
|
839
|
-
__props.call.deletions != null ? (openBlock(), createElementBlock("span", _hoisted_16, "-" + toDisplayString(__props.call.deletions), 1)) : createCommentVNode("v-if", true),
|
|
840
|
-
__props.call.stats ? (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(__props.call.stats), 1)) : createCommentVNode("v-if", true)
|
|
841
|
-
])) : createCommentVNode("v-if", true),
|
|
842
|
-
__props.call.duration && status.value === "complete" ? (openBlock(), createElementBlock("span", _hoisted_18, toDisplayString(__props.call.duration), 1)) : createCommentVNode("v-if", true)
|
|
843
|
-
])), __props.expandable && isDetailOpen.value ? (openBlock(), createElementBlock("div", {
|
|
844
|
-
key: 2,
|
|
845
|
-
id: detailId,
|
|
846
|
-
class: "astryx-chat-tool-calls__detail"
|
|
847
|
-
}, [renderSlot(_ctx.$slots, "detail")])) : createCommentVNode("v-if", true)]);
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
});
|
|
851
|
-
//#endregion
|
|
852
|
-
//#region src/Chat/ChatToolCalls.vue
|
|
853
|
-
const _hoisted_1$2 = ["aria-expanded"];
|
|
854
|
-
const _hoisted_2$1 = { class: "astryx-chat-tool-calls__group-icon" };
|
|
855
|
-
const _hoisted_3 = { class: "astryx-chat-tool-calls__group-label" };
|
|
856
|
-
const _hoisted_4 = { class: "astryx-chat-tool-calls__name" };
|
|
857
|
-
const _hoisted_5 = {
|
|
858
|
-
key: 0,
|
|
859
|
-
class: "astryx-chat-tool-calls__target"
|
|
860
|
-
};
|
|
861
|
-
const _hoisted_6 = { class: "astryx-chat-tool-calls__count" };
|
|
862
|
-
const _hoisted_7 = ["data-open"];
|
|
863
|
-
const _hoisted_8 = ["data-open", "inert"];
|
|
864
|
-
const _hoisted_9 = { class: "astryx-chat-tool-calls__panel-inner" };
|
|
865
|
-
const _hoisted_10 = { class: "astryx-chat-tool-calls__list" };
|
|
866
|
-
const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
867
|
-
name: "AstryxChatToolCalls",
|
|
868
|
-
inheritAttrs: false,
|
|
869
|
-
__name: "ChatToolCalls",
|
|
870
|
-
props: /*@__PURE__*/ mergeModels({
|
|
871
|
-
calls: {},
|
|
872
|
-
label: {},
|
|
873
|
-
defaultIsExpanded: {
|
|
874
|
-
type: Boolean,
|
|
875
|
-
default: false
|
|
876
|
-
}
|
|
877
|
-
}, {
|
|
878
|
-
"isExpanded": {
|
|
879
|
-
type: Boolean,
|
|
880
|
-
default: void 0
|
|
881
|
-
},
|
|
882
|
-
"isExpandedModifiers": {}
|
|
883
|
-
}),
|
|
884
|
-
emits: /*@__PURE__*/ mergeModels(["expandedChange"], ["update:isExpanded"]),
|
|
885
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
886
|
-
const props = __props;
|
|
887
|
-
const emit = __emit;
|
|
888
|
-
const slots = useSlots();
|
|
889
|
-
const messages = useAstryxMessages();
|
|
890
|
-
const model = useModel(__props, "isExpanded");
|
|
891
|
-
const internalExpanded = ref(props.defaultIsExpanded);
|
|
892
|
-
const isExpanded = computed(() => model.value ?? internalExpanded.value);
|
|
893
|
-
const contentId = `astryx-chat-tool-calls-${useId()}`;
|
|
894
|
-
const root = useTemplateRef("root");
|
|
895
|
-
const summary = computed(() => props.label ?? messages.value.chat.toolGroup(props.calls.length));
|
|
896
|
-
const latest = computed(() => props.calls[props.calls.length - 1]);
|
|
897
|
-
const single = computed(() => props.calls.length === 1 ? props.calls[0] : void 0);
|
|
898
|
-
function toggle() {
|
|
899
|
-
const next = !isExpanded.value;
|
|
900
|
-
internalExpanded.value = next;
|
|
901
|
-
model.value = next;
|
|
902
|
-
emit("expandedChange", next);
|
|
903
|
-
}
|
|
904
|
-
function rowKey(call, index) {
|
|
905
|
-
return call.key ?? `${call.name}\u001F${call.target ?? ""}\u001F${call.node ?? ""}\u001F${index}`;
|
|
906
|
-
}
|
|
907
|
-
function expandable(call) {
|
|
908
|
-
return Boolean(call.detail) || Boolean(slots.detail);
|
|
909
|
-
}
|
|
910
|
-
__expose({ element: root });
|
|
911
|
-
return (_ctx, _cache) => {
|
|
912
|
-
return __props.calls.length ? (openBlock(), createElementBlock("div", mergeProps({
|
|
913
|
-
key: 0,
|
|
914
|
-
ref_key: "root",
|
|
915
|
-
ref: root
|
|
916
|
-
}, _ctx.$attrs, { class: "astryx-chat-tool-calls" }), [single.value ? (openBlock(), createBlock(_sfc_main$3, {
|
|
917
|
-
key: 0,
|
|
918
|
-
call: single.value,
|
|
919
|
-
expandable: expandable(single.value)
|
|
920
|
-
}, createSlots({ _: 2 }, [expandable(single.value) ? {
|
|
921
|
-
name: "detail",
|
|
922
|
-
fn: withCtx(() => [renderSlot(_ctx.$slots, "detail", { call: single.value }, () => [createTextVNode(toDisplayString(single.value.detail), 1)])]),
|
|
923
|
-
key: "0"
|
|
924
|
-
} : void 0]), 1032, ["call", "expandable"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("button", {
|
|
925
|
-
type: "button",
|
|
926
|
-
class: "astryx-chat-tool-calls__row",
|
|
927
|
-
"aria-expanded": isExpanded.value,
|
|
928
|
-
"aria-controls": contentId,
|
|
929
|
-
onClick: toggle
|
|
930
|
-
}, [
|
|
931
|
-
isExpanded.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$1, [createVNode(_sfc_main$8, {
|
|
932
|
-
name: "wrench",
|
|
933
|
-
size: "sm"
|
|
934
|
-
})]), createElementVNode("span", _hoisted_3, toDisplayString(summary.value), 1)], 64)) : latest.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
935
|
-
createVNode(_sfc_main$4, {
|
|
936
|
-
status: latest.value.status ?? "complete",
|
|
937
|
-
"error-message": latest.value.errorMessage
|
|
938
|
-
}, null, 8, ["status", "error-message"]),
|
|
939
|
-
createElementVNode("span", _hoisted_4, toDisplayString(latest.value.name), 1),
|
|
940
|
-
latest.value.target ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(latest.value.target), 1)) : createCommentVNode("v-if", true)
|
|
941
|
-
], 64)) : createCommentVNode("v-if", true),
|
|
942
|
-
createElementVNode("span", _hoisted_6, [!isExpanded.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(_sfc_main$8, {
|
|
943
|
-
name: "wrench",
|
|
944
|
-
size: "xsm"
|
|
945
|
-
}), createTextVNode(" " + toDisplayString(__props.calls.length), 1)], 64)) : createCommentVNode("v-if", true)]),
|
|
946
|
-
createElementVNode("span", {
|
|
947
|
-
class: "astryx-chat-tool-calls__chevron",
|
|
948
|
-
"data-open": isExpanded.value || void 0
|
|
949
|
-
}, [createVNode(_sfc_main$17, {
|
|
950
|
-
icon: "chevronDown",
|
|
951
|
-
size: "xsm",
|
|
952
|
-
color: "inherit"
|
|
953
|
-
})], 8, _hoisted_7)
|
|
954
|
-
], 8, _hoisted_1$2), createElementVNode("div", {
|
|
955
|
-
id: contentId,
|
|
956
|
-
class: "astryx-chat-tool-calls__panel",
|
|
957
|
-
"data-open": isExpanded.value || void 0,
|
|
958
|
-
inert: !isExpanded.value
|
|
959
|
-
}, [createElementVNode("div", _hoisted_9, [createElementVNode("div", _hoisted_10, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.calls, (call, index) => {
|
|
960
|
-
return openBlock(), createBlock(_sfc_main$3, {
|
|
961
|
-
key: rowKey(call, index),
|
|
962
|
-
call,
|
|
963
|
-
expandable: expandable(call)
|
|
964
|
-
}, createSlots({ _: 2 }, [expandable(call) ? {
|
|
965
|
-
name: "detail",
|
|
966
|
-
fn: withCtx(() => [renderSlot(_ctx.$slots, "detail", { call }, () => [createTextVNode(toDisplayString(call.detail), 1)])]),
|
|
967
|
-
key: "0"
|
|
968
|
-
} : void 0]), 1032, ["call", "expandable"]);
|
|
969
|
-
}), 128))])])], 8, _hoisted_8)], 64))], 16)) : createCommentVNode("v-if", true);
|
|
970
|
-
};
|
|
971
|
-
}
|
|
972
|
-
});
|
|
973
|
-
//#endregion
|
|
974
|
-
//#region src/Chat/ChatTypingIndicator.vue
|
|
975
|
-
const _hoisted_1$1 = {
|
|
976
|
-
key: 0,
|
|
977
|
-
class: "astryx-chat-typing__label"
|
|
978
|
-
};
|
|
979
|
-
const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
980
|
-
name: "AstryxChatTypingIndicator",
|
|
981
|
-
inheritAttrs: false,
|
|
982
|
-
__name: "ChatTypingIndicator",
|
|
983
|
-
props: { names: {} },
|
|
984
|
-
setup(__props, { expose: __expose }) {
|
|
985
|
-
const props = __props;
|
|
986
|
-
const messages = useAstryxMessages();
|
|
987
|
-
const root = useTemplateRef("root");
|
|
988
|
-
const label = computed(() => {
|
|
989
|
-
const names = props.names?.filter((name) => name.trim() !== "") ?? [];
|
|
990
|
-
const chat = messages.value.chat;
|
|
991
|
-
if (names.length === 0) return null;
|
|
992
|
-
if (names.length === 1) return chat.typingOne(names[0]);
|
|
993
|
-
if (names.length === 2) return chat.typingTwo(names[0], names[1]);
|
|
994
|
-
return chat.typingMany(names[0], names.length - 1);
|
|
995
|
-
});
|
|
996
|
-
__expose({ element: root });
|
|
997
|
-
return (_ctx, _cache) => {
|
|
998
|
-
return openBlock(), createElementBlock("div", mergeProps({
|
|
999
|
-
ref_key: "root",
|
|
1000
|
-
ref: root
|
|
1001
|
-
}, _ctx.$attrs, {
|
|
1002
|
-
class: "astryx-chat-typing",
|
|
1003
|
-
role: "status",
|
|
1004
|
-
"aria-live": "polite"
|
|
1005
|
-
}), [_cache[0] || (_cache[0] = createElementVNode("span", {
|
|
1006
|
-
class: "astryx-chat-typing__dots",
|
|
1007
|
-
"aria-hidden": "true"
|
|
1008
|
-
}, [
|
|
1009
|
-
createElementVNode("span", { class: "astryx-chat-typing__dot" }),
|
|
1010
|
-
createElementVNode("span", {
|
|
1011
|
-
class: "astryx-chat-typing__dot",
|
|
1012
|
-
"data-index": "2"
|
|
1013
|
-
}),
|
|
1014
|
-
createElementVNode("span", {
|
|
1015
|
-
class: "astryx-chat-typing__dot",
|
|
1016
|
-
"data-index": "3"
|
|
1017
|
-
})
|
|
1018
|
-
], -1)), label.value ? (openBlock(), createElementBlock("span", _hoisted_1$1, toDisplayString(label.value), 1)) : createCommentVNode("v-if", true)], 16);
|
|
1019
|
-
};
|
|
1020
|
-
}
|
|
1021
|
-
});
|
|
1022
|
-
//#endregion
|
|
1023
|
-
//#region src/Chat/ChatUnreadDivider.vue
|
|
1024
|
-
const _hoisted_1 = ["aria-label"];
|
|
1025
|
-
const _hoisted_2 = { class: "astryx-chat-unread__label" };
|
|
1026
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
1027
|
-
name: "AstryxChatUnreadDivider",
|
|
1028
|
-
inheritAttrs: false,
|
|
1029
|
-
__name: "ChatUnreadDivider",
|
|
1030
|
-
props: { label: {} },
|
|
1031
|
-
setup(__props, { expose: __expose }) {
|
|
1032
|
-
const props = __props;
|
|
1033
|
-
const messages = useAstryxMessages();
|
|
1034
|
-
const root = useTemplateRef("root");
|
|
1035
|
-
const text = computed(() => props.label ?? messages.value.chat.unreadLabel);
|
|
1036
|
-
const accessibleName = computed(() => messages.value.chat.unreadBelow(text.value));
|
|
1037
|
-
__expose({ element: root });
|
|
1038
|
-
return (_ctx, _cache) => {
|
|
1039
|
-
return openBlock(), createElementBlock("div", mergeProps({
|
|
1040
|
-
ref_key: "root",
|
|
1041
|
-
ref: root
|
|
1042
|
-
}, _ctx.$attrs, {
|
|
1043
|
-
class: "astryx-chat-unread",
|
|
1044
|
-
role: "separator",
|
|
1045
|
-
"aria-label": accessibleName.value
|
|
1046
|
-
}), [_cache[0] || (_cache[0] = createElementVNode("span", { class: "astryx-chat-unread__line" }, null, -1)), createElementVNode("span", _hoisted_2, toDisplayString(text.value), 1)], 16, _hoisted_1);
|
|
1047
|
-
};
|
|
1048
|
-
}
|
|
1049
|
-
});
|
|
1050
|
-
//#endregion
|
|
1051
|
-
export { _sfc_main$6 as a, _sfc_main$10 as c, useChatLayoutContext as d, useChatListContext as f, _sfc_main$5 as i, _sfc_main$11 as l, _sfc_main$13 as m, _sfc_main$1 as n, _sfc_main$7 as o, useChatMessageContext as p, _sfc_main$2 as r, _sfc_main$9 as s, _sfc_main as t, _sfc_main$12 as u };
|