@paged-media/idml-viewer 0.44.1 → 0.46.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paged-media/idml-viewer",
3
- "version": "0.44.1",
3
+ "version": "0.46.0",
4
4
  "description": "Standalone IDML viewer for the browser — camera, pages, input and events over the @paged-media/sdk WebGPU ViewerSession.",
5
5
  "license": "MPL-2.0 OR LicenseRef-PMEL",
6
6
  "repository": {
@@ -5,6 +5,24 @@
5
5
  */
6
6
  export type ScenePathSeg = { op: "moveTo"; x: number; y: number } | { op: "lineTo"; x: number; y: number } | { op: "cubicTo"; cx1: number; cy1: number; cx2: number; cy2: number; x: number; y: number } | { op: "close" };
7
7
 
8
+ /**
9
+ * A compositing blend mode for [`SceneItem::FillPathBlend`] (C-1.4).
10
+ * Mirrors the CSS-relevant subset of the display list\'s
11
+ * [`BlendMode`] — `Normal` is intentionally absent (a normal fill is
12
+ * just [`SceneItem::FillPath`]). Maps 1:1 to [`BlendMode`] at
13
+ * lowering, so a plugin\'s `mix-blend-mode` composites identically to
14
+ * a native IDML transparency blend.
15
+ */
16
+ export type SceneBlendMode = "multiply" | "screen" | "overlay" | "darken" | "lighten" | "colorDodge" | "colorBurn" | "hardLight" | "softLight" | "difference" | "exclusion" | "hue" | "saturation" | "color" | "luminosity";
17
+
18
+ /**
19
+ * A plugin gradient paint for [`SceneItem::FillPathGradient`] (C-1.3).
20
+ * Coordinates are frame-content points (mapped by the frame transform
21
+ * like the filled path). Colours are sRGB, linearised at lowering to
22
+ * composite identically to document colours.
23
+ */
24
+ export type SceneGradient = { type: "linear"; x0: number; y0: number; x1: number; y1: number; stops: SceneGradientStop[] } | { type: "radial"; cx: number; cy: number; radius: number; stops: SceneGradientStop[] } | { type: "sweep"; cx: number; cy: number; start_angle: number; stops: SceneGradientStop[] };
25
+
8
26
  /**
9
27
  * A plugin-submitted vector layer in frame-content coordinates. Keyed
10
28
  * (on the wire) by the host element id of the frame it renders into.
@@ -65,10 +83,22 @@ export interface PagesLayout {
65
83
  pages: PageRect[];
66
84
  }
67
85
 
86
+ /**
87
+ * One colour stop in a [`SceneGradient`]. `offset` is `0.0..=1.0` along
88
+ * the gradient axis; the colour is sRGB (linearised at lowering).
89
+ */
90
+ export interface SceneGradientStop {
91
+ offset: number;
92
+ r: number;
93
+ g: number;
94
+ b: number;
95
+ a: number;
96
+ }
97
+
68
98
  /**
69
99
  * One drawable in a [`SceneLayer`]. Coordinates are frame-content points.
70
100
  */
71
- export type SceneItem = { kind: "fillPath"; path: ScenePathSeg[]; paint: ScenePaint } | { kind: "strokePath"; path: ScenePathSeg[]; paint: ScenePaint; width: number } | ({ kind: "text" } & SceneTextItem) | { kind: "image"; rgba: number[]; width: number; height: number; x: number; y: number; w: number; h: number };
101
+ export type SceneItem = { kind: "fillPath"; path: ScenePathSeg[]; paint: ScenePaint } | { kind: "strokePath"; path: ScenePathSeg[]; paint: ScenePaint; width: number } | ({ kind: "text" } & SceneTextItem) | { kind: "image"; rgba: number[]; width: number; height: number; x: number; y: number; w: number; h: number } | { kind: "fillPathGradient"; path: ScenePathSeg[]; gradient: SceneGradient } | { kind: "fillPathBlend"; path: ScenePathSeg[]; paint: ScenePaint; blend: SceneBlendMode } | { kind: "dropShadow"; path: ScenePathSeg[]; offset_x: number; offset_y: number; blur_radius: number; r: number; g: number; b: number; a: number };
72
102
 
73
103
  /**
74
104
  * Stable page identity, independent of position in the page vector.
package/wasm/paged_sdk.js CHANGED
@@ -1348,7 +1348,7 @@ function __wbg_get_imports() {
1348
1348
  arg0.writeTexture(arg1, getArrayU8FromWasm0(arg2, arg3), arg4, arg5);
1349
1349
  }, arguments); },
1350
1350
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1351
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1713, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1351
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1719, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1352
1352
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h0cde11723d429dba);
1353
1353
  return ret;
1354
1354
  },
Binary file