@turquoisehealth/pit-viper 2.266.1-dev.1 → 2.267.0
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/_site/assets/css/pit-viper-a11y-v3.css +12 -0
- package/_site/assets/css/pit-viper-a11y.css +12 -0
- package/_site/assets/css/pit-viper-consumer.css +12 -0
- package/_site/assets/css/pit-viper-v2-scoped.css +10 -0
- package/_site/assets/css/pit-viper-v2.css +12 -0
- package/_site/assets/css/pit-viper-v3.css +12 -0
- package/_site/assets/css/pit-viper.css +12 -0
- package/_site/manifest.json +2 -2
- package/package.json +1 -1
- package/pv-components/dist/stats/vue/ai/stats.html +1 -1
- package/pv-components/dist/stats/vue/base/stats.html +1 -1
- package/pv-components/dist/stats/vue/visualizations/stats.html +1 -1
- package/pv-components/dist/stats/web/pv-action-button-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-file-input-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-filter-modal-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-filter-panel-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-hover-action-menu-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-menu-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-multi-select-button-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-popover-v2-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-prompt-input-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-query-builder-input-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-question-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-segmented-control-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-select-button-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-sidebar-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-sidebar-v2-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-sortable-list-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-split-button-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-suggestion-tag-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-tabs-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-toggle-group-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-tooltip-v2-stats.html +1 -1
- package/pv-components/dist/vue/ai/components/ai/PvPromptInput/PvPromptInput.vue.d.ts +4 -0
- package/pv-components/dist/vue/ai/components/ai/PvPromptInput/types.d.ts +12 -0
- package/pv-components/dist/vue/ai/components/ai/PvQuestion/types.d.ts +4 -0
- package/pv-components/dist/vue/ai/components/base/PvFileInput/PvFileInput.vue.d.ts +3 -0
- package/pv-components/dist/vue/ai/components/base/PvMultiSelectButton/PvMultiSelectButton.vue.d.ts +0 -4
- package/pv-components/dist/vue/ai/components/base/PvMultiSelectButton/types.d.ts +0 -2
- package/pv-components/dist/vue/ai/components/base/PvPopoverV2/PvPopoverV2.vue.d.ts +1 -1
- package/pv-components/dist/vue/ai/components/base/PvRange/PvRange.vue.d.ts +2 -2
- package/pv-components/dist/vue/ai/components/base/PvSuggestionTag/PvSuggestionTag.vue.d.ts +5 -0
- package/pv-components/dist/vue/ai/components/base/PvTooltip/PvTooltip.vue.d.ts +1 -1
- package/pv-components/dist/vue/ai/components/base/PvTooltipV2/PvTooltipV2.vue.d.ts +1 -1
- package/pv-components/dist/vue/ai/pv-components-ai.mjs +494 -325
- package/pv-components/dist/vue/ai/pv-components-ai.mjs.map +1 -1
- package/pv-components/dist/vue/base/components/base/PvFileInput/PvFileInput.vue.d.ts +3 -0
- package/pv-components/dist/vue/base/components/base/PvMultiSelectButton/PvMultiSelectButton.vue.d.ts +0 -4
- package/pv-components/dist/vue/base/components/base/PvMultiSelectButton/types.d.ts +0 -2
- package/pv-components/dist/vue/base/components/base/PvSuggestionTag/PvSuggestionTag.vue.d.ts +5 -0
- package/pv-components/dist/vue/base/pv-components-base.mjs +1111 -1118
- package/pv-components/dist/vue/base/pv-components-base.mjs.map +1 -1
- package/pv-components/dist/vue/visualizations/components/base/PvFileInput/PvFileInput.vue.d.ts +3 -0
- package/pv-components/dist/vue/visualizations/components/base/PvMultiSelectButton/PvMultiSelectButton.vue.d.ts +0 -4
- package/pv-components/dist/vue/visualizations/components/base/PvMultiSelectButton/types.d.ts +0 -2
- package/pv-components/dist/vue/visualizations/components/base/PvSuggestionTag/PvSuggestionTag.vue.d.ts +5 -0
- package/pv-components/dist/vue/visualizations/components/tables/PvDataTable/types.d.ts +0 -7
- package/pv-components/dist/vue/visualizations/pv-components-visualizations.mjs +1020 -1064
- package/pv-components/dist/vue/visualizations/pv-components-visualizations.mjs.map +1 -1
- package/pv-components/dist/web/components/pv-action-button/pv-action-button.js +307 -323
- package/pv-components/dist/web/components/pv-file-input/pv-file-input.js +158 -151
- package/pv-components/dist/web/components/pv-filter-modal/pv-filter-modal.js +3 -20
- package/pv-components/dist/web/components/pv-filter-panel/pv-filter-panel.js +877 -887
- package/pv-components/dist/web/components/pv-hover-action-menu/pv-hover-action-menu.js +2 -18
- package/pv-components/dist/web/components/pv-menu/pv-menu.js +2 -18
- package/pv-components/dist/web/components/pv-multi-select-button/pv-multi-select-button.js +3 -20
- package/pv-components/dist/web/components/pv-popover-v2/pv-popover-v2.js +406 -422
- package/pv-components/dist/web/components/pv-prompt-input/pv-prompt-input.js +834 -572
- package/pv-components/dist/web/components/pv-query-builder-input/pv-query-builder-input.js +2 -18
- package/pv-components/dist/web/components/pv-question/pv-question.js +387 -373
- package/pv-components/dist/web/components/pv-segmented-control/pv-segmented-control.js +460 -476
- package/pv-components/dist/web/components/pv-select-button/pv-select-button.js +330 -346
- package/pv-components/dist/web/components/pv-sidebar/pv-sidebar.js +2 -18
- package/pv-components/dist/web/components/pv-sidebar-v2/pv-sidebar-v2.js +2 -18
- package/pv-components/dist/web/components/pv-sortable-list/pv-sortable-list.js +244 -260
- package/pv-components/dist/web/components/pv-split-button/pv-split-button.js +573 -589
- package/pv-components/dist/web/components/pv-suggestion-tag/pv-suggestion-tag.js +382 -376
- package/pv-components/dist/web/components/pv-tabs/pv-tabs.js +672 -688
- package/pv-components/dist/web/components/pv-toggle-group/pv-toggle-group.js +414 -430
- package/pv-components/dist/web/components/pv-tooltip-v2/pv-tooltip-v2.js +608 -624
- package/pv-components/dist/web/pv-components.iife.js +39 -39
- package/pv-components/dist/web/pv-components.iife.js.map +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.pv-badge-md[data-v-3def68cb]{--inset-size:2px 2px;min-width:20px;min-height:20px;max-height:20px;font-weight:500}.pv-badge-sm[data-v-3def68cb]{--inset-size:0 2px;min-width:16px;min-height:16px;max-height:16px;font-weight:500}.pv-rounded[data-v-3def68cb]{border-radius:50%}.input-icon-position{pointer-events:none;position:absolute;top:8px;left:12px}summary[data-v-dfa0b416]{background-image:none;padding-right:2px}
|
|
2
|
-
/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import { Comment as e, Fragment as t, Text as n, TransitionGroup as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, getCurrentInstance as f,
|
|
2
|
+
/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import { Comment as e, Fragment as t, Text as n, TransitionGroup as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, getCurrentInstance as f, guardReactiveProps as p, mergeModels as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeProps as v, normalizeStyle as y, onBeforeUnmount as b, onBeforeUpdate as x, onMounted as S, onScopeDispose as C, openBlock as w, ref as T, renderList as E, renderSlot as D, toDisplayString as O, toHandlers as k, unref as A, useId as j, useModel as M, useSlots as N, useTemplateRef as P, vModelDynamic as F, vModelText as I, vShow as L, watch as R, withCtx as z, withDirectives as B, withKeys as ee, withModifiers as V } from "vue";
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region src/components/base/PvSpinner/PvSpinner.vue
|
|
5
|
-
var
|
|
5
|
+
var te = /* @__PURE__ */ d({
|
|
6
6
|
__name: "PvSpinner",
|
|
7
7
|
props: {
|
|
8
8
|
size: { default: "lg" },
|
|
@@ -20,26 +20,26 @@ var z = /* @__PURE__ */ d({
|
|
|
20
20
|
dark: "pv-spinner-dark",
|
|
21
21
|
white: "pv-spinner-light"
|
|
22
22
|
};
|
|
23
|
-
return (r, i) => (
|
|
23
|
+
return (r, i) => (w(), s("div", {
|
|
24
24
|
"data-testid": "pv-spinner",
|
|
25
|
-
class:
|
|
26
|
-
style:
|
|
25
|
+
class: _(n[e.variant]),
|
|
26
|
+
style: y({ "--size": t[e.size] })
|
|
27
27
|
}, null, 6));
|
|
28
28
|
}
|
|
29
|
-
}),
|
|
29
|
+
}), ne = ["ghost"], H = {
|
|
30
30
|
md: "pv-button-small",
|
|
31
31
|
lg: void 0,
|
|
32
32
|
xl: "pv-button-large"
|
|
33
|
-
},
|
|
33
|
+
}, re = (e) => e == null || !H.hasOwnProperty(e) ? null : H[e] || null;
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/web-components/utils.ts
|
|
36
36
|
function U() {
|
|
37
|
-
let e =
|
|
37
|
+
let e = T(!1), t = f()?.root || {};
|
|
38
38
|
return "isCE" in t && t.isCE === !0 && (e.value = !0), e;
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/components/base/baseProps.ts
|
|
42
|
-
var
|
|
42
|
+
var ie = [
|
|
43
43
|
void 0,
|
|
44
44
|
10,
|
|
45
45
|
12,
|
|
@@ -48,24 +48,24 @@ var ee = [
|
|
|
48
48
|
24,
|
|
49
49
|
32,
|
|
50
50
|
64
|
|
51
|
-
],
|
|
51
|
+
], ae = ["xlink:href"], W = /* @__PURE__ */ d({
|
|
52
52
|
__name: "PvIcon",
|
|
53
53
|
props: {
|
|
54
54
|
name: {},
|
|
55
55
|
size: {}
|
|
56
56
|
},
|
|
57
57
|
setup(e) {
|
|
58
|
-
let t = e, n = U(), r =
|
|
58
|
+
let t = e, n = U(), r = T(null), a = i(() => ({
|
|
59
59
|
"pv-icon": !0,
|
|
60
|
-
[`pv-icon-${t.size}`]: t.size != null &&
|
|
60
|
+
[`pv-icon-${t.size}`]: t.size != null && ie.includes(t.size)
|
|
61
61
|
})), o = i(() => n.value && r.value ? `${r.value}#${t.name}` : `#${t.name}`);
|
|
62
|
-
return globalThis.__PV_GLOBAL_SPRITE_PATH__ && (r.value = globalThis.__PV_GLOBAL_SPRITE_PATH__), (e, t) => (
|
|
62
|
+
return globalThis.__PV_GLOBAL_SPRITE_PATH__ && (r.value = globalThis.__PV_GLOBAL_SPRITE_PATH__), (e, t) => (w(), s("svg", {
|
|
63
63
|
"data-testid": "pv-icon",
|
|
64
64
|
"aria-hidden": "true",
|
|
65
|
-
class:
|
|
66
|
-
}, [c("use", { "xlink:href": o.value }, null, 8,
|
|
65
|
+
class: _(a.value)
|
|
66
|
+
}, [c("use", { "xlink:href": o.value }, null, 8, ae)], 2));
|
|
67
67
|
}
|
|
68
|
-
}),
|
|
68
|
+
}), oe = /* @__PURE__ */ d({
|
|
69
69
|
__name: "PvCounterBadge",
|
|
70
70
|
props: {
|
|
71
71
|
maxValue: { default: 99 },
|
|
@@ -87,19 +87,19 @@ var ee = [
|
|
|
87
87
|
"pv-surface": t.variant == "ghost",
|
|
88
88
|
"pv-rounded": t.rounded
|
|
89
89
|
}));
|
|
90
|
-
return (e, t) => (
|
|
91
|
-
class:
|
|
90
|
+
return (e, t) => (w(), s("div", {
|
|
91
|
+
class: _(r.value),
|
|
92
92
|
"data-testid": "pv-counter-badge"
|
|
93
|
-
},
|
|
93
|
+
}, O(n.value), 3));
|
|
94
94
|
}
|
|
95
95
|
}), G = (e, t) => {
|
|
96
96
|
let n = e.__vccOpts || e;
|
|
97
97
|
for (let [e, r] of t) n[e] = r;
|
|
98
98
|
return n;
|
|
99
|
-
}, K = /* @__PURE__ */ G(
|
|
99
|
+
}, K = /* @__PURE__ */ G(oe, [["__scopeId", "data-v-3def68cb"]]), q = ["disabled", "aria-label"], se = {
|
|
100
100
|
key: 2,
|
|
101
101
|
"data-testid": "pv-button-label"
|
|
102
|
-
},
|
|
102
|
+
}, J = /* @__PURE__ */ d({
|
|
103
103
|
__name: "PvButton",
|
|
104
104
|
props: {
|
|
105
105
|
variant: { default: "primary" },
|
|
@@ -126,57 +126,57 @@ var ee = [
|
|
|
126
126
|
setup(e) {
|
|
127
127
|
let n = e, r = i(() => !n.label || n.loading ? n.label || n.ariaLabel : void 0), c = i(() => {
|
|
128
128
|
let e = [];
|
|
129
|
-
n.inverse &&
|
|
130
|
-
let t =
|
|
129
|
+
n.inverse && ne.includes(n.variant) ? e.push(`pv-button-${n.variant}-inverse`) : e.push(`pv-button-${n.variant}`);
|
|
130
|
+
let t = re(n.size);
|
|
131
131
|
return t && e.push(t), e;
|
|
132
132
|
});
|
|
133
|
-
return (n, i) => (
|
|
133
|
+
return (n, i) => (w(), s("button", {
|
|
134
134
|
type: "button",
|
|
135
|
-
class:
|
|
135
|
+
class: _(c.value),
|
|
136
136
|
disabled: e.disabled,
|
|
137
137
|
"aria-label": r.value,
|
|
138
138
|
"data-testid": "pv-button"
|
|
139
|
-
}, [e.loading ? (
|
|
139
|
+
}, [e.loading ? (w(), a(te, {
|
|
140
140
|
key: 0,
|
|
141
141
|
size: "sm"
|
|
142
|
-
})) : (
|
|
143
|
-
e.leftCounterBadge ? (
|
|
142
|
+
})) : (w(), s(t, { key: 1 }, [
|
|
143
|
+
e.leftCounterBadge ? (w(), a(K, {
|
|
144
144
|
key: 0,
|
|
145
145
|
value: e.leftCounterBadge,
|
|
146
146
|
variant: "tertiary"
|
|
147
147
|
}, null, 8, ["value"])) : o("", !0),
|
|
148
|
-
e.leftIcon ? (
|
|
148
|
+
e.leftIcon ? (w(), a(W, {
|
|
149
149
|
key: 1,
|
|
150
150
|
name: e.leftIcon,
|
|
151
151
|
"data-testid": "pv-button-left-icon"
|
|
152
152
|
}, null, 8, ["name"])) : o("", !0),
|
|
153
|
-
e.label ? (
|
|
154
|
-
e.rightCounterBadge ? (
|
|
153
|
+
e.label ? (w(), s("span", se, O(e.label), 1)) : o("", !0),
|
|
154
|
+
e.rightCounterBadge ? (w(), a(K, {
|
|
155
155
|
key: 3,
|
|
156
156
|
value: e.rightCounterBadge,
|
|
157
157
|
variant: "tertiary"
|
|
158
158
|
}, null, 8, ["value"])) : o("", !0),
|
|
159
|
-
e.rightIcon ? (
|
|
159
|
+
e.rightIcon ? (w(), a(W, {
|
|
160
160
|
key: 4,
|
|
161
161
|
name: e.rightIcon,
|
|
162
162
|
"data-testid": "pv-button-right-icon"
|
|
163
163
|
}, null, 8, ["name"])) : o("", !0)
|
|
164
|
-
], 64))], 10,
|
|
164
|
+
], 64))], 10, q));
|
|
165
165
|
}
|
|
166
|
-
}),
|
|
166
|
+
}), ce = ["for"], le = {
|
|
167
167
|
key: 0,
|
|
168
168
|
class: "pv-surface-accent pv-inset-square pv-text-body-md pv-radius pv-bordered",
|
|
169
169
|
style: { "--inset-size": "6px 10px" }
|
|
170
|
-
},
|
|
170
|
+
}, ue = { class: "pv-relative pv-flex-item" }, de = [
|
|
171
171
|
"disabled",
|
|
172
172
|
"type",
|
|
173
173
|
"placeholder",
|
|
174
174
|
"id",
|
|
175
175
|
"data-invalid",
|
|
176
176
|
"step"
|
|
177
|
-
],
|
|
177
|
+
], fe = /* @__PURE__ */ d({
|
|
178
178
|
__name: "PvInput",
|
|
179
|
-
props: /* @__PURE__ */
|
|
179
|
+
props: /* @__PURE__ */ m({
|
|
180
180
|
showLabel: { type: Boolean },
|
|
181
181
|
error: { type: Boolean },
|
|
182
182
|
disabled: { type: Boolean },
|
|
@@ -194,19 +194,19 @@ var ee = [
|
|
|
194
194
|
}),
|
|
195
195
|
emits: ["update:modelValue"],
|
|
196
196
|
setup(e) {
|
|
197
|
-
let n = e, r =
|
|
198
|
-
return (n, i) => (
|
|
199
|
-
n.$slots.label || e.showLabel ? (
|
|
197
|
+
let n = e, r = M(e, "modelValue"), l = i(() => n.inputIcon ? { "--inset-size": "8px 12px 6px 36px" } : {});
|
|
198
|
+
return (n, i) => (w(), s(t, null, [
|
|
199
|
+
n.$slots.label || e.showLabel ? (w(), s("label", {
|
|
200
200
|
key: 0,
|
|
201
201
|
"data-testid": "pv-input-label",
|
|
202
202
|
class: "pv-label pv-stack-8",
|
|
203
203
|
for: e.id
|
|
204
|
-
}, [
|
|
205
|
-
c("div", { class:
|
|
204
|
+
}, [D(n.$slots, "label")], 8, ce)) : o("", !0),
|
|
205
|
+
c("div", { class: _(["pv-flex pv-flex-item", { "pv-stack-8": e.lowerLabel }]) }, [e.prefixLabel ? (w(), s("div", le, O(e.prefixLabel), 1)) : o("", !0), c("div", ue, [e.inputIcon ? (w(), a(W, {
|
|
206
206
|
key: 0,
|
|
207
207
|
class: "pv-absolute input-icon-position",
|
|
208
208
|
name: e.inputIcon
|
|
209
|
-
}, null, 8, ["name"])) : o("", !0),
|
|
209
|
+
}, null, 8, ["name"])) : o("", !0), B(c("input", h(n.$attrs, {
|
|
210
210
|
"onUpdate:modelValue": i[0] ||= (e) => r.value = e,
|
|
211
211
|
"data-testid": "pv-input",
|
|
212
212
|
class: ["pv-input-text", {
|
|
@@ -220,57 +220,70 @@ var ee = [
|
|
|
220
220
|
id: e.id,
|
|
221
221
|
"data-invalid": e.error ? !0 : void 0,
|
|
222
222
|
step: e.step
|
|
223
|
-
}), null, 16,
|
|
224
|
-
e.lowerLabel ? (
|
|
223
|
+
}), null, 16, de), [[F, r.value]])])], 2),
|
|
224
|
+
e.lowerLabel ? (w(), s("p", {
|
|
225
225
|
key: 1,
|
|
226
226
|
"data-testid": "pv-input-lower-label",
|
|
227
227
|
style: { "margin-left": "12px" },
|
|
228
|
-
class:
|
|
228
|
+
class: _(["pv-text-body-xs", {
|
|
229
229
|
"pv-text-red": e.error,
|
|
230
230
|
"pv-text-subdued": !e.error
|
|
231
231
|
}])
|
|
232
|
-
},
|
|
232
|
+
}, O(e.lowerLabel), 3)) : o("", !0)
|
|
233
233
|
], 64));
|
|
234
234
|
}
|
|
235
|
-
}),
|
|
235
|
+
}), pe = ["onKeydown"], me = { class: "pv-question-header pv-inset-square-16 pv-space-between" }, he = {
|
|
236
236
|
class: "pv-question-header-copy pv-flex-vertical pv-flex-item",
|
|
237
237
|
style: {
|
|
238
238
|
"--flex-align": "flex-start",
|
|
239
239
|
"--flex-gap": "4px",
|
|
240
240
|
"min-width": "0"
|
|
241
241
|
}
|
|
242
|
-
},
|
|
242
|
+
}, ge = {
|
|
243
243
|
key: 0,
|
|
244
244
|
class: "pv-text-body-md pv-text-tertiary"
|
|
245
|
-
},
|
|
245
|
+
}, _e = { class: "pv-question-header-actions pv-flex" }, ve = {
|
|
246
246
|
key: 0,
|
|
247
247
|
class: "pv-text-body-xs pv-text-tertiary",
|
|
248
248
|
role: "status",
|
|
249
249
|
"aria-live": "polite"
|
|
250
|
-
},
|
|
250
|
+
}, ye = {
|
|
251
251
|
class: "pv-question-body pv-border-bottom",
|
|
252
252
|
style: { "padding-bottom": "2px" }
|
|
253
|
-
},
|
|
253
|
+
}, be = {
|
|
254
254
|
class: "pv-question-options pv-flex-vertical pv-inset-inline-16",
|
|
255
255
|
style: {
|
|
256
256
|
"--flex-align": "stretch",
|
|
257
257
|
"--flex-gap": "2px"
|
|
258
258
|
}
|
|
259
|
-
},
|
|
259
|
+
}, xe = ["aria-activedescendant"], Se = [
|
|
260
260
|
"id",
|
|
261
261
|
"aria-selected",
|
|
262
262
|
"data-active",
|
|
263
263
|
"onClick",
|
|
264
264
|
"onMouseenter"
|
|
265
|
-
],
|
|
265
|
+
], Ce = {
|
|
266
|
+
key: 0,
|
|
267
|
+
class: "pv-flex-item pv-flex-vertical",
|
|
268
|
+
style: {
|
|
269
|
+
"--flex-align": "flex-start",
|
|
270
|
+
"--flex-gap": "2px",
|
|
271
|
+
"min-width": "0"
|
|
272
|
+
}
|
|
273
|
+
}, we = { class: "pv-question-answer-text pv-text-title-md" }, Te = { class: "pv-question-description pv-text-body-sm pv-text-tertiary" }, Ee = {
|
|
274
|
+
key: 1,
|
|
266
275
|
class: "pv-question-answer-text pv-flex-item pv-text-title-md",
|
|
267
276
|
style: { "min-width": "0" }
|
|
268
|
-
},
|
|
277
|
+
}, De = {
|
|
278
|
+
key: 2,
|
|
279
|
+
class: "pv-question-tag pv-tag-highlight",
|
|
280
|
+
"data-style": "rounded"
|
|
281
|
+
}, Oe = ["title"], ke = { class: "pv-visually-hidden" }, Ae = ["data-active"], je = { class: "pv-question-chat-badge pv-flex pv-radius pv-text-subdued" }, Me = {
|
|
269
282
|
class: "pv-question-chat-input pv-flex-item",
|
|
270
283
|
style: { "min-width": "0" }
|
|
271
|
-
},
|
|
284
|
+
}, Ne = { class: "pv-question-footer pv-inset-squish-12 pv-space-between" }, Pe = /* @__PURE__ */ d({
|
|
272
285
|
__name: "PvQuestion",
|
|
273
|
-
props: /* @__PURE__ */
|
|
286
|
+
props: /* @__PURE__ */ m({
|
|
274
287
|
chatInputLabel: { default: "Other answer" },
|
|
275
288
|
chatInputPlaceholder: { default: "Something else..." },
|
|
276
289
|
currentQuestion: { default: 1 },
|
|
@@ -284,18 +297,18 @@ var ee = [
|
|
|
284
297
|
chatInput: { default: "" },
|
|
285
298
|
chatInputModifiers: {}
|
|
286
299
|
}),
|
|
287
|
-
emits: /* @__PURE__ */
|
|
300
|
+
emits: /* @__PURE__ */ m([
|
|
288
301
|
"close",
|
|
289
302
|
"select",
|
|
290
303
|
"skip",
|
|
291
304
|
"submit"
|
|
292
305
|
], ["update:modelValue", "update:chatInput"]),
|
|
293
306
|
setup(e, { emit: n }) {
|
|
294
|
-
let r = e, l = n, d =
|
|
295
|
-
|
|
307
|
+
let r = e, l = n, d = M(e, "modelValue"), f = M(e, "chatInput"), p = j(), m = `${p}-heading`, h = `${p}-keyboard-hint`, _ = T(), v = T(), y = r.options.findIndex((e) => e.id === d.value), b = T(Math.max(y, 0)), x = i(() => r.totalQuestions > 1), S = i(() => b.value < r.options.length ? C(b.value) : void 0);
|
|
308
|
+
R(d, (e) => {
|
|
296
309
|
let t = r.options.findIndex((t) => t.id === e);
|
|
297
310
|
t >= 0 && (b.value = t);
|
|
298
|
-
}),
|
|
311
|
+
}), R(() => r.options.map((e) => e.id), (e, t) => {
|
|
299
312
|
let n = e.findIndex((e) => e === d.value);
|
|
300
313
|
if (n >= 0) {
|
|
301
314
|
b.value = n;
|
|
@@ -308,34 +321,34 @@ var ee = [
|
|
|
308
321
|
let r = t[b.value], i = e.indexOf(r);
|
|
309
322
|
b.value = i >= 0 ? i : Math.min(b.value, Math.max(e.length - 1, 0));
|
|
310
323
|
});
|
|
311
|
-
function
|
|
324
|
+
function C(e) {
|
|
312
325
|
return `${p}-option-${e}`;
|
|
313
326
|
}
|
|
314
|
-
function
|
|
315
|
-
r.options.length && (b.value = e,
|
|
327
|
+
function D(e) {
|
|
328
|
+
r.options.length && (b.value = e, g(() => _.value?.focus()));
|
|
316
329
|
}
|
|
317
|
-
function
|
|
318
|
-
b.value = r.options.length,
|
|
330
|
+
function k() {
|
|
331
|
+
b.value = r.options.length, g(() => v.value?.querySelector("input")?.focus());
|
|
319
332
|
}
|
|
320
|
-
function
|
|
333
|
+
function A(e, t) {
|
|
321
334
|
b.value = t, d.value = e.id, l("select", e);
|
|
322
335
|
}
|
|
323
336
|
function N(e, t) {
|
|
324
|
-
|
|
337
|
+
A(e, t), g(() => _.value?.focus());
|
|
325
338
|
}
|
|
326
|
-
function
|
|
339
|
+
function P() {
|
|
327
340
|
b.value >= r.options.length && (b.value = 0);
|
|
328
341
|
}
|
|
329
|
-
function
|
|
330
|
-
e.key === "ArrowDown" ? (e.preventDefault(), b.value >= r.options.length - 1 ?
|
|
342
|
+
function F(e) {
|
|
343
|
+
e.key === "ArrowDown" ? (e.preventDefault(), b.value >= r.options.length - 1 ? k() : b.value += 1) : e.key === "ArrowUp" ? (e.preventDefault(), b.value <= 0 ? k() : --b.value) : e.key === "Enter" && r.options[b.value] && (e.preventDefault(), A(r.options[b.value], b.value));
|
|
331
344
|
}
|
|
332
|
-
function
|
|
345
|
+
function I() {
|
|
333
346
|
b.value = r.options.length, d.value = void 0;
|
|
334
347
|
}
|
|
335
|
-
function
|
|
348
|
+
function L(e) {
|
|
336
349
|
if (!(!r.options.length && (e.key === "ArrowDown" || e.key === "ArrowUp"))) {
|
|
337
|
-
if (e.key === "ArrowDown") e.preventDefault(),
|
|
338
|
-
else if (e.key === "ArrowUp") e.preventDefault(),
|
|
350
|
+
if (e.key === "ArrowDown") e.preventDefault(), D(0);
|
|
351
|
+
else if (e.key === "ArrowUp") e.preventDefault(), D(r.options.length - 1);
|
|
339
352
|
else if (e.key === "Enter" && !e.isComposing) {
|
|
340
353
|
e.preventDefault();
|
|
341
354
|
let t = f.value.trim();
|
|
@@ -343,29 +356,29 @@ var ee = [
|
|
|
343
356
|
}
|
|
344
357
|
}
|
|
345
358
|
}
|
|
346
|
-
function
|
|
359
|
+
function z() {
|
|
347
360
|
l("close");
|
|
348
361
|
}
|
|
349
|
-
function
|
|
362
|
+
function B() {
|
|
350
363
|
l("skip");
|
|
351
364
|
}
|
|
352
|
-
return (n, r) => (
|
|
365
|
+
return (n, r) => (w(), s("section", {
|
|
353
366
|
class: "pv-question pv-card pv-surface pv-full-width",
|
|
354
367
|
"data-testid": "pv-question",
|
|
355
368
|
"aria-labelledby": m,
|
|
356
|
-
onKeydown:
|
|
369
|
+
onKeydown: ee(V(B, ["stop", "prevent"]), ["esc"])
|
|
357
370
|
}, [
|
|
358
|
-
c("header",
|
|
371
|
+
c("header", me, [c("div", he, [c("h3", {
|
|
359
372
|
id: m,
|
|
360
373
|
class: "pv-heading-3"
|
|
361
|
-
},
|
|
374
|
+
}, O(e.headerLabel), 1), e.subheader ? (w(), s("p", ge, O(e.subheader), 1)) : o("", !0)]), c("div", _e, [x.value ? (w(), s("span", ve, O(e.currentQuestion) + " of " + O(e.totalQuestions), 1)) : o("", !0), u(J, {
|
|
362
375
|
ariaLabel: "Close",
|
|
363
376
|
leftIcon: "close",
|
|
364
377
|
size: "md",
|
|
365
378
|
variant: "ghost",
|
|
366
|
-
onClick:
|
|
379
|
+
onClick: z
|
|
367
380
|
})])]),
|
|
368
|
-
c("div",
|
|
381
|
+
c("div", ye, [c("div", be, [c("div", {
|
|
369
382
|
ref_key: "listboxRef",
|
|
370
383
|
ref: _,
|
|
371
384
|
class: "pv-question-listbox pv-flex-vertical",
|
|
@@ -376,13 +389,13 @@ var ee = [
|
|
|
376
389
|
"data-testid": "pv-question-listbox",
|
|
377
390
|
role: "listbox",
|
|
378
391
|
tabindex: "0",
|
|
379
|
-
"aria-activedescendant":
|
|
380
|
-
"aria-describedby":
|
|
392
|
+
"aria-activedescendant": S.value,
|
|
393
|
+
"aria-describedby": h,
|
|
381
394
|
"aria-labelledby": m,
|
|
382
|
-
onFocus:
|
|
383
|
-
onKeydown:
|
|
384
|
-
}, [(
|
|
385
|
-
id:
|
|
395
|
+
onFocus: P,
|
|
396
|
+
onKeydown: F
|
|
397
|
+
}, [(w(!0), s(t, null, E(e.options, (e, t) => (w(), s("div", {
|
|
398
|
+
id: C(t),
|
|
386
399
|
key: e.id,
|
|
387
400
|
class: "pv-question-option pv-flex pv-inset-squish-12 pv-radius-lg",
|
|
388
401
|
"data-testid": "pv-question-option",
|
|
@@ -397,9 +410,10 @@ var ee = [
|
|
|
397
410
|
size: "sm",
|
|
398
411
|
variant: "tertiary"
|
|
399
412
|
}, null, 8, ["value"]),
|
|
400
|
-
c("span",
|
|
401
|
-
e.
|
|
402
|
-
|
|
413
|
+
e.description ? (w(), s("div", Ce, [c("span", we, O(e.label), 1), c("span", Te, O(e.description), 1)])) : (w(), s("span", Ee, O(e.label), 1)),
|
|
414
|
+
e.tag ? (w(), s("span", De, O(e.tag), 1)) : o("", !0),
|
|
415
|
+
e.helpText ? (w(), s("span", {
|
|
416
|
+
key: 3,
|
|
403
417
|
class: "pv-question-help pv-flex",
|
|
404
418
|
style: { "--flex-gap": "0" },
|
|
405
419
|
title: e.helpText
|
|
@@ -407,9 +421,9 @@ var ee = [
|
|
|
407
421
|
class: "pv-text-tertiary",
|
|
408
422
|
name: "info-circle",
|
|
409
423
|
size: 12
|
|
410
|
-
}), c("span",
|
|
411
|
-
d.value === e.id ? (
|
|
412
|
-
key:
|
|
424
|
+
}), c("span", ke, O(e.helpText), 1)], 8, Oe)) : o("", !0),
|
|
425
|
+
d.value === e.id ? (w(), a(W, {
|
|
426
|
+
key: 4,
|
|
413
427
|
class: "pv-question-check pv-text-brand",
|
|
414
428
|
name: "check"
|
|
415
429
|
})) : o("", !0),
|
|
@@ -417,26 +431,26 @@ var ee = [
|
|
|
417
431
|
class: "pv-question-chevron pv-text-tertiary",
|
|
418
432
|
name: "chevron-right"
|
|
419
433
|
})
|
|
420
|
-
], 40,
|
|
434
|
+
], 40, Se))), 128))], 40, xe), c("div", {
|
|
421
435
|
ref_key: "chatInputWrapperRef",
|
|
422
436
|
ref: v,
|
|
423
437
|
class: "pv-question-chat pv-flex pv-inset-squish-12 pv-radius-lg",
|
|
424
438
|
"data-testid": "pv-question-chat",
|
|
425
439
|
"data-active": b.value === e.options.length || void 0,
|
|
426
|
-
onClick:
|
|
440
|
+
onClick: k,
|
|
427
441
|
onMouseenter: r[1] ||= (t) => b.value = e.options.length
|
|
428
442
|
}, [
|
|
429
|
-
c("span",
|
|
443
|
+
c("span", je, [u(W, {
|
|
430
444
|
name: "text-search",
|
|
431
445
|
size: 12
|
|
432
446
|
})]),
|
|
433
|
-
c("div",
|
|
447
|
+
c("div", Me, [u(fe, {
|
|
434
448
|
modelValue: f.value,
|
|
435
449
|
"onUpdate:modelValue": r[0] ||= (e) => f.value = e,
|
|
436
450
|
"aria-label": e.chatInputLabel,
|
|
437
451
|
placeholder: e.chatInputPlaceholder,
|
|
438
|
-
onFocus:
|
|
439
|
-
onKeydown:
|
|
452
|
+
onFocus: I,
|
|
453
|
+
onKeydown: L
|
|
440
454
|
}, null, 8, [
|
|
441
455
|
"modelValue",
|
|
442
456
|
"aria-label",
|
|
@@ -446,36 +460,36 @@ var ee = [
|
|
|
446
460
|
class: "pv-question-chevron pv-text-tertiary",
|
|
447
461
|
name: "chevron-right"
|
|
448
462
|
})
|
|
449
|
-
], 40,
|
|
450
|
-
c("footer",
|
|
451
|
-
id:
|
|
463
|
+
], 40, Ae)])]),
|
|
464
|
+
c("footer", Ne, [c("span", {
|
|
465
|
+
id: h,
|
|
452
466
|
class: "pv-text-body-xs pv-text-tertiary"
|
|
453
|
-
}, "↑↓ to navigate • Enter to select • Esc to skip"), u(
|
|
467
|
+
}, "↑↓ to navigate • Enter to select • Esc to skip"), u(J, {
|
|
454
468
|
class: "pv-question-skip",
|
|
455
469
|
label: "Skip",
|
|
456
470
|
size: "lg",
|
|
457
471
|
variant: "secondary",
|
|
458
|
-
onClick:
|
|
472
|
+
onClick: B
|
|
459
473
|
})])
|
|
460
|
-
], 40,
|
|
474
|
+
], 40, pe));
|
|
461
475
|
}
|
|
462
|
-
}),
|
|
476
|
+
}), Fe = {
|
|
463
477
|
key: 0,
|
|
464
478
|
class: "pv-confirmation pv-bordered pv-radius pv-inset-square-16 pv-flow-16",
|
|
465
479
|
"data-testid": "pv-confirmation",
|
|
466
480
|
"aria-label": "Tool approval"
|
|
467
|
-
},
|
|
481
|
+
}, Ie = { class: "pv-text-body-sm" }, Le = {
|
|
468
482
|
class: "pv-flex",
|
|
469
483
|
style: { "--flex-justify": "flex-end" }
|
|
470
|
-
},
|
|
484
|
+
}, Re = {
|
|
471
485
|
key: 1,
|
|
472
486
|
class: "pv-flex pv-text-body-sm pv-text-success",
|
|
473
487
|
role: "status"
|
|
474
|
-
},
|
|
488
|
+
}, ze = {
|
|
475
489
|
key: 2,
|
|
476
490
|
class: "pv-flex pv-text-body-sm pv-text-critical",
|
|
477
491
|
role: "status"
|
|
478
|
-
},
|
|
492
|
+
}, Be = /* @__PURE__ */ d({
|
|
479
493
|
__name: "PvConfirmation",
|
|
480
494
|
props: {
|
|
481
495
|
approval: {},
|
|
@@ -497,37 +511,223 @@ var ee = [
|
|
|
497
511
|
approved: e
|
|
498
512
|
});
|
|
499
513
|
}
|
|
500
|
-
return (n, r) => d.value || f.value || p.value ? (
|
|
514
|
+
return (n, r) => d.value || f.value || p.value ? (w(), s("section", Fe, [d.value ? (w(), s(t, { key: 0 }, [c("div", Ie, [D(n.$slots, "default", {}, () => [l(O(e.message), 1)])]), c("div", Le, [u(J, {
|
|
501
515
|
variant: "secondary",
|
|
502
516
|
size: "md",
|
|
503
517
|
label: e.rejectLabel,
|
|
504
518
|
disabled: e.disabled,
|
|
505
519
|
onClick: r[0] ||= (e) => m(!1)
|
|
506
|
-
}, null, 8, ["label", "disabled"]), u(
|
|
520
|
+
}, null, 8, ["label", "disabled"]), u(J, {
|
|
507
521
|
size: "md",
|
|
508
522
|
label: e.approveLabel,
|
|
509
523
|
disabled: e.disabled,
|
|
510
524
|
onClick: r[1] ||= (e) => m(!0)
|
|
511
|
-
}, null, 8, ["label", "disabled"])])], 64)) : f.value ? (
|
|
525
|
+
}, null, 8, ["label", "disabled"])])], 64)) : f.value ? (w(), s("p", Re, [u(W, {
|
|
512
526
|
name: "check-circle",
|
|
513
527
|
size: 20
|
|
514
|
-
}),
|
|
528
|
+
}), D(n.$slots, "accepted", {}, () => [r[2] ||= l("You approved this tool execution.", -1)])])) : (w(), s("p", ze, [u(W, {
|
|
515
529
|
name: "close-circle",
|
|
516
530
|
size: 20
|
|
517
|
-
}),
|
|
531
|
+
}), D(n.$slots, "rejected", {}, () => [r[3] ||= l("You rejected this tool execution.", -1)])]))])) : o("", !0);
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
//#endregion
|
|
535
|
+
//#region src/composables/useSlotPresence.ts
|
|
536
|
+
function Y(e, t) {
|
|
537
|
+
if (e.nodeType !== Node.TEXT_NODE) return !1;
|
|
538
|
+
let n = e.textContent ?? "";
|
|
539
|
+
return t ? n.length > 0 : n.trim().length > 0;
|
|
540
|
+
}
|
|
541
|
+
function Ve(e, t, n) {
|
|
542
|
+
let r = t === "default" ? "" : t, i = Array.from(e.childNodes);
|
|
543
|
+
return r === "" ? i.some((e) => e.nodeType === Node.ELEMENT_NODE ? !e.hasAttribute("slot") : Y(e, n)) : i.some((e) => e.nodeType === Node.ELEMENT_NODE ? e.getAttribute("slot") === r : !1);
|
|
544
|
+
}
|
|
545
|
+
function He(e) {
|
|
546
|
+
if (e.shadowRoot) return null;
|
|
547
|
+
let t = e._slots;
|
|
548
|
+
return !t || typeof t != "object" ? null : t;
|
|
549
|
+
}
|
|
550
|
+
function Ue(e, t, n) {
|
|
551
|
+
let r = e[t === "" ? "default" : t];
|
|
552
|
+
return r ? r.some((e) => e.nodeType === Node.ELEMENT_NODE ? !0 : Y(e, n)) : !1;
|
|
553
|
+
}
|
|
554
|
+
function We(e, t) {
|
|
555
|
+
let n = e.shadowRoot;
|
|
556
|
+
return n ? t === "default" || t === "" ? n.querySelector("slot:not([name])") : n.querySelector(`slot[name="${CSS.escape(t)}"]`) : null;
|
|
557
|
+
}
|
|
558
|
+
function Ge(e, t, { useShadowSlot: n = !0, countWhitespaceTextInDefaultSlot: r = !1 } = {}) {
|
|
559
|
+
let i = n ? We(e, t) : null;
|
|
560
|
+
if (i) return i.assignedNodes({ flatten: !0 }).some((e) => e.nodeType === Node.ELEMENT_NODE ? !0 : Y(e, r));
|
|
561
|
+
let a = He(e);
|
|
562
|
+
return a ? Ue(a, t, r) : Ve(e, t, r);
|
|
563
|
+
}
|
|
564
|
+
function X(e, t = {}) {
|
|
565
|
+
let { host: n, vueSlots: r, observe: a = !0, listenSlotChange: o = !0, countWhitespaceTextInDefaultSlot: s = !1 } = t, c = U(), l = r ?? N(), u = e === "default" || e === "" ? "default" : e, d = () => !!l && !!l[u], f = T(d());
|
|
566
|
+
x(() => {
|
|
567
|
+
f.value = d();
|
|
568
|
+
});
|
|
569
|
+
let p = T(!1), m = null, h = null, g = () => {
|
|
570
|
+
m &&= (m.disconnect(), null), h &&= (h.removeEventListener("slotchange", _), null);
|
|
571
|
+
}, _ = () => {
|
|
572
|
+
if (!c.value) {
|
|
573
|
+
p.value = !1;
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
let t = A(n);
|
|
577
|
+
if (!t) {
|
|
578
|
+
p.value = !1;
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
p.value = Ge(t, e, {
|
|
582
|
+
useShadowSlot: o,
|
|
583
|
+
countWhitespaceTextInDefaultSlot: s
|
|
584
|
+
});
|
|
585
|
+
}, v = () => {
|
|
586
|
+
if (!c.value) return;
|
|
587
|
+
g();
|
|
588
|
+
let e = A(n);
|
|
589
|
+
if (!e) {
|
|
590
|
+
p.value = !1;
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
_(), o && (h = e.shadowRoot, h?.addEventListener("slotchange", _)), a && (m = new MutationObserver(() => _()), m.observe(e, {
|
|
594
|
+
childList: !0,
|
|
595
|
+
subtree: !1,
|
|
596
|
+
attributes: !0,
|
|
597
|
+
attributeFilter: ["slot"],
|
|
598
|
+
characterData: !0
|
|
599
|
+
}));
|
|
600
|
+
};
|
|
601
|
+
return S(v), b(g), R(() => A(n), () => {
|
|
602
|
+
c.value && v();
|
|
603
|
+
}), {
|
|
604
|
+
present: i(() => c.value ? p.value : f.value),
|
|
605
|
+
hasVueSlot: f,
|
|
606
|
+
hasNativeSlot: p,
|
|
607
|
+
refresh: _
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
//#endregion
|
|
611
|
+
//#region src/components/base/PvTooltip/PvTooltip.vue?vue&type=script&setup=true&lang.ts
|
|
612
|
+
var Ke = [
|
|
613
|
+
"data-position",
|
|
614
|
+
"data-style",
|
|
615
|
+
"data-static",
|
|
616
|
+
"aria-labelledby"
|
|
617
|
+
], qe = ["id"], Je = /* @__PURE__ */ d({
|
|
618
|
+
__name: "PvTooltip",
|
|
619
|
+
props: {
|
|
620
|
+
variant: { default: "white" },
|
|
621
|
+
tooltipPosition: { default: "top-right" },
|
|
622
|
+
ariaLabelledBy: { default: "ariaLabelledById" },
|
|
623
|
+
size: { default: "md" },
|
|
624
|
+
disableInteractive: {
|
|
625
|
+
type: Boolean,
|
|
626
|
+
default: !1
|
|
627
|
+
},
|
|
628
|
+
delay: { default: 0 }
|
|
629
|
+
},
|
|
630
|
+
setup(e) {
|
|
631
|
+
let t = e, n = P("rootRef"), { present: r } = X("tooltip-content", { host: i(() => {
|
|
632
|
+
let e = n.value?.getRootNode();
|
|
633
|
+
return e instanceof ShadowRoot ? e.host : null;
|
|
634
|
+
}) }), a = i(() => t.delay > 0), c = T(!1), l = T(!1), u, d = () => {
|
|
635
|
+
u && clearTimeout(u), u = void 0;
|
|
636
|
+
}, f = i(() => !a.value || c.value || l.value), p = () => {
|
|
637
|
+
a.value && (d(), u = setTimeout(() => {
|
|
638
|
+
u = void 0, l.value = !0;
|
|
639
|
+
}, t.delay));
|
|
640
|
+
}, m = () => {
|
|
641
|
+
a.value && (d(), l.value = !1);
|
|
642
|
+
}, h = () => {
|
|
643
|
+
a.value && (c.value = !0);
|
|
644
|
+
}, g = () => {
|
|
645
|
+
a.value && (c.value = !1);
|
|
646
|
+
};
|
|
647
|
+
return b(d), (t, i) => (w(), s("div", {
|
|
648
|
+
ref_key: "rootRef",
|
|
649
|
+
ref: n,
|
|
650
|
+
"data-testid": "pv-tooltip",
|
|
651
|
+
class: _([{
|
|
652
|
+
"pv-tooltip": A(r),
|
|
653
|
+
"pv-tooltip-small": A(r) && e.size === "sm"
|
|
654
|
+
}]),
|
|
655
|
+
"data-position": e.tooltipPosition,
|
|
656
|
+
"data-style": e.variant === "white" ? "white" : "dark",
|
|
657
|
+
"data-static": e.disableInteractive ? !0 : void 0,
|
|
658
|
+
"aria-labelledby": A(r) ? e.ariaLabelledBy : void 0,
|
|
659
|
+
onMouseenter: p,
|
|
660
|
+
onMouseleave: m,
|
|
661
|
+
onFocusin: h,
|
|
662
|
+
onFocusout: g
|
|
663
|
+
}, [D(t.$slots, "label"), A(r) ? B((w(), s("div", {
|
|
664
|
+
key: 0,
|
|
665
|
+
role: "tooltip",
|
|
666
|
+
id: e.ariaLabelledBy,
|
|
667
|
+
"data-testid": "pv-tooltip-content"
|
|
668
|
+
}, [D(t.$slots, "tooltip-content")], 8, qe)), [[L, f.value]]) : o("", !0)], 42, Ke));
|
|
518
669
|
}
|
|
519
|
-
}),
|
|
670
|
+
}), Ye = { class: "pv-text-body-sm" }, Xe = /* @__PURE__ */ d({
|
|
671
|
+
__name: "PvButtonWithTooltip",
|
|
672
|
+
props: {
|
|
673
|
+
tooltipText: {},
|
|
674
|
+
tooltipVariant: { default: "dark" },
|
|
675
|
+
tooltipPosition: {},
|
|
676
|
+
delay: { default: 500 },
|
|
677
|
+
variant: {},
|
|
678
|
+
disabled: { type: Boolean },
|
|
679
|
+
size: {},
|
|
680
|
+
loading: { type: Boolean },
|
|
681
|
+
label: {},
|
|
682
|
+
leftIcon: {},
|
|
683
|
+
rightIcon: {},
|
|
684
|
+
inverse: { type: Boolean },
|
|
685
|
+
leftCounterBadge: {},
|
|
686
|
+
rightCounterBadge: {},
|
|
687
|
+
ariaLabel: {}
|
|
688
|
+
},
|
|
689
|
+
setup(e) {
|
|
690
|
+
let t = e, n = i(() => t.size === "md" ? "sm" : "md"), r = i(() => ({
|
|
691
|
+
variant: t.variant,
|
|
692
|
+
disabled: t.disabled,
|
|
693
|
+
size: t.size,
|
|
694
|
+
loading: t.loading,
|
|
695
|
+
label: t.label,
|
|
696
|
+
leftIcon: t.leftIcon,
|
|
697
|
+
rightIcon: t.rightIcon,
|
|
698
|
+
inverse: t.inverse,
|
|
699
|
+
leftCounterBadge: t.leftCounterBadge,
|
|
700
|
+
rightCounterBadge: t.rightCounterBadge,
|
|
701
|
+
ariaLabel: t.ariaLabel
|
|
702
|
+
}));
|
|
703
|
+
return (t, i) => (w(), a(Je, {
|
|
704
|
+
variant: e.tooltipVariant,
|
|
705
|
+
"tooltip-position": e.tooltipPosition,
|
|
706
|
+
delay: e.delay,
|
|
707
|
+
size: n.value
|
|
708
|
+
}, {
|
|
709
|
+
"tooltip-content": z(() => [c("p", Ye, O(e.tooltipText), 1)]),
|
|
710
|
+
label: z(() => [u(J, v(p(r.value)), null, 16)]),
|
|
711
|
+
_: 1
|
|
712
|
+
}, 8, [
|
|
713
|
+
"variant",
|
|
714
|
+
"tooltip-position",
|
|
715
|
+
"delay",
|
|
716
|
+
"size"
|
|
717
|
+
]));
|
|
718
|
+
}
|
|
719
|
+
}), Ze = {
|
|
520
720
|
class: "pv-flex-vertical",
|
|
521
721
|
style: { "--flex-align": "flex-start" }
|
|
522
|
-
},
|
|
722
|
+
}, Qe = ["for"], $e = [
|
|
523
723
|
"rows",
|
|
524
724
|
"disabled",
|
|
525
725
|
"placeholder",
|
|
526
726
|
"id",
|
|
527
727
|
"data-invalid"
|
|
528
|
-
],
|
|
728
|
+
], et = /* @__PURE__ */ d({
|
|
529
729
|
__name: "PvTextArea",
|
|
530
|
-
props: /* @__PURE__ */
|
|
730
|
+
props: /* @__PURE__ */ m({
|
|
531
731
|
error: { type: Boolean },
|
|
532
732
|
disabled: { type: Boolean },
|
|
533
733
|
placeholder: {},
|
|
@@ -541,14 +741,14 @@ var ee = [
|
|
|
541
741
|
}),
|
|
542
742
|
emits: ["update:modelValue"],
|
|
543
743
|
setup(e) {
|
|
544
|
-
let t =
|
|
545
|
-
return (n, r) => (
|
|
546
|
-
n.$slots.label ? (
|
|
744
|
+
let t = M(e, "modelValue");
|
|
745
|
+
return (n, r) => (w(), s("div", Ze, [
|
|
746
|
+
n.$slots.label ? (w(), s("label", {
|
|
547
747
|
key: 0,
|
|
548
748
|
class: "pv-label",
|
|
549
749
|
for: e.id
|
|
550
|
-
}, [
|
|
551
|
-
|
|
750
|
+
}, [D(n.$slots, "label")], 8, Qe)) : o("", !0),
|
|
751
|
+
B(c("textarea", h(n.$attrs, {
|
|
552
752
|
"onUpdate:modelValue": r[0] ||= (e) => t.value = e,
|
|
553
753
|
class: ["pv-textarea", { "pv-surface-accent": e.variant === "grey" }],
|
|
554
754
|
rows: e.rows,
|
|
@@ -556,78 +756,101 @@ var ee = [
|
|
|
556
756
|
placeholder: e.placeholder,
|
|
557
757
|
id: e.id,
|
|
558
758
|
"data-invalid": e.error ? !0 : void 0
|
|
559
|
-
}), null, 16,
|
|
560
|
-
e.lowerLabel ? (
|
|
759
|
+
}), null, 16, $e), [[I, t.value]]),
|
|
760
|
+
e.lowerLabel ? (w(), s("p", {
|
|
561
761
|
key: 1,
|
|
562
762
|
style: { "margin-left": "12px" },
|
|
563
|
-
class:
|
|
763
|
+
class: _(["pv-text-body-xs", {
|
|
564
764
|
"pv-text-red": e.error,
|
|
565
765
|
"pv-text-subdued": !e.error
|
|
566
766
|
}])
|
|
567
|
-
},
|
|
767
|
+
}, O(e.lowerLabel), 3)) : o("", !0)
|
|
568
768
|
]));
|
|
569
769
|
}
|
|
570
|
-
}),
|
|
770
|
+
}), tt = ["aria-busy"], nt = {
|
|
571
771
|
key: 0,
|
|
572
772
|
class: "pv-full-width pv-flow-8"
|
|
573
|
-
},
|
|
773
|
+
}, rt = { class: "pv-prompt-input-footer pv-flex pv-full-width" }, it = { class: "pv-prompt-input-actions pv-flex pv-flex-item" }, at = {
|
|
574
774
|
class: "pv-visually-hidden",
|
|
575
775
|
"aria-live": "polite"
|
|
576
|
-
},
|
|
776
|
+
}, ot = /* @__PURE__ */ d({
|
|
577
777
|
__name: "PvPromptInput",
|
|
578
|
-
props: /* @__PURE__ */
|
|
778
|
+
props: /* @__PURE__ */ m({
|
|
579
779
|
ariaLabel: { default: "Message" },
|
|
580
780
|
disabled: {
|
|
581
781
|
type: Boolean,
|
|
582
782
|
default: !1
|
|
583
783
|
},
|
|
784
|
+
ignoreModifiedEnter: {
|
|
785
|
+
type: Boolean,
|
|
786
|
+
default: !1
|
|
787
|
+
},
|
|
584
788
|
maxHeight: { default: "200px" },
|
|
585
789
|
maxLength: {},
|
|
586
790
|
placeholder: { default: "Ask anything..." },
|
|
791
|
+
roundedButton: {
|
|
792
|
+
type: Boolean,
|
|
793
|
+
default: !1
|
|
794
|
+
},
|
|
587
795
|
rows: { default: 1 },
|
|
588
796
|
status: { default: "ready" },
|
|
589
797
|
stopLabel: { default: "Stop generating" },
|
|
590
|
-
|
|
798
|
+
stopTooltip: {},
|
|
799
|
+
submitIcon: { default: "send" },
|
|
800
|
+
submitLabel: { default: "Send message" },
|
|
801
|
+
submitPending: {
|
|
802
|
+
type: Boolean,
|
|
803
|
+
default: !1
|
|
804
|
+
},
|
|
805
|
+
submitPendingLabel: {}
|
|
591
806
|
}, {
|
|
592
807
|
modelValue: { default: "" },
|
|
593
808
|
modelModifiers: {}
|
|
594
809
|
}),
|
|
595
|
-
emits: /* @__PURE__ */
|
|
810
|
+
emits: /* @__PURE__ */ m(["submit", "stop"], ["update:modelValue"]),
|
|
596
811
|
setup(e, { expose: n, emit: r }) {
|
|
597
|
-
let
|
|
598
|
-
function
|
|
599
|
-
|
|
812
|
+
let d = e, f = r, p = M(e, "modelValue"), m = T(), h = i(() => d.status === "submitted" || d.status === "streaming"), g = i(() => d.submitPending && !h.value), _ = i(() => !d.disabled && !h.value && !d.submitPending && p.value.trim().length > 0), v = i(() => h.value ? d.stopTooltip : g.value ? d.submitPendingLabel : void 0), b = i(() => d.roundedButton ? { "--button-radius": "999px" } : void 0);
|
|
813
|
+
function x() {
|
|
814
|
+
_.value && f("submit", p.value.trim());
|
|
600
815
|
}
|
|
601
|
-
function
|
|
602
|
-
|
|
816
|
+
function S() {
|
|
817
|
+
m.value?.querySelector("textarea")?.focus();
|
|
603
818
|
}
|
|
604
|
-
function
|
|
605
|
-
|
|
819
|
+
function C(e) {
|
|
820
|
+
d.disabled || e.target?.closest("button, a, input, textarea, select, [tabindex]") || S();
|
|
606
821
|
}
|
|
607
|
-
function
|
|
608
|
-
|
|
822
|
+
function E(e) {
|
|
823
|
+
if (!h.value) return;
|
|
824
|
+
let t = e.target?.closest("button");
|
|
825
|
+
t && !t.disabled && f("stop");
|
|
609
826
|
}
|
|
610
|
-
|
|
827
|
+
function O(e) {
|
|
828
|
+
e.key !== "Enter" || e.shiftKey || e.isComposing || d.ignoreModifiedEnter && (e.ctrlKey || e.metaKey || e.altKey) || (e.preventDefault(), e.stopPropagation(), x());
|
|
829
|
+
}
|
|
830
|
+
return n({ focus: S }), (n, r) => (w(), s("form", {
|
|
611
831
|
ref_key: "formRef",
|
|
612
|
-
ref:
|
|
832
|
+
ref: m,
|
|
613
833
|
class: "pv-prompt-input pv-bordered pv-radius pv-inset-square-8 pv-flex-vertical",
|
|
614
834
|
"data-testid": "pv-prompt-input",
|
|
615
|
-
"aria-busy":
|
|
616
|
-
onSubmit:
|
|
617
|
-
onClick:
|
|
835
|
+
"aria-busy": h.value,
|
|
836
|
+
onSubmit: V(x, ["prevent"]),
|
|
837
|
+
onClick: C
|
|
618
838
|
}, [
|
|
619
|
-
n.$slots.header ? (
|
|
620
|
-
u(
|
|
621
|
-
modelValue:
|
|
622
|
-
"onUpdate:modelValue": r[0] ||= (e) =>
|
|
839
|
+
n.$slots.header ? (w(), s("div", nt, [D(n.$slots, "header")])) : o("", !0),
|
|
840
|
+
u(et, {
|
|
841
|
+
modelValue: p.value,
|
|
842
|
+
"onUpdate:modelValue": r[0] ||= (e) => p.value = e,
|
|
623
843
|
class: "pv-prompt-input-textarea",
|
|
624
|
-
style:
|
|
844
|
+
style: y({
|
|
845
|
+
"--prompt-input-max-height": e.maxHeight,
|
|
846
|
+
"--prompt-input-rows": e.rows
|
|
847
|
+
}),
|
|
625
848
|
rows: e.rows,
|
|
626
849
|
maxlength: e.maxLength,
|
|
627
850
|
placeholder: e.placeholder,
|
|
628
851
|
disabled: e.disabled,
|
|
629
852
|
"aria-label": e.ariaLabel,
|
|
630
|
-
onKeydown:
|
|
853
|
+
onKeydown: O
|
|
631
854
|
}, null, 8, [
|
|
632
855
|
"modelValue",
|
|
633
856
|
"style",
|
|
@@ -637,32 +860,57 @@ var ee = [
|
|
|
637
860
|
"disabled",
|
|
638
861
|
"aria-label"
|
|
639
862
|
]),
|
|
640
|
-
c("div",
|
|
641
|
-
|
|
642
|
-
|
|
863
|
+
c("div", rt, [c("div", it, [D(n.$slots, "actions")]), v.value ? (w(), a(Xe, {
|
|
864
|
+
key: 0,
|
|
865
|
+
"tooltip-text": v.value,
|
|
866
|
+
delay: 0,
|
|
867
|
+
variant: h.value ? "secondary" : "primary",
|
|
868
|
+
size: "md",
|
|
869
|
+
"left-icon": h.value ? "stop" : e.submitIcon,
|
|
870
|
+
"aria-label": h.value ? e.stopLabel : e.submitLabel,
|
|
871
|
+
disabled: e.disabled || !h.value && !_.value,
|
|
872
|
+
loading: g.value,
|
|
873
|
+
style: y(b.value),
|
|
874
|
+
onClick: E
|
|
875
|
+
}, null, 8, [
|
|
876
|
+
"tooltip-text",
|
|
877
|
+
"variant",
|
|
878
|
+
"left-icon",
|
|
879
|
+
"aria-label",
|
|
880
|
+
"disabled",
|
|
881
|
+
"loading",
|
|
882
|
+
"style"
|
|
883
|
+
])) : (w(), a(J, {
|
|
884
|
+
key: 1,
|
|
885
|
+
type: h.value ? "button" : "submit",
|
|
886
|
+
variant: h.value ? "secondary" : "primary",
|
|
643
887
|
size: "md",
|
|
644
|
-
"left-icon":
|
|
645
|
-
"aria-label":
|
|
646
|
-
disabled: e.disabled || !
|
|
647
|
-
|
|
888
|
+
"left-icon": h.value ? "stop" : e.submitIcon,
|
|
889
|
+
"aria-label": h.value ? e.stopLabel : e.submitLabel,
|
|
890
|
+
disabled: e.disabled || !h.value && !_.value,
|
|
891
|
+
loading: g.value,
|
|
892
|
+
style: y(b.value),
|
|
893
|
+
onClick: r[1] ||= (e) => h.value && f("stop")
|
|
648
894
|
}, null, 8, [
|
|
649
895
|
"type",
|
|
650
896
|
"variant",
|
|
651
897
|
"left-icon",
|
|
652
898
|
"aria-label",
|
|
653
|
-
"disabled"
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
899
|
+
"disabled",
|
|
900
|
+
"loading",
|
|
901
|
+
"style"
|
|
902
|
+
]))]),
|
|
903
|
+
c("p", at, [e.status === "submitted" ? (w(), s(t, { key: 0 }, [l("Message submitted.")], 64)) : e.status === "streaming" ? (w(), s(t, { key: 1 }, [l("Response is streaming.")], 64)) : e.status === "error" ? (w(), s(t, { key: 2 }, [l("The message could not be sent.")], 64)) : o("", !0)])
|
|
904
|
+
], 40, tt));
|
|
657
905
|
}
|
|
658
|
-
}),
|
|
906
|
+
}), st = [
|
|
659
907
|
"ready",
|
|
660
908
|
"submitted",
|
|
661
909
|
"streaming",
|
|
662
910
|
"error"
|
|
663
|
-
],
|
|
911
|
+
], ct = ["open"], Z = /* @__PURE__ */ G(/* @__PURE__ */ d({
|
|
664
912
|
__name: "PvAccordion",
|
|
665
|
-
props: /* @__PURE__ */
|
|
913
|
+
props: /* @__PURE__ */ m({
|
|
666
914
|
chevronPosition: { default: "right" },
|
|
667
915
|
chevronVariant: { default: "vertical" },
|
|
668
916
|
defaultOpen: { type: Boolean },
|
|
@@ -688,148 +936,69 @@ var ee = [
|
|
|
688
936
|
modelValue: { type: Boolean },
|
|
689
937
|
modelModifiers: {}
|
|
690
938
|
}),
|
|
691
|
-
emits: /* @__PURE__ */
|
|
939
|
+
emits: /* @__PURE__ */ m([
|
|
692
940
|
"summary-mouseenter",
|
|
693
941
|
"summary-mouseleave",
|
|
694
942
|
"summary-click"
|
|
695
943
|
], ["update:modelValue"]),
|
|
696
944
|
setup(e, { emit: n }) {
|
|
697
|
-
let r = e, l =
|
|
945
|
+
let r = e, l = M(e, "modelValue"), u = n;
|
|
698
946
|
r.defaultOpen !== void 0 && (l.value = r.defaultOpen);
|
|
699
947
|
let d = (e) => {
|
|
700
948
|
l.value = e.target.open;
|
|
701
949
|
}, f = (e) => {
|
|
702
950
|
e.detail !== 0 && (e.target?.closest("[data-pv-accordion-chevron]") || e.defaultPrevented || (e.preventDefault(), u("summary-click", e)));
|
|
703
|
-
}, p = i(() => r.toggleOnChevronOnly ? { click: f } : {}),
|
|
704
|
-
return (n, r) => (
|
|
951
|
+
}, p = i(() => r.toggleOnChevronOnly ? { click: f } : {}), m = { width: r.enableTriggerFullWidth ? "100%" : "fit-content" }, g = i(() => r.chevronVariant === "horizontal" ? r.chevronPosition === "left" ? l.value ? "chevron-down" : "chevron-right" : l.value ? "chevron-down" : "chevron-left" : l.value ? "chevron-up" : "chevron-down");
|
|
952
|
+
return (n, r) => (w(), s("details", {
|
|
705
953
|
"data-testid": "pv-accordion",
|
|
706
954
|
class: "pv-accordion",
|
|
707
955
|
open: l.value,
|
|
708
956
|
onToggle: d
|
|
709
|
-
}, [c("summary",
|
|
957
|
+
}, [c("summary", h(e.summaryAttrs, {
|
|
710
958
|
class: ["pv-flex pv-space-between pv-relative", e.summaryClasses],
|
|
711
959
|
style: {
|
|
712
|
-
...
|
|
960
|
+
...m,
|
|
713
961
|
...e.summaryStyles
|
|
714
962
|
},
|
|
715
963
|
onMouseenter: r[0] ||= (e) => n.$emit("summary-mouseenter"),
|
|
716
964
|
onMouseleave: r[1] ||= (e) => n.$emit("summary-mouseleave")
|
|
717
|
-
},
|
|
718
|
-
|
|
719
|
-
e.chevronPosition === "left" ? (
|
|
965
|
+
}, k(p.value, !0)), [
|
|
966
|
+
D(n.$slots, "leading", {}, void 0, !0),
|
|
967
|
+
e.chevronPosition === "left" ? (w(), a(W, {
|
|
720
968
|
key: 0,
|
|
721
969
|
name: g.value,
|
|
722
970
|
"data-pv-accordion-chevron": ""
|
|
723
971
|
}, null, 8, ["name"])) : o("", !0),
|
|
724
|
-
e.enableTriggerSlot ?
|
|
972
|
+
e.enableTriggerSlot ? D(n.$slots, "trigger", { key: 1 }, void 0, !0) : (w(), s(t, { key: 2 }, [c("span", null, O(e.header), 1), e.counter ? (w(), a(K, {
|
|
725
973
|
key: 0,
|
|
726
974
|
value: e.counter,
|
|
727
975
|
variant: "secondary",
|
|
728
976
|
size: "sm"
|
|
729
977
|
}, null, 8, ["value"])) : o("", !0)], 64)),
|
|
730
|
-
e.chevronPosition === "right" ? (
|
|
978
|
+
e.chevronPosition === "right" ? (w(), a(W, {
|
|
731
979
|
key: 3,
|
|
732
980
|
name: g.value,
|
|
733
981
|
"data-pv-accordion-chevron": ""
|
|
734
982
|
}, null, 8, ["name"])) : o("", !0)
|
|
735
|
-
], 16), c("div", { style:
|
|
983
|
+
], 16), c("div", { style: y(e.contentStyles) }, [D(n.$slots, "default", {}, void 0, !0)], 4)], 40, ct));
|
|
736
984
|
}
|
|
737
|
-
}), [["__scopeId", "data-v-dfa0b416"]])
|
|
738
|
-
//#endregion
|
|
739
|
-
//#region src/composables/useSlotPresence.ts
|
|
740
|
-
function Z(e, t) {
|
|
741
|
-
if (e.nodeType !== Node.TEXT_NODE) return !1;
|
|
742
|
-
let n = e.textContent ?? "";
|
|
743
|
-
return t ? n.length > 0 : n.trim().length > 0;
|
|
744
|
-
}
|
|
745
|
-
function We(e, t, n) {
|
|
746
|
-
let r = t === "default" ? "" : t, i = Array.from(e.childNodes);
|
|
747
|
-
return r === "" ? i.some((e) => e.nodeType === Node.ELEMENT_NODE ? !e.hasAttribute("slot") : Z(e, n)) : i.some((e) => e.nodeType === Node.ELEMENT_NODE ? e.getAttribute("slot") === r : !1);
|
|
748
|
-
}
|
|
749
|
-
function Ge(e) {
|
|
750
|
-
if (e.shadowRoot) return null;
|
|
751
|
-
let t = e._slots;
|
|
752
|
-
return !t || typeof t != "object" ? null : t;
|
|
753
|
-
}
|
|
754
|
-
function Ke(e, t, n) {
|
|
755
|
-
let r = e[t === "" ? "default" : t];
|
|
756
|
-
return r ? r.some((e) => e.nodeType === Node.ELEMENT_NODE ? !0 : Z(e, n)) : !1;
|
|
757
|
-
}
|
|
758
|
-
function qe(e, t) {
|
|
759
|
-
let n = e.shadowRoot;
|
|
760
|
-
return n ? t === "default" || t === "" ? n.querySelector("slot:not([name])") : n.querySelector(`slot[name="${CSS.escape(t)}"]`) : null;
|
|
761
|
-
}
|
|
762
|
-
function Je(e, t, { useShadowSlot: n = !0, countWhitespaceTextInDefaultSlot: r = !1 } = {}) {
|
|
763
|
-
let i = n ? qe(e, t) : null;
|
|
764
|
-
if (i) return i.assignedNodes({ flatten: !0 }).some((e) => e.nodeType === Node.ELEMENT_NODE ? !0 : Z(e, r));
|
|
765
|
-
let a = Ge(e);
|
|
766
|
-
return a ? Ke(a, t, r) : We(e, t, r);
|
|
767
|
-
}
|
|
768
|
-
function Ye(e, t = {}) {
|
|
769
|
-
let { host: n, vueSlots: r, observe: a = !0, listenSlotChange: o = !0, countWhitespaceTextInDefaultSlot: s = !1 } = t, c = U(), l = r ?? j(), u = e === "default" || e === "" ? "default" : e, d = () => !!l && !!l[u], f = C(d());
|
|
770
|
-
y(() => {
|
|
771
|
-
f.value = d();
|
|
772
|
-
});
|
|
773
|
-
let p = C(!1), m = null, h = null, g = () => {
|
|
774
|
-
m &&= (m.disconnect(), null), h &&= (h.removeEventListener("slotchange", _), null);
|
|
775
|
-
}, _ = () => {
|
|
776
|
-
if (!c.value) {
|
|
777
|
-
p.value = !1;
|
|
778
|
-
return;
|
|
779
|
-
}
|
|
780
|
-
let t = O(n);
|
|
781
|
-
if (!t) {
|
|
782
|
-
p.value = !1;
|
|
783
|
-
return;
|
|
784
|
-
}
|
|
785
|
-
p.value = Je(t, e, {
|
|
786
|
-
useShadowSlot: o,
|
|
787
|
-
countWhitespaceTextInDefaultSlot: s
|
|
788
|
-
});
|
|
789
|
-
}, x = () => {
|
|
790
|
-
if (!c.value) return;
|
|
791
|
-
g();
|
|
792
|
-
let e = O(n);
|
|
793
|
-
if (!e) {
|
|
794
|
-
p.value = !1;
|
|
795
|
-
return;
|
|
796
|
-
}
|
|
797
|
-
_(), o && (h = e.shadowRoot, h?.addEventListener("slotchange", _)), a && (m = new MutationObserver(() => _()), m.observe(e, {
|
|
798
|
-
childList: !0,
|
|
799
|
-
subtree: !1,
|
|
800
|
-
attributes: !0,
|
|
801
|
-
attributeFilter: ["slot"],
|
|
802
|
-
characterData: !0
|
|
803
|
-
}));
|
|
804
|
-
};
|
|
805
|
-
return b(x), v(g), P(() => O(n), () => {
|
|
806
|
-
c.value && x();
|
|
807
|
-
}), {
|
|
808
|
-
present: i(() => c.value ? p.value : f.value),
|
|
809
|
-
hasVueSlot: f,
|
|
810
|
-
hasNativeSlot: p,
|
|
811
|
-
refresh: _
|
|
812
|
-
};
|
|
813
|
-
}
|
|
814
|
-
//#endregion
|
|
815
|
-
//#region src/components/ai/PvStepList/PvStepList.vue?vue&type=script&setup=true&lang.ts
|
|
816
|
-
var Xe = ["data-status"], Ze = {
|
|
985
|
+
}), [["__scopeId", "data-v-dfa0b416"]]), lt = ["data-status"], ut = {
|
|
817
986
|
key: 0,
|
|
818
987
|
class: "pv-step-marker",
|
|
819
988
|
"aria-hidden": "true"
|
|
820
|
-
},
|
|
989
|
+
}, dt = {
|
|
821
990
|
key: 1,
|
|
822
991
|
class: "pv-step-dot"
|
|
823
|
-
},
|
|
992
|
+
}, ft = { class: "pv-step-body pv-flow-8" }, pt = {
|
|
824
993
|
key: 0,
|
|
825
994
|
class: "pv-step-aside pv-text-body-md pv-text-tertiary"
|
|
826
|
-
},
|
|
995
|
+
}, mt = {
|
|
827
996
|
key: 0,
|
|
828
997
|
class: "pv-tag-highlight"
|
|
829
|
-
},
|
|
998
|
+
}, ht = {
|
|
830
999
|
key: 0,
|
|
831
1000
|
class: "pv-text-body-md pv-text-tertiary"
|
|
832
|
-
},
|
|
1001
|
+
}, gt = {
|
|
833
1002
|
key: 1,
|
|
834
1003
|
class: "pv-flex",
|
|
835
1004
|
role: "list",
|
|
@@ -837,7 +1006,7 @@ var Xe = ["data-status"], Ze = {
|
|
|
837
1006
|
"--flex-wrap": "wrap",
|
|
838
1007
|
"--flex-gap": "4px"
|
|
839
1008
|
}
|
|
840
|
-
},
|
|
1009
|
+
}, _t = {
|
|
841
1010
|
key: 2,
|
|
842
1011
|
class: "pv-text-body-md pv-text-medium pv-text-brand"
|
|
843
1012
|
}, Q = /* @__PURE__ */ d({
|
|
@@ -860,46 +1029,46 @@ var Xe = ["data-status"], Ze = {
|
|
|
860
1029
|
function d(e, t) {
|
|
861
1030
|
return u(e, t) === "active" ? "pv-text-medium pv-text-default" : "pv-text-quaternary";
|
|
862
1031
|
}
|
|
863
|
-
return (n, i) => (
|
|
1032
|
+
return (n, i) => (w(), a(r, {
|
|
864
1033
|
tag: "ol",
|
|
865
1034
|
name: "pv-step",
|
|
866
1035
|
class: "pv-step-list",
|
|
867
1036
|
role: "list"
|
|
868
1037
|
}, {
|
|
869
|
-
default:
|
|
1038
|
+
default: z(() => [(w(!0), s(t, null, E(e.steps, (e, n) => (w(), s("li", {
|
|
870
1039
|
key: e.id ?? n,
|
|
871
1040
|
class: "pv-step",
|
|
872
1041
|
"data-status": u(e, n)
|
|
873
|
-
}, [e.variant === "aside" ? o("", !0) : (
|
|
1042
|
+
}, [e.variant === "aside" ? o("", !0) : (w(), s("span", ut, [e.icon ? (w(), a(W, {
|
|
874
1043
|
key: 0,
|
|
875
1044
|
name: e.icon,
|
|
876
1045
|
size: 12
|
|
877
|
-
}, null, 8, ["name"])) : (
|
|
1046
|
+
}, null, 8, ["name"])) : (w(), s("span", dt))])), c("div", ft, [e.variant === "aside" ? (w(), s("p", pt, [c("em", null, O(e.label), 1)])) : (w(), s(t, { key: 1 }, [
|
|
878
1047
|
c("p", {
|
|
879
|
-
class:
|
|
1048
|
+
class: _(["pv-flex pv-text-body-md", d(e, n)]),
|
|
880
1049
|
style: { "--flex-wrap": "wrap" }
|
|
881
|
-
}, [c("span", { class:
|
|
882
|
-
e.note ? (
|
|
883
|
-
e.tags && e.tags.length > 0 ? (
|
|
1050
|
+
}, [c("span", { class: _({ "pv-shimmer": u(e, n) === "active" }) }, O(e.label), 3), e.artifact ? (w(), s("span", mt, O(e.artifact), 1)) : o("", !0)], 2),
|
|
1051
|
+
e.note ? (w(), s("p", ht, O(e.note), 1)) : o("", !0),
|
|
1052
|
+
e.tags && e.tags.length > 0 ? (w(), s("ul", gt, [(w(!0), s(t, null, E(e.tags, (e, t) => (w(), s("li", {
|
|
884
1053
|
key: t,
|
|
885
|
-
class:
|
|
1054
|
+
class: _(["pv-tag-secondary", { "pv-text-quaternary": e.variant === "muted" }]),
|
|
886
1055
|
"data-style": "rounded"
|
|
887
|
-
},
|
|
888
|
-
e.outcome ? (
|
|
889
|
-
], 64))])], 8,
|
|
1056
|
+
}, O(e.label), 3))), 128))])) : o("", !0),
|
|
1057
|
+
e.outcome ? (w(), s("p", _t, " →\xA0" + O(e.outcome), 1)) : o("", !0)
|
|
1058
|
+
], 64))])], 8, lt))), 128))]),
|
|
890
1059
|
_: 1
|
|
891
1060
|
}));
|
|
892
1061
|
}
|
|
893
|
-
}),
|
|
1062
|
+
}), vt = {
|
|
894
1063
|
class: "pv-reasoning-trigger pv-flex pv-text-body-md pv-text-medium",
|
|
895
1064
|
"aria-live": "polite"
|
|
896
|
-
},
|
|
1065
|
+
}, yt = { class: "pv-reasoning-content pv-text-body-md pv-text-tertiary" }, $ = {
|
|
897
1066
|
key: 1,
|
|
898
1067
|
class: "pv-reasoning-trigger pv-reasoning-standalone pv-flex pv-text-body-md pv-text-medium pv-text-tertiary",
|
|
899
1068
|
"aria-live": "polite"
|
|
900
|
-
},
|
|
1069
|
+
}, bt = /* @__PURE__ */ d({
|
|
901
1070
|
__name: "PvReasoning",
|
|
902
|
-
props: /* @__PURE__ */
|
|
1071
|
+
props: /* @__PURE__ */ m({
|
|
903
1072
|
autoCloseDelay: { default: 1e3 },
|
|
904
1073
|
completedLabel: { default: "Reasoning" },
|
|
905
1074
|
defaultOpen: {
|
|
@@ -922,36 +1091,36 @@ var Xe = ["data-status"], Ze = {
|
|
|
922
1091
|
}),
|
|
923
1092
|
emits: ["update:open"],
|
|
924
1093
|
setup(r) {
|
|
925
|
-
let l = r, d =
|
|
1094
|
+
let l = r, d = M(r, "open"), p = T(), m = T(), h = T(!1), g;
|
|
926
1095
|
(l.defaultOpen || l.isStreaming) && (d.value = !0), l.isStreaming && (m.value = Date.now());
|
|
927
|
-
let
|
|
1096
|
+
let v = i(() => l.duration ?? p.value), y = i(() => {
|
|
928
1097
|
if (l.isStreaming) return l.streamingLabel;
|
|
929
|
-
if (
|
|
930
|
-
let e = Math.max(1, Math.round(
|
|
1098
|
+
if (v.value === void 0) return l.completedLabel;
|
|
1099
|
+
let e = Math.max(1, Math.round(v.value));
|
|
931
1100
|
return `Thought for ${e} ${e === 1 ? "second" : "seconds"}`;
|
|
932
|
-
}), x =
|
|
933
|
-
function
|
|
934
|
-
return r.some((r) => r.type === e ? !1 : r.type === n ? String(r.children ?? "").trim().length > 0 : r.type === t ? Array.isArray(r.children) &&
|
|
1101
|
+
}), x = N(), S = f(), C = U(), E = i(() => C.value ? S?.ce : null), { hasNativeSlot: k } = X("default", { host: E });
|
|
1102
|
+
function A(r) {
|
|
1103
|
+
return r.some((r) => r.type === e ? !1 : r.type === n ? String(r.children ?? "").trim().length > 0 : r.type === t ? Array.isArray(r.children) && A(r.children) : !0);
|
|
935
1104
|
}
|
|
936
|
-
function
|
|
937
|
-
return l.steps.length > 0 || k.value ? !0 :
|
|
1105
|
+
function j() {
|
|
1106
|
+
return l.steps.length > 0 || k.value ? !0 : E.value ? !1 : A(x.default?.({}) ?? []);
|
|
938
1107
|
}
|
|
939
|
-
function
|
|
940
|
-
|
|
1108
|
+
function P() {
|
|
1109
|
+
g !== void 0 && (clearTimeout(g), g = void 0);
|
|
941
1110
|
}
|
|
942
|
-
function
|
|
1111
|
+
function F(e) {
|
|
943
1112
|
let t = e.target?.closest?.("summary");
|
|
944
|
-
!t || t.parentElement !== e.currentTarget || (h.value = !0,
|
|
1113
|
+
!t || t.parentElement !== e.currentTarget || (h.value = !0, P());
|
|
945
1114
|
}
|
|
946
|
-
return
|
|
947
|
-
if (
|
|
1115
|
+
return R(() => l.isStreaming, (e, t) => {
|
|
1116
|
+
if (P(), e) {
|
|
948
1117
|
m.value = Date.now(), p.value = void 0, h.value = !1, d.value = !0;
|
|
949
1118
|
return;
|
|
950
1119
|
}
|
|
951
|
-
t && (m.value !== void 0 && (p.value = (Date.now() - m.value) / 1e3), h.value || (
|
|
1120
|
+
t && (m.value !== void 0 && (p.value = (Date.now() - m.value) / 1e3), h.value || (g = setTimeout(() => {
|
|
952
1121
|
h.value || (d.value = !1);
|
|
953
1122
|
}, l.autoCloseDelay)));
|
|
954
|
-
}),
|
|
1123
|
+
}), b(P), (e, t) => j() ? (w(), a(Z, {
|
|
955
1124
|
key: 0,
|
|
956
1125
|
modelValue: d.value,
|
|
957
1126
|
"onUpdate:modelValue": t[0] ||= (e) => d.value = e,
|
|
@@ -963,31 +1132,31 @@ var Xe = ["data-status"], Ze = {
|
|
|
963
1132
|
"enable-trigger-slot": "",
|
|
964
1133
|
"summary-classes": { "pv-text-tertiary": !0 },
|
|
965
1134
|
"summary-styles": { justifyContent: "flex-start" },
|
|
966
|
-
onClick:
|
|
1135
|
+
onClick: F
|
|
967
1136
|
}, {
|
|
968
|
-
trigger:
|
|
969
|
-
default:
|
|
1137
|
+
trigger: z(() => [c("span", vt, [D(e.$slots, "trigger", {}, () => [u(W, { name: "brain" }), c("span", { class: _(["pv-text-subdued", { "pv-shimmer": r.isStreaming }]) }, O(y.value), 3)])])]),
|
|
1138
|
+
default: z(() => [c("div", yt, [r.steps.length > 0 ? (w(), a(Q, {
|
|
970
1139
|
key: 0,
|
|
971
1140
|
steps: r.steps,
|
|
972
1141
|
"in-progress": r.isStreaming
|
|
973
|
-
}, null, 8, ["steps", "in-progress"])) : o("", !0),
|
|
1142
|
+
}, null, 8, ["steps", "in-progress"])) : o("", !0), D(e.$slots, "default")])]),
|
|
974
1143
|
_: 3
|
|
975
|
-
}, 8, ["modelValue", "default-open"])) : (
|
|
1144
|
+
}, 8, ["modelValue", "default-open"])) : (w(), s("span", $, [D(e.$slots, "trigger", {}, () => [u(W, { name: "brain" }), c("span", { class: _(["pv-text-subdued", { "pv-shimmer": r.isStreaming }]) }, O(y.value), 3)])]));
|
|
976
1145
|
}
|
|
977
|
-
}),
|
|
1146
|
+
}), xt = { class: "pv-tool-heading pv-flex pv-flex-item" }, St = { class: "pv-text-title-sm pv-truncate" }, Ct = { class: "pv-tool-disclosure-content" }, wt = { class: "pv-flow-16 pv-border-top pv-tool-content" }, Tt = {
|
|
978
1147
|
key: 0,
|
|
979
1148
|
class: "pv-flow-8"
|
|
980
|
-
},
|
|
1149
|
+
}, Et = { class: "pv-surface-accent pv-inset-square-12 pv-radius-sm pv-text-body-xs" }, Dt = {
|
|
981
1150
|
key: 1,
|
|
982
1151
|
class: "pv-flow-8",
|
|
983
1152
|
role: "alert",
|
|
984
1153
|
"aria-label": "Tool error"
|
|
985
|
-
},
|
|
1154
|
+
}, Ot = { class: "pv-surface-critical pv-inset-square-12 pv-radius-sm pv-text-body-xs pv-text-critical" }, kt = {
|
|
986
1155
|
key: 2,
|
|
987
1156
|
class: "pv-flow-8"
|
|
988
|
-
},
|
|
1157
|
+
}, At = { class: "pv-surface-accent pv-inset-square-12 pv-radius-sm pv-text-body-xs" }, jt = /* @__PURE__ */ d({
|
|
989
1158
|
__name: "PvTool",
|
|
990
|
-
props: /* @__PURE__ */
|
|
1159
|
+
props: /* @__PURE__ */ m({
|
|
991
1160
|
defaultOpen: {
|
|
992
1161
|
type: Boolean,
|
|
993
1162
|
default: !1
|
|
@@ -1020,7 +1189,7 @@ var Xe = ["data-status"], Ze = {
|
|
|
1020
1189
|
}),
|
|
1021
1190
|
emits: ["update:open"],
|
|
1022
1191
|
setup(e) {
|
|
1023
|
-
let t = e, n =
|
|
1192
|
+
let t = e, n = M(e, "open"), r = ["output-available", "output-error"];
|
|
1024
1193
|
(t.defaultOpen || r.includes(t.state)) && (n.value = !0);
|
|
1025
1194
|
let l = i(() => ({
|
|
1026
1195
|
"input-streaming": {
|
|
@@ -1060,9 +1229,9 @@ var Xe = ["data-status"], Ze = {
|
|
|
1060
1229
|
return String(e);
|
|
1061
1230
|
}
|
|
1062
1231
|
}
|
|
1063
|
-
return
|
|
1232
|
+
return R(() => t.state, (e, t) => {
|
|
1064
1233
|
e !== t && r.includes(e) && (n.value = !0);
|
|
1065
|
-
}), (t, r) => (
|
|
1234
|
+
}), (t, r) => (w(), a(Z, {
|
|
1066
1235
|
modelValue: n.value,
|
|
1067
1236
|
"onUpdate:modelValue": r[0] ||= (e) => n.value = e,
|
|
1068
1237
|
"default-open": n.value,
|
|
@@ -1073,22 +1242,22 @@ var Xe = ["data-status"], Ze = {
|
|
|
1073
1242
|
"enable-trigger-slot": "",
|
|
1074
1243
|
"summary-classes": { "pv-inset-square-12": !0 }
|
|
1075
1244
|
}, {
|
|
1076
|
-
trigger:
|
|
1245
|
+
trigger: z(() => [c("span", xt, [
|
|
1077
1246
|
u(W, {
|
|
1078
1247
|
name: "settings",
|
|
1079
1248
|
size: 20
|
|
1080
1249
|
}),
|
|
1081
|
-
c("span",
|
|
1250
|
+
c("span", St, O(e.toolName), 1),
|
|
1082
1251
|
c("span", {
|
|
1083
|
-
class:
|
|
1252
|
+
class: _([l.value.className, "pv-tag-sm"]),
|
|
1084
1253
|
role: "status"
|
|
1085
|
-
},
|
|
1254
|
+
}, O(l.value.label), 3)
|
|
1086
1255
|
])]),
|
|
1087
|
-
default:
|
|
1256
|
+
default: z(() => [c("div", Ct, [c("div", wt, [t.$slots.input || e.input !== void 0 ? (w(), s("section", Tt, [r[1] ||= c("h3", { class: "pv-text-title-xs" }, "Parameters", -1), D(t.$slots, "input", { input: e.input }, () => [c("pre", Et, [c("code", null, O(d(e.input)), 1)])])])) : o("", !0), e.errorText ? (w(), s("section", Dt, [r[2] ||= c("h3", { class: "pv-text-title-xs pv-text-critical" }, "Error", -1), c("pre", Ot, O(e.errorText), 1)])) : t.$slots.output || e.output !== void 0 ? (w(), s("section", kt, [r[3] ||= c("h3", { class: "pv-text-title-xs" }, "Result", -1), D(t.$slots, "output", { output: e.output }, () => [c("pre", At, [c("code", null, O(d(e.output)), 1)])])])) : o("", !0)])])]),
|
|
1088
1257
|
_: 3
|
|
1089
1258
|
}, 8, ["modelValue", "default-open"]));
|
|
1090
1259
|
}
|
|
1091
|
-
}),
|
|
1260
|
+
}), Mt = [
|
|
1092
1261
|
"input-streaming",
|
|
1093
1262
|
"input-available",
|
|
1094
1263
|
"approval-requested",
|
|
@@ -1099,8 +1268,8 @@ var Xe = ["data-status"], Ze = {
|
|
|
1099
1268
|
];
|
|
1100
1269
|
//#endregion
|
|
1101
1270
|
//#region src/components/ai/useStickToBottom.ts
|
|
1102
|
-
function
|
|
1103
|
-
let n = t.threshold ?? 32, r =
|
|
1271
|
+
function Nt(e, t = {}) {
|
|
1272
|
+
let n = t.threshold ?? 32, r = T(!0);
|
|
1104
1273
|
function i() {
|
|
1105
1274
|
let t = e.value;
|
|
1106
1275
|
t && (r.value = t.scrollHeight - t.scrollTop - t.clientHeight <= n);
|
|
@@ -1131,14 +1300,14 @@ function bt(e, t = {}) {
|
|
|
1131
1300
|
e.removeEventListener("scroll", t), s.forEach((e) => e.disconnect());
|
|
1132
1301
|
};
|
|
1133
1302
|
}
|
|
1134
|
-
return
|
|
1303
|
+
return R(e, (e) => {
|
|
1135
1304
|
o?.(), o = void 0, e && s(e);
|
|
1136
|
-
}, { immediate: !0 }),
|
|
1305
|
+
}, { immediate: !0 }), C(() => o?.()), {
|
|
1137
1306
|
isAtBottom: r,
|
|
1138
1307
|
scrollToBottom: a
|
|
1139
1308
|
};
|
|
1140
1309
|
}
|
|
1141
1310
|
//#endregion
|
|
1142
|
-
export {
|
|
1311
|
+
export { Be as PvConfirmation, ot as PvPromptInput, Pe as PvQuestion, bt as PvReasoning, Q as PvStepList, jt as PvTool, st as promptInputStatuses, Mt as toolLifecycleStates, Nt as useStickToBottom };
|
|
1143
1312
|
|
|
1144
1313
|
//# sourceMappingURL=pv-components-ai.mjs.map
|