@8wave/ai-elements 0.121.0-beta.58 → 0.121.0-beta.59

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.
Files changed (62) hide show
  1. package/dist/ai-elements.es.js +2303 -2267
  2. package/dist/ai-elements.es.js.map +1 -1
  3. package/dist-vue/PkChatbot.js +1 -1
  4. package/dist-vue/PkChatbotEmptyState.js +1 -1
  5. package/dist-vue/PkChatbotInput.js +1 -1
  6. package/dist-vue/PkChatbotViewChat.js +1 -1
  7. package/dist-vue/PkChatbotViewConversations.js +1 -1
  8. package/dist-vue/PkChatbotViewFiles.js +1 -1
  9. package/dist-vue/PkChatbotViewProfile.js +1 -1
  10. package/dist-vue/_chunks/PkAvatar-DwtZWSW4.js +38 -0
  11. package/dist-vue/_chunks/PkAvatar-DwtZWSW4.js.map +1 -0
  12. package/dist-vue/_chunks/{PkChatbot-BjD_4yaD.js → PkChatbot-DtyJG8HB.js} +7 -8
  13. package/dist-vue/_chunks/PkChatbot-DtyJG8HB.js.map +1 -0
  14. package/dist-vue/_chunks/{PkChatbotEmptyState-CMNmmQdu.js → PkChatbotEmptyState-CivaIYxu.js} +2 -3
  15. package/dist-vue/_chunks/PkChatbotEmptyState-CivaIYxu.js.map +1 -0
  16. package/dist-vue/_chunks/{PkChatbotInput-CdpjDIzr.js → PkChatbotInput-mBl1PWIU.js} +88 -88
  17. package/dist-vue/_chunks/PkChatbotInput-mBl1PWIU.js.map +1 -0
  18. package/dist-vue/_chunks/{PkChatbotViewChat-BqFY0Evp.js → PkChatbotViewChat-ZOpF5REL.js} +248 -243
  19. package/dist-vue/_chunks/PkChatbotViewChat-ZOpF5REL.js.map +1 -0
  20. package/dist-vue/_chunks/{PkChatbotViewConversations-DF_c4X6k.js → PkChatbotViewConversations-THKK5wGp.js} +52 -34
  21. package/dist-vue/_chunks/PkChatbotViewConversations-THKK5wGp.js.map +1 -0
  22. package/dist-vue/_chunks/{PkChatbotViewFiles-B76IwGGP.js → PkChatbotViewFiles-BOGd3r0o.js} +3 -3
  23. package/dist-vue/_chunks/{PkChatbotViewFiles-B76IwGGP.js.map → PkChatbotViewFiles-BOGd3r0o.js.map} +1 -1
  24. package/dist-vue/_chunks/{PkChatbotViewProfile-Bt0eH8fO.js → PkChatbotViewProfile-XtL9RfC7.js} +3 -4
  25. package/dist-vue/_chunks/PkChatbotViewProfile-XtL9RfC7.js.map +1 -0
  26. package/dist-vue/_chunks/{createChatbotApiClient-BYGLKd_e.js → createChatbotApiClient-Bt387Z64.js} +6 -5
  27. package/dist-vue/_chunks/createChatbotApiClient-Bt387Z64.js.map +1 -0
  28. package/dist-vue/_chunks/{useChatbotStore-O0u7mVit.js → useChatbotStore-pnj_3y4N.js} +718 -687
  29. package/dist-vue/_chunks/useChatbotStore-pnj_3y4N.js.map +1 -0
  30. package/dist-vue/_chunks/useDialogConfirm-fn7iV-iE.js +86 -0
  31. package/dist-vue/_chunks/useDialogConfirm-fn7iV-iE.js.map +1 -0
  32. package/dist-vue/api.js +1 -1
  33. package/dist-vue/composables.js +12 -4
  34. package/dist-vue/composables.js.map +1 -1
  35. package/dist-vue/index.js +4252 -4009
  36. package/dist-vue/index.js.map +1 -1
  37. package/dist-vue/locales.js +22 -12
  38. package/dist-vue/packages/components/src/chat/PkAvatar.d.ts +6 -7
  39. package/dist-vue/packages/components/src/chat/PkChatSearchDialog.d.ts +19 -0
  40. package/dist-vue/packages/components/src/chat/{PkAgentSelectorInline.d.ts → PkChatShortcutsDialog.d.ts} +8 -5
  41. package/dist-vue/packages/components/src/chat/PkChatSidebar.d.ts +7 -8
  42. package/dist-vue/packages/components/src/chat/PkChatSidebarConversationItem.d.ts +2 -2
  43. package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +4 -1
  44. package/dist-vue/packages/components/src/chat/index.d.ts +1 -2
  45. package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +11 -1
  46. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +21 -3
  47. package/dist-vue/packages/composable/src/chatbot/useConversationActions.d.ts +54 -1
  48. package/dist-vue/packages/models/src/schema/Chat.d.ts +1 -0
  49. package/dist-vue/style.css +1 -1
  50. package/package.json +1 -1
  51. package/dist-vue/_chunks/PkAvatar-uVRs_DD9.js +0 -43
  52. package/dist-vue/_chunks/PkAvatar-uVRs_DD9.js.map +0 -1
  53. package/dist-vue/_chunks/PkChatbot-BjD_4yaD.js.map +0 -1
  54. package/dist-vue/_chunks/PkChatbotEmptyState-CMNmmQdu.js.map +0 -1
  55. package/dist-vue/_chunks/PkChatbotInput-CdpjDIzr.js.map +0 -1
  56. package/dist-vue/_chunks/PkChatbotViewChat-BqFY0Evp.js.map +0 -1
  57. package/dist-vue/_chunks/PkChatbotViewConversations-DF_c4X6k.js.map +0 -1
  58. package/dist-vue/_chunks/PkChatbotViewProfile-Bt0eH8fO.js.map +0 -1
  59. package/dist-vue/_chunks/createChatbotApiClient-BYGLKd_e.js.map +0 -1
  60. package/dist-vue/_chunks/useChatbotStore-O0u7mVit.js.map +0 -1
  61. package/dist-vue/_chunks/useDialogConfirm-CyD9VTKg.js +0 -84
  62. package/dist-vue/_chunks/useDialogConfirm-CyD9VTKg.js.map +0 -1
@@ -0,0 +1,86 @@
1
+ import { VvButton as e, VvButtonGroup as t, VvDialog as n, VvInputText as r } from "@volverjs/ui-vue/components";
2
+ import { defineComponent as i, h as a, nextTick as o, ref as s, watch as c } from "vue";
3
+ import { useI18n as l } from "vue-i18n";
4
+ // ../../packages/composable/src/useDialog.ts
5
+ var u = s(!1), d = s(), f = s(), p = s(), m = s(), h = s(!1), g = s(), _ = s(), v = () => {
6
+ let e = (e) => {
7
+ u.value = e;
8
+ }, t = () => {
9
+ d.value = void 0, f.value = void 0, p.value = void 0, m.value = void 0, h.value = void 0, g.value = void 0, _.value = void 0;
10
+ };
11
+ return {
12
+ PkGlobalDialog: i({
13
+ name: "PkGlobalDialog",
14
+ render: () => a(n, {
15
+ modelValue: u.value,
16
+ title: d.value,
17
+ transition: f.value,
18
+ modifiers: p.value,
19
+ size: m.value,
20
+ keepOpen: h.value,
21
+ role: g.value,
22
+ "onUpdate:modelValue": e,
23
+ onAfterLeave: t
24
+ }, _.value)
25
+ }),
26
+ openDialog: (e, t) => (d.value = e?.title, f.value = e?.transition, p.value = e?.modifiers, m.value = e?.size, h.value = e?.keepOpen ?? !1, g.value = e?.role, _.value = t, o(() => {
27
+ u.value = !0;
28
+ }), u),
29
+ isOpen: u
30
+ };
31
+ }, y = () => {
32
+ let { openDialog: n } = v(), { t: i } = l({ useScope: "global" });
33
+ return { openDialogConfirm: ({ emitReject: o = !1, confirmLabel: l, cancelLabel: u, questionLabel: d, descriptionLabel: f, onlyConfirm: p = !1, passphrase: m, passphraseLabel: h, passphraseHint: g, title: _, danger: v = !1 } = {}) => new Promise((y, b) => {
34
+ let x = s(), S = n({
35
+ role: "alertdialog",
36
+ size: "small",
37
+ keepOpen: !0,
38
+ title: _
39
+ }, {
40
+ default: () => a("div", [
41
+ a("div", {
42
+ class: ["text-14 text-word-2", f ? "" : "mb-sm"],
43
+ style: "white-space: pre-line"
44
+ }, d ?? i("message.confirm")),
45
+ f ? a("p", {
46
+ class: "text-14 text-word-3 mt-xs mb-sm",
47
+ style: "white-space: pre-line"
48
+ }, f) : void 0,
49
+ m ? a(r, {
50
+ modelValue: x.value,
51
+ "onUpdate:modelValue": (e) => {
52
+ x.value = e;
53
+ },
54
+ type: "text",
55
+ name: "passphrase",
56
+ class: "mb-0",
57
+ floating: !0,
58
+ label: h ?? i("label.passphrase"),
59
+ hintLabel: g ?? i("hint.passphrase", { passphrase: m })
60
+ }) : void 0
61
+ ]),
62
+ footer: () => a(t, () => {
63
+ let t = [];
64
+ return p || t.push(a(e, {
65
+ label: u ?? i("action.cancel"),
66
+ modifiers: "ghost",
67
+ onClick: () => {
68
+ S.value = !1;
69
+ }
70
+ })), t.push(a(e, {
71
+ label: l ?? i("action.proceed"),
72
+ modifiers: v ? "danger" : void 0,
73
+ disabled: m ? m !== x.value : !1,
74
+ onClick: () => {
75
+ y(!0), S.value = !1;
76
+ }
77
+ })), t;
78
+ })
79
+ }), C = c(S, (e) => {
80
+ e || (C(), o && b(), y(!1));
81
+ });
82
+ }) };
83
+ };
84
+ export { y as t };
85
+
86
+ //# sourceMappingURL=useDialogConfirm-fn7iV-iE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDialogConfirm-fn7iV-iE.js","names":["isOpen","ref","title","transition","modifiers","size","keepOpen","role","slots","useDialog","onUpdateModelValue","value","onAfterLeave","defineComponent","h","VvDialog","newProps","newSlots","nextTick","useDialogConfirm","$t","useI18n","passphraseText","openDialog","descriptionLabel","questionLabel","passphrase","VvInputText","passphraseLabel","passphraseHint","VvButtonGroup","toReturn","onlyConfirm","VvButton","cancelLabel","confirmLabel","danger","resolve","stopWatching","watch","open","emitReject","reject"],"sources":["../../../../packages/composable/src/useDialog.ts","../../../../packages/composable/src/useDialogConfirm.ts"],"sourcesContent":["import { VvDialog } from '@volverjs/ui-vue/components'\nimport { defineComponent, h, nextTick, ref, type VNode } from 'vue'\n\ntype DialogProps = {\n title?: string\n transition?: string\n modifiers?: string | string[]\n /** @deprecated use modifiers instead */\n size?: 'small' | 'standard' | 'fullscreen'\n role?: 'alert' | 'alertdialog'\n keepOpen?: boolean\n}\n\ntype DialogSlots = {\n footer?: () => VNode | string\n header?: () => VNode | string\n default?: () => VNode | string | VNode[] | string[]\n}\n\nconst isOpen = ref(false)\nconst title = ref<DialogProps['title']>()\nconst transition = ref<DialogProps['transition']>()\nconst modifiers = ref<DialogProps['modifiers']>()\nconst size = ref<DialogProps['size']>()\nconst keepOpen = ref<DialogProps['keepOpen']>(false)\nconst role = ref<DialogProps['role']>()\nconst slots = ref<DialogSlots>()\n\nexport const useDialog = () => {\n const onUpdateModelValue = (value: boolean) => {\n isOpen.value = value\n }\n\n const onAfterLeave = () => {\n title.value = undefined\n transition.value = undefined\n modifiers.value = undefined\n size.value = undefined\n keepOpen.value = undefined\n role.value = undefined\n slots.value = undefined\n }\n\n const PkGlobalDialog = defineComponent({\n name: 'PkGlobalDialog',\n render: () =>\n h(\n VvDialog,\n {\n modelValue: isOpen.value,\n title: title.value,\n transition: transition.value,\n modifiers: modifiers.value,\n size: size.value,\n keepOpen: keepOpen.value,\n role: role.value,\n 'onUpdate:modelValue': onUpdateModelValue,\n onAfterLeave: onAfterLeave,\n },\n slots.value,\n ),\n })\n\n const openDialog = (newProps: DialogProps, newSlots?: DialogSlots) => {\n title.value = newProps?.title\n transition.value = newProps?.transition\n modifiers.value = newProps?.modifiers\n size.value = newProps?.size\n keepOpen.value = newProps?.keepOpen ?? false\n role.value = newProps?.role\n slots.value = newSlots\n nextTick(() => {\n isOpen.value = true\n })\n return isOpen\n }\n\n return { PkGlobalDialog, openDialog, isOpen }\n}\n","import type { VNode } from 'vue'\nimport { h, ref, watch } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport {\n VvButton,\n VvButtonGroup,\n VvInputText,\n} from '@volverjs/ui-vue/components'\nimport { useDialog } from './useDialog'\n\nexport const useDialogConfirm = () => {\n const { openDialog } = useDialog()\n const { t: $t } = useI18n({\n useScope: 'global',\n })\n\n /**\n * Ask before doing something, in three parts that a person reads in order.\n *\n * `title` is what is about to happen, short, in the dialog header.\n * `questionLabel` is the question itself. `descriptionLabel` is what it\n * costs: the consequences, secondary, under the question. Splitting them\n * is the whole point: a confirm that puts question and consequences in one\n * paragraph is read as a wall and answered without being read, which is\n * the opposite of what a confirm is for.\n *\n * `danger` draws the confirm button red, for an action that cannot be\n * undone (DESIGN.md, principle 1): the one strong button of the dialog\n * stays one, and its color says what it costs.\n *\n * Resolves `true` from the confirm button and `false` however else the\n * dialog closes (rejecting first with `emitReject`).\n */\n const openDialogConfirm = ({\n emitReject = false,\n confirmLabel,\n cancelLabel,\n questionLabel,\n descriptionLabel,\n onlyConfirm = false,\n passphrase,\n passphraseLabel,\n passphraseHint,\n title,\n danger = false,\n }: {\n emitReject?: boolean\n confirmLabel?: string\n cancelLabel?: string\n questionLabel?: string\n descriptionLabel?: string\n onlyConfirm?: boolean\n passphrase?: string\n passphraseLabel?: string\n passphraseHint?: string\n title?: string\n danger?: boolean\n } = {}) => {\n return new Promise<boolean>((resolve, reject) => {\n const passphraseText = ref<string>()\n const isOpen = openDialog(\n {\n role: 'alertdialog',\n size: 'small',\n keepOpen: true,\n title,\n },\n {\n default: () =>\n h('div', [\n h(\n 'div',\n {\n class: [\n 'text-14 text-word-2',\n descriptionLabel ? '' : 'mb-sm',\n ],\n style: 'white-space: pre-line',\n },\n questionLabel ?? $t('message.confirm'),\n ),\n descriptionLabel\n ? h(\n 'p',\n {\n class: 'text-14 text-word-3 mt-xs mb-sm',\n style: 'white-space: pre-line',\n },\n descriptionLabel,\n )\n : undefined,\n passphrase\n ? h(VvInputText, {\n modelValue: passphraseText.value,\n 'onUpdate:modelValue': (\n value: string,\n ) => {\n passphraseText.value = value\n },\n type: 'text',\n name: 'passphrase',\n class: 'mb-0',\n floating: true,\n label:\n passphraseLabel ??\n $t('label.passphrase'),\n hintLabel:\n passphraseHint ??\n $t('hint.passphrase', { passphrase }),\n })\n : undefined,\n ]),\n footer: () =>\n h(VvButtonGroup, () => {\n const toReturn: VNode[] = []\n if (!onlyConfirm) {\n toReturn.push(\n h(VvButton, {\n label:\n cancelLabel ?? $t('action.cancel'),\n modifiers: 'ghost',\n onClick: () => {\n isOpen.value = false\n },\n }),\n )\n }\n toReturn.push(\n h(VvButton, {\n label: confirmLabel ?? $t('action.proceed'),\n modifiers: danger ? 'danger' : undefined,\n disabled: passphrase\n ? passphrase !== passphraseText.value\n : false,\n onClick: () => {\n resolve(true)\n isOpen.value = false\n },\n }),\n )\n return toReturn\n }),\n },\n )\n // Closing is the answer \"no\", whatever closes it: Cancel, the\n // close button of the header, or a second Esc, which closes even\n // a `keepOpen` dialog. Without it a caller waited for ever. The\n // confirm button settles the promise first, so this cannot\n // override it.\n const stopWatching = watch(isOpen, (open) => {\n if (open) {\n return\n }\n stopWatching()\n if (emitReject) {\n reject()\n }\n resolve(false)\n })\n })\n }\n\n return { openDialogConfirm }\n}\n"],"mappings":";;;;AAmBA,IAAMA,IAASC,EAAI,EAAK,GAClBC,IAAQD,EAA0B,GAClCE,IAAaF,EAA+B,GAC5CG,IAAYH,EAA8B,GAC1CI,IAAOJ,EAAyB,GAChCK,IAAWL,EAA6B,EAAK,GAC7CM,IAAON,EAAyB,GAChCO,IAAQP,EAAiB,GAElBQ,UAAkB;CAC3B,IAAMC,KAAsB,MAAmB;EAC3C,EAAO,QAAQC;CACnB,GAEMC,UAAqB;EAOvB,AANA,EAAM,QAAQ,KAAA,GACd,EAAW,QAAQ,KAAA,GACnB,EAAU,QAAQ,KAAA,GAClB,EAAK,QAAQ,KAAA,GACb,EAAS,QAAQ,KAAA,GACjB,EAAK,QAAQ,KAAA,GACb,EAAM,QAAQ,KAAA;CAClB;CAoCA,OAAO;EAAE,gBAlCcC,EAAgB;GACnC,MAAM;GACN,cACIC,EACIC,GACA;IACI,YAAYf,EAAO;IACnB,OAAOE,EAAM;IACb,YAAYC,EAAW;IACvB,WAAWC,EAAU;IACrB,MAAMC,EAAK;IACX,UAAUC,EAAS;IACnB,MAAMC,EAAK;IACX,uBAAuBG;IACT;GAClB,GACAF,EAAM,KACV;EACR,CAgBS;EAAgB,aAdL,GAAuB,OACvC,EAAM,QAAQQ,GAAU,OACxB,EAAW,QAAQA,GAAU,YAC7B,EAAU,QAAQA,GAAU,WAC5B,EAAK,QAAQA,GAAU,MACvB,EAAS,QAAQA,GAAU,YAAY,IACvC,EAAK,QAAQA,GAAU,MACvB,EAAM,QAAQC,GACdC,QAAe;GACX,EAAO,QAAQ;EACnB,CAAC,GACMlB;EAG0B;CAAO;AAChD,GCpEamB,UAAyB;CAClC,IAAM,EAAE,kBAAeV,EAAU,GAC3B,EAAE,GAAGW,MAAOC,EAAQ,EACtB,UAAU,SACd,CAAC;CAoJD,OAAO,EAAE,oBAjIkB,E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;CACL,CAAC,EAGsB;AAC/B"}
package/dist-vue/api.js CHANGED
@@ -1 +1 @@
1
- export { t as createChatbotApiClient } from "./_chunks/createChatbotApiClient-BYGLKd_e.js";
1
+ export { t as createChatbotApiClient } from "./_chunks/createChatbotApiClient-Bt387Z64.js";