@doenet/v06-to-v07 0.7.24-dev.482 → 0.7.24-dev.484

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.
@@ -45857,7 +45857,7 @@ async function cidFromArrayBuffer(data) {
45857
45857
  await crypto.subtle.digest("SHA-256", new Uint8Array());
45858
45858
  digest = (data2) => crypto.subtle.digest("SHA-256", data2);
45859
45859
  } catch (e22) {
45860
- const sha256 = (await import("./sha256-DT5xJ2Hv-BPQuorEo-lKjpPVin.js").then((n2) => n2.s)).default;
45860
+ const sha256 = (await import("./sha256-DT5xJ2Hv-DBPjDuPu-CHV4SZss.js").then((n2) => n2.s)).default;
45861
45861
  digest = (data2) => sha256(data2, {
45862
45862
  asBytes: true
45863
45863
  });
@@ -97343,6 +97343,36 @@ class SectioningComponent extends BlockComponent {
97343
97343
  return { setValue: { hideChildren } };
97344
97344
  }
97345
97345
  };
97346
+ stateVariableDefinitions.hasCascadeMessageToShow = {
97347
+ returnDependencies: () => ({
97348
+ cascadeMessageChildren: {
97349
+ dependencyType: "child",
97350
+ childGroups: ["cascadeMessages"]
97351
+ }
97352
+ }),
97353
+ definition({ dependencyValues }) {
97354
+ return {
97355
+ setValue: {
97356
+ hasCascadeMessageToShow: dependencyValues.cascadeMessageChildren.length > 0
97357
+ }
97358
+ };
97359
+ }
97360
+ };
97361
+ stateVariableDefinitions.showCascadeMessage = {
97362
+ returnDependencies: () => ({
97363
+ parentSectionToShowCascadeMessage: {
97364
+ dependencyType: "parentStateVariable",
97365
+ variableName: "sectionToShowCascadeMessage"
97366
+ }
97367
+ }),
97368
+ definition({ dependencyValues, componentIdx }) {
97369
+ return {
97370
+ setValue: {
97371
+ showCascadeMessage: dependencyValues.parentSectionToShowCascadeMessage === componentIdx
97372
+ }
97373
+ };
97374
+ }
97375
+ };
97346
97376
  stateVariableDefinitions.childIndicesToRender = {
97347
97377
  returnDependencies: () => ({
97348
97378
  titleChildren: {
@@ -97449,6 +97479,10 @@ class SectioningComponent extends BlockComponent {
97449
97479
  hideChildren: {
97450
97480
  dependencyType: "stateVariable",
97451
97481
  variableName: "hideChildren"
97482
+ },
97483
+ showCascadeMessage: {
97484
+ dependencyType: "stateVariable",
97485
+ variableName: "showCascadeMessage"
97452
97486
  }
97453
97487
  }),
97454
97488
  definition({ dependencyValues }) {
@@ -97457,10 +97491,10 @@ class SectioningComponent extends BlockComponent {
97457
97491
  dependencyValues
97458
97492
  )) {
97459
97493
  if (child.componentType === "cascadeMessage") {
97460
- if (!dependencyValues.hideChildren && typeof child === "object") {
97494
+ if (!dependencyValues.showCascadeMessage) {
97461
97495
  childrenToHide.push(child.componentIdx);
97462
97496
  }
97463
- } else if (dependencyValues.hideChildren && typeof child === "object" && child.componentIdx !== dependencyValues.titleChildName && child.componentType !== "cascadeMessage") {
97497
+ } else if (dependencyValues.hideChildren && typeof child === "object" && child.componentIdx !== dependencyValues.titleChildName) {
97464
97498
  childrenToHide.push(child.componentIdx);
97465
97499
  }
97466
97500
  }
@@ -230329,7 +230363,10 @@ class Cascade extends SectioningComponent {
230329
230363
  }
230330
230364
  };
230331
230365
  stateVariableDefinitions.childrenToHide = {
230332
- additionalStateVariablesDefined: ["childrenToHideChildren"],
230366
+ additionalStateVariablesDefined: [
230367
+ "childrenToHideChildren",
230368
+ "sectionToShowCascadeMessage"
230369
+ ],
230333
230370
  returnDependencies: () => ({
230334
230371
  hideFutureSections: {
230335
230372
  dependencyType: "stateVariable",
@@ -230341,7 +230378,9 @@ class Cascade extends SectioningComponent {
230341
230378
  },
230342
230379
  children: {
230343
230380
  dependencyType: "child",
230344
- childGroups: ["anything"]
230381
+ childGroups: ["anything"],
230382
+ variableNames: ["hasCascadeMessageToShow"],
230383
+ variablesOptional: true
230345
230384
  },
230346
230385
  childrenWithCascadeMessages: {
230347
230386
  dependencyType: "child",
@@ -230354,6 +230393,10 @@ class Cascade extends SectioningComponent {
230354
230393
  hideChildren: {
230355
230394
  dependencyType: "stateVariable",
230356
230395
  variableName: "hideChildren"
230396
+ },
230397
+ showCascadeMessage: {
230398
+ dependencyType: "stateVariable",
230399
+ variableName: "showCascadeMessage"
230357
230400
  }
230358
230401
  }),
230359
230402
  definition({ dependencyValues, componentInfoObjects: componentInfoObjects2 }) {
@@ -230364,7 +230407,8 @@ class Cascade extends SectioningComponent {
230364
230407
  return {
230365
230408
  setValue: {
230366
230409
  childrenToHide: allContinuationComponentIndices,
230367
- childrenToHideChildren: []
230410
+ childrenToHideChildren: [],
230411
+ sectionToShowCascadeMessage: null
230368
230412
  }
230369
230413
  };
230370
230414
  }
@@ -230387,30 +230431,46 @@ class Cascade extends SectioningComponent {
230387
230431
  childrenToHide.push(child.componentIdx);
230388
230432
  }
230389
230433
  }
230390
- if (dependencyValues.numCompleted <= dependencyValues.children.length - 2) {
230391
- const lastShownChild = dependencyValues.children[dependencyValues.numCompleted].componentIdx;
230392
- const lastShownChildIdx = dependencyValues.childrenWithCascadeMessages.findIndex(
230393
- (child) => child.componentIdx === lastShownChild
230394
- );
230395
- const nextContinuation = dependencyValues.childrenWithCascadeMessages.slice(lastShownChildIdx + 1).find(
230396
- (child) => child.componentType === "cascadeMessage"
230397
- );
230398
- if (nextContinuation) {
230399
- childrenToHide.push(
230400
- ...allContinuationComponentIndices.filter(
230401
- (cIdx) => cIdx !== nextContinuation.componentIdx
230402
- )
230403
- );
230404
- } else {
230405
- childrenToHide.push(...allContinuationComponentIndices);
230434
+ const nextStep = dependencyValues.children[dependencyValues.numCompleted + 1];
230435
+ const sectionToShowCascadeMessage = nextStep && childrenToHideChildren.includes(nextStep.componentIdx) && nextStep.stateValues?.hasCascadeMessageToShow ? nextStep.componentIdx : null;
230436
+ const continuationToShow = sectionToShowCascadeMessage === null && (!dependencyValues.hideChildren || dependencyValues.showCascadeMessage) ? nextOwnCascadeMessage(dependencyValues) : null;
230437
+ childrenToHide.push(
230438
+ ...allContinuationComponentIndices.filter(
230439
+ (cIdx) => cIdx !== continuationToShow
230440
+ )
230441
+ );
230442
+ return {
230443
+ setValue: {
230444
+ childrenToHide,
230445
+ childrenToHideChildren,
230446
+ sectionToShowCascadeMessage
230406
230447
  }
230407
- } else {
230408
- childrenToHide.push(...allContinuationComponentIndices);
230448
+ };
230449
+ }
230450
+ };
230451
+ stateVariableDefinitions.hasCascadeMessageToShow = {
230452
+ returnDependencies: () => ({
230453
+ numCompleted: {
230454
+ dependencyType: "stateVariable",
230455
+ variableName: "numCompleted"
230456
+ },
230457
+ children: {
230458
+ dependencyType: "child",
230459
+ childGroups: ["anything"]
230460
+ },
230461
+ childrenWithCascadeMessages: {
230462
+ dependencyType: "child",
230463
+ childGroups: ["anything", "cascadeMessages"]
230464
+ },
230465
+ revealAll: {
230466
+ dependencyType: "stateVariable",
230467
+ variableName: "revealAll"
230409
230468
  }
230469
+ }),
230470
+ definition({ dependencyValues }) {
230410
230471
  return {
230411
230472
  setValue: {
230412
- childrenToHide,
230413
- childrenToHideChildren
230473
+ hasCascadeMessageToShow: nextOwnCascadeMessage(dependencyValues) !== null
230414
230474
  }
230415
230475
  };
230416
230476
  }
@@ -230418,6 +230478,16 @@ class Cascade extends SectioningComponent {
230418
230478
  return stateVariableDefinitions;
230419
230479
  }
230420
230480
  }
230481
+ function nextOwnCascadeMessage(dependencyValues) {
230482
+ if (dependencyValues.revealAll || dependencyValues.numCompleted > dependencyValues.children.length - 2) {
230483
+ return null;
230484
+ }
230485
+ const lastShownStep = dependencyValues.children[dependencyValues.numCompleted].componentIdx;
230486
+ const lastShownStepIdx = dependencyValues.childrenWithCascadeMessages.findIndex(
230487
+ (child) => child.componentIdx === lastShownStep
230488
+ );
230489
+ return dependencyValues.childrenWithCascadeMessages.slice(lastShownStepIdx + 1).find((child) => child.componentType === "cascadeMessage")?.componentIdx ?? null;
230490
+ }
230421
230491
  class DynamicChildren extends CompositeComponent {
230422
230492
  constructor(args) {
230423
230493
  super(args);
@@ -237286,4 +237356,4 @@ export {
237286
237356
  getDefaultExportFromCjs$1 as g,
237287
237357
  updateSyntaxFromV06toV07 as u
237288
237358
  };
237289
- //# sourceMappingURL=index-DlfTZGFl.js.map
237359
+ //# sourceMappingURL=index-vHOJ5L6p.js.map