ember-style-modifier 0.4.0 → 0.7.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 +226 -0
- package/.release-it.json +14 -0
- package/CHANGELOG.md +92 -0
- package/README.md +5 -1
- package/addon/modifiers/style.js +59 -71
- package/config/environment.js +2 -2
- package/index.js +1 -1
- package/package.json +57 -34
- package/renovate.json +6 -0
- package/config/release.js +0 -21
- package/jsconfig.json +0 -1
|
@@ -0,0 +1,226 @@
|
|
|
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.24
|
|
19
|
+
#$ - scenario: ember-lts-3.28
|
|
20
|
+
#$ - scenario: ember-release
|
|
21
|
+
#$ - scenario: ember-beta
|
|
22
|
+
#$ - scenario: ember-canary
|
|
23
|
+
#$ - scenario: ember-default-with-jquery
|
|
24
|
+
#$ - scenario: ember-classic
|
|
25
|
+
#$ - scenario: no-deprecations
|
|
26
|
+
#$ - scenario: ember-release-no-deprecations
|
|
27
|
+
#$ - scenario: embroider-safe
|
|
28
|
+
#$ - scenario: embroider-optimized
|
|
29
|
+
#$ nodeVersion: 12.x
|
|
30
|
+
#$ packageManager: yarn
|
|
31
|
+
#
|
|
32
|
+
|
|
33
|
+
name: CI
|
|
34
|
+
|
|
35
|
+
on:
|
|
36
|
+
push:
|
|
37
|
+
branches:
|
|
38
|
+
- master
|
|
39
|
+
pull_request:
|
|
40
|
+
|
|
41
|
+
env:
|
|
42
|
+
NODE_VERSION: '12.x'
|
|
43
|
+
|
|
44
|
+
jobs:
|
|
45
|
+
lint:
|
|
46
|
+
name: Lint
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v2
|
|
50
|
+
with:
|
|
51
|
+
fetch-depth: 1
|
|
52
|
+
|
|
53
|
+
- uses: actions/setup-node@v2-beta
|
|
54
|
+
with:
|
|
55
|
+
node-version: '${{ env.NODE_VERSION }}'
|
|
56
|
+
|
|
57
|
+
- name: Get package manager's global cache path
|
|
58
|
+
id: global-cache-dir-path
|
|
59
|
+
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
60
|
+
|
|
61
|
+
- name: Cache package manager's global cache and node_modules
|
|
62
|
+
id: cache-dependencies
|
|
63
|
+
uses: actions/cache@v2
|
|
64
|
+
with:
|
|
65
|
+
path: |
|
|
66
|
+
${{ steps.global-cache-dir-path.outputs.dir }}
|
|
67
|
+
node_modules
|
|
68
|
+
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
|
|
69
|
+
hashFiles('**/yarn.lock'
|
|
70
|
+
) }}
|
|
71
|
+
restore-keys: |
|
|
72
|
+
${{ runner.os }}-${{ matrix.node-version }}-
|
|
73
|
+
|
|
74
|
+
- name: Install Dependencies
|
|
75
|
+
run: yarn install --frozen-lockfile
|
|
76
|
+
if: |
|
|
77
|
+
steps.cache-dependencies.outputs.cache-hit != 'true'
|
|
78
|
+
|
|
79
|
+
- name: Lint
|
|
80
|
+
run: yarn lint
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
test:
|
|
84
|
+
name: Tests
|
|
85
|
+
runs-on: ${{ matrix.os }}
|
|
86
|
+
needs: lint
|
|
87
|
+
|
|
88
|
+
strategy:
|
|
89
|
+
matrix:
|
|
90
|
+
os: [ubuntu-latest]
|
|
91
|
+
browser: [chrome]
|
|
92
|
+
|
|
93
|
+
steps:
|
|
94
|
+
- uses: actions/checkout@v2
|
|
95
|
+
with:
|
|
96
|
+
fetch-depth: 1
|
|
97
|
+
|
|
98
|
+
- uses: actions/setup-node@v2-beta
|
|
99
|
+
with:
|
|
100
|
+
node-version: '${{ env.NODE_VERSION }}'
|
|
101
|
+
|
|
102
|
+
- name: Get package manager's global cache path
|
|
103
|
+
id: global-cache-dir-path
|
|
104
|
+
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
105
|
+
|
|
106
|
+
- name: Cache package manager's global cache and node_modules
|
|
107
|
+
id: cache-dependencies
|
|
108
|
+
uses: actions/cache@v2
|
|
109
|
+
with:
|
|
110
|
+
path: |
|
|
111
|
+
${{ steps.global-cache-dir-path.outputs.dir }}
|
|
112
|
+
node_modules
|
|
113
|
+
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
|
|
114
|
+
hashFiles('**/yarn.lock'
|
|
115
|
+
) }}
|
|
116
|
+
restore-keys: |
|
|
117
|
+
${{ runner.os }}-${{ matrix.node-version }}-
|
|
118
|
+
|
|
119
|
+
- name: Install Dependencies
|
|
120
|
+
run: yarn install --frozen-lockfile
|
|
121
|
+
if: |
|
|
122
|
+
steps.cache-dependencies.outputs.cache-hit != 'true'
|
|
123
|
+
|
|
124
|
+
- name: Test
|
|
125
|
+
run: yarn test:ember --launch ${{ matrix.browser }}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
floating-dependencies:
|
|
129
|
+
name: Floating Dependencies
|
|
130
|
+
runs-on: ${{ matrix.os }}
|
|
131
|
+
needs: lint
|
|
132
|
+
|
|
133
|
+
strategy:
|
|
134
|
+
matrix:
|
|
135
|
+
os: [ubuntu-latest]
|
|
136
|
+
browser: [chrome]
|
|
137
|
+
|
|
138
|
+
steps:
|
|
139
|
+
- uses: actions/checkout@v2
|
|
140
|
+
with:
|
|
141
|
+
fetch-depth: 1
|
|
142
|
+
|
|
143
|
+
- uses: actions/setup-node@v2-beta
|
|
144
|
+
with:
|
|
145
|
+
node-version: '${{ env.NODE_VERSION }}'
|
|
146
|
+
|
|
147
|
+
- name: Get package manager's global cache path
|
|
148
|
+
id: global-cache-dir-path
|
|
149
|
+
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
150
|
+
|
|
151
|
+
- name: Cache package manager's global cache and node_modules
|
|
152
|
+
id: cache-dependencies
|
|
153
|
+
uses: actions/cache@v2
|
|
154
|
+
with:
|
|
155
|
+
path: |
|
|
156
|
+
${{ steps.global-cache-dir-path.outputs.dir }}
|
|
157
|
+
node_modules
|
|
158
|
+
key: ${{ runner.os }}-${{ matrix.node-version }}-floating-deps
|
|
159
|
+
restore-keys: |
|
|
160
|
+
${{ runner.os }}-${{ matrix.node-version }}-
|
|
161
|
+
|
|
162
|
+
- name: Install Dependencies
|
|
163
|
+
run: yarn install --no-lockfile --non-interactive
|
|
164
|
+
|
|
165
|
+
- name: Test
|
|
166
|
+
run: yarn test:ember --launch ${{ matrix.browser }}
|
|
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.24,
|
|
180
|
+
ember-lts-3.28,
|
|
181
|
+
ember-release,
|
|
182
|
+
ember-beta,
|
|
183
|
+
ember-canary,
|
|
184
|
+
ember-default-with-jquery,
|
|
185
|
+
ember-classic,
|
|
186
|
+
no-deprecations,
|
|
187
|
+
ember-release-no-deprecations,
|
|
188
|
+
embroider-safe,
|
|
189
|
+
embroider-optimized
|
|
190
|
+
]
|
|
191
|
+
|
|
192
|
+
steps:
|
|
193
|
+
- uses: actions/checkout@v2
|
|
194
|
+
with:
|
|
195
|
+
fetch-depth: 1
|
|
196
|
+
|
|
197
|
+
- uses: actions/setup-node@v2-beta
|
|
198
|
+
with:
|
|
199
|
+
node-version: '${{ env.NODE_VERSION }}'
|
|
200
|
+
|
|
201
|
+
- name: Get package manager's global cache path
|
|
202
|
+
id: global-cache-dir-path
|
|
203
|
+
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
204
|
+
|
|
205
|
+
- name: Cache package manager's global cache and node_modules
|
|
206
|
+
id: cache-dependencies
|
|
207
|
+
uses: actions/cache@v2
|
|
208
|
+
with:
|
|
209
|
+
path: |
|
|
210
|
+
${{ steps.global-cache-dir-path.outputs.dir }}
|
|
211
|
+
node_modules
|
|
212
|
+
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
|
|
213
|
+
hashFiles('**/yarn.lock'
|
|
214
|
+
) }}
|
|
215
|
+
restore-keys: |
|
|
216
|
+
${{ runner.os }}-${{ matrix.node-version }}-
|
|
217
|
+
|
|
218
|
+
- name: Install Dependencies
|
|
219
|
+
run: yarn install --frozen-lockfile
|
|
220
|
+
if: |
|
|
221
|
+
steps.cache-dependencies.outputs.cache-hit != 'true'
|
|
222
|
+
|
|
223
|
+
- name: Test
|
|
224
|
+
env:
|
|
225
|
+
EMBER_TRY_SCENARIO: ${{ matrix.ember-try-scenario }}
|
|
226
|
+
run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
|
package/.release-it.json
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
-
|
package/README.md
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
# ember-style-modifier
|
|
2
2
|
|
|
3
3
|
[](https://travis-ci.org/jelhan/ember-style-modifier)
|
|
4
|
+
[](http://emberobserver.com/addons/ember-style-modifier)
|
|
5
|
+
[](https://badge.fury.io/js/ember-style-modifier)
|
|
4
6
|
|
|
5
7
|
This addon provides a `{{style}}` element modifier to set element's style.
|
|
6
8
|
This allows to set custom CSS of an element without requiring a [Content Security Policy](https://content-security-policy.com/) `style-src-attr: "unsafe-inline"`.
|
|
7
9
|
|
|
8
10
|
## Compatibility
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
* Ember.js v3.24 or above
|
|
13
|
+
* Ember CLI v3.24 or above
|
|
14
|
+
* Node.js v12 or above
|
|
11
15
|
|
|
12
16
|
## Installation
|
|
13
17
|
|
package/addon/modifiers/style.js
CHANGED
|
@@ -1,87 +1,75 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Modifier from 'ember-modifier';
|
|
2
2
|
import { dasherize } from '@ember/string';
|
|
3
3
|
import { assert } from '@ember/debug';
|
|
4
4
|
import { typeOf } from '@ember/utils';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Returns a two-dimensional array, like:
|
|
10
|
-
*
|
|
11
|
-
* ```js
|
|
12
|
-
* [
|
|
13
|
-
* ['font-size', '16px'],
|
|
14
|
-
* ['text-align', 'center'],
|
|
15
|
-
* ['color', 'red']
|
|
16
|
-
* ]
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* This data structure is slightly faster to process than an object / dictionary.
|
|
20
|
-
*/
|
|
21
|
-
const getStylesFromOptions = (positional, named) =>
|
|
22
|
-
// This is a workaround for the missing `Array#flat` in IE11.
|
|
23
|
-
[].concat(
|
|
24
|
-
...[...positional.filter(isObject), named].map(obj =>
|
|
25
|
-
Object.entries(obj).map(([k, v]) => [dasherize(k), v])
|
|
26
|
-
)
|
|
27
|
-
);
|
|
6
|
+
function isObject(o) {
|
|
7
|
+
return typeof o === 'object' && Boolean(o);
|
|
8
|
+
}
|
|
28
9
|
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
export default class StyleModifier extends Modifier {
|
|
11
|
+
/**
|
|
12
|
+
* Returns a two-dimensional array, like:
|
|
13
|
+
*
|
|
14
|
+
* ```js
|
|
15
|
+
* [
|
|
16
|
+
* ['font-size', '16px'],
|
|
17
|
+
* ['text-align', 'center'],
|
|
18
|
+
* ['color', 'red']
|
|
19
|
+
* ]
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* This data structure is slightly faster to process than an object / dictionary.
|
|
23
|
+
*/
|
|
24
|
+
get styles() {
|
|
25
|
+
const { positional, named } = this.args;
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
// This is a workaround for the missing `Array#flat` in IE11.
|
|
28
|
+
return [].concat(
|
|
29
|
+
...[...positional.filter(isObject), named].map((obj) =>
|
|
30
|
+
Object.entries(obj).map(([k, v]) => [dasherize(k), v])
|
|
31
|
+
)
|
|
36
32
|
);
|
|
33
|
+
}
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
let priority = '';
|
|
41
|
-
if (value && value.includes('!important')) {
|
|
42
|
-
priority = 'important';
|
|
43
|
-
value = value.replace('!important', '');
|
|
44
|
-
}
|
|
35
|
+
setStyles(newStyles) {
|
|
36
|
+
const rulesToRemove = this._oldStyles || new Set();
|
|
45
37
|
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
newStyles.forEach(([property, value]) => {
|
|
39
|
+
assert(
|
|
40
|
+
`Your given value for property '${property}' is ${value} (${typeOf(
|
|
41
|
+
value
|
|
42
|
+
)}). ` +
|
|
43
|
+
'Accepted types are string and undefined. Please change accordingly.',
|
|
44
|
+
typeof value === 'undefined' || typeOf(value) === 'string'
|
|
45
|
+
);
|
|
48
46
|
|
|
49
|
-
|
|
47
|
+
// priority must be specified as separate argument
|
|
48
|
+
// value must not contain "!important"
|
|
49
|
+
let priority = '';
|
|
50
|
+
if (value && value.includes('!important')) {
|
|
51
|
+
priority = 'important';
|
|
52
|
+
value = value.replace('!important', '');
|
|
53
|
+
}
|
|
50
54
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
+
// support camelCase property name
|
|
56
|
+
property = dasherize(property);
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
}
|
|
58
|
+
// update CSSOM
|
|
59
|
+
this.element.style.setProperty(property, value, priority);
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return {
|
|
65
|
-
element: null,
|
|
66
|
-
styles: {}
|
|
67
|
-
};
|
|
68
|
-
},
|
|
61
|
+
// should not remove rules that have been updated in this cycle
|
|
62
|
+
rulesToRemove.delete(property);
|
|
63
|
+
});
|
|
69
64
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
state.styles = getStylesFromOptions(positional, named);
|
|
73
|
-
setStyles(element, state.styles);
|
|
74
|
-
},
|
|
65
|
+
// remove rules that were present in last cycle but aren't present in this one
|
|
66
|
+
rulesToRemove.forEach((rule) => this.element.style.removeProperty(rule));
|
|
75
67
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
state.styles = newStyles;
|
|
80
|
-
},
|
|
68
|
+
// cache styles that in this rendering cycle for the next one
|
|
69
|
+
this._oldStyles = new Set(newStyles.map((e) => e[0]));
|
|
70
|
+
}
|
|
81
71
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
class OnModifier {}
|
|
87
|
-
);
|
|
72
|
+
didReceiveArguments() {
|
|
73
|
+
this.setStyles(this.styles);
|
|
74
|
+
}
|
|
75
|
+
}
|
package/config/environment.js
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-style-modifier",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "{{style}} modifier to set an element's style using the CSSStyleDeclaration API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -13,52 +13,75 @@
|
|
|
13
13
|
"test": "tests"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "ember build",
|
|
16
|
+
"build": "ember build --environment=production",
|
|
17
|
+
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
|
|
18
|
+
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
|
|
17
19
|
"lint:hbs": "ember-template-lint .",
|
|
18
|
-
"lint:
|
|
20
|
+
"lint:hbs:fix": "ember-template-lint . --fix",
|
|
21
|
+
"lint:js": "eslint . --cache",
|
|
22
|
+
"release": "release-it",
|
|
23
|
+
"lint:js:fix": "eslint . --fix",
|
|
19
24
|
"start": "ember serve",
|
|
20
|
-
"test": "
|
|
21
|
-
"test:
|
|
25
|
+
"test": "npm-run-all lint test:*",
|
|
26
|
+
"test:ember": "ember test",
|
|
27
|
+
"test:ember-compatibility": "ember try:each"
|
|
22
28
|
},
|
|
23
29
|
"dependencies": {
|
|
24
|
-
"ember-cli-babel": "^7.
|
|
25
|
-
"ember-modifier
|
|
30
|
+
"ember-cli-babel": "^7.26.6",
|
|
31
|
+
"ember-modifier": "^3.0.0"
|
|
26
32
|
},
|
|
27
33
|
"devDependencies": {
|
|
28
|
-
"@ember/optional-features": "^0.
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"ember-
|
|
36
|
-
"ember-cli
|
|
37
|
-
"ember-cli-
|
|
34
|
+
"@ember/optional-features": "^2.0.0",
|
|
35
|
+
"@ember/test-helpers": "^2.4.2",
|
|
36
|
+
"@embroider/test-setup": "^0.47.0",
|
|
37
|
+
"@glimmer/component": "^1.0.4",
|
|
38
|
+
"@glimmer/tracking": "^1.0.4",
|
|
39
|
+
"babel-eslint": "^10.1.0",
|
|
40
|
+
"broccoli-asset-rev": "^3.0.0",
|
|
41
|
+
"ember-auto-import": "^2.2.3",
|
|
42
|
+
"ember-cli": "~3.28.3",
|
|
43
|
+
"ember-cli-content-security-policy": "^2.0.0-1",
|
|
44
|
+
"ember-cli-dependency-checker": "^3.2.0",
|
|
45
|
+
"ember-cli-htmlbars": "^6.0.0",
|
|
46
|
+
"ember-cli-inject-live-reload": "^2.1.0",
|
|
38
47
|
"ember-cli-sri": "^2.1.1",
|
|
39
|
-
"ember-cli-
|
|
40
|
-
"ember-cli-uglify": "^2.1.0",
|
|
48
|
+
"ember-cli-terser": "^4.0.2",
|
|
41
49
|
"ember-disable-prototype-extensions": "^1.1.3",
|
|
42
|
-
"ember-export-application-global": "^2.0.
|
|
43
|
-
"ember-load-initializers": "^
|
|
44
|
-
"ember-maybe-import-regenerator": "^0.
|
|
45
|
-
"ember-
|
|
46
|
-
"ember-
|
|
47
|
-
"ember-
|
|
48
|
-
"ember-source
|
|
49
|
-
"ember-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
50
|
+
"ember-export-application-global": "^2.0.1",
|
|
51
|
+
"ember-load-initializers": "^2.1.2",
|
|
52
|
+
"ember-maybe-import-regenerator": "^1.0.0",
|
|
53
|
+
"ember-page-title": "^6.2.2",
|
|
54
|
+
"ember-qunit": "^5.1.4",
|
|
55
|
+
"ember-resolver": "^8.0.2",
|
|
56
|
+
"ember-source": "~3.28.0",
|
|
57
|
+
"ember-source-channel-url": "^3.0.0",
|
|
58
|
+
"ember-template-lint": "^3.6.0",
|
|
59
|
+
"ember-try": "^1.4.0",
|
|
60
|
+
"eslint": "^7.32.0",
|
|
61
|
+
"eslint-config-prettier": "^8.3.0",
|
|
62
|
+
"eslint-plugin-ember": "^10.5.4",
|
|
63
|
+
"eslint-plugin-node": "^11.1.0",
|
|
64
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
65
|
+
"eslint-plugin-qunit": "^7.0.0",
|
|
52
66
|
"loader.js": "^4.7.0",
|
|
53
|
-
"
|
|
67
|
+
"npm-run-all": "^4.1.5",
|
|
68
|
+
"prettier": "^2.3.2",
|
|
69
|
+
"qunit": "^2.16.0",
|
|
70
|
+
"qunit-dom": "^2.0.0",
|
|
71
|
+
"release-it": "^14.0.0",
|
|
72
|
+
"release-it-lerna-changelog": "^4.0.0",
|
|
73
|
+
"webpack": "^5.60.0"
|
|
54
74
|
},
|
|
55
75
|
"engines": {
|
|
56
|
-
"node": "
|
|
76
|
+
"node": "12.* || 14.* || >= 16"
|
|
77
|
+
},
|
|
78
|
+
"publishConfig": {
|
|
79
|
+
"registry": "https://registry.npmjs.org"
|
|
80
|
+
},
|
|
81
|
+
"ember": {
|
|
82
|
+
"edition": "octane"
|
|
57
83
|
},
|
|
58
84
|
"ember-addon": {
|
|
59
85
|
"configPath": "tests/dummy/config"
|
|
60
|
-
},
|
|
61
|
-
"resolutions": {
|
|
62
|
-
"qunit": "^2.9.1"
|
|
63
86
|
}
|
|
64
87
|
}
|
package/renovate.json
ADDED
package/config/release.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/* jshint node:true */
|
|
2
|
-
// var RSVP = require('rsvp');
|
|
3
|
-
|
|
4
|
-
// For details on each option run `ember help release`
|
|
5
|
-
module.exports = {
|
|
6
|
-
// local: true,
|
|
7
|
-
// remote: 'some_remote',
|
|
8
|
-
// annotation: "Release %@",
|
|
9
|
-
// message: "Bumped version to %@",
|
|
10
|
-
// manifest: [ 'package.json', 'bower.json', 'someconfig.json' ],
|
|
11
|
-
// publish: true,
|
|
12
|
-
// strategy: 'date',
|
|
13
|
-
// format: 'YYYY-MM-DD',
|
|
14
|
-
// timezone: 'America/Los_Angeles',
|
|
15
|
-
//
|
|
16
|
-
// beforeCommit: function(project, versions) {
|
|
17
|
-
// return new RSVP.Promise(function(resolve, reject) {
|
|
18
|
-
// // Do custom things here...
|
|
19
|
-
// });
|
|
20
|
-
// }
|
|
21
|
-
};
|
package/jsconfig.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"compilerOptions":{"target":"es6","experimentalDecorators":true},"exclude":["node_modules","bower_components","tmp","vendor",".git","dist"]}
|