pptx-angular-viewer 4.3.0 → 4.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 +106 -0
- package/fesm2022/{pptx-angular-viewer-chart-3d-view-scene-CN_ecxxS.mjs → pptx-angular-viewer-chart-3d-view-scene-Y6KGBCeN.mjs} +2 -2
- package/fesm2022/{pptx-angular-viewer-chart-3d-view-scene-CN_ecxxS.mjs.map → pptx-angular-viewer-chart-3d-view-scene-Y6KGBCeN.mjs.map} +1 -1
- package/fesm2022/{pptx-angular-viewer-chat-history-idb-CQafSmT3.mjs → pptx-angular-viewer-chat-history-idb-BgAmw1ty.mjs} +2 -2
- package/fesm2022/{pptx-angular-viewer-chat-history-idb-CQafSmT3.mjs.map → pptx-angular-viewer-chat-history-idb-BgAmw1ty.mjs.map} +1 -1
- package/fesm2022/{pptx-angular-viewer-pptx-angular-viewer-Dom_SGx5.mjs → pptx-angular-viewer-pptx-angular-viewer-16Hf0_zW.mjs} +2072 -560
- package/fesm2022/{pptx-angular-viewer-pptx-angular-viewer-Dom_SGx5.mjs.map → pptx-angular-viewer-pptx-angular-viewer-16Hf0_zW.mjs.map} +1 -1
- package/fesm2022/pptx-angular-viewer.mjs +1 -1
- package/i18n/de.cjs +23 -0
- package/i18n/de.mjs +23 -0
- package/i18n/es.cjs +23 -0
- package/i18n/es.mjs +23 -0
- package/i18n/fr.cjs +23 -0
- package/i18n/fr.mjs +23 -0
- package/i18n/zh-CN.cjs +23 -0
- package/i18n/zh-CN.mjs +23 -0
- package/package.json +2 -2
- package/types/pptx-angular-viewer.d.ts +272 -54
- package/types/pptx-angular-viewer.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,112 @@ 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
|
+
## [4.3.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-angular-viewer@4.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
|
+
- **angular:** Render the media fullScrn full-slide overlay (by @ChristopherVR) ([36e38a8](https://github.com/ChristopherVR/pptx-viewer/commit/36e38a8e3f8280d91d98eb5bb31590d63056481f))
|
|
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
|
+
- **angular:** Wire PowerPoint editor shortcuts via the shared keymap (by @ChristopherVR) ([7003468](https://github.com/ChristopherVR/pptx-viewer/commit/70034681efa36656c718eeb44594f374b6a9503e))
|
|
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
|
+
- **angular:** Apply highlighter mix-blend-mode per stroke, not per element (by @ChristopherVR) ([300a1f7](https://github.com/ChristopherVR/pptx-viewer/commit/300a1f7a4511107e8ea53cceba216b7e8bc033ea))
|
|
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
|
+
|
|
10
116
|
## [4.2.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-angular-viewer@4.2.0) - 2026-09-24
|
|
11
117
|
|
|
12
118
|
### Features
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as shade, c as createSvgEl, r as renderChartLineSvg, a as renderChartTextSvg, b as appendChartLegendSvg, d as dragAnchorViewY, e as advanceChartValueDrag, f as buildBarChart3DHoverTooltip, i as isChartInteractionArmed, g as beginChartValueDrag, C as CHART_3D_DRAG_THRESHOLD_PX, h as createSurfaceChart3DScene, j as createPieChart3DScene, k as createAreaChart3DScene, l as createLineChart3DScene, m as createBarChart3DScene } from './pptx-angular-viewer-pptx-angular-viewer-
|
|
1
|
+
import { s as shade, c as createSvgEl, r as renderChartLineSvg, a as renderChartTextSvg, b as appendChartLegendSvg, d as dragAnchorViewY, e as advanceChartValueDrag, f as buildBarChart3DHoverTooltip, i as isChartInteractionArmed, g as beginChartValueDrag, C as CHART_3D_DRAG_THRESHOLD_PX, h as createSurfaceChart3DScene, j as createPieChart3DScene, k as createAreaChart3DScene, l as createLineChart3DScene, m as createBarChart3DScene } from './pptx-angular-viewer-pptx-angular-viewer-16Hf0_zW.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* chart-3d-shading.ts: PowerPoint's flat chart-space shading for a 3D chart's
|
|
@@ -467,4 +467,4 @@ async function mountChart3DView(spec, ctx) {
|
|
|
467
467
|
}
|
|
468
468
|
|
|
469
469
|
export { buildObliqueCamera, mountChart3DView };
|
|
470
|
-
//# sourceMappingURL=pptx-angular-viewer-chart-3d-view-scene-
|
|
470
|
+
//# sourceMappingURL=pptx-angular-viewer-chart-3d-view-scene-Y6KGBCeN.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pptx-angular-viewer-chart-3d-view-scene-CN_ecxxS.mjs","sources":["../../src/internal/shared-src/render/chart-3d-shading.ts","../../src/internal/shared-src/render/chart-3d-bar-mesh.ts","../../src/internal/shared-src/render/chart-3d-chrome-overlay.ts","../../src/internal/shared-src/render/chart-3d-oblique-interaction.ts","../../src/internal/shared-src/render/chart-3d-view-scene.ts"],"sourcesContent":["/**\n * chart-3d-shading.ts: PowerPoint's flat chart-space shading for a 3D chart's\n * box faces, as one colour multiplier per named face.\n *\n * PowerPoint's 3D charts (bar3D, pie3D, line3D ribbons, area3D slabs, surface\n * bands) are flat-shaded in \"chart space\": every face of a given orientation\n * gets the SAME multiplier applied to the mark's base colour, regardless of\n * the chart's `c:view3D` tilt. Measured directly off the pixels of\n * `gt/chart-01.webp` (a 3-D Clustered Column, series 1 = theme accent1\n * `#156082`): the front (camera-facing) rect samples the base colour exactly\n * (`front = base`), the top face samples ~0.75x, and the visible side face\n * ~0.64x. `back`/`left` (mirrors of `right`) and `bottom` (rarely visible)\n * are not independently measured; `back`/`left` reuse the measured side\n * multiplier and `bottom` is a reasonable approximation between side and a\n * fully unlit face.\n *\n * @module chart-3d-shading\n */\nimport { shade } from './chart-palette';\n\n/** A box mesh's six face orientations, in the chart's own (unrotated) local frame. */\nexport type Chart3DFace = 'front' | 'back' | 'top' | 'bottom' | 'left' | 'right';\n\n/**\n * Darken amount (0-1, `chart-palette.ts#shade`'s `amount`) per face,\n * derived from the measured multipliers: `amount = 1 - multiplier`.\n */\nconst FACE_SHADE_AMOUNT: Record<Chart3DFace, number> = {\n\tfront: 0,\n\ttop: 0.25,\n\tright: 0.36,\n\tleft: 0.36,\n\tback: 0.36,\n\tbottom: 0.5,\n};\n\n/** Apply PowerPoint's measured per-face flat shading to a mark's base colour. */\nexport function shadeChart3DFace(baseColor: string, face: Chart3DFace): string {\n\tconst amount = FACE_SHADE_AMOUNT[face];\n\treturn amount === 0 ? baseColor : shade(baseColor, amount);\n}\n\n/**\n * The six face colours for a box mesh, in the order three.js `BoxGeometry`\n * expects its `material` array (`[+x, -x, +y, -y, +z, -z]`): right, left,\n * top, bottom, front, back. `front`/`back` name whichever world axis the\n * scene treats as the camera-facing depth axis; the caller picks that\n * mapping (see `chart-3d-view-scene.ts`).\n */\nexport function buildChart3DBoxFaceColors(\n\tbaseColor: string,\n): readonly [string, string, string, string, string, string] {\n\treturn [\n\t\tshadeChart3DFace(baseColor, 'right'),\n\t\tshadeChart3DFace(baseColor, 'left'),\n\t\tshadeChart3DFace(baseColor, 'top'),\n\t\tshadeChart3DFace(baseColor, 'bottom'),\n\t\tshadeChart3DFace(baseColor, 'front'),\n\t\tshadeChart3DFace(baseColor, 'back'),\n\t];\n}\n","/**\n * Build the real WebGL box meshes for a `bar3D` chart's `Chart3DBarGeometry`\n * (see `chart-3d-spec.ts`). Split out of `chart-3d-view-scene.ts` to keep\n * that file within the repo's ~300-LOC limit.\n *\n * Every box is positioned so its FRONT face (world Z=0) sits exactly where\n * the flat 2D fallback's front-face rectangle would be drawn, in \"1 world\n * unit = 1 authored chart px\" coordinates matching `chart-3d-chrome-overlay.ts`'s\n * overlay `<svg>` viewBox. The box then extrudes backward (negative Z) by its\n * own depth, so the oblique camera's shear (`chart-3d-view-scene.ts`) shifts\n * only the BACK face, reproducing the same silhouette the flat 2D depth pass\n * draws as a hand-built parallelogram (`chart-3d-depth.ts#barExtrusion`).\n *\n * Only `PptxBar3DShape === 'box'` reaches this module today\n * (`chart-3d-spec.ts#isSupportedBoxShape` gates everything else out at the\n * spec level), so every box gets flat, per-face-group `MeshBasicMaterial`s\n * (no lights involved: PowerPoint's box faces are flat-shaded in chart\n * space, not lit) built from `chart-3d-shading.ts`'s measured multipliers.\n *\n * @module chart-3d-bar-mesh\n */\nimport type * as THREE from 'three';\n\nimport { buildChart3DBoxFaceColors } from './chart-3d-shading';\nimport type { Chart3DBarBox } from './chart-3d-spec';\n\ntype ThreeModule = typeof THREE;\n\nexport interface Chart3DBarMeshResult {\n\tgroup: THREE.Group;\n\t/** One mesh per box, same order as `boxes`; carries `{ seriesIndex, categoryIndex }` in `userData`. */\n\tmeshes: THREE.Mesh[];\n\tdispose: () => void;\n}\n\n/**\n * Build one `THREE.Mesh` per box and add them to a new `THREE.Group`. World\n * coordinates: X/Y centred on the chart's own `svgWidth`/`svgHeight` (X\n * right, Y UP - the SVG Y-down front rect is flipped here), Z=0 at the\n * front face, extending negative (away from the camera) by the box's own\n * depth.\n */\nexport function buildChart3DBarMeshes(\n\tthree: ThreeModule,\n\tboxes: ReadonlyArray<Chart3DBarBox>,\n\tsvgWidth: number,\n\tsvgHeight: number,\n): Chart3DBarMeshResult {\n\tconst group = new three.Group();\n\tconst meshes: THREE.Mesh[] = [];\n\tconst geometries: THREE.BufferGeometry[] = [];\n\tconst materials: THREE.Material[] = [];\n\tconst halfW = svgWidth / 2;\n\tconst halfH = svgHeight / 2;\n\n\tfor (const box of boxes) {\n\t\tconst geometry = new three.BoxGeometry(1, 1, 1);\n\t\tgeometries.push(geometry);\n\t\tconst faceMaterials = buildChart3DBoxFaceColors(box.color).map(\n\t\t\t(color) => new three.MeshBasicMaterial({ color }),\n\t\t);\n\t\tmaterials.push(...faceMaterials);\n\n\t\tconst mesh = new three.Mesh(geometry, faceMaterials);\n\t\tconst zDepth = box.depthMagnitude;\n\t\tmesh.position.set(box.x + box.w / 2 - halfW, halfH - (box.y + box.h / 2), -zDepth / 2);\n\t\tmesh.scale.set(box.w, box.h, zDepth);\n\t\tmesh.userData = { seriesIndex: box.seriesIndex, categoryIndex: box.categoryIndex };\n\t\tgroup.add(mesh);\n\t\tmeshes.push(mesh);\n\t}\n\n\treturn {\n\t\tgroup,\n\t\tmeshes,\n\t\tdispose: () => {\n\t\t\tfor (const geometry of geometries) {\n\t\t\t\tgeometry.dispose();\n\t\t\t}\n\t\t\tfor (const material of materials) {\n\t\t\t\tmaterial.dispose();\n\t\t\t}\n\t\t},\n\t};\n}\n","/**\n * chart-3d-chrome-overlay.ts: the SVG \"chrome\" (chart-area fill/border,\n * title, legend, value-axis gridlines/ticks, category labels) a 3D chart\n * scene draws OVER its WebGL canvas via `ctx.overlay`.\n *\n * PowerPoint's own 3D charts always show this chrome exactly like the 2D\n * chart does (see the parity brief's \"hybrid rendering\" requirement); for a\n * chart in the oblique (`rAngAx=1`) projection family this chrome is\n * ALREADY pixel-correct in the flat 2D `ChartViewModel` (verified against\n * `gt/chart-01.webp`: axes/gridlines/title/legend sit exactly where a plain\n * 2D chart would put them, perfectly undistorted), so this module reuses the\n * SAME `chart-view-model-dom.ts` piece-renderers the 2D/vanilla projector\n * uses, just WITHOUT `vm.primitives`/`vm.dataLabels` (the flat oblique\n * bars/extrusion polygons, replaced by real WebGL geometry).\n *\n * @module chart-3d-chrome-overlay\n */\nimport {\n\tappendChartLegendSvg,\n\trenderChartLineSvg,\n\trenderChartTextSvg,\n} from './chart-view-model-dom';\nimport { createSvgEl } from './chart-view-model-dom-helpers';\nimport type { ChartViewModel } from './chart-view-model-types';\n\n/**\n * Render a `ChartViewModel`'s chrome (everything except data marks) to an\n * `<svg>` sized to `vm.svgWidth` x `vm.svgHeight`, matching the WebGL\n * scene's own world-unit convention (1 world unit = 1 authored chart px) so\n * an element positioned from the same view-model's rects lines up exactly.\n */\nexport function renderChart3DChromeOverlaySvg(doc: Document, vm: ChartViewModel): SVGSVGElement {\n\tconst svg = createSvgEl(doc, 'svg', {\n\t\tclass: 'pptxv-chart-3d-chrome',\n\t\tviewBox: `0 0 ${vm.svgWidth} ${vm.svgHeight}`,\n\t\tpreserveAspectRatio: 'none',\n\t});\n\tsvg.style.setProperty('width', '100%');\n\tsvg.style.setProperty('height', '100%');\n\tsvg.style.setProperty('display', 'block');\n\tsvg.style.setProperty('position', 'absolute');\n\tsvg.style.setProperty('inset', '0');\n\t// The WebGL canvas paints the marks; this overlay only adds chrome on top\n\t// of them, so pointer events must fall through to the canvas underneath.\n\tsvg.style.setProperty('pointer-events', 'none');\n\n\tif (vm.areaFill) {\n\t\tsvg.appendChild(\n\t\t\tcreateSvgEl(doc, 'rect', {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0,\n\t\t\t\twidth: vm.svgWidth,\n\t\t\t\theight: vm.svgHeight,\n\t\t\t\trx: vm.areaRadius,\n\t\t\t\tfill: vm.areaFill,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (vm.title) {\n\t\tconst title = createSvgEl(doc, 'text', {\n\t\t\tx: vm.titleX,\n\t\t\ty: vm.titleY,\n\t\t\t'text-anchor': 'middle',\n\t\t\t'font-size': vm.titleStyle?.fontSize ?? 12,\n\t\t\t'font-weight': vm.titleStyle?.fontWeight ?? 600,\n\t\t\t'font-family': vm.titleStyle?.fontFamily,\n\t\t\tfill: vm.titleStyle?.fill ?? '#1e293b',\n\t\t\t'data-chart-part': 'title',\n\t\t});\n\t\tif (vm.titleRunSpans && vm.titleRunSpans.length > 0) {\n\t\t\tfor (const run of vm.titleRunSpans) {\n\t\t\t\tconst tspan = createSvgEl(doc, 'tspan', {\n\t\t\t\t\t'font-size': run.fontSize,\n\t\t\t\t\t'font-weight': run.fontWeight,\n\t\t\t\t\t'font-style': run.fontStyle,\n\t\t\t\t\t'font-family': run.fontFamily,\n\t\t\t\t\tfill: run.fill,\n\t\t\t\t});\n\t\t\t\ttspan.textContent = run.text;\n\t\t\t\ttitle.appendChild(tspan);\n\t\t\t}\n\t\t} else {\n\t\t\ttitle.textContent = vm.title;\n\t\t}\n\t\tsvg.appendChild(title);\n\t}\n\n\tfor (const gl of vm.gridlines) {\n\t\tsvg.appendChild(renderChartLineSvg(doc, gl));\n\t}\n\tfor (const gl of vm.secondaryGridlines ?? []) {\n\t\tsvg.appendChild(renderChartLineSvg(doc, gl));\n\t}\n\tfor (const lbl of vm.axisLabels) {\n\t\tsvg.appendChild(renderChartTextSvg(doc, lbl));\n\t}\n\tfor (const lbl of vm.secondaryAxisLabels ?? []) {\n\t\tsvg.appendChild(renderChartTextSvg(doc, lbl));\n\t}\n\tif (vm.zeroLine) {\n\t\tsvg.appendChild(renderChartLineSvg(doc, vm.zeroLine));\n\t}\n\tfor (const lbl of vm.categoryLabels) {\n\t\tsvg.appendChild(renderChartTextSvg(doc, lbl));\n\t}\n\n\tappendChartLegendSvg(doc, svg, vm);\n\treturn svg;\n}\n","import type { PptxChartData } from 'pptx-viewer-core';\n/**\n * Pointer interaction for the oblique `bar3D` scene (`chart-3d-view-scene.ts`):\n * hover tooltip, click-to-select and drag-to-value on the WebGL boxes.\n *\n * The oblique scene draws each box's FRONT face exactly where the flat 2D\n * chart draws the bar (1 world unit = 1 authored chart px), so a value drag\n * reuses the 2D engine's own drag maths unchanged: `beginChartValueDrag` /\n * `advanceChartValueDrag` from `chart-canvas-drag.ts`, driven by the view\n * model the spec was built from. That keeps a 3D bar's drag identical to the\n * 2D bar's (same rounding, same axis range, same \"stacked marks are not\n * value-draggable\" rule).\n *\n * Picking casts its own ray instead of `Raycaster.setFromCamera`: the camera\n * carries a hand-inserted shear in its projection matrix, which\n * `setFromCamera`'s orthographic branch ignores (it always casts straight\n * down the camera's -Z). Unprojecting the near and far NDC points through the\n * full inverse projection gives the correctly sheared ray.\n *\n * @module chart-3d-oblique-interaction\n */\nimport type * as THREE from 'three';\n\nimport type { ThreeViewContext } from '../three-view/types';\nimport { buildBarChart3DHoverTooltip } from './bar-chart-3d-hit-test';\nimport { CHART_3D_DRAG_THRESHOLD_PX } from './chart-3d-interaction';\nimport type { Chart3DBarBox } from './chart-3d-spec';\nimport {\n\tadvanceChartValueDrag,\n\tbeginChartValueDrag,\n\tisChartInteractionArmed,\n} from './chart-canvas-drag';\nimport type { ChartValueDragState } from './chart-canvas-drag';\nimport { dragAnchorViewY } from './chart-interaction';\nimport type { ChartPartRef } from './chart-view-model';\nimport type { ChartViewModel } from './chart-view-model-types';\n\n/** Colour of the selected box's outline (matches the 2D selected-mark accent). */\nconst SELECTED_OUTLINE_COLOR = 0x2563eb;\n\nexport interface ObliqueBarInteractionOptions {\n\tctx: ThreeViewContext;\n\tcamera: THREE.Camera;\n\tmeshes: ReadonlyArray<THREE.Mesh>;\n\tboxes: ReadonlyArray<Chart3DBarBox>;\n\tvm: ChartViewModel;\n\tchartData: PptxChartData;\n\tcategoryLabels: ReadonlyArray<string>;\n\tseriesNames: ReadonlyArray<string>;\n\t/** Scene the selection outline is added to. */\n\tscene: THREE.Object3D;\n}\n\nexport interface ObliqueBarInteraction {\n\tsetInteractive: (on: boolean) => void;\n\tsetSelectedPart: (part: ChartPartRef | null) => void;\n\tdispose: () => void;\n}\n\ninterface PressState {\n\tpart: ChartPartRef | null;\n\tdrag: ChartValueDragState | null;\n\tstartX: number;\n\tstartY: number;\n\tlastValue: number | null;\n}\n\n/** Front-face rect of a box after a live drag to `value` (the bar's baseline edge stays put). */\nfunction draggedRect(\n\tbox: Chart3DBarBox,\n\tstate: ChartValueDragState,\n\tstartValue: number,\n\tvalue: number,\n): { y: number; h: number } {\n\tconst startY = dragAnchorViewY(startValue, state.drag, state.part.seriesIndex);\n\tconst base =\n\t\tMath.abs(startY - box.y) <= Math.abs(startY - (box.y + box.h)) ? box.y + box.h : box.y;\n\tconst valueY = dragAnchorViewY(value, state.drag, state.part.seriesIndex);\n\treturn { y: Math.min(base, valueY), h: Math.abs(base - valueY) };\n}\n\n/** Attach hover/select/drag to an oblique bar scene's boxes. */\nexport function attachObliqueBarInteraction(\n\toptions: ObliqueBarInteractionOptions,\n): ObliqueBarInteraction {\n\tconst { ctx, camera, meshes, boxes, vm, chartData } = options;\n\tconst three = ctx.three;\n\tconst target = ctx.eventTarget;\n\tconst raycaster = new three.Raycaster();\n\tconst far = new three.Vector3();\n\tlet interactive = ctx.interactive;\n\tlet press: PressState | null = null;\n\tlet hoveredTooltip: string | undefined;\n\n\tconst outline = new three.LineSegments(\n\t\tnew three.EdgesGeometry(new three.BoxGeometry(1, 1, 1)),\n\t\tnew three.LineBasicMaterial({ color: SELECTED_OUTLINE_COLOR }),\n\t);\n\toutline.visible = false;\n\toptions.scene.add(outline);\n\n\tfunction hitAt(clientX: number, clientY: number): THREE.Intersection | undefined {\n\t\tconst rect = target.getBoundingClientRect();\n\t\tif (rect.width <= 0 || rect.height <= 0) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// World matrices are otherwise only refreshed by a render; a pointer\n\t\t// event can arrive before the first frame.\n\t\toptions.scene.updateMatrixWorld();\n\t\tcamera.updateMatrixWorld();\n\t\tconst x = ((clientX - rect.left) / rect.width) * 2 - 1;\n\t\tconst y = -((clientY - rect.top) / rect.height) * 2 + 1;\n\t\traycaster.ray.origin.set(x, y, -1).unproject(camera);\n\t\tfar.set(x, y, 1).unproject(camera);\n\t\traycaster.ray.direction.copy(far).sub(raycaster.ray.origin).normalize();\n\t\treturn raycaster.intersectObjects(meshes as THREE.Mesh[], false)[0];\n\t}\n\n\tfunction partOf(hit: THREE.Intersection | undefined): ChartPartRef | null {\n\t\tconst data = hit?.object.userData as\n\t\t\t| { seriesIndex?: number; categoryIndex?: number }\n\t\t\t| undefined;\n\t\tif (data?.seriesIndex === undefined || data.categoryIndex === undefined) {\n\t\t\treturn null;\n\t\t}\n\t\treturn { role: 'dataPoint', seriesIndex: data.seriesIndex, pointIndex: data.categoryIndex };\n\t}\n\n\tfunction indexOf(part: ChartPartRef | null): number {\n\t\tif (!part || part.role !== 'dataPoint') {\n\t\t\treturn -1;\n\t\t}\n\t\treturn boxes.findIndex(\n\t\t\t(b) => b.seriesIndex === part.seriesIndex && b.categoryIndex === part.pointIndex,\n\t\t);\n\t}\n\n\tfunction setSelectedPart(part: ChartPartRef | null): void {\n\t\tconst i = indexOf(part);\n\t\toutline.visible = i >= 0;\n\t\tif (i >= 0) {\n\t\t\toutline.position.copy(meshes[i].position);\n\t\t\toutline.scale.copy(meshes[i].scale);\n\t\t}\n\t\tctx.requestRender();\n\t}\n\n\t/** Resize box `i`'s mesh to a new front-face rect (live drag preview). */\n\tfunction applyRect(i: number, rect: { y: number; h: number }): void {\n\t\tconst mesh = meshes[i];\n\t\tconst h = Math.max(rect.h, 0.001);\n\t\tmesh.position.y = vm.svgHeight / 2 - (rect.y + rect.h / 2);\n\t\tmesh.scale.y = h;\n\t\tif (outline.visible) {\n\t\t\toutline.position.copy(mesh.position);\n\t\t\toutline.scale.copy(mesh.scale);\n\t\t}\n\t\tctx.requestRender();\n\t}\n\n\tconst onPointerMove = (event: PointerEvent): void => {\n\t\tif (press?.drag) {\n\t\t\tconst step = advanceChartValueDrag(\n\t\t\t\tpress.drag,\n\t\t\t\tevent.clientY,\n\t\t\t\ttarget.getBoundingClientRect().height,\n\t\t\t);\n\t\t\tif (step) {\n\t\t\t\tconst i = indexOf(press.drag.part);\n\t\t\t\tconst start = boxes[i]?.value ?? 0;\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tapplyRect(i, draggedRect(boxes[i], press.drag, start, step.value));\n\t\t\t\t}\n\t\t\t\tpress.lastValue = step.value;\n\t\t\t\tctx.emit({\n\t\t\t\t\ttype: 'drag',\n\t\t\t\t\tdetail: { part: press.drag.part, value: step.value, phase: 'move' },\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst hit = hitAt(event.clientX, event.clientY);\n\t\tconst data = hit?.object.userData as { seriesIndex: number; categoryIndex: number } | undefined;\n\t\tconst box = data ? boxes[indexOf(partOf(hit))] : undefined;\n\t\tconst tooltip = box\n\t\t\t? buildBarChart3DHoverTooltip(\n\t\t\t\t\t{ seriesIndex: box.seriesIndex, categoryIndex: box.categoryIndex, value: box.value },\n\t\t\t\t\t{\n\t\t\t\t\t\tcategoryLabels: options.categoryLabels,\n\t\t\t\t\t\tseriesNames: options.seriesNames,\n\t\t\t\t\t\tnumberFormats: chartData.series.map((s) => s.numberFormat),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t: undefined;\n\t\tif (tooltip !== hoveredTooltip) {\n\t\t\thoveredTooltip = tooltip;\n\t\t\ttarget.title = tooltip ?? '';\n\t\t}\n\t};\n\n\tconst onPointerDown = (event: PointerEvent): void => {\n\t\tif (!interactive) {\n\t\t\treturn;\n\t\t}\n\t\tconst part = partOf(hitAt(event.clientX, event.clientY));\n\t\tconst armed = part !== null && isChartInteractionArmed(target);\n\t\tif (armed) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tconst drag =\n\t\t\tarmed && part\n\t\t\t\t? beginChartValueDrag({ part, viewModel: vm, chartData, clientY: event.clientY })\n\t\t\t\t: null;\n\t\tif (drag) {\n\t\t\tevent.preventDefault();\n\t\t\t(target as { setPointerCapture?: (id: number) => void }).setPointerCapture?.(event.pointerId);\n\t\t}\n\t\tpress = { part, drag, startX: event.clientX, startY: event.clientY, lastValue: null };\n\t};\n\n\tconst onPointerUp = (event: PointerEvent): void => {\n\t\tconst current = press;\n\t\tpress = null;\n\t\tif (!current || !interactive) {\n\t\t\treturn;\n\t\t}\n\t\tif (current.drag?.moved && current.lastValue !== null) {\n\t\t\tctx.emit({\n\t\t\t\ttype: 'drag',\n\t\t\t\tdetail: { part: current.drag.part, value: current.lastValue, phase: 'commit' },\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst travel = Math.hypot(event.clientX - current.startX, event.clientY - current.startY);\n\t\tif (travel < CHART_3D_DRAG_THRESHOLD_PX) {\n\t\t\tctx.emit({ type: 'select', part: current.part });\n\t\t}\n\t};\n\n\tconst onPointerLeave = (): void => {\n\t\tif (hoveredTooltip !== undefined) {\n\t\t\thoveredTooltip = undefined;\n\t\t\ttarget.title = '';\n\t\t}\n\t};\n\n\ttarget.addEventListener('pointermove', onPointerMove);\n\ttarget.addEventListener('pointerdown', onPointerDown);\n\ttarget.addEventListener('pointerup', onPointerUp);\n\ttarget.addEventListener('pointerleave', onPointerLeave);\n\n\treturn {\n\t\tsetInteractive(on) {\n\t\t\tinteractive = on;\n\t\t\tif (!on) {\n\t\t\t\tpress = null;\n\t\t\t}\n\t\t},\n\t\tsetSelectedPart,\n\t\tdispose() {\n\t\t\ttarget.removeEventListener('pointermove', onPointerMove);\n\t\t\ttarget.removeEventListener('pointerdown', onPointerDown);\n\t\t\ttarget.removeEventListener('pointerup', onPointerUp);\n\t\t\ttarget.removeEventListener('pointerleave', onPointerLeave);\n\t\t\toutline.geometry.dispose();\n\t\t\t(outline.material as THREE.Material).dispose();\n\t\t\toutline.removeFromParent();\n\t\t},\n\t};\n}\n","import type { ChartPptxElement } from 'pptx-viewer-core';\n/**\n * `<pptx-three-view>` scene module for 3D charts.\n *\n * The oblique-projection family (`c:view3D/@rAngAx=1`, `bar3D`'s own\n * default; verified against `gt/chart-01.webp`) is drawn here. Everything\n * else (line3D/area3D/pie3D/surface3D, and bar3D's `standard` grouping, a\n * horizontal `c:barDir val=\"bar\"` or round shapes) has `geometry: null` and\n * mounts the matching perspective scene from `spec.perspective` (the\n * pre-`<pptx-three-view>` scenes, hosted on the shared renderer). Those are\n * not yet at PowerPoint parity; see `demos/demo-three-parity/README.md`.\n *\n * The oblique projection is built as a plain `OrthographicCamera` (1 world\n * unit = 1 authored chart px, matching `chart-3d-chrome-overlay.ts`'s\n * overlay `<svg>` viewBox exactly) with a SHEAR term hand-inserted into its\n * projection matrix, rather than tilting the camera or shearing the scene\n * graph: this keeps a future `OrbitControls` well-defined, since only the camera moves, and keeps every box's world\n * position/size meaningful on its own instead of encoding the illusion into\n * mesh transforms.\n *\n * @module chart-3d-view-scene\n */\nimport type * as THREE from 'three';\n\nimport type { ThreeViewContext, ThreeViewScene } from '../three-view/types';\nimport { createAreaChart3DScene } from './area-chart-3d-scene';\nimport { createBarChart3DScene } from './bar-chart-3d-scene';\nimport { buildChart3DBarMeshes } from './chart-3d-bar-mesh';\nimport { renderChart3DChromeOverlaySvg } from './chart-3d-chrome-overlay';\nimport { attachObliqueBarInteraction } from './chart-3d-oblique-interaction';\nimport type { Chart3DPerspectiveScene, Chart3DSpec } from './chart-3d-spec';\nimport { createLineChart3DScene } from './line-chart-3d-scene';\nimport { createPieChart3DScene } from './pie-chart-3d-scene';\nimport { createSurfaceChart3DScene } from './surface-chart-3d-scene';\n\n/**\n * The oblique chart camera. Camera distance is chosen so `NEAR`/`FAR` stay\n * tight around the scene's own (tiny) depth extent. Exported for tests.\n */\nexport function buildObliqueCamera(\n\tthree: ThreeModule,\n\tsvgWidth: number,\n\tsvgHeight: number,\n\tshearX: number,\n\tshearY: number,\n): THREE.OrthographicCamera {\n\tconst halfW = svgWidth / 2;\n\tconst halfH = svgHeight / 2;\n\tconst distance = halfW + halfH + 500;\n\tconst camera = new three.OrthographicCamera(-halfW, halfW, halfH, -halfH, 1, distance + 2000);\n\tcamera.position.set(0, 0, distance);\n\tcamera.lookAt(0, 0, 0);\n\tcamera.updateProjectionMatrix();\n\n\t// Hand-insert the oblique shear: clip_x += kX * ndcScaleX * world_z,\n\t// clip_y += kY * ndcScaleY * world_z (see the module doc + the chart\n\t// track's progress log for the sign derivation between the flat 2D\n\t// fallback's SVG-Y-down depth vector and this scene's world-Y-up frame:\n\t// X needs no flip (kX = -shearX), Y does (kY = +shearY)).\n\tconst m = camera.projectionMatrix.elements;\n\tconst ndcScaleX = m[0];\n\tconst ndcScaleY = m[5];\n\tm[8] = -shearX * ndcScaleX;\n\tm[9] = shearY * ndcScaleY;\n\t// The shear multiplies VIEW-space z, which is `-distance` at the chart's\n\t// front plane (world z = 0). Offset it so the front plane is unsheared\n\t// and lands exactly on the 2D layout; only depth behind it shifts.\n\tm[12] += m[8] * distance;\n\tm[13] += m[9] * distance;\n\tcamera.projectionMatrixInverse.copy(camera.projectionMatrix).invert();\n\treturn camera;\n}\n\ntype ThreeModule = typeof THREE;\n\n/** The hosted perspective scene for a spec whose oblique geometry is `null`. */\nfunction mountPerspectiveScene(\n\tperspective: Chart3DPerspectiveScene,\n\tctx: ThreeViewContext,\n): ThreeViewScene {\n\tswitch (perspective.kind) {\n\t\tcase 'bar':\n\t\t\treturn createBarChart3DScene(ctx, perspective.options);\n\t\tcase 'line':\n\t\t\treturn createLineChart3DScene(ctx, perspective.options);\n\t\tcase 'area':\n\t\t\treturn createAreaChart3DScene(ctx, perspective.options);\n\t\tcase 'pie':\n\t\t\treturn createPieChart3DScene(ctx, perspective.options);\n\t\tcase 'surface':\n\t\t\treturn createSurfaceChart3DScene(ctx, perspective.options);\n\t\tdefault: {\n\t\t\tconst exhaustive: never = perspective;\n\t\t\treturn exhaustive;\n\t\t}\n\t}\n}\n\nexport async function mountChart3DView(\n\tspec: Chart3DSpec,\n\tctx: ThreeViewContext,\n): Promise<ThreeViewScene> {\n\tif (spec.projection.mode !== 'oblique' || spec.geometry?.kind !== 'bar') {\n\t\tif (spec.perspective) {\n\t\t\treturn mountPerspectiveScene(spec.perspective, ctx);\n\t\t}\n\t\tthrow new Error(`no 3D chart scene for chartType=${spec.chartType}`);\n\t}\n\tconst three = ctx.three;\n\tconst { vm, geometry } = spec;\n\tconst chartData = (spec.element as ChartPptxElement).chartData;\n\tif (!chartData) {\n\t\tthrow new Error('3D chart spec without chart data');\n\t}\n\n\tconst camera = buildObliqueCamera(\n\t\tthree,\n\t\tvm.svgWidth,\n\t\tvm.svgHeight,\n\t\tspec.projection.shearX,\n\t\tspec.projection.shearY,\n\t);\n\n\tconst scene = new three.Scene();\n\tconst bars = buildChart3DBarMeshes(three, geometry.boxes, vm.svgWidth, vm.svgHeight);\n\tscene.add(bars.group);\n\n\tconst overlay = renderChart3DChromeOverlaySvg(ctx.document, vm);\n\tctx.overlay.appendChild(overlay);\n\n\tconst interaction = attachObliqueBarInteraction({\n\t\tctx,\n\t\tcamera,\n\t\tmeshes: bars.meshes,\n\t\tboxes: geometry.boxes,\n\t\tvm,\n\t\tchartData,\n\t\tcategoryLabels: spec.categoryLabels,\n\t\tseriesNames: chartData.series.map((series) => series.name),\n\t\tscene,\n\t});\n\n\tlet disposed = false;\n\treturn {\n\t\trender(renderer: THREE.WebGLRenderer) {\n\t\t\trenderer.render(scene, camera);\n\t\t},\n\t\tresize() {\n\t\t\t// The orthographic frustum is fixed in authored chart-px units\n\t\t\t// (svgWidth/svgHeight), independent of the element's on-screen CSS\n\t\t\t// size, so nothing needs recomputing here.\n\t\t},\n\t\tisAnimating: () => false,\n\t\tsetInteractive: (on) => interaction.setInteractive(on),\n\t\tsetSelectedPart: (part) => interaction.setSelectedPart(part),\n\t\tdispose() {\n\t\t\tif (disposed) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdisposed = true;\n\t\t\tinteraction.dispose();\n\t\t\tbars.dispose();\n\t\t\toverlay.remove();\n\t\t},\n\t};\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;AAiBG;AAMH;;;AAGG;AACH,MAAM,iBAAiB,GAAgC;AACtD,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,GAAG,EAAE,IAAI;AACT,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,MAAM,EAAE,GAAG;CACX;AAED;AACM,SAAU,gBAAgB,CAAC,SAAiB,EAAE,IAAiB,EAAA;AACpE,IAAA,MAAM,MAAM,GAAG,iB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B,OAAO;AACN,QAAA,MAAM,CAAC,QAA6B,EAAA;AACnC,YAAA,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC;QAC/B,CAAC;QACD,MAAM,GAAA;;;;QAIN,CAAC;AACD,QAAA,WAAW,EAAE,MAAM,KAAK;QACxB,cAAc,EAAE,CAAC,EAAE,KAAK,WAAW,CAAC,cAAc,CAAC,EAAE,CAAC;QACtD,eAAe,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC;QAC5D,OAAO,GAAA;YACN,IAAI,QAAQ,EAAE;gBACb;YACD;YACA,QAAQ,GAAG,IAAI;YACf,WAAW,CAAC,OAAO,EAAE;YACrB,IAAI,CAAC,OAAO,EAAE;YACd,OAAO,CAAC,MAAM,EAAE;QACjB,CAAC;KACD;AACF;;"}
|
|
1
|
+
{"version":3,"file":"pptx-angular-viewer-chart-3d-view-scene-Y6KGBCeN.mjs","sources":["../../src/internal/shared-src/render/chart-3d-shading.ts","../../src/internal/shared-src/render/chart-3d-bar-mesh.ts","../../src/internal/shared-src/render/chart-3d-chrome-overlay.ts","../../src/internal/shared-src/render/chart-3d-oblique-interaction.ts","../../src/internal/shared-src/render/chart-3d-view-scene.ts"],"sourcesContent":["/**\n * chart-3d-shading.ts: PowerPoint's flat chart-space shading for a 3D chart's\n * box faces, as one colour multiplier per named face.\n *\n * PowerPoint's 3D charts (bar3D, pie3D, line3D ribbons, area3D slabs, surface\n * bands) are flat-shaded in \"chart space\": every face of a given orientation\n * gets the SAME multiplier applied to the mark's base colour, regardless of\n * the chart's `c:view3D` tilt. Measured directly off the pixels of\n * `gt/chart-01.webp` (a 3-D Clustered Column, series 1 = theme accent1\n * `#156082`): the front (camera-facing) rect samples the base colour exactly\n * (`front = base`), the top face samples ~0.75x, and the visible side face\n * ~0.64x. `back`/`left` (mirrors of `right`) and `bottom` (rarely visible)\n * are not independently measured; `back`/`left` reuse the measured side\n * multiplier and `bottom` is a reasonable approximation between side and a\n * fully unlit face.\n *\n * @module chart-3d-shading\n */\nimport { shade } from './chart-palette';\n\n/** A box mesh's six face orientations, in the chart's own (unrotated) local frame. */\nexport type Chart3DFace = 'front' | 'back' | 'top' | 'bottom' | 'left' | 'right';\n\n/**\n * Darken amount (0-1, `chart-palette.ts#shade`'s `amount`) per face,\n * derived from the measured multipliers: `amount = 1 - multiplier`.\n */\nconst FACE_SHADE_AMOUNT: Record<Chart3DFace, number> = {\n\tfront: 0,\n\ttop: 0.25,\n\tright: 0.36,\n\tleft: 0.36,\n\tback: 0.36,\n\tbottom: 0.5,\n};\n\n/** Apply PowerPoint's measured per-face flat shading to a mark's base colour. */\nexport function shadeChart3DFace(baseColor: string, face: Chart3DFace): string {\n\tconst amount = FACE_SHADE_AMOUNT[face];\n\treturn amount === 0 ? baseColor : shade(baseColor, amount);\n}\n\n/**\n * The six face colours for a box mesh, in the order three.js `BoxGeometry`\n * expects its `material` array (`[+x, -x, +y, -y, +z, -z]`): right, left,\n * top, bottom, front, back. `front`/`back` name whichever world axis the\n * scene treats as the camera-facing depth axis; the caller picks that\n * mapping (see `chart-3d-view-scene.ts`).\n */\nexport function buildChart3DBoxFaceColors(\n\tbaseColor: string,\n): readonly [string, string, string, string, string, string] {\n\treturn [\n\t\tshadeChart3DFace(baseColor, 'right'),\n\t\tshadeChart3DFace(baseColor, 'left'),\n\t\tshadeChart3DFace(baseColor, 'top'),\n\t\tshadeChart3DFace(baseColor, 'bottom'),\n\t\tshadeChart3DFace(baseColor, 'front'),\n\t\tshadeChart3DFace(baseColor, 'back'),\n\t];\n}\n","/**\n * Build the real WebGL box meshes for a `bar3D` chart's `Chart3DBarGeometry`\n * (see `chart-3d-spec.ts`). Split out of `chart-3d-view-scene.ts` to keep\n * that file within the repo's ~300-LOC limit.\n *\n * Every box is positioned so its FRONT face (world Z=0) sits exactly where\n * the flat 2D fallback's front-face rectangle would be drawn, in \"1 world\n * unit = 1 authored chart px\" coordinates matching `chart-3d-chrome-overlay.ts`'s\n * overlay `<svg>` viewBox. The box then extrudes backward (negative Z) by its\n * own depth, so the oblique camera's shear (`chart-3d-view-scene.ts`) shifts\n * only the BACK face, reproducing the same silhouette the flat 2D depth pass\n * draws as a hand-built parallelogram (`chart-3d-depth.ts#barExtrusion`).\n *\n * Only `PptxBar3DShape === 'box'` reaches this module today\n * (`chart-3d-spec.ts#isSupportedBoxShape` gates everything else out at the\n * spec level), so every box gets flat, per-face-group `MeshBasicMaterial`s\n * (no lights involved: PowerPoint's box faces are flat-shaded in chart\n * space, not lit) built from `chart-3d-shading.ts`'s measured multipliers.\n *\n * @module chart-3d-bar-mesh\n */\nimport type * as THREE from 'three';\n\nimport { buildChart3DBoxFaceColors } from './chart-3d-shading';\nimport type { Chart3DBarBox } from './chart-3d-spec';\n\ntype ThreeModule = typeof THREE;\n\nexport interface Chart3DBarMeshResult {\n\tgroup: THREE.Group;\n\t/** One mesh per box, same order as `boxes`; carries `{ seriesIndex, categoryIndex }` in `userData`. */\n\tmeshes: THREE.Mesh[];\n\tdispose: () => void;\n}\n\n/**\n * Build one `THREE.Mesh` per box and add them to a new `THREE.Group`. World\n * coordinates: X/Y centred on the chart's own `svgWidth`/`svgHeight` (X\n * right, Y UP - the SVG Y-down front rect is flipped here), Z=0 at the\n * front face, extending negative (away from the camera) by the box's own\n * depth.\n */\nexport function buildChart3DBarMeshes(\n\tthree: ThreeModule,\n\tboxes: ReadonlyArray<Chart3DBarBox>,\n\tsvgWidth: number,\n\tsvgHeight: number,\n): Chart3DBarMeshResult {\n\tconst group = new three.Group();\n\tconst meshes: THREE.Mesh[] = [];\n\tconst geometries: THREE.BufferGeometry[] = [];\n\tconst materials: THREE.Material[] = [];\n\tconst halfW = svgWidth / 2;\n\tconst halfH = svgHeight / 2;\n\n\tfor (const box of boxes) {\n\t\tconst geometry = new three.BoxGeometry(1, 1, 1);\n\t\tgeometries.push(geometry);\n\t\tconst faceMaterials = buildChart3DBoxFaceColors(box.color).map(\n\t\t\t(color) => new three.MeshBasicMaterial({ color }),\n\t\t);\n\t\tmaterials.push(...faceMaterials);\n\n\t\tconst mesh = new three.Mesh(geometry, faceMaterials);\n\t\tconst zDepth = box.depthMagnitude;\n\t\tmesh.position.set(box.x + box.w / 2 - halfW, halfH - (box.y + box.h / 2), -zDepth / 2);\n\t\tmesh.scale.set(box.w, box.h, zDepth);\n\t\tmesh.userData = { seriesIndex: box.seriesIndex, categoryIndex: box.categoryIndex };\n\t\tgroup.add(mesh);\n\t\tmeshes.push(mesh);\n\t}\n\n\treturn {\n\t\tgroup,\n\t\tmeshes,\n\t\tdispose: () => {\n\t\t\tfor (const geometry of geometries) {\n\t\t\t\tgeometry.dispose();\n\t\t\t}\n\t\t\tfor (const material of materials) {\n\t\t\t\tmaterial.dispose();\n\t\t\t}\n\t\t},\n\t};\n}\n","/**\n * chart-3d-chrome-overlay.ts: the SVG \"chrome\" (chart-area fill/border,\n * title, legend, value-axis gridlines/ticks, category labels) a 3D chart\n * scene draws OVER its WebGL canvas via `ctx.overlay`.\n *\n * PowerPoint's own 3D charts always show this chrome exactly like the 2D\n * chart does (see the parity brief's \"hybrid rendering\" requirement); for a\n * chart in the oblique (`rAngAx=1`) projection family this chrome is\n * ALREADY pixel-correct in the flat 2D `ChartViewModel` (verified against\n * `gt/chart-01.webp`: axes/gridlines/title/legend sit exactly where a plain\n * 2D chart would put them, perfectly undistorted), so this module reuses the\n * SAME `chart-view-model-dom.ts` piece-renderers the 2D/vanilla projector\n * uses, just WITHOUT `vm.primitives`/`vm.dataLabels` (the flat oblique\n * bars/extrusion polygons, replaced by real WebGL geometry).\n *\n * @module chart-3d-chrome-overlay\n */\nimport {\n\tappendChartLegendSvg,\n\trenderChartLineSvg,\n\trenderChartTextSvg,\n} from './chart-view-model-dom';\nimport { createSvgEl } from './chart-view-model-dom-helpers';\nimport type { ChartViewModel } from './chart-view-model-types';\n\n/**\n * Render a `ChartViewModel`'s chrome (everything except data marks) to an\n * `<svg>` sized to `vm.svgWidth` x `vm.svgHeight`, matching the WebGL\n * scene's own world-unit convention (1 world unit = 1 authored chart px) so\n * an element positioned from the same view-model's rects lines up exactly.\n */\nexport function renderChart3DChromeOverlaySvg(doc: Document, vm: ChartViewModel): SVGSVGElement {\n\tconst svg = createSvgEl(doc, 'svg', {\n\t\tclass: 'pptxv-chart-3d-chrome',\n\t\tviewBox: `0 0 ${vm.svgWidth} ${vm.svgHeight}`,\n\t\tpreserveAspectRatio: 'none',\n\t});\n\tsvg.style.setProperty('width', '100%');\n\tsvg.style.setProperty('height', '100%');\n\tsvg.style.setProperty('display', 'block');\n\tsvg.style.setProperty('position', 'absolute');\n\tsvg.style.setProperty('inset', '0');\n\t// The WebGL canvas paints the marks; this overlay only adds chrome on top\n\t// of them, so pointer events must fall through to the canvas underneath.\n\tsvg.style.setProperty('pointer-events', 'none');\n\n\tif (vm.areaFill) {\n\t\tsvg.appendChild(\n\t\t\tcreateSvgEl(doc, 'rect', {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0,\n\t\t\t\twidth: vm.svgWidth,\n\t\t\t\theight: vm.svgHeight,\n\t\t\t\trx: vm.areaRadius,\n\t\t\t\tfill: vm.areaFill,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (vm.title) {\n\t\tconst title = createSvgEl(doc, 'text', {\n\t\t\tx: vm.titleX,\n\t\t\ty: vm.titleY,\n\t\t\t'text-anchor': 'middle',\n\t\t\t'font-size': vm.titleStyle?.fontSize ?? 12,\n\t\t\t'font-weight': vm.titleStyle?.fontWeight ?? 600,\n\t\t\t'font-family': vm.titleStyle?.fontFamily,\n\t\t\tfill: vm.titleStyle?.fill ?? '#1e293b',\n\t\t\t'data-chart-part': 'title',\n\t\t});\n\t\tif (vm.titleRunSpans && vm.titleRunSpans.length > 0) {\n\t\t\tfor (const run of vm.titleRunSpans) {\n\t\t\t\tconst tspan = createSvgEl(doc, 'tspan', {\n\t\t\t\t\t'font-size': run.fontSize,\n\t\t\t\t\t'font-weight': run.fontWeight,\n\t\t\t\t\t'font-style': run.fontStyle,\n\t\t\t\t\t'font-family': run.fontFamily,\n\t\t\t\t\tfill: run.fill,\n\t\t\t\t});\n\t\t\t\ttspan.textContent = run.text;\n\t\t\t\ttitle.appendChild(tspan);\n\t\t\t}\n\t\t} else {\n\t\t\ttitle.textContent = vm.title;\n\t\t}\n\t\tsvg.appendChild(title);\n\t}\n\n\tfor (const gl of vm.gridlines) {\n\t\tsvg.appendChild(renderChartLineSvg(doc, gl));\n\t}\n\tfor (const gl of vm.secondaryGridlines ?? []) {\n\t\tsvg.appendChild(renderChartLineSvg(doc, gl));\n\t}\n\tfor (const lbl of vm.axisLabels) {\n\t\tsvg.appendChild(renderChartTextSvg(doc, lbl));\n\t}\n\tfor (const lbl of vm.secondaryAxisLabels ?? []) {\n\t\tsvg.appendChild(renderChartTextSvg(doc, lbl));\n\t}\n\tif (vm.zeroLine) {\n\t\tsvg.appendChild(renderChartLineSvg(doc, vm.zeroLine));\n\t}\n\tfor (const lbl of vm.categoryLabels) {\n\t\tsvg.appendChild(renderChartTextSvg(doc, lbl));\n\t}\n\n\tappendChartLegendSvg(doc, svg, vm);\n\treturn svg;\n}\n","import type { PptxChartData } from 'pptx-viewer-core';\n/**\n * Pointer interaction for the oblique `bar3D` scene (`chart-3d-view-scene.ts`):\n * hover tooltip, click-to-select and drag-to-value on the WebGL boxes.\n *\n * The oblique scene draws each box's FRONT face exactly where the flat 2D\n * chart draws the bar (1 world unit = 1 authored chart px), so a value drag\n * reuses the 2D engine's own drag maths unchanged: `beginChartValueDrag` /\n * `advanceChartValueDrag` from `chart-canvas-drag.ts`, driven by the view\n * model the spec was built from. That keeps a 3D bar's drag identical to the\n * 2D bar's (same rounding, same axis range, same \"stacked marks are not\n * value-draggable\" rule).\n *\n * Picking casts its own ray instead of `Raycaster.setFromCamera`: the camera\n * carries a hand-inserted shear in its projection matrix, which\n * `setFromCamera`'s orthographic branch ignores (it always casts straight\n * down the camera's -Z). Unprojecting the near and far NDC points through the\n * full inverse projection gives the correctly sheared ray.\n *\n * @module chart-3d-oblique-interaction\n */\nimport type * as THREE from 'three';\n\nimport type { ThreeViewContext } from '../three-view/types';\nimport { buildBarChart3DHoverTooltip } from './bar-chart-3d-hit-test';\nimport { CHART_3D_DRAG_THRESHOLD_PX } from './chart-3d-interaction';\nimport type { Chart3DBarBox } from './chart-3d-spec';\nimport {\n\tadvanceChartValueDrag,\n\tbeginChartValueDrag,\n\tisChartInteractionArmed,\n} from './chart-canvas-drag';\nimport type { ChartValueDragState } from './chart-canvas-drag';\nimport { dragAnchorViewY } from './chart-interaction';\nimport type { ChartPartRef } from './chart-view-model';\nimport type { ChartViewModel } from './chart-view-model-types';\n\n/** Colour of the selected box's outline (matches the 2D selected-mark accent). */\nconst SELECTED_OUTLINE_COLOR = 0x2563eb;\n\nexport interface ObliqueBarInteractionOptions {\n\tctx: ThreeViewContext;\n\tcamera: THREE.Camera;\n\tmeshes: ReadonlyArray<THREE.Mesh>;\n\tboxes: ReadonlyArray<Chart3DBarBox>;\n\tvm: ChartViewModel;\n\tchartData: PptxChartData;\n\tcategoryLabels: ReadonlyArray<string>;\n\tseriesNames: ReadonlyArray<string>;\n\t/** Scene the selection outline is added to. */\n\tscene: THREE.Object3D;\n}\n\nexport interface ObliqueBarInteraction {\n\tsetInteractive: (on: boolean) => void;\n\tsetSelectedPart: (part: ChartPartRef | null) => void;\n\tdispose: () => void;\n}\n\ninterface PressState {\n\tpart: ChartPartRef | null;\n\tdrag: ChartValueDragState | null;\n\tstartX: number;\n\tstartY: number;\n\tlastValue: number | null;\n}\n\n/** Front-face rect of a box after a live drag to `value` (the bar's baseline edge stays put). */\nfunction draggedRect(\n\tbox: Chart3DBarBox,\n\tstate: ChartValueDragState,\n\tstartValue: number,\n\tvalue: number,\n): { y: number; h: number } {\n\tconst startY = dragAnchorViewY(startValue, state.drag, state.part.seriesIndex);\n\tconst base =\n\t\tMath.abs(startY - box.y) <= Math.abs(startY - (box.y + box.h)) ? box.y + box.h : box.y;\n\tconst valueY = dragAnchorViewY(value, state.drag, state.part.seriesIndex);\n\treturn { y: Math.min(base, valueY), h: Math.abs(base - valueY) };\n}\n\n/** Attach hover/select/drag to an oblique bar scene's boxes. */\nexport function attachObliqueBarInteraction(\n\toptions: ObliqueBarInteractionOptions,\n): ObliqueBarInteraction {\n\tconst { ctx, camera, meshes, boxes, vm, chartData } = options;\n\tconst three = ctx.three;\n\tconst target = ctx.eventTarget;\n\tconst raycaster = new three.Raycaster();\n\tconst far = new three.Vector3();\n\tlet interactive = ctx.interactive;\n\tlet press: PressState | null = null;\n\tlet hoveredTooltip: string | undefined;\n\n\tconst outline = new three.LineSegments(\n\t\tnew three.EdgesGeometry(new three.BoxGeometry(1, 1, 1)),\n\t\tnew three.LineBasicMaterial({ color: SELECTED_OUTLINE_COLOR }),\n\t);\n\toutline.visible = false;\n\toptions.scene.add(outline);\n\n\tfunction hitAt(clientX: number, clientY: number): THREE.Intersection | undefined {\n\t\tconst rect = target.getBoundingClientRect();\n\t\tif (rect.width <= 0 || rect.height <= 0) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// World matrices are otherwise only refreshed by a render; a pointer\n\t\t// event can arrive before the first frame.\n\t\toptions.scene.updateMatrixWorld();\n\t\tcamera.updateMatrixWorld();\n\t\tconst x = ((clientX - rect.left) / rect.width) * 2 - 1;\n\t\tconst y = -((clientY - rect.top) / rect.height) * 2 + 1;\n\t\traycaster.ray.origin.set(x, y, -1).unproject(camera);\n\t\tfar.set(x, y, 1).unproject(camera);\n\t\traycaster.ray.direction.copy(far).sub(raycaster.ray.origin).normalize();\n\t\treturn raycaster.intersectObjects(meshes as THREE.Mesh[], false)[0];\n\t}\n\n\tfunction partOf(hit: THREE.Intersection | undefined): ChartPartRef | null {\n\t\tconst data = hit?.object.userData as\n\t\t\t| { seriesIndex?: number; categoryIndex?: number }\n\t\t\t| undefined;\n\t\tif (data?.seriesIndex === undefined || data.categoryIndex === undefined) {\n\t\t\treturn null;\n\t\t}\n\t\treturn { role: 'dataPoint', seriesIndex: data.seriesIndex, pointIndex: data.categoryIndex };\n\t}\n\n\tfunction indexOf(part: ChartPartRef | null): number {\n\t\tif (!part || part.role !== 'dataPoint') {\n\t\t\treturn -1;\n\t\t}\n\t\treturn boxes.findIndex(\n\t\t\t(b) => b.seriesIndex === part.seriesIndex && b.categoryIndex === part.pointIndex,\n\t\t);\n\t}\n\n\tfunction setSelectedPart(part: ChartPartRef | null): void {\n\t\tconst i = indexOf(part);\n\t\toutline.visible = i >= 0;\n\t\tif (i >= 0) {\n\t\t\toutline.position.copy(meshes[i].position);\n\t\t\toutline.scale.copy(meshes[i].scale);\n\t\t}\n\t\tctx.requestRender();\n\t}\n\n\t/** Resize box `i`'s mesh to a new front-face rect (live drag preview). */\n\tfunction applyRect(i: number, rect: { y: number; h: number }): void {\n\t\tconst mesh = meshes[i];\n\t\tconst h = Math.max(rect.h, 0.001);\n\t\tmesh.position.y = vm.svgHeight / 2 - (rect.y + rect.h / 2);\n\t\tmesh.scale.y = h;\n\t\tif (outline.visible) {\n\t\t\toutline.position.copy(mesh.position);\n\t\t\toutline.scale.copy(mesh.scale);\n\t\t}\n\t\tctx.requestRender();\n\t}\n\n\tconst onPointerMove = (event: PointerEvent): void => {\n\t\tif (press?.drag) {\n\t\t\tconst step = advanceChartValueDrag(\n\t\t\t\tpress.drag,\n\t\t\t\tevent.clientY,\n\t\t\t\ttarget.getBoundingClientRect().height,\n\t\t\t);\n\t\t\tif (step) {\n\t\t\t\tconst i = indexOf(press.drag.part);\n\t\t\t\tconst start = boxes[i]?.value ?? 0;\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tapplyRect(i, draggedRect(boxes[i], press.drag, start, step.value));\n\t\t\t\t}\n\t\t\t\tpress.lastValue = step.value;\n\t\t\t\tctx.emit({\n\t\t\t\t\ttype: 'drag',\n\t\t\t\t\tdetail: { part: press.drag.part, value: step.value, phase: 'move' },\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst hit = hitAt(event.clientX, event.clientY);\n\t\tconst data = hit?.object.userData as { seriesIndex: number; categoryIndex: number } | undefined;\n\t\tconst box = data ? boxes[indexOf(partOf(hit))] : undefined;\n\t\tconst tooltip = box\n\t\t\t? buildBarChart3DHoverTooltip(\n\t\t\t\t\t{ seriesIndex: box.seriesIndex, categoryIndex: box.categoryIndex, value: box.value },\n\t\t\t\t\t{\n\t\t\t\t\t\tcategoryLabels: options.categoryLabels,\n\t\t\t\t\t\tseriesNames: options.seriesNames,\n\t\t\t\t\t\tnumberFormats: chartData.series.map((s) => s.numberFormat),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t: undefined;\n\t\tif (tooltip !== hoveredTooltip) {\n\t\t\thoveredTooltip = tooltip;\n\t\t\ttarget.title = tooltip ?? '';\n\t\t}\n\t};\n\n\tconst onPointerDown = (event: PointerEvent): void => {\n\t\tif (!interactive) {\n\t\t\treturn;\n\t\t}\n\t\tconst part = partOf(hitAt(event.clientX, event.clientY));\n\t\tconst armed = part !== null && isChartInteractionArmed(target);\n\t\tif (armed) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tconst drag =\n\t\t\tarmed && part\n\t\t\t\t? beginChartValueDrag({ part, viewModel: vm, chartData, clientY: event.clientY })\n\t\t\t\t: null;\n\t\tif (drag) {\n\t\t\tevent.preventDefault();\n\t\t\t(target as { setPointerCapture?: (id: number) => void }).setPointerCapture?.(event.pointerId);\n\t\t}\n\t\tpress = { part, drag, startX: event.clientX, startY: event.clientY, lastValue: null };\n\t};\n\n\tconst onPointerUp = (event: PointerEvent): void => {\n\t\tconst current = press;\n\t\tpress = null;\n\t\tif (!current || !interactive) {\n\t\t\treturn;\n\t\t}\n\t\tif (current.drag?.moved && current.lastValue !== null) {\n\t\t\tctx.emit({\n\t\t\t\ttype: 'drag',\n\t\t\t\tdetail: { part: current.drag.part, value: current.lastValue, phase: 'commit' },\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst travel = Math.hypot(event.clientX - current.startX, event.clientY - current.startY);\n\t\tif (travel < CHART_3D_DRAG_THRESHOLD_PX) {\n\t\t\tctx.emit({ type: 'select', part: current.part });\n\t\t}\n\t};\n\n\tconst onPointerLeave = (): void => {\n\t\tif (hoveredTooltip !== undefined) {\n\t\t\thoveredTooltip = undefined;\n\t\t\ttarget.title = '';\n\t\t}\n\t};\n\n\ttarget.addEventListener('pointermove', onPointerMove);\n\ttarget.addEventListener('pointerdown', onPointerDown);\n\ttarget.addEventListener('pointerup', onPointerUp);\n\ttarget.addEventListener('pointerleave', onPointerLeave);\n\n\treturn {\n\t\tsetInteractive(on) {\n\t\t\tinteractive = on;\n\t\t\tif (!on) {\n\t\t\t\tpress = null;\n\t\t\t}\n\t\t},\n\t\tsetSelectedPart,\n\t\tdispose() {\n\t\t\ttarget.removeEventListener('pointermove', onPointerMove);\n\t\t\ttarget.removeEventListener('pointerdown', onPointerDown);\n\t\t\ttarget.removeEventListener('pointerup', onPointerUp);\n\t\t\ttarget.removeEventListener('pointerleave', onPointerLeave);\n\t\t\toutline.geometry.dispose();\n\t\t\t(outline.material as THREE.Material).dispose();\n\t\t\toutline.removeFromParent();\n\t\t},\n\t};\n}\n","import type { ChartPptxElement } from 'pptx-viewer-core';\n/**\n * `<pptx-three-view>` scene module for 3D charts.\n *\n * The oblique-projection family (`c:view3D/@rAngAx=1`, `bar3D`'s own\n * default; verified against `gt/chart-01.webp`) is drawn here. Everything\n * else (line3D/area3D/pie3D/surface3D, and bar3D's `standard` grouping, a\n * horizontal `c:barDir val=\"bar\"` or round shapes) has `geometry: null` and\n * mounts the matching perspective scene from `spec.perspective` (the\n * pre-`<pptx-three-view>` scenes, hosted on the shared renderer). Those are\n * not yet at PowerPoint parity; see `demos/demo-three-parity/README.md`.\n *\n * The oblique projection is built as a plain `OrthographicCamera` (1 world\n * unit = 1 authored chart px, matching `chart-3d-chrome-overlay.ts`'s\n * overlay `<svg>` viewBox exactly) with a SHEAR term hand-inserted into its\n * projection matrix, rather than tilting the camera or shearing the scene\n * graph: this keeps a future `OrbitControls` well-defined, since only the camera moves, and keeps every box's world\n * position/size meaningful on its own instead of encoding the illusion into\n * mesh transforms.\n *\n * @module chart-3d-view-scene\n */\nimport type * as THREE from 'three';\n\nimport type { ThreeViewContext, ThreeViewScene } from '../three-view/types';\nimport { createAreaChart3DScene } from './area-chart-3d-scene';\nimport { createBarChart3DScene } from './bar-chart-3d-scene';\nimport { buildChart3DBarMeshes } from './chart-3d-bar-mesh';\nimport { renderChart3DChromeOverlaySvg } from './chart-3d-chrome-overlay';\nimport { attachObliqueBarInteraction } from './chart-3d-oblique-interaction';\nimport type { Chart3DPerspectiveScene, Chart3DSpec } from './chart-3d-spec';\nimport { createLineChart3DScene } from './line-chart-3d-scene';\nimport { createPieChart3DScene } from './pie-chart-3d-scene';\nimport { createSurfaceChart3DScene } from './surface-chart-3d-scene';\n\n/**\n * The oblique chart camera. Camera distance is chosen so `NEAR`/`FAR` stay\n * tight around the scene's own (tiny) depth extent. Exported for tests.\n */\nexport function buildObliqueCamera(\n\tthree: ThreeModule,\n\tsvgWidth: number,\n\tsvgHeight: number,\n\tshearX: number,\n\tshearY: number,\n): THREE.OrthographicCamera {\n\tconst halfW = svgWidth / 2;\n\tconst halfH = svgHeight / 2;\n\tconst distance = halfW + halfH + 500;\n\tconst camera = new three.OrthographicCamera(-halfW, halfW, halfH, -halfH, 1, distance + 2000);\n\tcamera.position.set(0, 0, distance);\n\tcamera.lookAt(0, 0, 0);\n\tcamera.updateProjectionMatrix();\n\n\t// Hand-insert the oblique shear: clip_x += kX * ndcScaleX * world_z,\n\t// clip_y += kY * ndcScaleY * world_z (see the module doc + the chart\n\t// track's progress log for the sign derivation between the flat 2D\n\t// fallback's SVG-Y-down depth vector and this scene's world-Y-up frame:\n\t// X needs no flip (kX = -shearX), Y does (kY = +shearY)).\n\tconst m = camera.projectionMatrix.elements;\n\tconst ndcScaleX = m[0];\n\tconst ndcScaleY = m[5];\n\tm[8] = -shearX * ndcScaleX;\n\tm[9] = shearY * ndcScaleY;\n\t// The shear multiplies VIEW-space z, which is `-distance` at the chart's\n\t// front plane (world z = 0). Offset it so the front plane is unsheared\n\t// and lands exactly on the 2D layout; only depth behind it shifts.\n\tm[12] += m[8] * distance;\n\tm[13] += m[9] * distance;\n\tcamera.projectionMatrixInverse.copy(camera.projectionMatrix).invert();\n\treturn camera;\n}\n\ntype ThreeModule = typeof THREE;\n\n/** The hosted perspective scene for a spec whose oblique geometry is `null`. */\nfunction mountPerspectiveScene(\n\tperspective: Chart3DPerspectiveScene,\n\tctx: ThreeViewContext,\n): ThreeViewScene {\n\tswitch (perspective.kind) {\n\t\tcase 'bar':\n\t\t\treturn createBarChart3DScene(ctx, perspective.options);\n\t\tcase 'line':\n\t\t\treturn createLineChart3DScene(ctx, perspective.options);\n\t\tcase 'area':\n\t\t\treturn createAreaChart3DScene(ctx, perspective.options);\n\t\tcase 'pie':\n\t\t\treturn createPieChart3DScene(ctx, perspective.options);\n\t\tcase 'surface':\n\t\t\treturn createSurfaceChart3DScene(ctx, perspective.options);\n\t\tdefault: {\n\t\t\tconst exhaustive: never = perspective;\n\t\t\treturn exhaustive;\n\t\t}\n\t}\n}\n\nexport async function mountChart3DView(\n\tspec: Chart3DSpec,\n\tctx: ThreeViewContext,\n): Promise<ThreeViewScene> {\n\tif (spec.projection.mode !== 'oblique' || spec.geometry?.kind !== 'bar') {\n\t\tif (spec.perspective) {\n\t\t\treturn mountPerspectiveScene(spec.perspective, ctx);\n\t\t}\n\t\tthrow new Error(`no 3D chart scene for chartType=${spec.chartType}`);\n\t}\n\tconst three = ctx.three;\n\tconst { vm, geometry } = spec;\n\tconst chartData = (spec.element as ChartPptxElement).chartData;\n\tif (!chartData) {\n\t\tthrow new Error('3D chart spec without chart data');\n\t}\n\n\tconst camera = buildObliqueCamera(\n\t\tthree,\n\t\tvm.svgWidth,\n\t\tvm.svgHeight,\n\t\tspec.projection.shearX,\n\t\tspec.projection.shearY,\n\t);\n\n\tconst scene = new three.Scene();\n\tconst bars = buildChart3DBarMeshes(three, geometry.boxes, vm.svgWidth, vm.svgHeight);\n\tscene.add(bars.group);\n\n\tconst overlay = renderChart3DChromeOverlaySvg(ctx.document, vm);\n\tctx.overlay.appendChild(overlay);\n\n\tconst interaction = attachObliqueBarInteraction({\n\t\tctx,\n\t\tcamera,\n\t\tmeshes: bars.meshes,\n\t\tboxes: geometry.boxes,\n\t\tvm,\n\t\tchartData,\n\t\tcategoryLabels: spec.categoryLabels,\n\t\tseriesNames: chartData.series.map((series) => series.name),\n\t\tscene,\n\t});\n\n\tlet disposed = false;\n\treturn {\n\t\trender(renderer: THREE.WebGLRenderer) {\n\t\t\trenderer.render(scene, camera);\n\t\t},\n\t\tresize() {\n\t\t\t// The orthographic frustum is fixed in authored chart-px units\n\t\t\t// (svgWidth/svgHeight), independent of the element's on-screen CSS\n\t\t\t// size, so nothing needs recomputing here.\n\t\t},\n\t\tisAnimating: () => false,\n\t\tsetInteractive: (on) => interaction.setInteractive(on),\n\t\tsetSelectedPart: (part) => interaction.setSelectedPart(part),\n\t\tdispose() {\n\t\t\tif (disposed) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdisposed = true;\n\t\t\tinteraction.dispose();\n\t\t\tbars.dispose();\n\t\t\toverlay.remove();\n\t\t},\n\t};\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;AAiBG;AAMH;;;AAGG;AACH,MAAM,iBAAiB,GAAgC;AACtD,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,GAAG,EAAE,IAAI;AACT,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,MAAM,EAAE,GAAG;CACX;AAED;AACM,SAAU,gBAAgB,CAAC,SAAiB,EAAE,IAAiB,EAAA;AACpE,IAAA,MAAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAC;AACtC,IAAA,OAAO,MAAM,KAAK,CAAC,GAAG,SAAS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AAM,CAAC,KAAK,EAAE,MAAM,CAAC;QAC/B,CAAC;QACD,MAAM,GAAA;;;;QAIN,CAAC;AACD,QAAA,WAAW,EAAE,MAAM,KAAK;QACxB,cAAc,EAAE,CAAC,EAAE,KAAK,WAAW,CAAC,cAAc,CAAC,EAAE,CAAC;QACtD,eAAe,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC;QAC5D,OAAO,GAAA;YACN,IAAI,QAAQ,EAAE;gBACb;YACD;YACA,QAAQ,GAAG,IAAI;YACf,WAAW,CAAC,OAAO,EAAE;YACrB,IAAI,CAAC,OAAO,EAAE;YACd,OAAO,CAAC,MAAM,EAAE;QACjB,CAAC;KACD;AACF;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as toChatSummary } from './pptx-angular-viewer-pptx-angular-viewer-
|
|
1
|
+
import { t as toChatSummary } from './pptx-angular-viewer-pptx-angular-viewer-16Hf0_zW.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* IndexedDB backend for {@link createChatHistoryStore}. Kept in its own module
|
|
@@ -103,4 +103,4 @@ function createIdbBackend(db) {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
export { CHAT_STORE, createIdbBackend, openChatDb };
|
|
106
|
-
//# sourceMappingURL=pptx-angular-viewer-chat-history-idb-
|
|
106
|
+
//# sourceMappingURL=pptx-angular-viewer-chat-history-idb-BgAmw1ty.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pptx-angular-viewer-chat-history-idb-
|
|
1
|
+
{"version":3,"file":"pptx-angular-viewer-chat-history-idb-BgAmw1ty.mjs","sources":["../../src/internal/shared-src/ai/chat-history-idb.ts"],"sourcesContent":["/**\n * IndexedDB backend for {@link createChatHistoryStore}. Kept in its own module\n * so the localStorage fallback and the public factory stay within the per-file\n * size budget. Uses the raw IndexedDB API with tiny promise wrappers so no new\n * runtime dependency is pulled in.\n *\n * Every browser global is touched lazily from inside a function, never at module\n * load, so importing this file in a non-DOM environment (Node, SSR) never throws.\n */\n\nimport type { ChatBackend, PptxAiChatSummary, PptxAiStoredChat } from './chat-history-store';\nimport { toChatSummary } from './chat-history-store';\n\n/** Object store holding one record per chat, keyed by `id`. */\nexport const CHAT_STORE = 'chats';\n/** Index over the optional `deckId` key path, used for per-deck filtering. */\nconst DECK_INDEX = 'deckId';\n\n/** Resolve an `IDBRequest` to a promise. */\nfunction requestToPromise<T>(request: IDBRequest<T>): Promise<T> {\n\treturn new Promise<T>((resolve, reject) => {\n\t\trequest.onsuccess = () => resolve(request.result);\n\t\trequest.onerror = () => reject(request.error ?? new Error('IndexedDB request failed.'));\n\t});\n}\n\n/** Resolve when a transaction commits (or reject on error/abort). */\nfunction transactionDone(tx: IDBTransaction): Promise<void> {\n\treturn new Promise<void>((resolve, reject) => {\n\t\ttx.oncomplete = () => resolve();\n\t\ttx.onerror = () => reject(tx.error ?? new Error('IndexedDB transaction failed.'));\n\t\ttx.onabort = () => reject(tx.error ?? new Error('IndexedDB transaction aborted.'));\n\t});\n}\n\n/**\n * Open (and if needed create/upgrade) the chat database. Throws when there is no\n * `indexedDB` global so the caller can transparently fall back to localStorage.\n */\nexport function openChatDb(dbName: string): Promise<IDBDatabase> {\n\tconst idb = typeof indexedDB !== 'undefined' ? indexedDB : undefined;\n\tif (!idb) {\n\t\tthrow new Error('IndexedDB is not available in this environment.');\n\t}\n\treturn new Promise<IDBDatabase>((resolve, reject) => {\n\t\tconst open = idb.open(dbName, 1);\n\t\topen.onupgradeneeded = () => {\n\t\t\tconst db = open.result;\n\t\t\tif (!db.objectStoreNames.contains(CHAT_STORE)) {\n\t\t\t\tconst store = db.createObjectStore(CHAT_STORE, { keyPath: 'id' });\n\t\t\t\tstore.createIndex(DECK_INDEX, 'deckId', { unique: false });\n\t\t\t}\n\t\t};\n\t\topen.onsuccess = () => resolve(open.result);\n\t\topen.onerror = () => reject(open.error ?? new Error('Failed to open IndexedDB.'));\n\t\topen.onblocked = () => reject(new Error('IndexedDB open blocked by another connection.'));\n\t});\n}\n\n/** Read every stored chat (newest-first ordering is applied by the caller). */\nasync function readAll(db: IDBDatabase, deckId: string | undefined): Promise<PptxAiStoredChat[]> {\n\tconst tx = db.transaction(CHAT_STORE, 'readonly');\n\tconst store = tx.objectStore(CHAT_STORE);\n\tconst source =\n\t\tdeckId === undefined\n\t\t\t? store.getAll()\n\t\t\t: store.index(DECK_INDEX).getAll(IDBKeyRange.only(deckId));\n\tconst rows = await requestToPromise<PptxAiStoredChat[]>(source);\n\tawait transactionDone(tx);\n\treturn rows;\n}\n\n/** Create an IndexedDB-backed {@link ChatBackend}. */\nexport function createIdbBackend(db: IDBDatabase): ChatBackend {\n\treturn {\n\t\tasync list(deckId: string | undefined): Promise<PptxAiChatSummary[]> {\n\t\t\tconst rows = await readAll(db, deckId);\n\t\t\treturn rows.map(toChatSummary).sort((a, b) => b.updatedAt - a.updatedAt);\n\t\t},\n\t\tasync load(id: string): Promise<PptxAiStoredChat | null> {\n\t\t\tconst tx = db.transaction(CHAT_STORE, 'readonly');\n\t\t\tconst row = await requestToPromise<PptxAiStoredChat | undefined>(\n\t\t\t\ttx.objectStore(CHAT_STORE).get(id),\n\t\t\t);\n\t\t\tawait transactionDone(tx);\n\t\t\treturn row ?? null;\n\t\t},\n\t\tasync save(chat: PptxAiStoredChat): Promise<void> {\n\t\t\tconst tx = db.transaction(CHAT_STORE, 'readwrite');\n\t\t\ttx.objectStore(CHAT_STORE).put(chat);\n\t\t\tawait transactionDone(tx);\n\t\t},\n\t\tasync remove(id: string): Promise<void> {\n\t\t\tconst tx = db.transaction(CHAT_STORE, 'readwrite');\n\t\t\ttx.objectStore(CHAT_STORE).delete(id);\n\t\t\tawait transactionDone(tx);\n\t\t},\n\t\tasync clear(deckId: string | undefined): Promise<void> {\n\t\t\tconst tx = db.transaction(CHAT_STORE, 'readwrite');\n\t\t\tconst store = tx.objectStore(CHAT_STORE);\n\t\t\tif (deckId === undefined) {\n\t\t\t\tstore.clear();\n\t\t\t} else {\n\t\t\t\tconst ids = await requestToPromise<IDBValidKey[]>(\n\t\t\t\t\tstore.index(DECK_INDEX).getAllKeys(IDBKeyRange.only(deckId)),\n\t\t\t\t);\n\t\t\t\tfor (const id of ids) {\n\t\t\t\t\tstore.delete(id);\n\t\t\t\t}\n\t\t\t}\n\t\t\tawait transactionDone(tx);\n\t\t},\n\t};\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;AAQG;AAKH;AACO,MAAM,UAAU,GAAG;AAC1B;AACA,MAAM,UAAU,GAAG,QAAQ;AAE3B;AACA,SAAS,gBAAgB,CAAI,OAAsB,EAAA;IAClD,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,KAAI;AACzC,QAAA,OAAO,CAAC,SAAS,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;AACjD,QAAA,OAAO,CAAC,OAAO,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;AACxF,IAAA,CAAC,CAAC;AACH;AAEA;AACA,SAAS,eAAe,CAAC,EAAkB,EAAA;IAC1C,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,KAAI;QAC5C,EAAE,CAAC,UAAU,GAAG,MAAM,OAAO,EAAE;AAC/B,QAAA,EAAE,CAAC,OAAO,GAAG,MAAM,MAAM,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;AACjF,QAAA,EAAE,CAAC,OAAO,GAAG,MAAM,MAAM,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACnF,IAAA,CAAC,CAAC;AACH;AAEA;;;AAGG;AACG,SAAU,UAAU,CAAC,MAAc,EAAA;AACxC,IAAA,MAAM,GAAG,GAAG,OAAO,SAAS,KAAK,WAAW,GAAG,SAAS,G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