@shotstack/schemas 1.10.8 → 1.10.10

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.
@@ -2846,6 +2846,11 @@
2846
2846
  "type": "number",
2847
2847
  "minimum": 0,
2848
2848
  "example": 5
2849
+ },
2850
+ "wrap": {
2851
+ "description": "Not supported on legacy `text` assets. Accepted here only so validators can emit a clear migration error pointing users to `rich-text` or `rich-caption`, which support background wrapping natively.",
2852
+ "type": "boolean",
2853
+ "example": false
2849
2854
  }
2850
2855
  },
2851
2856
  "additionalProperties": false,
package/dist/schema.d.ts CHANGED
@@ -1549,6 +1549,11 @@ export interface components {
1549
1549
  * @example 5
1550
1550
  */
1551
1551
  borderRadius?: number;
1552
+ /**
1553
+ * @description Not supported on legacy `text` assets. Accepted here only so validators can emit a clear migration error pointing users to `rich-text` or `rich-caption`, which support background wrapping natively.
1554
+ * @example false
1555
+ */
1556
+ wrap?: boolean;
1552
1557
  };
1553
1558
  /** @description Horizontal and vertical alignment properties for text. */
1554
1559
  TextAlignment: {
@@ -1710,7 +1710,8 @@ exports.textpropertiesTextBackgroundSchema = zod_1.z.object({
1710
1710
  if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
1711
1711
  return v;
1712
1712
  return Number(v);
1713
- } return v; }), zod_1.z.number().gte(0)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
1713
+ } return v; }), zod_1.z.number().gte(0)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
1714
+ wrap: zod_1.z.optional(zod_1.z.boolean())
1714
1715
  }).strict();
1715
1716
  exports.textBackgroundSchema = exports.textpropertiesTextBackgroundSchema;
1716
1717
  /**
@@ -1790,7 +1791,15 @@ exports.textassetTextAssetSchema = zod_1.z.object({
1790
1791
  stroke: zod_1.z.optional(exports.textpropertiesTextStrokeSchema),
1791
1792
  animation: zod_1.z.optional(exports.textpropertiesTextAnimationSchema),
1792
1793
  ellipsis: zod_1.z.optional(zod_1.z.string())
1793
- }).strict();
1794
+ }).strict().superRefine((data, ctx) => {
1795
+ if (data.background && data.background.wrap === true) {
1796
+ ctx.addIssue({
1797
+ code: zod_1.z.ZodIssueCode.custom,
1798
+ message: "background.wrap is only supported on rich-text and rich-caption assets. For type \"text\", migrate to type \"rich-text\" to use this feature.",
1799
+ path: ["background", "wrap"],
1800
+ });
1801
+ }
1802
+ });
1794
1803
  exports.textAssetSchema = exports.textassetTextAssetSchema;
1795
1804
  /**
1796
1805
  * The TextToImageAsset lets you create a dynamic image from a text prompt.