@paged-media/plugin-sdk 0.2.28-canary.0 → 0.2.30-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.js +26 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -827,7 +827,7 @@ function createBundleHost(getEditor, manifest, options) {
|
|
|
827
827
|
return;
|
|
828
828
|
}
|
|
829
829
|
submitted.add(elementId);
|
|
830
|
-
await ch.submit(elementId, layer);
|
|
830
|
+
await ch.submit(elementId, layer, manifest.id);
|
|
831
831
|
},
|
|
832
832
|
async clear(elementId) {
|
|
833
833
|
submitted.delete(elementId);
|
|
@@ -1597,7 +1597,31 @@ function createBundleHost(getEditor, manifest, options) {
|
|
|
1597
1597
|
async write(path, bytes) {
|
|
1598
1598
|
const reply = await getEditor().client.send({
|
|
1599
1599
|
kind: "writePagedPart",
|
|
1600
|
-
payload: {
|
|
1600
|
+
payload: {
|
|
1601
|
+
path: partsFull(path),
|
|
1602
|
+
bytes: Array.from(bytes),
|
|
1603
|
+
// C-34 — DECLARE WHO IS WRITING, so the engine
|
|
1604
|
+
// confines this to `paged/<id>/` instead of trusting that we
|
|
1605
|
+
// built the path correctly. `partsFull` already scopes it;
|
|
1606
|
+
// that is a convention held in THIS file, and a convention is
|
|
1607
|
+
// not a boundary — a bundle reaching the raw handle bypasses
|
|
1608
|
+
// it entirely. Saying the caller moves the check to the one
|
|
1609
|
+
// place that cannot be routed around.
|
|
1610
|
+
//
|
|
1611
|
+
// Safe against an older worker: the wire has no
|
|
1612
|
+
// `deny_unknown_fields`, so an engine without the gate
|
|
1613
|
+
// ignores this and behaves exactly as before. No `supports()`
|
|
1614
|
+
// probe needed — there is no degraded path to choose between.
|
|
1615
|
+
caller: manifest.id
|
|
1616
|
+
}
|
|
1617
|
+
// THE CAST, named rather than left to be discovered. `wire.d.ts`
|
|
1618
|
+
// is vendored from the PUBLISHED `@paged-media/canvas-wasm`
|
|
1619
|
+
// (0.61.0), whose `writePagedPart` has no `caller` — the field
|
|
1620
|
+
// exists in core today and reaches these types only when the
|
|
1621
|
+
// next canvas-wasm publishes and `sync-wire` runs. Same escape-hatch
|
|
1622
|
+
// shape the repo already uses elsewhere: a cast pointing at a
|
|
1623
|
+
// contract that EXISTS AND IS COMMITTED, not at a hope. It
|
|
1624
|
+
// deletes itself at the repin.
|
|
1601
1625
|
});
|
|
1602
1626
|
if (reply.kind !== "pagedPartWritten") {
|
|
1603
1627
|
const err = reply.kind === "pagedPartFailed" ? reply.payload.error : `unexpected ${reply.kind}`;
|
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.30-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.30-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.
|
|
25
|
+
"@paged-media/canvas-wasm": "0.61.0",
|
|
26
26
|
"@types/node": "20.19.39",
|
|
27
27
|
"@types/react": "^18.3.12",
|
|
28
28
|
"react": "^18.3.0",
|