ember-style-modifier 0.7.0 → 0.8.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/.github/workflows/ci.yml +8 -8
- package/addon/modifiers/style.js +6 -8
- package/package.json +6 -6
- package/CHANGELOG.md +0 -92
package/.github/workflows/ci.yml
CHANGED
|
@@ -46,7 +46,7 @@ jobs:
|
|
|
46
46
|
name: Lint
|
|
47
47
|
runs-on: ubuntu-latest
|
|
48
48
|
steps:
|
|
49
|
-
- uses: actions/checkout@
|
|
49
|
+
- uses: actions/checkout@v3
|
|
50
50
|
with:
|
|
51
51
|
fetch-depth: 1
|
|
52
52
|
|
|
@@ -60,7 +60,7 @@ jobs:
|
|
|
60
60
|
|
|
61
61
|
- name: Cache package manager's global cache and node_modules
|
|
62
62
|
id: cache-dependencies
|
|
63
|
-
uses: actions/cache@
|
|
63
|
+
uses: actions/cache@v3
|
|
64
64
|
with:
|
|
65
65
|
path: |
|
|
66
66
|
${{ steps.global-cache-dir-path.outputs.dir }}
|
|
@@ -91,7 +91,7 @@ jobs:
|
|
|
91
91
|
browser: [chrome]
|
|
92
92
|
|
|
93
93
|
steps:
|
|
94
|
-
- uses: actions/checkout@
|
|
94
|
+
- uses: actions/checkout@v3
|
|
95
95
|
with:
|
|
96
96
|
fetch-depth: 1
|
|
97
97
|
|
|
@@ -105,7 +105,7 @@ jobs:
|
|
|
105
105
|
|
|
106
106
|
- name: Cache package manager's global cache and node_modules
|
|
107
107
|
id: cache-dependencies
|
|
108
|
-
uses: actions/cache@
|
|
108
|
+
uses: actions/cache@v3
|
|
109
109
|
with:
|
|
110
110
|
path: |
|
|
111
111
|
${{ steps.global-cache-dir-path.outputs.dir }}
|
|
@@ -136,7 +136,7 @@ jobs:
|
|
|
136
136
|
browser: [chrome]
|
|
137
137
|
|
|
138
138
|
steps:
|
|
139
|
-
- uses: actions/checkout@
|
|
139
|
+
- uses: actions/checkout@v3
|
|
140
140
|
with:
|
|
141
141
|
fetch-depth: 1
|
|
142
142
|
|
|
@@ -150,7 +150,7 @@ jobs:
|
|
|
150
150
|
|
|
151
151
|
- name: Cache package manager's global cache and node_modules
|
|
152
152
|
id: cache-dependencies
|
|
153
|
-
uses: actions/cache@
|
|
153
|
+
uses: actions/cache@v3
|
|
154
154
|
with:
|
|
155
155
|
path: |
|
|
156
156
|
${{ steps.global-cache-dir-path.outputs.dir }}
|
|
@@ -190,7 +190,7 @@ jobs:
|
|
|
190
190
|
]
|
|
191
191
|
|
|
192
192
|
steps:
|
|
193
|
-
- uses: actions/checkout@
|
|
193
|
+
- uses: actions/checkout@v3
|
|
194
194
|
with:
|
|
195
195
|
fetch-depth: 1
|
|
196
196
|
|
|
@@ -204,7 +204,7 @@ jobs:
|
|
|
204
204
|
|
|
205
205
|
- name: Cache package manager's global cache and node_modules
|
|
206
206
|
id: cache-dependencies
|
|
207
|
-
uses: actions/cache@
|
|
207
|
+
uses: actions/cache@v3
|
|
208
208
|
with:
|
|
209
209
|
path: |
|
|
210
210
|
${{ steps.global-cache-dir-path.outputs.dir }}
|
package/addon/modifiers/style.js
CHANGED
|
@@ -21,9 +21,7 @@ export default class StyleModifier extends Modifier {
|
|
|
21
21
|
*
|
|
22
22
|
* This data structure is slightly faster to process than an object / dictionary.
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
const { positional, named } = this.args;
|
|
26
|
-
|
|
24
|
+
getStyles(positional, named) {
|
|
27
25
|
// This is a workaround for the missing `Array#flat` in IE11.
|
|
28
26
|
return [].concat(
|
|
29
27
|
...[...positional.filter(isObject), named].map((obj) =>
|
|
@@ -32,7 +30,7 @@ export default class StyleModifier extends Modifier {
|
|
|
32
30
|
);
|
|
33
31
|
}
|
|
34
32
|
|
|
35
|
-
setStyles(newStyles) {
|
|
33
|
+
setStyles(element, newStyles) {
|
|
36
34
|
const rulesToRemove = this._oldStyles || new Set();
|
|
37
35
|
|
|
38
36
|
newStyles.forEach(([property, value]) => {
|
|
@@ -56,20 +54,20 @@ export default class StyleModifier extends Modifier {
|
|
|
56
54
|
property = dasherize(property);
|
|
57
55
|
|
|
58
56
|
// update CSSOM
|
|
59
|
-
|
|
57
|
+
element.style.setProperty(property, value, priority);
|
|
60
58
|
|
|
61
59
|
// should not remove rules that have been updated in this cycle
|
|
62
60
|
rulesToRemove.delete(property);
|
|
63
61
|
});
|
|
64
62
|
|
|
65
63
|
// remove rules that were present in last cycle but aren't present in this one
|
|
66
|
-
rulesToRemove.forEach((rule) =>
|
|
64
|
+
rulesToRemove.forEach((rule) => element.style.removeProperty(rule));
|
|
67
65
|
|
|
68
66
|
// cache styles that in this rendering cycle for the next one
|
|
69
67
|
this._oldStyles = new Set(newStyles.map((e) => e[0]));
|
|
70
68
|
}
|
|
71
69
|
|
|
72
|
-
|
|
73
|
-
this.setStyles(this.
|
|
70
|
+
modify(element, positional, named) {
|
|
71
|
+
this.setStyles(element, this.getStyles(positional, named));
|
|
74
72
|
}
|
|
75
73
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-style-modifier",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "{{style}} modifier to set an element's style using the CSSStyleDeclaration API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -28,18 +28,18 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"ember-cli-babel": "^7.26.6",
|
|
31
|
-
"ember-modifier": "^3.
|
|
31
|
+
"ember-modifier": "^3.2.7"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@ember/optional-features": "^2.0.0",
|
|
35
35
|
"@ember/test-helpers": "^2.4.2",
|
|
36
|
-
"@embroider/test-setup": "^0.
|
|
36
|
+
"@embroider/test-setup": "^1.0.0",
|
|
37
37
|
"@glimmer/component": "^1.0.4",
|
|
38
38
|
"@glimmer/tracking": "^1.0.4",
|
|
39
39
|
"babel-eslint": "^10.1.0",
|
|
40
40
|
"broccoli-asset-rev": "^3.0.0",
|
|
41
41
|
"ember-auto-import": "^2.2.3",
|
|
42
|
-
"ember-cli": "~3.
|
|
42
|
+
"ember-cli": "~4.3.0",
|
|
43
43
|
"ember-cli-content-security-policy": "^2.0.0-1",
|
|
44
44
|
"ember-cli-dependency-checker": "^3.2.0",
|
|
45
45
|
"ember-cli-htmlbars": "^6.0.0",
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
"ember-export-application-global": "^2.0.1",
|
|
51
51
|
"ember-load-initializers": "^2.1.2",
|
|
52
52
|
"ember-maybe-import-regenerator": "^1.0.0",
|
|
53
|
-
"ember-page-title": "^
|
|
53
|
+
"ember-page-title": "^7.0.0",
|
|
54
54
|
"ember-qunit": "^5.1.4",
|
|
55
55
|
"ember-resolver": "^8.0.2",
|
|
56
56
|
"ember-source": "~3.28.0",
|
|
57
57
|
"ember-source-channel-url": "^3.0.0",
|
|
58
58
|
"ember-template-lint": "^3.6.0",
|
|
59
|
-
"ember-try": "^
|
|
59
|
+
"ember-try": "^2.0.0",
|
|
60
60
|
"eslint": "^7.32.0",
|
|
61
61
|
"eslint-config-prettier": "^8.3.0",
|
|
62
62
|
"eslint-plugin-ember": "^10.5.4",
|
package/CHANGELOG.md
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
## v0.7.0 (2021-10-27)
|
|
3
|
-
|
|
4
|
-
#### :boom: Breaking Change
|
|
5
|
-
* [#71](https://github.com/jelhan/ember-style-modifier/pull/71) add Ember Auto Import v2 ([@jelhan](https://github.com/jelhan))
|
|
6
|
-
* [#60](https://github.com/jelhan/ember-style-modifier/pull/60) Update dependency ember-modifier to v3 ([@renovate[bot]](https://github.com/apps/renovate))
|
|
7
|
-
* [#67](https://github.com/jelhan/ember-style-modifier/pull/67) drop support for Ember < 3.24 ([@jelhan](https://github.com/jelhan))
|
|
8
|
-
* [#57](https://github.com/jelhan/ember-style-modifier/pull/57) drop support for Ember 3.4 ([@jelhan](https://github.com/jelhan))
|
|
9
|
-
* [#58](https://github.com/jelhan/ember-style-modifier/pull/58) drop support for node 10 ([@jelhan](https://github.com/jelhan))
|
|
10
|
-
|
|
11
|
-
#### :house: Internal
|
|
12
|
-
* [#72](https://github.com/jelhan/ember-style-modifier/pull/72) fix CSP for Embroider builds ([@jelhan](https://github.com/jelhan))
|
|
13
|
-
* [#68](https://github.com/jelhan/ember-style-modifier/pull/68) upgrade addon blueprints to Ember CLI 3.28 ([@jelhan](https://github.com/jelhan))
|
|
14
|
-
* [#51](https://github.com/jelhan/ember-style-modifier/pull/51) Create ember-try scenarios for `no-deprecations` ([@mansona](https://github.com/mansona))
|
|
15
|
-
* [#39](https://github.com/jelhan/ember-style-modifier/pull/39) upgrade to Ember 3.24 ([@jelhan](https://github.com/jelhan))
|
|
16
|
-
* [#64](https://github.com/jelhan/ember-style-modifier/pull/64) finish all scenarios in CI even if one fails ([@jelhan](https://github.com/jelhan))
|
|
17
|
-
* [#28](https://github.com/jelhan/ember-style-modifier/pull/28) Upgrade Ember CLI to 3.21 ([@jelhan](https://github.com/jelhan))
|
|
18
|
-
* [#20](https://github.com/jelhan/ember-style-modifier/pull/20) Configure Renovate ([@renovate[bot]](https://github.com/apps/renovate))
|
|
19
|
-
|
|
20
|
-
#### Committers: 2
|
|
21
|
-
- Chris Manson ([@mansona](https://github.com/mansona))
|
|
22
|
-
- Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
|
|
23
|
-
|
|
24
|
-
## v0.6.0 (2020-08-03)
|
|
25
|
-
|
|
26
|
-
#### :boom: Breaking Change
|
|
27
|
-
* [#19](https://github.com/jelhan/ember-style-modifier/pull/19) Update ember-modifier to 2.1.0 and drop support for Ember < 3.4 ([@andreyfel](https://github.com/andreyfel))
|
|
28
|
-
|
|
29
|
-
#### Committers: 2
|
|
30
|
-
- Andrey Fel ([@andreyfel](https://github.com/andreyfel))
|
|
31
|
-
- Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
|
|
32
|
-
|
|
33
|
-
## v0.5.0 (2019-12-04)
|
|
34
|
-
|
|
35
|
-
#### :boom: Breaking Change
|
|
36
|
-
* [#12](https://github.com/jelhan/ember-style-modifier/pull/12) use public APIs through ember-modifier and upgrade dependencies ([@andreyfel](https://github.com/andreyfel))
|
|
37
|
-
|
|
38
|
-
#### :house: Internal
|
|
39
|
-
* [#14](https://github.com/jelhan/ember-style-modifier/pull/14) automate releases with release-it and lerna-changelog ([@jelhan](https://github.com/jelhan))
|
|
40
|
-
* [#12](https://github.com/jelhan/ember-style-modifier/pull/12) use public APIs through ember-modifier and upgrade dependencies ([@andreyfel](https://github.com/andreyfel))
|
|
41
|
-
|
|
42
|
-
#### Committers: 2
|
|
43
|
-
- Andrey Fel ([@andreyfel](https://github.com/andreyfel))
|
|
44
|
-
- Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
## v0.4.1 (2019-03-28)
|
|
48
|
-
|
|
49
|
-
#### :rocket: Enhancement
|
|
50
|
-
* [#10](https://github.com/jelhan/ember-style-modifier/pull/10) better assertion message for wrong value type ([@jelhan](https://github.com/jelhan))
|
|
51
|
-
|
|
52
|
-
#### Committers: 1
|
|
53
|
-
- Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
## v0.4.0 (2019-03-18)
|
|
57
|
-
|
|
58
|
-
#### :house: Internal
|
|
59
|
-
* [#8](https://github.com/jelhan/ember-style-modifier/pull/8) refactor: drop ember-functional-modifiers ([@buschtoens](https://github.com/buschtoens))
|
|
60
|
-
|
|
61
|
-
#### Committers: 1
|
|
62
|
-
- Jan Buschtöns ([@buschtoens](https://github.com/buschtoens))
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
## v0.3.0 (2019-03-13)
|
|
66
|
-
|
|
67
|
-
#### :rocket: Enhancement
|
|
68
|
-
* [#6](https://github.com/jelhan/ember-style-modifier/pull/6) support setting CSS rules using a POJO ([@jelhan](https://github.com/jelhan))
|
|
69
|
-
|
|
70
|
-
#### Committers: 1
|
|
71
|
-
- Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
## v0.2.0 (2019-03-12)
|
|
75
|
-
|
|
76
|
-
#### :boom: Breaking Change
|
|
77
|
-
* [#4](https://github.com/jelhan/ember-style-modifier/pull/4) support a more compact style for declaring CSS rules ([@jelhan](https://github.com/jelhan))
|
|
78
|
-
|
|
79
|
-
#### :rocket: Enhancement
|
|
80
|
-
* [#4](https://github.com/jelhan/ember-style-modifier/pull/4) support a more compact style for declaring CSS rules ([@jelhan](https://github.com/jelhan))
|
|
81
|
-
|
|
82
|
-
#### Committers: 1
|
|
83
|
-
- Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
## v0.1.0 (2019-03-11)
|
|
87
|
-
|
|
88
|
-
Initial proof of concept
|
|
89
|
-
|
|
90
|
-
#### Committers: 1
|
|
91
|
-
- Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
|
|
92
|
-
-
|