@o3r/design 10.0.0-prerelease.101 → 10.0.0-prerelease.102

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/design",
3
- "version": "10.0.0-prerelease.101",
3
+ "version": "10.0.0-prerelease.102",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -50,9 +50,9 @@
50
50
  "tslib": "^2.5.3"
51
51
  },
52
52
  "peerDependencies": {
53
- "@o3r/core": "^10.0.0-prerelease.101",
54
- "@o3r/schematics": "^10.0.0-prerelease.101",
55
- "@o3r/styling": "^10.0.0-prerelease.101",
53
+ "@o3r/core": "^10.0.0-prerelease.102",
54
+ "@o3r/schematics": "^10.0.0-prerelease.102",
55
+ "@o3r/styling": "^10.0.0-prerelease.102",
56
56
  "chokidar": "^3.5.2",
57
57
  "globby": "^11.1.0",
58
58
  "minimatch": "~9.0.3",
@@ -99,12 +99,12 @@
99
99
  "@nx/eslint-plugin": "~18.0.2",
100
100
  "@nx/jest": "~18.0.2",
101
101
  "@nx/js": "~18.0.2",
102
- "@o3r/build-helpers": "^10.0.0-prerelease.101",
103
- "@o3r/core": "^10.0.0-prerelease.101",
104
- "@o3r/eslint-plugin": "^10.0.0-prerelease.101",
105
- "@o3r/schematics": "^10.0.0-prerelease.101",
106
- "@o3r/styling": "^10.0.0-prerelease.101",
107
- "@o3r/test-helpers": "^10.0.0-prerelease.101",
102
+ "@o3r/build-helpers": "^10.0.0-prerelease.102",
103
+ "@o3r/core": "^10.0.0-prerelease.102",
104
+ "@o3r/eslint-plugin": "^10.0.0-prerelease.102",
105
+ "@o3r/schematics": "^10.0.0-prerelease.102",
106
+ "@o3r/styling": "^10.0.0-prerelease.102",
107
+ "@o3r/test-helpers": "^10.0.0-prerelease.102",
108
108
  "@schematics/angular": "~17.2.0",
109
109
  "@stylistic/eslint-plugin-ts": "^1.5.4",
110
110
  "@types/jest": "~29.5.2",
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/extract-token/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAM7D;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,4BAA4B,GAAG,IAAI,CA2FxE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/extract-token/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAM7D;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,4BAA4B,GAAG,IAAI,CA8FxE"}
@@ -43,7 +43,10 @@ function extractToken(options) {
43
43
  const isPrivate = file.endsWith('theme.scss');
44
44
  const tokenSpecification = variables
45
45
  .reduce((node, variable) => {
46
- const namePath = variable.name.split('-');
46
+ const nameSplit = variable.name.split('-');
47
+ const namePath = options.flattenLevel === undefined
48
+ ? nameSplit
49
+ : [...nameSplit.slice(0, options.flattenLevel), nameSplit.slice(options.flattenLevel).join('.')].filter((item) => !!item);
47
50
  let targetNode = node;
48
51
  namePath.forEach((name) => {
49
52
  targetNode[name] ||= {};
@@ -10,5 +10,7 @@ export interface ExtractTokenSchematicsSchema extends SchematicOptionObject {
10
10
  };
11
11
  /** List of file pattern of component theme files */
12
12
  componentFilePatterns: string[];
13
+ /** Level from which to flatten the token nodes */
14
+ flattenLevel?: number;
13
15
  }
14
16
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/extract-token/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACzE;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAE7D,oDAAoD;IACpD,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACjC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/extract-token/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACzE;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAE7D,oDAAoD;IACpD,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAEhC,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
@@ -34,6 +34,10 @@
34
34
  "items": {
35
35
  "type": "string"
36
36
  }
37
+ },
38
+ "flattenLevel": {
39
+ "description": "Level from which to flatten the token nodes (let it empty to not flatten the token nodes)",
40
+ "type": "number"
37
41
  }
38
42
  },
39
43
  "additionalProperties": true,