@limetech/lime-elements 40.5.0 → 40.5.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.
@@ -1957,6 +1957,7 @@ const Portal = class {
1957
1957
  this.anchor = null;
1958
1958
  this.loaded = false;
1959
1959
  this.writtenStyles = {};
1960
+ this.scheduledRestyle = null;
1960
1961
  this.parents = new WeakMap();
1961
1962
  }
1962
1963
  disconnectedCallback() {
@@ -1991,7 +1992,7 @@ const Portal = class {
1991
1992
  }
1992
1993
  }
1993
1994
  render() {
1994
- return index.h("slot", { key: '32f6da268363dd30db38fb8189ee2d6414890959' });
1995
+ return index.h("slot", { key: 'ce5bfa7d65680773e1917e0a6d54256f5852bd65' });
1995
1996
  }
1996
1997
  onVisible() {
1997
1998
  if (!this.container && this.visible) {
@@ -2117,6 +2118,7 @@ const Portal = class {
2117
2118
  destroyPopper() {
2118
2119
  var _a, _b;
2119
2120
  (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
2121
+ this.cancelScheduledRestyle();
2120
2122
  (_b = this.popperInstance) === null || _b === void 0 ? void 0 : _b.destroy();
2121
2123
  this.popperInstance = null;
2122
2124
  }
@@ -2126,14 +2128,33 @@ const Portal = class {
2126
2128
  return;
2127
2129
  }
2128
2130
  (_a = this.observer) !== null && _a !== void 0 ? _a : (this.observer = new ResizeObserver(() => {
2129
- if (this.popperInstance) {
2130
- this.styleContainer();
2131
- this.popperInstance.update();
2132
- }
2131
+ this.scheduleRestyle();
2133
2132
  }));
2134
2133
  this.observer.observe(this.container);
2135
2134
  this.observer.observe(this.anchorElement);
2136
2135
  }
2136
+ // Restyling can resize the container this observer watches, so writing from
2137
+ // inside the callback re-enters it as a `ResizeObserver loop`.
2138
+ scheduleRestyle() {
2139
+ if (this.scheduledRestyle !== null) {
2140
+ return;
2141
+ }
2142
+ this.scheduledRestyle = requestAnimationFrame(() => {
2143
+ this.scheduledRestyle = null;
2144
+ if (!this.popperInstance) {
2145
+ return;
2146
+ }
2147
+ this.styleContainer();
2148
+ this.popperInstance.update();
2149
+ });
2150
+ }
2151
+ cancelScheduledRestyle() {
2152
+ if (this.scheduledRestyle === null) {
2153
+ return;
2154
+ }
2155
+ cancelAnimationFrame(this.scheduledRestyle);
2156
+ this.scheduledRestyle = null;
2157
+ }
2137
2158
  createPopperConfig() {
2138
2159
  const placement = this.getPlacement(this.openDirection);
2139
2160
  const flipPlacement = this.getFlipPlacement(this.openDirection);
@@ -165,7 +165,7 @@ const Popover = class {
165
165
  };
166
166
  Popover.style = popoverCss();
167
167
 
168
- const popoverSurfaceCss = () => `@charset "UTF-8";:host(limel-popover-surface){isolation:isolate;position:relative;display:flex;width:var(--popover-surface-width, auto);max-height:inherit;max-width:calc(100vw - 2rem);margin:0 0.25rem}.limel-popover-surface{flex:1;min-width:0;min-height:0;border-radius:var(--popover-border-radius, 0.75rem);box-shadow:var(--popover-box-shadow, var(--shadow-depth-16));backdrop-filter:blur(0.3125rem);-webkit-backdrop-filter:blur(0.3125rem)}.limel-popover-surface:after{transition:opacity 0.4s ease;pointer-events:none;content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;opacity:0.95;border-radius:var(--popover-border-radius, 0.75rem);background-color:var(--popover-body-background-color, var(--lime-elevated-surface-background-color))}.limel-popover-surface:focus{outline:none}.limel-popover-surface:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.limel-popover-surface:focus:after,.limel-popover-surface:focus-within:after{opacity:1}.limel-popover-surface>*{box-sizing:border-box}`;
168
+ const popoverSurfaceCss = () => `@charset "UTF-8";:host(limel-popover-surface){isolation:isolate;position:relative;display:flex;width:var(--popover-surface-width, auto);max-height:inherit;max-width:calc(100vw - 2rem);margin:0 0.25rem}.limel-popover-surface{flex:1;min-width:0;min-height:0;border-radius:var(--popover-border-radius, 0.75rem);box-shadow:var(--popover-box-shadow, var(--shadow-depth-16));border:1px solid rgb(var(--contrast-1200), 0.1);backdrop-filter:blur(0.3125rem);-webkit-backdrop-filter:blur(0.3125rem)}.limel-popover-surface:after{transition:opacity 0.4s ease;pointer-events:none;content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;opacity:0.95;border-radius:var(--popover-border-radius, 0.75rem);background-color:var(--popover-body-background-color, var(--lime-elevated-surface-background-color))}.limel-popover-surface:focus{outline:none}.limel-popover-surface:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.limel-popover-surface:focus:after,.limel-popover-surface:focus-within:after{opacity:1}.limel-popover-surface>*{box-sizing:border-box}`;
169
169
 
170
170
  const PopoverSurface = class {
171
171
  constructor(hostRef) {
@@ -119,6 +119,7 @@
119
119
  min-height: 0;
120
120
  border-radius: var(--popover-border-radius, 0.75rem);
121
121
  box-shadow: var(--popover-box-shadow, var(--shadow-depth-16));
122
+ border: 1px solid rgb(var(--contrast-1200), 0.1);
122
123
  backdrop-filter: blur(0.3125rem);
123
124
  -webkit-backdrop-filter: blur(0.3125rem);
124
125
  }
@@ -79,6 +79,7 @@ export class Portal {
79
79
  this.anchor = null;
80
80
  this.loaded = false;
81
81
  this.writtenStyles = {};
82
+ this.scheduledRestyle = null;
82
83
  this.parents = new WeakMap();
83
84
  }
84
85
  disconnectedCallback() {
@@ -113,7 +114,7 @@ export class Portal {
113
114
  }
114
115
  }
115
116
  render() {
116
- return h("slot", { key: '32f6da268363dd30db38fb8189ee2d6414890959' });
117
+ return h("slot", { key: 'ce5bfa7d65680773e1917e0a6d54256f5852bd65' });
117
118
  }
118
119
  onVisible() {
119
120
  if (!this.container && this.visible) {
@@ -239,6 +240,7 @@ export class Portal {
239
240
  destroyPopper() {
240
241
  var _a, _b;
241
242
  (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
243
+ this.cancelScheduledRestyle();
242
244
  (_b = this.popperInstance) === null || _b === void 0 ? void 0 : _b.destroy();
243
245
  this.popperInstance = null;
244
246
  }
@@ -248,14 +250,33 @@ export class Portal {
248
250
  return;
249
251
  }
250
252
  (_a = this.observer) !== null && _a !== void 0 ? _a : (this.observer = new ResizeObserver(() => {
251
- if (this.popperInstance) {
252
- this.styleContainer();
253
- this.popperInstance.update();
254
- }
253
+ this.scheduleRestyle();
255
254
  }));
256
255
  this.observer.observe(this.container);
257
256
  this.observer.observe(this.anchorElement);
258
257
  }
258
+ // Restyling can resize the container this observer watches, so writing from
259
+ // inside the callback re-enters it as a `ResizeObserver loop`.
260
+ scheduleRestyle() {
261
+ if (this.scheduledRestyle !== null) {
262
+ return;
263
+ }
264
+ this.scheduledRestyle = requestAnimationFrame(() => {
265
+ this.scheduledRestyle = null;
266
+ if (!this.popperInstance) {
267
+ return;
268
+ }
269
+ this.styleContainer();
270
+ this.popperInstance.update();
271
+ });
272
+ }
273
+ cancelScheduledRestyle() {
274
+ if (this.scheduledRestyle === null) {
275
+ return;
276
+ }
277
+ cancelAnimationFrame(this.scheduledRestyle);
278
+ this.scheduledRestyle = null;
279
+ }
259
280
  createPopperConfig() {
260
281
  const placement = this.getPlacement(this.openDirection);
261
282
  const flipPlacement = this.getFlipPlacement(this.openDirection);