alpha2 0.4.6 → 0.5.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.
Files changed (119) hide show
  1. package/README.md +5 -4
  2. package/THIRD_PARTY_NOTICES.md +4 -0
  3. package/dist/abort.d.ts +12 -0
  4. package/dist/abort.js +48 -0
  5. package/dist/active-clock.d.ts +35 -0
  6. package/dist/active-clock.js +99 -0
  7. package/dist/assets.d.ts +28 -22
  8. package/dist/assets.js +8 -12
  9. package/dist/audio-layout.d.ts +52 -74
  10. package/dist/audio-layout.js +114 -148
  11. package/dist/audio-timeline.d.ts +89 -117
  12. package/dist/audio-timeline.js +102 -118
  13. package/dist/audio-worker.d.ts +12 -21
  14. package/dist/audio-worker.js +8 -13
  15. package/dist/audio-worklet-processor.js +45 -58
  16. package/dist/audio-worklet.d.ts +45 -76
  17. package/dist/audio-worklet.js +44 -79
  18. package/dist/audio.d.ts +15 -23
  19. package/dist/audio.js +9 -13
  20. package/dist/builder.d.ts +45 -63
  21. package/dist/builder.js +49 -45
  22. package/dist/capabilities.d.ts +99 -16
  23. package/dist/capabilities.js +2 -2
  24. package/dist/captions.d.ts +45 -22
  25. package/dist/captions.js +60 -15
  26. package/dist/chroma-siting.d.ts +24 -41
  27. package/dist/chroma-siting.js +38 -71
  28. package/dist/containers.d.ts +41 -30
  29. package/dist/containers.js +59 -27
  30. package/dist/decoder-fallback.d.ts +13 -0
  31. package/dist/decoder-fallback.js +38 -0
  32. package/dist/decoder-order.d.ts +24 -39
  33. package/dist/decoder-order.js +28 -42
  34. package/dist/edit.d.ts +77 -154
  35. package/dist/edit.js +98 -180
  36. package/dist/effects.d.ts +108 -177
  37. package/dist/effects.js +7 -9
  38. package/dist/export-destination.d.ts +25 -41
  39. package/dist/export-destination.js +20 -32
  40. package/dist/export-failure.d.ts +34 -59
  41. package/dist/export-failure.js +54 -48
  42. package/dist/export-metrics.d.ts +116 -0
  43. package/dist/export-metrics.js +74 -0
  44. package/dist/export-retry.d.ts +46 -29
  45. package/dist/export-retry.js +86 -51
  46. package/dist/exporter.d.ts +67 -116
  47. package/dist/exporter.js +133 -133
  48. package/dist/extensions.d.ts +69 -115
  49. package/dist/extensions.js +55 -82
  50. package/dist/frame-intake.d.ts +92 -0
  51. package/dist/frame-intake.js +114 -0
  52. package/dist/frame-supply.d.ts +96 -162
  53. package/dist/frame-supply.js +181 -171
  54. package/dist/generated/project-schema.d.ts +701 -485
  55. package/dist/generated/project-schema.js +55 -2
  56. package/dist/generated/project-shape.js +261 -16
  57. package/dist/geometry.d.ts +28 -34
  58. package/dist/geometry.js +18 -23
  59. package/dist/gpu-recovery.d.ts +92 -0
  60. package/dist/gpu-recovery.js +135 -0
  61. package/dist/hdr-frames.d.ts +82 -67
  62. package/dist/hdr-frames.js +112 -49
  63. package/dist/index.d.ts +4 -0
  64. package/dist/index.js +4 -0
  65. package/dist/json-text.d.ts +13 -23
  66. package/dist/json-text.js +10 -20
  67. package/dist/layout-values.d.ts +14 -22
  68. package/dist/layout-values.js +18 -21
  69. package/dist/layout.d.ts +48 -63
  70. package/dist/layout.js +37 -37
  71. package/dist/loudness.d.ts +27 -32
  72. package/dist/loudness.js +19 -23
  73. package/dist/media.d.ts +85 -237
  74. package/dist/media.js +133 -287
  75. package/dist/mediabunny.d.ts +166 -245
  76. package/dist/mediabunny.js +741 -580
  77. package/dist/physical-frames.d.ts +5 -17
  78. package/dist/physical-frames.js +4 -11
  79. package/dist/player.d.ts +56 -47
  80. package/dist/player.js +155 -40
  81. package/dist/presented-frames.d.ts +2 -7
  82. package/dist/presented-frames.js +3 -8
  83. package/dist/project.d.ts +73 -117
  84. package/dist/project.js +384 -445
  85. package/dist/rate-control.d.ts +9 -23
  86. package/dist/rate-control.js +7 -18
  87. package/dist/renderer-choice.d.ts +41 -0
  88. package/dist/renderer-choice.js +82 -0
  89. package/dist/repacked-bytes.d.ts +0 -2
  90. package/dist/repacked-bytes.js +2 -5
  91. package/dist/robustness.d.ts +25 -37
  92. package/dist/robustness.js +71 -54
  93. package/dist/sha256.d.ts +5 -13
  94. package/dist/sha256.js +9 -24
  95. package/dist/text.d.ts +97 -71
  96. package/dist/text.js +33 -70
  97. package/dist/video-frames.d.ts +7 -25
  98. package/dist/video-frames.js +12 -29
  99. package/dist/waveform.d.ts +5 -11
  100. package/dist/waveform.js +4 -9
  101. package/dist/worker-error.d.ts +5 -20
  102. package/dist/worker-error.js +8 -25
  103. package/dist/worker.d.ts +82 -95
  104. package/dist/worker.js +235 -143
  105. package/package.json +26 -2
  106. package/wasm/alpha2_audio_worklet.wasm +0 -0
  107. package/wasm/alpha2_extensions.d.ts +26 -47
  108. package/wasm/alpha2_extensions.js +26 -47
  109. package/wasm/alpha2_extensions_bg.wasm +0 -0
  110. package/wasm/alpha2_wasm.d.ts +460 -567
  111. package/wasm/alpha2_wasm.js +594 -594
  112. package/wasm/alpha2_wasm_bg.wasm +0 -0
  113. package/wasm/alpha2_wasm_bg.wasm.d.ts +15 -8
  114. package/wasm/rust-crate-licenses.md +2 -2
  115. package/wasm/snippets/{alpha2-wasm-c62e60c964e88a52 → alpha2-wasm-1313375d424845c0}/inline1.js +1 -0
  116. package/wasm/snippets/alpha2-wasm-1313375d424845c0/inline2.js +82 -0
  117. package/wasm/snippets/alpha2-wasm-c62e60c964e88a52/inline2.js +0 -52
  118. /package/wasm/snippets/{alpha2-wasm-c62e60c964e88a52 → alpha2-wasm-1313375d424845c0}/inline0.js +0 -0
  119. /package/wasm/snippets/{alpha2-wasm-c62e60c964e88a52 → alpha2-wasm-1313375d424845c0}/inline3.js +0 -0
@@ -5,6 +5,8 @@
5
5
  export const AUDIO_EFFECT_STATE_MARGIN_MS = 1100;
6
6
  /** Mirrors `alpha2_model::CURRENT_SCHEMA_VERSION`. */
7
7
  export const CURRENT_SCHEMA_VERSION = 1;
8
+ /** Mirrors `alpha2_model::MAX_ANIMATOR_SCALE`. */
9
+ export const MAX_ANIMATOR_SCALE = 10;
8
10
  /** Mirrors `alpha2_model::MAX_AUDIO_DELAY_MS`. */
9
11
  export const MAX_AUDIO_DELAY_MS = 120000;
10
12
  /** Mirrors `alpha2_model::MAX_AUDIO_EFFECTS`. */
@@ -19,8 +21,14 @@ export const MAX_CAPTION_FILE_BYTES = 67108864;
19
21
  export const MAX_CAPTION_FILE_CUES = 65536;
20
22
  /** Mirrors `alpha2_model::MAX_CAPTION_FONT_SIZE`. */
21
23
  export const MAX_CAPTION_FONT_SIZE = 0.25;
24
+ /** Mirrors `alpha2_model::MAX_CAPTION_NAME_BYTES`. */
25
+ export const MAX_CAPTION_NAME_BYTES = 64;
26
+ /** Mirrors `alpha2_model::MAX_CAPTION_STYLES`. */
27
+ export const MAX_CAPTION_STYLES = 32;
22
28
  /** Mirrors `alpha2_model::MAX_CHAIN_EFFECTS`. */
23
29
  export const MAX_CHAIN_EFFECTS = 16;
30
+ /** Mirrors `alpha2_model::MAX_CLASS_NAME_BYTES`. */
31
+ export const MAX_CLASS_NAME_BYTES = 64;
24
32
  /** Mirrors `alpha2_model::MAX_CLIPS`. */
25
33
  export const MAX_CLIPS = 100000;
26
34
  /** Mirrors `alpha2_model::MAX_CLIPS_PER_TRACK`. */
@@ -99,6 +107,12 @@ export const MAX_POLYSTAR_POINTS = 100;
99
107
  export const MAX_PROJECT_JSON_BYTES = 67108864;
100
108
  /** Mirrors `alpha2_model::MAX_PROVIDER_DOCUMENT_BYTES`. */
101
109
  export const MAX_PROVIDER_DOCUMENT_BYTES = 268435456;
110
+ /** Mirrors `alpha2_model::MAX_RANGE_INDEX`. */
111
+ export const MAX_RANGE_INDEX = 4096;
112
+ /** Mirrors `alpha2_model::MAX_RANGE_PERCENT`. */
113
+ export const MAX_RANGE_PERCENT = 200;
114
+ /** Mirrors `alpha2_model::MAX_RUN_CLASSES`. */
115
+ export const MAX_RUN_CLASSES = 8;
102
116
  /** Mirrors `alpha2_model::MAX_SAMPLE_RATE`. */
103
117
  export const MAX_SAMPLE_RATE = 96000;
104
118
  /** Mirrors `alpha2_model::MAX_SEQUENCE_FRAMES`. */
@@ -109,14 +123,26 @@ export const MAX_SHAPE_DEPTH = 32;
109
123
  export const MAX_SHAPE_ITEMS = 1024;
110
124
  /** Mirrors `alpha2_model::MAX_SVG_DOCUMENT_BYTES`. */
111
125
  export const MAX_SVG_DOCUMENT_BYTES = 33554432;
126
+ /** Mirrors `alpha2_model::MAX_TEXT_ANIMATORS`. */
127
+ export const MAX_TEXT_ANIMATORS = 8;
112
128
  /** Mirrors `alpha2_model::MAX_TEXT_CONTENT_BYTES`. */
113
129
  export const MAX_TEXT_CONTENT_BYTES = 4096;
114
130
  /** Mirrors `alpha2_model::MAX_TEXT_GENERATOR_FONT_SIZE`. */
115
131
  export const MAX_TEXT_GENERATOR_FONT_SIZE = 1;
116
- /** Mirrors `alpha2_model::MAX_TEXT_OUTLINE_WIDTH`. */
117
- export const MAX_TEXT_OUTLINE_WIDTH = 0.5;
118
132
  /** Mirrors `alpha2_model::MAX_TEXT_PADDING`. */
119
133
  export const MAX_TEXT_PADDING = 2;
134
+ /** Mirrors `alpha2_model::MAX_TEXT_RUNS`. */
135
+ export const MAX_TEXT_RUNS = 512;
136
+ /** Mirrors `alpha2_model::MAX_TEXT_SHADOWS`. */
137
+ export const MAX_TEXT_SHADOWS = 4;
138
+ /** Mirrors `alpha2_model::MAX_TEXT_SHADOW_BLUR`. */
139
+ export const MAX_TEXT_SHADOW_BLUR = 1;
140
+ /** Mirrors `alpha2_model::MAX_TEXT_SHADOW_OFFSET`. */
141
+ export const MAX_TEXT_SHADOW_OFFSET = 1;
142
+ /** Mirrors `alpha2_model::MAX_TEXT_STROKES`. */
143
+ export const MAX_TEXT_STROKES = 4;
144
+ /** Mirrors `alpha2_model::MAX_TEXT_STROKE_EXTENT`. */
145
+ export const MAX_TEXT_STROKE_EXTENT = 0.5;
120
146
  /** Mirrors `alpha2_model::MAX_TRACKS`. */
121
147
  export const MAX_TRACKS = 256;
122
148
  /** Mirrors `alpha2_model::MAX_TRANSITIONS_PER_TRACK`. */
@@ -137,6 +163,8 @@ export const MIN_LEVEL_DB = -96;
137
163
  export const MIN_LINE_HEIGHT = 0.5;
138
164
  /** Mirrors `alpha2_model::MIN_POLYSTAR_POINTS`. */
139
165
  export const MIN_POLYSTAR_POINTS = 3;
166
+ /** Mirrors `alpha2_model::MIN_RANGE_PERCENT`. */
167
+ export const MIN_RANGE_PERCENT = -100;
140
168
  /** Mirrors `alpha2_model::MIN_SAMPLE_RATE`. */
141
169
  export const MIN_SAMPLE_RATE = 8000;
142
170
  /** Mirrors `alpha2_model::REVERB_DELAY_MS`. */
@@ -189,6 +217,7 @@ export const CLIP_BLEND_MODE_VALUES = [
189
217
  "saturation",
190
218
  "color",
191
219
  "luminosity",
220
+ "plus_lighter",
192
221
  ];
193
222
  /** Every {@link ColorMatrix}, in the model's order. */
194
223
  export const COLOR_MATRIX_VALUES = [
@@ -307,6 +336,23 @@ export const POLYSTAR_KIND_VALUES = [
307
336
  ];
308
337
  /** Every {@link Position}, in the model's order. */
309
338
  export const POSITION_VALUES = ["relative", "absolute"];
339
+ /** Every {@link RangeShape}, in the model's order. */
340
+ export const RANGE_SHAPE_VALUES = [
341
+ "square",
342
+ "ramp_up",
343
+ "ramp_down",
344
+ "triangle",
345
+ "round",
346
+ "smooth",
347
+ ];
348
+ /** Every {@link RangeUnits}, in the model's order. */
349
+ export const RANGE_UNITS_VALUES = ["percent", "index"];
350
+ /** Every {@link RunState}, in the model's order. */
351
+ export const RUN_STATE_VALUES = [
352
+ "upcoming",
353
+ "active",
354
+ "spoken",
355
+ ];
310
356
  /** Every {@link Spread}, in the model's order. */
311
357
  export const SPREAD_VALUES = ["pad", "repeat", "reflect"];
312
358
  /** Every {@link TextAlign}, in the model's order. */
@@ -315,6 +361,13 @@ export const TEXT_ALIGN_VALUES = [
315
361
  "center",
316
362
  "end",
317
363
  ];
364
+ /** Every {@link TextUnit}, in the model's order. */
365
+ export const TEXT_UNIT_VALUES = [
366
+ "characters",
367
+ "characters_excluding_spaces",
368
+ "words",
369
+ "lines",
370
+ ];
318
371
  /** Every {@link TrackKind}, in the model's order. */
319
372
  export const TRACK_KIND_VALUES = [
320
373
  "video",
@@ -222,6 +222,31 @@ export const PROJECT_SHAPE = {
222
222
  },
223
223
  ],
224
224
  },
225
+ Animated_Rgba: {
226
+ oneOf: [
227
+ {
228
+ additionalProperties: false,
229
+ properties: {
230
+ mode: { const: "constant", type: "string" },
231
+ value: { $ref: "#/$defs/Rgba" },
232
+ },
233
+ required: ["mode", "value"],
234
+ type: "object",
235
+ },
236
+ {
237
+ additionalProperties: false,
238
+ properties: {
239
+ keyframes: {
240
+ items: { $ref: "#/$defs/Keyframe_Rgba" },
241
+ type: "array",
242
+ },
243
+ mode: { const: "keyframes", type: "string" },
244
+ },
245
+ required: ["mode", "keyframes"],
246
+ type: "object",
247
+ },
248
+ ],
249
+ },
225
250
  Animated_Vec2: {
226
251
  oneOf: [
227
252
  {
@@ -360,6 +385,7 @@ export const PROJECT_SHAPE = {
360
385
  $ref: "#/$defs/Animated_float",
361
386
  default: { mode: "constant", value: 0 },
362
387
  },
388
+ preserve_pitch: { type: "boolean" },
363
389
  },
364
390
  type: "object",
365
391
  },
@@ -398,7 +424,9 @@ export const PROJECT_SHAPE = {
398
424
  CaptionCue: {
399
425
  additionalProperties: false,
400
426
  properties: {
401
- text: { type: "string" },
427
+ speaker: { type: ["string", "null"] },
428
+ style: { type: ["string", "null"] },
429
+ text: { $ref: "#/$defs/TextContent" },
402
430
  timeline_range: { $ref: "#/$defs/TimeRange" },
403
431
  },
404
432
  required: ["timeline_range", "text"],
@@ -414,16 +442,22 @@ export const PROJECT_SHAPE = {
414
442
  align: "center",
415
443
  anchor: { x: 0.5, y: 1 },
416
444
  background: null,
417
- color: { alpha: 1, blue: 1, green: 1, red: 1 },
445
+ fill: {
446
+ color: { alpha: 1, blue: 1, green: 1, red: 1 },
447
+ type: "solid",
448
+ },
418
449
  font_size: 0.05,
419
450
  font_weight: 400,
420
451
  letter_spacing: 0,
421
452
  line_height: 1.2,
422
453
  max_width: 0.9,
423
- outline: null,
424
454
  position: { x: 0.5, y: 0.92 },
425
455
  },
426
456
  },
457
+ styles: {
458
+ additionalProperties: { $ref: "#/$defs/TextStylePatch" },
459
+ type: "object",
460
+ },
427
461
  },
428
462
  required: ["cues"],
429
463
  type: "object",
@@ -495,6 +529,7 @@ export const PROJECT_SHAPE = {
495
529
  { const: "saturation", type: "string" },
496
530
  { const: "color", type: "string" },
497
531
  { const: "luminosity", type: "string" },
532
+ { const: "plus_lighter", type: "string" },
498
533
  ],
499
534
  },
500
535
  ClipComposition: {
@@ -880,17 +915,19 @@ export const PROJECT_SHAPE = {
880
915
  align: "center",
881
916
  anchor: { x: 0.5, y: 1 },
882
917
  background: null,
883
- color: { alpha: 1, blue: 1, green: 1, red: 1 },
918
+ fill: {
919
+ color: { alpha: 1, blue: 1, green: 1, red: 1 },
920
+ type: "solid",
921
+ },
884
922
  font_size: 0.05,
885
923
  font_weight: 400,
886
924
  letter_spacing: 0,
887
925
  line_height: 1.2,
888
926
  max_width: 0.9,
889
- outline: null,
890
927
  position: { x: 0.5, y: 0.92 },
891
928
  },
892
929
  },
893
- text: { type: "string" },
930
+ text: { $ref: "#/$defs/TextContent" },
894
931
  type: { const: "text", type: "string" },
895
932
  },
896
933
  required: ["type", "text"],
@@ -1063,6 +1100,16 @@ export const PROJECT_SHAPE = {
1063
1100
  required: ["time", "value", "interpolation"],
1064
1101
  type: "object",
1065
1102
  },
1103
+ Keyframe_Rgba: {
1104
+ additionalProperties: false,
1105
+ properties: {
1106
+ interpolation: { $ref: "#/$defs/Interpolation" },
1107
+ time: { $ref: "#/$defs/MediaTime" },
1108
+ value: { $ref: "#/$defs/Rgba" },
1109
+ },
1110
+ required: ["time", "value", "interpolation"],
1111
+ type: "object",
1112
+ },
1066
1113
  Keyframe_Vec2: {
1067
1114
  additionalProperties: false,
1068
1115
  properties: {
@@ -1147,11 +1194,11 @@ export const PROJECT_SHAPE = {
1147
1194
  anyOf: [{ $ref: "#/$defs/Animated_LayoutSize" }, { type: "null" }],
1148
1195
  },
1149
1196
  children: { items: { $ref: "#/$defs/LayoutNode" }, type: "array" },
1150
- color: { anyOf: [{ $ref: "#/$defs/Rgba" }, { type: "null" }] },
1151
1197
  column_gap: {
1152
1198
  anyOf: [{ $ref: "#/$defs/Animated_LayoutSize" }, { type: "null" }],
1153
1199
  },
1154
1200
  display: { anyOf: [{ $ref: "#/$defs/Display" }, { type: "null" }] },
1201
+ fill: { anyOf: [{ $ref: "#/$defs/Paint" }, { type: "null" }] },
1155
1202
  flex_basis: {
1156
1203
  anyOf: [{ $ref: "#/$defs/Animated_LayoutLength" }, { type: "null" }],
1157
1204
  },
@@ -1232,7 +1279,6 @@ export const PROJECT_SHAPE = {
1232
1279
  opacity: {
1233
1280
  anyOf: [{ $ref: "#/$defs/Animated_float" }, { type: "null" }],
1234
1281
  },
1235
- outline: { anyOf: [{ $ref: "#/$defs/TextOutline" }, { type: "null" }] },
1236
1282
  overflow: { anyOf: [{ $ref: "#/$defs/Overflow" }, { type: "null" }] },
1237
1283
  padding: {
1238
1284
  anyOf: [{ $ref: "#/$defs/Animated_Insets" }, { type: "null" }],
@@ -1245,13 +1291,25 @@ export const PROJECT_SHAPE = {
1245
1291
  anyOf: [{ $ref: "#/$defs/Animated_LayoutSize" }, { type: "null" }],
1246
1292
  },
1247
1293
  scale: { anyOf: [{ $ref: "#/$defs/Animated_Vec2" }, { type: "null" }] },
1294
+ shadows: {
1295
+ items: { $ref: "#/$defs/TextShadow" },
1296
+ type: ["array", "null"],
1297
+ },
1248
1298
  shape: { anyOf: [{ $ref: "#/$defs/LayoutShape" }, { type: "null" }] },
1299
+ strokes: {
1300
+ items: { $ref: "#/$defs/TextStroke" },
1301
+ type: ["array", "null"],
1302
+ },
1249
1303
  text: {
1250
1304
  anyOf: [{ $ref: "#/$defs/Animated_string" }, { type: "null" }],
1251
1305
  },
1252
1306
  text_align: {
1253
1307
  anyOf: [{ $ref: "#/$defs/TextAlign" }, { type: "null" }],
1254
1308
  },
1309
+ text_animators: {
1310
+ items: { $ref: "#/$defs/TextAnimator" },
1311
+ type: "array",
1312
+ },
1255
1313
  translate: {
1256
1314
  anyOf: [{ $ref: "#/$defs/Animated_LayoutOffset" }, { type: "null" }],
1257
1315
  },
@@ -1809,6 +1867,22 @@ export const PROJECT_SHAPE = {
1809
1867
  },
1810
1868
  ],
1811
1869
  },
1870
+ RangeShape: {
1871
+ oneOf: [
1872
+ { const: "square", type: "string" },
1873
+ { const: "ramp_up", type: "string" },
1874
+ { const: "ramp_down", type: "string" },
1875
+ { const: "triangle", type: "string" },
1876
+ { const: "round", type: "string" },
1877
+ { const: "smooth", type: "string" },
1878
+ ],
1879
+ },
1880
+ RangeUnits: {
1881
+ oneOf: [
1882
+ { const: "percent", type: "string" },
1883
+ { const: "index", type: "string" },
1884
+ ],
1885
+ },
1812
1886
  Rgb: {
1813
1887
  additionalProperties: false,
1814
1888
  properties: {
@@ -1838,6 +1912,22 @@ export const PROJECT_SHAPE = {
1838
1912
  },
1839
1913
  ],
1840
1914
  },
1915
+ RunState: {
1916
+ oneOf: [
1917
+ { const: "upcoming", type: "string" },
1918
+ { const: "active", type: "string" },
1919
+ { const: "spoken", type: "string" },
1920
+ ],
1921
+ },
1922
+ RunTime: {
1923
+ additionalProperties: false,
1924
+ properties: {
1925
+ end: { $ref: "#/$defs/MediaTime" },
1926
+ start: { $ref: "#/$defs/MediaTime" },
1927
+ },
1928
+ required: ["start", "end"],
1929
+ type: "object",
1930
+ },
1841
1931
  ShapeGeometry: {
1842
1932
  oneOf: [
1843
1933
  {
@@ -2130,6 +2220,38 @@ export const PROJECT_SHAPE = {
2130
2220
  { const: "end", type: "string" },
2131
2221
  ],
2132
2222
  },
2223
+ TextAnimator: {
2224
+ additionalProperties: false,
2225
+ properties: {
2226
+ properties: { $ref: "#/$defs/TextAnimatorProperties", default: {} },
2227
+ selector: { $ref: "#/$defs/TextSelector" },
2228
+ },
2229
+ required: ["selector"],
2230
+ type: "object",
2231
+ },
2232
+ TextAnimatorProperties: {
2233
+ additionalProperties: false,
2234
+ properties: {
2235
+ fill: { anyOf: [{ $ref: "#/$defs/Animated_Rgba" }, { type: "null" }] },
2236
+ offset: {
2237
+ anyOf: [{ $ref: "#/$defs/Animated_Vec2" }, { type: "null" }],
2238
+ },
2239
+ opacity: {
2240
+ anyOf: [{ $ref: "#/$defs/Animated_float" }, { type: "null" }],
2241
+ },
2242
+ rotation_degrees: {
2243
+ anyOf: [{ $ref: "#/$defs/Animated_float" }, { type: "null" }],
2244
+ },
2245
+ scale: { anyOf: [{ $ref: "#/$defs/Animated_Vec2" }, { type: "null" }] },
2246
+ stroke: {
2247
+ anyOf: [{ $ref: "#/$defs/Animated_Rgba" }, { type: "null" }],
2248
+ },
2249
+ tracking: {
2250
+ anyOf: [{ $ref: "#/$defs/Animated_float" }, { type: "null" }],
2251
+ },
2252
+ },
2253
+ type: "object",
2254
+ },
2133
2255
  TextBackground: {
2134
2256
  additionalProperties: false,
2135
2257
  properties: {
@@ -2139,7 +2261,84 @@ export const PROJECT_SHAPE = {
2139
2261
  required: ["color"],
2140
2262
  type: "object",
2141
2263
  },
2142
- TextOutline: {
2264
+ TextContent: {
2265
+ anyOf: [
2266
+ { type: "string" },
2267
+ { items: { $ref: "#/$defs/TextRun" }, type: "array" },
2268
+ ],
2269
+ },
2270
+ TextRun: {
2271
+ additionalProperties: false,
2272
+ properties: {
2273
+ class: { items: { type: "string" }, type: "array" },
2274
+ text: { type: "string" },
2275
+ time: { anyOf: [{ $ref: "#/$defs/RunTime" }, { type: "null" }] },
2276
+ },
2277
+ required: ["text"],
2278
+ type: "object",
2279
+ },
2280
+ TextSelector: {
2281
+ oneOf: [
2282
+ {
2283
+ additionalProperties: false,
2284
+ properties: {
2285
+ amount: {
2286
+ $ref: "#/$defs/Animated_float",
2287
+ default: { mode: "constant", value: 1 },
2288
+ },
2289
+ based_on: { $ref: "#/$defs/TextUnit", default: "characters" },
2290
+ end: {
2291
+ $ref: "#/$defs/Animated_float",
2292
+ default: { mode: "constant", value: 100 },
2293
+ },
2294
+ offset: {
2295
+ $ref: "#/$defs/Animated_float",
2296
+ default: { mode: "constant", value: 0 },
2297
+ },
2298
+ shape: { $ref: "#/$defs/RangeShape", default: "square" },
2299
+ start: {
2300
+ $ref: "#/$defs/Animated_float",
2301
+ default: { mode: "constant", value: 0 },
2302
+ },
2303
+ type: { const: "range", type: "string" },
2304
+ units: { $ref: "#/$defs/RangeUnits", default: "percent" },
2305
+ },
2306
+ required: ["type"],
2307
+ type: "object",
2308
+ },
2309
+ {
2310
+ additionalProperties: false,
2311
+ properties: {
2312
+ ramp: { $ref: "#/$defs/MediaTime", default: 0 },
2313
+ state: { $ref: "#/$defs/RunState" },
2314
+ sweep: { default: false, type: "boolean" },
2315
+ type: { const: "timing", type: "string" },
2316
+ },
2317
+ required: ["type", "state"],
2318
+ type: "object",
2319
+ },
2320
+ {
2321
+ additionalProperties: false,
2322
+ properties: {
2323
+ class: { type: "string" },
2324
+ type: { const: "class", type: "string" },
2325
+ },
2326
+ required: ["type", "class"],
2327
+ type: "object",
2328
+ },
2329
+ ],
2330
+ },
2331
+ TextShadow: {
2332
+ additionalProperties: false,
2333
+ properties: {
2334
+ blur: { default: 0, format: "float", type: "number" },
2335
+ color: { $ref: "#/$defs/Rgba" },
2336
+ offset: { $ref: "#/$defs/Vec2", default: { x: 0, y: 0 } },
2337
+ },
2338
+ required: ["color"],
2339
+ type: "object",
2340
+ },
2341
+ TextStroke: {
2143
2342
  additionalProperties: false,
2144
2343
  properties: {
2145
2344
  color: { $ref: "#/$defs/Rgba" },
@@ -2153,13 +2352,17 @@ export const PROJECT_SHAPE = {
2153
2352
  properties: {
2154
2353
  align: { $ref: "#/$defs/TextAlign", default: "center" },
2155
2354
  anchor: { $ref: "#/$defs/Vec2", default: { x: 0.5, y: 1 } },
2355
+ animators: { items: { $ref: "#/$defs/TextAnimator" }, type: "array" },
2156
2356
  background: {
2157
2357
  anyOf: [{ $ref: "#/$defs/TextBackground" }, { type: "null" }],
2158
2358
  default: null,
2159
2359
  },
2160
- color: {
2161
- $ref: "#/$defs/Rgba",
2162
- default: { alpha: 1, blue: 1, green: 1, red: 1 },
2360
+ fill: {
2361
+ $ref: "#/$defs/Paint",
2362
+ default: {
2363
+ color: { alpha: 1, blue: 1, green: 1, red: 1 },
2364
+ type: "solid",
2365
+ },
2163
2366
  },
2164
2367
  font_family: { type: ["string", "null"] },
2165
2368
  font_size: { default: 0.05, format: "float", type: "number" },
@@ -2173,14 +2376,56 @@ export const PROJECT_SHAPE = {
2173
2376
  letter_spacing: { default: 0, format: "float", type: "number" },
2174
2377
  line_height: { default: 1.2, format: "float", type: "number" },
2175
2378
  max_width: { default: 0.9, format: "float", type: "number" },
2176
- outline: {
2177
- anyOf: [{ $ref: "#/$defs/TextOutline" }, { type: "null" }],
2178
- default: null,
2179
- },
2180
2379
  position: { $ref: "#/$defs/Vec2", default: { x: 0.5, y: 0.92 } },
2380
+ shadows: { items: { $ref: "#/$defs/TextShadow" }, type: "array" },
2381
+ strokes: { items: { $ref: "#/$defs/TextStroke" }, type: "array" },
2382
+ },
2383
+ type: "object",
2384
+ },
2385
+ TextStylePatch: {
2386
+ additionalProperties: false,
2387
+ properties: {
2388
+ align: { anyOf: [{ $ref: "#/$defs/TextAlign" }, { type: "null" }] },
2389
+ anchor: { anyOf: [{ $ref: "#/$defs/Vec2" }, { type: "null" }] },
2390
+ animators: {
2391
+ items: { $ref: "#/$defs/TextAnimator" },
2392
+ type: ["array", "null"],
2393
+ },
2394
+ background: {
2395
+ anyOf: [{ $ref: "#/$defs/TextBackground" }, { type: "null" }],
2396
+ },
2397
+ fill: { anyOf: [{ $ref: "#/$defs/Paint" }, { type: "null" }] },
2398
+ font_family: { type: ["string", "null"] },
2399
+ font_size: { format: "float", type: ["number", "null"] },
2400
+ font_weight: {
2401
+ format: "uint16",
2402
+ maximum: 65535,
2403
+ minimum: 0,
2404
+ type: ["integer", "null"],
2405
+ },
2406
+ letter_spacing: { format: "float", type: ["number", "null"] },
2407
+ line_height: { format: "float", type: ["number", "null"] },
2408
+ max_width: { format: "float", type: ["number", "null"] },
2409
+ position: { anyOf: [{ $ref: "#/$defs/Vec2" }, { type: "null" }] },
2410
+ shadows: {
2411
+ items: { $ref: "#/$defs/TextShadow" },
2412
+ type: ["array", "null"],
2413
+ },
2414
+ strokes: {
2415
+ items: { $ref: "#/$defs/TextStroke" },
2416
+ type: ["array", "null"],
2417
+ },
2181
2418
  },
2182
2419
  type: "object",
2183
2420
  },
2421
+ TextUnit: {
2422
+ oneOf: [
2423
+ { const: "characters", type: "string" },
2424
+ { const: "characters_excluding_spaces", type: "string" },
2425
+ { const: "words", type: "string" },
2426
+ { const: "lines", type: "string" },
2427
+ ],
2428
+ },
2184
2429
  TimeMap: {
2185
2430
  oneOf: [
2186
2431
  {
@@ -1,18 +1,16 @@
1
1
  /**
2
- * Shape geometry for editors, answered in wasm by the code the engine draws shapes with: where a
3
- * shapes generator's items are, which paint is under a point, how long a path is, and paths cut,
4
- * resampled, or converted. A hit test or a trim here agrees with what a frame shows.
2
+ * Shape geometry queries for editors, computed in wasm by the engine's shape code so results match
3
+ * rendered frames.
5
4
  *
6
- * Positions are normalized as the project document's are, `(0, 0)` top-left to `(1, 1)`
7
- * bottom-right of a `width` by `height` picture; lengths and distances are in its pixels. Times
8
- * are ticks, as keyframe times are.
5
+ * Positions are normalized, `(0, 0)` top-left to `(1, 1)` bottom-right of a `width` by `height`
6
+ * picture. Lengths and distances are in pixels; times are in ticks.
9
7
  *
10
8
  * Every function throws an `INVALID_INPUT` error for a picture outside 1 to 16384 pixels a side, a
11
- * time that is not a whole number of ticks, or input the model rejects (a content tree or geometry
12
- * that is not valid, a path point or tangent that is not finite).
9
+ * non-integer tick time, or input the model rejects (invalid content tree or geometry, non-finite
10
+ * point or tangent).
13
11
  */
14
12
  import type { AnimatedPoint, Path, ShapeGeometry, ShapeItem, Ticks, Vec2 } from "./project.js";
15
- /** The part of `alpha2/wasm` these functions use. */
13
+ /** The `alpha2/wasm` functions these wrappers use. */
16
14
  export interface GeometryBinding {
17
15
  shapeBounds(itemsJson: string, time: number, width: number, height: number): string;
18
16
  hitTest(itemsJson: string, time: number, width: number, height: number, x: number, y: number): string | undefined;
@@ -23,76 +21,72 @@ export interface GeometryBinding {
23
21
  toPath(geometryJson: string, time: number, width: number, height: number): string;
24
22
  motionPath(pointJson: string, width: number, height: number): string;
25
23
  }
26
- /** The size of the picture shapes are drawn on, in pixels. */
24
+ /** Picture size in pixels. */
27
25
  export interface PictureSize {
28
26
  readonly width: number;
29
27
  readonly height: number;
30
28
  }
31
- /** A normalized rectangle: `x0`, `y0` its top-left corner, `x1`, `y1` its bottom-right. */
29
+ /** Normalized rectangle from top-left (`x0`, `y0`) to bottom-right (`x1`, `y1`). */
32
30
  export interface Bounds {
33
31
  readonly x0: number;
34
32
  readonly y0: number;
35
33
  readonly x1: number;
36
34
  readonly y1: number;
37
35
  }
38
- /** An item's bounds, by its place in the tree (`items[0].items[2]`). */
36
+ /** An item's bounds; `at` is its tree path, such as `items[0].items[2]`. */
39
37
  export interface ItemBounds {
40
38
  readonly at: string;
41
- /** What it covers: geometry's outline, a paint's area; `null` for an item that shows nothing. */
39
+ /** `null` for an item that draws nothing. */
42
40
  readonly bounds: Bounds | null;
43
41
  }
44
- /** The point of a path nearest another. */
42
+ /** The closest point on a path to a query point. */
45
43
  export interface NearestPoint {
46
- /** The subpath. */
47
44
  readonly subpath: number;
48
- /** The segment within it: segment `i` runs from vertex `i` to the next. */
45
+ /** Segment `i` runs from vertex `i` to the next. */
49
46
  readonly segment: number;
50
- /** The parameter along the segment, in `0..=1`. */
47
+ /** Parameter along the segment, in `0..=1`. */
51
48
  readonly t: number;
52
- /** The point, normalized. */
49
+ /** Normalized position. */
53
50
  readonly point: Vec2;
54
- /** Its distance from the point asked about, in pixels. */
51
+ /** Distance from the query point, in pixels. */
55
52
  readonly distance: number;
56
53
  }
57
54
  /**
58
- * Each item's bounds at `time`, in document order: a group's are its items', a stroke's include
59
- * its width.
55
+ * Each item's bounds at `time`, in document order. Stroke bounds include the stroke width.
60
56
  *
61
57
  * @throws When `items` is not a valid content tree.
62
58
  */
63
59
  export declare function shapeBounds(binding: GeometryBinding, items: readonly ShapeItem[], time: Ticks, size: PictureSize): ItemBounds[];
64
60
  /**
65
- * The front-most fill or stroke at normalized `point` at `time`, by its fill rule (a stroke by
66
- * its outline): its place in the tree, or `undefined` where nothing is painted.
61
+ * Tree path of the front-most fill or stroke at normalized `point` at `time`, honoring fill rules,
62
+ * or `undefined` where nothing is painted.
67
63
  *
68
64
  * @throws When `items` is not a valid content tree.
69
65
  */
70
66
  export declare function hitTest(binding: GeometryBinding, items: readonly ShapeItem[], time: Ticks, size: PictureSize, point: Vec2): string | undefined;
71
- /** The point of `path` nearest normalized `point`, or `undefined` for an empty path. */
67
+ /** Closest point of `path` to normalized `point`, or `undefined` for an empty path. */
72
68
  export declare function nearestPoint(binding: GeometryBinding, path: Path, size: PictureSize, point: Vec2): NearestPoint | undefined;
73
69
  /** Each subpath's length, in pixels. */
74
70
  export declare function pathLength(binding: GeometryBinding, path: Path, size: PictureSize): number[];
75
71
  /**
76
- * The part of `path` a trim item keeps: from `start` to `end` (fractions of its pixel length, all
77
- * subpaths end to end, clamped to `0..=1`), shifted by `offset` turns. Nothing when `start` is not
78
- * before `end`.
72
+ * The part of `path` a trim item keeps. `start` and `end` are fractions of the total length of all
73
+ * subpaths, clamped to `0..=1`; `offset` is in turns. Empty when `start >= end`.
79
74
  */
80
75
  export declare function trimPath(binding: GeometryBinding, path: Path, size: PictureSize, start: number, end: number, offset?: number): Path;
81
76
  /**
82
- * `path` with `vertexCounts[i]` vertices on subpath `i`, evenly along its length, so two paths can
83
- * be given the same structure and their keyframes can morph. The engine never resamples on its
84
- * own. A subpath whose count is missing, below 2 (3 when closed), or that has no length is kept as
85
- * it is.
77
+ * Resamples subpath `i` to `vertexCounts[i]` evenly spaced vertices, so two paths can share a
78
+ * structure and morph between keyframes. Subpaths with a missing count, a count below 2 (3 when
79
+ * closed), or zero length are kept unchanged.
86
80
  *
87
81
  * @throws When a count is over `MAX_PATH_VERTICES`.
88
82
  */
89
83
  export declare function resamplePath(binding: GeometryBinding, path: Path, size: PictureSize, vertexCounts: readonly number[]): Path;
90
84
  /**
91
- * A rectangle, ellipse, or polystar at `time` as a path of the same outline, from the same start
92
- * point and in the same direction: "convert to path".
85
+ * Converts a rectangle, ellipse or polystar at `time` to a path with the same outline, start point
86
+ * and direction.
93
87
  *
94
88
  * @throws When `geometry` is not valid.
95
89
  */
96
90
  export declare function toPath(binding: GeometryBinding, geometry: ShapeGeometry, time: Ticks, size: PictureSize): Path;
97
- /** The polyline a position travels between its keyframes, along their spatial tangents. */
91
+ /** Polyline a position follows between keyframes, along their spatial tangents. */
98
92
  export declare function motionPath(binding: GeometryBinding, position: AnimatedPoint, size: PictureSize): Vec2[];