@citolab/qti-components 10.0.0-next.23 → 10.0.0-next.24

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.
@@ -4,7 +4,7 @@ import {
4
4
  control,
5
5
  dispatchPublic,
6
6
  listenPublic as listenPublic2
7
- } from "./chunk-J6VX4N7M.js";
7
+ } from "./chunk-HUM7ST4L.js";
8
8
  import {
9
9
  QtiModalFeedback
10
10
  } from "./chunk-H6DO5UHC.js";
@@ -2830,6 +2830,8 @@ var TestStateMixin = (superClass) => {
2830
2830
  class TestStateClass extends superClass {
2831
2831
  /** A state assigned before the test connected, applied when it does. */
2832
2832
  #pending = null;
2833
+ /** A refused state assigned before the test connected, reported when it does. */
2834
+ #refused = null;
2833
2835
  /**
2834
2836
  * False while a test document is loading. Loading resets both contexts and rebuilds them, so
2835
2837
  * the intermediate states are empty — emitting one would invite a host to save it over the
@@ -2850,6 +2852,10 @@ var TestStateMixin = (superClass) => {
2850
2852
  this.#pending = null;
2851
2853
  }
2852
2854
  this.#ready = true;
2855
+ if (this.#refused) {
2856
+ dispatchPublic(this, "qc-test-state-refused", this.#refused);
2857
+ this.#refused = null;
2858
+ }
2853
2859
  });
2854
2860
  }
2855
2861
  /** One plugin's entry, as JSON: the test stores it without reading it. `null` removes it. */
@@ -2873,7 +2879,12 @@ var TestStateMixin = (superClass) => {
2873
2879
  }
2874
2880
  set state(value) {
2875
2881
  if (!isQtiTestState(value)) {
2876
- console.warn(`[qti-test] Ignoring a state that is not a version ${QTI_TEST_STATE_VERSION} QtiTestState.`);
2882
+ const message = `Ignoring a state that is not a version ${QTI_TEST_STATE_VERSION} QtiTestState.`;
2883
+ console.warn(`[qti-test] ${message}`);
2884
+ if (this.#ready)
2885
+ dispatchPublic(this, "qc-test-state-refused", { message, state: value });
2886
+ else
2887
+ this.#refused = { message, state: value };
2877
2888
  return;
2878
2889
  }
2879
2890
  if (!this.#ready) {
@@ -4077,4 +4088,4 @@ export {
4077
4088
  * Portions Copyright (c) 2013, the Dart project authors.
4078
4089
  *)
4079
4090
  */
4080
- //# sourceMappingURL=chunk-IJKHXJSM.js.map
4091
+ //# sourceMappingURL=chunk-2NHZOI3W.js.map