@anvpx/motion-build 0.1.49 → 0.1.51

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.
@@ -56,16 +56,33 @@ const layerErrors = (entry, index) => {
56
56
  };
57
57
  const ABSOLUTE_DIR = /^(?:[a-zA-Z]:|[\\/]|~)/;
58
58
  const ESCAPING_DIR = /(^|[\\/])\.\.([\\/]|$)/;
59
- /** `custom` takes exactly one prop: a relative directory holding the scene's three files. */
59
+ /**
60
+ * `custom` props: the relative directory holding the scene's three files, and the declared
61
+ * `elements` count — how many labelled marks the plate draws. The count is declared because an
62
+ * authored scene's copy lives in its own files, so no validator can see it; the density rule
63
+ * needs the number to judge a plate at all.
64
+ */
65
+ const CUSTOM_PROP_KEYS = new Set(["dir", "elements"]);
60
66
  const customErrors = (entry, index) => {
61
67
  const props = entry.props;
62
- const unknown = Object.keys(props).filter((key) => key !== "dir");
68
+ const unknown = Object.keys(props).filter((key) => !CUSTOM_PROP_KEYS.has(key));
63
69
  if (unknown.length > 0) {
64
70
  return [
65
71
  {
66
72
  path: toJsonPointer(["scenes", index, "props"]),
67
73
  message: `unknown key(s): ${unknown.join(", ")}`,
68
- suggestion: "custom scenes take only props.dir",
74
+ suggestion: "custom scenes take props.dir and an optional elements count",
75
+ },
76
+ ];
77
+ }
78
+ const elements = props.elements;
79
+ if (elements !== undefined &&
80
+ (typeof elements !== "number" || !Number.isInteger(elements) || elements < 1 || elements > 64)) {
81
+ return [
82
+ {
83
+ path: toJsonPointer(["scenes", index, "props", "elements"]),
84
+ message: "custom scene elements must be an integer from 1 to 64",
85
+ suggestion: "count the labelled marks the plate draws, for example 8",
69
86
  },
70
87
  ];
71
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvpx/motion-build",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
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.49",
35
- "@anvpx/motion-schema": "0.1.49",
36
- "@anvpx/motion-themes": "0.1.49",
34
+ "@anvpx/motion-scenes": "0.1.51",
35
+ "@anvpx/motion-schema": "0.1.51",
36
+ "@anvpx/motion-themes": "0.1.51",
37
37
  "postprocessing": "6.39.5",
38
38
  "three": "0.186.0"
39
39
  },