@pptx-editor.dev/react 0.1.0 → 0.2.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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/index.d.ts +36 -7
- package/dist/index.js +314 -103
- package/package.json +3 -3
- package/dist/index.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright 2026
|
|
189
|
+
Copyright 2026 Eigenpal, Inc.
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -245,7 +245,7 @@ const fonts = useFonts(packagedFonts());
|
|
|
245
245
|
<PptxEditor document={bytes} fonts={fonts} onFontError={(error) => report(error)} />;
|
|
246
246
|
```
|
|
247
247
|
|
|
248
|
-
See [Fonts](
|
|
248
|
+
See [Fonts](https://github.com/eigenpal/pptx-editor/blob/main/docs/site/content/customization/fonts.mdx).
|
|
249
249
|
|
|
250
250
|
## License
|
|
251
251
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ReactElement, CSSProperties, ComponentType, MouseEvent } from 'react';
|
|
3
|
-
import { ChromeTranslate, PptxEditorInstance, ColumnsDialogFields, BulletsDialogFields, FontDialogFields, ParagraphDialogFields, SlideBackground, EditorRejection, MenuNamedRow, ChromeSlotId, ChromeMenuId, CanvasMenuKind, SlideSection, CommandResult, EditorCommand, EditorExecOptions, EditorSnapshot, EditorMode, EditorFontsOption, EditorFontError, EditorModule, ColorMode, ChromeGroupId, ChromeControl, SlideshowController, ToolbarValueMap, ToolbarShownValue, SlideRailOrientation, DocumentOpenFailure, RibbonTabId, ResolvedColorMode, DocumentSearchState, DocumentSearchFindOptions, FindMatch, EditorCaret, HistoryGroupBindingOptions, PptxEditorEvents, ShapeStyleChoice, ShapeStyleValue, HyperlinkPopupActions, HyperlinkPopupState, FontResolver, PptxSource, UsePptxSourceOptions, GradientFill, SlideLayoutSummary, ParagraphFormatRead, ParagraphFormatCommand, FontFormatRead, FontFormatCommand, BulletFormatRead, BulletFormat, FontConfigurationFragment, MarkedFontResolver, FontOrigin, FontPickerGroup, FontPickerRow, PopoverAnchorRect, ContextMenuPartName, MenuRowPartName } from '@pptx-editor.dev/core/editor';
|
|
3
|
+
import { ChromeTranslate, PptxEditorInstance, ColumnsDialogFields, BulletsDialogFields, FontDialogFields, ParagraphDialogFields, SlideBackground, EditorRejection, MenuNamedRow, ChromeSlotId, ChromeMenuId, CanvasMenuKind, SlideSection, LoadOptions, CommandResult, EditorCommand, EditorExecOptions, EditorSnapshot, EditorMode, EditorFontsOption, EditorFontError, EditorModule, ColorMode, ChromeGroupId, ChromeControl, SlideshowController, ToolbarValueMap, ToolbarShownValue, SlideRailOrientation, DocumentOpenFailure, RibbonTabId, ResolvedColorMode, DocumentSearchState, DocumentSearchFindOptions, FindMatch, EditorCaret, HistoryGroupBindingOptions, PptxEditorEvents, ShapeStyleChoice, ShapeStyleValue, HyperlinkPopupActions, HyperlinkPopupState, FontResolver, PptxSource, UsePptxSourceOptions, GradientFill, SlideLayoutSummary, ParagraphFormatRead, ParagraphFormatCommand, FontFormatRead, FontFormatCommand, BulletFormatRead, BulletFormat, FontConfigurationFragment, MarkedFontResolver, FontOrigin, FontPickerGroup, FontPickerRow, PopoverAnchorRect, ContextMenuPartName, MenuRowPartName } from '@pptx-editor.dev/core/editor';
|
|
4
4
|
export { BulletFormat, BulletFormatRead, BulletsDialogFields, CanvasMenuKind, ChromeControl, ChromeGroupId, ChromeMenuId, ChromeSlotId, ChromeTranslate, ColorMode, ColumnsDialogFields, CommandResult, ContextMenuPartName, DEFAULT_FONT, DocumentOpenFailure, DocumentSearchFindOptions, DocumentSearchState, EditorCaret, EditorCommand, EditorExecOptions, EditorFontError, EditorFontsOption, EditorMode, EditorModule, EditorRejection, EditorRemoval, EditorSnapshot, FontConfigurationBase, FontConfigurationFragment, FontDialogFields, FontFormatCommand, FontFormatRead, FontLoadFailure, FontLoadFailureReason, FontOrigin, FontPickerGroup, FontPickerGroupId, FontPickerRow, FontResolutionRequest, FontResolver, FontResolverMark, FontUrlSource, GradientFill, HistoryGroupBindingOptions, HyperlinkPopupActions, HyperlinkPopupLink, HyperlinkPopupMode, HyperlinkPopupState, LoadFontsRequest, LoadFontsResult, MAX_RESOLVER_FAMILIES, MarkedFontResolver, MenuNamedRow, MenuRowPartName, ParagraphDialogFields, ParagraphFormatCommand, ParagraphFormatRead, PptxEditorEvents, PptxEditorInstance, PptxFontOrigin, PptxFontsInput, PptxFontsSource, PptxSource, ResolvedColorMode, RibbonTabId, ShapeStyleChoice, ShapeStyleValue, SlideBackground, SlideLayoutSummary, SlideRailOrientation, SlideSection, SlideshowController, ToolbarShownValue, ToolbarValueMap, UsePptxSourceOptions, composeFontConfiguration, composeFontOrigins, createFontSource, deferFonts, defineFontResolver, gradientCss, isFontResolver, loadFonts, platformShortcuts } from '@pptx-editor.dev/core/editor';
|
|
5
5
|
import { Translate, LocaleCatalog } from '@pptx-editor.dev/i18n';
|
|
6
6
|
import { FontConfiguration } from '@pptx-editor.dev/core/contracts';
|
|
@@ -1201,6 +1201,12 @@ interface PptxEditorRootProps {
|
|
|
1201
1201
|
* effect and prints a development warning. Create the list once, outside the component.
|
|
1202
1202
|
*/
|
|
1203
1203
|
readonly modules?: readonly EditorModule[];
|
|
1204
|
+
/**
|
|
1205
|
+
* AutoCorrect while typing (default `true`): curly quotes, symbols, fractions, en dashes,
|
|
1206
|
+
* sentence capitals, and lists started by typing `1.`, `1)`, `*`, or `-` and a space. Read
|
|
1207
|
+
* once, when the editor is created.
|
|
1208
|
+
*/
|
|
1209
|
+
readonly autoCorrect?: boolean;
|
|
1204
1210
|
/** Customize the dialogs the editor mounts. Set an entry to `false` to turn one off. */
|
|
1205
1211
|
readonly popups?: PptxEditorPopups;
|
|
1206
1212
|
/**
|
|
@@ -1220,11 +1226,16 @@ interface PptxEditorRootProps {
|
|
|
1220
1226
|
* returns. @public
|
|
1221
1227
|
*/
|
|
1222
1228
|
interface PptxEditorRef {
|
|
1223
|
-
/** Open `.pptx` bytes. Resolves when the presentation is open, or with the refusal. */
|
|
1224
|
-
load(bytes: Uint8Array): Promise<CommandResult>;
|
|
1225
1229
|
/**
|
|
1226
|
-
*
|
|
1227
|
-
*
|
|
1230
|
+
* Open `.pptx` bytes. Resolves when the presentation is open, or with the refusal. A long
|
|
1231
|
+
* deck resolves when `options.startSlide` (or the first slide) is ready.
|
|
1232
|
+
*/
|
|
1233
|
+
load(bytes: Uint8Array, options?: LoadOptions): Promise<CommandResult>;
|
|
1234
|
+
/**
|
|
1235
|
+
* The presentation as `.pptx` bytes. The bytes own an `ArrayBuffer`, so `new Blob([bytes])`
|
|
1236
|
+
* takes them as they are. `null` when no presentation is open, and when a slide of it is
|
|
1237
|
+
* damaged: `snapshot().readOnlyReason` is then `'damaged-slide'` (after edits), or
|
|
1238
|
+
* `snapshot().openFailure` reports the refused file.
|
|
1228
1239
|
*/
|
|
1229
1240
|
save(): Uint8Array<ArrayBuffer> | null;
|
|
1230
1241
|
/** The editor instance, or `null` before it mounts. */
|
|
@@ -1242,14 +1253,21 @@ declare const PptxEditorRoot: react.ForwardRefExoticComponent<PptxEditorRootProp
|
|
|
1242
1253
|
interface PptxEditorViewportProps {
|
|
1243
1254
|
/** Appended after the `pptx-editor` class. */
|
|
1244
1255
|
className?: string;
|
|
1256
|
+
/**
|
|
1257
|
+
* The name of the editor's landmark region, or a translation key. Default: "Presentation
|
|
1258
|
+
* editor" (`viewport.ariaLabel`). Give each editor its own name when a page shows more than one.
|
|
1259
|
+
* `false` renders no region, for a host whose own landmarks (`header`, `main`) are inside.
|
|
1260
|
+
*/
|
|
1261
|
+
label?: string | false;
|
|
1245
1262
|
/** The chrome and the content of the editor. */
|
|
1246
1263
|
children?: ReactNode;
|
|
1247
1264
|
}
|
|
1248
1265
|
/**
|
|
1249
1266
|
* The editor's scroll and styling scope: carries the `.pptx-editor` class, and `dark` with it
|
|
1250
|
-
* when the root's `colorMode` resolves to dark.
|
|
1267
|
+
* when the root's `colorMode` resolves to dark. It is a named landmark region ("Presentation
|
|
1268
|
+
* editor"), so a screen reader user can go to the editor from anywhere on the page. @public
|
|
1251
1269
|
*/
|
|
1252
|
-
declare function PptxEditorViewport({ className, children }: PptxEditorViewportProps): react.JSX.Element;
|
|
1270
|
+
declare function PptxEditorViewport({ className, label, children }: PptxEditorViewportProps): react.JSX.Element;
|
|
1253
1271
|
/** The props of `PptxEditorContent`. @public */
|
|
1254
1272
|
interface PptxEditorContentProps {
|
|
1255
1273
|
/** Appended after the `pptx-canvas` class. */
|
|
@@ -1538,6 +1556,9 @@ interface UseEditorValueCommandReturn<V, S = V> {
|
|
|
1538
1556
|
/**
|
|
1539
1557
|
* The slot's fixed choices, from the registry (the Rotate, Align, line width, or Shape Effects
|
|
1540
1558
|
* rows); none for a slot with a free value (`font.size`, `shape.fill`, `shape.styles`).
|
|
1559
|
+
* Without the `@pptx-editor.dev/pro/drawing` module, they leave out the effects it paints
|
|
1560
|
+
* (`chromeOfferedControl`), so `value` can be an effect from the file that is not in the list.
|
|
1561
|
+
* They keep the rows that remove an effect the selection has (`reflection.none`).
|
|
1541
1562
|
*/
|
|
1542
1563
|
readonly options: readonly V[];
|
|
1543
1564
|
/** Whether the command can run now. */
|
|
@@ -1864,6 +1885,12 @@ interface ToolbarNamedParts {
|
|
|
1864
1885
|
readonly TableCellFill: ToolbarColorSplitComponent;
|
|
1865
1886
|
/** `table.borderTarget`. */
|
|
1866
1887
|
readonly TableBorderTarget: ToolbarSlotPartComponent;
|
|
1888
|
+
/** `table.borderColor`. */
|
|
1889
|
+
readonly TableBorderColor: ToolbarColorSplitComponent;
|
|
1890
|
+
/** `table.borderStyle`. */
|
|
1891
|
+
readonly TableBorderStyle: ToolbarSlotPartComponent;
|
|
1892
|
+
/** `table.borderWidth`. */
|
|
1893
|
+
readonly TableBorderWidth: ToolbarSlotPartComponent;
|
|
1867
1894
|
/** `table.select`. */
|
|
1868
1895
|
readonly TableSelect: ToolbarSlotPartComponent;
|
|
1869
1896
|
/** `table.delete`. */
|
|
@@ -3192,6 +3219,8 @@ interface PptxEditorProps {
|
|
|
3192
3219
|
readonly fontFamilies?: readonly string[];
|
|
3193
3220
|
/** Capability modules (`@pptx-editor.dev/pro`), as on `PptxEditor.Root`. Read at mount. */
|
|
3194
3221
|
readonly modules?: readonly EditorModule[];
|
|
3222
|
+
/** AutoCorrect while typing, as on `PptxEditor.Root`. Read at mount. */
|
|
3223
|
+
readonly autoCorrect?: boolean;
|
|
3195
3224
|
/**
|
|
3196
3225
|
* The notice for a file that does not open (`PptxEditor.OpenFailure`). An object is
|
|
3197
3226
|
* `PptxEditorOpenFailureProps`, passed straight through. `false` removes the notice, for a host that
|