@spectrum-web-components/dropzone 1.12.2 → 1.12.3-next.20260827072617

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.
@@ -60,6 +60,7 @@
60
60
  "privacy": "public",
61
61
  "default": "false",
62
62
  "description": "Indicates that files are currently being dragged over the dropzone.",
63
+ "deprecated": "The `isDragged` property will be replaced by `dragged` in a future release. The `dragged` attribute is unchanged.",
63
64
  "attribute": "dragged",
64
65
  "reflects": true
65
66
  },
@@ -72,6 +73,7 @@
72
73
  "privacy": "public",
73
74
  "default": "false",
74
75
  "description": "Set this property to indicate that the component is in a filled state.",
76
+ "deprecated": "The `isFilled` property will be replaced by `filled` in a future release. The `filled` attribute is unchanged.",
75
77
  "attribute": "filled"
76
78
  },
77
79
  {
@@ -99,7 +101,8 @@
99
101
  "text": "DragEvent"
100
102
  }
101
103
  }
102
- ]
104
+ ],
105
+ "deprecated": "This method will become non-public in a future release. Overriding it is deprecated."
103
106
  },
104
107
  {
105
108
  "kind": "method",
@@ -117,7 +120,8 @@
117
120
  "text": "DragEvent"
118
121
  }
119
122
  }
120
- ]
123
+ ],
124
+ "deprecated": "This method will become non-public in a future release. Overriding it is deprecated."
121
125
  },
122
126
  {
123
127
  "kind": "method",
@@ -135,7 +139,8 @@
135
139
  "text": "DragEvent"
136
140
  }
137
141
  }
138
- ]
142
+ ],
143
+ "deprecated": "This method will become non-public in a future release. Overriding it is deprecated."
139
144
  },
140
145
  {
141
146
  "kind": "method",
@@ -191,6 +196,7 @@
191
196
  },
192
197
  "default": "false",
193
198
  "description": "Indicates that files are currently being dragged over the dropzone.",
199
+ "deprecated": "The `isDragged` property will be replaced by `dragged` in a future release. The `dragged` attribute is unchanged.",
194
200
  "fieldName": "isDragged"
195
201
  },
196
202
  {
@@ -200,6 +206,7 @@
200
206
  },
201
207
  "default": "false",
202
208
  "description": "Set this property to indicate that the component is in a filled state.",
209
+ "deprecated": "The `isFilled` property will be replaced by `filled` in a future release. The `filled` attribute is unchanged.",
203
210
  "fieldName": "isFilled"
204
211
  }
205
212
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/dropzone",
3
- "version": "1.12.2",
3
+ "version": "1.12.3-next.20260827072617",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Adobe",
@@ -54,7 +54,7 @@
54
54
  ],
55
55
  "types": "./src/index.d.ts",
56
56
  "dependencies": {
57
- "@spectrum-web-components/base": "1.12.2"
57
+ "@spectrum-web-components/base": "1.12.3-next.20260827072617"
58
58
  },
59
59
  "keywords": [
60
60
  "design-system",
package/src/Dropzone.d.ts CHANGED
@@ -10,6 +10,9 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
  import { CSSResultArray, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
13
+ /**
14
+ * @deprecated Not exported from `@spectrum-web-components/dropzone` in a future release. Use `DragEvent` directly.
15
+ */
13
16
  export type DropzoneEventDetail = DragEvent;
14
17
  export type DropEffects = 'copy' | 'move' | 'link' | 'none';
15
18
  /**
@@ -39,17 +42,30 @@ export declare class Dropzone extends SpectrumElement {
39
42
  private _dropEffect;
40
43
  /**
41
44
  * Indicates that files are currently being dragged over the dropzone.
45
+ *
46
+ * @deprecated The `isDragged` property will be replaced by `dragged` in a future release. The `dragged` attribute is unchanged.
42
47
  */
43
48
  isDragged: boolean;
44
49
  /**
45
50
  * Set this property to indicate that the component is in a filled state.
51
+ *
52
+ * @deprecated The `isFilled` property will be replaced by `filled` in a future release. The `filled` attribute is unchanged.
46
53
  */
47
54
  isFilled: boolean;
48
55
  private debouncedDragLeave;
49
56
  connectedCallback(): void;
50
57
  disconnectedCallback(): void;
58
+ /**
59
+ * @deprecated This method will become non-public in a future release. Overriding it is deprecated.
60
+ */
51
61
  onDragOver(event: DragEvent): void;
62
+ /**
63
+ * @deprecated This method will become non-public in a future release. Overriding it is deprecated.
64
+ */
52
65
  onDragLeave(event: DragEvent): void;
66
+ /**
67
+ * @deprecated This method will become non-public in a future release. Overriding it is deprecated.
68
+ */
53
69
  onDrop(event: DragEvent): void;
54
70
  protected render(): TemplateResult;
55
71
  protected clearDebouncedDragLeave(): void;
@@ -15,12 +15,21 @@ import {
15
15
  } from "@spectrum-web-components/base";
16
16
  import { property } from "@spectrum-web-components/base/src/decorators.js";
17
17
  import dropzoneStyles from "./dropzone.css.js";
18
- export class Dropzone extends SpectrumElement {
18
+ const _Dropzone = class _Dropzone extends SpectrumElement {
19
19
  constructor() {
20
20
  super(...arguments);
21
21
  this._dropEffect = "copy";
22
22
  this.isDragged = false;
23
23
  this.isFilled = false;
24
+ // No runtime warn for `isDragged`/`isFilled` above: both attributes (`dragged`/`filled`)
25
+ // are unchanged and still valid per B2/B3, and Lit's attribute-to-property sync
26
+ // routes through the same reactive property a consumer's own JS assignment would.
27
+ // `isDragged` is also set internally on every drag-over/drag-leave. A `changes.has()`
28
+ // guard in `updated()` can't distinguish any of those from a consumer explicitly
29
+ // writing `element.isDragged = ...`/`element.isFilled = ...`, so a warning there
30
+ // would fire for ordinary, unmigrated attribute/template-binding usage that the
31
+ // migration plan explicitly promises is unaffected. The `@deprecated` JSDoc above
32
+ // still documents the rename for IDE/type tooling.
24
33
  this.debouncedDragLeave = null;
25
34
  }
26
35
  static get styles() {
@@ -45,6 +54,14 @@ export class Dropzone extends SpectrumElement {
45
54
  this.addEventListener("drop", this.onDrop);
46
55
  this.addEventListener("dragover", this.onDragOver);
47
56
  this.addEventListener("dragleave", this.onDragLeave);
57
+ if (this.onDragOver !== _Dropzone.prototype.onDragOver || this.onDragLeave !== _Dropzone.prototype.onDragLeave || this.onDrop !== _Dropzone.prototype.onDrop) {
58
+ window.__swc.warn(
59
+ this,
60
+ `<${this.localName}> "onDragOver", "onDragLeave", and "onDrop" are deprecated as public, overridable methods and will become non-public in a future release.`,
61
+ "https://opensource.adobe.com/spectrum-web-components/components/dropzone/",
62
+ { level: "deprecation" }
63
+ );
64
+ }
48
65
  }
49
66
  disconnectedCallback() {
50
67
  super.disconnectedCallback();
@@ -53,6 +70,9 @@ export class Dropzone extends SpectrumElement {
53
70
  this.removeEventListener("dragleave", this.onDragLeave);
54
71
  this.clearDebouncedDragLeave();
55
72
  }
73
+ /**
74
+ * @deprecated This method will become non-public in a future release. Overriding it is deprecated.
75
+ */
56
76
  onDragOver(event) {
57
77
  event.preventDefault();
58
78
  const shouldAcceptEvent = new CustomEvent(
@@ -75,6 +95,14 @@ export class Dropzone extends SpectrumElement {
75
95
  this.clearDebouncedDragLeave();
76
96
  if (!this.isDragged) {
77
97
  this.isDragged = true;
98
+ if (true) {
99
+ window.__swc.warn(
100
+ this,
101
+ `<${this.localName}> events will be renamed with a "swc-dropzone-" prefix in a future release (for example, "sp-dropzone-should-accept" becomes "swc-dropzone-should-accept").`,
102
+ "https://opensource.adobe.com/spectrum-web-components/components/dropzone/",
103
+ { level: "deprecation" }
104
+ );
105
+ }
78
106
  }
79
107
  event.dataTransfer.dropEffect = this.dropEffect;
80
108
  this.dispatchEvent(
@@ -85,6 +113,9 @@ export class Dropzone extends SpectrumElement {
85
113
  })
86
114
  );
87
115
  }
116
+ /**
117
+ * @deprecated This method will become non-public in a future release. Overriding it is deprecated.
118
+ */
88
119
  onDragLeave(event) {
89
120
  if (event.relatedTarget && this.contains(event.relatedTarget)) {
90
121
  return;
@@ -101,6 +132,9 @@ export class Dropzone extends SpectrumElement {
101
132
  );
102
133
  }, 100);
103
134
  }
135
+ /**
136
+ * @deprecated This method will become non-public in a future release. Overriding it is deprecated.
137
+ */
104
138
  onDrop(event) {
105
139
  event.preventDefault();
106
140
  if (!this.isDragged) {
@@ -127,11 +161,12 @@ export class Dropzone extends SpectrumElement {
127
161
  this.debouncedDragLeave = null;
128
162
  }
129
163
  }
130
- }
164
+ };
131
165
  __decorateClass([
132
166
  property({ type: Boolean, reflect: true, attribute: "dragged" })
133
- ], Dropzone.prototype, "isDragged", 2);
167
+ ], _Dropzone.prototype, "isDragged", 2);
134
168
  __decorateClass([
135
169
  property({ type: Boolean, attribute: "filled" })
136
- ], Dropzone.prototype, "isFilled", 2);
170
+ ], _Dropzone.prototype, "isFilled", 2);
171
+ export let Dropzone = _Dropzone;
137
172
  //# sourceMappingURL=Dropzone.dev.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["Dropzone.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing 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 *\n * @attr\n * @type {'copy' | 'move' | 'link' | 'none'}\n */\n public get dropEffect(): DropEffects {\n return this._dropEffect;\n }\n\n public set dropEffect(value: DropEffects) {\n if (['copy', 'move', 'link', 'none'].includes(value)) {\n this._dropEffect = value;\n }\n }\n\n private _dropEffect: DropEffects = 'copy';\n\n /**\n * Indicates that files are currently being dragged over the dropzone.\n */\n @property({ type: Boolean, reflect: true, attribute: 'dragged' })\n public isDragged = false;\n\n /**\n * Set this property to indicate that the component is in a filled state.\n */\n @property({ type: Boolean, attribute: 'filled' })\n public isFilled = 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 this.clearDebouncedDragLeave();\n }\n\n public onDragOver(event: DragEvent): void {\n /**\n * Required for Chrome/Windows to consistently allow dropping.\n * Without preventDefault(), Chrome may suppress the drop event.\n */\n event.preventDefault();\n\n const shouldAcceptEvent = new CustomEvent<DragEvent>(\n 'sp-dropzone-should-accept',\n {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: event,\n }\n );\n\n const shouldAccept = this.dispatchEvent(shouldAcceptEvent);\n\n if (!event.dataTransfer) {\n return;\n }\n\n if (!shouldAccept) {\n event.dataTransfer.dropEffect = 'none';\n return;\n }\n\n this.clearDebouncedDragLeave();\n\n if (!this.isDragged) {\n this.isDragged = true;\n }\n\n event.dataTransfer.dropEffect = this.dropEffect;\n\n this.dispatchEvent(\n new CustomEvent<DragEvent>('sp-dropzone-dragover', {\n bubbles: true,\n composed: true,\n detail: event,\n })\n );\n }\n\n public onDragLeave(event: DragEvent): void {\n /**\n * Ignore internal dragleave events triggered while moving\n * between children inside the dropzone.\n */\n if (event.relatedTarget && this.contains(event.relatedTarget as Node)) {\n return;\n }\n\n this.clearDebouncedDragLeave();\n\n this.debouncedDragLeave = window.setTimeout(() => {\n this.isDragged = false;\n\n this.dispatchEvent(\n new CustomEvent<DragEvent>('sp-dropzone-dragleave', {\n bubbles: true,\n composed: true,\n detail: event,\n })\n );\n }, 100);\n }\n\n public onDrop(event: DragEvent): void {\n /**\n * Prevent browser default behavior (opening files in browser).\n */\n event.preventDefault();\n\n if (!this.isDragged) {\n return;\n }\n\n this.clearDebouncedDragLeave();\n\n this.isDragged = false;\n\n this.dispatchEvent(\n new CustomEvent<DragEvent>('sp-dropzone-drop', {\n bubbles: true,\n composed: true,\n detail: event,\n })\n );\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n\n protected clearDebouncedDragLeave(): void {\n if (this.debouncedDragLeave !== null) {\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,EAEE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,gBAAgB;AAEzB,OAAO,oBAAoB;AAoBpB,aAAM,iBAAiB,gBAAgB;AAAA,EAAvC;AAAA;AAqBL,SAAQ,cAA2B;AAMnC,SAAO,YAAY;AAMnB,SAAO,WAAW;AAElB,SAAQ,qBAAoC;AAAA;AAAA,EAlC5C,WAA2B,SAAyB;AAClD,WAAO,CAAC,cAAc;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAW,aAA0B;AACnC,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAW,WAAW,OAAoB;AACxC,QAAI,CAAC,QAAQ,QAAQ,QAAQ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AAI,YAAuB,yBAAyB;AAAA,UAClD,SAAS;AAAA,UACT,UAAU;AAAA,UACV,QAAQ;AAAA,QACV,CAAC;AAAA,MACH;AAAA,IACF,GAAG,GAAG;AAAA,EACR;AAAA,EAEO,OAAO,OAAwB;AAIpC,UAAM,eAAe;AAErB,QAAI,CAAC,KAAK,WAAW;AACnB;AAAA,IACF;AAEA,SAAK,wBAAwB;AAE7B,SAAK,YAAY;AAEjB,SAAK;AAAA,MACH,IAAI,YAAuB,oBAAoB;AAAA,QAC7C,SAAS;AAAA,QACT,UAAU;AAAA,QACV,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEmB,SAAyB;AAC1C,WAAO;AAAA;AAAA;AAAA,EAGT;AAAA,EAEU,0BAAgC;AACxC,QAAI,KAAK,uBAAuB,MAAM;AACpC,mBAAa,KAAK,kBAAkB;AACpC,WAAK,qBAAqB;AAAA,IAC5B;AAAA,EACF;AACF;AApIS;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,UAAU,CAAC;AAAA,GA1BrD,SA2BJ;AAMA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,WAAW,SAAS,CAAC;AAAA,GAhCrC,SAiCJ;",
4
+ "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing 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\n/**\n * @deprecated Not exported from `@spectrum-web-components/dropzone` in a future release. Use `DragEvent` directly.\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 *\n * @attr\n * @type {'copy' | 'move' | 'link' | 'none'}\n */\n public get dropEffect(): DropEffects {\n return this._dropEffect;\n }\n\n public set dropEffect(value: DropEffects) {\n if (['copy', 'move', 'link', 'none'].includes(value)) {\n this._dropEffect = value;\n }\n }\n\n private _dropEffect: DropEffects = 'copy';\n\n /**\n * Indicates that files are currently being dragged over the dropzone.\n *\n * @deprecated The `isDragged` property will be replaced by `dragged` in a future release. The `dragged` attribute is unchanged.\n */\n @property({ type: Boolean, reflect: true, attribute: 'dragged' })\n public isDragged = false;\n\n /**\n * Set this property to indicate that the component is in a filled state.\n *\n * @deprecated The `isFilled` property will be replaced by `filled` in a future release. The `filled` attribute is unchanged.\n */\n @property({ type: Boolean, attribute: 'filled' })\n public isFilled = false;\n\n // No runtime warn for `isDragged`/`isFilled` above: both attributes (`dragged`/`filled`)\n // are unchanged and still valid per B2/B3, and Lit's attribute-to-property sync\n // routes through the same reactive property a consumer's own JS assignment would.\n // `isDragged` is also set internally on every drag-over/drag-leave. A `changes.has()`\n // guard in `updated()` can't distinguish any of those from a consumer explicitly\n // writing `element.isDragged = ...`/`element.isFilled = ...`, so a warning there\n // would fire for ordinary, unmigrated attribute/template-binding usage that the\n // migration plan explicitly promises is unaffected. The `@deprecated` JSDoc above\n // still documents the rename for IDE/type tooling.\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 if (\n window.__swc?.DEBUG &&\n (this.onDragOver !== Dropzone.prototype.onDragOver ||\n this.onDragLeave !== Dropzone.prototype.onDragLeave ||\n this.onDrop !== Dropzone.prototype.onDrop)\n ) {\n window.__swc.warn(\n this,\n `<${this.localName}> \"onDragOver\", \"onDragLeave\", and \"onDrop\" are deprecated as public, overridable methods and will become non-public in a future release.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/dropzone/',\n { level: 'deprecation' }\n );\n }\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 this.clearDebouncedDragLeave();\n }\n\n /**\n * @deprecated This method will become non-public in a future release. Overriding it is deprecated.\n */\n public onDragOver(event: DragEvent): void {\n /**\n * Required for Chrome/Windows to consistently allow dropping.\n * Without preventDefault(), Chrome may suppress the drop event.\n */\n event.preventDefault();\n\n const shouldAcceptEvent = new CustomEvent<DragEvent>(\n 'sp-dropzone-should-accept',\n {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: event,\n }\n );\n\n const shouldAccept = this.dispatchEvent(shouldAcceptEvent);\n\n if (!event.dataTransfer) {\n return;\n }\n\n if (!shouldAccept) {\n event.dataTransfer.dropEffect = 'none';\n return;\n }\n\n this.clearDebouncedDragLeave();\n\n if (!this.isDragged) {\n this.isDragged = true;\n\n if (window.__swc?.DEBUG) {\n window.__swc.warn(\n this,\n `<${this.localName}> events will be renamed with a \"swc-dropzone-\" prefix in a future release (for example, \"sp-dropzone-should-accept\" becomes \"swc-dropzone-should-accept\").`,\n 'https://opensource.adobe.com/spectrum-web-components/components/dropzone/',\n { level: 'deprecation' }\n );\n }\n }\n\n event.dataTransfer.dropEffect = this.dropEffect;\n\n this.dispatchEvent(\n new CustomEvent<DragEvent>('sp-dropzone-dragover', {\n bubbles: true,\n composed: true,\n detail: event,\n })\n );\n }\n\n /**\n * @deprecated This method will become non-public in a future release. Overriding it is deprecated.\n */\n public onDragLeave(event: DragEvent): void {\n /**\n * Ignore internal dragleave events triggered while moving\n * between children inside the dropzone.\n */\n if (event.relatedTarget && this.contains(event.relatedTarget as Node)) {\n return;\n }\n\n this.clearDebouncedDragLeave();\n\n this.debouncedDragLeave = window.setTimeout(() => {\n this.isDragged = false;\n\n this.dispatchEvent(\n new CustomEvent<DragEvent>('sp-dropzone-dragleave', {\n bubbles: true,\n composed: true,\n detail: event,\n })\n );\n }, 100);\n }\n\n /**\n * @deprecated This method will become non-public in a future release. Overriding it is deprecated.\n */\n public onDrop(event: DragEvent): void {\n /**\n * Prevent browser default behavior (opening files in browser).\n */\n event.preventDefault();\n\n if (!this.isDragged) {\n return;\n }\n\n this.clearDebouncedDragLeave();\n\n this.isDragged = false;\n\n this.dispatchEvent(\n new CustomEvent<DragEvent>('sp-dropzone-drop', {\n bubbles: true,\n composed: true,\n detail: event,\n })\n );\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n\n protected clearDebouncedDragLeave(): void {\n if (this.debouncedDragLeave !== null) {\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": ";;;;;;;;;;;AAY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oBAAoB;AAAA,QAC7C,SAAS;AAAA,QACT,UAAU;AAAA,QACV,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEmB,SAAyB;AAC1C,WAAO;AAAA;AAAA;AAAA,EAGT;AAAA,EAEU,0BAAgC;AACxC,QAAI,KAAK,uBAAuB,MAAM;AACpC,mBAAa,KAAK,kBAAkB;AACpC,WAAK,qBAAqB;AAAA,IAC5B;AAAA,EACF;AACF;AAhLS;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,UAAU,CAAC;AAAA,GA5BrD,UA6BJ;AAQA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,WAAW,SAAS,CAAC;AAAA,GApCrC,UAqCJ;AArCF,WAAM,WAAN;",
6
6
  "names": []
7
7
  }
package/src/Dropzone.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var l=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var d=(a,o,e,r)=>{for(var t=r>1?void 0:r?p(o,e):o,s=a.length-1,n;s>=0;s--)(n=a[s])&&(t=(r?n(o,e,t):n(t))||t);return r&&t&&l(o,e,t),t};import{html as c,SpectrumElement as u}from"@spectrum-web-components/base";import{property as i}from"@spectrum-web-components/base/src/decorators.js";import v from"./dropzone.css.js";export class Dropzone extends u{constructor(){super(...arguments);this._dropEffect="copy";this.isDragged=!1;this.isFilled=!1;this.debouncedDragLeave=null}static get styles(){return[v]}get dropEffect(){return this._dropEffect}set dropEffect(e){["copy","move","link","none"].includes(e)&&(this._dropEffect=e)}connectedCallback(){super.connectedCallback(),this.addEventListener("drop",this.onDrop),this.addEventListener("dragover",this.onDragOver),this.addEventListener("dragleave",this.onDragLeave)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("drop",this.onDrop),this.removeEventListener("dragover",this.onDragOver),this.removeEventListener("dragleave",this.onDragLeave),this.clearDebouncedDragLeave()}onDragOver(e){e.preventDefault();const r=new CustomEvent("sp-dropzone-should-accept",{bubbles:!0,cancelable:!0,composed:!0,detail:e}),t=this.dispatchEvent(r);if(e.dataTransfer){if(!t){e.dataTransfer.dropEffect="none";return}this.clearDebouncedDragLeave(),this.isDragged||(this.isDragged=!0),e.dataTransfer.dropEffect=this.dropEffect,this.dispatchEvent(new CustomEvent("sp-dropzone-dragover",{bubbles:!0,composed:!0,detail:e}))}}onDragLeave(e){e.relatedTarget&&this.contains(e.relatedTarget)||(this.clearDebouncedDragLeave(),this.debouncedDragLeave=window.setTimeout(()=>{this.isDragged=!1,this.dispatchEvent(new CustomEvent("sp-dropzone-dragleave",{bubbles:!0,composed:!0,detail:e}))},100))}onDrop(e){e.preventDefault(),this.isDragged&&(this.clearDebouncedDragLeave(),this.isDragged=!1,this.dispatchEvent(new CustomEvent("sp-dropzone-drop",{bubbles:!0,composed:!0,detail:e})))}render(){return c`
1
+ "use strict";var p=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=(a,o,e,r)=>{for(var t=r>1?void 0:r?c(o,e):o,n=a.length-1,s;n>=0;n--)(s=a[n])&&(t=(r?s(o,e,t):s(t))||t);return r&&t&&p(o,e,t),t};import{html as l,SpectrumElement as u}from"@spectrum-web-components/base";import{property as i}from"@spectrum-web-components/base/src/decorators.js";import v from"./dropzone.css.js";export class Dropzone extends u{constructor(){super(...arguments);this._dropEffect="copy";this.isDragged=!1;this.isFilled=!1;this.debouncedDragLeave=null}static get styles(){return[v]}get dropEffect(){return this._dropEffect}set dropEffect(e){["copy","move","link","none"].includes(e)&&(this._dropEffect=e)}connectedCallback(){super.connectedCallback(),this.addEventListener("drop",this.onDrop),this.addEventListener("dragover",this.onDragOver),this.addEventListener("dragleave",this.onDragLeave)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("drop",this.onDrop),this.removeEventListener("dragover",this.onDragOver),this.removeEventListener("dragleave",this.onDragLeave),this.clearDebouncedDragLeave()}onDragOver(e){e.preventDefault();const r=new CustomEvent("sp-dropzone-should-accept",{bubbles:!0,cancelable:!0,composed:!0,detail:e}),t=this.dispatchEvent(r);if(e.dataTransfer){if(!t){e.dataTransfer.dropEffect="none";return}this.clearDebouncedDragLeave(),this.isDragged||(this.isDragged=!0),e.dataTransfer.dropEffect=this.dropEffect,this.dispatchEvent(new CustomEvent("sp-dropzone-dragover",{bubbles:!0,composed:!0,detail:e}))}}onDragLeave(e){e.relatedTarget&&this.contains(e.relatedTarget)||(this.clearDebouncedDragLeave(),this.debouncedDragLeave=window.setTimeout(()=>{this.isDragged=!1,this.dispatchEvent(new CustomEvent("sp-dropzone-dragleave",{bubbles:!0,composed:!0,detail:e}))},100))}onDrop(e){e.preventDefault(),this.isDragged&&(this.clearDebouncedDragLeave(),this.isDragged=!1,this.dispatchEvent(new CustomEvent("sp-dropzone-drop",{bubbles:!0,composed:!0,detail:e})))}render(){return l`
2
2
  <slot></slot>
3
3
  `}clearDebouncedDragLeave(){this.debouncedDragLeave!==null&&(clearTimeout(this.debouncedDragLeave),this.debouncedDragLeave=null)}}d([i({type:Boolean,reflect:!0,attribute:"dragged"})],Dropzone.prototype,"isDragged",2),d([i({type:Boolean,attribute:"filled"})],Dropzone.prototype,"isFilled",2);
4
4
  //# sourceMappingURL=Dropzone.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["Dropzone.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing 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 *\n * @attr\n * @type {'copy' | 'move' | 'link' | 'none'}\n */\n public get dropEffect(): DropEffects {\n return this._dropEffect;\n }\n\n public set dropEffect(value: DropEffects) {\n if (['copy', 'move', 'link', 'none'].includes(value)) {\n this._dropEffect = value;\n }\n }\n\n private _dropEffect: DropEffects = 'copy';\n\n /**\n * Indicates that files are currently being dragged over the dropzone.\n */\n @property({ type: Boolean, reflect: true, attribute: 'dragged' })\n public isDragged = false;\n\n /**\n * Set this property to indicate that the component is in a filled state.\n */\n @property({ type: Boolean, attribute: 'filled' })\n public isFilled = 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 this.clearDebouncedDragLeave();\n }\n\n public onDragOver(event: DragEvent): void {\n /**\n * Required for Chrome/Windows to consistently allow dropping.\n * Without preventDefault(), Chrome may suppress the drop event.\n */\n event.preventDefault();\n\n const shouldAcceptEvent = new CustomEvent<DragEvent>(\n 'sp-dropzone-should-accept',\n {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: event,\n }\n );\n\n const shouldAccept = this.dispatchEvent(shouldAcceptEvent);\n\n if (!event.dataTransfer) {\n return;\n }\n\n if (!shouldAccept) {\n event.dataTransfer.dropEffect = 'none';\n return;\n }\n\n this.clearDebouncedDragLeave();\n\n if (!this.isDragged) {\n this.isDragged = true;\n }\n\n event.dataTransfer.dropEffect = this.dropEffect;\n\n this.dispatchEvent(\n new CustomEvent<DragEvent>('sp-dropzone-dragover', {\n bubbles: true,\n composed: true,\n detail: event,\n })\n );\n }\n\n public onDragLeave(event: DragEvent): void {\n /**\n * Ignore internal dragleave events triggered while moving\n * between children inside the dropzone.\n */\n if (event.relatedTarget && this.contains(event.relatedTarget as Node)) {\n return;\n }\n\n this.clearDebouncedDragLeave();\n\n this.debouncedDragLeave = window.setTimeout(() => {\n this.isDragged = false;\n\n this.dispatchEvent(\n new CustomEvent<DragEvent>('sp-dropzone-dragleave', {\n bubbles: true,\n composed: true,\n detail: event,\n })\n );\n }, 100);\n }\n\n public onDrop(event: DragEvent): void {\n /**\n * Prevent browser default behavior (opening files in browser).\n */\n event.preventDefault();\n\n if (!this.isDragged) {\n return;\n }\n\n this.clearDebouncedDragLeave();\n\n this.isDragged = false;\n\n this.dispatchEvent(\n new CustomEvent<DragEvent>('sp-dropzone-drop', {\n bubbles: true,\n composed: true,\n detail: event,\n })\n );\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n\n protected clearDebouncedDragLeave(): void {\n if (this.debouncedDragLeave !== null) {\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': Cust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B,uBAAwB,CACjD,QAAS,GACT,SAAU,GACV,OAAQA,CACV,CAAC,CACH,EACF,CAEO,YAAYA,EAAwB,CAKrCA,EAAM,eAAiB,KAAK,SAASA,EAAM,aAAqB,IAIpE,KAAK,wBAAwB,EAE7B,KAAK,mBAAqB,OAAO,WAAW,IAAM,CAChD,KAAK,UAAY,GAEjB,KAAK,cACH,IAAI,YAAuB,wBAAyB,CAClD,QAAS,GACT,SAAU,GACV,OAAQA,CACV,CAAC,CACH,CACF,EAAG,GAAG,EACR,CAEO,OAAOA,EAAwB,CAIpCA,EAAM,eAAe,EAEhB,KAAK,YAIV,KAAK,wBAAwB,EAE7B,KAAK,UAAY,GAEjB,KAAK,cACH,IAAI,YAAuB,mBAAoB,CAC7C,QAAS,GACT,SAAU,GACV,OAAQA,CACV,CAAC,CACH,EACF,CAEmB,QAAyB,CAC1C,OAAOL;AAAA;AAAA,KAGT,CAEU,yBAAgC,CACpC,KAAK,qBAAuB,OAC9B,aAAa,KAAK,kBAAkB,EACpC,KAAK,mBAAqB,KAE9B,CACF,CApISQ,EAAA,CADNN,EAAS,CAAE,KAAM,QAAS,QAAS,GAAM,UAAW,SAAU,CAAC,GA1BrD,SA2BJ,yBAMAM,EAAA,CADNN,EAAS,CAAE,KAAM,QAAS,UAAW,QAAS,CAAC,GAhCrC,SAiCJ",
4
+ "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing 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\n/**\n * @deprecated Not exported from `@spectrum-web-components/dropzone` in a future release. Use `DragEvent` directly.\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 *\n * @attr\n * @type {'copy' | 'move' | 'link' | 'none'}\n */\n public get dropEffect(): DropEffects {\n return this._dropEffect;\n }\n\n public set dropEffect(value: DropEffects) {\n if (['copy', 'move', 'link', 'none'].includes(value)) {\n this._dropEffect = value;\n }\n }\n\n private _dropEffect: DropEffects = 'copy';\n\n /**\n * Indicates that files are currently being dragged over the dropzone.\n *\n * @deprecated The `isDragged` property will be replaced by `dragged` in a future release. The `dragged` attribute is unchanged.\n */\n @property({ type: Boolean, reflect: true, attribute: 'dragged' })\n public isDragged = false;\n\n /**\n * Set this property to indicate that the component is in a filled state.\n *\n * @deprecated The `isFilled` property will be replaced by `filled` in a future release. The `filled` attribute is unchanged.\n */\n @property({ type: Boolean, attribute: 'filled' })\n public isFilled = false;\n\n // No runtime warn for `isDragged`/`isFilled` above: both attributes (`dragged`/`filled`)\n // are unchanged and still valid per B2/B3, and Lit's attribute-to-property sync\n // routes through the same reactive property a consumer's own JS assignment would.\n // `isDragged` is also set internally on every drag-over/drag-leave. A `changes.has()`\n // guard in `updated()` can't distinguish any of those from a consumer explicitly\n // writing `element.isDragged = ...`/`element.isFilled = ...`, so a warning there\n // would fire for ordinary, unmigrated attribute/template-binding usage that the\n // migration plan explicitly promises is unaffected. The `@deprecated` JSDoc above\n // still documents the rename for IDE/type tooling.\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 if (\n window.__swc?.DEBUG &&\n (this.onDragOver !== Dropzone.prototype.onDragOver ||\n this.onDragLeave !== Dropzone.prototype.onDragLeave ||\n this.onDrop !== Dropzone.prototype.onDrop)\n ) {\n window.__swc.warn(\n this,\n `<${this.localName}> \"onDragOver\", \"onDragLeave\", and \"onDrop\" are deprecated as public, overridable methods and will become non-public in a future release.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/dropzone/',\n { level: 'deprecation' }\n );\n }\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 this.clearDebouncedDragLeave();\n }\n\n /**\n * @deprecated This method will become non-public in a future release. Overriding it is deprecated.\n */\n public onDragOver(event: DragEvent): void {\n /**\n * Required for Chrome/Windows to consistently allow dropping.\n * Without preventDefault(), Chrome may suppress the drop event.\n */\n event.preventDefault();\n\n const shouldAcceptEvent = new CustomEvent<DragEvent>(\n 'sp-dropzone-should-accept',\n {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: event,\n }\n );\n\n const shouldAccept = this.dispatchEvent(shouldAcceptEvent);\n\n if (!event.dataTransfer) {\n return;\n }\n\n if (!shouldAccept) {\n event.dataTransfer.dropEffect = 'none';\n return;\n }\n\n this.clearDebouncedDragLeave();\n\n if (!this.isDragged) {\n this.isDragged = true;\n\n if (window.__swc?.DEBUG) {\n window.__swc.warn(\n this,\n `<${this.localName}> events will be renamed with a \"swc-dropzone-\" prefix in a future release (for example, \"sp-dropzone-should-accept\" becomes \"swc-dropzone-should-accept\").`,\n 'https://opensource.adobe.com/spectrum-web-components/components/dropzone/',\n { level: 'deprecation' }\n );\n }\n }\n\n event.dataTransfer.dropEffect = this.dropEffect;\n\n this.dispatchEvent(\n new CustomEvent<DragEvent>('sp-dropzone-dragover', {\n bubbles: true,\n composed: true,\n detail: event,\n })\n );\n }\n\n /**\n * @deprecated This method will become non-public in a future release. Overriding it is deprecated.\n */\n public onDragLeave(event: DragEvent): void {\n /**\n * Ignore internal dragleave events triggered while moving\n * between children inside the dropzone.\n */\n if (event.relatedTarget && this.contains(event.relatedTarget as Node)) {\n return;\n }\n\n this.clearDebouncedDragLeave();\n\n this.debouncedDragLeave = window.setTimeout(() => {\n this.isDragged = false;\n\n this.dispatchEvent(\n new CustomEvent<DragEvent>('sp-dropzone-dragleave', {\n bubbles: true,\n composed: true,\n detail: event,\n })\n );\n }, 100);\n }\n\n /**\n * @deprecated This method will become non-public in a future release. Overriding it is deprecated.\n */\n public onDrop(event: DragEvent): void {\n /**\n * Prevent browser default behavior (opening files in browser).\n */\n event.preventDefault();\n\n if (!this.isDragged) {\n return;\n }\n\n this.clearDebouncedDragLeave();\n\n this.isDragged = false;\n\n this.dispatchEvent(\n new CustomEvent<DragEvent>('sp-dropzone-drop', {\n bubbles: true,\n composed: true,\n detail: event,\n })\n );\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n\n protected clearDebouncedDragLeave(): void {\n if (this.debouncedDragLeave !== null) {\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': C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KO,YAAYA,EAAwB,CAKrCA,EAAM,eAAiB,KAAK,SAASA,EAAM,aAAqB,IAIpE,KAAK,wBAAwB,EAE7B,KAAK,mBAAqB,OAAO,WAAW,IAAM,CAChD,KAAK,UAAY,GAEjB,KAAK,cACH,IAAI,YAAuB,wBAAyB,CAClD,QAAS,GACT,SAAU,GACV,OAAQA,CACV,CAAC,CACH,CACF,EAAG,GAAG,EACR,CAKO,OAAOA,EAAwB,CAIpCA,EAAM,eAAe,EAEhB,KAAK,YAIV,KAAK,wBAAwB,EAE7B,KAAK,UAAY,GAEjB,KAAK,cACH,IAAI,YAAuB,mBAAoB,CAC7C,QAAS,GACT,SAAU,GACV,OAAQA,CACV,CAAC,CACH,EACF,CAEmB,QAAyB,CAC1C,OAAOL;AAAA;AAAA,KAGT,CAEU,yBAAgC,CACpC,KAAK,qBAAuB,OAC9B,aAAa,KAAK,kBAAkB,EACpC,KAAK,mBAAqB,KAE9B,CACF,CAhLSQ,EAAA,CADNN,EAAS,CAAE,KAAM,QAAS,QAAS,GAAM,UAAW,SAAU,CAAC,GA5BrD,SA6BJ,yBAQAM,EAAA,CADNN,EAAS,CAAE,KAAM,QAAS,UAAW,QAAS,CAAC,GApCrC,SAqCJ",
6
6
  "names": ["html", "SpectrumElement", "property", "dropzoneStyles", "value", "event", "shouldAcceptEvent", "shouldAccept", "__decorateClass"]
7
7
  }