@paged-media/plugin-sdk 0.2.35-canary.0 → 0.2.37-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.
Files changed (2) hide show
  1. package/dist/index.js +13 -6
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -209,7 +209,12 @@ var HOST_FEATURES = [
209
209
  // `{ found: false, reason }`, never a fake empty face list. Same
210
210
  // honesty split as the protocol-ahead mutations (mutations.ts): the
211
211
  // engine-level gate is the worker handshake, not `supports()`.
212
- "document.planarRegions@1"
212
+ "document.planarRegions@1",
213
+ // DOC-03 structured whole-story read (canvas-wasm v54). Static for the same
214
+ // reason as storage.parts@1: the pinned engine is the server, and the worker
215
+ // handshake refuses a protocol older than the pin — so a running bundle is
216
+ // always talking to an engine that answers RequestStoryContent.
217
+ "document.readStory@1"
213
218
  ];
214
219
  var PluginApiNotImplemented = class extends Error {
215
220
  constructor(member, pointer) {
@@ -1159,11 +1164,13 @@ function createBundleHost(getEditor, manifest, options) {
1159
1164
  });
1160
1165
  return reply.kind === "frameChainResult" ? reply.payload.links : [];
1161
1166
  },
1162
- async storyContent(_storyId) {
1163
- throw new PluginApiNotImplemented(
1164
- "document.storyContent",
1165
- "awaiting @paged-media/canvas-wasm v54 publish + sync-wire; core op RequestStoryContent already exists"
1166
- );
1167
+ async storyContent(storyId) {
1168
+ requireDocRead("document.storyContent");
1169
+ const reply = await getEditor().client.send({
1170
+ kind: "requestStoryContent",
1171
+ payload: { storyId }
1172
+ });
1173
+ return reply.kind === "storyContentResult" ? reply.payload.content ?? null : null;
1167
1174
  },
1168
1175
  onDidChange(listener) {
1169
1176
  requireDocRead("document.onDidChange");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paged-media/plugin-sdk",
3
- "version": "0.2.35-canary.0",
3
+ "version": "0.2.37-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.36-canary.0"
14
+ "@paged-media/plugin-api": "0.2.37-canary.0"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "react": "^18.3.0"
@@ -22,12 +22,12 @@
22
22
  }
23
23
  },
24
24
  "devDependencies": {
25
- "@paged-media/canvas-wasm": "0.63.0",
25
+ "@paged-media/canvas-wasm": "0.64.0",
26
26
  "@types/node": "20.19.39",
27
- "@types/react": "^18.3.12",
28
- "react": "^18.3.0",
29
- "typescript": "^5.6.3",
30
- "vitest": "^2.1.8"
27
+ "@types/react": "^18.3.31",
28
+ "react": "^18.3.1",
29
+ "typescript": "^5.9.3",
30
+ "vitest": "^2.1.9"
31
31
  },
32
32
  "description": "The Paged plugin runtime: loadBundle, the in-process BundleHost adapter, the gesture kit, and version negotiation.",
33
33
  "license": "MPL-2.0 OR LicenseRef-PMEL",