@paged-media/canvas-wasm 0.61.0 → 0.61.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paged-media/canvas-wasm",
3
- "version": "0.61.0",
3
+ "version": "0.61.1",
4
4
  "type": "module",
5
5
  "main": "paged_canvas_wasm.js",
6
6
  "types": "paged_canvas_wasm.d.ts",
@@ -918,7 +918,31 @@ export type GestureHandle = number;
918
918
  */
919
919
  export interface ElementGeometryItem {
920
920
  id: ElementId;
921
- pageId: PageId;
921
+ /**
922
+ * C-23 — the page this element sits on, or `None` when it sits on
923
+ * the PASTEBOARD and belongs to no page.
924
+ *
925
+ * This used to be a plain `PageId`, and the door did not report a
926
+ * pageless element as pageless — it dropped it from the reply
927
+ * entirely, so a plugin that generated art off-page (paged.draw\'s
928
+ * pattern bake, stepping a tile past the page edge) created and
929
+ * grouped something it then could not read back.
930
+ *
931
+ * **The convention `None` carries:** `bounds` + `item_transform`
932
+ * compose against the SPREAD origin rather than a page origin.
933
+ * `spread_id` names which spread, because without it the answer is
934
+ * unusable the moment a document has two.
935
+ *
936
+ * Runtime-safe to widen: every element of every existing document
937
+ * is on a page, so no existing reply changes shape. The `None`
938
+ * only appears for items this door used to omit.
939
+ */
940
+ pageId?: PageId | null;
941
+ /**
942
+ * C-23 — the owning spread. Always populated; the page-owned case
943
+ * carries it too, so a consumer never has to ask a second door.
944
+ */
945
+ spreadId?: string | null;
922
946
  /**
923
947
  * `[top, left, bottom, right]`.
924
948
  */
@@ -1582,6 +1606,25 @@ export interface LinkSummary {
1582
1606
  * 300-ppi floor. `None` when the IDML omits it.
1583
1607
  */
1584
1608
  effectivePpi?: number | null;
1609
+ /**
1610
+ * C-27 — the placed image\'s OWN `<Image ItemTransform>`: how the
1611
+ * pixels sit inside the frame. `elementGeometry` reports the frame
1612
+ * and nothing reported this, so a plugin deriving geometry from the
1613
+ * pixels (Image Trace today; any measure or annotate tool later)
1614
+ * had to assume the image fills the frame — and quietly mis-placed
1615
+ * its output on every cropped or fitted placement.
1616
+ *
1617
+ * Row-major `[a, b, c, d, tx, ty]`, mapping the image\'s natural
1618
+ * pixel rect `(0, 0, width, height)` into the frame\'s INNER
1619
+ * coordinate space — the same matrix the renderer composes with
1620
+ * the frame\'s own transform. Compose it the same way and generated
1621
+ * geometry lands where the pixels do.
1622
+ *
1623
+ * `None` for synthetic IDMLs that omit the inner transform, which
1624
+ * is the case the renderer handles by stretching the image to the
1625
+ * frame bounds; a consumer seeing `None` may assume that fill.
1626
+ */
1627
+ imageTransform?: [number, number, number, number, number, number] | null;
1585
1628
  }
1586
1629
 
1587
1630
  /**
@@ -1696,7 +1739,15 @@ export type PageId = string;
1696
1739
  */
1697
1740
  export interface PathAnchorsResult {
1698
1741
  id: ElementId;
1699
- pageId: PageId;
1742
+ /**
1743
+ * C-23 — see [`ElementGeometryItem::page_id`]; same convention,
1744
+ * same reason. Anchors are in the element\'s own space either way.
1745
+ */
1746
+ pageId?: PageId | null;
1747
+ /**
1748
+ * C-23 — the owning spread; see [`ElementGeometryItem::spread_id`].
1749
+ */
1750
+ spreadId?: string | null;
1700
1751
  anchors: PathAnchorTriple[];
1701
1752
  /**
1702
1753
  * Per-contour boundaries. Empty for the common single-contour
@@ -1770,7 +1821,7 @@ export type Operation = { kind: "SetProperty"; node: NodeId; path: PropertyPath;
1770
1821
  * variants so e.g. `cmyk_icc_profile` becomes `cmykIccProfile` on
1771
1822
  * the wire — the TS protocol mirror locks the camelCase contract.
1772
1823
  */
1773
- 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 } };
1824
+ 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 } };
1774
1825
 
1775
1826
  /**
1776
1827
  * Track J — wire-shape mirror of `paged_model::PathAnchor`. The
@@ -1480,12 +1480,12 @@ function __wbg_get_imports() {
1480
1480
  arg0.writeTexture(arg1, getArrayU8FromWasm0(arg2, arg3), arg4, arg5);
1481
1481
  }, arguments); },
1482
1482
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1483
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 4832, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1483
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 4833, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1484
1484
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h84d34b615e684f5e);
1485
1485
  return ret;
1486
1486
  },
1487
1487
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
1488
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 5773, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1488
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 5774, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1489
1489
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hba9dab33e391dce8);
1490
1490
  return ret;
1491
1491
  },
Binary file