@pagelines/sdk 1.0.682 → 1.0.683
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AgentProvider.js +701 -0
- package/dist/AgentProvider.js.map +1 -0
- package/dist/AgentWidgetInline.js +44 -32
- package/dist/AgentWidgetInline.js.map +1 -1
- package/dist/AgentWidgetModal.js +75 -64
- package/dist/AgentWidgetModal.js.map +1 -1
- package/dist/AgentWrap.js +5180 -0
- package/dist/AgentWrap.js.map +1 -0
- package/dist/FModal.js +165 -0
- package/dist/FModal.js.map +1 -0
- package/dist/agent/ui/AgentChat.vue.d.ts +3 -4
- package/dist/agent/ui/AgentInputEmail.vue.d.ts +3 -2
- package/dist/agent/ui/AgentInputOneTimeCode.vue.d.ts +3 -4
- package/dist/agent/ui/AgentModal.vue.d.ts +2 -1
- package/dist/agent/ui/AgentProvider.vue.d.ts +2 -1
- package/dist/agent/ui/AgentSidebarClose.vue.d.ts +3 -2
- package/dist/agent/ui/AgentToolActivityGroup.vue.d.ts +2 -1
- package/dist/agent/ui/AgentWidget.vue.d.ts +3 -2
- package/dist/agent/ui/AgentWrap.vue.d.ts +14 -29
- package/dist/agent/ui/ChatRichText.vue.d.ts +2 -1
- package/dist/agent/ui/ChatScroller.vue.d.ts +8 -18
- package/dist/agent/ui/ChatVisualBlock.vue.d.ts +2 -3
- package/dist/agent/ui/ElAgentAbout.vue.d.ts +2 -1
- package/dist/agent/ui/ElAgentButton.vue.d.ts +7 -11
- package/dist/agent/ui/ElAgentChat.vue.d.ts +2 -53
- package/dist/agent/ui/ElAgentChatPreview.vue.d.ts +2 -1
- package/dist/agent/ui/ElAgentHeader.vue.d.ts +2 -1
- package/dist/agent/ui/ElAgentModeSidebar.vue.d.ts +2 -1
- package/dist/agent/ui/ElAgentSidebar.vue.d.ts +2 -1
- package/dist/agent/ui/ElAuthGate.vue.d.ts +2 -1
- package/dist/agent/ui/ElAuthPanel.vue.d.ts +2 -1
- package/dist/agent/ui/ElCreateAgent.vue.d.ts +3 -2
- package/dist/agent/ui/ElModeHeader.vue.d.ts +2 -1
- package/dist/agent/ui/ElProvisioningStatus.vue.d.ts +3 -2
- package/dist/agent/ui/ElSidebar.vue.d.ts +9 -12
- package/dist/agent/ui/ElTrialGate.vue.d.ts +2 -1
- package/dist/agent.js +157 -186
- package/dist/agent.js.map +1 -1
- package/dist/constants.js +80 -0
- package/dist/constants.js.map +1 -0
- package/dist/contract.js +6284 -0
- package/dist/contract.js.map +1 -0
- package/dist/demo.js +242 -259
- package/dist/demo.js.map +1 -1
- package/dist/rolldown-runtime.js +14 -0
- package/dist/sdk.css +2 -1
- package/dist/sdk.js +4 -14
- package/dist/sdkClient.js +775 -867
- package/dist/sdkClient.js.map +1 -1
- package/dist/ui/EffectTransitionList.vue.d.ts +7 -11
- package/dist/ui/FClose.vue.d.ts +3 -2
- package/dist/ui/FModal.vue.d.ts +7 -5
- package/dist/ui/FSpinner.vue.d.ts +3 -2
- package/dist/useWidgetState.js +21 -0
- package/dist/useWidgetState.js.map +1 -0
- package/dist/widget/ui/AgentWidgetInline.vue.d.ts +2 -1
- package/dist/widget/ui/AgentWidgetModal.vue.d.ts +2 -1
- package/dist/widget/ui/AgentWidgetOnboard.vue.d.ts +2 -1
- package/dist/widget/ui/AgentWidgetPopup.vue.d.ts +3 -2
- package/dist/widget.js +717 -7
- package/dist/widget.js.map +1 -1
- package/package.json +25 -25
- package/dist/AgentProvider.vue_vue_type_script_setup_true_lang.js +0 -842
- package/dist/AgentProvider.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/AgentWidgetOnboard.js +0 -5
- package/dist/AgentWidgetOnboard.js.map +0 -1
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js +0 -4952
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/FModal.vue_vue_type_script_setup_true_lang.js +0 -181
- package/dist/FModal.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/agent/test/AgentController.test.d.ts +0 -1
- package/dist/agent/test/AgentToolActivityGroup.client.test.d.ts +0 -1
- package/dist/agent/test/ChatRichText.client.test.d.ts +0 -1
- package/dist/agent/test/ChatVisualBlock.client.test.d.ts +0 -1
- package/dist/agent/test/ElAgentChat.client.test.d.ts +0 -1
- package/dist/agent/test/ElAgentChatPreview.client.test.d.ts +0 -1
- package/dist/agent/test/VoiceRecorderController.unit.test.d.ts +0 -1
- package/dist/agent/test/auth-inputs.test.d.ts +0 -1
- package/dist/agent/test/chat-visual-format.unit.test.d.ts +0 -1
- package/dist/agent/test/utils.test.d.ts +0 -1
- package/dist/agent/test/webhook.test.d.ts +0 -1
- package/dist/contract/regenerate.d.ts +0 -2
- package/dist/contract/test/build.unit.test.d.ts +0 -1
- package/dist/contract/test/conversation-wire-shapes.unit.test.d.ts +0 -14
- package/dist/contract/test/snapshot.unit.test.d.ts +0 -1
- package/dist/index.js +0 -871
- package/dist/index.js.map +0 -1
- package/dist/sdk.js.map +0 -1
- package/dist/socialPlatforms.js +0 -82
- package/dist/socialPlatforms.js.map +0 -1
- package/dist/test/agent-client.test.d.ts +0 -4
- package/dist/test/api.test.d.ts +0 -1
- package/dist/test/billing-client.test.d.ts +0 -4
- package/dist/test/build.test.d.ts +0 -1
- package/dist/test/chat-authenticated.test.d.ts +0 -1
- package/dist/test/chat-issue-presentation.test.d.ts +0 -1
- package/dist/test/derive-mode.test.d.ts +0 -1
- package/dist/test/sdk-token-capture.test.d.ts +0 -13
- package/dist/vite.config.sdk.d.ts +0 -2
- package/dist/vitest.config.d.ts +0 -2
|
@@ -2,7 +2,7 @@ import { PageLinesSDK } from '../../sdkClient';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
sdk: PageLinesSDK;
|
|
4
4
|
};
|
|
5
|
-
declare const
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
6
6
|
created: (agent: {
|
|
7
7
|
agentId?: string | undefined;
|
|
8
8
|
handle?: string | undefined;
|
|
@@ -212,5 +212,6 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
212
212
|
detail?: string | undefined;
|
|
213
213
|
} | undefined;
|
|
214
214
|
}) => any) | undefined;
|
|
215
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {},
|
|
215
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
216
|
+
declare const _default: typeof __VLS_export;
|
|
216
217
|
export default _default;
|
|
@@ -5,5 +5,6 @@ interface Props {
|
|
|
5
5
|
isOnline?: boolean;
|
|
6
6
|
layout?: 'centered' | 'horizontal';
|
|
7
7
|
}
|
|
8
|
-
declare const
|
|
8
|
+
declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
9
10
|
export default _default;
|
|
@@ -3,11 +3,12 @@ type __VLS_Props = {
|
|
|
3
3
|
sdk: PageLinesSDK;
|
|
4
4
|
agentId: string;
|
|
5
5
|
};
|
|
6
|
-
declare const
|
|
6
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
7
|
error: (message: string) => any;
|
|
8
8
|
ready: () => any;
|
|
9
9
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
10
|
onError?: ((message: string) => any) | undefined;
|
|
11
11
|
onReady?: (() => any) | undefined;
|
|
12
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {},
|
|
12
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
13
14
|
export default _default;
|
|
@@ -6,24 +6,21 @@ type __VLS_Props = {
|
|
|
6
6
|
title?: string;
|
|
7
7
|
widthClasses?: string;
|
|
8
8
|
};
|
|
9
|
-
declare
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
refs: {};
|
|
16
|
-
rootEl: any;
|
|
9
|
+
declare var __VLS_20: {}, __VLS_28: {};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
header?: (props: typeof __VLS_20) => any;
|
|
12
|
+
} & {
|
|
13
|
+
footer?: (props: typeof __VLS_28) => any;
|
|
17
14
|
};
|
|
18
|
-
|
|
19
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
20
16
|
"update:modelValue": (value: boolean) => any;
|
|
21
17
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
18
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
23
19
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
24
|
-
declare const
|
|
20
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
25
22
|
export default _default;
|
|
26
|
-
type
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
24
|
new (): {
|
|
28
25
|
$slots: S;
|
|
29
26
|
};
|
|
@@ -2,5 +2,6 @@ import { PageLinesSDK } from '../../sdkClient';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
sdk: PageLinesSDK;
|
|
4
4
|
};
|
|
5
|
-
declare const
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
6
7
|
export default _default;
|
package/dist/agent.js
CHANGED
|
@@ -1,187 +1,158 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
"data-test": "agent-chat-preview"
|
|
155
|
-
}, [
|
|
156
|
-
(n(!0), d(N, null, j(e.messages, (t, a) => (n(), d("div", {
|
|
157
|
-
key: `${t.sender}-${a}`,
|
|
158
|
-
class: f(["flex", t.sender === "user" ? "justify-end" : "justify-start"]),
|
|
159
|
-
"data-test": "agent-chat-preview-message",
|
|
160
|
-
"data-sender": t.sender
|
|
161
|
-
}, [
|
|
162
|
-
i("div", {
|
|
163
|
-
class: f(["max-w-[88%] rounded-2xl px-4 py-3 text-sm shadow-sm @sm/chat-preview:max-w-[78%]", t.sender === "user" ? "bg-slate-950 text-white" : e.variant === "dark" ? "border border-white/10 bg-white/10 text-white" : "border border-slate-200 bg-white text-slate-950"])
|
|
164
|
-
}, [
|
|
165
|
-
b(T, {
|
|
166
|
-
text: t.text,
|
|
167
|
-
inverted: t.sender === "user" || e.variant === "dark"
|
|
168
|
-
}, null, 8, ["text", "inverted"])
|
|
169
|
-
], 2)
|
|
170
|
-
], 10, D))), 128))
|
|
171
|
-
], 2));
|
|
172
|
-
}
|
|
1
|
+
import "./rolldown-runtime.js";
|
|
2
|
+
import { d as e, f as t, n, p as r, r as i, t as a } from "./AgentWrap.js";
|
|
3
|
+
import { n as o, t as s } from "./AgentProvider.js";
|
|
4
|
+
import { t as c } from "./FModal.js";
|
|
5
|
+
import { Fragment as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineComponent as h, nextTick as g, normalizeClass as _, normalizeStyle as v, openBlock as y, ref as b, renderList as x, watch as S, withCtx as C } from "vue";
|
|
6
|
+
//#region agent/ui/AgentModal.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var w = { class: "relative w-full h-[80vh] md:h-[600px]" }, T = /* @__PURE__ */ h({
|
|
8
|
+
name: "AgentModal",
|
|
9
|
+
__name: "AgentModal",
|
|
10
|
+
props: {
|
|
11
|
+
vis: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: !1
|
|
14
|
+
},
|
|
15
|
+
sdk: {},
|
|
16
|
+
agent: {},
|
|
17
|
+
handle: {},
|
|
18
|
+
context: {},
|
|
19
|
+
firstMessage: {}
|
|
20
|
+
},
|
|
21
|
+
emits: ["update:vis"],
|
|
22
|
+
setup(e, { emit: t }) {
|
|
23
|
+
let n = t;
|
|
24
|
+
return (t, r) => (y(), u(c, {
|
|
25
|
+
vis: e.vis,
|
|
26
|
+
"modal-class": "max-w-4xl p-0",
|
|
27
|
+
"style-class": "bg-transparent shadow-2xl rounded-2xl",
|
|
28
|
+
"has-close": !1,
|
|
29
|
+
"onUpdate:vis": r[1] || (r[1] = (e) => n("update:vis", e))
|
|
30
|
+
}, {
|
|
31
|
+
default: C(() => [p("div", w, [m(s, {
|
|
32
|
+
sdk: e.sdk,
|
|
33
|
+
agent: e.agent,
|
|
34
|
+
handle: e.handle,
|
|
35
|
+
context: e.context,
|
|
36
|
+
"first-message": e.firstMessage,
|
|
37
|
+
"has-close": !0,
|
|
38
|
+
onClose: r[0] || (r[0] = (e) => n("update:vis", !1))
|
|
39
|
+
}, null, 8, [
|
|
40
|
+
"sdk",
|
|
41
|
+
"agent",
|
|
42
|
+
"handle",
|
|
43
|
+
"context",
|
|
44
|
+
"first-message"
|
|
45
|
+
])])]),
|
|
46
|
+
_: 1
|
|
47
|
+
}, 8, ["vis"]));
|
|
48
|
+
}
|
|
49
|
+
}), E = {
|
|
50
|
+
key: 0,
|
|
51
|
+
class: "relative h-full w-full"
|
|
52
|
+
}, D = { class: "group relative h-full w-full rounded-3xl overflow-hidden shadow-lg transition-all duration-300 ease-[cubic-bezier(0.25,1,0.33,1)] hover:shadow-2xl hover:translate-y-[-1px] hover:brightness-110 active:scale-[1.06] active:-translate-y-0.5 active:duration-100" }, O = ["src", "alt"], k = {
|
|
53
|
+
key: 0,
|
|
54
|
+
class: "absolute top-0.5 right-0.5"
|
|
55
|
+
}, A = /* @__PURE__ */ h({
|
|
56
|
+
__name: "AgentWidget",
|
|
57
|
+
props: {
|
|
58
|
+
sdk: {},
|
|
59
|
+
handle: {},
|
|
60
|
+
context: {},
|
|
61
|
+
firstMessage: {},
|
|
62
|
+
position: {}
|
|
63
|
+
},
|
|
64
|
+
setup(e, { expose: t }) {
|
|
65
|
+
let n = e, r = b(!1), i = b(!1);
|
|
66
|
+
function toggle() {
|
|
67
|
+
r.value = !r.value;
|
|
68
|
+
}
|
|
69
|
+
S(r, async (e) => {
|
|
70
|
+
e ? (await g(), setTimeout(() => {
|
|
71
|
+
i.value = !0;
|
|
72
|
+
}, 400)) : i.value = !1;
|
|
73
|
+
});
|
|
74
|
+
function open() {
|
|
75
|
+
r.value = !0;
|
|
76
|
+
}
|
|
77
|
+
function close() {
|
|
78
|
+
r.value = !1;
|
|
79
|
+
}
|
|
80
|
+
function handleClose() {
|
|
81
|
+
close();
|
|
82
|
+
}
|
|
83
|
+
return t({
|
|
84
|
+
toggle,
|
|
85
|
+
open,
|
|
86
|
+
close
|
|
87
|
+
}), (t, s) => (y(), u(a, {
|
|
88
|
+
sdk: e.sdk,
|
|
89
|
+
handle: e.handle,
|
|
90
|
+
context: e.context,
|
|
91
|
+
"first-message": e.firstMessage
|
|
92
|
+
}, {
|
|
93
|
+
default: C(({ agent: t, sdk: a }) => [t ? (y(), f("div", {
|
|
94
|
+
key: 0,
|
|
95
|
+
class: _(["fixed z-[999999] pointer-events-auto", [n.position === "bottom-left" ? "bottom-6 left-6" : n.position === "top-right" ? "top-6 right-6" : n.position === "top-left" ? "top-6 left-6" : "bottom-6 right-6"]])
|
|
96
|
+
}, [p("div", {
|
|
97
|
+
class: _(["transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] transform-gpu", [r.value ? "widget-expanded w-96 h-[600px] max-w-[calc(100vw-48px)] max-h-[calc(100vh-48px)] rounded-3xl opacity-100 scale-100" : "widget-button w-[80px] h-[80px] opacity-100 scale-100 flex items-center justify-center cursor-pointer"]]),
|
|
98
|
+
style: v({ "transform-origin": n.position === "bottom-left" ? "bottom left" : n.position === "top-right" ? "top right" : n.position === "top-left" ? "top left" : "bottom right" }),
|
|
99
|
+
onClick: s[0] || (s[0] = (e) => r.value ? void 0 : toggle())
|
|
100
|
+
}, [r.value ? d("", !0) : (y(), f("div", E, [p("div", D, [p("img", {
|
|
101
|
+
src: t.avatarUrl.value,
|
|
102
|
+
alt: `${t.displayName.value} assistant`,
|
|
103
|
+
class: "h-full w-full object-cover pointer-events-none",
|
|
104
|
+
width: "80",
|
|
105
|
+
height: "80"
|
|
106
|
+
}, null, 8, O), s[1] || (s[1] = p("div", { class: "absolute inset-0 pointer-events-none bg-gradient-to-br from-transparent via-black/10 to-black/40 opacity-60 transition-opacity duration-300 group-hover:opacity-40" }, null, -1))]), t.state.value.lifecycle === "running" ? (y(), f("div", k, [...s[2] || (s[2] = [p("div", {
|
|
107
|
+
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
108
|
+
style: { "animation-duration": "3s" }
|
|
109
|
+
}, null, -1), p("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1)])])) : d("", !0)])), r.value && t ? (y(), u(o, {
|
|
110
|
+
key: 1,
|
|
111
|
+
class: "rounded-3xl shadow-2xl border border-white/10",
|
|
112
|
+
sdk: a,
|
|
113
|
+
agent: t,
|
|
114
|
+
context: e.context,
|
|
115
|
+
"first-message": e.firstMessage,
|
|
116
|
+
"has-close": !0,
|
|
117
|
+
"is-active": i.value,
|
|
118
|
+
onClose: handleClose
|
|
119
|
+
}, null, 8, [
|
|
120
|
+
"sdk",
|
|
121
|
+
"agent",
|
|
122
|
+
"context",
|
|
123
|
+
"first-message",
|
|
124
|
+
"is-active"
|
|
125
|
+
])) : d("", !0)], 6)], 2)) : d("", !0)]),
|
|
126
|
+
_: 1
|
|
127
|
+
}, 8, [
|
|
128
|
+
"sdk",
|
|
129
|
+
"handle",
|
|
130
|
+
"context",
|
|
131
|
+
"first-message"
|
|
132
|
+
]));
|
|
133
|
+
}
|
|
134
|
+
}), j = ["data-sender"], M = /* @__PURE__ */ h({
|
|
135
|
+
__name: "ElAgentChatPreview",
|
|
136
|
+
props: {
|
|
137
|
+
messages: {},
|
|
138
|
+
variant: {}
|
|
139
|
+
},
|
|
140
|
+
setup(e) {
|
|
141
|
+
return (t, n) => (y(), f("div", {
|
|
142
|
+
class: _(["@container/chat-preview flex flex-col gap-3", e.variant === "dark" ? "text-white" : "text-slate-950"]),
|
|
143
|
+
"data-test": "agent-chat-preview"
|
|
144
|
+
}, [(y(!0), f(l, null, x(e.messages, (t, n) => (y(), f("div", {
|
|
145
|
+
key: `${t.sender}-${n}`,
|
|
146
|
+
class: _(["flex", t.sender === "user" ? "justify-end" : "justify-start"]),
|
|
147
|
+
"data-test": "agent-chat-preview-message",
|
|
148
|
+
"data-sender": t.sender
|
|
149
|
+
}, [p("div", { class: _(["max-w-[88%] rounded-2xl px-4 py-3 text-sm shadow-sm @sm/chat-preview:max-w-[78%]", t.sender === "user" ? "bg-slate-950 text-white" : e.variant === "dark" ? "border border-white/10 bg-white/10 text-white" : "border border-slate-200 bg-white text-slate-950"]) }, [m(i, {
|
|
150
|
+
text: t.text,
|
|
151
|
+
inverted: t.sender === "user" || e.variant === "dark"
|
|
152
|
+
}, null, 8, ["text", "inverted"])], 2)], 10, j))), 128))], 2));
|
|
153
|
+
}
|
|
173
154
|
});
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
ee as AgentChatController,
|
|
179
|
-
te as AgentController,
|
|
180
|
-
J as AgentModal,
|
|
181
|
-
$ as AgentProvider,
|
|
182
|
-
K as AgentWidget,
|
|
183
|
-
P as AgentWrap,
|
|
184
|
-
se as ElAgentChat,
|
|
185
|
-
Q as ElAgentChatPreview
|
|
186
|
-
};
|
|
187
|
-
//# sourceMappingURL=agent.js.map
|
|
155
|
+
//#endregion
|
|
156
|
+
export { t as AGENT_MODES, r as Agent, o as AgentChat, e as AgentChatController, e as AgentController, T as AgentModal, s as AgentProvider, A as AgentWidget, a as AgentWrap, n as ElAgentChat, M as ElAgentChatPreview };
|
|
157
|
+
|
|
158
|
+
//# sourceMappingURL=agent.js.map
|
package/dist/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sources":["../agent/ui/AgentModal.vue","../agent/ui/AgentWidget.vue","../agent/ui/ElAgentChatPreview.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport type { AgentConfig } from '../schema'\nimport FModal from '../../ui/FModal.vue'\nimport AgentProvider from './AgentProvider.vue'\n\ndefineOptions({ name: 'AgentModal' })\n\nconst {\n vis = false,\n sdk,\n agent,\n handle,\n context,\n firstMessage,\n} = defineProps<{\n vis?: boolean\n sdk?: PageLinesSDK\n agent?: AgentConfig\n handle?: string\n context?: string\n firstMessage?: string\n}>()\n\nconst emit = defineEmits<{\n 'update:vis': [value: boolean]\n}>()\n</script>\n\n<template>\n <FModal\n :vis=\"vis\"\n modal-class=\"max-w-4xl p-0\"\n style-class=\"bg-transparent shadow-2xl rounded-2xl\"\n :has-close=\"false\"\n @update:vis=\"(val) => emit('update:vis', val)\"\n >\n <div class=\"relative w-full h-[80vh] md:h-[600px]\">\n <AgentProvider\n :sdk=\"sdk\"\n :agent=\"agent\"\n :handle=\"handle\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n :has-close=\"true\"\n @close=\"emit('update:vis', false)\"\n />\n </div>\n </FModal>\n</template>\n","<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport { nextTick, ref, watch } from 'vue'\nimport AgentChat from './AgentChat.vue'\nimport AgentWrap from './AgentWrap.vue'\n\ninterface Props {\n sdk?: PageLinesSDK\n handle: string\n context?: string\n firstMessage?: string\n position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\n}\n\nconst props = defineProps<Props>()\nconst isOpen = ref(false)\nconst isAgentActive = ref(false)\n\nfunction toggle() {\n isOpen.value = !isOpen.value\n}\n\n// Watch isOpen to delay agent activation for smooth transition\nwatch(isOpen, async (newValue) => {\n if (newValue) {\n // When opening, delay agent activation until transition starts\n await nextTick()\n setTimeout(() => {\n isAgentActive.value = true\n }, 400) // Delay to let container expand first\n } else {\n // When closing, immediately deactivate agent\n isAgentActive.value = false\n }\n})\n\nfunction open() {\n isOpen.value = true\n}\n\nfunction close() {\n isOpen.value = false\n}\n\nfunction handleClose() {\n close()\n}\n\ndefineExpose({\n toggle,\n open,\n close,\n})\n</script>\n\n<template>\n <AgentWrap\n v-slot=\"{ agent, sdk: resolvedSdk }\"\n :sdk=\"sdk\"\n :handle=\"handle\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n >\n <!-- Fixed Widget Wrapper -->\n <div\n v-if=\"agent\"\n class=\"fixed z-[999999] pointer-events-auto\"\n :class=\"[\n props.position === 'bottom-left' ? 'bottom-6 left-6'\n : props.position === 'top-right' ? 'top-6 right-6'\n : props.position === 'top-left' ? 'top-6 left-6'\n : 'bottom-6 right-6',\n ]\"\n >\n <!-- Widget Content with Transition -->\n <div\n class=\"transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] transform-gpu\"\n :class=\"[\n isOpen\n ? 'widget-expanded w-96 h-[600px] max-w-[calc(100vw-48px)] max-h-[calc(100vh-48px)] rounded-3xl opacity-100 scale-100'\n : 'widget-button w-[80px] h-[80px] opacity-100 scale-100 flex items-center justify-center cursor-pointer',\n ]\"\n :style=\"{\n 'transform-origin':\n props.position === 'bottom-left' ? 'bottom left'\n : props.position === 'top-right' ? 'top right'\n : props.position === 'top-left' ? 'top left'\n : 'bottom right',\n }\"\n @click=\"!isOpen ? toggle() : undefined\"\n >\n <!-- Button Content (visible when closed) -->\n <div v-if=\"!isOpen\" class=\"relative h-full w-full\">\n <div class=\"group relative h-full w-full rounded-3xl overflow-hidden shadow-lg transition-all duration-300 ease-[cubic-bezier(0.25,1,0.33,1)] hover:shadow-2xl hover:translate-y-[-1px] hover:brightness-110 active:scale-[1.06] active:-translate-y-0.5 active:duration-100\">\n <img\n :src=\"agent.avatarUrl.value\"\n :alt=\"`${agent.displayName.value} assistant`\"\n class=\"h-full w-full object-cover pointer-events-none\"\n width=\"80\"\n height=\"80\"\n />\n <!-- Gradient overlay for contrast -->\n <div class=\"absolute inset-0 pointer-events-none bg-gradient-to-br from-transparent via-black/10 to-black/40 opacity-60 transition-opacity duration-300 group-hover:opacity-40\" />\n </div>\n <!-- Online indicator -->\n <div v-if=\"agent.state.value.lifecycle === 'running'\" class=\"absolute top-0.5 right-0.5\">\n <div class=\"size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping\" style=\"animation-duration: 3s;\" />\n <div class=\"size-3 bg-green-500 rounded-full ring-2 ring-white\" />\n </div>\n </div>\n\n <!-- Chat Content (visible when open) -->\n <AgentChat\n v-if=\"isOpen && agent\"\n class=\"rounded-3xl shadow-2xl border border-white/10\"\n :sdk=\"resolvedSdk\"\n :agent=\"agent\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n :has-close=\"true\"\n :is-active=\"isAgentActive\"\n @close=\"handleClose\"\n />\n </div>\n </div>\n </AgentWrap>\n</template>\n","<script setup lang=\"ts\">\nimport ChatRichText from './ChatRichText.vue'\n\nexport type ChatPreviewMessage = {\n sender: 'user' | 'agent'\n text: string\n}\n\ndefineProps<{\n messages: ChatPreviewMessage[]\n variant?: 'light' | 'dark'\n}>()\n</script>\n\n<template>\n <div\n class=\"@container/chat-preview flex flex-col gap-3\"\n :class=\"variant === 'dark' ? 'text-white' : 'text-slate-950'\"\n data-test=\"agent-chat-preview\"\n >\n <div\n v-for=\"(message, index) in messages\"\n :key=\"`${message.sender}-${index}`\"\n class=\"flex\"\n :class=\"message.sender === 'user' ? 'justify-end' : 'justify-start'\"\n data-test=\"agent-chat-preview-message\"\n :data-sender=\"message.sender\"\n >\n <div\n class=\"max-w-[88%] rounded-2xl px-4 py-3 text-sm shadow-sm @sm/chat-preview:max-w-[78%]\"\n :class=\"message.sender === 'user'\n ? 'bg-slate-950 text-white'\n : variant === 'dark'\n ? 'border border-white/10 bg-white/10 text-white'\n : 'border border-slate-200 bg-white text-slate-950'\"\n >\n <ChatRichText\n :text=\"message.text\"\n :inverted=\"message.sender === 'user' || variant === 'dark'\"\n />\n </div>\n </div>\n </div>\n</template>\n"],"names":["emit","__emit","_createBlock","FModal","__props","_cache","val","_createElementVNode","_hoisted_1","_createVNode","AgentProvider","props","isOpen","ref","isAgentActive","toggle","__name","watch","newValue","nextTick","open","close","handleClose","__expose","AgentWrap","agent","resolvedSdk","_createElementBlock","_normalizeStyle","$event","_openBlock","_hoisted_2","_hoisted_4","AgentChat","_normalizeClass","_Fragment","_renderList","message","index","ChatRichText"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA,UAAMA,IAAOC;2BAMXC,EAkBSC,GAAA;AAAA,MAjBN,KAAKC,EAAA;AAAA,MACN,eAAY;AAAA,MACZ,eAAY;AAAA,MACX,aAAW;AAAA,MACX,gBAAUC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAGC,MAAQN,gBAAmBM,CAAG;AAAA,IAAA;iBAE5C,MAUM;AAAA,QAVNC,EAUM,OAVNC,GAUM;AAAA,UATJC,EAQEC,GAAA;AAAA,YAPC,KAAKN,EAAA;AAAA,YACL,OAAOA,EAAA;AAAA,YACP,QAAQA,EAAA;AAAA,YACR,SAASA,EAAA;AAAA,YACT,iBAAeA,EAAA;AAAA,YACf,aAAW;AAAA,YACX,gCAAOJ,EAAI,cAAA,EAAA;AAAA,UAAA;;;;;;;;;;;;;;;;;;;;;;AC/BpB,UAAMW,IAAQP,GACRQ,IAASC,EAAI,EAAK,GAClBC,IAAgBD,EAAI,EAAK;AAE/B,aAASE,IAAS;AAChB,MAAAH,EAAO,QAAQ,CAACA,EAAO;AAAA,IACzB;AAFS,IAAAI,EAAAD,GAAA,WAKTE,EAAML,GAAQ,OAAOM,MAAa;AAChC,MAAIA,KAEF,MAAMC,EAAA,GACN,WAAW,MAAM;AACf,QAAAL,EAAc,QAAQ;AAAA,MACxB,GAAG,GAAG,KAGNA,EAAc,QAAQ;AAAA,IAE1B,CAAC;AAED,aAASM,IAAO;AACd,MAAAR,EAAO,QAAQ;AAAA,IACjB;AAFS,IAAAI,EAAAI,GAAA;AAIT,aAASC,IAAQ;AACf,MAAAT,EAAO,QAAQ;AAAA,IACjB;AAFS,IAAAI,EAAAK,GAAA;AAIT,aAASC,IAAc;AACrB,MAAA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AAA;AAAA,kBAAnH,OAAM;AAAA,kBAA2E,OAAA,EAAA,sBAAA,KAAA;AAAA,gBAAA;gBACtFA,EAAkE,OAAA,EAA7D,OAAM,qDAAA,GAAoD,MAAA,EAAA;AAAA,cAAA;;YAM3DK,EAAA,SAAUa,UADlBvB,EAUE+B,GAAA;AAAA;cARA,OAAM;AAAA,cACL,KAAKP;AAAA,cACL,OAAAD;AAAA,cACA,SAASrB,EAAA;AAAA,cACT,iBAAeA,EAAA;AAAA,cACf,aAAW;AAAA,cACX,aAAWU,EAAA;AAAA,cACX,SAAOQ;AAAA,YAAA;;;;;;;;;;;;;;2BC1GhBK,EA2BM,OAAA;AAAA,MA1BJ,OAAKO,EAAA,CAAC,+CACE9B,EAAA,YAAO,SAAA,eAAA,gBAAA,CAAA;AAAA,MACf,aAAU;AAAA,IAAA;OAEV0B,EAAA,EAAA,GAAAH,EAqBMQ,GAAA,MAAAC,EApBuBhC,EAAA,UAAQ,CAA3BiC,GAASC,YADnBX,EAqBM,OAAA;AAAA,QAnBH,KAAG,GAAKU,EAAQ,MAAM,IAAIC,CAAK;AAAA,QAChC,OAAKJ,EAAA,CAAC,QACEG,EAAQ,WAAM,SAAA,gBAAA,eAAA,CAAA;AAAA,QACtB,aAAU;AAAA,QACT,eAAaA,EAAQ;AAAA,MAAA;QAEtB9B,EAYM,OAAA;AAAA,UAXJ,OAAK2B,EAAA,CAAC,oFACEG,EAAQ,WAAM,qCAA8DjC,EAAA,YAAO;;UAM3FK,EAGE8B,GAAA;AAAA,YAFC,MAAMF,EAAQ;AAAA,YACd,UAAUA,EAAQ,qBAAqBjC,EAAA,YAAO;AAAA,UAAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"agent.js","names":[],"sources":["../agent/ui/AgentModal.vue","../agent/ui/AgentModal.vue","../agent/ui/AgentWidget.vue","../agent/ui/AgentWidget.vue","../agent/ui/ElAgentChatPreview.vue","../agent/ui/ElAgentChatPreview.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport type { AgentConfig } from '../schema'\nimport FModal from '../../ui/FModal.vue'\nimport AgentProvider from './AgentProvider.vue'\n\ndefineOptions({ name: 'AgentModal' })\n\nconst {\n vis = false,\n sdk,\n agent,\n handle,\n context,\n firstMessage,\n} = defineProps<{\n vis?: boolean\n sdk?: PageLinesSDK\n agent?: AgentConfig\n handle?: string\n context?: string\n firstMessage?: string\n}>()\n\nconst emit = defineEmits<{\n 'update:vis': [value: boolean]\n}>()\n</script>\n\n<template>\n <FModal\n :vis=\"vis\"\n modal-class=\"max-w-4xl p-0\"\n style-class=\"bg-transparent shadow-2xl rounded-2xl\"\n :has-close=\"false\"\n @update:vis=\"(val) => emit('update:vis', val)\"\n >\n <div class=\"relative w-full h-[80vh] md:h-[600px]\">\n <AgentProvider\n :sdk=\"sdk\"\n :agent=\"agent\"\n :handle=\"handle\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n :has-close=\"true\"\n @close=\"emit('update:vis', false)\"\n />\n </div>\n </FModal>\n</template>\n","<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport type { AgentConfig } from '../schema'\nimport FModal from '../../ui/FModal.vue'\nimport AgentProvider from './AgentProvider.vue'\n\ndefineOptions({ name: 'AgentModal' })\n\nconst {\n vis = false,\n sdk,\n agent,\n handle,\n context,\n firstMessage,\n} = defineProps<{\n vis?: boolean\n sdk?: PageLinesSDK\n agent?: AgentConfig\n handle?: string\n context?: string\n firstMessage?: string\n}>()\n\nconst emit = defineEmits<{\n 'update:vis': [value: boolean]\n}>()\n</script>\n\n<template>\n <FModal\n :vis=\"vis\"\n modal-class=\"max-w-4xl p-0\"\n style-class=\"bg-transparent shadow-2xl rounded-2xl\"\n :has-close=\"false\"\n @update:vis=\"(val) => emit('update:vis', val)\"\n >\n <div class=\"relative w-full h-[80vh] md:h-[600px]\">\n <AgentProvider\n :sdk=\"sdk\"\n :agent=\"agent\"\n :handle=\"handle\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n :has-close=\"true\"\n @close=\"emit('update:vis', false)\"\n />\n </div>\n </FModal>\n</template>\n","<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport { nextTick, ref, watch } from 'vue'\nimport AgentChat from './AgentChat.vue'\nimport AgentWrap from './AgentWrap.vue'\n\ninterface Props {\n sdk?: PageLinesSDK\n handle: string\n context?: string\n firstMessage?: string\n position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\n}\n\nconst props = defineProps<Props>()\nconst isOpen = ref(false)\nconst isAgentActive = ref(false)\n\nfunction toggle() {\n isOpen.value = !isOpen.value\n}\n\n// Watch isOpen to delay agent activation for smooth transition\nwatch(isOpen, async (newValue) => {\n if (newValue) {\n // When opening, delay agent activation until transition starts\n await nextTick()\n setTimeout(() => {\n isAgentActive.value = true\n }, 400) // Delay to let container expand first\n } else {\n // When closing, immediately deactivate agent\n isAgentActive.value = false\n }\n})\n\nfunction open() {\n isOpen.value = true\n}\n\nfunction close() {\n isOpen.value = false\n}\n\nfunction handleClose() {\n close()\n}\n\ndefineExpose({\n toggle,\n open,\n close,\n})\n</script>\n\n<template>\n <AgentWrap\n v-slot=\"{ agent, sdk: resolvedSdk }\"\n :sdk=\"sdk\"\n :handle=\"handle\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n >\n <!-- Fixed Widget Wrapper -->\n <div\n v-if=\"agent\"\n class=\"fixed z-[999999] pointer-events-auto\"\n :class=\"[\n props.position === 'bottom-left' ? 'bottom-6 left-6'\n : props.position === 'top-right' ? 'top-6 right-6'\n : props.position === 'top-left' ? 'top-6 left-6'\n : 'bottom-6 right-6',\n ]\"\n >\n <!-- Widget Content with Transition -->\n <div\n class=\"transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] transform-gpu\"\n :class=\"[\n isOpen\n ? 'widget-expanded w-96 h-[600px] max-w-[calc(100vw-48px)] max-h-[calc(100vh-48px)] rounded-3xl opacity-100 scale-100'\n : 'widget-button w-[80px] h-[80px] opacity-100 scale-100 flex items-center justify-center cursor-pointer',\n ]\"\n :style=\"{\n 'transform-origin':\n props.position === 'bottom-left' ? 'bottom left'\n : props.position === 'top-right' ? 'top right'\n : props.position === 'top-left' ? 'top left'\n : 'bottom right',\n }\"\n @click=\"!isOpen ? toggle() : undefined\"\n >\n <!-- Button Content (visible when closed) -->\n <div v-if=\"!isOpen\" class=\"relative h-full w-full\">\n <div class=\"group relative h-full w-full rounded-3xl overflow-hidden shadow-lg transition-all duration-300 ease-[cubic-bezier(0.25,1,0.33,1)] hover:shadow-2xl hover:translate-y-[-1px] hover:brightness-110 active:scale-[1.06] active:-translate-y-0.5 active:duration-100\">\n <img\n :src=\"agent.avatarUrl.value\"\n :alt=\"`${agent.displayName.value} assistant`\"\n class=\"h-full w-full object-cover pointer-events-none\"\n width=\"80\"\n height=\"80\"\n />\n <!-- Gradient overlay for contrast -->\n <div class=\"absolute inset-0 pointer-events-none bg-gradient-to-br from-transparent via-black/10 to-black/40 opacity-60 transition-opacity duration-300 group-hover:opacity-40\" />\n </div>\n <!-- Online indicator -->\n <div v-if=\"agent.state.value.lifecycle === 'running'\" class=\"absolute top-0.5 right-0.5\">\n <div class=\"size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping\" style=\"animation-duration: 3s;\" />\n <div class=\"size-3 bg-green-500 rounded-full ring-2 ring-white\" />\n </div>\n </div>\n\n <!-- Chat Content (visible when open) -->\n <AgentChat\n v-if=\"isOpen && agent\"\n class=\"rounded-3xl shadow-2xl border border-white/10\"\n :sdk=\"resolvedSdk\"\n :agent=\"agent\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n :has-close=\"true\"\n :is-active=\"isAgentActive\"\n @close=\"handleClose\"\n />\n </div>\n </div>\n </AgentWrap>\n</template>\n","<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport { nextTick, ref, watch } from 'vue'\nimport AgentChat from './AgentChat.vue'\nimport AgentWrap from './AgentWrap.vue'\n\ninterface Props {\n sdk?: PageLinesSDK\n handle: string\n context?: string\n firstMessage?: string\n position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\n}\n\nconst props = defineProps<Props>()\nconst isOpen = ref(false)\nconst isAgentActive = ref(false)\n\nfunction toggle() {\n isOpen.value = !isOpen.value\n}\n\n// Watch isOpen to delay agent activation for smooth transition\nwatch(isOpen, async (newValue) => {\n if (newValue) {\n // When opening, delay agent activation until transition starts\n await nextTick()\n setTimeout(() => {\n isAgentActive.value = true\n }, 400) // Delay to let container expand first\n } else {\n // When closing, immediately deactivate agent\n isAgentActive.value = false\n }\n})\n\nfunction open() {\n isOpen.value = true\n}\n\nfunction close() {\n isOpen.value = false\n}\n\nfunction handleClose() {\n close()\n}\n\ndefineExpose({\n toggle,\n open,\n close,\n})\n</script>\n\n<template>\n <AgentWrap\n v-slot=\"{ agent, sdk: resolvedSdk }\"\n :sdk=\"sdk\"\n :handle=\"handle\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n >\n <!-- Fixed Widget Wrapper -->\n <div\n v-if=\"agent\"\n class=\"fixed z-[999999] pointer-events-auto\"\n :class=\"[\n props.position === 'bottom-left' ? 'bottom-6 left-6'\n : props.position === 'top-right' ? 'top-6 right-6'\n : props.position === 'top-left' ? 'top-6 left-6'\n : 'bottom-6 right-6',\n ]\"\n >\n <!-- Widget Content with Transition -->\n <div\n class=\"transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] transform-gpu\"\n :class=\"[\n isOpen\n ? 'widget-expanded w-96 h-[600px] max-w-[calc(100vw-48px)] max-h-[calc(100vh-48px)] rounded-3xl opacity-100 scale-100'\n : 'widget-button w-[80px] h-[80px] opacity-100 scale-100 flex items-center justify-center cursor-pointer',\n ]\"\n :style=\"{\n 'transform-origin':\n props.position === 'bottom-left' ? 'bottom left'\n : props.position === 'top-right' ? 'top right'\n : props.position === 'top-left' ? 'top left'\n : 'bottom right',\n }\"\n @click=\"!isOpen ? toggle() : undefined\"\n >\n <!-- Button Content (visible when closed) -->\n <div v-if=\"!isOpen\" class=\"relative h-full w-full\">\n <div class=\"group relative h-full w-full rounded-3xl overflow-hidden shadow-lg transition-all duration-300 ease-[cubic-bezier(0.25,1,0.33,1)] hover:shadow-2xl hover:translate-y-[-1px] hover:brightness-110 active:scale-[1.06] active:-translate-y-0.5 active:duration-100\">\n <img\n :src=\"agent.avatarUrl.value\"\n :alt=\"`${agent.displayName.value} assistant`\"\n class=\"h-full w-full object-cover pointer-events-none\"\n width=\"80\"\n height=\"80\"\n />\n <!-- Gradient overlay for contrast -->\n <div class=\"absolute inset-0 pointer-events-none bg-gradient-to-br from-transparent via-black/10 to-black/40 opacity-60 transition-opacity duration-300 group-hover:opacity-40\" />\n </div>\n <!-- Online indicator -->\n <div v-if=\"agent.state.value.lifecycle === 'running'\" class=\"absolute top-0.5 right-0.5\">\n <div class=\"size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping\" style=\"animation-duration: 3s;\" />\n <div class=\"size-3 bg-green-500 rounded-full ring-2 ring-white\" />\n </div>\n </div>\n\n <!-- Chat Content (visible when open) -->\n <AgentChat\n v-if=\"isOpen && agent\"\n class=\"rounded-3xl shadow-2xl border border-white/10\"\n :sdk=\"resolvedSdk\"\n :agent=\"agent\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n :has-close=\"true\"\n :is-active=\"isAgentActive\"\n @close=\"handleClose\"\n />\n </div>\n </div>\n </AgentWrap>\n</template>\n","<script setup lang=\"ts\">\nimport ChatRichText from './ChatRichText.vue'\n\nexport type ChatPreviewMessage = {\n sender: 'user' | 'agent'\n text: string\n}\n\ndefineProps<{\n messages: ChatPreviewMessage[]\n variant?: 'light' | 'dark'\n}>()\n</script>\n\n<template>\n <div\n class=\"@container/chat-preview flex flex-col gap-3\"\n :class=\"variant === 'dark' ? 'text-white' : 'text-slate-950'\"\n data-test=\"agent-chat-preview\"\n >\n <div\n v-for=\"(message, index) in messages\"\n :key=\"`${message.sender}-${index}`\"\n class=\"flex\"\n :class=\"message.sender === 'user' ? 'justify-end' : 'justify-start'\"\n data-test=\"agent-chat-preview-message\"\n :data-sender=\"message.sender\"\n >\n <div\n class=\"max-w-[88%] rounded-2xl px-4 py-3 text-sm shadow-sm @sm/chat-preview:max-w-[78%]\"\n :class=\"message.sender === 'user'\n ? 'bg-slate-950 text-white'\n : variant === 'dark'\n ? 'border border-white/10 bg-white/10 text-white'\n : 'border border-slate-200 bg-white text-slate-950'\"\n >\n <ChatRichText\n :text=\"message.text\"\n :inverted=\"message.sender === 'user' || variant === 'dark'\"\n />\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport ChatRichText from './ChatRichText.vue'\n\nexport type ChatPreviewMessage = {\n sender: 'user' | 'agent'\n text: string\n}\n\ndefineProps<{\n messages: ChatPreviewMessage[]\n variant?: 'light' | 'dark'\n}>()\n</script>\n\n<template>\n <div\n class=\"@container/chat-preview flex flex-col gap-3\"\n :class=\"variant === 'dark' ? 'text-white' : 'text-slate-950'\"\n data-test=\"agent-chat-preview\"\n >\n <div\n v-for=\"(message, index) in messages\"\n :key=\"`${message.sender}-${index}`\"\n class=\"flex\"\n :class=\"message.sender === 'user' ? 'justify-end' : 'justify-start'\"\n data-test=\"agent-chat-preview-message\"\n :data-sender=\"message.sender\"\n >\n <div\n class=\"max-w-[88%] rounded-2xl px-4 py-3 text-sm shadow-sm @sm/chat-preview:max-w-[78%]\"\n :class=\"message.sender === 'user'\n ? 'bg-slate-950 text-white'\n : variant === 'dark'\n ? 'border border-white/10 bg-white/10 text-white'\n : 'border border-slate-200 bg-white text-slate-950'\"\n >\n <ChatRichText\n :text=\"message.text\"\n :inverted=\"message.sender === 'user' || variant === 'dark'\"\n />\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAwBA,IAAM,IAAO;yBAMX,EAkBS,GAAA;GAjBN,KAAK,EAAA;GACN,eAAY;GACZ,eAAY;GACX,aAAW;GACX,gBAA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A8D,EAAA,YAAO,SAAA,kDAAA,iDAAA,CAAA,EAAA,GAAA,CAM3F,EAGE,GAAA;GAFC,MAAM,EAAQ;GACd,UAAU,EAAQ,WAAM,UAAe,EAAA,YAAO"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import "./rolldown-runtime.js";
|
|
2
|
+
//#region constants/socialPlatforms.ts
|
|
3
|
+
var e = {
|
|
4
|
+
linkedin: {
|
|
5
|
+
label: "LinkedIn",
|
|
6
|
+
icon: "i-simple-icons-linkedin",
|
|
7
|
+
placeholder: "john-smith",
|
|
8
|
+
getUrl: (e) => `https://linkedin.com/in/${e}`
|
|
9
|
+
},
|
|
10
|
+
x: {
|
|
11
|
+
label: "X",
|
|
12
|
+
icon: "i-simple-icons-x",
|
|
13
|
+
placeholder: "johnsmith",
|
|
14
|
+
getUrl: (e) => `https://x.com/${e}`
|
|
15
|
+
},
|
|
16
|
+
facebook: {
|
|
17
|
+
label: "Facebook",
|
|
18
|
+
icon: "i-simple-icons-facebook",
|
|
19
|
+
placeholder: "johnsmith",
|
|
20
|
+
getUrl: (e) => `https://facebook.com/${e}`
|
|
21
|
+
},
|
|
22
|
+
tiktok: {
|
|
23
|
+
label: "TikTok",
|
|
24
|
+
icon: "i-simple-icons-tiktok",
|
|
25
|
+
placeholder: "johnsmith",
|
|
26
|
+
getUrl: (e) => `https://tiktok.com/@${e}`
|
|
27
|
+
},
|
|
28
|
+
youtube: {
|
|
29
|
+
label: "YouTube",
|
|
30
|
+
icon: "i-tabler-brand-youtube",
|
|
31
|
+
placeholder: "johnsmith",
|
|
32
|
+
getUrl: (e) => `https://youtube.com/@${e}`
|
|
33
|
+
},
|
|
34
|
+
github: {
|
|
35
|
+
label: "GitHub",
|
|
36
|
+
icon: "i-tabler-brand-github",
|
|
37
|
+
placeholder: "johnsmith",
|
|
38
|
+
getUrl: (e) => `https://github.com/${e}`
|
|
39
|
+
},
|
|
40
|
+
instagram: {
|
|
41
|
+
label: "Instagram",
|
|
42
|
+
icon: "i-simple-icons-instagram",
|
|
43
|
+
placeholder: "johnsmith",
|
|
44
|
+
getUrl: (e) => `https://instagram.com/${e}`
|
|
45
|
+
},
|
|
46
|
+
threads: {
|
|
47
|
+
label: "Threads",
|
|
48
|
+
icon: "i-simple-icons-threads",
|
|
49
|
+
placeholder: "johnsmith",
|
|
50
|
+
getUrl: (e) => `https://threads.net/@${e}`
|
|
51
|
+
},
|
|
52
|
+
email: {
|
|
53
|
+
label: "Email",
|
|
54
|
+
icon: "i-tabler-mail",
|
|
55
|
+
placeholder: "hello@example.com",
|
|
56
|
+
getUrl: (e) => `mailto:${e}`
|
|
57
|
+
},
|
|
58
|
+
phone: {
|
|
59
|
+
label: "Phone",
|
|
60
|
+
icon: "i-tabler-phone",
|
|
61
|
+
placeholder: "+1-555-123-4567",
|
|
62
|
+
getUrl: (e) => `tel:${e.replace(/[^0-9+]/g, "")}`
|
|
63
|
+
},
|
|
64
|
+
website: {
|
|
65
|
+
label: "Website",
|
|
66
|
+
icon: "i-tabler-world",
|
|
67
|
+
placeholder: "https://example.com",
|
|
68
|
+
getUrl: (e) => e
|
|
69
|
+
},
|
|
70
|
+
calendar: {
|
|
71
|
+
label: "Calendar",
|
|
72
|
+
icon: "i-tabler-calendar",
|
|
73
|
+
placeholder: "https://cal.com/username",
|
|
74
|
+
getUrl: (e) => e
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
export { e as SOCIAL_PLATFORMS };
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["../constants/socialPlatforms.ts"],"sourcesContent":["import type { SocialAccount } from '@pagelines/core'\n\n// Extract platform type from schema to ensure type safety\ntype Platform = SocialAccount['platform']\n\n// Platform metadata for URL generation and display\n// TypeScript enforces completeness - must include all platforms from schema\nexport const SOCIAL_PLATFORMS: Record<Platform, {\n label: string\n icon: string\n placeholder: string\n getUrl: (handle: string) => string\n}> = {\n linkedin: {\n label: 'LinkedIn',\n icon: 'i-simple-icons-linkedin',\n placeholder: 'john-smith',\n getUrl: (handle: string) => `https://linkedin.com/in/${handle}`,\n },\n x: {\n label: 'X',\n icon: 'i-simple-icons-x',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://x.com/${handle}`,\n },\n facebook: {\n label: 'Facebook',\n icon: 'i-simple-icons-facebook',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://facebook.com/${handle}`,\n },\n tiktok: {\n label: 'TikTok',\n icon: 'i-simple-icons-tiktok',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://tiktok.com/@${handle}`,\n },\n youtube: {\n label: 'YouTube',\n icon: 'i-tabler-brand-youtube',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://youtube.com/@${handle}`,\n },\n github: {\n label: 'GitHub',\n icon: 'i-tabler-brand-github',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://github.com/${handle}`,\n },\n instagram: {\n label: 'Instagram',\n icon: 'i-simple-icons-instagram',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://instagram.com/${handle}`,\n },\n threads: {\n label: 'Threads',\n icon: 'i-simple-icons-threads',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://threads.net/@${handle}`,\n },\n email: {\n label: 'Email',\n icon: 'i-tabler-mail',\n placeholder: 'hello@example.com',\n getUrl: (handle: string) => `mailto:${handle}`,\n },\n phone: {\n label: 'Phone',\n icon: 'i-tabler-phone',\n placeholder: '+1-555-123-4567',\n getUrl: (handle: string) => `tel:${handle.replace(/[^0-9+]/g, '')}`,\n },\n website: {\n label: 'Website',\n icon: 'i-tabler-world',\n placeholder: 'https://example.com',\n getUrl: (handle: string) => handle, // handle IS the URL\n },\n calendar: {\n label: 'Calendar',\n icon: 'i-tabler-calendar',\n placeholder: 'https://cal.com/username',\n getUrl: (handle: string) => handle, // handle IS the URL (e.g., Cal.com link)\n },\n} as const\n\nexport type SocialPlatform = keyof typeof SOCIAL_PLATFORMS\n"],"mappings":";;AAOA,IAAa,IAKR;CACH,UAAU;EACR,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,2BAA2B;CACzD;CACA,GAAG;EACD,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,iBAAiB;CAC/C;CACA,UAAU;EACR,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,wBAAwB;CACtD;CACA,QAAQ;EACN,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,uBAAuB;CACrD;CACA,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,wBAAwB;CACtD;CACA,QAAQ;EACN,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,sBAAsB;CACpD;CACA,WAAW;EACT,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,yBAAyB;CACvD;CACA,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,wBAAwB;CACtD;CACA,OAAO;EACL,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,UAAU;CACxC;CACA,OAAO;EACL,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,OAAO,EAAO,QAAQ,YAAY,EAAE;CAClE;CACA,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB;CAC9B;CACA,UAAU;EACR,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB;CAC9B;AACF"}
|