@turquoisehealth/pit-viper 2.255.1 → 2.256.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 +20 -11
- package/_site/assets/css/pit-viper-a11y.css +20 -11
- package/_site/assets/css/pit-viper-consumer.css +20 -11
- package/_site/assets/css/pit-viper-v2-scoped.css +17 -11
- package/_site/assets/css/pit-viper-v2.css +20 -11
- package/_site/assets/css/pit-viper-v3.css +20 -11
- package/_site/assets/css/pit-viper.css +20 -11
- package/package.json +1 -1
- package/pv-components/dist/stats/vue/ai/stats.html +1 -1
- package/pv-components/dist/stats/web/pv-prompt-input-stats.html +1 -1
- package/pv-components/dist/vue/ai/components/ai/PvPromptInput/PvPromptInput.vue.d.ts +4 -1
- package/pv-components/dist/vue/ai/components/ai/PvPromptInput/types.d.ts +2 -0
- package/pv-components/dist/vue/ai/pv-components-ai.mjs +28 -22
- package/pv-components/dist/vue/ai/pv-components-ai.mjs.map +1 -1
- package/pv-components/dist/web/components/pv-prompt-input/pv-prompt-input.js +28 -22
- package/pv-components/dist/web/pv-components.iife.js +1 -1
- package/pv-components/dist/web/pv-components.iife.js.map +1 -1
|
@@ -580,6 +580,7 @@ var ne = [
|
|
|
580
580
|
default: !1
|
|
581
581
|
},
|
|
582
582
|
maxHeight: { default: "200px" },
|
|
583
|
+
maxLength: {},
|
|
583
584
|
placeholder: { default: "Ask anything..." },
|
|
584
585
|
rows: { default: 1 },
|
|
585
586
|
status: { default: "ready" },
|
|
@@ -590,53 +591,58 @@ var ne = [
|
|
|
590
591
|
modelModifiers: {}
|
|
591
592
|
}),
|
|
592
593
|
emits: /* @__PURE__ */ p(["submit", "stop"], ["update:modelValue"]),
|
|
593
|
-
setup(e, {
|
|
594
|
-
let
|
|
595
|
-
function
|
|
596
|
-
|
|
594
|
+
setup(e, { expose: n, emit: r }) {
|
|
595
|
+
let a = e, d = r, f = A(e, "modelValue"), p = C(), m = i(() => a.status === "submitted" || a.status === "streaming"), h = i(() => !a.disabled && !m.value && f.value.trim().length > 0);
|
|
596
|
+
function g() {
|
|
597
|
+
h.value && d("submit", f.value.trim());
|
|
598
|
+
}
|
|
599
|
+
function v() {
|
|
600
|
+
p.value?.querySelector("textarea")?.focus();
|
|
597
601
|
}
|
|
598
|
-
function
|
|
599
|
-
|
|
602
|
+
function y(e) {
|
|
603
|
+
a.disabled || e.target?.closest("button, a, input, textarea, select, [tabindex]") || v();
|
|
600
604
|
}
|
|
601
|
-
function
|
|
602
|
-
e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), e.stopPropagation(),
|
|
605
|
+
function b(e) {
|
|
606
|
+
e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), e.stopPropagation(), g());
|
|
603
607
|
}
|
|
604
|
-
return (n, r) => (S(), s("form", {
|
|
608
|
+
return n({ focus: v }), (n, r) => (S(), s("form", {
|
|
605
609
|
ref_key: "formRef",
|
|
606
|
-
ref:
|
|
610
|
+
ref: p,
|
|
607
611
|
class: "pv-prompt-input pv-bordered pv-radius pv-inset-square-8 pv-flex-vertical",
|
|
608
612
|
"data-testid": "pv-prompt-input",
|
|
609
|
-
"aria-busy":
|
|
610
|
-
onSubmit: R(
|
|
611
|
-
onClick:
|
|
613
|
+
"aria-busy": m.value,
|
|
614
|
+
onSubmit: R(g, ["prevent"]),
|
|
615
|
+
onClick: y
|
|
612
616
|
}, [
|
|
613
617
|
n.$slots.header ? (S(), s("div", ze, [T(n.$slots, "header")])) : o("", !0),
|
|
614
618
|
u(Le, {
|
|
615
|
-
modelValue:
|
|
616
|
-
"onUpdate:modelValue": r[0] ||= (e) =>
|
|
619
|
+
modelValue: f.value,
|
|
620
|
+
"onUpdate:modelValue": r[0] ||= (e) => f.value = e,
|
|
617
621
|
class: "pv-prompt-input-textarea",
|
|
618
622
|
style: _({ "--prompt-input-max-height": e.maxHeight }),
|
|
619
623
|
rows: e.rows,
|
|
624
|
+
maxlength: e.maxLength,
|
|
620
625
|
placeholder: e.placeholder,
|
|
621
626
|
disabled: e.disabled,
|
|
622
627
|
"aria-label": e.ariaLabel,
|
|
623
|
-
onKeydown:
|
|
628
|
+
onKeydown: b
|
|
624
629
|
}, null, 8, [
|
|
625
630
|
"modelValue",
|
|
626
631
|
"style",
|
|
627
632
|
"rows",
|
|
633
|
+
"maxlength",
|
|
628
634
|
"placeholder",
|
|
629
635
|
"disabled",
|
|
630
636
|
"aria-label"
|
|
631
637
|
]),
|
|
632
638
|
c("div", Be, [c("div", Ve, [T(n.$slots, "actions")]), u(q, {
|
|
633
|
-
type:
|
|
634
|
-
variant:
|
|
639
|
+
type: m.value ? "button" : "submit",
|
|
640
|
+
variant: m.value ? "secondary" : "primary",
|
|
635
641
|
size: "md",
|
|
636
|
-
"left-icon":
|
|
637
|
-
"aria-label":
|
|
638
|
-
disabled: e.disabled || !
|
|
639
|
-
onClick: r[1] ||= (e) =>
|
|
642
|
+
"left-icon": m.value ? "stop" : "send",
|
|
643
|
+
"aria-label": m.value ? e.stopLabel : e.submitLabel,
|
|
644
|
+
disabled: e.disabled || !m.value && !h.value,
|
|
645
|
+
onClick: r[1] ||= (e) => m.value && d("stop")
|
|
640
646
|
}, null, 8, [
|
|
641
647
|
"type",
|
|
642
648
|
"variant",
|