pptx-vue-viewer 4.1.2 → 4.1.4
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/CHANGELOG.md +22 -0
- package/dist/{AiChatPanel-BAALzbEt.cjs → AiChatPanel-CcsFus_r.cjs} +202 -221
- package/dist/AiChatPanel-CcsFus_r.cjs.br +0 -0
- package/dist/AiChatPanel-CcsFus_r.cjs.gz +0 -0
- package/dist/AiChatPanel-D-Ct97lz.js +620 -0
- package/dist/AiChatPanel-D-Ct97lz.js.br +0 -0
- package/dist/AiChatPanel-D-Ct97lz.js.gz +0 -0
- package/dist/{dist-Br8KDhMp.cjs → dist-sCkfhMyk.cjs} +39 -36
- package/dist/dist-sCkfhMyk.cjs.br +0 -0
- package/dist/{dist-Br8KDhMp.cjs.gz → dist-sCkfhMyk.cjs.gz} +0 -0
- package/dist/{dist-DSVV_5rB.js → dist-zk_4DkIr.js} +39 -36
- package/dist/dist-zk_4DkIr.js.br +0 -0
- package/dist/{dist-DSVV_5rB.js.gz → dist-zk_4DkIr.js.gz} +0 -0
- package/dist/gif-encoder-BD5IcTeX.js +2 -0
- package/dist/gif-encoder-BD5IcTeX.js.br +0 -0
- package/dist/gif-encoder-BD5IcTeX.js.gz +0 -0
- package/dist/gif-encoder-BYmRz5U7.cjs +2 -0
- package/dist/gif-encoder-BYmRz5U7.cjs.br +0 -0
- package/dist/gif-encoder-BYmRz5U7.cjs.gz +0 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.br +0 -0
- package/dist/index.cjs.gz +0 -0
- package/dist/index.js +3 -3
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/internals.cjs +1 -1
- package/dist/internals.cjs.br +0 -0
- package/dist/internals.cjs.gz +0 -0
- package/dist/internals.js +2 -2
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/{useViewerSettingsDialog-BKMRD0WG.js → useViewerSettingsDialog-Bq28kYRH.js} +3055 -3008
- package/dist/useViewerSettingsDialog-Bq28kYRH.js.br +0 -0
- package/dist/{useViewerSettingsDialog-BKMRD0WG.js.gz → useViewerSettingsDialog-Bq28kYRH.js.gz} +0 -0
- package/dist/{useViewerSettingsDialog-CdoOvMVO.cjs → useViewerSettingsDialog-D1cWcNDR.cjs} +3484 -3432
- package/dist/useViewerSettingsDialog-D1cWcNDR.cjs.br +0 -0
- package/dist/useViewerSettingsDialog-D1cWcNDR.cjs.gz +0 -0
- package/dist/viewer/index.cjs +1 -1
- package/dist/viewer/index.cjs.br +0 -0
- package/dist/viewer/index.cjs.gz +0 -0
- package/dist/viewer/index.js +3 -3
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/{viewer-CWYZJPT1.cjs → viewer-B-ek2MiS.cjs} +2409 -2382
- package/dist/viewer-B-ek2MiS.cjs.br +0 -0
- package/dist/viewer-B-ek2MiS.cjs.gz +0 -0
- package/dist/{viewer-CGWSWH4j.js → viewer-D95gsM0e.js} +10394 -10372
- package/dist/viewer-D95gsM0e.js.br +0 -0
- package/dist/viewer-D95gsM0e.js.gz +0 -0
- package/package.json +4 -4
- package/dist/AiChatPanel-BAALzbEt.cjs.br +0 -0
- package/dist/AiChatPanel-BAALzbEt.cjs.gz +0 -0
- package/dist/AiChatPanel-klDHq3m1.js +0 -640
- package/dist/AiChatPanel-klDHq3m1.js.br +0 -0
- package/dist/AiChatPanel-klDHq3m1.js.gz +0 -0
- package/dist/dist-Br8KDhMp.cjs.br +0 -0
- package/dist/dist-DSVV_5rB.js.br +0 -0
- package/dist/gif-encoder-BBDPvUe_.js +0 -2
- package/dist/gif-encoder-BBDPvUe_.js.br +0 -0
- package/dist/gif-encoder-BBDPvUe_.js.gz +0 -0
- package/dist/gif-encoder-Bg5D4WkC.cjs +0 -2
- package/dist/gif-encoder-Bg5D4WkC.cjs.br +0 -0
- package/dist/gif-encoder-Bg5D4WkC.cjs.gz +0 -0
- package/dist/useViewerSettingsDialog-BKMRD0WG.js.br +0 -0
- package/dist/useViewerSettingsDialog-CdoOvMVO.cjs.br +0 -0
- package/dist/useViewerSettingsDialog-CdoOvMVO.cjs.gz +0 -0
- package/dist/viewer-CGWSWH4j.js.br +0 -0
- package/dist/viewer-CGWSWH4j.js.gz +0 -0
- package/dist/viewer-CWYZJPT1.cjs.br +0 -0
- package/dist/viewer-CWYZJPT1.cjs.gz +0 -0
|
@@ -1,81 +1,10 @@
|
|
|
1
|
-
const e = require("./useViewerSettingsDialog-
|
|
2
|
-
let r = require("vue"), a = require("lucide-vue-next")
|
|
3
|
-
var o =
|
|
4
|
-
"input-available",
|
|
5
|
-
"output-available",
|
|
6
|
-
"output-error"
|
|
7
|
-
]);
|
|
8
|
-
function l(e, a, l, s = {}) {
|
|
9
|
-
const i = (0, r.ref)(a.proposals.list()), c = () => {
|
|
10
|
-
i.value = a.proposals.list();
|
|
11
|
-
}, p = e({
|
|
12
|
-
transport: a.transport,
|
|
13
|
-
sendAutomaticallyWhen: a.sendAutomaticallyWhen,
|
|
14
|
-
onError: (e) => l.onError?.(e),
|
|
15
|
-
onToolCall: async ({ toolCall: e }) => {
|
|
16
|
-
const { toolName: t, toolCallId: r, input: n } = e, o = p.addToolOutput;
|
|
17
|
-
try {
|
|
18
|
-
o({
|
|
19
|
-
tool: t,
|
|
20
|
-
toolCallId: r,
|
|
21
|
-
output: await a.executeToolCall(t, n)
|
|
22
|
-
});
|
|
23
|
-
} catch (e) {
|
|
24
|
-
o({
|
|
25
|
-
tool: t,
|
|
26
|
-
toolCallId: r,
|
|
27
|
-
state: "output-error",
|
|
28
|
-
errorText: e instanceof Error ? e.message : String(e)
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
c();
|
|
32
|
-
}
|
|
33
|
-
}), d = (0, r.computed)(() => "submitted" === p.status.value || "streaming" === p.status.value), u = /* @__PURE__ */ new Set();
|
|
34
|
-
(0, r.watch)(p.messages, (e) => {
|
|
35
|
-
for (const r of function(e) {
|
|
36
|
-
const t = [];
|
|
37
|
-
for (const r of e) for (const e of r.parts) {
|
|
38
|
-
if (!(0, n.isToolUIPart)(e) && !(0, n.isDynamicToolUIPart)(e)) continue;
|
|
39
|
-
const r = e, a = r.toolCallId ?? "";
|
|
40
|
-
0 !== a.length && void 0 !== r.input && o.has(r.state ?? "") && t.push({
|
|
41
|
-
toolName: (0, n.getToolOrDynamicToolName)(e),
|
|
42
|
-
toolCallId: a,
|
|
43
|
-
input: r.input
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return t;
|
|
47
|
-
}(e)) u.has(r.toolCallId) || (u.add(r.toolCallId), s.onToolTarget?.(t.toolCanvasTarget(r.toolName, r.input)));
|
|
48
|
-
}, { deep: !0 });
|
|
49
|
-
return {
|
|
50
|
-
messages: p.messages,
|
|
51
|
-
status: p.status,
|
|
52
|
-
error: p.error,
|
|
53
|
-
isStreaming: d,
|
|
54
|
-
proposals: i,
|
|
55
|
-
send: (e) => {
|
|
56
|
-
const t = e.trim();
|
|
57
|
-
0 !== t.length && p.sendMessage({ text: t });
|
|
58
|
-
},
|
|
59
|
-
stop: () => {
|
|
60
|
-
p.stop();
|
|
61
|
-
},
|
|
62
|
-
clearError: () => p.clearError(),
|
|
63
|
-
applyProposal: (e) => {
|
|
64
|
-
a.proposals.apply(e), c();
|
|
65
|
-
},
|
|
66
|
-
rejectProposal: (e) => {
|
|
67
|
-
a.proposals.revert(e), c();
|
|
68
|
-
},
|
|
69
|
-
acceptAllProposals: () => {
|
|
70
|
-
a.proposals.acceptAll(), c();
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end gap-1.5 rounded-md border border-input bg-background px-2 py-1.5 focus-within:border-ring" }, c = ["placeholder", "aria-label"], p = ["title", "aria-label"], d = [
|
|
1
|
+
const e = require("./useViewerSettingsDialog-D1cWcNDR.cjs"), t = require("./viewer-B-ek2MiS.cjs");
|
|
2
|
+
let r = require("vue"), a = require("lucide-vue-next");
|
|
3
|
+
var n = { class: "border-t border-border p-2" }, o = { class: "flex items-end gap-1.5 rounded-md border border-input bg-background px-2 py-1.5 focus-within:border-ring" }, l = ["placeholder", "aria-label"], s = ["title", "aria-label"], i = [
|
|
75
4
|
"disabled",
|
|
76
5
|
"title",
|
|
77
6
|
"aria-label"
|
|
78
|
-
],
|
|
7
|
+
], c = (0, r.defineComponent)({
|
|
79
8
|
__name: "AiComposer",
|
|
80
9
|
props: {
|
|
81
10
|
isStreaming: { type: Boolean },
|
|
@@ -83,34 +12,34 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
83
12
|
prefillNonce: {}
|
|
84
13
|
},
|
|
85
14
|
emits: ["send", "stop"],
|
|
86
|
-
setup(
|
|
87
|
-
const
|
|
15
|
+
setup(c, { emit: p }) {
|
|
16
|
+
const d = c, u = p, { t: m } = e.useI18n(), x = (0, r.ref)(""), f = (0, r.ref)(null), g = (0, r.computed)(() => x.value.trim().length > 0);
|
|
88
17
|
function k() {
|
|
89
|
-
const e =
|
|
90
|
-
0 === e.length ||
|
|
18
|
+
const e = x.value.trim();
|
|
19
|
+
0 === e.length || d.isStreaming || (u("send", e), x.value = "");
|
|
91
20
|
}
|
|
92
21
|
function y(e) {
|
|
93
22
|
"Enter" !== e.key || e.shiftKey || (e.preventDefault(), k());
|
|
94
23
|
}
|
|
95
|
-
return (0, r.watch)(() =>
|
|
96
|
-
void 0 !== e && 0 !== e && (
|
|
97
|
-
}), (e,
|
|
24
|
+
return (0, r.watch)(() => d.prefillNonce, (e) => {
|
|
25
|
+
void 0 !== e && 0 !== e && (d.prefillText && (x.value = d.prefillText), (0, r.nextTick)(() => f.value?.focus()));
|
|
26
|
+
}), (e, c) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", n, [(0, r.createElementVNode)("div", o, [(0, r.withDirectives)((0, r.createElementVNode)("textarea", {
|
|
98
27
|
ref_key: "textareaRef",
|
|
99
|
-
ref:
|
|
100
|
-
"onUpdate:modelValue":
|
|
28
|
+
ref: f,
|
|
29
|
+
"onUpdate:modelValue": c[0] || (c[0] = (e) => x.value = e),
|
|
101
30
|
rows: 1,
|
|
102
31
|
placeholder: (0, r.unref)(m)("pptx.ai.placeholder"),
|
|
103
32
|
"aria-label": (0, r.unref)(m)("pptx.ai.placeholder"),
|
|
104
33
|
class: "max-h-32 min-h-[1.5rem] flex-1 resize-none bg-transparent text-[13px] text-foreground outline-none placeholder:text-muted-foreground",
|
|
105
34
|
onKeydown: y
|
|
106
|
-
}, null, 40,
|
|
35
|
+
}, null, 40, l), [[r.vModelText, x.value]]), d.isStreaming ? ((0, r.openBlock)(), (0, r.createElementBlock)("button", {
|
|
107
36
|
key: 0,
|
|
108
37
|
type: "button",
|
|
109
38
|
title: (0, r.unref)(m)("pptx.ai.stop"),
|
|
110
39
|
"aria-label": (0, r.unref)(m)("pptx.ai.stop"),
|
|
111
40
|
class: "shrink-0 rounded-sm p-1.5 text-muted-foreground transition-colors hover:bg-accent",
|
|
112
|
-
onClick:
|
|
113
|
-
}, [(0, r.createVNode)((0, r.unref)(a.Square), { class: "w-4 h-4" })], 8,
|
|
41
|
+
onClick: c[1] || (c[1] = (e) => u("stop"))
|
|
42
|
+
}, [(0, r.createVNode)((0, r.unref)(a.Square), { class: "w-4 h-4" })], 8, s)) : ((0, r.openBlock)(), (0, r.createElementBlock)("button", {
|
|
114
43
|
key: 1,
|
|
115
44
|
type: "button",
|
|
116
45
|
disabled: !g.value,
|
|
@@ -118,19 +47,19 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
118
47
|
"aria-label": (0, r.unref)(m)("pptx.ai.send"),
|
|
119
48
|
class: (0, r.normalizeClass)((0, r.unref)(t.cn)("shrink-0 rounded-sm p-1.5 transition-colors", g.value ? "bg-primary text-primary-foreground hover:bg-primary/90" : "text-muted-foreground/50")),
|
|
120
49
|
onClick: k
|
|
121
|
-
}, [(0, r.createVNode)((0, r.unref)(a.Send), { class: "w-4 h-4" })], 10,
|
|
50
|
+
}, [(0, r.createVNode)((0, r.unref)(a.Send), { class: "w-4 h-4" })], 10, i))])]));
|
|
122
51
|
}
|
|
123
|
-
}),
|
|
52
|
+
}), p = { class: "border-b border-border bg-secondary/30" }, d = { class: "flex flex-wrap items-center gap-1 px-2.5 py-1.5" }, u = { class: "text-[10px] font-semibold uppercase tracking-wide text-muted-foreground" }, m = ["title"], x = { class: "truncate" }, f = {
|
|
124
53
|
key: 0,
|
|
125
54
|
class: "rounded-full bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium text-primary"
|
|
126
|
-
},
|
|
55
|
+
}, g = { class: "ml-auto flex items-center gap-0.5" }, k = [
|
|
127
56
|
"title",
|
|
128
57
|
"aria-label",
|
|
129
58
|
"aria-pressed"
|
|
130
|
-
],
|
|
59
|
+
], y = ["title", "aria-label"], b = ["title", "aria-label"], h = {
|
|
131
60
|
key: 0,
|
|
132
61
|
class: "flex items-center gap-2 border-t border-primary/20 bg-primary/5 px-2.5 py-1"
|
|
133
|
-
},
|
|
62
|
+
}, v = { class: "text-[11px] font-medium text-primary" }, C = (0, r.defineComponent)({
|
|
134
63
|
__name: "AiFocusBar",
|
|
135
64
|
props: {
|
|
136
65
|
targets: {},
|
|
@@ -148,25 +77,25 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
148
77
|
"send-directive"
|
|
149
78
|
],
|
|
150
79
|
setup(n, { emit: o }) {
|
|
151
|
-
const l = n, s = o, { t: i } = e.useI18n(), c = (0, r.computed)(() => t.focusTargetChips(l.targets, l.slides)),
|
|
152
|
-
function
|
|
153
|
-
const e =
|
|
80
|
+
const l = n, s = o, { t: i } = e.useI18n(), c = (0, r.computed)(() => t.focusTargetChips(l.targets, l.slides)), C = (0, r.computed)(() => t.isTwoTableFocus(l.targets, l.slides));
|
|
81
|
+
function B() {
|
|
82
|
+
const e = C.value;
|
|
154
83
|
e && s("send-directive", t.mergeTablesDirective(e.slideIndex, e.elementIdA, e.elementIdB));
|
|
155
84
|
}
|
|
156
|
-
return (e, o) => ((0, r.openBlock)(), (0, r.createElementBlock)("div",
|
|
157
|
-
(0, r.createElementVNode)("span",
|
|
85
|
+
return (e, o) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", p, [(0, r.createElementVNode)("div", d, [
|
|
86
|
+
(0, r.createElementVNode)("span", u, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.focusScope")), 1),
|
|
158
87
|
((0, r.openBlock)(!0), (0, r.createElementBlock)(r.Fragment, null, (0, r.renderList)(c.value, (e) => ((0, r.openBlock)(), (0, r.createElementBlock)("span", {
|
|
159
88
|
key: e.key,
|
|
160
89
|
class: (0, r.normalizeClass)((0, r.unref)(t.cn)("inline-flex max-w-[10rem] items-center rounded-full px-2 py-0.5 text-[11px]", n.hasPicks || n.isPinned ? "bg-primary/15 text-primary" : "bg-muted text-muted-foreground")),
|
|
161
90
|
title: e.title
|
|
162
|
-
}, [(0, r.createElementVNode)("span",
|
|
163
|
-
n.isPinned ? ((0, r.openBlock)(), (0, r.createElementBlock)("span",
|
|
164
|
-
(0, r.createElementVNode)("div",
|
|
165
|
-
|
|
91
|
+
}, [(0, r.createElementVNode)("span", x, (0, r.toDisplayString)(e.label), 1)], 10, m))), 128)),
|
|
92
|
+
n.isPinned ? ((0, r.openBlock)(), (0, r.createElementBlock)("span", f, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.pinnedFocus")), 1)) : (0, r.createCommentVNode)("", !0),
|
|
93
|
+
(0, r.createElementVNode)("div", g, [
|
|
94
|
+
C.value ? ((0, r.openBlock)(), (0, r.createElementBlock)("button", {
|
|
166
95
|
key: 0,
|
|
167
96
|
type: "button",
|
|
168
97
|
class: "inline-flex items-center gap-1 rounded-sm bg-primary/90 px-1.5 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary",
|
|
169
|
-
onClick:
|
|
98
|
+
onClick: B
|
|
170
99
|
}, [(0, r.createVNode)((0, r.unref)(a.GitMerge), { class: "w-3 h-3" }), (0, r.createTextVNode)(" " + (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.mergeSelectedTables")), 1)])) : (0, r.createCommentVNode)("", !0),
|
|
171
100
|
(0, r.createElementVNode)("button", {
|
|
172
101
|
type: "button",
|
|
@@ -175,7 +104,7 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
175
104
|
"aria-pressed": n.pickMode,
|
|
176
105
|
class: (0, r.normalizeClass)((0, r.unref)(t.cn)("rounded-sm p-1 flex items-center justify-center max-md:min-w-[44px]! max-md:min-h-[44px]!", n.pickMode ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-accent")),
|
|
177
106
|
onClick: o[0] || (o[0] = (e) => n.pickMode ? s("stop-pick") : s("start-pick"))
|
|
178
|
-
}, [(0, r.createVNode)((0, r.unref)(a.Crosshair), { class: "w-3.5 h-3.5" })], 10,
|
|
107
|
+
}, [(0, r.createVNode)((0, r.unref)(a.Crosshair), { class: "w-3.5 h-3.5" })], 10, k),
|
|
179
108
|
n.hasPicks ? ((0, r.openBlock)(), (0, r.createElementBlock)("button", {
|
|
180
109
|
key: 1,
|
|
181
110
|
type: "button",
|
|
@@ -183,7 +112,7 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
183
112
|
"aria-label": (0, r.unref)(i)("pptx.ai.pickClear"),
|
|
184
113
|
class: "rounded-sm p-1 text-muted-foreground hover:bg-accent flex items-center justify-center max-md:min-w-[44px]! max-md:min-h-[44px]!",
|
|
185
114
|
onClick: o[1] || (o[1] = (e) => s("clear-picks"))
|
|
186
|
-
}, [(0, r.createVNode)((0, r.unref)(a.X), { class: "w-3.5 h-3.5" })], 8,
|
|
115
|
+
}, [(0, r.createVNode)((0, r.unref)(a.X), { class: "w-3.5 h-3.5" })], 8, y)) : ((0, r.openBlock)(), (0, r.createElementBlock)("button", {
|
|
187
116
|
key: 2,
|
|
188
117
|
type: "button",
|
|
189
118
|
title: n.isPinned ? (0, r.unref)(i)("pptx.ai.clearFocus") : (0, r.unref)(i)("pptx.ai.pinFocus"),
|
|
@@ -196,11 +125,11 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
196
125
|
})) : ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(a.Pin), {
|
|
197
126
|
key: 1,
|
|
198
127
|
class: "w-3.5 h-3.5"
|
|
199
|
-
}))], 8,
|
|
128
|
+
}))], 8, b))
|
|
200
129
|
])
|
|
201
|
-
]), n.pickMode ? ((0, r.openBlock)(), (0, r.createElementBlock)("div",
|
|
130
|
+
]), n.pickMode ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", h, [
|
|
202
131
|
(0, r.createVNode)((0, r.unref)(a.Crosshair), { class: "w-3.5 h-3.5 shrink-0 animate-pulse text-primary" }),
|
|
203
|
-
(0, r.createElementVNode)("span",
|
|
132
|
+
(0, r.createElementVNode)("span", v, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.pickElementHint")), 1),
|
|
204
133
|
(0, r.createElementVNode)("button", {
|
|
205
134
|
type: "button",
|
|
206
135
|
class: "ml-auto rounded-sm bg-primary px-2 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary/90",
|
|
@@ -208,17 +137,17 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
208
137
|
}, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.pickDone")), 1)
|
|
209
138
|
])) : (0, r.createCommentVNode)("", !0)]));
|
|
210
139
|
}
|
|
211
|
-
}),
|
|
140
|
+
}), B = { class: "flex items-center justify-between border-b border-border px-2.5 py-1.5" }, E = { class: "text-[11px] font-semibold uppercase tracking-wide text-muted-foreground" }, w = {
|
|
212
141
|
key: 0,
|
|
213
142
|
class: "px-3 py-4 text-center text-[12px] text-muted-foreground"
|
|
214
|
-
},
|
|
143
|
+
}, N = {
|
|
215
144
|
key: 1,
|
|
216
145
|
class: "max-h-64 overflow-y-auto py-1"
|
|
217
|
-
},
|
|
146
|
+
}, V = ["onClick"], S = { class: "min-w-0 flex-1" }, P = { class: "block truncate text-[12px] font-medium text-foreground" }, T = { class: "block text-[10px] text-muted-foreground" }, D = [
|
|
218
147
|
"title",
|
|
219
148
|
"aria-label",
|
|
220
149
|
"onClick"
|
|
221
|
-
],
|
|
150
|
+
], I = { class: "border-t border-border px-2.5 py-1.5 text-[10px] text-muted-foreground" }, A = (0, r.defineComponent)({
|
|
222
151
|
__name: "AiHistoryMenu",
|
|
223
152
|
props: {
|
|
224
153
|
chats: {},
|
|
@@ -240,14 +169,14 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
240
169
|
ref: i,
|
|
241
170
|
class: "absolute right-2 top-10 z-40 w-64 rounded-md border border-border bg-popover shadow-xl"
|
|
242
171
|
}, [
|
|
243
|
-
(0, r.createElementVNode)("div",
|
|
172
|
+
(0, r.createElementVNode)("div", B, [(0, r.createElementVNode)("span", E, (0, r.toDisplayString)((0, r.unref)(s)("pptx.ai.historyTitle")), 1), (0, r.createElementVNode)("button", {
|
|
244
173
|
type: "button",
|
|
245
174
|
class: "inline-flex items-center gap-1 rounded-sm bg-primary/90 px-1.5 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary",
|
|
246
175
|
onClick: t[0] || (t[0] = (e) => {
|
|
247
176
|
l("new-chat"), l("close");
|
|
248
177
|
})
|
|
249
178
|
}, [(0, r.createVNode)((0, r.unref)(a.Plus), { class: "w-3 h-3" }), (0, r.createTextVNode)(" " + (0, r.toDisplayString)((0, r.unref)(s)("pptx.ai.newChat")), 1)])]),
|
|
250
|
-
0 === o.chats.length ? ((0, r.openBlock)(), (0, r.createElementBlock)("p",
|
|
179
|
+
0 === o.chats.length ? ((0, r.openBlock)(), (0, r.createElementBlock)("p", w, (0, r.toDisplayString)((0, r.unref)(s)("pptx.ai.historyEmpty")), 1)) : ((0, r.openBlock)(), (0, r.createElementBlock)("ul", N, [((0, r.openBlock)(!0), (0, r.createElementBlock)(r.Fragment, null, (0, r.renderList)(o.chats, (e) => ((0, r.openBlock)(), (0, r.createElementBlock)("li", {
|
|
251
180
|
key: e.id,
|
|
252
181
|
class: "group flex items-center gap-1 px-1"
|
|
253
182
|
}, [(0, r.createElementVNode)("button", {
|
|
@@ -256,23 +185,23 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
256
185
|
onClick: (t) => {
|
|
257
186
|
l("resume", e.id), l("close");
|
|
258
187
|
}
|
|
259
|
-
}, [(0, r.createVNode)((0, r.unref)(a.MessageSquare), { class: "mt-0.5 w-3.5 h-3.5 shrink-0 text-muted-foreground" }), (0, r.createElementVNode)("span",
|
|
188
|
+
}, [(0, r.createVNode)((0, r.unref)(a.MessageSquare), { class: "mt-0.5 w-3.5 h-3.5 shrink-0 text-muted-foreground" }), (0, r.createElementVNode)("span", S, [(0, r.createElementVNode)("span", P, (0, r.toDisplayString)(e.title || (0, r.unref)(s)("pptx.ai.untitledChat")), 1), (0, r.createElementVNode)("span", T, (0, r.toDisplayString)((0, r.unref)(s)("pptx.ai.messageCount", { count: e.messageCount })), 1)])], 10, V), (0, r.createElementVNode)("button", {
|
|
260
189
|
type: "button",
|
|
261
190
|
title: (0, r.unref)(s)("pptx.ai.deleteChat"),
|
|
262
191
|
"aria-label": (0, r.unref)(s)("pptx.ai.deleteChat"),
|
|
263
192
|
class: "shrink-0 rounded-sm p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",
|
|
264
193
|
onClick: (t) => l("delete", e.id)
|
|
265
|
-
}, [(0, r.createVNode)((0, r.unref)(a.Trash2), { class: "w-3.5 h-3.5" })], 8,
|
|
266
|
-
(0, r.createElementVNode)("p",
|
|
194
|
+
}, [(0, r.createVNode)((0, r.unref)(a.Trash2), { class: "w-3.5 h-3.5" })], 8, D)]))), 128))])),
|
|
195
|
+
(0, r.createElementVNode)("p", I, (0, r.toDisplayString)((0, r.unref)(s)("pptx.ai.historyHint")), 1)
|
|
267
196
|
], 512));
|
|
268
197
|
}
|
|
269
|
-
}),
|
|
198
|
+
}), F = { class: "text-[12px]" }, j = { class: "flex items-center gap-1.5" }, M = {
|
|
270
199
|
key: 0,
|
|
271
200
|
class: "mt-1 pl-5 text-[11px] text-destructive"
|
|
272
|
-
},
|
|
201
|
+
}, _ = {
|
|
273
202
|
key: 1,
|
|
274
203
|
class: "group mt-0.5 pl-5"
|
|
275
|
-
},
|
|
204
|
+
}, L = { class: "cursor-pointer list-none text-[10px] text-muted-foreground/70 hover:text-muted-foreground" }, z = { class: "mt-0.5 break-words font-mono text-[10px] text-muted-foreground/80" }, R = (0, r.defineComponent)({
|
|
276
205
|
__name: "AiToolCallCard",
|
|
277
206
|
props: { part: {} },
|
|
278
207
|
setup(n) {
|
|
@@ -291,9 +220,9 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
291
220
|
animation: a.Film,
|
|
292
221
|
notes: a.StickyNote,
|
|
293
222
|
tool: a.Wrench
|
|
294
|
-
}, i = (0, r.computed)(() => "output-error" === o.part.state), c = (0, r.computed)(() => "output-available" === o.part.state), p = (0, r.computed)(() => !i.value && !c.value), d = (0, r.computed)(() => t.describeToolActivity(o.part.toolName, o.part.input, p.value ? "present" : "past")), u = (0, r.computed)(() => s[d.value.icon] ?? a.Wrench), m = (0, r.computed)(() => t.summarizeToolArgs(o.part.input)),
|
|
295
|
-
return (e, n) => ((0, r.openBlock)(), (0, r.createElementBlock)("div",
|
|
296
|
-
(0, r.createElementVNode)("div",
|
|
223
|
+
}, i = (0, r.computed)(() => "output-error" === o.part.state), c = (0, r.computed)(() => "output-available" === o.part.state), p = (0, r.computed)(() => !i.value && !c.value), d = (0, r.computed)(() => t.describeToolActivity(o.part.toolName, o.part.input, p.value ? "present" : "past")), u = (0, r.computed)(() => s[d.value.icon] ?? a.Wrench), m = (0, r.computed)(() => t.summarizeToolArgs(o.part.input)), x = (0, r.computed)(() => i.value ? l("pptx.ai.toolFailed") : c.value ? l("pptx.ai.toolDone") : l("pptx.ai.toolRunning"));
|
|
224
|
+
return (e, n) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", F, [
|
|
225
|
+
(0, r.createElementVNode)("div", j, [
|
|
297
226
|
((0, r.openBlock)(), (0, r.createBlock)((0, r.resolveDynamicComponent)(u.value), { class: (0, r.normalizeClass)((0, r.unref)(t.cn)("w-3.5 h-3.5 shrink-0", i.value ? "text-destructive" : "text-muted-foreground")) }, null, 8, ["class"])),
|
|
298
227
|
(0, r.createElementVNode)("span", { class: (0, r.normalizeClass)((0, r.unref)(t.cn)("truncate", i.value ? "text-destructive" : "text-foreground")) }, (0, r.toDisplayString)(d.value.label), 3),
|
|
299
228
|
(0, r.createElementVNode)("span", { class: (0, r.normalizeClass)((0, r.unref)(t.cn)("ml-auto inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 text-[10px]", i.value ? "bg-destructive/15 text-destructive" : c.value ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground")) }, [p.value ? ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(a.LoaderCircle), {
|
|
@@ -305,28 +234,28 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
305
234
|
})) : ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(a.TriangleAlert), {
|
|
306
235
|
key: 2,
|
|
307
236
|
class: "w-3 h-3"
|
|
308
|
-
})), (0, r.createTextVNode)(" " + (0, r.toDisplayString)(
|
|
237
|
+
})), (0, r.createTextVNode)(" " + (0, r.toDisplayString)(x.value), 1)], 2)
|
|
309
238
|
]),
|
|
310
|
-
i.value && o.part.errorText ? ((0, r.openBlock)(), (0, r.createElementBlock)("div",
|
|
311
|
-
m.value ? ((0, r.openBlock)(), (0, r.createElementBlock)("details",
|
|
239
|
+
i.value && o.part.errorText ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", M, (0, r.toDisplayString)(o.part.errorText), 1)) : (0, r.createCommentVNode)("", !0),
|
|
240
|
+
m.value ? ((0, r.openBlock)(), (0, r.createElementBlock)("details", _, [(0, r.createElementVNode)("summary", L, (0, r.toDisplayString)((0, r.unref)(l)("pptx.ai.toolDetails")), 1), (0, r.createElementVNode)("div", z, (0, r.toDisplayString)((0, r.unref)(t.toolLabel)(o.part.toolName)) + ": " + (0, r.toDisplayString)(m.value), 1)])) : (0, r.createCommentVNode)("", !0)
|
|
312
241
|
]));
|
|
313
242
|
}
|
|
314
|
-
}),
|
|
243
|
+
}), q = {
|
|
315
244
|
key: 0,
|
|
316
245
|
class: "flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center"
|
|
317
|
-
},
|
|
246
|
+
}, H = { class: "text-sm font-medium text-foreground" }, W = { class: "text-[12px] text-muted-foreground" }, U = {
|
|
318
247
|
key: 1,
|
|
319
248
|
class: "flex-1 space-y-3 overflow-y-auto px-3 py-3"
|
|
320
|
-
},
|
|
249
|
+
}, X = {
|
|
321
250
|
key: 0,
|
|
322
251
|
class: "flex gap-2"
|
|
323
|
-
},
|
|
252
|
+
}, K = ["aria-label"], O = { class: "min-w-0 flex-1 space-y-1.5" }, G = {
|
|
324
253
|
key: 0,
|
|
325
254
|
class: "whitespace-pre-wrap break-words text-[13px] leading-relaxed text-foreground"
|
|
326
|
-
},
|
|
255
|
+
}, $ = {
|
|
327
256
|
key: 0,
|
|
328
257
|
class: "flex items-center gap-2 pl-8 text-[12px] text-muted-foreground"
|
|
329
|
-
},
|
|
258
|
+
}, J = (0, r.defineComponent)({
|
|
330
259
|
__name: "AiMessageList",
|
|
331
260
|
props: {
|
|
332
261
|
messages: {},
|
|
@@ -336,12 +265,12 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
336
265
|
const o = n, { t: l } = e.useI18n(), s = (0, r.ref)(null);
|
|
337
266
|
return (0, r.watch)(() => [o.messages, o.isStreaming], () => {
|
|
338
267
|
(0, r.nextTick)(() => s.value?.scrollIntoView({ block: "end" }));
|
|
339
|
-
}, { deep: !0 }), (e, n) => 0 === o.messages.length ? ((0, r.openBlock)(), (0, r.createElementBlock)("div",
|
|
268
|
+
}, { deep: !0 }), (e, n) => 0 === o.messages.length ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", q, [
|
|
340
269
|
(0, r.createVNode)((0, r.unref)(a.Sparkles), { class: "w-7 h-7 text-primary/70" }),
|
|
341
|
-
(0, r.createElementVNode)("p",
|
|
342
|
-
(0, r.createElementVNode)("p",
|
|
343
|
-
])) : ((0, r.openBlock)(), (0, r.createElementBlock)("div",
|
|
344
|
-
((0, r.openBlock)(!0), (0, r.createElementBlock)(r.Fragment, null, (0, r.renderList)(o.messages, (e) => ((0, r.openBlock)(), (0, r.createElementBlock)(r.Fragment, { key: e.id }, ["user" === e.role || (0, r.unref)(t.toRenderableParts)(e).length > 0 ? ((0, r.openBlock)(), (0, r.createElementBlock)("div",
|
|
270
|
+
(0, r.createElementVNode)("p", H, (0, r.toDisplayString)((0, r.unref)(l)("pptx.ai.emptyTitle")), 1),
|
|
271
|
+
(0, r.createElementVNode)("p", W, (0, r.toDisplayString)((0, r.unref)(l)("pptx.ai.emptyHint")), 1)
|
|
272
|
+
])) : ((0, r.openBlock)(), (0, r.createElementBlock)("div", U, [
|
|
273
|
+
((0, r.openBlock)(!0), (0, r.createElementBlock)(r.Fragment, null, (0, r.renderList)(o.messages, (e) => ((0, r.openBlock)(), (0, r.createElementBlock)(r.Fragment, { key: e.id }, ["user" === e.role || (0, r.unref)(t.toRenderableParts)(e).length > 0 ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", X, [(0, r.createElementVNode)("div", {
|
|
345
274
|
class: (0, r.normalizeClass)((0, r.unref)(t.cn)("mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full", "user" === e.role ? "bg-secondary text-muted-foreground" : "bg-primary/15 text-primary")),
|
|
346
275
|
"aria-label": "user" === e.role ? (0, r.unref)(l)("pptx.ai.you") : (0, r.unref)(l)("pptx.ai.assistant")
|
|
347
276
|
}, ["user" === e.role ? ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(a.User), {
|
|
@@ -350,11 +279,11 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
350
279
|
})) : ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(a.Bot), {
|
|
351
280
|
key: 1,
|
|
352
281
|
class: "w-3.5 h-3.5"
|
|
353
|
-
}))], 10,
|
|
282
|
+
}))], 10, K), (0, r.createElementVNode)("div", O, [((0, r.openBlock)(!0), (0, r.createElementBlock)(r.Fragment, null, (0, r.renderList)((0, r.unref)(t.toRenderableParts)(e), (e, t) => ((0, r.openBlock)(), (0, r.createElementBlock)(r.Fragment, { key: "tool" === e.kind && e.toolCallId || t }, ["text" === e.kind ? ((0, r.openBlock)(), (0, r.createElementBlock)("p", G, (0, r.toDisplayString)(e.text), 1)) : ((0, r.openBlock)(), (0, r.createBlock)(R, {
|
|
354
283
|
key: 1,
|
|
355
284
|
part: e
|
|
356
285
|
}, null, 8, ["part"]))], 64))), 128))])])) : (0, r.createCommentVNode)("", !0)], 64))), 128)),
|
|
357
|
-
o.isStreaming ? ((0, r.openBlock)(), (0, r.createElementBlock)("div",
|
|
286
|
+
o.isStreaming ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", $, [n[0] || (n[0] = (0, r.createElementVNode)("span", { class: "inline-flex gap-1" }, [
|
|
358
287
|
(0, r.createElementVNode)("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.2s]" }),
|
|
359
288
|
(0, r.createElementVNode)("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.1s]" }),
|
|
360
289
|
(0, r.createElementVNode)("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground" })
|
|
@@ -365,23 +294,23 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
365
294
|
}, null, 512)
|
|
366
295
|
]));
|
|
367
296
|
}
|
|
368
|
-
}),
|
|
297
|
+
}), Q = { class: "rounded-md border border-primary/40 bg-primary/5 p-2.5" }, Y = { class: "mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-primary" }, Z = { class: "text-[12px] font-medium text-foreground" }, ee = {
|
|
369
298
|
key: 0,
|
|
370
299
|
class: "mt-1 max-h-40 space-y-0.5 overflow-y-auto text-[11px] text-muted-foreground"
|
|
371
|
-
},
|
|
300
|
+
}, te = { class: "mt-2 flex items-center gap-2" }, re = (0, r.defineComponent)({
|
|
372
301
|
__name: "AiProposalCard",
|
|
373
302
|
props: { proposal: {} },
|
|
374
303
|
emits: ["accept", "reject"],
|
|
375
304
|
setup(n, { emit: o }) {
|
|
376
305
|
const l = n, s = o, { t: i } = e.useI18n(), c = (0, r.computed)(() => l.proposal.summary.map(t.humanizeDiffLine));
|
|
377
|
-
return (e, t) => ((0, r.openBlock)(), (0, r.createElementBlock)("div",
|
|
378
|
-
(0, r.createElementVNode)("div",
|
|
379
|
-
(0, r.createElementVNode)("div",
|
|
380
|
-
c.value.length > 0 ? ((0, r.openBlock)(), (0, r.createElementBlock)("ul",
|
|
306
|
+
return (e, t) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", Q, [
|
|
307
|
+
(0, r.createElementVNode)("div", Y, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.proposedChange")), 1),
|
|
308
|
+
(0, r.createElementVNode)("div", Z, (0, r.toDisplayString)(l.proposal.label), 1),
|
|
309
|
+
c.value.length > 0 ? ((0, r.openBlock)(), (0, r.createElementBlock)("ul", ee, [((0, r.openBlock)(!0), (0, r.createElementBlock)(r.Fragment, null, (0, r.renderList)(c.value, (e, t) => ((0, r.openBlock)(), (0, r.createElementBlock)("li", {
|
|
381
310
|
key: t,
|
|
382
311
|
class: "break-words"
|
|
383
312
|
}, (0, r.toDisplayString)(e), 1))), 128))])) : (0, r.createCommentVNode)("", !0),
|
|
384
|
-
(0, r.createElementVNode)("div",
|
|
313
|
+
(0, r.createElementVNode)("div", te, [(0, r.createElementVNode)("button", {
|
|
385
314
|
type: "button",
|
|
386
315
|
class: "inline-flex items-center gap-1 rounded-sm bg-primary px-2 py-1 text-[11px] font-medium text-primary-foreground transition-colors hover:bg-primary/90",
|
|
387
316
|
onClick: t[0] || (t[0] = (e) => s("accept", l.proposal.id))
|
|
@@ -392,17 +321,17 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
392
321
|
}, [(0, r.createVNode)((0, r.unref)(a.X), { class: "w-3.5 h-3.5" }), (0, r.createTextVNode)(" " + (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.reject")), 1)])])
|
|
393
322
|
]));
|
|
394
323
|
}
|
|
395
|
-
}),
|
|
324
|
+
}), ae = { class: "relative flex min-h-0 flex-1 flex-col" }, ne = { class: "flex items-center gap-1 border-b border-border px-2 py-1" }, oe = { class: "ml-auto flex items-center gap-0.5" }, le = ["title", "aria-label"], se = [
|
|
396
325
|
"title",
|
|
397
326
|
"aria-label",
|
|
398
327
|
"disabled"
|
|
399
|
-
],
|
|
328
|
+
], ie = {
|
|
400
329
|
key: 1,
|
|
401
330
|
class: "mx-3 mb-2 flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/5 px-2.5 py-1.5 text-[12px] text-destructive"
|
|
402
|
-
},
|
|
331
|
+
}, ce = { class: "min-w-0 flex-1" }, pe = { class: "font-medium" }, de = { class: "max-h-24 overflow-y-auto break-words text-[11px] opacity-80" }, ue = {
|
|
403
332
|
key: 2,
|
|
404
333
|
class: "max-h-[38%] space-y-2 overflow-y-auto border-t border-border bg-background px-3 py-2"
|
|
405
|
-
},
|
|
334
|
+
}, me = { class: "flex items-center justify-between" }, xe = { class: "text-[11px] font-semibold uppercase tracking-wide text-muted-foreground" }, fe = (0, r.defineComponent)({
|
|
406
335
|
__name: "AiConversation",
|
|
407
336
|
props: {
|
|
408
337
|
session: {},
|
|
@@ -411,10 +340,62 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
411
340
|
aiPanel: {}
|
|
412
341
|
},
|
|
413
342
|
async setup(n) {
|
|
414
|
-
let o,
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
|
|
343
|
+
let o, l;
|
|
344
|
+
const s = n, { t: i } = e.useI18n(), { useChat: p } = ([o, l] = (0, r.withAsyncContext)(() => import("@ai-sdk/vue")), o = await o, l(), o), { messages: d, error: u, isStreaming: m, proposals: x, send: f, stop: g, clearError: k, applyProposal: y, rejectProposal: b, acceptAllProposals: h } = function(e, a, n, o = {}) {
|
|
345
|
+
const l = (0, r.ref)(a.proposals.list()), s = () => {
|
|
346
|
+
l.value = a.proposals.list();
|
|
347
|
+
}, i = e({
|
|
348
|
+
transport: a.transport,
|
|
349
|
+
sendAutomaticallyWhen: a.sendAutomaticallyWhen,
|
|
350
|
+
onError: (e) => n.onError?.(e),
|
|
351
|
+
onToolCall: async ({ toolCall: e }) => {
|
|
352
|
+
const { toolName: t, toolCallId: r, input: n } = e, o = i.addToolOutput;
|
|
353
|
+
try {
|
|
354
|
+
o({
|
|
355
|
+
tool: t,
|
|
356
|
+
toolCallId: r,
|
|
357
|
+
output: await a.executeToolCall(t, n)
|
|
358
|
+
});
|
|
359
|
+
} catch (e) {
|
|
360
|
+
o({
|
|
361
|
+
tool: t,
|
|
362
|
+
toolCallId: r,
|
|
363
|
+
state: "output-error",
|
|
364
|
+
errorText: e instanceof Error ? e.message : String(e)
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
s();
|
|
368
|
+
}
|
|
369
|
+
}), c = (0, r.computed)(() => "submitted" === i.status.value || "streaming" === i.status.value), p = /* @__PURE__ */ new Set();
|
|
370
|
+
return (0, r.watch)(i.messages, (e) => {
|
|
371
|
+
for (const r of t.extractReadyToolCalls(e)) p.has(r.toolCallId) || (p.add(r.toolCallId), o.onToolTarget?.(t.toolCanvasTarget(r.toolName, r.input)));
|
|
372
|
+
}, { deep: !0 }), {
|
|
373
|
+
messages: i.messages,
|
|
374
|
+
status: i.status,
|
|
375
|
+
error: i.error,
|
|
376
|
+
isStreaming: c,
|
|
377
|
+
proposals: l,
|
|
378
|
+
send: (e) => {
|
|
379
|
+
const t = e.trim();
|
|
380
|
+
0 !== t.length && i.sendMessage({ text: t });
|
|
381
|
+
},
|
|
382
|
+
stop: () => {
|
|
383
|
+
i.stop();
|
|
384
|
+
},
|
|
385
|
+
clearError: () => i.clearError(),
|
|
386
|
+
applyProposal: (e) => {
|
|
387
|
+
a.proposals.apply(e), s();
|
|
388
|
+
},
|
|
389
|
+
rejectProposal: (e) => {
|
|
390
|
+
a.proposals.revert(e), s();
|
|
391
|
+
},
|
|
392
|
+
acceptAllProposals: () => {
|
|
393
|
+
a.proposals.acceptAll(), s();
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
}(p, s.session, s.config, { onToolTarget: (e) => {
|
|
397
|
+
e && void 0 !== e.slideIndex && s.bridge.goToSlide(e.slideIndex), s.aiPanel.flashToolTarget(e);
|
|
398
|
+
} }), v = function(e) {
|
|
418
399
|
const a = (0, r.ref)([]), n = t.createAiChatHistoryController({
|
|
419
400
|
deckId: e.deckId,
|
|
420
401
|
store: e.store,
|
|
@@ -443,67 +424,67 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
443
424
|
clearCurrent: () => n.clearCurrent()
|
|
444
425
|
};
|
|
445
426
|
}({
|
|
446
|
-
deckId: t.deckIdFromBridge(
|
|
427
|
+
deckId: t.deckIdFromBridge(s.bridge),
|
|
447
428
|
messages: d,
|
|
448
429
|
setMessages: (e) => {
|
|
449
430
|
d.value = e;
|
|
450
431
|
},
|
|
451
|
-
untitledLabel:
|
|
452
|
-
}), B = (0, r.ref)(!1), E =
|
|
453
|
-
e &&
|
|
432
|
+
untitledLabel: i("pptx.ai.untitledChat")
|
|
433
|
+
}), B = (0, r.ref)(!1), E = s.session.changeAnimator.subscribe((e) => {
|
|
434
|
+
e && s.bridge.goToSlide(e.slideIndex), s.aiPanel.showChangeBatch(e);
|
|
454
435
|
});
|
|
455
436
|
(0, r.onBeforeUnmount)(() => E());
|
|
456
|
-
const w = (0, r.computed)(() =>
|
|
457
|
-
function
|
|
458
|
-
|
|
437
|
+
const w = (0, r.computed)(() => s.aiPanel.pickTargets.value.length > 0), N = (0, r.computed)(() => w.value ? s.aiPanel.pickTargets.value : s.aiPanel.pinnedFocus.value ?? s.aiPanel.liveFocusTargets.value), V = (0, r.computed)(() => !w.value && null !== s.aiPanel.pinnedFocus.value);
|
|
438
|
+
function S(e) {
|
|
439
|
+
s.aiPanel.flashToolTarget(null), y(e);
|
|
459
440
|
}
|
|
460
|
-
function
|
|
461
|
-
|
|
441
|
+
function P() {
|
|
442
|
+
s.aiPanel.flashToolTarget(null), h();
|
|
462
443
|
}
|
|
463
|
-
return (e, t) => ((0, r.openBlock)(), (0, r.createElementBlock)("div",
|
|
464
|
-
(0, r.createElementVNode)("div",
|
|
444
|
+
return (e, t) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", ae, [
|
|
445
|
+
(0, r.createElementVNode)("div", ne, [(0, r.createElementVNode)("button", {
|
|
465
446
|
type: "button",
|
|
466
447
|
class: "inline-flex items-center gap-1 rounded-sm px-1.5 py-1 text-[12px] text-muted-foreground hover:bg-accent max-md:min-h-[44px]!",
|
|
467
448
|
onClick: t[0] || (t[0] = (e) => B.value = !B.value)
|
|
468
|
-
}, [(0, r.createVNode)((0, r.unref)(a.History), { class: "w-3.5 h-3.5" }), (0, r.createTextVNode)(" " + (0, r.toDisplayString)((0, r.unref)(
|
|
449
|
+
}, [(0, r.createVNode)((0, r.unref)(a.History), { class: "w-3.5 h-3.5" }), (0, r.createTextVNode)(" " + (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.chats")), 1)]), (0, r.createElementVNode)("div", oe, [(0, r.createElementVNode)("button", {
|
|
469
450
|
type: "button",
|
|
470
|
-
title: (0, r.unref)(
|
|
471
|
-
"aria-label": (0, r.unref)(
|
|
451
|
+
title: (0, r.unref)(i)("pptx.ai.newChat"),
|
|
452
|
+
"aria-label": (0, r.unref)(i)("pptx.ai.newChat"),
|
|
472
453
|
class: "rounded-sm p-1 text-muted-foreground hover:bg-accent flex items-center justify-center max-md:min-w-[44px]! max-md:min-h-[44px]!",
|
|
473
|
-
onClick: t[1] || (t[1] = (e) => (0, r.unref)(
|
|
474
|
-
}, [(0, r.createVNode)((0, r.unref)(a.MessageSquarePlus), { class: "w-3.5 h-3.5" })], 8,
|
|
454
|
+
onClick: t[1] || (t[1] = (e) => (0, r.unref)(v).newChat())
|
|
455
|
+
}, [(0, r.createVNode)((0, r.unref)(a.MessageSquarePlus), { class: "w-3.5 h-3.5" })], 8, le), (0, r.createElementVNode)("button", {
|
|
475
456
|
type: "button",
|
|
476
|
-
title: (0, r.unref)(
|
|
477
|
-
"aria-label": (0, r.unref)(
|
|
457
|
+
title: (0, r.unref)(i)("pptx.ai.clearChat"),
|
|
458
|
+
"aria-label": (0, r.unref)(i)("pptx.ai.clearChat"),
|
|
478
459
|
disabled: 0 === (0, r.unref)(d).length,
|
|
479
460
|
class: "rounded-sm p-1 text-muted-foreground hover:bg-accent disabled:opacity-40 flex items-center justify-center max-md:min-w-[44px]! max-md:min-h-[44px]!",
|
|
480
|
-
onClick: t[2] || (t[2] = (e) => (0, r.unref)(
|
|
481
|
-
}, [(0, r.createVNode)((0, r.unref)(a.Trash2), { class: "w-3.5 h-3.5" })], 8,
|
|
482
|
-
B.value ? ((0, r.openBlock)(), (0, r.createBlock)(
|
|
461
|
+
onClick: t[2] || (t[2] = (e) => (0, r.unref)(v).clearCurrent())
|
|
462
|
+
}, [(0, r.createVNode)((0, r.unref)(a.Trash2), { class: "w-3.5 h-3.5" })], 8, se)])]),
|
|
463
|
+
B.value ? ((0, r.openBlock)(), (0, r.createBlock)(A, {
|
|
483
464
|
key: 0,
|
|
484
|
-
chats: (0, r.unref)(
|
|
485
|
-
"active-chat-id": (0, r.unref)(
|
|
465
|
+
chats: (0, r.unref)(v).chats.value,
|
|
466
|
+
"active-chat-id": (0, r.unref)(v).activeChatId.value,
|
|
486
467
|
onResume: t[3] || (t[3] = (e) => {
|
|
487
|
-
(0, r.unref)(
|
|
468
|
+
(0, r.unref)(v).resumeChat(e);
|
|
488
469
|
}),
|
|
489
470
|
onDelete: t[4] || (t[4] = (e) => {
|
|
490
|
-
(0, r.unref)(
|
|
471
|
+
(0, r.unref)(v).deleteChat(e);
|
|
491
472
|
}),
|
|
492
|
-
onNewChat: t[5] || (t[5] = (e) => (0, r.unref)(
|
|
473
|
+
onNewChat: t[5] || (t[5] = (e) => (0, r.unref)(v).newChat()),
|
|
493
474
|
onClose: t[6] || (t[6] = (e) => B.value = !1)
|
|
494
475
|
}, null, 8, ["chats", "active-chat-id"])) : (0, r.createCommentVNode)("", !0),
|
|
495
|
-
(0, r.createVNode)(
|
|
496
|
-
targets:
|
|
497
|
-
slides:
|
|
498
|
-
"is-pinned":
|
|
499
|
-
"pick-mode":
|
|
476
|
+
(0, r.createVNode)(C, {
|
|
477
|
+
targets: N.value,
|
|
478
|
+
slides: s.bridge.getSlides(),
|
|
479
|
+
"is-pinned": V.value,
|
|
480
|
+
"pick-mode": s.aiPanel.pickMode.value,
|
|
500
481
|
"has-picks": w.value,
|
|
501
|
-
onPin:
|
|
502
|
-
onClearPin:
|
|
503
|
-
onStartPick:
|
|
504
|
-
onStopPick:
|
|
505
|
-
onClearPicks:
|
|
506
|
-
onSendDirective: (0, r.unref)(
|
|
482
|
+
onPin: s.aiPanel.pinFocus,
|
|
483
|
+
onClearPin: s.aiPanel.clearPinnedFocus,
|
|
484
|
+
onStartPick: s.aiPanel.startPicking,
|
|
485
|
+
onStopPick: s.aiPanel.stopPicking,
|
|
486
|
+
onClearPicks: s.aiPanel.clearPicks,
|
|
487
|
+
onSendDirective: (0, r.unref)(f)
|
|
507
488
|
}, null, 8, [
|
|
508
489
|
"targets",
|
|
509
490
|
"slides",
|
|
@@ -517,36 +498,36 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
517
498
|
"onClearPicks",
|
|
518
499
|
"onSendDirective"
|
|
519
500
|
]),
|
|
520
|
-
(0, r.createVNode)(
|
|
501
|
+
(0, r.createVNode)(J, {
|
|
521
502
|
messages: (0, r.unref)(d),
|
|
522
|
-
"is-streaming": (0, r.unref)(
|
|
503
|
+
"is-streaming": (0, r.unref)(m)
|
|
523
504
|
}, null, 8, ["messages", "is-streaming"]),
|
|
524
|
-
(0, r.unref)(
|
|
505
|
+
(0, r.unref)(u) ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", ie, [
|
|
525
506
|
(0, r.createVNode)((0, r.unref)(a.TriangleAlert), { class: "mt-0.5 w-3.5 h-3.5 shrink-0" }),
|
|
526
|
-
(0, r.createElementVNode)("div",
|
|
507
|
+
(0, r.createElementVNode)("div", ce, [(0, r.createElementVNode)("div", pe, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.errorPrefix")), 1), (0, r.createElementVNode)("div", de, (0, r.toDisplayString)((0, r.unref)(u).message), 1)]),
|
|
527
508
|
(0, r.createElementVNode)("button", {
|
|
528
509
|
type: "button",
|
|
529
510
|
class: "shrink-0 rounded-sm px-1.5 py-0.5 text-[11px] underline-offset-2 hover:underline",
|
|
530
|
-
onClick: t[7] || (t[7] = (...e) => (0, r.unref)(
|
|
531
|
-
}, (0, r.toDisplayString)((0, r.unref)(
|
|
511
|
+
onClick: t[7] || (t[7] = (...e) => (0, r.unref)(k) && (0, r.unref)(k)(...e))
|
|
512
|
+
}, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.retry")), 1)
|
|
532
513
|
])) : (0, r.createCommentVNode)("", !0),
|
|
533
|
-
(0, r.unref)(x).length > 0 ? ((0, r.openBlock)(), (0, r.createElementBlock)("div",
|
|
514
|
+
(0, r.unref)(x).length > 0 ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", ue, [(0, r.createElementVNode)("div", me, [(0, r.createElementVNode)("span", xe, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.pendingChanges", { count: (0, r.unref)(x).length })), 1), (0, r.unref)(x).length > 1 ? ((0, r.openBlock)(), (0, r.createElementBlock)("button", {
|
|
534
515
|
key: 0,
|
|
535
516
|
type: "button",
|
|
536
517
|
class: "rounded-sm bg-primary/90 px-2 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary",
|
|
537
|
-
onClick:
|
|
538
|
-
}, (0, r.toDisplayString)((0, r.unref)(
|
|
518
|
+
onClick: P
|
|
519
|
+
}, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.acceptAll")), 1)) : (0, r.createCommentVNode)("", !0)]), ((0, r.openBlock)(!0), (0, r.createElementBlock)(r.Fragment, null, (0, r.renderList)((0, r.unref)(x), (e) => ((0, r.openBlock)(), (0, r.createBlock)(re, {
|
|
539
520
|
key: e.id,
|
|
540
521
|
proposal: e,
|
|
541
|
-
onAccept:
|
|
542
|
-
onReject: (0, r.unref)(
|
|
522
|
+
onAccept: S,
|
|
523
|
+
onReject: (0, r.unref)(b)
|
|
543
524
|
}, null, 8, ["proposal", "onReject"]))), 128))])) : (0, r.createCommentVNode)("", !0),
|
|
544
|
-
(0, r.createVNode)(
|
|
545
|
-
"is-streaming": (0, r.unref)(
|
|
546
|
-
"prefill-text":
|
|
547
|
-
"prefill-nonce":
|
|
548
|
-
onSend: (0, r.unref)(
|
|
549
|
-
onStop: (0, r.unref)(
|
|
525
|
+
(0, r.createVNode)(c, {
|
|
526
|
+
"is-streaming": (0, r.unref)(m),
|
|
527
|
+
"prefill-text": s.aiPanel.prefill.value.text,
|
|
528
|
+
"prefill-nonce": s.aiPanel.prefill.value.nonce,
|
|
529
|
+
onSend: (0, r.unref)(f),
|
|
530
|
+
onStop: (0, r.unref)(g)
|
|
550
531
|
}, null, 8, [
|
|
551
532
|
"is-streaming",
|
|
552
533
|
"prefill-text",
|
|
@@ -556,13 +537,13 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
556
537
|
])
|
|
557
538
|
]));
|
|
558
539
|
}
|
|
559
|
-
}),
|
|
540
|
+
}), ge = { class: "flex items-center gap-2 border-b border-border px-3 py-2" }, ke = { class: "text-sm font-semibold text-foreground" }, ye = ["title", "aria-label"], be = {
|
|
560
541
|
key: 0,
|
|
561
542
|
class: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground"
|
|
562
|
-
},
|
|
543
|
+
}, he = {
|
|
563
544
|
key: 1,
|
|
564
545
|
class: "flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center"
|
|
565
|
-
},
|
|
546
|
+
}, ve = { class: "text-sm font-medium text-foreground" }, Ce = { class: "text-[12px] text-muted-foreground" }, Be = { class: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground" }, Ee = (0, r.defineComponent)({
|
|
566
547
|
__name: "AiChatPanel",
|
|
567
548
|
props: {
|
|
568
549
|
bridge: {},
|
|
@@ -598,32 +579,32 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
598
579
|
activeSlideIndex: (0, r.ref)(0),
|
|
599
580
|
selectedElementIds: (0, r.ref)([]),
|
|
600
581
|
selectedElement: () => null
|
|
601
|
-
}),
|
|
582
|
+
}), x = (0, r.computed)(() => l.aiPanel ?? m);
|
|
602
583
|
return (e, t) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", {
|
|
603
584
|
"data-pptx-ai-panel": "",
|
|
604
585
|
class: "absolute right-0 top-0 z-30 flex h-full w-80 flex-col border-l border-border bg-card shadow-xl max-md:inset-x-0 max-md:top-auto max-md:bottom-0 max-md:h-[75dvh] max-md:w-full max-md:rounded-t-2xl max-md:border-l-0 max-md:border-t max-md:shadow-2xl",
|
|
605
586
|
style: (0, r.normalizeStyle)(u.value)
|
|
606
|
-
}, [(0, r.createElementVNode)("div",
|
|
587
|
+
}, [(0, r.createElementVNode)("div", ge, [
|
|
607
588
|
(0, r.createVNode)((0, r.unref)(a.Sparkles), { class: "w-4 h-4 text-primary" }),
|
|
608
|
-
(0, r.createElementVNode)("span",
|
|
589
|
+
(0, r.createElementVNode)("span", ke, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.title")), 1),
|
|
609
590
|
(0, r.createElementVNode)("button", {
|
|
610
591
|
type: "button",
|
|
611
592
|
title: (0, r.unref)(i)("pptx.ai.close"),
|
|
612
593
|
"aria-label": (0, r.unref)(i)("pptx.ai.close"),
|
|
613
594
|
class: "ml-auto flex items-center justify-center rounded-sm p-1 text-muted-foreground transition-colors hover:bg-accent max-md:min-w-[44px]! max-md:min-h-[44px]!",
|
|
614
595
|
onClick: t[0] || (t[0] = (e) => s("close"))
|
|
615
|
-
}, [(0, r.createVNode)((0, r.unref)(a.X), { class: "w-4 h-4" })], 8,
|
|
616
|
-
]), "checking" === (0, r.unref)(c) ? ((0, r.openBlock)(), (0, r.createElementBlock)("div",
|
|
596
|
+
}, [(0, r.createVNode)((0, r.unref)(a.X), { class: "w-4 h-4" })], 8, ye)
|
|
597
|
+
]), "checking" === (0, r.unref)(c) ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", be, [(0, r.createVNode)((0, r.unref)(a.LoaderCircle), { class: "w-5 h-5 animate-spin" })])) : "unavailable" === (0, r.unref)(c) || "error" === (0, r.unref)(c) ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", he, [
|
|
617
598
|
(0, r.createVNode)((0, r.unref)(a.TriangleAlert), { class: "w-6 h-6 text-muted-foreground" }),
|
|
618
|
-
(0, r.createElementVNode)("p",
|
|
619
|
-
(0, r.createElementVNode)("p",
|
|
599
|
+
(0, r.createElementVNode)("p", ve, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.unavailableTitle")), 1),
|
|
600
|
+
(0, r.createElementVNode)("p", Ce, (0, r.toDisplayString)((0, r.unref)(d)?.message ?? (0, r.unref)(i)("pptx.ai.unavailableHint")), 1)
|
|
620
601
|
])) : "ready" === (0, r.unref)(c) && (0, r.unref)(p) ? ((0, r.openBlock)(), (0, r.createBlock)(r.Suspense, { key: 2 }, {
|
|
621
|
-
fallback: (0, r.withCtx)(() => [(0, r.createElementVNode)("div",
|
|
622
|
-
default: (0, r.withCtx)(() => [(0, r.createVNode)(
|
|
602
|
+
fallback: (0, r.withCtx)(() => [(0, r.createElementVNode)("div", Be, [(0, r.createVNode)((0, r.unref)(a.LoaderCircle), { class: "w-5 h-5 animate-spin" })])]),
|
|
603
|
+
default: (0, r.withCtx)(() => [(0, r.createVNode)(fe, {
|
|
623
604
|
session: (0, r.unref)(p),
|
|
624
605
|
config: l.config,
|
|
625
606
|
bridge: l.bridge,
|
|
626
|
-
"ai-panel":
|
|
607
|
+
"ai-panel": x.value
|
|
627
608
|
}, null, 8, [
|
|
628
609
|
"session",
|
|
629
610
|
"config",
|
|
@@ -634,4 +615,4 @@ var s = { class: "border-t border-border p-2" }, i = { class: "flex items-end ga
|
|
|
634
615
|
})) : (0, r.createCommentVNode)("", !0)], 4));
|
|
635
616
|
}
|
|
636
617
|
});
|
|
637
|
-
exports.default =
|
|
618
|
+
exports.default = Ee;
|