@spectrum-web-components/color-wheel 0.4.0-devmode.0 → 0.4.1
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/custom-elements.json +6 -38
- package/package.json +6 -5
- package/sp-color-wheel.dev.js +1 -0
- package/sp-color-wheel.dev.js.map +1 -1
- package/sp-color-wheel.js +1 -2
- package/sp-color-wheel.js.map +2 -2
- package/src/ColorWheel.d.ts +2 -6
- package/src/ColorWheel.dev.js +69 -118
- package/src/ColorWheel.dev.js.map +3 -3
- package/src/ColorWheel.js +6 -336
- package/src/ColorWheel.js.map +3 -3
- package/src/color-wheel.css.dev.js +3 -2
- package/src/color-wheel.css.dev.js.map +2 -2
- package/src/color-wheel.css.js +4 -6
- package/src/color-wheel.css.js.map +3 -3
- package/src/index.dev.js +1 -0
- package/src/index.dev.js.map +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/spectrum-color-wheel.css.dev.js +1 -0
- package/src/spectrum-color-wheel.css.dev.js.map +1 -1
- package/src/spectrum-color-wheel.css.js +2 -4
- package/src/spectrum-color-wheel.css.js.map +2 -2
- package/src/types.dev.js +1 -0
- package/src/types.js +1 -0
- package/stories/color-wheel.stories.js +12 -3
- package/stories/color-wheel.stories.js.map +2 -2
- package/test/benchmark/basic-test.js +1 -0
- package/test/benchmark/basic-test.js.map +1 -1
- package/test/color-wheel.test-vrt.js +1 -0
- package/test/color-wheel.test-vrt.js.map +1 -1
- package/test/color-wheel.test.js +167 -78
- package/test/color-wheel.test.js.map +2 -2
package/custom-elements.json
CHANGED
|
@@ -84,21 +84,18 @@
|
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
"kind": "field",
|
|
87
|
-
"name": "
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
"privacy": "public",
|
|
92
|
-
"attribute": "value"
|
|
87
|
+
"name": "colorController",
|
|
88
|
+
"privacy": "private",
|
|
89
|
+
"default": "new ColorController(this, {\n /* c8 ignore next 3 */\n applyColorToState: () => {\n return;\n },\n extractColorFromState: (controller) => ({\n ...(controller.getColor('hsl') as HSL),\n h: this.value,\n }),\n maintains: 'saturation',\n })"
|
|
93
90
|
},
|
|
94
91
|
{
|
|
95
92
|
"kind": "field",
|
|
96
|
-
"name": "
|
|
93
|
+
"name": "value",
|
|
97
94
|
"type": {
|
|
98
95
|
"text": "number"
|
|
99
96
|
},
|
|
100
|
-
"privacy": "
|
|
101
|
-
"
|
|
97
|
+
"privacy": "public",
|
|
98
|
+
"attribute": "value"
|
|
102
99
|
},
|
|
103
100
|
{
|
|
104
101
|
"kind": "field",
|
|
@@ -109,35 +106,6 @@
|
|
|
109
106
|
"privacy": "public",
|
|
110
107
|
"attribute": "color"
|
|
111
108
|
},
|
|
112
|
-
{
|
|
113
|
-
"kind": "field",
|
|
114
|
-
"name": "_color",
|
|
115
|
-
"privacy": "private",
|
|
116
|
-
"default": "new TinyColor({ h: 0, s: 1, v: 1 })"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"kind": "field",
|
|
120
|
-
"name": "_previousColor",
|
|
121
|
-
"privacy": "private",
|
|
122
|
-
"default": "new TinyColor({ h: 0, s: 1, v: 1 })"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"kind": "field",
|
|
126
|
-
"name": "_saturation",
|
|
127
|
-
"type": {
|
|
128
|
-
"text": "number"
|
|
129
|
-
},
|
|
130
|
-
"privacy": "private"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
"kind": "field",
|
|
134
|
-
"name": "_format",
|
|
135
|
-
"type": {
|
|
136
|
-
"text": "{ format: string; isString: boolean }"
|
|
137
|
-
},
|
|
138
|
-
"privacy": "private",
|
|
139
|
-
"default": "{\n format: '',\n isString: false,\n }"
|
|
140
|
-
},
|
|
141
109
|
{
|
|
142
110
|
"kind": "field",
|
|
143
111
|
"name": "altered",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/color-wheel",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -62,9 +62,10 @@
|
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@ctrl/tinycolor": "^3.3.3",
|
|
65
|
-
"@spectrum-web-components/base": "^0.
|
|
66
|
-
"@spectrum-web-components/color-handle": "^0.4.
|
|
67
|
-
"@spectrum-web-components/
|
|
65
|
+
"@spectrum-web-components/base": "^0.7.0",
|
|
66
|
+
"@spectrum-web-components/color-handle": "^0.4.1",
|
|
67
|
+
"@spectrum-web-components/reactive-controllers": "^0.3.1",
|
|
68
|
+
"@spectrum-web-components/shared": "^0.15.0",
|
|
68
69
|
"tslib": "^2.0.0"
|
|
69
70
|
},
|
|
70
71
|
"devDependencies": {
|
|
@@ -76,5 +77,5 @@
|
|
|
76
77
|
"./sp-*.js",
|
|
77
78
|
"./**/*.dev.js"
|
|
78
79
|
],
|
|
79
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "15588c72c774b17cfac605b20ac52a27d123bd03"
|
|
80
81
|
}
|
package/sp-color-wheel.dev.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-color-wheel.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { ColorWheel } from './src/ColorWheel.dev.js'\n\ncustomElements.define('sp-color-wheel', ColorWheel);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-color-wheel': ColorWheel;\n }\n}\n"],
|
|
5
|
-
"mappings": "AAYA;
|
|
5
|
+
"mappings": ";AAYA,SAAS,kBAAkB;AAE3B,eAAe,OAAO,kBAAkB,UAAU;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/sp-color-wheel.js
CHANGED
package/sp-color-wheel.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-color-wheel.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { ColorWheel } from './src/ColorWheel.js';\n\ncustomElements.define('sp-color-wheel', ColorWheel);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-color-wheel': ColorWheel;\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAYA,OAAS,cAAAA,MAAkB,sBAE3B,eAAe,OAAO,iBAAkBA,CAAU",
|
|
6
|
+
"names": ["ColorWheel"]
|
|
7
7
|
}
|
package/src/ColorWheel.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSResultArray, PropertyValues, TemplateResult } from '@spectrum-web-components/base';
|
|
2
2
|
import { Focusable } from '@spectrum-web-components/shared/src/focusable.js';
|
|
3
3
|
import '@spectrum-web-components/color-handle/sp-color-handle.js';
|
|
4
|
-
import { ColorValue } from '@spectrum-web-components/
|
|
4
|
+
import { ColorValue } from '@spectrum-web-components/reactive-controllers/src/Color.js';
|
|
5
5
|
/**
|
|
6
6
|
* @element sp-color-wheel
|
|
7
7
|
* @slot gradient - a custom gradient visually outlining the available color values
|
|
@@ -15,15 +15,11 @@ export declare class ColorWheel extends Focusable {
|
|
|
15
15
|
private handle;
|
|
16
16
|
label: string;
|
|
17
17
|
step: number;
|
|
18
|
+
private colorController;
|
|
18
19
|
get value(): number;
|
|
19
20
|
set value(hue: number);
|
|
20
|
-
private _value;
|
|
21
21
|
get color(): ColorValue;
|
|
22
22
|
set color(color: ColorValue);
|
|
23
|
-
private _color;
|
|
24
|
-
private _previousColor;
|
|
25
|
-
private _saturation;
|
|
26
|
-
private _format;
|
|
27
23
|
private get altered();
|
|
28
24
|
private set altered(value);
|
|
29
25
|
private _altered;
|
package/src/ColorWheel.dev.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -20,12 +21,10 @@ import {
|
|
|
20
21
|
import { streamingListener } from "@spectrum-web-components/base/src/streaming-listener.js";
|
|
21
22
|
import { Focusable } from "@spectrum-web-components/shared/src/focusable.js";
|
|
22
23
|
import "@spectrum-web-components/color-handle/sp-color-handle.js";
|
|
23
|
-
import styles from "./color-wheel.css.js";
|
|
24
24
|
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
import { TinyColor } from "@ctrl/tinycolor";
|
|
25
|
+
ColorController
|
|
26
|
+
} from "@spectrum-web-components/reactive-controllers/src/Color.js";
|
|
27
|
+
import styles from "./color-wheel.css.js";
|
|
29
28
|
export class ColorWheel extends Focusable {
|
|
30
29
|
constructor() {
|
|
31
30
|
super(...arguments);
|
|
@@ -33,13 +32,16 @@ export class ColorWheel extends Focusable {
|
|
|
33
32
|
this.focused = false;
|
|
34
33
|
this.label = "hue";
|
|
35
34
|
this.step = 1;
|
|
36
|
-
this.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
this.colorController = new ColorController(this, {
|
|
36
|
+
applyColorToState: () => {
|
|
37
|
+
return;
|
|
38
|
+
},
|
|
39
|
+
extractColorFromState: (controller) => ({
|
|
40
|
+
...controller.getColor("hsl"),
|
|
41
|
+
h: this.value
|
|
42
|
+
}),
|
|
43
|
+
maintains: "saturation"
|
|
44
|
+
});
|
|
43
45
|
this._altered = 0;
|
|
44
46
|
this._pointerDown = false;
|
|
45
47
|
}
|
|
@@ -47,86 +49,16 @@ export class ColorWheel extends Focusable {
|
|
|
47
49
|
return [styles];
|
|
48
50
|
}
|
|
49
51
|
get value() {
|
|
50
|
-
return this.
|
|
52
|
+
return this.colorController.hue;
|
|
51
53
|
}
|
|
52
54
|
set value(hue) {
|
|
53
|
-
|
|
54
|
-
if (value === this.value) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
const oldValue = this.value;
|
|
58
|
-
const { s, v } = this._color.toHsv();
|
|
59
|
-
this._color = new TinyColor({ h: value, s, v });
|
|
60
|
-
this._value = value;
|
|
61
|
-
this.requestUpdate("value", oldValue);
|
|
55
|
+
this.colorController.hue = hue;
|
|
62
56
|
}
|
|
63
57
|
get color() {
|
|
64
|
-
|
|
65
|
-
case "rgb":
|
|
66
|
-
return this._format.isString ? this._color.toRgbString() : this._color.toRgb();
|
|
67
|
-
case "prgb":
|
|
68
|
-
return this._format.isString ? this._color.toPercentageRgbString() : this._color.toPercentageRgb();
|
|
69
|
-
case "hex":
|
|
70
|
-
case "hex3":
|
|
71
|
-
case "hex4":
|
|
72
|
-
case "hex6":
|
|
73
|
-
return this._format.isString ? this._color.toHexString() : this._color.toHex();
|
|
74
|
-
case "hex8":
|
|
75
|
-
return this._format.isString ? this._color.toHex8String() : this._color.toHex8();
|
|
76
|
-
case "name":
|
|
77
|
-
return this._color.toName() || this._color.toRgbString();
|
|
78
|
-
case "hsl":
|
|
79
|
-
if (this._format.isString) {
|
|
80
|
-
const hslString = this._color.toHslString();
|
|
81
|
-
return hslString.replace(replaceHueAndSaturationRegExp, `$1${this.value}$2${this._saturation}`);
|
|
82
|
-
} else {
|
|
83
|
-
const { s, l, a } = this._color.toHsl();
|
|
84
|
-
return { h: this.value, s, l, a };
|
|
85
|
-
}
|
|
86
|
-
case "hsv":
|
|
87
|
-
if (this._format.isString) {
|
|
88
|
-
const hsvString = this._color.toHsvString();
|
|
89
|
-
return hsvString.replace(replaceHueAndSaturationRegExp, `$1${this.value}$2${this._saturation}`);
|
|
90
|
-
} else {
|
|
91
|
-
const { s, v, a } = this._color.toHsv();
|
|
92
|
-
return { h: this.value, s, v, a };
|
|
93
|
-
}
|
|
94
|
-
default:
|
|
95
|
-
return "No color format applied.";
|
|
96
|
-
}
|
|
58
|
+
return this.colorController.color;
|
|
97
59
|
}
|
|
98
60
|
set color(color) {
|
|
99
|
-
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const oldValue = this._color;
|
|
103
|
-
this._color = new TinyColor(color);
|
|
104
|
-
const format = this._color.format;
|
|
105
|
-
let isString = typeof color === "string" || color instanceof String;
|
|
106
|
-
if (format.startsWith("hex")) {
|
|
107
|
-
isString = color.startsWith("#");
|
|
108
|
-
}
|
|
109
|
-
this._format = {
|
|
110
|
-
format,
|
|
111
|
-
isString
|
|
112
|
-
};
|
|
113
|
-
if (isString && format.startsWith("hs")) {
|
|
114
|
-
const values = extractHueAndSaturationRegExp.exec(color);
|
|
115
|
-
if (values !== null) {
|
|
116
|
-
const [, h, s] = values;
|
|
117
|
-
this.value = Number(h);
|
|
118
|
-
this._saturation = Number(s);
|
|
119
|
-
}
|
|
120
|
-
} else if (!isString && format.startsWith("hs")) {
|
|
121
|
-
const colorInput = this._color.originalInput;
|
|
122
|
-
const colorValues = Object.values(colorInput);
|
|
123
|
-
this.value = colorValues[0];
|
|
124
|
-
this._saturation = colorValues[1];
|
|
125
|
-
} else {
|
|
126
|
-
const { h } = this._color.toHsv();
|
|
127
|
-
this.value = h;
|
|
128
|
-
}
|
|
129
|
-
this.requestUpdate("color", oldValue);
|
|
61
|
+
this.colorController.color = color;
|
|
130
62
|
}
|
|
131
63
|
get altered() {
|
|
132
64
|
return this._altered;
|
|
@@ -141,7 +73,9 @@ export class ColorWheel extends Focusable {
|
|
|
141
73
|
handleKeydown(event) {
|
|
142
74
|
const { key } = event;
|
|
143
75
|
this.focused = true;
|
|
144
|
-
this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(
|
|
76
|
+
this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(
|
|
77
|
+
(key2) => !!key2
|
|
78
|
+
).length;
|
|
145
79
|
let delta = 0;
|
|
146
80
|
switch (key) {
|
|
147
81
|
case "ArrowUp":
|
|
@@ -161,32 +95,38 @@ export class ColorWheel extends Focusable {
|
|
|
161
95
|
}
|
|
162
96
|
event.preventDefault();
|
|
163
97
|
this.value = (360 + this.value + delta) % 360;
|
|
164
|
-
this.
|
|
165
|
-
this.
|
|
166
|
-
this.dispatchEvent(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
98
|
+
this.colorController.savePreviousColor();
|
|
99
|
+
this.colorController.applyColorFromState();
|
|
100
|
+
this.dispatchEvent(
|
|
101
|
+
new Event("input", {
|
|
102
|
+
bubbles: true,
|
|
103
|
+
composed: true
|
|
104
|
+
})
|
|
105
|
+
);
|
|
106
|
+
const applyDefault = this.dispatchEvent(
|
|
107
|
+
new Event("change", {
|
|
108
|
+
bubbles: true,
|
|
109
|
+
composed: true,
|
|
110
|
+
cancelable: true
|
|
111
|
+
})
|
|
112
|
+
);
|
|
175
113
|
if (!applyDefault) {
|
|
176
|
-
this.
|
|
114
|
+
this.colorController.restorePreviousColor();
|
|
177
115
|
}
|
|
178
116
|
}
|
|
179
117
|
handleInput(event) {
|
|
180
118
|
const { valueAsNumber } = event.target;
|
|
181
119
|
this.value = valueAsNumber;
|
|
182
|
-
this.
|
|
120
|
+
this.colorController.applyColorFromState();
|
|
183
121
|
}
|
|
184
122
|
handleChange(event) {
|
|
185
123
|
this.handleInput(event);
|
|
186
|
-
this.dispatchEvent(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
124
|
+
this.dispatchEvent(
|
|
125
|
+
new Event("change", {
|
|
126
|
+
bubbles: true,
|
|
127
|
+
composed: true
|
|
128
|
+
})
|
|
129
|
+
);
|
|
190
130
|
}
|
|
191
131
|
focus(focusOptions = {}) {
|
|
192
132
|
super.focus(focusOptions);
|
|
@@ -212,7 +152,7 @@ export class ColorWheel extends Focusable {
|
|
|
212
152
|
return;
|
|
213
153
|
}
|
|
214
154
|
this._pointerDown = true;
|
|
215
|
-
this.
|
|
155
|
+
this.colorController.savePreviousColor();
|
|
216
156
|
this.boundingClientRect = this.getBoundingClientRect();
|
|
217
157
|
event.target.setPointerCapture(event.pointerId);
|
|
218
158
|
if (event.pointerType === "mouse") {
|
|
@@ -221,23 +161,27 @@ export class ColorWheel extends Focusable {
|
|
|
221
161
|
}
|
|
222
162
|
handlePointermove(event) {
|
|
223
163
|
this.value = this.calculateHandlePosition(event);
|
|
224
|
-
this.
|
|
225
|
-
this.dispatchEvent(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
164
|
+
this.colorController.applyColorFromState();
|
|
165
|
+
this.dispatchEvent(
|
|
166
|
+
new Event("input", {
|
|
167
|
+
bubbles: true,
|
|
168
|
+
composed: true,
|
|
169
|
+
cancelable: true
|
|
170
|
+
})
|
|
171
|
+
);
|
|
230
172
|
}
|
|
231
173
|
handlePointerup(event) {
|
|
232
174
|
this._pointerDown = false;
|
|
233
175
|
event.target.releasePointerCapture(event.pointerId);
|
|
234
|
-
const applyDefault = this.dispatchEvent(
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
176
|
+
const applyDefault = this.dispatchEvent(
|
|
177
|
+
new Event("change", {
|
|
178
|
+
bubbles: true,
|
|
179
|
+
composed: true,
|
|
180
|
+
cancelable: true
|
|
181
|
+
})
|
|
182
|
+
);
|
|
239
183
|
if (!applyDefault) {
|
|
240
|
-
this.
|
|
184
|
+
this.colorController.restorePreviousColor();
|
|
241
185
|
}
|
|
242
186
|
this.focus();
|
|
243
187
|
if (event.pointerType === "mouse") {
|
|
@@ -263,7 +207,14 @@ export class ColorWheel extends Focusable {
|
|
|
263
207
|
}
|
|
264
208
|
event.stopPropagation();
|
|
265
209
|
event.preventDefault();
|
|
266
|
-
|
|
210
|
+
const { button, pointerId, pointerType } = event;
|
|
211
|
+
this.handle.dispatchEvent(
|
|
212
|
+
new PointerEvent("pointerdown", {
|
|
213
|
+
button,
|
|
214
|
+
pointerId,
|
|
215
|
+
pointerType
|
|
216
|
+
})
|
|
217
|
+
);
|
|
267
218
|
this.handlePointermove(event);
|
|
268
219
|
}
|
|
269
220
|
render() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["ColorWheel.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { streamingListener } from '@spectrum-web-components/base/src/streaming-listener.js';\nimport { SWCResizeObserverEntry, WithSWCResizeObserver } from './types';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport '@spectrum-web-components/color-handle/sp-color-handle.js';\nimport styles from './color-wheel.css.js';\nimport {\n ColorHandle,\n ColorValue,\n extractHueAndSaturationRegExp,\n replaceHueAndSaturationRegExp,\n} from '@spectrum-web-components/color-handle';\nimport { TinyColor } from '@ctrl/tinycolor';\n\n/**\n * @element sp-color-wheel\n * @slot gradient - a custom gradient visually outlining the available color values\n * @fires input - The value of the Color Wheel has changed.\n * @fires change - An alteration to the value of the Color Wheel has been committed by the user.\n */\nexport class ColorWheel extends Focusable {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Boolean, reflect: true })\n public override disabled = false;\n\n @property({ type: Boolean, reflect: true })\n public focused = false;\n\n @query('.handle')\n private handle!: ColorHandle;\n\n @property({ type: String })\n public label = 'hue';\n\n @property({ type: Number })\n public step = 1;\n\n @property({ type: Number })\n public get value(): number {\n return this._value;\n }\n\n public set value(hue: number) {\n const value = Math.min(360, Math.max(0, hue));\n if (value === this.value) {\n return;\n }\n const oldValue = this.value;\n const { s, v } = this._color.toHsv();\n this._color = new TinyColor({ h: value, s, v });\n this._value = value;\n this.requestUpdate('value', oldValue);\n }\n\n private _value = 0;\n\n @property({ type: String })\n public get color(): ColorValue {\n switch (this._format.format) {\n case 'rgb':\n return this._format.isString\n ? this._color.toRgbString()\n : this._color.toRgb();\n case 'prgb':\n return this._format.isString\n ? this._color.toPercentageRgbString()\n : this._color.toPercentageRgb();\n case 'hex':\n case 'hex3':\n case 'hex4':\n case 'hex6':\n return this._format.isString\n ? this._color.toHexString()\n : this._color.toHex();\n case 'hex8':\n return this._format.isString\n ? this._color.toHex8String()\n : this._color.toHex8();\n case 'name':\n return this._color.toName() || this._color.toRgbString();\n case 'hsl':\n if (this._format.isString) {\n const hslString = this._color.toHslString();\n return hslString.replace(\n replaceHueAndSaturationRegExp,\n `$1${this.value}$2${this._saturation}`\n );\n } else {\n const { s, l, a } = this._color.toHsl();\n return { h: this.value, s, l, a };\n }\n case 'hsv':\n if (this._format.isString) {\n const hsvString = this._color.toHsvString();\n return hsvString.replace(\n replaceHueAndSaturationRegExp,\n `$1${this.value}$2${this._saturation}`\n );\n } else {\n const { s, v, a } = this._color.toHsv();\n return { h: this.value, s, v, a };\n }\n default:\n return 'No color format applied.';\n }\n }\n\n public set color(color: ColorValue) {\n if (color === this.color) {\n return;\n }\n const oldValue = this._color;\n this._color = new TinyColor(color);\n const format = this._color.format;\n let isString = typeof color === 'string' || color instanceof String;\n\n if (format.startsWith('hex')) {\n isString = (color as string).startsWith('#');\n }\n\n this._format = {\n format,\n isString,\n };\n\n if (isString && format.startsWith('hs')) {\n const values = extractHueAndSaturationRegExp.exec(color as string);\n\n if (values !== null) {\n const [, h, s] = values;\n this.value = Number(h);\n this._saturation = Number(s);\n }\n } else if (!isString && format.startsWith('hs')) {\n const colorInput = this._color.originalInput;\n const colorValues = Object.values(colorInput);\n this.value = colorValues[0];\n this._saturation = colorValues[1];\n } else {\n const { h } = this._color.toHsv();\n this.value = h;\n }\n this.requestUpdate('color', oldValue);\n }\n\n private _color = new TinyColor({ h: 0, s: 1, v: 1 });\n\n private _previousColor = new TinyColor({ h: 0, s: 1, v: 1 });\n\n private _saturation!: number;\n\n private _format: { format: string; isString: boolean } = {\n format: '',\n isString: false,\n };\n private get altered(): number {\n return this._altered;\n }\n\n private set altered(altered: number) {\n this._altered = altered;\n this.step = Math.max(1, this.altered * 10);\n }\n\n private _altered = 0;\n\n @query('input')\n public input!: HTMLInputElement;\n\n public override get focusElement(): HTMLInputElement {\n return this.input;\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n const { key } = event;\n this.focused = true;\n this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(\n (key) => !!key\n ).length;\n let delta = 0;\n switch (key) {\n case 'ArrowUp':\n delta = this.step;\n break;\n case 'ArrowDown':\n delta = -this.step;\n break;\n case 'ArrowLeft':\n delta = this.step * (this.isLTR ? -1 : 1);\n break;\n case 'ArrowRight':\n delta = this.step * (this.isLTR ? 1 : -1);\n break;\n default:\n return;\n }\n event.preventDefault();\n this.value = (360 + this.value + delta) % 360;\n this._previousColor = this._color.clone();\n this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\n );\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n if (!applyDefault) {\n this._color = this._previousColor;\n }\n }\n\n private handleInput(event: Event & { target: HTMLInputElement }): void {\n const { valueAsNumber } = event.target;\n\n this.value = valueAsNumber;\n this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });\n }\n\n private handleChange(event: Event & { target: HTMLInputElement }): void {\n this.handleInput(event);\n this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n public override focus(focusOptions: FocusOptions = {}): void {\n super.focus(focusOptions);\n this.forwardFocus();\n }\n\n private forwardFocus(): void {\n this.focused = this.hasVisibleFocusInTree();\n this.input.focus();\n }\n\n private handleFocusin(): void {\n this.focused = true;\n }\n\n private handleFocusout(): void {\n if (this._pointerDown) {\n return;\n }\n this.altered = 0;\n this.focused = false;\n }\n\n private boundingClientRect!: DOMRect;\n private _pointerDown = false;\n\n private handlePointerdown(event: PointerEvent): void {\n if (event.button !== 0) {\n event.preventDefault();\n return;\n }\n this._pointerDown = true;\n this._previousColor = this._color.clone();\n this.boundingClientRect = this.getBoundingClientRect();\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n if (event.pointerType === 'mouse') {\n this.focused = true;\n }\n }\n\n private handlePointermove(event: PointerEvent): void {\n this.value = this.calculateHandlePosition(event);\n this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });\n\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n }\n\n private handlePointerup(event: PointerEvent): void {\n this._pointerDown = false;\n (event.target as HTMLElement).releasePointerCapture(event.pointerId);\n\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n if (!applyDefault) {\n this._color = this._previousColor;\n }\n // Retain focus on input element after mouse up to enable keyboard interactions\n this.focus();\n if (event.pointerType === 'mouse') {\n this.focused = false;\n }\n }\n\n /**\n * Returns the value under the cursor\n * @param: PointerEvent on slider\n * @return: Slider value that correlates to the position under the pointer\n */\n private calculateHandlePosition(event: PointerEvent): number {\n /* c8 ignore next 3 */\n if (!this.boundingClientRect) {\n return this.value;\n }\n const rect = this.boundingClientRect;\n const { width, height, left, top } = rect;\n const centerX = left + width / 2;\n const centerY = top + height / 2;\n const pointX = event.clientX - centerX;\n const pointY = event.clientY - centerY;\n const value = (Math.atan2(pointY, pointX) * 180) / Math.PI;\n\n return (360 + (360 + value)) % 360;\n }\n\n private handleGradientPointerdown(event: PointerEvent): void {\n if (\n event.button !== 0 ||\n (event.target as SVGElement).classList.contains('innerCircle')\n ) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n this.handle.dispatchEvent(new PointerEvent('pointerdown', event));\n this.handlePointermove(event);\n }\n\n protected override render(): TemplateResult {\n const { width: diameter = 160 } = this.boundingClientRect || {};\n\n const radius = diameter / 2;\n const trackWidth = 24;\n const innerRadius = radius - trackWidth;\n const innerDiameter = innerRadius * 2;\n const clipPath = `path(evenodd, \"M ${radius} ${radius} m -${radius} 0 a ${radius} ${radius} 0 1 0 ${diameter} 0 a ${radius} ${radius} 0 1 0 -${diameter} 0 M ${radius} ${radius} m -${innerRadius} 0 a ${innerRadius} ${innerRadius} 0 1 0 ${innerDiameter} 0 a ${innerRadius} ${innerRadius} 0 1 0 -${innerDiameter} 0\")`;\n const handleLocationStyles = `transform: translate(${\n (radius - 12.5) * Math.cos((this.value * Math.PI) / 180)\n }px, ${(radius - 12.5) * Math.sin((this.value * Math.PI) / 180)}px);`;\n return html`\n <slot\n name=\"gradient\"\n @pointerdown=${this.handleGradientPointerdown}\n >\n <div class=\"wheel\" style=\"clip-path: ${clipPath}\"></div>\n </slot>\n\n <sp-color-handle\n tabindex=${ifDefined(this.focused ? undefined : '0')}\n @focus=${this.forwardFocus}\n ?focused=${this.focused}\n class=\"handle\"\n color=\"hsl(${this.value}, 100%, 50%)\"\n ?disabled=${this.disabled}\n style=${handleLocationStyles}\n ${streamingListener({\n start: ['pointerdown', this.handlePointerdown],\n streamInside: ['pointermove', this.handlePointermove],\n end: [['pointerup', 'pointercancel'], this.handlePointerup],\n })}\n ></sp-color-handle>\n\n <input\n type=\"range\"\n class=\"slider\"\n aria-label=${this.label}\n min=\"0\"\n max=\"360\"\n step=${this.step}\n .value=${String(this.value)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n @keydown=${this.handleKeydown}\n />\n `;\n }\n\n protected override firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n this.boundingClientRect = this.getBoundingClientRect();\n this.addEventListener('focusin', this.handleFocusin);\n this.addEventListener('focusout', this.handleFocusout);\n }\n\n private observer?: WithSWCResizeObserver['ResizeObserver'];\n\n public override connectedCallback(): void {\n super.connectedCallback();\n if (\n !this.observer &&\n (window as unknown as WithSWCResizeObserver).ResizeObserver\n ) {\n this.observer = new (\n window as unknown as WithSWCResizeObserver\n ).ResizeObserver((entries: SWCResizeObserverEntry[]) => {\n for (const entry of entries) {\n this.boundingClientRect = entry.contentRect;\n }\n this.requestUpdate();\n });\n }\n this.observer?.observe(this);\n }\n\n public override disconnectedCallback(): void {\n this.observer?.unobserve(this);\n super.disconnectedCallback();\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { streamingListener } from '@spectrum-web-components/base/src/streaming-listener.js';\nimport { SWCResizeObserverEntry, WithSWCResizeObserver } from './types';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport type { ColorHandle } from '@spectrum-web-components/color-handle';\nimport '@spectrum-web-components/color-handle/sp-color-handle.js';\nimport {\n ColorController,\n ColorValue,\n HSL,\n} from '@spectrum-web-components/reactive-controllers/src/Color.js';\n\nimport styles from './color-wheel.css.js';\n\n/**\n * @element sp-color-wheel\n * @slot gradient - a custom gradient visually outlining the available color values\n * @fires input - The value of the Color Wheel has changed.\n * @fires change - An alteration to the value of the Color Wheel has been committed by the user.\n */\nexport class ColorWheel extends Focusable {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Boolean, reflect: true })\n public override disabled = false;\n\n @property({ type: Boolean, reflect: true })\n public focused = false;\n\n @query('.handle')\n private handle!: ColorHandle;\n\n @property({ type: String })\n public label = 'hue';\n\n @property({ type: Number })\n public step = 1;\n\n private colorController = new ColorController(this, {\n /* c8 ignore next 3 */\n applyColorToState: () => {\n return;\n },\n extractColorFromState: (controller) => ({\n ...(controller.getColor('hsl') as HSL),\n h: this.value,\n }),\n maintains: 'saturation',\n });\n\n @property({ type: Number })\n public get value(): number {\n return this.colorController.hue;\n }\n\n public set value(hue: number) {\n this.colorController.hue = hue;\n }\n\n @property({ type: String })\n public get color(): ColorValue {\n return this.colorController.color;\n }\n\n public set color(color: ColorValue) {\n this.colorController.color = color;\n }\n\n private get altered(): number {\n return this._altered;\n }\n\n private set altered(altered: number) {\n this._altered = altered;\n this.step = Math.max(1, this.altered * 10);\n }\n\n private _altered = 0;\n\n @query('input')\n public input!: HTMLInputElement;\n\n public override get focusElement(): HTMLInputElement {\n return this.input;\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n const { key } = event;\n this.focused = true;\n this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(\n (key) => !!key\n ).length;\n let delta = 0;\n switch (key) {\n case 'ArrowUp':\n delta = this.step;\n break;\n case 'ArrowDown':\n delta = -this.step;\n break;\n case 'ArrowLeft':\n delta = this.step * (this.isLTR ? -1 : 1);\n break;\n case 'ArrowRight':\n delta = this.step * (this.isLTR ? 1 : -1);\n break;\n default:\n return;\n }\n event.preventDefault();\n this.value = (360 + this.value + delta) % 360;\n this.colorController.savePreviousColor();\n this.colorController.applyColorFromState();\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\n );\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n if (!applyDefault) {\n this.colorController.restorePreviousColor();\n }\n }\n\n private handleInput(event: Event & { target: HTMLInputElement }): void {\n const { valueAsNumber } = event.target;\n\n this.value = valueAsNumber;\n this.colorController.applyColorFromState();\n }\n\n private handleChange(event: Event & { target: HTMLInputElement }): void {\n this.handleInput(event);\n this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n public override focus(focusOptions: FocusOptions = {}): void {\n super.focus(focusOptions);\n this.forwardFocus();\n }\n\n private forwardFocus(): void {\n this.focused = this.hasVisibleFocusInTree();\n this.input.focus();\n }\n\n private handleFocusin(): void {\n this.focused = true;\n }\n\n private handleFocusout(): void {\n if (this._pointerDown) {\n return;\n }\n this.altered = 0;\n this.focused = false;\n }\n\n private boundingClientRect!: DOMRect;\n private _pointerDown = false;\n\n private handlePointerdown(event: PointerEvent): void {\n if (event.button !== 0) {\n event.preventDefault();\n return;\n }\n this._pointerDown = true;\n this.colorController.savePreviousColor();\n this.boundingClientRect = this.getBoundingClientRect();\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n if (event.pointerType === 'mouse') {\n this.focused = true;\n }\n }\n\n private handlePointermove(event: PointerEvent): void {\n this.value = this.calculateHandlePosition(event);\n this.colorController.applyColorFromState();\n\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n }\n\n private handlePointerup(event: PointerEvent): void {\n this._pointerDown = false;\n (event.target as HTMLElement).releasePointerCapture(event.pointerId);\n\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n if (!applyDefault) {\n this.colorController.restorePreviousColor();\n }\n // Retain focus on input element after mouse up to enable keyboard interactions\n this.focus();\n if (event.pointerType === 'mouse') {\n this.focused = false;\n }\n }\n\n /**\n * Returns the value under the cursor\n * @param: PointerEvent on slider\n * @return: Slider value that correlates to the position under the pointer\n */\n private calculateHandlePosition(event: PointerEvent): number {\n /* c8 ignore next 3 */\n if (!this.boundingClientRect) {\n return this.value;\n }\n const rect = this.boundingClientRect;\n const { width, height, left, top } = rect;\n const centerX = left + width / 2;\n const centerY = top + height / 2;\n const pointX = event.clientX - centerX;\n const pointY = event.clientY - centerY;\n const value = (Math.atan2(pointY, pointX) * 180) / Math.PI;\n\n return (360 + (360 + value)) % 360;\n }\n\n private handleGradientPointerdown(event: PointerEvent): void {\n if (\n event.button !== 0 ||\n (event.target as SVGElement).classList.contains('innerCircle')\n ) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n const { button, pointerId, pointerType } = event;\n this.handle.dispatchEvent(\n new PointerEvent('pointerdown', {\n button,\n pointerId,\n pointerType,\n })\n );\n this.handlePointermove(event);\n }\n\n protected override render(): TemplateResult {\n const { width: diameter = 160 } = this.boundingClientRect || {};\n\n const radius = diameter / 2;\n const trackWidth = 24;\n const innerRadius = radius - trackWidth;\n const innerDiameter = innerRadius * 2;\n const clipPath = `path(evenodd, \"M ${radius} ${radius} m -${radius} 0 a ${radius} ${radius} 0 1 0 ${diameter} 0 a ${radius} ${radius} 0 1 0 -${diameter} 0 M ${radius} ${radius} m -${innerRadius} 0 a ${innerRadius} ${innerRadius} 0 1 0 ${innerDiameter} 0 a ${innerRadius} ${innerRadius} 0 1 0 -${innerDiameter} 0\")`;\n const handleLocationStyles = `transform: translate(${\n (radius - 12.5) * Math.cos((this.value * Math.PI) / 180)\n }px, ${(radius - 12.5) * Math.sin((this.value * Math.PI) / 180)}px);`;\n return html`\n <slot\n name=\"gradient\"\n @pointerdown=${this.handleGradientPointerdown}\n >\n <div class=\"wheel\" style=\"clip-path: ${clipPath}\"></div>\n </slot>\n\n <sp-color-handle\n tabindex=${ifDefined(this.focused ? undefined : '0')}\n @focus=${this.forwardFocus}\n ?focused=${this.focused}\n class=\"handle\"\n color=\"hsl(${this.value}, 100%, 50%)\"\n ?disabled=${this.disabled}\n style=${handleLocationStyles}\n ${streamingListener({\n start: ['pointerdown', this.handlePointerdown],\n streamInside: ['pointermove', this.handlePointermove],\n end: [['pointerup', 'pointercancel'], this.handlePointerup],\n })}\n ></sp-color-handle>\n\n <input\n type=\"range\"\n class=\"slider\"\n aria-label=${this.label}\n min=\"0\"\n max=\"360\"\n step=${this.step}\n .value=${String(this.value)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n @keydown=${this.handleKeydown}\n />\n `;\n }\n\n protected override firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n this.boundingClientRect = this.getBoundingClientRect();\n this.addEventListener('focusin', this.handleFocusin);\n this.addEventListener('focusout', this.handleFocusout);\n }\n\n private observer?: WithSWCResizeObserver['ResizeObserver'];\n\n public override connectedCallback(): void {\n super.connectedCallback();\n if (\n !this.observer &&\n (window as unknown as WithSWCResizeObserver).ResizeObserver\n ) {\n this.observer = new (\n window as unknown as WithSWCResizeObserver\n ).ResizeObserver((entries: SWCResizeObserverEntry[]) => {\n for (const entry of entries) {\n this.boundingClientRect = entry.contentRect;\n }\n this.requestUpdate();\n });\n }\n this.observer?.observe(this);\n }\n\n public override disconnectedCallback(): void {\n this.observer?.unobserve(this);\n super.disconnectedCallback();\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,OAGG;AACP,SAAS,iBAAiB;AAC1B;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP,SAAS,yBAAyB;AAElC,SAAS,iBAAiB;AAE1B,OAAO;AACP;AAAA,EACI;AAAA,OAGG;AAEP,OAAO,YAAY;AAQZ,aAAM,mBAAmB,UAAU;AAAA,EAAnC;AAAA;AAMH,SAAgB,WAAW;AAG3B,SAAO,UAAU;AAMjB,SAAO,QAAQ;AAGf,SAAO,OAAO;AAEd,SAAQ,kBAAkB,IAAI,gBAAgB,MAAM;AAAA,MAEhD,mBAAmB,MAAM;AACrB;AAAA,MACJ;AAAA,MACA,uBAAuB,CAAC,gBAAgB;AAAA,QACpC,GAAI,WAAW,SAAS,KAAK;AAAA,QAC7B,GAAG,KAAK;AAAA,MACZ;AAAA,MACA,WAAW;AAAA,IACf,CAAC;AA6BD,SAAQ,WAAW;AA8FnB,SAAQ,eAAe;AAAA;AAAA,EAxJvB,WAA2B,SAAyB;AAChD,WAAO,CAAC,MAAM;AAAA,EAClB;AAAA,EA8BA,IAAW,QAAgB;AACvB,WAAO,KAAK,gBAAgB;AAAA,EAChC;AAAA,EAEA,IAAW,MAAM,KAAa;AAC1B,SAAK,gBAAgB,MAAM;AAAA,EAC/B;AAAA,EAGA,IAAW,QAAoB;AAC3B,WAAO,KAAK,gBAAgB;AAAA,EAChC;AAAA,EAEA,IAAW,MAAM,OAAmB;AAChC,SAAK,gBAAgB,QAAQ;AAAA,EACjC;AAAA,EAEA,IAAY,UAAkB;AAC1B,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAY,QAAQ,SAAiB;AACjC,SAAK,WAAW;AAChB,SAAK,OAAO,KAAK,IAAI,G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