@pie-qti/default-components 0.1.28 → 1.0.0-beta.0
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/dist/plugins/hottext/hottextSelector.d.ts +2 -0
- package/dist/plugins/hottext/hottextSelector.js +3 -0
- package/dist/plugins/hottext/hottextSelector.js.map +1 -0
- package/dist/plugins.js +11597 -10430
- package/dist/plugins.js.map +1 -1
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +2 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/styles/qti-pnp.css +209 -0
- package/dist/shared/styles/qti-shared-vocabulary.css +194 -1
- package/dist/shared/utils/interactionAria.d.ts +11 -0
- package/dist/shared/utils/interactionAria.js +18 -0
- package/dist/shared/utils/interactionAria.js.map +1 -0
- package/package.json +19 -8
package/dist/shared/index.d.ts
CHANGED
package/dist/shared/index.js
CHANGED
|
@@ -11,4 +11,6 @@ export * from './extensions/MathLiveEditor.js';
|
|
|
11
11
|
export * from './utils/eventHelpers.js';
|
|
12
12
|
// Pair helpers for matching/association interactions
|
|
13
13
|
export * from './utils/pairHelpers.js';
|
|
14
|
+
// Authored accessible name and description for an interaction root
|
|
15
|
+
export * from './utils/interactionAria.js';
|
|
14
16
|
//# sourceMappingURL=index.js.map
|
package/dist/shared/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,oCAAoC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,kDAAkD;AAClD,cAAc,gCAAgC,CAAC;AAC/C,0CAA0C;AAC1C,cAAc,yBAAyB,CAAC;AACxC,qDAAqD;AACrD,cAAc,wBAAwB,CAAC","sourcesContent":["/**\n * Shared utilities and helpers for QTI interaction plugins\n *\n * This module exports common utilities used across all interaction plugins.\n */\n\n\n// Typeset action for math rendering\nexport * from './actions/typesetAction.js';\n// MathLive editor extension for visual math input\nexport * from './extensions/MathLiveEditor.js';\n// Event helpers for creating CustomEvents\nexport * from './utils/eventHelpers.js';\n// Pair helpers for matching/association interactions\nexport * from './utils/pairHelpers.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,oCAAoC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,kDAAkD;AAClD,cAAc,gCAAgC,CAAC;AAC/C,0CAA0C;AAC1C,cAAc,yBAAyB,CAAC;AACxC,qDAAqD;AACrD,cAAc,wBAAwB,CAAC;AACvC,mEAAmE;AACnE,cAAc,4BAA4B,CAAC","sourcesContent":["/**\n * Shared utilities and helpers for QTI interaction plugins\n *\n * This module exports common utilities used across all interaction plugins.\n */\n\n\n// Typeset action for math rendering\nexport * from './actions/typesetAction.js';\n// MathLive editor extension for visual math input\nexport * from './extensions/MathLiveEditor.js';\n// Event helpers for creating CustomEvents\nexport * from './utils/eventHelpers.js';\n// Pair helpers for matching/association interactions\nexport * from './utils/pairHelpers.js';\n// Authored accessible name and description for an interaction root\nexport * from './utils/interactionAria.js';\n"]}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Personal needs display, from the PNP profile the item player applies to its root
|
|
3
|
+
* (`applyPnpToRoot`): colour schemes, inverted polarity, single-column layout and text
|
|
4
|
+
* appearance. Every scheme's foreground and background meet WCAG 1.4.3's 4.5:1.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* =============================================================================
|
|
8
|
+
Colour schemes
|
|
9
|
+
============================================================================= */
|
|
10
|
+
|
|
11
|
+
/* light text on a dark ground */
|
|
12
|
+
[data-qti-colorscheme='defaultreverse'] {
|
|
13
|
+
--qti-scheme-fg: #ffffff;
|
|
14
|
+
--qti-scheme-bg: #1a1a1a;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* black on white */
|
|
18
|
+
[data-qti-colorscheme='blackwhite'] {
|
|
19
|
+
--qti-scheme-fg: #000000;
|
|
20
|
+
--qti-scheme-bg: #ffffff;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* white on black */
|
|
24
|
+
[data-qti-colorscheme='whiteblack'] {
|
|
25
|
+
--qti-scheme-fg: #ffffff;
|
|
26
|
+
--qti-scheme-bg: #000000;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* black on rose */
|
|
30
|
+
[data-qti-colorscheme='blackrose'] {
|
|
31
|
+
--qti-scheme-fg: #000000;
|
|
32
|
+
--qti-scheme-bg: #ffd0ff;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* rose on black */
|
|
36
|
+
[data-qti-colorscheme='roseblack'] {
|
|
37
|
+
--qti-scheme-fg: #ffd0ff;
|
|
38
|
+
--qti-scheme-bg: #000000;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* yellow on blue */
|
|
42
|
+
[data-qti-colorscheme='yellowblue'] {
|
|
43
|
+
--qti-scheme-fg: #ffff00;
|
|
44
|
+
--qti-scheme-bg: #003399;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* blue on yellow */
|
|
48
|
+
[data-qti-colorscheme='blueyellow'] {
|
|
49
|
+
--qti-scheme-fg: #003399;
|
|
50
|
+
--qti-scheme-bg: #ffff00;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* medium grey on dark grey */
|
|
54
|
+
[data-qti-colorscheme='mgraydgray'] {
|
|
55
|
+
--qti-scheme-fg: #bbbbbb;
|
|
56
|
+
--qti-scheme-bg: #333333;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* dark grey on medium grey */
|
|
60
|
+
[data-qti-colorscheme='dgraymgray'] {
|
|
61
|
+
--qti-scheme-fg: #333333;
|
|
62
|
+
--qti-scheme-bg: #bbbbbb;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* black on cyan */
|
|
66
|
+
[data-qti-colorscheme='blackcyan'] {
|
|
67
|
+
--qti-scheme-fg: #000000;
|
|
68
|
+
--qti-scheme-bg: #00ffff;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* cyan on black */
|
|
72
|
+
[data-qti-colorscheme='cyanblack'] {
|
|
73
|
+
--qti-scheme-fg: #00ffff;
|
|
74
|
+
--qti-scheme-bg: #000000;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* black on cream */
|
|
78
|
+
[data-qti-colorscheme='blackcream'] {
|
|
79
|
+
--qti-scheme-fg: #000000;
|
|
80
|
+
--qti-scheme-bg: #fffacd;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* cream on black */
|
|
84
|
+
[data-qti-colorscheme='creamblack'] {
|
|
85
|
+
--qti-scheme-fg: #fffacd;
|
|
86
|
+
--qti-scheme-bg: #000000;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* white on navy */
|
|
90
|
+
[data-qti-colorscheme='whitenav'] {
|
|
91
|
+
--qti-scheme-fg: #ffffff;
|
|
92
|
+
--qti-scheme-bg: #000080;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* black on medium grey */
|
|
96
|
+
[data-qti-colorscheme='medgray'] {
|
|
97
|
+
--qti-scheme-fg: #000000;
|
|
98
|
+
--qti-scheme-bg: #a0a0a0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/*
|
|
102
|
+
* A scheme recolours the player: the root and the theme tokens interactions draw with,
|
|
103
|
+
* so selection and focus states stay visible in the scheme's two colours.
|
|
104
|
+
*/
|
|
105
|
+
[data-qti-colorscheme],
|
|
106
|
+
[data-qti-invert-polarity='colors'] {
|
|
107
|
+
color: var(--qti-scheme-fg);
|
|
108
|
+
background-color: var(--qti-scheme-bg);
|
|
109
|
+
--color-base-100: var(--qti-scheme-bg);
|
|
110
|
+
--color-base-200: var(--qti-scheme-bg);
|
|
111
|
+
--color-base-300: var(--qti-scheme-fg);
|
|
112
|
+
--color-base-content: var(--qti-scheme-fg);
|
|
113
|
+
--color-primary: var(--qti-scheme-fg);
|
|
114
|
+
--color-primary-content: var(--qti-scheme-bg);
|
|
115
|
+
--color-secondary: var(--qti-scheme-fg);
|
|
116
|
+
--color-secondary-content: var(--qti-scheme-bg);
|
|
117
|
+
--color-accent: var(--qti-scheme-fg);
|
|
118
|
+
--color-accent-content: var(--qti-scheme-bg);
|
|
119
|
+
--color-neutral: var(--qti-scheme-fg);
|
|
120
|
+
--color-neutral-content: var(--qti-scheme-bg);
|
|
121
|
+
--pie-qti-base-100: var(--qti-scheme-bg);
|
|
122
|
+
--pie-qti-base-200: var(--qti-scheme-bg);
|
|
123
|
+
--pie-qti-base-300: var(--qti-scheme-fg);
|
|
124
|
+
--pie-qti-base-content: var(--qti-scheme-fg);
|
|
125
|
+
--pie-qti-primary: var(--qti-scheme-fg);
|
|
126
|
+
--pie-qti-primary-content: var(--qti-scheme-bg);
|
|
127
|
+
--pie-qti-secondary: var(--qti-scheme-fg);
|
|
128
|
+
--pie-qti-secondary-content: var(--qti-scheme-bg);
|
|
129
|
+
--pie-qti-accent: var(--qti-scheme-fg);
|
|
130
|
+
--pie-qti-accent-content: var(--qti-scheme-bg);
|
|
131
|
+
--pie-qti-neutral: var(--qti-scheme-fg);
|
|
132
|
+
--pie-qti-neutral-content: var(--qti-scheme-bg);
|
|
133
|
+
--pie-qti-focus: var(--qti-scheme-fg);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
[data-qti-colorscheme] :where(a),
|
|
137
|
+
[data-qti-invert-polarity='colors'] :where(a) {
|
|
138
|
+
color: inherit;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* =============================================================================
|
|
142
|
+
Inverted polarity
|
|
143
|
+
============================================================================= */
|
|
144
|
+
|
|
145
|
+
/* Without colours of its own, the player inverts and media is inverted back. */
|
|
146
|
+
[data-qti-invert-polarity='invert'] {
|
|
147
|
+
filter: invert(1) hue-rotate(180deg);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
[data-qti-invert-polarity='invert'] :where(img, picture, video, canvas, object) {
|
|
151
|
+
filter: invert(1) hue-rotate(180deg);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* With the profile's colours, they take the scheme's place. */
|
|
155
|
+
[data-qti-invert-polarity='colors'] {
|
|
156
|
+
--qti-scheme-fg: var(--qti-invert-foreground, #ffffff);
|
|
157
|
+
--qti-scheme-bg: var(--qti-invert-background, #000000);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* =============================================================================
|
|
161
|
+
Single-column layout
|
|
162
|
+
============================================================================= */
|
|
163
|
+
|
|
164
|
+
[data-qti-layout='single-column'] .qti-layout-row {
|
|
165
|
+
flex-direction: column;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
[data-qti-layout='single-column'] .qti-layout-row > * {
|
|
169
|
+
width: 100%;
|
|
170
|
+
margin-left: 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* =============================================================================
|
|
174
|
+
Text appearance: each property the profile sets is a token on the attribute
|
|
175
|
+
============================================================================= */
|
|
176
|
+
|
|
177
|
+
[data-qti-text-appearance~='font-size'] {
|
|
178
|
+
font-size: var(--qti-font-size);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
[data-qti-text-appearance~='font-family'],
|
|
182
|
+
[data-qti-text-appearance~='font-family'] :where(p, li, td, th, label, span, div, button, input, textarea, select) {
|
|
183
|
+
font-family: var(--qti-font-family);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
[data-qti-text-appearance~='font-color'] {
|
|
187
|
+
color: var(--qti-font-color);
|
|
188
|
+
--color-base-content: var(--qti-font-color);
|
|
189
|
+
--pie-qti-base-content: var(--qti-font-color);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
[data-qti-text-appearance~='background-color'] {
|
|
193
|
+
background-color: var(--qti-background-color);
|
|
194
|
+
--color-base-100: var(--qti-background-color);
|
|
195
|
+
--pie-qti-base-100: var(--qti-background-color);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
[data-qti-text-appearance~='line-height'],
|
|
199
|
+
[data-qti-text-appearance~='line-height'] :where(p, li, td, th, label, span, div) {
|
|
200
|
+
line-height: var(--qti-line-height);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
[data-qti-text-appearance~='letter-spacing'] {
|
|
204
|
+
letter-spacing: var(--qti-letter-spacing);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
[data-qti-text-appearance~='word-spacing'] {
|
|
208
|
+
word-spacing: var(--qti-word-spacing);
|
|
209
|
+
}
|
|
@@ -245,6 +245,7 @@
|
|
|
245
245
|
.qti-display-inline-grid { display: inline-grid; }
|
|
246
246
|
.qti-display-table { display: table; }
|
|
247
247
|
.qti-display-table-row { display: table-row; }
|
|
248
|
+
.qti-display-table-cell { display: table-cell; }
|
|
248
249
|
.qti-display-list-item { display: list-item; }
|
|
249
250
|
|
|
250
251
|
/* Visually hidden but available to screen readers */
|
|
@@ -316,5 +317,197 @@
|
|
|
316
317
|
.qti-width-3-6 { width: 50%; }
|
|
317
318
|
.qti-width-4-6 { width: 66.6667%; }
|
|
318
319
|
.qti-width-5-6 { width: 83.3333%; }
|
|
319
|
-
.qti-width-
|
|
320
|
+
.qti-width-1-12 { width: 8.3333%; }
|
|
321
|
+
.qti-width-2-12 { width: 16.6667%; }
|
|
322
|
+
.qti-width-3-12 { width: 25%; }
|
|
323
|
+
.qti-width-4-12 { width: 33.3333%; }
|
|
324
|
+
.qti-width-5-12 { width: 41.6667%; }
|
|
325
|
+
.qti-width-6-12 { width: 50%; }
|
|
326
|
+
.qti-width-7-12 { width: 58.3333%; }
|
|
327
|
+
.qti-width-8-12 { width: 66.6667%; }
|
|
328
|
+
.qti-width-9-12 { width: 75%; }
|
|
329
|
+
.qti-width-10-12 { width: 83.3333%; }
|
|
330
|
+
.qti-width-11-12 { width: 91.6667%; }
|
|
331
|
+
.qti-width-full,
|
|
332
|
+
.qti-fullwidth { width: 100%; }
|
|
320
333
|
.qti-width-auto { width: auto; }
|
|
334
|
+
|
|
335
|
+
/* =============================================================================
|
|
336
|
+
Height (same scale as width)
|
|
337
|
+
============================================================================= */
|
|
338
|
+
|
|
339
|
+
.qti-height-0 { height: 0; }
|
|
340
|
+
.qti-height-px { height: 1px; }
|
|
341
|
+
.qti-height-0p5 { height: 0.125rem; }
|
|
342
|
+
.qti-height-1 { height: 0.25rem; }
|
|
343
|
+
.qti-height-1p5 { height: 0.375rem; }
|
|
344
|
+
.qti-height-2 { height: 0.5rem; }
|
|
345
|
+
.qti-height-2p5 { height: 0.625rem; }
|
|
346
|
+
.qti-height-3 { height: 0.75rem; }
|
|
347
|
+
.qti-height-3p5 { height: 0.875rem; }
|
|
348
|
+
.qti-height-4 { height: 1rem; }
|
|
349
|
+
.qti-height-5 { height: 1.25rem; }
|
|
350
|
+
.qti-height-6 { height: 1.5rem; }
|
|
351
|
+
.qti-height-7 { height: 1.75rem; }
|
|
352
|
+
.qti-height-8 { height: 2rem; }
|
|
353
|
+
.qti-height-9 { height: 2.25rem; }
|
|
354
|
+
.qti-height-10 { height: 2.5rem; }
|
|
355
|
+
.qti-height-11 { height: 2.75rem; }
|
|
356
|
+
.qti-height-12 { height: 3rem; }
|
|
357
|
+
.qti-height-14 { height: 3.5rem; }
|
|
358
|
+
.qti-height-16 { height: 4rem; }
|
|
359
|
+
.qti-height-20 { height: 5rem; }
|
|
360
|
+
.qti-height-24 { height: 6rem; }
|
|
361
|
+
.qti-height-28 { height: 7rem; }
|
|
362
|
+
.qti-height-32 { height: 8rem; }
|
|
363
|
+
.qti-height-36 { height: 9rem; }
|
|
364
|
+
.qti-height-40 { height: 10rem; }
|
|
365
|
+
.qti-height-44 { height: 11rem; }
|
|
366
|
+
.qti-height-48 { height: 12rem; }
|
|
367
|
+
.qti-height-52 { height: 13rem; }
|
|
368
|
+
.qti-height-56 { height: 14rem; }
|
|
369
|
+
.qti-height-60 { height: 15rem; }
|
|
370
|
+
.qti-height-64 { height: 16rem; }
|
|
371
|
+
.qti-height-72 { height: 18rem; }
|
|
372
|
+
.qti-height-80 { height: 20rem; }
|
|
373
|
+
.qti-height-96 { height: 24rem; }
|
|
374
|
+
.qti-height-1-2 { height: 50%; }
|
|
375
|
+
.qti-height-1-3 { height: 33.3333%; }
|
|
376
|
+
.qti-height-2-3 { height: 66.6667%; }
|
|
377
|
+
.qti-height-1-4 { height: 25%; }
|
|
378
|
+
.qti-height-2-4 { height: 50%; }
|
|
379
|
+
.qti-height-3-4 { height: 75%; }
|
|
380
|
+
.qti-height-1-5 { height: 20%; }
|
|
381
|
+
.qti-height-2-5 { height: 40%; }
|
|
382
|
+
.qti-height-3-5 { height: 60%; }
|
|
383
|
+
.qti-height-4-5 { height: 80%; }
|
|
384
|
+
.qti-height-1-6 { height: 16.6667%; }
|
|
385
|
+
.qti-height-2-6 { height: 33.3333%; }
|
|
386
|
+
.qti-height-3-6 { height: 50%; }
|
|
387
|
+
.qti-height-4-6 { height: 66.6667%; }
|
|
388
|
+
.qti-height-5-6 { height: 83.3333%; }
|
|
389
|
+
.qti-height-full { height: 100%; }
|
|
390
|
+
.qti-height-auto { height: auto; }
|
|
391
|
+
|
|
392
|
+
/* =============================================================================
|
|
393
|
+
Text Indent
|
|
394
|
+
============================================================================= */
|
|
395
|
+
|
|
396
|
+
.qti-text-indent-0 { text-indent: 0; }
|
|
397
|
+
.qti-text-indent-px { text-indent: 1px; }
|
|
398
|
+
.qti-text-indent-0p5 { text-indent: 0.125rem; }
|
|
399
|
+
.qti-text-indent-1 { text-indent: 0.25rem; }
|
|
400
|
+
.qti-text-indent-1p5 { text-indent: 0.375rem; }
|
|
401
|
+
.qti-text-indent-2 { text-indent: 0.5rem; }
|
|
402
|
+
.qti-text-indent-2p5 { text-indent: 0.625rem; }
|
|
403
|
+
.qti-text-indent-3 { text-indent: 0.75rem; }
|
|
404
|
+
.qti-text-indent-3p5 { text-indent: 0.875rem; }
|
|
405
|
+
.qti-text-indent-4 { text-indent: 1rem; }
|
|
406
|
+
.qti-text-indent-5 { text-indent: 1.25rem; }
|
|
407
|
+
.qti-text-indent-6 { text-indent: 1.5rem; }
|
|
408
|
+
.qti-text-indent-7 { text-indent: 1.75rem; }
|
|
409
|
+
.qti-text-indent-8 { text-indent: 2rem; }
|
|
410
|
+
.qti-text-indent-12 { text-indent: 3rem; }
|
|
411
|
+
.qti-text-indent-16 { text-indent: 4rem; }
|
|
412
|
+
.qti-text-indent-20 { text-indent: 5rem; }
|
|
413
|
+
.qti-text-indent-24 { text-indent: 6rem; }
|
|
414
|
+
.qti-text-indent-28 { text-indent: 7rem; }
|
|
415
|
+
.qti-text-indent-32 { text-indent: 8rem; }
|
|
416
|
+
|
|
417
|
+
/* =============================================================================
|
|
418
|
+
Flex
|
|
419
|
+
============================================================================= */
|
|
420
|
+
|
|
421
|
+
.qti-flex-direction-column { flex-direction: column; }
|
|
422
|
+
.qti-flex-direction-row { flex-direction: row; }
|
|
423
|
+
.qti-flex-grow-1 { flex-grow: 1; }
|
|
424
|
+
.qti-flex-grow-0 { flex-grow: 0; }
|
|
425
|
+
|
|
426
|
+
/* =============================================================================
|
|
427
|
+
Float
|
|
428
|
+
============================================================================= */
|
|
429
|
+
|
|
430
|
+
.qti-float-left { float: left; }
|
|
431
|
+
.qti-float-right { float: right; }
|
|
432
|
+
.qti-float-none { float: none; }
|
|
433
|
+
.qti-float-clear-left { clear: left; }
|
|
434
|
+
.qti-float-clear-right { clear: right; }
|
|
435
|
+
.qti-float-clear-both { clear: both; }
|
|
436
|
+
.qti-float-clearfix::after {
|
|
437
|
+
content: '';
|
|
438
|
+
clear: both;
|
|
439
|
+
display: table;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/* =============================================================================
|
|
443
|
+
Vertical Writing
|
|
444
|
+
============================================================================= */
|
|
445
|
+
|
|
446
|
+
.qti-writing-mode-vertical-rl { writing-mode: vertical-rl; }
|
|
447
|
+
.qti-writing-mode-vertical-lr { writing-mode: vertical-lr; }
|
|
448
|
+
.qti-writing-mode-horizontal-tb { writing-mode: horizontal-tb; }
|
|
449
|
+
.qti-text-orientation-upright { text-orientation: upright; }
|
|
450
|
+
.qti-text-orientation-mixed { text-orientation: mixed; }
|
|
451
|
+
.qti-text-orientation-sideways { text-orientation: sideways; }
|
|
452
|
+
.qti-text-combine-upright-all { text-combine-upright: all; }
|
|
453
|
+
|
|
454
|
+
/* =============================================================================
|
|
455
|
+
List Style Type
|
|
456
|
+
============================================================================= */
|
|
457
|
+
|
|
458
|
+
.qti-list-style-type-none { list-style-type: none; }
|
|
459
|
+
.qti-list-style-type-disc { list-style-type: disc; }
|
|
460
|
+
.qti-list-style-type-circle { list-style-type: circle; }
|
|
461
|
+
.qti-list-style-type-square { list-style-type: square; }
|
|
462
|
+
.qti-list-style-type-decimal { list-style-type: decimal; }
|
|
463
|
+
.qti-list-style-type-decimal-leading-zero { list-style-type: decimal-leading-zero; }
|
|
464
|
+
.qti-list-style-type-lower-alpha { list-style-type: lower-alpha; }
|
|
465
|
+
.qti-list-style-type-upper-alpha { list-style-type: upper-alpha; }
|
|
466
|
+
.qti-list-style-type-lower-roman { list-style-type: lower-roman; }
|
|
467
|
+
.qti-list-style-type-upper-roman { list-style-type: upper-roman; }
|
|
468
|
+
.qti-list-style-type-lower-latin { list-style-type: lower-latin; }
|
|
469
|
+
.qti-list-style-type-upper-latin { list-style-type: upper-latin; }
|
|
470
|
+
.qti-list-style-type-lower-greek { list-style-type: lower-greek; }
|
|
471
|
+
.qti-list-style-type-arabic-indic { list-style-type: arabic-indic; }
|
|
472
|
+
.qti-list-style-type-armenian { list-style-type: armenian; }
|
|
473
|
+
.qti-list-style-type-lower-armenian { list-style-type: lower-armenian; }
|
|
474
|
+
.qti-list-style-type-upper-armenian { list-style-type: upper-armenian; }
|
|
475
|
+
.qti-list-style-type-bengali { list-style-type: bengali; }
|
|
476
|
+
.qti-list-style-type-cambodian { list-style-type: cambodian; }
|
|
477
|
+
.qti-list-style-type-simp-chinese-formal { list-style-type: simp-chinese-formal; }
|
|
478
|
+
.qti-list-style-type-simp-chinese-informal { list-style-type: simp-chinese-informal; }
|
|
479
|
+
.qti-list-style-type-trad-chinese-formal { list-style-type: trad-chinese-formal; }
|
|
480
|
+
.qti-list-style-type-trad-chinese-informal { list-style-type: trad-chinese-informal; }
|
|
481
|
+
.qti-list-style-type-cjk-ideographic { list-style-type: cjk-ideographic; }
|
|
482
|
+
.qti-list-style-type-cjk-heavenly-stem { list-style-type: cjk-heavenly-stem; }
|
|
483
|
+
.qti-list-style-type-cjk-earthly-branch { list-style-type: cjk-earthly-branch; }
|
|
484
|
+
.qti-list-style-type-devanagari { list-style-type: devanagari; }
|
|
485
|
+
.qti-list-style-type-ethiopic-halehame-ti-er { list-style-type: ethiopic-halehame-ti-er; }
|
|
486
|
+
.qti-list-style-type-ethiopic-halehame-ti-et { list-style-type: ethiopic-halehame-ti-et; }
|
|
487
|
+
.qti-list-style-type-ethiopic-halehame-am { list-style-type: ethiopic-halehame-am; }
|
|
488
|
+
.qti-list-style-type-ethiopic-halehame { list-style-type: ethiopic-halehame; }
|
|
489
|
+
.qti-list-style-type-georgian { list-style-type: georgian; }
|
|
490
|
+
.qti-list-style-type-gujarati { list-style-type: gujarati; }
|
|
491
|
+
.qti-list-style-type-gurmukhi { list-style-type: gurmukhi; }
|
|
492
|
+
.qti-list-style-type-hangul { list-style-type: hangul; }
|
|
493
|
+
.qti-list-style-type-hangul-consonant { list-style-type: hangul-consonant; }
|
|
494
|
+
.qti-list-style-type-hebrew { list-style-type: hebrew; }
|
|
495
|
+
.qti-list-style-type-hiragana { list-style-type: hiragana; }
|
|
496
|
+
.qti-list-style-type-hiragana-iroha { list-style-type: hiragana-iroha; }
|
|
497
|
+
.qti-list-style-type-kannada { list-style-type: kannada; }
|
|
498
|
+
.qti-list-style-type-katakana { list-style-type: katakana; }
|
|
499
|
+
.qti-list-style-type-katakana-iroha { list-style-type: katakana-iroha; }
|
|
500
|
+
.qti-list-style-type-khmer { list-style-type: khmer; }
|
|
501
|
+
.qti-list-style-type-korean-hangul-formal { list-style-type: korean-hangul-formal; }
|
|
502
|
+
.qti-list-style-type-korean-hanja-formal { list-style-type: korean-hanja-formal; }
|
|
503
|
+
.qti-list-style-type-korean-hanja-informal { list-style-type: korean-hanja-informal; }
|
|
504
|
+
.qti-list-style-type-lao { list-style-type: lao; }
|
|
505
|
+
.qti-list-style-type-malayalam { list-style-type: malayalam; }
|
|
506
|
+
.qti-list-style-type-mongolian { list-style-type: mongolian; }
|
|
507
|
+
.qti-list-style-type-myanmar { list-style-type: myanmar; }
|
|
508
|
+
.qti-list-style-type-oriya { list-style-type: oriya; }
|
|
509
|
+
.qti-list-style-type-persian { list-style-type: persian; }
|
|
510
|
+
.qti-list-style-type-thai { list-style-type: thai; }
|
|
511
|
+
.qti-list-style-type-tibetan { list-style-type: tibetan; }
|
|
512
|
+
.qti-list-style-type-telugu { list-style-type: telugu; }
|
|
513
|
+
.qti-list-style-type-urdu { list-style-type: urdu; }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { InteractionAccessibility } from '@pie-qti/item-player';
|
|
2
|
+
/** The id of the hidden element `InteractionDescription` renders in an interaction's shadow root. */
|
|
3
|
+
export declare const INTERACTION_DESCRIPTION_ID = "qti-interaction-description";
|
|
4
|
+
/**
|
|
5
|
+
* Attributes that give an interaction's root its authored accessible name and description:
|
|
6
|
+
* a labelled `group`, or nothing when the interaction carries no authored `aria-*`. The
|
|
7
|
+
* description is the text `InteractionDescription` renders beside them.
|
|
8
|
+
*/
|
|
9
|
+
export declare function interactionAria(interaction: {
|
|
10
|
+
accessibility?: InteractionAccessibility;
|
|
11
|
+
} | null | undefined): Record<string, string>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The id of the hidden element `InteractionDescription` renders in an interaction's shadow root. */
|
|
2
|
+
export const INTERACTION_DESCRIPTION_ID = 'qti-interaction-description';
|
|
3
|
+
/**
|
|
4
|
+
* Attributes that give an interaction's root its authored accessible name and description:
|
|
5
|
+
* a labelled `group`, or nothing when the interaction carries no authored `aria-*`. The
|
|
6
|
+
* description is the text `InteractionDescription` renders beside them.
|
|
7
|
+
*/
|
|
8
|
+
export function interactionAria(interaction) {
|
|
9
|
+
const accessibility = interaction?.accessibility;
|
|
10
|
+
if (!accessibility?.label && !accessibility?.description)
|
|
11
|
+
return {};
|
|
12
|
+
return {
|
|
13
|
+
role: 'group',
|
|
14
|
+
...(accessibility.label ? { 'aria-label': accessibility.label } : {}),
|
|
15
|
+
...(accessibility.description ? { 'aria-describedby': INTERACTION_DESCRIPTION_ID } : {}),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=interactionAria.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactionAria.js","sourceRoot":"","sources":["../../../src/shared/utils/interactionAria.ts"],"names":[],"mappings":"AAEA,qGAAqG;AACrG,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AAExE;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC9B,WAA4E;IAE5E,MAAM,aAAa,GAAG,WAAW,EAAE,aAAa,CAAC;IACjD,IAAI,CAAC,aAAa,EAAE,KAAK,IAAI,CAAC,aAAa,EAAE,WAAW;QAAE,OAAO,EAAE,CAAC;IACpE,OAAO;QACN,IAAI,EAAE,OAAO;QACb,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,GAAG,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACxF,CAAC;AACH,CAAC","sourcesContent":["import type { InteractionAccessibility } from '@pie-qti/item-player';\n\n/** The id of the hidden element `InteractionDescription` renders in an interaction's shadow root. */\nexport const INTERACTION_DESCRIPTION_ID = 'qti-interaction-description';\n\n/**\n * Attributes that give an interaction's root its authored accessible name and description:\n * a labelled `group`, or nothing when the interaction carries no authored `aria-*`. The\n * description is the text `InteractionDescription` renders beside them.\n */\nexport function interactionAria(\n\tinteraction: { accessibility?: InteractionAccessibility } | null | undefined,\n): Record<string, string> {\n\tconst accessibility = interaction?.accessibility;\n\tif (!accessibility?.label && !accessibility?.description) return {};\n\treturn {\n\t\trole: 'group',\n\t\t...(accessibility.label ? { 'aria-label': accessibility.label } : {}),\n\t\t...(accessibility.description ? { 'aria-describedby': INTERACTION_DESCRIPTION_ID } : {}),\n\t};\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-qti/default-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
4
|
"description": "Default Svelte-based component implementations for QTI (2.x and 3.0) player",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "rm -rf dist && tsc && vite build && mkdir -p dist/shared/styles && cp src/shared/styles/qti-shared-vocabulary.css
|
|
10
|
-
"test": "bun test",
|
|
9
|
+
"build": "rm -rf dist && tsc && vite build && mkdir -p dist/shared/styles && cp src/shared/styles/qti-shared-vocabulary.css src/shared/styles/qti-pnp.css dist/shared/styles/",
|
|
10
|
+
"test": "bun test && bun run test:component",
|
|
11
|
+
"test:component": "vitest run",
|
|
11
12
|
"typecheck": "tsc --noEmit",
|
|
12
13
|
"check": "svelte-check --tsconfig ./tsconfig.svelte.json",
|
|
13
14
|
"lint": "biome check .",
|
|
@@ -27,8 +28,8 @@
|
|
|
27
28
|
],
|
|
28
29
|
"license": "MIT",
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"@pie-qti/item-player": "0.
|
|
31
|
-
"@pie-qti/qti-common": "0.
|
|
31
|
+
"@pie-qti/item-player": "1.0.0-beta.0",
|
|
32
|
+
"@pie-qti/qti-common": "1.0.0-beta.0",
|
|
32
33
|
"@tiptap/core": "3.31.4",
|
|
33
34
|
"@tiptap/extension-mathematics": "3.31.4",
|
|
34
35
|
"@tiptap/extension-placeholder": "3.31.4",
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
"mathlive": "^0.110.0"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
|
-
"@pie-qti/i18n": "0.
|
|
40
|
+
"@pie-qti/i18n": "1.0.0-beta.0"
|
|
40
41
|
},
|
|
41
42
|
"peerDependenciesMeta": {
|
|
42
43
|
"@pie-qti/i18n": {
|
|
@@ -45,14 +46,16 @@
|
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@biomejs/biome": "^2.5.15",
|
|
48
|
-
"@pie-qti/i18n": "0.
|
|
49
|
+
"@pie-qti/i18n": "1.0.0-beta.0",
|
|
49
50
|
"@sveltejs/vite-plugin-svelte": "7.3.0",
|
|
50
51
|
"@types/node": "^26.6.4",
|
|
52
|
+
"jsdom": "^30.1.3",
|
|
51
53
|
"linkedom": "^0.18.13",
|
|
52
54
|
"svelte": "5.57.1",
|
|
53
55
|
"svelte-check": "^4.7.5",
|
|
54
56
|
"typescript": "^5.9.3",
|
|
55
|
-
"vite": "8.2.1"
|
|
57
|
+
"vite": "8.2.1",
|
|
58
|
+
"vitest": "^5.0.5"
|
|
56
59
|
},
|
|
57
60
|
"exports": {
|
|
58
61
|
".": {
|
|
@@ -91,6 +94,14 @@
|
|
|
91
94
|
"./qti-shared-vocabulary.css": {
|
|
92
95
|
"style": "./dist/shared/styles/qti-shared-vocabulary.css",
|
|
93
96
|
"default": "./dist/shared/styles/qti-shared-vocabulary.css"
|
|
97
|
+
},
|
|
98
|
+
"./shared/styles/qti-pnp.css": {
|
|
99
|
+
"style": "./dist/shared/styles/qti-pnp.css",
|
|
100
|
+
"default": "./dist/shared/styles/qti-pnp.css"
|
|
101
|
+
},
|
|
102
|
+
"./qti-pnp.css": {
|
|
103
|
+
"style": "./dist/shared/styles/qti-pnp.css",
|
|
104
|
+
"default": "./dist/shared/styles/qti-pnp.css"
|
|
94
105
|
}
|
|
95
106
|
},
|
|
96
107
|
"repository": {
|