@spectrum-web-components/overlay 0.34.0 → 0.34.1-rc.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.
Files changed (155) hide show
  1. package/README.md +227 -152
  2. package/custom-elements.json +1401 -541
  3. package/package.json +48 -22
  4. package/sp-overlay.d.ts +6 -0
  5. package/sp-overlay.dev.js +5 -0
  6. package/{active-overlay.dev.js.map → sp-overlay.dev.js.map} +3 -3
  7. package/sp-overlay.js +2 -0
  8. package/{active-overlay.js.map → sp-overlay.js.map} +4 -4
  9. package/src/Overlay.d.ts +29 -0
  10. package/src/Overlay.dev.js +91 -0
  11. package/src/Overlay.dev.js.map +7 -0
  12. package/src/Overlay.js +2 -0
  13. package/src/Overlay.js.map +7 -0
  14. package/src/OverlayBase.d.ts +124 -0
  15. package/src/OverlayBase.dev.js +744 -0
  16. package/src/OverlayBase.dev.js.map +7 -0
  17. package/src/OverlayBase.js +31 -0
  18. package/src/OverlayBase.js.map +7 -0
  19. package/src/OverlayDialog.d.ts +8 -0
  20. package/src/OverlayDialog.dev.js +160 -0
  21. package/src/OverlayDialog.dev.js.map +7 -0
  22. package/src/OverlayDialog.js +2 -0
  23. package/src/OverlayDialog.js.map +7 -0
  24. package/src/OverlayNoPopover.d.ts +8 -0
  25. package/src/OverlayNoPopover.dev.js +149 -0
  26. package/src/OverlayNoPopover.dev.js.map +7 -0
  27. package/src/OverlayNoPopover.js +2 -0
  28. package/src/OverlayNoPopover.js.map +7 -0
  29. package/src/OverlayPopover.d.ts +8 -0
  30. package/src/OverlayPopover.dev.js +199 -0
  31. package/src/OverlayPopover.dev.js.map +7 -0
  32. package/src/OverlayPopover.js +2 -0
  33. package/src/OverlayPopover.js.map +7 -0
  34. package/src/OverlayStack.d.ts +29 -0
  35. package/src/OverlayStack.dev.js +126 -0
  36. package/src/OverlayStack.dev.js.map +7 -0
  37. package/src/OverlayStack.js +2 -0
  38. package/src/OverlayStack.js.map +7 -0
  39. package/src/OverlayTrigger.d.ts +23 -31
  40. package/src/OverlayTrigger.dev.js +135 -245
  41. package/src/OverlayTrigger.dev.js.map +3 -3
  42. package/src/OverlayTrigger.js +52 -22
  43. package/src/OverlayTrigger.js.map +3 -3
  44. package/src/PlacementController.d.ts +36 -0
  45. package/src/PlacementController.dev.js +191 -0
  46. package/src/PlacementController.dev.js.map +7 -0
  47. package/src/PlacementController.js +2 -0
  48. package/src/PlacementController.js.map +7 -0
  49. package/src/VirtualTrigger.dev.js +0 -2
  50. package/src/VirtualTrigger.dev.js.map +2 -2
  51. package/src/VirtualTrigger.js +1 -1
  52. package/src/VirtualTrigger.js.map +3 -3
  53. package/src/fullSizePlugin.d.ts +12 -0
  54. package/src/fullSizePlugin.dev.js +39 -0
  55. package/src/fullSizePlugin.dev.js.map +7 -0
  56. package/src/fullSizePlugin.js +2 -0
  57. package/src/fullSizePlugin.js.map +7 -0
  58. package/src/index.d.ts +2 -3
  59. package/src/index.dev.js +2 -3
  60. package/src/index.dev.js.map +2 -2
  61. package/src/index.js +1 -1
  62. package/src/index.js.map +2 -2
  63. package/src/loader.d.ts +2 -2
  64. package/src/loader.dev.js +2 -19
  65. package/src/loader.dev.js.map +2 -2
  66. package/src/loader.js +1 -1
  67. package/src/loader.js.map +3 -3
  68. package/src/overlay-base.css.dev.js +9 -0
  69. package/src/overlay-base.css.dev.js.map +7 -0
  70. package/src/overlay-base.css.js +6 -0
  71. package/src/overlay-base.css.js.map +7 -0
  72. package/src/overlay-trigger.css.dev.js +1 -1
  73. package/src/overlay-trigger.css.dev.js.map +1 -1
  74. package/src/overlay-trigger.css.js +1 -1
  75. package/src/overlay-trigger.css.js.map +1 -1
  76. package/src/overlay-types.d.ts +7 -5
  77. package/src/overlay-types.dev.js +1 -0
  78. package/src/overlay-types.dev.js.map +3 -3
  79. package/src/overlay-types.js +1 -1
  80. package/src/overlay-types.js.map +3 -3
  81. package/src/topLayerOverTransforms.d.ts +23 -0
  82. package/src/topLayerOverTransforms.dev.js +170 -0
  83. package/src/topLayerOverTransforms.dev.js.map +7 -0
  84. package/src/topLayerOverTransforms.js +2 -0
  85. package/src/topLayerOverTransforms.js.map +7 -0
  86. package/stories/overlay-element.stories.js +247 -0
  87. package/stories/overlay-element.stories.js.map +7 -0
  88. package/stories/overlay-story-components.js +9 -8
  89. package/stories/overlay-story-components.js.map +2 -2
  90. package/stories/overlay.stories.js +780 -683
  91. package/stories/overlay.stories.js.map +2 -2
  92. package/sync/overlay-trigger.d.ts +4 -0
  93. package/sync/overlay-trigger.dev.js +1 -4
  94. package/sync/overlay-trigger.dev.js.map +2 -2
  95. package/sync/overlay-trigger.js +1 -1
  96. package/sync/overlay-trigger.js.map +3 -3
  97. package/test/benchmark/basic-test.js +1 -1
  98. package/test/benchmark/basic-test.js.map +1 -1
  99. package/test/index.js +407 -376
  100. package/test/index.js.map +3 -3
  101. package/test/overlay-element.test-vrt.js +5 -0
  102. package/test/overlay-element.test-vrt.js.map +7 -0
  103. package/test/overlay-element.test.js +682 -0
  104. package/test/overlay-element.test.js.map +7 -0
  105. package/test/overlay-lifecycle.test.js +34 -106
  106. package/test/overlay-lifecycle.test.js.map +2 -2
  107. package/test/overlay-trigger-click.test.js +11 -5
  108. package/test/overlay-trigger-click.test.js.map +2 -2
  109. package/test/overlay-trigger-extended.test.js +1 -6
  110. package/test/overlay-trigger-extended.test.js.map +2 -2
  111. package/test/overlay-trigger-hover-click.test.js +23 -23
  112. package/test/overlay-trigger-hover-click.test.js.map +2 -2
  113. package/test/overlay-trigger-hover.test.js +40 -34
  114. package/test/overlay-trigger-hover.test.js.map +2 -2
  115. package/test/overlay-trigger-longpress.test.js +98 -80
  116. package/test/overlay-trigger-longpress.test.js.map +2 -2
  117. package/test/overlay-trigger-sync.test.js +1 -1
  118. package/test/overlay-trigger-sync.test.js.map +2 -2
  119. package/test/overlay-trigger.test.js +1 -1
  120. package/test/overlay-trigger.test.js.map +2 -2
  121. package/test/overlay-update.test.js +4 -4
  122. package/test/overlay-update.test.js.map +2 -2
  123. package/test/{overlay.test.js → overlay-v1.test.js} +267 -249
  124. package/test/overlay-v1.test.js.map +7 -0
  125. package/test/overlay-v2.test.js +720 -0
  126. package/test/overlay-v2.test.js.map +7 -0
  127. package/active-overlay.d.ts +0 -6
  128. package/active-overlay.dev.js +0 -5
  129. package/active-overlay.js +0 -2
  130. package/src/ActiveOverlay.d.ts +0 -84
  131. package/src/ActiveOverlay.dev.js +0 -517
  132. package/src/ActiveOverlay.dev.js.map +0 -7
  133. package/src/ActiveOverlay.js +0 -16
  134. package/src/ActiveOverlay.js.map +0 -7
  135. package/src/active-overlay.css.dev.js +0 -13
  136. package/src/active-overlay.css.dev.js.map +0 -7
  137. package/src/active-overlay.css.js +0 -10
  138. package/src/active-overlay.css.js.map +0 -7
  139. package/src/overlay-stack.d.ts +0 -50
  140. package/src/overlay-stack.dev.js +0 -515
  141. package/src/overlay-stack.dev.js.map +0 -7
  142. package/src/overlay-stack.js +0 -34
  143. package/src/overlay-stack.js.map +0 -7
  144. package/src/overlay-utils.d.ts +0 -3
  145. package/src/overlay-utils.dev.js +0 -31
  146. package/src/overlay-utils.dev.js.map +0 -7
  147. package/src/overlay-utils.js +0 -2
  148. package/src/overlay-utils.js.map +0 -7
  149. package/src/overlay.d.ts +0 -59
  150. package/src/overlay.dev.js +0 -127
  151. package/src/overlay.dev.js.map +0 -7
  152. package/src/overlay.js +0 -2
  153. package/src/overlay.js.map +0 -7
  154. package/test/overlay.test.js.map +0 -7
  155. /package/src/{active-overlay.css.d.ts → overlay-base.css.d.ts} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["PlacementController.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport {\n arrow,\n autoUpdate,\n computePosition,\n flip,\n offset,\n Placement,\n shift,\n size,\n} from '@floating-ui/dom';\nimport type { VirtualTrigger } from './VirtualTrigger.dev.js'\nimport { topLayerOverTransforms } from './topLayerOverTransforms.dev.js'\nimport type { OpenableElement, OverlayBase } from './OverlayBase.dev.js'\n\ntype OverlayOptionsV1 = {\n abortPromise?: Promise<boolean>;\n delayed?: boolean;\n offset?: number | [number, number]; // supporting multi-axis\n placement: Placement;\n notImmediatelyClosable?: boolean; // rename or place behind other API options\n receivesFocus?: 'auto';\n root?: HTMLElement;\n trigger: HTMLElement | VirtualTrigger;\n type?: 'modal' | 'page' | 'hint' | 'auto' | 'manual';\n};\n\nfunction roundByDPR(num?: number): number {\n if (typeof num === 'undefined') return 0;\n const dpr = window.devicePixelRatio || 1;\n return Math.round(num * dpr) / dpr ?? -10000;\n}\n\n// See: https://spectrum.adobe.com/page/popover/#Container-padding\nconst REQUIRED_DISTANCE_TO_EDGE = 8;\n// See: https://github.com/adobe/spectrum-web-components/issues/910\nconst MIN_OVERLAY_HEIGHT = 100;\n\nconst getFallbackPlacements = (placement: Placement): Placement[] => {\n const fallbacks: Record<Placement, Placement[]> = {\n left: ['right', 'bottom', 'top'],\n 'left-start': ['right-start', 'bottom', 'top'],\n 'left-end': ['right-end', 'bottom', 'top'],\n right: ['left', 'bottom', 'top'],\n 'right-start': ['left-start', 'bottom', 'top'],\n 'right-end': ['left-end', 'bottom', 'top'],\n top: ['bottom', 'left', 'right'],\n 'top-start': ['bottom-start', 'left', 'right'],\n 'top-end': ['bottom-end', 'left', 'right'],\n bottom: ['top', 'left', 'right'],\n 'bottom-start': ['top-start', 'left', 'right'],\n 'bottom-end': ['top-end', 'left', 'right'],\n };\n return fallbacks[placement] ?? [placement];\n};\n\nexport const placementUpdatedSymbol = Symbol('placement updated');\n\nexport class PlacementController implements ReactiveController {\n private cleanup?: () => void;\n\n initialHeight?: number;\n\n isConstrained?: boolean;\n\n private host!: ReactiveElement & { elements: OpenableElement[] };\n\n private options!: OverlayOptionsV1;\n\n private originalPlacements = new WeakMap<HTMLElement, Placement>();\n\n private target!: HTMLElement;\n\n constructor(host: ReactiveElement & { elements: OpenableElement[] }) {\n this.host = host;\n // Add the controller after the MutationObserver has been created in preparation\n // for the `hostConnected`/`hostDisconnected` callbacks to be run.\n this.host.addController(this);\n }\n\n public async placeOverlay(\n target: HTMLElement = this.target,\n options: OverlayOptionsV1 = this.options\n ): Promise<void> {\n this.target = target;\n this.options = options;\n if (!target || !options) return;\n\n const cleanup = autoUpdate(\n options.trigger,\n target,\n this.updatePlacement,\n {\n elementResize: false,\n }\n );\n this.cleanup = () => {\n this.host.elements?.forEach((element) => {\n element.addEventListener(\n 'sp-closed',\n () => {\n const placement = this.originalPlacements.get(element);\n if (placement) {\n element.setAttribute('placement', placement);\n }\n this.originalPlacements.delete(element);\n },\n { once: true }\n );\n });\n cleanup();\n };\n }\n\n updatePlacement = (): void => {\n if (this.options.type !== 'modal' && this.cleanup) {\n this.target.dispatchEvent(new Event('close', { bubbles: true }));\n return;\n }\n this.computePlacement();\n };\n\n async computePlacement(): Promise<void> {\n const { options, target } = this;\n\n await (document.fonts ? document.fonts.ready : Promise.resolve());\n\n const flipMiddleware = !(options.trigger instanceof HTMLElement)\n ? flip({\n padding: REQUIRED_DISTANCE_TO_EDGE,\n fallbackPlacements: getFallbackPlacements(options.placement),\n })\n : flip();\n\n const [mainAxis = 0, crossAxis = 0] = Array.isArray(options?.offset)\n ? options.offset\n : [options.offset, 0];\n\n const tipElement = this.host.elements.find(\n (el) => el.tipElement\n )?.tipElement;\n\n const middleware = [\n offset({\n mainAxis,\n crossAxis,\n }),\n shift({ padding: REQUIRED_DISTANCE_TO_EDGE }),\n flipMiddleware,\n size({\n padding: REQUIRED_DISTANCE_TO_EDGE,\n apply: ({\n availableWidth,\n availableHeight,\n rects: { floating },\n }) => {\n const maxHeight = Math.max(\n MIN_OVERLAY_HEIGHT,\n Math.floor(availableHeight)\n );\n const actualHeight = floating.height;\n this.initialHeight = !this.isConstrained // && !this.virtualTrigger\n ? actualHeight\n : this.initialHeight || actualHeight;\n this.isConstrained =\n actualHeight < this.initialHeight ||\n maxHeight <= actualHeight;\n const appliedHeight = this.isConstrained\n ? `${maxHeight}px`\n : '';\n Object.assign(target.style, {\n maxWidth: `${Math.floor(availableWidth)}px`,\n maxHeight: appliedHeight,\n height: appliedHeight,\n });\n },\n }),\n ...(tipElement ? [arrow({ element: tipElement })] : []),\n topLayerOverTransforms(),\n ];\n const { x, y, placement, middlewareData } = await computePosition(\n options.trigger,\n target,\n {\n placement: options.placement,\n middleware,\n strategy: 'fixed',\n }\n );\n Object.assign(target.style, {\n top: '0px',\n left: '0px',\n translate: `${roundByDPR(x)}px ${roundByDPR(y)}px`,\n });\n\n target.setAttribute('actual-placement', placement);\n this.host.elements?.forEach((element) => {\n this.originalPlacements.set(\n element,\n element.getAttribute('placement') as Placement\n );\n element.setAttribute('placement', placement);\n });\n\n if (tipElement && middlewareData.arrow) {\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n Object.assign(tipElement.style, {\n top:\n placement.startsWith('right') ||\n placement.startsWith('left')\n ? '0px'\n : '',\n left:\n placement.startsWith('bottom') ||\n placement.startsWith('top')\n ? '0px'\n : '',\n translate: `${roundByDPR(arrowX)}px ${roundByDPR(arrowY)}px`,\n });\n }\n }\n\n public resetOverlayPosition = (): void => {\n if (!this.target || !this.options) return;\n\n this.target.style.removeProperty('max-height');\n this.target.style.removeProperty('height');\n this.initialHeight = undefined;\n this.isConstrained = false;\n // force paint\n this.host.offsetHeight;\n this.computePlacement();\n };\n\n hostConnected(): void {\n document.addEventListener(\n 'sp-update-overlays',\n this.resetOverlayPosition\n );\n }\n\n hostUpdated(): void {\n if (!(this.host as OverlayBase).open) {\n this.cleanup?.();\n this.cleanup = undefined;\n }\n }\n\n hostDisconnected(): void {\n this.cleanup?.();\n this.cleanup = undefined;\n document.removeEventListener(\n 'sp-update-overlays',\n this.resetOverlayPosition\n );\n }\n}\n"],
5
+ "mappings": ";AAaA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OACG;AAEP,SAAS,8BAA8B;AAevC,SAAS,WAAW,KAAsB;AACtC,MAAI,OAAO,QAAQ;AAAa,WAAO;AACvC,QAAM,MAAM,OAAO,oBAAoB;AACvC,SAAO,KAAK,MAAM,MAAM,GAAG,IAAI;AACnC;AAGA,MAAM,4BAA4B;AAElC,MAAM,qBAAqB;AAE3B,MAAM,wBAAwB,CAAC,cAAsC;AAlDrE;AAmDI,QAAM,YAA4C;AAAA,IAC9C,MAAM,CAAC,SAAS,UAAU,KAAK;AAAA,IAC/B,cAAc,CAAC,eAAe,UAAU,KAAK;AAAA,IAC7C,YAAY,CAAC,aAAa,UAAU,KAAK;AAAA,IACzC,OAAO,CAAC,QAAQ,UAAU,KAAK;AAAA,IAC/B,eAAe,CAAC,cAAc,UAAU,KAAK;AAAA,IAC7C,aAAa,CAAC,YAAY,UAAU,KAAK;AAAA,IACzC,KAAK,CAAC,UAAU,QAAQ,OAAO;AAAA,IAC/B,aAAa,CAAC,gBAAgB,QAAQ,OAAO;AAAA,IAC7C,WAAW,CAAC,cAAc,QAAQ,OAAO;AAAA,IACzC,QAAQ,CAAC,OAAO,QAAQ,OAAO;AAAA,IAC/B,gBAAgB,CAAC,aAAa,QAAQ,OAAO;AAAA,IAC7C,cAAc,CAAC,WAAW,QAAQ,OAAO;AAAA,EAC7C;AACA,UAAO,eAAU,SAAS,MAAnB,YAAwB,CAAC,SAAS;AAC7C;AAEO,aAAM,yBAAyB,OAAO,mBAAmB;AAEzD,aAAM,oBAAkD;AAAA,EAe3D,YAAY,MAAyD;AAJrE,SAAQ,qBAA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flip as v,offset as M,shift as T,size as C}from"@floating-ui/dom";import{topLayerOverTransforms as R}from"./topLayerOverTransforms.js";function m(a){if(typeof a=="undefined")return 0;const t=window.devicePixelRatio||1;return Math.round(a*t)/t}const h=8,L=100,A=a=>{var e;return(e={left:["right","bottom","top"],"left-start":["right-start","bottom","top"],"left-end":["right-end","bottom","top"],right:["left","bottom","top"],"right-start":["left-start","bottom","top"],"right-end":["left-end","bottom","top"],top:["bottom","left","right"],"top-start":["bottom-start","left","right"],"top-end":["bottom-end","left","right"],bottom:["top","left","right"],"bottom-start":["top-start","left","right"],"bottom-end":["top-end","left","right"]}[a])!=null?e:[a]};export const placementUpdatedSymbol=Symbol("placement updated");export class PlacementController{constructor(t){this.originalPlacements=new WeakMap;this.updatePlacement=()=>{if(this.options.type!=="modal"&&this.cleanup){this.target.dispatchEvent(new Event("close",{bubbles:!0}));return}this.computePlacement()};this.resetOverlayPosition=()=>{!this.target||!this.options||(this.target.style.removeProperty("max-height"),this.target.style.removeProperty("height"),this.initialHeight=void 0,this.isConstrained=!1,this.host.offsetHeight,this.computePlacement())};this.host=t,this.host.addController(this)}async placeOverlay(t=this.target,e=this.options){if(this.target=t,this.options=e,!t||!e)return;const p=H(e.trigger,t,this.updatePlacement,{elementResize:!1});this.cleanup=()=>{var r;(r=this.host.elements)==null||r.forEach(s=>{s.addEventListener("sp-closed",()=>{const o=this.originalPlacements.get(s);o&&s.setAttribute("placement",o),this.originalPlacements.delete(s)},{once:!0})}),p()}}async computePlacement(){var f,g;const{options:t,target:e}=this;await(document.fonts?document.fonts.ready:Promise.resolve());const p=t.trigger instanceof HTMLElement?v():v({padding:h,fallbackPlacements:A(t.placement)}),[r=0,s=0]=Array.isArray(t==null?void 0:t.offset)?t.offset:[t.offset,0],o=(f=this.host.elements.find(i=>i.tipElement))==null?void 0:f.tipElement,y=[M({mainAxis:r,crossAxis:s}),T({padding:h}),p,C({padding:h,apply:({availableWidth:i,availableHeight:c,rects:{floating:x}})=>{const u=Math.max(L,Math.floor(c)),l=x.height;this.initialHeight=this.isConstrained&&this.initialHeight||l,this.isConstrained=l<this.initialHeight||u<=l;const b=this.isConstrained?`${u}px`:"";Object.assign(e.style,{maxWidth:`${Math.floor(i)}px`,maxHeight:b,height:b})}}),...o?[O({element:o})]:[],R()],{x:P,y:E,placement:n,middlewareData:d}=await w(t.trigger,e,{placement:t.placement,middleware:y,strategy:"fixed"});if(Object.assign(e.style,{top:"0px",left:"0px",translate:`${m(P)}px ${m(E)}px`}),e.setAttribute("actual-placement",n),(g=this.host.elements)==null||g.forEach(i=>{this.originalPlacements.set(i,i.getAttribute("placement")),i.setAttribute("placement",n)}),o&&d.arrow){const{x:i,y:c}=d.arrow;Object.assign(o.style,{top:n.startsWith("right")||n.startsWith("left")?"0px":"",left:n.startsWith("bottom")||n.startsWith("top")?"0px":"",translate:`${m(i)}px ${m(c)}px`})}}hostConnected(){document.addEventListener("sp-update-overlays",this.resetOverlayPosition)}hostUpdated(){var t;this.host.open||((t=this.cleanup)==null||t.call(this),this.cleanup=void 0)}hostDisconnected(){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0,document.removeEventListener("sp-update-overlays",this.resetOverlayPosition)}}
2
+ //# sourceMappingURL=PlacementController.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["PlacementController.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport {\n arrow,\n autoUpdate,\n computePosition,\n flip,\n offset,\n Placement,\n shift,\n size,\n} from '@floating-ui/dom';\nimport type { VirtualTrigger } from './VirtualTrigger.js';\nimport { topLayerOverTransforms } from './topLayerOverTransforms.js';\nimport type { OpenableElement, OverlayBase } from './OverlayBase.js';\n\ntype OverlayOptionsV1 = {\n abortPromise?: Promise<boolean>;\n delayed?: boolean;\n offset?: number | [number, number]; // supporting multi-axis\n placement: Placement;\n notImmediatelyClosable?: boolean; // rename or place behind other API options\n receivesFocus?: 'auto';\n root?: HTMLElement;\n trigger: HTMLElement | VirtualTrigger;\n type?: 'modal' | 'page' | 'hint' | 'auto' | 'manual';\n};\n\nfunction roundByDPR(num?: number): number {\n if (typeof num === 'undefined') return 0;\n const dpr = window.devicePixelRatio || 1;\n return Math.round(num * dpr) / dpr ?? -10000;\n}\n\n// See: https://spectrum.adobe.com/page/popover/#Container-padding\nconst REQUIRED_DISTANCE_TO_EDGE = 8;\n// See: https://github.com/adobe/spectrum-web-components/issues/910\nconst MIN_OVERLAY_HEIGHT = 100;\n\nconst getFallbackPlacements = (placement: Placement): Placement[] => {\n const fallbacks: Record<Placement, Placement[]> = {\n left: ['right', 'bottom', 'top'],\n 'left-start': ['right-start', 'bottom', 'top'],\n 'left-end': ['right-end', 'bottom', 'top'],\n right: ['left', 'bottom', 'top'],\n 'right-start': ['left-start', 'bottom', 'top'],\n 'right-end': ['left-end', 'bottom', 'top'],\n top: ['bottom', 'left', 'right'],\n 'top-start': ['bottom-start', 'left', 'right'],\n 'top-end': ['bottom-end', 'left', 'right'],\n bottom: ['top', 'left', 'right'],\n 'bottom-start': ['top-start', 'left', 'right'],\n 'bottom-end': ['top-end', 'left', 'right'],\n };\n return fallbacks[placement] ?? [placement];\n};\n\nexport const placementUpdatedSymbol = Symbol('placement updated');\n\nexport class PlacementController implements ReactiveController {\n private cleanup?: () => void;\n\n initialHeight?: number;\n\n isConstrained?: boolean;\n\n private host!: ReactiveElement & { elements: OpenableElement[] };\n\n private options!: OverlayOptionsV1;\n\n private originalPlacements = new WeakMap<HTMLElement, Placement>();\n\n private target!: HTMLElement;\n\n constructor(host: ReactiveElement & { elements: OpenableElement[] }) {\n this.host = host;\n // Add the controller after the MutationObserver has been created in preparation\n // for the `hostConnected`/`hostDisconnected` callbacks to be run.\n this.host.addController(this);\n }\n\n public async placeOverlay(\n target: HTMLElement = this.target,\n options: OverlayOptionsV1 = this.options\n ): Promise<void> {\n this.target = target;\n this.options = options;\n if (!target || !options) return;\n\n const cleanup = autoUpdate(\n options.trigger,\n target,\n this.updatePlacement,\n {\n elementResize: false,\n }\n );\n this.cleanup = () => {\n this.host.elements?.forEach((element) => {\n element.addEventListener(\n 'sp-closed',\n () => {\n const placement = this.originalPlacements.get(element);\n if (placement) {\n element.setAttribute('placement', placement);\n }\n this.originalPlacements.delete(element);\n },\n { once: true }\n );\n });\n cleanup();\n };\n }\n\n updatePlacement = (): void => {\n if (this.options.type !== 'modal' && this.cleanup) {\n this.target.dispatchEvent(new Event('close', { bubbles: true }));\n return;\n }\n this.computePlacement();\n };\n\n async computePlacement(): Promise<void> {\n const { options, target } = this;\n\n await (document.fonts ? document.fonts.ready : Promise.resolve());\n\n const flipMiddleware = !(options.trigger instanceof HTMLElement)\n ? flip({\n padding: REQUIRED_DISTANCE_TO_EDGE,\n fallbackPlacements: getFallbackPlacements(options.placement),\n })\n : flip();\n\n const [mainAxis = 0, crossAxis = 0] = Array.isArray(options?.offset)\n ? options.offset\n : [options.offset, 0];\n\n const tipElement = this.host.elements.find(\n (el) => el.tipElement\n )?.tipElement;\n\n const middleware = [\n offset({\n mainAxis,\n crossAxis,\n }),\n shift({ padding: REQUIRED_DISTANCE_TO_EDGE }),\n flipMiddleware,\n size({\n padding: REQUIRED_DISTANCE_TO_EDGE,\n apply: ({\n availableWidth,\n availableHeight,\n rects: { floating },\n }) => {\n const maxHeight = Math.max(\n MIN_OVERLAY_HEIGHT,\n Math.floor(availableHeight)\n );\n const actualHeight = floating.height;\n this.initialHeight = !this.isConstrained // && !this.virtualTrigger\n ? actualHeight\n : this.initialHeight || actualHeight;\n this.isConstrained =\n actualHeight < this.initialHeight ||\n maxHeight <= actualHeight;\n const appliedHeight = this.isConstrained\n ? `${maxHeight}px`\n : '';\n Object.assign(target.style, {\n maxWidth: `${Math.floor(availableWidth)}px`,\n maxHeight: appliedHeight,\n height: appliedHeight,\n });\n },\n }),\n ...(tipElement ? [arrow({ element: tipElement })] : []),\n topLayerOverTransforms(),\n ];\n const { x, y, placement, middlewareData } = await computePosition(\n options.trigger,\n target,\n {\n placement: options.placement,\n middleware,\n strategy: 'fixed',\n }\n );\n Object.assign(target.style, {\n top: '0px',\n left: '0px',\n translate: `${roundByDPR(x)}px ${roundByDPR(y)}px`,\n });\n\n target.setAttribute('actual-placement', placement);\n this.host.elements?.forEach((element) => {\n this.originalPlacements.set(\n element,\n element.getAttribute('placement') as Placement\n );\n element.setAttribute('placement', placement);\n });\n\n if (tipElement && middlewareData.arrow) {\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n Object.assign(tipElement.style, {\n top:\n placement.startsWith('right') ||\n placement.startsWith('left')\n ? '0px'\n : '',\n left:\n placement.startsWith('bottom') ||\n placement.startsWith('top')\n ? '0px'\n : '',\n translate: `${roundByDPR(arrowX)}px ${roundByDPR(arrowY)}px`,\n });\n }\n }\n\n public resetOverlayPosition = (): void => {\n if (!this.target || !this.options) return;\n\n this.target.style.removeProperty('max-height');\n this.target.style.removeProperty('height');\n this.initialHeight = undefined;\n this.isConstrained = false;\n // force paint\n this.host.offsetHeight;\n this.computePlacement();\n };\n\n hostConnected(): void {\n document.addEventListener(\n 'sp-update-overlays',\n this.resetOverlayPosition\n );\n }\n\n hostUpdated(): void {\n if (!(this.host as OverlayBase).open) {\n this.cleanup?.();\n this.cleanup = undefined;\n }\n }\n\n hostDisconnected(): void {\n this.cleanup?.();\n this.cleanup = undefined;\n document.removeEventListener(\n 'sp-update-overlays',\n this.resetOverlayPosition\n );\n }\n}\n"],
5
+ "mappings": "aAaA,OACI,SAAAA,EACA,cAAAC,EACA,mBAAAC,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AAOX,EAAW,MAAO,CAC5B,IACIX,EAAU,WAAW,OAAO,GAC5BA,EAAU,WAAW,MAAM,EACrB,MACA,GACV,KACIA,EAAU,WAAW,QAAQ,GAC7BA,EAAU,WAAW,KAAK,EACpB,MACA,GACV,UAAW,GAAGN,EAAW6B,CAAM,OAAO7B,EAAW8B,CAAM,KAC3D,CAAC,EAET,CAcA,eAAsB,CAClB,SAAS,iBACL,qBACA,KAAK,oBACT,CACJ,CAEA,aAAoB,CA9PxB,IAAAvB,EA+Pc,KAAK,KAAqB,QAC5BA,EAAA,KAAK,UAAL,MAAAA,EAAA,WACA,KAAK,QAAU,OAEvB,CAEA,kBAAyB,CArQ7B,IAAAA,GAsQQA,EAAA,KAAK,UAAL,MAAAA,EAAA,WACA,KAAK,QAAU,OACf,SAAS,oBACL,qBACA,KAAK,oBACT,CACJ,CACJ",
6
+ "names": ["arrow", "autoUpdate", "computePosition", "flip", "offset", "shift", "size", "topLayerOverTransforms", "roundByDPR", "num", "dpr", "REQUIRED_DISTANCE_TO_EDGE", "MIN_OVERLAY_HEIGHT", "getFallbackPlacements", "placement", "_a", "host", "target", "options", "cleanup", "element", "_b", "flipMiddleware", "mainAxis", "crossAxis", "tipElement", "el", "middleware", "availableWidth", "availableHeight", "floating", "maxHeight", "actualHeight", "appliedHeight", "x", "y", "middlewareData", "arrowX", "arrowY"]
7
+ }
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- import { Overlay } from "./overlay.dev.js";
3
2
  export class VirtualTrigger {
4
3
  constructor(x, y) {
5
4
  this.x = 0;
@@ -10,7 +9,6 @@ export class VirtualTrigger {
10
9
  updateBoundingClientRect(x, y) {
11
10
  this.x = x;
12
11
  this.y = y;
13
- Overlay.update();
14
12
  }
15
13
  getBoundingClientRect() {
16
14
  return {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["VirtualTrigger.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\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 { Overlay } from './overlay.dev.js'\n\nexport class VirtualTrigger {\n private x = 0;\n private y = 0;\n\n public constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n public updateBoundingClientRect(x: number, y: number): void {\n this.x = x;\n this.y = y;\n Overlay.update();\n }\n\n public getBoundingClientRect(): DOMRect {\n return {\n width: 0,\n height: 0,\n top: this.y,\n right: this.x,\n y: this.y,\n x: this.x,\n bottom: this.y,\n left: this.x,\n toJSON() {\n return;\n },\n };\n }\n}\n"],
5
- "mappings": ";AAWA,SAAS,eAAe;AAEjB,aAAM,eAAe;AAAA,EAIjB,YAAY,GAAW,GAAW;AAHzC,SAAQ,IAAI;AACZ,SAAQ,IAAI;AAGR,SAAK,IAAI;AACT,SAAK,IAAI;AAAA,EACb;AAAA,EAEO,yBAAyB,GAAW,GAAiB;AACxD,SAAK,IAAI;AACT,SAAK,IAAI;AACT,YAAQ,OAAO;AAAA,EACnB;AAAA,EAEO,wBAAiC;AACpC,WAAO;AAAA,MACH,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,KAAK,KAAK;AAAA,MACV,OAAO,KAAK;AAAA,MACZ,GAAG,KAAK;AAAA,MACR,GAAG,KAAK;AAAA,MACR,QAAQ,KAAK;AAAA,MACb,MAAM,KAAK;AAAA,MACX,SAAS;AACL;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;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\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\n// import { Overlay } from './overlay.dev.js'\n\nexport class VirtualTrigger {\n private x = 0;\n private y = 0;\n\n public constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n public updateBoundingClientRect(x: number, y: number): void {\n this.x = x;\n this.y = y;\n // Overlay.update();\n }\n\n public getBoundingClientRect(): DOMRect {\n return {\n width: 0,\n height: 0,\n top: this.y,\n right: this.x,\n y: this.y,\n x: this.x,\n bottom: this.y,\n left: this.x,\n toJSON() {\n return;\n },\n };\n }\n}\n"],
5
+ "mappings": ";AAaO,aAAM,eAAe;AAAA,EAIjB,YAAY,GAAW,GAAW;AAHzC,SAAQ,IAAI;AACZ,SAAQ,IAAI;AAGR,SAAK,IAAI;AACT,SAAK,IAAI;AAAA,EACb;AAAA,EAEO,yBAAyB,GAAW,GAAiB;AACxD,SAAK,IAAI;AACT,SAAK,IAAI;AAAA,EAEb;AAAA,EAEO,wBAAiC;AACpC,WAAO;AAAA,MACH,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,KAAK,KAAK;AAAA,MACV,OAAO,KAAK;AAAA,MACZ,GAAG,KAAK;AAAA,MACR,GAAG,KAAK;AAAA,MACR,QAAQ,KAAK;AAAA,MACb,MAAM,KAAK;AAAA,MACX,SAAS;AACL;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";import{Overlay as e}from"./overlay.js";export class VirtualTrigger{constructor(t,i){this.x=0;this.y=0;this.x=t,this.y=i}updateBoundingClientRect(t,i){this.x=t,this.y=i,e.update()}getBoundingClientRect(){return{width:0,height:0,top:this.y,right:this.x,y:this.y,x:this.x,bottom:this.y,left:this.x,toJSON(){}}}}
1
+ "use strict";export class VirtualTrigger{constructor(t,i){this.x=0;this.y=0;this.x=t,this.y=i}updateBoundingClientRect(t,i){this.x=t,this.y=i}getBoundingClientRect(){return{width:0,height:0,top:this.y,right:this.x,y:this.y,x:this.x,bottom:this.y,left:this.x,toJSON(){}}}}
2
2
  //# sourceMappingURL=VirtualTrigger.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["VirtualTrigger.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\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 { Overlay } from './overlay.js';\n\nexport class VirtualTrigger {\n private x = 0;\n private y = 0;\n\n public constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n public updateBoundingClientRect(x: number, y: number): void {\n this.x = x;\n this.y = y;\n Overlay.update();\n }\n\n public getBoundingClientRect(): DOMRect {\n return {\n width: 0,\n height: 0,\n top: this.y,\n right: this.x,\n y: this.y,\n x: this.x,\n bottom: this.y,\n left: this.x,\n toJSON() {\n return;\n },\n };\n }\n}\n"],
5
- "mappings": "aAWA,OAAS,WAAAA,MAAe,eAEjB,aAAM,cAAe,CAIjB,YAAYC,EAAWC,EAAW,CAHzC,KAAQ,EAAI,EACZ,KAAQ,EAAI,EAGR,KAAK,EAAID,EACT,KAAK,EAAIC,CACb,CAEO,yBAAyBD,EAAWC,EAAiB,CACxD,KAAK,EAAID,EACT,KAAK,EAAIC,EACTF,EAAQ,OAAO,CACnB,CAEO,uBAAiC,CACpC,MAAO,CACH,MAAO,EACP,OAAQ,EACR,IAAK,KAAK,EACV,MAAO,KAAK,EACZ,EAAG,KAAK,EACR,EAAG,KAAK,EACR,OAAQ,KAAK,EACb,KAAM,KAAK,EACX,QAAS,CAET,CACJ,CACJ,CACJ",
6
- "names": ["Overlay", "x", "y"]
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\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\n// import { Overlay } from './overlay.js';\n\nexport class VirtualTrigger {\n private x = 0;\n private y = 0;\n\n public constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n public updateBoundingClientRect(x: number, y: number): void {\n this.x = x;\n this.y = y;\n // Overlay.update();\n }\n\n public getBoundingClientRect(): DOMRect {\n return {\n width: 0,\n height: 0,\n top: this.y,\n right: this.x,\n y: this.y,\n x: this.x,\n bottom: this.y,\n left: this.x,\n toJSON() {\n return;\n },\n };\n }\n}\n"],
5
+ "mappings": "aAaO,aAAM,cAAe,CAIjB,YAAYA,EAAWC,EAAW,CAHzC,KAAQ,EAAI,EACZ,KAAQ,EAAI,EAGR,KAAK,EAAID,EACT,KAAK,EAAIC,CACb,CAEO,yBAAyBD,EAAWC,EAAiB,CACxD,KAAK,EAAID,EACT,KAAK,EAAIC,CAEb,CAEO,uBAAiC,CACpC,MAAO,CACH,MAAO,EACP,OAAQ,EACR,IAAK,KAAK,EACV,MAAO,KAAK,EACZ,EAAG,KAAK,EACR,EAAG,KAAK,EACR,OAAQ,KAAK,EACb,KAAM,KAAK,EACX,QAAS,CAET,CACJ,CACJ,CACJ",
6
+ "names": ["x", "y"]
7
7
  }
@@ -0,0 +1,12 @@
1
+ import { MiddlewareArguments, MiddlewareReturn } from '@floating-ui/dom';
2
+ export declare const fullSize: (options?: {
3
+ padding: number;
4
+ }) => {
5
+ name: string;
6
+ fn(middlewareArguments: MiddlewareArguments): Promise<MiddlewareReturn & {
7
+ data: {
8
+ availableWidth: number;
9
+ availableHeight: number;
10
+ };
11
+ }>;
12
+ };
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ import {
3
+ detectOverflow
4
+ } from "@floating-ui/dom";
5
+ export const fullSize = (options = { padding: 0 }) => ({
6
+ name: "fullSize",
7
+ async fn(middlewareArguments) {
8
+ var _a, _b, _c, _d;
9
+ const overflow = await detectOverflow(middlewareArguments, options);
10
+ let availableHeight = -overflow.top - overflow.bottom + middlewareArguments.rects.floating.height;
11
+ let availableWidth = -overflow.left - overflow.right + middlewareArguments.rects.floating.width;
12
+ if (middlewareArguments.placement.startsWith("bottom")) {
13
+ availableHeight -= middlewareArguments.rects.reference.height;
14
+ availableHeight -= middlewareArguments.rects.reference.y;
15
+ availableHeight -= ((_a = middlewareArguments.middlewareData.offset) == null ? void 0 : _a.y) || 0;
16
+ availableHeight += options.padding;
17
+ } else if (middlewareArguments.placement.startsWith("top")) {
18
+ availableHeight = middlewareArguments.rects.reference.y;
19
+ availableHeight -= ((_b = middlewareArguments.middlewareData.offset) == null ? void 0 : _b.y) || 0;
20
+ availableHeight += options.padding;
21
+ } else if (middlewareArguments.placement.startsWith("right")) {
22
+ availableWidth -= middlewareArguments.rects.reference.width;
23
+ availableWidth -= middlewareArguments.rects.reference.x;
24
+ availableWidth -= ((_c = middlewareArguments.middlewareData.offset) == null ? void 0 : _c.x) || 0;
25
+ availableWidth += options.padding;
26
+ } else if (middlewareArguments.placement.startsWith("left")) {
27
+ availableWidth = middlewareArguments.rects.reference.x;
28
+ availableWidth -= ((_d = middlewareArguments.middlewareData.offset) == null ? void 0 : _d.x) || 0;
29
+ availableWidth += options.padding;
30
+ }
31
+ return {
32
+ data: {
33
+ availableWidth,
34
+ availableHeight
35
+ }
36
+ };
37
+ }
38
+ });
39
+ //# sourceMappingURL=fullSizePlugin.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["fullSizePlugin.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport {\n detectOverflow,\n MiddlewareArguments,\n MiddlewareReturn,\n} from '@floating-ui/dom';\n\nexport const fullSize = (options: { padding: number } = { padding: 0 }) => ({\n name: 'fullSize',\n async fn(\n middlewareArguments: MiddlewareArguments\n ): Promise<\n MiddlewareReturn & {\n data: { availableWidth: number; availableHeight: number };\n }\n > {\n const overflow = await detectOverflow(middlewareArguments, options);\n let availableHeight =\n -overflow.top -\n overflow.bottom +\n middlewareArguments.rects.floating.height;\n let availableWidth =\n -overflow.left -\n overflow.right +\n middlewareArguments.rects.floating.width;\n if (middlewareArguments.placement.startsWith('bottom')) {\n availableHeight -= middlewareArguments.rects.reference.height;\n availableHeight -= middlewareArguments.rects.reference.y;\n availableHeight -=\n middlewareArguments.middlewareData.offset?.y || 0;\n availableHeight += options.padding;\n } else if (middlewareArguments.placement.startsWith('top')) {\n availableHeight = middlewareArguments.rects.reference.y;\n availableHeight -=\n middlewareArguments.middlewareData.offset?.y || 0;\n availableHeight += options.padding;\n } else if (middlewareArguments.placement.startsWith('right')) {\n availableWidth -= middlewareArguments.rects.reference.width;\n availableWidth -= middlewareArguments.rects.reference.x;\n availableWidth -= middlewareArguments.middlewareData.offset?.x || 0;\n availableWidth += options.padding;\n } else if (middlewareArguments.placement.startsWith('left')) {\n availableWidth = middlewareArguments.rects.reference.x;\n availableWidth -= middlewareArguments.middlewareData.offset?.x || 0;\n availableWidth += options.padding;\n }\n return {\n data: {\n availableWidth,\n availableHeight,\n },\n };\n },\n});\n"],
5
+ "mappings": ";AAWA;AAAA,EACI;AAAA,OAGG;AAEA,aAAM,WAAW,CAAC,UAA+B,EAAE,SAAS,EAAE,OAAO;AAAA,EACxE,MAAM;AAAA,EACN,MAAM,GACF,qBAKF;AAzBN;AA0BQ,UAAM,WAAW,MAAM,eAAe,qBAAqB,OAAO;AAClE,QAAI,kBACA,CAAC,SAAS,MACV,SAAS,SACT,oBAAoB,MAAM,SAAS;AACvC,QAAI,iBACA,CAAC,SAAS,OACV,SAAS,QACT,oBAAoB,MAAM,SAAS;AACvC,QAAI,oBAAoB,UAAU,WAAW,QAAQ,GAAG;AACpD,yBAAmB,oBAAoB,MAAM,UAAU;AACvD,yBAAmB,oBAAoB,MAAM,UAAU;AACvD,2BACI,yBAAoB,eAAe,WAAnC,mBAA2C,MAAK;AACpD,yBAAmB,QAAQ;AAAA,IAC/B,WAAW,oBAAoB,UAAU,WAAW,KAAK,GAAG;AACxD,wBAAkB,oBAAoB,MAAM,UAAU;AACtD,2BACI,yBAAoB,eAAe,WAAnC,mBAA2C,MAAK;AACpD,yBAAmB,QAAQ;AAAA,IAC/B,WAAW,oBAAoB,UAAU,WAAW,OAAO,GAAG;AAC1D,wBAAkB,oBAAoB,MAAM,UAAU;AACtD,wBAAkB,oBAAoB,MAAM,UAAU;AACtD,0BAAkB,yBAAoB,eAAe,WAAnC,mBAA2C,MAAK;AAClE,wBAAkB,QAAQ;AAAA,IAC9B,WAAW,oBAAoB,UAAU,WAAW,MAAM,GAAG;AACzD,uBAAiB,oBAAoB,MAAM,UAAU;AACrD,0BAAkB,yBAAoB,eAAe,WAAnC,mBAA2C,MAAK;AAClE,wBAAkB,QAAQ;AAAA,IAC9B;AACA,WAAO;AAAA,MACH,MAAM;AAAA,QACF;AAAA,QACA;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";import{detectOverflow as o}from"@floating-ui/dom";export const fullSize=(f={padding:0})=>({name:"fullSize",async fn(t){var c,l,r,h;const i=await o(t,f);let e=-i.top-i.bottom+t.rects.floating.height,a=-i.left-i.right+t.rects.floating.width;return t.placement.startsWith("bottom")?(e-=t.rects.reference.height,e-=t.rects.reference.y,e-=((c=t.middlewareData.offset)==null?void 0:c.y)||0,e+=f.padding):t.placement.startsWith("top")?(e=t.rects.reference.y,e-=((l=t.middlewareData.offset)==null?void 0:l.y)||0,e+=f.padding):t.placement.startsWith("right")?(a-=t.rects.reference.width,a-=t.rects.reference.x,a-=((r=t.middlewareData.offset)==null?void 0:r.x)||0,a+=f.padding):t.placement.startsWith("left")&&(a=t.rects.reference.x,a-=((h=t.middlewareData.offset)==null?void 0:h.x)||0,a+=f.padding),{data:{availableWidth:a,availableHeight:e}}}});
2
+ //# sourceMappingURL=fullSizePlugin.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["fullSizePlugin.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport {\n detectOverflow,\n MiddlewareArguments,\n MiddlewareReturn,\n} from '@floating-ui/dom';\n\nexport const fullSize = (options: { padding: number } = { padding: 0 }) => ({\n name: 'fullSize',\n async fn(\n middlewareArguments: MiddlewareArguments\n ): Promise<\n MiddlewareReturn & {\n data: { availableWidth: number; availableHeight: number };\n }\n > {\n const overflow = await detectOverflow(middlewareArguments, options);\n let availableHeight =\n -overflow.top -\n overflow.bottom +\n middlewareArguments.rects.floating.height;\n let availableWidth =\n -overflow.left -\n overflow.right +\n middlewareArguments.rects.floating.width;\n if (middlewareArguments.placement.startsWith('bottom')) {\n availableHeight -= middlewareArguments.rects.reference.height;\n availableHeight -= middlewareArguments.rects.reference.y;\n availableHeight -=\n middlewareArguments.middlewareData.offset?.y || 0;\n availableHeight += options.padding;\n } else if (middlewareArguments.placement.startsWith('top')) {\n availableHeight = middlewareArguments.rects.reference.y;\n availableHeight -=\n middlewareArguments.middlewareData.offset?.y || 0;\n availableHeight += options.padding;\n } else if (middlewareArguments.placement.startsWith('right')) {\n availableWidth -= middlewareArguments.rects.reference.width;\n availableWidth -= middlewareArguments.rects.reference.x;\n availableWidth -= middlewareArguments.middlewareData.offset?.x || 0;\n availableWidth += options.padding;\n } else if (middlewareArguments.placement.startsWith('left')) {\n availableWidth = middlewareArguments.rects.reference.x;\n availableWidth -= middlewareArguments.middlewareData.offset?.x || 0;\n availableWidth += options.padding;\n }\n return {\n data: {\n availableWidth,\n availableHeight,\n },\n };\n },\n});\n"],
5
+ "mappings": "aAWA,OACI,kBAAAA,MAGG,mBAEA,aAAM,SAAW,CAACC,EAA+B,CAAE,QAAS,CAAE,KAAO,CACxE,KAAM,WACN,MAAM,GACFC,EAKF,CAzBN,IAAAC,EAAAC,EAAAC,EAAAC,EA0BQ,MAAMC,EAAW,MAAMP,EAAeE,EAAqBD,CAAO,EAClE,IAAIO,EACA,CAACD,EAAS,IACVA,EAAS,OACTL,EAAoB,MAAM,SAAS,OACnCO,EACA,CAACF,EAAS,KACVA,EAAS,MACTL,EAAoB,MAAM,SAAS,MACvC,OAAIA,EAAoB,UAAU,WAAW,QAAQ,GACjDM,GAAmBN,EAAoB,MAAM,UAAU,OACvDM,GAAmBN,EAAoB,MAAM,UAAU,EACvDM,KACIL,EAAAD,EAAoB,eAAe,SAAnC,YAAAC,EAA2C,IAAK,EACpDK,GAAmBP,EAAQ,SACpBC,EAAoB,UAAU,WAAW,KAAK,GACrDM,EAAkBN,EAAoB,MAAM,UAAU,EACtDM,KACIJ,EAAAF,EAAoB,eAAe,SAAnC,YAAAE,EAA2C,IAAK,EACpDI,GAAmBP,EAAQ,SACpBC,EAAoB,UAAU,WAAW,OAAO,GACvDO,GAAkBP,EAAoB,MAAM,UAAU,MACtDO,GAAkBP,EAAoB,MAAM,UAAU,EACtDO,KAAkBJ,EAAAH,EAAoB,eAAe,SAAnC,YAAAG,EAA2C,IAAK,EAClEI,GAAkBR,EAAQ,SACnBC,EAAoB,UAAU,WAAW,MAAM,IACtDO,EAAiBP,EAAoB,MAAM,UAAU,EACrDO,KAAkBH,EAAAJ,EAAoB,eAAe,SAAnC,YAAAI,EAA2C,IAAK,EAClEG,GAAkBR,EAAQ,SAEvB,CACH,KAAM,CACF,eAAAQ,EACA,gBAAAD,CACJ,CACJ,CACJ,CACJ",
6
+ "names": ["detectOverflow", "options", "middlewareArguments", "_a", "_b", "_c", "_d", "overflow", "availableHeight", "availableWidth"]
7
+ }
package/src/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- export * from './overlay.js';
1
+ export * from './Overlay.js';
2
2
  export * from './OverlayTrigger.js';
3
3
  export * from './overlay-types.js';
4
- export * from './ActiveOverlay.js';
5
- export * from './loader.js';
6
4
  export * from './VirtualTrigger.js';
5
+ export * from './loader.js';
package/src/index.dev.js CHANGED
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
- export * from "./overlay.dev.js";
2
+ export * from "./Overlay.dev.js";
3
3
  export * from "./OverlayTrigger.dev.js";
4
4
  export * from "./overlay-types.dev.js";
5
- export * from "./ActiveOverlay.dev.js";
6
- export * from "./loader.dev.js";
7
5
  export * from "./VirtualTrigger.dev.js";
6
+ export * from "./loader.dev.js";
8
7
  //# sourceMappingURL=index.dev.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["index.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './overlay.dev.js'\nexport * from './OverlayTrigger.dev.js'\nexport * from './overlay-types.dev.js'\nexport * from './ActiveOverlay.dev.js'\nexport * from './loader.dev.js'\nexport * from './VirtualTrigger.dev.js'\n"],
5
- "mappings": ";AAWA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './Overlay.dev.js'\nexport * from './OverlayTrigger.dev.js'\nexport * from './overlay-types.dev.js'\nexport * from './VirtualTrigger.dev.js'\nexport * from './loader.dev.js'\n"],
5
+ "mappings": ";AAWA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
6
  "names": []
7
7
  }
package/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";export*from"./overlay.js";export*from"./OverlayTrigger.js";export*from"./overlay-types.js";export*from"./ActiveOverlay.js";export*from"./loader.js";export*from"./VirtualTrigger.js";
1
+ "use strict";export*from"./Overlay.js";export*from"./OverlayTrigger.js";export*from"./overlay-types.js";export*from"./VirtualTrigger.js";export*from"./loader.js";
2
2
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["index.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './overlay.js';\nexport * from './OverlayTrigger.js';\nexport * from './overlay-types.js';\nexport * from './ActiveOverlay.js';\nexport * from './loader.js';\nexport * from './VirtualTrigger.js';\n"],
5
- "mappings": "aAWA,WAAc,eACd,WAAc,sBACd,WAAc,qBACd,WAAc,qBACd,WAAc,cACd,WAAc",
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './Overlay.js';\nexport * from './OverlayTrigger.js';\nexport * from './overlay-types.js';\nexport * from './VirtualTrigger.js';\nexport * from './loader.js';\n"],
5
+ "mappings": "aAWA,WAAc,eACd,WAAc,sBACd,WAAc,qBACd,WAAc,sBACd,WAAc",
6
6
  "names": []
7
7
  }
package/src/loader.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import type { OverlayOptions, TriggerInteractions } from './overlay-types';
2
- export declare const openOverlay: (target: HTMLElement, interaction: TriggerInteractions, content: HTMLElement, options: OverlayOptions) => Promise<() => void>;
1
+ import { Overlay } from './Overlay.js';
2
+ export declare const openOverlay: typeof Overlay.open;
package/src/loader.dev.js CHANGED
@@ -1,21 +1,4 @@
1
1
  "use strict";
2
- export const openOverlay = async (target, interaction, content, options) => {
3
- if (true) {
4
- var ignoreDeprecations = window.__swc.ignoreWarningLevels.deprecation;
5
- }
6
- const { Overlay } = await import("@spectrum-web-components/overlay/src/overlay.js");
7
- if (true) {
8
- if (
9
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
10
- // @ts-ignore
11
- ignoreDeprecations && !window.__swc.ignoreWarningLevels.deprecation
12
- ) {
13
- window.__swc.ignoreWarningLevels.deprecation = ignoreDeprecations;
14
- requestAnimationFrame(() => {
15
- window.__swc.ignoreWarningLevels.deprecation = false;
16
- });
17
- }
18
- }
19
- return Overlay.open(target, interaction, content, options);
20
- };
2
+ import { Overlay } from "./Overlay.dev.js";
3
+ export const openOverlay = Overlay.open;
21
4
  //# sourceMappingURL=loader.dev.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["loader.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 { OverlayOptions, TriggerInteractions } from './overlay-types';\n\nexport const openOverlay = async (\n target: HTMLElement,\n interaction: TriggerInteractions,\n content: HTMLElement,\n options: OverlayOptions\n): Promise<() => void> => {\n if (window.__swc.DEBUG) {\n // eslint-disable-next-line no-var\n var ignoreDeprecations = window.__swc.ignoreWarningLevels.deprecation;\n }\n const { Overlay } = await import(\n '@spectrum-web-components/overlay/src/overlay.js'\n );\n if (window.__swc.DEBUG) {\n if (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n ignoreDeprecations &&\n !window.__swc.ignoreWarningLevels.deprecation\n ) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n window.__swc.ignoreWarningLevels.deprecation = ignoreDeprecations;\n requestAnimationFrame(() => {\n window.__swc.ignoreWarningLevels.deprecation = false;\n });\n }\n }\n return Overlay.open(target, interaction, content, options);\n};\n"],
5
- "mappings": ";AAcO,aAAM,cAAc,OACvB,QACA,aACA,SACA,YACsB;AACtB,MAAI,MAAoB;AAEpB,QAAI,qBAAqB,OAAO,MAAM,oBAAoB;AAAA,EAC9D;AACA,QAAM,EAAE,QAAQ,IAAI,MAAM,OACtB,iDACJ;AACA,MAAI,MAAoB;AACpB;AAAA;AAAA;AAAA,MAGI,sBACA,CAAC,OAAO,MAAM,oBAAoB;AAAA,MACpC;AAGE,aAAO,MAAM,oBAAoB,cAAc;AAC/C,4BAAsB,MAAM;AACxB,eAAO,MAAM,oBAAoB,cAAc;AAAA,MACnD,CAAC;AAAA,IACL;AAAA,EACJ;AACA,SAAO,QAAQ,KAAK,QAAQ,aAAa,SAAS,OAAO;AAC7D;",
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 { Overlay } from './Overlay.dev.js'\n\nexport const openOverlay = Overlay.open;\n"],
5
+ "mappings": ";AAYA,SAAS,eAAe;AAEjB,aAAM,cAAc,QAAQ;",
6
6
  "names": []
7
7
  }
package/src/loader.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";export const openOverlay=async(e,n,i,r)=>{if(!1)var t;const{Overlay:o}=await import("@spectrum-web-components/overlay/src/overlay.js");return o.open(e,n,i,r)};
1
+ "use strict";import{Overlay as o}from"./Overlay.js";export const openOverlay=o.open;
2
2
  //# sourceMappingURL=loader.js.map
package/src/loader.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["loader.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 { OverlayOptions, TriggerInteractions } from './overlay-types';\n\nexport const openOverlay = async (\n target: HTMLElement,\n interaction: TriggerInteractions,\n content: HTMLElement,\n options: OverlayOptions\n): Promise<() => void> => {\n if (window.__swc.DEBUG) {\n // eslint-disable-next-line no-var\n var ignoreDeprecations = window.__swc.ignoreWarningLevels.deprecation;\n }\n const { Overlay } = await import(\n '@spectrum-web-components/overlay/src/overlay.js'\n );\n if (window.__swc.DEBUG) {\n if (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n ignoreDeprecations &&\n !window.__swc.ignoreWarningLevels.deprecation\n ) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n window.__swc.ignoreWarningLevels.deprecation = ignoreDeprecations;\n requestAnimationFrame(() => {\n window.__swc.ignoreWarningLevels.deprecation = false;\n });\n }\n }\n return Overlay.open(target, interaction, content, options);\n};\n"],
5
- "mappings": "aAcO,aAAM,YAAc,MACvBA,EACAC,EACAC,EACAC,IACsB,CACtB,GAAI,GAEA,IAAIC,EAER,KAAM,CAAE,QAAAC,CAAQ,EAAI,KAAM,QACtB,iDACJ,EAgBA,OAAOA,EAAQ,KAAKL,EAAQC,EAAaC,EAASC,CAAO,CAC7D",
6
- "names": ["target", "interaction", "content", "options", "ignoreDeprecations", "Overlay"]
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 { Overlay } from './Overlay.js';\n\nexport const openOverlay = Overlay.open;\n"],
5
+ "mappings": "aAYA,OAAS,WAAAA,MAAe,eAEjB,aAAM,YAAcA,EAAQ",
6
+ "names": ["Overlay"]
7
7
  }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ import { css } from "@spectrum-web-components/base";
3
+ const styles = css`
4
+ :host{--swc-overlay-animation-distance:var(
5
+ --spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
6
+ );display:contents;pointer-events:none}.dialog{--sp-overlay-open:true;background:none;border:0;box-sizing:border-box;display:flex;margin:0;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);opacity:1!important;overflow:visible;padding:0;position:fixed}:host(:not([open])) .dialog{--sp-overlay-open:false;left:0;top:0;transform:translate(-999em,-999em)}.dialog:focus{outline:none}.dialog::backdrop{display:none}.dialog:before{content:"";inset:-999em;pointer-events:auto!important;position:absolute}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto}::slotted(sp-popover){position:static}.dialog[actual-placement*=top]{margin-top:var(--swc-overlay-animation-distance);padding-block:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=right]{margin-left:calc(var(--swc-overlay-animation-distance)*-1);padding-inline:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=bottom]{margin-top:calc(var(--swc-overlay-animation-distance)*-1);padding-block:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=left]{margin-left:var(--swc-overlay-animation-distance);padding-inline:var(--swc-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:var(--swc-overlay-z-index)}}
7
+ `;
8
+ export default styles;
9
+ //# sourceMappingURL=overlay-base.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["overlay-base.css.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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--swc-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);display:contents;pointer-events:none}.dialog{--sp-overlay-open:true;background:none;border:0;box-sizing:border-box;display:flex;margin:0;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);opacity:1!important;overflow:visible;padding:0;position:fixed}:host(:not([open])) .dialog{--sp-overlay-open:false;left:0;top:0;transform:translate(-999em,-999em)}.dialog:focus{outline:none}.dialog::backdrop{display:none}.dialog:before{content:\"\";inset:-999em;pointer-events:auto!important;position:absolute}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto}::slotted(sp-popover){position:static}.dialog[actual-placement*=top]{margin-top:var(--swc-overlay-animation-distance);padding-block:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=right]{margin-left:calc(var(--swc-overlay-animation-distance)*-1);padding-inline:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=bottom]{margin-top:calc(var(--swc-overlay-animation-distance)*-1);padding-block:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=left]{margin-left:var(--swc-overlay-animation-distance);padding-inline:var(--swc-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:var(--swc-overlay-z-index)}}\n`;\nexport default styles;"],
5
+ "mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAKf,eAAe;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";import{css as o}from"@spectrum-web-components/base";const a=o`
2
+ :host{--swc-overlay-animation-distance:var(
3
+ --spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
4
+ );display:contents;pointer-events:none}.dialog{--sp-overlay-open:true;background:none;border:0;box-sizing:border-box;display:flex;margin:0;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);opacity:1!important;overflow:visible;padding:0;position:fixed}:host(:not([open])) .dialog{--sp-overlay-open:false;left:0;top:0;transform:translate(-999em,-999em)}.dialog:focus{outline:none}.dialog::backdrop{display:none}.dialog:before{content:"";inset:-999em;pointer-events:auto!important;position:absolute}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto}::slotted(sp-popover){position:static}.dialog[actual-placement*=top]{margin-top:var(--swc-overlay-animation-distance);padding-block:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=right]{margin-left:calc(var(--swc-overlay-animation-distance)*-1);padding-inline:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=bottom]{margin-top:calc(var(--swc-overlay-animation-distance)*-1);padding-block:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=left]{margin-left:var(--swc-overlay-animation-distance);padding-inline:var(--swc-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:var(--swc-overlay-z-index)}}
5
+ `;export default a;
6
+ //# sourceMappingURL=overlay-base.css.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["overlay-base.css.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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--swc-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);display:contents;pointer-events:none}.dialog{--sp-overlay-open:true;background:none;border:0;box-sizing:border-box;display:flex;margin:0;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);opacity:1!important;overflow:visible;padding:0;position:fixed}:host(:not([open])) .dialog{--sp-overlay-open:false;left:0;top:0;transform:translate(-999em,-999em)}.dialog:focus{outline:none}.dialog::backdrop{display:none}.dialog:before{content:\"\";inset:-999em;pointer-events:auto!important;position:absolute}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto}::slotted(sp-popover){position:static}.dialog[actual-placement*=top]{margin-top:var(--swc-overlay-animation-distance);padding-block:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=right]{margin-left:calc(var(--swc-overlay-animation-distance)*-1);padding-inline:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=bottom]{margin-top:calc(var(--swc-overlay-animation-distance)*-1);padding-block:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=left]{margin-left:var(--swc-overlay-animation-distance);padding-inline:var(--swc-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:var(--swc-overlay-z-index)}}\n`;\nexport default styles;"],
5
+ "mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA;AAAA;AAAA,EAKf,eAAeC",
6
+ "names": ["css", "styles"]
7
+ }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  import { css } from "@spectrum-web-components/base";
3
3
  const styles = css`
4
- :host([disabled]) ::slotted([slot=trigger]){pointer-events:none}#overlay-content slot{display:none}
4
+ :host([disabled]) ::slotted([slot=trigger]){pointer-events:none}
5
5
  `;
6
6
  export default styles;
7
7
  //# sourceMappingURL=overlay-trigger.css.dev.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["overlay-trigger.css.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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host([disabled]) ::slotted([slot=trigger]){pointer-events:none}#overlay-content slot{display:none}\n`;\nexport default styles;"],
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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host([disabled]) ::slotted([slot=trigger]){pointer-events:none}\n`;\nexport default styles;"],
5
5
  "mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
1
  "use strict";import{css as t}from"@spectrum-web-components/base";const e=t`
2
- :host([disabled]) ::slotted([slot=trigger]){pointer-events:none}#overlay-content slot{display:none}
2
+ :host([disabled]) ::slotted([slot=trigger]){pointer-events:none}
3
3
  `;export default e;
4
4
  //# sourceMappingURL=overlay-trigger.css.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["overlay-trigger.css.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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host([disabled]) ::slotted([slot=trigger]){pointer-events:none}#overlay-content slot{display:none}\n`;\nexport default styles;"],
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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host([disabled]) ::slotted([slot=trigger]){pointer-events:none}\n`;\nexport default styles;"],
5
5
  "mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
6
6
  "names": ["css", "styles"]
7
7
  }
@@ -1,7 +1,10 @@
1
1
  import type { ThemeData } from '@spectrum-web-components/theme/src/Theme.js';
2
- import type { Placement as FloatingUIPlacement } from '@floating-ui/dom';
2
+ import type { Placement } from '@floating-ui/dom';
3
3
  import type { VirtualTrigger } from './VirtualTrigger.js';
4
- export declare type TriggerInteractions = 'click' | 'longpress' | 'hover' | 'custom' | 'replace' | 'inline' | 'modal';
4
+ export { Placement };
5
+ export declare type OverlayTypes = 'auto' | 'hint' | 'manual' | 'modal' | 'page';
6
+ export declare type TriggerInteractions = OverlayTypes;
7
+ export declare type TriggerInteractionsV1 = 'click' | 'longpress' | 'hover' | 'custom' | 'replace' | 'inline' | 'modal';
5
8
  export declare type OverlayTriggerInteractions = Extract<TriggerInteractions, 'inline' | 'modal' | 'replace'>;
6
9
  export interface OverlayOpenDetail {
7
10
  content: HTMLElement;
@@ -35,13 +38,12 @@ export interface OverlayDisplayQueryDetail {
35
38
  overlayRootElement?: HTMLElement;
36
39
  overlayContentTipElement?: HTMLElement;
37
40
  }
38
- export declare type Placement = FloatingUIPlacement | 'none';
39
- export declare type OverlayOptions = {
41
+ export declare type OverlayOptionsV1 = {
40
42
  root?: HTMLElement;
41
43
  delayed?: boolean;
42
44
  placement?: Placement;
43
45
  offset?: number;
44
- receivesFocus?: 'auto';
46
+ receivesFocus?: 'true' | 'false' | 'auto';
45
47
  notImmediatelyClosable?: boolean;
46
48
  abortPromise?: Promise<boolean>;
47
49
  virtualTrigger?: VirtualTrigger;
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
+ export {};
2
3
  //# sourceMappingURL=overlay-types.dev.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
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 { ThemeData } from '@spectrum-web-components/theme/src/Theme.js';\nimport type { Placement } from '@floating-ui/dom';\nimport type { VirtualTrigger } from './VirtualTrigger.dev.js'\n\nexport { Placement };\n\nexport type OverlayTypes = 'auto' | 'hint' | 'manual' | 'modal' | 'page';\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 OverlayOpenDetail {\n content: HTMLElement;\n contentTip?: HTMLElement;\n delayed: boolean;\n offset: number;\n skidding?: number;\n placement?: Placement;\n receivesFocus?: 'auto';\n virtualTrigger?: VirtualTrigger;\n trigger: HTMLElement;\n root?: HTMLElement;\n interaction: TriggerInteractions;\n theme: ThemeData;\n notImmediatelyClosable?: boolean;\n abortPromise?: Promise<boolean>;\n}\n\nexport interface OverlayOpenCloseDetail {\n interaction: TriggerInteractions;\n reason?: 'external-click';\n}\n\nexport interface OverlayCloseReasonDetail {\n reason?: 'external-click';\n}\n\n/**\n * Used, via an event, to query details about how an element should be shown in\n * an overlay\n */\nexport interface OverlayDisplayQueryDetail {\n overlayRootName?: string;\n overlayRootElement?: HTMLElement;\n overlayContentTipElement?: HTMLElement;\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-overlay-query': CustomEvent<OverlayDisplayQueryDetail>;\n 'sp-open': CustomEvent<OverlayOpenCloseDetail>;\n 'sp-close': CustomEvent<OverlayOpenCloseDetail>;\n }\n}\n"],
5
+ "mappings": ";AAgBA;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";
1
+ "use strict";export{};
2
2
  //# sourceMappingURL=overlay-types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
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 { ThemeData } from '@spectrum-web-components/theme/src/Theme.js';\nimport type { Placement } from '@floating-ui/dom';\nimport type { VirtualTrigger } from './VirtualTrigger.js';\n\nexport { Placement };\n\nexport type OverlayTypes = 'auto' | 'hint' | 'manual' | 'modal' | 'page';\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 OverlayOpenDetail {\n content: HTMLElement;\n contentTip?: HTMLElement;\n delayed: boolean;\n offset: number;\n skidding?: number;\n placement?: Placement;\n receivesFocus?: 'auto';\n virtualTrigger?: VirtualTrigger;\n trigger: HTMLElement;\n root?: HTMLElement;\n interaction: TriggerInteractions;\n theme: ThemeData;\n notImmediatelyClosable?: boolean;\n abortPromise?: Promise<boolean>;\n}\n\nexport interface OverlayOpenCloseDetail {\n interaction: TriggerInteractions;\n reason?: 'external-click';\n}\n\nexport interface OverlayCloseReasonDetail {\n reason?: 'external-click';\n}\n\n/**\n * Used, via an event, to query details about how an element should be shown in\n * an overlay\n */\nexport interface OverlayDisplayQueryDetail {\n overlayRootName?: string;\n overlayRootElement?: HTMLElement;\n overlayContentTipElement?: HTMLElement;\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-overlay-query': CustomEvent<OverlayDisplayQueryDetail>;\n 'sp-open': CustomEvent<OverlayOpenCloseDetail>;\n 'sp-close': CustomEvent<OverlayOpenCloseDetail>;\n }\n}\n"],
5
+ "mappings": "aAgBA",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,23 @@
1
+ import type { MiddlewareArguments } from '@floating-ui/dom';
2
+ export declare const topLayerOverTransforms: () => {
3
+ name: string;
4
+ fn(middlewareArguments: MiddlewareArguments): Promise<{
5
+ x: number;
6
+ y: number;
7
+ data: {
8
+ x: number;
9
+ y: number;
10
+ };
11
+ }>;
12
+ };
13
+ export declare function isLastTraversableNode(node: Node): boolean;
14
+ export declare function isSafari(): boolean;
15
+ export declare function getUAString(): string;
16
+ export declare function getParentNode(node: Node): Node;
17
+ export declare function getNodeName(node: Node | Window): string;
18
+ export declare function getDocumentElement(node: Node | Window): HTMLElement;
19
+ export declare function isNode(value: any): value is Node;
20
+ export declare function isWindow(value: any): value is Window;
21
+ export declare function getWindow(node: Node | Window): Window;
22
+ export declare function isShadowRoot(node: Node): node is ShadowRoot;
23
+ export declare function isHTMLElement(value: any): value is HTMLElement;