ember-style-modifier 4.0.0 → 4.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
@@ -6,6 +6,15 @@
6
6
 
7
7
 
8
8
 
9
+
10
+ ## v4.1.0 (2024-01-11)
11
+
12
+ #### :rocket: Enhancement
13
+ * [#216](https://github.com/jelhan/ember-style-modifier/pull/216) improve typing of CSS styles using csstype package ([@jelhan](https://github.com/jelhan))
14
+
15
+ #### Committers: 1
16
+ - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
17
+
9
18
  ## v4.0.0 (2024-01-10)
10
19
 
11
20
  #### :boom: Breaking Change
@@ -2,12 +2,13 @@ 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
+ import type * as CSS from 'csstype';
5
6
 
6
7
  // Cannot be typed as `Partial<CSSStyleDeclaration>` because `CSSStyleDeclaration`
7
8
  // interface does _not_ included dashed CSS property names. It only includes the
8
9
  // camelCase version of a CSS property.
9
10
  // https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1672
10
- type CSSStyles = { [key: string]: string | undefined };
11
+ type CSSStyles = Partial<CSS.Properties> | Partial<CSS.PropertiesHyphen>;
11
12
 
12
13
  function isObject(o: unknown): boolean {
13
14
  return typeof o === 'object' && Boolean(o);
@@ -1,7 +1,6 @@
1
1
  import Modifier from 'ember-modifier';
2
- type CSSStyles = {
3
- [key: string]: string | undefined;
4
- };
2
+ import type * as CSS from 'csstype';
3
+ type CSSStyles = Partial<CSS.Properties> | Partial<CSS.PropertiesHyphen>;
5
4
  export interface StyleModifierSignature {
6
5
  Element: HTMLElement;
7
6
  Args: {
@@ -1 +1 @@
1
- {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../addon/modifiers/style.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;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7D,MAAM,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,SAAS;CAG5E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-style-modifier",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "{{style}} modifier to set an element's style using the CSSStyleDeclaration API.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -48,6 +48,7 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@babel/core": "^7.23.6",
51
+ "csstype": "^3.1.3",
51
52
  "ember-auto-import": "^2.7.0",
52
53
  "ember-cli-babel": "^8.2.0",
53
54
  "ember-modifier": "^3.2.7 || ^4.0.0"