Skip to content

Commit 9d01e3d

Browse files
m3l1xArtyom Melichowkevinhinterlong
authored
feat: bump gridstack to 7.2.2 (#109)
* feat: bump gridstack to 7.2.2 * refactor: cleanup removeWidget method * docs: update changelog --------- Co-authored-by: Artyom Melichow <[email protected]> Co-authored-by: Kevin Hinterlong <[email protected]>
1 parent 03eeab5 commit 9d01e3d

File tree

5 files changed

+45
-44
lines changed

5 files changed

+45
-44
lines changed

CHANGELOG.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,42 @@
11
# Changelog
22

3-
## 3.0.0
3+
## [3.2.0](https://github.com/yahoo/ember-gridstack/compare/v3.1.1...v3.2.0) (2023-02-06)
4+
5+
### Features
6+
7+
- update to gridstack v7
8+
9+
## [3.1.1](https://github.com/yahoo/ember-gridstack/compare/v3.1.0...v3.1.1) (2022-05-25)
10+
11+
### Bug Fixes
12+
13+
- don't trigger events due to teardown ([#98](https://github.com/yahoo/ember-gridstack/issues/98)) ([7743acf](https://github.com/yahoo/ember-gridstack/commit/7743acf900e433f2f74507e527aa41b46b8692c7))
14+
15+
# [3.1.0](https://github.com/yahoo/ember-gridstack/compare/v3.0.2...v3.1.0) (2021-12-22)
16+
17+
### Bug Fixes
18+
19+
- **grid-stack:** allow custom class attribute ([f00309e](https://github.com/yahoo/ember-gridstack/commit/f00309ef9e016fe0e90e024b78c48b2dc1dd6e79))
20+
21+
### Features
22+
23+
- update ember-modifier render-modifiers deps ([7a1c6b4](https://github.com/yahoo/ember-gridstack/commit/7a1c6b40120b8c99af1aa1769b985232b83af3e6))
24+
25+
## [3.0.2](https://github.com/yahoo/ember-gridstack/compare/v3.0.1...v3.0.2) (2021-10-21)
26+
27+
### Bug Fixes
28+
29+
- embroider-safe and embroider-optimized builds ([#88](https://github.com/yahoo/ember-gridstack/issues/88)) ([26e77a8](https://github.com/yahoo/ember-gridstack/commit/26e77a867a146eeaf949b4c89697593d3872865c))
30+
31+
## [3.0.1](https://github.com/yahoo/ember-gridstack/compare/v3.0.0...v3.0.1) (2021-10-19)
32+
33+
### Bug Fixes
34+
35+
- bump path-parse from 1.0.6 to 1.0.7 ([#83](https://github.com/yahoo/ember-gridstack/issues/83)) ([47503ed](https://github.com/yahoo/ember-gridstack/commit/47503edc97fc8ab280a619fc6370cfa0ee1d0956))
36+
- bump tmpl from 1.0.4 to 1.0.5 ([#84](https://github.com/yahoo/ember-gridstack/issues/84)) ([382c7f9](https://github.com/yahoo/ember-gridstack/commit/382c7f91ec5a49abee9be52bb230b271bdf17e7d))
37+
- bump ws from 7.4.5 to 7.4.6 ([#80](https://github.com/yahoo/ember-gridstack/issues/80)) ([4b36d95](https://github.com/yahoo/ember-gridstack/commit/4b36d95637f84c282af730d651588a1f41c1ba55))
38+
39+
## [3.0.0](https://github.com/yahoo/ember-gridstack/compare/v2.1.0...v3.0.0) (2021-10-19)
440

541
✨ Huge shoutout to [@adumesny](https://github.com/adumesny) for his work on gridstack ✨
642

addon/components/grid-stack.js

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ import { inject as service } from '@ember/service';
2626
import { scheduleOnce } from '@ember/runloop';
2727
import { capitalize } from '@ember/string';
2828
import { guidFor } from '@ember/object/internals';
29-
import { GridStackDDI } from 'gridstack';
30-
import GridStack from 'gridstack-h5';
29+
import { GridStack } from 'gridstack';
3130

3231
export const GRID_STACK_EVENTS = [
3332
'added',
@@ -130,39 +129,9 @@ export default class GridStackComponent extends Component {
130129
this.gridStack?.makeWidget(element);
131130
}
132131

133-
/**
134-
* Custom removeWidget function that skips check to see if widget is in current grid
135-
* @see https://github.com/gridstack/gridstack.js/blob/v4.2.5/src/gridstack.ts#L893
136-
*/
137132
@action
138133
removeWidget(element, removeDOM = false, triggerEvent = true) {
139-
GridStack.getElements(element).forEach((el) => {
140-
// The following line was causing issues because this hook is called correctly from
141-
// child widgets, but after they are already removed from the dom
142-
// --- SKIP ---
143-
// if (el.parentElement !== this.el) return; // not our child!
144-
// --- SKIP ---
145-
let node = el.gridstackNode;
146-
// For Meteor support: https://github.com/gridstack/gridstack.js/pull/272
147-
if (!node) {
148-
node = this.gridStack?.engine.nodes.find((n) => el === n.el);
149-
}
150-
if (!node) return;
151-
152-
// remove our DOM data (circular link) and drag&drop permanently
153-
delete el.gridstackNode;
154-
GridStackDDI.get().remove(el);
155-
156-
this.gridStack?.engine.removeNode(node, removeDOM, triggerEvent);
157-
158-
if (removeDOM && el.parentElement) {
159-
el.remove(); // in batch mode engine.removeNode doesn't call back to remove DOM
160-
}
161-
});
162-
if (triggerEvent && !this.isDestroying && !this.isDestroyed) {
163-
this.gridStack?._triggerRemoveEvent();
164-
this.gridStack?._triggerChangeEvent();
165-
}
166-
return this;
134+
triggerEvent = triggerEvent && !this.isDestroying && !this.isDestroyed;
135+
this.gridStack?.removeWidget(element, removeDOM, triggerEvent);
167136
}
168137
}

index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ module.exports = {
88
included(app) {
99
this._super.included.apply(this, arguments);
1010

11-
app.import(`${GRIDSTACK_DIR}/gridstack-h5.js`, {
12-
using: [{ transformation: 'amd', as: 'gridstack-h5' }],
13-
});
14-
1511
app.import(`${GRIDSTACK_DIR}/gridstack.css`);
1612
app.import(`${GRIDSTACK_DIR}/gridstack-extra.css`);
1713
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"ember-cli-babel": "^7.26.6",
3939
"ember-cli-htmlbars": "^5.7.1",
4040
"ember-modifier": "^3.0.0",
41-
"gridstack": "^4.2.7"
41+
"gridstack": "^7.2.2"
4242
},
4343
"devDependencies": {
4444
"@commitlint/cli": "^11.0.0",

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7762,10 +7762,10 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.3
77627762
resolved "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
77637763
integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=
77647764

7765-
gridstack@^4.2.7:
7766-
version "4.3.1"
7767-
resolved "https://registry.npmjs.org/gridstack/-/gridstack-4.3.1.tgz#dd9709fc5ba0a1e4ff64d8ed3319a95d88f2e21b"
7768-
integrity sha512-E4smuSe7ZZBrqPWm4THxDSYCQG4xcoQg8k0eeHjqkKiKuh3W4JFbyhA86DVarWruuZuUl2pwgO3oDhL6DFKFYw==
7765+
gridstack@^7.2.2:
7766+
version "7.2.2"
7767+
resolved "https://registry.yarnpkg.com/gridstack/-/gridstack-7.2.2.tgz#1a5be730923722c88685641809f36c9681d329bd"
7768+
integrity sha512-9swEjbisKhtZlbmNiTCxOarp/9NWit5mLg6Z73sUhd4LKur5ZptMH16CUJu7HjMHxgI86FbQI5ZfMM/2TuMqdw==
77697769

77707770
growly@^1.3.0:
77717771
version "1.3.0"

0 commit comments

Comments
 (0)