@paged-media/canvas-wasm 0.71.7 → 0.71.9

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.71.7",
3
+ "version": "0.71.9",
4
4
  "type": "module",
5
5
  "main": "paged_canvas_wasm.js",
6
6
  "types": "paged_canvas_wasm.d.ts",
@@ -759,7 +759,9 @@ export interface HitResult {
759
759
  bounds?: [number, number, number, number] | null;
760
760
  /**
761
761
  * Phase A — composed affine `[a, b, c, d, tx, ty]` on the hit
762
- * element. `None` for items with no `ItemTransform`.
762
+ * element, into the hit page\'s space like `frame_bounds` (the
763
+ * page\'s origin inside its spread folded in). `None` for an item
764
+ * with no `ItemTransform` on a page at its spread\'s origin.
763
765
  */
764
766
  itemTransform?: [number, number, number, number, number, number] | null;
765
767
  /**
@@ -1135,8 +1137,9 @@ export type GestureHandle = number;
1135
1137
  /**
1136
1138
  * Oriented geometry for one selected element. `bounds` is the raw
1137
1139
  * `GeometricBounds` (content-box space); `item_transform` is the
1138
- * composed affine. The overlay layer multiplies bounds corners by
1139
- * the transform to draw the oriented selection chrome.
1140
+ * composed affine into the PAGE the element sits on (see
1141
+ * [`Self::item_transform`]). The overlay layer multiplies bounds
1142
+ * corners by the transform to draw the oriented selection chrome.
1140
1143
  */
1141
1144
  export interface ElementGeometryItem {
1142
1145
  id: ElementId;
@@ -1151,7 +1154,8 @@ export interface ElementGeometryItem {
1151
1154
  * grouped something it then could not read back.
1152
1155
  *
1153
1156
  * **The convention `None` carries:** `bounds` + `item_transform`
1154
- * compose against the SPREAD origin rather than a page origin.
1157
+ * compose against the SPREAD origin rather than a page origin (a
1158
+ * page-owned item composes against its page\'s).
1155
1159
  * `spread_id` names which spread, because without it the answer is
1156
1160
  * unusable the moment a document has two.
1157
1161
  *
@@ -1170,9 +1174,23 @@ export interface ElementGeometryItem {
1170
1174
  */
1171
1175
  bounds: [number, number, number, number];
1172
1176
  /**
1173
- * `[a, b, c, d, tx, ty]`.
1177
+ * `[a, b, c, d, tx, ty]`: `bounds` through it lands in the
1178
+ * coordinates of `page_id`\'s page, `(0, 0)` at its top-left — the
1179
+ * space of the hit test\'s `frameBounds`, carets, selection rects and
1180
+ * the inserts. It is the stored `ItemTransform` with the page\'s
1181
+ * origin inside its spread folded in ([`Self::page_origin`]); the two
1182
+ * differ wherever a page does not start at its spread\'s origin (a
1183
+ * verso, every page of an InDesign document). `moveFrame` takes it
1184
+ * back in the same space. A pageless item answers in spread space.
1174
1185
  */
1175
1186
  itemTransform?: [number, number, number, number, number, number] | null;
1187
+ /**
1188
+ * The page\'s origin inside its spread, `[x, y]` in spread
1189
+ * coordinates; `None` for a pageless item and a table cell. The
1190
+ * stored `ItemTransform` (what the `frameTransform` property reads
1191
+ * and writes) is `translate(page_origin) ∘ item_transform`. Additive.
1192
+ */
1193
+ pageOrigin?: [number, number];
1176
1194
  /**
1177
1195
  * Phase F — `true` when this element hosts a placed image
1178
1196
  * (`Rectangle` with `<Image>` / `<EPSImage>` / `<PDF>` /
@@ -1791,6 +1809,13 @@ export interface PageSummary {
1791
1809
  * 1-based index — what the user types in \"Go to page #\".
1792
1810
  */
1793
1811
  index: number;
1812
+ /**
1813
+ * The page\'s name as InDesign gives it: its folio, the label a
1814
+ * page-number marker on it prints (`\"3\"`, `\"iv\"`, `\"A-2\"`) — the
1815
+ * baked `Name` of a page InDesign wrote, else the number the section
1816
+ * rules give it where it stands. Never the page\'s id. Additive.
1817
+ */
1818
+ name?: string;
1794
1819
  /**
1795
1820
  * `[width, height]` in points.
1796
1821
  */
@@ -1894,8 +1919,10 @@ export interface LinkSummary {
1894
1919
  /**
1895
1920
  * SDK Phase 5 (v1 sweep) — one spread summary. Backs
1896
1921
  * `documentCollection:spreads`. `pageCount` is the number of
1897
- * `<Page>` children in the spread; `label` is the spread\'s
1898
- * `Self` id (or filename when missing).
1922
+ * `<Page>` children in the spread; `label` is what InDesign\'s Pages
1923
+ * panel shows for it, its pages\' folios (`\"3\"`, `\"2–3\"`, see
1924
+ * [`PageSummary::name`]) — the spread\'s `Self` id (or filename) only
1925
+ * when it has no built page.
1899
1926
  */
1900
1927
  export interface SpreadSummary {
1901
1928
  selfId: string;
@@ -2015,9 +2042,15 @@ export interface PathAnchorsResult {
2015
2042
  */
2016
2043
  subpathOpen?: boolean[];
2017
2044
  /**
2018
- * `[a, b, c, d, tx, ty]`. None ⇒ identity.
2045
+ * `[a, b, c, d, tx, ty]`. None ⇒ identity. Into the PAGE the path
2046
+ * sits on, the page\'s origin folded in, exactly as
2047
+ * [`ElementGeometryItem::item_transform`].
2019
2048
  */
2020
2049
  itemTransform?: [number, number, number, number, number, number] | null;
2050
+ /**
2051
+ * See [`ElementGeometryItem::page_origin`]. Additive.
2052
+ */
2053
+ pageOrigin?: [number, number];
2021
2054
  }
2022
2055
 
2023
2056
  /**
@@ -1655,12 +1655,12 @@ function __wbg_get_imports() {
1655
1655
  arg0.writeTexture(arg1, getArrayU8FromWasm0(arg2, arg3), arg4, arg5);
1656
1656
  }, arguments); },
1657
1657
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
1658
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 5530, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1658
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 5570, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1659
1659
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h90756ddb99d2201d);
1660
1660
  return ret;
1661
1661
  },
1662
1662
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
1663
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 6811, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1663
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 6853, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1664
1664
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h78ff2cea7266d1aa);
1665
1665
  return ret;
1666
1666
  },
Binary file