@anvpx/motion-cli 0.1.53 → 0.1.56
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/.out/smoke/boot.js +90 -0
- package/dist/.out/smoke/runtime/compose.js +43 -0
- package/dist/.out/smoke/runtime/easing.js +45 -0
- package/dist/.out/smoke/runtime/mount.js +153 -0
- package/dist/.out/smoke/runtime/timeline.js +199 -0
- package/dist/.out/smoke/scenes/count/scene.js +6 -0
- package/dist/.out/smoke/scenes/intro/scene.js +6 -0
- package/dist/.out/smoke/scenes/outro/scene.js +6 -0
- package/dist/.out/smoke/scenes/path/scene.js +6 -0
- package/dist/.out/smoke/scenes/signals/scene.js +6 -0
- package/dist/.out/smoke/shared/format.js +59 -0
- package/dist/.out/smoke/shared/motion.js +117 -0
- package/dist/.out/template-flow/out/project/boot.js +88 -0
- package/dist/.out/template-flow/out/project/runtime/compose.js +43 -0
- package/dist/.out/template-flow/out/project/runtime/easing.js +45 -0
- package/dist/.out/template-flow/out/project/runtime/mount.js +153 -0
- package/dist/.out/template-flow/out/project/runtime/timeline.js +199 -0
- package/dist/.out/template-flow/out/project/scenes/diagram/scene.js +6 -0
- package/dist/.out/template-flow/out/project/scenes/end/scene.js +6 -0
- package/dist/.out/template-flow/out/project/scenes/intro/scene.js +6 -0
- package/dist/.out/template-flow/out/project/shared/format.js +59 -0
- package/dist/.out/template-flow/out/project/shared/motion.js +117 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/clip/project/boot.js +88 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/clip/project/runtime/compose.js +43 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/clip/project/runtime/easing.js +45 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/clip/project/runtime/mount.js +153 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/clip/project/runtime/timeline.js +199 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/clip/project/scenes/diagram/scene.js +6 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/clip/project/scenes/end/scene.js +6 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/clip/project/scenes/intro/scene.js +6 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/clip/project/shared/format.js +59 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/clip/project/shared/motion.js +117 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/light/project/boot.js +88 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/light/project/runtime/compose.js +43 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/light/project/runtime/easing.js +45 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/light/project/runtime/mount.js +153 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/light/project/runtime/timeline.js +199 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/light/project/scenes/diagram/scene.js +6 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/light/project/scenes/end/scene.js +6 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/light/project/scenes/intro/scene.js +6 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/light/project/shared/format.js +59 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/light/project/shared/motion.js +117 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/paired/project/boot.js +88 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/paired/project/runtime/compose.js +43 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/paired/project/runtime/easing.js +45 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/paired/project/runtime/mount.js +153 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/paired/project/runtime/timeline.js +199 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/paired/project/scenes/diagram/scene.js +6 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/paired/project/scenes/end/scene.js +6 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/paired/project/scenes/intro/scene.js +6 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/paired/project/shared/format.js +59 -0
- package/dist/.out/template-flow/out/storyboard.preview-work/paired/project/shared/motion.js +117 -0
- package/dist/contact/argv.js +2 -2
- package/dist/plugin/install.d.ts +3 -3
- package/dist/plugin/install.js +2 -2
- package/dist/preview/plan.d.ts +4 -1
- package/dist/preview/plan.js +58 -13
- package/package.json +5 -5
package/dist/preview/plan.js
CHANGED
|
@@ -21,9 +21,25 @@ function bisect(picked) {
|
|
|
21
21
|
return Math.floor(((sorted[best] ?? 0) + (sorted[best + 1] ?? 0)) / 2);
|
|
22
22
|
}
|
|
23
23
|
const weightOf = (scenes, index) => scenes[index]?.weight ?? 0;
|
|
24
|
+
/**
|
|
25
|
+
* Type coverage order: types seen on base scenes first (timeline order), then
|
|
26
|
+
* overlay-only types. Overlays fill leftover slots; they never starve a base
|
|
27
|
+
* scene of its review still.
|
|
28
|
+
*/
|
|
29
|
+
const baseFirstTypes = (scenes) => {
|
|
30
|
+
const base = new Set();
|
|
31
|
+
const over = new Set();
|
|
32
|
+
for (const s of scenes)
|
|
33
|
+
(s.overlay === true ? over : base).add(s.type);
|
|
34
|
+
for (const t of over)
|
|
35
|
+
if (!base.has(t))
|
|
36
|
+
base.add(t);
|
|
37
|
+
return [...base];
|
|
38
|
+
};
|
|
24
39
|
/**
|
|
25
40
|
* Which scenes to show, as ascending indices: first, last, each distinct `type` once (the instance
|
|
26
|
-
* with the most props), then an even spread.
|
|
41
|
+
* with the most props), then an even spread. Missed overlays fill leftover slots only, so every
|
|
42
|
+
* base scene keeps its review still. Pure and deterministic.
|
|
27
43
|
*/
|
|
28
44
|
export function pickScenes(scenes, count) {
|
|
29
45
|
const n = scenes.length;
|
|
@@ -31,20 +47,48 @@ export function pickScenes(scenes, count) {
|
|
|
31
47
|
return [];
|
|
32
48
|
if (count >= n)
|
|
33
49
|
return scenes.map((_, i) => i);
|
|
34
|
-
const picked = new Set(
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
50
|
+
const picked = new Set();
|
|
51
|
+
const bases = scenes.flatMap((s, i) => (s.overlay === true ? [] : [i]));
|
|
52
|
+
const run = (pool) => {
|
|
53
|
+
if (pool.length === 0)
|
|
54
|
+
return;
|
|
55
|
+
const add = (index) => {
|
|
56
|
+
if (picked.size < count)
|
|
57
|
+
picked.add(index);
|
|
58
|
+
};
|
|
59
|
+
add(pool[0]);
|
|
60
|
+
const last = pool[pool.length - 1];
|
|
61
|
+
if (last !== pool[0] && !picked.has(last))
|
|
62
|
+
add(last);
|
|
63
|
+
for (const type of baseFirstTypes(pool.map((i) => scenes[i]))) {
|
|
64
|
+
const same = pool.filter((i) => scenes[i]?.type === type);
|
|
65
|
+
if (same.some((i) => picked.has(i)))
|
|
66
|
+
continue;
|
|
67
|
+
add(same.reduce((a, b) => (weightOf(scenes, b) ?? 0) > (weightOf(scenes, a) ?? 0) ? b : a));
|
|
68
|
+
}
|
|
69
|
+
const sub = () => new Set(pool.filter((i) => picked.has(i)));
|
|
70
|
+
let guard = pool.length + 2;
|
|
71
|
+
while (picked.size < count && sub().size < pool.length && guard-- > 0) {
|
|
72
|
+
const next = bisect(sub());
|
|
73
|
+
if (!pool.includes(next) || picked.has(next)) {
|
|
74
|
+
const open = pool.find((i) => !picked.has(i));
|
|
75
|
+
if (open === undefined)
|
|
76
|
+
break;
|
|
77
|
+
picked.add(open);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
picked.add(next);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
38
83
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
84
|
+
run(bases);
|
|
85
|
+
if (picked.size < count) {
|
|
86
|
+
for (const i of scenes.flatMap((s, j) => (s.overlay === true ? [j] : []))) {
|
|
87
|
+
if (picked.size >= count)
|
|
88
|
+
break;
|
|
89
|
+
picked.add(i);
|
|
90
|
+
}
|
|
45
91
|
}
|
|
46
|
-
while (picked.size < count)
|
|
47
|
-
picked.add(bisect(picked));
|
|
48
92
|
return [...picked].sort((a, b) => a - b);
|
|
49
93
|
}
|
|
50
94
|
/** Time of each pick: 70% into its scene. */
|
|
@@ -110,6 +154,7 @@ export function stillCandidates(board) {
|
|
|
110
154
|
weight: JSON.stringify(entry?.props ?? {}).length,
|
|
111
155
|
start: o.start,
|
|
112
156
|
duration: o.duration,
|
|
157
|
+
overlay: true,
|
|
113
158
|
},
|
|
114
159
|
];
|
|
115
160
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anvpx/motion-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.56",
|
|
4
4
|
"description": "The mk CLI for @anvpx/motion: validate, preview, approve and render storyboards.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "anvpx",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"dist/**/*.d.ts"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@anvpx/motion-audio": "0.1.
|
|
34
|
-
"@anvpx/motion-build": "0.1.
|
|
35
|
-
"@anvpx/motion-schema": "0.1.
|
|
36
|
-
"@anvpx/motion-templates": "0.1.
|
|
33
|
+
"@anvpx/motion-audio": "0.1.56",
|
|
34
|
+
"@anvpx/motion-build": "0.1.56",
|
|
35
|
+
"@anvpx/motion-schema": "0.1.56",
|
|
36
|
+
"@anvpx/motion-templates": "0.1.56"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"test:integration": "vitest run --config vitest.integration.config.ts"
|