@citolab/qti-components 10.0.0-next.16 → 10.0.0-next.18
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.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +233 -459
- package/dist/base.d.ts +12 -10
- package/dist/base.js +1 -0
- package/dist/chunk-DJ7PB252.js +7 -0
- package/dist/chunk-DJ7PB252.js.map +1 -0
- package/dist/{chunk-7MYZHZWV.js → chunk-DUKQ53E7.js} +46 -3
- package/dist/chunk-DUKQ53E7.js.map +1 -0
- package/dist/chunk-J6VX4N7M.js +197 -0
- package/dist/chunk-J6VX4N7M.js.map +1 -0
- package/dist/{chunk-J3F3JSCW.js → chunk-N453PANH.js} +2 -2
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/{chunk-NWSDBYK7.js → chunk-QLGUI5VG.js} +2 -2
- package/dist/{chunk-H3Z3TMFB.js → chunk-SUPLA6QQ.js} +9 -19
- package/dist/chunk-SUPLA6QQ.js.map +1 -0
- package/dist/chunk-UCXLDQYA.js +56 -0
- package/dist/chunk-UCXLDQYA.js.map +1 -0
- package/dist/{chunk-LQ65RILE.js → chunk-UURHLJVM.js} +66 -1803
- package/dist/chunk-UURHLJVM.js.map +1 -0
- package/dist/{chunk-4DC5Z2LQ.js → chunk-V5GL7PTC.js} +2 -2
- package/dist/{chunk-M4TZIB3W.js → chunk-WGUQCB2Z.js} +4 -54
- package/dist/chunk-WGUQCB2Z.js.map +1 -0
- package/dist/{computed.types.d-n3K2VvB0.d.ts → computed.types.d-D4wskgi0.d.ts} +1 -1
- package/dist/corrections.d.ts +13 -14
- package/dist/corrections.js +7 -7
- package/dist/corrections.js.map +1 -1
- package/dist/elements.d.ts +5 -105
- package/dist/elements.js +7 -4
- package/dist/index.d.ts +17 -13
- package/dist/index.js +17 -57
- package/dist/interactions.d.ts +5 -4
- package/dist/interactions.js +3 -2
- package/dist/item.d.ts +6 -4
- package/dist/item.js +1 -0
- package/dist/item.types.d-Zc6ZQDhu.d.ts +25 -0
- package/dist/loader.d.ts +4 -2
- package/dist/loader.js +1 -0
- package/dist/processing.d.ts +4 -3
- package/dist/processing.js +1 -0
- package/dist/public-events.d-3dGip9pd.d.ts +105 -0
- package/dist/qti-components-jsx.d.ts +2686 -4046
- package/dist/{qti-condition-expression.d-B-T1NNl0.d.ts → qti-condition-expression.d-7Kd4LBxn.d.ts} +1 -1
- package/dist/{qti-expression.d-B-Cfbqlb.d.ts → qti-expression.d-iH3w6mqf.d.ts} +2 -1
- package/dist/{qti-feedback.d-1JL_qHjc.d.ts → qti-feedback.d-CT0W-8Gm.d.ts} +1 -1
- package/dist/{qti-item.d-DDMDjWIk.d.ts → qti-item.d-CLChmRvB.d.ts} +2 -1
- package/dist/qti-test-state-BAf5AmJ2.d.ts +68 -0
- package/dist/qti-test-state.d-D8Q89RzZ.d.ts +57 -0
- package/dist/{qti-test.d-CDdyCp6e.d.ts → qti-test.d-COzv7YZG.d.ts} +9 -546
- package/dist/{qti-text-entry-interaction.d-BTAKmr4b.d.ts → qti-text-entry-interaction.d-DsUyecBC.d.ts} +3 -2
- package/dist/{record.d-Bojj6_LW.d.ts → record.d-BfZhFr0L.d.ts} +1 -1
- package/dist/{session.context.d-BNxGeyh9.d.ts → session.context.d-9gRdGK4T.d.ts} +1 -1
- package/dist/test-plugin-api.d.ts +134 -0
- package/dist/test-plugin-api.js +19 -0
- package/dist/test-plugin-api.js.map +1 -0
- package/dist/test.d.ts +16 -158
- package/dist/test.js +11 -50
- package/dist/transformers.js +1 -0
- package/dist/{item.types.d-DuVR0ZVK.d.ts → variables.d-DWHlTszN.d.ts} +1 -23
- package/package.json +7 -3
- package/dist/chunk-7MYZHZWV.js.map +0 -1
- package/dist/chunk-H3Z3TMFB.js.map +0 -1
- package/dist/chunk-LQ65RILE.js.map +0 -1
- package/dist/chunk-M4TZIB3W.js.map +0 -1
- /package/dist/{chunk-J3F3JSCW.js.map → chunk-N453PANH.js.map} +0 -0
- /package/dist/{chunk-NWSDBYK7.js.map → chunk-QLGUI5VG.js.map} +0 -0
- /package/dist/{chunk-4DC5Z2LQ.js.map → chunk-V5GL7PTC.js.map} +0 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dispatchDeclared,
|
|
3
|
+
listenDeclared
|
|
4
|
+
} from "./chunk-UCXLDQYA.js";
|
|
5
|
+
import {
|
|
6
|
+
__export
|
|
7
|
+
} from "./chunk-PZ5AY32C.js";
|
|
8
|
+
|
|
9
|
+
// ../qti-test/dist/public-events.js
|
|
10
|
+
var PUBLIC_EVENTS = {
|
|
11
|
+
"qc-test-navigate": { kind: "request", scope: "test", deprecated: "cito-test-navigate" },
|
|
12
|
+
"qc-test-end-attempt": { kind: "request", scope: "test", deprecated: "cito-test-end-attempt" },
|
|
13
|
+
"qc-test-submit": { kind: "request", scope: "test", deprecated: "cito-test-submit" },
|
|
14
|
+
"qc-test-update-outcome": { kind: "request", scope: "test", deprecated: "cito-test-update-outcome" },
|
|
15
|
+
"qc-test-update-plugin-state": { kind: "request", scope: "test", deprecated: "cito-test-update-plugin-state" },
|
|
16
|
+
"qc-test-switch-view": { kind: "request", scope: "test", deprecated: "cito-test-switch-view" },
|
|
17
|
+
"qc-test-submitted": { kind: "notification", scope: "test", deprecated: "cito-test-submitted" },
|
|
18
|
+
"qc-test-navigated": { kind: "notification", scope: "test", deprecated: "cito-test-navigated" },
|
|
19
|
+
"qc-test-navigation-started": { kind: "notification", scope: "test", deprecated: "cito-test-navigation-started" },
|
|
20
|
+
"qc-test-navigation-failed": { kind: "notification", scope: "test", deprecated: "cito-test-navigation-failed" },
|
|
21
|
+
"qc-test-rendered": { kind: "notification", scope: "test", deprecated: "cito-test-rendered" },
|
|
22
|
+
"qc-test-loaded": { kind: "notification", scope: "test", deprecated: "cito-test-loaded" },
|
|
23
|
+
"qc-test-state-changed": { kind: "notification", scope: "test", deprecated: "cito-test-state-changed" },
|
|
24
|
+
"qc-test-items-skipped": { kind: "notification", scope: "test", deprecated: "cito-test-items-skipped" },
|
|
25
|
+
"qc-test-end-reached": { kind: "notification", scope: "test", deprecated: "cito-test-end-reached" },
|
|
26
|
+
"qc-item-ref-connected": { kind: "notification", scope: "item", deprecated: "cito-item-ref-connected" }
|
|
27
|
+
};
|
|
28
|
+
function dispatchPublic(target, name, detail) {
|
|
29
|
+
dispatchDeclared(target, PUBLIC_EVENTS, name, detail);
|
|
30
|
+
}
|
|
31
|
+
function listenPublic(target, name, handler) {
|
|
32
|
+
listenDeclared(target, PUBLIC_EVENTS, name, handler);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ../qti-test/dist/components/styles.js
|
|
36
|
+
var styles_exports = {};
|
|
37
|
+
__export(styles_exports, {
|
|
38
|
+
btn: () => btn,
|
|
39
|
+
btnActive: () => btnActive,
|
|
40
|
+
btnInteractive: () => btnInteractive,
|
|
41
|
+
btnPrimary: () => btnPrimary,
|
|
42
|
+
btnPrimaryActive: () => btnPrimaryActive,
|
|
43
|
+
btnPrimaryInteractive: () => btnPrimaryInteractive,
|
|
44
|
+
button: () => button,
|
|
45
|
+
buttonPrimary: () => buttonPrimary,
|
|
46
|
+
control: () => control,
|
|
47
|
+
dis: () => dis,
|
|
48
|
+
focusRing: () => focusRing,
|
|
49
|
+
form: () => form,
|
|
50
|
+
hostBox: () => hostBox,
|
|
51
|
+
ind: () => ind
|
|
52
|
+
});
|
|
53
|
+
import { css, html } from "lit";
|
|
54
|
+
var surface = css`var(--qti-color-base-100, var(--qc-color-base-100, var(--cito-color-base-100, Canvas)))`;
|
|
55
|
+
var content = css`var(--qti-color-base-content, var(--qc-color-base-content, var(--cito-color-base-content, CanvasText)))`;
|
|
56
|
+
var neutral = css`var(--qti-color-neutral, var(--qc-color-neutral, var(--cito-color-neutral, CanvasText)))`;
|
|
57
|
+
var neutralContent = css`var(--qti-color-neutral-content, var(--qc-color-neutral-content, var(--cito-color-neutral-content, Canvas)))`;
|
|
58
|
+
var radius = css`var(--button-border-radius, var(--test-button-border-radius, var(--qti-radius-field, var(--qc-radius-field, var(--cito-radius-field, 0.2rem)))))`;
|
|
59
|
+
var borderWidth = css`var(--qti-border-width, var(--qc-border-width, var(--cito-border-width, 1px)))`;
|
|
60
|
+
var hostBox = css`
|
|
61
|
+
display: inline-flex;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
user-select: none;
|
|
64
|
+
border-radius: ${radius};
|
|
65
|
+
`;
|
|
66
|
+
var form = css`
|
|
67
|
+
display: flex;
|
|
68
|
+
flex: 1 1 auto;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
gap: 0.375em;
|
|
72
|
+
box-sizing: border-box;
|
|
73
|
+
min-block-size: var(--button-size, var(--test-button-size, 2.25rem));
|
|
74
|
+
padding: 0 0.875rem;
|
|
75
|
+
font: inherit;
|
|
76
|
+
line-height: 1.25;
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
user-select: none;
|
|
79
|
+
border-radius: ${radius};
|
|
80
|
+
`;
|
|
81
|
+
var btn = css`
|
|
82
|
+
${form};
|
|
83
|
+
background-color: var(--button-background-color, var(--test-button-background-color, ${surface}));
|
|
84
|
+
color: var(--button-color, var(--test-button-color, inherit));
|
|
85
|
+
border: ${borderWidth} solid
|
|
86
|
+
var(
|
|
87
|
+
--button-border-color,
|
|
88
|
+
var(--test-button-border-color, var(--qti-border-color, color-mix(in oklab, ${content} 45%, ${surface})))
|
|
89
|
+
);
|
|
90
|
+
`;
|
|
91
|
+
var btnPrimary = css`
|
|
92
|
+
background-color: var(--button-primary-background-color, var(--test-button-primary-background-color, ${neutral}));
|
|
93
|
+
color: var(--button-primary-color, var(--test-button-primary-color, ${neutralContent}));
|
|
94
|
+
border-color: var(--button-primary-background-color, var(--test-button-primary-background-color, ${neutral}));
|
|
95
|
+
`;
|
|
96
|
+
var btnInteractive = css`
|
|
97
|
+
background-color: var(
|
|
98
|
+
--button-hover-background-color,
|
|
99
|
+
var(--test-button-hover-background-color, color-mix(in oklab, ${surface}, ${content} var(--qti-hover-mix, 8%)))
|
|
100
|
+
);
|
|
101
|
+
`;
|
|
102
|
+
var btnPrimaryInteractive = css`
|
|
103
|
+
background-color: var(
|
|
104
|
+
--button-primary-hover-background-color,
|
|
105
|
+
var(
|
|
106
|
+
--test-button-primary-hover-background-color,
|
|
107
|
+
color-mix(in oklab, ${neutral}, ${neutralContent} var(--qti-hover-mix, 8%))
|
|
108
|
+
)
|
|
109
|
+
);
|
|
110
|
+
`;
|
|
111
|
+
var btnActive = css`
|
|
112
|
+
background-color: var(
|
|
113
|
+
--button-active-background-color,
|
|
114
|
+
var(--test-button-active-background-color, color-mix(in oklab, ${surface}, ${content} var(--qti-active-mix, 16%)))
|
|
115
|
+
);
|
|
116
|
+
`;
|
|
117
|
+
var btnPrimaryActive = css`
|
|
118
|
+
background-color: var(
|
|
119
|
+
--button-primary-active-background-color,
|
|
120
|
+
var(
|
|
121
|
+
--test-button-primary-active-background-color,
|
|
122
|
+
color-mix(in oklab, ${neutral}, ${neutralContent} var(--qti-active-mix, 16%))
|
|
123
|
+
)
|
|
124
|
+
);
|
|
125
|
+
`;
|
|
126
|
+
var focusRing = css`
|
|
127
|
+
outline: var(--qti-focus-border-width, 2px) solid var(--qti-focus-color, Highlight);
|
|
128
|
+
outline-offset: var(--qti-focus-offset, 2px);
|
|
129
|
+
`;
|
|
130
|
+
var dis = css`
|
|
131
|
+
cursor: not-allowed;
|
|
132
|
+
opacity: 0.45;
|
|
133
|
+
`;
|
|
134
|
+
var ind = css`
|
|
135
|
+
${form};
|
|
136
|
+
border: ${borderWidth} solid var(--qti-border-color, GrayText);
|
|
137
|
+
`;
|
|
138
|
+
var control = html`<span class="control" part="button"><slot></slot></span>`;
|
|
139
|
+
var button = css`
|
|
140
|
+
:host {
|
|
141
|
+
${hostBox};
|
|
142
|
+
}
|
|
143
|
+
.control {
|
|
144
|
+
${btn};
|
|
145
|
+
}
|
|
146
|
+
@media (hover: hover) and (pointer: fine) {
|
|
147
|
+
:host(:hover:not([disabled])) .control {
|
|
148
|
+
${btnInteractive};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
:host(:active:not([disabled])) .control {
|
|
152
|
+
${btnActive};
|
|
153
|
+
}
|
|
154
|
+
/* The press the theme gives a choice (qti-motion.css), from the same knob: a touch smaller while
|
|
155
|
+
the button is down, springing back on release; 0 motion means no press. */
|
|
156
|
+
.control {
|
|
157
|
+
transition:
|
|
158
|
+
background-color calc(200ms * var(--qti-motion, 1)) cubic-bezier(0.2, 0, 0, 1),
|
|
159
|
+
scale calc(200ms * var(--qti-motion, 1)) cubic-bezier(0.2, 0, 0, 1);
|
|
160
|
+
}
|
|
161
|
+
:host(:active:not([disabled])) .control {
|
|
162
|
+
scale: calc(1 - 0.03 * var(--qti-motion, 1));
|
|
163
|
+
}
|
|
164
|
+
:host(:focus-visible) {
|
|
165
|
+
${focusRing};
|
|
166
|
+
}
|
|
167
|
+
:host([disabled]) {
|
|
168
|
+
${dis};
|
|
169
|
+
}
|
|
170
|
+
:host([disabled]) .control {
|
|
171
|
+
cursor: not-allowed;
|
|
172
|
+
}
|
|
173
|
+
`;
|
|
174
|
+
var buttonPrimary = css`
|
|
175
|
+
.control {
|
|
176
|
+
${btnPrimary};
|
|
177
|
+
}
|
|
178
|
+
@media (hover: hover) and (pointer: fine) {
|
|
179
|
+
:host(:hover:not([disabled])) .control {
|
|
180
|
+
${btnPrimaryInteractive};
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
:host(:active:not([disabled])) .control {
|
|
184
|
+
${btnPrimaryActive};
|
|
185
|
+
}
|
|
186
|
+
`;
|
|
187
|
+
|
|
188
|
+
export {
|
|
189
|
+
PUBLIC_EVENTS,
|
|
190
|
+
dispatchPublic,
|
|
191
|
+
listenPublic,
|
|
192
|
+
control,
|
|
193
|
+
button,
|
|
194
|
+
buttonPrimary,
|
|
195
|
+
styles_exports
|
|
196
|
+
};
|
|
197
|
+
//# sourceMappingURL=chunk-J6VX4N7M.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../qti-test/src/public-events.ts","../../qti-test/src/components/styles.ts"],"sourcesContent":["import { dispatchDeclared, listenDeclared } from '@qti-components/elements/public-events';\n\nimport type { View } from '@qti-components/base';\nimport type { PublicEventDeclaration } from '@qti-components/elements/public-events';\nimport type { QtiTestState } from './types/qti-test-state';\n\n/**\n * The public events of the test. The name tells you it is public: everything here starts with\n * `qc-`; every other event is internal plumbing and may change in any release.\n *\n * Requests are verbs (a host or plugin dispatches them at the test), notifications are past tense\n * (the test dispatches them). All bubble and are composed.\n *\n * `deprecated` is the `cito-` name this event had in 9.x. One helper (`dispatchPublic`,\n * `listenPublic`) sends or handles both names until the next major, then the field goes. The 7.x\n * names (`qti-request-navigation`, `test-end-attempt`, `on-test-switch-view`, …) are no longer sent\n * or handled.\n */\nexport interface NavigationTarget {\n type: 'item' | 'section';\n id: string;\n}\n\nexport interface NavigationFailure {\n message: string;\n details?: unknown;\n itemId?: string;\n sectionId?: string;\n}\n\nexport interface PublicEventMap {\n 'qc-test-navigate': CustomEvent<NavigationTarget>;\n /**\n * Ends an attempt: processes the response of the item-ref `itemId`, or, without it, of the item on\n * screen. `<test-end-attempt>` sends the `itemId` of the item it is stamped into or names.\n */\n 'qc-test-end-attempt': CustomEvent<{ itemId?: string }>;\n /** Scores the test: resets its outcomes to their defaults, runs outcome processing, then `qc-test-submitted`. */\n 'qc-test-submit': CustomEvent<Record<string, never>>;\n 'qc-test-update-outcome': CustomEvent<{\n assessmentItemRefId: string;\n outcomeVariableId: string;\n value: number | string;\n }>;\n 'qc-test-switch-view': CustomEvent<View>;\n /** `value` is JSON; `null` or `undefined` removes the plugin's entry. */\n 'qc-test-update-plugin-state': CustomEvent<{ plugin: string; value: unknown }>;\n /** Outcome processing ran after a submit: read the test outcomes now. */\n 'qc-test-submitted': CustomEvent<Record<string, never>>;\n 'qc-test-navigated': CustomEvent<NavigationTarget>;\n 'qc-test-navigation-started': CustomEvent<NavigationTarget>;\n 'qc-test-navigation-failed': CustomEvent<NavigationFailure>;\n 'qc-test-rendered': CustomEvent<{ identifier: string; element: Element }[]>;\n // `qc-test-loaded` (detail: the `QtiAssessmentTest`) is added by qti-assessment-test.ts, so this\n // module imports no element: that import would be a cycle.\n 'qc-test-state-changed': CustomEvent<QtiTestState>;\n 'qc-test-items-skipped': CustomEvent<{ ids: string[] }>;\n 'qc-test-end-reached': CustomEvent<Record<string, never>>;\n 'qc-item-ref-connected': CustomEvent<{ identifier: string; href: string; category: string }>;\n}\n\nexport type PublicEventName = keyof PublicEventMap;\n\nexport const PUBLIC_EVENTS: Record<PublicEventName, PublicEventDeclaration> = {\n 'qc-test-navigate': { kind: 'request', scope: 'test', deprecated: 'cito-test-navigate' },\n 'qc-test-end-attempt': { kind: 'request', scope: 'test', deprecated: 'cito-test-end-attempt' },\n 'qc-test-submit': { kind: 'request', scope: 'test', deprecated: 'cito-test-submit' },\n 'qc-test-update-outcome': { kind: 'request', scope: 'test', deprecated: 'cito-test-update-outcome' },\n 'qc-test-update-plugin-state': { kind: 'request', scope: 'test', deprecated: 'cito-test-update-plugin-state' },\n 'qc-test-switch-view': { kind: 'request', scope: 'test', deprecated: 'cito-test-switch-view' },\n 'qc-test-submitted': { kind: 'notification', scope: 'test', deprecated: 'cito-test-submitted' },\n 'qc-test-navigated': { kind: 'notification', scope: 'test', deprecated: 'cito-test-navigated' },\n 'qc-test-navigation-started': { kind: 'notification', scope: 'test', deprecated: 'cito-test-navigation-started' },\n 'qc-test-navigation-failed': { kind: 'notification', scope: 'test', deprecated: 'cito-test-navigation-failed' },\n 'qc-test-rendered': { kind: 'notification', scope: 'test', deprecated: 'cito-test-rendered' },\n 'qc-test-loaded': { kind: 'notification', scope: 'test', deprecated: 'cito-test-loaded' },\n 'qc-test-state-changed': { kind: 'notification', scope: 'test', deprecated: 'cito-test-state-changed' },\n 'qc-test-items-skipped': { kind: 'notification', scope: 'test', deprecated: 'cito-test-items-skipped' },\n 'qc-test-end-reached': { kind: 'notification', scope: 'test', deprecated: 'cito-test-end-reached' },\n 'qc-item-ref-connected': { kind: 'notification', scope: 'item', deprecated: 'cito-item-ref-connected' }\n};\n\ndeclare global {\n interface HTMLElementEventMap extends PublicEventMap {}\n}\n\n/**\n * Dispatch a public event, and its deprecated name with the same `detail` object. The detail is\n * always an object so `listenPublic` can tell the two apart from one dispatch.\n */\nexport function dispatchPublic<K extends PublicEventName>(\n target: EventTarget,\n name: K,\n detail: PublicEventMap[K] extends CustomEvent<infer D> ? D : never\n): void {\n dispatchDeclared(target, PUBLIC_EVENTS, name, detail);\n}\n\n/**\n * Listen for a public event and its deprecated name; the handler runs once for a sender that\n * dispatched both. See `listenDeclared`.\n */\nexport function listenPublic<K extends PublicEventName>(\n target: EventTarget,\n name: K,\n handler: (e: PublicEventMap[K]) => void\n): void {\n listenDeclared(target, PUBLIC_EVENTS, name, handler as (e: Event) => void);\n}\n","// /* eslint-disable lit-plugin(no-invalid-css) */\nimport { css, html } from 'lit';\n\n/*\n * The resting look of the test controls (next, prev, item/section links, TTS buttons).\n *\n * Two looks, both plain: a neutral one (the page's surface, the theme's border, the surrounding text\n * colour) and a filled one that `test-next` wears, in the theme's neutral colour with its content\n * colour on top. No shadow, no glow, no transition, so the controls read as unbranded until a host\n * repaints them.\n *\n * Every colour is the theme's tier 1 (CONTRACT.md §8 in qti-theme): `--qc-*` first, the older\n * `--cito-*` name as its fallback for this major, and a CSS system colour behind both for a page\n * that loads no theme: Canvas and CanvasText follow the page's color-scheme, so the controls stay\n * legible in dark mode without the theme too. Hover and press mix the content colour into the\n * fill, by --qti-hover-mix and --qti-active-mix.\n *\n * Paint comes from the `--button-*` slots, the one button slot set the theme's `@mixin paint button`\n * reads too, so a host that repaints its buttons repaints the test controls, the end-attempt and the\n * upload button alike. The older `--test-button-*` names are aliases: each slot is read as\n * `var(--button-X, var(--test-button-X, <default>))`. Never the shared `--qti-component-*` tokens:\n * those also paint the items' own borders, and a change to how a button looks must not move an\n * interaction.\n *\n * --button-size, --button-border-radius the box\n * --button-background-color, --button-color, --button-border-color,\n * --button-hover-background-color, --button-active-background-color\n * the neutral look, and the filled look's slots\n * --button-primary-background-color, --button-primary-color,\n * --button-primary-hover-background-color, --button-primary-active-background-color\n * the filled look only\n * --button-selected-background-color, --button-selected-color\n * a toggle that is on (the host carries :state(selected))\n *\n * --test-button-<same> aliases of the names above\n */\n\nconst surface = css`var(--qti-color-base-100, var(--qc-color-base-100, var(--cito-color-base-100, Canvas)))`;\nconst content = css`var(--qti-color-base-content, var(--qc-color-base-content, var(--cito-color-base-content, CanvasText)))`;\nconst neutral = css`var(--qti-color-neutral, var(--qc-color-neutral, var(--cito-color-neutral, CanvasText)))`;\nconst neutralContent = css`var(--qti-color-neutral-content, var(--qc-color-neutral-content, var(--cito-color-neutral-content, Canvas)))`;\nconst radius = css`var(--button-border-radius, var(--test-button-border-radius, var(--qti-radius-field, var(--qc-radius-field, var(--cito-radius-field, 0.2rem)))))`;\nconst borderWidth = css`var(--qti-border-width, var(--qc-border-width, var(--cito-border-width, 1px)))`;\n\n/*\n * A test control is drawn on an inner element (`.control`, part \"button\"), never on its host.\n *\n * A page's reset, Tailwind's preflight for one (`*, ::before, ::after { margin: 0; padding: 0; border: 0 solid }`),\n * is a rule of the page, and a page rule beats the `:host` rules of a shadow root whatever its layer or its\n * specificity. A control that paints its padding and border on the host loses them to such a reset. The\n * inner element lives in the shadow tree, where the page's `*` does not reach, so the control looks the same with\n * or without a reset. The host keeps only what a reset leaves alone: its display, the radius its focus ring\n * follows, and the cursor.\n */\nexport const hostBox = css`\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n border-radius: ${radius};\n`;\n\n/** The box of the control itself: the inner element. */\nexport const form = css`\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n justify-content: center;\n gap: 0.375em;\n box-sizing: border-box;\n min-block-size: var(--button-size, var(--test-button-size, 2.25rem));\n padding: 0 0.875rem;\n font: inherit;\n line-height: 1.25;\n cursor: pointer;\n user-select: none;\n border-radius: ${radius};\n`;\n\nexport const btn = css`\n ${form};\n background-color: var(--button-background-color, var(--test-button-background-color, ${surface}));\n color: var(--button-color, var(--test-button-color, inherit));\n border: ${borderWidth} solid\n var(\n --button-border-color,\n var(--test-button-border-color, var(--qti-border-color, color-mix(in oklab, ${content} 45%, ${surface})))\n );\n`;\n\n/** The filled look: the neutral colour, its content colour on top. Same box as `btn`, so the two sit level. */\nexport const btnPrimary = css`\n background-color: var(--button-primary-background-color, var(--test-button-primary-background-color, ${neutral}));\n color: var(--button-primary-color, var(--test-button-primary-color, ${neutralContent}));\n border-color: var(--button-primary-background-color, var(--test-button-primary-background-color, ${neutral}));\n`;\n\n/** Hover; paint only, so the box never moves. */\nexport const btnInteractive = css`\n background-color: var(\n --button-hover-background-color,\n var(--test-button-hover-background-color, color-mix(in oklab, ${surface}, ${content} var(--qti-hover-mix, 8%)))\n );\n`;\n\nexport const btnPrimaryInteractive = css`\n background-color: var(\n --button-primary-hover-background-color,\n var(\n --test-button-primary-hover-background-color,\n color-mix(in oklab, ${neutral}, ${neutralContent} var(--qti-hover-mix, 8%))\n )\n );\n`;\n\n/** Pressed: the same mix, twice as far. Paint only, so a click never moves the button. */\nexport const btnActive = css`\n background-color: var(\n --button-active-background-color,\n var(--test-button-active-background-color, color-mix(in oklab, ${surface}, ${content} var(--qti-active-mix, 16%)))\n );\n`;\n\nexport const btnPrimaryActive = css`\n background-color: var(\n --button-primary-active-background-color,\n var(\n --test-button-primary-active-background-color,\n color-mix(in oklab, ${neutral}, ${neutralContent} var(--qti-active-mix, 16%))\n )\n );\n`;\n\n/** The theme's one focus ring (qti-theme `@mixin foc`), so a page shows one kind of ring. */\nexport const focusRing = css`\n outline: var(--qti-focus-border-width, 2px) solid var(--qti-focus-color, Highlight);\n outline-offset: var(--qti-focus-offset, 2px);\n`;\n\nexport const dis = css`\n cursor: not-allowed;\n opacity: 0.45;\n`;\n\nexport const ind = css`\n ${form};\n border: ${borderWidth} solid var(--qti-border-color, GrayText);\n`;\n\n/** What a test control renders: the inner element that carries the look (see `hostBox`). */\nexport const control = html`<span class=\"control\" part=\"button\"><slot></slot></span>`;\n\n/**\n * The stylesheet of a neutral test control: the host box, the look on `.control`, and its hover, press,\n * focus and disabled states. A control with its own content (a bookmark's icon) adds to it.\n */\nexport const button = css`\n :host {\n ${hostBox};\n }\n .control {\n ${btn};\n }\n @media (hover: hover) and (pointer: fine) {\n :host(:hover:not([disabled])) .control {\n ${btnInteractive};\n }\n }\n :host(:active:not([disabled])) .control {\n ${btnActive};\n }\n /* The press the theme gives a choice (qti-motion.css), from the same knob: a touch smaller while\n the button is down, springing back on release; 0 motion means no press. */\n .control {\n transition:\n background-color calc(200ms * var(--qti-motion, 1)) cubic-bezier(0.2, 0, 0, 1),\n scale calc(200ms * var(--qti-motion, 1)) cubic-bezier(0.2, 0, 0, 1);\n }\n :host(:active:not([disabled])) .control {\n scale: calc(1 - 0.03 * var(--qti-motion, 1));\n }\n :host(:focus-visible) {\n ${focusRing};\n }\n :host([disabled]) {\n ${dis};\n }\n :host([disabled]) .control {\n cursor: not-allowed;\n }\n`;\n\n/** The filled look of `test-next`: add after `button`, so its rules win at equal specificity. */\nexport const buttonPrimary = css`\n .control {\n ${btnPrimary};\n }\n @media (hover: hover) and (pointer: fine) {\n :host(:hover:not([disabled])) .control {\n ${btnPrimaryInteractive};\n }\n }\n :host(:active:not([disabled])) .control {\n ${btnPrimaryActive};\n }\n`;\n"],"mappings":";;;;;;;;;AA+DO,IAAM,gBAAiE;EAC5E,oBAAoB,EAAE,MAAM,WAAW,OAAO,QAAQ,YAAY,qBAAoB;EACtF,uBAAuB,EAAE,MAAM,WAAW,OAAO,QAAQ,YAAY,wBAAuB;EAC5F,kBAAkB,EAAE,MAAM,WAAW,OAAO,QAAQ,YAAY,mBAAkB;EAClF,0BAA0B,EAAE,MAAM,WAAW,OAAO,QAAQ,YAAY,2BAA0B;EAClG,+BAA+B,EAAE,MAAM,WAAW,OAAO,QAAQ,YAAY,gCAA+B;EAC5G,uBAAuB,EAAE,MAAM,WAAW,OAAO,QAAQ,YAAY,wBAAuB;EAC5F,qBAAqB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,sBAAqB;EAC7F,qBAAqB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,sBAAqB;EAC7F,8BAA8B,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,+BAA8B;EAC/G,6BAA6B,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,8BAA6B;EAC7G,oBAAoB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,qBAAoB;EAC3F,kBAAkB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,mBAAkB;EACvF,yBAAyB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,0BAAyB;EACrG,yBAAyB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,0BAAyB;EACrG,uBAAuB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,wBAAuB;EACjG,yBAAyB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,0BAAyB;;AAWjG,SAAU,eACd,QACA,MACA,QAAkE;AAElE,mBAAiB,QAAQ,eAAe,MAAM,MAAM;AACtD;AAMM,SAAU,aACd,QACA,MACA,SAAuC;AAEvC,iBAAe,QAAQ,eAAe,MAAM,OAA6B;AAC3E;;;AC5GA;;;;;;;;;;;;;;;;;AACA,SAAS,KAAK,YAAY;AAoC1B,IAAM,UAAU;AAChB,IAAM,UAAU;AAChB,IAAM,UAAU;AAChB,IAAM,iBAAiB;AACvB,IAAM,SAAS;AACf,IAAM,cAAc;AAYb,IAAM,UAAU;;;;mBAIJ,MAAM;;AAIlB,IAAM,OAAO;;;;;;;;;;;;;mBAaD,MAAM;;AAGlB,IAAM,MAAM;IACf,IAAI;yFACiF,OAAO;;YAEpF,WAAW;;;oFAG6D,OAAO,SAAS,OAAO;;;AAKpG,IAAM,aAAa;yGAC+E,OAAO;wEACxC,cAAc;qGACe,OAAO;;AAIrG,IAAM,iBAAiB;;;oEAGsC,OAAO,KAAK,OAAO;;;AAIhF,IAAM,wBAAwB;;;;;4BAKT,OAAO,KAAK,cAAc;;;;AAM/C,IAAM,YAAY;;;qEAG4C,OAAO,KAAK,OAAO;;;AAIjF,IAAM,mBAAmB;;;;;4BAKJ,OAAO,KAAK,cAAc;;;;AAM/C,IAAM,YAAY;;;;AAKlB,IAAM,MAAM;;;;AAKZ,IAAM,MAAM;IACf,IAAI;YACI,WAAW;;AAIhB,IAAM,UAAU;AAMhB,IAAM,SAAS;;MAEhB,OAAO;;;MAGP,GAAG;;;;QAID,cAAc;;;;MAIhB,SAAS;;;;;;;;;;;;;MAaT,SAAS;;;MAGT,GAAG;;;;;;AAQF,IAAM,gBAAgB;;MAEvB,UAAU;;;;QAIR,qBAAqB;;;;MAIvB,gBAAgB;;;","names":[]}
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
elements8,
|
|
22
22
|
elements9,
|
|
23
23
|
qtiInteractionElements
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-DUKQ53E7.js";
|
|
25
25
|
|
|
26
26
|
// ../qti-interactions/dist/register-all.js
|
|
27
27
|
for (const { tag, ctor } of qtiInteractionElements) {
|
|
@@ -176,4 +176,4 @@ for (const { tag, ctor } of elements21) {
|
|
|
176
176
|
customElements.define(tag, ctor);
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
//# sourceMappingURL=chunk-
|
|
179
|
+
//# sourceMappingURL=chunk-N453PANH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
qtiTestElements
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UURHLJVM.js";
|
|
4
4
|
|
|
5
5
|
// ../qti-test/dist/register.js
|
|
6
6
|
for (const { tag, ctor } of qtiTestElements) {
|
|
@@ -8,4 +8,4 @@ for (const { tag, ctor } of qtiTestElements) {
|
|
|
8
8
|
customElements.define(tag, ctor);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-QLGUI5VG.js.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
QtiTest,
|
|
3
|
-
TestCheckItem,
|
|
4
3
|
TestNavigation
|
|
5
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UURHLJVM.js";
|
|
6
5
|
import {
|
|
7
6
|
QtiAssessmentItem
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WGUQCB2Z.js";
|
|
9
8
|
import {
|
|
10
9
|
QtiAssociateInteraction,
|
|
11
10
|
QtiChoiceInteraction,
|
|
@@ -28,7 +27,7 @@ import {
|
|
|
28
27
|
QtiSimpleChoice,
|
|
29
28
|
QtiSliderInteraction,
|
|
30
29
|
QtiTextEntryInteraction
|
|
31
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-DUKQ53E7.js";
|
|
32
31
|
import {
|
|
33
32
|
QtiItem
|
|
34
33
|
} from "./chunk-OG5HIRHE.js";
|
|
@@ -348,12 +347,12 @@ var TestShowCorrectResponse = class extends LitElement4 {
|
|
|
348
347
|
this.tabIndex = 0;
|
|
349
348
|
}
|
|
350
349
|
#previousActiveItem;
|
|
351
|
-
//
|
|
350
|
+
// The identifier of the item the control last showed
|
|
352
351
|
willUpdate(_changedProperties) {
|
|
353
352
|
const activeItem = this.computedContext?.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items)).find((item) => item.active);
|
|
354
|
-
if (this.#previousActiveItem !== activeItem) {
|
|
353
|
+
if (this.#previousActiveItem !== activeItem?.identifier) {
|
|
355
354
|
this.shown = false;
|
|
356
|
-
this.#previousActiveItem = activeItem;
|
|
355
|
+
this.#previousActiveItem = activeItem?.identifier;
|
|
357
356
|
}
|
|
358
357
|
if (activeItem) {
|
|
359
358
|
const containsCorrectResponse = !!activeItem?.variables?.some((v) => v["correctResponse"]);
|
|
@@ -380,7 +379,7 @@ var TestShowCorrectResponse = class extends LitElement4 {
|
|
|
380
379
|
return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;
|
|
381
380
|
}
|
|
382
381
|
render() {
|
|
383
|
-
return html4
|
|
382
|
+
return html4`<div part="button">${this.#getDisplayedText()}</div>`;
|
|
384
383
|
}
|
|
385
384
|
};
|
|
386
385
|
__decorate4([
|
|
@@ -1650,14 +1649,6 @@ var QtiTestCorrection = class extends QtiTest {
|
|
|
1650
1649
|
assessmentItem.showCorrectResponse?.(view === "scorer");
|
|
1651
1650
|
}
|
|
1652
1651
|
};
|
|
1653
|
-
var TestCheckItemCorrection = class extends TestCheckItem {
|
|
1654
|
-
constructor() {
|
|
1655
|
-
super();
|
|
1656
|
-
this.addEventListener("click", () => {
|
|
1657
|
-
this.dispatchEvent(new CustomEvent("test-show-correct-response", { detail: true, bubbles: true }));
|
|
1658
|
-
});
|
|
1659
|
-
}
|
|
1660
|
-
};
|
|
1661
1652
|
|
|
1662
1653
|
export {
|
|
1663
1654
|
ItemCorrectResponseMode,
|
|
@@ -1693,7 +1684,6 @@ export {
|
|
|
1693
1684
|
QtiAssessmentItemCorrection,
|
|
1694
1685
|
QtiItemCorrection,
|
|
1695
1686
|
TestNavigationCorrection,
|
|
1696
|
-
QtiTestCorrection
|
|
1697
|
-
TestCheckItemCorrection
|
|
1687
|
+
QtiTestCorrection
|
|
1698
1688
|
};
|
|
1699
|
-
//# sourceMappingURL=chunk-
|
|
1689
|
+
//# sourceMappingURL=chunk-SUPLA6QQ.js.map
|