ember-style-modifier 4.0.0 → 4.2.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/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019
3
+ Copyright (c) 2024
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
package/README.md CHANGED
@@ -9,8 +9,8 @@ This allows to set custom CSS of an element without requiring a [Content Securit
9
9
 
10
10
  ## Compatibility
11
11
 
12
- * Ember.js v4.12 or above
13
- * Ember CLI v4.12 or above
12
+ * Ember.js v3.28 or above
13
+ * Ember CLI v3.28 or above
14
14
  * Node.js v18 or above
15
15
 
16
16
  ## Installation
package/addon-main.cjs ADDED
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ const { addonV1Shim } = require("@embroider/addon-shim");
4
+ module.exports = addonV1Shim(__dirname);
@@ -0,0 +1,2 @@
1
+ export { default } from './modifiers/style.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import Modifier from 'ember-modifier';
2
- type CSSStyles = {
3
- [key: string]: string | undefined;
2
+ import type * as CSS from 'csstype';
3
+ type CSSStyles = Partial<CSS.Properties> | Partial<CSS.PropertiesHyphen> | {
4
+ readonly [key: `--${string}`]: string;
4
5
  };
5
6
  export interface StyleModifierSignature {
6
7
  Element: HTMLElement;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../src/modifiers/style.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAItC,OAAO,KAAK,KAAK,GAAG,MAAM,SAAS,CAAC;AAMpC,KAAK,SAAS,GACV,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GACvB,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAC7B;IAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,MAAM,EAAE,GAAG,MAAM,CAAA;CAAE,CAAC;AAgC9C,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE;QACJ,UAAU,EAAE,SAAS,EAAE,CAAC;QACxB,KAAK,EAAE,SAAS,CAAC;KAClB,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,QAAQ,CAAC,sBAAsB,CAAC;IACzE,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAa;IAExC,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;IAsC7D,MAAM,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,SAAS;CAG5E"}
@@ -0,0 +1,5 @@
1
+ import type StyleModifier from './modifiers/style.ts';
2
+ export default interface EmberStyleModifierRegistry {
3
+ style: typeof StyleModifier;
4
+ }
5
+ //# sourceMappingURL=template-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-registry.d.ts","sourceRoot":"","sources":["../src/template-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AAEtD,MAAM,CAAC,OAAO,WAAW,0BAA0B;IACjD,KAAK,EAAE,OAAO,aAAa,CAAC;CAC7B"}
@@ -0,0 +1 @@
1
+ export { default } from "ember-style-modifier/modifiers/style";
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './modifiers/style.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -7,9 +7,8 @@ import { typeOf } from '@ember/utils';
7
7
  // interface does _not_ included dashed CSS property names. It only includes the
8
8
  // camelCase version of a CSS property.
9
9
  // https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1672
10
- type CSSStyles = { [key: string]: string | undefined };
11
10
 
12
- function isObject(o: unknown): boolean {
11
+ function isObject(o) {
13
12
  return typeof o === 'object' && Boolean(o);
14
13
  }
15
14
 
@@ -26,45 +25,21 @@ function isObject(o: unknown): boolean {
26
25
  *
27
26
  * This data structure is slightly faster to process than an object / dictionary.
28
27
  */
29
- function compileStyles(
30
- positional: CSSStyles[],
31
- named: CSSStyles,
32
- ): [string, string][] {
33
- return [...positional.filter(isObject), named]
34
- .map((obj) =>
35
- Object.entries(obj).map(
36
- ([k, v]) => [dasherize(k), v] as [string, string],
37
- ),
38
- )
39
- .flat();
28
+ function compileStyles(positional, named) {
29
+ return [...positional.filter(isObject), named].map(obj => Object.entries(obj).map(([k, v]) => [dasherize(k), v])).flat();
40
30
  }
41
-
42
- export interface StyleModifierSignature {
43
- Element: HTMLElement;
44
- Args: {
45
- Positional: CSSStyles[];
46
- Named: CSSStyles;
47
- };
48
- }
49
-
50
- export default class StyleModifier extends Modifier<StyleModifierSignature> {
51
- existingStyles: Set<string> = new Set();
52
-
53
- setStyles(element: HTMLElement, newStyles: [string, string][]) {
54
- const { existingStyles } = this;
55
- const rulesToRemove: Set<string> = new Set(existingStyles);
31
+ class StyleModifier extends Modifier {
32
+ existingStyles = new Set();
33
+ setStyles(element, newStyles) {
34
+ const {
35
+ existingStyles
36
+ } = this;
37
+ const rulesToRemove = new Set(existingStyles);
56
38
 
57
39
  // clear cache of existing styles
58
40
  existingStyles.clear();
59
-
60
41
  newStyles.forEach(([property, value]) => {
61
- assert(
62
- `Your given value for property '${property}' is ${value} (${typeOf(
63
- value,
64
- )}). ` +
65
- 'Accepted types are string and undefined. Please change accordingly.',
66
- typeof value === 'undefined' || typeOf(value) === 'string',
67
- );
42
+ assert(`Your given value for property '${property}' is ${value} (${typeOf(value)}). ` + 'Accepted types are string and undefined. Please change accordingly.', typeof value === 'undefined' || typeOf(value) === 'string');
68
43
 
69
44
  // priority must be specified as separate argument
70
45
  // value must not contain "!important"
@@ -85,10 +60,12 @@ export default class StyleModifier extends Modifier<StyleModifierSignature> {
85
60
  });
86
61
 
87
62
  // remove rules that were present in last cycle but aren't present in this one
88
- rulesToRemove.forEach((rule) => element.style.removeProperty(rule));
63
+ rulesToRemove.forEach(rule => element.style.removeProperty(rule));
89
64
  }
90
-
91
- modify(element: HTMLElement, positional: [CSSStyles] | [], named: CSSStyles) {
65
+ modify(element, positional, named) {
92
66
  this.setStyles(element, compileStyles(positional, named));
93
67
  }
94
68
  }
69
+
70
+ export { StyleModifier as default };
71
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sources":["../../src/modifiers/style.ts"],"sourcesContent":["import Modifier from 'ember-modifier';\nimport { dasherize } from '@ember/string';\nimport { assert } from '@ember/debug';\nimport { typeOf } from '@ember/utils';\nimport type * as CSS from 'csstype';\n\n// Cannot be typed as `Partial<CSSStyleDeclaration>` because `CSSStyleDeclaration`\n// interface does _not_ included dashed CSS property names. It only includes the\n// camelCase version of a CSS property.\n// https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1672\ntype CSSStyles =\n | Partial<CSS.Properties>\n | Partial<CSS.PropertiesHyphen>\n | { readonly [key: `--${string}`]: string };\n\nfunction isObject(o: unknown): boolean {\n return typeof o === 'object' && Boolean(o);\n}\n\n/**\n * Returns a two-dimensional array, like:\n *\n * ```js\n * [\n * ['font-size', '16px'],\n * ['text-align', 'center'],\n * ['color', 'red']\n * ]\n * ```\n *\n * This data structure is slightly faster to process than an object / dictionary.\n */\nfunction compileStyles(\n positional: CSSStyles[],\n named: CSSStyles,\n): [string, string][] {\n return [...positional.filter(isObject), named]\n .map((obj) =>\n Object.entries(obj).map(\n ([k, v]) => [dasherize(k), v] as [string, string],\n ),\n )\n .flat();\n}\n\nexport interface StyleModifierSignature {\n Element: HTMLElement;\n Args: {\n Positional: CSSStyles[];\n Named: CSSStyles;\n };\n}\n\nexport default class StyleModifier extends Modifier<StyleModifierSignature> {\n existingStyles: Set<string> = new Set();\n\n setStyles(element: HTMLElement, newStyles: [string, string][]) {\n const { existingStyles } = this;\n const rulesToRemove: Set<string> = new Set(existingStyles);\n\n // clear cache of existing styles\n existingStyles.clear();\n\n newStyles.forEach(([property, value]) => {\n assert(\n `Your given value for property '${property}' is ${value} (${typeOf(\n value,\n )}). ` +\n 'Accepted types are string and undefined. Please change accordingly.',\n typeof value === 'undefined' || typeOf(value) === 'string',\n );\n\n // priority must be specified as separate argument\n // value must not contain \"!important\"\n let priority = '';\n if (value && value.includes('!important')) {\n priority = 'important';\n value = value.replace('!important', '');\n }\n\n // update CSSOM\n element.style.setProperty(property, value, priority);\n\n // should not remove rules that have been updated in this cycle\n rulesToRemove.delete(property);\n\n // cache styles that have been set for potential clean-up when argument changes\n existingStyles.add(property);\n });\n\n // remove rules that were present in last cycle but aren't present in this one\n rulesToRemove.forEach((rule) => element.style.removeProperty(rule));\n }\n\n modify(element: HTMLElement, positional: [CSSStyles] | [], named: CSSStyles) {\n this.setStyles(element, compileStyles(positional, named));\n }\n}\n"],"names":["isObject","o","Boolean","compileStyles","positional","named","filter","map","obj","Object","entries","k","v","dasherize","flat","StyleModifier","Modifier","existingStyles","Set","setStyles","element","newStyles","rulesToRemove","clear","forEach","property","value","assert","typeOf","priority","includes","replace","style","setProperty","delete","add","rule","removeProperty","modify"],"mappings":";;;;;AAMA;AACA;AACA;AACA;;AAMA,SAASA,QAAQA,CAACC,CAAU,EAAW;EACrC,OAAO,OAAOA,CAAC,KAAK,QAAQ,IAAIC,OAAO,CAACD,CAAC,CAAC,CAAA;AAC5C,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,aAAaA,CACpBC,UAAuB,EACvBC,KAAgB,EACI;EACpB,OAAO,CAAC,GAAGD,UAAU,CAACE,MAAM,CAACN,QAAQ,CAAC,EAAEK,KAAK,CAAC,CAC3CE,GAAG,CAAEC,GAAG,IACPC,MAAM,CAACC,OAAO,CAACF,GAAG,CAAC,CAACD,GAAG,CACrB,CAAC,CAACI,CAAC,EAAEC,CAAC,CAAC,KAAK,CAACC,SAAS,CAACF,CAAC,CAAC,EAAEC,CAAC,CAC9B,CACF,CAAC,CACAE,IAAI,EAAE,CAAA;AACX,CAAA;AAUe,MAAMC,aAAa,SAASC,QAAQ,CAAyB;AAC1EC,EAAAA,cAAc,GAAgB,IAAIC,GAAG,EAAE,CAAA;AAEvCC,EAAAA,SAASA,CAACC,OAAoB,EAAEC,SAA6B,EAAE;IAC7D,MAAM;AAAEJ,MAAAA,cAAAA;AAAe,KAAC,GAAG,IAAI,CAAA;AAC/B,IAAA,MAAMK,aAA0B,GAAG,IAAIJ,GAAG,CAACD,cAAc,CAAC,CAAA;;AAE1D;IACAA,cAAc,CAACM,KAAK,EAAE,CAAA;IAEtBF,SAAS,CAACG,OAAO,CAAC,CAAC,CAACC,QAAQ,EAAEC,KAAK,CAAC,KAAK;MACvCC,MAAM,CACH,CAAiCF,+BAAAA,EAAAA,QAAS,CAAOC,KAAAA,EAAAA,KAAM,KAAIE,MAAM,CAChEF,KACF,CAAE,CAAI,GAAA,CAAA,GACJ,qEAAqE,EACvE,OAAOA,KAAK,KAAK,WAAW,IAAIE,MAAM,CAACF,KAAK,CAAC,KAAK,QACpD,CAAC,CAAA;;AAED;AACA;MACA,IAAIG,QAAQ,GAAG,EAAE,CAAA;MACjB,IAAIH,KAAK,IAAIA,KAAK,CAACI,QAAQ,CAAC,YAAY,CAAC,EAAE;AACzCD,QAAAA,QAAQ,GAAG,WAAW,CAAA;QACtBH,KAAK,GAAGA,KAAK,CAACK,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAA;AACzC,OAAA;;AAEA;MACAX,OAAO,CAACY,KAAK,CAACC,WAAW,CAACR,QAAQ,EAAEC,KAAK,EAAEG,QAAQ,CAAC,CAAA;;AAEpD;AACAP,MAAAA,aAAa,CAACY,MAAM,CAACT,QAAQ,CAAC,CAAA;;AAE9B;AACAR,MAAAA,cAAc,CAACkB,GAAG,CAACV,QAAQ,CAAC,CAAA;AAC9B,KAAC,CAAC,CAAA;;AAEF;AACAH,IAAAA,aAAa,CAACE,OAAO,CAAEY,IAAI,IAAKhB,OAAO,CAACY,KAAK,CAACK,cAAc,CAACD,IAAI,CAAC,CAAC,CAAA;AACrE,GAAA;AAEAE,EAAAA,MAAMA,CAAClB,OAAoB,EAAEhB,UAA4B,EAAEC,KAAgB,EAAE;IAC3E,IAAI,CAACc,SAAS,CAACC,OAAO,EAAEjB,aAAa,CAACC,UAAU,EAAEC,KAAK,CAAC,CAAC,CAAA;AAC3D,GAAA;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-style-modifier",
3
- "version": "4.0.0",
3
+ "version": "4.2.0",
4
4
  "description": "{{style}} modifier to set an element's style using the CSSStyleDeclaration API.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -8,62 +8,64 @@
8
8
  "repository": "https://github.com/jelhan/ember-style-modifier",
9
9
  "license": "MIT",
10
10
  "author": "",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./declarations/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "./*": {
17
+ "types": "./declarations/*.d.ts",
18
+ "default": "./dist/*.js"
19
+ },
20
+ "./addon-main.js": "./addon-main.cjs"
21
+ },
11
22
  "typesVersions": {
12
23
  "*": {
13
- "test-support": [
14
- "declarations/addon-test-support/index.d.ts"
15
- ],
16
- "test-support/*": [
17
- "declarations/addon-test-support/*",
18
- "declarations/addon-test-support/*/index.d.ts"
19
- ],
20
24
  "*": [
21
- "declarations/addon/*",
22
- "declarations/addon/*/index.d.ts"
25
+ "declarations/*"
23
26
  ]
24
27
  }
25
28
  },
26
- "directories": {
27
- "doc": "doc",
28
- "test": "tests"
29
- },
29
+ "files": [
30
+ "addon-main.cjs",
31
+ "declarations",
32
+ "dist"
33
+ ],
30
34
  "scripts": {
31
- "build": "ember build --environment=production",
32
- "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
33
- "lint:css": "stylelint \"**/*.css\"",
34
- "lint:css:fix": "concurrently \"npm:lint:css -- --fix\"",
35
- "lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
36
- "lint:hbs": "ember-template-lint .",
37
- "lint:hbs:fix": "ember-template-lint . --fix",
35
+ "build": "concurrently 'npm:build:*'",
36
+ "build:js": "rollup --config",
37
+ "build:types": "glint --declaration",
38
+ "lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
39
+ "lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
40
+ "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
41
+ "lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
38
42
  "lint:js": "eslint . --cache",
39
43
  "lint:js:fix": "eslint . --fix",
40
44
  "lint:types": "glint",
41
- "prepack": "tsc --project tsconfig.declarations.json",
42
- "postpack": "rimraf declarations",
43
- "release": "release-it",
44
- "start": "ember serve",
45
- "test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
46
- "test:ember": "ember test",
47
- "test:ember-compatibility": "ember try:each"
45
+ "prepack": "pnpm run build",
46
+ "start": "concurrently 'npm:start:*'",
47
+ "start:js": "rollup --config --watch --no-watch.clearScreen",
48
+ "start:types": "glint --declaration --watch",
49
+ "test": "echo 'A v2 addon does not have tests, run tests in test-app'",
50
+ "prepare": "pnpm run build"
48
51
  },
49
52
  "dependencies": {
53
+ "@embroider/addon-shim": "^1.8.7",
54
+ "decorator-transforms": "^1.0.1",
50
55
  "@babel/core": "^7.23.6",
51
- "ember-auto-import": "^2.7.0",
52
- "ember-cli-babel": "^8.2.0",
56
+ "csstype": "^3.1.3",
53
57
  "ember-modifier": "^3.2.7 || ^4.0.0"
54
58
  },
55
59
  "devDependencies": {
56
- "@ember/optional-features": "^2.0.0",
57
- "@ember/string": "^3.1.1",
58
- "@ember/test-helpers": "^3.2.1",
59
- "@embroider/test-setup": "^3.0.3",
60
- "@glimmer/component": "^1.1.2",
61
- "@glimmer/tracking": "^1.1.2",
62
- "@glint/core": "^1.2.2",
63
- "@glint/environment-ember-loose": "^1.2.2",
60
+ "@babel/core": "^7.23.6",
61
+ "@babel/plugin-transform-typescript": "^7.23.6",
62
+ "@babel/runtime": "^7.17.0",
63
+ "@embroider/addon-dev": "^4.1.0",
64
+ "@glint/core": "^1.2.1",
65
+ "@glint/environment-ember-loose": "^1.2.1",
64
66
  "@glint/environment-ember-template-imports": "^1.2.2",
65
67
  "@glint/template": "^1.2.2",
66
- "@release-it-plugins/lerna-changelog": "^6.0.0",
68
+ "@rollup/plugin-babel": "^6.0.4",
67
69
  "@tsconfig/ember": "^3.0.2",
68
70
  "@types/ember": "^4.0.10",
69
71
  "@types/ember__application": "^4.0.10",
@@ -86,57 +88,20 @@
86
88
  "@types/ember__template": "^4.0.5",
87
89
  "@types/ember__test": "^4.0.5",
88
90
  "@types/ember__utils": "^4.0.6",
89
- "@types/qunit": "^2.19.9",
90
- "@types/rsvp": "^4.0.8",
91
91
  "@typescript-eslint/eslint-plugin": "^6.14.0",
92
- "@typescript-eslint/parser": "^6.14.0",
93
- "broccoli-asset-rev": "^3.0.0",
92
+ "@typescript-eslint/parser": "^6.15.0",
93
+ "babel-plugin-ember-template-compilation": "^2.2.1",
94
94
  "concurrently": "^8.2.2",
95
- "ember-auto-import": "^2.7.0",
96
- "ember-cli": "~5.5.0",
97
- "ember-cli-clean-css": "^3.0.0",
98
- "ember-cli-content-security-policy": "^2.0.3",
99
- "ember-cli-dependency-checker": "^3.3.2",
100
- "ember-cli-htmlbars": "^6.3.0",
101
- "ember-cli-inject-live-reload": "^2.1.0",
102
- "ember-cli-sri": "^2.1.1",
103
- "ember-cli-terser": "^4.0.2",
104
- "ember-eslint-parser": "^0.2.5",
105
- "ember-load-initializers": "^2.1.2",
106
- "ember-page-title": "^8.1.0",
107
- "ember-qunit": "^7.0.0",
108
- "ember-resolver": "^11.0.1",
109
- "ember-source": "~5.5.0",
110
- "ember-source-channel-url": "^3.0.0",
111
- "ember-template-imports": "^4.0.0",
112
95
  "ember-template-lint": "^5.13.0",
113
- "ember-try": "^3.0.0",
114
- "ember-welcome-page": "^7.0.2",
115
- "eslint": "^8.55.0",
96
+ "eslint": "^8.56.0",
116
97
  "eslint-config-prettier": "^9.1.0",
117
- "eslint-plugin-ember": "^11.11.1",
98
+ "eslint-plugin-ember": "^12.0.0",
118
99
  "eslint-plugin-n": "^16.4.0",
119
100
  "eslint-plugin-prettier": "^5.0.1",
120
- "eslint-plugin-qunit": "^8.0.1",
121
- "loader.js": "^4.7.0",
122
101
  "prettier": "^3.1.1",
123
102
  "prettier-plugin-ember-template-tag": "^2.0.0",
124
- "qunit": "^2.20.0",
125
- "qunit-dom": "^3.0.0",
126
- "release-it": "^16.0.0",
127
- "rimraf": "^5.0.1",
128
- "stylelint": "^16.0.0",
129
- "stylelint-config-standard": "^36.0.0",
130
- "stylelint-prettier": "^5.0.0",
131
- "typescript": "^5.3.3",
132
- "webpack": "^5.89.0"
133
- },
134
- "peerDependencies": {
135
- "@ember/string": "^3.0.1",
136
- "ember-source": ">= 4.12.0"
137
- },
138
- "engines": {
139
- "node": "18.* || >= 20"
103
+ "rollup": "^4.9.1",
104
+ "typescript": "^5.3.3"
140
105
  },
141
106
  "publishConfig": {
142
107
  "registry": "https://registry.npmjs.org"
@@ -145,6 +110,15 @@
145
110
  "edition": "octane"
146
111
  },
147
112
  "ember-addon": {
148
- "configPath": "tests/dummy/config"
113
+ "version": 2,
114
+ "type": "addon",
115
+ "main": "addon-main.cjs",
116
+ "app-js": {
117
+ "./modifiers/style.js": "./dist/_app_/modifiers/style.js"
118
+ }
119
+ },
120
+ "peerDependencies": {
121
+ "@ember/string": "^3.0.1",
122
+ "ember-source": "^3.28.0 || ^4.0.0 || >=5.0.0"
149
123
  }
150
124
  }
package/CHANGELOG.md DELETED
@@ -1,199 +0,0 @@
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
- ## v4.0.0 (2024-01-10)
10
-
11
- #### :boom: Breaking Change
12
- * [#181](https://github.com/jelhan/ember-style-modifier/pull/181) drop support for Ember < 4.12 ([@jelhan](https://github.com/jelhan))
13
- * [#180](https://github.com/jelhan/ember-style-modifier/pull/180) drop support for node 14 and 16 ([@jelhan](https://github.com/jelhan))
14
-
15
- #### :rocket: Enhancement
16
- * [#213](https://github.com/jelhan/ember-style-modifier/pull/213) document Ember compatibility adding a peer dep on ember-source ([@jelhan](https://github.com/jelhan))
17
- * [#211](https://github.com/jelhan/ember-style-modifier/pull/211) better import path for apps using template tag ([@jelhan](https://github.com/jelhan))
18
- * [#210](https://github.com/jelhan/ember-style-modifier/pull/210) Convert to TypeScript and publish types (including Glint) ([@jelhan](https://github.com/jelhan))
19
-
20
- #### :house: Internal
21
- * [#208](https://github.com/jelhan/ember-style-modifier/pull/208) upgrade with Ember CLI v5.5 blueprints ([@jelhan](https://github.com/jelhan))
22
- * [#207](https://github.com/jelhan/ember-style-modifier/pull/207) migrate from yarn v1 to pnpm ([@jelhan](https://github.com/jelhan))
23
-
24
- #### Committers: 1
25
- - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
26
-
27
-
28
- ## v3.1.1 (2024-01-10)
29
-
30
- Published `v3.0.1` again to shadow `v3.1.0` release, which includes breaking changes.
31
-
32
- ## v3.0.1 (2023-02-15)
33
-
34
- #### :bug: Bug Fix
35
- * [#148](https://github.com/jelhan/ember-style-modifier/pull/148) Don't dasherize property names twice ([@drewpereli](https://github.com/drewpereli))
36
-
37
- #### :house: Internal
38
- * [#149](https://github.com/jelhan/ember-style-modifier/pull/149) ember-cli-update to v4.10 ([@jelhan](https://github.com/jelhan))
39
-
40
- #### Committers: 2
41
- - Drew Pereli ([@drewpereli](https://github.com/drewpereli))
42
- - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
43
-
44
- ## v3.0.0 (2023-01-16)
45
-
46
- #### :boom: Breaking Change
47
- * [#139](https://github.com/jelhan/ember-style-modifier/pull/139) Add `@ember/string` as a dependency ([@boris-petrov](https://github.com/boris-petrov))
48
-
49
- #### Committers: 1
50
- - Boris Petrov ([@boris-petrov](https://github.com/boris-petrov))
51
-
52
- ## v2.1.0 (2023-01-13)
53
-
54
- #### :house: Internal
55
- * [#143](https://github.com/jelhan/ember-style-modifier/pull/143) upgrade files created by Ember CLI blueprints to 4.9 ([@jelhan](https://github.com/jelhan))
56
- * [#142](https://github.com/jelhan/ember-style-modifier/pull/142) refactor pure method to pure function for readability ([@jelhan](https://github.com/jelhan))
57
- * [#141](https://github.com/jelhan/ember-style-modifier/pull/141) use Array.flat() instead of complex workaround ([@jelhan](https://github.com/jelhan))
58
- * [#140](https://github.com/jelhan/ember-style-modifier/pull/140) only loop once over styles ([@jelhan](https://github.com/jelhan))
59
-
60
- #### Committers: 1
61
- - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
62
-
63
- ## v2.0.0 (2022-12-22)
64
-
65
- ember-style-modifier v2 requires consuming application to have an explicit
66
- dependency on ember-auto-import@v2. This is the only breaking change introduced.
67
-
68
- Addon authors are encouraged to support both v1 and v2 of ember-style-modifier
69
- in parallel. Instead of replacing ember-style-modifier@^1.0.0 dependency with a
70
- dependency on ember-style-modifier@^2.0.0 widening the version range to
71
- `^1.0.0 || ^2.0.0` is recommended. Widening the version range is _not_ a
72
- change. Doing so allows applications to upgrade to ember-style-modifer@^2.0.0
73
- as soon as all their direct and indirect addons support both.
74
-
75
- #### :boom: Breaking Change
76
- * [#133](https://github.com/jelhan/ember-style-modifier/pull/133) Add ember-auto-import v2 dependency ([@SergeAstapov](https://github.com/SergeAstapov))
77
-
78
- #### :rocket: Enhancement
79
- * [#133](https://github.com/jelhan/ember-style-modifier/pull/133) Widen ember-modifier versions to support v4 ([@SergeAstapov](https://github.com/SergeAstapov))
80
-
81
- #### Committers: 1
82
- - Sergey Astapov ([@SergeAstapov](https://github.com/SergeAstapov))
83
-
84
- ## v1.0.0 (2022-10-14)
85
-
86
- #### :boom: Breaking Change
87
- * [#112](https://github.com/jelhan/ember-style-modifier/pull/112) drop support for Ember 3.24 ([@jelhan](https://github.com/jelhan))
88
- * [#111](https://github.com/jelhan/ember-style-modifier/pull/111) drop support for node 12 ([@jelhan](https://github.com/jelhan))
89
-
90
- #### :house: Internal
91
- * [#117](https://github.com/jelhan/ember-style-modifier/pull/117) document known limitations ([@jelhan](https://github.com/jelhan))
92
- * [#114](https://github.com/jelhan/ember-style-modifier/pull/114) update blueprints to Ember CLI 4.7 ([@jelhan](https://github.com/jelhan))
93
- * [#94](https://github.com/jelhan/ember-style-modifier/pull/94) Update Ember to v4.3 ([@bertdeblock](https://github.com/bertdeblock))
94
- * [#93](https://github.com/jelhan/ember-style-modifier/pull/93) Update `.npmignore` file ([@bertdeblock](https://github.com/bertdeblock))
95
- * [#92](https://github.com/jelhan/ember-style-modifier/pull/92) Update CI badge in README ([@bertdeblock](https://github.com/bertdeblock))
96
-
97
- #### Committers: 2
98
- - Bert De Block ([@bertdeblock](https://github.com/bertdeblock))
99
- - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
100
-
101
- ## v0.8.0 (2022-04-08)
102
-
103
- #### :rocket: Enhancement
104
- * [#88](https://github.com/jelhan/ember-style-modifier/pull/88) Resolve `ember-modifier` deprecations ([@bertdeblock](https://github.com/bertdeblock))
105
-
106
- #### Committers: 1
107
- - Bert De Block ([@bertdeblock](https://github.com/bertdeblock))
108
-
109
- ## v0.7.0 (2021-10-27)
110
-
111
- #### :boom: Breaking Change
112
- * [#71](https://github.com/jelhan/ember-style-modifier/pull/71) add Ember Auto Import v2 ([@jelhan](https://github.com/jelhan))
113
- * [#60](https://github.com/jelhan/ember-style-modifier/pull/60) Update dependency ember-modifier to v3 ([@renovate[bot]](https://github.com/apps/renovate))
114
- * [#67](https://github.com/jelhan/ember-style-modifier/pull/67) drop support for Ember < 3.24 ([@jelhan](https://github.com/jelhan))
115
- * [#57](https://github.com/jelhan/ember-style-modifier/pull/57) drop support for Ember 3.4 ([@jelhan](https://github.com/jelhan))
116
- * [#58](https://github.com/jelhan/ember-style-modifier/pull/58) drop support for node 10 ([@jelhan](https://github.com/jelhan))
117
-
118
- #### :house: Internal
119
- * [#72](https://github.com/jelhan/ember-style-modifier/pull/72) fix CSP for Embroider builds ([@jelhan](https://github.com/jelhan))
120
- * [#68](https://github.com/jelhan/ember-style-modifier/pull/68) upgrade addon blueprints to Ember CLI 3.28 ([@jelhan](https://github.com/jelhan))
121
- * [#51](https://github.com/jelhan/ember-style-modifier/pull/51) Create ember-try scenarios for `no-deprecations` ([@mansona](https://github.com/mansona))
122
- * [#39](https://github.com/jelhan/ember-style-modifier/pull/39) upgrade to Ember 3.24 ([@jelhan](https://github.com/jelhan))
123
- * [#64](https://github.com/jelhan/ember-style-modifier/pull/64) finish all scenarios in CI even if one fails ([@jelhan](https://github.com/jelhan))
124
- * [#28](https://github.com/jelhan/ember-style-modifier/pull/28) Upgrade Ember CLI to 3.21 ([@jelhan](https://github.com/jelhan))
125
- * [#20](https://github.com/jelhan/ember-style-modifier/pull/20) Configure Renovate ([@renovate[bot]](https://github.com/apps/renovate))
126
-
127
- #### Committers: 2
128
- - Chris Manson ([@mansona](https://github.com/mansona))
129
- - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
130
-
131
- ## v0.6.0 (2020-08-03)
132
-
133
- #### :boom: Breaking Change
134
- * [#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))
135
-
136
- #### Committers: 2
137
- - Andrey Fel ([@andreyfel](https://github.com/andreyfel))
138
- - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
139
-
140
- ## v0.5.0 (2019-12-04)
141
-
142
- #### :boom: Breaking Change
143
- * [#12](https://github.com/jelhan/ember-style-modifier/pull/12) use public APIs through ember-modifier and upgrade dependencies ([@andreyfel](https://github.com/andreyfel))
144
-
145
- #### :house: Internal
146
- * [#14](https://github.com/jelhan/ember-style-modifier/pull/14) automate releases with release-it and lerna-changelog ([@jelhan](https://github.com/jelhan))
147
- * [#12](https://github.com/jelhan/ember-style-modifier/pull/12) use public APIs through ember-modifier and upgrade dependencies ([@andreyfel](https://github.com/andreyfel))
148
-
149
- #### Committers: 2
150
- - Andrey Fel ([@andreyfel](https://github.com/andreyfel))
151
- - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
152
-
153
-
154
- ## v0.4.1 (2019-03-28)
155
-
156
- #### :rocket: Enhancement
157
- * [#10](https://github.com/jelhan/ember-style-modifier/pull/10) better assertion message for wrong value type ([@jelhan](https://github.com/jelhan))
158
-
159
- #### Committers: 1
160
- - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
161
-
162
-
163
- ## v0.4.0 (2019-03-18)
164
-
165
- #### :house: Internal
166
- * [#8](https://github.com/jelhan/ember-style-modifier/pull/8) refactor: drop ember-functional-modifiers ([@buschtoens](https://github.com/buschtoens))
167
-
168
- #### Committers: 1
169
- - Jan Buschtöns ([@buschtoens](https://github.com/buschtoens))
170
-
171
-
172
- ## v0.3.0 (2019-03-13)
173
-
174
- #### :rocket: Enhancement
175
- * [#6](https://github.com/jelhan/ember-style-modifier/pull/6) support setting CSS rules using a POJO ([@jelhan](https://github.com/jelhan))
176
-
177
- #### Committers: 1
178
- - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
179
-
180
-
181
- ## v0.2.0 (2019-03-12)
182
-
183
- #### :boom: Breaking Change
184
- * [#4](https://github.com/jelhan/ember-style-modifier/pull/4) support a more compact style for declaring CSS rules ([@jelhan](https://github.com/jelhan))
185
-
186
- #### :rocket: Enhancement
187
- * [#4](https://github.com/jelhan/ember-style-modifier/pull/4) support a more compact style for declaring CSS rules ([@jelhan](https://github.com/jelhan))
188
-
189
- #### Committers: 1
190
- - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
191
-
192
-
193
- ## v0.1.0 (2019-03-11)
194
-
195
- Initial proof of concept
196
-
197
- #### Committers: 1
198
- - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
199
- -
package/addon/index.ts DELETED
@@ -1 +0,0 @@
1
- export { default } from './modifiers/style';
@@ -1,5 +0,0 @@
1
- import type StyleModifier from './modifiers/style';
2
-
3
- export default interface EmberStyleModifierRegistry {
4
- style: typeof StyleModifier;
5
- }
@@ -1 +0,0 @@
1
- export { default } from 'ember-style-modifier/modifiers/style';
@@ -1,2 +0,0 @@
1
- export { default } from './modifiers/style';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../addon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../addon/modifiers/style.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAStC,KAAK,SAAS,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAgCvD,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE;QACJ,UAAU,EAAE,SAAS,EAAE,CAAC;QACxB,KAAK,EAAE,SAAS,CAAC;KAClB,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,QAAQ,CAAC,sBAAsB,CAAC;IACzE,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAa;IAExC,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;IAsC7D,MAAM,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,SAAS;CAG5E"}
@@ -1,5 +0,0 @@
1
- import type StyleModifier from './modifiers/style';
2
- export default interface EmberStyleModifierRegistry {
3
- style: typeof StyleModifier;
4
- }
5
- //# sourceMappingURL=template-registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-registry.d.ts","sourceRoot":"","sources":["../../addon/template-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAC;AAEnD,MAAM,CAAC,OAAO,WAAW,0BAA0B;IACjD,KAAK,EAAE,OAAO,aAAa,CAAC;CAC7B"}
package/index.js DELETED
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- name: require('./package').name,
5
-
6
- options: {
7
- 'ember-cli-babel': { enableTypeScriptTransform: true },
8
- },
9
- };
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "declarationDir": "declarations",
5
- "emitDeclarationOnly": true,
6
- "noEmit": false,
7
- "rootDir": "."
8
- },
9
- "include": ["addon", "addon-test-support"]
10
- }
package/tsconfig.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "extends": "@tsconfig/ember/tsconfig.json",
3
- "compilerOptions": {
4
- // The combination of `baseUrl` with `paths` allows Ember's classic package
5
- // layout, which is not resolvable with the Node resolution algorithm, to
6
- // work with TypeScript.
7
- "baseUrl": ".",
8
- "paths": {
9
- "dummy/tests/*": ["tests/*"],
10
- "dummy/*": ["tests/dummy/app/*", "app/*"],
11
- "ember-style-modifier": ["addon"],
12
- "ember-style-modifier/*": ["addon/*"],
13
- "ember-style-modifier/test-support": ["addon-test-support"],
14
- "ember-style-modifier/test-support/*": ["addon-test-support/*"],
15
- "*": ["types/*"]
16
- }
17
- },
18
- "glint": {
19
- "environment": ["ember-loose", "ember-template-imports"]
20
- }
21
- }
package/types/global.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import '@glint/environment-ember-loose';
2
- import EmberStyleModifierRegistry from 'ember-style-modifier/template-registry';
3
-
4
- declare module '@glint/environment-ember-loose/registry' {
5
- export default interface Registry extends EmberStyleModifierRegistry {}
6
- }