@beff/aula 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/engine.d.ts CHANGED
@@ -1629,6 +1629,8 @@ export interface Drawing {
1629
1629
  lint: boolean;
1630
1630
  /** The number of chapters with the title card. */
1631
1631
  count: number;
1632
+ /** Leave out the linear keyframes that a player interpolates to within a small error. */
1633
+ prune: boolean;
1632
1634
  }
1633
1635
  /** A drawn chapter: its problems and its Lottie, on the narration clock. */
1634
1636
  export interface ChapterRun {
package/dist/engine.js CHANGED
@@ -3468,7 +3468,7 @@ function finished(handle) {
3468
3468
  * error). */
3469
3469
  export function drawRows(chapter, theme, card, slot, drawing) {
3470
3470
  const rows = rowsOf(chapter);
3471
- const handle = engine.Chapter.render(drawing.narration, theme.background, slot.number, drawing.count, drawing.name, drawing.lint);
3471
+ const handle = engine.Chapter.render(drawing.narration, theme.background, slot.number, drawing.count, drawing.name, drawing.lint, drawing.prune);
3472
3472
  const scene = new Scene(handle, slot);
3473
3473
  const heading = { title: chapter.heading, chapter: slot.number, count: slot.count, theme };
3474
3474
  write(handle, chapter, rows, slot, scene, () => {
@@ -3479,7 +3479,7 @@ export function drawRows(chapter, theme, card, slot, drawing) {
3479
3479
  /** Draws chapter 0: the card of the project `title` while the title is spoken. */
3480
3480
  export function drawTitle(title, theme, card, drawing) {
3481
3481
  freshSeed();
3482
- const handle = engine.Chapter.render(drawing.narration, theme.background, 0, drawing.count, drawing.name, drawing.lint);
3482
+ const handle = engine.Chapter.render(drawing.narration, theme.background, 0, drawing.count, drawing.name, drawing.lint, drawing.prune);
3483
3483
  const count = drawing.count - 1;
3484
3484
  const slot = {
3485
3485
  number: 0,
Binary file
Binary file
Binary file
@@ -4060,12 +4060,8 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
4060
4060
  let memory0;
4061
4061
  let realloc0;
4062
4062
  let memory1;
4063
- let _trampoline14 = function(arg0, arg1) {
4064
- var ptr0 = arg0 >>> 0 >>> 0;
4065
- var len0 = arg1 >>> 0;
4066
- if (ptr0 > memory0.buffer.byteLength || len0 > Math.floor((memory0.buffer.byteLength - ptr0) / 1)) throw new WebAssemblyRuntimeError("string pointer/length out of bounds of memory");
4067
- var result0 = _decodeUtf8(WebAssemblyRuntimeError, TEXT_DECODER_UTF8, new Uint8Array(memory0.buffer, ptr0, len0));
4068
- _debugLog("[iface=\"aula:engine/host\", function=\"report-panic\"] [Instruction::CallInterface] (sync, @ enter)");
4063
+ let _trampoline14 = function(arg0, arg1, arg2) {
4064
+ _debugLog("[iface=\"aula:engine/host\", function=\"call-rate\"] [Instruction::CallInterface] (sync, @ enter)");
4069
4065
  let parentTask;
4070
4066
  let task;
4071
4067
  let threadID;
@@ -4074,7 +4070,7 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
4074
4070
  ({task, threadID} = createNewCurrentImplicitThread(_jcoTaskCreateContext, {
4075
4071
  componentIdx: -1,
4076
4072
  isAsync: !1,
4077
- entryFnName: "reportPanic",
4073
+ entryFnName: "callRate",
4078
4074
  getCallbackFn: () => null,
4079
4075
  callbackFnName: null,
4080
4076
  errHandling: "none",
@@ -4095,11 +4091,11 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
4095
4091
  task.enterSync();
4096
4092
  let ret;
4097
4093
  try {
4098
- _withGlobalCurrentThreadMeta(CURRENT_TASK_META, {
4094
+ ret = _withGlobalCurrentThreadMeta(CURRENT_TASK_META, {
4099
4095
  componentIdx: task.componentIdx(),
4100
4096
  taskID: task.id(),
4101
4097
  threadID,
4102
- fn: () => _trackHostOperation(_jcoComponentHostOperationContext, () => reportPanic(result0))
4098
+ fn: () => _trackHostOperation(_jcoComponentHostOperationContext, () => callRate(arg0 >>> 0, arg1))
4103
4099
  });
4104
4100
  } catch (err) {
4105
4101
  _debugLog("[Instruction::CallInterface] error during sync call", {
@@ -4114,8 +4110,15 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
4114
4110
  throw err;
4115
4111
  }
4116
4112
  getOrCreateAsyncState(_jcoComponentStateLookupContext, 3).throwIfInterrupted();
4117
- _debugLog("[iface=\"aula:engine/host\", function=\"report-panic\"][Instruction::Return]", {
4118
- funcName: "report-panic",
4113
+ var variant0 = ret;
4114
+ if (variant0 == null) dataView(_jcoDataViewCacheContext, memory0).setInt8((arg2 >>> 0) + 0, 0, !0);
4115
+ else {
4116
+ let e = variant0;
4117
+ dataView(_jcoDataViewCacheContext, memory0).setInt8((arg2 >>> 0) + 0, 1, !0);
4118
+ dataView(_jcoDataViewCacheContext, memory0).setFloat64((arg2 >>> 0) + 8, +e, !0);
4119
+ }
4120
+ _debugLog("[iface=\"aula:engine/host\", function=\"call-rate\"][Instruction::Return]", {
4121
+ funcName: "call-rate",
4119
4122
  paramCount: 0,
4120
4123
  async: !1,
4121
4124
  postReturn: !1
@@ -4123,7 +4126,7 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
4123
4126
  task.resolve([ret]);
4124
4127
  task.exit();
4125
4128
  };
4126
- _trampoline14.fnName = "aula:engine/host#reportPanic";
4129
+ _trampoline14.fnName = "aula:engine/host#callRate";
4127
4130
  let _trampoline15 = function(arg0, arg1, arg2, arg3) {
4128
4131
  _debugLog("[iface=\"aula:engine/host\", function=\"call-point\"] [Instruction::CallInterface] (sync, @ enter)");
4129
4132
  let parentTask;
@@ -4193,8 +4196,12 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
4193
4196
  task.exit();
4194
4197
  };
4195
4198
  _trampoline15.fnName = "aula:engine/host#callPoint";
4196
- let _trampoline16 = function(arg0, arg1, arg2) {
4197
- _debugLog("[iface=\"aula:engine/host\", function=\"call-rate\"] [Instruction::CallInterface] (sync, @ enter)");
4199
+ let _trampoline16 = function(arg0, arg1) {
4200
+ var ptr0 = arg0 >>> 0 >>> 0;
4201
+ var len0 = arg1 >>> 0;
4202
+ if (ptr0 > memory0.buffer.byteLength || len0 > Math.floor((memory0.buffer.byteLength - ptr0) / 1)) throw new WebAssemblyRuntimeError("string pointer/length out of bounds of memory");
4203
+ var result0 = _decodeUtf8(WebAssemblyRuntimeError, TEXT_DECODER_UTF8, new Uint8Array(memory0.buffer, ptr0, len0));
4204
+ _debugLog("[iface=\"aula:engine/host\", function=\"report-panic\"] [Instruction::CallInterface] (sync, @ enter)");
4198
4205
  let parentTask;
4199
4206
  let task;
4200
4207
  let threadID;
@@ -4203,7 +4210,7 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
4203
4210
  ({task, threadID} = createNewCurrentImplicitThread(_jcoTaskCreateContext, {
4204
4211
  componentIdx: -1,
4205
4212
  isAsync: !1,
4206
- entryFnName: "callRate",
4213
+ entryFnName: "reportPanic",
4207
4214
  getCallbackFn: () => null,
4208
4215
  callbackFnName: null,
4209
4216
  errHandling: "none",
@@ -4224,11 +4231,11 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
4224
4231
  task.enterSync();
4225
4232
  let ret;
4226
4233
  try {
4227
- ret = _withGlobalCurrentThreadMeta(CURRENT_TASK_META, {
4234
+ _withGlobalCurrentThreadMeta(CURRENT_TASK_META, {
4228
4235
  componentIdx: task.componentIdx(),
4229
4236
  taskID: task.id(),
4230
4237
  threadID,
4231
- fn: () => _trackHostOperation(_jcoComponentHostOperationContext, () => callRate(arg0 >>> 0, arg1))
4238
+ fn: () => _trackHostOperation(_jcoComponentHostOperationContext, () => reportPanic(result0))
4232
4239
  });
4233
4240
  } catch (err) {
4234
4241
  _debugLog("[Instruction::CallInterface] error during sync call", {
@@ -4243,15 +4250,8 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
4243
4250
  throw err;
4244
4251
  }
4245
4252
  getOrCreateAsyncState(_jcoComponentStateLookupContext, 3).throwIfInterrupted();
4246
- var variant0 = ret;
4247
- if (variant0 == null) dataView(_jcoDataViewCacheContext, memory0).setInt8((arg2 >>> 0) + 0, 0, !0);
4248
- else {
4249
- let e = variant0;
4250
- dataView(_jcoDataViewCacheContext, memory0).setInt8((arg2 >>> 0) + 0, 1, !0);
4251
- dataView(_jcoDataViewCacheContext, memory0).setFloat64((arg2 >>> 0) + 8, +e, !0);
4252
- }
4253
- _debugLog("[iface=\"aula:engine/host\", function=\"call-rate\"][Instruction::Return]", {
4254
- funcName: "call-rate",
4253
+ _debugLog("[iface=\"aula:engine/host\", function=\"report-panic\"][Instruction::Return]", {
4254
+ funcName: "report-panic",
4255
4255
  paramCount: 0,
4256
4256
  async: !1,
4257
4257
  postReturn: !1
@@ -4259,7 +4259,7 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
4259
4259
  task.resolve([ret]);
4260
4260
  task.exit();
4261
4261
  };
4262
- _trampoline16.fnName = "aula:engine/host#callRate";
4262
+ _trampoline16.fnName = "aula:engine/host#reportPanic";
4263
4263
  let _trampoline17 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
4264
4264
  var len0 = arg2;
4265
4265
  var base0 = arg1 >>> 0 >>> 0;
@@ -22739,7 +22739,7 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
22739
22739
  });
22740
22740
  };
22741
22741
  let engineStaticChapterRender;
22742
- Chapter.render = function render(arg0, arg1, arg2, arg3, arg4, arg5) {
22742
+ Chapter.render = function render(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
22743
22743
  getOrCreateAsyncState(_jcoComponentStateLookupContext, 3).throwIfTrapped();
22744
22744
  let { task, threadID } = createNewCurrentImplicitThread(_jcoTaskCreateContext, {
22745
22745
  componentIdx: 3,
@@ -22946,7 +22946,7 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
22946
22946
  var len8 = encodeRes.len;
22947
22947
  _debugLog("[iface=\"aula:engine/engine\", function=\"[static]chapter.render\"][Instruction::CallWasm] enter", {
22948
22948
  funcName: "[static]chapter.render",
22949
- paramCount: 11,
22949
+ paramCount: 12,
22950
22950
  async: !1,
22951
22951
  postReturn: !0
22952
22952
  });
@@ -22956,7 +22956,7 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
22956
22956
  taskID: task.id(),
22957
22957
  threadID,
22958
22958
  componentIdx: task.componentIdx(),
22959
- fn: () => engineStaticChapterRender(+v0_0, toUint32(_jcoStrictNumericContext, v0_1), result6, len6, ptr7, len7, toUint32(_jcoStrictNumericContext, arg2), toUint32(_jcoStrictNumericContext, arg3), ptr8, len8, +!!arg5)
22959
+ fn: () => engineStaticChapterRender(+v0_0, toUint32(_jcoStrictNumericContext, v0_1), result6, len6, ptr7, len7, toUint32(_jcoStrictNumericContext, arg2), toUint32(_jcoStrictNumericContext, arg3), ptr8, len8, +!!arg5, +!!arg6)
22960
22960
  });
22961
22961
  } catch (err) {
22962
22962
  _debugLog("[Instruction::CallWasm] error during sync call", {
@@ -57545,9 +57545,28 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
57545
57545
  componentIdx: 3,
57546
57546
  isAsync: !1,
57547
57547
  isManualAsync: _trampoline14.manuallyAsync,
57548
- paramLiftFns: [_liftFlatStringAny.bind(void 0, _jcoLiftStringContext)],
57549
- resultLowerFns: [],
57550
- hasResultPointer: !1,
57548
+ paramLiftFns: [_liftFlatU32, _liftFlatFloat64],
57549
+ resultLowerFns: [_lowerFlatOption(_jcoStrictNumericContext, {
57550
+ caseMetas: [[
57551
+ "none",
57552
+ null,
57553
+ 0,
57554
+ 0,
57555
+ 0
57556
+ ], [
57557
+ "some",
57558
+ _lowerFlatFloat64.bind(void 0, _jcoStrictNumericContext),
57559
+ 8,
57560
+ 8,
57561
+ 1
57562
+ ]],
57563
+ variantSize32: 16,
57564
+ variantAlign32: 8,
57565
+ variantPayloadOffset32: 8,
57566
+ variantFlatCount: 2,
57567
+ payloadMaybeNull: !1
57568
+ })],
57569
+ hasResultPointer: !0,
57551
57570
  funcTypeIsAsync: !1,
57552
57571
  getCallbackFn: () => null,
57553
57572
  getPostReturnFn: () => null,
@@ -57624,28 +57643,9 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
57624
57643
  componentIdx: 3,
57625
57644
  isAsync: !1,
57626
57645
  isManualAsync: _trampoline16.manuallyAsync,
57627
- paramLiftFns: [_liftFlatU32, _liftFlatFloat64],
57628
- resultLowerFns: [_lowerFlatOption(_jcoStrictNumericContext, {
57629
- caseMetas: [[
57630
- "none",
57631
- null,
57632
- 0,
57633
- 0,
57634
- 0
57635
- ], [
57636
- "some",
57637
- _lowerFlatFloat64.bind(void 0, _jcoStrictNumericContext),
57638
- 8,
57639
- 8,
57640
- 1
57641
- ]],
57642
- variantSize32: 16,
57643
- variantAlign32: 8,
57644
- variantPayloadOffset32: 8,
57645
- variantFlatCount: 2,
57646
- payloadMaybeNull: !1
57647
- })],
57648
- hasResultPointer: !0,
57646
+ paramLiftFns: [_liftFlatStringAny.bind(void 0, _jcoLiftStringContext)],
57647
+ resultLowerFns: [],
57648
+ hasResultPointer: !1,
57649
57649
  funcTypeIsAsync: !1,
57650
57650
  getCallbackFn: () => null,
57651
57651
  getPostReturnFn: () => null,
@@ -57804,11 +57804,11 @@ export function instantiate(getCoreModule, imports, instantiateCore, options) {
57804
57804
  "call-alpha": Object.assign(_guardTrap(_jcoComponentRecordTrapContext, 3, trampoline11, !1), { _jcoMaySuspend: !1 }),
57805
57805
  "call-path": Object.assign(exports4[3], { _jcoMaySuspend: !1 }),
57806
57806
  "call-point": Object.assign(exports4[1], { _jcoMaySuspend: !1 }),
57807
- "call-rate": Object.assign(exports4[2], { _jcoMaySuspend: !1 }),
57807
+ "call-rate": Object.assign(exports4[0], { _jcoMaySuspend: !1 }),
57808
57808
  "call-redraw": Object.assign(_guardTrap(_jcoComponentRecordTrapContext, 3, trampoline12, !1), { _jcoMaySuspend: !1 }),
57809
57809
  "call-updater": Object.assign(_guardTrap(_jcoComponentRecordTrapContext, 3, trampoline13, !1), { _jcoMaySuspend: !1 }),
57810
57810
  "drop-callback": Object.assign(_guardTrap(_jcoComponentRecordTrapContext, 3, trampoline8, !1), { _jcoMaySuspend: !1 }),
57811
- "report-panic": Object.assign(exports4[0], { _jcoMaySuspend: !1 })
57811
+ "report-panic": Object.assign(exports4[2], { _jcoMaySuspend: !1 })
57812
57812
  },
57813
57813
  "aula:espeak/espeak": { "text-to-phonemes": Object.assign(exports4[4], { _jcoMaySuspend: !1 }) }
57814
57814
  }));
@@ -692,7 +692,7 @@ export class Chapter implements Disposable {
692
692
  /**
693
693
  * @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
694
694
  */
695
- static render(narration: Narration, background: Color, chapter: number, count: number, name: string, lint: boolean): Chapter;
695
+ static render(narration: Narration, background: Color, chapter: number, count: number, name: string, lint: boolean, prune: boolean): Chapter;
696
696
  /**
697
697
  * @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
698
698
  */
package/dist/run.d.ts CHANGED
@@ -91,6 +91,9 @@ export interface RenderOptions extends ReadOptions {
91
91
  /** Draw no frames: only the clock (the waits and the narration on the clock of the
92
92
  * picture). */
93
93
  lint?: boolean | undefined;
94
+ /** Leave out the linear keyframes of the Lottie that a player interpolates to within a small
95
+ * error (default `true`). Only the test of that rule turns it off. */
96
+ prune?: boolean | undefined;
94
97
  }
95
98
  /** Draws chapter `index` (0 is the title card) of `project` on its narration: its Lottie, its
96
99
  * length in frames, the waits of the narration and the warnings at the moves that the
package/dist/run.js CHANGED
@@ -282,6 +282,7 @@ export function renderChapter(project, index, options) {
282
282
  narration: options.narration,
283
283
  name: chapterNames(project)[index] ?? "",
284
284
  lint: options.lint ?? false,
285
+ prune: options.prune ?? true,
285
286
  count: project.chapters.length + 1,
286
287
  };
287
288
  const card = project.card ?? defaultCard;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beff/aula",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "description": "The aula engine for narrated explainer videos: the Manim CE API, defineChapter, its rows, readChapter and renderChapter over a Rust WebAssembly component. Chapters and kits import it; the aula command is @beff/aula-cli.",
6
6
  "license": "MIT AND GPL-3.0-or-later",