@spectrum-web-components/overlay 1.6.0-beta.0 → 1.6.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/README.md CHANGED
@@ -186,7 +186,7 @@ The `type` of an Overlay outlines a number of things about the interaction model
186
186
 
187
187
  ### Modal
188
188
 
189
- `'modal'` Overlays are opened with the `showModal()` method on a `<dialog>` element, which causes the Overlay to accept focus and trap the tab stop within the content of said Overlay.
189
+ `'modal'` Overlays create a modal context that traps focus within the content and prevents interaction with the rest of the page. The overlay manages focus trapping and accessibility features like `aria-modal="true"` to ensure proper screen reader behavior.
190
190
 
191
191
  They should be used when you need to ensure that the user has interacted with the content of the Overlay before continuing with their work. This is commonly used for dialogs that require a user to confirm or cancel an action before continuing.
192
192
 
@@ -215,7 +215,7 @@ They should be used when you need to ensure that the user has interacted with th
215
215
 
216
216
  ### Page
217
217
 
218
- `'page'` Overlays will act in a similar manner to a `'modal'` Overlay, however they will not be allowed to close via the "light dismiss" algorithm (e.g. the Escape key).
218
+ `'page'` Overlays behave similarly to `'modal'` Overlays by creating a modal context and trapping focus, but they will not be allowed to close via the "light dismiss" algorithm (e.g. the Escape key).
219
219
 
220
220
  A page overlay could be used for a full-screen menu on a mobile website. When the user clicks on the menu button, the entire screen is covered with the menu options.
221
221
 
@@ -311,6 +311,40 @@ The `overlay` value in this case will hold a reference to the actual `<sp-overla
311
311
 
312
312
  This means that in both cases, if the transition is meant to be a part of the opening or closing of the overlay in question you will need to redispatch the `transitionrun`, `transitionend`, and `transitioncancel` events from that transition from the closest direct child of the `<sp-overlay>`.
313
313
 
314
+ ## Nested Overlays
315
+
316
+ When nesting multiple overlays, it is important to ensure that the nested overlays are actually nested in the HTML as well, otherwise it will not be accessible.
317
+
318
+ ```html
319
+ <div style="padding: 20px;">
320
+ <sp-button id="outerTrigger" variant="primary">Open Outer Modal</sp-button>
321
+ <sp-overlay id="outerOverlay" type="auto" trigger="outerTrigger@click">
322
+ <sp-popover>
323
+ <sp-dialog>
324
+ <p>This is the outer modal content. Press ESC to close it.</p>
325
+ <sp-button id="innerTrigger" variant="primary">
326
+ Open Inner Modal
327
+ </sp-button>
328
+ <sp-overlay
329
+ id="innerOverlay"
330
+ type="auto"
331
+ trigger="innerTrigger@click"
332
+ >
333
+ <sp-popover>
334
+ <sp-dialog>
335
+ <p>
336
+ This is the inner modal content. Press ESC to
337
+ close this first, then the outer modal.
338
+ </p>
339
+ </sp-dialog>
340
+ </sp-popover>
341
+ </sp-overlay>
342
+ </sp-dialog>
343
+ </sp-popover>
344
+ </sp-overlay>
345
+ </div>
346
+ ```
347
+
314
348
  ## Styling
315
349
 
316
350
  `<sp-overlay>` element will use the `<dialog>` element or `popover` attribute to project your content onto the top-layer of the browser, without being moved in the DOM tree. That means that you can style your overlay content with whatever techniques you are already leveraging to style the content that doesn't get overlaid. This means standard CSS selectors, CSS Custom Properties, and CSS Parts applied in your parent context will always apply to your overlaid content.
@@ -255,16 +255,6 @@
255
255
  }
256
256
  ]
257
257
  },
258
- {
259
- "kind": "method",
260
- "name": "manageDialogOpen",
261
- "privacy": "protected",
262
- "return": {
263
- "type": {
264
- "text": "Promise<void>"
265
- }
266
- }
267
- },
268
258
  {
269
259
  "kind": "method",
270
260
  "name": "managePopoverOpen",
@@ -1054,16 +1044,6 @@
1054
1044
  "module": "src/InteractionController.js"
1055
1045
  }
1056
1046
  },
1057
- {
1058
- "kind": "method",
1059
- "name": "removeSafariFocusRingClass",
1060
- "privacy": "private",
1061
- "return": {
1062
- "type": {
1063
- "text": "void"
1064
- }
1065
- }
1066
- },
1067
1047
  {
1068
1048
  "kind": "field",
1069
1049
  "name": "abortController",
@@ -1255,14 +1235,6 @@
1255
1235
  "kind": "variable",
1256
1236
  "name": "lastInteractionType"
1257
1237
  },
1258
- {
1259
- "kind": "variable",
1260
- "name": "SAFARI_FOCUS_RING_CLASS",
1261
- "type": {
1262
- "text": "string"
1263
- },
1264
- "default": "'remove-focus-ring-safari-hack'"
1265
- },
1266
1238
  {
1267
1239
  "kind": "class",
1268
1240
  "description": "",
@@ -1435,14 +1407,6 @@
1435
1407
  "module": "src/InteractionController.js"
1436
1408
  }
1437
1409
  },
1438
- {
1439
- "kind": "js",
1440
- "name": "SAFARI_FOCUS_RING_CLASS",
1441
- "declaration": {
1442
- "name": "SAFARI_FOCUS_RING_CLASS",
1443
- "module": "src/InteractionController.js"
1444
- }
1445
- },
1446
1410
  {
1447
1411
  "kind": "js",
1448
1412
  "name": "InteractionController",
@@ -2066,30 +2030,25 @@
2066
2030
  },
2067
2031
  {
2068
2032
  "kind": "field",
2069
- "name": "elementResolver",
2033
+ "name": "_focusTrap",
2070
2034
  "type": {
2071
- "text": "ElementResolutionController"
2072
- },
2073
- "privacy": "protected",
2074
- "description": "Provides an instance of the `ElementResolutionController` for managing the element\nthat the overlay should be associated with. If the instance does not already exist,\nit is created and assigned to the `_elementResolver` property.",
2075
- "return": {
2076
- "type": {
2077
- "text": "ElementResolutionController"
2078
- }
2035
+ "text": "FocusTrap | null"
2079
2036
  },
2080
- "readonly": true
2037
+ "privacy": "private",
2038
+ "default": "null",
2039
+ "description": "Focus trap to keep focus within the dialog"
2081
2040
  },
2082
2041
  {
2083
2042
  "kind": "field",
2084
- "name": "usesDialog",
2043
+ "name": "elementResolver",
2085
2044
  "type": {
2086
- "text": "boolean"
2045
+ "text": "ElementResolutionController"
2087
2046
  },
2088
- "privacy": "private",
2089
- "description": "Determines if the overlay uses a dialog.\nReturns `true` if the overlay type is \"modal\" or \"page\".",
2047
+ "privacy": "protected",
2048
+ "description": "Provides an instance of the `ElementResolutionController` for managing the element\nthat the overlay should be associated with. If the instance does not already exist,\nit is created and assigned to the `_elementResolver` property.",
2090
2049
  "return": {
2091
2050
  "type": {
2092
- "text": "boolean"
2051
+ "text": "ElementResolutionController"
2093
2052
  }
2094
2053
  },
2095
2054
  "readonly": true
@@ -2199,6 +2158,11 @@
2199
2158
  }
2200
2159
  ]
2201
2160
  },
2161
+ {
2162
+ "kind": "field",
2163
+ "name": "closeOnCancelEvent",
2164
+ "privacy": "private"
2165
+ },
2202
2166
  {
2203
2167
  "kind": "method",
2204
2168
  "name": "manageOpen",
@@ -2340,17 +2304,6 @@
2340
2304
  },
2341
2305
  "readonly": true
2342
2306
  },
2343
- {
2344
- "kind": "method",
2345
- "name": "renderDialog",
2346
- "privacy": "protected",
2347
- "return": {
2348
- "type": {
2349
- "text": "TemplateResult"
2350
- }
2351
- },
2352
- "description": "Renders the dialog element for the overlay.\n\nThis method returns a template result containing a dialog element. The dialog element\nincludes various attributes and event listeners to manage the overlay's state and behavior."
2353
- },
2354
2307
  {
2355
2308
  "kind": "method",
2356
2309
  "name": "renderPopover",
@@ -2484,102 +2437,6 @@
2484
2437
  }
2485
2438
  ]
2486
2439
  },
2487
- {
2488
- "kind": "javascript-module",
2489
- "path": "src/OverlayDialog.js",
2490
- "declarations": [
2491
- {
2492
- "kind": "mixin",
2493
- "description": "",
2494
- "name": "OverlayDialog",
2495
- "members": [
2496
- {
2497
- "kind": "method",
2498
- "name": "manageDialogOpen",
2499
- "privacy": "protected",
2500
- "return": {
2501
- "type": {
2502
- "text": "Promise<void>"
2503
- }
2504
- }
2505
- },
2506
- {
2507
- "kind": "method",
2508
- "name": "dialogMakeTransition",
2509
- "privacy": "protected",
2510
- "return": {
2511
- "type": {
2512
- "text": "Promise<HTMLElement | null>"
2513
- }
2514
- },
2515
- "parameters": [
2516
- {
2517
- "name": "targetOpenState",
2518
- "type": {
2519
- "text": "boolean"
2520
- }
2521
- }
2522
- ]
2523
- },
2524
- {
2525
- "kind": "method",
2526
- "name": "dialogApplyFocus",
2527
- "privacy": "protected",
2528
- "return": {
2529
- "type": {
2530
- "text": "Promise<void>"
2531
- }
2532
- },
2533
- "parameters": [
2534
- {
2535
- "name": "targetOpenState",
2536
- "type": {
2537
- "text": "boolean"
2538
- }
2539
- },
2540
- {
2541
- "name": "focusEl",
2542
- "type": {
2543
- "text": "HTMLElement | null"
2544
- }
2545
- }
2546
- ]
2547
- }
2548
- ],
2549
- "events": [
2550
- {
2551
- "type": {
2552
- "text": "event"
2553
- }
2554
- },
2555
- {
2556
- "name": "eventName",
2557
- "type": {
2558
- "text": "OverlayStateEvent"
2559
- }
2560
- }
2561
- ],
2562
- "parameters": [
2563
- {
2564
- "name": "constructor",
2565
- "type": {
2566
- "text": "T"
2567
- }
2568
- }
2569
- ]
2570
- }
2571
- ],
2572
- "exports": [
2573
- {
2574
- "kind": "js",
2575
- "name": "OverlayDialog",
2576
- "declaration": {
2577
- "name": "OverlayDialog",
2578
- "module": "src/OverlayDialog.js"
2579
- }
2580
- }
2581
- ]
2582
- },
2583
2440
  {
2584
2441
  "kind": "javascript-module",
2585
2442
  "path": "src/OverlayNoPopover.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/overlay",
3
- "version": "1.6.0-beta.0",
3
+ "version": "1.6.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -166,11 +166,12 @@
166
166
  "dependencies": {
167
167
  "@floating-ui/dom": "^1.6.1",
168
168
  "@floating-ui/utils": "^0.2.1",
169
- "@spectrum-web-components/action-button": "1.6.0-beta.0",
170
- "@spectrum-web-components/base": "1.6.0-beta.0",
171
- "@spectrum-web-components/reactive-controllers": "1.6.0-beta.0",
172
- "@spectrum-web-components/shared": "1.6.0-beta.0",
173
- "@spectrum-web-components/theme": "1.6.0-beta.0"
169
+ "@spectrum-web-components/action-button": "1.6.0",
170
+ "@spectrum-web-components/base": "1.6.0",
171
+ "@spectrum-web-components/reactive-controllers": "1.6.0",
172
+ "@spectrum-web-components/shared": "1.6.0",
173
+ "@spectrum-web-components/theme": "1.6.0",
174
+ "focus-trap": "^7.6.4"
174
175
  },
175
176
  "types": "./src/index.d.ts",
176
177
  "customElements": "custom-elements.json",
@@ -39,7 +39,6 @@ export declare class AbstractOverlay extends SpectrumElement {
39
39
  elements: OpenableElement[];
40
40
  protected makeTransition(_targetOpenState: boolean): Promise<HTMLElement | null>;
41
41
  protected manageDelay(_targetOpenState: boolean): Promise<void>;
42
- protected manageDialogOpen(): Promise<void>;
43
42
  protected managePopoverOpen(): Promise<void>;
44
43
  protected managePosition(): void;
45
44
  protected offset: number | [number, number];
@@ -108,10 +108,6 @@ export class AbstractOverlay extends SpectrumElement {
108
108
  return;
109
109
  }
110
110
  /* c8 ignore next 3 */
111
- async manageDialogOpen() {
112
- return;
113
- }
114
- /* c8 ignore next 3 */
115
111
  async managePopoverOpen() {
116
112
  return;
117
113
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["AbstractOverlay.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 { SpectrumElement } from '@spectrum-web-components/base';\nimport { reparentChildren } from '@spectrum-web-components/shared/src/reparent-children.js';\n\nimport type {\n OpenableElement,\n OverlayOptions,\n OverlayOptionsV1,\n OverlayState,\n OverlayTypes,\n Placement,\n TriggerInteractionsV1,\n} from './overlay-types.dev.js'\nimport type { Overlay } from './Overlay.dev.js'\nimport type { VirtualTrigger } from './VirtualTrigger.dev.js'\nimport { OverlayTimer } from './overlay-timer.dev.js'\nimport type { PlacementController } from './PlacementController.dev.js'\nimport type { ElementResolutionController } from '@spectrum-web-components/reactive-controllers/src/ElementResolution.js';\n\nexport const overlayTimer = new OverlayTimer();\n\nexport const noop = (): void => {\n return;\n};\n\n/**\n * Apply a \"transitionend\" listener to an element that may not transition but\n * guarantee the callback will be fired either way.\n *\n * @param el {HTMLElement} - Target of the \"transition\" listeners.\n * @param action {Function} - Method to trigger the \"transition\".\n * @param cb {Function} - Callback to trigger when the \"transition\" has ended.\n */\nexport const guaranteedAllTransitionend = (\n el: HTMLElement,\n action: () => void,\n cb: () => void\n): void => {\n const abortController = new AbortController();\n const runningTransitions = new Map<string, number>();\n const cleanup = (): void => {\n abortController.abort();\n cb();\n };\n let guarantee2: number;\n let guarantee3: number;\n // WebKit fires `transitionrun` a little earlier, the multiple guarantees here\n // allow WebKit to be caught, but doesn't remove the animation listener until\n // after it would have fired in Chromium.\n const guarantee1 = requestAnimationFrame(() => {\n guarantee2 = requestAnimationFrame(() => {\n guarantee3 = requestAnimationFrame(() => {\n cleanup();\n });\n });\n });\n const handleTransitionend = (event: TransitionEvent): void => {\n if (event.target !== el) {\n return;\n }\n runningTransitions.set(\n event.propertyName,\n (runningTransitions.get(event.propertyName) as number) - 1\n );\n if (!runningTransitions.get(event.propertyName)) {\n runningTransitions.delete(event.propertyName);\n }\n if (runningTransitions.size === 0) {\n cleanup();\n }\n };\n const handleTransitionrun = (event: TransitionEvent): void => {\n if (event.target !== el) {\n return;\n }\n if (!runningTransitions.has(event.propertyName)) {\n runningTransitions.set(event.propertyName, 0);\n }\n runningTransitions.set(\n event.propertyName,\n (runningTransitions.get(event.propertyName) as number) + 1\n );\n cancelAnimationFrame(guarantee1);\n cancelAnimationFrame(guarantee2);\n cancelAnimationFrame(guarantee3);\n };\n el.addEventListener('transitionrun', handleTransitionrun, {\n signal: abortController.signal,\n });\n el.addEventListener('transitionend', handleTransitionend, {\n signal: abortController.signal,\n });\n el.addEventListener('transitioncancel', handleTransitionend, {\n signal: abortController.signal,\n });\n action();\n};\n\nexport function nextFrame(): Promise<void> {\n return new Promise((res) => requestAnimationFrame(() => res()));\n}\n\n/**\n * Abstract Overlay base class so that property tyings and imperative API\n * interfaces can be held separate from the actual class definition.\n */\nexport class AbstractOverlay extends SpectrumElement {\n protected async applyFocus(\n _targetOpenState: boolean,\n _focusEl: HTMLElement | null\n ): Promise<void> {\n return;\n }\n /* c8 ignore next 6 */\n get delayed(): boolean {\n return false;\n }\n set delayed(_delayed: boolean) {\n return;\n }\n dialogEl!: HTMLDialogElement & {\n showPopover(): void;\n hidePopover(): void;\n };\n /* c8 ignore next 6 */\n get disabled(): boolean {\n return false;\n }\n set disabled(_disabled: boolean) {\n return;\n }\n dispose = noop;\n protected get elementResolver(): ElementResolutionController {\n return this._elementResolver;\n }\n protected set elementResolver(controller) {\n this._elementResolver = controller;\n }\n protected _elementResolver!: ElementResolutionController;\n /* c8 ignore next 3 */\n protected async ensureOnDOM(_targetOpenState: boolean): Promise<void> {\n return;\n }\n elements!: OpenableElement[];\n /* c8 ignore next 5 */\n protected async makeTransition(\n _targetOpenState: boolean\n ): Promise<HTMLElement | null> {\n return null;\n }\n protected async manageDelay(_targetOpenState: boolean): Promise<void> {\n return;\n }\n /* c8 ignore next 3 */\n protected async manageDialogOpen(): Promise<void> {\n return;\n }\n /* c8 ignore next 3 */\n protected async managePopoverOpen(): Promise<void> {\n return;\n }\n /* c8 ignore next 3 */\n protected managePosition(): void {\n return;\n }\n protected offset: number | [number, number] = 0;\n /* c8 ignore next 6 */\n get open(): boolean {\n return false;\n }\n set open(_open: boolean) {\n return;\n }\n placement?: Placement;\n protected get placementController(): PlacementController {\n return this._placementController;\n }\n protected set placementController(controller) {\n this._placementController = controller;\n }\n protected _placementController!: PlacementController;\n receivesFocus!: 'true' | 'false' | 'auto';\n protected requestSlottable(): void {}\n protected returnFocus(): void {\n return;\n }\n /* c8 ignore next 6 */\n get state(): OverlayState {\n return 'closed';\n }\n set state(_state: OverlayState) {\n return;\n }\n protected _state!: OverlayState;\n triggerElement!: HTMLElement | VirtualTrigger | null;\n type!: OverlayTypes;\n willPreventClose = false;\n /* c8 ignore next 3 */\n public manuallyKeepOpen(): void {\n return;\n }\n\n public static update(): void {\n const overlayUpdateEvent = new CustomEvent('sp-update-overlays', {\n bubbles: true,\n composed: true,\n cancelable: true,\n });\n document.dispatchEvent(overlayUpdateEvent);\n }\n\n /**\n * Overloaded imperative API entry point that allows for both the pre-0.37.0\n * argument signature as well as the post-0.37.0 signature. This allows for\n * consumers to continue to leverage it as they had been in previous releases\n * while also surfacing the more feature-rich API that has been made available.\n */\n public static async open(\n trigger: HTMLElement,\n interaction: TriggerInteractionsV1,\n content: HTMLElement,\n optionsV1: OverlayOptionsV1\n ): Promise<() => void>;\n public static async open(\n content: HTMLElement,\n options?: OverlayOptions\n ): Promise<Overlay>;\n public static async open(\n triggerOrContent: HTMLElement,\n interactionOrOptions:\n | TriggerInteractionsV1\n | OverlayOptions\n | undefined,\n content?: HTMLElement,\n optionsV1?: OverlayOptionsV1\n ): Promise<Overlay | (() => void)> {\n await import('@spectrum-web-components/overlay/sp-overlay.js');\n const v2 = arguments.length === 2;\n const overlayContent = content || triggerOrContent;\n // Use the `this` from the `static` method context rather than a\n // specific imported constructor to prevent opening a circular dependency.\n const overlay = new this() as Overlay;\n let restored = false;\n overlay.dispose = () => {\n overlay.addEventListener('sp-closed', () => {\n if (!restored) {\n restoreContent();\n restored = true;\n }\n requestAnimationFrame(() => {\n overlay.remove();\n });\n });\n overlay.open = false;\n overlay.dispose = noop;\n };\n /**\n * Since content must exist in an <sp-overlay>, we need a way to get it there.\n * The best & most-direct way is to declaratively use an <sp-overlay> element,\n * but for imperative users, we'll reparent content into an overlay that we've created for them.\n **/\n const restoreContent = reparentChildren([overlayContent], overlay, {\n position: 'beforeend',\n prepareCallback: (el) => {\n // Ensure that content to be overlaid is no longer targetted to a specific `slot`.\n // This allow for it to be visible in the overlaid context.\n const slot = el.slot;\n el.removeAttribute('slot');\n return () => {\n el.slot = slot;\n };\n },\n });\n\n const v1 = !v2 && overlayContent && optionsV1;\n if (v1) {\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n overlay,\n `You are interacting with an ${overlay.localName} element via a deprecated imperative API. This API will be removed in a future version of the SWC library. Consider leveraging an ${overlay.localName} directly.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/overlay/',\n { level: 'deprecation' }\n );\n }\n const trigger = triggerOrContent;\n const interaction = interactionOrOptions;\n const options = optionsV1;\n AbstractOverlay.applyOptions(overlay, {\n ...options,\n delayed:\n options.delayed || overlayContent.hasAttribute('delayed'),\n trigger: options.virtualTrigger || trigger,\n type:\n interaction === 'modal'\n ? 'modal'\n : interaction === 'hover'\n ? 'hint'\n : 'auto',\n });\n trigger.insertAdjacentElement('afterend', overlay);\n await overlay.updateComplete;\n overlay.open = true;\n return overlay.dispose;\n }\n\n const options = interactionOrOptions as OverlayOptions;\n overlay.append(overlayContent);\n AbstractOverlay.applyOptions(overlay, {\n ...options,\n delayed: options.delayed || overlayContent.hasAttribute('delayed'),\n });\n overlay.updateComplete.then(() => {\n // Do we want to \"open\" this path, or leave that to the consumer?\n overlay.open = true;\n });\n return overlay;\n }\n\n static applyOptions(\n overlay: AbstractOverlay,\n options: OverlayOptions\n ): void {\n overlay.delayed = !!options.delayed;\n overlay.receivesFocus = options.receivesFocus ?? 'auto';\n overlay.triggerElement = options.trigger || null;\n overlay.type = options.type || 'modal';\n overlay.offset = options.offset ?? 0;\n overlay.placement = options.placement;\n overlay.willPreventClose = !!options.notImmediatelyClosable;\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n }\n}\n"],
5
- "mappings": ";AAWA,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AAajC,SAAS,oBAAoB;AAItB,aAAM,eAAe,IAAI,aAAa;AAEtC,aAAM,OAAO,MAAY;AAC5B;AACJ;AAUO,aAAM,6BAA6B,CACtC,IACA,QACA,OACO;AACP,QAAM,kBAAkB,IAAI,gBAAgB;AAC5C,QAAM,qBAAqB,oBAAI,IAAoB;AACnD,QAAM,UAAU,MAAY;AACxB,oBAAgB,MAAM;AACtB,OAAG;AAAA,EACP;AACA,MAAI;AACJ,MAAI;AAIJ,QAAM,aAAa,sBAAsB,MAAM;AAC3C,iBAAa,sBAAsB,MAAM;AACrC,mBAAa,sBAAsB,MAAM;AACrC,gB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O;AACjD,YAAM,QAAQ;AACd,cAAQ,OAAO;AACf,aAAO,QAAQ;AAAA,IACnB;AAEA,UAAM,UAAU;AAChB,YAAQ,OAAO,cAAc;AAC7B,oBAAgB,aAAa,SAAS;AAAA,MAClC,GAAG;AAAA,MACH,SAAS,QAAQ,WAAW,eAAe,aAAa,SAAS;AAAA,IACrE,CAAC;AACD,YAAQ,eAAe,KAAK,MAAM;AAE9B,cAAQ,OAAO;AAAA,IACnB,CAAC;AACD,WAAO;AAAA,EACX;AAAA,EAEA,OAAO,aACH,SACA,SACI;AA3UZ;AA4UQ,YAAQ,UAAU,CAAC,CAAC,QAAQ;AAC5B,YAAQ,iBAAgB,aAAQ,kBAAR,YAAyB;AACjD,YAAQ,iBAAiB,QAAQ,WAAW;AAC5C,YAAQ,OAAO,QAAQ,QAAQ;AAC/B,YAAQ,UAAS,aAAQ,WAAR,YAAkB;AACnC,YAAQ,YAAY,QAAQ;AAC5B,YAAQ,mBAAmB,CAAC,CAAC,QAAQ;AAAA,EACzC;AAAA,EAES,uBAA6B;AAClC,UAAM,qBAAqB;AAAA,EAC/B;AACJ;",
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 { SpectrumElement } from '@spectrum-web-components/base';\nimport { reparentChildren } from '@spectrum-web-components/shared/src/reparent-children.js';\n\nimport type {\n OpenableElement,\n OverlayOptions,\n OverlayOptionsV1,\n OverlayState,\n OverlayTypes,\n Placement,\n TriggerInteractionsV1,\n} from './overlay-types.dev.js'\nimport type { Overlay } from './Overlay.dev.js'\nimport type { VirtualTrigger } from './VirtualTrigger.dev.js'\nimport { OverlayTimer } from './overlay-timer.dev.js'\nimport type { PlacementController } from './PlacementController.dev.js'\nimport type { ElementResolutionController } from '@spectrum-web-components/reactive-controllers/src/ElementResolution.js';\n\nexport const overlayTimer = new OverlayTimer();\n\nexport const noop = (): void => {\n return;\n};\n\n/**\n * Apply a \"transitionend\" listener to an element that may not transition but\n * guarantee the callback will be fired either way.\n *\n * @param el {HTMLElement} - Target of the \"transition\" listeners.\n * @param action {Function} - Method to trigger the \"transition\".\n * @param cb {Function} - Callback to trigger when the \"transition\" has ended.\n */\nexport const guaranteedAllTransitionend = (\n el: HTMLElement,\n action: () => void,\n cb: () => void\n): void => {\n const abortController = new AbortController();\n const runningTransitions = new Map<string, number>();\n const cleanup = (): void => {\n abortController.abort();\n cb();\n };\n let guarantee2: number;\n let guarantee3: number;\n // WebKit fires `transitionrun` a little earlier, the multiple guarantees here\n // allow WebKit to be caught, but doesn't remove the animation listener until\n // after it would have fired in Chromium.\n const guarantee1 = requestAnimationFrame(() => {\n guarantee2 = requestAnimationFrame(() => {\n guarantee3 = requestAnimationFrame(() => {\n cleanup();\n });\n });\n });\n const handleTransitionend = (event: TransitionEvent): void => {\n if (event.target !== el) {\n return;\n }\n runningTransitions.set(\n event.propertyName,\n (runningTransitions.get(event.propertyName) as number) - 1\n );\n if (!runningTransitions.get(event.propertyName)) {\n runningTransitions.delete(event.propertyName);\n }\n if (runningTransitions.size === 0) {\n cleanup();\n }\n };\n const handleTransitionrun = (event: TransitionEvent): void => {\n if (event.target !== el) {\n return;\n }\n if (!runningTransitions.has(event.propertyName)) {\n runningTransitions.set(event.propertyName, 0);\n }\n runningTransitions.set(\n event.propertyName,\n (runningTransitions.get(event.propertyName) as number) + 1\n );\n cancelAnimationFrame(guarantee1);\n cancelAnimationFrame(guarantee2);\n cancelAnimationFrame(guarantee3);\n };\n el.addEventListener('transitionrun', handleTransitionrun, {\n signal: abortController.signal,\n });\n el.addEventListener('transitionend', handleTransitionend, {\n signal: abortController.signal,\n });\n el.addEventListener('transitioncancel', handleTransitionend, {\n signal: abortController.signal,\n });\n action();\n};\n\nexport function nextFrame(): Promise<void> {\n return new Promise((res) => requestAnimationFrame(() => res()));\n}\n\n/**\n * Abstract Overlay base class so that property tyings and imperative API\n * interfaces can be held separate from the actual class definition.\n */\nexport class AbstractOverlay extends SpectrumElement {\n protected async applyFocus(\n _targetOpenState: boolean,\n _focusEl: HTMLElement | null\n ): Promise<void> {\n return;\n }\n /* c8 ignore next 6 */\n get delayed(): boolean {\n return false;\n }\n set delayed(_delayed: boolean) {\n return;\n }\n dialogEl!: HTMLDialogElement & {\n showPopover(): void;\n hidePopover(): void;\n };\n /* c8 ignore next 6 */\n get disabled(): boolean {\n return false;\n }\n set disabled(_disabled: boolean) {\n return;\n }\n dispose = noop;\n protected get elementResolver(): ElementResolutionController {\n return this._elementResolver;\n }\n protected set elementResolver(controller) {\n this._elementResolver = controller;\n }\n protected _elementResolver!: ElementResolutionController;\n /* c8 ignore next 3 */\n protected async ensureOnDOM(_targetOpenState: boolean): Promise<void> {\n return;\n }\n elements!: OpenableElement[];\n /* c8 ignore next 5 */\n protected async makeTransition(\n _targetOpenState: boolean\n ): Promise<HTMLElement | null> {\n return null;\n }\n protected async manageDelay(_targetOpenState: boolean): Promise<void> {\n return;\n }\n /* c8 ignore next 3 */\n protected async managePopoverOpen(): Promise<void> {\n return;\n }\n /* c8 ignore next 3 */\n protected managePosition(): void {\n return;\n }\n protected offset: number | [number, number] = 0;\n /* c8 ignore next 6 */\n get open(): boolean {\n return false;\n }\n set open(_open: boolean) {\n return;\n }\n placement?: Placement;\n protected get placementController(): PlacementController {\n return this._placementController;\n }\n protected set placementController(controller) {\n this._placementController = controller;\n }\n protected _placementController!: PlacementController;\n receivesFocus!: 'true' | 'false' | 'auto';\n protected requestSlottable(): void {}\n protected returnFocus(): void {\n return;\n }\n /* c8 ignore next 6 */\n get state(): OverlayState {\n return 'closed';\n }\n set state(_state: OverlayState) {\n return;\n }\n protected _state!: OverlayState;\n triggerElement!: HTMLElement | VirtualTrigger | null;\n type!: OverlayTypes;\n willPreventClose = false;\n /* c8 ignore next 3 */\n public manuallyKeepOpen(): void {\n return;\n }\n\n public static update(): void {\n const overlayUpdateEvent = new CustomEvent('sp-update-overlays', {\n bubbles: true,\n composed: true,\n cancelable: true,\n });\n document.dispatchEvent(overlayUpdateEvent);\n }\n\n /**\n * Overloaded imperative API entry point that allows for both the pre-0.37.0\n * argument signature as well as the post-0.37.0 signature. This allows for\n * consumers to continue to leverage it as they had been in previous releases\n * while also surfacing the more feature-rich API that has been made available.\n */\n public static async open(\n trigger: HTMLElement,\n interaction: TriggerInteractionsV1,\n content: HTMLElement,\n optionsV1: OverlayOptionsV1\n ): Promise<() => void>;\n public static async open(\n content: HTMLElement,\n options?: OverlayOptions\n ): Promise<Overlay>;\n public static async open(\n triggerOrContent: HTMLElement,\n interactionOrOptions:\n | TriggerInteractionsV1\n | OverlayOptions\n | undefined,\n content?: HTMLElement,\n optionsV1?: OverlayOptionsV1\n ): Promise<Overlay | (() => void)> {\n await import('@spectrum-web-components/overlay/sp-overlay.js');\n const v2 = arguments.length === 2;\n const overlayContent = content || triggerOrContent;\n // Use the `this` from the `static` method context rather than a\n // specific imported constructor to prevent opening a circular dependency.\n const overlay = new this() as Overlay;\n let restored = false;\n overlay.dispose = () => {\n overlay.addEventListener('sp-closed', () => {\n if (!restored) {\n restoreContent();\n restored = true;\n }\n requestAnimationFrame(() => {\n overlay.remove();\n });\n });\n overlay.open = false;\n overlay.dispose = noop;\n };\n /**\n * Since content must exist in an <sp-overlay>, we need a way to get it there.\n * The best & most-direct way is to declaratively use an <sp-overlay> element,\n * but for imperative users, we'll reparent content into an overlay that we've created for them.\n **/\n const restoreContent = reparentChildren([overlayContent], overlay, {\n position: 'beforeend',\n prepareCallback: (el) => {\n // Ensure that content to be overlaid is no longer targetted to a specific `slot`.\n // This allow for it to be visible in the overlaid context.\n const slot = el.slot;\n el.removeAttribute('slot');\n return () => {\n el.slot = slot;\n };\n },\n });\n\n const v1 = !v2 && overlayContent && optionsV1;\n if (v1) {\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n overlay,\n `You are interacting with an ${overlay.localName} element via a deprecated imperative API. This API will be removed in a future version of the SWC library. Consider leveraging an ${overlay.localName} directly.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/overlay/',\n { level: 'deprecation' }\n );\n }\n const trigger = triggerOrContent;\n const interaction = interactionOrOptions;\n const options = optionsV1;\n AbstractOverlay.applyOptions(overlay, {\n ...options,\n delayed:\n options.delayed || overlayContent.hasAttribute('delayed'),\n trigger: options.virtualTrigger || trigger,\n type:\n interaction === 'modal'\n ? 'modal'\n : interaction === 'hover'\n ? 'hint'\n : 'auto',\n });\n trigger.insertAdjacentElement('afterend', overlay);\n await overlay.updateComplete;\n overlay.open = true;\n return overlay.dispose;\n }\n\n const options = interactionOrOptions as OverlayOptions;\n overlay.append(overlayContent);\n AbstractOverlay.applyOptions(overlay, {\n ...options,\n delayed: options.delayed || overlayContent.hasAttribute('delayed'),\n });\n overlay.updateComplete.then(() => {\n // Do we want to \"open\" this path, or leave that to the consumer?\n overlay.open = true;\n });\n return overlay;\n }\n\n static applyOptions(\n overlay: AbstractOverlay,\n options: OverlayOptions\n ): void {\n overlay.delayed = !!options.delayed;\n overlay.receivesFocus = options.receivesFocus ?? 'auto';\n overlay.triggerElement = options.trigger || null;\n overlay.type = options.type || 'modal';\n overlay.offset = options.offset ?? 0;\n overlay.placement = options.placement;\n overlay.willPreventClose = !!options.notImmediatelyClosable;\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n }\n}\n"],
5
+ "mappings": ";AAWA,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AAajC,SAAS,oBAAoB;AAItB,aAAM,eAAe,IAAI,aAAa;AAEtC,aAAM,OAAO,MAAY;AAC5B;AACJ;AAUO,aAAM,6BAA6B,CACtC,IACA,QACA,OACO;AACP,QAAM,kBAAkB,IAAI,gBAAgB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ACIA,SAAQ,WAAW,eAAe,aAAa,SAAS;AAAA,QAC5D,SAASA,SAAQ,kBAAkB;AAAA,QACnC,MACI,gBAAgB,UACV,UACA,gBAAgB,UACd,SACA;AAAA,MAChB,CAAC;AACD,cAAQ,sBAAsB,YAAY,OAAO;AACjD,YAAM,QAAQ;AACd,cAAQ,OAAO;AACf,aAAO,QAAQ;AAAA,IACnB;AAEA,UAAM,UAAU;AAChB,YAAQ,OAAO,cAAc;AAC7B,oBAAgB,aAAa,SAAS;AAAA,MAClC,GAAG;AAAA,MACH,SAAS,QAAQ,WAAW,eAAe,aAAa,SAAS;AAAA,IACrE,CAAC;AACD,YAAQ,eAAe,KAAK,MAAM;AAE9B,cAAQ,OAAO;AAAA,IACnB,CAAC;AACD,WAAO;AAAA,EACX;AAAA,EAEA,OAAO,aACH,SACA,SACI;AAvUZ;AAwUQ,YAAQ,UAAU,CAAC,CAAC,QAAQ;AAC5B,YAAQ,iBAAgB,aAAQ,kBAAR,YAAyB;AACjD,YAAQ,iBAAiB,QAAQ,WAAW;AAC5C,YAAQ,OAAO,QAAQ,QAAQ;AAC/B,YAAQ,UAAS,aAAQ,WAAR,YAAkB;AACnC,YAAQ,YAAY,QAAQ;AAC5B,YAAQ,mBAAmB,CAAC,CAAC,QAAQ;AAAA,EACzC;AAAA,EAES,uBAA6B;AAClC,UAAM,qBAAqB;AAAA,EAC/B;AACJ;",
6
6
  "names": ["options"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";import{SpectrumElement as g}from"@spectrum-web-components/base";import{reparentChildren as b}from"@spectrum-web-components/shared/src/reparent-children.js";import{OverlayTimer as O}from"./overlay-timer.js";export const overlayTimer=new O,noop=()=>{},guaranteedAllTransitionend=(i,v,e)=>{const r=new AbortController,n=new Map,a=()=>{r.abort(),e()};let m,l;const t=requestAnimationFrame(()=>{m=requestAnimationFrame(()=>{l=requestAnimationFrame(()=>{a()})})}),p=o=>{o.target===i&&(n.set(o.propertyName,n.get(o.propertyName)-1),n.get(o.propertyName)||n.delete(o.propertyName),n.size===0&&a())},d=o=>{o.target===i&&(n.has(o.propertyName)||n.set(o.propertyName,0),n.set(o.propertyName,n.get(o.propertyName)+1),cancelAnimationFrame(t),cancelAnimationFrame(m),cancelAnimationFrame(l))};i.addEventListener("transitionrun",d,{signal:r.signal}),i.addEventListener("transitionend",p,{signal:r.signal}),i.addEventListener("transitioncancel",p,{signal:r.signal}),v()};export function nextFrame(){return new Promise(i=>requestAnimationFrame(()=>i()))}export class AbstractOverlay extends g{constructor(){super(...arguments);this.dispose=noop;this.offset=0;this.willPreventClose=!1}async applyFocus(e,r){}get delayed(){return!1}set delayed(e){}get disabled(){return!1}set disabled(e){}get elementResolver(){return this._elementResolver}set elementResolver(e){this._elementResolver=e}async ensureOnDOM(e){}async makeTransition(e){return null}async manageDelay(e){}async manageDialogOpen(){}async managePopoverOpen(){}managePosition(){}get open(){return!1}set open(e){}get placementController(){return this._placementController}set placementController(e){this._placementController=e}requestSlottable(){}returnFocus(){}get state(){return"closed"}set state(e){}manuallyKeepOpen(){}static update(){const e=new CustomEvent("sp-update-overlays",{bubbles:!0,composed:!0,cancelable:!0});document.dispatchEvent(e)}static async open(e,r,n,a){await import("@spectrum-web-components/overlay/sp-overlay.js");const m=arguments.length===2,l=n||e,t=new this;let p=!1;t.dispose=()=>{t.addEventListener("sp-closed",()=>{p||(d(),p=!0),requestAnimationFrame(()=>{t.remove()})}),t.open=!1,t.dispose=noop};const d=b([l],t,{position:"beforeend",prepareCallback:s=>{const c=s.slot;return s.removeAttribute("slot"),()=>{s.slot=c}}});if(!m&&l&&a){const s=e,c=r,u=a;return AbstractOverlay.applyOptions(t,{...u,delayed:u.delayed||l.hasAttribute("delayed"),trigger:u.virtualTrigger||s,type:c==="modal"?"modal":c==="hover"?"hint":"auto"}),s.insertAdjacentElement("afterend",t),await t.updateComplete,t.open=!0,t.dispose}const y=r;return t.append(l),AbstractOverlay.applyOptions(t,{...y,delayed:y.delayed||l.hasAttribute("delayed")}),t.updateComplete.then(()=>{t.open=!0}),t}static applyOptions(e,r){var n,a;e.delayed=!!r.delayed,e.receivesFocus=(n=r.receivesFocus)!=null?n:"auto",e.triggerElement=r.trigger||null,e.type=r.type||"modal",e.offset=(a=r.offset)!=null?a:0,e.placement=r.placement,e.willPreventClose=!!r.notImmediatelyClosable}disconnectedCallback(){super.disconnectedCallback()}}
1
+ "use strict";import{SpectrumElement as g}from"@spectrum-web-components/base";import{reparentChildren as b}from"@spectrum-web-components/shared/src/reparent-children.js";import{OverlayTimer as O}from"./overlay-timer.js";export const overlayTimer=new O,noop=()=>{},guaranteedAllTransitionend=(i,v,e)=>{const r=new AbortController,n=new Map,a=()=>{r.abort(),e()};let m,l;const t=requestAnimationFrame(()=>{m=requestAnimationFrame(()=>{l=requestAnimationFrame(()=>{a()})})}),p=o=>{o.target===i&&(n.set(o.propertyName,n.get(o.propertyName)-1),n.get(o.propertyName)||n.delete(o.propertyName),n.size===0&&a())},d=o=>{o.target===i&&(n.has(o.propertyName)||n.set(o.propertyName,0),n.set(o.propertyName,n.get(o.propertyName)+1),cancelAnimationFrame(t),cancelAnimationFrame(m),cancelAnimationFrame(l))};i.addEventListener("transitionrun",d,{signal:r.signal}),i.addEventListener("transitionend",p,{signal:r.signal}),i.addEventListener("transitioncancel",p,{signal:r.signal}),v()};export function nextFrame(){return new Promise(i=>requestAnimationFrame(()=>i()))}export class AbstractOverlay extends g{constructor(){super(...arguments);this.dispose=noop;this.offset=0;this.willPreventClose=!1}async applyFocus(e,r){}get delayed(){return!1}set delayed(e){}get disabled(){return!1}set disabled(e){}get elementResolver(){return this._elementResolver}set elementResolver(e){this._elementResolver=e}async ensureOnDOM(e){}async makeTransition(e){return null}async manageDelay(e){}async managePopoverOpen(){}managePosition(){}get open(){return!1}set open(e){}get placementController(){return this._placementController}set placementController(e){this._placementController=e}requestSlottable(){}returnFocus(){}get state(){return"closed"}set state(e){}manuallyKeepOpen(){}static update(){const e=new CustomEvent("sp-update-overlays",{bubbles:!0,composed:!0,cancelable:!0});document.dispatchEvent(e)}static async open(e,r,n,a){await import("@spectrum-web-components/overlay/sp-overlay.js");const m=arguments.length===2,l=n||e,t=new this;let p=!1;t.dispose=()=>{t.addEventListener("sp-closed",()=>{p||(d(),p=!0),requestAnimationFrame(()=>{t.remove()})}),t.open=!1,t.dispose=noop};const d=b([l],t,{position:"beforeend",prepareCallback:s=>{const c=s.slot;return s.removeAttribute("slot"),()=>{s.slot=c}}});if(!m&&l&&a){const s=e,c=r,u=a;return AbstractOverlay.applyOptions(t,{...u,delayed:u.delayed||l.hasAttribute("delayed"),trigger:u.virtualTrigger||s,type:c==="modal"?"modal":c==="hover"?"hint":"auto"}),s.insertAdjacentElement("afterend",t),await t.updateComplete,t.open=!0,t.dispose}const y=r;return t.append(l),AbstractOverlay.applyOptions(t,{...y,delayed:y.delayed||l.hasAttribute("delayed")}),t.updateComplete.then(()=>{t.open=!0}),t}static applyOptions(e,r){var n,a;e.delayed=!!r.delayed,e.receivesFocus=(n=r.receivesFocus)!=null?n:"auto",e.triggerElement=r.trigger||null,e.type=r.type||"modal",e.offset=(a=r.offset)!=null?a:0,e.placement=r.placement,e.willPreventClose=!!r.notImmediatelyClosable}disconnectedCallback(){super.disconnectedCallback()}}
2
2
  //# sourceMappingURL=AbstractOverlay.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["AbstractOverlay.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 { SpectrumElement } from '@spectrum-web-components/base';\nimport { reparentChildren } from '@spectrum-web-components/shared/src/reparent-children.js';\n\nimport type {\n OpenableElement,\n OverlayOptions,\n OverlayOptionsV1,\n OverlayState,\n OverlayTypes,\n Placement,\n TriggerInteractionsV1,\n} from './overlay-types.js';\nimport type { Overlay } from './Overlay.js';\nimport type { VirtualTrigger } from './VirtualTrigger.js';\nimport { OverlayTimer } from './overlay-timer.js';\nimport type { PlacementController } from './PlacementController.js';\nimport type { ElementResolutionController } from '@spectrum-web-components/reactive-controllers/src/ElementResolution.js';\n\nexport const overlayTimer = new OverlayTimer();\n\nexport const noop = (): void => {\n return;\n};\n\n/**\n * Apply a \"transitionend\" listener to an element that may not transition but\n * guarantee the callback will be fired either way.\n *\n * @param el {HTMLElement} - Target of the \"transition\" listeners.\n * @param action {Function} - Method to trigger the \"transition\".\n * @param cb {Function} - Callback to trigger when the \"transition\" has ended.\n */\nexport const guaranteedAllTransitionend = (\n el: HTMLElement,\n action: () => void,\n cb: () => void\n): void => {\n const abortController = new AbortController();\n const runningTransitions = new Map<string, number>();\n const cleanup = (): void => {\n abortController.abort();\n cb();\n };\n let guarantee2: number;\n let guarantee3: number;\n // WebKit fires `transitionrun` a little earlier, the multiple guarantees here\n // allow WebKit to be caught, but doesn't remove the animation listener until\n // after it would have fired in Chromium.\n const guarantee1 = requestAnimationFrame(() => {\n guarantee2 = requestAnimationFrame(() => {\n guarantee3 = requestAnimationFrame(() => {\n cleanup();\n });\n });\n });\n const handleTransitionend = (event: TransitionEvent): void => {\n if (event.target !== el) {\n return;\n }\n runningTransitions.set(\n event.propertyName,\n (runningTransitions.get(event.propertyName) as number) - 1\n );\n if (!runningTransitions.get(event.propertyName)) {\n runningTransitions.delete(event.propertyName);\n }\n if (runningTransitions.size === 0) {\n cleanup();\n }\n };\n const handleTransitionrun = (event: TransitionEvent): void => {\n if (event.target !== el) {\n return;\n }\n if (!runningTransitions.has(event.propertyName)) {\n runningTransitions.set(event.propertyName, 0);\n }\n runningTransitions.set(\n event.propertyName,\n (runningTransitions.get(event.propertyName) as number) + 1\n );\n cancelAnimationFrame(guarantee1);\n cancelAnimationFrame(guarantee2);\n cancelAnimationFrame(guarantee3);\n };\n el.addEventListener('transitionrun', handleTransitionrun, {\n signal: abortController.signal,\n });\n el.addEventListener('transitionend', handleTransitionend, {\n signal: abortController.signal,\n });\n el.addEventListener('transitioncancel', handleTransitionend, {\n signal: abortController.signal,\n });\n action();\n};\n\nexport function nextFrame(): Promise<void> {\n return new Promise((res) => requestAnimationFrame(() => res()));\n}\n\n/**\n * Abstract Overlay base class so that property tyings and imperative API\n * interfaces can be held separate from the actual class definition.\n */\nexport class AbstractOverlay extends SpectrumElement {\n protected async applyFocus(\n _targetOpenState: boolean,\n _focusEl: HTMLElement | null\n ): Promise<void> {\n return;\n }\n /* c8 ignore next 6 */\n get delayed(): boolean {\n return false;\n }\n set delayed(_delayed: boolean) {\n return;\n }\n dialogEl!: HTMLDialogElement & {\n showPopover(): void;\n hidePopover(): void;\n };\n /* c8 ignore next 6 */\n get disabled(): boolean {\n return false;\n }\n set disabled(_disabled: boolean) {\n return;\n }\n dispose = noop;\n protected get elementResolver(): ElementResolutionController {\n return this._elementResolver;\n }\n protected set elementResolver(controller) {\n this._elementResolver = controller;\n }\n protected _elementResolver!: ElementResolutionController;\n /* c8 ignore next 3 */\n protected async ensureOnDOM(_targetOpenState: boolean): Promise<void> {\n return;\n }\n elements!: OpenableElement[];\n /* c8 ignore next 5 */\n protected async makeTransition(\n _targetOpenState: boolean\n ): Promise<HTMLElement | null> {\n return null;\n }\n protected async manageDelay(_targetOpenState: boolean): Promise<void> {\n return;\n }\n /* c8 ignore next 3 */\n protected async manageDialogOpen(): Promise<void> {\n return;\n }\n /* c8 ignore next 3 */\n protected async managePopoverOpen(): Promise<void> {\n return;\n }\n /* c8 ignore next 3 */\n protected managePosition(): void {\n return;\n }\n protected offset: number | [number, number] = 0;\n /* c8 ignore next 6 */\n get open(): boolean {\n return false;\n }\n set open(_open: boolean) {\n return;\n }\n placement?: Placement;\n protected get placementController(): PlacementController {\n return this._placementController;\n }\n protected set placementController(controller) {\n this._placementController = controller;\n }\n protected _placementController!: PlacementController;\n receivesFocus!: 'true' | 'false' | 'auto';\n protected requestSlottable(): void {}\n protected returnFocus(): void {\n return;\n }\n /* c8 ignore next 6 */\n get state(): OverlayState {\n return 'closed';\n }\n set state(_state: OverlayState) {\n return;\n }\n protected _state!: OverlayState;\n triggerElement!: HTMLElement | VirtualTrigger | null;\n type!: OverlayTypes;\n willPreventClose = false;\n /* c8 ignore next 3 */\n public manuallyKeepOpen(): void {\n return;\n }\n\n public static update(): void {\n const overlayUpdateEvent = new CustomEvent('sp-update-overlays', {\n bubbles: true,\n composed: true,\n cancelable: true,\n });\n document.dispatchEvent(overlayUpdateEvent);\n }\n\n /**\n * Overloaded imperative API entry point that allows for both the pre-0.37.0\n * argument signature as well as the post-0.37.0 signature. This allows for\n * consumers to continue to leverage it as they had been in previous releases\n * while also surfacing the more feature-rich API that has been made available.\n */\n public static async open(\n trigger: HTMLElement,\n interaction: TriggerInteractionsV1,\n content: HTMLElement,\n optionsV1: OverlayOptionsV1\n ): Promise<() => void>;\n public static async open(\n content: HTMLElement,\n options?: OverlayOptions\n ): Promise<Overlay>;\n public static async open(\n triggerOrContent: HTMLElement,\n interactionOrOptions:\n | TriggerInteractionsV1\n | OverlayOptions\n | undefined,\n content?: HTMLElement,\n optionsV1?: OverlayOptionsV1\n ): Promise<Overlay | (() => void)> {\n await import('@spectrum-web-components/overlay/sp-overlay.js');\n const v2 = arguments.length === 2;\n const overlayContent = content || triggerOrContent;\n // Use the `this` from the `static` method context rather than a\n // specific imported constructor to prevent opening a circular dependency.\n const overlay = new this() as Overlay;\n let restored = false;\n overlay.dispose = () => {\n overlay.addEventListener('sp-closed', () => {\n if (!restored) {\n restoreContent();\n restored = true;\n }\n requestAnimationFrame(() => {\n overlay.remove();\n });\n });\n overlay.open = false;\n overlay.dispose = noop;\n };\n /**\n * Since content must exist in an <sp-overlay>, we need a way to get it there.\n * The best & most-direct way is to declaratively use an <sp-overlay> element,\n * but for imperative users, we'll reparent content into an overlay that we've created for them.\n **/\n const restoreContent = reparentChildren([overlayContent], overlay, {\n position: 'beforeend',\n prepareCallback: (el) => {\n // Ensure that content to be overlaid is no longer targetted to a specific `slot`.\n // This allow for it to be visible in the overlaid context.\n const slot = el.slot;\n el.removeAttribute('slot');\n return () => {\n el.slot = slot;\n };\n },\n });\n\n const v1 = !v2 && overlayContent && optionsV1;\n if (v1) {\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n overlay,\n `You are interacting with an ${overlay.localName} element via a deprecated imperative API. This API will be removed in a future version of the SWC library. Consider leveraging an ${overlay.localName} directly.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/overlay/',\n { level: 'deprecation' }\n );\n }\n const trigger = triggerOrContent;\n const interaction = interactionOrOptions;\n const options = optionsV1;\n AbstractOverlay.applyOptions(overlay, {\n ...options,\n delayed:\n options.delayed || overlayContent.hasAttribute('delayed'),\n trigger: options.virtualTrigger || trigger,\n type:\n interaction === 'modal'\n ? 'modal'\n : interaction === 'hover'\n ? 'hint'\n : 'auto',\n });\n trigger.insertAdjacentElement('afterend', overlay);\n await overlay.updateComplete;\n overlay.open = true;\n return overlay.dispose;\n }\n\n const options = interactionOrOptions as OverlayOptions;\n overlay.append(overlayContent);\n AbstractOverlay.applyOptions(overlay, {\n ...options,\n delayed: options.delayed || overlayContent.hasAttribute('delayed'),\n });\n overlay.updateComplete.then(() => {\n // Do we want to \"open\" this path, or leave that to the consumer?\n overlay.open = true;\n });\n return overlay;\n }\n\n static applyOptions(\n overlay: AbstractOverlay,\n options: OverlayOptions\n ): void {\n overlay.delayed = !!options.delayed;\n overlay.receivesFocus = options.receivesFocus ?? 'auto';\n overlay.triggerElement = options.trigger || null;\n overlay.type = options.type || 'modal';\n overlay.offset = options.offset ?? 0;\n overlay.placement = options.placement;\n overlay.willPreventClose = !!options.notImmediatelyClosable;\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n }\n}\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,KAAAE,EAAkB,EACnCR,EAAQ,UAAYM,EAAQ,UAC5BN,EAAQ,iBAAmB,CAAC,CAACM,EAAQ,sBACzC,CAES,sBAA6B,CAClC,MAAM,qBAAqB,CAC/B,CACJ",
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 { SpectrumElement } from '@spectrum-web-components/base';\nimport { reparentChildren } from '@spectrum-web-components/shared/src/reparent-children.js';\n\nimport type {\n OpenableElement,\n OverlayOptions,\n OverlayOptionsV1,\n OverlayState,\n OverlayTypes,\n Placement,\n TriggerInteractionsV1,\n} from './overlay-types.js';\nimport type { Overlay } from './Overlay.js';\nimport type { VirtualTrigger } from './VirtualTrigger.js';\nimport { OverlayTimer } from './overlay-timer.js';\nimport type { PlacementController } from './PlacementController.js';\nimport type { ElementResolutionController } from '@spectrum-web-components/reactive-controllers/src/ElementResolution.js';\n\nexport const overlayTimer = new OverlayTimer();\n\nexport const noop = (): void => {\n return;\n};\n\n/**\n * Apply a \"transitionend\" listener to an element that may not transition but\n * guarantee the callback will be fired either way.\n *\n * @param el {HTMLElement} - Target of the \"transition\" listeners.\n * @param action {Function} - Method to trigger the \"transition\".\n * @param cb {Function} - Callback to trigger when the \"transition\" has ended.\n */\nexport const guaranteedAllTransitionend = (\n el: HTMLElement,\n action: () => void,\n cb: () => void\n): void => {\n const abortController = new AbortController();\n const runningTransitions = new Map<string, number>();\n const cleanup = (): void => {\n abortController.abort();\n cb();\n };\n let guarantee2: number;\n let guarantee3: number;\n // WebKit fires `transitionrun` a little earlier, the multiple guarantees here\n // allow WebKit to be caught, but doesn't remove the animation listener until\n // after it would have fired in Chromium.\n const guarantee1 = requestAnimationFrame(() => {\n guarantee2 = requestAnimationFrame(() => {\n guarantee3 = requestAnimationFrame(() => {\n cleanup();\n });\n });\n });\n const handleTransitionend = (event: TransitionEvent): void => {\n if (event.target !== el) {\n return;\n }\n runningTransitions.set(\n event.propertyName,\n (runningTransitions.get(event.propertyName) as number) - 1\n );\n if (!runningTransitions.get(event.propertyName)) {\n runningTransitions.delete(event.propertyName);\n }\n if (runningTransitions.size === 0) {\n cleanup();\n }\n };\n const handleTransitionrun = (event: TransitionEvent): void => {\n if (event.target !== el) {\n return;\n }\n if (!runningTransitions.has(event.propertyName)) {\n runningTransitions.set(event.propertyName, 0);\n }\n runningTransitions.set(\n event.propertyName,\n (runningTransitions.get(event.propertyName) as number) + 1\n );\n cancelAnimationFrame(guarantee1);\n cancelAnimationFrame(guarantee2);\n cancelAnimationFrame(guarantee3);\n };\n el.addEventListener('transitionrun', handleTransitionrun, {\n signal: abortController.signal,\n });\n el.addEventListener('transitionend', handleTransitionend, {\n signal: abortController.signal,\n });\n el.addEventListener('transitioncancel', handleTransitionend, {\n signal: abortController.signal,\n });\n action();\n};\n\nexport function nextFrame(): Promise<void> {\n return new Promise((res) => requestAnimationFrame(() => res()));\n}\n\n/**\n * Abstract Overlay base class so that property tyings and imperative API\n * interfaces can be held separate from the actual class definition.\n */\nexport class AbstractOverlay extends SpectrumElement {\n protected async applyFocus(\n _targetOpenState: boolean,\n _focusEl: HTMLElement | null\n ): Promise<void> {\n return;\n }\n /* c8 ignore next 6 */\n get delayed(): boolean {\n return false;\n }\n set delayed(_delayed: boolean) {\n return;\n }\n dialogEl!: HTMLDialogElement & {\n showPopover(): void;\n hidePopover(): void;\n };\n /* c8 ignore next 6 */\n get disabled(): boolean {\n return false;\n }\n set disabled(_disabled: boolean) {\n return;\n }\n dispose = noop;\n protected get elementResolver(): ElementResolutionController {\n return this._elementResolver;\n }\n protected set elementResolver(controller) {\n this._elementResolver = controller;\n }\n protected _elementResolver!: ElementResolutionController;\n /* c8 ignore next 3 */\n protected async ensureOnDOM(_targetOpenState: boolean): Promise<void> {\n return;\n }\n elements!: OpenableElement[];\n /* c8 ignore next 5 */\n protected async makeTransition(\n _targetOpenState: boolean\n ): Promise<HTMLElement | null> {\n return null;\n }\n protected async manageDelay(_targetOpenState: boolean): Promise<void> {\n return;\n }\n /* c8 ignore next 3 */\n protected async managePopoverOpen(): Promise<void> {\n return;\n }\n /* c8 ignore next 3 */\n protected managePosition(): void {\n return;\n }\n protected offset: number | [number, number] = 0;\n /* c8 ignore next 6 */\n get open(): boolean {\n return false;\n }\n set open(_open: boolean) {\n return;\n }\n placement?: Placement;\n protected get placementController(): PlacementController {\n return this._placementController;\n }\n protected set placementController(controller) {\n this._placementController = controller;\n }\n protected _placementController!: PlacementController;\n receivesFocus!: 'true' | 'false' | 'auto';\n protected requestSlottable(): void {}\n protected returnFocus(): void {\n return;\n }\n /* c8 ignore next 6 */\n get state(): OverlayState {\n return 'closed';\n }\n set state(_state: OverlayState) {\n return;\n }\n protected _state!: OverlayState;\n triggerElement!: HTMLElement | VirtualTrigger | null;\n type!: OverlayTypes;\n willPreventClose = false;\n /* c8 ignore next 3 */\n public manuallyKeepOpen(): void {\n return;\n }\n\n public static update(): void {\n const overlayUpdateEvent = new CustomEvent('sp-update-overlays', {\n bubbles: true,\n composed: true,\n cancelable: true,\n });\n document.dispatchEvent(overlayUpdateEvent);\n }\n\n /**\n * Overloaded imperative API entry point that allows for both the pre-0.37.0\n * argument signature as well as the post-0.37.0 signature. This allows for\n * consumers to continue to leverage it as they had been in previous releases\n * while also surfacing the more feature-rich API that has been made available.\n */\n public static async open(\n trigger: HTMLElement,\n interaction: TriggerInteractionsV1,\n content: HTMLElement,\n optionsV1: OverlayOptionsV1\n ): Promise<() => void>;\n public static async open(\n content: HTMLElement,\n options?: OverlayOptions\n ): Promise<Overlay>;\n public static async open(\n triggerOrContent: HTMLElement,\n interactionOrOptions:\n | TriggerInteractionsV1\n | OverlayOptions\n | undefined,\n content?: HTMLElement,\n optionsV1?: OverlayOptionsV1\n ): Promise<Overlay | (() => void)> {\n await import('@spectrum-web-components/overlay/sp-overlay.js');\n const v2 = arguments.length === 2;\n const overlayContent = content || triggerOrContent;\n // Use the `this` from the `static` method context rather than a\n // specific imported constructor to prevent opening a circular dependency.\n const overlay = new this() as Overlay;\n let restored = false;\n overlay.dispose = () => {\n overlay.addEventListener('sp-closed', () => {\n if (!restored) {\n restoreContent();\n restored = true;\n }\n requestAnimationFrame(() => {\n overlay.remove();\n });\n });\n overlay.open = false;\n overlay.dispose = noop;\n };\n /**\n * Since content must exist in an <sp-overlay>, we need a way to get it there.\n * The best & most-direct way is to declaratively use an <sp-overlay> element,\n * but for imperative users, we'll reparent content into an overlay that we've created for them.\n **/\n const restoreContent = reparentChildren([overlayContent], overlay, {\n position: 'beforeend',\n prepareCallback: (el) => {\n // Ensure that content to be overlaid is no longer targetted to a specific `slot`.\n // This allow for it to be visible in the overlaid context.\n const slot = el.slot;\n el.removeAttribute('slot');\n return () => {\n el.slot = slot;\n };\n },\n });\n\n const v1 = !v2 && overlayContent && optionsV1;\n if (v1) {\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n overlay,\n `You are interacting with an ${overlay.localName} element via a deprecated imperative API. This API will be removed in a future version of the SWC library. Consider leveraging an ${overlay.localName} directly.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/overlay/',\n { level: 'deprecation' }\n );\n }\n const trigger = triggerOrContent;\n const interaction = interactionOrOptions;\n const options = optionsV1;\n AbstractOverlay.applyOptions(overlay, {\n ...options,\n delayed:\n options.delayed || overlayContent.hasAttribute('delayed'),\n trigger: options.virtualTrigger || trigger,\n type:\n interaction === 'modal'\n ? 'modal'\n : interaction === 'hover'\n ? 'hint'\n : 'auto',\n });\n trigger.insertAdjacentElement('afterend', overlay);\n await overlay.updateComplete;\n overlay.open = true;\n return overlay.dispose;\n }\n\n const options = interactionOrOptions as OverlayOptions;\n overlay.append(overlayContent);\n AbstractOverlay.applyOptions(overlay, {\n ...options,\n delayed: options.delayed || overlayContent.hasAttribute('delayed'),\n });\n overlay.updateComplete.then(() => {\n // Do we want to \"open\" this path, or leave that to the consumer?\n overlay.open = true;\n });\n return overlay;\n }\n\n static applyOptions(\n overlay: AbstractOverlay,\n options: OverlayOptions\n ): void {\n overlay.delayed = !!options.delayed;\n overlay.receivesFocus = options.receivesFocus ?? 'auto';\n overlay.triggerElement = options.trigger || null;\n overlay.type = options.type || 'modal';\n overlay.offset = options.offset ?? 0;\n overlay.placement = options.placement;\n overlay.willPreventClose = !!options.notImmediatelyClosable;\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n }\n}\n"],
5
+ "mappings": "aAWA,OAAS,mBAAAA,MAAuB,gCAChC,OAAS,oBAAAC,MAAwB,2DAajC,OAAS,gBAAAC,MAAoB,qBAItB,aAAM,aAAe,IAAIA,EAEnB,KAAO,IAAY,CAEhC,EAUa,2BAA6B,CACtCC,EACAC,EACAC,IACO,CACP,MAAMC,EAAkB,IAAI,gBACtBC,EAAqB,IAAI,IACzBC,EAAU,IAAY,CACxBF,EAAgB,MAAM,EACtBD,EAAG,CACP,EACA,IAAII,EACAC,EAIJ,MAAMC,EAAa,sBAAsB,IAAM,CAC3CF,EAAa,sBAAsB,IAAM,CACrCC,EAAa,sBAAsB,IAAM,CACrCF,EAAQ,CACZ,CAAC,CACL,CAAC,CACL,CAAC,EACKI,EAAuBC,GAAiC,CACtDA,EAAM,SAAWV,IAGrBI,EAAmB,IACfM,EAAM,aACLN,EAAmB,IAAIM,EAAM,YAAY,EAAe,CAC7D,EACKN,EAAmB,IAAIM,EAAM,YAAY,GAC1CN,EAAmB,OAAOM,EAAM,YAAY,EAE5CN,EAAmB,OAAS,GAC5BC,EAAQ,EAEhB,EACMM,EAAuBD,GAAiC,CACtDA,EAAM,SAAWV,IAGhBI,EAAmB,IAAIM,EAAM,YAAY,GAC1CN,EAAmB,IAAIM,EAAM,aA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,CAClC,GAAGM,EACH,QAASA,EAAQ,SAAWP,EAAe,aAAa,SAAS,CACrE,CAAC,EACDC,EAAQ,eAAe,KAAK,IAAM,CAE9BA,EAAQ,KAAO,EACnB,CAAC,EACMA,CACX,CAEA,OAAO,aACHA,EACAM,EACI,CAvUZ,IAAAC,EAAAC,EAwUQR,EAAQ,QAAU,CAAC,CAACM,EAAQ,QAC5BN,EAAQ,eAAgBO,EAAAD,EAAQ,gBAAR,KAAAC,EAAyB,OACjDP,EAAQ,eAAiBM,EAAQ,SAAW,KAC5CN,EAAQ,KAAOM,EAAQ,MAAQ,QAC/BN,EAAQ,QAASQ,EAAAF,EAAQ,SAAR,KAAAE,EAAkB,EACnCR,EAAQ,UAAYM,EAAQ,UAC5BN,EAAQ,iBAAmB,CAAC,CAACM,EAAQ,sBACzC,CAES,sBAA6B,CAClC,MAAM,qBAAqB,CAC/B,CACJ",
6
6
  "names": ["SpectrumElement", "reparentChildren", "OverlayTimer", "el", "action", "cb", "abortController", "runningTransitions", "cleanup", "guarantee2", "guarantee3", "guarantee1", "handleTransitionend", "event", "handleTransitionrun", "res", "_targetOpenState", "_focusEl", "_delayed", "_disabled", "controller", "_open", "_state", "overlayUpdateEvent", "triggerOrContent", "interactionOrOptions", "content", "optionsV1", "v2", "overlayContent", "overlay", "restored", "restoreContent", "slot", "trigger", "interaction", "options", "_a", "_b"]
7
7
  }
@@ -18,5 +18,4 @@ export declare class HoverController extends InteractionController {
18
18
  protected doPointerleave(): void;
19
19
  init(): void;
20
20
  initOverlay(): void;
21
- private removeSafariFocusRingClass;
22
21
  }
@@ -6,8 +6,7 @@ import { noop } from "./AbstractOverlay.dev.js";
6
6
  import {
7
7
  InteractionController,
8
8
  InteractionTypes,
9
- lastInteractionType,
10
- SAFARI_FOCUS_RING_CLASS
9
+ lastInteractionType
11
10
  } from "./InteractionController.dev.js";
12
11
  const HOVER_DELAY = 300;
13
12
  export class HoverController extends InteractionController {
@@ -21,7 +20,6 @@ export class HoverController extends InteractionController {
21
20
  handleKeyup(event) {
22
21
  if (event.code === "Tab" || event.code === "Escape") {
23
22
  this.open = true;
24
- this.removeSafariFocusRingClass();
25
23
  }
26
24
  }
27
25
  handleTargetFocusin() {
@@ -29,15 +27,12 @@ export class HoverController extends InteractionController {
29
27
  return;
30
28
  }
31
29
  if (isWebKit() && this.target[lastInteractionType] === InteractionTypes.click) {
32
- this.target.classList.add(SAFARI_FOCUS_RING_CLASS);
33
30
  return;
34
31
  }
35
32
  this.open = true;
36
33
  this.focusedin = true;
37
- this.removeSafariFocusRingClass();
38
34
  }
39
35
  handleTargetFocusout() {
40
- this.removeSafariFocusRingClass();
41
36
  this.focusedin = false;
42
37
  if (this.pointerentered) return;
43
38
  this.open = false;
@@ -169,9 +164,5 @@ export class HoverController extends InteractionController {
169
164
  { signal }
170
165
  );
171
166
  }
172
- removeSafariFocusRingClass() {
173
- if (isWebKit() && this.target.classList.contains(SAFARI_FOCUS_RING_CLASS))
174
- this.target.classList.remove(SAFARI_FOCUS_RING_CLASS);
175
- }
176
167
  }
177
168
  //# sourceMappingURL=HoverController.dev.js.map