pptx-vue-viewer 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/{AiChatPanel-BxNXpUN6.cjs → AiChatPanel-CIWcMm8C.cjs} +10 -10
- package/dist/AiChatPanel-CIWcMm8C.cjs.br +0 -0
- package/dist/AiChatPanel-CIWcMm8C.cjs.gz +0 -0
- package/dist/AiChatPanel-CzS-aHL8.js +640 -0
- package/dist/AiChatPanel-CzS-aHL8.js.br +0 -0
- package/dist/AiChatPanel-CzS-aHL8.js.gz +0 -0
- package/dist/gif-encoder-DWBR8LMW.cjs +2 -0
- package/dist/gif-encoder-DWBR8LMW.cjs.br +0 -0
- package/dist/gif-encoder-DWBR8LMW.cjs.gz +0 -0
- package/dist/gif-encoder-Hs46qb2d.js +2 -0
- package/dist/gif-encoder-Hs46qb2d.js.br +0 -0
- package/dist/gif-encoder-Hs46qb2d.js.gz +0 -0
- package/dist/{i18n-D2rp3BB2.js → i18n-C0N3ae_W.js} +1 -0
- package/dist/i18n-C0N3ae_W.js.br +0 -0
- package/dist/{i18n-D2rp3BB2.js.gz → i18n-C0N3ae_W.js.gz} +0 -0
- package/dist/{i18n-Dwd1wvi3.cjs → i18n-Dta_jyWT.cjs} +1 -0
- package/dist/i18n-Dta_jyWT.cjs.br +0 -0
- package/dist/{i18n-Dwd1wvi3.cjs.gz → i18n-Dta_jyWT.cjs.gz} +0 -0
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.cjs.br +0 -0
- package/dist/i18n.cjs.gz +0 -0
- package/dist/i18n.js +1 -1
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.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 +2 -2
- 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/pptx-vue-viewer.css +17 -17
- package/dist/pptx-vue-viewer.css.br +0 -0
- package/dist/pptx-vue-viewer.css.gz +0 -0
- package/dist/{useViewerSettingsDialog-QANgtUZA.cjs → useViewerSettingsDialog-Ba-pfmyk.cjs} +11854 -9003
- package/dist/useViewerSettingsDialog-Ba-pfmyk.cjs.br +0 -0
- package/dist/useViewerSettingsDialog-Ba-pfmyk.cjs.gz +0 -0
- package/dist/{useViewerSettingsDialog-we5OdcQt.js → useViewerSettingsDialog-DC7CgLIE.js} +8004 -5308
- package/dist/useViewerSettingsDialog-DC7CgLIE.js.br +0 -0
- package/dist/useViewerSettingsDialog-DC7CgLIE.js.gz +0 -0
- package/dist/viewer/components/ConnectorRenderer.vue.d.ts.map +1 -1
- package/dist/viewer/components/ElementImageBox.vue.d.ts.map +1 -1
- package/dist/viewer/components/ElementRenderer.vue.d.ts.map +1 -1
- package/dist/viewer/components/OleRenderer.vue.d.ts +3 -2
- package/dist/viewer/components/OleRenderer.vue.d.ts.map +1 -1
- package/dist/viewer/components/PresentationAnnotationOverlay.vue.d.ts.map +1 -1
- package/dist/viewer/components/PresentationMode.vue.d.ts.map +1 -1
- package/dist/viewer/components/SelectionOverlay.vue.d.ts +2 -2
- package/dist/viewer/components/SelectionOverlay.vue.d.ts.map +1 -1
- package/dist/viewer/components/SlideTransitionPanel.vue.d.ts.map +1 -1
- package/dist/viewer/components/SmartArtPreviews.vue.d.ts +4 -0
- package/dist/viewer/components/SmartArtPreviews.vue.d.ts.map +1 -1
- package/dist/viewer/components/ai/AiFocusBar.vue.d.ts.map +1 -1
- package/dist/viewer/components/inspector/ChartDisplayOptions.vue.d.ts +16 -3
- package/dist/viewer/components/inspector/ChartDisplayOptions.vue.d.ts.map +1 -1
- package/dist/viewer/components/inspector/ChartPanel.vue.d.ts.map +1 -1
- package/dist/viewer/components/inspector/EffectsGlowReflectionSection.vue.d.ts +20 -0
- package/dist/viewer/components/inspector/EffectsGlowReflectionSection.vue.d.ts.map +1 -0
- package/dist/viewer/components/inspector/EffectsPanel.vue.d.ts +14 -17
- package/dist/viewer/components/inspector/EffectsPanel.vue.d.ts.map +1 -1
- package/dist/viewer/components/inspector/EffectsShadowSection.vue.d.ts +20 -0
- package/dist/viewer/components/inspector/EffectsShadowSection.vue.d.ts.map +1 -0
- package/dist/viewer/components/inspector/FillGradientControls.vue.d.ts +23 -0
- package/dist/viewer/components/inspector/FillGradientControls.vue.d.ts.map +1 -0
- package/dist/viewer/components/inspector/FillPanel.vue.d.ts +9 -3
- package/dist/viewer/components/inspector/FillPanel.vue.d.ts.map +1 -1
- package/dist/viewer/components/inspector/FillPatternControls.vue.d.ts +25 -0
- package/dist/viewer/components/inspector/FillPatternControls.vue.d.ts.map +1 -0
- package/dist/viewer/components/inspector/SlideTransitionSection.vue.d.ts.map +1 -1
- package/dist/viewer/components/inspector/StrokePanel.vue.d.ts.map +1 -1
- package/dist/viewer/components/inspector/TableCellAdvancedFill.vue.d.ts +3 -2
- package/dist/viewer/components/inspector/TableCellAdvancedFill.vue.d.ts.map +1 -1
- package/dist/viewer/components/inspector/TableStyleOptions.vue.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/HomeSection.vue.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/ShapeArrangeExtras.vue.d.ts.map +1 -1
- package/dist/viewer/composables/ai/ai-log-export.d.ts +2 -54
- package/dist/viewer/composables/ai/ai-log-export.d.ts.map +1 -1
- package/dist/viewer/composables/ai/useAiBridge.d.ts.map +1 -1
- package/dist/viewer/composables/ai/useAiPanelController.d.ts +2 -8
- package/dist/viewer/composables/ai/useAiPanelController.d.ts.map +1 -1
- package/dist/viewer/composables/cross-slide-audio.d.ts +7 -9
- package/dist/viewer/composables/cross-slide-audio.d.ts.map +1 -1
- package/dist/viewer/composables/element-store-patch.d.ts.map +1 -1
- package/dist/viewer/composables/selection-gesture.d.ts +1 -3
- package/dist/viewer/composables/selection-gesture.d.ts.map +1 -1
- package/dist/viewer/composables/useAnimationPlayback.d.ts.map +1 -1
- package/dist/viewer/composables/useCollaboration.d.ts.map +1 -1
- package/dist/viewer/composables/useEditorOperations.d.ts.map +1 -1
- package/dist/viewer/composables/useElementDrag.d.ts.map +1 -1
- package/dist/viewer/composables/useGoogleWebfonts.d.ts +2 -1
- package/dist/viewer/composables/useGoogleWebfonts.d.ts.map +1 -1
- package/dist/viewer/composables/useLoadContent.d.ts.map +1 -1
- package/dist/viewer/composables/useModel3dScene.d.ts.map +1 -1
- package/dist/viewer/composables/usePresentationAnnotations.d.ts +0 -2
- package/dist/viewer/composables/usePresentationAnnotations.d.ts.map +1 -1
- package/dist/viewer/composables/usePresentationNavigation.d.ts +7 -0
- package/dist/viewer/composables/usePresentationNavigation.d.ts.map +1 -1
- 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-CN_soJdw.cjs → viewer-DyWiOaRX.cjs} +6274 -6231
- package/dist/viewer-DyWiOaRX.cjs.br +0 -0
- package/dist/viewer-DyWiOaRX.cjs.gz +0 -0
- package/dist/{viewer-BRRFtKDV.js → viewer-Mdf9Ioha.js} +10847 -10806
- package/dist/viewer-Mdf9Ioha.js.br +0 -0
- package/dist/viewer-Mdf9Ioha.js.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-BxNXpUN6.cjs.br +0 -0
- package/dist/AiChatPanel-BxNXpUN6.cjs.gz +0 -0
- package/dist/AiChatPanel-t_4NXlkY.js +0 -640
- package/dist/AiChatPanel-t_4NXlkY.js.br +0 -0
- package/dist/AiChatPanel-t_4NXlkY.js.gz +0 -0
- package/dist/gif-encoder-Bzuo20ei.js +0 -2
- package/dist/gif-encoder-Bzuo20ei.js.br +0 -0
- package/dist/gif-encoder-Bzuo20ei.js.gz +0 -0
- package/dist/gif-encoder-Cz7X2ehi.cjs +0 -2
- package/dist/gif-encoder-Cz7X2ehi.cjs.br +0 -0
- package/dist/gif-encoder-Cz7X2ehi.cjs.gz +0 -0
- package/dist/i18n-D2rp3BB2.js.br +0 -0
- package/dist/i18n-Dwd1wvi3.cjs.br +0 -0
- package/dist/useViewerSettingsDialog-QANgtUZA.cjs.br +0 -0
- package/dist/useViewerSettingsDialog-QANgtUZA.cjs.gz +0 -0
- package/dist/useViewerSettingsDialog-we5OdcQt.js.br +0 -0
- package/dist/useViewerSettingsDialog-we5OdcQt.js.gz +0 -0
- package/dist/viewer/composables/ai/focus-targets.d.ts +0 -34
- package/dist/viewer/composables/ai/focus-targets.d.ts.map +0 -1
- package/dist/viewer/composables/animation-playback-helpers.d.ts +0 -43
- package/dist/viewer/composables/animation-playback-helpers.d.ts.map +0 -1
- package/dist/viewer-BRRFtKDV.js.br +0 -0
- package/dist/viewer-BRRFtKDV.js.gz +0 -0
- package/dist/viewer-CN_soJdw.cjs.br +0 -0
- package/dist/viewer-CN_soJdw.cjs.gz +0 -0
|
@@ -0,0 +1,640 @@
|
|
|
1
|
+
import { gn as e } from "./useViewerSettingsDialog-DC7CgLIE.js";
|
|
2
|
+
import { S as t, T as a, _ as s, b as r, d as l, f as o, g as n, h as i, m as p, o as d, p as c, u, v as m, x, y as g } from "./viewer-Mdf9Ioha.js";
|
|
3
|
+
import { Fragment as f, Suspense as b, computed as v, createBlock as h, createCommentVNode as y, createElementBlock as k, createElementVNode as w, createTextVNode as C, createVNode as P, defineComponent as S, nextTick as T, normalizeClass as I, normalizeStyle as _, onBeforeUnmount as A, onMounted as E, openBlock as j, ref as M, renderList as F, resolveDynamicComponent as B, shallowRef as D, toDisplayString as N, unref as L, vModelText as R, watch as H, withAsyncContext as W, withCtx as z, withDirectives as V } from "vue";
|
|
4
|
+
import { Bot as K, ChartColumn as O, Check as U, Crosshair as $, Eye as q, Film as G, GitMerge as J, History as Q, LayoutTemplate as X, LoaderCircle as Y, MessageSquare as Z, MessageSquarePlus as ee, Move as te, Navigation as ae, Palette as se, Pin as re, PinOff as le, Plus as oe, Search as ne, Send as ie, Shapes as pe, Sparkles as de, Square as ce, StickyNote as ue, Table as me, Trash2 as xe, TriangleAlert as ge, Type as fe, User as be, Wrench as ve, X as he } from "lucide-vue-next";
|
|
5
|
+
import { getToolOrDynamicToolName as ye, isDynamicToolUIPart as ke, isToolUIPart as we } from "ai";
|
|
6
|
+
var Ce = /* @__PURE__ */ new Set([
|
|
7
|
+
"input-available",
|
|
8
|
+
"output-available",
|
|
9
|
+
"output-error"
|
|
10
|
+
]);
|
|
11
|
+
function Pe(e, t, a, s = {}) {
|
|
12
|
+
const r = M(t.proposals.list()), l = () => {
|
|
13
|
+
r.value = t.proposals.list();
|
|
14
|
+
}, o = e({
|
|
15
|
+
transport: t.transport,
|
|
16
|
+
sendAutomaticallyWhen: t.sendAutomaticallyWhen,
|
|
17
|
+
onError: (e) => a.onError?.(e),
|
|
18
|
+
onToolCall: async ({ toolCall: e }) => {
|
|
19
|
+
const { toolName: a, toolCallId: s, input: r } = e, n = o.addToolOutput;
|
|
20
|
+
try {
|
|
21
|
+
n({
|
|
22
|
+
tool: a,
|
|
23
|
+
toolCallId: s,
|
|
24
|
+
output: await t.executeToolCall(a, r)
|
|
25
|
+
});
|
|
26
|
+
} catch (e) {
|
|
27
|
+
n({
|
|
28
|
+
tool: a,
|
|
29
|
+
toolCallId: s,
|
|
30
|
+
state: "output-error",
|
|
31
|
+
errorText: e instanceof Error ? e.message : String(e)
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
l();
|
|
35
|
+
}
|
|
36
|
+
}), n = v(() => "submitted" === o.status.value || "streaming" === o.status.value), i = /* @__PURE__ */ new Set();
|
|
37
|
+
H(o.messages, (e) => {
|
|
38
|
+
for (const t of function(e) {
|
|
39
|
+
const t = [];
|
|
40
|
+
for (const a of e) for (const e of a.parts) {
|
|
41
|
+
if (!we(e) && !ke(e)) continue;
|
|
42
|
+
const a = e, s = a.toolCallId ?? "";
|
|
43
|
+
0 !== s.length && void 0 !== a.input && Ce.has(a.state ?? "") && t.push({
|
|
44
|
+
toolName: ye(e),
|
|
45
|
+
toolCallId: s,
|
|
46
|
+
input: a.input
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return t;
|
|
50
|
+
}(e)) i.has(t.toolCallId) || (i.add(t.toolCallId), s.onToolTarget?.(x(t.toolName, t.input)));
|
|
51
|
+
}, { deep: !0 });
|
|
52
|
+
return {
|
|
53
|
+
messages: o.messages,
|
|
54
|
+
status: o.status,
|
|
55
|
+
error: o.error,
|
|
56
|
+
isStreaming: n,
|
|
57
|
+
proposals: r,
|
|
58
|
+
send: (e) => {
|
|
59
|
+
const t = e.trim();
|
|
60
|
+
0 !== t.length && o.sendMessage({ text: t });
|
|
61
|
+
},
|
|
62
|
+
stop: () => {
|
|
63
|
+
o.stop();
|
|
64
|
+
},
|
|
65
|
+
clearError: () => o.clearError(),
|
|
66
|
+
applyProposal: (e) => {
|
|
67
|
+
t.proposals.apply(e), l();
|
|
68
|
+
},
|
|
69
|
+
rejectProposal: (e) => {
|
|
70
|
+
t.proposals.revert(e), l();
|
|
71
|
+
},
|
|
72
|
+
acceptAllProposals: () => {
|
|
73
|
+
t.proposals.acceptAll(), l();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
var Se = { class: "border-t border-border p-2" }, Te = { class: "flex items-end gap-1.5 rounded-md border border-input bg-background px-2 py-1.5 focus-within:border-ring" }, Ie = ["placeholder", "aria-label"], _e = ["title", "aria-label"], Ae = [
|
|
78
|
+
"disabled",
|
|
79
|
+
"title",
|
|
80
|
+
"aria-label"
|
|
81
|
+
], Ee = S({
|
|
82
|
+
__name: "AiComposer",
|
|
83
|
+
props: {
|
|
84
|
+
isStreaming: { type: Boolean },
|
|
85
|
+
prefillText: {},
|
|
86
|
+
prefillNonce: {}
|
|
87
|
+
},
|
|
88
|
+
emits: ["send", "stop"],
|
|
89
|
+
setup(t, { emit: s }) {
|
|
90
|
+
const r = t, l = s, { t: o } = e(), n = M(""), i = M(null), p = v(() => n.value.trim().length > 0);
|
|
91
|
+
function d() {
|
|
92
|
+
const e = n.value.trim();
|
|
93
|
+
0 === e.length || r.isStreaming || (l("send", e), n.value = "");
|
|
94
|
+
}
|
|
95
|
+
function c(e) {
|
|
96
|
+
"Enter" !== e.key || e.shiftKey || (e.preventDefault(), d());
|
|
97
|
+
}
|
|
98
|
+
return H(() => r.prefillNonce, (e) => {
|
|
99
|
+
void 0 !== e && 0 !== e && (r.prefillText && (n.value = r.prefillText), T(() => i.value?.focus()));
|
|
100
|
+
}), (e, t) => (j(), k("div", Se, [w("div", Te, [V(w("textarea", {
|
|
101
|
+
ref_key: "textareaRef",
|
|
102
|
+
ref: i,
|
|
103
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => n.value = e),
|
|
104
|
+
rows: 1,
|
|
105
|
+
placeholder: L(o)("pptx.ai.placeholder"),
|
|
106
|
+
"aria-label": L(o)("pptx.ai.placeholder"),
|
|
107
|
+
class: "max-h-32 min-h-[1.5rem] flex-1 resize-none bg-transparent text-[13px] text-foreground outline-none placeholder:text-muted-foreground",
|
|
108
|
+
onKeydown: c
|
|
109
|
+
}, null, 40, Ie), [[R, n.value]]), r.isStreaming ? (j(), k("button", {
|
|
110
|
+
key: 0,
|
|
111
|
+
type: "button",
|
|
112
|
+
title: L(o)("pptx.ai.stop"),
|
|
113
|
+
"aria-label": L(o)("pptx.ai.stop"),
|
|
114
|
+
class: "shrink-0 rounded-sm p-1.5 text-muted-foreground transition-colors hover:bg-accent",
|
|
115
|
+
onClick: t[1] || (t[1] = (e) => l("stop"))
|
|
116
|
+
}, [P(L(ce), { class: "w-4 h-4" })], 8, _e)) : (j(), k("button", {
|
|
117
|
+
key: 1,
|
|
118
|
+
type: "button",
|
|
119
|
+
disabled: !p.value,
|
|
120
|
+
title: L(o)("pptx.ai.send"),
|
|
121
|
+
"aria-label": L(o)("pptx.ai.send"),
|
|
122
|
+
class: I(L(a)("shrink-0 rounded-sm p-1.5 transition-colors", p.value ? "bg-primary text-primary-foreground hover:bg-primary/90" : "text-muted-foreground/50")),
|
|
123
|
+
onClick: d
|
|
124
|
+
}, [P(L(ie), { class: "w-4 h-4" })], 10, Ae))])]));
|
|
125
|
+
}
|
|
126
|
+
}), je = { class: "border-b border-border bg-secondary/30" }, Me = { class: "flex flex-wrap items-center gap-1 px-2.5 py-1.5" }, Fe = { class: "text-[10px] font-semibold uppercase tracking-wide text-muted-foreground" }, Be = ["title"], De = { class: "truncate" }, Ne = {
|
|
127
|
+
key: 0,
|
|
128
|
+
class: "rounded-full bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium text-primary"
|
|
129
|
+
}, Le = { class: "ml-auto flex items-center gap-0.5" }, Re = [
|
|
130
|
+
"title",
|
|
131
|
+
"aria-label",
|
|
132
|
+
"aria-pressed"
|
|
133
|
+
], He = ["title", "aria-label"], We = ["title", "aria-label"], ze = {
|
|
134
|
+
key: 0,
|
|
135
|
+
class: "flex items-center gap-2 border-t border-primary/20 bg-primary/5 px-2.5 py-1"
|
|
136
|
+
}, Ve = { class: "text-[11px] font-medium text-primary" }, Ke = S({
|
|
137
|
+
__name: "AiFocusBar",
|
|
138
|
+
props: {
|
|
139
|
+
targets: {},
|
|
140
|
+
slides: {},
|
|
141
|
+
isPinned: { type: Boolean },
|
|
142
|
+
pickMode: { type: Boolean },
|
|
143
|
+
hasPicks: { type: Boolean }
|
|
144
|
+
},
|
|
145
|
+
emits: [
|
|
146
|
+
"pin",
|
|
147
|
+
"clear-pin",
|
|
148
|
+
"start-pick",
|
|
149
|
+
"stop-pick",
|
|
150
|
+
"clear-picks",
|
|
151
|
+
"send-directive"
|
|
152
|
+
],
|
|
153
|
+
setup(t, { emit: r }) {
|
|
154
|
+
const l = t, o = r, { t: n } = e(), i = v(() => p(l.targets, l.slides)), d = v(() => s(l.targets, l.slides));
|
|
155
|
+
function c() {
|
|
156
|
+
const e = d.value;
|
|
157
|
+
e && o("send-directive", m(e.slideIndex, e.elementIdA, e.elementIdB));
|
|
158
|
+
}
|
|
159
|
+
return (e, s) => (j(), k("div", je, [w("div", Me, [
|
|
160
|
+
w("span", Fe, N(L(n)("pptx.ai.focusScope")), 1),
|
|
161
|
+
(j(!0), k(f, null, F(i.value, (e) => (j(), k("span", {
|
|
162
|
+
key: e.key,
|
|
163
|
+
class: I(L(a)("inline-flex max-w-[10rem] items-center rounded-full px-2 py-0.5 text-[11px]", t.hasPicks || t.isPinned ? "bg-primary/15 text-primary" : "bg-muted text-muted-foreground")),
|
|
164
|
+
title: e.title
|
|
165
|
+
}, [w("span", De, N(e.label), 1)], 10, Be))), 128)),
|
|
166
|
+
t.isPinned ? (j(), k("span", Ne, N(L(n)("pptx.ai.pinnedFocus")), 1)) : y("", !0),
|
|
167
|
+
w("div", Le, [
|
|
168
|
+
d.value ? (j(), k("button", {
|
|
169
|
+
key: 0,
|
|
170
|
+
type: "button",
|
|
171
|
+
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",
|
|
172
|
+
onClick: c
|
|
173
|
+
}, [P(L(J), { class: "w-3 h-3" }), C(" " + N(L(n)("pptx.ai.mergeSelectedTables")), 1)])) : y("", !0),
|
|
174
|
+
w("button", {
|
|
175
|
+
type: "button",
|
|
176
|
+
title: L(n)("pptx.ai.pickElement"),
|
|
177
|
+
"aria-label": L(n)("pptx.ai.pickAria"),
|
|
178
|
+
"aria-pressed": t.pickMode,
|
|
179
|
+
class: I(L(a)("rounded-sm p-1", t.pickMode ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-accent")),
|
|
180
|
+
onClick: s[0] || (s[0] = (e) => t.pickMode ? o("stop-pick") : o("start-pick"))
|
|
181
|
+
}, [P(L($), { class: "w-3.5 h-3.5" })], 10, Re),
|
|
182
|
+
t.hasPicks ? (j(), k("button", {
|
|
183
|
+
key: 1,
|
|
184
|
+
type: "button",
|
|
185
|
+
title: L(n)("pptx.ai.pickClear"),
|
|
186
|
+
"aria-label": L(n)("pptx.ai.pickClear"),
|
|
187
|
+
class: "rounded-sm p-1 text-muted-foreground hover:bg-accent",
|
|
188
|
+
onClick: s[1] || (s[1] = (e) => o("clear-picks"))
|
|
189
|
+
}, [P(L(he), { class: "w-3.5 h-3.5" })], 8, He)) : (j(), k("button", {
|
|
190
|
+
key: 2,
|
|
191
|
+
type: "button",
|
|
192
|
+
title: t.isPinned ? L(n)("pptx.ai.clearFocus") : L(n)("pptx.ai.pinFocus"),
|
|
193
|
+
"aria-label": t.isPinned ? L(n)("pptx.ai.clearFocus") : L(n)("pptx.ai.pinFocus"),
|
|
194
|
+
class: "rounded-sm p-1 text-muted-foreground hover:bg-accent",
|
|
195
|
+
onClick: s[2] || (s[2] = (e) => t.isPinned ? o("clear-pin") : o("pin"))
|
|
196
|
+
}, [t.isPinned ? (j(), h(L(le), {
|
|
197
|
+
key: 0,
|
|
198
|
+
class: "w-3.5 h-3.5"
|
|
199
|
+
})) : (j(), h(L(re), {
|
|
200
|
+
key: 1,
|
|
201
|
+
class: "w-3.5 h-3.5"
|
|
202
|
+
}))], 8, We))
|
|
203
|
+
])
|
|
204
|
+
]), t.pickMode ? (j(), k("div", ze, [
|
|
205
|
+
P(L($), { class: "w-3.5 h-3.5 shrink-0 animate-pulse text-primary" }),
|
|
206
|
+
w("span", Ve, N(L(n)("pptx.ai.pickElementHint")), 1),
|
|
207
|
+
w("button", {
|
|
208
|
+
type: "button",
|
|
209
|
+
class: "ml-auto rounded-sm bg-primary px-2 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary/90",
|
|
210
|
+
onClick: s[3] || (s[3] = (e) => o("stop-pick"))
|
|
211
|
+
}, N(L(n)("pptx.ai.pickDone")), 1)
|
|
212
|
+
])) : y("", !0)]));
|
|
213
|
+
}
|
|
214
|
+
}), Oe = { class: "flex items-center justify-between border-b border-border px-2.5 py-1.5" }, Ue = { class: "text-[11px] font-semibold uppercase tracking-wide text-muted-foreground" }, $e = {
|
|
215
|
+
key: 0,
|
|
216
|
+
class: "px-3 py-4 text-center text-[12px] text-muted-foreground"
|
|
217
|
+
}, qe = {
|
|
218
|
+
key: 1,
|
|
219
|
+
class: "max-h-64 overflow-y-auto py-1"
|
|
220
|
+
}, Ge = ["onClick"], Je = { class: "min-w-0 flex-1" }, Qe = { class: "block truncate text-[12px] font-medium text-foreground" }, Xe = { class: "block text-[10px] text-muted-foreground" }, Ye = [
|
|
221
|
+
"title",
|
|
222
|
+
"aria-label",
|
|
223
|
+
"onClick"
|
|
224
|
+
], Ze = { class: "border-t border-border px-2.5 py-1.5 text-[10px] text-muted-foreground" }, et = S({
|
|
225
|
+
__name: "AiHistoryMenu",
|
|
226
|
+
props: {
|
|
227
|
+
chats: {},
|
|
228
|
+
activeChatId: {}
|
|
229
|
+
},
|
|
230
|
+
emits: [
|
|
231
|
+
"resume",
|
|
232
|
+
"delete",
|
|
233
|
+
"new-chat",
|
|
234
|
+
"close"
|
|
235
|
+
],
|
|
236
|
+
setup(t, { emit: a }) {
|
|
237
|
+
const s = t, r = a, { t: l } = e(), o = M(null);
|
|
238
|
+
function n(e) {
|
|
239
|
+
o.value && !o.value.contains(e.target) && r("close");
|
|
240
|
+
}
|
|
241
|
+
return E(() => document.addEventListener("mousedown", n)), A(() => document.removeEventListener("mousedown", n)), (e, t) => (j(), k("div", {
|
|
242
|
+
ref_key: "root",
|
|
243
|
+
ref: o,
|
|
244
|
+
class: "absolute right-2 top-10 z-40 w-64 rounded-md border border-border bg-popover shadow-xl"
|
|
245
|
+
}, [
|
|
246
|
+
w("div", Oe, [w("span", Ue, N(L(l)("pptx.ai.historyTitle")), 1), w("button", {
|
|
247
|
+
type: "button",
|
|
248
|
+
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",
|
|
249
|
+
onClick: t[0] || (t[0] = (e) => {
|
|
250
|
+
r("new-chat"), r("close");
|
|
251
|
+
})
|
|
252
|
+
}, [P(L(oe), { class: "w-3 h-3" }), C(" " + N(L(l)("pptx.ai.newChat")), 1)])]),
|
|
253
|
+
0 === s.chats.length ? (j(), k("p", $e, N(L(l)("pptx.ai.historyEmpty")), 1)) : (j(), k("ul", qe, [(j(!0), k(f, null, F(s.chats, (e) => (j(), k("li", {
|
|
254
|
+
key: e.id,
|
|
255
|
+
class: "group flex items-center gap-1 px-1"
|
|
256
|
+
}, [w("button", {
|
|
257
|
+
type: "button",
|
|
258
|
+
class: I(["flex min-w-0 flex-1 items-start gap-2 rounded-sm px-2 py-1.5 text-left hover:bg-accent", e.id === s.activeChatId ? "bg-accent/60" : ""]),
|
|
259
|
+
onClick: (t) => {
|
|
260
|
+
r("resume", e.id), r("close");
|
|
261
|
+
}
|
|
262
|
+
}, [P(L(Z), { class: "mt-0.5 w-3.5 h-3.5 shrink-0 text-muted-foreground" }), w("span", Je, [w("span", Qe, N(e.title || L(l)("pptx.ai.untitledChat")), 1), w("span", Xe, N(L(l)("pptx.ai.messageCount", { count: e.messageCount })), 1)])], 10, Ge), w("button", {
|
|
263
|
+
type: "button",
|
|
264
|
+
title: L(l)("pptx.ai.deleteChat"),
|
|
265
|
+
"aria-label": L(l)("pptx.ai.deleteChat"),
|
|
266
|
+
class: "shrink-0 rounded-sm p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",
|
|
267
|
+
onClick: (t) => r("delete", e.id)
|
|
268
|
+
}, [P(L(xe), { class: "w-3.5 h-3.5" })], 8, Ye)]))), 128))])),
|
|
269
|
+
w("p", Ze, N(L(l)("pptx.ai.historyHint")), 1)
|
|
270
|
+
], 512));
|
|
271
|
+
}
|
|
272
|
+
}), tt = { class: "text-[12px]" }, at = { class: "flex items-center gap-1.5" }, st = {
|
|
273
|
+
key: 0,
|
|
274
|
+
class: "mt-1 pl-5 text-[11px] text-destructive"
|
|
275
|
+
}, rt = {
|
|
276
|
+
key: 1,
|
|
277
|
+
class: "group mt-0.5 pl-5"
|
|
278
|
+
}, lt = { class: "cursor-pointer list-none text-[10px] text-muted-foreground/70 hover:text-muted-foreground" }, ot = { class: "mt-0.5 break-words font-mono text-[10px] text-muted-foreground/80" }, nt = S({
|
|
279
|
+
__name: "AiToolCallCard",
|
|
280
|
+
props: { part: {} },
|
|
281
|
+
setup(s) {
|
|
282
|
+
const r = s, { t: l } = e(), o = {
|
|
283
|
+
view: q,
|
|
284
|
+
text: fe,
|
|
285
|
+
shape: pe,
|
|
286
|
+
theme: se,
|
|
287
|
+
table: me,
|
|
288
|
+
slide: X,
|
|
289
|
+
chart: O,
|
|
290
|
+
move: te,
|
|
291
|
+
delete: xe,
|
|
292
|
+
search: ne,
|
|
293
|
+
nav: ae,
|
|
294
|
+
animation: G,
|
|
295
|
+
notes: ue,
|
|
296
|
+
tool: ve
|
|
297
|
+
}, n = v(() => "output-error" === r.part.state), i = v(() => "output-available" === r.part.state), p = v(() => !n.value && !i.value), d = v(() => c(r.part.toolName, r.part.input, p.value ? "present" : "past")), u = v(() => o[d.value.icon] ?? ve), m = v(() => g(r.part.input)), x = v(() => n.value ? l("pptx.ai.toolFailed") : i.value ? l("pptx.ai.toolDone") : l("pptx.ai.toolRunning"));
|
|
298
|
+
return (e, s) => (j(), k("div", tt, [
|
|
299
|
+
w("div", at, [
|
|
300
|
+
(j(), h(B(u.value), { class: I(L(a)("w-3.5 h-3.5 shrink-0", n.value ? "text-destructive" : "text-muted-foreground")) }, null, 8, ["class"])),
|
|
301
|
+
w("span", { class: I(L(a)("truncate", n.value ? "text-destructive" : "text-foreground")) }, N(d.value.label), 3),
|
|
302
|
+
w("span", { class: I(L(a)("ml-auto inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 text-[10px]", n.value ? "bg-destructive/15 text-destructive" : i.value ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground")) }, [p.value ? (j(), h(L(Y), {
|
|
303
|
+
key: 0,
|
|
304
|
+
class: "w-3 h-3 animate-spin"
|
|
305
|
+
})) : i.value ? (j(), h(L(U), {
|
|
306
|
+
key: 1,
|
|
307
|
+
class: "w-3 h-3"
|
|
308
|
+
})) : (j(), h(L(ge), {
|
|
309
|
+
key: 2,
|
|
310
|
+
class: "w-3 h-3"
|
|
311
|
+
})), C(" " + N(x.value), 1)], 2)
|
|
312
|
+
]),
|
|
313
|
+
n.value && r.part.errorText ? (j(), k("div", st, N(r.part.errorText), 1)) : y("", !0),
|
|
314
|
+
m.value ? (j(), k("details", rt, [w("summary", lt, N(L(l)("pptx.ai.toolDetails")), 1), w("div", ot, N(L(t)(r.part.toolName)) + ": " + N(m.value), 1)])) : y("", !0)
|
|
315
|
+
]));
|
|
316
|
+
}
|
|
317
|
+
}), it = {
|
|
318
|
+
key: 0,
|
|
319
|
+
class: "flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center"
|
|
320
|
+
}, pt = { class: "text-sm font-medium text-foreground" }, dt = { class: "text-[12px] text-muted-foreground" }, ct = {
|
|
321
|
+
key: 1,
|
|
322
|
+
class: "flex-1 space-y-3 overflow-y-auto px-3 py-3"
|
|
323
|
+
}, ut = {
|
|
324
|
+
key: 0,
|
|
325
|
+
class: "flex gap-2"
|
|
326
|
+
}, mt = ["aria-label"], xt = { class: "min-w-0 flex-1 space-y-1.5" }, gt = {
|
|
327
|
+
key: 0,
|
|
328
|
+
class: "whitespace-pre-wrap break-words text-[13px] leading-relaxed text-foreground"
|
|
329
|
+
}, ft = {
|
|
330
|
+
key: 0,
|
|
331
|
+
class: "flex items-center gap-2 pl-8 text-[12px] text-muted-foreground"
|
|
332
|
+
}, bt = S({
|
|
333
|
+
__name: "AiMessageList",
|
|
334
|
+
props: {
|
|
335
|
+
messages: {},
|
|
336
|
+
isStreaming: { type: Boolean }
|
|
337
|
+
},
|
|
338
|
+
setup(t) {
|
|
339
|
+
const s = t, { t: l } = e(), o = M(null);
|
|
340
|
+
return H(() => [s.messages, s.isStreaming], () => {
|
|
341
|
+
T(() => o.value?.scrollIntoView({ block: "end" }));
|
|
342
|
+
}, { deep: !0 }), (e, t) => 0 === s.messages.length ? (j(), k("div", it, [
|
|
343
|
+
P(L(de), { class: "w-7 h-7 text-primary/70" }),
|
|
344
|
+
w("p", pt, N(L(l)("pptx.ai.emptyTitle")), 1),
|
|
345
|
+
w("p", dt, N(L(l)("pptx.ai.emptyHint")), 1)
|
|
346
|
+
])) : (j(), k("div", ct, [
|
|
347
|
+
(j(!0), k(f, null, F(s.messages, (e) => (j(), k(f, { key: e.id }, ["user" === e.role || L(r)(e).length > 0 ? (j(), k("div", ut, [w("div", {
|
|
348
|
+
class: I(L(a)("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")),
|
|
349
|
+
"aria-label": "user" === e.role ? L(l)("pptx.ai.you") : L(l)("pptx.ai.assistant")
|
|
350
|
+
}, ["user" === e.role ? (j(), h(L(be), {
|
|
351
|
+
key: 0,
|
|
352
|
+
class: "w-3.5 h-3.5"
|
|
353
|
+
})) : (j(), h(L(K), {
|
|
354
|
+
key: 1,
|
|
355
|
+
class: "w-3.5 h-3.5"
|
|
356
|
+
}))], 10, mt), w("div", xt, [(j(!0), k(f, null, F(L(r)(e), (e, t) => (j(), k(f, { key: "tool" === e.kind && e.toolCallId || t }, ["text" === e.kind ? (j(), k("p", gt, N(e.text), 1)) : (j(), h(nt, {
|
|
357
|
+
key: 1,
|
|
358
|
+
part: e
|
|
359
|
+
}, null, 8, ["part"]))], 64))), 128))])])) : y("", !0)], 64))), 128)),
|
|
360
|
+
s.isStreaming ? (j(), k("div", ft, [t[0] || (t[0] = w("span", { class: "inline-flex gap-1" }, [
|
|
361
|
+
w("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.2s]" }),
|
|
362
|
+
w("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.1s]" }),
|
|
363
|
+
w("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground" })
|
|
364
|
+
], -1)), C(" " + N(L(l)("pptx.ai.thinking")), 1)])) : y("", !0),
|
|
365
|
+
w("div", {
|
|
366
|
+
ref_key: "endRef",
|
|
367
|
+
ref: o
|
|
368
|
+
}, null, 512)
|
|
369
|
+
]));
|
|
370
|
+
}
|
|
371
|
+
}), vt = { class: "rounded-md border border-primary/40 bg-primary/5 p-2.5" }, ht = { class: "mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-primary" }, yt = { class: "text-[12px] font-medium text-foreground" }, kt = {
|
|
372
|
+
key: 0,
|
|
373
|
+
class: "mt-1 max-h-40 space-y-0.5 overflow-y-auto text-[11px] text-muted-foreground"
|
|
374
|
+
}, wt = { class: "mt-2 flex items-center gap-2" }, Ct = S({
|
|
375
|
+
__name: "AiProposalCard",
|
|
376
|
+
props: { proposal: {} },
|
|
377
|
+
emits: ["accept", "reject"],
|
|
378
|
+
setup(t, { emit: a }) {
|
|
379
|
+
const s = t, r = a, { t: l } = e(), o = v(() => s.proposal.summary.map(i));
|
|
380
|
+
return (e, t) => (j(), k("div", vt, [
|
|
381
|
+
w("div", ht, N(L(l)("pptx.ai.proposedChange")), 1),
|
|
382
|
+
w("div", yt, N(s.proposal.label), 1),
|
|
383
|
+
o.value.length > 0 ? (j(), k("ul", kt, [(j(!0), k(f, null, F(o.value, (e, t) => (j(), k("li", {
|
|
384
|
+
key: t,
|
|
385
|
+
class: "break-words"
|
|
386
|
+
}, N(e), 1))), 128))])) : y("", !0),
|
|
387
|
+
w("div", wt, [w("button", {
|
|
388
|
+
type: "button",
|
|
389
|
+
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",
|
|
390
|
+
onClick: t[0] || (t[0] = (e) => r("accept", s.proposal.id))
|
|
391
|
+
}, [P(L(U), { class: "w-3.5 h-3.5" }), C(" " + N(L(l)("pptx.ai.accept")), 1)]), w("button", {
|
|
392
|
+
type: "button",
|
|
393
|
+
class: "inline-flex items-center gap-1 rounded-sm border border-border px-2 py-1 text-[11px] text-muted-foreground transition-colors hover:bg-accent",
|
|
394
|
+
onClick: t[1] || (t[1] = (e) => r("reject", s.proposal.id))
|
|
395
|
+
}, [P(L(he), { class: "w-3.5 h-3.5" }), C(" " + N(L(l)("pptx.ai.reject")), 1)])])
|
|
396
|
+
]));
|
|
397
|
+
}
|
|
398
|
+
}), Pt = { class: "relative flex min-h-0 flex-1 flex-col" }, St = { class: "flex items-center gap-1 border-b border-border px-2 py-1" }, Tt = { class: "ml-auto flex items-center gap-0.5" }, It = ["title", "aria-label"], _t = [
|
|
399
|
+
"title",
|
|
400
|
+
"aria-label",
|
|
401
|
+
"disabled"
|
|
402
|
+
], At = {
|
|
403
|
+
key: 1,
|
|
404
|
+
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"
|
|
405
|
+
}, Et = { class: "min-w-0 flex-1" }, jt = { class: "font-medium" }, Mt = { class: "max-h-24 overflow-y-auto break-words text-[11px] opacity-80" }, Ft = {
|
|
406
|
+
key: 2,
|
|
407
|
+
class: "max-h-[38%] space-y-2 overflow-y-auto border-t border-border bg-background px-3 py-2"
|
|
408
|
+
}, Bt = { class: "flex items-center justify-between" }, Dt = { class: "text-[11px] font-semibold uppercase tracking-wide text-muted-foreground" }, Nt = S({
|
|
409
|
+
__name: "AiConversation",
|
|
410
|
+
props: {
|
|
411
|
+
session: {},
|
|
412
|
+
config: {},
|
|
413
|
+
bridge: {},
|
|
414
|
+
aiPanel: {}
|
|
415
|
+
},
|
|
416
|
+
async setup(t) {
|
|
417
|
+
let a, s;
|
|
418
|
+
const r = t, { t: l } = e(), { useChat: n } = ([a, s] = W(() => import("@ai-sdk/vue")), a = await a, s(), a), { messages: i, error: p, isStreaming: d, proposals: c, send: m, stop: x, clearError: g, applyProposal: b, rejectProposal: S, acceptAllProposals: T } = Pe(n, r.session, r.config, { onToolTarget: (e) => {
|
|
419
|
+
e && void 0 !== e.slideIndex && r.bridge.goToSlide(e.slideIndex), r.aiPanel.flashToolTarget(e);
|
|
420
|
+
} }), I = function(e) {
|
|
421
|
+
const t = M([]), a = u({
|
|
422
|
+
deckId: e.deckId,
|
|
423
|
+
store: e.store,
|
|
424
|
+
getMessages: () => e.messages.value,
|
|
425
|
+
setMessages: e.setMessages,
|
|
426
|
+
untitledLabel: e.untitledLabel,
|
|
427
|
+
onChatsChanged: (e) => {
|
|
428
|
+
t.value = e;
|
|
429
|
+
}
|
|
430
|
+
}), s = M(a.activeChatId()), r = () => {
|
|
431
|
+
s.value = a.activeChatId();
|
|
432
|
+
};
|
|
433
|
+
return H(e.messages, () => a.notifyMessagesChanged(), { deep: !0 }), A(() => a.dispose()), {
|
|
434
|
+
chats: t,
|
|
435
|
+
activeChatId: s,
|
|
436
|
+
refresh: () => a.refresh(),
|
|
437
|
+
newChat: () => {
|
|
438
|
+
a.newChat(), r();
|
|
439
|
+
},
|
|
440
|
+
resumeChat: async (e) => {
|
|
441
|
+
await a.resumeChat(e), r();
|
|
442
|
+
},
|
|
443
|
+
deleteChat: async (e) => {
|
|
444
|
+
await a.deleteChat(e), r();
|
|
445
|
+
},
|
|
446
|
+
clearCurrent: () => a.clearCurrent()
|
|
447
|
+
};
|
|
448
|
+
}({
|
|
449
|
+
deckId: o(r.bridge),
|
|
450
|
+
messages: i,
|
|
451
|
+
setMessages: (e) => {
|
|
452
|
+
i.value = e;
|
|
453
|
+
},
|
|
454
|
+
untitledLabel: l("pptx.ai.untitledChat")
|
|
455
|
+
}), _ = M(!1), E = r.session.changeAnimator.subscribe((e) => {
|
|
456
|
+
e && r.bridge.goToSlide(e.slideIndex), r.aiPanel.showChangeBatch(e);
|
|
457
|
+
});
|
|
458
|
+
A(() => E());
|
|
459
|
+
const B = v(() => r.aiPanel.pickTargets.value.length > 0), D = v(() => B.value ? r.aiPanel.pickTargets.value : r.aiPanel.pinnedFocus.value ?? r.aiPanel.liveFocusTargets.value), R = v(() => !B.value && null !== r.aiPanel.pinnedFocus.value);
|
|
460
|
+
function z(e) {
|
|
461
|
+
r.aiPanel.flashToolTarget(null), b(e);
|
|
462
|
+
}
|
|
463
|
+
function V() {
|
|
464
|
+
r.aiPanel.flashToolTarget(null), T();
|
|
465
|
+
}
|
|
466
|
+
return (e, t) => (j(), k("div", Pt, [
|
|
467
|
+
w("div", St, [w("button", {
|
|
468
|
+
type: "button",
|
|
469
|
+
class: "inline-flex items-center gap-1 rounded-sm px-1.5 py-1 text-[12px] text-muted-foreground hover:bg-accent",
|
|
470
|
+
onClick: t[0] || (t[0] = (e) => _.value = !_.value)
|
|
471
|
+
}, [P(L(Q), { class: "w-3.5 h-3.5" }), C(" " + N(L(l)("pptx.ai.chats")), 1)]), w("div", Tt, [w("button", {
|
|
472
|
+
type: "button",
|
|
473
|
+
title: L(l)("pptx.ai.newChat"),
|
|
474
|
+
"aria-label": L(l)("pptx.ai.newChat"),
|
|
475
|
+
class: "rounded-sm p-1 text-muted-foreground hover:bg-accent",
|
|
476
|
+
onClick: t[1] || (t[1] = (e) => L(I).newChat())
|
|
477
|
+
}, [P(L(ee), { class: "w-3.5 h-3.5" })], 8, It), w("button", {
|
|
478
|
+
type: "button",
|
|
479
|
+
title: L(l)("pptx.ai.clearChat"),
|
|
480
|
+
"aria-label": L(l)("pptx.ai.clearChat"),
|
|
481
|
+
disabled: 0 === L(i).length,
|
|
482
|
+
class: "rounded-sm p-1 text-muted-foreground hover:bg-accent disabled:opacity-40",
|
|
483
|
+
onClick: t[2] || (t[2] = (e) => L(I).clearCurrent())
|
|
484
|
+
}, [P(L(xe), { class: "w-3.5 h-3.5" })], 8, _t)])]),
|
|
485
|
+
_.value ? (j(), h(et, {
|
|
486
|
+
key: 0,
|
|
487
|
+
chats: L(I).chats.value,
|
|
488
|
+
"active-chat-id": L(I).activeChatId.value,
|
|
489
|
+
onResume: t[3] || (t[3] = (e) => {
|
|
490
|
+
L(I).resumeChat(e);
|
|
491
|
+
}),
|
|
492
|
+
onDelete: t[4] || (t[4] = (e) => {
|
|
493
|
+
L(I).deleteChat(e);
|
|
494
|
+
}),
|
|
495
|
+
onNewChat: t[5] || (t[5] = (e) => L(I).newChat()),
|
|
496
|
+
onClose: t[6] || (t[6] = (e) => _.value = !1)
|
|
497
|
+
}, null, 8, ["chats", "active-chat-id"])) : y("", !0),
|
|
498
|
+
P(Ke, {
|
|
499
|
+
targets: D.value,
|
|
500
|
+
slides: r.bridge.getSlides(),
|
|
501
|
+
"is-pinned": R.value,
|
|
502
|
+
"pick-mode": r.aiPanel.pickMode.value,
|
|
503
|
+
"has-picks": B.value,
|
|
504
|
+
onPin: r.aiPanel.pinFocus,
|
|
505
|
+
onClearPin: r.aiPanel.clearPinnedFocus,
|
|
506
|
+
onStartPick: r.aiPanel.startPicking,
|
|
507
|
+
onStopPick: r.aiPanel.stopPicking,
|
|
508
|
+
onClearPicks: r.aiPanel.clearPicks,
|
|
509
|
+
onSendDirective: L(m)
|
|
510
|
+
}, null, 8, [
|
|
511
|
+
"targets",
|
|
512
|
+
"slides",
|
|
513
|
+
"is-pinned",
|
|
514
|
+
"pick-mode",
|
|
515
|
+
"has-picks",
|
|
516
|
+
"onPin",
|
|
517
|
+
"onClearPin",
|
|
518
|
+
"onStartPick",
|
|
519
|
+
"onStopPick",
|
|
520
|
+
"onClearPicks",
|
|
521
|
+
"onSendDirective"
|
|
522
|
+
]),
|
|
523
|
+
P(bt, {
|
|
524
|
+
messages: L(i),
|
|
525
|
+
"is-streaming": L(d)
|
|
526
|
+
}, null, 8, ["messages", "is-streaming"]),
|
|
527
|
+
L(p) ? (j(), k("div", At, [
|
|
528
|
+
P(L(ge), { class: "mt-0.5 w-3.5 h-3.5 shrink-0" }),
|
|
529
|
+
w("div", Et, [w("div", jt, N(L(l)("pptx.ai.errorPrefix")), 1), w("div", Mt, N(L(p).message), 1)]),
|
|
530
|
+
w("button", {
|
|
531
|
+
type: "button",
|
|
532
|
+
class: "shrink-0 rounded-sm px-1.5 py-0.5 text-[11px] underline-offset-2 hover:underline",
|
|
533
|
+
onClick: t[7] || (t[7] = (...e) => L(g) && L(g)(...e))
|
|
534
|
+
}, N(L(l)("pptx.ai.retry")), 1)
|
|
535
|
+
])) : y("", !0),
|
|
536
|
+
L(c).length > 0 ? (j(), k("div", Ft, [w("div", Bt, [w("span", Dt, N(L(l)("pptx.ai.pendingChanges", { count: L(c).length })), 1), L(c).length > 1 ? (j(), k("button", {
|
|
537
|
+
key: 0,
|
|
538
|
+
type: "button",
|
|
539
|
+
class: "rounded-sm bg-primary/90 px-2 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary",
|
|
540
|
+
onClick: V
|
|
541
|
+
}, N(L(l)("pptx.ai.acceptAll")), 1)) : y("", !0)]), (j(!0), k(f, null, F(L(c), (e) => (j(), h(Ct, {
|
|
542
|
+
key: e.id,
|
|
543
|
+
proposal: e,
|
|
544
|
+
onAccept: z,
|
|
545
|
+
onReject: L(S)
|
|
546
|
+
}, null, 8, ["proposal", "onReject"]))), 128))])) : y("", !0),
|
|
547
|
+
P(Ee, {
|
|
548
|
+
"is-streaming": L(d),
|
|
549
|
+
"prefill-text": r.aiPanel.prefill.value.text,
|
|
550
|
+
"prefill-nonce": r.aiPanel.prefill.value.nonce,
|
|
551
|
+
onSend: L(m),
|
|
552
|
+
onStop: L(x)
|
|
553
|
+
}, null, 8, [
|
|
554
|
+
"is-streaming",
|
|
555
|
+
"prefill-text",
|
|
556
|
+
"prefill-nonce",
|
|
557
|
+
"onSend",
|
|
558
|
+
"onStop"
|
|
559
|
+
])
|
|
560
|
+
]));
|
|
561
|
+
}
|
|
562
|
+
}), Lt = { class: "flex items-center gap-2 border-b border-border px-3 py-2" }, Rt = { class: "text-sm font-semibold text-foreground" }, Ht = ["title", "aria-label"], Wt = {
|
|
563
|
+
key: 0,
|
|
564
|
+
class: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground"
|
|
565
|
+
}, zt = {
|
|
566
|
+
key: 1,
|
|
567
|
+
class: "flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center"
|
|
568
|
+
}, Vt = { class: "text-sm font-medium text-foreground" }, Kt = { class: "text-[12px] text-muted-foreground" }, Ot = { class: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground" }, Ut = S({
|
|
569
|
+
__name: "AiChatPanel",
|
|
570
|
+
props: {
|
|
571
|
+
bridge: {},
|
|
572
|
+
config: {},
|
|
573
|
+
panelWidth: {},
|
|
574
|
+
aiPanel: {}
|
|
575
|
+
},
|
|
576
|
+
emits: ["close"],
|
|
577
|
+
setup(t, { emit: a }) {
|
|
578
|
+
const s = t, r = a, { t: o } = e(), { state: i, session: p, initError: c } = function(e, t) {
|
|
579
|
+
const a = M("checking"), s = D(null), r = D(void 0);
|
|
580
|
+
let o = 0;
|
|
581
|
+
return (async () => {
|
|
582
|
+
const i = ++o;
|
|
583
|
+
a.value = "checking", s.value = null, r.value = void 0;
|
|
584
|
+
try {
|
|
585
|
+
const r = await n();
|
|
586
|
+
if (i !== o) return;
|
|
587
|
+
if (!r) return void (a.value = "unavailable");
|
|
588
|
+
const p = await l(e, t);
|
|
589
|
+
if (i !== o) return;
|
|
590
|
+
s.value = p, a.value = "ready";
|
|
591
|
+
} catch (e) {
|
|
592
|
+
if (i !== o) return;
|
|
593
|
+
r.value = e instanceof Error ? e : new Error(String(e)), a.value = "error";
|
|
594
|
+
}
|
|
595
|
+
})(), {
|
|
596
|
+
state: a,
|
|
597
|
+
session: s,
|
|
598
|
+
initError: r
|
|
599
|
+
};
|
|
600
|
+
}(s.bridge, s.config), u = v(() => s.panelWidth ? { width: `${s.panelWidth}px` } : void 0), m = d({
|
|
601
|
+
activeSlideIndex: M(0),
|
|
602
|
+
selectedElementIds: M([]),
|
|
603
|
+
selectedElement: () => null
|
|
604
|
+
}), x = v(() => s.aiPanel ?? m);
|
|
605
|
+
return (e, t) => (j(), k("div", {
|
|
606
|
+
"data-pptx-ai-panel": "",
|
|
607
|
+
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",
|
|
608
|
+
style: _(u.value)
|
|
609
|
+
}, [w("div", Lt, [
|
|
610
|
+
P(L(de), { class: "w-4 h-4 text-primary" }),
|
|
611
|
+
w("span", Rt, N(L(o)("pptx.ai.title")), 1),
|
|
612
|
+
w("button", {
|
|
613
|
+
type: "button",
|
|
614
|
+
title: L(o)("pptx.ai.close"),
|
|
615
|
+
"aria-label": L(o)("pptx.ai.close"),
|
|
616
|
+
class: "ml-auto rounded-sm p-1 text-muted-foreground transition-colors hover:bg-accent",
|
|
617
|
+
onClick: t[0] || (t[0] = (e) => r("close"))
|
|
618
|
+
}, [P(L(he), { class: "w-4 h-4" })], 8, Ht)
|
|
619
|
+
]), "checking" === L(i) ? (j(), k("div", Wt, [P(L(Y), { class: "w-5 h-5 animate-spin" })])) : "unavailable" === L(i) || "error" === L(i) ? (j(), k("div", zt, [
|
|
620
|
+
P(L(ge), { class: "w-6 h-6 text-muted-foreground" }),
|
|
621
|
+
w("p", Vt, N(L(o)("pptx.ai.unavailableTitle")), 1),
|
|
622
|
+
w("p", Kt, N(L(c)?.message ?? L(o)("pptx.ai.unavailableHint")), 1)
|
|
623
|
+
])) : "ready" === L(i) && L(p) ? (j(), h(b, { key: 2 }, {
|
|
624
|
+
fallback: z(() => [w("div", Ot, [P(L(Y), { class: "w-5 h-5 animate-spin" })])]),
|
|
625
|
+
default: z(() => [P(Nt, {
|
|
626
|
+
session: L(p),
|
|
627
|
+
config: s.config,
|
|
628
|
+
bridge: s.bridge,
|
|
629
|
+
"ai-panel": x.value
|
|
630
|
+
}, null, 8, [
|
|
631
|
+
"session",
|
|
632
|
+
"config",
|
|
633
|
+
"bridge",
|
|
634
|
+
"ai-panel"
|
|
635
|
+
])]),
|
|
636
|
+
_: 1
|
|
637
|
+
})) : y("", !0)], 4));
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
export { Ut as default };
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1057,6 +1057,7 @@ var t = {
|
|
|
1057
1057
|
"pptx.effects.blur": "Blur",
|
|
1058
1058
|
"pptx.effects.distance": "Distance",
|
|
1059
1059
|
"pptx.effects.angle": "Angle",
|
|
1060
|
+
"pptx.effects.rotateWithShape": "Rotate with Shape",
|
|
1060
1061
|
"pptx.effects.outerGlow": "Outer Glow",
|
|
1061
1062
|
"pptx.effects.radius": "Radius",
|
|
1062
1063
|
"pptx.effects.shapeOnlyNote": "Shadow and glow are only available on shape-like elements.",
|
|
Binary file
|
|
Binary file
|