├── test-app
├── app
│ ├── models
│ │ └── .gitkeep
│ ├── routes
│ │ └── .gitkeep
│ ├── components
│ │ ├── .gitkeep
│ │ ├── glint-typecheck.js
│ │ └── glint-typecheck.hbs
│ ├── controllers
│ │ └── .gitkeep
│ ├── helpers
│ │ └── .gitkeep
│ ├── templates
│ │ ├── components
│ │ │ └── .gitkeep
│ │ └── application.hbs
│ ├── styles
│ │ └── app.css
│ ├── router.ts
│ ├── config
│ │ └── environment.d.ts
│ ├── app.ts
│ └── index.html
├── tests
│ ├── unit
│ │ └── .gitkeep
│ ├── integration
│ │ ├── .gitkeep
│ │ └── modifiers
│ │ │ └── click-outside-test.js
│ ├── test-helper.ts
│ ├── index.html
│ └── helpers
│ │ ├── index.js
│ │ └── index.ts
├── .watchmanconfig
├── types
│ └── global.d.ts
├── public
│ └── robots.txt
├── .template-lintrc.js
├── .stylelintrc.js
├── .stylelintignore
├── config
│ ├── optional-features.json
│ ├── targets.js
│ ├── ember-cli-update.json
│ ├── environment.js
│ └── ember-try.js
├── .prettierignore
├── .gitignore
├── .prettierrc.cjs
├── .editorconfig
├── ember-cli-build.js
├── .ember-cli
├── .npmignore
├── testem.js
├── tsconfig.json
├── README.md
├── eslint.config.mjs
└── package.json
├── ember-click-outside-modifier
├── src
│ ├── index.js
│ └── modifiers
│ │ └── click-outside.js
├── types
│ ├── index.d.ts
│ ├── template-registry.d.ts
│ └── modifiers
│ │ └── click-outside.d.ts
├── .template-lintrc.cjs
├── addon-main.cjs
├── .prettierignore
├── .gitignore
├── .prettierrc.cjs
├── babel.config.json
├── unpublished-development-types
│ └── index.d.ts
├── tsconfig.json
├── rollup.config.mjs
├── eslint.config.mjs
└── package.json
├── pnpm-workspace.yaml
├── .prettierrc.cjs
├── .prettierignore
├── .npmrc
├── .gitignore
├── .editorconfig
├── config
└── ember-cli-update.json
├── CONTRIBUTING.md
├── LICENSE.md
├── .github
└── workflows
│ ├── push-dist.yml
│ └── ci.yml
├── package.json
├── README.md
├── RELEASE.md
└── CHANGELOG.md
/test-app/app/models/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test-app/app/routes/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test-app/tests/unit/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test-app/app/components/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test-app/app/controllers/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test-app/app/helpers/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test-app/tests/integration/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test-app/app/templates/components/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test-app/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {
2 | "ignore_dirs": ["dist"]
3 | }
4 |
--------------------------------------------------------------------------------
/test-app/types/global.d.ts:
--------------------------------------------------------------------------------
1 | import '@glint/environment-ember-loose';
2 |
--------------------------------------------------------------------------------
/test-app/public/robots.txt:
--------------------------------------------------------------------------------
1 | # http://www.robotstxt.org
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/test-app/app/templates/application.hbs:
--------------------------------------------------------------------------------
1 |
Welcome to Ember
2 |
3 | {{outlet}}
--------------------------------------------------------------------------------
/test-app/.template-lintrc.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | module.exports = {
4 | extends: 'recommended',
5 | };
6 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/src/index.js:
--------------------------------------------------------------------------------
1 | export { default as clickOutside } from './modifiers/click-outside.js';
2 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/types/index.d.ts:
--------------------------------------------------------------------------------
1 | export { default as clickOutside } from './modifiers/click-outside';
2 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/.template-lintrc.cjs:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | module.exports = {
4 | extends: 'recommended',
5 | };
6 |
--------------------------------------------------------------------------------
/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | - 'ember-click-outside-modifier'
3 | - 'test-app'
4 | onlyBuiltDependencies:
5 | - 'core-js'
6 |
--------------------------------------------------------------------------------
/.prettierrc.cjs:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | module.exports = {
4 | plugins: ['prettier-plugin-ember-template-tag'],
5 | singleQuote: true,
6 | };
7 |
--------------------------------------------------------------------------------
/test-app/app/styles/app.css:
--------------------------------------------------------------------------------
1 | /* Ember supports plain CSS out of the box. More info: https://cli.emberjs.com/release/advanced-use/stylesheets/ */
2 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/addon-main.cjs:
--------------------------------------------------------------------------------
1 | const { addonV1Shim } = require('@embroider/addon-shim');
2 | module.exports = addonV1Shim(__dirname);
3 |
--------------------------------------------------------------------------------
/test-app/.stylelintrc.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | module.exports = {
4 | extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
5 | };
6 |
--------------------------------------------------------------------------------
/test-app/.stylelintignore:
--------------------------------------------------------------------------------
1 | # unconventional files
2 | /blueprints/*/files/
3 |
4 | # compiled output
5 | /dist/
6 |
7 | # addons
8 | /.node_modules.ember-try/
9 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/.prettierignore:
--------------------------------------------------------------------------------
1 | # unconventional js
2 | /blueprints/*/files/
3 |
4 | # compiled output
5 | /dist/
6 | /declarations/
7 |
8 | # misc
9 | /coverage/
10 |
--------------------------------------------------------------------------------
/test-app/app/components/glint-typecheck.js:
--------------------------------------------------------------------------------
1 | import Component from '@glimmer/component';
2 |
3 | export default class extends Component {
4 | noop() {
5 | // do nothing
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test-app/config/optional-features.json:
--------------------------------------------------------------------------------
1 | {
2 | "application-template-wrapper": false,
3 | "default-async-observers": true,
4 | "jquery-integration": false,
5 | "template-only-glimmer-components": true
6 | }
7 |
--------------------------------------------------------------------------------
/test-app/.prettierignore:
--------------------------------------------------------------------------------
1 | # unconventional js
2 | /blueprints/*/files/
3 |
4 | # compiled output
5 | /dist/
6 |
7 | # misc
8 | /coverage/
9 | !.*
10 | .*/
11 |
12 | # ember-try
13 | /.node_modules.ember-try/
14 |
--------------------------------------------------------------------------------
/test-app/config/targets.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const browsers = [
4 | 'last 1 Chrome versions',
5 | 'last 1 Firefox versions',
6 | 'last 1 Safari versions',
7 | ];
8 |
9 | module.exports = {
10 | browsers,
11 | };
12 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/types/template-registry.d.ts:
--------------------------------------------------------------------------------
1 | import type ClickOutsideModifier from './modifiers/click-outside';
2 |
3 | export default interface EmberClickOutsideRegistry {
4 | 'click-outside': typeof ClickOutsideModifier;
5 | }
6 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | # Prettier is also run from each package, so the ignores here
2 | # protect against files that may not be within a package
3 |
4 | # misc
5 | !.*
6 | .lint-todo/
7 |
8 | # ember-try
9 | /.node_modules.ember-try/
10 | /pnpm-lock.ember-try.yaml
11 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | # Docs: https://pnpm.io/npmrc
2 | # https://github.com/emberjs/rfcs/pull/907
3 |
4 | # we don't want addons to be bad citizens of the ecosystem
5 | auto-install-peers=false
6 |
7 | # we want true isolation,
8 | # if a dependency is not declared, we want an error
9 | resolve-peers-from-workspace-root=false
10 |
--------------------------------------------------------------------------------
/test-app/app/router.ts:
--------------------------------------------------------------------------------
1 | import EmberRouter from '@ember/routing/router';
2 | import config from 'test-app/config/environment';
3 |
4 | export default class Router extends EmberRouter {
5 | location = config.locationType;
6 | rootURL = config.rootURL;
7 | }
8 |
9 | Router.map(function () {
10 | // Add route declarations here
11 | });
12 |
--------------------------------------------------------------------------------
/test-app/tests/test-helper.ts:
--------------------------------------------------------------------------------
1 | import Application from 'test-app/app';
2 | import config from 'test-app/config/environment';
3 | import * as QUnit from 'qunit';
4 | import { setApplication } from '@ember/test-helpers';
5 | import { setup } from 'qunit-dom';
6 | import { start } from 'ember-qunit';
7 |
8 | setApplication(Application.create(config.APP));
9 |
10 | setup(QUnit.assert);
11 |
12 | start();
13 |
--------------------------------------------------------------------------------
/test-app/app/config/environment.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Type declarations for
3 | * import config from 'test-app/config/environment'
4 | */
5 | declare const config: {
6 | environment: string;
7 | modulePrefix: string;
8 | podModulePrefix: string;
9 | locationType: 'history' | 'hash' | 'none' | 'auto';
10 | rootURL: string;
11 | APP: Record;
12 | };
13 |
14 | export default config;
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | node_modules/
5 |
6 | # misc
7 | .env*
8 | .pnp*
9 | .pnpm-debug.log
10 | .sass-cache
11 | .eslintcache
12 | coverage/
13 | npm-debug.log*
14 | yarn-error.log
15 |
16 | # ember-try
17 | /.node_modules.ember-try/
18 | /package.json.ember-try
19 | /package-lock.json.ember-try
20 | /yarn.lock.ember-try
21 | /pnpm-lock.ember-try.yaml
22 |
--------------------------------------------------------------------------------
/test-app/app/app.ts:
--------------------------------------------------------------------------------
1 | import Application from '@ember/application';
2 | import Resolver from 'ember-resolver';
3 | import loadInitializers from 'ember-load-initializers';
4 | import config from 'test-app/config/environment';
5 |
6 | export default class App extends Application {
7 | modulePrefix = config.modulePrefix;
8 | podModulePrefix = config.podModulePrefix;
9 | Resolver = Resolver;
10 | }
11 |
12 | loadInitializers(App, config.modulePrefix);
13 |
--------------------------------------------------------------------------------
/test-app/app/components/glint-typecheck.hbs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # editorconfig.org
4 |
5 | root = true
6 |
7 | [*]
8 | end_of_line = lf
9 | charset = utf-8
10 | trim_trailing_whitespace = true
11 | insert_final_newline = true
12 | indent_style = space
13 | indent_size = 2
14 |
15 | [*.hbs]
16 | insert_final_newline = false
17 |
18 | [*.{diff,md}]
19 | trim_trailing_whitespace = false
20 |
--------------------------------------------------------------------------------
/test-app/.gitignore:
--------------------------------------------------------------------------------
1 | # compiled output
2 | /dist/
3 | /declarations/
4 |
5 | # dependencies
6 | /node_modules/
7 |
8 | # misc
9 | /.env*
10 | /.pnp*
11 | /.eslintcache
12 | /coverage/
13 | /npm-debug.log*
14 | /testem.log
15 | /yarn-error.log
16 |
17 | # ember-try
18 | /.node_modules.ember-try/
19 | /npm-shrinkwrap.json.ember-try
20 | /package.json.ember-try
21 | /package-lock.json.ember-try
22 | /yarn.lock.ember-try
23 |
24 | # broccoli-debug
25 | /DEBUG/
26 |
--------------------------------------------------------------------------------
/test-app/.prettierrc.cjs:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | module.exports = {
4 | plugins: ['prettier-plugin-ember-template-tag'],
5 | overrides: [
6 | {
7 | files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}',
8 | options: {
9 | singleQuote: true,
10 | },
11 | },
12 | {
13 | files: '*.{gjs,gts}',
14 | options: {
15 | singleQuote: true,
16 | templateSingleQuote: false,
17 | },
18 | },
19 | ],
20 | };
21 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/.gitignore:
--------------------------------------------------------------------------------
1 | # The authoritative copies of these live in the monorepo root (because they're
2 | # more useful on github that way), but the build copies them into here so they
3 | # will also appear in published NPM packages.
4 | /README.md
5 | /LICENSE.md
6 |
7 | # compiled output
8 | dist/
9 | declarations/
10 |
11 | # npm/pnpm/yarn pack output
12 | *.tgz
13 |
14 | # deps & caches
15 | node_modules/
16 | .eslintcache
17 | .prettiercache
18 |
--------------------------------------------------------------------------------
/test-app/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # editorconfig.org
4 |
5 | root = true
6 |
7 | [*]
8 | end_of_line = lf
9 | charset = utf-8
10 | trim_trailing_whitespace = true
11 | insert_final_newline = true
12 | indent_style = space
13 | indent_size = 2
14 |
15 | [*.hbs]
16 | insert_final_newline = false
17 |
18 | [*.{diff,md}]
19 | trim_trailing_whitespace = false
20 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/.prettierrc.cjs:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | module.exports = {
4 | plugins: ['prettier-plugin-ember-template-tag'],
5 | overrides: [
6 | {
7 | files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}',
8 | options: {
9 | singleQuote: true,
10 | },
11 | },
12 | {
13 | files: '*.{gjs,gts}',
14 | options: {
15 | singleQuote: true,
16 | templateSingleQuote: false,
17 | },
18 | },
19 | ],
20 | };
21 |
--------------------------------------------------------------------------------
/test-app/ember-cli-build.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const EmberApp = require('ember-cli/lib/broccoli/ember-app');
4 |
5 | module.exports = function (defaults) {
6 | let app = new EmberApp(defaults, {
7 | 'ember-cli-babel': { enableTypeScriptTransform: true },
8 | autoImport: {
9 | watchDependencies: ['ember-click-outside-modifier'],
10 | },
11 | });
12 |
13 | const { maybeEmbroider } = require('@embroider/test-setup');
14 | return maybeEmbroider(app);
15 | };
16 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/babel.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | [
4 | "@babel/plugin-transform-typescript",
5 | {
6 | "allExtensions": true,
7 | "onlyRemoveTypeImports": true,
8 | "allowDeclareFields": true
9 | }
10 | ],
11 | "@embroider/addon-dev/template-colocation-plugin",
12 | [
13 | "babel-plugin-ember-template-compilation",
14 | {
15 | "targetFormat": "hbs",
16 | "transforms": []
17 | }
18 | ]
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/types/modifiers/click-outside.d.ts:
--------------------------------------------------------------------------------
1 | import Modifier from 'ember-modifier';
2 |
3 | export interface ClickOutsideSignature {
4 | Element?: HTMLElement;
5 | Args: {
6 | Positional: [handlerValue: (event: Event) => unknown, useCapture?: boolean];
7 | Named?:
8 | | {
9 | events?: string[];
10 | }
11 | | {
12 | event?: string;
13 | };
14 | };
15 | }
16 |
17 | export default class ClickOutsideModifier extends Modifier {}
18 |
--------------------------------------------------------------------------------
/test-app/.ember-cli:
--------------------------------------------------------------------------------
1 | {
2 | /**
3 | Ember CLI sends analytics information by default. The data is completely
4 | anonymous, but there are times when you might want to disable this behavior.
5 |
6 | Setting `disableAnalytics` to true will prevent any data from being sent.
7 | */
8 | "disableAnalytics": false,
9 |
10 | /**
11 | Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
12 | rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
13 | */
14 | "isTypeScriptProject": true
15 | }
16 |
--------------------------------------------------------------------------------
/config/ember-cli-update.json:
--------------------------------------------------------------------------------
1 | {
2 | "schemaVersion": "1.0.0",
3 | "packages": [
4 | {
5 | "name": "@embroider/addon-blueprint",
6 | "version": "4.1.1",
7 | "blueprints": [
8 | {
9 | "name": "@embroider/addon-blueprint",
10 | "isBaseBlueprint": true,
11 | "options": [
12 | "--addon-location=ember-click-outside-modifier",
13 | "--ci-provider=github",
14 | "--pnpm",
15 | "--test-app-location=test-app",
16 | "--typescript"
17 | ]
18 | }
19 | ]
20 | }
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/test-app/.npmignore:
--------------------------------------------------------------------------------
1 | # compiled output
2 | /dist/
3 | /tmp/
4 |
5 | # dependencies
6 | /bower_components/
7 |
8 | # misc
9 | /.bowerrc
10 | /.editorconfig
11 | /.ember-cli.js
12 | /.env*
13 | /.eslintcache
14 | /.eslintignore
15 | /.eslintrc.js
16 | /.git/
17 | /.gitignore
18 | /.prettierignore
19 | /.prettierrc.js
20 | /.template-lintrc.js
21 | /.travis.yml
22 | /.watchmanconfig
23 | /bower.json
24 | /config/ember-try.js
25 | /CONTRIBUTING.md
26 | /ember-cli-build.js
27 | /testem.js
28 | /tests/
29 | /yarn.lock
30 | .gitkeep
31 |
32 | # ember-try
33 | /.node_modules.ember-try/
34 | /bower.json.ember-try
35 | /package.json.ember-try
36 |
--------------------------------------------------------------------------------
/test-app/config/ember-cli-update.json:
--------------------------------------------------------------------------------
1 | {
2 | "schemaVersion": "1.0.0",
3 | "packages": [
4 | {
5 | "name": "ember-cli",
6 | "version": "5.2.0-beta.0",
7 | "blueprints": [
8 | {
9 | "name": "app",
10 | "outputRepo": "https://github.com/ember-cli/ember-new-output",
11 | "codemodsSource": "ember-app-codemods-manifest@1",
12 | "isBaseBlueprint": true,
13 | "options": [
14 | "--no-welcome",
15 | "--pnpm",
16 | "--ci-provider=github",
17 | "--typescript"
18 | ]
19 | }
20 | ]
21 | }
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------
/test-app/testem.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | module.exports = {
4 | test_page: 'tests/index.html?hidepassed',
5 | disable_watching: true,
6 | launch_in_ci: ['Chrome'],
7 | launch_in_dev: ['Chrome'],
8 | browser_start_timeout: 120,
9 | browser_args: {
10 | Chrome: {
11 | ci: [
12 | // --no-sandbox is needed when running Chrome inside a container
13 | process.env.CI ? '--no-sandbox' : null,
14 | '--headless',
15 | '--disable-dev-shm-usage',
16 | '--disable-software-rasterizer',
17 | '--mute-audio',
18 | '--remote-debugging-port=0',
19 | '--window-size=1440,900',
20 | ].filter(Boolean),
21 | },
22 | },
23 | };
24 |
--------------------------------------------------------------------------------
/test-app/app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | TestApp
6 |
7 |
8 |
9 | {{content-for "head"}}
10 |
11 |
12 |
13 |
14 | {{content-for "head-footer"}}
15 |
16 |
17 | {{content-for "body"}}
18 |
19 |
20 |
21 |
22 | {{content-for "body-footer"}}
23 |
24 |
25 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/unpublished-development-types/index.d.ts:
--------------------------------------------------------------------------------
1 | // Add any types here that you need for local development only.
2 | // These will *not* be published as part of your addon, so be careful that your published code does not rely on them!
3 |
4 | import '@glint/environment-ember-loose';
5 | import '@glint/environment-ember-template-imports';
6 |
7 | // Uncomment if you need to support consuming projects in loose mode
8 | //
9 | // declare module '@glint/environment-ember-loose/registry' {
10 | // export default interface Registry {
11 | // // Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates)
12 | // // See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons
13 | // }
14 | // }
15 |
--------------------------------------------------------------------------------
/test-app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/ember/tsconfig.json",
3 | "glint": {
4 | "environment": ["ember-loose", "ember-template-imports"]
5 | },
6 | "compilerOptions": {
7 | "skipLibCheck": true,
8 | "noEmit": true,
9 | "noEmitOnError": false,
10 | "declaration": false,
11 | "declarationMap": false,
12 | // The combination of `baseUrl` with `paths` allows Ember's classic package
13 | // layout, which is not resolvable with the Node resolution algorithm, to
14 | // work with TypeScript.
15 | "baseUrl": ".",
16 | "paths": {
17 | "test-app/tests/*": ["tests/*"],
18 | "test-app/*": ["app/*"],
19 | "*": ["types/*"]
20 | },
21 | "types": [
22 | "ember-source/types",
23 | ]
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How To Contribute
2 |
3 | ## Installation
4 |
5 | - `git clone https://github.com/lifeart/ember-click-outside-modifier.git`
6 | - `cd ember-click-outside-modifier`
7 | - `pnpm install`
8 |
9 | ## Linting
10 |
11 | - `pnpm lint`
12 | - `pnpm lint:fix`
13 |
14 | ## Building the addon
15 |
16 | - `cd ember-click-outside-modifier`
17 | - `pnpm build`
18 |
19 | ## Running tests
20 |
21 | - `cd test-app`
22 | - `pnpm test` – Runs the test suite on the current Ember version
23 | - `pnpm test:watch` – Runs the test suite in "watch mode"
24 |
25 | ## Running the test application
26 |
27 | - `cd test-app`
28 | - `pnpm start`
29 | - Visit the test application at [http://localhost:4200](http://localhost:4200).
30 |
31 | For more information on using ember-cli, visit [https://cli.emberjs.com/release/](https://cli.emberjs.com/release/).
32 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2020
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 |
--------------------------------------------------------------------------------
/.github/workflows/push-dist.yml:
--------------------------------------------------------------------------------
1 | # Because this library needs to be built,
2 | # we can't easily point package.json files at the git repo for easy cross-repo testing.
3 | #
4 | # This workflow brings back that capability by placing the compiled assets on a "dist" branch
5 | # (configurable via the "branch" option below)
6 | name: Push dist
7 |
8 | on:
9 | push:
10 | branches:
11 | - main
12 | - master
13 |
14 | jobs:
15 | push-dist:
16 | name: Push dist
17 | runs-on: ubuntu-latest
18 | timeout-minutes: 10
19 |
20 | steps:
21 | - uses: actions/checkout@v4
22 | - name: Install pnpm
23 | uses: pnpm/action-setup@v4
24 |
25 | - name: Install Node
26 | uses: actions/setup-node@v4
27 | with:
28 | node-version: 20.x
29 | cache: 'pnpm'
30 |
31 | - name: Install Dependencies
32 | run: pnpm install --frozen-lockfile
33 | - uses: kategengler/put-built-npm-package-contents-on-branch@v2.0.0
34 | with:
35 | branch: dist
36 | token: ${{ secrets.GITHUB_TOKEN }}
37 | working-directory: 'ember-click-outside-modifier'
38 |
--------------------------------------------------------------------------------
/test-app/tests/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | TestApp Tests
6 |
7 |
8 |
9 | {{content-for "head"}}
10 | {{content-for "test-head"}}
11 |
12 |
13 |
14 |
15 |
16 | {{content-for "head-footer"}}
17 | {{content-for "test-head-footer"}}
18 |
19 |
20 | {{content-for "body"}}
21 | {{content-for "test-body"}}
22 |
23 |
24 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | {{content-for "body-footer"}}
37 | {{content-for "test-body-footer"}}
38 |
39 |
40 |
--------------------------------------------------------------------------------
/test-app/config/environment.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | module.exports = function (environment) {
4 | const ENV = {
5 | modulePrefix: 'test-app',
6 | environment,
7 | rootURL: '/',
8 | locationType: 'history',
9 | EmberENV: {
10 | EXTEND_PROTOTYPES: false,
11 | FEATURES: {
12 | // Here you can enable experimental features on an ember canary build
13 | // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
14 | },
15 | },
16 |
17 | APP: {
18 | // Here you can pass flags/options to your application instance
19 | // when it is created
20 | },
21 | };
22 |
23 | if (environment === 'development') {
24 | // ENV.APP.LOG_RESOLVER = true;
25 | // ENV.APP.LOG_ACTIVE_GENERATION = true;
26 | // ENV.APP.LOG_TRANSITIONS = true;
27 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
28 | // ENV.APP.LOG_VIEW_LOOKUPS = true;
29 | }
30 |
31 | if (environment === 'test') {
32 | // Testem prefers this...
33 | ENV.locationType = 'none';
34 |
35 | // keep test console output quieter
36 | ENV.APP.LOG_ACTIVE_GENERATION = false;
37 | ENV.APP.LOG_VIEW_LOOKUPS = false;
38 |
39 | ENV.APP.rootElement = '#ember-testing';
40 | ENV.APP.autoboot = false;
41 | }
42 |
43 | if (environment === 'production') {
44 | // here you can enable a production-specific feature
45 | }
46 |
47 | return ENV;
48 | };
49 |
--------------------------------------------------------------------------------
/test-app/tests/helpers/index.js:
--------------------------------------------------------------------------------
1 | import {
2 | setupApplicationTest as upstreamSetupApplicationTest,
3 | setupRenderingTest as upstreamSetupRenderingTest,
4 | setupTest as upstreamSetupTest,
5 | } from 'ember-qunit';
6 |
7 | // This file exists to provide wrappers around ember-qunit's / ember-mocha's
8 | // test setup functions. This way, you can easily extend the setup that is
9 | // needed per test type.
10 |
11 | function setupApplicationTest(hooks, options) {
12 | upstreamSetupApplicationTest(hooks, options);
13 |
14 | // Additional setup for application tests can be done here.
15 | //
16 | // For example, if you need an authenticated session for each
17 | // application test, you could do:
18 | //
19 | // hooks.beforeEach(async function () {
20 | // await authenticateSession(); // ember-simple-auth
21 | // });
22 | //
23 | // This is also a good place to call test setup functions coming
24 | // from other addons:
25 | //
26 | // setupIntl(hooks); // ember-intl
27 | // setupMirage(hooks); // ember-cli-mirage
28 | }
29 |
30 | function setupRenderingTest(hooks, options) {
31 | upstreamSetupRenderingTest(hooks, options);
32 |
33 | // Additional setup for rendering tests can be done here.
34 | }
35 |
36 | function setupTest(hooks, options) {
37 | upstreamSetupTest(hooks, options);
38 |
39 | // Additional setup for unit tests can be done here.
40 | }
41 |
42 | export { setupApplicationTest, setupRenderingTest, setupTest };
43 |
--------------------------------------------------------------------------------
/test-app/tests/helpers/index.ts:
--------------------------------------------------------------------------------
1 | import {
2 | setupApplicationTest as upstreamSetupApplicationTest,
3 | setupRenderingTest as upstreamSetupRenderingTest,
4 | setupTest as upstreamSetupTest,
5 | type SetupTestOptions,
6 | } from 'ember-qunit';
7 |
8 | // This file exists to provide wrappers around ember-qunit's / ember-mocha's
9 | // test setup functions. This way, you can easily extend the setup that is
10 | // needed per test type.
11 |
12 | function setupApplicationTest(hooks: NestedHooks, options?: SetupTestOptions) {
13 | upstreamSetupApplicationTest(hooks, options);
14 |
15 | // Additional setup for application tests can be done here.
16 | //
17 | // For example, if you need an authenticated session for each
18 | // application test, you could do:
19 | //
20 | // hooks.beforeEach(async function () {
21 | // await authenticateSession(); // ember-simple-auth
22 | // });
23 | //
24 | // This is also a good place to call test setup functions coming
25 | // from other addons:
26 | //
27 | // setupIntl(hooks); // ember-intl
28 | // setupMirage(hooks); // ember-cli-mirage
29 | }
30 |
31 | function setupRenderingTest(hooks: NestedHooks, options?: SetupTestOptions) {
32 | upstreamSetupRenderingTest(hooks, options);
33 |
34 | // Additional setup for rendering tests can be done here.
35 | }
36 |
37 | function setupTest(hooks: NestedHooks, options?: SetupTestOptions) {
38 | upstreamSetupTest(hooks, options);
39 |
40 | // Additional setup for unit tests can be done here.
41 | }
42 |
43 | export { setupApplicationTest, setupRenderingTest, setupTest };
44 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "repository": {
4 | "type": "git",
5 | "url": "git@github.com:lifeart/ember-click-outside-modifier.git"
6 | },
7 | "scripts": {
8 | "build": "pnpm --filter ember-click-outside-modifier build",
9 | "prepare": "pnpm build",
10 | "lint": "pnpm --filter '*' lint",
11 | "test": "pnpm --filter '*' test",
12 | "test:ember": "pnpm --filter '*' test:ember"
13 | },
14 | "packageManager": "pnpm@10.0.0",
15 | "devDependencies": {
16 | "@glint/core": "^1.2.1",
17 | "@release-it-plugins/lerna-changelog": "^7.0.0",
18 | "@release-it-plugins/workspaces": "^4.2.0",
19 | "concurrently": "^9.1.2",
20 | "prettier-plugin-ember-template-tag": "^2.0.2",
21 | "release-it": "^17.11.0"
22 | },
23 | "publishConfig": {
24 | "registry": "https://registry.npmjs.org"
25 | },
26 | "release-it": {
27 | "hooks": {
28 | "before:init": "cp README.md LICENSE.md ember-click-outside-modifier/"
29 | },
30 | "plugins": {
31 | "@release-it-plugins/lerna-changelog": {
32 | "infile": "CHANGELOG.md",
33 | "launchEditor": true
34 | },
35 | "@release-it-plugins/workspaces": {
36 | "workspaces": [
37 | "ember-click-outside-modifier"
38 | ]
39 | }
40 | },
41 | "git": {
42 | "tagName": "v${version}"
43 | },
44 | "github": {
45 | "release": true,
46 | "tokenRef": "GITHUB_AUTH"
47 | },
48 | "npm": false
49 | },
50 | "volta": {
51 | "node": "20.19.0",
52 | "pnpm": "10.6.5"
53 | },
54 | "version": "4.1.2"
55 | }
56 |
--------------------------------------------------------------------------------
/test-app/README.md:
--------------------------------------------------------------------------------
1 | # test-app
2 |
3 | This README outlines the details of collaborating on this Ember application.
4 | A short introduction of this app could easily go here.
5 |
6 | ## Prerequisites
7 |
8 | You will need the following things properly installed on your computer.
9 |
10 | - [Git](https://git-scm.com/)
11 | - [Node.js](https://nodejs.org/)
12 | - [pnpm](https://pnpm.io/)
13 | - [Ember CLI](https://cli.emberjs.com/release/)
14 | - [Google Chrome](https://google.com/chrome/)
15 |
16 | ## Installation
17 |
18 | - `git clone https://github.com/lifeart/ember-click-outside-modifier.git` this repository
19 | - `cd ember-click-outside-modifier/test-app`
20 | - `pnpm install`
21 |
22 | ## Running / Development
23 |
24 | - `pnpm start`
25 | - Visit your app at [http://localhost:4200](http://localhost:4200).
26 | - Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).
27 |
28 | ### Code Generators
29 |
30 | Make use of the many generators for code, try `ember help generate` for more details
31 |
32 | ### Running Tests
33 |
34 | - `pnpm test`
35 | - `pnpm test:ember --server`
36 |
37 | ### Linting
38 |
39 | - `pnpm lint`
40 | - `pnpm lint:fix`
41 |
42 | ### Building
43 |
44 | - `pnpm ember build` (development)
45 | - `pnpm build` (production)
46 |
47 | ### Deploying
48 |
49 | Specify what it takes to deploy your app.
50 |
51 | ## Further Reading / Useful Links
52 |
53 | - [ember.js](https://emberjs.com/)
54 | - [ember-cli](https://cli.emberjs.com/release/)
55 | - Development Browser Extensions
56 | - [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
57 | - [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
58 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/src/modifiers/click-outside.js:
--------------------------------------------------------------------------------
1 | const HAS_WINDOWS = typeof window !== 'undefined';
2 | const HAS_NAVIGATOR = typeof navigator !== 'undefined';
3 | const IS_TOUCH =
4 | HAS_WINDOWS &&
5 | ('ontouchstart' in window ||
6 | (HAS_NAVIGATOR && navigator.msMaxTouchPoints > 0));
7 | const EVENTS = IS_TOUCH ? ['touchstart'] : ['click'];
8 |
9 | import { modifier } from 'ember-modifier';
10 |
11 | function getEventNames({ event, events }) {
12 | if (events) {
13 | return events;
14 | }
15 |
16 | if (event) {
17 | return [event];
18 | }
19 |
20 | return EVENTS;
21 | }
22 |
23 | export default modifier(
24 | function clickOutside(
25 | element,
26 | [handlerValue, useCapture] = [undefined, false],
27 | hashParams = {},
28 | ) {
29 | const refEvent = new Event('clickReference');
30 | const events = getEventNames(hashParams);
31 | const isFunction = typeof handlerValue === 'function';
32 | if (!isFunction) {
33 | throw new Error('{{click-outside}}: Handler value must be a function.');
34 | }
35 | const handlers = [];
36 | events.forEach((eventName) => {
37 | const handler = (event) => {
38 | if (refEvent.timeStamp > event.timeStamp) {
39 | return;
40 | }
41 | const isClickOutside =
42 | event.target !== element && !element.contains(event.target);
43 | if (!isClickOutside) {
44 | return;
45 | }
46 | handlerValue(event);
47 | };
48 | handlers.push([eventName, handler]);
49 | document.documentElement.addEventListener(eventName, handler, useCapture);
50 | });
51 | return () => {
52 | handlers.forEach(([eventName, handler]) => {
53 | document.documentElement.removeEventListener(
54 | eventName,
55 | handler,
56 | useCapture,
57 | );
58 | });
59 | };
60 | },
61 | { eager: false },
62 | );
63 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/ember/tsconfig.json",
3 | "include": ["src/**/*", "types/**/*", "unpublished-development-types/**/*"],
4 | "glint": {
5 | "environment": ["ember-loose", "ember-template-imports"]
6 | },
7 | "compilerOptions": {
8 | "allowJs": true,
9 | "declarationDir": "declarations",
10 | /**
11 | https://www.typescriptlang.org/tsconfig#noEmit
12 |
13 | We want to emit declarations, so this option must be set to `false`.
14 | @tsconfig/ember sets this to `true`, which is incompatible with our need to set `emitDeclarationOnly`.
15 | @tsconfig/ember is more optimized for apps, which wouldn't emit anything, only type check.
16 | */
17 | "noEmit": false,
18 | /**
19 | https://www.typescriptlang.org/tsconfig#emitDeclarationOnly
20 | We want to only emit declarations as we use Rollup to emit JavaScript.
21 | */
22 | "emitDeclarationOnly": true,
23 |
24 | /**
25 | https://www.typescriptlang.org/tsconfig#noEmitOnError
26 | Do not block emit on TS errors.
27 | */
28 | "noEmitOnError": false,
29 |
30 | /**
31 | https://www.typescriptlang.org/tsconfig#rootDir
32 | "Default: The longest common path of all non-declaration input files."
33 |
34 | Because we want our declarations' structure to match our rollup output,
35 | we need this "rootDir" to match the "srcDir" in the rollup.config.mjs.
36 |
37 | This way, we can have simpler `package.json#exports` that matches
38 | imports to files on disk
39 | */
40 | "rootDir": "./src",
41 |
42 | /**
43 | https://www.typescriptlang.org/tsconfig#allowImportingTsExtensions
44 |
45 | We want our tooling to know how to resolve our custom files so the appropriate plugins
46 | can do the proper transformations on those files.
47 | */
48 | "allowImportingTsExtensions": true,
49 |
50 | "types": ["ember-source/types"]
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ember-click-outside-modifier
2 |
3 | Ember modifier to react on clicks outside an element without stopping the event propagation. Great for closing dialogues, menus among other things.
4 |
5 | If you need more control on click outside - take a look at [ember-click-outside](https://github.com/zeppelin/ember-click-outside)
6 |
7 | Inspired by [v-click-outside](https://github.com/ndelvalle/v-click-outside)
8 |
9 | ## Compatibility
10 |
11 | * Ember.js v3.20 or above
12 | - Embroider or ember-auto-import v2 (this is [v2 addon](https://emberjs.github.io/rfcs/0507-embroider-v2-package-format.html))
13 |
14 | ## Installation
15 |
16 | ```
17 | ember install ember-click-outside-modifier
18 | ```
19 |
20 | ## Usage
21 |
22 | ```hbs
23 |
24 | ```
25 |
26 | You can also provide specific events that you want to bind to with the `event` or `events` named arguments.
27 |
28 | ```hbs
29 |
30 |
31 | ```
32 |
33 | ## Usage with Glint
34 |
35 | `ember-click-outside-modifier` is a glint enabled addon. Add this to your
36 | `types/global.d.ts` file:
37 |
38 | ```ts
39 | import '@glint/environment-ember-loose';
40 |
41 | import type EmberClickOutsideRegistry from 'ember-click-outside-modifier/template-registry';
42 |
43 | declare module '@glint/environment-ember-loose/registry' {
44 | export default interface Registry extends EmberClickOutsideRegistry, /* other addon registries */ {
45 | // local entries
46 | }
47 | }
48 | ```
49 |
50 | For the entire guide, please refer to [Using
51 | Addons](https://typed-ember.gitbook.io/glint/environments/ember/using-addons#using-glint-enabled-addons)
52 | section on the glint handbook.
53 |
54 | Types are made available through package.json `exports` field.
55 |
56 | ## Usage with `` tag
57 |
58 | For usage in `gts` or `gjs` files, modifier are exported from the index:
59 |
60 | ```hbs
61 | import { clickOutside } from 'ember-click-outside-modifier';
62 |
63 |
64 |
65 | Lorem ipsum.
66 |
67 |
68 | ```
69 |
70 | ## Contributing
71 |
72 | See the [Contributing](CONTRIBUTING.md) guide for details.
73 |
74 | ## License
75 |
76 | This project is licensed under the [MIT License](LICENSE.md).
77 |
--------------------------------------------------------------------------------
/RELEASE.md:
--------------------------------------------------------------------------------
1 | # Release Process
2 |
3 | Releases are mostly automated using
4 | [release-it](https://github.com/release-it/release-it/) and
5 | [lerna-changelog](https://github.com/lerna/lerna-changelog/).
6 |
7 | ## Preparation
8 |
9 | Since the majority of the actual release process is automated, the primary
10 | remaining task prior to releasing is confirming that all pull requests that
11 | have been merged since the last release have been labeled with the appropriate
12 | `lerna-changelog` labels and the titles have been updated to ensure they
13 | represent something that would make sense to our users. Some great information
14 | on why this is important can be found at
15 | [keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
16 | guiding principle here is that changelogs are for humans, not machines.
17 |
18 | When reviewing merged PR's the labels to be used are:
19 |
20 | * breaking - Used when the PR is considered a breaking change.
21 | * enhancement - Used when the PR adds a new feature or enhancement.
22 | * bug - Used when the PR fixes a bug included in a previous release.
23 | * documentation - Used when the PR adds or updates documentation.
24 | * internal - Used for internal changes that still require a mention in the
25 | changelog/release notes.
26 |
27 | ## Release
28 |
29 | Once the prep work is completed, the actual release is straight forward:
30 |
31 | * First, ensure that you have installed your projects dependencies:
32 |
33 | ```sh
34 | pnpm install
35 | ```
36 |
37 | * Second, ensure that you have obtained a
38 | [GitHub personal access token][generate-token] with the `repo` scope (no
39 | other permissions are needed). Make sure the token is available as the
40 | `GITHUB_AUTH` environment variable.
41 |
42 | For instance:
43 |
44 | ```bash
45 | export GITHUB_AUTH=abc123def456
46 | ```
47 |
48 | [generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable
49 |
50 | * And last (but not least 😁) do your release.
51 |
52 | ```sh
53 | pnpm release-it
54 | ```
55 |
56 | [release-it](https://github.com/release-it/release-it/) manages the actual
57 | release process. It will prompt you to choose the version number after which
58 | you will have the chance to hand tweak the changelog to be used (for the
59 | `CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
60 | pushing the tag and commits, etc.
61 |
62 | ## Unstable Tag
63 |
64 | For every push to the master branch, [`Publish Unstable`](./.github/workflows/publish-unstable.yml)
65 | publishes an NPM package to the "unstable" NPM tag.
66 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/rollup.config.mjs:
--------------------------------------------------------------------------------
1 | import { babel } from '@rollup/plugin-babel';
2 | import copy from 'rollup-plugin-copy';
3 | import { Addon } from '@embroider/addon-dev/rollup';
4 |
5 | const addon = new Addon({
6 | srcDir: 'src',
7 | destDir: 'dist',
8 | });
9 |
10 | export default {
11 | // This provides defaults that work well alongside `publicEntrypoints` below.
12 | // You can augment this if you need to.
13 | output: addon.output(),
14 |
15 | plugins: [
16 | // These are the modules that users should be able to import from your
17 | // addon. Anything not listed here may get optimized away.
18 | // By default all your JavaScript modules (**/*.js) will be importable.
19 | // But you are encouraged to tweak this to only cover the modules that make
20 | // up your addon's public API. Also make sure your package.json#exports
21 | // is aligned to the config here.
22 | // See https://github.com/embroider-build/embroider/blob/main/docs/v2-faq.md#how-can-i-define-the-public-exports-of-my-addon
23 | addon.publicEntrypoints(['**/*.js', 'index.js', 'template-registry.js']),
24 |
25 | // These are the modules that should get reexported into the traditional
26 | // "app" tree. Things in here should also be in publicEntrypoints above, but
27 | // not everything in publicEntrypoints necessarily needs to go here.
28 | addon.appReexports([
29 | 'components/**/*.js',
30 | 'helpers/**/*.js',
31 | 'modifiers/**/*.js',
32 | 'services/**/*.js',
33 | ]),
34 |
35 | // Follow the V2 Addon rules about dependencies. Your code can import from
36 | // `dependencies` and `peerDependencies` as well as standard Ember-provided
37 | // package names.
38 | addon.dependencies(),
39 |
40 | // This babel config should *not* apply presets or compile away ES modules.
41 | // It exists only to provide development niceties for you, like automatic
42 | // template colocation.
43 | //
44 | // By default, this will load the actual babel config from the file
45 | // babel.config.json.
46 | babel({
47 | extensions: ['.js', '.gjs', '.ts', '.gts'],
48 | babelHelpers: 'bundled',
49 | }),
50 |
51 | // Ensure that standalone .hbs files are properly integrated as Javascript.
52 | addon.hbs(),
53 |
54 | // Ensure that .gjs files are properly integrated as Javascript
55 | addon.gjs(),
56 |
57 | // Emit .d.ts declaration files
58 | addon.declarations('declarations'),
59 |
60 | // addons are allowed to contain imports of .css files, which we want rollup
61 | // to leave alone and keep in the published output.
62 | addon.keepAssets(['**/*.css']),
63 |
64 | // Remove leftover build artifacts when starting a new build.
65 | addon.clean(),
66 |
67 | // Copy Readme and License into published package
68 | copy({
69 | targets: [
70 | { src: '../README.md', dest: '.' },
71 | { src: '../LICENSE.md', dest: '.' },
72 | ],
73 | }),
74 | ],
75 | };
76 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/eslint.config.mjs:
--------------------------------------------------------------------------------
1 | /**
2 | * Debugging:
3 | * https://eslint.org/docs/latest/use/configure/debug
4 | * ----------------------------------------------------
5 | *
6 | * Print a file's calculated configuration
7 | *
8 | * npx eslint --print-config path/to/file.js
9 | *
10 | * Inspecting the config
11 | *
12 | * npx eslint --inspect-config
13 | *
14 | */
15 | import babelParser from '@babel/eslint-parser';
16 | import js from '@eslint/js';
17 | import prettier from 'eslint-config-prettier';
18 | import ember from 'eslint-plugin-ember/recommended';
19 | import importPlugin from 'eslint-plugin-import';
20 | import n from 'eslint-plugin-n';
21 | import globals from 'globals';
22 | import ts from 'typescript-eslint';
23 |
24 | const parserOptions = {
25 | esm: {
26 | js: {
27 | ecmaFeatures: { modules: true },
28 | ecmaVersion: 'latest',
29 | },
30 | ts: {
31 | projectService: true,
32 | project: true,
33 | tsconfigRootDir: import.meta.dirname,
34 | },
35 | },
36 | };
37 |
38 | export default ts.config(
39 | js.configs.recommended,
40 | ember.configs.base,
41 | ember.configs.gjs,
42 | ember.configs.gts,
43 | prettier,
44 | /**
45 | * Ignores must be in their own object
46 | * https://eslint.org/docs/latest/use/configure/ignore
47 | */
48 | {
49 | ignores: ['dist/', 'declarations/', 'node_modules/', 'coverage/', '!**/.*'],
50 | },
51 | /**
52 | * https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
53 | */
54 | {
55 | linterOptions: {
56 | reportUnusedDisableDirectives: 'error',
57 | },
58 | },
59 | {
60 | files: ['**/*.js'],
61 | languageOptions: {
62 | parser: babelParser,
63 | },
64 | },
65 | {
66 | files: ['**/*.{js,gjs}'],
67 | languageOptions: {
68 | parserOptions: parserOptions.esm.js,
69 | globals: {
70 | ...globals.browser,
71 | },
72 | },
73 | },
74 | {
75 | files: ['**/*.{ts,gts}'],
76 | languageOptions: {
77 | parser: ember.parser,
78 | parserOptions: parserOptions.esm.ts,
79 | },
80 | extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts],
81 | },
82 | {
83 | files: ['src/**/*'],
84 | plugins: {
85 | import: importPlugin,
86 | },
87 | rules: {
88 | // require relative imports use full extensions
89 | 'import/extensions': ['error', 'always', { ignorePackages: true }],
90 | },
91 | },
92 | /**
93 | * CJS node files
94 | */
95 | {
96 | files: [
97 | '**/*.cjs',
98 | '.prettierrc.js',
99 | '.stylelintrc.js',
100 | '.template-lintrc.js',
101 | 'addon-main.cjs',
102 | ],
103 | plugins: {
104 | n,
105 | },
106 |
107 | languageOptions: {
108 | sourceType: 'script',
109 | ecmaVersion: 'latest',
110 | globals: {
111 | ...globals.node,
112 | },
113 | },
114 | },
115 | /**
116 | * ESM node files
117 | */
118 | {
119 | files: ['**/*.mjs'],
120 | plugins: {
121 | n,
122 | },
123 |
124 | languageOptions: {
125 | sourceType: 'module',
126 | ecmaVersion: 'latest',
127 | parserOptions: parserOptions.esm.js,
128 | globals: {
129 | ...globals.node,
130 | },
131 | },
132 | },
133 | );
134 |
--------------------------------------------------------------------------------
/ember-click-outside-modifier/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ember-click-outside-modifier",
3 | "version": "4.1.2",
4 | "description": "Ember modifier to catch events outside marked DOM element",
5 | "keywords": [
6 | "ember-addon",
7 | "ember-modifier"
8 | ],
9 | "repository": {
10 | "type": "git",
11 | "url": "git@github.com:lifeart/ember-click-outside-modifier.git"
12 | },
13 | "license": "MIT",
14 | "author": "Aleksandr Kanunnikov ",
15 | "exports": {
16 | ".": {
17 | "types": "./types/index.d.ts",
18 | "default": "./dist/index.js"
19 | },
20 | "./*": {
21 | "types": "./types/*.d.ts",
22 | "default": "./dist/*.js"
23 | },
24 | "./addon-main.js": "./addon-main.cjs"
25 | },
26 | "typesVersions": {
27 | "*": {
28 | "*": [
29 | "types/*"
30 | ]
31 | }
32 | },
33 | "files": [
34 | "addon-main.cjs",
35 | "dist",
36 | "types"
37 | ],
38 | "scripts": {
39 | "build": "rollup --config",
40 | "format": "prettier . --cache --write",
41 | "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
42 | "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm run format",
43 | "lint:format": "prettier . --cache --check",
44 | "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
45 | "lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
46 | "lint:js": "eslint . --cache",
47 | "lint:js:fix": "eslint . --fix",
48 | "lint:types": "glint",
49 | "prepack": "rollup --config",
50 | "start": "rollup --config --watch",
51 | "test": "echo 'A v2 addon does not have tests, run tests in test-app'"
52 | },
53 | "dependencies": {
54 | "@embroider/addon-shim": "^1.8.9",
55 | "ember-modifier": "^3.0.0 || ^4.0.0"
56 | },
57 | "devDependencies": {
58 | "@babel/core": "^7.25.2",
59 | "@babel/eslint-parser": "^7.25.1",
60 | "@babel/plugin-transform-typescript": "^7.25.2",
61 | "@babel/runtime": "^7.25.6",
62 | "@embroider/addon-dev": "^7.1.0",
63 | "@eslint/js": "^9.17.0",
64 | "@glint/core": "^1.4.0",
65 | "@glint/environment-ember-loose": "^1.4.0",
66 | "@glint/environment-ember-template-imports": "^1.4.0",
67 | "@glint/template": "^1.4.0",
68 | "@rollup/plugin-babel": "^6.0.4",
69 | "@tsconfig/ember": "^3.0.8",
70 | "babel-plugin-ember-template-compilation": "^2.2.5",
71 | "concurrently": "^9.0.1",
72 | "ember-source": "~5.4.0",
73 | "ember-template-lint": "^6.0.0",
74 | "eslint": "^9.17.0",
75 | "eslint-config-prettier": "^9.1.0",
76 | "eslint-plugin-ember": "^12.3.3",
77 | "eslint-plugin-import": "^2.31.0",
78 | "eslint-plugin-n": "^17.15.1",
79 | "globals": "^15.14.0",
80 | "prettier": "^3.4.2",
81 | "prettier-plugin-ember-template-tag": "^2.0.4",
82 | "rollup": "^4.22.5",
83 | "rollup-plugin-copy": "^3.5.0",
84 | "typescript": "~5.6.0",
85 | "typescript-eslint": "^8.19.1"
86 | },
87 | "publishConfig": {
88 | "registry": "https://registry.npmjs.org"
89 | },
90 | "ember": {
91 | "edition": "octane"
92 | },
93 | "ember-addon": {
94 | "version": 2,
95 | "type": "addon",
96 | "main": "addon-main.cjs",
97 | "app-js": {
98 | "./modifiers/click-outside.js": "./dist/_app_/modifiers/click-outside.js"
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/test-app/eslint.config.mjs:
--------------------------------------------------------------------------------
1 | /**
2 | * Debugging:
3 | * https://eslint.org/docs/latest/use/configure/debug
4 | * ----------------------------------------------------
5 | *
6 | * Print a file's calculated configuration
7 | *
8 | * npx eslint --print-config path/to/file.js
9 | *
10 | * Inspecting the config
11 | *
12 | * npx eslint --inspect-config
13 | *
14 | */
15 | import globals from 'globals';
16 | import js from '@eslint/js';
17 |
18 | import ts from 'typescript-eslint';
19 |
20 | import ember from 'eslint-plugin-ember/recommended';
21 |
22 | import prettier from 'eslint-plugin-prettier/recommended';
23 | import qunit from 'eslint-plugin-qunit';
24 | import n from 'eslint-plugin-n';
25 |
26 | import babelParser from '@babel/eslint-parser';
27 |
28 | const parserOptions = {
29 | esm: {
30 | js: {
31 | ecmaFeatures: { modules: true },
32 | ecmaVersion: 'latest',
33 | requireConfigFile: false,
34 | babelOptions: {
35 | plugins: [
36 | [
37 | '@babel/plugin-proposal-decorators',
38 | { decoratorsBeforeExport: true },
39 | ],
40 | ],
41 | },
42 | },
43 | ts: {
44 | projectService: true,
45 | tsconfigRootDir: import.meta.dirname,
46 | },
47 | },
48 | };
49 |
50 | export default ts.config(
51 | js.configs.recommended,
52 | ember.configs.base,
53 | ember.configs.gjs,
54 | ember.configs.gts,
55 | prettier,
56 | /**
57 | * Ignores must be in their own object
58 | * https://eslint.org/docs/latest/use/configure/ignore
59 | */
60 | {
61 | ignores: ['dist/', 'node_modules/', 'coverage/', '!**/.*'],
62 | },
63 | /**
64 | * https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
65 | */
66 | {
67 | linterOptions: {
68 | reportUnusedDisableDirectives: 'error',
69 | },
70 | },
71 | {
72 | files: ['**/*.js'],
73 | languageOptions: {
74 | parser: babelParser,
75 | },
76 | },
77 | {
78 | files: ['**/*.{js,gjs}'],
79 | languageOptions: {
80 | parserOptions: parserOptions.esm.js,
81 | globals: {
82 | ...globals.browser,
83 | },
84 | },
85 | },
86 | {
87 | files: ['**/*.{ts,gts}'],
88 | languageOptions: {
89 | parser: ember.parser,
90 | parserOptions: parserOptions.esm.ts,
91 | },
92 | extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts],
93 | },
94 | {
95 | files: ['tests/**/*-test.{js,gjs,ts,gts}'],
96 | plugins: {
97 | qunit,
98 | },
99 | },
100 | /**
101 | * CJS node files
102 | */
103 | {
104 | files: [
105 | '**/*.cjs',
106 | 'config/**/*.js',
107 | 'testem.js',
108 | 'testem*.js',
109 | '.prettierrc.js',
110 | '.stylelintrc.js',
111 | '.template-lintrc.js',
112 | 'ember-cli-build.js',
113 | ],
114 | plugins: {
115 | n,
116 | },
117 |
118 | languageOptions: {
119 | sourceType: 'script',
120 | ecmaVersion: 'latest',
121 | globals: {
122 | ...globals.node,
123 | },
124 | },
125 | },
126 | /**
127 | * ESM node files
128 | */
129 | {
130 | files: ['**/*.mjs'],
131 | plugins: {
132 | n,
133 | },
134 |
135 | languageOptions: {
136 | sourceType: 'module',
137 | ecmaVersion: 'latest',
138 | parserOptions: parserOptions.esm.js,
139 | globals: {
140 | ...globals.node,
141 | },
142 | },
143 | },
144 | );
145 |
--------------------------------------------------------------------------------
/test-app/config/ember-try.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const getChannelURL = require('ember-source-channel-url');
4 | const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');
5 |
6 | module.exports = async function () {
7 | return {
8 | usePnpm: true,
9 | scenarios: [
10 | {
11 | name: 'ember-lts-3.20',
12 | npm: {
13 | devDependencies: {
14 | '@ember/test-helpers': '^2.6.0',
15 | 'ember-cli-app-version': '^6.0.1',
16 | 'ember-cli': '~3.20.0',
17 | 'ember-modifier': '^3.0.0',
18 | 'ember-qunit': '^5.1.5',
19 | 'ember-resolver': '^8.0.3',
20 | 'ember-source': '~3.20.6',
21 | },
22 | },
23 | },
24 | {
25 | name: 'ember-lts-3.24',
26 | npm: {
27 | devDependencies: {
28 | '@ember/test-helpers': '^2.6.0',
29 | 'ember-cli-app-version': '^6.0.1',
30 | 'ember-cli': '~3.24.0',
31 | 'ember-qunit': '^5.1.5',
32 | 'ember-resolver': '^8.0.3',
33 | 'ember-source': '~3.24.6',
34 | },
35 | },
36 | },
37 | {
38 | name: 'ember-lts-3.28',
39 | npm: {
40 | devDependencies: {
41 | '@ember/test-helpers': '^2.6.0',
42 | 'ember-cli': '~3.28.0',
43 | 'ember-qunit': '^5.1.5',
44 | 'ember-resolver': '^8.0.3',
45 | 'ember-source': '~3.28.9',
46 | },
47 | },
48 | },
49 | {
50 | name: 'ember-lts-4.4',
51 | npm: {
52 | devDependencies: {
53 | '@ember/test-helpers': '^2.6.0',
54 | 'ember-qunit': '^5.1.5',
55 | 'ember-resolver': '^8.0.3',
56 | 'ember-source': '~4.4.0',
57 | },
58 | },
59 | },
60 | {
61 | name: 'ember-lts-4.8',
62 | npm: {
63 | devDependencies: {
64 | 'ember-source': '~4.8.0',
65 | },
66 | },
67 | },
68 | {
69 | name: 'ember-lts-4.12',
70 | npm: {
71 | devDependencies: {
72 | 'ember-source': '~4.12.0',
73 | },
74 | },
75 | },
76 | {
77 | name: 'ember-lts-5.4',
78 | npm: {
79 | devDependencies: {
80 | 'ember-source': '~5.4.0',
81 | },
82 | },
83 | },
84 | {
85 | name: 'ember-lts-5.8',
86 | npm: {
87 | devDependencies: {
88 | 'ember-source': '~5.8.0',
89 | },
90 | },
91 | },
92 | {
93 | name: 'ember-lts-5.12',
94 | npm: {
95 | devDependencies: {
96 | 'ember-source': '~5.12.0',
97 | },
98 | },
99 | },
100 | {
101 | name: 'ember-release',
102 | npm: {
103 | devDependencies: {
104 | 'ember-source': await getChannelURL('release'),
105 | 'ember-resolver': '^11.0.0',
106 | },
107 | },
108 | },
109 | {
110 | name: 'ember-beta',
111 | npm: {
112 | devDependencies: {
113 | 'ember-source': await getChannelURL('beta'),
114 | 'ember-resolver': '^11.0.0',
115 | },
116 | },
117 | },
118 | {
119 | name: 'ember-canary',
120 | npm: {
121 | devDependencies: {
122 | 'ember-source': await getChannelURL('canary'),
123 | 'ember-resolver': '^11.0.0',
124 | },
125 | },
126 | },
127 | embroiderSafe(),
128 | embroiderOptimized(),
129 | ],
130 | };
131 | };
132 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | - master
8 | pull_request: {}
9 |
10 | concurrency:
11 | group: ci-${{ github.head_ref || github.ref }}
12 | cancel-in-progress: true
13 |
14 | jobs:
15 | test:
16 | name: "Tests"
17 | runs-on: ubuntu-latest
18 | timeout-minutes: 10
19 |
20 | steps:
21 | - uses: actions/checkout@v4
22 | - uses: pnpm/action-setup@v4
23 | - uses: actions/setup-node@v4
24 | with:
25 | node-version: 20
26 | cache: pnpm
27 | - name: Install Dependencies
28 | run: pnpm install --frozen-lockfile
29 | - name: Lint
30 | run: pnpm lint
31 | - name: Run Tests
32 | run: pnpm test
33 |
34 | floating:
35 | name: "Floating Dependencies"
36 | runs-on: ubuntu-latest
37 | timeout-minutes: 10
38 |
39 | steps:
40 | - uses: actions/checkout@v4
41 | - uses: pnpm/action-setup@v4
42 | - uses: actions/setup-node@v4
43 | with:
44 | node-version: 20
45 | cache: pnpm
46 | - name: Install Dependencies
47 | run: pnpm install --no-lockfile
48 | - name: Run Tests
49 | run: pnpm test
50 |
51 | try-scenarios:
52 | name: ${{ matrix.try-scenario }}
53 | runs-on: ubuntu-latest
54 | needs: 'test'
55 | timeout-minutes: 10
56 |
57 | strategy:
58 | fail-fast: false
59 | matrix:
60 | try-scenario:
61 | - ember-lts-3.20
62 | - ember-lts-3.24
63 | - ember-lts-3.28
64 | - ember-lts-4.4
65 | - ember-lts-4.8
66 | - ember-lts-4.12
67 | - ember-lts-5.4
68 | - ember-lts-5.8
69 | - ember-lts-5.12
70 | - ember-release
71 | - ember-beta
72 | - ember-canary
73 | - embroider-safe
74 | - embroider-optimized
75 |
76 | steps:
77 | - uses: actions/checkout@v4
78 | - uses: pnpm/action-setup@v4
79 | - uses: actions/setup-node@v4
80 | with:
81 | node-version: 20
82 | cache: pnpm
83 | - name: Install Dependencies
84 | run: pnpm install --frozen-lockfile
85 |
86 | - run: |
87 | [[ "${{ matrix.try-scenario }}" = "ember-lts-3.20" ]] && pnpm add ember-modifier@3.0 || true
88 | working-directory: ember-click-outside-modifier
89 |
90 |
91 | - run: |
92 | [[ "${{ matrix.try-scenario }}" = "ember-lts-3.20" || "${{ matrix.try-scenario }}" = "ember-lts-3.24" ]] && pnpm remove ember-template-imports || true
93 | working-directory: test-app
94 |
95 | - name: Run Tests
96 | run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }} --skip-cleanup
97 | working-directory: test-app
98 |
99 | ember-modifier-scenarios:
100 | name: ${{ matrix.ember-modifier-scenario }}
101 | runs-on: ubuntu-latest
102 | timeout-minutes: 20
103 | needs: 'test'
104 |
105 | strategy:
106 | fail-fast: false
107 | matrix:
108 | ember-modifier-scenario:
109 | - ember-modifier@3.0
110 | - ember-modifier@^3.2
111 | - ember-modifier@^4.0.0
112 |
113 | steps:
114 | - uses: actions/checkout@v4
115 | - name: Install pnpm
116 | uses: pnpm/action-setup@v4
117 |
118 | - name: Install Node
119 | uses: actions/setup-node@v4
120 | with:
121 | node-version: 20.x
122 | cache: 'pnpm'
123 |
124 | - name: Install Dependencies
125 | run: pnpm install --frozen-lockfile
126 |
127 | - name: Update ember-modifier version in addon
128 | run: pnpm add ${{ matrix.ember-modifier-scenario }}
129 | working-directory: ember-click-outside-modifier
130 |
131 | - name: Update ember-modifier version in test-app
132 | run: pnpm add -D ${{ matrix.ember-modifier-scenario }}
133 | working-directory: test-app
134 |
135 | - name: Run Tests
136 | run: pnpm test:ember
137 | working-directory: test-app
138 |
--------------------------------------------------------------------------------
/test-app/tests/integration/modifiers/click-outside-test.js:
--------------------------------------------------------------------------------
1 | import { module, test } from 'qunit';
2 | import { setupRenderingTest } from 'ember-qunit';
3 | import { render, click, triggerEvent } from '@ember/test-helpers';
4 | import { hbs } from 'ember-cli-htmlbars';
5 |
6 | module('Integration | Modifier | click-outside', function (hooks) {
7 | setupRenderingTest(hooks);
8 |
9 | test('simple case', async function (assert) {
10 | let outsideClicked = false;
11 | this.set('onClickOutside', () => {
12 | outsideClicked = true;
13 | });
14 | await render(
15 | hbs``,
16 | );
17 | assert.ok(true);
18 | await click('.inside');
19 | assert.false(outsideClicked);
20 | await click('.outside');
21 | assert.true(outsideClicked);
22 | });
23 |
24 | test('nested case', async function (assert) {
25 | let outsideClicked = false;
26 | this.set('onClickOutside', () => {
27 | outsideClicked = true;
28 | });
29 | await render(
30 | hbs``,
31 | );
32 | assert.ok(true);
33 | await click('.inside');
34 | assert.false(outsideClicked);
35 | await click('.outside');
36 | assert.true(outsideClicked);
37 | });
38 |
39 | test('wrapped case', async function (assert) {
40 | let outsideClicked = false;
41 | this.set('onClickOutside', () => {
42 | outsideClicked = true;
43 | });
44 | await render(
45 | hbs``,
46 | );
47 | assert.ok(true);
48 | await click('.inside');
49 | assert.false(outsideClicked);
50 | await click('.outside');
51 | assert.true(outsideClicked);
52 | });
53 |
54 | test('it does not capture preceding events', async function (assert) {
55 | let outsideClicked = false;
56 | this.set('onClickOutside', () => {
57 | outsideClicked = true;
58 | });
59 | this.set('show', false);
60 | this.set('onClick', () => {
61 | this.set('show', true);
62 | });
63 | await render(
64 | hbs`
65 |
66 | {{#if this.show}}{{/if}}
67 | `,
68 | );
69 | assert.ok(true);
70 | await click('button');
71 | assert.false(outsideClicked);
72 | });
73 |
74 | module('configurable event bindings', function () {
75 | test('single event', async function (assert) {
76 | let outsideClicked = false;
77 | this.set('onClickOutside', () => {
78 | outsideClicked = true;
79 | });
80 | await render(
81 | hbs``,
82 | );
83 | assert.ok(true);
84 | await triggerEvent('.inside', 'mouseup');
85 | assert.false(outsideClicked);
86 | await triggerEvent('.outside', 'mouseup');
87 | assert.true(outsideClicked);
88 | });
89 |
90 | test('multiple events', async function (assert) {
91 | let outsideClicked = 0;
92 | this.set('onClickOutside', () => {
93 | outsideClicked++;
94 | });
95 | await render(
96 | hbs``,
97 | );
98 | assert.ok(true);
99 | await triggerEvent('.inside', 'mouseup');
100 | await triggerEvent('.inside', 'click');
101 | assert.strictEqual(outsideClicked, 0);
102 | await triggerEvent('.outside', 'mouseup');
103 | await triggerEvent('.outside', 'click');
104 | assert.strictEqual(outsideClicked, 2);
105 | });
106 | });
107 |
108 | test.skip('error case', async function (assert) {
109 | try {
110 | await render(
111 | hbs``,
112 | );
113 | } catch (e) {
114 | assert.equal(
115 | e.toString(),
116 | 'Error: {{click-outside}}: Binding value must be a function',
117 | );
118 | }
119 | });
120 | });
121 |
--------------------------------------------------------------------------------
/test-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-app",
3 | "version": "0.0.0",
4 | "private": true,
5 | "description": "Test app for ember-click-outside-modifier addon",
6 | "repository": {
7 | "type": "git",
8 | "url": "git@github.com:lifeart/ember-click-outside-modifier.git",
9 | "directory": "test-app"
10 | },
11 | "license": "MIT",
12 | "author": "Aleksandr Kanunnikov ",
13 | "directories": {
14 | "doc": "doc",
15 | "test": "tests"
16 | },
17 | "scripts": {
18 | "build": "ember build --environment=production",
19 | "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
20 | "lint:css": "stylelint \"**/*.css\"",
21 | "lint:css:fix": "concurrently \"pnpm:lint:css -- --fix\"",
22 | "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto",
23 | "lint:glint": "glint",
24 | "lint:hbs": "ember-template-lint .",
25 | "lint:hbs:fix": "ember-template-lint . --fix",
26 | "lint:js": "eslint . --cache",
27 | "lint:js:fix": "eslint . --fix",
28 | "lint:types": "tsc --noEmit",
29 | "start": "ember serve",
30 | "test": "concurrently \"pnpm:lint\" \"pnpm:test:*\" --names \"lint,test:\" --prefixColors auto",
31 | "test:ember": "ember test"
32 | },
33 | "devDependencies": {
34 | "@babel/core": "^7.26.7",
35 | "@babel/eslint-parser": "^7.26.5",
36 | "@babel/plugin-proposal-decorators": "^7.25.9",
37 | "@ember/optional-features": "^2.2.0",
38 | "@ember/test-helpers": "^3.2.0",
39 | "@embroider/test-setup": "^3.0.1",
40 | "@eslint/js": "^9.19.0",
41 | "@glimmer/component": "^1.1.2",
42 | "@glimmer/tracking": "^1.1.2",
43 | "@glint/core": "^1.5.2",
44 | "@glint/environment-ember-loose": "^1.5.2",
45 | "@glint/environment-ember-template-imports": "^1.5.2",
46 | "@glint/template": "^1.5.2",
47 | "@tsconfig/ember": "^3.0.9",
48 | "@types/eslint__js": "^8.42.3",
49 | "@types/ember": "^4.0.4",
50 | "@types/ember__application": "^4.0.6",
51 | "@types/ember__array": "^4.0.4",
52 | "@types/ember__component": "^4.0.14",
53 | "@types/ember__controller": "^4.0.5",
54 | "@types/ember__debug": "^4.0.4",
55 | "@types/ember__destroyable": "^4.0.2",
56 | "@types/ember__engine": "^4.0.5",
57 | "@types/ember__error": "^4.0.3",
58 | "@types/ember__helper": "^4.0.2",
59 | "@types/ember__modifier": "^4.0.5",
60 | "@types/ember__object": "^4.0.6",
61 | "@types/ember__owner": "^4.0.4",
62 | "@types/ember__polyfills": "^4.0.2",
63 | "@types/ember__routing": "^4.0.13",
64 | "@types/ember__runloop": "^4.0.3",
65 | "@types/ember__service": "^4.0.3",
66 | "@types/ember__string": "^3.0.11",
67 | "@types/ember__template": "^4.0.2",
68 | "@types/ember__test": "^4.0.2",
69 | "@types/ember__utils": "^4.0.3",
70 | "@types/qunit": "^2.19.12",
71 | "@types/rsvp": "^4.0.9",
72 | "broccoli-asset-rev": "^3.0.0",
73 | "concurrently": "^9.1.2",
74 | "ember-auto-import": "^2.10.0",
75 | "ember-cli": "~5.2.0",
76 | "ember-cli-app-version": "^7.0.0",
77 | "ember-cli-babel": "^8.2.0",
78 | "ember-cli-clean-css": "^3.0.0",
79 | "ember-cli-dependency-checker": "^3.3.3",
80 | "ember-cli-htmlbars": "^6.3.0",
81 | "ember-cli-inject-live-reload": "^2.1.0",
82 | "ember-cli-sri": "^2.1.1",
83 | "ember-cli-terser": "^4.0.2",
84 | "ember-click-outside-modifier": "workspace:*",
85 | "ember-load-initializers": "^3.0.1",
86 | "ember-page-title": "^8.2.3",
87 | "ember-qunit": "^7.0.0",
88 | "ember-resolver": "^11.0.0",
89 | "ember-source": "~5.4.0",
90 | "ember-source-channel-url": "^3.0.0",
91 | "ember-template-imports": "^4.3.0",
92 | "ember-template-lint": "^6.1.0",
93 | "ember-try": "^3.0.0",
94 | "eslint": "^9.19.0",
95 | "eslint-config-prettier": "^9.1.0",
96 | "eslint-plugin-ember": "^12.5.0",
97 | "eslint-plugin-n": "^17.15.1",
98 | "eslint-plugin-prettier": "^5.2.3",
99 | "eslint-plugin-qunit": "^8.1.2",
100 | "globals": "^15.14.0",
101 | "loader.js": "^4.7.0",
102 | "prettier": "^3.4.2",
103 | "prettier-plugin-ember-template-tag": "^2.0.4",
104 | "qunit": "^2.24.1",
105 | "qunit-dom": "^3.4.0",
106 | "stylelint": "^16.14.1",
107 | "stylelint-config-standard": "^36.0.1",
108 | "stylelint-prettier": "^5.0.3",
109 | "typescript": "^5.7.3",
110 | "typescript-eslint": "^8.23.0",
111 | "webpack": "^5.97.1"
112 | },
113 | "engines": {
114 | "node": ">= 18"
115 | },
116 | "ember": {
117 | "edition": "octane"
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 |
4 |
5 |
6 | ## v4.1.2 (2025-05-12)
7 |
8 | #### :bug: Bug Fix
9 | * [#47](https://github.com/lifeart/ember-click-outside-modifier/pull/47) Remove unneeded peer dependency declaration ([@SergeAstapov](https://github.com/SergeAstapov))
10 |
11 | #### Committers: 1
12 | - Sergey Astapov ([@SergeAstapov](https://github.com/SergeAstapov))
13 |
14 | ## v4.1.1 (2025-03-22)
15 |
16 | #### :bug: Bug Fix
17 | * [#45](https://github.com/lifeart/ember-click-outside-modifier/pull/45) Add types for package entrypoint ([@SergeAstapov](https://github.com/SergeAstapov))
18 |
19 | #### :house: Internal
20 | * [#44](https://github.com/lifeart/ember-click-outside-modifier/pull/44) run `npx ember-cli-update` to align with addon blueprint ([@SergeAstapov](https://github.com/SergeAstapov))
21 | * [#42](https://github.com/lifeart/ember-click-outside-modifier/pull/42) Switch from yarn to pnpm ([@SergeAstapov](https://github.com/SergeAstapov))
22 | * [#43](https://github.com/lifeart/ember-click-outside-modifier/pull/43) Bump release-it and plugins ([@SergeAstapov](https://github.com/SergeAstapov))
23 |
24 | #### Committers: 1
25 | - Sergey Astapov ([@SergeAstapov](https://github.com/SergeAstapov))
26 |
27 | ## v4.1.0 (2023-08-09)
28 |
29 | #### :rocket: Enhancement
30 | * [#38](https://github.com/lifeart/ember-click-outside-modifier/pull/38) Glint Support ([@SergeAstapov](https://github.com/SergeAstapov))
31 | * [#32](https://github.com/lifeart/ember-click-outside-modifier/pull/32) Winden ember-modifier version range to allow v4 ([@SergeAstapov](https://github.com/SergeAstapov))
32 | * [#33](https://github.com/lifeart/ember-click-outside-modifier/pull/33) Remove engines field from addon package.json ([@SergeAstapov](https://github.com/SergeAstapov))
33 | * [#24](https://github.com/lifeart/ember-click-outside-modifier/pull/24) auto-publish unstable packages to NPM ([@SergeAstapov](https://github.com/SergeAstapov))
34 |
35 | #### :memo: Documentation
36 | * [#23](https://github.com/lifeart/ember-click-outside-modifier/pull/23) Improve contributing docs ([@SergeAstapov](https://github.com/SergeAstapov))
37 |
38 | #### :house: Internal
39 | * [#37](https://github.com/lifeart/ember-click-outside-modifier/pull/37) replace publish-unstable with push-dist ([@SergeAstapov](https://github.com/SergeAstapov))
40 | * [#28](https://github.com/lifeart/ember-click-outside-modifier/pull/28) Add 4.4 and 4.8 LTS ember-try scenarios ([@SergeAstapov](https://github.com/SergeAstapov))
41 | * [#26](https://github.com/lifeart/ember-click-outside-modifier/pull/26) Rename addon folder to ember-click-outside-modifier ([@SergeAstapov](https://github.com/SergeAstapov))
42 | * [#25](https://github.com/lifeart/ember-click-outside-modifier/pull/25) Use release-it hook to copy .md files at publish time ([@SergeAstapov](https://github.com/SergeAstapov))
43 | * [#22](https://github.com/lifeart/ember-click-outside-modifier/pull/22) run `npx ember-cli-update --to=v4.3.0` to align with blueprint ([@SergeAstapov](https://github.com/SergeAstapov))
44 | * [#21](https://github.com/lifeart/ember-click-outside-modifier/pull/21) add `eslint-plugin-qunit` per latest blueprint ([@SergeAstapov](https://github.com/SergeAstapov))
45 |
46 | #### Committers: 1
47 | - Sergey Astapov ([@SergeAstapov](https://github.com/SergeAstapov))
48 |
49 | ## v4.0.0 (2022-04-08)
50 |
51 | #### :boom: Breaking Change
52 | * [#14](https://github.com/lifeart/ember-click-outside-modifier/pull/14) Convert to v2 addon ([@SergeAstapov](https://github.com/SergeAstapov))
53 | * [#15](https://github.com/lifeart/ember-click-outside-modifier/pull/15) Drop Node.js 12 support ([@SergeAstapov](https://github.com/SergeAstapov))
54 |
55 | #### :rocket: Enhancement
56 | * [#19](https://github.com/lifeart/ember-click-outside-modifier/pull/19) Prepare for ember-modifier v4 ([@SergeAstapov](https://github.com/SergeAstapov))
57 | * [#14](https://github.com/lifeart/ember-click-outside-modifier/pull/14) Convert to v2 addon ([@SergeAstapov](https://github.com/SergeAstapov))
58 |
59 | #### :memo: Documentation
60 | * [#18](https://github.com/lifeart/ember-click-outside-modifier/pull/18) move .md files to published package ([@SergeAstapov](https://github.com/SergeAstapov))
61 | * [#17](https://github.com/lifeart/ember-click-outside-modifier/pull/17) Add CHANGELOG.md ([@SergeAstapov](https://github.com/SergeAstapov))
62 |
63 | #### :house: Internal
64 | * [#16](https://github.com/lifeart/ember-click-outside-modifier/pull/16) Add release-it setup ([@SergeAstapov](https://github.com/SergeAstapov))
65 | * [#13](https://github.com/lifeart/ember-click-outside-modifier/pull/13) Convert to monorepo ([@SergeAstapov](https://github.com/SergeAstapov))
66 |
67 | #### Committers: 1
68 | - Sergey Astapov ([@SergeAstapov](https://github.com/SergeAstapov))
69 |
70 |
71 | ## v3.0.2 (2022-03-17)
72 |
73 | #### :rocket: Enhancement
74 | * [#10](https://github.com/lifeart/ember-click-outside-modifier/pull/10) Move `ember-cli-htmlbars` to `devDependencies` ([@SergeAstapov](https://github.com/SergeAstapov))
75 |
76 | #### Committers: 1
77 | - Sergey Astapov ([@SergeAstapov](https://github.com/SergeAstapov))
78 |
79 |
80 | ## v3.0.1 (2022-03-17)
81 |
82 | #### :house: Internal
83 | * [#11](https://github.com/lifeart/ember-click-outside-modifier/pull/11) Add `ember-auto-import` and `webpack` dev deps to fix CI ([@SergeAstapov](https://github.com/SergeAstapov))
84 |
85 | #### Committers: 1
86 | - Sergey Astapov ([@SergeAstapov](https://github.com/SergeAstapov))
87 |
88 |
89 | ## v3.0.0 (2021-12-11)
90 |
91 | #### :boom: Breaking Change
92 | * [#9](https://github.com/lifeart/ember-click-outside-modifier/pull/9) Update multiple dependencies and bump minimum node version ([@mayatron](https://github.com/mayatron))
93 |
94 | #### :bug: Bug Fix
95 | * [#8](https://github.com/lifeart/ember-click-outside-modifier/pull/8) Fix typo in package.json ([@mayatron](https://github.com/mayatron))
96 |
97 | #### Committers: 1
98 | - Jeremy M. Taylor ([@mayatron](https://github.com/mayatron))
99 |
100 |
101 | ## v2.0.1 (2021-11-09)
102 |
103 | #### :bug: Bug Fix
104 | * [#7](https://github.com/lifeart/ember-click-outside-modifier/pull/7) Reproduction for #6 ([@simonihmig](https://github.com/simonihmig))
105 |
106 | #### Committers: 1
107 | - Simon Ihmig ([@simonihmig](https://github.com/simonihmig))
108 |
109 |
110 | ## v2.0.0 (2021-06-08)
111 |
112 | #### :rocket: Enhancement
113 | * [#4](https://github.com/lifeart/ember-click-outside-modifier/pull/4) feat: allow user to pass events to bind to ([@alexlafroscia](https://github.com/alexlafroscia))
114 |
115 | #### :house: Internal
116 | * [#5](https://github.com/lifeart/ember-click-outside-modifier/pull/5) Addon upgrade ([@lifeart](https://github.com/lifeart))
117 |
118 | #### Committers: 2
119 | - Alex Kanunnikov ([@lifeart](https://github.com/lifeart))
120 | - Alex LaFroscia ([@alexlafroscia](https://github.com/alexlafroscia))
121 |
122 |
123 | ## v1.0.0 (2020-08-02)
124 |
125 | #### :rocket: Enhancement
126 | * [#2](https://github.com/lifeart/ember-click-outside-modifier/pull/2) Upgrade ember-modifier to v2 ([@SergeAstapov](https://github.com/SergeAstapov))
127 |
128 | #### :house: Internal
129 | * [#3](https://github.com/lifeart/ember-click-outside-modifier/pull/3) Addon version upgrade ([@lifeart](https://github.com/lifeart))
130 |
131 | #### Committers: 2
132 | - Alex Kanunnikov ([@lifeart](https://github.com/lifeart))
133 | - Sergey Astapov ([@SergeAstapov](https://github.com/SergeAstapov))
134 |
--------------------------------------------------------------------------------