pptx-vanilla-viewer 3.2.0 → 3.4.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 CHANGED
@@ -7,6 +7,145 @@ A release listed with no entries carried no Conventional Commit in this package'
7
7
  scope: scripts/release-plan.mjs re-releases a package whenever any of its files
8
8
  change, not only on conventional ones.
9
9
 
10
+ ## [3.3.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@3.3.0) - 2026-09-24
11
+
12
+ ### Features
13
+
14
+ - **shared:** Trace glyph outlines for exact wordart envelope warps (work in progress) (by @ChristopherVR) ([c91f1cf](https://github.com/ChristopherVR/pptx-viewer/commit/c91f1cf2e7c089acf79f706ba49f887179a97499))
15
+ - **core:** Embed round-trip ooxml blobs for rich objects in .ppt export (work in progress) (by @ChristopherVR) ([2f9aea3](https://github.com/ChristopherVR/pptx-viewer/commit/2f9aea35b3887dfb5d3593ecad67a1605889ef00))
16
+ - **core:** Start a per-point diagramml layout engine for smartart (work in progress) (by @ChristopherVR) ([11c956f](https://github.com/ChristopherVR/pptx-viewer/commit/11c956f2c125c1572003129b0d9cd8d2b5ce5f28))
17
+ - **shared:** Add media fullScrn full-slide overlay decision function (by @ChristopherVR) ([8ae8ee1](https://github.com/ChristopherVR/pptx-viewer/commit/8ae8ee150518d89cb5328d98b775eb49983214a2))
18
+ - **core:** Route un-cached SmartArt through the per-point layout engine (by @ChristopherVR) ([e020656](https://github.com/ChristopherVR/pptx-viewer/commit/e020656b042dc9c86efb6588bfe22770870c4280))
19
+ - **core:** Parse InkML per-point T (time) channel into pointTimestamps (by @ChristopherVR) ([af3b954](https://github.com/ChristopherVR/pptx-viewer/commit/af3b9546cec6fc319ab579d035f22fc203de4059))
20
+ - **vanilla:** Wire the fullScrn full-slide media overlay (by @ChristopherVR) ([7f5e392](https://github.com/ChristopherVR/pptx-viewer/commit/7f5e39203d2a2c7ea97b922dc5f0186810d8053a))
21
+ - **core:** Parse zoom return-to-parent and transition duration (work in progress) (by @ChristopherVR) ([5b0c9fb](https://github.com/ChristopherVR/pptx-viewer/commit/5b0c9fbf5bab3b599101b63f7782ebe88411cf79))
22
+ - **core:** Route measurably-better SmartArt layouts through the engine first (by @ChristopherVR) ([59e78c9](https://github.com/ChristopherVR/pptx-viewer/commit/59e78c99c7b9130ca00bb956654cadde2547b575))
23
+ - **core:** Implement the snake algorithm in the SmartArt layout engine (by @ChristopherVR) ([4b27704](https://github.com/ChristopherVR/pptx-viewer/commit/4b27704163ac689f5720de9d0ae1c481eea78fd6))
24
+ - **core:** Implement the cycle algorithm in the SmartArt layout engine (by @ChristopherVR) ([ad971a3](https://github.com/ChristopherVR/pptx-viewer/commit/ad971a3534392a595cb973c0b90609dd3a548921))
25
+ - **shared:** Add PowerPoint editor shortcuts to the shared keymap (by @ChristopherVR) ([9afcb56](https://github.com/ChristopherVR/pptx-viewer/commit/9afcb56d9d71d820d19dfbb78b4c4e7d00cd991e))
26
+ - **shared:** Add a shared PowerPoint font-size ladder stepper (by @ChristopherVR) ([8c86424](https://github.com/ChristopherVR/pptx-viewer/commit/8c864248a3a832996d8b0c0807c47a802d89a776))
27
+ - **vanilla:** Wire PowerPoint editor shortcuts via the shared keymap (by @ChristopherVR) ([a352f98](https://github.com/ChristopherVR/pptx-viewer/commit/a352f98d3ff8b7f3df157f2c3ef4b2eeae5a6ac5))
28
+ - **core:** Parse p14:bounceEnd and play a Fly In bounce settle curve (by @ChristopherVR) ([2c44f37](https://github.com/ChristopherVR/pptx-viewer/commit/2c44f372b5a44ca8a9c87d2d86f84c0d1c49720a))
29
+ - **core:** Model onMediaBookmark triggers and fire them on playback (by @ChristopherVR) ([b153932](https://github.com/ChristopherVR/pptx-viewer/commit/b1539323ae4c063abe869f97c310506161973b10))
30
+ - **core:** Implement the pyra algorithm in the SmartArt layout engine (by @ChristopherVR) ([8dfb1d0](https://github.com/ChristopherVR/pptx-viewer/commit/8dfb1d0a58f75c98d6e24b5470dd82db54d0df76))
31
+ - **shared:** Add the 12 p15 preset transitions to the picker catalogue (by @ChristopherVR) ([9d4cd08](https://github.com/ChristopherVR/pptx-viewer/commit/9d4cd083326627015f290f110035594b547b839d))
32
+
33
+ ### Bug Fixes
34
+
35
+ - **core:** Declare every namespace prefix a saved part uses (by @ChristopherVR) ([bd0a7fc](https://github.com/ChristopherVR/pptx-viewer/commit/bd0a7fca02bbbc4ea8d71f5c2b2970411ab6e971))
36
+ - **core:** Keep run-level slide jumps as slide relationships on save (by @ChristopherVR) ([d2f6924](https://github.com/ChristopherVR/pptx-viewer/commit/d2f6924aeee390a40d11579e9ee6a1d8033ecf1a))
37
+ - **core:** Stop showing chart data labels PowerPoint hides (work in progress) (by @ChristopherVR) ([a8de727](https://github.com/ChristopherVR/pptx-viewer/commit/a8de727868334f822a032b5c11370199dafd6020))
38
+ - **core:** Write valid build lists and effect behaviours for animations (work in progress) (by @ChristopherVR) ([09af92c](https://github.com/ChristopherVR/pptx-viewer/commit/09af92c1085764a49b18b7dfca3d71207c46ec91))
39
+ - **shared:** Halve-width bug in clustered bar/column gap sizing (by @ChristopherVR) ([bfd1953](https://github.com/ChristopherVR/pptx-viewer/commit/bfd19533effd6393d802cd8cbd598cd45d420e19))
40
+ - **core:** Prune custom-show/section refs on slide delete without opts (by @ChristopherVR) ([4046345](https://github.com/ChristopherVR/pptx-viewer/commit/40463456981eae2128d5a18dd0d1b34993d50af4))
41
+ - **shared:** Recover per-paragraph rtl lost to the shape-level default (by @ChristopherVR) ([cc046bf](https://github.com/ChristopherVR/pptx-viewer/commit/cc046bffe37c8445bb99de188636eaacbe4b2c9e))
42
+ - **core:** Stop a bulleted paragraph's marker from shadowing its own algn (by @ChristopherVR) ([3a4307b](https://github.com/ChristopherVR/pptx-viewer/commit/3a4307b1c058b38d21c2518726417c6a72f881f2))
43
+ - **shared:** Combo per-series chart types and stray "-0" axis labels (by @ChristopherVR) ([06f2b41](https://github.com/ChristopherVR/pptx-viewer/commit/06f2b4173c1feb849284f67a3711e28ec9288f3e))
44
+ - **core:** Stop dropping empty self-closing image effect elements (by @ChristopherVR) ([2ee225e](https://github.com/ChristopherVR/pptx-viewer/commit/2ee225e43c93c69f7633f214b1c4e175227ebf8a))
45
+ - **core:** Stop untouched SmartArt colours corrupting on save (by @ChristopherVR) ([fc06842](https://github.com/ChristopherVR/pptx-viewer/commit/fc068425b770c251db1701b604e5ff7b81598b03))
46
+ - **shared:** Use sample (not population) variance for stdDev/stdErr error bars (by @ChristopherVR) ([982c16c](https://github.com/ChristopherVR/pptx-viewer/commit/982c16cb583354001e0455c1247a1bfd15154240))
47
+ - **core:** Fix TS18048 possibly-undefined scope in namespace declarations (by @ChristopherVR) ([a55c718](https://github.com/ChristopherVR/pptx-viewer/commit/a55c718d1738feb360caaf4594018b37faedcfe7))
48
+ - **core:** Resolve spcPct paragraph spacing against 1.2x font size (by @ChristopherVR) ([bca61b4](https://github.com/ChristopherVR/pptx-viewer/commit/bca61b44a1fd2d23505e457de53edb30cadb1e6c))
49
+ - **shared:** Render area-typed combo series as filled areas (by @ChristopherVR) ([54aa4be](https://github.com/ChristopherVR/pptx-viewer/commit/54aa4be9d599cf8413780aee7a0b4cf8672076fe))
50
+ - **core:** Reconcile animation write tests with valid build-list output (by @ChristopherVR) ([ef4e294](https://github.com/ChristopherVR/pptx-viewer/commit/ef4e294c64c58a64e00bdf40c6e582ab79977f9c))
51
+ - **core:** Read back .ppt gradient fills and stop dropping pattern fills (by @ChristopherVR) ([42ded86](https://github.com/ChristopherVR/pptx-viewer/commit/42ded865efef2e040771749f528386e485d0bb99))
52
+ - **shared:** Correct washout/lum brightness-contrast formula (by @ChristopherVR) ([dd28449](https://github.com/ChristopherVR/pptx-viewer/commit/dd2844911ea0c620e749683740580cd33fc10620))
53
+ - **shared:** Decouple metal bevel specular elevation from diffuse (by @ChristopherVR) ([981ef88](https://github.com/ChristopherVR/pptx-viewer/commit/981ef880aa529e759220c828ed7bf7fcd1a8e6de))
54
+ - **shared:** Drive ink replay timing from real InkML timestamps (by @ChristopherVR) ([ab67076](https://github.com/ChristopherVR/pptx-viewer/commit/ab67076f8e794aa4a5fbdece16f5d41a809660da))
55
+ - **shared:** Derive the WordArt can-preset glyph-spacing law from COM (by @ChristopherVR) ([440356d](https://github.com/ChristopherVR/pptx-viewer/commit/440356d62d17fae40ccf0394110161589b6d5e1e))
56
+ - **core:** Resolve a:tblBg fillRef against the theme format scheme (by @ChristopherVR) ([0174572](https://github.com/ChristopherVR/pptx-viewer/commit/01745725a8506b79b5dd812bd0ed46e2ecfd39ce))
57
+ - **core:** Resolve legacy VML-only OLE preview images (by @ChristopherVR) ([98ae67c](https://github.com/ChristopherVR/pptx-viewer/commit/98ae67cbbd3383e529894bd6ea0e93461488f5f4))
58
+ - **vanilla:** Apply highlighter mix-blend-mode per stroke, not per element (by @ChristopherVR) ([e910b68](https://github.com/ChristopherVR/pptx-viewer/commit/e910b68df08c16b8ba69d547447081b4a7033abc))
59
+ - **shared:** Render the table style tblBg background beneath noFill layers (by @ChristopherVR) ([9e4f1e7](https://github.com/ChristopherVR/pptx-viewer/commit/9e4f1e7aea07a487b3052dad1d5628357bdfef46))
60
+ - **shared:** Scale tiled picture fills from the image's native size (work in progress) (by @ChristopherVR) ([92375c4](https://github.com/ChristopherVR/pptx-viewer/commit/92375c470c9c3995f48afc2f22871ffa9609c76c))
61
+ - **core:** Size table cell text from the master other-text style (work in progress) (by @ChristopherVR) ([481c564](https://github.com/ChristopherVR/pptx-viewer/commit/481c5645a5a0e3f930899217308177bea36a5bfa))
62
+ - **core:** Update the OLE in-place-editing compatibility warning (by @ChristopherVR) ([9dd216e](https://github.com/ChristopherVR/pptx-viewer/commit/9dd216edc58e29358e187f62c8ad742d523e578a))
63
+ - **core:** Stop the SmartArt engine dropping hideGeom item-role shapes (by @ChristopherVR) ([9c8c2dc](https://github.com/ChristopherVR/pptx-viewer/commit/9c8c2dce96e7fc1f6faf7ef813deb9095a15ba6b))
64
+ - **core:** Preserve untouched equation XML on save (by @ChristopherVR) ([640bd17](https://github.com/ChristopherVR/pptx-viewer/commit/640bd176246ef43dc510d301017da71d7b5b44ae))
65
+ - **core:** Keep a soft line break from becoming a paragraph break (by @ChristopherVR) ([fbdb209](https://github.com/ChristopherVR/pptx-viewer/commit/fbdb2094f61eadd60fd50656a61d13081d923c07))
66
+ - **core:** Stop reformatting and mutating untouched comment timestamps (by @ChristopherVR) ([bfc92de](https://github.com/ChristopherVR/pptx-viewer/commit/bfc92de9fff54052b9f71f1a72e1a5c4eb83d536))
67
+ - **core:** Write PowerPoint's real behaviour tree for entrance/exit presets (by @ChristopherVR) ([d510300](https://github.com/ChristopherVR/pptx-viewer/commit/d510300729453c1344232efa1cb786790aeeeeae))
68
+ - **core:** Write PowerPoint's real behaviour tree for emphasis presets (by @ChristopherVR) ([0662453](https://github.com/ChristopherVR/pptx-viewer/commit/0662453b747fb4d6099ccdf75531c296b39c055a))
69
+ - **shared:** Render real dates for datetime fields, not the field type (by @ChristopherVR) ([f3653c2](https://github.com/ChristopherVR/pptx-viewer/commit/f3653c2665b0675ad4a50bfee5dc2e8eae7ba3af))
70
+ - **shared:** Apply theme per-script fonts over a run's cascaded font (by @ChristopherVR) ([0a00208](https://github.com/ChristopherVR/pptx-viewer/commit/0a00208cc553eb91b2f96292b1690fdb252f743d))
71
+ - **shared:** Keep gradient/pattern text fills continuous, not per-word (by @ChristopherVR) ([cf05400](https://github.com/ChristopherVR/pptx-viewer/commit/cf054000044540c233e49e6aaae590ff059f15f9))
72
+ - **core:** Resolve buBlip picture-bullet images after slide parsing (by @ChristopherVR) ([beb20b5](https://github.com/ChristopherVR/pptx-viewer/commit/beb20b59eaa3ec93d7f8c164d5fea58bd32aaceb))
73
+ - **shared:** Apply brightness scaled by contrast in a:lum luminance (by @ChristopherVR) ([e55b28a](https://github.com/ChristopherVR/pptx-viewer/commit/e55b28a2042b506562f8edb9759210f2f15a8097))
74
+ - **core:** Parse and render table-style band fill alpha (by @ChristopherVR) ([69f124a](https://github.com/ChristopherVR/pptx-viewer/commit/69f124a84fb962b346718c75dac99f7708a30c06))
75
+ - **shared:** Stop clipping a table whose rows auto-grow past its frame (by @ChristopherVR) ([ad4ebb2](https://github.com/ChristopherVR/pptx-viewer/commit/ad4ebb2e91bd9c4c4adfe5c2bcc6fc9aa1aa3d9c))
76
+ - **core,shared:** Settle table-style fill alpha on one unit (by @ChristopherVR) ([afa50de](https://github.com/ChristopherVR/pptx-viewer/commit/afa50de2a7e5f314fed908a196244c886e67641a))
77
+ - **shared:** Stop a "repeat until next click" loop on the next click (by @ChristopherVR) ([c92d667](https://github.com/ChristopherVR/pptx-viewer/commit/c92d66751c94388a0aac9d0dd172fe880db89d54))
78
+ - **shared:** Honour presetSubtype for Blinds, Checkerboard, Wheel, Random Bars (by @ChristopherVR) ([000efbe](https://github.com/ChristopherVR/pptx-viewer/commit/000efbea966863276d6275ac3ca68ccae3b5e6f9))
79
+ - **shared:** Draw stock HLC/OHLC candles per PowerPoint semantics (by @ChristopherVR) ([7ecb42b](https://github.com/ChristopherVR/pptx-viewer/commit/7ecb42b628b32622f98780f6e18b9e9881bbf68a))
80
+ - **shared:** Correct trendline math, formatting and legend (by @ChristopherVR) ([91cc3c8](https://github.com/ChristopherVR/pptx-viewer/commit/91cc3c8a4c2008726f03f598984133882736f643))
81
+ - **shared:** Scale a scatter/bubble chart's X axis like Excel (by @ChristopherVR) ([16a3e4d](https://github.com/ChristopherVR/pptx-viewer/commit/16a3e4df35b97e2983e4ee394257a280a50b4bf9))
82
+ - **shared,core:** Map animation preset 30 to Float, not Spinner (by @ChristopherVR) ([e98152e](https://github.com/ChristopherVR/pptx-viewer/commit/e98152eee7a756ec205ee370525baec146f1dedb))
83
+ - **core:** Read the pyramid composite ctrX/w fill idiom as a fraction (by @ChristopherVR) ([9cf9fd9](https://github.com/ChristopherVR/pptx-viewer/commit/9cf9fd9aad6f856862fa431236d3697f42f87886))
84
+ - **core:** Stop pinning inherited bodyPr onto untouched shapes on save (by @ChristopherVR) ([7f35589](https://github.com/ChristopherVR/pptx-viewer/commit/7f35589094588355579da4b21c2e2ff654eaf847))
85
+ - **core:** Stop pinning master bullets and dropping bullet inherit markers (by @ChristopherVR) ([c406fa9](https://github.com/ChristopherVR/pptx-viewer/commit/c406fa986723ba69b5c29006fa509c90ee7cbbdd))
86
+ - **core:** Stop flattening master text-style aliases on every save (by @ChristopherVR) ([1cdd778](https://github.com/ChristopherVR/pptx-viewer/commit/1cdd778ec42288d548b442a89e5b3bcd4cfcec0b))
87
+ - **core:** Mirror the master/layout p:bgRef guard onto slide rewrite (by @ChristopherVR) ([670d106](https://github.com/ChristopherVR/pptx-viewer/commit/670d10694a18089a383084dbc00127f5c03d78d4))
88
+ - **shared:** Correct CSS mapping for vert/vert270/wordArt vertical text (by @ChristopherVR) ([fce308c](https://github.com/ChristopherVR/pptx-viewer/commit/fce308c093640f49adb05efb4e9aa6bb9f2cb1cd))
89
+ - **shared:** Honour numCol column-fill, @anchor and @rtlCol (by @ChristopherVR) ([f380f53](https://github.com/ChristopherVR/pptx-viewer/commit/f380f531f976c3769db27d45181c9aff1173e6e3))
90
+ - **shared:** Distribute the last line and single lines for algn="dist" (by @ChristopherVR) ([730ced1](https://github.com/ChristopherVR/pptx-viewer/commit/730ced1fff583a222f89d8ee28f775aa5eb2ff6e))
91
+ - **shared:** Size a paragraph's line-height strut on its smallest run (by @ChristopherVR) ([940137d](https://github.com/ChristopherVR/pptx-viewer/commit/940137d6cc16d468c8fcaeb154c97eb69384e6ca))
92
+ - **shared:** Centre anchorCtr as one shared box, not per-paragraph (by @ChristopherVR) ([5982d91](https://github.com/ChristopherVR/pptx-viewer/commit/5982d917abb062676596ac6976b7df9b70b26222))
93
+ - **core,shared:** Stop empty auto-numbered paragraphs consuming a number and marR being dropped (by @ChristopherVR) ([b163cad](https://github.com/ChristopherVR/pptx-viewer/commit/b163cad85630772903e01954d05987c9e6dbaa5d))
94
+ - **core:** Stretch SVG picture fills instead of squashing srcRect crops (by @ChristopherVR) ([096794f](https://github.com/ChristopherVR/pptx-viewer/commit/096794fbca013f1a1cc5432c8dec82ccc0f9a419))
95
+ - **shared:** Play exit preset 30 (Float Out) with the existing fade-out approximation (by @ChristopherVR) ([c128d23](https://github.com/ChristopherVR/pptx-viewer/commit/c128d230d2ab28bb63f3d7f15e688199721291f9))
96
+ - **angular,core,shared:** Finish View > Normal and zoom field wiring after rebase (by @ChristopherVR) ([df6bddf](https://github.com/ChristopherVR/pptx-viewer/commit/df6bddf25bcde10b0153ffb3f0bd33491b065291))
97
+
98
+ ### Documentation
99
+
100
+ - **core:** Restate the SmartArt interpreter gate with measured numbers (by @ChristopherVR) ([8d706b9](https://github.com/ChristopherVR/pptx-viewer/commit/8d706b99802292414adc9a9da663d9320b08bf81))
101
+
102
+ ### Testing
103
+
104
+ - **core:** Re-anchor coverage evidence to the renamed build-list tests (by @ChristopherVR) ([a1b26e5](https://github.com/ChristopherVR/pptx-viewer/commit/a1b26e592d7059e2bcf9384f97ec37b031338778))
105
+ - **core:** Cover attribute-less grayscl parsing in image colour effects (by @ChristopherVR) ([5588bec](https://github.com/ChristopherVR/pptx-viewer/commit/5588bec9a354bc54360c6f352ddb4fe8a5cb2ee1))
106
+ - **core:** Register the new table-row-autogrow.pptx fixture (by @ChristopherVR) ([e1cebe9](https://github.com/ChristopherVR/pptx-viewer/commit/e1cebe93462cf4e6e351824c931a80fdda3480f4))
107
+ - **core:** Cover the notes master save path for text-less anchor loss (by @ChristopherVR) ([8bed413](https://github.com/ChristopherVR/pptx-viewer/commit/8bed413605f9408ab28864659ca5e81da035c0e0))
108
+ - **core:** Add extractOwnBackgroundRefNode to mocked loader params (by @ChristopherVR) ([8056d5a](https://github.com/ChristopherVR/pptx-viewer/commit/8056d5a7a19e4aa198e1726cfce01719bfe67473))
109
+
110
+ ### Dependencies
111
+
112
+ - **deps:** Update emf-converter to 3.1.0 (by @ChristopherVR) ([5eac42f](https://github.com/ChristopherVR/pptx-viewer/commit/5eac42f20a2d783574ab5f40640238c0e42bf744))
113
+ - **deps:** Update emf-converter to 3.2.0 (by @ChristopherVR) ([bc37b25](https://github.com/ChristopherVR/pptx-viewer/commit/bc37b256dd8c0b93e03c451144562c6e466c25c9))
114
+ - **deps:** Update emf-converter to 3.3.0 (by @ChristopherVR) ([9c83a17](https://github.com/ChristopherVR/pptx-viewer/commit/9c83a17478fbc634e2da9c8cdcbadc956a8dd2eb))
115
+
116
+ ## [3.2.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@3.2.0) - 2026-09-24
117
+
118
+ ### Features
119
+
120
+ - **shared:** Add pptx-three-view host with one shared WebGL context (by @ChristopherVR) ([aaaf21d](https://github.com/ChristopherVR/pptx-viewer/commit/aaaf21d56e5baad79f9e7327029811e95c55d781))
121
+ - **shared:** Wire chart-events, view-spec, and export snapshot for pptx-three-view (by @ChristopherVR) ([089738a](https://github.com/ChristopherVR/pptx-viewer/commit/089738a19e443bc08c3c7576b81f28bef236ec0c))
122
+ - **core:** Parse 3D scene/extrusion for cached SmartArt drawing shapes (by @ChristopherVR) ([e80b086](https://github.com/ChristopherVR/pptx-viewer/commit/e80b086ada646f9786510e43f7e11f705eebe77c))
123
+ - **shared:** Add pure chart-3d projection + flat-shading resolvers (by @ChristopherVR) ([117cfc5](https://github.com/ChristopherVR/pptx-viewer/commit/117cfc5d4e355394565a8ca935c6d970a460cc1a))
124
+ - **shared:** Build a real Chart3DSpec for bar3D (clustered/stacked) (by @ChristopherVR) ([7df9a11](https://github.com/ChristopherVR/pptx-viewer/commit/7df9a1137e5b75333dcb376147af04c0dcb6082d))
125
+ - **shared:** Add the 3D chart's SVG chrome overlay renderer (by @ChristopherVR) ([635aea0](https://github.com/ChristopherVR/pptx-viewer/commit/635aea0e896d4fb5c2592627d62147a37ff54313))
126
+ - **shared:** Render flat SmartArt quick styles from the cached drawing (by @ChristopherVR) ([bb89b9b](https://github.com/ChristopherVR/pptx-viewer/commit/bb89b9bddd6b3f696143164665f9539257cc057c))
127
+ - **shared:** Implement mountChart3DView for oblique bar3D boxes (by @ChristopherVR) ([4cbb870](https://github.com/ChristopherVR/pptx-viewer/commit/4cbb8700cb579510177591cd0b16697ecdf6c2ab))
128
+ - **shared:** Host every 3D chart kind in pptx-three-view (by @claude) ([d8a3019](https://github.com/ChristopherVR/pptx-viewer/commit/d8a3019259327557b331bf9ff456909573eda552))
129
+ - **vue:** Render 3D charts and SmartArt through <pptx-three-view> (by @claude) ([5a35348](https://github.com/ChristopherVR/pptx-viewer/commit/5a35348748e78b49c4e5150843b3bd2797bae0d7))
130
+ - **vanilla:** Render 3D charts and SmartArt through <pptx-three-view> (by @claude) ([b7f6200](https://github.com/ChristopherVR/pptx-viewer/commit/b7f6200fbc2540c20538ff9899a04ac0ae346cfb))
131
+ - **shared:** Use web components for search, select, and checkbox controls ([#352](https://github.com/ChristopherVR/pptx-viewer/issues/352)) (by @yunfeizhu) ([e09b47a](https://github.com/ChristopherVR/pptx-viewer/commit/e09b47a6e7c94e170d4fe9c87774d11619da776d))
132
+
133
+ ### Bug Fixes
134
+
135
+ - **shared:** Draw PowerPoint's auto title for a c:title without text (by @claude) ([dd3c6f0](https://github.com/ChristopherVR/pptx-viewer/commit/dd3c6f0165a6d60305ac0e93ec6548707d351ee5))
136
+ - **vue,svelte,vanilla:** Arm the 3D chart scene only on a selected chart (by @claude) ([192fc8e](https://github.com/ChristopherVR/pptx-viewer/commit/192fc8e959140d9a33ecb2bba5eb43a9875f387a))
137
+ - **shared:** Keep surfaceChart3D covering 2D surface charts (by @claude) ([b208414](https://github.com/ChristopherVR/pptx-viewer/commit/b2084147636006d0791d3dc43e98ed1a52d00a74))
138
+
139
+ ### Refactor
140
+
141
+ - **shared:** Extract the chart view-model DOM renderer to shared (by @ChristopherVR) ([9ff7298](https://github.com/ChristopherVR/pptx-viewer/commit/9ff7298ba49049def9c910c54ef7564b28ee16d1))
142
+ - **shared:** Move the extracted chart DOM renderer into shared (by @ChristopherVR) ([0d850d4](https://github.com/ChristopherVR/pptx-viewer/commit/0d850d4015b30bf2d7f92ca8bfd093839d18c5dd))
143
+ - **shared:** Remove the pre-element SmartArt scene runtime (by @claude) ([a2bd6c1](https://github.com/ChristopherVR/pptx-viewer/commit/a2bd6c18beba4ad8e3769a71e04f3cb08fee3d99))
144
+
145
+ ### Testing
146
+
147
+ - **shared:** Cover the three-view host, controller and sizing (by @ChristopherVR) ([ad42c24](https://github.com/ChristopherVR/pptx-viewer/commit/ad42c248a07e7f297a5e47076c325bbd456417b6))
148
+
10
149
  ## [3.1.6](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@3.1.6) - 2026-09-23
11
150
 
12
151
  ### Bug Fixes
@@ -1 +1 @@
1
- 'use strict';var chunkSTTHTBBT_cjs=require('./chunk-STTHTBBT.cjs');require('./chunk-HUS3377F.cjs'),require('./chunk-B5PFHICE.cjs');function K(o){let{doc:t,t:n,controller:i}=o,a=chunkSTTHTBBT_cjs.w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=chunkSTTHTBBT_cjs.w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(chunkSTTHTBBT_cjs.K(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l=i.isPinned(),s=i.isPicking(),g=chunkSTTHTBBT_cjs.w(t,"div","pptxv-ai-focus-row"),f=chunkSTTHTBBT_cjs.w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of chunkSTTHTBBT_cjs.j(p,o.getSlides())){let b=chunkSTTHTBBT_cjs.w(t,"span","pptxv-ai-focus-chip");(m||l)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l){let r=chunkSTTHTBBT_cjs.w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=chunkSTTHTBBT_cjs.w(t,"div","pptxv-ai-focus-actions"),d=chunkSTTHTBBT_cjs.k(p,o.getSlides());if(d){let r=chunkSTTHTBBT_cjs.w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(chunkSTTHTBBT_cjs.K(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(chunkSTTHTBBT_cjs.l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=chunkSTTHTBBT_cjs.w(t,"div","pptxv-ai-focus-pick"),b=chunkSTTHTBBT_cjs.K(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=chunkSTTHTBBT_cjs.w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=chunkSTTHTBBT_cjs.w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n}=o,i=chunkSTTHTBBT_cjs.w(t,"button","pptxv-ai-chats");i.type="button",i.append(chunkSTTHTBBT_cjs.K(t,"history"),t.createTextNode(n("pptx.ai.chats")));let a=chunkSTTHTBBT_cjs.w(t,"div","pptxv-ai-history");a.hidden=true;let h=chunkSTTHTBBT_cjs.w(t,"div","pptxv-ai-history-head"),x=chunkSTTHTBBT_cjs.w(t,"span","pptxv-ai-history-title");x.textContent=n("pptx.ai.historyTitle");let c=chunkSTTHTBBT_cjs.w(t,"button","pptxv-ai-history-new");c.type="button",c.append(chunkSTTHTBBT_cjs.K(t,"plus"),t.createTextNode(n("pptx.ai.newChat"))),h.append(x,c);let p=chunkSTTHTBBT_cjs.w(t,"div","pptxv-ai-history-body"),m=chunkSTTHTBBT_cjs.w(t,"p","pptxv-ai-history-hint");m.textContent=n("pptx.ai.historyHint"),a.append(h,p,m);let l=chunkSTTHTBBT_cjs.n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=chunkSTTHTBBT_cjs.w(t,"p","pptxv-ai-history-empty");d.textContent=n("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=chunkSTTHTBBT_cjs.w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=chunkSTTHTBBT_cjs.w(t,"li","pptxv-ai-history-row"),r=chunkSTTHTBBT_cjs.w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=chunkSTTHTBBT_cjs.w(t,"span","pptxv-ai-history-text"),k=chunkSTTHTBBT_cjs.w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n("pptx.ai.untitledChat");let T=chunkSTTHTBBT_cjs.w(t,"span","pptxv-ai-history-meta");T.textContent=n("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(chunkSTTHTBBT_cjs.K(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=chunkSTTHTBBT_cjs.w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n("pptx.ai.deleteChat"),P.setAttribute("aria-label",n("pptx.ai.deleteChat")),P.appendChild(chunkSTTHTBBT_cjs.K(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=chunkSTTHTBBT_cjs.s(t.toolName,t.input,h?"present":"past"),c=chunkSTTHTBBT_cjs.w(o,"div","pptxv-ai-tool"),p=chunkSTTHTBBT_cjs.w(o,"div","pptxv-ai-tool-head"),m=chunkSTTHTBBT_cjs.K(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=chunkSTTHTBBT_cjs.w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s=chunkSTTHTBBT_cjs.w(o,"span","pptxv-ai-tool-state");if(i?(s.classList.add("is-error"),s.append(chunkSTTHTBBT_cjs.K(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s.classList.add("is-done"),s.append(chunkSTTHTBBT_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s.classList.add("is-running"),s.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s),c.appendChild(p),i&&t.errorText){let f=chunkSTTHTBBT_cjs.w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=chunkSTTHTBBT_cjs.r(t.input);if(g){let f=chunkSTTHTBBT_cjs.w(o,"details","pptxv-ai-tool-details"),C=chunkSTTHTBBT_cjs.w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=chunkSTTHTBBT_cjs.w(o,"div","pptxv-ai-tool-raw");d.textContent=`${chunkSTTHTBBT_cjs.q(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=chunkSTTHTBBT_cjs.f(a);if(x.length===0&&!h)continue;let c=chunkSTTHTBBT_cjs.w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=chunkSTTHTBBT_cjs.w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(chunkSTTHTBBT_cjs.K(o,h?"comment":"sparkles"));let m=chunkSTTHTBBT_cjs.w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=chunkSTTHTBBT_cjs.w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=chunkSTTHTBBT_cjs.w(o,"div","pptxv-ai-proposals-header"),x=chunkSTTHTBBT_cjs.w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=chunkSTTHTBBT_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=chunkSTTHTBBT_cjs.w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=chunkSTTHTBBT_cjs.w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=chunkSTTHTBBT_cjs.w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=chunkSTTHTBBT_cjs.w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=chunkSTTHTBBT_cjs.w(o,"li");g.textContent=chunkSTTHTBBT_cjs.c(s),l.appendChild(g);}a.appendChild(l);}let c=chunkSTTHTBBT_cjs.w(o,"div","pptxv-ai-proposal-actions"),p=chunkSTTHTBBT_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(chunkSTTHTBBT_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=chunkSTTHTBBT_cjs.w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(chunkSTTHTBBT_cjs.K(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c.append(p,m),a.appendChild(c),a}async function wt(o){let{doc:t,host:n,t:i}=o;n.replaceChildren();let a=chunkSTTHTBBT_cjs.w(t,"div","pptxv-ai-header"),h=chunkSTTHTBBT_cjs.w(t,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=chunkSTTHTBBT_cjs.w(t,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(chunkSTTHTBBT_cjs.K(t,"close")),x.addEventListener("click",()=>o.onClose?.()),a.append(chunkSTTHTBBT_cjs.K(t,"sparkles"),h,x);let c,p=o.controller,m=p?K({doc:t,t:i,controller:p,getSlides:()=>o.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=chunkSTTHTBBT_cjs.w(t,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=chunkSTTHTBBT_cjs.w(t,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=chunkSTTHTBBT_cjs.w(t,"div","pptxv-ai-proposals");g.hidden=true;let f=chunkSTTHTBBT_cjs.w(t,"div","pptxv-ai-error");f.setAttribute("role","alert"),f.hidden=true;let C=chunkSTTHTBBT_cjs.w(t,"form","pptxv-ai-composer"),d=chunkSTTHTBBT_cjs.w(t,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=chunkSTTHTBBT_cjs.w(t,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(chunkSTTHTBBT_cjs.K(t,"send")),C.append(d,y),n.append(a,...m?[m.el]:[],l,g,f,C);try{c=await(o.createChat??chunkSTTHTBBT_cjs.o)({bridge:o.bridge,config:o.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t,t:i,deckId:chunkSTTHTBBT_cjs.m(o.bridge),store:o.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>chunkSTTHTBBT_cjs.f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=chunkSTTHTBBT_cjs.t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f.hidden=!u.error,f.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m?.destroy(),n.replaceChildren();}}}exports.createAiPanel=wt;
1
+ 'use strict';var chunkDCFIS6IJ_cjs=require('./chunk-DCFIS6IJ.cjs');require('./chunk-TOWHSYAL.cjs'),require('./chunk-B5PFHICE.cjs');function K(o){let{doc:t,t:n,controller:i}=o,a=chunkDCFIS6IJ_cjs.w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=chunkDCFIS6IJ_cjs.w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(chunkDCFIS6IJ_cjs.K(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l=i.isPinned(),s=i.isPicking(),g=chunkDCFIS6IJ_cjs.w(t,"div","pptxv-ai-focus-row"),f=chunkDCFIS6IJ_cjs.w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of chunkDCFIS6IJ_cjs.j(p,o.getSlides())){let b=chunkDCFIS6IJ_cjs.w(t,"span","pptxv-ai-focus-chip");(m||l)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l){let r=chunkDCFIS6IJ_cjs.w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=chunkDCFIS6IJ_cjs.w(t,"div","pptxv-ai-focus-actions"),d=chunkDCFIS6IJ_cjs.k(p,o.getSlides());if(d){let r=chunkDCFIS6IJ_cjs.w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(chunkDCFIS6IJ_cjs.K(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(chunkDCFIS6IJ_cjs.l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=chunkDCFIS6IJ_cjs.w(t,"div","pptxv-ai-focus-pick"),b=chunkDCFIS6IJ_cjs.K(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=chunkDCFIS6IJ_cjs.w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=chunkDCFIS6IJ_cjs.w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n}=o,i=chunkDCFIS6IJ_cjs.w(t,"button","pptxv-ai-chats");i.type="button",i.append(chunkDCFIS6IJ_cjs.K(t,"history"),t.createTextNode(n("pptx.ai.chats")));let a=chunkDCFIS6IJ_cjs.w(t,"div","pptxv-ai-history");a.hidden=true;let h=chunkDCFIS6IJ_cjs.w(t,"div","pptxv-ai-history-head"),x=chunkDCFIS6IJ_cjs.w(t,"span","pptxv-ai-history-title");x.textContent=n("pptx.ai.historyTitle");let c=chunkDCFIS6IJ_cjs.w(t,"button","pptxv-ai-history-new");c.type="button",c.append(chunkDCFIS6IJ_cjs.K(t,"plus"),t.createTextNode(n("pptx.ai.newChat"))),h.append(x,c);let p=chunkDCFIS6IJ_cjs.w(t,"div","pptxv-ai-history-body"),m=chunkDCFIS6IJ_cjs.w(t,"p","pptxv-ai-history-hint");m.textContent=n("pptx.ai.historyHint"),a.append(h,p,m);let l=chunkDCFIS6IJ_cjs.n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=chunkDCFIS6IJ_cjs.w(t,"p","pptxv-ai-history-empty");d.textContent=n("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=chunkDCFIS6IJ_cjs.w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=chunkDCFIS6IJ_cjs.w(t,"li","pptxv-ai-history-row"),r=chunkDCFIS6IJ_cjs.w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=chunkDCFIS6IJ_cjs.w(t,"span","pptxv-ai-history-text"),k=chunkDCFIS6IJ_cjs.w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n("pptx.ai.untitledChat");let T=chunkDCFIS6IJ_cjs.w(t,"span","pptxv-ai-history-meta");T.textContent=n("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(chunkDCFIS6IJ_cjs.K(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=chunkDCFIS6IJ_cjs.w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n("pptx.ai.deleteChat"),P.setAttribute("aria-label",n("pptx.ai.deleteChat")),P.appendChild(chunkDCFIS6IJ_cjs.K(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=chunkDCFIS6IJ_cjs.s(t.toolName,t.input,h?"present":"past"),c=chunkDCFIS6IJ_cjs.w(o,"div","pptxv-ai-tool"),p=chunkDCFIS6IJ_cjs.w(o,"div","pptxv-ai-tool-head"),m=chunkDCFIS6IJ_cjs.K(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=chunkDCFIS6IJ_cjs.w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s=chunkDCFIS6IJ_cjs.w(o,"span","pptxv-ai-tool-state");if(i?(s.classList.add("is-error"),s.append(chunkDCFIS6IJ_cjs.K(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s.classList.add("is-done"),s.append(chunkDCFIS6IJ_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s.classList.add("is-running"),s.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s),c.appendChild(p),i&&t.errorText){let f=chunkDCFIS6IJ_cjs.w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=chunkDCFIS6IJ_cjs.r(t.input);if(g){let f=chunkDCFIS6IJ_cjs.w(o,"details","pptxv-ai-tool-details"),C=chunkDCFIS6IJ_cjs.w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=chunkDCFIS6IJ_cjs.w(o,"div","pptxv-ai-tool-raw");d.textContent=`${chunkDCFIS6IJ_cjs.q(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=chunkDCFIS6IJ_cjs.f(a);if(x.length===0&&!h)continue;let c=chunkDCFIS6IJ_cjs.w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=chunkDCFIS6IJ_cjs.w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(chunkDCFIS6IJ_cjs.K(o,h?"comment":"sparkles"));let m=chunkDCFIS6IJ_cjs.w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=chunkDCFIS6IJ_cjs.w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=chunkDCFIS6IJ_cjs.w(o,"div","pptxv-ai-proposals-header"),x=chunkDCFIS6IJ_cjs.w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=chunkDCFIS6IJ_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=chunkDCFIS6IJ_cjs.w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=chunkDCFIS6IJ_cjs.w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=chunkDCFIS6IJ_cjs.w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=chunkDCFIS6IJ_cjs.w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=chunkDCFIS6IJ_cjs.w(o,"li");g.textContent=chunkDCFIS6IJ_cjs.c(s),l.appendChild(g);}a.appendChild(l);}let c=chunkDCFIS6IJ_cjs.w(o,"div","pptxv-ai-proposal-actions"),p=chunkDCFIS6IJ_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(chunkDCFIS6IJ_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=chunkDCFIS6IJ_cjs.w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(chunkDCFIS6IJ_cjs.K(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c.append(p,m),a.appendChild(c),a}async function wt(o){let{doc:t,host:n,t:i}=o;n.replaceChildren();let a=chunkDCFIS6IJ_cjs.w(t,"div","pptxv-ai-header"),h=chunkDCFIS6IJ_cjs.w(t,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=chunkDCFIS6IJ_cjs.w(t,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(chunkDCFIS6IJ_cjs.K(t,"close")),x.addEventListener("click",()=>o.onClose?.()),a.append(chunkDCFIS6IJ_cjs.K(t,"sparkles"),h,x);let c,p=o.controller,m=p?K({doc:t,t:i,controller:p,getSlides:()=>o.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=chunkDCFIS6IJ_cjs.w(t,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=chunkDCFIS6IJ_cjs.w(t,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=chunkDCFIS6IJ_cjs.w(t,"div","pptxv-ai-proposals");g.hidden=true;let f=chunkDCFIS6IJ_cjs.w(t,"div","pptxv-ai-error");f.setAttribute("role","alert"),f.hidden=true;let C=chunkDCFIS6IJ_cjs.w(t,"form","pptxv-ai-composer"),d=chunkDCFIS6IJ_cjs.w(t,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=chunkDCFIS6IJ_cjs.w(t,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(chunkDCFIS6IJ_cjs.K(t,"send")),C.append(d,y),n.append(a,...m?[m.el]:[],l,g,f,C);try{c=await(o.createChat??chunkDCFIS6IJ_cjs.o)({bridge:o.bridge,config:o.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t,t:i,deckId:chunkDCFIS6IJ_cjs.m(o.bridge),store:o.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>chunkDCFIS6IJ_cjs.f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=chunkDCFIS6IJ_cjs.t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f.hidden=!u.error,f.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m?.destroy(),n.replaceChildren();}}}exports.createAiPanel=wt;
@@ -1 +1 @@
1
- import {w,K as K$1,o,m,n,f,t,j,k,l,s,r,q as q$1,c}from'./chunk-Z2X65UZV.js';import'./chunk-ZAW5DLMV.js';import'./chunk-62D2TNHX.js';function K(o){let{doc:t,t:n,controller:i}=o,a=w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(K$1(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l$1=i.isPinned(),s=i.isPicking(),g=w(t,"div","pptxv-ai-focus-row"),f=w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of j(p,o.getSlides())){let b=w(t,"span","pptxv-ai-focus-chip");(m||l$1)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l$1){let r=w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=w(t,"div","pptxv-ai-focus-actions"),d=k(p,o.getSlides());if(d){let r=w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(K$1(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l$1?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=w(t,"div","pptxv-ai-focus-pick"),b=K$1(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n$1}=o,i=w(t,"button","pptxv-ai-chats");i.type="button",i.append(K$1(t,"history"),t.createTextNode(n$1("pptx.ai.chats")));let a=w(t,"div","pptxv-ai-history");a.hidden=true;let h=w(t,"div","pptxv-ai-history-head"),x=w(t,"span","pptxv-ai-history-title");x.textContent=n$1("pptx.ai.historyTitle");let c=w(t,"button","pptxv-ai-history-new");c.type="button",c.append(K$1(t,"plus"),t.createTextNode(n$1("pptx.ai.newChat"))),h.append(x,c);let p=w(t,"div","pptxv-ai-history-body"),m=w(t,"p","pptxv-ai-history-hint");m.textContent=n$1("pptx.ai.historyHint"),a.append(h,p,m);let l=n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n$1("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=w(t,"p","pptxv-ai-history-empty");d.textContent=n$1("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=w(t,"li","pptxv-ai-history-row"),r=w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=w(t,"span","pptxv-ai-history-text"),k=w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n$1("pptx.ai.untitledChat");let T=w(t,"span","pptxv-ai-history-meta");T.textContent=n$1("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(K$1(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n$1("pptx.ai.deleteChat"),P.setAttribute("aria-label",n$1("pptx.ai.deleteChat")),P.appendChild(K$1(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=s(t.toolName,t.input,h?"present":"past"),c=w(o,"div","pptxv-ai-tool"),p=w(o,"div","pptxv-ai-tool-head"),m=K$1(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s$1=w(o,"span","pptxv-ai-tool-state");if(i?(s$1.classList.add("is-error"),s$1.append(K$1(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s$1.classList.add("is-done"),s$1.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s$1.classList.add("is-running"),s$1.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s$1),c.appendChild(p),i&&t.errorText){let f=w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=r(t.input);if(g){let f=w(o,"details","pptxv-ai-tool-details"),C=w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=w(o,"div","pptxv-ai-tool-raw");d.textContent=`${q$1(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=f(a);if(x.length===0&&!h)continue;let c=w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(K$1(o,h?"comment":"sparkles"));let m=w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=w(o,"div","pptxv-ai-proposals-header"),x=w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=w(o,"li");g.textContent=c(s),l.appendChild(g);}a.appendChild(l);}let c$1=w(o,"div","pptxv-ai-proposal-actions"),p=w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(K$1(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c$1.append(p,m),a.appendChild(c$1),a}async function wt(o$1){let{doc:t$1,host:n,t:i}=o$1;n.replaceChildren();let a=w(t$1,"div","pptxv-ai-header"),h=w(t$1,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=w(t$1,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(K$1(t$1,"close")),x.addEventListener("click",()=>o$1.onClose?.()),a.append(K$1(t$1,"sparkles"),h,x);let c,p=o$1.controller,m$1=p?K({doc:t$1,t:i,controller:p,getSlides:()=>o$1.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=w(t$1,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=w(t$1,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=w(t$1,"div","pptxv-ai-proposals");g.hidden=true;let f$1=w(t$1,"div","pptxv-ai-error");f$1.setAttribute("role","alert"),f$1.hidden=true;let C=w(t$1,"form","pptxv-ai-composer"),d=w(t$1,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=w(t$1,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(K$1(t$1,"send")),C.append(d,y),n.append(a,...m$1?[m$1.el]:[],l,g,f$1,C);try{c=await(o$1.createChat??o)({bridge:o$1.bridge,config:o$1.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m$1?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t$1,t:i,deckId:m(o$1.bridge),store:o$1.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o$1.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t$1,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t$1,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f$1.hidden=!u.error,f$1.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m$1?.destroy(),n.replaceChildren();}}}export{wt as createAiPanel};
1
+ import {w,K as K$1,o,m,n,f,t,j,k,l,s,r,q as q$1,c}from'./chunk-E6UE4V7R.js';import'./chunk-KR4EBOP3.js';import'./chunk-62D2TNHX.js';function K(o){let{doc:t,t:n,controller:i}=o,a=w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(K$1(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l$1=i.isPinned(),s=i.isPicking(),g=w(t,"div","pptxv-ai-focus-row"),f=w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of j(p,o.getSlides())){let b=w(t,"span","pptxv-ai-focus-chip");(m||l$1)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l$1){let r=w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=w(t,"div","pptxv-ai-focus-actions"),d=k(p,o.getSlides());if(d){let r=w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(K$1(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l$1?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=w(t,"div","pptxv-ai-focus-pick"),b=K$1(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n$1}=o,i=w(t,"button","pptxv-ai-chats");i.type="button",i.append(K$1(t,"history"),t.createTextNode(n$1("pptx.ai.chats")));let a=w(t,"div","pptxv-ai-history");a.hidden=true;let h=w(t,"div","pptxv-ai-history-head"),x=w(t,"span","pptxv-ai-history-title");x.textContent=n$1("pptx.ai.historyTitle");let c=w(t,"button","pptxv-ai-history-new");c.type="button",c.append(K$1(t,"plus"),t.createTextNode(n$1("pptx.ai.newChat"))),h.append(x,c);let p=w(t,"div","pptxv-ai-history-body"),m=w(t,"p","pptxv-ai-history-hint");m.textContent=n$1("pptx.ai.historyHint"),a.append(h,p,m);let l=n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n$1("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=w(t,"p","pptxv-ai-history-empty");d.textContent=n$1("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=w(t,"li","pptxv-ai-history-row"),r=w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=w(t,"span","pptxv-ai-history-text"),k=w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n$1("pptx.ai.untitledChat");let T=w(t,"span","pptxv-ai-history-meta");T.textContent=n$1("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(K$1(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n$1("pptx.ai.deleteChat"),P.setAttribute("aria-label",n$1("pptx.ai.deleteChat")),P.appendChild(K$1(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=s(t.toolName,t.input,h?"present":"past"),c=w(o,"div","pptxv-ai-tool"),p=w(o,"div","pptxv-ai-tool-head"),m=K$1(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s$1=w(o,"span","pptxv-ai-tool-state");if(i?(s$1.classList.add("is-error"),s$1.append(K$1(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s$1.classList.add("is-done"),s$1.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s$1.classList.add("is-running"),s$1.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s$1),c.appendChild(p),i&&t.errorText){let f=w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=r(t.input);if(g){let f=w(o,"details","pptxv-ai-tool-details"),C=w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=w(o,"div","pptxv-ai-tool-raw");d.textContent=`${q$1(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=f(a);if(x.length===0&&!h)continue;let c=w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(K$1(o,h?"comment":"sparkles"));let m=w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=w(o,"div","pptxv-ai-proposals-header"),x=w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=w(o,"li");g.textContent=c(s),l.appendChild(g);}a.appendChild(l);}let c$1=w(o,"div","pptxv-ai-proposal-actions"),p=w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(K$1(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c$1.append(p,m),a.appendChild(c$1),a}async function wt(o$1){let{doc:t$1,host:n,t:i}=o$1;n.replaceChildren();let a=w(t$1,"div","pptxv-ai-header"),h=w(t$1,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=w(t$1,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(K$1(t$1,"close")),x.addEventListener("click",()=>o$1.onClose?.()),a.append(K$1(t$1,"sparkles"),h,x);let c,p=o$1.controller,m$1=p?K({doc:t$1,t:i,controller:p,getSlides:()=>o$1.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=w(t$1,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=w(t$1,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=w(t$1,"div","pptxv-ai-proposals");g.hidden=true;let f$1=w(t$1,"div","pptxv-ai-error");f$1.setAttribute("role","alert"),f$1.hidden=true;let C=w(t$1,"form","pptxv-ai-composer"),d=w(t$1,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=w(t$1,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(K$1(t$1,"send")),C.append(d,y),n.append(a,...m$1?[m$1.el]:[],l,g,f$1,C);try{c=await(o$1.createChat??o)({bridge:o$1.bridge,config:o$1.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m$1?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t$1,t:i,deckId:m(o$1.bridge),store:o$1.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o$1.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t$1,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t$1,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f$1.hidden=!u.error,f$1.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m$1?.destroy(),n.replaceChildren();}}}export{wt as createAiPanel};