@vaadin/notification 25.3.0-alpha9 → 25.3.0-beta1

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": "@vaadin/notification",
3
- "version": "25.3.0-alpha9",
3
+ "version": "25.3.0-beta1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,19 +37,19 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/component-base": "25.3.0-alpha9",
41
- "@vaadin/lit-renderer": "25.3.0-alpha9",
42
- "@vaadin/overlay": "25.3.0-alpha9",
43
- "@vaadin/vaadin-themable-mixin": "25.3.0-alpha9",
40
+ "@vaadin/component-base": "25.3.0-beta1",
41
+ "@vaadin/lit-renderer": "25.3.0-beta1",
42
+ "@vaadin/overlay": "25.3.0-beta1",
43
+ "@vaadin/vaadin-themable-mixin": "25.3.0-beta1",
44
44
  "lit": "^3.0.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@vaadin/aura": "25.3.0-alpha9",
48
- "@vaadin/button": "25.3.0-alpha9",
49
- "@vaadin/chai-plugins": "25.3.0-alpha9",
50
- "@vaadin/test-runner-commands": "25.3.0-alpha9",
47
+ "@vaadin/aura": "25.3.0-beta1",
48
+ "@vaadin/button": "25.3.0-beta1",
49
+ "@vaadin/chai-plugins": "25.3.0-beta1",
50
+ "@vaadin/test-runner-commands": "25.3.0-beta1",
51
51
  "@vaadin/testing-helpers": "^2.0.0",
52
- "@vaadin/vaadin-lumo-styles": "25.3.0-alpha9",
52
+ "@vaadin/vaadin-lumo-styles": "25.3.0-beta1",
53
53
  "sinon": "^22.0.0"
54
54
  },
55
55
  "customElements": "custom-elements.json",
@@ -57,5 +57,5 @@
57
57
  "web-types.json",
58
58
  "web-types.lit.json"
59
59
  ],
60
- "gitHead": "cb915ebde095ec5b94a87af93dd4530f51984c52"
60
+ "gitHead": "295432e44a6967e1aff36462b2e3e1d0e64eb8cc"
61
61
  }
@@ -7,7 +7,6 @@ import { render } from 'lit';
7
7
  import { isTemplateResult } from 'lit/directive-helpers.js';
8
8
  import { isIOS } from '@vaadin/component-base/src/browser-utils.js';
9
9
  import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
10
- import { shouldAnimate } from '@vaadin/overlay/src/vaadin-overlay-utils.js';
11
10
  import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
12
11
 
13
12
  /**
@@ -343,6 +342,27 @@ export const NotificationMixin = (superClass) =>
343
342
  this._card.removeEventListener('animationend', this.__animationEndListener);
344
343
  }
345
344
 
345
+ /**
346
+ * Detect whether an animation runs on the card, so that its end can be awaited before the
347
+ * card is removed. A card that is not rendered, has no animation name, or has a zero
348
+ * duration does not fire `animationend`.
349
+ *
350
+ * `getStateAnimations()` cannot replace this: the card declares the same keyframes for both
351
+ * states, so nothing restarts when it closes right after the opening animation ended, and no
352
+ * animation is found. The computed style still reports the declared animation, which is what
353
+ * the card needs in order to stay in the DOM until its height has collapsed.
354
+ * @private
355
+ */
356
+ __shouldAnimateCard() {
357
+ const style = getComputedStyle(this._card);
358
+ const name = style.getPropertyValue('animation-name');
359
+ const hasDuration = style
360
+ .getPropertyValue('animation-duration')
361
+ .split(',')
362
+ .some((duration) => parseFloat(duration) > 0);
363
+ return style.getPropertyValue('display') !== 'none' && name && name !== 'none' && hasDuration;
364
+ }
365
+
346
366
  /**
347
367
  * Run the callback when the animation of the card itself ends. Animations of the
348
368
  * notification content also end on the card, as the content is in its light DOM.
@@ -365,7 +385,7 @@ export const NotificationMixin = (superClass) =>
365
385
 
366
386
  this._card.setAttribute('opening', '');
367
387
  this._appendNotificationCard();
368
- if (shouldAnimate(this._card)) {
388
+ if (this.__shouldAnimateCard()) {
369
389
  this.__onCardAnimationEnd(() => this.__cleanUpOpeningClosingState());
370
390
  } else {
371
391
  this.__cleanUpOpeningClosingState();
@@ -428,7 +448,7 @@ export const NotificationMixin = (superClass) =>
428
448
  this.__cleanUpOpeningClosingState();
429
449
 
430
450
  this._card.setAttribute('closing', '');
431
- if (shouldAnimate(this._card)) {
451
+ if (this.__shouldAnimateCard()) {
432
452
  this.__onCardAnimationEnd(() => {
433
453
  this._removeNotificationCard();
434
454
  this.__cleanUpOpeningClosingState();
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/notification",
4
- "version": "25.3.0-alpha9",
4
+ "version": "25.3.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/notification",
4
- "version": "25.3.0-alpha9",
4
+ "version": "25.3.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {