@ama-styling/style-dictionary 13.6.0-prerelease.3 → 13.6.0-prerelease.5

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/README.md CHANGED
@@ -55,7 +55,7 @@ The property can be applied to the Token directly as follows:
55
55
  }
56
56
  ```
57
57
 
58
- or in a dedicated `.extensions.json` file (when the [o3r/json-parser/extensions](#parsers) parser is loaded):
58
+ or in a dedicated `.extensions.json` file (when the [ama/json-parser/extensions](#parsers) parser is loaded):
59
59
 
60
60
  ```json5
61
61
  // color.token.json
@@ -84,13 +84,13 @@ or in a dedicated `.extensions.json` file (when the [o3r/json-parser/extensions]
84
84
 
85
85
  | Extensions | Type | Description | Required hooks |
86
86
  | ----------------- |----------------------------------------------------------------------------------------------------------------------------------------------------------| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
87
- | o3rPrivate | `boolean` | Determine if the token is flagged as private | pre-processor: **o3r/pre-processor/extensions** <br />formatter: **o3r/css/variable** |
88
- | o3rImportant | `boolean` | Determine if the token should be flagged as important when generated | pre-processor: **o3r/pre-processor/extensions** <br />formatter: **o3r/css/variable** |
89
- | o3rScope | `string` | Scope to apply to the generated variable | pre-processor: **o3r/pre-processor/extensions** <br />formatter: **o3r/css/variable** |
90
- | o3rMetadata | [CMS Metadata](https://github.com/AmadeusITGroup/otter/blob/main/packages/%40ama-styling/style-dictionary/src/interfaces/style-dictionary-interface.mts) | Additional information to provide to the metadata if generated | pre-processor: **o3r/pre-processor/extensions** <br />formatter: **o3r/json/metadata** |
91
- | o3rUnit | `string` | Convert a numeric value from the specified unit to the new unit. It will add a unit to the tokens of type \"number\" for which the unit is not specified.<br />In the case of complex types (such as shadow, transition, etc...), the unit will be applied to all numeric types they contain. | pre-processor: **o3r/pre-processor/extensions** <br />transforms: **o3r/transform/unit** |
92
- | o3rRatio | `number` | Ratio to apply to the previous value. The ratio will only be applied to tokens of type \"number\" or to the first numbers determined in \"string\" like types.<br />In the case of complex types (such as shadow, transition, etc...), the ratio will be applied to all numeric types they contain. | pre-processor: **o3r/pre-processor/extensions** <br />transforms: **o3r/transform/ratio** |
93
- | o3rExpectOverride | `boolean` | Indicate that the token is expected to be overridden by external rules | pre-processor: **o3r/pre-processor/extensions** |
87
+ | o3rPrivate | `boolean` | Determine if the token is flagged as private | pre-processor: **ama/pre-processor/extensions** <br />formatter: **ama/css/variable** |
88
+ | o3rImportant | `boolean` | Determine if the token should be flagged as important when generated | pre-processor: **ama/pre-processor/extensions** <br />formatter: **ama/css/variable** |
89
+ | o3rScope | `string` | Scope to apply to the generated variable | pre-processor: **ama/pre-processor/extensions** <br />formatter: **ama/css/variable** |
90
+ | o3rMetadata | [CMS Metadata](https://github.com/AmadeusITGroup/otter/blob/main/packages/%40ama-styling/style-dictionary/src/interfaces/style-dictionary-interface.mts) | Additional information to provide to the metadata if generated | pre-processor: **ama/pre-processor/extensions** <br />formatter: **ama/json/metadata** |
91
+ | o3rUnit | `string` | Convert a numeric value from the specified unit to the new unit. It will add a unit to the tokens of type \"number\" for which the unit is not specified.<br />In the case of complex types (such as shadow, transition, etc...), the unit will be applied to all numeric types they contain. | pre-processor: **ama/pre-processor/extensions** <br />transforms: **ama/transform/unit** |
92
+ | o3rRatio | `number` | Ratio to apply to the previous value. The ratio will only be applied to tokens of type \"number\" or to the first numbers determined in \"string\" like types.<br />In the case of complex types (such as shadow, transition, etc...), the ratio will be applied to all numeric types they contain. | pre-processor: **ama/pre-processor/extensions** <br />transforms: **ama/transform/ratio** |
93
+ | o3rExpectOverride | `boolean` | Indicate that the token is expected to be overridden by external rules | pre-processor: **ama/pre-processor/extensions** |
94
94
 
95
95
  > [!WARNING]
96
96
  > The **required hooks** need to be registered to the [Style Dictionary configuration](https://styledictionary.com/reference/config/) to fully support the extension.
@@ -101,34 +101,34 @@ or in a dedicated `.extensions.json` file (when the [o3r/json-parser/extensions]
101
101
 
102
102
  | Name | Matching files | Description |
103
103
  | ------------------------------ | ---------------------- | -------------------------------------------------------------------------------- |
104
- | o3r/json-parser/one-line-token | `**/*.json` | Allow *dot notation* Token in JSON file |
105
- | o3r/json-parser/extensions | `**/*.extensions.json` | Parse file containing `$extensions` instructions to apply on top of Design Token |
104
+ | ama/json-parser/one-line-token | `**/*.json` | Allow *dot notation* Token in JSON file |
105
+ | ama/json-parser/extensions | `**/*.extensions.json` | Parse file containing `$extensions` instructions to apply on top of Design Token |
106
106
 
107
107
  ### [Pre-processor](https://styledictionary.com/reference/hooks/preprocessors/)
108
108
 
109
109
  | Name | Description |
110
110
  | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
111
- | o3r/pre-processor/extensions | Pre-processor to add the support of the `$extensions` instructions in the Token (or dedicated `extensions.json` file). This pre-processor is mandatory for any Otter hooks. |
111
+ | ama/pre-processor/extensions | Pre-processor to add the support of the `$extensions` instructions in the Token (or dedicated `extensions.json` file). This pre-processor is mandatory for any Otter hooks. |
112
112
 
113
113
  ### [Transforms](https://styledictionary.com/reference/hooks/transforms/)
114
114
 
115
115
  | Name | Type | Criteria | Description |
116
116
  | ------------------- | ------- | -------------------------------- | --------------------------------------------------------------------------------------- |
117
- | o3r/transform/ratio | `value` | `o3rRatio` extension is provided | Apply the given `o3rRatio` to the numeric values of the Token(s) it refers to. |
118
- | o3r/transform/unit | `value` | `o3rUnit` extension is provided | Replace the unit of the values of the Token(s) it refers to, by the provided `o3rUnit`. |
117
+ | ama/transform/ratio | `value` | `o3rRatio` extension is provided | Apply the given `o3rRatio` to the numeric values of the Token(s) it refers to. |
118
+ | ama/transform/unit | `value` | `o3rUnit` extension is provided | Replace the unit of the values of the Token(s) it refers to, by the provided `o3rUnit`. |
119
119
 
120
120
  ### [Transform-groups](https://styledictionary.com/reference/hooks/transform-groups/)
121
121
 
122
122
  | Name | Description |
123
123
  | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
124
- | o3r/css/recommended | Extend the official [CSS transform groups](https://styledictionary.com/reference/hooks/transform-groups/predefined/#css) by adding `o3r/transform/ratio` and `o3r/transform/unit` |
124
+ | ama/css/recommended | Extend the official [CSS transform groups](https://styledictionary.com/reference/hooks/transform-groups/predefined/#css) by adding `ama/transform/ratio` and `ama/transform/unit` |
125
125
 
126
126
  ### [Formats](https://styledictionary.com/reference/hooks/formats/)
127
127
 
128
128
  | Name | Options | Description |
129
129
  | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
130
- | o3r/css/variable | See [css/variables options](https://styledictionary.com/reference/hooks/formats/predefined/#cssvariables) | Render CSS variable block (based on the [built-in format](https://styledictionary.com/reference/hooks/formats/predefined/#cssvariables)) supporting additional [Otter Extensions features](#enhancement). |
131
- | o3r/json/metadata | See [css/variables options](https://styledictionary.com/reference/hooks/formats/predefined/#cssvariables) *(applied to `defaultValue`)*<br />- **keepPrivate**: include private variables | Render [CMS style metadata](https://github.com/AmadeusITGroup/otter/blob/main/docs/styling/THEME.md). |
130
+ | ama/css/variable | See [css/variables options](https://styledictionary.com/reference/hooks/formats/predefined/#cssvariables) | Render CSS variable block (based on the [built-in format](https://styledictionary.com/reference/hooks/formats/predefined/#cssvariables)) supporting additional [Otter Extensions features](#enhancement). |
131
+ | ama/json/metadata | See [css/variables options](https://styledictionary.com/reference/hooks/formats/predefined/#cssvariables) *(applied to `defaultValue`)*<br />- **keepPrivate**: include private variables | Render [CMS style metadata](https://github.com/AmadeusITGroup/otter/blob/main/docs/styling/THEME.md). |
132
132
 
133
133
  ### Registration process
134
134
 
@@ -235,7 +235,7 @@ const sd = new StyleDictionary({
235
235
  options: {
236
236
  outputReferences: true // to output `--var: var(--other-var)` instead of the value of `--other-var`
237
237
  },
238
- transformGroup: 'o3r/css/recommended',
238
+ transformGroup: 'ama/css/recommended',
239
239
  files: [
240
240
  ...getTargetFiles(fileRules, { format: 'css' }),
241
241
  // default CSS file where generate variables
@@ -246,9 +246,9 @@ const sd = new StyleDictionary({
246
246
  options: {
247
247
  outputReferences: true
248
248
  },
249
- transformGroup: 'o3r/css/recommended',
249
+ transformGroup: 'ama/css/recommended',
250
250
  files: [
251
- { destination: 'style.metadata.json', format: 'o3r/json/metadata' }
251
+ { destination: 'style.metadata.json', format: 'ama/json/metadata' }
252
252
  ]
253
253
  }
254
254
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ama-styling/style-dictionary",
3
- "version": "13.6.0-prerelease.3",
3
+ "version": "13.6.0-prerelease.5",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -41,14 +41,14 @@
41
41
  "dependencies": {
42
42
  "@angular-devkit/architect": "0.2003.13",
43
43
  "@angular-devkit/schematics": "~20.3.13",
44
- "@o3r/schematics": "~13.6.0-prerelease.3",
44
+ "@o3r/schematics": "~13.6.0-prerelease.5",
45
45
  "@schematics/angular": "~20.3.13",
46
46
  "tslib": "^2.6.2"
47
47
  },
48
48
  "peerDependencies": {
49
- "@o3r/core": "~13.6.0-prerelease.3",
50
- "@o3r/schematics": "~13.6.0-prerelease.3",
51
- "@o3r/telemetry": "~13.6.0-prerelease.3",
49
+ "@o3r/core": "~13.6.0-prerelease.5",
50
+ "@o3r/schematics": "~13.6.0-prerelease.5",
51
+ "@o3r/telemetry": "~13.6.0-prerelease.5",
52
52
  "style-dictionary": "^5.0.0",
53
53
  "type-fest": "^4.30.1"
54
54
  },
@@ -82,11 +82,11 @@
82
82
  "@nx/eslint-plugin": "~21.6.0",
83
83
  "@nx/jest": "~21.6.0",
84
84
  "@nx/js": "~21.6.0",
85
- "@o3r/build-helpers": "~13.6.0-prerelease.3",
86
- "@o3r/core": "~13.6.0-prerelease.3",
87
- "@o3r/eslint-plugin": "~13.6.0-prerelease.3",
88
- "@o3r/telemetry": "~13.6.0-prerelease.3",
89
- "@o3r/test-helpers": "~13.6.0-prerelease.3",
85
+ "@o3r/build-helpers": "~13.6.0-prerelease.5",
86
+ "@o3r/core": "~13.6.0-prerelease.5",
87
+ "@o3r/eslint-plugin": "~13.6.0-prerelease.5",
88
+ "@o3r/telemetry": "~13.6.0-prerelease.5",
89
+ "@o3r/test-helpers": "~13.6.0-prerelease.5",
90
90
  "@schematics/angular": "~20.3.13",
91
91
  "@stylistic/eslint-plugin": "~5.6.0",
92
92
  "@types/jest": "~30.0.0",
package/src/presets.d.mts CHANGED
@@ -6,7 +6,7 @@ import StyleDictionary from 'style-dictionary';
6
6
  export declare const register: (styleDictionary?: StyleDictionary) => void;
7
7
  /** Base configuration for Otter Extension */
8
8
  export declare const baseConfig: {
9
- readonly preprocessors: ["o3r/pre-processor/extensions"];
10
- readonly parsers: ["o3r/json-parser/one-line-token", "o3r/json-parser/extensions"];
9
+ readonly preprocessors: [string];
10
+ readonly parsers: [string, string];
11
11
  };
12
12
  //# sourceMappingURL=presets.d.mts.map
package/src/presets.mjs CHANGED
@@ -24,10 +24,10 @@ export const register = (styleDictionary) => {
24
24
  };
25
25
  /** Base configuration for Otter Extension */
26
26
  export const baseConfig = {
27
- preprocessors: ['o3r/pre-processor/extensions'],
27
+ preprocessors: [extensionPropagatePreprocessor.name],
28
28
  parsers: [
29
- 'o3r/json-parser/one-line-token',
30
- 'o3r/json-parser/extensions'
29
+ oneLineTokenJsonParser.name,
30
+ extensionsJsonParser.name
31
31
  ]
32
32
  };
33
33
  //# sourceMappingURL=presets.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"presets.mjs","sourceRoot":"","sources":["../../src/presets.mts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAI/C,OAAO,EACL,SAAS,GACV,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,cAAc,GACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,oBAAoB,GACrB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,sBAAsB,GACvB,MAAM,0CAA0C,CAAC;AAClD,OA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