@doenet/v06-to-v07 0.7.21-dev.382 → 0.7.21-dev.384

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.
@@ -43370,7 +43370,7 @@ async function cidFromArrayBuffer(data) {
43370
43370
  await crypto.subtle.digest("SHA-256", new Uint8Array());
43371
43371
  digest = (data2) => crypto.subtle.digest("SHA-256", data2);
43372
43372
  } catch (e22) {
43373
- const sha256 = (await import("./sha256-AuWkkb03-Cx3VZc-P-D8XEbJdS.js").then((n2) => n2.s)).default;
43373
+ const sha256 = (await import("./sha256-AuWkkb03-CMunoRDy-DVISCgeV.js").then((n2) => n2.s)).default;
43374
43374
  digest = (data2) => sha256(data2, {
43375
43375
  asBytes: true
43376
43376
  });
@@ -94334,6 +94334,42 @@ function addSectionTitleColorContrastDiagnostic({
94334
94334
  );
94335
94335
  }
94336
94336
  }
94337
+ function returnSectionChildDependencies() {
94338
+ return {
94339
+ allChildren: {
94340
+ dependencyType: "child",
94341
+ includeAllChildren: true
94342
+ },
94343
+ configurationChildren: {
94344
+ dependencyType: "child",
94345
+ childGroups: [
94346
+ "styleDefinitions",
94347
+ "stylePalettes",
94348
+ "feedbackDefinitions",
94349
+ "setups",
94350
+ "variantControls"
94351
+ ]
94352
+ }
94353
+ };
94354
+ }
94355
+ function nonConfigurationChildEntries(dependencyValues) {
94356
+ const configurationChildIndices = new Set(
94357
+ dependencyValues.configurationChildren.map(
94358
+ (child) => child.componentIdx
94359
+ )
94360
+ );
94361
+ return [...dependencyValues.allChildren.entries()].filter(
94362
+ ([, child]) => !configurationChildIndices.has(child.componentIdx)
94363
+ );
94364
+ }
94365
+ function childRendersSomething(child, componentInfoObjects2) {
94366
+ if (typeof child !== "object") {
94367
+ return child.trim() !== "";
94368
+ }
94369
+ return Boolean(
94370
+ componentInfoObjects2.allComponentClasses[child.componentType]?.rendererType
94371
+ );
94372
+ }
94337
94373
  class SectioningComponent extends BlockComponent {
94338
94374
  constructor(args) {
94339
94375
  super(args);
@@ -94673,16 +94709,7 @@ class SectioningComponent extends BlockComponent {
94673
94709
  dependencyType: "child",
94674
94710
  childGroups: ["titles"]
94675
94711
  },
94676
- allChildren: {
94677
- dependencyType: "child",
94678
- childGroups: [
94679
- "anything",
94680
- "variantControls",
94681
- "titles",
94682
- "setups",
94683
- "cascadeMessages"
94684
- ]
94685
- },
94712
+ ...returnSectionChildDependencies(),
94686
94713
  titleChildName: {
94687
94714
  dependencyType: "stateVariable",
94688
94715
  variableName: "titleChildName"
@@ -94702,30 +94729,31 @@ class SectioningComponent extends BlockComponent {
94702
94729
  let allTitleChildNames = dependencyValues.titleChildren.map(
94703
94730
  (x2) => x2.componentIdx
94704
94731
  );
94705
- for (let [
94706
- ind,
94707
- child
94708
- ] of dependencyValues.allChildren.entries()) {
94732
+ for (let [ind, child] of nonConfigurationChildEntries(
94733
+ dependencyValues
94734
+ )) {
94709
94735
  if (dependencyValues.hideChildren && typeof child === "string") {
94710
94736
  continue;
94711
94737
  }
94712
- if (dependencyValues.asList) {
94713
- if (child.componentIdx === dependencyValues.titleChildName || componentInfoObjects2.isInheritedComponentType({
94738
+ const renderChild = dependencyValues.asList ? (
94739
+ // if asList, then only include titleChild, sections, introduction, and conclusion
94740
+ child.componentIdx === dependencyValues.titleChildName || componentInfoObjects2.isInheritedComponentType({
94714
94741
  inheritedComponentType: child.componentType,
94715
94742
  baseComponentType: "_sectioningComponent"
94716
94743
  }) || ["introduction", "conclusion"].includes(
94717
94744
  child.componentType
94718
- )) {
94719
- childIndicesToRender.push(ind);
94720
- if (firstVisibleChild === null && !dependencyValues.hideChildren) {
94721
- firstVisibleChild = child;
94722
- }
94723
- }
94724
- } else if (typeof child !== "object" || !allTitleChildNames.includes(child.componentIdx) || child.componentIdx === dependencyValues.titleChildName) {
94725
- childIndicesToRender.push(ind);
94726
- if (firstVisibleChild === null && !dependencyValues.hideChildren && (typeof child === "object" || child.trim() !== "")) {
94727
- firstVisibleChild = child;
94728
- }
94745
+ )
94746
+ ) : (
94747
+ // otherwise, include everything but the title children
94748
+ // that lost out to `titleChildName`
94749
+ typeof child !== "object" || !allTitleChildNames.includes(child.componentIdx) || child.componentIdx === dependencyValues.titleChildName
94750
+ );
94751
+ if (!renderChild) {
94752
+ continue;
94753
+ }
94754
+ childIndicesToRender.push(ind);
94755
+ if (firstVisibleChild === null && !dependencyValues.hideChildren && childRendersSomething(child, componentInfoObjects2)) {
94756
+ firstVisibleChild = child;
94729
94757
  }
94730
94758
  }
94731
94759
  return {
@@ -94736,16 +94764,7 @@ class SectioningComponent extends BlockComponent {
94736
94764
  };
94737
94765
  stateVariableDefinitions.childrenToHide = {
94738
94766
  returnDependencies: () => ({
94739
- allChildren: {
94740
- dependencyType: "child",
94741
- childGroups: [
94742
- "anything",
94743
- "variantControls",
94744
- "titles",
94745
- "setups",
94746
- "cascadeMessages"
94747
- ]
94748
- },
94767
+ ...returnSectionChildDependencies(),
94749
94768
  titleChildName: {
94750
94769
  dependencyType: "stateVariable",
94751
94770
  variableName: "titleChildName"
@@ -94757,7 +94776,9 @@ class SectioningComponent extends BlockComponent {
94757
94776
  }),
94758
94777
  definition({ dependencyValues }) {
94759
94778
  const childrenToHide = [];
94760
- for (let child of dependencyValues.allChildren) {
94779
+ for (let [, child] of nonConfigurationChildEntries(
94780
+ dependencyValues
94781
+ )) {
94761
94782
  if (child.componentType === "cascadeMessage") {
94762
94783
  if (!dependencyValues.hideChildren && typeof child === "object") {
94763
94784
  childrenToHide.push(child.componentIdx);
@@ -94898,15 +94919,14 @@ class SectioningComponent extends BlockComponent {
94898
94919
  ],
94899
94920
  forRenderer: true,
94900
94921
  returnDependencies: () => ({
94922
+ // `childIndicesToRender` is looked up in this list below, so it
94923
+ // must be the same complete child list that produced those
94924
+ // positions (see `returnSectionChildDependencies`). The
94925
+ // configuration children are already excluded from
94926
+ // `childIndicesToRender`, so they need not be identified here.
94901
94927
  allChildren: {
94902
94928
  dependencyType: "child",
94903
- childGroups: [
94904
- "anything",
94905
- "variantControls",
94906
- "titles",
94907
- "setups",
94908
- "cascadeMessages"
94909
- ]
94929
+ includeAllChildren: true
94910
94930
  },
94911
94931
  asList: {
94912
94932
  dependencyType: "stateVariable",
@@ -233868,4 +233888,4 @@ export {
233868
233888
  getDefaultExportFromCjs$1 as g,
233869
233889
  updateSyntaxFromV06toV07 as u
233870
233890
  };
233871
- //# sourceMappingURL=index-CWT152hP.js.map
233891
+ //# sourceMappingURL=index-CINa3RRM.js.map