@skyux/packages 15.0.0-alpha.9 → 15.0.0-beta.1

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 (36) hide show
  1. package/migrations.json +19 -9
  2. package/package.json +61 -61
  3. package/src/schematics/migrations/update-15/add-compat-stylesheets/add-compat-stylesheet.schematic.js +138 -15
  4. package/src/schematics/migrations/update-15/add-compat-stylesheets/add-compat-stylesheet.schematic.js.map +1 -1
  5. package/src/schematics/migrations/update-15/fluid-grid-inset/fluid-grid-inset.schematic.d.ts +8 -0
  6. package/src/schematics/migrations/update-15/fluid-grid-inset/fluid-grid-inset.schematic.js +173 -0
  7. package/src/schematics/migrations/update-15/fluid-grid-inset/fluid-grid-inset.schematic.js.map +1 -0
  8. package/src/schematics/migrations/update-15/legacy-i18n-services/legacy-i18n-services.schematic.d.ts +13 -2
  9. package/src/schematics/migrations/update-15/legacy-i18n-services/legacy-i18n-services.schematic.js +426 -4
  10. package/src/schematics/migrations/update-15/legacy-i18n-services/legacy-i18n-services.schematic.js.map +1 -1
  11. package/src/schematics/migrations/update-15/remove-select-field/remove-select-field.schematic.d.ts +7 -0
  12. package/src/schematics/migrations/update-15/remove-select-field/remove-select-field.schematic.js +98 -0
  13. package/src/schematics/migrations/update-15/remove-select-field/remove-select-field.schematic.js.map +1 -0
  14. package/src/schematics/ng-generate/add-skyux-to-project/add-skyux-to-project.schematic.js +4 -15
  15. package/src/schematics/ng-generate/add-skyux-to-project/add-skyux-to-project.schematic.js.map +1 -1
  16. package/src/schematics/rules/add-ag-grid-styles-config.js +2 -11
  17. package/src/schematics/rules/add-ag-grid-styles-config.js.map +1 -1
  18. package/src/schematics/rules/convert-grid-to-data-grid/convert-grid-to-data-grid.js +5 -4
  19. package/src/schematics/rules/convert-grid-to-data-grid/convert-grid-to-data-grid.js.map +1 -1
  20. package/src/schematics/rules/convert-page-summary-to-page-header/convert-page-summary-to-page-header.js +1 -1
  21. package/src/schematics/rules/convert-progress-indicator-wizard-to-tab-wizard/convert-progress-indicator-wizard-to-tab-wizard.js +1 -1
  22. package/src/schematics/rules/workspace-check/workspace-check.js +2 -7
  23. package/src/schematics/rules/workspace-check/workspace-check.js.map +1 -1
  24. package/src/schematics/utility/builders.d.ts +7 -0
  25. package/src/schematics/utility/builders.js +28 -0
  26. package/src/schematics/utility/builders.js.map +1 -0
  27. package/src/schematics/utility/typescript/ng-ast.d.ts +8 -0
  28. package/src/schematics/utility/typescript/ng-ast.js +41 -20
  29. package/src/schematics/utility/typescript/ng-ast.js.map +1 -1
  30. package/src/schematics/utility/typescript/remove-class-reference.d.ts +7 -6
  31. package/src/schematics/utility/typescript/remove-class-reference.js +39 -14
  32. package/src/schematics/utility/typescript/remove-class-reference.js.map +1 -1
  33. package/src/schematics/utility/typescript/swap-imported-class.d.ts +7 -0
  34. package/src/schematics/utility/typescript/swap-imported-class.js +24 -8
  35. package/src/schematics/utility/typescript/swap-imported-class.js.map +1 -1
  36. package/src/version.js +1 -1
package/migrations.json CHANGED
@@ -1,49 +1,59 @@
1
1
  {
2
2
  "schematics": {
3
3
  "noop": {
4
- "version": "15.0.0-alpha.9",
4
+ "version": "15.0.0-beta.1",
5
5
  "factory": "./src/schematics/migrations/all/noop/noop.schematic",
6
6
  "description": "Update all SKY UX component packages"
7
7
  },
8
8
  "i18n-resources-module": {
9
- "version": "15.0.0-alpha.9",
9
+ "version": "15.0.0-beta.1",
10
10
  "factory": "./src/schematics/migrations/all/i18n-resources-module/i18n-resources-module.schematic",
11
11
  "description": "Regenerate i18n resources modules for libraries."
12
12
  },
13
13
  "remove-old-compat-stylesheets": {
14
- "version": "15.0.0-alpha.9",
14
+ "version": "15.0.0-beta.1",
15
15
  "factory": "./src/schematics/migrations/all/remove-old-compat-stylesheets/remove-old-compat-stylesheets.schematic",
16
16
  "description": "Remove backward compatible stylesheets for older versions of SKY UX."
17
17
  },
18
18
  "workspace-check": {
19
- "version": "15.0.0-alpha.9",
19
+ "version": "15.0.0-beta.1",
20
20
  "factory": "./src/schematics/migrations/all/workspace-check/workspace-check.schematic",
21
21
  "description": "Log warnings if the workspace is not configured correctly."
22
22
  },
23
23
  "migrate-dragula-polyfill": {
24
- "version": "15.0.0-alpha.9",
24
+ "version": "15.0.0-beta.1",
25
25
  "factory": "./src/schematics/migrations/all/migrate-dragula-polyfill/migrate-dragula-polyfill.schematic",
26
26
  "description": "Remove the @skyux/packages/polyfills entry from project config, replacing it with a local copy when Dragula is still installed."
27
27
  },
28
28
  "remove-timepicker-retain-invalid-values": {
29
- "version": "15.0.0-alpha.9",
29
+ "version": "15.0.0-beta.1",
30
30
  "factory": "./src/schematics/migrations/update-15/remove-timepicker-retain-invalid-values/remove-timepicker-retain-invalid-values.schematic",
31
31
  "description": "Remove the skyTimepickerRetainInvalidValues input from timepicker inputs since retaining invalid values is now the default behavior."
32
32
  },
33
33
  "add-compat-stylesheets": {
34
- "version": "15.0.0-alpha.9",
34
+ "version": "15.0.0-beta.1",
35
35
  "factory": "./src/schematics/migrations/update-15/add-compat-stylesheets/add-compat-stylesheet.schematic",
36
36
  "description": "Add a backwards-compatible stylesheet with styles that have been removed from components in SKY UX 15."
37
37
  },
38
38
  "migrate-sdk-testing-imports": {
39
- "version": "15.0.0-alpha.9",
39
+ "version": "15.0.0-beta.1",
40
40
  "factory": "./src/schematics/migrations/update-15/migrate-sdk-testing-imports/migrate-sdk-testing-imports.schematic",
41
41
  "description": "Move SkyAppTestUtility, SkyAppTestUtilityDomEventOptions, and SkyBy imports from the deprecated @skyux-sdk/testing package to @skyux/core/testing."
42
42
  },
43
43
  "legacy-i18n-services": {
44
- "version": "15.0.0-alpha.9",
44
+ "version": "15.0.0-beta.1",
45
45
  "factory": "./src/schematics/migrations/update-15/legacy-i18n-services/legacy-i18n-services.schematic",
46
46
  "description": "Replace SkyAppResourcesService and SkyLibResourcesService with their legacy equivalents since the originals now emit whenever the locale changes."
47
+ },
48
+ "fluid-grid-inset": {
49
+ "version": "15.0.0-beta.1",
50
+ "factory": "./src/schematics/migrations/update-15/fluid-grid-inset/fluid-grid-inset.schematic",
51
+ "description": "Migrate sky-fluid-grid elements from the deprecated disableMargin input to the new inset input, since hiding the outer margin is now the default behavior."
52
+ },
53
+ "remove-select-field": {
54
+ "version": "15.0.0-beta.1",
55
+ "factory": "./src/schematics/migrations/update-15/remove-select-field/remove-select-field.schematic",
56
+ "description": "Remove the SkySelectFieldModule import and the @skyux/select-field dependency from projects that do not reference <sky-select-field> in any template."
47
57
  }
48
58
  }
49
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyux/packages",
3
- "version": "15.0.0-alpha.9",
3
+ "version": "15.0.0-beta.1",
4
4
  "author": "Blackbaud, Inc.",
5
5
  "description": "Handles the `ng update` command for SKY UX component libraries.",
6
6
  "keywords": [
@@ -32,71 +32,71 @@
32
32
  "ng-update": {
33
33
  "migrations": "./migrations.json",
34
34
  "packageGroup": {
35
- "@skyux/packages": "15.0.0-alpha.9",
35
+ "@skyux/packages": "15.0.0-beta.1",
36
36
  "@blackbaud/angular-tree-component": "^1.0.0",
37
- "@skyux-sdk/eslint-schematics": "15.0.0-alpha.9",
38
- "@skyux-sdk/stylelint-schematics": "15.0.0-alpha.9",
39
- "@skyux-sdk/testing": "15.0.0-alpha.9",
40
- "@skyux-sdk/testing-schematics": "15.0.0-alpha.9",
41
- "@skyux-sdk/vitest": "15.0.0-alpha.9",
42
- "@skyux/a11y": "15.0.0-alpha.9",
43
- "@skyux/action-bars": "15.0.0-alpha.9",
44
- "@skyux/ag-grid": "15.0.0-alpha.9",
45
- "@skyux/angular-tree-component": "15.0.0-alpha.9",
46
- "@skyux/animations": "15.0.0-alpha.9",
47
- "@skyux/assets": "15.0.0-alpha.9",
48
- "@skyux/autonumeric": "15.0.0-alpha.9",
49
- "@skyux/avatar": "15.0.0-alpha.9",
50
- "@skyux/charts": "15.0.0-alpha.9",
51
- "@skyux/code-examples": "15.0.0-alpha.9",
52
- "@skyux/colorpicker": "15.0.0-alpha.9",
53
- "@skyux/config": "15.0.0-alpha.9",
54
- "@skyux/core": "15.0.0-alpha.9",
55
- "@skyux/data-grid": "15.0.0-alpha.9",
56
- "@skyux/data-manager": "15.0.0-alpha.9",
57
- "@skyux/datetime": "15.0.0-alpha.9",
58
- "@skyux/docs-tools": "15.0.0-alpha.9",
59
- "@skyux/errors": "15.0.0-alpha.9",
60
- "@skyux/filter-bar": "15.0.0-alpha.9",
61
- "@skyux/flyout": "15.0.0-alpha.9",
62
- "@skyux/forms": "15.0.0-alpha.9",
63
- "@skyux/grids": "15.0.0-alpha.9",
64
- "@skyux/help-inline": "15.0.0-alpha.9",
65
- "@skyux/i18n": "15.0.0-alpha.9",
66
- "@skyux/icon": "15.0.0-alpha.9",
37
+ "@skyux-sdk/eslint-schematics": "15.0.0-beta.1",
38
+ "@skyux-sdk/stylelint-schematics": "15.0.0-beta.1",
39
+ "@skyux-sdk/testing": "15.0.0-beta.1",
40
+ "@skyux-sdk/testing-schematics": "15.0.0-beta.1",
41
+ "@skyux-sdk/vitest": "15.0.0-beta.1",
42
+ "@skyux/a11y": "15.0.0-beta.1",
43
+ "@skyux/action-bars": "15.0.0-beta.1",
44
+ "@skyux/ag-grid": "15.0.0-beta.1",
45
+ "@skyux/angular-tree-component": "15.0.0-beta.1",
46
+ "@skyux/animations": "15.0.0-beta.1",
47
+ "@skyux/assets": "15.0.0-beta.1",
48
+ "@skyux/autonumeric": "15.0.0-beta.1",
49
+ "@skyux/avatar": "15.0.0-beta.1",
50
+ "@skyux/charts": "15.0.0-beta.1",
51
+ "@skyux/code-examples": "15.0.0-beta.1",
52
+ "@skyux/colorpicker": "15.0.0-beta.1",
53
+ "@skyux/config": "15.0.0-beta.1",
54
+ "@skyux/core": "15.0.0-beta.1",
55
+ "@skyux/data-grid": "15.0.0-beta.1",
56
+ "@skyux/data-manager": "15.0.0-beta.1",
57
+ "@skyux/datetime": "15.0.0-beta.1",
58
+ "@skyux/docs-tools": "15.0.0-beta.1",
59
+ "@skyux/errors": "15.0.0-beta.1",
60
+ "@skyux/filter-bar": "15.0.0-beta.1",
61
+ "@skyux/flyout": "15.0.0-beta.1",
62
+ "@skyux/forms": "15.0.0-beta.1",
63
+ "@skyux/grids": "15.0.0-beta.1",
64
+ "@skyux/help-inline": "15.0.0-beta.1",
65
+ "@skyux/i18n": "15.0.0-beta.1",
66
+ "@skyux/icon": "15.0.0-beta.1",
67
67
  "@skyux/icons": "^11.4.0",
68
- "@skyux/indicators": "15.0.0-alpha.9",
69
- "@skyux/inline-form": "15.0.0-alpha.9",
70
- "@skyux/layout": "15.0.0-alpha.9",
71
- "@skyux/list-builder": "15.0.0-alpha.9",
72
- "@skyux/list-builder-common": "15.0.0-alpha.9",
73
- "@skyux/list-builder-view-checklist": "15.0.0-alpha.9",
74
- "@skyux/list-builder-view-grids": "15.0.0-alpha.9",
75
- "@skyux/lists": "15.0.0-alpha.9",
76
- "@skyux/lookup": "15.0.0-alpha.9",
77
- "@skyux/manifest": "15.0.0-alpha.9",
78
- "@skyux/modals": "15.0.0-alpha.9",
79
- "@skyux/navbar": "15.0.0-alpha.9",
80
- "@skyux/pages": "15.0.0-alpha.9",
81
- "@skyux/phone-field": "15.0.0-alpha.9",
82
- "@skyux/popovers": "15.0.0-alpha.9",
83
- "@skyux/progress-indicator": "15.0.0-alpha.9",
84
- "@skyux/router": "15.0.0-alpha.9",
85
- "@skyux/split-view": "15.0.0-alpha.9",
86
- "@skyux/tabs": "15.0.0-alpha.9",
87
- "@skyux/text-editor": "15.0.0-alpha.9",
88
- "@skyux/theme": "15.0.0-alpha.9",
89
- "@skyux/tiles": "15.0.0-alpha.9",
90
- "@skyux/toast": "15.0.0-alpha.9",
91
- "@skyux/validation": "15.0.0-alpha.9",
68
+ "@skyux/indicators": "15.0.0-beta.1",
69
+ "@skyux/inline-form": "15.0.0-beta.1",
70
+ "@skyux/layout": "15.0.0-beta.1",
71
+ "@skyux/list-builder": "15.0.0-beta.1",
72
+ "@skyux/list-builder-common": "15.0.0-beta.1",
73
+ "@skyux/list-builder-view-checklist": "15.0.0-beta.1",
74
+ "@skyux/list-builder-view-grids": "15.0.0-beta.1",
75
+ "@skyux/lists": "15.0.0-beta.1",
76
+ "@skyux/lookup": "15.0.0-beta.1",
77
+ "@skyux/manifest": "15.0.0-beta.1",
78
+ "@skyux/modals": "15.0.0-beta.1",
79
+ "@skyux/navbar": "15.0.0-beta.1",
80
+ "@skyux/pages": "15.0.0-beta.1",
81
+ "@skyux/phone-field": "15.0.0-beta.1",
82
+ "@skyux/popovers": "15.0.0-beta.1",
83
+ "@skyux/progress-indicator": "15.0.0-beta.1",
84
+ "@skyux/router": "15.0.0-beta.1",
85
+ "@skyux/split-view": "15.0.0-beta.1",
86
+ "@skyux/tabs": "15.0.0-beta.1",
87
+ "@skyux/text-editor": "15.0.0-beta.1",
88
+ "@skyux/theme": "15.0.0-beta.1",
89
+ "@skyux/tiles": "15.0.0-beta.1",
90
+ "@skyux/toast": "15.0.0-beta.1",
91
+ "@skyux/validation": "15.0.0-beta.1",
92
92
  "ag-grid-angular": "^36.1.0",
93
93
  "ag-grid-community": "^36.1.0",
94
94
  "ag-grid-enterprise": "^36.0.2",
95
95
  "autonumeric": "^4.10.10",
96
- "eslint-config-skyux": "15.0.0-alpha.9",
97
- "skyux-eslint": "15.0.0-alpha.9",
98
- "skyux-stylelint": "15.0.0-alpha.9",
99
- "stylelint-config-skyux": "15.0.0-alpha.9"
96
+ "eslint-config-skyux": "15.0.0-beta.1",
97
+ "skyux-eslint": "15.0.0-beta.1",
98
+ "skyux-stylelint": "15.0.0-beta.1",
99
+ "stylelint-config-skyux": "15.0.0-beta.1"
100
100
  }
101
101
  },
102
102
  "peerDependencies": {
@@ -105,7 +105,7 @@
105
105
  "typescript": "^6.0.3"
106
106
  },
107
107
  "dependencies": {
108
- "@blackbaud/skyux-design-tokens": "7.0.0-alpha.8",
108
+ "@blackbaud/skyux-design-tokens": "7.0.0-alpha.12",
109
109
  "fs-extra": "11.3.6",
110
110
  "jsonc-parser": "3.3.1",
111
111
  "parse5": "7.3.0",
@@ -5,6 +5,7 @@ const schematics_1 = require("@angular-devkit/schematics");
5
5
  const utility_1 = require("@schematics/angular/utility");
6
6
  const workspace_1 = require("@schematics/angular/utility/workspace");
7
7
  const version_1 = require("../../../../version");
8
+ const builders_1 = require("../../../utility/builders");
8
9
  const tree_1 = require("../../../utility/tree");
9
10
  const workspace_2 = require("../../../utility/workspace");
10
11
  const COMPAT_CSS_FILE_NAME = `skyux${version_1.VERSION.major}-compat.css`;
@@ -29,6 +30,121 @@ Pointer events are no longer disabled on elements with the "sky-btn-disabled" cl
29
30
  },
30
31
  ],
31
32
  },
33
+ {
34
+ name: '@skyux/tabs',
35
+ components: [
36
+ {
37
+ name: 'vertical-tabset',
38
+ styles: [
39
+ {
40
+ css: `
41
+ /* Default theme */
42
+ :root {
43
+ --sky-compat-vertical-tabset-content-spacing-xs: 10px 0 0 10px;
44
+ --sky-compat-vertical-tabset-content-spacing-sm: 10px 0 0 10px;
45
+ --sky-compat-vertical-tabset-content-overflow-y: auto;
46
+ }
47
+
48
+ .sky-theme-modern {
49
+ --sky-compat-vertical-tabset-content-spacing-xs:
50
+ var(--sky-comp-tab-vertical-content-space-inset-xs-top)
51
+ var(--sky-comp-tab-vertical-content-space-inset-xs-right)
52
+ var(--sky-comp-tab-vertical-content-space-inset-xs-bottom)
53
+ var(--sky-comp-tab-vertical-content-space-inset-xs-left);
54
+ --sky-compat-vertical-tabset-content-spacing-sm:
55
+ var(--sky-comp-tab-vertical-content-space-inset-sm-top)
56
+ var(--sky-comp-tab-vertical-content-space-inset-sm-right)
57
+ var(--sky-comp-tab-vertical-content-space-inset-sm-bottom)
58
+ var(--sky-comp-tab-vertical-content-space-inset-sm-left);
59
+ }
60
+ `,
61
+ instructions: `
62
+ Vertical tab content spacing and scrolling are now controlled by the "layout" input on each "sky-vertical-tab" element, matching the "layout" input on "sky-tab". Tabs that do not specify a layout, or that specify "none", no longer receive the previous default padding or vertical scrolling. To address this change, set "layout" on each "sky-vertical-tab" to the value that matches its content ("blocks", "fit", or "list"), then remove these blocks of code.`,
63
+ },
64
+ ],
65
+ },
66
+ ],
67
+ },
68
+ {
69
+ name: '@skyux/layout',
70
+ components: [
71
+ {
72
+ name: 'toolbar',
73
+ styles: [
74
+ {
75
+ css: `
76
+ .sky-theme-modern {
77
+ --sky-compat-toolbar-container-padding: var(--sky-comp-toolbar-space-inset-top)
78
+ var(--sky-comp-toolbar-space-inset-right)
79
+ var(--sky-comp-toolbar-space-inset-bottom)
80
+ var(--sky-comp-toolbar-space-inset-left);
81
+ }
82
+ `,
83
+ instructions: `
84
+ The toolbar no longer applies its own left, right, and top padding unless it is inside a page or tab with layout="list". Everywhere else it now inherits the padding of its container, so that its contents line up with the content above and below it. To address this change, remove this block of code, then remove any negative margins or spacing overrides your app applied to compensate for the toolbar's extra padding.`,
85
+ },
86
+ ],
87
+ },
88
+ ],
89
+ },
90
+ {
91
+ name: '@skyux/filter-bar',
92
+ components: [
93
+ {
94
+ name: 'filter bar',
95
+ styles: [
96
+ {
97
+ css: `
98
+ .sky-theme-modern {
99
+ --sky-compat-filter-bar-toolbar-padding: var(--sky-comp-filter_bar-space-inset-top)
100
+ var(--sky-comp-filter_bar-space-inset-right)
101
+ var(--sky-comp-filter_bar-space-inset-bottom)
102
+ var(--sky-comp-filter_bar-space-inset-left);
103
+ }
104
+ `,
105
+ instructions: `
106
+ The filter bar no longer applies its own left, right, and top padding unless it is inside a page or tab with layout="list". Everywhere else it now inherits the padding of its container, so that its filters line up with the content above and below it. To address this change, remove this block of code, then remove any negative margins or spacing overrides your app applied to compensate for the filter bar's extra padding.`,
107
+ },
108
+ ],
109
+ },
110
+ ],
111
+ },
112
+ {
113
+ name: '@skyux/lists',
114
+ components: [
115
+ {
116
+ name: 'list summary',
117
+ styles: [
118
+ {
119
+ css: `
120
+ .sky-theme-modern {
121
+ --sky-compat-list-summary-padding: var(--sky-comp-list_summary-space-inset-top)
122
+ var(--sky-comp-list_summary-space-inset-right)
123
+ var(--sky-comp-list_summary-space-inset-bottom)
124
+ var(--sky-comp-list_summary-space-inset-left);
125
+ }
126
+ `,
127
+ instructions: `
128
+ The list summary no longer applies its own left and right padding unless it is inside a page or tab with layout="list". Everywhere else it now inherits the padding of its container, so that its summary items line up with the content above and below it. Its top and bottom padding is unchanged. To address this change, remove this block of code, then remove any negative margins or spacing overrides your app applied to compensate for the list summary's extra padding.`,
129
+ },
130
+ ],
131
+ },
132
+ {
133
+ name: 'repeater',
134
+ styles: [
135
+ {
136
+ css: `
137
+ .sky-theme-modern {
138
+ --sky-compat-repeater-first-item-space-inset-top: var(--sky-comp-repeater_item-space-inset-top);
139
+ }
140
+ `,
141
+ instructions: `
142
+ A repeater's first item no longer applies its own top padding when the repeater is the first thing inside a box, modal, or tile, since that container already supplies its own inset padding. To address this change, remove this block of code, then remove any negative margins or spacing overrides your app applied to compensate for the missing top padding.`,
143
+ },
144
+ ],
145
+ },
146
+ ],
147
+ },
32
148
  ],
33
149
  };
34
150
  function getProjectAppPath(project) {
@@ -70,22 +186,29 @@ function addStylesheetToStylesArray(styles, filePath) {
70
186
  function addStylesheetToWorkspace() {
71
187
  return () => (0, utility_1.updateWorkspace)((workspace) => {
72
188
  for (const project of workspace.projects.values()) {
189
+ if (project.extensions['projectType'] !== 'application') {
190
+ continue;
191
+ }
73
192
  for (const targetName of ['build', 'test']) {
74
- if (project.extensions['projectType'] === 'application') {
75
- const target = project.targets.get(targetName);
76
- const sourceRoot = getProjectAppPath(project);
77
- const filePath = `${sourceRoot}/${COMPAT_CSS_FILE_NAME}`;
78
- /* istanbul ignore else */
79
- if (target && target.options) {
80
- target.options['styles'] ??= [];
81
- addStylesheetToStylesArray(target.options['styles'], filePath);
82
- // A configuration's `styles` array replaces (rather than
83
- // merges with) the target's base `styles` array, so any
84
- // configuration that already declares its own `styles` needs
85
- // the compatibility stylesheet appended too.
86
- for (const configuration of Object.values(target.configurations ?? {})) {
87
- addStylesheetToStylesArray(configuration?.['styles'], filePath);
88
- }
193
+ const target = project.targets.get(targetName);
194
+ if (!target) {
195
+ continue;
196
+ }
197
+ if (!(0, builders_1.builderHasStylesOption)(target.builder)) {
198
+ continue;
199
+ }
200
+ const sourceRoot = getProjectAppPath(project);
201
+ const filePath = `${sourceRoot}/${COMPAT_CSS_FILE_NAME}`;
202
+ /* istanbul ignore else */
203
+ if (target.options) {
204
+ target.options['styles'] ??= [];
205
+ addStylesheetToStylesArray(target.options['styles'], filePath);
206
+ // A configuration's `styles` array replaces (rather than
207
+ // merges with) the target's base `styles` array, so any
208
+ // configuration that already declares its own `styles` needs
209
+ // the compatibility stylesheet appended too.
210
+ for (const configuration of Object.values(target.configurations ?? {})) {
211
+ addStylesheetToStylesArray(configuration?.['styles'], filePath);
89
212
  }
90
213
  }
91
214
  }
@@ -1 +1 @@
1
- {"version":3,"file":"add-compat-stylesheet.schematic.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/packages/src/schematics/migrations/update-15/add-compat-stylesheets/add-compat-stylesheet.schematic.ts"],"names":[],"mappings":";;AA6KA,4BAqBC;AAlMD,2DAA+D;AAC/D,yDAGqC;AACrC,qEAAqE;AAErE,iDAA8C;AAC9C,gDAAyD;AACzD,0DAA2D;AAE3D,MAAM,oBAAoB,GAAG,QAAQ,iBAAO,CAAC,KAAK,aAAa,CAAC;AAYhE,MAAM,YAAY,GAAgB;IAChC,SAAS,EAAE;QACT;YACE,IAAI,EAAE,cAAc;YACpB,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE;wBACN;4BACE,GAAG,EAAE;;;;CAIlB;4BACa,YAAY,EAAE;uUAC2S;yBAC1T;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC;AAEF,SAAS,iBAAiB,CAAC,OAA0B;IACnD,OAAO,GAAG,IAAA,yBAAa,EAAC,OAAO,CAAC,MAAM,CAAC;AACzC,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAe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C,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"add-compat-stylesheet.schematic.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/packages/src/schematics/migrations/update-15/add-compat-stylesheets/add-compat-stylesheet.schematic.ts"],"names":[],"mappings":";;AA4SA,4BAqBC;AAjUD,2DAA+D;AAC/D,yDAGqC;AACrC,qEAAqE;AAErE,iDAA8C;AAC9C,wDAAmE;AACnE,gDAAyD;AACzD,0DAA2D;AAE3D,MAAM,oBAAoB,GAAG,QAAQ,iBAAO,CAAC,KAAK,aAAa,CAAC;AAYhE,MAAM,YAAY,GAAgB;IAChC,SAAS,EAAE;QACT;YACE,IAAI,EAAE,cAAc;YACpB,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE;wBACN;4BACE,GAAG,EAAE;;;;CAIlB;4BACa,YAAY,EAAE;uUAC2S;yBAC1T;qBACF;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,aAAa;YACnB,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,iBAAiB;oBACvB,MAAM,EAAE;wBACN;4BACE,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;CAoBlB;4BACa,YAAY,EAAE;ycAC6a;yBAC5b;qBACF;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,eAAe;YACrB,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,SAAS;oBACf,MAAM,EAAE;wBACN;4BACE,GAAG,EAAE;;;;;;;CAOlB;4BACa,YAAY,EAAE;kaACsY;yBACrZ;qBACF;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,mBAAmB;YACzB,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,YAAY;oBAClB,MAAM,EAAE;wBACN;4BACE,GAAG,EAAE;;;;;;;CAOlB;4BACa,YAAY,EAAE;uaAC2Y;yBAC1Z;qBACF;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,cAAc;Y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C;QAC3C,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,KAAK,GAAW,EAAE,CAAC;QAEzB,KAAK,MAAM,CAAC,EAAE,iBAAiB,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;YACjE,IAAI,iBAAiB,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,aAAa,EAAE,CAAC;gBAClE,IAAI,MAAM,EAAE,CAAC;oBACX,MAAM,UAAU,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;oBACxD,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;gBAClD,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YACX,KAAK,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC;QACzC,CAAC;QAED,OAAO,IAAA,kBAAK,EAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ /**
3
+ * Migrates `sky-fluid-grid` templates from the deprecated `disableMargin`
4
+ * input to the new `inset` input, which has the opposite default: the fluid
5
+ * grid's outer left and right margin is now hidden unless `inset` is set to
6
+ * `true`.
7
+ */
8
+ export default function (): Rule;
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const workspace_1 = require("@schematics/angular/utility/workspace");
5
+ const template_1 = require("../../../utility/template");
6
+ const ng_ast_1 = require("../../../utility/typescript/ng-ast");
7
+ const visit_project_files_1 = require("../../../utility/visit-project-files");
8
+ // parse5 lowercases attribute names.
9
+ const STATIC_ATTRIBUTE = 'disablemargin';
10
+ // `[disableMargin]` and the equivalent long-form `bind-disableMargin` syntax
11
+ // are both bound (real boolean) forms.
12
+ const BOUND_ATTRIBUTES = ['[disablemargin]', 'bind-disablemargin'];
13
+ const INSET_ATTRIBUTES = ['inset', '[inset]', 'bind-inset'];
14
+ /**
15
+ * Quotes a value for use as an HTML attribute, choosing a quote character
16
+ * that doesn't appear in the value when possible. If the value contains
17
+ * both quote characters, double quotes are used and any embedded double
18
+ * quotes are entity-encoded so the attribute isn't terminated early.
19
+ */
20
+ function quoteAttributeValue(value) {
21
+ if (!value.includes('"')) {
22
+ return `"${value}"`;
23
+ }
24
+ if (!value.includes("'")) {
25
+ return `'${value}'`;
26
+ }
27
+ return `"${value.replace(/"/g, '&quot;')}"`;
28
+ }
29
+ function isElement(node) {
30
+ return 'tagName' in node;
31
+ }
32
+ function isFluidGrid(node) {
33
+ return node.tagName.toLowerCase() === 'sky-fluid-grid';
34
+ }
35
+ function removeAttribute(node, attributeName, content, offset, recorder) {
36
+ const location = node.sourceCodeLocation.attrs[attributeName];
37
+ // Also remove the whitespace preceding the attribute.
38
+ let start = location.startOffset;
39
+ while (/\s/.test(content.charAt(start - 1))) {
40
+ start--;
41
+ }
42
+ recorder.remove(offset + start, location.endOffset - start);
43
+ }
44
+ function replaceAttribute(node, attributeName, replacement, offset, recorder) {
45
+ const location = node.sourceCodeLocation.attrs[attributeName];
46
+ recorder.remove(offset + location.startOffset, location.endOffset - location.startOffset);
47
+ recorder.insertLeft(offset + location.startOffset, replacement);
48
+ }
49
+ /**
50
+ * Migrates a single `sky-fluid-grid` element's `disableMargin` usage to the
51
+ * new `inset` input, which has the opposite meaning:
52
+ * - A static (unbound) attribute binds its literal string value, and
53
+ * `disableMargin`'s `@Input()` doesn't coerce that to a boolean. So only a
54
+ * bare/empty attribute is falsy (the margin was shown); any other value --
55
+ * including the literal string `"false"` -- is truthy and already hides
56
+ * the margin, same as `"true"`. A bare/empty attribute becomes
57
+ * `inset` to keep the margin; any other static value is removed.
58
+ * - A bound literal `true` or `false` is a real boolean, so `[disableMargin]="true"`
59
+ * (or the equivalent `bind-disableMargin="true"`) is removed (hiding the
60
+ * margin is now the default) and `[disableMargin]="false"` becomes
61
+ * `inset` (preserving the margin).
62
+ * - A bound, non-literal expression becomes `[inset]="!(expression)"`.
63
+ * - If `disableMargin` isn't set at all, nothing changes: the fluid grid's
64
+ * default behavior is changing, so the file is left for manual review --
65
+ * unless `inset` is already set, in which case it's already migrated and
66
+ * doesn't need a warning.
67
+ *
68
+ * Known limitation: this only recognizes literal `disableMargin`/
69
+ * `[disableMargin]`/`bind-disableMargin` template attributes. It can't see
70
+ * usages set programmatically (e.g. via `ViewChild` or `Renderer2`), and a
71
+ * static, interpolated attribute (`disableMargin="{{ expression }}"`) is
72
+ * judged by its literal source text rather than the expression's runtime
73
+ * value.
74
+ */
75
+ function migrateFluidGrid(node, content, offset, recorder) {
76
+ const staticAttr = node.attrs.find((attr) => attr.name === STATIC_ATTRIBUTE);
77
+ const boundAttr = node.attrs.find((attr) => BOUND_ATTRIBUTES.includes(attr.name));
78
+ if (!staticAttr && !boundAttr) {
79
+ // Elements that already set `inset` (static or bound) have already been
80
+ // migrated, so they don't need a warning even though `disableMargin`
81
+ // isn't present.
82
+ return node.attrs.some((attr) => INSET_ATTRIBUTES.includes(attr.name));
83
+ }
84
+ if (staticAttr) {
85
+ if (staticAttr.value.trim() === '') {
86
+ replaceAttribute(node, STATIC_ATTRIBUTE, 'inset', offset, recorder);
87
+ }
88
+ else {
89
+ removeAttribute(node, STATIC_ATTRIBUTE, content, offset, recorder);
90
+ }
91
+ }
92
+ if (boundAttr) {
93
+ const attributeName = boundAttr.name;
94
+ const value = boundAttr.value.trim();
95
+ if (value === 'true') {
96
+ removeAttribute(node, attributeName, content, offset, recorder);
97
+ }
98
+ else if (value === 'false') {
99
+ replaceAttribute(node, attributeName, 'inset', offset, recorder);
100
+ }
101
+ else {
102
+ replaceAttribute(node, attributeName, `[inset]=${quoteAttributeValue(`!(${value})`)}`, offset, recorder);
103
+ }
104
+ }
105
+ return true;
106
+ }
107
+ function migrateTemplate(content, offset, recorder) {
108
+ const nodeQueue = [(0, template_1.parseTemplate)(content)];
109
+ let notConfiguredCount = 0;
110
+ while (nodeQueue.length) {
111
+ const node = nodeQueue.shift();
112
+ if (isElement(node) && isFluidGrid(node)) {
113
+ const migrated = migrateFluidGrid(node, content, offset, recorder);
114
+ if (!migrated) {
115
+ notConfiguredCount++;
116
+ }
117
+ }
118
+ if ((0, template_1.isParentNode)(node)) {
119
+ nodeQueue.push(...node.childNodes);
120
+ }
121
+ }
122
+ return notConfiguredCount;
123
+ }
124
+ async function updateSourceFiles(tree, context) {
125
+ const workspace = await (0, workspace_1.getWorkspace)(tree);
126
+ let notConfiguredCount = 0;
127
+ const visitedFiles = new Set();
128
+ workspace.projects.forEach((project) => {
129
+ (0, visit_project_files_1.visitProjectFiles)(tree, project.sourceRoot || project.root, (filePath) => {
130
+ if (filePath.endsWith('.html') || filePath.endsWith('.ts')) {
131
+ // Overlapping project roots (e.g. an app project at the workspace
132
+ // root with libraries nested inside it) can cause the same file to
133
+ // be visited more than once.
134
+ if (visitedFiles.has(filePath)) {
135
+ return;
136
+ }
137
+ visitedFiles.add(filePath);
138
+ const content = tree.readText(filePath);
139
+ if (!content.toLowerCase().includes('sky-fluid-grid')) {
140
+ return;
141
+ }
142
+ const recorder = tree.beginUpdate(filePath);
143
+ if (filePath.endsWith('.html')) {
144
+ notConfiguredCount += migrateTemplate(content, 0, recorder);
145
+ }
146
+ else {
147
+ const templates = (0, ng_ast_1.getInlineTemplates)((0, ng_ast_1.parseSourceFile)(tree, filePath));
148
+ templates.forEach((template) => {
149
+ notConfiguredCount += migrateTemplate(content.substring(template.start, template.end), template.start, recorder);
150
+ });
151
+ }
152
+ tree.commitUpdate(recorder);
153
+ }
154
+ });
155
+ });
156
+ if (notConfiguredCount > 0) {
157
+ context.logger.warn(`Found ${notConfiguredCount} <sky-fluid-grid> element(s) that do not set 'disableMargin'. ` +
158
+ "Starting in SKY UX 15, the fluid grid's outer left and right margin is hidden by default. " +
159
+ "Review these elements and add the 'inset' input (e.g. <sky-fluid-grid inset>) to any that should keep their margin.");
160
+ }
161
+ }
162
+ /**
163
+ * Migrates `sky-fluid-grid` templates from the deprecated `disableMargin`
164
+ * input to the new `inset` input, which has the opposite default: the fluid
165
+ * grid's outer left and right margin is now hidden unless `inset` is set to
166
+ * `true`.
167
+ */
168
+ function default_1() {
169
+ return async (tree, context) => {
170
+ await updateSourceFiles(tree, context);
171
+ };
172
+ }
173
+ //# sourceMappingURL=fluid-grid-inset.schematic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fluid-grid-inset.schematic.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/packages/src/schematics/migrations/update-15/fluid-grid-inset/fluid-grid-inset.schematic.ts"],"names":[],"mappings":";;AAuPA,4BAIC;AArPD,qEAAqE;AAIrE,wDAImC;AACnC,+DAG4C;AAC5C,8EAAyE;AAEzE,qCAAqC;AACrC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AACzC,6EAA6E;AAC7E,uCAAuC;AACvC,MAAM,gBAAgB,GAAG,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;AACnE,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAE5D;;;;;GAKG;AACH,SAAS,mBAAmB,CAAC,KAAa;IACxC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,KAAK,GAAG,CAAC;IACtB,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,KAAK,GAAG,CAAC;IACtB,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC;AAC9C,CAAC;AAED,SAAS,SAAS,CAChB,IAAkC;IAElC,OAAO,SAAS,IAAI,IAAI,CAAC;AAC3B,CAAC;AAED,SAAS,WAAW,CAAC,IAAyB;IAC5C,OAAO,IA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;YAC5F,qHAAqH,CACxH,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH;IACE,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAiB,EAAE;QACpE,MAAM,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC,CAAC;AACJ,CAAC"}
@@ -1,7 +1,18 @@
1
1
  import { Rule } from '@angular-devkit/schematics';
2
2
  /**
3
3
  * Replaces the resources services with their "legacy" equivalents, which emit
4
- * once and complete. The original services now emit again whenever the locale
5
- * changes.
4
+ * once and complete. The original services now emit again whenever the
5
+ * locale changes.
6
+ *
7
+ * A `provide:` token inside a `providers: [...]` array (e.g. a test's
8
+ * `TestBed.configureTestingModule`) is duplicated instead of renamed: the
9
+ * original provider stays, and a `useExisting` twin for the legacy token is
10
+ * added right after it unless that array already provides the legacy service.
11
+ * Provider variables are resolved within their lexical scope, including
12
+ * parenthesized expressions, type assertions, and `satisfies` expressions.
13
+ * The `skyAppResources` pipe and the `toHaveResourceText`/`toEqualResourceText`
14
+ * matchers still inject the
15
+ * original service, so renaming the provider outright would leave them
16
+ * resolving against the real, un-mocked service.
6
17
  */
7
18
  export default function (): Rule;