@spectrum-web-components/overlay 0.41.0 → 0.41.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 (100) hide show
  1. package/custom-elements.json +996 -314
  2. package/package.json +31 -7
  3. package/src/AbstractOverlay.d.ts +13 -3
  4. package/src/AbstractOverlay.dev.js +54 -19
  5. package/src/AbstractOverlay.dev.js.map +2 -2
  6. package/src/AbstractOverlay.js +1 -1
  7. package/src/AbstractOverlay.js.map +3 -3
  8. package/src/ClickController.d.ts +14 -0
  9. package/src/ClickController.dev.js +42 -0
  10. package/src/ClickController.dev.js.map +7 -0
  11. package/src/ClickController.js +2 -0
  12. package/src/ClickController.js.map +7 -0
  13. package/src/HoverController.d.ts +19 -0
  14. package/src/HoverController.dev.js +141 -0
  15. package/src/HoverController.dev.js.map +7 -0
  16. package/src/HoverController.js +2 -0
  17. package/src/HoverController.js.map +7 -0
  18. package/src/InteractionController.d.ts +23 -0
  19. package/src/InteractionController.dev.js +45 -0
  20. package/src/InteractionController.dev.js.map +7 -0
  21. package/src/InteractionController.js +2 -0
  22. package/src/InteractionController.js.map +7 -0
  23. package/src/LongpressController.d.ts +21 -0
  24. package/src/LongpressController.dev.js +157 -0
  25. package/src/LongpressController.dev.js.map +7 -0
  26. package/src/LongpressController.js +2 -0
  27. package/src/LongpressController.js.map +7 -0
  28. package/src/Overlay.d.ts +17 -50
  29. package/src/Overlay.dev.js +86 -363
  30. package/src/Overlay.dev.js.map +2 -2
  31. package/src/Overlay.js +10 -10
  32. package/src/Overlay.js.map +3 -3
  33. package/src/OverlayDialog.dev.js +8 -1
  34. package/src/OverlayDialog.dev.js.map +2 -2
  35. package/src/OverlayDialog.js +1 -1
  36. package/src/OverlayDialog.js.map +3 -3
  37. package/src/OverlayNoPopover.dev.js +9 -3
  38. package/src/OverlayNoPopover.dev.js.map +2 -2
  39. package/src/OverlayNoPopover.js +1 -1
  40. package/src/OverlayNoPopover.js.map +3 -3
  41. package/src/OverlayPopover.dev.js +10 -1
  42. package/src/OverlayPopover.dev.js.map +2 -2
  43. package/src/OverlayPopover.js +1 -1
  44. package/src/OverlayPopover.js.map +3 -3
  45. package/src/OverlayStack.dev.js +3 -0
  46. package/src/OverlayStack.dev.js.map +2 -2
  47. package/src/OverlayStack.js +1 -1
  48. package/src/OverlayStack.js.map +2 -2
  49. package/src/index.d.ts +1 -0
  50. package/src/index.dev.js +1 -0
  51. package/src/index.dev.js.map +2 -2
  52. package/src/index.js +1 -1
  53. package/src/index.js.map +2 -2
  54. package/src/overlay-trigger-directive.d.ts +31 -0
  55. package/src/overlay-trigger-directive.dev.js +102 -0
  56. package/src/overlay-trigger-directive.dev.js.map +7 -0
  57. package/src/overlay-trigger-directive.js +2 -0
  58. package/src/overlay-trigger-directive.js.map +7 -0
  59. package/src/overlay-trigger.css.dev.js +1 -1
  60. package/src/overlay-trigger.css.dev.js.map +1 -1
  61. package/src/overlay-trigger.css.js +1 -1
  62. package/src/overlay-trigger.css.js.map +1 -1
  63. package/src/overlay-types.d.ts +7 -0
  64. package/src/overlay-types.dev.js.map +1 -1
  65. package/src/overlay-types.js.map +1 -1
  66. package/src/overlay.css.dev.js +1 -3
  67. package/src/overlay.css.dev.js.map +2 -2
  68. package/src/overlay.css.js +1 -3
  69. package/src/overlay.css.js.map +2 -2
  70. package/src/slottable-request-event.d.ts +7 -0
  71. package/src/slottable-request-event.dev.js +28 -0
  72. package/src/slottable-request-event.dev.js.map +7 -0
  73. package/src/slottable-request-event.js +2 -0
  74. package/src/slottable-request-event.js.map +7 -0
  75. package/stories/overlay-directive.stories.js +203 -0
  76. package/stories/overlay-directive.stories.js.map +7 -0
  77. package/stories/overlay-element.stories.js +44 -1
  78. package/stories/overlay-element.stories.js.map +2 -2
  79. package/stories/overlay.stories.js +9 -9
  80. package/stories/overlay.stories.js.map +2 -2
  81. package/test/benchmark/basic-test.js +24 -1
  82. package/test/benchmark/basic-test.js.map +2 -2
  83. package/test/benchmark/directive-test.js +42 -0
  84. package/test/benchmark/directive-test.js.map +7 -0
  85. package/test/benchmark/element-test.js +40 -0
  86. package/test/benchmark/element-test.js.map +7 -0
  87. package/test/benchmark/lazy-test.js +48 -0
  88. package/test/benchmark/lazy-test.js.map +7 -0
  89. package/test/index.js +11 -176
  90. package/test/index.js.map +2 -2
  91. package/test/overlay-directive.test-vrt.js +5 -0
  92. package/test/overlay-directive.test-vrt.js.map +7 -0
  93. package/test/overlay-directive.test.js +147 -0
  94. package/test/overlay-directive.test.js.map +7 -0
  95. package/test/overlay-element.test.js +152 -1
  96. package/test/overlay-element.test.js.map +2 -2
  97. package/test/overlay-trigger-directive.test.js +75 -0
  98. package/test/overlay-trigger-directive.test.js.map +7 -0
  99. package/test/overlay-trigger-extended.test.js +1 -1
  100. package/test/overlay-trigger-extended.test.js.map +2 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["OverlayStack.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\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\nconst supportsPopover = 'showPopover' in document.createElement('div');\n\nclass OverlayStack {\n private get document(): Document {\n return this.root.ownerDocument /* c8 ignore next */ || document;\n }\n\n private pointerdownPath?: EventTarget[];\n\n private lastOverlay?: Overlay;\n\n private root: HTMLElement = document.body;\n\n stack: Overlay[] = [];\n\n constructor() {\n this.bindEvents();\n }\n\n bindEvents(): void {\n this.document.addEventListener('pointerdown', this.handlePointerdown);\n this.document.addEventListener('pointerup', this.handlePointerup);\n this.document.addEventListener('keydown', this.handleKeydown);\n }\n\n private closeOverlay(overlay: Overlay): void {\n const overlayIndex = this.stack.indexOf(overlay);\n if (overlayIndex > -1) {\n this.stack.splice(overlayIndex, 1);\n }\n overlay.open = false;\n }\n\n /**\n * Cach the `pointerdownTarget` for later testing\n *\n * @param event {ClickEvent}\n */\n handlePointerdown = (event: Event): void => {\n this.pointerdownPath = event.composedPath();\n this.lastOverlay = this.stack.at(-1);\n };\n\n /**\n * Close all overlays that are not ancestors of this click event\n *\n * @param event {ClickEvent}\n */\n handlePointerup = (): void => {\n if (!this.stack.length) return;\n if (!this.pointerdownPath?.length) return;\n\n // Test against the composed path in `pointerdown` in case the visitor moved their\n // pointer during the course of the interaction.\n const composedPath = this.pointerdownPath;\n this.pointerdownPath = undefined;\n const lastIndex = this.stack.length - 1;\n const nonAncestorOverlays = this.stack.filter((overlay, i) => {\n const inStack = composedPath.find(\n (el) =>\n // The Overlay is in the stack\n el === overlay ||\n // The Overlay trigger is in the stack and the Overlay is a \"hint\"\n (el === overlay?.triggerElement &&\n 'hint' === overlay?.type) ||\n // The last Overlay in the stack is not the last Overlay at `pointerdown` time and has a\n // `triggerInteraction` of \"longpress\", meaning it was opened by this poitner interaction\n (i === lastIndex &&\n overlay !== this.lastOverlay &&\n overlay.triggerInteraction === 'longpress')\n );\n return (\n !inStack &&\n !overlay.shouldPreventClose() &&\n overlay.type !== 'manual'\n );\n }) as Overlay[];\n nonAncestorOverlays.reverse();\n nonAncestorOverlays.forEach((overlay) => {\n this.closeOverlay(overlay);\n let parentToClose = overlay.parentOverlayToForceClose;\n while (parentToClose) {\n this.closeOverlay(parentToClose);\n parentToClose = parentToClose.parentOverlayToForceClose;\n }\n });\n };\n\n handleBeforetoggle = (event: Event): void => {\n const { target, newState: open } = event as Event & {\n newState: string;\n };\n if (open === 'open') return;\n this.closeOverlay(target as Overlay);\n };\n\n private handleKeydown = (event: KeyboardEvent): void => {\n if (event.code !== 'Escape') return;\n if (!this.stack.length) return;\n const last = this.stack.at(-1);\n if (last?.type === 'page') {\n event.preventDefault();\n return;\n }\n if (supportsPopover) return;\n\n if (!last) return;\n this.closeOverlay(last);\n };\n\n /**\n * Get an array of Overlays that all share the same trigger element.\n *\n * @param triggerElement {HTMLELement}\n * @returns {Overlay[]}\n */\n overlaysByTriggerElement(triggerElement: HTMLElement): Overlay[] {\n return this.stack.filter(\n (overlay) => overlay.triggerElement === triggerElement\n );\n }\n\n /**\n * When overlays are added manage the open state of exisiting overlays appropriately:\n * - 'modal': should close other overlays\n * - 'page': should close other overlays\n * - 'hint': shouldn't close other overlays\n * - 'auto': should close other 'auto' overlays and other 'hint' overlays, but not 'manual' overlays\n * - 'manual': shouldn't close other overlays\n */\n add(overlay: Overlay): void {\n if (this.stack.includes(overlay)) {\n const overlayIndex = this.stack.indexOf(overlay);\n if (overlayIndex > -1) {\n this.stack.splice(overlayIndex, 1);\n this.stack.push(overlay);\n }\n return;\n }\n if (\n overlay.type === 'auto' ||\n overlay.type === 'modal' ||\n overlay.type === 'page'\n ) {\n // manage closing open overlays\n const queryPathEventName = 'sp-overlay-query-path';\n const queryPathEvent = new Event(queryPathEventName, {\n composed: true,\n bubbles: true,\n });\n overlay.addEventListener(\n queryPathEventName,\n (event: Event) => {\n const path = event.composedPath();\n this.stack.forEach((overlayEl) => {\n const inPath = path.find((el) => el === overlayEl);\n if (!inPath && overlayEl.type !== 'manual') {\n this.closeOverlay(overlayEl);\n }\n });\n },\n { once: true }\n );\n overlay.dispatchEvent(queryPathEvent);\n } else if (overlay.type === 'hint') {\n this.stack.forEach((overlayEl) => {\n if (overlayEl.type === 'hint') {\n this.closeOverlay(overlayEl);\n }\n });\n }\n requestAnimationFrame(() => {\n this.stack.push(overlay);\n overlay.addEventListener('beforetoggle', this.handleBeforetoggle, {\n once: true,\n });\n });\n }\n\n remove(overlay: Overlay): void {\n this.closeOverlay(overlay);\n }\n}\n\nexport const overlayStack = new OverlayStack();\n"],
5
- "mappings": "aAaA,MAAMA,EAAkB,gBAAiB,SAAS,cAAc,KAAK,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KAAK,MAAM,KAAKZ,CAAO,EACvBA,EAAQ,iBAAiB,eAAgB,KAAK,mBAAoB,CAC9D,KAAM,EACV,CAAC,CACL,CAAC,CACL,CAEA,OAAOA,EAAwB,CAC3B,KAAK,aAAaA,CAAO,CAC7B,CACJ,CAEO,aAAM,aAAe,IAAIN",
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\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\nconst supportsPopover = 'showPopover' in document.createElement('div');\n\nclass OverlayStack {\n private get document(): Document {\n return this.root.ownerDocument /* c8 ignore next */ || document;\n }\n\n private pointerdownPath?: EventTarget[];\n\n private lastOverlay?: Overlay;\n\n private root: HTMLElement = document.body;\n\n stack: Overlay[] = [];\n\n constructor() {\n this.bindEvents();\n }\n\n bindEvents(): void {\n this.document.addEventListener('pointerdown', this.handlePointerdown);\n this.document.addEventListener('pointerup', this.handlePointerup);\n this.document.addEventListener('keydown', this.handleKeydown);\n }\n\n private closeOverlay(overlay: Overlay): void {\n const overlayIndex = this.stack.indexOf(overlay);\n if (overlayIndex > -1) {\n this.stack.splice(overlayIndex, 1);\n }\n overlay.open = false;\n }\n\n /**\n * Cach the `pointerdownTarget` for later testing\n *\n * @param event {ClickEvent}\n */\n handlePointerdown = (event: Event): void => {\n this.pointerdownPath = event.composedPath();\n this.lastOverlay = this.stack.at(-1);\n };\n\n /**\n * Close all overlays that are not ancestors of this click event\n *\n * @param event {ClickEvent}\n */\n handlePointerup = (): void => {\n if (!this.stack.length) return;\n if (!this.pointerdownPath?.length) return;\n\n // Test against the composed path in `pointerdown` in case the visitor moved their\n // pointer during the course of the interaction.\n const composedPath = this.pointerdownPath;\n this.pointerdownPath = undefined;\n const lastIndex = this.stack.length - 1;\n const nonAncestorOverlays = this.stack.filter((overlay, i) => {\n const inStack = composedPath.find(\n (el) =>\n // The Overlay is in the stack\n el === overlay ||\n // The Overlay trigger is in the stack and the Overlay is a \"hint\"\n (el === overlay?.triggerElement &&\n 'hint' === overlay?.type) ||\n // The last Overlay in the stack is not the last Overlay at `pointerdown` time and has a\n // `triggerInteraction` of \"longpress\", meaning it was opened by this poitner interaction\n (i === lastIndex &&\n overlay !== this.lastOverlay &&\n overlay.triggerInteraction === 'longpress')\n );\n return (\n !inStack &&\n !overlay.shouldPreventClose() &&\n overlay.type !== 'manual'\n );\n }) as Overlay[];\n nonAncestorOverlays.reverse();\n nonAncestorOverlays.forEach((overlay) => {\n this.closeOverlay(overlay);\n let parentToClose = overlay.parentOverlayToForceClose;\n while (parentToClose) {\n this.closeOverlay(parentToClose);\n parentToClose = parentToClose.parentOverlayToForceClose;\n }\n });\n };\n\n handleBeforetoggle = (event: Event): void => {\n const { target, newState: open } = event as Event & {\n newState: string;\n };\n if (open === 'open') return;\n this.closeOverlay(target as Overlay);\n };\n\n private handleKeydown = (event: KeyboardEvent): void => {\n if (event.code !== 'Escape') return;\n if (!this.stack.length) return;\n const last = this.stack.at(-1);\n if (last?.type === 'page') {\n event.preventDefault();\n return;\n }\n if (supportsPopover) return;\n if (last?.type === 'manual') {\n // Manual Overlays should not close on \"light dismiss\".\n return;\n }\n\n if (!last) return;\n this.closeOverlay(last);\n };\n\n /**\n * Get an array of Overlays that all share the same trigger element.\n *\n * @param triggerElement {HTMLELement}\n * @returns {Overlay[]}\n */\n overlaysByTriggerElement(triggerElement: HTMLElement): Overlay[] {\n return this.stack.filter(\n (overlay) => overlay.triggerElement === triggerElement\n );\n }\n\n /**\n * When overlays are added manage the open state of exisiting overlays appropriately:\n * - 'modal': should close other overlays\n * - 'page': should close other overlays\n * - 'hint': shouldn't close other overlays\n * - 'auto': should close other 'auto' overlays and other 'hint' overlays, but not 'manual' overlays\n * - 'manual': shouldn't close other overlays\n */\n add(overlay: Overlay): void {\n if (this.stack.includes(overlay)) {\n const overlayIndex = this.stack.indexOf(overlay);\n if (overlayIndex > -1) {\n this.stack.splice(overlayIndex, 1);\n this.stack.push(overlay);\n }\n return;\n }\n if (\n overlay.type === 'auto' ||\n overlay.type === 'modal' ||\n overlay.type === 'page'\n ) {\n // manage closing open overlays\n const queryPathEventName = 'sp-overlay-query-path';\n const queryPathEvent = new Event(queryPathEventName, {\n composed: true,\n bubbles: true,\n });\n overlay.addEventListener(\n queryPathEventName,\n (event: Event) => {\n const path = event.composedPath();\n this.stack.forEach((overlayEl) => {\n const inPath = path.find((el) => el === overlayEl);\n if (!inPath && overlayEl.type !== 'manual') {\n this.closeOverlay(overlayEl);\n }\n });\n },\n { once: true }\n );\n overlay.dispatchEvent(queryPathEvent);\n } else if (overlay.type === 'hint') {\n this.stack.forEach((overlayEl) => {\n if (overlayEl.type === 'hint') {\n this.closeOverlay(overlayEl);\n }\n });\n }\n requestAnimationFrame(() => {\n this.stack.push(overlay);\n overlay.addEventListener('beforetoggle', this.handleBeforetoggle, {\n once: true,\n });\n });\n }\n\n remove(overlay: Overlay): void {\n this.closeOverlay(overlay);\n }\n}\n\nexport const overlayStack = new OverlayStack();\n"],
5
+ "mappings": "aAaA,MAAMA,EAAkB,gBAAiB,SAAS,cAAc,KAAK,EAErE,MAAMC,CAAa,CAaf,aAAc,CAJd,KAAQ,KAAoB,SAAS,KAErC,WAAmB,CAAC,EAyBpB,uBAAqBC,GAAuB,CACxC,KAAK,gBAAkBA,EAAM,aAAa,EAC1C,KAAK,YAAc,KAAK,MAAM,GAAG,EAAE,CACvC,EAOA,qBAAkB,IAAY,CA7DlC,IAAAC,EA+DQ,GADI,CAAC,KAAK,MAAM,QACZ,GAACA,EAAA,KAAK,kBAAL,MAAAA,EAAsB,QAAQ,OAInC,MAAMC,EAAe,KAAK,gB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,IACf,KAAK,MAAM,OAAOA,EAAc,CAAC,EAErCP,EAAQ,KAAO,EACnB,CAyFA,yBAAyBQ,EAAwC,CAC7D,OAAO,KAAK,MAAM,OACbR,GAAYA,EAAQ,iBAAmBQ,CAC5C,CACJ,CAUA,IAAIR,EAAwB,CACxB,GAAI,KAAK,MAAM,SAASA,CAAO,EAAG,CAC9B,MAAMO,EAAe,KAAK,MAAM,QAAQP,CAAO,EAC3CO,EAAe,KACf,KAAK,MAAM,OAAOA,EAAc,CAAC,EACjC,KAAK,MAAM,KAAKP,CAAO,GAE3B,MACJ,CACA,GACIA,EAAQ,OAAS,QACjBA,EAAQ,OAAS,SACjBA,EAAQ,OAAS,OACnB,CAEE,MAAMS,EAAqB,wBACrBC,EAAiB,IAAI,MAAMD,EAAoB,CACjD,SAAU,GACV,QAAS,EACb,CAAC,EACDT,EAAQ,iBACJS,EACCd,GAAiB,CACd,MAAMgB,EAAOhB,EAAM,aAAa,EAChC,KAAK,MAAM,QAASiB,GAAc,CAE1B,CADWD,EAAK,KAAMT,GAAOA,IAAOU,CAAS,GAClCA,EAAU,OAAS,UAC9B,KAAK,aAAaA,CAAS,CAEnC,CAAC,CACL,EACA,CAAE,KAAM,EAAK,CACjB,EACAZ,EAAQ,cAAcU,CAAc,CACxC,MAAWV,EAAQ,OAAS,QACxB,KAAK,MAAM,QAASY,GAAc,CAC1BA,EAAU,OAAS,QACnB,KAAK,aAAaA,CAAS,CAEnC,CAAC,EAEL,sBAAsB,IAAM,CACxB,KAAK,MAAM,KAAKZ,CAAO,EACvBA,EAAQ,iBAAiB,eAAgB,KAAK,mBAAoB,CAC9D,KAAM,EACV,CAAC,CACL,CAAC,CACL,CAEA,OAAOA,EAAwB,CAC3B,KAAK,aAAaA,CAAO,CAC7B,CACJ,CAEO,aAAM,aAAe,IAAIN",
6
6
  "names": ["supportsPopover", "OverlayStack", "event", "_a", "composedPath", "lastIndex", "nonAncestorOverlays", "overlay", "i", "el", "parentToClose", "target", "open", "last", "overlayIndex", "triggerElement", "queryPathEventName", "queryPathEvent", "path", "overlayEl"]
7
7
  }
package/src/index.d.ts CHANGED
@@ -3,3 +3,4 @@ export * from './OverlayTrigger.js';
3
3
  export * from './overlay-types.js';
4
4
  export * from './VirtualTrigger.js';
5
5
  export * from './loader.js';
6
+ export * from './overlay-trigger-directive.js';
package/src/index.dev.js CHANGED
@@ -4,4 +4,5 @@ export * from "./OverlayTrigger.dev.js";
4
4
  export * from "./overlay-types.dev.js";
5
5
  export * from "./VirtualTrigger.dev.js";
6
6
  export * from "./loader.dev.js";
7
+ export * from "./overlay-trigger-directive.dev.js";
7
8
  //# 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 './VirtualTrigger.dev.js'\nexport * from './loader.dev.js'\n"],
5
- "mappings": ";AAWA,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'\nexport * from './overlay-trigger-directive.dev.js'\n"],
5
+ "mappings": ";AAWA,cAAc;AACd,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"./VirtualTrigger.js";export*from"./loader.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";export*from"./overlay-trigger-directive.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 './VirtualTrigger.js';\nexport * from './loader.js';\n"],
5
- "mappings": "aAWA,WAAc,eACd,WAAc,sBACd,WAAc,qBACd,WAAc,sBACd,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';\nexport * from './overlay-trigger-directive.js';\n"],
5
+ "mappings": "aAWA,WAAc,eACd,WAAc,sBACd,WAAc,qBACd,WAAc,sBACd,WAAc,cACd,WAAc",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,31 @@
1
+ import { ElementPart, TemplateResult } from '@spectrum-web-components/base';
2
+ import { AsyncDirective } from 'lit/async-directive.js';
3
+ import { OverlayOptions, TriggerInteraction } from './overlay-types.js';
4
+ import '../sp-overlay.js';
5
+ import { SlottableRequestEvent } from './slottable-request-event.js';
6
+ export declare type InsertionOptions = {
7
+ el: HTMLElement | (() => HTMLElement);
8
+ where: InsertPosition;
9
+ };
10
+ export declare type OverlayTriggerOptions = {
11
+ triggerInteraction: TriggerInteraction;
12
+ overlayOptions: OverlayOptions;
13
+ insertionOptions?: InsertionOptions;
14
+ };
15
+ export declare class OverlayTriggerDirective extends AsyncDirective {
16
+ private template;
17
+ private target;
18
+ private overlay;
19
+ private strategy?;
20
+ private abortController;
21
+ protected defaultOptions: OverlayTriggerOptions;
22
+ protected options: OverlayOptions;
23
+ protected insertionOptions?: InsertionOptions;
24
+ render(_template: () => TemplateResult, _options?: Partial<OverlayTriggerOptions>): unknown;
25
+ update(part: ElementPart, [template, options]: Parameters<this['render']>): void;
26
+ handleSlottableRequest(event: SlottableRequestEvent): void;
27
+ init(): void;
28
+ disconnected(): void;
29
+ reconnected(): void;
30
+ }
31
+ export declare const trigger: (_template: () => TemplateResult, _options?: Partial<OverlayTriggerOptions> | undefined) => import("lit-html/directive.js").DirectiveResult<typeof OverlayTriggerDirective>;
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ import {
3
+ nothing,
4
+ render
5
+ } from "@spectrum-web-components/base";
6
+ import { AsyncDirective, directive } from "lit/async-directive.js";
7
+ import { Overlay, strategies } from "./Overlay.dev.js";
8
+ import "../sp-overlay.dev.js";
9
+ import {
10
+ removeSlottableRequest
11
+ } from "./slottable-request-event.dev.js";
12
+ export class OverlayTriggerDirective extends AsyncDirective {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.overlay = new Overlay();
16
+ this.defaultOptions = {
17
+ triggerInteraction: "hover",
18
+ overlayOptions: {
19
+ placement: "top-start",
20
+ type: "auto",
21
+ offset: 0
22
+ }
23
+ };
24
+ this.options = {
25
+ ...this.defaultOptions.overlayOptions
26
+ };
27
+ }
28
+ /* c8 ignore next 9 */
29
+ render(_template, _options) {
30
+ return nothing;
31
+ }
32
+ update(part, [template, options]) {
33
+ var _a, _b;
34
+ this.options = {
35
+ ...this.defaultOptions.overlayOptions,
36
+ ...options == null ? void 0 : options.overlayOptions
37
+ };
38
+ this.insertionOptions = options == null ? void 0 : options.insertionOptions;
39
+ this.template = template;
40
+ let newTarget = false;
41
+ const triggerInteraction = (options == null ? void 0 : options.triggerInteraction) || this.defaultOptions.triggerInteraction;
42
+ const newStrategy = ((_a = this.strategy) == null ? void 0 : _a.type) !== triggerInteraction;
43
+ if (this.target !== part.element) {
44
+ this.target = part.element;
45
+ newTarget = true;
46
+ }
47
+ if (newTarget || newStrategy) {
48
+ (_b = this.strategy) == null ? void 0 : _b.abort();
49
+ this.strategy = new strategies[triggerInteraction](this.overlay, this.target, true);
50
+ }
51
+ this.init();
52
+ if (true) {
53
+ window.__swc.warn(
54
+ void 0,
55
+ `\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.`,
56
+ "https://opensource.adobe.com/spectrum-web-components/components/overlay",
57
+ {
58
+ level: "high",
59
+ type: "api"
60
+ }
61
+ );
62
+ }
63
+ }
64
+ handleSlottableRequest(event) {
65
+ var _a, _b;
66
+ if (event.target !== event.currentTarget)
67
+ return;
68
+ const willRemoveSlottable = event.data === removeSlottableRequest;
69
+ render(willRemoveSlottable ? void 0 : this.template(), this.overlay);
70
+ if (willRemoveSlottable) {
71
+ this.overlay.remove();
72
+ } else {
73
+ Overlay.applyOptions(this.overlay, {
74
+ ...this.options,
75
+ trigger: this.target
76
+ });
77
+ const insertionEl = typeof ((_a = this.insertionOptions) == null ? void 0 : _a.el) === "function" ? this.insertionOptions.el() : ((_b = this.insertionOptions) == null ? void 0 : _b.el) || this.target;
78
+ const { where = "afterend" } = this.insertionOptions || {};
79
+ insertionEl.insertAdjacentElement(where, this.overlay);
80
+ }
81
+ }
82
+ init() {
83
+ var _a;
84
+ (_a = this.abortController) == null ? void 0 : _a.abort();
85
+ this.abortController = new AbortController();
86
+ const { signal } = this.abortController;
87
+ this.overlay.addEventListener(
88
+ "slottable-request",
89
+ (event) => this.handleSlottableRequest(event),
90
+ { signal }
91
+ );
92
+ }
93
+ disconnected() {
94
+ this.abortController.abort();
95
+ }
96
+ /* c8 ignore next 3 */
97
+ reconnected() {
98
+ this.init();
99
+ }
100
+ }
101
+ export const trigger = directive(OverlayTriggerDirective);
102
+ //# sourceMappingURL=overlay-trigger-directive.dev.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 ElementPart,\n nothing,\n render,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { AsyncDirective, directive } from 'lit/async-directive.js';\nimport { Overlay, strategies } from './Overlay.dev.js'\nimport { OverlayOptions, TriggerInteraction } from './overlay-types.dev.js'\nimport { ClickController } from './ClickController.dev.js'\nimport { HoverController } from './HoverController.dev.js'\nimport { LongpressController } from './LongpressController.dev.js'\nimport '../sp-overlay.dev.js'\nimport {\n removeSlottableRequest,\n SlottableRequestEvent,\n} from './slottable-request-event.dev.js'\n\nexport type InsertionOptions = {\n el: HTMLElement | (() => HTMLElement);\n where: InsertPosition;\n};\n\nexport type OverlayTriggerOptions = {\n triggerInteraction: TriggerInteraction;\n overlayOptions: OverlayOptions;\n insertionOptions?: InsertionOptions;\n};\n\nexport class OverlayTriggerDirective extends AsyncDirective {\n private template!: () => TemplateResult;\n private target!: HTMLElement;\n private overlay = new Overlay();\n private strategy?: ClickController | HoverController | LongpressController;\n private abortController!: AbortController;\n\n protected defaultOptions: OverlayTriggerOptions = {\n triggerInteraction: 'hover',\n overlayOptions: {\n placement: 'top-start',\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 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 let newTarget = false;\n const triggerInteraction = (options?.triggerInteraction ||\n this.defaultOptions.triggerInteraction) as TriggerInteraction;\n const newStrategy =\n (this.strategy?.type as unknown as TriggerInteraction) !==\n 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.overlay, this.target, true);\n }\n this.init();\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 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.overlay);\n if (willRemoveSlottable) {\n this.overlay.remove();\n } else {\n Overlay.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 init(): void {\n this.abortController?.abort();\n this.abortController = new AbortController();\n const { signal } = this.abortController;\n this.overlay.addEventListener(\n 'slottable-request',\n (event: Event) =>\n this.handleSlottableRequest(event as SlottableRequestEvent),\n { signal }\n );\n }\n\n override disconnected(): void {\n this.abortController.abort();\n }\n\n /* c8 ignore next 3 */\n override reconnected(): void {\n this.init();\n }\n}\n\nexport const trigger = directive(OverlayTriggerDirective);\n"],
5
+ "mappings": ";AAWA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP,SAAS,gBAAgB,iBAAiB;AAC1C,SAAS,SAAS,kBAAkB;AAKpC,OAAO;AACP;AAAA,EACI;AAAA,OAEG;AAaA,aAAM,gCAAgC,eAAe;AAAA,EAArD;AAAA;AAGH,SAAQ,UAAU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AA,QAC/B,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;AAAA,EAEA,OAAa;AAvIjB;AAwIQ,eAAK,oBAAL,mBAAsB;AACtB,SAAK,kBAAkB,IAAI,gBAAgB;AAC3C,UAAM,EAAE,OAAO,IAAI,KAAK;AACxB,SAAK,QAAQ;AAAA,MACT;AAAA,MACA,CAAC,UACG,KAAK,uBAAuB,KAA8B;AAAA,MAC9D,EAAE,OAAO;AAAA,IACb;AAAA,EACJ;AAAA,EAES,eAAqB;AAC1B,SAAK,gBAAgB,MAAM;AAAA,EAC/B;AAAA;AAAA,EAGS,cAAoB;AACzB,SAAK,KAAK;AAAA,EACd;AACJ;AAEO,aAAM,UAAU,UAAU,uBAAuB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";import{nothing as p,render as g}from"@spectrum-web-components/base";import{AsyncDirective as v,directive as c}from"lit/async-directive.js";import{Overlay as l,strategies as h}from"./Overlay.js";import"../sp-overlay.js";import{removeSlottableRequest as m}from"./slottable-request-event.js";export class OverlayTriggerDirective extends v{constructor(){super(...arguments);this.overlay=new l;this.defaultOptions={triggerInteraction:"hover",overlayOptions:{placement:"top-start",type:"auto",offset:0}};this.options={...this.defaultOptions.overlayOptions}}render(t,r){return p}update(t,[r,e]){var a,s;this.options={...this.defaultOptions.overlayOptions,...e==null?void 0:e.overlayOptions},this.insertionOptions=e==null?void 0:e.insertionOptions,this.template=r;let i=!1;const o=(e==null?void 0:e.triggerInteraction)||this.defaultOptions.triggerInteraction,n=((a=this.strategy)==null?void 0:a.type)!==o;this.target!==t.element&&(this.target=t.element,i=!0),(i||n)&&((s=this.strategy)==null||s.abort(),this.strategy=new h[o](this.overlay,this.target,!0)),this.init()}handleSlottableRequest(t){var e,i;if(t.target!==t.currentTarget)return;const r=t.data===m;if(g(r?void 0:this.template(),this.overlay),r)this.overlay.remove();else{l.applyOptions(this.overlay,{...this.options,trigger:this.target});const o=typeof((e=this.insertionOptions)==null?void 0:e.el)=="function"?this.insertionOptions.el():((i=this.insertionOptions)==null?void 0:i.el)||this.target,{where:n="afterend"}=this.insertionOptions||{};o.insertAdjacentElement(n,this.overlay)}}init(){var r;(r=this.abortController)==null||r.abort(),this.abortController=new AbortController;const{signal:t}=this.abortController;this.overlay.addEventListener("slottable-request",e=>this.handleSlottableRequest(e),{signal:t})}disconnected(){this.abortController.abort()}reconnected(){this.init()}}export const trigger=c(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 ElementPart,\n nothing,\n render,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { AsyncDirective, directive } from 'lit/async-directive.js';\nimport { Overlay, strategies } from './Overlay.js';\nimport { OverlayOptions, TriggerInteraction } from './overlay-types.js';\nimport { ClickController } from './ClickController.js';\nimport { HoverController } from './HoverController.js';\nimport { LongpressController } from './LongpressController.js';\nimport '../sp-overlay.js';\nimport {\n removeSlottableRequest,\n SlottableRequestEvent,\n} from './slottable-request-event.js';\n\nexport type InsertionOptions = {\n el: HTMLElement | (() => HTMLElement);\n where: InsertPosition;\n};\n\nexport type OverlayTriggerOptions = {\n triggerInteraction: TriggerInteraction;\n overlayOptions: OverlayOptions;\n insertionOptions?: InsertionOptions;\n};\n\nexport class OverlayTriggerDirective extends AsyncDirective {\n private template!: () => TemplateResult;\n private target!: HTMLElement;\n private overlay = new Overlay();\n private strategy?: ClickController | HoverController | LongpressController;\n private abortController!: AbortController;\n\n protected defaultOptions: OverlayTriggerOptions = {\n triggerInteraction: 'hover',\n overlayOptions: {\n placement: 'top-start',\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 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 let newTarget = false;\n const triggerInteraction = (options?.triggerInteraction ||\n this.defaultOptions.triggerInteraction) as TriggerInteraction;\n const newStrategy =\n (this.strategy?.type as unknown as TriggerInteraction) !==\n 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.overlay, this.target, true);\n }\n this.init();\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 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.overlay);\n if (willRemoveSlottable) {\n this.overlay.remove();\n } else {\n Overlay.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 init(): void {\n this.abortController?.abort();\n this.abortController = new AbortController();\n const { signal } = this.abortController;\n this.overlay.addEventListener(\n 'slottable-request',\n (event: Event) =>\n this.handleSlottableRequest(event as SlottableRequestEvent),\n { signal }\n );\n }\n\n override disconnected(): void {\n this.abortController.abort();\n }\n\n /* c8 ignore next 3 */\n override reconnected(): void {\n this.init();\n }\n}\n\nexport const trigger = directive(OverlayTriggerDirective);\n"],
5
+ "mappings": "aAWA,OAEI,WAAAA,EACA,UAAAC,MAEG,gCACP,OAAS,kBAAAC,EAAgB,aAAAC,MAAiB,yBAC1C,OAAS,WAAAC,EAAS,cAAAC,MAAkB,eAKpC,MAAO,mBACP,OACI,0BAAAC,MAEG,+BAaA,aAAM,gCAAgCJ,CAAe,CAArD,kCAGH,KAAQ,QAAU,IAAIE,EAItB,KAAU,eAAwC,CAC9C,mBAAoB,QACpB,eAAgB,CACZ,UAAW,YACX,KAAM,OACN,OAAQ,CACZ,CACJ,EACA,KAAU,QAA0B,CAChC,GAAG,KAAK,eAAe,cAC3B,EAIA,OACIG,EACAC,EACO,CAIP,OAAOR,CACX,CAES,OACLS,EACA,CAACC,EAAUC,CAAO,EACd,CA1EZ,IAAAC,EAAAC,EA2EQ,KAAK,QAAU,CACX,G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AE,OAAAI,CAAO,CACb,CACJ,CAES,cAAqB,CAC1B,KAAK,gBAAgB,MAAM,CAC/B,CAGS,aAAoB,CACzB,KAAK,KAAK,CACd,CACJ,CAEO,aAAM,QAAUlB,EAAU,uBAAuB",
6
+ "names": ["nothing", "render", "AsyncDirective", "directive", "Overlay", "strategies", "removeSlottableRequest", "_template", "_options", "part", "template", "options", "_a", "_b", "newTarget", "triggerInteraction", "newStrategy", "event", "willRemoveSlottable", "insertionEl", "where", "signal"]
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}slot[name=longpress-describedby-descriptor]{display:none}
4
+ :host([disabled]) ::slotted([slot=trigger]){pointer-events:none}slot[name=longpress-describedby-descriptor]{display: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 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*/\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;"],
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*/\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
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 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}
2
+ :host([disabled]) ::slotted([slot=trigger]){pointer-events:none}slot[name=longpress-describedby-descriptor]{display:none}
3
3
  `;export default s;
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 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*/\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;"],
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*/\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
5
  "mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
6
6
  "names": ["css", "styles"]
7
7
  }
@@ -6,6 +6,7 @@ export declare type Constructor<T = Record<string, unknown>> = {
6
6
  };
7
7
  export { Placement };
8
8
  export declare type OverlayTypes = 'auto' | 'hint' | 'manual' | 'modal' | 'page';
9
+ export declare type TriggerInteraction = 'click' | 'longpress' | 'hover';
9
10
  export declare type TriggerInteractions = OverlayTypes;
10
11
  export declare type TriggerInteractionsV1 = 'click' | 'longpress' | 'hover' | 'custom' | 'replace' | 'inline' | 'modal';
11
12
  export declare type OverlayTriggerInteractions = Extract<TriggerInteractions, 'inline' | 'modal' | 'replace'>;
@@ -35,6 +36,12 @@ export declare type OverlayOptionsV1 = {
35
36
  abortPromise?: Promise<boolean>;
36
37
  virtualTrigger?: VirtualTrigger;
37
38
  };
39
+ declare global {
40
+ interface GlobalEventHandlersEventMap {
41
+ 'sp-opened': CustomEvent<OverlayOpenCloseDetail>;
42
+ 'sp-closed': CustomEvent<OverlayOpenCloseDetail>;
43
+ }
44
+ }
38
45
  export declare type OpenableElement = HTMLElement & {
39
46
  open: boolean;
40
47
  tipElement?: HTMLElement;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 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\nexport type OpenableElement = HTMLElement & {\n open: boolean;\n tipElement?: HTMLElement;\n updateComplete?: Promise<void>;\n};\n\nexport type OverlayState = 'closed' | 'opening' | 'opened' | 'closing';\n"],
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
5
  "mappings": ";AAqBA;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 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\nexport type OpenableElement = HTMLElement & {\n open: boolean;\n tipElement?: HTMLElement;\n updateComplete?: Promise<void>;\n};\n\nexport type OverlayState = 'closed' | 'opening' | 'opened' | 'closing';\n"],
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
5
  "mappings": "aAqBA",
6
6
  "names": []
7
7
  }
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  import { css } from "@spectrum-web-components/base";
3
3
  const styles = css`
4
- :host{display:contents;pointer-events:none;--swc-overlay-animation-distance:var(
5
- --spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
6
- )}.dialog{background:none;border:0;box-sizing:border-box;display:flex;height:auto;inset:auto;left:0;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;top:0;--sp-overlay-open:true}.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:"";inset:-999em;pointer-events:auto!important;position:absolute}.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]{margin-top:var(--swc-overlay-animation-distance);padding-block:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{margin-left:calc(var(--swc-overlay-animation-distance)*-1);padding-inline:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=bottom]{margin-top:calc(var(--swc-overlay-animation-distance)*-1);padding-block:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=left]{margin-left:var(--swc-overlay-animation-distance);padding-inline:var(--swc-overlay-animation-distance)}.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;--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 (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))}}
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;--sp-overlay-open:true;background:0 0;border:0;max-width:calc(100vw - 16px);height:auto;max-height:calc(100dvh - 16px);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))}}
7
5
  `;
8
6
  export default styles;
9
7
  //# sourceMappingURL=overlay.css.dev.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["overlay.css.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*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{display:contents;pointer-events:none;--swc-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n)}.dialog{background:none;border:0;box-sizing:border-box;display:flex;height:auto;inset:auto;left:0;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;top:0;--sp-overlay-open:true}.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:\"\";inset:-999em;pointer-events:auto!important;position:absolute}.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]{margin-top:var(--swc-overlay-animation-distance);padding-block:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{margin-left:calc(var(--swc-overlay-animation-distance)*-1);padding-inline:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=bottom]{margin-top:calc(var(--swc-overlay-animation-distance)*-1);padding-block:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=left]{margin-left:var(--swc-overlay-animation-distance);padding-inline:var(--swc-overlay-animation-distance)}.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;--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 (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;AAAA;AAAA;AAKf,eAAe;",
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*/\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;--sp-overlay-open:true;background:0 0;border:0;max-width:calc(100vw - 16px);height:auto;max-height:calc(100dvh - 16px);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
6
  "names": []
7
7
  }
@@ -1,6 +1,4 @@
1
1
  "use strict";import{css as a}from"@spectrum-web-components/base";const o=a`
2
- :host{display:contents;pointer-events:none;--swc-overlay-animation-distance:var(
3
- --spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
4
- )}.dialog{background:none;border:0;box-sizing:border-box;display:flex;height:auto;inset:auto;left:0;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;top:0;--sp-overlay-open:true}.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:"";inset:-999em;pointer-events:auto!important;position:absolute}.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]{margin-top:var(--swc-overlay-animation-distance);padding-block:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{margin-left:calc(var(--swc-overlay-animation-distance)*-1);padding-inline:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=bottom]{margin-top:calc(var(--swc-overlay-animation-distance)*-1);padding-block:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=left]{margin-left:var(--swc-overlay-animation-distance);padding-inline:var(--swc-overlay-animation-distance)}.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;--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 (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))}}
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;--sp-overlay-open:true;background:0 0;border:0;max-width:calc(100vw - 16px);height:auto;max-height:calc(100dvh - 16px);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
3
  `;export default o;
6
4
  //# sourceMappingURL=overlay.css.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["overlay.css.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*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{display:contents;pointer-events:none;--swc-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n)}.dialog{background:none;border:0;box-sizing:border-box;display:flex;height:auto;inset:auto;left:0;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;top:0;--sp-overlay-open:true}.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:\"\";inset:-999em;pointer-events:auto!important;position:absolute}.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]{margin-top:var(--swc-overlay-animation-distance);padding-block:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{margin-left:calc(var(--swc-overlay-animation-distance)*-1);padding-inline:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=bottom]{margin-top:calc(var(--swc-overlay-animation-distance)*-1);padding-block:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=left]{margin-left:var(--swc-overlay-animation-distance);padding-inline:var(--swc-overlay-animation-distance)}.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;--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 (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;AAAA;AAAA,EAKf,eAAeC",
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*/\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;--sp-overlay-open:true;background:0 0;border:0;max-width:calc(100vw - 16px);height:auto;max-height:calc(100dvh - 16px);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
6
  "names": ["css", "styles"]
7
7
  }
@@ -0,0 +1,7 @@
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;
@@ -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"],
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"],
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
+ }