@anvpx/motion-build 0.1.20 → 0.1.21
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
|
@@ -3,6 +3,7 @@ import { flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule } from "./flow.t
|
|
|
3
3
|
import { hookFirstRule } from "./hook-first.ts";
|
|
4
4
|
import { linearEaseRule } from "./linear-ease.ts";
|
|
5
5
|
import { longHoldRule } from "./long-hold.ts";
|
|
6
|
+
import { spanNeedsTwoBodiesRule } from "./measure-span.ts";
|
|
6
7
|
import { minHoldRule } from "./min-hold.ts";
|
|
7
8
|
import { flatMotionRule, holdAfterAccentRule, transitionEaseMismatchRule, unsupportedMotionRule } from "./motion-craft.ts";
|
|
8
9
|
import { narrationPaceRule } from "./narration-pace.ts";
|
|
@@ -16,7 +17,7 @@ import { duplicatedEmphasisRule, lineLengthRule, offGridSpacingRule, typeDensity
|
|
|
16
17
|
import type { LintInput, LintResult, LintRule } from "./types.ts";
|
|
17
18
|
import { wordsOnScreenRule } from "./words-on-screen.ts";
|
|
18
19
|
export type { LintFinding, LintInput, LintResult, LintRule, PlatformMarginLookup, PlatformMargins, } from "./types.ts";
|
|
19
|
-
export { contentOverflowRule, duplicatedEmphasisRule, flatMotionRule, flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule, holdAfterAccentRule, hookFirstRule, linearEaseRule, lineLengthRule, longHoldRule, minHoldRule, narrationPaceRule, offGridSpacingRule, overlayFitRule, overlayStackRule, overlayTargetRule, readingTimeRule, safeZone9x16Rule, textFloorRule, transitionEaseMismatchRule, transitionImplementedRule, transitionLengthRule, typeDensityRule, unsupportedMotionRule, wordsOnScreenRule, };
|
|
20
|
+
export { contentOverflowRule, duplicatedEmphasisRule, 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, };
|
|
20
21
|
/**
|
|
21
22
|
* All rules, in report order. Contrast lives in theme tokens.
|
|
22
23
|
* Craft rules (motion-craft, type-grid) run after the timing and layout
|
package/dist/lint/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule } from "./flow.j
|
|
|
3
3
|
import { hookFirstRule } from "./hook-first.js";
|
|
4
4
|
import { linearEaseRule } from "./linear-ease.js";
|
|
5
5
|
import { longHoldRule } from "./long-hold.js";
|
|
6
|
+
import { spanNeedsTwoBodiesRule } from "./measure-span.js";
|
|
6
7
|
import { minHoldRule } from "./min-hold.js";
|
|
7
8
|
import { flatMotionRule, holdAfterAccentRule, transitionEaseMismatchRule, unsupportedMotionRule, } from "./motion-craft.js";
|
|
8
9
|
import { narrationPaceRule } from "./narration-pace.js";
|
|
@@ -14,13 +15,14 @@ import { transitionImplementedRule } from "./transition-implemented.js";
|
|
|
14
15
|
import { transitionLengthRule } from "./transition-length.js";
|
|
15
16
|
import { duplicatedEmphasisRule, lineLengthRule, offGridSpacingRule, typeDensityRule, } from "./type-grid.js";
|
|
16
17
|
import { wordsOnScreenRule } from "./words-on-screen.js";
|
|
17
|
-
export { contentOverflowRule, duplicatedEmphasisRule, flatMotionRule, flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule, holdAfterAccentRule, hookFirstRule, linearEaseRule, lineLengthRule, longHoldRule, minHoldRule, narrationPaceRule, offGridSpacingRule, overlayFitRule, overlayStackRule, overlayTargetRule, readingTimeRule, safeZone9x16Rule, textFloorRule, transitionEaseMismatchRule, transitionImplementedRule, transitionLengthRule, typeDensityRule, unsupportedMotionRule, wordsOnScreenRule, };
|
|
18
|
+
export { contentOverflowRule, duplicatedEmphasisRule, 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, };
|
|
18
19
|
/**
|
|
19
20
|
* All rules, in report order. Contrast lives in theme tokens.
|
|
20
21
|
* Craft rules (motion-craft, type-grid) run after the timing and layout
|
|
21
22
|
* gates so their pointers stay stable when earlier rules change.
|
|
22
23
|
*/
|
|
23
24
|
export const LINT_RULES = [
|
|
25
|
+
spanNeedsTwoBodiesRule,
|
|
24
26
|
minHoldRule,
|
|
25
27
|
readingTimeRule,
|
|
26
28
|
transitionLengthRule,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LintRule } from "./types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* `annotate: "span"` draws a caliper between the hero and the comparison body and prints
|
|
4
|
+
* their gap as a ratio. With one body there is no gap to measure, so the readout prints
|
|
5
|
+
* "0.0" — a number that means nothing on screen. Requiring a second body is the cheapest
|
|
6
|
+
* possible guard: it costs the author one prop or one caption, and it removes a readout
|
|
7
|
+
* that looks broken rather than deliberate.
|
|
8
|
+
*/
|
|
9
|
+
export declare const spanNeedsTwoBodiesRule: LintRule;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `annotate: "span"` draws a caliper between the hero and the comparison body and prints
|
|
3
|
+
* their gap as a ratio. With one body there is no gap to measure, so the readout prints
|
|
4
|
+
* "0.0" — a number that means nothing on screen. Requiring a second body is the cheapest
|
|
5
|
+
* possible guard: it costs the author one prop or one caption, and it removes a readout
|
|
6
|
+
* that looks broken rather than deliberate.
|
|
7
|
+
*/
|
|
8
|
+
export const spanNeedsTwoBodiesRule = ({ storyboard }) => {
|
|
9
|
+
const findings = [];
|
|
10
|
+
for (const [index, scene] of storyboard.scenes.entries()) {
|
|
11
|
+
if (scene.type !== "scene3d")
|
|
12
|
+
continue;
|
|
13
|
+
const props = (scene.props ?? {});
|
|
14
|
+
if (props.annotate !== "span")
|
|
15
|
+
continue;
|
|
16
|
+
const compare = props.compare;
|
|
17
|
+
if (typeof compare === "string" && compare !== "off")
|
|
18
|
+
continue;
|
|
19
|
+
findings.push({
|
|
20
|
+
severity: "warning",
|
|
21
|
+
path: `/scenes/${index}/props/annotate`,
|
|
22
|
+
message: `scene "${scene.id}" measures a span with no second body; the caliper reads the gap between two bodies and prints 0.0`,
|
|
23
|
+
suggestion: 'add "compare": "behind" so the span has two edges, or drop "annotate": "span" and carry the number in the copy',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return findings;
|
|
27
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anvpx/motion-build",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
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.21",
|
|
35
|
+
"@anvpx/motion-schema": "0.1.21",
|
|
36
|
+
"@anvpx/motion-themes": "0.1.21",
|
|
37
37
|
"postprocessing": "6.39.5",
|
|
38
38
|
"three": "0.186.0"
|
|
39
39
|
},
|