pptx-react-viewer 4.55.0 → 4.56.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 +54 -0
- package/README.md +16 -1
- package/dist/ai.d.ts +17 -0
- package/dist/ai.js +11 -0
- package/dist/ai.js.br +2 -0
- package/dist/ai.js.gz +0 -0
- package/dist/ai.mjs +9 -0
- package/dist/ai.mjs.br +0 -0
- package/dist/ai.mjs.gz +0 -0
- package/dist/{chunk-OIQAJR57.js → chunk-BL2P6K67.js} +100 -5
- package/dist/chunk-BL2P6K67.js.br +0 -0
- package/dist/chunk-BL2P6K67.js.gz +0 -0
- package/dist/{chunk-V7JICDSL.js → chunk-CNCPFDFS.js} +3113 -3132
- package/dist/chunk-CNCPFDFS.js.br +0 -0
- package/dist/chunk-CNCPFDFS.js.gz +0 -0
- package/dist/{chunk-64BFLDBT.mjs → chunk-EZRO5ETF.mjs} +101 -6
- package/dist/chunk-EZRO5ETF.mjs.br +0 -0
- package/dist/chunk-EZRO5ETF.mjs.gz +0 -0
- package/dist/chunk-F6WCYCHV.js +40 -0
- package/dist/chunk-F6WCYCHV.js.br +0 -0
- package/dist/chunk-F6WCYCHV.js.gz +0 -0
- package/dist/chunk-NE5JQMED.mjs +37 -0
- package/dist/chunk-NE5JQMED.mjs.br +0 -0
- package/dist/chunk-NE5JQMED.mjs.gz +0 -0
- package/dist/{chunk-EXSGJHOH.mjs → chunk-NESLWTLG.mjs} +3017 -3037
- package/dist/chunk-NESLWTLG.mjs.br +0 -0
- package/dist/chunk-NESLWTLG.mjs.gz +0 -0
- package/dist/index.d.ts +95 -14
- package/dist/index.js +28 -23
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +64 -7
- package/dist/internals.js +80 -80
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +1 -1
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer-canvas.css +1 -1
- package/dist/pptx-viewer-canvas.css.br +0 -0
- package/dist/pptx-viewer-canvas.css.gz +0 -0
- package/dist/viewer/index.d.ts +20 -10
- package/dist/viewer/index.js +19 -18
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +3 -2
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +9 -4
- package/dist/chunk-64BFLDBT.mjs.br +0 -0
- package/dist/chunk-64BFLDBT.mjs.gz +0 -0
- package/dist/chunk-EXSGJHOH.mjs.br +0 -0
- package/dist/chunk-EXSGJHOH.mjs.gz +0 -0
- package/dist/chunk-OIQAJR57.js.br +0 -0
- package/dist/chunk-OIQAJR57.js.gz +0 -0
- package/dist/chunk-V7JICDSL.js.br +0 -0
- package/dist/chunk-V7JICDSL.js.gz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,60 @@ A release listed with no entries carried no Conventional Commit in this package'
|
|
|
7
7
|
scope: scripts/release-plan.mjs releases whenever any published file changes, not only on
|
|
8
8
|
conventional commits.
|
|
9
9
|
|
|
10
|
+
## [4.56.0](https://github.com/ChristopherVR/ooxml/releases/tag/pptx-react-viewer@4.56.0) - 2026-10-28
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **pptx:** Expose the slide thumbnail rail as a building block in every binding ([#228](https://github.com/ChristopherVR/ooxml/issues/228)) ([2b77f02](https://github.com/ChristopherVR/ooxml/commit/2b77f026e1e26e6a5fe3c52f275608f39bc0ea8e))
|
|
15
|
+
- **text:** Share font selection with word script layout ([59ad0a2](https://github.com/ChristopherVR/ooxml/commit/59ad0a2e8249d3ffc9be34c2c9e6f9ffe8b3b07a))
|
|
16
|
+
- **chart:** Share manual plot layout across chart painters ([18b79c0](https://github.com/ChristopherVR/ooxml/commit/18b79c04bb1d2aa914630453413d995d0bb54922))
|
|
17
|
+
- **chart:** Share smooth series paths and authored strokes ([7329e5c](https://github.com/ChristopherVR/ooxml/commit/7329e5cbb546a041c0e67417fbe84e9d3dc415a2))
|
|
18
|
+
- **chart:** Share point label offsets and pie leader lines ([861f78f](https://github.com/ChristopherVR/ooxml/commit/861f78f5d9ba0fa93ed6e85ddfc209fd2bf828ca))
|
|
19
|
+
- **drawingml:** Render guide-driven custom shapes in word ([81558e6](https://github.com/ChristopherVR/ooxml/commit/81558e6fcfdb2a64ced22661410cbdfba954cea2))
|
|
20
|
+
- **drawingml:** Share picture crop with excel ([f093c0f](https://github.com/ChristopherVR/ooxml/commit/f093c0f6d1c2ea96736613990e870143d770774e))
|
|
21
|
+
- **chart:** Share calendar date axis rendering ([474de5c](https://github.com/ChristopherVR/ooxml/commit/474de5c4f2418ee7b67ec34a5e08c8eefa4bb992))
|
|
22
|
+
- **chart:** Share chart data table layout and rendering ([09fbdf1](https://github.com/ChristopherVR/ooxml/commit/09fbdf1ec8016b376b67053d8a5575fc3d1ef145))
|
|
23
|
+
- **drawingml:** Share ordered picture effects with excel ([b669575](https://github.com/ChristopherVR/ooxml/commit/b669575a041ab25169a7c83757075fe9dffe390a))
|
|
24
|
+
- **chart:** Share funnel geometry and neutral rendering ([28f6ce3](https://github.com/ChristopherVR/ooxml/commit/28f6ce302fa5791a11819209d6501e97e971b80b))
|
|
25
|
+
- **chart:** Share box distributions and neutral rendering ([6390e30](https://github.com/ChristopherVR/ooxml/commit/6390e30ac6994e6891f8324e4264949f66e0a0a0))
|
|
26
|
+
- **diagram:** Paint cached pictures in word and excel ([f254d51](https://github.com/ChristopherVR/ooxml/commit/f254d51eeed81279dd9f971cb7ac496364738ec2))
|
|
27
|
+
- **drawingml:** Share source-backed text body 3d codecs ([bcf2a0a](https://github.com/ChristopherVR/ooxml/commit/bcf2a0a491c6e4dc4e5fd4f5b615f3673285cadf))
|
|
28
|
+
- **pptx:** Add an /ai entry and createAiAssistant to every binding ([#219](https://github.com/ChristopherVR/ooxml/issues/219)) ([ecd4d43](https://github.com/ChristopherVR/ooxml/commit/ecd4d43acfc0133c2f9c1e3320f366244ba3bba3))
|
|
29
|
+
- **visio:** Improve selection dragging and resizing ([60cf8dd](https://github.com/ChristopherVR/ooxml/commit/60cf8dd9c547f16e114b98ae01fed0968aca5866))
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
- **pptx:** Scope collaboration undo to the local participant ([55b8bad](https://github.com/ChristopherVR/ooxml/commit/55b8badcf0ec06a7294debff8deff844dcfafb62))
|
|
34
|
+
- **pptx:** Autocorrect only the text typed in this edit ([0e5a85e](https://github.com/ChristopherVR/ooxml/commit/0e5a85e496e0d53e36c00e6fdfd5dd3749337d8a))
|
|
35
|
+
- **pptx:** Keep browser-local blob URLs out of the collaboration room ([433891b](https://github.com/ChristopherVR/ooxml/commit/433891b1db9a173780e6ad59cad56d92a5a0e929))
|
|
36
|
+
- **chart:** Resolve chartex axes by position to avoid prototype pollution ([16edc2f](https://github.com/ChristopherVR/ooxml/commit/16edc2fd96b261ecbfbe388491fe12494be15b89))
|
|
37
|
+
- **drawingml:** Separate guide and path coordinate spaces ([4db9fe1](https://github.com/ChristopherVR/ooxml/commit/4db9fe140ec43aae8cac6cae8846ccf4dad9ba58))
|
|
38
|
+
- **chart:** Export shared date format tokenizer ([b928657](https://github.com/ChristopherVR/ooxml/commit/b928657532d41bec6a83a5969c03be922ef0a90a))
|
|
39
|
+
- **drawingml:** Bound picture luminance and report extensions ([a36e847](https://github.com/ChristopherVR/ooxml/commit/a36e84725c483815ae7508872dd4d89c5a8375b2))
|
|
40
|
+
- **chart:** Paint date ticks over plot backgrounds ([e3fad37](https://github.com/ChristopherVR/ooxml/commit/e3fad379f6d990c1ad85658e751cb84176ca7852))
|
|
41
|
+
- **docx:** Load media for cached smartart pictures ([149b350](https://github.com/ChristopherVR/ooxml/commit/149b35025750b5189813e34cfa33cd1ff5757a17))
|
|
42
|
+
- **chart:** Retain table names and exclude hidden box series ([292dc25](https://github.com/ChristopherVR/ooxml/commit/292dc25c22544d9179d5c0fd31327a3d0aafb462))
|
|
43
|
+
- **chart:** Match native funnel label and box mean defaults ([06bbf26](https://github.com/ChristopherVR/ooxml/commit/06bbf26e496f00270eca67472087454496217cc1))
|
|
44
|
+
- **drawingml:** Preserve anchors and guard text 3d edits ([617a029](https://github.com/ChristopherVR/ooxml/commit/617a02979d5cdae5e3818afd8fb79af367de25eb))
|
|
45
|
+
- **drawingml:** Preserve omitted picture source formatting ([5e2d57d](https://github.com/ChristopherVR/ooxml/commit/5e2d57dfe0b3076be7c6cb5b086c596643eb5203))
|
|
46
|
+
|
|
47
|
+
### Refactor
|
|
48
|
+
|
|
49
|
+
- **opc:** Share hyperlink policy with explicit host protocols ([5f8ac72](https://github.com/ChristopherVR/ooxml/commit/5f8ac72edbe4fff4d2fa303ed3ce8a471762bd12))
|
|
50
|
+
|
|
51
|
+
### Documentation
|
|
52
|
+
|
|
53
|
+
- Record further shared office capability delivery ([845ee99](https://github.com/ChristopherVR/ooxml/commit/845ee99bdc290e148c485c87e64d853a5884e7f8))
|
|
54
|
+
|
|
55
|
+
### Testing
|
|
56
|
+
|
|
57
|
+
- **diagram:** Guard optional word media in picture assertion ([c8f5d14](https://github.com/ChristopherVR/ooxml/commit/c8f5d14ddcdef1ee04de6d4f3e557d1719eae5e8))
|
|
58
|
+
|
|
59
|
+
### Chores
|
|
60
|
+
|
|
61
|
+
- Integrate current main for reuse verification ([a22d5f5](https://github.com/ChristopherVR/ooxml/commit/a22d5f53406330909d3853ab64a4d850bc3c0ad1))
|
|
62
|
+
- Integrate main before shared capability push ([9dc78da](https://github.com/ChristopherVR/ooxml/commit/9dc78da5262a854807b9fc8395f1fd97f71c2eb4))
|
|
63
|
+
|
|
10
64
|
## [4.55.0](https://github.com/ChristopherVR/ooxml/releases/tag/pptx-react-viewer@4.55.0) - 2026-10-28
|
|
11
65
|
|
|
12
66
|
### Features
|
package/README.md
CHANGED
|
@@ -110,7 +110,7 @@ const bytes = await viewerRef.current?.getContent(); // Uint8Array of a valid .p
|
|
|
110
110
|
| `shareDefaults` | `{ roomId?, userName?, serverUrl? }` | n/a | Seed values for the Share dialog fields |
|
|
111
111
|
| `smartArt3D` | `boolean` | `false` | Opt-in Three.js 3D SmartArt renderer (needs the optional `three` dependency; falls back to SVG without it) |
|
|
112
112
|
| `surfaceChart3D`, `barChart3D`, `lineChart3D`, `areaChart3D`, `pieChart3D` | `boolean` | `false` | Independently opt in to interactive Three.js renderers for the matching 3D chart kinds; each falls back to SVG when WebGL is unavailable. |
|
|
113
|
-
| `ai` | `PptxAiConfig`
|
|
113
|
+
| `ai` | `PptxAiAssistant \| PptxAiConfig` | n/a | Optional AI assistant: a handle from `createAiAssistant` (`pptx-react-viewer/ai`), or a plain config. The SDK peers load only when its panel is opened. See [AI assistant](#ai-assistant). |
|
|
114
114
|
| `onOpenFile` | `() => void` | n/a | Host override for File > Open; bypasses the built-in file picker |
|
|
115
115
|
| `onContentChange` | `(content: Uint8Array) => void` | n/a | Called with freshly serialised `.pptx` bytes when the content changes |
|
|
116
116
|
| `onDirtyChange` | `(isDirty: boolean) => void` | n/a | Called when dirty state changes |
|
|
@@ -265,6 +265,21 @@ import { PowerPointViewer, vermilionLightTheme } from 'pptx-react-viewer';
|
|
|
265
265
|
|
|
266
266
|
The underlying palettes (`vermilionLightColors`, `vermilionDarkColors`) and radius (`vermilionRadius`) are exported too, so you can spread them into your own variant.
|
|
267
267
|
|
|
268
|
+
## AI assistant
|
|
269
|
+
|
|
270
|
+
Create the assistant with `createAiAssistant` from the `pptx-react-viewer/ai` entry. Install the `ai` and `@ai-sdk/react` peers, create an assistant once (at module scope or in `useMemo`) and pass it to the `ai` prop:
|
|
271
|
+
|
|
272
|
+
```tsx
|
|
273
|
+
import { PowerPointViewer } from 'pptx-react-viewer';
|
|
274
|
+
import { createAiAssistant } from 'pptx-react-viewer/ai';
|
|
275
|
+
|
|
276
|
+
const assistant = createAiAssistant({ connection: { kind: 'endpoint', api: '/api/ai/chat' } });
|
|
277
|
+
|
|
278
|
+
<PowerPointViewer content={bytes} ai={assistant} />;
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
The panel still loads lazily, the first time the user opens it, and the main entries still reach the same lazy panel loader. The handle is opaque: only `createAiAssistant` makes one, and any other value is read as a plain config. A plain `PptxAiConfig` (`ai={{ connection }}`) keeps working through the viewer's own lazy panel and is not deprecated in this release; the handle is a preparatory, opt-in path for a later major release (see [The `/ai` entry](https://christophervr.github.io/ooxml/pptx/guide/ai-assistant#ai-entry)). The `PptxAi*` types are exported from both `pptx-react-viewer` and `pptx-react-viewer/ai`. See the [AI assistant guide](https://christophervr.github.io/ooxml/pptx/guide/ai-assistant) for connection modes, tools and the write policy.
|
|
282
|
+
|
|
268
283
|
## Localization (i18n)
|
|
269
284
|
|
|
270
285
|
UI labels go through [i18next](https://www.i18next.com/) / [react-i18next](https://react.i18next.com/) with dotted keys such as `pptx.statusBar.allSaved`, or through your own i18n library with `PptxI18nProvider` (see below). Initialise an i18next instance and wrap your app in `I18nextProvider` (the demo's `demos/pptx/demo-react/i18n.ts` shows a minimal config, including a `parseMissingKeyHandler` that derives Title Case labels for any key you don't explicitly translate). `pptx-react-viewer/i18n` exports `translationsEn` (the English dictionary), `keyToLabel` (the fallback), and a `TranslationKey` type you can use to type-check a new locale dictionary (`Record<TranslationKey, string>`) at compile time. Add a new language by supplying a resource bundle under its language code. See the [Localization guide](https://christophervr.github.io/ooxml/pptx/guide/localization) for full wiring examples and how to contribute a translation upstream; the live demo's language picker is a working reference.
|
package/dist/ai.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PptxAiConfig } from 'ooxml-ui/pptx/ai';
|
|
2
|
+
export { PptxAiBridge, PptxAiConfig, PptxAiConnection, PptxAiContextStrategy, PptxAiToolName, PptxAiWritePolicy } from 'ooxml-ui/pptx/ai';
|
|
3
|
+
import { PptxAiAssistant } from 'ooxml-ui/pptx/ai/host';
|
|
4
|
+
export { PptxAiAssistant } from 'ooxml-ui/pptx/ai/host';
|
|
5
|
+
|
|
6
|
+
//#region src/ai.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Create an AI assistant for the viewer's `ai` prop from a `PptxAiConfig`.
|
|
9
|
+
*
|
|
10
|
+
* The handle is opaque and loads nothing. It keeps `config` by reference; create a new
|
|
11
|
+
* handle to change it. Every handle renders the same chat panel component, so a handle
|
|
12
|
+
* created on every render (rather than in `useMemo` or at module scope) never remounts the
|
|
13
|
+
* chat.
|
|
14
|
+
*/
|
|
15
|
+
declare function createAiAssistant(config: PptxAiConfig): PptxAiAssistant;
|
|
16
|
+
|
|
17
|
+
export { createAiAssistant };
|
package/dist/ai.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkF6WCYCHV_js = require('./chunk-F6WCYCHV.js');
|
|
4
|
+
require('./chunk-PIRHQTI4.js');
|
|
5
|
+
|
|
6
|
+
// src/ai.ts
|
|
7
|
+
function createAiAssistant(config) {
|
|
8
|
+
return chunkF6WCYCHV_js.aiAssistants.register(config, chunkF6WCYCHV_js.AiChatPanelLazy);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
exports.createAiAssistant = createAiAssistant;
|
package/dist/ai.js.br
ADDED
package/dist/ai.js.gz
ADDED
|
Binary file
|
package/dist/ai.mjs
ADDED
package/dist/ai.mjs.br
ADDED
|
Binary file
|
package/dist/ai.mjs.gz
ADDED
|
Binary file
|
|
@@ -917,6 +917,7 @@ function useEditorHistory(input) {
|
|
|
917
917
|
handleRedo,
|
|
918
918
|
resetHistory,
|
|
919
919
|
forgetHistory: history.forget,
|
|
920
|
+
attachCollaboration: history.attachCollaboration,
|
|
920
921
|
markDirty,
|
|
921
922
|
withoutUndoStep,
|
|
922
923
|
buildHistorySnapshot
|
|
@@ -5649,7 +5650,7 @@ function useCanvasInteractions(input) {
|
|
|
5649
5650
|
return;
|
|
5650
5651
|
}
|
|
5651
5652
|
const liveText = read?.snapshot.text ?? inlineEditingTextRef?.current ?? inlineEditingText;
|
|
5652
|
-
const committedText = transformCommittedText ? transformCommittedText(liveText) : liveText;
|
|
5653
|
+
const committedText = transformCommittedText ? transformCommittedText(liveText, el.text) : liveText;
|
|
5653
5654
|
const textPatch = pptx.buildInlineTextCommitPatch(
|
|
5654
5655
|
el,
|
|
5655
5656
|
committedText,
|
|
@@ -7121,7 +7122,7 @@ function createTableStructHandlers(input) {
|
|
|
7121
7122
|
if (!el || el.type !== "table") {
|
|
7122
7123
|
return;
|
|
7123
7124
|
}
|
|
7124
|
-
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
7125
|
+
const text = transformCommittedText ? transformCommittedText(rawText, pptx.getCellText(el, rowIndex, colIndex)) : rawText;
|
|
7125
7126
|
const updates = {};
|
|
7126
7127
|
if (el.tableData) {
|
|
7127
7128
|
updates.tableData = pptx.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
@@ -11993,6 +11994,70 @@ function buildCanvasProps(input) {
|
|
|
11993
11994
|
}
|
|
11994
11995
|
};
|
|
11995
11996
|
}
|
|
11997
|
+
function useSlidesPaneProps({
|
|
11998
|
+
state,
|
|
11999
|
+
slides,
|
|
12000
|
+
canEdit,
|
|
12001
|
+
activeSlideIndex,
|
|
12002
|
+
slideSectionGroups,
|
|
12003
|
+
slideOps,
|
|
12004
|
+
sectionOps,
|
|
12005
|
+
recordedTimings,
|
|
12006
|
+
onOpenLayoutGallery
|
|
12007
|
+
}) {
|
|
12008
|
+
const { setActiveSlideIndex, setIsSlidesPaneOpen } = state;
|
|
12009
|
+
const fieldContext = React17.useMemo(
|
|
12010
|
+
() => pptx.buildSlidesPaneFieldContext({
|
|
12011
|
+
headerFooter: state.headerFooter,
|
|
12012
|
+
customProperties: state.customProperties,
|
|
12013
|
+
firstSlideNumber: state.firstSlideNumber
|
|
12014
|
+
}),
|
|
12015
|
+
[state.headerFooter, state.customProperties, state.firstSlideNumber]
|
|
12016
|
+
);
|
|
12017
|
+
const tableStyleContext = React17.useMemo(
|
|
12018
|
+
() => pptx.buildSlidesPaneTableStyleContext(state.theme, state.tableStyleMap),
|
|
12019
|
+
[state.theme, state.tableStyleMap]
|
|
12020
|
+
);
|
|
12021
|
+
const rehearsalTimings = React17.useMemo(
|
|
12022
|
+
() => pptx.slidesPaneRehearsalTimings(recordedTimings),
|
|
12023
|
+
[recordedTimings]
|
|
12024
|
+
);
|
|
12025
|
+
const onOpenLayoutForSlide = React17.useCallback(
|
|
12026
|
+
(slideIndex, x, y) => {
|
|
12027
|
+
pptx.openSlidesPaneLayoutGallery({ slideIndex, x, y }, setActiveSlideIndex, onOpenLayoutGallery);
|
|
12028
|
+
},
|
|
12029
|
+
[setActiveSlideIndex, onOpenLayoutGallery]
|
|
12030
|
+
);
|
|
12031
|
+
const onCollapse = React17.useCallback(() => setIsSlidesPaneOpen(false), [setIsSlidesPaneOpen]);
|
|
12032
|
+
return {
|
|
12033
|
+
slides,
|
|
12034
|
+
templateElementsBySlideId: state.templateElementsBySlideId,
|
|
12035
|
+
activeSlideIndex,
|
|
12036
|
+
canvasSize: state.canvasSize,
|
|
12037
|
+
sectionGroups: slideSectionGroups,
|
|
12038
|
+
isOpen: state.isSlidesPaneOpen,
|
|
12039
|
+
canEdit,
|
|
12040
|
+
onSelectSlide: setActiveSlideIndex,
|
|
12041
|
+
onSlideContextMenu: slideOps.handleSlideContextMenu,
|
|
12042
|
+
onMoveSlide: slideOps.handleMoveSlide,
|
|
12043
|
+
onAddSlide: slideOps.handleAddSlide,
|
|
12044
|
+
onAddSlideAfter: slideOps.handleAddSlideAfter,
|
|
12045
|
+
onDuplicateSlides: slideOps.handleDuplicateSlides,
|
|
12046
|
+
onDeleteSlides: slideOps.handleDeleteSlides,
|
|
12047
|
+
onHideSlides: slideOps.handleToggleHideSlides,
|
|
12048
|
+
onOpenLayoutForSlide,
|
|
12049
|
+
onCollapse,
|
|
12050
|
+
onAddSection: sectionOps.addSection,
|
|
12051
|
+
onRenameSection: sectionOps.renameSection,
|
|
12052
|
+
onDeleteSection: sectionOps.deleteSection,
|
|
12053
|
+
onMoveSectionUp: sectionOps.moveSectionUp,
|
|
12054
|
+
onMoveSectionDown: sectionOps.moveSectionDown,
|
|
12055
|
+
onToggleSectionCollapse: sectionOps.toggleSectionCollapse,
|
|
12056
|
+
rehearsalTimings,
|
|
12057
|
+
fieldContext,
|
|
12058
|
+
tableStyleContext
|
|
12059
|
+
};
|
|
12060
|
+
}
|
|
11996
12061
|
|
|
11997
12062
|
// src/viewer/hooks/createReviewCommentsHost.ts
|
|
11998
12063
|
function createReviewCommentsHost(input) {
|
|
@@ -12467,7 +12532,7 @@ function RemoteSelectionOverlay({
|
|
|
12467
12532
|
)) });
|
|
12468
12533
|
}
|
|
12469
12534
|
function useCollaborationDocumentSync(input) {
|
|
12470
|
-
const { collaboration, ...state } = input;
|
|
12535
|
+
const { collaboration, history, ...state } = input;
|
|
12471
12536
|
const latest = React17.useRef(input);
|
|
12472
12537
|
latest.current = input;
|
|
12473
12538
|
const getSourceBytes = React17.useCallback(() => {
|
|
@@ -12486,6 +12551,20 @@ function useCollaborationDocumentSync(input) {
|
|
|
12486
12551
|
}
|
|
12487
12552
|
}, []);
|
|
12488
12553
|
const isConnected = config?.externalSession ? Boolean(collaboration?.doc) : collaboration?.status === "connected";
|
|
12554
|
+
const historyReady = pptx.collaborationHistoryReady({
|
|
12555
|
+
hasDoc: Boolean(doc),
|
|
12556
|
+
external: Boolean(config?.externalSession),
|
|
12557
|
+
connected: isConnected && !config?.externalSession,
|
|
12558
|
+
synced: collaboration?.synced ?? false,
|
|
12559
|
+
viewer: config?.role === "viewer"
|
|
12560
|
+
});
|
|
12561
|
+
const attachCollaboration = history?.attachCollaboration;
|
|
12562
|
+
React17.useEffect(() => {
|
|
12563
|
+
if (!attachCollaboration || !doc || !historyReady) {
|
|
12564
|
+
return;
|
|
12565
|
+
}
|
|
12566
|
+
return pptx.bindCollaborationHistory({ attachCollaboration }, doc, collabModules.loadYjs);
|
|
12567
|
+
}, [attachCollaboration, doc, historyReady]);
|
|
12489
12568
|
useYjsDocumentSync({
|
|
12490
12569
|
...state,
|
|
12491
12570
|
doc: collaboration?.doc ?? null,
|
|
@@ -12522,6 +12601,7 @@ function useViewerBuildingBlocksCollaboration(input) {
|
|
|
12522
12601
|
});
|
|
12523
12602
|
useCollaborationDocumentSync({
|
|
12524
12603
|
collaboration,
|
|
12604
|
+
history: input.core.history,
|
|
12525
12605
|
content: input.content,
|
|
12526
12606
|
slides: state.slides,
|
|
12527
12607
|
setSlides: state.setSlides,
|
|
@@ -12626,7 +12706,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
12626
12706
|
setEditTemplateMode: state.setEditTemplateMode,
|
|
12627
12707
|
setHeaderFooter: state.setHeaderFooter
|
|
12628
12708
|
});
|
|
12629
|
-
const { gridSpacingPx, visibleSlideIndexes, masterPseudoSlide } = useDerivedSlideState({
|
|
12709
|
+
const { gridSpacingPx, visibleSlideIndexes, masterPseudoSlide, slideSectionGroups } = useDerivedSlideState({
|
|
12630
12710
|
slides,
|
|
12631
12711
|
sections: state.sections,
|
|
12632
12712
|
customShows: state.customShows,
|
|
@@ -12685,6 +12765,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
12685
12765
|
setExitModeHandler,
|
|
12686
12766
|
masterPseudoSlide,
|
|
12687
12767
|
gridSpacingPx,
|
|
12768
|
+
slideSectionGroups,
|
|
12688
12769
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
12689
12770
|
// comment in `PowerPointViewer.tsx`.
|
|
12690
12771
|
imageExportScale: 2 * pptx.resolveImageResolutionScale(viewerOptions),
|
|
@@ -13014,7 +13095,8 @@ function useViewerBuildingBlocks(input) {
|
|
|
13014
13095
|
onSlideCountChange,
|
|
13015
13096
|
onOpenSettings,
|
|
13016
13097
|
onOpenHeaderFooter,
|
|
13017
|
-
onOpenShareDialog
|
|
13098
|
+
onOpenShareDialog,
|
|
13099
|
+
onOpenLayoutGallery
|
|
13018
13100
|
} = input;
|
|
13019
13101
|
const collaborationConfig = pptx.resolveCollaborationConfig(input.collaboration);
|
|
13020
13102
|
const [collaborationReadOnly, setCollaborationReadOnly] = React17.useState(Boolean(collaborationConfig));
|
|
@@ -13062,6 +13144,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
13062
13144
|
presentation,
|
|
13063
13145
|
masterPseudoSlide,
|
|
13064
13146
|
gridSpacingPx,
|
|
13147
|
+
slideSectionGroups,
|
|
13065
13148
|
viewerOptions
|
|
13066
13149
|
} = core;
|
|
13067
13150
|
const canEdit = pptx.resolveCollaborationShellEditability({
|
|
@@ -13168,6 +13251,17 @@ function useViewerBuildingBlocks(input) {
|
|
|
13168
13251
|
${url}`
|
|
13169
13252
|
});
|
|
13170
13253
|
canvasProps.collaborationOverlay = overlay;
|
|
13254
|
+
const slidesPaneProps = useSlidesPaneProps({
|
|
13255
|
+
state,
|
|
13256
|
+
slides,
|
|
13257
|
+
canEdit,
|
|
13258
|
+
activeSlideIndex,
|
|
13259
|
+
slideSectionGroups,
|
|
13260
|
+
slideOps: editorOps.slideOps,
|
|
13261
|
+
sectionOps: editorOps.sectionOps,
|
|
13262
|
+
recordedTimings: presentation.recordedTimings,
|
|
13263
|
+
onOpenLayoutGallery
|
|
13264
|
+
});
|
|
13171
13265
|
const shellState = React17.useMemo(
|
|
13172
13266
|
() => pptx.resolveCollaborationShellState({
|
|
13173
13267
|
authorizedCanEdit: requestedCanEdit,
|
|
@@ -13192,6 +13286,7 @@ ${url}`
|
|
|
13192
13286
|
return {
|
|
13193
13287
|
toolbarProps,
|
|
13194
13288
|
canvasProps,
|
|
13289
|
+
slidesPaneProps,
|
|
13195
13290
|
mode,
|
|
13196
13291
|
loading,
|
|
13197
13292
|
error,
|
|
Binary file
|
|
Binary file
|