@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/package.json
CHANGED
|
@@ -1,6 +1,107 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonical/motion-control",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"description": "Short looping clips of interactions, played over your own HTML frames, with one symbol per kind of interaction.",
|
|
4
|
+
"version": "0.47.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"./dist/motion.global.js",
|
|
10
|
+
"./dist/esm/global.js",
|
|
11
|
+
"./dist/esm/cli.js",
|
|
12
|
+
"**/*.css"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/types/index.d.ts",
|
|
17
|
+
"import": "./dist/esm/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./cast": {
|
|
20
|
+
"types": "./dist/types/lib/cast/index.d.ts",
|
|
21
|
+
"import": "./dist/esm/lib/cast/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./timeline": {
|
|
24
|
+
"types": "./dist/types/lib/timeline/index.d.ts",
|
|
25
|
+
"import": "./dist/esm/lib/timeline/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./moment": {
|
|
28
|
+
"types": "./dist/types/lib/moment/index.d.ts",
|
|
29
|
+
"import": "./dist/esm/lib/moment/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./dom": {
|
|
32
|
+
"types": "./dist/types/lib/player/index.d.ts",
|
|
33
|
+
"import": "./dist/esm/lib/player/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./gif": {
|
|
36
|
+
"types": "./dist/types/lib/gif/index.d.ts",
|
|
37
|
+
"import": "./dist/esm/lib/gif/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./video": {
|
|
40
|
+
"types": "./dist/types/lib/video/index.d.ts",
|
|
41
|
+
"import": "./dist/esm/lib/video/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./style.css": "./dist/motion.css",
|
|
44
|
+
"./global": "./dist/motion.global.js",
|
|
45
|
+
"./cast.schema.json": "./cast.schema.json"
|
|
46
|
+
},
|
|
47
|
+
"bin": {
|
|
48
|
+
"motion-control": "dist/esm/cli.js"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"dist",
|
|
52
|
+
"skills",
|
|
53
|
+
"cast.schema.json"
|
|
54
|
+
],
|
|
55
|
+
"keywords": [
|
|
56
|
+
"prototype",
|
|
57
|
+
"frames",
|
|
58
|
+
"interaction",
|
|
59
|
+
"animation",
|
|
60
|
+
"specification",
|
|
61
|
+
"design"
|
|
62
|
+
],
|
|
63
|
+
"author": {
|
|
64
|
+
"email": "webteam@canonical.com",
|
|
65
|
+
"name": "Canonical Webteam"
|
|
66
|
+
},
|
|
67
|
+
"repository": {
|
|
68
|
+
"type": "git",
|
|
69
|
+
"url": "https://github.com/canonical/pragma-web"
|
|
70
|
+
},
|
|
71
|
+
"license": "LGPL-3.0",
|
|
72
|
+
"bugs": {
|
|
73
|
+
"url": "https://github.com/canonical/pragma-web/issues"
|
|
74
|
+
},
|
|
75
|
+
"homepage": "https://github.com/canonical/pragma-web#readme",
|
|
76
|
+
"publishConfig": {
|
|
77
|
+
"access": "public"
|
|
78
|
+
},
|
|
79
|
+
"scripts": {
|
|
80
|
+
"build": "tsc -p tsconfig.build.json && bun run build:css && bun run build:global",
|
|
81
|
+
"build:css": "cp src/lib/player/motion.css dist/motion.css",
|
|
82
|
+
"build:global": "bun build src/global.ts --outfile dist/motion.global.js --format iife --minify-syntax",
|
|
83
|
+
"build:all": "bun run build",
|
|
84
|
+
"check": "bun run check:biome && bun run check:ts && bun run check:webarchitect",
|
|
85
|
+
"check:webarchitect": "webarchitect library",
|
|
86
|
+
"check:fix": "bun run check:biome:fix && bun run check:ts",
|
|
87
|
+
"check:biome": "biome check",
|
|
88
|
+
"check:biome:fix": "biome check --write",
|
|
89
|
+
"check:ts": "tsc --noEmit",
|
|
90
|
+
"test": "vitest run",
|
|
91
|
+
"test:watch": "vitest",
|
|
92
|
+
"test:coverage": "vitest run --coverage",
|
|
93
|
+
"examples": "bun examples/serve.ts",
|
|
94
|
+
"examples:single": "node examples/04-single-file/build.mjs"
|
|
95
|
+
},
|
|
96
|
+
"devDependencies": {
|
|
97
|
+
"@biomejs/biome": "2.6.9",
|
|
98
|
+
"@canonical/biome-config": "0.47.0",
|
|
99
|
+
"@canonical/typescript-config": "0.46.0",
|
|
100
|
+
"@canonical/webarchitect": "0.46.0",
|
|
101
|
+
"@types/node": "^26.0.0",
|
|
102
|
+
"@vitest/coverage-v8": "^5.0.0",
|
|
103
|
+
"happy-dom": "^21.0.0",
|
|
104
|
+
"typescript": "^7.0.2",
|
|
105
|
+
"vitest": "^5.0.0"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-motion-frames
|
|
3
|
+
description: Turn a set of drawn interface frames into short looping clips that show the interactions between them, with @canonical/motion-control; also runs as a guided tutorial on a worked example
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Design Motion Frames
|
|
7
|
+
|
|
8
|
+
Show how an interface is used, not only how it looks. Take frames that are already drawn as HTML, and write casts: short lists that say which frame to show and which interaction leads to the next. The result is a page of clips a designer or a contributor can play, step through and scrub, and that sits in the specification next to the frames it uses.
|
|
9
|
+
|
|
10
|
+
**A clip never redraws anything.** It plays the catalogue's own frames. When a frame changes, every clip that uses it changes with it. If a clip needs a state that is not drawn, the frame is missing: ask for it, do not fake it in the cast.
|
|
11
|
+
|
|
12
|
+
## Working mode: assistant to a design authority
|
|
13
|
+
|
|
14
|
+
Most of the time this skill runs with an operator who owns the design. They are the authority. You are the assistant whose job is to make them successful:
|
|
15
|
+
|
|
16
|
+
- Say which step comes next and why.
|
|
17
|
+
- Do the legwork yourself: read the frames, write the casts, run the checks, look at the result.
|
|
18
|
+
- Bring each decision as a recommendation plus a question. Which interactions deserve a clip, and what a clip must prove, is in no file.
|
|
19
|
+
|
|
20
|
+
Decision gates — pause at each and resolve it WITH the operator:
|
|
21
|
+
|
|
22
|
+
1. Which interactions get a scene, and which end-to-end stories get a clip.
|
|
23
|
+
2. Any frame a story needs that is not drawn.
|
|
24
|
+
3. What a clip is bound to in the product's own model (a journey, a situation, a requirement).
|
|
25
|
+
4. Where the page of clips is published, and who can open it.
|
|
26
|
+
|
|
27
|
+
## When to Use
|
|
28
|
+
|
|
29
|
+
- Frames exist as HTML and reviewers cannot tell from them how one state leads to another
|
|
30
|
+
- A gesture, a scroll behaviour or a keyboard path needs to be reviewed in motion
|
|
31
|
+
- A specification needs an end-to-end story a newcomer can watch in half a minute
|
|
32
|
+
|
|
33
|
+
## When NOT to Use
|
|
34
|
+
|
|
35
|
+
- No frames are drawn yet — draw them first; this skill animates, it does not design
|
|
36
|
+
- The question is how an element moves between two states (easing, a true transition) — motion cuts from frame to frame and moves only the element that is touched
|
|
37
|
+
- A marketing video is wanted — a clip is a specification, and looks like one
|
|
38
|
+
|
|
39
|
+
## Opening move: ask, or offer the tutorial
|
|
40
|
+
|
|
41
|
+
Unless the first message already names the work, ask:
|
|
42
|
+
|
|
43
|
+
> Which frames should I work from, and which interaction is hardest to judge from still
|
|
44
|
+
> frames today? Something like "the Frames page of the board, and what happens when you
|
|
45
|
+
> slide a row away".
|
|
46
|
+
|
|
47
|
+
Offer the tutorial in the same breath:
|
|
48
|
+
|
|
49
|
+
> Or I can run it as a tutorial on a worked example: a list with a heading that stays in
|
|
50
|
+
> place, a row that slides away, and a line to type in.
|
|
51
|
+
|
|
52
|
+
## The vocabulary
|
|
53
|
+
|
|
54
|
+
A **frame** is one drawn state of a screen. A **scene** is two to ten seconds: a few frames and the interactions between them, proving one thing. A **clip** is twenty to thirty seconds: one end-to-end story, cut into named **chapters**. A **cast** is the JSON that describes a scene or a clip.
|
|
55
|
+
|
|
56
|
+
Each kind of interaction has one symbol, the same in every clip:
|
|
57
|
+
|
|
58
|
+
| `do` | Symbol | Use it for |
|
|
59
|
+
|---|---|---|
|
|
60
|
+
| `tap` | a ring, down and up | a finger pressing something |
|
|
61
|
+
| `hold` | a ring whose edge fills | a long press |
|
|
62
|
+
| `slide` | a ring moving sideways with a trail | a swipe on a row; `to` start or end, `depth` short or deep |
|
|
63
|
+
| `drag` | a ring moving up or down with a trail | scrolling by touch; `dy` in pixels |
|
|
64
|
+
| `move` | the mouse pointer | bringing the pointer somewhere |
|
|
65
|
+
| `click` | the pointer and a ring at its tip | a mouse press |
|
|
66
|
+
| `wheel` | the pointer and a wheel that turns | scrolling with a mouse; `dy` |
|
|
67
|
+
| `key` | a keycap with the key's name | one key; `k` |
|
|
68
|
+
| `type` | letters arriving in the line | typing; `text`, or `"type": true` on a frame |
|
|
69
|
+
| `wait` | nothing | a pause that is not a frame's hold |
|
|
70
|
+
|
|
71
|
+
Never invent a symbol, and never use a touch symbol on a wide screen with a mouse or the reverse. If an interaction has no symbol, raise it with the operator.
|
|
72
|
+
|
|
73
|
+
## Step 1 — Make the frames name themselves
|
|
74
|
+
|
|
75
|
+
Each frame is an element whose content is the frame's HTML:
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<div data-frame="board.1" data-code="C1" data-state="rest" data-device="phone">…</div>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`data-frame` is the name casts use. `data-code` is an optional short name to say aloud. A frame flagged as not part of the first version carries the class `later`. If the frames are not marked this way, ask whoever owns them to add the attributes; do not match frames by their order or their captions, which change.
|
|
82
|
+
|
|
83
|
+
## Step 2 — Write the profile
|
|
84
|
+
|
|
85
|
+
The profile tells motion what it cannot guess about these frames. Fill in only what differs from the default:
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
const profile = {
|
|
89
|
+
shells: { phone: '<div class="phone"><div class="screen mo-screen"></div></div>' },
|
|
90
|
+
settle(screen) { /* anchor the input to the foot of a screen of fixed height */ },
|
|
91
|
+
line: ".input .field", // where typed words go
|
|
92
|
+
readLine: (line) => line.textContent,
|
|
93
|
+
writeLine: (line, text) => { line.textContent = text; },
|
|
94
|
+
slideTarget: (el) => el.closest(".row") ?? el, // what a slide carries with it
|
|
95
|
+
scroll: { touch: ".list", wheel: ".list" }, // what rolls
|
|
96
|
+
stick: (list) => { const head = list.querySelector(".heading"); return head ? { box: list, head } : undefined; },
|
|
97
|
+
onScroll(screen) { /* show what the design shows once content has rolled */ },
|
|
98
|
+
};
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Get `stick` and `onScroll` right before writing any scroll scene. A scroll that moves a heading the design keeps in place, or shows a rule late, teaches reviewers the wrong behaviour, and they will report it as a bug in the design.
|
|
102
|
+
|
|
103
|
+
## Step 3 — Write the casts
|
|
104
|
+
|
|
105
|
+
One scene proves one thing. Write it as a reader would watch it:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"id": "remove",
|
|
110
|
+
"title": "Sliding a row away",
|
|
111
|
+
"device": "phone",
|
|
112
|
+
"steps": [
|
|
113
|
+
{ "frame": "board.1", "hold": 1000, "say": "Row 4 is in the band." },
|
|
114
|
+
{ "do": "slide", "on": ".row.focus", "to": "end", "depth": "deep", "say": "A slide all the way to the end." },
|
|
115
|
+
{ "frame": "board.removed", "hold": 2200, "say": "Removed. The band says what went, with the way back." }
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Rules that keep a cast honest:
|
|
121
|
+
|
|
122
|
+
1. **Start on a frame.** The first step always shows one.
|
|
123
|
+
2. **Every interaction is followed by the frame that shows its result.** An interaction with nothing after it proves nothing.
|
|
124
|
+
3. **Aim every interaction.** Give `on`, a selector inside the frame in view, and `at` when the middle of the element is the wrong place.
|
|
125
|
+
4. **Hold a frame long enough to read it**: about a second for a familiar state, two or more for a new one with text.
|
|
126
|
+
5. **Caption each beat** with `say`: one short sentence, in the product's own words, about what is on screen. Not what the code does.
|
|
127
|
+
6. **Do not paper over a gap.** If two frames in a row do not follow from each other, say so in the caption ("Later, reading.") and tell the operator which frame is missing.
|
|
128
|
+
|
|
129
|
+
A clip adds `"clip": true`, a `chapter` name on each step that opens a part, and `about`:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{ "id": "found", "title": "A sentence found, opened, asked about", "clip": true,
|
|
133
|
+
"about": { "kind": "situation", "name": "seen" }, "steps": [ … ] }
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
`about.kind` is free: use the word the product's own model uses.
|
|
137
|
+
|
|
138
|
+
## Step 4 — Check, then look
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
motion-control check casts.json --frames frames.json
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
This fails on what cannot be played (a frame that does not exist, a malformed step) and warns on what a reviewer would question (an interaction with no result, a scene far from its length). It cannot see whether a selector matches: that needs the frames. In the browser:
|
|
145
|
+
|
|
146
|
+
```js
|
|
147
|
+
const mounted = mountScenes({ scenes, into, profile });
|
|
148
|
+
mounted.audit(); // every target that matches nothing, as sentences
|
|
149
|
+
mounted.pose("remove", 1, 0.6); // show step 2 of "remove" at 60% of its duration
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Verify with `pose`, never by waiting.** A headless browser does not advance the clock reliably, so a screenshot taken "after two seconds" proves nothing. Pose the exact step and fraction, then take the screenshot. For every scene, look at one moment in the middle of each interaction and at each frame settled. Do this in the light and the dark theme.
|
|
153
|
+
|
|
154
|
+
## Step 5 — Publish
|
|
155
|
+
|
|
156
|
+
Put the page where the frames are published, with the legend of symbols at the top. For one clip alone, link `#<scene id>`, or build a self-contained file with the global script (`@canonical/motion-control/global`) and `solo`. Say who can open it.
|
|
157
|
+
|
|
158
|
+
## What to hand back
|
|
159
|
+
|
|
160
|
+
- The casts, the profile and the page.
|
|
161
|
+
- The output of `motion-control check` and of `audit()`, both clean, or each remaining line explained.
|
|
162
|
+
- The list of frames a story needed that are not drawn.
|
|
163
|
+
- What you looked at, in which theme, and what you did not.
|
|
164
|
+
|
|
165
|
+
## Common mistakes
|
|
166
|
+
|
|
167
|
+
- Matching frames by position in the page. Use `data-frame`.
|
|
168
|
+
- A clip that hides a missing frame behind a quick cut.
|
|
169
|
+
- Captions that describe the mechanism ("the row translates") instead of what the reader sees ("the row slides away").
|
|
170
|
+
- A scene that tries to prove three things. Split it.
|
|
171
|
+
- Trusting a build that ran. Look at the posed moments.
|
|
172
|
+
- Drawing a hovered or focused state by hand in a frame that a step then reaches. The player marks what a step hovers, presses and focuses (`data-mo-hover`, `data-mo-active`, `data-mo-focus`) and mirrors the page's own `:hover`, `:active` and `:focus` rules onto the marks. Draw a state into a frame, with the mark in its markup, only when the frame starts in that state.
|
|
173
|
+
- A row styled on hover that is not the step's target. Aim the `move` or the `click` at the element the rule is written for, or at something inside it.
|
|
174
|
+
|
|
175
|
+
## Worked example
|
|
176
|
+
|
|
177
|
+
A list of rows under a heading, with a line to type in. Three frames: `list.rest`, `list.scrolled` (the heading in place, a rule under it), `list.removed`.
|
|
178
|
+
|
|
179
|
+
1. *Frames*: each `.screen` gets `data-frame`.
|
|
180
|
+
2. *Profile*: `.list` rolls; `.heading` stays; a slide carries `.row`; the line is `.field`.
|
|
181
|
+
3. *Casts*: `scroll` (rest, `drag`, scrolled) and `remove` (rest, deep `slide` to the end, removed).
|
|
182
|
+
4. *Check*: `motion-control check` is clean. `audit()` reports `.row.focus matches nothing in list.scrolled`: the scroll scene aimed a tap at a row the scrolled frame no longer marks. The cast was wrong; fix the selector.
|
|
183
|
+
5. *Look*: `pose("scroll", 1, 0.5)` shows the heading still in place with rows passing under it. That is the behaviour the design intends, and now a reviewer can see it.
|