@pie-element/extended-text-entry 15.2.0-beta.0 → 15.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +66 -6
- package/configure/CHANGELOG.md +59 -6
- package/configure/package.json +3 -3
- package/controller/CHANGELOG.md +9 -1
- package/controller/package.json +1 -1
- package/docs/demo/PIE-927-math-repro.md +170 -0
- package/lib/annotation/annotation-menu.js +17 -14
- package/lib/annotation/annotation-menu.js.map +1 -1
- package/lib/annotation/freeform-editor.js +11 -12
- package/lib/annotation/freeform-editor.js.map +1 -1
- package/module/configure.js +1 -0
- package/module/controller.js +139 -0
- package/module/demo.js +38 -0
- package/module/element.js +1 -0
- package/module/index.html +21 -0
- package/module/manifest.json +22 -0
- package/module/print-demo.js +76 -0
- package/module/print.html +18 -0
- package/module/print.js +1 -0
- package/package.json +5 -5
- package/configure/lib/__tests__/main.test.js +0 -123
- package/controller/lib/__tests__/index.test.js +0 -350
- package/docs/demo/pie.manifest.json +0 -11
- package/lib/__tests__/index.test.js +0 -37
- package/lib/annotation/__tests__/annotation-editor.test.js +0 -326
- package/lib/annotation/__tests__/freeform-editor.test.js +0 -136
package/CHANGELOG.md
CHANGED
|
@@ -3,20 +3,80 @@
|
|
|
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
|
-
# [15.2.0
|
|
6
|
+
# [15.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.11...@pie-element/extended-text-entry@15.2.0) (2026-08-21)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- 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))
|
|
11
|
+
- 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))
|
|
12
|
+
- restore demo setup PIE-927 ([c1bf7f3](https://github.com/pie-framework/pie-elements/commit/c1bf7f323f5895cef8ca0d3af9dc76f20805c3da))
|
|
13
|
+
- **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)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
- bump libs PIE-856, PIE-681, PIE-927 ([cb26d7a](https://github.com/pie-framework/pie-elements/commit/cb26d7afa6c99522533c321d5ff8ce3148a66e9e))
|
|
18
|
+
|
|
19
|
+
## [15.1.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.10...@pie-element/extended-text-entry@15.1.11) (2026-08-19)
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
- bump libs and shared modules PIE-681, PIE-708 ([08af8b5](https://github.com/pie-framework/pie-elements/commit/08af8b5802aecc8ee5454a1b6d60277d7ec94204))
|
|
24
|
+
|
|
25
|
+
## [15.1.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.8...@pie-element/extended-text-entry@15.1.10) (2026-08-13)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @pie-element/extended-text-entry
|
|
28
|
+
|
|
29
|
+
## [15.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.7...@pie-element/extended-text-entry@15.1.9) (2026-08-11)
|
|
30
|
+
|
|
31
|
+
**Note:** Version bump only for package @pie-element/extended-text-entry
|
|
32
|
+
|
|
33
|
+
## [15.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.7...@pie-element/extended-text-entry@15.1.8) (2026-07-31)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @pie-element/extended-text-entry
|
|
36
|
+
|
|
37
|
+
## [15.1.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.6...@pie-element/extended-text-entry@15.1.7) (2026-07-08)
|
|
7
38
|
|
|
8
39
|
### Bug Fixes
|
|
9
40
|
|
|
10
41
|
- bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
42
|
+
|
|
43
|
+
## [15.1.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.5...@pie-element/extended-text-entry@15.1.6) (2026-07-02)
|
|
44
|
+
|
|
45
|
+
### Bug Fixes
|
|
46
|
+
|
|
14
47
|
- 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))
|
|
15
|
-
-
|
|
48
|
+
- sync libs versions ([48b5be9](https://github.com/pie-framework/pie-elements/commit/48b5be9559eb5b5235ca05f51c5f0161032a7041))
|
|
49
|
+
|
|
50
|
+
## [15.1.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.4...@pie-element/extended-text-entry@15.1.5) (2026-06-22)
|
|
51
|
+
|
|
52
|
+
### Bug Fixes
|
|
53
|
+
|
|
54
|
+
- 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))
|
|
16
55
|
- **extended-text-entry:** ensure StyledPrompt is displayed as a block element PIE-692 ([a230a25](https://github.com/pie-framework/pie-elements/commit/a230a253451996a15fb24adfc53f43c5e7550fa5))
|
|
17
56
|
- **extended-text-entry:** re-render elements on reconnect PIE-672 ([9b241e8](https://github.com/pie-framework/pie-elements/commit/9b241e850263da72de72692265d244dbb023e3a1))
|
|
18
57
|
- if allowMultiplePlacements default should be false PIE-682 ([b7447f4](https://github.com/pie-framework/pie-elements/commit/b7447f4d97e9d7cc2415f54a17ffe13ed15d1ebb))
|
|
19
|
-
|
|
58
|
+
|
|
59
|
+
## [15.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.3...@pie-element/extended-text-entry@15.1.4) (2026-06-17)
|
|
60
|
+
|
|
61
|
+
### Bug Fixes
|
|
62
|
+
|
|
63
|
+
- 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))
|
|
64
|
+
|
|
65
|
+
## [15.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.2...@pie-element/extended-text-entry@15.1.3) (2026-06-12)
|
|
66
|
+
|
|
67
|
+
### Bug Fixes
|
|
68
|
+
|
|
69
|
+
- bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
|
|
70
|
+
|
|
71
|
+
## [15.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.1...@pie-element/extended-text-entry@15.1.2) (2026-06-04)
|
|
72
|
+
|
|
73
|
+
### Bug Fixes
|
|
74
|
+
|
|
75
|
+
- bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
|
|
76
|
+
|
|
77
|
+
## [15.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.0...@pie-element/extended-text-entry@15.1.1) (2026-05-21)
|
|
78
|
+
|
|
79
|
+
**Note:** Version bump only for package @pie-element/extended-text-entry
|
|
20
80
|
|
|
21
81
|
# [15.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.0-next.1...@pie-element/extended-text-entry@15.1.0) (2026-05-21)
|
|
22
82
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,19 +3,72 @@
|
|
|
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.2.0
|
|
6
|
+
# [13.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.11...@pie-element/extended-text-entry-configure@13.2.0) (2026-08-21)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- bump libs PIE-856, PIE-681, PIE-927 ([cb26d7a](https://github.com/pie-framework/pie-elements/commit/cb26d7afa6c99522533c321d5ff8ce3148a66e9e))
|
|
11
|
+
|
|
12
|
+
## [13.1.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.10...@pie-element/extended-text-entry-configure@13.1.11) (2026-08-19)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- bump libs and shared modules PIE-681, PIE-708 ([08af8b5](https://github.com/pie-framework/pie-elements/commit/08af8b5802aecc8ee5454a1b6d60277d7ec94204))
|
|
17
|
+
|
|
18
|
+
## [13.1.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.8...@pie-element/extended-text-entry-configure@13.1.10) (2026-08-13)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package @pie-element/extended-text-entry-configure
|
|
21
|
+
|
|
22
|
+
## [13.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.7...@pie-element/extended-text-entry-configure@13.1.9) (2026-08-11)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @pie-element/extended-text-entry-configure
|
|
25
|
+
|
|
26
|
+
## [13.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.7...@pie-element/extended-text-entry-configure@13.1.8) (2026-07-31)
|
|
27
|
+
|
|
28
|
+
**Note:** Version bump only for package @pie-element/extended-text-entry-configure
|
|
29
|
+
|
|
30
|
+
## [13.1.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.6...@pie-element/extended-text-entry-configure@13.1.7) (2026-07-08)
|
|
7
31
|
|
|
8
32
|
### Bug Fixes
|
|
9
33
|
|
|
10
34
|
- bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
35
|
+
|
|
36
|
+
## [13.1.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.5...@pie-element/extended-text-entry-configure@13.1.6) (2026-07-02)
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
14
40
|
- 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))
|
|
15
|
-
-
|
|
41
|
+
- sync libs versions ([48b5be9](https://github.com/pie-framework/pie-elements/commit/48b5be9559eb5b5235ca05f51c5f0161032a7041))
|
|
42
|
+
|
|
43
|
+
## [13.1.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.4...@pie-element/extended-text-entry-configure@13.1.5) (2026-06-22)
|
|
44
|
+
|
|
45
|
+
### Bug Fixes
|
|
46
|
+
|
|
47
|
+
- 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))
|
|
16
48
|
- **extended-text-entry:** re-render elements on reconnect PIE-672 ([9b241e8](https://github.com/pie-framework/pie-elements/commit/9b241e850263da72de72692265d244dbb023e3a1))
|
|
17
49
|
- if allowMultiplePlacements default should be false PIE-682 ([b7447f4](https://github.com/pie-framework/pie-elements/commit/b7447f4d97e9d7cc2415f54a17ffe13ed15d1ebb))
|
|
18
|
-
|
|
50
|
+
|
|
51
|
+
## [13.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.3...@pie-element/extended-text-entry-configure@13.1.4) (2026-06-17)
|
|
52
|
+
|
|
53
|
+
### Bug Fixes
|
|
54
|
+
|
|
55
|
+
- 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))
|
|
56
|
+
|
|
57
|
+
## [13.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.2...@pie-element/extended-text-entry-configure@13.1.3) (2026-06-12)
|
|
58
|
+
|
|
59
|
+
### Bug Fixes
|
|
60
|
+
|
|
61
|
+
- bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
|
|
62
|
+
|
|
63
|
+
## [13.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.1...@pie-element/extended-text-entry-configure@13.1.2) (2026-06-04)
|
|
64
|
+
|
|
65
|
+
### Bug Fixes
|
|
66
|
+
|
|
67
|
+
- bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
|
|
68
|
+
|
|
69
|
+
## [13.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.0...@pie-element/extended-text-entry-configure@13.1.1) (2026-05-21)
|
|
70
|
+
|
|
71
|
+
**Note:** Version bump only for package @pie-element/extended-text-entry-configure
|
|
19
72
|
|
|
20
73
|
# [13.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.0-next.1...@pie-element/extended-text-entry-configure@13.1.0) (2026-05-21)
|
|
21
74
|
|
package/configure/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/extended-text-entry-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "13.2.0
|
|
4
|
+
"version": "13.2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"@mui/icons-material": "^7.3.4",
|
|
14
14
|
"@mui/material": "^7.3.4",
|
|
15
15
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
16
|
-
"@pie-lib/config-ui": "13.
|
|
17
|
-
"@pie-lib/editable-html-tip-tap": "2.
|
|
16
|
+
"@pie-lib/config-ui": "13.0.16",
|
|
17
|
+
"@pie-lib/editable-html-tip-tap": "2.1.14",
|
|
18
18
|
"lodash-es": "^4.17.23",
|
|
19
19
|
"prop-types": "^15.8.1",
|
|
20
20
|
"react": "18.3.1",
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,15 @@
|
|
|
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
|
+
## [9.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-controller@9.1.1...@pie-element/extended-text-entry-controller@9.1.3) (2026-08-13)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/extended-text-entry-controller
|
|
9
|
+
|
|
10
|
+
## [9.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-controller@9.1.1...@pie-element/extended-text-entry-controller@9.1.2) (2026-08-11)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @pie-element/extended-text-entry-controller
|
|
13
|
+
|
|
14
|
+
## [9.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-controller@9.1.0...@pie-element/extended-text-entry-controller@9.1.1) (2026-05-21)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @pie-element/extended-text-entry-controller
|
|
9
17
|
|
package/controller/package.json
CHANGED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# PIE-927 — math prompt repro harness (archived)
|
|
2
|
+
|
|
3
|
+
Reported as **DNAFORM-2099**: `extended-text-entry` prompts showed their raw latex source
|
|
4
|
+
(`P\left(x\right)=-2x^{3}...`) instead of typeset math.
|
|
5
|
+
|
|
6
|
+
This file archives the throwaway demo harness built to reproduce it. The demo itself was reverted to
|
|
7
|
+
its plain single-item form once the fix landed — everything needed to rebuild the harness is below.
|
|
8
|
+
|
|
9
|
+
## Cause and fix
|
|
10
|
+
|
|
11
|
+
The prompt container was located by a **shared DOM id**. With several items of the same element on
|
|
12
|
+
one page, every item resolved that id to the *first* match, so an item would request math
|
|
13
|
+
typesetting against another item's node — leaving its own prompt untypeset.
|
|
14
|
+
|
|
15
|
+
Fixed in two halves:
|
|
16
|
+
|
|
17
|
+
| Repo | Change |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `pie-lib` | `fix(render-ui)!: scope PreviewPrompt to its own node instead of a shared id` — breaking, shipped in `@pie-lib/render-ui@7.0.0` |
|
|
20
|
+
| `pie-elements` | `fix: read the prompt container by class, not by the id pie-lib removed` |
|
|
21
|
+
|
|
22
|
+
## Why the harness needed several items
|
|
23
|
+
|
|
24
|
+
**A single item on a page typesets fine.** The id collision cannot happen with one item, so a
|
|
25
|
+
one-item demo shows nothing. Any future repro must mount **more than one** item of the same element.
|
|
26
|
+
|
|
27
|
+
The harness mounted 5 items × 6 expressions = **30 tagged prompt expressions**, each prefixed with a
|
|
28
|
+
unique tag (`[3.E2]`) so a mis-rendered one could be named exactly. Two extra tags per item —
|
|
29
|
+
`[n.T1]` in teacher instructions, `[n.F1]` in feedback — need `role=instructor` (with `mode=view` or
|
|
30
|
+
`evaluate`) and `mode=evaluate` respectively to appear at all.
|
|
31
|
+
|
|
32
|
+
## Expression shapes covered
|
|
33
|
+
|
|
34
|
+
The two forms below both appeared in the reported items and both must render. `E1`'s wrapper holds no
|
|
35
|
+
delimiters and braces its exponents; `E2`'s holds the delimiters and leaves exponents unbraced.
|
|
36
|
+
|
|
37
|
+
| Tag | Shape |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `E1` | wrapper without delimiters, braced exponents — `P\left(x\right)=-2x^{3}-4x^{2}+18x+36` |
|
|
40
|
+
| `E2` | wrapper with delimiters, unbraced exponents — `P\left(x\right)=-2x^3-4x^2+18x+36` |
|
|
41
|
+
| `E3` | fraction and radical — `x=\frac{-b\pm\sqrt{b^{2}-4ac}}{2a}` |
|
|
42
|
+
| `E4` | radical, no delimiters — `\sqrt[3]{27x^{6}}=3x^{2}` |
|
|
43
|
+
| `E5` | series with limits — `\sum_{n=1}^{\infty}\frac{1}{n^{2}}=\frac{\pi^{2}}{6}` |
|
|
44
|
+
| `E6` | MathML pasted raw, no `data-latex` wrapper (exercises the other code path) |
|
|
45
|
+
| `T1` | teacher instructions (needs `role=instructor`) |
|
|
46
|
+
| `F1` | feedback (needs `mode=evaluate`) |
|
|
47
|
+
|
|
48
|
+
Two wrapper builders drove `E1`–`E5`:
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
// no delimiters inside the wrapper: renderMath() adds them itself, via fixMathElements()
|
|
52
|
+
const bare = (latex) => `<span data-latex="" data-raw="${latex}">${latex}</span>`;
|
|
53
|
+
|
|
54
|
+
// already delimited - the form that shipped in the item that failed to render
|
|
55
|
+
const delimited = (latex) => `<span data-latex="" data-raw="${latex}">\\(${latex}\\)</span>`;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Rebuilding it
|
|
59
|
+
|
|
60
|
+
Run with `yarn pie-install` / the usual demo flow from `packages/extended-text-entry`. Restore these
|
|
61
|
+
four files, then remember that `ITEM_COUNT` drives `config.js` and `session.js` **but not**
|
|
62
|
+
`index.html`, which hardcodes its elements — raising the count means adding matching markup there.
|
|
63
|
+
|
|
64
|
+
### `generate.js`
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
const LATEX = {
|
|
68
|
+
polyBraced: 'P\\left(x\\right)=-2x^{3}-4x^{2}+18x+36',
|
|
69
|
+
polyPlain: 'P\\left(x\\right)=-2x^3-4x^2+18x+36',
|
|
70
|
+
quadratic: 'x=\\frac{-b\\pm\\sqrt{b^{2}-4ac}}{2a}',
|
|
71
|
+
radical: '\\sqrt[3]{27x^{6}}=3x^{2}',
|
|
72
|
+
series: '\\sum_{n=1}^{\\infty}\\frac{1}{n^{2}}=\\frac{\\pi^{2}}{6}',
|
|
73
|
+
inequality: '-3\\le x\\le 2',
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const MATHML =
|
|
77
|
+
'<math xmlns="http://www.w3.org/1998/Math/MathML">' +
|
|
78
|
+
'<mfrac><mrow><mn>3</mn><mi>x</mi></mrow><mn>4</mn></mfrac></math>';
|
|
79
|
+
|
|
80
|
+
const bare = (latex) => `<span data-latex="" data-raw="${latex}">${latex}</span>`;
|
|
81
|
+
const delimited = (latex) => `<span data-latex="" data-raw="${latex}">\\(${latex}\\)</span>`;
|
|
82
|
+
const tag = (label) => `<strong style="color:#b00020;font-family:ui-monospace,Menlo,monospace">[${label}]</strong>`;
|
|
83
|
+
const line = (label, note, markup) => `<div>${tag(label)} ${note}: ${markup}</div>`;
|
|
84
|
+
|
|
85
|
+
const prompt = (item) =>
|
|
86
|
+
[
|
|
87
|
+
`<p>Item ${item}. Every expression below must show as typeset math — ` +
|
|
88
|
+
'if any shows its raw latex source instead, report it by its tag.</p>',
|
|
89
|
+
line(`${item}.E1`, 'wrapper without delimiters, braced exponents', bare(LATEX.polyBraced)),
|
|
90
|
+
line(`${item}.E2`, 'wrapper with delimiters, unbraced exponents', delimited(LATEX.polyPlain)),
|
|
91
|
+
line(`${item}.E3`, 'fraction and radical', delimited(LATEX.quadratic)),
|
|
92
|
+
line(`${item}.E4`, 'radical, no delimiters', bare(LATEX.radical)),
|
|
93
|
+
line(`${item}.E5`, 'series with limits', delimited(LATEX.series)),
|
|
94
|
+
line(`${item}.E6`, 'mathml, no data-latex wrapper', MATHML),
|
|
95
|
+
].join('');
|
|
96
|
+
|
|
97
|
+
exports.model = (id, element) => ({
|
|
98
|
+
id,
|
|
99
|
+
element,
|
|
100
|
+
customKeys: ['\\square'],
|
|
101
|
+
feedback: {
|
|
102
|
+
type: 'custom',
|
|
103
|
+
default: 'this is default feedback',
|
|
104
|
+
custom: line(`${id}.F1`, 'feedback', delimited(LATEX.inequality)),
|
|
105
|
+
},
|
|
106
|
+
feedbackEnabled: true,
|
|
107
|
+
prompt: prompt(id),
|
|
108
|
+
promptEnabled: true,
|
|
109
|
+
teacherInstructions: line(`${id}.T1`, 'teacher instructions', delimited(LATEX.polyPlain)),
|
|
110
|
+
teacherInstructionsEnabled: true,
|
|
111
|
+
mathInput: true,
|
|
112
|
+
playersToolbarPosition: 'bottom',
|
|
113
|
+
toolbarEditorPosition: 'bottom',
|
|
114
|
+
spellCheckEnabled: true,
|
|
115
|
+
rubricEnabled: false,
|
|
116
|
+
annotationsEnabled: false,
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
exports.ITEM_COUNT = 5;
|
|
120
|
+
exports.PROMPT_EXPRESSIONS_PER_ITEM = 6;
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### `config.js`
|
|
124
|
+
|
|
125
|
+
```js
|
|
126
|
+
const { model, ITEM_COUNT } = require('./generate');
|
|
127
|
+
|
|
128
|
+
const ids = Array.from({ length: ITEM_COUNT }, (_, i) => `${i + 1}`);
|
|
129
|
+
|
|
130
|
+
module.exports = {
|
|
131
|
+
elements: {
|
|
132
|
+
'extended-text-entry': '../..',
|
|
133
|
+
},
|
|
134
|
+
models: ids.map((id) => model(id, 'extended-text-entry')),
|
|
135
|
+
};
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### `session.js`
|
|
139
|
+
|
|
140
|
+
One session per model — the player needs a session whose `id` matches each model's `id`, so this must
|
|
141
|
+
stay the same length as `config.js`.
|
|
142
|
+
|
|
143
|
+
```js
|
|
144
|
+
const { ITEM_COUNT } = require('./generate');
|
|
145
|
+
|
|
146
|
+
module.exports = Array.from({ length: ITEM_COUNT }, (_, i) => ({
|
|
147
|
+
id: `${i + 1}`,
|
|
148
|
+
element: 'extended-text-entry',
|
|
149
|
+
}));
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### `index.html`
|
|
153
|
+
|
|
154
|
+
Five `<extended-text-entry>` elements with `pie-id="1"`…`"5"`, each wrapped in a labelled box:
|
|
155
|
+
|
|
156
|
+
```html
|
|
157
|
+
<div class="body">
|
|
158
|
+
<div class="math-demo-item">
|
|
159
|
+
<h5>item 1 — 1.E1–1.E6</h5>
|
|
160
|
+
<extended-text-entry pie-id="1"></extended-text-entry>
|
|
161
|
+
</div>
|
|
162
|
+
<!-- repeat for pie-id 2..5 -->
|
|
163
|
+
</div>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Regression check
|
|
167
|
+
|
|
168
|
+
Nothing here is covered by the Jest suite — it needs a real browser to observe typesetting. Rebuild
|
|
169
|
+
this harness and eyeball all 30 tags after any change to prompt rendering or to the math-rendering
|
|
170
|
+
libs (`@pie-lib/render-ui`, `@pie-lib/math-rendering`, `@pie-lib/math-rendering-accessible`).
|
|
@@ -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 _material = require("@mui/material");
|
|
13
|
+
var _renderUi = require("@pie-lib/render-ui");
|
|
13
14
|
const StyledPopover = (0, _styles.styled)(_material.Popover)({
|
|
14
15
|
'& .MuiPaper-root': {
|
|
15
16
|
overflowX: 'unset',
|
|
@@ -24,47 +25,49 @@ const StyledPopover = (0, _styles.styled)(_material.Popover)({
|
|
|
24
25
|
width: 0,
|
|
25
26
|
pointerEvents: 'none',
|
|
26
27
|
borderWidth: '7px',
|
|
27
|
-
borderTopColor:
|
|
28
|
+
borderTopColor: _renderUi.color.border()
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* Surface and stroke move together. Tokenising the border alone would put a scheme's
|
|
35
|
+
* border colour on a fixed white popover -- under white-on-black, `--pie-border` is
|
|
36
|
+
* #ffffff, so the outline would vanish. `--pie-white` inverts with the scheme, which
|
|
37
|
+
* is what `common.white` was standing in for.
|
|
38
|
+
*/
|
|
39
|
+
const MainWrapper = (0, _styles.styled)('div')(() => ({
|
|
34
40
|
width: '300px',
|
|
35
41
|
overflow: 'hidden',
|
|
36
42
|
borderRadius: '4px',
|
|
37
|
-
backgroundColor:
|
|
38
|
-
border: `2px solid ${
|
|
43
|
+
backgroundColor: _renderUi.color.white(),
|
|
44
|
+
border: `2px solid ${_renderUi.color.border()}`
|
|
39
45
|
}));
|
|
40
46
|
const AnnotationsWrapper = (0, _styles.styled)('div')({
|
|
41
47
|
display: 'flex',
|
|
42
48
|
flexWrap: 'wrap'
|
|
43
49
|
});
|
|
44
|
-
const ControlsWrapper = (0, _styles.styled)('div')(({
|
|
45
|
-
theme
|
|
46
|
-
}) => ({
|
|
50
|
+
const ControlsWrapper = (0, _styles.styled)('div')(() => ({
|
|
47
51
|
display: 'flex',
|
|
48
52
|
flexWrap: 'wrap',
|
|
49
|
-
borderTop: `2px solid ${
|
|
53
|
+
borderTop: `2px solid ${_renderUi.color.border()}`
|
|
50
54
|
}));
|
|
51
55
|
const Button = (0, _styles.styled)('div')(({
|
|
52
|
-
theme,
|
|
53
56
|
variant
|
|
54
57
|
}) => ({
|
|
55
58
|
width: '22%',
|
|
56
59
|
textAlign: 'center',
|
|
57
60
|
padding: '4px',
|
|
58
61
|
cursor: 'pointer',
|
|
59
|
-
borderBottom: `1px solid ${
|
|
62
|
+
borderBottom: `1px solid ${_renderUi.color.border()}`,
|
|
60
63
|
'&:not(:nth-child(4n))': {
|
|
61
|
-
borderRight: `1px solid ${
|
|
64
|
+
borderRight: `1px solid ${_renderUi.color.border()}`
|
|
62
65
|
},
|
|
63
66
|
'&:nth-child(4n)': {
|
|
64
67
|
flexGrow: 1
|
|
65
68
|
},
|
|
66
69
|
'&:hover': {
|
|
67
|
-
backgroundColor:
|
|
70
|
+
backgroundColor: _renderUi.color.backgroundDark()
|
|
68
71
|
},
|
|
69
72
|
...(variant === 'positive' && {
|
|
70
73
|
backgroundColor: 'rgb(153, 255, 153) !important',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation-menu.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_material","StyledPopover","styled","Popover","overflowX","overflowY","marginTop","position","left","border","content","height","width","pointerEvents","borderWidth","borderTopColor","
|
|
1
|
+
{"version":3,"file":"annotation-menu.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_material","_renderUi","StyledPopover","styled","Popover","overflowX","overflowY","marginTop","position","left","border","content","height","width","pointerEvents","borderWidth","borderTopColor","color","MainWrapper","overflow","borderRadius","backgroundColor","white","AnnotationsWrapper","display","flexWrap","ControlsWrapper","borderTop","Button","variant","textAlign","padding","cursor","borderBottom","borderRight","flexGrow","backgroundDark","filter","AnnotationMenu","React","Component","render","anchorEl","annotations","isNewAnnotation","onAnnotate","onClose","onEdit","onDelete","onWrite","open","props","default","createElement","elevation","transitionDuration","enter","exit","anchorOrigin","vertical","horizontal","transformOrigin","map","annotation","index","key","type","onClick","label","style","Fragment","_defineProperty2","PropTypes","object","bool","array","func","_default","exports"],"sources":["../../src/annotation/annotation-menu.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { Popover } from '@mui/material';\nimport { color } from '@pie-lib/render-ui';\n\nconst StyledPopover = styled(Popover)({\n '& .MuiPaper-root': {\n overflowX: 'unset',\n overflowY: 'unset',\n marginTop: '-16px',\n '&::after': {\n position: 'absolute',\n left: 'calc(50% - 7px)',\n border: 'solid transparent',\n content: '\"\"',\n height: 0,\n width: 0,\n pointerEvents: 'none',\n borderWidth: '7px',\n borderTopColor: color.border(),\n },\n },\n});\n\n/*\n * Surface and stroke move together. Tokenising the border alone would put a scheme's\n * border colour on a fixed white popover -- under white-on-black, `--pie-border` is\n * #ffffff, so the outline would vanish. `--pie-white` inverts with the scheme, which\n * is what `common.white` was standing in for.\n */\nconst MainWrapper = styled('div')(() => ({\n width: '300px',\n overflow: 'hidden',\n borderRadius: '4px',\n backgroundColor: color.white(),\n border: `2px solid ${color.border()}`,\n}));\n\nconst AnnotationsWrapper = styled('div')({\n display: 'flex',\n flexWrap: 'wrap',\n});\n\nconst ControlsWrapper = styled('div')(() => ({\n display: 'flex',\n flexWrap: 'wrap',\n borderTop: `2px solid ${color.border()}`,\n}));\n\nconst Button = styled('div')(({ variant }) => ({\n width: '22%',\n textAlign: 'center',\n padding: '4px',\n cursor: 'pointer',\n borderBottom: `1px solid ${color.border()}`,\n '&:not(:nth-child(4n))': {\n borderRight: `1px solid ${color.border()}`,\n },\n '&:nth-child(4n)': {\n flexGrow: 1,\n },\n '&:hover': {\n backgroundColor: color.backgroundDark(),\n },\n ...(variant === 'positive' && {\n backgroundColor: 'rgb(153, 255, 153) !important',\n '&:hover': {\n filter: 'brightness(85%)',\n },\n }),\n ...(variant === 'negative' && {\n backgroundColor: 'rgb(255, 204, 238) !important',\n '&:hover': {\n filter: 'brightness(85%)',\n },\n }),\n}));\n\nclass AnnotationMenu extends React.Component {\n static propTypes = {\n anchorEl: PropTypes.object,\n open: PropTypes.bool,\n annotations: PropTypes.array,\n isNewAnnotation: PropTypes.bool,\n onClose: PropTypes.func,\n onDelete: PropTypes.func,\n onEdit: PropTypes.func,\n onWrite: PropTypes.func,\n onAnnotate: PropTypes.func,\n };\n\n render() {\n const { anchorEl, annotations, isNewAnnotation, onAnnotate, onClose, onEdit, onDelete, onWrite, open } =\n this.props;\n\n return (\n <StyledPopover\n anchorEl={anchorEl}\n open={open}\n onClose={onClose}\n elevation={5}\n transitionDuration={{ enter: 225, exit: 195 }}\n anchorOrigin={{\n vertical: 'top',\n horizontal: 'center',\n }}\n transformOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n >\n <MainWrapper>\n <AnnotationsWrapper>\n {annotations.map((annotation, index) => (\n <Button\n key={`annotation-${index}`}\n variant={annotation.type}\n onClick={() => onAnnotate(annotation)}\n >\n {annotation.label}\n </Button>\n ))}\n </AnnotationsWrapper>\n <ControlsWrapper>\n <Button onClick={onClose}>\n Cancel\n </Button>\n <Button style={{ pointerEvents: 'none' }} />\n {isNewAnnotation ? (\n <React.Fragment>\n <Button variant=\"positive\" onClick={() => onWrite('positive')}>\n Write\n </Button>\n <Button variant=\"negative\" onClick={() => onWrite('negative')}>\n Write\n </Button>\n </React.Fragment>\n ) : (\n <React.Fragment>\n <Button onClick={onDelete}>\n Delete\n </Button>\n <Button onClick={onEdit}>\n Edit\n </Button>\n </React.Fragment>\n )}\n </ControlsWrapper>\n </MainWrapper>\n </StyledPopover>\n );\n }\n}\n\nexport default AnnotationMenu;\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C,OAAO,EAAC,UAAU;MAACsC,OAAO,EAAEA,CAAA,KAAMlB,OAAO,CAAC,UAAU;IAAE,GAAC,OAEvD,CACM,CAAC,gBAEjBtD,MAAA,CAAAyD,OAAA,CAAAC,aAAA,CAAC1D,MAAA,CAAAyD,OAAK,CAACkB,QAAQ,qBACb3E,MAAA,CAAAyD,OAAA,CAAAC,aAAA,CAACzB,MAAM;MAACuC,OAAO,EAAEnB;IAAS,GAAC,QAEnB,CAAC,eACTrD,MAAA,CAAAyD,OAAA,CAAAC,aAAA,CAACzB,MAAM;MAACuC,OAAO,EAAEpB;IAAO,GAAC,MAEjB,CACM,CAEH,CACN,CACA,CAAC;EAEpB;AACF;AAAC,IAAAwB,gBAAA,CAAAnB,OAAA,EA1EKd,cAAc,eACC;EACjBI,QAAQ,EAAE8B,kBAAS,CAACC,MAAM;EAC1BvB,IAAI,EAAEsB,kBAAS,CAACE,IAAI;EACpB/B,WAAW,EAAE6B,kBAAS,CAACG,KAAK;EAC5B/B,eAAe,EAAE4B,kBAAS,CAACE,IAAI;EAC/B5B,OAAO,EAAE0B,kBAAS,CAACI,IAAI;EACvB5B,QAAQ,EAAEwB,kBAAS,CAACI,IAAI;EACxB7B,MAAM,EAAEyB,kBAAS,CAACI,IAAI;EACtB3B,OAAO,EAAEuB,kBAAS,CAACI,IAAI;EACvB/B,UAAU,EAAE2B,kBAAS,CAACI;AACxB,CAAC;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAA1B,OAAA,GAiEYd,cAAc","ignoreList":[]}
|
|
@@ -10,8 +10,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _material = require("@mui/material");
|
|
12
12
|
var _styles = require("@mui/material/styles");
|
|
13
|
+
var _renderUi = require("@pie-lib/render-ui");
|
|
13
14
|
const StyledPopover = (0, _styles.styled)(_material.Popover)(({
|
|
14
|
-
theme,
|
|
15
15
|
annotationType
|
|
16
16
|
}) => ({
|
|
17
17
|
'& .MuiPaper-root': {
|
|
@@ -28,7 +28,7 @@ const StyledPopover = (0, _styles.styled)(_material.Popover)(({
|
|
|
28
28
|
width: 0,
|
|
29
29
|
pointerEvents: 'none',
|
|
30
30
|
borderWidth: '7px',
|
|
31
|
-
borderRightColor:
|
|
31
|
+
borderRightColor: _renderUi.color.border()
|
|
32
32
|
},
|
|
33
33
|
...(annotationType === 'negative' && {
|
|
34
34
|
'&::before': {
|
|
@@ -42,15 +42,17 @@ const StyledPopover = (0, _styles.styled)(_material.Popover)(({
|
|
|
42
42
|
})
|
|
43
43
|
}
|
|
44
44
|
}));
|
|
45
|
+
|
|
46
|
+
// See annotation-menu: the popover surface has to follow the scheme alongside its
|
|
47
|
+
// stroke, or a scheme's border colour lands on a permanently white card.
|
|
45
48
|
const Wrapper = (0, _styles.styled)('div')(({
|
|
46
|
-
theme,
|
|
47
49
|
annotationType
|
|
48
50
|
}) => ({
|
|
49
51
|
width: '200px',
|
|
50
52
|
overflow: 'hidden',
|
|
51
53
|
borderRadius: '4px',
|
|
52
|
-
backgroundColor:
|
|
53
|
-
border: `4px solid ${
|
|
54
|
+
backgroundColor: _renderUi.color.white(),
|
|
55
|
+
border: `4px solid ${_renderUi.color.border()}`,
|
|
54
56
|
...(annotationType === 'negative' && {
|
|
55
57
|
borderColor: 'rgb(255, 204, 238) !important'
|
|
56
58
|
}),
|
|
@@ -58,15 +60,12 @@ const Wrapper = (0, _styles.styled)('div')(({
|
|
|
58
60
|
borderColor: 'rgb(153, 255, 153) !important'
|
|
59
61
|
})
|
|
60
62
|
}));
|
|
61
|
-
const Holder = (0, _styles.styled)('div')(({
|
|
62
|
-
theme
|
|
63
|
-
}) => ({
|
|
63
|
+
const Holder = (0, _styles.styled)('div')(() => ({
|
|
64
64
|
display: 'flex',
|
|
65
65
|
flexWrap: 'wrap',
|
|
66
|
-
borderTop: `2px solid ${
|
|
66
|
+
borderTop: `2px solid ${_renderUi.color.border()}`
|
|
67
67
|
}));
|
|
68
68
|
const Button = (0, _styles.styled)('div')(({
|
|
69
|
-
theme,
|
|
70
69
|
variant,
|
|
71
70
|
annotationType
|
|
72
71
|
}) => ({
|
|
@@ -76,10 +75,10 @@ const Button = (0, _styles.styled)('div')(({
|
|
|
76
75
|
padding: '4px',
|
|
77
76
|
cursor: 'pointer',
|
|
78
77
|
'&:not(:nth-child(3n))': {
|
|
79
|
-
borderRight: `1px solid ${
|
|
78
|
+
borderRight: `1px solid ${_renderUi.color.border()}`
|
|
80
79
|
},
|
|
81
80
|
'&:hover': {
|
|
82
|
-
backgroundColor:
|
|
81
|
+
backgroundColor: _renderUi.color.backgroundDark()
|
|
83
82
|
},
|
|
84
83
|
...(variant === 'positive' && {
|
|
85
84
|
backgroundColor: 'rgb(153, 255, 153) !important',
|