@anvpx/motion-build 0.1.35 → 0.1.37
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/lint/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { minHoldRule } from "./min-hold.ts";
|
|
|
9
9
|
import { flatMotionRule, holdAfterAccentRule, transitionEaseMismatchRule, unsupportedMotionRule } from "./motion-craft.ts";
|
|
10
10
|
import { narrationPaceRule } from "./narration-pace.ts";
|
|
11
11
|
import { overlayFitRule, overlayStackRule, overlayTargetRule } from "./overlays.ts";
|
|
12
|
+
import { plateOverCaptionRule } from "./plate-over-caption.ts";
|
|
12
13
|
import { readingTimeRule } from "./reading-time.ts";
|
|
13
14
|
import { safeZone9x16Rule } from "./safe-zone-9x16.ts";
|
|
14
15
|
import { textFloorRule } from "./text-floor.ts";
|
|
@@ -18,7 +19,7 @@ import { duplicatedEmphasisRule, lineLengthRule, offGridSpacingRule, typeDensity
|
|
|
18
19
|
import type { LintInput, LintResult, LintRule } from "./types.ts";
|
|
19
20
|
import { wordsOnScreenRule } from "./words-on-screen.ts";
|
|
20
21
|
export type { LintFinding, LintInput, LintResult, LintRule, PlatformMarginLookup, PlatformMargins, } from "./types.ts";
|
|
21
|
-
export { contentOverflowRule, duplicatedEmphasisRule, fadeDeckRule, flatMotionRule, flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule, holdAfterAccentRule, hookFirstRule, linearEaseRule, lineLengthRule, longHoldRule, minHoldRule, narrationPaceRule, offGridSpacingRule, overlayFitRule, overlayStackRule, overlayTargetRule, readingTimeRule, safeZone9x16Rule, spanNeedsTwoBodiesRule, textFloorRule, transitionEaseMismatchRule, transitionImplementedRule, transitionLengthRule, typeDensityRule, unsupportedMotionRule, wordsOnScreenRule, };
|
|
22
|
+
export { contentOverflowRule, duplicatedEmphasisRule, fadeDeckRule, flatMotionRule, flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule, holdAfterAccentRule, hookFirstRule, linearEaseRule, lineLengthRule, longHoldRule, minHoldRule, narrationPaceRule, offGridSpacingRule, overlayFitRule, overlayStackRule, overlayTargetRule, plateOverCaptionRule, readingTimeRule, safeZone9x16Rule, spanNeedsTwoBodiesRule, textFloorRule, transitionEaseMismatchRule, transitionImplementedRule, transitionLengthRule, typeDensityRule, unsupportedMotionRule, wordsOnScreenRule, };
|
|
22
23
|
/**
|
|
23
24
|
* All rules, in report order. Contrast lives in theme tokens.
|
|
24
25
|
* Craft rules (motion-craft, type-grid) run after the timing and layout
|
package/dist/lint/index.js
CHANGED
|
@@ -3,12 +3,14 @@ import { fadeDeckRule } from "./fade-deck.js";
|
|
|
3
3
|
import { flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule } from "./flow.js";
|
|
4
4
|
import { hookFirstRule } from "./hook-first.js";
|
|
5
5
|
import { linearEaseRule } from "./linear-ease.js";
|
|
6
|
+
import { literalMarkupRule } from "./literal-markup.js";
|
|
6
7
|
import { longHoldRule } from "./long-hold.js";
|
|
7
8
|
import { spanNeedsTwoBodiesRule } from "./measure-span.js";
|
|
8
9
|
import { minHoldRule } from "./min-hold.js";
|
|
9
10
|
import { flatMotionRule, holdAfterAccentRule, transitionEaseMismatchRule, unsupportedMotionRule, } from "./motion-craft.js";
|
|
10
11
|
import { narrationPaceRule } from "./narration-pace.js";
|
|
11
12
|
import { overlayFitRule, overlayStackRule, overlayTargetRule } from "./overlays.js";
|
|
13
|
+
import { plateOverCaptionRule } from "./plate-over-caption.js";
|
|
12
14
|
import { readingTimeRule } from "./reading-time.js";
|
|
13
15
|
import { safeZone9x16Rule } from "./safe-zone-9x16.js";
|
|
14
16
|
import { textFloorRule } from "./text-floor.js";
|
|
@@ -16,7 +18,7 @@ import { transitionImplementedRule } from "./transition-implemented.js";
|
|
|
16
18
|
import { transitionLengthRule } from "./transition-length.js";
|
|
17
19
|
import { duplicatedEmphasisRule, lineLengthRule, offGridSpacingRule, typeDensityRule, } from "./type-grid.js";
|
|
18
20
|
import { wordsOnScreenRule } from "./words-on-screen.js";
|
|
19
|
-
export { contentOverflowRule, duplicatedEmphasisRule, fadeDeckRule, flatMotionRule, flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule, holdAfterAccentRule, hookFirstRule, linearEaseRule, lineLengthRule, longHoldRule, minHoldRule, narrationPaceRule, offGridSpacingRule, overlayFitRule, overlayStackRule, overlayTargetRule, readingTimeRule, safeZone9x16Rule, spanNeedsTwoBodiesRule, textFloorRule, transitionEaseMismatchRule, transitionImplementedRule, transitionLengthRule, typeDensityRule, unsupportedMotionRule, wordsOnScreenRule, };
|
|
21
|
+
export { contentOverflowRule, duplicatedEmphasisRule, fadeDeckRule, flatMotionRule, flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule, holdAfterAccentRule, hookFirstRule, linearEaseRule, lineLengthRule, longHoldRule, minHoldRule, narrationPaceRule, offGridSpacingRule, overlayFitRule, overlayStackRule, overlayTargetRule, plateOverCaptionRule, readingTimeRule, safeZone9x16Rule, spanNeedsTwoBodiesRule, textFloorRule, transitionEaseMismatchRule, transitionImplementedRule, transitionLengthRule, typeDensityRule, unsupportedMotionRule, wordsOnScreenRule, };
|
|
20
22
|
/**
|
|
21
23
|
* All rules, in report order. Contrast lives in theme tokens.
|
|
22
24
|
* Craft rules (motion-craft, type-grid) run after the timing and layout
|
|
@@ -38,10 +40,12 @@ export const LINT_RULES = [
|
|
|
38
40
|
wordsOnScreenRule,
|
|
39
41
|
longHoldRule,
|
|
40
42
|
linearEaseRule,
|
|
43
|
+
literalMarkupRule,
|
|
41
44
|
narrationPaceRule,
|
|
42
45
|
hookFirstRule,
|
|
43
46
|
safeZone9x16Rule,
|
|
44
47
|
contentOverflowRule,
|
|
48
|
+
plateOverCaptionRule,
|
|
45
49
|
fadeDeckRule,
|
|
46
50
|
flatMotionRule,
|
|
47
51
|
unsupportedMotionRule,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authoring markup that reached the screen.
|
|
3
|
+
*
|
|
4
|
+
* Three reviewers of a cold-run board flagged a literal caret in the equation
|
|
5
|
+
* "Balance = deposit x (1 + rate)^years": an agent wrote markup, the renderer printed it.
|
|
6
|
+
* The same class of defect covers asterisks, underscores and arrows in on-screen text.
|
|
7
|
+
* Brackets are excluded on purpose — `[accent]` is the kit's own markup and is meant to show.
|
|
8
|
+
*/
|
|
9
|
+
const MARKUP = /(\^|\*\*|__|=>|->|\\n|\\t|<[a-z/])/i;
|
|
10
|
+
const textValues = (props) => {
|
|
11
|
+
if (props === undefined)
|
|
12
|
+
return [];
|
|
13
|
+
const out = [];
|
|
14
|
+
for (const [key, value] of Object.entries(props)) {
|
|
15
|
+
if (key === "image" || key === "src")
|
|
16
|
+
continue;
|
|
17
|
+
if (typeof value === "string")
|
|
18
|
+
out.push(value);
|
|
19
|
+
else if (Array.isArray(value))
|
|
20
|
+
for (const item of value)
|
|
21
|
+
if (typeof item === "string")
|
|
22
|
+
out.push(item);
|
|
23
|
+
}
|
|
24
|
+
return out;
|
|
25
|
+
};
|
|
26
|
+
export const literalMarkupRule = ({ storyboard }) => {
|
|
27
|
+
const findings = [];
|
|
28
|
+
storyboard.scenes.forEach((scene, index) => {
|
|
29
|
+
for (const text of textValues(scene.props)) {
|
|
30
|
+
const hit = MARKUP.exec(text);
|
|
31
|
+
if (hit === null)
|
|
32
|
+
continue;
|
|
33
|
+
findings.push({
|
|
34
|
+
severity: "warning",
|
|
35
|
+
path: `/scenes/${index}`,
|
|
36
|
+
message: `on-screen text contains authoring markup ("${hit[0]}") which will print literally`,
|
|
37
|
+
suggestion: 'write the words the viewer should read: "rate squared", not "rate^2"',
|
|
38
|
+
});
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return findings;
|
|
43
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LintRule } from "./types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* A name plate on the left will cover a picture that sits on the left's mirror: a
|
|
4
|
+
* `media-frame` with `layout: "right"` puts its own caption where the plate lands.
|
|
5
|
+
* Found by rendering the presenter layout in round 56, not by reading the catalog —
|
|
6
|
+
* the prop to fix it (`lower-third` `align`) already existed and nothing said to use it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const plateOverCaptionRule: LintRule;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A name plate on the left will cover a picture that sits on the left's mirror: a
|
|
3
|
+
* `media-frame` with `layout: "right"` puts its own caption where the plate lands.
|
|
4
|
+
* Found by rendering the presenter layout in round 56, not by reading the catalog —
|
|
5
|
+
* the prop to fix it (`lower-third` `align`) already existed and nothing said to use it.
|
|
6
|
+
*/
|
|
7
|
+
export const plateOverCaptionRule = ({ storyboard }) => {
|
|
8
|
+
const rightFrames = new Set(storyboard.scenes
|
|
9
|
+
.filter((scene) => scene.type === "media-frame" && scene.props?.layout === "right")
|
|
10
|
+
.map((scene) => scene.id));
|
|
11
|
+
if (rightFrames.size === 0)
|
|
12
|
+
return [];
|
|
13
|
+
const findings = [];
|
|
14
|
+
storyboard.scenes.forEach((scene, index) => {
|
|
15
|
+
if (scene.type !== "lower-third")
|
|
16
|
+
return;
|
|
17
|
+
const align = scene.props?.align ?? "left";
|
|
18
|
+
if (align === "right")
|
|
19
|
+
return;
|
|
20
|
+
const over = typeof scene.over === "string" ? scene.over : undefined;
|
|
21
|
+
if (over === undefined || !rightFrames.has(over))
|
|
22
|
+
return;
|
|
23
|
+
findings.push({
|
|
24
|
+
severity: "warning",
|
|
25
|
+
path: `/scenes/${index}/props/align`,
|
|
26
|
+
message: `plate "${scene.id}" sits where the caption of "${over}" sits`,
|
|
27
|
+
suggestion: 'set props.align to "right" so the plate clears the framed picture',
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
return findings;
|
|
31
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anvpx/motion-build",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.37",
|
|
4
4
|
"description": "Storyboard compiler for @anvpx/motion: validation, scene emission and HyperFrames project output.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "anvpx",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"@fontsource/jetbrains-mono": "5.3.0",
|
|
32
32
|
"@fontsource/source-serif-4": "5.3.1",
|
|
33
33
|
"@fontsource/space-grotesk": "5.3.0",
|
|
34
|
-
"@anvpx/motion-scenes": "0.1.
|
|
35
|
-
"@anvpx/motion-schema": "0.1.
|
|
36
|
-
"@anvpx/motion-themes": "0.1.
|
|
34
|
+
"@anvpx/motion-scenes": "0.1.37",
|
|
35
|
+
"@anvpx/motion-schema": "0.1.37",
|
|
36
|
+
"@anvpx/motion-themes": "0.1.37",
|
|
37
37
|
"postprocessing": "6.39.5",
|
|
38
38
|
"three": "0.186.0"
|
|
39
39
|
},
|