@cardstack/boxel-cli 0.11.0-unstable.1 → 0.11.0-unstable.2

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 (82) hide show
  1. package/bundled-test-harness/assets/{app-QAuw0l8v.js → app-CtezUCip.js} +1 -1
  2. package/bundled-test-harness/assets/choreo-BEHW-NOc.js +2 -0
  3. package/bundled-test-harness/assets/{choreo-CJfBb_EY.js → choreo-C2cpCfhA.js} +164 -13
  4. package/bundled-test-harness/assets/{choreo-feature-reel-test-D2OrygZv.js → choreo-feature-reel-test-CPI_6nkT.js} +2 -2
  5. package/bundled-test-harness/assets/{choreo-gallery-w07xqtO-.js → choreo-gallery-BxA9cyzF.js} +3 -3
  6. package/bundled-test-harness/assets/{choreo-gallery-build-order-test-yQg4JER6.js → choreo-gallery-build-order-test-CLVoseAJ.js} +1 -1
  7. package/bundled-test-harness/assets/{choreo-gallery-compositor-test-C2THCXJN.js → choreo-gallery-compositor-test-BpT5Ia6B.js} +1 -1
  8. package/bundled-test-harness/assets/{choreo-gallery-cover-test-D4T_Tk4s.js → choreo-gallery-cover-test-DL_fdSsh.js} +1 -1
  9. package/bundled-test-harness/assets/{choreo-gallery-crossing-stage-test-tHUPJ-Hy.js → choreo-gallery-crossing-stage-test-BcKHhpOK.js} +2 -2
  10. package/bundled-test-harness/assets/{choreo-gallery-demos-alive-test-BOtBOnEZ.js → choreo-gallery-demos-alive-test-KufLhXG8.js} +1 -1
  11. package/bundled-test-harness/assets/{choreo-gallery-drift-test-D_6U1Z2c.js → choreo-gallery-drift-test-Cx58rYIA.js} +1 -1
  12. package/bundled-test-harness/assets/{choreo-gallery-escort-test-DDBU0n4C.js → choreo-gallery-escort-test-Wz-emmID.js} +1 -1
  13. package/bundled-test-harness/assets/{choreo-gallery-films-test-CgW1NSdr.js → choreo-gallery-films-test-BFrVs5WW.js} +2 -2
  14. package/bundled-test-harness/assets/{choreo-gallery-filter-test-DUIsNwdO.js → choreo-gallery-filter-test-DCKQkhwe.js} +1 -1
  15. package/bundled-test-harness/assets/{choreo-gallery-fold-test-Chzlxvdr.js → choreo-gallery-fold-test-UtpDgpG9.js} +1 -1
  16. package/bundled-test-harness/assets/{choreo-gallery-guide-pages-test-DOWnqALT.js → choreo-gallery-guide-pages-test-rXDU9JLM.js} +1 -1
  17. package/bundled-test-harness/assets/{choreo-gallery-guides-test-Dra2J4LJ.js → choreo-gallery-guides-test-DfVFdIuU.js} +3 -3
  18. package/bundled-test-harness/assets/{choreo-gallery-hang-test-zzn1eiB-.js → choreo-gallery-hang-test-Cj7MbkFf.js} +1 -1
  19. package/bundled-test-harness/assets/{choreo-gallery-highlight-test-CW99hncQ.js → choreo-gallery-highlight-test-D6CF3IYZ.js} +2 -2
  20. package/bundled-test-harness/assets/{choreo-gallery-inline-edit-test-CYFm1kUz.js → choreo-gallery-inline-edit-test-LfHWsbqc.js} +1 -1
  21. package/bundled-test-harness/assets/{choreo-gallery-interruption-test-CYIBrKV9.js → choreo-gallery-interruption-test-CvQQAgTp.js} +2 -2
  22. package/bundled-test-harness/assets/{choreo-gallery-lone-stack-test-DL8R3SG7.js → choreo-gallery-lone-stack-test-D7Zci7fm.js} +1 -1
  23. package/bundled-test-harness/assets/{choreo-gallery-navigation-test-Dcv04kDx.js → choreo-gallery-navigation-test-DB1EnBEW.js} +1 -1
  24. package/bundled-test-harness/assets/{choreo-gallery-playhead-transport-test-Cfz7GsXl.js → choreo-gallery-playhead-transport-test-CtBlc6AJ.js} +1 -1
  25. package/bundled-test-harness/assets/{choreo-gallery-poplayout-subtree-test-CwoklBkW.js → choreo-gallery-poplayout-subtree-test-BQbmjsvI.js} +1 -1
  26. package/bundled-test-harness/assets/{choreo-gallery-presence-modes-test-BDCIZzJ0.js → choreo-gallery-presence-modes-test-CIdXVG1K.js} +1 -1
  27. package/bundled-test-harness/assets/{choreo-gallery-presentation-test-DlyiHwFf.js → choreo-gallery-presentation-test-C_rPFp29.js} +1 -1
  28. package/bundled-test-harness/assets/{choreo-gallery-reduced-motion-test-DVz5SKNR.js → choreo-gallery-reduced-motion-test-CH5w8Lw-.js} +2 -2
  29. package/bundled-test-harness/assets/{choreo-gallery-sheet-standalone-test-CpD_-BvS.js → choreo-gallery-sheet-standalone-test-CDgI4mGX.js} +1 -1
  30. package/bundled-test-harness/assets/{choreo-gallery-sheet-test-BjvAKHDL.js → choreo-gallery-sheet-test-5lsFX7Rk.js} +1 -1
  31. package/bundled-test-harness/assets/{choreo-gallery-site-test-oq_7y_PN.js → choreo-gallery-site-test-DbMa2xeC.js} +2 -2
  32. package/bundled-test-harness/assets/{choreo-gallery-stage-Bzr4_8Xd.js → choreo-gallery-stage-b3Sk86hp.js} +2 -2
  33. package/bundled-test-harness/assets/{choreo-gallery-stage-keyboard-test-a83d2euJ.js → choreo-gallery-stage-keyboard-test-ds6fT5Eg.js} +1 -1
  34. package/bundled-test-harness/assets/{choreo-gallery-stages-test-C9Sl1kH6.js → choreo-gallery-stages-test-ahioKCct.js} +2 -2
  35. package/bundled-test-harness/assets/{choreo-gallery-subdivision-test-BVVnkOwk.js → choreo-gallery-subdivision-test-g7anTDhT.js} +1 -1
  36. package/bundled-test-harness/assets/{choreo-gallery-table-plan-test-B0YdYEA0.js → choreo-gallery-table-plan-test-Bozc4uUf.js} +1 -1
  37. package/bundled-test-harness/assets/{choreo-gallery-theater-test-BLA147xw.js → choreo-gallery-theater-test-kE535d-b.js} +3 -3
  38. package/bundled-test-harness/assets/{choreo-gallery-tuning-test-DSXiNzCh.js → choreo-gallery-tuning-test-6rHkQBnZ.js} +1 -1
  39. package/bundled-test-harness/assets/{choreo-gallery-widget-room-test-BI574PdO.js → choreo-gallery-widget-room-test-0Vq-uTo1.js} +2 -2
  40. package/bundled-test-harness/assets/{choreo-gallery-wires-test-B6Mz2WZl.js → choreo-gallery-wires-test-CdtnAWYO.js} +1 -1
  41. package/bundled-test-harness/assets/clip-BLfuHi8g.js +2 -0
  42. package/bundled-test-harness/assets/{clip-C_pXjVvY.js → clip-q1QE5f73.js} +1 -1
  43. package/bundled-test-harness/assets/{externals-6ZWftYIb.js → externals-DCnB4XSS.js} +11 -11
  44. package/bundled-test-harness/assets/film-B68PjRlr.js +2 -0
  45. package/bundled-test-harness/assets/{film-D7vtJO5q.js → film-CeUpnHN_.js} +6 -6
  46. package/bundled-test-harness/assets/{film-DN0A8JHx.js → film-DBZqyqW4.js} +6 -6
  47. package/bundled-test-harness/assets/{glimmer-motion-and-choreo-in-cards-test-BHte2t9G.js → glimmer-motion-and-choreo-in-cards-test-HA-INN3d.js} +14 -14
  48. package/bundled-test-harness/assets/{glimmer-motion-and-choreo-test-BPNVeIio.js → glimmer-motion-and-choreo-test-BZ0ZuuAw.js} +3 -3
  49. package/bundled-test-harness/assets/{index-query-engine-test-Dz7Q4Xmk.js → index-query-engine-test-CY2tAkot.js} +1 -1
  50. package/bundled-test-harness/assets/{instance-filter-matcher-test-BoLU3bVg.js → instance-filter-matcher-test-CMBTh8xn.js} +1 -1
  51. package/bundled-test-harness/assets/{main-Dlgp8c7v.js → main-BOZbZVem.js} +1 -1
  52. package/bundled-test-harness/assets/{operation-lowering-test-B0KpI1xu.js → operation-lowering-test-CHnjKSJb.js} +1 -1
  53. package/bundled-test-harness/assets/{overlays-BnOM360u.js → overlays-BOzLbVDK.js} +1 -1
  54. package/bundled-test-harness/assets/{overlays-kBVfa4i8.js → overlays-C_PuGDGh.js} +1 -1
  55. package/bundled-test-harness/assets/{plate-CFvCDv2t.js → plate-BL7UtyKE.js} +1 -1
  56. package/bundled-test-harness/assets/plate-CqG3igCJ.js +2 -0
  57. package/bundled-test-harness/assets/player-BJfsgdSI.js +2 -0
  58. package/bundled-test-harness/assets/{player-DzuYjrTU.js → player-Da_CIsp_.js} +1 -1
  59. package/bundled-test-harness/assets/{run-BMyvn_UL.js → run-D4n4LPcK.js} +96 -6
  60. package/bundled-test-harness/assets/{searchable-option-test-BBr5BPow.js → searchable-option-test-Ctf8r3HZ.js} +1 -1
  61. package/bundled-test-harness/assets/{src-Df148w_b.js → src-B_DEhPze.js} +4 -4
  62. package/bundled-test-harness/assets/{src-Cf2wv-Le.js → src-BoTgwqUA.js} +2 -2
  63. package/bundled-test-harness/assets/{test-support-rNHuieEc.js → test-support-FXDPpIl3.js} +1 -1
  64. package/bundled-test-harness/assets/{test-support-C6N_2X-l.js → test-support-VX6ukQNR.js} +1 -1
  65. package/bundled-test-harness/assets/{tests-CmsQ-Z_3.js → tests-DoTEpvcF.js} +43 -43
  66. package/bundled-test-harness/assets/{titles-B1pTaIfP.js → titles-DFJj5O0E.js} +1 -1
  67. package/bundled-test-harness/assets/titles-xGlgu7ys.js +2 -0
  68. package/bundled-test-harness/index.html +4 -4
  69. package/bundled-test-harness/tests/index.html +4 -4
  70. package/bundled-types/choreo/beacons.ts +16 -4
  71. package/bundled-types/choreo/changeset.ts +25 -5
  72. package/bundled-types/choreo/choreo.gts +245 -3
  73. package/bundled-types/choreo/far.ts +39 -0
  74. package/bundled-types/choreo/index.ts +2 -0
  75. package/bundled-types/choreo/run.ts +104 -1
  76. package/package.json +1 -1
  77. package/bundled-test-harness/assets/choreo-B3Z9QhDH.js +0 -2
  78. package/bundled-test-harness/assets/clip-BjcXuTwN.js +0 -2
  79. package/bundled-test-harness/assets/film-DMDPP7ma.js +0 -2
  80. package/bundled-test-harness/assets/plate-66qnQ-M9.js +0 -2
  81. package/bundled-test-harness/assets/player-pygg1PwA.js +0 -2
  82. package/bundled-test-harness/assets/titles-Ccpcl-jq.js +0 -2
@@ -11,10 +11,12 @@ export type { Arming, ArmingOptions, ArmingRegion } from './arming.ts';
11
11
  export { createArming } from './arming.ts';
12
12
  export { beacon } from './beacon.ts';
13
13
  export type { BeaconRef } from './beacons.ts';
14
+ export { registerBeacon } from './beacons.ts';
14
15
  export type { Changeset } from './changeset.ts';
15
16
  export type { ChoreoContext } from './choreo.gts';
16
17
  export { Choreo } from './choreo.gts';
17
18
  export { easeIn, easeInAndOut, easeOut } from './easings.ts';
19
+ export { registerSettle } from './far.ts';
18
20
  export type { GestureRef } from './gesture.ts';
19
21
  export {
20
22
  type ChoreoHost,
@@ -184,6 +184,13 @@ interface RunOptions {
184
184
  inherit?: Velocities;
185
185
  /** where the prior run's ambient loops stood, to carry them on from */
186
186
  loops?: LoopPhases;
187
+ /**
188
+ * The most animation time, in ms, one painted frame may advance. Unset,
189
+ * a frame advances by the time since the last one (the frame loop caps
190
+ * that at 40 ms). Set, a run behind a long frame slows down rather than
191
+ * skipping: it lands later, and no frame jumps.
192
+ */
193
+ maxFrameStep?: number;
187
194
  /** a camera step landed or the run ended: the frame's new resting state */
188
195
  onCamera?(state: CameraState): void;
189
196
  /**
@@ -396,6 +403,18 @@ interface Track {
396
403
  wire?: SVGPathElement;
397
404
  }
398
405
 
406
+ let warnedPrivateFields = false;
407
+ /** @maxFrameStep reads motion-dom's private animation fields; say once when they are gone */
408
+ function warnPrivateFieldsMoved() {
409
+ if (warnedPrivateFields) {
410
+ return;
411
+ }
412
+ warnedPrivateFields = true;
413
+ console.warn(
414
+ '@cardstack/choreo: motion-dom no longer exposes the animation fields @maxFrameStep reads (_animation, startTime, holdTime); a long frame will skip tweens ahead instead of slowing them',
415
+ );
416
+ }
417
+
399
418
  export class ChoreoRun implements Run {
400
419
  cues: Cue[];
401
420
  velocities: Velocities = new Map();
@@ -454,6 +473,17 @@ export class ChoreoRun implements Run {
454
473
  private ended = false;
455
474
  private resolveFinished!: () => void;
456
475
  private ticking = false;
476
+ /**
477
+ * The next tick is the first since the clock started (or resumed): it
478
+ * paints the run where it stands and advances nothing. The frame loop's
479
+ * delta on that tick is the time since ITS last frame, up to 40 ms, so a
480
+ * run started by a render pass would otherwise open with that whole step
481
+ * on its own clock: every cue the clock starts, gates, or drives frame by
482
+ * frame (a camera, a wire, a later cue's start) would begin that far in.
483
+ */
484
+ private freshClock = false;
485
+ /** the frame timestamp holdBack saw last, while a maxFrameStep applies */
486
+ private lastStamp: number | undefined;
457
487
  private autoTimer: ReturnType<typeof setTimeout> | undefined;
458
488
 
459
489
  constructor(compiled: Compiled, options: RunOptions) {
@@ -895,6 +925,12 @@ export class ChoreoRun implements Run {
895
925
  return;
896
926
  }
897
927
  this.ticking = true;
928
+ this.freshClock = true;
929
+ this.lastStamp = undefined;
930
+ if (this.options.maxFrameStep) {
931
+ // read runs before update: the animations tick after the hold-back
932
+ frame.read(this.holdBack, true);
933
+ }
898
934
  frame.update(this.tick, true);
899
935
  }
900
936
 
@@ -902,15 +938,82 @@ export class ChoreoRun implements Run {
902
938
  if (this.ticking) {
903
939
  this.ticking = false;
904
940
  cancelFrame(this.tick);
941
+ cancelFrame(this.holdBack);
905
942
  }
906
943
  }
907
944
 
945
+ /**
946
+ * maxFrameStep for the animations themselves. The run's own clock is
947
+ * capped in tick; the tweens and springs it started run on motion-dom's
948
+ * frame clock, which takes the real time since their start, so a long
949
+ * frame would still skip that much of them. Before they update, each one
950
+ * driven on the main thread has its start moved on by the time past the
951
+ * cap: it resumes from where the last frame left it, plus one step.
952
+ * Animations on the compositor (WAAPI) kept playing through the long
953
+ * frame and are left alone.
954
+ */
955
+ private holdBack = (data: FrameData) => {
956
+ const step = this.options.maxFrameStep;
957
+ const last = this.lastStamp;
958
+ this.lastStamp = data.timestamp;
959
+ if (!step) {
960
+ return;
961
+ }
962
+ // The first frame: an animation the render pass started takes its start
963
+ // from motion-dom's clock, which holds one time for a whole task, so a
964
+ // pass late in a long render would date it back to the task's start and
965
+ // its first frame would skip that far. Its start moves to this frame.
966
+ // After that: the time past the cap since the last frame.
967
+ for (const t of this.tracks) {
968
+ for (const c of t.controls ?? []) {
969
+ // the wrapper's resolved animation, read without the getter that
970
+ // flushes pending keyframes. These are motion-dom's private fields
971
+ // (VENDORED.md lists them for a bump to check): past the first frame
972
+ // every control has resolved, so a control without them means the
973
+ // fields moved and the cap no longer reaches the tweens.
974
+ const inner = (c as unknown as { _animation?: object })._animation as
975
+ | { holdTime?: number | null; startTime?: number | null }
976
+ | undefined;
977
+ if (
978
+ last !== undefined &&
979
+ (!inner ||
980
+ (!('animation' in inner) &&
981
+ !('startTime' in inner && 'holdTime' in inner)))
982
+ ) {
983
+ warnPrivateFieldsMoved();
984
+ }
985
+ if (
986
+ !inner ||
987
+ 'animation' in inner ||
988
+ typeof inner.startTime !== 'number' ||
989
+ inner.holdTime !== null
990
+ ) {
991
+ continue;
992
+ }
993
+ if (last === undefined) {
994
+ if (data.timestamp - inner.startTime > step) {
995
+ inner.startTime = data.timestamp;
996
+ }
997
+ } else if (data.timestamp - last > step) {
998
+ inner.startTime += data.timestamp - last - step;
999
+ }
1000
+ }
1001
+ }
1002
+ };
1003
+
908
1004
  private tick = (data: FrameData) => {
909
1005
  if (!this.playing || this.cancelled || this.ended) {
910
1006
  this.stopTicking();
911
1007
  return;
912
1008
  }
913
- const next = this.master + data.delta * this.rate;
1009
+ const step = this.options.maxFrameStep;
1010
+ const delta = this.freshClock
1011
+ ? 0
1012
+ : step
1013
+ ? Math.min(data.delta, step)
1014
+ : data.delta;
1015
+ this.freshClock = false;
1016
+ const next = this.master + delta * this.rate;
914
1017
  const gate = this.gates.find(
915
1018
  (g) => !g.opened && g.at >= this.master && g.at <= next,
916
1019
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cardstack/boxel-cli",
3
- "version": "0.11.0-unstable.1",
3
+ "version": "0.11.0-unstable.2",
4
4
  "license": "MIT",
5
5
  "description": "CLI tools for Boxel workspace management",
6
6
  "main": "./dist/index.js",
@@ -1,2 +0,0 @@
1
- import { t as Choreo } from "./choreo-CJfBb_EY.js";
2
- export { Choreo, Choreo as default };
@@ -1,2 +0,0 @@
1
- import { t as Clip } from "./clip-C_pXjVvY.js";
2
- export { Clip };
@@ -1,2 +0,0 @@
1
- import { r as TICK, t as Film } from "./film-D7vtJO5q.js";
2
- export { Film, TICK };
@@ -1,2 +0,0 @@
1
- import { t as Plate } from "./plate-CFvCDv2t.js";
2
- export { Plate };
@@ -1,2 +0,0 @@
1
- import { n as Menu, r as Player, t as Burst } from "./player-DzuYjrTU.js";
2
- export { Burst, Menu, Player };
@@ -1,2 +0,0 @@
1
- import { n as Gate, t as EndCard } from "./titles-B1pTaIfP.js";
2
- export { EndCard, Gate };