@paged-media/plugin-sdk 0.2.47-canary.0 → 0.2.49-canary.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 +4 -0
- package/dist/index.js +13 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1023,6 +1023,10 @@ interface HeadlessHost {
|
|
|
1023
1023
|
/** Load an IDML package into the headless document. Resolves to the
|
|
1024
1024
|
* loaded page ids (or throws on a parse failure). */
|
|
1025
1025
|
load(idml: Uint8Array): Promise<string[]>;
|
|
1026
|
+
/** Start a new blank document: one page of the given size in points,
|
|
1027
|
+
* laid out with `defaultFont` when one was given. Resolves to its page
|
|
1028
|
+
* ids, fanned out to subscribers like `load`. */
|
|
1029
|
+
newBlank(widthPt: number, heightPt: number): Promise<string[]>;
|
|
1026
1030
|
/** ADR 324 — the core EXPORT door the Node CLI (and a conformance test)
|
|
1027
1031
|
* calls: the active document as `.paged` (`exportPaged`), `.idml`
|
|
1028
1032
|
* (`exportIdml`, `linkBase` for relative links) or PDF (the
|
package/dist/index.js
CHANGED
|
@@ -73,7 +73,7 @@ function parseRange(text2) {
|
|
|
73
73
|
if (dots < 0) return null;
|
|
74
74
|
const start = uint(text2.slice(0, dots));
|
|
75
75
|
const end = uint(text2.slice(dots + 2));
|
|
76
|
-
if (start === null || end === null || end
|
|
76
|
+
if (start === null || end === null || end < start) return null;
|
|
77
77
|
return { start, end };
|
|
78
78
|
}
|
|
79
79
|
var MASTER_SCOPE = " > ";
|
|
@@ -13668,6 +13668,18 @@ async function createHeadlessHost(options = {}) {
|
|
|
13668
13668
|
}
|
|
13669
13669
|
throw loadFailure(reply);
|
|
13670
13670
|
},
|
|
13671
|
+
async newBlank(widthPt, heightPt) {
|
|
13672
|
+
const reply = await editor.client.send({
|
|
13673
|
+
kind: "newBlankDocument",
|
|
13674
|
+
payload: { widthPt, heightPt, font: options.defaultFont ? Array.from(options.defaultFont) : null }
|
|
13675
|
+
});
|
|
13676
|
+
if (reply.kind === "documentLoaded") {
|
|
13677
|
+
objects.core?.invalidate();
|
|
13678
|
+
fanOut(reply);
|
|
13679
|
+
return reply.payload.pageIds;
|
|
13680
|
+
}
|
|
13681
|
+
throw loadFailure(reply);
|
|
13682
|
+
},
|
|
13671
13683
|
async exportDocument(format, exportOptions = {}) {
|
|
13672
13684
|
const send = (kind, payload) => editor.client.send({ kind, payload });
|
|
13673
13685
|
if (format === "paged") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paged-media/plugin-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.49-canary.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@paged-media/plugin-api": "0.2.
|
|
14
|
+
"@paged-media/plugin-api": "0.2.48-canary.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": "^18.3.0"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@paged-media/canvas-wasm": "0.71.
|
|
25
|
+
"@paged-media/canvas-wasm": "0.71.2",
|
|
26
26
|
"@types/node": "20.19.39",
|
|
27
27
|
"@types/react": "^18.3.31",
|
|
28
28
|
"fast-check": "^4.10.2",
|