@hyperframes/parsers 0.8.167 → 0.8.169
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/composition.d.ts +2 -2
- package/dist/composition.js +18 -3
- package/dist/gsapConstants.d.ts +2 -2
- package/dist/gsapParser.d.ts +3 -3
- package/dist/gsapParserAcorn.d.ts +3 -3
- package/dist/gsapParserExports.d.ts +2 -2
- package/dist/{gsapSerialize-Cj1MDhsF.d.ts → gsapSerialize-DmU7GIhl.d.ts} +1 -1
- package/dist/gsapWriterAcorn.d.ts +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +30 -18
- package/dist/{types-Ejqndkej.d.ts → types-DhN8sPyL.d.ts} +24 -0
- package/package.json +2 -2
package/dist/composition.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CompositionVariable } from './types-
|
|
2
|
-
export { A as AddElementData, b as Asset, B as BooleanVariable, c as CANVAS_DIMENSIONS, d as COMPOSITION_VARIABLE_TYPES, a as CanvasResolution, e as ColorVariable, f as CompositionAPI, g as CompositionAsset, h as CompositionSpec, i as CompositionVariableBase, j as CompositionVariableType, D as DEFAULT_DURATIONS, E as ElementKeyframes, k as EnumVariable, F as FontVariable, I as ImageVariable, K as Keyframe, l as KeyframeProperties, M as MediaElementType, m as MediaFile, N as NumberVariable, P as PlayerAPI, R as ResolvedResolutionFlag, n as StageZoom, S as StageZoomKeyframe, o as StringVariable, p as TIMELINE_COLORS, q as TimelineCompositionElement, T as TimelineElement, r as TimelineElementBase, s as TimelineElementType, t as TimelineMediaElement, u as TimelineTextElement, v as VALID_CANVAS_RESOLUTIONS, V as ValidationResult, W as WaveformData, w as getDefaultStageZoom, x as isAspectAgnosticResolutionAlias, y as isCompositionElement, z as isMediaElement, G as isTextElement, H as normalizeResolutionFlag, J as resolveResolutionFlagPair } from './types-
|
|
1
|
+
import { C as CompositionVariable } from './types-DhN8sPyL.js';
|
|
2
|
+
export { A as AddElementData, b as Asset, B as BooleanVariable, c as CANVAS_DIMENSIONS, d as COMPOSITION_VARIABLE_TYPES, a as CanvasResolution, e as ColorVariable, f as CompositionAPI, g as CompositionAsset, h as CompositionSpec, i as CompositionVariableBase, j as CompositionVariableType, D as DEFAULT_DURATIONS, E as ElementKeyframes, k as EnumVariable, F as FontVariable, I as ImageVariable, K as Keyframe, l as KeyframeProperties, M as MediaElementType, m as MediaFile, N as NumberVariable, P as PlayerAPI, R as ResolvedResolutionFlag, n as StageZoom, S as StageZoomKeyframe, o as StringVariable, p as TIMELINE_COLORS, q as TimelineCompositionElement, T as TimelineElement, r as TimelineElementBase, s as TimelineElementType, t as TimelineMediaElement, u as TimelineTextElement, v as VALID_CANVAS_RESOLUTIONS, V as ValidationResult, W as WaveformData, w as getDefaultStageZoom, x as isAspectAgnosticResolutionAlias, y as isCompositionElement, z as isMediaElement, G as isTextElement, H as normalizeResolutionFlag, J as resolveResolutionFlagPair } from './types-DhN8sPyL.js';
|
|
3
3
|
export { c as decodeUrlPathVariants } from './urlPath-C_0f_-Hp.js';
|
|
4
4
|
export { CANONICAL_AUTHORED_TIMING_ATTRIBUTES, COMPOSITION_ATTRIBUTES, COMPOSITION_CONTRACT_VERSION, ClipAttributeReader, ClipAttributeWriter, ClipTiming, ClipTimingDiagnostic, ClipTimingDiagnosticCode, ClipTimingUpdate, ClipTimingWriteError, DERIVED_TIMING_ATTRIBUTES, LEGACY_TIMING_ATTRIBUTES, ReadClipTimingOptions, ReferenceExpression, parseNumeric, parseStartExpression, readClipTiming, writeClipTiming } from './compositionContract.js';
|
|
5
5
|
|
package/dist/composition.js
CHANGED
|
@@ -5,7 +5,14 @@ var CANVAS_DIMENSIONS = {
|
|
|
5
5
|
"landscape-4k": { width: 3840, height: 2160 },
|
|
6
6
|
"portrait-4k": { width: 2160, height: 3840 },
|
|
7
7
|
square: { width: 1080, height: 1080 },
|
|
8
|
-
"square-4k": { width: 2160, height: 2160 }
|
|
8
|
+
"square-4k": { width: 2160, height: 2160 },
|
|
9
|
+
"landscape-720p": { width: 1280, height: 720 },
|
|
10
|
+
"portrait-720p": { width: 720, height: 1280 },
|
|
11
|
+
"square-720p": { width: 720, height: 720 },
|
|
12
|
+
// 480 tall at 16:9 is 853.33 wide: 854 keeps both sides even for 4:2:0 encoders.
|
|
13
|
+
"landscape-480p": { width: 854, height: 480 },
|
|
14
|
+
"portrait-480p": { width: 480, height: 854 },
|
|
15
|
+
"square-480p": { width: 480, height: 480 }
|
|
9
16
|
};
|
|
10
17
|
var VALID_CANVAS_RESOLUTIONS = Object.keys(
|
|
11
18
|
CANVAS_DIMENSIONS
|
|
@@ -20,13 +27,21 @@ var RESOLUTION_ALIASES = {
|
|
|
20
27
|
"4k-portrait": "portrait-4k",
|
|
21
28
|
"1080p-square": "square",
|
|
22
29
|
"square-1080p": "square",
|
|
23
|
-
"4k-square": "square-4k"
|
|
30
|
+
"4k-square": "square-4k",
|
|
31
|
+
"720p": "landscape-720p",
|
|
32
|
+
"720p-portrait": "portrait-720p",
|
|
33
|
+
"720p-square": "square-720p",
|
|
34
|
+
"480p": "landscape-480p",
|
|
35
|
+
"480p-portrait": "portrait-480p",
|
|
36
|
+
"480p-square": "square-480p"
|
|
24
37
|
};
|
|
25
38
|
var ASPECT_AGNOSTIC_RESOLUTION_ALIASES = /* @__PURE__ */ new Set([
|
|
26
39
|
"1080p",
|
|
27
40
|
"hd",
|
|
28
41
|
"4k",
|
|
29
|
-
"uhd"
|
|
42
|
+
"uhd",
|
|
43
|
+
"720p",
|
|
44
|
+
"480p"
|
|
30
45
|
]);
|
|
31
46
|
function normalizeResolutionFlag(input) {
|
|
32
47
|
if (!input) return void 0;
|
package/dist/gsapConstants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { B as BUILTIN_VAR_KEYS, D as DROPPED_VAR_KEYS, E as EXTRAS_KEYS, u as GSAP_DEFAULT_DURATION, H as HoldScope, f as PROPERTY_GROUPS, g as PropertyGroupName, S as SUPPORTED_EASES, h as SUPPORTED_PROPS, i as classifyPropertyGroup, j as classifyTweenPropertyGroup, x as holdScope, y as isTweenConfigKey, z as isXYPositionWrite, C as keyframeHoldForAnimation } from './gsapSerialize-
|
|
2
|
-
import './types-
|
|
1
|
+
export { B as BUILTIN_VAR_KEYS, D as DROPPED_VAR_KEYS, E as EXTRAS_KEYS, u as GSAP_DEFAULT_DURATION, H as HoldScope, f as PROPERTY_GROUPS, g as PropertyGroupName, S as SUPPORTED_EASES, h as SUPPORTED_PROPS, i as classifyPropertyGroup, j as classifyTweenPropertyGroup, x as holdScope, y as isTweenConfigKey, z as isXYPositionWrite, C as keyframeHoldForAnimation } from './gsapSerialize-DmU7GIhl.js';
|
|
2
|
+
import './types-DhN8sPyL.js';
|
package/dist/gsapParser.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { G as GsapAnimation, P as ParsedGsap, A as ArcPathConfig, a as ArcPathSegment } from './gsapSerialize-
|
|
2
|
-
export { b as GsapKeyframeFormat, c as GsapKeyframesData, d as GsapMethod, e as GsapPercentageKeyframe, f as PROPERTY_GROUPS, g as PropertyGroupName, S as SUPPORTED_EASES, h as SUPPORTED_PROPS, i as classifyPropertyGroup, j as classifyTweenPropertyGroup, k as getAnimationsForElementId, l as gsapAnimationsToKeyframes, m as keyframesToGsapAnimations, s as serializeGsapAnimations, v as validateCompositionGsap } from './gsapSerialize-
|
|
1
|
+
import { G as GsapAnimation, P as ParsedGsap, A as ArcPathConfig, a as ArcPathSegment } from './gsapSerialize-DmU7GIhl.js';
|
|
2
|
+
export { b as GsapKeyframeFormat, c as GsapKeyframesData, d as GsapMethod, e as GsapPercentageKeyframe, f as PROPERTY_GROUPS, g as PropertyGroupName, S as SUPPORTED_EASES, h as SUPPORTED_PROPS, i as classifyPropertyGroup, j as classifyTweenPropertyGroup, k as getAnimationsForElementId, l as gsapAnimationsToKeyframes, m as keyframesToGsapAnimations, s as serializeGsapAnimations, v as validateCompositionGsap } from './gsapSerialize-DmU7GIhl.js';
|
|
3
3
|
export { SPRING_PRESETS, SpringPreset, generateSpringEaseData } from './springEase.js';
|
|
4
|
-
import './types-
|
|
4
|
+
import './types-DhN8sPyL.js';
|
|
5
5
|
|
|
6
6
|
declare function parseGsapScript(script: string): ParsedGsap;
|
|
7
7
|
declare function updateAnimationInScript(script: string, animationId: string, updates: Partial<GsapAnimation> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as ParsedGsap, d as GsapMethod, G as GsapAnimation } from './gsapSerialize-
|
|
2
|
-
export { A as ArcPathConfig, a as ArcPathSegment, n as GsapProvenance, o as GsapProvenanceKind, K as KeyframeEditability, M as MotionPathShape, p as buildArcPath, q as editabilityForProvenance } from './gsapSerialize-
|
|
3
|
-
import './types-
|
|
1
|
+
import { P as ParsedGsap, d as GsapMethod, G as GsapAnimation } from './gsapSerialize-DmU7GIhl.js';
|
|
2
|
+
export { A as ArcPathConfig, a as ArcPathSegment, n as GsapProvenance, o as GsapProvenanceKind, K as KeyframeEditability, M as MotionPathShape, p as buildArcPath, q as editabilityForProvenance } from './gsapSerialize-DmU7GIhl.js';
|
|
3
|
+
import './types-DhN8sPyL.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* A script's syntax tree as one string, or null when it does not parse. Comments, layout, quote
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { A as ArcPathConfig, a as ArcPathSegment, u as GSAP_DEFAULT_DURATION, G as GsapAnimation, c as GsapKeyframesData, d as GsapMethod, e as GsapPercentageKeyframe, n as GsapProvenance, o as GsapProvenanceKind, K as KeyframeEditability, f as PROPERTY_GROUPS, P as ParsedGsap, g as PropertyGroupName, S as SUPPORTED_EASES, h as SUPPORTED_PROPS, w as SourcedGsapPercentageKeyframe, r as SplitAnimationsOptions, t as SplitAnimationsResult, i as classifyPropertyGroup, j as classifyTweenPropertyGroup, q as editabilityForProvenance, k as getAnimationsForElementId, l as gsapAnimationsToKeyframes, m as keyframesToGsapAnimations, s as serializeGsapAnimations, v as validateCompositionGsap } from './gsapSerialize-
|
|
1
|
+
export { A as ArcPathConfig, a as ArcPathSegment, u as GSAP_DEFAULT_DURATION, G as GsapAnimation, c as GsapKeyframesData, d as GsapMethod, e as GsapPercentageKeyframe, n as GsapProvenance, o as GsapProvenanceKind, K as KeyframeEditability, f as PROPERTY_GROUPS, P as ParsedGsap, g as PropertyGroupName, S as SUPPORTED_EASES, h as SUPPORTED_PROPS, w as SourcedGsapPercentageKeyframe, r as SplitAnimationsOptions, t as SplitAnimationsResult, i as classifyPropertyGroup, j as classifyTweenPropertyGroup, q as editabilityForProvenance, k as getAnimationsForElementId, l as gsapAnimationsToKeyframes, m as keyframesToGsapAnimations, s as serializeGsapAnimations, v as validateCompositionGsap } from './gsapSerialize-DmU7GIhl.js';
|
|
2
2
|
export { isStudioHoldSet } from './gsapParser.js';
|
|
3
3
|
export { SPRING_PRESETS, SpringPreset, generateSpringEaseData } from './springEase.js';
|
|
4
4
|
export { parseGsapScriptAcorn as parseGsapScript } from './gsapParserAcorn.js';
|
|
5
|
-
import './types-
|
|
5
|
+
import './types-DhN8sPyL.js';
|
|
6
6
|
|
|
7
7
|
interface ObjectArrayKeyframeTiming {
|
|
8
8
|
percentages: number[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as GsapAnimation, A as ArcPathConfig, r as SplitAnimationsOptions, t as SplitAnimationsResult, a as ArcPathSegment } from './gsapSerialize-
|
|
2
|
-
import './types-
|
|
1
|
+
import { G as GsapAnimation, A as ArcPathConfig, r as SplitAnimationsOptions, t as SplitAnimationsResult, a as ArcPathSegment } from './gsapSerialize-DmU7GIhl.js';
|
|
2
|
+
import './types-DhN8sPyL.js';
|
|
3
3
|
|
|
4
4
|
type TweenTarget = Pick<GsapAnimation, "targetSelector" | "hasPartialSelector">;
|
|
5
5
|
type TweenTime = Pick<GsapAnimation, "position" | "implicitPosition">;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as CompositionVariable, T as TimelineElement, a as CanvasResolution, K as Keyframe, S as StageZoomKeyframe, V as ValidationResult } from './types-
|
|
2
|
-
export { A as AddElementData, b as Asset, B as BooleanVariable, c as CANVAS_DIMENSIONS, d as COMPOSITION_VARIABLE_TYPES, e as ColorVariable, f as CompositionAPI, g as CompositionAsset, h as CompositionSpec, i as CompositionVariableBase, j as CompositionVariableType, D as DEFAULT_DURATIONS, E as ElementKeyframes, k as EnumVariable, F as FontVariable, I as ImageVariable, l as KeyframeProperties, M as MediaElementType, m as MediaFile, N as NumberVariable, P as PlayerAPI, R as ResolvedResolutionFlag, n as StageZoom, o as StringVariable, p as TIMELINE_COLORS, q as TimelineCompositionElement, r as TimelineElementBase, s as TimelineElementType, t as TimelineMediaElement, u as TimelineTextElement, v as VALID_CANVAS_RESOLUTIONS, W as WaveformData, w as getDefaultStageZoom, x as isAspectAgnosticResolutionAlias, y as isCompositionElement, z as isMediaElement, G as isTextElement, H as normalizeResolutionFlag, J as resolveResolutionFlagPair } from './types-
|
|
3
|
-
export { A as ArcPathConfig, a as ArcPathSegment, u as GSAP_DEFAULT_DURATION, G as GsapAnimation, c as GsapKeyframesData, d as GsapMethod, e as GsapPercentageKeyframe, n as GsapProvenance, o as GsapProvenanceKind, K as KeyframeEditability, f as PROPERTY_GROUPS, P as ParsedGsap, g as PropertyGroupName, S as SUPPORTED_EASES, h as SUPPORTED_PROPS, w as SourcedGsapPercentageKeyframe, r as SplitAnimationsOptions, t as SplitAnimationsResult, i as classifyPropertyGroup, j as classifyTweenPropertyGroup, q as editabilityForProvenance, k as getAnimationsForElementId, l as gsapAnimationsToKeyframes, m as keyframesToGsapAnimations, s as serializeGsapAnimations, v as validateCompositionGsap } from './gsapSerialize-
|
|
1
|
+
import { C as CompositionVariable, T as TimelineElement, a as CanvasResolution, K as Keyframe, S as StageZoomKeyframe, V as ValidationResult } from './types-DhN8sPyL.js';
|
|
2
|
+
export { A as AddElementData, b as Asset, B as BooleanVariable, c as CANVAS_DIMENSIONS, d as COMPOSITION_VARIABLE_TYPES, e as ColorVariable, f as CompositionAPI, g as CompositionAsset, h as CompositionSpec, i as CompositionVariableBase, j as CompositionVariableType, D as DEFAULT_DURATIONS, E as ElementKeyframes, k as EnumVariable, F as FontVariable, I as ImageVariable, l as KeyframeProperties, M as MediaElementType, m as MediaFile, N as NumberVariable, P as PlayerAPI, R as ResolvedResolutionFlag, n as StageZoom, o as StringVariable, p as TIMELINE_COLORS, q as TimelineCompositionElement, r as TimelineElementBase, s as TimelineElementType, t as TimelineMediaElement, u as TimelineTextElement, v as VALID_CANVAS_RESOLUTIONS, W as WaveformData, w as getDefaultStageZoom, x as isAspectAgnosticResolutionAlias, y as isCompositionElement, z as isMediaElement, G as isTextElement, H as normalizeResolutionFlag, J as resolveResolutionFlagPair } from './types-DhN8sPyL.js';
|
|
3
|
+
export { A as ArcPathConfig, a as ArcPathSegment, u as GSAP_DEFAULT_DURATION, G as GsapAnimation, c as GsapKeyframesData, d as GsapMethod, e as GsapPercentageKeyframe, n as GsapProvenance, o as GsapProvenanceKind, K as KeyframeEditability, f as PROPERTY_GROUPS, P as ParsedGsap, g as PropertyGroupName, S as SUPPORTED_EASES, h as SUPPORTED_PROPS, w as SourcedGsapPercentageKeyframe, r as SplitAnimationsOptions, t as SplitAnimationsResult, i as classifyPropertyGroup, j as classifyTweenPropertyGroup, q as editabilityForProvenance, k as getAnimationsForElementId, l as gsapAnimationsToKeyframes, m as keyframesToGsapAnimations, s as serializeGsapAnimations, v as validateCompositionGsap } from './gsapSerialize-DmU7GIhl.js';
|
|
4
4
|
export { isStudioHoldSet } from './gsapParser.js';
|
|
5
5
|
export { getObjectArrayKeyframeTiming } from './gsapParserExports.js';
|
|
6
6
|
export { SPRING_PRESETS, SpringPreset, generateSpringEaseData } from './springEase.js';
|
|
@@ -80,7 +80,7 @@ declare function validateCompositionHtml(html: string): ValidationResult;
|
|
|
80
80
|
* `core`. The geometry it needs (`CANVAS_DIMENSIONS`) already lives here.
|
|
81
81
|
*/
|
|
82
82
|
|
|
83
|
-
type OutputResolutionIssueKind = "hdr-incompatible" | "aspect-mismatch" | "
|
|
83
|
+
type OutputResolutionIssueKind = "hdr-incompatible" | "aspect-mismatch" | "non-integer-scale";
|
|
84
84
|
interface OutputResolutionCompatibility {
|
|
85
85
|
ok: boolean;
|
|
86
86
|
/** Present when `ok` is false. */
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,14 @@ var CANVAS_DIMENSIONS = {
|
|
|
5
5
|
"landscape-4k": { width: 3840, height: 2160 },
|
|
6
6
|
"portrait-4k": { width: 2160, height: 3840 },
|
|
7
7
|
square: { width: 1080, height: 1080 },
|
|
8
|
-
"square-4k": { width: 2160, height: 2160 }
|
|
8
|
+
"square-4k": { width: 2160, height: 2160 },
|
|
9
|
+
"landscape-720p": { width: 1280, height: 720 },
|
|
10
|
+
"portrait-720p": { width: 720, height: 1280 },
|
|
11
|
+
"square-720p": { width: 720, height: 720 },
|
|
12
|
+
// 480 tall at 16:9 is 853.33 wide: 854 keeps both sides even for 4:2:0 encoders.
|
|
13
|
+
"landscape-480p": { width: 854, height: 480 },
|
|
14
|
+
"portrait-480p": { width: 480, height: 854 },
|
|
15
|
+
"square-480p": { width: 480, height: 480 }
|
|
9
16
|
};
|
|
10
17
|
var VALID_CANVAS_RESOLUTIONS = Object.keys(
|
|
11
18
|
CANVAS_DIMENSIONS
|
|
@@ -20,13 +27,21 @@ var RESOLUTION_ALIASES = {
|
|
|
20
27
|
"4k-portrait": "portrait-4k",
|
|
21
28
|
"1080p-square": "square",
|
|
22
29
|
"square-1080p": "square",
|
|
23
|
-
"4k-square": "square-4k"
|
|
30
|
+
"4k-square": "square-4k",
|
|
31
|
+
"720p": "landscape-720p",
|
|
32
|
+
"720p-portrait": "portrait-720p",
|
|
33
|
+
"720p-square": "square-720p",
|
|
34
|
+
"480p": "landscape-480p",
|
|
35
|
+
"480p-portrait": "portrait-480p",
|
|
36
|
+
"480p-square": "square-480p"
|
|
24
37
|
};
|
|
25
38
|
var ASPECT_AGNOSTIC_RESOLUTION_ALIASES = /* @__PURE__ */ new Set([
|
|
26
39
|
"1080p",
|
|
27
40
|
"hd",
|
|
28
41
|
"4k",
|
|
29
|
-
"uhd"
|
|
42
|
+
"uhd",
|
|
43
|
+
"720p",
|
|
44
|
+
"480p"
|
|
30
45
|
]);
|
|
31
46
|
function normalizeResolutionFlag(input) {
|
|
32
47
|
if (!input) return void 0;
|
|
@@ -3646,14 +3661,17 @@ function checkSubCompositionUsability(html, parseHtml2) {
|
|
|
3646
3661
|
// src/outputResolutionCompatibility.ts
|
|
3647
3662
|
var OK = { ok: true };
|
|
3648
3663
|
function suggestMatchingPreset(compositionWidth, compositionHeight, chosen) {
|
|
3649
|
-
const aspectMatches = VALID_CANVAS_RESOLUTIONS.filter(
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
});
|
|
3664
|
+
const aspectMatches = VALID_CANVAS_RESOLUTIONS.filter(
|
|
3665
|
+
(preset) => fitsAspect(CANVAS_DIMENSIONS[preset], compositionWidth, compositionHeight)
|
|
3666
|
+
);
|
|
3653
3667
|
if (aspectMatches.length === 0) return void 0;
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3668
|
+
return aspectMatches.find((preset) => tierOf(preset) === tierOf(chosen));
|
|
3669
|
+
}
|
|
3670
|
+
var tierOf = (preset) => preset.includes("-") ? preset.slice(preset.indexOf("-")) : "";
|
|
3671
|
+
function fitsAspect(target, compositionWidth, compositionHeight) {
|
|
3672
|
+
const drift = Math.abs(target.width * compositionHeight - target.height * compositionWidth);
|
|
3673
|
+
if (drift === 0) return true;
|
|
3674
|
+
return target.width < compositionWidth && drift < Math.min(compositionWidth, compositionHeight);
|
|
3657
3675
|
}
|
|
3658
3676
|
function describeOrientation(width, height) {
|
|
3659
3677
|
if (width > height) return "landscape";
|
|
@@ -3685,17 +3703,11 @@ function checkOutputResolutionCompatibility(input) {
|
|
|
3685
3703
|
};
|
|
3686
3704
|
}
|
|
3687
3705
|
const target = CANVAS_DIMENSIONS[outputResolution];
|
|
3688
|
-
if (target
|
|
3706
|
+
if (!fitsAspect(target, compositionWidth, compositionHeight)) {
|
|
3689
3707
|
return buildAspectMismatch(compositionWidth, compositionHeight, outputResolution, target);
|
|
3690
3708
|
}
|
|
3691
3709
|
const widthRatio = target.width / compositionWidth;
|
|
3692
|
-
if (widthRatio < 1)
|
|
3693
|
-
return {
|
|
3694
|
-
ok: false,
|
|
3695
|
-
kind: "downsampling",
|
|
3696
|
-
message: `outputResolution ${outputResolution} (${target.width}\xD7${target.height}) is smaller than the composition (${compositionWidth}\xD7${compositionHeight}). Downsampling via --resolution is not supported.`
|
|
3697
|
-
};
|
|
3698
|
-
}
|
|
3710
|
+
if (widthRatio < 1) return OK;
|
|
3699
3711
|
if (!Number.isInteger(widthRatio)) {
|
|
3700
3712
|
return {
|
|
3701
3713
|
ok: false,
|
|
@@ -33,6 +33,30 @@ declare const CANVAS_DIMENSIONS: {
|
|
|
33
33
|
readonly width: 2160;
|
|
34
34
|
readonly height: 2160;
|
|
35
35
|
};
|
|
36
|
+
readonly "landscape-720p": {
|
|
37
|
+
readonly width: 1280;
|
|
38
|
+
readonly height: 720;
|
|
39
|
+
};
|
|
40
|
+
readonly "portrait-720p": {
|
|
41
|
+
readonly width: 720;
|
|
42
|
+
readonly height: 1280;
|
|
43
|
+
};
|
|
44
|
+
readonly "square-720p": {
|
|
45
|
+
readonly width: 720;
|
|
46
|
+
readonly height: 720;
|
|
47
|
+
};
|
|
48
|
+
readonly "landscape-480p": {
|
|
49
|
+
readonly width: 854;
|
|
50
|
+
readonly height: 480;
|
|
51
|
+
};
|
|
52
|
+
readonly "portrait-480p": {
|
|
53
|
+
readonly width: 480;
|
|
54
|
+
readonly height: 854;
|
|
55
|
+
};
|
|
56
|
+
readonly "square-480p": {
|
|
57
|
+
readonly width: 480;
|
|
58
|
+
readonly height: 480;
|
|
59
|
+
};
|
|
36
60
|
};
|
|
37
61
|
type CanvasResolution = keyof typeof CANVAS_DIMENSIONS;
|
|
38
62
|
declare const VALID_CANVAS_RESOLUTIONS: readonly CanvasResolution[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/parsers",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.169",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/heygen-com/hyperframes",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"tsx": "^4.21.0",
|
|
120
120
|
"typescript": "^5.0.0",
|
|
121
121
|
"vitest": "^4.1.11",
|
|
122
|
-
"@hyperframes/core": "0.8.
|
|
122
|
+
"@hyperframes/core": "0.8.169"
|
|
123
123
|
},
|
|
124
124
|
"scripts": {
|
|
125
125
|
"build": "tsup",
|