ember-attacher 2.0.8 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
 
2
2
 
3
+
4
+
5
+ ## v3.1.0 (2024-03-07)
6
+
7
+ #### :boom: Breaking Change
8
+ * [#843](https://github.com/tylerturdenpants/ember-attacher/pull/843) Drop ember-in-element-polyfill from dependencies ([@pzubar](https://github.com/pzubar))
9
+
10
+ #### :rocket: Enhancement
11
+ * [#887](https://github.com/tylerturdenpants/ember-attacher/pull/887) [chore]: Bump ember-cli-babel from 7.26.11 to 8.2.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
12
+ * [#820](https://github.com/tylerturdenpants/ember-attacher/pull/820) Fix the "cancelAnimationFrame is not defined" error in fastboot ([@pzubar](https://github.com/pzubar))
13
+ * [#790](https://github.com/tylerturdenpants/ember-attacher/pull/790) Bump ember-maybe-in-element to supress build-time warning ([@pzubar](https://github.com/pzubar))
14
+ * [#784](https://github.com/tylerturdenpants/ember-attacher/pull/784) Prevent overflow by default ([@pzubar](https://github.com/pzubar))
15
+
16
+ #### :bug: Bug Fix
17
+ * [#820](https://github.com/tylerturdenpants/ember-attacher/pull/820) Fix the "cancelAnimationFrame is not defined" error in fastboot ([@pzubar](https://github.com/pzubar))
18
+ * [#807](https://github.com/tylerturdenpants/ember-attacher/pull/807) Fix the stripInProduction for the apps and the runtime error ([@pzubar](https://github.com/pzubar))
19
+ * [#794](https://github.com/tylerturdenpants/ember-attacher/pull/794) Fix test error caused by wrong endAsync call ([@pzubar](https://github.com/pzubar))
20
+ * [#784](https://github.com/tylerturdenpants/ember-attacher/pull/784) Prevent overflow by default ([@pzubar](https://github.com/pzubar))
21
+
22
+ #### :house: Internal
23
+ * [#867](https://github.com/tylerturdenpants/ember-attacher/pull/867) [chore]: Bump ember-truth-helpers from 3.1.1 to 4.0.3 ([@dependabot[bot]](https://github.com/apps/dependabot))
24
+ * [#928](https://github.com/tylerturdenpants/ember-attacher/pull/928) [chore]: Bump ip from 1.1.8 to 1.1.9 ([@dependabot[bot]](https://github.com/apps/dependabot))
25
+ * [#827](https://github.com/tylerturdenpants/ember-attacher/pull/827) [chore]: Bump @ember/test-helpers from 2.9.3 to 2.9.4 ([@dependabot[bot]](https://github.com/apps/dependabot))
26
+ * [#786](https://github.com/tylerturdenpants/ember-attacher/pull/786) [chore]: Bump @ember/string from 3.0.1 to 3.1.1 ([@dependabot[bot]](https://github.com/apps/dependabot))
27
+ * [#833](https://github.com/tylerturdenpants/ember-attacher/pull/833) [chore]: Bump ember-source from 4.12.0 to 4.12.3 ([@dependabot[bot]](https://github.com/apps/dependabot))
28
+ * [#834](https://github.com/tylerturdenpants/ember-attacher/pull/834) [chore]: Bump eslint-plugin-ember from 11.5.2 to 11.10.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
29
+ * [#835](https://github.com/tylerturdenpants/ember-attacher/pull/835) [chore]: Bump semver from 5.7.1 to 5.7.2 ([@dependabot[bot]](https://github.com/apps/dependabot))
30
+ * [#819](https://github.com/tylerturdenpants/ember-attacher/pull/819) [chore]: Bump eslint from 8.40.0 to 8.43.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
31
+ * [#811](https://github.com/tylerturdenpants/ember-attacher/pull/811) Remove the "beyond ember 3.24" support note ([@pzubar](https://github.com/pzubar))
32
+ * [#783](https://github.com/tylerturdenpants/ember-attacher/pull/783) Upgrade Ember to v4 ([@pzubar](https://github.com/pzubar))
33
+
34
+ #### Committers: 1
35
+ - Petro Zubar ([@pzubar](https://github.com/pzubar))
36
+
37
+ ## v3.0.0 (2024-03-06)
38
+
39
+ #### :boom: Breaking Change
40
+ * [#843](https://github.com/tylerturdenpants/ember-attacher/pull/843) Drop ember-in-element-polyfill from dependencies ([@pzubar](https://github.com/pzubar))
41
+
42
+ #### Committers: 1
43
+ - Petro Zubar ([@pzubar](https://github.com/pzubar))
44
+
3
45
  ## v2.0.8 (2024-01-16)
4
46
 
5
47
  #### :rocket: Enhancement
@@ -669,4 +711,4 @@
669
711
 
670
712
 
671
713
 
672
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
714
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  ----
20
20
 
21
- * Ember.js v3.16 or above
21
+ * Ember.js v3.20 or above
22
22
  * Ember CLI v3.13 or above
23
23
  * Node.js v12 or above
24
24
 
@@ -1,6 +1,6 @@
1
1
  import { action } from '@ember/object';
2
2
  import Component from '@glimmer/component';
3
- import { cancel, debounce, later, next, run } from '@ember/runloop';
3
+ import { cancel, debounce, later, next, run, once } from '@ember/runloop';
4
4
  import { getOwner } from '@ember/application';
5
5
  import { guidFor } from '@ember/object/internals';
6
6
  import { htmlSafe, isHTMLSafe } from '@ember/template';
@@ -10,6 +10,7 @@ import { isEmpty, typeOf } from '@ember/utils';
10
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
+ import { modifier } from 'ember-modifier';
13
14
  import DEFAULTS from '../defaults';
14
15
 
15
16
  const animationTestWaiter = buildWaiter('attach-popover');
@@ -293,20 +294,18 @@ export default class AttachPopover extends Component {
293
294
  this._hide();
294
295
  }
295
296
 
296
- @action
297
- onParentFinderInsert(element) {
297
+ onParentFinderInsert = modifier((element) => {
298
298
  this.parentElement = element.parentElement;
299
- this._initializeAttacher();
300
- }
299
+ once(this, '_initializeAttacher')
300
+ });
301
301
 
302
- @action
303
- _ensureArgumentsAreValid() {
302
+ _ensureArgumentsAreValid([arrow, useCapture]) {
304
303
  stripInProduction(() => {
305
- if (this.arrow && this.isFillAnimation) {
304
+ if (arrow && this.isFillAnimation) {
306
305
  warn('Animation: \'fill\' is not compatible with arrow: true', { id: 70015 });
307
306
  }
308
307
 
309
- if (this.useCapture !== this._lastUseCaptureArgumentValue) {
308
+ if (useCapture !== this._lastUseCaptureArgumentValue) {
310
309
  warn(
311
310
  'The value of the useCapture argument was mutated',
312
311
  { id: 'ember-attacher.use-capture-mutated' }
@@ -403,15 +402,11 @@ export default class AttachPopover extends Component {
403
402
  });
404
403
  }
405
404
 
406
- @action
407
- onTargetOrTriggerChange() {
408
- this._initializeAttacher();
409
- }
410
-
411
- @action
412
- onIsShownChange() {
413
- const isShown = this.isShown;
405
+ onTargetOrTriggerChange = modifier((_, _positional) => {
406
+ once(this, '_initializeAttacher', ..._positional);
407
+ });
414
408
 
409
+ onIsShownChange = modifier((_, [isShown]) => {
415
410
  if (isShown === true && this._isHidden) {
416
411
  this._show();
417
412
 
@@ -421,7 +416,18 @@ export default class AttachPopover extends Component {
421
416
  } else if (isShown === false && !this._isHidden) {
422
417
  this._hide();
423
418
  }
424
- }
419
+ });
420
+
421
+ initializeAttacher = modifier((floatingElement) => {
422
+ this._floatingElement = floatingElement;
423
+
424
+ if (this.renderInPlace) {
425
+ this.parentElement = floatingElement.parentElement;
426
+ once(this, '_initializeAttacher');
427
+ }
428
+
429
+ return () => this._cleanup?.();
430
+ });
425
431
 
426
432
  /**
427
433
  * ================== SHOW ATTACHMENT LOGIC ==================
@@ -768,31 +774,14 @@ export default class AttachPopover extends Component {
768
774
  });
769
775
  }
770
776
 
771
- @action
772
- didInsertFloatingElement(floatingElement) {
773
- this._floatingElement = floatingElement;
774
-
775
- if (this.renderInPlace) {
776
- this.parentElement = floatingElement.parentElement;
777
- this._initializeAttacher();
778
- }
779
- }
780
-
781
- @action
782
- didInsertArrow(element) {
777
+ didInsertArrow = modifier((element) => {
783
778
  this._arrowElement = element;
784
- }
785
-
786
- @action
787
- onOptionsChange() {
788
- this._ensureArgumentsAreValid();
789
- this._update();
790
- }
779
+ })
791
780
 
792
- @action
793
- willDestroyFloatingElement() {
794
- this._cleanup?.();
795
- }
781
+ onOptionsChange = modifier((_, positional) => {
782
+ this._ensureArgumentsAreValid(positional);
783
+ once(this, '_update')
784
+ })
796
785
 
797
786
  _update() {
798
787
  this._cleanup?.();
@@ -1,5 +1,5 @@
1
1
  {{~#unless this.renderFloatingElement}}
2
- <meta hidden {{did-insert this.onParentFinderInsert}} {{did-update this.onIsShownChange this.isShown}}/>
2
+ <meta hidden {{this.onParentFinderInsert}} {{this.onIsShownChange this.isShown}}/>
3
3
  {{~/unless~}}
4
4
 
5
5
  {{~#if this.renderFloatingElement~}}
@@ -8,17 +8,16 @@
8
8
  class="ember-attacher"
9
9
  id={{this.id}}
10
10
  role={{this.ariaRole}}
11
- {{did-insert this.didInsertFloatingElement}}
12
- {{did-update this.onIsShownChange this.isShown}}
13
- {{did-update this.onTargetOrTriggerChange this.hideOn this.showOn @explicitTarget}}
14
- {{did-update this.onOptionsChange this.autoUpdate this.animation this.arrow this.useCapture this.placement this._renderInPlace this._currentTarget this._middleware}}
15
- {{will-destroy this.willDestroyFloatingElement}}
11
+ {{this.onIsShownChange this.isShown}}
12
+ {{this.onTargetOrTriggerChange this.hideOn this.showOn @explicitTarget}}
13
+ {{this.onOptionsChange this.arrow this.useCapture this.autoUpdate this.animation this.placement this._renderInPlace this._currentTarget this._middleware}}
14
+ {{this.initializeAttacher}}
16
15
  ...attributes
17
16
  >
18
17
  <div class={{this._class}} style={{this._style}}>
19
- {{yield (hash hide=(action 'hide'))}}
18
+ {{yield (hash hide=this.hide)}}
20
19
  {{#if this.arrow}}
21
- <div x-arrow {{did-insert this.didInsertArrow}}></div>
20
+ <div x-arrow {{this.didInsertArrow}}></div>
22
21
  {{/if}}
23
22
  {{#if this.isFillAnimation}}
24
23
  <div x-circle style="{{this._circleTransitionDuration}}"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-attacher",
3
- "version": "2.0.8",
3
+ "version": "3.1.0",
4
4
  "description": "Tooltips and popovers for Ember.js apps",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -29,32 +29,31 @@
29
29
  "test:all": "ember try:each"
30
30
  },
31
31
  "dependencies": {
32
- "@floating-ui/dom": "^1.5.4",
32
+ "@floating-ui/dom": "^1.6.3",
33
33
  "babel-plugin-filter-imports": "^4.0.0",
34
34
  "broccoli-funnel": "~3.0.8",
35
- "ember-auto-import": "^2.7.0",
36
- "ember-cli-babel": "^7.26.11",
35
+ "ember-auto-import": "^2.7.2",
36
+ "ember-cli-babel": "^8.2.0",
37
37
  "ember-cli-htmlbars": "^6.3.0",
38
38
  "ember-cli-sass": "^11.0.1",
39
- "ember-in-element-polyfill": "~1.0.1",
40
- "ember-maybe-in-element": "2.0.3",
41
- "sass": "^1.69.5"
39
+ "ember-maybe-in-element": "^2.1.0",
40
+ "ember-modifier": "^4.1.0",
41
+ "sass": "^1.71.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@babel/core": "^7.23.7",
45
- "@babel/eslint-parser": "^7.22.15",
45
+ "@babel/eslint-parser": "^7.23.10",
46
46
  "@babel/helper-get-function-arity": "^7.16.7",
47
47
  "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
48
48
  "@ember/optional-features": "^2.0.0",
49
- "@ember/render-modifiers": "^2.0.5",
50
49
  "@ember/string": "^3.1.1",
51
50
  "@ember/test-helpers": "~2.9.4",
52
51
  "@ember/test-waiters": "^3.1.0",
53
- "@embroider/test-setup": "^2.1.1",
52
+ "@embroider/test-setup": "^3.0.0",
54
53
  "@glimmer/component": "^1.1.2",
55
54
  "@glimmer/tracking": "^1.1.2",
56
55
  "@html-next/flexi-default-styles": "^2.2.0",
57
- "@release-it-plugins/lerna-changelog": "^5.0.0",
56
+ "@release-it-plugins/lerna-changelog": "^6.1.0",
58
57
  "babel-plugin-dynamic-import-node": "^2.3.3",
59
58
  "broccoli-asset-rev": "^3.0.0",
60
59
  "ember-cli": "~4.12.1",
@@ -69,7 +68,7 @@
69
68
  "ember-source": "~4.12.3",
70
69
  "ember-source-channel-url": "^3.0.0",
71
70
  "ember-svg-jar": "~2.4.7",
72
- "ember-truth-helpers": "^3.1.1",
71
+ "ember-truth-helpers": "^4.0.3",
73
72
  "ember-try": "~3.0.0",
74
73
  "eslint": "~8.55.0",
75
74
  "eslint-plugin-decorator-position": "^5.0.2",
@@ -82,9 +81,6 @@
82
81
  "release-it": "~15.11.0",
83
82
  "webpack": "~5.89.0"
84
83
  },
85
- "resolutions": {
86
- "ember-in-element-polyfill": "^1.0.1"
87
- },
88
84
  "engines": {
89
85
  "node": "16.* || >= 18"
90
86
  },