pptx-vue-viewer 1.24.5 → 2.0.1
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 +34 -0
- package/README.md +5 -5
- package/dist/AiChatPanel-CGUiGQHq.cjs +505 -0
- package/dist/AiChatPanel-CGUiGQHq.cjs.br +0 -0
- package/dist/AiChatPanel-CGUiGQHq.cjs.gz +0 -0
- package/dist/AiChatPanel-CiKUwNa7.js +509 -0
- package/dist/AiChatPanel-CiKUwNa7.js.br +0 -0
- package/dist/AiChatPanel-CiKUwNa7.js.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-DFZGfDM5.js → dist-BrPQWoqf.js} +9201 -8237
- package/dist/dist-BrPQWoqf.js.br +0 -0
- package/dist/dist-BrPQWoqf.js.gz +0 -0
- package/dist/{dist-SXQFzd4Z.cjs → dist-CdhFHzWb.cjs} +9301 -8322
- package/dist/dist-CdhFHzWb.cjs.br +0 -0
- package/dist/dist-CdhFHzWb.cjs.gz +0 -0
- package/dist/gif-encoder-5E-yGZpc.cjs +2 -0
- package/dist/gif-encoder-5E-yGZpc.cjs.br +0 -0
- package/dist/gif-encoder-5E-yGZpc.cjs.gz +0 -0
- package/dist/gif-encoder-6ImIq6nV.js +2 -0
- package/dist/gif-encoder-6ImIq6nV.js.br +0 -0
- package/dist/gif-encoder-6ImIq6nV.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-Cod3XnCF.js → useViewerSettingsDialog-BO_xKhyt.js} +6809 -4153
- package/dist/useViewerSettingsDialog-BO_xKhyt.js.br +0 -0
- package/dist/useViewerSettingsDialog-BO_xKhyt.js.gz +0 -0
- package/dist/{useViewerSettingsDialog-D3ICbqio.cjs → useViewerSettingsDialog-DBsbzYgS.cjs} +6840 -4125
- package/dist/useViewerSettingsDialog-DBsbzYgS.cjs.br +0 -0
- package/dist/useViewerSettingsDialog-DBsbzYgS.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/CollaborationCursors.vue.d.ts +17 -10
- package/dist/viewer/components/CollaborationCursors.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/RemoteSelectionOverlay.vue.d.ts +10 -4
- package/dist/viewer/components/RemoteSelectionOverlay.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-Cz4EufQD.cjs +60686 -0
- package/dist/viewer-Cz4EufQD.cjs.br +0 -0
- package/dist/viewer-Cz4EufQD.cjs.gz +0 -0
- package/dist/viewer-zKqroO4K.js +60470 -0
- package/dist/viewer-zKqroO4K.js.br +0 -0
- package/dist/viewer-zKqroO4K.js.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-DFZGfDM5.js.br +0 -0
- package/dist/dist-DFZGfDM5.js.gz +0 -0
- package/dist/dist-SXQFzd4Z.cjs.br +0 -0
- package/dist/dist-SXQFzd4Z.cjs.gz +0 -0
- package/dist/gif-encoder-aUCqeGoI.cjs +0 -2
- package/dist/gif-encoder-aUCqeGoI.cjs.br +0 -0
- package/dist/gif-encoder-aUCqeGoI.cjs.gz +0 -0
- package/dist/gif-encoder-ebFGAdLD.js +0 -2
- package/dist/gif-encoder-ebFGAdLD.js.br +0 -0
- package/dist/gif-encoder-ebFGAdLD.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-Cod3XnCF.js.br +0 -0
- package/dist/useViewerSettingsDialog-Cod3XnCF.js.gz +0 -0
- package/dist/useViewerSettingsDialog-D3ICbqio.cjs.br +0 -0
- package/dist/useViewerSettingsDialog-D3ICbqio.cjs.gz +0 -0
- package/dist/viewer-CS8OK0px.cjs +0 -24946
- package/dist/viewer-CS8OK0px.cjs.br +0 -0
- package/dist/viewer-CS8OK0px.cjs.gz +0 -0
- package/dist/viewer-DEbWIqF4.js +0 -24779
- package/dist/viewer-DEbWIqF4.js.br +0 -0
- package/dist/viewer-DEbWIqF4.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,40 @@ 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.0.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vue-viewer@2.0.0) - 2026-07-23
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- **vue:** Rename unstable subpath to internals and unify collab API (by @ChristopherVR) ([8bcf4e7](https://github.com/ChristopherVR/pptx-viewer/commit/8bcf4e7dbea249b98a746f857830f1243a8bcdb6))
|
|
12
|
+
- **shared:** Ai config, loader and bridge contracts (by @ChristopherVR) ([1c40e28](https://github.com/ChristopherVR/pptx-viewer/commit/1c40e28b1661895e2993b01c11bea6262459cb88))
|
|
13
|
+
- **vue:** Ai bridge and chat session composables (by @ChristopherVR) ([7143ee7](https://github.com/ChristopherVR/pptx-viewer/commit/7143ee767e90acb15813802aecb29afb413bf096))
|
|
14
|
+
- **shared:** Indexeddb-first ai chat history store (by @ChristopherVR) ([88920f2](https://github.com/ChristopherVR/pptx-viewer/commit/88920f20eb00e72b84efa9ef2cb500dfd6d20db4))
|
|
15
|
+
- **shared:** Rebuild AI assistant tools on pptx-viewer-mcp (by @ChristopherVR) ([da1c31e](https://github.com/ChristopherVR/pptx-viewer/commit/da1c31ee88c0b60a82628003c8a1b16245f028ed))
|
|
16
|
+
- **core:** Upgrade emf-converter to 2.0.0 (breaking) (by @ChristopherVR) ([effa4e5](https://github.com/ChristopherVR/pptx-viewer/commit/effa4e5338b2b01796a3671f505bcb4563de74cc))
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
- **build:** Restore pptx-viewer-shared/ai vitest alias after main merge (by @ChristopherVR) ([f878be8](https://github.com/ChristopherVR/pptx-viewer/commit/f878be8dc5b4735081690b691ca30bf3b0264559))
|
|
21
|
+
|
|
22
|
+
### Documentation
|
|
23
|
+
|
|
24
|
+
- Friendly 2.0.0 changelog for root and packages (by @ChristopherVR) ([f56564d](https://github.com/ChristopherVR/pptx-viewer/commit/f56564de0dea3f3aa6f0bdf5ad5ed1bf6e9d4823))
|
|
25
|
+
|
|
26
|
+
### Testing
|
|
27
|
+
|
|
28
|
+
- **shared:** Opt-in live gpt-4o-mini ai integration test (by @ChristopherVR) ([48622f1](https://github.com/ChristopherVR/pptx-viewer/commit/48622f135a5f2ee4c28d97d08478d3c203745f47))
|
|
29
|
+
|
|
30
|
+
### Build & CI
|
|
31
|
+
|
|
32
|
+
- **shared:** Keep the ai SDK external across bindings (by @ChristopherVR) ([fa5e6b7](https://github.com/ChristopherVR/pptx-viewer/commit/fa5e6b77e6586764d9e7717439f574291810e93b))
|
|
33
|
+
- Pin Vue/Angular/Svelte to exact TypeScript 6.0.3 (by @ChristopherVR) ([3d80082](https://github.com/ChristopherVR/pptx-viewer/commit/3d8008282231e1ee4bc11300757d1cc35e8dc174))
|
|
34
|
+
|
|
35
|
+
## [1.24.5](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vue-viewer@1.24.5) - 2026-07-19
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
- **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))
|
|
40
|
+
|
|
7
41
|
## [1.24.4](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vue-viewer@1.24.4) - 2026-07-19
|
|
8
42
|
|
|
9
43
|
## [1.24.3](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vue-viewer@1.24.3) - 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,505 @@
|
|
|
1
|
+
const e = require("./useViewerSettingsDialog-DBsbzYgS.cjs"), t = require("./viewer-Cz4EufQD.cjs");
|
|
2
|
+
let r = require("vue"), o = require("lucide-vue-next"), a = require("@ai-sdk/vue"), n = require("ai");
|
|
3
|
+
var l = /* @__PURE__ */ new Set([
|
|
4
|
+
"input-available",
|
|
5
|
+
"output-available",
|
|
6
|
+
"output-error"
|
|
7
|
+
]);
|
|
8
|
+
function s(e, o, s = {}) {
|
|
9
|
+
const i = (0, r.ref)(e.proposals.list()), c = () => {
|
|
10
|
+
i.value = e.proposals.list();
|
|
11
|
+
}, p = (0, a.useChat)({
|
|
12
|
+
transport: e.transport,
|
|
13
|
+
sendAutomaticallyWhen: e.sendAutomaticallyWhen,
|
|
14
|
+
onError: (e) => o.onError?.(e),
|
|
15
|
+
onToolCall: async ({ toolCall: t }) => {
|
|
16
|
+
const { toolName: r, toolCallId: o, input: a } = t, n = p.addToolOutput;
|
|
17
|
+
try {
|
|
18
|
+
n({
|
|
19
|
+
tool: r,
|
|
20
|
+
toolCallId: o,
|
|
21
|
+
output: await e.executeToolCall(r, a)
|
|
22
|
+
});
|
|
23
|
+
} catch (e) {
|
|
24
|
+
n({
|
|
25
|
+
tool: r,
|
|
26
|
+
toolCallId: o,
|
|
27
|
+
state: "output-error",
|
|
28
|
+
errorText: e instanceof Error ? e.message : String(e)
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
c();
|
|
32
|
+
}
|
|
33
|
+
}), u = (0, r.computed)(() => "submitted" === p.status.value || "streaming" === p.status.value), d = /* @__PURE__ */ new Set();
|
|
34
|
+
(0, r.watch)(p.messages, (e) => {
|
|
35
|
+
for (const r of function(e) {
|
|
36
|
+
const t = [];
|
|
37
|
+
for (const r of e) for (const e of r.parts) {
|
|
38
|
+
if (!(0, n.isToolUIPart)(e) && !(0, n.isDynamicToolUIPart)(e)) continue;
|
|
39
|
+
const r = e, o = r.toolCallId ?? "";
|
|
40
|
+
0 !== o.length && void 0 !== r.input && l.has(r.state ?? "") && t.push({
|
|
41
|
+
toolName: (0, n.getToolOrDynamicToolName)(e),
|
|
42
|
+
toolCallId: o,
|
|
43
|
+
input: r.input
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return t;
|
|
47
|
+
}(e)) d.has(r.toolCallId) || (d.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: u,
|
|
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: (t) => {
|
|
64
|
+
e.proposals.apply(t), c();
|
|
65
|
+
},
|
|
66
|
+
rejectProposal: (t) => {
|
|
67
|
+
e.proposals.revert(t), c();
|
|
68
|
+
},
|
|
69
|
+
acceptAllProposals: () => {
|
|
70
|
+
e.proposals.acceptAll(), c();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
var i = { class: "border-t border-border p-2" }, c = { class: "flex items-end gap-1.5 rounded-md border border-input bg-background px-2 py-1.5 focus-within:border-ring" }, p = ["placeholder", "aria-label"], u = ["title", "aria-label"], d = [
|
|
75
|
+
"disabled",
|
|
76
|
+
"title",
|
|
77
|
+
"aria-label"
|
|
78
|
+
], m = (0, r.defineComponent)({
|
|
79
|
+
__name: "AiComposer",
|
|
80
|
+
props: {
|
|
81
|
+
isStreaming: { type: Boolean },
|
|
82
|
+
prefillText: {},
|
|
83
|
+
prefillNonce: {}
|
|
84
|
+
},
|
|
85
|
+
emits: ["send", "stop"],
|
|
86
|
+
setup(a, { emit: n }) {
|
|
87
|
+
const l = a, s = 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 || (s("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, a) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", i, [(0, r.createElementVNode)("div", c, [(0, r.withDirectives)((0, r.createElementVNode)("textarea", {
|
|
98
|
+
ref_key: "textareaRef",
|
|
99
|
+
ref: x,
|
|
100
|
+
"onUpdate:modelValue": a[0] || (a[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, p), [[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: a[1] || (a[1] = (e) => s("stop"))
|
|
113
|
+
}, [(0, r.createVNode)((0, r.unref)(o.Square), { class: "w-4 h-4" })], 8, u)) : ((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)(o.Send), { class: "w-4 h-4" })], 10, d))])]));
|
|
122
|
+
}
|
|
123
|
+
}), f = { class: "border-b border-border bg-secondary/30" }, x = { class: "flex flex-wrap items-center gap-1 px-2.5 py-1.5" }, g = { class: "text-[10px] font-semibold uppercase tracking-wide text-muted-foreground" }, k = ["title"], y = { class: "truncate" }, b = {
|
|
124
|
+
key: 0,
|
|
125
|
+
class: "rounded-full bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium text-primary"
|
|
126
|
+
}, v = { class: "ml-auto flex items-center gap-0.5" }, h = [
|
|
127
|
+
"title",
|
|
128
|
+
"aria-label",
|
|
129
|
+
"aria-pressed"
|
|
130
|
+
], B = ["title", "aria-label"], E = ["title", "aria-label"], N = {
|
|
131
|
+
key: 0,
|
|
132
|
+
class: "flex items-center gap-2 border-t border-primary/20 bg-primary/5 px-2.5 py-1"
|
|
133
|
+
}, C = { class: "text-[11px] font-medium text-primary" }, V = (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(a, { emit: n }) {
|
|
151
|
+
const l = a, 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 u() {
|
|
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", f, [(0, r.createElementVNode)("div", x, [
|
|
157
|
+
(0, r.createElementVNode)("span", g, (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]", a.hasPicks || a.isPinned ? "bg-primary/15 text-primary" : "bg-muted text-muted-foreground")),
|
|
161
|
+
title: e.title
|
|
162
|
+
}, [(0, r.createElementVNode)("span", y, (0, r.toDisplayString)(e.label), 1)], 10, k))), 128)),
|
|
163
|
+
a.isPinned ? ((0, r.openBlock)(), (0, r.createElementBlock)("span", b, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.pinnedFocus")), 1)) : (0, r.createCommentVNode)("", !0),
|
|
164
|
+
(0, r.createElementVNode)("div", v, [
|
|
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: u
|
|
170
|
+
}, [(0, r.createVNode)((0, r.unref)(o.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": a.pickMode,
|
|
176
|
+
class: (0, r.normalizeClass)((0, r.unref)(t.cn)("rounded-sm p-1", a.pickMode ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-accent")),
|
|
177
|
+
onClick: n[0] || (n[0] = (e) => a.pickMode ? s("stop-pick") : s("start-pick"))
|
|
178
|
+
}, [(0, r.createVNode)((0, r.unref)(o.Crosshair), { class: "w-3.5 h-3.5" })], 10, h),
|
|
179
|
+
a.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)(o.X), { class: "w-3.5 h-3.5" })], 8, B)) : ((0, r.openBlock)(), (0, r.createElementBlock)("button", {
|
|
187
|
+
key: 2,
|
|
188
|
+
type: "button",
|
|
189
|
+
title: a.isPinned ? (0, r.unref)(i)("pptx.ai.clearFocus") : (0, r.unref)(i)("pptx.ai.pinFocus"),
|
|
190
|
+
"aria-label": a.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) => a.isPinned ? s("clear-pin") : s("pin"))
|
|
193
|
+
}, [a.isPinned ? ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(o.PinOff), {
|
|
194
|
+
key: 0,
|
|
195
|
+
class: "w-3.5 h-3.5"
|
|
196
|
+
})) : ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(o.Pin), {
|
|
197
|
+
key: 1,
|
|
198
|
+
class: "w-3.5 h-3.5"
|
|
199
|
+
}))], 8, E))
|
|
200
|
+
])
|
|
201
|
+
]), a.pickMode ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", N, [
|
|
202
|
+
(0, r.createVNode)((0, r.unref)(o.Crosshair), { class: "w-3.5 h-3.5 shrink-0 animate-pulse text-primary" }),
|
|
203
|
+
(0, r.createElementVNode)("span", C, (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: "text-[12px]" }, S = { class: "flex items-center gap-1.5" }, P = {
|
|
212
|
+
key: 0,
|
|
213
|
+
class: "mt-1 pl-5 text-[11px] text-destructive"
|
|
214
|
+
}, T = {
|
|
215
|
+
key: 1,
|
|
216
|
+
class: "group mt-0.5 pl-5"
|
|
217
|
+
}, D = { class: "cursor-pointer list-none text-[10px] text-muted-foreground/70 hover:text-muted-foreground" }, I = { class: "mt-0.5 break-words font-mono text-[10px] text-muted-foreground/80" }, A = (0, r.defineComponent)({
|
|
218
|
+
__name: "AiToolCallCard",
|
|
219
|
+
props: { part: {} },
|
|
220
|
+
setup(a) {
|
|
221
|
+
const n = a, { t: l } = e.useI18n(), s = {
|
|
222
|
+
view: o.Eye,
|
|
223
|
+
text: o.Type,
|
|
224
|
+
shape: o.Shapes,
|
|
225
|
+
theme: o.Palette,
|
|
226
|
+
table: o.Table,
|
|
227
|
+
slide: o.LayoutTemplate,
|
|
228
|
+
chart: o.ChartColumn,
|
|
229
|
+
move: o.Move,
|
|
230
|
+
delete: o.Trash2,
|
|
231
|
+
search: o.Search,
|
|
232
|
+
nav: o.Navigation,
|
|
233
|
+
animation: o.Film,
|
|
234
|
+
notes: o.StickyNote,
|
|
235
|
+
tool: o.Wrench
|
|
236
|
+
}, 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), u = (0, r.computed)(() => t.describeToolActivity(n.part.toolName, n.part.input, p.value ? "present" : "past")), d = (0, r.computed)(() => s[u.value.icon] ?? o.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"));
|
|
237
|
+
return (e, a) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", w, [
|
|
238
|
+
(0, r.createElementVNode)("div", S, [
|
|
239
|
+
((0, r.openBlock)(), (0, r.createBlock)((0, r.resolveDynamicComponent)(d.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"])),
|
|
240
|
+
(0, r.createElementVNode)("span", { class: (0, r.normalizeClass)((0, r.unref)(t.cn)("truncate", i.value ? "text-destructive" : "text-foreground")) }, (0, r.toDisplayString)(u.value.label), 3),
|
|
241
|
+
(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)(o.LoaderCircle), {
|
|
242
|
+
key: 0,
|
|
243
|
+
class: "w-3 h-3 animate-spin"
|
|
244
|
+
})) : c.value ? ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(o.Check), {
|
|
245
|
+
key: 1,
|
|
246
|
+
class: "w-3 h-3"
|
|
247
|
+
})) : ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(o.TriangleAlert), {
|
|
248
|
+
key: 2,
|
|
249
|
+
class: "w-3 h-3"
|
|
250
|
+
})), (0, r.createTextVNode)(" " + (0, r.toDisplayString)(f.value), 1)], 2)
|
|
251
|
+
]),
|
|
252
|
+
i.value && n.part.errorText ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", P, (0, r.toDisplayString)(n.part.errorText), 1)) : (0, r.createCommentVNode)("", !0),
|
|
253
|
+
m.value ? ((0, r.openBlock)(), (0, r.createElementBlock)("details", T, [(0, r.createElementVNode)("summary", D, (0, r.toDisplayString)((0, r.unref)(l)("pptx.ai.toolDetails")), 1), (0, r.createElementVNode)("div", I, (0, r.toDisplayString)((0, r.unref)(t.toolLabel)(n.part.toolName)) + ": " + (0, r.toDisplayString)(m.value), 1)])) : (0, r.createCommentVNode)("", !0)
|
|
254
|
+
]));
|
|
255
|
+
}
|
|
256
|
+
}), F = {
|
|
257
|
+
key: 0,
|
|
258
|
+
class: "flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center"
|
|
259
|
+
}, _ = { class: "text-sm font-medium text-foreground" }, j = { class: "text-[12px] text-muted-foreground" }, z = {
|
|
260
|
+
key: 1,
|
|
261
|
+
class: "flex-1 space-y-3 overflow-y-auto px-3 py-3"
|
|
262
|
+
}, M = {
|
|
263
|
+
key: 0,
|
|
264
|
+
class: "flex gap-2"
|
|
265
|
+
}, L = ["aria-label"], R = { class: "min-w-0 flex-1 space-y-1.5" }, q = {
|
|
266
|
+
key: 0,
|
|
267
|
+
class: "whitespace-pre-wrap break-words text-[13px] leading-relaxed text-foreground"
|
|
268
|
+
}, W = {
|
|
269
|
+
key: 0,
|
|
270
|
+
class: "flex items-center gap-2 pl-8 text-[12px] text-muted-foreground"
|
|
271
|
+
}, U = (0, r.defineComponent)({
|
|
272
|
+
__name: "AiMessageList",
|
|
273
|
+
props: {
|
|
274
|
+
messages: {},
|
|
275
|
+
isStreaming: { type: Boolean }
|
|
276
|
+
},
|
|
277
|
+
setup(a) {
|
|
278
|
+
const n = a, { t: l } = e.useI18n(), s = (0, r.ref)(null);
|
|
279
|
+
return (0, r.watch)(() => [n.messages, n.isStreaming], () => {
|
|
280
|
+
(0, r.nextTick)(() => s.value?.scrollIntoView({ block: "end" }));
|
|
281
|
+
}, { deep: !0 }), (e, a) => 0 === n.messages.length ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", F, [
|
|
282
|
+
(0, r.createVNode)((0, r.unref)(o.Sparkles), { class: "w-7 h-7 text-primary/70" }),
|
|
283
|
+
(0, r.createElementVNode)("p", _, (0, r.toDisplayString)((0, r.unref)(l)("pptx.ai.emptyTitle")), 1),
|
|
284
|
+
(0, r.createElementVNode)("p", j, (0, r.toDisplayString)((0, r.unref)(l)("pptx.ai.emptyHint")), 1)
|
|
285
|
+
])) : ((0, r.openBlock)(), (0, r.createElementBlock)("div", z, [
|
|
286
|
+
((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", M, [(0, r.createElementVNode)("div", {
|
|
287
|
+
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")),
|
|
288
|
+
"aria-label": "user" === e.role ? (0, r.unref)(l)("pptx.ai.you") : (0, r.unref)(l)("pptx.ai.assistant")
|
|
289
|
+
}, ["user" === e.role ? ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(o.User), {
|
|
290
|
+
key: 0,
|
|
291
|
+
class: "w-3.5 h-3.5"
|
|
292
|
+
})) : ((0, r.openBlock)(), (0, r.createBlock)((0, r.unref)(o.Bot), {
|
|
293
|
+
key: 1,
|
|
294
|
+
class: "w-3.5 h-3.5"
|
|
295
|
+
}))], 10, L), (0, r.createElementVNode)("div", R, [((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)(A, {
|
|
296
|
+
key: 1,
|
|
297
|
+
part: e
|
|
298
|
+
}, null, 8, ["part"]))], 64))), 128))])])) : (0, r.createCommentVNode)("", !0)], 64))), 128)),
|
|
299
|
+
n.isStreaming ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", W, [a[0] || (a[0] = (0, r.createElementVNode)("span", { class: "inline-flex gap-1" }, [
|
|
300
|
+
(0, r.createElementVNode)("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.2s]" }),
|
|
301
|
+
(0, r.createElementVNode)("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.1s]" }),
|
|
302
|
+
(0, r.createElementVNode)("span", { class: "h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground" })
|
|
303
|
+
], -1)), (0, r.createTextVNode)(" " + (0, r.toDisplayString)((0, r.unref)(l)("pptx.ai.thinking")), 1)])) : (0, r.createCommentVNode)("", !0),
|
|
304
|
+
(0, r.createElementVNode)("div", {
|
|
305
|
+
ref_key: "endRef",
|
|
306
|
+
ref: s
|
|
307
|
+
}, null, 512)
|
|
308
|
+
]));
|
|
309
|
+
}
|
|
310
|
+
}), $ = { class: "rounded-md border border-primary/40 bg-primary/5 p-2.5" }, H = { class: "mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-primary" }, O = { class: "text-[12px] font-medium text-foreground" }, X = {
|
|
311
|
+
key: 0,
|
|
312
|
+
class: "mt-1 max-h-40 space-y-0.5 overflow-y-auto text-[11px] text-muted-foreground"
|
|
313
|
+
}, K = { class: "mt-2 flex items-center gap-2" }, G = (0, r.defineComponent)({
|
|
314
|
+
__name: "AiProposalCard",
|
|
315
|
+
props: { proposal: {} },
|
|
316
|
+
emits: ["accept", "reject"],
|
|
317
|
+
setup(a, { emit: n }) {
|
|
318
|
+
const l = a, s = n, { t: i } = e.useI18n(), c = (0, r.computed)(() => l.proposal.summary.map(t.humanizeDiffLine));
|
|
319
|
+
return (e, t) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", $, [
|
|
320
|
+
(0, r.createElementVNode)("div", H, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.proposedChange")), 1),
|
|
321
|
+
(0, r.createElementVNode)("div", O, (0, r.toDisplayString)(l.proposal.label), 1),
|
|
322
|
+
c.value.length > 0 ? ((0, r.openBlock)(), (0, r.createElementBlock)("ul", X, [((0, r.openBlock)(!0), (0, r.createElementBlock)(r.Fragment, null, (0, r.renderList)(c.value, (e, t) => ((0, r.openBlock)(), (0, r.createElementBlock)("li", {
|
|
323
|
+
key: t,
|
|
324
|
+
class: "break-words"
|
|
325
|
+
}, (0, r.toDisplayString)(e), 1))), 128))])) : (0, r.createCommentVNode)("", !0),
|
|
326
|
+
(0, r.createElementVNode)("div", K, [(0, r.createElementVNode)("button", {
|
|
327
|
+
type: "button",
|
|
328
|
+
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",
|
|
329
|
+
onClick: t[0] || (t[0] = (e) => s("accept", l.proposal.id))
|
|
330
|
+
}, [(0, r.createVNode)((0, r.unref)(o.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", {
|
|
331
|
+
type: "button",
|
|
332
|
+
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",
|
|
333
|
+
onClick: t[1] || (t[1] = (e) => s("reject", l.proposal.id))
|
|
334
|
+
}, [(0, r.createVNode)((0, r.unref)(o.X), { class: "w-3.5 h-3.5" }), (0, r.createTextVNode)(" " + (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.reject")), 1)])])
|
|
335
|
+
]));
|
|
336
|
+
}
|
|
337
|
+
}), J = { class: "flex min-h-0 flex-1 flex-col" }, Q = {
|
|
338
|
+
key: 0,
|
|
339
|
+
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"
|
|
340
|
+
}, Y = { class: "min-w-0 flex-1" }, Z = { class: "font-medium" }, ee = { class: "max-h-24 overflow-y-auto break-words text-[11px] opacity-80" }, te = {
|
|
341
|
+
key: 1,
|
|
342
|
+
class: "max-h-[38%] space-y-2 overflow-y-auto border-t border-border bg-background px-3 py-2"
|
|
343
|
+
}, re = { class: "flex items-center justify-between" }, oe = { class: "text-[11px] font-semibold uppercase tracking-wide text-muted-foreground" }, ae = (0, r.defineComponent)({
|
|
344
|
+
__name: "AiConversation",
|
|
345
|
+
props: {
|
|
346
|
+
session: {},
|
|
347
|
+
config: {},
|
|
348
|
+
bridge: {},
|
|
349
|
+
aiPanel: {}
|
|
350
|
+
},
|
|
351
|
+
setup(t) {
|
|
352
|
+
const a = t, { t: n } = e.useI18n(), { messages: l, error: i, isStreaming: c, proposals: p, send: u, stop: d, clearError: f, applyProposal: x, rejectProposal: g, acceptAllProposals: k } = s(a.session, a.config, { onToolTarget: (e) => {
|
|
353
|
+
e && void 0 !== e.slideIndex && a.bridge.goToSlide(e.slideIndex), a.aiPanel.flashToolTarget(e);
|
|
354
|
+
} }), y = a.session.changeAnimator.subscribe((e) => {
|
|
355
|
+
e && a.bridge.goToSlide(e.slideIndex), a.aiPanel.showChangeBatch(e);
|
|
356
|
+
});
|
|
357
|
+
(0, r.onBeforeUnmount)(() => y());
|
|
358
|
+
const b = (0, r.computed)(() => a.aiPanel.pickTargets.value.length > 0), v = (0, r.computed)(() => b.value ? a.aiPanel.pickTargets.value : a.aiPanel.pinnedFocus.value ?? a.aiPanel.liveFocusTargets.value), h = (0, r.computed)(() => !b.value && null !== a.aiPanel.pinnedFocus.value);
|
|
359
|
+
function B(e) {
|
|
360
|
+
a.aiPanel.flashToolTarget(null), x(e);
|
|
361
|
+
}
|
|
362
|
+
function E() {
|
|
363
|
+
a.aiPanel.flashToolTarget(null), k();
|
|
364
|
+
}
|
|
365
|
+
return (e, t) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", J, [
|
|
366
|
+
(0, r.createVNode)(V, {
|
|
367
|
+
targets: v.value,
|
|
368
|
+
slides: a.bridge.getSlides(),
|
|
369
|
+
"is-pinned": h.value,
|
|
370
|
+
"pick-mode": a.aiPanel.pickMode.value,
|
|
371
|
+
"has-picks": b.value,
|
|
372
|
+
onPin: a.aiPanel.pinFocus,
|
|
373
|
+
onClearPin: a.aiPanel.clearPinnedFocus,
|
|
374
|
+
onStartPick: a.aiPanel.startPicking,
|
|
375
|
+
onStopPick: a.aiPanel.stopPicking,
|
|
376
|
+
onClearPicks: a.aiPanel.clearPicks,
|
|
377
|
+
onSendDirective: (0, r.unref)(u)
|
|
378
|
+
}, null, 8, [
|
|
379
|
+
"targets",
|
|
380
|
+
"slides",
|
|
381
|
+
"is-pinned",
|
|
382
|
+
"pick-mode",
|
|
383
|
+
"has-picks",
|
|
384
|
+
"onPin",
|
|
385
|
+
"onClearPin",
|
|
386
|
+
"onStartPick",
|
|
387
|
+
"onStopPick",
|
|
388
|
+
"onClearPicks",
|
|
389
|
+
"onSendDirective"
|
|
390
|
+
]),
|
|
391
|
+
(0, r.createVNode)(U, {
|
|
392
|
+
messages: (0, r.unref)(l),
|
|
393
|
+
"is-streaming": (0, r.unref)(c)
|
|
394
|
+
}, null, 8, ["messages", "is-streaming"]),
|
|
395
|
+
(0, r.unref)(i) ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", Q, [
|
|
396
|
+
(0, r.createVNode)((0, r.unref)(o.TriangleAlert), { class: "mt-0.5 w-3.5 h-3.5 shrink-0" }),
|
|
397
|
+
(0, r.createElementVNode)("div", Y, [(0, r.createElementVNode)("div", Z, (0, r.toDisplayString)((0, r.unref)(n)("pptx.ai.errorPrefix")), 1), (0, r.createElementVNode)("div", ee, (0, r.toDisplayString)((0, r.unref)(i).message), 1)]),
|
|
398
|
+
(0, r.createElementVNode)("button", {
|
|
399
|
+
type: "button",
|
|
400
|
+
class: "shrink-0 rounded-sm px-1.5 py-0.5 text-[11px] underline-offset-2 hover:underline",
|
|
401
|
+
onClick: t[0] || (t[0] = (...e) => (0, r.unref)(f) && (0, r.unref)(f)(...e))
|
|
402
|
+
}, (0, r.toDisplayString)((0, r.unref)(n)("pptx.ai.retry")), 1)
|
|
403
|
+
])) : (0, r.createCommentVNode)("", !0),
|
|
404
|
+
(0, r.unref)(p).length > 0 ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", te, [(0, r.createElementVNode)("div", re, [(0, r.createElementVNode)("span", oe, (0, r.toDisplayString)((0, r.unref)(n)("pptx.ai.pendingChanges", { count: (0, r.unref)(p).length })), 1), (0, r.unref)(p).length > 1 ? ((0, r.openBlock)(), (0, r.createElementBlock)("button", {
|
|
405
|
+
key: 0,
|
|
406
|
+
type: "button",
|
|
407
|
+
class: "rounded-sm bg-primary/90 px-2 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary",
|
|
408
|
+
onClick: E
|
|
409
|
+
}, (0, r.toDisplayString)((0, r.unref)(n)("pptx.ai.acceptAll")), 1)) : (0, r.createCommentVNode)("", !0)]), ((0, r.openBlock)(!0), (0, r.createElementBlock)(r.Fragment, null, (0, r.renderList)((0, r.unref)(p), (e) => ((0, r.openBlock)(), (0, r.createBlock)(G, {
|
|
410
|
+
key: e.id,
|
|
411
|
+
proposal: e,
|
|
412
|
+
onAccept: B,
|
|
413
|
+
onReject: (0, r.unref)(g)
|
|
414
|
+
}, null, 8, ["proposal", "onReject"]))), 128))])) : (0, r.createCommentVNode)("", !0),
|
|
415
|
+
(0, r.createVNode)(m, {
|
|
416
|
+
"is-streaming": (0, r.unref)(c),
|
|
417
|
+
"prefill-text": a.aiPanel.prefill.value.text,
|
|
418
|
+
"prefill-nonce": a.aiPanel.prefill.value.nonce,
|
|
419
|
+
onSend: (0, r.unref)(u),
|
|
420
|
+
onStop: (0, r.unref)(d)
|
|
421
|
+
}, null, 8, [
|
|
422
|
+
"is-streaming",
|
|
423
|
+
"prefill-text",
|
|
424
|
+
"prefill-nonce",
|
|
425
|
+
"onSend",
|
|
426
|
+
"onStop"
|
|
427
|
+
])
|
|
428
|
+
]));
|
|
429
|
+
}
|
|
430
|
+
}), ne = { class: "flex items-center gap-2 border-b border-border px-3 py-2" }, le = { class: "text-sm font-semibold text-foreground" }, se = ["title", "aria-label"], ie = {
|
|
431
|
+
key: 0,
|
|
432
|
+
class: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground"
|
|
433
|
+
}, ce = {
|
|
434
|
+
key: 1,
|
|
435
|
+
class: "flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center"
|
|
436
|
+
}, pe = { class: "text-sm font-medium text-foreground" }, ue = { class: "text-[12px] text-muted-foreground" }, de = (0, r.defineComponent)({
|
|
437
|
+
__name: "AiChatPanel",
|
|
438
|
+
props: {
|
|
439
|
+
bridge: {},
|
|
440
|
+
config: {},
|
|
441
|
+
panelWidth: {},
|
|
442
|
+
aiPanel: {}
|
|
443
|
+
},
|
|
444
|
+
emits: ["close"],
|
|
445
|
+
setup(a, { emit: n }) {
|
|
446
|
+
const l = a, s = n, { t: i } = e.useI18n(), { state: c, session: p, initError: u } = function(e, o) {
|
|
447
|
+
const a = (0, r.ref)("checking"), n = (0, r.shallowRef)(null), l = (0, r.shallowRef)(void 0);
|
|
448
|
+
let s = 0;
|
|
449
|
+
return (async () => {
|
|
450
|
+
const r = ++s;
|
|
451
|
+
a.value = "checking", n.value = null, l.value = void 0;
|
|
452
|
+
try {
|
|
453
|
+
const l = await t.isAiAvailable();
|
|
454
|
+
if (r !== s) return;
|
|
455
|
+
if (!l) return void (a.value = "unavailable");
|
|
456
|
+
const i = await t.createAiChatSession(e, o);
|
|
457
|
+
if (r !== s) return;
|
|
458
|
+
n.value = i, a.value = "ready";
|
|
459
|
+
} catch (e) {
|
|
460
|
+
if (r !== s) return;
|
|
461
|
+
l.value = e instanceof Error ? e : new Error(String(e)), a.value = "error";
|
|
462
|
+
}
|
|
463
|
+
})(), {
|
|
464
|
+
state: a,
|
|
465
|
+
session: n,
|
|
466
|
+
initError: l
|
|
467
|
+
};
|
|
468
|
+
}(l.bridge, l.config), d = (0, r.computed)(() => l.panelWidth ? { width: `${l.panelWidth}px` } : void 0), m = t.useAiPanelController({
|
|
469
|
+
activeSlideIndex: (0, r.ref)(0),
|
|
470
|
+
selectedElementIds: (0, r.ref)([]),
|
|
471
|
+
selectedElement: () => null
|
|
472
|
+
}), f = (0, r.computed)(() => l.aiPanel ?? m);
|
|
473
|
+
return (e, t) => ((0, r.openBlock)(), (0, r.createElementBlock)("div", {
|
|
474
|
+
"data-pptx-ai-panel": "",
|
|
475
|
+
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",
|
|
476
|
+
style: (0, r.normalizeStyle)(d.value)
|
|
477
|
+
}, [(0, r.createElementVNode)("div", ne, [
|
|
478
|
+
(0, r.createVNode)((0, r.unref)(o.Sparkles), { class: "w-4 h-4 text-primary" }),
|
|
479
|
+
(0, r.createElementVNode)("span", le, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.title")), 1),
|
|
480
|
+
(0, r.createElementVNode)("button", {
|
|
481
|
+
type: "button",
|
|
482
|
+
title: (0, r.unref)(i)("pptx.ai.close"),
|
|
483
|
+
"aria-label": (0, r.unref)(i)("pptx.ai.close"),
|
|
484
|
+
class: "ml-auto rounded-sm p-1 text-muted-foreground transition-colors hover:bg-accent",
|
|
485
|
+
onClick: t[0] || (t[0] = (e) => s("close"))
|
|
486
|
+
}, [(0, r.createVNode)((0, r.unref)(o.X), { class: "w-4 h-4" })], 8, se)
|
|
487
|
+
]), "checking" === (0, r.unref)(c) ? ((0, r.openBlock)(), (0, r.createElementBlock)("div", ie, [(0, r.createVNode)((0, r.unref)(o.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", ce, [
|
|
488
|
+
(0, r.createVNode)((0, r.unref)(o.TriangleAlert), { class: "w-6 h-6 text-muted-foreground" }),
|
|
489
|
+
(0, r.createElementVNode)("p", pe, (0, r.toDisplayString)((0, r.unref)(i)("pptx.ai.unavailableTitle")), 1),
|
|
490
|
+
(0, r.createElementVNode)("p", ue, (0, r.toDisplayString)((0, r.unref)(u)?.message ?? (0, r.unref)(i)("pptx.ai.unavailableHint")), 1)
|
|
491
|
+
])) : "ready" === (0, r.unref)(c) && (0, r.unref)(p) ? ((0, r.openBlock)(), (0, r.createBlock)(ae, {
|
|
492
|
+
key: 2,
|
|
493
|
+
session: (0, r.unref)(p),
|
|
494
|
+
config: l.config,
|
|
495
|
+
bridge: l.bridge,
|
|
496
|
+
"ai-panel": f.value
|
|
497
|
+
}, null, 8, [
|
|
498
|
+
"session",
|
|
499
|
+
"config",
|
|
500
|
+
"bridge",
|
|
501
|
+
"ai-panel"
|
|
502
|
+
])) : (0, r.createCommentVNode)("", !0)], 4));
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
exports.default = de;
|
|
Binary file
|
|
Binary file
|