@angular/material 15.0.0-rc.1 → 15.0.0-rc.2

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.
Files changed (52) hide show
  1. package/_index.scss +1 -1
  2. package/checkbox/_checkbox-private.scss +1 -1
  3. package/chips/index.d.ts +0 -2
  4. package/core/density/private/_all-density.scss +5 -9
  5. package/core/theming/_all-theme.scss +14 -18
  6. package/core/typography/_all-typography.scss +15 -19
  7. package/core/typography/_typography-deprecated.scss +1 -1
  8. package/core/typography/_typography.scss +130 -0
  9. package/esm2020/chips/chip-option.mjs +5 -11
  10. package/esm2020/core/version.mjs +1 -1
  11. package/esm2020/stepper/step-header.mjs +2 -2
  12. package/esm2020/stepper/stepper.mjs +3 -3
  13. package/esm2020/tabs/tab-header.mjs +2 -2
  14. package/esm2020/tabs/tab-nav-bar/tab-nav-bar.mjs +97 -97
  15. package/fesm2015/chips.mjs +4 -10
  16. package/fesm2015/chips.mjs.map +1 -1
  17. package/fesm2015/core.mjs +1 -1
  18. package/fesm2015/core.mjs.map +1 -1
  19. package/fesm2015/stepper.mjs +4 -4
  20. package/fesm2015/stepper.mjs.map +1 -1
  21. package/fesm2015/tabs.mjs +112 -112
  22. package/fesm2015/tabs.mjs.map +1 -1
  23. package/fesm2020/chips.mjs +4 -10
  24. package/fesm2020/chips.mjs.map +1 -1
  25. package/fesm2020/core.mjs +1 -1
  26. package/fesm2020/core.mjs.map +1 -1
  27. package/fesm2020/stepper.mjs +4 -4
  28. package/fesm2020/stepper.mjs.map +1 -1
  29. package/fesm2020/tabs.mjs +110 -110
  30. package/fesm2020/tabs.mjs.map +1 -1
  31. package/legacy-core/density/private/_all-density.scss +10 -2
  32. package/legacy-core/theming/_all-theme.scss +29 -2
  33. package/legacy-core/typography/_all-typography.scss +31 -2
  34. package/legacy-prebuilt-themes/legacy-deeppurple-amber.css +1 -1
  35. package/legacy-prebuilt-themes/legacy-indigo-pink.css +1 -1
  36. package/legacy-prebuilt-themes/legacy-pink-bluegrey.css +1 -1
  37. package/legacy-prebuilt-themes/legacy-purple-green.css +1 -1
  38. package/package.json +2 -2
  39. package/prebuilt-themes/deeppurple-amber.css +1 -1
  40. package/prebuilt-themes/indigo-pink.css +1 -1
  41. package/prebuilt-themes/pink-bluegrey.css +1 -1
  42. package/prebuilt-themes/purple-green.css +1 -1
  43. package/radio/_radio-theme.scss +1 -1
  44. package/schematics/ng-add/index.js +1 -1
  45. package/schematics/ng-add/index.mjs +1 -1
  46. package/schematics/ng-generate/mdc-migration/index_bundled.js +240 -51
  47. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +3 -3
  48. package/schematics/ng-generate/mdc-migration/mdc_migration_bundle_metadata.json +1 -1
  49. package/schematics/ng-update/index_bundled.js +2 -1
  50. package/schematics/ng-update/index_bundled.js.map +2 -2
  51. package/schematics/ng-update/ng_update_index_metadata.json +1 -1
  52. package/tabs/index.d.ts +1 -1
@@ -28,7 +28,7 @@
28
28
 
29
29
  @include mdc-helpers.using-mdc-theme($config) {
30
30
  $on-surface: rgba(mdc-theme-color.$on-surface, 0.54);
31
- $is-dark: map-get($config, is-dark);
31
+ $is-dark: map.get($config, is-dark);
32
32
  $active-border-color: if(
33
33
  $is-dark,
34
34
  theming.get-color-from-palette(palette.$gray-palette, 200),
@@ -18,7 +18,7 @@ const package_config_1 = require("./package-config");
18
18
  * Note that the fallback version range does not use caret, but tilde because that is
19
19
  * the default for Angular framework dependencies in CLI projects.
20
20
  */
21
- const fallbackMaterialVersionRange = `~15.0.0-rc.1`;
21
+ const fallbackMaterialVersionRange = `~15.0.0-rc.2`;
22
22
  /**
23
23
  * Schematic factory entry-point for the `ng-add` schematic. The ng-add schematic will be
24
24
  * automatically executed if developers run `ng add @angular/material`.
@@ -18,7 +18,7 @@ const package_config_1 = require("./package-config");
18
18
  * Note that the fallback version range does not use caret, but tilde because that is
19
19
  * the default for Angular framework dependencies in CLI projects.
20
20
  */
21
- const fallbackMaterialVersionRange = `~15.0.0-rc.1`;
21
+ const fallbackMaterialVersionRange = `~15.0.0-rc.2`;
22
22
  /**
23
23
  * Schematic factory entry-point for the `ng-add` schematic. The ng-add schematic will be
24
24
  * automatically executed if developers run `ng add @angular/material`.
@@ -1962,9 +1962,9 @@ var require_source_map_generator = __commonJS({
1962
1962
  var mapping;
1963
1963
  var nameIdx;
1964
1964
  var sourceIdx;
1965
- var mappings = this._mappings.toArray();
1966
- for (var i = 0, len = mappings.length; i < len; i++) {
1967
- mapping = mappings[i];
1965
+ var mappings2 = this._mappings.toArray();
1966
+ for (var i = 0, len = mappings2.length; i < len; i++) {
1967
+ mapping = mappings2[i];
1968
1968
  next = "";
1969
1969
  if (mapping.generatedLine !== previousGeneratedLine) {
1970
1970
  previousGeneratedColumn = 0;
@@ -1974,7 +1974,7 @@ var require_source_map_generator = __commonJS({
1974
1974
  }
1975
1975
  } else {
1976
1976
  if (i > 0) {
1977
- if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
1977
+ if (!util.compareByGeneratedPositionsInflated(mapping, mappings2[i - 1])) {
1978
1978
  continue;
1979
1979
  }
1980
1980
  next += ",";
@@ -2190,13 +2190,13 @@ var require_source_map_consumer = __commonJS({
2190
2190
  SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
2191
2191
  var context = aContext || null;
2192
2192
  var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
2193
- var mappings;
2193
+ var mappings2;
2194
2194
  switch (order) {
2195
2195
  case SourceMapConsumer.GENERATED_ORDER:
2196
- mappings = this._generatedMappings;
2196
+ mappings2 = this._generatedMappings;
2197
2197
  break;
2198
2198
  case SourceMapConsumer.ORIGINAL_ORDER:
2199
- mappings = this._originalMappings;
2199
+ mappings2 = this._originalMappings;
2200
2200
  break;
2201
2201
  default:
2202
2202
  throw new Error("Unknown order of iteration.");
@@ -2206,8 +2206,8 @@ var require_source_map_consumer = __commonJS({
2206
2206
  var names = this._names;
2207
2207
  var sources = this._sources;
2208
2208
  var sourceMapURL = this._sourceMapURL;
2209
- for (var i = 0, n = mappings.length; i < n; i++) {
2210
- var mapping = mappings[i];
2209
+ for (var i = 0, n = mappings2.length; i < n; i++) {
2210
+ var mapping = mappings2[i];
2211
2211
  var source = mapping.source === null ? null : sources.at(mapping.source);
2212
2212
  source = util.computeSourceURL(sourceRoot, source, sourceMapURL);
2213
2213
  boundCallback({
@@ -2231,14 +2231,14 @@ var require_source_map_consumer = __commonJS({
2231
2231
  if (needle.source < 0) {
2232
2232
  return [];
2233
2233
  }
2234
- var mappings = [];
2234
+ var mappings2 = [];
2235
2235
  var index2 = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND);
2236
2236
  if (index2 >= 0) {
2237
2237
  var mapping = this._originalMappings[index2];
2238
2238
  if (aArgs.column === void 0) {
2239
2239
  var originalLine = mapping.originalLine;
2240
2240
  while (mapping && mapping.originalLine === originalLine) {
2241
- mappings.push({
2241
+ mappings2.push({
2242
2242
  line: util.getArg(mapping, "generatedLine", null),
2243
2243
  column: util.getArg(mapping, "generatedColumn", null),
2244
2244
  lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
@@ -2248,7 +2248,7 @@ var require_source_map_consumer = __commonJS({
2248
2248
  } else {
2249
2249
  var originalColumn = mapping.originalColumn;
2250
2250
  while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
2251
- mappings.push({
2251
+ mappings2.push({
2252
2252
  line: util.getArg(mapping, "generatedLine", null),
2253
2253
  column: util.getArg(mapping, "generatedColumn", null),
2254
2254
  lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
@@ -2257,7 +2257,7 @@ var require_source_map_consumer = __commonJS({
2257
2257
  }
2258
2258
  }
2259
2259
  }
2260
- return mappings;
2260
+ return mappings2;
2261
2261
  };
2262
2262
  exports.SourceMapConsumer = SourceMapConsumer;
2263
2263
  function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
@@ -2270,7 +2270,7 @@ var require_source_map_consumer = __commonJS({
2270
2270
  var names = util.getArg(sourceMap, "names", []);
2271
2271
  var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
2272
2272
  var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
2273
- var mappings = util.getArg(sourceMap, "mappings");
2273
+ var mappings2 = util.getArg(sourceMap, "mappings");
2274
2274
  var file = util.getArg(sourceMap, "file", null);
2275
2275
  if (version != this._version) {
2276
2276
  throw new Error("Unsupported version: " + version);
@@ -2288,7 +2288,7 @@ var require_source_map_consumer = __commonJS({
2288
2288
  });
2289
2289
  this.sourceRoot = sourceRoot;
2290
2290
  this.sourcesContent = sourcesContent;
2291
- this._mappings = mappings;
2291
+ this._mappings = mappings2;
2292
2292
  this._sourceMapURL = aSourceMapURL;
2293
2293
  this.file = file;
2294
2294
  }
@@ -6271,11 +6271,25 @@ module.exports = __toCommonJS(mdc_migration_exports);
6271
6271
  var END_OF_SELECTOR_REGEX = "(?!-)";
6272
6272
  var MIXIN_ARGUMENTS_REGEX = "\\(((\\s|.)*)\\)";
6273
6273
  var StyleMigrator = class {
6274
+ constructor() {
6275
+ this._processedNodes = /* @__PURE__ */ new WeakMap();
6276
+ }
6277
+ static wrapValue(value) {
6278
+ const escapeString = "__NG_MDC_MIGRATION_PLACEHOLDER__";
6279
+ return `${escapeString}${value}${escapeString}`;
6280
+ }
6281
+ static unwrapAllValues(content) {
6282
+ return content.replace(/__NG_MDC_MIGRATION_PLACEHOLDER__/g, "");
6283
+ }
6274
6284
  isLegacyMixin(namespace, atRule2) {
6275
6285
  return this.mixinChanges.some((change) => atRule2.params.includes(`${namespace}.${change.old}`));
6276
6286
  }
6277
6287
  getMixinChange(namespace, atRule2) {
6278
6288
  var _a, _b;
6289
+ const processedKey = `mixinChange-${namespace}`;
6290
+ if (this._nodeIsProcessed(atRule2, processedKey)) {
6291
+ return null;
6292
+ }
6279
6293
  const change = this.mixinChanges.find((c) => {
6280
6294
  return atRule2.params.includes(`${namespace}.${c.old}`);
6281
6295
  });
@@ -6294,6 +6308,7 @@ var StyleMigrator = class {
6294
6308
  }
6295
6309
  });
6296
6310
  }
6311
+ this._trackProcessedNode(atRule2, processedKey);
6297
6312
  return { old: change.old, new: replacements.length ? replacements : null };
6298
6313
  }
6299
6314
  isLegacySelector(rule2) {
@@ -6304,16 +6319,28 @@ var StyleMigrator = class {
6304
6319
  }
6305
6320
  replaceLegacySelector(rule2) {
6306
6321
  var _a;
6307
- for (let i = 0; i < this.classChanges.length; i++) {
6308
- const change = this.classChanges[i];
6309
- if ((_a = rule2.selector) == null ? void 0 : _a.match(change.old + END_OF_SELECTOR_REGEX)) {
6310
- rule2.selector = rule2.selector.replace(change.old, change.new);
6322
+ if (!this._nodeIsProcessed(rule2, "replaceLegacySelector")) {
6323
+ for (let i = 0; i < this.classChanges.length; i++) {
6324
+ const change = this.classChanges[i];
6325
+ if ((_a = rule2.selector) == null ? void 0 : _a.match(change.old + END_OF_SELECTOR_REGEX)) {
6326
+ rule2.selector = rule2.selector.replace(change.old, change.new);
6327
+ }
6311
6328
  }
6329
+ this._trackProcessedNode(rule2, "replaceLegacySelector");
6312
6330
  }
6313
6331
  }
6314
6332
  isDeprecatedSelector(rule2) {
6315
6333
  return this.deprecatedPrefixes.some((deprecatedPrefix) => rule2.selector.includes(deprecatedPrefix));
6316
6334
  }
6335
+ _trackProcessedNode(node, action) {
6336
+ const appliedActions = this._processedNodes.get(node) || /* @__PURE__ */ new Set();
6337
+ appliedActions.add(action);
6338
+ this._processedNodes.set(node, appliedActions);
6339
+ }
6340
+ _nodeIsProcessed(node, action) {
6341
+ var _a;
6342
+ return !!((_a = this._processedNodes.get(node)) == null ? void 0 : _a.has(action));
6343
+ }
6317
6344
  };
6318
6345
 
6319
6346
  // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/autocomplete/autocomplete-styles.js
@@ -8412,14 +8439,14 @@ var SourceMapGenerator = class {
8412
8439
  sources.push(url);
8413
8440
  sourcesContent.push(this.sourcesContent.get(url) || null);
8414
8441
  });
8415
- let mappings = "";
8442
+ let mappings2 = "";
8416
8443
  let lastCol0 = 0;
8417
8444
  let lastSourceIndex = 0;
8418
8445
  let lastSourceLine0 = 0;
8419
8446
  let lastSourceCol0 = 0;
8420
8447
  this.lines.forEach((segments) => {
8421
8448
  lastCol0 = 0;
8422
- mappings += segments.map((segment) => {
8449
+ mappings2 += segments.map((segment) => {
8423
8450
  let segAsStr = toBase64VLQ(segment.col0 - lastCol0);
8424
8451
  lastCol0 = segment.col0;
8425
8452
  if (segment.sourceUrl != null) {
@@ -8432,16 +8459,16 @@ var SourceMapGenerator = class {
8432
8459
  }
8433
8460
  return segAsStr;
8434
8461
  }).join(",");
8435
- mappings += ";";
8462
+ mappings2 += ";";
8436
8463
  });
8437
- mappings = mappings.slice(0, -1);
8464
+ mappings2 = mappings2.slice(0, -1);
8438
8465
  return {
8439
8466
  "file": this.file || "",
8440
8467
  "version": VERSION$1,
8441
8468
  "sourceRoot": "",
8442
8469
  "sources": sources,
8443
8470
  "sourcesContent": sourcesContent,
8444
- "mappings": mappings
8471
+ "mappings": mappings2
8445
8472
  };
8446
8473
  }
8447
8474
  toJsComment() {
@@ -22203,14 +22230,174 @@ var SliderTemplateMigrator = class extends TemplateMigrator {
22203
22230
  const updates = [];
22204
22231
  visitElements(ast.nodes, (node) => {
22205
22232
  if (node.name === "mat-slider") {
22233
+ const originalHtml = node.sourceSpan.start.file.content;
22234
+ const bindings = this._getBindings(node);
22235
+ const inputBindings = [];
22236
+ const comments = [];
22237
+ for (let i = 0; i < bindings.length; i++) {
22238
+ const binding = bindings[i];
22239
+ if (binding.name === "value") {
22240
+ const sourceSpan = binding.node.sourceSpan;
22241
+ inputBindings.push(originalHtml.slice(sourceSpan.start.offset, sourceSpan.end.offset));
22242
+ updates.push(this._removeBinding(originalHtml, binding.node));
22243
+ }
22244
+ if (binding.name === "invert" || binding.name === "vertical") {
22245
+ comments.push(`<!-- TODO: The '${binding.name}' property no longer exists -->`);
22246
+ updates.push(this._removeBinding(originalHtml, binding.node));
22247
+ }
22248
+ }
22249
+ if (comments.length) {
22250
+ updates.push(this._addComments(node, comments));
22251
+ }
22252
+ const matSliderThumb = inputBindings.length ? `<input matSliderThumb ${inputBindings.join(" ")} />` : "<input matSliderThumb />";
22206
22253
  updates.push({
22207
- offset: node.sourceSpan.start.offset,
22208
- updateFn: (html) => html
22254
+ offset: node.startSourceSpan.end.offset,
22255
+ updateFn: (html) => html.slice(0, node.startSourceSpan.end.offset) + matSliderThumb + html.slice(node.startSourceSpan.end.offset)
22209
22256
  });
22210
22257
  }
22211
22258
  });
22212
22259
  return updates;
22213
22260
  }
22261
+ _addComments(node, comments) {
22262
+ const whitespace = this._parseIndentation(node);
22263
+ const indentation = "\n" + this._parseIndentation(node);
22264
+ const commentStr = whitespace.length === node.sourceSpan.start.col ? comments.join(indentation) : indentation + comments.join(indentation);
22265
+ return {
22266
+ offset: node.sourceSpan.start.offset,
22267
+ updateFn: (html) => html.slice(0, node.sourceSpan.start.offset) + commentStr + `${indentation}${html.slice(node.sourceSpan.start.offset)}`
22268
+ };
22269
+ }
22270
+ _parseIndentation(node) {
22271
+ const html = node.sourceSpan.start.file.content;
22272
+ const before = html.slice(node.sourceSpan.start.offset - node.sourceSpan.start.col, node.sourceSpan.start.offset);
22273
+ return before.slice(0, before.length - before.trimStart().length);
22274
+ }
22275
+ _removeBinding(originalHtml, binding) {
22276
+ let charIndex = binding.sourceSpan.start.offset - 1;
22277
+ while (/\s/.test(originalHtml.charAt(charIndex)) && charIndex > -1) {
22278
+ charIndex--;
22279
+ }
22280
+ return {
22281
+ offset: charIndex + 1,
22282
+ updateFn: (html) => html.slice(0, charIndex + 1) + html.slice(binding.sourceSpan.end.offset)
22283
+ };
22284
+ }
22285
+ _getBindings(node) {
22286
+ const allInputs = this._getInputs(node);
22287
+ const allOutputs = this._getOutputs(node);
22288
+ const attributes = this._getAttributes(node);
22289
+ const twoWayBindings = this._getTwoWayBindings(allInputs, allOutputs);
22290
+ const inputs = allInputs.filter((input) => !twoWayBindings.some((binding) => binding.name === input.name));
22291
+ const outputs = allOutputs.filter((output) => !twoWayBindings.some((binding) => binding.name === output.name));
22292
+ return inputs.concat(outputs).concat(attributes).concat(twoWayBindings);
22293
+ }
22294
+ _getTwoWayBindings(inputs, outputs) {
22295
+ return inputs.filter((input) => outputs.some((output) => output.name === input.name)).map((input) => __spreadProps(__spreadValues({}, input), { type: 3 }));
22296
+ }
22297
+ _getOutputs(node) {
22298
+ return node.outputs.map((output) => ({
22299
+ node: output,
22300
+ type: 1,
22301
+ name: node.sourceSpan.start.file.content.slice(output.keySpan.start.offset, output.keySpan.end.offset),
22302
+ value: node.sourceSpan.start.file.content.slice(output.handlerSpan.start.offset, output.handlerSpan.end.offset)
22303
+ }));
22304
+ }
22305
+ _getInputs(node) {
22306
+ return node.inputs.map((input) => ({
22307
+ node: input,
22308
+ type: 0,
22309
+ name: node.sourceSpan.start.file.content.slice(input.keySpan.start.offset, input.keySpan.end.offset),
22310
+ value: node.sourceSpan.start.file.content.slice(input.value.sourceSpan.start, input.value.sourceSpan.end)
22311
+ }));
22312
+ }
22313
+ _getAttributes(node) {
22314
+ return node.attributes.map((attribute) => ({
22315
+ node: attribute,
22316
+ type: 2,
22317
+ name: attribute.name,
22318
+ value: attribute.value
22319
+ }));
22320
+ }
22321
+ };
22322
+
22323
+ // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/typography-hierarchy/constants.js
22324
+ var mappings = [
22325
+ ["display-4", "headline-1"],
22326
+ ["display-3", "headline-2"],
22327
+ ["display-2", "headline-3"],
22328
+ ["display-1", "headline-4"],
22329
+ ["headline", "headline-5"],
22330
+ ["title", "headline-6"],
22331
+ ["subheading-2", "subtitle-1"],
22332
+ ["body-2", "subtitle-2"],
22333
+ ["subheading-1", "body-1"],
22334
+ ["body-1", "body-2"]
22335
+ ];
22336
+ var RENAMED_TYPOGRAPHY_LEVELS = new Map(mappings);
22337
+ var RENAMED_TYPOGRAPHY_CLASSES = new Map(mappings.map((m) => ["mat-" + m[0], "mat-" + m[1]]));
22338
+
22339
+ // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/typography-hierarchy/typography-hierarchy-template.js
22340
+ var TypographyHierarchyTemplateMigrator = class extends TemplateMigrator {
22341
+ getUpdates(ast) {
22342
+ const updates = [];
22343
+ visitElements(ast.nodes, (node) => {
22344
+ this._addStaticClassUpdates(node, updates);
22345
+ this._addClassBindingUpdates(node, updates);
22346
+ });
22347
+ return updates;
22348
+ }
22349
+ _addStaticClassUpdates(node, updates) {
22350
+ const classAttr = node.attributes.find((attr) => attr.name === "class");
22351
+ if (classAttr && classAttr.keySpan && classAttr.valueSpan && classAttr.value.includes("mat-")) {
22352
+ const classes = classAttr.value.split(" ");
22353
+ let hasChanged = false;
22354
+ classes.forEach((current, index2) => {
22355
+ if (RENAMED_TYPOGRAPHY_CLASSES.has(current)) {
22356
+ hasChanged = true;
22357
+ classes[index2] = RENAMED_TYPOGRAPHY_CLASSES.get(current);
22358
+ }
22359
+ });
22360
+ if (hasChanged) {
22361
+ updates.push({
22362
+ offset: classAttr.keySpan.start.offset,
22363
+ updateFn: (html) => html.slice(0, classAttr.valueSpan.start.offset) + classes.join(" ") + html.slice(classAttr.valueSpan.end.offset)
22364
+ });
22365
+ }
22366
+ }
22367
+ }
22368
+ _addClassBindingUpdates(node, updates) {
22369
+ node.inputs.forEach((input) => {
22370
+ if (input.type === 2 && RENAMED_TYPOGRAPHY_CLASSES.has(input.name)) {
22371
+ updates.push({
22372
+ offset: input.keySpan.start.offset,
22373
+ updateFn: (html) => {
22374
+ return html.slice(0, input.keySpan.start.offset) + "class." + RENAMED_TYPOGRAPHY_CLASSES.get(input.name) + html.slice(input.keySpan.end.offset);
22375
+ }
22376
+ });
22377
+ }
22378
+ });
22379
+ }
22380
+ };
22381
+
22382
+ // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/typography-hierarchy/typography-hierarchy-styles.js
22383
+ var TypographyHierarchyStylesMigrator = class extends StyleMigrator {
22384
+ constructor() {
22385
+ super();
22386
+ this.component = "typography-hierarchy";
22387
+ this.deprecatedPrefixes = [];
22388
+ this.classChanges = [];
22389
+ this.mixinChanges = [
22390
+ {
22391
+ old: "legacy-typography-hierarchy",
22392
+ new: ["typography-hierarchy"],
22393
+ checkForDuplicates: false
22394
+ }
22395
+ ];
22396
+ RENAMED_TYPOGRAPHY_CLASSES.forEach((newClass, oldClass) => {
22397
+ const wrappedNewClass = RENAMED_TYPOGRAPHY_CLASSES.has(newClass) ? `.${StyleMigrator.wrapValue(newClass)}` : `.${newClass}`;
22398
+ this.classChanges.push({ new: wrappedNewClass, old: "." + oldClass });
22399
+ });
22400
+ }
22214
22401
  };
22215
22402
 
22216
22403
  // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/index.js
@@ -22358,6 +22545,13 @@ var MIGRATORS = [
22358
22545
  styles: new TooltipStylesMigrator()
22359
22546
  }
22360
22547
  ];
22548
+ var PERMANENT_MIGRATORS = [
22549
+ {
22550
+ component: "typography-hierarchy",
22551
+ template: new TypographyHierarchyTemplateMigrator(),
22552
+ styles: new TypographyHierarchyStylesMigrator()
22553
+ }
22554
+ ];
22361
22555
 
22362
22556
  // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/index.mjs
22363
22557
  var import_schematics4 = require("@angular/cdk/schematics");
@@ -22410,18 +22604,6 @@ var parse3 = import_scss_syntax.default.parse;
22410
22604
 
22411
22605
  // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/theming-styles.js
22412
22606
  var COMPONENTS_MIXIN_NAME = /\.([^(;]*)/;
22413
- var RENAMED_TYPOGRAPHY_LEVELS = /* @__PURE__ */ new Map([
22414
- ["display-4", "headline-1"],
22415
- ["display-3", "headline-2"],
22416
- ["display-2", "headline-3"],
22417
- ["display-1", "headline-4"],
22418
- ["headline", "headline-5"],
22419
- ["title", "headline-6"],
22420
- ["subheading-2", "subtitle-1"],
22421
- ["body-2", "subtitle-2"],
22422
- ["subheading-1", "body-1"],
22423
- ["body-1", "body-2"]
22424
- ]);
22425
22607
  var ThemingStylesMigration = class extends import_schematics.Migration {
22426
22608
  constructor() {
22427
22609
  super(...arguments);
@@ -22439,26 +22621,27 @@ var ThemingStylesMigration = class extends import_schematics.Migration {
22439
22621
  {
22440
22622
  postcssPlugin: "theming-styles-migration-plugin",
22441
22623
  AtRule: {
22442
- use: this.atUseHandler.bind(this),
22443
- include: this.atIncludeHandler.bind(this)
22624
+ use: this._atUseHandler.bind(this),
22625
+ include: (atRule2) => this._atIncludeHandler(atRule2)
22444
22626
  },
22445
- Rule: this.ruleHandler.bind(this)
22627
+ Rule: (rule2) => this._ruleHandler(rule2)
22446
22628
  }
22447
22629
  ]);
22448
22630
  try {
22449
- return processor.process(styles, { syntax: scss_syntax_exports }).toString();
22631
+ const result = processor.process(styles, { syntax: scss_syntax_exports }).toString();
22632
+ return result === styles ? styles : StyleMigrator.unwrapAllValues(result);
22450
22633
  } catch (e) {
22451
22634
  this.context.logger.error(`${e}`);
22452
22635
  this.context.logger.warn(`Failed to process stylesheet: ${filename} (see error above).`);
22453
22636
  return styles;
22454
22637
  }
22455
22638
  }
22456
- atUseHandler(atRule2) {
22639
+ _atUseHandler(atRule2) {
22457
22640
  if (isAngularMaterialImport(atRule2)) {
22458
22641
  this._namespace = parseNamespace(atRule2);
22459
22642
  }
22460
22643
  }
22461
- atIncludeHandler(atRule2) {
22644
+ _atIncludeHandler(atRule2) {
22462
22645
  const migrator = this.upgradeData.find((m) => {
22463
22646
  return m.styles.isLegacyMixin(this._namespace, atRule2);
22464
22647
  });
@@ -22489,20 +22672,23 @@ var ThemingStylesMigration = class extends import_schematics.Migration {
22489
22672
  ].some((r) => new RegExp(r).test(mixinText));
22490
22673
  }
22491
22674
  isPartialMigration() {
22492
- return this.upgradeData.length !== MIGRATORS.length;
22675
+ return this.upgradeData.length !== MIGRATORS.length + PERMANENT_MIGRATORS.length;
22493
22676
  }
22494
- ruleHandler(rule2) {
22495
- let isLegacySelector;
22496
- let isDeprecatedSelector;
22677
+ _ruleHandler(rule2) {
22678
+ let isLegacySelector = false;
22679
+ let isDeprecatedSelector = false;
22497
22680
  const migrator = this.upgradeData.find((m) => {
22498
22681
  isLegacySelector = m.styles.isLegacySelector(rule2);
22499
22682
  isDeprecatedSelector = m.styles.isDeprecatedSelector(rule2);
22500
22683
  return isLegacySelector || isDeprecatedSelector;
22501
22684
  });
22685
+ if (!migrator) {
22686
+ return;
22687
+ }
22502
22688
  if (isLegacySelector) {
22503
- migrator == null ? void 0 : migrator.styles.replaceLegacySelector(rule2);
22689
+ migrator.styles.replaceLegacySelector(rule2);
22504
22690
  } else if (isDeprecatedSelector) {
22505
- addCommentBeforeNode(rule2, "TODO(mdc-migration): The following rule targets internal classes of " + (migrator == null ? void 0 : migrator.component) + " that may no longer apply for the MDC version.");
22691
+ addCommentBeforeNode(rule2, `TODO(mdc-migration): The following rule targets internal classes of ${migrator.component} that may no longer apply for the MDC version.`);
22506
22692
  }
22507
22693
  }
22508
22694
  };
@@ -22893,7 +23079,10 @@ function mdc_migration_default(options) {
22893
23079
  const fileSystem = new import_schematics4.DevkitFileSystem(tree);
22894
23080
  const analyzedFiles = /* @__PURE__ */ new Set();
22895
23081
  const componentsToMigrate = getComponentsToMigrate(options.components);
22896
- const migrators = MIGRATORS.filter((m) => componentsToMigrate.has(m.component));
23082
+ const migrators = [
23083
+ ...MIGRATORS.filter((m) => componentsToMigrate.has(m.component)),
23084
+ ...PERMANENT_MIGRATORS
23085
+ ];
22897
23086
  let success = true;
22898
23087
  if (options.directory) {
22899
23088
  logger.info(`Limiting migration to: ${options.directory}`);