@react-aria/color 3.0.0-beta.17 → 3.0.0-beta.18
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/dist/main.js +365 -384
- package/dist/main.js.map +1 -1
- package/dist/module.js +365 -384
- package/dist/module.js.map +1 -1
- package/package.json +12 -12
package/dist/main.js
CHANGED
|
@@ -18,14 +18,32 @@ $parcel$export(module.exports, "useColorArea", () => $47925bd68062ac17$export$2f
|
|
|
18
18
|
$parcel$export(module.exports, "useColorSlider", () => $afbb9647440a7f5b$export$106b7a4e66508f66);
|
|
19
19
|
$parcel$export(module.exports, "useColorWheel", () => $1d29bf243d4a9a53$export$9064ff4e44b3729a);
|
|
20
20
|
$parcel$export(module.exports, "useColorField", () => $58c850037bc7a7ce$export$77e32ca575a28fdf);
|
|
21
|
-
|
|
21
|
+
/*
|
|
22
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
23
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
24
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
25
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
+
*
|
|
27
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
28
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
29
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
30
|
+
* governing permissions and limitations under the License.
|
|
31
|
+
*/ /*
|
|
32
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
33
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
34
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
35
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
36
|
+
*
|
|
37
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
38
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
39
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
40
|
+
* governing permissions and limitations under the License.
|
|
41
|
+
*/
|
|
22
42
|
var $4f97b428b4cbcd4e$exports = {};
|
|
23
43
|
var $f141a15c3076a67b$exports = {};
|
|
24
44
|
$f141a15c3076a67b$exports = {
|
|
25
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
26
|
-
|
|
27
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
28
|
-
,
|
|
45
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
46
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
29
47
|
"colorPicker": `أداة انتقاء اللون`,
|
|
30
48
|
"twoDimensionalSlider": `مُنزلق 2D`
|
|
31
49
|
};
|
|
@@ -33,10 +51,8 @@ $f141a15c3076a67b$exports = {
|
|
|
33
51
|
|
|
34
52
|
var $435ac2a9fdd2ae5e$exports = {};
|
|
35
53
|
$435ac2a9fdd2ae5e$exports = {
|
|
36
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
37
|
-
|
|
38
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
39
|
-
,
|
|
54
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
55
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
40
56
|
"colorPicker": `Средство за избиране на цвят`,
|
|
41
57
|
"twoDimensionalSlider": `2D плъзгач`
|
|
42
58
|
};
|
|
@@ -44,10 +60,8 @@ $435ac2a9fdd2ae5e$exports = {
|
|
|
44
60
|
|
|
45
61
|
var $6b29758b432284f5$exports = {};
|
|
46
62
|
$6b29758b432284f5$exports = {
|
|
47
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
48
|
-
|
|
49
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
50
|
-
,
|
|
63
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
64
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
51
65
|
"colorPicker": `Výběr barvy`,
|
|
52
66
|
"twoDimensionalSlider": `2D posuvník`
|
|
53
67
|
};
|
|
@@ -55,10 +69,8 @@ $6b29758b432284f5$exports = {
|
|
|
55
69
|
|
|
56
70
|
var $357597bcf4afd6fb$exports = {};
|
|
57
71
|
$357597bcf4afd6fb$exports = {
|
|
58
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
59
|
-
|
|
60
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
61
|
-
,
|
|
72
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
73
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
62
74
|
"colorPicker": `Farvevælger`,
|
|
63
75
|
"twoDimensionalSlider": `2D-skyder`
|
|
64
76
|
};
|
|
@@ -66,10 +78,8 @@ $357597bcf4afd6fb$exports = {
|
|
|
66
78
|
|
|
67
79
|
var $ddc6333960e2b591$exports = {};
|
|
68
80
|
$ddc6333960e2b591$exports = {
|
|
69
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
70
|
-
|
|
71
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
72
|
-
,
|
|
81
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
82
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
73
83
|
"colorPicker": `Farbwähler`,
|
|
74
84
|
"twoDimensionalSlider": `2D-Schieberegler`
|
|
75
85
|
};
|
|
@@ -77,10 +87,8 @@ $ddc6333960e2b591$exports = {
|
|
|
77
87
|
|
|
78
88
|
var $417ee93d3ca474c0$exports = {};
|
|
79
89
|
$417ee93d3ca474c0$exports = {
|
|
80
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
81
|
-
|
|
82
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
83
|
-
,
|
|
90
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
91
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
84
92
|
"colorPicker": `Επιλογέας χρωμάτων`,
|
|
85
93
|
"twoDimensionalSlider": `Ρυθμιστικό 2D`
|
|
86
94
|
};
|
|
@@ -90,18 +98,15 @@ var $519561bc6dcff98b$exports = {};
|
|
|
90
98
|
$519561bc6dcff98b$exports = {
|
|
91
99
|
"colorPicker": `Color picker`,
|
|
92
100
|
"twoDimensionalSlider": `2D slider`,
|
|
93
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}
|
|
94
|
-
,
|
|
101
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
95
102
|
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`
|
|
96
103
|
};
|
|
97
104
|
|
|
98
105
|
|
|
99
106
|
var $7a34c3fcc03402b8$exports = {};
|
|
100
107
|
$7a34c3fcc03402b8$exports = {
|
|
101
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
102
|
-
|
|
103
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
104
|
-
,
|
|
108
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
109
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
105
110
|
"colorPicker": `Selector de color`,
|
|
106
111
|
"twoDimensionalSlider": `Regulador 2D`
|
|
107
112
|
};
|
|
@@ -109,10 +114,8 @@ $7a34c3fcc03402b8$exports = {
|
|
|
109
114
|
|
|
110
115
|
var $860f86d6eae22cba$exports = {};
|
|
111
116
|
$860f86d6eae22cba$exports = {
|
|
112
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
113
|
-
|
|
114
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
115
|
-
,
|
|
117
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
118
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
116
119
|
"colorPicker": `Värvivalija`,
|
|
117
120
|
"twoDimensionalSlider": `2D-liugur`
|
|
118
121
|
};
|
|
@@ -120,10 +123,8 @@ $860f86d6eae22cba$exports = {
|
|
|
120
123
|
|
|
121
124
|
var $8525d3c77b8a51b0$exports = {};
|
|
122
125
|
$8525d3c77b8a51b0$exports = {
|
|
123
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
124
|
-
|
|
125
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
126
|
-
,
|
|
126
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
127
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
127
128
|
"colorPicker": `Värimuokkain`,
|
|
128
129
|
"twoDimensionalSlider": `2D-liukusäädin`
|
|
129
130
|
};
|
|
@@ -131,10 +132,8 @@ $8525d3c77b8a51b0$exports = {
|
|
|
131
132
|
|
|
132
133
|
var $8240fe6825e900ec$exports = {};
|
|
133
134
|
$8240fe6825e900ec$exports = {
|
|
134
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
135
|
-
|
|
136
|
-
"colorNameAndValue": (args)=>`${args.name} : ${args.value}`
|
|
137
|
-
,
|
|
135
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
136
|
+
"colorNameAndValue": (args)=>`${args.name} : ${args.value}`,
|
|
138
137
|
"colorPicker": `Sélecteur de couleurs`,
|
|
139
138
|
"twoDimensionalSlider": `Curseur 2D`
|
|
140
139
|
};
|
|
@@ -142,10 +141,8 @@ $8240fe6825e900ec$exports = {
|
|
|
142
141
|
|
|
143
142
|
var $377849238307c673$exports = {};
|
|
144
143
|
$377849238307c673$exports = {
|
|
145
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
146
|
-
|
|
147
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
148
|
-
,
|
|
144
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
145
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
149
146
|
"colorPicker": `בוחר הצבעים`,
|
|
150
147
|
"twoDimensionalSlider": `מחוון דו מימדי`
|
|
151
148
|
};
|
|
@@ -153,10 +150,8 @@ $377849238307c673$exports = {
|
|
|
153
150
|
|
|
154
151
|
var $5a6f44e0ec14b083$exports = {};
|
|
155
152
|
$5a6f44e0ec14b083$exports = {
|
|
156
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
157
|
-
|
|
158
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
159
|
-
,
|
|
153
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
154
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
160
155
|
"colorPicker": `Odabir boje`,
|
|
161
156
|
"twoDimensionalSlider": `2D klizač`
|
|
162
157
|
};
|
|
@@ -164,10 +159,8 @@ $5a6f44e0ec14b083$exports = {
|
|
|
164
159
|
|
|
165
160
|
var $82327d6e71e3e273$exports = {};
|
|
166
161
|
$82327d6e71e3e273$exports = {
|
|
167
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
168
|
-
|
|
169
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
170
|
-
,
|
|
162
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
163
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
171
164
|
"colorPicker": `Színválasztó`,
|
|
172
165
|
"twoDimensionalSlider": `2D-csúszka`
|
|
173
166
|
};
|
|
@@ -175,10 +168,8 @@ $82327d6e71e3e273$exports = {
|
|
|
175
168
|
|
|
176
169
|
var $b1e297275c248ab8$exports = {};
|
|
177
170
|
$b1e297275c248ab8$exports = {
|
|
178
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
179
|
-
|
|
180
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
181
|
-
,
|
|
171
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
172
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
182
173
|
"colorPicker": `Selettore colore`,
|
|
183
174
|
"twoDimensionalSlider": `Cursore 2D`
|
|
184
175
|
};
|
|
@@ -186,10 +177,8 @@ $b1e297275c248ab8$exports = {
|
|
|
186
177
|
|
|
187
178
|
var $b39c9f2638b4d2b9$exports = {};
|
|
188
179
|
$b39c9f2638b4d2b9$exports = {
|
|
189
|
-
"colorInputLabel": (args)=>`${args.label}、${args.channelLabel}
|
|
190
|
-
|
|
191
|
-
"colorNameAndValue": (args)=>`${args.name} : ${args.value}`
|
|
192
|
-
,
|
|
180
|
+
"colorInputLabel": (args)=>`${args.label}、${args.channelLabel}`,
|
|
181
|
+
"colorNameAndValue": (args)=>`${args.name} : ${args.value}`,
|
|
193
182
|
"colorPicker": `カラーピッカー`,
|
|
194
183
|
"twoDimensionalSlider": `2D スライダー`
|
|
195
184
|
};
|
|
@@ -197,10 +186,8 @@ $b39c9f2638b4d2b9$exports = {
|
|
|
197
186
|
|
|
198
187
|
var $2d2fbf4195848a62$exports = {};
|
|
199
188
|
$2d2fbf4195848a62$exports = {
|
|
200
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
201
|
-
|
|
202
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
203
|
-
,
|
|
189
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
190
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
204
191
|
"colorPicker": `색상 피커`,
|
|
205
192
|
"twoDimensionalSlider": `2D 슬라이더`
|
|
206
193
|
};
|
|
@@ -208,10 +195,8 @@ $2d2fbf4195848a62$exports = {
|
|
|
208
195
|
|
|
209
196
|
var $ea88350d0828fa2c$exports = {};
|
|
210
197
|
$ea88350d0828fa2c$exports = {
|
|
211
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
212
|
-
|
|
213
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
214
|
-
,
|
|
198
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
199
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
215
200
|
"colorPicker": `Spalvų parinkiklis`,
|
|
216
201
|
"twoDimensionalSlider": `2D slankiklis`
|
|
217
202
|
};
|
|
@@ -219,10 +204,8 @@ $ea88350d0828fa2c$exports = {
|
|
|
219
204
|
|
|
220
205
|
var $0e0acd541630120a$exports = {};
|
|
221
206
|
$0e0acd541630120a$exports = {
|
|
222
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
223
|
-
|
|
224
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
225
|
-
,
|
|
207
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
208
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
226
209
|
"colorPicker": `Krāsu atlasītājs`,
|
|
227
210
|
"twoDimensionalSlider": `2D slīdnis`
|
|
228
211
|
};
|
|
@@ -230,10 +213,8 @@ $0e0acd541630120a$exports = {
|
|
|
230
213
|
|
|
231
214
|
var $952a458224052046$exports = {};
|
|
232
215
|
$952a458224052046$exports = {
|
|
233
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
234
|
-
|
|
235
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
236
|
-
,
|
|
216
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
217
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
237
218
|
"colorPicker": `Fargevelger`,
|
|
238
219
|
"twoDimensionalSlider": `2D-glidebryter`
|
|
239
220
|
};
|
|
@@ -241,10 +222,8 @@ $952a458224052046$exports = {
|
|
|
241
222
|
|
|
242
223
|
var $2d8e195bc5683483$exports = {};
|
|
243
224
|
$2d8e195bc5683483$exports = {
|
|
244
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
245
|
-
|
|
246
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
247
|
-
,
|
|
225
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
226
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
248
227
|
"colorPicker": `Kleurkiezer`,
|
|
249
228
|
"twoDimensionalSlider": `2D-schuifregelaar`
|
|
250
229
|
};
|
|
@@ -252,10 +231,8 @@ $2d8e195bc5683483$exports = {
|
|
|
252
231
|
|
|
253
232
|
var $750d83f83c5f38d4$exports = {};
|
|
254
233
|
$750d83f83c5f38d4$exports = {
|
|
255
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
256
|
-
|
|
257
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
258
|
-
,
|
|
234
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
235
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
259
236
|
"colorPicker": `Próbnik kolorów`,
|
|
260
237
|
"twoDimensionalSlider": `Suwak 2D`
|
|
261
238
|
};
|
|
@@ -263,10 +240,8 @@ $750d83f83c5f38d4$exports = {
|
|
|
263
240
|
|
|
264
241
|
var $656b2846f611067c$exports = {};
|
|
265
242
|
$656b2846f611067c$exports = {
|
|
266
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
267
|
-
|
|
268
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
269
|
-
,
|
|
243
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
244
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
270
245
|
"colorPicker": `Seletor de cores`,
|
|
271
246
|
"twoDimensionalSlider": `Controle deslizante 2D`
|
|
272
247
|
};
|
|
@@ -274,10 +249,8 @@ $656b2846f611067c$exports = {
|
|
|
274
249
|
|
|
275
250
|
var $58ce120874d069dd$exports = {};
|
|
276
251
|
$58ce120874d069dd$exports = {
|
|
277
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
278
|
-
|
|
279
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
280
|
-
,
|
|
252
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
253
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
281
254
|
"colorPicker": `Seletor de cores`,
|
|
282
255
|
"twoDimensionalSlider": `Controle deslizante 2D`
|
|
283
256
|
};
|
|
@@ -285,10 +258,8 @@ $58ce120874d069dd$exports = {
|
|
|
285
258
|
|
|
286
259
|
var $fd6c85b4eba18825$exports = {};
|
|
287
260
|
$fd6c85b4eba18825$exports = {
|
|
288
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
289
|
-
|
|
290
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
291
|
-
,
|
|
261
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
262
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
292
263
|
"colorPicker": `Selector de culori`,
|
|
293
264
|
"twoDimensionalSlider": `Glisor 2D`
|
|
294
265
|
};
|
|
@@ -296,10 +267,8 @@ $fd6c85b4eba18825$exports = {
|
|
|
296
267
|
|
|
297
268
|
var $8849a15ecc435984$exports = {};
|
|
298
269
|
$8849a15ecc435984$exports = {
|
|
299
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
300
|
-
|
|
301
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
302
|
-
,
|
|
270
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
271
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
303
272
|
"colorPicker": `Палитра цветов`,
|
|
304
273
|
"twoDimensionalSlider": `Ползунок 2D`
|
|
305
274
|
};
|
|
@@ -307,10 +276,8 @@ $8849a15ecc435984$exports = {
|
|
|
307
276
|
|
|
308
277
|
var $5192372f064be783$exports = {};
|
|
309
278
|
$5192372f064be783$exports = {
|
|
310
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
311
|
-
|
|
312
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
313
|
-
,
|
|
279
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
280
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
314
281
|
"colorPicker": `Výber farieb`,
|
|
315
282
|
"twoDimensionalSlider": `2D jazdec`
|
|
316
283
|
};
|
|
@@ -318,10 +285,8 @@ $5192372f064be783$exports = {
|
|
|
318
285
|
|
|
319
286
|
var $094525f9176df65d$exports = {};
|
|
320
287
|
$094525f9176df65d$exports = {
|
|
321
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
322
|
-
|
|
323
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
324
|
-
,
|
|
288
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
289
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
325
290
|
"colorPicker": `Izbirnik barv`,
|
|
326
291
|
"twoDimensionalSlider": `2D drsnik`
|
|
327
292
|
};
|
|
@@ -329,10 +294,8 @@ $094525f9176df65d$exports = {
|
|
|
329
294
|
|
|
330
295
|
var $9795aa59b4ad40ed$exports = {};
|
|
331
296
|
$9795aa59b4ad40ed$exports = {
|
|
332
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
333
|
-
|
|
334
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
335
|
-
,
|
|
297
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
298
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
336
299
|
"colorPicker": `Birač boja`,
|
|
337
300
|
"twoDimensionalSlider": `2D klizač`
|
|
338
301
|
};
|
|
@@ -340,10 +303,8 @@ $9795aa59b4ad40ed$exports = {
|
|
|
340
303
|
|
|
341
304
|
var $9ebaa0b485f13e4d$exports = {};
|
|
342
305
|
$9ebaa0b485f13e4d$exports = {
|
|
343
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
344
|
-
|
|
345
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
346
|
-
,
|
|
306
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
307
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
347
308
|
"colorPicker": `Färgväljaren`,
|
|
348
309
|
"twoDimensionalSlider": `2D-reglage`
|
|
349
310
|
};
|
|
@@ -351,10 +312,8 @@ $9ebaa0b485f13e4d$exports = {
|
|
|
351
312
|
|
|
352
313
|
var $ad58e2e4e0f2e750$exports = {};
|
|
353
314
|
$ad58e2e4e0f2e750$exports = {
|
|
354
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
355
|
-
|
|
356
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
357
|
-
,
|
|
315
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
316
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
358
317
|
"colorPicker": `Renk Seçici`,
|
|
359
318
|
"twoDimensionalSlider": `2D sürgü`
|
|
360
319
|
};
|
|
@@ -362,10 +321,8 @@ $ad58e2e4e0f2e750$exports = {
|
|
|
362
321
|
|
|
363
322
|
var $dafc19306f8b2dfc$exports = {};
|
|
364
323
|
$dafc19306f8b2dfc$exports = {
|
|
365
|
-
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}
|
|
366
|
-
|
|
367
|
-
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`
|
|
368
|
-
,
|
|
324
|
+
"colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
|
|
325
|
+
"colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
|
|
369
326
|
"colorPicker": `Палітра кольорів`,
|
|
370
327
|
"twoDimensionalSlider": `Повзунок 2D`
|
|
371
328
|
};
|
|
@@ -373,10 +330,8 @@ $dafc19306f8b2dfc$exports = {
|
|
|
373
330
|
|
|
374
331
|
var $d31a8b80af5acc16$exports = {};
|
|
375
332
|
$d31a8b80af5acc16$exports = {
|
|
376
|
-
"colorInputLabel": (args)=>`${args.label}、${args.channelLabel}
|
|
377
|
-
|
|
378
|
-
"colorNameAndValue": (args)=>`${args.name}:${args.value}`
|
|
379
|
-
,
|
|
333
|
+
"colorInputLabel": (args)=>`${args.label}、${args.channelLabel}`,
|
|
334
|
+
"colorNameAndValue": (args)=>`${args.name}:${args.value}`,
|
|
380
335
|
"colorPicker": `拾色器`,
|
|
381
336
|
"twoDimensionalSlider": `2D 滑块`
|
|
382
337
|
};
|
|
@@ -384,10 +339,8 @@ $d31a8b80af5acc16$exports = {
|
|
|
384
339
|
|
|
385
340
|
var $7377d28aec5fa200$exports = {};
|
|
386
341
|
$7377d28aec5fa200$exports = {
|
|
387
|
-
"colorInputLabel": (args)=>`${args.label},${args.channelLabel}
|
|
388
|
-
|
|
389
|
-
"colorNameAndValue": (args)=>`${args.name}:${args.value}`
|
|
390
|
-
,
|
|
342
|
+
"colorInputLabel": (args)=>`${args.label},${args.channelLabel}`,
|
|
343
|
+
"colorNameAndValue": (args)=>`${args.name}:${args.value}`,
|
|
391
344
|
"colorPicker": `檢色器`,
|
|
392
345
|
"twoDimensionalSlider": `2D 滑桿`
|
|
393
346
|
};
|
|
@@ -432,7 +385,17 @@ $4f97b428b4cbcd4e$exports = {
|
|
|
432
385
|
|
|
433
386
|
|
|
434
387
|
|
|
435
|
-
|
|
388
|
+
/*
|
|
389
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
390
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
391
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
392
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
393
|
+
*
|
|
394
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
395
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
396
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
397
|
+
* governing permissions and limitations under the License.
|
|
398
|
+
*/
|
|
436
399
|
const $99936ad0bf67c8c4$var$generateRGB_R = (orientation, dir, zValue)=>{
|
|
437
400
|
let maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, transparent, #000)`;
|
|
438
401
|
let result = {
|
|
@@ -441,7 +404,7 @@ const $99936ad0bf67c8c4$var$generateRGB_R = (orientation, dir, zValue)=>{
|
|
|
441
404
|
},
|
|
442
405
|
gradientStyles: {
|
|
443
406
|
backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(${zValue},0,255),rgb(${zValue},255,255))`,
|
|
444
|
-
|
|
407
|
+
"WebkitMaskImage": maskImage,
|
|
445
408
|
maskImage: maskImage
|
|
446
409
|
}
|
|
447
410
|
};
|
|
@@ -455,7 +418,7 @@ const $99936ad0bf67c8c4$var$generateRGB_G = (orientation, dir, zValue)=>{
|
|
|
455
418
|
},
|
|
456
419
|
gradientStyles: {
|
|
457
420
|
backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,${zValue},255),rgb(255,${zValue},255))`,
|
|
458
|
-
|
|
421
|
+
"WebkitMaskImage": maskImage,
|
|
459
422
|
maskImage: maskImage
|
|
460
423
|
}
|
|
461
424
|
};
|
|
@@ -469,7 +432,7 @@ const $99936ad0bf67c8c4$var$generateRGB_B = (orientation, dir, zValue)=>{
|
|
|
469
432
|
},
|
|
470
433
|
gradientStyles: {
|
|
471
434
|
backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,255,${zValue}),rgb(255,255,${zValue}))`,
|
|
472
|
-
|
|
435
|
+
"WebkitMaskImage": maskImage,
|
|
473
436
|
maskImage: maskImage
|
|
474
437
|
}
|
|
475
438
|
};
|
|
@@ -477,164 +440,156 @@ const $99936ad0bf67c8c4$var$generateRGB_B = (orientation, dir, zValue)=>{
|
|
|
477
440
|
};
|
|
478
441
|
const $99936ad0bf67c8c4$var$generateHSL_H = (orientation, dir, zValue)=>{
|
|
479
442
|
let result = {
|
|
480
|
-
colorAreaStyles: {
|
|
481
|
-
},
|
|
443
|
+
colorAreaStyles: {},
|
|
482
444
|
gradientStyles: {
|
|
483
445
|
background: [
|
|
484
446
|
`linear-gradient(to ${orientation[Number(dir)]}, hsla(0,0%,0%,1) 0%, hsla(0,0%,0%,0) 50%, hsla(0,0%,100%,0) 50%, hsla(0,0%,100%,1) 100%)`,
|
|
485
447
|
`linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,50%),hsla(0,0%,50%,0))`,
|
|
486
448
|
`hsl(${zValue}, 100%, 50%)`
|
|
487
|
-
].join(
|
|
449
|
+
].join(",")
|
|
488
450
|
}
|
|
489
451
|
};
|
|
490
452
|
return result;
|
|
491
453
|
};
|
|
492
454
|
const $99936ad0bf67c8c4$var$generateHSL_S = (orientation, dir, alphaValue)=>{
|
|
493
455
|
let result = {
|
|
494
|
-
colorAreaStyles: {
|
|
495
|
-
},
|
|
456
|
+
colorAreaStyles: {},
|
|
496
457
|
gradientStyles: {
|
|
497
458
|
background: [
|
|
498
459
|
`linear-gradient(to ${orientation[Number(!dir)]}, hsla(0,0%,0%,${alphaValue}) 0%, hsla(0,0%,0%,0) 50%, hsla(0,0%,100%,0) 50%, hsla(0,0%,100%,${alphaValue}) 100%)`,
|
|
499
460
|
`linear-gradient(to ${orientation[Number(dir)]},hsla(0,100%,50%,${alphaValue}),hsla(60,100%,50%,${alphaValue}),hsla(120,100%,50%,${alphaValue}),hsla(180,100%,50%,${alphaValue}),hsla(240,100%,50%,${alphaValue}),hsla(300,100%,50%,${alphaValue}),hsla(359,100%,50%,${alphaValue}))`,
|
|
500
|
-
|
|
501
|
-
].join(
|
|
461
|
+
"hsl(0, 0%, 50%)"
|
|
462
|
+
].join(",")
|
|
502
463
|
}
|
|
503
464
|
};
|
|
504
465
|
return result;
|
|
505
466
|
};
|
|
506
467
|
const $99936ad0bf67c8c4$var$generateHSL_L = (orientation, dir, zValue)=>{
|
|
507
468
|
let result = {
|
|
508
|
-
colorAreaStyles: {
|
|
509
|
-
},
|
|
469
|
+
colorAreaStyles: {},
|
|
510
470
|
gradientStyles: {
|
|
511
471
|
backgroundImage: [
|
|
512
472
|
`linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,${zValue}%),hsla(0,0%,${zValue}%,0))`,
|
|
513
473
|
`linear-gradient(to ${orientation[Number(dir)]},hsl(0,100%,${zValue}%),hsl(60,100%,${zValue}%),hsl(120,100%,${zValue}%),hsl(180,100%,${zValue}%),hsl(240,100%,${zValue}%),hsl(300,100%,${zValue}%),hsl(360,100%,${zValue}%))`
|
|
514
|
-
].join(
|
|
474
|
+
].join(",")
|
|
515
475
|
}
|
|
516
476
|
};
|
|
517
477
|
return result;
|
|
518
478
|
};
|
|
519
479
|
const $99936ad0bf67c8c4$var$generateHSB_H = (orientation, dir, zValue)=>{
|
|
520
480
|
let result = {
|
|
521
|
-
colorAreaStyles: {
|
|
522
|
-
},
|
|
481
|
+
colorAreaStyles: {},
|
|
523
482
|
gradientStyles: {
|
|
524
483
|
background: [
|
|
525
484
|
`linear-gradient(to ${orientation[Number(dir)]},hsl(0,0%,0%),hsla(0,0%,0%,0))`,
|
|
526
485
|
`linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,100%),hsla(0,0%,100%,0))`,
|
|
527
486
|
`hsl(${zValue}, 100%, 50%)`
|
|
528
|
-
].join(
|
|
487
|
+
].join(",")
|
|
529
488
|
}
|
|
530
489
|
};
|
|
531
490
|
return result;
|
|
532
491
|
};
|
|
533
492
|
const $99936ad0bf67c8c4$var$generateHSB_S = (orientation, dir, alphaValue)=>{
|
|
534
493
|
let result = {
|
|
535
|
-
colorAreaStyles: {
|
|
536
|
-
},
|
|
494
|
+
colorAreaStyles: {},
|
|
537
495
|
gradientStyles: {
|
|
538
496
|
background: [
|
|
539
497
|
`linear-gradient(to ${orientation[Number(!dir)]},hsla(0,0%,0%,${alphaValue}),hsla(0,0%,0%,0))`,
|
|
540
498
|
`linear-gradient(to ${orientation[Number(dir)]},hsla(0,100%,50%,${alphaValue}),hsla(60,100%,50%,${alphaValue}),hsla(120,100%,50%,${alphaValue}),hsla(180,100%,50%,${alphaValue}),hsla(240,100%,50%,${alphaValue}),hsla(300,100%,50%,${alphaValue}),hsla(359,100%,50%,${alphaValue}))`,
|
|
541
499
|
`linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,0%),hsl(0,0%,100%))`
|
|
542
|
-
].join(
|
|
500
|
+
].join(",")
|
|
543
501
|
}
|
|
544
502
|
};
|
|
545
503
|
return result;
|
|
546
504
|
};
|
|
547
505
|
const $99936ad0bf67c8c4$var$generateHSB_B = (orientation, dir, alphaValue)=>{
|
|
548
506
|
let result = {
|
|
549
|
-
colorAreaStyles: {
|
|
550
|
-
},
|
|
507
|
+
colorAreaStyles: {},
|
|
551
508
|
gradientStyles: {
|
|
552
509
|
background: [
|
|
553
510
|
`linear-gradient(to ${orientation[Number(!dir)]},hsla(0,0%,100%,${alphaValue}),hsla(0,0%,100%,0))`,
|
|
554
511
|
`linear-gradient(to ${orientation[Number(dir)]},hsla(0,100%,50%,${alphaValue}),hsla(60,100%,50%,${alphaValue}),hsla(120,100%,50%,${alphaValue}),hsla(180,100%,50%,${alphaValue}),hsla(240,100%,50%,${alphaValue}),hsla(300,100%,50%,${alphaValue}),hsla(359,100%,50%,${alphaValue}))`,
|
|
555
|
-
|
|
556
|
-
].join(
|
|
512
|
+
"#000"
|
|
513
|
+
].join(",")
|
|
557
514
|
}
|
|
558
515
|
};
|
|
559
516
|
return result;
|
|
560
517
|
};
|
|
561
518
|
function $99936ad0bf67c8c4$export$dd62420467d245ca({ direction: direction , state: state , zChannel: zChannel , xChannel: xChannel , isDisabled: isDisabled }) {
|
|
562
|
-
let returnVal = $kZqDi$react.useMemo(()=>{
|
|
519
|
+
let returnVal = (0, $kZqDi$react.useMemo)(()=>{
|
|
563
520
|
let orientation = [
|
|
564
|
-
|
|
565
|
-
direction ===
|
|
521
|
+
"top",
|
|
522
|
+
direction === "rtl" ? "left" : "right"
|
|
566
523
|
];
|
|
567
524
|
let dir = false;
|
|
568
525
|
let background = {
|
|
569
|
-
colorAreaStyles: {
|
|
570
|
-
}
|
|
571
|
-
gradientStyles: {
|
|
572
|
-
}
|
|
526
|
+
colorAreaStyles: {},
|
|
527
|
+
gradientStyles: {}
|
|
573
528
|
};
|
|
574
529
|
let zValue = state.value.getChannelValue(zChannel);
|
|
575
530
|
let { minValue: zMin , maxValue: zMax } = state.value.getChannelRange(zChannel);
|
|
576
531
|
let alphaValue = (zValue - zMin) / (zMax - zMin);
|
|
577
|
-
let isHSL = state.value.getColorSpace() ===
|
|
532
|
+
let isHSL = state.value.getColorSpace() === "hsl";
|
|
578
533
|
if (!isDisabled) switch(zChannel){
|
|
579
|
-
case
|
|
580
|
-
dir = xChannel ===
|
|
534
|
+
case "red":
|
|
535
|
+
dir = xChannel === "green";
|
|
581
536
|
background = $99936ad0bf67c8c4$var$generateRGB_R(orientation, dir, zValue);
|
|
582
537
|
break;
|
|
583
|
-
case
|
|
584
|
-
dir = xChannel ===
|
|
538
|
+
case "green":
|
|
539
|
+
dir = xChannel === "red";
|
|
585
540
|
background = $99936ad0bf67c8c4$var$generateRGB_G(orientation, dir, zValue);
|
|
586
541
|
break;
|
|
587
|
-
case
|
|
588
|
-
dir = xChannel ===
|
|
542
|
+
case "blue":
|
|
543
|
+
dir = xChannel === "red";
|
|
589
544
|
background = $99936ad0bf67c8c4$var$generateRGB_B(orientation, dir, zValue);
|
|
590
545
|
break;
|
|
591
|
-
case
|
|
592
|
-
dir = xChannel !==
|
|
546
|
+
case "hue":
|
|
547
|
+
dir = xChannel !== "saturation";
|
|
593
548
|
if (isHSL) background = $99936ad0bf67c8c4$var$generateHSL_H(orientation, dir, zValue);
|
|
594
549
|
else background = $99936ad0bf67c8c4$var$generateHSB_H(orientation, dir, zValue);
|
|
595
550
|
break;
|
|
596
|
-
case
|
|
597
|
-
dir = xChannel ===
|
|
551
|
+
case "saturation":
|
|
552
|
+
dir = xChannel === "hue";
|
|
598
553
|
if (isHSL) background = $99936ad0bf67c8c4$var$generateHSL_S(orientation, dir, alphaValue);
|
|
599
554
|
else background = $99936ad0bf67c8c4$var$generateHSB_S(orientation, dir, alphaValue);
|
|
600
555
|
break;
|
|
601
|
-
case
|
|
602
|
-
dir = xChannel ===
|
|
556
|
+
case "brightness":
|
|
557
|
+
dir = xChannel === "hue";
|
|
603
558
|
background = $99936ad0bf67c8c4$var$generateHSB_B(orientation, dir, alphaValue);
|
|
604
559
|
break;
|
|
605
|
-
case
|
|
606
|
-
dir = xChannel ===
|
|
560
|
+
case "lightness":
|
|
561
|
+
dir = xChannel === "hue";
|
|
607
562
|
background = $99936ad0bf67c8c4$var$generateHSL_L(orientation, dir, zValue);
|
|
608
563
|
break;
|
|
609
564
|
}
|
|
610
565
|
let { x: x , y: y } = state.getThumbPosition();
|
|
611
|
-
if (direction ===
|
|
566
|
+
if (direction === "rtl") x = 1 - x;
|
|
612
567
|
let forcedColorAdjustNoneStyle = {
|
|
613
|
-
forcedColorAdjust:
|
|
568
|
+
forcedColorAdjust: "none"
|
|
614
569
|
};
|
|
615
570
|
return {
|
|
616
571
|
colorAreaStyleProps: {
|
|
617
572
|
style: {
|
|
618
|
-
position:
|
|
619
|
-
touchAction:
|
|
573
|
+
position: "relative",
|
|
574
|
+
touchAction: "none",
|
|
620
575
|
...forcedColorAdjustNoneStyle,
|
|
621
576
|
...background.colorAreaStyles
|
|
622
577
|
}
|
|
623
578
|
},
|
|
624
579
|
gradientStyleProps: {
|
|
625
580
|
style: {
|
|
626
|
-
touchAction:
|
|
581
|
+
touchAction: "none",
|
|
627
582
|
...forcedColorAdjustNoneStyle,
|
|
628
583
|
...background.gradientStyles
|
|
629
584
|
}
|
|
630
585
|
},
|
|
631
586
|
thumbStyleProps: {
|
|
632
587
|
style: {
|
|
633
|
-
position:
|
|
588
|
+
position: "absolute",
|
|
634
589
|
left: `${x * 100}%`,
|
|
635
590
|
top: `${y * 100}%`,
|
|
636
|
-
transform:
|
|
637
|
-
touchAction:
|
|
591
|
+
transform: "translate(0%, 0%)",
|
|
592
|
+
touchAction: "none",
|
|
638
593
|
...forcedColorAdjustNoneStyle
|
|
639
594
|
}
|
|
640
595
|
}
|
|
@@ -654,23 +609,23 @@ function $99936ad0bf67c8c4$export$dd62420467d245ca({ direction: direction , stat
|
|
|
654
609
|
|
|
655
610
|
|
|
656
611
|
function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
657
|
-
let { isDisabled: isDisabled , inputXRef: inputXRef , inputYRef: inputYRef , containerRef: containerRef ,
|
|
658
|
-
let stringFormatter = $kZqDi$reactariai18n.useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($4f97b428b4cbcd4e$exports)));
|
|
659
|
-
let { addGlobalListener: addGlobalListener , removeGlobalListener: removeGlobalListener } = $kZqDi$reactariautils.useGlobalListeners();
|
|
660
|
-
let { direction: direction , locale: locale } = $kZqDi$reactariai18n.useLocale();
|
|
661
|
-
let focusedInputRef = $kZqDi$react.useRef(null);
|
|
662
|
-
let focusInput = $kZqDi$react.useCallback((inputRef = inputXRef)=>{
|
|
663
|
-
if (inputRef.current) $kZqDi$reactariautils.focusWithoutScrolling(inputRef.current);
|
|
612
|
+
let { isDisabled: isDisabled , inputXRef: inputXRef , inputYRef: inputYRef , containerRef: containerRef , "aria-label": ariaLabel } = props;
|
|
613
|
+
let stringFormatter = (0, $kZqDi$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($4f97b428b4cbcd4e$exports))));
|
|
614
|
+
let { addGlobalListener: addGlobalListener , removeGlobalListener: removeGlobalListener } = (0, $kZqDi$reactariautils.useGlobalListeners)();
|
|
615
|
+
let { direction: direction , locale: locale } = (0, $kZqDi$reactariai18n.useLocale)();
|
|
616
|
+
let focusedInputRef = (0, $kZqDi$react.useRef)(null);
|
|
617
|
+
let focusInput = (0, $kZqDi$react.useCallback)((inputRef = inputXRef)=>{
|
|
618
|
+
if (inputRef.current) (0, $kZqDi$reactariautils.focusWithoutScrolling)(inputRef.current);
|
|
664
619
|
}, [
|
|
665
620
|
inputXRef
|
|
666
621
|
]);
|
|
667
|
-
let stateRef = $kZqDi$react.useRef(null);
|
|
622
|
+
let stateRef = (0, $kZqDi$react.useRef)(null);
|
|
668
623
|
stateRef.current = state;
|
|
669
624
|
let { xChannel: xChannel , yChannel: yChannel , zChannel: zChannel } = stateRef.current.channels;
|
|
670
|
-
let
|
|
671
|
-
let
|
|
672
|
-
let currentPosition = $kZqDi$react.useRef(null);
|
|
673
|
-
let { keyboardProps: keyboardProps } = $kZqDi$reactariainteractions.useKeyboard({
|
|
625
|
+
let xChannelStep = stateRef.current.xChannelStep;
|
|
626
|
+
let yChannelStep = stateRef.current.yChannelStep;
|
|
627
|
+
let currentPosition = (0, $kZqDi$react.useRef)(null);
|
|
628
|
+
let { keyboardProps: keyboardProps } = (0, $kZqDi$reactariainteractions.useKeyboard)({
|
|
674
629
|
onKeyDown (e) {
|
|
675
630
|
// these are the cases that useMove doesn't handle
|
|
676
631
|
if (!/^(PageUp|PageDown|Home|End)$/.test(e.key)) {
|
|
@@ -683,20 +638,20 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
|
683
638
|
stateRef.current.setDragging(true);
|
|
684
639
|
valueChangedViaKeyboard.current = true;
|
|
685
640
|
switch(e.key){
|
|
686
|
-
case
|
|
641
|
+
case "PageUp":
|
|
687
642
|
stateRef.current.incrementY(stateRef.current.yChannelPageStep);
|
|
688
643
|
focusedInputRef.current = inputYRef.current;
|
|
689
644
|
break;
|
|
690
|
-
case
|
|
645
|
+
case "PageDown":
|
|
691
646
|
stateRef.current.decrementY(stateRef.current.yChannelPageStep);
|
|
692
647
|
focusedInputRef.current = inputYRef.current;
|
|
693
648
|
break;
|
|
694
|
-
case
|
|
695
|
-
direction ===
|
|
649
|
+
case "Home":
|
|
650
|
+
direction === "rtl" ? stateRef.current.incrementX(stateRef.current.xChannelPageStep) : stateRef.current.decrementX(stateRef.current.xChannelPageStep);
|
|
696
651
|
focusedInputRef.current = inputXRef.current;
|
|
697
652
|
break;
|
|
698
|
-
case
|
|
699
|
-
direction ===
|
|
653
|
+
case "End":
|
|
654
|
+
direction === "rtl" ? stateRef.current.decrementX(stateRef.current.xChannelPageStep) : stateRef.current.incrementX(stateRef.current.xChannelPageStep);
|
|
700
655
|
focusedInputRef.current = inputXRef.current;
|
|
701
656
|
break;
|
|
702
657
|
}
|
|
@@ -714,18 +669,18 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
|
714
669
|
if (currentPosition.current == null) currentPosition.current = getThumbPosition();
|
|
715
670
|
let { width: width , height: height } = containerRef.current.getBoundingClientRect();
|
|
716
671
|
let valueChanged = deltaX !== 0 || deltaY !== 0;
|
|
717
|
-
if (pointerType ===
|
|
672
|
+
if (pointerType === "keyboard") {
|
|
718
673
|
let deltaXValue = shiftKey && xChannelPageStep > xChannelStep ? xChannelPageStep : xChannelStep;
|
|
719
674
|
let deltaYValue = shiftKey && yChannelPageStep > yChannelStep ? yChannelPageStep : yChannelStep;
|
|
720
|
-
if (deltaX > 0 && direction ===
|
|
721
|
-
else if (deltaX < 0 && direction ===
|
|
675
|
+
if (deltaX > 0 && direction === "ltr" || deltaX < 0 && direction === "rtl") incrementX(deltaXValue);
|
|
676
|
+
else if (deltaX < 0 && direction === "ltr" || deltaX > 0 && direction === "rtl") decrementX(deltaXValue);
|
|
722
677
|
else if (deltaY > 0) decrementY(deltaYValue);
|
|
723
678
|
else if (deltaY < 0) incrementY(deltaYValue);
|
|
724
679
|
valueChangedViaKeyboard.current = valueChanged;
|
|
725
680
|
// set the focused input based on which axis has the greater delta
|
|
726
681
|
focusedInputRef.current = valueChanged && Math.abs(deltaY) > Math.abs(deltaX) ? inputYRef.current : inputXRef.current;
|
|
727
682
|
} else {
|
|
728
|
-
currentPosition.current.x += (direction ===
|
|
683
|
+
currentPosition.current.x += (direction === "rtl" ? -1 : 1) * deltaX / width;
|
|
729
684
|
currentPosition.current.y += deltaY / height;
|
|
730
685
|
setColorFromPoint(currentPosition.current.x, currentPosition.current.y);
|
|
731
686
|
}
|
|
@@ -736,9 +691,9 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
|
736
691
|
focusInput(focusedInputRef.current ? focusedInputRef : inputXRef);
|
|
737
692
|
}
|
|
738
693
|
};
|
|
739
|
-
let { moveProps: movePropsThumb } = $kZqDi$reactariainteractions.useMove(moveHandler);
|
|
740
|
-
let valueChangedViaKeyboard = $kZqDi$react.useRef(false);
|
|
741
|
-
let { focusWithinProps: focusWithinProps } = $kZqDi$reactariainteractions.useFocusWithin({
|
|
694
|
+
let { moveProps: movePropsThumb } = (0, $kZqDi$reactariainteractions.useMove)(moveHandler);
|
|
695
|
+
let valueChangedViaKeyboard = (0, $kZqDi$react.useRef)(false);
|
|
696
|
+
let { focusWithinProps: focusWithinProps } = (0, $kZqDi$reactariainteractions.useFocusWithin)({
|
|
742
697
|
onFocusWithinChange: (focusWithin)=>{
|
|
743
698
|
if (!focusWithin) {
|
|
744
699
|
valueChangedViaKeyboard.current = false;
|
|
@@ -746,9 +701,9 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
|
746
701
|
}
|
|
747
702
|
}
|
|
748
703
|
});
|
|
749
|
-
let currentPointer = $kZqDi$react.useRef(undefined);
|
|
750
|
-
let isOnColorArea = $kZqDi$react.useRef(false);
|
|
751
|
-
let { moveProps: movePropsContainer } = $kZqDi$reactariainteractions.useMove({
|
|
704
|
+
let currentPointer = (0, $kZqDi$react.useRef)(undefined);
|
|
705
|
+
let isOnColorArea = (0, $kZqDi$react.useRef)(false);
|
|
706
|
+
let { moveProps: movePropsContainer } = (0, $kZqDi$reactariainteractions.useMove)({
|
|
752
707
|
onMoveStart () {
|
|
753
708
|
if (isOnColorArea.current) moveHandler.onMoveStart();
|
|
754
709
|
},
|
|
@@ -765,27 +720,27 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
|
765
720
|
valueChangedViaKeyboard.current = false;
|
|
766
721
|
focusInput();
|
|
767
722
|
state.setDragging(true);
|
|
768
|
-
if (typeof PointerEvent !==
|
|
723
|
+
if (typeof PointerEvent !== "undefined") addGlobalListener(window, "pointerup", onThumbUp, false);
|
|
769
724
|
else {
|
|
770
|
-
addGlobalListener(window,
|
|
771
|
-
addGlobalListener(window,
|
|
725
|
+
addGlobalListener(window, "mouseup", onThumbUp, false);
|
|
726
|
+
addGlobalListener(window, "touchend", onThumbUp, false);
|
|
772
727
|
}
|
|
773
728
|
}
|
|
774
729
|
};
|
|
775
730
|
let onThumbUp = (e)=>{
|
|
776
|
-
var
|
|
777
|
-
var
|
|
778
|
-
let id = (
|
|
731
|
+
var _e_changedTouches;
|
|
732
|
+
var _e_pointerId;
|
|
733
|
+
let id = (_e_pointerId = e.pointerId) !== null && _e_pointerId !== void 0 ? _e_pointerId : (_e_changedTouches = e.changedTouches) === null || _e_changedTouches === void 0 ? void 0 : _e_changedTouches[0].identifier;
|
|
779
734
|
if (id === currentPointer.current) {
|
|
780
735
|
valueChangedViaKeyboard.current = false;
|
|
781
736
|
focusInput();
|
|
782
737
|
state.setDragging(false);
|
|
783
738
|
currentPointer.current = undefined;
|
|
784
739
|
isOnColorArea.current = false;
|
|
785
|
-
if (typeof PointerEvent !==
|
|
740
|
+
if (typeof PointerEvent !== "undefined") removeGlobalListener(window, "pointerup", onThumbUp, false);
|
|
786
741
|
else {
|
|
787
|
-
removeGlobalListener(window,
|
|
788
|
-
removeGlobalListener(window,
|
|
742
|
+
removeGlobalListener(window, "mouseup", onThumbUp, false);
|
|
743
|
+
removeGlobalListener(window, "touchend", onThumbUp, false);
|
|
789
744
|
}
|
|
790
745
|
}
|
|
791
746
|
};
|
|
@@ -794,7 +749,7 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
|
794
749
|
let { width: width , height: height } = rect;
|
|
795
750
|
let x = (clientX - rect.x) / width;
|
|
796
751
|
let y = (clientY - rect.y) / height;
|
|
797
|
-
if (direction ===
|
|
752
|
+
if (direction === "rtl") x = 1 - x;
|
|
798
753
|
if (x >= 0 && x <= 1 && y >= 0 && y <= 1 && !state.isDragging && currentPointer.current === undefined) {
|
|
799
754
|
isOnColorArea.current = true;
|
|
800
755
|
valueChangedViaKeyboard.current = false;
|
|
@@ -802,35 +757,34 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
|
802
757
|
state.setColorFromPoint(x, y);
|
|
803
758
|
focusInput();
|
|
804
759
|
state.setDragging(true);
|
|
805
|
-
if (typeof PointerEvent !==
|
|
760
|
+
if (typeof PointerEvent !== "undefined") addGlobalListener(window, "pointerup", onColorAreaUp, false);
|
|
806
761
|
else {
|
|
807
|
-
addGlobalListener(window,
|
|
808
|
-
addGlobalListener(window,
|
|
762
|
+
addGlobalListener(window, "mouseup", onColorAreaUp, false);
|
|
763
|
+
addGlobalListener(window, "touchend", onColorAreaUp, false);
|
|
809
764
|
}
|
|
810
765
|
}
|
|
811
766
|
};
|
|
812
767
|
let onColorAreaUp = (e)=>{
|
|
813
|
-
var
|
|
814
|
-
var
|
|
815
|
-
let id = (
|
|
768
|
+
var _e_changedTouches;
|
|
769
|
+
var _e_pointerId;
|
|
770
|
+
let id = (_e_pointerId = e.pointerId) !== null && _e_pointerId !== void 0 ? _e_pointerId : (_e_changedTouches = e.changedTouches) === null || _e_changedTouches === void 0 ? void 0 : _e_changedTouches[0].identifier;
|
|
816
771
|
if (isOnColorArea.current && id === currentPointer.current) {
|
|
817
772
|
isOnColorArea.current = false;
|
|
818
773
|
valueChangedViaKeyboard.current = false;
|
|
819
774
|
currentPointer.current = undefined;
|
|
820
775
|
state.setDragging(false);
|
|
821
776
|
focusInput();
|
|
822
|
-
if (typeof PointerEvent !==
|
|
777
|
+
if (typeof PointerEvent !== "undefined") removeGlobalListener(window, "pointerup", onColorAreaUp, false);
|
|
823
778
|
else {
|
|
824
|
-
removeGlobalListener(window,
|
|
825
|
-
removeGlobalListener(window,
|
|
779
|
+
removeGlobalListener(window, "mouseup", onColorAreaUp, false);
|
|
780
|
+
removeGlobalListener(window, "touchend", onColorAreaUp, false);
|
|
826
781
|
}
|
|
827
782
|
}
|
|
828
783
|
};
|
|
829
|
-
let colorAreaInteractions = isDisabled ? {
|
|
830
|
-
|
|
831
|
-
...typeof PointerEvent !== 'undefined' ? {
|
|
784
|
+
let colorAreaInteractions = isDisabled ? {} : (0, $kZqDi$reactariautils.mergeProps)({
|
|
785
|
+
...typeof PointerEvent !== "undefined" ? {
|
|
832
786
|
onPointerDown: (e)=>{
|
|
833
|
-
if (e.pointerType ===
|
|
787
|
+
if (e.pointerType === "mouse" && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)) return;
|
|
834
788
|
onColorAreaDown(e.currentTarget, e.pointerId, e.clientX, e.clientY);
|
|
835
789
|
}
|
|
836
790
|
} : {
|
|
@@ -843,11 +797,10 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
|
843
797
|
}
|
|
844
798
|
}
|
|
845
799
|
}, movePropsContainer);
|
|
846
|
-
let thumbInteractions = isDisabled ? {
|
|
847
|
-
|
|
848
|
-
...typeof PointerEvent !== 'undefined' ? {
|
|
800
|
+
let thumbInteractions = isDisabled ? {} : (0, $kZqDi$reactariautils.mergeProps)({
|
|
801
|
+
...typeof PointerEvent !== "undefined" ? {
|
|
849
802
|
onPointerDown: (e)=>{
|
|
850
|
-
if (e.pointerType ===
|
|
803
|
+
if (e.pointerType === "mouse" && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)) return;
|
|
851
804
|
onThumbDown(e.pointerId);
|
|
852
805
|
}
|
|
853
806
|
} : {
|
|
@@ -860,61 +813,61 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
|
860
813
|
}
|
|
861
814
|
}
|
|
862
815
|
}, focusWithinProps, keyboardProps, movePropsThumb);
|
|
863
|
-
let { focusProps: xInputFocusProps } = $kZqDi$reactariainteractions.useFocus({
|
|
816
|
+
let { focusProps: xInputFocusProps } = (0, $kZqDi$reactariainteractions.useFocus)({
|
|
864
817
|
onFocus: ()=>{
|
|
865
818
|
focusedInputRef.current = inputXRef.current;
|
|
866
819
|
}
|
|
867
820
|
});
|
|
868
|
-
let { focusProps: yInputFocusProps } = $kZqDi$reactariainteractions.useFocus({
|
|
821
|
+
let { focusProps: yInputFocusProps } = (0, $kZqDi$reactariainteractions.useFocus)({
|
|
869
822
|
onFocus: ()=>{
|
|
870
823
|
focusedInputRef.current = inputYRef.current;
|
|
871
824
|
}
|
|
872
825
|
});
|
|
873
|
-
let isMobile = $kZqDi$reactariautils.isIOS() || $kZqDi$reactariautils.isAndroid();
|
|
826
|
+
let isMobile = (0, $kZqDi$reactariautils.isIOS)() || (0, $kZqDi$reactariautils.isAndroid)();
|
|
874
827
|
function getAriaValueTextForChannel(channel) {
|
|
875
|
-
return valueChangedViaKeyboard.current ? stringFormatter.format(
|
|
828
|
+
return valueChangedViaKeyboard.current ? stringFormatter.format("colorNameAndValue", {
|
|
876
829
|
name: state.value.getChannelName(channel, locale),
|
|
877
830
|
value: state.value.formatChannelValue(channel, locale)
|
|
878
831
|
}) : [
|
|
879
|
-
stringFormatter.format(
|
|
832
|
+
stringFormatter.format("colorNameAndValue", {
|
|
880
833
|
name: state.value.getChannelName(channel, locale),
|
|
881
834
|
value: state.value.formatChannelValue(channel, locale)
|
|
882
835
|
}),
|
|
883
|
-
stringFormatter.format(
|
|
836
|
+
stringFormatter.format("colorNameAndValue", {
|
|
884
837
|
name: state.value.getChannelName(channel === yChannel ? xChannel : yChannel, locale),
|
|
885
838
|
value: state.value.formatChannelValue(channel === yChannel ? xChannel : yChannel, locale)
|
|
886
839
|
})
|
|
887
|
-
].join(
|
|
840
|
+
].join(", ");
|
|
888
841
|
}
|
|
889
|
-
let colorPickerLabel = stringFormatter.format(
|
|
890
|
-
let xInputLabellingProps = $kZqDi$reactariautils.useLabels({
|
|
842
|
+
let colorPickerLabel = stringFormatter.format("colorPicker");
|
|
843
|
+
let xInputLabellingProps = (0, $kZqDi$reactariautils.useLabels)({
|
|
891
844
|
...props,
|
|
892
|
-
|
|
845
|
+
"aria-label": ariaLabel ? stringFormatter.format("colorInputLabel", {
|
|
893
846
|
label: ariaLabel,
|
|
894
847
|
channelLabel: colorPickerLabel
|
|
895
848
|
}) : colorPickerLabel
|
|
896
849
|
});
|
|
897
|
-
let yInputLabellingProps = $kZqDi$reactariautils.useLabels({
|
|
850
|
+
let yInputLabellingProps = (0, $kZqDi$reactariautils.useLabels)({
|
|
898
851
|
...props,
|
|
899
|
-
|
|
852
|
+
"aria-label": ariaLabel ? stringFormatter.format("colorInputLabel", {
|
|
900
853
|
label: ariaLabel,
|
|
901
854
|
channelLabel: colorPickerLabel
|
|
902
855
|
}) : colorPickerLabel
|
|
903
856
|
});
|
|
904
|
-
let colorAreaLabellingProps = $kZqDi$reactariautils.useLabels({
|
|
857
|
+
let colorAreaLabellingProps = (0, $kZqDi$reactariautils.useLabels)({
|
|
905
858
|
...props,
|
|
906
|
-
|
|
859
|
+
"aria-label": ariaLabel ? `${ariaLabel}, ${colorPickerLabel}` : undefined
|
|
907
860
|
}, isMobile ? colorPickerLabel : undefined);
|
|
908
|
-
let ariaRoleDescription = stringFormatter.format(
|
|
909
|
-
let { visuallyHiddenProps: visuallyHiddenProps } = $kZqDi$reactariavisuallyhidden.useVisuallyHidden({
|
|
861
|
+
let ariaRoleDescription = stringFormatter.format("twoDimensionalSlider");
|
|
862
|
+
let { visuallyHiddenProps: visuallyHiddenProps } = (0, $kZqDi$reactariavisuallyhidden.useVisuallyHidden)({
|
|
910
863
|
style: {
|
|
911
|
-
opacity:
|
|
912
|
-
width:
|
|
913
|
-
height:
|
|
914
|
-
pointerEvents:
|
|
864
|
+
opacity: "0.0001",
|
|
865
|
+
width: "100%",
|
|
866
|
+
height: "100%",
|
|
867
|
+
pointerEvents: "none"
|
|
915
868
|
}
|
|
916
869
|
});
|
|
917
|
-
let { colorAreaStyleProps: colorAreaStyleProps , gradientStyleProps: gradientStyleProps , thumbStyleProps: thumbStyleProps } = $99936ad0bf67c8c4$export$dd62420467d245ca({
|
|
870
|
+
let { colorAreaStyleProps: colorAreaStyleProps , gradientStyleProps: gradientStyleProps , thumbStyleProps: thumbStyleProps } = (0, $99936ad0bf67c8c4$export$dd62420467d245ca)({
|
|
918
871
|
direction: direction,
|
|
919
872
|
state: state,
|
|
920
873
|
xChannel: xChannel,
|
|
@@ -926,27 +879,27 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
|
926
879
|
...colorAreaLabellingProps,
|
|
927
880
|
...colorAreaInteractions,
|
|
928
881
|
...colorAreaStyleProps,
|
|
929
|
-
role:
|
|
882
|
+
role: "group"
|
|
930
883
|
},
|
|
931
884
|
gradientProps: {
|
|
932
885
|
...gradientStyleProps,
|
|
933
|
-
role:
|
|
886
|
+
role: "presentation"
|
|
934
887
|
},
|
|
935
888
|
thumbProps: {
|
|
936
889
|
...thumbInteractions,
|
|
937
890
|
...thumbStyleProps,
|
|
938
|
-
role:
|
|
891
|
+
role: "presentation"
|
|
939
892
|
},
|
|
940
893
|
xInputProps: {
|
|
941
894
|
...xInputLabellingProps,
|
|
942
895
|
...visuallyHiddenProps,
|
|
943
896
|
...xInputFocusProps,
|
|
944
|
-
type:
|
|
897
|
+
type: "range",
|
|
945
898
|
min: state.value.getChannelRange(xChannel).minValue,
|
|
946
899
|
max: state.value.getChannelRange(xChannel).maxValue,
|
|
947
|
-
step:
|
|
948
|
-
|
|
949
|
-
|
|
900
|
+
step: xChannelStep,
|
|
901
|
+
"aria-roledescription": ariaRoleDescription,
|
|
902
|
+
"aria-valuetext": getAriaValueTextForChannel(xChannel),
|
|
950
903
|
disabled: isDisabled,
|
|
951
904
|
value: state.value.getChannelValue(xChannel),
|
|
952
905
|
tabIndex: isMobile || !focusedInputRef.current || focusedInputRef.current === inputXRef.current ? undefined : -1,
|
|
@@ -954,7 +907,7 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
|
954
907
|
So that only a single "2d slider" control shows up when listing form elements for screen readers,
|
|
955
908
|
add aria-hidden="true" to the unfocused control when the value has not changed via the keyboard,
|
|
956
909
|
but remove aria-hidden to reveal the input for each channel when the value has changed with the keyboard.
|
|
957
|
-
*/
|
|
910
|
+
*/ "aria-hidden": isMobile || !focusedInputRef.current || focusedInputRef.current === inputXRef.current || valueChangedViaKeyboard.current ? undefined : "true",
|
|
958
911
|
onChange: (e)=>{
|
|
959
912
|
state.setXValue(parseFloat(e.target.value));
|
|
960
913
|
}
|
|
@@ -963,13 +916,13 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
|
963
916
|
...yInputLabellingProps,
|
|
964
917
|
...visuallyHiddenProps,
|
|
965
918
|
...yInputFocusProps,
|
|
966
|
-
type:
|
|
919
|
+
type: "range",
|
|
967
920
|
min: state.value.getChannelRange(yChannel).minValue,
|
|
968
921
|
max: state.value.getChannelRange(yChannel).maxValue,
|
|
969
|
-
step:
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
922
|
+
step: yChannelStep,
|
|
923
|
+
"aria-roledescription": ariaRoleDescription,
|
|
924
|
+
"aria-valuetext": getAriaValueTextForChannel(yChannel),
|
|
925
|
+
"aria-orientation": "vertical",
|
|
973
926
|
disabled: isDisabled,
|
|
974
927
|
value: state.value.getChannelValue(yChannel),
|
|
975
928
|
tabIndex: isMobile || focusedInputRef.current && focusedInputRef.current === inputYRef.current ? undefined : -1,
|
|
@@ -977,7 +930,7 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
|
977
930
|
So that only a single "2d slider" control shows up when listing form elements for screen readers,
|
|
978
931
|
add aria-hidden="true" to the unfocused input when the value has not changed via the keyboard,
|
|
979
932
|
but remove aria-hidden to reveal the input for each channel when the value has changed with the keyboard.
|
|
980
|
-
*/
|
|
933
|
+
*/ "aria-hidden": isMobile || focusedInputRef.current && focusedInputRef.current === inputYRef.current || valueChangedViaKeyboard.current ? undefined : "true",
|
|
981
934
|
onChange: (e)=>{
|
|
982
935
|
state.setYValue(parseFloat(e.target.value));
|
|
983
936
|
}
|
|
@@ -986,20 +939,30 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
|
|
|
986
939
|
}
|
|
987
940
|
|
|
988
941
|
|
|
989
|
-
|
|
942
|
+
/*
|
|
943
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
944
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
945
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
946
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
947
|
+
*
|
|
948
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
949
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
950
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
951
|
+
* governing permissions and limitations under the License.
|
|
952
|
+
*/
|
|
990
953
|
|
|
991
954
|
|
|
992
955
|
function $afbb9647440a7f5b$export$106b7a4e66508f66(props, state) {
|
|
993
|
-
let { trackRef: trackRef , inputRef: inputRef , orientation: orientation , channel: channel ,
|
|
994
|
-
let { locale: locale , direction: direction } = $kZqDi$reactariai18n.useLocale();
|
|
956
|
+
let { trackRef: trackRef , inputRef: inputRef , orientation: orientation , channel: channel , "aria-label": ariaLabel } = props;
|
|
957
|
+
let { locale: locale , direction: direction } = (0, $kZqDi$reactariai18n.useLocale)();
|
|
995
958
|
// Provide a default aria-label if there is no other label provided.
|
|
996
|
-
if (!props.label && !ariaLabel && !props[
|
|
959
|
+
if (!props.label && !ariaLabel && !props["aria-labelledby"]) ariaLabel = state.value.getChannelName(channel, locale);
|
|
997
960
|
// @ts-ignore - ignore unused incompatible props
|
|
998
|
-
let { groupProps: groupProps , trackProps: trackProps , labelProps: labelProps , outputProps: outputProps } = $kZqDi$reactariaslider.useSlider({
|
|
961
|
+
let { groupProps: groupProps , trackProps: trackProps , labelProps: labelProps , outputProps: outputProps } = (0, $kZqDi$reactariaslider.useSlider)({
|
|
999
962
|
...props,
|
|
1000
|
-
|
|
963
|
+
"aria-label": ariaLabel
|
|
1001
964
|
}, state, trackRef);
|
|
1002
|
-
let { inputProps: inputProps , thumbProps: thumbProps } = $kZqDi$reactariaslider.useSliderThumb({
|
|
965
|
+
let { inputProps: inputProps , thumbProps: thumbProps } = (0, $kZqDi$reactariaslider.useSliderThumb)({
|
|
1003
966
|
index: 0,
|
|
1004
967
|
orientation: orientation,
|
|
1005
968
|
isDisabled: props.isDisabled,
|
|
@@ -1009,44 +972,44 @@ function $afbb9647440a7f5b$export$106b7a4e66508f66(props, state) {
|
|
|
1009
972
|
let generateBackground = ()=>{
|
|
1010
973
|
let value = state.getDisplayColor();
|
|
1011
974
|
let to;
|
|
1012
|
-
if (orientation ===
|
|
1013
|
-
else if (direction ===
|
|
1014
|
-
else to =
|
|
975
|
+
if (orientation === "vertical") to = "top";
|
|
976
|
+
else if (direction === "ltr") to = "right";
|
|
977
|
+
else to = "left";
|
|
1015
978
|
switch(channel){
|
|
1016
|
-
case
|
|
979
|
+
case "hue":
|
|
1017
980
|
return `linear-gradient(to ${to}, rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)`;
|
|
1018
|
-
case
|
|
981
|
+
case "lightness":
|
|
1019
982
|
{
|
|
1020
983
|
// We have to add an extra color stop in the middle so that the hue shows up at all.
|
|
1021
984
|
// Otherwise it will always just be black to white.
|
|
1022
985
|
let min = state.getThumbMinValue(0);
|
|
1023
986
|
let max = state.getThumbMaxValue(0);
|
|
1024
|
-
let start = value.withChannelValue(channel, min).toString(
|
|
1025
|
-
let middle = value.withChannelValue(channel, (max - min) / 2).toString(
|
|
1026
|
-
let end = value.withChannelValue(channel, max).toString(
|
|
987
|
+
let start = value.withChannelValue(channel, min).toString("css");
|
|
988
|
+
let middle = value.withChannelValue(channel, (max - min) / 2).toString("css");
|
|
989
|
+
let end = value.withChannelValue(channel, max).toString("css");
|
|
1027
990
|
return `linear-gradient(to ${to}, ${start}, ${middle}, ${end})`;
|
|
1028
991
|
}
|
|
1029
|
-
case
|
|
1030
|
-
case
|
|
1031
|
-
case
|
|
1032
|
-
case
|
|
1033
|
-
case
|
|
1034
|
-
case
|
|
992
|
+
case "saturation":
|
|
993
|
+
case "brightness":
|
|
994
|
+
case "red":
|
|
995
|
+
case "green":
|
|
996
|
+
case "blue":
|
|
997
|
+
case "alpha":
|
|
1035
998
|
{
|
|
1036
|
-
let
|
|
1037
|
-
let
|
|
1038
|
-
return `linear-gradient(to ${to}, ${
|
|
999
|
+
let start1 = value.withChannelValue(channel, state.getThumbMinValue(0)).toString("css");
|
|
1000
|
+
let end1 = value.withChannelValue(channel, state.getThumbMaxValue(0)).toString("css");
|
|
1001
|
+
return `linear-gradient(to ${to}, ${start1}, ${end1})`;
|
|
1039
1002
|
}
|
|
1040
1003
|
default:
|
|
1041
|
-
throw new Error(
|
|
1004
|
+
throw new Error("Unknown color channel: " + channel);
|
|
1042
1005
|
}
|
|
1043
1006
|
};
|
|
1044
1007
|
let forcedColorAdjustNoneStyle = {
|
|
1045
|
-
forcedColorAdjust:
|
|
1008
|
+
forcedColorAdjust: "none"
|
|
1046
1009
|
};
|
|
1047
1010
|
return {
|
|
1048
1011
|
trackProps: {
|
|
1049
|
-
|
|
1012
|
+
...(0, $kZqDi$reactariautils.mergeProps)(groupProps, trackProps),
|
|
1050
1013
|
style: {
|
|
1051
1014
|
...trackProps.style,
|
|
1052
1015
|
...forcedColorAdjustNoneStyle,
|
|
@@ -1067,23 +1030,33 @@ function $afbb9647440a7f5b$export$106b7a4e66508f66(props, state) {
|
|
|
1067
1030
|
}
|
|
1068
1031
|
|
|
1069
1032
|
|
|
1070
|
-
|
|
1033
|
+
/*
|
|
1034
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
1035
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
1036
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
1037
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
1038
|
+
*
|
|
1039
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
1040
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
1041
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1042
|
+
* governing permissions and limitations under the License.
|
|
1043
|
+
*/
|
|
1071
1044
|
|
|
1072
1045
|
|
|
1073
1046
|
|
|
1074
1047
|
function $1d29bf243d4a9a53$export$9064ff4e44b3729a(props, state, inputRef) {
|
|
1075
|
-
let { isDisabled: isDisabled , innerRadius: innerRadius , outerRadius: outerRadius ,
|
|
1076
|
-
let { addGlobalListener: addGlobalListener , removeGlobalListener: removeGlobalListener } = $kZqDi$reactariautils.useGlobalListeners();
|
|
1048
|
+
let { isDisabled: isDisabled , innerRadius: innerRadius , outerRadius: outerRadius , "aria-label": ariaLabel } = props;
|
|
1049
|
+
let { addGlobalListener: addGlobalListener , removeGlobalListener: removeGlobalListener } = (0, $kZqDi$reactariautils.useGlobalListeners)();
|
|
1077
1050
|
let thumbRadius = (innerRadius + outerRadius) / 2;
|
|
1078
|
-
let focusInput = $kZqDi$react.useCallback(()=>{
|
|
1079
|
-
if (inputRef.current) $kZqDi$reactariautils.focusWithoutScrolling(inputRef.current);
|
|
1051
|
+
let focusInput = (0, $kZqDi$react.useCallback)(()=>{
|
|
1052
|
+
if (inputRef.current) (0, $kZqDi$reactariautils.focusWithoutScrolling)(inputRef.current);
|
|
1080
1053
|
}, [
|
|
1081
1054
|
inputRef
|
|
1082
1055
|
]);
|
|
1083
|
-
let stateRef = $kZqDi$react.useRef(null);
|
|
1056
|
+
let stateRef = (0, $kZqDi$react.useRef)(null);
|
|
1084
1057
|
stateRef.current = state;
|
|
1085
|
-
let currentPosition = $kZqDi$react.useRef(null);
|
|
1086
|
-
let { keyboardProps: keyboardProps } = $kZqDi$reactariainteractions.useKeyboard({
|
|
1058
|
+
let currentPosition = (0, $kZqDi$react.useRef)(null);
|
|
1059
|
+
let { keyboardProps: keyboardProps } = (0, $kZqDi$reactariainteractions.useKeyboard)({
|
|
1087
1060
|
onKeyDown (e) {
|
|
1088
1061
|
// these are the cases that useMove doesn't handle
|
|
1089
1062
|
if (!/^(PageUp|PageDown)$/.test(e.key)) {
|
|
@@ -1095,11 +1068,11 @@ function $1d29bf243d4a9a53$export$9064ff4e44b3729a(props, state, inputRef) {
|
|
|
1095
1068
|
// remember to set this and unset it so that onChangeEnd is fired
|
|
1096
1069
|
stateRef.current.setDragging(true);
|
|
1097
1070
|
switch(e.key){
|
|
1098
|
-
case
|
|
1071
|
+
case "PageUp":
|
|
1099
1072
|
e.preventDefault();
|
|
1100
1073
|
state.increment(stateRef.current.pageStep);
|
|
1101
1074
|
break;
|
|
1102
|
-
case
|
|
1075
|
+
case "PageDown":
|
|
1103
1076
|
e.preventDefault();
|
|
1104
1077
|
state.decrement(stateRef.current.pageStep);
|
|
1105
1078
|
break;
|
|
@@ -1116,7 +1089,7 @@ function $1d29bf243d4a9a53$export$9064ff4e44b3729a(props, state, inputRef) {
|
|
|
1116
1089
|
if (currentPosition.current == null) currentPosition.current = stateRef.current.getThumbPosition(thumbRadius);
|
|
1117
1090
|
currentPosition.current.x += deltaX;
|
|
1118
1091
|
currentPosition.current.y += deltaY;
|
|
1119
|
-
if (pointerType ===
|
|
1092
|
+
if (pointerType === "keyboard") {
|
|
1120
1093
|
if (deltaX > 0 || deltaY < 0) state.increment(shiftKey ? stateRef.current.pageStep : stateRef.current.step);
|
|
1121
1094
|
else if (deltaX < 0 || deltaY > 0) state.decrement(shiftKey ? stateRef.current.pageStep : stateRef.current.step);
|
|
1122
1095
|
} else stateRef.current.setHueFromPoint(currentPosition.current.x, currentPosition.current.y, thumbRadius);
|
|
@@ -1127,10 +1100,10 @@ function $1d29bf243d4a9a53$export$9064ff4e44b3729a(props, state, inputRef) {
|
|
|
1127
1100
|
focusInput();
|
|
1128
1101
|
}
|
|
1129
1102
|
};
|
|
1130
|
-
let { moveProps: movePropsThumb } = $kZqDi$reactariainteractions.useMove(moveHandler);
|
|
1131
|
-
let currentPointer = $kZqDi$react.useRef(undefined);
|
|
1132
|
-
let isOnTrack = $kZqDi$react.useRef(false);
|
|
1133
|
-
let { moveProps: movePropsContainer } = $kZqDi$reactariainteractions.useMove({
|
|
1103
|
+
let { moveProps: movePropsThumb } = (0, $kZqDi$reactariainteractions.useMove)(moveHandler);
|
|
1104
|
+
let currentPointer = (0, $kZqDi$react.useRef)(undefined);
|
|
1105
|
+
let isOnTrack = (0, $kZqDi$react.useRef)(false);
|
|
1106
|
+
let { moveProps: movePropsContainer } = (0, $kZqDi$reactariainteractions.useMove)({
|
|
1134
1107
|
onMoveStart () {
|
|
1135
1108
|
if (isOnTrack.current) moveHandler.onMoveStart();
|
|
1136
1109
|
},
|
|
@@ -1146,26 +1119,26 @@ function $1d29bf243d4a9a53$export$9064ff4e44b3729a(props, state, inputRef) {
|
|
|
1146
1119
|
currentPointer.current = id;
|
|
1147
1120
|
focusInput();
|
|
1148
1121
|
state.setDragging(true);
|
|
1149
|
-
if (typeof PointerEvent !==
|
|
1122
|
+
if (typeof PointerEvent !== "undefined") addGlobalListener(window, "pointerup", onThumbUp, false);
|
|
1150
1123
|
else {
|
|
1151
|
-
addGlobalListener(window,
|
|
1152
|
-
addGlobalListener(window,
|
|
1124
|
+
addGlobalListener(window, "mouseup", onThumbUp, false);
|
|
1125
|
+
addGlobalListener(window, "touchend", onThumbUp, false);
|
|
1153
1126
|
}
|
|
1154
1127
|
}
|
|
1155
1128
|
};
|
|
1156
1129
|
let onThumbUp = (e)=>{
|
|
1157
|
-
var
|
|
1158
|
-
var
|
|
1159
|
-
let id = (
|
|
1130
|
+
var _e_changedTouches;
|
|
1131
|
+
var _e_pointerId;
|
|
1132
|
+
let id = (_e_pointerId = e.pointerId) !== null && _e_pointerId !== void 0 ? _e_pointerId : (_e_changedTouches = e.changedTouches) === null || _e_changedTouches === void 0 ? void 0 : _e_changedTouches[0].identifier;
|
|
1160
1133
|
if (id === currentPointer.current) {
|
|
1161
1134
|
focusInput();
|
|
1162
1135
|
state.setDragging(false);
|
|
1163
1136
|
currentPointer.current = undefined;
|
|
1164
1137
|
isOnTrack.current = false;
|
|
1165
|
-
if (typeof PointerEvent !==
|
|
1138
|
+
if (typeof PointerEvent !== "undefined") removeGlobalListener(window, "pointerup", onThumbUp, false);
|
|
1166
1139
|
else {
|
|
1167
|
-
removeGlobalListener(window,
|
|
1168
|
-
removeGlobalListener(window,
|
|
1140
|
+
removeGlobalListener(window, "mouseup", onThumbUp, false);
|
|
1141
|
+
removeGlobalListener(window, "touchend", onThumbUp, false);
|
|
1169
1142
|
}
|
|
1170
1143
|
}
|
|
1171
1144
|
};
|
|
@@ -1180,34 +1153,33 @@ function $1d29bf243d4a9a53$export$9064ff4e44b3729a(props, state, inputRef) {
|
|
|
1180
1153
|
stateRef.current.setHueFromPoint(x, y, radius);
|
|
1181
1154
|
focusInput();
|
|
1182
1155
|
state.setDragging(true);
|
|
1183
|
-
if (typeof PointerEvent !==
|
|
1156
|
+
if (typeof PointerEvent !== "undefined") addGlobalListener(window, "pointerup", onTrackUp, false);
|
|
1184
1157
|
else {
|
|
1185
|
-
addGlobalListener(window,
|
|
1186
|
-
addGlobalListener(window,
|
|
1158
|
+
addGlobalListener(window, "mouseup", onTrackUp, false);
|
|
1159
|
+
addGlobalListener(window, "touchend", onTrackUp, false);
|
|
1187
1160
|
}
|
|
1188
1161
|
}
|
|
1189
1162
|
};
|
|
1190
1163
|
let onTrackUp = (e)=>{
|
|
1191
|
-
var
|
|
1192
|
-
var
|
|
1193
|
-
let id = (
|
|
1164
|
+
var _e_changedTouches;
|
|
1165
|
+
var _e_pointerId;
|
|
1166
|
+
let id = (_e_pointerId = e.pointerId) !== null && _e_pointerId !== void 0 ? _e_pointerId : (_e_changedTouches = e.changedTouches) === null || _e_changedTouches === void 0 ? void 0 : _e_changedTouches[0].identifier;
|
|
1194
1167
|
if (isOnTrack.current && id === currentPointer.current) {
|
|
1195
1168
|
isOnTrack.current = false;
|
|
1196
1169
|
currentPointer.current = undefined;
|
|
1197
1170
|
state.setDragging(false);
|
|
1198
1171
|
focusInput();
|
|
1199
|
-
if (typeof PointerEvent !==
|
|
1172
|
+
if (typeof PointerEvent !== "undefined") removeGlobalListener(window, "pointerup", onTrackUp, false);
|
|
1200
1173
|
else {
|
|
1201
|
-
removeGlobalListener(window,
|
|
1202
|
-
removeGlobalListener(window,
|
|
1174
|
+
removeGlobalListener(window, "mouseup", onTrackUp, false);
|
|
1175
|
+
removeGlobalListener(window, "touchend", onTrackUp, false);
|
|
1203
1176
|
}
|
|
1204
1177
|
}
|
|
1205
1178
|
};
|
|
1206
|
-
let trackInteractions = isDisabled ? {
|
|
1207
|
-
|
|
1208
|
-
...typeof PointerEvent !== 'undefined' ? {
|
|
1179
|
+
let trackInteractions = isDisabled ? {} : (0, $kZqDi$reactariautils.mergeProps)({
|
|
1180
|
+
...typeof PointerEvent !== "undefined" ? {
|
|
1209
1181
|
onPointerDown: (e)=>{
|
|
1210
|
-
if (e.pointerType ===
|
|
1182
|
+
if (e.pointerType === "mouse" && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)) return;
|
|
1211
1183
|
onTrackDown(e.currentTarget, e.pointerId, e.clientX, e.clientY);
|
|
1212
1184
|
}
|
|
1213
1185
|
} : {
|
|
@@ -1220,38 +1192,37 @@ function $1d29bf243d4a9a53$export$9064ff4e44b3729a(props, state, inputRef) {
|
|
|
1220
1192
|
}
|
|
1221
1193
|
}
|
|
1222
1194
|
}, movePropsContainer);
|
|
1223
|
-
let thumbInteractions = isDisabled ? {
|
|
1224
|
-
} : $kZqDi$reactariautils.mergeProps({
|
|
1195
|
+
let thumbInteractions = isDisabled ? {} : (0, $kZqDi$reactariautils.mergeProps)({
|
|
1225
1196
|
onMouseDown: (e)=>{
|
|
1226
1197
|
if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
1227
1198
|
onThumbDown(undefined);
|
|
1228
1199
|
},
|
|
1229
1200
|
onPointerDown: (e)=>{
|
|
1230
|
-
if (e.pointerType ===
|
|
1201
|
+
if (e.pointerType === "mouse" && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)) return;
|
|
1231
1202
|
onThumbDown(e.pointerId);
|
|
1232
1203
|
},
|
|
1233
1204
|
onTouchStart: (e)=>{
|
|
1234
1205
|
onThumbDown(e.changedTouches[0].identifier);
|
|
1235
1206
|
}
|
|
1236
1207
|
}, keyboardProps, movePropsThumb);
|
|
1237
|
-
let { x:
|
|
1208
|
+
let { x: x , y: y } = state.getThumbPosition(thumbRadius);
|
|
1238
1209
|
// Provide a default aria-label if none is given
|
|
1239
|
-
let { locale: locale } = $kZqDi$reactariai18n.useLocale();
|
|
1240
|
-
if (ariaLabel == null && props[
|
|
1241
|
-
let inputLabellingProps = $kZqDi$reactariautils.useLabels({
|
|
1210
|
+
let { locale: locale } = (0, $kZqDi$reactariai18n.useLocale)();
|
|
1211
|
+
if (ariaLabel == null && props["aria-labelledby"] == null) ariaLabel = state.value.getChannelName("hue", locale);
|
|
1212
|
+
let inputLabellingProps = (0, $kZqDi$reactariautils.useLabels)({
|
|
1242
1213
|
...props,
|
|
1243
|
-
|
|
1214
|
+
"aria-label": ariaLabel
|
|
1244
1215
|
});
|
|
1245
|
-
let { minValue: minValue , maxValue: maxValue , step: step } = state.value.getChannelRange(
|
|
1216
|
+
let { minValue: minValue , maxValue: maxValue , step: step } = state.value.getChannelRange("hue");
|
|
1246
1217
|
let forcedColorAdjustNoneStyle = {
|
|
1247
|
-
forcedColorAdjust:
|
|
1218
|
+
forcedColorAdjust: "none"
|
|
1248
1219
|
};
|
|
1249
1220
|
return {
|
|
1250
1221
|
trackProps: {
|
|
1251
1222
|
...trackInteractions,
|
|
1252
1223
|
style: {
|
|
1253
|
-
position:
|
|
1254
|
-
touchAction:
|
|
1224
|
+
position: "relative",
|
|
1225
|
+
touchAction: "none",
|
|
1255
1226
|
width: outerRadius * 2,
|
|
1256
1227
|
height: outerRadius * 2,
|
|
1257
1228
|
background: `
|
|
@@ -1279,22 +1250,22 @@ function $1d29bf243d4a9a53$export$9064ff4e44b3729a(props, state, inputRef) {
|
|
|
1279
1250
|
thumbProps: {
|
|
1280
1251
|
...thumbInteractions,
|
|
1281
1252
|
style: {
|
|
1282
|
-
position:
|
|
1283
|
-
left:
|
|
1284
|
-
top:
|
|
1285
|
-
transform: `translate(calc(${
|
|
1286
|
-
touchAction:
|
|
1253
|
+
position: "absolute",
|
|
1254
|
+
left: "50%",
|
|
1255
|
+
top: "50%",
|
|
1256
|
+
transform: `translate(calc(${x}px - 50%), calc(${y}px - 50%))`,
|
|
1257
|
+
touchAction: "none",
|
|
1287
1258
|
...forcedColorAdjustNoneStyle
|
|
1288
1259
|
}
|
|
1289
1260
|
},
|
|
1290
|
-
inputProps: $kZqDi$reactariautils.mergeProps(inputLabellingProps, {
|
|
1291
|
-
type:
|
|
1261
|
+
inputProps: (0, $kZqDi$reactariautils.mergeProps)(inputLabellingProps, {
|
|
1262
|
+
type: "range",
|
|
1292
1263
|
min: String(minValue),
|
|
1293
1264
|
max: String(maxValue),
|
|
1294
1265
|
step: String(step),
|
|
1295
|
-
|
|
1266
|
+
"aria-valuetext": state.value.formatChannelValue("hue", locale),
|
|
1296
1267
|
disabled: isDisabled,
|
|
1297
|
-
value: `${state.value.getChannelValue(
|
|
1268
|
+
value: `${state.value.getChannelValue("hue")}`,
|
|
1298
1269
|
onChange: (e)=>{
|
|
1299
1270
|
state.setHue(parseFloat(e.target.value));
|
|
1300
1271
|
}
|
|
@@ -1307,7 +1278,17 @@ function $1d29bf243d4a9a53$var$circlePath(cx, cy, r) {
|
|
|
1307
1278
|
}
|
|
1308
1279
|
|
|
1309
1280
|
|
|
1310
|
-
|
|
1281
|
+
/*
|
|
1282
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
1283
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
1284
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
1285
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
1286
|
+
*
|
|
1287
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
1288
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
1289
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1290
|
+
* governing permissions and limitations under the License.
|
|
1291
|
+
*/
|
|
1311
1292
|
|
|
1312
1293
|
|
|
1313
1294
|
|
|
@@ -1315,26 +1296,26 @@ function $1d29bf243d4a9a53$var$circlePath(cx, cy, r) {
|
|
|
1315
1296
|
function $58c850037bc7a7ce$export$77e32ca575a28fdf(props, state, ref) {
|
|
1316
1297
|
let { isDisabled: isDisabled , isReadOnly: isReadOnly , isRequired: isRequired } = props;
|
|
1317
1298
|
let { colorValue: colorValue , inputValue: inputValue , commit: commit , increment: increment , decrement: decrement , incrementToMax: incrementToMax , decrementToMin: decrementToMin } = state;
|
|
1318
|
-
let inputId = $kZqDi$reactariautils.useId();
|
|
1319
|
-
let { spinButtonProps: spinButtonProps } = $kZqDi$reactariaspinbutton.useSpinButton({
|
|
1299
|
+
let inputId = (0, $kZqDi$reactariautils.useId)();
|
|
1300
|
+
let { spinButtonProps: spinButtonProps } = (0, $kZqDi$reactariaspinbutton.useSpinButton)({
|
|
1320
1301
|
isDisabled: isDisabled,
|
|
1321
1302
|
isReadOnly: isReadOnly,
|
|
1322
1303
|
isRequired: isRequired,
|
|
1323
|
-
maxValue:
|
|
1304
|
+
maxValue: 0xFFFFFF,
|
|
1324
1305
|
minValue: 0,
|
|
1325
1306
|
onIncrement: increment,
|
|
1326
1307
|
onIncrementToMax: incrementToMax,
|
|
1327
1308
|
onDecrement: decrement,
|
|
1328
1309
|
onDecrementToMin: decrementToMin,
|
|
1329
1310
|
value: colorValue ? colorValue.toHexInt() : undefined,
|
|
1330
|
-
textValue: colorValue ? colorValue.toString(
|
|
1311
|
+
textValue: colorValue ? colorValue.toString("hex") : undefined
|
|
1331
1312
|
});
|
|
1332
|
-
let [focusWithin, setFocusWithin] = $kZqDi$react.useState(false);
|
|
1333
|
-
let { focusWithinProps: focusWithinProps } = $kZqDi$reactariainteractions.useFocusWithin({
|
|
1313
|
+
let [focusWithin, setFocusWithin] = (0, $kZqDi$react.useState)(false);
|
|
1314
|
+
let { focusWithinProps: focusWithinProps } = (0, $kZqDi$reactariainteractions.useFocusWithin)({
|
|
1334
1315
|
isDisabled: isDisabled,
|
|
1335
1316
|
onFocusWithinChange: setFocusWithin
|
|
1336
1317
|
});
|
|
1337
|
-
let onWheel = $kZqDi$react.useCallback((e)=>{
|
|
1318
|
+
let onWheel = (0, $kZqDi$react.useCallback)((e)=>{
|
|
1338
1319
|
if (Math.abs(e.deltaY) <= Math.abs(e.deltaX)) return;
|
|
1339
1320
|
if (e.deltaY > 0) increment();
|
|
1340
1321
|
else if (e.deltaY < 0) decrement();
|
|
@@ -1344,31 +1325,31 @@ function $58c850037bc7a7ce$export$77e32ca575a28fdf(props, state, ref) {
|
|
|
1344
1325
|
]);
|
|
1345
1326
|
// If the input isn't supposed to receive input, disable scrolling.
|
|
1346
1327
|
let scrollingDisabled = isDisabled || isReadOnly || !focusWithin;
|
|
1347
|
-
$kZqDi$reactariainteractions.useScrollWheel({
|
|
1328
|
+
(0, $kZqDi$reactariainteractions.useScrollWheel)({
|
|
1348
1329
|
onScroll: onWheel,
|
|
1349
1330
|
isDisabled: scrollingDisabled
|
|
1350
1331
|
}, ref);
|
|
1351
1332
|
let onChange = (value)=>{
|
|
1352
1333
|
state.setInputValue(value);
|
|
1353
1334
|
};
|
|
1354
|
-
let { labelProps: labelProps , inputProps: inputProps } = $kZqDi$reactariatextfield.useFormattedTextField($kZqDi$reactariautils.mergeProps(props, {
|
|
1335
|
+
let { labelProps: labelProps , inputProps: inputProps } = (0, $kZqDi$reactariatextfield.useFormattedTextField)((0, $kZqDi$reactariautils.mergeProps)(props, {
|
|
1355
1336
|
id: inputId,
|
|
1356
1337
|
value: inputValue,
|
|
1357
1338
|
defaultValue: undefined,
|
|
1358
|
-
type:
|
|
1359
|
-
autoComplete:
|
|
1339
|
+
type: "text",
|
|
1340
|
+
autoComplete: "off",
|
|
1360
1341
|
onChange: onChange
|
|
1361
1342
|
}), state, ref);
|
|
1362
1343
|
return {
|
|
1363
1344
|
labelProps: labelProps,
|
|
1364
|
-
inputProps: $kZqDi$reactariautils.mergeProps(inputProps, spinButtonProps, focusWithinProps, {
|
|
1365
|
-
role:
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
autoCorrect:
|
|
1371
|
-
spellCheck:
|
|
1345
|
+
inputProps: (0, $kZqDi$reactariautils.mergeProps)(inputProps, spinButtonProps, focusWithinProps, {
|
|
1346
|
+
role: "textbox",
|
|
1347
|
+
"aria-valuemax": null,
|
|
1348
|
+
"aria-valuemin": null,
|
|
1349
|
+
"aria-valuenow": null,
|
|
1350
|
+
"aria-valuetext": null,
|
|
1351
|
+
autoCorrect: "off",
|
|
1352
|
+
spellCheck: "false",
|
|
1372
1353
|
onBlur: commit
|
|
1373
1354
|
})
|
|
1374
1355
|
};
|