ember-promise-modals 3.0.0 → 4.0.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.
@@ -1,30 +1,45 @@
1
+ import { settled } from '@ember/test-helpers';
2
+
3
+ function setMinimum(propertyName) {
4
+ document.documentElement.style.setProperty(propertyName, '0.001s');
5
+ }
6
+
7
+ function unsetMinimum(propertyName) {
8
+ document.documentElement.style.removeProperty(propertyName);
9
+ }
10
+
1
11
  export function setupPromiseModals(hooks) {
2
12
  hooks.beforeEach(function () {
3
- document.documentElement.style.setProperty('--epm-animation-backdrop-in-duration', `0.00001s`);
4
- document.documentElement.style.setProperty('--epm-animation-backdrop-out-duration', `0.00001s`);
5
- document.documentElement.style.setProperty('--epm-animation-backdrop-in-delay', `0.00001s`);
6
- document.documentElement.style.setProperty('--epm-animation-backdrop-out-delay', `0.00001s`);
7
- document.documentElement.style.setProperty('--epm-animation-modal-in-duration', `0.00001s`);
8
- document.documentElement.style.setProperty('--epm-animation-modal-out-duration', `0.00001s`);
9
- document.documentElement.style.setProperty('--epm-animation-modal-in-delay', `0.00001s`);
10
- document.documentElement.style.setProperty('--epm-animation-modal-out-delay', `0.00001s`);
13
+ setMinimum('--epm-animation-backdrop-in-duration');
14
+ setMinimum('--epm-animation-backdrop-out-duration');
15
+ setMinimum('--epm-animation-backdrop-in-delay');
16
+ setMinimum('--epm-animation-backdrop-out-delay');
17
+ setMinimum('--epm-animation-modal-in-duration');
18
+ setMinimum('--epm-animation-modal-out-duration');
19
+ setMinimum('--epm-animation-modal-in-delay');
20
+ setMinimum('--epm-animation-modal-out-delay');
11
21
 
12
22
  this.modals = this.owner.lookup('service:modals');
13
23
  });
14
24
 
15
- hooks.afterEach(function () {
25
+ hooks.afterEach(async function () {
16
26
  // be sure to close all modals after a test
17
27
  if (this.modals) {
18
- this.modals._stack.forEach(modal => modal.close());
28
+ this.modals._destroyModals();
19
29
  }
20
30
 
21
- document.documentElement.style.removeProperty('--epm-animation-backdrop-in-duration', `0.00001s`);
22
- document.documentElement.style.removeProperty('--epm-animation-backdrop-out-duration', `0.00001s`);
23
- document.documentElement.style.removeProperty('--epm-animation-backdrop-in-delay', `0.00001s`);
24
- document.documentElement.style.removeProperty('--epm-animation-backdrop-out-delay', `0.00001s`);
25
- document.documentElement.style.removeProperty('--epm-animation-modal-in-duration', `0.00001s`);
26
- document.documentElement.style.removeProperty('--epm-animation-modal-out-duration', `0.00001s`);
27
- document.documentElement.style.removeProperty('--epm-animation-modal-in-delay', `0.00001s`);
28
- document.documentElement.style.removeProperty('--epm-animation-modal-out-delay', `0.00001s`);
31
+ delete this.modals;
32
+
33
+ unsetMinimum('--epm-animation-backdrop-in-duration');
34
+ unsetMinimum('--epm-animation-backdrop-out-duration');
35
+ unsetMinimum('--epm-animation-backdrop-in-delay');
36
+ unsetMinimum('--epm-animation-backdrop-out-delay');
37
+ unsetMinimum('--epm-animation-modal-in-duration');
38
+ unsetMinimum('--epm-animation-modal-out-duration');
39
+ unsetMinimum('--epm-animation-modal-in-delay');
40
+ unsetMinimum('--epm-animation-modal-out-delay');
41
+
42
+ // wait for any registered test waiters to settle
43
+ await settled();
29
44
  });
30
45
  }
@@ -0,0 +1 @@
1
+ export { default } from 'ember-promise-modals/helpers/open-modal';
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "ember-promise-modals",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "The better way to handle modals in your Ember.js apps.",
5
5
  "keywords": [
6
6
  "ember-addon"
7
7
  ],
8
- "repository": "https://github.com/simplabs/ember-promise-modals",
8
+ "repository": "https://github.com/mainmatter/ember-promise-modals",
9
9
  "license": "MIT",
10
- "author": "simplabs GmbH",
10
+ "author": "Mainmatter GmbH",
11
11
  "directories": {
12
12
  "doc": "doc",
13
13
  "test": "tests"
@@ -30,24 +30,25 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@ember/test-waiters": "^3.0.1",
33
- "@embroider/util": "^1.6.0",
33
+ "@embroider/util": "^1.7.1",
34
34
  "broccoli-funnel": "^3.0.8",
35
35
  "broccoli-merge-trees": "^4.2.0",
36
36
  "broccoli-postcss": "^6.0.1",
37
- "ember-auto-import": "^2.4.1",
37
+ "ember-auto-import": "^2.4.2",
38
38
  "ember-cli-babel": "^7.26.11",
39
39
  "ember-cli-htmlbars": "^6.0.1",
40
- "focus-trap": "^6.7.3",
41
- "postcss-preset-env": "^7.4.3"
40
+ "focus-trap": "^6.9.3",
41
+ "postcss-preset-env": "^7.6.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@babel/eslint-parser": "7.17.0",
44
+ "@babel/eslint-parser": "7.19.1",
45
45
  "@ember/optional-features": "2.0.0",
46
- "@ember/test-helpers": "2.7.0",
47
- "@embroider/test-setup": "1.6.0",
46
+ "@ember/test-helpers": "2.9.0",
47
+ "@embroider/test-setup": "2.0.2",
48
+ "@release-it-plugins/lerna-changelog": "5.0.0",
48
49
  "broccoli-asset-rev": "3.0.0",
49
- "ember-cli": "4.3.0",
50
- "ember-cli-dependency-checker": "3.3.0",
50
+ "ember-cli": "4.9.2",
51
+ "ember-cli-dependency-checker": "3.3.1",
51
52
  "ember-cli-inject-live-reload": "2.1.0",
52
53
  "ember-cli-sri": "2.1.1",
53
54
  "ember-cli-terser": "4.0.2",
@@ -57,33 +58,33 @@
57
58
  "ember-maybe-import-regenerator": "1.0.0",
58
59
  "ember-qunit": "5.1.5",
59
60
  "ember-resolver": "8.0.3",
60
- "ember-source": "4.3.0",
61
+ "ember-source": "4.9.3",
61
62
  "ember-source-channel-url": "3.0.0",
62
- "ember-template-lint": "4.3.0",
63
+ "ember-template-lint": "5.3.0",
63
64
  "ember-try": "2.0.0",
64
- "eslint": "8.13.0",
65
+ "eslint": "8.29.0",
65
66
  "eslint-config-prettier": "8.5.0",
66
- "eslint-plugin-ember": "10.6.0",
67
- "eslint-plugin-import-helpers": "1.2.1",
67
+ "eslint-plugin-ember": "11.2.1",
68
+ "eslint-plugin-import-helpers": "1.3.1",
68
69
  "eslint-plugin-node": "11.1.0",
69
- "eslint-plugin-prettier": "4.0.0",
70
- "eslint-plugin-promise": "6.0.0",
71
- "eslint-plugin-qunit": "7.2.0",
70
+ "eslint-plugin-prettier": "4.2.1",
71
+ "eslint-plugin-promise": "6.1.1",
72
+ "eslint-plugin-qunit": "7.3.4",
72
73
  "loader.js": "4.7.0",
73
74
  "npm-run-all": "4.1.5",
74
- "prettier": "2.6.2",
75
- "qunit": "2.18.1",
75
+ "prettier": "2.8.1",
76
+ "qunit": "2.19.3",
76
77
  "qunit-console-grouper": "0.3.0",
77
78
  "qunit-dom": "2.0.0",
78
- "release-it": "^14.14.1",
79
- "release-it-lerna-changelog": "^4.0.1",
80
- "webpack": "^5.72.0"
79
+ "release-it": "15.5.1",
80
+ "sinon": "15.0.0",
81
+ "webpack": "5.75.0"
81
82
  },
82
83
  "engines": {
83
84
  "node": "12.* || >= 14.*"
84
85
  },
85
86
  "changelog": {
86
- "repo": "simplabs/ember-promise-modals",
87
+ "repo": "mainmatter/ember-promise-modals",
87
88
  "labels": {
88
89
  "breaking": ":boom: Breaking Change",
89
90
  "enhancement": ":rocket: Enhancement",
@@ -102,6 +103,7 @@
102
103
  "peerDependencyRules": {
103
104
  "ignoreMissing": [
104
105
  "@babel/core",
106
+ "mustache",
105
107
  "postcss",
106
108
  "webpack"
107
109
  ]