pptx-react-viewer 4.50.0 → 4.51.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +38 -4
- package/dist/{AiChatPanel-WYAL24DX.js → AiChatPanel-EV22O7UO.js} +19 -20
- package/dist/AiChatPanel-EV22O7UO.js.br +0 -0
- package/dist/AiChatPanel-EV22O7UO.js.gz +0 -0
- package/dist/{AiChatPanel-VJV5OEG2.mjs → AiChatPanel-R323KNGN.mjs} +1 -2
- package/dist/AiChatPanel-R323KNGN.mjs.br +0 -0
- package/dist/AiChatPanel-R323KNGN.mjs.gz +0 -0
- package/dist/{chunk-5JJQLK7N.mjs → chunk-KCUXY7DE.mjs} +151 -48
- package/dist/chunk-KCUXY7DE.mjs.br +0 -0
- package/dist/chunk-KCUXY7DE.mjs.gz +0 -0
- package/dist/{chunk-QHGEPW5G.mjs → chunk-V4DY4IWP.mjs} +16 -19
- package/dist/chunk-V4DY4IWP.mjs.br +0 -0
- package/dist/chunk-V4DY4IWP.mjs.gz +0 -0
- package/dist/{chunk-4OF7X5EE.js → chunk-VRX5NJY2.js} +693 -589
- package/dist/chunk-VRX5NJY2.js.br +0 -0
- package/dist/chunk-VRX5NJY2.js.gz +0 -0
- package/dist/{chunk-D5NXYXPP.js → chunk-YJ4DAS4V.js} +214 -217
- package/dist/chunk-YJ4DAS4V.js.br +0 -0
- package/dist/chunk-YJ4DAS4V.js.gz +0 -0
- package/dist/{chunk-JWNBTFZZ.js → chunk-Z22RD3E2.js} +41 -6
- package/dist/chunk-Z22RD3E2.js.br +0 -0
- package/dist/chunk-Z22RD3E2.js.gz +0 -0
- package/dist/{chunk-77IXTLKU.mjs → chunk-ZCGYPCZM.mjs} +35 -5
- package/dist/chunk-ZCGYPCZM.mjs.br +0 -0
- package/dist/chunk-ZCGYPCZM.mjs.gz +0 -0
- package/dist/index.d.ts +51 -12
- package/dist/index.js +28 -24
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.js +81 -81
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +2 -2
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +51 -12
- package/dist/viewer/index.js +23 -19
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +3 -3
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +3 -3
- package/dist/AiChatPanel-VJV5OEG2.mjs.br +0 -0
- package/dist/AiChatPanel-VJV5OEG2.mjs.gz +0 -0
- package/dist/AiChatPanel-WYAL24DX.js.br +0 -0
- package/dist/AiChatPanel-WYAL24DX.js.gz +0 -0
- package/dist/chunk-4OF7X5EE.js.br +0 -0
- package/dist/chunk-4OF7X5EE.js.gz +0 -0
- package/dist/chunk-5JJQLK7N.mjs.br +0 -0
- package/dist/chunk-5JJQLK7N.mjs.gz +0 -0
- package/dist/chunk-77IXTLKU.mjs.br +0 -0
- package/dist/chunk-77IXTLKU.mjs.gz +0 -0
- package/dist/chunk-D5NXYXPP.js.br +0 -0
- package/dist/chunk-D5NXYXPP.js.gz +0 -0
- package/dist/chunk-JWNBTFZZ.js.br +0 -0
- package/dist/chunk-JWNBTFZZ.js.gz +0 -0
- package/dist/chunk-QHGEPW5G.mjs.br +0 -0
- package/dist/chunk-QHGEPW5G.mjs.gz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,31 @@ 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.51.1](https://github.com/ChristopherVR/ooxml/releases/tag/pptx-react-viewer@4.51.1) - 2026-10-24
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **pptx:** Stop the fill showing along a widened outline's edge ([52251e3](https://github.com/ChristopherVR/ooxml/commit/52251e39b5e74b0674e19380eee93c963c983a54))
|
|
15
|
+
|
|
16
|
+
## [4.51.0](https://github.com/ChristopherVR/ooxml/releases/tag/pptx-react-viewer@4.51.0) - 2026-10-23
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- **react:** Let hosts translate the viewer through PptxI18nProvider ([d171dc1](https://github.com/ChristopherVR/ooxml/commit/d171dc1ccabdea3c27cac11db9971fd5d23bdab7))
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
- **xlsx:** Close the open code scanning alerts in core ([0f6b643](https://github.com/ChristopherVR/ooxml/commit/0f6b64306e57958a097caaf7085d63479766acb3))
|
|
25
|
+
- **pptx:** Apply theme picks in place and keep theme tiles stable ([ecb6385](https://github.com/ChristopherVR/ooxml/commit/ecb6385a8e211b60461f842eb4a88945555796e5))
|
|
26
|
+
|
|
27
|
+
### Refactor
|
|
28
|
+
|
|
29
|
+
- **react:** Route translations through an internal useTranslation hook ([cbe1912](https://github.com/ChristopherVR/ooxml/commit/cbe1912f38747ca01a07fc7475c0103574b5fb62))
|
|
30
|
+
|
|
31
|
+
### Testing
|
|
32
|
+
|
|
33
|
+
- **pptx:** Copy fixture Buffers by value in the chart save harnesses ([#181](https://github.com/ChristopherVR/ooxml/issues/181)) ([90ce9e4](https://github.com/ChristopherVR/ooxml/commit/90ce9e4704be388ef1ee8723c0b745c3457f07e7))
|
|
34
|
+
|
|
10
35
|
## [4.50.0](https://github.com/ChristopherVR/ooxml/releases/tag/pptx-react-viewer@4.50.0) - 2026-10-23
|
|
11
36
|
|
|
12
37
|
### Features
|
package/README.md
CHANGED
|
@@ -128,9 +128,9 @@ const bytes = await viewerRef.current?.getContent(); // Uint8Array of a valid .p
|
|
|
128
128
|
| `defaultThemeKey` | `string` | n/a | Initial File > Options > Appearance selection when no persisted preference exists |
|
|
129
129
|
| `availableThemes` | `ThemeCatalogEntry[]` | n/a | Theme choices offered by File > Options > Appearance (defaults to the built-in catalog) |
|
|
130
130
|
| `onThemeChange` | `(key: string) => void` | n/a | Host hook for the appearance picker; when set, the host owns persisting the choice |
|
|
131
|
-
| `defaultLocale` | `string` | n/a | Initial locale code when no persisted preference exists
|
|
132
|
-
| `availableLocales` | `LocaleCatalogEntry[]` | n/a | Locale choices offered by File > Options > Language (defaults to the registered i18next locales)
|
|
133
|
-
| `onLocaleChange` | `(code: string) => void` | n/a | Host hook for the language picker; when set, the host owns applying/persisting the switch
|
|
131
|
+
| `defaultLocale` | `string` | n/a | Initial locale code when no persisted preference exists. Ignored inside a `PptxI18nProvider`, whose `locale` is the language |
|
|
132
|
+
| `availableLocales` | `LocaleCatalogEntry[]` | n/a | Locale choices offered by File > Options > Language (defaults to the registered i18next locales; inside a `PptxI18nProvider` no default: pass two or more with `onLocaleChange`) |
|
|
133
|
+
| `onLocaleChange` | `(code: string) => void` | n/a | Host hook for the language picker; when set, the host owns applying/persisting the switch. Inside a `PptxI18nProvider` the host always owns it, and without this callback the Language category is left out |
|
|
134
134
|
| `accountAuth` | `AccountAuthConfig` | n/a | Optional sign-in hook point for File > Account (disabled unless `enabled: true`) |
|
|
135
135
|
|
|
136
136
|
### `PowerPointViewerHandle` (via `ref`)
|
|
@@ -267,7 +267,41 @@ The underlying palettes (`vermilionLightColors`, `vermilionDarkColors`) and radi
|
|
|
267
267
|
|
|
268
268
|
## Localization (i18n)
|
|
269
269
|
|
|
270
|
-
UI labels go through [i18next](https://www.i18next.com/) / [react-i18next](https://react.i18next.com/) with dotted keys such as `pptx.statusBar.allSaved
|
|
270
|
+
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.
|
|
271
|
+
|
|
272
|
+
### Use your own i18n library
|
|
273
|
+
|
|
274
|
+
To translate the viewer with Lingui, FormatJS or any other library, wrap it (or the standalone building blocks) in `PptxI18nProvider` and pass a `translate(key, params)` function plus the active `locale`:
|
|
275
|
+
|
|
276
|
+
```tsx
|
|
277
|
+
import { i18n } from '@lingui/core';
|
|
278
|
+
import { useLingui } from '@lingui/react';
|
|
279
|
+
import { LOCALE_CATALOG, PowerPointViewer, PptxI18nProvider } from 'pptx-react-viewer';
|
|
280
|
+
import type { PptxTranslate } from 'pptx-react-viewer';
|
|
281
|
+
|
|
282
|
+
import { dynamicActivate } from './i18n'; // loads a catalog, then calls i18n.activate(code)
|
|
283
|
+
|
|
284
|
+
// Module level, so it never changes: the viewer re-translates when `locale` changes.
|
|
285
|
+
const translate: PptxTranslate = (key, params) => i18n._(key, params);
|
|
286
|
+
const LOCALES = LOCALE_CATALOG.filter((entry) => ['en', 'fr'].includes(entry.code));
|
|
287
|
+
|
|
288
|
+
function TranslatedViewer({ content }: { content: Uint8Array }) {
|
|
289
|
+
const { i18n: active } = useLingui(); // re-renders when the language changes
|
|
290
|
+
return (
|
|
291
|
+
<PptxI18nProvider locale={active.locale} translate={translate}>
|
|
292
|
+
<PowerPointViewer
|
|
293
|
+
content={content}
|
|
294
|
+
availableLocales={LOCALES}
|
|
295
|
+
onLocaleChange={(code) => void dynamicActivate(code)}
|
|
296
|
+
/>
|
|
297
|
+
</PptxI18nProvider>
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
`translate` receives the viewer's params unchanged: `defaultValue`, `count` and the values of the `{{name}}` placeholders. Use the same names in your catalog (`{name}` in ICU syntax); `count` is a plain value, so pluralise in your catalog. `{{name}}` placeholders left in the text you return are filled too, so the shipped dictionaries work as they are: `const translate: PptxTranslate = (key) => translationsFr[key];`. A miss (the key itself, an empty string, nothing, or a throw) shows the built-in English text, then the call's default text, then a label derived from the key, never a raw key. Keep `translate` stable (a module-level function or `useCallback`): the viewer re-translates whenever `translate` or `locale` changes.
|
|
303
|
+
|
|
304
|
+
Inside a provider the host owns the language: the viewer never calls `changeLanguage`, ignores `defaultLocale` and never restores a stored language choice. File > Options > Language appears only with `onLocaleChange` and two or more `availableLocales`; a pick calls `onLocaleChange`, and the selection follows `locale` (`fr-CA` selects an offered `fr`). A `PowerPointViewer` reads the provider nearest above it; a provider rendered inside the viewer is ignored. `i18next` and `react-i18next` stay required peer dependencies in 4.x: install them, but inside a provider the viewer does not use them. `PptxI18nProvider` is React-only: the Vue and Angular bindings delegate to vue-i18n and ngx-translate, and Vanilla and Svelte take `messages` dictionaries.
|
|
271
305
|
|
|
272
306
|
## How it's built
|
|
273
307
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZ22RD3E2_js = require('./chunk-Z22RD3E2.js');
|
|
4
4
|
require('./chunk-PIRHQTI4.js');
|
|
5
5
|
var react = require('react');
|
|
6
|
-
var reactI18next = require('react-i18next');
|
|
7
6
|
var lu = require('react-icons/lu');
|
|
8
7
|
var ai = require('ooxml-ui/pptx/ai');
|
|
9
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -302,7 +301,7 @@ function AiComposer({
|
|
|
302
301
|
prefillText,
|
|
303
302
|
prefillNonce
|
|
304
303
|
}) {
|
|
305
|
-
const { t } =
|
|
304
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
306
305
|
const [value, setValue] = react.useState("");
|
|
307
306
|
const textareaRef = react.useRef(null);
|
|
308
307
|
const appliedNonce = react.useRef(void 0);
|
|
@@ -365,7 +364,7 @@ function AiComposer({
|
|
|
365
364
|
disabled: value.trim().length === 0,
|
|
366
365
|
title: t("pptx.ai.send"),
|
|
367
366
|
"aria-label": t("pptx.ai.send"),
|
|
368
|
-
className:
|
|
367
|
+
className: chunkZ22RD3E2_js.cn(
|
|
369
368
|
"shrink-0 rounded-sm p-1.5 transition-colors",
|
|
370
369
|
value.trim().length === 0 ? "text-muted-foreground/50" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
371
370
|
),
|
|
@@ -387,7 +386,7 @@ function AiFocusBar({
|
|
|
387
386
|
onStopPick,
|
|
388
387
|
onClearPicks
|
|
389
388
|
}) {
|
|
390
|
-
const { t } =
|
|
389
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
391
390
|
const chips = ai.focusTargetChips(targets, slides);
|
|
392
391
|
const twoTables = ai.isTwoTableFocus(targets, slides);
|
|
393
392
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b border-border bg-secondary/30", children: [
|
|
@@ -396,7 +395,7 @@ function AiFocusBar({
|
|
|
396
395
|
chips.map((chip) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
397
396
|
"span",
|
|
398
397
|
{
|
|
399
|
-
className:
|
|
398
|
+
className: chunkZ22RD3E2_js.cn(
|
|
400
399
|
"inline-flex max-w-[10rem] items-center rounded-full px-2 py-0.5 text-[11px]",
|
|
401
400
|
hasPicks || isPinned ? "bg-primary/15 text-primary" : "bg-muted text-muted-foreground"
|
|
402
401
|
),
|
|
@@ -433,7 +432,7 @@ function AiFocusBar({
|
|
|
433
432
|
title: t("pptx.ai.pickElement"),
|
|
434
433
|
"aria-label": t("pptx.ai.pickAria"),
|
|
435
434
|
"aria-pressed": pickMode,
|
|
436
|
-
className:
|
|
435
|
+
className: chunkZ22RD3E2_js.cn(
|
|
437
436
|
"rounded-sm p-1 max-md:min-w-[44px]! max-md:min-h-[44px]! flex items-center justify-center",
|
|
438
437
|
pickMode ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-accent"
|
|
439
438
|
),
|
|
@@ -502,7 +501,7 @@ function relativeTime(from, now = Date.now()) {
|
|
|
502
501
|
return `${weeks}w ago`;
|
|
503
502
|
}
|
|
504
503
|
function AiHistoryList({ chats, activeChatId, onResume, onDelete }) {
|
|
505
|
-
const { t } =
|
|
504
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
506
505
|
if (chats.length === 0) {
|
|
507
506
|
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-3 py-4 text-center text-[12px] text-muted-foreground", children: t("pptx.ai.historyEmpty") });
|
|
508
507
|
}
|
|
@@ -512,7 +511,7 @@ function AiHistoryList({ chats, activeChatId, onResume, onDelete }) {
|
|
|
512
511
|
{
|
|
513
512
|
type: "button",
|
|
514
513
|
onClick: () => onResume(chat.id),
|
|
515
|
-
className:
|
|
514
|
+
className: chunkZ22RD3E2_js.cn(
|
|
516
515
|
"flex min-w-0 flex-1 items-start gap-2 rounded-sm px-2 py-1.5 text-left hover:bg-accent",
|
|
517
516
|
chat.id === activeChatId && "bg-accent/60"
|
|
518
517
|
),
|
|
@@ -551,7 +550,7 @@ function AiHistoryMenu({
|
|
|
551
550
|
onNewChat,
|
|
552
551
|
onClose
|
|
553
552
|
}) {
|
|
554
|
-
const { t } =
|
|
553
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
555
554
|
const ref = react.useRef(null);
|
|
556
555
|
react.useEffect(() => {
|
|
557
556
|
const handler = (e) => {
|
|
@@ -617,7 +616,7 @@ function appliedThemeFromPart(part) {
|
|
|
617
616
|
return { summary: out.summary ?? "Theme updated", previous: out.previous ?? {} };
|
|
618
617
|
}
|
|
619
618
|
function AiAppliedThemeCard({ summary, onUndo }) {
|
|
620
|
-
const { t } =
|
|
619
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
621
620
|
const [undone, setUndone] = react.useState(false);
|
|
622
621
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 rounded-md border border-primary/30 bg-primary/5 px-2.5 py-1.5 text-[12px]", children: [
|
|
623
622
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuPalette, { className: "w-3.5 h-3.5 shrink-0 text-primary" }),
|
|
@@ -663,7 +662,7 @@ var ICONS = {
|
|
|
663
662
|
tool: lu.LuWrench
|
|
664
663
|
};
|
|
665
664
|
function AiToolCallCard({ part }) {
|
|
666
|
-
const { t } =
|
|
665
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
667
666
|
const failed = part.state === "output-error";
|
|
668
667
|
const done = part.state === "output-available";
|
|
669
668
|
const running = !failed && !done;
|
|
@@ -676,17 +675,17 @@ function AiToolCallCard({ part }) {
|
|
|
676
675
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
677
676
|
Icon,
|
|
678
677
|
{
|
|
679
|
-
className:
|
|
678
|
+
className: chunkZ22RD3E2_js.cn(
|
|
680
679
|
"w-3.5 h-3.5 shrink-0",
|
|
681
680
|
failed ? "text-destructive" : "text-muted-foreground"
|
|
682
681
|
)
|
|
683
682
|
}
|
|
684
683
|
),
|
|
685
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
684
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkZ22RD3E2_js.cn("truncate", failed ? "text-destructive" : "text-foreground"), children: activity.label }),
|
|
686
685
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
687
686
|
"span",
|
|
688
687
|
{
|
|
689
|
-
className:
|
|
688
|
+
className: chunkZ22RD3E2_js.cn(
|
|
690
689
|
"ml-auto inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 text-[10px]",
|
|
691
690
|
failed ? "bg-destructive/15 text-destructive" : done ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground"
|
|
692
691
|
),
|
|
@@ -711,7 +710,7 @@ function AiToolCallCard({ part }) {
|
|
|
711
710
|
] });
|
|
712
711
|
}
|
|
713
712
|
function AiMessageList({ messages, isStreaming, bridge }) {
|
|
714
|
-
const { t } =
|
|
713
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
715
714
|
const endRef = react.useRef(null);
|
|
716
715
|
react.useEffect(() => {
|
|
717
716
|
endRef.current?.scrollIntoView({ block: "end" });
|
|
@@ -734,7 +733,7 @@ function AiMessageList({ messages, isStreaming, bridge }) {
|
|
|
734
733
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
735
734
|
"div",
|
|
736
735
|
{
|
|
737
|
-
className:
|
|
736
|
+
className: chunkZ22RD3E2_js.cn(
|
|
738
737
|
"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full",
|
|
739
738
|
isUser ? "bg-secondary text-muted-foreground" : "bg-primary/15 text-primary"
|
|
740
739
|
),
|
|
@@ -780,7 +779,7 @@ function AiMessageList({ messages, isStreaming, bridge }) {
|
|
|
780
779
|
] });
|
|
781
780
|
}
|
|
782
781
|
function AiProposalCard({ proposal, onAccept, onReject }) {
|
|
783
|
-
const { t } =
|
|
782
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
784
783
|
const lines = proposal.summary.map(ai.humanizeDiffLine);
|
|
785
784
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-md border border-primary/40 bg-primary/5 p-2.5", children: [
|
|
786
785
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-primary", children: t("pptx.ai.proposedChange") }),
|
|
@@ -822,7 +821,7 @@ function AiConversation({
|
|
|
822
821
|
aiPanel,
|
|
823
822
|
deckId
|
|
824
823
|
}) {
|
|
825
|
-
const { t } =
|
|
824
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
826
825
|
const chat = useAiConversation(useChat, session, config, bridge, {
|
|
827
826
|
// Live "AI as a collaborator" focus: as each tool runs, navigate to and
|
|
828
827
|
// highlight the slide / element(s) it touches so the canvas mirrors the
|
|
@@ -987,7 +986,7 @@ function AiChatPanel({
|
|
|
987
986
|
onClose,
|
|
988
987
|
panelWidth
|
|
989
988
|
}) {
|
|
990
|
-
const { t } =
|
|
989
|
+
const { t } = chunkZ22RD3E2_js.useTranslation();
|
|
991
990
|
const { state, session, initError } = useAiChat(bridge, config);
|
|
992
991
|
const deckId = react.useMemo(() => ai.deckIdFromBridge(bridge), [bridge]);
|
|
993
992
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { cn } from './chunk-
|
|
1
|
+
import { useTranslation, cn } from './chunk-ZCGYPCZM.mjs';
|
|
2
2
|
import './chunk-UV2HVMKZ.mjs';
|
|
3
3
|
import { useMemo, useRef, useState, useEffect, useReducer, useCallback } from 'react';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
4
|
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';
|
|
6
5
|
import { deckIdFromBridge, isAiAvailable, createAiChatSession, extractReadyToolCalls, toolCanvasTarget, createChatHistoryStore, focusTargetChips, isTwoTableFocus, mergeTablesDirective, toRenderableParts, humanizeDiffLine, buildDeckContext, describeToolActivity, summarizeToolArgs, toolLabel } from 'ooxml-ui/pptx/ai';
|
|
7
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
Binary file
|
|
Binary file
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { StaticElementRenderer, useModalDismissDrag, useToolbarVisibility, useViewerOptionsContext, InlineCollaborationContext, SlideBackgroundImageLayer, ElementRenderer, withDisplayName, useCollaboration, ResizeHandles, imgSrc, renderStrokeView, useViewerOptions, useReadOnlyRecommendationState, useCompatibilityToastsState, useReducedMotion, useViewerState, useIsMobile, useResizablePanels, useDerivedSlideState, useZoomViewport, useEditorHistory, usePresentationSetup, useTouchGestures, useViewerDialogs, useEditorOperations, useViewerIntegration, useViewPreferencesSync, useLayoutSwitching, Rendering3DFlagsContext, CollaborationProvider, ChartFormatContext,
|
|
2
|
-
import { cn, getShapeAdjustmentHandleDescriptors, isConnectorOrLineElement, TOOLBAR_SECTIONS, GRID_SIZE, getElementTransformWithoutRotation, getElementTransform, MIN_ELEMENT_SIZE, hasCopyableFormat, DEFAULT_SECTION_GROUP_ID, safeOpenUrl, isPpactionUrl, parsePpactionUrl, SHORTCUT_REFERENCE_ITEMS, isUrlSafe, computeHandoutLayout, getPrintableArea, generateNoteLineCount, normalizeHexColor, UNGROUPED_SECTION_ID, SLIDE_NAV_THUMBNAIL_WIDTH, SLIDE_TRANSITION_OPTIONS, getElementLabel, TABLE_STYLE_PRESETS, SHAPE_PRESETS, sanitizeGradientStops, formatCommentTimestamp, ANIMATION_PRESET_OPTIONS, clampCropValue, CONNECTOR_ARROW_OPTIONS, ARROW_SIZE_OPTIONS, DEFAULT_FILL_COLOR, startMotionPathPreview, startPreviewAnimation, stopPreviewAnimation, getPatternSvg, DEFAULT_STROKE_COLOR, openNativeEyeDropper } from './chunk-
|
|
3
|
-
import { ANIMATION_DIRECTION_LABEL_KEYS, buildQuickStylesGallery, buildSlideTemplateContent, SLIDE_TEMPLATES, homeLaunchers, attachRibbonOverflow, isPanelVisible, parentSelection, slideSpaceElement, isGroupMember, motionPathFor, setMotionPath, RULER_THICKNESS, shouldShowElementHandles, deviceStrokeStageStyle, activateModalFocus, visibleContextualTabs, resolveActiveRibbonTab, visibleRibbonAddIns, isDialogAvailable, resolveScreenTip, RIBBON_ADD_IN_TAB_ATTR, contextualTabLabelKey, RIBBON_CONTEXTUAL_TAB_ATTR, buildTabRowActionsState, isFeatureEnabled, TAB_ROW_ACTION_CLASSES, tabRowActionsAttributes, buildTitleBarState, backstageNavEntries, BACKSTAGE_NAV, listBackstageRecentFiles, BACKSTAGE_BACK_CLASSES, BACKSTAGE_NAV_CLASSES, DEFAULT_INSERT_CHART_KIND, FREEFORM_TOOL_IDS, isDrawingToolVisible, textFontSizePtToPx, withHomeGalleries, drawingHomeControls, homeGalleryControls, homeGalleryApply, shapeOutlineChange, shapeFillChange, editingHomeControls, arrangeHomeControls, arrangePainterHomeControls, arrangeAlignAction, DESIGN_RIBBON_GROUPS, FIXED_TAB_GALLERIES, DESIGN_RIBBON_COMMANDS, designCommandState, CONTEXTUAL_TAB_GROUPS, attachEditorImagePaste, authorConnectorBetweenSites, findEraserHitElementId, generateTicks, rulerDragToGuidePosition, resolveElementInteractivity, buildChartQuickActionsDescriptor, applyChartElementToggle, CHART_QUICK_ACTION_BUTTON_SIZE, applyChartStylePreset, hideChartSeries, restoreFilteredSeries, buildCropOverlay, CROP_HANDLE_ARIA_KEY, getActiveXControlOverlayView, buildCommentMarkers, COMMENT_MARKER_SIZE, collectConnectorSiteCandidates, getConnectorEndpointHandles, findConnectorSiteNear, motionPathToSvgD, motionPathEndPixel, isEditableMotionPath, setMotionPathEnd, canEditElementPoints, getSlideBackgroundStyle, resolveCollaborationConfig, resolveViewerRootOptions, buildUserFontFaceStyles, readStoredViewerPrefs, resolveThemeCatalogEntry, THEME_CATALOG, writeStoredViewerPrefs, openPptxFile, readBackstageRecentFile, isEditingAllowed, resolveAutosaveActivation, viewerOptionsToPreferences, applyPreferenceToOptions, resolveHistoryDepth, attachViewerHyperlinks, shouldConfirmExternalHyperlink, applyAutoCorrect, resolveImageResolutionScale, resolveAutosaveIntervalMs, resolveAutosaveIntervalSeconds, saveFailureMessage, withSaveFailureToast, createSlidePackageClipboard, shouldShowAutosaveRecoveryPrompt, resolveOptionRootClasses, RIBBON_SCOPE_ATTR, resolve3DRenderingFlags, resolveSlideSizeSelection, EMPTY_RESOLVED_CUSTOMIZATION, getRegionRenderer, ViewerRegionHost, BACKSTAGE_TEMPLATES, formatBackstageDate, formatBackstageSize, customizeBackstageCards, backstageCardsFor, DEFAULT_VIEWER_PROFILE, resolveProfileInitial, AVATAR_COLOR_SWATCHES, clipboardHomeControls, slidesHomeControls, resolveInsertSlideLayout, resolveDefaultFontFamily, textFontSizePxToPt, getInlineEditorSelectionResult, selectedParagraphBulletKind, elementBulletKind, selectionBulletKind, fontPickerHomeControls, fontHomeControls, nextToggleValue, RIBBON_GROUP_ATTR, paragraphHomeAlign, paragraphHomeControls, paragraphHomeAction, arrangeShapeHomeControls, strokeWidthOf, canSetStrokeWidth, canUngroupSelection, canGroupSelection, buildRibbonGallery, readRibbonTransitionDraft, SLIDE_SHOW_COMMAND_GROUPS, buildRecordRibbon, trackActiveComment, commentCounts, findCommentLocation, buildReviewRibbon, buildHelpRibbon, galleryTextLabel, pictureSizeHomeControls, chartSelectionHomeControls, dispatchChartSelectionRequest, buildFreeformShapeElement, buildLiveInkStrokeView, beginCropDrag, CONNECTOR_SITE_SNAP_PX, resolveConnectorEndpointUpdate, withConnectorEndpointUpdate, getShapeConnectionSites, FreeformToolSession, attachOverlayKeyboard, EditPointsSession, EDIT_POINTS_STYLE, themeToCssVars, createCustomizationController, resolveEffectiveHiddenActions, pruneExpiredAutosaveSnapshots, createDeckStyleHost, galleryDeckView, tableLayoutCells, resetChartFormatTarget, masterViewCrudActions, applyMasterViewCrudAction, masterViewCrudFailureKey, EDITOR_CHROME_CSS, ribbonCustomizationCss, applyMotionPathPreset, resetSlideLayoutPath, templateSchemeFromTheme, createBackstagePresentation, playFeedbackSound, shouldDiscardAutosaveOnSuccessfulSave, deleteAutosaveSnapshot, dispatchReadOnlyBannerIntent, readOnlyBannerState, buildFieldSubstitutionContext, setMasterViewBackgroundColor, canUseClipboard, runProgramNoticeStackStyle, observeElementHeight, printPropertiesFrameSlides, printPropertiesSlidesPerPage, PASTE_SPECIAL_OPTIONS, findCanvasElementNode, isHeaderFooterDateTextVisible, isHeaderFooterHeaderTextVisible, isHeaderFooterFooterTextVisible, getDensePanelTouchTargetPx, shouldStickyActionRow, buildJoinCollaborationConfig, buildCreateCollaborationConfig, generateBroadcastRoomId, DEFAULT_BROADCAST_SERVER_URL, buildBroadcastViewerUrl, resolveTransportForServerUrl, MIN_TOUCH_TARGET_PX, getLocalStorageUsageSummary, saveViewerProfile, clearAllLocalViewerData, getSelectionTextStyleFlags, TEXT_DECORATION_FLAGS, dispatchCropRequest, applyRibbonGalleryItem, ribbonTransitionsDraftPatch, ribbonTransitionUpdates, ribbonTransitionsSoundChange, ribbonTransitionStockSoundUrl, playSlideTransitionPreview, playAnimationRibbonPreview, SLIDE_SHOW_OPTIONS, createViewerOptionsStore, subtitleSettingsFromOptions, subtitleSettingsLabels, isReviewCommentCommand, runReviewCommentCommand, hasTiltData, RULER_FONT_SIZE, toElementAxes, dragCropHandle, panCropImage, clientToSlidePoint, EDIT_POINTS_TARGET_ATTR, pushRecentColor, mruColorsPatch, shouldClearAutosaveCacheOnClose, clearAutosaveSnapshots, canCropElement, cropSessionChanged, cancelCropUpdate, startCropSession, editorThumbnailWidth, EDITOR_THUMBNAIL_WIDTH, masterViewBackgroundColor, resolvePresentationAction, isPresentationAdvanceClick, toggleBlackboard, visibleTemplateElements, PRESENT_TOOLBAR_CLASSES, resolveEditPointsAvailability, isCurrentLayout, EXPANDED_MAX_HEIGHT, statusBarState, statusBarViewMode, formatVersionTimestamp, formatRelativeTime, scanAvailableFontFamilies, convertOmmlToLatex, compileLatexEquation, convertLatexToOmml, EQUATION_TEMPLATES, resolveDefaultPrintSettings, HANDOUT_OPTIONS, bindPptxOptionsDialog, optionsBlockSlot, optionsPaneSlot, DEFAULT_QUICK_ACCESS_COMMAND_IDS, AI_OPTIONS_CATEGORY, buildCollaborationShareUrl, buildActiveSessionUsers, slideClipboardLabels, sorterPasteInsertAt, SORTER_MIN_ZOOM, SORTER_ZOOM_STEP, SORTER_MAX_ZOOM, canGoPrevious, formatSlideCounter, READING_VIEW_COUNTER_ATTR, canGoNext, READING_VIEW_ATTR, listenForOutlineViewDismiss, OUTLINE_LEVEL_ATTR, OUTLINE_SLIDE_ATTR, OUTLINE_ROW_ATTR, OUTLINE_VIEW_ATTR, mobileElapsedSince, nextPresentedSlide, presenterPrevDisabled, presenterNextDisabled, formatMobileElapsed, mobileSlideCounter, presenterPaneAdvancesOnClick, presenterTimerProgress, PRESENTER_CONSOLE_CLASSES, formatElapsed, createCollaborationStateReporter, buildCollaborationState, writeBackReport, computeAnchoredPopupPosition, updateSubtitleSettings, overlayPointerInput, cropModeKeyAction, editorThumbnailStep, resolveSlidePaneClick, SLIDE_VIRTUALIZATION_THRESHOLD, buildSectionContextMenuEntries, buildSlidePaneContextMenuEntries, slidePaneViewItems, isEditPointsEnabled, findReplacementAvailability, PRESENTATION_HIT_TEST_CSS, PRESENTATION_STAGE_ATTRIBUTE, buildStrokePathD, cursorForTool, annotationOverlayZIndex, presentationInkPath, resolveNotesSchematicBodyFontSizePx, PRESENTER_NAVIGATOR_LABEL_KEYS, getPresentationContextMenuSections, CONTEXT_MENU_PRESENTATION_LAYER, presentationViewItems, subtitleRecognitionLanguage, getSpeechRecognitionCtor, mergeCaptionResults, customizeContextMenuEntries, buildContextMenuEntries, contextMenuViewItems, customizeCanvasContextMenuEntries, buildCanvasContextMenuEntries, buildLayoutPreviewGeometry, scaleSlidesForSizeChange, slideSizeToCanvasPx, resolveSelectionPaneRename, themeEditorLabels, resolveNotesSegments, defaultRichEnabled, segmentsToEditorHtml, DEBOUNCE_MS, createPlainNotesSegments, parseSegmentsFromRichEditor, segmentsToPlainText, getCurrentParagraphIndex, segmentsToParagraphs, paragraphsToSegments, MAX_INDENT_LEVEL, INDENT_PX as INDENT_PX$1, buildNotesPrintHtml, dispatchStatusBarIntent, toggleSheet, describeElementChange, sanitizeMathMl, compileEquationTemplateMathMl, computeAllNotesPages, getNotesPrintableArea, CUSTOM_FONT_ACCEPT, TOOLBAR_TABS, SHORTCUT_REFERENCE_ITEMS as SHORTCUT_REFERENCE_ITEMS$1, availableQuickAccessCommands, addQuickAccessCommand, removeQuickAccessCommand, moveQuickAccessCommand, resolveViewerAddinRows, createSlideSorterState, sorterSelectionIndexes, selectSorterSlide, applySorterAction, sorterGridColumns, sorterMenuContext, buildSlideSorterContextMenuEntries, slideSorterContextMenuLabel, openReadingView, applyReadingViewCommand, createPresentationKeyBuffer, readingViewFitScale, READING_VIEW_STAGE_ATTR, buildOutline, applyOutlineEdit, mapOutlineKey, notesSegmentsToSpans, erasePresentationInkAt, movePresenterPointer, appendPresentationInkPoint, presenterConsoleAction, presenterConsoleViewState, NOTES_FONT_SIZE_DEFAULT, formatTime, NOTES_FONT_SIZE_MIN, clampNotesFontSize, NOTES_FONT_SIZE_STEP, NOTES_FONT_SIZE_MAX, sectionAddAfterSlideIndex, masterViewPseudoSlide, PRESENTATION_ANIM_TRIGGER_ATTRIBUTE, applyTableStyleDelete, applyTableStyleMapChange, registerCustomFont, QUICK_ACCESS_COMMAND_CATALOG, handleReadingViewKey, editorThumbnailHeight, buildPreviewElements, deriveSlideFieldContext, hiddenSlideCue, HIDDEN_SLIDE_SLASH_GRADIENT, HIDDEN_SLIDE_LABEL_KEY, MERGE_SHAPES_MENU_ITEMS, hasMultipleSelectedTableCells, isElementLocked, ELEMENT_GEOMETRY_SECTIONS, mergeSlideTransition, slideBackgroundClearState, slideBackgroundClearPatch, effectiveDirection, TRIGGER_OPTIONS, effectiveTimingCurve, getAfterAnimationState, mapSlideSorterKey, isEditorTextInputTarget, clampSorterZoom, elementLockTogglePatch, resolveInspectorSections, inspectorTogglePatch, buildTableDataGrid, getDenseGridLayoutPlan, appendTableElementRow, removeLastTableElementRow, appendTableElementColumn, removeLastTableElementColumn, removeTableElementColumn, removeTableElementRow, setTableElementCellText, applyTableStylePreset, tableStyleAssignmentUpdate, evenColumnWidths, redistributeColumnWidth, evenRowHeights, inspectorNumber, patchChartData, collapseChartTitleRunsForEdit, chartGridlinesState, chartGridlinesPatch, seriesSecondaryAxisPatch, setDataLabelsRangeCache, imageResetPatch, imageResetState, canInteractWithElement, buildOleObjectNamePatch, shouldShowAccessibilitySection, withFrameSlides, withSlidesPerPage, schemaLabel, THEME_COLOR_SLOT_LABEL_KEYS, SLIDE_SIZE_PRESETS, TRANSITION_ORIENTATION_TYPES, clampTransitionNumber, TRANSITION_SPEED_OPTIONS, TRANSITION_MORPH_OPTIONS, flattenTagCollections, resolveTemplateBackgroundRows, commentMentionQuery, matchCommentMentionAuthors, buildAnimationTimelineRows, clearMotionPath, setTrigger, setTriggerBookmark, getEffectSoundState, setEffectSound, setEffectStockSound, setAfterAnimation, setAfterAnimationColor, directionValuesFor, buildAnimationTimelineBars, motionPathPresetIdForPath, MOTION_PATH_FAMILIES, motionPathPresetsByFamily, motionPathPresetLabelKey, motionPathFamilyLabelKey, EFFECT_SOUND_CATALOGUE, listMediaBookmarkOptions, selectedBookmarkOptionValue, describeTableStyleEditor, TABLE_STYLE_EDITOR_PARTS, computeMergeCellRight, computeMergeCellDown, computeSplitCell, resolveDisplayedChartType, CHART_TYPE_OPTIONS, chartDataLabelsTogglePatch, BAR3D_SHAPE_OPTIONS, bar3DShapePatch, RADAR_STYLE_OPTIONS, radarStylePatch, SURFACE_WIREFRAME_OPTIONS, surfaceWireframePatch, isSeriesUsingSecondaryAxis, seriesColorClearState, listChartUserShapeRows, withChartUserShapeAdded, createDefaultChartUserShape, withChartUserShapeRowRemoved, withChartUserShapeRowTextUpdated, rebuildDrawingShapesIfCleared, SMARTART_COLOR_SCHEME_LABEL_KEYS, SMARTART_STYLE_LABEL_KEYS, cropResetState, cropResetPatch, ARTISTIC_EFFECTS, mediaTrimEndSeconds, trimmedMediaDurationMs, mediaTrimEndAbsoluteMs, mediaTrimResetState, mediaTrimEndMsFromAbsoluteMs, mediaTrimResetPatch, buildOleEditDialogDescriptor, buildOleContentUpdatePatch, buildThemeColorSwatchGrid, themeColorGridView, recentColorsGridView, getNonVisualDescriptionFields, resolveActionType, ELEMENT_ACTION_TYPE_OPTIONS, canCommitActionType, slideSizeFromPreset, withSlideSizeOrientation, TRANSITION_DIR_ARROWS, buildDirectionGrid, updateTagInCollections, deleteTagFromCollections, addTagToCollections, commentTextSegments, COMMENT_MENTION_CLASS, COMMENT_MENTION_ATTRIBUTE, insertCommentMention, reorderAnimationTimelineRows, applyAnimationTimelineOrder, getEffectSoundAsset, animationEffectLabel, inspectorFieldPatch, TABLE_STYLE_BORDER_SIDES, applyTableStyleFieldEdit, withCellStyle, LBL as LBL$1, SEL as SEL$1, FILL_MODE_OPTIONS as FILL_MODE_OPTIONS$1, SECTION_HEADING, NUM as NUM$1, getChartUserShapeGroupTransform, withChartUserShapeGroupChildAdded, createDefaultChartUserShapeGroupChild, withChartUserShapeRowUpdated, getChartUserShapeRowChartBox, withChartUserShapeRowFlipUpdated, withChartUserShapeRowRotationUpdated, withChartUserShapeRowChartBoxUpdated, smartArtLayoutSwitchPatch, mediaTrimEndMsFromSeconds, validateMediaTrimRange, OFFICE_COLOR_SWATCHES, officeColorSwatchLabel, PATTERN_PRESET_OPTIONS as PATTERN_PRESET_OPTIONS$1, SHAPE_LINE_SECTIONS, SHAPE_EFFECT_SECTIONS, themeColorGridCommit, TEXT_BOX_SECTIONS, buildTextWarpGallery, TEXT_WARP_PRESETS, text3dPtToEmu, text3dEmuToPt, MATERIAL_PRESETS, toSlideIndex, TABLE_STYLE_BORDER_SIDE_LABEL_KEYS, TABLE_STYLE_DASH_PRESETS, GRADIENT_TYPE_OPTIONS as GRADIENT_TYPE_OPTIONS$1, PATTERN_OPTIONS, FILL_PATTERN_LABEL_KEYS, quickStyleShapeStyle, textWarpStyle, toggleText3dExtrusion, BEVEL_PRESETS, cropFit, cropFill, cropToAspectRatio } from 'ooxml-ui/pptx';
|
|
1
|
+
import { StaticElementRenderer, useModalDismissDrag, useToolbarVisibility, useViewerOptionsContext, InlineCollaborationContext, SlideBackgroundImageLayer, ElementRenderer, withDisplayName, useCollaboration, ResizeHandles, imgSrc, renderStrokeView, useChartFormatContext, useViewerOptions, useReadOnlyRecommendationState, useCompatibilityToastsState, useReducedMotion, useViewerState, useIsMobile, useResizablePanels, useDerivedSlideState, useZoomViewport, useEditorHistory, usePresentationSetup, useTouchGestures, useViewerDialogs, useEditorOperations, useViewerIntegration, useViewPreferencesSync, useLayoutSwitching, Rendering3DFlagsContext, CollaborationProvider, ChartFormatContext, useSheetDismissDrag, playAnimationSound, ViewerOptionsStoreContext, safePrompt, useController, scopeLayoutOptionsToActiveSlide, createReviewCommentsHost, ChartPartSelectionProvider, useKeyboardInsets, ViewerOptionsContext, useReportOnChange, useCollaborationDocumentSync, useFollowMode, useBroadcastFollower, useVirtualizedSlides, useSwipeNavigation, PresentationTransitionOverlay, RemoteSelectionOverlay, CollaborationCursorOverlay, detectTargetType, parseEmailUrl, parseSlideFromUrl, ACTION_VERB_MAP, downloadBlob, useChartPartSelection, resolveSmartArtDataPalette, DUOTONE_PRESETS, getSlideTransitionAnimations, SLIDE_TRANSITION_KEYFRAMES } from './chunk-V4DY4IWP.mjs';
|
|
2
|
+
import { useTranslation, cn, getShapeAdjustmentHandleDescriptors, isConnectorOrLineElement, PptxI18nContext, TOOLBAR_SECTIONS, GRID_SIZE, getElementTransformWithoutRotation, getElementTransform, MIN_ELEMENT_SIZE, ViewerLocaleControlsContext, hasCopyableFormat, ViewerI18nContext, useHostI18next, DEFAULT_SECTION_GROUP_ID, safeOpenUrl, isPpactionUrl, parsePpactionUrl, SHORTCUT_REFERENCE_ITEMS, isUrlSafe, computeHandoutLayout, getPrintableArea, generateNoteLineCount, normalizeHexColor, UNGROUPED_SECTION_ID, SLIDE_NAV_THUMBNAIL_WIDTH, SLIDE_TRANSITION_OPTIONS, getElementLabel, TABLE_STYLE_PRESETS, SHAPE_PRESETS, sanitizeGradientStops, formatCommentTimestamp, ANIMATION_PRESET_OPTIONS, clampCropValue, CONNECTOR_ARROW_OPTIONS, ARROW_SIZE_OPTIONS, DEFAULT_FILL_COLOR, startMotionPathPreview, startPreviewAnimation, stopPreviewAnimation, getPatternSvg, DEFAULT_STROKE_COLOR, openNativeEyeDropper } from './chunk-ZCGYPCZM.mjs';
|
|
3
|
+
import { ANIMATION_DIRECTION_LABEL_KEYS, buildQuickStylesGallery, buildSlideTemplateContent, SLIDE_TEMPLATES, homeLaunchers, attachRibbonOverflow, isPanelVisible, parentSelection, slideSpaceElement, isGroupMember, motionPathFor, setMotionPath, RULER_THICKNESS, shouldShowElementHandles, deviceStrokeStageStyle, activateModalFocus, visibleContextualTabs, resolveActiveRibbonTab, visibleRibbonAddIns, isDialogAvailable, resolveScreenTip, RIBBON_ADD_IN_TAB_ATTR, contextualTabLabelKey, RIBBON_CONTEXTUAL_TAB_ATTR, buildTabRowActionsState, isFeatureEnabled, TAB_ROW_ACTION_CLASSES, tabRowActionsAttributes, buildTitleBarState, backstageNavEntries, BACKSTAGE_NAV, listBackstageRecentFiles, BACKSTAGE_BACK_CLASSES, BACKSTAGE_NAV_CLASSES, DEFAULT_INSERT_CHART_KIND, FREEFORM_TOOL_IDS, isDrawingToolVisible, textFontSizePtToPx, withHomeGalleries, drawingHomeControls, homeGalleryControls, homeGalleryApply, shapeOutlineChange, shapeFillChange, editingHomeControls, arrangeHomeControls, arrangePainterHomeControls, arrangeAlignAction, DESIGN_RIBBON_GROUPS, FIXED_TAB_GALLERIES, DESIGN_RIBBON_COMMANDS, designCommandState, CONTEXTUAL_TAB_GROUPS, attachEditorImagePaste, authorConnectorBetweenSites, findEraserHitElementId, generateTicks, rulerDragToGuidePosition, resolveElementInteractivity, buildChartQuickActionsDescriptor, applyChartElementToggle, CHART_QUICK_ACTION_BUTTON_SIZE, applyChartStylePreset, hideChartSeries, restoreFilteredSeries, buildCropOverlay, CROP_HANDLE_ARIA_KEY, getActiveXControlOverlayView, buildCommentMarkers, COMMENT_MARKER_SIZE, collectConnectorSiteCandidates, getConnectorEndpointHandles, findConnectorSiteNear, motionPathToSvgD, motionPathEndPixel, isEditableMotionPath, setMotionPathEnd, canEditElementPoints, getSlideBackgroundStyle, EMPTY_RESOLVED_CUSTOMIZATION, getRegionRenderer, ViewerRegionHost, BACKSTAGE_TEMPLATES, formatBackstageDate, formatBackstageSize, customizeBackstageCards, backstageCardsFor, DEFAULT_VIEWER_PROFILE, readStoredViewerPrefs, resolveProfileInitial, AVATAR_COLOR_SWATCHES, clipboardHomeControls, slidesHomeControls, resolveInsertSlideLayout, resolveDefaultFontFamily, textFontSizePxToPt, getInlineEditorSelectionResult, selectedParagraphBulletKind, elementBulletKind, selectionBulletKind, fontPickerHomeControls, fontHomeControls, nextToggleValue, RIBBON_GROUP_ATTR, paragraphHomeAlign, paragraphHomeControls, paragraphHomeAction, arrangeShapeHomeControls, strokeWidthOf, canSetStrokeWidth, canUngroupSelection, canGroupSelection, buildRibbonGallery, readRibbonTransitionDraft, SLIDE_SHOW_COMMAND_GROUPS, buildRecordRibbon, trackActiveComment, commentCounts, findCommentLocation, buildReviewRibbon, buildHelpRibbon, galleryTextLabel, pictureSizeHomeControls, chartSelectionHomeControls, dispatchChartSelectionRequest, buildFreeformShapeElement, buildLiveInkStrokeView, beginCropDrag, CONNECTOR_SITE_SNAP_PX, resolveConnectorEndpointUpdate, withConnectorEndpointUpdate, getShapeConnectionSites, FreeformToolSession, attachOverlayKeyboard, EditPointsSession, EDIT_POINTS_STYLE, resolveCollaborationConfig, resolveViewerRootOptions, buildUserFontFaceStyles, resolveThemeCatalogEntry, THEME_CATALOG, writeStoredViewerPrefs, openPptxFile, readBackstageRecentFile, isEditingAllowed, resolveAutosaveActivation, viewerOptionsToPreferences, applyPreferenceToOptions, resolveHistoryDepth, attachViewerHyperlinks, shouldConfirmExternalHyperlink, applyAutoCorrect, resolveImageResolutionScale, resolveAutosaveIntervalMs, resolveAutosaveIntervalSeconds, saveFailureMessage, withSaveFailureToast, createSlidePackageClipboard, shouldShowAutosaveRecoveryPrompt, resolveOptionRootClasses, RIBBON_SCOPE_ATTR, resolve3DRenderingFlags, resolveSlideSizeSelection, MIN_TOUCH_TARGET_PX, getLocalStorageUsageSummary, saveViewerProfile, clearAllLocalViewerData, getSelectionTextStyleFlags, TEXT_DECORATION_FLAGS, dispatchCropRequest, applyRibbonGalleryItem, ribbonTransitionsDraftPatch, ribbonTransitionUpdates, ribbonTransitionsSoundChange, ribbonTransitionStockSoundUrl, playSlideTransitionPreview, playAnimationRibbonPreview, SLIDE_SHOW_OPTIONS, createViewerOptionsStore, subtitleSettingsFromOptions, subtitleSettingsLabels, isReviewCommentCommand, runReviewCommentCommand, hasTiltData, RULER_FONT_SIZE, toElementAxes, dragCropHandle, panCropImage, clientToSlidePoint, EDIT_POINTS_TARGET_ATTR, themeToCssVars, createCustomizationController, resolveEffectiveHiddenActions, pruneExpiredAutosaveSnapshots, createDeckStyleHost, galleryDeckView, tableLayoutCells, resetChartFormatTarget, masterViewCrudActions, applyMasterViewCrudAction, masterViewCrudFailureKey, EDITOR_CHROME_CSS, ribbonCustomizationCss, applyMotionPathPreset, resetSlideLayoutPath, templateSchemeFromTheme, createBackstagePresentation, playFeedbackSound, shouldDiscardAutosaveOnSuccessfulSave, deleteAutosaveSnapshot, dispatchReadOnlyBannerIntent, readOnlyBannerState, buildFieldSubstitutionContext, setMasterViewBackgroundColor, canUseClipboard, runProgramNoticeStackStyle, observeElementHeight, printPropertiesFrameSlides, printPropertiesSlidesPerPage, PASTE_SPECIAL_OPTIONS, findCanvasElementNode, isHeaderFooterDateTextVisible, isHeaderFooterHeaderTextVisible, isHeaderFooterFooterTextVisible, getDensePanelTouchTargetPx, shouldStickyActionRow, buildJoinCollaborationConfig, buildCreateCollaborationConfig, generateBroadcastRoomId, DEFAULT_BROADCAST_SERVER_URL, buildBroadcastViewerUrl, resolveTransportForServerUrl, computeAnchoredPopupPosition, updateSubtitleSettings, overlayPointerInput, pushRecentColor, mruColorsPatch, shouldClearAutosaveCacheOnClose, clearAutosaveSnapshots, canCropElement, cropSessionChanged, cancelCropUpdate, startCropSession, editorThumbnailWidth, EDITOR_THUMBNAIL_WIDTH, masterViewBackgroundColor, resolvePresentationAction, isPresentationAdvanceClick, toggleBlackboard, visibleTemplateElements, PRESENT_TOOLBAR_CLASSES, resolveEditPointsAvailability, isCurrentLayout, EXPANDED_MAX_HEIGHT, statusBarState, statusBarViewMode, formatVersionTimestamp, formatRelativeTime, scanAvailableFontFamilies, convertOmmlToLatex, compileLatexEquation, convertLatexToOmml, EQUATION_TEMPLATES, resolveDefaultPrintSettings, HANDOUT_OPTIONS, bindPptxOptionsDialog, optionsBlockSlot, optionsPaneSlot, DEFAULT_QUICK_ACCESS_COMMAND_IDS, AI_OPTIONS_CATEGORY, buildCollaborationShareUrl, buildActiveSessionUsers, slideClipboardLabels, sorterPasteInsertAt, SORTER_MIN_ZOOM, SORTER_ZOOM_STEP, SORTER_MAX_ZOOM, canGoPrevious, formatSlideCounter, READING_VIEW_COUNTER_ATTR, canGoNext, READING_VIEW_ATTR, listenForOutlineViewDismiss, OUTLINE_LEVEL_ATTR, OUTLINE_SLIDE_ATTR, OUTLINE_ROW_ATTR, OUTLINE_VIEW_ATTR, mobileElapsedSince, nextPresentedSlide, presenterPrevDisabled, presenterNextDisabled, formatMobileElapsed, mobileSlideCounter, presenterPaneAdvancesOnClick, presenterTimerProgress, PRESENTER_CONSOLE_CLASSES, formatElapsed, createCollaborationStateReporter, buildCollaborationState, writeBackReport, cropModeKeyAction, editorThumbnailStep, resolveSlidePaneClick, SLIDE_VIRTUALIZATION_THRESHOLD, buildSectionContextMenuEntries, buildSlidePaneContextMenuEntries, slidePaneViewItems, isEditPointsEnabled, findReplacementAvailability, PRESENTATION_HIT_TEST_CSS, PRESENTATION_STAGE_ATTRIBUTE, buildStrokePathD, cursorForTool, annotationOverlayZIndex, presentationInkPath, resolveNotesSchematicBodyFontSizePx, PRESENTER_NAVIGATOR_LABEL_KEYS, getPresentationContextMenuSections, CONTEXT_MENU_PRESENTATION_LAYER, presentationViewItems, subtitleRecognitionLanguage, getSpeechRecognitionCtor, mergeCaptionResults, customizeContextMenuEntries, buildContextMenuEntries, contextMenuViewItems, customizeCanvasContextMenuEntries, buildCanvasContextMenuEntries, buildLayoutPreviewGeometry, scaleSlidesForSizeChange, slideSizeToCanvasPx, resolveSelectionPaneRename, themeEditorLabels, resolveNotesSegments, defaultRichEnabled, segmentsToEditorHtml, DEBOUNCE_MS, createPlainNotesSegments, parseSegmentsFromRichEditor, segmentsToPlainText, getCurrentParagraphIndex, segmentsToParagraphs, paragraphsToSegments, MAX_INDENT_LEVEL, INDENT_PX as INDENT_PX$1, buildNotesPrintHtml, dispatchStatusBarIntent, toggleSheet, describeElementChange, sanitizeMathMl, compileEquationTemplateMathMl, computeAllNotesPages, getNotesPrintableArea, CUSTOM_FONT_ACCEPT, TOOLBAR_TABS, SHORTCUT_REFERENCE_ITEMS as SHORTCUT_REFERENCE_ITEMS$1, availableQuickAccessCommands, addQuickAccessCommand, removeQuickAccessCommand, moveQuickAccessCommand, resolveViewerAddinRows, createSlideSorterState, sorterSelectionIndexes, selectSorterSlide, applySorterAction, sorterGridColumns, sorterMenuContext, buildSlideSorterContextMenuEntries, slideSorterContextMenuLabel, openReadingView, applyReadingViewCommand, createPresentationKeyBuffer, readingViewFitScale, READING_VIEW_STAGE_ATTR, buildOutline, applyOutlineEdit, mapOutlineKey, notesSegmentsToSpans, erasePresentationInkAt, movePresenterPointer, appendPresentationInkPoint, presenterConsoleAction, presenterConsoleViewState, NOTES_FONT_SIZE_DEFAULT, formatTime, NOTES_FONT_SIZE_MIN, clampNotesFontSize, NOTES_FONT_SIZE_STEP, NOTES_FONT_SIZE_MAX, sectionAddAfterSlideIndex, masterViewPseudoSlide, PRESENTATION_ANIM_TRIGGER_ATTRIBUTE, applyTableStyleDelete, applyTableStyleMapChange, registerCustomFont, QUICK_ACCESS_COMMAND_CATALOG, handleReadingViewKey, editorThumbnailHeight, buildPreviewElements, deriveSlideFieldContext, hiddenSlideCue, HIDDEN_SLIDE_SLASH_GRADIENT, HIDDEN_SLIDE_LABEL_KEY, MERGE_SHAPES_MENU_ITEMS, hasMultipleSelectedTableCells, isElementLocked, ELEMENT_GEOMETRY_SECTIONS, mergeSlideTransition, slideBackgroundClearState, slideBackgroundClearPatch, effectiveDirection, TRIGGER_OPTIONS, effectiveTimingCurve, getAfterAnimationState, mapSlideSorterKey, isEditorTextInputTarget, clampSorterZoom, elementLockTogglePatch, resolveInspectorSections, inspectorTogglePatch, buildTableDataGrid, getDenseGridLayoutPlan, appendTableElementRow, removeLastTableElementRow, appendTableElementColumn, removeLastTableElementColumn, removeTableElementColumn, removeTableElementRow, setTableElementCellText, applyTableStylePreset, tableStyleAssignmentUpdate, evenColumnWidths, redistributeColumnWidth, evenRowHeights, inspectorNumber, patchChartData, collapseChartTitleRunsForEdit, chartGridlinesState, chartGridlinesPatch, seriesSecondaryAxisPatch, setDataLabelsRangeCache, imageResetPatch, imageResetState, canInteractWithElement, buildOleObjectNamePatch, shouldShowAccessibilitySection, withFrameSlides, withSlidesPerPage, schemaLabel, THEME_COLOR_SLOT_LABEL_KEYS, SLIDE_SIZE_PRESETS, TRANSITION_ORIENTATION_TYPES, clampTransitionNumber, TRANSITION_SPEED_OPTIONS, TRANSITION_MORPH_OPTIONS, flattenTagCollections, resolveTemplateBackgroundRows, commentMentionQuery, matchCommentMentionAuthors, buildAnimationTimelineRows, clearMotionPath, setTrigger, setTriggerBookmark, getEffectSoundState, setEffectSound, setEffectStockSound, setAfterAnimation, setAfterAnimationColor, directionValuesFor, buildAnimationTimelineBars, motionPathPresetIdForPath, MOTION_PATH_FAMILIES, motionPathPresetsByFamily, motionPathPresetLabelKey, motionPathFamilyLabelKey, EFFECT_SOUND_CATALOGUE, listMediaBookmarkOptions, selectedBookmarkOptionValue, describeTableStyleEditor, TABLE_STYLE_EDITOR_PARTS, computeMergeCellRight, computeMergeCellDown, computeSplitCell, resolveDisplayedChartType, CHART_TYPE_OPTIONS, chartDataLabelsTogglePatch, BAR3D_SHAPE_OPTIONS, bar3DShapePatch, RADAR_STYLE_OPTIONS, radarStylePatch, SURFACE_WIREFRAME_OPTIONS, surfaceWireframePatch, isSeriesUsingSecondaryAxis, seriesColorClearState, listChartUserShapeRows, withChartUserShapeAdded, createDefaultChartUserShape, withChartUserShapeRowRemoved, withChartUserShapeRowTextUpdated, rebuildDrawingShapesIfCleared, SMARTART_COLOR_SCHEME_LABEL_KEYS, SMARTART_STYLE_LABEL_KEYS, cropResetState, cropResetPatch, ARTISTIC_EFFECTS, mediaTrimEndSeconds, trimmedMediaDurationMs, mediaTrimEndAbsoluteMs, mediaTrimResetState, mediaTrimEndMsFromAbsoluteMs, mediaTrimResetPatch, buildOleEditDialogDescriptor, buildOleContentUpdatePatch, buildThemeColorSwatchGrid, themeColorGridView, recentColorsGridView, getNonVisualDescriptionFields, resolveActionType, ELEMENT_ACTION_TYPE_OPTIONS, canCommitActionType, slideSizeFromPreset, withSlideSizeOrientation, TRANSITION_DIR_ARROWS, buildDirectionGrid, updateTagInCollections, deleteTagFromCollections, addTagToCollections, commentTextSegments, COMMENT_MENTION_CLASS, COMMENT_MENTION_ATTRIBUTE, insertCommentMention, reorderAnimationTimelineRows, applyAnimationTimelineOrder, getEffectSoundAsset, animationEffectLabel, inspectorFieldPatch, TABLE_STYLE_BORDER_SIDES, applyTableStyleFieldEdit, withCellStyle, LBL as LBL$1, SEL as SEL$1, FILL_MODE_OPTIONS as FILL_MODE_OPTIONS$1, SECTION_HEADING, NUM as NUM$1, getChartUserShapeGroupTransform, withChartUserShapeGroupChildAdded, createDefaultChartUserShapeGroupChild, withChartUserShapeRowUpdated, getChartUserShapeRowChartBox, withChartUserShapeRowFlipUpdated, withChartUserShapeRowRotationUpdated, withChartUserShapeRowChartBoxUpdated, smartArtLayoutSwitchPatch, mediaTrimEndMsFromSeconds, validateMediaTrimRange, OFFICE_COLOR_SWATCHES, officeColorSwatchLabel, PATTERN_PRESET_OPTIONS as PATTERN_PRESET_OPTIONS$1, SHAPE_LINE_SECTIONS, SHAPE_EFFECT_SECTIONS, themeColorGridCommit, TEXT_BOX_SECTIONS, buildTextWarpGallery, TEXT_WARP_PRESETS, text3dPtToEmu, text3dEmuToPt, MATERIAL_PRESETS, toSlideIndex, TABLE_STYLE_BORDER_SIDE_LABEL_KEYS, TABLE_STYLE_DASH_PRESETS, GRADIENT_TYPE_OPTIONS as GRADIENT_TYPE_OPTIONS$1, PATTERN_OPTIONS, FILL_PATTERN_LABEL_KEYS, quickStyleShapeStyle, textWarpStyle, toggleText3dExtrusion, BEVEL_PRESETS, cropFit, cropFill, cropToAspectRatio } from 'ooxml-ui/pptx';
|
|
4
4
|
export { THEME_CATALOG, defaultCssVars, defaultRadius, defaultThemeColors, resolveThemeCatalogEntry, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius } from 'ooxml-ui/pptx';
|
|
5
|
-
import React108, { createContext, useContext, useMemo, useState, useRef, useCallback, useEffect, useLayoutEffect, forwardRef, useSyncExternalStore, useReducer,
|
|
5
|
+
import React108, { createContext, useContext, useMemo, useState, useRef, useCallback, useEffect, useLayoutEffect, forwardRef, useSyncExternalStore, useReducer, Fragment as Fragment$1, useId, useDeferredValue, Suspense, lazy } from 'react';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
-
import {
|
|
8
|
-
import { LuArrowDown, LuArrowUp, LuArrowRight, LuArrowLeft, LuArrowDownRight, LuArrowDownLeft, LuArrowUpRight, LuArrowUpLeft, LuX, LuPanelLeft, LuPanelRight, LuSparkles, LuSettings, LuFolderOpen, LuType, LuPalette, LuFilter, LuPaintbrush, LuPlus, LuClipboardCopy, LuShapes, LuLayoutGrid, LuWand, LuPresentation, LuTextCursorInput, LuFile, LuEllipsis, LuUserRound, LuUpload, LuShare2, LuPrinter, LuDownload, LuSave, LuInfo, LuFilePlus2, LuHouse, LuCopy, LuFileJson, LuBox, LuVideo, LuFileImage, LuFileText, LuDatabase, LuPlay, LuClock3, LuShieldAlert, LuLock, LuUser, LuHardDrive, LuLogIn, LuHistory, LuCalendarDays, LuClock, LuHash, LuText, LuCast, LuChevronRight, LuChevronDown, LuMonitor, LuRadio, LuCaptions, LuCheck, LuImage, LuSearch, LuShieldCheck, LuPanelLeftClose, LuTrash2, LuEyeOff, LuEye, LuLoader, LuSignature, LuTriangleAlert, LuPenTool, LuWifi, LuWifiOff, LuUsers, LuMinus, LuChevronLeft, LuPause, LuCaseSensitive, LuChevronUp, LuReplace, LuGripVertical, LuLoaderCircle, LuGrid2X2, LuStickyNote, LuList, LuBug, LuMove, LuCopyPlus, LuClipboardPaste, LuMessageSquare, LuLayers, LuSettings2, LuLockOpen, LuPencil, LuReply, LuMoveRight, LuRotateCw, LuScissors, LuBookmark, LuPipette } from 'react-icons/lu';
|
|
7
|
+
import { LuArrowDown, LuArrowUp, LuArrowRight, LuArrowLeft, LuArrowDownRight, LuArrowDownLeft, LuArrowUpRight, LuArrowUpLeft, LuX, LuPanelLeft, LuPanelRight, LuSparkles, LuSettings, LuFolderOpen, LuType, LuPalette, LuFilter, LuPaintbrush, LuPlus, LuClipboardCopy, LuShapes, LuLayoutGrid, LuWand, LuPresentation, LuTextCursorInput, LuFile, LuEllipsis, LuUserRound, LuUpload, LuShare2, LuPrinter, LuDownload, LuSave, LuInfo, LuFilePlus2, LuHouse, LuCopy, LuFileJson, LuBox, LuVideo, LuFileImage, LuFileText, LuDatabase, LuPlay, LuClock3, LuShieldAlert, LuLock, LuUser, LuHardDrive, LuLogIn, LuChevronRight, LuChevronDown, LuMonitor, LuClock, LuRadio, LuCaptions, LuCheck, LuImage, LuSearch, LuHistory, LuCalendarDays, LuHash, LuText, LuCast, LuShieldCheck, LuPanelLeftClose, LuTrash2, LuEyeOff, LuEye, LuLoader, LuSignature, LuTriangleAlert, LuPenTool, LuWifi, LuWifiOff, LuUsers, LuMinus, LuChevronLeft, LuPause, LuCaseSensitive, LuChevronUp, LuReplace, LuGripVertical, LuLoaderCircle, LuGrid2X2, LuStickyNote, LuList, LuBug, LuMove, LuCopyPlus, LuClipboardPaste, LuMessageSquare, LuLayers, LuSettings2, LuLockOpen, LuPencil, LuReply, LuMoveRight, LuRotateCw, LuScissors, LuBookmark, LuPipette } from 'react-icons/lu';
|
|
9
8
|
import { createPortal } from 'react-dom';
|
|
10
9
|
import { hasTextProperties, hasShapeProperties, buildThemeColorMap, themeColorSchemesEqual, isImageLikeElement, setChartAxisLogScale, setChartAxisTitleStyle, setChartAxisGridlineStyle, setChartSeriesMarker, setChartSeriesChartType, setChartDataPointFill, setChartDataPointExplosion, setChartDataPointMarker, setChartDataPointLabel, getOleObjectTypeLabel, pptxActionToElementAction, THEME_COLOR_SCHEME_KEYS, applyThemeOverrideToSlide, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, TRANSITION_VALID_DIRECTIONS, TRANSITION_PATTERN_OPTIONS, TRANSITION_THRUBLK_TYPES, normalizeTableStyleGuid, updateMergeAttrsInRawXml, applyOleSheetCellEdit, getOleSheetGrid, applyOleDocumentParagraphEdit, getOleDocumentParagraphs, applyOleNestedDeckElementTextEdit, getOleNestedDeckDetail, replaceOleFile, elementActionToPptxAction, createTableStyleEntry, addTableStyleToMap, deleteTableStyleFromMap, SWITCHABLE_LAYOUT_TYPES } from 'ooxml-core/pptx';
|
|
11
|
-
import { LOCALE_CATALOG } from 'ooxml-ui/pptx/i18n';
|
|
12
10
|
import { createPptxAiPanelController, computeFocusTargets, createPptxAiBridge, resolveAiEffectiveTargets, aiChangeAnimationCss, changeGhostStyle, createChatHistoryStore, collectStoredChats, exportAiChatLogs as exportAiChatLogs$1 } from 'ooxml-ui/pptx/ai';
|
|
11
|
+
import { interpolate, normalizeLocale } from 'ooxml-core/i18n';
|
|
12
|
+
import { translationsEn, keyToLabel, LOCALE_CATALOG } from 'ooxml-ui/pptx/i18n';
|
|
13
13
|
|
|
14
14
|
var ViewerThemeContext = /* @__PURE__ */ createContext(void 0);
|
|
15
15
|
function ViewerThemeProvider({ theme, children }) {
|
|
@@ -1678,7 +1678,7 @@ function AccountPage() {
|
|
|
1678
1678
|
return void 0;
|
|
1679
1679
|
});
|
|
1680
1680
|
};
|
|
1681
|
-
const version = "4.
|
|
1681
|
+
const version = "4.51.1" ;
|
|
1682
1682
|
return /* @__PURE__ */ jsxs("div", { className: "mt-8 max-w-[700px] space-y-6", children: [
|
|
1683
1683
|
/* @__PURE__ */ jsxs("section", { className: cardClass, children: [
|
|
1684
1684
|
/* @__PURE__ */ jsxs("h2", { className: "flex items-center gap-2 text-sm font-semibold", children: [
|
|
@@ -30498,7 +30498,7 @@ function useTableStyleMapHandlers(input) {
|
|
|
30498
30498
|
var AiChatPanel = /* @__PURE__ */ lazy(async () => {
|
|
30499
30499
|
const [{ useChat }, { default: Panel }] = await Promise.all([
|
|
30500
30500
|
import('@ai-sdk/react'),
|
|
30501
|
-
import('./AiChatPanel-
|
|
30501
|
+
import('./AiChatPanel-R323KNGN.mjs')
|
|
30502
30502
|
]);
|
|
30503
30503
|
function BoundAiChatPanel(props) {
|
|
30504
30504
|
return /* @__PURE__ */ jsx(Panel, { ...props, useChat });
|
|
@@ -32654,6 +32654,7 @@ function OpenSettingsDialog({
|
|
|
32654
32654
|
onSelectTheme,
|
|
32655
32655
|
localeCode,
|
|
32656
32656
|
availableLocales,
|
|
32657
|
+
languageSelectable = true,
|
|
32657
32658
|
onSelectLocale,
|
|
32658
32659
|
aiEnabled,
|
|
32659
32660
|
chatStore,
|
|
@@ -32661,7 +32662,17 @@ function OpenSettingsDialog({
|
|
|
32661
32662
|
onCustomFontRegistered
|
|
32662
32663
|
}) {
|
|
32663
32664
|
const { t } = useTranslation();
|
|
32664
|
-
const
|
|
32665
|
+
const viewerCustomization = useViewerCustomizationContext();
|
|
32666
|
+
const customization = useMemo(
|
|
32667
|
+
() => languageSelectable ? viewerCustomization : {
|
|
32668
|
+
...viewerCustomization,
|
|
32669
|
+
hiddenOptionsPages: /* @__PURE__ */ new Set([
|
|
32670
|
+
...viewerCustomization.hiddenOptionsPages,
|
|
32671
|
+
"language"
|
|
32672
|
+
])
|
|
32673
|
+
},
|
|
32674
|
+
[viewerCustomization, languageSelectable]
|
|
32675
|
+
);
|
|
32665
32676
|
const regionBase = useContext(ViewerRegionBaseContext);
|
|
32666
32677
|
const regionContext = useMemo(
|
|
32667
32678
|
() => regionBase ? { ...regionBase, region: "dialog.options", close: onClose } : null,
|
|
@@ -33446,10 +33457,106 @@ function useViewerCustomization(customization, legacyHiddenActions, optionsStore
|
|
|
33446
33457
|
);
|
|
33447
33458
|
return { resolved, api: controller.api, hiddenActions };
|
|
33448
33459
|
}
|
|
33460
|
+
var NO_LOCALES = [];
|
|
33461
|
+
var toCatalogEntry = (code) => LOCALE_CATALOG.find((entry) => entry.code === code) ?? { code, label: code, nativeLabel: code };
|
|
33462
|
+
function useHostLanguage({
|
|
33463
|
+
defaultLocale,
|
|
33464
|
+
availableLocales,
|
|
33465
|
+
onLocaleChange
|
|
33466
|
+
}) {
|
|
33467
|
+
const { t, i18n } = useHostI18next();
|
|
33468
|
+
const [localeCode, setLocaleCode] = useState(
|
|
33469
|
+
() => defaultLocale ?? readStoredViewerPrefs().localeCode ?? "en"
|
|
33470
|
+
);
|
|
33471
|
+
useEffect(() => {
|
|
33472
|
+
if (localeCode !== "en" && !onLocaleChange) {
|
|
33473
|
+
void i18n.changeLanguage(localeCode);
|
|
33474
|
+
}
|
|
33475
|
+
}, []);
|
|
33476
|
+
const locales = useMemo(() => {
|
|
33477
|
+
if (availableLocales) {
|
|
33478
|
+
return availableLocales;
|
|
33479
|
+
}
|
|
33480
|
+
const registeredCodes = i18n.options.resources ? Object.keys(i18n.options.resources) : i18n.languages ?? ["en"];
|
|
33481
|
+
return registeredCodes.map(toCatalogEntry);
|
|
33482
|
+
}, [availableLocales, i18n]);
|
|
33483
|
+
const selectLocale = useCallback(
|
|
33484
|
+
(code) => {
|
|
33485
|
+
setLocaleCode(code);
|
|
33486
|
+
if (onLocaleChange) {
|
|
33487
|
+
onLocaleChange(code);
|
|
33488
|
+
} else {
|
|
33489
|
+
void i18n.changeLanguage(code);
|
|
33490
|
+
writeStoredViewerPrefs({ localeCode: code });
|
|
33491
|
+
}
|
|
33492
|
+
},
|
|
33493
|
+
[onLocaleChange, i18n]
|
|
33494
|
+
);
|
|
33495
|
+
const language = i18n.resolvedLanguage ?? i18n.language ?? localeCode;
|
|
33496
|
+
const state = useMemo(() => ({ t, locale: language }), [t, language]);
|
|
33497
|
+
const controls = useMemo(
|
|
33498
|
+
() => ({ localeCode, locales, selectLocale, languageSelectable: true }),
|
|
33499
|
+
[localeCode, locales, selectLocale]
|
|
33500
|
+
);
|
|
33501
|
+
return { state, controls };
|
|
33502
|
+
}
|
|
33503
|
+
function useProvidedLanguage({
|
|
33504
|
+
availableLocales,
|
|
33505
|
+
onLocaleChange
|
|
33506
|
+
}) {
|
|
33507
|
+
const state = useContext(PptxI18nContext);
|
|
33508
|
+
const { locale } = state;
|
|
33509
|
+
const locales = availableLocales ?? NO_LOCALES;
|
|
33510
|
+
const controls = useMemo(
|
|
33511
|
+
() => ({
|
|
33512
|
+
// `fr-CA` selects an offered `fr`: the host's locale need not be one of the codes.
|
|
33513
|
+
localeCode: normalizeLocale(
|
|
33514
|
+
locale,
|
|
33515
|
+
locales.map((entry) => entry.code),
|
|
33516
|
+
locale
|
|
33517
|
+
),
|
|
33518
|
+
locales,
|
|
33519
|
+
selectLocale: (code) => onLocaleChange?.(code),
|
|
33520
|
+
languageSelectable: onLocaleChange !== void 0 && locales.length > 1
|
|
33521
|
+
}),
|
|
33522
|
+
[locale, locales, onLocaleChange]
|
|
33523
|
+
);
|
|
33524
|
+
return { state, controls };
|
|
33525
|
+
}
|
|
33526
|
+
function provideLanguage({ state, controls }, children) {
|
|
33527
|
+
return /* @__PURE__ */ jsx(ViewerI18nContext.Provider, { value: state, children: /* @__PURE__ */ jsx(ViewerLocaleControlsContext.Provider, { value: controls, children }) });
|
|
33528
|
+
}
|
|
33529
|
+
function HostLanguageRoot({ children, ...props }) {
|
|
33530
|
+
return provideLanguage(useHostLanguage(props), children);
|
|
33531
|
+
}
|
|
33532
|
+
function ProvidedLanguageRoot({ children, ...props }) {
|
|
33533
|
+
return provideLanguage(useProvidedLanguage(props), children);
|
|
33534
|
+
}
|
|
33535
|
+
function ViewerI18nRoot(props) {
|
|
33536
|
+
const Root = useContext(PptxI18nContext) ? ProvidedLanguageRoot : HostLanguageRoot;
|
|
33537
|
+
return /* @__PURE__ */ jsx(Root, { ...props });
|
|
33538
|
+
}
|
|
33539
|
+
function useViewerLocaleControls() {
|
|
33540
|
+
return useContext(ViewerLocaleControlsContext);
|
|
33541
|
+
}
|
|
33449
33542
|
var NO_RIBBON_ADD_INS = [];
|
|
33450
33543
|
var PowerPointViewerComponent = /* @__PURE__ */ forwardRef(
|
|
33451
33544
|
// oxlint-disable-next-line prefer-arrow-callback -- named fn gives the forwardRef component its displayName
|
|
33452
33545
|
function PowerPointViewer(props, ref) {
|
|
33546
|
+
return /* @__PURE__ */ jsx(
|
|
33547
|
+
ViewerI18nRoot,
|
|
33548
|
+
{
|
|
33549
|
+
defaultLocale: props.defaultLocale,
|
|
33550
|
+
availableLocales: props.availableLocales,
|
|
33551
|
+
onLocaleChange: props.onLocaleChange,
|
|
33552
|
+
children: /* @__PURE__ */ jsx(PowerPointViewerBody, { ...props, ref })
|
|
33553
|
+
}
|
|
33554
|
+
);
|
|
33555
|
+
}
|
|
33556
|
+
);
|
|
33557
|
+
var PowerPointViewerBody = /* @__PURE__ */ forwardRef(
|
|
33558
|
+
// oxlint-disable-next-line prefer-arrow-callback -- named fn gives the forwardRef component its displayName
|
|
33559
|
+
function PowerPointViewerBody2(props, ref) {
|
|
33453
33560
|
const {
|
|
33454
33561
|
content: incomingContent,
|
|
33455
33562
|
fonts = [],
|
|
@@ -33474,9 +33581,6 @@ var PowerPointViewerComponent = /* @__PURE__ */ forwardRef(
|
|
|
33474
33581
|
defaultThemeKey,
|
|
33475
33582
|
availableThemes,
|
|
33476
33583
|
onThemeChange,
|
|
33477
|
-
defaultLocale,
|
|
33478
|
-
availableLocales,
|
|
33479
|
-
onLocaleChange,
|
|
33480
33584
|
accountAuth,
|
|
33481
33585
|
authorName,
|
|
33482
33586
|
collaboration: collaborationInput,
|
|
@@ -33542,40 +33646,13 @@ var PowerPointViewerComponent = /* @__PURE__ */ forwardRef(
|
|
|
33542
33646
|
(current) => current.includes(family) ? current : [...current, family]
|
|
33543
33647
|
);
|
|
33544
33648
|
}, []);
|
|
33545
|
-
const { t
|
|
33546
|
-
const
|
|
33547
|
-
|
|
33548
|
-
|
|
33549
|
-
|
|
33550
|
-
|
|
33551
|
-
|
|
33552
|
-
}
|
|
33553
|
-
}, []);
|
|
33554
|
-
const resolvedLocales = useMemo(() => {
|
|
33555
|
-
if (availableLocales) {
|
|
33556
|
-
return availableLocales;
|
|
33557
|
-
}
|
|
33558
|
-
const registeredCodes = i18n.options.resources ? Object.keys(i18n.options.resources) : i18n.languages ?? ["en"];
|
|
33559
|
-
return registeredCodes.map(
|
|
33560
|
-
(code) => LOCALE_CATALOG.find((entry) => entry.code === code) ?? {
|
|
33561
|
-
code,
|
|
33562
|
-
label: code,
|
|
33563
|
-
nativeLabel: code
|
|
33564
|
-
}
|
|
33565
|
-
);
|
|
33566
|
-
}, [availableLocales, i18n]);
|
|
33567
|
-
const handleLocaleChange = useCallback(
|
|
33568
|
-
(code) => {
|
|
33569
|
-
setLocaleCode(code);
|
|
33570
|
-
if (onLocaleChange) {
|
|
33571
|
-
onLocaleChange(code);
|
|
33572
|
-
} else {
|
|
33573
|
-
void i18n.changeLanguage(code);
|
|
33574
|
-
writeStoredViewerPrefs({ localeCode: code });
|
|
33575
|
-
}
|
|
33576
|
-
},
|
|
33577
|
-
[onLocaleChange, i18n]
|
|
33578
|
-
);
|
|
33649
|
+
const { t } = useTranslation();
|
|
33650
|
+
const {
|
|
33651
|
+
localeCode,
|
|
33652
|
+
locales: resolvedLocales,
|
|
33653
|
+
selectLocale: handleLocaleChange,
|
|
33654
|
+
languageSelectable
|
|
33655
|
+
} = useViewerLocaleControls();
|
|
33579
33656
|
const [content, setContent] = useState(incomingContent);
|
|
33580
33657
|
const [loadOrigin, setLoadOrigin] = useState("bootstrap");
|
|
33581
33658
|
useEffect(() => {
|
|
@@ -34609,6 +34686,7 @@ ${url}`)
|
|
|
34609
34686
|
onSelectTheme: handleThemeChange,
|
|
34610
34687
|
localeCode,
|
|
34611
34688
|
availableLocales: resolvedLocales,
|
|
34689
|
+
languageSelectable,
|
|
34612
34690
|
onSelectLocale: handleLocaleChange,
|
|
34613
34691
|
aiEnabled,
|
|
34614
34692
|
customFontFamilies,
|
|
@@ -34878,5 +34956,30 @@ function CollaborationFollowLayer({
|
|
|
34878
34956
|
}
|
|
34879
34957
|
) }) });
|
|
34880
34958
|
}
|
|
34959
|
+
var asMessageParams = (params) => params;
|
|
34960
|
+
function withEnglishFallback(translate) {
|
|
34961
|
+
return (key, defaultOrParams) => {
|
|
34962
|
+
const params = typeof defaultOrParams === "string" ? { defaultValue: defaultOrParams } : defaultOrParams;
|
|
34963
|
+
let text;
|
|
34964
|
+
try {
|
|
34965
|
+
text = params === void 0 ? translate(key) : translate(key, params);
|
|
34966
|
+
} catch {
|
|
34967
|
+
text = void 0;
|
|
34968
|
+
}
|
|
34969
|
+
const found = text && text !== key ? text : translationsEn[key] ?? params?.defaultValue;
|
|
34970
|
+
return typeof found === "string" ? interpolate(found, asMessageParams(params), "double") : keyToLabel(key);
|
|
34971
|
+
};
|
|
34972
|
+
}
|
|
34973
|
+
function PptxI18nProvider({
|
|
34974
|
+
translate,
|
|
34975
|
+
locale,
|
|
34976
|
+
children
|
|
34977
|
+
}) {
|
|
34978
|
+
const state = useMemo(
|
|
34979
|
+
() => ({ t: withEnglishFallback(translate), locale }),
|
|
34980
|
+
[translate, locale]
|
|
34981
|
+
);
|
|
34982
|
+
return /* @__PURE__ */ jsx(PptxI18nContext.Provider, { value: state, children });
|
|
34983
|
+
}
|
|
34881
34984
|
|
|
34882
|
-
export { CollaborationStatusIndicator, PowerPointViewer2 as PowerPointViewer, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, Toolbar, UserAvatarBar, ViewerThemeProvider, useViewerTheme };
|
|
34985
|
+
export { CollaborationStatusIndicator, PowerPointViewer2 as PowerPointViewer, PptxI18nProvider, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, Toolbar, UserAvatarBar, ViewerThemeProvider, useViewerTheme };
|
|
Binary file
|
|
Binary file
|