pptx-vue-viewer 2.13.2 → 2.14.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 +2 -0
- package/dist/AiChatPanel-B8QSMoWW.cjs +637 -0
- package/dist/AiChatPanel-B8QSMoWW.cjs.br +0 -0
- package/dist/AiChatPanel-B8QSMoWW.cjs.gz +0 -0
- package/dist/AiChatPanel-C9tDF9w2.js +640 -0
- package/dist/AiChatPanel-C9tDF9w2.js.br +0 -0
- package/dist/AiChatPanel-C9tDF9w2.js.gz +0 -0
- package/dist/{dist-CrzKtRxp.js → dist-BRLnKo1Y.js} +9103 -7402
- package/dist/dist-BRLnKo1Y.js.br +0 -0
- package/dist/dist-BRLnKo1Y.js.gz +0 -0
- package/dist/{dist-CNLUj2f9.cjs → dist-DXA9RFq7.cjs} +9033 -7297
- package/dist/dist-DXA9RFq7.cjs.br +0 -0
- package/dist/dist-DXA9RFq7.cjs.gz +0 -0
- package/dist/gif-encoder-DQpum4Kn.js +2 -0
- package/dist/gif-encoder-DQpum4Kn.js.br +0 -0
- package/dist/gif-encoder-DQpum4Kn.js.gz +0 -0
- package/dist/gif-encoder-FBevv6TW.cjs +2 -0
- package/dist/gif-encoder-FBevv6TW.cjs.br +0 -0
- package/dist/gif-encoder-FBevv6TW.cjs.gz +0 -0
- package/dist/{i18n-CX6HlMNo.cjs → i18n-Bm1FdvTe.cjs} +73 -2
- package/dist/i18n-Bm1FdvTe.cjs.br +0 -0
- package/dist/i18n-Bm1FdvTe.cjs.gz +0 -0
- package/dist/{i18n-BPiHp_k5.js → i18n-vGMsvpN1.js} +73 -2
- package/dist/i18n-vGMsvpN1.js.br +0 -0
- package/dist/i18n-vGMsvpN1.js.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.d.ts +1 -0
- package/dist/internals.d.ts.map +1 -1
- 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 +1 -1
- package/dist/pptx-vue-viewer.css.br +0 -0
- package/dist/pptx-vue-viewer.css.gz +0 -0
- package/dist/{useViewerSettingsDialog-BSsouEGv.cjs → useViewerSettingsDialog-CMHLo-CP.cjs} +10922 -6219
- package/dist/useViewerSettingsDialog-CMHLo-CP.cjs.br +0 -0
- package/dist/useViewerSettingsDialog-CMHLo-CP.cjs.gz +0 -0
- package/dist/useViewerSettingsDialog-CfaQyiWy.js +33412 -0
- package/dist/useViewerSettingsDialog-CfaQyiWy.js.br +0 -0
- package/dist/useViewerSettingsDialog-CfaQyiWy.js.gz +0 -0
- package/dist/viewer/PowerPointViewer.vue.d.ts.map +1 -1
- package/dist/viewer/components/AccessibilityPanel.vue.d.ts.map +1 -1
- package/dist/viewer/components/ChartRenderer.vue.d.ts +2 -0
- package/dist/viewer/components/ChartRenderer.vue.d.ts.map +1 -1
- package/dist/viewer/components/CommentMarkersOverlay.vue.d.ts +4 -3
- package/dist/viewer/components/CommentMarkersOverlay.vue.d.ts.map +1 -1
- package/dist/viewer/components/ElementImageBox.vue.d.ts +2 -0
- package/dist/viewer/components/ElementImageBox.vue.d.ts.map +1 -1
- package/dist/viewer/components/ElementMediaBox.vue.d.ts +2 -0
- package/dist/viewer/components/ElementMediaBox.vue.d.ts.map +1 -1
- package/dist/viewer/components/ElementRenderer.vue.d.ts +8 -0
- package/dist/viewer/components/ElementRenderer.vue.d.ts.map +1 -1
- package/dist/viewer/components/InlineTextEditor.vue.d.ts.map +1 -1
- package/dist/viewer/components/MobileMenuSheet.vue.d.ts.map +1 -1
- package/dist/viewer/components/PresentationAnnotationOverlay.vue.d.ts +10 -1
- package/dist/viewer/components/PresentationAnnotationOverlay.vue.d.ts.map +1 -1
- package/dist/viewer/components/PresentationAudienceOverlays.vue.d.ts.map +1 -1
- package/dist/viewer/components/PresentationMode.vue.d.ts.map +1 -1
- package/dist/viewer/components/PresentationToolbar.vue.d.ts +6 -0
- package/dist/viewer/components/PresentationToolbar.vue.d.ts.map +1 -1
- package/dist/viewer/components/SelectionOverlay.vue.d.ts +9 -20
- package/dist/viewer/components/SelectionOverlay.vue.d.ts.map +1 -1
- package/dist/viewer/components/SelectionPane.vue.d.ts +13 -4
- package/dist/viewer/components/SelectionPane.vue.d.ts.map +1 -1
- package/dist/viewer/components/ShapeEffectOverlay.vue.d.ts.map +1 -1
- package/dist/viewer/components/SlideStage.vue.d.ts.map +1 -1
- package/dist/viewer/components/SlideTemplateGalleryDialog.vue.d.ts +27 -0
- package/dist/viewer/components/SlideTemplateGalleryDialog.vue.d.ts.map +1 -0
- package/dist/viewer/components/SlideTemplatePreview.vue.d.ts +20 -0
- package/dist/viewer/components/SlideTemplatePreview.vue.d.ts.map +1 -0
- package/dist/viewer/components/SmartArtRenderer.vue.d.ts +2 -0
- package/dist/viewer/components/SmartArtRenderer.vue.d.ts.map +1 -1
- package/dist/viewer/components/TableRenderer.vue.d.ts +2 -0
- package/dist/viewer/components/TableRenderer.vue.d.ts.map +1 -1
- package/dist/viewer/components/ViewerSidePanels.vue.d.ts.map +1 -1
- package/dist/viewer/components/ZoomRenderer.vue.d.ts.map +1 -1
- package/dist/viewer/components/ai/AiConversation.vue.d.ts.map +1 -1
- package/dist/viewer/components/ai/AiHistoryMenu.vue.d.ts +19 -0
- package/dist/viewer/components/ai/AiHistoryMenu.vue.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/HomeSection.vue.d.ts +4 -0
- package/dist/viewer/components/ribbon/HomeSection.vue.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/InsertSection.vue.d.ts +2 -2
- package/dist/viewer/components/ribbon/InsertSection.vue.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/RibbonToolbar.vue.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/SlidesGroup.vue.d.ts +4 -0
- package/dist/viewer/components/ribbon/SlidesGroup.vue.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/file-section-actions.d.ts +2 -1
- package/dist/viewer/components/ribbon/file-section-actions.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/file-section-types.d.ts +2 -0
- package/dist/viewer/components/ribbon/file-section-types.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/ribbon-props-fixture.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/ribbon-types.d.ts +9 -3
- package/dist/viewer/components/ribbon/ribbon-types.d.ts.map +1 -1
- package/dist/viewer/components/selection-overlay-geometry.d.ts +73 -0
- package/dist/viewer/components/selection-overlay-geometry.d.ts.map +1 -0
- package/dist/viewer/composables/ai/useAiChatHistory.d.ts +24 -0
- package/dist/viewer/composables/ai/useAiChatHistory.d.ts.map +1 -0
- package/dist/viewer/composables/collaboration-presence-view.d.ts +19 -3
- package/dist/viewer/composables/collaboration-presence-view.d.ts.map +1 -1
- package/dist/viewer/composables/deck-data.d.ts +7 -0
- package/dist/viewer/composables/deck-data.d.ts.map +1 -0
- package/dist/viewer/composables/element-style.d.ts.map +1 -1
- package/dist/viewer/composables/ribbon-props-actions.d.ts +3 -1
- package/dist/viewer/composables/ribbon-props-actions.d.ts.map +1 -1
- package/dist/viewer/composables/ribbon-props-state.d.ts +1 -0
- package/dist/viewer/composables/ribbon-props-state.d.ts.map +1 -1
- package/dist/viewer/composables/ribbon-props-types.d.ts +8 -4
- package/dist/viewer/composables/ribbon-props-types.d.ts.map +1 -1
- package/dist/viewer/composables/selection-gesture.d.ts +38 -0
- package/dist/viewer/composables/selection-gesture.d.ts.map +1 -0
- package/dist/viewer/composables/useCollaboration.d.ts.map +1 -1
- package/dist/viewer/composables/useCommandDispatch.d.ts +3 -2
- package/dist/viewer/composables/useCommandDispatch.d.ts.map +1 -1
- package/dist/viewer/composables/useElementInsertion.d.ts +3 -2
- package/dist/viewer/composables/useElementInsertion.d.ts.map +1 -1
- package/dist/viewer/composables/useExportWiring.d.ts +4 -1
- package/dist/viewer/composables/useExportWiring.d.ts.map +1 -1
- package/dist/viewer/composables/useSelectionPaneWiring.d.ts +6 -2
- package/dist/viewer/composables/useSelectionPaneWiring.d.ts.map +1 -1
- package/dist/viewer/composables/useSlideTemplateInsertion.d.ts +30 -0
- package/dist/viewer/composables/useSlideTemplateInsertion.d.ts.map +1 -0
- package/dist/viewer/composables/useViewerRibbonProps.d.ts +5 -1
- package/dist/viewer/composables/useViewerRibbonProps.d.ts.map +1 -1
- package/dist/viewer/composables/useViewerStore.d.ts +5 -0
- package/dist/viewer/composables/useViewerStore.d.ts.map +1 -0
- package/dist/viewer/composables/useViewerZoom.d.ts +3 -0
- package/dist/viewer/composables/useViewerZoom.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-CKGNkLtj.cjs → viewer-4-O3wMK_.cjs} +5925 -5522
- package/dist/viewer-4-O3wMK_.cjs.br +0 -0
- package/dist/viewer-4-O3wMK_.cjs.gz +0 -0
- package/dist/{viewer-BVGVczOF.js → viewer-smczRer1.js} +10499 -10105
- package/dist/viewer-smczRer1.js.br +0 -0
- package/dist/viewer-smczRer1.js.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-CtoBtOtB.cjs +0 -509
- package/dist/AiChatPanel-CtoBtOtB.cjs.br +0 -0
- package/dist/AiChatPanel-CtoBtOtB.cjs.gz +0 -0
- package/dist/AiChatPanel-xSeCJVHJ.js +0 -512
- package/dist/AiChatPanel-xSeCJVHJ.js.br +0 -0
- package/dist/AiChatPanel-xSeCJVHJ.js.gz +0 -0
- package/dist/dist-CNLUj2f9.cjs.br +0 -0
- package/dist/dist-CNLUj2f9.cjs.gz +0 -0
- package/dist/dist-CrzKtRxp.js.br +0 -0
- package/dist/dist-CrzKtRxp.js.gz +0 -0
- package/dist/gif-encoder-N24YqPHj.js +0 -2
- package/dist/gif-encoder-N24YqPHj.js.br +0 -0
- package/dist/gif-encoder-N24YqPHj.js.gz +0 -0
- package/dist/gif-encoder-xPQiQFxW.cjs +0 -2
- package/dist/gif-encoder-xPQiQFxW.cjs.br +0 -0
- package/dist/gif-encoder-xPQiQFxW.cjs.gz +0 -0
- package/dist/i18n-BPiHp_k5.js.br +0 -0
- package/dist/i18n-BPiHp_k5.js.gz +0 -0
- package/dist/i18n-CX6HlMNo.cjs.br +0 -0
- package/dist/i18n-CX6HlMNo.cjs.gz +0 -0
- package/dist/useViewerSettingsDialog-BSsouEGv.cjs.br +0 -0
- package/dist/useViewerSettingsDialog-BSsouEGv.cjs.gz +0 -0
- package/dist/useViewerSettingsDialog-CiRnHsjC.js +0 -28789
- package/dist/useViewerSettingsDialog-CiRnHsjC.js.br +0 -0
- package/dist/useViewerSettingsDialog-CiRnHsjC.js.gz +0 -0
- package/dist/viewer-BVGVczOF.js.br +0 -0
- package/dist/viewer-BVGVczOF.js.gz +0 -0
- package/dist/viewer-CKGNkLtj.cjs.br +0 -0
- package/dist/viewer-CKGNkLtj.cjs.gz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,8 @@ All notable changes to this project are documented here.
|
|
|
4
4
|
This file is generated from [Conventional Commits](https://www.conventionalcommits.org)
|
|
5
5
|
by [git-cliff](https://git-cliff.org); do not edit it by hand.
|
|
6
6
|
|
|
7
|
+
## [2.13.2](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vue-viewer@2.13.2) - 2026-08-05
|
|
8
|
+
|
|
7
9
|
## [2.13.1](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vue-viewer@2.13.1) - 2026-08-05
|
|
8
10
|
|
|
9
11
|
### Dependencies
|
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
const e = require("./useViewerSettingsDialog-CMHLo-CP.cjs"), t = require("./viewer-4-O3wMK_.cjs");
|
|
2
|
+
let r = require("vue"), a = require("lucide-vue-next"), o = require("ai");
|
|
3
|
+
var n = /* @__PURE__ */ new Set([
|
|
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: o } = e, n = p.addToolOutput;
|
|
17
|
+
try {
|
|
18
|
+
n({
|
|
19
|
+
tool: t,
|
|
20
|
+
toolCallId: r,
|
|
21
|
+
output: await a.executeToolCall(t, o)
|
|
22
|
+
});
|
|
23
|
+
} catch (e) {
|
|
24
|
+
n({
|
|
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, o.isToolUIPart)(e) && !(0, o.isDynamicToolUIPart)(e)) continue;
|
|
39
|
+
const r = e, a = r.toolCallId ?? "";
|
|
40
|
+
0 !== a.length && void 0 !== r.input && n.has(r.state ?? "") && t.push({
|
|
41
|
+
toolName: (0, o.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 = [
|
|
75
|
+
"disabled",
|
|
76
|
+
"title",
|
|
77
|
+
"aria-label"
|
|
78
|
+
], u = (0, r.defineComponent)({
|
|
79
|
+
__name: "AiComposer",
|
|
80
|
+
props: {
|
|
81
|
+
isStreaming: { type: Boolean },
|
|
82
|
+
prefillText: {},
|
|
83
|
+
prefillNonce: {}
|
|
84
|
+
},
|
|
85
|
+
emits: ["send", "stop"],
|
|
86
|
+
setup(o, { emit: n }) {
|
|
87
|
+
const l = o, u = n, { t: m } = e.useI18n(), f = (0, r.ref)(""), x = (0, r.ref)(null), g = (0, r.computed)(() => f.value.trim().length > 0);
|
|
88
|
+
function k() {
|
|
89
|
+
const e = f.value.trim();
|
|
90
|
+
0 === e.length || l.isStreaming || (u("send", e), f.value = "");
|
|
91
|
+
}
|
|
92
|
+
function y(e) {
|
|
93
|
+
"Enter" !== e.key || e.shiftKey || (e.preventDefault(), k());
|
|
94
|
+
}
|
|
95
|
+
return (0, r.watch)(() => l.prefillNonce, (e) => {
|
|
96
|
+
void 0 !== e && 0 !== e && (l.prefillText && (f.value = l.prefillText), (0, r.nextTick)(() => x.value?.focus()));
|
|
97
|
+
}), (e, o) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", s, [(0, r.createElementVNode)("div", i, [(0, r.withDirectives)((0, r.createElementVNode)("textarea", {
|
|
98
|
+
ref_key: "textareaRef",
|
|
99
|
+
ref: x,
|
|
100
|
+
"onUpdate:modelValue": o[0] || (o[0] = (e) => f.value = e),
|
|
101
|
+
rows: 1,
|
|
102
|
+
placeholder: (0, r.unref)(m)("pptx.ai.placeholder"),
|
|
103
|
+
"aria-label": (0, r.unref)(m)("pptx.ai.placeholder"),
|
|
104
|
+
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
|
+
onKeydown: y
|
|
106
|
+
}, null, 40, c), [[r.vModelText, f.value]]), l.isStreaming ? ((0, r.openBlock)(), (0, r.createElementBlock)("button", {
|
|
107
|
+
key: 0,
|
|
108
|
+
type: "button",
|
|
109
|
+
title: (0, r.unref)(m)("pptx.ai.stop"),
|
|
110
|
+
"aria-label": (0, r.unref)(m)("pptx.ai.stop"),
|
|
111
|
+
class: "shrink-0 rounded-sm p-1.5 text-muted-foreground transition-colors hover:bg-accent",
|
|
112
|
+
onClick: o[1] || (o[1] = (e) => u("stop"))
|
|
113
|
+
}, [(0, r.createVNode)((0, r.unref)(a.Square), { class: "w-4 h-4" })], 8, p)) : ((0, r.openBlock)(), (0, r.createElementBlock)("button", {
|
|
114
|
+
key: 1,
|
|
115
|
+
type: "button",
|
|
116
|
+
disabled: !g.value,
|
|
117
|
+
title: (0, r.unref)(m)("pptx.ai.send"),
|
|
118
|
+
"aria-label": (0, r.unref)(m)("pptx.ai.send"),
|
|
119
|
+
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
|
+
onClick: k
|
|
121
|
+
}, [(0, r.createVNode)((0, r.unref)(a.Send), { class: "w-4 h-4" })], 10, d))])]));
|
|
122
|
+
}
|
|
123
|
+
}), m = { class: "border-b border-border bg-secondary/30" }, f = { class: "flex flex-wrap items-center gap-1 px-2.5 py-1.5" }, x = { class: "text-[10px] font-semibold uppercase tracking-wide text-muted-foreground" }, g = ["title"], k = { class: "truncate" }, y = {
|
|
124
|
+
key: 0,
|
|
125
|
+
class: "rounded-full bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium text-primary"
|
|
126
|
+
}, b = { class: "ml-auto flex items-center gap-0.5" }, h = [
|
|
127
|
+
"title",
|
|
128
|
+
"aria-label",
|
|
129
|
+
"aria-pressed"
|
|
130
|
+
], v = ["title", "aria-label"], C = ["title", "aria-label"], B = {
|
|
131
|
+
key: 0,
|
|
132
|
+
class: "flex items-center gap-2 border-t border-primary/20 bg-primary/5 px-2.5 py-1"
|
|
133
|
+
}, E = { class: "text-[11px] font-medium text-primary" }, N = (0, r.defineComponent)({
|
|
134
|
+
__name: "AiFocusBar",
|
|
135
|
+
props: {
|
|
136
|
+
targets: {},
|
|
137
|
+
slides: {},
|
|
138
|
+
isPinned: { type: Boolean },
|
|
139
|
+
pickMode: { type: Boolean },
|
|
140
|
+
hasPicks: { type: Boolean }
|
|
141
|
+
},
|
|
142
|
+
emits: [
|
|
143
|
+
"pin",
|
|
144
|
+
"clear-pin",
|
|
145
|
+
"start-pick",
|
|
146
|
+
"stop-pick",
|
|
147
|
+
"clear-picks",
|
|
148
|
+
"send-directive"
|
|
149
|
+
],
|
|
150
|
+
setup(o, { emit: n }) {
|
|
151
|
+
const l = o, s = n, { t: i } = e.useI18n(), c = (0, r.computed)(() => t.focusTargetChips(l.targets, l.slides)), p = (0, r.computed)(() => t.isTwoTableFocus(l.targets, l.slides));
|
|
152
|
+
function d() {
|
|
153
|
+
const e = p.value;
|
|
154
|
+
e && s("send-directive", `Merge the two selected tables (elementIdA=${e.elementIdA}, elementIdB=${e.elementIdB}) on slide ${e.slideIndex + 1} using merge_tables; stage it now, do not ask me to confirm.`);
|
|
155
|
+
}
|
|
156
|
+
return (e, n) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", m, [(0, r.createElementVNode)("div", f, [
|
|
157
|
+
(0, r.createElementVNode)("span", x, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.focusScope")), 1),
|
|
158
|
+
((0, r.openBlock)(!0), (0, r.createElementBlock)(r.Fragment, null, (0, r.renderList)(c.value, (e) => ((0, r.openBlock)(), (0, r.createElementBlock)("span", {
|
|
159
|
+
key: e.key,
|
|
160
|
+
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]", o.hasPicks || o.isPinned ? "bg-primary/15 text-primary" : "bg-muted text-muted-foreground")),
|
|
161
|
+
title: e.title
|
|
162
|
+
}, [(0, r.createElementVNode)("span", k, (0, r.toDisplayString)(e.label), 1)], 10, g))), 128)),
|
|
163
|
+
o.isPinned ? ((0, r.openBlock)(), (0, r.createElementBlock)("span", y, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.pinnedFocus")), 1)) : (0, r.createCommentVNode)("", !0),
|
|
164
|
+
(0, r.createElementVNode)("div", b, [
|
|
165
|
+
p.value ? ((0, r.openBlock)(), (0, r.createElementBlock)("button", {
|
|
166
|
+
key: 0,
|
|
167
|
+
type: "button",
|
|
168
|
+
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: d
|
|
170
|
+
}, [(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
|
+
(0, r.createElementVNode)("button", {
|
|
172
|
+
type: "button",
|
|
173
|
+
title: (0, r.unref)(i)("pptx.ai.pickElement"),
|
|
174
|
+
"aria-label": (0, r.unref)(i)("pptx.ai.pickAria"),
|
|
175
|
+
"aria-pressed": o.pickMode,
|
|
176
|
+
class: (0, r.normalizeClass)((0, r.unref)(t.cn)("rounded-sm p-1", o.pickMode ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-accent")),
|
|
177
|
+
onClick: n[0] || (n[0] = (e) => o.pickMode ? s("stop-pick") : s("start-pick"))
|
|
178
|
+
}, [(0, r.createVNode)((0, r.unref)(a.Crosshair), { class: "w-3.5 h-3.5" })], 10, h),
|
|
179
|
+
o.hasPicks ? ((0, r.openBlock)(), (0, r.createElementBlock)("button", {
|
|
180
|
+
key: 1,
|
|
181
|
+
type: "button",
|
|
182
|
+
title: (0, r.unref)(i)("pptx.ai.pickClear"),
|
|
183
|
+
"aria-label": (0, r.unref)(i)("pptx.ai.pickClear"),
|
|
184
|
+
class: "rounded-sm p-1 text-muted-foreground hover:bg-accent",
|
|
185
|
+
onClick: n[1] || (n[1] = (e) => s("clear-picks"))
|
|
186
|
+
}, [(0, r.createVNode)((0, r.unref)(a.X), { class: "w-3.5 h-3.5" })], 8, v)) : ((0, r.openBlock)(), (0, r.createElementBlock)("button", {
|
|
187
|
+
key: 2,
|
|
188
|
+
type: "button",
|
|
189
|
+
title: o.isPinned ? (0, r.unref)(i)("pptx.ai.clearFocus") : (0, r.unref)(i)("pptx.ai.pinFocus"),
|
|
190
|
+
"aria-label": o.isPinned ? (0, r.unref)(i)("pptx.ai.clearFocus") : (0, r.unref)(i)("pptx.ai.pinFocus"),
|
|
191
|
+
class: "rounded-sm p-1 text-muted-foreground hover:bg-accent",
|
|
192
|
+
onClick: n[2] || (n[2] = (e) => o.isPinned ? s("clear-pin") : s("pin"))
|
|
193
|
+
}, [o.isPinned ? ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(a.PinOff), {
|
|
194
|
+
key: 0,
|
|
195
|
+
class: "w-3.5 h-3.5"
|
|
196
|
+
})) : ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(a.Pin), {
|
|
197
|
+
key: 1,
|
|
198
|
+
class: "w-3.5 h-3.5"
|
|
199
|
+
}))], 8, C))
|
|
200
|
+
])
|
|
201
|
+
]), o.pickMode ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", B, [
|
|
202
|
+
(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", E, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.pickElementHint")), 1),
|
|
204
|
+
(0, r.createElementVNode)("button", {
|
|
205
|
+
type: "button",
|
|
206
|
+
class: "ml-auto rounded-sm bg-primary px-2 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary/90",
|
|
207
|
+
onClick: n[3] || (n[3] = (e) => s("stop-pick"))
|
|
208
|
+
}, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.pickDone")), 1)
|
|
209
|
+
])) : (0, r.createCommentVNode)("", !0)]));
|
|
210
|
+
}
|
|
211
|
+
}), w = { class: "flex items-center justify-between border-b border-border px-2.5 py-1.5" }, V = { class: "text-[11px] font-semibold uppercase tracking-wide text-muted-foreground" }, S = {
|
|
212
|
+
key: 0,
|
|
213
|
+
class: "px-3 py-4 text-center text-[12px] text-muted-foreground"
|
|
214
|
+
}, P = {
|
|
215
|
+
key: 1,
|
|
216
|
+
class: "max-h-64 overflow-y-auto py-1"
|
|
217
|
+
}, T = ["onClick"], D = { class: "min-w-0 flex-1" }, I = { class: "block truncate text-[12px] font-medium text-foreground" }, A = { class: "block text-[10px] text-muted-foreground" }, F = [
|
|
218
|
+
"title",
|
|
219
|
+
"aria-label",
|
|
220
|
+
"onClick"
|
|
221
|
+
], M = { class: "border-t border-border px-2.5 py-1.5 text-[10px] text-muted-foreground" }, _ = (0, r.defineComponent)({
|
|
222
|
+
__name: "AiHistoryMenu",
|
|
223
|
+
props: {
|
|
224
|
+
chats: {},
|
|
225
|
+
activeChatId: {}
|
|
226
|
+
},
|
|
227
|
+
emits: [
|
|
228
|
+
"resume",
|
|
229
|
+
"delete",
|
|
230
|
+
"new-chat",
|
|
231
|
+
"close"
|
|
232
|
+
],
|
|
233
|
+
setup(t, { emit: o }) {
|
|
234
|
+
const n = t, l = o, { t: s } = e.useI18n(), i = (0, r.ref)(null);
|
|
235
|
+
function c(e) {
|
|
236
|
+
i.value && !i.value.contains(e.target) && l("close");
|
|
237
|
+
}
|
|
238
|
+
return (0, r.onMounted)(() => document.addEventListener("mousedown", c)), (0, r.onBeforeUnmount)(() => document.removeEventListener("mousedown", c)), (e, t) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", {
|
|
239
|
+
ref_key: "root",
|
|
240
|
+
ref: i,
|
|
241
|
+
class: "absolute right-2 top-10 z-40 w-64 rounded-md border border-border bg-popover shadow-xl"
|
|
242
|
+
}, [
|
|
243
|
+
(0, r.createElementVNode)("div", w, [(0, r.createElementVNode)("span", V, (0, r.toDisplayString)((0, r.unref)(s)("pptx.ai.historyTitle")), 1), (0, r.createElementVNode)("button", {
|
|
244
|
+
type: "button",
|
|
245
|
+
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
|
+
onClick: t[0] || (t[0] = (e) => {
|
|
247
|
+
l("new-chat"), l("close");
|
|
248
|
+
})
|
|
249
|
+
}, [(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 === n.chats.length ? ((0, r.openBlock)(), (0, r.createElementBlock)("p", S, (0, r.toDisplayString)((0, r.unref)(s)("pptx.ai.historyEmpty")), 1)) : ((0, r.openBlock)(), (0, r.createElementBlock)("ul", P, [((0, r.openBlock)(!0), (0, r.createElementBlock)(r.Fragment, null, (0, r.renderList)(n.chats, (e) => ((0, r.openBlock)(), (0, r.createElementBlock)("li", {
|
|
251
|
+
key: e.id,
|
|
252
|
+
class: "group flex items-center gap-1 px-1"
|
|
253
|
+
}, [(0, r.createElementVNode)("button", {
|
|
254
|
+
type: "button",
|
|
255
|
+
class: (0, r.normalizeClass)(["flex min-w-0 flex-1 items-start gap-2 rounded-sm px-2 py-1.5 text-left hover:bg-accent", e.id === n.activeChatId ? "bg-accent/60" : ""]),
|
|
256
|
+
onClick: (t) => {
|
|
257
|
+
l("resume", e.id), l("close");
|
|
258
|
+
}
|
|
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", D, [(0, r.createElementVNode)("span", I, (0, r.toDisplayString)(e.title || (0, r.unref)(s)("pptx.ai.untitledChat")), 1), (0, r.createElementVNode)("span", A, (0, r.toDisplayString)((0, r.unref)(s)("pptx.ai.messageCount", { count: e.messageCount })), 1)])], 10, T), (0, r.createElementVNode)("button", {
|
|
260
|
+
type: "button",
|
|
261
|
+
title: (0, r.unref)(s)("pptx.ai.deleteChat"),
|
|
262
|
+
"aria-label": (0, r.unref)(s)("pptx.ai.deleteChat"),
|
|
263
|
+
class: "shrink-0 rounded-sm p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",
|
|
264
|
+
onClick: (t) => l("delete", e.id)
|
|
265
|
+
}, [(0, r.createVNode)((0, r.unref)(a.Trash2), { class: "w-3.5 h-3.5" })], 8, F)]))), 128))])),
|
|
266
|
+
(0, r.createElementVNode)("p", M, (0, r.toDisplayString)((0, r.unref)(s)("pptx.ai.historyHint")), 1)
|
|
267
|
+
], 512));
|
|
268
|
+
}
|
|
269
|
+
}), L = { class: "text-[12px]" }, j = { class: "flex items-center gap-1.5" }, z = {
|
|
270
|
+
key: 0,
|
|
271
|
+
class: "mt-1 pl-5 text-[11px] text-destructive"
|
|
272
|
+
}, R = {
|
|
273
|
+
key: 1,
|
|
274
|
+
class: "group mt-0.5 pl-5"
|
|
275
|
+
}, q = { class: "cursor-pointer list-none text-[10px] text-muted-foreground/70 hover:text-muted-foreground" }, H = { class: "mt-0.5 break-words font-mono text-[10px] text-muted-foreground/80" }, U = (0, r.defineComponent)({
|
|
276
|
+
__name: "AiToolCallCard",
|
|
277
|
+
props: { part: {} },
|
|
278
|
+
setup(o) {
|
|
279
|
+
const n = o, { t: l } = e.useI18n(), s = {
|
|
280
|
+
view: a.Eye,
|
|
281
|
+
text: a.Type,
|
|
282
|
+
shape: a.Shapes,
|
|
283
|
+
theme: a.Palette,
|
|
284
|
+
table: a.Table,
|
|
285
|
+
slide: a.LayoutTemplate,
|
|
286
|
+
chart: a.ChartColumn,
|
|
287
|
+
move: a.Move,
|
|
288
|
+
delete: a.Trash2,
|
|
289
|
+
search: a.Search,
|
|
290
|
+
nav: a.Navigation,
|
|
291
|
+
animation: a.Film,
|
|
292
|
+
notes: a.StickyNote,
|
|
293
|
+
tool: a.Wrench
|
|
294
|
+
}, i = (0, r.computed)(() => "output-error" === n.part.state), c = (0, r.computed)(() => "output-available" === n.part.state), p = (0, r.computed)(() => !i.value && !c.value), d = (0, r.computed)(() => t.describeToolActivity(n.part.toolName, n.part.input, p.value ? "present" : "past")), u = (0, r.computed)(() => s[d.value.icon] ?? a.Wrench), m = (0, r.computed)(() => t.summarizeToolArgs(n.part.input)), f = (0, r.computed)(() => i.value ? l("pptx.ai.toolFailed") : c.value ? l("pptx.ai.toolDone") : l("pptx.ai.toolRunning"));
|
|
295
|
+
return (e, o) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", L, [
|
|
296
|
+
(0, r.createElementVNode)("div", j, [
|
|
297
|
+
((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
|
+
(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
|
+
(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), {
|
|
300
|
+
key: 0,
|
|
301
|
+
class: "w-3 h-3 animate-spin"
|
|
302
|
+
})) : c.value ? ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(a.Check), {
|
|
303
|
+
key: 1,
|
|
304
|
+
class: "w-3 h-3"
|
|
305
|
+
})) : ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(a.TriangleAlert), {
|
|
306
|
+
key: 2,
|
|
307
|
+
class: "w-3 h-3"
|
|
308
|
+
})), (0, r.createTextVNode)(" " + (0, r.toDisplayString)(f.value), 1)], 2)
|
|
309
|
+
]),
|
|
310
|
+
i.value && n.part.errorText ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", z, (0, r.toDisplayString)(n.part.errorText), 1)) : (0, r.createCommentVNode)("", !0),
|
|
311
|
+
m.value ? ((0, r.openBlock)(), (0, r.createElementBlock)("details", R, [(0, r.createElementVNode)("summary", q, (0, r.toDisplayString)((0, r.unref)(l)("pptx.ai.toolDetails")), 1), (0, r.createElementVNode)("div", H, (0, r.toDisplayString)((0, r.unref)(t.toolLabel)(n.part.toolName)) + ": " + (0, r.toDisplayString)(m.value), 1)])) : (0, r.createCommentVNode)("", !0)
|
|
312
|
+
]));
|
|
313
|
+
}
|
|
314
|
+
}), W = {
|
|
315
|
+
key: 0,
|
|
316
|
+
class: "flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center"
|
|
317
|
+
}, $ = { class: "text-sm font-medium text-foreground" }, O = { class: "text-[12px] text-muted-foreground" }, X = {
|
|
318
|
+
key: 1,
|
|
319
|
+
class: "flex-1 space-y-3 overflow-y-auto px-3 py-3"
|
|
320
|
+
}, K = {
|
|
321
|
+
key: 0,
|
|
322
|
+
class: "flex gap-2"
|
|
323
|
+
}, G = ["aria-label"], J = { class: "min-w-0 flex-1 space-y-1.5" }, Q = {
|
|
324
|
+
key: 0,
|
|
325
|
+
class: "whitespace-pre-wrap break-words text-[13px] leading-relaxed text-foreground"
|
|
326
|
+
}, Y = {
|
|
327
|
+
key: 0,
|
|
328
|
+
class: "flex items-center gap-2 pl-8 text-[12px] text-muted-foreground"
|
|
329
|
+
}, Z = (0, r.defineComponent)({
|
|
330
|
+
__name: "AiMessageList",
|
|
331
|
+
props: {
|
|
332
|
+
messages: {},
|
|
333
|
+
isStreaming: { type: Boolean }
|
|
334
|
+
},
|
|
335
|
+
setup(o) {
|
|
336
|
+
const n = o, { t: l } = e.useI18n(), s = (0, r.ref)(null);
|
|
337
|
+
return (0, r.watch)(() => [n.messages, n.isStreaming], () => {
|
|
338
|
+
(0, r.nextTick)(() => s.value?.scrollIntoView({ block: "end" }));
|
|
339
|
+
}, { deep: !0 }), (e, o) => 0 === n.messages.length ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", W, [
|
|
340
|
+
(0, r.createVNode)((0, r.unref)(a.Sparkles), { class: "w-7 h-7 text-primary/70" }),
|
|
341
|
+
(0, r.createElementVNode)("p", $, (0, r.toDisplayString)((0, r.unref)(l)("pptx.ai.emptyTitle")), 1),
|
|
342
|
+
(0, r.createElementVNode)("p", O, (0, r.toDisplayString)((0, r.unref)(l)("pptx.ai.emptyHint")), 1)
|
|
343
|
+
])) : ((0, r.openBlock)(), (0, r.createElementBlock)("div", X, [
|
|
344
|
+
((0, r.openBlock)(!0), (0, r.createElementBlock)(r.Fragment, null, (0, r.renderList)(n.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", K, [(0, r.createElementVNode)("div", {
|
|
345
|
+
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
|
+
"aria-label": "user" === e.role ? (0, r.unref)(l)("pptx.ai.you") : (0, r.unref)(l)("pptx.ai.assistant")
|
|
347
|
+
}, ["user" === e.role ? ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(a.User), {
|
|
348
|
+
key: 0,
|
|
349
|
+
class: "w-3.5 h-3.5"
|
|
350
|
+
})) : ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(a.Bot), {
|
|
351
|
+
key: 1,
|
|
352
|
+
class: "w-3.5 h-3.5"
|
|
353
|
+
}))], 10, G), (0, r.createElementVNode)("div", J, [((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", Q, (0, r.toDisplayString)(e.text), 1)) : ((0, r.openBlock)(), (0, r.createBlock)(U, {
|
|
354
|
+
key: 1,
|
|
355
|
+
part: e
|
|
356
|
+
}, null, 8, ["part"]))], 64))), 128))])])) : (0, r.createCommentVNode)("", !0)], 64))), 128)),
|
|
357
|
+
n.isStreaming ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", Y, [o[0] || (o[0] = (0, r.createElementVNode)("span", { class: "inline-flex gap-1" }, [
|
|
358
|
+
(0, r.createElementVNode)("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.2s]" }),
|
|
359
|
+
(0, r.createElementVNode)("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.1s]" }),
|
|
360
|
+
(0, r.createElementVNode)("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground" })
|
|
361
|
+
], -1)), (0, r.createTextVNode)(" " + (0, r.toDisplayString)((0, r.unref)(l)("pptx.ai.thinking")), 1)])) : (0, r.createCommentVNode)("", !0),
|
|
362
|
+
(0, r.createElementVNode)("div", {
|
|
363
|
+
ref_key: "endRef",
|
|
364
|
+
ref: s
|
|
365
|
+
}, null, 512)
|
|
366
|
+
]));
|
|
367
|
+
}
|
|
368
|
+
}), ee = { class: "rounded-md border border-primary/40 bg-primary/5 p-2.5" }, te = { class: "mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-primary" }, re = { class: "text-[12px] font-medium text-foreground" }, ae = {
|
|
369
|
+
key: 0,
|
|
370
|
+
class: "mt-1 max-h-40 space-y-0.5 overflow-y-auto text-[11px] text-muted-foreground"
|
|
371
|
+
}, oe = { class: "mt-2 flex items-center gap-2" }, ne = (0, r.defineComponent)({
|
|
372
|
+
__name: "AiProposalCard",
|
|
373
|
+
props: { proposal: {} },
|
|
374
|
+
emits: ["accept", "reject"],
|
|
375
|
+
setup(o, { emit: n }) {
|
|
376
|
+
const l = o, s = n, { 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", ee, [
|
|
378
|
+
(0, r.createElementVNode)("div", te, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.proposedChange")), 1),
|
|
379
|
+
(0, r.createElementVNode)("div", re, (0, r.toDisplayString)(l.proposal.label), 1),
|
|
380
|
+
c.value.length > 0 ? ((0, r.openBlock)(), (0, r.createElementBlock)("ul", ae, [((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
|
+
key: t,
|
|
382
|
+
class: "break-words"
|
|
383
|
+
}, (0, r.toDisplayString)(e), 1))), 128))])) : (0, r.createCommentVNode)("", !0),
|
|
384
|
+
(0, r.createElementVNode)("div", oe, [(0, r.createElementVNode)("button", {
|
|
385
|
+
type: "button",
|
|
386
|
+
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
|
+
onClick: t[0] || (t[0] = (e) => s("accept", l.proposal.id))
|
|
388
|
+
}, [(0, r.createVNode)((0, r.unref)(a.Check), { class: "w-3.5 h-3.5" }), (0, r.createTextVNode)(" " + (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.accept")), 1)]), (0, r.createElementVNode)("button", {
|
|
389
|
+
type: "button",
|
|
390
|
+
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",
|
|
391
|
+
onClick: t[1] || (t[1] = (e) => s("reject", l.proposal.id))
|
|
392
|
+
}, [(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
|
+
]));
|
|
394
|
+
}
|
|
395
|
+
}), le = { class: "relative flex min-h-0 flex-1 flex-col" }, se = { class: "flex items-center gap-1 border-b border-border px-2 py-1" }, ie = { class: "ml-auto flex items-center gap-0.5" }, ce = ["title", "aria-label"], pe = [
|
|
396
|
+
"title",
|
|
397
|
+
"aria-label",
|
|
398
|
+
"disabled"
|
|
399
|
+
], de = {
|
|
400
|
+
key: 1,
|
|
401
|
+
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
|
+
}, ue = { class: "min-w-0 flex-1" }, me = { class: "font-medium" }, fe = { class: "max-h-24 overflow-y-auto break-words text-[11px] opacity-80" }, xe = {
|
|
403
|
+
key: 2,
|
|
404
|
+
class: "max-h-[38%] space-y-2 overflow-y-auto border-t border-border bg-background px-3 py-2"
|
|
405
|
+
}, ge = { class: "flex items-center justify-between" }, ke = { class: "text-[11px] font-semibold uppercase tracking-wide text-muted-foreground" }, ye = (0, r.defineComponent)({
|
|
406
|
+
__name: "AiConversation",
|
|
407
|
+
props: {
|
|
408
|
+
session: {},
|
|
409
|
+
config: {},
|
|
410
|
+
bridge: {},
|
|
411
|
+
aiPanel: {}
|
|
412
|
+
},
|
|
413
|
+
async setup(o) {
|
|
414
|
+
let n, s;
|
|
415
|
+
const i = o, { t: c } = e.useI18n(), { useChat: p } = ([n, s] = (0, r.withAsyncContext)(() => import("@ai-sdk/vue")), n = await n, s(), n), { messages: d, error: m, isStreaming: f, proposals: x, send: g, stop: k, clearError: y, applyProposal: b, rejectProposal: h, acceptAllProposals: v } = l(p, i.session, i.config, { onToolTarget: (e) => {
|
|
416
|
+
e && void 0 !== e.slideIndex && i.bridge.goToSlide(e.slideIndex), i.aiPanel.flashToolTarget(e);
|
|
417
|
+
} }), C = function(e) {
|
|
418
|
+
const a = (0, r.ref)([]), o = t.createAiChatHistoryController({
|
|
419
|
+
deckId: e.deckId,
|
|
420
|
+
store: e.store,
|
|
421
|
+
getMessages: () => e.messages.value,
|
|
422
|
+
setMessages: e.setMessages,
|
|
423
|
+
untitledLabel: e.untitledLabel,
|
|
424
|
+
onChatsChanged: (e) => {
|
|
425
|
+
a.value = e;
|
|
426
|
+
}
|
|
427
|
+
}), n = (0, r.ref)(o.activeChatId()), l = () => {
|
|
428
|
+
n.value = o.activeChatId();
|
|
429
|
+
};
|
|
430
|
+
return (0, r.watch)(e.messages, () => o.notifyMessagesChanged(), { deep: !0 }), (0, r.onBeforeUnmount)(() => o.dispose()), {
|
|
431
|
+
chats: a,
|
|
432
|
+
activeChatId: n,
|
|
433
|
+
refresh: () => o.refresh(),
|
|
434
|
+
newChat: () => {
|
|
435
|
+
o.newChat(), l();
|
|
436
|
+
},
|
|
437
|
+
resumeChat: async (e) => {
|
|
438
|
+
await o.resumeChat(e), l();
|
|
439
|
+
},
|
|
440
|
+
deleteChat: async (e) => {
|
|
441
|
+
await o.deleteChat(e), l();
|
|
442
|
+
},
|
|
443
|
+
clearCurrent: () => o.clearCurrent()
|
|
444
|
+
};
|
|
445
|
+
}({
|
|
446
|
+
deckId: t.deckIdFromBridge(i.bridge),
|
|
447
|
+
messages: d,
|
|
448
|
+
setMessages: (e) => {
|
|
449
|
+
d.value = e;
|
|
450
|
+
},
|
|
451
|
+
untitledLabel: c("pptx.ai.untitledChat")
|
|
452
|
+
}), B = (0, r.ref)(!1), E = i.session.changeAnimator.subscribe((e) => {
|
|
453
|
+
e && i.bridge.goToSlide(e.slideIndex), i.aiPanel.showChangeBatch(e);
|
|
454
|
+
});
|
|
455
|
+
(0, r.onBeforeUnmount)(() => E());
|
|
456
|
+
const w = (0, r.computed)(() => i.aiPanel.pickTargets.value.length > 0), V = (0, r.computed)(() => w.value ? i.aiPanel.pickTargets.value : i.aiPanel.pinnedFocus.value ?? i.aiPanel.liveFocusTargets.value), S = (0, r.computed)(() => !w.value && null !== i.aiPanel.pinnedFocus.value);
|
|
457
|
+
function P(e) {
|
|
458
|
+
i.aiPanel.flashToolTarget(null), b(e);
|
|
459
|
+
}
|
|
460
|
+
function T() {
|
|
461
|
+
i.aiPanel.flashToolTarget(null), v();
|
|
462
|
+
}
|
|
463
|
+
return (e, t) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", le, [
|
|
464
|
+
(0, r.createElementVNode)("div", se, [(0, r.createElementVNode)("button", {
|
|
465
|
+
type: "button",
|
|
466
|
+
class: "inline-flex items-center gap-1 rounded-sm px-1.5 py-1 text-[12px] text-muted-foreground hover:bg-accent",
|
|
467
|
+
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)(c)("pptx.ai.chats")), 1)]), (0, r.createElementVNode)("div", ie, [(0, r.createElementVNode)("button", {
|
|
469
|
+
type: "button",
|
|
470
|
+
title: (0, r.unref)(c)("pptx.ai.newChat"),
|
|
471
|
+
"aria-label": (0, r.unref)(c)("pptx.ai.newChat"),
|
|
472
|
+
class: "rounded-sm p-1 text-muted-foreground hover:bg-accent",
|
|
473
|
+
onClick: t[1] || (t[1] = (e) => (0, r.unref)(C).newChat())
|
|
474
|
+
}, [(0, r.createVNode)((0, r.unref)(a.MessageSquarePlus), { class: "w-3.5 h-3.5" })], 8, ce), (0, r.createElementVNode)("button", {
|
|
475
|
+
type: "button",
|
|
476
|
+
title: (0, r.unref)(c)("pptx.ai.clearChat"),
|
|
477
|
+
"aria-label": (0, r.unref)(c)("pptx.ai.clearChat"),
|
|
478
|
+
disabled: 0 === (0, r.unref)(d).length,
|
|
479
|
+
class: "rounded-sm p-1 text-muted-foreground hover:bg-accent disabled:opacity-40",
|
|
480
|
+
onClick: t[2] || (t[2] = (e) => (0, r.unref)(C).clearCurrent())
|
|
481
|
+
}, [(0, r.createVNode)((0, r.unref)(a.Trash2), { class: "w-3.5 h-3.5" })], 8, pe)])]),
|
|
482
|
+
B.value ? ((0, r.openBlock)(), (0, r.createBlock)(_, {
|
|
483
|
+
key: 0,
|
|
484
|
+
chats: (0, r.unref)(C).chats.value,
|
|
485
|
+
"active-chat-id": (0, r.unref)(C).activeChatId.value,
|
|
486
|
+
onResume: t[3] || (t[3] = (e) => {
|
|
487
|
+
(0, r.unref)(C).resumeChat(e);
|
|
488
|
+
}),
|
|
489
|
+
onDelete: t[4] || (t[4] = (e) => {
|
|
490
|
+
(0, r.unref)(C).deleteChat(e);
|
|
491
|
+
}),
|
|
492
|
+
onNewChat: t[5] || (t[5] = (e) => (0, r.unref)(C).newChat()),
|
|
493
|
+
onClose: t[6] || (t[6] = (e) => B.value = !1)
|
|
494
|
+
}, null, 8, ["chats", "active-chat-id"])) : (0, r.createCommentVNode)("", !0),
|
|
495
|
+
(0, r.createVNode)(N, {
|
|
496
|
+
targets: V.value,
|
|
497
|
+
slides: i.bridge.getSlides(),
|
|
498
|
+
"is-pinned": S.value,
|
|
499
|
+
"pick-mode": i.aiPanel.pickMode.value,
|
|
500
|
+
"has-picks": w.value,
|
|
501
|
+
onPin: i.aiPanel.pinFocus,
|
|
502
|
+
onClearPin: i.aiPanel.clearPinnedFocus,
|
|
503
|
+
onStartPick: i.aiPanel.startPicking,
|
|
504
|
+
onStopPick: i.aiPanel.stopPicking,
|
|
505
|
+
onClearPicks: i.aiPanel.clearPicks,
|
|
506
|
+
onSendDirective: (0, r.unref)(g)
|
|
507
|
+
}, null, 8, [
|
|
508
|
+
"targets",
|
|
509
|
+
"slides",
|
|
510
|
+
"is-pinned",
|
|
511
|
+
"pick-mode",
|
|
512
|
+
"has-picks",
|
|
513
|
+
"onPin",
|
|
514
|
+
"onClearPin",
|
|
515
|
+
"onStartPick",
|
|
516
|
+
"onStopPick",
|
|
517
|
+
"onClearPicks",
|
|
518
|
+
"onSendDirective"
|
|
519
|
+
]),
|
|
520
|
+
(0, r.createVNode)(Z, {
|
|
521
|
+
messages: (0, r.unref)(d),
|
|
522
|
+
"is-streaming": (0, r.unref)(f)
|
|
523
|
+
}, null, 8, ["messages", "is-streaming"]),
|
|
524
|
+
(0, r.unref)(m) ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", de, [
|
|
525
|
+
(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", ue, [(0, r.createElementVNode)("div", me, (0, r.toDisplayString)((0, r.unref)(c)("pptx.ai.errorPrefix")), 1), (0, r.createElementVNode)("div", fe, (0, r.toDisplayString)((0, r.unref)(m).message), 1)]),
|
|
527
|
+
(0, r.createElementVNode)("button", {
|
|
528
|
+
type: "button",
|
|
529
|
+
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)(y) && (0, r.unref)(y)(...e))
|
|
531
|
+
}, (0, r.toDisplayString)((0, r.unref)(c)("pptx.ai.retry")), 1)
|
|
532
|
+
])) : (0, r.createCommentVNode)("", !0),
|
|
533
|
+
(0, r.unref)(x).length > 0 ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", xe, [(0, r.createElementVNode)("div", ge, [(0, r.createElementVNode)("span", ke, (0, r.toDisplayString)((0, r.unref)(c)("pptx.ai.pendingChanges", { count: (0, r.unref)(x).length })), 1), (0, r.unref)(x).length > 1 ? ((0, r.openBlock)(), (0, r.createElementBlock)("button", {
|
|
534
|
+
key: 0,
|
|
535
|
+
type: "button",
|
|
536
|
+
class: "rounded-sm bg-primary/90 px-2 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary",
|
|
537
|
+
onClick: T
|
|
538
|
+
}, (0, r.toDisplayString)((0, r.unref)(c)("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)(ne, {
|
|
539
|
+
key: e.id,
|
|
540
|
+
proposal: e,
|
|
541
|
+
onAccept: P,
|
|
542
|
+
onReject: (0, r.unref)(h)
|
|
543
|
+
}, null, 8, ["proposal", "onReject"]))), 128))])) : (0, r.createCommentVNode)("", !0),
|
|
544
|
+
(0, r.createVNode)(u, {
|
|
545
|
+
"is-streaming": (0, r.unref)(f),
|
|
546
|
+
"prefill-text": i.aiPanel.prefill.value.text,
|
|
547
|
+
"prefill-nonce": i.aiPanel.prefill.value.nonce,
|
|
548
|
+
onSend: (0, r.unref)(g),
|
|
549
|
+
onStop: (0, r.unref)(k)
|
|
550
|
+
}, null, 8, [
|
|
551
|
+
"is-streaming",
|
|
552
|
+
"prefill-text",
|
|
553
|
+
"prefill-nonce",
|
|
554
|
+
"onSend",
|
|
555
|
+
"onStop"
|
|
556
|
+
])
|
|
557
|
+
]));
|
|
558
|
+
}
|
|
559
|
+
}), be = { class: "flex items-center gap-2 border-b border-border px-3 py-2" }, he = { class: "text-sm font-semibold text-foreground" }, ve = ["title", "aria-label"], Ce = {
|
|
560
|
+
key: 0,
|
|
561
|
+
class: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground"
|
|
562
|
+
}, Be = {
|
|
563
|
+
key: 1,
|
|
564
|
+
class: "flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center"
|
|
565
|
+
}, Ee = { class: "text-sm font-medium text-foreground" }, Ne = { class: "text-[12px] text-muted-foreground" }, we = { class: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground" }, Ve = (0, r.defineComponent)({
|
|
566
|
+
__name: "AiChatPanel",
|
|
567
|
+
props: {
|
|
568
|
+
bridge: {},
|
|
569
|
+
config: {},
|
|
570
|
+
panelWidth: {},
|
|
571
|
+
aiPanel: {}
|
|
572
|
+
},
|
|
573
|
+
emits: ["close"],
|
|
574
|
+
setup(o, { emit: n }) {
|
|
575
|
+
const l = o, s = n, { t: i } = e.useI18n(), { state: c, session: p, initError: d } = function(e, a) {
|
|
576
|
+
const o = (0, r.ref)("checking"), n = (0, r.shallowRef)(null), l = (0, r.shallowRef)(void 0);
|
|
577
|
+
let s = 0;
|
|
578
|
+
return (async () => {
|
|
579
|
+
const r = ++s;
|
|
580
|
+
o.value = "checking", n.value = null, l.value = void 0;
|
|
581
|
+
try {
|
|
582
|
+
const l = await t.isAiAvailable();
|
|
583
|
+
if (r !== s) return;
|
|
584
|
+
if (!l) return void (o.value = "unavailable");
|
|
585
|
+
const i = await t.createAiChatSession(e, a);
|
|
586
|
+
if (r !== s) return;
|
|
587
|
+
n.value = i, o.value = "ready";
|
|
588
|
+
} catch (e) {
|
|
589
|
+
if (r !== s) return;
|
|
590
|
+
l.value = e instanceof Error ? e : new Error(String(e)), o.value = "error";
|
|
591
|
+
}
|
|
592
|
+
})(), {
|
|
593
|
+
state: o,
|
|
594
|
+
session: n,
|
|
595
|
+
initError: l
|
|
596
|
+
};
|
|
597
|
+
}(l.bridge, l.config), u = (0, r.computed)(() => l.panelWidth ? { width: `${l.panelWidth}px` } : void 0), m = t.useAiPanelController({
|
|
598
|
+
activeSlideIndex: (0, r.ref)(0),
|
|
599
|
+
selectedElementIds: (0, r.ref)([]),
|
|
600
|
+
selectedElement: () => null
|
|
601
|
+
}), f = (0, r.computed)(() => l.aiPanel ?? m);
|
|
602
|
+
return (e, t) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", {
|
|
603
|
+
"data-pptx-ai-panel": "",
|
|
604
|
+
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
|
+
style: (0, r.normalizeStyle)(u.value)
|
|
606
|
+
}, [(0, r.createElementVNode)("div", be, [
|
|
607
|
+
(0, r.createVNode)((0, r.unref)(a.Sparkles), { class: "w-4 h-4 text-primary" }),
|
|
608
|
+
(0, r.createElementVNode)("span", he, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.title")), 1),
|
|
609
|
+
(0, r.createElementVNode)("button", {
|
|
610
|
+
type: "button",
|
|
611
|
+
title: (0, r.unref)(i)("pptx.ai.close"),
|
|
612
|
+
"aria-label": (0, r.unref)(i)("pptx.ai.close"),
|
|
613
|
+
class: "ml-auto rounded-sm p-1 text-muted-foreground transition-colors hover:bg-accent",
|
|
614
|
+
onClick: t[0] || (t[0] = (e) => s("close"))
|
|
615
|
+
}, [(0, r.createVNode)((0, r.unref)(a.X), { class: "w-4 h-4" })], 8, ve)
|
|
616
|
+
]), "checking" === (0, r.unref)(c) ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", Ce, [(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", Be, [
|
|
617
|
+
(0, r.createVNode)((0, r.unref)(a.TriangleAlert), { class: "w-6 h-6 text-muted-foreground" }),
|
|
618
|
+
(0, r.createElementVNode)("p", Ee, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.unavailableTitle")), 1),
|
|
619
|
+
(0, r.createElementVNode)("p", Ne, (0, r.toDisplayString)((0, r.unref)(d)?.message ?? (0, r.unref)(i)("pptx.ai.unavailableHint")), 1)
|
|
620
|
+
])) : "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", we, [(0, r.createVNode)((0, r.unref)(a.LoaderCircle), { class: "w-5 h-5 animate-spin" })])]),
|
|
622
|
+
default: (0, r.withCtx)(() => [(0, r.createVNode)(ye, {
|
|
623
|
+
session: (0, r.unref)(p),
|
|
624
|
+
config: l.config,
|
|
625
|
+
bridge: l.bridge,
|
|
626
|
+
"ai-panel": f.value
|
|
627
|
+
}, null, 8, [
|
|
628
|
+
"session",
|
|
629
|
+
"config",
|
|
630
|
+
"bridge",
|
|
631
|
+
"ai-panel"
|
|
632
|
+
])]),
|
|
633
|
+
_: 1
|
|
634
|
+
})) : (0, r.createCommentVNode)("", !0)], 4));
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
exports.default = Ve;
|
|
Binary file
|
|
Binary file
|