@pie-element/explicit-constructed-response 11.2.2-beta.3 → 11.2.3
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 +57 -28
- package/configure/CHANGELOG.md +47 -27
- package/configure/lib/alternateSection.js +4 -4
- package/configure/lib/alternateSection.js.map +1 -1
- package/configure/lib/defaults.js +2 -1
- package/configure/lib/defaults.js.map +1 -1
- package/configure/package.json +3 -3
- package/controller/CHANGELOG.md +9 -39
- package/controller/lib/defaults.js +2 -1
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +3 -1
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +1 -1
- package/module/configure.js +1 -0
- package/module/controller.js +6537 -0
- package/module/demo.js +45 -0
- package/module/element.js +1 -0
- package/module/index.html +21 -0
- package/module/manifest.json +18 -0
- package/module/print-demo.js +83 -0
- package/module/print.html +18 -0
- package/module/print.js +1 -0
- package/package.json +5 -5
- package/configure/lib/__tests__/alternateResponses.test.js +0 -503
- package/configure/lib/__tests__/alternateSection.test.js +0 -372
- package/configure/lib/__tests__/ecr-toolbar.test.js +0 -214
- package/configure/lib/__tests__/main.test.js +0 -470
- package/configure/lib/__tests__/markupUtils.test.js +0 -55
- package/configure/lib/__tests__/utils.test.js +0 -62
- package/controller/lib/__tests__/index.spec.js +0 -30
- package/controller/lib/__tests__/index.test.js +0 -950
- package/docs/demo/pie.manifest.json +0 -11
- package/lib/__tests__/main.test.js +0 -166
package/CHANGELOG.md
CHANGED
|
@@ -3,67 +3,96 @@
|
|
|
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
|
-
## [11.2.
|
|
6
|
+
## [11.2.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.2.2...@pie-element/explicit-constructed-response@11.2.3) (2026-09-09)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
### Bug Fixes
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- **mask-markup:** prevent transparent dropdown background PIE-1008 ([1562bd8](https://github.com/pie-framework/pie-elements/commit/1562bd863abc4f062429dc545318f074ce096efc))
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## [11.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.2.1...@pie-element/explicit-constructed-response@11.2.2) (2026-09-04)
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
### Bug Fixes
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
- bump libs PIE-978, PIE-980 ([96489ba](https://github.com/pie-framework/pie-elements/commit/96489ba3c220604f21c3ce4500d79f4389266e9e))
|
|
17
|
+
- **explicit-constructed-response:** honor the student spellcheck setting PIE-979 ([98c67b3](https://github.com/pie-framework/pie-elements/commit/98c67b3484472b0325defc1fc694822ea3c6cd64))
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
## [11.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.2.0...@pie-element/explicit-constructed-response@11.2.1) (2026-08-26)
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
### Bug Fixes
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
- PIE-518 ([f19ac71](https://github.com/pie-framework/pie-elements/commit/f19ac7145e5daf9dde0377ac6d634b44c9201973))
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
# [11.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.1.11...@pie-element/explicit-constructed-response@11.2.0) (2026-08-21)
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
### Bug Fixes
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
- 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))
|
|
30
|
+
- **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)
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
### Features
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
- bump libs PIE-856, PIE-681, PIE-927 ([cb26d7a](https://github.com/pie-framework/pie-elements/commit/cb26d7afa6c99522533c321d5ff8ce3148a66e9e))
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
## [11.1.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.1.10...@pie-element/explicit-constructed-response@11.1.11) (2026-08-19)
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
# [11.4.0-beta.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.4.0-beta.0...@pie-element/explicit-constructed-response@11.4.0-beta.1) (2026-08-07)
|
|
38
|
+
### Bug Fixes
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
- bump libs and shared modules PIE-681, PIE-708 ([08af8b5](https://github.com/pie-framework/pie-elements/commit/08af8b5802aecc8ee5454a1b6d60277d7ec94204))
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
## [11.1.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.1.8...@pie-element/explicit-constructed-response@11.1.10) (2026-08-13)
|
|
43
43
|
|
|
44
44
|
**Note:** Version bump only for package @pie-element/explicit-constructed-response
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
## [11.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.1.7...@pie-element/explicit-constructed-response@11.1.9) (2026-08-11)
|
|
47
47
|
|
|
48
48
|
**Note:** Version bump only for package @pie-element/explicit-constructed-response
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
## [11.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.1.7...@pie-element/explicit-constructed-response@11.1.8) (2026-07-31)
|
|
51
51
|
|
|
52
52
|
**Note:** Version bump only for package @pie-element/explicit-constructed-response
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
## [11.1.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.1.6...@pie-element/explicit-constructed-response@11.1.7) (2026-07-08)
|
|
55
55
|
|
|
56
56
|
### Bug Fixes
|
|
57
57
|
|
|
58
58
|
- bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
|
|
60
|
+
## [11.1.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.1.5...@pie-element/explicit-constructed-response@11.1.6) (2026-07-02)
|
|
61
|
+
|
|
62
|
+
### Bug Fixes
|
|
63
|
+
|
|
62
64
|
- 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))
|
|
65
|
+
- sync libs versions ([48b5be9](https://github.com/pie-framework/pie-elements/commit/48b5be9559eb5b5235ca05f51c5f0161032a7041))
|
|
66
|
+
|
|
67
|
+
## [11.1.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.1.4...@pie-element/explicit-constructed-response@11.1.5) (2026-06-22)
|
|
68
|
+
|
|
69
|
+
### Bug Fixes
|
|
70
|
+
|
|
71
|
+
- 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))
|
|
72
|
+
- handle webcomponent lifecycle on every element that misses it PIE-703 ([9d5923f](https://github.com/pie-framework/pie-elements/commit/9d5923f973f0471e1e8f69ad4309cfc63d980d93))
|
|
73
|
+
|
|
74
|
+
## [11.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.1.3...@pie-element/explicit-constructed-response@11.1.4) (2026-06-17)
|
|
75
|
+
|
|
76
|
+
### Bug Fixes
|
|
77
|
+
|
|
78
|
+
- 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))
|
|
79
|
+
|
|
80
|
+
## [11.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.1.2...@pie-element/explicit-constructed-response@11.1.3) (2026-06-12)
|
|
81
|
+
|
|
82
|
+
### Bug Fixes
|
|
83
|
+
|
|
63
84
|
- bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
|
|
85
|
+
|
|
86
|
+
## [11.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.1.1...@pie-element/explicit-constructed-response@11.1.2) (2026-06-04)
|
|
87
|
+
|
|
88
|
+
### Bug Fixes
|
|
89
|
+
|
|
90
|
+
- bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
|
|
64
91
|
- called onModelChanged with only the change, to no override changes done fast [PIE-509][PIE-562][PIE-563] ([0b9ac0f](https://github.com/pie-framework/pie-elements/commit/0b9ac0f69efc3e5be28230a784fa6c7e5faf92fb))
|
|
65
|
-
|
|
66
|
-
|
|
92
|
+
|
|
93
|
+
## [11.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.1.0...@pie-element/explicit-constructed-response@11.1.1) (2026-05-21)
|
|
94
|
+
|
|
95
|
+
**Note:** Version bump only for package @pie-element/explicit-constructed-response
|
|
67
96
|
|
|
68
97
|
# [11.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@11.1.0-next.1...@pie-element/explicit-constructed-response@11.1.0) (2026-05-21)
|
|
69
98
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,67 +3,87 @@
|
|
|
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/explicit-constructed-response-configure@10.2.1...@pie-element/explicit-constructed-response-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))
|
|
11
|
+
- **explicit-constructed-response:** honor the student spellcheck setting PIE-979 ([98c67b3](https://github.com/pie-framework/pie-elements/commit/98c67b3484472b0325defc1fc694822ea3c6cd64))
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
## [10.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@10.2.0...@pie-element/explicit-constructed-response-configure@10.2.1) (2026-08-26)
|
|
11
14
|
|
|
12
15
|
**Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
|
|
13
16
|
|
|
14
|
-
# [10.
|
|
17
|
+
# [10.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@10.1.11...@pie-element/explicit-constructed-response-configure@10.2.0) (2026-08-21)
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
### Bug Fixes
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
- **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)
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
### Features
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
- bump libs PIE-856, PIE-681, PIE-927 ([cb26d7a](https://github.com/pie-framework/pie-elements/commit/cb26d7afa6c99522533c321d5ff8ce3148a66e9e))
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
## [10.1.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@10.1.10...@pie-element/explicit-constructed-response-configure@10.1.11) (2026-08-19)
|
|
25
28
|
|
|
26
|
-
|
|
29
|
+
### Bug Fixes
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
- bump libs and shared modules PIE-681, PIE-708 ([08af8b5](https://github.com/pie-framework/pie-elements/commit/08af8b5802aecc8ee5454a1b6d60277d7ec94204))
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
## [10.1.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@10.1.8...@pie-element/explicit-constructed-response-configure@10.1.10) (2026-08-13)
|
|
31
34
|
|
|
32
35
|
**Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
## [10.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@10.1.7...@pie-element/explicit-constructed-response-configure@10.1.9) (2026-08-11)
|
|
35
38
|
|
|
36
39
|
**Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
|
|
37
40
|
|
|
38
|
-
|
|
41
|
+
## [10.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@10.1.7...@pie-element/explicit-constructed-response-configure@10.1.8) (2026-07-31)
|
|
39
42
|
|
|
40
43
|
**Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
|
|
41
44
|
|
|
42
|
-
|
|
45
|
+
## [10.1.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@10.1.6...@pie-element/explicit-constructed-response-configure@10.1.7) (2026-07-08)
|
|
43
46
|
|
|
44
|
-
|
|
47
|
+
### Bug Fixes
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
- bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
## [10.1.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@10.1.5...@pie-element/explicit-constructed-response-configure@10.1.6) (2026-07-02)
|
|
49
52
|
|
|
50
|
-
|
|
53
|
+
### Bug Fixes
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
- 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))
|
|
56
|
+
- sync libs versions ([48b5be9](https://github.com/pie-framework/pie-elements/commit/48b5be9559eb5b5235ca05f51c5f0161032a7041))
|
|
53
57
|
|
|
54
|
-
|
|
58
|
+
## [10.1.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@10.1.4...@pie-element/explicit-constructed-response-configure@10.1.5) (2026-06-22)
|
|
55
59
|
|
|
56
60
|
### Bug Fixes
|
|
57
61
|
|
|
58
|
-
- bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
|
|
59
|
-
- bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
|
|
60
|
-
- 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))
|
|
61
62
|
- 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))
|
|
62
|
-
-
|
|
63
|
+
- handle webcomponent lifecycle on every element that misses it PIE-703 ([9d5923f](https://github.com/pie-framework/pie-elements/commit/9d5923f973f0471e1e8f69ad4309cfc63d980d93))
|
|
64
|
+
|
|
65
|
+
## [10.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@10.1.3...@pie-element/explicit-constructed-response-configure@10.1.4) (2026-06-17)
|
|
66
|
+
|
|
67
|
+
### Bug Fixes
|
|
68
|
+
|
|
69
|
+
- 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))
|
|
70
|
+
|
|
71
|
+
## [10.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@10.1.2...@pie-element/explicit-constructed-response-configure@10.1.3) (2026-06-12)
|
|
72
|
+
|
|
73
|
+
### Bug Fixes
|
|
74
|
+
|
|
63
75
|
- bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
|
|
76
|
+
|
|
77
|
+
## [10.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@10.1.1...@pie-element/explicit-constructed-response-configure@10.1.2) (2026-06-04)
|
|
78
|
+
|
|
79
|
+
### Bug Fixes
|
|
80
|
+
|
|
81
|
+
- bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
|
|
64
82
|
- called onModelChanged with only the change, to no override changes done fast [PIE-509][PIE-562][PIE-563] ([0b9ac0f](https://github.com/pie-framework/pie-elements/commit/0b9ac0f69efc3e5be28230a784fa6c7e5faf92fb))
|
|
65
|
-
|
|
66
|
-
|
|
83
|
+
|
|
84
|
+
## [10.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@10.1.0...@pie-element/explicit-constructed-response-configure@10.1.1) (2026-05-21)
|
|
85
|
+
|
|
86
|
+
**Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
|
|
67
87
|
|
|
68
88
|
# [10.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@10.1.0-next.1...@pie-element/explicit-constructed-response-configure@10.1.0) (2026-05-21)
|
|
69
89
|
|
|
@@ -18,6 +18,7 @@ var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
|
18
18
|
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
19
19
|
var _styles = require("@mui/material/styles");
|
|
20
20
|
var _editableHtmlTipTap = _interopRequireDefault(require("@pie-lib/editable-html-tip-tap"));
|
|
21
|
+
var _renderUi = require("@pie-lib/render-ui");
|
|
21
22
|
var _markupUtils = require("./markupUtils");
|
|
22
23
|
const DesignContainer = (0, _styles.styled)('div')(({
|
|
23
24
|
theme
|
|
@@ -47,11 +48,10 @@ const StyledEditableHtml = (0, _styles.styled)(_editableHtmlTipTap.default)(({
|
|
|
47
48
|
borderRadius: '6px'
|
|
48
49
|
})
|
|
49
50
|
}));
|
|
50
|
-
const StyledDeleteButton = (0, _styles.styled)(_IconButton.default)(({
|
|
51
|
-
theme
|
|
52
|
-
}) => ({
|
|
51
|
+
const StyledDeleteButton = (0, _styles.styled)(_IconButton.default)(() => ({
|
|
53
52
|
'& svg': {
|
|
54
|
-
|
|
53
|
+
// A delete control: it has to be found before it can be avoided.
|
|
54
|
+
fill: _renderUi.color.text()
|
|
55
55
|
}
|
|
56
56
|
}));
|
|
57
57
|
const SelectContainer = (0, _styles.styled)('div')({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alternateSection.js","names":["_react","_interopRequireDefault","require","_propTypes","_lodashEs","_Button","_Delete","_IconButton","_MenuItem","_Select","_TextField","_styles","_editableHtmlTipTap","_markupUtils","DesignContainer","styled","theme","marginBottom","spacing","AltChoices","alignItems","flexDirection","display","paddingTop","width","StyledEditableHtml","EditableHtml","hasError","flex","marginRight","border","palette","error","main","borderRadius","StyledDeleteButton","IconButton","fill","grey","SelectContainer","justifyContent","RightContainer","LengthField","TextField","borderBottomColor","divider","text","primary","ErrorText","fontSize","typography","color","ChoiceWrapper","Choice","React","Component","constructor","args","_defineProperty2","default","value","props","markup","debounce","onChange","e","strippedValue","stripHtmlTags","setState","updateText","event","key","UNSAFE_componentWillReceiveProps","nextProps","render","state","onDelete","spellCheck","showMaxLength","pluginProps","inputProps","maxLength","createElement","Fragment","_extends2","disableUnderline","onKeyDown","activePlugins","languageCharactersProps","language","autoWidthToolbar","toolbarOpts","minWidth","isHidden","characters","disabled","onClick","size","exports","PropTypes","string","func","isRequired","bool","object","AlternateSection","choices","isEqual","onSelect","selectChoices","target","find","c","length","label","max","map","parseInt","filter","id","isNaN","choice","index","choiceChanged","lengthChanged","labelLengthsArr","decodeHTML","newLength","Math","getAdjustedLength","choiceRemoved","numberValue","minLength","getChoicesMaxLength","updateChoicesIfNeeded","componentDidMount","errors","variant","displayEmpty","handleSelect","readOnly","MenuProps","transitionDuration","enter","exit","type","min","changeLength","onAddChoice","val","onChoiceChanged","onRemoveChoice","array","number","_default"],"sources":["../src/alternateSection.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { debounce, isEqual } from 'lodash-es';\nimport Button from '@mui/material/Button';\nimport Delete from '@mui/icons-material/Delete';\nimport IconButton from '@mui/material/IconButton';\nimport MenuItem from '@mui/material/MenuItem';\nimport Select from '@mui/material/Select';\nimport TextField from '@mui/material/TextField';\nimport { styled } from '@mui/material/styles';\nimport { max } from 'lodash-es';\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport { stripHtmlTags, getAdjustedLength, decodeHTML } from './markupUtils';\n\nconst DesignContainer = styled('div')(({ theme }) => ({\n marginBottom: theme.spacing(0.5),\n}));\n\nconst AltChoices = styled('div')(({ theme }) => ({\n alignItems: 'flex-start',\n flexDirection: 'column',\n display: 'flex',\n paddingTop: theme.spacing(2.5),\n '& > *': {\n marginBottom: theme.spacing(2.5),\n width: '100%',\n },\n}));\n\nconst StyledEditableHtml = styled(EditableHtml)(({ theme, hasError }) => ({\n flex: '1',\n marginRight: theme.spacing(2.5),\n ...(hasError && {\n border: `2px solid ${theme.palette.error.main}`,\n borderRadius: '6px',\n }),\n}));\n\nconst StyledDeleteButton = styled(IconButton)(({ theme }) => ({\n '& svg': {\n fill: theme.palette.grey[600],\n },\n}));\n\nconst SelectContainer = styled('div')({\n alignItems: 'flex-end',\n display: 'flex',\n justifyContent: 'space-between',\n width: '100%',\n});\n\nconst RightContainer = styled('div')({\n alignItems: 'center',\n display: 'flex',\n});\n\nconst LengthField = styled(TextField)(({ theme }) => ({\n width: '230px',\n marginRight: theme.spacing(2.5),\n '& .MuiInput-underline:before': {\n borderBottomColor: theme.palette.divider,\n },\n '& .MuiInput-underline:hover:not(.Mui-disabled):before': {\n borderBottomColor: theme.palette.text.primary,\n },\n '& .MuiInput-underline:after': {\n borderBottomColor: theme.palette.primary.main,\n },\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(0.5),\n}));\n\nconst ChoiceWrapper = styled('div')({\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'space-between',\n});\n\nexport class Choice extends React.Component {\n static propTypes = {\n error: PropTypes.string,\n markup: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n onDelete: PropTypes.func.isRequired,\n value: PropTypes.string,\n spellCheck: PropTypes.bool,\n showMaxLength: PropTypes.bool,\n pluginProps: PropTypes.object,\n };\n\n state = {\n value: this.props.markup,\n };\n\n updateText = debounce(this.props.onChange, 300);\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (nextProps.markup) {\n this.setState({ value: nextProps.markup });\n }\n }\n\n onChange = (e) => {\n const strippedValue = stripHtmlTags(e);\n this.setState({ value: strippedValue });\n this.updateText(strippedValue);\n };\n\n onKeyDown = (event) => {\n if (event.key === 'Enter') {\n return true;\n }\n };\n\n render() {\n const { value } = this.state;\n const { onDelete, spellCheck, error, showMaxLength, pluginProps } = this.props;\n const inputProps = showMaxLength ? {} : { maxLength: 25 };\n\n return (\n <React.Fragment>\n <ChoiceWrapper>\n <StyledEditableHtml\n hasError={!!error}\n disableUnderline\n onChange={this.onChange}\n onKeyDown={this.onKeyDown}\n markup={value || ''}\n activePlugins={['languageCharacters']}\n pluginProps={pluginProps}\n languageCharactersProps={[{ language: 'spanish' }]}\n spellCheck={spellCheck}\n autoWidthToolbar\n toolbarOpts={{\n minWidth: 'auto',\n isHidden: !!pluginProps?.characters?.disabled,\n }}\n {...inputProps}\n />\n <StyledDeleteButton aria-label=\"delete\" onClick={onDelete} size=\"large\">\n <Delete />\n </StyledDeleteButton>\n </ChoiceWrapper>\n {error && <ErrorText>{error}</ErrorText>}\n </React.Fragment>\n );\n }\n}\n\nexport class AlternateSection extends React.Component {\n static propTypes = {\n choices: PropTypes.array,\n selectChoices: PropTypes.array.isRequired,\n errors: PropTypes.object,\n onSelect: PropTypes.func.isRequired,\n choiceChanged: PropTypes.func.isRequired,\n lengthChanged: PropTypes.func,\n choiceRemoved: PropTypes.func.isRequired,\n value: PropTypes.string,\n maxLength: PropTypes.number,\n showMaxLength: PropTypes.bool,\n spellCheck: PropTypes.bool,\n pluginProps: PropTypes.object,\n };\n\n state = {};\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n this.updateChoicesIfNeeded(nextProps);\n }\n\n componentDidMount() {\n this.updateChoicesIfNeeded(this.props);\n }\n\n updateChoicesIfNeeded = (props) => {\n if (\n !this.state.choices ||\n !isEqual(props.choices, this.state.choices) ||\n !isEqual(props.choices, this.props.choices)\n ) {\n this.setState({\n choices: props.choices,\n });\n }\n };\n\n handleSelect = (e) => {\n const { onSelect, selectChoices } = this.props;\n const { value } = e.target;\n\n onSelect(selectChoices.find((c) => c.value === value));\n };\n\n onAddChoice = () => {\n const { choices } = this.state;\n\n if (choices.length && choices[choices.length - 1].label !== '') {\n const value = max(choices.map((c) => parseInt(c.value)).filter((id) => !isNaN(id))) || 0;\n\n this.setState({\n choices: [\n ...choices,\n {\n value: `${value + 1}`,\n label: '',\n },\n ],\n });\n }\n };\n\n onChoiceChanged = (choice, value, index) => {\n const { choiceChanged, lengthChanged, maxLength, choices } = this.props;\n\n const labelLengthsArr = choices.map((choice) => decodeHTML(choice.label || '').length);\n labelLengthsArr[index] = decodeHTML(value).length;\n\n const newLength = Math.max(...labelLengthsArr);\n\n choiceChanged({\n ...choice,\n label: value,\n });\n\n if (newLength > maxLength || newLength + 10 <= maxLength) {\n lengthChanged(getAdjustedLength(newLength));\n }\n };\n\n onRemoveChoice = (choice) => {\n const { choiceRemoved } = this.props;\n\n choiceRemoved(choice.value);\n };\n\n getChoicesMaxLength = () => {\n const { choices } = this.state;\n\n if (!choices) {\n return 1;\n }\n\n const labelLengthsArr = choices.map((choice) => decodeHTML(choice.label || '').length);\n\n return Math.max(...labelLengthsArr);\n };\n\n changeLength = (event) => {\n const { lengthChanged } = this.props;\n const numberValue = parseInt(event.target.value, 10);\n const minLength = this.getChoicesMaxLength();\n\n if (numberValue && numberValue >= minLength && numberValue <= minLength + 10) {\n lengthChanged(numberValue);\n }\n };\n\n render() {\n const { selectChoices, maxLength, showMaxLength, value, spellCheck, errors, pluginProps } = this.props;\n const { choices } = this.state;\n const minLength = this.getChoicesMaxLength();\n\n return (\n <DesignContainer>\n <SelectContainer>\n <Select\n variant=\"standard\"\n displayEmpty\n onChange={this.handleSelect}\n value={value || ''}\n readOnly={showMaxLength}\n MenuProps={{\n transitionDuration: { enter: 225, exit: 195 },\n }}\n >\n <MenuItem value=\"\">\n <em>{value ? 'Remove selection' : 'Select a response'}</em>\n </MenuItem>\n {selectChoices.map((c, index) => (\n <MenuItem key={index} value={c?.value}>\n {decodeHTML(c?.label)}\n </MenuItem>\n ))}\n </Select>\n\n {choices && choices.length > 0 && (\n <RightContainer>\n {maxLength && showMaxLength && (\n <LengthField\n variant=\"standard\"\n label=\"Maximum length (characters)\"\n type=\"number\"\n inputProps={{\n min: minLength,\n max: minLength + 10,\n }}\n value={maxLength}\n onChange={this.changeLength}\n />\n )}\n <Button variant=\"contained\" color=\"primary\" onClick={this.onAddChoice}>\n Add\n </Button>\n </RightContainer>\n )}\n </SelectContainer>\n {errors && errors[0] && <ErrorText>{errors[0]}</ErrorText>}\n\n <AltChoices>\n {choices &&\n choices.map(\n (c, index) =>\n index > 0 && (\n <Choice\n key={index}\n markup={c.label}\n onChange={(val) => this.onChoiceChanged(c, val, index)}\n onDelete={() => this.onRemoveChoice(c)}\n spellCheck={spellCheck}\n error={errors && errors[index]}\n showMaxLength={showMaxLength}\n pluginProps={pluginProps}\n />\n ),\n )}\n </AltChoices>\n </DesignContainer>\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alternateSection.js","names":["_react","_interopRequireDefault","require","_propTypes","_lodashEs","_Button","_Delete","_IconButton","_MenuItem","_Select","_TextField","_styles","_editableHtmlTipTap","_renderUi","_markupUtils","DesignContainer","styled","theme","marginBottom","spacing","AltChoices","alignItems","flexDirection","display","paddingTop","width","StyledEditableHtml","EditableHtml","hasError","flex","marginRight","border","palette","error","main","borderRadius","StyledDeleteButton","IconButton","fill","color","text","SelectContainer","justifyContent","RightContainer","LengthField","TextField","borderBottomColor","divider","primary","ErrorText","fontSize","typography","ChoiceWrapper","Choice","React","Component","constructor","args","_defineProperty2","default","value","props","markup","debounce","onChange","e","strippedValue","stripHtmlTags","setState","updateText","event","key","UNSAFE_componentWillReceiveProps","nextProps","render","state","onDelete","spellCheck","showMaxLength","pluginProps","inputProps","maxLength","createElement","Fragment","_extends2","disableUnderline","onKeyDown","activePlugins","languageCharactersProps","language","autoWidthToolbar","toolbarOpts","minWidth","isHidden","characters","disabled","onClick","size","exports","PropTypes","string","func","isRequired","bool","object","AlternateSection","choices","isEqual","onSelect","selectChoices","target","find","c","length","label","max","map","parseInt","filter","id","isNaN","choice","index","choiceChanged","lengthChanged","labelLengthsArr","decodeHTML","newLength","Math","getAdjustedLength","choiceRemoved","numberValue","minLength","getChoicesMaxLength","updateChoicesIfNeeded","componentDidMount","errors","variant","displayEmpty","handleSelect","readOnly","MenuProps","transitionDuration","enter","exit","type","min","changeLength","onAddChoice","val","onChoiceChanged","onRemoveChoice","array","number","_default"],"sources":["../src/alternateSection.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { debounce, isEqual } from 'lodash-es';\nimport Button from '@mui/material/Button';\nimport Delete from '@mui/icons-material/Delete';\nimport IconButton from '@mui/material/IconButton';\nimport MenuItem from '@mui/material/MenuItem';\nimport Select from '@mui/material/Select';\nimport TextField from '@mui/material/TextField';\nimport { styled } from '@mui/material/styles';\nimport { max } from 'lodash-es';\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport { color } from '@pie-lib/render-ui';\nimport { stripHtmlTags, getAdjustedLength, decodeHTML } from './markupUtils';\n\nconst DesignContainer = styled('div')(({ theme }) => ({\n marginBottom: theme.spacing(0.5),\n}));\n\nconst AltChoices = styled('div')(({ theme }) => ({\n alignItems: 'flex-start',\n flexDirection: 'column',\n display: 'flex',\n paddingTop: theme.spacing(2.5),\n '& > *': {\n marginBottom: theme.spacing(2.5),\n width: '100%',\n },\n}));\n\nconst StyledEditableHtml = styled(EditableHtml)(({ theme, hasError }) => ({\n flex: '1',\n marginRight: theme.spacing(2.5),\n ...(hasError && {\n border: `2px solid ${theme.palette.error.main}`,\n borderRadius: '6px',\n }),\n}));\n\nconst StyledDeleteButton = styled(IconButton)(() => ({\n '& svg': {\n // A delete control: it has to be found before it can be avoided.\n fill: color.text(),\n },\n}));\n\nconst SelectContainer = styled('div')({\n alignItems: 'flex-end',\n display: 'flex',\n justifyContent: 'space-between',\n width: '100%',\n});\n\nconst RightContainer = styled('div')({\n alignItems: 'center',\n display: 'flex',\n});\n\nconst LengthField = styled(TextField)(({ theme }) => ({\n width: '230px',\n marginRight: theme.spacing(2.5),\n '& .MuiInput-underline:before': {\n borderBottomColor: theme.palette.divider,\n },\n '& .MuiInput-underline:hover:not(.Mui-disabled):before': {\n borderBottomColor: theme.palette.text.primary,\n },\n '& .MuiInput-underline:after': {\n borderBottomColor: theme.palette.primary.main,\n },\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(0.5),\n}));\n\nconst ChoiceWrapper = styled('div')({\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'space-between',\n});\n\nexport class Choice extends React.Component {\n static propTypes = {\n error: PropTypes.string,\n markup: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n onDelete: PropTypes.func.isRequired,\n value: PropTypes.string,\n spellCheck: PropTypes.bool,\n showMaxLength: PropTypes.bool,\n pluginProps: PropTypes.object,\n };\n\n state = {\n value: this.props.markup,\n };\n\n updateText = debounce(this.props.onChange, 300);\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (nextProps.markup) {\n this.setState({ value: nextProps.markup });\n }\n }\n\n onChange = (e) => {\n const strippedValue = stripHtmlTags(e);\n this.setState({ value: strippedValue });\n this.updateText(strippedValue);\n };\n\n onKeyDown = (event) => {\n if (event.key === 'Enter') {\n return true;\n }\n };\n\n render() {\n const { value } = this.state;\n const { onDelete, spellCheck, error, showMaxLength, pluginProps } = this.props;\n const inputProps = showMaxLength ? {} : { maxLength: 25 };\n\n return (\n <React.Fragment>\n <ChoiceWrapper>\n <StyledEditableHtml\n hasError={!!error}\n disableUnderline\n onChange={this.onChange}\n onKeyDown={this.onKeyDown}\n markup={value || ''}\n activePlugins={['languageCharacters']}\n pluginProps={pluginProps}\n languageCharactersProps={[{ language: 'spanish' }]}\n spellCheck={spellCheck}\n autoWidthToolbar\n toolbarOpts={{\n minWidth: 'auto',\n isHidden: !!pluginProps?.characters?.disabled,\n }}\n {...inputProps}\n />\n <StyledDeleteButton aria-label=\"delete\" onClick={onDelete} size=\"large\">\n <Delete />\n </StyledDeleteButton>\n </ChoiceWrapper>\n {error && <ErrorText>{error}</ErrorText>}\n </React.Fragment>\n );\n }\n}\n\nexport class AlternateSection extends React.Component {\n static propTypes = {\n choices: PropTypes.array,\n selectChoices: PropTypes.array.isRequired,\n errors: PropTypes.object,\n onSelect: PropTypes.func.isRequired,\n choiceChanged: PropTypes.func.isRequired,\n lengthChanged: PropTypes.func,\n choiceRemoved: PropTypes.func.isRequired,\n value: PropTypes.string,\n maxLength: PropTypes.number,\n showMaxLength: PropTypes.bool,\n spellCheck: PropTypes.bool,\n pluginProps: PropTypes.object,\n };\n\n state = {};\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n this.updateChoicesIfNeeded(nextProps);\n }\n\n componentDidMount() {\n this.updateChoicesIfNeeded(this.props);\n }\n\n updateChoicesIfNeeded = (props) => {\n if (\n !this.state.choices ||\n !isEqual(props.choices, this.state.choices) ||\n !isEqual(props.choices, this.props.choices)\n ) {\n this.setState({\n choices: props.choices,\n });\n }\n };\n\n handleSelect = (e) => {\n const { onSelect, selectChoices } = this.props;\n const { value } = e.target;\n\n onSelect(selectChoices.find((c) => c.value === value));\n };\n\n onAddChoice = () => {\n const { choices } = this.state;\n\n if (choices.length && choices[choices.length - 1].label !== '') {\n const value = max(choices.map((c) => parseInt(c.value)).filter((id) => !isNaN(id))) || 0;\n\n this.setState({\n choices: [\n ...choices,\n {\n value: `${value + 1}`,\n label: '',\n },\n ],\n });\n }\n };\n\n onChoiceChanged = (choice, value, index) => {\n const { choiceChanged, lengthChanged, maxLength, choices } = this.props;\n\n const labelLengthsArr = choices.map((choice) => decodeHTML(choice.label || '').length);\n labelLengthsArr[index] = decodeHTML(value).length;\n\n const newLength = Math.max(...labelLengthsArr);\n\n choiceChanged({\n ...choice,\n label: value,\n });\n\n if (newLength > maxLength || newLength + 10 <= maxLength) {\n lengthChanged(getAdjustedLength(newLength));\n }\n };\n\n onRemoveChoice = (choice) => {\n const { choiceRemoved } = this.props;\n\n choiceRemoved(choice.value);\n };\n\n getChoicesMaxLength = () => {\n const { choices } = this.state;\n\n if (!choices) {\n return 1;\n }\n\n const labelLengthsArr = choices.map((choice) => decodeHTML(choice.label || '').length);\n\n return Math.max(...labelLengthsArr);\n };\n\n changeLength = (event) => {\n const { lengthChanged } = this.props;\n const numberValue = parseInt(event.target.value, 10);\n const minLength = this.getChoicesMaxLength();\n\n if (numberValue && numberValue >= minLength && numberValue <= minLength + 10) {\n lengthChanged(numberValue);\n }\n };\n\n render() {\n const { selectChoices, maxLength, showMaxLength, value, spellCheck, errors, pluginProps } = this.props;\n const { choices } = this.state;\n const minLength = this.getChoicesMaxLength();\n\n return (\n <DesignContainer>\n <SelectContainer>\n <Select\n variant=\"standard\"\n displayEmpty\n onChange={this.handleSelect}\n value={value || ''}\n readOnly={showMaxLength}\n MenuProps={{\n transitionDuration: { enter: 225, exit: 195 },\n }}\n >\n <MenuItem value=\"\">\n <em>{value ? 'Remove selection' : 'Select a response'}</em>\n </MenuItem>\n {selectChoices.map((c, index) => (\n <MenuItem key={index} value={c?.value}>\n {decodeHTML(c?.label)}\n </MenuItem>\n ))}\n </Select>\n\n {choices && choices.length > 0 && (\n <RightContainer>\n {maxLength && showMaxLength && (\n <LengthField\n variant=\"standard\"\n label=\"Maximum length (characters)\"\n type=\"number\"\n inputProps={{\n min: minLength,\n max: minLength + 10,\n }}\n value={maxLength}\n onChange={this.changeLength}\n />\n )}\n <Button variant=\"contained\" color=\"primary\" onClick={this.onAddChoice}>\n Add\n </Button>\n </RightContainer>\n )}\n </SelectContainer>\n {errors && errors[0] && <ErrorText>{errors[0]}</ErrorText>}\n\n <AltChoices>\n {choices &&\n choices.map(\n (c, index) =>\n index > 0 && (\n <Choice\n key={index}\n markup={c.label}\n onChange={(val) => this.onChoiceChanged(c, val, index)}\n onDelete={() => this.onRemoveChoice(c)}\n spellCheck={spellCheck}\n error={errors && errors[index]}\n showMaxLength={showMaxLength}\n pluginProps={pluginProps}\n />\n ),\n )}\n </AltChoices>\n </DesignContainer>\n );\n }\n}\n\nexport default AlternateSection;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,OAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,UAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAEA,IAAAU,mBAAA,GAAAX,sBAAA,C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BAAA,CAAAC,OAAA,EArLY8C,gBAAgB,eACR;EACjBC,OAAO,EAAEP,kBAAS,CAACqD,KAAK;EACxB3C,aAAa,EAAEV,kBAAS,CAACqD,KAAK,CAAClD,UAAU;EACzCkC,MAAM,EAAErC,kBAAS,CAACK,MAAM;EACxBI,QAAQ,EAAET,kBAAS,CAACE,IAAI,CAACC,UAAU;EACnCqB,aAAa,EAAExB,kBAAS,CAACE,IAAI,CAACC,UAAU;EACxCsB,aAAa,EAAEzB,kBAAS,CAACE,IAAI;EAC7B6B,aAAa,EAAE/B,kBAAS,CAACE,IAAI,CAACC,UAAU;EACxC1C,KAAK,EAAEuC,kBAAS,CAACC,MAAM;EACvBnB,SAAS,EAAEkB,kBAAS,CAACsD,MAAM;EAC3B3E,aAAa,EAAEqB,kBAAS,CAACI,IAAI;EAC7B1B,UAAU,EAAEsB,kBAAS,CAACI,IAAI;EAC1BxB,WAAW,EAAEoB,kBAAS,CAACK;AACzB,CAAC;AAAA,IAAAkD,QAAA,GAAAxD,OAAA,CAAAvC,OAAA,GAyKY8C,gBAAgB","ignoreList":[]}
|
|
@@ -10,7 +10,8 @@ var _default = exports.default = {
|
|
|
10
10
|
displayType: 'block',
|
|
11
11
|
markup: '',
|
|
12
12
|
maxLengthPerChoiceEnabled: true,
|
|
13
|
-
|
|
13
|
+
// Student-facing spellcheck is off unless the author turns it on. See PIE-979.
|
|
14
|
+
playerSpellCheckEnabled: false,
|
|
14
15
|
prompt: '',
|
|
15
16
|
promptEnabled: true,
|
|
16
17
|
rationale: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","names":["model","choices","displayType","markup","maxLengthPerChoiceEnabled","playerSpellCheckEnabled","prompt","promptEnabled","rationale","rationaleEnabled","spellCheckEnabled","studentInstructionsEnabled","teacherInstructions","teacherInstructionsEnabled","toolbarEditorPosition","responseAreaInputConfiguration","configuration","baseInputConfiguration","h3","disabled","html","audio","video","image","textAlign","showParagraphs","separateParagraphs","settings","label","inputConfiguration","required","partialScoring","settingsPanelDisabled","spellCheck","enabled","editSource","playerSpellCheck","template","blockquote","maxLengthPerChoice","maxResponseAreas","maxImageWidth","maxImageHeight","withRubric","mathMlOptions","mmlOutput","mmlEditing","language","languageChoices","options","characters","spanishButton"],"sources":["../src/defaults.js"],"sourcesContent":["export default {\n model: {\n choices: {},\n displayType: 'block',\n markup: '',\n maxLengthPerChoiceEnabled: true,\n playerSpellCheckEnabled:
|
|
1
|
+
{"version":3,"file":"defaults.js","names":["model","choices","displayType","markup","maxLengthPerChoiceEnabled","playerSpellCheckEnabled","prompt","promptEnabled","rationale","rationaleEnabled","spellCheckEnabled","studentInstructionsEnabled","teacherInstructions","teacherInstructionsEnabled","toolbarEditorPosition","responseAreaInputConfiguration","configuration","baseInputConfiguration","h3","disabled","html","audio","video","image","textAlign","showParagraphs","separateParagraphs","settings","label","inputConfiguration","required","partialScoring","settingsPanelDisabled","spellCheck","enabled","editSource","playerSpellCheck","template","blockquote","maxLengthPerChoice","maxResponseAreas","maxImageWidth","maxImageHeight","withRubric","mathMlOptions","mmlOutput","mmlEditing","language","languageChoices","options","characters","spanishButton"],"sources":["../src/defaults.js"],"sourcesContent":["export default {\n model: {\n choices: {},\n displayType: 'block',\n markup: '',\n maxLengthPerChoiceEnabled: true,\n // Student-facing spellcheck is off unless the author turns it on. See PIE-979.\n playerSpellCheckEnabled: false,\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n spellCheckEnabled: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n responseAreaInputConfiguration: {},\n },\n configuration: {\n baseInputConfiguration: {\n h3: { disabled: true },\n html: { disabled: true },\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n textAlign: { disabled: true },\n showParagraphs: { disabled: false },\n separateParagraphs: { disabled: true },\n },\n prompt: {\n settings: true,\n label: 'Prompt',\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n required: false,\n },\n partialScoring: {\n settings: false,\n label: 'Allow Partial Scoring',\n },\n rationale: {\n settings: true,\n label: 'Rationale',\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n required: false,\n },\n settingsPanelDisabled: false,\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n editSource: {\n label: 'Edit Source',\n settings: false,\n enabled: false,\n },\n playerSpellCheck: {\n label: 'Student Spellcheck',\n settings: true,\n enabled: true,\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n required: false,\n },\n template: {\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n h3: { disabled: true },\n blockquote: { disabled: true },\n },\n },\n maxLengthPerChoice: {\n settings: true,\n label: 'Maximum Length Per Choice',\n },\n maxResponseAreas: 10,\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric',\n },\n mathMlOptions: {\n mmlOutput: false,\n mmlEditing: false,\n },\n language: {\n settings: false,\n label: 'Specify Language',\n enabled: false,\n },\n languageChoices: {\n label: 'Language Choices',\n options: [],\n },\n responseAreaInputConfiguration: {\n inputConfiguration: {\n characters: {\n disabled: true\n },\n },\n },\n spanishButton: {\n settings: true,\n label: 'Disable Spanish Characters',\n },\n },\n};\n"],"mappings":";;;;;;iCAAe;EACbA,KAAK,EAAE;IACLC,OAAO,EAAE,CAAC,CAAC;IACXC,WAAW,EAAE,OAAO;IACpBC,MAAM,EAAE,EAAE;IACVC,yBAAyB,EAAE,IAAI;IAC/B;IACAC,uBAAuB,EAAE,KAAK;IAC9BC,MAAM,EAAE,EAAE;IACVC,aAAa,EAAE,I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GAAG;MACXE,SAAS,EAAE;IACb,CAAC;IACDkC,cAAc,EAAE;MACd9B,mBAAmB,EAAE,GAAG;MACxBN,MAAM,EAAE,GAAG;MACXE,SAAS,EAAE;IACb,CAAC;IACDmC,UAAU,EAAE;MACVhB,QAAQ,EAAE,KAAK;MACfC,KAAK,EAAE;IACT,CAAC;IACDgB,aAAa,EAAE;MACbC,SAAS,EAAE,KAAK;MAChBC,UAAU,EAAE;IACd,CAAC;IACDC,QAAQ,EAAE;MACRpB,QAAQ,EAAE,KAAK;MACfC,KAAK,EAAE,kBAAkB;MACzBM,OAAO,EAAE;IACX,CAAC;IACDc,eAAe,EAAE;MACfpB,KAAK,EAAE,kBAAkB;MACzBqB,OAAO,EAAE;IACX,CAAC;IACDlC,8BAA8B,EAAE;MAC9Bc,kBAAkB,EAAE;QAClBqB,UAAU,EAAE;UACV/B,QAAQ,EAAE;QACZ;MACF;IACF,CAAC;IACDgC,aAAa,EAAE;MACbxB,QAAQ,EAAE,IAAI;MACdC,KAAK,EAAE;IACT;EACF;AACF,CAAC","ignoreList":[]}
|
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/explicit-constructed-response-configure",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"modue": "src/index.js",
|
|
@@ -10,8 +10,8 @@
|
|
|
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.
|
|
13
|
+
"@pie-lib/config-ui": "13.0.19",
|
|
14
|
+
"@pie-lib/editable-html-tip-tap": "2.1.17",
|
|
15
15
|
"classnames": "^2.2.6",
|
|
16
16
|
"debug": "^4.1.1",
|
|
17
17
|
"lodash-es": "^4.17.23",
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,60 +3,30 @@
|
|
|
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/explicit-constructed-response-controller@8.1.4...@pie-element/explicit-constructed-response-controller@8.1.5) (2026-09-04)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# [8.4.0-beta.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@8.4.0-beta.7...@pie-element/explicit-constructed-response-controller@8.4.0-beta.8) (2026-08-26)
|
|
11
|
-
|
|
12
|
-
**Note:** Version bump only for package @pie-element/explicit-constructed-response-controller
|
|
13
|
-
|
|
14
|
-
# [8.4.0-beta.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@8.4.0-beta.6...@pie-element/explicit-constructed-response-controller@8.4.0-beta.7) (2026-08-20)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @pie-element/explicit-constructed-response-controller
|
|
17
|
-
|
|
18
|
-
# [8.4.0-beta.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@8.4.0-beta.5...@pie-element/explicit-constructed-response-controller@8.4.0-beta.6) (2026-08-14)
|
|
19
|
-
|
|
20
|
-
**Note:** Version bump only for package @pie-element/explicit-constructed-response-controller
|
|
21
|
-
|
|
22
|
-
# [8.4.0-beta.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@8.4.0-beta.4...@pie-element/explicit-constructed-response-controller@8.4.0-beta.5) (2026-08-11)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @pie-element/explicit-constructed-response-controller
|
|
25
|
-
|
|
26
|
-
# [8.4.0-beta.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@8.4.0-beta.3...@pie-element/explicit-constructed-response-controller@8.4.0-beta.4) (2026-08-11)
|
|
27
|
-
|
|
28
|
-
**Note:** Version bump only for package @pie-element/explicit-constructed-response-controller
|
|
29
|
-
|
|
30
|
-
# [8.4.0-beta.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@8.4.0-beta.2...@pie-element/explicit-constructed-response-controller@8.4.0-beta.3) (2026-08-11)
|
|
8
|
+
### Bug Fixes
|
|
31
9
|
|
|
32
|
-
**
|
|
10
|
+
- **explicit-constructed-response:** honor the student spellcheck setting PIE-979 ([98c67b3](https://github.com/pie-framework/pie-elements/commit/98c67b3484472b0325defc1fc694822ea3c6cd64))
|
|
33
11
|
|
|
34
|
-
|
|
12
|
+
## [8.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@8.1.2...@pie-element/explicit-constructed-response-controller@8.1.4) (2026-08-13)
|
|
35
13
|
|
|
36
14
|
**Note:** Version bump only for package @pie-element/explicit-constructed-response-controller
|
|
37
15
|
|
|
38
|
-
|
|
16
|
+
## [8.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@8.1.2...@pie-element/explicit-constructed-response-controller@8.1.3) (2026-08-11)
|
|
39
17
|
|
|
40
18
|
**Note:** Version bump only for package @pie-element/explicit-constructed-response-controller
|
|
41
19
|
|
|
42
|
-
|
|
20
|
+
## [8.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@8.1.1...@pie-element/explicit-constructed-response-controller@8.1.2) (2026-07-02)
|
|
43
21
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
# [8.3.0-beta.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@8.3.0-beta.0...@pie-element/explicit-constructed-response-controller@8.3.0-beta.1) (2026-08-07)
|
|
22
|
+
### Bug Fixes
|
|
47
23
|
|
|
48
|
-
|
|
24
|
+
- 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))
|
|
49
25
|
|
|
50
|
-
|
|
26
|
+
## [8.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@8.1.0...@pie-element/explicit-constructed-response-controller@8.1.1) (2026-05-21)
|
|
51
27
|
|
|
52
28
|
**Note:** Version bump only for package @pie-element/explicit-constructed-response-controller
|
|
53
29
|
|
|
54
|
-
# [8.2.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@8.1.0...@pie-element/explicit-constructed-response-controller@8.2.0-beta.0) (2026-08-07)
|
|
55
|
-
|
|
56
|
-
### Bug Fixes
|
|
57
|
-
|
|
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
|
-
|
|
60
30
|
# [8.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@8.1.0-next.1...@pie-element/explicit-constructed-response-controller@8.1.0) (2026-05-21)
|
|
61
31
|
|
|
62
32
|
### Bug Fixes
|
|
@@ -9,7 +9,8 @@ var _default = exports.default = {
|
|
|
9
9
|
displayType: 'block',
|
|
10
10
|
markup: '',
|
|
11
11
|
maxLengthPerChoiceEnabled: true,
|
|
12
|
-
|
|
12
|
+
// Student-facing spellcheck is off unless the model opts in. See PIE-979.
|
|
13
|
+
playerSpellCheckEnabled: false,
|
|
13
14
|
prompt: '',
|
|
14
15
|
promptEnabled: true,
|
|
15
16
|
rationale: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","names":["choices","displayType","markup","maxLengthPerChoiceEnabled","playerSpellCheckEnabled","prompt","promptEnabled","rationale","rationaleEnabled","spellCheckEnabled","studentInstructionsEnabled","teacherInstructions","teacherInstructionsEnabled","toolbarEditorPosition"],"sources":["../src/defaults.js"],"sourcesContent":["export default {\n choices: {},\n displayType: 'block',\n markup: '',\n maxLengthPerChoiceEnabled: true,\n playerSpellCheckEnabled:
|
|
1
|
+
{"version":3,"file":"defaults.js","names":["choices","displayType","markup","maxLengthPerChoiceEnabled","playerSpellCheckEnabled","prompt","promptEnabled","rationale","rationaleEnabled","spellCheckEnabled","studentInstructionsEnabled","teacherInstructions","teacherInstructionsEnabled","toolbarEditorPosition"],"sources":["../src/defaults.js"],"sourcesContent":["export default {\n choices: {},\n displayType: 'block',\n markup: '',\n maxLengthPerChoiceEnabled: true,\n // Student-facing spellcheck is off unless the model opts in. See PIE-979.\n playerSpellCheckEnabled: false,\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n spellCheckEnabled: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n"],"mappings":";;;;;;iCAAe;EACbA,OAAO,EAAE,CAAC,CAAC;EACXC,WAAW,EAAE,OAAO;EACpBC,MAAM,EAAE,EAAE;EACVC,yBAAyB,EAAE,IAAI;EAC/B;EACAC,uBAAuB,EAAE,KAAK;EAC9BC,MAAM,EAAE,EAAE;EACVC,aAAa,EAAE,IAAI;EACnBC,SAAS,EAAE,EAAE;EACbC,gBAAgB,EAAE,IAAI;EACtBC,iBAAiB,EAAE,IAAI;EACvBC,0BAA0B,EAAE,IAAI;EAChCC,mBAAmB,EAAE,EAAE;EACvBC,0BAA0B,EAAE,IAAI;EAChCC,qBAAqB,EAAE;AACzB,CAAC","ignoreList":[]}
|
package/controller/lib/index.js
CHANGED
|
@@ -145,7 +145,9 @@ async function model(question, session, env) {
|
|
|
145
145
|
maxLengthPerChoice,
|
|
146
146
|
maxLengthPerChoiceEnabled,
|
|
147
147
|
note,
|
|
148
|
-
|
|
148
|
+
// normalize's defaults cover a missing key, but a key present as undefined/null overwrites
|
|
149
|
+
// them and would reach the editor as undefined, which enables spellcheck. See PIE-979.
|
|
150
|
+
playerSpellCheckEnabled: normalizedQuestion.playerSpellCheckEnabled === true,
|
|
149
151
|
prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : _defaults.default.prompt,
|
|
150
152
|
rationale: _defaults.default.rationale,
|
|
151
153
|
responseCorrect: env.mode === 'evaluate' ? getScore(normalizedQuestion, session) === 1 : undefined,
|