@doenet/v06-to-v07 0.7.26-dev.540 → 0.7.26

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.
@@ -47272,7 +47272,7 @@ async function cidFromArrayBuffer(data) {
47272
47272
  await crypto.subtle.digest("SHA-256", new Uint8Array());
47273
47273
  digest = (data2) => crypto.subtle.digest("SHA-256", data2);
47274
47274
  } catch (e22) {
47275
- const sha256 = (await import("./sha256-DT5xJ2Hv-Qy06UIn3-DoA6xmY7.js").then((n2) => n2.s)).default;
47275
+ const sha256 = (await import("./sha256-DT5xJ2Hv-BVeLgYWQ-CHOh3hgV.js").then((n2) => n2.s)).default;
47276
47276
  digest = (data2) => sha256(data2, {
47277
47277
  asBytes: true
47278
47278
  });
@@ -68088,8 +68088,12 @@ class DependencyHandler {
68088
68088
  stateVariable
68089
68089
  );
68090
68090
  }
68091
- const item = { componentIdx, type, stateVariable, dependency };
68092
- let neededForItem = this.peekNeededToResolve(item);
68091
+ let neededForItem = this.peekNeededToResolve({
68092
+ componentIdx,
68093
+ type,
68094
+ stateVariable,
68095
+ dependency
68096
+ });
68093
68097
  let determineDepsBlockers = neededForItem.determineDependencies;
68094
68098
  if (determineDepsBlockers && determineDepsBlockers.length > 0) {
68095
68099
  for (let blockerCode of [...determineDepsBlockers]) {
@@ -68119,62 +68123,115 @@ class DependencyHandler {
68119
68123
  stateVarObj.currentlyResolving = true;
68120
68124
  }
68121
68125
  }
68122
- try {
68123
- let previousNFailures = Infinity;
68124
- let nFailures = Infinity;
68125
- while (Object.keys(neededForItem).length > 0 || nFailures > 0) {
68126
- if (Number.isFinite(nFailures) && nFailures >= previousNFailures) {
68127
- break;
68128
- }
68129
- if (nFailures > 0) {
68130
- neededForItem = this.peekNeededToResolve(item);
68131
- }
68132
- previousNFailures = nFailures;
68133
- let passResult = await this._resolveBlockersOfItem({
68134
- neededForItem,
68135
- item,
68136
- forceBlockers: false,
68137
- tolerateFailures: force,
68138
- expandComposites
68139
- });
68140
- if (passResult.failure) {
68141
- return passResult.failure;
68142
- }
68143
- nFailures = passResult.nFailures;
68126
+ let previousNFailures = Infinity;
68127
+ let nFailures = Infinity;
68128
+ while (Object.keys(neededForItem).length > 0 || nFailures > 0) {
68129
+ if (Number.isFinite(nFailures) && nFailures >= previousNFailures) {
68130
+ break;
68144
68131
  }
68145
68132
  if (nFailures > 0) {
68146
- neededForItem = this.peekNeededToResolve(item);
68147
- while (Object.keys(neededForItem).length > 0) {
68148
- let passResult = await this._resolveBlockersOfItem({
68149
- neededForItem,
68150
- item,
68151
- forceBlockers: force,
68152
- tolerateFailures: false,
68133
+ neededForItem = this.peekNeededToResolve({
68134
+ componentIdx,
68135
+ type,
68136
+ stateVariable,
68137
+ dependency
68138
+ });
68139
+ }
68140
+ previousNFailures = nFailures;
68141
+ nFailures = 0;
68142
+ for (let blockerType in neededForItem) {
68143
+ if (blockerType === "determineDependencies") {
68144
+ throw Error(
68145
+ `Shouldn't have determine dependencies blocker after determining dependencies: ${componentIdx}, ${type}, ${stateVariable}, ${dependency}`
68146
+ );
68147
+ }
68148
+ for (let code of [...neededForItem[blockerType]]) {
68149
+ let [
68150
+ blockerComponentIdx,
68151
+ blockerStateVariable,
68152
+ blockerDependency
68153
+ ] = typeof code === "string" ? code.split("|") : [code];
68154
+ let result2 = await this.resolveItem({
68155
+ componentIdx: blockerComponentIdx,
68156
+ type: blockerType,
68157
+ stateVariable: blockerStateVariable,
68158
+ dependency: blockerDependency,
68159
+ //force, //recurseUpstream
68153
68160
  expandComposites
68154
68161
  });
68155
- if (passResult.failure) {
68156
- return passResult.failure;
68162
+ if (!result2.success) {
68163
+ if (force) {
68164
+ nFailures++;
68165
+ } else {
68166
+ return result2;
68167
+ }
68157
68168
  }
68158
68169
  }
68159
68170
  }
68160
- } finally {
68161
- if (stateVarObj) {
68162
- stateVarObj.currentlyResolving = false;
68171
+ }
68172
+ if (nFailures > 0) {
68173
+ neededForItem = this.peekNeededToResolve({
68174
+ componentIdx,
68175
+ type,
68176
+ stateVariable,
68177
+ dependency
68178
+ });
68179
+ while (Object.keys(neededForItem).length > 0) {
68180
+ for (let blockerType in neededForItem) {
68181
+ if (blockerType === "determineDependencies") {
68182
+ throw Error(
68183
+ `Shouldn't have determine dependencies blocker after determining dependencies: ${componentIdx}, ${type}, ${stateVariable}, ${dependency}`
68184
+ );
68185
+ }
68186
+ for (let code of [...neededForItem[blockerType]]) {
68187
+ let [
68188
+ blockerComponentIdx,
68189
+ blockerStateVariable,
68190
+ blockerDependency
68191
+ ] = typeof code === "string" ? code.split("|") : [code];
68192
+ let result2 = await this.resolveItem({
68193
+ componentIdx: blockerComponentIdx,
68194
+ type: blockerType,
68195
+ stateVariable: blockerStateVariable,
68196
+ dependency: blockerDependency,
68197
+ force,
68198
+ //recurseUpstream
68199
+ expandComposites
68200
+ });
68201
+ if (!result2.success) {
68202
+ return result2;
68203
+ }
68204
+ }
68205
+ }
68163
68206
  }
68164
68207
  }
68208
+ if (stateVarObj) {
68209
+ stateVarObj.currentlyResolving = false;
68210
+ }
68165
68211
  let finalResult = await this.resolveIfReady({
68166
- ...item,
68212
+ componentIdx,
68213
+ type,
68214
+ stateVariable,
68215
+ dependency,
68167
68216
  force,
68168
68217
  recurseUpstream,
68169
68218
  expandComposites
68170
68219
  });
68171
68220
  if (!finalResult.success) {
68172
- let stillNeededForItem = this.peekNeededToResolve(item);
68221
+ let stillNeededForItem = this.peekNeededToResolve({
68222
+ componentIdx,
68223
+ type,
68224
+ stateVariable,
68225
+ dependency
68226
+ });
68173
68227
  let numNeeded = Object.keys(stillNeededForItem).length;
68174
68228
  if (numNeeded > 0) {
68175
68229
  if (numPreviouslyNeeded === void 0 || numNeeded < numPreviouslyNeeded) {
68176
68230
  finalResult = await this.resolveItem({
68177
- ...item,
68231
+ componentIdx,
68232
+ type,
68233
+ stateVariable,
68234
+ dependency,
68178
68235
  force,
68179
68236
  recurseUpstream,
68180
68237
  expandComposites,
@@ -68185,61 +68242,6 @@ class DependencyHandler {
68185
68242
  }
68186
68243
  return finalResult;
68187
68244
  }
68188
- /**
68189
- * Make one pass over `neededForItem`, the live record of what is still
68190
- * blocking `item`, resolving each blocker in turn. Entries drop out of the
68191
- * record as their blockers resolve, so the caller can loop until it is
68192
- * empty.
68193
- *
68194
- * `forceBlockers` is passed on to each blocker's own `resolveItem`.
68195
- * `tolerateFailures` decides what an unresolved blocker means: when false,
68196
- * the pass stops and hands back that blocker's result as `failure` for the
68197
- * caller to propagate; when true, the pass continues and reports how many
68198
- * blockers failed as `nFailures`.
68199
- *
68200
- * A `determineDependencies` blocker reaching here is a bug, so it throws:
68201
- * `resolveItem` resolves those before it sets `currentlyResolving`, and
68202
- * that flag is what stops a new one from being added while it works.
68203
- */
68204
- async _resolveBlockersOfItem({
68205
- neededForItem,
68206
- item,
68207
- forceBlockers,
68208
- tolerateFailures,
68209
- expandComposites
68210
- }) {
68211
- let nFailures = 0;
68212
- for (let blockerType in neededForItem) {
68213
- if (blockerType === "determineDependencies") {
68214
- throw Error(
68215
- `Shouldn't have determine dependencies blocker after determining dependencies: ${item.componentIdx}, ${item.type}, ${item.stateVariable}, ${item.dependency}`
68216
- );
68217
- }
68218
- for (let code of [...neededForItem[blockerType]]) {
68219
- let [
68220
- blockerComponentIdx,
68221
- blockerStateVariable,
68222
- blockerDependency
68223
- ] = typeof code === "string" ? code.split("|") : [code];
68224
- let result2 = await this.resolveItem({
68225
- componentIdx: blockerComponentIdx,
68226
- type: blockerType,
68227
- stateVariable: blockerStateVariable,
68228
- dependency: blockerDependency,
68229
- force: forceBlockers,
68230
- expandComposites
68231
- });
68232
- if (!result2.success) {
68233
- if (tolerateFailures) {
68234
- nFailures++;
68235
- } else {
68236
- return { failure: result2, nFailures };
68237
- }
68238
- }
68239
- }
68240
- }
68241
- return { nFailures };
68242
- }
68243
68245
  checkForCircularResolveBlocker({
68244
68246
  componentIdx,
68245
68247
  type,
@@ -239467,4 +239469,4 @@ export {
239467
239469
  getDefaultExportFromCjs$1 as g,
239468
239470
  updateSyntaxFromV06toV07 as u
239469
239471
  };
239470
- //# sourceMappingURL=index-DYUgFZHa.js.map
239472
+ //# sourceMappingURL=index-Bin7pIAp.js.map