@pptx-editor.dev/editor-api 0.0.1-placeholder → 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.md +84 -0
- package/README.md +127 -2
- package/THIRD_PARTY_NOTICES.md +3 -0
- package/dist/browser.d.ts +58 -0
- package/dist/browser.js +6 -0
- package/dist/chunk-K2KXZPMF.js +6 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.js +6 -0
- package/dist/server-BVGx60kW.d.ts +3401 -0
- package/package.json +49 -9
- package/index.js +0 -1
package/LICENSE.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# EigenPal Pro Evaluation License 1.0
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Eigenpal, Inc. All rights reserved.
|
|
4
|
+
|
|
5
|
+
By copying, modifying, or using the Software, you agree to these terms.
|
|
6
|
+
|
|
7
|
+
## 1. Covered Software
|
|
8
|
+
|
|
9
|
+
“Software” means all source code, object code, documentation, assets, and other materials contained in the “packages/editor-api/” directory of the EigenPal PPTX Editor repository, except for any material that expressly states that it is subject to a different license.
|
|
10
|
+
|
|
11
|
+
## 2. Evaluation Permission; Modifications
|
|
12
|
+
|
|
13
|
+
Subject to these terms, Eigenpal, Inc. grants you a limited, non-exclusive, non-transferable, non-sublicensable, royalty-free license to:
|
|
14
|
+
|
|
15
|
+
1. view, clone, and copy the Software;
|
|
16
|
+
2. run the Software internally in a non-production environment solely to evaluate its suitability for your intended application; and
|
|
17
|
+
3. modify the Software solely as reasonably necessary for that internal, non-production evaluation.
|
|
18
|
+
|
|
19
|
+
For any such modification, the following applies:
|
|
20
|
+
|
|
21
|
+
You may keep any modification to yourself. If you do not disclose it to Eigenpal, Inc. or to anyone else, it remains yours. If you disclose a modification to Eigenpal, Inc. or to any third party, in any form, you assign all right, title, and interest in it to Eigenpal, Inc. at the moment of disclosure. The same applies to any feedback you give Eigenpal, Inc. You will promptly send Eigenpal, Inc. the source code of any modification you disclose, and will sign any document needed to record the assignment. Disclosing a modification to a third party grants that third party no rights in it or in the Software. You will not license or purport to license any modification to anyone. You may continue using an assigned modification for the internal, non-production evaluation permitted by Section 2 for as long as this license is in effect. Eigenpal, Inc. is not obliged to use or support any modification or feedback, and owes you nothing for it. You confirm that any modification or feedback you disclose is yours to assign and is not subject to any license that would impose obligations on Eigenpal, Inc. or grant rights to any third party.
|
|
22
|
+
|
|
23
|
+
No other rights are granted.
|
|
24
|
+
|
|
25
|
+
## 3. No Production Use
|
|
26
|
+
|
|
27
|
+
You may not use the Software for Production Use.
|
|
28
|
+
|
|
29
|
+
“Production Use” means any use of the Software:
|
|
30
|
+
|
|
31
|
+
1. in a live, operational, or customer-facing environment;
|
|
32
|
+
2. to provide, operate, support, or enhance a product or service for another person or organization;
|
|
33
|
+
3. to process live, customer, or business-operational data; or
|
|
34
|
+
4. as part of your ordinary internal business operations, other than evaluation and testing.
|
|
35
|
+
|
|
36
|
+
For the avoidance of doubt, Production Use includes embedding the Software in a product made available to others, offering the Software through a hosted or managed service, and using it in a customer pilot or paid proof of concept.
|
|
37
|
+
|
|
38
|
+
## 4. No Distribution or Sublicensing
|
|
39
|
+
|
|
40
|
+
You may not sell, sublicense, distribute, publish, transfer, or otherwise make the Software or modifications to the Software available to any third party.
|
|
41
|
+
|
|
42
|
+
You may allow your employees and contractors to access the Software solely for your evaluation, provided they are bound by restrictions at least as protective as these terms. You are responsible for their compliance.
|
|
43
|
+
|
|
44
|
+
## 5. Commercial Rights
|
|
45
|
+
|
|
46
|
+
Production Use and any rights not expressly granted by this license require a separate written commercial agreement signed by Eigenpal, Inc.
|
|
47
|
+
|
|
48
|
+
Commercial licenses are available by contacting licensing@eigenpal.com.
|
|
49
|
+
|
|
50
|
+
Access to the Software, correspondence with Eigenpal, Inc., or payment of an invoice does not by itself grant production or commercial rights unless those rights are set out in a written agreement signed by Eigenpal, Inc.
|
|
51
|
+
|
|
52
|
+
## 6. Ownership
|
|
53
|
+
|
|
54
|
+
Eigenpal, Inc. and its licensors retain all rights, title, and interest in the Software. This license does not transfer ownership or grant any rights by implication.
|
|
55
|
+
|
|
56
|
+
Modifying the Software does not grant you the right to use the Software or those modifications in production.
|
|
57
|
+
|
|
58
|
+
## 7. Termination
|
|
59
|
+
|
|
60
|
+
Your rights under this license terminate automatically if you breach these terms or if EigenPal terminates this license.
|
|
61
|
+
|
|
62
|
+
Following termination, you must stop using the Software and delete your copies and modifications, except for copies that you are legally required to retain. Eigenpal, Inc. may reinstate your rights in writing.
|
|
63
|
+
|
|
64
|
+
## 8. No Warranty
|
|
65
|
+
|
|
66
|
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED “AS IS” AND WITHOUT WARRANTIES OF ANY KIND, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT.
|
|
67
|
+
|
|
68
|
+
## 9. Limitation of Liability
|
|
69
|
+
|
|
70
|
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, EIGENPAL, INC. AND ITS LICENSORS WILL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES, OR FOR ANY LOSS OF DATA, REVENUE, PROFITS, OR BUSINESS, ARISING FROM OR RELATING TO THE SOFTWARE OR THIS LICENSE. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE TOTAL AGGREGATE LIABILITY OF EIGENPAL, INC. AND ITS LICENSORS FOR ALL CLAIMS ARISING FROM OR RELATING TO THE SOFTWARE OR THIS LICENSE, WHETHER IN CONTRACT, TORT, STRICT LIABILITY, OR ANY OTHER THEORY, WILL NOT EXCEED TEN UNITED STATES DOLLARS (US$10). THE FOREGOING LIMITATIONS APPLY EVEN IF EIGENPAL, INC. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND EVEN IF ANY LIMITED REMEDY IS FOUND TO HAVE FAILED OF ITS ESSENTIAL PURPOSE.
|
|
71
|
+
|
|
72
|
+
## 10. Trademarks
|
|
73
|
+
|
|
74
|
+
This license does not grant permission to use the names, trademarks, service marks, or logos of Eigenpal, Inc., except to identify the origin of an unmodified copy of the Software.
|
|
75
|
+
|
|
76
|
+
## 11. Governing Law and Jurisdiction
|
|
77
|
+
|
|
78
|
+
This license is governed by the laws of the State of California, without regard to its conflict-of-laws rules.
|
|
79
|
+
|
|
80
|
+
Any dispute arising from or relating to this license will be subject to the exclusive jurisdiction of the state and federal courts located in California, and you consent to their jurisdiction.
|
|
81
|
+
|
|
82
|
+
## 12. Separate Commercial Agreements
|
|
83
|
+
|
|
84
|
+
If Eigenpal, Inc. and you enter into a separate written commercial agreement, that agreement controls to the extent it grants additional rights or conflicts with this license.
|
package/README.md
CHANGED
|
@@ -1,5 +1,130 @@
|
|
|
1
1
|
# @pptx-editor.dev/editor-api
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Drive a `.pptx` from code with an object model in the shape of the Office.js presentation API: `Presentation`, `Slide`, `Shape`, `TextFrame`, `TextRange`, `Table`, and their collections. The package runs on the PPTX Editor engine. It works on a server from PPTX bytes, or in a page against an editor that a reader already has open.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The package is not Office.js and does not run in an add-in host. It implements a documented subset of that API, and every type in it is authored here. It uses the EigenPal Pro License (`LICENSE.md`). Evaluation is permitted. Production use requires a commercial agreement.
|
|
6
|
+
|
|
7
|
+
For task guides and API details, see the [developer documentation](https://pptx-editor.dev/docs/editor-api).
|
|
8
|
+
|
|
9
|
+
## Edit a presentation on a server
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
13
|
+
import { PptxEditor } from '@pptx-editor.dev/editor-api';
|
|
14
|
+
|
|
15
|
+
const runtime = await PptxEditor.createServer(await readFile('deck.pptx'));
|
|
16
|
+
try {
|
|
17
|
+
await runtime.run(async (context) => {
|
|
18
|
+
const slide = context.presentation.slides.getItemAt(0);
|
|
19
|
+
const box = slide.shapes.addTextBox('Quarterly results', { left: 40, top: 40, width: 400 });
|
|
20
|
+
box.textFrame.textRange.font.bold = true;
|
|
21
|
+
await context.sync();
|
|
22
|
+
});
|
|
23
|
+
await writeFile('edited.pptx', await runtime.save());
|
|
24
|
+
} finally {
|
|
25
|
+
runtime.dispose();
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`createServer` takes the font options of the engine: `fonts` (faces to measure text with) and `substitutes` (load the metric-compatible substitute fonts, default `true`). It also takes `rasterize`, a function that turns the SVG of a slide or shape picture into PNG bytes, so `getImageAsBase64` works on a server. The engine paints the SVG with the editor's own renderer, and your function must answer a PNG of exactly the asked size. The package ships no rasterizer.
|
|
30
|
+
|
|
31
|
+
## Drive an open editor
|
|
32
|
+
|
|
33
|
+
Import from `@pptx-editor.dev/editor-api/browser` to get `createBrowser`. It borrows a live `PptxEditorInstance`. Each `sync()` that writes is one undo step, and the selection members work.
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { PptxEditor } from '@pptx-editor.dev/editor-api/browser';
|
|
37
|
+
|
|
38
|
+
const runtime = PptxEditor.createBrowser(editor);
|
|
39
|
+
await runtime.run(async (context) => {
|
|
40
|
+
const range = context.presentation.getSelectedTextRangeOrNullObject();
|
|
41
|
+
range.load('text');
|
|
42
|
+
await context.sync();
|
|
43
|
+
if (!range.isNullObject) range.font.color = '#C00000';
|
|
44
|
+
await context.sync();
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Dispose the runtime before the editor. A browser runtime has no `save()`: save through the editor.
|
|
49
|
+
|
|
50
|
+
## Batches, loads, and null objects
|
|
51
|
+
|
|
52
|
+
- Calls on proxy objects are queued. Nothing reaches the presentation until `await context.sync()`.
|
|
53
|
+
- A host batch of independent writes is atomic. A `sync()` can split into several host batches for dependent reads; a later refusal keeps writes that already committed.
|
|
54
|
+
- Every read and lookup sees the calls queued before it in the same `sync()`, for example `getItemOrNullObject` after an `add`, or `getSelectedShapes()` after `setSelectedShapes`. When a later call needs the answer of such a read to go on, for example a write to a `getItemOrNullObject` result or to the selected text, the sync splits before that read: the calls before it apply first. On a live editor, the whole sync is still one undo step. A refusal after the split keeps its own diagnostic, and its hint says that the writes before the read applied.
|
|
55
|
+
- A call with an argument that the API does not accept does not throw. The next `sync()` refuses with `InvalidArgument`, `NotImplemented`, `NotSupported`, or `ItemNotFound`, and no call of that batch applies, as in Office.js. For example, a write of `ShadeFromTitle` or a bad `addTable` option refuses at the sync. A refused call that returns an object returns one that takes more calls and queues nothing.
|
|
56
|
+
- Only three errors throw at the call: a read of a property that you did not load (`PropertyNotLoaded`), a bad `load(...)` argument, and an object or context that you use after its run. A bad `load(...)` argument includes a wrong name anywhere in a path, also below the items of a collection: `shapes.load('itmes/name')` throws `InvalidArgument` with the hint "Did you mean 'items'?". Such a call queues nothing, and the calls before it stay queued.
|
|
57
|
+
- A refused sync drops only its own calls. Proxies stay usable, as in Office.js: a retry with the same objects works while the objects exist. An object that the refused sync would have created does not exist, and refuses with `InvalidObjectPath`.
|
|
58
|
+
- An object that a call creates is usable in the same batch, for example `addTextBox(...)` followed by `box.name = ...`.
|
|
59
|
+
- A `sync()` that you call before the previous one settles takes the calls queued so far. It sends them when the previous sync settles. Syncs apply in the order you call them. A refused sync rejects alone: the syncs after it still apply. A sync that you do not await still applies before the run ends.
|
|
60
|
+
- Read a property only after its `load(...)` completed in a `sync()`. An early read throws `PropertyNotLoaded`.
|
|
61
|
+
- `load(...)` takes paths through navigation properties and collections, such as `load('shapes/items/textFrame/textRange/text')`, the property tree `load({ shapes: { items: { name: true } } })`, `expand`, and `$all`. Collections take `load('items/name')` and `load({ select, top, skip })`; `load()` and `load('items')` load every scalar property of each item. Each level of collections on a path costs one more host batch; the items of one level are read together. In a sync that writes, put such a load before the writes. An item read after the writes that fails has the diagnostic `edit.read-after-commit`: the writes applied.
|
|
62
|
+
- `getItemOrNullObject` answers an object with `isNullObject` set when there is no such item. `getItem` refuses with `ItemNotFound`.
|
|
63
|
+
- Proxies end with their run. Use `context.trackedObjects.add(...)` to keep one, and pass it to a later `runtime.run(object, callback)`.
|
|
64
|
+
- A write that follows a read in the same run is conditional on that read. If another writer changed the presentation in between, the batch refuses with `StaleDocument` and applies nothing.
|
|
65
|
+
|
|
66
|
+
## Common mistakes
|
|
67
|
+
|
|
68
|
+
These four mistakes cause most first errors.
|
|
69
|
+
|
|
70
|
+
**A read with no load.** A proxy holds no values until a `sync()` fills them. Load the properties first, then sync, then read:
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
const box = slide.shapes.getItem('2');
|
|
74
|
+
box.load('name');
|
|
75
|
+
await context.sync();
|
|
76
|
+
console.log(box.name); // A read before the sync throws PropertyNotLoaded.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**A sync inside a loop.** Each `sync()` is one round trip and, on a live editor, one undo step. Queue the work for every item, then sync once:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
const shapes = slide.shapes.load('items/name');
|
|
83
|
+
await context.sync();
|
|
84
|
+
for (const shape of shapes.items) shape.name = shape.name.trim();
|
|
85
|
+
await context.sync(); // One sync for all the writes.
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**A retry after a refusal.** A refused host batch drops its own calls. If the sync split or reports `edit.read-after-commit`, earlier writes remain applied. Objects that you looked up before it still work, so queue the corrected calls again and sync. An object that the refused sync would have created was never created: create it again.
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
// Import isPptxEditorError from @pptx-editor.dev/editor-api.
|
|
92
|
+
// box and context belong to the active run.
|
|
93
|
+
try {
|
|
94
|
+
box.fill.setSolidColor('notacolor');
|
|
95
|
+
await context.sync();
|
|
96
|
+
} catch (error) {
|
|
97
|
+
if (!isPptxEditorError(error) || error.code !== 'InvalidArgument') throw error;
|
|
98
|
+
box.fill.setSolidColor('#1F4E79'); // The same proxy works in the retry.
|
|
99
|
+
await context.sync();
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Bindings in a saved file.** A binding lives in memory, for the lifetime of the runtime. It is not saved, so a presentation that you open again has no bindings. Add them again after you open it. A binding whose shape is deleted stays listed, and `getShape()` refuses with `ItemNotFound`.
|
|
104
|
+
|
|
105
|
+
## Errors
|
|
106
|
+
|
|
107
|
+
Every refusal is a `PptxEditorError`. Test for one with `isPptxEditorError(error)`, and branch on `error.code`:
|
|
108
|
+
|
|
109
|
+
| Code | Cause |
|
|
110
|
+
| --- | --- |
|
|
111
|
+
| `PropertyNotLoaded`, `ValueNotLoaded` | A read before the `sync()` that fills it |
|
|
112
|
+
| `InvalidArgument` | An argument or load option the API does not accept |
|
|
113
|
+
| `ItemNotFound` | No such item in the collection |
|
|
114
|
+
| `NotSupported` | The call is outside the subset for this host or content, for example a selection on a server |
|
|
115
|
+
| `NotImplemented` | The member is in the Office.js shape but this package does not implement it |
|
|
116
|
+
| `StaleDocument` | Another writer changed the presentation after this context read it |
|
|
117
|
+
| `InvalidObjectPath`, `ObjectInUse`, `InvalidRequestContext`, `RuntimeDisposed` | A proxy or context used outside its lifetime |
|
|
118
|
+
| `ResourceLimitExceeded`, `DocumentUnavailable`, `GeneralException` | The presentation or the host refused the request |
|
|
119
|
+
|
|
120
|
+
`error.debugInfo.innerError` gives a fixed engine diagnostic, for example `host.no-selection` or `edit.read-only`. Messages never contain presentation content.
|
|
121
|
+
|
|
122
|
+
## Office.js compatibility
|
|
123
|
+
|
|
124
|
+
`compat/` measures the public surface against a pinned `@types/office-js` release. The report counts every editing method and property write of the selected subset, and compares their exact signatures. Run it from the repository root:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
bun run --filter '@pptx-editor.dev/editor-api' compat:report
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
A signature match does not prove the same runtime behavior. `compat/runtime-notes.json` records each known difference, for example a member that refuses with `NotImplemented`. `compat/README.md` describes the files and the update process.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
Copyright (c) 2026 Eigenpal, Inc. All rights reserved.
|
|
3
|
+
Licensed under the EigenPal Pro Evaluation License 1.0. See LICENSE.md in this package.
|
|
4
|
+
Production use requires a commercial agreement: licensing@eigenpal.com
|
|
5
|
+
*/
|
|
6
|
+
import { PptxEditorInstance } from '@pptx-editor.dev/core/editor';
|
|
7
|
+
import { P as PptxEditorRuntime, C as CreateServerOptions, a as PptxEditorServerRuntime } from './server-BVGx60kW.js';
|
|
8
|
+
export { A as AddSlideOptions, b as Adjustments, c as Application, B as Binding, d as BindingCollection, e as BindingType, f as Border, g as BorderProperties, h as Borders, i as BulletFormat, j as BulletStyle, k as BulletType, l as ClientObject, m as ClientRequestContext, n as ClientResult, o as ConnectorType, p as CustomProperty, q as CustomPropertyCollection, r as CustomXmlPart, s as CustomXmlPartCollection, t as CustomXmlPartScopedCollection, D as DocumentProperties, u as DocumentPropertyType, F as FillProperties, v as FontProperties, G as GeometricShapeType, H as Hyperlink, w as HyperlinkAddOptions, x as HyperlinkCollection, y as HyperlinkScopedCollection, z as HyperlinkType, I as InsertSlideFormatting, E as InsertSlideOptions, L as LoadOption, J as LoadPropertyOptions, K as LoadQueryOptions, M as Margins, N as PageSetup, O as ParagraphFormat, Q as ParagraphHorizontalAlignment, R as PlaceholderFormat, S as PlaceholderType, T as PptxEditorDebugInfo, U as PptxEditorError, V as PptxEditorErrorCode, W as PptxEditorErrorInit, X as PptxEditorInnerError, Y as Presentation, Z as PresentationCapabilities, _ as RequestContext, $ as RequestContextDebugInfo, a0 as RunCallback, a1 as Shape, a2 as ShapeAddOptions, a3 as ShapeAutoSize, a4 as ShapeCollection, a5 as ShapeFill, a6 as ShapeFillType, a7 as ShapeFont, a8 as ShapeFontUnderlineStyle, a9 as ShapeGetImageFormatType, aa as ShapeGetImageOptions, ab as ShapeGroup, ac as ShapeLineDashStyle, ad as ShapeLineFormat, ae as ShapeLineStyle, af as ShapeScopedCollection, ag as ShapeType, ah as ShapeZOrder, ai as Slide, aj as SlideBackground, ak as SlideBackgroundFill, al as SlideBackgroundFillType, am as SlideBackgroundGradientFill, an as SlideBackgroundGradientFillOptions, ao as SlideBackgroundGradientFillType, ap as SlideBackgroundPatternFill, aq as SlideBackgroundPatternFillOptions, ar as SlideBackgroundPatternFillType, as as SlideBackgroundPictureOrTextureFill, at as SlideBackgroundPictureOrTextureFillOptions, au as SlideBackgroundSolidFill, av as SlideBackgroundSolidFillOptions, aw as SlideCollection, ax as SlideGetImageOptions, ay as SlideLayout, az as SlideLayoutBackground, aA as SlideLayoutCollection, aB as SlideLayoutType, aC as SlideMaster, aD as SlideMasterBackground, aE as SlideMasterCollection, aF as SlideScopedCollection, aG as Table, aH as TableAddOptions, aI as TableCell, aJ as TableCellBorders, aK as TableCellCollection, aL as TableCellMargins, aM as TableCellProperties, aN as TableClearOptions, aO as TableColumn, aP as TableColumnCollection, aQ as TableColumnProperties, aR as TableMergedAreaProperties, aS as TableRow, aT as TableRowCollection, aU as TableRowProperties, aV as TableStyle, aW as TableStyleSettings, aX as Tag, aY as TagCollection, aZ as TextFrame, a_ as TextRange, a$ as TextRun, b0 as TextVerticalAlignment, b1 as ThemeColor, b2 as ThemeColorScheme, b3 as TrackedObjects, b4 as isPptxEditorError } from './server-BVGx60kW.js';
|
|
9
|
+
import '@pptx-editor.dev/core/automation';
|
|
10
|
+
import '@pptx-editor.dev/core/layout';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Presentation automation over an editor a reader already has open, plus everything the root
|
|
14
|
+
* entry offers.
|
|
15
|
+
*
|
|
16
|
+
* `createBrowser` lives one subpath along because reaching a live editor means reaching the
|
|
17
|
+
* painted engine; a consumer that holds bytes does not pay for that.
|
|
18
|
+
*
|
|
19
|
+
* @example Format the reader's selected text
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { PptxEditor } from '@pptx-editor.dev/editor-api/browser';
|
|
22
|
+
*
|
|
23
|
+
* const runtime = PptxEditor.createBrowser(editor);
|
|
24
|
+
* await runtime.run(async (context) => {
|
|
25
|
+
* const range = context.presentation.getSelectedTextRangeOrNullObject();
|
|
26
|
+
* range.load('text');
|
|
27
|
+
* await context.sync();
|
|
28
|
+
* if (!range.isNullObject) range.font.color = '#C00000';
|
|
29
|
+
* await context.sync();
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @packageDocumentation
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The entry point with `createBrowser`.
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
interface PptxEditorBrowserNamespace {
|
|
42
|
+
/**
|
|
43
|
+
* A runtime over an editor that is already open. The editor keeps its own lifetime: dispose
|
|
44
|
+
* the runtime before the editor. Each `sync()` that writes is one undo step.
|
|
45
|
+
*/
|
|
46
|
+
createBrowser(editor: PptxEditorInstance): PptxEditorRuntime;
|
|
47
|
+
/** A runtime over PPTX bytes. It also offers `save()`. */
|
|
48
|
+
createServer(bytes: Uint8Array, options?: CreateServerOptions): Promise<PptxEditorServerRuntime>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The entry point: borrow a live editor, or open bytes.
|
|
52
|
+
*
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
55
|
+
declare const PptxEditor: PptxEditorBrowserNamespace;
|
|
56
|
+
|
|
57
|
+
export { CreateServerOptions, PptxEditor, PptxEditorRuntime, PptxEditorServerRuntime };
|
|
58
|
+
export type { PptxEditorBrowserNamespace };
|
package/dist/browser.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
Copyright (c) 2026 Eigenpal, Inc. All rights reserved.
|
|
3
|
+
Licensed under the EigenPal Pro Evaluation License 1.0. See LICENSE.md in this package.
|
|
4
|
+
Production use requires a commercial agreement: licensing@eigenpal.com
|
|
5
|
+
*/
|
|
6
|
+
import{$ as it,A as l,Aa as lt,B as z,Ba as zt,C as H,Ca as Ht,D as U,Da as Ut,E as g,Ea as gt,F as k,Fa as kt,G as q,Ga as qt,H as D,Ha as t,I as F,Ia as e,J as G,K as J,L as K,M as L,N as M,O as Q,P as T,Q as V,R as W,S as X,T as Y,U as Z,V as _,W as $,X as tt,Y as et,Z as rt,_ as ot,a as p,aa as pt,b as n,ba as nt,c as m,ca as mt,d as s,da as st,e as a,ea as at,f as c,fa as ct,g as x,ga as xt,h as d,ha as dt,i as P,ia as Pt,j as E,ja as Et,k as u,ka as ut,l as f,la as ft,m as v,ma as vt,n as y,na as yt,o as R,oa as Rt,p as w,pa as wt,q as B,qa as Bt,r as S,ra as St,s as I,sa as It,t as O,ta as Ot,u as b,ua as bt,v as A,va as At,w as C,wa as Ct,x as N,xa as Nt,y as h,ya as ht,z as j,za as jt}from"./chunk-K2KXZPMF.js";import{createBrowserAutomationHost as i}from"@pptx-editor.dev/core/editor";function r(o){return t({host:i(o),save:!1})}var Lt=Object.freeze({createBrowser:r,createServer:e});export{U as Adjustments,s as Application,ht as Binding,jt as BindingCollection,x as BindingType,Pt as Border,Et as Borders,K as BulletFormat,b as BulletStyle,O as BulletType,m as ClientObject,a as ClientResult,d as ConnectorType,lt as CustomProperty,zt as CustomPropertyCollection,tt as CustomXmlPart,et as CustomXmlPartCollection,rt as CustomXmlPartScopedCollection,Ut as DocumentProperties,H as DocumentPropertyType,q as GeometricShapeType,L as Hyperlink,M as HyperlinkCollection,Q as HyperlinkScopedCollection,P as HyperlinkType,l as InsertSlideFormatting,ut as Margins,gt as PageSetup,J as ParagraphFormat,w as ParagraphHorizontalAlignment,Nt as PlaceholderFormat,S as PlaceholderType,Lt as PptxEditor,p as PptxEditorError,Ht as Presentation,qt as RequestContext,Ot as Shape,y as ShapeAutoSize,bt as ShapeCollection,g as ShapeFill,u as ShapeFillType,G as ShapeFont,B as ShapeFontUnderlineStyle,z as ShapeGetImageFormatType,Ct as ShapeGroup,f as ShapeLineDashStyle,k as ShapeLineFormat,v as ShapeLineStyle,At as ShapeScopedCollection,c as ShapeType,E as ShapeZOrder,nt as Slide,Z as SlideBackground,Y as SlideBackgroundFill,A as SlideBackgroundFillType,V as SlideBackgroundGradientFill,C as SlideBackgroundGradientFillType,W as SlideBackgroundPatternFill,N as SlideBackgroundPatternFillType,X as SlideBackgroundPictureOrTextureFill,T as SlideBackgroundSolidFill,mt as SlideCollection,at as SlideLayout,_ as SlideLayoutBackground,ct as SlideLayoutCollection,I as SlideLayoutType,xt as SlideMaster,$ as SlideMasterBackground,dt as SlideMasterCollection,st as SlideScopedCollection,yt as Table,vt as TableCell,It as TableCellCollection,wt as TableColumn,St as TableColumnCollection,Rt as TableRow,Bt as TableRowCollection,j as TableStyle,ft as TableStyleSettings,ot as Tag,it as TagCollection,D as TextFrame,F as TextRange,R as TextVerticalAlignment,h as ThemeColor,pt as ThemeColorScheme,kt as TrackedObjects,n as isPptxEditorError};
|