@atlaskit/primitives 14.7.1 → 14.7.3

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
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/primitives
2
2
 
3
+ ## 14.7.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#154215](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/154215)
8
+ [`eccacf87bc9e5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/eccacf87bc9e5) -
9
+ Tweaks formatting behaviour of the stage1 compiled codemod
10
+
11
+ ## 14.7.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [#152840](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/152840)
16
+ [`c6830ce5e4911`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c6830ce5e4911) -
17
+ Fix bug in `compiled-fork-stage1` codemod in which deprecated Pressable props were not being moved
18
+ into the `xcss` prop.
19
+
3
20
  ## 14.7.1
4
21
 
5
22
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  import type { API, FileInfo, JSXAttribute } from 'jscodeshift';
2
2
 
3
- const ANCHOR_XCSS_PROPS = [
3
+ const ANCHOR_PRESSABLE_XCSS_PROPS = [
4
4
  'backgroundColor',
5
5
  'padding',
6
6
  'paddingBlock',
@@ -35,6 +35,14 @@ function transform(file: FileInfo, { jscodeshift: j }: API) {
35
35
  return file.source;
36
36
  }
37
37
 
38
+ // Has @atlaskit/primitives import?
39
+ const hasPrimitivesImport =
40
+ root.find(j.ImportDeclaration, { source: { value: '@atlaskit/primitives' } }).length > 0;
41
+
42
+ if (!hasPrimitivesImport) {
43
+ return file.source;
44
+ }
45
+
38
46
  // Find all import declarations from '@atlaskit/primitives'
39
47
  root.find(j.ImportDeclaration, { source: { value: '@atlaskit/primitives' } }).forEach((path) => {
40
48
  // Change the import to '@atlaskit/primitives/compiled'
@@ -56,21 +64,21 @@ function transform(file: FileInfo, { jscodeshift: j }: API) {
56
64
  }
57
65
  }
58
66
 
59
- // Find JSX elements for Grid and Anchor
67
+ // Find JSX elements for Grid, Anchor and Pressable
60
68
  root.find(j.JSXElement).forEach((path) => {
61
69
  if (!j.JSXIdentifier.check(path.node.openingElement.name)) {
62
70
  return;
63
71
  }
64
72
 
65
73
  const elementName = path.node.openingElement.name.name;
66
- if (elementName !== 'Grid' && elementName !== 'Anchor') {
74
+ if (elementName !== 'Grid' && elementName !== 'Anchor' && elementName !== 'Pressable') {
67
75
  return;
68
76
  }
69
77
 
70
78
  const attributes = path.node.openingElement.attributes || [];
71
79
  const props = attributes.filter((attr) => j.JSXAttribute.check(attr)) as Array<JSXAttribute>;
72
80
 
73
- const xcssProps = elementName === 'Grid' ? GRID_XCSS_PROPS : ANCHOR_XCSS_PROPS;
81
+ const xcssProps = elementName === 'Grid' ? GRID_XCSS_PROPS : ANCHOR_PRESSABLE_XCSS_PROPS;
74
82
  const propsToTransform = props.filter(
75
83
  (prop) => j.JSXIdentifier.check(prop.name) && xcssProps.includes(prop.name.name),
76
84
  );
@@ -175,7 +183,7 @@ function transform(file: FileInfo, { jscodeshift: j }: API) {
175
183
  );
176
184
  }
177
185
 
178
- return root.toSource();
186
+ return root.toSource({ quote: 'single' });
179
187
  }
180
188
 
181
189
  export default transform;
@@ -70,7 +70,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
70
70
  action: 'clicked',
71
71
  componentName: componentName || 'Anchor',
72
72
  packageName: "@atlaskit/primitives",
73
- packageVersion: "14.7.1",
73
+ packageVersion: "14.7.3",
74
74
  analyticsData: analyticsContext,
75
75
  actionSubject: 'link'
76
76
  });
@@ -62,7 +62,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
62
62
  action: 'clicked',
63
63
  componentName: componentName || 'Pressable',
64
64
  packageName: "@atlaskit/primitives",
65
- packageVersion: "14.7.1",
65
+ packageVersion: "14.7.3",
66
66
  analyticsData: analyticsContext,
67
67
  actionSubject: 'button'
68
68
  });
@@ -100,7 +100,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
100
100
  action: 'clicked',
101
101
  componentName: componentName || 'Anchor',
102
102
  packageName: "@atlaskit/primitives",
103
- packageVersion: "14.7.1",
103
+ packageVersion: "14.7.3",
104
104
  analyticsData: analyticsContext,
105
105
  actionSubject: 'link'
106
106
  });
@@ -95,7 +95,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
95
95
  action: 'clicked',
96
96
  componentName: componentName || 'Pressable',
97
97
  packageName: "@atlaskit/primitives",
98
- packageVersion: "14.7.1",
98
+ packageVersion: "14.7.3",
99
99
  analyticsData: analyticsContext,
100
100
  actionSubject: 'button'
101
101
  });
@@ -55,7 +55,7 @@ const AnchorNoRef = ({
55
55
  action: 'clicked',
56
56
  componentName: componentName || 'Anchor',
57
57
  packageName: "@atlaskit/primitives",
58
- packageVersion: "14.7.1",
58
+ packageVersion: "14.7.3",
59
59
  analyticsData: analyticsContext,
60
60
  actionSubject: 'link'
61
61
  });
@@ -48,7 +48,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
48
48
  action: 'clicked',
49
49
  componentName: componentName || 'Pressable',
50
50
  packageName: "@atlaskit/primitives",
51
- packageVersion: "14.7.1",
51
+ packageVersion: "14.7.3",
52
52
  analyticsData: analyticsContext,
53
53
  actionSubject: 'button'
54
54
  });
@@ -90,7 +90,7 @@ const AnchorNoRef = ({
90
90
  action: 'clicked',
91
91
  componentName: componentName || 'Anchor',
92
92
  packageName: "@atlaskit/primitives",
93
- packageVersion: "14.7.1",
93
+ packageVersion: "14.7.3",
94
94
  analyticsData: analyticsContext,
95
95
  actionSubject: 'link'
96
96
  });
@@ -85,7 +85,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
85
85
  action: 'clicked',
86
86
  componentName: componentName || 'Pressable',
87
87
  packageName: "@atlaskit/primitives",
88
- packageVersion: "14.7.1",
88
+ packageVersion: "14.7.3",
89
89
  analyticsData: analyticsContext,
90
90
  actionSubject: 'button'
91
91
  });
@@ -60,7 +60,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
60
60
  action: 'clicked',
61
61
  componentName: componentName || 'Anchor',
62
62
  packageName: "@atlaskit/primitives",
63
- packageVersion: "14.7.1",
63
+ packageVersion: "14.7.3",
64
64
  analyticsData: analyticsContext,
65
65
  actionSubject: 'link'
66
66
  });
@@ -52,7 +52,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
52
52
  action: 'clicked',
53
53
  componentName: componentName || 'Pressable',
54
54
  packageName: "@atlaskit/primitives",
55
- packageVersion: "14.7.1",
55
+ packageVersion: "14.7.3",
56
56
  analyticsData: analyticsContext,
57
57
  actionSubject: 'button'
58
58
  });
@@ -94,7 +94,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
94
94
  action: 'clicked',
95
95
  componentName: componentName || 'Anchor',
96
96
  packageName: "@atlaskit/primitives",
97
- packageVersion: "14.7.1",
97
+ packageVersion: "14.7.3",
98
98
  analyticsData: analyticsContext,
99
99
  actionSubject: 'link'
100
100
  });
@@ -89,7 +89,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
89
89
  action: 'clicked',
90
90
  componentName: componentName || 'Pressable',
91
91
  packageName: "@atlaskit/primitives",
92
- packageVersion: "14.7.1",
92
+ packageVersion: "14.7.3",
93
93
  analyticsData: analyticsContext,
94
94
  actionSubject: 'button'
95
95
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "14.7.1",
3
+ "version": "14.7.3",
4
4
  "description": "Primitives are token-backed low-level building blocks.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -146,16 +146,16 @@
146
146
  "@af/formatting": "workspace:^",
147
147
  "@af/integration-testing": "workspace:^",
148
148
  "@af/visual-regression": "workspace:^",
149
- "@atlaskit/avatar": "^25.0.0",
149
+ "@atlaskit/avatar": "^25.1.0",
150
150
  "@atlaskit/button": "^23.0.0",
151
151
  "@atlaskit/checkbox": "^17.1.0",
152
- "@atlaskit/code": "^17.1.0",
152
+ "@atlaskit/code": "^17.2.0",
153
153
  "@atlaskit/docs": "^10.0.0",
154
- "@atlaskit/dropdown-menu": "^14.1.0",
154
+ "@atlaskit/dropdown-menu": "^14.2.0",
155
155
  "@atlaskit/flag": "^17.1.0",
156
156
  "@atlaskit/form": "^12.0.0",
157
157
  "@atlaskit/heading": "^5.2.0",
158
- "@atlaskit/icon": "^25.6.0",
158
+ "@atlaskit/icon": "^26.0.0",
159
159
  "@atlaskit/icon-object": "^7.1.0",
160
160
  "@atlaskit/image": "^3.0.0",
161
161
  "@atlaskit/link": "^3.1.0",