@paged-media/plugin-api 0.2.29-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/editor.d.ts +12 -1
- package/dist/host.d.ts +31 -3
- package/dist/manifest.d.ts +3 -1
- package/dist/mutations.d.ts +74 -103
- package/dist/wire.d.ts +55 -4
- package/package.json +1 -1
- package/src/manifest.schema.json +1 -2
package/dist/editor.d.ts
CHANGED
|
@@ -444,7 +444,18 @@ export interface PagedEditor {
|
|
|
444
444
|
* scene channel (headless / older editor); `host.contribute.sceneLayer()`
|
|
445
445
|
* then warns + no-ops and `supports("rendering.sceneLayer@1")` is false. */
|
|
446
446
|
sceneLayers?: {
|
|
447
|
-
|
|
447
|
+
/**
|
|
448
|
+
* `caller` (C-34) — the plugin submitting. OPTIONAL, and omitting it
|
|
449
|
+
* keeps the prior behaviour exactly: the engine records no owner and
|
|
450
|
+
* enforces nothing.
|
|
451
|
+
*
|
|
452
|
+
* When present the engine records which plugin claimed the frame's
|
|
453
|
+
* render and refuses a foreign replace, because a frame's in-frame
|
|
454
|
+
* render belongs to ONE content type and the door used to be an
|
|
455
|
+
* unconditional insert. The SDK adapter fills it from the manifest
|
|
456
|
+
* id, so a bundle never passes it itself.
|
|
457
|
+
*/
|
|
458
|
+
submit(elementId: string, layer: SceneLayer, caller?: string): Promise<void>;
|
|
448
459
|
clear(elementId: string): Promise<void>;
|
|
449
460
|
};
|
|
450
461
|
/** C-6 (I-06) — the renderer RESOURCE-PROVIDER channel. The editor
|
package/dist/host.d.ts
CHANGED
|
@@ -60,9 +60,37 @@ export interface EditContextContribution {
|
|
|
60
60
|
* (a content-type name, e.g. `"vectorGraphic"`, `"webFrame"`), but
|
|
61
61
|
* the bundle can only claim a type it declared. */
|
|
62
62
|
type: string;
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
|
|
63
|
+
/**
|
|
64
|
+
* How the user enters it. `"doubleClick"` wires the canvas
|
|
65
|
+
* double-click entry.
|
|
66
|
+
*
|
|
67
|
+
* THIS IS THE ONLY VALUE, and that is a product rule rather than a
|
|
68
|
+
* missing feature (K-13, 2026-08-07). **Any plugin that exposes
|
|
69
|
+
* content to the canvas is entered by double-clicking its frame.**
|
|
70
|
+
* The gesture must mean ONE thing across the product: a user learns
|
|
71
|
+
* "double-click to go inside" once, and it has to hold for a vector
|
|
72
|
+
* group, a spreadsheet, a web frame, a Word document and a raster
|
|
73
|
+
* image alike. A bundle with a bespoke entry would turn "how do I get
|
|
74
|
+
* into this thing" into plugin-specific trivia, which is a worse cost
|
|
75
|
+
* than any convenience a custom entry buys.
|
|
76
|
+
*
|
|
77
|
+
* `"command"` USED TO BE HERE, documented as "programmatic /
|
|
78
|
+
* menu-driven", and nothing ever implemented it: the registry is
|
|
79
|
+
* `register`-only, `BundleHost` has no enter member, and the shell's
|
|
80
|
+
* `enter` is a React hook no bundle can reach. So it was a value the
|
|
81
|
+
* platform accepted, validated and registered — and then silently
|
|
82
|
+
* never honoured, which is the `absent` lie one layer up. An audit at
|
|
83
|
+
* removal found 5 of 5 content plugins on `"doubleClick"` (draw, web,
|
|
84
|
+
* sheets, doc, image) and ZERO users of `"command"`, so removing it
|
|
85
|
+
* broke nothing and made the rule checkable by the compiler instead
|
|
86
|
+
* of by review.
|
|
87
|
+
*
|
|
88
|
+
* Kept as a one-member union rather than deleted outright: the field
|
|
89
|
+
* is where a SECOND entry gesture would be declared if one is ever
|
|
90
|
+
* genuinely warranted, and a plugin author reading it should see that
|
|
91
|
+
* the choice was made, not that it was never considered.
|
|
92
|
+
*/
|
|
93
|
+
entry: "doubleClick";
|
|
66
94
|
/** Does this element warrant entering THIS context? Pure predicate
|
|
67
95
|
* over the candidate snapshot (kind / groupChain / this plugin's
|
|
68
96
|
* metadata). When an `objectType` already routes a double-click to a
|
package/dist/manifest.d.ts
CHANGED
|
@@ -292,7 +292,9 @@ export interface PluginContributions {
|
|
|
292
292
|
* nondeterminism is undebuggable. */
|
|
293
293
|
editContexts?: Array<{
|
|
294
294
|
type: string;
|
|
295
|
-
entry
|
|
295
|
+
/** K-13 — the ONE entry gesture for canvas content. See
|
|
296
|
+
* `EditContextContribution.entry` and DESIGN.md §19. */
|
|
297
|
+
entry: "doubleClick";
|
|
296
298
|
priority?: number;
|
|
297
299
|
}>;
|
|
298
300
|
/** Reserved (paged.web §9.1.2): plugin-defined object types under
|
package/dist/mutations.d.ts
CHANGED
|
@@ -1,101 +1,68 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Mutation } from "./wire";
|
|
2
2
|
export type { ElementId, PageId, NodeId, NodeSpec, Mutation, Operation, PropertyPath, Value, PathAnchorSpec, PathAnchorTriple, PathAnchorsResult, PathPointAddress, PathPointRole, PathfinderKind, HitFilter, HitResult, CollectionName, DocumentMeta, ElementGeometryItem, SceneTreeNode, SelectionMode, ContentSelection, MainToWorker, MainToWorkerKind, WorkerToMain, SceneLayer, SceneItem, ScenePathSeg, ScenePaint, GestureType, GestureHandle, GestureModifiers, SwatchSpec, GradientSpec, GradientStopSpec, SwatchSummary, GradientSummary, LayerSummary, } from "./wire";
|
|
3
3
|
/** v56 (Wave B) — close an OPEN subpath of a path element: the inverse
|
|
4
4
|
* gesture of `pathOpenAt`'s scissors cut. `subpath` picks the contour
|
|
5
5
|
* by index; omit for the default (the single/last open subpath).
|
|
6
6
|
* Coincident endpoints — the duplicated pair a cut leaves — merge back
|
|
7
7
|
* into one anchor; endpoints apart gain the implicit closing edge. */
|
|
8
|
-
export type ClosePathMutation = {
|
|
8
|
+
export type ClosePathMutation = Extract<Mutation, {
|
|
9
9
|
op: "closePath";
|
|
10
|
-
|
|
11
|
-
elementId: ElementId;
|
|
12
|
-
subpath?: number | null;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
10
|
+
}>;
|
|
15
11
|
/** v56 (Wave B) — weld two OPEN single-contour path elements into one
|
|
16
12
|
* (InDesign's Join): connect the NEAREST endpoints of `elementId` and
|
|
17
13
|
* `otherId`, then delete `otherId`. Both endpoint pairs coincident
|
|
18
14
|
* closes the result into a ring. Non-path / closed / multi-contour
|
|
19
15
|
* inputs are rejected with an honest error (no-op). One undo step
|
|
20
16
|
* restores BOTH elements. */
|
|
21
|
-
export type JoinPathsMutation = {
|
|
17
|
+
export type JoinPathsMutation = Extract<Mutation, {
|
|
22
18
|
op: "joinPaths";
|
|
23
|
-
|
|
24
|
-
elementId: ElementId;
|
|
25
|
-
otherId: ElementId;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
19
|
+
}>;
|
|
28
20
|
/** v56 (B-18) — InDesign paste-into: nest an existing TOP-LEVEL page
|
|
29
21
|
* item inside a container Rectangle / Oval / Polygon. The child keeps
|
|
30
22
|
* its document-space geometry (nothing moves on canvas) and renders
|
|
31
23
|
* clipped by the container's outline. Grouped / already-nested
|
|
32
24
|
* children and non-container hosts are rejected with an honest error.
|
|
33
25
|
* One undo pops the child back to its exact stacking slot. */
|
|
34
|
-
export type PasteIntoMutation = {
|
|
26
|
+
export type PasteIntoMutation = Extract<Mutation, {
|
|
35
27
|
op: "pasteInto";
|
|
36
|
-
|
|
37
|
-
containerId: ElementId;
|
|
38
|
-
childId: ElementId;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
28
|
+
}>;
|
|
41
29
|
/** v56 (B-18) — the inverse gesture: pop a pasted-in child back to top
|
|
42
30
|
* level (stacks on top), world transform preserved. One undo re-nests
|
|
43
31
|
* it at the same child index. */
|
|
44
|
-
export type ReleaseFromMutation = {
|
|
32
|
+
export type ReleaseFromMutation = Extract<Mutation, {
|
|
45
33
|
op: "releaseFrom";
|
|
46
|
-
|
|
47
|
-
childId: ElementId;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
34
|
+
}>;
|
|
50
35
|
/** v57 (B-22) — every face of the arrangement becomes its own object,
|
|
51
36
|
* keeping the attributes of the topmost input covering it. */
|
|
52
|
-
export type PathfinderDivideMutation = {
|
|
37
|
+
export type PathfinderDivideMutation = Extract<Mutation, {
|
|
53
38
|
op: "pathfinderDivide";
|
|
54
|
-
|
|
55
|
-
elementIds: ElementId[];
|
|
56
|
-
};
|
|
57
|
-
};
|
|
39
|
+
}>;
|
|
58
40
|
/** v57 (B-22) — each input is clipped to the part nothing above it
|
|
59
41
|
* covers, and loses its stroke. Inputs entirely hidden are deleted. */
|
|
60
|
-
export type PathfinderTrimMutation = {
|
|
42
|
+
export type PathfinderTrimMutation = Extract<Mutation, {
|
|
61
43
|
op: "pathfinderTrim";
|
|
62
|
-
|
|
63
|
-
elementIds: ElementId[];
|
|
64
|
-
};
|
|
65
|
-
};
|
|
44
|
+
}>;
|
|
66
45
|
/** v57 (B-22) — Trim, then coalesce: inputs that share a fill colour
|
|
67
46
|
* merge into one object. */
|
|
68
|
-
export type PathfinderMergeMutation = {
|
|
47
|
+
export type PathfinderMergeMutation = Extract<Mutation, {
|
|
69
48
|
op: "pathfinderMerge";
|
|
70
|
-
|
|
71
|
-
elementIds: ElementId[];
|
|
72
|
-
};
|
|
73
|
-
};
|
|
49
|
+
}>;
|
|
74
50
|
/** v57 (B-22) — keep only what falls inside the TOPMOST input, coloured
|
|
75
51
|
* by the objects beneath it; the topmost input is consumed as the
|
|
76
52
|
* cookie cutter and disappears. */
|
|
77
|
-
export type PathfinderCropMutation = {
|
|
53
|
+
export type PathfinderCropMutation = Extract<Mutation, {
|
|
78
54
|
op: "pathfinderCrop";
|
|
79
|
-
|
|
80
|
-
elementIds: ElementId[];
|
|
81
|
-
};
|
|
82
|
-
};
|
|
55
|
+
}>;
|
|
83
56
|
/** v57 (B-22) — fills become strokes: every arrangement edge (split at
|
|
84
57
|
* each crossing) becomes an open `GraphicLine` stroked with the fill of
|
|
85
58
|
* the input that contributed it. All inputs are consumed. */
|
|
86
|
-
export type PathfinderOutlineMutation = {
|
|
59
|
+
export type PathfinderOutlineMutation = Extract<Mutation, {
|
|
87
60
|
op: "pathfinderOutline";
|
|
88
|
-
|
|
89
|
-
elementIds: ElementId[];
|
|
90
|
-
};
|
|
91
|
-
};
|
|
61
|
+
}>;
|
|
92
62
|
/** v57 (B-22) — the BACKMOST object minus every object in front of it. */
|
|
93
|
-
export type PathfinderMinusBackMutation = {
|
|
63
|
+
export type PathfinderMinusBackMutation = Extract<Mutation, {
|
|
94
64
|
op: "pathfinderMinusBack";
|
|
95
|
-
|
|
96
|
-
elementIds: ElementId[];
|
|
97
|
-
};
|
|
98
|
-
};
|
|
65
|
+
}>;
|
|
99
66
|
/** v57 (B-22) — whether `pathfinderFaces` KEEPS the named faces or
|
|
100
67
|
* REMOVES them (Shape Builder's drag vs alt-drag). */
|
|
101
68
|
export type FaceSelectMode = "keep" | "remove";
|
|
@@ -105,14 +72,9 @@ export type FaceSelectMode = "keep" | "remove";
|
|
|
105
72
|
* `elementIds` (ids are only stable per input set); `mode` picks
|
|
106
73
|
* whether they are the faces kept or the faces removed. An unknown id
|
|
107
74
|
* is REFUSED, not ignored — a stale face set fails loudly. */
|
|
108
|
-
export type PathfinderFacesMutation = {
|
|
75
|
+
export type PathfinderFacesMutation = Extract<Mutation, {
|
|
109
76
|
op: "pathfinderFaces";
|
|
110
|
-
|
|
111
|
-
elementIds: ElementId[];
|
|
112
|
-
faces: string[];
|
|
113
|
-
mode: FaceSelectMode;
|
|
114
|
-
};
|
|
115
|
-
};
|
|
77
|
+
}>;
|
|
116
78
|
/** v58 (C-28) — how the mask artwork's coverage is read. `luminosity`
|
|
117
79
|
* is Illustrator's default and PDF's `/S /Luminosity`; `alpha` reads
|
|
118
80
|
* the artwork's alpha channel instead. Unpainted area means HIDDEN for
|
|
@@ -136,24 +98,15 @@ export type OpacityMaskType = "luminosity" | "alpha";
|
|
|
136
98
|
* Vello output is now byte-identical to the CPU rasterizer across
|
|
137
99
|
* luminosity, alpha and both inverted forms. Safe to build WYSIWYG UI
|
|
138
100
|
* over. */
|
|
139
|
-
export type ApplyOpacityMaskMutation = {
|
|
101
|
+
export type ApplyOpacityMaskMutation = Extract<Mutation, {
|
|
140
102
|
op: "applyOpacityMask";
|
|
141
|
-
|
|
142
|
-
targetId: ElementId;
|
|
143
|
-
maskId: ElementId;
|
|
144
|
-
maskType?: OpacityMaskType | null;
|
|
145
|
-
invert?: boolean | null;
|
|
146
|
-
};
|
|
147
|
-
};
|
|
103
|
+
}>;
|
|
148
104
|
/** v58 (C-28) — drop the mask relation; the artwork returns to top level
|
|
149
105
|
* with its geometry untouched. One undo re-applies the mask with its
|
|
150
106
|
* original mode/invert at the same z slot. */
|
|
151
|
-
export type ReleaseOpacityMaskMutation = {
|
|
107
|
+
export type ReleaseOpacityMaskMutation = Extract<Mutation, {
|
|
152
108
|
op: "releaseOpacityMask";
|
|
153
|
-
|
|
154
|
-
targetId: ElementId;
|
|
155
|
-
};
|
|
156
|
-
};
|
|
109
|
+
}>;
|
|
157
110
|
/** v58 (C-29) — **Type on a Path**: flow an existing story along an
|
|
158
111
|
* existing path element. The engine could already RENDER type on a path
|
|
159
112
|
* loaded from an IDML; until v58 nothing could create one.
|
|
@@ -164,24 +117,13 @@ export type ReleaseOpacityMaskMutation = {
|
|
|
164
117
|
* Center honoured), `flipPathEffect` and the `startBracket`/`endBracket`
|
|
165
118
|
* range are all live. `PathEffect` is deliberately NOT exposed — only
|
|
166
119
|
* `RainbowPathEffect` actually renders. */
|
|
167
|
-
export type AttachTextToPathMutation = {
|
|
120
|
+
export type AttachTextToPathMutation = Extract<Mutation, {
|
|
168
121
|
op: "attachTextToPath";
|
|
169
|
-
|
|
170
|
-
elementId: ElementId;
|
|
171
|
-
storyId: string;
|
|
172
|
-
pathTypeAlignment?: string | null;
|
|
173
|
-
flipPathEffect?: string | null;
|
|
174
|
-
startBracket?: number | null;
|
|
175
|
-
endBracket?: number | null;
|
|
176
|
-
};
|
|
177
|
-
};
|
|
122
|
+
}>;
|
|
178
123
|
/** v58 (C-29) — unlink the text from the path; the exact inverse. */
|
|
179
|
-
export type DetachTextFromPathMutation = {
|
|
124
|
+
export type DetachTextFromPathMutation = Extract<Mutation, {
|
|
180
125
|
op: "detachTextFromPath";
|
|
181
|
-
|
|
182
|
-
elementId: ElementId;
|
|
183
|
-
};
|
|
184
|
-
};
|
|
126
|
+
}>;
|
|
185
127
|
/** v59 (Arrange) — where `reorderElement` puts its target inside the
|
|
186
128
|
* sibling list it already belongs to. `0` is the BACKMOST slot (painted
|
|
187
129
|
* first). Prefer the four verbs: they are evaluated against the order
|
|
@@ -226,16 +168,19 @@ export type ZOrderTarget = "front" | "back" | "forward" | "backward" | {
|
|
|
226
168
|
* existing source elements byte-for-byte and only places new ones, so a
|
|
227
169
|
* reorder reverts on an export/reopen round trip. Do not present
|
|
228
170
|
* Arrange as durable across IDML interchange yet. */
|
|
229
|
-
export type ReorderElementMutation = {
|
|
171
|
+
export type ReorderElementMutation = Extract<Mutation, {
|
|
230
172
|
op: "reorderElement";
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
*
|
|
238
|
-
*
|
|
173
|
+
}>;
|
|
174
|
+
/** The protocol-ahead ops, as one union.
|
|
175
|
+
*
|
|
176
|
+
* This said "the delta between the vendored `Mutation` (protocol 51)
|
|
177
|
+
* and core's protocol 59 — empties itself on the next `sync-wire.mjs`
|
|
178
|
+
* run". The run happened (the vendored stamp is 0.61.0) and the delta
|
|
179
|
+
* did NOT empty itself: `sync-wire.mjs` rewrites `wire.d.ts` and has
|
|
180
|
+
* no idea this file exists. So it is currently EMPTY in substance —
|
|
181
|
+
* every member is a member of `Mutation` — while still being a real
|
|
182
|
+
* union, and the gate at the foot of this file is what keeps that
|
|
183
|
+
* claim honest instead of asserting it in prose. */
|
|
239
184
|
/** v57 (C-15) — name the id a creating sibling is about to mint, so a
|
|
240
185
|
* LATER child of the same batch can address it as `"$h:<handle>"`.
|
|
241
186
|
*
|
|
@@ -262,14 +207,40 @@ export type ReorderElementMutation = {
|
|
|
262
207
|
* Generalises the v34 `$created` sentinel — which only two mutation
|
|
263
208
|
* kinds understood — to any number of live names addressable from any
|
|
264
209
|
* mutation kind. */
|
|
265
|
-
export type BindCreatedMutation = {
|
|
210
|
+
export type BindCreatedMutation = Extract<Mutation, {
|
|
266
211
|
op: "bindCreated";
|
|
267
|
-
|
|
268
|
-
handle: string;
|
|
269
|
-
};
|
|
270
|
-
};
|
|
212
|
+
}>;
|
|
271
213
|
export type PendingMutation = BindCreatedMutation | ClosePathMutation | JoinPathsMutation | PasteIntoMutation | ReleaseFromMutation | PathfinderDivideMutation | PathfinderTrimMutation | PathfinderMergeMutation | PathfinderCropMutation | PathfinderOutlineMutation | PathfinderMinusBackMutation | PathfinderFacesMutation | ApplyOpacityMaskMutation | ReleaseOpacityMaskMutation | AttachTextToPathMutation | DetachTextFromPathMutation | ReorderElementMutation;
|
|
272
214
|
/** What `host.document.mutate` ACCEPTS: the vendored op union plus the
|
|
273
215
|
* protocol-ahead ops. Widening an accepted-input type is additive —
|
|
274
216
|
* every existing `Mutation` call site still compiles. */
|
|
275
217
|
export type MutationInput = Mutation | PendingMutation;
|
|
218
|
+
/** K-12 — THE DELTA IS A SUBSET OF `Mutation`, and this is the gate.
|
|
219
|
+
*
|
|
220
|
+
* `sync-wire.mjs` empties the delta in one direction only: it refreshes
|
|
221
|
+
* `wire.d.ts`, and nothing here notices that the ops it used to be
|
|
222
|
+
* ahead of have arrived. So the delta drained itself and no one told
|
|
223
|
+
* it — every member above is now IN the vendored union, and the block's
|
|
224
|
+
* own header has said so since 2026-08-06 while the members went on
|
|
225
|
+
* being independently-declared object literals.
|
|
226
|
+
*
|
|
227
|
+
* That is not cosmetic. A hand-written literal that HAPPENS to match a
|
|
228
|
+
* generated one is a second type that structural typing lets you get
|
|
229
|
+
* away with until the generated side changes a field — and then the
|
|
230
|
+
* error surfaces at the call site, not here. Declaring each member as
|
|
231
|
+
* `Extract<Mutation, …>` makes them one type by construction, so they
|
|
232
|
+
* cannot drift at all.
|
|
233
|
+
*
|
|
234
|
+
* This line is the check: if any member ever stops being part of
|
|
235
|
+
* `Mutation`, its `Extract` collapses to `never`, `PendingMutation`
|
|
236
|
+
* narrows, and the assignment below fails to compile — naming the
|
|
237
|
+
* regression here rather than in whichever bundle hit it first. When a
|
|
238
|
+
* genuinely protocol-ahead op is added, it will not be an `Extract`,
|
|
239
|
+
* and this line is what will (correctly) fail until it lands in a
|
|
240
|
+
* published wire and the member is folded back.
|
|
241
|
+
*
|
|
242
|
+
* Type-level, never a value: this module is the type-only façade, and
|
|
243
|
+
* a `const` here — even an unexported one — would put a runtime symbol
|
|
244
|
+
* in a package whose whole contract is that it has none. */
|
|
245
|
+
type Assert<T extends true> = T;
|
|
246
|
+
export type DeltaIsASubsetOfTheSettledUnion = Assert<PendingMutation extends Mutation ? true : false>;
|
package/dist/wire.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// GENERATED — do not edit. Vendored verbatim from the published
|
|
2
2
|
// @paged-media/canvas-wasm .d.ts (tsify output from paged-media/core,
|
|
3
3
|
// MPL-2.0 OR PMEL). Sync: node scripts/sync-wire.mjs · Check: --check.
|
|
4
|
-
// Synced from @paged-media/canvas-wasm@0.61.
|
|
4
|
+
// Synced from @paged-media/canvas-wasm@0.61.1
|
|
5
5
|
/* tslint:disable */
|
|
6
6
|
/* eslint-disable */
|
|
7
7
|
|
|
@@ -922,7 +922,31 @@ export type GestureHandle = number;
|
|
|
922
922
|
*/
|
|
923
923
|
export interface ElementGeometryItem {
|
|
924
924
|
id: ElementId;
|
|
925
|
-
|
|
925
|
+
/**
|
|
926
|
+
* C-23 — the page this element sits on, or `None` when it sits on
|
|
927
|
+
* the PASTEBOARD and belongs to no page.
|
|
928
|
+
*
|
|
929
|
+
* This used to be a plain `PageId`, and the door did not report a
|
|
930
|
+
* pageless element as pageless — it dropped it from the reply
|
|
931
|
+
* entirely, so a plugin that generated art off-page (paged.draw\'s
|
|
932
|
+
* pattern bake, stepping a tile past the page edge) created and
|
|
933
|
+
* grouped something it then could not read back.
|
|
934
|
+
*
|
|
935
|
+
* **The convention `None` carries:** `bounds` + `item_transform`
|
|
936
|
+
* compose against the SPREAD origin rather than a page origin.
|
|
937
|
+
* `spread_id` names which spread, because without it the answer is
|
|
938
|
+
* unusable the moment a document has two.
|
|
939
|
+
*
|
|
940
|
+
* Runtime-safe to widen: every element of every existing document
|
|
941
|
+
* is on a page, so no existing reply changes shape. The `None`
|
|
942
|
+
* only appears for items this door used to omit.
|
|
943
|
+
*/
|
|
944
|
+
pageId?: PageId | null;
|
|
945
|
+
/**
|
|
946
|
+
* C-23 — the owning spread. Always populated; the page-owned case
|
|
947
|
+
* carries it too, so a consumer never has to ask a second door.
|
|
948
|
+
*/
|
|
949
|
+
spreadId?: string | null;
|
|
926
950
|
/**
|
|
927
951
|
* `[top, left, bottom, right]`.
|
|
928
952
|
*/
|
|
@@ -1586,6 +1610,25 @@ export interface LinkSummary {
|
|
|
1586
1610
|
* 300-ppi floor. `None` when the IDML omits it.
|
|
1587
1611
|
*/
|
|
1588
1612
|
effectivePpi?: number | null;
|
|
1613
|
+
/**
|
|
1614
|
+
* C-27 — the placed image\'s OWN `<Image ItemTransform>`: how the
|
|
1615
|
+
* pixels sit inside the frame. `elementGeometry` reports the frame
|
|
1616
|
+
* and nothing reported this, so a plugin deriving geometry from the
|
|
1617
|
+
* pixels (Image Trace today; any measure or annotate tool later)
|
|
1618
|
+
* had to assume the image fills the frame — and quietly mis-placed
|
|
1619
|
+
* its output on every cropped or fitted placement.
|
|
1620
|
+
*
|
|
1621
|
+
* Row-major `[a, b, c, d, tx, ty]`, mapping the image\'s natural
|
|
1622
|
+
* pixel rect `(0, 0, width, height)` into the frame\'s INNER
|
|
1623
|
+
* coordinate space — the same matrix the renderer composes with
|
|
1624
|
+
* the frame\'s own transform. Compose it the same way and generated
|
|
1625
|
+
* geometry lands where the pixels do.
|
|
1626
|
+
*
|
|
1627
|
+
* `None` for synthetic IDMLs that omit the inner transform, which
|
|
1628
|
+
* is the case the renderer handles by stretching the image to the
|
|
1629
|
+
* frame bounds; a consumer seeing `None` may assume that fill.
|
|
1630
|
+
*/
|
|
1631
|
+
imageTransform?: [number, number, number, number, number, number] | null;
|
|
1589
1632
|
}
|
|
1590
1633
|
|
|
1591
1634
|
/**
|
|
@@ -1700,7 +1743,15 @@ export type PageId = string;
|
|
|
1700
1743
|
*/
|
|
1701
1744
|
export interface PathAnchorsResult {
|
|
1702
1745
|
id: ElementId;
|
|
1703
|
-
|
|
1746
|
+
/**
|
|
1747
|
+
* C-23 — see [`ElementGeometryItem::page_id`]; same convention,
|
|
1748
|
+
* same reason. Anchors are in the element\'s own space either way.
|
|
1749
|
+
*/
|
|
1750
|
+
pageId?: PageId | null;
|
|
1751
|
+
/**
|
|
1752
|
+
* C-23 — the owning spread; see [`ElementGeometryItem::spread_id`].
|
|
1753
|
+
*/
|
|
1754
|
+
spreadId?: string | null;
|
|
1704
1755
|
anchors: PathAnchorTriple[];
|
|
1705
1756
|
/**
|
|
1706
1757
|
* Per-contour boundaries. Empty for the common single-contour
|
|
@@ -1774,7 +1825,7 @@ export type Operation = { kind: "SetProperty"; node: NodeId; path: PropertyPath;
|
|
|
1774
1825
|
* variants so e.g. `cmyk_icc_profile` becomes `cmykIccProfile` on
|
|
1775
1826
|
* the wire — the TS protocol mirror locks the camelCase contract.
|
|
1776
1827
|
*/
|
|
1777
|
-
export type MainToWorkerKind = { kind: "hello" } | { kind: "loadDocument"; payload: { bytes: number[]; font?: number[] | null; cmykIccProfile?: number[] | null } } | { kind: "newBlankDocument"; payload: { widthPt: number; heightPt: number; font?: number[] | null } } | { kind: "registerFont"; payload: { family: string; style?: string | null; bytes: number[] } } | { kind: "clearFontRegistry" } | { kind: "registerColorProfile"; payload: { name: string; bytes: number[] } } | { kind: "mutate"; payload: Mutation } | { kind: "requestPage"; payload: { pageId: PageId; lod: LodTier } } | { kind: "hitTest"; payload: { pageId: PageId; docPoint: [number, number]; filter: HitFilter } } | { kind: "requestSnapshot"; payload: { pageId: PageId; targetWidthPx: number; dpi?: number | null } } | { kind: "setSelection"; payload: { selection: ContentSelection | null } } | { kind: "requestSelectionGeometry"; payload: { selection: ContentSelection } } | { kind: "requestCaretGeometry"; payload: { selection: ContentSelection } } | { kind: "requestCaretNav"; payload: { storyId: string; offset: number; direction: CaretDirection; cell?: TextCellAddr | null } } | { kind: "requestLineBounds"; payload: { storyId: string; offset: number; cell?: TextCellAddr | null } } | { kind: "requestWordBounds"; payload: { storyId: string; offset: number; cell?: TextCellAddr | null } } | { kind: "requestParagraphBounds"; payload: { storyId: string; offset: number; cell?: TextCellAddr | null } } | { kind: "undo" } | { kind: "redo" } | { kind: "setElementSelection"; payload: { ids: ElementId[]; mode: SelectionMode } } | { kind: "requestMarqueeHits"; payload: { pageId: PageId; rect: [number, number, number, number] } } | { kind: "requestElementGeometry"; payload: { ids: ElementId[] } } | { kind: "requestGroupLeaves"; payload: { groupId: string } } | { kind: "requestPathAnchors"; payload: { id: ElementId } } | { kind: "requestNearestPathPoint"; payload: { id: ElementId; point: [number, number] } } | { kind: "requestPlanarRegions"; payload: { elementIds: ElementId[]; point?: [number, number] | null } } | { kind: "requestLayers" } | { kind: "requestCollection"; payload: { name: CollectionName } } | { kind: "requestFrameChain"; payload: { storyId: string } } | { kind: "requestStoryContent"; payload: { storyId: string } } | { kind: "requestPlacedAssetBytes"; payload: { elementId: string } } | { kind: "requestFontFaceBytes"; payload: { family: string; style?: string | null } } | { kind: "requestMeasureText"; payload: { family: string; style?: string | null; text: string; sizePt: number } } | { kind: "submitSceneLayer"; payload: { elementId: string; layer: SceneLayer } } | { kind: "clearSceneLayer"; payload: { elementId: string } } | { kind: "submitPixelLayer"; payload: { elementId: string; layer: PixelLayer } } | { kind: "clearPixelLayer"; payload: { elementId: string } } | { kind: "claimImageResource"; payload: { imageId: string; levels: number; tileSize: number; baseWidth: number; baseHeight: number; revision: number } } | { kind: "releaseImageResource"; payload: { imageId: string } } | { kind: "submitResourceTiles"; payload: { imageId: string; level: number; tiles: ProviderTileWire[]; generation: number } } | { kind: "requestDocumentMeta" } | { kind: "requestDocumentPlaceholders" } | { kind: "requestColorPreview"; payload: { swatchId: string } } | { kind: "requestColorCompute"; payload: { space: string; value: number[]; tint?: number | null; model?: string | null; alternateSpace?: string | null; alternateValue?: number[] | null } } | { kind: "requestGradientDetail"; payload: { gradientId: string } } | { kind: "exportSwatchLibrary"; payload: { groupId?: string | null } } | { kind: "executeScript"; payload: { source: string } } | { kind: "exportPdfBegin"; payload: { options: ExportPdfWireOptions } } | { kind: "exportPdfPage"; payload: { session: number } } | { kind: "exportPdfFinish"; payload: { session: number } } | { kind: "exportPdfCancel"; payload: { session: number } } | { kind: "exportIdml"; payload: {} } | { kind: "writePagedPart"; payload: { path: string; bytes: number[] } } | { kind: "readPagedPart"; payload: { path: string } } | { kind: "listPagedParts"; payload: { prefix: string } } | { kind: "exportPaged"; payload: {} } | { kind: "requestElementProperties"; payload: { id: ElementId } } | { kind: "requestSceneTree" } | { kind: "beginGesture"; payload: { nodes: ElementId[]; gesture: GestureType; anchor?: GestureAnchor | null; cameraScale?: number | null } } | { kind: "updateGesture"; payload: { handle: GestureHandle; delta: [number, number]; modifiers: GestureModifiers } } | { kind: "commitGesture"; payload: { handle: GestureHandle } } | { kind: "cancelGesture"; payload: { handle: GestureHandle } };
|
|
1828
|
+
export type MainToWorkerKind = { kind: "hello" } | { kind: "loadDocument"; payload: { bytes: number[]; font?: number[] | null; cmykIccProfile?: number[] | null } } | { kind: "newBlankDocument"; payload: { widthPt: number; heightPt: number; font?: number[] | null } } | { kind: "registerFont"; payload: { family: string; style?: string | null; bytes: number[] } } | { kind: "clearFontRegistry" } | { kind: "registerColorProfile"; payload: { name: string; bytes: number[] } } | { kind: "mutate"; payload: Mutation } | { kind: "requestPage"; payload: { pageId: PageId; lod: LodTier } } | { kind: "hitTest"; payload: { pageId: PageId; docPoint: [number, number]; filter: HitFilter } } | { kind: "requestSnapshot"; payload: { pageId: PageId; targetWidthPx: number; dpi?: number | null } } | { kind: "setSelection"; payload: { selection: ContentSelection | null } } | { kind: "requestSelectionGeometry"; payload: { selection: ContentSelection } } | { kind: "requestCaretGeometry"; payload: { selection: ContentSelection } } | { kind: "requestCaretNav"; payload: { storyId: string; offset: number; direction: CaretDirection; cell?: TextCellAddr | null } } | { kind: "requestLineBounds"; payload: { storyId: string; offset: number; cell?: TextCellAddr | null } } | { kind: "requestWordBounds"; payload: { storyId: string; offset: number; cell?: TextCellAddr | null } } | { kind: "requestParagraphBounds"; payload: { storyId: string; offset: number; cell?: TextCellAddr | null } } | { kind: "undo" } | { kind: "redo" } | { kind: "setElementSelection"; payload: { ids: ElementId[]; mode: SelectionMode } } | { kind: "requestMarqueeHits"; payload: { pageId: PageId; rect: [number, number, number, number] } } | { kind: "requestElementGeometry"; payload: { ids: ElementId[] } } | { kind: "requestGroupLeaves"; payload: { groupId: string } } | { kind: "requestPathAnchors"; payload: { id: ElementId } } | { kind: "requestNearestPathPoint"; payload: { id: ElementId; point: [number, number] } } | { kind: "requestPlanarRegions"; payload: { elementIds: ElementId[]; point?: [number, number] | null } } | { kind: "requestLayers" } | { kind: "requestCollection"; payload: { name: CollectionName } } | { kind: "requestFrameChain"; payload: { storyId: string } } | { kind: "requestStoryContent"; payload: { storyId: string } } | { kind: "requestPlacedAssetBytes"; payload: { elementId: string } } | { kind: "requestFontFaceBytes"; payload: { family: string; style?: string | null } } | { kind: "requestMeasureText"; payload: { family: string; style?: string | null; text: string; sizePt: number } } | { kind: "submitSceneLayer"; payload: { elementId: string; layer: SceneLayer; caller?: string } } | { kind: "clearSceneLayer"; payload: { elementId: string } } | { kind: "submitPixelLayer"; payload: { elementId: string; layer: PixelLayer } } | { kind: "clearPixelLayer"; payload: { elementId: string } } | { kind: "claimImageResource"; payload: { imageId: string; levels: number; tileSize: number; baseWidth: number; baseHeight: number; revision: number } } | { kind: "releaseImageResource"; payload: { imageId: string } } | { kind: "submitResourceTiles"; payload: { imageId: string; level: number; tiles: ProviderTileWire[]; generation: number } } | { kind: "requestDocumentMeta" } | { kind: "requestDocumentPlaceholders" } | { kind: "requestColorPreview"; payload: { swatchId: string } } | { kind: "requestColorCompute"; payload: { space: string; value: number[]; tint?: number | null; model?: string | null; alternateSpace?: string | null; alternateValue?: number[] | null } } | { kind: "requestGradientDetail"; payload: { gradientId: string } } | { kind: "exportSwatchLibrary"; payload: { groupId?: string | null } } | { kind: "executeScript"; payload: { source: string } } | { kind: "exportPdfBegin"; payload: { options: ExportPdfWireOptions } } | { kind: "exportPdfPage"; payload: { session: number } } | { kind: "exportPdfFinish"; payload: { session: number } } | { kind: "exportPdfCancel"; payload: { session: number } } | { kind: "exportIdml"; payload: {} } | { kind: "writePagedPart"; payload: { path: string; bytes: number[]; caller?: string } } | { kind: "readPagedPart"; payload: { path: string } } | { kind: "listPagedParts"; payload: { prefix: string } } | { kind: "exportPaged"; payload: {} } | { kind: "requestElementProperties"; payload: { id: ElementId } } | { kind: "requestSceneTree" } | { kind: "beginGesture"; payload: { nodes: ElementId[]; gesture: GestureType; anchor?: GestureAnchor | null; cameraScale?: number | null } } | { kind: "updateGesture"; payload: { handle: GestureHandle; delta: [number, number]; modifiers: GestureModifiers } } | { kind: "commitGesture"; payload: { handle: GestureHandle } } | { kind: "cancelGesture"; payload: { handle: GestureHandle } };
|
|
1778
1829
|
|
|
1779
1830
|
/**
|
|
1780
1831
|
* Track J — wire-shape mirror of `paged_model::PathAnchor`. The
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paged-media/plugin-api",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.30-canary.0",
|
|
4
4
|
"description": "The Paged plugin contract: manifest, bundle lifecycle, the BundleHost surface, and the contribution + engine wire types. Type-only.",
|
|
5
5
|
"license": "MPL-2.0 OR LicenseRef-PMEL",
|
|
6
6
|
"type": "module",
|