ember-promise-modals 4.0.0 → 5.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.
Files changed (35) hide show
  1. package/README.md +27 -58
  2. package/addon-main.cjs +4 -0
  3. package/dist/_app_/components/epm-modal-container.js +1 -0
  4. package/dist/_app_/components/epm-modal.js +1 -0
  5. package/dist/_app_/helpers/open-modal.js +1 -0
  6. package/dist/_app_/services/modals.js +1 -0
  7. package/{addon/styles/ember-promise-modals.css → dist/components/epm-modal-container.css} +17 -15
  8. package/dist/components/epm-modal-container.js +14 -0
  9. package/dist/components/epm-modal-container.js.map +1 -0
  10. package/{addon/components/modal.js → dist/components/epm-modal.js} +26 -48
  11. package/dist/components/epm-modal.js.map +1 -0
  12. package/{addon → dist}/helpers/open-modal.js +13 -12
  13. package/dist/helpers/open-modal.js.map +1 -0
  14. package/{addon → dist}/modal.js +12 -36
  15. package/dist/modal.js.map +1 -0
  16. package/{addon → dist}/services/modals.js +10 -22
  17. package/dist/services/modals.js.map +1 -0
  18. package/{addon-test-support → dist/test-support}/index.js +4 -7
  19. package/dist/test-support/index.js.map +1 -0
  20. package/package.json +54 -82
  21. package/.prettierignore +0 -27
  22. package/.release-it.js +0 -20
  23. package/CHANGELOG.md +0 -205
  24. package/MIGRATION.md +0 -80
  25. package/addon/components/modal-container.js +0 -11
  26. package/addon/templates/components/modal-container.hbs +0 -12
  27. package/addon/templates/components/modal.hbs +0 -6
  28. package/app/components/epm-modal-container.js +0 -1
  29. package/app/components/epm-modal.js +0 -1
  30. package/app/helpers/open-modal.js +0 -1
  31. package/app/services/modals.js +0 -1
  32. package/config/environment.js +0 -5
  33. package/index.js +0 -45
  34. package/pnpm-lock.yaml +0 -14235
  35. package/renovate.json +0 -29
@@ -2,74 +2,62 @@ import { A } from '@ember/array';
2
2
  import { computed } from '@ember/object';
3
3
  import { alias } from '@ember/object/computed';
4
4
  import Service from '@ember/service';
5
+ import Modal from '../modal.js';
5
6
 
6
- import Modal from '../modal';
7
-
8
- export default Service.extend({
7
+ var modals = Service.extend({
9
8
  count: computed('_stack.@each.isClosing', function () {
10
9
  return this._stack.filter(modal => !modal.isClosing).length;
11
10
  }),
12
11
  top: alias('_stack.lastObject'),
13
-
14
12
  focusTrapOptions: undefined,
15
-
16
13
  init() {
17
14
  this._super(...arguments);
18
15
  this._stack = A([]);
19
-
20
16
  if (this.focusTrapOptions !== null) {
21
17
  this.focusTrapOptions = {
22
18
  ...(this.focusTrapOptions ?? {}),
23
- clickOutsideDeactivates: this.focusTrapOptions?.clickOutsideDeactivates ?? true,
19
+ clickOutsideDeactivates: this.focusTrapOptions?.clickOutsideDeactivates ?? true
24
20
  };
25
21
  }
26
22
  },
27
-
28
23
  willDestroy() {
29
24
  this._onLastModalRemoved();
30
25
  this._onModalAnimationEnd();
31
26
  this._destroyModals();
32
-
33
27
  this._super(...arguments);
34
28
  },
35
-
36
29
  /**
37
- * @param {string} name component path
30
+ * @param {*} componentClass component class
38
31
  * @param {*} data passed to the component template
39
32
  * @param {ModalOptions} options applied to the modal
40
33
  * @returns {Modal}
41
34
  */
42
- open(name, data, options) {
43
- let modal = new Modal(this, name, data, options);
44
-
35
+ open(componentClass, data, options) {
36
+ let modal = new Modal(this, componentClass, data, options);
45
37
  this._stack.pushObject(modal);
46
-
47
38
  if (this._stack.length === 1) {
48
39
  this._onFirstModalAdded();
49
40
  }
50
-
51
41
  return modal;
52
42
  },
53
-
54
43
  _destroyModals() {
55
44
  this._stack.forEach(modal => {
56
45
  modal._destroy();
57
46
  });
58
47
  },
59
-
60
48
  _onFirstModalAdded() {
61
49
  document.body.classList.add('epm-scrolling-disabled');
62
50
  },
63
-
64
51
  _onLastModalRemoved() {
65
52
  document.body.classList.remove('epm-scrolling-disabled');
66
53
  },
67
-
68
54
  _onModalAnimationStart() {
69
55
  document.body.classList.add('epm-animating');
70
56
  },
71
-
72
57
  _onModalAnimationEnd() {
73
58
  document.body.classList.remove('epm-animating');
74
- },
59
+ }
75
60
  });
61
+
62
+ export { modals as default };
63
+ //# sourceMappingURL=modals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modals.js","sources":["../../src/services/modals.js"],"sourcesContent":["import { A } from '@ember/array';\nimport { computed } from '@ember/object';\nimport { alias } from '@ember/object/computed';\nimport Service from '@ember/service';\n\nimport Modal from '../modal';\n\nexport default Service.extend({\n count: computed('_stack.@each.isClosing', function () {\n return this._stack.filter(modal => !modal.isClosing).length;\n }),\n top: alias('_stack.lastObject'),\n\n focusTrapOptions: undefined,\n\n init() {\n this._super(...arguments);\n this._stack = A([]);\n\n if (this.focusTrapOptions !== null) {\n this.focusTrapOptions = {\n ...(this.focusTrapOptions ?? {}),\n clickOutsideDeactivates: this.focusTrapOptions?.clickOutsideDeactivates ?? true,\n };\n }\n },\n\n willDestroy() {\n this._onLastModalRemoved();\n this._onModalAnimationEnd();\n this._destroyModals();\n\n this._super(...arguments);\n },\n\n /**\n * @param {*} componentClass component class\n * @param {*} data passed to the component template\n * @param {ModalOptions} options applied to the modal\n * @returns {Modal}\n */\n open(componentClass, data, options) {\n let modal = new Modal(this, componentClass, data, options);\n\n this._stack.pushObject(modal);\n\n if (this._stack.length === 1) {\n this._onFirstModalAdded();\n }\n\n return modal;\n },\n\n _destroyModals() {\n this._stack.forEach(modal => {\n modal._destroy();\n });\n },\n\n _onFirstModalAdded() {\n document.body.classList.add('epm-scrolling-disabled');\n },\n\n _onLastModalRemoved() {\n document.body.classList.remove('epm-scrolling-disabled');\n },\n\n _onModalAnimationStart() {\n document.body.classList.add('epm-animating');\n },\n\n _onModalAnimationEnd() {\n document.body.classList.remove('epm-animating');\n },\n});\n"],"names":["Service","extend","count","computed","_stack","filter","modal","isClosing","length","top","alias","focusTrapOptions","undefined","init","_super","arguments","A","clickOutsideDeactivates","willDestroy","_onLastModalRemoved","_onModalAnimationEnd","_destroyModals","open","componentClass","data","options","Modal","pushObject","_onFirstModalAdded","forEach","_destroy","document","body","classList","add","remove","_onModalAnimationStart"],"mappings":";;;;;;AAOA,aAAeA,OAAO,CAACC,MAAM,CAAC;AAC5BC,EAAAA,KAAK,EAAEC,QAAQ,CAAC,wBAAwB,EAAE,YAAY;AACpD,IAAA,OAAO,IAAI,CAACC,MAAM,CAACC,MAAM,CAACC,KAAK,IAAI,CAACA,KAAK,CAACC,SAAS,CAAC,CAACC,MAAM,CAAA;AAC7D,GAAC,CAAC;AACFC,EAAAA,GAAG,EAAEC,KAAK,CAAC,mBAAmB,CAAC;AAE/BC,EAAAA,gBAAgB,EAAEC,SAAS;AAE3BC,EAAAA,IAAIA,GAAG;AACL,IAAA,IAAI,CAACC,MAAM,CAAC,GAAGC,SAAS,CAAC,CAAA;AACzB,IAAA,IAAI,CAACX,MAAM,GAAGY,CAAC,CAAC,EAAE,CAAC,CAAA;AAEnB,IAAA,IAAI,IAAI,CAACL,gBAAgB,KAAK,IAAI,EAAE;MAClC,IAAI,CAACA,gBAAgB,GAAG;AACtB,QAAA,IAAI,IAAI,CAACA,gBAAgB,IAAI,EAAE;AAC/BM,QAAAA,uBAAuB,EAAE,IAAI,CAACN,gBAAgB,EAAEM,uBAAuB,IAAI,IAAA;OAC5E,CAAA;AACH,KAAA;GACD;AAEDC,EAAAA,WAAWA,GAAG;IACZ,IAAI,CAACC,mBAAmB,EAAE,CAAA;IAC1B,IAAI,CAACC,oBAAoB,EAAE,CAAA;IAC3B,IAAI,CAACC,cAAc,EAAE,CAAA;AAErB,IAAA,IAAI,CAACP,MAAM,CAAC,GAAGC,SAAS,CAAC,CAAA;GAC1B;AAED;AACF;AACA;AACA;AACA;AACA;AACEO,EAAAA,IAAIA,CAACC,cAAc,EAAEC,IAAI,EAAEC,OAAO,EAAE;AAClC,IAAA,IAAInB,KAAK,GAAG,IAAIoB,KAAK,CAAC,IAAI,EAAEH,cAAc,EAAEC,IAAI,EAAEC,OAAO,CAAC,CAAA;AAE1D,IAAA,IAAI,CAACrB,MAAM,CAACuB,UAAU,CAACrB,KAAK,CAAC,CAAA;AAE7B,IAAA,IAAI,IAAI,CAACF,MAAM,CAACI,MAAM,KAAK,CAAC,EAAE;MAC5B,IAAI,CAACoB,kBAAkB,EAAE,CAAA;AAC3B,KAAA;AAEA,IAAA,OAAOtB,KAAK,CAAA;GACb;AAEDe,EAAAA,cAAcA,GAAG;AACf,IAAA,IAAI,CAACjB,MAAM,CAACyB,OAAO,CAACvB,KAAK,IAAI;MAC3BA,KAAK,CAACwB,QAAQ,EAAE,CAAA;AAClB,KAAC,CAAC,CAAA;GACH;AAEDF,EAAAA,kBAAkBA,GAAG;IACnBG,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACC,GAAG,CAAC,wBAAwB,CAAC,CAAA;GACtD;AAEDf,EAAAA,mBAAmBA,GAAG;IACpBY,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAC,wBAAwB,CAAC,CAAA;GACzD;AAEDC,EAAAA,sBAAsBA,GAAG;IACvBL,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACC,GAAG,CAAC,eAAe,CAAC,CAAA;GAC7C;AAEDd,EAAAA,oBAAoBA,GAAG;IACrBW,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAC,eAAe,CAAC,CAAA;AACjD,GAAA;AACF,CAAC,CAAC;;;;"}
@@ -3,12 +3,10 @@ import { settled } from '@ember/test-helpers';
3
3
  function setMinimum(propertyName) {
4
4
  document.documentElement.style.setProperty(propertyName, '0.001s');
5
5
  }
6
-
7
6
  function unsetMinimum(propertyName) {
8
7
  document.documentElement.style.removeProperty(propertyName);
9
8
  }
10
-
11
- export function setupPromiseModals(hooks) {
9
+ function setupPromiseModals(hooks) {
12
10
  hooks.beforeEach(function () {
13
11
  setMinimum('--epm-animation-backdrop-in-duration');
14
12
  setMinimum('--epm-animation-backdrop-out-duration');
@@ -18,18 +16,14 @@ export function setupPromiseModals(hooks) {
18
16
  setMinimum('--epm-animation-modal-out-duration');
19
17
  setMinimum('--epm-animation-modal-in-delay');
20
18
  setMinimum('--epm-animation-modal-out-delay');
21
-
22
19
  this.modals = this.owner.lookup('service:modals');
23
20
  });
24
-
25
21
  hooks.afterEach(async function () {
26
22
  // be sure to close all modals after a test
27
23
  if (this.modals) {
28
24
  this.modals._destroyModals();
29
25
  }
30
-
31
26
  delete this.modals;
32
-
33
27
  unsetMinimum('--epm-animation-backdrop-in-duration');
34
28
  unsetMinimum('--epm-animation-backdrop-out-duration');
35
29
  unsetMinimum('--epm-animation-backdrop-in-delay');
@@ -43,3 +37,6 @@ export function setupPromiseModals(hooks) {
43
37
  await settled();
44
38
  });
45
39
  }
40
+
41
+ export { setupPromiseModals };
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/test-support/index.js"],"sourcesContent":["import { settled } from '@ember/test-helpers';\n\nfunction setMinimum(propertyName) {\n document.documentElement.style.setProperty(propertyName, '0.001s');\n}\n\nfunction unsetMinimum(propertyName) {\n document.documentElement.style.removeProperty(propertyName);\n}\n\nexport function setupPromiseModals(hooks) {\n hooks.beforeEach(function () {\n setMinimum('--epm-animation-backdrop-in-duration');\n setMinimum('--epm-animation-backdrop-out-duration');\n setMinimum('--epm-animation-backdrop-in-delay');\n setMinimum('--epm-animation-backdrop-out-delay');\n setMinimum('--epm-animation-modal-in-duration');\n setMinimum('--epm-animation-modal-out-duration');\n setMinimum('--epm-animation-modal-in-delay');\n setMinimum('--epm-animation-modal-out-delay');\n\n this.modals = this.owner.lookup('service:modals');\n });\n\n hooks.afterEach(async function () {\n // be sure to close all modals after a test\n if (this.modals) {\n this.modals._destroyModals();\n }\n\n delete this.modals;\n\n unsetMinimum('--epm-animation-backdrop-in-duration');\n unsetMinimum('--epm-animation-backdrop-out-duration');\n unsetMinimum('--epm-animation-backdrop-in-delay');\n unsetMinimum('--epm-animation-backdrop-out-delay');\n unsetMinimum('--epm-animation-modal-in-duration');\n unsetMinimum('--epm-animation-modal-out-duration');\n unsetMinimum('--epm-animation-modal-in-delay');\n unsetMinimum('--epm-animation-modal-out-delay');\n\n // wait for any registered test waiters to settle\n await settled();\n });\n}\n"],"names":["setMinimum","propertyName","document","documentElement","style","setProperty","unsetMinimum","removeProperty","setupPromiseModals","hooks","beforeEach","modals","owner","lookup","afterEach","_destroyModals","settled"],"mappings":";;AAEA,SAASA,UAAUA,CAACC,YAAY,EAAE;EAChCC,QAAQ,CAACC,eAAe,CAACC,KAAK,CAACC,WAAW,CAACJ,YAAY,EAAE,QAAQ,CAAC,CAAA;AACpE,CAAA;AAEA,SAASK,YAAYA,CAACL,YAAY,EAAE;EAClCC,QAAQ,CAACC,eAAe,CAACC,KAAK,CAACG,cAAc,CAACN,YAAY,CAAC,CAAA;AAC7D,CAAA;AAEO,SAASO,kBAAkBA,CAACC,KAAK,EAAE;EACxCA,KAAK,CAACC,UAAU,CAAC,YAAY;IAC3BV,UAAU,CAAC,sCAAsC,CAAC,CAAA;IAClDA,UAAU,CAAC,uCAAuC,CAAC,CAAA;IACnDA,UAAU,CAAC,mCAAmC,CAAC,CAAA;IAC/CA,UAAU,CAAC,oCAAoC,CAAC,CAAA;IAChDA,UAAU,CAAC,mCAAmC,CAAC,CAAA;IAC/CA,UAAU,CAAC,oCAAoC,CAAC,CAAA;IAChDA,UAAU,CAAC,gCAAgC,CAAC,CAAA;IAC5CA,UAAU,CAAC,iCAAiC,CAAC,CAAA;IAE7C,IAAI,CAACW,MAAM,GAAG,IAAI,CAACC,KAAK,CAACC,MAAM,CAAC,gBAAgB,CAAC,CAAA;AACnD,GAAC,CAAC,CAAA;EAEFJ,KAAK,CAACK,SAAS,CAAC,kBAAkB;AAChC;IACA,IAAI,IAAI,CAACH,MAAM,EAAE;AACf,MAAA,IAAI,CAACA,MAAM,CAACI,cAAc,EAAE,CAAA;AAC9B,KAAA;IAEA,OAAO,IAAI,CAACJ,MAAM,CAAA;IAElBL,YAAY,CAAC,sCAAsC,CAAC,CAAA;IACpDA,YAAY,CAAC,uCAAuC,CAAC,CAAA;IACrDA,YAAY,CAAC,mCAAmC,CAAC,CAAA;IACjDA,YAAY,CAAC,oCAAoC,CAAC,CAAA;IAClDA,YAAY,CAAC,mCAAmC,CAAC,CAAA;IACjDA,YAAY,CAAC,oCAAoC,CAAC,CAAA;IAClDA,YAAY,CAAC,gCAAgC,CAAC,CAAA;IAC9CA,YAAY,CAAC,iCAAiC,CAAC,CAAA;;AAE/C;IACA,MAAMU,OAAO,EAAE,CAAA;AACjB,GAAC,CAAC,CAAA;AACJ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-promise-modals",
3
- "version": "4.0.0",
3
+ "version": "5.0.0",
4
4
  "description": "The better way to handle modals in your Ember.js apps.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -12,101 +12,73 @@
12
12
  "doc": "doc",
13
13
  "test": "tests"
14
14
  },
15
- "scripts": {
16
- "build": "ember build --env=production",
17
- "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
18
- "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:*:fix\"",
19
- "lint:hbs": "ember-template-lint .",
20
- "lint:hbs:fix": "ember-template-lint . --fix",
21
- "lint:js": "eslint . --cache",
22
- "lint:js:fix": "eslint . --fix",
23
- "lint:md": "prettier --check '**/*.md'",
24
- "lint:md:fix": "prettier --write '**/*.md'",
25
- "release": "release-it",
26
- "start": "ember serve",
27
- "test": "ember test",
28
- "test:all": "npm-run-all lint test:*",
29
- "test:ember-compatibility": "ember try:each"
15
+ "exports": {
16
+ ".": "./dist/index.js",
17
+ "./*": "./dist/*",
18
+ "./test-support": "./dist/test-support/index.js",
19
+ "./addon-main.cjs": "./addon-main.cjs"
20
+ },
21
+ "files": [
22
+ "addon-main.cjs",
23
+ "dist"
24
+ ],
25
+ "ember-addon": {
26
+ "main": "addon-main.cjs",
27
+ "type": "addon",
28
+ "version": 2,
29
+ "app-js": {
30
+ "./components/epm-modal-container.js": "./dist/_app_/components/epm-modal-container.js",
31
+ "./components/epm-modal.js": "./dist/_app_/components/epm-modal.js",
32
+ "./helpers/open-modal.js": "./dist/_app_/helpers/open-modal.js",
33
+ "./services/modals.js": "./dist/_app_/services/modals.js"
34
+ }
30
35
  },
31
36
  "dependencies": {
32
- "@ember/test-waiters": "^3.0.1",
37
+ "@ember/test-waiters": "^3.0.2",
38
+ "@embroider/addon-shim": "^1.8.7",
33
39
  "@embroider/util": "^1.7.1",
34
- "broccoli-funnel": "^3.0.8",
35
- "broccoli-merge-trees": "^4.2.0",
36
- "broccoli-postcss": "^6.0.1",
37
- "ember-auto-import": "^2.4.2",
38
- "ember-cli-babel": "^7.26.11",
39
- "ember-cli-htmlbars": "^6.0.1",
40
- "focus-trap": "^6.9.3",
41
- "postcss-preset-env": "^7.6.0"
40
+ "decorator-transforms": "^1.0.1",
41
+ "focus-trap": "^6.9.3"
42
42
  },
43
43
  "devDependencies": {
44
- "@babel/eslint-parser": "7.19.1",
45
- "@ember/optional-features": "2.0.0",
46
- "@ember/test-helpers": "2.9.0",
47
- "@embroider/test-setup": "2.0.2",
48
- "@release-it-plugins/lerna-changelog": "5.0.0",
49
- "broccoli-asset-rev": "3.0.0",
50
- "ember-cli": "4.9.2",
51
- "ember-cli-dependency-checker": "3.3.1",
52
- "ember-cli-inject-live-reload": "2.1.0",
53
- "ember-cli-sri": "2.1.1",
54
- "ember-cli-terser": "4.0.2",
55
- "ember-disable-prototype-extensions": "1.1.3",
56
- "ember-export-application-global": "2.0.1",
57
- "ember-load-initializers": "2.1.2",
58
- "ember-maybe-import-regenerator": "1.0.0",
59
- "ember-qunit": "5.1.5",
60
- "ember-resolver": "8.0.3",
61
- "ember-source": "4.9.3",
62
- "ember-source-channel-url": "3.0.0",
63
- "ember-template-lint": "5.3.0",
64
- "ember-try": "2.0.0",
65
- "eslint": "8.29.0",
66
- "eslint-config-prettier": "8.5.0",
67
- "eslint-plugin-ember": "11.2.1",
44
+ "@babel/core": "7.24.4",
45
+ "@babel/eslint-parser": "7.24.1",
46
+ "@babel/plugin-proposal-decorators": "7.24.1",
47
+ "@babel/plugin-transform-class-properties": "7.24.1",
48
+ "@embroider/addon-dev": "4.2.1",
49
+ "@rollup/plugin-babel": "6.0.4",
50
+ "ember-template-lint": "5.13.0",
51
+ "eslint": "8.57.0",
52
+ "eslint-config-prettier": "8.10.0",
53
+ "eslint-plugin-ember": "11.12.0",
68
54
  "eslint-plugin-import-helpers": "1.3.1",
69
- "eslint-plugin-node": "11.1.0",
55
+ "eslint-plugin-n": "16.6.2",
70
56
  "eslint-plugin-prettier": "4.2.1",
71
57
  "eslint-plugin-promise": "6.1.1",
72
58
  "eslint-plugin-qunit": "7.3.4",
73
- "loader.js": "4.7.0",
74
59
  "npm-run-all": "4.1.5",
75
- "prettier": "2.8.1",
76
- "qunit": "2.19.3",
77
- "qunit-console-grouper": "0.3.0",
78
- "qunit-dom": "2.0.0",
79
- "release-it": "15.5.1",
80
- "sinon": "15.0.0",
81
- "webpack": "5.75.0"
60
+ "prettier": "2.8.8",
61
+ "rollup": "4.14.0",
62
+ "rollup-plugin-copy": "3.5.0",
63
+ "webpack": "5.89.0"
82
64
  },
83
- "engines": {
84
- "node": "12.* || >= 14.*"
65
+ "peerDependencies": {
66
+ "@ember/test-helpers": "^3.0.0"
85
67
  },
86
- "changelog": {
87
- "repo": "mainmatter/ember-promise-modals",
88
- "labels": {
89
- "breaking": ":boom: Breaking Change",
90
- "enhancement": ":rocket: Enhancement",
91
- "bug": ":bug: Bug Fix",
92
- "documentation": ":memo: Documentation",
93
- "internal": ":house: Internal"
94
- }
68
+ "engines": {
69
+ "node": ">= 16.*"
95
70
  },
96
71
  "ember": {
97
72
  "edition": "octane"
98
73
  },
99
- "ember-addon": {
100
- "configPath": "tests/dummy/config"
101
- },
102
- "pnpm": {
103
- "peerDependencyRules": {
104
- "ignoreMissing": [
105
- "@babel/core",
106
- "mustache",
107
- "postcss",
108
- "webpack"
109
- ]
110
- }
74
+ "scripts": {
75
+ "build": "rollup --config",
76
+ "start": "rollup --config --watch",
77
+ "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
78
+ "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:*:fix\"",
79
+ "lint:hbs": "ember-template-lint .",
80
+ "lint:hbs:fix": "ember-template-lint . --fix",
81
+ "lint:js": "eslint . --cache",
82
+ "lint:js:fix": "eslint . --fix"
111
83
  }
112
- }
84
+ }
package/.prettierignore DELETED
@@ -1,27 +0,0 @@
1
- # unconventional js
2
- /blueprints/*/files/
3
- /vendor/
4
-
5
- # compiled output
6
- /dist/
7
- /tmp/
8
-
9
- # dependencies
10
- /bower_components/
11
- /node_modules/
12
-
13
- # misc
14
- /coverage/
15
- !.*
16
- .eslintcache
17
- .lint-todo/
18
-
19
- # ember-try
20
- /.node_modules.ember-try/
21
- /bower.json.ember-try
22
- /npm-shrinkwrap.json.ember-try
23
- /package.json.ember-try
24
- /package-lock.json.ember-try
25
- /yarn.lock.ember-try
26
-
27
- CHANGELOG.md
package/.release-it.js DELETED
@@ -1,20 +0,0 @@
1
- /* eslint-disable no-template-curly-in-string */
2
- module.exports = {
3
- plugins: {
4
- '@release-it-plugins/lerna-changelog': {
5
- infile: 'CHANGELOG.md',
6
- },
7
- },
8
- git: {
9
- commitMessage: 'v${version}',
10
- tagName: 'v${version}',
11
- },
12
- github: {
13
- release: true,
14
- releaseName: 'v${version}',
15
- tokenRef: 'GITHUB_AUTH',
16
- },
17
- npm: {
18
- publish: false,
19
- },
20
- };
package/CHANGELOG.md DELETED
@@ -1,205 +0,0 @@
1
- # Changelog
2
-
3
-
4
-
5
-
6
- ## v4.0.0 (2023-06-01)
7
-
8
- #### :boom: Breaking Change
9
- * [#856](https://github.com/mainmatter/ember-promise-modals/pull/856) setupPromiseModals should wait for test waiters to settle ([@marcin-wicha](https://github.com/marcin-wicha))
10
-
11
- #### :rocket: Enhancement
12
- * [#550](https://github.com/mainmatter/ember-promise-modals/pull/550) Modal template helper ([@pichfl](https://github.com/pichfl))
13
-
14
- #### :bug: Bug Fix
15
- * [#826](https://github.com/mainmatter/ember-promise-modals/pull/826) Ensure animations are triggered when `prefer-reduced-animation` is used ([@pichfl](https://github.com/pichfl))
16
- * [#682](https://github.com/mainmatter/ember-promise-modals/pull/682) Improve test helper ([@pichfl](https://github.com/pichfl))
17
-
18
- #### :house: Internal
19
- * [#819](https://github.com/mainmatter/ember-promise-modals/pull/819) Update ember-try configuration ([@pichfl](https://github.com/pichfl))
20
- * [#688](https://github.com/mainmatter/ember-promise-modals/pull/688) Prefer "happy path" code style for `_resolve()` ([@pichfl](https://github.com/pichfl))
21
- * [#687](https://github.com/mainmatter/ember-promise-modals/pull/687) Extract destruction of the modals effects into a method and apply them ([@pichfl](https://github.com/pichfl))
22
- * [#686](https://github.com/mainmatter/ember-promise-modals/pull/686) Closing the modal should inform the modals service ([@pichfl](https://github.com/pichfl))
23
- * [#766](https://github.com/mainmatter/ember-promise-modals/pull/766) Replace deprecated release-it-lerna-changelog ([@pichfl](https://github.com/pichfl))
24
- * [#685](https://github.com/mainmatter/ember-promise-modals/pull/685) Move attaching/detaching `animationend` event handler into methods and generalize related names ([@pichfl](https://github.com/pichfl))
25
- * [#763](https://github.com/mainmatter/ember-promise-modals/pull/763) Allow automatic installation of peer dependencies ([@pichfl](https://github.com/pichfl))
26
- * [#684](https://github.com/mainmatter/ember-promise-modals/pull/684) Move focusTrap setup/teardown to methods ([@pichfl](https://github.com/pichfl))
27
- * [#683](https://github.com/mainmatter/ember-promise-modals/pull/683) Replace retained element reference with a method ([@pichfl](https://github.com/pichfl))
28
- * [#598](https://github.com/mainmatter/ember-promise-modals/pull/598) Refactor handling of `focusTrap.onDeactivate` method ([@pichfl](https://github.com/pichfl))
29
- * [#681](https://github.com/mainmatter/ember-promise-modals/pull/681) remove dependabot configuration ([@nickschot](https://github.com/nickschot))
30
-
31
- #### Committers: 5
32
- - Florian Pichler ([@pichfl](https://github.com/pichfl))
33
- - Gabor Babicz ([@zeppelin](https://github.com/zeppelin))
34
- - Marcin Wicha ([@marcin-wicha](https://github.com/marcin-wicha))
35
- - Nick Schot ([@nickschot](https://github.com/nickschot))
36
- - Sebastian Helbig ([@sebastianhelbig](https://github.com/sebastianhelbig))
37
-
38
- ## v3.0.1 (2022-04-12)
39
-
40
- #### :bug: Bug Fix
41
- * [#596](https://github.com/mainmatter/ember-promise-modals/pull/596) Ensure calls to @close run before the focus-out deactivation ([@pichfl](https://github.com/pichfl))
42
-
43
- #### :house: Internal
44
- * [#597](https://github.com/mainmatter/ember-promise-modals/pull/597) Remove deprecated `clickOutsideDeactivates` option ([@pichfl](https://github.com/pichfl))
45
-
46
- #### Committers: 1
47
- - Florian Pichler ([@pichfl](https://github.com/pichfl))
48
-
49
- ## v3.0.0 (2022-04-11)
50
-
51
- #### :boom: Breaking Change
52
- * [#588](https://github.com/mainmatter/ember-promise-modals/pull/588) Use ember-auto-import@2 ([@pichfl](https://github.com/pichfl))
53
- * [#438](https://github.com/mainmatter/ember-promise-modals/pull/438) bump @ember/test-waiters to 3.0.0 ([@nickschot](https://github.com/nickschot))
54
- * [#437](https://github.com/mainmatter/ember-promise-modals/pull/437) Drop Node 10 support ([@nickschot](https://github.com/nickschot))
55
-
56
- #### :rocket: Enhancement
57
- * [#549](https://github.com/mainmatter/ember-promise-modals/pull/549) Enhance focus trap configuration ([@zeppelin](https://github.com/zeppelin))
58
- * [#533](https://github.com/mainmatter/ember-promise-modals/pull/533) Legacy: Downgrade native class to Ember.Object ([@pichfl](https://github.com/pichfl))
59
- * [#436](https://github.com/mainmatter/ember-promise-modals/pull/436) Embroider optimized compatibility ([@nickschot](https://github.com/nickschot))
60
- * [#517](https://github.com/mainmatter/ember-promise-modals/pull/517) Add option to disable focus trap ([@zeppelin](https://github.com/zeppelin))
61
-
62
- #### :memo: Documentation
63
- * [#502](https://github.com/mainmatter/ember-promise-modals/pull/502) Provide additional documentation for the Modal class and ModalOptions ([@pichfl](https://github.com/pichfl))
64
-
65
- #### :house: Internal
66
- * [#594](https://github.com/mainmatter/ember-promise-modals/pull/594) Configure release-it ([@pichfl](https://github.com/pichfl))
67
- * [#570](https://github.com/mainmatter/ember-promise-modals/pull/570) Setup Renovatebot ([@nickschot](https://github.com/nickschot))
68
- * [#477](https://github.com/mainmatter/ember-promise-modals/pull/477) Replace Yarn with pnpm ([@pichfl](https://github.com/pichfl))
69
- * [#530](https://github.com/mainmatter/ember-promise-modals/pull/530) Internal: Extend and apply prettier configuration ([@pichfl](https://github.com/pichfl))
70
- * [#500](https://github.com/mainmatter/ember-promise-modals/pull/500) Specify octane edition in package.json & add missing optional features ([@nickschot](https://github.com/nickschot))
71
- * [#499](https://github.com/mainmatter/ember-promise-modals/pull/499) Update ember-release scenario to use auto-import v2 ([@nickschot](https://github.com/nickschot))
72
-
73
- #### Committers: 3
74
- - Florian Pichler ([@pichfl](https://github.com/pichfl))
75
- - Gabor Babicz ([@zeppelin](https://github.com/zeppelin))
76
- - Nick Schot ([@nickschot](https://github.com/nickschot))
77
-
78
- ## v2.0.0 (2021-09-01)
79
-
80
- #### :boom: Breaking Change
81
- * [#427](https://github.com/mainmatter/ember-promise-modals/pull/427) Generate one backdrop per modal ([@aoumiri](https://github.com/aoumiri))
82
-
83
- #### :rocket: Enhancement
84
- * [#427](https://github.com/mainmatter/ember-promise-modals/pull/427) Generate one backdrop per modal ([@aoumiri](https://github.com/aoumiri))
85
-
86
- #### :memo: Documentation
87
- * [#432](https://github.com/mainmatter/ember-promise-modals/pull/432) Fix responsiveness of dummy app ([@nickschot](https://github.com/nickschot))
88
- * [#414](https://github.com/mainmatter/ember-promise-modals/pull/414) Improve README and dummy application ([@pichfl](https://github.com/pichfl))
89
-
90
- #### :house: Internal
91
- * [#431](https://github.com/mainmatter/ember-promise-modals/pull/431) Use env=production when building the dummy application ([@pichfl](https://github.com/pichfl))
92
- * [#430](https://github.com/mainmatter/ember-promise-modals/pull/430) Update production build path for GitHub pages ([@pichfl](https://github.com/pichfl))
93
- * [#415](https://github.com/mainmatter/ember-promise-modals/pull/415) Deploy dummy application to Github pages ([@pichfl](https://github.com/pichfl))
94
-
95
- #### Committers: 4
96
- - Anass OUMIRI ([@aoumiri](https://github.com/aoumiri))
97
- - Florian Pichler ([@pichfl](https://github.com/pichfl))
98
- - Nick Schot ([@nickschot](https://github.com/nickschot))
99
- - [@dependabot-preview[bot]](https://github.com/apps/dependabot-preview)
100
-
101
-
102
- ## v1.1.1 (2021-07-27)
103
-
104
- #### :bug: Bug Fix
105
- * [#422](https://github.com/mainmatter/ember-promise-modals/pull/422) fix promsie-modals from breaking when used in another addon instead of an app ([@nickschot](https://github.com/nickschot))
106
-
107
- #### Committers: 1
108
- - Nick Schot ([@nickschot](https://github.com/nickschot))
109
-
110
-
111
- ## v1.1.0 (2021-07-27)
112
-
113
- #### :rocket: Enhancement
114
- * [#421](https://github.com/mainmatter/ember-promise-modals/pull/421) add optional onAnimationModalOutEnd hook ([@nickschot](https://github.com/nickschot))
115
-
116
- #### :bug: Bug Fix
117
- * [#420](https://github.com/mainmatter/ember-promise-modals/pull/420) explicitly specify animation delay and duration as separate to make sure they're properly used by the browser ([@nickschot](https://github.com/nickschot))
118
-
119
- #### Committers: 1
120
- - Nick Schot ([@nickschot](https://github.com/nickschot))
121
-
122
-
123
- ## v1.0.2 (2021-07-26)
124
-
125
- #### :bug: Bug Fix
126
- * [#419](https://github.com/mainmatter/ember-promise-modals/pull/419) fix setting a delay on the backdrop or modal makes animation break ([@nickschot](https://github.com/nickschot))
127
-
128
- #### :house: Internal
129
- * [#417](https://github.com/mainmatter/ember-promise-modals/pull/417) Delete unused modal service file from dummy app ([@nickschot](https://github.com/nickschot))
130
-
131
- #### Committers: 1
132
- - Nick Schot ([@nickschot](https://github.com/nickschot))
133
-
134
-
135
- ## v1.0.1 (2021-07-16)
136
-
137
- #### :bug: Bug Fix
138
- * [#412](https://github.com/mainmatter/ember-promise-modals/pull/412) fix backdrop not animating immediately after the last modal is closed ([@nickschot](https://github.com/nickschot))
139
-
140
- #### :house: Internal
141
- * [#413](https://github.com/mainmatter/ember-promise-modals/pull/413) use babel-eslint as eslint parser ([@nickschot](https://github.com/nickschot))
142
-
143
- #### Committers: 2
144
- - Nick Schot ([@nickschot](https://github.com/nickschot))
145
- - [@dependabot-preview[bot]](https://github.com/apps/dependabot-preview)
146
-
147
-
148
- ## v1.0.0 (2021-07-13)
149
-
150
- #### :boom: Breaking Change
151
- * [#148](https://github.com/mainmatter/ember-promise-modals/pull/148) Replace ember-animated with CSS animations ([@pichfl](https://github.com/pichfl))
152
-
153
- #### :rocket: Enhancement
154
- * [#148](https://github.com/mainmatter/ember-promise-modals/pull/148) Replace ember-animated with CSS animations ([@pichfl](https://github.com/pichfl))
155
-
156
- #### :house: Internal
157
- * [#407](https://github.com/mainmatter/ember-promise-modals/pull/407) upgrade to ember-qunit v5 ([@nickschot](https://github.com/nickschot))
158
- * [#309](https://github.com/mainmatter/ember-promise-modals/pull/309) Update addon layout according to latest ember addon blueprint ([@pichfl](https://github.com/pichfl))
159
-
160
- #### Committers: 3
161
- - Florian Pichler ([@pichfl](https://github.com/pichfl))
162
- - Nick Schot ([@nickschot](https://github.com/nickschot))
163
- - [@dependabot-preview[bot]](https://github.com/apps/dependabot-preview)
164
-
165
-
166
- ## v0.2.1 (2020-06-30)
167
-
168
- #### :rocket: Enhancement
169
- * [#178](https://github.com/mainmatter/ember-promise-modals/pull/178) Expose `clickOutsideDeactivates` on the `modals` service ([@Turbo87](https://github.com/Turbo87))
170
-
171
- #### :bug: Bug Fix
172
- * [#181](https://github.com/mainmatter/ember-promise-modals/pull/181) service/modals: Reset `.epm-scrolling-disabled` class in the destructor ([@Turbo87](https://github.com/Turbo87))
173
- * [#180](https://github.com/mainmatter/ember-promise-modals/pull/180) components/modal: Fix broken destructor ([@Turbo87](https://github.com/Turbo87))
174
-
175
- #### :house: Internal
176
- * [#179](https://github.com/mainmatter/ember-promise-modals/pull/179) Add `qunit-console-grouper` dev dependency ([@Turbo87](https://github.com/Turbo87))
177
-
178
- #### Committers: 1
179
- - Tobias Bieniek ([@Turbo87](https://github.com/Turbo87))
180
-
181
-
182
- ## v0.2.0 (2020-04-22)
183
-
184
- #### :boom: Breaking Change
185
- * [#142](https://github.com/mainmatter/ember-promise-modals/pull/142) Convert `ember-animated` to a peer dependency ([@Turbo87](https://github.com/Turbo87))
186
- * [#139](https://github.com/mainmatter/ember-promise-modals/pull/139) Drop Support for Node.js 8 ([@Turbo87](https://github.com/Turbo87))
187
-
188
- #### :rocket: Enhancement
189
- * [#137](https://github.com/mainmatter/ember-promise-modals/pull/137) Add Support for `ember-animated` v0.9 and v0.10 ([@dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
190
-
191
- #### :memo: Documentation
192
- * [#80](https://github.com/mainmatter/ember-promise-modals/pull/80) Update README ([@ansmonjol](https://github.com/ansmonjol))
193
-
194
- #### :house: Internal
195
- * [#143](https://github.com/mainmatter/ember-promise-modals/pull/143) CI: Add scenarios for Ember v3.12 and v3.16 ([@Turbo87](https://github.com/Turbo87))
196
- * [#141](https://github.com/mainmatter/ember-promise-modals/pull/141) Use GitHub Actions for CI ([@Turbo87](https://github.com/Turbo87))
197
-
198
- #### Committers: 2
199
- - Alexandre Monjol ([@ansmonjol](https://github.com/ansmonjol))
200
- - Tobias Bieniek ([@Turbo87](https://github.com/Turbo87))
201
-
202
-
203
- ## v0.1.0 (2019-09-03)
204
-
205
- Initial Release! 🎉
package/MIGRATION.md DELETED
@@ -1,80 +0,0 @@
1
- # Migration
2
-
3
- ## From 0.x.x to 1.x.x
4
-
5
- Version 1.0.0 replaced the ember-animated powered animations with CSS based animations. In addition to that the default animation was also changed. This guide will show you how to get the animations of the old version.
6
-
7
- ### From top/bottom animations
8
-
9
- The first step is to add some CSS which replicates the old animations to your app.
10
-
11
- ```css
12
- /* app/styles/app.css */
13
-
14
- /* === Variation 1: Custom animation which animates the modal in from the bottom and back */
15
- @keyframes from-bottom-in {
16
- 0% {
17
- opacity: 0;
18
- transform: translate(0, calc(50vh + 50%));
19
- }
20
- 100% {
21
- opacity: 1;
22
- transform: translate(0, 0);
23
- }
24
- }
25
-
26
- @keyframes from-bottom-out {
27
- 0% {
28
- opacity: 1;
29
- transform: translate(0, 0);
30
- }
31
- 100% {
32
- opacity: 0;
33
- transform: translate(0, calc(50vh + 50%));
34
- }
35
- }
36
-
37
- /* === Variation 2: Custom animation which animates the modal in from the top and back */
38
- @keyframes from-top-in {
39
- 0% {
40
- opacity: 0;
41
- transform: translate(0, calc(-50vh - 50%));
42
- }
43
- 100% {
44
- opacity: 1;
45
- transform: translate(0, 0);
46
- }
47
- }
48
-
49
- @keyframes from-top-out {
50
- 0% {
51
- opacity: 1;
52
- transform: translate(0, 0);
53
- }
54
- 100% {
55
- opacity: 0;
56
- transform: translate(0, calc(-50vh - 50%));
57
- }
58
- }
59
- ```
60
-
61
- Furthermore, some CSS variables will need to be overridden so that the new animation will be used (whichever of the two you prefer).
62
-
63
- ```css
64
- /* app/styles/app.css */
65
- :root {
66
- --epm-animation-backdrop-in-duration: 0.6s;
67
- --epm-animation-backdrop-out-duration: 0.6s;
68
- --epm-animation-modal-in-duration: 0.25s;
69
- --epm-animation-modal-out-duration: 0.25s;
70
- --epm-animation-modal-in: from-top-in var(--epm-animation-in-duration) ease-out;
71
- --epm-animation-modal-out: from-top-out var(--epm-animation-out-duration) ease-in;
72
- }
73
- ```
74
-
75
- ### Using both animations
76
-
77
- If you need to switch between both animations it's easiest to replicate the setup shown in the dummy app. See [the application.js controller](./tests/dummy/app/controllers/application.js)
78
- for how the modals are openend in your JavaScript actions and look at
79
- [app.css](./tests/dummy/app/styles/app.css) for the style definition of these
80
- custom animations.