@twick/video-editor 0.15.23 → 0.15.25

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/index.mjs CHANGED
@@ -6863,8 +6863,6 @@ const DEFAULT_CAPTION_PROPS = {
6863
6863
  fill: "#FFFFFF",
6864
6864
  /** Font weight */
6865
6865
  fontWeight: 600,
6866
- /** Text stroke color */
6867
- stroke: "#000000",
6868
6866
  /** Stroke line width */
6869
6867
  lineWidth: 0.2,
6870
6868
  /** Shadow color */
@@ -7592,7 +7590,7 @@ const addTextElement = ({
7592
7590
  splitByGrapheme: false,
7593
7591
  textAlign: ((_q = element.props) == null ? void 0 : _q.textAlign) || "center",
7594
7592
  stroke: ((_r2 = element.props) == null ? void 0 : _r2.stroke) || DEFAULT_TEXT_PROPS.stroke,
7595
- strokeWidth: ((_s2 = element.props) == null ? void 0 : _s2.lineWidth) || DEFAULT_TEXT_PROPS.lineWidth,
7593
+ strokeWidth: (((_s2 = element.props) == null ? void 0 : _s2.lineWidth) || DEFAULT_TEXT_PROPS.lineWidth) * 0.025,
7596
7594
  ...backgroundColor && { backgroundColor },
7597
7595
  shadow: ((_t2 = element.props) == null ? void 0 : _t2.shadowColor) ? new Ds({
7598
7596
  offsetX: ((_v = (_u = element.props) == null ? void 0 : _u.shadowOffset) == null ? void 0 : _v.length) && ((_x = (_w = element.props) == null ? void 0 : _w.shadowOffset) == null ? void 0 : _x.length) > 1 ? element.props.shadowOffset[0] / 2 : 1,
@@ -7664,19 +7662,23 @@ const addCaptionElement = ({
7664
7662
  }
7665
7663
  const elementColors = (_g = element.props) == null ? void 0 : _g.colors;
7666
7664
  const resolvedFill = (applyToAll ? captionTextColor : ((_h2 = element.props) == null ? void 0 : _h2.fill) ?? (elementColors == null ? void 0 : elementColors.text) ?? captionTextColor) ?? DEFAULT_CAPTION_PROPS.fill;
7667
- const caption = new Uo(((_i2 = element.props) == null ? void 0 : _i2.text) || element.t || "", {
7665
+ const trackColors = captionProps == null ? void 0 : captionProps.colors;
7666
+ const trackStroke = trackColors == null ? void 0 : trackColors.outlineColor;
7667
+ const elementStroke = (elementColors == null ? void 0 : elementColors.outlineColor) ?? ((_i2 = element.props) == null ? void 0 : _i2.stroke);
7668
+ const resolvedStroke = (applyToAll ? trackStroke ?? elementStroke : elementStroke ?? trackStroke) ?? void 0;
7669
+ const caption = new Uo(((_j = element.props) == null ? void 0 : _j.text) || element.t || "", {
7668
7670
  left: x2,
7669
7671
  top: y2,
7670
7672
  originX: "center",
7671
7673
  originY: "center",
7672
- angle: ((_j = element.props) == null ? void 0 : _j.rotation) || 0,
7674
+ angle: ((_k = element.props) == null ? void 0 : _k.rotation) || 0,
7673
7675
  fontSize: Math.round(
7674
- ((applyToAll ? (_k = captionProps == null ? void 0 : captionProps.font) == null ? void 0 : _k.size : ((_m = (_l = element.props) == null ? void 0 : _l.font) == null ? void 0 : _m.size) ?? ((_n2 = captionProps == null ? void 0 : captionProps.font) == null ? void 0 : _n2.size)) ?? DEFAULT_CAPTION_PROPS.size) * canvasMetadata.scaleX
7676
+ ((applyToAll ? (_l = captionProps == null ? void 0 : captionProps.font) == null ? void 0 : _l.size : ((_n2 = (_m = element.props) == null ? void 0 : _m.font) == null ? void 0 : _n2.size) ?? ((_o2 = captionProps == null ? void 0 : captionProps.font) == null ? void 0 : _o2.size)) ?? DEFAULT_CAPTION_PROPS.size) * canvasMetadata.scaleX
7675
7677
  ),
7676
- fontFamily: (applyToAll ? (_o2 = captionProps == null ? void 0 : captionProps.font) == null ? void 0 : _o2.family : ((_q = (_p = element.props) == null ? void 0 : _p.font) == null ? void 0 : _q.family) ?? ((_r2 = captionProps == null ? void 0 : captionProps.font) == null ? void 0 : _r2.family)) ?? DEFAULT_CAPTION_PROPS.family,
7678
+ fontFamily: (applyToAll ? (_p = captionProps == null ? void 0 : captionProps.font) == null ? void 0 : _p.family : ((_r2 = (_q = element.props) == null ? void 0 : _q.font) == null ? void 0 : _r2.family) ?? ((_s2 = captionProps == null ? void 0 : captionProps.font) == null ? void 0 : _s2.family)) ?? DEFAULT_CAPTION_PROPS.family,
7677
7679
  fill: resolvedFill,
7678
- fontWeight: (applyToAll ? (_s2 = captionProps == null ? void 0 : captionProps.font) == null ? void 0 : _s2.weight : ((_u = (_t2 = element.props) == null ? void 0 : _t2.font) == null ? void 0 : _u.weight) ?? ((_v = captionProps == null ? void 0 : captionProps.font) == null ? void 0 : _v.weight)) ?? DEFAULT_CAPTION_PROPS.fontWeight,
7679
- stroke: (applyToAll ? captionProps == null ? void 0 : captionProps.stroke : ((_w = element.props) == null ? void 0 : _w.stroke) ?? (captionProps == null ? void 0 : captionProps.stroke)) ?? DEFAULT_CAPTION_PROPS.stroke,
7680
+ fontWeight: (applyToAll ? (_t2 = captionProps == null ? void 0 : captionProps.font) == null ? void 0 : _t2.weight : ((_v = (_u = element.props) == null ? void 0 : _u.font) == null ? void 0 : _v.weight) ?? ((_w = captionProps == null ? void 0 : captionProps.font) == null ? void 0 : _w.weight)) ?? DEFAULT_CAPTION_PROPS.fontWeight,
7681
+ ...resolvedStroke ? { stroke: resolvedStroke } : {},
7680
7682
  opacity: (applyToAll ? captionProps == null ? void 0 : captionProps.opacity : ((_x = element.props) == null ? void 0 : _x.opacity) ?? (captionProps == null ? void 0 : captionProps.opacity)) ?? 1,
7681
7683
  width,
7682
7684
  splitByGrapheme: false,
@@ -7687,7 +7689,7 @@ const addCaptionElement = ({
7687
7689
  blur: (applyToAll ? captionProps == null ? void 0 : captionProps.shadowBlur : ((_J = element.props) == null ? void 0 : _J.shadowBlur) ?? (captionProps == null ? void 0 : captionProps.shadowBlur)) ?? DEFAULT_CAPTION_PROPS.shadowBlur,
7688
7690
  color: (applyToAll ? captionProps == null ? void 0 : captionProps.shadowColor : ((_K = element.props) == null ? void 0 : _K.shadowColor) ?? (captionProps == null ? void 0 : captionProps.shadowColor)) ?? DEFAULT_CAPTION_PROPS.shadowColor
7689
7691
  }),
7690
- strokeWidth: (applyToAll ? captionProps == null ? void 0 : captionProps.lineWidth : ((_L = element.props) == null ? void 0 : _L.lineWidth) ?? (captionProps == null ? void 0 : captionProps.lineWidth)) ?? DEFAULT_CAPTION_PROPS.lineWidth
7692
+ strokeWidth: ((applyToAll ? captionProps == null ? void 0 : captionProps.lineWidth : ((_L = element.props) == null ? void 0 : _L.lineWidth) ?? (captionProps == null ? void 0 : captionProps.lineWidth)) ?? DEFAULT_CAPTION_PROPS.lineWidth) * 0.025
7691
7693
  });
7692
7694
  caption.set("id", element.id);
7693
7695
  caption.set("zIndex", index);