@citolab/qti-components 10.0.0-next.15 → 10.0.0-next.16

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.
Files changed (62) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +1535 -2737
  3. package/dist/base.d.ts +31 -7
  4. package/dist/base.js +7 -1
  5. package/dist/{chunk-IWNRQVNW.js → chunk-4DC5Z2LQ.js} +2 -2
  6. package/dist/{chunk-G2EIC7H2.js → chunk-7MYZHZWV.js} +955 -364
  7. package/dist/chunk-7MYZHZWV.js.map +1 -0
  8. package/dist/{chunk-URYYGVTA.js → chunk-H3Z3TMFB.js} +55 -60
  9. package/dist/chunk-H3Z3TMFB.js.map +1 -0
  10. package/dist/{chunk-F553IZPL.js → chunk-J3F3JSCW.js} +2 -2
  11. package/dist/{chunk-32PI7KWX.js → chunk-L3LBSAGZ.js} +2 -2
  12. package/dist/{chunk-WIUPAUJV.js → chunk-L7J2ZOJL.js} +2 -2
  13. package/dist/{chunk-MIQZBDTB.js → chunk-LQ65RILE.js} +140 -105
  14. package/dist/chunk-LQ65RILE.js.map +1 -0
  15. package/dist/{chunk-QT7WQXCS.js → chunk-M4TZIB3W.js} +33 -37
  16. package/dist/chunk-M4TZIB3W.js.map +1 -0
  17. package/dist/{chunk-HT3LSWXL.js → chunk-NWSDBYK7.js} +2 -2
  18. package/dist/{chunk-IM5AKPIJ.js → chunk-NZ7ZC4SP.js} +96 -4
  19. package/dist/chunk-NZ7ZC4SP.js.map +1 -0
  20. package/dist/{chunk-XY5DHYIH.js → chunk-OG5HIRHE.js} +3 -3
  21. package/dist/{chunk-5AJZGRWI.js → chunk-UDJ7MHLF.js} +4 -4
  22. package/dist/chunk-UDJ7MHLF.js.map +1 -0
  23. package/dist/chunk-WWY2H2YO.js +7 -0
  24. package/dist/chunk-WWY2H2YO.js.map +1 -0
  25. package/dist/{computed.types.d-IXACuBr7.d.ts → computed.types.d-n3K2VvB0.d.ts} +2 -2
  26. package/dist/corrections.d.ts +117 -13
  27. package/dist/corrections.js +8 -8
  28. package/dist/elements.d.ts +44 -21
  29. package/dist/elements.js +3 -3
  30. package/dist/index.d.ts +8 -8
  31. package/dist/index.js +19 -13
  32. package/dist/interactions.d.ts +82 -16
  33. package/dist/interactions.js +3 -3
  34. package/dist/item.css +1057 -2383
  35. package/dist/item.d.ts +3 -3
  36. package/dist/item.js +4 -4
  37. package/dist/loader.d.ts +1 -1
  38. package/dist/processing.js +3 -3
  39. package/dist/qti-components-jsx.d.ts +1198 -201
  40. package/dist/{qti-feedback.d-GAqMqAt6.d.ts → qti-feedback.d-1JL_qHjc.d.ts} +1 -1
  41. package/dist/{qti-item.d-pFcNk0th.d.ts → qti-item.d-DDMDjWIk.d.ts} +1 -1
  42. package/dist/{qti-test.d-BjhVQnQy.d.ts → qti-test.d-CDdyCp6e.d.ts} +19 -16
  43. package/dist/{qti-text-entry-interaction.d-DECzpIzi.d.ts → qti-text-entry-interaction.d-BTAKmr4b.d.ts} +142 -42
  44. package/dist/{record.d-CljDLwRz.d.ts → record.d-Bojj6_LW.d.ts} +33 -2
  45. package/dist/{session.context.d-DW09Lrie.d.ts → session.context.d-BNxGeyh9.d.ts} +1 -1
  46. package/dist/test.d.ts +7 -7
  47. package/dist/test.js +5 -5
  48. package/package.json +9 -9
  49. package/dist/chunk-5AJZGRWI.js.map +0 -1
  50. package/dist/chunk-G2EIC7H2.js.map +0 -1
  51. package/dist/chunk-IM5AKPIJ.js.map +0 -1
  52. package/dist/chunk-MIQZBDTB.js.map +0 -1
  53. package/dist/chunk-QT7WQXCS.js.map +0 -1
  54. package/dist/chunk-RNLSNH4N.js +0 -7
  55. package/dist/chunk-RNLSNH4N.js.map +0 -1
  56. package/dist/chunk-URYYGVTA.js.map +0 -1
  57. /package/dist/{chunk-IWNRQVNW.js.map → chunk-4DC5Z2LQ.js.map} +0 -0
  58. /package/dist/{chunk-F553IZPL.js.map → chunk-J3F3JSCW.js.map} +0 -0
  59. /package/dist/{chunk-32PI7KWX.js.map → chunk-L3LBSAGZ.js.map} +0 -0
  60. /package/dist/{chunk-WIUPAUJV.js.map → chunk-L7J2ZOJL.js.map} +0 -0
  61. /package/dist/{chunk-HT3LSWXL.js.map → chunk-NWSDBYK7.js.map} +0 -0
  62. /package/dist/{chunk-XY5DHYIH.js.map → chunk-OG5HIRHE.js.map} +0 -0
@@ -3,10 +3,10 @@ import {
3
3
  dispatchDeclared,
4
4
  listenDeclared,
5
5
  listenPublic
6
- } from "./chunk-QT7WQXCS.js";
6
+ } from "./chunk-M4TZIB3W.js";
7
7
  import {
8
8
  item_css_default
9
- } from "./chunk-RNLSNH4N.js";
9
+ } from "./chunk-WWY2H2YO.js";
10
10
  import {
11
11
  watch
12
12
  } from "./chunk-4DB4SC5K.js";
@@ -25,7 +25,7 @@ import {
25
25
  qtiContext,
26
26
  sessionContext,
27
27
  testContext
28
- } from "./chunk-IM5AKPIJ.js";
28
+ } from "./chunk-NZ7ZC4SP.js";
29
29
 
30
30
  // ../qti-test/dist/components/qti-assessment-item-ref/qti-assessment-item-ref.js
31
31
  import { LitElement, nothing as nothing2 } from "lit";
@@ -1106,26 +1106,22 @@ var testHostContext = createContext(/* @__PURE__ */ Symbol("testHost"));
1106
1106
 
1107
1107
  // ../qti-test/dist/public-events.js
1108
1108
  var PUBLIC_EVENTS = {
1109
- "cito-test-navigate": { kind: "request", scope: "test", deprecated: "qti-request-navigation" },
1110
- "cito-test-end-attempt": { kind: "request", scope: "test", deprecated: "test-end-attempt" },
1111
- "cito-test-submit": { kind: "request", scope: "test" },
1112
- "cito-test-update-outcome": { kind: "request", scope: "test", deprecated: "test-update-outcome-variable" },
1113
- "cito-test-update-plugin-state": { kind: "request", scope: "test" },
1114
- "cito-test-switch-view": { kind: "request", scope: "test", deprecated: "on-test-switch-view" },
1115
- "cito-test-submitted": { kind: "notification", scope: "test" },
1116
- "cito-test-navigated": { kind: "notification", scope: "test" },
1117
- "cito-test-navigation-started": {
1118
- kind: "notification",
1119
- scope: "test",
1120
- deprecated: "qti-navigation-loading-started"
1121
- },
1122
- "cito-test-navigation-failed": { kind: "notification", scope: "test", deprecated: "qti-navigation-error" },
1123
- "cito-test-rendered": { kind: "notification", scope: "test", deprecated: "qti-test-loaded" },
1124
- "cito-test-loaded": { kind: "notification", scope: "test", deprecated: "qti-assessment-test-connected" },
1125
- "cito-test-state-changed": { kind: "notification", scope: "test", deprecated: "qti-state-changed" },
1126
- "cito-test-items-skipped": { kind: "notification", scope: "test" },
1127
- "cito-test-end-reached": { kind: "notification", scope: "test" },
1128
- "cito-item-ref-connected": { kind: "notification", scope: "item", deprecated: "qti-assessment-item-ref-connected" }
1109
+ "qc-test-navigate": { kind: "request", scope: "test", deprecated: "cito-test-navigate" },
1110
+ "qc-test-end-attempt": { kind: "request", scope: "test", deprecated: "cito-test-end-attempt" },
1111
+ "qc-test-submit": { kind: "request", scope: "test", deprecated: "cito-test-submit" },
1112
+ "qc-test-update-outcome": { kind: "request", scope: "test", deprecated: "cito-test-update-outcome" },
1113
+ "qc-test-update-plugin-state": { kind: "request", scope: "test", deprecated: "cito-test-update-plugin-state" },
1114
+ "qc-test-switch-view": { kind: "request", scope: "test", deprecated: "cito-test-switch-view" },
1115
+ "qc-test-submitted": { kind: "notification", scope: "test", deprecated: "cito-test-submitted" },
1116
+ "qc-test-navigated": { kind: "notification", scope: "test", deprecated: "cito-test-navigated" },
1117
+ "qc-test-navigation-started": { kind: "notification", scope: "test", deprecated: "cito-test-navigation-started" },
1118
+ "qc-test-navigation-failed": { kind: "notification", scope: "test", deprecated: "cito-test-navigation-failed" },
1119
+ "qc-test-rendered": { kind: "notification", scope: "test", deprecated: "cito-test-rendered" },
1120
+ "qc-test-loaded": { kind: "notification", scope: "test", deprecated: "cito-test-loaded" },
1121
+ "qc-test-state-changed": { kind: "notification", scope: "test", deprecated: "cito-test-state-changed" },
1122
+ "qc-test-items-skipped": { kind: "notification", scope: "test", deprecated: "cito-test-items-skipped" },
1123
+ "qc-test-end-reached": { kind: "notification", scope: "test", deprecated: "cito-test-end-reached" },
1124
+ "qc-item-ref-connected": { kind: "notification", scope: "item", deprecated: "cito-item-ref-connected" }
1129
1125
  };
1130
1126
  function dispatchPublic(target, name, detail) {
1131
1127
  dispatchDeclared(target, PUBLIC_EVENTS, name, detail);
@@ -1195,7 +1191,7 @@ var QtiAssessmentItemRef = class extends LitElement {
1195
1191
  this.myTemplate = templateElement ? prepareTemplate(templateElement) : null;
1196
1192
  this.requestUpdate();
1197
1193
  await this.updateComplete;
1198
- dispatchPublic(this, "cito-item-ref-connected", {
1194
+ dispatchPublic(this, "qc-item-ref-connected", {
1199
1195
  identifier: this.identifier,
1200
1196
  href: this.href,
1201
1197
  category: this.category
@@ -1360,7 +1356,7 @@ var QtiAssessmentTest = class extends LitElement3 {
1360
1356
  async connectedCallback() {
1361
1357
  super.connectedCallback();
1362
1358
  await this.updateComplete;
1363
- dispatchPublic(this, "cito-test-loaded", this);
1359
+ dispatchPublic(this, "qc-test-loaded", this);
1364
1360
  }
1365
1361
  render() {
1366
1362
  return html2` <slot></slot>`;
@@ -1538,7 +1534,7 @@ var QtiNumberPresented = class extends QtiExpression {
1538
1534
  #connectedTest = null;
1539
1535
  constructor() {
1540
1536
  super();
1541
- listenPublic2(this, "cito-test-loaded", (e) => this.#connectedTest = e.detail);
1537
+ listenPublic2(this, "qc-test-loaded", (e) => this.#connectedTest = e.detail);
1542
1538
  }
1543
1539
  /** The test this expression is in: handed over by a test harness, or found up the tree in a real document. */
1544
1540
  get #testElement() {
@@ -1569,10 +1565,10 @@ var QtiNumberSelected = class extends QtiExpression {
1569
1565
  #connectedTest = null;
1570
1566
  constructor() {
1571
1567
  super();
1572
- listenPublic2(this, "cito-test-loaded", (e) => this.#connectedTest = e.detail);
1568
+ listenPublic2(this, "qc-test-loaded", (e) => this.#connectedTest = e.detail);
1573
1569
  }
1574
1570
  /**
1575
- * `qti-assessment-test-connected` bubbles *up* from the test element, and this
1571
+ * `qc-test-loaded` bubbles *up* from the test element, and this
1576
1572
  * expression lives inside that test's `qti-outcome-processing` — so the
1577
1573
  * listener above only ever fires for a test handed to us directly (a test
1578
1574
  * harness). Walking up the tree is what resolves the test in a real document.
@@ -1747,10 +1743,10 @@ var QtiTestVariables = class extends QtiExpression {
1747
1743
  #connectedTest = null;
1748
1744
  constructor() {
1749
1745
  super();
1750
- listenPublic2(this, "cito-test-loaded", (e) => this.#connectedTest = e.detail);
1746
+ listenPublic2(this, "qc-test-loaded", (e) => this.#connectedTest = e.detail);
1751
1747
  }
1752
1748
  /**
1753
- * `qti-assessment-test-connected` bubbles *up* from the test element, and this
1749
+ * `qc-test-loaded` bubbles *up* from the test element, and this
1754
1750
  * expression lives inside that test's `qti-outcome-processing` — so the
1755
1751
  * listener above only ever fires for a test handed to us directly (a test
1756
1752
  * harness). Walking up the tree is what resolves the test in a real document.
@@ -1948,15 +1944,15 @@ var TestNavigationMixin = (superClass) => {
1948
1944
  navigateTo(type, id) {
1949
1945
  const targetId = id || this._getDefaultNavigationId(type);
1950
1946
  if (targetId) {
1951
- dispatchPublic(this, "cito-test-navigate", { type, id: targetId });
1947
+ dispatchPublic(this, "qc-test-navigate", { type, id: targetId });
1952
1948
  }
1953
1949
  }
1954
1950
  // ===========================================
1955
1951
  // EVENT HANDLER SETUP
1956
1952
  // ===========================================
1957
1953
  _bindEventHandlers() {
1958
- listenPublic2(this, "cito-test-navigate", this._handleNavigationRequest.bind(this));
1959
- listenPublic2(this, "cito-test-loaded", this._handleTestConnected.bind(this));
1954
+ listenPublic2(this, "qc-test-navigate", this._handleNavigationRequest.bind(this));
1955
+ listenPublic2(this, "qc-test-loaded", this._handleTestConnected.bind(this));
1960
1956
  this.addEventListener("qti-assessment-item-connected", this._handleItemConnected.bind(this));
1961
1957
  this.addEventListener("qti-assessment-stimulus-ref-connected", this._handleStimulusRefConnected.bind(this));
1962
1958
  }
@@ -2033,9 +2029,9 @@ var TestNavigationMixin = (superClass) => {
2033
2029
  if (refs[0]?.closest("qti-test-part")?.getAttribute("navigation-mode") === "linear") {
2034
2030
  const first = resolveFirstItem(refs);
2035
2031
  if (first.skipped.length)
2036
- dispatchPublic(this, "cito-test-items-skipped", { ids: first.skipped });
2032
+ dispatchPublic(this, "qc-test-items-skipped", { ids: first.skipped });
2037
2033
  if (first.id === null) {
2038
- dispatchPublic(this, "cito-test-end-reached", {});
2034
+ dispatchPublic(this, "qc-test-end-reached", {});
2039
2035
  return;
2040
2036
  }
2041
2037
  id = first.id;
@@ -2100,8 +2096,8 @@ var TestNavigationMixin = (superClass) => {
2100
2096
  const resolved = this._resolveLinearNext(detail.type, detail.id);
2101
2097
  if (resolved?.id === null) {
2102
2098
  if (resolved.skipped.length)
2103
- dispatchPublic(this, "cito-test-items-skipped", { ids: resolved.skipped });
2104
- dispatchPublic(this, "cito-test-end-reached", {});
2099
+ dispatchPublic(this, "qc-test-items-skipped", { ids: resolved.skipped });
2100
+ dispatchPublic(this, "qc-test-end-reached", {});
2105
2101
  return;
2106
2102
  }
2107
2103
  const target = resolved?.id ?? detail.id;
@@ -2117,7 +2113,7 @@ var TestNavigationMixin = (superClass) => {
2117
2113
  this._activeController = controller;
2118
2114
  await this._executeNavigation(detail.type, target, navigationId, controller);
2119
2115
  if (resolved?.skipped.length && navigationId === this._navigationId && !controller.signal.aborted) {
2120
- dispatchPublic(this, "cito-test-items-skipped", { ids: resolved.skipped });
2116
+ dispatchPublic(this, "qc-test-items-skipped", { ids: resolved.skipped });
2121
2117
  }
2122
2118
  } catch (error) {
2123
2119
  this._handleNavigationError(error, detail.type, target);
@@ -2396,7 +2392,7 @@ var TestNavigationMixin = (superClass) => {
2396
2392
  // EVENT DISPATCHING
2397
2393
  // ===========================================
2398
2394
  _dispatchLoadingStarted(type, id) {
2399
- dispatchPublic(this, "cito-test-navigation-started", { type, id });
2395
+ dispatchPublic(this, "qc-test-navigation-started", { type, id });
2400
2396
  }
2401
2397
  _dispatchLoadingEnded(type, id) {
2402
2398
  this.dispatchEvent(new CustomEvent("qti-navigation-loading-ended", {
@@ -2406,16 +2402,16 @@ var TestNavigationMixin = (superClass) => {
2406
2402
  }));
2407
2403
  }
2408
2404
  _dispatchError(error) {
2409
- dispatchPublic(this, "cito-test-navigation-failed", error);
2405
+ dispatchPublic(this, "qc-test-navigation-failed", error);
2410
2406
  }
2411
- /** The items are in the DOM: tell hosts the new position rendered (`cito-test-navigated`) and which items it holds. */
2407
+ /** The items are in the DOM: tell hosts the new position rendered (`qc-test-navigated`) and which items it holds. */
2412
2408
  _dispatchTestLoaded(results, type, id) {
2413
2409
  requestAnimationFrame(() => {
2414
- dispatchPublic(this, "cito-test-rendered", results.map(({ itemRef }) => ({
2410
+ dispatchPublic(this, "qc-test-rendered", results.map(({ itemRef }) => ({
2415
2411
  identifier: itemRef?.identifier,
2416
2412
  element: itemRef
2417
2413
  })));
2418
- dispatchPublic(this, "cito-test-navigated", { type, id });
2414
+ dispatchPublic(this, "qc-test-navigated", { type, id });
2419
2415
  });
2420
2416
  }
2421
2417
  }
@@ -2440,11 +2436,11 @@ var TestViewMixin = (superClass) => {
2440
2436
  constructor(...args) {
2441
2437
  super(...args);
2442
2438
  this.sessionContext = { ...this.sessionContext, view: "candidate" };
2443
- listenPublic2(this, "cito-test-switch-view", (e) => {
2439
+ listenPublic2(this, "qc-test-switch-view", (e) => {
2444
2440
  this.sessionContext = { ...this.sessionContext, view: e.detail };
2445
2441
  this._updateElementView();
2446
2442
  });
2447
- listenPublic2(this, "cito-test-loaded", () => {
2443
+ listenPublic2(this, "qc-test-loaded", () => {
2448
2444
  this._updateElementView();
2449
2445
  });
2450
2446
  this.addEventListener("qti-assessment-item-connected", (e) => {
@@ -2537,7 +2533,7 @@ var TestBaseMixin = (superClass) => {
2537
2533
  * before the item has loaded. To restore a whole session, assign `state` instead.
2538
2534
  *
2539
2535
  * The test context is replaced rather than changed in place, so its consumers update and
2540
- * `qti-state-changed` fires.
2536
+ * `qc-test-state-changed` fires.
2541
2537
  *
2542
2538
  * @param itemRefID The `qti-assessment-item-ref` identifier, not the item's own identifier.
2543
2539
  * @param state Opaque per-interaction state keyed by response identifier, e.g. a PCI's `getState()`.
@@ -2577,7 +2573,7 @@ var TestBaseMixin = (superClass) => {
2577
2573
  this.testContext = INITIAL_TEST_CONTEXT;
2578
2574
  this.sessionContext = INITIAL_SESSION_CONTEXT;
2579
2575
  });
2580
- listenPublic2(this, "cito-test-loaded", (e) => {
2576
+ listenPublic2(this, "qc-test-loaded", (e) => {
2581
2577
  this._testElement = e.detail;
2582
2578
  const items = Array.from(this._testElement.querySelectorAll("qti-assessment-item-ref")).map((itemRef) => {
2583
2579
  return {
@@ -2703,8 +2699,8 @@ var TestStateMixin = (superClass) => {
2703
2699
  this.#ready = false;
2704
2700
  this.#lastEmitted = null;
2705
2701
  });
2706
- listenPublic2(this, "cito-test-update-plugin-state", ({ detail }) => this.#updatePluginState(detail));
2707
- listenPublic2(this, "cito-test-loaded", () => {
2702
+ listenPublic2(this, "qc-test-update-plugin-state", ({ detail }) => this.#updatePluginState(detail));
2703
+ listenPublic2(this, "qc-test-loaded", () => {
2708
2704
  if (this.#pending) {
2709
2705
  this.#apply(this.#pending);
2710
2706
  this.#pending = null;
@@ -2758,7 +2754,7 @@ var TestStateMixin = (superClass) => {
2758
2754
  if (serialized === this.#lastEmitted)
2759
2755
  return;
2760
2756
  this.#lastEmitted = serialized;
2761
- dispatchPublic(this, "cito-test-state-changed", state10);
2757
+ dispatchPublic(this, "qc-test-state-changed", state10);
2762
2758
  }
2763
2759
  #apply(state10) {
2764
2760
  for (const saved of state10.test.items)
@@ -2784,7 +2780,7 @@ var TestStateMixin = (superClass) => {
2784
2780
  };
2785
2781
  }
2786
2782
  #requestNavigation(type, id) {
2787
- dispatchPublic(this, "cito-test-navigate", { type, id });
2783
+ dispatchPublic(this, "qc-test-navigate", { type, id });
2788
2784
  }
2789
2785
  }
2790
2786
  return TestStateClass;
@@ -2802,7 +2798,7 @@ var TestProcessingMixin = (superClass) => {
2802
2798
  };
2803
2799
  e.stopPropagation();
2804
2800
  });
2805
- listenPublic2(this, "cito-test-submit", () => this.submit());
2801
+ listenPublic2(this, "qc-test-submit", () => this.submit());
2806
2802
  this.addEventListener("qti-set-outcome-value", (e) => {
2807
2803
  const { outcomeIdentifier, value } = e.detail;
2808
2804
  this.updateOutcomeVariable(outcomeIdentifier, value);
@@ -2825,12 +2821,12 @@ var TestProcessingMixin = (superClass) => {
2825
2821
  }
2826
2822
  /**
2827
2823
  * Ends the test for scoring: runs `outcomeProcessing()`, then tells the host with
2828
- * `cito-test-submitted`. Returns false, and sends nothing, when the test has no outcome processing.
2824
+ * `qc-test-submitted`. Returns false, and sends nothing, when the test has no outcome processing.
2829
2825
  */
2830
2826
  submit() {
2831
2827
  if (!this.outcomeProcessing())
2832
2828
  return false;
2833
- dispatchPublic(this, "cito-test-submitted", {});
2829
+ dispatchPublic(this, "qc-test-submitted", {});
2834
2830
  return true;
2835
2831
  }
2836
2832
  /**
@@ -2976,7 +2972,7 @@ var TestContainer = class extends LitElement11 {
2976
2972
  * Assign a new test document and announce it.
2977
2973
  *
2978
2974
  * The announcement has to happen here rather than on
2979
- * `qti-assessment-test-connected`, because by then the new document's
2975
+ * `qc-test-loaded`, because by then the new document's
2980
2976
  * children have already connected and registered themselves — a host that
2981
2977
  * resets its context on that event throws those registrations away. Lit's
2982
2978
  * re-render is async, so a handler running now still gets in before any child
@@ -3060,15 +3056,17 @@ import { consume as consume7 } from "@lit/context";
3060
3056
 
3061
3057
  // ../qti-test/dist/components/styles.js
3062
3058
  import { css as css5, html as html11 } from "lit";
3063
- var surface = css5`var(--qti-color-base-100, var(--cito-color-base-100, Canvas))`;
3064
- var content = css5`var(--qti-color-base-content, var(--cito-color-base-content, CanvasText))`;
3065
- var neutral = css5`var(--qti-color-neutral, var(--cito-color-neutral, CanvasText))`;
3066
- var neutralContent = css5`var(--qti-color-neutral-content, var(--cito-color-neutral-content, Canvas))`;
3059
+ var surface = css5`var(--qti-color-base-100, var(--qc-color-base-100, var(--cito-color-base-100, Canvas)))`;
3060
+ var content = css5`var(--qti-color-base-content, var(--qc-color-base-content, var(--cito-color-base-content, CanvasText)))`;
3061
+ var neutral = css5`var(--qti-color-neutral, var(--qc-color-neutral, var(--cito-color-neutral, CanvasText)))`;
3062
+ var neutralContent = css5`var(--qti-color-neutral-content, var(--qc-color-neutral-content, var(--cito-color-neutral-content, Canvas)))`;
3063
+ var radius = css5`var(--button-border-radius, var(--test-button-border-radius, var(--qti-radius-field, var(--qc-radius-field, var(--cito-radius-field, 0.2rem)))))`;
3064
+ var borderWidth = css5`var(--qti-border-width, var(--qc-border-width, var(--cito-border-width, 1px)))`;
3067
3065
  var hostBox = css5`
3068
3066
  display: inline-flex;
3069
3067
  cursor: pointer;
3070
3068
  user-select: none;
3071
- border-radius: var(--test-button-border-radius, var(--qti-radius-field, var(--cito-radius-field, 0.2rem)));
3069
+ border-radius: ${radius};
3072
3070
  `;
3073
3071
  var form = css5`
3074
3072
  display: flex;
@@ -3077,48 +3075,57 @@ var form = css5`
3077
3075
  justify-content: center;
3078
3076
  gap: 0.375em;
3079
3077
  box-sizing: border-box;
3080
- min-block-size: var(--test-button-size, 2.25rem);
3078
+ min-block-size: var(--button-size, var(--test-button-size, 2.25rem));
3081
3079
  padding: 0 0.875rem;
3082
3080
  font: inherit;
3083
3081
  line-height: 1.25;
3084
3082
  cursor: pointer;
3085
3083
  user-select: none;
3086
- border-radius: var(--test-button-border-radius, var(--qti-radius-field, var(--cito-radius-field, 0.2rem)));
3084
+ border-radius: ${radius};
3087
3085
  `;
3088
3086
  var btn = css5`
3089
3087
  ${form};
3090
- background-color: var(--test-button-background-color, ${surface});
3091
- color: var(--test-button-color, inherit);
3092
- border: var(--qti-border-width, var(--cito-border-width, 1px)) solid
3093
- var(--test-button-border-color, var(--qti-border-color, color-mix(in oklab, ${content} 45%, ${surface})));
3088
+ background-color: var(--button-background-color, var(--test-button-background-color, ${surface}));
3089
+ color: var(--button-color, var(--test-button-color, inherit));
3090
+ border: ${borderWidth} solid
3091
+ var(
3092
+ --button-border-color,
3093
+ var(--test-button-border-color, var(--qti-border-color, color-mix(in oklab, ${content} 45%, ${surface})))
3094
+ );
3094
3095
  `;
3095
3096
  var btnPrimary = css5`
3096
- background-color: var(--test-button-primary-background-color, ${neutral});
3097
- color: var(--test-button-primary-color, ${neutralContent});
3098
- border-color: var(--test-button-primary-background-color, ${neutral});
3097
+ background-color: var(--button-primary-background-color, var(--test-button-primary-background-color, ${neutral}));
3098
+ color: var(--button-primary-color, var(--test-button-primary-color, ${neutralContent}));
3099
+ border-color: var(--button-primary-background-color, var(--test-button-primary-background-color, ${neutral}));
3099
3100
  `;
3100
3101
  var btnInteractive = css5`
3101
3102
  background-color: var(
3102
- --test-button-hover-background-color,
3103
- color-mix(in oklab, ${surface}, ${content} var(--qti-hover-mix, 8%))
3103
+ --button-hover-background-color,
3104
+ var(--test-button-hover-background-color, color-mix(in oklab, ${surface}, ${content} var(--qti-hover-mix, 8%)))
3104
3105
  );
3105
3106
  `;
3106
3107
  var btnPrimaryInteractive = css5`
3107
3108
  background-color: var(
3108
- --test-button-primary-hover-background-color,
3109
- color-mix(in oklab, ${neutral}, ${neutralContent} var(--qti-hover-mix, 8%))
3109
+ --button-primary-hover-background-color,
3110
+ var(
3111
+ --test-button-primary-hover-background-color,
3112
+ color-mix(in oklab, ${neutral}, ${neutralContent} var(--qti-hover-mix, 8%))
3113
+ )
3110
3114
  );
3111
3115
  `;
3112
3116
  var btnActive = css5`
3113
3117
  background-color: var(
3114
- --test-button-active-background-color,
3115
- color-mix(in oklab, ${surface}, ${content} var(--qti-active-mix, 16%))
3118
+ --button-active-background-color,
3119
+ var(--test-button-active-background-color, color-mix(in oklab, ${surface}, ${content} var(--qti-active-mix, 16%)))
3116
3120
  );
3117
3121
  `;
3118
3122
  var btnPrimaryActive = css5`
3119
3123
  background-color: var(
3120
- --test-button-primary-active-background-color,
3121
- color-mix(in oklab, ${neutral}, ${neutralContent} var(--qti-active-mix, 16%))
3124
+ --button-primary-active-background-color,
3125
+ var(
3126
+ --test-button-primary-active-background-color,
3127
+ color-mix(in oklab, ${neutral}, ${neutralContent} var(--qti-active-mix, 16%))
3128
+ )
3122
3129
  );
3123
3130
  `;
3124
3131
  var focusRing = css5`
@@ -3131,7 +3138,7 @@ var dis = css5`
3131
3138
  `;
3132
3139
  var ind = css5`
3133
3140
  ${form};
3134
- border: var(--qti-border-width, var(--cito-border-width, 1px)) solid var(--qti-border-color, GrayText);
3141
+ border: ${borderWidth} solid var(--qti-border-color, GrayText);
3135
3142
  `;
3136
3143
  var control = html11`<span class="control" part="button"><slot></slot></span>`;
3137
3144
  var button = css5`
@@ -3149,6 +3156,16 @@ var button = css5`
3149
3156
  :host(:active:not([disabled])) .control {
3150
3157
  ${btnActive};
3151
3158
  }
3159
+ /* The press the theme gives a choice (qti-motion.css), from the same knob: a touch smaller while
3160
+ the button is down, springing back on release; 0 motion means no press. */
3161
+ .control {
3162
+ transition:
3163
+ background-color calc(200ms * var(--qti-motion, 1)) cubic-bezier(0.2, 0, 0, 1),
3164
+ scale calc(200ms * var(--qti-motion, 1)) cubic-bezier(0.2, 0, 0, 1);
3165
+ }
3166
+ :host(:active:not([disabled])) .control {
3167
+ scale: calc(1 - 0.03 * var(--qti-motion, 1));
3168
+ }
3152
3169
  :host(:focus-visible) {
3153
3170
  ${focusRing};
3154
3171
  }
@@ -3204,7 +3221,7 @@ var TestEndAttempt = class extends LitElement12 {
3204
3221
  e.preventDefault();
3205
3222
  if (!this._internalDisabled) {
3206
3223
  const itemId = this.#ownItem;
3207
- dispatchPublic(this, "cito-test-end-attempt", itemId ? { itemId } : {});
3224
+ dispatchPublic(this, "qc-test-end-attempt", itemId ? { itemId } : {});
3208
3225
  }
3209
3226
  });
3210
3227
  }
@@ -3286,7 +3303,7 @@ var TestItemLink = class extends LitElement13 {
3286
3303
  this.addEventListener("click", () => this._requestItem(this.itemId));
3287
3304
  }
3288
3305
  _requestItem(identifier) {
3289
- dispatchPublic(this, "cito-test-navigate", { type: "item", id: identifier });
3306
+ dispatchPublic(this, "qc-test-navigate", { type: "item", id: identifier });
3290
3307
  }
3291
3308
  render() {
3292
3309
  return control;
@@ -3374,12 +3391,12 @@ var TestNavigation = class extends LitElement14 {
3374
3391
  this.#optimality = /* @__PURE__ */ new Map();
3375
3392
  this.#itemElement = (identifier) => this.#assessmentItemFor(identifier) ?? null;
3376
3393
  this.#lockedItems = /* @__PURE__ */ new WeakSet();
3377
- listenPublic2(this, "cito-test-loaded", this.#handleTestConnected.bind(this));
3394
+ listenPublic2(this, "qc-test-loaded", this.#handleTestConnected.bind(this));
3378
3395
  this.addEventListener("qti-assessment-item-connected", this.#handleItemConnected.bind(this));
3379
- listenPublic(this, "cito-item-response-changed", this.#handleInteractionChanged.bind(this));
3396
+ listenPublic(this, "qc-item-response-changed", this.#handleInteractionChanged.bind(this));
3380
3397
  this.addEventListener("qti-item-context-updated", this.#handleItemContextUpdated.bind(this));
3381
- listenPublic2(this, "cito-test-end-attempt", this.#handleTestEndAttempt.bind(this));
3382
- listenPublic2(this, "cito-test-update-outcome", this.#handleTestUpdateOutcomeVariable.bind(this));
3398
+ listenPublic2(this, "qc-test-end-attempt", this.#handleTestEndAttempt.bind(this));
3399
+ listenPublic2(this, "qc-test-update-outcome", this.#handleTestUpdateOutcomeVariable.bind(this));
3383
3400
  }
3384
3401
  /**
3385
3402
  * Latch whether an item reached its optimal outcome whenever it has just ended
@@ -3955,7 +3972,7 @@ var TestNext = class extends LitElement15 {
3955
3972
  this._internalDisabled = !this.computedContext || this.itemIndex < 0 || this.itemIndex >= (this.sectionItems?.length ?? 0) - 1 || isLinearIndividual && !activeItem?.done;
3956
3973
  }
3957
3974
  _requestItem(identifier) {
3958
- dispatchPublic(this, "cito-test-navigate", { type: "item", id: identifier });
3975
+ dispatchPublic(this, "qc-test-navigate", { type: "item", id: identifier });
3959
3976
  }
3960
3977
  render() {
3961
3978
  return control;
@@ -4016,7 +4033,7 @@ var TestPrev = class extends LitElement16 {
4016
4033
  this._internalDisabled = navigationMode === "linear" || !this.computedContext || this.itemIndex === 0 || this.itemIndex === -1;
4017
4034
  }
4018
4035
  _requestItem(identifier) {
4019
- dispatchPublic(this, "cito-test-navigate", { type: "item", id: identifier });
4036
+ dispatchPublic(this, "qc-test-navigate", { type: "item", id: identifier });
4020
4037
  }
4021
4038
  render() {
4022
4039
  return control;
@@ -4046,7 +4063,7 @@ var TestSectionLink = class extends LitElement17 {
4046
4063
  this.styles = button;
4047
4064
  }
4048
4065
  #requestItem(identifier) {
4049
- dispatchPublic(this, "cito-test-navigate", { type: "section", id: identifier });
4066
+ dispatchPublic(this, "qc-test-navigate", { type: "section", id: identifier });
4050
4067
  }
4051
4068
  constructor() {
4052
4069
  super();
@@ -4143,7 +4160,7 @@ var TestBookmark = class extends LitElement18 {
4143
4160
  return;
4144
4161
  const marked = bookmarkedItems(this.computedContext);
4145
4162
  const next = marked.includes(active) ? marked.filter((id) => id !== active) : [...marked, active];
4146
- dispatchPublic(this, "cito-test-update-plugin-state", {
4163
+ dispatchPublic(this, "qc-test-update-plugin-state", {
4147
4164
  plugin: "bookmarks",
4148
4165
  value: next.length > 0 ? next : null
4149
4166
  });
@@ -4185,8 +4202,8 @@ var TestCheckItem = class extends LitElement19 {
4185
4202
  super();
4186
4203
  this.view = "scorer";
4187
4204
  this.addEventListener("click", () => {
4188
- dispatchPublic(this, "cito-test-end-attempt", {});
4189
- dispatchPublic(this, "cito-test-switch-view", this.view);
4205
+ dispatchPublic(this, "qc-test-end-attempt", {});
4206
+ dispatchPublic(this, "qc-test-switch-view", this.view);
4190
4207
  });
4191
4208
  }
4192
4209
  render() {
@@ -4341,12 +4358,12 @@ var TestPrintState = class extends LitElement22 {
4341
4358
  connectedCallback() {
4342
4359
  super.connectedCallback();
4343
4360
  this.#test = this.closest("qti-test");
4344
- this.#test?.addEventListener("cito-test-state-changed", this.#onStateChanged);
4361
+ this.#test?.addEventListener("qc-test-state-changed", this.#onStateChanged);
4345
4362
  this.testState = this.#test?.state;
4346
4363
  }
4347
4364
  disconnectedCallback() {
4348
4365
  super.disconnectedCallback();
4349
- this.#test?.removeEventListener("cito-test-state-changed", this.#onStateChanged);
4366
+ this.#test?.removeEventListener("qc-test-state-changed", this.#onStateChanged);
4350
4367
  this.#test = null;
4351
4368
  }
4352
4369
  render() {
@@ -4407,7 +4424,7 @@ var TestScoringButtons = class extends LitElement23 {
4407
4424
  const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
4408
4425
  const sectionItems = testPart.sections.flatMap((section) => section.items);
4409
4426
  const currentItemIdentifier = sectionItems.find((item) => item.active)?.identifier;
4410
- dispatchPublic(this, "cito-test-update-outcome", {
4427
+ dispatchPublic(this, "qc-test-update-outcome", {
4411
4428
  assessmentItemRefId: currentItemIdentifier,
4412
4429
  outcomeVariableId: "SCORE",
4413
4430
  value
@@ -4598,7 +4615,7 @@ var TestSubmit = class extends LitElement26 {
4598
4615
  }
4599
4616
  constructor() {
4600
4617
  super();
4601
- this.addEventListener("click", () => dispatchPublic(this, "cito-test-submit", {}));
4618
+ this.addEventListener("click", () => dispatchPublic(this, "qc-test-submit", {}));
4602
4619
  }
4603
4620
  render() {
4604
4621
  return control;
@@ -4641,7 +4658,7 @@ var TestView = class extends LitElement27 {
4641
4658
  }
4642
4659
  }
4643
4660
  _switchView(view) {
4644
- dispatchPublic(this, "cito-test-switch-view", view);
4661
+ dispatchPublic(this, "qc-test-switch-view", view);
4645
4662
  }
4646
4663
  render() {
4647
4664
  return html20`
@@ -4699,7 +4716,7 @@ var TestViewToggle = class extends LitElement28 {
4699
4716
  this.myTemplate = prepareTemplate(templateElement);
4700
4717
  }
4701
4718
  _switchView(view) {
4702
- dispatchPublic(this, "cito-test-switch-view", view);
4719
+ dispatchPublic(this, "qc-test-switch-view", view);
4703
4720
  }
4704
4721
  firstUpdated(_changedProperties) {
4705
4722
  this.addEventListener("click", () => {
@@ -4739,11 +4756,11 @@ function getHighlightSheet() {
4739
4756
  highlightSheet = new CSSStyleSheet();
4740
4757
  highlightSheet.replaceSync(`
4741
4758
  ::highlight(${HIGHLIGHT_ELEMENT}) {
4742
- background-color: var(--test-tts-element-highlight, color-mix(in oklab, var(--qti-color-info, var(--cito-color-info, Highlight)) 15%, transparent));
4759
+ background-color: var(--test-tts-element-highlight, color-mix(in oklab, var(--qti-color-info, var(--qc-color-info, var(--cito-color-info, Highlight))) 15%, transparent));
4743
4760
  color: inherit;
4744
4761
  }
4745
4762
  ::highlight(${HIGHLIGHT_WORD}) {
4746
- background-color: var(--test-tts-word-highlight, color-mix(in oklab, var(--qti-color-warning, var(--cito-color-warning, Mark)) 55%, transparent));
4763
+ background-color: var(--test-tts-word-highlight, color-mix(in oklab, var(--qti-color-warning, var(--qc-color-warning, var(--cito-color-warning, Mark))) 55%, transparent));
4747
4764
  color: inherit;
4748
4765
  }
4749
4766
  `);
@@ -4773,7 +4790,7 @@ var TtsButtonBase = class extends LitElement29 {
4773
4790
  }
4774
4791
  button {
4775
4792
  ${btn};
4776
- min-inline-size: var(--test-button-size, 2.25rem);
4793
+ min-inline-size: var(--button-size, var(--test-button-size, 2.25rem));
4777
4794
  padding-inline: 0.5rem;
4778
4795
  /* Containing block for the visually hidden .label. Without it the label is placed against
4779
4796
  the nearest positioned ancestor, which can sit outside a scroll container and make the
@@ -4794,10 +4811,16 @@ var TtsButtonBase = class extends LitElement29 {
4794
4811
  button:disabled {
4795
4812
  ${dis};
4796
4813
  }
4814
+ /* A toggle that is on (the pick button in pick mode). The host carries :state(selected) for a
4815
+ page's own rules; in here the inner button's aria-pressed says the same thing and matches in
4816
+ a browser without :state(), so the look keys on that. */
4797
4817
  button[aria-pressed='true'],
4798
4818
  button[aria-pressed='true']:hover {
4799
- background-color: var(--test-button-selected-background-color, var(--qti-selected-bg, Highlight));
4800
- color: var(--test-button-selected-color, var(--qti-selected-color, HighlightText));
4819
+ background-color: var(
4820
+ --button-selected-background-color,
4821
+ var(--test-button-selected-background-color, var(--qti-selected-bg, Highlight))
4822
+ );
4823
+ color: var(--button-selected-color, var(--test-button-selected-color, var(--qti-selected-color, HighlightText)));
4801
4824
  }
4802
4825
  svg,
4803
4826
  ::slotted(svg) {
@@ -4822,18 +4845,27 @@ var TtsButtonBase = class extends LitElement29 {
4822
4845
  #internals = this.attachInternals();
4823
4846
  #mirroredState;
4824
4847
  #mirroredPicking = false;
4848
+ #mirroredSelected = false;
4849
+ /** Whether this control is a toggle that is on; mirrored as `:state(selected)`. A plain button never is. */
4850
+ get selected() {
4851
+ return false;
4852
+ }
4825
4853
  updated(_changed) {
4826
4854
  const state10 = this._tts?.state;
4827
4855
  const picking = this._tts?.picking ?? false;
4828
- if (state10 === this.#mirroredState && picking === this.#mirroredPicking)
4856
+ const selected = this.selected;
4857
+ if (state10 === this.#mirroredState && picking === this.#mirroredPicking && selected === this.#mirroredSelected)
4829
4858
  return;
4830
4859
  this.#mirroredState = state10;
4831
4860
  this.#mirroredPicking = picking;
4861
+ this.#mirroredSelected = selected;
4832
4862
  this.#internals.states.clear();
4833
4863
  if (state10)
4834
4864
  this.#internals.states.add(state10);
4835
4865
  if (picking)
4836
4866
  this.#internals.states.add("picking");
4867
+ if (selected)
4868
+ this.#internals.states.add("selected");
4837
4869
  }
4838
4870
  };
4839
4871
  __decorate30([
@@ -4979,8 +5011,8 @@ var TestItemToSpeech = class extends LitElement29 {
4979
5011
  this.#eventHost.addEventListener("qti-assessment-item-connected", this.#boundHandleItemConnected);
4980
5012
  } else {
4981
5013
  this.#eventHost = this.closest("test-navigation") ?? this.getRootNode();
5014
+ this.#eventHost.addEventListener("qc-test-navigate", this.#boundHandleNavigation);
4982
5015
  this.#eventHost.addEventListener("cito-test-navigate", this.#boundHandleNavigation);
4983
- this.#eventHost.addEventListener("qti-request-navigation", this.#boundHandleNavigation);
4984
5016
  }
4985
5017
  }
4986
5018
  disconnectedCallback() {
@@ -4992,8 +5024,8 @@ var TestItemToSpeech = class extends LitElement29 {
4992
5024
  this.#stopPicking();
4993
5025
  this.#clearAllHighlights();
4994
5026
  this.#eventHost?.removeEventListener("qti-assessment-item-connected", this.#boundHandleItemConnected);
5027
+ this.#eventHost?.removeEventListener("qc-test-navigate", this.#boundHandleNavigation);
4995
5028
  this.#eventHost?.removeEventListener("cito-test-navigate", this.#boundHandleNavigation);
4996
- this.#eventHost?.removeEventListener("qti-request-navigation", this.#boundHandleNavigation);
4997
5029
  this.#eventHost = null;
4998
5030
  this.#itemRef = null;
4999
5031
  this.#stimulusObserver?.disconnect();
@@ -5515,6 +5547,9 @@ var TestTtsNext = class extends TtsButtonBase {
5515
5547
  }
5516
5548
  };
5517
5549
  var TestTtsPick = class extends TtsButtonBase {
5550
+ get selected() {
5551
+ return this._tts?.picking ?? false;
5552
+ }
5518
5553
  render() {
5519
5554
  return html22`
5520
5555
  <button
@@ -5643,4 +5678,4 @@ export {
5643
5678
  * Portions Copyright (c) 2013, the Dart project authors.
5644
5679
  *)
5645
5680
  */
5646
- //# sourceMappingURL=chunk-MIQZBDTB.js.map
5681
+ //# sourceMappingURL=chunk-LQ65RILE.js.map