@citolab/qti-components 10.0.0-next.10 → 10.0.0-next.12

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 (37) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +1971 -641
  3. package/dist/{chunk-RRMCWCSA.js → chunk-5K5JO7OG.js} +119 -35
  4. package/dist/chunk-5K5JO7OG.js.map +1 -0
  5. package/dist/{chunk-CQ3WU35R.js → chunk-AJ5U5KXR.js} +2 -2
  6. package/dist/{chunk-Q3C7XFVS.js → chunk-AVZRY5SQ.js} +2 -2
  7. package/dist/{chunk-AHULN3UB.js → chunk-O76BOKAP.js} +108 -30
  8. package/dist/chunk-O76BOKAP.js.map +1 -0
  9. package/dist/{chunk-YYZCTIZY.js → chunk-OHRAG2UM.js} +14 -11
  10. package/dist/chunk-OHRAG2UM.js.map +1 -0
  11. package/dist/{chunk-WPILS3CW.js → chunk-PLP3YX6C.js} +2 -2
  12. package/dist/{chunk-3TUGZHKB.js → chunk-XXJAE6AP.js} +2 -2
  13. package/dist/chunk-YKXVAXSI.js +7 -0
  14. package/dist/chunk-YKXVAXSI.js.map +1 -0
  15. package/dist/corrections.d.ts +2 -2
  16. package/dist/corrections.js +5 -5
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.js +8 -8
  19. package/dist/interactions.d.ts +2 -2
  20. package/dist/interactions.js +2 -2
  21. package/dist/item.css +1579 -386
  22. package/dist/item.js +3 -3
  23. package/dist/qti-components-jsx.d.ts +6 -4
  24. package/dist/{qti-test.d-D-RYWphm.d.ts → qti-test.d-D5C7W8Lg.d.ts} +3 -2
  25. package/dist/{qti-text-entry-interaction.d-utFyp1DH.d.ts → qti-text-entry-interaction.d-CU-fAAD1.d.ts} +0 -1
  26. package/dist/test.d.ts +2 -2
  27. package/dist/test.js +3 -3
  28. package/package.json +5 -5
  29. package/dist/chunk-AHULN3UB.js.map +0 -1
  30. package/dist/chunk-QVZLJY75.js +0 -7
  31. package/dist/chunk-QVZLJY75.js.map +0 -1
  32. package/dist/chunk-RRMCWCSA.js.map +0 -1
  33. package/dist/chunk-YYZCTIZY.js.map +0 -1
  34. /package/dist/{chunk-CQ3WU35R.js.map → chunk-AJ5U5KXR.js.map} +0 -0
  35. /package/dist/{chunk-Q3C7XFVS.js.map → chunk-AVZRY5SQ.js.map} +0 -0
  36. /package/dist/{chunk-WPILS3CW.js.map → chunk-PLP3YX6C.js.map} +0 -0
  37. /package/dist/{chunk-3TUGZHKB.js.map → chunk-XXJAE6AP.js.map} +0 -0
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-YOCOLMGB.js";
7
7
  import {
8
8
  item_css_default
9
- } from "./chunk-QVZLJY75.js";
9
+ } from "./chunk-YKXVAXSI.js";
10
10
  import {
11
11
  watch
12
12
  } from "./chunk-4DB4SC5K.js";
@@ -2160,13 +2160,15 @@ var TestNavigationMixin = (superClass) => {
2160
2160
  async _navigateToSection(sectionId, navigationId, controller) {
2161
2161
  const sectionEl = this._findSection(sectionId);
2162
2162
  const navPartId = sectionEl?.closest("qti-test-part")?.identifier;
2163
+ const itemIds = this._getSectionItemIds(sectionId);
2163
2164
  this.sessionContext = {
2164
2165
  ...this.sessionContext,
2165
2166
  navPartId,
2166
2167
  navSectionId: sectionId,
2167
- navItemRefId: null
2168
+ // with navigate="item", the section's first item is the current position, so test-next/test-prev
2169
+ // and item highlights have an item to work from
2170
+ navItemRefId: this.navigate === "item" ? itemIds[0] ?? null : null
2168
2171
  };
2169
- const itemIds = this._getSectionItemIds(sectionId);
2170
2172
  this._resetLoadingState();
2171
2173
  this._loadingState.expectedItems = itemIds.length;
2172
2174
  await this._loadItems(itemIds, navigationId, controller);
@@ -3058,6 +3060,10 @@ import { consume as consume7 } from "@lit/context";
3058
3060
 
3059
3061
  // ../qti-test/dist/components/styles.js
3060
3062
  import { css as css5 } 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))`;
3061
3067
  var form = css5`
3062
3068
  display: inline-flex;
3063
3069
  align-items: center;
@@ -3070,21 +3076,47 @@ var form = css5`
3070
3076
  line-height: 1.25;
3071
3077
  cursor: pointer;
3072
3078
  user-select: none;
3073
- border-radius: var(--test-button-border-radius, var(--qti-component-border-radius, 0.2rem));
3079
+ border-radius: var(--test-button-border-radius, var(--qti-radius-field, var(--cito-radius-field, 0.2rem)));
3074
3080
  `;
3075
3081
  var btn = css5`
3076
3082
  ${form};
3077
- background-color: var(--test-button-background-color, var(--qti-component-background-color, #fff));
3078
- color: var(--test-button-color, var(--qti-component-color, inherit));
3079
- border: var(--qti-component-border-width, 1px) var(--qti-component-border-style, solid)
3080
- var(--test-button-border-color, var(--qti-component-border-color, #0175aa));
3083
+ background-color: var(--test-button-background-color, ${surface});
3084
+ color: var(--test-button-color, inherit);
3085
+ border: var(--qti-border-width, var(--cito-border-width, 1px)) solid
3086
+ var(--test-button-border-color, var(--qti-border-color, color-mix(in oklab, ${content} 45%, ${surface})));
3087
+ `;
3088
+ var btnPrimary = css5`
3089
+ background-color: var(--test-button-primary-background-color, ${neutral});
3090
+ color: var(--test-button-primary-color, ${neutralContent});
3091
+ border-color: var(--test-button-primary-background-color, ${neutral});
3081
3092
  `;
3082
3093
  var btnInteractive = css5`
3083
- background-color: var(--test-button-hover-background-color, var(--qti-bg-active, #f2f8fb));
3094
+ background-color: var(
3095
+ --test-button-hover-background-color,
3096
+ color-mix(in oklab, ${surface}, ${content} var(--qti-hover-mix, 8%))
3097
+ );
3098
+ `;
3099
+ var btnPrimaryInteractive = css5`
3100
+ background-color: var(
3101
+ --test-button-primary-hover-background-color,
3102
+ color-mix(in oklab, ${neutral}, ${neutralContent} var(--qti-hover-mix, 8%))
3103
+ );
3104
+ `;
3105
+ var btnActive = css5`
3106
+ background-color: var(
3107
+ --test-button-active-background-color,
3108
+ color-mix(in oklab, ${surface}, ${content} var(--qti-active-mix, 16%))
3109
+ );
3110
+ `;
3111
+ var btnPrimaryActive = css5`
3112
+ background-color: var(
3113
+ --test-button-primary-active-background-color,
3114
+ color-mix(in oklab, ${neutral}, ${neutralContent} var(--qti-active-mix, 16%))
3115
+ );
3084
3116
  `;
3085
3117
  var focusRing = css5`
3086
- outline: var(--qti-focus-border-width, 2px) solid var(--qti-focus-color, #007ac3);
3087
- outline-offset: 2px;
3118
+ outline: var(--qti-focus-border-width, 2px) solid var(--qti-focus-color, Highlight);
3119
+ outline-offset: var(--qti-focus-offset, 2px);
3088
3120
  `;
3089
3121
  var dis = css5`
3090
3122
  cursor: not-allowed;
@@ -3092,7 +3124,7 @@ var dis = css5`
3092
3124
  `;
3093
3125
  var ind = css5`
3094
3126
  ${form};
3095
- border: 1px solid gray;
3127
+ border: var(--qti-border-width, var(--cito-border-width, 1px)) solid var(--qti-border-color, GrayText);
3096
3128
  `;
3097
3129
 
3098
3130
  // ../qti-test/dist/components/test-end-attempt/test-end-attempt.js
@@ -3113,8 +3145,13 @@ var TestEndAttempt = class extends LitElement12 {
3113
3145
  :host {
3114
3146
  ${btn};
3115
3147
  }
3116
- :host(:hover:not([disabled])) {
3117
- ${btnInteractive};
3148
+ @media (hover: hover) and (pointer: fine) {
3149
+ :host(:hover:not([disabled])) {
3150
+ ${btnInteractive};
3151
+ }
3152
+ }
3153
+ :host(:active:not([disabled])) {
3154
+ ${btnActive};
3118
3155
  }
3119
3156
  :host(:focus-visible) {
3120
3157
  ${focusRing};
@@ -3198,8 +3235,13 @@ var TestItemLink = class extends LitElement13 {
3198
3235
  :host {
3199
3236
  ${btn};
3200
3237
  }
3201
- :host(:hover:not([disabled])) {
3202
- ${btnInteractive};
3238
+ @media (hover: hover) and (pointer: fine) {
3239
+ :host(:hover:not([disabled])) {
3240
+ ${btnInteractive};
3241
+ }
3242
+ }
3243
+ :host(:active:not([disabled])) {
3244
+ ${btnActive};
3203
3245
  }
3204
3246
  :host(:focus-visible) {
3205
3247
  ${focusRing};
@@ -3799,9 +3841,15 @@ var TestNext = class extends LitElement15 {
3799
3841
  this.styles = css8`
3800
3842
  :host {
3801
3843
  ${btn};
3844
+ ${btnPrimary};
3802
3845
  }
3803
- :host(:hover:not([disabled])) {
3804
- ${btnInteractive};
3846
+ @media (hover: hover) and (pointer: fine) {
3847
+ :host(:hover:not([disabled])) {
3848
+ ${btnPrimaryInteractive};
3849
+ }
3850
+ }
3851
+ :host(:active:not([disabled])) {
3852
+ ${btnPrimaryActive};
3805
3853
  }
3806
3854
  :host(:focus-visible) {
3807
3855
  ${focusRing};
@@ -3887,8 +3935,13 @@ var TestPrev = class extends LitElement16 {
3887
3935
  :host {
3888
3936
  ${btn};
3889
3937
  }
3890
- :host(:hover:not([disabled])) {
3891
- ${btnInteractive};
3938
+ @media (hover: hover) and (pointer: fine) {
3939
+ :host(:hover:not([disabled])) {
3940
+ ${btnInteractive};
3941
+ }
3942
+ }
3943
+ :host(:active:not([disabled])) {
3944
+ ${btnActive};
3892
3945
  }
3893
3946
  :host(:focus-visible) {
3894
3947
  ${focusRing};
@@ -3955,8 +4008,13 @@ var TestSectionLink = class extends LitElement17 {
3955
4008
  :host {
3956
4009
  ${btn};
3957
4010
  }
3958
- :host(:hover:not([disabled])) {
3959
- ${btnInteractive};
4011
+ @media (hover: hover) and (pointer: fine) {
4012
+ :host(:hover:not([disabled])) {
4013
+ ${btnInteractive};
4014
+ }
4015
+ }
4016
+ :host(:active:not([disabled])) {
4017
+ ${btnActive};
3960
4018
  }
3961
4019
  :host(:focus-visible) {
3962
4020
  ${focusRing};
@@ -4009,8 +4067,13 @@ var TestBookmark = class extends LitElement18 {
4009
4067
  :host {
4010
4068
  ${btn};
4011
4069
  }
4012
- :host(:hover:not([disabled])) {
4013
- ${btnInteractive};
4070
+ @media (hover: hover) and (pointer: fine) {
4071
+ :host(:hover:not([disabled])) {
4072
+ ${btnInteractive};
4073
+ }
4074
+ }
4075
+ :host(:active:not([disabled])) {
4076
+ ${btnActive};
4014
4077
  }
4015
4078
  :host {
4016
4079
  display: inline-flex;
@@ -4116,8 +4179,13 @@ var TestCheckItem = class extends LitElement19 {
4116
4179
  :host {
4117
4180
  ${btn};
4118
4181
  }
4119
- :host(:hover:not([disabled])) {
4120
- ${btnInteractive};
4182
+ @media (hover: hover) and (pointer: fine) {
4183
+ :host(:hover:not([disabled])) {
4184
+ ${btnInteractive};
4185
+ }
4186
+ }
4187
+ :host(:active:not([disabled])) {
4188
+ ${btnActive};
4121
4189
  }
4122
4190
  :host(:focus-visible) {
4123
4191
  ${focusRing};
@@ -4471,8 +4539,13 @@ var TestSubmit = class extends LitElement25 {
4471
4539
  :host {
4472
4540
  ${btn};
4473
4541
  }
4474
- :host(:hover:not([disabled])) {
4475
- ${btnInteractive};
4542
+ @media (hover: hover) and (pointer: fine) {
4543
+ :host(:hover:not([disabled])) {
4544
+ ${btnInteractive};
4545
+ }
4546
+ }
4547
+ :host(:active:not([disabled])) {
4548
+ ${btnActive};
4476
4549
  }
4477
4550
  :host(:focus-visible) {
4478
4551
  ${focusRing};
@@ -4624,8 +4697,14 @@ function getHighlightSheet() {
4624
4697
  if (!highlightSheet) {
4625
4698
  highlightSheet = new CSSStyleSheet();
4626
4699
  highlightSheet.replaceSync(`
4627
- ::highlight(${HIGHLIGHT_ELEMENT}) { background-color: #dbeafe; color: inherit; }
4628
- ::highlight(${HIGHLIGHT_WORD}) { background-color: #ffe066; color: inherit; }
4700
+ ::highlight(${HIGHLIGHT_ELEMENT}) {
4701
+ background-color: var(--test-tts-element-highlight, color-mix(in oklab, var(--qti-color-info, var(--cito-color-info, Highlight)) 15%, transparent));
4702
+ color: inherit;
4703
+ }
4704
+ ::highlight(${HIGHLIGHT_WORD}) {
4705
+ background-color: var(--test-tts-word-highlight, color-mix(in oklab, var(--qti-color-warning, var(--cito-color-warning, Mark)) 55%, transparent));
4706
+ color: inherit;
4707
+ }
4629
4708
  `);
4630
4709
  }
4631
4710
  return highlightSheet;
@@ -4660,8 +4739,13 @@ var TtsButtonBase = class extends LitElement28 {
4660
4739
  page as tall as the scrolled content. */
4661
4740
  position: relative;
4662
4741
  }
4663
- button:hover:not(:disabled) {
4664
- ${btnInteractive};
4742
+ @media (hover: hover) and (pointer: fine) {
4743
+ button:hover:not(:disabled) {
4744
+ ${btnInteractive};
4745
+ }
4746
+ }
4747
+ button:active:not(:disabled) {
4748
+ ${btnActive};
4665
4749
  }
4666
4750
  button:focus-visible {
4667
4751
  ${focusRing};
@@ -4671,8 +4755,8 @@ var TtsButtonBase = class extends LitElement28 {
4671
4755
  }
4672
4756
  button[aria-pressed='true'],
4673
4757
  button[aria-pressed='true']:hover {
4674
- background-color: var(--test-button-selected-background-color, var(--qti-selected-bg, #0175aa));
4675
- color: var(--test-button-selected-color, var(--qti-selected-color, #fff));
4758
+ background-color: var(--test-button-selected-background-color, var(--qti-selected-bg, Highlight));
4759
+ color: var(--test-button-selected-color, var(--qti-selected-color, HighlightText));
4676
4760
  }
4677
4761
  svg,
4678
4762
  ::slotted(svg) {
@@ -5516,4 +5600,4 @@ export {
5516
5600
  * Portions Copyright (c) 2013, the Dart project authors.
5517
5601
  *)
5518
5602
  */
5519
- //# sourceMappingURL=chunk-RRMCWCSA.js.map
5603
+ //# sourceMappingURL=chunk-5K5JO7OG.js.map