canvas-recorder-lib 0.8.1 → 0.8.4

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 (260) hide show
  1. package/README.md +10 -2
  2. package/dev/canvas-recorder.css +20 -6
  3. package/dev/canvas-recorder.ts +389 -54
  4. package/dev/color-picker.ts +13 -0
  5. package/dev/component-picker.ts +60 -11
  6. package/dev/delay-files.ts +3 -1
  7. package/dev/font-widgets.ts +2 -2
  8. package/dev/format-editor.ts +3 -1
  9. package/dev/fourier-panel.ts +7 -3
  10. package/dev/handwriting-panel.ts +7 -7
  11. package/dev/multi-text-dialog.ts +28 -15
  12. package/dev/player-body.ts +78 -33
  13. package/dev/schedule-helpers.ts +10 -3
  14. package/dev/static-image-panel.ts +4 -4
  15. package/dev/subtitles.ts +170 -0
  16. package/dev/synced-file.ts +34 -0
  17. package/dev/timeline-display.ts +1 -1
  18. package/dev/transcribe-core.ts +7 -4
  19. package/dev/transcript-align.ts +24 -18
  20. package/dev/transcript-editor.ts +1187 -0
  21. package/dev/transcript-export.ts +90 -0
  22. package/dev/transcript-view.ts +8 -5
  23. package/dev/transcripts.ts +140 -15
  24. package/dev/video-clip-panel.ts +4 -4
  25. package/dist/dev/canvas-recorder.css +20 -6
  26. package/dist/dev/canvas-recorder.js +314 -48
  27. package/dist/dev/canvas-recorder.js.map +1 -1
  28. package/dist/dev/color-picker.d.ts.map +1 -1
  29. package/dist/dev/color-picker.js +15 -0
  30. package/dist/dev/color-picker.js.map +1 -1
  31. package/dist/dev/component-picker.d.ts +2 -1
  32. package/dist/dev/component-picker.d.ts.map +1 -1
  33. package/dist/dev/component-picker.js +56 -11
  34. package/dist/dev/component-picker.js.map +1 -1
  35. package/dist/dev/delay-files.d.ts.map +1 -1
  36. package/dist/dev/delay-files.js +3 -1
  37. package/dist/dev/delay-files.js.map +1 -1
  38. package/dist/dev/font-widgets.d.ts +2 -2
  39. package/dist/dev/font-widgets.d.ts.map +1 -1
  40. package/dist/dev/font-widgets.js.map +1 -1
  41. package/dist/dev/format-editor.d.ts.map +1 -1
  42. package/dist/dev/format-editor.js +3 -1
  43. package/dist/dev/format-editor.js.map +1 -1
  44. package/dist/dev/fourier-panel.d.ts.map +1 -1
  45. package/dist/dev/fourier-panel.js +4 -3
  46. package/dist/dev/fourier-panel.js.map +1 -1
  47. package/dist/dev/handwriting-panel.d.ts +4 -4
  48. package/dist/dev/handwriting-panel.d.ts.map +1 -1
  49. package/dist/dev/handwriting-panel.js.map +1 -1
  50. package/dist/dev/multi-text-dialog.d.ts.map +1 -1
  51. package/dist/dev/multi-text-dialog.js +23 -12
  52. package/dist/dev/multi-text-dialog.js.map +1 -1
  53. package/dist/dev/player-body.d.ts +1 -1
  54. package/dist/dev/player-body.d.ts.map +1 -1
  55. package/dist/dev/player-body.js +78 -33
  56. package/dist/dev/player-body.js.map +1 -1
  57. package/dist/dev/schedule-helpers.d.ts.map +1 -1
  58. package/dist/dev/schedule-helpers.js +4 -2
  59. package/dist/dev/schedule-helpers.js.map +1 -1
  60. package/dist/dev/static-image-panel.d.ts +3 -3
  61. package/dist/dev/static-image-panel.d.ts.map +1 -1
  62. package/dist/dev/subtitles.d.ts +36 -0
  63. package/dist/dev/subtitles.d.ts.map +1 -0
  64. package/dist/dev/subtitles.js +135 -0
  65. package/dist/dev/subtitles.js.map +1 -0
  66. package/dist/dev/synced-file.d.ts +14 -0
  67. package/dist/dev/synced-file.d.ts.map +1 -1
  68. package/dist/dev/synced-file.js +22 -0
  69. package/dist/dev/synced-file.js.map +1 -1
  70. package/dist/dev/timeline-display.d.ts +5 -0
  71. package/dist/dev/timeline-display.d.ts.map +1 -1
  72. package/dist/dev/timeline-display.js +1 -1
  73. package/dist/dev/timeline-display.js.map +1 -1
  74. package/dist/dev/transcribe-core.d.ts.map +1 -1
  75. package/dist/dev/transcribe-core.js +7 -4
  76. package/dist/dev/transcribe-core.js.map +1 -1
  77. package/dist/dev/transcript-align.d.ts +6 -4
  78. package/dist/dev/transcript-align.d.ts.map +1 -1
  79. package/dist/dev/transcript-align.js +18 -13
  80. package/dist/dev/transcript-align.js.map +1 -1
  81. package/dist/dev/transcript-editor.d.ts +36 -0
  82. package/dist/dev/transcript-editor.d.ts.map +1 -0
  83. package/dist/dev/transcript-editor.js +948 -0
  84. package/dist/dev/transcript-editor.js.map +1 -0
  85. package/dist/dev/transcript-export.d.ts +21 -0
  86. package/dist/dev/transcript-export.d.ts.map +1 -1
  87. package/dist/dev/transcript-export.js +65 -0
  88. package/dist/dev/transcript-export.js.map +1 -1
  89. package/dist/dev/transcript-view.d.ts +2 -0
  90. package/dist/dev/transcript-view.d.ts.map +1 -1
  91. package/dist/dev/transcript-view.js +1 -1
  92. package/dist/dev/transcript-view.js.map +1 -1
  93. package/dist/dev/transcripts.d.ts +18 -1
  94. package/dist/dev/transcripts.d.ts.map +1 -1
  95. package/dist/dev/transcripts.js +102 -12
  96. package/dist/dev/transcripts.js.map +1 -1
  97. package/dist/dev/video-clip-panel.d.ts +3 -3
  98. package/dist/dev/video-clip-panel.d.ts.map +1 -1
  99. package/dist/lib/index.d.ts +1 -0
  100. package/dist/lib/index.d.ts.map +1 -1
  101. package/dist/lib/index.js +1 -0
  102. package/dist/lib/index.js.map +1 -1
  103. package/dist/src/glib/line-font.d.ts +6 -0
  104. package/dist/src/glib/line-font.d.ts.map +1 -1
  105. package/dist/src/glib/line-font.js +9 -0
  106. package/dist/src/glib/line-font.js.map +1 -1
  107. package/dist/src/glib/path-shape.d.ts +23 -0
  108. package/dist/src/glib/path-shape.d.ts.map +1 -1
  109. package/dist/src/glib/path-shape.js +66 -221
  110. package/dist/src/glib/path-shape.js.map +1 -1
  111. package/dist/src/glib/svg-arc.d.ts +41 -0
  112. package/dist/src/glib/svg-arc.d.ts.map +1 -0
  113. package/dist/src/glib/svg-arc.js +114 -0
  114. package/dist/src/glib/svg-arc.js.map +1 -0
  115. package/dist/src/glib/svg-path-parser.d.ts +60 -0
  116. package/dist/src/glib/svg-path-parser.d.ts.map +1 -0
  117. package/dist/src/glib/svg-path-parser.js +258 -0
  118. package/dist/src/glib/svg-path-parser.js.map +1 -0
  119. package/dist/src/glib/transforms.d.ts +9 -0
  120. package/dist/src/glib/transforms.d.ts.map +1 -1
  121. package/dist/src/glib/transforms.js +7 -4
  122. package/dist/src/glib/transforms.js.map +1 -1
  123. package/dist/src/interpolate.d.ts +17 -10
  124. package/dist/src/interpolate.d.ts.map +1 -1
  125. package/dist/src/interpolate.js +1 -17
  126. package/dist/src/interpolate.js.map +1 -1
  127. package/dist/src/morph-animation.js +1 -1
  128. package/dist/src/morph-animation.js.map +1 -1
  129. package/dist/src/peano-fourier/fourier-shared.d.ts.map +1 -1
  130. package/dist/src/peano-fourier/fourier-shared.js +4 -2
  131. package/dist/src/peano-fourier/fourier-shared.js.map +1 -1
  132. package/dist/src/schedule-helper.d.ts +50 -28
  133. package/dist/src/schedule-helper.d.ts.map +1 -1
  134. package/dist/src/schedule-helper.js +22 -0
  135. package/dist/src/schedule-helper.js.map +1 -1
  136. package/dist/src/showable.d.ts +57 -10
  137. package/dist/src/showable.d.ts.map +1 -1
  138. package/dist/src/showable.js +19 -0
  139. package/dist/src/showable.js.map +1 -1
  140. package/dist/src/slide-components/arrow.d.ts +4 -4
  141. package/dist/src/slide-components/arrow.d.ts.map +1 -1
  142. package/dist/src/slide-components/cross-fade-transition.d.ts +2 -1
  143. package/dist/src/slide-components/cross-fade-transition.d.ts.map +1 -1
  144. package/dist/src/slide-components/cross-fade-transition.js +2 -1
  145. package/dist/src/slide-components/cross-fade-transition.js.map +1 -1
  146. package/dist/src/slide-components/duration-agnostic.d.ts +3 -2
  147. package/dist/src/slide-components/duration-agnostic.d.ts.map +1 -1
  148. package/dist/src/slide-components/duration-agnostic.js +4 -2
  149. package/dist/src/slide-components/duration-agnostic.js.map +1 -1
  150. package/dist/src/slide-components/fixed-duration.d.ts +3 -1
  151. package/dist/src/slide-components/fixed-duration.d.ts.map +1 -1
  152. package/dist/src/slide-components/fixed-duration.js +4 -2
  153. package/dist/src/slide-components/fixed-duration.js.map +1 -1
  154. package/dist/src/slide-components/fourier.d.ts +19 -12
  155. package/dist/src/slide-components/fourier.d.ts.map +1 -1
  156. package/dist/src/slide-components/fourier.js +77 -16
  157. package/dist/src/slide-components/fourier.js.map +1 -1
  158. package/dist/src/slide-components/function-graph.d.ts +4 -3
  159. package/dist/src/slide-components/function-graph.d.ts.map +1 -1
  160. package/dist/src/slide-components/function-graph.js +6 -2
  161. package/dist/src/slide-components/function-graph.js.map +1 -1
  162. package/dist/src/slide-components/halftone-shadow.d.ts +8 -7
  163. package/dist/src/slide-components/halftone-shadow.d.ts.map +1 -1
  164. package/dist/src/slide-components/halftone-shadow.js +14 -10
  165. package/dist/src/slide-components/halftone-shadow.js.map +1 -1
  166. package/dist/src/slide-components/handwriting-effect.d.ts +8 -6
  167. package/dist/src/slide-components/handwriting-effect.d.ts.map +1 -1
  168. package/dist/src/slide-components/handwriting-effect.js +4 -2
  169. package/dist/src/slide-components/handwriting-effect.js.map +1 -1
  170. package/dist/src/slide-components/hold.d.ts +4 -2
  171. package/dist/src/slide-components/hold.d.ts.map +1 -1
  172. package/dist/src/slide-components/hold.js +4 -2
  173. package/dist/src/slide-components/hold.js.map +1 -1
  174. package/dist/src/slide-components/image.d.ts +7 -7
  175. package/dist/src/slide-components/image.d.ts.map +1 -1
  176. package/dist/src/slide-components/image.js +4 -2
  177. package/dist/src/slide-components/image.js.map +1 -1
  178. package/dist/src/slide-components/in-parallel.d.ts +6 -3
  179. package/dist/src/slide-components/in-parallel.d.ts.map +1 -1
  180. package/dist/src/slide-components/in-parallel.js +12 -2
  181. package/dist/src/slide-components/in-parallel.js.map +1 -1
  182. package/dist/src/slide-components/in-series.d.ts +2 -1
  183. package/dist/src/slide-components/in-series.d.ts.map +1 -1
  184. package/dist/src/slide-components/in-series.js +2 -1
  185. package/dist/src/slide-components/in-series.js.map +1 -1
  186. package/dist/src/slide-components/live-duration.d.ts +3 -1
  187. package/dist/src/slide-components/live-duration.d.ts.map +1 -1
  188. package/dist/src/slide-components/live-duration.js +4 -2
  189. package/dist/src/slide-components/live-duration.js.map +1 -1
  190. package/dist/src/slide-components/multi-text.d.ts +39 -26
  191. package/dist/src/slide-components/multi-text.d.ts.map +1 -1
  192. package/dist/src/slide-components/multi-text.js +44 -29
  193. package/dist/src/slide-components/multi-text.js.map +1 -1
  194. package/dist/src/slide-components/rectangle.d.ts +5 -4
  195. package/dist/src/slide-components/rectangle.d.ts.map +1 -1
  196. package/dist/src/slide-components/rectangle.js +2 -1
  197. package/dist/src/slide-components/rectangle.js.map +1 -1
  198. package/dist/src/slide-components/registry.d.ts +5 -0
  199. package/dist/src/slide-components/registry.d.ts.map +1 -1
  200. package/dist/src/slide-components/registry.js +28 -27
  201. package/dist/src/slide-components/registry.js.map +1 -1
  202. package/dist/src/slide-components/show-error.d.ts.map +1 -1
  203. package/dist/src/slide-components/show-error.js +12 -4
  204. package/dist/src/slide-components/show-error.js.map +1 -1
  205. package/dist/src/slide-components/simple-text.d.ts +11 -10
  206. package/dist/src/slide-components/simple-text.d.ts.map +1 -1
  207. package/dist/src/slide-components/simple-text.js +5 -3
  208. package/dist/src/slide-components/simple-text.js.map +1 -1
  209. package/dist/src/slide-components/slide-component.d.ts +14 -13
  210. package/dist/src/slide-components/slide-component.d.ts.map +1 -1
  211. package/dist/src/slide-components/slide-component.js +2 -1
  212. package/dist/src/slide-components/slide-component.js.map +1 -1
  213. package/dist/src/slide-components/slide-left.d.ts +2 -1
  214. package/dist/src/slide-components/slide-left.d.ts.map +1 -1
  215. package/dist/src/slide-components/slide-left.js +2 -1
  216. package/dist/src/slide-components/slide-left.js.map +1 -1
  217. package/dist/src/slide-components/text-effect.d.ts +9 -1
  218. package/dist/src/slide-components/text-effect.d.ts.map +1 -1
  219. package/dist/src/slide-components/text-effect.js.map +1 -1
  220. package/dist/src/slide-components/traditional-text.d.ts +8 -8
  221. package/dist/src/slide-components/traditional-text.d.ts.map +1 -1
  222. package/dist/src/slide-components/video-clip.d.ts +4 -3
  223. package/dist/src/slide-components/video-clip.d.ts.map +1 -1
  224. package/dist/src/slide-components/video-clip.js +2 -1
  225. package/dist/src/slide-components/video-clip.js.map +1 -1
  226. package/lib/index.ts +1 -0
  227. package/package.json +2 -2
  228. package/src/glib/line-font.ts +9 -0
  229. package/src/glib/path-shape.ts +101 -245
  230. package/src/glib/svg-arc.ts +141 -0
  231. package/src/glib/svg-path-parser.ts +308 -0
  232. package/src/glib/transforms.ts +7 -4
  233. package/src/interpolate.ts +18 -27
  234. package/src/morph-animation.ts +1 -1
  235. package/src/peano-fourier/fourier-shared.ts +4 -2
  236. package/src/schedule-helper.ts +50 -28
  237. package/src/showable.ts +79 -10
  238. package/src/slide-components/arrow.ts +4 -4
  239. package/src/slide-components/cross-fade-transition.ts +9 -2
  240. package/src/slide-components/duration-agnostic.ts +4 -3
  241. package/src/slide-components/fixed-duration.ts +4 -2
  242. package/src/slide-components/fourier.ts +98 -29
  243. package/src/slide-components/function-graph.ts +7 -3
  244. package/src/slide-components/halftone-shadow.ts +21 -16
  245. package/src/slide-components/handwriting-effect.ts +8 -6
  246. package/src/slide-components/hold.ts +18 -4
  247. package/src/slide-components/image.ts +9 -7
  248. package/src/slide-components/in-parallel.ts +16 -1
  249. package/src/slide-components/in-series.ts +3 -1
  250. package/src/slide-components/live-duration.ts +4 -2
  251. package/src/slide-components/multi-text.ts +71 -44
  252. package/src/slide-components/rectangle.ts +6 -4
  253. package/src/slide-components/registry.ts +33 -27
  254. package/src/slide-components/show-error.ts +13 -4
  255. package/src/slide-components/simple-text.ts +22 -12
  256. package/src/slide-components/slide-component.ts +15 -13
  257. package/src/slide-components/slide-left.ts +9 -2
  258. package/src/slide-components/text-effect.ts +9 -0
  259. package/src/slide-components/traditional-text.ts +8 -8
  260. package/src/slide-components/video-clip.ts +5 -3
@@ -3,7 +3,11 @@
3
3
  import { Point } from "bezier-js";
4
4
  import { ReadOnlyRect } from "phil-lib/misc";
5
5
  import { Font } from "../glib/letters-base.ts";
6
- import { MIN_FONT_SIZE, MIN_FONT_WIDTH } from "../glib/line-font.ts";
6
+ import {
7
+ MIN_BOLDNESS,
8
+ MIN_FONT_SIZE,
9
+ MIN_FONT_WIDTH,
10
+ } from "../glib/line-font.ts";
7
11
  import {
8
12
  checkCharacters,
9
13
  FONT_NAMES,
@@ -26,6 +30,7 @@ import {
26
30
  ColorScheduleInfo,
27
31
  } from "../schedule-helper.ts";
28
32
  import {
33
+ ComponentOptions,
29
34
  ShowOptions,
30
35
  Showable,
31
36
  ShowableParent,
@@ -33,7 +38,6 @@ import {
33
38
  Scalar,
34
39
  } from "../showable.ts";
35
40
  import { DurationAgnosticComponent } from "./duration-agnostic.ts";
36
- import { ShowChildInfo } from "./in-parallel.ts";
37
41
  import { showError } from "./show-error.ts";
38
42
  import {
39
43
  EffectLetter,
@@ -41,14 +45,15 @@ import {
41
45
  TextEffect,
42
46
  TEXT_EFFECT,
43
47
  } from "./text-effect.ts";
44
- import { Keyframe } from "../interpolate.ts";
48
+ import { TimedKeyframe } from "../interpolate.ts";
45
49
  // Type-only: registry.ts imports this module, so a runtime import would be circular.
46
50
  import type { ComponentRegistryEntry } from "./registry.ts";
47
51
 
48
52
  /**
49
53
  * This is needed as a default in some places but should never actually be used.
50
54
  */
51
- const baseFont = Font.cursive(1);
55
+ /** Made the first time it's needed, so this module loads without a browser. */
56
+ let baseFont: Font | undefined;
52
57
 
53
58
  const TEXT_FORMAT_LIST = Symbol("Text Format List");
54
59
  function getFormat(
@@ -309,7 +314,7 @@ const ANCHOR_FRACTION = {
309
314
  * This includes Multi Text Components that are wrapped in other components.
310
315
  */
311
316
  export class MultiTextComponent extends DurationAgnosticComponent {
312
- readonly registryKey = "Multi Text";
317
+ readonly registryKey: string;
313
318
  /**
314
319
  * Text Span and Text Format are what a Multi Text is made of, so offer them first.
315
320
  * Text Format and the text effects only work as direct children of a Multi Text, so
@@ -616,6 +621,13 @@ export class MultiTextComponent extends DurationAgnosticComponent {
616
621
  description: "Rotation",
617
622
  type: "select",
618
623
  choices: ROTATIONS,
624
+ // Which way the text reads. Saved as the names in ROTATIONS.
625
+ choiceLabels: {
626
+ none: "→",
627
+ "90° clockwise": "↓",
628
+ "180°": "←",
629
+ "90° counterclockwise": "↑",
630
+ } satisfies Record<(typeof ROTATIONS)[number], string>,
619
631
  value: "none",
620
632
  };
621
633
  /** See {@link WIDTH_MODES}. */
@@ -682,15 +694,16 @@ export class MultiTextComponent extends DurationAgnosticComponent {
682
694
  constructor(
683
695
  initialValues: {
684
696
  description?: string;
685
- position?: Point | readonly Keyframe<Point>[];
697
+ registryKey?: string;
698
+ position?: Point | readonly TimedKeyframe<Point>[];
686
699
  alignment?: Parameters<MultiTextComponent["alignmentSchedule"]["set"]>[0];
687
700
  anchorX?: Parameters<MultiTextComponent["anchorXSchedule"]["set"]>[0];
688
701
  textBaseline?: Parameters<
689
702
  MultiTextComponent["textBaselineSchedule"]["set"]
690
703
  >[0];
691
- width?: number | readonly Keyframe<number>[];
692
- height?: number | readonly Keyframe<number>[];
693
- additionalLineHeight?: number | readonly Keyframe<number>[];
704
+ width?: number | readonly TimedKeyframe<number>[];
705
+ height?: number | readonly TimedKeyframe<number>[];
706
+ additionalLineHeight?: number | readonly TimedKeyframe<number>[];
694
707
  widthMode?: (typeof WIDTH_MODES)[number];
695
708
  heightMode?: (typeof HEIGHT_MODES)[number];
696
709
  mayGrow?: "shrink or grow" | "shrink only";
@@ -700,6 +713,7 @@ export class MultiTextComponent extends DurationAgnosticComponent {
700
713
  } = {},
701
714
  ) {
702
715
  super(initialValues.description ?? "Multi Text");
716
+ this.registryKey = initialValues.registryKey ?? "Multi Text";
703
717
  this.schedules.push(
704
718
  this.positionSchedule,
705
719
  this.alignmentSchedule,
@@ -744,20 +758,6 @@ export class MultiTextComponent extends DurationAgnosticComponent {
744
758
  if (initialValues.rotation !== undefined)
745
759
  this.rotationScalar.value = initialValues.rotation;
746
760
  }
747
- protected override showChild(info: ShowChildInfo): void {
748
- // We are not currently using this method.
749
- console.warn("yes!");
750
- if (info.child instanceof TextSpanComponent) {
751
- // TODO we should display the result of each TextSpanComponent in this call.
752
- // That way we can completely control the zIndex.
753
- // For now the text is all displayed at the highest zIndex.
754
- } else if (info.child instanceof TextFormatComponent) {
755
- // Nothing to do.
756
- // This is not a visible component.
757
- } else {
758
- super.showChild(info);
759
- }
760
- }
761
761
  /**
762
762
  * Our own {@link TextFormatComponent} children.
763
763
  * These name the styles that our {@link TextSpanComponent} children can ask for.
@@ -808,7 +808,7 @@ export class MultiTextComponent extends DurationAgnosticComponent {
808
808
  const { context, timeInMs } = options;
809
809
  const spanIndexOf = new Map<WordInPlace["wordInfo"], number>();
810
810
  const allFormatters = extractTextFormatList(options, this.#ownFormatters());
811
- const paragraphLayout = new ParagraphLayout(baseFont);
811
+ const paragraphLayout = new ParagraphLayout((baseFont ??= Font.cursive(1)));
812
812
  const initializedFormatters = new Map<
813
813
  string,
814
814
  ReturnType<TextFormatComponent["freeze"]> | undefined
@@ -1156,18 +1156,27 @@ export class MultiTextComponent extends DurationAgnosticComponent {
1156
1156
  const { context } = options;
1157
1157
  // Children that are neither spans nor formats draw normally, before the
1158
1158
  // text, and they can see our formatters.
1159
+ // TODO: draw the text in its children's place, so zIndex works. For now
1160
+ // it's always drawn last, above everything else.
1159
1161
  const childOptions = setTextFormatList(
1160
1162
  options,
1161
1163
  extractTextFormatList(options, this.#ownFormatters()),
1162
1164
  );
1163
1165
  const effects: TextEffect[] = [];
1164
1166
  this.children.forEach(({ child }) => {
1167
+ if (
1168
+ child instanceof TextSpanComponent ||
1169
+ child instanceof TextFormatComponent
1170
+ ) {
1171
+ return;
1172
+ }
1173
+ // These work in our coordinates, which are our parent's. So the editor
1174
+ // draws their markers (an effect's Center, say) in the right place,
1175
+ // even inside a moved or scaled Slide.
1176
+ options.registerTransform?.(child, context.getTransform());
1165
1177
  if (isTextEffect(child)) {
1166
1178
  effects.push(child);
1167
- } else if (
1168
- !(child instanceof TextSpanComponent) &&
1169
- !(child instanceof TextFormatComponent)
1170
- ) {
1179
+ } else {
1171
1180
  child.show(childOptions);
1172
1181
  }
1173
1182
  });
@@ -1181,6 +1190,7 @@ export class MultiTextComponent extends DurationAgnosticComponent {
1181
1190
  ? effects[0][TEXT_EFFECT](
1182
1191
  MultiTextComponent.effectLetters(placed),
1183
1192
  options,
1193
+ placed,
1184
1194
  )
1185
1195
  : laidOut.pathShapeByTag();
1186
1196
  // The scale goes on the context rather than the path, so the stroke width
@@ -1214,19 +1224,24 @@ export class MultiTextComponent extends DurationAgnosticComponent {
1214
1224
  // MARK: Text Span
1215
1225
 
1216
1226
  export class TextSpanComponent implements Showable {
1217
- readonly registryKey = "Text Span";
1227
+ readonly registryKey: string;
1218
1228
  public contentSchedule = new StringScheduleInfo("Content", "");
1219
1229
  // TODO do not allow easing in styleSchedule.
1220
- public styleSchedule = new StringScheduleInfo("Style", "");
1230
+ /** Saved as "Style". Shown as "Style Name", the same as the Text Format's. */
1231
+ public styleSchedule = Object.assign(new StringScheduleInfo("Style", ""), {
1232
+ label: "Style Name",
1233
+ });
1221
1234
  readonly schedules = [this.contentSchedule, this.styleSchedule] as const;
1222
- readonly description = "Text Span";
1235
+ readonly description: string;
1223
1236
  readonly duration = 0;
1224
1237
  constructor(
1225
1238
  initialValues: {
1226
- content?: string | readonly Keyframe<string>[];
1227
- style?: string | readonly Keyframe<string>[];
1228
- } = {},
1239
+ content?: string | readonly TimedKeyframe<string>[];
1240
+ style?: string | readonly TimedKeyframe<string>[];
1241
+ } & ComponentOptions = {},
1229
1242
  ) {
1243
+ this.description = initialValues.description ?? "Text Span";
1244
+ this.registryKey = initialValues.registryKey ?? "Text Span";
1230
1245
  if (initialValues.content !== undefined)
1231
1246
  this.contentSchedule.set(initialValues.content);
1232
1247
  if (initialValues.style !== undefined)
@@ -1258,8 +1273,14 @@ type CachedFont = {
1258
1273
  };
1259
1274
 
1260
1275
  export class TextFormatComponent implements Showable {
1261
- readonly registryKey = "Text Format";
1262
- readonly nameScalar = new StringScalarInfo("Name", "");
1276
+ readonly registryKey: string;
1277
+ /**
1278
+ * The name Text Spans use to pick this format. Saved as "Name", and shown as "Style Name",
1279
+ * so it isn't confused with the component's own Name.
1280
+ */
1281
+ readonly nameScalar = Object.assign(new StringScalarInfo("Name", ""), {
1282
+ label: "Style Name",
1283
+ });
1263
1284
  readonly scalars = [this.nameScalar] as const;
1264
1285
  readonly colorSchedule: ColorScheduleInfo;
1265
1286
  /**
@@ -1286,16 +1307,18 @@ export class TextFormatComponent implements Showable {
1286
1307
  constructor(
1287
1308
  initialValues: {
1288
1309
  description?: string;
1310
+ registryKey?: string;
1289
1311
  name?: string;
1290
- color?: string | readonly Keyframe<string>[] | ColorScheduleInfo;
1291
- font?: FontName | readonly Keyframe<FontName>[];
1292
- size?: number | readonly Keyframe<number>[];
1293
- fontWidth?: number | readonly Keyframe<number>[];
1294
- boldness?: number | readonly Keyframe<number>[];
1295
- obliqueness?: number | readonly Keyframe<number>[];
1296
- alpha?: number | readonly Keyframe<number>[];
1312
+ color?: string | readonly TimedKeyframe<string>[] | ColorScheduleInfo;
1313
+ font?: FontName | readonly TimedKeyframe<FontName>[];
1314
+ size?: number | readonly TimedKeyframe<number>[];
1315
+ fontWidth?: number | readonly TimedKeyframe<number>[];
1316
+ boldness?: number | readonly TimedKeyframe<number>[];
1317
+ obliqueness?: number | readonly TimedKeyframe<number>[];
1318
+ alpha?: number | readonly TimedKeyframe<number>[];
1297
1319
  } = {},
1298
1320
  ) {
1321
+ this.registryKey = initialValues.registryKey ?? "Text Format";
1299
1322
  this.description = initialValues.description ?? "Text Format";
1300
1323
  if (initialValues.name !== undefined)
1301
1324
  this.nameScalar.value = initialValues.name;
@@ -1352,7 +1375,11 @@ export class TextFormatComponent implements Showable {
1352
1375
  MIN_FONT_WIDTH,
1353
1376
  this.fontWidthSchedule.at(timeInMs) || 0,
1354
1377
  );
1355
- const boldness = this.boldnessSchedule.at(timeInMs);
1378
+ // 0 or less would hang the font builder. As thin as it goes is the closest thing.
1379
+ const boldness = Math.max(
1380
+ MIN_BOLDNESS,
1381
+ this.boldnessSchedule.at(timeInMs) || 0,
1382
+ );
1356
1383
  const obliqueness = this.obliquenessSchedule.at(timeInMs);
1357
1384
  const alpha = this.alphaSchedule.at(timeInMs);
1358
1385
  if (
@@ -1,5 +1,5 @@
1
1
  import { Showable, ShowOptions } from "../showable.ts";
2
- import { Keyframe } from "../interpolate.ts";
2
+ import { TimedKeyframe } from "../interpolate.ts";
3
3
  import { ReadOnlyRect } from "phil-lib/misc";
4
4
  import {
5
5
  ColorScheduleInfo,
@@ -11,7 +11,7 @@ import {
11
11
  * position/size schedule.
12
12
  */
13
13
  export class RectangleComponent implements Showable {
14
- readonly registryKey = "Rectangle";
14
+ readonly registryKey: string;
15
15
  readonly colorSchedule = new ColorScheduleInfo("Color", "cyan");
16
16
  readonly rectSchedule = new RectangleScheduleInfo("Rect", {
17
17
  x: 2,
@@ -25,10 +25,12 @@ export class RectangleComponent implements Showable {
25
25
  constructor(
26
26
  initialValues: {
27
27
  description?: string;
28
- color?: string | readonly Keyframe<string>[];
29
- rect?: ReadOnlyRect | readonly Keyframe<ReadOnlyRect>[];
28
+ registryKey?: string;
29
+ color?: string | readonly TimedKeyframe<string>[];
30
+ rect?: ReadOnlyRect | readonly TimedKeyframe<ReadOnlyRect>[];
30
31
  } = {},
31
32
  ) {
33
+ this.registryKey = initialValues.registryKey ?? "Rectangle";
32
34
  this.description = initialValues.description ?? "Rectangle";
33
35
  if (initialValues.color !== undefined)
34
36
  this.colorSchedule.set(initialValues.color);
@@ -33,6 +33,11 @@ export type ComponentRegistryEntry = {
33
33
  * English text that can be displayed when the user selects this item.
34
34
  */
35
35
  description?: string;
36
+ /**
37
+ * The name the Visual Editor shows for this kind of component, if not its key. The key is
38
+ * what save files store, so it (almost) never changes. This can.
39
+ */
40
+ label?: string;
36
41
  /**
37
42
  * Offer this in the Visual Editor's "Wrap Component" dialog.
38
43
  *
@@ -361,34 +366,35 @@ export const componentRegistry = new Map<string, ComponentRegistryEntry>([
361
366
  ],
362
367
  ]);
363
368
 
369
+ /**
370
+ * A check that runs at compile time, never at run time. The code generator behind Save Diffs
371
+ * writes `new X({ description: … })` for every class with `howToGenerate`, so each one has to
372
+ * take its name, and its registry key, in its options. A class added to the registry with
373
+ * `howToGenerate` belongs on this list. See `ComponentOptions` in showable.ts.
374
+ */
364
375
  if (false) {
365
- //test
366
- // This is a work in progress.
367
- // I want to make the inputs to the constructors of the components more similar,
368
- // for the sake of the code generator in the "Save Diffs" button.
369
- // In particular, Showable.description is read only and must be set in the constructor.
370
- // This won't be difficult, but I'm still considering some design decision.
371
- new PaddingComponent({ description: "test" });
372
- new FrameCounter({ description: "test" });
373
- new InSeriesComponent({ description: "test" });
374
- new SlideLeftTransition({ description: "test" });
375
- new CrossFadeTransition({ description: "test" });
376
- new HoldPreviousTransition({ description: "test" });
377
- new HoldNextTransition({ description: "test" });
378
- new SlideComponent({ description: "test" });
379
- new TextComponent({ description: "test" });
380
- new TraditionalTextComponent({ description: "test" });
381
- new RectangleComponent({ description: "test" });
382
- new ArrowComponent({ description: "test" });
383
- // @ts-expect-error: TODO make this work.
384
- new FunctionGraphComponent({ description: "test" });
385
- // @ts-expect-error: TODO make this work.
386
- new SingleImageComponent({ description: "test" });
387
- new MultiTextComponent({ description: "test" });
388
- // @ts-expect-error: TODO make this work.
389
- new TextSpanComponent({ description: "test" });
390
- new TextFormatComponent({ description: "test" });
391
- new HalftoneShadowComponent({ description: "test" });
376
+ const options = { description: "test", registryKey: "test" };
377
+ new PaddingComponent(options);
378
+ new FrameCounter(options);
379
+ new InSeriesComponent(options);
380
+ new SlideLeftTransition(options);
381
+ new CrossFadeTransition(options);
382
+ new HoldPreviousTransition(options);
383
+ new HoldNextTransition(options);
384
+ new SlideComponent(options);
385
+ new TextComponent(options);
386
+ new TraditionalTextComponent(options);
387
+ new RectangleComponent(options);
388
+ new ArrowComponent(options);
389
+ new FunctionGraphComponent(options);
390
+ new SingleImageComponent(options);
391
+ new VideoClipComponent(options);
392
+ new MultiTextComponent(options);
393
+ new TextSpanComponent(options);
394
+ new TextFormatComponent(options);
395
+ new HandwritingEffectComponent(options);
396
+ new FourierComponent(options);
397
+ new HalftoneShadowComponent(options);
392
398
  }
393
399
 
394
400
  /**
@@ -1,7 +1,10 @@
1
+ import { canvasRecorder } from "../../lib/main-control.ts";
2
+ import type { Font } from "../glib/letters-base.ts";
1
3
  import { makeLineFont } from "../glib/line-font.ts";
2
4
  import { ParagraphLayout } from "../glib/paragraph-layout.ts";
3
5
 
4
- const errorFont = makeLineFont(1);
6
+ /** Made the first time it's needed, so this module loads without a browser. */
7
+ let errorFont: Font | undefined;
5
8
 
6
9
  /**
7
10
  * Write text on the screen where it is big and easy to see, even without knowing what else is there.
@@ -10,13 +13,19 @@ const errorFont = makeLineFont(1);
10
13
  * Can include " " and "\n" for optional and forced line breaks.
11
14
  */
12
15
  export function showError(context: CanvasRenderingContext2D, text: string) {
13
- const font = errorFont;
16
+ const font = (errorFont ??= makeLineFont(1));
17
+ /** Space on the left and right. */
18
+ const margin = 0.25;
19
+ // Read the width every time: it can change at any time.
20
+ const width = Math.max(1, canvasRecorder.width - 2 * margin);
14
21
  const path = ParagraphLayout.singlePathShape({
15
22
  font,
16
23
  text,
17
24
  alignment: "center",
18
- width: 15.5,
19
- }).canvasPath;
25
+ width,
26
+ })
27
+ // Center on the canvas, not on the paragraph.
28
+ .translate((canvasRecorder.width - width) / 2, 0).canvasPath;
20
29
  context.lineCap = "round";
21
30
  context.lineJoin = "round";
22
31
  context.lineWidth = font.strokeWidth * 3;
@@ -1,5 +1,9 @@
1
1
  import { ReadOnlyRect } from "phil-lib/misc";
2
- import { MIN_FONT_SIZE, MIN_FONT_WIDTH } from "../glib/line-font.ts";
2
+ import {
3
+ MIN_BOLDNESS,
4
+ MIN_FONT_SIZE,
5
+ MIN_FONT_WIDTH,
6
+ } from "../glib/line-font.ts";
3
7
  import {
4
8
  checkCharacters,
5
9
  FONT_NAMES,
@@ -17,7 +21,7 @@ import {
17
21
  } from "../schedule-helper.ts";
18
22
  import { ShowOptions } from "../showable.ts";
19
23
  import { DurationAgnosticComponent } from "./duration-agnostic.ts";
20
- import { Keyframe } from "../interpolate.ts";
24
+ import { TimedKeyframe } from "../interpolate.ts";
21
25
  import { Font } from "../glib/letters-base.ts";
22
26
 
23
27
  type CachedFont = {
@@ -30,7 +34,7 @@ type CachedFont = {
30
34
  };
31
35
 
32
36
  export class TextComponent extends DurationAgnosticComponent {
33
- readonly registryKey = "Text";
37
+ readonly registryKey: string;
34
38
  readonly colorSchedule = new ColorScheduleInfo("Color", "#888");
35
39
  readonly rectSchedule = new RectangleScheduleInfo("Rect", {
36
40
  x: 2,
@@ -66,15 +70,16 @@ export class TextComponent extends DurationAgnosticComponent {
66
70
  constructor(
67
71
  initialValues: {
68
72
  description?: string;
73
+ registryKey?: string;
69
74
  minDuration?: number;
70
- color?: string | readonly Keyframe<string>[];
71
- rect?: ReadOnlyRect | readonly Keyframe<ReadOnlyRect>[];
72
- text?: string | readonly Keyframe<string>[];
73
- font?: FontName | readonly Keyframe<FontName>[];
74
- size?: number | readonly Keyframe<number>[];
75
- fontWidth?: number | readonly Keyframe<number>[];
76
- boldness?: number | readonly Keyframe<number>[];
77
- obliqueness?: number | readonly Keyframe<number>[];
75
+ color?: string | readonly TimedKeyframe<string>[];
76
+ rect?: ReadOnlyRect | readonly TimedKeyframe<ReadOnlyRect>[];
77
+ text?: string | readonly TimedKeyframe<string>[];
78
+ font?: FontName | readonly TimedKeyframe<FontName>[];
79
+ size?: number | readonly TimedKeyframe<number>[];
80
+ fontWidth?: number | readonly TimedKeyframe<number>[];
81
+ boldness?: number | readonly TimedKeyframe<number>[];
82
+ obliqueness?: number | readonly TimedKeyframe<number>[];
78
83
  // I have mixed feelings on the complicated type definition.
79
84
  // It is exactly what it needs to be, and it avoids any duplicated code or namespace pollution.
80
85
  // But it is long and complicated.
@@ -86,6 +91,7 @@ export class TextComponent extends DurationAgnosticComponent {
86
91
  } = {},
87
92
  ) {
88
93
  super(initialValues.description ?? "Text");
94
+ this.registryKey = initialValues.registryKey ?? "Text";
89
95
  if (initialValues.minDuration !== undefined) {
90
96
  this.minDurationScalar.value = initialValues.minDuration;
91
97
  }
@@ -169,7 +175,11 @@ export class TextComponent extends DurationAgnosticComponent {
169
175
  MIN_FONT_WIDTH,
170
176
  this.fontWidthSchedule.at(timeInMs) || 0,
171
177
  );
172
- const boldness = this.boldnessSchedule.at(timeInMs);
178
+ // 0 or less would hang the font builder. As thin as it goes is the closest thing.
179
+ const boldness = Math.max(
180
+ MIN_BOLDNESS,
181
+ this.boldnessSchedule.at(timeInMs) || 0,
182
+ );
173
183
  const obliqueness = this.obliquenessSchedule.at(timeInMs);
174
184
  const alignment = this.alignmentSchedule.at(timeInMs);
175
185
  context.strokeStyle = color;
@@ -4,7 +4,7 @@ import { ShowOptions } from "../showable.ts";
4
4
  import { DurationAgnosticComponent } from "./duration-agnostic.ts";
5
5
  import { ShowChildInfo } from "./in-parallel.ts";
6
6
  import { showError } from "./show-error.ts";
7
- import { Keyframe } from "../interpolate.ts";
7
+ import { TimedKeyframe } from "../interpolate.ts";
8
8
 
9
9
  /**
10
10
  * Mathematical Bold Script capital letters A–J, used as placeholders in
@@ -38,7 +38,7 @@ export const TRANSFORM_PLACEHOLDERS = [
38
38
  * Exported so dev/canvas-recorder.ts can use instanceof for the custom panel.
39
39
  */
40
40
  export class SlideComponent extends DurationAgnosticComponent {
41
- readonly registryKey = "Slide";
41
+ readonly registryKey: string;
42
42
  readonly transformTemplate = new StringScalarInfo(
43
43
  "Transform Template",
44
44
  "scale(1)",
@@ -68,21 +68,23 @@ export class SlideComponent extends DurationAgnosticComponent {
68
68
  constructor(
69
69
  initialValues: {
70
70
  description?: string;
71
+ registryKey?: string;
71
72
  transformTemplate?: string;
72
- alpha?: number | readonly Keyframe<number>[];
73
- placeA?: number | readonly Keyframe<number>[];
74
- placeB?: number | readonly Keyframe<number>[];
75
- placeC?: number | readonly Keyframe<number>[];
76
- placeD?: number | readonly Keyframe<number>[];
77
- placeE?: number | readonly Keyframe<number>[];
78
- placeF?: number | readonly Keyframe<number>[];
79
- placeG?: number | readonly Keyframe<number>[];
80
- placeH?: number | readonly Keyframe<number>[];
81
- placeI?: number | readonly Keyframe<number>[];
82
- placeJ?: number | readonly Keyframe<number>[];
73
+ alpha?: number | readonly TimedKeyframe<number>[];
74
+ placeA?: number | readonly TimedKeyframe<number>[];
75
+ placeB?: number | readonly TimedKeyframe<number>[];
76
+ placeC?: number | readonly TimedKeyframe<number>[];
77
+ placeD?: number | readonly TimedKeyframe<number>[];
78
+ placeE?: number | readonly TimedKeyframe<number>[];
79
+ placeF?: number | readonly TimedKeyframe<number>[];
80
+ placeG?: number | readonly TimedKeyframe<number>[];
81
+ placeH?: number | readonly TimedKeyframe<number>[];
82
+ placeI?: number | readonly TimedKeyframe<number>[];
83
+ placeJ?: number | readonly TimedKeyframe<number>[];
83
84
  } = {},
84
85
  ) {
85
86
  super(initialValues.description ?? "Slide");
87
+ this.registryKey = initialValues.registryKey ?? "Slide";
86
88
  this.scalars.push(this.transformTemplate);
87
89
  if (initialValues.transformTemplate !== undefined)
88
90
  this.transformTemplate.value = initialValues.transformTemplate;
@@ -12,10 +12,17 @@ export class SlideLeftTransition
12
12
  extends ComponentWithLiveDuration
13
13
  implements Transition
14
14
  {
15
- constructor(options: { description?: string; duration?: number } = {}) {
15
+ constructor(
16
+ options: {
17
+ description?: string;
18
+ registryKey?: string;
19
+ duration?: number;
20
+ } = {},
21
+ ) {
16
22
  super(options.description ?? "Slide Left", options.duration ?? 1000);
23
+ this.registryKey = options.registryKey ?? "Slide Left Transition";
17
24
  }
18
- readonly registryKey = "Slide Left Transition";
25
+ readonly registryKey: string;
19
26
  override show(options: ShowOptions): void {
20
27
  // Thoughts about the future:
21
28
  // For now I'm focused on using this in an InSeriesComponent.
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { PathShape } from "../glib/path-shape.ts";
4
4
  import { Showable, ShowOptions } from "../showable.ts";
5
+ import type { PlacedText } from "./multi-text.ts";
5
6
 
6
7
  /**
7
8
  * A {@link MultiTextComponent} child with this key changes how the text is
@@ -77,6 +78,13 @@ export type TextEffect = Showable & {
77
78
  * @param letters Every letter, in reading order.
78
79
  * @param options The Multi Text's own options, so `timeInMs` is the Multi
79
80
  * Text's local time.
81
+ * @param placed Where the Multi Text put the paragraph: scale, offset, turn
82
+ * and pivot. The letters are in the paragraph's own coordinates, and an
83
+ * effect that wants to work in the Multi Text's coordinates, where Position
84
+ * and the Visual Editor's point markers live, needs this to convert. The
85
+ * paragraph point `p` is drawn at the Multi Text's point `turn(offset + scale
86
+ * * p)`, as {@link PlacedText} describes. Optional for the implementer: an
87
+ * effect that doesn't need it can leave the parameter out.
80
88
  * @returns What to stroke, grouped by {@link EffectLetter.tag}. This
81
89
  * replaces `laidOut.pathShapeByTag()`. Each path is stroked by its tag's
82
90
  * format, in the order of this map, so later entries are drawn on top. Leave
@@ -85,6 +93,7 @@ export type TextEffect = Showable & {
85
93
  [TEXT_EFFECT](
86
94
  letters: readonly EffectLetter[],
87
95
  options: ShowOptions,
96
+ placed: PlacedText,
88
97
  ): Map<unknown, PathShape>;
89
98
  };
90
99
 
@@ -9,7 +9,7 @@ import {
9
9
  } from "../schedule-helper.ts";
10
10
  import { ShowOptions } from "../showable.ts";
11
11
  import { DurationAgnosticComponent } from "./duration-agnostic.ts";
12
- import { Keyframe } from "../interpolate.ts";
12
+ import { TimedKeyframe } from "../interpolate.ts";
13
13
 
14
14
  /**
15
15
  * `document.fonts.check()`/`.load()` only know about `FontFace` objects that
@@ -214,17 +214,17 @@ export class TraditionalTextComponent extends DurationAgnosticComponent {
214
214
  registryKey?: string;
215
215
  description?: string;
216
216
  minDuration?: number;
217
- text?: string | readonly Keyframe<string>[];
217
+ text?: string | readonly TimedKeyframe<string>[];
218
218
  position?: Point;
219
- fillColor?: string | readonly Keyframe<string>[];
220
- outlineColor?: string | readonly Keyframe<string>[];
221
- outlineWidth?: number | readonly Keyframe<number>[];
222
- fontSize?: number | readonly Keyframe<number>[];
219
+ fillColor?: string | readonly TimedKeyframe<string>[];
220
+ outlineColor?: string | readonly TimedKeyframe<string>[];
221
+ outlineWidth?: number | readonly TimedKeyframe<number>[];
222
+ fontSize?: number | readonly TimedKeyframe<number>[];
223
223
  fontStyle?: Parameters<
224
224
  TraditionalTextComponent["fontStyleSchedule"]["set"]
225
225
  >[0];
226
- fontWeight?: number | readonly Keyframe<number>[];
227
- fontFamily?: string | readonly Keyframe<string>[];
226
+ fontWeight?: number | readonly TimedKeyframe<number>[];
227
+ fontFamily?: string | readonly TimedKeyframe<string>[];
228
228
  textAlign?: Parameters<
229
229
  TraditionalTextComponent["textAlignSchedule"]["set"]
230
230
  >[0];
@@ -16,7 +16,7 @@ import { ReadOnlyRect } from "phil-lib/misc";
16
16
  import { RectangleScheduleInfo } from "../schedule-helper.ts";
17
17
  import { Scalar, ShowOptions, SoundClip } from "../showable.ts";
18
18
  import { SlowImage } from "../slow-image-sources.ts";
19
- import { Keyframe } from "../interpolate.ts";
19
+ import { TimedKeyframe } from "../interpolate.ts";
20
20
  import { debugLog } from "../debug-log.ts";
21
21
  import { readVideoInfo, VideoInfo } from "./video-info.ts";
22
22
 
@@ -488,7 +488,7 @@ export class VideoClipComponent extends ComponentWithLiveDuration {
488
488
  * clip in the series at once.
489
489
  */
490
490
  static readonly GET_READY_MS = 5_000;
491
- readonly registryKey = "Video Clip";
491
+ readonly registryKey: string;
492
492
  readonly urlScalar: Scalar<"string"> = {
493
493
  description: "URL",
494
494
  type: "string",
@@ -588,17 +588,19 @@ export class VideoClipComponent extends ComponentWithLiveDuration {
588
588
  constructor(
589
589
  initialValues: {
590
590
  description?: string;
591
+ registryKey?: string;
591
592
  url?: string;
592
593
  startMsIntoClip?: number;
593
594
  endMsIntoClip?: number;
594
595
  duration?: number;
595
- destinationRect?: ReadOnlyRect | readonly Keyframe<ReadOnlyRect>[];
596
+ destinationRect?: ReadOnlyRect | readonly TimedKeyframe<ReadOnlyRect>[];
596
597
  } = {},
597
598
  ) {
598
599
  super(
599
600
  initialValues.description ?? "Video Clip",
600
601
  initialValues.duration ?? 1_000,
601
602
  );
603
+ this.registryKey = initialValues.registryKey ?? "Video Clip";
602
604
  if (initialValues.url !== undefined) {
603
605
  this.urlScalar.value = initialValues.url;
604
606
  }