@pie-lib/text-select 1.14.0-beta.0 → 1.14.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.json +1 -632
- package/CHANGELOG.md +122 -30
- package/package.json +6 -6
- package/src/index.js +1 -2
- package/src/legend.js +55 -37
- package/src/token-select/__tests__/__snapshots__/token.test.jsx.snap +2 -6
- package/src/token-select/token.jsx +96 -61
- package/src/tokenizer/controls.jsx +7 -7
- package/lib/__tests__/text-select.test.js +0 -56
- package/lib/__tests__/utils.test.js +0 -23
- package/lib/index.js +0 -76
- package/lib/legend.js +0 -99
- package/lib/text-select.js +0 -138
- package/lib/token-select/__tests__/index.test.js +0 -268
- package/lib/token-select/__tests__/token.test.js +0 -35
- package/lib/token-select/index.js +0 -250
- package/lib/token-select/token.js +0 -230
- package/lib/tokenizer/__tests__/builder.test.js +0 -399
- package/lib/tokenizer/__tests__/controls.test.js +0 -34
- package/lib/tokenizer/__tests__/index.test.js +0 -210
- package/lib/tokenizer/__tests__/selection-utils.test.js +0 -27
- package/lib/tokenizer/__tests__/token-text.test.js +0 -154
- package/lib/tokenizer/builder.js +0 -311
- package/lib/tokenizer/controls.js +0 -137
- package/lib/tokenizer/index.js +0 -205
- package/lib/tokenizer/selection-utils.js +0 -65
- package/lib/tokenizer/token-text.js +0 -209
- package/lib/utils.js +0 -67
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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
|
-
# [1.14.0
|
|
6
|
+
# [1.14.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.14.0) (2025-07-31)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
# [1.
|
|
14
|
+
# [1.15.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.15.0) (2025-07-31)
|
|
15
15
|
|
|
16
16
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
# [1.14.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.14.0) (2025-07-31)
|
|
23
23
|
|
|
24
24
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
25
25
|
|
|
@@ -27,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
# [1.13.0-beta.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.8) (2025-07-25)
|
|
31
31
|
|
|
32
32
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
33
33
|
|
|
@@ -35,7 +35,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
# [1.13.0-beta.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.7) (2025-07-25)
|
|
39
39
|
|
|
40
40
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
41
41
|
|
|
@@ -43,7 +43,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
# [1.13.0-beta.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.7) (2025-07-25)
|
|
47
47
|
|
|
48
48
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
49
49
|
|
|
@@ -51,7 +51,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
# [1.13.0-beta.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.6) (2025-07-25)
|
|
55
55
|
|
|
56
56
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
57
57
|
|
|
@@ -59,7 +59,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
# [1.13.0-beta.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.6) (2025-07-25)
|
|
63
63
|
|
|
64
64
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
65
65
|
|
|
@@ -67,7 +67,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
# [1.13.0-beta.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.5) (2025-07-25)
|
|
71
71
|
|
|
72
72
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
73
73
|
|
|
@@ -75,18 +75,23 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
|
|
78
|
-
# [1.
|
|
78
|
+
# [1.13.0-beta.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.5) (2025-07-25)
|
|
79
79
|
|
|
80
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
80
81
|
|
|
81
|
-
### Features
|
|
82
82
|
|
|
83
|
-
* **translator, text-select:** add translations for new text-select legend PD-3162 ([20ee2c1](https://github.com/pie-framework/pie-lib/commit/20ee2c17873985fa06b4b58cf781742a5923b532))
|
|
84
83
|
|
|
85
84
|
|
|
86
85
|
|
|
86
|
+
# [1.13.0-beta.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.4) (2025-07-25)
|
|
87
|
+
|
|
88
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
87
89
|
|
|
88
90
|
|
|
89
|
-
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
# [1.13.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.3) (2025-07-25)
|
|
90
95
|
|
|
91
96
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
92
97
|
|
|
@@ -94,19 +99,23 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
94
99
|
|
|
95
100
|
|
|
96
101
|
|
|
97
|
-
|
|
102
|
+
# [1.13.0-beta.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.4) (2025-07-23)
|
|
103
|
+
|
|
104
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
98
105
|
|
|
99
106
|
|
|
100
|
-
### Bug Fixes
|
|
101
107
|
|
|
102
|
-
* **text-select:** PD-3117 - avoids tokens overlapping in eval mode ([728c242](https://github.com/pie-framework/pie-lib/commit/728c24274c726907de568600b074305a145320ca))
|
|
103
|
-
* **text-select:** PD-3134 replace typography with span to prevent materialui from overwriting styling ([a9c4860](https://github.com/pie-framework/pie-lib/commit/a9c4860701355e3e6b33145414658da06ba5a5a3))
|
|
104
108
|
|
|
105
109
|
|
|
110
|
+
# [1.13.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.3) (2025-07-23)
|
|
111
|
+
|
|
112
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
113
|
+
|
|
106
114
|
|
|
107
115
|
|
|
108
116
|
|
|
109
|
-
|
|
117
|
+
|
|
118
|
+
# [1.13.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.3) (2025-07-20)
|
|
110
119
|
|
|
111
120
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
112
121
|
|
|
@@ -114,32 +123,31 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
114
123
|
|
|
115
124
|
|
|
116
125
|
|
|
117
|
-
# [1.
|
|
126
|
+
# [1.13.0-beta.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.2) (2025-07-20)
|
|
127
|
+
|
|
128
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
118
129
|
|
|
119
130
|
|
|
120
|
-
### Features
|
|
121
131
|
|
|
122
|
-
* **text-select:** PD-1163 - add legend for icons used in eval mode ([7b2bac2](https://github.com/pie-framework/pie-lib/commit/7b2bac262d29986db2ce57ff6cee6c04af08472a))
|
|
123
132
|
|
|
124
133
|
|
|
134
|
+
# [1.13.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.1) (2025-07-20)
|
|
125
135
|
|
|
136
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
126
137
|
|
|
127
138
|
|
|
128
|
-
# [1.10.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.9.29...@pie-lib/text-select@1.10.0) (2023-08-15)
|
|
129
139
|
|
|
130
140
|
|
|
131
|
-
### Features
|
|
132
141
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
* **text-select:** PD-1163 updates to tokens in text select ([2535c91](https://github.com/pie-framework/pie-lib/commit/2535c911f378f4cf41c8471bfa1898b996ffacee))
|
|
142
|
+
# [1.13.0-beta.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.2) (2025-07-20)
|
|
143
|
+
|
|
144
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
137
145
|
|
|
138
146
|
|
|
139
147
|
|
|
140
148
|
|
|
141
149
|
|
|
142
|
-
|
|
150
|
+
# [1.13.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.1) (2025-07-20)
|
|
143
151
|
|
|
144
152
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
145
153
|
|
|
@@ -147,7 +155,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
147
155
|
|
|
148
156
|
|
|
149
157
|
|
|
150
|
-
|
|
158
|
+
# [1.13.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.1) (2025-07-20)
|
|
151
159
|
|
|
152
160
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
153
161
|
|
|
@@ -155,7 +163,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
155
163
|
|
|
156
164
|
|
|
157
165
|
|
|
158
|
-
|
|
166
|
+
# [1.13.0-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.0) (2025-07-20)
|
|
159
167
|
|
|
160
168
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
161
169
|
|
|
@@ -163,6 +171,90 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
163
171
|
|
|
164
172
|
|
|
165
173
|
|
|
174
|
+
# [1.14.0-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.14.0-beta.0) (2025-07-15)
|
|
175
|
+
|
|
176
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
177
|
+
|
|
178
|
+
# [1.13.0-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.13.0-beta.0) (2025-07-15)
|
|
179
|
+
|
|
180
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
181
|
+
|
|
182
|
+
## [1.12.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.6...@pie-lib/text-select@1.12.7) (2023-10-03)
|
|
183
|
+
|
|
184
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
185
|
+
|
|
186
|
+
## [1.12.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.5...@pie-lib/text-select@1.12.6) (2023-10-01)
|
|
187
|
+
|
|
188
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
189
|
+
|
|
190
|
+
## [1.12.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.4...@pie-lib/text-select@1.12.5) (2023-09-27)
|
|
191
|
+
|
|
192
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
193
|
+
|
|
194
|
+
## [1.12.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.3...@pie-lib/text-select@1.12.4) (2023-09-27)
|
|
195
|
+
|
|
196
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
197
|
+
|
|
198
|
+
## [1.12.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.2...@pie-lib/text-select@1.12.3) (2023-09-25)
|
|
199
|
+
|
|
200
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
201
|
+
|
|
202
|
+
## [1.12.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.1...@pie-lib/text-select@1.12.2) (2023-09-20)
|
|
203
|
+
|
|
204
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
205
|
+
|
|
206
|
+
## [1.12.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.0...@pie-lib/text-select@1.12.1) (2023-09-20)
|
|
207
|
+
|
|
208
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
209
|
+
|
|
210
|
+
# [1.12.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.11.3...@pie-lib/text-select@1.12.0) (2023-09-18)
|
|
211
|
+
|
|
212
|
+
### Features
|
|
213
|
+
|
|
214
|
+
- **translator, text-select:** add translations for new text-select legend PD-3162 ([20ee2c1](https://github.com/pie-framework/pie-lib/commit/20ee2c17873985fa06b4b58cf781742a5923b532))
|
|
215
|
+
|
|
216
|
+
## [1.11.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.11.2...@pie-lib/text-select@1.11.3) (2023-09-14)
|
|
217
|
+
|
|
218
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
219
|
+
|
|
220
|
+
## [1.11.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.11.1...@pie-lib/text-select@1.11.2) (2023-08-29)
|
|
221
|
+
|
|
222
|
+
### Bug Fixes
|
|
223
|
+
|
|
224
|
+
- **text-select:** PD-3117 - avoids tokens overlapping in eval mode ([728c242](https://github.com/pie-framework/pie-lib/commit/728c24274c726907de568600b074305a145320ca))
|
|
225
|
+
- **text-select:** PD-3134 replace typography with span to prevent materialui from overwriting styling ([a9c4860](https://github.com/pie-framework/pie-lib/commit/a9c4860701355e3e6b33145414658da06ba5a5a3))
|
|
226
|
+
|
|
227
|
+
## [1.11.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.11.0...@pie-lib/text-select@1.11.1) (2023-08-21)
|
|
228
|
+
|
|
229
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
230
|
+
|
|
231
|
+
# [1.11.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.10.0...@pie-lib/text-select@1.11.0) (2023-08-16)
|
|
232
|
+
|
|
233
|
+
### Features
|
|
234
|
+
|
|
235
|
+
- **text-select:** PD-1163 - add legend for icons used in eval mode ([7b2bac2](https://github.com/pie-framework/pie-lib/commit/7b2bac262d29986db2ce57ff6cee6c04af08472a))
|
|
236
|
+
|
|
237
|
+
# [1.10.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.9.29...@pie-lib/text-select@1.10.0) (2023-08-15)
|
|
238
|
+
|
|
239
|
+
### Features
|
|
240
|
+
|
|
241
|
+
- **text-select:** adjust colors and alignment of the color ([a51ba55](https://github.com/pie-framework/pie-lib/commit/a51ba5547f6e1559915d6ea967d406923831b561))
|
|
242
|
+
- **text-select:** PD-1163 create wrapper component ([b41db39](https://github.com/pie-framework/pie-lib/commit/b41db39ade332d19dca70a06d54acf51b5888c69))
|
|
243
|
+
- **text-select:** PD-1163 update snapshots ([6b8edf8](https://github.com/pie-framework/pie-lib/commit/6b8edf83b763abdd93eee2655be3600cef90586b))
|
|
244
|
+
- **text-select:** PD-1163 updates to tokens in text select ([2535c91](https://github.com/pie-framework/pie-lib/commit/2535c911f378f4cf41c8471bfa1898b996ffacee))
|
|
245
|
+
|
|
246
|
+
## [1.9.29](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.9.28...@pie-lib/text-select@1.9.29) (2023-07-24)
|
|
247
|
+
|
|
248
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
249
|
+
|
|
250
|
+
## [1.9.28](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.9.27...@pie-lib/text-select@1.9.28) (2023-06-24)
|
|
251
|
+
|
|
252
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
253
|
+
|
|
254
|
+
## [1.9.27](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.9.26...@pie-lib/text-select@1.9.27) (2023-06-13)
|
|
255
|
+
|
|
256
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
257
|
+
|
|
166
258
|
## [1.9.26](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.9.25...@pie-lib/text-select@1.9.26) (2023-06-12)
|
|
167
259
|
|
|
168
260
|
**Note:** Version bump only for package @pie-lib/text-select
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.14.0
|
|
6
|
+
"version": "1.14.0",
|
|
7
7
|
"description": "Some react components for text selection",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"react",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"author": "",
|
|
18
18
|
"license": "ISC",
|
|
19
19
|
"dependencies": {
|
|
20
|
+
"@material-ui/icons": "^3.0.2",
|
|
20
21
|
"@pie-framework/parse-english": "^1.0.0",
|
|
21
|
-
"@pie-lib/
|
|
22
|
-
"@pie-lib/
|
|
23
|
-
"@pie-lib/translator": "^2.5.0-beta.0",
|
|
22
|
+
"@pie-lib/style-utils": "^0.4.0",
|
|
23
|
+
"@pie-lib/translator": "^2.6.0",
|
|
24
24
|
"classnames": "^2.2.6",
|
|
25
25
|
"debug": "^4.1.1",
|
|
26
26
|
"invariant": "^2.2.4",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@material-ui/core": "^3.8.3",
|
|
33
33
|
"@pie-framework/parse-english": "^1.0.0",
|
|
34
|
-
"@pie-lib/test-utils": "^0.
|
|
34
|
+
"@pie-lib/test-utils": "^0.5.0",
|
|
35
35
|
"natural": "^0.6.3",
|
|
36
36
|
"react": "^16.8.1",
|
|
37
37
|
"react-dom": "^16.9.0"
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
"@material-ui/core": "^3.8.3",
|
|
41
41
|
"react": "^16.8.1"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "889a13bfea2c768b8a3a6eabfc6fe7b7725aa832",
|
|
44
44
|
"scripts": {}
|
|
45
45
|
}
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import Controls from './tokenizer/controls';
|
|
2
1
|
import Tokenizer from './tokenizer';
|
|
3
2
|
import TokenSelect, { TokenTypes } from './token-select';
|
|
4
3
|
import TextSelect from './text-select';
|
|
@@ -6,4 +5,4 @@ import { Legend } from './legend';
|
|
|
6
5
|
import Token from './token-select/token';
|
|
7
6
|
import { prepareText } from './utils';
|
|
8
7
|
|
|
9
|
-
export {
|
|
8
|
+
export { TextSelect, TokenTypes, Tokenizer, TokenSelect, Token, prepareText, Legend };
|
package/src/legend.js
CHANGED
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { withStyles } from '@material-ui/core/styles';
|
|
3
3
|
import Check from '@material-ui/icons/Check';
|
|
4
4
|
import Close from '@material-ui/icons/Close';
|
|
5
|
-
import
|
|
6
|
-
import { color } from '@pie-lib/render-ui';
|
|
5
|
+
import { color } from '../../render-ui/src/index';
|
|
7
6
|
import Translator from '@pie-lib/translator';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
8
|
|
|
9
9
|
const { translator } = Translator;
|
|
10
10
|
|
|
@@ -12,6 +12,7 @@ export const Legend = withStyles((theme) => ({
|
|
|
12
12
|
flexContainer: {
|
|
13
13
|
display: 'flex',
|
|
14
14
|
flexDirection: 'row',
|
|
15
|
+
alignItems: 'center',
|
|
15
16
|
gap: `${2 * theme.spacing.unit}px`,
|
|
16
17
|
borderBottom: '1px solid lightgrey',
|
|
17
18
|
borderTop: '1px solid lightgrey',
|
|
@@ -19,60 +20,77 @@ export const Legend = withStyles((theme) => ({
|
|
|
19
20
|
paddingTop: theme.spacing.unit,
|
|
20
21
|
marginBottom: theme.spacing.unit,
|
|
21
22
|
},
|
|
23
|
+
key: {
|
|
24
|
+
fontSize: '14px',
|
|
25
|
+
fontWeight: 'bold',
|
|
26
|
+
color: color.black(),
|
|
27
|
+
marginLeft: theme.spacing.unit,
|
|
28
|
+
},
|
|
22
29
|
container: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
position: 'relative',
|
|
31
|
+
padding: '4px',
|
|
32
|
+
fontSize: '14px',
|
|
33
|
+
borderRadius: '4px',
|
|
27
34
|
},
|
|
28
35
|
correct: {
|
|
29
|
-
|
|
30
|
-
color: color.correct(),
|
|
31
|
-
backgroundColor: color.correctSecondary(),
|
|
32
|
-
border: `2px solid ${color.correct()}`,
|
|
36
|
+
border: `${color.correctTertiary()} solid 2px`,
|
|
33
37
|
},
|
|
34
38
|
incorrect: {
|
|
35
|
-
|
|
36
|
-
color: color.missing(),
|
|
37
|
-
backgroundColor: color.incorrectSecondary(),
|
|
38
|
-
border: `2px solid ${color.missing()}`,
|
|
39
|
+
border: `${color.incorrectWithIcon()} solid 2px`,
|
|
39
40
|
},
|
|
40
41
|
missing: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
border: `${color.incorrectWithIcon()} dashed 2px`,
|
|
43
|
+
},
|
|
44
|
+
incorrectIcon: {
|
|
45
|
+
backgroundColor: color.incorrectWithIcon(),
|
|
46
|
+
},
|
|
47
|
+
correctIcon: {
|
|
48
|
+
backgroundColor: color.correctTertiary(),
|
|
45
49
|
},
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
icon: {
|
|
51
|
+
color: color.white(),
|
|
52
|
+
position: 'absolute',
|
|
53
|
+
top: '-8px',
|
|
54
|
+
left: '-8px',
|
|
55
|
+
borderRadius: '50%',
|
|
56
|
+
fontSize: '12px',
|
|
57
|
+
padding: '2px',
|
|
58
|
+
},
|
|
59
|
+
}))(({ classes, language, showOnlyCorrect }) => {
|
|
60
|
+
const legendItems = [
|
|
48
61
|
{
|
|
49
|
-
|
|
62
|
+
Icon: Check,
|
|
50
63
|
label: translator.t('selectText.correctAnswerSelected', { lng: language }),
|
|
51
|
-
|
|
64
|
+
containerClass: classNames(classes.correct, classes.container),
|
|
65
|
+
iconClass: classNames(classes.correctIcon, classes.icon),
|
|
52
66
|
},
|
|
53
67
|
{
|
|
54
|
-
|
|
55
|
-
label: translator.t('selectText.
|
|
56
|
-
|
|
68
|
+
Icon: Close,
|
|
69
|
+
label: translator.t('selectText.incorrectSelection', { lng: language }),
|
|
70
|
+
containerClass: classNames(classes.incorrect, classes.container),
|
|
71
|
+
iconClass: classNames(classes.incorrectIcon, classes.icon),
|
|
57
72
|
},
|
|
58
73
|
{
|
|
59
|
-
|
|
60
|
-
label: translator.t('selectText.
|
|
61
|
-
|
|
74
|
+
Icon: Close,
|
|
75
|
+
label: translator.t('selectText.correctAnswerNotSelected', { lng: language }),
|
|
76
|
+
containerClass: classNames(classes.missing, classes.container),
|
|
77
|
+
iconClass: classNames(classes.incorrectIcon, classes.icon),
|
|
62
78
|
},
|
|
63
79
|
];
|
|
64
80
|
|
|
81
|
+
if (showOnlyCorrect) {
|
|
82
|
+
legendItems.splice(1, 2);
|
|
83
|
+
}
|
|
84
|
+
|
|
65
85
|
return (
|
|
66
86
|
<div className={classes.flexContainer}>
|
|
67
|
-
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
);
|
|
75
|
-
})}
|
|
87
|
+
<span className={classes.key}>{translator.t('selectText.key', { lng: language })}</span>
|
|
88
|
+
{legendItems.map(({ Icon, label, containerClass, iconClass }, idx) => (
|
|
89
|
+
<div key={idx} className={containerClass}>
|
|
90
|
+
<Icon className={iconClass} />
|
|
91
|
+
<span>{label}</span>
|
|
92
|
+
</div>
|
|
93
|
+
))}
|
|
76
94
|
</div>
|
|
77
95
|
);
|
|
78
96
|
});
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`token snapshot renders 1`] = `
|
|
4
|
-
<Wrapper
|
|
5
|
-
useWrapper={false}
|
|
6
|
-
>
|
|
4
|
+
<Wrapper>
|
|
7
5
|
<span
|
|
8
6
|
className="tokenRootClass token"
|
|
9
7
|
dangerouslySetInnerHTML={
|
|
@@ -16,9 +14,7 @@ exports[`token snapshot renders 1`] = `
|
|
|
16
14
|
`;
|
|
17
15
|
|
|
18
16
|
exports[`token snapshot renders with brs 1`] = `
|
|
19
|
-
<Wrapper
|
|
20
|
-
useWrapper={false}
|
|
21
|
-
>
|
|
17
|
+
<Wrapper>
|
|
22
18
|
<span
|
|
23
19
|
className="tokenRootClass token"
|
|
24
20
|
dangerouslySetInnerHTML={
|