@pie-lib/text-select 1.15.0 → 1.17.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 +24 -52
- package/package.json +6 -5
- package/src/legend.js +1 -1
- package/src/token-select/token.jsx +1 -1
- package/src/tokenizer/controls.jsx +1 -1
- package/lib/index.js +0 -68
- package/lib/index.js.map +0 -1
- package/lib/legend.js +0 -126
- package/lib/legend.js.map +0 -1
- package/lib/shared/index.js +0 -136
- package/lib/text-select.js +0 -138
- package/lib/text-select.js.map +0 -1
- package/lib/token-select/index.js +0 -250
- package/lib/token-select/index.js.map +0 -1
- package/lib/token-select/token.js +0 -276
- package/lib/token-select/token.js.map +0 -1
- package/lib/tokenizer/builder.js +0 -311
- package/lib/tokenizer/builder.js.map +0 -1
- package/lib/tokenizer/controls.js +0 -137
- package/lib/tokenizer/controls.js.map +0 -1
- package/lib/tokenizer/index.js +0 -205
- package/lib/tokenizer/index.js.map +0 -1
- package/lib/tokenizer/selection-utils.js +0 -65
- package/lib/tokenizer/selection-utils.js.map +0 -1
- package/lib/tokenizer/token-text.js +0 -209
- package/lib/tokenizer/token-text.js.map +0 -1
- package/lib/utils.js +0 -67
- package/lib/utils.js.map +0 -1
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.
|
|
6
|
+
# [1.17.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.17.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.16.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.16.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
|
-
# [1.
|
|
22
|
+
# [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)
|
|
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
|
-
# [1.
|
|
30
|
+
# [1.16.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.12.7...@pie-lib/text-select@1.16.0) (2025-07-31)
|
|
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
|
-
# [1.
|
|
38
|
+
# [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)
|
|
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
|
-
# [1.
|
|
46
|
+
# [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)
|
|
47
47
|
|
|
48
48
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
49
49
|
|
|
@@ -51,118 +51,90 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
# [1.
|
|
54
|
+
# [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)
|
|
55
55
|
|
|
56
56
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
57
57
|
|
|
58
|
+
# [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)
|
|
58
59
|
|
|
60
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
59
61
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
# [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)
|
|
62
|
+
# [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)
|
|
63
63
|
|
|
64
64
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
65
65
|
|
|
66
|
+
# [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)
|
|
66
67
|
|
|
68
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
67
69
|
|
|
70
|
+
# [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)
|
|
68
71
|
|
|
72
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
69
73
|
|
|
70
|
-
# [1.13.0-beta.
|
|
74
|
+
# [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)
|
|
71
75
|
|
|
72
76
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
73
77
|
|
|
78
|
+
# [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)
|
|
74
79
|
|
|
80
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
75
81
|
|
|
82
|
+
# [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)
|
|
76
83
|
|
|
84
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
77
85
|
|
|
78
|
-
# [1.13.0-beta.
|
|
86
|
+
# [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
87
|
|
|
80
88
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
81
89
|
|
|
90
|
+
# [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)
|
|
82
91
|
|
|
92
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
83
93
|
|
|
94
|
+
# [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)
|
|
84
95
|
|
|
96
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
85
97
|
|
|
86
98
|
# [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)
|
|
87
99
|
|
|
88
100
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
89
101
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
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)
|
|
95
103
|
|
|
96
104
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
97
105
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
106
|
# [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)
|
|
103
107
|
|
|
104
108
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
105
109
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
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-20)
|
|
111
111
|
|
|
112
112
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
114
|
# [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)
|
|
119
115
|
|
|
120
116
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
121
117
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
118
|
# [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)
|
|
127
119
|
|
|
128
120
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
129
121
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
122
|
# [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)
|
|
135
123
|
|
|
136
124
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
137
125
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
126
|
# [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
127
|
|
|
144
128
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
145
129
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
130
|
# [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
131
|
|
|
152
132
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
153
133
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
134
|
# [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
135
|
|
|
160
136
|
**Note:** Version bump only for package @pie-lib/text-select
|
|
161
137
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
138
|
# [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)
|
|
167
139
|
|
|
168
140
|
**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.
|
|
6
|
+
"version": "1.17.0",
|
|
7
7
|
"description": "Some react components for text selection",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"react",
|
|
@@ -19,8 +19,9 @@
|
|
|
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/
|
|
22
|
+
"@pie-lib/render-ui": "^4.20.0",
|
|
23
|
+
"@pie-lib/style-utils": "^0.6.0",
|
|
24
|
+
"@pie-lib/translator": "^2.8.0",
|
|
24
25
|
"classnames": "^2.2.6",
|
|
25
26
|
"debug": "^4.1.1",
|
|
26
27
|
"invariant": "^2.2.4",
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"@material-ui/core": "^3.8.3",
|
|
33
34
|
"@pie-framework/parse-english": "^1.0.0",
|
|
34
|
-
"@pie-lib/test-utils": "
|
|
35
|
+
"@pie-lib/test-utils": "^0.7.0",
|
|
35
36
|
"natural": "^0.6.3",
|
|
36
37
|
"react": "^16.8.1",
|
|
37
38
|
"react-dom": "^16.9.0"
|
|
@@ -40,6 +41,6 @@
|
|
|
40
41
|
"@material-ui/core": "^3.8.3",
|
|
41
42
|
"react": "^16.8.1"
|
|
42
43
|
},
|
|
43
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "889a13bfea2c768b8a3a6eabfc6fe7b7725aa832",
|
|
44
45
|
"scripts": {}
|
|
45
46
|
}
|
package/src/legend.js
CHANGED
|
@@ -2,7 +2,7 @@ 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 { color } from '
|
|
5
|
+
import { color } from '@pie-lib/render-ui';
|
|
6
6
|
import Translator from '@pie-lib/translator';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
|
|
@@ -5,7 +5,7 @@ import classNames from 'classnames';
|
|
|
5
5
|
import Check from '@material-ui/icons/Check';
|
|
6
6
|
import Close from '@material-ui/icons/Close';
|
|
7
7
|
|
|
8
|
-
import { color } from '
|
|
8
|
+
import { color } from '@pie-lib/render-ui';
|
|
9
9
|
|
|
10
10
|
// we need to use a larger line height for the token to be more readable
|
|
11
11
|
const LINE_HEIGHT_MULTIPLIER = 3.2;
|
|
@@ -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 '@pie-lib/render-ui';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
|
|
10
10
|
export class Controls extends React.Component {
|
package/lib/index.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
Object.defineProperty(exports, "Legend", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _legend.Legend;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(exports, "TextSelect", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function get() {
|
|
19
|
-
return _textSelect["default"];
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(exports, "Token", {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: function get() {
|
|
25
|
-
return _token["default"];
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports, "TokenSelect", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function get() {
|
|
31
|
-
return _tokenSelect["default"];
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(exports, "TokenTypes", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
get: function get() {
|
|
37
|
-
return _tokenSelect.TokenTypes;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperty(exports, "Tokenizer", {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
get: function get() {
|
|
43
|
-
return _tokenizer["default"];
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(exports, "prepareText", {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
get: function get() {
|
|
49
|
-
return _utils.prepareText;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
var _tokenizer = _interopRequireDefault(require("./tokenizer"));
|
|
54
|
-
|
|
55
|
-
var _tokenSelect = _interopRequireWildcard(require("./token-select"));
|
|
56
|
-
|
|
57
|
-
var _textSelect = _interopRequireDefault(require("./text-select"));
|
|
58
|
-
|
|
59
|
-
var _legend = require("./legend");
|
|
60
|
-
|
|
61
|
-
var _token = _interopRequireDefault(require("./token-select/token"));
|
|
62
|
-
|
|
63
|
-
var _utils = require("./utils");
|
|
64
|
-
|
|
65
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
66
|
-
|
|
67
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
68
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["import Tokenizer from './tokenizer';\nimport TokenSelect, { TokenTypes } from './token-select';\nimport TextSelect from './text-select';\nimport { Legend } from './legend';\nimport Token from './token-select/token';\nimport { prepareText } from './utils';\n\nexport { TextSelect, TokenTypes, Tokenizer, TokenSelect, Token, prepareText, Legend };\n"],"file":"index.js"}
|
package/lib/legend.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.Legend = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _styles = require("@material-ui/core/styles");
|
|
13
|
-
|
|
14
|
-
var _Check = _interopRequireDefault(require("@material-ui/icons/Check"));
|
|
15
|
-
|
|
16
|
-
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
17
|
-
|
|
18
|
-
var _index = require("./shared/index");
|
|
19
|
-
|
|
20
|
-
var _translator = _interopRequireDefault(require("@pie-lib/translator"));
|
|
21
|
-
|
|
22
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
23
|
-
|
|
24
|
-
var translator = _translator["default"].translator;
|
|
25
|
-
var Legend = (0, _styles.withStyles)(function (theme) {
|
|
26
|
-
return {
|
|
27
|
-
flexContainer: {
|
|
28
|
-
display: 'flex',
|
|
29
|
-
flexDirection: 'row',
|
|
30
|
-
alignItems: 'center',
|
|
31
|
-
gap: "".concat(2 * theme.spacing.unit, "px"),
|
|
32
|
-
borderBottom: '1px solid lightgrey',
|
|
33
|
-
borderTop: '1px solid lightgrey',
|
|
34
|
-
paddingBottom: theme.spacing.unit,
|
|
35
|
-
paddingTop: theme.spacing.unit,
|
|
36
|
-
marginBottom: theme.spacing.unit
|
|
37
|
-
},
|
|
38
|
-
key: {
|
|
39
|
-
fontSize: '14px',
|
|
40
|
-
fontWeight: 'bold',
|
|
41
|
-
color: _index.color.black(),
|
|
42
|
-
marginLeft: theme.spacing.unit
|
|
43
|
-
},
|
|
44
|
-
container: {
|
|
45
|
-
position: 'relative',
|
|
46
|
-
padding: '4px',
|
|
47
|
-
fontSize: '14px',
|
|
48
|
-
borderRadius: '4px'
|
|
49
|
-
},
|
|
50
|
-
correct: {
|
|
51
|
-
border: "".concat(_index.color.correctTertiary(), " solid 2px")
|
|
52
|
-
},
|
|
53
|
-
incorrect: {
|
|
54
|
-
border: "".concat(_index.color.incorrectWithIcon(), " solid 2px")
|
|
55
|
-
},
|
|
56
|
-
missing: {
|
|
57
|
-
border: "".concat(_index.color.incorrectWithIcon(), " dashed 2px")
|
|
58
|
-
},
|
|
59
|
-
incorrectIcon: {
|
|
60
|
-
backgroundColor: _index.color.incorrectWithIcon()
|
|
61
|
-
},
|
|
62
|
-
correctIcon: {
|
|
63
|
-
backgroundColor: _index.color.correctTertiary()
|
|
64
|
-
},
|
|
65
|
-
icon: {
|
|
66
|
-
color: _index.color.white(),
|
|
67
|
-
position: 'absolute',
|
|
68
|
-
top: '-8px',
|
|
69
|
-
left: '-8px',
|
|
70
|
-
borderRadius: '50%',
|
|
71
|
-
fontSize: '12px',
|
|
72
|
-
padding: '2px'
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
})(function (_ref) {
|
|
76
|
-
var classes = _ref.classes,
|
|
77
|
-
language = _ref.language,
|
|
78
|
-
showOnlyCorrect = _ref.showOnlyCorrect;
|
|
79
|
-
var legendItems = [{
|
|
80
|
-
Icon: _Check["default"],
|
|
81
|
-
label: translator.t('selectText.correctAnswerSelected', {
|
|
82
|
-
lng: language
|
|
83
|
-
}),
|
|
84
|
-
containerClass: (0, _classnames["default"])(classes.correct, classes.container),
|
|
85
|
-
iconClass: (0, _classnames["default"])(classes.correctIcon, classes.icon)
|
|
86
|
-
}, {
|
|
87
|
-
Icon: _Close["default"],
|
|
88
|
-
label: translator.t('selectText.incorrectSelection', {
|
|
89
|
-
lng: language
|
|
90
|
-
}),
|
|
91
|
-
containerClass: (0, _classnames["default"])(classes.incorrect, classes.container),
|
|
92
|
-
iconClass: (0, _classnames["default"])(classes.incorrectIcon, classes.icon)
|
|
93
|
-
}, {
|
|
94
|
-
Icon: _Close["default"],
|
|
95
|
-
label: translator.t('selectText.correctAnswerNotSelected', {
|
|
96
|
-
lng: language
|
|
97
|
-
}),
|
|
98
|
-
containerClass: (0, _classnames["default"])(classes.missing, classes.container),
|
|
99
|
-
iconClass: (0, _classnames["default"])(classes.incorrectIcon, classes.icon)
|
|
100
|
-
}];
|
|
101
|
-
|
|
102
|
-
if (showOnlyCorrect) {
|
|
103
|
-
legendItems.splice(1, 2);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
107
|
-
className: classes.flexContainer
|
|
108
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
109
|
-
className: classes.key
|
|
110
|
-
}, translator.t('selectText.key', {
|
|
111
|
-
lng: language
|
|
112
|
-
})), legendItems.map(function (_ref2, idx) {
|
|
113
|
-
var Icon = _ref2.Icon,
|
|
114
|
-
label = _ref2.label,
|
|
115
|
-
containerClass = _ref2.containerClass,
|
|
116
|
-
iconClass = _ref2.iconClass;
|
|
117
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
118
|
-
key: idx,
|
|
119
|
-
className: containerClass
|
|
120
|
-
}, /*#__PURE__*/_react["default"].createElement(Icon, {
|
|
121
|
-
className: iconClass
|
|
122
|
-
}), /*#__PURE__*/_react["default"].createElement("span", null, label));
|
|
123
|
-
}));
|
|
124
|
-
});
|
|
125
|
-
exports.Legend = Legend;
|
|
126
|
-
//# sourceMappingURL=legend.js.map
|
package/lib/legend.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/legend.js"],"names":["translator","Translator","Legend","theme","flexContainer","display","flexDirection","alignItems","gap","spacing","unit","borderBottom","borderTop","paddingBottom","paddingTop","marginBottom","key","fontSize","fontWeight","color","black","marginLeft","container","position","padding","borderRadius","correct","border","correctTertiary","incorrect","incorrectWithIcon","missing","incorrectIcon","backgroundColor","correctIcon","icon","white","top","left","classes","language","showOnlyCorrect","legendItems","Icon","Check","label","t","lng","containerClass","iconClass","Close","splice","map","idx"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAQA,UAAR,GAAuBC,sBAAvB,CAAQD,UAAR;AAEO,IAAME,MAAM,GAAG,wBAAW,UAACC,KAAD;AAAA,SAAY;AAC3CC,IAAAA,aAAa,EAAE;AACbC,MAAAA,OAAO,EAAE,MADI;AAEbC,MAAAA,aAAa,EAAE,KAFF;AAGbC,MAAAA,UAAU,EAAE,QAHC;AAIbC,MAAAA,GAAG,YAAK,IAAIL,KAAK,CAACM,OAAN,CAAcC,IAAvB,OAJU;AAKbC,MAAAA,YAAY,EAAE,qBALD;AAMbC,MAAAA,SAAS,EAAE,qBANE;AAObC,MAAAA,aAAa,EAAEV,KAAK,CAACM,OAAN,CAAcC,IAPhB;AAQbI,MAAAA,UAAU,EAAEX,KAAK,CAACM,OAAN,CAAcC,IARb;AASbK,MAAAA,YAAY,EAAEZ,KAAK,CAACM,OAAN,CAAcC;AATf,KAD4B;AAY3CM,IAAAA,GAAG,EAAE;AACHC,MAAAA,QAAQ,EAAE,MADP;AAEHC,MAAAA,UAAU,EAAE,MAFT;AAG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AAEC,IAAAA,GAAG,EAAEP;AAAP,GAA/B,CAA/B,CADF,EAEGE,WAAW,CAACU,GAAZ,CAAgB,iBAA6CC,GAA7C;AAAA,QAAGV,IAAH,SAAGA,IAAH;AAAA,QAASE,KAAT,SAASA,KAAT;AAAA,QAAgBG,cAAhB,SAAgBA,cAAhB;AAAA,QAAgCC,SAAhC,SAAgCA,SAAhC;AAAA,wBACf;AAAK,MAAA,GAAG,EAAEI,GAAV;AAAe,MAAA,SAAS,EAAEL;AAA1B,oBACE,gCAAC,IAAD;AAAM,MAAA,SAAS,EAAEC;AAAjB,MADF,eAEE,8CAAOJ,KAAP,CAFF,CADe;AAAA,GAAhB,CAFH,CADF;AAWD,CArFqB,CAAf","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\nimport Check from '@material-ui/icons/Check';\nimport Close from '@material-ui/icons/Close';\nimport { color } from '../../render-ui/src/index';\nimport Translator from '@pie-lib/translator';\nimport classNames from 'classnames';\n\nconst { translator } = Translator;\n\nexport const Legend = withStyles((theme) => ({\n flexContainer: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n gap: `${2 * theme.spacing.unit}px`,\n borderBottom: '1px solid lightgrey',\n borderTop: '1px solid lightgrey',\n paddingBottom: theme.spacing.unit,\n paddingTop: theme.spacing.unit,\n marginBottom: theme.spacing.unit,\n },\n key: {\n fontSize: '14px',\n fontWeight: 'bold',\n color: color.black(),\n marginLeft: theme.spacing.unit,\n },\n container: {\n position: 'relative',\n padding: '4px',\n fontSize: '14px',\n borderRadius: '4px',\n },\n correct: {\n border: `${color.correctTertiary()} solid 2px`,\n },\n incorrect: {\n border: `${color.incorrectWithIcon()} solid 2px`,\n },\n missing: {\n border: `${color.incorrectWithIcon()} dashed 2px`,\n },\n incorrectIcon: {\n backgroundColor: color.incorrectWithIcon(),\n },\n correctIcon: {\n backgroundColor: color.correctTertiary(),\n },\n icon: {\n color: color.white(),\n position: 'absolute',\n top: '-8px',\n left: '-8px',\n borderRadius: '50%',\n fontSize: '12px',\n padding: '2px',\n },\n}))(({ classes, language, showOnlyCorrect }) => {\n const legendItems = [\n {\n Icon: Check,\n label: translator.t('selectText.correctAnswerSelected', { lng: language }),\n containerClass: classNames(classes.correct, classes.container),\n iconClass: classNames(classes.correctIcon, classes.icon),\n },\n {\n Icon: Close,\n label: translator.t('selectText.incorrectSelection', { lng: language }),\n containerClass: classNames(classes.incorrect, classes.container),\n iconClass: classNames(classes.incorrectIcon, classes.icon),\n },\n {\n Icon: Close,\n label: translator.t('selectText.correctAnswerNotSelected', { lng: language }),\n containerClass: classNames(classes.missing, classes.container),\n iconClass: classNames(classes.incorrectIcon, classes.icon),\n },\n ];\n\n if (showOnlyCorrect) {\n legendItems.splice(1, 2);\n }\n\n return (\n <div className={classes.flexContainer}>\n <span className={classes.key}>{translator.t('selectText.key', { lng: language })}</span>\n {legendItems.map(({ Icon, label, containerClass, iconClass }, idx) => (\n <div key={idx} className={containerClass}>\n <Icon className={iconClass} />\n <span>{label}</span>\n </div>\n ))}\n </div>\n );\n});\n"],"file":"legend.js"}
|
package/lib/shared/index.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
Object.defineProperty(exports, "AppendCSSRules", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _appendCssRules["default"];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(exports, "Collapsible", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function get() {
|
|
19
|
-
return _collapsible["default"];
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(exports, "EnableAudioAutoplayImage", {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: function get() {
|
|
25
|
-
return _enableAudioAutoplayImage["default"];
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports, "Feedback", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function get() {
|
|
31
|
-
return _feedback["default"];
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(exports, "HtmlAndMath", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
get: function get() {
|
|
37
|
-
return _htmlAndMath["default"];
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperty(exports, "InputContainer", {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
get: function get() {
|
|
43
|
-
return _inputContainer["default"];
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(exports, "PreviewLayout", {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
get: function get() {
|
|
49
|
-
return _previewLayout["default"];
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
Object.defineProperty(exports, "PreviewPrompt", {
|
|
53
|
-
enumerable: true,
|
|
54
|
-
get: function get() {
|
|
55
|
-
return _previewPrompt["default"];
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
Object.defineProperty(exports, "Purpose", {
|
|
59
|
-
enumerable: true,
|
|
60
|
-
get: function get() {
|
|
61
|
-
return _purpose["default"];
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
Object.defineProperty(exports, "Readable", {
|
|
65
|
-
enumerable: true,
|
|
66
|
-
get: function get() {
|
|
67
|
-
return _readable["default"];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
Object.defineProperty(exports, "UiLayout", {
|
|
71
|
-
enumerable: true,
|
|
72
|
-
get: function get() {
|
|
73
|
-
return _uiLayout["default"];
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
exports.color = void 0;
|
|
77
|
-
Object.defineProperty(exports, "hasMedia", {
|
|
78
|
-
enumerable: true,
|
|
79
|
-
get: function get() {
|
|
80
|
-
return _hasMedia.hasMedia;
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
Object.defineProperty(exports, "hasText", {
|
|
84
|
-
enumerable: true,
|
|
85
|
-
get: function get() {
|
|
86
|
-
return _hasText.hasText;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
exports.indicators = void 0;
|
|
90
|
-
Object.defineProperty(exports, "withUndoReset", {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function get() {
|
|
93
|
-
return _withUndoReset["default"];
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
var indicators = _interopRequireWildcard(require("./response-indicators"));
|
|
98
|
-
|
|
99
|
-
exports.indicators = indicators;
|
|
100
|
-
|
|
101
|
-
var _feedback = _interopRequireDefault(require("./feedback"));
|
|
102
|
-
|
|
103
|
-
var _collapsible = _interopRequireDefault(require("./collapsible"));
|
|
104
|
-
|
|
105
|
-
var _withUndoReset = _interopRequireDefault(require("./withUndoReset"));
|
|
106
|
-
|
|
107
|
-
var _previewLayout = _interopRequireDefault(require("./preview-layout"));
|
|
108
|
-
|
|
109
|
-
var _uiLayout = _interopRequireDefault(require("./ui-layout"));
|
|
110
|
-
|
|
111
|
-
var _htmlAndMath = _interopRequireDefault(require("./html-and-math"));
|
|
112
|
-
|
|
113
|
-
var _inputContainer = _interopRequireDefault(require("./input-container"));
|
|
114
|
-
|
|
115
|
-
var _previewPrompt = _interopRequireDefault(require("./preview-prompt"));
|
|
116
|
-
|
|
117
|
-
var _readable = _interopRequireDefault(require("./readable"));
|
|
118
|
-
|
|
119
|
-
var _purpose = _interopRequireDefault(require("./purpose"));
|
|
120
|
-
|
|
121
|
-
var color = _interopRequireWildcard(require("./color"));
|
|
122
|
-
|
|
123
|
-
exports.color = color;
|
|
124
|
-
|
|
125
|
-
var _hasText = require("./has-text");
|
|
126
|
-
|
|
127
|
-
var _hasMedia = require("./has-media");
|
|
128
|
-
|
|
129
|
-
var _enableAudioAutoplayImage = _interopRequireDefault(require("./assets/enableAudioAutoplayImage"));
|
|
130
|
-
|
|
131
|
-
var _appendCssRules = _interopRequireDefault(require("./append-css-rules"));
|
|
132
|
-
|
|
133
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
134
|
-
|
|
135
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
136
|
-
//# sourceMappingURL=index.js.map
|