@lowdefy/blocks-color-selectors 4.0.0-rc.8 → 4.0.0

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ import { HexColorPicker, HexColorInput } from 'react-colorful';
17
17
  import classNames from 'classnames';
18
18
  import useClickOutside from './useClickOutside.js';
19
19
  const DEFAULT_COLOR = '#000000';
20
- export const ColorPicker = ({ className , disabled , hideInput , onChange , size , value =DEFAULT_COLOR })=>{
20
+ export const ColorPicker = ({ className, disabled, hideInput, onChange, size, value = DEFAULT_COLOR })=>{
21
21
  const popover = useRef();
22
22
  const [isOpen, toggle] = useState(false);
23
23
  const close = useCallback((newColor)=>{
@@ -50,7 +50,7 @@ export const ColorPicker = ({ className , disabled , hideInput , onChange , size
50
50
  'ant-input-sm': size === 'small',
51
51
  'ant-input-lg': size === 'large'
52
52
  }),
53
- color: value || '',
53
+ color: value ?? '',
54
54
  onChange: (newColor)=>{
55
55
  onChange(newColor);
56
56
  },
@@ -60,7 +60,7 @@ export const ColorPicker = ({ className , disabled , hideInput , onChange , size
60
60
  className: "color-picker-popover",
61
61
  ref: popover
62
62
  }, /*#__PURE__*/ React.createElement(HexColorPicker, {
63
- color: value || DEFAULT_COLOR,
63
+ color: value ?? DEFAULT_COLOR,
64
64
  onChange: onChange
65
65
  })));
66
66
  };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
16
16
  import { blockDefaultProps } from '@lowdefy/block-utils';
17
17
  import Label from '@lowdefy/blocks-antd/blocks/Label/Label.js';
18
18
  import ColorPicker from './ColorPicker.js';
19
- const ColorSelector = ({ blockId , components , events , loading , methods , properties , required , validation , value })=>{
19
+ const ColorSelector = ({ blockId, components, events, loading, methods, properties, required, validation, value })=>{
20
20
  return /*#__PURE__*/ React.createElement(Label, {
21
21
  blockId: blockId,
22
22
  components: components,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ const useClickOutside = (ref, handler, value)=>{
27
27
  };
28
28
  const validateEventStart = (event)=>{
29
29
  startedWhenMounted = ref.current;
30
- startedInside = ref.current && ref.current.contains(event.target);
30
+ startedInside = ref.current?.contains(event.target);
31
31
  };
32
32
  document.addEventListener('mousedown', validateEventStart);
33
33
  document.addEventListener('touchstart', validateEventStart);
package/dist/blocks.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable import/namespace */ /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
16
16
  const icons = {};
17
17
  const styles = {};
18
18
  Object.keys(blocks).forEach((block)=>{
19
- icons[block] = blocks[block].meta.icons || [];
20
- styles[block] = blocks[block].meta.styles || [];
19
+ icons[block] = blocks[block].meta.icons ?? [];
20
+ styles[block] = blocks[block].meta.styles ?? [];
21
21
  });
22
22
  export default {
23
23
  blocks: Object.keys(blocks),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/blocks-color-selectors",
3
- "version": "4.0.0-rc.8",
3
+ "version": "4.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "A Lowdefy color selector blocks based on react-color.",
6
6
  "homepage": "https://lowdefy.com",
@@ -41,16 +41,9 @@
41
41
  "files": [
42
42
  "dist/*"
43
43
  ],
44
- "scripts": {
45
- "build": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start && pnpm copyfiles",
46
- "clean": "rm -rf dist",
47
- "copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.yaml\" -e \"./src/**/*.snap\"",
48
- "prepublishOnly": "pnpm build",
49
- "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
50
- },
51
44
  "dependencies": {
52
- "@lowdefy/block-utils": "4.0.0-rc.8",
53
- "@lowdefy/blocks-antd": "4.0.0-rc.8",
45
+ "@lowdefy/block-utils": "4.0.0",
46
+ "@lowdefy/blocks-antd": "4.0.0",
54
47
  "classnames": "2.3.2",
55
48
  "react": "18.2.0",
56
49
  "react-colorful": "5.6.1",
@@ -58,22 +51,27 @@
58
51
  },
59
52
  "devDependencies": {
60
53
  "@emotion/jest": "11.10.5",
61
- "@lowdefy/block-dev": "4.0.0-rc.8",
62
- "@lowdefy/jest-yaml-transform": "4.0.0-rc.8",
63
- "@swc/cli": "0.1.59",
64
- "@swc/core": "1.3.24",
65
- "@swc/jest": "0.2.24",
54
+ "@lowdefy/block-dev": "4.0.0",
55
+ "@lowdefy/jest-yaml-transform": "4.0.0",
56
+ "@swc/cli": "0.1.63",
57
+ "@swc/core": "1.3.99",
58
+ "@swc/jest": "0.2.29",
66
59
  "@testing-library/dom": "8.19.1",
67
60
  "@testing-library/react": "13.4.0",
68
61
  "@testing-library/user-event": "14.4.3",
69
62
  "copyfiles": "2.4.1",
70
- "jest": "28.1.0",
63
+ "jest": "28.1.3",
71
64
  "jest-canvas-mock": "2.4.0",
72
- "jest-environment-jsdom": "28.1.0",
65
+ "jest-environment-jsdom": "28.1.3",
73
66
  "jest-serializer-html": "7.1.0"
74
67
  },
75
68
  "publishConfig": {
76
69
  "access": "public"
77
70
  },
78
- "gitHead": "db883daef0443647439b6fe2db845b846ffb6d4e"
79
- }
71
+ "scripts": {
72
+ "build": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start && pnpm copyfiles",
73
+ "clean": "rm -rf dist",
74
+ "copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.yaml\" -e \"./src/**/*.snap\"",
75
+ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
76
+ }
77
+ }