@atlaskit/color-picker 1.2.2 → 1.2.6

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,29 @@
1
1
  # @atlaskit/color-picker
2
2
 
3
+ ## 1.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b85e7ce12cd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b85e7ce12cd) - Internal upgrade of memoize-one to 6.0.0
8
+
9
+ ## 1.2.5
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 1.2.4
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
21
+ ## 1.2.3
22
+
23
+ ### Patch Changes
24
+
25
+ - [`a96040c6a39`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a96040c6a39) - Update imports to help tree-shake, greatly improving bundle size
26
+
3
27
  ## 1.2.2
4
28
 
5
29
  ### Patch Changes
@@ -9,5 +9,9 @@
9
9
  "../src/**/*.ts",
10
10
  "../src/**/*.tsx"
11
11
  ],
12
- "exclude": ["../src/**/__tests__/*"]
13
- }
12
+ "exclude": [
13
+ "../src/**/__tests__/*",
14
+ "../src/**/*.test.*",
15
+ "../src/**/test.*"
16
+ ]
17
+ }
@@ -28,15 +28,15 @@ function updatePopperProps(
28
28
  j,
29
29
  element: path,
30
30
  attributeName: 'popperProps',
31
- }).forEach(attribute => {
31
+ }).forEach((attribute) => {
32
32
  // convert positionFixed
33
33
  j(attribute)
34
34
  .find(j.JSXExpressionContainer)
35
35
  .find(j.ObjectExpression)
36
36
  .find(j.ObjectProperty)
37
37
  // @ts-ignore
38
- .filter(property => property.node.key.name === 'positionFixed')
39
- .forEach(property => {
38
+ .filter((property) => property.node.key.name === 'positionFixed')
39
+ .forEach((property) => {
40
40
  // @ts-ignore
41
41
  const strategy = property.node.value.value ? 'fixed' : 'absolute';
42
42
  property.replace(
@@ -53,7 +53,7 @@ function updatePopperProps(
53
53
  .find(j.ObjectExpression)
54
54
  .find(j.ObjectProperty)
55
55
  //@ts-ignore
56
- .filter(property => property.node.key.name === 'modifiers')
56
+ .filter((property) => property.node.key.name === 'modifiers')
57
57
  .forEach(() => {
58
58
  addCommentToStartOfFile({
59
59
  j,
@@ -36,7 +36,7 @@ export function getDefaultSpecifierName({
36
36
  }): Nullable<string> {
37
37
  const specifiers = base
38
38
  .find(j.ImportDeclaration)
39
- .filter(path => path.node.source.value === packageName)
39
+ .filter((path) => path.node.source.value === packageName)
40
40
  .find(j.ImportDefaultSpecifier);
41
41
 
42
42
  if (!specifiers.length) {
@@ -58,7 +58,7 @@ export function getSpecifierName({
58
58
  }): Nullable<string> {
59
59
  const specifiers = base
60
60
  .find(j.ImportDeclaration)
61
- .filter(path => path.node.source.value === packageName)
61
+ .filter((path) => path.node.source.value === packageName)
62
62
  .find(j.ImportSpecifier);
63
63
 
64
64
  if (!specifiers.length) {
@@ -66,7 +66,7 @@ export function getSpecifierName({
66
66
  }
67
67
  const specifierNode = specifiers
68
68
  .nodes()
69
- .find(node => node.imported.name === component);
69
+ .find((node) => node.imported.name === component);
70
70
  if (!specifierNode) {
71
71
  return null;
72
72
  }
@@ -86,10 +86,10 @@ export function getJSXAttributesByName({
86
86
  return j(element)
87
87
  .find(j.JSXOpeningElement)
88
88
  .find(j.JSXAttribute)
89
- .filter(attribute => {
89
+ .filter((attribute) => {
90
90
  const matches = j(attribute)
91
91
  .find(j.JSXIdentifier)
92
- .filter(identifier => identifier.value.name === attributeName);
92
+ .filter((identifier) => identifier.value.name === attributeName);
93
93
  return Boolean(matches.length);
94
94
  });
95
95
  }
@@ -125,7 +125,7 @@ export function isUsingSupportedSpread({
125
125
  return (
126
126
  j(element)
127
127
  .find(j.JSXSpreadAttribute)
128
- .filter(spread => {
128
+ .filter((spread) => {
129
129
  const argument = spread.value.argument;
130
130
  // in place expression is supported
131
131
  if (argument.type === 'ObjectExpression') {
@@ -170,10 +170,10 @@ export function isUsingThroughSpread({
170
170
  j(element)
171
171
  .find(j.JSXSpreadAttribute)
172
172
  .find(j.ObjectExpression)
173
- .filter(item => {
173
+ .filter((item) => {
174
174
  const match: boolean =
175
175
  item.value.properties.filter(
176
- property =>
176
+ (property) =>
177
177
  property.type === 'ObjectProperty' &&
178
178
  property.key.type === 'Identifier' &&
179
179
  property.key.name === propName,
@@ -195,11 +195,11 @@ export function isUsingThroughSpread({
195
195
  base
196
196
  .find(j.VariableDeclarator)
197
197
  .filter(
198
- declarator =>
198
+ (declarator) =>
199
199
  declarator.value.id.type === 'Identifier' &&
200
200
  declarator.value.id.name === identifier.value.name,
201
201
  )
202
- .filter(declarator => {
202
+ .filter((declarator) => {
203
203
  const value = declarator.value;
204
204
  if (value.id.type !== 'Identifier') {
205
205
  return false;
@@ -217,7 +217,7 @@ export function isUsingThroughSpread({
217
217
  // @ts-ignore
218
218
  value.init.properties.filter(
219
219
  // @ts-ignore
220
- property =>
220
+ (property) =>
221
221
  property.type === 'ObjectProperty' &&
222
222
  property.key.type === 'Identifier' &&
223
223
  property.key.name === propName,
@@ -298,11 +298,11 @@ export function addCommentBefore({
298
298
  message: string;
299
299
  }) {
300
300
  const content: string = ` TODO: (from codemod) ${clean(message)} `;
301
- target.forEach(path => {
301
+ target.forEach((path) => {
302
302
  path.value.comments = path.value.comments || [];
303
303
 
304
304
  const exists = path.value.comments.find(
305
- comment => comment.value === content,
305
+ (comment) => comment.value === content,
306
306
  );
307
307
 
308
308
  // avoiding duplicates of the same comment
@@ -330,7 +330,7 @@ export function updateRenderProps(
330
330
  // @ts-ignore
331
331
  (path: ASTPath<ObjectProperty>) => path.value.key.name === oldProperty,
332
332
  )
333
- .forEach(path => {
333
+ .forEach((path) => {
334
334
  j(path).replaceWith(
335
335
  j.property(
336
336
  'init',
@@ -58,7 +58,7 @@ var defaultPopperProps = {
58
58
  placement: 'bottom-start'
59
59
  };
60
60
  var packageName = "@atlaskit/color-picker";
61
- var packageVersion = "1.2.2";
61
+ var packageVersion = "1.2.6";
62
62
 
63
63
  var ColorPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
64
64
  (0, _inherits2.default)(ColorPickerWithoutAnalytics, _React$Component);
@@ -17,7 +17,7 @@ var _theme = require("@atlaskit/theme");
17
17
 
18
18
  var _constants = require("../constants");
19
19
 
20
- var _polished = require("polished");
20
+ var _darken = _interopRequireDefault(require("polished/lib/color/darken"));
21
21
 
22
22
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
23
23
 
@@ -47,7 +47,7 @@ exports.ColorCardButton = ColorCardButton;
47
47
  var ColorCardContent = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n top: 1px;\n left: 1px;\n width: 22px;\n height: 22px;\n border-radius: ", "px;\n background: ", ";\n border: solid 1px ", ";\n"])), (0, _theme.borderRadius)(), function (props) {
48
48
  return props.color;
49
49
  }, function (props) {
50
- return (0, _polished.darken)(0.1, props.color);
50
+ return (0, _darken.default)(0.1, props.color);
51
51
  });
52
52
 
53
53
  exports.ColorCardContent = ColorCardContent;
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/color-picker",
3
- "version": "1.2.2"
3
+ "version": "1.2.6"
4
4
  }
@@ -18,7 +18,7 @@ const defaultPopperProps = {
18
18
  placement: 'bottom-start'
19
19
  };
20
20
  const packageName = "@atlaskit/color-picker";
21
- const packageVersion = "1.2.2";
21
+ const packageVersion = "1.2.6";
22
22
  export class ColorPickerWithoutAnalytics extends React.Component {
23
23
  constructor(...args) {
24
24
  super(...args);
@@ -2,8 +2,9 @@ import styled, { css } from 'styled-components'; // AFP-2532 TODO: Fix automatic
2
2
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
3
3
 
4
4
  import { borderRadius, colors } from '@atlaskit/theme';
5
- import { COLOR_CARD_SIZE } from '../constants';
6
- import { darken } from 'polished';
5
+ import { COLOR_CARD_SIZE } from '../constants'; // polished has problems tree-shaking https://github.com/styled-components/polished/issues/478
6
+
7
+ import darken from 'polished/lib/color/darken';
7
8
  const buttonFocusedBorder = `border-color: ${colors.B100};`;
8
9
  const sharedColorContainerStyles = css`
9
10
  display: inline-block;
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/color-picker",
3
- "version": "1.2.2"
3
+ "version": "1.2.6"
4
4
  }
@@ -29,7 +29,7 @@ var defaultPopperProps = {
29
29
  placement: 'bottom-start'
30
30
  };
31
31
  var packageName = "@atlaskit/color-picker";
32
- var packageVersion = "1.2.2";
32
+ var packageVersion = "1.2.6";
33
33
  export var ColorPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
34
34
  _inherits(ColorPickerWithoutAnalytics, _React$Component);
35
35
 
@@ -6,8 +6,9 @@ import styled, { css } from 'styled-components'; // AFP-2532 TODO: Fix automatic
6
6
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
7
7
 
8
8
  import { borderRadius, colors } from '@atlaskit/theme';
9
- import { COLOR_CARD_SIZE } from '../constants';
10
- import { darken } from 'polished';
9
+ import { COLOR_CARD_SIZE } from '../constants'; // polished has problems tree-shaking https://github.com/styled-components/polished/issues/478
10
+
11
+ import darken from 'polished/lib/color/darken';
11
12
  var buttonFocusedBorder = "border-color: ".concat(colors.B100, ";");
12
13
  var sharedColorContainerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n position: relative;\n width: ", "px;\n height: ", "px;\n border: 2px solid transparent;\n box-sizing: border-box;\n border-radius: ", "px;\n transition: border-color 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38);\n background-color: transparent;\n border-color: transparent;\n padding: 0;\n cursor: pointer;\n outline: none;\n &:hover,\n &:focus {\n border-color: ", ";\n }\n"])), COLOR_CARD_SIZE, COLOR_CARD_SIZE, borderRadius() * 2, colors.B75);
13
14
  export var ColorCardOption = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n\n ", ";\n"])), sharedColorContainerStyles, function (props) {
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/color-picker",
3
- "version": "1.2.2"
3
+ "version": "1.2.6"
4
4
  }
@@ -1,7 +1,7 @@
1
1
  import { Palette } from './types';
2
2
  export declare const getWidth: (cols: number) => number;
3
- export declare const getOptions: (palette: Palette, selectedColor?: string | undefined) => {
3
+ export declare const getOptions: import("memoize-one").MemoizedFn<(palette: Palette, selectedColor?: string | undefined) => {
4
4
  options: Palette;
5
5
  value: import("./types").Color;
6
6
  focusedItemIndex: number;
7
- };
7
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/color-picker",
3
- "version": "1.2.2",
3
+ "version": "1.2.6",
4
4
  "description": "Jira Color Picker Component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -21,12 +21,12 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@atlaskit/analytics-next": "^8.0.0",
25
- "@atlaskit/icon": "^21.6.0",
26
- "@atlaskit/select": "^14.0.0",
27
- "@atlaskit/theme": "^11.0.0",
24
+ "@atlaskit/analytics-next": "^8.2.0",
25
+ "@atlaskit/icon": "^21.9.0",
26
+ "@atlaskit/select": "^15.0.0",
27
+ "@atlaskit/theme": "^12.0.0",
28
28
  "@babel/runtime": "^7.0.0",
29
- "memoize-one": "^5.1.0",
29
+ "memoize-one": "^6.0.0",
30
30
  "polished": "1.9.3",
31
31
  "styled-components": "^3.2.6"
32
32
  },
@@ -36,11 +36,11 @@
36
36
  "devDependencies": {
37
37
  "@atlaskit/docs": "*",
38
38
  "@atlaskit/visual-regression": "*",
39
- "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
39
+ "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
40
40
  "ast-types": "^0.13.3",
41
41
  "enzyme": "^3.10.0",
42
42
  "enzyme-adapter-react-16": "^1.15.1",
43
- "jscodeshift": "^0.11.0",
43
+ "jscodeshift": "^0.13.0",
44
44
  "react": "^16.8.0",
45
45
  "typescript": "3.9.6"
46
46
  },
@@ -54,5 +54,5 @@
54
54
  "./ColorPaletteMenu": "./src/components/ColorPaletteMenu.tsx",
55
55
  ".": "./src/index.ts"
56
56
  },
57
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
57
+ "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
58
58
  }