motion-dom 12.42.1 → 12.42.2

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.
@@ -1,3 +1,5 @@
1
+ import { cornerRadiusProps } from '../../../utils/border-radius.mjs';
2
+
1
3
  const pxValues = new Set([
2
4
  // Border props
3
5
  "borderWidth",
@@ -6,10 +8,7 @@ const pxValues = new Set([
6
8
  "borderBottomWidth",
7
9
  "borderLeftWidth",
8
10
  "borderRadius",
9
- "borderTopLeftRadius",
10
- "borderTopRightRadius",
11
- "borderBottomRightRadius",
12
- "borderBottomLeftRadius",
11
+ ...cornerRadiusProps,
13
12
  // Positioning props
14
13
  "width",
15
14
  "maxWidth",
@@ -1 +1 @@
1
- {"version":3,"file":"px-values.mjs","sources":["../../../../../src/animation/waapi/utils/px-values.ts"],"sourcesContent":["export const pxValues = new Set([\n // Border props\n \"borderWidth\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderRadius\",\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n // Positioning props\n \"width\",\n \"maxWidth\",\n \"height\",\n \"maxHeight\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"inset\",\n \"insetBlock\",\n \"insetBlockStart\",\n \"insetBlockEnd\",\n \"insetInline\",\n \"insetInlineStart\",\n \"insetInlineEnd\",\n // Spacing props\n \"padding\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"paddingBlock\",\n \"paddingBlockStart\",\n \"paddingBlockEnd\",\n \"paddingInline\",\n \"paddingInlineStart\",\n \"paddingInlineEnd\",\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n \"marginBlock\",\n \"marginBlockStart\",\n \"marginBlockEnd\",\n \"marginInline\",\n \"marginInlineStart\",\n \"marginInlineEnd\",\n // Typography\n \"fontSize\",\n // Misc\n \"backgroundPositionX\",\n \"backgroundPositionY\",\n])\n"],"names":[],"mappings":"AAAO,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;;IAE5B,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,cAAc;IACd,qBAAqB;IACrB,sBAAsB;IACtB,yBAAyB;IACzB,wBAAwB;;IAExB,OAAO;IACP,UAAU;IACV,QAAQ;IACR,WAAW;IACX,KAAK;IACL,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,YAAY;IACZ,iBAAiB;IACjB,eAAe;IACf,aAAa;IACb,kBAAkB;IAClB,gBAAgB;;IAEhB,SAAS;IACT,YAAY;IACZ,cAAc;IACd,eAAe;IACf,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,iBAAiB;IACjB,eAAe;IACf,oBAAoB;IACpB,kBAAkB;IAClB,QAAQ;IACR,WAAW;IACX,aAAa;IACb,cAAc;IACd,YAAY;IACZ,aAAa;IACb,kBAAkB;IAClB,gBAAgB;IAChB,cAAc;IACd,mBAAmB;IACnB,iBAAiB;;IAEjB,UAAU;;IAEV,qBAAqB;IACrB,qBAAqB;AACxB,CAAA;;;;"}
1
+ {"version":3,"file":"px-values.mjs","sources":["../../../../../src/animation/waapi/utils/px-values.ts"],"sourcesContent":["import { cornerRadiusProps } from \"../../../utils/border-radius\"\n\nexport const pxValues = new Set([\n // Border props\n \"borderWidth\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderRadius\",\n ...cornerRadiusProps,\n // Positioning props\n \"width\",\n \"maxWidth\",\n \"height\",\n \"maxHeight\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"inset\",\n \"insetBlock\",\n \"insetBlockStart\",\n \"insetBlockEnd\",\n \"insetInline\",\n \"insetInlineStart\",\n \"insetInlineEnd\",\n // Spacing props\n \"padding\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"paddingBlock\",\n \"paddingBlockStart\",\n \"paddingBlockEnd\",\n \"paddingInline\",\n \"paddingInlineStart\",\n \"paddingInlineEnd\",\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n \"marginBlock\",\n \"marginBlockStart\",\n \"marginBlockEnd\",\n \"marginInline\",\n \"marginInlineStart\",\n \"marginInlineEnd\",\n // Typography\n \"fontSize\",\n // Misc\n \"backgroundPositionX\",\n \"backgroundPositionY\",\n])\n"],"names":[],"mappings":";;AAEO,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;;IAE5B,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,cAAc;AACd,IAAA,GAAG,iBAAiB;;IAEpB,OAAO;IACP,UAAU;IACV,QAAQ;IACR,WAAW;IACX,KAAK;IACL,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,YAAY;IACZ,iBAAiB;IACjB,eAAe;IACf,aAAa;IACb,kBAAkB;IAClB,gBAAgB;;IAEhB,SAAS;IACT,YAAY;IACZ,cAAc;IACd,eAAe;IACf,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,iBAAiB;IACjB,eAAe;IACf,oBAAoB;IACpB,kBAAkB;IAClB,QAAQ;IACR,WAAW;IACX,aAAa;IACb,cAAc;IACd,YAAY;IACZ,aAAa;IACb,kBAAkB;IAClB,gBAAgB;IAChB,cAAc;IACd,mBAAmB;IACnB,iBAAiB;;IAEjB,UAAU;;IAEV,qBAAqB;IACrB,qBAAqB;AACxB,CAAA;;;;"}
@@ -1,14 +1,9 @@
1
1
  import { mixNumber } from '../../utils/mix/number.mjs';
2
2
  import { percent, px } from '../../value/types/numbers/units.mjs';
3
3
  import { progress, circOut, noop } from 'motion-utils';
4
+ import { cornerRadiusProps } from '../../utils/border-radius.mjs';
4
5
 
5
- const borderLabels = [
6
- "borderTopLeftRadius",
7
- "borderTopRightRadius",
8
- "borderBottomLeftRadius",
9
- "borderBottomRightRadius",
10
- ];
11
- const numBorders = borderLabels.length;
6
+ const numBorders = cornerRadiusProps.length;
12
7
  const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value;
13
8
  const isPx = (value) => typeof value === "number" || px.test(value);
14
9
  function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {
@@ -23,7 +18,7 @@ function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnl
23
18
  * Mix border radius
24
19
  */
25
20
  for (let i = 0; i < numBorders; i++) {
26
- const borderLabel = borderLabels[i];
21
+ const borderLabel = cornerRadiusProps[i];
27
22
  let followRadius = getRadius(follow, borderLabel);
28
23
  let leadRadius = getRadius(lead, borderLabel);
29
24
  if (followRadius === undefined && leadRadius === undefined)
@@ -1 +1 @@
1
- {"version":3,"file":"mix-values.mjs","sources":["../../../../src/projection/animation/mix-values.ts"],"sourcesContent":["import { mixNumber } from \"../../utils/mix/number\"\nimport { percent, px } from \"../../value/types/numbers/units\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport {\n progress as calcProgress,\n circOut,\n EasingFunction,\n noop,\n} from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\n\nconst borderLabels = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n]\nconst numBorders = borderLabels.length\n\nconst asNumber = (value: AnyResolvedKeyframe) =>\n typeof value === \"string\" ? parseFloat(value) : value\n\nconst isPx = (value: AnyResolvedKeyframe) =>\n typeof value === \"number\" || px.test(value)\n\nexport function mixValues(\n target: ResolvedValues,\n follow: ResolvedValues,\n lead: ResolvedValues,\n progress: number,\n shouldCrossfadeOpacity: boolean,\n isOnlyMember: boolean\n) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(\n 0,\n (lead.opacity as number) ?? 1,\n easeCrossfadeIn(progress)\n )\n target.opacityExit = mixNumber(\n (follow.opacity as number) ?? 1,\n 0,\n easeCrossfadeOut(progress)\n )\n } else if (isOnlyMember) {\n target.opacity = mixNumber(\n (follow.opacity as number) ?? 1,\n (lead.opacity as number) ?? 1,\n progress\n )\n }\n\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = borderLabels[i]\n let followRadius = getRadius(follow, borderLabel)\n let leadRadius = getRadius(lead, borderLabel)\n\n if (followRadius === undefined && leadRadius === undefined) continue\n\n followRadius ||= 0\n leadRadius ||= 0\n\n const canMix =\n followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius)\n\n if (canMix) {\n target[borderLabel] = Math.max(\n mixNumber(\n asNumber(followRadius),\n asNumber(leadRadius),\n progress\n ),\n 0\n )\n\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\"\n }\n } else {\n target[borderLabel] = leadRadius\n }\n }\n\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(\n (follow.rotate as number) || 0,\n (lead.rotate as number) || 0,\n progress\n )\n }\n}\n\nfunction getRadius(values: ResolvedValues, radiusName: string) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius\n}\n\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut)\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop)\n\nfunction compress(\n min: number,\n max: number,\n easing: EasingFunction\n): EasingFunction {\n return (p: number) => {\n // Could replace ifs with clamp\n if (p < min) return 0\n if (p > max) return 1\n return easing(calcProgress(min, max, p))\n }\n}\n"],"names":["calcProgress"],"mappings":";;;;AAWA,MAAM,YAAY,GAAG;IACjB,qBAAqB;IACrB,sBAAsB;IACtB,wBAAwB;IACxB,yBAAyB;CAC5B;AACD,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM;AAEtC,MAAM,QAAQ,GAAG,CAAC,KAA0B,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GAAG;AAAE,YAAA,OAAO,CAAC;QACrB,OAAO,MAAM,CAACA,QAAY,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AAC5C,IAAA,CAAC;AACL;;;;"}
1
+ {"version":3,"file":"mix-values.mjs","sources":["../../../../src/projection/animation/mix-values.ts"],"sourcesContent":["import { mixNumber } from \"../../utils/mix/number\"\nimport { percent, px } from \"../../value/types/numbers/units\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport {\n progress as calcProgress,\n circOut,\n EasingFunction,\n noop,\n} from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\nimport { cornerRadiusProps } from \"../../utils/border-radius\"\n\nconst numBorders = cornerRadiusProps.length\n\nconst asNumber = (value: AnyResolvedKeyframe) =>\n typeof value === \"string\" ? parseFloat(value) : value\n\nconst isPx = (value: AnyResolvedKeyframe) =>\n typeof value === \"number\" || px.test(value)\n\nexport function mixValues(\n target: ResolvedValues,\n follow: ResolvedValues,\n lead: ResolvedValues,\n progress: number,\n shouldCrossfadeOpacity: boolean,\n isOnlyMember: boolean\n) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(\n 0,\n (lead.opacity as number) ?? 1,\n easeCrossfadeIn(progress)\n )\n target.opacityExit = mixNumber(\n (follow.opacity as number) ?? 1,\n 0,\n easeCrossfadeOut(progress)\n )\n } else if (isOnlyMember) {\n target.opacity = mixNumber(\n (follow.opacity as number) ?? 1,\n (lead.opacity as number) ?? 1,\n progress\n )\n }\n\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = cornerRadiusProps[i]\n let followRadius = getRadius(follow, borderLabel)\n let leadRadius = getRadius(lead, borderLabel)\n\n if (followRadius === undefined && leadRadius === undefined) continue\n\n followRadius ||= 0\n leadRadius ||= 0\n\n const canMix =\n followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius)\n\n if (canMix) {\n target[borderLabel] = Math.max(\n mixNumber(\n asNumber(followRadius),\n asNumber(leadRadius),\n progress\n ),\n 0\n )\n\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\"\n }\n } else {\n target[borderLabel] = leadRadius\n }\n }\n\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(\n (follow.rotate as number) || 0,\n (lead.rotate as number) || 0,\n progress\n )\n }\n}\n\nfunction getRadius(values: ResolvedValues, radiusName: string) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius\n}\n\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut)\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop)\n\nfunction compress(\n min: number,\n max: number,\n easing: EasingFunction\n): EasingFunction {\n return (p: number) => {\n // Could replace ifs with clamp\n if (p < min) return 0\n if (p > max) return 1\n return easing(calcProgress(min, max, p))\n }\n}\n"],"names":["calcProgress"],"mappings":";;;;;AAYA,MAAM,UAAU,GAAG,iBAAiB,CAAC,MAAM;AAE3C,MAAM,QAAQ,GAAG,CAAC,KAA0B,KACxC,OAAO,KAAK,KAAK,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,KAAK;AAEzD,MAAM,IAAI,GAAG,CAAC,KAA0B,KACpC,OAAO,KAAK,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;AAEzC,SAAU,SAAS,CACrB,MAAsB,EACtB,MAAsB,EACtB,IAAoB,EACpB,QAAgB,EAChB,sBAA+B,EAC/B,YAAqB,EAAA;IAErB,IAAI,sBAAsB,EAAE;AACxB,QAAA,MAAM,CAAC,OAAO,GAAG,SAAS,CACtB,CAAC,EACA,IAAI,CAAC,OAAkB,IAAI,CAAC,EAC7B,eAAe,CAAC,QAAQ,CAAC,CAC5B;AACD,QAAA,MAAM,CAAC,WAAW,GAAG,SAAS,CACzB,MAAM,CAAC,OAAkB,IAAI,CAAC,EAC/B,CAAC,EAC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MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;AAC9B,QAAA,MAAM,CAAC,MAAM,GAAG,SAAS,CACpB,MAAM,CAAC,MAAiB,IAAI,CAAC,EAC7B,IAAI,CAAC,MAAiB,IAAI,CAAC,EAC5B,QAAQ,CACX;IACL;AACJ;AAEA,SAAS,SAAS,CAAC,MAAsB,EAAE,UAAkB,EAAA;AACzD,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK;AAC1B,UAAE,MAAM,CAAC,UAAU;AACnB,UAAE,MAAM,CAAC,YAAY;AAC7B;AAEA,MAAM,eAAe,iBAAiB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC;AAC/D,MAAM,gBAAgB,iBAAiB,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC;AAEhE,SAAS,QAAQ,CACb,GAAW,EACX,GAAW,EACX,MAAsB,EAAA;IAEtB,OAAO,CAAC,CAAS,KAAI;;QAEjB,IAAI,CAAC,GAAG,GAAG;AAAE,YAAA,OAAO,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG;AAAE,YAAA,OAAO,CAAC;QACrB,OAAO,MAAM,CAACA,QAAY,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AAC5C,IAAA,CAAC;AACL;;;;"}
@@ -1,16 +1,12 @@
1
1
  import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';
2
+ import { cornerRadiusProps } from '../../utils/border-radius.mjs';
2
3
  import { correctBorderRadius } from './scale-border-radius.mjs';
3
4
  import { correctBoxShadow } from './scale-box-shadow.mjs';
4
5
 
5
6
  const scaleCorrectors = {
6
7
  borderRadius: {
7
8
  ...correctBorderRadius,
8
- applyTo: [
9
- "borderTopLeftRadius",
10
- "borderTopRightRadius",
11
- "borderBottomLeftRadius",
12
- "borderBottomRightRadius",
13
- ],
9
+ applyTo: [...cornerRadiusProps],
14
10
  },
15
11
  borderTopLeftRadius: correctBorderRadius,
16
12
  borderTopRightRadius: correctBorderRadius,
@@ -1 +1 @@
1
- {"version":3,"file":"scale-correction.mjs","sources":["../../../../src/projection/styles/scale-correction.ts"],"sourcesContent":["import { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport { correctBorderRadius } from \"./scale-border-radius\"\nimport { correctBoxShadow } from \"./scale-box-shadow\"\nimport type { ScaleCorrectorMap } from \"./types\"\n\nexport const scaleCorrectors: ScaleCorrectorMap = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n}\n\nexport function addScaleCorrector(correctors: ScaleCorrectorMap) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key]\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true\n }\n }\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,eAAe,GAAsB;AAC9C,IAAA,YAAY,EAAE;AACV,QAAA,GAAG,mBAAmB;AACtB,QAAA,OAAO,EAAE;YACL,qBAAqB;YACrB,sBAAsB;YACtB,wBAAwB;YACxB,yBAAyB;AAC5B,SAAA;AACJ,KAAA;AACD,IAAA,mBAAmB,EAAE,mBAAmB;AACxC,IAAA,oBAAoB,EAAE,mBAAmB;AACzC,IAAA,sBAAsB,EAAE,mBAAmB;AAC3C,IAAA,uBAAuB,EAAE,mBAAmB;AAC5C,IAAA,SAAS,EAAE,gBAAgB;;AAGzB,SAAU,iBAAiB,CAAC,UAA6B,EAAA;AAC3D,IAAA,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;QAC1B,eAAe,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC;AACtC,QAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE;AACxB,YAAA,eAAe,CAAC,GAAG,CAAC,CAAC,aAAa,GAAG,IAAI;QAC7C;IACJ;AACJ;;;;"}
1
+ {"version":3,"file":"scale-correction.mjs","sources":["../../../../src/projection/styles/scale-correction.ts"],"sourcesContent":["import { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport { cornerRadiusProps } from \"../../utils/border-radius\"\nimport { correctBorderRadius } from \"./scale-border-radius\"\nimport { correctBoxShadow } from \"./scale-box-shadow\"\nimport type { ScaleCorrectorMap } from \"./types\"\n\nexport const scaleCorrectors: ScaleCorrectorMap = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [...cornerRadiusProps],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n}\n\nexport function addScaleCorrector(correctors: ScaleCorrectorMap) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key]\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,eAAe,GAAsB;AAC9C,IAAA,YAAY,EAAE;AACV,QAAA,GAAG,mBAAmB;AACtB,QAAA,OAAO,EAAE,CAAC,GAAG,iBAAiB,CAAC;AAClC,KAAA;AACD,IAAA,mBAAmB,EAAE,mBAAmB;AACxC,IAAA,oBAAoB,EAAE,mBAAmB;AACzC,IAAA,sBAAsB,EAAE,mBAAmB;AAC3C,IAAA,uBAAuB,EAAE,mBAAmB;AAC5C,IAAA,SAAS,EAAE,gBAAgB;;AAGzB,SAAU,iBAAiB,CAAC,UAA6B,EAAA;AAC3D,IAAA,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;QAC1B,eAAe,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC;AACtC,QAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE;AACxB,YAAA,eAAe,CAAC,GAAG,CAAC,CAAC,aAAa,GAAG,IAAI;QAC7C;IACJ;AACJ;;;;"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The four corner-radius longhands. Shared so the projection mixer, scale
3
+ * corrector, WAAPI px-value set and view-transition crop pass don't each carry
4
+ * their own copy. Order is irrelevant - every consumer mixes/corrects/animates
5
+ * each corner independently.
6
+ */
7
+ const cornerRadiusProps = [
8
+ "borderTopLeftRadius",
9
+ "borderTopRightRadius",
10
+ "borderBottomRightRadius",
11
+ "borderBottomLeftRadius",
12
+ ];
13
+
14
+ export { cornerRadiusProps };
15
+ //# sourceMappingURL=border-radius.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"border-radius.mjs","sources":["../../../src/utils/border-radius.ts"],"sourcesContent":["/**\n * The four corner-radius longhands. Shared so the projection mixer, scale\n * corrector, WAAPI px-value set and view-transition crop pass don't each carry\n * their own copy. Order is irrelevant - every consumer mixes/corrects/animates\n * each corner independently.\n */\nexport const cornerRadiusProps = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n] as const\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AACI,MAAM,iBAAiB,GAAG;IAC7B,qBAAqB;IACrB,sBAAsB;IACtB,yBAAyB;IACzB,wBAAwB;;;;;"}
@@ -5,6 +5,7 @@ import { NativeAnimationWrapper } from '../animation/NativeAnimationWrapper.mjs'
5
5
  import { getValueTransition } from '../animation/utils/get-value-transition.mjs';
6
6
  import { mapEasingToNativeEasing } from '../animation/waapi/easing/map-easing.mjs';
7
7
  import { applyGeneratorOptions } from '../animation/waapi/utils/apply-generator.mjs';
8
+ import { cornerRadiusProps } from '../utils/border-radius.mjs';
8
9
  import { resolveElements } from '../utils/resolve-elements.mjs';
9
10
  import { assignViewTransitionNames, releaseViewTransitionNames } from './utils/assign-names.mjs';
10
11
  import { chooseLayerType } from './utils/choose-layer-type.mjs';
@@ -14,6 +15,12 @@ import { getViewAnimations } from './utils/get-view-animations.mjs';
14
15
  import { hasTarget } from './utils/has-target.mjs';
15
16
 
16
17
  const definitionNames = ["layout", "enter", "exit", "new", "old"];
18
+ /**
19
+ * Whether a computed border-radius is square (every component zero). Splitting
20
+ * on whitespace handles two-value/elliptical radii like "0px 20px" - a leading
21
+ * `parseFloat` alone would misread the non-zero vertical radius as square.
22
+ */
23
+ const isSquareRadius = (radius) => radius.split(" ").every((value) => parseFloat(value) === 0);
17
24
  /**
18
25
  * The `ViewTransitionTarget` buckets driving each generated layer type, in
19
26
  * priority order - the inverse of `chooseLayerType`. The new view is driven by
@@ -200,16 +207,48 @@ function startViewAnimation(builder) {
200
207
  return transition;
201
208
  };
202
209
  /**
203
- * Each layer's box size per snapshot, so `finalizeCrop` can tell whether a
204
- * morph's aspect ratio changed (the only case worth cropping).
210
+ * Resolve a layer's group (`layout`) timing to plain WAAPI values: native
211
+ * ms `delay`/`duration` and a baked `ease`. The single source of group
212
+ * timing, shared by the generated-group retiming and the crop corner-radius
213
+ * pass so the rounded clip animates on exactly the box's timing. It returns
214
+ * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string
215
+ * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so
216
+ * none of them can leak into the radius animation and desync it.
217
+ */
218
+ const resolveGroupTiming = (name) => {
219
+ const [index, total] = staggerPosition(name, "group");
220
+ const transition = resolveLayerTransition(layerTargets.get(name), "group", "layout", index === -1 ? 0 : index, total);
221
+ transition.duration && (transition.duration = secondsToMilliseconds(transition.duration));
222
+ const { delay = 0, duration, ease } = applyGeneratorOptions(transition);
223
+ return { delay: secondsToMilliseconds(delay), duration, ease };
224
+ };
225
+ /**
226
+ * Each layer's measured box + corner radii per snapshot. The box lets
227
+ * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case
228
+ * worth cropping); the radii let a cropped morph's group clip animate each
229
+ * corner from the old element's radius to the new element's, keeping it
230
+ * rounded where `overflow: clip` would otherwise square the corners.
231
+ *
232
+ * We never flatten the source for capture (a snapshot is a paint of the live
233
+ * DOM, so squaring an element just for its capture would flash one real
234
+ * square frame). For an aspect-changing morph `object-fit: cover` crops each
235
+ * snapshot's own baked corners off-screen mid-morph, so the animated clip is
236
+ * the only visible corner; a near-same-aspect forced crop (`.crop(true)`)
237
+ * can't hide the outgoing snapshot's silhouette, but the endpoints coincide.
205
238
  */
206
- const cropBox = new Map();
239
+ const cropMeasurements = new Map();
207
240
  const measureLayers = (phase) => nameRegistry.forEach((name, element) => {
208
- const rect = element.getBoundingClientRect?.();
241
+ const el = element;
242
+ const rect = el.getBoundingClientRect?.();
209
243
  if (rect && rect.height) {
210
- const entry = cropBox.get(name) ?? {};
211
- entry[phase] = { width: rect.width, height: rect.height };
212
- cropBox.set(name, entry);
244
+ const style = getComputedStyle(el);
245
+ const radii = {};
246
+ for (const corner of cornerRadiusProps) {
247
+ radii[corner] = style[corner];
248
+ }
249
+ const entry = cropMeasurements.get(name) ?? {};
250
+ entry[phase] = { width: rect.width, height: rect.height, radii };
251
+ cropMeasurements.set(name, entry);
213
252
  }
214
253
  });
215
254
  /**
@@ -239,7 +278,7 @@ function startViewAnimation(builder) {
239
278
  * never "changed".
240
279
  */
241
280
  const aspectChanged = (name) => {
242
- const box = cropBox.get(name);
281
+ const box = cropMeasurements.get(name);
243
282
  if (!box?.old || !box?.new || !box.old.height || !box.new.height) {
244
283
  return false;
245
284
  }
@@ -532,36 +571,85 @@ function startViewAnimation(builder) {
532
571
  const isMorphCrossfade = (name.type === "old" || name.type === "new") &&
533
572
  !!stagger?.old &&
534
573
  !!stagger?.new;
535
- const timingType = name.type.startsWith("group") || isMorphCrossfade
536
- ? "group"
537
- : name.type;
538
- const [index, total] = staggerPosition(name.layer, timingType);
539
- const transitionName = timingType === "group" ? "layout" : "";
540
- let animationTransition = resolveLayerTransition(targetDefinition, timingType, transitionName, index === -1 ? 0 : index, total);
541
- /**
542
- * The crossfade should resolve at the spring's *perceptual*
543
- * (visual) duration - the geometry can keep bouncing, but the
544
- * opacity shouldn't drag through the settle. So capture
545
- * `visualDuration` before `applyGeneratorOptions` replaces it
546
- * with the full overshoot duration, and use it for the fade.
547
- */
548
- const visualDuration = animationTransition.visualDuration;
549
- animationTransition.duration && (animationTransition.duration = secondsToMilliseconds(animationTransition.duration));
550
- animationTransition =
551
- applyGeneratorOptions(animationTransition);
552
- const duration = isMorphCrossfade && visualDuration !== undefined
553
- ? secondsToMilliseconds(visualDuration)
554
- : animationTransition.duration;
555
- const easing = isMorphCrossfade
556
- ? "linear"
557
- : mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration);
558
- effect.updateTiming({
559
- delay: secondsToMilliseconds(animationTransition.delay ?? 0),
560
- duration,
561
- easing,
562
- });
574
+ let timing;
575
+ if (name.type.startsWith("group")) {
576
+ // group + group-children follow the resolved group
577
+ // timing - the single source shared with the crop
578
+ // corner-radius pass below.
579
+ const { delay, duration, ease } = resolveGroupTiming(name.layer);
580
+ timing = {
581
+ delay,
582
+ duration,
583
+ easing: mapEasingToNativeEasing(ease, duration),
584
+ };
585
+ }
586
+ else {
587
+ const timingType = isMorphCrossfade ? "group" : name.type;
588
+ const [index, total] = staggerPosition(name.layer, timingType);
589
+ const transitionName = timingType === "group" ? "layout" : "";
590
+ let animationTransition = resolveLayerTransition(targetDefinition, timingType, transitionName, index === -1 ? 0 : index, total);
591
+ /**
592
+ * The crossfade should resolve at the spring's
593
+ * *perceptual* (visual) duration - the geometry can keep
594
+ * bouncing, but the opacity shouldn't drag through the
595
+ * settle. So capture `visualDuration` before
596
+ * `applyGeneratorOptions` replaces it with the full
597
+ * overshoot duration, and use it for the fade.
598
+ */
599
+ const visualDuration = animationTransition.visualDuration;
600
+ animationTransition.duration && (animationTransition.duration = secondsToMilliseconds(animationTransition.duration));
601
+ animationTransition =
602
+ applyGeneratorOptions(animationTransition);
603
+ timing = {
604
+ delay: secondsToMilliseconds(animationTransition.delay ?? 0),
605
+ duration: isMorphCrossfade && visualDuration !== undefined
606
+ ? secondsToMilliseconds(visualDuration)
607
+ : animationTransition.duration,
608
+ easing: isMorphCrossfade
609
+ ? "linear"
610
+ : mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration),
611
+ };
612
+ }
613
+ effect.updateTiming(timing);
563
614
  animations.push(new NativeAnimationWrapper(animation));
564
615
  }
616
+ /**
617
+ * Round each cropped layer's clip. Its `::view-transition-group`
618
+ * has `overflow: clip`, which would otherwise square the corners
619
+ * mid-morph; animate each corner from the old element's radius to
620
+ * the new element's so the crop stays rounded. Timed as the group
621
+ * (`layout`) so the radius tracks the morphing box.
622
+ */
623
+ cropMeasurements.forEach((entry, name) => {
624
+ if (!croppedNames.has(name))
625
+ return;
626
+ // Reuse the group's resolved timing - native ms delay/
627
+ // duration + a baked ease, with no generator `type` or
628
+ // repeat/times to leak into (or throw inside) NativeAnimation.
629
+ const { delay, duration, ease } = resolveGroupTiming(name);
630
+ for (const corner of cornerRadiusProps) {
631
+ // `||` (not `??`) so an empty measurement falls back to
632
+ // the other snapshot rather than an invalid keyframe.
633
+ const from = entry.old?.radii[corner] ||
634
+ entry.new?.radii[corner] ||
635
+ "0px";
636
+ const to = entry.new?.radii[corner] ||
637
+ entry.old?.radii[corner] ||
638
+ "0px";
639
+ // Nothing to round if the corner is square at both ends.
640
+ if (isSquareRadius(from) && isSquareRadius(to))
641
+ continue;
642
+ animations.push(new NativeAnimation({
643
+ element: document.documentElement,
644
+ name: corner,
645
+ pseudoElement: `::view-transition-group(${name})`,
646
+ keyframes: [from, to],
647
+ delay,
648
+ duration,
649
+ ease,
650
+ }));
651
+ }
652
+ });
565
653
  resolve(new GroupAnimation(animations));
566
654
  })
567
655
  .catch(() =>
@@ -1 +1 @@
1
- {"version":3,"file":"start.mjs","sources":["../../../src/view/start.ts"],"sourcesContent":["import { secondsToMilliseconds, warnOnce } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport { NativeAnimationWrapper } from \"../animation/NativeAnimationWrapper\"\nimport { AnimationPlaybackControls, DOMKeyframesDefinition } from \"../animation/types\"\nimport { getValueTransition } from \"../animation/utils/get-value-transition\"\nimport { mapEasingToNativeEasing } from \"../animation/waapi/easing/map-easing\"\nimport { applyGeneratorOptions } from \"../animation/waapi/utils/apply-generator\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport type { ViewTransitionBuilder } from \"./index\"\nimport { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"./types\"\nimport {\n assignViewTransitionNames,\n releaseViewTransitionNames,\n} from \"./utils/assign-names\"\nimport { chooseLayerType } from \"./utils/choose-layer-type\"\nimport { css } from \"./utils/css\"\nimport { getViewAnimationLayerInfo } from \"./utils/get-layer-info\"\nimport { getViewAnimations } from \"./utils/get-view-animations\"\nimport { hasTarget } from \"./utils/has-target\"\n\nconst definitionNames = [\"layout\", \"enter\", \"exit\", \"new\", \"old\"] as const\n\n/**\n * The `ViewTransitionTarget` buckets driving each generated layer type, in\n * priority order - the inverse of `chooseLayerType`. The new view is driven by\n * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no\n * bucket; they follow the default layout timing.\n */\nconst typeBuckets: Record<string, (keyof ViewTransitionTarget)[]> = {\n group: [\"layout\"],\n new: [\"new\", \"enter\"],\n old: [\"old\", \"exit\"],\n}\n\n/**\n * Default \"absent\" origin for a single-value keyframe, by pseudo type, so e.g.\n * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades\n * from 1. `enter` prefers the matching `exit` value over these (see below).\n */\nconst ORIGIN_DEFAULTS: Record<string, Record<string, number>> = {\n new: { opacity: 0, scale: 0.85 },\n old: { opacity: 1, scale: 1 },\n}\n\n/**\n * How much two box aspect ratios must differ before a morph is treated as\n * aspect-changing (and so worth cropping). Matches the projection engine's\n * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop.\n */\nconst ASPECT_TOLERANCE = 0.2\n\nexport function startViewAnimation(\n builder: ViewTransitionBuilder\n): Promise<GroupAnimation> {\n const {\n update,\n targets,\n resolveDefs,\n cropOverride,\n pairs,\n classNames,\n flatGroups,\n options: defaultOptions,\n } = builder\n\n if (!document.startViewTransition) {\n // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting\n // update rejects this promise rather than leaving it unsettled.\n return (async () => {\n await update()\n return new GroupAnimation([])\n })()\n }\n\n /**\n * Resolve any selector/Element targets to layer names, assigning a\n * `view-transition-name` to each element as we go. We run this before the\n * update (so the elements are captured in the old snapshot) and again\n * after it (for the new snapshot). An element present in both keeps the\n * same name and animates as a single `group` layer.\n */\n const nameRegistry = new Map<Element, string>()\n const assigned: Element[] = []\n /**\n * Elements we tagged with a `view-transition-class` (via `.class()`),\n * tracked separately from `assigned` so cleanup removes the class without\n * ever stripping an author's own inline `view-transition-name`.\n */\n const classed: Element[] = []\n /**\n * Elements we set a `view-transition-group` on (for nesting), tracked for\n * cleanup. `clipChildren` collects the names of nested parents that clip in\n * the live layout, so their `::view-transition-group-children` is clipped\n * through the transition - not just once the live DOM takes back over.\n */\n const grouped: Element[] = []\n const clipChildren = new Set<string>()\n const layerTargets = new Map<string, ViewTransitionTarget>()\n const croppedNames = new Set<string>()\n /**\n * Each layer's explicit `.crop(true | false)` override (by resolved name),\n * so `finalizeCrop` can let an author's choice win over the morph default.\n */\n const cropForName = new Map<string, boolean>()\n /**\n * Each layer's stagger position (index + total) within its subject, per\n * snapshot. Resolving against the snapshot the layer belongs to keeps\n * stagger correct when `update()` replaces the matched elements, and lets\n * us skip a layer that's absent from a snapshot (e.g. an exited element\n * has no `new` pseudo-element).\n */\n const layerStagger = new Map<\n string,\n { old?: [number, number]; new?: [number, number] }\n >()\n /**\n * Names allocated for a paired subject in the old snapshot, replayed onto\n * its new-snapshot target so both ends share a layer and morph.\n */\n const pairNames = new Map<ViewTransitionTargetDefinition, string[]>()\n /**\n * The old (`from`) elements of each paired subject, so their names can be\n * transferred off before the new (`to`) elements inherit them.\n */\n const pairFrom = new Map<ViewTransitionTargetDefinition, Element[]>()\n\n const resolveLayers = (phase: \"old\" | \"new\") => {\n targets.forEach((target, definition) => {\n const className = classNames.get(definition)\n /**\n * Nest each resolved layer under its DOM-ancestor layer by default\n * (`contain`), so an ancestor's clip/transform/opacity reach it\n * through the transition; `.group(false)` opts a subject out (`none`)\n * to stay flat and escape. Skipped for root / pre-named layers, which\n * aren't elements we resolve and style.\n */\n const group =\n definition === \"root\" || !resolveDefs.has(definition)\n ? undefined\n : flatGroups.has(definition)\n ? \"none\"\n : \"contain\"\n let names: string[]\n if (definition === \"root\" || !resolveDefs.has(definition)) {\n names = [definition as string]\n } else if (pairs.has(definition)) {\n /**\n * Paired morph: name the old target in the old snapshot, then\n * force the same name(s) onto the new target in the new one, so\n * two different elements morph as a single layer.\n */\n if (phase === \"old\") {\n pairFrom.set(\n definition,\n resolveElements(definition as ElementOrSelector)\n )\n names = assignViewTransitionNames(\n definition as ElementOrSelector,\n nameRegistry,\n assigned,\n undefined,\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n pairNames.set(definition, names)\n } else {\n /**\n * Transfer the name(s) off the `from` elements before the\n * `to` elements inherit them. A `from` that survives into\n * the new snapshot (e.g. hidden with `visibility: hidden`\n * rather than removed) would otherwise keep the name and\n * collide - \"duplicate view-transition-name\".\n */\n for (const el of pairFrom.get(definition) ?? []) {\n ;(el as HTMLElement).style?.removeProperty(\n \"view-transition-name\"\n )\n /**\n * Drop the old end from the registry too, so the new\n * end alone supplies this name's `new` crop radii - we\n * neither re-measure nor get ordered by a stale element.\n */\n nameRegistry.delete(el)\n }\n names = assignViewTransitionNames(\n pairs.get(definition) as ElementOrSelector,\n nameRegistry,\n assigned,\n pairNames.get(definition),\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n }\n } else {\n names = assignViewTransitionNames(\n definition as ElementOrSelector,\n nameRegistry,\n assigned,\n undefined,\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n }\n\n // Record any explicit `.crop(true | false)` per resolved name; the\n // crop set itself is computed later by `finalizeCrop` (it needs both\n // snapshots to know which morphs change aspect ratio).\n const override = cropOverride.get(definition)\n\n names.forEach((name, index) => {\n /**\n * If two subjects resolve to the same element, merge their\n * definitions so neither subject's animations are dropped.\n */\n const existing = layerTargets.get(name)\n layerTargets.set(\n name,\n existing && existing !== target\n ? { ...existing, ...target }\n : target\n )\n\n if (override !== undefined) cropForName.set(name, override)\n\n const stagger = layerStagger.get(name) ?? {}\n stagger[phase] = [index, names.length]\n layerStagger.set(name, stagger)\n })\n })\n }\n\n /**\n * The stagger index/total for a layer, resolved against the snapshot it\n * belongs to. Returns index -1 when the layer is absent from that snapshot\n * so the caller can skip a pseudo-element that doesn't exist.\n */\n const staggerPosition = (name: string, type: string) => {\n const stagger = layerStagger.get(name)\n const position =\n type === \"old\"\n ? stagger?.old\n : type === \"new\"\n ? stagger?.new\n : // group / group-children / image-pair persist across both.\n stagger?.new ?? stagger?.old\n return position ?? ([-1, 1] as const)\n }\n\n /**\n * Merge default + per-layer transition options for a generated layer and\n * resolve any stagger/delay function against this element's position. Used\n * by both the morph-retiming and crop corner-radius passes.\n */\n const resolveLayerTransition = (\n target: ViewTransitionTarget | undefined,\n type: string,\n transitionName: string,\n index: number,\n total: number\n ) => {\n const transition = mergeTransition(\n getValueTransition(defaultOptions, transitionName),\n getValueTransition(\n (layerOptions(target, type) ?? {}) as any,\n transitionName\n )\n )\n\n if (typeof transition.delay === \"function\") {\n transition.delay = transition.delay(index, total)\n }\n\n return transition\n }\n\n /**\n * Each layer's box size per snapshot, so `finalizeCrop` can tell whether a\n * morph's aspect ratio changed (the only case worth cropping).\n */\n const cropBox = new Map<\n string,\n {\n old?: { width: number; height: number }\n new?: { width: number; height: number }\n }\n >()\n\n const measureLayers = (phase: \"old\" | \"new\") =>\n nameRegistry.forEach((name, element) => {\n const rect = (element as HTMLElement).getBoundingClientRect?.()\n if (rect && rect.height) {\n const entry = cropBox.get(name) ?? {}\n entry[phase] = { width: rect.width, height: rect.height }\n cropBox.set(name, entry)\n }\n })\n\n /**\n * With both snapshots measured, settle which layers crop. The default crops\n * only a morph whose aspect ratio *changes* between snapshots - the one case\n * where `object-fit: cover` does real work. A same-aspect morph or a\n * fade-only layer is left uncropped: its corners scale naturally (no flash\n * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't\n * be clipped to nothing. An explicit `.crop(true | false)` overrides either\n * way. Runs after both snapshots are measured, since aspect needs both.\n */\n const finalizeCrop = () => {\n croppedNames.clear()\n for (const name of layerStagger.keys()) {\n if (name === \"root\") continue\n // An explicit `.crop(true | false)` wins; otherwise crop a morph\n // whose aspect ratio changed.\n if (cropForName.get(name) ?? aspectChanged(name)) {\n croppedNames.add(name)\n }\n }\n }\n\n /**\n * Whether a layer is a morph whose box aspect ratio changed between\n * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are\n * never \"changed\".\n */\n const aspectChanged = (name: string) => {\n const box = cropBox.get(name)\n if (!box?.old || !box?.new || !box.old.height || !box.new.height) {\n return false\n }\n return (\n Math.abs(\n box.old.width / box.old.height -\n box.new.width / box.new.height\n ) > ASPECT_TOLERANCE\n )\n }\n\n /**\n * Write the persistent view-transition CSS: suppress root capture when the\n * root has no animations of its own; force linear timing (baked into the\n * keyframes, so we can retime later via updateTiming); and clip +\n * object-fit: cover every cropped morph (the UA default overflows on\n * aspect-ratio change).\n *\n * `css.commit` replaces rather than appends, so we re-set the full rule set\n * each call - the crop rules are only known after `finalizeCrop` runs in the\n * update callback, so the second call writes them.\n */\n const commitViewCSS = () => {\n if (!hasTarget(\"root\", targets)) {\n css.set(\":root\", { \"view-transition-name\": \"none\" })\n }\n\n css.set(\n \"::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)\",\n { \"animation-timing-function\": \"linear !important\" }\n )\n\n croppedNames.forEach((name) => {\n css.set(`::view-transition-group(${name})`, { overflow: \"clip\" })\n css.set(\n `::view-transition-old(${name}), ::view-transition-new(${name})`,\n { width: \"100%\", height: \"100%\", \"object-fit\": \"cover\" }\n )\n })\n\n /**\n * Clip the nested children of any layer that clips in the live layout,\n * so a wrapper crops its child for the whole morph (mirroring the DOM)\n * rather than only at the live-DOM handoff. No-op on browsers without\n * nested view-transition groups.\n */\n clipChildren.forEach((name) => {\n css.set(`::view-transition-group-children(${name})`, {\n overflow: \"clip\",\n })\n })\n\n css.commit() // Write\n }\n\n const cleanup = () => {\n releaseViewTransitionNames(assigned, classed, grouped)\n css.remove() // Write\n }\n\n const callback = async () => {\n await update()\n\n /**\n * Re-resolve so elements created by the update are named for the new\n * snapshot, then measure them. With both snapshots measured we can\n * settle the crop set (aspect-changing morphs + forced).\n */\n resolveLayers(\"new\")\n measureLayers(\"new\")\n finalizeCrop()\n\n /**\n * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed\n * here (after both snapshots are measured), so the clip rules must be\n * (re)written to match the settled set.\n */\n commitViewCSS()\n }\n\n let transition: ViewTransition\n try {\n resolveLayers(\"old\")\n /**\n * Measure the old snapshot against the optimistic crop set (the new\n * snapshot doesn't exist yet, so aspect change can't be known here;\n * `finalizeCrop` settles it post-update).\n */\n measureLayers(\"old\")\n commitViewCSS()\n transition = document.startViewTransition(callback)\n } catch (error) {\n /**\n * The prelude writes inline names before the transition exists. If it\n * throws (e.g. startViewTransition rejects in a bad UA state), release\n * them so we neither leak DOM state nor stall the queue on a promise\n * that never settles - hand back a rejection it can advance past.\n */\n cleanup()\n return Promise.reject(error)\n }\n\n transition.finished.finally(cleanup)\n\n return new Promise<GroupAnimation>((resolve, reject) => {\n transition.ready\n .then(() => {\n const generatedViewAnimations = getViewAnimations()\n\n const animations: AnimationPlaybackControls[] = []\n\n /**\n * Create animations for each of our explicitly-defined subjects.\n * `opacityAnimated` additionally tracks which `${name}:${type}`\n * we faded, so we can keep the UA `plus-lighter` blend only for a\n * genuine opacity crossfade (both sides fading) and drop it for a\n * slide/transform, where additive compositing would flash bright.\n */\n const explicitlyAnimated = new Set<string>()\n const opacityAnimated = new Set<string>()\n layerTargets.forEach((target, name) => {\n const stagger = layerStagger.get(name)\n /**\n * Presence: `enter` only fires for a pure newcomer (a new\n * view with no old), `exit` only for a pure leaver. A\n * survivor (both) gets neither - it just morphs.\n */\n const enterApplies = !!stagger?.new && !stagger?.old\n const exitApplies = !!stagger?.old && !stagger?.new\n\n for (const key of definitionNames) {\n if (!target[key]) continue\n if (key === \"enter\" && !enterApplies) continue\n if (key === \"exit\" && !exitApplies) continue\n\n const type = chooseLayerType(\n key as keyof ViewTransitionTarget\n )\n const [index, total] = staggerPosition(name, type)\n // Skip a layer absent from its snapshot.\n if (index === -1) continue\n\n const { keyframes, options } =\n target[key as keyof ViewTransitionTarget]!\n\n for (let [valueName, valueKeyframes] of Object.entries(\n keyframes\n )) {\n // Skip only missing values - `0` (e.g. opacity: 0)\n // is valid and must reach the from-value inference.\n if (valueKeyframes == null) continue\n\n /**\n * The view path hands keyframes straight to WAAPI,\n * so Motion's `x`/`y` shorthands (compiled to\n * `transform` only via the value pipeline) have no\n * effect. Warn and skip - use `transform`/`translate`.\n */\n if (valueName === \"x\" || valueName === \"y\") {\n warnOnce(\n false,\n `animateView() animates view-transition layers with CSS properties; the \"${valueName}\" shorthand has no effect - use transform, e.g. { transform: \"translateX(40px)\" }.`\n )\n continue\n }\n\n /**\n * enter/exit win over new/old on a shared property -\n * skip it here when the gated bucket also defines it.\n */\n if (\n key === \"new\" &&\n enterApplies &&\n target.enter?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ] != null\n ) {\n continue\n }\n if (\n key === \"old\" &&\n exitApplies &&\n target.exit?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ] != null\n ) {\n continue\n }\n\n const valueOptions = mergeTransition(\n getValueTransition(\n defaultOptions as any,\n valueName\n ),\n getValueTransition(options as any, valueName)\n )\n\n /**\n * Infer an origin for a single-value keyframe. An\n * `enter` mirrors the matching `exit` value (a\n * defined exit reverses into the enter for free);\n * otherwise the per-type default (opacity 0/1, scale\n * 0.85). No default -> left as-is (animates from the\n * live value).\n *\n * `new`/`old` fire for survivors too, where only the\n * opacity crossfade default applies - a transform\n * default like scale 0.85 would pop a persisting\n * element, so gate it on the layer actually\n * entering/leaving.\n */\n if (!Array.isArray(valueKeyframes)) {\n const exitValue =\n key === \"enter\"\n ? target.exit?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ]\n : undefined\n const allowDefault =\n valueName === \"opacity\" ||\n (type === \"new\" ? enterApplies : exitApplies)\n const from =\n exitValue != null\n ? Array.isArray(exitValue)\n ? exitValue[exitValue.length - 1]\n : exitValue\n : allowDefault\n ? ORIGIN_DEFAULTS[type]?.[valueName]\n : undefined\n if (from !== undefined) {\n valueKeyframes = [from, valueKeyframes]\n }\n }\n\n /**\n * Resolve stagger function if provided, per element\n * across this subject's resolved layers.\n */\n if (typeof valueOptions.delay === \"function\") {\n valueOptions.delay = valueOptions.delay(\n index,\n total\n )\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(\n valueOptions.delay\n )\n\n animations.push(\n new NativeAnimation({\n ...valueOptions,\n element: document.documentElement,\n name: valueName,\n pseudoElement: `::view-transition-${type}(${name})`,\n keyframes: valueKeyframes,\n })\n )\n explicitlyAnimated.add(`${name}:${type}`)\n if (valueName === \"opacity\") {\n opacityAnimated.add(`${name}:${type}`)\n }\n }\n }\n })\n\n /**\n * Handle browser generated animations\n */\n for (const animation of generatedViewAnimations) {\n if (animation.playState === \"finished\") continue\n\n const { effect } = animation\n if (!effect || !(effect instanceof KeyframeEffect)) continue\n\n const { pseudoElement } = effect\n if (!pseudoElement) continue\n\n const name = getViewAnimationLayerInfo(pseudoElement)\n if (!name) continue\n\n const targetDefinition = layerTargets.get(name.layer)\n\n /**\n * We built our own animation for this layer, so drop the\n * browser-generated fade we're replacing. The UA\n * `plus-lighter` blend is a *separate* generated animation on\n * the same pseudo (it sets `mix-blend-mode` in its keyframes):\n * keep it *only* for a true opacity crossfade - both sides\n * fading - so a symmetric crossfade composites without\n * darkening, but a slide/transform (where both layers stay\n * opaque and overlap) doesn't flash bright from the addition.\n */\n if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) {\n const isCrossfade =\n opacityAnimated.has(`${name.layer}:new`) &&\n opacityAnimated.has(`${name.layer}:old`)\n if (\n isCrossfade &&\n effect\n .getKeyframes()\n .some((keyframe) => keyframe.mixBlendMode)\n ) {\n animations.push(new NativeAnimationWrapper(animation))\n } else {\n animation.cancel()\n }\n continue\n }\n\n /**\n * Drop the orphaned half of the default crossfade. The UA\n * fades old out and new in as a *pair*; if the opposing half\n * was explicitly overridden with something other than an\n * opacity fade (a clip or transform reveal), this side's\n * default opacity fade has no partner - left to run it would\n * dissolve what should be a static backdrop (e.g.\n * `.new({ clipPath })` should reveal over a still old view,\n * not fade the old out around the growing clip). Cancel it -\n * and its `plus-lighter` sibling on the same pseudo, which\n * would otherwise flash bright where the two opaque layers\n * overlap. A genuine crossfade (the opposing side also fading\n * opacity) keeps both halves and is handled above.\n */\n const opposite =\n name.type === \"old\"\n ? \"new\"\n : name.type === \"new\"\n ? \"old\"\n : undefined\n if (\n opposite &&\n explicitlyAnimated.has(\n `${name.layer}:${opposite}`\n ) &&\n !opacityAnimated.has(`${name.layer}:${opposite}`)\n ) {\n animation.cancel()\n continue\n }\n\n /**\n * Otherwise retime the browser-generated animation to\n * Motion's timing. This auto-enables the layout (group)\n * morph for any resolved/named target, and applies the\n * default timing to old/new layers we haven't explicitly\n * overridden.\n *\n * group + group-children both follow the layout timing so\n * the nesting container stays in sync with the morph.\n */\n /**\n * A survivor's old + new are the two halves of one\n * `plus-lighter` crossfade. They must share identical timing\n * (so their opacities stay mirrored and sum to 1 - else the\n * additive blend flashes bright wherever both are partly\n * visible) and fade linearly (the bounce belongs on the\n * group's geometry, not the opacity). So time them as the\n * group, rather than via their own - potentially staggered,\n * or enter/exit-derived - old/new options.\n */\n const stagger = layerStagger.get(name.layer)\n const isMorphCrossfade =\n (name.type === \"old\" || name.type === \"new\") &&\n !!stagger?.old &&\n !!stagger?.new\n const timingType =\n name.type.startsWith(\"group\") || isMorphCrossfade\n ? \"group\"\n : name.type\n\n const [index, total] = staggerPosition(\n name.layer,\n timingType\n )\n const transitionName =\n timingType === \"group\" ? \"layout\" : \"\"\n let animationTransition = resolveLayerTransition(\n targetDefinition,\n timingType,\n transitionName,\n index === -1 ? 0 : index,\n total\n )\n\n /**\n * The crossfade should resolve at the spring's *perceptual*\n * (visual) duration - the geometry can keep bouncing, but the\n * opacity shouldn't drag through the settle. So capture\n * `visualDuration` before `applyGeneratorOptions` replaces it\n * with the full overshoot duration, and use it for the fade.\n */\n const visualDuration = animationTransition.visualDuration\n\n animationTransition.duration &&= secondsToMilliseconds(\n animationTransition.duration\n )\n\n animationTransition =\n applyGeneratorOptions(animationTransition)\n\n const duration =\n isMorphCrossfade && visualDuration !== undefined\n ? secondsToMilliseconds(visualDuration)\n : animationTransition.duration\n\n const easing = isMorphCrossfade\n ? \"linear\"\n : (mapEasingToNativeEasing(\n animationTransition.ease,\n animationTransition.duration!\n ) as string)\n\n effect.updateTiming({\n delay: secondsToMilliseconds(\n animationTransition.delay ?? 0\n ),\n duration,\n easing,\n })\n\n animations.push(new NativeAnimationWrapper(animation))\n }\n\n resolve(new GroupAnimation(animations))\n })\n .catch(() =>\n /**\n * `ready` rejects when the transition is skipped - no visual\n * change, or superseded by an interrupting transition. The DOM\n * update still applied, so settle with no animations rather than\n * surfacing it as an error to an awaiting caller. A genuine\n * failure in `update()` rejects `updateCallbackDone` (already\n * settled by now), so propagate that instead.\n */\n transition.updateCallbackDone.then(\n () => resolve(new GroupAnimation([])),\n reject\n )\n )\n })\n}\n\n/**\n * The options that should time a given generated layer type, so a retimed\n * group/old/new picks up any per-target transition the user provided. Checks\n * the type's buckets in priority order (e.g. `new` before `enter`).\n */\nfunction layerOptions(target: ViewTransitionTarget | undefined, type: string) {\n for (const bucket of typeBuckets[type] ?? []) {\n const options = target?.[bucket]?.options\n if (options) return options\n }\n}\n\n/**\n * Merge a base transition (e.g. the default `options`) with a per-layer/value\n * override. An explicit `duration` on the override must win over an inherited\n * generator's own timing: a spring prefers `visualDuration`, and\n * `spring.applyToOptions` overwrites `duration` with the computed settle time -\n * so without this the override is silently discarded. Dropping the inherited\n * `type`/`visualDuration` makes the layer a plain tween of that duration, unless\n * it asked for its own generator `type`/`visualDuration`.\n */\nfunction mergeTransition(base: any, override: any) {\n const merged = { ...base, ...override }\n\n if (override.duration !== undefined) {\n if (override.visualDuration === undefined) delete merged.visualDuration\n if (override.type === undefined) delete merged.type\n }\n\n return merged\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAU;AAE1E;;;;;AAKG;AACH,MAAM,WAAW,GAAmD;IAChE,KAAK,EAAE,CAAC,QAAQ,CAAC;AACjB,IAAA,GAAG,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;AACrB,IAAA,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED;;;;AAIG;AACH,MAAM,eAAe,GAA2C;IAC5D,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;IAChC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;CAChC;AAED;;;;AAIG;AACH,MAAM,gBAAgB,GAAG,GAAG;AAEtB,SAAU,kBAAkB,CAC9B,OAA8B,EAAA;IAE9B,MAAM,EACF,MAAM,EACN,OAAO,EACP,WAAW,EACX,YAAY,EACZ,KAAK,EACL,UAAU,EACV,UAAU,EACV,OAAO,EAAE,cAAc,GAC1B,GAAG,OAAO;AAEX,IAAA,IAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE;;;QAG/B,OAAO,CAAC,YAAW;YACf,MAAM,MAAM,EAAE;AACd,YAAA,OAAO,I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AEA;;;;AAIG;AACH,SAAS,YAAY,CAAC,MAAwC,EAAE,IAAY,EAAA;IACxE,KAAK,MAAM,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE;QAC1C,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,OAAO;AACzC,QAAA,IAAI,OAAO;AAAE,YAAA,OAAO,OAAO;IAC/B;AACJ;AAEA;;;;;;;;AAQG;AACH,SAAS,eAAe,CAAC,IAAS,EAAE,QAAa,EAAA;IAC7C,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,EAAE;AAEvC,IAAA,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS,EAAE;AACjC,QAAA,IAAI,QAAQ,CAAC,cAAc,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC,cAAc;AACvE,QAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC,IAAI;IACvD;AAEA,IAAA,OAAO,MAAM;AACjB;;;;"}
1
+ {"version":3,"file":"start.mjs","sources":["../../../src/view/start.ts"],"sourcesContent":["import { secondsToMilliseconds, warnOnce } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport { NativeAnimationWrapper } from \"../animation/NativeAnimationWrapper\"\nimport { AnimationPlaybackControls, DOMKeyframesDefinition } from \"../animation/types\"\nimport { getValueTransition } from \"../animation/utils/get-value-transition\"\nimport { mapEasingToNativeEasing } from \"../animation/waapi/easing/map-easing\"\nimport { applyGeneratorOptions } from \"../animation/waapi/utils/apply-generator\"\nimport { cornerRadiusProps } from \"../utils/border-radius\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport type { ViewTransitionBuilder } from \"./index\"\nimport { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"./types\"\nimport {\n assignViewTransitionNames,\n releaseViewTransitionNames,\n} from \"./utils/assign-names\"\nimport { chooseLayerType } from \"./utils/choose-layer-type\"\nimport { css } from \"./utils/css\"\nimport { getViewAnimationLayerInfo } from \"./utils/get-layer-info\"\nimport { getViewAnimations } from \"./utils/get-view-animations\"\nimport { hasTarget } from \"./utils/has-target\"\n\nconst definitionNames = [\"layout\", \"enter\", \"exit\", \"new\", \"old\"] as const\n\ntype CornerRadii = Record<(typeof cornerRadiusProps)[number], string>\n\n/**\n * Whether a computed border-radius is square (every component zero). Splitting\n * on whitespace handles two-value/elliptical radii like \"0px 20px\" - a leading\n * `parseFloat` alone would misread the non-zero vertical radius as square.\n */\nconst isSquareRadius = (radius: string) =>\n radius.split(\" \").every((value) => parseFloat(value) === 0)\n\n/**\n * The `ViewTransitionTarget` buckets driving each generated layer type, in\n * priority order - the inverse of `chooseLayerType`. The new view is driven by\n * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no\n * bucket; they follow the default layout timing.\n */\nconst typeBuckets: Record<string, (keyof ViewTransitionTarget)[]> = {\n group: [\"layout\"],\n new: [\"new\", \"enter\"],\n old: [\"old\", \"exit\"],\n}\n\n/**\n * Default \"absent\" origin for a single-value keyframe, by pseudo type, so e.g.\n * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades\n * from 1. `enter` prefers the matching `exit` value over these (see below).\n */\nconst ORIGIN_DEFAULTS: Record<string, Record<string, number>> = {\n new: { opacity: 0, scale: 0.85 },\n old: { opacity: 1, scale: 1 },\n}\n\n/**\n * How much two box aspect ratios must differ before a morph is treated as\n * aspect-changing (and so worth cropping). Matches the projection engine's\n * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop.\n */\nconst ASPECT_TOLERANCE = 0.2\n\nexport function startViewAnimation(\n builder: ViewTransitionBuilder\n): Promise<GroupAnimation> {\n const {\n update,\n targets,\n resolveDefs,\n cropOverride,\n pairs,\n classNames,\n flatGroups,\n options: defaultOptions,\n } = builder\n\n if (!document.startViewTransition) {\n // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting\n // update rejects this promise rather than leaving it unsettled.\n return (async () => {\n await update()\n return new GroupAnimation([])\n })()\n }\n\n /**\n * Resolve any selector/Element targets to layer names, assigning a\n * `view-transition-name` to each element as we go. We run this before the\n * update (so the elements are captured in the old snapshot) and again\n * after it (for the new snapshot). An element present in both keeps the\n * same name and animates as a single `group` layer.\n */\n const nameRegistry = new Map<Element, string>()\n const assigned: Element[] = []\n /**\n * Elements we tagged with a `view-transition-class` (via `.class()`),\n * tracked separately from `assigned` so cleanup removes the class without\n * ever stripping an author's own inline `view-transition-name`.\n */\n const classed: Element[] = []\n /**\n * Elements we set a `view-transition-group` on (for nesting), tracked for\n * cleanup. `clipChildren` collects the names of nested parents that clip in\n * the live layout, so their `::view-transition-group-children` is clipped\n * through the transition - not just once the live DOM takes back over.\n */\n const grouped: Element[] = []\n const clipChildren = new Set<string>()\n const layerTargets = new Map<string, ViewTransitionTarget>()\n const croppedNames = new Set<string>()\n /**\n * Each layer's explicit `.crop(true | false)` override (by resolved name),\n * so `finalizeCrop` can let an author's choice win over the morph default.\n */\n const cropForName = new Map<string, boolean>()\n /**\n * Each layer's stagger position (index + total) within its subject, per\n * snapshot. Resolving against the snapshot the layer belongs to keeps\n * stagger correct when `update()` replaces the matched elements, and lets\n * us skip a layer that's absent from a snapshot (e.g. an exited element\n * has no `new` pseudo-element).\n */\n const layerStagger = new Map<\n string,\n { old?: [number, number]; new?: [number, number] }\n >()\n /**\n * Names allocated for a paired subject in the old snapshot, replayed onto\n * its new-snapshot target so both ends share a layer and morph.\n */\n const pairNames = new Map<ViewTransitionTargetDefinition, string[]>()\n /**\n * The old (`from`) elements of each paired subject, so their names can be\n * transferred off before the new (`to`) elements inherit them.\n */\n const pairFrom = new Map<ViewTransitionTargetDefinition, Element[]>()\n\n const resolveLayers = (phase: \"old\" | \"new\") => {\n targets.forEach((target, definition) => {\n const className = classNames.get(definition)\n /**\n * Nest each resolved layer under its DOM-ancestor layer by default\n * (`contain`), so an ancestor's clip/transform/opacity reach it\n * through the transition; `.group(false)` opts a subject out (`none`)\n * to stay flat and escape. Skipped for root / pre-named layers, which\n * aren't elements we resolve and style.\n */\n const group =\n definition === \"root\" || !resolveDefs.has(definition)\n ? undefined\n : flatGroups.has(definition)\n ? \"none\"\n : \"contain\"\n let names: string[]\n if (definition === \"root\" || !resolveDefs.has(definition)) {\n names = [definition as string]\n } else if (pairs.has(definition)) {\n /**\n * Paired morph: name the old target in the old snapshot, then\n * force the same name(s) onto the new target in the new one, so\n * two different elements morph as a single layer.\n */\n if (phase === \"old\") {\n pairFrom.set(\n definition,\n resolveElements(definition as ElementOrSelector)\n )\n names = assignViewTransitionNames(\n definition as ElementOrSelector,\n nameRegistry,\n assigned,\n undefined,\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n pairNames.set(definition, names)\n } else {\n /**\n * Transfer the name(s) off the `from` elements before the\n * `to` elements inherit them. A `from` that survives into\n * the new snapshot (e.g. hidden with `visibility: hidden`\n * rather than removed) would otherwise keep the name and\n * collide - \"duplicate view-transition-name\".\n */\n for (const el of pairFrom.get(definition) ?? []) {\n ;(el as HTMLElement).style?.removeProperty(\n \"view-transition-name\"\n )\n /**\n * Drop the old end from the registry too, so the new\n * end alone supplies this name's `new` crop radii - we\n * neither re-measure nor get ordered by a stale element.\n */\n nameRegistry.delete(el)\n }\n names = assignViewTransitionNames(\n pairs.get(definition) as ElementOrSelector,\n nameRegistry,\n assigned,\n pairNames.get(definition),\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n }\n } else {\n names = assignViewTransitionNames(\n definition as ElementOrSelector,\n nameRegistry,\n assigned,\n undefined,\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n }\n\n // Record any explicit `.crop(true | false)` per resolved name; the\n // crop set itself is computed later by `finalizeCrop` (it needs both\n // snapshots to know which morphs change aspect ratio).\n const override = cropOverride.get(definition)\n\n names.forEach((name, index) => {\n /**\n * If two subjects resolve to the same element, merge their\n * definitions so neither subject's animations are dropped.\n */\n const existing = layerTargets.get(name)\n layerTargets.set(\n name,\n existing && existing !== target\n ? { ...existing, ...target }\n : target\n )\n\n if (override !== undefined) cropForName.set(name, override)\n\n const stagger = layerStagger.get(name) ?? {}\n stagger[phase] = [index, names.length]\n layerStagger.set(name, stagger)\n })\n })\n }\n\n /**\n * The stagger index/total for a layer, resolved against the snapshot it\n * belongs to. Returns index -1 when the layer is absent from that snapshot\n * so the caller can skip a pseudo-element that doesn't exist.\n */\n const staggerPosition = (name: string, type: string) => {\n const stagger = layerStagger.get(name)\n const position =\n type === \"old\"\n ? stagger?.old\n : type === \"new\"\n ? stagger?.new\n : // group / group-children / image-pair persist across both.\n stagger?.new ?? stagger?.old\n return position ?? ([-1, 1] as const)\n }\n\n /**\n * Merge default + per-layer transition options for a generated layer and\n * resolve any stagger/delay function against this element's position. Used\n * by both the morph-retiming and crop corner-radius passes.\n */\n const resolveLayerTransition = (\n target: ViewTransitionTarget | undefined,\n type: string,\n transitionName: string,\n index: number,\n total: number\n ) => {\n const transition = mergeTransition(\n getValueTransition(defaultOptions, transitionName),\n getValueTransition(\n (layerOptions(target, type) ?? {}) as any,\n transitionName\n )\n )\n\n if (typeof transition.delay === \"function\") {\n transition.delay = transition.delay(index, total)\n }\n\n return transition\n }\n\n /**\n * Resolve a layer's group (`layout`) timing to plain WAAPI values: native\n * ms `delay`/`duration` and a baked `ease`. The single source of group\n * timing, shared by the generated-group retiming and the crop corner-radius\n * pass so the rounded clip animates on exactly the box's timing. It returns\n * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string\n * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so\n * none of them can leak into the radius animation and desync it.\n */\n const resolveGroupTiming = (name: string) => {\n const [index, total] = staggerPosition(name, \"group\")\n const transition = resolveLayerTransition(\n layerTargets.get(name),\n \"group\",\n \"layout\",\n index === -1 ? 0 : index,\n total\n )\n transition.duration &&= secondsToMilliseconds(transition.duration)\n const { delay = 0, duration, ease } = applyGeneratorOptions(transition)\n return { delay: secondsToMilliseconds(delay), duration, ease }\n }\n\n /**\n * Each layer's measured box + corner radii per snapshot. The box lets\n * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case\n * worth cropping); the radii let a cropped morph's group clip animate each\n * corner from the old element's radius to the new element's, keeping it\n * rounded where `overflow: clip` would otherwise square the corners.\n *\n * We never flatten the source for capture (a snapshot is a paint of the live\n * DOM, so squaring an element just for its capture would flash one real\n * square frame). For an aspect-changing morph `object-fit: cover` crops each\n * snapshot's own baked corners off-screen mid-morph, so the animated clip is\n * the only visible corner; a near-same-aspect forced crop (`.crop(true)`)\n * can't hide the outgoing snapshot's silhouette, but the endpoints coincide.\n */\n const cropMeasurements = new Map<\n string,\n {\n old?: { width: number; height: number; radii: CornerRadii }\n new?: { width: number; height: number; radii: CornerRadii }\n }\n >()\n\n const measureLayers = (phase: \"old\" | \"new\") =>\n nameRegistry.forEach((name, element) => {\n const el = element as HTMLElement\n const rect = el.getBoundingClientRect?.()\n if (rect && rect.height) {\n const style = getComputedStyle(el)\n const radii = {} as CornerRadii\n for (const corner of cornerRadiusProps) {\n radii[corner] = style[corner]\n }\n const entry = cropMeasurements.get(name) ?? {}\n entry[phase] = { width: rect.width, height: rect.height, radii }\n cropMeasurements.set(name, entry)\n }\n })\n\n /**\n * With both snapshots measured, settle which layers crop. The default crops\n * only a morph whose aspect ratio *changes* between snapshots - the one case\n * where `object-fit: cover` does real work. A same-aspect morph or a\n * fade-only layer is left uncropped: its corners scale naturally (no flash\n * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't\n * be clipped to nothing. An explicit `.crop(true | false)` overrides either\n * way. Runs after both snapshots are measured, since aspect needs both.\n */\n const finalizeCrop = () => {\n croppedNames.clear()\n for (const name of layerStagger.keys()) {\n if (name === \"root\") continue\n // An explicit `.crop(true | false)` wins; otherwise crop a morph\n // whose aspect ratio changed.\n if (cropForName.get(name) ?? aspectChanged(name)) {\n croppedNames.add(name)\n }\n }\n }\n\n /**\n * Whether a layer is a morph whose box aspect ratio changed between\n * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are\n * never \"changed\".\n */\n const aspectChanged = (name: string) => {\n const box = cropMeasurements.get(name)\n if (!box?.old || !box?.new || !box.old.height || !box.new.height) {\n return false\n }\n return (\n Math.abs(\n box.old.width / box.old.height -\n box.new.width / box.new.height\n ) > ASPECT_TOLERANCE\n )\n }\n\n /**\n * Write the persistent view-transition CSS: suppress root capture when the\n * root has no animations of its own; force linear timing (baked into the\n * keyframes, so we can retime later via updateTiming); and clip +\n * object-fit: cover every cropped morph (the UA default overflows on\n * aspect-ratio change).\n *\n * `css.commit` replaces rather than appends, so we re-set the full rule set\n * each call - the crop rules are only known after `finalizeCrop` runs in the\n * update callback, so the second call writes them.\n */\n const commitViewCSS = () => {\n if (!hasTarget(\"root\", targets)) {\n css.set(\":root\", { \"view-transition-name\": \"none\" })\n }\n\n css.set(\n \"::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)\",\n { \"animation-timing-function\": \"linear !important\" }\n )\n\n croppedNames.forEach((name) => {\n css.set(`::view-transition-group(${name})`, { overflow: \"clip\" })\n css.set(\n `::view-transition-old(${name}), ::view-transition-new(${name})`,\n { width: \"100%\", height: \"100%\", \"object-fit\": \"cover\" }\n )\n })\n\n /**\n * Clip the nested children of any layer that clips in the live layout,\n * so a wrapper crops its child for the whole morph (mirroring the DOM)\n * rather than only at the live-DOM handoff. No-op on browsers without\n * nested view-transition groups.\n */\n clipChildren.forEach((name) => {\n css.set(`::view-transition-group-children(${name})`, {\n overflow: \"clip\",\n })\n })\n\n css.commit() // Write\n }\n\n const cleanup = () => {\n releaseViewTransitionNames(assigned, classed, grouped)\n css.remove() // Write\n }\n\n const callback = async () => {\n await update()\n\n /**\n * Re-resolve so elements created by the update are named for the new\n * snapshot, then measure them. With both snapshots measured we can\n * settle the crop set (aspect-changing morphs + forced).\n */\n resolveLayers(\"new\")\n measureLayers(\"new\")\n finalizeCrop()\n\n /**\n * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed\n * here (after both snapshots are measured), so the clip rules must be\n * (re)written to match the settled set.\n */\n commitViewCSS()\n }\n\n let transition: ViewTransition\n try {\n resolveLayers(\"old\")\n /**\n * Measure the old snapshot against the optimistic crop set (the new\n * snapshot doesn't exist yet, so aspect change can't be known here;\n * `finalizeCrop` settles it post-update).\n */\n measureLayers(\"old\")\n commitViewCSS()\n transition = document.startViewTransition(callback)\n } catch (error) {\n /**\n * The prelude writes inline names before the transition exists. If it\n * throws (e.g. startViewTransition rejects in a bad UA state), release\n * them so we neither leak DOM state nor stall the queue on a promise\n * that never settles - hand back a rejection it can advance past.\n */\n cleanup()\n return Promise.reject(error)\n }\n\n transition.finished.finally(cleanup)\n\n return new Promise<GroupAnimation>((resolve, reject) => {\n transition.ready\n .then(() => {\n const generatedViewAnimations = getViewAnimations()\n\n const animations: AnimationPlaybackControls[] = []\n\n /**\n * Create animations for each of our explicitly-defined subjects.\n * `opacityAnimated` additionally tracks which `${name}:${type}`\n * we faded, so we can keep the UA `plus-lighter` blend only for a\n * genuine opacity crossfade (both sides fading) and drop it for a\n * slide/transform, where additive compositing would flash bright.\n */\n const explicitlyAnimated = new Set<string>()\n const opacityAnimated = new Set<string>()\n layerTargets.forEach((target, name) => {\n const stagger = layerStagger.get(name)\n /**\n * Presence: `enter` only fires for a pure newcomer (a new\n * view with no old), `exit` only for a pure leaver. A\n * survivor (both) gets neither - it just morphs.\n */\n const enterApplies = !!stagger?.new && !stagger?.old\n const exitApplies = !!stagger?.old && !stagger?.new\n\n for (const key of definitionNames) {\n if (!target[key]) continue\n if (key === \"enter\" && !enterApplies) continue\n if (key === \"exit\" && !exitApplies) continue\n\n const type = chooseLayerType(\n key as keyof ViewTransitionTarget\n )\n const [index, total] = staggerPosition(name, type)\n // Skip a layer absent from its snapshot.\n if (index === -1) continue\n\n const { keyframes, options } =\n target[key as keyof ViewTransitionTarget]!\n\n for (let [valueName, valueKeyframes] of Object.entries(\n keyframes\n )) {\n // Skip only missing values - `0` (e.g. opacity: 0)\n // is valid and must reach the from-value inference.\n if (valueKeyframes == null) continue\n\n /**\n * The view path hands keyframes straight to WAAPI,\n * so Motion's `x`/`y` shorthands (compiled to\n * `transform` only via the value pipeline) have no\n * effect. Warn and skip - use `transform`/`translate`.\n */\n if (valueName === \"x\" || valueName === \"y\") {\n warnOnce(\n false,\n `animateView() animates view-transition layers with CSS properties; the \"${valueName}\" shorthand has no effect - use transform, e.g. { transform: \"translateX(40px)\" }.`\n )\n continue\n }\n\n /**\n * enter/exit win over new/old on a shared property -\n * skip it here when the gated bucket also defines it.\n */\n if (\n key === \"new\" &&\n enterApplies &&\n target.enter?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ] != null\n ) {\n continue\n }\n if (\n key === \"old\" &&\n exitApplies &&\n target.exit?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ] != null\n ) {\n continue\n }\n\n const valueOptions = mergeTransition(\n getValueTransition(\n defaultOptions as any,\n valueName\n ),\n getValueTransition(options as any, valueName)\n )\n\n /**\n * Infer an origin for a single-value keyframe. An\n * `enter` mirrors the matching `exit` value (a\n * defined exit reverses into the enter for free);\n * otherwise the per-type default (opacity 0/1, scale\n * 0.85). No default -> left as-is (animates from the\n * live value).\n *\n * `new`/`old` fire for survivors too, where only the\n * opacity crossfade default applies - a transform\n * default like scale 0.85 would pop a persisting\n * element, so gate it on the layer actually\n * entering/leaving.\n */\n if (!Array.isArray(valueKeyframes)) {\n const exitValue =\n key === \"enter\"\n ? target.exit?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ]\n : undefined\n const allowDefault =\n valueName === \"opacity\" ||\n (type === \"new\" ? enterApplies : exitApplies)\n const from =\n exitValue != null\n ? Array.isArray(exitValue)\n ? exitValue[exitValue.length - 1]\n : exitValue\n : allowDefault\n ? ORIGIN_DEFAULTS[type]?.[valueName]\n : undefined\n if (from !== undefined) {\n valueKeyframes = [from, valueKeyframes]\n }\n }\n\n /**\n * Resolve stagger function if provided, per element\n * across this subject's resolved layers.\n */\n if (typeof valueOptions.delay === \"function\") {\n valueOptions.delay = valueOptions.delay(\n index,\n total\n )\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(\n valueOptions.delay\n )\n\n animations.push(\n new NativeAnimation({\n ...valueOptions,\n element: document.documentElement,\n name: valueName,\n pseudoElement: `::view-transition-${type}(${name})`,\n keyframes: valueKeyframes,\n })\n )\n explicitlyAnimated.add(`${name}:${type}`)\n if (valueName === \"opacity\") {\n opacityAnimated.add(`${name}:${type}`)\n }\n }\n }\n })\n\n /**\n * Handle browser generated animations\n */\n for (const animation of generatedViewAnimations) {\n if (animation.playState === \"finished\") continue\n\n const { effect } = animation\n if (!effect || !(effect instanceof KeyframeEffect)) continue\n\n const { pseudoElement } = effect\n if (!pseudoElement) continue\n\n const name = getViewAnimationLayerInfo(pseudoElement)\n if (!name) continue\n\n const targetDefinition = layerTargets.get(name.layer)\n\n /**\n * We built our own animation for this layer, so drop the\n * browser-generated fade we're replacing. The UA\n * `plus-lighter` blend is a *separate* generated animation on\n * the same pseudo (it sets `mix-blend-mode` in its keyframes):\n * keep it *only* for a true opacity crossfade - both sides\n * fading - so a symmetric crossfade composites without\n * darkening, but a slide/transform (where both layers stay\n * opaque and overlap) doesn't flash bright from the addition.\n */\n if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) {\n const isCrossfade =\n opacityAnimated.has(`${name.layer}:new`) &&\n opacityAnimated.has(`${name.layer}:old`)\n if (\n isCrossfade &&\n effect\n .getKeyframes()\n .some((keyframe) => keyframe.mixBlendMode)\n ) {\n animations.push(new NativeAnimationWrapper(animation))\n } else {\n animation.cancel()\n }\n continue\n }\n\n /**\n * Drop the orphaned half of the default crossfade. The UA\n * fades old out and new in as a *pair*; if the opposing half\n * was explicitly overridden with something other than an\n * opacity fade (a clip or transform reveal), this side's\n * default opacity fade has no partner - left to run it would\n * dissolve what should be a static backdrop (e.g.\n * `.new({ clipPath })` should reveal over a still old view,\n * not fade the old out around the growing clip). Cancel it -\n * and its `plus-lighter` sibling on the same pseudo, which\n * would otherwise flash bright where the two opaque layers\n * overlap. A genuine crossfade (the opposing side also fading\n * opacity) keeps both halves and is handled above.\n */\n const opposite =\n name.type === \"old\"\n ? \"new\"\n : name.type === \"new\"\n ? \"old\"\n : undefined\n if (\n opposite &&\n explicitlyAnimated.has(\n `${name.layer}:${opposite}`\n ) &&\n !opacityAnimated.has(`${name.layer}:${opposite}`)\n ) {\n animation.cancel()\n continue\n }\n\n /**\n * Otherwise retime the browser-generated animation to\n * Motion's timing. This auto-enables the layout (group)\n * morph for any resolved/named target, and applies the\n * default timing to old/new layers we haven't explicitly\n * overridden.\n *\n * group + group-children both follow the layout timing so\n * the nesting container stays in sync with the morph.\n */\n /**\n * A survivor's old + new are the two halves of one\n * `plus-lighter` crossfade. They must share identical timing\n * (so their opacities stay mirrored and sum to 1 - else the\n * additive blend flashes bright wherever both are partly\n * visible) and fade linearly (the bounce belongs on the\n * group's geometry, not the opacity). So time them as the\n * group, rather than via their own - potentially staggered,\n * or enter/exit-derived - old/new options.\n */\n const stagger = layerStagger.get(name.layer)\n const isMorphCrossfade =\n (name.type === \"old\" || name.type === \"new\") &&\n !!stagger?.old &&\n !!stagger?.new\n\n let timing: {\n delay: number\n duration?: number\n easing: string\n }\n if (name.type.startsWith(\"group\")) {\n // group + group-children follow the resolved group\n // timing - the single source shared with the crop\n // corner-radius pass below.\n const { delay, duration, ease } = resolveGroupTiming(\n name.layer\n )\n timing = {\n delay,\n duration,\n easing: mapEasingToNativeEasing(\n ease,\n duration!\n ) as string,\n }\n } else {\n const timingType = isMorphCrossfade ? \"group\" : name.type\n const [index, total] = staggerPosition(\n name.layer,\n timingType\n )\n const transitionName =\n timingType === \"group\" ? \"layout\" : \"\"\n let animationTransition = resolveLayerTransition(\n targetDefinition,\n timingType,\n transitionName,\n index === -1 ? 0 : index,\n total\n )\n\n /**\n * The crossfade should resolve at the spring's\n * *perceptual* (visual) duration - the geometry can keep\n * bouncing, but the opacity shouldn't drag through the\n * settle. So capture `visualDuration` before\n * `applyGeneratorOptions` replaces it with the full\n * overshoot duration, and use it for the fade.\n */\n const visualDuration = animationTransition.visualDuration\n\n animationTransition.duration &&= secondsToMilliseconds(\n animationTransition.duration\n )\n\n animationTransition =\n applyGeneratorOptions(animationTransition)\n\n timing = {\n delay: secondsToMilliseconds(\n animationTransition.delay ?? 0\n ),\n duration:\n isMorphCrossfade && visualDuration !== undefined\n ? secondsToMilliseconds(visualDuration)\n : animationTransition.duration,\n easing: isMorphCrossfade\n ? \"linear\"\n : (mapEasingToNativeEasing(\n animationTransition.ease,\n animationTransition.duration!\n ) as string),\n }\n }\n\n effect.updateTiming(timing)\n\n animations.push(new NativeAnimationWrapper(animation))\n }\n\n /**\n * Round each cropped layer's clip. Its `::view-transition-group`\n * has `overflow: clip`, which would otherwise square the corners\n * mid-morph; animate each corner from the old element's radius to\n * the new element's so the crop stays rounded. Timed as the group\n * (`layout`) so the radius tracks the morphing box.\n */\n cropMeasurements.forEach((entry, name) => {\n if (!croppedNames.has(name)) return\n\n // Reuse the group's resolved timing - native ms delay/\n // duration + a baked ease, with no generator `type` or\n // repeat/times to leak into (or throw inside) NativeAnimation.\n const { delay, duration, ease } = resolveGroupTiming(name)\n\n for (const corner of cornerRadiusProps) {\n // `||` (not `??`) so an empty measurement falls back to\n // the other snapshot rather than an invalid keyframe.\n const from =\n entry.old?.radii[corner] ||\n entry.new?.radii[corner] ||\n \"0px\"\n const to =\n entry.new?.radii[corner] ||\n entry.old?.radii[corner] ||\n \"0px\"\n // Nothing to round if the corner is square at both ends.\n if (isSquareRadius(from) && isSquareRadius(to)) continue\n\n animations.push(\n new NativeAnimation({\n element: document.documentElement,\n name: corner,\n pseudoElement: `::view-transition-group(${name})`,\n keyframes: [from, to],\n delay,\n duration,\n ease,\n })\n )\n }\n })\n\n resolve(new GroupAnimation(animations))\n })\n .catch(() =>\n /**\n * `ready` rejects when the transition is skipped - no visual\n * change, or superseded by an interrupting transition. The DOM\n * update still applied, so settle with no animations rather than\n * surfacing it as an error to an awaiting caller. A genuine\n * failure in `update()` rejects `updateCallbackDone` (already\n * settled by now), so propagate that instead.\n */\n transition.updateCallbackDone.then(\n () => resolve(new GroupAnimation([])),\n reject\n )\n )\n })\n}\n\n/**\n * The options that should time a given generated layer type, so a retimed\n * group/old/new picks up any per-target transition the user provided. Checks\n * the type's buckets in priority order (e.g. `new` before `enter`).\n */\nfunction layerOptions(target: ViewTransitionTarget | undefined, type: string) {\n for (const bucket of typeBuckets[type] ?? []) {\n const options = target?.[bucket]?.options\n if (options) return options\n }\n}\n\n/**\n * Merge a base transition (e.g. the default `options`) with a per-layer/value\n * override. An explicit `duration` on the override must win over an inherited\n * generator's own timing: a spring prefers `visualDuration`, and\n * `spring.applyToOptions` overwrites `duration` with the computed settle time -\n * so without this the override is silently discarded. Dropping the inherited\n * `type`/`visualDuration` makes the layer a plain tween of that duration, unless\n * it asked for its own generator `type`/`visualDuration`.\n */\nfunction mergeTransition(base: any, override: any) {\n const merged = { ...base, ...override }\n\n if (override.duration !== undefined) {\n if (override.visualDuration === undefined) delete merged.visualDuration\n if (override.type === undefined) delete merged.type\n }\n\n return merged\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAsBA,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAU;AAI1E;;;;AAIG;AACH,MAAM,cAAc,GAAG,CAAC,MAAc,KAClC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAE/D;;;;;AAKG;AACH,MAAM,WAAW,GAAmD;IAChE,KAAK,EAAE,CAAC,QAAQ,CAAC;AACjB,IAAA,GAAG,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;AACrB,IAAA,GAAG,EAAE,CAAC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