@paged-media/plugin-sdk 0.2.38-canary.3 → 0.2.39-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 +22 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -266,6 +266,10 @@ var HOST_FEATURES = [
|
|
|
266
266
|
// honesty split as the protocol-ahead mutations (mutations.ts): the
|
|
267
267
|
// engine-level gate is the worker handshake, not `supports()`.
|
|
268
268
|
"document.planarRegions@1",
|
|
269
|
+
// v67 (RFI C-68) — the engine's point snapper. Static like the region
|
|
270
|
+
// door: the flag says this SDK forwards `snapPoint`; an engine older
|
|
271
|
+
// than v67 answers the point unsnapped, never a throw.
|
|
272
|
+
"document.snapPoint@1",
|
|
269
273
|
// DOC-03 structured whole-story read (canvas-wasm v54). Static for the same
|
|
270
274
|
// reason as storage.parts@1: the pinned engine is the server, and the worker
|
|
271
275
|
// handshake refuses a protocol older than the pin — so a running bundle is
|
|
@@ -1296,6 +1300,24 @@ function createBundleHost(getEditor, manifest, options) {
|
|
|
1296
1300
|
return refusal(`the region read door failed: ${String(error)}`);
|
|
1297
1301
|
}
|
|
1298
1302
|
},
|
|
1303
|
+
async snapPoint(query) {
|
|
1304
|
+
requireDocRead("document.snapPoint");
|
|
1305
|
+
const unsnapped = () => ({
|
|
1306
|
+
point: [query.point[0], query.point[1]],
|
|
1307
|
+
snapped: false,
|
|
1308
|
+
lines: [],
|
|
1309
|
+
tolerancePt: 0
|
|
1310
|
+
});
|
|
1311
|
+
try {
|
|
1312
|
+
const reply = await getEditor().client.send({
|
|
1313
|
+
kind: "requestSnapPoint",
|
|
1314
|
+
payload: { query }
|
|
1315
|
+
});
|
|
1316
|
+
return reply.kind === "snapPoint" ? reply.payload.result : unsnapped();
|
|
1317
|
+
} catch {
|
|
1318
|
+
return unsnapped();
|
|
1319
|
+
}
|
|
1320
|
+
},
|
|
1299
1321
|
async tree() {
|
|
1300
1322
|
requireDocRead("document.tree");
|
|
1301
1323
|
const reply = await getEditor().client.send({
|
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.39-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.39-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.67.0",
|
|
26
26
|
"@types/node": "20.19.39",
|
|
27
27
|
"@types/react": "^18.3.31",
|
|
28
28
|
"react": "^18.3.1",
|