ember-attacher 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <sourceFolder url="file://$MODULE_DIR$/addon" isTestSource="false" />
6
+ <sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" />
7
+ <sourceFolder url="file://$MODULE_DIR$/public" isTestSource="false" />
8
+ <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
9
+ <sourceFolder url="file://$MODULE_DIR$/test-app" isTestSource="true" />
10
+ <sourceFolder url="file://$MODULE_DIR$/test-app/app" isTestSource="true" />
11
+ <sourceFolder url="file://$MODULE_DIR$/test-app/tests/acceptance" isTestSource="true" />
12
+ <sourceFolder url="file://$MODULE_DIR$/test-app/tests/integration" isTestSource="true" />
13
+ <sourceFolder url="file://$MODULE_DIR$/test-app/tests/unit" isTestSource="true" />
14
+ <sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
15
+ <sourceFolder url="file://$MODULE_DIR$/tests/acceptance" isTestSource="true" />
16
+ <sourceFolder url="file://$MODULE_DIR$/tests/dummy/app" isTestSource="true" />
17
+ <sourceFolder url="file://$MODULE_DIR$/tests/integration" isTestSource="true" />
18
+ <sourceFolder url="file://$MODULE_DIR$/tests/unit" isTestSource="true" />
19
+ <excludeFolder url="file://$MODULE_DIR$/.bower_components.ember-try" />
20
+ <excludeFolder url="file://$MODULE_DIR$/.node_modules.ember-try" />
21
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
22
+ <excludeFolder url="file://$MODULE_DIR$/dist" />
23
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
24
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
25
+ </content>
26
+ <orderEntry type="inheritedJdk" />
27
+ <orderEntry type="sourceFolder" forTests="false" />
28
+ </component>
29
+ </module>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
+ </profile>
6
+ </component>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/ember-attacher.iml" filepath="$PROJECT_DIR$/.idea/ember-attacher.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
package/CHANGELOG.md CHANGED
@@ -1,4 +1,20 @@
1
1
 
2
+
3
+ ## v2.0.2 (2023-05-18)
4
+
5
+ #### :rocket: Enhancement
6
+ * [#790](https://github.com/tylerturdenpants/ember-attacher/pull/790) Bump ember-maybe-in-element to supress build-time warning ([@pzubar](https://github.com/pzubar))
7
+ * [#784](https://github.com/tylerturdenpants/ember-attacher/pull/784) Prevent overflow by default ([@pzubar](https://github.com/pzubar))
8
+
9
+ #### :bug: Bug Fix
10
+ * [#784](https://github.com/tylerturdenpants/ember-attacher/pull/784) Prevent overflow by default ([@pzubar](https://github.com/pzubar))
11
+
12
+ #### :house: Internal
13
+ * [#783](https://github.com/tylerturdenpants/ember-attacher/pull/783) Upgrade Ember to v4 ([@pzubar](https://github.com/pzubar))
14
+
15
+ #### Committers: 1
16
+ - Petro Zubar ([@pzubar](https://github.com/pzubar))
17
+
2
18
  ## v2.0.1 (2023-05-15)
3
19
 
4
20
  #### :boom: Breaking Change
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Download count all time](https://img.shields.io/npm/dt/ember-attacher.svg)](https://www.npmjs.com/package/ember-attacher)
5
5
  [![npm](https://img.shields.io/npm/dm/ember-attacher.svg)](https://www.npmjs.com/package/ember-attacher)
6
6
  [![Ember Observer Score](http://emberobserver.com/badges/ember-attacher.svg)](http://emberobserver.com/addons/ember-attacher)
7
- [![Build Status](https://travis-ci.org/kybishop/ember-attacher.svg?branch=master)](https://travis-ci.org/kybishop/ember-attacher)
7
+ [![GitHub CI](https://github.com/tylerturdenpants/ember-attacher/actions/workflows/ci.yml/badge.svg)](https://github.com/tylerturdenpants/ember-attacher/actions/workflows/ci.yml)
8
8
 
9
9
  ## Compatibility
10
10
 
@@ -178,7 +178,10 @@ Below is a list of all available options, along with their defaults.
178
178
  // than the bubbling phase. This should be set to true when there are elements on the page that
179
179
  // are stopping event propagation in the bubbling phase, and as a result preventing correct
180
180
  // showing and hiding of popovers and tooltips.
181
- useCapture: false
181
+ useCapture: false,
182
+
183
+ // The default padding if collision happens. Set "false" if no collision prevention needed
184
+ overflowPadding: 5
182
185
  }
183
186
  ```
184
187
 
@@ -7,7 +7,7 @@ import { htmlSafe, isHTMLSafe } from '@ember/template';
7
7
  import { stripInProduction } from 'ember-attacher/-debug/helpers';
8
8
  import { warn, assert } from '@ember/debug';
9
9
  import { isEmpty, typeOf } from '@ember/utils';
10
- import { autoUpdate, computePosition, arrow, flip } from '@floating-ui/dom';
10
+ import { autoUpdate, computePosition, arrow, flip, limitShift, shift } from '@floating-ui/dom';
11
11
  import { buildWaiter } from '@ember/test-waiters';
12
12
  import { tracked } from '@glimmer/tracking';
13
13
  import DEFAULTS from '../defaults';
@@ -62,7 +62,7 @@ export default class AttachPopover extends Component {
62
62
  }
63
63
 
64
64
  get isOffset() {
65
- return this.args.isOffset ?? this._config.isOffset ?? DEFAULTS.interactive;
65
+ return this.args.isOffset ?? this._config.isOffset ?? DEFAULTS.isOffset;
66
66
  }
67
67
 
68
68
  get isShown() {
@@ -129,6 +129,10 @@ export default class AttachPopover extends Component {
129
129
  return this.args.id || `${guidFor(this)}-floating`;
130
130
  }
131
131
 
132
+ get overflowPadding() {
133
+ return this.args.overflowPadding ?? this._config.overflowPadding ?? DEFAULTS.overflowPadding;
134
+ }
135
+
132
136
  // The circle element needs a special duration that is slightly faster than the floating element's
133
137
  // transition, this prevents text from appearing outside the circle as it fills the background
134
138
  get _circleTransitionDuration() {
@@ -180,12 +184,7 @@ export default class AttachPopover extends Component {
180
184
 
181
185
  get _middleware() {
182
186
  // Copy the middleware since we might write to the provided array
183
- const middleware
184
- = this.args.middleware ? [...this.args.middleware] : [];
185
-
186
- if (this.arrow && this._arrowElement && !middleware.find(name => name === 'arrow')) {
187
- middleware.push(arrow({ element: this._arrowElement }));
188
- }
187
+ const middleware = this.args.middleware ? [...this.args.middleware] : [];
189
188
 
190
189
  const flipString = this.flip;
191
190
  if (flipString) {
@@ -196,6 +195,16 @@ export default class AttachPopover extends Component {
196
195
  } else if (!flipMiddleware.fallbackPlacements) {
197
196
  Object.assign({}, flipMiddleware, flipOptions);
198
197
  }
198
+ } else if (this.overflowPadding !== false) {
199
+ middleware.push(flip());
200
+ }
201
+
202
+ if (this.overflowPadding !== false && !middleware.find(name => name === 'shift')) {
203
+ middleware.push(shift({ limiter: limitShift(), padding: this.overflowPadding }))
204
+ }
205
+
206
+ if (this.arrow && this._arrowElement && !middleware.find(name => name === 'arrow')) {
207
+ middleware.push(arrow({ element: this._arrowElement }));
199
208
  }
200
209
 
201
210
  return middleware;
package/addon/defaults.js CHANGED
@@ -20,5 +20,6 @@ export default {
20
20
  showOn: 'mouseenter focus',
21
21
  style: null,
22
22
  tooltipClass: 'ember-attacher-floating ember-attacher-tooltip',
23
- useCapture: false
23
+ useCapture: false,
24
+ overflowPadding: 5
24
25
  };
@@ -2,8 +2,8 @@
2
2
  <meta hidden {{did-insert this.onParentFinderInsert}} {{did-update this.onIsShownChange this.isShown}}/>
3
3
  {{~/unless~}}
4
4
 
5
- {{~#if this.renderFloatingElement}}
6
- {{~#maybe-in-element destinationElement=this._floatingElementContainer renderInPlace=@renderInPlace}}
5
+ {{~#if this.renderFloatingElement~}}
6
+ <MaybeInElement @destinationElement={{this._floatingElementContainer}} @renderInPlace={{@renderInPlace}}>
7
7
  <div
8
8
  class="ember-attacher"
9
9
  id={{this.id}}
@@ -25,5 +25,5 @@
25
25
  {{/if}}
26
26
  </div>
27
27
  </div>
28
- {{~/maybe-in-element}}
28
+ </MaybeInElement>
29
29
  {{~/if~}}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "ember-attacher",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Tooltips and popovers for Ember.js apps",
5
5
  "keywords": [
6
6
  "ember-addon",
7
7
  "tooltips",
8
8
  "popovers"
9
9
  ],
10
- "repository": "https://github.com/kybishop/ember-attacher",
10
+ "repository": "https://github.com/tylerturdenpants/ember-attacher",
11
11
  "license": "MIT",
12
12
  "author": {
13
13
  "name": "Kyle Bishop",
@@ -33,10 +33,11 @@
33
33
  "babel-plugin-filter-imports": "^4.0.0",
34
34
  "broccoli-funnel": "~3.0.8",
35
35
  "ember-auto-import": "~2.6.3",
36
- "ember-cli-babel": "^7.26.10",
36
+ "ember-cli-babel": "^7.26.11",
37
37
  "ember-cli-htmlbars": "~6.2.0",
38
38
  "ember-cli-sass": "~11.0.1",
39
39
  "ember-in-element-polyfill": "~1.0.1",
40
+ "ember-maybe-in-element": "2.0.3",
40
41
  "sass": "^1.62.1"
41
42
  },
42
43
  "devDependencies": {
@@ -47,25 +48,22 @@
47
48
  "@ember/string": "^3.0.1",
48
49
  "@ember/test-helpers": "~2.9.3",
49
50
  "@ember/test-waiters": "^3.0.2",
50
- "@glimmer/component": "^1.0.0",
51
- "@glimmer/tracking": "^1.0.0",
51
+ "@embroider/test-setup": "^2.1.1",
52
+ "@glimmer/component": "^1.1.2",
53
+ "@glimmer/tracking": "^1.1.2",
52
54
  "@html-next/flexi-default-styles": "^2.2.0",
53
55
  "@release-it-plugins/lerna-changelog": "^5.0.0",
54
56
  "broccoli-asset-rev": "^3.0.0",
55
- "ember-cli": "~3.28.5",
57
+ "ember-cli": "~4.12.1",
56
58
  "ember-cli-dependency-checker": "~3.3.1",
57
59
  "ember-cli-github-pages": "^0.2.2",
58
- "ember-cli-inject-live-reload": "^2.0.2",
60
+ "ember-cli-inject-live-reload": "~2.1.0",
59
61
  "ember-cli-sri": "^2.1.1",
60
62
  "ember-cli-terser": "^4.0.2",
61
- "ember-disable-prototype-extensions": "^1.1.3",
62
- "ember-export-application-global": "^2.0.1",
63
63
  "ember-load-initializers": "^2.1.2",
64
- "ember-maybe-import-regenerator": "^1.0.0",
65
- "ember-maybe-in-element": "^2.1.0",
66
64
  "ember-qunit": "^6.2.0",
67
65
  "ember-resolver": "~10.0.0",
68
- "ember-source": "~3.28.11",
66
+ "ember-source": "~4.12.0",
69
67
  "ember-source-channel-url": "^3.0.0",
70
68
  "ember-svg-jar": "~2.4.2",
71
69
  "ember-truth-helpers": "^3.1.1",
@@ -73,7 +71,7 @@
73
71
  "eslint": "~8.40.0",
74
72
  "eslint-plugin-decorator-position": "^5.0.2",
75
73
  "eslint-plugin-ember": "~11.5.2",
76
- "eslint-plugin-node": "^11.1.0",
74
+ "eslint-plugin-n": "^15.7.0",
77
75
  "flexi": "^2.1.0",
78
76
  "loader.js": "^4.7.0",
79
77
  "qunit": "~2.19.4",
@@ -85,7 +83,7 @@
85
83
  "ember-in-element-polyfill": "^1.0.1"
86
84
  },
87
85
  "engines": {
88
- "node": ">= 12.*"
86
+ "node": "14.* || 16.* || >= 18"
89
87
  },
90
88
  "ember": {
91
89
  "edition": "octane"
@@ -1,3 +0,0 @@
1
- Thank you for taking the time to open an issue!
2
-
3
- For non-obvious bugs, please alter [this twiddle](https://ember-twiddle.com/26aef5ea692f75105cfda90949dd3f7d?openFiles=templates.application.hbs%2C) to reproduce the issue, then include a link.
@@ -1,71 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: npm
4
- directory: "/"
5
- schedule:
6
- interval: daily
7
- time: "10:00"
8
- open-pull-requests-limit: 10
9
- versioning-strategy: increase
10
- ignore:
11
- - dependency-name: sass
12
- versions:
13
- - 1.32.10
14
- - 1.32.11
15
- - 1.32.7
16
- - 1.32.8
17
- - dependency-name: eslint-plugin-ember
18
- versions:
19
- - 10.1.2
20
- - 10.2.0
21
- - 10.3.0
22
- - 10.4.1
23
- - dependency-name: ember-cli
24
- versions:
25
- - 3.25.0
26
- - 3.25.1
27
- - 3.25.2
28
- - 3.25.3
29
- - 3.26.0
30
- - dependency-name: eslint
31
- versions:
32
- - 7.20.0
33
- - 7.21.0
34
- - 7.22.0
35
- - 7.23.0
36
- - 7.24.0
37
- - dependency-name: release-it
38
- versions:
39
- - 14.4.0
40
- - 14.4.1
41
- - 14.5.0
42
- - 14.5.1
43
- - 14.6.0
44
- - dependency-name: y18n
45
- versions:
46
- - 4.0.1
47
- - 4.0.2
48
- - dependency-name: ember-cli-babel
49
- versions:
50
- - 7.25.0
51
- - 7.26.1
52
- - 7.26.2
53
- - 7.26.3
54
- - dependency-name: ember-source
55
- versions:
56
- - 3.25.0
57
- - 3.25.1
58
- - 3.25.3
59
- - 3.26.0
60
- - dependency-name: ember-cli-htmlbars
61
- versions:
62
- - 5.3.2
63
- - 5.4.0
64
- - 5.6.0
65
- - 5.6.2
66
- - 5.6.3
67
- - 5.6.4
68
- - 5.6.5
69
- - 5.7.0
70
- commit-message:
71
- prefix: "[chore]"
@@ -1,221 +0,0 @@
1
- # This file was autogenerated by create-github-actions-setup-for-ember-addons.
2
- #
3
- # You can upgrade the GitHub Actions workflow to the latest blueprints used
4
- # by Create GitHub Actions setup for Ember Addons by running it again:
5
- #
6
- # - `yarn create github-actions-setup-for-ember-addons` if using yarn and
7
- # - `npm init github-actions-setup-for-ember-addons` if using NPM.
8
- #
9
- # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for
10
- # details.
11
- #
12
- # The following lines contain the configuration used in the last run. Please do
13
- # not change them. Doing so could break upgrade flow.
14
- #
15
- #$ browsers:
16
- #$ - Chrome
17
- #$ emberTryScenarios:
18
- #$ - scenario: ember-lts-3.12
19
- #$ - scenario: ember-lts-3.16
20
- #$ - scenario: ember-lts-3.20
21
- #$ - scenario: ember-release
22
- #$ - scenario: ember-beta
23
- #$ - scenario: ember-canary
24
- #$ allowedToFail: true
25
- #$ - scenario: ember-default
26
- #$ - scenario: ember-default-with-jquery
27
- #$ nodeVersion: '10'
28
- #$ packageManager: yarn
29
- #
30
-
31
- name: CI
32
-
33
- on:
34
- push:
35
- branches:
36
- - master
37
- pull_request:
38
-
39
- env:
40
- NODE_VERSION: '14'
41
-
42
- jobs:
43
- lint:
44
- name: Lint
45
- runs-on: ubuntu-latest
46
- steps:
47
- - uses: actions/checkout@v2
48
- with:
49
- fetch-depth: 1
50
-
51
- - uses: actions/setup-node@v2-beta
52
- with:
53
- node-version: '${{ env.NODE_VERSION }}'
54
-
55
- - name: Get package manager's global cache path
56
- id: global-cache-dir-path
57
- run: echo "::set-output name=dir::$(yarn cache dir)"
58
-
59
- - name: Cache package manager's global cache and node_modules
60
- id: cache-dependencies
61
- uses: actions/cache@v2
62
- with:
63
- path: |
64
- ${{ steps.global-cache-dir-path.outputs.dir }}
65
- node_modules
66
- key: ${{ runner.os }}-${{ matrix.node-version }}-${{
67
- hashFiles('**/yarn.lock'
68
- ) }}
69
- restore-keys: |
70
- ${{ runner.os }}-${{ matrix.node-version }}-
71
-
72
- - name: Install Dependencies
73
- run: yarn install --frozen-lockfile
74
- if: |
75
- steps.cache-dependencies.outputs.cache-hit != 'true'
76
-
77
- - name: Lint
78
- run: yarn lint
79
-
80
-
81
- test:
82
- name: Tests
83
- runs-on: ${{ matrix.os }}
84
- needs: lint
85
-
86
- strategy:
87
- matrix:
88
- os: [ubuntu-latest]
89
- browser: [Chrome]
90
-
91
- steps:
92
- - uses: actions/checkout@v2
93
- with:
94
- fetch-depth: 1
95
-
96
- - uses: actions/setup-node@v2-beta
97
- with:
98
- node-version: '${{ env.NODE_VERSION }}'
99
-
100
- - name: Get package manager's global cache path
101
- id: global-cache-dir-path
102
- run: echo "::set-output name=dir::$(yarn cache dir)"
103
-
104
- - name: Cache package manager's global cache and node_modules
105
- id: cache-dependencies
106
- uses: actions/cache@v2
107
- with:
108
- path: |
109
- ${{ steps.global-cache-dir-path.outputs.dir }}
110
- node_modules
111
- key: ${{ runner.os }}-${{ matrix.node-version }}-${{
112
- hashFiles('**/yarn.lock'
113
- ) }}
114
- restore-keys: |
115
- ${{ runner.os }}-${{ matrix.node-version }}-
116
-
117
- - name: Install Dependencies
118
- run: yarn install --frozen-lockfile
119
- if: |
120
- steps.cache-dependencies.outputs.cache-hit != 'true'
121
-
122
- - name: Test
123
- run: yarn test --launch ${{ matrix.browser }}
124
- timeout-minutes: 5
125
-
126
-
127
- floating-dependencies:
128
- name: Floating Dependencies
129
- runs-on: ${{ matrix.os }}
130
- needs: lint
131
-
132
- strategy:
133
- matrix:
134
- os: [ubuntu-latest]
135
- browser: [Chrome]
136
-
137
- steps:
138
- - uses: actions/checkout@v2
139
- with:
140
- fetch-depth: 1
141
-
142
- - uses: actions/setup-node@v2-beta
143
- with:
144
- node-version: '${{ env.NODE_VERSION }}'
145
-
146
- - name: Get package manager's global cache path
147
- id: global-cache-dir-path
148
- run: echo "::set-output name=dir::$(yarn cache dir)"
149
-
150
- - name: Cache package manager's global cache and node_modules
151
- id: cache-dependencies
152
- uses: actions/cache@v2
153
- with:
154
- path: |
155
- ${{ steps.global-cache-dir-path.outputs.dir }}
156
- node_modules
157
- key: ${{ runner.os }}-${{ matrix.node-version }}-floating-deps
158
- restore-keys: |
159
- ${{ runner.os }}-${{ matrix.node-version }}-
160
-
161
- - name: Install Dependencies
162
- run: yarn install --no-lockfile --non-interactive
163
-
164
- - name: Test
165
- run: yarn test --launch ${{ matrix.browser }}
166
- timeout-minutes: 5
167
-
168
-
169
- try-scenarios:
170
- name: Tests - ${{ matrix.ember-try-scenario }}
171
- runs-on: ubuntu-latest
172
- continue-on-error: true
173
- needs: test
174
-
175
- strategy:
176
- fail-fast: true
177
- matrix:
178
- ember-try-scenario: [
179
- ember-lts-3.16,
180
- ember-lts-3.20,
181
- ember-lts-3.26,
182
- ember-release,
183
- ember-default,
184
- ember-default-with-jquery
185
- ]
186
-
187
- steps:
188
- - uses: actions/checkout@v2
189
- with:
190
- fetch-depth: 1
191
-
192
- - uses: actions/setup-node@v2-beta
193
- with:
194
- node-version: '${{ env.NODE_VERSION }}'
195
-
196
- - name: Get package manager's global cache path
197
- id: global-cache-dir-path
198
- run: echo "::set-output name=dir::$(yarn cache dir)"
199
-
200
- - name: Cache package manager's global cache and node_modules
201
- id: cache-dependencies
202
- uses: actions/cache@v2
203
- with:
204
- path: |
205
- ${{ steps.global-cache-dir-path.outputs.dir }}
206
- node_modules
207
- key: ${{ runner.os }}-${{ matrix.node-version }}-${{
208
- hashFiles('**/yarn.lock'
209
- ) }}
210
- restore-keys: |
211
- ${{ runner.os }}-${{ matrix.node-version }}-
212
-
213
- - name: Install Dependencies
214
- run: yarn install --frozen-lockfile
215
- if: |
216
- steps.cache-dependencies.outputs.cache-hit != 'true'
217
-
218
- - name: Test
219
- env:
220
- EMBER_TRY_SCENARIO: ${{ matrix.ember-try-scenario }}
221
- run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
-
5
- };
@@ -1,6 +0,0 @@
1
- /* eslint-env node */
2
- 'use strict';
3
-
4
- module.exports = function(/* environment, appConfig */) {
5
- return { };
6
- };