@canonical/motion-control 0.0.0-stage → 0.47.0
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/README.md +300 -2
- package/cast.schema.json +101 -0
- package/dist/esm/cli.js +30 -0
- package/dist/esm/cli.js.map +1 -0
- package/dist/esm/global.js +7 -0
- package/dist/esm/global.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/cast/checkCasts.js +34 -0
- package/dist/esm/lib/cast/checkCasts.js.map +1 -0
- package/dist/esm/lib/cast/checkScene.js +58 -0
- package/dist/esm/lib/cast/checkScene.js.map +1 -0
- package/dist/esm/lib/cast/checkStep.js +73 -0
- package/dist/esm/lib/cast/checkStep.js.map +1 -0
- package/dist/esm/lib/cast/constants.js +53 -0
- package/dist/esm/lib/cast/constants.js.map +1 -0
- package/dist/esm/lib/cast/formatReport.js +22 -0
- package/dist/esm/lib/cast/formatReport.js.map +1 -0
- package/dist/esm/lib/cast/index.js +10 -0
- package/dist/esm/lib/cast/index.js.map +1 -0
- package/dist/esm/lib/cast/listFrameNames.js +19 -0
- package/dist/esm/lib/cast/listFrameNames.js.map +1 -0
- package/dist/esm/lib/cast/measureScene.js +11 -0
- package/dist/esm/lib/cast/measureScene.js.map +1 -0
- package/dist/esm/lib/cast/measureStep.js +21 -0
- package/dist/esm/lib/cast/measureStep.js.map +1 -0
- package/dist/esm/lib/cast/measureTyping.js +13 -0
- package/dist/esm/lib/cast/measureTyping.js.map +1 -0
- package/dist/esm/lib/cast/types.js +2 -0
- package/dist/esm/lib/cast/types.js.map +1 -0
- package/dist/esm/lib/gif/compressLzw.js +61 -0
- package/dist/esm/lib/gif/compressLzw.js.map +1 -0
- package/dist/esm/lib/gif/constants.js +9 -0
- package/dist/esm/lib/gif/constants.js.map +1 -0
- package/dist/esm/lib/gif/encodeGif.js +45 -0
- package/dist/esm/lib/gif/encodeGif.js.map +1 -0
- package/dist/esm/lib/gif/index.js +6 -0
- package/dist/esm/lib/gif/index.js.map +1 -0
- package/dist/esm/lib/gif/mergeStills.js +32 -0
- package/dist/esm/lib/gif/mergeStills.js.map +1 -0
- package/dist/esm/lib/gif/quantizePictures.js +75 -0
- package/dist/esm/lib/gif/quantizePictures.js.map +1 -0
- package/dist/esm/lib/gif/types.js +2 -0
- package/dist/esm/lib/gif/types.js.map +1 -0
- package/dist/esm/lib/index.js +3 -0
- package/dist/esm/lib/index.js.map +1 -0
- package/dist/esm/lib/moment/constants.js +33 -0
- package/dist/esm/lib/moment/constants.js.map +1 -0
- package/dist/esm/lib/moment/describeAction.js +20 -0
- package/dist/esm/lib/moment/describeAction.js.map +1 -0
- package/dist/esm/lib/moment/describeKeyRun.js +53 -0
- package/dist/esm/lib/moment/describeKeyRun.js.map +1 -0
- package/dist/esm/lib/moment/describeMoment.js +323 -0
- package/dist/esm/lib/moment/describeMoment.js.map +1 -0
- package/dist/esm/lib/moment/easeInOut.js +12 -0
- package/dist/esm/lib/moment/easeInOut.js.map +1 -0
- package/dist/esm/lib/moment/index.js +8 -0
- package/dist/esm/lib/moment/index.js.map +1 -0
- package/dist/esm/lib/moment/resolveStates.js +82 -0
- package/dist/esm/lib/moment/resolveStates.js.map +1 -0
- package/dist/esm/lib/moment/takeSpan.js +12 -0
- package/dist/esm/lib/moment/takeSpan.js.map +1 -0
- package/dist/esm/lib/moment/types.js +2 -0
- package/dist/esm/lib/moment/types.js.map +1 -0
- package/dist/esm/lib/player/Player.js +498 -0
- package/dist/esm/lib/player/Player.js.map +1 -0
- package/dist/esm/lib/player/announceHeight.js +30 -0
- package/dist/esm/lib/player/announceHeight.js.map +1 -0
- package/dist/esm/lib/player/applyMoment.js +155 -0
- package/dist/esm/lib/player/applyMoment.js.map +1 -0
- package/dist/esm/lib/player/assertPresent.js +14 -0
- package/dist/esm/lib/player/assertPresent.js.map +1 -0
- package/dist/esm/lib/player/collectFrames.js +30 -0
- package/dist/esm/lib/player/collectFrames.js.map +1 -0
- package/dist/esm/lib/player/collectStyles.js +24 -0
- package/dist/esm/lib/player/collectStyles.js.map +1 -0
- package/dist/esm/lib/player/constants.js +101 -0
- package/dist/esm/lib/player/constants.js.map +1 -0
- package/dist/esm/lib/player/defaultProfile.js +50 -0
- package/dist/esm/lib/player/defaultProfile.js.map +1 -0
- package/dist/esm/lib/player/drawMarkup.js +36 -0
- package/dist/esm/lib/player/drawMarkup.js.map +1 -0
- package/dist/esm/lib/player/drawScene.js +32 -0
- package/dist/esm/lib/player/drawScene.js.map +1 -0
- package/dist/esm/lib/player/drawSprites.js +122 -0
- package/dist/esm/lib/player/drawSprites.js.map +1 -0
- package/dist/esm/lib/player/fitEmbeds.js +42 -0
- package/dist/esm/lib/player/fitEmbeds.js.map +1 -0
- package/dist/esm/lib/player/fitSlide.js +27 -0
- package/dist/esm/lib/player/fitSlide.js.map +1 -0
- package/dist/esm/lib/player/formatKey.js +13 -0
- package/dist/esm/lib/player/formatKey.js.map +1 -0
- package/dist/esm/lib/player/formatKeySign.js +12 -0
- package/dist/esm/lib/player/formatKeySign.js.map +1 -0
- package/dist/esm/lib/player/formatSpeed.js +11 -0
- package/dist/esm/lib/player/formatSpeed.js.map +1 -0
- package/dist/esm/lib/player/formatTime.js +18 -0
- package/dist/esm/lib/player/formatTime.js.map +1 -0
- package/dist/esm/lib/player/index.js +30 -0
- package/dist/esm/lib/player/index.js.map +1 -0
- package/dist/esm/lib/player/installStateRules.js +25 -0
- package/dist/esm/lib/player/installStateRules.js.map +1 -0
- package/dist/esm/lib/player/listHidden.js +24 -0
- package/dist/esm/lib/player/listHidden.js.map +1 -0
- package/dist/esm/lib/player/makeElement.js +15 -0
- package/dist/esm/lib/player/makeElement.js.map +1 -0
- package/dist/esm/lib/player/mergeProfile.js +17 -0
- package/dist/esm/lib/player/mergeProfile.js.map +1 -0
- package/dist/esm/lib/player/mirrorStates.js +23 -0
- package/dist/esm/lib/player/mirrorStates.js.map +1 -0
- package/dist/esm/lib/player/mountScenes.js +100 -0
- package/dist/esm/lib/player/mountScenes.js.map +1 -0
- package/dist/esm/lib/player/readLayerBox.js +20 -0
- package/dist/esm/lib/player/readLayerBox.js.map +1 -0
- package/dist/esm/lib/player/recordGif.js +63 -0
- package/dist/esm/lib/player/recordGif.js.map +1 -0
- package/dist/esm/lib/player/recordVideo.js +114 -0
- package/dist/esm/lib/player/recordVideo.js.map +1 -0
- package/dist/esm/lib/player/renderLegend.js +27 -0
- package/dist/esm/lib/player/renderLegend.js.map +1 -0
- package/dist/esm/lib/player/saveFile.js +22 -0
- package/dist/esm/lib/player/saveFile.js.map +1 -0
- package/dist/esm/lib/player/serializeElement.js +36 -0
- package/dist/esm/lib/player/serializeElement.js.map +1 -0
- package/dist/esm/lib/player/types.js +2 -0
- package/dist/esm/lib/player/types.js.map +1 -0
- package/dist/esm/lib/player/wrapSlide.js +28 -0
- package/dist/esm/lib/player/wrapSlide.js.map +1 -0
- package/dist/esm/lib/timeline/advanceClock.js +24 -0
- package/dist/esm/lib/timeline/advanceClock.js.map +1 -0
- package/dist/esm/lib/timeline/buildTimeline.js +47 -0
- package/dist/esm/lib/timeline/buildTimeline.js.map +1 -0
- package/dist/esm/lib/timeline/constants.js +3 -0
- package/dist/esm/lib/timeline/constants.js.map +1 -0
- package/dist/esm/lib/timeline/findKeyframe.js +11 -0
- package/dist/esm/lib/timeline/findKeyframe.js.map +1 -0
- package/dist/esm/lib/timeline/index.js +7 -0
- package/dist/esm/lib/timeline/index.js.map +1 -0
- package/dist/esm/lib/timeline/locateTime.js +21 -0
- package/dist/esm/lib/timeline/locateTime.js.map +1 -0
- package/dist/esm/lib/timeline/stepKeyframe.js +20 -0
- package/dist/esm/lib/timeline/stepKeyframe.js.map +1 -0
- package/dist/esm/lib/timeline/types.js +2 -0
- package/dist/esm/lib/timeline/types.js.map +1 -0
- package/dist/esm/lib/video/constants.js +7 -0
- package/dist/esm/lib/video/constants.js.map +1 -0
- package/dist/esm/lib/video/index.js +4 -0
- package/dist/esm/lib/video/index.js.map +1 -0
- package/dist/esm/lib/video/types.js +2 -0
- package/dist/esm/lib/video/types.js.map +1 -0
- package/dist/esm/lib/video/writeBox.js +21 -0
- package/dist/esm/lib/video/writeBox.js.map +1 -0
- package/dist/esm/lib/video/writeMp4.js +45 -0
- package/dist/esm/lib/video/writeMp4.js.map +1 -0
- package/dist/motion.css +581 -0
- package/dist/motion.global.js +1534 -0
- package/dist/types/cli.d.ts +3 -0
- package/dist/types/cli.d.ts.map +1 -0
- package/dist/types/global.d.ts +2 -0
- package/dist/types/global.d.ts.map +1 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/cast/checkCasts.d.ts +15 -0
- package/dist/types/lib/cast/checkCasts.d.ts.map +1 -0
- package/dist/types/lib/cast/checkScene.d.ts +11 -0
- package/dist/types/lib/cast/checkScene.d.ts.map +1 -0
- package/dist/types/lib/cast/checkStep.d.ts +12 -0
- package/dist/types/lib/cast/checkStep.d.ts.map +1 -0
- package/dist/types/lib/cast/constants.d.ts +20 -0
- package/dist/types/lib/cast/constants.d.ts.map +1 -0
- package/dist/types/lib/cast/formatReport.d.ts +11 -0
- package/dist/types/lib/cast/formatReport.d.ts.map +1 -0
- package/dist/types/lib/cast/index.d.ts +11 -0
- package/dist/types/lib/cast/index.d.ts.map +1 -0
- package/dist/types/lib/cast/listFrameNames.d.ts +8 -0
- package/dist/types/lib/cast/listFrameNames.d.ts.map +1 -0
- package/dist/types/lib/cast/measureScene.d.ts +9 -0
- package/dist/types/lib/cast/measureScene.d.ts.map +1 -0
- package/dist/types/lib/cast/measureStep.d.ts +13 -0
- package/dist/types/lib/cast/measureStep.d.ts.map +1 -0
- package/dist/types/lib/cast/measureTyping.d.ts +12 -0
- package/dist/types/lib/cast/measureTyping.d.ts.map +1 -0
- package/dist/types/lib/cast/types.d.ts +87 -0
- package/dist/types/lib/cast/types.d.ts.map +1 -0
- package/dist/types/lib/gif/compressLzw.d.ts +9 -0
- package/dist/types/lib/gif/compressLzw.d.ts.map +1 -0
- package/dist/types/lib/gif/constants.d.ts +9 -0
- package/dist/types/lib/gif/constants.d.ts.map +1 -0
- package/dist/types/lib/gif/encodeGif.d.ts +13 -0
- package/dist/types/lib/gif/encodeGif.d.ts.map +1 -0
- package/dist/types/lib/gif/index.d.ts +7 -0
- package/dist/types/lib/gif/index.d.ts.map +1 -0
- package/dist/types/lib/gif/mergeStills.d.ts +12 -0
- package/dist/types/lib/gif/mergeStills.d.ts.map +1 -0
- package/dist/types/lib/gif/quantizePictures.d.ts +13 -0
- package/dist/types/lib/gif/quantizePictures.d.ts.map +1 -0
- package/dist/types/lib/gif/types.d.ts +22 -0
- package/dist/types/lib/gif/types.d.ts.map +1 -0
- package/dist/types/lib/index.d.ts +3 -0
- package/dist/types/lib/index.d.ts.map +1 -0
- package/dist/types/lib/moment/constants.d.ts +33 -0
- package/dist/types/lib/moment/constants.d.ts.map +1 -0
- package/dist/types/lib/moment/describeAction.d.ts +9 -0
- package/dist/types/lib/moment/describeAction.d.ts.map +1 -0
- package/dist/types/lib/moment/describeKeyRun.d.ts +18 -0
- package/dist/types/lib/moment/describeKeyRun.d.ts.map +1 -0
- package/dist/types/lib/moment/describeMoment.d.ts +16 -0
- package/dist/types/lib/moment/describeMoment.d.ts.map +1 -0
- package/dist/types/lib/moment/easeInOut.d.ts +8 -0
- package/dist/types/lib/moment/easeInOut.d.ts.map +1 -0
- package/dist/types/lib/moment/index.d.ts +9 -0
- package/dist/types/lib/moment/index.d.ts.map +1 -0
- package/dist/types/lib/moment/resolveStates.d.ts +18 -0
- package/dist/types/lib/moment/resolveStates.d.ts.map +1 -0
- package/dist/types/lib/moment/takeSpan.d.ts +10 -0
- package/dist/types/lib/moment/takeSpan.d.ts.map +1 -0
- package/dist/types/lib/moment/types.d.ts +187 -0
- package/dist/types/lib/moment/types.d.ts.map +1 -0
- package/dist/types/lib/player/Player.d.ts +134 -0
- package/dist/types/lib/player/Player.d.ts.map +1 -0
- package/dist/types/lib/player/announceHeight.d.ts +12 -0
- package/dist/types/lib/player/announceHeight.d.ts.map +1 -0
- package/dist/types/lib/player/applyMoment.d.ts +21 -0
- package/dist/types/lib/player/applyMoment.d.ts.map +1 -0
- package/dist/types/lib/player/assertPresent.d.ts +10 -0
- package/dist/types/lib/player/assertPresent.d.ts.map +1 -0
- package/dist/types/lib/player/collectFrames.d.ts +11 -0
- package/dist/types/lib/player/collectFrames.d.ts.map +1 -0
- package/dist/types/lib/player/collectStyles.d.ts +12 -0
- package/dist/types/lib/player/collectStyles.d.ts.map +1 -0
- package/dist/types/lib/player/constants.d.ts +80 -0
- package/dist/types/lib/player/constants.d.ts.map +1 -0
- package/dist/types/lib/player/defaultProfile.d.ts +8 -0
- package/dist/types/lib/player/defaultProfile.d.ts.map +1 -0
- package/dist/types/lib/player/drawMarkup.d.ts +15 -0
- package/dist/types/lib/player/drawMarkup.d.ts.map +1 -0
- package/dist/types/lib/player/drawScene.d.ts +23 -0
- package/dist/types/lib/player/drawScene.d.ts.map +1 -0
- package/dist/types/lib/player/drawSprites.d.ts +35 -0
- package/dist/types/lib/player/drawSprites.d.ts.map +1 -0
- package/dist/types/lib/player/fitEmbeds.d.ts +13 -0
- package/dist/types/lib/player/fitEmbeds.d.ts.map +1 -0
- package/dist/types/lib/player/fitSlide.d.ts +24 -0
- package/dist/types/lib/player/fitSlide.d.ts.map +1 -0
- package/dist/types/lib/player/formatKey.d.ts +9 -0
- package/dist/types/lib/player/formatKey.d.ts.map +1 -0
- package/dist/types/lib/player/formatKeySign.d.ts +9 -0
- package/dist/types/lib/player/formatKeySign.d.ts.map +1 -0
- package/dist/types/lib/player/formatSpeed.d.ts +9 -0
- package/dist/types/lib/player/formatSpeed.d.ts.map +1 -0
- package/dist/types/lib/player/formatTime.d.ts +12 -0
- package/dist/types/lib/player/formatTime.d.ts.map +1 -0
- package/dist/types/lib/player/index.d.ts +31 -0
- package/dist/types/lib/player/index.d.ts.map +1 -0
- package/dist/types/lib/player/installStateRules.d.ts +12 -0
- package/dist/types/lib/player/installStateRules.d.ts.map +1 -0
- package/dist/types/lib/player/listHidden.d.ts +12 -0
- package/dist/types/lib/player/listHidden.d.ts.map +1 -0
- package/dist/types/lib/player/makeElement.d.ts +10 -0
- package/dist/types/lib/player/makeElement.d.ts.map +1 -0
- package/dist/types/lib/player/mergeProfile.d.ts +9 -0
- package/dist/types/lib/player/mergeProfile.d.ts.map +1 -0
- package/dist/types/lib/player/mirrorStates.d.ts +12 -0
- package/dist/types/lib/player/mirrorStates.d.ts.map +1 -0
- package/dist/types/lib/player/mountScenes.d.ts +25 -0
- package/dist/types/lib/player/mountScenes.d.ts.map +1 -0
- package/dist/types/lib/player/readLayerBox.d.ts +23 -0
- package/dist/types/lib/player/readLayerBox.d.ts.map +1 -0
- package/dist/types/lib/player/recordGif.d.ts +16 -0
- package/dist/types/lib/player/recordGif.d.ts.map +1 -0
- package/dist/types/lib/player/recordVideo.d.ts +19 -0
- package/dist/types/lib/player/recordVideo.d.ts.map +1 -0
- package/dist/types/lib/player/renderLegend.d.ts +8 -0
- package/dist/types/lib/player/renderLegend.d.ts.map +1 -0
- package/dist/types/lib/player/saveFile.d.ts +13 -0
- package/dist/types/lib/player/saveFile.d.ts.map +1 -0
- package/dist/types/lib/player/serializeElement.d.ts +14 -0
- package/dist/types/lib/player/serializeElement.d.ts.map +1 -0
- package/dist/types/lib/player/types.d.ts +321 -0
- package/dist/types/lib/player/types.d.ts.map +1 -0
- package/dist/types/lib/player/wrapSlide.d.ts +17 -0
- package/dist/types/lib/player/wrapSlide.d.ts.map +1 -0
- package/dist/types/lib/timeline/advanceClock.d.ts +16 -0
- package/dist/types/lib/timeline/advanceClock.d.ts.map +1 -0
- package/dist/types/lib/timeline/buildTimeline.d.ts +15 -0
- package/dist/types/lib/timeline/buildTimeline.d.ts.map +1 -0
- package/dist/types/lib/timeline/constants.d.ts +3 -0
- package/dist/types/lib/timeline/constants.d.ts.map +1 -0
- package/dist/types/lib/timeline/findKeyframe.d.ts +10 -0
- package/dist/types/lib/timeline/findKeyframe.d.ts.map +1 -0
- package/dist/types/lib/timeline/index.d.ts +8 -0
- package/dist/types/lib/timeline/index.d.ts.map +1 -0
- package/dist/types/lib/timeline/locateTime.d.ts +10 -0
- package/dist/types/lib/timeline/locateTime.d.ts.map +1 -0
- package/dist/types/lib/timeline/stepKeyframe.d.ts +12 -0
- package/dist/types/lib/timeline/stepKeyframe.d.ts.map +1 -0
- package/dist/types/lib/timeline/types.d.ts +40 -0
- package/dist/types/lib/timeline/types.d.ts.map +1 -0
- package/dist/types/lib/video/constants.d.ts +5 -0
- package/dist/types/lib/video/constants.d.ts.map +1 -0
- package/dist/types/lib/video/index.d.ts +5 -0
- package/dist/types/lib/video/index.d.ts.map +1 -0
- package/dist/types/lib/video/types.d.ts +21 -0
- package/dist/types/lib/video/types.d.ts.map +1 -0
- package/dist/types/lib/video/writeBox.d.ts +9 -0
- package/dist/types/lib/video/writeBox.d.ts.map +1 -0
- package/dist/types/lib/video/writeMp4.d.ts +10 -0
- package/dist/types/lib/video/writeMp4.d.ts.map +1 -0
- package/package.json +105 -4
- package/skills/design-motion-frames/SKILL.md +183 -0
package/README.md
CHANGED
|
@@ -1,3 +1,301 @@
|
|
|
1
|
-
#
|
|
1
|
+
# motion
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@canonical/motion-control` plays short looping clips of interactions over a page's own HTML frames. A page draws its screens as HTML and names each one with `data-frame`. A cast lists, in order, the frames to show and the interactions that lead from one to the next, and the player draws it as a figure a reader can play, step through and scrub. Each kind of interaction has one symbol, the same in every clip: a finger is a ring, a mouse is a pointer, a key is a keycap. Nothing is redrawn for the animation, so when a frame changes, every clip that uses it changes with it.
|
|
4
|
+
|
|
5
|
+
The package has two halves. The cast half needs no browser: `checkCasts` reads a list of scenes and says what cannot be played and what a reviewer would question, `listFrameNames` reads the names frames answer to from a catalogue, and `formatReport` writes the outcome as lines to print. The `motion` executable is those three behind one command. The player half runs in a page: `collectFrames` gathers every element that names itself as a frame, `mountScenes` puts one figure per scene on the page and returns the players with two ways to look at them from outside, and `fitEmbeds` gives an iframe the height the page inside it announces.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
bun add @canonical/motion-control
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## The 90-second example
|
|
14
|
+
|
|
15
|
+
Name two frames, and give the clips a place:
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<div data-frame="list.rest">…the frame's HTML…</div>
|
|
19
|
+
<div data-frame="list.removed">…</div>
|
|
20
|
+
<div id="clips"></div>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Write one scene and mount it:
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { mountScenes, type Scene } from "@canonical/motion-control";
|
|
27
|
+
import "@canonical/motion-control/style.css";
|
|
28
|
+
|
|
29
|
+
const scenes: Scene[] = [
|
|
30
|
+
{
|
|
31
|
+
id: "remove",
|
|
32
|
+
title: "Sliding a row away",
|
|
33
|
+
steps: [
|
|
34
|
+
{ frame: "list.rest", hold: 1000, say: "At rest." },
|
|
35
|
+
{ do: "slide", on: ".row", to: "end", depth: "deep", say: "A slide all the way to the end." },
|
|
36
|
+
{ frame: "list.removed", hold: 2000, say: "Removed, with the way back." },
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
mountScenes({
|
|
42
|
+
scenes,
|
|
43
|
+
into: document.querySelector("#clips"),
|
|
44
|
+
profile: { slideTarget: (element) => element.closest(".row") ?? element },
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The figure shows the first frame, a finger slides the row to the end, the second frame cuts in, and the clip starts again. Under the screen, one panel names the scene, the frame in view and the interaction while it happens, carries the caption, and holds the controls: back and forward from frame to frame with play between them, a bar to scrub, and at the bar's end the speed, which goes on to the next one as it is pressed, and the time, which reads elapsed, total or remaining as it is pressed. Three dots at the end of the title's row open a menu with a way to save the scene as a GIF.
|
|
49
|
+
|
|
50
|
+
## Common tasks
|
|
51
|
+
|
|
52
|
+
### Check casts before they are published
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
motion-control check casts.json --frames frames.json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The command exits with 1 when something cannot be played, such as a frame that does not exist, and prints a warning for what a reviewer would question, such as an interaction whose effect no frame shows. The frames file is a list of names, or of objects with an `id` and perhaps a `code`. A selector that matches nothing cannot be found without the frames themselves; in a page, `mountScenes(…).audit()` lists each one.
|
|
59
|
+
|
|
60
|
+
### Tell the player about your frames
|
|
61
|
+
|
|
62
|
+
The player cannot guess what scrolls, what stays in place while it scrolls, or where typed words go. A profile says so, and only what differs from the default needs saying:
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
mountScenes({
|
|
66
|
+
scenes,
|
|
67
|
+
into,
|
|
68
|
+
profile: {
|
|
69
|
+
shells: { phone: '<div class="phone"><div class="mo-screen"></div></div>' },
|
|
70
|
+
line: ".input .field",
|
|
71
|
+
scroll: { touch: ".list", wheel: ".list" },
|
|
72
|
+
stick: (list) => {
|
|
73
|
+
const head = list.querySelector<HTMLElement>(".heading");
|
|
74
|
+
return head ? { box: list, head } : undefined;
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Put the title under the screen
|
|
81
|
+
|
|
82
|
+
The title stands in a bar over the screen, with the menu's three dots at its end; the panel under the screen keeps the frame, the caption and the controls. To have the title as the first row of that panel instead, mount with `title`:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
mountScenes({ scenes, into, title: "below" });
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The figure is then one screen with one panel under it.
|
|
89
|
+
|
|
90
|
+
### Embed one clip in another page
|
|
91
|
+
|
|
92
|
+
Make a page that mounts with `solo` and `embedded`, and point an iframe at it:
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
mountScenes({ scenes, into, solo: "remove", embedded: true });
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
On the page that holds the iframe, `fitEmbeds()` gives each iframe the height its page announces, so nothing scrolls inside a frame. The two pages find each other whichever loads first. A clip plays only while it is in view, inside an iframe as well, and not at all for a reader who asks for reduced motion.
|
|
99
|
+
|
|
100
|
+
### Put a clip in one self-contained file
|
|
101
|
+
|
|
102
|
+
A page that cannot import modules loads `@canonical/motion-control/global`, one classic script that puts the same exports on `globalThis.Motion`. `examples/04-single-file/build.mjs` inlines that script, the stylesheet, the frames and the casts into a single HTML file that makes no requests.
|
|
103
|
+
|
|
104
|
+
### Choose what a figure shows beside its screen
|
|
105
|
+
|
|
106
|
+
A figure shows three sections beside its screen: the title's row, the caption's rows, and the controls' row. Each can be hidden whole, or part by part, with `show`:
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
mountScenes({
|
|
110
|
+
scenes,
|
|
111
|
+
into,
|
|
112
|
+
show: {
|
|
113
|
+
title: { kind: false },
|
|
114
|
+
caption: { code: false, count: false },
|
|
115
|
+
timeline: false,
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
| Section | Parts |
|
|
121
|
+
|---|---|
|
|
122
|
+
| `title` | `kind` (Scene or Clip), `about`, `menu` (the three dots). The title itself shows whenever the row does. |
|
|
123
|
+
| `caption` | `code`, `frame` (its name), `interaction`, `count` (the step or the chapter), `words` (the caption). |
|
|
124
|
+
| `timeline` | `steps` (back, play, forward), `bar`, `speed`, `time`. |
|
|
125
|
+
|
|
126
|
+
A section left out shows whole; `false` hides it whole. A scene with its controls hidden still plays when it comes into view, and `player.exportGif()` still records it when the menu is hidden.
|
|
127
|
+
|
|
128
|
+
### Show the keys as they are pressed
|
|
129
|
+
|
|
130
|
+
Typing shows as a small sign that words are arriving, and a named key as a keycap in a corner of the screen. Keys pressed one after another stay in one row, so each can be read: the newest in the corner, the earlier ones beside it and fainter by age. The row fades once a step that is not a key starts, or 1.5 s after the last press. To show the keys themselves, the way a recording of a screen shows its keystrokes, mount with `keys`:
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
mountScenes({ scenes, into, keys: "letters" });
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
A strip of keystrokes then carries what was typed and pressed on the frame, the newest marked: letters as they are and keys by the sign keyboards print on them, so a typo taken back reads `Fix the bikr⌫e`. A key being pressed stands at the end as a cap with its name. The strip stands just over the frame's line, so the words being typed stay in view, or at the foot of the screen when the frame has no line. `--mo-keys-gap` sets how far over the line, `10px` when left out:
|
|
137
|
+
|
|
138
|
+
```css
|
|
139
|
+
.motion-figure {
|
|
140
|
+
--mo-keys-gap: 24px;
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Outline what a step acts on
|
|
145
|
+
|
|
146
|
+
While words arrive or a key is pressed, what they go to, the element in focus, is outlined in the colour of the interactions, so a reader sees where the keys land. A click or a tap can outline what it presses too; it does not unless the page asks:
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
mountScenes({ scenes, into, outline: { keys: true, click: true } });
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
`outline: { keys: false }` turns the first off. The outline is a box drawn over the frame, `.mo-outline` in the stylesheet, so the frame's own styles cannot hide it; the outlined element also carries `data-mo-outline`, for a page that wants to style it as well.
|
|
153
|
+
|
|
154
|
+
### Choose the speeds a scene can be played at
|
|
155
|
+
|
|
156
|
+
The speed beside the time goes through half speed, the speed as written and double. To offer others, mount with `speeds`:
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
mountScenes({ scenes, into, speeds: [0.25, 0.5, 2, 4] });
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
A press goes through them slowest first, and 1, the speed a scene starts at, is always among them.
|
|
163
|
+
|
|
164
|
+
### Play once or again
|
|
165
|
+
|
|
166
|
+
A scene starts again when it ends, unless its cast says `"loop": false`. To set it for every scene on the page, whatever the casts say, mount with `loop`:
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
mountScenes({ scenes, into, loop: false });
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
The reader can still turn it on and off for one scene with Loop in the menu behind the three dots, and a script with `player.setLoop(true)`. A GIF saved from the scene does the same as the scene: it plays again, or once and stops on its last picture. `recordGif` takes `loop` to choose for the file alone. A video has no such setting; the program that plays it decides.
|
|
173
|
+
|
|
174
|
+
### Show what is hovered, pressed and focused
|
|
175
|
+
|
|
176
|
+
A clip has no real pointer and no real focus, so a page's `:hover`, `:active`, `:focus` and `:visited` rules never apply in it as they would for a reader. The player works the states out from the steps and marks the frame's elements instead, and when scenes are mounted it gives the page a twin of each of those rules that answers to the marks. A page's CSS needs no change.
|
|
177
|
+
|
|
178
|
+
| State | Mark | When |
|
|
179
|
+
|---|---|---|
|
|
180
|
+
| `:hover` | `data-mo-hover` | On the target the mouse pointer rests on, and on what holds it. Never by touch. |
|
|
181
|
+
| `:active` | `data-mo-active` | On the target of a click or a tap while it is pressed, and of a hold, a slide or a drag for the whole step. |
|
|
182
|
+
| `:focus` | `data-mo-focus` | On the last thing clicked, tapped or held that can hold the focus, or on the line while words are typed. It stays until the next one. |
|
|
183
|
+
| `:focus-visible` | `data-mo-focus-visible` | With the focus, when it came from typing or is on a field words go into. |
|
|
184
|
+
| `:focus-within` | `data-mo-focus-within` | On what is focused and on everything that holds it. |
|
|
185
|
+
| `:visited` | `data-mo-visited` | On a link once a click or a tap has pressed it or something inside it, for the rest of the scene. |
|
|
186
|
+
|
|
187
|
+
A frame can carry a mark in its own markup, to be drawn in that state from the start: `<button data-mo-hover>`.
|
|
188
|
+
|
|
189
|
+
The twins are made from the stylesheets the page may read, as a recording is. The pointer's hover follows the steps, not what is under it: when a wheel rolls the page under a resting pointer, the hover stays on the element the pointer was moved to.
|
|
190
|
+
|
|
191
|
+
### Let the reader do a step
|
|
192
|
+
|
|
193
|
+
A scene can stop at a tap, a click or a hold and wait for the reader to do it on the frame. Mark the step in the cast, and mount for practice:
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{ "do": "tap", "on": ".row.focus", "practice": true, "say": "Tap the task to open it." }
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
mountScenes({ scenes, into, practice: true });
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
The scene plays up to the step, shows its symbol where the press is wanted, says it is the reader's turn, and goes on when they press what the step aims at. Without `practice` in the mount, the same cast plays through as a demonstration.
|
|
204
|
+
|
|
205
|
+
### Follow a scene from the page, and take it down
|
|
206
|
+
|
|
207
|
+
`onStep` and `onEnd` say where a scene is; `destroy` stops every scene, takes the figures off the page and stops listening to the window.
|
|
208
|
+
|
|
209
|
+
```typescript
|
|
210
|
+
const mounted = mountScenes({
|
|
211
|
+
scenes,
|
|
212
|
+
into,
|
|
213
|
+
onStep: (sceneId, index) => console.log(sceneId, index),
|
|
214
|
+
onEnd: (sceneId) => console.log(sceneId, "ended"),
|
|
215
|
+
});
|
|
216
|
+
mounted.destroy();
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Draw scenes with a renderer of your own
|
|
220
|
+
|
|
221
|
+
The player on the page is one renderer over layers that need none. A renderer of another kind, a component of a framework for instance, uses the same layers and draws what they describe.
|
|
222
|
+
|
|
223
|
+
| Entry | What it holds | Needs a browser |
|
|
224
|
+
|---|---|---|
|
|
225
|
+
| `@canonical/motion-control/cast` | The cast's types, how long a step lasts, the checker. | No |
|
|
226
|
+
| `@canonical/motion-control/timeline` | A scene laid out in time: `buildTimeline`, `locateTime`, `findKeyframe`, `stepKeyframe`, `advanceClock`. | No |
|
|
227
|
+
| `@canonical/motion-control/moment` | `describeMoment`: for a step and a progress, the frame in view, the symbols and where they are, what the step changes in the frame, the states, and what the panel reads. | No |
|
|
228
|
+
| `@canonical/motion-control/gif` | The GIF encoder. | No |
|
|
229
|
+
| `@canonical/motion-control/dom` | `applyMoment`, which makes a frame show a moment and gives back a function that undoes it; `drawSprites`; the state rules; the recorder; the player itself. | Yes |
|
|
230
|
+
|
|
231
|
+
```typescript
|
|
232
|
+
import { describeMoment } from "@canonical/motion-control/moment";
|
|
233
|
+
import { buildTimeline, locateTime } from "@canonical/motion-control/timeline";
|
|
234
|
+
|
|
235
|
+
const timeline = buildTimeline(scene, (frameName) => "");
|
|
236
|
+
const { index, progress } = locateTime(timeline, 1200);
|
|
237
|
+
const moment = describeMoment(index, progress, { timeline, measure, rightToLeft: false, label, scroll });
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
`measure` says where an aim lands in the layer the symbols are drawn in; it is the one thing a description needs from the page. These entries are new and may still change shape before 1.0.
|
|
241
|
+
|
|
242
|
+
### Look at one moment of a clip
|
|
243
|
+
|
|
244
|
+
A headless browser does not advance a clip's clock reliably, so a screenshot taken after a wait proves nothing. Show the moment directly, then look:
|
|
245
|
+
|
|
246
|
+
```typescript
|
|
247
|
+
const mounted = mountScenes({ scenes, into });
|
|
248
|
+
mounted.pose("remove", 1, 0.6); // the second step of "remove", at 60% of its duration
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Save a scene as a GIF
|
|
252
|
+
|
|
253
|
+
The three dots at the end of the title's row open a menu, and its first entry is Download as GIF. It records the scene from its first moment to its last, ten pictures a second, and hands the reader `<scene id>.gif`: the screen and the panel, without the controls, playing again when it ends if the scene does. To get the bytes without the menu, ask the player:
|
|
254
|
+
|
|
255
|
+
```typescript
|
|
256
|
+
const mounted = mountScenes({ scenes, into });
|
|
257
|
+
const bytes = await mounted.players[0].exportGif((done) => console.log(done));
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
The recording draws the figure with the page's own style rules, and it can only read the rules of stylesheets the page may read: serve the page over HTTP, and keep the stylesheets on the page's own origin or served with CORS headers. A font fetched from another site is not drawn, and text then shows in a font the browser already has. A page inside a sandbox that forbids downloads still records, but the menu's entry saves nothing there; use `exportGif` and do with the bytes what the sandbox allows.
|
|
261
|
+
|
|
262
|
+
### Record a scene as a video, at any size and speed
|
|
263
|
+
|
|
264
|
+
`recordGif` and `recordVideo` record any element that shows a scene's moments: a player's figure, or a slide built round one. Both take the pictures per second, how many times faster than written the scene plays, and the size of the file:
|
|
265
|
+
|
|
266
|
+
```typescript
|
|
267
|
+
import { recordVideo } from "@canonical/motion-control/dom";
|
|
268
|
+
|
|
269
|
+
const bytes = await recordVideo(mounted.players[0], {
|
|
270
|
+
size: { width: 3840, height: 2400 },
|
|
271
|
+
speed: 2,
|
|
272
|
+
fps: 30,
|
|
273
|
+
});
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
To record a scene for a slide deck, give a `slide` in place of a size: the recording is then of a slide of that size, with the scene centred on it and scaled to fill it, a title over it and a caption under it. A `framed` slide shows the whole figure; a `bare` one shows the screen alone, with the symbols over it.
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
const bytes = await recordVideo(mounted.players[0], {
|
|
280
|
+
slide: { width: 3840, height: 2400, mode: "bare", title: "Sliding a task away" },
|
|
281
|
+
speed: 2,
|
|
282
|
+
});
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
The slide is laid out by the stylesheet's `.mo-slide` rules, in hundredths of its height, so a slide is the same at any size; `--mo-slide-paper` and `--mo-slide-ink` set its colours.
|
|
286
|
+
|
|
287
|
+
The video is H.264 in an MP4 file, which presentation software and video players open. It is encoded by the browser's own encoder, so it records where the browser offers one, as Chrome and Edge do; elsewhere `recordVideo` says it cannot, and `recordGif` records the same scene. The file is written by `writeMp4` (`@canonical/motion-control/video`), which needs no browser.
|
|
288
|
+
|
|
289
|
+
## Reference
|
|
290
|
+
|
|
291
|
+
Every export carries a doc comment, and the types say the rest: `Scene` and `Step` for a cast, `Profile` for what a page says about its frames, `MountOptions` for `mountScenes`. A cast as JSON is described by `@canonical/motion-control/cast.schema.json`. The stylesheet reads its colours from custom properties, each with a fallback: `--mo` for the interaction layer, `--mo-paper` and `--mo-rule` for the screen and the legend, and `--mo-bg`, `--mo-fg` and `--mo-edge` for the panel and the frame round a figure.
|
|
292
|
+
|
|
293
|
+
`examples/` sets the same four scenes up four ways: a script tag, a module import, clips in iframes, and one self-contained file.
|
|
294
|
+
|
|
295
|
+
## Stability
|
|
296
|
+
|
|
297
|
+
The version is below 1.0: the cast format, the profile and the exports can change between minor versions.
|
|
298
|
+
|
|
299
|
+
## License
|
|
300
|
+
|
|
301
|
+
MIT
|
package/cast.schema.json
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "motion casts",
|
|
4
|
+
"type": "array",
|
|
5
|
+
"items": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["id", "title", "steps"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
|
|
11
|
+
"title": { "type": "string" },
|
|
12
|
+
"device": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The name of a shell in the profile. phone and wide exist by default."
|
|
15
|
+
},
|
|
16
|
+
"clip": {
|
|
17
|
+
"type": "boolean",
|
|
18
|
+
"description": "A longer end-to-end story (20 to 30 s) with chapters."
|
|
19
|
+
},
|
|
20
|
+
"loop": { "type": "boolean" },
|
|
21
|
+
"about": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"required": ["kind", "name"],
|
|
24
|
+
"properties": {
|
|
25
|
+
"kind": { "type": "string" },
|
|
26
|
+
"name": { "type": "string" }
|
|
27
|
+
},
|
|
28
|
+
"description": "What the scene shows in the product's own model: a journey, a situation, a requirement."
|
|
29
|
+
},
|
|
30
|
+
"steps": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"minItems": 1,
|
|
33
|
+
"items": {
|
|
34
|
+
"oneOf": [
|
|
35
|
+
{
|
|
36
|
+
"type": "object",
|
|
37
|
+
"required": ["frame"],
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"properties": {
|
|
40
|
+
"frame": { "type": "string" },
|
|
41
|
+
"hold": { "type": "number", "minimum": 0 },
|
|
42
|
+
"type": {
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"description": "Type the frame's line in, letter by letter."
|
|
45
|
+
},
|
|
46
|
+
"cps": { "type": "number" },
|
|
47
|
+
"say": { "type": "string" },
|
|
48
|
+
"chapter": { "type": "string" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "object",
|
|
53
|
+
"required": ["do"],
|
|
54
|
+
"additionalProperties": false,
|
|
55
|
+
"properties": {
|
|
56
|
+
"do": {
|
|
57
|
+
"enum": [
|
|
58
|
+
"tap",
|
|
59
|
+
"hold",
|
|
60
|
+
"slide",
|
|
61
|
+
"drag",
|
|
62
|
+
"move",
|
|
63
|
+
"click",
|
|
64
|
+
"wheel",
|
|
65
|
+
"key",
|
|
66
|
+
"type",
|
|
67
|
+
"wait"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"on": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"description": "A CSS selector inside the frame in view."
|
|
73
|
+
},
|
|
74
|
+
"at": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"items": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
77
|
+
"minItems": 2,
|
|
78
|
+
"maxItems": 2
|
|
79
|
+
},
|
|
80
|
+
"ms": { "type": "number", "minimum": 0 },
|
|
81
|
+
"to": { "enum": ["start", "end"] },
|
|
82
|
+
"depth": { "enum": ["short", "deep"] },
|
|
83
|
+
"dy": { "type": "number" },
|
|
84
|
+
"move": { "type": "string" },
|
|
85
|
+
"k": { "type": "string" },
|
|
86
|
+
"text": { "type": "string" },
|
|
87
|
+
"cps": { "type": "number" },
|
|
88
|
+
"practice": {
|
|
89
|
+
"type": "boolean",
|
|
90
|
+
"description": "For a tap, a click or a hold: wait for the reader to do it on the frame before going on, where the page plays its scenes for practice."
|
|
91
|
+
},
|
|
92
|
+
"say": { "type": "string" },
|
|
93
|
+
"chapter": { "type": "string" }
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
package/dist/esm/cli.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* motion-control check <casts.json> [--frames <frames.json>]
|
|
4
|
+
*
|
|
5
|
+
* Checks casts without a browser. The frames file is a list of frame names, or of objects with an id and perhaps
|
|
6
|
+
* a code. Exits with 1 when something cannot be played, 2 when the command is not understood.
|
|
7
|
+
*
|
|
8
|
+
* @note Impure: it reads files, prints, and sets the exit code.
|
|
9
|
+
*/
|
|
10
|
+
import { readFileSync } from "node:fs";
|
|
11
|
+
import { checkCasts, formatReport, listFrameNames } from "./lib/index.js";
|
|
12
|
+
const [command, castsPath, ...rest] = process.argv.slice(2);
|
|
13
|
+
const flag = rest.indexOf("--frames");
|
|
14
|
+
const framesPath = flag >= 0 ? rest.at(flag + 1) : undefined;
|
|
15
|
+
if (command !== "check" || castsPath === undefined) {
|
|
16
|
+
console.error("usage: motion-control check <casts.json> [--frames <frames.json>]");
|
|
17
|
+
process.exitCode = 2;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
const casts = JSON.parse(readFileSync(castsPath, "utf8"));
|
|
21
|
+
const names = framesPath === undefined
|
|
22
|
+
? undefined
|
|
23
|
+
: listFrameNames(JSON.parse(readFileSync(framesPath, "utf8")));
|
|
24
|
+
const result = checkCasts(casts, names);
|
|
25
|
+
for (const line of formatReport(casts, result, names !== undefined)) {
|
|
26
|
+
console.log(line);
|
|
27
|
+
}
|
|
28
|
+
process.exitCode = result.errors.length > 0 ? 1 : 0;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=cli.js.map
|
|
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AAC;IACD,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The published surface as one classic script: it puts the exports of the package on `globalThis.Motion`, for a
|
|
3
|
+
* page that cannot import modules, such as a single self-contained HTML file.
|
|
4
|
+
*/
|
|
5
|
+
import * as Motion from "./index.js";
|
|
6
|
+
globalThis.Motion = Motion;
|
|
7
|
+
//# sourceMappingURL=global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.js","sourceRoot":"","sources":["../../src/global.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,YAAY,CAAC;AAEpC,UAAyC,CAAC,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAuCA,OAAO,EACL,UAAU,EACV,aAAa,EACb,SAAS,EACT,YAAY,EACZ,cAAc,EACd,WAAW,GACZ,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import checkScene from "./checkScene.js";
|
|
2
|
+
/**
|
|
3
|
+
* Checks a list of scenes without a browser.
|
|
4
|
+
*
|
|
5
|
+
* Errors are things the player cannot play: a frame that does not exist, a step that is neither a frame nor an
|
|
6
|
+
* interaction, an id used twice. Warnings are things a reviewer would question: an interaction whose effect is
|
|
7
|
+
* never shown, a scene far from its intended length. A selector that matches nothing cannot be found here,
|
|
8
|
+
* since that needs the frames themselves: the player's `audit` finds those in a browser.
|
|
9
|
+
*
|
|
10
|
+
* @param casts - The scenes, as read from a file: nothing about them is taken for granted.
|
|
11
|
+
* @param frameNames - The names of the frames that exist. Leave out to skip checking frame names.
|
|
12
|
+
* @returns What cannot be played, and what a reviewer would question, as sentences.
|
|
13
|
+
*/
|
|
14
|
+
export default function checkCasts(casts, frameNames) {
|
|
15
|
+
if (!Array.isArray(casts)) {
|
|
16
|
+
return { errors: ["The casts must be a list of scenes."], warnings: [] };
|
|
17
|
+
}
|
|
18
|
+
const names = frameNames ? new Set(frameNames) : undefined;
|
|
19
|
+
const errors = [];
|
|
20
|
+
const warnings = [];
|
|
21
|
+
const seen = new Set();
|
|
22
|
+
casts.forEach((scene, index) => {
|
|
23
|
+
const found = checkScene(scene, index + 1, names);
|
|
24
|
+
errors.push(...found.errors);
|
|
25
|
+
warnings.push(...found.warnings);
|
|
26
|
+
const id = scene?.id;
|
|
27
|
+
if (id != null && seen.has(id)) {
|
|
28
|
+
errors.push(`scene ${String(id)}: this id is used twice.`);
|
|
29
|
+
}
|
|
30
|
+
seen.add(id);
|
|
31
|
+
});
|
|
32
|
+
return { errors, warnings };
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=checkCasts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkCasts.js","sourceRoot":"","sources":["../../../../src/lib/cast/checkCasts.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAGzC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,KAAc,EACd,UAA6B;IAE7B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,EAAE,MAAM,EAAE,CAAC,qCAAqC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC3E,CAAC;IACD,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3D,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAW,CAAC;IAChC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAC7B,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QAClD,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7B,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;QACjC,MAAM,EAAE,GAAI,KAAiC,EAAE,EAAE,CAAC;QAClD,IAAI,EAAE,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YAC/B,MAAM,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC;QAC7D,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACf,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import checkStep from "./checkStep.js";
|
|
2
|
+
import { LIMITS } from "./constants.js";
|
|
3
|
+
import measureScene from "./measureScene.js";
|
|
4
|
+
const isRecord = (value) => typeof value === "object" && value !== null;
|
|
5
|
+
/**
|
|
6
|
+
* Checks one scene: its name, its title, what it is about, each of its steps, and how long it lasts.
|
|
7
|
+
*
|
|
8
|
+
* @param scene - The scene, as read from a file: nothing about it is taken for granted.
|
|
9
|
+
* @param position - Its place in the list, counted from one, to name it when it has no id.
|
|
10
|
+
* @param frameNames - The names of the frames that exist, or nothing to leave names unchecked.
|
|
11
|
+
* @returns What cannot be played, and what a reviewer would question.
|
|
12
|
+
*/
|
|
13
|
+
export default function checkScene(scene, position, frameNames) {
|
|
14
|
+
const errors = [];
|
|
15
|
+
const warnings = [];
|
|
16
|
+
if (!isRecord(scene)) {
|
|
17
|
+
return { errors: [`scene #${position}: is not an object.`], warnings };
|
|
18
|
+
}
|
|
19
|
+
const where = `scene ${typeof scene.id === "string" && scene.id ? scene.id : `#${position}`}`;
|
|
20
|
+
if (typeof scene.id !== "string" || !/^[a-z][a-z0-9-]*$/.test(scene.id)) {
|
|
21
|
+
errors.push(`${where}: id must be lower-case letters, digits and hyphens, starting with a letter.`);
|
|
22
|
+
}
|
|
23
|
+
if (!scene.title)
|
|
24
|
+
errors.push(`${where}: has no title.`);
|
|
25
|
+
if (scene.about != null &&
|
|
26
|
+
!(isRecord(scene.about) && scene.about.kind && scene.about.name)) {
|
|
27
|
+
errors.push(`${where}: about needs a kind and a name.`);
|
|
28
|
+
}
|
|
29
|
+
const steps = scene.steps;
|
|
30
|
+
if (!Array.isArray(steps) || steps.length === 0) {
|
|
31
|
+
errors.push(`${where}: has no steps.`);
|
|
32
|
+
return { errors, warnings };
|
|
33
|
+
}
|
|
34
|
+
if (!(isRecord(steps.at(0)) && steps.at(0).frame)) {
|
|
35
|
+
errors.push(`${where}: the first step must show a frame.`);
|
|
36
|
+
}
|
|
37
|
+
steps.forEach((step, index) => {
|
|
38
|
+
const found = checkStep(step, steps.at(index + 1), `${where}, step ${index + 1}`, frameNames);
|
|
39
|
+
errors.push(...found.errors);
|
|
40
|
+
warnings.push(...found.warnings);
|
|
41
|
+
});
|
|
42
|
+
if (errors.length > 0)
|
|
43
|
+
return { errors, warnings };
|
|
44
|
+
if (!steps.some((step) => step.say)) {
|
|
45
|
+
warnings.push(`${where}: has no captions.`);
|
|
46
|
+
}
|
|
47
|
+
const kind = scene.clip ? "clip" : "scene";
|
|
48
|
+
const [shortest, longest] = LIMITS[kind];
|
|
49
|
+
const duration = measureScene({ steps: steps });
|
|
50
|
+
if (duration < shortest || duration > longest) {
|
|
51
|
+
warnings.push(`${where}: lasts about ${(duration / 1000).toFixed(1)} s; a ${kind} is meant to last ${shortest / 1000} to ${longest / 1000} s.`);
|
|
52
|
+
}
|
|
53
|
+
if (scene.clip && !steps.some((step) => step.chapter)) {
|
|
54
|
+
warnings.push(`${where}: a clip should name its chapters.`);
|
|
55
|
+
}
|
|
56
|
+
return { errors, warnings };
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=checkScene.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkScene.js","sourceRoot":"","sources":["../../../../src/lib/cast/checkScene.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAG7C,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AAE9C;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,KAAc,EACd,QAAgB,EAChB,UAAgC;IAEhC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,EAAE,MAAM,EAAE,CAAC,UAAU,QAAQ,qBAAqB,CAAC,EAAE,QAAQ,EAAE,CAAC;IACzE,CAAC;IACD,MAAM,KAAK,GAAG,SAAS,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,EAAE,CAAC;IAC9F,IAAI,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;QACxE,MAAM,CAAC,IAAI,CACT,GAAG,KAAK,8EAA8E,CACvF,CAAC;IACJ,CAAC;IACD,I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tap", "hold", "click", "slide"];
|
|
4
|
+
/** The interactions whose effect must be shown by the step that follows. */
|
|
5
|
+
/** The interactions a reader can do on a drawn frame, so a step of these kinds may wait for them. */
|
|
6
|
+
const PRACTISED = ["tap", "click", "hold"];
|
|
7
|
+
const CONSEQUENTIAL = [...AIMED, "key"];
|
|
8
|
+
const isRecord = (value) => typeof value === "object" && value !== null;
|
|
9
|
+
const isFraction = (value) => typeof value === "number" && value >= 0 && value <= 1;
|
|
10
|
+
/**
|
|
11
|
+
* Checks one step of a scene.
|
|
12
|
+
*
|
|
13
|
+
* @param step - The step, as read from a file: nothing about it is taken for granted.
|
|
14
|
+
* @param next - The step after it, if any.
|
|
15
|
+
* @param where - How to name the step in a sentence, such as `scene add, step 2`.
|
|
16
|
+
* @param frameNames - The names of the frames that exist, or nothing to leave names unchecked.
|
|
17
|
+
* @returns What cannot be played, and what a reviewer would question.
|
|
18
|
+
*/
|
|
19
|
+
export default function checkStep(step, next, where, frameNames) {
|
|
20
|
+
const errors = [];
|
|
21
|
+
const warnings = [];
|
|
22
|
+
if (!isRecord(step) || !!step.frame === !!step.do) {
|
|
23
|
+
errors.push(`${where}: a step shows a frame or does one interaction, not both and not neither.`);
|
|
24
|
+
return { errors, warnings };
|
|
25
|
+
}
|
|
26
|
+
if (typeof step.say === "string" && step.say.length > MAX_CAPTION) {
|
|
27
|
+
warnings.push(`${where}: the caption is ${step.say.length} characters; keep it under ${MAX_CAPTION}.`);
|
|
28
|
+
}
|
|
29
|
+
if (step.frame) {
|
|
30
|
+
if (frameNames && !frameNames.has(String(step.frame))) {
|
|
31
|
+
errors.push(`${where}: no frame is named ${step.frame}.`);
|
|
32
|
+
}
|
|
33
|
+
if (step.hold != null && !(Number(step.hold) >= 0)) {
|
|
34
|
+
errors.push(`${where}: hold must be a number of milliseconds.`);
|
|
35
|
+
}
|
|
36
|
+
return { errors, warnings };
|
|
37
|
+
}
|
|
38
|
+
const kind = String(step.do);
|
|
39
|
+
if (!ACTIONS.includes(kind)) {
|
|
40
|
+
errors.push(`${where}: ${kind} is not an interaction. Use one of: ${ACTIONS.join(", ")}.`);
|
|
41
|
+
return { errors, warnings };
|
|
42
|
+
}
|
|
43
|
+
if (kind === "key" && !step.k) {
|
|
44
|
+
errors.push(`${where}: a key step needs k, the name on the keycap.`);
|
|
45
|
+
}
|
|
46
|
+
if (step.to != null && step.to !== "start" && step.to !== "end") {
|
|
47
|
+
errors.push(`${where}: a slide goes to start or to end.`);
|
|
48
|
+
}
|
|
49
|
+
if (step.depth != null && step.depth !== "short" && step.depth !== "deep") {
|
|
50
|
+
errors.push(`${where}: a slide's depth is short or deep.`);
|
|
51
|
+
}
|
|
52
|
+
if (step.practice && !PRACTISED.includes(kind)) {
|
|
53
|
+
errors.push(`${where}: only a tap, a click or a hold can wait for the reader to practise it.`);
|
|
54
|
+
}
|
|
55
|
+
if (step.on != null && (typeof step.on !== "string" || !step.on.trim())) {
|
|
56
|
+
errors.push(`${where}: on must be a CSS selector.`);
|
|
57
|
+
}
|
|
58
|
+
if (step.at != null &&
|
|
59
|
+
!(Array.isArray(step.at) &&
|
|
60
|
+
step.at.length === 2 &&
|
|
61
|
+
step.at.every(isFraction))) {
|
|
62
|
+
errors.push(`${where}: at is two fractions between 0 and 1.`);
|
|
63
|
+
}
|
|
64
|
+
if (AIMED.includes(kind) && !step.on) {
|
|
65
|
+
warnings.push(`${where}: ${kind} has no target (on), so it lands in the middle of the screen.`);
|
|
66
|
+
}
|
|
67
|
+
const shown = isRecord(next) && (!!next.frame || next.do === "key");
|
|
68
|
+
if (CONSEQUENTIAL.includes(kind) && !shown) {
|
|
69
|
+
warnings.push(`${where}: nothing shows what this ${kind} did. Follow it with a frame.`);
|
|
70
|
+
}
|
|
71
|
+
return { errors, warnings };
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=checkStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkStep.js","sourceRoot":"","sources":["../../../../src/lib/cast/checkStep.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