@pie-element/multiple-choice 13.4.2-beta.2 → 13.4.2
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/CHANGELOG.md +63 -31
- package/configure/CHANGELOG.md +48 -26
- package/configure/package.json +4 -4
- package/controller/CHANGELOG.md +11 -36
- package/controller/package.json +1 -1
- package/lib/choice.js +8 -1
- package/lib/choice.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/module/configure.js +1 -1
- package/module/controller.js +12 -15
- package/module/element.js +1 -1
- package/module/index.html +1 -1
- package/module/manifest.json +3 -3
- package/module/print.html +1 -1
- package/module/print.js +1 -1
- package/package.json +4 -4
- package/configure/lib/__tests__/root.test.js +0 -279
- package/controller/lib/__tests__/index.test.js +0 -561
- package/controller/lib/__tests__/utils.test.js +0 -8
- package/docs/demo/pie.manifest.json +0 -11
- package/lib/__tests__/choice-input-test.js +0 -49
- package/lib/__tests__/choice-input.test.js +0 -49
- package/lib/__tests__/index-test.js +0 -206
- package/lib/__tests__/index.test.js +0 -221
- package/lib/__tests__/key-events-test.js +0 -95
- package/lib/__tests__/key-events.test.js +0 -107
- package/lib/__tests__/multiple-choice-test.js +0 -101
- package/lib/__tests__/multiple-choice.test.js +0 -256
- package/lib/__tests__/session-updater-test.js +0 -70
- package/lib/__tests__/session-updater.test.js +0 -70
package/CHANGELOG.md
CHANGED
|
@@ -3,71 +3,103 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [13.4.2
|
|
6
|
+
## [13.4.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.4.1...@pie-element/multiple-choice@13.4.2) (2026-09-04)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# [13.5.0-beta.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.5.0-beta.6...@pie-element/multiple-choice@13.5.0-beta.7) (2026-08-20)
|
|
8
|
+
### Bug Fixes
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
- bump libs PIE-978, PIE-980 ([96489ba](https://github.com/pie-framework/pie-elements/commit/96489ba3c220604f21c3ce4500d79f4389266e9e))
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
## [13.4.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.4.0...@pie-element/multiple-choice@13.4.1) (2026-08-26)
|
|
15
13
|
|
|
16
14
|
**Note:** Version bump only for package @pie-element/multiple-choice
|
|
17
15
|
|
|
18
|
-
# [13.
|
|
16
|
+
# [13.4.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.3.8...@pie-element/multiple-choice@13.4.0) (2026-08-21)
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
### Bug Fixes
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
- move [@pie-lib](https://github.com/pie-lib) deps back to latest, off next prereleases PIE-927 ([a53e012](https://github.com/pie-framework/pie-elements/commit/a53e0127eb4ac95ece54e1e2bd669ae4974f4251))
|
|
21
|
+
- read the prompt container by class, not by the id pie-lib removed PIE-927 ([aaaf6c2](https://github.com/pie-framework/pie-elements/commit/aaaf6c2f189de3b39f9de85969aeb2e50376c548))
|
|
22
|
+
- **theming:** move the grey palette reads onto --pie-\* tokens PIE-856 ([d7d005b](https://github.com/pie-framework/pie-elements/commit/d7d005bf081843335b4b0377852f2ecd075cb62d)), closes [#000000](https://github.com/pie-framework/pie-elements/issues/000000) [#E0E1E6](https://github.com/pie-framework/pie-elements/issues/E0E1E6) [#646464](https://github.com/pie-framework/pie-elements/issues/646464) [#616161](https://github.com/pie-framework/pie-elements/issues/616161) [#E0E1E6](https://github.com/pie-framework/pie-elements/issues/E0E1E6) [#C0C3](https://github.com/pie-framework/pie-elements/issues/C0C3)
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
### Features
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
- bump libs PIE-856, PIE-681, PIE-927 ([cb26d7a](https://github.com/pie-framework/pie-elements/commit/cb26d7afa6c99522533c321d5ff8ce3148a66e9e))
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
## [13.3.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.3.7...@pie-element/multiple-choice@13.3.8) (2026-08-19)
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
### Bug Fixes
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
- bump libs and shared modules PIE-681, PIE-708 ([08af8b5](https://github.com/pie-framework/pie-elements/commit/08af8b5802aecc8ee5454a1b6d60277d7ec94204))
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
## [13.3.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.3.5...@pie-element/multiple-choice@13.3.7) (2026-08-13)
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
### Bug Fixes
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
- **multiple-choice, number-line:** add render math in configure PIE-763 ([b7dfd29](https://github.com/pie-framework/pie-elements/commit/b7dfd29e6d5f1981799f8cef96f6f73ae829951c))
|
|
39
|
+
- **multiple-choice, number-line:** revert initial fix, avoid calling renderMath is not necessary PIE-763 ([d8f7078](https://github.com/pie-framework/pie-elements/commit/d8f70789a8ab88e65c8ee1f0235e3603065b2090))
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
## [13.3.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.3.4...@pie-element/multiple-choice@13.3.6) (2026-08-11)
|
|
42
|
+
|
|
43
|
+
### Bug Fixes
|
|
41
44
|
|
|
42
|
-
|
|
45
|
+
- **multiple-choice:** maxSelections should not affect single choices, repair tests in src PIE-432 ([feba612](https://github.com/pie-framework/pie-elements/commit/feba61239db62626c05fa8099d8adc373f968061))
|
|
46
|
+
- **multiple-choice:** maxSelections should not affect single choices, repair tests in src PIE-432 ([6010172](https://github.com/pie-framework/pie-elements/commit/6010172f083a9670b5c0f48375e690c483bdedaf))
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
## [13.3.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.3.4...@pie-element/multiple-choice@13.3.5) (2026-07-31)
|
|
45
49
|
|
|
46
|
-
|
|
50
|
+
### Bug Fixes
|
|
47
51
|
|
|
48
|
-
**
|
|
52
|
+
- **multiple-choice:** maxSelections should not affect single choices, repair tests in src PIE-432 ([feba612](https://github.com/pie-framework/pie-elements/commit/feba61239db62626c05fa8099d8adc373f968061))
|
|
53
|
+
- **multiple-choice:** maxSelections should not affect single choices, repair tests in src PIE-432 ([6010172](https://github.com/pie-framework/pie-elements/commit/6010172f083a9670b5c0f48375e690c483bdedaf))
|
|
49
54
|
|
|
50
|
-
|
|
55
|
+
## [13.3.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.3.3...@pie-element/multiple-choice@13.3.4) (2026-07-08)
|
|
51
56
|
|
|
52
57
|
### Bug Fixes
|
|
53
58
|
|
|
54
59
|
- bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
|
|
61
|
+
## [13.3.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.3.2...@pie-element/multiple-choice@13.3.3) (2026-07-02)
|
|
62
|
+
|
|
63
|
+
### Bug Fixes
|
|
64
|
+
|
|
58
65
|
- bump shared modules and libs PIE-695, PIE-697, PIE-699, PIE-680, PIE-714, PIE-665, PIE-656 ([4b76ae7](https://github.com/pie-framework/pie-elements/commit/4b76ae75d1c5ea6d55f7c6fb53f299dfcbda2b1f))
|
|
59
|
-
-
|
|
66
|
+
- sync libs versions ([48b5be9](https://github.com/pie-framework/pie-elements/commit/48b5be9559eb5b5235ca05f51c5f0161032a7041))
|
|
67
|
+
|
|
68
|
+
## [13.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.3.1...@pie-element/multiple-choice@13.3.2) (2026-06-22)
|
|
69
|
+
|
|
70
|
+
### Bug Fixes
|
|
71
|
+
|
|
72
|
+
- bump shared modules and libs PIE-674, PIE-662, PIE-705, PIE-674, PIE-963 ([78a3f64](https://github.com/pie-framework/pie-elements/commit/78a3f64652c9581c61bd4159f3210fc1e32d8bcf))
|
|
60
73
|
- handle webcomponent lifecycle on every element that misses it PIE-703 ([9d5923f](https://github.com/pie-framework/pie-elements/commit/9d5923f973f0471e1e8f69ad4309cfc63d980d93))
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
74
|
+
|
|
75
|
+
## [13.3.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.3.0...@pie-element/multiple-choice@13.3.1) (2026-06-17)
|
|
76
|
+
|
|
77
|
+
### Bug Fixes
|
|
78
|
+
|
|
79
|
+
- bump shared modules and libs PIE-661 PIE-664 PIE-683 PIE-666 PIE-656 PIE-657 PIE-658 PIE-659 PIE-670 ([ebd6be4](https://github.com/pie-framework/pie-elements/commit/ebd6be4fd48fca41ad4c4908f606b25334731aed))
|
|
80
|
+
|
|
81
|
+
# [13.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.2.2...@pie-element/multiple-choice@13.3.0) (2026-06-12)
|
|
82
|
+
|
|
83
|
+
### Bug Fixes
|
|
84
|
+
|
|
85
|
+
- bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
|
|
64
86
|
- surpress ripple anim that generated visible background PIE-104 ([5c653ca](https://github.com/pie-framework/pie-elements/commit/5c653ca9a2967b1283b59e7b8fdb387ac76b6fa2))
|
|
65
|
-
- sync libs versions ([48b5be9](https://github.com/pie-framework/pie-elements/commit/48b5be9559eb5b5235ca05f51c5f0161032a7041))
|
|
66
87
|
|
|
67
88
|
### Features
|
|
68
89
|
|
|
69
90
|
- **multiple-choice:** hover styles for checkboxes and radios PIE-558 ([c5c38e8](https://github.com/pie-framework/pie-elements/commit/c5c38e8377e6ec919d100c5457531233ca119fbd))
|
|
70
91
|
|
|
92
|
+
## [13.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.2.1...@pie-element/multiple-choice@13.2.2) (2026-06-04)
|
|
93
|
+
|
|
94
|
+
### Bug Fixes
|
|
95
|
+
|
|
96
|
+
- bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
|
|
97
|
+
- **multiple-choice:** change keyboard focus indicator PIE-104 ([cbb6308](https://github.com/pie-framework/pie-elements/commit/cbb6308c41137e1054a0bcb3179fe1c8fbdd4188))
|
|
98
|
+
|
|
99
|
+
## [13.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.2.0...@pie-element/multiple-choice@13.2.1) (2026-05-21)
|
|
100
|
+
|
|
101
|
+
**Note:** Version bump only for package @pie-element/multiple-choice
|
|
102
|
+
|
|
71
103
|
# [13.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.2.0-next.1...@pie-element/multiple-choice@13.2.0) (2026-05-21)
|
|
72
104
|
|
|
73
105
|
### Bug Fixes
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,62 +3,84 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## [10.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.2.1...@pie-element/multiple-choice-configure@10.2.2) (2026-09-04)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- bump libs PIE-978, PIE-980 ([96489ba](https://github.com/pie-framework/pie-elements/commit/96489ba3c220604f21c3ce4500d79f4389266e9e))
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
## [10.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.2.0...@pie-element/multiple-choice-configure@10.2.1) (2026-08-26)
|
|
11
13
|
|
|
12
14
|
**Note:** Version bump only for package @pie-element/multiple-choice-configure
|
|
13
15
|
|
|
14
|
-
# [10.
|
|
16
|
+
# [10.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.11...@pie-element/multiple-choice-configure@10.2.0) (2026-08-21)
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
### Features
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
- bump libs PIE-856, PIE-681, PIE-927 ([cb26d7a](https://github.com/pie-framework/pie-elements/commit/cb26d7afa6c99522533c321d5ff8ce3148a66e9e))
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
## [10.1.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.10...@pie-element/multiple-choice-configure@10.1.11) (2026-08-19)
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
### Bug Fixes
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
- bump libs and shared modules PIE-681, PIE-708 ([08af8b5](https://github.com/pie-framework/pie-elements/commit/08af8b5802aecc8ee5454a1b6d60277d7ec94204))
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
## [10.1.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.8...@pie-element/multiple-choice-configure@10.1.10) (2026-08-13)
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
- **multiple-choice, number-line:** add render math in configure PIE-763 ([b7dfd29](https://github.com/pie-framework/pie-elements/commit/b7dfd29e6d5f1981799f8cef96f6f73ae829951c))
|
|
33
|
+
- **multiple-choice, number-line:** revert initial fix, avoid calling renderMath is not necessary PIE-763 ([d8f7078](https://github.com/pie-framework/pie-elements/commit/d8f70789a8ab88e65c8ee1f0235e3603065b2090))
|
|
29
34
|
|
|
30
|
-
|
|
35
|
+
## [10.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.7...@pie-element/multiple-choice-configure@10.1.9) (2026-08-11)
|
|
31
36
|
|
|
32
37
|
**Note:** Version bump only for package @pie-element/multiple-choice-configure
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
## [10.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.7...@pie-element/multiple-choice-configure@10.1.8) (2026-07-31)
|
|
35
40
|
|
|
36
41
|
**Note:** Version bump only for package @pie-element/multiple-choice-configure
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
## [10.1.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.6...@pie-element/multiple-choice-configure@10.1.7) (2026-07-08)
|
|
39
44
|
|
|
40
|
-
|
|
45
|
+
### Bug Fixes
|
|
41
46
|
|
|
42
|
-
|
|
47
|
+
- bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
|
|
43
48
|
|
|
44
|
-
|
|
49
|
+
## [10.1.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.5...@pie-element/multiple-choice-configure@10.1.6) (2026-07-02)
|
|
45
50
|
|
|
46
|
-
|
|
51
|
+
### Bug Fixes
|
|
47
52
|
|
|
48
|
-
|
|
53
|
+
- bump shared modules and libs PIE-695, PIE-697, PIE-699, PIE-680, PIE-714, PIE-665, PIE-656 ([4b76ae7](https://github.com/pie-framework/pie-elements/commit/4b76ae75d1c5ea6d55f7c6fb53f299dfcbda2b1f))
|
|
54
|
+
- sync libs versions ([48b5be9](https://github.com/pie-framework/pie-elements/commit/48b5be9559eb5b5235ca05f51c5f0161032a7041))
|
|
49
55
|
|
|
50
|
-
|
|
56
|
+
## [10.1.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.4...@pie-element/multiple-choice-configure@10.1.5) (2026-06-22)
|
|
51
57
|
|
|
52
58
|
### Bug Fixes
|
|
53
59
|
|
|
54
|
-
- bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
|
|
55
|
-
- bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
|
|
56
|
-
- bump shared modules and libs PIE-661 PIE-664 PIE-683 PIE-666 PIE-656 PIE-657 PIE-658 PIE-659 PIE-670 ([ebd6be4](https://github.com/pie-framework/pie-elements/commit/ebd6be4fd48fca41ad4c4908f606b25334731aed))
|
|
57
60
|
- bump shared modules and libs PIE-674, PIE-662, PIE-705, PIE-674, PIE-963 ([78a3f64](https://github.com/pie-framework/pie-elements/commit/78a3f64652c9581c61bd4159f3210fc1e32d8bcf))
|
|
58
|
-
- bump shared modules and libs PIE-695, PIE-697, PIE-699, PIE-680, PIE-714, PIE-665, PIE-656 ([4b76ae7](https://github.com/pie-framework/pie-elements/commit/4b76ae75d1c5ea6d55f7c6fb53f299dfcbda2b1f))
|
|
59
|
-
- bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
|
|
60
61
|
- handle webcomponent lifecycle on every element that misses it PIE-703 ([9d5923f](https://github.com/pie-framework/pie-elements/commit/9d5923f973f0471e1e8f69ad4309cfc63d980d93))
|
|
61
|
-
|
|
62
|
+
|
|
63
|
+
## [10.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.3...@pie-element/multiple-choice-configure@10.1.4) (2026-06-17)
|
|
64
|
+
|
|
65
|
+
### Bug Fixes
|
|
66
|
+
|
|
67
|
+
- bump shared modules and libs PIE-661 PIE-664 PIE-683 PIE-666 PIE-656 PIE-657 PIE-658 PIE-659 PIE-670 ([ebd6be4](https://github.com/pie-framework/pie-elements/commit/ebd6be4fd48fca41ad4c4908f606b25334731aed))
|
|
68
|
+
|
|
69
|
+
## [10.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.2...@pie-element/multiple-choice-configure@10.1.3) (2026-06-12)
|
|
70
|
+
|
|
71
|
+
### Bug Fixes
|
|
72
|
+
|
|
73
|
+
- bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
|
|
74
|
+
|
|
75
|
+
## [10.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.1...@pie-element/multiple-choice-configure@10.1.2) (2026-06-04)
|
|
76
|
+
|
|
77
|
+
### Bug Fixes
|
|
78
|
+
|
|
79
|
+
- bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
|
|
80
|
+
|
|
81
|
+
## [10.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.0...@pie-element/multiple-choice-configure@10.1.1) (2026-05-21)
|
|
82
|
+
|
|
83
|
+
**Note:** Version bump only for package @pie-element/multiple-choice-configure
|
|
62
84
|
|
|
63
85
|
# [10.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.0-next.1...@pie-element/multiple-choice-configure@10.1.0) (2026-05-21)
|
|
64
86
|
|
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multiple-choice-configure",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"@mui/icons-material": "^7.3.4",
|
|
11
11
|
"@mui/material": "^7.3.4",
|
|
12
12
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
13
|
-
"@pie-lib/config-ui": "13.
|
|
14
|
-
"@pie-lib/editable-html-tip-tap": "2.
|
|
15
|
-
"@pie-lib/render-ui": "
|
|
13
|
+
"@pie-lib/config-ui": "13.0.19",
|
|
14
|
+
"@pie-lib/editable-html-tip-tap": "2.1.17",
|
|
15
|
+
"@pie-lib/render-ui": "7.0.2",
|
|
16
16
|
"debug": "^4.1.1",
|
|
17
17
|
"lodash-es": "^4.17.23",
|
|
18
18
|
"prop-types": "^15.8.1",
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,57 +3,32 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## [8.1.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@8.1.3...@pie-element/multiple-choice-controller@8.1.5) (2026-08-13)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @pie-element/multiple-choice-controller
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## [8.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@8.1.2...@pie-element/multiple-choice-controller@8.1.4) (2026-08-11)
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# [8.4.0-beta.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@8.4.0-beta.5...@pie-element/multiple-choice-controller@8.4.0-beta.6) (2026-08-14)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @pie-element/multiple-choice-controller
|
|
17
|
-
|
|
18
|
-
# [8.4.0-beta.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@8.4.0-beta.4...@pie-element/multiple-choice-controller@8.4.0-beta.5) (2026-08-11)
|
|
19
|
-
|
|
20
|
-
**Note:** Version bump only for package @pie-element/multiple-choice-controller
|
|
21
|
-
|
|
22
|
-
# [8.4.0-beta.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@8.4.0-beta.3...@pie-element/multiple-choice-controller@8.4.0-beta.4) (2026-08-11)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @pie-element/multiple-choice-controller
|
|
25
|
-
|
|
26
|
-
# [8.4.0-beta.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@8.4.0-beta.2...@pie-element/multiple-choice-controller@8.4.0-beta.3) (2026-08-11)
|
|
27
|
-
|
|
28
|
-
**Note:** Version bump only for package @pie-element/multiple-choice-controller
|
|
29
|
-
|
|
30
|
-
# [8.4.0-beta.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@8.4.0-beta.1...@pie-element/multiple-choice-controller@8.4.0-beta.2) (2026-08-11)
|
|
12
|
+
### Bug Fixes
|
|
31
13
|
|
|
32
|
-
**
|
|
14
|
+
- **multiple-choice:** maxSelections should not affect single choices, repair tests in src PIE-432 ([6010172](https://github.com/pie-framework/pie-elements/commit/6010172f083a9670b5c0f48375e690c483bdedaf))
|
|
33
15
|
|
|
34
|
-
|
|
16
|
+
## [8.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@8.1.2...@pie-element/multiple-choice-controller@8.1.3) (2026-07-31)
|
|
35
17
|
|
|
36
|
-
|
|
18
|
+
### Bug Fixes
|
|
37
19
|
|
|
38
|
-
|
|
20
|
+
- **multiple-choice:** maxSelections should not affect single choices, repair tests in src PIE-432 ([6010172](https://github.com/pie-framework/pie-elements/commit/6010172f083a9670b5c0f48375e690c483bdedaf))
|
|
39
21
|
|
|
40
|
-
|
|
22
|
+
## [8.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@8.1.1...@pie-element/multiple-choice-controller@8.1.2) (2026-07-02)
|
|
41
23
|
|
|
42
|
-
|
|
24
|
+
### Bug Fixes
|
|
43
25
|
|
|
44
|
-
|
|
26
|
+
- bump shared modules and libs PIE-695, PIE-697, PIE-699, PIE-680, PIE-714, PIE-665, PIE-656 ([4b76ae7](https://github.com/pie-framework/pie-elements/commit/4b76ae75d1c5ea6d55f7c6fb53f299dfcbda2b1f))
|
|
45
27
|
|
|
46
|
-
|
|
28
|
+
## [8.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@8.1.0...@pie-element/multiple-choice-controller@8.1.1) (2026-05-21)
|
|
47
29
|
|
|
48
30
|
**Note:** Version bump only for package @pie-element/multiple-choice-controller
|
|
49
31
|
|
|
50
|
-
# [8.2.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@8.1.0...@pie-element/multiple-choice-controller@8.2.0-beta.0) (2026-08-07)
|
|
51
|
-
|
|
52
|
-
### Bug Fixes
|
|
53
|
-
|
|
54
|
-
- bump shared modules and libs PIE-695, PIE-697, PIE-699, PIE-680, PIE-714, PIE-665, PIE-656 ([4b76ae7](https://github.com/pie-framework/pie-elements/commit/4b76ae75d1c5ea6d55f7c6fb53f299dfcbda2b1f))
|
|
55
|
-
- **multiple-choice:** maxSelections should not affect single choices, repair tests in src PIE-432 ([6010172](https://github.com/pie-framework/pie-elements/commit/6010172f083a9670b5c0f48375e690c483bdedaf))
|
|
56
|
-
|
|
57
32
|
# [8.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@8.1.0-next.1...@pie-element/multiple-choice-controller@8.1.0) (2026-05-21)
|
|
58
33
|
|
|
59
34
|
### Bug Fixes
|
package/controller/package.json
CHANGED
package/lib/choice.js
CHANGED
|
@@ -10,6 +10,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _styles = require("@mui/material/styles");
|
|
12
12
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
13
|
+
var _renderUi = require("@pie-lib/render-ui");
|
|
13
14
|
var _choiceInput = _interopRequireDefault(require("./choice-input"));
|
|
14
15
|
const ChoiceContainer = (0, _styles.styled)(_Box.default, {
|
|
15
16
|
shouldForwardProp: prop => prop !== 'noBorder' && prop !== 'horizontalLayout'
|
|
@@ -22,7 +23,13 @@ const ChoiceContainer = (0, _styles.styled)(_Box.default, {
|
|
|
22
23
|
paddingBottom: `calc(${theme.spacing(1)} + 2px)`,
|
|
23
24
|
paddingLeft: `calc(${theme.spacing(1)} + 2px)`,
|
|
24
25
|
paddingRight: `calc(${theme.spacing(1)} + 2px)`,
|
|
25
|
-
|
|
26
|
+
/*
|
|
27
|
+
* The separator between answer choices. MUI's grey[300] does not follow `--pie-*`,
|
|
28
|
+
* so it stayed #e0e0e0 on every scheme -- about 1.1:1 against black-on-rose's own
|
|
29
|
+
* background, which is where George reported it. `--pie-border` is stepped per
|
|
30
|
+
* scheme and holds at least 3.23:1 everywhere.
|
|
31
|
+
*/
|
|
32
|
+
borderBottom: noBorder ? 'none' : `1px solid ${_renderUi.color.border()}`,
|
|
26
33
|
...(horizontalLayout && {
|
|
27
34
|
paddingRight: theme.spacing(2.5),
|
|
28
35
|
'& label': {
|
package/lib/choice.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choice.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_Box","_choiceInput","ChoiceContainer","styled","Box","shouldForwardProp","prop","theme","noBorder","horizontalLayout","paddingTop","spacing","paddingBottom","paddingLeft","paddingRight","borderBottom","palette","grey","marginRight","Choice","React","Component","constructor","args","_defineProperty2","default","isHovered","disabled","checked","props","setState","choice","onChoiceChanged","render","index","choicesLength","showCorrect","isEvaluateMode","choiceMode","correctness","displayKey","choicesLayout","gridColumns","isSelectionButtonBelow","selectedAnswerBackgroundColor","selectedAnswerStrokeColor","selectedAnswerStrokeWidth","hoverAnswerBackgroundColor","hoverAnswerStrokeColor","hoverAnswerStrokeWidth","tagName","state","choiceClass","feedback","choiceProps","onChange","normalizeStrokeWidth","width","trimmed","String","trim","test","hasSelectedStroke","hasHoverStroke","currentStrokeColor","currentStrokeWidth","currentBackgroundColor","hasStroke","strokeStyle","border","borderRadius","choiceBackground","createElement","className","key","style","backgroundColor","onMouseEnter","handleMouseEnter","onMouseLeave","handleMouseLeave","component","exports","propTypes","PropTypes","oneOf","object","bool","isRequired","func","number","string","_default"],"sources":["../src/choice.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\n\nimport ChoiceInput from './choice-input';\n\nconst ChoiceContainer = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'noBorder' && prop !== 'horizontalLayout',\n})(({ theme, noBorder, horizontalLayout }) => ({\n paddingTop: theme.spacing(2.5),\n paddingBottom: `calc(${theme.spacing(1)} + 2px)`,\n paddingLeft: `calc(${theme.spacing(1)} + 2px)`,\n paddingRight: `calc(${theme.spacing(1)} + 2px)`,\n borderBottom: noBorder ? 'none' : `1px solid ${theme.palette.grey[300]}`,\n ...(horizontalLayout && {\n paddingRight: theme.spacing(2.5),\n '& label': {\n marginRight: theme.spacing(1),\n },\n }),\n}));\n\nexport class Choice extends React.Component {\n static propTypes = {};\n\n state = {\n isHovered: false,\n };\n\n handleMouseEnter = () => {\n const { disabled, checked } = this.props;\n\n if (!disabled && !checked) {\n this.setState({ isHovered: true });\n }\n };\n\n handleMouseLeave = () => {\n this.setState({ isHovered: false });\n };\n\n onChange = (choice) => {\n const { disabled, onChoiceChanged } = this.props;\n\n if (!disabled) {\n onChoiceChanged(choice);\n }\n };\n\n render() {\n const {\n choice,\n index,\n choicesLength,\n showCorrect,\n isEvaluateMode,\n choiceMode,\n disabled,\n checked,\n correctness,\n displayKey,\n choicesLayout,\n gridColumns,\n isSelectionButtonBelow,\n selectedAnswerBackgroundColor,\n selectedAnswerStrokeColor,\n selectedAnswerStrokeWidth,\n hoverAnswerBackgroundColor,\n hoverAnswerStrokeColor,\n hoverAnswerStrokeWidth,\n tagName\n } = this.props;\n \n const { isHovered } = this.state;\n const choiceClass = 'choice' + (index === choicesLength - 1 ? ' last' : '');\n\n const feedback = !isEvaluateMode || showCorrect ? '' : choice.feedback;\n\n const choiceProps = {\n ...choice,\n checked,\n choiceMode,\n disabled,\n feedback,\n correctness,\n displayKey,\n index,\n choicesLayout,\n gridColumns,\n onChange: this.onChange,\n isEvaluateMode,\n isSelectionButtonBelow,\n selectedAnswerStrokeColor,\n selectedAnswerStrokeWidth,\n tagName,\n };\n\n const normalizeStrokeWidth = (width) => {\n if (!width) return '2px'; // default\n const trimmed = String(width).trim();\n \n // add 'px' if the value is a number\n if (/^\\d+(\\.\\d+)?$/.test(trimmed)) {\n return `${trimmed}px`;\n }\n\n return trimmed;\n };\n\n const hasSelectedStroke = selectedAnswerStrokeColor && selectedAnswerStrokeColor !== 'initial';\n const hasHoverStroke = hoverAnswerStrokeColor && hoverAnswerStrokeColor !== 'initial';\n \n let currentStrokeColor = 'transparent';\n let currentStrokeWidth = '2px';\n let currentBackgroundColor = 'initial';\n \n if ((hasSelectedStroke || hasHoverStroke)) {\n if (checked && hasSelectedStroke) {\n // selected state takes priority when selected stroke is configured\n currentStrokeColor = selectedAnswerStrokeColor;\n currentStrokeWidth = selectedAnswerStrokeWidth;\n } else if (isHovered && !disabled && hasHoverStroke) {\n // hover state when not selected and not disabled, and hover stroke is configured\n currentStrokeColor = hoverAnswerStrokeColor;\n currentStrokeWidth = hoverAnswerStrokeWidth;\n }\n }\n \n if (checked && selectedAnswerBackgroundColor && selectedAnswerBackgroundColor !== 'initial') {\n currentBackgroundColor = selectedAnswerBackgroundColor;\n } else if (isHovered && !disabled && hoverAnswerBackgroundColor && hoverAnswerBackgroundColor !== 'initial') {\n currentBackgroundColor = hoverAnswerBackgroundColor;\n }\n\n const hasStroke = hasSelectedStroke || hasHoverStroke;\n const strokeStyle = hasStroke ? {\n border: `${normalizeStrokeWidth(currentStrokeWidth)} solid ${currentStrokeColor}`,\n borderRadius: '8px',\n } : {};\n\n const noBorder = index === choicesLength - 1 || choicesLayout !== 'vertical' || hasStroke;\n const horizontalLayout = choicesLayout === 'horizontal';\n\n const choiceBackground = currentBackgroundColor !== 'initial' ? currentBackgroundColor : 'initial';\n\n return (\n <div \n className={choiceClass} \n key={index} \n style={{ backgroundColor: choiceBackground, ...strokeStyle }}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n >\n <ChoiceContainer \n component=\"div\"\n noBorder={noBorder}\n horizontalLayout={horizontalLayout}\n >\n <ChoiceInput {...choiceProps} />\n </ChoiceContainer>\n </div>\n );\n }\n}\n\nChoice.propTypes = {\n choiceMode: PropTypes.oneOf(['radio', 'checkbox']),\n choice: PropTypes.object,\n disabled: PropTypes.bool.isRequired,\n onChoiceChanged: PropTypes.func,\n index: PropTypes.number,\n choicesLength: PropTypes.number,\n showCorrect: PropTypes.bool,\n isEvaluateMode: PropTypes.bool,\n checked: PropTypes.bool,\n correctness: PropTypes.string,\n displayKey: PropTypes.string,\n choicesLayout: PropTypes.oneOf(['vertical', 'grid', 'horizontal']),\n gridColumns: PropTypes.string,\n selectedAnswerBackgroundColor: PropTypes.string,\n selectedAnswerStrokeColor: PropTypes.string,\n selectedAnswerStrokeWidth: PropTypes.string,\n hoverAnswerBackgroundColor: PropTypes.string,\n hoverAnswerStrokeColor: PropTypes.string,\n hoverAnswerStrokeWidth: PropTypes.string,\n tagName: PropTypes.string,\n isSelectionButtonBelow: PropTypes.bool,\n};\n\nexport default Choice;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MA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MAAM;EACxB3D,QAAQ,EAAEyD,kBAAS,CAACG,IAAI,CAACC,UAAU;EACnCxD,eAAe,EAAEoD,kBAAS,CAACK,IAAI;EAC/BvD,KAAK,EAAEkD,kBAAS,CAACM,MAAM;EACvBvD,aAAa,EAAEiD,kBAAS,CAACM,MAAM;EAC/BtD,WAAW,EAAEgD,kBAAS,CAACG,IAAI;EAC3BlD,cAAc,EAAE+C,kBAAS,CAACG,IAAI;EAC9B3D,OAAO,EAAEwD,kBAAS,CAACG,IAAI;EACvBhD,WAAW,EAAE6C,kBAAS,CAACO,MAAM;EAC7BnD,UAAU,EAAE4C,kBAAS,CAACO,MAAM;EAC5BlD,aAAa,EAAE2C,kBAAS,CAACC,KAAK,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;EAClE3C,WAAW,EAAE0C,kBAAS,CAACO,MAAM;EAC7B/C,6BAA6B,EAAEwC,kBAAS,CAACO,MAAM;EAC/C9C,yBAAyB,EAAEuC,kBAAS,CAACO,MAAM;EAC3C7C,yBAAyB,EAAEsC,kBAAS,CAACO,MAAM;EAC3C5C,0BAA0B,EAAEqC,kBAAS,CAACO,MAAM;EAC5C3C,sBAAsB,EAAEoC,kBAAS,CAACO,MAAM;EACxC1C,sBAAsB,EAAEmC,kBAAS,CAACO,MAAM;EACxCzC,OAAO,EAAEkC,kBAAS,CAACO,MAAM;EACzBhD,sBAAsB,EAAEyC,kBAAS,CAACG;AACpC,CAAC;AAAC,IAAAK,QAAA,GAAAV,OAAA,CAAAzD,OAAA,GAEaN,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"choice.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_Box","_renderUi","_choiceInput","ChoiceContainer","styled","Box","shouldForwardProp","prop","theme","noBorder","horizontalLayout","paddingTop","spacing","paddingBottom","paddingLeft","paddingRight","borderBottom","color","border","marginRight","Choice","React","Component","constructor","args","_defineProperty2","default","isHovered","disabled","checked","props","setState","choice","onChoiceChanged","render","index","choicesLength","showCorrect","isEvaluateMode","choiceMode","correctness","displayKey","choicesLayout","gridColumns","isSelectionButtonBelow","selectedAnswerBackgroundColor","selectedAnswerStrokeColor","selectedAnswerStrokeWidth","hoverAnswerBackgroundColor","hoverAnswerStrokeColor","hoverAnswerStrokeWidth","tagName","state","choiceClass","feedback","choiceProps","onChange","normalizeStrokeWidth","width","trimmed","String","trim","test","hasSelectedStroke","hasHoverStroke","currentStrokeColor","currentStrokeWidth","currentBackgroundColor","hasStroke","strokeStyle","borderRadius","choiceBackground","createElement","className","key","style","backgroundColor","onMouseEnter","handleMouseEnter","onMouseLeave","handleMouseLeave","component","exports","propTypes","PropTypes","oneOf","object","bool","isRequired","func","number","string","_default"],"sources":["../src/choice.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\nimport { color } from '@pie-lib/render-ui';\n\nimport ChoiceInput from './choice-input';\n\nconst ChoiceContainer = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'noBorder' && prop !== 'horizontalLayout',\n})(({ theme, noBorder, horizontalLayout }) => ({\n paddingTop: theme.spacing(2.5),\n paddingBottom: `calc(${theme.spacing(1)} + 2px)`,\n paddingLeft: `calc(${theme.spacing(1)} + 2px)`,\n paddingRight: `calc(${theme.spacing(1)} + 2px)`,\n /*\n * The separator between answer choices. MUI's grey[300] does not follow `--pie-*`,\n * so it stayed #e0e0e0 on every scheme -- about 1.1:1 against black-on-rose's own\n * background, which is where George reported it. `--pie-border` is stepped per\n * scheme and holds at least 3.23:1 everywhere.\n */\n borderBottom: noBorder ? 'none' : `1px solid ${color.border()}`,\n ...(horizontalLayout && {\n paddingRight: theme.spacing(2.5),\n '& label': {\n marginRight: theme.spacing(1),\n },\n }),\n}));\n\nexport class Choice extends React.Component {\n static propTypes = {};\n\n state = {\n isHovered: false,\n };\n\n handleMouseEnter = () => {\n const { disabled, checked } = this.props;\n\n if (!disabled && !checked) {\n this.setState({ isHovered: true });\n }\n };\n\n handleMouseLeave = () => {\n this.setState({ isHovered: false });\n };\n\n onChange = (choice) => {\n const { disabled, onChoiceChanged } = this.props;\n\n if (!disabled) {\n onChoiceChanged(choice);\n }\n };\n\n render() {\n const {\n choice,\n index,\n choicesLength,\n showCorrect,\n isEvaluateMode,\n choiceMode,\n disabled,\n checked,\n correctness,\n displayKey,\n choicesLayout,\n gridColumns,\n isSelectionButtonBelow,\n selectedAnswerBackgroundColor,\n selectedAnswerStrokeColor,\n selectedAnswerStrokeWidth,\n hoverAnswerBackgroundColor,\n hoverAnswerStrokeColor,\n hoverAnswerStrokeWidth,\n tagName\n } = this.props;\n \n const { isHovered } = this.state;\n const choiceClass = 'choice' + (index === choicesLength - 1 ? ' last' : '');\n\n const feedback = !isEvaluateMode || showCorrect ? '' : choice.feedback;\n\n const choiceProps = {\n ...choice,\n checked,\n choiceMode,\n disabled,\n feedback,\n correctness,\n displayKey,\n index,\n choicesLayout,\n gridColumns,\n onChange: this.onChange,\n isEvaluateMode,\n isSelectionButtonBelow,\n selectedAnswerStrokeColor,\n selectedAnswerStrokeWidth,\n tagName,\n };\n\n const normalizeStrokeWidth = (width) => {\n if (!width) return '2px'; // default\n const trimmed = String(width).trim();\n \n // add 'px' if the value is a number\n if (/^\\d+(\\.\\d+)?$/.test(trimmed)) {\n return `${trimmed}px`;\n }\n\n return trimmed;\n };\n\n const hasSelectedStroke = selectedAnswerStrokeColor && selectedAnswerStrokeColor !== 'initial';\n const hasHoverStroke = hoverAnswerStrokeColor && hoverAnswerStrokeColor !== 'initial';\n \n let currentStrokeColor = 'transparent';\n let currentStrokeWidth = '2px';\n let currentBackgroundColor = 'initial';\n \n if ((hasSelectedStroke || hasHoverStroke)) {\n if (checked && hasSelectedStroke) {\n // selected state takes priority when selected stroke is configured\n currentStrokeColor = selectedAnswerStrokeColor;\n currentStrokeWidth = selectedAnswerStrokeWidth;\n } else if (isHovered && !disabled && hasHoverStroke) {\n // hover state when not selected and not disabled, and hover stroke is configured\n currentStrokeColor = hoverAnswerStrokeColor;\n currentStrokeWidth = hoverAnswerStrokeWidth;\n }\n }\n \n if (checked && selectedAnswerBackgroundColor && selectedAnswerBackgroundColor !== 'initial') {\n currentBackgroundColor = selectedAnswerBackgroundColor;\n } else if (isHovered && !disabled && hoverAnswerBackgroundColor && hoverAnswerBackgroundColor !== 'initial') {\n currentBackgroundColor = hoverAnswerBackgroundColor;\n }\n\n const hasStroke = hasSelectedStroke || hasHoverStroke;\n const strokeStyle = hasStroke ? {\n border: `${normalizeStrokeWidth(currentStrokeWidth)} solid ${currentStrokeColor}`,\n borderRadius: '8px',\n } : {};\n\n const noBorder = index === choicesLength - 1 || choicesLayout !== 'vertical' || hasStroke;\n const horizontalLayout = choicesLayout === 'horizontal';\n\n const choiceBackground = currentBackgroundColor !== 'initial' ? currentBackgroundColor : 'initial';\n\n return (\n <div \n className={choiceClass} \n key={index} \n style={{ backgroundColor: choiceBackground, ...strokeStyle }}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n >\n <ChoiceContainer \n component=\"div\"\n noBorder={noBorder}\n horizontalLayout={horizontalLayout}\n >\n <ChoiceInput {...choiceProps} />\n </ChoiceContainer>\n </div>\n );\n }\n}\n\nChoice.propTypes = {\n choiceMode: PropTypes.oneOf(['radio', 'checkbox']),\n choice: PropTypes.object,\n disabled: PropTypes.bool.isRequired,\n onChoiceChanged: PropTypes.func,\n index: PropTypes.number,\n choicesLength: PropTypes.number,\n showCorrect: PropTypes.bool,\n isEvaluateMode: PropTypes.bool,\n checked: PropTypes.bool,\n correctness: PropTypes.string,\n displayKey: PropTypes.string,\n choicesLayout: PropTypes.oneOf(['vertical', 'grid', 'horizontal']),\n gridColumns: PropTypes.string,\n selectedAnswerBackgroundColor: PropTypes.string,\n selectedAnswerStrokeColor: PropTypes.string,\n selectedAnswerStrokeWidth: PropTypes.string,\n hoverAnswerBackgroundColor: PropTypes.string,\n hoverAnswerStrokeColor: PropTypes.string,\n hoverAnswerStrokeWidth: PropTypes.string,\n tagName: PropTypes.string,\n isSelectionButtonBelow: PropTypes.bool,\n};\n\nexport default Choice;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAEA,IAAAK,YAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEA,MAAMM,eAAe,GAAG,IAAAC,cAAM,EAACC,YAAG,EAAE;EAClCC,iBAAiB,EAAGC,IAAI,IAAKA,IAAI,KAAK,UAAU,IAAIA,IAAI,KAAK;AAC/D,CAAC,CAAC,CAAC,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC;AAAiB,CAAC,MAAM;EAC7CC,UAAU,EAAEH,KAAK,CAACI,OAAO,CAAC,GAAG,CAAC;EAC9BC,aAAa,EAAE,QAAQL,KAAK,CAACI,OAAO,CAAC,CAAC,CAAC,SAAS;EAChDE,WAAW,EAAE,QAAQN,KAAK,CAACI,OAAO,CAAC,CAAC,CAAC,SAAS;EAC9CG,YAAY,EAAE,QAAQP,KAAK,CAACI,OAAO,CAAC,CAAC,CAAC,SAAS;EAC/C;AACF;AACA;AACA;AACA;AACA;EACEI,YAAY,EAAEP,QAAQ,GAAG,MAAM,GAAG,aAAaQ,eAAK,CAACC,MAAM,CAAC,CAAC,EAAE;EAC/D,IAAIR,gBAAgB,IAAI;IACtBK,YAAY,EAAEP,KAAK,CAACI,OAAO,CAAC,GAAG,CAAC;IAChC,SAAS,EAAE;MACTO,WAAW,EAAEX,KAAK,CAACI,OAAO,CAAC,CAAC;IAC9B;EACF,CAAC;AACH,CAAC,CAAC,CAAC;AAEI,MAAMQ,MAAM,SAASC,cAAK,CAACC,SAAS,CAAC;EAAAC,YAAA,G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ete, elementContext) => {
|
|
|
27
27
|
if (autoplayAudioEnabled && completeAudioEnabled && !audioComplete) {
|
|
28
28
|
if (elementContext) {
|
|
29
29
|
const audio = elementContext.querySelector('audio');
|
|
30
|
-
const isInsidePrompt = audio && audio.closest('
|
|
30
|
+
const isInsidePrompt = audio && audio.closest('.preview-prompt');
|
|
31
31
|
|
|
32
32
|
// only require audio completion if audio exists and is inside the prompt
|
|
33
33
|
if (audio && isInsidePrompt) {
|
|
@@ -257,7 +257,7 @@ class MultipleChoice extends HTMLElement {
|
|
|
257
257
|
if (mutation.type === 'childList') {
|
|
258
258
|
if (this._audioInitialized) return;
|
|
259
259
|
const audio = this.querySelector('audio');
|
|
260
|
-
const isInsidePrompt = audio && audio.closest('
|
|
260
|
+
const isInsidePrompt = audio && audio.closest('.preview-prompt');
|
|
261
261
|
if (!this._model) return;
|
|
262
262
|
if (!this._model.autoplayAudioEnabled) return;
|
|
263
263
|
if (audio && !isInsidePrompt) return;
|