@spectrum-web-components/overlay 1.1.0 → 1.1.2

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.
Files changed (204) hide show
  1. package/overlay-trigger.d.ts +6 -0
  2. package/overlay-trigger.dev.js +5 -0
  3. package/overlay-trigger.dev.js.map +7 -0
  4. package/overlay-trigger.js +2 -0
  5. package/overlay-trigger.js.map +7 -0
  6. package/package.json +7 -7
  7. package/sp-overlay.d.ts +6 -0
  8. package/sp-overlay.dev.js +5 -0
  9. package/sp-overlay.dev.js.map +7 -0
  10. package/sp-overlay.js +2 -0
  11. package/sp-overlay.js.map +7 -0
  12. package/src/AbstractOverlay.d.ts +76 -0
  13. package/src/AbstractOverlay.dev.js +262 -0
  14. package/src/AbstractOverlay.dev.js.map +7 -0
  15. package/src/AbstractOverlay.js +2 -0
  16. package/src/AbstractOverlay.js.map +7 -0
  17. package/src/ClickController.d.ts +14 -0
  18. package/src/ClickController.dev.js +42 -0
  19. package/src/ClickController.dev.js.map +7 -0
  20. package/src/ClickController.js +2 -0
  21. package/src/ClickController.js.map +7 -0
  22. package/src/HoverController.d.ts +22 -0
  23. package/src/HoverController.dev.js +177 -0
  24. package/src/HoverController.dev.js.map +7 -0
  25. package/src/HoverController.js +2 -0
  26. package/src/HoverController.js.map +7 -0
  27. package/src/InteractionController.d.ts +44 -0
  28. package/src/InteractionController.dev.js +94 -0
  29. package/src/InteractionController.dev.js.map +7 -0
  30. package/src/InteractionController.js +2 -0
  31. package/src/InteractionController.js.map +7 -0
  32. package/src/LongpressController.d.ts +21 -0
  33. package/src/LongpressController.dev.js +156 -0
  34. package/src/LongpressController.dev.js.map +7 -0
  35. package/src/LongpressController.js +2 -0
  36. package/src/LongpressController.js.map +7 -0
  37. package/src/Overlay.d.ts +464 -0
  38. package/src/Overlay.dev.js +794 -0
  39. package/src/Overlay.dev.js.map +7 -0
  40. package/src/Overlay.js +33 -0
  41. package/src/Overlay.js.map +7 -0
  42. package/src/OverlayDialog.d.ts +4 -0
  43. package/src/OverlayDialog.dev.js +142 -0
  44. package/src/OverlayDialog.dev.js.map +7 -0
  45. package/src/OverlayDialog.js +2 -0
  46. package/src/OverlayDialog.js.map +7 -0
  47. package/src/OverlayNoPopover.d.ts +4 -0
  48. package/src/OverlayNoPopover.dev.js +117 -0
  49. package/src/OverlayNoPopover.dev.js.map +7 -0
  50. package/src/OverlayNoPopover.js +2 -0
  51. package/src/OverlayNoPopover.js.map +7 -0
  52. package/src/OverlayPopover.d.ts +4 -0
  53. package/src/OverlayPopover.dev.js +199 -0
  54. package/src/OverlayPopover.dev.js.map +7 -0
  55. package/src/OverlayPopover.js +2 -0
  56. package/src/OverlayPopover.js.map +7 -0
  57. package/src/OverlayStack.d.ts +44 -0
  58. package/src/OverlayStack.dev.js +163 -0
  59. package/src/OverlayStack.dev.js.map +7 -0
  60. package/src/OverlayStack.js +2 -0
  61. package/src/OverlayStack.js.map +7 -0
  62. package/src/OverlayTrigger.d.ts +52 -0
  63. package/src/OverlayTrigger.dev.js +243 -0
  64. package/src/OverlayTrigger.dev.js.map +7 -0
  65. package/src/OverlayTrigger.js +57 -0
  66. package/src/OverlayTrigger.js.map +7 -0
  67. package/src/PlacementController.d.ts +157 -0
  68. package/src/PlacementController.dev.js +287 -0
  69. package/src/PlacementController.dev.js.map +7 -0
  70. package/src/PlacementController.js +2 -0
  71. package/src/PlacementController.js.map +7 -0
  72. package/src/VirtualTrigger.d.ts +7 -0
  73. package/src/VirtualTrigger.dev.js +32 -0
  74. package/src/VirtualTrigger.dev.js.map +7 -0
  75. package/src/VirtualTrigger.js +2 -0
  76. package/src/VirtualTrigger.js.map +7 -0
  77. package/src/events.d.ts +23 -0
  78. package/src/events.dev.js +39 -0
  79. package/src/events.dev.js.map +7 -0
  80. package/src/events.js +2 -0
  81. package/src/events.js.map +7 -0
  82. package/src/fullSizePlugin.d.ts +12 -0
  83. package/src/fullSizePlugin.dev.js +39 -0
  84. package/src/fullSizePlugin.dev.js.map +7 -0
  85. package/src/fullSizePlugin.js +2 -0
  86. package/src/fullSizePlugin.js.map +7 -0
  87. package/src/index.d.ts +6 -0
  88. package/src/index.dev.js +8 -0
  89. package/src/index.dev.js.map +7 -0
  90. package/src/index.js +2 -0
  91. package/src/index.js.map +7 -0
  92. package/src/loader.d.ts +4 -0
  93. package/src/loader.dev.js +11 -0
  94. package/src/loader.dev.js.map +7 -0
  95. package/src/loader.js +2 -0
  96. package/src/loader.js.map +7 -0
  97. package/src/overlay-events.d.ts +11 -0
  98. package/src/overlay-events.dev.js +8 -0
  99. package/src/overlay-events.dev.js.map +7 -0
  100. package/src/overlay-events.js +2 -0
  101. package/src/overlay-events.js.map +7 -0
  102. package/src/overlay-timer.d.ts +22 -0
  103. package/src/overlay-timer.dev.js +72 -0
  104. package/src/overlay-timer.dev.js.map +7 -0
  105. package/src/overlay-timer.js +2 -0
  106. package/src/overlay-timer.js.map +7 -0
  107. package/src/overlay-trigger-directive.d.ts +26 -0
  108. package/src/overlay-trigger-directive.dev.js +87 -0
  109. package/src/overlay-trigger-directive.dev.js.map +7 -0
  110. package/src/overlay-trigger-directive.js +2 -0
  111. package/src/overlay-trigger-directive.js.map +7 -0
  112. package/src/overlay-trigger.css.d.ts +2 -0
  113. package/src/overlay-trigger.css.dev.js +7 -0
  114. package/src/overlay-trigger.css.dev.js.map +7 -0
  115. package/src/overlay-trigger.css.js +4 -0
  116. package/src/overlay-trigger.css.js.map +7 -0
  117. package/src/overlay-types.d.ts +50 -0
  118. package/src/overlay-types.dev.js +3 -0
  119. package/src/overlay-types.dev.js.map +7 -0
  120. package/src/overlay-types.js +2 -0
  121. package/src/overlay-types.js.map +7 -0
  122. package/src/overlay.css.d.ts +2 -0
  123. package/src/overlay.css.dev.js +7 -0
  124. package/src/overlay.css.dev.js.map +7 -0
  125. package/src/overlay.css.js +4 -0
  126. package/src/overlay.css.js.map +7 -0
  127. package/src/slottable-request-directive.d.ts +17 -0
  128. package/src/slottable-request-directive.dev.js +66 -0
  129. package/src/slottable-request-directive.dev.js.map +7 -0
  130. package/src/slottable-request-directive.js +2 -0
  131. package/src/slottable-request-directive.js.map +7 -0
  132. package/src/slottable-request-event.d.ts +12 -0
  133. package/src/slottable-request-event.dev.js +28 -0
  134. package/src/slottable-request-event.dev.js.map +7 -0
  135. package/src/slottable-request-event.js +2 -0
  136. package/src/slottable-request-event.js.map +7 -0
  137. package/src/strategies.d.ts +8 -0
  138. package/src/strategies.dev.js +10 -0
  139. package/src/strategies.dev.js.map +7 -0
  140. package/src/strategies.js +2 -0
  141. package/src/strategies.js.map +7 -0
  142. package/stories/index.js +48 -0
  143. package/stories/index.js.map +7 -0
  144. package/stories/overlay-directive.stories.js +340 -0
  145. package/stories/overlay-directive.stories.js.map +7 -0
  146. package/stories/overlay-element.stories.js +687 -0
  147. package/stories/overlay-element.stories.js.map +7 -0
  148. package/stories/overlay-story-components.js +338 -0
  149. package/stories/overlay-story-components.js.map +7 -0
  150. package/stories/overlay.stories.js +1412 -0
  151. package/stories/overlay.stories.js.map +7 -0
  152. package/sync/overlay-trigger.d.ts +6 -0
  153. package/sync/overlay-trigger.dev.js +6 -0
  154. package/sync/overlay-trigger.dev.js.map +7 -0
  155. package/sync/overlay-trigger.js +2 -0
  156. package/sync/overlay-trigger.js.map +7 -0
  157. package/test/benchmark/basic-test.js +40 -0
  158. package/test/benchmark/basic-test.js.map +7 -0
  159. package/test/benchmark/directive-test.js +43 -0
  160. package/test/benchmark/directive-test.js.map +7 -0
  161. package/test/benchmark/element-test.js +40 -0
  162. package/test/benchmark/element-test.js.map +7 -0
  163. package/test/benchmark/lazy-test.js +47 -0
  164. package/test/benchmark/lazy-test.js.map +7 -0
  165. package/test/index.js +605 -0
  166. package/test/index.js.map +7 -0
  167. package/test/overlay-directive.test-vrt.js +5 -0
  168. package/test/overlay-directive.test-vrt.js.map +7 -0
  169. package/test/overlay-directive.test.js +162 -0
  170. package/test/overlay-directive.test.js.map +7 -0
  171. package/test/overlay-element.test-vrt.js +5 -0
  172. package/test/overlay-element.test-vrt.js.map +7 -0
  173. package/test/overlay-element.test.js +934 -0
  174. package/test/overlay-element.test.js.map +7 -0
  175. package/test/overlay-lifecycle.test.js +139 -0
  176. package/test/overlay-lifecycle.test.js.map +7 -0
  177. package/test/overlay-memory.test.js +10 -0
  178. package/test/overlay-memory.test.js.map +7 -0
  179. package/test/overlay-timer.test.js +118 -0
  180. package/test/overlay-timer.test.js.map +7 -0
  181. package/test/overlay-trigger-click.test.js +164 -0
  182. package/test/overlay-trigger-click.test.js.map +7 -0
  183. package/test/overlay-trigger-directive.test.js +75 -0
  184. package/test/overlay-trigger-directive.test.js.map +7 -0
  185. package/test/overlay-trigger-extended.test.js +235 -0
  186. package/test/overlay-trigger-extended.test.js.map +7 -0
  187. package/test/overlay-trigger-hover-click.test.js +225 -0
  188. package/test/overlay-trigger-hover-click.test.js.map +7 -0
  189. package/test/overlay-trigger-hover.test.js +308 -0
  190. package/test/overlay-trigger-hover.test.js.map +7 -0
  191. package/test/overlay-trigger-longpress.test.js +531 -0
  192. package/test/overlay-trigger-longpress.test.js.map +7 -0
  193. package/test/overlay-trigger-sync.test.js +5 -0
  194. package/test/overlay-trigger-sync.test.js.map +7 -0
  195. package/test/overlay-trigger.test.js +5 -0
  196. package/test/overlay-trigger.test.js.map +7 -0
  197. package/test/overlay-update.test.js +28 -0
  198. package/test/overlay-update.test.js.map +7 -0
  199. package/test/overlay-v1.test.js +569 -0
  200. package/test/overlay-v1.test.js.map +7 -0
  201. package/test/overlay.test-vrt.js +5 -0
  202. package/test/overlay.test-vrt.js.map +7 -0
  203. package/test/overlay.test.js +865 -0
  204. package/test/overlay.test.js.map +7 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["overlay-trigger-directive.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2023 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 {\n type ElementPart,\n nothing,\n render,\n type RenderOptions,\n type TemplateResult,\n} from '@spectrum-web-components/base';\nimport { directive } from '@spectrum-web-components/base/src/async-directive.js';\nimport { strategies } from './strategies.dev.js'\nimport type { OverlayOptions, TriggerInteraction } from './overlay-types.dev.js'\nimport type { ClickController } from './ClickController.dev.js'\nimport type { HoverController } from './HoverController.dev.js'\nimport type { LongpressController } from './LongpressController.dev.js'\nimport {\n removeSlottableRequest,\n type SlottableRequestEvent,\n} from './slottable-request-event.dev.js'\nimport { SlottableRequestDirective } from './slottable-request-directive.dev.js'\nimport { AbstractOverlay } from './AbstractOverlay.dev.js'\nimport { InteractionTypes } from './InteractionController.dev.js'\n\nexport type InsertionOptions = {\n el: HTMLElement | (() => HTMLElement);\n where: InsertPosition;\n};\n\nexport type OverlayTriggerOptions = {\n open?: boolean;\n triggerInteraction: TriggerInteraction;\n overlayOptions: OverlayOptions;\n insertionOptions?: InsertionOptions;\n};\n\nexport class OverlayTriggerDirective extends SlottableRequestDirective {\n private host?: object;\n private overlay!: AbstractOverlay;\n private strategy!: ClickController | HoverController | LongpressController;\n\n protected defaultOptions: OverlayTriggerOptions = {\n triggerInteraction: 'click',\n overlayOptions: {\n type: 'auto',\n offset: 0,\n },\n };\n protected options: OverlayOptions = {\n ...this.defaultOptions.overlayOptions,\n };\n protected insertionOptions?: InsertionOptions;\n\n /* c8 ignore next 9 */\n override render(\n _template: () => TemplateResult,\n _options?: Partial<OverlayTriggerOptions>\n ): unknown {\n // render function here just defines the interface to the update call later\n // we don't have anything to render since this is intended to be an ElementPart directive\n // so will be used on an element and is not itself rendered\n return nothing;\n }\n\n override update(\n part: ElementPart,\n [template, options]: Parameters<this['render']>\n ): void {\n this.options = {\n ...this.defaultOptions.overlayOptions,\n ...options?.overlayOptions,\n };\n this.insertionOptions = options?.insertionOptions;\n this.template = template;\n this.host = part.options?.host;\n let newTarget = false;\n const triggerInteraction = (options?.triggerInteraction ||\n this.defaultOptions.triggerInteraction) as TriggerInteraction;\n const newStrategy =\n InteractionTypes[this.strategy?.type] !== triggerInteraction;\n if (this.target !== part.element) {\n this.target = part.element as HTMLElement;\n newTarget = true;\n }\n if (newTarget || newStrategy) {\n this.strategy?.abort();\n this.strategy = new strategies[\n triggerInteraction as TriggerInteraction\n ](this.target, {\n isPersistent: true,\n handleOverlayReady: (overlay: AbstractOverlay) => {\n this.listenerHost = this.overlay = overlay;\n this.init();\n },\n });\n }\n this.strategy.open = options?.open ?? false;\n }\n\n override handleSlottableRequest(event: SlottableRequestEvent): void {\n /* c8 ignore next 1 */\n if (event.target !== event.currentTarget) return;\n\n const willRemoveSlottable = event.data === removeSlottableRequest;\n const options = {} as RenderOptions;\n if (this.host) {\n options.host = this.host;\n }\n render(\n willRemoveSlottable ? undefined : this.template(),\n this.overlay,\n options\n );\n\n if (willRemoveSlottable) {\n this.overlay.remove();\n } else {\n AbstractOverlay.applyOptions(this.overlay, {\n ...this.options,\n trigger: this.target,\n });\n const insertionEl =\n typeof this.insertionOptions?.el === 'function'\n ? this.insertionOptions.el()\n : this.insertionOptions?.el || this.target;\n const { where = 'afterend' } = this.insertionOptions || {};\n insertionEl.insertAdjacentElement(where, this.overlay);\n }\n }\n}\n\nexport const trigger = directive(OverlayTriggerDirective);\n"],
5
+ "mappings": ";AAWA;AAAA,EAEI;AAAA,EACA;AAAA,OAGG;AACP,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAK3B;AAAA,EACI;AAAA,OAEG;AACP,SAAS,iCAAiC;AAC1C,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AAc1B,aAAM,gCAAgC,0BAA0B;AAAA,EAAhE;AAAA;AAKH,SAAU,iBAAwC;AAAA,MAC9C,oBAAoB;AAAA,MACpB,gBAAgB;AAAA,QACZ,MAAM;AAAA,QACN,QAAQ;AAAA,MACZ;AAAA,IACJ;AACA,SAAU,UAA0B;AAAA,MAChC,GAAG,KAAK,eAAe;AAAA,IAC3B;AAAA;AAAA;AAAA,EAIS,OACL,WACA,UACO;AAIP,WAAO;AAAA,EACX;AAAA,EAES,OACL,MACA,CAAC,UAAU,OAAO,GACd;AA3EZ;AA4EQ,SAAK,UAAU;AAAA,MACX,GAAG,KAAK,eAAe;AAAA,MACvB,GAAG,mCAAS;AAAA,IAChB;AACA,SAAK,mBAAmB,mCAAS;AACjC,SAAK,WAAW;AAChB,SAAK,QAAO,UAAK,YAAL,mBAAc;AAC1B,QAAI,YAAY;AAChB,UAAM,sBAAsB,mCAAS,uBACjC,KAAK,eAAe;AACxB,UAAM,cACF,kBAAiB,UAAK,aAAL,mBAAe,IAAI,MAAM;AAC9C,QAAI,KAAK,WAAW,KAAK,SAAS;AAC9B,WAAK,SAAS,KAAK;AACnB,kBAAY;AAAA,IAChB;AACA,QAAI,aAAa,aAAa;AAC1B,iBAAK,aAAL,mBAAe;AACf,WAAK,WAAW,IAAI,WAChB,kBACJ,EAAE,KAAK,QAAQ;AAAA,QACX,cAAc;AAAA,QACd,oBAAoB,CAAC,YAA6B;AAC9C,eAAK,eAAe,KAAK,UAAU;AACnC,eAAK,KAAK;AAAA,QACd;AAAA,MACJ,CAAC;AAAA,IACL;AACA,SAAK,SAAS,QAAO,wCAAS,SAAT,YAAiB;AAAA,EAC1C;AAAA,EAES,uBAAuB,OAAoC;AA3GxE;AA6GQ,QAAI,MAAM,WAAW,MAAM,cAAe;AAE1C,UAAM,sBAAsB,MAAM,SAAS;AAC3C,UAAM,UAAU,CAAC;AACjB,QAAI,KAAK,MAAM;AACX,cAAQ,OAAO,KAAK;AAAA,IACxB;AACA;AAAA,MACI,sBAAsB,SAAY,KAAK,SAAS;AAAA,MAChD,KAAK;AAAA,MACL;AAAA,IACJ;AAEA,QAAI,qBAAqB;AACrB,WAAK,QAAQ,OAAO;AAAA,IACxB,OAAO;AACH,sBAAgB,aAAa,KAAK,SAAS;AAAA,QACvC,GAAG,KAAK;AAAA,QACR,SAAS,KAAK;AAAA,MAClB,CAAC;AACD,YAAM,cACF,SAAO,UAAK,qBAAL,mBAAuB,QAAO,aAC/B,KAAK,iBAAiB,GAAG,MACzB,UAAK,qBAAL,mBAAuB,OAAM,KAAK;AAC5C,YAAM,EAAE,QAAQ,WAAW,IAAI,KAAK,oBAAoB,CAAC;AACzD,kBAAY,sBAAsB,OAAO,KAAK,OAAO;AAAA,IACzD;AAAA,EACJ;AACJ;AAEO,aAAM,UAAU,UAAU,uBAAuB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";import{nothing as y,render as h}from"@spectrum-web-components/base";import{directive as v}from"@spectrum-web-components/base/src/async-directive.js";import{strategies as O}from"./strategies.js";import{removeSlottableRequest as m}from"./slottable-request-event.js";import{SlottableRequestDirective as c}from"./slottable-request-directive.js";import{AbstractOverlay as d}from"./AbstractOverlay.js";import{InteractionTypes as f}from"./InteractionController.js";export class OverlayTriggerDirective extends c{constructor(){super(...arguments);this.defaultOptions={triggerInteraction:"click",overlayOptions:{type:"auto",offset:0}};this.options={...this.defaultOptions.overlayOptions}}render(e,r){return y}update(e,[r,t]){var n,l,a,p;this.options={...this.defaultOptions.overlayOptions,...t==null?void 0:t.overlayOptions},this.insertionOptions=t==null?void 0:t.insertionOptions,this.template=r,this.host=(n=e.options)==null?void 0:n.host;let i=!1;const o=(t==null?void 0:t.triggerInteraction)||this.defaultOptions.triggerInteraction,s=f[(l=this.strategy)==null?void 0:l.type]!==o;this.target!==e.element&&(this.target=e.element,i=!0),(i||s)&&((a=this.strategy)==null||a.abort(),this.strategy=new O[o](this.target,{isPersistent:!0,handleOverlayReady:g=>{this.listenerHost=this.overlay=g,this.init()}})),this.strategy.open=(p=t==null?void 0:t.open)!=null?p:!1}handleSlottableRequest(e){var i,o;if(e.target!==e.currentTarget)return;const r=e.data===m,t={};if(this.host&&(t.host=this.host),h(r?void 0:this.template(),this.overlay,t),r)this.overlay.remove();else{d.applyOptions(this.overlay,{...this.options,trigger:this.target});const s=typeof((i=this.insertionOptions)==null?void 0:i.el)=="function"?this.insertionOptions.el():((o=this.insertionOptions)==null?void 0:o.el)||this.target,{where:n="afterend"}=this.insertionOptions||{};s.insertAdjacentElement(n,this.overlay)}}}export const trigger=v(OverlayTriggerDirective);
2
+ //# sourceMappingURL=overlay-trigger-directive.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["overlay-trigger-directive.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2023 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 {\n type ElementPart,\n nothing,\n render,\n type RenderOptions,\n type TemplateResult,\n} from '@spectrum-web-components/base';\nimport { directive } from '@spectrum-web-components/base/src/async-directive.js';\nimport { strategies } from './strategies.js';\nimport type { OverlayOptions, TriggerInteraction } from './overlay-types.js';\nimport type { ClickController } from './ClickController.js';\nimport type { HoverController } from './HoverController.js';\nimport type { LongpressController } from './LongpressController.js';\nimport {\n removeSlottableRequest,\n type SlottableRequestEvent,\n} from './slottable-request-event.js';\nimport { SlottableRequestDirective } from './slottable-request-directive.js';\nimport { AbstractOverlay } from './AbstractOverlay.js';\nimport { InteractionTypes } from './InteractionController.js';\n\nexport type InsertionOptions = {\n el: HTMLElement | (() => HTMLElement);\n where: InsertPosition;\n};\n\nexport type OverlayTriggerOptions = {\n open?: boolean;\n triggerInteraction: TriggerInteraction;\n overlayOptions: OverlayOptions;\n insertionOptions?: InsertionOptions;\n};\n\nexport class OverlayTriggerDirective extends SlottableRequestDirective {\n private host?: object;\n private overlay!: AbstractOverlay;\n private strategy!: ClickController | HoverController | LongpressController;\n\n protected defaultOptions: OverlayTriggerOptions = {\n triggerInteraction: 'click',\n overlayOptions: {\n type: 'auto',\n offset: 0,\n },\n };\n protected options: OverlayOptions = {\n ...this.defaultOptions.overlayOptions,\n };\n protected insertionOptions?: InsertionOptions;\n\n /* c8 ignore next 9 */\n override render(\n _template: () => TemplateResult,\n _options?: Partial<OverlayTriggerOptions>\n ): unknown {\n // render function here just defines the interface to the update call later\n // we don't have anything to render since this is intended to be an ElementPart directive\n // so will be used on an element and is not itself rendered\n return nothing;\n }\n\n override update(\n part: ElementPart,\n [template, options]: Parameters<this['render']>\n ): void {\n this.options = {\n ...this.defaultOptions.overlayOptions,\n ...options?.overlayOptions,\n };\n this.insertionOptions = options?.insertionOptions;\n this.template = template;\n this.host = part.options?.host;\n let newTarget = false;\n const triggerInteraction = (options?.triggerInteraction ||\n this.defaultOptions.triggerInteraction) as TriggerInteraction;\n const newStrategy =\n InteractionTypes[this.strategy?.type] !== triggerInteraction;\n if (this.target !== part.element) {\n this.target = part.element as HTMLElement;\n newTarget = true;\n }\n if (newTarget || newStrategy) {\n this.strategy?.abort();\n this.strategy = new strategies[\n triggerInteraction as TriggerInteraction\n ](this.target, {\n isPersistent: true,\n handleOverlayReady: (overlay: AbstractOverlay) => {\n this.listenerHost = this.overlay = overlay;\n this.init();\n },\n });\n }\n this.strategy.open = options?.open ?? false;\n }\n\n override handleSlottableRequest(event: SlottableRequestEvent): void {\n /* c8 ignore next 1 */\n if (event.target !== event.currentTarget) return;\n\n const willRemoveSlottable = event.data === removeSlottableRequest;\n const options = {} as RenderOptions;\n if (this.host) {\n options.host = this.host;\n }\n render(\n willRemoveSlottable ? undefined : this.template(),\n this.overlay,\n options\n );\n\n if (willRemoveSlottable) {\n this.overlay.remove();\n } else {\n AbstractOverlay.applyOptions(this.overlay, {\n ...this.options,\n trigger: this.target,\n });\n const insertionEl =\n typeof this.insertionOptions?.el === 'function'\n ? this.insertionOptions.el()\n : this.insertionOptions?.el || this.target;\n const { where = 'afterend' } = this.insertionOptions || {};\n insertionEl.insertAdjacentElement(where, this.overlay);\n }\n }\n}\n\nexport const trigger = directive(OverlayTriggerDirective);\n"],
5
+ "mappings": "aAWA,OAEI,WAAAA,EACA,UAAAC,MAGG,gCACP,OAAS,aAAAC,MAAiB,uDAC1B,OAAS,cAAAC,MAAkB,kBAK3B,OACI,0BAAAC,MAEG,+BACP,OAAS,6BAAAC,MAAiC,mCAC1C,OAAS,mBAAAC,MAAuB,uBAChC,OAAS,oBAAAC,MAAwB,6BAc1B,aAAM,gCAAgCF,CAA0B,CAAhE,kCAKH,KAAU,eAAwC,CAC9C,mBAAoB,QACpB,eAAgB,CACZ,KAAM,OACN,OAAQ,CACZ,CACJ,EACA,KAAU,QAA0B,CAChC,GAAG,KAAK,eAAe,cAC3B,EAIS,OACLG,EACAC,EACO,CAIP,OAAOT,CACX,CAES,OACLU,EACA,CAACC,EAAUC,CAAO,EACd,CA3EZ,IAAAC,EAAAC,EAAAC,EAAAC,EA4EQ,KAAK,QAAU,CACX,GAAG,KAAK,eAAe,eACvB,GAAGJ,GAAA,YAAAA,EAAS,cAChB,EACA,KAAK,iBAAmBA,GAAA,YAAAA,EAAS,iBACjC,KAAK,SAAWD,EAChB,KAAK,MAAOE,EAAAH,EAAK,UAAL,YAAAG,EAAc,KAC1B,IAAII,EAAY,GAChB,MAAMC,GAAsBN,GAAA,YAAAA,EAAS,qBACjC,KAAK,eAAe,mBAClBO,EACFZ,GAAiBO,EAAA,KAAK,WAAL,YAAAA,EAAe,IAAI,IAAMI,EAC1C,KAAK,SAAWR,EAAK,UACrB,KAAK,OAASA,EAAK,QACnBO,EAAY,KAEZA,GAAaE,MACbJ,EAAA,KAAK,WAAL,MAAAA,EAAe,QACf,KAAK,SAAW,IAAIZ,EAChBe,CACJ,EAAE,KAAK,OAAQ,CACX,aAAc,GACd,mBAAqBE,GAA6B,CAC9C,KAAK,aAAe,KAAK,QAAUA,EACnC,KAAK,KAAK,CACd,CACJ,CAAC,GAEL,KAAK,SAAS,MAAOJ,EAAAJ,GAAA,YAAAA,EAAS,OAAT,KAAAI,EAAiB,EAC1C,CAES,uBAAuBK,EAAoC,CA3GxE,IAAAR,EAAAC,EA6GQ,GAAIO,EAAM,SAAWA,EAAM,cAAe,OAE1C,MAAMC,EAAsBD,EAAM,OAASjB,EACrCQ,EAAU,CAAC,EAUjB,GATI,KAAK,OACLA,EAAQ,KAAO,KAAK,MAExBX,EACIqB,EAAsB,OAAY,KAAK,SAAS,EAChD,KAAK,QACLV,CACJ,EAEIU,EACA,KAAK,QAAQ,OAAO,MACjB,CACHhB,EAAgB,aAAa,KAAK,QAAS,CACvC,GAAG,KAAK,QACR,QAAS,KAAK,MAClB,CAAC,EACD,MAAMiB,EACF,QAAOV,EAAA,KAAK,mBAAL,YAAAA,EAAuB,KAAO,WAC/B,KAAK,iBAAiB,GAAG,IACzBC,EAAA,KAAK,mBAAL,YAAAA,EAAuB,KAAM,KAAK,OACtC,CAAE,MAAAU,EAAQ,UAAW,EAAI,KAAK,kBAAoB,CAAC,EACzDD,EAAY,sBAAsBC,EAAO,KAAK,OAAO,CACzD,CACJ,CACJ,CAEO,aAAM,QAAUtB,EAAU,uBAAuB",
6
+ "names": ["nothing", "render", "directive", "strategies", "removeSlottableRequest", "SlottableRequestDirective", "AbstractOverlay", "InteractionTypes", "_template", "_options", "part", "template", "options", "_a", "_b", "_c", "_d", "newTarget", "triggerInteraction", "newStrategy", "overlay", "event", "willRemoveSlottable", "insertionEl", "where"]
7
+ }
@@ -0,0 +1,2 @@
1
+ declare const styles: import("@spectrum-web-components/base").CSSResult;
2
+ export default styles;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ import { css } from "@spectrum-web-components/base";
3
+ const styles = css`
4
+ :host([disabled]) ::slotted([slot=trigger]){pointer-events:none}slot[name=longpress-describedby-descriptor]{display:none}
5
+ `;
6
+ export default styles;
7
+ //# sourceMappingURL=overlay-trigger.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["overlay-trigger.css.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host([disabled]) ::slotted([slot=trigger]){pointer-events:none}slot[name=longpress-describedby-descriptor]{display:none}\n`;\nexport default styles;"],
5
+ "mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";import{css as e}from"@spectrum-web-components/base";const s=e`
2
+ :host([disabled]) ::slotted([slot=trigger]){pointer-events:none}slot[name=longpress-describedby-descriptor]{display:none}
3
+ `;export default s;
4
+ //# sourceMappingURL=overlay-trigger.css.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["overlay-trigger.css.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host([disabled]) ::slotted([slot=trigger]){pointer-events:none}slot[name=longpress-describedby-descriptor]{display:none}\n`;\nexport default styles;"],
5
+ "mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
6
+ "names": ["css", "styles"]
7
+ }
@@ -0,0 +1,50 @@
1
+ import type { Placement } from '@floating-ui/dom';
2
+ import type { VirtualTrigger } from './VirtualTrigger.js';
3
+ export type Constructor<T = Record<string, unknown>> = {
4
+ new (...args: any[]): T;
5
+ prototype: T;
6
+ };
7
+ export { Placement };
8
+ export type OverlayTypes = 'auto' | 'hint' | 'manual' | 'modal' | 'page';
9
+ export type TriggerInteraction = 'click' | 'longpress' | 'hover';
10
+ export type TriggerInteractions = OverlayTypes;
11
+ export type TriggerInteractionsV1 = 'click' | 'longpress' | 'hover' | 'custom' | 'replace' | 'inline' | 'modal';
12
+ export type OverlayTriggerInteractions = Extract<TriggerInteractions, 'inline' | 'modal' | 'replace'>;
13
+ export interface OverlayOpenCloseDetail {
14
+ interaction: TriggerInteractions;
15
+ reason?: 'external-click';
16
+ }
17
+ export interface OverlayCloseReasonDetail {
18
+ reason?: 'external-click';
19
+ }
20
+ export type OverlayOptions = {
21
+ delayed?: boolean;
22
+ notImmediatelyClosable?: boolean;
23
+ offset?: number | [number, number];
24
+ placement?: Placement;
25
+ receivesFocus?: 'auto' | 'true' | 'false';
26
+ trigger?: HTMLElement | VirtualTrigger;
27
+ type?: 'modal' | 'page' | 'hint' | 'auto' | 'manual';
28
+ };
29
+ export type OverlayOptionsV1 = {
30
+ root?: HTMLElement;
31
+ delayed?: boolean;
32
+ placement?: Placement;
33
+ offset?: number;
34
+ receivesFocus?: 'true' | 'false' | 'auto';
35
+ notImmediatelyClosable?: boolean;
36
+ abortPromise?: Promise<boolean>;
37
+ virtualTrigger?: VirtualTrigger;
38
+ };
39
+ declare global {
40
+ interface GlobalEventHandlersEventMap {
41
+ 'sp-opened': CustomEvent<OverlayOpenCloseDetail>;
42
+ 'sp-closed': CustomEvent<OverlayOpenCloseDetail>;
43
+ }
44
+ }
45
+ export type OpenableElement = HTMLElement & {
46
+ open: boolean;
47
+ tipElement?: HTMLElement;
48
+ updateComplete?: Promise<void>;
49
+ };
50
+ export type OverlayState = 'closed' | 'opening' | 'opened' | 'closing';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ export {};
3
+ //# sourceMappingURL=overlay-types.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["overlay-types.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport type { Placement } from '@floating-ui/dom';\nimport type { VirtualTrigger } from './VirtualTrigger.dev.js'\n\nexport type Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport { Placement };\n\nexport type OverlayTypes = 'auto' | 'hint' | 'manual' | 'modal' | 'page';\n\nexport type TriggerInteraction = 'click' | 'longpress' | 'hover';\n\nexport type TriggerInteractions = OverlayTypes;\n\nexport type TriggerInteractionsV1 =\n | 'click'\n | 'longpress'\n | 'hover'\n | 'custom'\n | 'replace'\n | 'inline'\n | 'modal';\n\nexport type OverlayTriggerInteractions = Extract<\n TriggerInteractions,\n 'inline' | 'modal' | 'replace'\n>;\n\nexport interface OverlayOpenCloseDetail {\n interaction: TriggerInteractions;\n reason?: 'external-click';\n}\n\nexport interface OverlayCloseReasonDetail {\n reason?: 'external-click';\n}\n\nexport type OverlayOptions = {\n delayed?: boolean;\n notImmediatelyClosable?: boolean;\n offset?: number | [number, number]; // supporting multi-axis\n placement?: Placement;\n receivesFocus?: 'auto' | 'true' | 'false';\n trigger?: HTMLElement | VirtualTrigger;\n type?: 'modal' | 'page' | 'hint' | 'auto' | 'manual';\n};\n\nexport type OverlayOptionsV1 = {\n root?: HTMLElement;\n delayed?: boolean;\n placement?: Placement;\n offset?: number;\n receivesFocus?: 'true' | 'false' | 'auto';\n notImmediatelyClosable?: boolean;\n abortPromise?: Promise<boolean>;\n virtualTrigger?: VirtualTrigger;\n};\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n 'sp-opened': CustomEvent<OverlayOpenCloseDetail>;\n 'sp-closed': CustomEvent<OverlayOpenCloseDetail>;\n }\n}\n\nexport type OpenableElement = HTMLElement & {\n open: boolean;\n tipElement?: HTMLElement;\n updateComplete?: Promise<void>;\n};\n\nexport type OverlayState = 'closed' | 'opening' | 'opened' | 'closing';\n"],
5
+ "mappings": ";AAqBA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";export{};
2
+ //# sourceMappingURL=overlay-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["overlay-types.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport type { Placement } from '@floating-ui/dom';\nimport type { VirtualTrigger } from './VirtualTrigger.js';\n\nexport type Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport { Placement };\n\nexport type OverlayTypes = 'auto' | 'hint' | 'manual' | 'modal' | 'page';\n\nexport type TriggerInteraction = 'click' | 'longpress' | 'hover';\n\nexport type TriggerInteractions = OverlayTypes;\n\nexport type TriggerInteractionsV1 =\n | 'click'\n | 'longpress'\n | 'hover'\n | 'custom'\n | 'replace'\n | 'inline'\n | 'modal';\n\nexport type OverlayTriggerInteractions = Extract<\n TriggerInteractions,\n 'inline' | 'modal' | 'replace'\n>;\n\nexport interface OverlayOpenCloseDetail {\n interaction: TriggerInteractions;\n reason?: 'external-click';\n}\n\nexport interface OverlayCloseReasonDetail {\n reason?: 'external-click';\n}\n\nexport type OverlayOptions = {\n delayed?: boolean;\n notImmediatelyClosable?: boolean;\n offset?: number | [number, number]; // supporting multi-axis\n placement?: Placement;\n receivesFocus?: 'auto' | 'true' | 'false';\n trigger?: HTMLElement | VirtualTrigger;\n type?: 'modal' | 'page' | 'hint' | 'auto' | 'manual';\n};\n\nexport type OverlayOptionsV1 = {\n root?: HTMLElement;\n delayed?: boolean;\n placement?: Placement;\n offset?: number;\n receivesFocus?: 'true' | 'false' | 'auto';\n notImmediatelyClosable?: boolean;\n abortPromise?: Promise<boolean>;\n virtualTrigger?: VirtualTrigger;\n};\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n 'sp-opened': CustomEvent<OverlayOpenCloseDetail>;\n 'sp-closed': CustomEvent<OverlayOpenCloseDetail>;\n }\n}\n\nexport type OpenableElement = HTMLElement & {\n open: boolean;\n tipElement?: HTMLElement;\n updateComplete?: Promise<void>;\n};\n\nexport type OverlayState = 'closed' | 'opening' | 'opened' | 'closing';\n"],
5
+ "mappings": "aAqBA",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ declare const styles: import("@spectrum-web-components/base").CSSResult;
2
+ export default styles;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ import { css } from "@spectrum-web-components/base";
3
+ const styles = css`
4
+ :host{pointer-events:none;--swc-overlay-animation-distance:var(--spectrum-spacing-100);display:contents}:host(:has(>sp-tooltip)){--swc-overlay-animation-distance:var(--spectrum-tooltip-animation-distance)}.dialog{box-sizing:border-box;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);height:auto;--sp-overlay-open:true;background:0 0;border:0;margin:0;padding:0;display:flex;position:fixed;inset:0 auto auto 0;overflow:visible;opacity:1!important}.dialog:not([is-visible]){display:none}.dialog:focus{outline:none}dialog:modal{--mod-popover-filter:var(--spectrum-popover-filter)}:host(:not([open])) .dialog{--sp-overlay-open:false}.dialog::backdrop{display:none}.dialog:before{content:"";position:absolute;inset:-999em;pointer-events:auto!important}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto;visibility:visible!important}::slotted(sp-popover){position:static}.dialog:not([actual-placement])[placement*=top]{padding-block:var(--swc-overlay-animation-distance);margin-top:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{padding-inline:var(--swc-overlay-animation-distance);margin-left:calc(-1*var(--swc-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=bottom]{padding-block:var(--swc-overlay-animation-distance);margin-top:calc(-1*var(--swc-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=left]{padding-inline:var(--swc-overlay-animation-distance);margin-left:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=top]{padding-block:var(--swc-overlay-animation-distance);margin-top:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=right]{padding-inline:var(--swc-overlay-animation-distance);margin-left:calc(-1*var(--swc-overlay-animation-distance))}.dialog[actual-placement*=bottom]{padding-block:var(--swc-overlay-animation-distance);margin-top:calc(-1*var(--swc-overlay-animation-distance))}.dialog[actual-placement*=left]{padding-inline:var(--swc-overlay-animation-distance);margin-left:var(--swc-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1;--mod-popover-filter:var(--spectrum-popover-filter)}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1;--mod-popover-filter:var(--spectrum-popover-filter)}}@supports (overlay:auto){.dialog{transition:all var(--mod-overlay-animation-duration,var(--spectrum-animation-duration-100,.13s)),translate 0s,display var(--mod-overlay-animation-duration,var(--spectrum-animation-duration-100,.13s));transition-behavior:allow-discrete;display:none}.dialog:popover-open,.dialog:modal{display:flex}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:calc(var(--swc-overlay-z-index-base,1000) + var(--swc-overlay-open-count))}}
5
+ `;
6
+ export default styles;
7
+ //# sourceMappingURL=overlay.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["overlay.css.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{pointer-events:none;--swc-overlay-animation-distance:var(--spectrum-spacing-100);display:contents}:host(:has(>sp-tooltip)){--swc-overlay-animation-distance:var(--spectrum-tooltip-animation-distance)}.dialog{box-sizing:border-box;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);height:auto;--sp-overlay-open:true;background:0 0;border:0;margin:0;padding:0;display:flex;position:fixed;inset:0 auto auto 0;overflow:visible;opacity:1!important}.dialog:not([is-visible]){display:none}.dialog:focus{outline:none}dialog:modal{--mod-popover-filter:var(--spectrum-popover-filter)}:host(:not([open])) .dialog{--sp-overlay-open:false}.dialog::backdrop{display:none}.dialog:before{content:\"\";position:absolute;inset:-999em;pointer-events:auto!important}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto;visibility:visible!important}::slotted(sp-popover){position:static}.dialog:not([actual-placement])[placement*=top]{padding-block:var(--swc-overlay-animation-distance);margin-top:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{padding-inline:var(--swc-overlay-animation-distance);margin-left:calc(-1*var(--swc-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=bottom]{padding-block:var(--swc-overlay-animation-distance);margin-top:calc(-1*var(--swc-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=left]{padding-inline:var(--swc-overlay-animation-distance);margin-left:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=top]{padding-block:var(--swc-overlay-animation-distance);margin-top:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=right]{padding-inline:var(--swc-overlay-animation-distance);margin-left:calc(-1*var(--swc-overlay-animation-distance))}.dialog[actual-placement*=bottom]{padding-block:var(--swc-overlay-animation-distance);margin-top:calc(-1*var(--swc-overlay-animation-distance))}.dialog[actual-placement*=left]{padding-inline:var(--swc-overlay-animation-distance);margin-left:var(--swc-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1;--mod-popover-filter:var(--spectrum-popover-filter)}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1;--mod-popover-filter:var(--spectrum-popover-filter)}}@supports (overlay:auto){.dialog{transition:all var(--mod-overlay-animation-duration,var(--spectrum-animation-duration-100,.13s)),translate 0s,display var(--mod-overlay-animation-duration,var(--spectrum-animation-duration-100,.13s));transition-behavior:allow-discrete;display:none}.dialog:popover-open,.dialog:modal{display:flex}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:calc(var(--swc-overlay-z-index-base,1000) + var(--swc-overlay-open-count))}}\n`;\nexport default styles;"],
5
+ "mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";import{css as a}from"@spectrum-web-components/base";const o=a`
2
+ :host{pointer-events:none;--swc-overlay-animation-distance:var(--spectrum-spacing-100);display:contents}:host(:has(>sp-tooltip)){--swc-overlay-animation-distance:var(--spectrum-tooltip-animation-distance)}.dialog{box-sizing:border-box;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);height:auto;--sp-overlay-open:true;background:0 0;border:0;margin:0;padding:0;display:flex;position:fixed;inset:0 auto auto 0;overflow:visible;opacity:1!important}.dialog:not([is-visible]){display:none}.dialog:focus{outline:none}dialog:modal{--mod-popover-filter:var(--spectrum-popover-filter)}:host(:not([open])) .dialog{--sp-overlay-open:false}.dialog::backdrop{display:none}.dialog:before{content:"";position:absolute;inset:-999em;pointer-events:auto!important}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto;visibility:visible!important}::slotted(sp-popover){position:static}.dialog:not([actual-placement])[placement*=top]{padding-block:var(--swc-overlay-animation-distance);margin-top:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{padding-inline:var(--swc-overlay-animation-distance);margin-left:calc(-1*var(--swc-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=bottom]{padding-block:var(--swc-overlay-animation-distance);margin-top:calc(-1*var(--swc-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=left]{padding-inline:var(--swc-overlay-animation-distance);margin-left:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=top]{padding-block:var(--swc-overlay-animation-distance);margin-top:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=right]{padding-inline:var(--swc-overlay-animation-distance);margin-left:calc(-1*var(--swc-overlay-animation-distance))}.dialog[actual-placement*=bottom]{padding-block:var(--swc-overlay-animation-distance);margin-top:calc(-1*var(--swc-overlay-animation-distance))}.dialog[actual-placement*=left]{padding-inline:var(--swc-overlay-animation-distance);margin-left:var(--swc-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1;--mod-popover-filter:var(--spectrum-popover-filter)}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1;--mod-popover-filter:var(--spectrum-popover-filter)}}@supports (overlay:auto){.dialog{transition:all var(--mod-overlay-animation-duration,var(--spectrum-animation-duration-100,.13s)),translate 0s,display var(--mod-overlay-animation-duration,var(--spectrum-animation-duration-100,.13s));transition-behavior:allow-discrete;display:none}.dialog:popover-open,.dialog:modal{display:flex}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:calc(var(--swc-overlay-z-index-base,1000) + var(--swc-overlay-open-count))}}
3
+ `;export default o;
4
+ //# sourceMappingURL=overlay.css.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["overlay.css.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{pointer-events:none;--swc-overlay-animation-distance:var(--spectrum-spacing-100);display:contents}:host(:has(>sp-tooltip)){--swc-overlay-animation-distance:var(--spectrum-tooltip-animation-distance)}.dialog{box-sizing:border-box;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);height:auto;--sp-overlay-open:true;background:0 0;border:0;margin:0;padding:0;display:flex;position:fixed;inset:0 auto auto 0;overflow:visible;opacity:1!important}.dialog:not([is-visible]){display:none}.dialog:focus{outline:none}dialog:modal{--mod-popover-filter:var(--spectrum-popover-filter)}:host(:not([open])) .dialog{--sp-overlay-open:false}.dialog::backdrop{display:none}.dialog:before{content:\"\";position:absolute;inset:-999em;pointer-events:auto!important}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto;visibility:visible!important}::slotted(sp-popover){position:static}.dialog:not([actual-placement])[placement*=top]{padding-block:var(--swc-overlay-animation-distance);margin-top:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{padding-inline:var(--swc-overlay-animation-distance);margin-left:calc(-1*var(--swc-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=bottom]{padding-block:var(--swc-overlay-animation-distance);margin-top:calc(-1*var(--swc-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=left]{padding-inline:var(--swc-overlay-animation-distance);margin-left:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=top]{padding-block:var(--swc-overlay-animation-distance);margin-top:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=right]{padding-inline:var(--swc-overlay-animation-distance);margin-left:calc(-1*var(--swc-overlay-animation-distance))}.dialog[actual-placement*=bottom]{padding-block:var(--swc-overlay-animation-distance);margin-top:calc(-1*var(--swc-overlay-animation-distance))}.dialog[actual-placement*=left]{padding-inline:var(--swc-overlay-animation-distance);margin-left:var(--swc-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1;--mod-popover-filter:var(--spectrum-popover-filter)}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1;--mod-popover-filter:var(--spectrum-popover-filter)}}@supports (overlay:auto){.dialog{transition:all var(--mod-overlay-animation-duration,var(--spectrum-animation-duration-100,.13s)),translate 0s,display var(--mod-overlay-animation-duration,var(--spectrum-animation-duration-100,.13s));transition-behavior:allow-discrete;display:none}.dialog:popover-open,.dialog:modal{display:flex}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:calc(var(--swc-overlay-z-index-base,1000) + var(--swc-overlay-open-count))}}\n`;\nexport default styles;"],
5
+ "mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
6
+ "names": ["css", "styles"]
7
+ }
@@ -0,0 +1,17 @@
1
+ import { ElementPart, TemplateResult } from '@spectrum-web-components/base';
2
+ import { AsyncDirective } from '@spectrum-web-components/base/src/async-directive.js';
3
+ import { SlottableRequestEvent } from './slottable-request-event.js';
4
+ export declare class SlottableRequestDirective extends AsyncDirective {
5
+ protected template: () => TemplateResult;
6
+ protected target: HTMLElement;
7
+ private renderBefore;
8
+ protected listenerHost: HTMLElement;
9
+ protected listeners: AbortController;
10
+ render(_template: () => TemplateResult): unknown;
11
+ update(part: ElementPart, [template]: Parameters<this['render']>): void;
12
+ handleSlottableRequest(event: SlottableRequestEvent): void;
13
+ init(): void;
14
+ disconnected(): void;
15
+ reconnected(): void;
16
+ }
17
+ export declare const slottableRequest: (_template: () => TemplateResult) => import("lit-html/directive.js").DirectiveResult<typeof SlottableRequestDirective>;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ import {
3
+ nothing,
4
+ render
5
+ } from "@spectrum-web-components/base";
6
+ import {
7
+ AsyncDirective,
8
+ directive
9
+ } from "@spectrum-web-components/base/src/async-directive.js";
10
+ import {
11
+ removeSlottableRequest
12
+ } from "./slottable-request-event.dev.js";
13
+ export class SlottableRequestDirective extends AsyncDirective {
14
+ /* c8 ignore next 9 */
15
+ render(_template) {
16
+ return nothing;
17
+ }
18
+ update(part, [template]) {
19
+ this.template = template;
20
+ if (this.target !== part.element) {
21
+ this.target = part.element;
22
+ this.renderBefore = this.target.children[0];
23
+ }
24
+ this.listenerHost = this.target;
25
+ this.init();
26
+ }
27
+ handleSlottableRequest(event) {
28
+ if (event.target !== event.currentTarget) return;
29
+ const willRemoveSlottable = event.data === removeSlottableRequest;
30
+ render(willRemoveSlottable ? void 0 : this.template(), this.target, {
31
+ renderBefore: this.renderBefore
32
+ });
33
+ }
34
+ init() {
35
+ var _a;
36
+ (_a = this.listeners) == null ? void 0 : _a.abort();
37
+ this.listeners = new AbortController();
38
+ const { signal } = this.listeners;
39
+ this.listenerHost.addEventListener(
40
+ "slottable-request",
41
+ (event) => this.handleSlottableRequest(event),
42
+ { signal }
43
+ );
44
+ if (true) {
45
+ window.__swc.warn(
46
+ void 0,
47
+ `\u26A0\uFE0F WARNING \u26A0\uFE0F : The Overlay Trigger Directive is experimental and there is no guarantees behind its usage in an application!! Its API and presence within the library could be changed at anytime. See "sp-overlay" or "Overlay.open()" for a stable API for overlaying content on your application.`,
48
+ "https://opensource.adobe.com/spectrum-web-components/components/overlay",
49
+ {
50
+ level: "high",
51
+ type: "api"
52
+ }
53
+ );
54
+ }
55
+ }
56
+ disconnected() {
57
+ var _a;
58
+ (_a = this.listeners) == null ? void 0 : _a.abort();
59
+ }
60
+ /* c8 ignore next 3 */
61
+ reconnected() {
62
+ this.init();
63
+ }
64
+ }
65
+ export const slottableRequest = directive(SlottableRequestDirective);
66
+ //# sourceMappingURL=slottable-request-directive.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["slottable-request-directive.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2023 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 {\n ElementPart,\n nothing,\n render,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n AsyncDirective,\n directive,\n} from '@spectrum-web-components/base/src/async-directive.js';\nimport {\n removeSlottableRequest,\n SlottableRequestEvent,\n} from './slottable-request-event.dev.js'\n\nexport class SlottableRequestDirective extends AsyncDirective {\n protected template!: () => TemplateResult;\n protected target!: HTMLElement;\n private renderBefore: HTMLElement | undefined;\n protected listenerHost!: HTMLElement;\n protected listeners!: AbortController;\n\n /* c8 ignore next 9 */\n render(_template: () => TemplateResult): unknown {\n // render function here just defines the interface to the update call later\n // we don't have anything to render since this is intended to be an ElementPart directive\n // so will be used on an element and is not itself rendered\n return nothing;\n }\n\n override update(\n part: ElementPart,\n [template]: Parameters<this['render']>\n ): void {\n this.template = template;\n if (this.target !== part.element) {\n this.target = part.element as HTMLElement;\n this.renderBefore = this.target.children[0] as HTMLElement;\n }\n this.listenerHost = this.target;\n this.init();\n }\n\n handleSlottableRequest(event: SlottableRequestEvent): void {\n /* c8 ignore next 1 */\n if (event.target !== event.currentTarget) return;\n\n const willRemoveSlottable = event.data === removeSlottableRequest;\n\n render(willRemoveSlottable ? undefined : this.template(), this.target, {\n renderBefore: this.renderBefore,\n });\n }\n\n init(): void {\n this.listeners?.abort();\n this.listeners = new AbortController();\n const { signal } = this.listeners;\n this.listenerHost.addEventListener(\n 'slottable-request',\n (event: Event) =>\n this.handleSlottableRequest(event as SlottableRequestEvent),\n { signal }\n );\n\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n undefined,\n `\u26A0\uFE0F WARNING \u26A0\uFE0F : The Overlay Trigger Directive is experimental and there is no guarantees behind its usage in an application!! Its API and presence within the library could be changed at anytime. See \"sp-overlay\" or \"Overlay.open()\" for a stable API for overlaying content on your application.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/overlay',\n {\n level: 'high',\n type: 'api',\n }\n );\n }\n }\n\n override disconnected(): void {\n this.listeners?.abort();\n }\n\n /* c8 ignore next 3 */\n override reconnected(): void {\n this.init();\n }\n}\n\nexport const slottableRequest = directive(SlottableRequestDirective);\n"],
5
+ "mappings": ";AAWA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP;AAAA,EACI;AAAA,OAEG;AAEA,aAAM,kCAAkC,eAAe;AAAA;AAAA,EAQ1D,OAAO,WAA0C;AAI7C,WAAO;AAAA,EACX;AAAA,EAES,OACL,MACA,CAAC,QAAQ,GACL;AACJ,SAAK,WAAW;AAChB,QAAI,KAAK,WAAW,KAAK,SAAS;AAC9B,WAAK,SAAS,KAAK;AACnB,WAAK,eAAe,KAAK,OAAO,SAAS,CAAC;AAAA,IAC9C;AACA,SAAK,eAAe,KAAK;AACzB,SAAK,KAAK;AAAA,EACd;AAAA,EAEA,uBAAuB,OAAoC;AAEvD,QAAI,MAAM,WAAW,MAAM,cAAe;AAE1C,UAAM,sBAAsB,MAAM,SAAS;AAE3C,WAAO,sBAAsB,SAAY,KAAK,SAAS,GAAG,KAAK,QAAQ;AAAA,MACnE,cAAc,KAAK;AAAA,IACvB,CAAC;AAAA,EACL;AAAA,EAEA,OAAa;AAjEjB;AAkEQ,eAAK,cAAL,mBAAgB;AAChB,SAAK,YAAY,IAAI,gBAAgB;AACrC,UAAM,EAAE,OAAO,IAAI,KAAK;AACxB,SAAK,aAAa;AAAA,MACd;AAAA,MACA,CAAC,UACG,KAAK,uBAAuB,KAA8B;AAAA,MAC9D,EAAE,OAAO;AAAA,IACb;AAEA,QAAI,MAAoB;AACpB,aAAO,MAAM;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,UACI,OAAO;AAAA,UACP,MAAM;AAAA,QACV;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAAA,EAES,eAAqB;AAzFlC;AA0FQ,eAAK,cAAL,mBAAgB;AAAA,EACpB;AAAA;AAAA,EAGS,cAAoB;AACzB,SAAK,KAAK;AAAA,EACd;AACJ;AAEO,aAAM,mBAAmB,UAAU,yBAAyB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";import{nothing as n,render as i}from"@spectrum-web-components/base";import{AsyncDirective as s,directive as o}from"@spectrum-web-components/base/src/async-directive.js";import{removeSlottableRequest as l}from"./slottable-request-event.js";export class SlottableRequestDirective extends s{render(e){return n}update(e,[t]){this.template=t,this.target!==e.element&&(this.target=e.element,this.renderBefore=this.target.children[0]),this.listenerHost=this.target,this.init()}handleSlottableRequest(e){if(e.target!==e.currentTarget)return;const t=e.data===l;i(t?void 0:this.template(),this.target,{renderBefore:this.renderBefore})}init(){var t;(t=this.listeners)==null||t.abort(),this.listeners=new AbortController;const{signal:e}=this.listeners;this.listenerHost.addEventListener("slottable-request",r=>this.handleSlottableRequest(r),{signal:e})}disconnected(){var e;(e=this.listeners)==null||e.abort()}reconnected(){this.init()}}export const slottableRequest=o(SlottableRequestDirective);
2
+ //# sourceMappingURL=slottable-request-directive.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["slottable-request-directive.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2023 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 {\n ElementPart,\n nothing,\n render,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n AsyncDirective,\n directive,\n} from '@spectrum-web-components/base/src/async-directive.js';\nimport {\n removeSlottableRequest,\n SlottableRequestEvent,\n} from './slottable-request-event.js';\n\nexport class SlottableRequestDirective extends AsyncDirective {\n protected template!: () => TemplateResult;\n protected target!: HTMLElement;\n private renderBefore: HTMLElement | undefined;\n protected listenerHost!: HTMLElement;\n protected listeners!: AbortController;\n\n /* c8 ignore next 9 */\n render(_template: () => TemplateResult): unknown {\n // render function here just defines the interface to the update call later\n // we don't have anything to render since this is intended to be an ElementPart directive\n // so will be used on an element and is not itself rendered\n return nothing;\n }\n\n override update(\n part: ElementPart,\n [template]: Parameters<this['render']>\n ): void {\n this.template = template;\n if (this.target !== part.element) {\n this.target = part.element as HTMLElement;\n this.renderBefore = this.target.children[0] as HTMLElement;\n }\n this.listenerHost = this.target;\n this.init();\n }\n\n handleSlottableRequest(event: SlottableRequestEvent): void {\n /* c8 ignore next 1 */\n if (event.target !== event.currentTarget) return;\n\n const willRemoveSlottable = event.data === removeSlottableRequest;\n\n render(willRemoveSlottable ? undefined : this.template(), this.target, {\n renderBefore: this.renderBefore,\n });\n }\n\n init(): void {\n this.listeners?.abort();\n this.listeners = new AbortController();\n const { signal } = this.listeners;\n this.listenerHost.addEventListener(\n 'slottable-request',\n (event: Event) =>\n this.handleSlottableRequest(event as SlottableRequestEvent),\n { signal }\n );\n\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n undefined,\n `\u26A0\uFE0F WARNING \u26A0\uFE0F : The Overlay Trigger Directive is experimental and there is no guarantees behind its usage in an application!! Its API and presence within the library could be changed at anytime. See \"sp-overlay\" or \"Overlay.open()\" for a stable API for overlaying content on your application.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/overlay',\n {\n level: 'high',\n type: 'api',\n }\n );\n }\n }\n\n override disconnected(): void {\n this.listeners?.abort();\n }\n\n /* c8 ignore next 3 */\n override reconnected(): void {\n this.init();\n }\n}\n\nexport const slottableRequest = directive(SlottableRequestDirective);\n"],
5
+ "mappings": "aAWA,OAEI,WAAAA,EACA,UAAAC,MAEG,gCACP,OACI,kBAAAC,EACA,aAAAC,MACG,uDACP,OACI,0BAAAC,MAEG,+BAEA,aAAM,kCAAkCF,CAAe,CAQ1D,OAAOG,EAA0C,CAI7C,OAAOL,CACX,CAES,OACLM,EACA,CAACC,CAAQ,EACL,CACJ,KAAK,SAAWA,EACZ,KAAK,SAAWD,EAAK,UACrB,KAAK,OAASA,EAAK,QACnB,KAAK,aAAe,KAAK,OAAO,SAAS,CAAC,GAE9C,KAAK,aAAe,KAAK,OACzB,KAAK,KAAK,CACd,CAEA,uBAAuBE,EAAoC,CAEvD,GAAIA,EAAM,SAAWA,EAAM,cAAe,OAE1C,MAAMC,EAAsBD,EAAM,OAASJ,EAE3CH,EAAOQ,EAAsB,OAAY,KAAK,SAAS,EAAG,KAAK,OAAQ,CACnE,aAAc,KAAK,YACvB,CAAC,CACL,CAEA,MAAa,CAjEjB,IAAAC,GAkEQA,EAAA,KAAK,YAAL,MAAAA,EAAgB,QAChB,KAAK,UAAY,IAAI,gBACrB,KAAM,CAAE,OAAAC,CAAO,EAAI,KAAK,UACxB,KAAK,aAAa,iBACd,oBACCH,GACG,KAAK,uBAAuBA,CAA8B,EAC9D,CAAE,OAAAG,CAAO,CACb,CAaJ,CAES,cAAqB,CAzFlC,IAAAD,GA0FQA,EAAA,KAAK,YAAL,MAAAA,EAAgB,OACpB,CAGS,aAAoB,CACzB,KAAK,KAAK,CACd,CACJ,CAEO,aAAM,iBAAmBP,EAAU,yBAAyB",
6
+ "names": ["nothing", "render", "AsyncDirective", "directive", "removeSlottableRequest", "_template", "part", "template", "event", "willRemoveSlottable", "_a", "signal"]
7
+ }
@@ -0,0 +1,12 @@
1
+ export declare class SlottableRequestEvent extends Event {
2
+ readonly data: unknown;
3
+ readonly name: string;
4
+ readonly slotName: string;
5
+ constructor(name: string, data: unknown, key?: string);
6
+ }
7
+ export declare const removeSlottableRequest: unique symbol;
8
+ declare global {
9
+ interface GlobalEventHandlersEventMap {
10
+ 'slottable-request': SlottableRequestEvent;
11
+ }
12
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ export class SlottableRequestEvent extends Event {
3
+ constructor(name, data, key) {
4
+ super("slottable-request", {
5
+ bubbles: false,
6
+ cancelable: true,
7
+ composed: false
8
+ });
9
+ this.name = name;
10
+ this.data = data;
11
+ this.slotName = key !== void 0 ? `${name}.${key}` : name;
12
+ if (true) {
13
+ window.__swc.warn(
14
+ void 0,
15
+ `\u26A0\uFE0F WARNING \u26A0\uFE0F : \`slottable-request\` events are experimental and there is no guarantees behind usage of them in an application!! Their shape and presence within the library could be changed at anytime.
16
+
17
+ Learn more about the protocol these events are based on below:`,
18
+ "https://github.com/webcomponents-cg/community-protocols/pull/45",
19
+ {
20
+ level: "high",
21
+ type: "api"
22
+ }
23
+ );
24
+ }
25
+ }
26
+ }
27
+ export const removeSlottableRequest = Symbol("remove-slottable-request");
28
+ //# sourceMappingURL=slottable-request-event.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["slottable-request-event.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2024 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\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport class SlottableRequestEvent extends Event {\n readonly data: unknown;\n readonly name: string;\n readonly slotName: string;\n constructor(name: string, data: unknown, key?: string) {\n super('slottable-request', {\n bubbles: false,\n cancelable: true,\n composed: false,\n });\n this.name = name;\n this.data = data;\n this.slotName = key !== undefined ? `${name}.${key}` : name;\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n undefined,\n `\u26A0\uFE0F WARNING \u26A0\uFE0F : \\`slottable-request\\` events are experimental and there is no guarantees behind usage of them in an application!! Their shape and presence within the library could be changed at anytime.\n \nLearn more about the protocol these events are based on below:`,\n 'https://github.com/webcomponents-cg/community-protocols/pull/45',\n {\n level: 'high',\n type: 'api',\n }\n );\n }\n }\n}\n\nexport const removeSlottableRequest = Symbol('remove-slottable-request');\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n 'slottable-request': SlottableRequestEvent;\n }\n}\n"],
5
+ "mappings": ";AAWO,aAAM,8BAA8B,MAAM;AAAA,EAI7C,YAAY,MAAc,MAAe,KAAc;AACnD,UAAM,qBAAqB;AAAA,MACvB,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,UAAU;AAAA,IACd,CAAC;AACD,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,WAAW,QAAQ,SAAY,GAAG,IAAI,IAAI,GAAG,KAAK;AACvD,QAAI,MAAoB;AACpB,aAAO,MAAM;AAAA,QACT;AAAA,QACA;AAAA;AAAA;AAAA,QAGA;AAAA,QACA;AAAA,UACI,OAAO;AAAA,UACP,MAAM;AAAA,QACV;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;AAEO,aAAM,yBAAyB,OAAO,0BAA0B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";export class SlottableRequestEvent extends Event{constructor(e,n,t){super("slottable-request",{bubbles:!1,cancelable:!0,composed:!1}),this.name=e,this.data=n,this.slotName=t!==void 0?`${e}.${t}`:e}}export const removeSlottableRequest=Symbol("remove-slottable-request");
2
+ //# sourceMappingURL=slottable-request-event.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["slottable-request-event.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2024 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\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport class SlottableRequestEvent extends Event {\n readonly data: unknown;\n readonly name: string;\n readonly slotName: string;\n constructor(name: string, data: unknown, key?: string) {\n super('slottable-request', {\n bubbles: false,\n cancelable: true,\n composed: false,\n });\n this.name = name;\n this.data = data;\n this.slotName = key !== undefined ? `${name}.${key}` : name;\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n undefined,\n `\u26A0\uFE0F WARNING \u26A0\uFE0F : \\`slottable-request\\` events are experimental and there is no guarantees behind usage of them in an application!! Their shape and presence within the library could be changed at anytime.\n \nLearn more about the protocol these events are based on below:`,\n 'https://github.com/webcomponents-cg/community-protocols/pull/45',\n {\n level: 'high',\n type: 'api',\n }\n );\n }\n }\n}\n\nexport const removeSlottableRequest = Symbol('remove-slottable-request');\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n 'slottable-request': SlottableRequestEvent;\n }\n}\n"],
5
+ "mappings": "aAWO,aAAM,8BAA8B,KAAM,CAI7C,YAAYA,EAAcC,EAAeC,EAAc,CACnD,MAAM,oBAAqB,CACvB,QAAS,GACT,WAAY,GACZ,SAAU,EACd,CAAC,EACD,KAAK,KAAOF,EACZ,KAAK,KAAOC,EACZ,KAAK,SAAWC,IAAQ,OAAY,GAAGF,CAAI,IAAIE,CAAG,GAAKF,CAc3D,CACJ,CAEO,aAAM,uBAAyB,OAAO,0BAA0B",
6
+ "names": ["name", "data", "key"]
7
+ }
@@ -0,0 +1,8 @@
1
+ import { ClickController } from './ClickController.js';
2
+ import { HoverController } from './HoverController.js';
3
+ import { LongpressController } from './LongpressController.js';
4
+ export declare const strategies: {
5
+ click: typeof ClickController;
6
+ longpress: typeof LongpressController;
7
+ hover: typeof HoverController;
8
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ import { ClickController } from "./ClickController.dev.js";
3
+ import { HoverController } from "./HoverController.dev.js";
4
+ import { LongpressController } from "./LongpressController.dev.js";
5
+ export const strategies = {
6
+ click: ClickController,
7
+ longpress: LongpressController,
8
+ hover: HoverController
9
+ };
10
+ //# sourceMappingURL=strategies.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["strategies.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { ClickController } from './ClickController.dev.js'\nimport { HoverController } from './HoverController.dev.js'\nimport { LongpressController } from './LongpressController.dev.js'\n\nexport const strategies = {\n click: ClickController,\n longpress: LongpressController,\n hover: HoverController,\n};\n"],
5
+ "mappings": ";AAYA,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;AAChC,SAAS,2BAA2B;AAE7B,aAAM,aAAa;AAAA,EACtB,OAAO;AAAA,EACP,WAAW;AAAA,EACX,OAAO;AACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";import{ClickController as o}from"./ClickController.js";import{HoverController as r}from"./HoverController.js";import{LongpressController as e}from"./LongpressController.js";export const strategies={click:o,longpress:e,hover:r};
2
+ //# sourceMappingURL=strategies.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["strategies.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { ClickController } from './ClickController.js';\nimport { HoverController } from './HoverController.js';\nimport { LongpressController } from './LongpressController.js';\n\nexport const strategies = {\n click: ClickController,\n longpress: LongpressController,\n hover: HoverController,\n};\n"],
5
+ "mappings": "aAYA,OAAS,mBAAAA,MAAuB,uBAChC,OAAS,mBAAAC,MAAuB,uBAChC,OAAS,uBAAAC,MAA2B,2BAE7B,aAAM,WAAa,CACtB,MAAOF,EACP,UAAWE,EACX,MAAOD,CACX",
6
+ "names": ["ClickController", "HoverController", "LongpressController"]
7
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ import { html } from "@spectrum-web-components/base";
3
+ function nextFrame() {
4
+ return new Promise((res) => requestAnimationFrame(() => res()));
5
+ }
6
+ class IsOverlayOpen extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this.sendFocus = async () => {
10
+ var _a;
11
+ const selectedItem = (_a = document.querySelector("[focusable]")) == null ? void 0 : _a.querySelector("[selected]");
12
+ if (selectedItem) {
13
+ selectedItem.focus();
14
+ selectedItem.focused = true;
15
+ }
16
+ };
17
+ this.handleOpened = async (event) => {
18
+ const overlay = event.target;
19
+ const actions = [nextFrame(), overlay.updateComplete, this.sendFocus()];
20
+ await Promise.all(actions);
21
+ await nextFrame();
22
+ await nextFrame();
23
+ await nextFrame();
24
+ await nextFrame();
25
+ this.ready(true);
26
+ };
27
+ this.readyPromise = Promise.resolve(false);
28
+ this.readyPromise = new Promise((res) => {
29
+ this.ready = res;
30
+ this.setup();
31
+ });
32
+ }
33
+ async setup() {
34
+ await nextFrame();
35
+ document.addEventListener("sp-opened", this.handleOpened);
36
+ }
37
+ get updateComplete() {
38
+ return this.readyPromise;
39
+ }
40
+ }
41
+ customElements.define("is-overlay-open", IsOverlayOpen);
42
+ export const isOverlayOpen = (story) => {
43
+ return html`
44
+ ${story()}
45
+ <is-overlay-open></is-overlay-open>
46
+ `;
47
+ };
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport type { Overlay } from '@spectrum-web-components/overlay';\n\nfunction nextFrame(): Promise<void> {\n return new Promise((res) => requestAnimationFrame(() => res()));\n}\n\nclass IsOverlayOpen extends HTMLElement {\n ready!: (value: boolean | PromiseLike<boolean>) => void;\n\n constructor() {\n super();\n this.readyPromise = new Promise((res) => {\n this.ready = res;\n this.setup();\n });\n }\n\n async setup(): Promise<void> {\n await nextFrame();\n document.addEventListener('sp-opened', this.handleOpened);\n }\n\n private sendFocus = async (): Promise<void> => {\n const selectedItem = document\n .querySelector('[focusable]')\n ?.querySelector('[selected]') as HTMLElement & {\n focused?: boolean;\n };\n\n if (selectedItem) {\n selectedItem.focus();\n selectedItem.focused = true;\n }\n };\n\n handleOpened = async (event: Event): Promise<void> => {\n const overlay = event.target as Overlay;\n const actions = [nextFrame(), overlay.updateComplete, this.sendFocus()];\n\n await Promise.all(actions);\n // Focus happens _after_ `sp-opened` by at least two frames.\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n\n this.ready(true);\n };\n\n private readyPromise: Promise<boolean> = Promise.resolve(false);\n\n get updateComplete(): Promise<boolean> {\n return this.readyPromise;\n }\n}\n\ncustomElements.define('is-overlay-open', IsOverlayOpen);\n\nexport const isOverlayOpen = (story: () => TemplateResult): TemplateResult => {\n return html`\n ${story()}\n <is-overlay-open></is-overlay-open>\n `;\n};\n"],
5
+ "mappings": ";AAYA,SAAS,YAA4B;AAGrC,SAAS,YAA2B;AAChC,SAAO,IAAI,QAAQ,CAAC,QAAQ,sBAAsB,MAAM,IAAI,CAAC,CAAC;AAClE;AAEA,MAAM,sBAAsB,YAAY;AAAA,EAGpC,cAAc;AACV,UAAM;AAYV,SAAQ,YAAY,YAA2B;AAnCnD;AAoCQ,YAAM,gBAAe,cAChB,cAAc,aAAa,MADX,mBAEf,cAAc;AAIpB,UAAI,cAAc;AACd,qBAAa,MAAM;AACnB,qBAAa,UAAU;AAAA,MAC3B;AAAA,IACJ;AAEA,wBAAe,OAAO,UAAgC;AAClD,YAAM,UAAU,MAAM;AACtB,YAAM,UAAU,CAAC,UAAU,GAAG,QAAQ,gBAAgB,KAAK,UAAU,CAAC;AAEtE,YAAM,QAAQ,IAAI,OAAO;AAEzB,YAAM,UAAU;AAChB,YAAM,UAAU;AAChB,YAAM,UAAU;AAChB,YAAM,UAAU;AAEhB,WAAK,MAAM,IAAI;AAAA,IACnB;AAEA,SAAQ,eAAiC,QAAQ,QAAQ,KAAK;AAtC1D,SAAK,eAAe,IAAI,QAAQ,CAAC,QAAQ;AACrC,WAAK,QAAQ;AACb,WAAK,MAAM;AAAA,IACf,CAAC;AAAA,EACL;AAAA,EAEA,MAAM,QAAuB;AACzB,UAAM,UAAU;AAChB,aAAS,iBAAiB,aAAa,KAAK,YAAY;AAAA,EAC5D;AAAA,EA+BA,IAAI,iBAAmC;AACnC,WAAO,KAAK;AAAA,EAChB;AACJ;AAEA,eAAe,OAAO,mBAAmB,aAAa;AAE/C,aAAM,gBAAgB,CAAC,UAAgD;AAC1E,SAAO;AAAA,UACD,MAAM,CAAC;AAAA;AAAA;AAGjB;",
6
+ "names": []
7
+ }