@spectrum-web-components/dropzone 0.9.10 → 0.9.11-devmode.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/dropzone",
3
- "version": "0.9.10",
3
+ "version": "0.9.11-devmode.0+07474d44f",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -20,11 +20,24 @@
20
20
  "module": "./src/index.js",
21
21
  "type": "module",
22
22
  "exports": {
23
- ".": "./src/index.js",
24
- "./src/*": "./src/*",
23
+ ".": {
24
+ "development": "./src/index.dev.js",
25
+ "default": "./src/index.js"
26
+ },
25
27
  "./package.json": "./package.json",
26
- "./sp-dropzone": "./sp-dropzone.js",
27
- "./sp-dropzone.js": "./sp-dropzone.js"
28
+ "./src/Dropzone.js": {
29
+ "development": "./src/Dropzone.dev.js",
30
+ "default": "./src/Dropzone.js"
31
+ },
32
+ "./src/dropzone.css.js": "./src/dropzone.css.js",
33
+ "./src/index.js": {
34
+ "development": "./src/index.dev.js",
35
+ "default": "./src/index.js"
36
+ },
37
+ "./sp-dropzone.js": {
38
+ "development": "./sp-dropzone.dev.js",
39
+ "default": "./sp-dropzone.js"
40
+ }
28
41
  },
29
42
  "scripts": {
30
43
  "test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
@@ -44,7 +57,7 @@
44
57
  "lit-html"
45
58
  ],
46
59
  "dependencies": {
47
- "@spectrum-web-components/base": "^0.5.8",
60
+ "@spectrum-web-components/base": "^0.5.9-devmode.24+07474d44f",
48
61
  "tslib": "^2.0.0"
49
62
  },
50
63
  "devDependencies": {
@@ -55,5 +68,5 @@
55
68
  "sideEffects": [
56
69
  "./sp-*.js"
57
70
  ],
58
- "gitHead": "3be62133721efba844cd7032566a2c49ed6d9875"
71
+ "gitHead": "07474d44f6cee1db241b9ccf3dc812514ffbe7fa"
59
72
  }
@@ -0,0 +1,3 @@
1
+ import { Dropzone } from "./src/Dropzone.dev.js";
2
+ customElements.define("sp-dropzone", Dropzone);
3
+ //# sourceMappingURL=sp-dropzone.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-dropzone.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*/\nimport { Dropzone } from './src/Dropzone.dev.js'\n\ncustomElements.define('sp-dropzone', Dropzone);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-dropzone': Dropzone;\n }\n}\n"],
5
+ "mappings": "AAWA;AAEA,eAAe,OAAO,eAAe,QAAQ;",
6
+ "names": []
7
+ }
package/sp-dropzone.js CHANGED
@@ -1,14 +1,3 @@
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 { Dropzone } from './src/Dropzone.js';
13
- customElements.define('sp-dropzone', Dropzone);
14
- //# sourceMappingURL=sp-dropzone.js.map
1
+ import { Dropzone } from "./src/Dropzone.js";
2
+ customElements.define("sp-dropzone", Dropzone);
3
+ //# sourceMappingURL=sp-dropzone.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"sp-dropzone.js","sourceRoot":"","sources":["sp-dropzone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,QAAQ,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*/\nimport { Dropzone } from './src/Dropzone.js';\n\ncustomElements.define('sp-dropzone', Dropzone);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-dropzone': Dropzone;\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-dropzone.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*/\nimport { Dropzone } from './src/Dropzone.js';\n\ncustomElements.define('sp-dropzone', Dropzone);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-dropzone': Dropzone;\n }\n}\n"],
5
+ "mappings": "AAWA;AAEA,eAAe,OAAO,eAAe,QAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,112 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result)
9
+ __defProp(target, key, result);
10
+ return result;
11
+ };
12
+ import {
13
+ html,
14
+ SpectrumElement
15
+ } from "@spectrum-web-components/base";
16
+ import { property } from "@spectrum-web-components/base/src/decorators.js";
17
+ import dropzoneStyles from "./dropzone.css.js";
18
+ export class Dropzone extends SpectrumElement {
19
+ constructor() {
20
+ super(...arguments);
21
+ this._dropEffect = "copy";
22
+ this.isDragged = false;
23
+ this.debouncedDragLeave = null;
24
+ }
25
+ static get styles() {
26
+ return [dropzoneStyles];
27
+ }
28
+ get dropEffect() {
29
+ return this._dropEffect;
30
+ }
31
+ set dropEffect(value) {
32
+ if (["copy", "move", "link", "none"].includes(value)) {
33
+ this._dropEffect = value;
34
+ }
35
+ }
36
+ connectedCallback() {
37
+ super.connectedCallback();
38
+ this.addEventListener("drop", this.onDrop);
39
+ this.addEventListener("dragover", this.onDragOver);
40
+ this.addEventListener("dragleave", this.onDragLeave);
41
+ }
42
+ disconnectedCallback() {
43
+ super.disconnectedCallback();
44
+ this.removeEventListener("drop", this.onDrop);
45
+ this.removeEventListener("dragover", this.onDragOver);
46
+ this.removeEventListener("dragleave", this.onDragLeave);
47
+ }
48
+ onDragOver(event) {
49
+ const shouldAcceptEvent = new CustomEvent("sp-dropzone-should-accept", {
50
+ bubbles: true,
51
+ cancelable: true,
52
+ composed: true,
53
+ detail: event
54
+ });
55
+ const shouldAccept = this.dispatchEvent(shouldAcceptEvent);
56
+ if (!event.dataTransfer) {
57
+ return;
58
+ }
59
+ if (!shouldAccept) {
60
+ event.dataTransfer.dropEffect = "none";
61
+ return;
62
+ }
63
+ event.preventDefault();
64
+ this.clearDebouncedDragLeave();
65
+ this.isDragged = true;
66
+ event.dataTransfer.dropEffect = this.dropEffect;
67
+ const dragOverEvent = new CustomEvent("sp-dropzone-dragover", {
68
+ bubbles: true,
69
+ composed: true,
70
+ detail: event
71
+ });
72
+ this.dispatchEvent(dragOverEvent);
73
+ }
74
+ onDragLeave(event) {
75
+ this.clearDebouncedDragLeave();
76
+ this.debouncedDragLeave = window.setTimeout(() => {
77
+ this.isDragged = false;
78
+ const dragLeave = new CustomEvent("sp-dropzone-dragleave", {
79
+ bubbles: true,
80
+ composed: true,
81
+ detail: event
82
+ });
83
+ this.dispatchEvent(dragLeave);
84
+ }, 100);
85
+ }
86
+ onDrop(event) {
87
+ event.preventDefault();
88
+ this.clearDebouncedDragLeave();
89
+ this.isDragged = false;
90
+ const dropEvent = new CustomEvent("sp-dropzone-drop", {
91
+ bubbles: true,
92
+ composed: true,
93
+ detail: event
94
+ });
95
+ this.dispatchEvent(dropEvent);
96
+ }
97
+ render() {
98
+ return html`
99
+ <slot></slot>
100
+ `;
101
+ }
102
+ clearDebouncedDragLeave() {
103
+ if (this.debouncedDragLeave) {
104
+ clearTimeout(this.debouncedDragLeave);
105
+ this.debouncedDragLeave = null;
106
+ }
107
+ }
108
+ }
109
+ __decorateClass([
110
+ property({ type: Boolean, reflect: true, attribute: "dragged" })
111
+ ], Dropzone.prototype, "isDragged", 2);
112
+ //# sourceMappingURL=Dropzone.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["Dropzone.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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport dropzoneStyles from './dropzone.css.js';\n\nexport type DropzoneEventDetail = DragEvent;\n\nexport type DropEffects = 'copy' | 'move' | 'link' | 'none';\n\n/**\n * @element sp-dropzone\n *\n * @slot - The default slot on an `sp-dropzone` is a great place to place upload instructions\n * built with an `sp-illustrated-message` or other information, possibly even built from data\n * provided by the upload, to support users successfully interacting with the drag and drop\n * based features of your application\n *\n * @fires sp-dropzone-should-accept - A cancellable event that confirms whether or not\n * a file dropped on the UI should be accepted.\n * @fires sp-dropzone-dragover - Announces when files have been dragged over the UI, but not yet dropped.\n * @fires sp-dropzone-dragleave - Announces when dragged files have been moved out of the UI without having been dropped.\n * @fires sp-dropzone-drop - Announces when dragged files have been dropped on the UI.\n */\nexport class Dropzone extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [dropzoneStyles];\n }\n\n /**\n * Controls the feedback (typically visual) the user is given during a drag and drop operation\n * @attr\n * @type {'copy' | 'move' | 'link' | 'none'}\n */\n public get dropEffect(): DropEffects {\n return this._dropEffect;\n }\n public set dropEffect(value: DropEffects) {\n if (['copy', 'move', 'link', 'none'].includes(value)) {\n this._dropEffect = value;\n }\n }\n private _dropEffect: DropEffects = 'copy';\n\n @property({ type: Boolean, reflect: true, attribute: 'dragged' })\n public isDragged = false;\n\n private debouncedDragLeave: number | null = null;\n\n public override connectedCallback(): void {\n super.connectedCallback();\n\n this.addEventListener('drop', this.onDrop);\n this.addEventListener('dragover', this.onDragOver);\n this.addEventListener('dragleave', this.onDragLeave);\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n\n this.removeEventListener('drop', this.onDrop);\n this.removeEventListener('dragover', this.onDragOver);\n this.removeEventListener('dragleave', this.onDragLeave);\n }\n\n public onDragOver(event: DragEvent): void {\n const shouldAcceptEvent = new CustomEvent('sp-dropzone-should-accept', {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: event,\n });\n const shouldAccept = this.dispatchEvent(shouldAcceptEvent);\n if (!event.dataTransfer) {\n return;\n }\n if (!shouldAccept) {\n event.dataTransfer.dropEffect = 'none';\n return;\n }\n\n event.preventDefault();\n\n this.clearDebouncedDragLeave();\n\n this.isDragged = true;\n\n event.dataTransfer.dropEffect = this.dropEffect;\n const dragOverEvent = new CustomEvent('sp-dropzone-dragover', {\n bubbles: true,\n composed: true,\n detail: event,\n });\n this.dispatchEvent(dragOverEvent);\n }\n\n public onDragLeave(event: DragEvent): void {\n this.clearDebouncedDragLeave();\n\n this.debouncedDragLeave = window.setTimeout(() => {\n this.isDragged = false;\n\n const dragLeave = new CustomEvent('sp-dropzone-dragleave', {\n bubbles: true,\n composed: true,\n detail: event,\n });\n this.dispatchEvent(dragLeave);\n }, 100);\n }\n\n public onDrop(event: DragEvent): void {\n event.preventDefault();\n\n this.clearDebouncedDragLeave();\n\n this.isDragged = false;\n const dropEvent = new CustomEvent('sp-dropzone-drop', {\n bubbles: true,\n composed: true,\n detail: event,\n });\n this.dispatchEvent(dropEvent);\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n\n protected clearDebouncedDragLeave(): void {\n if (this.debouncedDragLeave) {\n clearTimeout(this.debouncedDragLeave);\n this.debouncedDragLeave = null;\n }\n }\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n 'sp-dropzone:should-accept': CustomEvent<DragEvent>;\n 'sp-dropzone:dragover': CustomEvent<DragEvent>;\n 'sp-dropzone:dragleave': CustomEvent<DragEvent>;\n 'sp-dropzone:drop': CustomEvent<DragEvent>;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAAA;AAMA;AAEA;AAoBO,aAAM,iBAAiB,gBAAgB;AAAA,EAAvC;AAAA;AAkBK,uBAA2B;AAG5B,qBAAY;AAEX,8BAAoC;AAAA;AAAA,aAtBjB,SAAyB;AAChD,WAAO,CAAC,cAAc;AAAA,EAC1B;AAAA,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A,QACT,UAAU;AAAA,QACV,QAAQ;AAAA,MACZ,CAAC;AACD,WAAK,cAAc,SAAS;AAAA,IAChC,GAAG,GAAG;AAAA,EACV;AAAA,EAEO,OAAO,OAAwB;AAClC,UAAM,eAAe;AAErB,SAAK,wBAAwB;AAE7B,SAAK,YAAY;AACjB,UAAM,YAAY,IAAI,YAAY,oBAAoB;AAAA,MAClD,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ;AAAA,IACZ,CAAC;AACD,SAAK,cAAc,SAAS;AAAA,EAChC;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA;AAAA,EAGX;AAAA,EAEU,0BAAgC;AACtC,QAAI,KAAK,oBAAoB;AACzB,mBAAa,KAAK,kBAAkB;AACpC,WAAK,qBAAqB;AAAA,IAC9B;AAAA,EACJ;AACJ;AA5FW;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,UAAU,CAAC;AAAA,GACzD,AArBJ,SAqBI;",
6
+ "names": []
7
+ }
package/src/Dropzone.js CHANGED
@@ -1,129 +1,112 @@
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 { __decorate } from "tslib";
13
- import { html, SpectrumElement, } from '@spectrum-web-components/base';
14
- import { property } from '@spectrum-web-components/base/src/decorators.js';
15
- import dropzoneStyles from './dropzone.css.js';
16
- /**
17
- * @element sp-dropzone
18
- *
19
- * @slot - The default slot on an `sp-dropzone` is a great place to place upload instructions
20
- * built with an `sp-illustrated-message` or other information, possibly even built from data
21
- * provided by the upload, to support users successfully interacting with the drag and drop
22
- * based features of your application
23
- *
24
- * @fires sp-dropzone-should-accept - A cancellable event that confirms whether or not
25
- * a file dropped on the UI should be accepted.
26
- * @fires sp-dropzone-dragover - Announces when files have been dragged over the UI, but not yet dropped.
27
- * @fires sp-dropzone-dragleave - Announces when dragged files have been moved out of the UI without having been dropped.
28
- * @fires sp-dropzone-drop - Announces when dragged files have been dropped on the UI.
29
- */
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result)
9
+ __defProp(target, key, result);
10
+ return result;
11
+ };
12
+ import {
13
+ html,
14
+ SpectrumElement
15
+ } from "@spectrum-web-components/base";
16
+ import { property } from "@spectrum-web-components/base/src/decorators.js";
17
+ import dropzoneStyles from "./dropzone.css.js";
30
18
  export class Dropzone extends SpectrumElement {
31
- constructor() {
32
- super(...arguments);
33
- this._dropEffect = 'copy';
34
- this.isDragged = false;
35
- this.debouncedDragLeave = null;
19
+ constructor() {
20
+ super(...arguments);
21
+ this._dropEffect = "copy";
22
+ this.isDragged = false;
23
+ this.debouncedDragLeave = null;
24
+ }
25
+ static get styles() {
26
+ return [dropzoneStyles];
27
+ }
28
+ get dropEffect() {
29
+ return this._dropEffect;
30
+ }
31
+ set dropEffect(value) {
32
+ if (["copy", "move", "link", "none"].includes(value)) {
33
+ this._dropEffect = value;
36
34
  }
37
- static get styles() {
38
- return [dropzoneStyles];
35
+ }
36
+ connectedCallback() {
37
+ super.connectedCallback();
38
+ this.addEventListener("drop", this.onDrop);
39
+ this.addEventListener("dragover", this.onDragOver);
40
+ this.addEventListener("dragleave", this.onDragLeave);
41
+ }
42
+ disconnectedCallback() {
43
+ super.disconnectedCallback();
44
+ this.removeEventListener("drop", this.onDrop);
45
+ this.removeEventListener("dragover", this.onDragOver);
46
+ this.removeEventListener("dragleave", this.onDragLeave);
47
+ }
48
+ onDragOver(event) {
49
+ const shouldAcceptEvent = new CustomEvent("sp-dropzone-should-accept", {
50
+ bubbles: true,
51
+ cancelable: true,
52
+ composed: true,
53
+ detail: event
54
+ });
55
+ const shouldAccept = this.dispatchEvent(shouldAcceptEvent);
56
+ if (!event.dataTransfer) {
57
+ return;
39
58
  }
40
- /**
41
- * Controls the feedback (typically visual) the user is given during a drag and drop operation
42
- * @attr
43
- * @type {'copy' | 'move' | 'link' | 'none'}
44
- */
45
- get dropEffect() {
46
- return this._dropEffect;
59
+ if (!shouldAccept) {
60
+ event.dataTransfer.dropEffect = "none";
61
+ return;
47
62
  }
48
- set dropEffect(value) {
49
- if (['copy', 'move', 'link', 'none'].includes(value)) {
50
- this._dropEffect = value;
51
- }
52
- }
53
- connectedCallback() {
54
- super.connectedCallback();
55
- this.addEventListener('drop', this.onDrop);
56
- this.addEventListener('dragover', this.onDragOver);
57
- this.addEventListener('dragleave', this.onDragLeave);
58
- }
59
- disconnectedCallback() {
60
- super.disconnectedCallback();
61
- this.removeEventListener('drop', this.onDrop);
62
- this.removeEventListener('dragover', this.onDragOver);
63
- this.removeEventListener('dragleave', this.onDragLeave);
64
- }
65
- onDragOver(event) {
66
- const shouldAcceptEvent = new CustomEvent('sp-dropzone-should-accept', {
67
- bubbles: true,
68
- cancelable: true,
69
- composed: true,
70
- detail: event,
71
- });
72
- const shouldAccept = this.dispatchEvent(shouldAcceptEvent);
73
- if (!event.dataTransfer) {
74
- return;
75
- }
76
- if (!shouldAccept) {
77
- event.dataTransfer.dropEffect = 'none';
78
- return;
79
- }
80
- event.preventDefault();
81
- this.clearDebouncedDragLeave();
82
- this.isDragged = true;
83
- event.dataTransfer.dropEffect = this.dropEffect;
84
- const dragOverEvent = new CustomEvent('sp-dropzone-dragover', {
85
- bubbles: true,
86
- composed: true,
87
- detail: event,
88
- });
89
- this.dispatchEvent(dragOverEvent);
90
- }
91
- onDragLeave(event) {
92
- this.clearDebouncedDragLeave();
93
- this.debouncedDragLeave = window.setTimeout(() => {
94
- this.isDragged = false;
95
- const dragLeave = new CustomEvent('sp-dropzone-dragleave', {
96
- bubbles: true,
97
- composed: true,
98
- detail: event,
99
- });
100
- this.dispatchEvent(dragLeave);
101
- }, 100);
102
- }
103
- onDrop(event) {
104
- event.preventDefault();
105
- this.clearDebouncedDragLeave();
106
- this.isDragged = false;
107
- const dropEvent = new CustomEvent('sp-dropzone-drop', {
108
- bubbles: true,
109
- composed: true,
110
- detail: event,
111
- });
112
- this.dispatchEvent(dropEvent);
113
- }
114
- render() {
115
- return html `
63
+ event.preventDefault();
64
+ this.clearDebouncedDragLeave();
65
+ this.isDragged = true;
66
+ event.dataTransfer.dropEffect = this.dropEffect;
67
+ const dragOverEvent = new CustomEvent("sp-dropzone-dragover", {
68
+ bubbles: true,
69
+ composed: true,
70
+ detail: event
71
+ });
72
+ this.dispatchEvent(dragOverEvent);
73
+ }
74
+ onDragLeave(event) {
75
+ this.clearDebouncedDragLeave();
76
+ this.debouncedDragLeave = window.setTimeout(() => {
77
+ this.isDragged = false;
78
+ const dragLeave = new CustomEvent("sp-dropzone-dragleave", {
79
+ bubbles: true,
80
+ composed: true,
81
+ detail: event
82
+ });
83
+ this.dispatchEvent(dragLeave);
84
+ }, 100);
85
+ }
86
+ onDrop(event) {
87
+ event.preventDefault();
88
+ this.clearDebouncedDragLeave();
89
+ this.isDragged = false;
90
+ const dropEvent = new CustomEvent("sp-dropzone-drop", {
91
+ bubbles: true,
92
+ composed: true,
93
+ detail: event
94
+ });
95
+ this.dispatchEvent(dropEvent);
96
+ }
97
+ render() {
98
+ return html`
116
99
  <slot></slot>
117
100
  `;
101
+ }
102
+ clearDebouncedDragLeave() {
103
+ if (this.debouncedDragLeave) {
104
+ clearTimeout(this.debouncedDragLeave);
105
+ this.debouncedDragLeave = null;
118
106
  }
119
- clearDebouncedDragLeave() {
120
- if (this.debouncedDragLeave) {
121
- clearTimeout(this.debouncedDragLeave);
122
- this.debouncedDragLeave = null;
123
- }
124
- }
107
+ }
125
108
  }
126
- __decorate([
127
- property({ type: Boolean, reflect: true, attribute: 'dragged' })
128
- ], Dropzone.prototype, "isDragged", void 0);
129
- //# sourceMappingURL=Dropzone.js.map
109
+ __decorateClass([
110
+ property({ type: Boolean, reflect: true, attribute: "dragged" })
111
+ ], Dropzone.prototype, "isDragged", 2);
112
+ //# sourceMappingURL=Dropzone.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"Dropzone.js","sourceRoot":"","sources":["Dropzone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,EACJ,eAAe,GAElB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAE3E,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAM/C;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,QAAS,SAAQ,eAAe;IAA7C;;QAkBY,gBAAW,GAAgB,MAAM,CAAC;QAGnC,cAAS,GAAG,KAAK,CAAC;QAEjB,uBAAkB,GAAkB,IAAI,CAAC;IA0FrD,CAAC;IAhHU,MAAM,KAAc,MAAM;QAC7B,OAAO,CAAC,cAAc,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IACD,IAAW,UAAU,CAAC,KAAkB;QACpC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YAClD,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;SAC5B;IACL,CAAC;IAQe,iBAAiB;QAC7B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1B,IAAI,CAAC,gBAAgB,CAAC,MAA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ights 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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport dropzoneStyles from './dropzone.css.js';\n\nexport type DropzoneEventDetail = DragEvent;\n\nexport type DropEffects = 'copy' | 'move' | 'link' | 'none';\n\n/**\n * @element sp-dropzone\n *\n * @slot - The default slot on an `sp-dropzone` is a great place to place upload instructions\n * built with an `sp-illustrated-message` or other information, possibly even built from data\n * provided by the upload, to support users successfully interacting with the drag and drop\n * based features of your application\n *\n * @fires sp-dropzone-should-accept - A cancellable event that confirms whether or not\n * a file dropped on the UI should be accepted.\n * @fires sp-dropzone-dragover - Announces when files have been dragged over the UI, but not yet dropped.\n * @fires sp-dropzone-dragleave - Announces when dragged files have been moved out of the UI without having been dropped.\n * @fires sp-dropzone-drop - Announces when dragged files have been dropped on the UI.\n */\nexport class Dropzone extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [dropzoneStyles];\n }\n\n /**\n * Controls the feedback (typically visual) the user is given during a drag and drop operation\n * @attr\n * @type {'copy' | 'move' | 'link' | 'none'}\n */\n public get dropEffect(): DropEffects {\n return this._dropEffect;\n }\n public set dropEffect(value: DropEffects) {\n if (['copy', 'move', 'link', 'none'].includes(value)) {\n this._dropEffect = value;\n }\n }\n private _dropEffect: DropEffects = 'copy';\n\n @property({ type: Boolean, reflect: true, attribute: 'dragged' })\n public isDragged = false;\n\n private debouncedDragLeave: number | null = null;\n\n public override connectedCallback(): void {\n super.connectedCallback();\n\n this.addEventListener('drop', this.onDrop);\n this.addEventListener('dragover', this.onDragOver);\n this.addEventListener('dragleave', this.onDragLeave);\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n\n this.removeEventListener('drop', this.onDrop);\n this.removeEventListener('dragover', this.onDragOver);\n this.removeEventListener('dragleave', this.onDragLeave);\n }\n\n public onDragOver(event: DragEvent): void {\n const shouldAcceptEvent = new CustomEvent('sp-dropzone-should-accept', {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: event,\n });\n const shouldAccept = this.dispatchEvent(shouldAcceptEvent);\n if (!event.dataTransfer) {\n return;\n }\n if (!shouldAccept) {\n event.dataTransfer.dropEffect = 'none';\n return;\n }\n\n event.preventDefault();\n\n this.clearDebouncedDragLeave();\n\n this.isDragged = true;\n\n event.dataTransfer.dropEffect = this.dropEffect;\n const dragOverEvent = new CustomEvent('sp-dropzone-dragover', {\n bubbles: true,\n composed: true,\n detail: event,\n });\n this.dispatchEvent(dragOverEvent);\n }\n\n public onDragLeave(event: DragEvent): void {\n this.clearDebouncedDragLeave();\n\n this.debouncedDragLeave = window.setTimeout(() => {\n this.isDragged = false;\n\n const dragLeave = new CustomEvent('sp-dropzone-dragleave', {\n bubbles: true,\n composed: true,\n detail: event,\n });\n this.dispatchEvent(dragLeave);\n }, 100);\n }\n\n public onDrop(event: DragEvent): void {\n event.preventDefault();\n\n this.clearDebouncedDragLeave();\n\n this.isDragged = false;\n const dropEvent = new CustomEvent('sp-dropzone-drop', {\n bubbles: true,\n composed: true,\n detail: event,\n });\n this.dispatchEvent(dropEvent);\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n\n protected clearDebouncedDragLeave(): void {\n if (this.debouncedDragLeave) {\n clearTimeout(this.debouncedDragLeave);\n this.debouncedDragLeave = null;\n }\n }\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n 'sp-dropzone:should-accept': CustomEvent<DragEvent>;\n 'sp-dropzone:dragover': CustomEvent<DragEvent>;\n 'sp-dropzone:dragleave': CustomEvent<DragEvent>;\n 'sp-dropzone:drop': CustomEvent<DragEvent>;\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["Dropzone.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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport dropzoneStyles from './dropzone.css.js';\n\nexport type DropzoneEventDetail = DragEvent;\n\nexport type DropEffects = 'copy' | 'move' | 'link' | 'none';\n\n/**\n * @element sp-dropzone\n *\n * @slot - The default slot on an `sp-dropzone` is a great place to place upload instructions\n * built with an `sp-illustrated-message` or other information, possibly even built from data\n * provided by the upload, to support users successfully interacting with the drag and drop\n * based features of your application\n *\n * @fires sp-dropzone-should-accept - A cancellable event that confirms whether or not\n * a file dropped on the UI should be accepted.\n * @fires sp-dropzone-dragover - Announces when files have been dragged over the UI, but not yet dropped.\n * @fires sp-dropzone-dragleave - Announces when dragged files have been moved out of the UI without having been dropped.\n * @fires sp-dropzone-drop - Announces when dragged files have been dropped on the UI.\n */\nexport class Dropzone extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [dropzoneStyles];\n }\n\n /**\n * Controls the feedback (typically visual) the user is given during a drag and drop operation\n * @attr\n * @type {'copy' | 'move' | 'link' | 'none'}\n */\n public get dropEffect(): DropEffects {\n return this._dropEffect;\n }\n public set dropEffect(value: DropEffects) {\n if (['copy', 'move', 'link', 'none'].includes(value)) {\n this._dropEffect = value;\n }\n }\n private _dropEffect: DropEffects = 'copy';\n\n @property({ type: Boolean, reflect: true, attribute: 'dragged' })\n public isDragged = false;\n\n private debouncedDragLeave: number | null = null;\n\n public override connectedCallback(): void {\n super.connectedCallback();\n\n this.addEventListener('drop', this.onDrop);\n this.addEventListener('dragover', this.onDragOver);\n this.addEventListener('dragleave', this.onDragLeave);\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n\n this.removeEventListener('drop', this.onDrop);\n this.removeEventListener('dragover', this.onDragOver);\n this.removeEventListener('dragleave', this.onDragLeave);\n }\n\n public onDragOver(event: DragEvent): void {\n const shouldAcceptEvent = new CustomEvent('sp-dropzone-should-accept', {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: event,\n });\n const shouldAccept = this.dispatchEvent(shouldAcceptEvent);\n if (!event.dataTransfer) {\n return;\n }\n if (!shouldAccept) {\n event.dataTransfer.dropEffect = 'none';\n return;\n }\n\n event.preventDefault();\n\n this.clearDebouncedDragLeave();\n\n this.isDragged = true;\n\n event.dataTransfer.dropEffect = this.dropEffect;\n const dragOverEvent = new CustomEvent('sp-dropzone-dragover', {\n bubbles: true,\n composed: true,\n detail: event,\n });\n this.dispatchEvent(dragOverEvent);\n }\n\n public onDragLeave(event: DragEvent): void {\n this.clearDebouncedDragLeave();\n\n this.debouncedDragLeave = window.setTimeout(() => {\n this.isDragged = false;\n\n const dragLeave = new CustomEvent('sp-dropzone-dragleave', {\n bubbles: true,\n composed: true,\n detail: event,\n });\n this.dispatchEvent(dragLeave);\n }, 100);\n }\n\n public onDrop(event: DragEvent): void {\n event.preventDefault();\n\n this.clearDebouncedDragLeave();\n\n this.isDragged = false;\n const dropEvent = new CustomEvent('sp-dropzone-drop', {\n bubbles: true,\n composed: true,\n detail: event,\n });\n this.dispatchEvent(dropEvent);\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n\n protected clearDebouncedDragLeave(): void {\n if (this.debouncedDragLeave) {\n clearTimeout(this.debouncedDragLeave);\n this.debouncedDragLeave = null;\n }\n }\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n 'sp-dropzone:should-accept': CustomEvent<DragEvent>;\n 'sp-dropzone:dragover': CustomEvent<DragEvent>;\n 'sp-dropzone:dragleave': CustomEvent<DragEvent>;\n 'sp-dropzone:drop': CustomEvent<DragEvent>;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAAA;AAMA;AAEA;AAoBO,aAAM,iBAAiB,gBAAgB;AAAA,EAAvC;AAAA;AAkBK,uBAA2B;AAG5B,qBAAY;AAEX,8BAAoC;AAAA;AAAA,aAtBjB,SAAyB;AAChD,WAAO,CAAC,cAAc;AAAA,EAC1B;AAAA,MAOW,aAA0B;AACjC,WAAO,KAAK;AAAA,EAChB;AAAA,MACW,WAAW,OAAoB;AACtC,QAAI,CAAC,QAAQ,QAAQ,QAAQ,MAAM,EAAE,SAAS,KAAK,GAAG;AAClD,WAAK,cAAc;AAAA,IACvB;AAAA,EACJ;AAAA,EAQgB,oBAA0B;AACtC,UAAM,kBAAkB;AAExB,SAAK,iBAAiB,QAAQ,KAAK,MAAM;AACzC,SAAK,iBAAiB,YAAY,KAAK,UAAU;AACjD,SAAK,iBAAiB,aAAa,KAAK,WAAW;AAAA,EACvD;AAAA,EAEgB,uBAA6B;AACzC,UAAM,qBAAqB;AAE3B,SAAK,oBAAoB,QAAQ,KAAK,MAAM;AAC5C,SAAK,oBAAoB,YAAY,KAAK,UAAU;AACpD,SAAK,oBAAoB,aAAa,KAAK,WAAW;AAAA,EAC1D;AAAA,EAEO,WAAW,OAAwB;AACtC,UAAM,oBAAoB,IAAI,YAAY,6BAA6B;AAAA,MACnE,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,QAAQ;AAAA,IACZ,CAAC;AACD,UAAM,eAAe,KAAK,cAAc,iBAAiB;AACzD,QAAI,CAAC,MAAM,cAAc;AACrB;AAAA,IACJ;AACA,QAAI,CAAC,cAAc;AACf,YAAM,aAAa,aAAa;AAChC;AAAA,IACJ;AAEA,UAAM,eAAe;AAErB,SAAK,wBAAwB;AAE7B,SAAK,YAAY;AAEjB,UAAM,aAAa,aAAa,KAAK;AACrC,UAAM,gBAAgB,IAAI,YAAY,wBAAwB;AAAA,MAC1D,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ;AAAA,IACZ,CAAC;AACD,SAAK,cAAc,aAAa;AAAA,EACpC;AAAA,EAEO,YAAY,OAAwB;AACvC,SAAK,wBAAwB;AAE7B,SAAK,qBAAqB,OAAO,WAAW,MAAM;AAC9C,WAAK,YAAY;AAEjB,YAAM,YAAY,IAAI,YAAY,yBAAyB;AAAA,QACvD,SAAS;AAAA,QACT,UAAU;AAAA,QACV,QAAQ;AAAA,MACZ,CAAC;AACD,WAAK,cAAc,SAAS;AAAA,IAChC,GAAG,GAAG;AAAA,EACV;AAAA,EAEO,OAAO,OAAwB;AAClC,UAAM,eAAe;AAErB,SAAK,wBAAwB;AAE7B,SAAK,YAAY;AACjB,UAAM,YAAY,IAAI,YAAY,oBAAoB;AAAA,MAClD,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ;AAAA,IACZ,CAAC;AACD,SAAK,cAAc,SAAS;AAAA,EAChC;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA;AAAA,EAGX;AAAA,EAEU,0BAAgC;AACtC,QAAI,KAAK,oBAAoB;AACzB,mBAAa,KAAK,kBAAkB;AACpC,WAAK,qBAAqB;AAAA,IAC9B;AAAA,EACJ;AACJ;AA5FW;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,UAAU,CAAC;AAAA,GACzD,AArBJ,SAqBI;",
6
+ "names": []
7
+ }
@@ -0,0 +1,48 @@
1
+ import { css } from "@spectrum-web-components/base";
2
+ const styles = css`
3
+ :host{border-radius:var(
4
+ --spectrum-dropzone-border-radius,var(--spectrum-alias-border-radius-regular)
5
+ );border-style:dashed;border-width:var(
6
+ --spectrum-dropzone-border-width,var(--spectrum-alias-border-size-thick)
7
+ );padding:var(
8
+ --spectrum-dropzone-padding,var(--spectrum-global-dimension-size-900)
9
+ );text-align:center}:host([dragged]){border-style:solid}:host(:focus){border-style:dashed;outline:0}:host(:focus.focus-visible){border-style:solid}:host(:focus:focus-visible){border-style:solid}:host{border-color:var(
10
+ --spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)
11
+ )}:host([dragged]){background-color:var(
12
+ --spectrum-dropzone-background-color-selected-hover,var(--spectrum-alias-highlight-selected)
13
+ );border-color:var(
14
+ --spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)
15
+ )}:host([dragged]) ::slotted(*){color:var(
16
+ --spectrum-global-color-blue-400
17
+ )}:host(:focus){border-color:var(
18
+ --spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)
19
+ )}:host(:focus) ::slotted(*){color:var(
20
+ --spectrum-global-color-static-gray-500,rgb(var(--spectrum-global-color-static-gray-500-rgb))
21
+ )}:host(:focus.focus-visible){border-color:var(
22
+ --spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)
23
+ )}:host(:focus:focus-visible){border-color:var(
24
+ --spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)
25
+ )}:host(:focus[dragged].focus-visible) ::slotted(*){color:var(
26
+ --spectrum-global-color-blue-400
27
+ )}:host(:focus[dragged]:focus-visible) ::slotted(*){color:var(
28
+ --spectrum-global-color-blue-400
29
+ )}:host{--spectrum-dropzone-illustration-color:var(
30
+ --spectrum-global-color-static-blue-400
31
+ );display:block}::slotted(*){font-family:var(
32
+ --spectrum-body-m-text-font-family,var(--spectrum-alias-body-text-font-family)
33
+ );font-size:var(
34
+ --spectrum-body-s-text-size,var(--spectrum-alias-font-size-default)
35
+ );font-style:var(
36
+ --spectrum-body-s-text-font-style,var(--spectrum-global-font-style-regular)
37
+ );font-weight:var(
38
+ --spectrum-body-s-text-font-weight,var(--spectrum-alias-body-text-font-weight)
39
+ );letter-spacing:var(
40
+ --spectrum-body-s-text-letter-spacing,var(--spectrum-global-font-letter-spacing-none)
41
+ );line-height:var(
42
+ --spectrum-body-s-text-line-height,var(--spectrum-alias-body-text-line-height)
43
+ );margin-bottom:0;margin-top:0;text-transform:var(--spectrum-body-s-text-transform,none)}:host([dragged]) ::slotted(*){--spectrum-global-color-gray-500:var(
44
+ --spectrum-dropzone-illustration-color
45
+ )}
46
+ `;
47
+ export default styles;
48
+ //# sourceMappingURL=dropzone.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["dropzone.css.ts"],
4
+ "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:host{border-radius:var(\n--spectrum-dropzone-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:dashed;border-width:var(\n--spectrum-dropzone-border-width,var(--spectrum-alias-border-size-thick)\n);padding:var(\n--spectrum-dropzone-padding,var(--spectrum-global-dimension-size-900)\n);text-align:center}:host([dragged]){border-style:solid}:host(:focus){border-style:dashed;outline:0}:host(:focus.focus-visible){border-style:solid}:host(:focus:focus-visible){border-style:solid}:host{border-color:var(\n--spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)\n)}:host([dragged]){background-color:var(\n--spectrum-dropzone-background-color-selected-hover,var(--spectrum-alias-highlight-selected)\n);border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host([dragged]) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host(:focus){border-color:var(\n--spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)\n)}:host(:focus) ::slotted(*){color:var(\n--spectrum-global-color-static-gray-500,rgb(var(--spectrum-global-color-static-gray-500-rgb))\n)}:host(:focus.focus-visible){border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host(:focus:focus-visible){border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host(:focus[dragged].focus-visible) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host(:focus[dragged]:focus-visible) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host{--spectrum-dropzone-illustration-color:var(\n--spectrum-global-color-static-blue-400\n);display:block}::slotted(*){font-family:var(\n--spectrum-body-m-text-font-family,var(--spectrum-alias-body-text-font-family)\n);font-size:var(\n--spectrum-body-s-text-size,var(--spectrum-alias-font-size-default)\n);font-style:var(\n--spectrum-body-s-text-font-style,var(--spectrum-global-font-style-regular)\n);font-weight:var(\n--spectrum-body-s-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);letter-spacing:var(\n--spectrum-body-s-text-letter-spacing,var(--spectrum-global-font-letter-spacing-none)\n);line-height:var(\n--spectrum-body-s-text-line-height,var(--spectrum-alias-body-text-line-height)\n);margin-bottom:0;margin-top:0;text-transform:var(--spectrum-body-s-text-transform,none)}:host([dragged]) ::slotted(*){--spectrum-global-color-gray-500:var(\n--spectrum-dropzone-illustration-color\n)}\n`;\nexport default styles;"],
5
+ "mappings": "AAWA;AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6Cf,eAAe;",
6
+ "names": []
7
+ }
@@ -1,16 +1,5 @@
1
- /*
2
- Copyright 2022 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 { css } from '@spectrum-web-components/base';
13
- const styles = css `
1
+ import { css } from "@spectrum-web-components/base";
2
+ const styles = css`
14
3
  :host{border-radius:var(
15
4
  --spectrum-dropzone-border-radius,var(--spectrum-alias-border-radius-regular)
16
5
  );border-style:dashed;border-width:var(
@@ -56,4 +45,4 @@ const styles = css `
56
45
  )}
57
46
  `;
58
47
  export default styles;
59
- //# sourceMappingURL=dropzone.css.js.map
48
+ //# sourceMappingURL=dropzone.css.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"dropzone.css.js","sourceRoot":"","sources":["dropzone.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CjB,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:host{border-radius:var(\n--spectrum-dropzone-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:dashed;border-width:var(\n--spectrum-dropzone-border-width,var(--spectrum-alias-border-size-thick)\n);padding:var(\n--spectrum-dropzone-padding,var(--spectrum-global-dimension-size-900)\n);text-align:center}:host([dragged]){border-style:solid}:host(:focus){border-style:dashed;outline:0}:host(:focus.focus-visible){border-style:solid}:host(:focus:focus-visible){border-style:solid}:host{border-color:var(\n--spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)\n)}:host([dragged]){background-color:var(\n--spectrum-dropzone-background-color-selected-hover,var(--spectrum-alias-highlight-selected)\n);border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host([dragged]) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host(:focus){border-color:var(\n--spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)\n)}:host(:focus) ::slotted(*){color:var(\n--spectrum-global-color-static-gray-500,rgb(var(--spectrum-global-color-static-gray-500-rgb))\n)}:host(:focus.focus-visible){border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host(:focus:focus-visible){border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host(:focus[dragged].focus-visible) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host(:focus[dragged]:focus-visible) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host{--spectrum-dropzone-illustration-color:var(\n--spectrum-global-color-static-blue-400\n);display:block}::slotted(*){font-family:var(\n--spectrum-body-m-text-font-family,var(--spectrum-alias-body-text-font-family)\n);font-size:var(\n--spectrum-body-s-text-size,var(--spectrum-alias-font-size-default)\n);font-style:var(\n--spectrum-body-s-text-font-style,var(--spectrum-global-font-style-regular)\n);font-weight:var(\n--spectrum-body-s-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);letter-spacing:var(\n--spectrum-body-s-text-letter-spacing,var(--spectrum-global-font-letter-spacing-none)\n);line-height:var(\n--spectrum-body-s-text-line-height,var(--spectrum-alias-body-text-line-height)\n);margin-bottom:0;margin-top:0;text-transform:var(--spectrum-body-s-text-transform,none)}:host([dragged]) ::slotted(*){--spectrum-global-color-gray-500:var(\n--spectrum-dropzone-illustration-color\n)}\n`;\nexport default styles;"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["dropzone.css.ts"],
4
+ "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:host{border-radius:var(\n--spectrum-dropzone-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:dashed;border-width:var(\n--spectrum-dropzone-border-width,var(--spectrum-alias-border-size-thick)\n);padding:var(\n--spectrum-dropzone-padding,var(--spectrum-global-dimension-size-900)\n);text-align:center}:host([dragged]){border-style:solid}:host(:focus){border-style:dashed;outline:0}:host(:focus.focus-visible){border-style:solid}:host(:focus:focus-visible){border-style:solid}:host{border-color:var(\n--spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)\n)}:host([dragged]){background-color:var(\n--spectrum-dropzone-background-color-selected-hover,var(--spectrum-alias-highlight-selected)\n);border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host([dragged]) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host(:focus){border-color:var(\n--spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)\n)}:host(:focus) ::slotted(*){color:var(\n--spectrum-global-color-static-gray-500,rgb(var(--spectrum-global-color-static-gray-500-rgb))\n)}:host(:focus.focus-visible){border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host(:focus:focus-visible){border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host(:focus[dragged].focus-visible) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host(:focus[dragged]:focus-visible) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host{--spectrum-dropzone-illustration-color:var(\n--spectrum-global-color-static-blue-400\n);display:block}::slotted(*){font-family:var(\n--spectrum-body-m-text-font-family,var(--spectrum-alias-body-text-font-family)\n);font-size:var(\n--spectrum-body-s-text-size,var(--spectrum-alias-font-size-default)\n);font-style:var(\n--spectrum-body-s-text-font-style,var(--spectrum-global-font-style-regular)\n);font-weight:var(\n--spectrum-body-s-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);letter-spacing:var(\n--spectrum-body-s-text-letter-spacing,var(--spectrum-global-font-letter-spacing-none)\n);line-height:var(\n--spectrum-body-s-text-line-height,var(--spectrum-alias-body-text-line-height)\n);margin-bottom:0;margin-top:0;text-transform:var(--spectrum-body-s-text-transform,none)}:host([dragged]) ::slotted(*){--spectrum-global-color-gray-500:var(\n--spectrum-dropzone-illustration-color\n)}\n`;\nexport default styles;"],
5
+ "mappings": "AAWA;AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6Cf,eAAe;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./Dropzone.dev.js";
2
+ //# sourceMappingURL=index.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.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*/\nexport * from './Dropzone.dev.js'\n"],
5
+ "mappings": "AAWA;",
6
+ "names": []
7
+ }