@spectrum-web-components/overlay 0.19.4-overlay.8 → 0.19.4-overlay.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/overlay",
3
- "version": "0.19.4-overlay.8+eef228d8d",
3
+ "version": "0.19.4-overlay.9+d03f9a710",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -69,6 +69,10 @@
69
69
  "development": "./src/index.dev.js",
70
70
  "default": "./src/index.js"
71
71
  },
72
+ "./src/loader.js": {
73
+ "development": "./src/loader.dev.js",
74
+ "default": "./src/loader.js"
75
+ },
72
76
  "./src/overlay-base.css.js": "./src/overlay-base.css.js",
73
77
  "./src/overlay-events.js": {
74
78
  "development": "./src/overlay-events.dev.js",
@@ -127,10 +131,10 @@
127
131
  ],
128
132
  "dependencies": {
129
133
  "@floating-ui/dom": "^1.2.5",
130
- "@spectrum-web-components/action-button": "^0.10.15-overlay.8+eef228d8d",
131
- "@spectrum-web-components/base": "^0.7.5-overlay.236+eef228d8d",
132
- "@spectrum-web-components/shared": "^0.15.6-overlay.236+eef228d8d",
133
- "@spectrum-web-components/theme": "^0.14.14-overlay.8+eef228d8d"
134
+ "@spectrum-web-components/action-button": "^0.10.15-overlay.9+d03f9a710",
135
+ "@spectrum-web-components/base": "^0.7.5-overlay.237+d03f9a710",
136
+ "@spectrum-web-components/shared": "^0.15.6-overlay.237+d03f9a710",
137
+ "@spectrum-web-components/theme": "^0.14.14-overlay.9+d03f9a710"
134
138
  },
135
139
  "types": "./src/index.d.ts",
136
140
  "customElements": "custom-elements.json",
@@ -142,5 +146,5 @@
142
146
  "./stories/overlay-story-components.js",
143
147
  "./**/*.dev.js"
144
148
  ],
145
- "gitHead": "eef228d8defcf04fe32713c7232fd0873828752b"
149
+ "gitHead": "d03f9a710c8f3870f4e43f96ed279cc9cbd0e729"
146
150
  }
@@ -15,6 +15,7 @@ export class Overlay extends OverlayFeatures {
15
15
  return;
16
16
  }
17
17
  static async open(targetOrContent, interactionOrOptions, content, options) {
18
+ var _a, _b;
18
19
  const v2 = arguments.length === 2;
19
20
  const overlay = new Overlay();
20
21
  if (v2) {
@@ -34,9 +35,10 @@ export class Overlay extends OverlayFeatures {
34
35
  const target = targetOrContent;
35
36
  const interaction = interactionOrOptions;
36
37
  overlay.append(content);
38
+ overlay.receivesFocus = (_a = options.receivesFocus) != null ? _a : "auto";
37
39
  overlay.triggerElement = target;
38
40
  overlay.type = interaction === "modal" ? "modal" : interaction === "hover" ? "hint" : "auto";
39
- overlay.offset = options.offset || 6;
41
+ overlay.offset = (_b = options.offset) != null ? _b : 6;
40
42
  overlay.placement = options.placement;
41
43
  const parent = target.getRootNode();
42
44
  if (parent === document) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["Overlay.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 { OverlayBase } from './OverlayBase.dev.js'\nimport { OverlayDialog } from './OverlayDialog.dev.js'\nimport { OverlayPopover } from './OverlayPopover.dev.js'\nimport { OverlayNoPopover } from './OverlayNoPopover.dev.js'\nimport type { OverlayOptions, TriggerInteractions } from './overlay-types.dev.js'\nimport { Placement } from '@floating-ui/dom/src/types.js';\nimport { VirtualTrigger } from './VirtualTrigger.dev.js'\n\nconst supportsPopover = 'showPopover' in document.createElement('div');\n\nlet OverlayFeatures = OverlayDialog(OverlayBase);\nif (supportsPopover) {\n OverlayFeatures = OverlayPopover(OverlayFeatures);\n} else {\n OverlayFeatures = OverlayNoPopover(OverlayFeatures);\n}\n\ntype OverlayOptionsV2 = {\n delayed?: 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 class Overlay extends OverlayFeatures {\n public static update(): void {\n return;\n }\n\n public static async open(\n target: HTMLElement,\n interaction: TriggerInteractions,\n content: HTMLElement,\n options: OverlayOptions\n ): Promise<() => void>;\n public static async open(\n content: HTMLElement,\n options: OverlayOptionsV2\n ): Promise<Overlay>;\n public static async open(\n targetOrContent: HTMLElement,\n interactionOrOptions: TriggerInteractions | OverlayOptionsV2,\n content?: HTMLElement,\n options?: OverlayOptions\n ): Promise<Overlay | (() => void)> {\n const v2 = arguments.length === 2;\n const overlay = new Overlay();\n if (v2) {\n const content = targetOrContent;\n const options = interactionOrOptions as OverlayOptionsV2;\n overlay.append(content);\n overlay.triggerElement = options.trigger || null;\n overlay.type = options.type || 'modal';\n overlay.offset = options.offset || 6;\n overlay.placement = options.placement;\n await new Promise<void>((res) =>\n requestAnimationFrame(() => res())\n );\n overlay.open = true;\n return overlay;\n } else if (content && options) {\n const target = targetOrContent;\n const interaction = interactionOrOptions;\n overlay.append(content);\n overlay.triggerElement = target;\n overlay.type =\n interaction === 'modal'\n ? 'modal'\n : interaction === 'hover'\n ? 'hint'\n : 'auto';\n overlay.offset = options.offset || 6;\n overlay.placement = options.placement;\n // This is super dirty...find a better way.\n // Maybe imperative open should go _at the end_ of everything?\n // Having an option is likely useful.\n // Make imperative overlays less useful?\n // Delete the imperative approach to an overlay?\n // Possibly the giving all of the responsiblities to the user is the best path.\n const parent = target.getRootNode() as Document;\n if (parent === document) {\n document.body.append(overlay);\n } else {\n parent.append(overlay);\n }\n await new Promise<void>((res) =>\n requestAnimationFrame(() => res())\n );\n overlay.open = true;\n return () => {\n overlay.addEventListener('sp-closed', () => {\n requestAnimationFrame(() => {\n overlay.remove();\n });\n });\n overlay.open = false;\n };\n }\n return overlay;\n }\n}\n"],
5
- "mappings": ";AAWA,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AAKjC,MAAM,kBAAkB,iBAAiB,SAAS,cAAc,KAAK;AAErE,IAAI,kBAAkB,cAAc,WAAW;AAC/C,IAAI,iBAAiB;AACjB,oBAAkB,eAAe,eAAe;AACpD,OAAO;AACH,oBAAkB,iBAAiB,eAAe;AACtD;AAWO,aAAM,gBAAgB,gBAAgB;AAAA,EACzC,OAAc,SAAe;AACzB;AAAA,EACJ;AAAA,EAYA,aAAoB,KAChB,iBACA,sBACA,SACA,SAC+B;AAC/B,UAAM,KAAK,UAAU,WAAW;AAChC,UAAM,UAAU,IAAI,QAAQ;AAC5B,QAAI,IAAI;AACJ,YAAMA,WAAU;AAChB,YAAMC,WAAU;AAChB,cAAQ,OAAOD,QAAO;AACtB,cAAQ,iBAAiBC,SAAQ,WAAW;AAC5C,cAAQ,OAAOA,SAAQ,QAAQ;AAC/B,cAAQ,SAASA,SAAQ,UAAU;AACnC,cAAQ,YAAYA,SAAQ;AAC5B,YAAM,IAAI;AAAA,QAAc,CAAC,QACrB,sBAAsB,MAAM,IAAI,CAAC;AAAA,MACrC;AACA,cAAQ,OAAO;AACf,aAAO;AAAA,IACX,WAAW,WAAW,SAAS;AAC3B,YAAM,SAAS;AACf,YAAM,cAAc;AACpB,cAAQ,OAAO,OAAO;AACtB,cAAQ,iBAAiB;AACzB,cAAQ,OACJ,gBAAgB,UACV,UACA,gBAAgB,UAChB,SACA;AACV,cAAQ,SAAS,QAAQ,UAAU;AACnC,cAAQ,YAAY,QAAQ;AAO5B,YAAM,SAAS,OAAO,YAAY;AAClC,UAAI,WAAW,UAAU;AACrB,iBAAS,KAAK,OAAO,OAAO;AAAA,MAChC,OAAO;AACH,eAAO,OAAO,OAAO;AAAA,MACzB;AACA,YAAM,IAAI;AAAA,QAAc,CAAC,QACrB,sBAAsB,MAAM,IAAI,CAAC;AAAA,MACrC;AACA,cAAQ,OAAO;AACf,aAAO,MAAM;AACT,gBAAQ,iBAAiB,aAAa,MAAM;AACxC,gCAAsB,MAAM;AACxB,oBAAQ,OAAO;AAAA,UACnB,CAAC;AAAA,QACL,CAAC;AACD,gBAAQ,OAAO;AAAA,MACnB;AAAA,IACJ;AACA,WAAO;AAAA,EACX;AACJ;",
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 { OverlayBase } from './OverlayBase.dev.js'\nimport { OverlayDialog } from './OverlayDialog.dev.js'\nimport { OverlayPopover } from './OverlayPopover.dev.js'\nimport { OverlayNoPopover } from './OverlayNoPopover.dev.js'\nimport type { OverlayOptions, TriggerInteractions } from './overlay-types.dev.js'\nimport { Placement } from '@floating-ui/dom/src/types.js';\nimport { VirtualTrigger } from './VirtualTrigger.dev.js'\n\nconst supportsPopover = 'showPopover' in document.createElement('div');\n\nlet OverlayFeatures = OverlayDialog(OverlayBase);\nif (supportsPopover) {\n OverlayFeatures = OverlayPopover(OverlayFeatures);\n} else {\n OverlayFeatures = OverlayNoPopover(OverlayFeatures);\n}\n\ntype OverlayOptionsV2 = {\n delayed?: 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 class Overlay extends OverlayFeatures {\n public static update(): void {\n return;\n }\n\n public static async open(\n target: HTMLElement,\n interaction: TriggerInteractions,\n content: HTMLElement,\n options: OverlayOptions\n ): Promise<() => void>;\n public static async open(\n content: HTMLElement,\n options: OverlayOptionsV2\n ): Promise<Overlay>;\n public static async open(\n targetOrContent: HTMLElement,\n interactionOrOptions: TriggerInteractions | OverlayOptionsV2,\n content?: HTMLElement,\n options?: OverlayOptions\n ): Promise<Overlay | (() => void)> {\n const v2 = arguments.length === 2;\n const overlay = new Overlay();\n if (v2) {\n const content = targetOrContent;\n const options = interactionOrOptions as OverlayOptionsV2;\n overlay.append(content);\n overlay.triggerElement = options.trigger || null;\n overlay.type = options.type || 'modal';\n overlay.offset = options.offset || 6;\n overlay.placement = options.placement;\n await new Promise<void>((res) =>\n requestAnimationFrame(() => res())\n );\n // Do we want to \"open\" this path, or leave that to the consumer?\n overlay.open = true;\n return overlay;\n } else if (content && options) {\n const target = targetOrContent;\n const interaction = interactionOrOptions;\n overlay.append(content);\n overlay.receivesFocus = options.receivesFocus ?? 'auto';\n overlay.triggerElement = target;\n overlay.type =\n interaction === 'modal'\n ? 'modal'\n : interaction === 'hover'\n ? 'hint'\n : 'auto';\n overlay.offset = options.offset ?? 6;\n overlay.placement = options.placement;\n // This is super dirty...find a better way.\n // Maybe imperative open should go _at the end_ of everything?\n // Having an option is likely useful.\n // Make imperative overlays less useful?\n // Delete the imperative approach to an overlay?\n // Possibly the giving all of the responsiblities to the user is the best path.\n const parent = target.getRootNode() as Document;\n if (parent === document) {\n document.body.append(overlay);\n } else {\n parent.append(overlay);\n }\n await new Promise<void>((res) =>\n requestAnimationFrame(() => res())\n );\n overlay.open = true;\n return () => {\n overlay.addEventListener('sp-closed', () => {\n requestAnimationFrame(() => {\n overlay.remove();\n });\n });\n overlay.open = false;\n };\n }\n return overlay;\n }\n}\n"],
5
+ "mappings": ";AAWA,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AAKjC,MAAM,kBAAkB,iBAAiB,SAAS,cAAc,KAAK;AAErE,IAAI,kBAAkB,cAAc,WAAW;AAC/C,IAAI,iBAAiB;AACjB,oBAAkB,eAAe,eAAe;AACpD,OAAO;AACH,oBAAkB,iBAAiB,eAAe;AACtD;AAWO,aAAM,gBAAgB,gBAAgB;AAAA,EACzC,OAAc,SAAe;AACzB;AAAA,EACJ;AAAA,EAYA,aAAoB,KAChB,iBACA,sBACA,SACA,SAC+B;AAzDvC;AA0DQ,UAAM,KAAK,UAAU,WAAW;AAChC,UAAM,UAAU,IAAI,QAAQ;AAC5B,QAAI,IAAI;AACJ,YAAMA,WAAU;AAChB,YAAMC,WAAU;AAChB,cAAQ,OAAOD,QAAO;AACtB,cAAQ,iBAAiBC,SAAQ,WAAW;AAC5C,cAAQ,OAAOA,SAAQ,QAAQ;AAC/B,cAAQ,SAASA,SAAQ,UAAU;AACnC,cAAQ,YAAYA,SAAQ;AAC5B,YAAM,IAAI;AAAA,QAAc,CAAC,QACrB,sBAAsB,MAAM,IAAI,CAAC;AAAA,MACrC;AAEA,cAAQ,OAAO;AACf,aAAO;AAAA,IACX,WAAW,WAAW,SAAS;AAC3B,YAAM,SAAS;AACf,YAAM,cAAc;AACpB,cAAQ,OAAO,OAAO;AACtB,cAAQ,iBAAgB,aAAQ,kBAAR,YAAyB;AACjD,cAAQ,iBAAiB;AACzB,cAAQ,OACJ,gBAAgB,UACV,UACA,gBAAgB,UAChB,SACA;AACV,cAAQ,UAAS,aAAQ,WAAR,YAAkB;AACnC,cAAQ,YAAY,QAAQ;AAO5B,YAAM,SAAS,OAAO,YAAY;AAClC,UAAI,WAAW,UAAU;AACrB,iBAAS,KAAK,OAAO,OAAO;AAAA,MAChC,OAAO;AACH,eAAO,OAAO,OAAO;AAAA,MACzB;AACA,YAAM,IAAI;AAAA,QAAc,CAAC,QACrB,sBAAsB,MAAM,IAAI,CAAC;AAAA,MACrC;AACA,cAAQ,OAAO;AACf,aAAO,MAAM;AACT,gBAAQ,iBAAiB,aAAa,MAAM;AACxC,gCAAsB,MAAM;AACxB,oBAAQ,OAAO;AAAA,UACnB,CAAC;AAAA,QACL,CAAC;AACD,gBAAQ,OAAO;AAAA,MACnB;AAAA,IACJ;AACA,WAAO;AAAA,EACX;AACJ;",
6
6
  "names": ["content", "options"]
7
7
  }
package/src/Overlay.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";import{OverlayBase as c}from"./OverlayBase.js";import{OverlayDialog as u}from"./OverlayDialog.js";import{OverlayPopover as v}from"./OverlayPopover.js";import{OverlayNoPopover as y}from"./OverlayNoPopover.js";const d="showPopover"in document.createElement("div");let o=u(c);d?o=v(o):o=y(o);export class Overlay extends o{static update(){}static async open(i,s,l,a){const m=arguments.length===2,e=new Overlay;if(m){const r=i,t=s;return e.append(r),e.triggerElement=t.trigger||null,e.type=t.type||"modal",e.offset=t.offset||6,e.placement=t.placement,await new Promise(n=>requestAnimationFrame(()=>n())),e.open=!0,e}else if(l&&a){const r=i,t=s;e.append(l),e.triggerElement=r,e.type=t==="modal"?"modal":t==="hover"?"hint":"auto",e.offset=a.offset||6,e.placement=a.placement;const n=r.getRootNode();return n===document?document.body.append(e):n.append(e),await new Promise(p=>requestAnimationFrame(()=>p())),e.open=!0,()=>{e.addEventListener("sp-closed",()=>{requestAnimationFrame(()=>{e.remove()})}),e.open=!1}}return e}}
1
+ "use strict";import{OverlayBase as v}from"./OverlayBase.js";import{OverlayDialog as y}from"./OverlayDialog.js";import{OverlayPopover as d}from"./OverlayPopover.js";import{OverlayNoPopover as g}from"./OverlayNoPopover.js";const f="showPopover"in document.createElement("div");let o=y(v);f?o=d(o):o=g(o);export class Overlay extends o{static update(){}static async open(i,s,l,r){var m,p;const c=arguments.length===2,e=new Overlay;if(c){const n=i,t=s;return e.append(n),e.triggerElement=t.trigger||null,e.type=t.type||"modal",e.offset=t.offset||6,e.placement=t.placement,await new Promise(a=>requestAnimationFrame(()=>a())),e.open=!0,e}else if(l&&r){const n=i,t=s;e.append(l),e.receivesFocus=(m=r.receivesFocus)!=null?m:"auto",e.triggerElement=n,e.type=t==="modal"?"modal":t==="hover"?"hint":"auto",e.offset=(p=r.offset)!=null?p:6,e.placement=r.placement;const a=n.getRootNode();return a===document?document.body.append(e):a.append(e),await new Promise(u=>requestAnimationFrame(()=>u())),e.open=!0,()=>{e.addEventListener("sp-closed",()=>{requestAnimationFrame(()=>{e.remove()})}),e.open=!1}}return e}}
2
2
  //# sourceMappingURL=Overlay.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["Overlay.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 { OverlayBase } from './OverlayBase.js';\nimport { OverlayDialog } from './OverlayDialog.js';\nimport { OverlayPopover } from './OverlayPopover.js';\nimport { OverlayNoPopover } from './OverlayNoPopover.js';\nimport type { OverlayOptions, TriggerInteractions } from './overlay-types.js';\nimport { Placement } from '@floating-ui/dom/src/types.js';\nimport { VirtualTrigger } from './VirtualTrigger.js';\n\nconst supportsPopover = 'showPopover' in document.createElement('div');\n\nlet OverlayFeatures = OverlayDialog(OverlayBase);\nif (supportsPopover) {\n OverlayFeatures = OverlayPopover(OverlayFeatures);\n} else {\n OverlayFeatures = OverlayNoPopover(OverlayFeatures);\n}\n\ntype OverlayOptionsV2 = {\n delayed?: 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 class Overlay extends OverlayFeatures {\n public static update(): void {\n return;\n }\n\n public static async open(\n target: HTMLElement,\n interaction: TriggerInteractions,\n content: HTMLElement,\n options: OverlayOptions\n ): Promise<() => void>;\n public static async open(\n content: HTMLElement,\n options: OverlayOptionsV2\n ): Promise<Overlay>;\n public static async open(\n targetOrContent: HTMLElement,\n interactionOrOptions: TriggerInteractions | OverlayOptionsV2,\n content?: HTMLElement,\n options?: OverlayOptions\n ): Promise<Overlay | (() => void)> {\n const v2 = arguments.length === 2;\n const overlay = new Overlay();\n if (v2) {\n const content = targetOrContent;\n const options = interactionOrOptions as OverlayOptionsV2;\n overlay.append(content);\n overlay.triggerElement = options.trigger || null;\n overlay.type = options.type || 'modal';\n overlay.offset = options.offset || 6;\n overlay.placement = options.placement;\n await new Promise<void>((res) =>\n requestAnimationFrame(() => res())\n );\n overlay.open = true;\n return overlay;\n } else if (content && options) {\n const target = targetOrContent;\n const interaction = interactionOrOptions;\n overlay.append(content);\n overlay.triggerElement = target;\n overlay.type =\n interaction === 'modal'\n ? 'modal'\n : interaction === 'hover'\n ? 'hint'\n : 'auto';\n overlay.offset = options.offset || 6;\n overlay.placement = options.placement;\n // This is super dirty...find a better way.\n // Maybe imperative open should go _at the end_ of everything?\n // Having an option is likely useful.\n // Make imperative overlays less useful?\n // Delete the imperative approach to an overlay?\n // Possibly the giving all of the responsiblities to the user is the best path.\n const parent = target.getRootNode() as Document;\n if (parent === document) {\n document.body.append(overlay);\n } else {\n parent.append(overlay);\n }\n await new Promise<void>((res) =>\n requestAnimationFrame(() => res())\n );\n overlay.open = true;\n return () => {\n overlay.addEventListener('sp-closed', () => {\n requestAnimationFrame(() => {\n overlay.remove();\n });\n });\n overlay.open = false;\n };\n }\n return overlay;\n }\n}\n"],
5
- "mappings": "aAWA,OAAS,eAAAA,MAAmB,mBAC5B,OAAS,iBAAAC,MAAqB,qBAC9B,OAAS,kBAAAC,MAAsB,sBAC/B,OAAS,oBAAAC,MAAwB,wBAKjC,MAAMC,EAAkB,gBAAiB,SAAS,cAAc,KAAK,EAErE,IAAIC,EAAkBJ,EAAcD,CAAW,EAC3CI,EACAC,EAAkBH,EAAeG,CAAe,EAEhDA,EAAkBF,EAAiBE,CAAe,EAY/C,aAAM,gBAAgBA,CAAgB,CACzC,OAAc,QAAe,CAE7B,CAYA,aAAoB,KAChBC,EACAC,EACAC,EACAC,EAC+B,CAC/B,MAAMC,EAAK,UAAU,SAAW,EAC1BC,EAAU,IAAI,QACpB,GAAID,EAAI,CACJ,MAAMF,EAAUF,EACVG,EAAUF,EAChB,OAAAI,EAAQ,OAAOH,CAAO,EACtBG,EAAQ,eAAiBF,EAAQ,SAAW,KAC5CE,EAAQ,KAAOF,EAAQ,MAAQ,QAC/BE,EAAQ,OAASF,EAAQ,QAAU,EACnCE,EAAQ,UAAYF,EAAQ,UAC5B,MAAM,IAAI,QAAeG,GACrB,sBAAsB,IAAMA,EAAI,CAAC,CACrC,EACAD,EAAQ,KAAO,GACRA,CACX,SAAWH,GAAWC,EAAS,CAC3B,MAAMI,EAASP,EACTQ,EAAcP,EACpBI,EAAQ,OAAOH,CAAO,EACtBG,EAAQ,eAAiBE,EACzBF,EAAQ,KACJG,IAAgB,QACV,QACAA,IAAgB,QAChB,OACA,OACVH,EAAQ,OAASF,EAAQ,QAAU,EACnCE,EAAQ,UAAYF,EAAQ,UAO5B,MAAMM,EAASF,EAAO,YAAY,EAClC,OAAIE,IAAW,SACX,SAAS,KAAK,OAAOJ,CAAO,EAE5BI,EAAO,OAAOJ,CAAO,EAEzB,MAAM,IAAI,QAAeC,GACrB,sBAAsB,IAAMA,EAAI,CAAC,CACrC,EACAD,EAAQ,KAAO,GACR,IAAM,CACTA,EAAQ,iBAAiB,YAAa,IAAM,CACxC,sBAAsB,IAAM,CACxBA,EAAQ,OAAO,CACnB,CAAC,CACL,CAAC,EACDA,EAAQ,KAAO,EACnB,CACJ,CACA,OAAOA,CACX,CACJ",
6
- "names": ["OverlayBase", "OverlayDialog", "OverlayPopover", "OverlayNoPopover", "supportsPopover", "OverlayFeatures", "targetOrContent", "interactionOrOptions", "content", "options", "v2", "overlay", "res", "target", "interaction", "parent"]
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 { OverlayBase } from './OverlayBase.js';\nimport { OverlayDialog } from './OverlayDialog.js';\nimport { OverlayPopover } from './OverlayPopover.js';\nimport { OverlayNoPopover } from './OverlayNoPopover.js';\nimport type { OverlayOptions, TriggerInteractions } from './overlay-types.js';\nimport { Placement } from '@floating-ui/dom/src/types.js';\nimport { VirtualTrigger } from './VirtualTrigger.js';\n\nconst supportsPopover = 'showPopover' in document.createElement('div');\n\nlet OverlayFeatures = OverlayDialog(OverlayBase);\nif (supportsPopover) {\n OverlayFeatures = OverlayPopover(OverlayFeatures);\n} else {\n OverlayFeatures = OverlayNoPopover(OverlayFeatures);\n}\n\ntype OverlayOptionsV2 = {\n delayed?: 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 class Overlay extends OverlayFeatures {\n public static update(): void {\n return;\n }\n\n public static async open(\n target: HTMLElement,\n interaction: TriggerInteractions,\n content: HTMLElement,\n options: OverlayOptions\n ): Promise<() => void>;\n public static async open(\n content: HTMLElement,\n options: OverlayOptionsV2\n ): Promise<Overlay>;\n public static async open(\n targetOrContent: HTMLElement,\n interactionOrOptions: TriggerInteractions | OverlayOptionsV2,\n content?: HTMLElement,\n options?: OverlayOptions\n ): Promise<Overlay | (() => void)> {\n const v2 = arguments.length === 2;\n const overlay = new Overlay();\n if (v2) {\n const content = targetOrContent;\n const options = interactionOrOptions as OverlayOptionsV2;\n overlay.append(content);\n overlay.triggerElement = options.trigger || null;\n overlay.type = options.type || 'modal';\n overlay.offset = options.offset || 6;\n overlay.placement = options.placement;\n await new Promise<void>((res) =>\n requestAnimationFrame(() => res())\n );\n // Do we want to \"open\" this path, or leave that to the consumer?\n overlay.open = true;\n return overlay;\n } else if (content && options) {\n const target = targetOrContent;\n const interaction = interactionOrOptions;\n overlay.append(content);\n overlay.receivesFocus = options.receivesFocus ?? 'auto';\n overlay.triggerElement = target;\n overlay.type =\n interaction === 'modal'\n ? 'modal'\n : interaction === 'hover'\n ? 'hint'\n : 'auto';\n overlay.offset = options.offset ?? 6;\n overlay.placement = options.placement;\n // This is super dirty...find a better way.\n // Maybe imperative open should go _at the end_ of everything?\n // Having an option is likely useful.\n // Make imperative overlays less useful?\n // Delete the imperative approach to an overlay?\n // Possibly the giving all of the responsiblities to the user is the best path.\n const parent = target.getRootNode() as Document;\n if (parent === document) {\n document.body.append(overlay);\n } else {\n parent.append(overlay);\n }\n await new Promise<void>((res) =>\n requestAnimationFrame(() => res())\n );\n overlay.open = true;\n return () => {\n overlay.addEventListener('sp-closed', () => {\n requestAnimationFrame(() => {\n overlay.remove();\n });\n });\n overlay.open = false;\n };\n }\n return overlay;\n }\n}\n"],
5
+ "mappings": "aAWA,OAAS,eAAAA,MAAmB,mBAC5B,OAAS,iBAAAC,MAAqB,qBAC9B,OAAS,kBAAAC,MAAsB,sBAC/B,OAAS,oBAAAC,MAAwB,wBAKjC,MAAMC,EAAkB,gBAAiB,SAAS,cAAc,KAAK,EAErE,IAAIC,EAAkBJ,EAAcD,CAAW,EAC3CI,EACAC,EAAkBH,EAAeG,CAAe,EAEhDA,EAAkBF,EAAiBE,CAAe,EAY/C,aAAM,gBAAgBA,CAAgB,CACzC,OAAc,QAAe,CAE7B,CAYA,aAAoB,KAChBC,EACAC,EACAC,EACAC,EAC+B,CAzDvC,IAAAC,EAAAC,EA0DQ,MAAMC,EAAK,UAAU,SAAW,EAC1BC,EAAU,IAAI,QACpB,GAAID,EAAI,CACJ,MAAMJ,EAAUF,EACVG,EAAUF,EAChB,OAAAM,EAAQ,OAAOL,CAAO,EACtBK,EAAQ,eAAiBJ,EAAQ,SAAW,KAC5CI,EAAQ,KAAOJ,EAAQ,MAAQ,QAC/BI,EAAQ,OAASJ,EAAQ,QAAU,EACnCI,EAAQ,UAAYJ,EAAQ,UAC5B,MAAM,IAAI,QAAeK,GACrB,sBAAsB,IAAMA,EAAI,CAAC,CACrC,EAEAD,EAAQ,KAAO,GACRA,CACX,SAAWL,GAAWC,EAAS,CAC3B,MAAMM,EAAST,EACTU,EAAcT,EACpBM,EAAQ,OAAOL,CAAO,EACtBK,EAAQ,eAAgBH,EAAAD,EAAQ,gBAAR,KAAAC,EAAyB,OACjDG,EAAQ,eAAiBE,EACzBF,EAAQ,KACJG,IAAgB,QACV,QACAA,IAAgB,QAChB,OACA,OACVH,EAAQ,QAASF,EAAAF,EAAQ,SAAR,KAAAE,EAAkB,EACnCE,EAAQ,UAAYJ,EAAQ,UAO5B,MAAMQ,EAASF,EAAO,YAAY,EAClC,OAAIE,IAAW,SACX,SAAS,KAAK,OAAOJ,CAAO,EAE5BI,EAAO,OAAOJ,CAAO,EAEzB,MAAM,IAAI,QAAeC,GACrB,sBAAsB,IAAMA,EAAI,CAAC,CACrC,EACAD,EAAQ,KAAO,GACR,IAAM,CACTA,EAAQ,iBAAiB,YAAa,IAAM,CACxC,sBAAsB,IAAM,CACxBA,EAAQ,OAAO,CACnB,CAAC,CACL,CAAC,EACDA,EAAQ,KAAO,EACnB,CACJ,CACA,OAAOA,CACX,CACJ",
6
+ "names": ["OverlayBase", "OverlayDialog", "OverlayPopover", "OverlayNoPopover", "supportsPopover", "OverlayFeatures", "targetOrContent", "interactionOrOptions", "content", "options", "_a", "_b", "v2", "overlay", "res", "target", "interaction", "parent"]
7
7
  }
package/src/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './Overlay.js';
2
2
  export * from './OverlayTrigger.js';
3
3
  export * from './overlay-types.js';
4
4
  export * from './VirtualTrigger.js';
5
+ export * from './loader.js';
package/src/index.dev.js CHANGED
@@ -3,4 +3,5 @@ export * from "./Overlay.dev.js";
3
3
  export * from "./OverlayTrigger.dev.js";
4
4
  export * from "./overlay-types.dev.js";
5
5
  export * from "./VirtualTrigger.dev.js";
6
+ export * from "./loader.dev.js";
6
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 './VirtualTrigger.dev.js'\n"],
5
- "mappings": ";AAWA,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"./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 './VirtualTrigger.js';\n"],
5
- "mappings": "aAWA,WAAc,eACd,WAAc,sBACd,WAAc,qBACd,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
  }
@@ -0,0 +1,2 @@
1
+ import { Overlay } from './Overlay.js';
2
+ export declare const openOverlay: typeof Overlay.open;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ import { Overlay } from "./Overlay.dev.js";
3
+ export const openOverlay = Overlay.open;
4
+ //# sourceMappingURL=loader.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["loader.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Overlay } from './Overlay.dev.js'\n\nexport const openOverlay = Overlay.open;\n"],
5
+ "mappings": ";AAYA,SAAS,eAAe;AAEjB,aAAM,cAAc,QAAQ;",
6
+ "names": []
7
+ }
package/src/loader.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";import{Overlay as o}from"./Overlay.js";export const openOverlay=o.open;
2
+ //# sourceMappingURL=loader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["loader.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { 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
+ }
@@ -41,7 +41,7 @@ export declare type OverlayOptions = {
41
41
  delayed?: boolean;
42
42
  placement?: Placement;
43
43
  offset?: number;
44
- receivesFocus?: 'auto';
44
+ receivesFocus?: 'true' | 'false' | 'auto';
45
45
  notImmediatelyClosable?: boolean;
46
46
  abortPromise?: Promise<boolean>;
47
47
  virtualTrigger?: VirtualTrigger;
@@ -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 { 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 TriggerInteractions =\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 OverlayOptions = {\n root?: HTMLElement;\n delayed?: boolean;\n placement?: Placement;\n offset?: number;\n receivesFocus?: '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"],
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 TriggerInteractions =\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 OverlayOptions = {\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
5
  "mappings": ";AAgBA;",
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 { 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 TriggerInteractions =\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 OverlayOptions = {\n root?: HTMLElement;\n delayed?: boolean;\n placement?: Placement;\n offset?: number;\n receivesFocus?: '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"],
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 TriggerInteractions =\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 OverlayOptions = {\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
5
  "mappings": "aAgBA",
6
6
  "names": []
7
7
  }