@anvpx/motion-build 0.1.36 → 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.js
CHANGED
|
@@ -3,6 +3,7 @@ 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";
|
|
@@ -39,6 +40,7 @@ export const LINT_RULES = [
|
|
|
39
40
|
wordsOnScreenRule,
|
|
40
41
|
longHoldRule,
|
|
41
42
|
linearEaseRule,
|
|
43
|
+
literalMarkupRule,
|
|
42
44
|
narrationPaceRule,
|
|
43
45
|
hookFirstRule,
|
|
44
46
|
safeZone9x16Rule,
|
|
@@ -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
|
+
};
|
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
|
},
|