@oim-media/core 1.31.0 → 1.32.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/dist/schema.js CHANGED
@@ -488,9 +488,13 @@ export const styleSchema = z.object({
488
488
  innerStrokeWidth: z.number().min(0).optional(),
489
489
  // Mask and cut-out
490
490
  maskMode: z.enum(["window", "cutout"]).optional(),
491
+ // The twelve frame shapes join the eleven 1.x values. Kept as literals, like
492
+ // geoShape above; schema-frame-shapes.test.ts fails if one drifts from FRAME_SHAPES.
491
493
  maskShape: z.enum([
492
494
  "circle", "rectangle", "triangle", "star", "line", "arrow",
493
- "diamond", "hexagon", "heart", "blob", "custom"
495
+ "diamond", "hexagon", "heart", "blob", "custom",
496
+ "pill", "octagon", "pentagon", "cross", "moon", "cloud", "drop",
497
+ "bolt", "bubble", "flower", "burst", "arch",
494
498
  ]).optional(),
495
499
  maskBgColor: cssColor.optional(),
496
500
  maskStrokeColor: cssColor.optional(),
@@ -97,6 +97,11 @@ function shapeGeometry(ctx, slot, media) {
97
97
  const parsed = svgToPaths(xml);
98
98
  if (parsed.ok)
99
99
  return { kind: "paths", ...parsed.value };
100
+ // The editor bakes a gradient or pattern fill into the content (<defs>, url()); the original
101
+ // drawing is still svgRawXml, and the fill travels as the layer's own.
102
+ const original = xml !== rawXml && typeof rawXml === "string" && rawXml ? svgToPaths(rawXml) : undefined;
103
+ if (original?.ok)
104
+ return { kind: "paths", ...original.value };
100
105
  ctx.note(`style.svgRawXml: ${parsed.reason}`);
101
106
  return { kind: "rect" };
102
107
  }
@@ -56,7 +56,11 @@ export function convertMask(ctx, slot, layer) {
56
56
  const value = isColor(literal) ? literal : fallback;
57
57
  return typeof role === "string" && ctx.hasRole(role) ? { var: role, fallback: value } : value;
58
58
  };
59
- layer.fills = [{ kind: "color", value: color(bgRole || style.fillColorRole, bgLiteral, "#38BDF8") }];
59
+ // convertPaints already read a gradient, photo or pattern fill: it wins over the 1.x colour.
60
+ const own = layer.fills?.[0];
61
+ const kept = own !== undefined && "kind" in own && own.kind !== "color";
62
+ if (!kept)
63
+ layer.fills = [{ kind: "color", value: color(bgRole || style.fillColorRole, bgLiteral, "#38BDF8") }];
60
64
  delete layer.strokes;
61
65
  if (typeof strokeWidth === "number" && strokeWidth > 0) {
62
66
  layer.strokes = [{ paint: { kind: "color", value: color(strokeRole || style.strokeColorRole, strokeLiteral, "#FFFFFF") }, width: strokeWidth }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oim-media/core",
3
- "version": "1.31.0",
3
+ "version": "1.32.1",
4
4
  "description": "Core of the OIM format: the contract schema, binary extraction from PNG and the shared rendering logic used by every OIM player.",
5
5
  "keywords": [
6
6
  "oim",