@useinsider/guido 3.2.0-beta.803b92e → 3.2.0-beta.8220f9d

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 (113) hide show
  1. package/README.md +1 -25
  2. package/dist/@types/config/schemas.js +2 -2
  3. package/dist/components/Guido.vue.js +5 -5
  4. package/dist/components/Guido.vue2.js +88 -78
  5. package/dist/components/organisms/chat/blueprint/BlueprintCard.vue.js +20 -0
  6. package/dist/components/organisms/chat/blueprint/BlueprintCard.vue2.js +20 -0
  7. package/dist/components/organisms/chat/blueprint/EmailTemplateBlueprintCard.vue.js +23 -0
  8. package/dist/components/organisms/chat/blueprint/EmailTemplateBlueprintCard.vue2.js +18 -0
  9. package/dist/components/organisms/chat/chatbox/ChatboxContainer.vue.js +18 -0
  10. package/dist/components/organisms/chat/chatbox/ChatboxContainer.vue2.js +16 -0
  11. package/dist/components/organisms/chat/chatbox/ChatboxPanel.vue.js +20 -0
  12. package/dist/components/organisms/chat/chatbox/ChatboxPanel.vue2.js +19 -0
  13. package/dist/components/organisms/chat/conversation/ChatConversation.vue.js +28 -0
  14. package/dist/components/organisms/chat/conversation/ChatConversation.vue2.js +20 -0
  15. package/dist/components/organisms/chat/conversation/ChatWelcome.vue.js +18 -0
  16. package/dist/components/organisms/chat/conversation/ChatWelcome.vue2.js +11 -0
  17. package/dist/components/organisms/chat/conversation/QuickActionChips.vue.js +22 -0
  18. package/dist/components/organisms/chat/conversation/QuickActionChips.vue2.js +42 -0
  19. package/dist/components/organisms/chat/input/ChatInput.vue.js +29 -0
  20. package/dist/components/organisms/chat/input/ChatInput.vue2.js +39 -0
  21. package/dist/components/organisms/chat/input/GuidoAgentSelector.vue.js +22 -0
  22. package/dist/components/organisms/chat/input/GuidoAgentSelector.vue2.js +29 -0
  23. package/dist/components/organisms/chat/messages/AiMessage.vue.js +26 -0
  24. package/dist/components/organisms/chat/messages/AiMessage.vue2.js +41 -0
  25. package/dist/components/organisms/chat/messages/AiMessageActions.vue.js +18 -0
  26. package/dist/components/organisms/chat/messages/AiMessageActions.vue2.js +27 -0
  27. package/dist/components/organisms/chat/messages/ChatLoading.vue.js +18 -0
  28. package/dist/components/organisms/chat/messages/ChatLoading.vue2.js +30 -0
  29. package/dist/components/organisms/chat/messages/ChatMessages.vue.js +26 -0
  30. package/dist/components/organisms/chat/messages/ChatMessages.vue2.js +67 -0
  31. package/dist/components/organisms/chat/messages/UserMessage.vue.js +18 -0
  32. package/dist/components/organisms/chat/messages/UserMessage.vue2.js +26 -0
  33. package/dist/components/organisms/header/RightSlot.vue.js +8 -8
  34. package/dist/components/organisms/header/RightSlot.vue2.js +8 -9
  35. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
  36. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  37. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
  38. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
  39. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
  40. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
  41. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
  42. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
  43. package/dist/composables/useChatState.js +130 -0
  44. package/dist/composables/useChatStreaming.js +191 -0
  45. package/dist/composables/useConversationEvents.js +37 -0
  46. package/dist/composables/useEmailTemplateApplier.js +41 -0
  47. package/dist/composables/useRibbonOffset.js +21 -0
  48. package/dist/composables/useSave.js +15 -15
  49. package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
  50. package/dist/enums/onboarding.js +7 -2
  51. package/dist/enums/unsubscribe.js +34 -27
  52. package/dist/guido.css +1 -1
  53. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +258 -235
  54. package/dist/node_modules/@vueuse/core/index.js +127 -0
  55. package/dist/node_modules/@vueuse/shared/index.js +68 -27
  56. package/dist/node_modules/dompurify/dist/purify.es.js +595 -0
  57. package/dist/node_modules/marked/lib/marked.esm.js +1152 -0
  58. package/dist/package.json.js +1 -1
  59. package/dist/services/chatService.js +163 -0
  60. package/dist/services/templateLibraryApi.js +5 -4
  61. package/dist/src/@types/chat.d.ts +138 -0
  62. package/dist/src/@types/config/schemas.d.ts +4 -4
  63. package/dist/src/components/Guido.vue.d.ts +5 -1
  64. package/dist/src/components/organisms/chat/blueprint/BlueprintCard.vue.d.ts +38 -0
  65. package/dist/src/components/organisms/chat/blueprint/EmailTemplateBlueprintCard.vue.d.ts +35 -0
  66. package/dist/src/components/organisms/chat/chatbox/ChatboxContainer.vue.d.ts +4 -0
  67. package/dist/src/components/organisms/chat/chatbox/ChatboxPanel.vue.d.ts +4 -0
  68. package/dist/src/components/organisms/chat/conversation/ChatConversation.vue.d.ts +31 -0
  69. package/dist/src/components/organisms/chat/conversation/QuickActionChips.vue.d.ts +30 -0
  70. package/dist/src/components/organisms/chat/input/ChatInput.vue.d.ts +37 -0
  71. package/dist/src/components/organisms/chat/messages/AiMessage.vue.d.ts +33 -0
  72. package/dist/src/components/organisms/chat/messages/AiMessageActions.vue.d.ts +18 -0
  73. package/dist/src/components/organisms/chat/messages/ChatLoading.vue.d.ts +32 -0
  74. package/dist/src/components/organisms/chat/messages/ChatMessages.vue.d.ts +37 -0
  75. package/dist/src/components/organisms/chat/messages/UserMessage.vue.d.ts +35 -0
  76. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  77. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  78. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  79. package/dist/src/composables/useChatState.d.ts +26 -0
  80. package/dist/src/composables/useChatStreaming.d.ts +26 -0
  81. package/dist/src/composables/useConfig.d.ts +2 -2
  82. package/dist/src/composables/useConversationEvents.d.ts +19 -0
  83. package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
  84. package/dist/src/composables/useRibbonOffset.d.ts +4 -0
  85. package/dist/src/composables/useSave.d.ts +1 -1
  86. package/dist/src/enums/onboarding.d.ts +6 -0
  87. package/dist/src/enums/unsubscribe.d.ts +5 -0
  88. package/dist/src/services/chatService.d.ts +16 -0
  89. package/dist/src/stores/chat.d.ts +323 -0
  90. package/dist/src/stores/config.d.ts +18 -18
  91. package/dist/src/stores/editor.d.ts +23 -0
  92. package/dist/src/stores/onboarding.d.ts +4 -0
  93. package/dist/src/utils/generateId.d.ts +1 -0
  94. package/dist/src/utils/markdown.d.ts +1 -0
  95. package/dist/stores/chat.js +26 -0
  96. package/dist/stores/editor.js +1 -0
  97. package/dist/stores/onboarding.js +4 -0
  98. package/dist/utils/generateId.js +7 -0
  99. package/dist/utils/markdown.js +21 -0
  100. package/dist/utils/pairProductVariables.js +89 -88
  101. package/package.json +6 -3
  102. package/dist/components/organisms/AutoSaveController.vue.js +0 -17
  103. package/dist/components/organisms/AutoSaveController.vue2.js +0 -13
  104. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  105. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  106. package/dist/composables/useAutoSave.js +0 -68
  107. package/dist/src/composables/useAutoSave.d.ts +0 -3
  108. package/dist/src/stores/autosave.d.ts +0 -6
  109. package/dist/src/utils/timeUtil.d.ts +0 -8
  110. package/dist/stores/autosave.js +0 -11
  111. package/dist/utils/timeUtil.js +0 -19
  112. /package/dist/src/components/organisms/{AutoSaveController.vue.d.ts → chat/conversation/ChatWelcome.vue.d.ts} +0 -0
  113. /package/dist/src/components/organisms/{header/AutoSaveToggle.vue.d.ts → chat/input/GuidoAgentSelector.vue.d.ts} +0 -0
@@ -0,0 +1,127 @@
1
+ import { useTimeoutFn as T, toValue as b, isClient as A, createSingletonPromise as W, noop as L, isObject as q, tryOnScopeDispose as O } from "../shared/index.js";
2
+ import { createFilterWrapper as K, debounceFilter as Q, useDebounceFn as U } from "../shared/index.js";
3
+ import "../../vue-demi/lib/index.js";
4
+ import { computed as C, ref as g, shallowRef as S, watch as P, getCurrentInstance as j, onMounted as B, toRaw as D } from "vue";
5
+ const I = A ? window : void 0, E = A ? window.navigator : void 0;
6
+ function N(e) {
7
+ var t;
8
+ const o = b(e);
9
+ return (t = o == null ? void 0 : o.$el) != null ? t : o;
10
+ }
11
+ function _(...e) {
12
+ let t, o, a, c;
13
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([o, a, c] = e, t = I) : [t, o, a, c] = e, !t)
14
+ return L;
15
+ Array.isArray(o) || (o = [o]), Array.isArray(a) || (a = [a]);
16
+ const u = [], d = () => {
17
+ u.forEach((n) => n()), u.length = 0;
18
+ }, p = (n, i, v, m) => (n.addEventListener(i, v, m), () => n.removeEventListener(i, v, m)), f = P(
19
+ () => [N(t), b(c)],
20
+ ([n, i]) => {
21
+ if (d(), !n)
22
+ return;
23
+ const v = q(i) ? { ...i } : i;
24
+ u.push(
25
+ ...o.flatMap((m) => a.map((y) => p(n, m, y, v)))
26
+ );
27
+ },
28
+ { immediate: !0, flush: "post" }
29
+ ), l = () => {
30
+ f(), d();
31
+ };
32
+ return O(l), l;
33
+ }
34
+ function V() {
35
+ const e = g(!1);
36
+ return j() && B(() => {
37
+ e.value = !0;
38
+ }, void 0), e;
39
+ }
40
+ function M(e) {
41
+ const t = V();
42
+ return C(() => (t.value, !!e()));
43
+ }
44
+ function x(e, t = {}) {
45
+ const {
46
+ controls: o = !1,
47
+ navigator: a = E
48
+ } = t, c = M(() => a && "permissions" in a), u = S(), d = typeof e == "string" ? { name: e } : e, p = S(), f = () => {
49
+ var n, i;
50
+ p.value = (i = (n = u.value) == null ? void 0 : n.state) != null ? i : "prompt";
51
+ };
52
+ _(u, "change", f);
53
+ const l = W(async () => {
54
+ if (c.value) {
55
+ if (!u.value)
56
+ try {
57
+ u.value = await a.permissions.query(d);
58
+ } catch {
59
+ u.value = void 0;
60
+ } finally {
61
+ f();
62
+ }
63
+ if (o)
64
+ return D(u.value);
65
+ }
66
+ });
67
+ return l(), o ? {
68
+ state: p,
69
+ isSupported: c,
70
+ query: l
71
+ } : p;
72
+ }
73
+ function G(e = {}) {
74
+ const {
75
+ navigator: t = E,
76
+ read: o = !1,
77
+ source: a,
78
+ copiedDuring: c = 1500,
79
+ legacy: u = !1
80
+ } = e, d = M(() => t && "clipboard" in t), p = x("clipboard-read"), f = x("clipboard-write"), l = C(() => d.value || u), n = g(""), i = g(!1), v = T(() => i.value = !1, c);
81
+ function m() {
82
+ d.value && w(p.value) ? t.clipboard.readText().then((r) => {
83
+ n.value = r;
84
+ }) : n.value = R();
85
+ }
86
+ l.value && o && _(["copy", "cut"], m);
87
+ async function y(r = b(a)) {
88
+ l.value && r != null && (d.value && w(f.value) ? await t.clipboard.writeText(r) : F(r), n.value = r, i.value = !0, v.start());
89
+ }
90
+ function F(r) {
91
+ const s = document.createElement("textarea");
92
+ s.value = r ?? "", s.style.position = "absolute", s.style.opacity = "0", document.body.appendChild(s), s.select(), document.execCommand("copy"), s.remove();
93
+ }
94
+ function R() {
95
+ var r, s, h;
96
+ return (h = (s = (r = document == null ? void 0 : document.getSelection) == null ? void 0 : r.call(document)) == null ? void 0 : s.toString()) != null ? h : "";
97
+ }
98
+ function w(r) {
99
+ return r === "granted" || r === "prompt";
100
+ }
101
+ return {
102
+ isSupported: l,
103
+ text: n,
104
+ copied: i,
105
+ copy: y
106
+ };
107
+ }
108
+ export {
109
+ K as createFilterWrapper,
110
+ W as createSingletonPromise,
111
+ Q as debounceFilter,
112
+ E as defaultNavigator,
113
+ I as defaultWindow,
114
+ A as isClient,
115
+ q as isObject,
116
+ L as noop,
117
+ b as toValue,
118
+ O as tryOnScopeDispose,
119
+ N as unrefElement,
120
+ G as useClipboard,
121
+ U as useDebounceFn,
122
+ _ as useEventListener,
123
+ V as useMounted,
124
+ x as usePermission,
125
+ M as useSupported,
126
+ T as useTimeoutFn
127
+ };
@@ -1,45 +1,86 @@
1
1
  import "../../vue-demi/lib/index.js";
2
- import { unref as p } from "vue";
3
- function f(t) {
4
- return typeof t == "function" ? t() : p(t);
2
+ import { ref as d, readonly as b, unref as y, getCurrentScope as T, onScopeDispose as S } from "vue";
3
+ function g(e) {
4
+ return T() ? (S(e), !0) : !1;
5
5
  }
6
+ function a(e) {
7
+ return typeof e == "function" ? e() : y(e);
8
+ }
9
+ const w = typeof window < "u" && typeof document < "u";
6
10
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
7
- const m = () => {
11
+ const P = Object.prototype.toString, x = (e) => P.call(e) === "[object Object]", p = () => {
8
12
  };
9
- function h(t, n) {
10
- function r(...e) {
11
- return new Promise((i, o) => {
12
- Promise.resolve(t(() => n.apply(this, e), { fn: n, thisArg: this, args: e })).then(i).catch(o);
13
+ function h(e, n) {
14
+ function o(...t) {
15
+ return new Promise((i, r) => {
16
+ Promise.resolve(e(() => n.apply(this, t), { fn: n, thisArg: this, args: t })).then(i).catch(r);
13
17
  });
14
18
  }
15
- return r;
19
+ return o;
16
20
  }
17
- function T(t, n = {}) {
18
- let r, e, i = m;
19
- const o = (u) => {
20
- clearTimeout(u), i(), i = m;
21
+ function j(e, n = {}) {
22
+ let o, t, i = p;
23
+ const r = (u) => {
24
+ clearTimeout(u), i(), i = p;
21
25
  };
22
26
  return (u) => {
23
- const a = f(t), l = f(n.maxWait);
24
- return r && o(r), a <= 0 || l !== void 0 && l <= 0 ? (e && (o(e), e = null), Promise.resolve(u())) : new Promise((c, s) => {
25
- i = n.rejectOnCancel ? s : c, l && !e && (e = setTimeout(() => {
26
- r && o(r), e = null, c(u());
27
- }, l)), r = setTimeout(() => {
28
- e && o(e), e = null, c(u());
29
- }, a);
27
+ const l = a(e), c = a(n.maxWait);
28
+ return o && r(o), l <= 0 || c !== void 0 && c <= 0 ? (t && (r(t), t = null), Promise.resolve(u())) : new Promise((f, m) => {
29
+ i = n.rejectOnCancel ? m : f, c && !t && (t = setTimeout(() => {
30
+ o && r(o), t = null, f(u());
31
+ }, c)), o = setTimeout(() => {
32
+ t && r(t), t = null, f(u());
33
+ }, l);
30
34
  });
31
35
  };
32
36
  }
33
- function P(t, n = 200, r = {}) {
37
+ function D(e) {
38
+ let n;
39
+ function o() {
40
+ return n || (n = e()), n;
41
+ }
42
+ return o.reset = async () => {
43
+ const t = n;
44
+ n = void 0, t && await t;
45
+ }, o;
46
+ }
47
+ function F(e, n = 200, o = {}) {
34
48
  return h(
35
- T(n, r),
36
- t
49
+ j(n, o),
50
+ e
37
51
  );
38
52
  }
53
+ function W(e, n, o = {}) {
54
+ const {
55
+ immediate: t = !0
56
+ } = o, i = d(!1);
57
+ let r = null;
58
+ function s() {
59
+ r && (clearTimeout(r), r = null);
60
+ }
61
+ function u() {
62
+ i.value = !1, s();
63
+ }
64
+ function l(...c) {
65
+ s(), i.value = !0, r = setTimeout(() => {
66
+ i.value = !1, r = null, e(...c);
67
+ }, a(n));
68
+ }
69
+ return t && (i.value = !0, w && l()), g(u), {
70
+ isPending: b(i),
71
+ start: l,
72
+ stop: u
73
+ };
74
+ }
39
75
  export {
40
76
  h as createFilterWrapper,
41
- T as debounceFilter,
42
- m as noop,
43
- f as toValue,
44
- P as useDebounceFn
77
+ D as createSingletonPromise,
78
+ j as debounceFilter,
79
+ w as isClient,
80
+ x as isObject,
81
+ p as noop,
82
+ a as toValue,
83
+ g as tryOnScopeDispose,
84
+ F as useDebounceFn,
85
+ W as useTimeoutFn
45
86
  };