@pie-lib/text-select 1.13.1-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 +153 -1
- package/package.json +5 -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 +1 -1
package/CHANGELOG.json
CHANGED
|
@@ -1,632 +1 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"type": "fix",
|
|
4
|
-
"scope": null,
|
|
5
|
-
"subject": "rm child prepack in favour of root prepack",
|
|
6
|
-
"merge": null,
|
|
7
|
-
"header": "fix: rm child prepack in favour of root prepack",
|
|
8
|
-
"body": null,
|
|
9
|
-
"footer": null,
|
|
10
|
-
"notes": [],
|
|
11
|
-
"hash": "381d8d6485269b641d8d4655148966d2e70803be",
|
|
12
|
-
"gitTags": "",
|
|
13
|
-
"committerDate": "2019-03-15 09:51:11 +0000",
|
|
14
|
-
"isTagged": true,
|
|
15
|
-
"tag": "@pie-lib/text-select@1.4.9"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"type": "chore",
|
|
19
|
-
"scope": null,
|
|
20
|
-
"subject": "get packages to call changelog function on prepack",
|
|
21
|
-
"merge": null,
|
|
22
|
-
"header": "chore: get packages to call changelog function on prepack",
|
|
23
|
-
"body": null,
|
|
24
|
-
"footer": null,
|
|
25
|
-
"notes": [],
|
|
26
|
-
"hash": "8828f01f2d16d29404ba837c1de40d09e7230ec5",
|
|
27
|
-
"gitTags": "",
|
|
28
|
-
"committerDate": "2019-03-14 12:40:05 +0000",
|
|
29
|
-
"isTagged": true,
|
|
30
|
-
"tag": "@pie-lib/text-select@1.4.5"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"type": "chore",
|
|
34
|
-
"scope": null,
|
|
35
|
-
"subject": "call changelog on prepack",
|
|
36
|
-
"merge": null,
|
|
37
|
-
"header": "chore: call changelog on prepack",
|
|
38
|
-
"body": null,
|
|
39
|
-
"footer": null,
|
|
40
|
-
"notes": [],
|
|
41
|
-
"hash": "b672c012de096c55b765a765f758da3fc5df2f90",
|
|
42
|
-
"gitTags": "",
|
|
43
|
-
"committerDate": "2019-03-13 23:00:44 +0000",
|
|
44
|
-
"isTagged": true,
|
|
45
|
-
"tag": "@pie-lib/text-select@1.4.4"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"type": "chore",
|
|
49
|
-
"scope": null,
|
|
50
|
-
"subject": "generate changelog.json instead of markdown",
|
|
51
|
-
"merge": null,
|
|
52
|
-
"header": "chore: generate changelog.json instead of markdown",
|
|
53
|
-
"body": null,
|
|
54
|
-
"footer": null,
|
|
55
|
-
"notes": [],
|
|
56
|
-
"hash": "eaa5019a11f70c53425d55856bd3b940237f8c7d",
|
|
57
|
-
"gitTags": "",
|
|
58
|
-
"committerDate": "2019-03-13 17:24:09 +0000",
|
|
59
|
-
"isTagged": true,
|
|
60
|
-
"tag": "@pie-lib/text-select@1.4.2"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"type": "fix",
|
|
64
|
-
"scope": null,
|
|
65
|
-
"subject": "fix tests",
|
|
66
|
-
"merge": null,
|
|
67
|
-
"header": "fix: fix tests",
|
|
68
|
-
"body": null,
|
|
69
|
-
"footer": null,
|
|
70
|
-
"notes": [],
|
|
71
|
-
"hash": "1363aa4540f970c8cdd05ef05c1325de973d22e2",
|
|
72
|
-
"gitTags": "",
|
|
73
|
-
"committerDate": "2019-02-16 23:47:25 +0000",
|
|
74
|
-
"isTagged": true,
|
|
75
|
-
"tag": "@pie-lib/text-select@1.4.1"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"type": "feat",
|
|
79
|
-
"scope": null,
|
|
80
|
-
"subject": "support html markup in TextSelect",
|
|
81
|
-
"merge": null,
|
|
82
|
-
"header": "feat: support html markup in TextSelect",
|
|
83
|
-
"body": "text-select only worked with plain text when rendering because it used\nsafe rendering. This change now does markup up rendering.",
|
|
84
|
-
"footer": null,
|
|
85
|
-
"notes": [],
|
|
86
|
-
"hash": "b3942ed811b05f57e585523a0bac06b0c2f039ce",
|
|
87
|
-
"gitTags": "",
|
|
88
|
-
"committerDate": "2019-02-07 15:24:36 +0000",
|
|
89
|
-
"isTagged": true,
|
|
90
|
-
"tag": "@pie-lib/text-select@1.4.0"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"type": "feat",
|
|
94
|
-
"scope": null,
|
|
95
|
-
"subject": "libs version bump",
|
|
96
|
-
"merge": null,
|
|
97
|
-
"header": "feat: libs version bump",
|
|
98
|
-
"body": null,
|
|
99
|
-
"footer": null,
|
|
100
|
-
"notes": [],
|
|
101
|
-
"hash": "b4c1087c59eaa6a2d67fffec59fa288ecc68de9b",
|
|
102
|
-
"gitTags": "",
|
|
103
|
-
"committerDate": "2019-01-30 22:14:28 +0000",
|
|
104
|
-
"isTagged": true,
|
|
105
|
-
"tag": "@pie-lib/text-select@1.3.0"
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
"type": "fix",
|
|
109
|
-
"scope": "added-dependencies-where-needed",
|
|
110
|
-
"subject": "fixed missing dependencies",
|
|
111
|
-
"merge": null,
|
|
112
|
-
"header": "fix(added-dependencies-where-needed): fixed missing dependencies",
|
|
113
|
-
"body": null,
|
|
114
|
-
"footer": null,
|
|
115
|
-
"notes": [],
|
|
116
|
-
"hash": "7c28bd3f42f7f5803bb9514c9f45d9540a024eb9",
|
|
117
|
-
"gitTags": " (origin/fix/added-dependencies-where-needed)",
|
|
118
|
-
"committerDate": "2018-11-09 16:44:05 +0200",
|
|
119
|
-
"isTagged": true,
|
|
120
|
-
"tag": "@pie-lib/text-select@1.2.3"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"type": "fix",
|
|
124
|
-
"scope": "mode-save",
|
|
125
|
-
"subject": "added some tests and refactored some code",
|
|
126
|
-
"merge": null,
|
|
127
|
-
"header": "fix(mode-save): added some tests and refactored some code",
|
|
128
|
-
"body": null,
|
|
129
|
-
"footer": null,
|
|
130
|
-
"notes": [],
|
|
131
|
-
"hash": "2ffeaca5ddb0abe1e33c8b11b7a6928cd9ee7368",
|
|
132
|
-
"gitTags": "",
|
|
133
|
-
"committerDate": "2018-10-16 12:00:59 +0300",
|
|
134
|
-
"isTagged": true,
|
|
135
|
-
"tag": "@pie-lib/text-select@1.2.2"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
"type": "fix",
|
|
139
|
-
"scope": "mode-save",
|
|
140
|
-
"subject": "added a new state variable that saves the current mode of the tokenizer",
|
|
141
|
-
"merge": null,
|
|
142
|
-
"header": "fix(mode-save): added a new state variable that saves the current mode of the tokenizer",
|
|
143
|
-
"body": null,
|
|
144
|
-
"footer": null,
|
|
145
|
-
"notes": [],
|
|
146
|
-
"hash": "340b4bab2aafade4933c25d877a6a74385684568",
|
|
147
|
-
"gitTags": "",
|
|
148
|
-
"committerDate": "2018-10-15 12:33:16 +0300",
|
|
149
|
-
"isTagged": true,
|
|
150
|
-
"tag": "@pie-lib/text-select@1.2.2"
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
"type": "fix",
|
|
154
|
-
"scope": "add-paragraph",
|
|
155
|
-
"subject": "added a paragraph builder for tokens",
|
|
156
|
-
"merge": null,
|
|
157
|
-
"header": "fix(add-paragraph): added a paragraph builder for tokens",
|
|
158
|
-
"body": null,
|
|
159
|
-
"footer": null,
|
|
160
|
-
"notes": [],
|
|
161
|
-
"hash": "61189c05fbe5ed1f83a739a1a7734cc2bb016944",
|
|
162
|
-
"gitTags": "",
|
|
163
|
-
"committerDate": "2018-10-12 16:40:12 +0300",
|
|
164
|
-
"isTagged": true,
|
|
165
|
-
"tag": "@pie-lib/text-select@1.2.2"
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
"type": "chore",
|
|
169
|
-
"scope": null,
|
|
170
|
-
"subject": "fix tests",
|
|
171
|
-
"merge": null,
|
|
172
|
-
"header": "chore: fix tests",
|
|
173
|
-
"body": null,
|
|
174
|
-
"footer": null,
|
|
175
|
-
"notes": [],
|
|
176
|
-
"hash": "274ab3bdb02b7a1738a861dc7594ca9392943e50",
|
|
177
|
-
"gitTags": "",
|
|
178
|
-
"committerDate": "2018-07-25 10:23:50 -0400",
|
|
179
|
-
"isTagged": true,
|
|
180
|
-
"tag": "@pie-lib/text-select@1.2.1"
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"type": "feat",
|
|
184
|
-
"scope": null,
|
|
185
|
-
"subject": "upgrade material-ui -> @material-ui/core@^1.0.0-rc.1",
|
|
186
|
-
"merge": null,
|
|
187
|
-
"header": "feat: upgrade material-ui -> @material-ui/core@^1.0.0-rc.1",
|
|
188
|
-
"body": null,
|
|
189
|
-
"footer": null,
|
|
190
|
-
"notes": [],
|
|
191
|
-
"hash": "017ef6300f1fd345fc932496d25682a7981a4938",
|
|
192
|
-
"gitTags": "",
|
|
193
|
-
"committerDate": "2018-05-15 21:52:09 -0400",
|
|
194
|
-
"isTagged": true,
|
|
195
|
-
"tag": "@pie-lib/text-select@1.2.0"
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
"type": "fix",
|
|
199
|
-
"scope": "lint",
|
|
200
|
-
"subject": "lint fixes",
|
|
201
|
-
"merge": null,
|
|
202
|
-
"header": "fix(lint): lint fixes",
|
|
203
|
-
"body": null,
|
|
204
|
-
"footer": null,
|
|
205
|
-
"notes": [],
|
|
206
|
-
"hash": "f0595831a75561d829c0f18f86ce5ea7feeb4ddd",
|
|
207
|
-
"gitTags": "",
|
|
208
|
-
"committerDate": "2018-05-09 13:35:42 -0400",
|
|
209
|
-
"isTagged": true,
|
|
210
|
-
"tag": "@pie-lib/text-select@1.1.2"
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
"type": "fix",
|
|
214
|
-
"scope": "test",
|
|
215
|
-
"subject": "fix test run",
|
|
216
|
-
"merge": null,
|
|
217
|
-
"header": "fix(test): fix test run",
|
|
218
|
-
"body": null,
|
|
219
|
-
"footer": null,
|
|
220
|
-
"notes": [],
|
|
221
|
-
"hash": "d15ac94f6b1e4b834930f2d5ac84eb4e8e235d19",
|
|
222
|
-
"gitTags": "",
|
|
223
|
-
"committerDate": "2018-05-09 12:25:29 -0400",
|
|
224
|
-
"isTagged": true,
|
|
225
|
-
"tag": "@pie-lib/text-select@1.1.1"
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
"type": "chore",
|
|
229
|
-
"scope": null,
|
|
230
|
-
"subject": "tidy up",
|
|
231
|
-
"merge": null,
|
|
232
|
-
"header": "chore: tidy up",
|
|
233
|
-
"body": null,
|
|
234
|
-
"footer": null,
|
|
235
|
-
"notes": [],
|
|
236
|
-
"hash": "c8268c95d6b521788813e1c0c638991ca94b9dea",
|
|
237
|
-
"gitTags": "",
|
|
238
|
-
"committerDate": "2018-05-08 16:39:24 -0400",
|
|
239
|
-
"isTagged": true,
|
|
240
|
-
"tag": "@pie-lib/text-select@1.1.0"
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
"type": "chore",
|
|
244
|
-
"scope": "demo",
|
|
245
|
-
"subject": "fix demo",
|
|
246
|
-
"merge": null,
|
|
247
|
-
"header": "chore(demo): fix demo",
|
|
248
|
-
"body": null,
|
|
249
|
-
"footer": null,
|
|
250
|
-
"notes": [],
|
|
251
|
-
"hash": "e5d0f8a0c6044d52710326f6c480b0dc77570577",
|
|
252
|
-
"gitTags": "",
|
|
253
|
-
"committerDate": "2018-05-08 16:38:55 -0400",
|
|
254
|
-
"isTagged": true,
|
|
255
|
-
"tag": "@pie-lib/text-select@1.1.0"
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
"type": "chore",
|
|
259
|
-
"scope": null,
|
|
260
|
-
"subject": "clean up",
|
|
261
|
-
"merge": null,
|
|
262
|
-
"header": "chore: clean up",
|
|
263
|
-
"body": null,
|
|
264
|
-
"footer": null,
|
|
265
|
-
"notes": [],
|
|
266
|
-
"hash": "8cb1e415bb43a0f3109a8efef95a8c4181e71e5c",
|
|
267
|
-
"gitTags": "",
|
|
268
|
-
"committerDate": "2018-05-08 16:32:55 -0400",
|
|
269
|
-
"isTagged": true,
|
|
270
|
-
"tag": "@pie-lib/text-select@1.1.0"
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
"type": "feat",
|
|
274
|
-
"scope": "text-select",
|
|
275
|
-
"subject": "Add new text-select package.",
|
|
276
|
-
"merge": null,
|
|
277
|
-
"header": "feat(text-select): Add new text-select package.",
|
|
278
|
-
"body": "Features:\n* `TextSelect`\n* `TokenSelect`\n* `Tokenizer`",
|
|
279
|
-
"footer": null,
|
|
280
|
-
"notes": [],
|
|
281
|
-
"hash": "3916c1922fa8ab3fe5a58cf35147f73f42d96f7e",
|
|
282
|
-
"gitTags": "",
|
|
283
|
-
"committerDate": "2018-05-08 16:28:33 -0400",
|
|
284
|
-
"isTagged": true,
|
|
285
|
-
"tag": "@pie-lib/text-select@1.1.0"
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
"type": "fix",
|
|
289
|
-
"scope": "text-select",
|
|
290
|
-
"subject": "making use of span wrapper for tokens only where needed and recreated the html as string (issue: previous implementation was breaking the html content)",
|
|
291
|
-
"merge": null,
|
|
292
|
-
"header": "fix(text-select): making use of span wrapper for tokens only where needed and recreated the html as string (issue: previous implementation was breaking the html content)",
|
|
293
|
-
"body": null,
|
|
294
|
-
"footer": null,
|
|
295
|
-
"notes": [],
|
|
296
|
-
"hash": "532adc78de6cb429a521969e2ed9dd4f22f774fd",
|
|
297
|
-
"gitTags": "",
|
|
298
|
-
"committerDate": "2019-03-28 13:14:54 +0200",
|
|
299
|
-
"isTagged": true,
|
|
300
|
-
"tag": "@pie-lib/text-select@1.4.10"
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
"type": "feat",
|
|
304
|
-
"scope": null,
|
|
305
|
-
"subject": "version bumps",
|
|
306
|
-
"merge": null,
|
|
307
|
-
"header": "feat: version bumps",
|
|
308
|
-
"body": null,
|
|
309
|
-
"footer": null,
|
|
310
|
-
"notes": [],
|
|
311
|
-
"hash": "23eb54f95e4b6480e2f8c5b336627a7f3bc2f428",
|
|
312
|
-
"gitTags": "",
|
|
313
|
-
"committerDate": "2019-06-10 15:24:32 +0100",
|
|
314
|
-
"isTagged": true,
|
|
315
|
-
"tag": "@pie-lib/text-select@1.5.0"
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
"type": "chore",
|
|
319
|
-
"scope": "merge",
|
|
320
|
-
"subject": "merged master into this branch",
|
|
321
|
-
"merge": null,
|
|
322
|
-
"header": "chore(merge): merged master into this branch",
|
|
323
|
-
"body": null,
|
|
324
|
-
"footer": null,
|
|
325
|
-
"notes": [],
|
|
326
|
-
"hash": "e7758d577c82c0f39a5bf44556792517cd1ea6b0",
|
|
327
|
-
"gitTags": "",
|
|
328
|
-
"committerDate": "2019-07-02 11:29:52 -0400",
|
|
329
|
-
"isTagged": true,
|
|
330
|
-
"tag": "@pie-lib/text-select@1.5.2"
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
"type": "fix",
|
|
334
|
-
"scope": null,
|
|
335
|
-
"subject": "ch5389: A Select Text item had incorrect text if some of the tokens were defined twice, because in the normalized array there were being added tokens where start value was bigger than the end value of the token.",
|
|
336
|
-
"merge": null,
|
|
337
|
-
"header": "fix: ch5389: A Select Text item had incorrect text if some of the tokens were defined twice, because in the normalized array there were being added tokens where start value was bigger than the end value of the token.",
|
|
338
|
-
"body": null,
|
|
339
|
-
"footer": null,
|
|
340
|
-
"notes": [],
|
|
341
|
-
"hash": "75ab455778ff5b4fd106526aada329228208570d",
|
|
342
|
-
"gitTags": " (origin/andreea/ch5389/a-select-text-item-has-incorrect-text-apparently)",
|
|
343
|
-
"committerDate": "2019-12-05 14:42:22 +0200",
|
|
344
|
-
"isTagged": true,
|
|
345
|
-
"tag": "@pie-lib/text-select@1.5.6"
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
"type": "fix",
|
|
349
|
-
"scope": null,
|
|
350
|
-
"subject": "add module prop to package.json",
|
|
351
|
-
"merge": null,
|
|
352
|
-
"header": "fix: add module prop to package.json",
|
|
353
|
-
"body": null,
|
|
354
|
-
"footer": null,
|
|
355
|
-
"notes": [],
|
|
356
|
-
"hash": "946c11820a49ae1dd76ba3b2809f0c4bb99dd0d4",
|
|
357
|
-
"gitTags": "",
|
|
358
|
-
"committerDate": "2020-03-30 13:03:59 +0100",
|
|
359
|
-
"isTagged": true,
|
|
360
|
-
"tag": "@pie-lib/text-select@1.5.11"
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
"type": "fix",
|
|
364
|
-
"scope": null,
|
|
365
|
-
"subject": "correct export syntax",
|
|
366
|
-
"merge": null,
|
|
367
|
-
"header": "fix: correct export syntax",
|
|
368
|
-
"body": null,
|
|
369
|
-
"footer": null,
|
|
370
|
-
"notes": [],
|
|
371
|
-
"hash": "db7fcc0fa1bddf9fc2d304978941db04001ec0ab",
|
|
372
|
-
"gitTags": "",
|
|
373
|
-
"committerDate": "2020-03-30 22:30:10 +0100",
|
|
374
|
-
"isTagged": true,
|
|
375
|
-
"tag": "@pie-lib/text-select@1.5.13"
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
"type": "fix",
|
|
379
|
-
"scope": null,
|
|
380
|
-
"subject": "PD-19: Sentence parser was not working properly - updated the package version.",
|
|
381
|
-
"merge": null,
|
|
382
|
-
"header": "fix: PD-19: Sentence parser was not working properly - updated the package version.",
|
|
383
|
-
"body": null,
|
|
384
|
-
"footer": null,
|
|
385
|
-
"notes": [],
|
|
386
|
-
"hash": "057a88e17603f9d393b8f16c94904d65f9b404b7",
|
|
387
|
-
"gitTags": "",
|
|
388
|
-
"committerDate": "2020-04-21 13:09:37 +0300",
|
|
389
|
-
"isTagged": true,
|
|
390
|
-
"tag": "@pie-lib/text-select@1.5.23"
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
"type": "feat",
|
|
394
|
-
"scope": "text-select",
|
|
395
|
-
"subject": "color theme support - use wider palette",
|
|
396
|
-
"merge": null,
|
|
397
|
-
"header": "feat(text-select): color theme support - use wider palette",
|
|
398
|
-
"body": null,
|
|
399
|
-
"footer": null,
|
|
400
|
-
"notes": [],
|
|
401
|
-
"hash": "2918cdd98d46dd2822950c19445608d8abf6c4cc",
|
|
402
|
-
"gitTags": " (origin/feat/colors)",
|
|
403
|
-
"committerDate": "2020-10-06 20:44:23 +0300",
|
|
404
|
-
"isTagged": true,
|
|
405
|
-
"tag": "@pie-lib/text-select@1.6.0"
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
"type": "feat",
|
|
409
|
-
"scope": "text-select",
|
|
410
|
-
"subject": "add color theme support",
|
|
411
|
-
"merge": null,
|
|
412
|
-
"header": "feat(text-select): add color theme support",
|
|
413
|
-
"body": null,
|
|
414
|
-
"footer": null,
|
|
415
|
-
"notes": [],
|
|
416
|
-
"hash": "8dd94e8206b9277a077b0e6c40954ab4b9428146",
|
|
417
|
-
"gitTags": "",
|
|
418
|
-
"committerDate": "2020-09-24 18:50:27 +0300",
|
|
419
|
-
"isTagged": true,
|
|
420
|
-
"tag": "@pie-lib/text-select@1.6.0"
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
"type": "feat",
|
|
424
|
-
"scope": "text-select",
|
|
425
|
-
"subject": "fix default colors in theme for hover and select",
|
|
426
|
-
"merge": null,
|
|
427
|
-
"header": "feat(text-select): fix default colors in theme for hover and select",
|
|
428
|
-
"body": null,
|
|
429
|
-
"footer": null,
|
|
430
|
-
"notes": [],
|
|
431
|
-
"hash": "f85b8f9585c11389ae0182632cc41d4cd5c082ee",
|
|
432
|
-
"gitTags": " (origin/feat/color-support)",
|
|
433
|
-
"committerDate": "2020-10-26 14:01:51 +0200",
|
|
434
|
-
"isTagged": true,
|
|
435
|
-
"tag": "@pie-lib/text-select@1.7.0"
|
|
436
|
-
},
|
|
437
|
-
{
|
|
438
|
-
"type": "fix",
|
|
439
|
-
"scope": "select-text",
|
|
440
|
-
"subject": "fix text indent styling for tokens",
|
|
441
|
-
"merge": null,
|
|
442
|
-
"header": "fix(select-text): fix text indent styling for tokens",
|
|
443
|
-
"body": null,
|
|
444
|
-
"footer": null,
|
|
445
|
-
"notes": [],
|
|
446
|
-
"hash": "0d13170e2c2daf67ccb9b6ae80cc9223368581a9",
|
|
447
|
-
"gitTags": " (origin/feat/color-support)",
|
|
448
|
-
"committerDate": "2020-10-26 15:30:32 +0200",
|
|
449
|
-
"isTagged": true,
|
|
450
|
-
"tag": "@pie-lib/text-select@1.7.1"
|
|
451
|
-
},
|
|
452
|
-
{
|
|
453
|
-
"type": "fix",
|
|
454
|
-
"scope": null,
|
|
455
|
-
"subject": "Added fix for style changes after selection of max tokens PD-646",
|
|
456
|
-
"merge": null,
|
|
457
|
-
"header": "fix: Added fix for style changes after selection of max tokens PD-646",
|
|
458
|
-
"body": null,
|
|
459
|
-
"footer": null,
|
|
460
|
-
"notes": [],
|
|
461
|
-
"hash": "30183a9aa2524d3487bb2124f6cc487f3f8cefd3",
|
|
462
|
-
"gitTags": "",
|
|
463
|
-
"committerDate": "2020-11-17 13:47:26 +0530",
|
|
464
|
-
"isTagged": true,
|
|
465
|
-
"tag": "@pie-lib/text-select@1.7.3"
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
"type": "fix",
|
|
469
|
-
"scope": "text-select",
|
|
470
|
-
"subject": "fix token rendering issue - PD-642",
|
|
471
|
-
"merge": null,
|
|
472
|
-
"header": "fix(text-select): fix token rendering issue - PD-642",
|
|
473
|
-
"body": null,
|
|
474
|
-
"footer": null,
|
|
475
|
-
"notes": [],
|
|
476
|
-
"hash": "89f3b709b9b1732e6a71ae3aa411d547b7166ac0",
|
|
477
|
-
"gitTags": " (origin/fix/PD-642-line-breaks)",
|
|
478
|
-
"committerDate": "2021-01-18 14:18:09 +0200",
|
|
479
|
-
"isTagged": true,
|
|
480
|
-
"tag": "@pie-lib/text-select@1.7.4"
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
"type": "fix",
|
|
484
|
-
"scope": "text-select",
|
|
485
|
-
"subject": "fix space between lines",
|
|
486
|
-
"merge": null,
|
|
487
|
-
"header": "fix(text-select): fix space between lines",
|
|
488
|
-
"body": null,
|
|
489
|
-
"footer": null,
|
|
490
|
-
"notes": [],
|
|
491
|
-
"hash": "56335373404f08cac617845a19b68b3c5018debd",
|
|
492
|
-
"gitTags": " (origin/fix/text-select-add-line-height)",
|
|
493
|
-
"committerDate": "2021-02-02 12:16:28 +0200",
|
|
494
|
-
"isTagged": true,
|
|
495
|
-
"tag": "@pie-lib/text-select@1.7.10"
|
|
496
|
-
},
|
|
497
|
-
{
|
|
498
|
-
"type": "fix",
|
|
499
|
-
"scope": "text-select",
|
|
500
|
-
"subject": "fix layout for legacy items with line number",
|
|
501
|
-
"merge": null,
|
|
502
|
-
"header": "fix(text-select): fix layout for legacy items with line number",
|
|
503
|
-
"body": null,
|
|
504
|
-
"footer": null,
|
|
505
|
-
"notes": [],
|
|
506
|
-
"hash": "d50865ee7705c3889ec366ada54810334114fbe5",
|
|
507
|
-
"gitTags": " (origin/fix/select-text-with-line-number)",
|
|
508
|
-
"committerDate": "2021-02-25 13:53:20 +0200",
|
|
509
|
-
"isTagged": true,
|
|
510
|
-
"tag": "@pie-lib/text-select@1.7.12"
|
|
511
|
-
},
|
|
512
|
-
{
|
|
513
|
-
"type": "fix",
|
|
514
|
-
"scope": "text-select",
|
|
515
|
-
"subject": "show tokens if they are selected in view mode to fix PD-464",
|
|
516
|
-
"merge": null,
|
|
517
|
-
"header": "fix(text-select): show tokens if they are selected in view mode to fix PD-464",
|
|
518
|
-
"body": null,
|
|
519
|
-
"footer": null,
|
|
520
|
-
"notes": [],
|
|
521
|
-
"hash": "7821536264b822852b12caefcea7b5d84f4c4f03",
|
|
522
|
-
"gitTags": "",
|
|
523
|
-
"committerDate": "2021-02-24 16:38:15 +0200",
|
|
524
|
-
"isTagged": true,
|
|
525
|
-
"tag": "@pie-lib/text-select@1.7.12"
|
|
526
|
-
},
|
|
527
|
-
{
|
|
528
|
-
"type": "fix",
|
|
529
|
-
"scope": "text-select",
|
|
530
|
-
"subject": "fix padding for tokens in order to fix PD-860",
|
|
531
|
-
"merge": null,
|
|
532
|
-
"header": "fix(text-select): fix padding for tokens in order to fix PD-860",
|
|
533
|
-
"body": null,
|
|
534
|
-
"footer": null,
|
|
535
|
-
"notes": [],
|
|
536
|
-
"hash": "eacb81c1f28276b95c75a203515c7c041df39ee7",
|
|
537
|
-
"gitTags": " (origin/fix/select-text-token-padding)",
|
|
538
|
-
"committerDate": "2021-02-23 16:03:46 +0200",
|
|
539
|
-
"isTagged": true,
|
|
540
|
-
"tag": "@pie-lib/text-select@1.7.12"
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
"type": "feat",
|
|
544
|
-
"scope": "text-select",
|
|
545
|
-
"subject": "when select-text item permits only one selection, change behavior of gather PD-958",
|
|
546
|
-
"merge": null,
|
|
547
|
-
"header": "feat(text-select): when select-text item permits only one selection, change behavior of gather PD-958",
|
|
548
|
-
"body": null,
|
|
549
|
-
"footer": null,
|
|
550
|
-
"notes": [],
|
|
551
|
-
"hash": "c1813148b652839635cb67882abeda78c3855235",
|
|
552
|
-
"gitTags": "",
|
|
553
|
-
"committerDate": "2021-05-25 13:31:19 +0300",
|
|
554
|
-
"isTagged": true,
|
|
555
|
-
"tag": "@pie-lib/text-select@1.8.0"
|
|
556
|
-
},
|
|
557
|
-
{
|
|
558
|
-
"type": "fix",
|
|
559
|
-
"scope": "text-select",
|
|
560
|
-
"subject": "fix incorrect indenting PD-1038",
|
|
561
|
-
"merge": null,
|
|
562
|
-
"header": "fix(text-select): fix incorrect indenting PD-1038",
|
|
563
|
-
"body": null,
|
|
564
|
-
"footer": null,
|
|
565
|
-
"notes": [],
|
|
566
|
-
"hash": "4d56509d3411c160328febaafc023aa83ad6e081",
|
|
567
|
-
"gitTags": " (origin/fix/PD-1038/select-text-fix-indentation)",
|
|
568
|
-
"committerDate": "2021-05-20 13:54:09 +0300",
|
|
569
|
-
"isTagged": true,
|
|
570
|
-
"tag": "@pie-lib/text-select@1.8.0"
|
|
571
|
-
},
|
|
572
|
-
{
|
|
573
|
-
"type": "fix",
|
|
574
|
-
"scope": "text-select",
|
|
575
|
-
"subject": "select text view mode should use black for text color PD-1154",
|
|
576
|
-
"merge": null,
|
|
577
|
-
"header": "fix(text-select): select text view mode should use black for text color PD-1154",
|
|
578
|
-
"body": null,
|
|
579
|
-
"footer": null,
|
|
580
|
-
"notes": [],
|
|
581
|
-
"hash": "0db5b1e47b48a9eb3669eea2a1bcfb4eba27f820",
|
|
582
|
-
"gitTags": " (origin/fix/PD-1154/select-text-view-mode-text-color)",
|
|
583
|
-
"committerDate": "2021-05-18 12:04:39 +0300",
|
|
584
|
-
"isTagged": true,
|
|
585
|
-
"tag": "@pie-lib/text-select@1.8.0"
|
|
586
|
-
},
|
|
587
|
-
{
|
|
588
|
-
"type": "fix",
|
|
589
|
-
"scope": "text-select",
|
|
590
|
-
"subject": "Fixed white space collapse PD-477",
|
|
591
|
-
"merge": null,
|
|
592
|
-
"header": "fix(text-select): Fixed white space collapse PD-477",
|
|
593
|
-
"body": null,
|
|
594
|
-
"footer": null,
|
|
595
|
-
"notes": [],
|
|
596
|
-
"hash": "1f9481fac827045491b8d4f827da944cfcd0a7b3",
|
|
597
|
-
"gitTags": " (origin/fix/PD-477)",
|
|
598
|
-
"committerDate": "2021-07-22 12:12:59 +0300",
|
|
599
|
-
"isTagged": true,
|
|
600
|
-
"tag": "@pie-lib/text-select@1.8.3"
|
|
601
|
-
},
|
|
602
|
-
{
|
|
603
|
-
"type": "fix",
|
|
604
|
-
"scope": "text-select",
|
|
605
|
-
"subject": "move prepareText function from pie-elements",
|
|
606
|
-
"merge": null,
|
|
607
|
-
"header": "fix(text-select): move prepareText function from pie-elements",
|
|
608
|
-
"body": null,
|
|
609
|
-
"footer": null,
|
|
610
|
-
"notes": [],
|
|
611
|
-
"hash": "0eaee810bca925de966d43e2a1a27f358df6b19d",
|
|
612
|
-
"gitTags": " (origin/fix/text-select-refactor)",
|
|
613
|
-
"committerDate": "2021-08-09 09:58:13 +0300",
|
|
614
|
-
"isTagged": true,
|
|
615
|
-
"tag": "@pie-lib/text-select@1.8.5"
|
|
616
|
-
},
|
|
617
|
-
{
|
|
618
|
-
"type": "fix",
|
|
619
|
-
"scope": "select-text",
|
|
620
|
-
"subject": "made sure the new line characters are taken into consideration for offsets [PD-1145]",
|
|
621
|
-
"merge": null,
|
|
622
|
-
"header": "fix(select-text): made sure the new line characters are taken into consideration for offsets [PD-1145]",
|
|
623
|
-
"body": null,
|
|
624
|
-
"footer": null,
|
|
625
|
-
"notes": [],
|
|
626
|
-
"hash": "a7bb44a833e2931177e122010aa160a924982530",
|
|
627
|
-
"gitTags": " (origin/feat/PD-1145-new-line-offset-handling)",
|
|
628
|
-
"committerDate": "2021-09-24 13:15:39 +0300",
|
|
629
|
-
"isTagged": true,
|
|
630
|
-
"tag": "@pie-lib/text-select@1.8.8"
|
|
631
|
-
}
|
|
632
|
-
]
|
|
1
|
+
[]
|
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,159 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# [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
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
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
|
+
|
|
16
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
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
|
+
|
|
24
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
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
|
+
|
|
32
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
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
|
+
|
|
40
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
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
|
+
|
|
48
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
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
|
+
|
|
56
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
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
|
+
|
|
64
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
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
|
+
|
|
72
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
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
|
+
|
|
80
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
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
|
|
89
|
+
|
|
90
|
+
|
|
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)
|
|
95
|
+
|
|
96
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
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
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
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
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
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)
|
|
119
|
+
|
|
120
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
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
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
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)
|
|
135
|
+
|
|
136
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
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
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
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)
|
|
151
|
+
|
|
152
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
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)
|
|
7
159
|
|
|
8
160
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
9
161
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.14.0",
|
|
7
7
|
"description": "Some react components for text selection",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"react",
|
|
@@ -19,9 +19,8 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@material-ui/icons": "^3.0.2",
|
|
21
21
|
"@pie-framework/parse-english": "^1.0.0",
|
|
22
|
-
"@pie-lib/
|
|
23
|
-
"@pie-lib/
|
|
24
|
-
"@pie-lib/translator": "^2.4.1-beta.0",
|
|
22
|
+
"@pie-lib/style-utils": "^0.4.0",
|
|
23
|
+
"@pie-lib/translator": "^2.6.0",
|
|
25
24
|
"classnames": "^2.2.6",
|
|
26
25
|
"debug": "^4.1.1",
|
|
27
26
|
"invariant": "^2.2.4",
|
|
@@ -32,7 +31,7 @@
|
|
|
32
31
|
"devDependencies": {
|
|
33
32
|
"@material-ui/core": "^3.8.3",
|
|
34
33
|
"@pie-framework/parse-english": "^1.0.0",
|
|
35
|
-
"@pie-lib/test-utils": "^0.
|
|
34
|
+
"@pie-lib/test-utils": "^0.5.0",
|
|
36
35
|
"natural": "^0.6.3",
|
|
37
36
|
"react": "^16.8.1",
|
|
38
37
|
"react-dom": "^16.9.0"
|
|
@@ -41,6 +40,6 @@
|
|
|
41
40
|
"@material-ui/core": "^3.8.3",
|
|
42
41
|
"react": "^16.8.1"
|
|
43
42
|
},
|
|
44
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "889a13bfea2c768b8a3a6eabfc6fe7b7725aa832",
|
|
45
44
|
"scripts": {}
|
|
46
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={
|
|
@@ -2,22 +2,26 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { withStyles } from '@material-ui/core/styles';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import { color } from '@pie-lib/render-ui';
|
|
6
5
|
import Check from '@material-ui/icons/Check';
|
|
7
6
|
import Close from '@material-ui/icons/Close';
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
if (useWrapper) {
|
|
11
|
-
return (
|
|
12
|
-
<span className={classNameContainer}>
|
|
13
|
-
{children}
|
|
14
|
-
<Icon className={iconClass} viewBox={'0 1 24 24'} />
|
|
15
|
-
</span>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
8
|
+
import { color } from '../../render-ui/src/index';
|
|
18
9
|
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
// we need to use a larger line height for the token to be more readable
|
|
11
|
+
const LINE_HEIGHT_MULTIPLIER = 3.2;
|
|
12
|
+
// we need a bit more space for correctness indicators
|
|
13
|
+
const CORRECTNESS_LINE_HEIGHT_MULTIPLIER = 3.4;
|
|
14
|
+
const CORRECTNESS_PADDING = 2;
|
|
15
|
+
|
|
16
|
+
const Wrapper = ({ useWrapper, children, classNameContainer, iconClass, Icon }) =>
|
|
17
|
+
useWrapper ? (
|
|
18
|
+
<span className={classNameContainer}>
|
|
19
|
+
{children}
|
|
20
|
+
<Icon className={iconClass} />
|
|
21
|
+
</span>
|
|
22
|
+
) : (
|
|
23
|
+
children
|
|
24
|
+
);
|
|
21
25
|
|
|
22
26
|
Wrapper.propTypes = {
|
|
23
27
|
useWrapper: PropTypes.bool,
|
|
@@ -38,11 +42,11 @@ export class Token extends React.Component {
|
|
|
38
42
|
static propTypes = {
|
|
39
43
|
...TokenTypes,
|
|
40
44
|
classes: PropTypes.object.isRequired,
|
|
45
|
+
text: PropTypes.string.isRequired,
|
|
41
46
|
className: PropTypes.string,
|
|
42
47
|
disabled: PropTypes.bool,
|
|
43
48
|
highlight: PropTypes.bool,
|
|
44
49
|
correct: PropTypes.bool,
|
|
45
|
-
text: PropTypes.string.isRequired,
|
|
46
50
|
};
|
|
47
51
|
|
|
48
52
|
static defaultProps = {
|
|
@@ -50,39 +54,55 @@ export class Token extends React.Component {
|
|
|
50
54
|
text: '',
|
|
51
55
|
};
|
|
52
56
|
|
|
53
|
-
|
|
57
|
+
getClassAndIconConfig = () => {
|
|
54
58
|
const {
|
|
55
|
-
text,
|
|
56
59
|
selectable,
|
|
57
60
|
selected,
|
|
58
61
|
classes,
|
|
59
62
|
className: classNameProp,
|
|
60
63
|
disabled,
|
|
61
|
-
index,
|
|
62
64
|
highlight,
|
|
63
65
|
correct,
|
|
64
66
|
animationsDisabled,
|
|
65
67
|
isMissing,
|
|
66
68
|
} = this.props;
|
|
67
69
|
const isTouchEnabled = 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
|
|
68
|
-
|
|
69
|
-
let className;
|
|
70
|
+
const baseClassName = Token.rootClassName;
|
|
70
71
|
let classNameContainer;
|
|
71
72
|
let Icon;
|
|
72
73
|
let iconClass;
|
|
73
74
|
|
|
74
75
|
if (correct === undefined && selected && disabled) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
return {
|
|
77
|
+
className: classNames(classes.token, classes.selected, classes.disabledBlack),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (correct !== undefined) {
|
|
82
|
+
const isCorrect = correct === true;
|
|
83
|
+
return {
|
|
84
|
+
className: classNames(baseClassName, classes.custom),
|
|
85
|
+
classNameContainer: classNames(isCorrect ? classes.correct : classes.incorrect, classes.commonTokenStyle),
|
|
86
|
+
Icon: isCorrect ? Check : Close,
|
|
87
|
+
iconClass: classNames(
|
|
88
|
+
classes.correctnessIndicatorIcon,
|
|
89
|
+
isCorrect ? classes.correctIcon : classes.incorrectIcon,
|
|
90
|
+
),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (isMissing) {
|
|
95
|
+
return {
|
|
96
|
+
className: classNames(baseClassName, classes.custom, classes.missing, classes.commonTokenStyle),
|
|
97
|
+
classNameContainer: classes.commonTokenStyle,
|
|
98
|
+
Icon: Close,
|
|
99
|
+
iconClass: classNames(classes.correctnessIndicatorIcon, classes.incorrectIcon),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
className: classNames(
|
|
105
|
+
baseClassName,
|
|
86
106
|
classes.token,
|
|
87
107
|
disabled && classes.disabled,
|
|
88
108
|
selectable && !disabled && !isTouchEnabled && classes.selectable,
|
|
@@ -91,11 +111,20 @@ export class Token extends React.Component {
|
|
|
91
111
|
highlight && selectable && !disabled && !selected && classes.highlight,
|
|
92
112
|
animationsDisabled && classes.print,
|
|
93
113
|
classNameProp,
|
|
94
|
-
)
|
|
95
|
-
|
|
114
|
+
),
|
|
115
|
+
classNameContainer,
|
|
116
|
+
Icon,
|
|
117
|
+
iconClass,
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
render() {
|
|
122
|
+
const { text, index, correct, isMissing } = this.props;
|
|
123
|
+
const { className, classNameContainer, Icon, iconClass } = this.getClassAndIconConfig();
|
|
124
|
+
|
|
96
125
|
return (
|
|
97
126
|
<Wrapper
|
|
98
|
-
useWrapper={correct !== undefined}
|
|
127
|
+
useWrapper={correct !== undefined || isMissing}
|
|
99
128
|
classNameContainer={classNameContainer}
|
|
100
129
|
iconClass={iconClass}
|
|
101
130
|
Icon={Icon}
|
|
@@ -124,67 +153,73 @@ export default withStyles((theme) => {
|
|
|
124
153
|
cursor: 'inherit',
|
|
125
154
|
},
|
|
126
155
|
disabledAndSelected: {
|
|
127
|
-
backgroundColor: color.
|
|
156
|
+
backgroundColor: color.blueGrey100(),
|
|
128
157
|
},
|
|
129
158
|
selectable: {
|
|
130
159
|
[theme.breakpoints.up(769)]: {
|
|
131
160
|
'&:hover': {
|
|
132
|
-
backgroundColor: color.
|
|
161
|
+
backgroundColor: color.blueGrey300(),
|
|
133
162
|
color: theme.palette.common.black,
|
|
134
163
|
'& > *': {
|
|
135
|
-
backgroundColor: color.
|
|
164
|
+
backgroundColor: color.blueGrey300(),
|
|
136
165
|
},
|
|
137
166
|
},
|
|
138
167
|
},
|
|
139
168
|
},
|
|
140
169
|
selected: {
|
|
141
|
-
backgroundColor: color.
|
|
170
|
+
backgroundColor: color.blueGrey100(),
|
|
142
171
|
color: theme.palette.common.black,
|
|
143
|
-
lineHeight: `${theme.spacing.unit *
|
|
172
|
+
lineHeight: `${theme.spacing.unit * LINE_HEIGHT_MULTIPLIER}px`,
|
|
173
|
+
border: `solid 2px ${color.blueGrey900()}`,
|
|
174
|
+
borderRadius: '4px',
|
|
144
175
|
'& > *': {
|
|
145
|
-
backgroundColor: color.
|
|
176
|
+
backgroundColor: color.blueGrey100(),
|
|
146
177
|
},
|
|
147
178
|
},
|
|
148
179
|
highlight: {
|
|
149
|
-
border: `dashed 2px ${color.
|
|
150
|
-
|
|
180
|
+
border: `dashed 2px ${color.blueGrey600()}`,
|
|
181
|
+
borderRadius: '4px',
|
|
182
|
+
lineHeight: `${theme.spacing.unit * LINE_HEIGHT_MULTIPLIER}px`,
|
|
151
183
|
},
|
|
152
184
|
print: {
|
|
153
|
-
border: `dashed 2px ${color.
|
|
154
|
-
|
|
185
|
+
border: `dashed 2px ${color.blueGrey600()}`,
|
|
186
|
+
borderRadius: '4px',
|
|
187
|
+
lineHeight: `${theme.spacing.unit * LINE_HEIGHT_MULTIPLIER}px`,
|
|
155
188
|
color: color.text(),
|
|
156
189
|
},
|
|
157
190
|
custom: {
|
|
158
191
|
display: 'initial',
|
|
159
192
|
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
193
|
+
commonTokenStyle: {
|
|
194
|
+
position: 'relative',
|
|
195
|
+
borderRadius: '4px',
|
|
163
196
|
color: theme.palette.common.black,
|
|
164
|
-
lineHeight: `${theme.spacing.unit *
|
|
197
|
+
lineHeight: `${theme.spacing.unit * CORRECTNESS_LINE_HEIGHT_MULTIPLIER + CORRECTNESS_PADDING}px`,
|
|
198
|
+
padding: `${CORRECTNESS_PADDING}px`,
|
|
199
|
+
},
|
|
200
|
+
correct: {
|
|
201
|
+
border: `${color.correctTertiary()} solid 2px`,
|
|
165
202
|
},
|
|
166
203
|
incorrect: {
|
|
167
|
-
|
|
168
|
-
border: `${color.missing()} solid 2px`,
|
|
169
|
-
color: theme.palette.common.black,
|
|
170
|
-
lineHeight: `${theme.spacing.unit * 3}px`,
|
|
204
|
+
border: `${color.incorrectWithIcon()} solid 2px`,
|
|
171
205
|
},
|
|
172
206
|
missing: {
|
|
173
|
-
|
|
174
|
-
border: `${color.missing()} dashed 2px`,
|
|
175
|
-
color: theme.palette.common.black,
|
|
176
|
-
lineHeight: `${theme.spacing.unit * 3}px`,
|
|
177
|
-
textDecoration: `line-through ${color.missing()}`,
|
|
207
|
+
border: `${color.incorrectWithIcon()} dashed 2px`,
|
|
178
208
|
},
|
|
179
209
|
incorrectIcon: {
|
|
180
|
-
|
|
181
|
-
fontSize: 'larger',
|
|
182
|
-
color: color.missing(),
|
|
210
|
+
backgroundColor: color.incorrectWithIcon(),
|
|
183
211
|
},
|
|
184
212
|
correctIcon: {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
213
|
+
backgroundColor: color.correctTertiary(),
|
|
214
|
+
},
|
|
215
|
+
correctnessIndicatorIcon: {
|
|
216
|
+
color: color.white(),
|
|
217
|
+
position: 'absolute',
|
|
218
|
+
top: '-8px',
|
|
219
|
+
left: '-8px',
|
|
220
|
+
borderRadius: '50%',
|
|
221
|
+
fontSize: '12px',
|
|
222
|
+
padding: '2px',
|
|
188
223
|
},
|
|
189
224
|
};
|
|
190
225
|
})(Token);
|
|
@@ -4,7 +4,7 @@ import Button from '@material-ui/core/Button';
|
|
|
4
4
|
import { withStyles } from '@material-ui/core/styles';
|
|
5
5
|
import Switch from '@material-ui/core/Switch';
|
|
6
6
|
import FormControlLabel from '@material-ui/core/FormControlLabel';
|
|
7
|
-
import { color } from '
|
|
7
|
+
import { color } from '../../../render-ui/src/index';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
|
|
10
10
|
export class Controls extends React.Component {
|