pptx-vue-viewer 1.24.4 → 2.0.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 +8 -0
- package/README.md +5 -5
- package/dist/AiChatPanel-DGB_Bw7d.js +509 -0
- package/dist/AiChatPanel-DGB_Bw7d.js.br +0 -0
- package/dist/AiChatPanel-DGB_Bw7d.js.gz +0 -0
- package/dist/AiChatPanel-DkpImFIU.cjs +505 -0
- package/dist/AiChatPanel-DkpImFIU.cjs.br +0 -0
- package/dist/AiChatPanel-DkpImFIU.cjs.gz +0 -0
- package/dist/__vite-browser-external-4htJ_nFU.js +5 -0
- package/dist/__vite-browser-external-4htJ_nFU.js.br +0 -0
- package/dist/__vite-browser-external-4htJ_nFU.js.gz +0 -0
- package/dist/__vite-browser-external-Cbcy2Heq.cjs +9 -0
- package/dist/__vite-browser-external-Cbcy2Heq.cjs.br +0 -0
- package/dist/__vite-browser-external-Cbcy2Heq.cjs.gz +0 -0
- package/dist/{dist-Bk18ZZMR.cjs → dist-DVTKkNd_.cjs} +10483 -8618
- package/dist/dist-DVTKkNd_.cjs.br +0 -0
- package/dist/dist-DVTKkNd_.cjs.gz +0 -0
- package/dist/{dist-D0uo4Qr-.js → dist-O5B4b6cK.js} +10193 -8493
- package/dist/dist-O5B4b6cK.js.br +0 -0
- package/dist/dist-O5B4b6cK.js.gz +0 -0
- package/dist/gif-encoder-Cdh-ia4-.cjs +2 -0
- package/dist/gif-encoder-Cdh-ia4-.cjs.br +0 -0
- package/dist/gif-encoder-Cdh-ia4-.cjs.gz +0 -0
- package/dist/gif-encoder-N6lgh64R.js +2 -0
- package/dist/gif-encoder-N6lgh64R.js.br +0 -0
- package/dist/gif-encoder-N6lgh64R.js.gz +0 -0
- package/dist/{i18n-YM1M3RlR.cjs → i18n-CiJ98jSy.cjs} +58 -0
- package/dist/i18n-CiJ98jSy.cjs.br +0 -0
- package/dist/i18n-CiJ98jSy.cjs.gz +0 -0
- package/dist/{i18n-DFum-9KW.js → i18n-DlbVzRoS.js} +58 -0
- package/dist/i18n-DlbVzRoS.js.br +0 -0
- package/dist/i18n-DlbVzRoS.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 +2 -2
- package/dist/index.cjs.br +0 -0
- package/dist/index.cjs.gz +0 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/{composables-unstable.cjs → internals.cjs} +2 -2
- package/dist/internals.cjs.br +0 -0
- package/dist/internals.cjs.gz +0 -0
- package/dist/{composables-unstable.d.ts → internals.d.ts} +3 -1
- package/dist/internals.d.ts.map +1 -0
- package/dist/internals.js +30 -0
- 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/rolldown-runtime-E3_hCp2H.js +21 -0
- package/dist/rolldown-runtime-E3_hCp2H.js.br +0 -0
- package/dist/rolldown-runtime-E3_hCp2H.js.gz +0 -0
- package/dist/{useViewerSettingsDialog-CtY1ryo8.js → useViewerSettingsDialog-BkxUrwyk.js} +7514 -4384
- package/dist/useViewerSettingsDialog-BkxUrwyk.js.br +0 -0
- package/dist/useViewerSettingsDialog-BkxUrwyk.js.gz +0 -0
- package/dist/{useViewerSettingsDialog-DPWjFSY-.cjs → useViewerSettingsDialog-D9H1CVYx.cjs} +7501 -4307
- package/dist/useViewerSettingsDialog-D9H1CVYx.cjs.br +0 -0
- package/dist/useViewerSettingsDialog-D9H1CVYx.cjs.gz +0 -0
- package/dist/viewer/PowerPointViewer.vue.d.ts.map +1 -1
- package/dist/viewer/components/ChartRenderer.vue.d.ts +7 -0
- package/dist/viewer/components/ChartRenderer.vue.d.ts.map +1 -1
- package/dist/viewer/components/ConnectorRenderer.vue.d.ts +7 -0
- package/dist/viewer/components/ConnectorRenderer.vue.d.ts.map +1 -1
- package/dist/viewer/components/CustomShowsPanel.vue.d.ts +2 -2
- package/dist/viewer/components/ElementRenderer.vue.d.ts +6 -1
- package/dist/viewer/components/ElementRenderer.vue.d.ts.map +1 -1
- package/dist/viewer/components/InlineTextEditor.vue.d.ts +2 -2
- package/dist/viewer/components/MobileBottomBar.vue.d.ts +6 -6
- package/dist/viewer/components/MobileSlidesSheet.vue.d.ts +2 -2
- package/dist/viewer/components/MobileToolbar.vue.d.ts.map +1 -1
- package/dist/viewer/components/PresentationMode.vue.d.ts.map +1 -1
- package/dist/viewer/components/SectionList.vue.d.ts +2 -2
- package/dist/viewer/components/SettingsAiTab.vue.d.ts +9 -0
- package/dist/viewer/components/SettingsAiTab.vue.d.ts.map +1 -0
- package/dist/viewer/components/SettingsDialog.vue.d.ts +5 -0
- package/dist/viewer/components/SettingsDialog.vue.d.ts.map +1 -1
- package/dist/viewer/components/ShapeEffectOverlay.vue.d.ts +8 -0
- package/dist/viewer/components/ShapeEffectOverlay.vue.d.ts.map +1 -0
- package/dist/viewer/components/SlideSorter.vue.d.ts +2 -2
- package/dist/viewer/components/SlideTextBlock.vue.d.ts.map +1 -1
- package/dist/viewer/components/SmartArtRenderer.vue.d.ts +7 -0
- package/dist/viewer/components/SmartArtRenderer.vue.d.ts.map +1 -1
- package/dist/viewer/components/StatusBar.vue.d.ts +15 -3
- package/dist/viewer/components/StatusBar.vue.d.ts.map +1 -1
- package/dist/viewer/components/TableRenderer.vue.d.ts.map +1 -1
- package/dist/viewer/components/VersionHistoryPanel.vue.d.ts +1 -1
- package/dist/viewer/components/ai/AiChangeOverlay.vue.d.ts +9 -0
- package/dist/viewer/components/ai/AiChangeOverlay.vue.d.ts.map +1 -0
- package/dist/viewer/components/ai/AiChatPanel.vue.d.ts +21 -0
- package/dist/viewer/components/ai/AiChatPanel.vue.d.ts.map +1 -0
- package/dist/viewer/components/ai/AiComposer.vue.d.ts +17 -0
- package/dist/viewer/components/ai/AiComposer.vue.d.ts.map +1 -0
- package/dist/viewer/components/ai/AiConversation.vue.d.ts +12 -0
- package/dist/viewer/components/ai/AiConversation.vue.d.ts.map +1 -0
- package/dist/viewer/components/ai/AiFocusBar.vue.d.ts +27 -0
- package/dist/viewer/components/ai/AiFocusBar.vue.d.ts.map +1 -0
- package/dist/viewer/components/ai/AiFocusHighlightOverlay.vue.d.ts +12 -0
- package/dist/viewer/components/ai/AiFocusHighlightOverlay.vue.d.ts.map +1 -0
- package/dist/viewer/components/ai/AiMessageList.vue.d.ts +9 -0
- package/dist/viewer/components/ai/AiMessageList.vue.d.ts.map +1 -0
- package/dist/viewer/components/ai/AiProposalCard.vue.d.ts +14 -0
- package/dist/viewer/components/ai/AiProposalCard.vue.d.ts.map +1 -0
- package/dist/viewer/components/ai/AiToolCallCard.vue.d.ts +8 -0
- package/dist/viewer/components/ai/AiToolCallCard.vue.d.ts.map +1 -0
- package/dist/viewer/components/ai/index.d.ts +16 -0
- package/dist/viewer/components/ai/index.d.ts.map +1 -0
- package/dist/viewer/components/inspector/PresentationSettingsCard.vue.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/FileSection.vue.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/RibbonToolbar.vue.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/ToolbarPrimaryRow.vue.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/ribbon-types.d.ts +6 -0
- package/dist/viewer/components/ribbon/ribbon-types.d.ts.map +1 -1
- package/dist/viewer/components/theme-gallery-presets.d.ts +6 -4
- package/dist/viewer/components/theme-gallery-presets.d.ts.map +1 -1
- package/dist/viewer/composables/ai/ai-log-export.d.ts +73 -0
- package/dist/viewer/composables/ai/ai-log-export.d.ts.map +1 -0
- package/dist/viewer/composables/ai/focus-targets.d.ts +34 -0
- package/dist/viewer/composables/ai/focus-targets.d.ts.map +1 -0
- package/dist/viewer/composables/ai/message-parts.d.ts +13 -0
- package/dist/viewer/composables/ai/message-parts.d.ts.map +1 -0
- package/dist/viewer/composables/ai/useAiBridge.d.ts +38 -0
- package/dist/viewer/composables/ai/useAiBridge.d.ts.map +1 -0
- package/dist/viewer/composables/ai/useAiChat.d.ts +11 -0
- package/dist/viewer/composables/ai/useAiChat.d.ts.map +1 -0
- package/dist/viewer/composables/ai/useAiConversation.d.ts +27 -0
- package/dist/viewer/composables/ai/useAiConversation.d.ts.map +1 -0
- package/dist/viewer/composables/ai/useAiPanelController.d.ts +51 -0
- package/dist/viewer/composables/ai/useAiPanelController.d.ts.map +1 -0
- package/dist/viewer/composables/animation-playback-helpers.d.ts +43 -0
- package/dist/viewer/composables/animation-playback-helpers.d.ts.map +1 -0
- package/dist/viewer/composables/animation-sound.d.ts +20 -0
- package/dist/viewer/composables/animation-sound.d.ts.map +1 -0
- package/dist/viewer/composables/audience-content-store.d.ts +6 -29
- package/dist/viewer/composables/audience-content-store.d.ts.map +1 -1
- package/dist/viewer/composables/collaboration-types.d.ts +2 -0
- package/dist/viewer/composables/collaboration-types.d.ts.map +1 -1
- package/dist/viewer/composables/element-style.d.ts +6 -2
- package/dist/viewer/composables/element-style.d.ts.map +1 -1
- package/dist/viewer/composables/index.d.ts +3 -5
- package/dist/viewer/composables/index.d.ts.map +1 -1
- package/dist/viewer/composables/presentation-element-states.d.ts +31 -0
- package/dist/viewer/composables/presentation-element-states.d.ts.map +1 -0
- package/dist/viewer/composables/table-theme.d.ts +6 -1
- package/dist/viewer/composables/table-theme.d.ts.map +1 -1
- package/dist/viewer/composables/useAnimationPlayback.d.ts +31 -40
- package/dist/viewer/composables/useAnimationPlayback.d.ts.map +1 -1
- package/dist/viewer/composables/useCollaboration.d.ts.map +1 -1
- package/dist/viewer/composables/useCollaborationGranular.d.ts +81 -0
- package/dist/viewer/composables/useCollaborationGranular.d.ts.map +1 -0
- package/dist/viewer/composables/useCollaborationWiring.d.ts.map +1 -1
- package/dist/viewer/composables/useContextMenu.d.ts +6 -0
- package/dist/viewer/composables/useContextMenu.d.ts.map +1 -1
- package/dist/viewer/composables/useImageEditing.d.ts +0 -8
- package/dist/viewer/composables/useImageEditing.d.ts.map +1 -1
- package/dist/viewer/index.cjs +2 -2
- package/dist/viewer/index.cjs.br +0 -0
- package/dist/viewer/index.cjs.gz +0 -0
- package/dist/viewer/index.d.ts +1 -0
- package/dist/viewer/index.d.ts.map +1 -1
- 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/types.d.ts +17 -5
- package/dist/viewer/types.d.ts.map +1 -1
- package/dist/viewer-D2Aqi7Ed.js +33161 -0
- package/dist/viewer-D2Aqi7Ed.js.br +0 -0
- package/dist/viewer-D2Aqi7Ed.js.gz +0 -0
- package/dist/viewer-DLN4eMIi.cjs +33378 -0
- package/dist/viewer-DLN4eMIi.cjs.br +0 -0
- package/dist/viewer-DLN4eMIi.cjs.gz +0 -0
- package/dist/{y-webrtc-DDj-Omhe.js → y-webrtc-BfSA9VEG.js} +574 -592
- package/dist/y-webrtc-BfSA9VEG.js.br +0 -0
- package/dist/y-webrtc-BfSA9VEG.js.gz +0 -0
- package/package.json +17 -7
- package/dist/composables-unstable.cjs.br +0 -0
- package/dist/composables-unstable.cjs.gz +0 -0
- package/dist/composables-unstable.d.ts.map +0 -1
- package/dist/composables-unstable.js +0 -30
- package/dist/composables-unstable.js.br +0 -0
- package/dist/composables-unstable.js.gz +0 -0
- package/dist/dist-Bk18ZZMR.cjs.br +0 -0
- package/dist/dist-Bk18ZZMR.cjs.gz +0 -0
- package/dist/dist-D0uo4Qr-.js.br +0 -0
- package/dist/dist-D0uo4Qr-.js.gz +0 -0
- package/dist/gif-encoder-BOqPyc1m.cjs +0 -2
- package/dist/gif-encoder-BOqPyc1m.cjs.br +0 -0
- package/dist/gif-encoder-BOqPyc1m.cjs.gz +0 -0
- package/dist/gif-encoder-giGxxGyL.js +0 -2
- package/dist/gif-encoder-giGxxGyL.js.br +0 -0
- package/dist/gif-encoder-giGxxGyL.js.gz +0 -0
- package/dist/i18n-DFum-9KW.js.br +0 -0
- package/dist/i18n-DFum-9KW.js.gz +0 -0
- package/dist/i18n-YM1M3RlR.cjs.br +0 -0
- package/dist/i18n-YM1M3RlR.cjs.gz +0 -0
- package/dist/useViewerSettingsDialog-CtY1ryo8.js.br +0 -0
- package/dist/useViewerSettingsDialog-CtY1ryo8.js.gz +0 -0
- package/dist/useViewerSettingsDialog-DPWjFSY-.cjs.br +0 -0
- package/dist/useViewerSettingsDialog-DPWjFSY-.cjs.gz +0 -0
- package/dist/viewer-C367x-uj.cjs +0 -24943
- package/dist/viewer-C367x-uj.cjs.br +0 -0
- package/dist/viewer-C367x-uj.cjs.gz +0 -0
- package/dist/viewer-qd3mSmOD.js +0 -24776
- package/dist/viewer-qd3mSmOD.js.br +0 -0
- package/dist/viewer-qd3mSmOD.js.gz +0 -0
- package/dist/y-webrtc-DDj-Omhe.js.br +0 -0
- package/dist/y-webrtc-DDj-Omhe.js.gz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ 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
|
+
## [1.24.5](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vue-viewer@1.24.5) - 2026-07-19
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **shared:** Enforce transition advanceOnClick in Vue/Angular/Svelte/Vanilla ([#82](https://github.com/ChristopherVR/pptx-viewer/issues/82)) (by @ChristopherVR) ([66d489b](https://github.com/ChristopherVR/pptx-viewer/commit/66d489b41d899e09d856d004d49d1eb17258d457))
|
|
12
|
+
|
|
13
|
+
## [1.24.4](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vue-viewer@1.24.4) - 2026-07-19
|
|
14
|
+
|
|
7
15
|
## [1.24.3](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vue-viewer@1.24.3) - 2026-07-19
|
|
8
16
|
|
|
9
17
|
## [1.24.2](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vue-viewer@1.24.2) - 2026-07-19
|
package/README.md
CHANGED
|
@@ -252,10 +252,10 @@ following slide/element manipulation methods are also available:
|
|
|
252
252
|
dialog into one component. If you only want a subset, for example your own
|
|
253
253
|
chrome around just the ribbon and the slide canvas, import the pieces
|
|
254
254
|
independently instead: `RibbonToolbar` (from `pptx-vue-viewer`, same as
|
|
255
|
-
`SlideCanvas`) and the `useRibbonProps` composable (from the
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
255
|
+
`SlideCanvas`) and the `useRibbonProps` composable (from the internal
|
|
256
|
+
building-blocks entry point `pptx-vue-viewer/internals`) that assembles its
|
|
257
|
+
props. The `internals` subpath is not covered by semver; prefer the stable
|
|
258
|
+
root exports, and pin your version when relying on `internals`.
|
|
259
259
|
|
|
260
260
|
```vue
|
|
261
261
|
<script setup lang="ts">
|
|
@@ -266,7 +266,7 @@ import {
|
|
|
266
266
|
useSelection,
|
|
267
267
|
// ...plus whichever other composables you need to build the
|
|
268
268
|
// `UseRibbonPropsInput` state/action fields (see ribbon-props-types.ts).
|
|
269
|
-
} from 'pptx-vue-viewer/
|
|
269
|
+
} from 'pptx-vue-viewer/internals';
|
|
270
270
|
|
|
271
271
|
// Wire up just the state/handlers your custom shell needs; anything from
|
|
272
272
|
// `UseRibbonPropsInput` you don't use can be a no-op ref/callback.
|
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
import { _n as e } from "./useViewerSettingsDialog-BkxUrwyk.js";
|
|
2
|
+
import { F as t, I as a, L as r, M as s, N as l, P as o, R as i, c as n, f as p, o as d, s as c, z as u } from "./viewer-D2Aqi7Ed.js";
|
|
3
|
+
import { Fragment as m, computed as x, createBlock as g, createCommentVNode as f, createElementBlock as b, createElementVNode as v, createTextVNode as y, createVNode as h, defineComponent as k, nextTick as w, normalizeClass as P, normalizeStyle as C, onBeforeUnmount as S, openBlock as T, ref as I, renderList as A, resolveDynamicComponent as _, shallowRef as E, toDisplayString as j, unref as F, vModelText as M, watch as B, withDirectives as N } from "vue";
|
|
4
|
+
import { Bot as D, ChartColumn as R, Check as W, Crosshair as $, Eye as z, Film as H, GitMerge as V, LayoutTemplate as K, LoaderCircle as L, Move as O, Navigation as U, Palette as q, Pin as G, PinOff as J, Search as Q, Send as X, Shapes as Y, Sparkles as Z, Square as ee, StickyNote as te, Table as ae, Trash2 as re, TriangleAlert as se, Type as le, User as oe, Wrench as ie, X as ne } from "lucide-vue-next";
|
|
5
|
+
import { useChat as pe } from "@ai-sdk/vue";
|
|
6
|
+
import { getToolOrDynamicToolName as de, isDynamicToolUIPart as ce, isToolUIPart as ue } from "ai";
|
|
7
|
+
var me = /* @__PURE__ */ new Set([
|
|
8
|
+
"input-available",
|
|
9
|
+
"output-available",
|
|
10
|
+
"output-error"
|
|
11
|
+
]);
|
|
12
|
+
function xe(e, t, a = {}) {
|
|
13
|
+
const r = I(e.proposals.list()), s = () => {
|
|
14
|
+
r.value = e.proposals.list();
|
|
15
|
+
}, l = pe({
|
|
16
|
+
transport: e.transport,
|
|
17
|
+
sendAutomaticallyWhen: e.sendAutomaticallyWhen,
|
|
18
|
+
onError: (e) => t.onError?.(e),
|
|
19
|
+
onToolCall: async ({ toolCall: t }) => {
|
|
20
|
+
const { toolName: a, toolCallId: r, input: o } = t, i = l.addToolOutput;
|
|
21
|
+
try {
|
|
22
|
+
i({
|
|
23
|
+
tool: a,
|
|
24
|
+
toolCallId: r,
|
|
25
|
+
output: await e.executeToolCall(a, o)
|
|
26
|
+
});
|
|
27
|
+
} catch (e) {
|
|
28
|
+
i({
|
|
29
|
+
tool: a,
|
|
30
|
+
toolCallId: r,
|
|
31
|
+
state: "output-error",
|
|
32
|
+
errorText: e instanceof Error ? e.message : String(e)
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
s();
|
|
36
|
+
}
|
|
37
|
+
}), o = x(() => "submitted" === l.status.value || "streaming" === l.status.value), n = /* @__PURE__ */ new Set();
|
|
38
|
+
B(l.messages, (e) => {
|
|
39
|
+
for (const t of function(e) {
|
|
40
|
+
const t = [];
|
|
41
|
+
for (const a of e) for (const e of a.parts) {
|
|
42
|
+
if (!ue(e) && !ce(e)) continue;
|
|
43
|
+
const a = e, r = a.toolCallId ?? "";
|
|
44
|
+
0 !== r.length && void 0 !== a.input && me.has(a.state ?? "") && t.push({
|
|
45
|
+
toolName: de(e),
|
|
46
|
+
toolCallId: r,
|
|
47
|
+
input: a.input
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return t;
|
|
51
|
+
}(e)) n.has(t.toolCallId) || (n.add(t.toolCallId), a.onToolTarget?.(i(t.toolName, t.input)));
|
|
52
|
+
}, { deep: !0 });
|
|
53
|
+
return {
|
|
54
|
+
messages: l.messages,
|
|
55
|
+
status: l.status,
|
|
56
|
+
error: l.error,
|
|
57
|
+
isStreaming: o,
|
|
58
|
+
proposals: r,
|
|
59
|
+
send: (e) => {
|
|
60
|
+
const t = e.trim();
|
|
61
|
+
0 !== t.length && l.sendMessage({ text: t });
|
|
62
|
+
},
|
|
63
|
+
stop: () => {
|
|
64
|
+
l.stop();
|
|
65
|
+
},
|
|
66
|
+
clearError: () => l.clearError(),
|
|
67
|
+
applyProposal: (t) => {
|
|
68
|
+
e.proposals.apply(t), s();
|
|
69
|
+
},
|
|
70
|
+
rejectProposal: (t) => {
|
|
71
|
+
e.proposals.revert(t), s();
|
|
72
|
+
},
|
|
73
|
+
acceptAllProposals: () => {
|
|
74
|
+
e.proposals.acceptAll(), s();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
var ge = { class: "border-t border-border p-2" }, fe = { class: "flex items-end gap-1.5 rounded-md border border-input bg-background px-2 py-1.5 focus-within:border-ring" }, be = ["placeholder", "aria-label"], ve = ["title", "aria-label"], ye = [
|
|
79
|
+
"disabled",
|
|
80
|
+
"title",
|
|
81
|
+
"aria-label"
|
|
82
|
+
], he = k({
|
|
83
|
+
__name: "AiComposer",
|
|
84
|
+
props: {
|
|
85
|
+
isStreaming: { type: Boolean },
|
|
86
|
+
prefillText: {},
|
|
87
|
+
prefillNonce: {}
|
|
88
|
+
},
|
|
89
|
+
emits: ["send", "stop"],
|
|
90
|
+
setup(t, { emit: a }) {
|
|
91
|
+
const r = t, s = a, { t: l } = e(), o = I(""), i = I(null), n = x(() => o.value.trim().length > 0);
|
|
92
|
+
function d() {
|
|
93
|
+
const e = o.value.trim();
|
|
94
|
+
0 === e.length || r.isStreaming || (s("send", e), o.value = "");
|
|
95
|
+
}
|
|
96
|
+
function c(e) {
|
|
97
|
+
"Enter" !== e.key || e.shiftKey || (e.preventDefault(), d());
|
|
98
|
+
}
|
|
99
|
+
return B(() => r.prefillNonce, (e) => {
|
|
100
|
+
void 0 !== e && 0 !== e && (r.prefillText && (o.value = r.prefillText), w(() => i.value?.focus()));
|
|
101
|
+
}), (e, t) => (T(), b("div", ge, [v("div", fe, [N(v("textarea", {
|
|
102
|
+
ref_key: "textareaRef",
|
|
103
|
+
ref: i,
|
|
104
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => o.value = e),
|
|
105
|
+
rows: 1,
|
|
106
|
+
placeholder: F(l)("pptx.ai.placeholder"),
|
|
107
|
+
"aria-label": F(l)("pptx.ai.placeholder"),
|
|
108
|
+
class: "max-h-32 min-h-[1.5rem] flex-1 resize-none bg-transparent text-[13px] text-foreground outline-none placeholder:text-muted-foreground",
|
|
109
|
+
onKeydown: c
|
|
110
|
+
}, null, 40, be), [[M, o.value]]), r.isStreaming ? (T(), b("button", {
|
|
111
|
+
key: 0,
|
|
112
|
+
type: "button",
|
|
113
|
+
title: F(l)("pptx.ai.stop"),
|
|
114
|
+
"aria-label": F(l)("pptx.ai.stop"),
|
|
115
|
+
class: "shrink-0 rounded-sm p-1.5 text-muted-foreground transition-colors hover:bg-accent",
|
|
116
|
+
onClick: t[1] || (t[1] = (e) => s("stop"))
|
|
117
|
+
}, [h(F(ee), { class: "w-4 h-4" })], 8, ve)) : (T(), b("button", {
|
|
118
|
+
key: 1,
|
|
119
|
+
type: "button",
|
|
120
|
+
disabled: !n.value,
|
|
121
|
+
title: F(l)("pptx.ai.send"),
|
|
122
|
+
"aria-label": F(l)("pptx.ai.send"),
|
|
123
|
+
class: P(F(p)("shrink-0 rounded-sm p-1.5 transition-colors", n.value ? "bg-primary text-primary-foreground hover:bg-primary/90" : "text-muted-foreground/50")),
|
|
124
|
+
onClick: d
|
|
125
|
+
}, [h(F(X), { class: "w-4 h-4" })], 10, ye))])]));
|
|
126
|
+
}
|
|
127
|
+
}), ke = { class: "border-b border-border bg-secondary/30" }, we = { class: "flex flex-wrap items-center gap-1 px-2.5 py-1.5" }, Pe = { class: "text-[10px] font-semibold uppercase tracking-wide text-muted-foreground" }, Ce = ["title"], Se = { class: "truncate" }, Te = {
|
|
128
|
+
key: 0,
|
|
129
|
+
class: "rounded-full bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium text-primary"
|
|
130
|
+
}, Ie = { class: "ml-auto flex items-center gap-0.5" }, Ae = [
|
|
131
|
+
"title",
|
|
132
|
+
"aria-label",
|
|
133
|
+
"aria-pressed"
|
|
134
|
+
], _e = ["title", "aria-label"], Ee = ["title", "aria-label"], je = {
|
|
135
|
+
key: 0,
|
|
136
|
+
class: "flex items-center gap-2 border-t border-primary/20 bg-primary/5 px-2.5 py-1"
|
|
137
|
+
}, Fe = { class: "text-[11px] font-medium text-primary" }, Me = k({
|
|
138
|
+
__name: "AiFocusBar",
|
|
139
|
+
props: {
|
|
140
|
+
targets: {},
|
|
141
|
+
slides: {},
|
|
142
|
+
isPinned: { type: Boolean },
|
|
143
|
+
pickMode: { type: Boolean },
|
|
144
|
+
hasPicks: { type: Boolean }
|
|
145
|
+
},
|
|
146
|
+
emits: [
|
|
147
|
+
"pin",
|
|
148
|
+
"clear-pin",
|
|
149
|
+
"start-pick",
|
|
150
|
+
"stop-pick",
|
|
151
|
+
"clear-picks",
|
|
152
|
+
"send-directive"
|
|
153
|
+
],
|
|
154
|
+
setup(t, { emit: a }) {
|
|
155
|
+
const r = t, s = a, { t: l } = e(), o = x(() => c(r.targets, r.slides)), i = x(() => n(r.targets, r.slides));
|
|
156
|
+
function d() {
|
|
157
|
+
const e = i.value;
|
|
158
|
+
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.`);
|
|
159
|
+
}
|
|
160
|
+
return (e, a) => (T(), b("div", ke, [v("div", we, [
|
|
161
|
+
v("span", Pe, j(F(l)("pptx.ai.focusScope")), 1),
|
|
162
|
+
(T(!0), b(m, null, A(o.value, (e) => (T(), b("span", {
|
|
163
|
+
key: e.key,
|
|
164
|
+
class: P(F(p)("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")),
|
|
165
|
+
title: e.title
|
|
166
|
+
}, [v("span", Se, j(e.label), 1)], 10, Ce))), 128)),
|
|
167
|
+
t.isPinned ? (T(), b("span", Te, j(F(l)("pptx.ai.pinnedFocus")), 1)) : f("", !0),
|
|
168
|
+
v("div", Ie, [
|
|
169
|
+
i.value ? (T(), b("button", {
|
|
170
|
+
key: 0,
|
|
171
|
+
type: "button",
|
|
172
|
+
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",
|
|
173
|
+
onClick: d
|
|
174
|
+
}, [h(F(V), { class: "w-3 h-3" }), y(" " + j(F(l)("pptx.ai.mergeSelectedTables")), 1)])) : f("", !0),
|
|
175
|
+
v("button", {
|
|
176
|
+
type: "button",
|
|
177
|
+
title: F(l)("pptx.ai.pickElement"),
|
|
178
|
+
"aria-label": F(l)("pptx.ai.pickAria"),
|
|
179
|
+
"aria-pressed": t.pickMode,
|
|
180
|
+
class: P(F(p)("rounded-sm p-1", t.pickMode ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-accent")),
|
|
181
|
+
onClick: a[0] || (a[0] = (e) => t.pickMode ? s("stop-pick") : s("start-pick"))
|
|
182
|
+
}, [h(F($), { class: "w-3.5 h-3.5" })], 10, Ae),
|
|
183
|
+
t.hasPicks ? (T(), b("button", {
|
|
184
|
+
key: 1,
|
|
185
|
+
type: "button",
|
|
186
|
+
title: F(l)("pptx.ai.pickClear"),
|
|
187
|
+
"aria-label": F(l)("pptx.ai.pickClear"),
|
|
188
|
+
class: "rounded-sm p-1 text-muted-foreground hover:bg-accent",
|
|
189
|
+
onClick: a[1] || (a[1] = (e) => s("clear-picks"))
|
|
190
|
+
}, [h(F(ne), { class: "w-3.5 h-3.5" })], 8, _e)) : (T(), b("button", {
|
|
191
|
+
key: 2,
|
|
192
|
+
type: "button",
|
|
193
|
+
title: t.isPinned ? F(l)("pptx.ai.clearFocus") : F(l)("pptx.ai.pinFocus"),
|
|
194
|
+
"aria-label": t.isPinned ? F(l)("pptx.ai.clearFocus") : F(l)("pptx.ai.pinFocus"),
|
|
195
|
+
class: "rounded-sm p-1 text-muted-foreground hover:bg-accent",
|
|
196
|
+
onClick: a[2] || (a[2] = (e) => t.isPinned ? s("clear-pin") : s("pin"))
|
|
197
|
+
}, [t.isPinned ? (T(), g(F(J), {
|
|
198
|
+
key: 0,
|
|
199
|
+
class: "w-3.5 h-3.5"
|
|
200
|
+
})) : (T(), g(F(G), {
|
|
201
|
+
key: 1,
|
|
202
|
+
class: "w-3.5 h-3.5"
|
|
203
|
+
}))], 8, Ee))
|
|
204
|
+
])
|
|
205
|
+
]), t.pickMode ? (T(), b("div", je, [
|
|
206
|
+
h(F($), { class: "w-3.5 h-3.5 shrink-0 animate-pulse text-primary" }),
|
|
207
|
+
v("span", Fe, j(F(l)("pptx.ai.pickElementHint")), 1),
|
|
208
|
+
v("button", {
|
|
209
|
+
type: "button",
|
|
210
|
+
class: "ml-auto rounded-sm bg-primary px-2 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary/90",
|
|
211
|
+
onClick: a[3] || (a[3] = (e) => s("stop-pick"))
|
|
212
|
+
}, j(F(l)("pptx.ai.pickDone")), 1)
|
|
213
|
+
])) : f("", !0)]));
|
|
214
|
+
}
|
|
215
|
+
}), Be = { class: "text-[12px]" }, Ne = { class: "flex items-center gap-1.5" }, De = {
|
|
216
|
+
key: 0,
|
|
217
|
+
class: "mt-1 pl-5 text-[11px] text-destructive"
|
|
218
|
+
}, Re = {
|
|
219
|
+
key: 1,
|
|
220
|
+
class: "group mt-0.5 pl-5"
|
|
221
|
+
}, We = { class: "cursor-pointer list-none text-[10px] text-muted-foreground/70 hover:text-muted-foreground" }, $e = { class: "mt-0.5 break-words font-mono text-[10px] text-muted-foreground/80" }, ze = k({
|
|
222
|
+
__name: "AiToolCallCard",
|
|
223
|
+
props: { part: {} },
|
|
224
|
+
setup(t) {
|
|
225
|
+
const r = t, { t: s } = e(), o = {
|
|
226
|
+
view: z,
|
|
227
|
+
text: le,
|
|
228
|
+
shape: Y,
|
|
229
|
+
theme: q,
|
|
230
|
+
table: ae,
|
|
231
|
+
slide: K,
|
|
232
|
+
chart: R,
|
|
233
|
+
move: O,
|
|
234
|
+
delete: re,
|
|
235
|
+
search: Q,
|
|
236
|
+
nav: U,
|
|
237
|
+
animation: H,
|
|
238
|
+
notes: te,
|
|
239
|
+
tool: ie
|
|
240
|
+
}, i = x(() => "output-error" === r.part.state), n = x(() => "output-available" === r.part.state), d = x(() => !i.value && !n.value), c = x(() => l(r.part.toolName, r.part.input, d.value ? "present" : "past")), m = x(() => o[c.value.icon] ?? ie), h = x(() => a(r.part.input)), k = x(() => i.value ? s("pptx.ai.toolFailed") : n.value ? s("pptx.ai.toolDone") : s("pptx.ai.toolRunning"));
|
|
241
|
+
return (e, t) => (T(), b("div", Be, [
|
|
242
|
+
v("div", Ne, [
|
|
243
|
+
(T(), g(_(m.value), { class: P(F(p)("w-3.5 h-3.5 shrink-0", i.value ? "text-destructive" : "text-muted-foreground")) }, null, 8, ["class"])),
|
|
244
|
+
v("span", { class: P(F(p)("truncate", i.value ? "text-destructive" : "text-foreground")) }, j(c.value.label), 3),
|
|
245
|
+
v("span", { class: P(F(p)("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" : n.value ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground")) }, [d.value ? (T(), g(F(L), {
|
|
246
|
+
key: 0,
|
|
247
|
+
class: "w-3 h-3 animate-spin"
|
|
248
|
+
})) : n.value ? (T(), g(F(W), {
|
|
249
|
+
key: 1,
|
|
250
|
+
class: "w-3 h-3"
|
|
251
|
+
})) : (T(), g(F(se), {
|
|
252
|
+
key: 2,
|
|
253
|
+
class: "w-3 h-3"
|
|
254
|
+
})), y(" " + j(k.value), 1)], 2)
|
|
255
|
+
]),
|
|
256
|
+
i.value && r.part.errorText ? (T(), b("div", De, j(r.part.errorText), 1)) : f("", !0),
|
|
257
|
+
h.value ? (T(), b("details", Re, [v("summary", We, j(F(s)("pptx.ai.toolDetails")), 1), v("div", $e, j(F(u)(r.part.toolName)) + ": " + j(h.value), 1)])) : f("", !0)
|
|
258
|
+
]));
|
|
259
|
+
}
|
|
260
|
+
}), He = {
|
|
261
|
+
key: 0,
|
|
262
|
+
class: "flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center"
|
|
263
|
+
}, Ve = { class: "text-sm font-medium text-foreground" }, Ke = { class: "text-[12px] text-muted-foreground" }, Le = {
|
|
264
|
+
key: 1,
|
|
265
|
+
class: "flex-1 space-y-3 overflow-y-auto px-3 py-3"
|
|
266
|
+
}, Oe = {
|
|
267
|
+
key: 0,
|
|
268
|
+
class: "flex gap-2"
|
|
269
|
+
}, Ue = ["aria-label"], qe = { class: "min-w-0 flex-1 space-y-1.5" }, Ge = {
|
|
270
|
+
key: 0,
|
|
271
|
+
class: "whitespace-pre-wrap break-words text-[13px] leading-relaxed text-foreground"
|
|
272
|
+
}, Je = {
|
|
273
|
+
key: 0,
|
|
274
|
+
class: "flex items-center gap-2 pl-8 text-[12px] text-muted-foreground"
|
|
275
|
+
}, Qe = k({
|
|
276
|
+
__name: "AiMessageList",
|
|
277
|
+
props: {
|
|
278
|
+
messages: {},
|
|
279
|
+
isStreaming: { type: Boolean }
|
|
280
|
+
},
|
|
281
|
+
setup(t) {
|
|
282
|
+
const a = t, { t: s } = e(), l = I(null);
|
|
283
|
+
return B(() => [a.messages, a.isStreaming], () => {
|
|
284
|
+
w(() => l.value?.scrollIntoView({ block: "end" }));
|
|
285
|
+
}, { deep: !0 }), (e, t) => 0 === a.messages.length ? (T(), b("div", He, [
|
|
286
|
+
h(F(Z), { class: "w-7 h-7 text-primary/70" }),
|
|
287
|
+
v("p", Ve, j(F(s)("pptx.ai.emptyTitle")), 1),
|
|
288
|
+
v("p", Ke, j(F(s)("pptx.ai.emptyHint")), 1)
|
|
289
|
+
])) : (T(), b("div", Le, [
|
|
290
|
+
(T(!0), b(m, null, A(a.messages, (e) => (T(), b(m, { key: e.id }, ["user" === e.role || F(r)(e).length > 0 ? (T(), b("div", Oe, [v("div", {
|
|
291
|
+
class: P(F(p)("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")),
|
|
292
|
+
"aria-label": "user" === e.role ? F(s)("pptx.ai.you") : F(s)("pptx.ai.assistant")
|
|
293
|
+
}, ["user" === e.role ? (T(), g(F(oe), {
|
|
294
|
+
key: 0,
|
|
295
|
+
class: "w-3.5 h-3.5"
|
|
296
|
+
})) : (T(), g(F(D), {
|
|
297
|
+
key: 1,
|
|
298
|
+
class: "w-3.5 h-3.5"
|
|
299
|
+
}))], 10, Ue), v("div", qe, [(T(!0), b(m, null, A(F(r)(e), (e, t) => (T(), b(m, { key: "tool" === e.kind && e.toolCallId || t }, ["text" === e.kind ? (T(), b("p", Ge, j(e.text), 1)) : (T(), g(ze, {
|
|
300
|
+
key: 1,
|
|
301
|
+
part: e
|
|
302
|
+
}, null, 8, ["part"]))], 64))), 128))])])) : f("", !0)], 64))), 128)),
|
|
303
|
+
a.isStreaming ? (T(), b("div", Je, [t[0] || (t[0] = v("span", { class: "inline-flex gap-1" }, [
|
|
304
|
+
v("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.2s]" }),
|
|
305
|
+
v("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.1s]" }),
|
|
306
|
+
v("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground" })
|
|
307
|
+
], -1)), y(" " + j(F(s)("pptx.ai.thinking")), 1)])) : f("", !0),
|
|
308
|
+
v("div", {
|
|
309
|
+
ref_key: "endRef",
|
|
310
|
+
ref: l
|
|
311
|
+
}, null, 512)
|
|
312
|
+
]));
|
|
313
|
+
}
|
|
314
|
+
}), Xe = { class: "rounded-md border border-primary/40 bg-primary/5 p-2.5" }, Ye = { class: "mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-primary" }, Ze = { class: "text-[12px] font-medium text-foreground" }, et = {
|
|
315
|
+
key: 0,
|
|
316
|
+
class: "mt-1 max-h-40 space-y-0.5 overflow-y-auto text-[11px] text-muted-foreground"
|
|
317
|
+
}, tt = { class: "mt-2 flex items-center gap-2" }, at = k({
|
|
318
|
+
__name: "AiProposalCard",
|
|
319
|
+
props: { proposal: {} },
|
|
320
|
+
emits: ["accept", "reject"],
|
|
321
|
+
setup(t, { emit: a }) {
|
|
322
|
+
const r = t, s = a, { t: l } = e(), i = x(() => r.proposal.summary.map(o));
|
|
323
|
+
return (e, t) => (T(), b("div", Xe, [
|
|
324
|
+
v("div", Ye, j(F(l)("pptx.ai.proposedChange")), 1),
|
|
325
|
+
v("div", Ze, j(r.proposal.label), 1),
|
|
326
|
+
i.value.length > 0 ? (T(), b("ul", et, [(T(!0), b(m, null, A(i.value, (e, t) => (T(), b("li", {
|
|
327
|
+
key: t,
|
|
328
|
+
class: "break-words"
|
|
329
|
+
}, j(e), 1))), 128))])) : f("", !0),
|
|
330
|
+
v("div", tt, [v("button", {
|
|
331
|
+
type: "button",
|
|
332
|
+
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",
|
|
333
|
+
onClick: t[0] || (t[0] = (e) => s("accept", r.proposal.id))
|
|
334
|
+
}, [h(F(W), { class: "w-3.5 h-3.5" }), y(" " + j(F(l)("pptx.ai.accept")), 1)]), v("button", {
|
|
335
|
+
type: "button",
|
|
336
|
+
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",
|
|
337
|
+
onClick: t[1] || (t[1] = (e) => s("reject", r.proposal.id))
|
|
338
|
+
}, [h(F(ne), { class: "w-3.5 h-3.5" }), y(" " + j(F(l)("pptx.ai.reject")), 1)])])
|
|
339
|
+
]));
|
|
340
|
+
}
|
|
341
|
+
}), rt = { class: "flex min-h-0 flex-1 flex-col" }, st = {
|
|
342
|
+
key: 0,
|
|
343
|
+
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"
|
|
344
|
+
}, lt = { class: "min-w-0 flex-1" }, ot = { class: "font-medium" }, it = { class: "max-h-24 overflow-y-auto break-words text-[11px] opacity-80" }, nt = {
|
|
345
|
+
key: 1,
|
|
346
|
+
class: "max-h-[38%] space-y-2 overflow-y-auto border-t border-border bg-background px-3 py-2"
|
|
347
|
+
}, pt = { class: "flex items-center justify-between" }, dt = { class: "text-[11px] font-semibold uppercase tracking-wide text-muted-foreground" }, ct = k({
|
|
348
|
+
__name: "AiConversation",
|
|
349
|
+
props: {
|
|
350
|
+
session: {},
|
|
351
|
+
config: {},
|
|
352
|
+
bridge: {},
|
|
353
|
+
aiPanel: {}
|
|
354
|
+
},
|
|
355
|
+
setup(t) {
|
|
356
|
+
const a = t, { t: r } = e(), { messages: s, error: l, isStreaming: o, proposals: i, send: n, stop: p, clearError: d, applyProposal: c, rejectProposal: u, acceptAllProposals: y } = xe(a.session, a.config, { onToolTarget: (e) => {
|
|
357
|
+
e && void 0 !== e.slideIndex && a.bridge.goToSlide(e.slideIndex), a.aiPanel.flashToolTarget(e);
|
|
358
|
+
} }), k = a.session.changeAnimator.subscribe((e) => {
|
|
359
|
+
e && a.bridge.goToSlide(e.slideIndex), a.aiPanel.showChangeBatch(e);
|
|
360
|
+
});
|
|
361
|
+
S(() => k());
|
|
362
|
+
const w = x(() => a.aiPanel.pickTargets.value.length > 0), P = x(() => w.value ? a.aiPanel.pickTargets.value : a.aiPanel.pinnedFocus.value ?? a.aiPanel.liveFocusTargets.value), C = x(() => !w.value && null !== a.aiPanel.pinnedFocus.value);
|
|
363
|
+
function I(e) {
|
|
364
|
+
a.aiPanel.flashToolTarget(null), c(e);
|
|
365
|
+
}
|
|
366
|
+
function _() {
|
|
367
|
+
a.aiPanel.flashToolTarget(null), y();
|
|
368
|
+
}
|
|
369
|
+
return (e, t) => (T(), b("div", rt, [
|
|
370
|
+
h(Me, {
|
|
371
|
+
targets: P.value,
|
|
372
|
+
slides: a.bridge.getSlides(),
|
|
373
|
+
"is-pinned": C.value,
|
|
374
|
+
"pick-mode": a.aiPanel.pickMode.value,
|
|
375
|
+
"has-picks": w.value,
|
|
376
|
+
onPin: a.aiPanel.pinFocus,
|
|
377
|
+
onClearPin: a.aiPanel.clearPinnedFocus,
|
|
378
|
+
onStartPick: a.aiPanel.startPicking,
|
|
379
|
+
onStopPick: a.aiPanel.stopPicking,
|
|
380
|
+
onClearPicks: a.aiPanel.clearPicks,
|
|
381
|
+
onSendDirective: F(n)
|
|
382
|
+
}, null, 8, [
|
|
383
|
+
"targets",
|
|
384
|
+
"slides",
|
|
385
|
+
"is-pinned",
|
|
386
|
+
"pick-mode",
|
|
387
|
+
"has-picks",
|
|
388
|
+
"onPin",
|
|
389
|
+
"onClearPin",
|
|
390
|
+
"onStartPick",
|
|
391
|
+
"onStopPick",
|
|
392
|
+
"onClearPicks",
|
|
393
|
+
"onSendDirective"
|
|
394
|
+
]),
|
|
395
|
+
h(Qe, {
|
|
396
|
+
messages: F(s),
|
|
397
|
+
"is-streaming": F(o)
|
|
398
|
+
}, null, 8, ["messages", "is-streaming"]),
|
|
399
|
+
F(l) ? (T(), b("div", st, [
|
|
400
|
+
h(F(se), { class: "mt-0.5 w-3.5 h-3.5 shrink-0" }),
|
|
401
|
+
v("div", lt, [v("div", ot, j(F(r)("pptx.ai.errorPrefix")), 1), v("div", it, j(F(l).message), 1)]),
|
|
402
|
+
v("button", {
|
|
403
|
+
type: "button",
|
|
404
|
+
class: "shrink-0 rounded-sm px-1.5 py-0.5 text-[11px] underline-offset-2 hover:underline",
|
|
405
|
+
onClick: t[0] || (t[0] = (...e) => F(d) && F(d)(...e))
|
|
406
|
+
}, j(F(r)("pptx.ai.retry")), 1)
|
|
407
|
+
])) : f("", !0),
|
|
408
|
+
F(i).length > 0 ? (T(), b("div", nt, [v("div", pt, [v("span", dt, j(F(r)("pptx.ai.pendingChanges", { count: F(i).length })), 1), F(i).length > 1 ? (T(), b("button", {
|
|
409
|
+
key: 0,
|
|
410
|
+
type: "button",
|
|
411
|
+
class: "rounded-sm bg-primary/90 px-2 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary",
|
|
412
|
+
onClick: _
|
|
413
|
+
}, j(F(r)("pptx.ai.acceptAll")), 1)) : f("", !0)]), (T(!0), b(m, null, A(F(i), (e) => (T(), g(at, {
|
|
414
|
+
key: e.id,
|
|
415
|
+
proposal: e,
|
|
416
|
+
onAccept: I,
|
|
417
|
+
onReject: F(u)
|
|
418
|
+
}, null, 8, ["proposal", "onReject"]))), 128))])) : f("", !0),
|
|
419
|
+
h(he, {
|
|
420
|
+
"is-streaming": F(o),
|
|
421
|
+
"prefill-text": a.aiPanel.prefill.value.text,
|
|
422
|
+
"prefill-nonce": a.aiPanel.prefill.value.nonce,
|
|
423
|
+
onSend: F(n),
|
|
424
|
+
onStop: F(p)
|
|
425
|
+
}, null, 8, [
|
|
426
|
+
"is-streaming",
|
|
427
|
+
"prefill-text",
|
|
428
|
+
"prefill-nonce",
|
|
429
|
+
"onSend",
|
|
430
|
+
"onStop"
|
|
431
|
+
])
|
|
432
|
+
]));
|
|
433
|
+
}
|
|
434
|
+
}), ut = { class: "flex items-center gap-2 border-b border-border px-3 py-2" }, mt = { class: "text-sm font-semibold text-foreground" }, xt = ["title", "aria-label"], gt = {
|
|
435
|
+
key: 0,
|
|
436
|
+
class: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground"
|
|
437
|
+
}, ft = {
|
|
438
|
+
key: 1,
|
|
439
|
+
class: "flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center"
|
|
440
|
+
}, bt = { class: "text-sm font-medium text-foreground" }, vt = { class: "text-[12px] text-muted-foreground" }, yt = k({
|
|
441
|
+
__name: "AiChatPanel",
|
|
442
|
+
props: {
|
|
443
|
+
bridge: {},
|
|
444
|
+
config: {},
|
|
445
|
+
panelWidth: {},
|
|
446
|
+
aiPanel: {}
|
|
447
|
+
},
|
|
448
|
+
emits: ["close"],
|
|
449
|
+
setup(a, { emit: r }) {
|
|
450
|
+
const l = a, o = r, { t: i } = e(), { state: n, session: p, initError: c } = function(e, a) {
|
|
451
|
+
const r = I("checking"), l = E(null), o = E(void 0);
|
|
452
|
+
let i = 0;
|
|
453
|
+
return (async () => {
|
|
454
|
+
const n = ++i;
|
|
455
|
+
r.value = "checking", l.value = null, o.value = void 0;
|
|
456
|
+
try {
|
|
457
|
+
const o = await t();
|
|
458
|
+
if (n !== i) return;
|
|
459
|
+
if (!o) return void (r.value = "unavailable");
|
|
460
|
+
const p = await s(e, a);
|
|
461
|
+
if (n !== i) return;
|
|
462
|
+
l.value = p, r.value = "ready";
|
|
463
|
+
} catch (e) {
|
|
464
|
+
if (n !== i) return;
|
|
465
|
+
o.value = e instanceof Error ? e : new Error(String(e)), r.value = "error";
|
|
466
|
+
}
|
|
467
|
+
})(), {
|
|
468
|
+
state: r,
|
|
469
|
+
session: l,
|
|
470
|
+
initError: o
|
|
471
|
+
};
|
|
472
|
+
}(l.bridge, l.config), u = x(() => l.panelWidth ? { width: `${l.panelWidth}px` } : void 0), m = d({
|
|
473
|
+
activeSlideIndex: I(0),
|
|
474
|
+
selectedElementIds: I([]),
|
|
475
|
+
selectedElement: () => null
|
|
476
|
+
}), y = x(() => l.aiPanel ?? m);
|
|
477
|
+
return (e, t) => (T(), b("div", {
|
|
478
|
+
"data-pptx-ai-panel": "",
|
|
479
|
+
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",
|
|
480
|
+
style: C(u.value)
|
|
481
|
+
}, [v("div", ut, [
|
|
482
|
+
h(F(Z), { class: "w-4 h-4 text-primary" }),
|
|
483
|
+
v("span", mt, j(F(i)("pptx.ai.title")), 1),
|
|
484
|
+
v("button", {
|
|
485
|
+
type: "button",
|
|
486
|
+
title: F(i)("pptx.ai.close"),
|
|
487
|
+
"aria-label": F(i)("pptx.ai.close"),
|
|
488
|
+
class: "ml-auto rounded-sm p-1 text-muted-foreground transition-colors hover:bg-accent",
|
|
489
|
+
onClick: t[0] || (t[0] = (e) => o("close"))
|
|
490
|
+
}, [h(F(ne), { class: "w-4 h-4" })], 8, xt)
|
|
491
|
+
]), "checking" === F(n) ? (T(), b("div", gt, [h(F(L), { class: "w-5 h-5 animate-spin" })])) : "unavailable" === F(n) || "error" === F(n) ? (T(), b("div", ft, [
|
|
492
|
+
h(F(se), { class: "w-6 h-6 text-muted-foreground" }),
|
|
493
|
+
v("p", bt, j(F(i)("pptx.ai.unavailableTitle")), 1),
|
|
494
|
+
v("p", vt, j(F(c)?.message ?? F(i)("pptx.ai.unavailableHint")), 1)
|
|
495
|
+
])) : "ready" === F(n) && F(p) ? (T(), g(ct, {
|
|
496
|
+
key: 2,
|
|
497
|
+
session: F(p),
|
|
498
|
+
config: l.config,
|
|
499
|
+
bridge: l.bridge,
|
|
500
|
+
"ai-panel": y.value
|
|
501
|
+
}, null, 8, [
|
|
502
|
+
"session",
|
|
503
|
+
"config",
|
|
504
|
+
"bridge",
|
|
505
|
+
"ai-panel"
|
|
506
|
+
])) : f("", !0)], 4));
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
export { yt as default };
|
|
Binary file
|
|
Binary file
|