pptx-react-viewer 4.45.0 → 4.47.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 +50 -0
- package/README.md +5 -2
- package/dist/{AiChatPanel-Z5VHI4WA.mjs → AiChatPanel-6S4LWXGM.mjs} +2 -2
- package/dist/AiChatPanel-6S4LWXGM.mjs.br +0 -0
- package/dist/AiChatPanel-6S4LWXGM.mjs.gz +0 -0
- package/dist/{AiChatPanel-TGZQBH3L.js → AiChatPanel-IEM43TTZ.js} +10 -10
- package/dist/AiChatPanel-IEM43TTZ.js.br +0 -0
- package/dist/AiChatPanel-IEM43TTZ.js.gz +0 -0
- package/dist/{Model3DScene-5HLXSIIK.js → Model3DScene-CCIG67DJ.js} +1 -1
- package/dist/Model3DScene-CCIG67DJ.js.br +0 -0
- package/dist/Model3DScene-CCIG67DJ.js.gz +0 -0
- package/dist/{Model3DScene-MSC4LEKG.mjs → Model3DScene-NUJH2UKM.mjs} +1 -1
- package/dist/Model3DScene-NUJH2UKM.mjs.br +0 -0
- package/dist/Model3DScene-NUJH2UKM.mjs.gz +0 -0
- package/dist/{chunk-FBN7UFW2.mjs → chunk-BVQSH5SS.mjs} +36 -43
- package/dist/chunk-BVQSH5SS.mjs.br +0 -0
- package/dist/chunk-BVQSH5SS.mjs.gz +0 -0
- package/dist/{chunk-66APV3YZ.mjs → chunk-HDOR67HF.mjs} +258 -130
- package/dist/chunk-HDOR67HF.mjs.br +0 -0
- package/dist/chunk-HDOR67HF.mjs.gz +0 -0
- package/dist/{chunk-VJZJESNT.js → chunk-MA2BI7LX.js} +45 -61
- package/dist/chunk-MA2BI7LX.js.br +0 -0
- package/dist/chunk-MA2BI7LX.js.gz +0 -0
- package/dist/{chunk-2YCROYR6.js → chunk-MRSGNERC.js} +432 -302
- package/dist/chunk-MRSGNERC.js.br +0 -0
- package/dist/chunk-MRSGNERC.js.gz +0 -0
- package/dist/{chunk-VUE3EPTJ.mjs → chunk-OWZSRPAH.mjs} +248 -162
- package/dist/chunk-OWZSRPAH.mjs.br +0 -0
- package/dist/chunk-OWZSRPAH.mjs.gz +0 -0
- package/dist/{chunk-W2IMY5SY.js → chunk-PIRHQTI4.js} +0 -2
- package/dist/chunk-PIRHQTI4.js.br +0 -0
- package/dist/chunk-PIRHQTI4.js.gz +0 -0
- package/dist/{chunk-KUQRWMIK.js → chunk-SSANGQ35.js} +550 -464
- package/dist/chunk-SSANGQ35.js.br +0 -0
- package/dist/chunk-SSANGQ35.js.gz +0 -0
- package/dist/{chunk-Q3DHYOLK.mjs → chunk-UV2HVMKZ.mjs} +1 -2
- package/dist/chunk-UV2HVMKZ.mjs.br +0 -0
- package/dist/chunk-UV2HVMKZ.mjs.gz +0 -0
- package/dist/i18n.js +1 -1
- package/dist/i18n.js.br +2 -2
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +1 -1
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +47 -6
- package/dist/index.js +25 -25
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +74 -8
- package/dist/internals.js +82 -82
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer-canvas.css +2 -0
- package/dist/pptx-viewer-canvas.css.br +0 -0
- package/dist/pptx-viewer-canvas.css.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{three.module-JPZUM7AI.mjs → three.module-EBJVANGB.mjs} +1 -1
- package/dist/three.module-EBJVANGB.mjs.br +0 -0
- package/dist/three.module-EBJVANGB.mjs.gz +0 -0
- package/dist/{three.module-RIUI7P3J.js → three.module-MBFHAT6M.js} +1 -1
- package/dist/three.module-MBFHAT6M.js.br +0 -0
- package/dist/three.module-MBFHAT6M.js.gz +0 -0
- package/dist/viewer/index.d.ts +49 -10
- package/dist/viewer/index.js +20 -20
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +4 -4
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/dist/{y-webrtc-CCA4HVZZ.mjs → y-webrtc-2H7UYAQD.mjs} +1 -1
- package/dist/y-webrtc-2H7UYAQD.mjs.br +0 -0
- package/dist/y-webrtc-2H7UYAQD.mjs.gz +0 -0
- package/dist/{y-webrtc-MB5ZXFBA.js → y-webrtc-DVPQNFLL.js} +5 -5
- package/dist/y-webrtc-DVPQNFLL.js.br +0 -0
- package/dist/y-webrtc-DVPQNFLL.js.gz +0 -0
- package/dist/{y-websocket-JQQZVAMX.js → y-websocket-TN4OKPXQ.js} +1 -1
- package/dist/y-websocket-TN4OKPXQ.js.br +0 -0
- package/dist/y-websocket-TN4OKPXQ.js.gz +0 -0
- package/dist/{y-websocket-SCLLNICY.mjs → y-websocket-WORVRRQS.mjs} +1 -1
- package/dist/y-websocket-WORVRRQS.mjs.br +0 -0
- package/dist/y-websocket-WORVRRQS.mjs.gz +0 -0
- package/package.json +7 -5
- package/dist/AiChatPanel-TGZQBH3L.js.br +0 -0
- package/dist/AiChatPanel-TGZQBH3L.js.gz +0 -0
- package/dist/AiChatPanel-Z5VHI4WA.mjs.br +0 -0
- package/dist/AiChatPanel-Z5VHI4WA.mjs.gz +0 -0
- package/dist/Model3DScene-5HLXSIIK.js.br +0 -0
- package/dist/Model3DScene-5HLXSIIK.js.gz +0 -0
- package/dist/Model3DScene-MSC4LEKG.mjs.br +0 -0
- package/dist/Model3DScene-MSC4LEKG.mjs.gz +0 -0
- package/dist/chunk-2YCROYR6.js.br +0 -0
- package/dist/chunk-2YCROYR6.js.gz +0 -0
- package/dist/chunk-66APV3YZ.mjs.br +0 -0
- package/dist/chunk-66APV3YZ.mjs.gz +0 -0
- package/dist/chunk-FBN7UFW2.mjs.br +0 -0
- package/dist/chunk-FBN7UFW2.mjs.gz +0 -0
- package/dist/chunk-KUQRWMIK.js.br +0 -0
- package/dist/chunk-KUQRWMIK.js.gz +0 -0
- package/dist/chunk-Q3DHYOLK.mjs.br +0 -0
- package/dist/chunk-Q3DHYOLK.mjs.gz +0 -0
- package/dist/chunk-VJZJESNT.js.br +0 -0
- package/dist/chunk-VJZJESNT.js.gz +0 -0
- package/dist/chunk-VUE3EPTJ.mjs.br +0 -0
- package/dist/chunk-VUE3EPTJ.mjs.gz +0 -0
- package/dist/chunk-W2IMY5SY.js.br +0 -0
- package/dist/chunk-W2IMY5SY.js.gz +0 -0
- package/dist/three.module-JPZUM7AI.mjs.br +0 -0
- package/dist/three.module-JPZUM7AI.mjs.gz +0 -0
- package/dist/three.module-RIUI7P3J.js.br +0 -0
- package/dist/three.module-RIUI7P3J.js.gz +0 -0
- package/dist/y-webrtc-CCA4HVZZ.mjs.br +0 -0
- package/dist/y-webrtc-CCA4HVZZ.mjs.gz +0 -0
- package/dist/y-webrtc-MB5ZXFBA.js.br +0 -0
- package/dist/y-webrtc-MB5ZXFBA.js.gz +0 -0
- package/dist/y-websocket-JQQZVAMX.js.br +0 -0
- package/dist/y-websocket-JQQZVAMX.js.gz +0 -0
- package/dist/y-websocket-SCLLNICY.mjs.br +0 -0
- package/dist/y-websocket-SCLLNICY.mjs.gz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,56 @@ 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.47.0](https://github.com/ChristopherVR/ooxml/releases/tag/pptx-react-viewer@4.47.0) - 2026-10-22
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **react:** Ship a canvas-only stylesheet as canvas.css ([34ef433](https://github.com/ChristopherVR/ooxml/commit/34ef433e6136bce3ca15b5d7024d867123d8af91))
|
|
15
|
+
- **pptx:** Route saves and recovery through host-owned storage ([4ad5655](https://github.com/ChristopherVR/ooxml/commit/4ad565525269ef0284114efad6d5e4a7bed756e4))
|
|
16
|
+
- **pptx:** Add readOnly to the five viewer bindings ([4aadd67](https://github.com/ChristopherVR/ooxml/commit/4aadd678969d4b2d4811d86880b91c79ba7ca3b6))
|
|
17
|
+
- **pptx:** Report the missing host events from the react viewer ([2ba8c58](https://github.com/ChristopherVR/ooxml/commit/2ba8c58d45446cf912eab5d3c4c026a55fd50a3e))
|
|
18
|
+
- **pptx:** Report inspector and AI property edits, emit vue dirty-change ([83d879d](https://github.com/ChristopherVR/ooxml/commit/83d879d4e27dec236e32af86064afebac21c6af9))
|
|
19
|
+
- **embedding:** Land the host customization, read-only and storage contracts ([822a6a0](https://github.com/ChristopherVR/ooxml/commit/822a6a073840b9e9d1671476542322b28332dc42))
|
|
20
|
+
- **automation:** Run the document tools against open editors ([6a45ebc](https://github.com/ChristopherVR/ooxml/commit/6a45ebc3651a21739b5e18e7758395c866656198))
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
- **pptx:** Scope the viewer stylesheet reset to the viewer roots ([c390b2b](https://github.com/ChristopherVR/ooxml/commit/c390b2ba2f0ec7811c3554b9989346c6e8cd927d))
|
|
25
|
+
- **pptx:** Fit the react slide before its first paint ([#164](https://github.com/ChristopherVR/ooxml/issues/164)) ([a8eed20](https://github.com/ChristopherVR/ooxml/commit/a8eed2004fbfe69d79f9ceaab785b09fe0fbb8f2))
|
|
26
|
+
- **pptx:** Report host save failures and use host recovery everywhere ([8e982c8](https://github.com/ChristopherVR/ooxml/commit/8e982c8576f656d10200a45cc1708a5ac8e14ed6))
|
|
27
|
+
- **pptx:** Align cache maintenance tests with the shared sweeps ([a13ff2d](https://github.com/ChristopherVR/ooxml/commit/a13ff2d5f487599fe43a37a503436bd069375479))
|
|
28
|
+
|
|
29
|
+
### Other
|
|
30
|
+
|
|
31
|
+
- Integrate the customization contract into host storage ([629554b](https://github.com/ChristopherVR/ooxml/commit/629554b3030728bfe16e11ac8ae5b2530bb28a17))
|
|
32
|
+
- Integrate the pptx binding events into host storage ([08272a2](https://github.com/ChristopherVR/ooxml/commit/08272a298c8b249aa0bf143b689ff01f66663309))
|
|
33
|
+
- Bring origin/main into the embedding work ([a3711a1](https://github.com/ChristopherVR/ooxml/commit/a3711a14049a2cd11b994e76eafec039db2dc2de))
|
|
34
|
+
|
|
35
|
+
### Performance
|
|
36
|
+
|
|
37
|
+
- **react:** Let hosts tree-shake unused components from the bundle ([5959b25](https://github.com/ChristopherVR/ooxml/commit/5959b2586753af02bafb10e9520b373293551935))
|
|
38
|
+
|
|
39
|
+
### Testing
|
|
40
|
+
|
|
41
|
+
- **react:** Compare canvas.css sources as posix paths ([3fc535c](https://github.com/ChristopherVR/ooxml/commit/3fc535c1513d848ed548fcf6bd0d986325ae2be4))
|
|
42
|
+
|
|
43
|
+
## [Unreleased]
|
|
44
|
+
|
|
45
|
+
### Documentation
|
|
46
|
+
|
|
47
|
+
- Point script, e2e and plan references at real paths ([eec05e2](https://github.com/ChristopherVR/ooxml/commit/eec05e293e6149c0ecf2dd3c863694721949294a))
|
|
48
|
+
|
|
49
|
+
## [4.46.0](https://github.com/ChristopherVR/ooxml/releases/tag/pptx-react-viewer@4.46.0) - 2026-10-22
|
|
50
|
+
|
|
51
|
+
### Features
|
|
52
|
+
|
|
53
|
+
- **pptx:** Confirm owner write-back and report its status ([2cb779f](https://github.com/ChristopherVR/ooxml/commit/2cb779f606c7d8d0778c11be830433fc93f728c3))
|
|
54
|
+
|
|
55
|
+
### Documentation
|
|
56
|
+
|
|
57
|
+
- **pptx:** Sync english docs with the monorepo layout and apis ([4b89444](https://github.com/ChristopherVR/ooxml/commit/4b89444ac835ae6ed61ef1f6f7a3fc0d23aac7f5))
|
|
58
|
+
- **pptx:** Fix demo paths and shared facade wording in package readmes ([4caf3d2](https://github.com/ChristopherVR/ooxml/commit/4caf3d2471527b484f1e1b6b2d3f5add11a92048))
|
|
59
|
+
|
|
10
60
|
## [4.45.0](https://github.com/ChristopherVR/ooxml/releases/tag/pptx-react-viewer@4.45.0) - 2026-10-22
|
|
11
61
|
|
|
12
62
|
### Features
|
package/README.md
CHANGED
|
@@ -228,6 +228,8 @@ viewport rather than the whole 540 px host.
|
|
|
228
228
|
|
|
229
229
|
`useViewerBuildingBlocks` accepts the same `content` / `canEdit` / `filePath` / `hiddenActions` / `onDirtyChange`-style inputs as `PowerPointViewer`, plus `onOpenSettings` / `onOpenHeaderFooter` / `onOpenShareDialog` callbacks (fired by the corresponding toolbar buttons) since this composition doesn't render those dialogs itself. It's an additive alternative, not a replacement: dialogs, presentation-mode overlays, mobile chrome, resizable side panels, and real-time collaboration are all part of `PowerPointViewer` and are out of scope for these building blocks. Reach for `PowerPointViewer` when you need the full editor; reach for `useViewerBuildingBlocks` when you're assembling your own chrome around just the toolbar and canvas.
|
|
230
230
|
|
|
231
|
+
The bundled stylesheet's base reset (Tailwind's preflight) applies only inside the viewer root, a canvas viewport and elements with a `data-pptx-scope` attribute, so your page's own headings, lists and margins stay as they are. `SlideCanvas` and `Toolbar` carry the scope themselves; give any other element of a composed shell that uses the viewer's classes an ancestor with `data-pptx-scope`. A canvas-only shell can import `pptx-react-viewer/canvas.css` instead of `pptx-react-viewer/styles`.
|
|
232
|
+
|
|
231
233
|
---
|
|
232
234
|
|
|
233
235
|
## Styling & theming
|
|
@@ -236,6 +238,7 @@ The viewer's UI references **CSS custom properties** (`--pptx-*`, the shadcn/ui
|
|
|
236
238
|
|
|
237
239
|
- **Tailwind CSS v4 project**: the viewer classes resolve through your existing Tailwind tokens. No extra CSS import needed.
|
|
238
240
|
- **No Tailwind**: import the bundled stylesheet once at your app entry: `import 'pptx-react-viewer/styles';`
|
|
241
|
+
- **Canvas only**: a host that renders just `SlideCanvas` (see [Composing a custom viewer shell](#composing-a-custom-viewer-shell)) can import `pptx-react-viewer/canvas.css` instead: the same tokens and reset with only the utilities the canvas uses (about 46 KB, 8 KB gzipped, against 112 KB, 16 KB gzipped).
|
|
239
242
|
- **CSS custom properties**: define the `--pptx-*` properties yourself for full control.
|
|
240
243
|
|
|
241
244
|
Override specific values with the `theme` prop:
|
|
@@ -264,7 +267,7 @@ The underlying palettes (`vermilionLightColors`, `vermilionDarkColors`) and radi
|
|
|
264
267
|
|
|
265
268
|
## Localization (i18n)
|
|
266
269
|
|
|
267
|
-
UI labels go through [i18next](https://www.i18next.com/) / [react-i18next](https://react.i18next.com/) with dotted keys such as `pptx.statusBar.allSaved`. Initialise an i18next instance and wrap your app in `I18nextProvider` (the demo's `demo/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.
|
|
270
|
+
UI labels go through [i18next](https://www.i18next.com/) / [react-i18next](https://react.i18next.com/) with dotted keys such as `pptx.statusBar.allSaved`. 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.
|
|
268
271
|
|
|
269
272
|
## How it's built
|
|
270
273
|
|
|
@@ -273,7 +276,7 @@ You only need the `<PowerPointViewer>` component; everything else is internal. B
|
|
|
273
276
|
A small curated set of those hooks is exported from `pptx-react-viewer/viewer` with a stable API; the complete set (80+) is also importable from `pptx-react-viewer/internals` for advanced integrations. The `internals` subpath is **not covered by semver**: prefer the stable root exports. See the [Hooks reference](https://christophervr.github.io/ooxml/pptx/react/hooks-reference) for the full list.
|
|
274
277
|
|
|
275
278
|
The bulk of that cross-framework logic (colour/geometry/connector/animation/chart math, slide
|
|
276
|
-
transitions, and more) actually lives in `pptx-viewer-shared`,
|
|
279
|
+
transitions, and more) actually lives in `pptx-viewer-shared`, a private facade over the shared renderer in `ooxml-ui/pptx`, that is
|
|
277
280
|
**never published to npm**. If you need one of those framework-neutral helpers directly, for
|
|
278
281
|
example the slide-transition resolver/keyframes (`resolveSlideTransition`,
|
|
279
282
|
`resolveTransitionDurationMs`, `SLIDE_TRANSITION_KEYFRAMES`) or the `PresentationTransitionOverlay`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cn } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
import { cn } from './chunk-BVQSH5SS.mjs';
|
|
2
|
+
import './chunk-UV2HVMKZ.mjs';
|
|
3
3
|
import { useMemo, useRef, useState, useEffect, useReducer, useCallback } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { LuSparkles, LuX, LuLoaderCircle, LuTriangleAlert, LuHistory, LuMessageSquarePlus, LuTrash2, LuPlus, LuGitMerge, LuCrosshair, LuPinOff, LuPin, LuUser, LuBot, LuCheck, LuSquare, LuSend, LuMessageSquare, LuPalette, LuUndo2, LuWrench, LuStickyNote, LuFilm, LuNavigation, LuSearch, LuMove, LuChartColumn, LuLayoutTemplate, LuTable, LuShapes, LuType, LuEye } from 'react-icons/lu';
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkMA2BI7LX_js = require('./chunk-MA2BI7LX.js');
|
|
4
|
+
require('./chunk-PIRHQTI4.js');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var reactI18next = require('react-i18next');
|
|
7
7
|
var lu = require('react-icons/lu');
|
|
@@ -365,7 +365,7 @@ function AiComposer({
|
|
|
365
365
|
disabled: value.trim().length === 0,
|
|
366
366
|
title: t("pptx.ai.send"),
|
|
367
367
|
"aria-label": t("pptx.ai.send"),
|
|
368
|
-
className:
|
|
368
|
+
className: chunkMA2BI7LX_js.cn(
|
|
369
369
|
"shrink-0 rounded-sm p-1.5 transition-colors",
|
|
370
370
|
value.trim().length === 0 ? "text-muted-foreground/50" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
371
371
|
),
|
|
@@ -396,7 +396,7 @@ function AiFocusBar({
|
|
|
396
396
|
chips.map((chip) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
397
397
|
"span",
|
|
398
398
|
{
|
|
399
|
-
className:
|
|
399
|
+
className: chunkMA2BI7LX_js.cn(
|
|
400
400
|
"inline-flex max-w-[10rem] items-center rounded-full px-2 py-0.5 text-[11px]",
|
|
401
401
|
hasPicks || isPinned ? "bg-primary/15 text-primary" : "bg-muted text-muted-foreground"
|
|
402
402
|
),
|
|
@@ -433,7 +433,7 @@ function AiFocusBar({
|
|
|
433
433
|
title: t("pptx.ai.pickElement"),
|
|
434
434
|
"aria-label": t("pptx.ai.pickAria"),
|
|
435
435
|
"aria-pressed": pickMode,
|
|
436
|
-
className:
|
|
436
|
+
className: chunkMA2BI7LX_js.cn(
|
|
437
437
|
"rounded-sm p-1 max-md:min-w-[44px]! max-md:min-h-[44px]! flex items-center justify-center",
|
|
438
438
|
pickMode ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-accent"
|
|
439
439
|
),
|
|
@@ -512,7 +512,7 @@ function AiHistoryList({ chats, activeChatId, onResume, onDelete }) {
|
|
|
512
512
|
{
|
|
513
513
|
type: "button",
|
|
514
514
|
onClick: () => onResume(chat.id),
|
|
515
|
-
className:
|
|
515
|
+
className: chunkMA2BI7LX_js.cn(
|
|
516
516
|
"flex min-w-0 flex-1 items-start gap-2 rounded-sm px-2 py-1.5 text-left hover:bg-accent",
|
|
517
517
|
chat.id === activeChatId && "bg-accent/60"
|
|
518
518
|
),
|
|
@@ -676,17 +676,17 @@ function AiToolCallCard({ part }) {
|
|
|
676
676
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
677
677
|
Icon,
|
|
678
678
|
{
|
|
679
|
-
className:
|
|
679
|
+
className: chunkMA2BI7LX_js.cn(
|
|
680
680
|
"w-3.5 h-3.5 shrink-0",
|
|
681
681
|
failed ? "text-destructive" : "text-muted-foreground"
|
|
682
682
|
)
|
|
683
683
|
}
|
|
684
684
|
),
|
|
685
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
685
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkMA2BI7LX_js.cn("truncate", failed ? "text-destructive" : "text-foreground"), children: activity.label }),
|
|
686
686
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
687
687
|
"span",
|
|
688
688
|
{
|
|
689
|
-
className:
|
|
689
|
+
className: chunkMA2BI7LX_js.cn(
|
|
690
690
|
"ml-auto inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 text-[10px]",
|
|
691
691
|
failed ? "bg-destructive/15 text-destructive" : done ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground"
|
|
692
692
|
),
|
|
@@ -734,7 +734,7 @@ function AiMessageList({ messages, isStreaming, bridge }) {
|
|
|
734
734
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
735
735
|
"div",
|
|
736
736
|
{
|
|
737
|
-
className:
|
|
737
|
+
className: chunkMA2BI7LX_js.cn(
|
|
738
738
|
"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full",
|
|
739
739
|
isUser ? "bg-secondary text-muted-foreground" : "bg-primary/15 text-primary"
|
|
740
740
|
),
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SHAPE_PRESET_DEFS, VIEWER_SHORTCUT_REFERENCE, STROKE_DASH_OPTIONS as STROKE_DASH_OPTIONS$1, getAnimationInitialStyle as getAnimationInitialStyle$1, cloneHistorySnapshot as cloneHistorySnapshot$1, getImageFitStyle, getImageFillCounterTransform, getComputedFillStyle, getCropShapeClipPath as getCropShapeClipPath$1, getImageTilingStyle as getImageTilingStyle$1, mediaPlaybackAttributes, getOnlineVideoEmbed, ONLINE_VIDEO_IFRAME_SANDBOX, ONLINE_VIDEO_IFRAME_ALLOW, buildTextBlockStyle, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle as buildTextBody3DSceneStyle$1, buildParagraphs, followingText, colorWithOpacity, normalizeHexColor, hexToRgbUnit, build3DExtrusionData as build3DExtrusionData$1, getFrameEffectStyle, getComputedEffectStyle, getComputedStrokeStyle, getAnimationColorBaseStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, screenStrokeWidth, markerPath, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, isArrowedCustomPath, buildStrokeOutline, getPresetShapeVectorGeometry, isWedgeCalloutPresetShape, svgGradientFillRef, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, canDrillDown, computeSelectionRect, DEFAULT_FONT_FAMILY as DEFAULT_FONT_FAMILY$1, cellStyleToCss, TABLE_CELL_TEXT_DEFAULTS, applyTableCellFontWeight, rectToCells, isCellInRect, tableContainerCss, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildTiledSlidesPdfBytes, buildPreviewAnimation, measurePreviewGeometry, buildMotionPathPreview, mediaFallbackVisual, scheduleMediaTrimAndFade, registerCrossSlideAudio, shouldShowMediaFullscreenStopButton, withInlineListDecorationDefaults, segmentStyleToCss, resolveAutoFitFontScale, applyUnderlineVariant, nestedTextDecorationStyle, scaleFontSizeForAutoFit, resolveFontKerning, resolveScriptFontSet, hasDistinctScriptFonts, authoredLetterSpacingPx, eastAsianBreaksForRun, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, splitsUnderlineIntoWords, stripUnderlineDecoration, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects as apply3dEffects$1, buildSubpathPaints, computeColumnBoundaries, computeTableMergeCrossings, columnHandleSegments, rowHandleSegments, getTableCellBandStyle as getTableCellBandStyle$1, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders as getCellDiagonalBorders$1, cellParagraphBlocks, resolveChartPalette, computeChartLegendLayout, resolveChartSvgDef, mediaFallbackIcon, mediaFallbackLabelKey, MEDIA_CHROME_ATTRIBUTE, convertOmmlToMathMl, sanitizeMathMl, tableCellCss, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, buildRectPathGradient, screenBorder, cellRunStyle, buildRunTabLines, chartPartToAttrs, splitWordsForUnderline, splitRunForMetrics, splitEastAsianBreaks, splitRunByScriptFont } from 'ooxml-ui/pptx';
|
|
1
|
+
import { VIEWER_SHORTCUT_REFERENCE, STROKE_DASH_OPTIONS as STROKE_DASH_OPTIONS$1, getAnimationInitialStyle as getAnimationInitialStyle$1, cloneHistorySnapshot as cloneHistorySnapshot$1, SHAPE_PRESET_DEFS, getImageFitStyle, getImageFillCounterTransform, getComputedFillStyle, getCropShapeClipPath as getCropShapeClipPath$1, getImageTilingStyle as getImageTilingStyle$1, mediaPlaybackAttributes, getOnlineVideoEmbed, ONLINE_VIDEO_IFRAME_SANDBOX, ONLINE_VIDEO_IFRAME_ALLOW, buildTextBlockStyle, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle as buildTextBody3DSceneStyle$1, buildParagraphs, followingText, colorWithOpacity, normalizeHexColor, hexToRgbUnit, build3DExtrusionData as build3DExtrusionData$1, getFrameEffectStyle, getComputedEffectStyle, getComputedStrokeStyle, getAnimationColorBaseStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, screenStrokeWidth, markerPath, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, isArrowedCustomPath, buildStrokeOutline, getPresetShapeVectorGeometry, isWedgeCalloutPresetShape, svgGradientFillRef, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, canDrillDown, computeSelectionRect, DEFAULT_FONT_FAMILY as DEFAULT_FONT_FAMILY$1, cellStyleToCss, TABLE_CELL_TEXT_DEFAULTS, applyTableCellFontWeight, rectToCells, isCellInRect, tableContainerCss, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildTiledSlidesPdfBytes, buildPreviewAnimation, measurePreviewGeometry, buildMotionPathPreview, mediaFallbackVisual, scheduleMediaTrimAndFade, registerCrossSlideAudio, shouldShowMediaFullscreenStopButton, withInlineListDecorationDefaults, segmentStyleToCss, resolveAutoFitFontScale, applyUnderlineVariant, nestedTextDecorationStyle, scaleFontSizeForAutoFit, resolveFontKerning, resolveScriptFontSet, hasDistinctScriptFonts, authoredLetterSpacingPx, eastAsianBreaksForRun, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, splitsUnderlineIntoWords, stripUnderlineDecoration, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects as apply3dEffects$1, buildSubpathPaints, computeColumnBoundaries, computeTableMergeCrossings, columnHandleSegments, rowHandleSegments, getTableCellBandStyle as getTableCellBandStyle$1, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders as getCellDiagonalBorders$1, cellParagraphBlocks, resolveChartPalette, computeChartLegendLayout, resolveChartSvgDef, mediaFallbackIcon, mediaFallbackLabelKey, MEDIA_CHROME_ATTRIBUTE, convertOmmlToMathMl, sanitizeMathMl, tableCellCss, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, buildRectPathGradient, screenBorder, cellRunStyle, buildRunTabLines, chartPartToAttrs, splitWordsForUnderline, splitRunForMetrics, splitEastAsianBreaks, splitRunByScriptFont } from 'ooxml-ui/pptx';
|
|
3
2
|
export { ACTION_BUTTON_PRESETS, DEFAULT_COLOR_CHANGE_TOLERANCE, INK_REPLAY_KEYFRAMES, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, SHAPE_QUICK_STYLES, SLIDE_TRANSITION_OPTIONS, TABLE_STYLE_PRESETS, applyColorChange, applyFormatToElement, applyReroutedConnectors, buildCacheKey, buildContentPartStrokes, buildCssGradientFromShapeStyle, buildInkGroupStrokes, buildSaveSlides, canvasToJpegData, clampCropValue, cloneSlide, cloneTemplateElementsBySlideId, colorWithOpacity, comparePresentation, computeHandoutLayout, computeSnapToShape, copyFormatFromElement, formatCommentTimestamp, generateNoteLineCount, getAriaLabel, getAriaRole, getAriaRoleDescription, getCachedResult, getCompoundLineOffsets, getCompoundLineWidths, getContentPartReplayStyles, getElementLabel, getElementTransform, getElementTransformWithoutRotation, getImageEffectsFilter, getImageEffectsOpacity, getInkReplayStyles, getPatternSvg, getPrintableArea, getShapeAdjustmentHandleDescriptors, getSvgStrokeDasharray, getTextCompensationTransform, hasCopyableFormat, isEditableTextElement, isImageTiled, isPpactionUrl, isTemplateElementId, isUrlSafe, makeCloneId, mergeCells, normalizeHexColor, normalizeStrokeDashType, openNativeEyeDropper, parsePpactionUrl, partitionTemplateElements, rerouteConnectorsForMovedElements, safeOpenUrl, sanitizeGradientStops, setCachedResult, splitCell, stopAllPersistentAudio, substituteFieldText } from 'ooxml-ui/pptx';
|
|
4
|
-
import * as pptx_star from 'ooxml-core/pptx';
|
|
5
3
|
import { clsx } from 'clsx';
|
|
6
4
|
import { twMerge } from 'tailwind-merge';
|
|
7
5
|
import React8, { useRef, useState, useEffect, useCallback, useMemo, useLayoutEffect } from 'react';
|
|
8
6
|
import { LuTriangle, LuPlus, LuMoveRight, LuMinus, LuDiamond, LuDatabase, LuCircle, LuSquare } from 'react-icons/lu';
|
|
7
|
+
import { hasShapeProperties, isImageLikeElement, hasTextProperties, getConnectorPathGeometry as getConnectorPathGeometry$1, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, getSubstituteFontFamily, parsePanoseString, customGeometryPathsToSvgSubpaths, xmlText, ooxmlGradientAngleToCssDegrees } from 'ooxml-core/pptx';
|
|
8
|
+
export { updateCellTextInRawXml, updateCellTextStyleInRawXml, updateMergeAttrsInRawXml } from 'ooxml-core/pptx';
|
|
9
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
10
|
import { translationsEn } from 'ooxml-ui/pptx/i18n';
|
|
11
11
|
import { useTranslation } from 'react-i18next';
|
|
12
12
|
|
|
13
|
+
// src/viewer/utils/animation-effects.ts
|
|
13
14
|
function getAnimationInitialStyle(preset, nativeAnimation) {
|
|
14
15
|
return getAnimationInitialStyle$1(preset, nativeAnimation);
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
// ../core/dist/index.mjs
|
|
18
|
-
var dist_exports = {};
|
|
19
|
-
__reExport(dist_exports, pptx_star);
|
|
20
17
|
function cn(...inputs) {
|
|
21
18
|
return twMerge(clsx(inputs));
|
|
22
19
|
}
|
|
@@ -81,16 +78,14 @@ var GLYPH_COMPONENTS = {
|
|
|
81
78
|
plus: LuPlus,
|
|
82
79
|
triangle: LuTriangle
|
|
83
80
|
};
|
|
84
|
-
var SHAPE_PRESETS = SHAPE_PRESET_DEFS.map(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
className: def.glyphClass ? `w-3.5 h-3.5 ${def.glyphClass}` : "w-3.5 h-3.5"
|
|
91
|
-
})
|
|
81
|
+
var SHAPE_PRESETS = /* @__PURE__ */ SHAPE_PRESET_DEFS.map((def) => ({
|
|
82
|
+
type: def.type,
|
|
83
|
+
label: def.label,
|
|
84
|
+
i18nKey: def.i18nKey,
|
|
85
|
+
icon: React8.createElement(GLYPH_COMPONENTS[def.glyph], {
|
|
86
|
+
className: def.glyphClass ? `w-3.5 h-3.5 ${def.glyphClass}` : "w-3.5 h-3.5"
|
|
92
87
|
})
|
|
93
|
-
);
|
|
88
|
+
}));
|
|
94
89
|
var CONNECTOR_ARROW_OPTIONS = [
|
|
95
90
|
{ value: "none", label: "None", i18nKey: "pptx.arrowhead.none" },
|
|
96
91
|
{ value: "triangle", label: "Triangle", i18nKey: "pptx.arrowhead.triangle" },
|
|
@@ -211,14 +206,14 @@ function isConnectorOrLineElement(element) {
|
|
|
211
206
|
if (element.type === "connector") {
|
|
212
207
|
return true;
|
|
213
208
|
}
|
|
214
|
-
if (!
|
|
209
|
+
if (!hasShapeProperties(element)) {
|
|
215
210
|
return false;
|
|
216
211
|
}
|
|
217
212
|
const st = getShapeType(element.shapeType);
|
|
218
213
|
return st === "connector" || st === "line" || element.shapeType === "line";
|
|
219
214
|
}
|
|
220
215
|
function getImageMaskStyle(element) {
|
|
221
|
-
if (!
|
|
216
|
+
if (!hasShapeProperties(element)) {
|
|
222
217
|
return void 0;
|
|
223
218
|
}
|
|
224
219
|
const geometry = resolveShapeGeometry(element);
|
|
@@ -248,7 +243,7 @@ function getImageSurfaceMaskStyle(element) {
|
|
|
248
243
|
};
|
|
249
244
|
}
|
|
250
245
|
function getImageSurfaceStyle(element) {
|
|
251
|
-
const fill =
|
|
246
|
+
const fill = hasShapeProperties(element) ? getComputedFillStyle(element) : void 0;
|
|
252
247
|
return {
|
|
253
248
|
position: "absolute",
|
|
254
249
|
inset: 0,
|
|
@@ -261,7 +256,7 @@ function getImageSurfaceStyle(element) {
|
|
|
261
256
|
};
|
|
262
257
|
}
|
|
263
258
|
function getCropShapeClipPath(element) {
|
|
264
|
-
if (!
|
|
259
|
+
if (!isImageLikeElement(element)) {
|
|
265
260
|
return void 0;
|
|
266
261
|
}
|
|
267
262
|
return getCropShapeClipPath$1(element.cropShape, element.width, element.height);
|
|
@@ -784,7 +779,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
784
779
|
return buildTextBlockStyle(element, { fallbackColor });
|
|
785
780
|
}
|
|
786
781
|
function getTextLayoutStyle(element) {
|
|
787
|
-
if (!
|
|
782
|
+
if (!hasTextProperties(element)) {
|
|
788
783
|
return {};
|
|
789
784
|
}
|
|
790
785
|
const writingMode = toCssWritingMode(element.textStyle?.textDirection);
|
|
@@ -792,7 +787,7 @@ function getTextLayoutStyle(element) {
|
|
|
792
787
|
const verticalDirection = toCssVerticalDirection(element.textStyle?.textDirection);
|
|
793
788
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
794
789
|
const shapeAutoFitTextBox = element.textStyle?.autoFitMode === "shrink" && (element.type === "text" || element.locks?.txBox === true);
|
|
795
|
-
const hasParagraphIndents =
|
|
790
|
+
const hasParagraphIndents = hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
796
791
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
797
792
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
798
793
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -1385,9 +1380,9 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1385
1380
|
segmentStyle.scriptFallbackFont && segmentStyle.fontFamilyIsCascadeDefault
|
|
1386
1381
|
);
|
|
1387
1382
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1388
|
-
const baseFontFamily = scriptFallbackWins ?
|
|
1383
|
+
const baseFontFamily = scriptFallbackWins ? getSubstituteFontFamily(segmentStyle.scriptFallbackFont) : rawFontFamily ? getSubstituteFontFamily(
|
|
1389
1384
|
rawFontFamily,
|
|
1390
|
-
|
|
1385
|
+
parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1391
1386
|
) : DEFAULT_FONT_FAMILY;
|
|
1392
1387
|
const scriptFonts = resolveScriptFontSet(segmentStyle, element.textStyle, baseFontFamily);
|
|
1393
1388
|
const needsScriptFonts = hasDistinctScriptFonts(scriptFonts);
|
|
@@ -1503,7 +1498,7 @@ function renderSeededListRun(seed, runs, segments, context) {
|
|
|
1503
1498
|
});
|
|
1504
1499
|
}
|
|
1505
1500
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick, placeholderPrompt, inlineListSeed) {
|
|
1506
|
-
if (!
|
|
1501
|
+
if (!hasTextProperties(element)) {
|
|
1507
1502
|
return emptyFallback || null;
|
|
1508
1503
|
}
|
|
1509
1504
|
const segments = segmentOverrides ?? element.textSegments;
|
|
@@ -1667,13 +1662,13 @@ function renderBulletMarker(para, paraIndex, elementId) {
|
|
|
1667
1662
|
);
|
|
1668
1663
|
}
|
|
1669
1664
|
function getDuotoneColors(element) {
|
|
1670
|
-
if (!
|
|
1665
|
+
if (!isImageLikeElement(element)) {
|
|
1671
1666
|
return void 0;
|
|
1672
1667
|
}
|
|
1673
1668
|
return element.imageEffects?.duotone;
|
|
1674
1669
|
}
|
|
1675
1670
|
function buildLineShadowCss(element) {
|
|
1676
|
-
if (!
|
|
1671
|
+
if (!hasShapeProperties(element)) {
|
|
1677
1672
|
return void 0;
|
|
1678
1673
|
}
|
|
1679
1674
|
const ss = element.shapeStyle;
|
|
@@ -1690,7 +1685,7 @@ function buildLineShadowCss(element) {
|
|
|
1690
1685
|
)}`;
|
|
1691
1686
|
}
|
|
1692
1687
|
function buildLineGlowFilter(element) {
|
|
1693
|
-
if (!
|
|
1688
|
+
if (!hasShapeProperties(element)) {
|
|
1694
1689
|
return void 0;
|
|
1695
1690
|
}
|
|
1696
1691
|
const ss = element.shapeStyle;
|
|
@@ -1706,7 +1701,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
1706
1701
|
return `dag-duotone-${elementId}`;
|
|
1707
1702
|
}
|
|
1708
1703
|
function hasDagDuotoneEffect(element) {
|
|
1709
|
-
if (!
|
|
1704
|
+
if (!hasShapeProperties(element)) {
|
|
1710
1705
|
return false;
|
|
1711
1706
|
}
|
|
1712
1707
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -1787,7 +1782,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1787
1782
|
if (frame) {
|
|
1788
1783
|
return { ...frame };
|
|
1789
1784
|
}
|
|
1790
|
-
if (!
|
|
1785
|
+
if (!hasShapeProperties(element)) {
|
|
1791
1786
|
return {};
|
|
1792
1787
|
}
|
|
1793
1788
|
const ss = element.shapeStyle;
|
|
@@ -1894,7 +1889,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1894
1889
|
}
|
|
1895
1890
|
}
|
|
1896
1891
|
function getConnectorPathGeometry(element) {
|
|
1897
|
-
return
|
|
1892
|
+
return getConnectorPathGeometry$1(element);
|
|
1898
1893
|
}
|
|
1899
1894
|
function renderConnectorMarker(markerId, arrowType, color, arrowWidth, arrowLength) {
|
|
1900
1895
|
if (!arrowType || arrowType === "none") {
|
|
@@ -1994,7 +1989,7 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
1994
1989
|
}
|
|
1995
1990
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
1996
1991
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
1997
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
1992
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
1998
1993
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
1999
1994
|
const gradientPaint = gradient ? svgGradientFillRef(gradient) : void 0;
|
|
2000
1995
|
const nodes = [];
|
|
@@ -2054,7 +2049,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2054
2049
|
);
|
|
2055
2050
|
}
|
|
2056
2051
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2057
|
-
if (!
|
|
2052
|
+
if (!hasShapeProperties(element)) {
|
|
2058
2053
|
return null;
|
|
2059
2054
|
}
|
|
2060
2055
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
@@ -2226,18 +2221,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2226
2221
|
);
|
|
2227
2222
|
}
|
|
2228
2223
|
}
|
|
2229
|
-
if (
|
|
2224
|
+
if (isCalloutShape(normalizedType)) {
|
|
2230
2225
|
const width = Math.max(element.width, 1);
|
|
2231
2226
|
const height = Math.max(element.height, 1);
|
|
2232
|
-
const geometry =
|
|
2227
|
+
const geometry = getCalloutLeaderLineGeometry(
|
|
2233
2228
|
normalizedType,
|
|
2234
2229
|
width,
|
|
2235
2230
|
height,
|
|
2236
2231
|
element.shapeAdjustments
|
|
2237
2232
|
);
|
|
2238
2233
|
if (geometry && geometry.points.length >= 2) {
|
|
2239
|
-
const leaderPath =
|
|
2240
|
-
const bounds =
|
|
2234
|
+
const leaderPath = buildCalloutLeaderLineSvgPath(geometry);
|
|
2235
|
+
const bounds = getCalloutViewBoxBounds(width, height, geometry);
|
|
2241
2236
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2242
2237
|
const offsetLeft = bounds.minX;
|
|
2243
2238
|
const offsetTop = bounds.minY;
|
|
@@ -2379,7 +2374,7 @@ function parseGradientFillCss(gradFill) {
|
|
|
2379
2374
|
const lin = gradFill["a:lin"];
|
|
2380
2375
|
if (lin) {
|
|
2381
2376
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
2382
|
-
const angleDeg = Math.round(
|
|
2377
|
+
const angleDeg = Math.round(ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
2383
2378
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
2384
2379
|
}
|
|
2385
2380
|
const path = gradFill["a:path"];
|
|
@@ -2575,8 +2570,6 @@ function parseCellTextEffects(runProps) {
|
|
|
2575
2570
|
}
|
|
2576
2571
|
return textShadowParts.length > 0 ? textShadowParts.join(", ") : void 0;
|
|
2577
2572
|
}
|
|
2578
|
-
|
|
2579
|
-
// src/viewer/utils/table-cell-style.tsx
|
|
2580
2573
|
function extractCellText(cellXml) {
|
|
2581
2574
|
if (!cellXml) {
|
|
2582
2575
|
return "";
|
|
@@ -2588,11 +2581,11 @@ function extractCellText(cellXml) {
|
|
|
2588
2581
|
const textParts = [];
|
|
2589
2582
|
const runs = ensureArrayValue(paragraph["a:r"]);
|
|
2590
2583
|
runs.forEach((run) => {
|
|
2591
|
-
textParts.push(
|
|
2584
|
+
textParts.push(xmlText(run["a:t"]) ?? "");
|
|
2592
2585
|
});
|
|
2593
2586
|
const fields = ensureArrayValue(paragraph["a:fld"]);
|
|
2594
2587
|
fields.forEach((field) => {
|
|
2595
|
-
textParts.push(
|
|
2588
|
+
textParts.push(xmlText(field["a:t"]) ?? "");
|
|
2596
2589
|
});
|
|
2597
2590
|
paragraphTexts.push(textParts.join(""));
|
|
2598
2591
|
});
|
|
@@ -3934,4 +3927,4 @@ function stopPreviewAnimation() {
|
|
|
3934
3927
|
activePreview = null;
|
|
3935
3928
|
}
|
|
3936
3929
|
|
|
3937
|
-
export { ANIMATION_PRESET_OPTIONS, ARROW_SIZE_OPTIONS, CONNECTOR_ARROW_OPTIONS, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_FILL_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_SECTION_GROUP_ID, DEFAULT_STROKE_COLOR, DEFAULT_TABLE_COLUMNS, DEFAULT_TABLE_ROWS, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_FONT_SIZE, GRID_SIZE, HYPERLINK_COLOR, MIN_ELEMENT_SIZE, SHAPE_PRESETS, SHORTCUT_REFERENCE_ITEMS, SLIDE_NAV_THUMBNAIL_WIDTH, STROKE_DASH_OPTIONS, TOOLBAR_SECTIONS, UNGROUPED_SECTION_ID, ZOOM_TO_SELECTION_PADDING, build3DExtrusionData, buildLineGlowFilter, buildLineShadowCss, buildNotesPdf, buildPdfFromTiledImageData, buildReactChartViewModel, buildTextBody3DSceneStyle, cloneHistorySnapshot, cn,
|
|
3930
|
+
export { ANIMATION_PRESET_OPTIONS, ARROW_SIZE_OPTIONS, CONNECTOR_ARROW_OPTIONS, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_FILL_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_SECTION_GROUP_ID, DEFAULT_STROKE_COLOR, DEFAULT_TABLE_COLUMNS, DEFAULT_TABLE_ROWS, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_FONT_SIZE, GRID_SIZE, HYPERLINK_COLOR, MIN_ELEMENT_SIZE, SHAPE_PRESETS, SHORTCUT_REFERENCE_ITEMS, SLIDE_NAV_THUMBNAIL_WIDTH, STROKE_DASH_OPTIONS, TOOLBAR_SECTIONS, UNGROUPED_SECTION_ID, ZOOM_TO_SELECTION_PADDING, build3DExtrusionData, buildLineGlowFilter, buildLineShadowCss, buildNotesPdf, buildPdfFromTiledImageData, buildReactChartViewModel, buildTextBody3DSceneStyle, cloneHistorySnapshot, cn, getAnimationInitialStyle, getConnectorPathGeometry, getCropShapeClipPath, getDuotoneColors, getImageRenderStyle, getImageSurfaceMaskStyle, getImageSurfaceStyle, getImageTilingStyle, getShapeVisualStyle, getTextLayoutStyle, getTextStyleForElement, getTextWarpStyle, hasDagDuotoneEffect, isConnectorOrLineElement, renderChartElement, renderConnectorMarker, renderDagDuotoneSvgFilter, renderMediaElement, renderTableElement, renderTextSegments, renderVectorShape, shouldRenderFallbackLabel, startMotionPathPreview, startPreviewAnimation, stopPreviewAnimation };
|
|
Binary file
|
|
Binary file
|