@cardstack/choreo 0.0.0 → 0.1.0-unstable.1

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.
Files changed (165) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/LICENSE +21 -0
  3. package/README.md +55 -6
  4. package/addon-main.cjs +4 -0
  5. package/declarations/anchors.d.ts +26 -0
  6. package/declarations/anchors.d.ts.map +1 -0
  7. package/declarations/arming.d.ts +33 -0
  8. package/declarations/arming.d.ts.map +1 -0
  9. package/declarations/beacon.d.ts +9 -0
  10. package/declarations/beacon.d.ts.map +1 -0
  11. package/declarations/beacons.d.ts +23 -0
  12. package/declarations/beacons.d.ts.map +1 -0
  13. package/declarations/changeset.d.ts +46 -0
  14. package/declarations/changeset.d.ts.map +1 -0
  15. package/declarations/choreo.d.ts +261 -0
  16. package/declarations/choreo.d.ts.map +1 -0
  17. package/declarations/compile.d.ts +45 -0
  18. package/declarations/compile.d.ts.map +1 -0
  19. package/declarations/deliver.d.ts +44 -0
  20. package/declarations/deliver.d.ts.map +1 -0
  21. package/declarations/easings.d.ts +20 -0
  22. package/declarations/easings.d.ts.map +1 -0
  23. package/declarations/far.d.ts +33 -0
  24. package/declarations/far.d.ts.map +1 -0
  25. package/declarations/film/clip.d.ts +51 -0
  26. package/declarations/film/clip.d.ts.map +1 -0
  27. package/declarations/film/clips.d.ts +155 -0
  28. package/declarations/film/clips.d.ts.map +1 -0
  29. package/declarations/film/film.d.ts +1208 -0
  30. package/declarations/film/film.d.ts.map +1 -0
  31. package/declarations/film/graph/adjust.d.ts +112 -0
  32. package/declarations/film/graph/adjust.d.ts.map +1 -0
  33. package/declarations/film/graph/compile.d.ts +140 -0
  34. package/declarations/film/graph/compile.d.ts.map +1 -0
  35. package/declarations/film/graph/host.d.ts +67 -0
  36. package/declarations/film/graph/host.d.ts.map +1 -0
  37. package/declarations/film/graph/nodes.d.ts +287 -0
  38. package/declarations/film/graph/nodes.d.ts.map +1 -0
  39. package/declarations/film/index.d.ts +24 -0
  40. package/declarations/film/index.d.ts.map +1 -0
  41. package/declarations/film/joins.d.ts +143 -0
  42. package/declarations/film/joins.d.ts.map +1 -0
  43. package/declarations/film/math.d.ts +15 -0
  44. package/declarations/film/math.d.ts.map +1 -0
  45. package/declarations/film/overlays.d.ts +54 -0
  46. package/declarations/film/overlays.d.ts.map +1 -0
  47. package/declarations/film/picture.d.ts +104 -0
  48. package/declarations/film/picture.d.ts.map +1 -0
  49. package/declarations/film/plate.d.ts +37 -0
  50. package/declarations/film/plate.d.ts.map +1 -0
  51. package/declarations/film/player.d.ts +120 -0
  52. package/declarations/film/player.d.ts.map +1 -0
  53. package/declarations/film/rail.d.ts +40 -0
  54. package/declarations/film/rail.d.ts.map +1 -0
  55. package/declarations/film/schedule.d.ts +93 -0
  56. package/declarations/film/schedule.d.ts.map +1 -0
  57. package/declarations/film/seam.d.ts +38 -0
  58. package/declarations/film/seam.d.ts.map +1 -0
  59. package/declarations/film/titles.d.ts +37 -0
  60. package/declarations/film/titles.d.ts.map +1 -0
  61. package/declarations/film/types.d.ts +544 -0
  62. package/declarations/film/types.d.ts.map +1 -0
  63. package/declarations/film.d.ts +3 -0
  64. package/declarations/film.d.ts.map +1 -0
  65. package/declarations/gesture.d.ts +33 -0
  66. package/declarations/gesture.d.ts.map +1 -0
  67. package/declarations/index.d.ts +26 -0
  68. package/declarations/index.d.ts.map +1 -0
  69. package/declarations/measure.d.ts +29 -0
  70. package/declarations/measure.d.ts.map +1 -0
  71. package/declarations/path.d.ts +73 -0
  72. package/declarations/path.d.ts.map +1 -0
  73. package/declarations/registry.d.ts +46 -0
  74. package/declarations/registry.d.ts.map +1 -0
  75. package/declarations/run.d.ts +406 -0
  76. package/declarations/run.d.ts.map +1 -0
  77. package/declarations/space.d.ts +31 -0
  78. package/declarations/space.d.ts.map +1 -0
  79. package/declarations/steps.d.ts +479 -0
  80. package/declarations/steps.d.ts.map +1 -0
  81. package/declarations/test-support/index.d.ts +30 -0
  82. package/declarations/test-support/index.d.ts.map +1 -0
  83. package/declarations/types.d.ts +761 -0
  84. package/declarations/types.d.ts.map +1 -0
  85. package/dist/anchors.js +34 -0
  86. package/dist/anchors.js.map +1 -0
  87. package/dist/arming.js +120 -0
  88. package/dist/arming.js.map +1 -0
  89. package/dist/beacon.js +25 -0
  90. package/dist/beacon.js.map +1 -0
  91. package/dist/beacons.js +77 -0
  92. package/dist/beacons.js.map +1 -0
  93. package/dist/changeset.js +129 -0
  94. package/dist/changeset.js.map +1 -0
  95. package/dist/choreo.js +1026 -0
  96. package/dist/choreo.js.map +1 -0
  97. package/dist/compile.js +1403 -0
  98. package/dist/compile.js.map +1 -0
  99. package/dist/deliver.js +326 -0
  100. package/dist/deliver.js.map +1 -0
  101. package/dist/easings.js +39 -0
  102. package/dist/easings.js.map +1 -0
  103. package/dist/far.js +147 -0
  104. package/dist/far.js.map +1 -0
  105. package/dist/film/clip.js +100 -0
  106. package/dist/film/clip.js.map +1 -0
  107. package/dist/film/clips.js +147 -0
  108. package/dist/film/clips.js.map +1 -0
  109. package/dist/film/film.js +4424 -0
  110. package/dist/film/film.js.map +1 -0
  111. package/dist/film/graph/adjust.js +160 -0
  112. package/dist/film/graph/adjust.js.map +1 -0
  113. package/dist/film/graph/compile.js +225 -0
  114. package/dist/film/graph/compile.js.map +1 -0
  115. package/dist/film/graph/host.js +77 -0
  116. package/dist/film/graph/host.js.map +1 -0
  117. package/dist/film/graph/nodes.js +500 -0
  118. package/dist/film/graph/nodes.js.map +1 -0
  119. package/dist/film/index.js +18 -0
  120. package/dist/film/index.js.map +1 -0
  121. package/dist/film/joins.js +260 -0
  122. package/dist/film/joins.js.map +1 -0
  123. package/dist/film/math.js +49 -0
  124. package/dist/film/math.js.map +1 -0
  125. package/dist/film/overlays.js +66 -0
  126. package/dist/film/overlays.js.map +1 -0
  127. package/dist/film/picture.js +58 -0
  128. package/dist/film/picture.js.map +1 -0
  129. package/dist/film/plate.js +36 -0
  130. package/dist/film/plate.js.map +1 -0
  131. package/dist/film/player.js +79 -0
  132. package/dist/film/player.js.map +1 -0
  133. package/dist/film/rail.js +38 -0
  134. package/dist/film/rail.js.map +1 -0
  135. package/dist/film/schedule.js +238 -0
  136. package/dist/film/schedule.js.map +1 -0
  137. package/dist/film/seam.js +64 -0
  138. package/dist/film/seam.js.map +1 -0
  139. package/dist/film/titles.js +45 -0
  140. package/dist/film/titles.js.map +1 -0
  141. package/dist/film/types.js +2 -0
  142. package/dist/film/types.js.map +1 -0
  143. package/dist/film.js +18 -0
  144. package/dist/film.js.map +1 -0
  145. package/dist/gesture.js +111 -0
  146. package/dist/gesture.js.map +1 -0
  147. package/dist/index.js +9 -0
  148. package/dist/index.js.map +1 -0
  149. package/dist/measure.js +99 -0
  150. package/dist/measure.js.map +1 -0
  151. package/dist/path.js +272 -0
  152. package/dist/path.js.map +1 -0
  153. package/dist/registry.js +55 -0
  154. package/dist/registry.js.map +1 -0
  155. package/dist/run.js +2423 -0
  156. package/dist/run.js.map +1 -0
  157. package/dist/space.js +57 -0
  158. package/dist/space.js.map +1 -0
  159. package/dist/steps.js +831 -0
  160. package/dist/steps.js.map +1 -0
  161. package/dist/test-support/index.js +150 -0
  162. package/dist/test-support/index.js.map +1 -0
  163. package/dist/types.js +2 -0
  164. package/dist/types.js.map +1 -0
  165. package/package.json +201 -6
@@ -0,0 +1,93 @@
1
+ import type { Beat, Cam, Chapter, Join, JoinName } from './types.ts';
2
+ /** one tick of the shot list, in seconds: a beat's `ticks` × this is its length */
3
+ export declare const TICK = 2;
4
+ /** the whole film, in seconds, leads included */
5
+ export declare function totalSecs(beats: Beat[]): number;
6
+ /** film seconds before a beat's nominal head, leads included */
7
+ export declare function secsBefore(beats: Beat[], index: number): number;
8
+ /**
9
+ * FILM SECONDS AT WHICH A BEAT'S OWN SHOT BEGINS. The cues fire one tick
10
+ * after the beat table says, because the pose-in-force seed occupies the
11
+ * spline's first slot — so the windows the exact clock derives carry the
12
+ * same offset, and the picture and the type agree with the cut film to
13
+ * the frame. This is the single most load-bearing constant in the film.
14
+ */
15
+ export declare function beatStart(beats: Beat[], i: number): number;
16
+ /** one cue per beat (and an `air` cue ahead of a led beat), as delays into the score */
17
+ export interface Cue {
18
+ action: 'air' | 'beat';
19
+ delay: number;
20
+ index: string;
21
+ }
22
+ export declare function cues(beats: Beat[]): Cue[];
23
+ /** the first beat of each chapter, in whole-film indices */
24
+ export declare function chapterHeads(beats: Beat[]): number[];
25
+ /** the chapter menu's rows: head index, numeral, title, shot count, running time */
26
+ export interface Content {
27
+ head: number;
28
+ n: string;
29
+ secs: number;
30
+ shots: number;
31
+ title: string;
32
+ }
33
+ export declare function contents(beats: Beat[], chapters: Chapter[]): Content[];
34
+ /** the seam a beat is entered through, or none when it neither cuts nor names one */
35
+ export declare function joinInto(beats: Beat[], i: number, defaultJoin: Join): JoinName | null;
36
+ /**
37
+ * WHERE A SHOT ENDS — the beat's authored tail, floored so it always reads
38
+ * as a move, and clamped so it never travels past the pose the next shot
39
+ * begins on. Shared by the path (which lerps its waypoints across it) and
40
+ * by the launch: a cut hands the chaser this shot's own speed.
41
+ *
42
+ * A shot must move on screen, not on paper: frame-differencing a capture
43
+ * of the cut showed authored tails of a few degrees reading as stills, so
44
+ * a tail is a DIRECTION and a floor, not a distance — what the beat asks
45
+ * for is honoured, and anything slower than a real slow move is stretched
46
+ * up to one. The floors are per second. And it never travels past where
47
+ * the next shot begins: at a cut that jumped BACKWARDS into the successor.
48
+ */
49
+ export declare function tailFor(beats: Beat[], bi: number): Cam;
50
+ /** one waypoint of the camera spline, in the terms `c.Camera3D @through` takes */
51
+ export interface Waypoint {
52
+ cut?: boolean;
53
+ dolly: number;
54
+ look: {
55
+ x: number;
56
+ y: number;
57
+ z: number;
58
+ };
59
+ pitch: number;
60
+ x: number;
61
+ y: number;
62
+ yaw: number;
63
+ }
64
+ /**
65
+ * THE PATH. Every beat contributes `ticks` waypoints, lerped from its
66
+ * head to its tail, so waypoint count is screen time; a led beat first
67
+ * contributes `lead` waypoints travelling in from the previous tail; a
68
+ * `cut` beat splices the spline. `recut` marks the first beat as a splice
69
+ * too — a cut film re-cut from a chapter's head has nothing behind it.
70
+ */
71
+ export declare function waypoints(beats: Beat[], recut?: boolean): Waypoint[];
72
+ /**
73
+ * THE GOLDEN SCHEDULE: one object per film, everything above at once, in
74
+ * the shape the fixtures are written in. A refactor of the engine that
75
+ * changes any number in here has changed the film.
76
+ */
77
+ export interface Schedule {
78
+ beats: {
79
+ ch: number;
80
+ id: string;
81
+ join: JoinName | null;
82
+ lead: number;
83
+ secsBefore: number;
84
+ start: number;
85
+ ticks: number;
86
+ }[];
87
+ contents: Content[];
88
+ cues: Cue[];
89
+ total: number;
90
+ waypoints: Waypoint[];
91
+ }
92
+ export declare function schedule(beats: Beat[], chapters: Chapter[], defaultJoin: Join): Schedule;
93
+ //# sourceMappingURL=schedule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../src/film/schedule.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAErE,mFAAmF;AACnF,eAAO,MAAM,IAAI,IAAI,CAAC;AAEtB,iDAAiD;AACjD,wBAAgB,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAK/C;AAED,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAO/D;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAK1D;AAED,wFAAwF;AACxF,MAAM,WAAW,GAAG;IAClB,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CA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KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;QACtB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,wBAAgB,QAAQ,CACtB,KAAK,EAAE,IAAI,EAAE,EACb,QAAQ,EAAE,OAAO,EAAE,EACnB,WAAW,EAAE,IAAI,GAChB,QAAQ,CAgBV"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * THE SEAM'S GATE: hold the cut until its still can be PAINTED.
3
+ *
4
+ * Every join that carries the outgoing frame carries it as a JPEG data
5
+ * URL in the DOM, and a full-resolution JPEG handed to the DOM is not
6
+ * paintable on the frame it is handed over — the browser decodes it off
7
+ * the main thread. The lens, meanwhile, moves on that frame. So the seam
8
+ * used to play backwards: three frames of the incoming shot at 60 Hz,
9
+ * then the still of the outgoing one, then the transition over it.
10
+ *
11
+ * The gate decodes the frame into the memory cache first and holds the
12
+ * whole cut — the lens snap, the overlay, an iris's projection — until
13
+ * it is ready; the DOM image then paints from that decode on the frame
14
+ * it is inserted. The outgoing shot stays live and moving for those few
15
+ * milliseconds, which nobody can see: a cut two frames late reads as a
16
+ * cut, a cut that shows the wrong picture does not.
17
+ *
18
+ * Three rules the film depends on:
19
+ *
20
+ * - **Nothing to decode, nothing to wait for.** A seam with no still (a
21
+ * cut, a flash, a dissolve the page held in its own glass) runs
22
+ * SYNCHRONOUSLY, on the caller's stack, exactly as it always did.
23
+ * - **One seam at a time.** A cut that arrives while an earlier one is
24
+ * still waiting retires it; the earlier one never runs.
25
+ * - **No seam waits for ever.** A decode that never comes back (a
26
+ * truncated capture, a browser without `HTMLImageElement.decode`) is
27
+ * given `cap` milliseconds and then the cut goes anyway.
28
+ */
29
+ export declare class Seam {
30
+ /** which cut is in hand; a later one retires an earlier one */
31
+ private turn;
32
+ /**
33
+ * Hold `cut` until `still` can be painted, or run it now if there is
34
+ * no still. `cap` is the longest the film will wait on a decode.
35
+ */
36
+ hold(still: string, cut: () => void, cap?: number): void;
37
+ }
38
+ //# sourceMappingURL=seam.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seam.d.ts","sourceRoot":"","sources":["../../src/film/seam.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,IAAI;IACf,+DAA+D;IAC/D,OAAO,CAAC,IAAI,CAAK;IAEjB;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,IAAI,EAAE,GAAG,SAAM,GAAG,IAAI;CAwBtD"}
@@ -0,0 +1,37 @@
1
+ import Component from '@glimmer/component';
2
+ import type { FilmHandle } from './types.ts';
3
+ export interface GateSignature {
4
+ Args: {
5
+ film: FilmHandle;
6
+ };
7
+ Blocks: {
8
+ default: [FilmHandle];
9
+ };
10
+ }
11
+ /**
12
+ * THE GATE — the front door. The film is narrated, so the door asks; and
13
+ * the click that answers is the same gesture autoplay policy wants. The
14
+ * scene stands behind it, already seated on the opening frame and
15
+ * turning. What the door SAYS is the film's: the block is the front
16
+ * matter, set in the title package (`cf-matter`, `cf-mg-*`), and the
17
+ * shell here is the museum frame and the wash the type stands on.
18
+ */
19
+ export declare class Gate extends Component<GateSignature> {
20
+ }
21
+ export interface EndCardSignature {
22
+ Args: {
23
+ film: FilmHandle;
24
+ };
25
+ Blocks: {
26
+ default: [FilmHandle];
27
+ };
28
+ }
29
+ /**
30
+ * THE END CARD. It arrives a moment after the last line has settled, over
31
+ * the held final frame — the film does not loop past its own ending;
32
+ * watching again is the viewer's choice. Back matter is the same package
33
+ * as the front, run in reverse order of importance.
34
+ */
35
+ export declare class EndCard extends Component<EndCardSignature> {
36
+ }
37
+ //# sourceMappingURL=titles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"titles.d.ts","sourceRoot":"","sources":["../../src/film/titles.gts"],"names":[],"mappings":"AA8EA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAI3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU,CAAC;KAClB,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC;KACvB,CAAC;CACH;AAED;;;;;;;GAOG;AAEH,qBAAa,IAAK,SAAQ,SAAS,CAAC,aAAa,CAAC;CAuBjD;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU,CAAC;KAClB,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC;KACvB,CAAC;CACH;AAED;;;;;GAKG;AAEH,qBAAa,OAAQ,SAAQ,SAAS,CAAC,gBAAgB,CAAC;CAyCvD"}