@paged-media/plugin-sdk 0.2.29-canary.0 → 0.2.31-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 +34 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -566,7 +566,12 @@ function createBundleHost(getEditor, manifest, options) {
|
|
|
566
566
|
"contribute.panel",
|
|
567
567
|
`contributes.panels[] must include "${c.id}"`
|
|
568
568
|
);
|
|
569
|
-
return store.add(
|
|
569
|
+
return store.add(
|
|
570
|
+
getEditor().registries.panels.register({
|
|
571
|
+
...c,
|
|
572
|
+
source: manifest.name
|
|
573
|
+
})
|
|
574
|
+
);
|
|
570
575
|
},
|
|
571
576
|
schemaPanel(c) {
|
|
572
577
|
assertNamespaced(c.id, "schemaPanel");
|
|
@@ -583,6 +588,8 @@ function createBundleHost(getEditor, manifest, options) {
|
|
|
583
588
|
defaultGroup: c.defaultGroup,
|
|
584
589
|
closable: c.closable,
|
|
585
590
|
movable: c.movable,
|
|
591
|
+
// Host-stamped provenance, same as `panel()` above.
|
|
592
|
+
source: manifest.name,
|
|
586
593
|
component: makeSchemaPanelComponent(
|
|
587
594
|
c,
|
|
588
595
|
bindings,
|
|
@@ -827,7 +834,7 @@ function createBundleHost(getEditor, manifest, options) {
|
|
|
827
834
|
return;
|
|
828
835
|
}
|
|
829
836
|
submitted.add(elementId);
|
|
830
|
-
await ch.submit(elementId, layer);
|
|
837
|
+
await ch.submit(elementId, layer, manifest.id);
|
|
831
838
|
},
|
|
832
839
|
async clear(elementId) {
|
|
833
840
|
submitted.delete(elementId);
|
|
@@ -1597,7 +1604,31 @@ function createBundleHost(getEditor, manifest, options) {
|
|
|
1597
1604
|
async write(path, bytes) {
|
|
1598
1605
|
const reply = await getEditor().client.send({
|
|
1599
1606
|
kind: "writePagedPart",
|
|
1600
|
-
payload: {
|
|
1607
|
+
payload: {
|
|
1608
|
+
path: partsFull(path),
|
|
1609
|
+
bytes: Array.from(bytes),
|
|
1610
|
+
// C-34 — DECLARE WHO IS WRITING, so the engine
|
|
1611
|
+
// confines this to `paged/<id>/` instead of trusting that we
|
|
1612
|
+
// built the path correctly. `partsFull` already scopes it;
|
|
1613
|
+
// that is a convention held in THIS file, and a convention is
|
|
1614
|
+
// not a boundary — a bundle reaching the raw handle bypasses
|
|
1615
|
+
// it entirely. Saying the caller moves the check to the one
|
|
1616
|
+
// place that cannot be routed around.
|
|
1617
|
+
//
|
|
1618
|
+
// Safe against an older worker: the wire has no
|
|
1619
|
+
// `deny_unknown_fields`, so an engine without the gate
|
|
1620
|
+
// ignores this and behaves exactly as before. No `supports()`
|
|
1621
|
+
// probe needed — there is no degraded path to choose between.
|
|
1622
|
+
caller: manifest.id
|
|
1623
|
+
}
|
|
1624
|
+
// THE CAST, named rather than left to be discovered. `wire.d.ts`
|
|
1625
|
+
// is vendored from the PUBLISHED `@paged-media/canvas-wasm`
|
|
1626
|
+
// (0.61.0), whose `writePagedPart` has no `caller` — the field
|
|
1627
|
+
// exists in core today and reaches these types only when the
|
|
1628
|
+
// next canvas-wasm publishes and `sync-wire` runs. Same escape-hatch
|
|
1629
|
+
// shape the repo already uses elsewhere: a cast pointing at a
|
|
1630
|
+
// contract that EXISTS AND IS COMMITTED, not at a hope. It
|
|
1631
|
+
// deletes itself at the repin.
|
|
1601
1632
|
});
|
|
1602
1633
|
if (reply.kind !== "pagedPartWritten") {
|
|
1603
1634
|
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.31-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.31-canary.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": "^18.3.0"
|