@pptx-editor.dev/react 0.3.0-canary.20261109032918.sha-39dc46e → 0.3.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/dist/index.d.ts +5 -4
- package/dist/index.js +14 -11
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1262,8 +1262,9 @@ interface PptxEditorRootProps {
|
|
|
1262
1262
|
*/
|
|
1263
1263
|
readonly modules?: readonly EditorModule[];
|
|
1264
1264
|
/**
|
|
1265
|
-
* AutoCorrect while typing (default `true`):
|
|
1266
|
-
*
|
|
1265
|
+
* AutoCorrect while typing (default `true`): symbols, ellipses, fractions, and lists started
|
|
1266
|
+
* by typing `1.`, `1)`, `*`, or `-` and a space. Capitals, curly quotes, dashes, and
|
|
1267
|
+
* spelling are never automatic here: keyboards and systems that offer them apply them. Read
|
|
1267
1268
|
* once, when the editor is created.
|
|
1268
1269
|
*/
|
|
1269
1270
|
readonly autoCorrect?: boolean;
|
|
@@ -2328,8 +2329,8 @@ interface StatusBarNotesProps extends StatusBarPartProps {
|
|
|
2328
2329
|
/** The Notes button: shows or hides the speaker notes (`useNotesPane`). @public */
|
|
2329
2330
|
declare function StatusBarNotes({ className, hidden, icon, asChild, children, }: StatusBarNotesProps): ReactNode;
|
|
2330
2331
|
/**
|
|
2331
|
-
* The view buttons: the editor's view switch (`view.presentationView`: Normal
|
|
2332
|
-
* Sorter
|
|
2332
|
+
* The view buttons: the editor's view switch (`view.presentationView`: Normal and Slide
|
|
2333
|
+
* Sorter), the same control as the default editor's status area. @public
|
|
2333
2334
|
*/
|
|
2334
2335
|
declare function StatusBarViews({ className, hidden }: StatusBarPartProps): ReactNode;
|
|
2335
2336
|
/** Zoom out, the zoom level with its menu, and zoom in: the editor's `ZoomPill`. @public */
|
package/dist/index.js
CHANGED
|
@@ -5277,6 +5277,7 @@ import {
|
|
|
5277
5277
|
resolveChromeMenuRow,
|
|
5278
5278
|
runChromeRow,
|
|
5279
5279
|
sameChromeCommandState as sameChromeCommandState2,
|
|
5280
|
+
SHAPE_GRID_MENU_SLOTS,
|
|
5280
5281
|
surfaceInputIn,
|
|
5281
5282
|
tidySeparators,
|
|
5282
5283
|
translateKeyOrText as translateKeyOrText10,
|
|
@@ -6458,7 +6459,8 @@ function SlotMenuRow({
|
|
|
6458
6459
|
if (entry.value === void 0 && control.state.kind === "value" && !entry.direct) {
|
|
6459
6460
|
if (entry.slot === "slide.add" || entry.slot === "slide.layout")
|
|
6460
6461
|
return /* @__PURE__ */ jsx26(LayoutSubmenu, { slot: entry.slot, ...common });
|
|
6461
|
-
if (
|
|
6462
|
+
if (SHAPE_GRID_MENU_SLOTS.has(entry.slot))
|
|
6463
|
+
return /* @__PURE__ */ jsx26(GallerySubmenu, { slot: entry.slot, ...common });
|
|
6462
6464
|
if (control.shape === "tableGrid")
|
|
6463
6465
|
return /* @__PURE__ */ jsx26(MenuSubmenu, { ...common, children: /* @__PURE__ */ jsx26(MenuTableGrid, { slot: entry.slot, label, autoFocus: true, onInserted: close }) });
|
|
6464
6466
|
const offered = offeredControl ?? control;
|
|
@@ -7002,7 +7004,7 @@ import {
|
|
|
7002
7004
|
useState as useState38
|
|
7003
7005
|
} from "react";
|
|
7004
7006
|
import {
|
|
7005
|
-
|
|
7007
|
+
STATUS_BAR_VIEW_OPTIONS,
|
|
7006
7008
|
focusSorterOnShow,
|
|
7007
7009
|
tooltipAttributes as tooltipAttributes6,
|
|
7008
7010
|
groupSlideSections as groupSlideSections3,
|
|
@@ -10849,7 +10851,7 @@ function SlideSorter({ className } = {}) {
|
|
|
10849
10851
|
function ViewSwitch() {
|
|
10850
10852
|
const { t } = useTranslation();
|
|
10851
10853
|
const cmd = useEditorCommand("view.presentationView");
|
|
10852
|
-
const options =
|
|
10854
|
+
const options = STATUS_BAR_VIEW_OPTIONS;
|
|
10853
10855
|
const off = !cmd.isEnabled;
|
|
10854
10856
|
const reason = cmd.disabledReason ? translateKeyOrText14(t, cmd.disabledReason) : null;
|
|
10855
10857
|
const offAttrs = useAriaDisabled(off, reason);
|
|
@@ -10870,8 +10872,9 @@ function ViewSwitch() {
|
|
|
10870
10872
|
"aria-label": t("toolbar.presentationView"),
|
|
10871
10873
|
onMouseDown: keepFocus,
|
|
10872
10874
|
children: [
|
|
10873
|
-
options.map((o) => {
|
|
10875
|
+
options.map((o, i) => {
|
|
10874
10876
|
const on = cmd.value === o.value;
|
|
10877
|
+
const tabStop = on || i === 0 && !options.some((x) => x.value === cmd.value);
|
|
10875
10878
|
const label = t(o.labelKey);
|
|
10876
10879
|
return /* @__PURE__ */ jsx43(
|
|
10877
10880
|
"button",
|
|
@@ -10882,7 +10885,7 @@ function ViewSwitch() {
|
|
|
10882
10885
|
"aria-label": label,
|
|
10883
10886
|
...offAttrs.attrs,
|
|
10884
10887
|
...tooltipAttributes6(label, off, reason),
|
|
10885
|
-
tabIndex:
|
|
10888
|
+
tabIndex: tabStop ? 0 : -1,
|
|
10886
10889
|
className: "pptx-toolbar__button pptx-view-switch__option",
|
|
10887
10890
|
"data-active": on ? "" : void 0,
|
|
10888
10891
|
"data-disabled": off ? "" : void 0,
|
|
@@ -11160,7 +11163,7 @@ import {
|
|
|
11160
11163
|
requestDialogSection,
|
|
11161
11164
|
runChromeRow as runChromeRow2,
|
|
11162
11165
|
surfaceInputIn as surfaceInputIn2,
|
|
11163
|
-
chromeControlForSlot as
|
|
11166
|
+
chromeControlForSlot as chromeControlForSlot4,
|
|
11164
11167
|
chromeSlotIsToggle,
|
|
11165
11168
|
isToolbarBarSlot,
|
|
11166
11169
|
TOOLBAR_NAMED_PARTS,
|
|
@@ -11719,7 +11722,7 @@ function CorrectionsControl({
|
|
|
11719
11722
|
import { Children as Children6, isValidElement as isValidElement6 } from "react";
|
|
11720
11723
|
import {
|
|
11721
11724
|
TOOLBAR_COMPOUND_SLOTS,
|
|
11722
|
-
chromeControlForSlot as
|
|
11725
|
+
chromeControlForSlot as chromeControlForSlot3,
|
|
11723
11726
|
warnAsChildChild as warnAsChildChild2,
|
|
11724
11727
|
warnIgnoredSlotAttributes,
|
|
11725
11728
|
warnReplacedControlSetting
|
|
@@ -11933,7 +11936,7 @@ var FONT_FAMILY_PARTS = {
|
|
|
11933
11936
|
// src/toolbar-parts.tsx
|
|
11934
11937
|
import { Fragment as Fragment38, jsx as jsx51 } from "react/jsx-runtime";
|
|
11935
11938
|
function namedPartSlotProps(slot, props, partName) {
|
|
11936
|
-
const shape =
|
|
11939
|
+
const shape = chromeControlForSlot3(slot)?.shape;
|
|
11937
11940
|
if (shape !== void 0 && shape !== "icon")
|
|
11938
11941
|
return { ...props, slotId: slot, [NAMED_PART]: partName };
|
|
11939
11942
|
const { children, icon, ...rest } = props;
|
|
@@ -11976,7 +11979,7 @@ function SlotControl({
|
|
|
11976
11979
|
if (props.icon !== void 0) warnReplacedControlSetting(props.slotId, "icon", parts10);
|
|
11977
11980
|
return /* @__PURE__ */ jsx51(Fragment38, { children: props.children });
|
|
11978
11981
|
}
|
|
11979
|
-
const control = compose ?
|
|
11982
|
+
const control = compose ? chromeControlForSlot3(props.slotId) : null;
|
|
11980
11983
|
const body = control && !props.asChild && props.children !== void 0 ? () => /* @__PURE__ */ jsx51(FontFamilyControl, { slot: props.slotId, control, children: props.children }) : render2;
|
|
11981
11984
|
const child = props.asChild ? asChildElement(props) : null;
|
|
11982
11985
|
return /* @__PURE__ */ jsx51(
|
|
@@ -12383,7 +12386,7 @@ function ActionControl({ slot, control }) {
|
|
|
12383
12386
|
) });
|
|
12384
12387
|
}
|
|
12385
12388
|
function ToolbarSlot(props) {
|
|
12386
|
-
const control =
|
|
12389
|
+
const control = chromeControlForSlot4(props.slotId);
|
|
12387
12390
|
if (!control) {
|
|
12388
12391
|
warnUnknownSlot(props.slotId);
|
|
12389
12392
|
return null;
|
|
@@ -12428,7 +12431,7 @@ function collectToolbarOverrides(children, inBar = isToolbarBarSlot) {
|
|
|
12428
12431
|
NAMED_PART_BY_SLOT.get(named)
|
|
12429
12432
|
) : child.props;
|
|
12430
12433
|
const parts10 = slotPartNames(props);
|
|
12431
|
-
if (!
|
|
12434
|
+
if (!chromeControlForSlot4(props.slotId)) warnUnknownSlot(props.slotId, parts10);
|
|
12432
12435
|
else if (!inBar(props.slotId)) {
|
|
12433
12436
|
if (!named && !props.hidden) warnSlotOutsideBar(props.slotId, parts10);
|
|
12434
12437
|
if (!props.hidden) extras.push(child);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pptx-editor.dev/react",
|
|
3
|
-
"version": "0.3.0
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "React adapter for PPTX Editor: a provider, hooks, and chrome compounds over the @pptx-editor.dev/core editor contract.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"api:check": "node ../../scripts/api-extractor.mjs --package @pptx-editor.dev/react"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@pptx-editor.dev/i18n": "0.3.0
|
|
31
|
+
"@pptx-editor.dev/i18n": "^0.3.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@pptx-editor.dev/core": "0.3.0
|
|
34
|
+
"@pptx-editor.dev/core": "~0.3.0",
|
|
35
35
|
"react": "^18.0.0 || ^19.0.0",
|
|
36
36
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
37
37
|
},
|