@spectrum-web-components/overlay 0.13.3-express.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,6 +32,12 @@
32
32
  }
33
33
  ]
34
34
  },
35
+ {
36
+ "kind": "javascript-module",
37
+ "path": "sync/overlay-trigger.ts",
38
+ "declarations": [],
39
+ "exports": []
40
+ },
35
41
  {
36
42
  "kind": "javascript-module",
37
43
  "path": "src/ActiveOverlay.ts",
@@ -81,11 +87,11 @@
81
87
  },
82
88
  {
83
89
  "kind": "field",
84
- "name": "popper",
90
+ "name": "childrenReady",
85
91
  "type": {
86
- "text": "Instance | undefined"
92
+ "text": "Promise<unknown[]>"
87
93
  },
88
- "privacy": "private"
94
+ "privacy": "protected"
89
95
  },
90
96
  {
91
97
  "kind": "field",
@@ -126,7 +132,7 @@
126
132
  "kind": "field",
127
133
  "name": "theme",
128
134
  "type": {
129
- "text": "{\n color?: Color;\n scale?: Scale;\n lang?: string;\n theme?: Flavor;\n }"
135
+ "text": "{\n color?: Color;\n scale?: Scale;\n lang?: string;\n }"
130
136
  },
131
137
  "privacy": "public",
132
138
  "default": "{}"
@@ -164,15 +170,6 @@
164
170
  },
165
171
  "privacy": "private"
166
172
  },
167
- {
168
- "kind": "field",
169
- "name": "dataPopperPlacement",
170
- "type": {
171
- "text": "Placement | undefined"
172
- },
173
- "privacy": "public",
174
- "attribute": "data-popper-placement"
175
- },
176
173
  {
177
174
  "kind": "method",
178
175
  "name": "focus",
@@ -272,11 +269,11 @@
272
269
  },
273
270
  {
274
271
  "kind": "method",
275
- "name": "updateOverlayPopperPlacement",
276
- "privacy": "private",
272
+ "name": "openCallback",
273
+ "privacy": "public",
277
274
  "return": {
278
275
  "type": {
279
- "text": "void"
276
+ "text": "Promise<void>"
280
277
  }
281
278
  }
282
279
  },
@@ -339,7 +336,7 @@
339
336
  {
340
337
  "name": "element",
341
338
  "type": {
342
- "text": "HTMLElement"
339
+ "text": "HTMLElement & { placement: Placement }"
343
340
  }
344
341
  }
345
342
  ]
@@ -364,14 +361,26 @@
364
361
  }
365
362
  },
366
363
  {
367
- "kind": "method",
364
+ "kind": "field",
365
+ "name": "initialHeight",
366
+ "type": {
367
+ "text": "number"
368
+ },
369
+ "privacy": "private"
370
+ },
371
+ {
372
+ "kind": "field",
373
+ "name": "isConstrained",
374
+ "type": {
375
+ "text": "boolean"
376
+ },
377
+ "privacy": "private",
378
+ "default": "false"
379
+ },
380
+ {
381
+ "kind": "field",
368
382
  "name": "updateOverlayPosition",
369
- "privacy": "public",
370
- "return": {
371
- "type": {
372
- "text": "Promise<void>"
373
- }
374
- }
383
+ "privacy": "public"
375
384
  },
376
385
  {
377
386
  "kind": "method",
@@ -513,13 +522,6 @@
513
522
  "text": "Placement | undefined"
514
523
  },
515
524
  "fieldName": "placement"
516
- },
517
- {
518
- "name": "data-popper-placement",
519
- "type": {
520
- "text": "Placement | undefined"
521
- },
522
- "fieldName": "dataPopperPlacement"
523
525
  }
524
526
  ],
525
527
  "superclass": {
@@ -545,6 +547,14 @@
545
547
  "kind": "javascript-module",
546
548
  "path": "src/OverlayTrigger.ts",
547
549
  "declarations": [
550
+ {
551
+ "kind": "variable",
552
+ "name": "LONGPRESS_INSTRUCTIONS",
553
+ "type": {
554
+ "text": "object"
555
+ },
556
+ "default": "{\n touch: 'Double tap and long press for additional options',\n keyboard: 'Press Space or Alt+Down Arrow for additional options',\n mouse: 'Click and hold for additional options',\n}"
557
+ },
548
558
  {
549
559
  "kind": "class",
550
560
  "description": "",
@@ -644,6 +654,23 @@
644
654
  "attribute": "disabled",
645
655
  "reflects": true
646
656
  },
657
+ {
658
+ "kind": "field",
659
+ "name": "hasLongpressContent",
660
+ "type": {
661
+ "text": "boolean"
662
+ },
663
+ "privacy": "public",
664
+ "default": "false"
665
+ },
666
+ {
667
+ "kind": "field",
668
+ "name": "longpressDescriptor",
669
+ "type": {
670
+ "text": "HTMLElement | undefined"
671
+ },
672
+ "privacy": "private"
673
+ },
647
674
  {
648
675
  "kind": "field",
649
676
  "name": "clickContent",
@@ -676,6 +703,12 @@
676
703
  },
677
704
  "privacy": "private"
678
705
  },
706
+ {
707
+ "kind": "field",
708
+ "name": "_longpressId",
709
+ "privacy": "private",
710
+ "default": "`longpress-describedby-descriptor`"
711
+ },
679
712
  {
680
713
  "kind": "method",
681
714
  "name": "handleClose",
@@ -695,6 +728,16 @@
695
728
  }
696
729
  ]
697
730
  },
731
+ {
732
+ "kind": "method",
733
+ "name": "manageLongpressDescriptor",
734
+ "privacy": "protected",
735
+ "return": {
736
+ "type": {
737
+ "text": "void"
738
+ }
739
+ }
740
+ },
698
741
  {
699
742
  "kind": "method",
700
743
  "name": "closeAllOverlays",
@@ -1013,7 +1056,7 @@
1013
1056
  }
1014
1057
  ],
1015
1058
  "superclass": {
1016
- "name": "LitElement",
1059
+ "name": "SpectrumElement",
1017
1060
  "package": "@spectrum-web-components/base"
1018
1061
  },
1019
1062
  "tagName": "overlay-trigger",
@@ -1021,6 +1064,14 @@
1021
1064
  }
1022
1065
  ],
1023
1066
  "exports": [
1067
+ {
1068
+ "kind": "js",
1069
+ "name": "LONGPRESS_INSTRUCTIONS",
1070
+ "declaration": {
1071
+ "name": "LONGPRESS_INSTRUCTIONS",
1072
+ "module": "src/OverlayTrigger.ts"
1073
+ }
1074
+ },
1024
1075
  {
1025
1076
  "kind": "js",
1026
1077
  "name": "OverlayTrigger",
@@ -1113,7 +1164,7 @@
1113
1164
  {
1114
1165
  "kind": "variable",
1115
1166
  "name": "styles",
1116
- "default": "css`\n@keyframes sp-overlay-fade-in{0%{opacity:0;transform:var(--sp-overlay-from)}to{opacity:1;transform:translate(0)}}@keyframes sp-overlay-fade-out{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:var(--sp-overlay-from)}}:host{display:inline-block;left:0;pointer-events:none;position:absolute;top:0;z-index:1000}:host(:focus){outline:none}#contents,sp-theme{height:100%}#contents{animation-duration:var(--spectrum-global-animation-duration-200,.16s);animation-timing-function:var(\n--spectrum-global-animation-ease-out,ease-out\n);display:inline-block;opacity:1;pointer-events:none;visibility:visible}:host([data-popper-placement*=top]) #contents{--sp-overlay-from:translateY(var(--spectrum-global-dimension-size-75))}:host([data-popper-placement*=right]) #contents{--sp-overlay-from:translateX(calc(-1*var(--spectrum-global-dimension-size-75)))}:host([data-popper-placement*=bottom]) #contents{--sp-overlay-from:translateY(calc(-1*var(--spectrum-global-dimension-size-75)))}:host([data-popper-placement*=left]) #contents{--sp-overlay-from:translateX(var(--spectrum-global-dimension-size-75))}:host([animating]) ::slotted(*){pointer-events:none}:host(:not([animating])) ::slotted(*){pointer-events:auto}#contents ::slotted(*){position:relative}\n`"
1167
+ "default": "css`\n@keyframes sp-overlay-fade-in{0%{opacity:0;transform:var(--sp-overlay-from)}to{opacity:1;transform:translate(0)}}@keyframes sp-overlay-fade-out{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:var(--sp-overlay-from)}}:host{display:inline-block;left:0;pointer-events:none;position:absolute;top:0;z-index:1000}:host(:focus){outline:none}:host([placement=none]){max-height:var(--swc-visual-viewport-height)}#contents,sp-theme{height:100%}#contents{animation-duration:var(\n--swc-test-duration,var(--spectrum-global-animation-duration-200,.16s)\n);animation-timing-function:var(\n--spectrum-global-animation-ease-out,ease-out\n);display:inline-block;opacity:1;pointer-events:none;visibility:visible}:host([actual-placement*=top]) #contents{--sp-overlay-from:translateY(var(--spectrum-global-dimension-size-75));align-items:flex-end;display:inline-flex}:host([actual-placement*=right]) #contents{--sp-overlay-from:translateX(calc(var(--spectrum-global-dimension-size-75)*-1))}:host([actual-placement*=bottom]) #contents{--sp-overlay-from:translateY(calc(var(--spectrum-global-dimension-size-75)*-1))}:host([actual-placement*=left]) #contents{--sp-overlay-from:translateX(var(--spectrum-global-dimension-size-75))}:host([animating]) ::slotted(*){pointer-events:none}:host(:not([animating])) ::slotted(*){pointer-events:auto}#contents ::slotted(*){position:relative}\n`"
1117
1168
  }
1118
1169
  ],
1119
1170
  "exports": [
@@ -1127,30 +1178,6 @@
1127
1178
  }
1128
1179
  ]
1129
1180
  },
1130
- {
1131
- "kind": "javascript-module",
1132
- "path": "src/apply-max-size.ts",
1133
- "declarations": [
1134
- {
1135
- "kind": "variable",
1136
- "name": "applyMaxSize",
1137
- "type": {
1138
- "text": "Modifier<'applyMaxSize', Record<string, unknown>>"
1139
- },
1140
- "default": "{\n name: 'applyMaxSize',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['maxSize'],\n fn({ state }: ModifierArguments<Record<string, unknown>>): void {\n const { height: maxHeight } = state.modifiersData.maxSize;\n if (!appliedSizeDefaults.has(state.elements.popper)) {\n appliedSizeDefaults.set(\n state.elements.popper,\n state.rects.popper.height\n );\n }\n const actualHeight = appliedSizeDefaults.get(state.elements.popper);\n const constrainHeight = maxHeight < actualHeight;\n const appliedHeight = constrainHeight ? `${maxHeight}px` : '';\n state.styles.popper.maxHeight = appliedHeight;\n state.styles.popper.height = appliedHeight;\n },\n}"
1141
- }
1142
- ],
1143
- "exports": [
1144
- {
1145
- "kind": "js",
1146
- "name": "applyMaxSize",
1147
- "declaration": {
1148
- "name": "applyMaxSize",
1149
- "module": "src/apply-max-size.ts"
1150
- }
1151
- }
1152
- ]
1153
- },
1154
1181
  {
1155
1182
  "kind": "javascript-module",
1156
1183
  "path": "src/index.ts",
@@ -2013,72 +2040,6 @@
2013
2040
  }
2014
2041
  }
2015
2042
  ]
2016
- },
2017
- {
2018
- "kind": "javascript-module",
2019
- "path": "src/popper.ts",
2020
- "declarations": [
2021
- {
2022
- "kind": "variable",
2023
- "name": "createPopper"
2024
- }
2025
- ],
2026
- "exports": [
2027
- {
2028
- "kind": "js",
2029
- "name": "createPopper",
2030
- "declaration": {
2031
- "name": "createPopper",
2032
- "module": "src/popper.ts"
2033
- }
2034
- },
2035
- {
2036
- "kind": "js",
2037
- "name": "Instance",
2038
- "declaration": {
2039
- "name": "Instance",
2040
- "module": "src/popper.ts"
2041
- }
2042
- },
2043
- {
2044
- "kind": "js",
2045
- "name": "Placement",
2046
- "declaration": {
2047
- "name": "Placement",
2048
- "module": "src/popper.ts"
2049
- }
2050
- },
2051
- {
2052
- "kind": "js",
2053
- "name": "VirtualElement",
2054
- "declaration": {
2055
- "name": "VirtualElement",
2056
- "module": "src/popper.ts"
2057
- }
2058
- },
2059
- {
2060
- "kind": "js",
2061
- "name": "maxSize",
2062
- "declaration": {
2063
- "name": "maxSize",
2064
- "module": "src/popper.ts"
2065
- }
2066
- },
2067
- {
2068
- "kind": "js",
2069
- "name": "applyMaxSize",
2070
- "declaration": {
2071
- "name": "applyMaxSize",
2072
- "module": "src/popper.ts"
2073
- }
2074
- }
2075
- ]
2076
- },
2077
- {
2078
- "kind": "javascript-module",
2079
- "path": "sync/overlay-trigger.ts",
2080
- "declarations": [],
2081
- "exports": []
2082
2043
  }
2083
2044
  ]
2084
2045
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/overlay",
3
- "version": "0.13.3-express.0+5d9e2a2ca",
3
+ "version": "0.14.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -48,12 +48,11 @@
48
48
  "lit-html"
49
49
  ],
50
50
  "dependencies": {
51
- "@popperjs/core": "^2.11.0",
52
- "@spectrum-web-components/action-button": "^0.7.3-express.0+5d9e2a2ca",
53
- "@spectrum-web-components/base": "^0.5.2-express.41+5d9e2a2ca",
54
- "@spectrum-web-components/shared": "^0.13.3-express.0+5d9e2a2ca",
55
- "@spectrum-web-components/theme": "^0.9.3-express.0+5d9e2a2ca",
56
- "popper-max-size-modifier": "^0.2.0",
51
+ "@floating-ui/dom": "^0.2.0",
52
+ "@spectrum-web-components/action-button": "^0.7.3",
53
+ "@spectrum-web-components/base": "^0.5.1",
54
+ "@spectrum-web-components/shared": "^0.13.3",
55
+ "@spectrum-web-components/theme": "^0.9.3",
57
56
  "tslib": "^2.0.0"
58
57
  },
59
58
  "types": "./src/index.d.ts",
@@ -64,5 +63,5 @@
64
63
  "./sync/overlay-trigger.js",
65
64
  "./stories/overlay-story-components.js"
66
65
  ],
67
- "gitHead": "5d9e2a2ca93deff51e4b2c7b8354f1127009a4e3"
66
+ "gitHead": "f23b15ec952d7450272a8275524c905e028b4ddc"
68
67
  }
@@ -1,7 +1,7 @@
1
1
  import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
2
- import { Color, Flavor, Scale } from '@spectrum-web-components/theme';
2
+ import { Color, Scale } from '@spectrum-web-components/theme';
3
3
  import { OverlayOpenDetail, Placement, TriggerInteractions } from './overlay-types.js';
4
- import { VirtualTrigger } from './VirtualTrigger.js';
4
+ import type { VirtualTrigger } from './VirtualTrigger.js';
5
5
  export interface PositionResult {
6
6
  arrowOffsetLeft: number;
7
7
  arrowOffsetTop: number;
@@ -10,7 +10,7 @@ export interface PositionResult {
10
10
  positionLeft: number;
11
11
  positionTop: number;
12
12
  }
13
- declare type OverlayStateType = 'idle' | 'active' | 'visible' | 'hiding' | 'dispose' | 'disposed';
13
+ declare type OverlayStateType = 'idle' | 'active' | 'hiding' | 'dispose' | 'disposed';
14
14
  declare type ContentAnimation = 'sp-overlay-fade-in' | 'sp-overlay-fade-out';
15
15
  /**
16
16
  * @element active-overlay
@@ -22,7 +22,7 @@ export declare class ActiveOverlay extends SpectrumElement {
22
22
  overlayContentTip?: HTMLElement;
23
23
  trigger: HTMLElement;
24
24
  virtualTrigger?: VirtualTrigger;
25
- private popper?;
25
+ protected childrenReady: Promise<unknown[]>;
26
26
  _state: OverlayStateType;
27
27
  get state(): OverlayStateType;
28
28
  set state(state: OverlayStateType);
@@ -32,18 +32,11 @@ export declare class ActiveOverlay extends SpectrumElement {
32
32
  color?: Color;
33
33
  scale?: Scale;
34
34
  lang?: string;
35
- theme?: Flavor;
36
35
  };
37
36
  receivesFocus?: 'auto';
38
37
  tabbingAway: boolean;
39
38
  private originalPlacement?;
40
39
  private restoreContent?;
41
- /**
42
- * @prop Used by the popper library to indicate where the overlay was
43
- * actually rendered. Popper may switch which side an overlay
44
- * is rendered on to fit it on the screen
45
- */
46
- dataPopperPlacement?: Placement;
47
40
  focus(): void;
48
41
  private get hasTheme();
49
42
  offset: number;
@@ -56,21 +49,21 @@ export declare class ActiveOverlay extends SpectrumElement {
56
49
  get hasModalRoot(): boolean;
57
50
  feature(): void;
58
51
  obscure(nextOverlayInteraction: TriggerInteractions): ActiveOverlay | undefined;
59
- firstUpdated(changedProperties: PropertyValues): void;
60
- private updateOverlayPopperPlacement;
61
- updated(changedProperties: PropertyValues): void;
52
+ firstUpdated(changedProperties: PropertyValues): Promise<void>;
53
+ openCallback(): Promise<void>;
62
54
  private open;
63
55
  private extractDetail;
64
56
  dispose(): void;
65
57
  private stealOverlayContent;
66
58
  private willNotifyClosed;
67
59
  private returnOverlayContent;
68
- updateOverlayPosition(): Promise<void>;
60
+ private initialHeight;
61
+ private isConstrained;
62
+ updateOverlayPosition: () => Promise<void>;
69
63
  hide(animated?: boolean): Promise<void>;
70
64
  private schedulePositionUpdate;
71
65
  private onSlotChange;
72
66
  handleInlineTriggerKeydown: (event: KeyboardEvent) => void;
73
- connectedCallback(): void;
74
67
  applyContentAnimation(animation: ContentAnimation): Promise<boolean>;
75
68
  renderTheme(content: TemplateResult): TemplateResult;
76
69
  render(): TemplateResult;
@@ -78,5 +71,6 @@ export declare class ActiveOverlay extends SpectrumElement {
78
71
  private stealOverlayContentPromise;
79
72
  private stealOverlayContentResolver;
80
73
  protected getUpdateComplete(): Promise<boolean>;
74
+ disconnectedCallback(): void;
81
75
  }
82
76
  export {};