@paged-media/canvas-wasm 0.45.0 → 0.47.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/canvas-wasm",
3
- "version": "0.45.0",
3
+ "version": "0.47.0",
4
4
  "type": "module",
5
5
  "main": "paged_canvas_wasm.js",
6
6
  "types": "paged_canvas_wasm.d.ts",
@@ -28,6 +28,16 @@ export type ScenePathSeg = { op: "moveTo"; x: number; y: number } | { op: "lineT
28
28
  */
29
29
  export type ByteBuf = number[];
30
30
 
31
+ /**
32
+ * A compositing blend mode for [`SceneItem::FillPathBlend`] (C-1.4).
33
+ * Mirrors the CSS-relevant subset of the display list\'s
34
+ * [`BlendMode`] — `Normal` is intentionally absent (a normal fill is
35
+ * just [`SceneItem::FillPath`]). Maps 1:1 to [`BlendMode`] at
36
+ * lowering, so a plugin\'s `mix-blend-mode` composites identically to
37
+ * a native IDML transparency blend.
38
+ */
39
+ export type SceneBlendMode = "multiply" | "screen" | "overlay" | "darken" | "lighten" | "colorDodge" | "colorBurn" | "hardLight" | "softLight" | "difference" | "exclusion" | "hue" | "saturation" | "color" | "luminosity";
40
+
31
41
  /**
32
42
  * A content-space mutation. Phase 1 carries the *envelope* only —
33
43
  * the worker rejects each variant with `WorkerError::NotImplemented`.
@@ -41,7 +51,7 @@ export type Mutation = { op: "insertText"; args: { storyId: string; offset: numb
41
51
  * like the filled path). Colours are sRGB, linearised at lowering to
42
52
  * composite identically to document colours.
43
53
  */
44
- 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[] };
54
+ 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[] };
45
55
 
46
56
  /**
47
57
  * A plugin-submitted vector layer in frame-content coordinates. Keyed
@@ -605,7 +615,7 @@ export interface SceneGradientStop {
605
615
  /**
606
616
  * One drawable in a [`SceneLayer`]. Coordinates are frame-content points.
607
617
  */
608
- 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 };
618
+ 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 } | { kind: "innerShadow"; path: ScenePathSeg[]; offset_x: number; offset_y: number; blur_radius: number; choke: number; r: number; g: number; b: number; a: number };
609
619
 
610
620
  /**
611
621
  * One entry in the field diff: a field whose resolved text
@@ -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: 3468, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1483
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 3477, 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: 4929, 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: 4938, 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