From 82d8b8d4bd61d0134972108fa828fbcbcc3818e6 Mon Sep 17 00:00:00 2001 From: Luke Melia Date: Sun, 10 Apr 2022 16:15:42 -0400 Subject: [PATCH 1/2] Convert liquid-fire, liquid-tether, liquid-wormhole --- package.json | 19 ++++++--- yarn.lock | 112 ++++----------------------------------------------- 2 files changed, 21 insertions(+), 110 deletions(-) diff --git a/package.json b/package.json index 0215c582..290e8ba6 100644 --- a/package.json +++ b/package.json @@ -70,9 +70,6 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-qunit": "^7.2.0", - "liquid-fire": "^0.34.0", - "liquid-tether": "pzuraq/liquid-tether#7c140024787c3c1b266e89a2ef528eaea898c78e", - "liquid-wormhole": "pzuraq/liquid-wormhole#efa7e5ca518de7c1d6c52666b70bbc0671fcf380", "loader.js": "^4.7.0", "npm-run-all": "^4.1.5", "prettier": "^2.5.1", @@ -83,11 +80,23 @@ "webpack": "^5.67.0" }, "peerDependencies": { - "ember-tether": "^2.0.1" + "ember-tether": "^2.0.1", + "liquid-fire": "^0.34.0", + "liquid-tether": "pzuraq/liquid-tether#7c140024787c3c1b266e89a2ef528eaea898c78e", + "liquid-wormhole": "pzuraq/liquid-wormhole#efa7e5ca518de7c1d6c52666b70bbc0671fcf380" }, "peerDependenciesMeta": { "ember-tether": { "optional": true + }, + "liquid-fire": { + "optional": true + }, + "liquid-tether": { + "optional": true + }, + "liquid-wormhole": { + "optional": true } }, "resolutions": { @@ -127,6 +136,6 @@ }, "volta": { "node": "12.22.1", - "yarn": "1.22.10" + "yarn": "1.22.18" } } diff --git a/yarn.lock b/yarn.lock index bb682e80..c9e76391 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1052,15 +1052,6 @@ mkdirp "^1.0.4" silent-error "^1.1.1" -"@ember/render-modifiers@^2.0.2": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@ember/render-modifiers/-/render-modifiers-2.0.3.tgz#bdbc93c02f854e86902fa9a5aca538356d151d1f" - integrity sha512-E5R3RN6XapSQid93UNKLj774Xg6e2tpdJAz1T1NWLIWajEpWR/hVPBd6c8eRAUBnTliEewc4L3pq7mwUUdsWHA== - dependencies: - "@embroider/macros" ">= 0.48.1 < 2.0.0-alpha.1" - ember-cli-babel "^7.26.6" - ember-modifier-manager-polyfill "^1.2.0" - "@ember/test-helpers@^2.6.0": version "2.6.0" resolved "https://registry.yarnpkg.com/@ember/test-helpers/-/test-helpers-2.6.0.tgz#d687515c6ab49ba72717fc62046970ef4a72ea9c" @@ -1083,7 +1074,7 @@ ember-cli-version-checker "^5.1.2" semver "^7.3.5" -"@embroider/macros@1.0.0", "@embroider/macros@>= 0.48.1 < 2.0.0-alpha.1", "@embroider/macros@^1.0.0": +"@embroider/macros@1.0.0", "@embroider/macros@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@embroider/macros/-/macros-1.0.0.tgz#2dfab550ba4e03cbf6e3524759949749ced98cc2" integrity sha512-RutDJ27j1eFQulyv83yJm27oSypsMd/UZyy62Q0NU00TIsIgQPCXaDiGIONWcJuAAVbtBRP3X4LMvaBAeq5g+A== @@ -3052,7 +3043,7 @@ broccoli-output-wrapper@^3.2.5: heimdalljs-logger "^0.1.10" symlink-or-copy "^1.2.0" -broccoli-persistent-filter@^1.1.5, broccoli-persistent-filter@^1.1.6, broccoli-persistent-filter@^1.4.3: +broccoli-persistent-filter@^1.1.6, broccoli-persistent-filter@^1.4.3: version "1.4.6" resolved "https://registry.yarnpkg.com/broccoli-persistent-filter/-/broccoli-persistent-filter-1.4.6.tgz#80762d19000880a77da33c34373299c0f6a3e615" integrity sha512-0RejLwoC95kv4kta8KAa+FmECJCK78Qgm8SRDEK7YyU0N9Cx6KpY3UCDy9WELl3mCXLN8TokNxc7/hp3lL4lfw== @@ -3189,14 +3180,6 @@ broccoli-stew@^3.0.0: symlink-or-copy "^1.2.0" walk-sync "^1.1.3" -broccoli-string-replace@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/broccoli-string-replace/-/broccoli-string-replace-0.1.2.tgz#1ed92f85680af8d503023925e754e4e33676b91f" - integrity sha1-HtkvhWgK+NUDAjkl51Tk4zZ2uR8= - dependencies: - broccoli-persistent-filter "^1.1.5" - minimatch "^3.0.3" - broccoli-terser-sourcemap@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/broccoli-terser-sourcemap/-/broccoli-terser-sourcemap-4.1.0.tgz#5f37441b64a3b6bfb0c67e9af232259c9576f115" @@ -4562,7 +4545,7 @@ ember-cli-babel-plugin-helpers@^1.0.0, ember-cli-babel-plugin-helpers@^1.1.1: resolved "https://registry.yarnpkg.com/ember-cli-babel-plugin-helpers/-/ember-cli-babel-plugin-helpers-1.1.1.tgz#5016b80cdef37036c4282eef2d863e1d73576879" integrity sha512-sKvOiPNHr5F/60NLd7SFzMpYPte/nnGkq/tMIfXejfKHIhaiIkYFqX8Z9UFTKWLLn+V7NOaby6niNPZUdvKCRw== -ember-cli-babel@^7.0.0, ember-cli-babel@^7.1.2, ember-cli-babel@^7.1.3, ember-cli-babel@^7.10.0, ember-cli-babel@^7.13.0, ember-cli-babel@^7.13.2, ember-cli-babel@^7.22.1, ember-cli-babel@^7.23.0, ember-cli-babel@^7.23.1, ember-cli-babel@^7.26.11, ember-cli-babel@^7.26.6, ember-cli-babel@^7.26.8, ember-cli-babel@^7.7.3: +ember-cli-babel@^7.0.0, ember-cli-babel@^7.1.2, ember-cli-babel@^7.1.3, ember-cli-babel@^7.13.0, ember-cli-babel@^7.13.2, ember-cli-babel@^7.22.1, ember-cli-babel@^7.23.0, ember-cli-babel@^7.23.1, ember-cli-babel@^7.26.6, ember-cli-babel@^7.26.8, ember-cli-babel@^7.7.3: version "7.26.11" resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-7.26.11.tgz#50da0fe4dcd99aada499843940fec75076249a9f" integrity sha512-JJYeYjiz/JTn34q7F5DSOjkkZqy8qwFOOxXfE6pe9yEJqWGu4qErKxlz8I22JoVEQ/aBUO+OcKTpmctvykM9YA== @@ -4769,7 +4752,7 @@ ember-cli-typescript@^2.0.2: stagehand "^1.0.0" walk-sync "^1.0.0" -ember-cli-version-checker@^2.1.0, ember-cli-version-checker@^2.1.2: +ember-cli-version-checker@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/ember-cli-version-checker/-/ember-cli-version-checker-2.2.0.tgz#47771b731fe0962705e27c8199a9e3825709f3b3" integrity sha512-G+KtYIVlSOWGcNaTFHk76xR4GdzDLzAS4uxZUKdASuFX0KJE43C6DaqL+y3VTpUFLI2FIkAS6HZ4I1YBi+S3hg== @@ -4912,7 +4895,7 @@ ember-code-snippet@^2.4.0: es6-promise "^1.0.0" glob "^7.1.3" -ember-compatibility-helpers@^1.1.2, ember-compatibility-helpers@^1.2.0, ember-compatibility-helpers@^1.2.1: +ember-compatibility-helpers@^1.1.2, ember-compatibility-helpers@^1.2.1: version "1.2.5" resolved "https://registry.yarnpkg.com/ember-compatibility-helpers/-/ember-compatibility-helpers-1.2.5.tgz#b8363b1d5b8725afa9a4fe2b2986ac28626c6f23" integrity sha512-7cddkQQp8Rs2Mqrj0xqZ0uO7eC9tBCKyZNcP2iE1RxQqOGPv8fiPkj1TUeidUB/Qe80lstoVXWMEuqqhW7Yy9A== @@ -4958,15 +4941,6 @@ ember-load-initializers@^2.1.2: ember-cli-babel "^7.13.0" ember-cli-typescript "^2.0.2" -ember-modifier-manager-polyfill@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/ember-modifier-manager-polyfill/-/ember-modifier-manager-polyfill-1.2.0.tgz#cf4444e11a42ac84f5c8badd85e635df57565dda" - integrity sha512-bnaKF1LLKMkBNeDoetvIJ4vhwRPKIIumWr6dbVuW6W6p4QV8ZiO+GdF8J7mxDNlog9CeL9Z/7wam4YS86G8BYA== - dependencies: - ember-cli-babel "^7.10.0" - ember-cli-version-checker "^2.1.2" - ember-compatibility-helpers "^1.2.0" - ember-qunit@^5.1.5: version "5.1.5" resolved "https://registry.yarnpkg.com/ember-qunit/-/ember-qunit-5.1.5.tgz#24a7850f052be24189ff597dfc31b923e684c444" @@ -7685,62 +7659,6 @@ linkify-it@^3.0.1: dependencies: uc.micro "^1.0.1" -liquid-fire@^0.34.0: - version "0.34.0" - resolved "https://registry.yarnpkg.com/liquid-fire/-/liquid-fire-0.34.0.tgz#3522b444a4ae3f2fb824cc6c483e04fc5bba2d94" - integrity sha512-IppYBxIUhv00+Hi2Lno9kG4pcBUHVJD2ROQA7o9r0bLuLDfXTG94C8m6dwfYlswQBGdJAuN6a9ItLxftj8DgSw== - dependencies: - "@embroider/macros" "^1.0.0" - broccoli-funnel "^3.0.8" - broccoli-merge-trees "^4.2.0" - broccoli-stew "^3.0.0" - broccoli-string-replace "^0.1.2" - ember-cli-babel "^7.26.11" - ember-cli-htmlbars "^6.0.1" - ember-cli-version-checker "^5.1.2" - match-media "^0.2.0" - velocity-animate "^1.5.2" - -liquid-tether@pzuraq/liquid-tether#7c140024787c3c1b266e89a2ef528eaea898c78e: - version "2.0.7" - resolved "https://codeload.github.com/pzuraq/liquid-tether/tar.gz/7c140024787c3c1b266e89a2ef528eaea898c78e" - dependencies: - "@ember/jquery" "^2.0.0" - broccoli-funnel "^3.0.8" - broccoli-merge-trees "^4.2.0" - ember-cli-babel "^7.26.8" - ember-cli-htmlbars "^6.0.1" - liquid-wormhole pzuraq/liquid-wormhole#8cfb67b7fbf158f1e9187bbc2c47c10ee32b5a28 - tether "^1.4.7" - -liquid-wormhole@pzuraq/liquid-wormhole#8cfb67b7fbf158f1e9187bbc2c47c10ee32b5a28: - version "2.1.5" - resolved "https://codeload.github.com/pzuraq/liquid-wormhole/tar.gz/8cfb67b7fbf158f1e9187bbc2c47c10ee32b5a28" - dependencies: - "@ember/jquery" "^2.0.0" - "@ember/render-modifiers" "^2.0.2" - "@embroider/util" "^1.0.0" - "@glimmer/component" "^1.0.4" - "@glimmer/tracking" "^1.0.4" - ember-cli-babel "^7.26.11" - ember-cli-htmlbars "^6.0.1" - ember-decorators "^6.1.1" - perf-primitives rwwagner90/perf-primitives#a6a26f11497ca27be3763a88a5f20744e424756b - -liquid-wormhole@pzuraq/liquid-wormhole#efa7e5ca518de7c1d6c52666b70bbc0671fcf380: - version "2.1.5" - resolved "https://codeload.github.com/pzuraq/liquid-wormhole/tar.gz/efa7e5ca518de7c1d6c52666b70bbc0671fcf380" - dependencies: - "@ember/jquery" "^2.0.0" - "@ember/render-modifiers" "^2.0.2" - "@embroider/util" "^1.0.0" - "@glimmer/component" "^1.0.4" - "@glimmer/tracking" "^1.0.4" - ember-cli-babel "^7.26.11" - ember-cli-htmlbars "^6.0.1" - ember-decorators "^6.1.1" - perf-primitives rwwagner90/perf-primitives#a6a26f11497ca27be3763a88a5f20744e424756b - livereload-js@^3.3.1: version "3.3.2" resolved "https://registry.yarnpkg.com/livereload-js/-/livereload-js-3.3.2.tgz#c88b009c6e466b15b91faa26fd7c99d620e12651" @@ -8155,11 +8073,6 @@ markdown-it@^8.3.1: mdurl "^1.0.1" uc.micro "^1.0.5" -match-media@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/match-media/-/match-media-0.2.0.tgz#ea4e09742e7253cc7d7e1599ba627e0fa29fbc50" - integrity sha1-6k4JdC5yU8x9fhWZumJ+D6KfvFA= - matcher-collection@^1.0.0, matcher-collection@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/matcher-collection/-/matcher-collection-1.1.2.tgz#1076f506f10ca85897b53d14ef54f90a5c426838" @@ -8356,7 +8269,7 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -9224,12 +9137,6 @@ pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" -perf-primitives@rwwagner90/perf-primitives#a6a26f11497ca27be3763a88a5f20744e424756b: - version "0.0.6" - resolved "https://codeload.github.com/rwwagner90/perf-primitives/tar.gz/a6a26f11497ca27be3763a88a5f20744e424756b" - dependencies: - ember-cli-babel "^7.26.6" - picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -11080,7 +10987,7 @@ testem@^3.2.0: tap-parser "^7.0.0" tmp "0.0.33" -tether@^1.4.0, tether@^1.4.7: +tether@^1.4.0: version "1.4.7" resolved "https://registry.yarnpkg.com/tether/-/tether-1.4.7.tgz#d56a818590d8fe72e387f77a67f93ab96d8e1fb2" integrity sha512-Z0J1aExjoFU8pybVkQAo/vD2wfSO63r+XOPfWQMC5qtf1bI7IWqNk4MiyBcgvvnY8kqnY06dVdvwTK2S3PU/Fw== @@ -11596,11 +11503,6 @@ vary@^1, vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= -velocity-animate@^1.5.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/velocity-animate/-/velocity-animate-1.5.2.tgz#5a351d75fca2a92756f5c3867548b873f6c32105" - integrity sha512-m6EXlCAMetKztO1ppBhGU1/1MR3IiEevO6ESq6rcrSQ3Q77xYSW13jkfXW88o4xMrkXJhy/U7j4wFR/twMB0Eg== - vm-browserify@^1.0.1: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" From 99900930f5a78826fc02de109144bb0329673758 Mon Sep 17 00:00:00 2001 From: Luke Melia Date: Mon, 11 Apr 2022 00:35:48 -0400 Subject: [PATCH 2/2] WIP, convert to v2 addon --- .editorconfig | 19 - .gitignore | 31 +- CONTRIBUTING.md | 6 +- README.md | 121 +- addon/.eslintignore | 11 + addon/.gitignore | 27 + .prettierignore => addon/.prettierignore | 2 +- .prettierrc.js => addon/.prettierrc.js | 0 .../.template-lintrc.js | 0 addon/addon-main.js | 3 + .../add-modals-container.js | 0 .../ember-modal-appearance.css | 0 .../ember-modal-structure.css | 0 addon/babel.config.json | 7 + addon/config/environment.js | 3 + index.js => addon/index.js | 0 addon/package.json | 134 + addon/rollup.config.js | 60 + .../components/basic-dialog/index.hbs} | 0 .../components/basic-dialog/index.js} | 4 +- .../index.js} | 0 .../components/in-place-dialog/index.hbs} | 0 .../components/in-place-dialog/index.js} | 4 +- .../components/liquid-dialog/index.hbs} | 0 .../components/liquid-dialog/index.js} | 5 +- .../liquid-tether-dialog/index.hbs} | 0 .../components/liquid-tether-dialog/index.js} | 5 +- .../components/modal-dialog/index.hbs} | 0 .../components/modal-dialog/index.js} | 4 +- .../components/tether-dialog/index.hbs} | 0 .../components/tether-dialog/index.js} | 5 +- addon/{ => src}/helpers/ignore-children.js | 0 .../add-modals-container.js | 0 addon/src/services/modal-dialog.js | 26 + addon/{ => src}/utils/config-utils.js | 0 ...ember-modal-dialog-positioned-container.js | 1 - .../ember-modal-dialog/-basic-dialog.js | 1 - .../ember-modal-dialog/-in-place-dialog.js | 1 - .../ember-modal-dialog/-liquid-dialog.js | 1 - .../-liquid-tether-dialog.js | 1 - .../ember-modal-dialog/-tether-dialog.js | 1 - app/components/modal-dialog.js | 1 - app/helpers/ignore-children.js | 1 - app/services/modal-dialog.js | 19 - config/environment.js | 18 - ember-cli-build.js | 25 - jsconfig.json | 14 + package.json | 144 +- .ember-cli => test-app/.ember-cli | 0 test-app/.eslintignore | 23 + .eslintrc.js => test-app/.eslintrc.js | 29 +- test-app/.gitignore | 29 + .npmignore => test-app/.npmignore | 7 +- .eslintignore => test-app/.prettierignore | 4 +- test-app/.prettierrc.js | 5 + test-app/.template-lintrc.js | 10 + .watchmanconfig => test-app/.watchmanconfig | 2 +- {tests/dummy => test-app}/app/app.js | 2 +- .../component-that-uses-modal-dialog.js | 2 + .../components/my-cool-modal-dialog-two.js | 0 .../app/components/my-cool-modal-dialog.js | 0 .../app/controllers/animatable.js | 38 +- .../app/controllers/index.js | 63 +- .../app/controllers/tethered-animatable.js | 154 + .../app/controllers/tethered.js | 37 +- .../app/helpers/lorem-ipsum.js | 0 {tests/dummy => test-app}/app/index.html | 4 +- {tests/dummy => test-app}/app/router.js | 2 +- .../app/styles/_tomorrow-night-eighties.css | 0 {tests/dummy => test-app}/app/styles/app.css | 0 .../app/templates/animatable.hbs | 36 +- .../app/templates/application.hbs | 0 .../component-that-uses-modal-dialog.hbs | 0 .../app/templates/index.hbs | 0 .../app/templates/tethered-animatable.hbs | 0 .../app/templates/tethered.hbs | 0 {tests/dummy => test-app}/app/transitions.js | 0 .../config/deprecation-workflow.js | 0 .../config/ember-cli-update.json | 0 {config => test-app/config}/ember-try.js | 0 .../dummy => test-app}/config/environment.js | 2 +- .../config/optional-features.json | 0 {tests/dummy => test-app}/config/targets.js | 0 test-app/ember-cli-build.js | 18 + test-app/package.json | 90 + .../public/modal-dialog.png | Bin {tests/dummy => test-app}/public/robots.txt | 0 .../public/tether-dialog.png | Bin testem.js => test-app/testem.js | 0 .../tests}/acceptance/animatable-test.js | 0 .../tests}/acceptance/basic-test.js | 0 .../acceptance/tethered-animatable-test.js | 0 .../tests}/acceptance/tethered-test.js | 0 {tests => test-app/tests}/helpers/.gitkeep | 0 .../tests}/helpers/modal-asserts.js | 0 {tests => test-app/tests}/index.html | 6 +- {tests => test-app/tests}/test-helper.js | 4 +- .../tests}/unit/services/modal-dialog-test.js | 0 {vendor => test-app/vendor}/.gitkeep | 0 .../app/controllers/tethered-animatable.js | 150 - yarn.lock | 2487 ++++++++++++----- 101 files changed, 2669 insertions(+), 1240 deletions(-) delete mode 100644 .editorconfig create mode 100644 addon/.eslintignore create mode 100644 addon/.gitignore rename .prettierignore => addon/.prettierignore (93%) rename .prettierrc.js => addon/.prettierrc.js (100%) rename .template-lintrc.js => addon/.template-lintrc.js (100%) create mode 100644 addon/addon-main.js rename {app => addon/app}/instance-initializers/add-modals-container.js (100%) rename {app => addon/app}/styles/ember-modal-dialog/ember-modal-appearance.css (100%) rename {app => addon/app}/styles/ember-modal-dialog/ember-modal-structure.css (100%) create mode 100644 addon/babel.config.json create mode 100644 addon/config/environment.js rename index.js => addon/index.js (100%) create mode 100644 addon/package.json create mode 100644 addon/rollup.config.js rename addon/{templates/components/basic-dialog.hbs => src/components/basic-dialog/index.hbs} (100%) rename addon/{components/basic-dialog.js => src/components/basic-dialog/index.js} (96%) rename addon/{components/positioned-container.js => src/components/ember-modal-dialog-positioned-container/index.js} (100%) rename addon/{templates/components/in-place-dialog.hbs => src/components/in-place-dialog/index.hbs} (100%) rename addon/{components/in-place-dialog.js => src/components/in-place-dialog/index.js} (76%) rename addon/{templates/components/liquid-dialog.hbs => src/components/liquid-dialog/index.hbs} (100%) rename addon/{components/liquid-dialog.js => src/components/liquid-dialog/index.js} (52%) rename addon/{templates/components/liquid-tether-dialog.hbs => src/components/liquid-tether-dialog/index.hbs} (100%) rename addon/{components/liquid-tether-dialog.js => src/components/liquid-tether-dialog/index.js} (86%) rename addon/{templates/components/modal-dialog.hbs => src/components/modal-dialog/index.hbs} (100%) rename addon/{components/modal-dialog.js => src/components/modal-dialog/index.js} (96%) rename addon/{templates/components/tether-dialog.hbs => src/components/tether-dialog/index.hbs} (100%) rename addon/{components/tether-dialog.js => src/components/tether-dialog/index.js} (87%) rename addon/{ => src}/helpers/ignore-children.js (100%) rename addon/{ => src}/instance-initializers/add-modals-container.js (100%) create mode 100644 addon/src/services/modal-dialog.js rename addon/{ => src}/utils/config-utils.js (100%) delete mode 100644 app/components/ember-modal-dialog-positioned-container.js delete mode 100644 app/components/ember-modal-dialog/-basic-dialog.js delete mode 100644 app/components/ember-modal-dialog/-in-place-dialog.js delete mode 100644 app/components/ember-modal-dialog/-liquid-dialog.js delete mode 100644 app/components/ember-modal-dialog/-liquid-tether-dialog.js delete mode 100644 app/components/ember-modal-dialog/-tether-dialog.js delete mode 100644 app/components/modal-dialog.js delete mode 100644 app/helpers/ignore-children.js delete mode 100644 app/services/modal-dialog.js delete mode 100644 config/environment.js delete mode 100644 ember-cli-build.js create mode 100644 jsconfig.json rename .ember-cli => test-app/.ember-cli (100%) create mode 100644 test-app/.eslintignore rename .eslintrc.js => test-app/.eslintrc.js (54%) create mode 100644 test-app/.gitignore rename .npmignore => test-app/.npmignore (87%) rename .eslintignore => test-app/.prettierignore (90%) create mode 100644 test-app/.prettierrc.js create mode 100644 test-app/.template-lintrc.js rename .watchmanconfig => test-app/.watchmanconfig (94%) rename {tests/dummy => test-app}/app/app.js (87%) rename {tests/dummy => test-app}/app/components/component-that-uses-modal-dialog.js (77%) rename {tests/dummy => test-app}/app/components/my-cool-modal-dialog-two.js (100%) rename {tests/dummy => test-app}/app/components/my-cool-modal-dialog.js (100%) rename {tests/dummy => test-app}/app/controllers/animatable.js (56%) rename {tests/dummy => test-app}/app/controllers/index.js (50%) create mode 100644 test-app/app/controllers/tethered-animatable.js rename {tests/dummy => test-app}/app/controllers/tethered.js (55%) rename {tests/dummy => test-app}/app/helpers/lorem-ipsum.js (100%) rename {tests/dummy => test-app}/app/index.html (89%) rename {tests/dummy => test-app}/app/router.js (85%) rename {tests/dummy => test-app}/app/styles/_tomorrow-night-eighties.css (100%) rename {tests/dummy => test-app}/app/styles/app.css (100%) rename {tests/dummy => test-app}/app/templates/animatable.hbs (69%) rename {tests/dummy => test-app}/app/templates/application.hbs (100%) rename {tests/dummy => test-app}/app/templates/components/component-that-uses-modal-dialog.hbs (100%) rename {tests/dummy => test-app}/app/templates/index.hbs (100%) rename {tests/dummy => test-app}/app/templates/tethered-animatable.hbs (100%) rename {tests/dummy => test-app}/app/templates/tethered.hbs (100%) rename {tests/dummy => test-app}/app/transitions.js (100%) rename {tests/dummy => test-app}/config/deprecation-workflow.js (100%) rename {tests/dummy => test-app}/config/ember-cli-update.json (100%) rename {config => test-app/config}/ember-try.js (100%) rename {tests/dummy => test-app}/config/environment.js (97%) rename {tests/dummy => test-app}/config/optional-features.json (100%) rename {tests/dummy => test-app}/config/targets.js (100%) create mode 100644 test-app/ember-cli-build.js create mode 100644 test-app/package.json rename {tests/dummy => test-app}/public/modal-dialog.png (100%) rename {tests/dummy => test-app}/public/robots.txt (100%) rename {tests/dummy => test-app}/public/tether-dialog.png (100%) rename testem.js => test-app/testem.js (100%) rename {tests => test-app/tests}/acceptance/animatable-test.js (100%) rename {tests => test-app/tests}/acceptance/basic-test.js (100%) rename {tests => test-app/tests}/acceptance/tethered-animatable-test.js (100%) rename {tests => test-app/tests}/acceptance/tethered-test.js (100%) rename {tests => test-app/tests}/helpers/.gitkeep (100%) rename {tests => test-app/tests}/helpers/modal-asserts.js (100%) rename {tests => test-app/tests}/index.html (89%) rename {tests => test-app/tests}/test-helper.js (78%) rename {tests => test-app/tests}/unit/services/modal-dialog-test.js (100%) rename {vendor => test-app/vendor}/.gitkeep (100%) delete mode 100644 tests/dummy/app/controllers/tethered-animatable.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index c35a0024..00000000 --- a/.editorconfig +++ /dev/null @@ -1,19 +0,0 @@ -# EditorConfig helps developers define and maintain consistent -# coding styles between different editors and IDEs -# editorconfig.org - -root = true - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 2 - -[*.hbs] -insert_final_newline = false - -[*.{diff,md}] -trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 9bab45af..6c88a9e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,29 +1,4 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. +node_modules -# compiled output -/dist/ -/tmp/ - -# dependencies -/bower_components/ -/node_modules/ - -# misc -/.env* -/.pnp* -/.sass-cache -/.eslintcache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try +yarn-error.log +.DS_Store diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b5ba4f1..65e55318 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,10 +24,10 @@ When running unit tests on components that use ember-modal-dialog, modals will b attached to the `#ember-testing` div. -## Running the Dummy Application +## Running the Test Apps -* `ember serve` -* Visit the dummy application at [http://localhost:4200](http://localhost:4200). +* `cd test-app && ember serve` +* Visit the test-app application at [http://localhost:4200](http://localhost:4200). For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/). diff --git a/README.md b/README.md index e6d11905..9efb107b 100644 --- a/README.md +++ b/README.md @@ -8,30 +8,32 @@ Unlike some other modal libraries for Ember, ember-modal-dialog uses solutions l -- [Live Demo and Test Examples](#live-demo-and-test-examples) -- [Including In An Ember Application](#including-in-an-ember-application) -- [Upgrading](#upgrading) -- [Controller-bound Usage](#controller-bound-usage) -- [Routable Usage](#routable-usage) -- [Configurable Properties](#configurable-properties) - * [modal-dialog](#modal-dialog) - + [Tethering](#tethering) - + [Animation](#animation) - * [Optional Dependencies](#optional-dependencies) -- [Which Component Should I Use?](#which-component-should-i-use) -- [Positioning](#positioning) - + [Caveats](#caveats) -- [Wormholes](#wormholes) -- [Configuring the Modal Root Element Id](#configuring-the-modal-root-element-id) -- [Configuring Styles](#configuring-styles) -- [Keyboard shortcuts](#keyboard-shortcuts) -- [iOS](#ios) -- [Custom Modals](#custom-modals) -- [Using as a nested addon](#using-as-a-nested-addon) -- [Dependencies](#dependencies) -- [Additional Resources](#additional-resources) -- [Contributing](#contributing) -- [Credits](#credits) +- [Ember Modal Dialog ![Build Status](https://travis-ci.org/yapplabs/ember-modal-dialog) [![Ember Observer Score](http://emberobserver.com/badges/ember-modal-dialog.svg)](http://emberobserver.com/addons/ember-modal-dialog)](#ember-modal-dialog--) + - [Table of Contents](#table-of-contents) + - [Live Demo and Test Examples](#live-demo-and-test-examples) + - [Including In An Ember Application](#including-in-an-ember-application) + - [Upgrading](#upgrading) + - [Controller-bound Usage](#controller-bound-usage) + - [Routable Usage](#routable-usage) + - [Configurable Properties](#configurable-properties) + - [modal-dialog](#modal-dialog) + - [Tethering](#tethering) + - [Animation](#animation) + - [Optional Dependencies](#optional-dependencies) + - [Which Component Should I Use?](#which-component-should-i-use) + - [Positioning](#positioning) + - [Caveats](#caveats) + - [Wormholes](#wormholes) + - [Configuring the Modal Root Element Id](#configuring-the-modal-root-element-id) + - [Configuring Styles](#configuring-styles) + - [Keyboard shortcuts](#keyboard-shortcuts) + - [iOS](#ios) + - [Custom Modals](#custom-modals) + - [Using as a nested addon](#using-as-a-nested-addon) + - [Dependencies](#dependencies) + - [Additional Resources](#additional-resources) + - [Contributing](#contributing) + - [Credits](#credits) @@ -39,7 +41,7 @@ Unlike some other modal libraries for Ember, ember-modal-dialog uses solutions l View a live demo here: [http://yapplabs.github.io/ember-modal-dialog/](http://yapplabs.github.io/ember-modal-dialog/) -Test examples are located in `tests/dummy/app/templates/application.hbs` and can be run locally by following the instructions in the "Installation" and "Running" sections below. +Test examples are located in `test-app/app/templates/application.hbs` and can be run locally by following the instructions in the "Installation" and "Running" sections below. [![Video image](https://i.vimeocdn.com/video/558401687_640x360.jpg)](https://vimeo.com/157192323) @@ -68,7 +70,7 @@ If you’re using SASS then just import the CSS slightly differently ``` **application.hbs** -```htmlbars +```hbs {{#modal-dialog}} Oh hai there! {{/modal-dialog}} @@ -88,17 +90,17 @@ Here is a more useful example of how to conditionally display a modal based on a **Template** -```htmlbars - +```hbs + -{{#if isShowingModal}} - {{#modal-dialog - onClose=(action "toggleModal") - targetAttachment="center" - translucentOverlay=true - }} +{{#if this.isShowingModal}} + Oh hai there! - {{/modal-dialog}} + {{/if}} ``` @@ -106,24 +108,23 @@ Here is a more useful example of how to conditionally display a modal based on a ```javascript import Controller from '@ember/controller'; +import { tracked } from '@glimmer/tracking'; -export default Controller.extend({ - isShowingModal: false, - actions: { - toggleModal() { - this.toggleProperty('isShowingModal'); - } +export default class extends Controller { + @tracked isShowingModal = false; + @action toggleModal() { + this.isShowingModal = !this.isShowingModal; } -}); +} ``` ## Routable Usage -To have a modal open for a specific route, just drop the `{{modal-dialog}}` into that route's template. Don't forget to have an `{{outlet}}` on the parent route. +To have a modal open for a specific route, just drop the `` into that route's template. Don't forget to have an `{{outlet}}` on the parent route. ## Configurable Properties -### modal-dialog +### <ModalDialog> The modal-dialog component supports the following properties: @@ -171,7 +172,7 @@ Property | Purpose This component supports animation when certain addons are present (liquid-wormhole, liquid-tether). -Detection is be automatic. To opt out of using animatable features when you have these `liquid-*` addons installed, pass `animatable=false`. +Detection is be automatic. To opt out of using animatable features when you have these `liquid-*` addons installed, pass `animatable={{false}}`. When in an animatable scenario, you may also pass the following properties, which are passed through to liquid-wormhole or liquid-tether: @@ -191,17 +192,17 @@ Dependency | Documentation ## Which Component Should I Use? -Various modal use cases are best supported by different DOM structures. Ember Modal Dialog's `modal-dialog` component provides the following capabilities: +Various modal use cases are best supported by different DOM structures. Ember Modal Dialog's `ModalDialog` component provides the following capabilities: -- modal-dialog without passing a `tetherTarget`: Uses ember-wormhole to append the following parent divs to the destination element: wrapper div > overlay div > container div +- ModalDialog without passing a `tetherTarget`: Uses ember-wormhole to append the following parent divs to the destination element: wrapper div > overlay div > container div - ![](tests/dummy/public/modal-dialog.png) + ![](test-app/public/modal-dialog.png) This can be customized (see `overlayPosition`). - modal-dialog, with a `tetherTarget` provided: Uses ember-tether to display modal container div. Uses ember-wormhole to append optional overlay div to the destination element. Requires separate installation of [ember-tether](//github.com/yapplabs/ember-tether) dependency. - ![](tests/dummy/public/tether-dialog.png) + ![](test-app/public/tether-dialog.png) ## Positioning @@ -217,14 +218,14 @@ To enable this behavior, install ember-tether as a dependency of **your ember ap Then pass a selector as `tetherTarget` for the modal you wish to position this way: -```htmlbars -{{#modal-dialog - tetherTarget='#target-element-id' - targetAttachment='middle right' - attachment='middle left' -}} +```hbs + I am a modal that will remain tethered to the right of the element with id 'target-element-id' -{{/modal-dialog}} + ``` #### Caveats @@ -354,13 +355,13 @@ export default ModalDialog.extend({ }); ``` -By subclassing `modal-dialog` your component will use the default modal dialog template. Therefore, you do not need to create a `app/templates/components/full-screen-modal.hbs` file. +By subclassing `ModalDialog` your component will use the default modal dialog template. Therefore, you do not need to create a `app/templates/components/full-screen-modal.hbs` file. Your component can then be used like so: -```htmlbars -{{#full-screen-modal}} +```hbs + Custom modal contents -{{/full-screen-modal}} + ``` ## Using as a nested addon diff --git a/addon/.eslintignore b/addon/.eslintignore new file mode 100644 index 00000000..b0aa7750 --- /dev/null +++ b/addon/.eslintignore @@ -0,0 +1,11 @@ +# compiled output +/dist/ + +# dependencies +/node_modules/ + +# misc +/coverage/ +!.* +.*/ +.eslintcache \ No newline at end of file diff --git a/addon/.gitignore b/addon/.gitignore new file mode 100644 index 00000000..8642e969 --- /dev/null +++ b/addon/.gitignore @@ -0,0 +1,27 @@ +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/.env* +/.pnp* +/.sass-cache +/.eslintcache +/connect.lock +/coverage/ +/libpeerconnection.log +/npm-debug.log* +/testem.log +/yarn-error.log + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try +/yarn.lock.ember-try diff --git a/.prettierignore b/addon/.prettierignore similarity index 93% rename from .prettierignore rename to addon/.prettierignore index 4178fd57..35854123 100644 --- a/.prettierignore +++ b/addon/.prettierignore @@ -22,4 +22,4 @@ /npm-shrinkwrap.json.ember-try /package.json.ember-try /package-lock.json.ember-try -/yarn.lock.ember-try +/yarn.lock.ember-try \ No newline at end of file diff --git a/.prettierrc.js b/addon/.prettierrc.js similarity index 100% rename from .prettierrc.js rename to addon/.prettierrc.js diff --git a/.template-lintrc.js b/addon/.template-lintrc.js similarity index 100% rename from .template-lintrc.js rename to addon/.template-lintrc.js diff --git a/addon/addon-main.js b/addon/addon-main.js new file mode 100644 index 00000000..3cde686e --- /dev/null +++ b/addon/addon-main.js @@ -0,0 +1,3 @@ +const { addonV1Shim } = require('@embroider/addon-shim'); + +module.exports = addonV1Shim(__dirname); diff --git a/app/instance-initializers/add-modals-container.js b/addon/app/instance-initializers/add-modals-container.js similarity index 100% rename from app/instance-initializers/add-modals-container.js rename to addon/app/instance-initializers/add-modals-container.js diff --git a/app/styles/ember-modal-dialog/ember-modal-appearance.css b/addon/app/styles/ember-modal-dialog/ember-modal-appearance.css similarity index 100% rename from app/styles/ember-modal-dialog/ember-modal-appearance.css rename to addon/app/styles/ember-modal-dialog/ember-modal-appearance.css diff --git a/app/styles/ember-modal-dialog/ember-modal-structure.css b/addon/app/styles/ember-modal-dialog/ember-modal-structure.css similarity index 100% rename from app/styles/ember-modal-dialog/ember-modal-structure.css rename to addon/app/styles/ember-modal-dialog/ember-modal-structure.css diff --git a/addon/babel.config.json b/addon/babel.config.json new file mode 100644 index 00000000..47975004 --- /dev/null +++ b/addon/babel.config.json @@ -0,0 +1,7 @@ +{ + "plugins": [ + "@embroider/addon-dev/template-colocation-plugin", + ["@babel/plugin-proposal-decorators", { "legacy": true }], + "@babel/plugin-proposal-class-properties" + ] +} \ No newline at end of file diff --git a/addon/config/environment.js b/addon/config/environment.js new file mode 100644 index 00000000..18aeb6e4 --- /dev/null +++ b/addon/config/environment.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (environment) {}; diff --git a/index.js b/addon/index.js similarity index 100% rename from index.js rename to addon/index.js diff --git a/addon/package.json b/addon/package.json new file mode 100644 index 00000000..946c5a16 --- /dev/null +++ b/addon/package.json @@ -0,0 +1,134 @@ +{ + "name": "ember-modal-dialog", + "version": "4.0.1", + "description": "An ember-cli addon for implementing modal dialogs", + "keywords": [ + "ember-addon" + ], + "repository": { + "type": "git", + "url": "https://github.com/yapplabs/ember-modal-dialog.git", + "directory": "addon" + }, + "license": "MIT", + "author": "Yapp Labs and friends", + "exports": { + ".": "./dist/index.js", + "./*": "./dist/*", + "./addon-main.js": "./addon-main.js" + }, + "files": [ + "addon-main.js", + "dist" + ], + "scripts": { + "build": "rollup --config", + "lint": "eslint . --cache", + "lint:fix": "eslint . --fix", + "lint:js": "eslint . --cache", + "lint:js:fix": "eslint . --fix", + "prepublishOnly": "rollup --config", + "start": "rollup --config --watch" + }, + "dependencies": { + "@embroider/addon-shim": "^1.5.0", + "@embroider/macros": "^1.0.0", + "@embroider/util": "^1.0.0", + "ember-cli-babel": "^7.26.8", + "ember-cli-htmlbars": "^6.0.1", + "ember-decorators": "^6.1.1", + "ember-wormhole": "^0.6.0" + }, + "devDependencies": { + "@babel/core": "^7.17.7", + "@babel/eslint-parser": "^7.17.0", + "@babel/plugin-proposal-class-properties": "^7.16.7", + "@babel/plugin-proposal-decorators": "^7.17.2", + "@embroider/addon-dev": "^1.5.0", + "@rollup/plugin-babel": "^5.3.1", + "ember-template-lint": "^4.3.0", + "eslint": "^8.11.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-ember": "^10.5.9", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-qunit": "^7.2.0", + "prettier": "^2.6.0", + "rollup": "^2.70.1" + }, + "peerDependencies": { + "@ember/test-helpers": "^2.6.0", + "ember-tether": "^2.0.1", + "liquid-fire": "^0.34.0", + "liquid-tether": "pzuraq/liquid-tether#7c140024787c3c1b266e89a2ef528eaea898c78e", + "liquid-wormhole": "pzuraq/liquid-wormhole#efa7e5ca518de7c1d6c52666b70bbc0671fcf380" + }, + "peerDependenciesMeta": { + "@ember/test-helpers": { + "optional": true + }, + "ember-tether": { + "optional": true + }, + "liquid-fire": { + "optional": true + }, + "liquid-tether": { + "optional": true + }, + "liquid-wormhole": { + "optional": true + } + }, + "resolutions": { + "**/@embroider/macros": "^1.0.0", + "**/@embroider/util": "^1.0.0" + }, + "engines": { + "node": "12.* || 14.* || >= 16" + }, + "publishConfig": { + "registry": "https://registry.npmjs.org" + }, + "ember": { + "edition": "octane" + }, + "ember-addon": { + "demoURL": "https://yapplabs.github.io/ember-modal-dialog/", + "main": "addon-main.js", + "type": "addon", + "version": 2, + "versionCompatibility": { + "ember": "3.8 || 3.12 || 3.16 || 3.20 || 3.24 || 3.28 || >=4.0" + }, + "app-js": { + "./components/basic-dialog/index.js": "./dist/_app_/components/basic-dialog/index.js", + "./components/ember-modal-dialog-positioned-container/index.js": "./dist/_app_/components/ember-modal-dialog-positioned-container/index.js", + "./components/in-place-dialog/index.js": "./dist/_app_/components/in-place-dialog/index.js", + "./components/liquid-dialog/index.js": "./dist/_app_/components/liquid-dialog/index.js", + "./components/liquid-tether-dialog/index.js": "./dist/_app_/components/liquid-tether-dialog/index.js", + "./components/modal-dialog/index.js": "./dist/_app_/components/modal-dialog/index.js", + "./components/tether-dialog/index.js": "./dist/_app_/components/tether-dialog/index.js", + "./helpers/ignore-children.js": "./dist/_app_/helpers/ignore-children.js", + "./services/modal-dialog.js": "./dist/_app_/services/modal-dialog.js" + } + }, + "release-it": { + "plugins": { + "release-it-lerna-changelog": { + "infile": "CHANGELOG.md", + "launchEditor": false + } + }, + "git": { + "tagName": "v${version}" + }, + "github": { + "release": true, + "tokenRef": "GITHUB_AUTH" + } + }, + "volta": { + "extends": "../package.json" + } +} diff --git a/addon/rollup.config.js b/addon/rollup.config.js new file mode 100644 index 00000000..80356d38 --- /dev/null +++ b/addon/rollup.config.js @@ -0,0 +1,60 @@ +import babel from '@rollup/plugin-babel'; +import { Addon } from '@embroider/addon-dev/rollup'; + +const addon = new Addon({ + srcDir: 'src', + destDir: 'dist', +}); + +export default { + // This provides defaults that work well alongside `publicEntrypoints` below. + // You can augment this if you need to. + output: addon.output(), + + plugins: [ + // These are the modules that users should be able to import from your + // addon. Anything not listed here may get optimized away. + addon.publicEntrypoints([ + 'components/**/*.js', + 'decorators/**/*.js', + 'helpers/**/*.js', + 'services/**/*.js', + 'utils/**/*.js', + 'index.js', + ]), + + // These are the modules that should get reexported into the traditional + // "app" tree. Things in here should also be in publicEntrypoints above, but + // not everything in publicEntrypoints necessarily needs to go here. + addon.appReexports([ + 'components/**/*.js', + 'helpers/**/*.js', + 'services/**/*.js', + ]), + + // This babel config should *not* apply presets or compile away ES modules. + // It exists only to provide development niceties for you, like automatic + // template colocation. + // + // By default, this will load the actual babel config from the file + // babel.config.json. + babel({ + babelHelpers: 'bundled', + }), + + // Follow the V2 Addon rules about dependencies. Your code can import from + // `dependencies` and `peerDependencies` as well as standard Ember-provided + // package names. + addon.dependencies(), + + // Ensure that standalone .hbs files are properly integrated as Javascript. + addon.hbs(), + + // addons are allowed to contain imports of .css files, which we want rollup + // to leave alone and keep in the published output. + addon.keepAssets(['**/*.css']), + + // Remove leftover build artifacts when starting a new build. + addon.clean(), + ], +}; diff --git a/addon/templates/components/basic-dialog.hbs b/addon/src/components/basic-dialog/index.hbs similarity index 100% rename from addon/templates/components/basic-dialog.hbs rename to addon/src/components/basic-dialog/index.hbs diff --git a/addon/components/basic-dialog.js b/addon/src/components/basic-dialog/index.js similarity index 96% rename from addon/components/basic-dialog.js rename to addon/src/components/basic-dialog/index.js index af975aec..e52ac814 100644 --- a/addon/components/basic-dialog.js +++ b/addon/src/components/basic-dialog/index.js @@ -1,13 +1,11 @@ -import { tagName, layout as templateLayout } from '@ember-decorators/component'; +import { tagName } from '@ember-decorators/component'; import { computed, set } from '@ember/object'; import { inject as service } from '@ember/service'; import Component from '@ember/component'; import { isEmpty } from '@ember/utils'; -import layout from '../templates/components/basic-dialog'; import { dasherize } from '@ember/string'; @tagName('') -@templateLayout(layout) export default class BasicDialog extends Component { containerClassNames = null; overlayClassNames = null; diff --git a/addon/components/positioned-container.js b/addon/src/components/ember-modal-dialog-positioned-container/index.js similarity index 100% rename from addon/components/positioned-container.js rename to addon/src/components/ember-modal-dialog-positioned-container/index.js diff --git a/addon/templates/components/in-place-dialog.hbs b/addon/src/components/in-place-dialog/index.hbs similarity index 100% rename from addon/templates/components/in-place-dialog.hbs rename to addon/src/components/in-place-dialog/index.hbs diff --git a/addon/components/in-place-dialog.js b/addon/src/components/in-place-dialog/index.js similarity index 76% rename from addon/components/in-place-dialog.js rename to addon/src/components/in-place-dialog/index.js index ee43edd4..58ece24d 100644 --- a/addon/components/in-place-dialog.js +++ b/addon/src/components/in-place-dialog/index.js @@ -1,9 +1,7 @@ -import { tagName, layout as templateLayout } from '@ember-decorators/component'; +import { tagName } from '@ember-decorators/component'; import Component from '@ember/component'; -import layout from '../templates/components/in-place-dialog'; @tagName('') -@templateLayout(layout) export default class InPlaceDialog extends Component { containerClass = null; // passed in diff --git a/addon/templates/components/liquid-dialog.hbs b/addon/src/components/liquid-dialog/index.hbs similarity index 100% rename from addon/templates/components/liquid-dialog.hbs rename to addon/src/components/liquid-dialog/index.hbs diff --git a/addon/components/liquid-dialog.js b/addon/src/components/liquid-dialog/index.js similarity index 52% rename from addon/components/liquid-dialog.js rename to addon/src/components/liquid-dialog/index.js index b25b86e9..12608bea 100644 --- a/addon/components/liquid-dialog.js +++ b/addon/src/components/liquid-dialog/index.js @@ -1,8 +1,5 @@ -import { layout as templateLayout } from '@ember-decorators/component'; -import BasicDialog from './basic-dialog'; -import layout from '../templates/components/liquid-dialog'; +import BasicDialog from '../basic-dialog/index'; -@templateLayout(layout) export default class LiquidDialog extends BasicDialog { hasOverlay = true; variantWrapperClass = 'emd-animatable'; diff --git a/addon/templates/components/liquid-tether-dialog.hbs b/addon/src/components/liquid-tether-dialog/index.hbs similarity index 100% rename from addon/templates/components/liquid-tether-dialog.hbs rename to addon/src/components/liquid-tether-dialog/index.hbs diff --git a/addon/components/liquid-tether-dialog.js b/addon/src/components/liquid-tether-dialog/index.js similarity index 86% rename from addon/components/liquid-tether-dialog.js rename to addon/src/components/liquid-tether-dialog/index.js index 502abe84..43504881 100644 --- a/addon/components/liquid-tether-dialog.js +++ b/addon/src/components/liquid-tether-dialog/index.js @@ -1,11 +1,8 @@ /* eslint-disable ember/no-computed-properties-in-native-classes */ -import { layout as templateLayout } from '@ember-decorators/component'; import { computed, set } from '@ember/object'; import { dasherize } from '@ember/string'; -import BasicDialog from './basic-dialog'; -import layout from '../templates/components/liquid-tether-dialog'; +import BasicDialog from '../basic-dialog/index'; -@templateLayout(layout) export default class LiquidTetherDialog extends BasicDialog { @computed('targetAttachment') get targetAttachmentClass() { diff --git a/addon/templates/components/modal-dialog.hbs b/addon/src/components/modal-dialog/index.hbs similarity index 100% rename from addon/templates/components/modal-dialog.hbs rename to addon/src/components/modal-dialog/index.hbs diff --git a/addon/components/modal-dialog.js b/addon/src/components/modal-dialog/index.js similarity index 96% rename from addon/components/modal-dialog.js rename to addon/src/components/modal-dialog/index.js index 7d0ef80d..193d8238 100644 --- a/addon/components/modal-dialog.js +++ b/addon/src/components/modal-dialog/index.js @@ -1,11 +1,10 @@ -import { tagName, layout as templateLayout } from '@ember-decorators/component'; +import { tagName } from '@ember-decorators/component'; import { action, computed, set } from '@ember/object'; import { inject as service } from '@ember/service'; import { readOnly, oneWay } from '@ember/object/computed'; import Component from '@ember/component'; import { dasherize } from '@ember/string'; import { isEmpty, typeOf, isNone } from '@ember/utils'; -import layout from '../templates/components/modal-dialog'; import { assert, warn } from '@ember/debug'; import { DEBUG } from '@glimmer/env'; import { importSync } from '@embroider/macros'; @@ -14,7 +13,6 @@ import { ensureSafeComponent } from '@embroider/util'; const VALID_OVERLAY_POSITIONS = ['parent', 'sibling']; @tagName('') -@templateLayout(layout) export default class ModalDialog extends Component { @service('modal-dialog') modalService; diff --git a/addon/templates/components/tether-dialog.hbs b/addon/src/components/tether-dialog/index.hbs similarity index 100% rename from addon/templates/components/tether-dialog.hbs rename to addon/src/components/tether-dialog/index.hbs diff --git a/addon/components/tether-dialog.js b/addon/src/components/tether-dialog/index.js similarity index 87% rename from addon/components/tether-dialog.js rename to addon/src/components/tether-dialog/index.js index 7744e78e..556a824a 100644 --- a/addon/components/tether-dialog.js +++ b/addon/src/components/tether-dialog/index.js @@ -1,10 +1,7 @@ -import { layout as templateLayout } from '@ember-decorators/component'; import { computed, set } from '@ember/object'; import { dasherize } from '@ember/string'; -import BasicDialog from './basic-dialog'; -import layout from '../templates/components/tether-dialog'; +import BasicDialog from '../basic-dialog/index'; -@templateLayout(layout) export default class TetherDialog extends BasicDialog { init() { super.init(...arguments); diff --git a/addon/helpers/ignore-children.js b/addon/src/helpers/ignore-children.js similarity index 100% rename from addon/helpers/ignore-children.js rename to addon/src/helpers/ignore-children.js diff --git a/addon/instance-initializers/add-modals-container.js b/addon/src/instance-initializers/add-modals-container.js similarity index 100% rename from addon/instance-initializers/add-modals-container.js rename to addon/src/instance-initializers/add-modals-container.js diff --git a/addon/src/services/modal-dialog.js b/addon/src/services/modal-dialog.js new file mode 100644 index 00000000..4b325ebe --- /dev/null +++ b/addon/src/services/modal-dialog.js @@ -0,0 +1,26 @@ +import Service from '@ember/service'; +import { getDestinationElementIdFromConfig } from 'ember-modal-dialog/utils/config-utils'; +import { macroCondition, dependencySatisfies } from '@embroider/macros'; +import { getOwner } from '@ember/application'; + +export default class extends Service { + hasEmberTether = false; + hasLiquidWormhole = false; + hasLiquidTether = false; + constructor() { + super(...arguments); + if (macroCondition(dependencySatisfies('ember-tether', '*'))) { + this.hasEmberTether = true; + } + if (macroCondition(dependencySatisfies('liquid-wormhole', '*'))) { + this.hasLiquidWormhole = true; + } + if (macroCondition(dependencySatisfies('liquid-wormhole', '*'))) { + this.hasLiquidTether = true; + } + } + get destinationElementId() { + const ENV = getOwner(this).resolveRegistration('config:environment') + return getDestinationElementIdFromConfig(ENV); + } +} diff --git a/addon/utils/config-utils.js b/addon/src/utils/config-utils.js similarity index 100% rename from addon/utils/config-utils.js rename to addon/src/utils/config-utils.js diff --git a/app/components/ember-modal-dialog-positioned-container.js b/app/components/ember-modal-dialog-positioned-container.js deleted file mode 100644 index 31a125e0..00000000 --- a/app/components/ember-modal-dialog-positioned-container.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from 'ember-modal-dialog/components/positioned-container'; diff --git a/app/components/ember-modal-dialog/-basic-dialog.js b/app/components/ember-modal-dialog/-basic-dialog.js deleted file mode 100644 index 761adce0..00000000 --- a/app/components/ember-modal-dialog/-basic-dialog.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from 'ember-modal-dialog/components/basic-dialog'; diff --git a/app/components/ember-modal-dialog/-in-place-dialog.js b/app/components/ember-modal-dialog/-in-place-dialog.js deleted file mode 100644 index bb11e8ef..00000000 --- a/app/components/ember-modal-dialog/-in-place-dialog.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from 'ember-modal-dialog/components/in-place-dialog'; diff --git a/app/components/ember-modal-dialog/-liquid-dialog.js b/app/components/ember-modal-dialog/-liquid-dialog.js deleted file mode 100644 index b1e18462..00000000 --- a/app/components/ember-modal-dialog/-liquid-dialog.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from 'ember-modal-dialog/components/liquid-dialog'; diff --git a/app/components/ember-modal-dialog/-liquid-tether-dialog.js b/app/components/ember-modal-dialog/-liquid-tether-dialog.js deleted file mode 100644 index 8fa26867..00000000 --- a/app/components/ember-modal-dialog/-liquid-tether-dialog.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from 'ember-modal-dialog/components/liquid-tether-dialog'; diff --git a/app/components/ember-modal-dialog/-tether-dialog.js b/app/components/ember-modal-dialog/-tether-dialog.js deleted file mode 100644 index 9e5e401c..00000000 --- a/app/components/ember-modal-dialog/-tether-dialog.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from 'ember-modal-dialog/components/tether-dialog'; diff --git a/app/components/modal-dialog.js b/app/components/modal-dialog.js deleted file mode 100644 index b17443d3..00000000 --- a/app/components/modal-dialog.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from 'ember-modal-dialog/components/modal-dialog'; diff --git a/app/helpers/ignore-children.js b/app/helpers/ignore-children.js deleted file mode 100644 index 3f2071e9..00000000 --- a/app/helpers/ignore-children.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from 'ember-modal-dialog/helpers/ignore-children'; diff --git a/app/services/modal-dialog.js b/app/services/modal-dialog.js deleted file mode 100644 index d54352a4..00000000 --- a/app/services/modal-dialog.js +++ /dev/null @@ -1,19 +0,0 @@ -import { computed } from '@ember/object'; -import Service from '@ember/service'; -import ENV from '../config/environment'; -import { getDestinationElementIdFromConfig } from 'ember-modal-dialog/utils/config-utils'; - -function computedFromConfig(prop) { - return computed(function () { - return ENV['ember-modal-dialog'] && ENV['ember-modal-dialog'][prop]; - }); -} - -export default Service.extend({ - hasEmberTether: computedFromConfig('hasEmberTether'), - hasLiquidWormhole: computedFromConfig('hasLiquidWormhole'), - hasLiquidTether: computedFromConfig('hasLiquidTether'), - destinationElementId: computed(function () { - return getDestinationElementIdFromConfig(ENV); - }), -}); diff --git a/config/environment.js b/config/environment.js deleted file mode 100644 index ded8ad8e..00000000 --- a/config/environment.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -var VersionChecker = require('ember-cli-version-checker'); - -module.exports = function (environment, appConfig, addon) { - appConfig['ember-modal-dialog'] = appConfig['ember-modal-dialog'] || {}; - - var checker = new VersionChecker(addon); - var hasLiquidWormhole = checker.for('liquid-wormhole', 'npm').version; - var hasLiquidTether = checker.for('liquid-tether', 'npm').version; - var hasEmberTether = checker.for('ember-tether', 'npm').version; - - appConfig['ember-modal-dialog']['hasLiquidWormhole'] = hasLiquidWormhole; - appConfig['ember-modal-dialog']['hasLiquidTether'] = hasLiquidTether; - appConfig['ember-modal-dialog']['hasEmberTether'] = hasEmberTether; - - return appConfig; -}; diff --git a/ember-cli-build.js b/ember-cli-build.js deleted file mode 100644 index 15bf9e91..00000000 --- a/ember-cli-build.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); - -module.exports = function (defaults) { - let app = new EmberAddon(defaults, { - snippetSearchPaths: ['tests/dummy/app'], - }); - - /* - This build file specifies the options for the dummy test app of this - addon, located in `/tests/dummy` - This build file does *not* influence how the addon or the app using it - behave. You most likely want to be modifying `./index.js` or app's build file - */ - - const { maybeEmbroider } = require('@embroider/test-setup'); - return maybeEmbroider(app, { - skipBabel: [ - { - package: 'qunit', - }, - ], - }); -}; diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 00000000..7e14a498 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "es6", + "experimentalDecorators": true + }, + "exclude": [ + "node_modules", + "bower_components", + "tmp", + "vendor", + ".git", + "dist" + ] +} \ No newline at end of file diff --git a/package.json b/package.json index 290e8ba6..446b5733 100644 --- a/package.json +++ b/package.json @@ -1,129 +1,46 @@ { - "name": "ember-modal-dialog", - "version": "4.0.0", - "description": "An ember-cli addon for implementing modal dialogs", - "keywords": [ - "ember-addon" + "private": true, + "version": "4.0.1", + "workspaces": [ + "addon", + "test-app" ], - "repository": "https://github.com/yapplabs/ember-modal-dialog", - "license": "MIT", - "author": "Yapp Labs and friends", - "directories": { - "doc": "doc", - "test": "tests" + "repository": { + "type": "git", + "url": "https://github.com/yapplabs/ember-modal-dialog.git" }, "scripts": { - "build": "ember build --environment=production", - "deploy": "ember github-pages:commit --message \"Deploy gh-pages from commit $(git rev-parse HEAD)\"; git push; git checkout -", - "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"", - "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix", - "lint:hbs": "ember-template-lint .", - "lint:hbs:fix": "ember-template-lint . --fix", - "lint:js": "eslint . --cache", - "lint:js:fix": "eslint . --fix", + "prepare": "cd addon && yarn build", "release": "release-it", - "start": "ember serve", - "test": "npm-run-all lint test:*", - "test:ember": "ember test", - "test:ember-compatibility": "ember try:each" - }, - "dependencies": { - "@embroider/macros": "^1.0.0", - "@embroider/util": "^1.0.0", - "ember-cli-babel": "^7.26.8", - "ember-cli-htmlbars": "^6.0.1", - "ember-cli-version-checker": "^2.1.0", - "ember-decorators": "^6.1.1", - "ember-wormhole": "^0.6.0" + "test": "cd test-app && yarn test" }, "devDependencies": { - "@ember/jquery": "^2.0.0", - "@ember/optional-features": "^2.0.0", - "@ember/test-helpers": "^2.6.0", - "@embroider/test-setup": "^1.0.0", - "@glimmer/component": "^1.0.4", - "@glimmer/tracking": "^1.0.4", - "babel-eslint": "^10.1.0", - "broccoli-asset-rev": "^3.0.0", - "ember-auto-import": "^2.4.0", - "ember-cli": "~4.0.1", - "ember-cli-dependency-checker": "^3.2.0", - "ember-cli-deprecation-workflow": "^2.1.0", - "ember-cli-github-pages": "^0.2.2", - "ember-cli-inject-live-reload": "^2.1.0", - "ember-cli-terser": "^4.0.2", - "ember-code-snippet": "^2.4.0", - "ember-disable-prototype-extensions": "^1.1.3", - "ember-export-application-global": "^2.0.1", - "ember-load-initializers": "^2.1.2", - "ember-qunit": "^5.1.5", - "ember-resolver": "^8.0.3", - "ember-source": "~3.28.8", - "ember-source-channel-url": "^3.0.0", - "ember-template-lint": "^3.15.0", - "ember-tether": "^2.0.1", - "ember-truth-helpers": "^3.0.0", - "ember-try": "^2.0.0", - "eslint": "^7.32.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-ember": "^10.5.8", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^4.0.0", - "eslint-plugin-qunit": "^7.2.0", - "loader.js": "^4.7.0", - "npm-run-all": "^4.1.5", - "prettier": "^2.5.1", - "qunit": "^2.17.2", - "qunit-dom": "^2.0.0", - "release-it": "^13.6.5", - "release-it-lerna-changelog": "^2.3.0", - "webpack": "^5.67.0" - }, - "peerDependencies": { - "ember-tether": "^2.0.1", - "liquid-fire": "^0.34.0", - "liquid-tether": "pzuraq/liquid-tether#7c140024787c3c1b266e89a2ef528eaea898c78e", - "liquid-wormhole": "pzuraq/liquid-wormhole#efa7e5ca518de7c1d6c52666b70bbc0671fcf380" - }, - "peerDependenciesMeta": { - "ember-tether": { - "optional": true - }, - "liquid-fire": { - "optional": true - }, - "liquid-tether": { - "optional": true - }, - "liquid-wormhole": { - "optional": true - } - }, - "resolutions": { - "**/@embroider/macros": "^1.0.0", - "**/@embroider/util": "^1.0.0" - }, - "engines": { - "node": "12.* || 14.* || >= 16" + "release-it": "^14.12.5", + "release-it-lerna-changelog": "^4.0.1", + "release-it-yarn-workspaces": "^2.0.1" }, "publishConfig": { "registry": "https://registry.npmjs.org" }, - "ember": { - "edition": "octane" - }, - "ember-addon": { - "configPath": "tests/dummy/config", - "demoURL": "http://yapplabs.github.io/ember-modal-dialog/", - "versionCompatibility": { - "ember": "~3.20.0 || ~3.24.0 || >= 3.25.0" - } - }, "release-it": { "plugins": { "release-it-lerna-changelog": { "infile": "CHANGELOG.md", - "launchEditor": false + "launchEditor": true + } + }, + "release-it-yarn-workspaces": { + "workspaces": [ + "addon" + ], + "additionalManifests": { + "dependencyUpdates": [ + "test-app/package.json" + ], + "versionUpdates": [ + "package.json", + "test-app/package.json" + ] } }, "git": { @@ -132,10 +49,11 @@ "github": { "release": true, "tokenRef": "GITHUB_AUTH" - } + }, + "npm": false }, "volta": { "node": "12.22.1", "yarn": "1.22.18" } -} +} \ No newline at end of file diff --git a/.ember-cli b/test-app/.ember-cli similarity index 100% rename from .ember-cli rename to test-app/.ember-cli diff --git a/test-app/.eslintignore b/test-app/.eslintignore new file mode 100644 index 00000000..48d55025 --- /dev/null +++ b/test-app/.eslintignore @@ -0,0 +1,23 @@ +# unconventional js +/blueprints/*/files/ +/vendor/ + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/coverage/ +!.* +.*/ +.eslintcache + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try +/yarn.lock.ember-try diff --git a/.eslintrc.js b/test-app/.eslintrc.js similarity index 54% rename from .eslintrc.js rename to test-app/.eslintrc.js index c5ab0058..e0b7ef5a 100644 --- a/.eslintrc.js +++ b/test-app/.eslintrc.js @@ -2,13 +2,17 @@ module.exports = { root: true, - parser: 'babel-eslint', + parser: '@babel/eslint-parser', parserOptions: { - ecmaVersion: 2020, + ecmaVersion: 2021, sourceType: 'module', ecmaFeatures: { legacyDecorators: true, }, + requireConfigFile: false, + babelOptions: { + plugins: [['@babel/plugin-proposal-decorators', { legacy: true }]], + }, }, plugins: ['ember'], extends: [ @@ -19,21 +23,7 @@ module.exports = { env: { browser: true, }, - rules: { - 'no-setter-return': 'off', - 'ember/classic-decorator-no-classic-methods': 'warn', - 'ember/classic-decorator-hooks': 'warn', - 'ember/no-actions-hash': 'warn', - 'ember/no-classic-classes': 'warn', - 'ember/no-classic-components': 'warn', - 'ember/no-component-lifecycle-hooks': 'warn', - 'ember/no-computed-properties-in-native-classes': 'warn', - 'ember/no-get': 'warn', - 'ember/no-observers': 'warn', - 'ember/require-computed-macros': 'warn', - 'ember/require-tagless-components': 'warn', - 'ember/no-jquery': 'error', - }, + rules: {}, overrides: [ // node files { @@ -42,11 +32,8 @@ module.exports = { './.prettierrc.js', './.template-lintrc.js', './ember-cli-build.js', - './index.js', './testem.js', - './blueprints/*/index.js', './config/**/*.js', - './tests/dummy/config/**/*.js', ], parserOptions: { sourceType: 'script', @@ -59,7 +46,7 @@ module.exports = { extends: ['plugin:node/recommended'], }, { - // test files + // Test files: files: ['tests/**/*-test.{js,ts}'], extends: ['plugin:qunit/recommended'], }, diff --git a/test-app/.gitignore b/test-app/.gitignore new file mode 100644 index 00000000..9bab45af --- /dev/null +++ b/test-app/.gitignore @@ -0,0 +1,29 @@ +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/.env* +/.pnp* +/.sass-cache +/.eslintcache +/connect.lock +/coverage/ +/libpeerconnection.log +/npm-debug.log* +/testem.log +/yarn-error.log + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/npm-shrinkwrap.json.ember-try +/package.json.ember-try +/package-lock.json.ember-try +/yarn.lock.ember-try diff --git a/.npmignore b/test-app/.npmignore similarity index 87% rename from .npmignore rename to test-app/.npmignore index 3aac2443..2ca54cec 100644 --- a/.npmignore +++ b/test-app/.npmignore @@ -19,7 +19,6 @@ /.prettierignore /.prettierrc.js /.template-lintrc.js -/.travis.yml /.watchmanconfig /bower.json /config/ember-try.js @@ -34,7 +33,9 @@ # ember-try /.node_modules.ember-try/ /bower.json.ember-try -/npm-shrinkwrap.json.ember-try /package.json.ember-try -/package-lock.json.ember-try /yarn.lock.ember-try + +# custom +/jsconfig.json +/RELEASE.md diff --git a/.eslintignore b/test-app/.prettierignore similarity index 90% rename from .eslintignore rename to test-app/.prettierignore index d474a40b..35854123 100644 --- a/.eslintignore +++ b/test-app/.prettierignore @@ -13,8 +13,8 @@ # misc /coverage/ !.* -.*/ .eslintcache +.lint-todo/ # ember-try /.node_modules.ember-try/ @@ -22,4 +22,4 @@ /npm-shrinkwrap.json.ember-try /package.json.ember-try /package-lock.json.ember-try -/yarn.lock.ember-try +/yarn.lock.ember-try \ No newline at end of file diff --git a/test-app/.prettierrc.js b/test-app/.prettierrc.js new file mode 100644 index 00000000..534e6d35 --- /dev/null +++ b/test-app/.prettierrc.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + singleQuote: true, +}; diff --git a/test-app/.template-lintrc.js b/test-app/.template-lintrc.js new file mode 100644 index 00000000..db6664a2 --- /dev/null +++ b/test-app/.template-lintrc.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = { + extends: 'recommended', + rules: { + 'no-action': false, + 'no-curly-component-invocation': false, + 'require-button-type': false, + }, +}; diff --git a/.watchmanconfig b/test-app/.watchmanconfig similarity index 94% rename from .watchmanconfig rename to test-app/.watchmanconfig index e7834e3e..477b5785 100644 --- a/.watchmanconfig +++ b/test-app/.watchmanconfig @@ -1,3 +1,3 @@ { "ignore_dirs": ["tmp", "dist"] -} +} \ No newline at end of file diff --git a/tests/dummy/app/app.js b/test-app/app/app.js similarity index 87% rename from tests/dummy/app/app.js rename to test-app/app/app.js index 523bad60..1ba93424 100644 --- a/tests/dummy/app/app.js +++ b/test-app/app/app.js @@ -1,7 +1,7 @@ import Application from '@ember/application'; import Resolver from 'ember-resolver'; import loadInitializers from 'ember-load-initializers'; -import config from 'dummy/config/environment'; +import config from 'test-app/config/environment'; export default class App extends Application { modulePrefix = config.modulePrefix; diff --git a/tests/dummy/app/components/component-that-uses-modal-dialog.js b/test-app/app/components/component-that-uses-modal-dialog.js similarity index 77% rename from tests/dummy/app/components/component-that-uses-modal-dialog.js rename to test-app/app/components/component-that-uses-modal-dialog.js index 65daa6fe..e89e94a9 100644 --- a/tests/dummy/app/components/component-that-uses-modal-dialog.js +++ b/test-app/app/components/component-that-uses-modal-dialog.js @@ -1,3 +1,5 @@ +/* eslint-disable ember/require-tagless-components */ +/* eslint-disable ember/no-classic-components */ import Component from '@ember/component'; import { action, set } from '@ember/object'; diff --git a/tests/dummy/app/components/my-cool-modal-dialog-two.js b/test-app/app/components/my-cool-modal-dialog-two.js similarity index 100% rename from tests/dummy/app/components/my-cool-modal-dialog-two.js rename to test-app/app/components/my-cool-modal-dialog-two.js diff --git a/tests/dummy/app/components/my-cool-modal-dialog.js b/test-app/app/components/my-cool-modal-dialog.js similarity index 100% rename from tests/dummy/app/components/my-cool-modal-dialog.js rename to test-app/app/components/my-cool-modal-dialog.js diff --git a/tests/dummy/app/controllers/animatable.js b/test-app/app/controllers/animatable.js similarity index 56% rename from tests/dummy/app/controllers/animatable.js rename to test-app/app/controllers/animatable.js index 4eb1c9b5..632c4341 100644 --- a/tests/dummy/app/controllers/animatable.js +++ b/test-app/app/controllers/animatable.js @@ -1,16 +1,17 @@ import Controller from '@ember/controller'; import { set, action } from '@ember/object'; +import { tracked } from '@glimmer/tracking'; export default class AnimatableController extends Controller { - isShowingBasic = false; - isShowingTranslucent = false; - isShowingTranslucentWithCallback = false; - isShowingWithoutOverlay = false; - isShowingWithoutOverlayClickOutsideToClose = false; - isShowingWithoutOverlayClickOutsideToCloseAnotherOne = false; - isShowingSubclassed = false; - isShowingCenteredScrolling = false; - isShowingElementCenterModal = false; + @tracked isShowingBasic = false; + @tracked isShowingTranslucent = false; + @tracked isShowingTranslucentWithCallback = false; + @tracked isShowingWithoutOverlay = false; + @tracked isShowingWithoutOverlayClickOutsideToClose = false; + @tracked isShowingWithoutOverlayClickOutsideToCloseAnotherOne = false; + @tracked isShowingSubclassed = false; + @tracked isShowingCenteredScrolling = false; + @tracked isShowingElementCenterModal = false; nextAttachment(val) { switch (val) { @@ -37,42 +38,45 @@ export default class AnimatableController extends Controller { @action toggleBasic() { - this.toggleProperty('isShowingBasic'); + this.isShowingBasic = !this.isShowingBasic; } @action toggleTranslucent() { - this.toggleProperty('isShowingTranslucent'); + this.isShowingTranslucent = !this.isShowingTranslucent; } @action toggleTranslucentWithCallback() { - this.toggleProperty('isShowingTranslucentWithCallback'); + this.isShowingTranslucentWithCallback = + !this.isShowingTranslucentWithCallback; } @action toggleWithoutOverlay() { - this.toggleProperty('isShowingWithoutOverlay'); + this.isShowingWithoutOverlay = !this.isShowingWithoutOverlay; } @action toggleWithoutOverlayClickOutsideToClose() { - this.toggleProperty('isShowingWithoutOverlayClickOutsideToClose'); + this.isShowingWithoutOverlayClickOutsideToClose = + !this.isShowingWithoutOverlayClickOutsideToClose; } @action toggleWithoutOverlayClickOutsideToCloseAnotherOne() { - this.toggleProperty('isShowingWithoutOverlayClickOutsideToCloseAnotherOne'); + this.isShowingWithoutOverlayClickOutsideToCloseAnotherOne = + !this.isShowingWithoutOverlayClickOutsideToCloseAnotherOne; } @action toggleSubclassed() { - this.toggleProperty('isShowingSubclassed'); + this.isShowingSubclassed = !this.isShowingSubclassed; } @action toggleCenteredScrolling() { - this.toggleProperty('isShowingCenteredScrolling'); + this.isShowingCenteredScrolling = !this.isShowingCenteredScrolling; if (this.isShowingCenteredScrolling) { document.querySelector('#modal-overlays').classList.add('active'); diff --git a/tests/dummy/app/controllers/index.js b/test-app/app/controllers/index.js similarity index 50% rename from tests/dummy/app/controllers/index.js rename to test-app/app/controllers/index.js index c462e772..42a98df2 100644 --- a/tests/dummy/app/controllers/index.js +++ b/test-app/app/controllers/index.js @@ -1,24 +1,25 @@ -import { action, set } from '@ember/object'; +import { action } from '@ember/object'; import Controller from '@ember/controller'; +import { tracked } from '@glimmer/tracking'; export default class IndexController extends Controller { - isShowingBasic = false; - isShowingTranslucent = false; - isShowingTranslucentWithCallback = false; - isShowingWithoutOverlay = false; - isShowingWithoutOverlayClickOutsideToClose = false; - isShowingWithoutOverlayClickOutsideToCloseAnotherOne = false; - isShowingCustomStyles = false; - isShowingTargetSelector = false; - isShowingTargetElement = false; - isShowingSubclassed = false; - isShowingSubclassed2 = false; - isShowingInPlace = false; - isShowingCenteredScrolling = false; - isShowingElementCenterModal = false; - exampleTargetAttachment = 'middle left'; - exampleAttachment = 'middle right'; - customContainerClassNames = 'custom-styles-modal-container'; + @tracked isShowingBasic = false; + @tracked isShowingTranslucent = false; + @tracked isShowingTranslucentWithCallback = false; + @tracked isShowingWithoutOverlay = false; + @tracked isShowingWithoutOverlayClickOutsideToClose = false; + @tracked isShowingWithoutOverlayClickOutsideToCloseAnotherOne = false; + @tracked isShowingCustomStyles = false; + @tracked isShowingTargetSelector = false; + @tracked isShowingTargetElement = false; + @tracked isShowingSubclassed = false; + @tracked isShowingSubclassed2 = false; + @tracked isShowingInPlace = false; + @tracked isShowingCenteredScrolling = false; + @tracked isShowingElementCenterModal = false; + @tracked exampleTargetAttachment = 'middle left'; + @tracked exampleAttachment = 'middle right'; + @tracked customContainerClassNames = 'custom-styles-modal-container'; nextAttachment(val) { switch (val) { @@ -41,13 +42,13 @@ export default class IndexController extends Controller { this.exampleTargetAttachment ); let newAttachment = this.nextAttachment(this.exampleAttachment); - set(this, 'exampleTargetAttachment', newTargetAttachment); - set(this, 'exampleAttachment', newAttachment); + this.exampleTargetAttachment = newTargetAttachment; + this.exampleAttachment = newAttachment; if (newTargetAttachment !== 'middle left') { return; } } - this.toggleProperty('isShowingTargetSelector'); + this.isShowingTargetSelector = !this.isShowingTargetSelector; } @action @@ -57,18 +58,18 @@ export default class IndexController extends Controller { this.exampleTargetAttachment ); let newAttachment = this.nextAttachment(this.exampleAttachment); - set(this, 'exampleTargetAttachment', newTargetAttachment); - set(this, 'exampleAttachment', newAttachment); + this.exampleTargetAttachment = newTargetAttachment; + this.exampleAttachment = newAttachment; if (newTargetAttachment !== 'middle left') { return; } } - this.toggleProperty('isShowingTargetElement'); + this.isShowingTargetElement = !this.isShowingTargetElement; } @action toggleCenteredScrolling() { - this.toggleProperty('isShowingCenteredScrolling'); + this.isShowingCenteredScrolling = !this.isShowingCenteredScrolling; if (this.isShowingCenteredScrolling) { document.querySelector('#modal-overlays').classList.add('active'); @@ -81,16 +82,16 @@ export default class IndexController extends Controller { @action closeTargetSelector() { - set(this, 'isShowingTargetSelector', false); - set(this, 'exampleTargetAttachment', 'middle left'); - set(this, 'exampleAttachment', 'middle right'); + this.isShowingTargetSelector = false; + this.exampleTargetAttachment = 'middle left'; + this.exampleAttachment = 'middle right'; } @action closeTargetElement() { - set(this, 'isShowingTargetElement', false); - set(this, 'exampleTargetAttachment', 'middle left'); - set(this, 'exampleAttachment', 'middle right'); + this.isShowingTargetElement = false; + this.exampleTargetAttachment = 'middle left'; + this.exampleAttachment = 'middle right'; } @action diff --git a/test-app/app/controllers/tethered-animatable.js b/test-app/app/controllers/tethered-animatable.js new file mode 100644 index 00000000..514d73b3 --- /dev/null +++ b/test-app/app/controllers/tethered-animatable.js @@ -0,0 +1,154 @@ +import Controller from '@ember/controller'; +import { action } from '@ember/object'; +import { tracked } from '@glimmer/tracking'; + +export default class TetheredAnimatableController extends Controller { + @tracked isShowingBasic = false; + @tracked isShowingTranslucent = false; + @tracked isShowingTranslucentWithCallback = false; + @tracked isShowingWithoutOverlay = false; + @tracked isShowingWithoutOverlayClickOutsideToClose = false; + @tracked isShowingWithoutOverlayClickOutsideToCloseAnotherOne = false; + @tracked isShowingTargetSelector = false; + @tracked isShowingTargetElement = false; + @tracked isShowingSubclassed = false; + @tracked isShowingCenteredScrolling = false; + @tracked isShowingElementCenterModal = false; + @tracked exampleTargetAttachment = 'middle left'; + @tracked exampleAttachment = 'middle right'; + + nextAttachment(val) { + switch (val) { + case 'middle right': + return 'bottom center'; + case 'bottom center': + return 'middle left'; + case 'middle left': + return 'top center'; + case 'top center': + return 'middle right'; + } + return false; + } + + @action + toggleActiveComponent() { + if (this.activeComponent === 'modal-dialog') { + this.activeComponent = 'tether-dialog'; + } else { + this.activeComponent = 'modal-dialog'; + } + } + + @action + toggleBasic() { + this.isShowingBasic = !this.isShowingBasic; + } + + @action + toggleTranslucent() { + this.isShowingTranslucent = !this.isShowingTranslucent; + } + + @action + toggleTranslucentWithCallback() { + this.isShowingTranslucentWithCallback = + !this.isShowingTranslucentWithCallback; + } + + @action + toggleWithoutOverlay() { + this.isShowingWithoutOverlay = !this.isShowingWithoutOverlay; + } + + @action + toggleWithoutOverlayClickOutsideToClose() { + this.isShowingWithoutOverlayClickOutsideToClose = + !this.isShowingWithoutOverlayClickOutsideToClose; + } + + @action + toggleWithoutOverlayClickOutsideToCloseAnotherOne() { + this.isShowingWithoutOverlayClickOutsideToCloseAnotherOne = + !this.isShowingWithoutOverlayClickOutsideToCloseAnotherOne; + } + + @action + toggleTargetSelector() { + if (this.isShowingTargetSelector) { + let newTargetAttachment = this.nextAttachment( + this.exampleTargetAttachment + ); + let newAttachment = this.nextAttachment(this.exampleAttachment); + this.exampleTargetAttachment = newTargetAttachment; + this.exampleAttachment = newAttachment; + if (newTargetAttachment !== 'middle left') { + return; + } + } + this.isShowingTargetSelector = !this.isShowingTargetSelector; + } + + @action + toggleTargetElement() { + if (this.isShowingTargetElement) { + let newTargetAttachment = this.nextAttachment( + this.exampleTargetAttachment + ); + let newAttachment = this.nextAttachment(this.exampleAttachment); + this.exampleTargetAttachment = newTargetAttachment; + this.exampleAttachment = newAttachment; + if (newTargetAttachment !== 'middle left') { + return; + } + } + this.isShowingTargetElement = !this.isShowingTargetElement; + } + + @action + toggleSubclassed() { + this.isShowingSubclassed = !this.isShowingSubclassed; + } + + @action + toggleCenteredScrolling() { + this.isShowingCenteredScrolling = !this.isShowingCenteredScrolling; + + if (this.isShowingCenteredScrolling) { + document.querySelector('#modal-overlays').classList.add('active'); + document.body.classList.add('centered-modal-showing'); + } else { + document.querySelector('#modal-overlays').classList.remove('active'); + document.body.classList.remove('centered-modal-showing'); + } + } + + @action + toggleElementCenterModal() { + this.isShowingElementCenterModal = !this.isShowingElementCenterModal; + if (this.isShowingElementCenterModal) { + this.targetAttachment = 'elementCenter'; + this.exampleTargetAttachment = 'elementCenter'; + this.exampleAttachment = 'elementCenter'; + } + } + + @action + closeTargetSelector() { + this.isShowingTargetSelector = false; + this.exampleTargetAttachment = 'middle left'; + this.exampleAttachment = 'middle right'; + } + + @action + closeTargetElement() { + this.isShowingTargetElement = false; + this.exampleTargetAttachment = 'middle left'; + this.exampleAttachment = 'middle right'; + } + + @action + clickedTranslucentOverlay() { + window.onClickOverlayCallbackCalled = true; + } +} diff --git a/tests/dummy/app/controllers/tethered.js b/test-app/app/controllers/tethered.js similarity index 55% rename from tests/dummy/app/controllers/tethered.js rename to test-app/app/controllers/tethered.js index 548c775a..1e54ce61 100644 --- a/tests/dummy/app/controllers/tethered.js +++ b/test-app/app/controllers/tethered.js @@ -1,12 +1,13 @@ -import { action, set } from '@ember/object'; import Controller from '@ember/controller'; +import { action } from '@ember/object'; +import { tracked } from '@glimmer/tracking'; export default class TetheredController extends Controller { - isShowingTargetSelector = false; - isShowingTargetElement = false; - isShowingElementCenterModal = false; - exampleTargetAttachment = 'middle left'; - exampleAttachment = 'middle right'; + @tracked isShowingTargetSelector = false; + @tracked isShowingTargetElement = false; + @tracked isShowingElementCenterModal = false; + @tracked exampleTargetAttachment = 'middle left'; + @tracked exampleAttachment = 'middle right'; nextAttachment(val) { switch (val) { @@ -29,13 +30,13 @@ export default class TetheredController extends Controller { this.exampleTargetAttachment ); let newAttachment = this.nextAttachment(this.exampleAttachment); - set(this, 'exampleTargetAttachment', newTargetAttachment); - set(this, 'exampleAttachment', newAttachment); + this.exampleTargetAttachment = newTargetAttachment; + this.exampleAttachment = newAttachment; if (newTargetAttachment !== 'middle left') { return; } } - this.toggleProperty('isShowingTargetSelector'); + this.isShowingTargetSelector = !this.isShowingTargetSelector; } @action @@ -45,26 +46,26 @@ export default class TetheredController extends Controller { this.exampleTargetAttachment ); let newAttachment = this.nextAttachment(this.exampleAttachment); - set(this, 'exampleTargetAttachment', newTargetAttachment); - set(this, 'exampleAttachment', newAttachment); + this.exampleTargetAttachment = newTargetAttachment; + this.exampleAttachment = newAttachment; if (newTargetAttachment !== 'middle left') { return; } } - this.toggleProperty('isShowingTargetElement'); + this.isShowingTargetElement = !this.isShowingTargetElement; } @action closeTargetSelector() { - set(this, 'isShowingTargetSelector', false); - set(this, 'exampleTargetAttachment', 'middle left'); - set(this, 'exampleAttachment', 'middle right'); + this.isShowingTargetSelector = false; + this.exampleTargetAttachment = 'middle left'; + this.exampleAttachment = 'middle right'; } @action closeTargetElement() { - set(this, 'isShowingTargetElement', false); - set(this, 'exampleTargetAttachment', 'middle left'); - set(this, 'exampleAttachment', 'middle right'); + this.isShowingTargetElement = false; + this.exampleTargetAttachment = 'middle left'; + this.exampleAttachment = 'middle right'; } } diff --git a/tests/dummy/app/helpers/lorem-ipsum.js b/test-app/app/helpers/lorem-ipsum.js similarity index 100% rename from tests/dummy/app/helpers/lorem-ipsum.js rename to test-app/app/helpers/lorem-ipsum.js diff --git a/tests/dummy/app/index.html b/test-app/app/index.html similarity index 89% rename from tests/dummy/app/index.html rename to test-app/app/index.html index 80801d7f..8213c8a3 100644 --- a/tests/dummy/app/index.html +++ b/test-app/app/index.html @@ -10,7 +10,7 @@ {{content-for "head"}} - + {{content-for "head-footer"}} @@ -18,7 +18,7 @@ {{content-for "body"}} - + {{content-for "body-footer"}} diff --git a/tests/dummy/app/router.js b/test-app/app/router.js similarity index 85% rename from tests/dummy/app/router.js rename to test-app/app/router.js index f7f2792f..9e4c1a31 100644 --- a/tests/dummy/app/router.js +++ b/test-app/app/router.js @@ -1,5 +1,5 @@ import EmberRouter from '@ember/routing/router'; -import config from 'dummy/config/environment'; +import config from 'test-app/config/environment'; export default class Router extends EmberRouter { location = config.locationType; diff --git a/tests/dummy/app/styles/_tomorrow-night-eighties.css b/test-app/app/styles/_tomorrow-night-eighties.css similarity index 100% rename from tests/dummy/app/styles/_tomorrow-night-eighties.css rename to test-app/app/styles/_tomorrow-night-eighties.css diff --git a/tests/dummy/app/styles/app.css b/test-app/app/styles/app.css similarity index 100% rename from tests/dummy/app/styles/app.css rename to test-app/app/styles/app.css diff --git a/tests/dummy/app/templates/animatable.hbs b/test-app/app/templates/animatable.hbs similarity index 69% rename from tests/dummy/app/templates/animatable.hbs rename to test-app/app/templates/animatable.hbs index 49b0baa8..3b11e2e1 100644 --- a/tests/dummy/app/templates/animatable.hbs +++ b/test-app/app/templates/animatable.hbs @@ -13,14 +13,14 @@

Basic

- + {{#if this.isShowingBasic}} {{!-- BEGIN-SNIPPET basic-modal-dialog-animatable --}} - +

Stop! Modal Time!

Basic

- +
{{!-- END-SNIPPET --}} {{/if}} @@ -28,14 +28,14 @@

With Translucent Overlay

- + {{#if this.isShowingTranslucent}} {{!-- BEGIN-SNIPPET translucent-modal-dialog-animatable --}} - +

Stop! Modal Time!

With Translucent Overlay

- +
{{!-- END-SNIPPET --}} {{/if}} @@ -43,14 +43,14 @@

Without Overlay

- + {{#if this.isShowingWithoutOverlay}} {{!-- BEGIN-SNIPPET without-overlay-modal-dialog-animatable --}} - +

Stop! Modal Time!

Without Overlay

- +
{{!-- END-SNIPPET --}} {{/if}} @@ -58,28 +58,28 @@

Without Overlay - Click Outside to Close

- + {{#if this.isShowingWithoutOverlayClickOutsideToClose}} {{!-- BEGIN-SNIPPET without-overlay-click-outside-to-close-modal-dialog-animatable --}} - +

Stop! Modal Time!

Without Overlay - Click Outside to Close

- +
{{!-- END-SNIPPET --}} {{/if}} {{#if this.isShowingWithoutOverlayClickOutsideToCloseAnotherOne}} - +

Stop! Another modal!

Without Overlay Another One - Click Outside to Close

- +
{{/if}} @@ -103,16 +103,16 @@

Via Subclass

- + {{#if this.isShowingSubclassed}} {{!-- BEGIN-SNIPPET subclass-modal-dialog-animatable --}} - +

Stop! Modal Time!

Via Subclass

- +
{{!-- END-SNIPPET --}} {{/if}} diff --git a/tests/dummy/app/templates/application.hbs b/test-app/app/templates/application.hbs similarity index 100% rename from tests/dummy/app/templates/application.hbs rename to test-app/app/templates/application.hbs diff --git a/tests/dummy/app/templates/components/component-that-uses-modal-dialog.hbs b/test-app/app/templates/components/component-that-uses-modal-dialog.hbs similarity index 100% rename from tests/dummy/app/templates/components/component-that-uses-modal-dialog.hbs rename to test-app/app/templates/components/component-that-uses-modal-dialog.hbs diff --git a/tests/dummy/app/templates/index.hbs b/test-app/app/templates/index.hbs similarity index 100% rename from tests/dummy/app/templates/index.hbs rename to test-app/app/templates/index.hbs diff --git a/tests/dummy/app/templates/tethered-animatable.hbs b/test-app/app/templates/tethered-animatable.hbs similarity index 100% rename from tests/dummy/app/templates/tethered-animatable.hbs rename to test-app/app/templates/tethered-animatable.hbs diff --git a/tests/dummy/app/templates/tethered.hbs b/test-app/app/templates/tethered.hbs similarity index 100% rename from tests/dummy/app/templates/tethered.hbs rename to test-app/app/templates/tethered.hbs diff --git a/tests/dummy/app/transitions.js b/test-app/app/transitions.js similarity index 100% rename from tests/dummy/app/transitions.js rename to test-app/app/transitions.js diff --git a/tests/dummy/config/deprecation-workflow.js b/test-app/config/deprecation-workflow.js similarity index 100% rename from tests/dummy/config/deprecation-workflow.js rename to test-app/config/deprecation-workflow.js diff --git a/tests/dummy/config/ember-cli-update.json b/test-app/config/ember-cli-update.json similarity index 100% rename from tests/dummy/config/ember-cli-update.json rename to test-app/config/ember-cli-update.json diff --git a/config/ember-try.js b/test-app/config/ember-try.js similarity index 100% rename from config/ember-try.js rename to test-app/config/ember-try.js diff --git a/tests/dummy/config/environment.js b/test-app/config/environment.js similarity index 97% rename from tests/dummy/config/environment.js rename to test-app/config/environment.js index f6588b54..a1b56f18 100644 --- a/tests/dummy/config/environment.js +++ b/test-app/config/environment.js @@ -2,7 +2,7 @@ module.exports = function (environment) { let ENV = { - modulePrefix: 'dummy', + modulePrefix: 'test-app', environment, rootURL: '/', locationType: 'auto', diff --git a/tests/dummy/config/optional-features.json b/test-app/config/optional-features.json similarity index 100% rename from tests/dummy/config/optional-features.json rename to test-app/config/optional-features.json diff --git a/tests/dummy/config/targets.js b/test-app/config/targets.js similarity index 100% rename from tests/dummy/config/targets.js rename to test-app/config/targets.js diff --git a/test-app/ember-cli-build.js b/test-app/ember-cli-build.js new file mode 100644 index 00000000..7faf4bf6 --- /dev/null +++ b/test-app/ember-cli-build.js @@ -0,0 +1,18 @@ +'use strict'; + +const EmberApp = require('ember-cli/lib/broccoli/ember-app'); + +module.exports = function (defaults) { + let app = new EmberApp(defaults, { + snippetSearchPaths: ['app'], + }); + + const { maybeEmbroider } = require('@embroider/test-setup'); + return maybeEmbroider(app, { + skipBabel: [ + { + package: 'qunit', + }, + ], + }); +}; diff --git a/test-app/package.json b/test-app/package.json new file mode 100644 index 00000000..59e236d6 --- /dev/null +++ b/test-app/package.json @@ -0,0 +1,90 @@ +{ + "name": "test-app", + "version": "4.0.1", + "private": true, + "description": "An ember-cli addon for implementing modal dialogs", + "repository": { + "type": "git", + "url": "https://github.com/yapplabs/ember-modal-dialog.git", + "directory": "test-app" + }, + "license": "MIT", + "author": "Yapp Labs and friends", + "directories": { + "test": "tests" + }, + "scripts": { + "build": "ember build --environment=production", + "deploy": "ember github-pages:commit --message \"Deploy gh-pages from commit $(git rev-parse HEAD)\"; git push; git checkout -", + "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"", + "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix", + "lint:hbs": "ember-template-lint .", + "lint:hbs:fix": "ember-template-lint . --fix", + "lint:js": "eslint . --cache", + "lint:js:fix": "eslint . --fix", + "release": "release-it", + "start": "ember serve", + "test": "npm-run-all lint test:*", + "test:ember": "ember test", + "test:ember-compatibility": "ember try:each" + }, + "devDependencies": { + "ember-modal-dialog": "4.0.1", + "@ember/jquery": "^2.0.0", + "@ember/optional-features": "^2.0.0", + "@ember/test-helpers": "^2.6.0", + "@embroider/test-setup": "^1.0.0", + "@glimmer/component": "^1.0.4", + "@glimmer/tracking": "^1.0.4", + "babel-eslint": "^10.1.0", + "broccoli-asset-rev": "^3.0.0", + "ember-auto-import": "^2.4.0", + "ember-cli": "~4.0.1", + "ember-cli-babel": "^7.26.8", + "ember-cli-dependency-checker": "^3.2.0", + "ember-cli-deprecation-workflow": "^2.1.0", + "ember-cli-github-pages": "^0.2.2", + "ember-cli-htmlbars": "^6.0.1", + "ember-cli-inject-live-reload": "^2.1.0", + "ember-cli-terser": "^4.0.2", + "ember-code-snippet": "^2.4.0", + "ember-disable-prototype-extensions": "^1.1.3", + "ember-export-application-global": "^2.0.1", + "ember-load-initializers": "^2.1.2", + "ember-qunit": "^5.1.5", + "ember-resolver": "^8.0.3", + "ember-source": "~3.28.8", + "ember-source-channel-url": "^3.0.0", + "ember-template-lint": "^3.15.0", + "ember-tether": "^2.0.1", + "ember-truth-helpers": "^3.0.0", + "ember-try": "^2.0.0", + "eslint": "^8.11.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-ember": "^10.5.8", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-qunit": "^7.2.0", + "loader.js": "^4.7.0", + "npm-run-all": "^4.1.5", + "prettier": "^2.5.1", + "qunit": "^2.17.2", + "qunit-dom": "^2.0.0", + "release-it": "^13.6.5", + "release-it-lerna-changelog": "^2.3.0", + "webpack": "^5.67.0" + }, + "resolutions": { + "**/@embroider/macros": "^1.0.0", + "**/@embroider/util": "^1.0.0" + }, + "engines": { + "node": "12.* || 14.* || >= 16" + }, + "ember": { + "edition": "octane" + }, + "volta": { + "extends": "../package.json" + } +} diff --git a/tests/dummy/public/modal-dialog.png b/test-app/public/modal-dialog.png similarity index 100% rename from tests/dummy/public/modal-dialog.png rename to test-app/public/modal-dialog.png diff --git a/tests/dummy/public/robots.txt b/test-app/public/robots.txt similarity index 100% rename from tests/dummy/public/robots.txt rename to test-app/public/robots.txt diff --git a/tests/dummy/public/tether-dialog.png b/test-app/public/tether-dialog.png similarity index 100% rename from tests/dummy/public/tether-dialog.png rename to test-app/public/tether-dialog.png diff --git a/testem.js b/test-app/testem.js similarity index 100% rename from testem.js rename to test-app/testem.js diff --git a/tests/acceptance/animatable-test.js b/test-app/tests/acceptance/animatable-test.js similarity index 100% rename from tests/acceptance/animatable-test.js rename to test-app/tests/acceptance/animatable-test.js diff --git a/tests/acceptance/basic-test.js b/test-app/tests/acceptance/basic-test.js similarity index 100% rename from tests/acceptance/basic-test.js rename to test-app/tests/acceptance/basic-test.js diff --git a/tests/acceptance/tethered-animatable-test.js b/test-app/tests/acceptance/tethered-animatable-test.js similarity index 100% rename from tests/acceptance/tethered-animatable-test.js rename to test-app/tests/acceptance/tethered-animatable-test.js diff --git a/tests/acceptance/tethered-test.js b/test-app/tests/acceptance/tethered-test.js similarity index 100% rename from tests/acceptance/tethered-test.js rename to test-app/tests/acceptance/tethered-test.js diff --git a/tests/helpers/.gitkeep b/test-app/tests/helpers/.gitkeep similarity index 100% rename from tests/helpers/.gitkeep rename to test-app/tests/helpers/.gitkeep diff --git a/tests/helpers/modal-asserts.js b/test-app/tests/helpers/modal-asserts.js similarity index 100% rename from tests/helpers/modal-asserts.js rename to test-app/tests/helpers/modal-asserts.js diff --git a/tests/index.html b/test-app/tests/index.html similarity index 89% rename from tests/index.html rename to test-app/tests/index.html index 1125b780..0182d30c 100644 --- a/tests/index.html +++ b/test-app/tests/index.html @@ -3,7 +3,7 @@ - Dummy Tests + ember-modal-dialog Tests @@ -11,7 +11,7 @@ {{content-for "test-head"}} - +