@pie-element/passage 7.4.0-beta.7 → 7.4.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 CHANGED
@@ -3,66 +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
- # [7.4.0-beta.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.0-beta.6...@pie-element/passage@7.4.0-beta.7) (2026-08-20)
6
+ # [7.4.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.3.5...@pie-element/passage@7.4.0) (2026-08-21)
7
7
 
8
- **Note:** Version bump only for package @pie-element/passage
8
+ ### Bug Fixes
9
9
 
10
- # [7.4.0-beta.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.0-beta.5...@pie-element/passage@7.4.0-beta.6) (2026-08-14)
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
11
 
12
- **Note:** Version bump only for package @pie-element/passage
12
+ ### Features
13
13
 
14
- # [7.4.0-beta.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.0-beta.4...@pie-element/passage@7.4.0-beta.5) (2026-08-11)
14
+ - bump libs PIE-856, PIE-681, PIE-927 ([cb26d7a](https://github.com/pie-framework/pie-elements/commit/cb26d7afa6c99522533c321d5ff8ce3148a66e9e))
15
15
 
16
- **Note:** Version bump only for package @pie-element/passage
16
+ ## [7.3.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.3.4...@pie-element/passage@7.3.5) (2026-08-19)
17
17
 
18
- # [7.4.0-beta.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.0-beta.3...@pie-element/passage@7.4.0-beta.4) (2026-08-11)
18
+ ### Bug Fixes
19
19
 
20
- **Note:** Version bump only for package @pie-element/passage
20
+ - bump libs and shared modules PIE-681, PIE-708 ([08af8b5](https://github.com/pie-framework/pie-elements/commit/08af8b5802aecc8ee5454a1b6d60277d7ec94204))
21
+ - **passage:** let the stimulus tabs follow the theme PIE-818 ([5c499e1](https://github.com/pie-framework/pie-elements/commit/5c499e1e38e1e9e8948e0d23532f63bd316204f8)), closes [#D9](https://github.com/pie-framework/pie-elements/issues/D9)
21
22
 
22
- # [7.4.0-beta.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.0-beta.2...@pie-element/passage@7.4.0-beta.3) (2026-08-11)
23
+ ## [7.3.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.3.2...@pie-element/passage@7.3.4) (2026-08-13)
23
24
 
24
25
  **Note:** Version bump only for package @pie-element/passage
25
26
 
26
- # [7.4.0-beta.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.0-beta.1...@pie-element/passage@7.4.0-beta.2) (2026-08-11)
27
+ ## [7.3.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.3.1...@pie-element/passage@7.3.3) (2026-08-11)
27
28
 
28
29
  **Note:** Version bump only for package @pie-element/passage
29
30
 
30
- # [7.4.0-beta.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.0-beta.0...@pie-element/passage@7.4.0-beta.1) (2026-08-07)
31
+ ## [7.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.3.1...@pie-element/passage@7.3.2) (2026-07-31)
31
32
 
32
33
  **Note:** Version bump only for package @pie-element/passage
33
34
 
34
- # [7.4.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.3.0-beta.0...@pie-element/passage@7.4.0-beta.0) (2026-08-07)
35
+ ## [7.3.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.3.0...@pie-element/passage@7.3.1) (2026-07-08)
35
36
 
36
- **Note:** Version bump only for package @pie-element/passage
37
+ ### Bug Fixes
37
38
 
38
- # [7.3.0-beta.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.3.0-beta.0...@pie-element/passage@7.3.0-beta.1) (2026-08-07)
39
+ - bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
40
+ - **stimulus-tabs:** update background colors to use CSS variables for theming support PIE-746 ([5db9d79](https://github.com/pie-framework/pie-elements/commit/5db9d79be4ee14c698342047a70292154d078d80))
39
41
 
40
- **Note:** Version bump only for package @pie-element/passage
42
+ # [7.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.2.2...@pie-element/passage@7.3.0) (2026-07-02)
41
43
 
42
- # [7.3.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.2.0-beta.0...@pie-element/passage@7.3.0-beta.0) (2026-08-07)
44
+ ### Bug Fixes
43
45
 
44
- **Note:** Version bump only for package @pie-element/passage
46
+ - 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))
47
+ - sync libs versions ([48b5be9](https://github.com/pie-framework/pie-elements/commit/48b5be9559eb5b5235ca05f51c5f0161032a7041))
48
+
49
+ ### Features
45
50
 
46
- # [7.2.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.1.0...@pie-element/passage@7.2.0-beta.0) (2026-08-07)
51
+ - **passage:** implement zoom compensation and dynamic tab width in StimulusTabs component PIE-728 ([8612da7](https://github.com/pie-framework/pie-elements/commit/8612da7d15a431511d053288ad616d545c96fc1d))
52
+
53
+ ## [7.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.2.1...@pie-element/passage@7.2.2) (2026-06-22)
47
54
 
48
55
  ### Bug Fixes
49
56
 
50
- - bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
51
- - bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
52
- - 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))
53
57
  - 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))
54
- - bump shared modules and libs PIE-695, PIE-697, PIE-699, PIE-680, PIE-714, PIE-665, PIE-656 ([4b76ae7](https://github.com/pie-framework/pie-elements/commit/4b76ae75d1c5ea6d55f7c6fb53f299dfcbda2b1f))
55
- - bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
56
58
  - handle webcomponent lifecycle on every element that misses it PIE-703 ([9d5923f](https://github.com/pie-framework/pie-elements/commit/9d5923f973f0471e1e8f69ad4309cfc63d980d93))
57
- - **passage:** change active focus style PIE-598 ([155dc22](https://github.com/pie-framework/pie-elements/commit/155dc2218e6c07d55f5c7e8d556fc05689a0da52))
59
+
60
+ ## [7.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.2.0...@pie-element/passage@7.2.1) (2026-06-17)
61
+
62
+ ### Bug Fixes
63
+
64
+ - 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))
65
+
66
+ # [7.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.1.2...@pie-element/passage@7.2.0) (2026-06-12)
67
+
68
+ ### Bug Fixes
69
+
70
+ - bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
58
71
  - **passage:** set background colors for tab to white. Update colors to use pie-lib constants PIE-621 ([44d7f82](https://github.com/pie-framework/pie-elements/commit/44d7f82e229ed4a10d4aed6dbb49196cf1df0c43))
59
- - **stimulus-tabs:** update background colors to use CSS variables for theming support PIE-746 ([5db9d79](https://github.com/pie-framework/pie-elements/commit/5db9d79be4ee14c698342047a70292154d078d80))
60
- - sync libs versions ([48b5be9](https://github.com/pie-framework/pie-elements/commit/48b5be9559eb5b5235ca05f51c5f0161032a7041))
61
72
 
62
73
  ### Features
63
74
 
64
75
  - **passage:** apply sticky tabs based on viewport PIE-622 ([5ab712d](https://github.com/pie-framework/pie-elements/commit/5ab712d230b290c138ef17f235e4f82e8147b436))
65
- - **passage:** implement zoom compensation and dynamic tab width in StimulusTabs component PIE-728 ([8612da7](https://github.com/pie-framework/pie-elements/commit/8612da7d15a431511d053288ad616d545c96fc1d))
76
+
77
+ ## [7.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.1.1...@pie-element/passage@7.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))
82
+ - **passage:** change active focus style PIE-598 ([155dc22](https://github.com/pie-framework/pie-elements/commit/155dc2218e6c07d55f5c7e8d556fc05689a0da52))
83
+
84
+ ## [7.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.1.0...@pie-element/passage@7.1.1) (2026-05-21)
85
+
86
+ **Note:** Version bump only for package @pie-element/passage
66
87
 
67
88
  # [7.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.1.0-next.1...@pie-element/passage@7.1.0) (2026-05-21)
68
89
 
@@ -3,58 +3,71 @@
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
- # [5.4.0-beta.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.4.0-beta.6...@pie-element/passage-configure@5.4.0-beta.7) (2026-08-20)
6
+ # [5.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.11...@pie-element/passage-configure@5.2.0) (2026-08-21)
7
7
 
8
- **Note:** Version bump only for package @pie-element/passage-configure
8
+ ### Features
9
9
 
10
- # [5.4.0-beta.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.4.0-beta.5...@pie-element/passage-configure@5.4.0-beta.6) (2026-08-14)
10
+ - bump libs PIE-856, PIE-681, PIE-927 ([cb26d7a](https://github.com/pie-framework/pie-elements/commit/cb26d7afa6c99522533c321d5ff8ce3148a66e9e))
11
11
 
12
- **Note:** Version bump only for package @pie-element/passage-configure
12
+ ## [5.1.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.10...@pie-element/passage-configure@5.1.11) (2026-08-19)
13
13
 
14
- # [5.4.0-beta.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.4.0-beta.4...@pie-element/passage-configure@5.4.0-beta.5) (2026-08-11)
14
+ ### Bug Fixes
15
15
 
16
- **Note:** Version bump only for package @pie-element/passage-configure
16
+ - bump libs and shared modules PIE-681, PIE-708 ([08af8b5](https://github.com/pie-framework/pie-elements/commit/08af8b5802aecc8ee5454a1b6d60277d7ec94204))
17
17
 
18
- # [5.4.0-beta.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.4.0-beta.3...@pie-element/passage-configure@5.4.0-beta.4) (2026-08-11)
18
+ ## [5.1.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.8...@pie-element/passage-configure@5.1.10) (2026-08-13)
19
19
 
20
20
  **Note:** Version bump only for package @pie-element/passage-configure
21
21
 
22
- # [5.4.0-beta.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.4.0-beta.2...@pie-element/passage-configure@5.4.0-beta.3) (2026-08-11)
22
+ ## [5.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.7...@pie-element/passage-configure@5.1.9) (2026-08-11)
23
23
 
24
24
  **Note:** Version bump only for package @pie-element/passage-configure
25
25
 
26
- # [5.4.0-beta.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.4.0-beta.1...@pie-element/passage-configure@5.4.0-beta.2) (2026-08-11)
26
+ ## [5.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.7...@pie-element/passage-configure@5.1.8) (2026-07-31)
27
27
 
28
28
  **Note:** Version bump only for package @pie-element/passage-configure
29
29
 
30
- # [5.4.0-beta.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.4.0-beta.0...@pie-element/passage-configure@5.4.0-beta.1) (2026-08-07)
30
+ ## [5.1.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.6...@pie-element/passage-configure@5.1.7) (2026-07-08)
31
31
 
32
- **Note:** Version bump only for package @pie-element/passage-configure
32
+ ### Bug Fixes
33
33
 
34
- # [5.4.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.3.0-beta.0...@pie-element/passage-configure@5.4.0-beta.0) (2026-08-07)
34
+ - bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
35
35
 
36
- **Note:** Version bump only for package @pie-element/passage-configure
36
+ ## [5.1.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.5...@pie-element/passage-configure@5.1.6) (2026-07-02)
37
37
 
38
- # [5.3.0-beta.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.3.0-beta.0...@pie-element/passage-configure@5.3.0-beta.1) (2026-08-07)
38
+ ### Bug Fixes
39
39
 
40
- **Note:** Version bump only for package @pie-element/passage-configure
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))
41
+ - sync libs versions ([48b5be9](https://github.com/pie-framework/pie-elements/commit/48b5be9559eb5b5235ca05f51c5f0161032a7041))
41
42
 
42
- # [5.3.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.2.0-beta.0...@pie-element/passage-configure@5.3.0-beta.0) (2026-08-07)
43
+ ## [5.1.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.4...@pie-element/passage-configure@5.1.5) (2026-06-22)
43
44
 
44
- **Note:** Version bump only for package @pie-element/passage-configure
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))
48
+ - handle webcomponent lifecycle on every element that misses it PIE-703 ([9d5923f](https://github.com/pie-framework/pie-elements/commit/9d5923f973f0471e1e8f69ad4309cfc63d980d93))
45
49
 
46
- # [5.2.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.0...@pie-element/passage-configure@5.2.0-beta.0) (2026-08-07)
50
+ ## [5.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.3...@pie-element/passage-configure@5.1.4) (2026-06-17)
47
51
 
48
52
  ### Bug Fixes
49
53
 
50
- - bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
51
- - bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
52
54
  - 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))
53
- - 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))
54
- - bump shared modules and libs PIE-695, PIE-697, PIE-699, PIE-680, PIE-714, PIE-665, PIE-656 ([4b76ae7](https://github.com/pie-framework/pie-elements/commit/4b76ae75d1c5ea6d55f7c6fb53f299dfcbda2b1f))
55
+
56
+ ## [5.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.2...@pie-element/passage-configure@5.1.3) (2026-06-12)
57
+
58
+ ### Bug Fixes
59
+
55
60
  - bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
56
- - handle webcomponent lifecycle on every element that misses it PIE-703 ([9d5923f](https://github.com/pie-framework/pie-elements/commit/9d5923f973f0471e1e8f69ad4309cfc63d980d93))
57
- - sync libs versions ([48b5be9](https://github.com/pie-framework/pie-elements/commit/48b5be9559eb5b5235ca05f51c5f0161032a7041))
61
+
62
+ ## [5.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.1...@pie-element/passage-configure@5.1.2) (2026-06-04)
63
+
64
+ ### Bug Fixes
65
+
66
+ - bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
67
+
68
+ ## [5.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.0...@pie-element/passage-configure@5.1.1) (2026-05-21)
69
+
70
+ **Note:** Version bump only for package @pie-element/passage-configure
58
71
 
59
72
  # [5.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.0-next.1...@pie-element/passage-configure@5.1.0) (2026-05-21)
60
73
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/passage-configure",
3
3
  "private": true,
4
- "version": "5.4.0-beta.7",
4
+ "version": "5.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.1.0-beta.4",
17
- "@pie-lib/editable-html-tip-tap": "2.2.0-beta.4",
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",
@@ -3,47 +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
- # [4.3.0-beta.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.6...@pie-element/passage-controller@4.3.0-beta.7) (2026-08-20)
6
+ ## [4.0.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.0.3...@pie-element/passage-controller@4.0.5) (2026-08-13)
7
7
 
8
8
  **Note:** Version bump only for package @pie-element/passage-controller
9
9
 
10
- # [4.3.0-beta.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.5...@pie-element/passage-controller@4.3.0-beta.6) (2026-08-14)
10
+ ## [4.0.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.0.3...@pie-element/passage-controller@4.0.4) (2026-08-11)
11
11
 
12
12
  **Note:** Version bump only for package @pie-element/passage-controller
13
13
 
14
- # [4.3.0-beta.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.4...@pie-element/passage-controller@4.3.0-beta.5) (2026-08-11)
15
-
16
- **Note:** Version bump only for package @pie-element/passage-controller
17
-
18
- # [4.3.0-beta.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.3...@pie-element/passage-controller@4.3.0-beta.4) (2026-08-11)
19
-
20
- **Note:** Version bump only for package @pie-element/passage-controller
21
-
22
- # [4.3.0-beta.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.2...@pie-element/passage-controller@4.3.0-beta.3) (2026-08-11)
23
-
24
- **Note:** Version bump only for package @pie-element/passage-controller
25
-
26
- # [4.3.0-beta.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.1...@pie-element/passage-controller@4.3.0-beta.2) (2026-08-11)
27
-
28
- **Note:** Version bump only for package @pie-element/passage-controller
29
-
30
- # [4.3.0-beta.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.0...@pie-element/passage-controller@4.3.0-beta.1) (2026-08-07)
31
-
32
- **Note:** Version bump only for package @pie-element/passage-controller
33
-
34
- # [4.3.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.2.0-beta.0...@pie-element/passage-controller@4.3.0-beta.0) (2026-08-07)
35
-
36
- **Note:** Version bump only for package @pie-element/passage-controller
37
-
38
- # [4.2.0-beta.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.2.0-beta.0...@pie-element/passage-controller@4.2.0-beta.1) (2026-08-07)
39
-
40
- **Note:** Version bump only for package @pie-element/passage-controller
41
-
42
- # [4.2.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.1.0-beta.0...@pie-element/passage-controller@4.2.0-beta.0) (2026-08-07)
43
-
44
- **Note:** Version bump only for package @pie-element/passage-controller
45
-
46
- # [4.1.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.0.2...@pie-element/passage-controller@4.1.0-beta.0) (2026-08-07)
14
+ ## [4.0.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.0.2...@pie-element/passage-controller@4.0.3) (2026-05-21)
47
15
 
48
16
  **Note:** Version bump only for package @pie-element/passage-controller
49
17
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/passage-controller",
3
3
  "private": true,
4
- "version": "4.3.0-beta.7",
4
+ "version": "4.0.5",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -83,14 +83,26 @@ const PassageAuthor = (0, _styles.styled)('div')({
83
83
  const TabStyled = (0, _styles.styled)(_Tab.default)(({
84
84
  theme
85
85
  }) => ({
86
- background: theme.palette.common.white,
87
- // replace with color.background() once PD-2801 is DONE
86
+ /*
87
+ * The tab carries the colour of the panel it opens, which is what makes it read as a
88
+ * tab rather than a button, and it has to be the themed panel colour: MUI's palette
89
+ * does not follow `--pie-*`, so `common.white` here left the tab white on every color
90
+ * scheme while the passage body beneath it went dark. The comment this replaces gated
91
+ * the change on PD-2801, which is about OT's `color-contrast` class -- the mechanism
92
+ * pie-theme superseded, and blocked since 2023.
93
+ */
94
+ background: _renderUi.color.background(),
88
95
  fontSize: 'inherit',
89
96
  fontFamily: 'Roboto, sans-serif',
90
- color: theme.palette.common.black,
91
- // remove when PD-2801 is DONE
97
+ color: _renderUi.color.text(),
92
98
  borderRadius: `${theme.spacing(2)} ${theme.spacing(2)} 0 0`,
93
- border: '1px solid #D9DADA',
99
+ /*
100
+ * `--pie-border-gray` is stepped to the 3:1 non-text minimum in every scheme. The
101
+ * literal it replaces measured about 1.2:1 against the dark schemes' surfaces, so the
102
+ * tab outline -- the only thing separating an unselected tab from the strip -- was
103
+ * invisible there.
104
+ */
105
+ border: `1px solid ${_renderUi.color.borderGray()}`,
94
106
  borderBottomWidth: 0,
95
107
  minHeight: '56px',
96
108
  padding: '8px 10px',
@@ -110,7 +122,7 @@ const TabStyled = (0, _styles.styled)(_Tab.default)(({
110
122
  opacity: 0.7
111
123
  },
112
124
  '&.Mui-selected': {
113
- color: theme.palette.common.black,
125
+ color: _renderUi.color.text(),
114
126
  '.passage-label': {
115
127
  opacity: 1
116
128
  },
@@ -127,13 +139,17 @@ const TabStyled = (0, _styles.styled)(_Tab.default)(({
127
139
  opacity: 0.7
128
140
  }
129
141
  }));
130
- const Underline = (0, _styles.styled)('div')(({
131
- theme
132
- }) => ({
142
+
143
+ /*
144
+ * The selection indicator, one per tab. Unselected it has to disappear into the tab, so it
145
+ * paints the tab's own background rather than a fixed white; selected it becomes
146
+ * `--pie-tertiary`, which every scheme sets.
147
+ */
148
+ const Underline = (0, _styles.styled)('div')(() => ({
133
149
  height: '2px',
134
150
  width: '100%',
135
151
  marginTop: '6px',
136
- background: theme.palette.common.white // replace with color.background() once PD-2801 is DONE
152
+ background: _renderUi.color.background()
137
153
  }));
138
154
  class StimulusTabs extends _react.default.Component {
139
155
  constructor(...args) {
@@ -373,8 +389,16 @@ class StimulusTabs extends _react.default.Component {
373
389
  // so the reclaimed space flows to the passage content below.
374
390
  zoom: zoomCompensation,
375
391
  '& .MuiTabs-list': {
376
- backgroundColor: 'var(--pie-passage-header-background, #ffffff)',
377
- borderBottom: '1px solid #D9DADA'
392
+ /*
393
+ * The strip behind the tabs. A host that has opted into
394
+ * `--pie-passage-header-background` keeps its own colour on every
395
+ * scheme -- Knowledge Checks' pale green-blue is deliberate and is not
396
+ * a scheme's business to override. With no host colour the fallback has
397
+ * to be a theme token rather than a white literal, or the strip stays
398
+ * white over a dark passage body.
399
+ */
400
+ backgroundColor: `var(--pie-passage-header-background, ${_renderUi.color.backgroundDark()})`,
401
+ borderBottom: `1px solid ${_renderUi.color.borderGray()}`
378
402
  },
379
403
  '& .MuiTabs-indicator': {
380
404
  backgroundColor: _renderUi.color.white(),
@@ -1 +1 @@
1
- {"version":3,"file":"stimulus-tabs.js","names":["_react","_interopRequireDefault","require","_propTypes","_Tabs","_Tab","_styles","_renderUi","STICKY_TABS_BREAKPOINT","MAX_TABS_ZOOM","MIN_ZOOM_COMPENSATION","NUMERIC_LABEL_MIN_WIDTH_PER_TAB","computeZoomCompensation","window","ratio","outerWidth","innerWidth","zoom","Number","isFinite","Math","max","min","PassagesContainer","styled","flexGrow","backgroundColor","color","background","text","borderCollapse","padding","textAlign","Passage","theme","spacing","borderLeft","margin","PassageTitle","fontSize","PassageSubtitle","PassageAuthor","TabStyled","Tab","palette","common","white","fontFamily","black","borderRadius","border","borderBottomWidth","minHeight","display","alignItems","justifyContent","textTransform","WebkitLineClamp","WebkitBoxOrient","overflow","textOverflow","whiteSpace","opacity","tertiary","tertiaryLight","Underline","height","width","marginTop","StimulusTabs","React","Component","constructor","args","_defineProperty2","default","activeTab","zoomCompensation","containerWidth","createRef","setState","node","containerRef","current","clientWidth","state","event","setTimeout","tabChangeEvent","CustomEvent","detail","tab","dispatchEvent","currentTabId","key","tabs","props","newTabIndex","currentIndex","findIndex","id","length","preventDefault","stopPropagation","handleChange","document","getElementById","focus","div","createElement","innerHTML","replace","audio","querySelector","source","setAttribute","getAttribute","removeAttribute","appendChild","componentDidMount","addEventListener","updateZoomCompensation","ResizeObserver","resizeObserver","updateContainerWidth","observe","componentWillUnmount","removeEventListener","disconnect","renderInstructions","teacherInstructions","disabledTabs","teacherInstructionsDiv","PreviewPrompt","tagName","className","defaultClassName","prompt","Collapsible","labels","hidden","visible","renderTab","baseHeadingLevel","clampedLevel","undefined","TitleTag","textLevel","role","title","Purpose","purpose","dangerouslySetInnerHTML","__html","parsedText","subtitle","author","transformDataHeadings","render","model","extraCSSRules","selectedTab","find","tabMaxWidth","useNumericLabels","UiLayout","ref","map","Fragment","sx","position","top","zIndex","borderBottom","marginBottom","value","onChange","index","maxWidth","label","tabIndex","onKeyDown","handleKeyDown","propTypes","PropTypes","arrayOf","shape","number","isRequired","string","bool","object","_default","exports"],"sources":["../src/stimulus-tabs.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Tabs from '@mui/material/Tabs';\nimport Tab from '@mui/material/Tab';\nimport { styled } from '@mui/material/styles';\nimport { Collapsible, color, PreviewPrompt, Purpose, UiLayout, transformDataHeadings } from '@pie-lib/render-ui';\n\n// Must match the breakpoint Quiz Engine passes to the PIE section player for\n// switching from the side-by-side passage/question layout to the tabbed layout.\n// Below (and at) this width the passage tabs scroll with the passage content\n// instead of being locked to the top of the panel, so that they do not lock up\n// space needed for the passage text (WCAG 1.4.10 Reflow, 400% zoom / 320px).\nconst STICKY_TABS_BREAKPOINT = 840;\n\n/**\n * Zoom compensation for the passage selection tabs.\n *\n * The tabs scale naturally with browser zoom up to 200%. Beyond 200%,\n * we shrink their CSS size proportionally so their physical on-screen size\n * freezes at the 200% appearance, leaving more room for passage content\n * in high-zoom / small-window situations.\n * The factor is min(1, 2 / zoom): exactly 1 at zoom <= 200% (component\n * behavior unchanged), shrinking proportionally above that. A lower clamp\n * of 0.4 guards against inflated ratios (docked devtools, browser side\n * panels, window chrome) ever making the tabs unusably small.\n */\nconst MAX_TABS_ZOOM = 2;\nconst MIN_ZOOM_COMPENSATION = 0.4;\n\n// Per-tab horizontal-space floor in CSS pixels. When the passage container is\n// narrow enough that each tab would have at most this much room\n// (containerWidth <= tabs.length * NUMERIC_LABEL_MIN_WIDTH_PER_TAB), tab labels\n// fall back to \"Passage 1\", \"Passage 2\", ... so navigation stays usable instead\n// of being dominated by aggressively truncated titles.\nconst NUMERIC_LABEL_MIN_WIDTH_PER_TAB = 170;\n\nconst computeZoomCompensation = () => {\n if (typeof window === 'undefined') return 1;\n const ratio = window.outerWidth / window.innerWidth;\n const zoom = Number.isFinite(ratio) && ratio > 0 ? ratio : 1;\n return Math.max(MIN_ZOOM_COMPENSATION, Math.min(1, MAX_TABS_ZOOM / zoom));\n};\n\nconst PassagesContainer = styled('div')({\n flexGrow: 1,\n backgroundColor: color.background(),\n color: color.text(),\n '&:not(.MathJax) table': {\n borderCollapse: 'collapse',\n },\n '&:not(.MathJax) table td, &:not(.MathJax) table th': {\n padding: '.6em 1em',\n textAlign: 'left',\n },\n});\n\nconst Passage = styled('div')(({ theme }) => ({\n backgroundColor: color.background(),\n color: color.text(),\n padding: theme.spacing(2),\n '& blockquote': {\n background: '#f9f9f9',\n borderLeft: '5px solid #ccc',\n margin: '1.5em 10px',\n padding: '.5em 10px',\n },\n}));\n\nconst PassageTitle = styled('div')({\n fontSize: '1.75rem',\n});\n\nconst PassageSubtitle = styled('div')({\n fontSize: '1.5rem',\n});\n\nconst PassageAuthor = styled('div')({\n fontSize: '1.25rem',\n});\n\nconst TabStyled = styled(Tab)(({ theme }) => ({\n background: theme.palette.common.white, // replace with color.background() once PD-2801 is DONE\n fontSize: 'inherit',\n fontFamily: 'Roboto, sans-serif',\n color: theme.palette.common.black, // remove when PD-2801 is DONE\n borderRadius: `${theme.spacing(2)} ${theme.spacing(2)} 0 0`,\n border: '1px solid #D9DADA',\n borderBottomWidth: 0,\n minHeight: '56px',\n padding: '8px 10px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n margin: `0 ${theme.spacing(1)}`,\n textTransform: 'none',\n\n '.passage-label': {\n display: '-webkit-box',\n WebkitLineClamp: 2,\n WebkitBoxOrient: 'vertical',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'normal',\n margin: 'auto 0',\n opacity: 0.7,\n },\n\n '&.Mui-selected': {\n color: theme.palette.common.black,\n '.passage-label': {\n opacity: 1,\n },\n '.passage-label-underline': {\n backgroundColor: color.tertiary(),\n },\n },\n\n '&:hover': {\n '.passage-label-underline': {\n backgroundColor: color.tertiaryLight(),\n },\n },\n\n '& .MuiTouchRipple-root': {\n opacity: 0.7,\n },\n}));\n\nconst Underline = styled('div')(({ theme }) => ({\n height: '2px',\n width: '100%',\n marginTop: '6px',\n background: theme.palette.common.white, // replace with color.background() once PD-2801 is DONE\n}));\n\nclass StimulusTabs extends React.Component {\n state = {\n activeTab: 0,\n zoomCompensation: computeZoomCompensation(),\n containerWidth: 0,\n };\n\n containerRef = React.createRef();\n\n componentDidMount() {\n if (typeof window === 'undefined') return;\n window.addEventListener('resize', this.updateZoomCompensation);\n\n if (this.containerRef.current && typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(this.updateContainerWidth);\n this.resizeObserver.observe(this.containerRef.current);\n }\n\n this.updateContainerWidth();\n }\n\n componentWillUnmount() {\n if (typeof window === 'undefined') return;\n window.removeEventListener('resize', this.updateZoomCompensation);\n\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n }\n\n updateZoomCompensation = () => {\n this.setState({ zoomCompensation: computeZoomCompensation() });\n };\n\n updateContainerWidth = () => {\n const node = this.containerRef.current;\n if (!node) return;\n const width = node.clientWidth;\n if (width !== this.state.containerWidth) {\n this.setState({ containerWidth: width });\n }\n };\n\n handleChange = (event, activeTab) => {\n this.setState(() => ({ activeTab }));\n\n setTimeout(() => {\n const tabChangeEvent = new CustomEvent('pie-ui-passage-tabChanged', {\n detail: { tab: activeTab },\n });\n\n window.dispatchEvent(tabChangeEvent);\n });\n };\n\n handleKeyDown = (event, currentTabId) => {\n const { key } = event;\n const { tabs } = this.props;\n\n let newTabIndex = -1;\n const currentIndex = tabs.findIndex((tab) => tab.id === currentTabId);\n\n switch (key) {\n case 'ArrowRight':\n // Move to the next tab\n newTabIndex = (currentIndex + 1) % tabs.length;\n break;\n case 'ArrowLeft':\n // Move to the previous tab\n newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n break;\n // Commented out ArrowDown and ArrowUp for future vertical tab navigation\n // case 'ArrowDown':\n // // Move to the next tab (for vertical alignment)\n // newTabIndex = (currentIndex + 1) % tabs.length;\n // break;\n // case 'ArrowUp':\n // // Move to the previous tab (for vertical alignment)\n // newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n // break;\n case 'Home':\n // Move to the first tab\n newTabIndex = 0;\n break;\n case 'End':\n // Move to the last tab\n newTabIndex = tabs.length - 1;\n break;\n case 'Enter':\n case ' ':\n // Activate the current tab\n newTabIndex = currentIndex;\n break;\n default:\n break;\n }\n\n if (newTabIndex !== -1) {\n event.preventDefault();\n event.stopPropagation();\n this.handleChange(event, tabs[newTabIndex].id);\n document.getElementById(`button-${tabs[newTabIndex].id}`).focus();\n }\n };\n\n parsedText = (text = '') => {\n // fix imported audio content for Safari PD-1391\n const div = document.createElement('div');\n div.innerHTML = text.replace(/(<br\\/>\\n)/g, '<br/>');\n\n const audio = div.querySelector('audio');\n\n if (audio) {\n const source = document.createElement('source');\n\n source.setAttribute('type', 'audio/mp3');\n source.setAttribute('src', audio.getAttribute('src'));\n\n audio.removeAttribute('src');\n audio.appendChild(source);\n }\n\n return div.innerHTML;\n };\n\n renderInstructions(teacherInstructions, disabledTabs = false) {\n if (!teacherInstructions) {\n return;\n }\n\n const teacherInstructionsDiv = (\n <PreviewPrompt\n tagName=\"div\"\n className=\"prompt\"\n defaultClassName=\"teacher-instructions\"\n prompt={teacherInstructions}\n />\n );\n\n if (disabledTabs) {\n return teacherInstructionsDiv;\n }\n\n return (\n <Collapsible\n labels={{\n hidden: 'Show Teacher Instructions',\n visible: 'Hide Teacher Instructions',\n }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n );\n }\n\n renderTab(tab, disabledTabs) {\n const { baseHeadingLevel } = this.props;\n const clampedLevel = baseHeadingLevel ? Math.min(6, Math.max(1, baseHeadingLevel)) : undefined;\n const TitleTag = baseHeadingLevel ? `h${clampedLevel}` : 'h2'; // default to h2 if no base level is provided - this was the previous behavior\n const textLevel = baseHeadingLevel ? Math.min(6, Math.max(1, clampedLevel + 1)) : undefined; // promote text headings one level above title\n\n return (\n <Passage key={tab.id} id={`tabpanel-${tab.id}`} role=\"tabpanel\" aria-labelledby={`button-${tab.id}`}>\n {this.renderInstructions(tab.teacherInstructions, disabledTabs)}\n\n {tab.title && (\n <Purpose purpose=\"passage-title\">\n <TitleTag>\n <PassageTitle dangerouslySetInnerHTML={{ __html: this.parsedText(tab.title) }} />\n </TitleTag>\n </Purpose>\n )}\n\n {tab.subtitle && (\n <Purpose purpose=\"passage-subtitle\">\n <PassageSubtitle dangerouslySetInnerHTML={{ __html: this.parsedText(tab.subtitle) }} />\n </Purpose>\n )}\n\n {tab.author && (\n <Purpose purpose=\"passage-author\">\n <PassageAuthor className=\"author\" dangerouslySetInnerHTML={{ __html: this.parsedText(tab.author) }} />\n </Purpose>\n )}\n\n {tab.text && (\n <Purpose purpose=\"passage-text\">\n <div key={tab.id} className=\"text\" dangerouslySetInnerHTML={{ __html: baseHeadingLevel ? transformDataHeadings(tab.text, textLevel) : tab.text }} />\n </Purpose>\n )}\n </Passage>\n );\n }\n\n render() {\n const { model, tabs, disabledTabs } = this.props;\n const { activeTab, zoomCompensation, containerWidth } = this.state;\n\n if (!tabs?.length) {\n return;\n }\n\n const { extraCSSRules } = model || {};\n const selectedTab = (tabs || []).find((tab) => tab.id === activeTab);\n\n // cap each tab at 1/n of the passage container width so a single long\n // title can't push other tabs off-screen. Existing two-line wrap + ellipsis\n // on .passage-label still trims anything that doesn't fit.\n const tabMaxWidth = containerWidth > 0 ? containerWidth / tabs.length : null;\n // When per-tab horizontal space drops to NUMERIC_LABEL_MIN_WIDTH_PER_TAB or\n // less, titles become unreadably truncated; swap to \"Passage N\" so users\n // can still navigate. Container width is read once layout has settled\n // (>0), so initial render uses real labels.\n const useNumericLabels =\n containerWidth > 0 && containerWidth <= tabs.length * NUMERIC_LABEL_MIN_WIDTH_PER_TAB;\n\n return (\n <UiLayout extraCSSRules={extraCSSRules}>\n <PassagesContainer className=\"passages\" ref={this.containerRef}>\n {disabledTabs || tabs.length === 1 ? (\n tabs.map((tab) => this.renderTab(tab, disabledTabs))\n ) : (\n <>\n <Tabs\n sx={{\n // Below the breakpoint (e.g. WCAG 400% zoom, ~320px viewport)\n // the tabs are in normal flow and scroll with the passage text,\n // so they don't lock up space needed to display the passage.\n position: 'static',\n // Above the breakpoint there is adequate screen space, so the\n // tabs stay locked to the top of the panel while the passage\n // text scrolls beneath them.\n [`@media (min-width: ${STICKY_TABS_BREAKPOINT + 1}px)`]: {\n position: 'sticky',\n top: 0,\n zIndex: 1,\n },\n background: 'var(--pie-passage-header-background, rgba(255,255,255,0))',\n color: color.text(),\n fontFamily: 'Roboto, sans-serif',\n // Freeze the tabs' physical size at their 200%-zoom appearance\n // when browser zoom exceeds 200%. The factor is 1 at zoom <= 200%,\n // so behavior below that threshold is unchanged. Using `zoom`\n // (rather than transform: scale) shrinks the layout box itself,\n // so the reclaimed space flows to the passage content below.\n zoom: zoomCompensation,\n '& .MuiTabs-list': {\n backgroundColor: 'var(--pie-passage-header-background, #ffffff)',\n borderBottom: '1px solid #D9DADA',\n },\n '& .MuiTabs-indicator': {\n backgroundColor: color.white(),\n marginBottom: '-1px',\n },\n }}\n value={activeTab}\n onChange={this.handleChange}\n >\n {tabs.map((tab, index) => (\n <TabStyled\n key={tab.id}\n id={`button-${tab.id}`}\n sx={tabMaxWidth ? { maxWidth: `${tabMaxWidth}px` } : undefined}\n label={\n <>\n <Purpose purpose=\"passage-label\">\n {useNumericLabels ? (\n <span className=\"passage-label\">{`Passage ${index + 1}`}</span>\n ) : (\n <span\n className=\"passage-label\"\n dangerouslySetInnerHTML={{ __html: this.parsedText(tab.label) }}\n />\n )}\n </Purpose>\n <Underline className=\"passage-label-underline\" />\n </>\n }\n value={tab.id}\n tabIndex={activeTab === tab.id ? 0 : -1}\n aria-controls={`tabpanel-${tab.id}`}\n aria-selected={activeTab === tab.id}\n onKeyDown={(event) => this.handleKeyDown(event, tab.id)}\n />\n ))}\n </Tabs>\n {selectedTab ? this.renderTab(selectedTab, disabledTabs) : null}\n </>\n )}\n </PassagesContainer>\n </UiLayout>\n );\n }\n}\n\nStimulusTabs.propTypes = {\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.number.isRequired,\n label: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string,\n author: PropTypes.string,\n text: PropTypes.string.isRequired,\n teacherInstructions: PropTypes.string,\n }).isRequired,\n ).isRequired,\n disabledTabs: PropTypes.bool,\n model: PropTypes.object,\n baseHeadingLevel: PropTypes.number,\n};\n\nexport default StimulusTabs;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,IAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMM,sBAAsB,GAAG,GAAG;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,qBAAqB,GAAG,GAAG;;AAEjC;AACA;AACA;AACA;AACA;AACA,MAAMC,+BAA+B,GAAG,GAAG;AAE3C,MAAMC,uBAAuB,GAAGA,CAAA,KAAM;EACpC,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE,OAAO,CAAC;EAC3C,MAAMC,KAAK,GAAGD,MAAM,CAACE,UAAU,GAAGF,MAAM,CAACG,UAAU;EACnD,MAAMC,IAAI,GAAGC,MAAM,CAACC,QAAQ,CAACL,KAAK,CAAC,IAAIA,KAAK,GAAG,CAAC,GAAGA,KAAK,GAAG,CAAC;EAC5D,OAAOM,IAAI,CAACC,GAAG,CAACX,qBAAqB,EAAEU,IAAI,CAACE,GAAG,CAAC,CAAC,EAAEb,aAAa,GAAGQ,IAAI,C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IAC3D,CAEa,CACX,CAAC;EAEf;AACF;AAEA9D,YAAY,CAACkH,SAAS,GAAG;EACvBxF,IAAI,EAAEyF,kBAAS,CAACC,OAAO,CACrBD,kBAAS,CAACE,KAAK,CAAC;IACdtF,EAAE,EAAEoF,kBAAS,CAACG,MAAM,CAACC,UAAU;IAC/BT,KAAK,EAAEK,kBAAS,CAACK,MAAM,CAACD,UAAU;IAClCvC,KAAK,EAAEmC,kBAAS,CAACK,MAAM,CAACD,UAAU;IAClCjC,QAAQ,EAAE6B,kBAAS,CAACK,MAAM;IAC1BjC,MAAM,EAAE4B,kBAAS,CAACK,MAAM;IACxBhK,IAAI,EAAE2J,kBAAS,CAACK,MAAM,CAACD,UAAU;IACjC1D,mBAAmB,EAAEsD,kBAAS,CAACK;EACjC,CAAC,CAAC,CAACD,UACL,CAAC,CAACA,UAAU;EACZzD,YAAY,EAAEqD,kBAAS,CAACM,IAAI;EAC5B/B,KAAK,EAAEyB,kBAAS,CAACO,MAAM;EACvBhD,gBAAgB,EAAEyC,kBAAS,CAACG;AAC9B,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAtH,OAAA,GAEaN,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"stimulus-tabs.js","names":["_react","_interopRequireDefault","require","_propTypes","_Tabs","_Tab","_styles","_renderUi","STICKY_TABS_BREAKPOINT","MAX_TABS_ZOOM","MIN_ZOOM_COMPENSATION","NUMERIC_LABEL_MIN_WIDTH_PER_TAB","computeZoomCompensation","window","ratio","outerWidth","innerWidth","zoom","Number","isFinite","Math","max","min","PassagesContainer","styled","flexGrow","backgroundColor","color","background","text","borderCollapse","padding","textAlign","Passage","theme","spacing","borderLeft","margin","PassageTitle","fontSize","PassageSubtitle","PassageAuthor","TabStyled","Tab","fontFamily","borderRadius","border","borderGray","borderBottomWidth","minHeight","display","alignItems","justifyContent","textTransform","WebkitLineClamp","WebkitBoxOrient","overflow","textOverflow","whiteSpace","opacity","tertiary","tertiaryLight","Underline","height","width","marginTop","StimulusTabs","React","Component","constructor","args","_defineProperty2","default","activeTab","zoomCompensation","containerWidth","createRef","setState","node","containerRef","current","clientWidth","state","event","setTimeout","tabChangeEvent","CustomEvent","detail","tab","dispatchEvent","currentTabId","key","tabs","props","newTabIndex","currentIndex","findIndex","id","length","preventDefault","stopPropagation","handleChange","document","getElementById","focus","div","createElement","innerHTML","replace","audio","querySelector","source","setAttribute","getAttribute","removeAttribute","appendChild","componentDidMount","addEventListener","updateZoomCompensation","ResizeObserver","resizeObserver","updateContainerWidth","observe","componentWillUnmount","removeEventListener","disconnect","renderInstructions","teacherInstructions","disabledTabs","teacherInstructionsDiv","PreviewPrompt","tagName","className","defaultClassName","prompt","Collapsible","labels","hidden","visible","renderTab","baseHeadingLevel","clampedLevel","undefined","TitleTag","textLevel","role","title","Purpose","purpose","dangerouslySetInnerHTML","__html","parsedText","subtitle","author","transformDataHeadings","render","model","extraCSSRules","selectedTab","find","tabMaxWidth","useNumericLabels","UiLayout","ref","map","Fragment","sx","position","top","zIndex","backgroundDark","borderBottom","white","marginBottom","value","onChange","index","maxWidth","label","tabIndex","onKeyDown","handleKeyDown","propTypes","PropTypes","arrayOf","shape","number","isRequired","string","bool","object","_default","exports"],"sources":["../src/stimulus-tabs.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Tabs from '@mui/material/Tabs';\nimport Tab from '@mui/material/Tab';\nimport { styled } from '@mui/material/styles';\nimport { Collapsible, color, PreviewPrompt, Purpose, UiLayout, transformDataHeadings } from '@pie-lib/render-ui';\n\n// Must match the breakpoint Quiz Engine passes to the PIE section player for\n// switching from the side-by-side passage/question layout to the tabbed layout.\n// Below (and at) this width the passage tabs scroll with the passage content\n// instead of being locked to the top of the panel, so that they do not lock up\n// space needed for the passage text (WCAG 1.4.10 Reflow, 400% zoom / 320px).\nconst STICKY_TABS_BREAKPOINT = 840;\n\n/**\n * Zoom compensation for the passage selection tabs.\n *\n * The tabs scale naturally with browser zoom up to 200%. Beyond 200%,\n * we shrink their CSS size proportionally so their physical on-screen size\n * freezes at the 200% appearance, leaving more room for passage content\n * in high-zoom / small-window situations.\n * The factor is min(1, 2 / zoom): exactly 1 at zoom <= 200% (component\n * behavior unchanged), shrinking proportionally above that. A lower clamp\n * of 0.4 guards against inflated ratios (docked devtools, browser side\n * panels, window chrome) ever making the tabs unusably small.\n */\nconst MAX_TABS_ZOOM = 2;\nconst MIN_ZOOM_COMPENSATION = 0.4;\n\n// Per-tab horizontal-space floor in CSS pixels. When the passage container is\n// narrow enough that each tab would have at most this much room\n// (containerWidth <= tabs.length * NUMERIC_LABEL_MIN_WIDTH_PER_TAB), tab labels\n// fall back to \"Passage 1\", \"Passage 2\", ... so navigation stays usable instead\n// of being dominated by aggressively truncated titles.\nconst NUMERIC_LABEL_MIN_WIDTH_PER_TAB = 170;\n\nconst computeZoomCompensation = () => {\n if (typeof window === 'undefined') return 1;\n const ratio = window.outerWidth / window.innerWidth;\n const zoom = Number.isFinite(ratio) && ratio > 0 ? ratio : 1;\n return Math.max(MIN_ZOOM_COMPENSATION, Math.min(1, MAX_TABS_ZOOM / zoom));\n};\n\nconst PassagesContainer = styled('div')({\n flexGrow: 1,\n backgroundColor: color.background(),\n color: color.text(),\n '&:not(.MathJax) table': {\n borderCollapse: 'collapse',\n },\n '&:not(.MathJax) table td, &:not(.MathJax) table th': {\n padding: '.6em 1em',\n textAlign: 'left',\n },\n});\n\nconst Passage = styled('div')(({ theme }) => ({\n backgroundColor: color.background(),\n color: color.text(),\n padding: theme.spacing(2),\n '& blockquote': {\n background: '#f9f9f9',\n borderLeft: '5px solid #ccc',\n margin: '1.5em 10px',\n padding: '.5em 10px',\n },\n}));\n\nconst PassageTitle = styled('div')({\n fontSize: '1.75rem',\n});\n\nconst PassageSubtitle = styled('div')({\n fontSize: '1.5rem',\n});\n\nconst PassageAuthor = styled('div')({\n fontSize: '1.25rem',\n});\n\nconst TabStyled = styled(Tab)(({ theme }) => ({\n /*\n * The tab carries the colour of the panel it opens, which is what makes it read as a\n * tab rather than a button, and it has to be the themed panel colour: MUI's palette\n * does not follow `--pie-*`, so `common.white` here left the tab white on every color\n * scheme while the passage body beneath it went dark. The comment this replaces gated\n * the change on PD-2801, which is about OT's `color-contrast` class -- the mechanism\n * pie-theme superseded, and blocked since 2023.\n */\n background: color.background(),\n fontSize: 'inherit',\n fontFamily: 'Roboto, sans-serif',\n color: color.text(),\n borderRadius: `${theme.spacing(2)} ${theme.spacing(2)} 0 0`,\n /*\n * `--pie-border-gray` is stepped to the 3:1 non-text minimum in every scheme. The\n * literal it replaces measured about 1.2:1 against the dark schemes' surfaces, so the\n * tab outline -- the only thing separating an unselected tab from the strip -- was\n * invisible there.\n */\n border: `1px solid ${color.borderGray()}`,\n borderBottomWidth: 0,\n minHeight: '56px',\n padding: '8px 10px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n margin: `0 ${theme.spacing(1)}`,\n textTransform: 'none',\n\n '.passage-label': {\n display: '-webkit-box',\n WebkitLineClamp: 2,\n WebkitBoxOrient: 'vertical',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'normal',\n margin: 'auto 0',\n opacity: 0.7,\n },\n\n '&.Mui-selected': {\n color: color.text(),\n '.passage-label': {\n opacity: 1,\n },\n '.passage-label-underline': {\n backgroundColor: color.tertiary(),\n },\n },\n\n '&:hover': {\n '.passage-label-underline': {\n backgroundColor: color.tertiaryLight(),\n },\n },\n\n '& .MuiTouchRipple-root': {\n opacity: 0.7,\n },\n}));\n\n/*\n * The selection indicator, one per tab. Unselected it has to disappear into the tab, so it\n * paints the tab's own background rather than a fixed white; selected it becomes\n * `--pie-tertiary`, which every scheme sets.\n */\nconst Underline = styled('div')(() => ({\n height: '2px',\n width: '100%',\n marginTop: '6px',\n background: color.background(),\n}));\n\nclass StimulusTabs extends React.Component {\n state = {\n activeTab: 0,\n zoomCompensation: computeZoomCompensation(),\n containerWidth: 0,\n };\n\n containerRef = React.createRef();\n\n componentDidMount() {\n if (typeof window === 'undefined') return;\n window.addEventListener('resize', this.updateZoomCompensation);\n\n if (this.containerRef.current && typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(this.updateContainerWidth);\n this.resizeObserver.observe(this.containerRef.current);\n }\n\n this.updateContainerWidth();\n }\n\n componentWillUnmount() {\n if (typeof window === 'undefined') return;\n window.removeEventListener('resize', this.updateZoomCompensation);\n\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n }\n\n updateZoomCompensation = () => {\n this.setState({ zoomCompensation: computeZoomCompensation() });\n };\n\n updateContainerWidth = () => {\n const node = this.containerRef.current;\n if (!node) return;\n const width = node.clientWidth;\n if (width !== this.state.containerWidth) {\n this.setState({ containerWidth: width });\n }\n };\n\n handleChange = (event, activeTab) => {\n this.setState(() => ({ activeTab }));\n\n setTimeout(() => {\n const tabChangeEvent = new CustomEvent('pie-ui-passage-tabChanged', {\n detail: { tab: activeTab },\n });\n\n window.dispatchEvent(tabChangeEvent);\n });\n };\n\n handleKeyDown = (event, currentTabId) => {\n const { key } = event;\n const { tabs } = this.props;\n\n let newTabIndex = -1;\n const currentIndex = tabs.findIndex((tab) => tab.id === currentTabId);\n\n switch (key) {\n case 'ArrowRight':\n // Move to the next tab\n newTabIndex = (currentIndex + 1) % tabs.length;\n break;\n case 'ArrowLeft':\n // Move to the previous tab\n newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n break;\n // Commented out ArrowDown and ArrowUp for future vertical tab navigation\n // case 'ArrowDown':\n // // Move to the next tab (for vertical alignment)\n // newTabIndex = (currentIndex + 1) % tabs.length;\n // break;\n // case 'ArrowUp':\n // // Move to the previous tab (for vertical alignment)\n // newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n // break;\n case 'Home':\n // Move to the first tab\n newTabIndex = 0;\n break;\n case 'End':\n // Move to the last tab\n newTabIndex = tabs.length - 1;\n break;\n case 'Enter':\n case ' ':\n // Activate the current tab\n newTabIndex = currentIndex;\n break;\n default:\n break;\n }\n\n if (newTabIndex !== -1) {\n event.preventDefault();\n event.stopPropagation();\n this.handleChange(event, tabs[newTabIndex].id);\n document.getElementById(`button-${tabs[newTabIndex].id}`).focus();\n }\n };\n\n parsedText = (text = '') => {\n // fix imported audio content for Safari PD-1391\n const div = document.createElement('div');\n div.innerHTML = text.replace(/(<br\\/>\\n)/g, '<br/>');\n\n const audio = div.querySelector('audio');\n\n if (audio) {\n const source = document.createElement('source');\n\n source.setAttribute('type', 'audio/mp3');\n source.setAttribute('src', audio.getAttribute('src'));\n\n audio.removeAttribute('src');\n audio.appendChild(source);\n }\n\n return div.innerHTML;\n };\n\n renderInstructions(teacherInstructions, disabledTabs = false) {\n if (!teacherInstructions) {\n return;\n }\n\n const teacherInstructionsDiv = (\n <PreviewPrompt\n tagName=\"div\"\n className=\"prompt\"\n defaultClassName=\"teacher-instructions\"\n prompt={teacherInstructions}\n />\n );\n\n if (disabledTabs) {\n return teacherInstructionsDiv;\n }\n\n return (\n <Collapsible\n labels={{\n hidden: 'Show Teacher Instructions',\n visible: 'Hide Teacher Instructions',\n }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n );\n }\n\n renderTab(tab, disabledTabs) {\n const { baseHeadingLevel } = this.props;\n const clampedLevel = baseHeadingLevel ? Math.min(6, Math.max(1, baseHeadingLevel)) : undefined;\n const TitleTag = baseHeadingLevel ? `h${clampedLevel}` : 'h2'; // default to h2 if no base level is provided - this was the previous behavior\n const textLevel = baseHeadingLevel ? Math.min(6, Math.max(1, clampedLevel + 1)) : undefined; // promote text headings one level above title\n\n return (\n <Passage key={tab.id} id={`tabpanel-${tab.id}`} role=\"tabpanel\" aria-labelledby={`button-${tab.id}`}>\n {this.renderInstructions(tab.teacherInstructions, disabledTabs)}\n\n {tab.title && (\n <Purpose purpose=\"passage-title\">\n <TitleTag>\n <PassageTitle dangerouslySetInnerHTML={{ __html: this.parsedText(tab.title) }} />\n </TitleTag>\n </Purpose>\n )}\n\n {tab.subtitle && (\n <Purpose purpose=\"passage-subtitle\">\n <PassageSubtitle dangerouslySetInnerHTML={{ __html: this.parsedText(tab.subtitle) }} />\n </Purpose>\n )}\n\n {tab.author && (\n <Purpose purpose=\"passage-author\">\n <PassageAuthor className=\"author\" dangerouslySetInnerHTML={{ __html: this.parsedText(tab.author) }} />\n </Purpose>\n )}\n\n {tab.text && (\n <Purpose purpose=\"passage-text\">\n <div key={tab.id} className=\"text\" dangerouslySetInnerHTML={{ __html: baseHeadingLevel ? transformDataHeadings(tab.text, textLevel) : tab.text }} />\n </Purpose>\n )}\n </Passage>\n );\n }\n\n render() {\n const { model, tabs, disabledTabs } = this.props;\n const { activeTab, zoomCompensation, containerWidth } = this.state;\n\n if (!tabs?.length) {\n return;\n }\n\n const { extraCSSRules } = model || {};\n const selectedTab = (tabs || []).find((tab) => tab.id === activeTab);\n\n // cap each tab at 1/n of the passage container width so a single long\n // title can't push other tabs off-screen. Existing two-line wrap + ellipsis\n // on .passage-label still trims anything that doesn't fit.\n const tabMaxWidth = containerWidth > 0 ? containerWidth / tabs.length : null;\n // When per-tab horizontal space drops to NUMERIC_LABEL_MIN_WIDTH_PER_TAB or\n // less, titles become unreadably truncated; swap to \"Passage N\" so users\n // can still navigate. Container width is read once layout has settled\n // (>0), so initial render uses real labels.\n const useNumericLabels =\n containerWidth > 0 && containerWidth <= tabs.length * NUMERIC_LABEL_MIN_WIDTH_PER_TAB;\n\n return (\n <UiLayout extraCSSRules={extraCSSRules}>\n <PassagesContainer className=\"passages\" ref={this.containerRef}>\n {disabledTabs || tabs.length === 1 ? (\n tabs.map((tab) => this.renderTab(tab, disabledTabs))\n ) : (\n <>\n <Tabs\n sx={{\n // Below the breakpoint (e.g. WCAG 400% zoom, ~320px viewport)\n // the tabs are in normal flow and scroll with the passage text,\n // so they don't lock up space needed to display the passage.\n position: 'static',\n // Above the breakpoint there is adequate screen space, so the\n // tabs stay locked to the top of the panel while the passage\n // text scrolls beneath them.\n [`@media (min-width: ${STICKY_TABS_BREAKPOINT + 1}px)`]: {\n position: 'sticky',\n top: 0,\n zIndex: 1,\n },\n background: 'var(--pie-passage-header-background, rgba(255,255,255,0))',\n color: color.text(),\n fontFamily: 'Roboto, sans-serif',\n // Freeze the tabs' physical size at their 200%-zoom appearance\n // when browser zoom exceeds 200%. The factor is 1 at zoom <= 200%,\n // so behavior below that threshold is unchanged. Using `zoom`\n // (rather than transform: scale) shrinks the layout box itself,\n // so the reclaimed space flows to the passage content below.\n zoom: zoomCompensation,\n '& .MuiTabs-list': {\n /*\n * The strip behind the tabs. A host that has opted into\n * `--pie-passage-header-background` keeps its own colour on every\n * scheme -- Knowledge Checks' pale green-blue is deliberate and is not\n * a scheme's business to override. With no host colour the fallback has\n * to be a theme token rather than a white literal, or the strip stays\n * white over a dark passage body.\n */\n backgroundColor: `var(--pie-passage-header-background, ${color.backgroundDark()})`,\n borderBottom: `1px solid ${color.borderGray()}`,\n },\n '& .MuiTabs-indicator': {\n backgroundColor: color.white(),\n marginBottom: '-1px',\n },\n }}\n value={activeTab}\n onChange={this.handleChange}\n >\n {tabs.map((tab, index) => (\n <TabStyled\n key={tab.id}\n id={`button-${tab.id}`}\n sx={tabMaxWidth ? { maxWidth: `${tabMaxWidth}px` } : undefined}\n label={\n <>\n <Purpose purpose=\"passage-label\">\n {useNumericLabels ? (\n <span className=\"passage-label\">{`Passage ${index + 1}`}</span>\n ) : (\n <span\n className=\"passage-label\"\n dangerouslySetInnerHTML={{ __html: this.parsedText(tab.label) }}\n />\n )}\n </Purpose>\n <Underline className=\"passage-label-underline\" />\n </>\n }\n value={tab.id}\n tabIndex={activeTab === tab.id ? 0 : -1}\n aria-controls={`tabpanel-${tab.id}`}\n aria-selected={activeTab === tab.id}\n onKeyDown={(event) => this.handleKeyDown(event, tab.id)}\n />\n ))}\n </Tabs>\n {selectedTab ? this.renderTab(selectedTab, disabledTabs) : null}\n </>\n )}\n </PassagesContainer>\n </UiLayout>\n );\n }\n}\n\nStimulusTabs.propTypes = {\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.number.isRequired,\n label: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string,\n author: PropTypes.string,\n text: PropTypes.string.isRequired,\n teacherInstructions: PropTypes.string,\n }).isRequired,\n ).isRequired,\n disabledTabs: PropTypes.bool,\n model: PropTypes.object,\n baseHeadingLevel: PropTypes.number,\n};\n\nexport default StimulusTabs;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,IAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMM,sBAAsB,GAAG,GAAG;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,qBAAqB,GAAG,GAAG;;AAEjC;AACA;AACA;AACA;AACA;AACA,MAAMC,+BAA+B,GAAG,GAAG;AAE3C,MAAMC,uBAAuB,GAAGA,CAAA,KAAM;EACpC,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE,OAAO,CAAC;EAC3C,MAAMC,KAAK,GAAGD,MAAM,CAACE,UAAU,GAAGF,MAAM,CAACG,UAAU;EACnD,MAAMC,IAAI,GAAGC,MAAM,CAACC,QAAQ,CAACL,KAAK,CAAC,IAAIA,KAAK,GAAG,CAAC,GAAGA,KAAK,GAAG,CAAC;EAC5D,OAAOM,IAAI,CAACC,GAAG,CAACX,qBAAqB,EAAEU,IAAI,CAACE,GAAG,CAAC,CAAC,EAAEb,aAAa,GAAGQ,IAAI,CAAC,CAAC;AAC3E,CAAC;AAED,MAAMM,iBAAiB,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AAE;IAAE,CACzD,CACF,CACG,CAAC,EACN6D,WAAW,GAAG,IAAI,CAACnB,SAAS,CAACmB,WAAW,EAAE9B,YAAY,CAAC,GAAG,IAC3D,CAEa,CACX,CAAC;EAEf;AACF;AAEA9D,YAAY,CAACoH,SAAS,GAAG;EACvB1F,IAAI,EAAE2F,kBAAS,CAACC,OAAO,CACrBD,kBAAS,CAACE,KAAK,CAAC;IACdxF,EAAE,EAAEsF,kBAAS,CAACG,MAAM,CAACC,UAAU;IAC/BT,KAAK,EAAEK,kBAAS,CAACK,MAAM,CAACD,UAAU;IAClCzC,KAAK,EAAEqC,kBAAS,CAACK,MAAM,CAACD,UAAU;IAClCnC,QAAQ,EAAE+B,kBAAS,CAACK,MAAM;IAC1BnC,MAAM,EAAE8B,kBAAS,CAACK,MAAM;IACxB/J,IAAI,EAAE0J,kBAAS,CAACK,MAAM,CAACD,UAAU;IACjC5D,mBAAmB,EAAEwD,kBAAS,CAACK;EACjC,CAAC,CAAC,CAACD,UACL,CAAC,CAACA,UAAU;EACZ3D,YAAY,EAAEuD,kBAAS,CAACM,IAAI;EAC5BjC,KAAK,EAAE2B,kBAAS,CAACO,MAAM;EACvBlD,gBAAgB,EAAE2C,kBAAS,CAACG;AAC9B,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAxH,OAAA,GAEaN,YAAY","ignoreList":[]}
@@ -1 +1 @@
1
- import{_dll_prop_types as e,_dll_mui__material_styles as t,_dll_react as a,_dll_mui__material as n,_dll_mui__icons_material as i,_dll_react_dom_client as s}from"../../../@pie-lib/shared-module@^5.1.1/module/index.js";import{_dll_pie_lib__config_ui as l}from"../../../@pie-lib/config-module@^4.0.4/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as o}from"../../../@pie-lib/editable-html-module@^7.1.1/module/index.js";var r={};Object.defineProperty(r,"__esModule",{value:!0});class d extends CustomEvent{constructor(e,t=!1){super(d.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}d.TYPE="model.updated";var u=r.ModelUpdatedEvent=d;class c extends CustomEvent{constructor(e,t){super(c.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}c.TYPE="delete.image";var g=r.DeleteImageEvent=c;class p extends CustomEvent{constructor(e){super(p.TYPE,{bubbles:!0,detail:e}),this.handler=e}}p.TYPE="insert.image";var h=r.InsertImageEvent=p;class m extends CustomEvent{constructor(e,t){super(m.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}m.TYPE="delete.sound";var b=r.DeleteSoundEvent=m;class _ extends CustomEvent{constructor(e){super(_.TYPE,{bubbles:!0,detail:e}),this.handler=e}}_.TYPE="insert.sound";var C=r.InsertSoundEvent=_;const E=a,f=e,{styled:x}=t,{Button:S}=n,{Dialog:I}=n,{DialogTitle:v}=n,{DialogContent:P}=n,{DialogContentText:y}=n,{DialogActions:T}=n,{RemoveCircle:R}=i,{AddCircle:q}=i,D=x(({label:e,type:t="add",onClick:a})=>{const n="add"===t?q:R;return E.createElement(S,{color:"primary",size:"small",onClick:a},E.createElement(n,{fontSize:"small",color:"primary",style:{marginRight:4}}),e)})({textDecoration:"underline","&:hover":{textDecoration:"underline",backgroundColor:"transparent"},display:"flex",alignItems:"center"}),k=({content:e,cancel:t,title:a,ok:n,open:i,onOk:s,onCancel:l})=>E.createElement(I,{open:i},E.createElement(v,null,a),E.createElement(P,null,E.createElement(y,null,e)),E.createElement(T,null,s&&E.createElement(S,{onClick:s,color:"primary"},n),l&&E.createElement(S,{onClick:l,color:"primary"},t)));k.propTypes={content:f.string.isRequired,title:f.string.isRequired,cancel:f.string.isRequired,ok:f.string.isRequired,open:f.bool.isRequired,onCancel:f.func.isRequired,onOk:f.func.isRequired};const A=a,M=e,{styled:w}=t,{InputContainer:j}=l,O=o,{ALL_PLUGINS:Y}=o;function L(e){let t,a=e[0],n=1;for(;n<e.length;){const i=e[n],s=e[n+1];if(n+=2,("optionalAccess"===i||"optionalCall"===i)&&null==a)return;"access"===i||"optionalAccess"===i?(t=a,a=s(a)):"call"!==i&&"optionalCall"!==i||(a=s((...e)=>a.call(t,...e)),t=void 0)}return a}const H=w(j)(({theme:e})=>({paddingTop:e.spacing(2),marginBottom:e.spacing(2),width:"100%"})),W=w("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)}));class z extends A.Component{static __initStatic(){this.propTypes={onModelChanged:M.func.isRequired,model:M.object.isRequired,configuration:M.object.isRequired,imageSupport:M.object.isRequired,passageIndex:M.number.isRequired,uploadSoundSupport:M.object.isRequired}}static __initStatic2(){this.defaultProps={passageIndex:0}}constructor(e){super(e),z.prototype.__init.call(this)}__init(){this.handleChange=(e,t)=>{const{model:a,onModelChanged:n,passageIndex:i}=this.props;if(!a.passages||i<0||i>=a.passages.length)return;const s=[...a.passages];s[i]={...s[i],[e]:t},n({...a,passages:s})}}render(){const{model:e,configuration:t,imageSupport:a,passageIndex:n,uploadSoundSupport:i}=this.props,{maxImageWidth:s={},maxImageHeight:l={},mathMlOptions:o={},baseInputConfiguration:r={},teacherInstructions:d={},title:u={},subtitle:c={},text:g={},author:p={}}=t||{},{errors:h={},passages:m=[],teacherInstructionsEnabled:b,titleEnabled:_,subtitleEnabled:C,authorEnabled:E,textEnabled:f}=e||{},{passages:x}=h||{},{teacherInstructions:S,title:I,subtitle:v,author:P,text:y}=x&&x[n]||{},T=s&&s.prompt,R=l&&l.prompt,q=e=>({...r,...e}),D=(Y||[]).filter(e=>!["math","table","bulleted-list","numbered-list"].includes(e));return A.createElement(A.Fragment,null,b&&A.createElement(H,{label:d.label},A.createElement(O,{activePlugins:Y,markup:m[n].teacherInstructions||"",onChange:e=>this.handleChange("teacherInstructions",e),nonEmpty:!1,error:S,maxImageWidth:s&&s.teacherInstructions||T,maxImageHeight:l&&l.teacherInstructions||R,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([d,"optionalAccess",e=>e.inputConfiguration]))}),S&&A.createElement(W,null,S)),_&&A.createElement(H,{label:u.label},A.createElement(O,{activePlugins:D,markup:m[n].title||"",onChange:e=>this.handleChange("title",e),nonEmpty:!1,error:I,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([u,"optionalAccess",e=>e.inputConfiguration]))}),I&&A.createElement(W,null,I)),C&&A.createElement(H,{label:c.label},A.createElement(O,{activePlugins:D,markup:m[n].subtitle||"",onChange:e=>this.handleChange("subtitle",e),nonEmpty:!1,error:v,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([c,"optionalAccess",e=>e.inputConfiguration]))}),v&&A.createElement(W,null,v)),E&&A.createElement(H,{label:p.label},A.createElement(O,{activePlugins:D,markup:m[n].author||"",onChange:e=>this.handleChange("author",e),nonEmpty:!1,error:P,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([p,"optionalAccess",e=>e.inputConfiguration]))}),P&&A.createElement(W,null,P)),f&&A.createElement(H,{label:g.label},A.createElement(O,{activePlugins:Y,markup:m[n].text||"",onChange:e=>this.handleChange("text",e),imageSupport:a,uploadSoundSupport:i,nonEmpty:!1,error:y,maxImageWidth:s&&s.text||T,maxImageHeight:l&&l.text||R,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([g,"optionalAccess",e=>e.inputConfiguration]))}),y&&A.createElement(W,null,y)))}}z.__initStatic(),z.__initStatic2();const B=a,$=e,{styled:F}=t,{Typography:U}=n,{settings:G}=l,{layout:N}=l,{Panel:J,toggle:K,dropdown:Q}=G,V=F(U)(({theme:e})=>({paddingTop:e.spacing(2),marginBottom:e.spacing(2)}));class X extends B.Component{static __initStatic(){this.propTypes={onModelChanged:$.func.isRequired,onConfigurationChanged:$.func,model:$.object.isRequired,configuration:$.object.isRequired,imageSupport:$.object.isRequired,uploadSoundSupport:$.object.isRequired,classes:$.object.isRequired}}constructor(e){super(e),X.prototype.__init.call(this),X.prototype.__init2.call(this),X.prototype.__init3.call(this),X.prototype.__init4.call(this),this.state={showConfirmationDialog:!1,indexToRemove:-1}}__init(){this.getInnerText=e=>(e||"").replaceAll(/<[^>]*>/g,"")}__init2(){this.onDelete=(e,t,a)=>{let n=e.passages;n.splice(t,1),a({...e,passages:n}),this.setState({showConfirmationDialog:!1,indexToRemove:-1})}}__init3(){this.removeAdditionalPassage=e=>{const{model:t={},onModelChanged:a}=this.props,{passages:n=[]}=t,{teacherInstructions:i="",title:s="",subtitle:l="",author:o="",text:r=""}=n[e];this.getInnerText(i).trim()||this.getInnerText(s).trim()||this.getInnerText(l).trim()||this.getInnerText(o).trim()||this.getInnerText(r).trim()?this.setState({showConfirmationDialog:!0,indexToRemove:e}):this.onDelete(t,e,a)}}__init4(){this.addAdditionalPassage=()=>{const{model:e,onModelChanged:t}=this.props,a=[...e.passages,{teacherInstructions:"",title:"",subtitle:"",author:"",text:""}];t({...e,passages:a})}}render(){const{model:e,configuration:t,imageSupport:a,onConfigurationChanged:n,onModelChanged:i,uploadSoundSupport:s}=this.props,{settingsPanelDisabled:l,language:o={},languageChoices:r={},teacherInstructions:d={},title:u={},subtitle:c={},text:g={},author:p={},additionalPassage:h={}}=t||{},{extraCSSRules:m,passages:b}=e||{},_={titleEnabled:u&&u.settings&&K(u.label),subtitleEnabled:c&&c.settings&&K(c.label),authorEnabled:p&&p.settings&&K(p.label),textEnabled:g&&g.settings&&K(g.label),"additionalPassage.enabled":h&&h.settings&&K(h.label,!0)},C={teacherInstructionsEnabled:d&&d.settings&&K(d.label),"language.enabled":o&&o.settings&&K(o.label,!0),language:o&&o.settings&&o.enabled&&Q(r.label,r.options)},E=`${h.label} will be deleted`,{indexToRemove:f,showConfirmationDialog:x}=this.state;return B.createElement(N.ConfigLayout,{extraCSSRules:m,hideSettings:l,settings:B.createElement(J,{model:e,configuration:t,onChangeModel:e=>i(e),onChangeConfiguration:e=>n(e),groups:{Settings:_,Properties:C}})},b.map((n,l)=>B.createElement(B.Fragment,{key:l},l>0&&B.createElement(V,{variant:"h5"},h.label),B.createElement(z,{imageSupport:a,uploadSoundSupport:s,model:e,configuration:t,passageIndex:l,onModelChanged:i}),l>0&&h.enabled&&B.createElement(D,{type:"remove",label:`Remove ${h.label}`,onClick:()=>this.removeAdditionalPassage(l)}),0===l&&h.enabled&&b.length<2&&B.createElement(D,{label:`Add ${h.label}`,onClick:this.addAdditionalPassage}))),B.createElement(k,{open:x,title:"Warning",content:E,cancel:"Cancel",ok:"Ok",onCancel:()=>this.setState({showConfirmationDialog:!1}),onOk:()=>this.onDelete(e,f,i)}))}}X.__initStatic();var Z={authorEnabled:!0,passages:[{teacherInstructions:"",title:"",subtitle:"",author:"",text:""}],subtitleEnabled:!0,teacherInstructionsEnabled:!0,textEnabled:!0,titleEnabled:!0},ee={baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!0},blockquote:{disabled:!0},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},settingsPanelDisabled:!1,title:{settings:!0,label:"Title",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0},textAlign:{disabled:!1}},required:!0},subtitle:{settings:!0,label:"Subtitle",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0},textAlign:{disabled:!1}},required:!1},author:{settings:!0,label:"Author",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0}},required:!1},text:{settings:!0,label:"Text",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!1},blockquote:{disabled:!1},textAlign:{disabled:!1}},required:!0},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},maxImageWidth:{teacherInstructions:300,text:300},maxImageHeight:{teacherInstructions:300,text:300},mathMlOptions:{mmlOutput:!1,mmlEditing:!1},language:{settings:!1,label:"Specify Language",enabled:!1},languageChoices:{label:"Language Choices",options:[]},additionalPassage:{settings:!0,label:"Additional Passage",enabled:!1}};const te=a,{createRoot:ae}=s;class ne extends HTMLElement{static __initStatic(){this.createDefaultModel=(e={})=>({...Z,...e})}constructor(){super(),this._root=null,this._model=ne.createDefaultModel(),this._configuration=ee}set model(e){this._model=ne.createDefaultModel(e),this.render()}set configuration(e){this._configuration=e,this.render()}connectedCallback(){this.render()}modelChanged(e){this._model=e,this.dispatchEvent(new u(this._model),!0),this.render()}onConfigurationChanged(e){this._configuration=e,this.render()}insertImage(e){this.dispatchEvent(new h(e))}onDeleteImage(e,t){this.dispatchEvent(new g(e,t))}insertSound(e){this.dispatchEvent(new C(e))}onDeleteSound(e,t){this.dispatchEvent(new b(e,t))}render(){if(this._model){const e=te.createElement(X,{model:this._model,configuration:this._configuration,onModelChanged:this.modelChanged.bind(this),onConfigurationChanged:this.onConfigurationChanged.bind(this),imageSupport:{add:this.insertImage.bind(this),delete:this.onDeleteImage.bind(this)},uploadSoundSupport:{add:this.insertSound.bind(this),delete:this.onDeleteSound.bind(this)}});this._root||(this._root=ae(this)),this._root.render(e)}}disconnectedCallback(){this._root&&this._root.unmount()}}ne.__initStatic();export{ne as default};
1
+ import{_dll_prop_types as e,_dll_mui__material_styles as t,_dll_react as n,_dll_mui__material as a,_dll_mui__icons_material as i,_dll_react_dom_client as s}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";import{_dll_pie_lib__config_ui as l}from"../../../@pie-lib/config-module@5.0.0/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as o}from"../../../@pie-lib/editable-html-module@8.0.0/module/index.js";var r={};Object.defineProperty(r,"__esModule",{value:!0});class d extends CustomEvent{constructor(e,t=!1){super(d.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}d.TYPE="model.updated";var u=r.ModelUpdatedEvent=d;class c extends CustomEvent{constructor(e,t){super(c.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}c.TYPE="delete.image";var g=r.DeleteImageEvent=c;class p extends CustomEvent{constructor(e){super(p.TYPE,{bubbles:!0,detail:e}),this.handler=e}}p.TYPE="insert.image";var h=r.InsertImageEvent=p;class m extends CustomEvent{constructor(e,t){super(m.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}m.TYPE="delete.sound";var b=r.DeleteSoundEvent=m;class _ extends CustomEvent{constructor(e){super(_.TYPE,{bubbles:!0,detail:e}),this.handler=e}}_.TYPE="insert.sound";var C=r.InsertSoundEvent=_;const E=n,f=e,{styled:x}=t,{Button:S}=a,{Dialog:I}=a,{DialogTitle:v}=a,{DialogContent:P}=a,{DialogContentText:y}=a,{DialogActions:T}=a,{RemoveCircle:R}=i,{AddCircle:q}=i,D=x(({label:e,type:t="add",onClick:n})=>{const a="add"===t?q:R;return E.createElement(S,{color:"primary",size:"small",onClick:n},E.createElement(a,{fontSize:"small",color:"primary",style:{marginRight:4}}),e)})({textDecoration:"underline","&:hover":{textDecoration:"underline",backgroundColor:"transparent"},display:"flex",alignItems:"center"}),k=({content:e,cancel:t,title:n,ok:a,open:i,onOk:s,onCancel:l})=>E.createElement(I,{open:i},E.createElement(v,null,n),E.createElement(P,null,E.createElement(y,null,e)),E.createElement(T,null,s&&E.createElement(S,{onClick:s,color:"primary"},a),l&&E.createElement(S,{onClick:l,color:"primary"},t)));k.propTypes={content:f.string.isRequired,title:f.string.isRequired,cancel:f.string.isRequired,ok:f.string.isRequired,open:f.bool.isRequired,onCancel:f.func.isRequired,onOk:f.func.isRequired};const A=n,M=e,{styled:w}=t,{InputContainer:j}=l,O=o,{ALL_PLUGINS:Y}=o;function L(e){let t,n=e[0],a=1;for(;a<e.length;){const i=e[a],s=e[a+1];if(a+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):"call"!==i&&"optionalCall"!==i||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}const H=w(j)(({theme:e})=>({paddingTop:e.spacing(2),marginBottom:e.spacing(2),width:"100%"})),W=w("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)}));class z extends A.Component{static __initStatic(){this.propTypes={onModelChanged:M.func.isRequired,model:M.object.isRequired,configuration:M.object.isRequired,imageSupport:M.object.isRequired,passageIndex:M.number.isRequired,uploadSoundSupport:M.object.isRequired}}static __initStatic2(){this.defaultProps={passageIndex:0}}constructor(e){super(e),z.prototype.__init.call(this)}__init(){this.handleChange=(e,t)=>{const{model:n,onModelChanged:a,passageIndex:i}=this.props;if(!n.passages||i<0||i>=n.passages.length)return;const s=[...n.passages];s[i]={...s[i],[e]:t},a({...n,passages:s})}}render(){const{model:e,configuration:t,imageSupport:n,passageIndex:a,uploadSoundSupport:i}=this.props,{maxImageWidth:s={},maxImageHeight:l={},mathMlOptions:o={},baseInputConfiguration:r={},teacherInstructions:d={},title:u={},subtitle:c={},text:g={},author:p={}}=t||{},{errors:h={},passages:m=[],teacherInstructionsEnabled:b,titleEnabled:_,subtitleEnabled:C,authorEnabled:E,textEnabled:f}=e||{},{passages:x}=h||{},{teacherInstructions:S,title:I,subtitle:v,author:P,text:y}=x&&x[a]||{},T=s&&s.prompt,R=l&&l.prompt,q=e=>({...r,...e}),D=(Y||[]).filter(e=>!["math","table","bulleted-list","numbered-list"].includes(e));return A.createElement(A.Fragment,null,b&&A.createElement(H,{label:d.label},A.createElement(O,{activePlugins:Y,markup:m[a].teacherInstructions||"",onChange:e=>this.handleChange("teacherInstructions",e),nonEmpty:!1,error:S,maxImageWidth:s&&s.teacherInstructions||T,maxImageHeight:l&&l.teacherInstructions||R,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([d,"optionalAccess",e=>e.inputConfiguration]))}),S&&A.createElement(W,null,S)),_&&A.createElement(H,{label:u.label},A.createElement(O,{activePlugins:D,markup:m[a].title||"",onChange:e=>this.handleChange("title",e),nonEmpty:!1,error:I,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([u,"optionalAccess",e=>e.inputConfiguration]))}),I&&A.createElement(W,null,I)),C&&A.createElement(H,{label:c.label},A.createElement(O,{activePlugins:D,markup:m[a].subtitle||"",onChange:e=>this.handleChange("subtitle",e),nonEmpty:!1,error:v,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([c,"optionalAccess",e=>e.inputConfiguration]))}),v&&A.createElement(W,null,v)),E&&A.createElement(H,{label:p.label},A.createElement(O,{activePlugins:D,markup:m[a].author||"",onChange:e=>this.handleChange("author",e),nonEmpty:!1,error:P,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([p,"optionalAccess",e=>e.inputConfiguration]))}),P&&A.createElement(W,null,P)),f&&A.createElement(H,{label:g.label},A.createElement(O,{activePlugins:Y,markup:m[a].text||"",onChange:e=>this.handleChange("text",e),imageSupport:n,uploadSoundSupport:i,nonEmpty:!1,error:y,maxImageWidth:s&&s.text||T,maxImageHeight:l&&l.text||R,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([g,"optionalAccess",e=>e.inputConfiguration]))}),y&&A.createElement(W,null,y)))}}z.__initStatic(),z.__initStatic2();const B=n,$=e,{styled:F}=t,{Typography:U}=a,{settings:G}=l,{layout:N}=l,{Panel:J,toggle:K,dropdown:Q}=G,V=F(U)(({theme:e})=>({paddingTop:e.spacing(2),marginBottom:e.spacing(2)}));class X extends B.Component{static __initStatic(){this.propTypes={onModelChanged:$.func.isRequired,onConfigurationChanged:$.func,model:$.object.isRequired,configuration:$.object.isRequired,imageSupport:$.object.isRequired,uploadSoundSupport:$.object.isRequired,classes:$.object.isRequired}}constructor(e){super(e),X.prototype.__init.call(this),X.prototype.__init2.call(this),X.prototype.__init3.call(this),X.prototype.__init4.call(this),this.state={showConfirmationDialog:!1,indexToRemove:-1}}__init(){this.getInnerText=e=>(e||"").replaceAll(/<[^>]*>/g,"")}__init2(){this.onDelete=(e,t,n)=>{let a=e.passages;a.splice(t,1),n({...e,passages:a}),this.setState({showConfirmationDialog:!1,indexToRemove:-1})}}__init3(){this.removeAdditionalPassage=e=>{const{model:t={},onModelChanged:n}=this.props,{passages:a=[]}=t,{teacherInstructions:i="",title:s="",subtitle:l="",author:o="",text:r=""}=a[e];this.getInnerText(i).trim()||this.getInnerText(s).trim()||this.getInnerText(l).trim()||this.getInnerText(o).trim()||this.getInnerText(r).trim()?this.setState({showConfirmationDialog:!0,indexToRemove:e}):this.onDelete(t,e,n)}}__init4(){this.addAdditionalPassage=()=>{const{model:e,onModelChanged:t}=this.props,n=[...e.passages,{teacherInstructions:"",title:"",subtitle:"",author:"",text:""}];t({...e,passages:n})}}render(){const{model:e,configuration:t,imageSupport:n,onConfigurationChanged:a,onModelChanged:i,uploadSoundSupport:s}=this.props,{settingsPanelDisabled:l,language:o={},languageChoices:r={},teacherInstructions:d={},title:u={},subtitle:c={},text:g={},author:p={},additionalPassage:h={}}=t||{},{extraCSSRules:m,passages:b}=e||{},_={titleEnabled:u&&u.settings&&K(u.label),subtitleEnabled:c&&c.settings&&K(c.label),authorEnabled:p&&p.settings&&K(p.label),textEnabled:g&&g.settings&&K(g.label),"additionalPassage.enabled":h&&h.settings&&K(h.label,!0)},C={teacherInstructionsEnabled:d&&d.settings&&K(d.label),"language.enabled":o&&o.settings&&K(o.label,!0),language:o&&o.settings&&o.enabled&&Q(r.label,r.options)},E=`${h.label} will be deleted`,{indexToRemove:f,showConfirmationDialog:x}=this.state;return B.createElement(N.ConfigLayout,{extraCSSRules:m,hideSettings:l,settings:B.createElement(J,{model:e,configuration:t,onChangeModel:e=>i(e),onChangeConfiguration:e=>a(e),groups:{Settings:_,Properties:C}})},b.map((a,l)=>B.createElement(B.Fragment,{key:l},l>0&&B.createElement(V,{variant:"h5"},h.label),B.createElement(z,{imageSupport:n,uploadSoundSupport:s,model:e,configuration:t,passageIndex:l,onModelChanged:i}),l>0&&h.enabled&&B.createElement(D,{type:"remove",label:`Remove ${h.label}`,onClick:()=>this.removeAdditionalPassage(l)}),0===l&&h.enabled&&b.length<2&&B.createElement(D,{label:`Add ${h.label}`,onClick:this.addAdditionalPassage}))),B.createElement(k,{open:x,title:"Warning",content:E,cancel:"Cancel",ok:"Ok",onCancel:()=>this.setState({showConfirmationDialog:!1}),onOk:()=>this.onDelete(e,f,i)}))}}X.__initStatic();var Z={authorEnabled:!0,passages:[{teacherInstructions:"",title:"",subtitle:"",author:"",text:""}],subtitleEnabled:!0,teacherInstructionsEnabled:!0,textEnabled:!0,titleEnabled:!0},ee={baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!0},blockquote:{disabled:!0},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},settingsPanelDisabled:!1,title:{settings:!0,label:"Title",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0},textAlign:{disabled:!1}},required:!0},subtitle:{settings:!0,label:"Subtitle",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0},textAlign:{disabled:!1}},required:!1},author:{settings:!0,label:"Author",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0}},required:!1},text:{settings:!0,label:"Text",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!1},blockquote:{disabled:!1},textAlign:{disabled:!1}},required:!0},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},maxImageWidth:{teacherInstructions:300,text:300},maxImageHeight:{teacherInstructions:300,text:300},mathMlOptions:{mmlOutput:!1,mmlEditing:!1},language:{settings:!1,label:"Specify Language",enabled:!1},languageChoices:{label:"Language Choices",options:[]},additionalPassage:{settings:!0,label:"Additional Passage",enabled:!1}};const te=n,{createRoot:ne}=s;class ae extends HTMLElement{static __initStatic(){this.createDefaultModel=(e={})=>({...Z,...e})}constructor(){super(),this._root=null,this._model=ae.createDefaultModel(),this._configuration=ee}set model(e){this._model=ae.createDefaultModel(e),this.render()}set configuration(e){this._configuration=e,this.render()}connectedCallback(){this.render()}modelChanged(e){this._model=e,this.dispatchEvent(new u(this._model),!0),this.render()}onConfigurationChanged(e){this._configuration=e,this.render()}insertImage(e){this.dispatchEvent(new h(e))}onDeleteImage(e,t){this.dispatchEvent(new g(e,t))}insertSound(e){this.dispatchEvent(new C(e))}onDeleteSound(e,t){this.dispatchEvent(new b(e,t))}render(){if(this._model){const e=te.createElement(X,{model:this._model,configuration:this._configuration,onModelChanged:this.modelChanged.bind(this),onConfigurationChanged:this.onConfigurationChanged.bind(this),imageSupport:{add:this.insertImage.bind(this),delete:this.onDeleteImage.bind(this)},uploadSoundSupport:{add:this.insertSound.bind(this),delete:this.onDeleteSound.bind(this)}});this._root||(this._root=ne(this)),this._root.render(e)}}disconnectedCallback(){this._root&&(this._root.unmount(),this._root=null)}}ae.__initStatic();export{ae as default};
package/module/element.js CHANGED
@@ -1 +1 @@
1
- import{_dll_pie_lib__math_rendering as e}from"../../../@pie-lib/math-rendering-module@^5.0.4/module/index.js";import{_dll_react as t,_dll_prop_types as s,_dll_mui__material as i,_dll_mui__material_styles as r,_dll_pie_lib__render_ui as n,_dll_react_dom_client as a}from"../../../@pie-lib/shared-module@^5.1.1/module/index.js";var o={};Object.defineProperty(o,"__esModule",{value:!0});class l extends CustomEvent{constructor(e,t,s){super(l.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:s}}),this.component=e,this.complete=t}}l.TYPE="model-set";var c=o.ModelSetEvent=l;class d extends CustomEvent{constructor(e,t){super(d.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}d.TYPE="session-changed",o.SessionChangedEvent=d;const h=t,u=s,{Tabs:b}=i,{Tab:m}=i,{styled:p}=r,{Collapsible:_}=n,{color:g}=n,{PreviewPrompt:v}=n,{Purpose:y}=n,{UiLayout:f}=n,{transformDataHeadings:E}=n;const x=p("div")({flexGrow:1,backgroundColor:g.background(),color:g.text(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),T=p("div")(({theme:e})=>({backgroundColor:g.background(),color:g.text(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),M=p("div")({fontSize:"1.75rem"}),O=p("div")({fontSize:"1.5rem"}),C=p("div")({fontSize:"1.25rem"}),k=p(m)(({theme:e})=>({background:e.palette.common.white,fontSize:"inherit",fontFamily:"Roboto, sans-serif",opacity:.7,color:e.palette.common.black,"&.Mui-selected":{opacity:1,color:e.palette.common.black}}));class L extends h.Component{constructor(...e){super(...e),L.prototype.__init.call(this),L.prototype.__init2.call(this),L.prototype.__init3.call(this),L.prototype.__init4.call(this)}__init(){this.state={activeTab:0}}__init2(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init3(){this.handleKeyDown=(e,t)=>{const{key:s}=e,{tabs:i}=this.props;let r=-1;const n=i.findIndex(e=>e.id===t);switch(s){case"ArrowRight":r=(n+1)%i.length;break;case"ArrowLeft":r=(n-1+i.length)%i.length;break;case"Home":r=0;break;case"End":r=i.length-1;break;case"Enter":case" ":r=n}-1!==r&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,i[r].id),document.getElementById(`button-${i[r].id}`).focus())}}__init4(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const s=t.querySelector("audio");if(s){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",s.getAttribute("src")),s.removeAttribute("src"),s.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const s=h.createElement(v,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?s:h.createElement(_,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},s)}renderTab(e,t){const{baseHeadingLevel:s}=this.props,i=s?Math.min(6,Math.max(1,s)):void 0,r=s?`h${i}`:"h2",n=s?Math.min(6,Math.max(1,i+1)):void 0;return h.createElement(T,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&h.createElement(y,{purpose:"passage-title"},h.createElement(r,null,h.createElement(M,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&h.createElement(y,{purpose:"passage-subtitle"},h.createElement(O,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&h.createElement(y,{purpose:"passage-author"},h.createElement(C,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&h.createElement(y,{purpose:"passage-text"},h.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:s?E(e.text,n):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:s}=this.props,{activeTab:i}=this.state;if(!function(e){let t,s=e[0],i=1;for(;i<e.length;){const r=e[i],n=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==s)return;"access"===r||"optionalAccess"===r?(t=s,s=n(s)):"call"!==r&&"optionalCall"!==r||(s=n((...e)=>s.call(t,...e)),t=void 0)}return s}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:r}=e||{},n=(t||[]).find(e=>e.id===i);return h.createElement(f,{extraCSSRules:r},h.createElement(x,{className:"passages"},s||1===t.length?t.map(e=>this.renderTab(e,s)):h.createElement(h.Fragment,null,h.createElement(b,{sx:{position:"sticky",top:0,background:g.background(),color:g.text(),fontFamily:"Roboto, sans-serif","& .MuiTabs-indicator":{backgroundColor:"#f50057"}},value:i,onChange:this.handleChange},t.map(e=>h.createElement(k,{key:e.id,id:`button-${e.id}`,label:h.createElement(y,{purpose:"passage-label"},h.createElement("span",{dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),value:e.id,tabIndex:i===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":i===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),n?this.renderTab(n,s):null)))}}L.propTypes={tabs:u.arrayOf(u.shape({id:u.number.isRequired,label:u.string.isRequired,title:u.string.isRequired,subtitle:u.string,author:u.string,text:u.string.isRequired,teacherInstructions:u.string}).isRequired).isRequired,disabledTabs:u.bool,model:u.object,baseHeadingLevel:u.number};const{renderMath:A}=e,P=t,{createRoot:R}=a;function S(e){const t=e.closest("pie-player")||e.closest("pie-item-player");if(t){let e=t.baseHeadingLevel;null==e&&(s=t.getAttribute("base-heading-level"),i=()=>t.getAttribute("baseheadinglevel"),e=null!=s?s:i());const r=parseInt(e,10);if(Number.isFinite(r)&&r>=1&&r<=6)return r}var s,i}class w extends HTMLElement{constructor(){super(),w.prototype.__init.call(this),this._model={passages:[]},this._session=null,this._root=null,this._mathObserver=null,this._mathRenderPending=!1,this._playerObserver=null}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t)}__init(){this._scheduleMathRender=()=>{this._mathRenderPending||(this._mathRenderPending=!0,requestAnimationFrame(()=>{this._mathObserver&&this._mathObserver.disconnect(),A(this),this._mathRenderPending=!1,setTimeout(()=>{this._mathObserver&&this._mathObserver.observe(this,{childList:!0,subtree:!0})},50)}))}}_initMathObserver(){this._mathObserver||(this._mathObserver=new MutationObserver(this._scheduleMathRender),this._mathObserver.observe(this,{childList:!0,subtree:!0}))}_disconnectMathObserver(){this._mathObserver&&(this._mathObserver.disconnect(),this._mathObserver=null)}set model(e){this._model=e,this.dispatchEvent(new c(this.tagName.toLowerCase(),this._session,!!this._model)),this.setLangAttribute(),this._render()}set session(e){this._session=e}connectedCallback(){this.setAttribute("aria-label","Passage"),this.setAttribute("role","region"),this._initMathObserver(),this._initPlayerObserver(),this._render()}_render(){const{passages:e=[]}=this._model;if(this._model.passages.length>0){const t=e.map((e,t)=>({id:t,...e})),s=P.createElement(L,{tabs:t,model:this._model,baseHeadingLevel:S(this)});this._root||(this._root=R(this)),this._root.render(s),this._initMathObserver()}}_initPlayerObserver(){const e=this.closest("pie-player")||this.closest("pie-item-player");e&&(this._playerObserver=new MutationObserver(()=>{this._render()}),this._playerObserver.observe(e,{attributes:!0,attributeFilter:["base-heading-level"]}))}_disconnectPlayerObserver(){this._playerObserver&&(this._playerObserver.disconnect(),this._playerObserver=null)}disconnectedCallback(){this._disconnectMathObserver(),this._disconnectPlayerObserver(),this._root&&this._root.unmount()}}export{w as default};
1
+ import{_dll_pie_lib__math_rendering as e}from"../../../@pie-lib/math-rendering-module@6.0.0/module/index.js";import{_dll_react as t,_dll_prop_types as s,_dll_mui__material as i,_dll_mui__material_styles as n,_dll_pie_lib__render_ui as r,_dll_react_dom_client as a}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";var o={};Object.defineProperty(o,"__esModule",{value:!0});class l extends CustomEvent{constructor(e,t,s){super(l.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:s}}),this.component=e,this.complete=t}}l.TYPE="model-set";var d=o.ModelSetEvent=l;class h extends CustomEvent{constructor(e,t){super(h.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}h.TYPE="session-changed",o.SessionChangedEvent=h;const c=t,p=s,{Tabs:u}=i,{Tab:m}=i,{styled:b}=n,{Collapsible:g}=r,{color:_}=r,{PreviewPrompt:v}=r,{Purpose:y}=r,{UiLayout:f}=r,{transformDataHeadings:x}=r;const E=()=>{if("undefined"==typeof window)return 1;const e=window.outerWidth/window.innerWidth,t=Number.isFinite(e)&&e>0?e:1;return Math.max(.4,Math.min(1,2/t))},O=b("div")({flexGrow:1,backgroundColor:_.background(),color:_.text(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),w=b("div")(({theme:e})=>({backgroundColor:_.background(),color:_.text(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),C=b("div")({fontSize:"1.75rem"}),T=b("div")({fontSize:"1.5rem"}),M=b("div")({fontSize:"1.25rem"}),k=b(m)(({theme:e})=>({background:_.background(),fontSize:"inherit",fontFamily:"Roboto, sans-serif",color:_.text(),borderRadius:`${e.spacing(2)} ${e.spacing(2)} 0 0`,border:`1px solid ${_.borderGray()}`,borderBottomWidth:0,minHeight:"56px",padding:"8px 10px",display:"flex",alignItems:"center",justifyContent:"center",margin:`0 ${e.spacing(1)}`,textTransform:"none",".passage-label":{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",margin:"auto 0",opacity:.7},"&.Mui-selected":{color:_.text(),".passage-label":{opacity:1},".passage-label-underline":{backgroundColor:_.tertiary()}},"&:hover":{".passage-label-underline":{backgroundColor:_.tertiaryLight()}},"& .MuiTouchRipple-root":{opacity:.7}})),R=b("div")(()=>({height:"2px",width:"100%",marginTop:"6px",background:_.background()}));class L extends c.Component{constructor(...e){super(...e),L.prototype.__init.call(this),L.prototype.__init2.call(this),L.prototype.__init3.call(this),L.prototype.__init4.call(this),L.prototype.__init5.call(this),L.prototype.__init6.call(this),L.prototype.__init7.call(this)}__init(){this.state={activeTab:0,zoomCompensation:E(),containerWidth:0}}__init2(){this.containerRef=c.createRef()}componentDidMount(){"undefined"!=typeof window&&(window.addEventListener("resize",this.updateZoomCompensation),this.containerRef.current&&"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.updateContainerWidth),this.resizeObserver.observe(this.containerRef.current)),this.updateContainerWidth())}componentWillUnmount(){"undefined"!=typeof window&&(window.removeEventListener("resize",this.updateZoomCompensation),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null))}__init3(){this.updateZoomCompensation=()=>{this.setState({zoomCompensation:E()})}}__init4(){this.updateContainerWidth=()=>{const e=this.containerRef.current;if(!e)return;const t=e.clientWidth;t!==this.state.containerWidth&&this.setState({containerWidth:t})}}__init5(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init6(){this.handleKeyDown=(e,t)=>{const{key:s}=e,{tabs:i}=this.props;let n=-1;const r=i.findIndex(e=>e.id===t);switch(s){case"ArrowRight":n=(r+1)%i.length;break;case"ArrowLeft":n=(r-1+i.length)%i.length;break;case"Home":n=0;break;case"End":n=i.length-1;break;case"Enter":case" ":n=r}-1!==n&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,i[n].id),document.getElementById(`button-${i[n].id}`).focus())}}__init7(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const s=t.querySelector("audio");if(s){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",s.getAttribute("src")),s.removeAttribute("src"),s.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const s=c.createElement(v,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?s:c.createElement(g,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},s)}renderTab(e,t){const{baseHeadingLevel:s}=this.props,i=s?Math.min(6,Math.max(1,s)):void 0,n=s?`h${i}`:"h2",r=s?Math.min(6,Math.max(1,i+1)):void 0;return c.createElement(w,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&c.createElement(y,{purpose:"passage-title"},c.createElement(n,null,c.createElement(C,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&c.createElement(y,{purpose:"passage-subtitle"},c.createElement(T,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&c.createElement(y,{purpose:"passage-author"},c.createElement(M,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&c.createElement(y,{purpose:"passage-text"},c.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:s?x(e.text,r):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:s}=this.props,{activeTab:i,zoomCompensation:n,containerWidth:r}=this.state;if(!function(e){let t,s=e[0],i=1;for(;i<e.length;){const n=e[i],r=e[i+1];if(i+=2,("optionalAccess"===n||"optionalCall"===n)&&null==s)return;"access"===n||"optionalAccess"===n?(t=s,s=r(s)):"call"!==n&&"optionalCall"!==n||(s=r((...e)=>s.call(t,...e)),t=void 0)}return s}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:a}=e||{},o=(t||[]).find(e=>e.id===i),l=r>0?r/t.length:null,d=r>0&&r<=170*t.length;return c.createElement(f,{extraCSSRules:a},c.createElement(O,{className:"passages",ref:this.containerRef},s||1===t.length?t.map(e=>this.renderTab(e,s)):c.createElement(c.Fragment,null,c.createElement(u,{sx:{position:"static","@media (min-width: 841px)":{position:"sticky",top:0,zIndex:1},background:"var(--pie-passage-header-background, rgba(255,255,255,0))",color:_.text(),fontFamily:"Roboto, sans-serif",zoom:n,"& .MuiTabs-list":{backgroundColor:`var(--pie-passage-header-background, ${_.backgroundDark()})`,borderBottom:`1px solid ${_.borderGray()}`},"& .MuiTabs-indicator":{backgroundColor:_.white(),marginBottom:"-1px"}},value:i,onChange:this.handleChange},t.map((e,t)=>c.createElement(k,{key:e.id,id:`button-${e.id}`,sx:l?{maxWidth:`${l}px`}:void 0,label:c.createElement(c.Fragment,null,c.createElement(y,{purpose:"passage-label"},d?c.createElement("span",{className:"passage-label"},`Passage ${t+1}`):c.createElement("span",{className:"passage-label",dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),c.createElement(R,{className:"passage-label-underline"})),value:e.id,tabIndex:i===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":i===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),o?this.renderTab(o,s):null)))}}L.propTypes={tabs:p.arrayOf(p.shape({id:p.number.isRequired,label:p.string.isRequired,title:p.string.isRequired,subtitle:p.string,author:p.string,text:p.string.isRequired,teacherInstructions:p.string}).isRequired).isRequired,disabledTabs:p.bool,model:p.object,baseHeadingLevel:p.number};const{renderMath:S}=e,P=t,{createRoot:z}=a;function A(e){const t=e.closest("pie-player")||e.closest("pie-item-player");if(t){let e=t.baseHeadingLevel;null==e&&(s=t.getAttribute("base-heading-level"),i=()=>t.getAttribute("baseheadinglevel"),e=null!=s?s:i());const n=parseInt(e,10);if(Number.isFinite(n)&&n>=1&&n<=6)return n}var s,i}class I extends HTMLElement{constructor(){super(),I.prototype.__init.call(this),this._model={passages:[]},this._session=null,this._root=null,this._mathObserver=null,this._mathRenderPending=!1,this._playerObserver=null}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t)}__init(){this._scheduleMathRender=()=>{this._mathRenderPending||(this._mathRenderPending=!0,requestAnimationFrame(()=>{this._mathObserver&&this._mathObserver.disconnect(),S(this),this._mathRenderPending=!1,setTimeout(()=>{this._mathObserver&&this._mathObserver.observe(this,{childList:!0,subtree:!0})},50)}))}}_initMathObserver(){this._mathObserver||(this._mathObserver=new MutationObserver(this._scheduleMathRender),this._mathObserver.observe(this,{childList:!0,subtree:!0}))}_disconnectMathObserver(){this._mathObserver&&(this._mathObserver.disconnect(),this._mathObserver=null)}set model(e){this._model=e,this.dispatchEvent(new d(this.tagName.toLowerCase(),this._session,!!this._model)),this.setLangAttribute(),this._render()}set session(e){this._session=e}connectedCallback(){this.setAttribute("aria-label","Passage"),this.setAttribute("role","region"),this._initMathObserver(),this._initPlayerObserver(),this._render()}_render(){const{passages:e=[]}=this._model;if(this._model.passages.length>0){const t=e.map((e,t)=>({id:t,...e})),s=P.createElement(L,{tabs:t,model:this._model,baseHeadingLevel:A(this)});this._root||(this._root=z(this)),this._root.render(s),this._initMathObserver()}}_initPlayerObserver(){const e=this.closest("pie-player")||this.closest("pie-item-player");e&&(this._playerObserver=new MutationObserver(()=>{this._render()}),this._playerObserver.observe(e,{attributes:!0,attributeFilter:["base-heading-level"]}))}_disconnectPlayerObserver(){this._playerObserver&&(this._playerObserver.disconnect(),this._playerObserver=null)}disconnectedCallback(){this._disconnectMathObserver(),this._disconnectPlayerObserver(),this._root&&(this._root.unmount(),this._root=null)}}export{I as default};
package/module/index.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/passage@7.1.0-next.1</title>
5
+ <title>@pie-element/passage@7.3.5</title>
6
6
  <script
7
7
  type="module"
8
8
  src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@pie-element/passage",
3
- "version": "7.1.0-next.1",
3
+ "version": "7.3.5",
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/shared-module",
7
- "version": "^5.1.1"
7
+ "version": "6.0.0"
8
8
  }
9
9
  ]
10
10
  }
package/module/print.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/passage@7.1.0-next.1</title>
5
+ <title>@pie-element/passage@7.3.5</title>
6
6
  <link
7
7
  href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
8
  rel="stylesheet"
package/module/print.js CHANGED
@@ -1 +1 @@
1
- import{_dll_react as e,_dll_prop_types as t,_dll_mui__material as n,_dll_mui__material_styles as r,_dll_pie_lib__render_ui as a,_dll_debug as i,_dll_react_dom_client as o}from"../../../@pie-lib/shared-module@^5.1.1/module/index.js";var s="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,c=s||l||Function("return this")(),u=c.Symbol,d=Object.prototype,p=d.hasOwnProperty,b=d.toString,h=u?u.toStringTag:void 0;var m=Object.prototype.toString;var f=u?u.toStringTag:void 0;function g(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":f&&f in Object(e)?function(e){var t=p.call(e,h),n=e[h];try{e[h]=void 0;var r=!0}catch(e){}var a=b.call(e);return r&&(t?e[h]=n:delete e[h]),a}(e):function(e){return m.call(e)}(e)}var v=/\s/;var y=/^\s+/;function _(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&v.test(e.charAt(t)););return t}(e)+1).replace(y,""):e}function x(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var E=/^[-+]0x[0-9a-f]+$/i,T=/^0b[01]+$/i,k=/^0o[0-7]+$/i,S=parseInt;function C(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==g(e)}(e))return NaN;if(x(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=x(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=_(e);var n=T.test(e);return n||k.test(e)?S(e.slice(2),n?2:8):E.test(e)?NaN:+e}var I=function(){return c.Date.now()},M=Math.max,w=Math.min;function j(e,t,n){var r,a,i,o,s,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=r,i=a;return r=a=void 0,c=t,o=e.apply(i,n)}function h(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function m(){var e=I();if(h(e))return f(e);s=setTimeout(m,function(e){var n=t-(e-l);return d?w(n,i-(e-c)):n}(e))}function f(e){return s=void 0,p&&r?b(e):(r=a=void 0,o)}function g(){var e=I(),n=h(e);if(r=arguments,a=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(m,t),u?b(e):o}(l);if(d)return clearTimeout(s),s=setTimeout(m,t),b(l)}return void 0===s&&(s=setTimeout(m,t)),o}return t=C(t)||0,x(n)&&(u=!!n.leading,i=(d="maxWait"in n)?M(C(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),g.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=a=s=void 0},g.flush=function(){return void 0===s?o:f(I())},g}const H=e,L=t,{Tabs:R}=n,{Tab:A}=n,{styled:N}=r,{Collapsible:O}=a,{color:$}=a,{PreviewPrompt:q}=a,{Purpose:D}=a,{UiLayout:P}=a,{transformDataHeadings:z}=a;const F=N("div")({flexGrow:1,backgroundColor:$.background(),color:$.text(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),J=N("div")(({theme:e})=>({backgroundColor:$.background(),color:$.text(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),K=N("div")({fontSize:"1.75rem"}),U=N("div")({fontSize:"1.5rem"}),W=N("div")({fontSize:"1.25rem"}),B=N(A)(({theme:e})=>({background:e.palette.common.white,fontSize:"inherit",fontFamily:"Roboto, sans-serif",opacity:.7,color:e.palette.common.black,"&.Mui-selected":{opacity:1,color:e.palette.common.black}}));class G extends H.Component{constructor(...e){super(...e),G.prototype.__init.call(this),G.prototype.__init2.call(this),G.prototype.__init3.call(this),G.prototype.__init4.call(this)}__init(){this.state={activeTab:0}}__init2(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init3(){this.handleKeyDown=(e,t)=>{const{key:n}=e,{tabs:r}=this.props;let a=-1;const i=r.findIndex(e=>e.id===t);switch(n){case"ArrowRight":a=(i+1)%r.length;break;case"ArrowLeft":a=(i-1+r.length)%r.length;break;case"Home":a=0;break;case"End":a=r.length-1;break;case"Enter":case" ":a=i}-1!==a&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,r[a].id),document.getElementById(`button-${r[a].id}`).focus())}}__init4(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const n=t.querySelector("audio");if(n){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",n.getAttribute("src")),n.removeAttribute("src"),n.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const n=H.createElement(q,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?n:H.createElement(O,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},n)}renderTab(e,t){const{baseHeadingLevel:n}=this.props,r=n?Math.min(6,Math.max(1,n)):void 0,a=n?`h${r}`:"h2",i=n?Math.min(6,Math.max(1,r+1)):void 0;return H.createElement(J,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&H.createElement(D,{purpose:"passage-title"},H.createElement(a,null,H.createElement(K,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&H.createElement(D,{purpose:"passage-subtitle"},H.createElement(U,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&H.createElement(D,{purpose:"passage-author"},H.createElement(W,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&H.createElement(D,{purpose:"passage-text"},H.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:n?z(e.text,i):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:n}=this.props,{activeTab:r}=this.state;if(!function(e){let t,n=e[0],r=1;for(;r<e.length;){const a=e[r],i=e[r+1];if(r+=2,("optionalAccess"===a||"optionalCall"===a)&&null==n)return;"access"===a||"optionalAccess"===a?(t=n,n=i(n)):"call"!==a&&"optionalCall"!==a||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:a}=e||{},i=(t||[]).find(e=>e.id===r);return H.createElement(P,{extraCSSRules:a},H.createElement(F,{className:"passages"},n||1===t.length?t.map(e=>this.renderTab(e,n)):H.createElement(H.Fragment,null,H.createElement(R,{sx:{position:"sticky",top:0,background:$.background(),color:$.text(),fontFamily:"Roboto, sans-serif","& .MuiTabs-indicator":{backgroundColor:"#f50057"}},value:r,onChange:this.handleChange},t.map(e=>H.createElement(B,{key:e.id,id:`button-${e.id}`,label:H.createElement(D,{purpose:"passage-label"},H.createElement("span",{dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),value:e.id,tabIndex:r===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":r===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),i?this.renderTab(i,n):null)))}}G.propTypes={tabs:L.arrayOf(L.shape({id:L.number.isRequired,label:L.string.isRequired,title:L.string.isRequired,subtitle:L.string,author:L.string,text:L.string.isRequired,teacherInstructions:L.string}).isRequired).isRequired,disabledTabs:L.bool,model:L.object,baseHeadingLevel:L.number};const Q=e,{createRoot:V}=o,X=i("pie-element:passage:print"),Y=(e,t)=>(e=>null!=e)(e)?e:t;class Z extends HTMLElement{constructor(){super(),this._model=null,this._options=null,this._session=[],this._root=null,this._rerender=j(()=>{if(this._model&&this._session){if(this._model.passages&&this._model.passages.length>0){const e=((e,t)=>{const n="instructor"===t.role,r=Y(e.teacherInstructionsEnabled,!0),a=Y(e.titleEnabled,!0),i=Y(e.authorEnabled,!1),o=Y(e.subtitleEnabled,!0),s=Y(e.textEnabled,!0);return e.passages.map((e,t)=>({id:t,teacherInstructions:Y(e.teacherInstructionsEnabled,r)&&n&&e.teacherInstructions||"",label:e.title||`Passage ${t+1}`,title:Y(e.titleEnabled,a)&&e.title||"",author:Y(e.authorEnabled,i)&&e.author||"",subtitle:Y(e.subtitleEnabled,o)&&e.subtitle||"",text:Y(e.textEnabled,s)&&e.text||""}))})(this._model,this._options),t=Q.createElement(G,{disabledTabs:!0,tabs:e});this._root||(this._root=V(this)),this._root.render(t)}}else X("skip")},50,{leading:!1,trailing:!0})}set model(e){this._model=e,this._rerender()}set options(e){this._options=e}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{Z as default};
1
+ import{_dll_react as e,_dll_prop_types as t,_dll_mui__material as n,_dll_mui__material_styles as i,_dll_pie_lib__render_ui as r,_dll_debug as a,_dll_react_dom_client as o}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";var s="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,c=s||l||Function("return this")(),d=c.Symbol,u=Object.prototype,p=u.hasOwnProperty,h=u.toString,b=d?d.toStringTag:void 0;var m=Object.prototype.toString;var g=d?d.toStringTag:void 0;function f(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":g&&g in Object(e)?function(e){var t=p.call(e,b),n=e[b];try{e[b]=void 0;var i=!0}catch(e){}var r=h.call(e);return i&&(t?e[b]=n:delete e[b]),r}(e):function(e){return m.call(e)}(e)}var v=/\s/;var x=/^\s+/;function y(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&v.test(e.charAt(t)););return t}(e)+1).replace(x,""):e}function _(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var E=/^[-+]0x[0-9a-f]+$/i,T=/^0b[01]+$/i,w=/^0o[0-7]+$/i,k=parseInt;function C(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==f(e)}(e))return NaN;if(_(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=_(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=y(e);var n=T.test(e);return n||w.test(e)?k(e.slice(2),n?2:8):E.test(e)?NaN:+e}var S=function(){return c.Date.now()},M=Math.max,R=Math.min;function I(e,t,n){var i,r,a,o,s,l,c=0,d=!1,u=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=i,a=r;return i=r=void 0,c=t,o=e.apply(a,n)}function b(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-c>=a}function m(){var e=S();if(b(e))return g(e);s=setTimeout(m,function(e){var n=t-(e-l);return u?R(n,a-(e-c)):n}(e))}function g(e){return s=void 0,p&&i?h(e):(i=r=void 0,o)}function f(){var e=S(),n=b(e);if(i=arguments,r=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(m,t),d?h(e):o}(l);if(u)return clearTimeout(s),s=setTimeout(m,t),h(l)}return void 0===s&&(s=setTimeout(m,t)),o}return t=C(t)||0,_(n)&&(d=!!n.leading,a=(u="maxWait"in n)?M(C(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),f.cancel=function(){void 0!==s&&clearTimeout(s),c=0,i=l=r=s=void 0},f.flush=function(){return void 0===s?o:g(S())},f}const O=e,z=t,{Tabs:$}=n,{Tab:j}=n,{styled:L}=i,{Collapsible:W}=r,{color:N}=r,{PreviewPrompt:H}=r,{Purpose:A}=r,{UiLayout:q}=r,{transformDataHeadings:D}=r;const P=()=>{if("undefined"==typeof window)return 1;const e=window.outerWidth/window.innerWidth,t=Number.isFinite(e)&&e>0?e:1;return Math.max(.4,Math.min(1,2/t))},F=L("div")({flexGrow:1,backgroundColor:N.background(),color:N.text(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),B=L("div")(({theme:e})=>({backgroundColor:N.background(),color:N.text(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),G=L("div")({fontSize:"1.75rem"}),J=L("div")({fontSize:"1.5rem"}),K=L("div")({fontSize:"1.25rem"}),U=L(j)(({theme:e})=>({background:N.background(),fontSize:"inherit",fontFamily:"Roboto, sans-serif",color:N.text(),borderRadius:`${e.spacing(2)} ${e.spacing(2)} 0 0`,border:`1px solid ${N.borderGray()}`,borderBottomWidth:0,minHeight:"56px",padding:"8px 10px",display:"flex",alignItems:"center",justifyContent:"center",margin:`0 ${e.spacing(1)}`,textTransform:"none",".passage-label":{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",margin:"auto 0",opacity:.7},"&.Mui-selected":{color:N.text(),".passage-label":{opacity:1},".passage-label-underline":{backgroundColor:N.tertiary()}},"&:hover":{".passage-label-underline":{backgroundColor:N.tertiaryLight()}},"& .MuiTouchRipple-root":{opacity:.7}})),Z=L("div")(()=>({height:"2px",width:"100%",marginTop:"6px",background:N.background()}));class Q extends O.Component{constructor(...e){super(...e),Q.prototype.__init.call(this),Q.prototype.__init2.call(this),Q.prototype.__init3.call(this),Q.prototype.__init4.call(this),Q.prototype.__init5.call(this),Q.prototype.__init6.call(this),Q.prototype.__init7.call(this)}__init(){this.state={activeTab:0,zoomCompensation:P(),containerWidth:0}}__init2(){this.containerRef=O.createRef()}componentDidMount(){"undefined"!=typeof window&&(window.addEventListener("resize",this.updateZoomCompensation),this.containerRef.current&&"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.updateContainerWidth),this.resizeObserver.observe(this.containerRef.current)),this.updateContainerWidth())}componentWillUnmount(){"undefined"!=typeof window&&(window.removeEventListener("resize",this.updateZoomCompensation),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null))}__init3(){this.updateZoomCompensation=()=>{this.setState({zoomCompensation:P()})}}__init4(){this.updateContainerWidth=()=>{const e=this.containerRef.current;if(!e)return;const t=e.clientWidth;t!==this.state.containerWidth&&this.setState({containerWidth:t})}}__init5(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init6(){this.handleKeyDown=(e,t)=>{const{key:n}=e,{tabs:i}=this.props;let r=-1;const a=i.findIndex(e=>e.id===t);switch(n){case"ArrowRight":r=(a+1)%i.length;break;case"ArrowLeft":r=(a-1+i.length)%i.length;break;case"Home":r=0;break;case"End":r=i.length-1;break;case"Enter":case" ":r=a}-1!==r&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,i[r].id),document.getElementById(`button-${i[r].id}`).focus())}}__init7(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const n=t.querySelector("audio");if(n){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",n.getAttribute("src")),n.removeAttribute("src"),n.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const n=O.createElement(H,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?n:O.createElement(W,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},n)}renderTab(e,t){const{baseHeadingLevel:n}=this.props,i=n?Math.min(6,Math.max(1,n)):void 0,r=n?`h${i}`:"h2",a=n?Math.min(6,Math.max(1,i+1)):void 0;return O.createElement(B,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&O.createElement(A,{purpose:"passage-title"},O.createElement(r,null,O.createElement(G,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&O.createElement(A,{purpose:"passage-subtitle"},O.createElement(J,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&O.createElement(A,{purpose:"passage-author"},O.createElement(K,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&O.createElement(A,{purpose:"passage-text"},O.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:n?D(e.text,a):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:n}=this.props,{activeTab:i,zoomCompensation:r,containerWidth:a}=this.state;if(!function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],a=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=a(n)):"call"!==r&&"optionalCall"!==r||(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:o}=e||{},s=(t||[]).find(e=>e.id===i),l=a>0?a/t.length:null,c=a>0&&a<=170*t.length;return O.createElement(q,{extraCSSRules:o},O.createElement(F,{className:"passages",ref:this.containerRef},n||1===t.length?t.map(e=>this.renderTab(e,n)):O.createElement(O.Fragment,null,O.createElement($,{sx:{position:"static","@media (min-width: 841px)":{position:"sticky",top:0,zIndex:1},background:"var(--pie-passage-header-background, rgba(255,255,255,0))",color:N.text(),fontFamily:"Roboto, sans-serif",zoom:r,"& .MuiTabs-list":{backgroundColor:`var(--pie-passage-header-background, ${N.backgroundDark()})`,borderBottom:`1px solid ${N.borderGray()}`},"& .MuiTabs-indicator":{backgroundColor:N.white(),marginBottom:"-1px"}},value:i,onChange:this.handleChange},t.map((e,t)=>O.createElement(U,{key:e.id,id:`button-${e.id}`,sx:l?{maxWidth:`${l}px`}:void 0,label:O.createElement(O.Fragment,null,O.createElement(A,{purpose:"passage-label"},c?O.createElement("span",{className:"passage-label"},`Passage ${t+1}`):O.createElement("span",{className:"passage-label",dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),O.createElement(Z,{className:"passage-label-underline"})),value:e.id,tabIndex:i===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":i===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),s?this.renderTab(s,n):null)))}}Q.propTypes={tabs:z.arrayOf(z.shape({id:z.number.isRequired,label:z.string.isRequired,title:z.string.isRequired,subtitle:z.string,author:z.string,text:z.string.isRequired,teacherInstructions:z.string}).isRequired).isRequired,disabledTabs:z.bool,model:z.object,baseHeadingLevel:z.number};const V=e,{createRoot:X}=o,Y=a("pie-element:passage:print"),ee=(e,t)=>(e=>null!=e)(e)?e:t;class te extends HTMLElement{constructor(){super(),this._model=null,this._options=null,this._session=[],this._root=null,this._rerender=I(()=>{if(this._model&&this._session){if(this._model.passages&&this._model.passages.length>0){const e=((e,t)=>{const n="instructor"===t.role,i=ee(e.teacherInstructionsEnabled,!0),r=ee(e.titleEnabled,!0),a=ee(e.authorEnabled,!1),o=ee(e.subtitleEnabled,!0),s=ee(e.textEnabled,!0);return e.passages.map((e,t)=>({id:t,teacherInstructions:ee(e.teacherInstructionsEnabled,i)&&n&&e.teacherInstructions||"",label:e.title||`Passage ${t+1}`,title:ee(e.titleEnabled,r)&&e.title||"",author:ee(e.authorEnabled,a)&&e.author||"",subtitle:ee(e.subtitleEnabled,o)&&e.subtitle||"",text:ee(e.textEnabled,s)&&e.text||""}))})(this._model,this._options),t=V.createElement(Q,{disabledTabs:!0,tabs:e});this._root||(this._root=X(this)),this._root.render(t)}}else Y("skip")},50,{leading:!1,trailing:!0})}set model(e){this._model=e,this._rerender()}set options(e){this._options=e}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{te as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/passage",
3
3
  "repository": "pie-framework/pie-elements",
4
- "version": "7.4.0-beta.7",
4
+ "version": "7.4.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -15,12 +15,12 @@
15
15
  "@mui/material": "^7.3.4",
16
16
  "@pie-framework/pie-player-events": "^0.1.0",
17
17
  "@pie-lib/math-rendering": "5.1.0",
18
- "@pie-lib/render-ui": "6.1.3",
18
+ "@pie-lib/render-ui": "7.0.0",
19
19
  "prop-types": "^15.8.1",
20
20
  "react": "18.3.1",
21
21
  "react-dom": "18.3.1"
22
22
  },
23
- "gitHead": "d2f4f1399d7b3de92e40140599e016b97ae1ccaa",
23
+ "gitHead": "e299866c75466c3c3f12469e783c129c800f24fb",
24
24
  "scripts": {
25
25
  "postpublish": "../../scripts/postpublish"
26
26
  },