@paged-media/plugin-sdk 0.2.1-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.
@@ -0,0 +1,108 @@
1
+ import { PagedBundle, BundleHost, Disposable, ShellSurface, PagedEditor, PluginManifest, CanvasPointerEvent, Mutation, MutationOutcome, ToolContribution, PanelContribution } from '@paged-media/plugin-api';
2
+
3
+ /**
4
+ * Identity helper that pins a bundle to the `PagedBundle` contract
5
+ * with full inference — the `defineConfig` idiom. Exists so bundle
6
+ * authors get contract errors at the definition site, not at the
7
+ * host's load site.
8
+ */
9
+ declare function defineBundle(bundle: PagedBundle): PagedBundle;
10
+
11
+ interface HarnessOptions {
12
+ /** IDML bytes to load into the headless document. */
13
+ idml?: Uint8Array;
14
+ }
15
+ /** Not implemented in API v0 — see module comment. */
16
+ declare function createHeadlessHost(_options?: HarnessOptions): BundleHost;
17
+
18
+ declare class DisposableStore implements Disposable {
19
+ private items;
20
+ private disposed;
21
+ get isDisposed(): boolean;
22
+ /** Track `d`; returns it for chaining. */
23
+ add<T extends Disposable>(d: T): T;
24
+ dispose(): void;
25
+ }
26
+ /** Wrap a plain cleanup function as a Disposable. */
27
+ declare function toDisposable(fn: () => void): Disposable;
28
+
29
+ /** The plugin API version this SDK implements. */
30
+ declare const API_VERSION = "0.2.0";
31
+ /**
32
+ * Does `version` satisfy `range`? Supported forms:
33
+ * `*` — anything
34
+ * `1.2.3` / `1.2`— exact (missing patch = 0)
35
+ * `^1.2.3` — npm caret: same major, >= base (major > 0);
36
+ * same major+minor, >= patch (major == 0 — the 0.x
37
+ * rule: minors are breaking during incubation)
38
+ */
39
+ declare function satisfiesApiVersion(range: string, version?: string): boolean;
40
+
41
+ /** The implemented feature set — `host.supports()` answers from this,
42
+ * so docs/tests can't drift from code. Form: `"area.member@major"`. */
43
+ declare const HOST_FEATURES: readonly string[];
44
+ /** Thrown by reserved surface members — a visible seam, never
45
+ * fake-interactive. */
46
+ declare class PluginApiNotImplemented extends Error {
47
+ constructor(member: string, pointer: string);
48
+ }
49
+ /** Minimal storage backing so tests / headless hosts can inject one;
50
+ * defaults to localStorage when present, else an in-memory Map. */
51
+ interface StorageBacking {
52
+ getItem(key: string): string | null;
53
+ setItem(key: string, value: string): void;
54
+ removeItem(key: string): void;
55
+ /** All keys currently in the backing (unfiltered). */
56
+ keys(): string[];
57
+ }
58
+ interface CreateBundleHostOptions {
59
+ storage?: StorageBacking;
60
+ /** Console sink override (tests). */
61
+ console?: Pick<Console, "debug" | "info" | "warn" | "error">;
62
+ /** Shell actions the HOST APP owns (the cockpit's panel placement).
63
+ * When absent, `host.shell` warns and no-ops, and
64
+ * `supports("shell.openPanel@1")` answers false. */
65
+ shell?: ShellSurface;
66
+ }
67
+ interface BundleHostHandle {
68
+ host: BundleHost;
69
+ /** Tears down every registration made through the host's facades. */
70
+ dispose(): void;
71
+ }
72
+ declare function createBundleHost(getEditor: () => PagedEditor, manifest: PluginManifest, options?: CreateBundleHostOptions): BundleHostHandle;
73
+
74
+ interface LoadedBundle {
75
+ readonly id: string;
76
+ readonly active: boolean;
77
+ dispose(): void;
78
+ }
79
+ declare function loadBundle(getEditor: () => PagedEditor, bundle: PagedBundle, options?: CreateBundleHostOptions): LoadedBundle;
80
+
81
+ declare const CLICK_DRAG_THRESHOLD_PX = 4;
82
+ /** A drag anchored to the page under the pointer at pointer-down. */
83
+ interface PageDrag {
84
+ pageId: string;
85
+ /** Page origin in document pt (docPoint − pagePoint at down). */
86
+ pageOrigin: [number, number];
87
+ /** Pointer-down position in page-local pt. */
88
+ startLocal: [number, number];
89
+ }
90
+ declare function beginPageDrag(e: CanvasPointerEvent): PageDrag | null;
91
+ /** Current pointer position in the START page's local coordinates. */
92
+ declare function endLocalFor(drag: PageDrag, e: CanvasPointerEvent): [number, number];
93
+ /** Screen px → document pt at `scale`, the constant-screen-tolerance
94
+ * idiom. Falls back to 1:1 when the camera hasn't initialised. */
95
+ declare function pxToPt(scale: number, px: number): number;
96
+ /**
97
+ * Fire a mutation and select the element the engine reports as
98
+ * created, so a fresh shape immediately carries selection chrome —
99
+ * the post-insert flow every drawing tool wants. Failures resolve
100
+ * (never throw); the outcome is returned for optional handling.
101
+ */
102
+ declare function commitAndSelect(paged: PagedEditor, mutation: Mutation, label: string): Promise<MutationOutcome>;
103
+
104
+ declare function contributeTool(host: BundleHost, tool: ToolContribution): Disposable;
105
+
106
+ declare function contributePanel(host: BundleHost, panel: PanelContribution): Disposable;
107
+
108
+ export { API_VERSION, type BundleHostHandle, CLICK_DRAG_THRESHOLD_PX, type CreateBundleHostOptions, DisposableStore, HOST_FEATURES, type HarnessOptions, type LoadedBundle, type PageDrag, PluginApiNotImplemented, type StorageBacking, beginPageDrag, commitAndSelect, contributePanel, contributeTool, createBundleHost, createHeadlessHost, defineBundle, endLocalFor, loadBundle, pxToPt, satisfiesApiVersion, toDisposable };
package/dist/index.js ADDED
@@ -0,0 +1,539 @@
1
+ // src/define-bundle.ts
2
+ function defineBundle(bundle) {
3
+ return bundle;
4
+ }
5
+
6
+ // src/harness.ts
7
+ function createHeadlessHost(_options) {
8
+ throw new Error(
9
+ "@paged-media/plugin-sdk: the headless harness is not implemented yet (tracked in plugin-draw/BREAKAGE_LOG.md). Run bundles inside the editor app, or unit-test their machines (pure, host-free) instead."
10
+ );
11
+ }
12
+
13
+ // src/disposables.ts
14
+ var DisposableStore = class {
15
+ items = [];
16
+ disposed = false;
17
+ get isDisposed() {
18
+ return this.disposed;
19
+ }
20
+ /** Track `d`; returns it for chaining. */
21
+ add(d) {
22
+ if (this.disposed) {
23
+ d.dispose();
24
+ return d;
25
+ }
26
+ this.items.push(d);
27
+ return d;
28
+ }
29
+ dispose() {
30
+ if (this.disposed) return;
31
+ this.disposed = true;
32
+ for (let i = this.items.length - 1; i >= 0; i--) {
33
+ try {
34
+ this.items[i].dispose();
35
+ } catch {
36
+ }
37
+ }
38
+ this.items = [];
39
+ }
40
+ };
41
+ function toDisposable(fn) {
42
+ let done = false;
43
+ return {
44
+ dispose() {
45
+ if (done) return;
46
+ done = true;
47
+ fn();
48
+ }
49
+ };
50
+ }
51
+
52
+ // src/version.ts
53
+ var API_VERSION = "0.2.0";
54
+ function parse(v) {
55
+ const m = /^(\d+)\.(\d+)(?:\.(\d+))?$/.exec(v.trim());
56
+ if (!m) return null;
57
+ return [Number(m[1]), Number(m[2]), Number(m[3] ?? "0")];
58
+ }
59
+ function satisfiesApiVersion(range, version = API_VERSION) {
60
+ const r = range.trim();
61
+ if (r === "*") return true;
62
+ const v = parse(version);
63
+ if (!v) return false;
64
+ if (r.startsWith("^")) {
65
+ const base = parse(r.slice(1));
66
+ if (!base) return false;
67
+ if (base[0] > 0) {
68
+ if (v[0] !== base[0]) return false;
69
+ if (v[1] !== base[1]) return v[1] > base[1];
70
+ return v[2] >= base[2];
71
+ }
72
+ return v[0] === 0 && v[1] === base[1] && v[2] >= base[2];
73
+ }
74
+ const exact = parse(r);
75
+ if (!exact) return false;
76
+ return v[0] === exact[0] && v[1] === exact[1] && v[2] === exact[2];
77
+ }
78
+
79
+ // src/host-impl.ts
80
+ var HOST_FEATURES = [
81
+ "contribute.tool@1",
82
+ "contribute.panel@1",
83
+ "contribute.command@1",
84
+ "contribute.keybinding@1",
85
+ "contribute.overlay@1",
86
+ "document.mutate@1",
87
+ "document.undo@1",
88
+ "document.collection@1",
89
+ "document.meta@1",
90
+ "document.pathAnchors@1",
91
+ "document.hitTest@1",
92
+ "document.elementGeometry@1",
93
+ "document.tree@1",
94
+ "document.onDidChange@1",
95
+ "selection@1",
96
+ "viewport@1",
97
+ "overlay.toolPreview@1",
98
+ "storage@1",
99
+ "diagnostics@1"
100
+ ];
101
+ var PluginApiNotImplemented = class extends Error {
102
+ constructor(member, pointer) {
103
+ super(
104
+ `plugin-api: ${member} is reserved and not implemented in v0 (${pointer})`
105
+ );
106
+ this.name = "PluginApiNotImplemented";
107
+ }
108
+ };
109
+ function defaultStorageBacking() {
110
+ const ls = globalThis.localStorage;
111
+ if (ls) {
112
+ return {
113
+ getItem: (k) => ls.getItem(k),
114
+ setItem: (k, v) => ls.setItem(k, v),
115
+ removeItem: (k) => ls.removeItem(k),
116
+ keys: () => {
117
+ const out = [];
118
+ for (let i = 0; i < ls.length; i++) {
119
+ const k = ls.key(i);
120
+ if (k !== null) out.push(k);
121
+ }
122
+ return out;
123
+ }
124
+ };
125
+ }
126
+ const map = /* @__PURE__ */ new Map();
127
+ return {
128
+ getItem: (k) => map.get(k) ?? null,
129
+ setItem: (k, v) => void map.set(k, v),
130
+ removeItem: (k) => void map.delete(k),
131
+ keys: () => Array.from(map.keys())
132
+ };
133
+ }
134
+ function createBundleHost(getEditor, manifest, options) {
135
+ const store = new DisposableStore();
136
+ const sink = options?.console ?? console;
137
+ const ns = `${manifest.id}.`;
138
+ const tag = `[${manifest.id}]`;
139
+ const assertNamespaced = (id, kind) => {
140
+ if (!id.startsWith(ns)) {
141
+ throw new Error(
142
+ `plugin-api: ${kind} id "${id}" must be namespaced under "${ns}" (the manifest id) \u2014 the namespace rule is where capability enforcement attaches`
143
+ );
144
+ }
145
+ };
146
+ const log = {
147
+ debug: (m, ...a) => sink.debug(`${tag} ${m}`, ...a),
148
+ info: (m, ...a) => sink.info(`${tag} ${m}`, ...a),
149
+ warn: (m, ...a) => sink.warn(`${tag} ${m}`, ...a),
150
+ error: (m, ...a) => sink.error(`${tag} ${m}`, ...a)
151
+ };
152
+ const contribute = {
153
+ tool(c) {
154
+ assertNamespaced(c.id, "tool");
155
+ return store.add(getEditor().registries.tools.register(c));
156
+ },
157
+ panel(c) {
158
+ assertNamespaced(c.id, "panel");
159
+ return store.add(getEditor().registries.panels.register(c));
160
+ },
161
+ command(c) {
162
+ assertNamespaced(c.id, "command");
163
+ return store.add(getEditor().registries.commands.register(c));
164
+ },
165
+ keybinding(c) {
166
+ return store.add(getEditor().registries.keybindings.register(c));
167
+ },
168
+ overlay(c) {
169
+ assertNamespaced(c.id, "overlay");
170
+ return store.add(getEditor().registries.overlays.register(c));
171
+ },
172
+ editContext() {
173
+ throw new PluginApiNotImplemented(
174
+ "contribute.editContext",
175
+ "P0 shell work \u2014 plugin-draw/BREAKAGE_LOG.md B-02"
176
+ );
177
+ },
178
+ objectType() {
179
+ throw new PluginApiNotImplemented(
180
+ "contribute.objectType",
181
+ "paged.web W1 \u2014 base-idea \xA79.1.2"
182
+ );
183
+ }
184
+ };
185
+ const document = {
186
+ async mutate(mutation) {
187
+ try {
188
+ const reply = await getEditor().client.mutate(mutation);
189
+ if (reply.kind === "mutationApplied") {
190
+ return {
191
+ applied: true,
192
+ createdId: reply.payload.createdId ?? null,
193
+ pageIds: reply.payload.pageIds
194
+ };
195
+ }
196
+ return {
197
+ applied: false,
198
+ error: reply.kind === "mutationFailed" ? reply.payload : reply
199
+ };
200
+ } catch (error) {
201
+ return { applied: false, error };
202
+ }
203
+ },
204
+ async undo() {
205
+ await getEditor().client.undo();
206
+ },
207
+ async redo() {
208
+ await getEditor().client.redo();
209
+ },
210
+ collection(name) {
211
+ return getEditor().client.collection(name);
212
+ },
213
+ meta() {
214
+ return getEditor().client.documentMeta();
215
+ },
216
+ pathAnchors(id) {
217
+ return getEditor().client.pathAnchors(id).catch(() => null);
218
+ },
219
+ async hitTest(pageId, point, filter = "any") {
220
+ try {
221
+ const reply = await getEditor().client.send({
222
+ kind: "hitTest",
223
+ payload: { pageId, docPoint: point, filter }
224
+ });
225
+ return reply.kind === "hitResult" ? reply.payload : null;
226
+ } catch {
227
+ return null;
228
+ }
229
+ },
230
+ elementGeometry(ids) {
231
+ return getEditor().client.elementGeometry(ids);
232
+ },
233
+ async tree() {
234
+ const reply = await getEditor().client.send({
235
+ kind: "requestSceneTree"
236
+ });
237
+ return reply.kind === "sceneTree" ? reply.payload.roots : [];
238
+ },
239
+ onDidChange(listener) {
240
+ const off = getEditor().client.subscribe((msg) => {
241
+ if (msg.kind === "mutationApplied" || msg.kind === "undoApplied" || msg.kind === "redoApplied") {
242
+ listener({ kind: msg.kind, pageIds: msg.payload.pageIds });
243
+ }
244
+ });
245
+ return store.add(toDisposable(off));
246
+ }
247
+ };
248
+ const selection = {
249
+ get() {
250
+ return getEditor().selection.elementSelection;
251
+ },
252
+ async set(ids, mode = "replace") {
253
+ const editor = getEditor();
254
+ const applied = await editor.client.setElementSelection(ids, mode);
255
+ editor.selection.setElementSelection(applied);
256
+ return applied;
257
+ },
258
+ onDidChange(listener) {
259
+ const off = getEditor().client.subscribe((msg) => {
260
+ if (msg.kind === "elementSelectionApplied") {
261
+ listener(msg.payload.ids);
262
+ }
263
+ });
264
+ return store.add(toDisposable(off));
265
+ }
266
+ };
267
+ const viewport = {
268
+ camera() {
269
+ const cam = getEditor().camera.camera;
270
+ return { scale: cam.scale, tx: cam.tx, ty: cam.ty };
271
+ },
272
+ pxToPt(px) {
273
+ const scale = getEditor().camera.camera.scale;
274
+ return px / (scale > 0 ? scale : 1);
275
+ }
276
+ };
277
+ const overlay = {
278
+ setToolPreview(shape) {
279
+ getEditor().overlaySignals.setToolPreview(shape);
280
+ }
281
+ };
282
+ const backing = options?.storage ?? defaultStorageBacking();
283
+ const prefix = `paged.plugin.${manifest.id}.`;
284
+ const storage = {
285
+ get(key) {
286
+ const raw = backing.getItem(prefix + key);
287
+ if (raw === null) return void 0;
288
+ try {
289
+ return JSON.parse(raw);
290
+ } catch {
291
+ return void 0;
292
+ }
293
+ },
294
+ set(key, value) {
295
+ backing.setItem(prefix + key, JSON.stringify(value));
296
+ },
297
+ delete(key) {
298
+ backing.removeItem(prefix + key);
299
+ },
300
+ keys() {
301
+ return backing.keys().filter((k) => k.startsWith(prefix)).map((k) => k.slice(prefix.length));
302
+ }
303
+ };
304
+ const diagnosticStore = /* @__PURE__ */ new Map();
305
+ const diagnosticListeners = /* @__PURE__ */ new Set();
306
+ const emitDiagnostics = (key) => {
307
+ for (const l of diagnosticListeners) l(key);
308
+ };
309
+ const diagnostics = {
310
+ set(key, items) {
311
+ diagnosticStore.set(key, items);
312
+ for (const d of items) {
313
+ const line = `${tag} ${key}: ${d.message}` + (d.line !== void 0 ? ` (${d.source ?? ""}:${d.line})` : "");
314
+ if (d.severity === "error") sink.error(line);
315
+ else if (d.severity === "warning") sink.warn(line);
316
+ else sink.info(line);
317
+ }
318
+ emitDiagnostics(key);
319
+ },
320
+ clear(key) {
321
+ if (key !== void 0) diagnosticStore.delete(key);
322
+ else diagnosticStore.clear();
323
+ emitDiagnostics(key ?? "");
324
+ },
325
+ get(key) {
326
+ return diagnosticStore.get(key) ?? [];
327
+ },
328
+ onDidChange(listener) {
329
+ diagnosticListeners.add(listener);
330
+ return store.add(toDisposable(() => diagnosticListeners.delete(listener)));
331
+ }
332
+ };
333
+ const shell = options?.shell ?? {
334
+ openPanel(panelId) {
335
+ log.warn(
336
+ `shell.openPanel("${panelId}") ignored \u2014 the host app provided no shell actions (probe with supports("shell.openPanel@1"))`
337
+ );
338
+ },
339
+ closePanel() {
340
+ }
341
+ };
342
+ const featureSet = new Set(HOST_FEATURES);
343
+ if (options?.shell) {
344
+ featureSet.add("shell.openPanel@1");
345
+ }
346
+ const host = {
347
+ manifest,
348
+ log,
349
+ contribute,
350
+ document,
351
+ selection,
352
+ viewport,
353
+ overlay,
354
+ shell,
355
+ storage,
356
+ diagnostics,
357
+ supports: (feature) => featureSet.has(feature),
358
+ get editor() {
359
+ return getEditor();
360
+ }
361
+ };
362
+ return {
363
+ host,
364
+ dispose() {
365
+ store.dispose();
366
+ }
367
+ };
368
+ }
369
+
370
+ // src/load.ts
371
+ var ID_PATTERN = /^[a-z][a-z0-9]*(\.[a-z][a-z0-9-]*)+$/;
372
+ function loadBundle(getEditor, bundle, options) {
373
+ const { manifest } = bundle;
374
+ if (!ID_PATTERN.test(manifest.id)) {
375
+ throw new Error(
376
+ `loadBundle: manifest id "${manifest.id}" is not reverse-DNS (expected e.g. "media.paged.draw")`
377
+ );
378
+ }
379
+ if (!satisfiesApiVersion(manifest.apiVersion)) {
380
+ throw new Error(
381
+ `loadBundle: ${manifest.id}@${manifest.version} requires plugin-api "${manifest.apiVersion}", host implements ${API_VERSION}`
382
+ );
383
+ }
384
+ const { host, dispose: disposeHost } = createBundleHost(
385
+ getEditor,
386
+ manifest,
387
+ options
388
+ );
389
+ const handle = bundle.activate(host);
390
+ let active = true;
391
+ return {
392
+ id: manifest.id,
393
+ get active() {
394
+ return active;
395
+ },
396
+ dispose() {
397
+ if (!active) return;
398
+ active = false;
399
+ try {
400
+ handle.dispose();
401
+ } finally {
402
+ disposeHost();
403
+ }
404
+ }
405
+ };
406
+ }
407
+
408
+ // src/gestures.ts
409
+ var CLICK_DRAG_THRESHOLD_PX = 4;
410
+ function beginPageDrag(e) {
411
+ if (e.button !== 0 || !e.pageId || !e.pagePoint) return null;
412
+ return {
413
+ pageId: e.pageId,
414
+ pageOrigin: [
415
+ e.docPoint[0] - e.pagePoint[0],
416
+ e.docPoint[1] - e.pagePoint[1]
417
+ ],
418
+ startLocal: e.pagePoint
419
+ };
420
+ }
421
+ function endLocalFor(drag, e) {
422
+ return [
423
+ e.docPoint[0] - drag.pageOrigin[0],
424
+ e.docPoint[1] - drag.pageOrigin[1]
425
+ ];
426
+ }
427
+ function pxToPt(scale, px) {
428
+ return px / (scale > 0 ? scale : 1);
429
+ }
430
+ async function commitAndSelect(paged, mutation, label) {
431
+ try {
432
+ const reply = await paged.client.mutate(mutation);
433
+ if (reply.kind !== "mutationApplied") {
434
+ const error = reply.kind === "mutationFailed" ? reply.payload : reply;
435
+ console.warn(`${label} rejected by engine:`, JSON.stringify(error));
436
+ return { applied: false, error };
437
+ }
438
+ const createdId = reply.payload.createdId ?? null;
439
+ if (createdId) {
440
+ try {
441
+ const ids = await paged.client.setElementSelection(
442
+ [createdId],
443
+ "replace"
444
+ );
445
+ paged.selection.setElementSelection(ids);
446
+ const items = await paged.client.elementGeometry(ids);
447
+ paged.selection.setElementGeometry(items);
448
+ } catch {
449
+ }
450
+ }
451
+ return {
452
+ applied: true,
453
+ createdId,
454
+ pageIds: reply.payload.pageIds
455
+ };
456
+ } catch (error) {
457
+ console.warn(`${label} failed:`, error);
458
+ return { applied: false, error };
459
+ }
460
+ }
461
+
462
+ // src/tools.ts
463
+ function contentSelectionInactive(state) {
464
+ const editor = state;
465
+ return editor?.contentSelection?.contentSelection == null;
466
+ }
467
+ function contributeTool(host, tool) {
468
+ const store = new DisposableStore();
469
+ store.add(host.contribute.tool(tool));
470
+ const commandId = `${tool.id}.activate`;
471
+ store.add(
472
+ host.contribute.command({
473
+ id: commandId,
474
+ title: `Tool: ${tool.title}`,
475
+ category: "Tools",
476
+ icon: tool.icon,
477
+ handler: (paged) => {
478
+ paged.tool.setBaseTool(tool.id);
479
+ }
480
+ })
481
+ );
482
+ if (tool.shortcut) {
483
+ store.add(
484
+ host.contribute.keybinding({
485
+ key: tool.shortcut,
486
+ command: commandId,
487
+ when: contentSelectionInactive
488
+ })
489
+ );
490
+ }
491
+ return store;
492
+ }
493
+
494
+ // src/panels.ts
495
+ function contributePanel(host, panel) {
496
+ const store = new DisposableStore();
497
+ store.add(host.contribute.panel(panel));
498
+ store.add(
499
+ host.contribute.command({
500
+ id: `${panel.id}.show`,
501
+ title: `Show: ${panel.title}`,
502
+ category: "View",
503
+ icon: panel.icon,
504
+ handler: () => {
505
+ host.shell.openPanel(panel.id);
506
+ }
507
+ })
508
+ );
509
+ store.add(
510
+ host.contribute.command({
511
+ id: `${panel.id}.hide`,
512
+ title: `Hide: ${panel.title}`,
513
+ category: "View",
514
+ handler: () => {
515
+ host.shell.closePanel(panel.id);
516
+ }
517
+ })
518
+ );
519
+ return store;
520
+ }
521
+ export {
522
+ API_VERSION,
523
+ CLICK_DRAG_THRESHOLD_PX,
524
+ DisposableStore,
525
+ HOST_FEATURES,
526
+ PluginApiNotImplemented,
527
+ beginPageDrag,
528
+ commitAndSelect,
529
+ contributePanel,
530
+ contributeTool,
531
+ createBundleHost,
532
+ createHeadlessHost,
533
+ defineBundle,
534
+ endLocalFor,
535
+ loadBundle,
536
+ pxToPt,
537
+ satisfiesApiVersion,
538
+ toDisposable
539
+ };
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@paged-media/plugin-sdk",
3
+ "version": "0.2.1-canary.0",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ }
12
+ },
13
+ "dependencies": {
14
+ "@paged-media/plugin-api": "0.2.1-canary.0"
15
+ },
16
+ "devDependencies": {
17
+ "typescript": "^5.6.3",
18
+ "vitest": "^2.1.8"
19
+ },
20
+ "description": "The Paged plugin runtime: loadBundle, the in-process BundleHost adapter, the gesture kit, and version negotiation.",
21
+ "license": "UNLICENSED",
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/paged-media/plugin-sdk.git",
28
+ "directory": "packages/plugin-sdk"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public",
32
+ "tag": "canary"
33
+ },
34
+ "scripts": {
35
+ "typecheck": "tsc --noEmit -p tsconfig.json",
36
+ "test": "vitest run",
37
+ "build": "tsup src/index.ts --format esm --dts --out-dir dist --clean"
38
+ }
39
+ }