@spectrum-web-components/color-area 0.4.4 → 0.4.7
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/package.json +5 -5
- package/src/color-area.css.js +1 -1
- package/src/color-area.css.js.map +1 -1
- package/src/spectrum-color-area.css.js +1 -1
- package/src/spectrum-color-area.css.js.map +1 -1
- package/stories/color-area.stories.js +141 -0
- package/stories/color-area.stories.js.map +1 -0
- package/test/benchmark/basic-test.js +18 -0
- package/test/benchmark/basic-test.js.map +1 -0
- package/test/color-area.test-vrt.js +15 -0
- package/test/color-area.test-vrt.js.map +1 -0
- package/test/color-area.test.js +554 -0
- package/test/color-area.test.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/color-area",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@ctrl/tinycolor": "^3.3.3",
|
|
48
|
-
"@spectrum-web-components/base": "^0.5.
|
|
49
|
-
"@spectrum-web-components/color-handle": "^0.3.
|
|
48
|
+
"@spectrum-web-components/base": "^0.5.6",
|
|
49
|
+
"@spectrum-web-components/color-handle": "^0.3.7",
|
|
50
50
|
"tslib": "^2.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@spectrum-css/colorarea": "^1.0.
|
|
53
|
+
"@spectrum-css/colorarea": "^1.0.20"
|
|
54
54
|
},
|
|
55
55
|
"types": "./src/index.d.ts",
|
|
56
56
|
"customElements": "custom-elements.json",
|
|
57
57
|
"sideEffects": [
|
|
58
58
|
"./sp-*.js"
|
|
59
59
|
],
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "32e049a0da090ffc1a54cfe3234be4d5efc73339"
|
|
61
61
|
}
|
package/src/color-area.css.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright
|
|
2
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
3
3
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-area.css.js","sourceRoot":"","sources":["color-area.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCjB,CAAC;AACF,eAAe,MAAM,CAAC","sourcesContent":["/*\nCopyright
|
|
1
|
+
{"version":3,"file":"color-area.css.js","sourceRoot":"","sources":["color-area.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCjB,CAAC;AACF,eAAe,MAAM,CAAC","sourcesContent":["/*\nCopyright 2022 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*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n.slider{height:100%;left:0;margin:0;opacity:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:0}:host([focused]) .handle{height:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2);margin-left:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);margin-top:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);width:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2)}:host{border-radius:var(\n--spectrum-colorarea-border-radius,var(--spectrum-alias-border-radius-regular)\n);cursor:default;display:inline-block;height:var(\n--spectrum-colorarea-default-height,var(--spectrum-global-dimension-size-2400)\n);position:relative;-webkit-user-select:none;user-select:none;width:var(\n--spectrum-colorarea-default-width,var(--spectrum-global-dimension-size-2400)\n)}:host([focused]){z-index:2}:host([disabled]){pointer-events:none}:host:before{border-radius:var(\n--spectrum-colorarea-border-radius,var(--spectrum-alias-border-radius-regular)\n);bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;z-index:1}.handle{left:0;top:0}.gradient{border-radius:var(\n--spectrum-colorarea-border-radius,var(--spectrum-alias-border-radius-regular)\n);height:100%;width:100%}:host:before{box-shadow:inset 0 0 0 var(\n--spectrum-colorarea-border-size,var(--spectrum-alias-border-size-thin)\n) var(\n--spectrum-colorarea-border-color,var(--spectrum-alias-border-color-translucent)\n)}.gradient{forced-color-adjust:none}:host([disabled]){background:var(\n--spectrum-colorarea-fill-color-disabled,var(--spectrum-alias-track-color-disabled)\n)}:host([disabled]):before{box-shadow:inset 0 0 0 var(\n--spectrum-colorarea-border-size,var(--spectrum-alias-border-size-thin)\n) var(\n--spectrum-colorarea-border-color-disabled,var(--spectrum-alias-track-color-disabled)\n)}:host([disabled]) .gradient{display:none}@media (forced-colors:active){:host{--spectrum-colorarea-fill-color-disabled:GrayText}:host([disabled]){forced-color-adjust:none}}:host{touch-action:none}:host:before{pointer-events:none}.gradient{overflow:hidden}.handle{transform:translate(var(--spectrum-colorarea-default-width))}::slotted(*){height:100%;width:100%}\n`;\nexport default styles;"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright
|
|
2
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
3
3
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spectrum-color-area.css.js","sourceRoot":"","sources":["spectrum-color-area.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCjB,CAAC;AACF,eAAe,MAAM,CAAC","sourcesContent":["/*\nCopyright
|
|
1
|
+
{"version":3,"file":"spectrum-color-area.css.js","sourceRoot":"","sources":["spectrum-color-area.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCjB,CAAC;AACF,eAAe,MAAM,CAAC","sourcesContent":["/*\nCopyright 2022 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*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n.slider{height:100%;left:0;margin:0;opacity:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:0}:host([focused]) .handle{height:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2);margin-left:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);margin-top:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);width:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2)}:host{border-radius:var(\n--spectrum-colorarea-border-radius,var(--spectrum-alias-border-radius-regular)\n);cursor:default;display:inline-block;height:var(\n--spectrum-colorarea-default-height,var(--spectrum-global-dimension-size-2400)\n);position:relative;-webkit-user-select:none;user-select:none;width:var(\n--spectrum-colorarea-default-width,var(--spectrum-global-dimension-size-2400)\n)}:host([focused]){z-index:2}:host([disabled]){pointer-events:none}:host:before{border-radius:var(\n--spectrum-colorarea-border-radius,var(--spectrum-alias-border-radius-regular)\n);bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;z-index:1}.handle{left:0;top:0}.gradient{border-radius:var(\n--spectrum-colorarea-border-radius,var(--spectrum-alias-border-radius-regular)\n);height:100%;width:100%}:host:before{box-shadow:inset 0 0 0 var(\n--spectrum-colorarea-border-size,var(--spectrum-alias-border-size-thin)\n) var(\n--spectrum-colorarea-border-color,var(--spectrum-alias-border-color-translucent)\n)}.gradient{forced-color-adjust:none}:host([disabled]){background:var(\n--spectrum-colorarea-fill-color-disabled,var(--spectrum-alias-track-color-disabled)\n)}:host([disabled]):before{box-shadow:inset 0 0 0 var(\n--spectrum-colorarea-border-size,var(--spectrum-alias-border-size-thin)\n) var(\n--spectrum-colorarea-border-color-disabled,var(--spectrum-alias-track-color-disabled)\n)}:host([disabled]) .gradient{display:none}@media (forced-colors:active){:host{--spectrum-colorarea-fill-color-disabled:GrayText}:host([disabled]){forced-color-adjust:none}}\n`;\nexport default styles;"]}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { html } from '@spectrum-web-components/base';
|
|
13
|
+
import '@spectrum-web-components/color-slider/sp-color-slider.js';
|
|
14
|
+
import '../sp-color-area.js';
|
|
15
|
+
export default {
|
|
16
|
+
title: 'Color/Area',
|
|
17
|
+
component: 'sp-color-area',
|
|
18
|
+
argTypes: {
|
|
19
|
+
onInput: { action: 'input' },
|
|
20
|
+
onChange: { action: 'change' },
|
|
21
|
+
color: {
|
|
22
|
+
name: 'color',
|
|
23
|
+
type: { name: 'ColorValue', required: 'true' },
|
|
24
|
+
description: 'The color displayed by the ColorArea.',
|
|
25
|
+
table: {
|
|
26
|
+
type: { summary: 'ColorValue' },
|
|
27
|
+
defaultValue: { summary: '' },
|
|
28
|
+
},
|
|
29
|
+
control: 'text',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
export const Default = ({ onChange, onInput }) => {
|
|
34
|
+
return html `
|
|
35
|
+
<sp-color-area
|
|
36
|
+
@input=${({ target }) => {
|
|
37
|
+
const next = target.nextElementSibling;
|
|
38
|
+
next.textContent = target.color;
|
|
39
|
+
next.style.color = target.color;
|
|
40
|
+
onInput(target.value);
|
|
41
|
+
}}
|
|
42
|
+
@change=${({ target }) => {
|
|
43
|
+
onChange(target.value);
|
|
44
|
+
}}
|
|
45
|
+
></sp-color-area>
|
|
46
|
+
<div style="color: #ff0000" aria-live="off">#ff0000</div>
|
|
47
|
+
`;
|
|
48
|
+
};
|
|
49
|
+
export const joint = () => {
|
|
50
|
+
return html `
|
|
51
|
+
<div>
|
|
52
|
+
<sp-color-area
|
|
53
|
+
color="hsv (120 0% 100%)"
|
|
54
|
+
@input=${({ target }) => {
|
|
55
|
+
const next = target.nextElementSibling;
|
|
56
|
+
const display = next.nextElementSibling;
|
|
57
|
+
display.textContent = target.color;
|
|
58
|
+
display.style.color = target.color;
|
|
59
|
+
next.color = target.color;
|
|
60
|
+
}}
|
|
61
|
+
></sp-color-area>
|
|
62
|
+
<sp-color-slider
|
|
63
|
+
color="hsv(120 0% 1)"
|
|
64
|
+
@input=${({ target: { color, previousElementSibling, nextElementSibling, }, }) => {
|
|
65
|
+
previousElementSibling.color = color;
|
|
66
|
+
nextElementSibling.textContent = color;
|
|
67
|
+
nextElementSibling.style.color = color;
|
|
68
|
+
}}
|
|
69
|
+
></sp-color-slider>
|
|
70
|
+
<div style="color: hsv(120, 0, 1)">hsv(120, 0, 1)</div>
|
|
71
|
+
</div>
|
|
72
|
+
`;
|
|
73
|
+
};
|
|
74
|
+
export const disabled = () => {
|
|
75
|
+
return html `
|
|
76
|
+
<sp-color-area disabled></sp-color-area>
|
|
77
|
+
`;
|
|
78
|
+
};
|
|
79
|
+
export const sized = () => {
|
|
80
|
+
return html `
|
|
81
|
+
<sp-color-area style="width: 72px; height: 72px"></sp-color-area>
|
|
82
|
+
`;
|
|
83
|
+
};
|
|
84
|
+
export const canvas = () => {
|
|
85
|
+
return html `
|
|
86
|
+
<sp-color-area>
|
|
87
|
+
<canvas slot="gradient"></canvas>
|
|
88
|
+
</sp-color-area>
|
|
89
|
+
`;
|
|
90
|
+
};
|
|
91
|
+
class CanvasWriter extends HTMLElement {
|
|
92
|
+
constructor() {
|
|
93
|
+
super();
|
|
94
|
+
this.writeStatePromise = Promise.resolve(false);
|
|
95
|
+
this.writeStatePromise = new Promise((res) => {
|
|
96
|
+
requestAnimationFrame(() => {
|
|
97
|
+
this.writeToCanvas();
|
|
98
|
+
res(true);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
writeToCanvas() {
|
|
103
|
+
const { previousElementSibling } = this;
|
|
104
|
+
if (previousElementSibling) {
|
|
105
|
+
const canvas = previousElementSibling.querySelector('canvas[slot="gradient"]');
|
|
106
|
+
if (canvas) {
|
|
107
|
+
canvas.width = canvas.offsetWidth;
|
|
108
|
+
canvas.height = canvas.offsetHeight;
|
|
109
|
+
const context = canvas.getContext('2d');
|
|
110
|
+
if (context) {
|
|
111
|
+
context.rect(0, 0, canvas.width, canvas.height);
|
|
112
|
+
const gradB = context.createLinearGradient(0, 0, 0, canvas.height);
|
|
113
|
+
gradB.addColorStop(0, 'white');
|
|
114
|
+
gradB.addColorStop(1, 'black');
|
|
115
|
+
const gradC = context.createLinearGradient(0, 0, canvas.width, 0);
|
|
116
|
+
gradC.addColorStop(0, 'hsla(0,100%,50%,0)');
|
|
117
|
+
gradC.addColorStop(1, 'hsla(0,100%,50%,1)');
|
|
118
|
+
context.fillStyle = gradB;
|
|
119
|
+
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
120
|
+
context.fillStyle = gradC;
|
|
121
|
+
context.globalCompositeOperation = 'multiply';
|
|
122
|
+
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
123
|
+
context.globalCompositeOperation = 'source-over';
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
get updateComplete() {
|
|
129
|
+
return this.writeStatePromise;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
customElements.define('area-canvas-writer', CanvasWriter);
|
|
133
|
+
canvas.decorators = [
|
|
134
|
+
(story) => {
|
|
135
|
+
return html `
|
|
136
|
+
${story()}
|
|
137
|
+
<area-canvas-writer></area-canvas-writer>
|
|
138
|
+
`;
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
//# sourceMappingURL=color-area.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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,CAAC,MAAM,CAAC,CAAC;oBACpD,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC;oBAC1B,OAAO,CAAC,wBAAwB,GAAG,UAAU,CAAC;oBAC9C,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;oBACpD,OAAO,CAAC,wBAAwB,GAAG,aAAa,CAAC;iBACpD;aACJ;SACJ;IACL,CAAC;IAcD,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;CACJ;AAED,cAAc,CAAC,MAAM,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC;AAE1D,MAAM,CAAC,UAAU,GAAG;IAChB,CAAC,KAA2B,EAAkB,EAAE;QAC5C,OAAO,IAAI,CAAA;cACL,KAAK,EAAE;;SAEZ,CAAC;IACN,CAAC;CACJ,CAAC","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 { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/color-slider/sp-color-slider.js';\nimport { ColorSlider } from '@spectrum-web-components/color-slider/src/ColorSlider';\nimport '../sp-color-area.js';\nimport { ColorArea } from '../src/ColorArea.js';\n\nexport default {\n title: 'Color/Area',\n component: 'sp-color-area',\n argTypes: {\n onInput: { action: 'input' },\n onChange: { action: 'change' },\n color: {\n name: 'color',\n type: { name: 'ColorValue', required: 'true' },\n description: 'The color displayed by the ColorArea.',\n table: {\n type: { summary: 'ColorValue' },\n defaultValue: { summary: '' },\n },\n control: 'text',\n },\n },\n};\n\ntype StoryArgs = {\n onInput: (val: string) => void;\n onChange: (val: string) => void;\n};\n\nexport const Default = ({ onChange, onInput }: StoryArgs): TemplateResult => {\n return html`\n <sp-color-area\n @input=${({ target }: Event & { target: ColorArea }) => {\n const next = target.nextElementSibling as HTMLElement;\n next.textContent = target.color as string;\n next.style.color = target.color as string;\n onInput(target.value as string);\n }}\n @change=${({ target }: Event & { target: ColorArea }) => {\n onChange(target.value as string);\n }}\n ></sp-color-area>\n <div style=\"color: #ff0000\" aria-live=\"off\">#ff0000</div>\n `;\n};\n\nexport const joint = (): TemplateResult => {\n return html`\n <div>\n <sp-color-area\n color=\"hsv (120 0% 100%)\"\n @input=${({ target }: Event & { target: ColorArea }) => {\n const next = target.nextElementSibling as ColorSlider;\n const display = next.nextElementSibling as HTMLElement;\n display.textContent = target.color as string;\n display.style.color = target.color as string;\n next.color = target.color;\n }}\n ></sp-color-area>\n <sp-color-slider\n color=\"hsv(120 0% 1)\"\n @input=${({\n target: {\n color,\n previousElementSibling,\n nextElementSibling,\n },\n }: Event & {\n target: ColorSlider & {\n previousElementSibling: ColorArea;\n nextElementSibling: HTMLDivElement;\n };\n }): void => {\n previousElementSibling.color = color;\n nextElementSibling.textContent = color as string;\n nextElementSibling.style.color = color as string;\n }}\n ></sp-color-slider>\n <div style=\"color: hsv(120, 0, 1)\">hsv(120, 0, 1)</div>\n </div>\n `;\n};\n\nexport const disabled = (): TemplateResult => {\n return html`\n <sp-color-area disabled></sp-color-area>\n `;\n};\n\nexport const sized = (): TemplateResult => {\n return html`\n <sp-color-area style=\"width: 72px; height: 72px\"></sp-color-area>\n `;\n};\n\nexport const canvas = (): TemplateResult => {\n return html`\n <sp-color-area>\n <canvas slot=\"gradient\"></canvas>\n </sp-color-area>\n `;\n};\n\nclass CanvasWriter extends HTMLElement {\n writeToCanvas(): void {\n const { previousElementSibling } = this;\n if (previousElementSibling) {\n const canvas = previousElementSibling.querySelector(\n 'canvas[slot=\"gradient\"]'\n ) as HTMLCanvasElement;\n\n if (canvas) {\n canvas.width = canvas.offsetWidth;\n canvas.height = canvas.offsetHeight;\n const context = canvas.getContext('2d');\n if (context) {\n context.rect(0, 0, canvas.width, canvas.height);\n\n const gradB = context.createLinearGradient(\n 0,\n 0,\n 0,\n canvas.height\n );\n gradB.addColorStop(0, 'white');\n gradB.addColorStop(1, 'black');\n const gradC = context.createLinearGradient(\n 0,\n 0,\n canvas.width,\n 0\n );\n gradC.addColorStop(0, 'hsla(0,100%,50%,0)');\n gradC.addColorStop(1, 'hsla(0,100%,50%,1)');\n\n context.fillStyle = gradB;\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.fillStyle = gradC;\n context.globalCompositeOperation = 'multiply';\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.globalCompositeOperation = 'source-over';\n }\n }\n }\n }\n\n constructor() {\n super();\n this.writeStatePromise = new Promise((res) => {\n requestAnimationFrame(() => {\n this.writeToCanvas();\n res(true);\n });\n });\n }\n\n private writeStatePromise: Promise<boolean> = Promise.resolve(false);\n\n get updateComplete(): Promise<boolean> {\n return this.writeStatePromise;\n }\n}\n\ncustomElements.define('area-canvas-writer', CanvasWriter);\n\ncanvas.decorators = [\n (story: () => TemplateResult): TemplateResult => {\n return html`\n ${story()}\n <area-canvas-writer></area-canvas-writer>\n `;\n },\n];\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import '@spectrum-web-components/color-area/sp-color-area.js';
|
|
13
|
+
import { html } from 'lit';
|
|
14
|
+
import { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';
|
|
15
|
+
measureFixtureCreation(html `
|
|
16
|
+
<sp-color-area></sp-color-area>
|
|
17
|
+
`);
|
|
18
|
+
//# sourceMappingURL=basic-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic-test.js","sourceRoot":"","sources":["basic-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,sDAAsD,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,sBAAsB,CAAC,IAAI,CAAA;;CAE1B,CAAC,CAAC","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 '@spectrum-web-components/color-area/sp-color-area.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-color-area></sp-color-area>\n`);\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import * as stories from '../stories/color-area.stories.js';
|
|
13
|
+
import { regressVisuals } from '../../../test/visual/test.js';
|
|
14
|
+
regressVisuals('ColorAreaStories', stories);
|
|
15
|
+
//# sourceMappingURL=color-area.test-vrt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-area.test-vrt.js","sourceRoot":"","sources":["color-area.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC","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 * as stories from '../stories/color-area.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ColorAreaStories', stories);\n"]}
|
|
@@ -0,0 +1,554 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { elementUpdated, expect, fixture, html, nextFrame, oneEvent, } from '@open-wc/testing';
|
|
13
|
+
import { TinyColor } from '@ctrl/tinycolor';
|
|
14
|
+
import '../sp-color-area.js';
|
|
15
|
+
import { sendKeys } from '@web/test-runner-commands';
|
|
16
|
+
import { spy } from 'sinon';
|
|
17
|
+
describe('ColorArea', () => {
|
|
18
|
+
it('loads default color-area accessibly', async () => {
|
|
19
|
+
const el = await fixture(html `
|
|
20
|
+
<sp-color-area></sp-color-area>
|
|
21
|
+
`);
|
|
22
|
+
await elementUpdated(el);
|
|
23
|
+
await expect(el).to.be.accessible();
|
|
24
|
+
});
|
|
25
|
+
it('manages a single tab stop', async () => {
|
|
26
|
+
const test = await fixture(html `
|
|
27
|
+
<div>
|
|
28
|
+
<input type="text" />
|
|
29
|
+
<sp-color-area color="hsl(100, 50%, 50%)"></sp-color-area>
|
|
30
|
+
<input type="text" />
|
|
31
|
+
</div>
|
|
32
|
+
`);
|
|
33
|
+
const el = test.querySelector('sp-color-area');
|
|
34
|
+
const input1 = test.querySelector('input:nth-of-type(1)');
|
|
35
|
+
const input2 = test.querySelector('input:nth-of-type(2)');
|
|
36
|
+
await elementUpdated(el);
|
|
37
|
+
input1.focus();
|
|
38
|
+
expect(document.activeElement, 'before input').to.equal(input1);
|
|
39
|
+
await sendKeys({
|
|
40
|
+
press: 'Tab',
|
|
41
|
+
});
|
|
42
|
+
await elementUpdated(el);
|
|
43
|
+
expect(document.activeElement, 'element').to.equal(el);
|
|
44
|
+
let value = el.value;
|
|
45
|
+
await sendKeys({
|
|
46
|
+
press: 'ArrowRight',
|
|
47
|
+
});
|
|
48
|
+
await elementUpdated(el);
|
|
49
|
+
expect(el.value).to.not.equal(value);
|
|
50
|
+
await sendKeys({
|
|
51
|
+
press: 'Tab',
|
|
52
|
+
});
|
|
53
|
+
await elementUpdated(el);
|
|
54
|
+
expect(document.activeElement, 'after input').to.equal(input2);
|
|
55
|
+
await sendKeys({
|
|
56
|
+
press: 'Shift+Tab',
|
|
57
|
+
});
|
|
58
|
+
await elementUpdated(el);
|
|
59
|
+
expect(document.activeElement, 'element again').to.equal(el);
|
|
60
|
+
value = el.value;
|
|
61
|
+
await sendKeys({
|
|
62
|
+
press: 'ArrowDown',
|
|
63
|
+
});
|
|
64
|
+
expect(el.value).to.not.equal(value);
|
|
65
|
+
await sendKeys({
|
|
66
|
+
press: 'Shift+Tab',
|
|
67
|
+
});
|
|
68
|
+
expect(document.activeElement, 'before input again').to.equal(input1);
|
|
69
|
+
});
|
|
70
|
+
it('provides separate aria-labels for X and Y inputs', async () => {
|
|
71
|
+
const el = await fixture(html `
|
|
72
|
+
<sp-color-area color="hsl(100, 50%, 50%)"></sp-color-area>
|
|
73
|
+
`);
|
|
74
|
+
const inputX = el.shadowRoot.querySelector('input[name="x"]');
|
|
75
|
+
const inputY = el.shadowRoot.querySelector('input[name="y"]');
|
|
76
|
+
expect(inputX === null || inputX === void 0 ? void 0 : inputX.getAttribute('aria-label')).to.equal('saturation');
|
|
77
|
+
expect(inputY === null || inputY === void 0 ? void 0 : inputY.getAttribute('aria-label')).to.equal('luminosity');
|
|
78
|
+
});
|
|
79
|
+
it('overrides both X and Y labels with a provided "label" attribute', async () => {
|
|
80
|
+
const el = await fixture(html `
|
|
81
|
+
<sp-color-area
|
|
82
|
+
color="hsl(100, 50%, 50%)"
|
|
83
|
+
label="something custom"
|
|
84
|
+
></sp-color-area>
|
|
85
|
+
`);
|
|
86
|
+
const inputX = el.shadowRoot.querySelector('input[name="x"]');
|
|
87
|
+
const inputY = el.shadowRoot.querySelector('input[name="y"]');
|
|
88
|
+
expect(inputX === null || inputX === void 0 ? void 0 : inputX.getAttribute('aria-label')).to.equal('something custom');
|
|
89
|
+
expect(inputY === null || inputY === void 0 ? void 0 : inputY.getAttribute('aria-label')).to.equal('something custom');
|
|
90
|
+
});
|
|
91
|
+
it('accepts "color" values as hsl', async () => {
|
|
92
|
+
const el = await fixture(html `
|
|
93
|
+
<sp-color-area color="hsl(100, 50%, 50%)"></sp-color-area>
|
|
94
|
+
`);
|
|
95
|
+
await elementUpdated(el);
|
|
96
|
+
expect(el.hue, 'hue').to.equal(100);
|
|
97
|
+
expect(el.x, 'x').to.equal(0.67);
|
|
98
|
+
expect(el.y, 'y').to.equal(0.25);
|
|
99
|
+
});
|
|
100
|
+
it('accepts "color" values as hsla', async () => {
|
|
101
|
+
const el = await fixture(html `
|
|
102
|
+
<sp-color-area color="hsla(100, 50%, 50%, 1)"></sp-color-area>
|
|
103
|
+
`);
|
|
104
|
+
await elementUpdated(el);
|
|
105
|
+
expect(el.hue, 'hugh').to.equal(100);
|
|
106
|
+
expect(el.x, 'ex').to.equal(0.67);
|
|
107
|
+
expect(el.y, 'why').to.equal(0.25);
|
|
108
|
+
el.color = 'hsla(120, 100%, 0, 1)';
|
|
109
|
+
await elementUpdated(el);
|
|
110
|
+
expect(el.hue, 'hue 2').to.equal(120);
|
|
111
|
+
expect(el.x, 'x 2').to.equal(0);
|
|
112
|
+
expect(el.y, 'y 2').to.equal(1);
|
|
113
|
+
});
|
|
114
|
+
it('accepts "color" values as rgb', async () => {
|
|
115
|
+
const el = await fixture(html `
|
|
116
|
+
<sp-color-area color="rgb(0,255,0)"></sp-color-area>
|
|
117
|
+
`);
|
|
118
|
+
await elementUpdated(el);
|
|
119
|
+
expect(el.hue).to.equal(120);
|
|
120
|
+
expect(el.x).to.equal(1);
|
|
121
|
+
expect(el.y).to.equal(0);
|
|
122
|
+
});
|
|
123
|
+
it('accepts "color" values as hex', async () => {
|
|
124
|
+
const el = await fixture(html `
|
|
125
|
+
<sp-color-area color="#00ff00"></sp-color-area>
|
|
126
|
+
`);
|
|
127
|
+
await elementUpdated(el);
|
|
128
|
+
expect(el.hue).to.equal(120);
|
|
129
|
+
expect(el.x).to.equal(1);
|
|
130
|
+
expect(el.y).to.equal(0);
|
|
131
|
+
});
|
|
132
|
+
it('accepts "Arrow*" keypresses', async () => {
|
|
133
|
+
const el = await fixture(html `
|
|
134
|
+
<sp-color-area color="hsla(100, 50%, 50%, 1)"></sp-color-area>
|
|
135
|
+
`);
|
|
136
|
+
expect(el.hue, 'hue').to.equal(100);
|
|
137
|
+
expect(el.x, 'x').to.equal(0.67);
|
|
138
|
+
expect(el.y, 'y').to.equal(0.25);
|
|
139
|
+
el.inputX.focus();
|
|
140
|
+
await nextFrame();
|
|
141
|
+
let changeEvent = oneEvent(el, 'change');
|
|
142
|
+
await sendKeys({
|
|
143
|
+
press: 'ArrowUp',
|
|
144
|
+
});
|
|
145
|
+
await changeEvent;
|
|
146
|
+
changeEvent = oneEvent(el, 'change');
|
|
147
|
+
await sendKeys({
|
|
148
|
+
press: 'ArrowUp',
|
|
149
|
+
});
|
|
150
|
+
await changeEvent;
|
|
151
|
+
expect(el.x).to.equal(0.67);
|
|
152
|
+
expect(el.y).to.equal(0.23);
|
|
153
|
+
changeEvent = oneEvent(el, 'change');
|
|
154
|
+
await sendKeys({
|
|
155
|
+
press: 'ArrowRight',
|
|
156
|
+
});
|
|
157
|
+
await changeEvent;
|
|
158
|
+
changeEvent = oneEvent(el, 'change');
|
|
159
|
+
await sendKeys({
|
|
160
|
+
press: 'ArrowRight',
|
|
161
|
+
});
|
|
162
|
+
await changeEvent;
|
|
163
|
+
expect(el.x).to.equal(0.69);
|
|
164
|
+
expect(el.y).to.equal(0.23);
|
|
165
|
+
changeEvent = oneEvent(el, 'change');
|
|
166
|
+
await sendKeys({
|
|
167
|
+
press: 'ArrowDown',
|
|
168
|
+
});
|
|
169
|
+
await changeEvent;
|
|
170
|
+
changeEvent = oneEvent(el, 'change');
|
|
171
|
+
await sendKeys({
|
|
172
|
+
press: 'ArrowDown',
|
|
173
|
+
});
|
|
174
|
+
await changeEvent;
|
|
175
|
+
expect(el.x).to.equal(0.69);
|
|
176
|
+
expect(el.y).to.equal(0.25);
|
|
177
|
+
changeEvent = oneEvent(el, 'change');
|
|
178
|
+
await sendKeys({
|
|
179
|
+
press: 'ArrowLeft',
|
|
180
|
+
});
|
|
181
|
+
await changeEvent;
|
|
182
|
+
changeEvent = oneEvent(el, 'change');
|
|
183
|
+
await sendKeys({
|
|
184
|
+
press: 'ArrowLeft',
|
|
185
|
+
});
|
|
186
|
+
await changeEvent;
|
|
187
|
+
expect(el.x).to.equal(0.67);
|
|
188
|
+
expect(el.y).to.equal(0.25);
|
|
189
|
+
});
|
|
190
|
+
it('accepts "Arrow*" keypresses with alteration', async () => {
|
|
191
|
+
const el = await fixture(html `
|
|
192
|
+
<sp-color-area color="hsla(100, 50%, 50%, 1)"></sp-color-area>
|
|
193
|
+
`);
|
|
194
|
+
await elementUpdated(el);
|
|
195
|
+
el.focus();
|
|
196
|
+
expect(el.hue, 'hue').to.equal(100);
|
|
197
|
+
expect(el.x, 'x').to.equal(0.67);
|
|
198
|
+
expect(el.y, 'y').to.equal(0.25);
|
|
199
|
+
await sendKeys({
|
|
200
|
+
down: 'Shift',
|
|
201
|
+
});
|
|
202
|
+
await elementUpdated(el);
|
|
203
|
+
await sendKeys({
|
|
204
|
+
press: 'ArrowUp',
|
|
205
|
+
});
|
|
206
|
+
// This ensures that all the keystrokes are processed seperately
|
|
207
|
+
await elementUpdated(el);
|
|
208
|
+
await sendKeys({
|
|
209
|
+
press: 'ArrowUp',
|
|
210
|
+
});
|
|
211
|
+
await elementUpdated(el);
|
|
212
|
+
expect(el.color).to.equal('hsl(100, 65%, 57%)');
|
|
213
|
+
expect(el.x, 'first').to.equal(0.67);
|
|
214
|
+
expect(el.y).to.equal(0.15);
|
|
215
|
+
await sendKeys({
|
|
216
|
+
press: 'ArrowRight',
|
|
217
|
+
});
|
|
218
|
+
await elementUpdated(el);
|
|
219
|
+
await sendKeys({
|
|
220
|
+
press: 'ArrowRight',
|
|
221
|
+
});
|
|
222
|
+
await elementUpdated(el);
|
|
223
|
+
expect(el.color).to.equal('hsl(100, 69%, 52%)');
|
|
224
|
+
expect(el.x).to.equal(0.77);
|
|
225
|
+
expect(el.y).to.equal(0.15);
|
|
226
|
+
await sendKeys({
|
|
227
|
+
press: 'ArrowDown',
|
|
228
|
+
});
|
|
229
|
+
await elementUpdated(el);
|
|
230
|
+
await sendKeys({
|
|
231
|
+
press: 'ArrowDown',
|
|
232
|
+
});
|
|
233
|
+
await elementUpdated(el);
|
|
234
|
+
expect(el.color).to.equal('hsl(100, 63%, 46%)');
|
|
235
|
+
expect(el.x).to.equal(0.77);
|
|
236
|
+
expect(el.y).to.equal(0.25);
|
|
237
|
+
await sendKeys({
|
|
238
|
+
press: 'ArrowLeft',
|
|
239
|
+
});
|
|
240
|
+
await elementUpdated(el);
|
|
241
|
+
await sendKeys({
|
|
242
|
+
press: 'ArrowLeft',
|
|
243
|
+
});
|
|
244
|
+
await elementUpdated(el);
|
|
245
|
+
await sendKeys({
|
|
246
|
+
up: 'Shift',
|
|
247
|
+
});
|
|
248
|
+
await elementUpdated(el);
|
|
249
|
+
expect(el.color).to.equal('hsl(100, 50%, 50%)');
|
|
250
|
+
expect(el.x, 'last').to.equal(0.67);
|
|
251
|
+
expect(el.y).to.equal(0.25);
|
|
252
|
+
});
|
|
253
|
+
it('accepts pointer events', async () => {
|
|
254
|
+
const el = await fixture(html `
|
|
255
|
+
<sp-color-area
|
|
256
|
+
style="--spectrum-colorarea-default-width: 192px; --spectrum-colorarea-default-height: 192px;"
|
|
257
|
+
></sp-color-area>
|
|
258
|
+
`);
|
|
259
|
+
await elementUpdated(el);
|
|
260
|
+
await elementUpdated(el);
|
|
261
|
+
const { handle } = el;
|
|
262
|
+
handle.setPointerCapture = () => {
|
|
263
|
+
return;
|
|
264
|
+
};
|
|
265
|
+
handle.releasePointerCapture = () => {
|
|
266
|
+
return;
|
|
267
|
+
};
|
|
268
|
+
expect(el.hue).to.equal(0);
|
|
269
|
+
expect(el.x).to.equal(1);
|
|
270
|
+
expect(el.y).to.equal(0);
|
|
271
|
+
handle.dispatchEvent(new PointerEvent('pointerdown', {
|
|
272
|
+
button: 1,
|
|
273
|
+
pointerId: 1,
|
|
274
|
+
clientX: 100,
|
|
275
|
+
clientY: 100,
|
|
276
|
+
bubbles: true,
|
|
277
|
+
composed: true,
|
|
278
|
+
cancelable: true,
|
|
279
|
+
}));
|
|
280
|
+
await elementUpdated(el);
|
|
281
|
+
expect(el.hue).to.equal(0);
|
|
282
|
+
expect(el.x).to.equal(1);
|
|
283
|
+
expect(el.y).to.equal(0);
|
|
284
|
+
const root = el.shadowRoot ? el.shadowRoot : el;
|
|
285
|
+
const gradient = root.querySelector('.gradient');
|
|
286
|
+
gradient.dispatchEvent(new PointerEvent('pointerdown', {
|
|
287
|
+
button: 1,
|
|
288
|
+
pointerId: 1,
|
|
289
|
+
clientX: 100,
|
|
290
|
+
clientY: 100,
|
|
291
|
+
bubbles: true,
|
|
292
|
+
composed: true,
|
|
293
|
+
cancelable: true,
|
|
294
|
+
}));
|
|
295
|
+
await elementUpdated(el);
|
|
296
|
+
expect(el.hue).to.equal(0);
|
|
297
|
+
expect(el.x).to.equal(1);
|
|
298
|
+
expect(el.y).to.equal(0);
|
|
299
|
+
gradient.dispatchEvent(new PointerEvent('pointerdown', {
|
|
300
|
+
pointerId: 1,
|
|
301
|
+
clientX: 100,
|
|
302
|
+
clientY: 100,
|
|
303
|
+
bubbles: true,
|
|
304
|
+
composed: true,
|
|
305
|
+
cancelable: true,
|
|
306
|
+
}));
|
|
307
|
+
await elementUpdated(el);
|
|
308
|
+
expect(el.hue).to.equal(0);
|
|
309
|
+
expect(el.x, 'pointerdown x').to.equal(0.48);
|
|
310
|
+
expect(el.y, 'pointerdown y').to.equal(0.48);
|
|
311
|
+
handle.dispatchEvent(new PointerEvent('pointermove', {
|
|
312
|
+
pointerId: 1,
|
|
313
|
+
clientX: 110,
|
|
314
|
+
clientY: 110,
|
|
315
|
+
bubbles: true,
|
|
316
|
+
composed: true,
|
|
317
|
+
cancelable: true,
|
|
318
|
+
}));
|
|
319
|
+
handle.dispatchEvent(new PointerEvent('pointerup', {
|
|
320
|
+
pointerId: 1,
|
|
321
|
+
clientX: 110,
|
|
322
|
+
clientY: 110,
|
|
323
|
+
bubbles: true,
|
|
324
|
+
composed: true,
|
|
325
|
+
cancelable: true,
|
|
326
|
+
}));
|
|
327
|
+
await elementUpdated(el);
|
|
328
|
+
expect(el.hue).to.equal(0);
|
|
329
|
+
expect(el.x).to.equal(0.53);
|
|
330
|
+
expect(el.y).to.equal(0.53);
|
|
331
|
+
});
|
|
332
|
+
it('responds to events on the internal input element', async () => {
|
|
333
|
+
const inputSpy = spy();
|
|
334
|
+
const changeSpy = spy();
|
|
335
|
+
const el = await fixture(html `
|
|
336
|
+
<sp-color-area
|
|
337
|
+
color="hsla(100, 50%, 50%, 1)"
|
|
338
|
+
@change=${() => changeSpy()}
|
|
339
|
+
@input=${() => inputSpy()}
|
|
340
|
+
></sp-color-area>
|
|
341
|
+
`);
|
|
342
|
+
await elementUpdated(el);
|
|
343
|
+
el.inputX.focus();
|
|
344
|
+
el.inputX.dispatchEvent(new Event('input', {
|
|
345
|
+
bubbles: true,
|
|
346
|
+
composed: true,
|
|
347
|
+
}));
|
|
348
|
+
el.inputX.dispatchEvent(new Event('change', {
|
|
349
|
+
bubbles: true,
|
|
350
|
+
composed: false, // native change events do not compose themselves by default
|
|
351
|
+
}));
|
|
352
|
+
expect(inputSpy.callCount).to.equal(1);
|
|
353
|
+
expect(changeSpy.callCount).to.equal(1);
|
|
354
|
+
el.inputY.focus();
|
|
355
|
+
el.inputY.dispatchEvent(new Event('input', {
|
|
356
|
+
bubbles: true,
|
|
357
|
+
composed: true,
|
|
358
|
+
}));
|
|
359
|
+
el.inputY.dispatchEvent(new Event('change', {
|
|
360
|
+
bubbles: true,
|
|
361
|
+
composed: false, // native change events do not compose themselves by default
|
|
362
|
+
}));
|
|
363
|
+
expect(inputSpy.callCount).to.equal(2);
|
|
364
|
+
expect(changeSpy.callCount).to.equal(2);
|
|
365
|
+
});
|
|
366
|
+
it('dispatches input and change events in response to "Arrow*" keypresses', async () => {
|
|
367
|
+
const inputSpy = spy();
|
|
368
|
+
const changeSpy = spy();
|
|
369
|
+
const el = await fixture(html `
|
|
370
|
+
<sp-color-area
|
|
371
|
+
color="hsla(100, 50%, 50%, 1)"
|
|
372
|
+
@change=${() => changeSpy()}
|
|
373
|
+
@input=${() => inputSpy()}
|
|
374
|
+
></sp-color-area>
|
|
375
|
+
`);
|
|
376
|
+
await elementUpdated(el);
|
|
377
|
+
el.inputX.focus();
|
|
378
|
+
inputSpy.resetHistory();
|
|
379
|
+
changeSpy.resetHistory();
|
|
380
|
+
await sendKeys({ press: 'ArrowRight' });
|
|
381
|
+
await sendKeys({ press: 'ArrowRight' });
|
|
382
|
+
await elementUpdated(el);
|
|
383
|
+
expect(inputSpy.callCount).to.equal(2);
|
|
384
|
+
expect(changeSpy.callCount).to.equal(2);
|
|
385
|
+
el.inputY.focus();
|
|
386
|
+
inputSpy.resetHistory();
|
|
387
|
+
changeSpy.resetHistory();
|
|
388
|
+
await sendKeys({ press: 'ArrowUp' });
|
|
389
|
+
await sendKeys({ press: 'ArrowUp' });
|
|
390
|
+
await elementUpdated(el);
|
|
391
|
+
expect(inputSpy.callCount).to.equal(2);
|
|
392
|
+
expect(changeSpy.callCount).to.equal(2);
|
|
393
|
+
el.inputY.focus();
|
|
394
|
+
inputSpy.resetHistory();
|
|
395
|
+
changeSpy.resetHistory();
|
|
396
|
+
await sendKeys({ press: 'ArrowDown' });
|
|
397
|
+
await sendKeys({ press: 'ArrowDown' });
|
|
398
|
+
await elementUpdated(el);
|
|
399
|
+
expect(inputSpy.callCount).to.equal(2);
|
|
400
|
+
expect(changeSpy.callCount).to.equal(2);
|
|
401
|
+
el.inputX.focus();
|
|
402
|
+
inputSpy.resetHistory();
|
|
403
|
+
changeSpy.resetHistory();
|
|
404
|
+
await sendKeys({ press: 'ArrowLeft' });
|
|
405
|
+
await sendKeys({ press: 'ArrowLeft' });
|
|
406
|
+
await elementUpdated(el);
|
|
407
|
+
expect(inputSpy.callCount).to.equal(2);
|
|
408
|
+
expect(changeSpy.callCount).to.equal(2);
|
|
409
|
+
});
|
|
410
|
+
it('retains `hue` value when s = 0 in HSL string format', async () => {
|
|
411
|
+
const el = await fixture(html `
|
|
412
|
+
<sp-color-area color="hsl(100, 50%, 50%)"></sp-color-area>
|
|
413
|
+
`);
|
|
414
|
+
await elementUpdated(el);
|
|
415
|
+
expect(el.hue, 'hue').to.equal(100);
|
|
416
|
+
expect(el.x, 'x').to.equal(0.67);
|
|
417
|
+
expect(el.y, 'y').to.equal(0.25);
|
|
418
|
+
expect(el.color).to.equal('hsl(100, 50%, 50%)');
|
|
419
|
+
el.color = 'hsl(100, 0%, 50%)';
|
|
420
|
+
await elementUpdated(el);
|
|
421
|
+
expect(el.hue, 'new hue').to.equal(100);
|
|
422
|
+
expect(el.x, 'new x').to.equal(0);
|
|
423
|
+
expect(el.y, 'new y').to.equal(0.5);
|
|
424
|
+
expect(el.color).to.equal('hsl(100, 0%, 50%)');
|
|
425
|
+
});
|
|
426
|
+
it('retains `hue` value when s = 0 in HSL object format', async () => {
|
|
427
|
+
let inputColor = { h: 100, s: 0.5, l: 0.5 };
|
|
428
|
+
const el = await fixture(html `
|
|
429
|
+
<sp-color-area .color=${inputColor}></sp-color-area>
|
|
430
|
+
`);
|
|
431
|
+
await elementUpdated(el);
|
|
432
|
+
let outputColor = el.color;
|
|
433
|
+
const variance = 0.00005;
|
|
434
|
+
expect(el.hue).to.equal(100);
|
|
435
|
+
expect(el.x, 'x').to.equal(0.67);
|
|
436
|
+
expect(el.y, 'y').to.equal(0.25);
|
|
437
|
+
expect(Math.abs(outputColor.h - inputColor.h)).to.be.lessThan(variance);
|
|
438
|
+
expect(Math.abs(outputColor.s - inputColor.s)).to.be.lessThan(variance);
|
|
439
|
+
expect(Math.abs(outputColor.l - inputColor.l)).to.be.lessThan(variance);
|
|
440
|
+
inputColor = { h: 100, s: 0, l: 0.5 };
|
|
441
|
+
el.color = inputColor;
|
|
442
|
+
await elementUpdated(el);
|
|
443
|
+
outputColor = el.color;
|
|
444
|
+
expect(el.hue).to.equal(100);
|
|
445
|
+
expect(el.x, 'x').to.equal(0);
|
|
446
|
+
expect(el.y, 'y').to.equal(0.5);
|
|
447
|
+
expect(Math.abs(outputColor.h - inputColor.h)).to.be.lessThan(variance);
|
|
448
|
+
expect(Math.abs(outputColor.s - inputColor.s)).to.be.lessThan(variance);
|
|
449
|
+
expect(Math.abs(outputColor.l - inputColor.l)).to.be.lessThan(variance);
|
|
450
|
+
});
|
|
451
|
+
it('retains `hue` value when s = 0 in HSV string format', async () => {
|
|
452
|
+
const el = await fixture(html `
|
|
453
|
+
<sp-color-area color="hsv(100, 50%, 50%)"></sp-color-area>
|
|
454
|
+
`);
|
|
455
|
+
await elementUpdated(el);
|
|
456
|
+
expect(el.hue, 'hue').to.equal(100);
|
|
457
|
+
expect(el.x, 'x').to.equal(0.5);
|
|
458
|
+
expect(el.y, 'y').to.equal(0.5);
|
|
459
|
+
expect(el.color).to.equal('hsv(100, 50%, 50%)');
|
|
460
|
+
el.color = 'hsv(100, 0%, 50%)';
|
|
461
|
+
await elementUpdated(el);
|
|
462
|
+
expect(el.hue, 'new hue').to.equal(100);
|
|
463
|
+
expect(el.x, 'new x').to.equal(0);
|
|
464
|
+
expect(el.y, 'new y').to.equal(0.5);
|
|
465
|
+
expect(el.color).to.equal('hsv(100, 0%, 50%)');
|
|
466
|
+
});
|
|
467
|
+
it('retains `hue` value when s = 0 in HSV object format', async () => {
|
|
468
|
+
let inputColor = { h: 100, s: 0.5, v: 0.5 };
|
|
469
|
+
const el = await fixture(html `
|
|
470
|
+
<sp-color-area .color=${inputColor}></sp-color-area>
|
|
471
|
+
`);
|
|
472
|
+
await elementUpdated(el);
|
|
473
|
+
let outputColor = el.color;
|
|
474
|
+
const variance = 0.00005;
|
|
475
|
+
expect(el.hue).to.equal(100);
|
|
476
|
+
expect(el.x, 'x').to.equal(0.5);
|
|
477
|
+
expect(el.y, 'y').to.equal(0.5);
|
|
478
|
+
expect(Math.abs(outputColor.h - inputColor.h)).to.be.lessThan(variance);
|
|
479
|
+
expect(Math.abs(outputColor.s - inputColor.s)).to.be.lessThan(variance);
|
|
480
|
+
expect(Math.abs(outputColor.v - inputColor.v)).to.be.lessThan(variance);
|
|
481
|
+
inputColor = { h: 100, s: 0, v: 0.5 };
|
|
482
|
+
el.color = inputColor;
|
|
483
|
+
await elementUpdated(el);
|
|
484
|
+
outputColor = el.color;
|
|
485
|
+
expect(el.hue).to.equal(100);
|
|
486
|
+
expect(el.x, 'x').to.equal(0);
|
|
487
|
+
expect(el.y, 'y').to.equal(0.5);
|
|
488
|
+
expect(Math.abs(outputColor.h - inputColor.h)).to.be.lessThan(variance);
|
|
489
|
+
expect(Math.abs(outputColor.s - inputColor.s)).to.be.lessThan(variance);
|
|
490
|
+
expect(Math.abs(outputColor.v - inputColor.v)).to.be.lessThan(variance);
|
|
491
|
+
});
|
|
492
|
+
const colorFormats = [
|
|
493
|
+
//rgb
|
|
494
|
+
{ name: 'RGB String', color: 'rgb(204, 51, 204)' },
|
|
495
|
+
{ name: 'RGB', color: { r: 204, g: 51, b: 204, a: 1 } },
|
|
496
|
+
//prgb
|
|
497
|
+
{ name: 'PRGB String', color: 'rgb(80%, 20%, 80%)' },
|
|
498
|
+
{ name: 'PRGB', color: { r: '80%', g: '20%', b: '80%', a: 1 } },
|
|
499
|
+
// hex
|
|
500
|
+
{ name: 'Hex', color: 'cc33cc' },
|
|
501
|
+
{ name: 'Hex String', color: '#cc33cc' },
|
|
502
|
+
// hex8
|
|
503
|
+
{ name: 'Hex8', color: 'cc33ccff' },
|
|
504
|
+
{ name: 'Hex8 String', color: '#cc33ccff' },
|
|
505
|
+
// name
|
|
506
|
+
{ name: 'string', color: 'red' },
|
|
507
|
+
// hsl
|
|
508
|
+
{ name: 'HSL String', color: 'hsl(300, 60%, 50%)' },
|
|
509
|
+
{ name: 'HSL', color: { h: 300, s: 0.6000000000000001, l: 0.5, a: 1 } },
|
|
510
|
+
// hsv
|
|
511
|
+
{ name: 'HSV String', color: 'hsv(300, 75%, 100%)' },
|
|
512
|
+
{ name: 'HSV', color: { h: 300, s: 0.75, v: 1, a: 1 } },
|
|
513
|
+
];
|
|
514
|
+
colorFormats.map((format) => {
|
|
515
|
+
it(`maintains \`color\` format as ${format.name}`, async () => {
|
|
516
|
+
const el = await fixture(html `
|
|
517
|
+
<sp-color-area></sp-color-area>
|
|
518
|
+
`);
|
|
519
|
+
el.color = format.color;
|
|
520
|
+
if (format.name.startsWith('Hex')) {
|
|
521
|
+
expect(el.color).to.equal(format.color);
|
|
522
|
+
}
|
|
523
|
+
else
|
|
524
|
+
expect(el.color).to.deep.equal(format.color);
|
|
525
|
+
});
|
|
526
|
+
});
|
|
527
|
+
it(`maintains \`color\` format as TinyColor`, async () => {
|
|
528
|
+
const el = await fixture(html `
|
|
529
|
+
<sp-color-area></sp-color-area>
|
|
530
|
+
`);
|
|
531
|
+
const color = new TinyColor('rgb(204, 51, 204)');
|
|
532
|
+
el.color = color;
|
|
533
|
+
expect(color.equals(el.color));
|
|
534
|
+
});
|
|
535
|
+
it(`resolves Hex3 format to Hex6 format`, async () => {
|
|
536
|
+
const el = await fixture(html `
|
|
537
|
+
<sp-color-area></sp-color-area>
|
|
538
|
+
`);
|
|
539
|
+
el.color = '0f0';
|
|
540
|
+
expect(el.color).to.equal('00ff00');
|
|
541
|
+
el.color = '#1e0';
|
|
542
|
+
expect(el.color).to.equal('#11ee00');
|
|
543
|
+
});
|
|
544
|
+
it(`resolves Hex4 format to Hex8 format`, async () => {
|
|
545
|
+
const el = await fixture(html `
|
|
546
|
+
<sp-color-area></sp-color-area>
|
|
547
|
+
`);
|
|
548
|
+
el.color = 'f3af';
|
|
549
|
+
expect(el.color).to.equal('ff33aaff');
|
|
550
|
+
el.color = '#f3af';
|
|
551
|
+
expect(el.color).to.equal('#ff33aaff');
|
|
552
|
+
});
|
|
553
|
+
});
|
|
554
|
+
//# sourceMappingURL=color-area.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-area.test.js","sourceRoot":"","sources":["color-area.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EACH,cAAc,EACd,MAAM,EACN,OAAO,EACP,IAAI,EACJ,SAAS,EACT,QAAQ,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAmC,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACvB,EAAE,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;QACjD,MAAM,EAAE,GAAG,MAAM,OAAO,CACpB,IAAI,CAAA;;aAEH,CACJ,CAAC;QAEF,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;QAEzB,MAAM,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,2BAA2B,EAAE,KAAK,IAAI,EAAE;QACvC,MAAM,IAAI,GAAG,MAAM,OAAO,CACtB,IAAI,CAAA;;;;;;aAMH,CACJ,CAAC;QACF,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,eAAe,CAAc,CAAC;QAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAC7B,sBAAsB,CACL,CAAC;QACtB,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAC7B,sBAAsB,CACL,CAAC;QAEtB,MAAM,cAAc,CAAC,EAAE,CAAC,CAA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KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;QACjD,MAAM,EAAE,GAAG,MAAM,OAAO,CACpB,IAAI,CAAA;;aAEH,CACJ,CAAC;QACF,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC;QACjB,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEpC,EAAE,CAAC,KAAK,GAAG,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;QACjD,MAAM,EAAE,GAAG,MAAM,OAAO,CACpB,IAAI,CAAA;;aAEH,CACJ,CAAC;QACF,EAAE,CAAC,KAAK,GAAG,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAEtC,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","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 elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { HSL, HSLA, HSV, HSVA, RGB, RGBA, TinyColor } from '@ctrl/tinycolor';\n\nimport '../sp-color-area.js';\nimport { ColorArea } from '..';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { spy } from 'sinon';\n\ndescribe('ColorArea', () => {\n it('loads default color-area accessibly', async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area></sp-color-area>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('manages a single tab stop', async () => {\n const test = await fixture<HTMLDivElement>(\n html`\n <div>\n <input type=\"text\" />\n <sp-color-area color=\"hsl(100, 50%, 50%)\"></sp-color-area>\n <input type=\"text\" />\n </div>\n `\n );\n const el = test.querySelector('sp-color-area') as ColorArea;\n const input1 = test.querySelector(\n 'input:nth-of-type(1)'\n ) as HTMLInputElement;\n const input2 = test.querySelector(\n 'input:nth-of-type(2)'\n ) as HTMLInputElement;\n\n await elementUpdated(el);\n\n input1.focus();\n\n expect(document.activeElement, 'before input').to.equal(input1);\n\n await sendKeys({\n press: 'Tab',\n });\n await elementUpdated(el);\n\n expect(document.activeElement, 'element').to.equal(el);\n let value = el.value;\n await sendKeys({\n press: 'ArrowRight',\n });\n await elementUpdated(el);\n expect(el.value).to.not.equal(value);\n await sendKeys({\n press: 'Tab',\n });\n await elementUpdated(el);\n\n expect(document.activeElement, 'after input').to.equal(input2);\n\n await sendKeys({\n press: 'Shift+Tab',\n });\n await elementUpdated(el);\n\n expect(document.activeElement, 'element again').to.equal(el);\n\n value = el.value;\n await sendKeys({\n press: 'ArrowDown',\n });\n expect(el.value).to.not.equal(value);\n await sendKeys({\n press: 'Shift+Tab',\n });\n expect(document.activeElement, 'before input again').to.equal(input1);\n });\n it('provides separate aria-labels for X and Y inputs', async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area color=\"hsl(100, 50%, 50%)\"></sp-color-area>\n `\n );\n const inputX = el.shadowRoot.querySelector('input[name=\"x\"]');\n const inputY = el.shadowRoot.querySelector('input[name=\"y\"]');\n\n expect(inputX?.getAttribute('aria-label')).to.equal('saturation');\n expect(inputY?.getAttribute('aria-label')).to.equal('luminosity');\n });\n it('overrides both X and Y labels with a provided \"label\" attribute', async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area\n color=\"hsl(100, 50%, 50%)\"\n label=\"something custom\"\n ></sp-color-area>\n `\n );\n const inputX = el.shadowRoot.querySelector('input[name=\"x\"]');\n const inputY = el.shadowRoot.querySelector('input[name=\"y\"]');\n\n expect(inputX?.getAttribute('aria-label')).to.equal('something custom');\n expect(inputY?.getAttribute('aria-label')).to.equal('something custom');\n });\n it('accepts \"color\" values as hsl', async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area color=\"hsl(100, 50%, 50%)\"></sp-color-area>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.hue, 'hue').to.equal(100);\n expect(el.x, 'x').to.equal(0.67);\n expect(el.y, 'y').to.equal(0.25);\n });\n it('accepts \"color\" values as hsla', async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area color=\"hsla(100, 50%, 50%, 1)\"></sp-color-area>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.hue, 'hugh').to.equal(100);\n expect(el.x, 'ex').to.equal(0.67);\n expect(el.y, 'why').to.equal(0.25);\n\n el.color = 'hsla(120, 100%, 0, 1)';\n await elementUpdated(el);\n\n expect(el.hue, 'hue 2').to.equal(120);\n expect(el.x, 'x 2').to.equal(0);\n expect(el.y, 'y 2').to.equal(1);\n });\n it('accepts \"color\" values as rgb', async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area color=\"rgb(0,255,0)\"></sp-color-area>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.hue).to.equal(120);\n expect(el.x).to.equal(1);\n expect(el.y).to.equal(0);\n });\n it('accepts \"color\" values as hex', async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area color=\"#00ff00\"></sp-color-area>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.hue).to.equal(120);\n expect(el.x).to.equal(1);\n expect(el.y).to.equal(0);\n });\n it('accepts \"Arrow*\" keypresses', async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area color=\"hsla(100, 50%, 50%, 1)\"></sp-color-area>\n `\n );\n\n expect(el.hue, 'hue').to.equal(100);\n expect(el.x, 'x').to.equal(0.67);\n expect(el.y, 'y').to.equal(0.25);\n\n el.inputX.focus();\n await nextFrame();\n\n let changeEvent = oneEvent(el, 'change');\n await sendKeys({\n press: 'ArrowUp',\n });\n await changeEvent;\n changeEvent = oneEvent(el, 'change');\n await sendKeys({\n press: 'ArrowUp',\n });\n await changeEvent;\n\n expect(el.x).to.equal(0.67);\n expect(el.y).to.equal(0.23);\n\n changeEvent = oneEvent(el, 'change');\n await sendKeys({\n press: 'ArrowRight',\n });\n await changeEvent;\n changeEvent = oneEvent(el, 'change');\n await sendKeys({\n press: 'ArrowRight',\n });\n await changeEvent;\n\n expect(el.x).to.equal(0.69);\n expect(el.y).to.equal(0.23);\n\n changeEvent = oneEvent(el, 'change');\n await sendKeys({\n press: 'ArrowDown',\n });\n await changeEvent;\n changeEvent = oneEvent(el, 'change');\n await sendKeys({\n press: 'ArrowDown',\n });\n await changeEvent;\n\n expect(el.x).to.equal(0.69);\n expect(el.y).to.equal(0.25);\n\n changeEvent = oneEvent(el, 'change');\n await sendKeys({\n press: 'ArrowLeft',\n });\n await changeEvent;\n changeEvent = oneEvent(el, 'change');\n await sendKeys({\n press: 'ArrowLeft',\n });\n await changeEvent;\n\n expect(el.x).to.equal(0.67);\n expect(el.y).to.equal(0.25);\n });\n it('accepts \"Arrow*\" keypresses with alteration', async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area color=\"hsla(100, 50%, 50%, 1)\"></sp-color-area>\n `\n );\n\n await elementUpdated(el);\n el.focus();\n expect(el.hue, 'hue').to.equal(100);\n expect(el.x, 'x').to.equal(0.67);\n expect(el.y, 'y').to.equal(0.25);\n\n await sendKeys({\n down: 'Shift',\n });\n await elementUpdated(el);\n await sendKeys({\n press: 'ArrowUp',\n });\n // This ensures that all the keystrokes are processed seperately\n await elementUpdated(el);\n await sendKeys({\n press: 'ArrowUp',\n });\n\n await elementUpdated(el);\n\n expect(el.color).to.equal('hsl(100, 65%, 57%)');\n expect(el.x, 'first').to.equal(0.67);\n expect(el.y).to.equal(0.15);\n\n await sendKeys({\n press: 'ArrowRight',\n });\n await elementUpdated(el);\n await sendKeys({\n press: 'ArrowRight',\n });\n await elementUpdated(el);\n\n expect(el.color).to.equal('hsl(100, 69%, 52%)');\n expect(el.x).to.equal(0.77);\n expect(el.y).to.equal(0.15);\n\n await sendKeys({\n press: 'ArrowDown',\n });\n await elementUpdated(el);\n await sendKeys({\n press: 'ArrowDown',\n });\n\n await elementUpdated(el);\n\n expect(el.color).to.equal('hsl(100, 63%, 46%)');\n expect(el.x).to.equal(0.77);\n expect(el.y).to.equal(0.25);\n\n await sendKeys({\n press: 'ArrowLeft',\n });\n await elementUpdated(el);\n await sendKeys({\n press: 'ArrowLeft',\n });\n await elementUpdated(el);\n await sendKeys({\n up: 'Shift',\n });\n\n await elementUpdated(el);\n\n expect(el.color).to.equal('hsl(100, 50%, 50%)');\n expect(el.x, 'last').to.equal(0.67);\n expect(el.y).to.equal(0.25);\n });\n it('accepts pointer events', async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area\n style=\"--spectrum-colorarea-default-width: 192px; --spectrum-colorarea-default-height: 192px;\"\n ></sp-color-area>\n `\n );\n\n await elementUpdated(el);\n await elementUpdated(el);\n\n const { handle } = el as unknown as { handle: HTMLElement };\n\n handle.setPointerCapture = () => {\n return;\n };\n handle.releasePointerCapture = () => {\n return;\n };\n\n expect(el.hue).to.equal(0);\n expect(el.x).to.equal(1);\n expect(el.y).to.equal(0);\n\n handle.dispatchEvent(\n new PointerEvent('pointerdown', {\n button: 1,\n pointerId: 1,\n clientX: 100,\n clientY: 100,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.hue).to.equal(0);\n expect(el.x).to.equal(1);\n expect(el.y).to.equal(0);\n\n const root = el.shadowRoot ? el.shadowRoot : el;\n const gradient = root.querySelector('.gradient') as HTMLElement;\n gradient.dispatchEvent(\n new PointerEvent('pointerdown', {\n button: 1,\n pointerId: 1,\n clientX: 100,\n clientY: 100,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.hue).to.equal(0);\n expect(el.x).to.equal(1);\n expect(el.y).to.equal(0);\n\n gradient.dispatchEvent(\n new PointerEvent('pointerdown', {\n pointerId: 1,\n clientX: 100,\n clientY: 100,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.hue).to.equal(0);\n expect(el.x, 'pointerdown x').to.equal(0.48);\n expect(el.y, 'pointerdown y').to.equal(0.48);\n\n handle.dispatchEvent(\n new PointerEvent('pointermove', {\n pointerId: 1,\n clientX: 110,\n clientY: 110,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n handle.dispatchEvent(\n new PointerEvent('pointerup', {\n pointerId: 1,\n clientX: 110,\n clientY: 110,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.hue).to.equal(0);\n expect(el.x).to.equal(0.53);\n expect(el.y).to.equal(0.53);\n });\n it('responds to events on the internal input element', async () => {\n const inputSpy = spy();\n const changeSpy = spy();\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area\n color=\"hsla(100, 50%, 50%, 1)\"\n @change=${() => changeSpy()}\n @input=${() => inputSpy()}\n ></sp-color-area>\n `\n );\n\n await elementUpdated(el);\n\n el.inputX.focus();\n\n el.inputX.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\n );\n el.inputX.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: false, // native change events do not compose themselves by default\n })\n );\n\n expect(inputSpy.callCount).to.equal(1);\n expect(changeSpy.callCount).to.equal(1);\n\n el.inputY.focus();\n\n el.inputY.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\n );\n el.inputY.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: false, // native change events do not compose themselves by default\n })\n );\n\n expect(inputSpy.callCount).to.equal(2);\n expect(changeSpy.callCount).to.equal(2);\n });\n it('dispatches input and change events in response to \"Arrow*\" keypresses', async () => {\n const inputSpy = spy();\n const changeSpy = spy();\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area\n color=\"hsla(100, 50%, 50%, 1)\"\n @change=${() => changeSpy()}\n @input=${() => inputSpy()}\n ></sp-color-area>\n `\n );\n\n await elementUpdated(el);\n\n el.inputX.focus();\n inputSpy.resetHistory();\n changeSpy.resetHistory();\n await sendKeys({ press: 'ArrowRight' });\n await sendKeys({ press: 'ArrowRight' });\n\n await elementUpdated(el);\n\n expect(inputSpy.callCount).to.equal(2);\n expect(changeSpy.callCount).to.equal(2);\n\n el.inputY.focus();\n inputSpy.resetHistory();\n changeSpy.resetHistory();\n await sendKeys({ press: 'ArrowUp' });\n await sendKeys({ press: 'ArrowUp' });\n\n await elementUpdated(el);\n\n expect(inputSpy.callCount).to.equal(2);\n expect(changeSpy.callCount).to.equal(2);\n\n el.inputY.focus();\n inputSpy.resetHistory();\n changeSpy.resetHistory();\n await sendKeys({ press: 'ArrowDown' });\n await sendKeys({ press: 'ArrowDown' });\n\n await elementUpdated(el);\n\n expect(inputSpy.callCount).to.equal(2);\n expect(changeSpy.callCount).to.equal(2);\n\n el.inputX.focus();\n inputSpy.resetHistory();\n changeSpy.resetHistory();\n await sendKeys({ press: 'ArrowLeft' });\n await sendKeys({ press: 'ArrowLeft' });\n\n await elementUpdated(el);\n expect(inputSpy.callCount).to.equal(2);\n expect(changeSpy.callCount).to.equal(2);\n });\n it('retains `hue` value when s = 0 in HSL string format', async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area color=\"hsl(100, 50%, 50%)\"></sp-color-area>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.hue, 'hue').to.equal(100);\n expect(el.x, 'x').to.equal(0.67);\n expect(el.y, 'y').to.equal(0.25);\n expect(el.color).to.equal('hsl(100, 50%, 50%)');\n\n el.color = 'hsl(100, 0%, 50%)';\n await elementUpdated(el);\n\n expect(el.hue, 'new hue').to.equal(100);\n expect(el.x, 'new x').to.equal(0);\n expect(el.y, 'new y').to.equal(0.5);\n expect(el.color).to.equal('hsl(100, 0%, 50%)');\n });\n it('retains `hue` value when s = 0 in HSL object format', async () => {\n let inputColor = { h: 100, s: 0.5, l: 0.5 };\n\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area .color=${inputColor}></sp-color-area>\n `\n );\n\n await elementUpdated(el);\n\n let outputColor = el.color as { h: number; s: number; l: number };\n const variance = 0.00005;\n\n expect(el.hue).to.equal(100);\n expect(el.x, 'x').to.equal(0.67);\n expect(el.y, 'y').to.equal(0.25);\n\n expect(Math.abs(outputColor.h - inputColor.h)).to.be.lessThan(variance);\n expect(Math.abs(outputColor.s - inputColor.s)).to.be.lessThan(variance);\n expect(Math.abs(outputColor.l - inputColor.l)).to.be.lessThan(variance);\n\n inputColor = { h: 100, s: 0, l: 0.5 };\n el.color = inputColor;\n\n await elementUpdated(el);\n outputColor = el.color as { h: number; s: number; l: number };\n\n expect(el.hue).to.equal(100);\n expect(el.x, 'x').to.equal(0);\n expect(el.y, 'y').to.equal(0.5);\n\n expect(Math.abs(outputColor.h - inputColor.h)).to.be.lessThan(variance);\n expect(Math.abs(outputColor.s - inputColor.s)).to.be.lessThan(variance);\n expect(Math.abs(outputColor.l - inputColor.l)).to.be.lessThan(variance);\n });\n it('retains `hue` value when s = 0 in HSV string format', async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area color=\"hsv(100, 50%, 50%)\"></sp-color-area>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.hue, 'hue').to.equal(100);\n expect(el.x, 'x').to.equal(0.5);\n expect(el.y, 'y').to.equal(0.5);\n expect(el.color).to.equal('hsv(100, 50%, 50%)');\n\n el.color = 'hsv(100, 0%, 50%)';\n await elementUpdated(el);\n\n expect(el.hue, 'new hue').to.equal(100);\n expect(el.x, 'new x').to.equal(0);\n expect(el.y, 'new y').to.equal(0.5);\n expect(el.color).to.equal('hsv(100, 0%, 50%)');\n });\n it('retains `hue` value when s = 0 in HSV object format', async () => {\n let inputColor = { h: 100, s: 0.5, v: 0.5 };\n\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area .color=${inputColor}></sp-color-area>\n `\n );\n\n await elementUpdated(el);\n\n let outputColor = el.color as { h: number; s: number; v: number };\n const variance = 0.00005;\n\n expect(el.hue).to.equal(100);\n expect(el.x, 'x').to.equal(0.5);\n expect(el.y, 'y').to.equal(0.5);\n\n expect(Math.abs(outputColor.h - inputColor.h)).to.be.lessThan(variance);\n expect(Math.abs(outputColor.s - inputColor.s)).to.be.lessThan(variance);\n expect(Math.abs(outputColor.v - inputColor.v)).to.be.lessThan(variance);\n\n inputColor = { h: 100, s: 0, v: 0.5 };\n el.color = inputColor;\n\n await elementUpdated(el);\n outputColor = el.color as { h: number; s: number; v: number };\n\n expect(el.hue).to.equal(100);\n expect(el.x, 'x').to.equal(0);\n expect(el.y, 'y').to.equal(0.5);\n\n expect(Math.abs(outputColor.h - inputColor.h)).to.be.lessThan(variance);\n expect(Math.abs(outputColor.s - inputColor.s)).to.be.lessThan(variance);\n expect(Math.abs(outputColor.v - inputColor.v)).to.be.lessThan(variance);\n });\n const colorFormats: {\n name: string;\n color:\n | string\n | number\n | TinyColor\n | HSVA\n | HSV\n | RGB\n | RGBA\n | HSL\n | HSLA;\n }[] = [\n //rgb\n { name: 'RGB String', color: 'rgb(204, 51, 204)' },\n { name: 'RGB', color: { r: 204, g: 51, b: 204, a: 1 } },\n //prgb\n { name: 'PRGB String', color: 'rgb(80%, 20%, 80%)' },\n { name: 'PRGB', color: { r: '80%', g: '20%', b: '80%', a: 1 } },\n // hex\n { name: 'Hex', color: 'cc33cc' },\n { name: 'Hex String', color: '#cc33cc' },\n // hex8\n { name: 'Hex8', color: 'cc33ccff' },\n { name: 'Hex8 String', color: '#cc33ccff' },\n // name\n { name: 'string', color: 'red' },\n // hsl\n { name: 'HSL String', color: 'hsl(300, 60%, 50%)' },\n { name: 'HSL', color: { h: 300, s: 0.6000000000000001, l: 0.5, a: 1 } },\n // hsv\n { name: 'HSV String', color: 'hsv(300, 75%, 100%)' },\n { name: 'HSV', color: { h: 300, s: 0.75, v: 1, a: 1 } },\n ];\n colorFormats.map((format) => {\n it(`maintains \\`color\\` format as ${format.name}`, async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area></sp-color-area>\n `\n );\n\n el.color = format.color;\n if (format.name.startsWith('Hex')) {\n expect(el.color).to.equal(format.color);\n } else expect(el.color).to.deep.equal(format.color);\n });\n });\n it(`maintains \\`color\\` format as TinyColor`, async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area></sp-color-area>\n `\n );\n const color = new TinyColor('rgb(204, 51, 204)');\n el.color = color;\n expect(color.equals(el.color));\n });\n it(`resolves Hex3 format to Hex6 format`, async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area></sp-color-area>\n `\n );\n el.color = '0f0';\n expect(el.color).to.equal('00ff00');\n\n el.color = '#1e0';\n expect(el.color).to.equal('#11ee00');\n });\n it(`resolves Hex4 format to Hex8 format`, async () => {\n const el = await fixture<ColorArea>(\n html`\n <sp-color-area></sp-color-area>\n `\n );\n el.color = 'f3af';\n expect(el.color).to.equal('ff33aaff');\n\n el.color = '#f3af';\n expect(el.color).to.equal('#ff33aaff');\n });\n});\n"]}
|