@easyv/react-components 0.0.50 → 0.2.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.
Files changed (82) hide show
  1. package/dist/BlurInput/index.d.ts +12 -0
  2. package/dist/BlurInput/index.js +58 -0
  3. package/dist/ColorsPicker/ControlBar.d.ts +8 -0
  4. package/dist/ColorsPicker/ControlBar.js +67 -0
  5. package/dist/ColorsPicker/History.d.ts +7 -0
  6. package/dist/ColorsPicker/History.js +53 -0
  7. package/dist/ColorsPicker/HistoryLinear.d.ts +6 -0
  8. package/dist/ColorsPicker/HistoryLinear.js +36 -0
  9. package/dist/ColorsPicker/HistoryPure.d.ts +5 -0
  10. package/dist/ColorsPicker/HistoryPure.js +28 -0
  11. package/dist/ColorsPicker/LinearColorPicker/LinearColorInput.d.ts +8 -0
  12. package/dist/ColorsPicker/LinearColorPicker/LinearColorInput.js +50 -0
  13. package/dist/ColorsPicker/LinearColorPicker/LinearColorPanel.d.ts +7 -0
  14. package/dist/ColorsPicker/LinearColorPicker/LinearColorPanel.js +77 -0
  15. package/dist/ColorsPicker/LinearColorPicker/LinearPointsBar.d.ts +9 -0
  16. package/dist/ColorsPicker/LinearColorPicker/LinearPointsBar.js +140 -0
  17. package/dist/ColorsPicker/LinearColorPicker/index.d.ts +2 -0
  18. package/dist/ColorsPicker/LinearColorPicker/index.js +2 -0
  19. package/dist/ColorsPicker/LinearColorPicker/useHistory.d.ts +4 -0
  20. package/dist/ColorsPicker/LinearColorPicker/useHistory.js +32 -0
  21. package/dist/ColorsPicker/MixedColorPicker/ColorTypeTab.d.ts +8 -0
  22. package/dist/ColorsPicker/MixedColorPicker/ColorTypeTab.js +30 -0
  23. package/dist/ColorsPicker/MixedColorPicker/MixedPanel.d.ts +8 -0
  24. package/dist/ColorsPicker/MixedColorPicker/MixedPanel.js +64 -0
  25. package/dist/ColorsPicker/MixedColorPicker/index.d.ts +1 -0
  26. package/dist/ColorsPicker/MixedColorPicker/index.js +1 -0
  27. package/dist/ColorsPicker/Palette.d.ts +7 -0
  28. package/dist/ColorsPicker/Palette.js +39 -0
  29. package/dist/ColorsPicker/Panel.d.ts +6 -0
  30. package/dist/ColorsPicker/Panel.js +224 -0
  31. package/dist/ColorsPicker/PanelContainer.d.ts +6 -0
  32. package/dist/ColorsPicker/PanelContainer.js +8 -0
  33. package/dist/ColorsPicker/PureColorPicker/PureColorInput.d.ts +7 -0
  34. package/dist/ColorsPicker/PureColorPicker/PureColorInput.js +61 -0
  35. package/dist/ColorsPicker/PureColorPicker/PureColorPanel.d.ts +7 -0
  36. package/dist/ColorsPicker/PureColorPicker/PureColorPanel.js +39 -0
  37. package/dist/ColorsPicker/PureColorPicker/index.d.ts +2 -0
  38. package/dist/ColorsPicker/PureColorPicker/index.js +2 -0
  39. package/dist/ColorsPicker/PureColorPicker/useHistory.d.ts +4 -0
  40. package/dist/ColorsPicker/PureColorPicker/useHistory.js +32 -0
  41. package/dist/ColorsPicker/PuresColorPicker/PuresCards.d.ts +10 -0
  42. package/dist/ColorsPicker/PuresColorPicker/PuresCards.js +40 -0
  43. package/dist/ColorsPicker/PuresColorPicker/PuresColorInput.d.ts +7 -0
  44. package/dist/ColorsPicker/PuresColorPicker/PuresColorInput.js +20 -0
  45. package/dist/ColorsPicker/PuresColorPicker/PuresColorPanel.d.ts +7 -0
  46. package/dist/ColorsPicker/PuresColorPicker/PuresColorPanel.js +78 -0
  47. package/dist/ColorsPicker/PuresColorPicker/index.d.ts +3 -0
  48. package/dist/ColorsPicker/PuresColorPicker/index.js +3 -0
  49. package/dist/ColorsPicker/PuresColorPicker/useHistory.d.ts +5 -0
  50. package/dist/ColorsPicker/PuresColorPicker/useHistory.js +34 -0
  51. package/dist/ColorsPicker/RangeColorPicker/RangeColorInput.d.ts +7 -0
  52. package/dist/ColorsPicker/RangeColorPicker/RangeColorInput.js +19 -0
  53. package/dist/ColorsPicker/RangeColorPicker/RangeColorPanel.d.ts +7 -0
  54. package/dist/ColorsPicker/RangeColorPicker/RangeColorPanel.js +59 -0
  55. package/dist/ColorsPicker/RangeColorPicker/RangePointBar.d.ts +8 -0
  56. package/dist/ColorsPicker/RangeColorPicker/RangePointBar.js +63 -0
  57. package/dist/ColorsPicker/RangeColorPicker/index.d.ts +2 -0
  58. package/dist/ColorsPicker/RangeColorPicker/index.js +2 -0
  59. package/dist/ColorsPicker/common/Preview.d.ts +11 -0
  60. package/dist/ColorsPicker/common/Preview.js +60 -0
  61. package/dist/ColorsPicker/hooks/useColorsPicker.d.ts +25 -0
  62. package/dist/ColorsPicker/hooks/useColorsPicker.js +78 -0
  63. package/dist/ColorsPicker/hooks/useControlBlock.d.ts +11 -0
  64. package/dist/ColorsPicker/hooks/useControlBlock.js +61 -0
  65. package/dist/ColorsPicker/hooks/useLocalstorageRef.d.ts +3 -0
  66. package/dist/ColorsPicker/hooks/useLocalstorageRef.js +11 -0
  67. package/dist/ColorsPicker/index.d.ts +4 -0
  68. package/dist/ColorsPicker/index.js +182 -0
  69. package/dist/ColorsPicker/interface.d.ts +58 -0
  70. package/dist/ColorsPicker/interface.js +1 -0
  71. package/dist/ColorsPicker/style/index.less +515 -0
  72. package/dist/ColorsPicker/utils.d.ts +29 -0
  73. package/dist/ColorsPicker/utils.js +233 -0
  74. package/dist/Watermark/index.d.ts +2 -0
  75. package/dist/Watermark/index.js +2 -0
  76. package/dist/Watermark/interface.d.ts +1 -0
  77. package/dist/Watermark/interface.js +1 -0
  78. package/dist/global.d.ts +13 -0
  79. package/dist/hooks/index.d.ts +3 -0
  80. package/dist/index.d.ts +4 -0
  81. package/dist/index.js +3 -3
  82. package/package.json +12 -9
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { InputProps } from '../index';
3
+ export interface BlurInputProps extends InputProps {
4
+ value: string;
5
+ validate?: (value: string) => boolean;
6
+ onChange: (value: string) => void;
7
+ }
8
+ export interface BlurInputRef {
9
+ forceUpdate: (value: string) => void;
10
+ }
11
+ declare const _default: import("react").ForwardRefExoticComponent<BlurInputProps & import("react").RefAttributes<BlurInputRef>>;
12
+ export default _default;
@@ -0,0 +1,58 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _excluded = ["value", "validate", "onChange"];
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
9
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
12
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
15
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
16
+ import { Input } from "../index";
17
+ import { useState, useEffect, forwardRef, useImperativeHandle } from 'react';
18
+ import { jsx as _jsx } from "react/jsx-runtime";
19
+ export default /*#__PURE__*/forwardRef(function BlurInput(_ref, ref) {
20
+ var value = _ref.value,
21
+ validate = _ref.validate,
22
+ onChange = _ref.onChange,
23
+ restProps = _objectWithoutProperties(_ref, _excluded);
24
+ var _useState = useState(value),
25
+ _useState2 = _slicedToArray(_useState, 2),
26
+ localValue = _useState2[0],
27
+ setLocalValue = _useState2[1];
28
+ useImperativeHandle(ref, function () {
29
+ return {
30
+ forceUpdate: function forceUpdate(val) {
31
+ setLocalValue(val !== null && val !== void 0 ? val : value);
32
+ }
33
+ };
34
+ });
35
+ useEffect(function () {
36
+ setLocalValue(value);
37
+ }, [value]);
38
+ var handleBlur = function handleBlur() {
39
+ if (validate) {
40
+ if (!validate(localValue)) {
41
+ setLocalValue(value);
42
+ } else {
43
+ onChange === null || onChange === void 0 ? void 0 : onChange(localValue);
44
+ }
45
+ } else {
46
+ onChange === null || onChange === void 0 ? void 0 : onChange(localValue);
47
+ }
48
+ };
49
+ var handlePressEnter = function handlePressEnter(e) {
50
+ e.currentTarget.blur();
51
+ };
52
+ return /*#__PURE__*/_jsx(Input, _objectSpread(_objectSpread({}, restProps), {}, {
53
+ value: localValue,
54
+ onChange: setLocalValue,
55
+ onBlur: handleBlur,
56
+ onPressEnter: handlePressEnter
57
+ }));
58
+ });
@@ -0,0 +1,8 @@
1
+ import { Color } from './interface';
2
+ interface ControlBarProps {
3
+ color: Color;
4
+ type: 'hue' | 'alpha';
5
+ onChange: (x: number) => void;
6
+ }
7
+ export default function ControlBar({ color, type, onChange }: ControlBarProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,67 @@
1
+ import classNames from 'classnames';
2
+ import tinycolor from 'tinycolor2';
3
+ import { useControlBlock } from "./hooks/useControlBlock";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
+ export default function ControlBar(_ref) {
7
+ var color = _ref.color,
8
+ type = _ref.type,
9
+ _onChange = _ref.onChange;
10
+ var x;
11
+ if (type === 'alpha') {
12
+ x = color.alpha;
13
+ } else {
14
+ x = color.hsv.h / 360;
15
+ }
16
+ var rgbColor = tinycolor(color.hsv).toRgbString();
17
+ var _useControlBlock = useControlBlock({
18
+ value: [x, 0],
19
+ onChange: function onChange(value) {
20
+ if (type === 'hue') {
21
+ _onChange(value[0] * 360);
22
+ } else {
23
+ _onChange(value[0]);
24
+ }
25
+ }
26
+ }),
27
+ blockRef = _useControlBlock.blockRef,
28
+ onMouseDown = _useControlBlock.onMouseDown;
29
+ if (type === 'alpha') {
30
+ return /*#__PURE__*/_jsx("div", {
31
+ className: classNames("colors-picker-control-bar colors-picker-control-alpha"),
32
+ children: /*#__PURE__*/_jsxs("div", {
33
+ ref: blockRef,
34
+ className: "colors-picker-control-bar-inner",
35
+ style: {
36
+ backgroundImage: "linear-gradient(to right, transparent, ".concat(rgbColor, ")")
37
+ },
38
+ onMouseDown: onMouseDown,
39
+ children: [/*#__PURE__*/_jsx("div", {
40
+ className: "colors-picker-control-bar-right-box",
41
+ style: {
42
+ backgroundColor: rgbColor
43
+ }
44
+ }), /*#__PURE__*/_jsx("div", {
45
+ className: "colors-picker-handler",
46
+ style: {
47
+ left: "".concat(x * 100, "%")
48
+ }
49
+ })]
50
+ })
51
+ });
52
+ }
53
+ return /*#__PURE__*/_jsx("div", {
54
+ className: classNames("colors-picker-control-bar colors-picker-control-hue"),
55
+ children: /*#__PURE__*/_jsx("div", {
56
+ ref: blockRef,
57
+ className: "colors-picker-control-bar-inner",
58
+ onMouseDown: onMouseDown,
59
+ children: /*#__PURE__*/_jsx("div", {
60
+ className: "colors-picker-handler",
61
+ style: {
62
+ left: "".concat(x * 100, "%")
63
+ }
64
+ })
65
+ })
66
+ });
67
+ }
@@ -0,0 +1,7 @@
1
+ import { GradientColorValue } from './interface';
2
+ interface HistoryProps<T extends 'pure' | 'linear'> {
3
+ type: T;
4
+ onSelect: (color: T extends 'linear' ? string | GradientColorValue : string) => void;
5
+ }
6
+ export default function History<T extends 'pure' | 'linear'>({ type, onSelect, }: HistoryProps<T>): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,53 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { useState } from 'react';
8
+ import { DownOutlined } from '@easyv/react-icons';
9
+ import classNames from 'classnames';
10
+ import HistoryPure from "./HistoryPure";
11
+ import HistoryLinear from "./HistoryLinear";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { Fragment as _Fragment } from "react/jsx-runtime";
15
+ export default function History(_ref) {
16
+ var type = _ref.type,
17
+ onSelect = _ref.onSelect;
18
+ var _useState = useState(false),
19
+ _useState2 = _slicedToArray(_useState, 2),
20
+ collapsed = _useState2[0],
21
+ setCollapsed = _useState2[1];
22
+ var handleCollapse = function handleCollapse() {
23
+ setCollapsed(function (prev) {
24
+ return !prev;
25
+ });
26
+ };
27
+ return /*#__PURE__*/_jsxs("div", {
28
+ className: "colors-picker-history",
29
+ children: [/*#__PURE__*/_jsxs("div", {
30
+ className: "colors-picker-history-title",
31
+ onClick: handleCollapse,
32
+ children: [/*#__PURE__*/_jsx("div", {
33
+ children: "\u6700\u8FD1\u4F7F\u7528"
34
+ }), /*#__PURE__*/_jsx(DownOutlined, {
35
+ className: classNames('colors-picker-history-icon', {
36
+ 'colors-picker-history-collapsed': collapsed
37
+ })
38
+ })]
39
+ }), type === 'linear' && /*#__PURE__*/_jsxs(_Fragment, {
40
+ children: [/*#__PURE__*/_jsx("div", {
41
+ className: "colors-picker-history-type-title",
42
+ children: "\u6E10\u53D8\u8272"
43
+ }), /*#__PURE__*/_jsx(HistoryLinear, {
44
+ onSelect: onSelect
45
+ }), /*#__PURE__*/_jsx("div", {
46
+ className: "colors-picker-history-type-title",
47
+ children: "\u7EAF\u8272"
48
+ })]
49
+ }), /*#__PURE__*/_jsx(HistoryPure, {
50
+ onSelect: onSelect
51
+ })]
52
+ });
53
+ }
@@ -0,0 +1,6 @@
1
+ import { GradientColorValue } from './interface';
2
+ interface HistoryLinearProps {
3
+ onSelect: (color: GradientColorValue) => void;
4
+ }
5
+ export default function HistoryLinear({ onSelect }: HistoryLinearProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,36 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { useLocalStorageState } from 'ahooks';
8
+ import Preview from "./common/Preview";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ export default function HistoryLinear(_ref) {
11
+ var onSelect = _ref.onSelect;
12
+ var _useLocalStorageState = useLocalStorageState('usedLinearColors'),
13
+ _useLocalStorageState2 = _slicedToArray(_useLocalStorageState, 1),
14
+ usedLinearColors = _useLocalStorageState2[0];
15
+ return /*#__PURE__*/_jsx("div", {
16
+ className: "colors-picker-history-pure-wrapper",
17
+ children: usedLinearColors === null || usedLinearColors === void 0 ? void 0 : usedLinearColors.map(function (d, i) {
18
+ return /*#__PURE__*/_jsx(Preview, {
19
+ border: true,
20
+ type: "linear",
21
+ color: {
22
+ stops: d,
23
+ angle: 0,
24
+ opacity: 1
25
+ },
26
+ onClick: function onClick() {
27
+ return onSelect({
28
+ stops: d,
29
+ angle: 0,
30
+ opacity: 1
31
+ });
32
+ }
33
+ }, i);
34
+ })
35
+ });
36
+ }
@@ -0,0 +1,5 @@
1
+ interface HistoryPureProps {
2
+ onSelect: (color: string) => void;
3
+ }
4
+ export default function HistoryPure({ onSelect }: HistoryPureProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,28 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { useLocalStorageState } from 'ahooks';
8
+ import Preview from "./common/Preview";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ export default function HistoryPure(_ref) {
11
+ var onSelect = _ref.onSelect;
12
+ var _useLocalStorageState = useLocalStorageState('usedColors'),
13
+ _useLocalStorageState2 = _slicedToArray(_useLocalStorageState, 1),
14
+ usedPureColors = _useLocalStorageState2[0];
15
+ return /*#__PURE__*/_jsx("div", {
16
+ className: "colors-picker-history-pure-wrapper",
17
+ children: usedPureColors === null || usedPureColors === void 0 ? void 0 : usedPureColors.map(function (d, i) {
18
+ return /*#__PURE__*/_jsx(Preview, {
19
+ border: true,
20
+ type: "pure",
21
+ color: d,
22
+ onClick: function onClick() {
23
+ return onSelect(d);
24
+ }
25
+ }, i);
26
+ })
27
+ });
28
+ }
@@ -0,0 +1,8 @@
1
+ import { ColorValueMap } from '../interface';
2
+ interface LinearColorInputProps {
3
+ value: ColorValueMap['linear'];
4
+ onTrigger: () => void;
5
+ onChange: (val: ColorValueMap['linear']) => void;
6
+ }
7
+ export default function LinearColorInput({ value, onChange, onTrigger, }: LinearColorInputProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,50 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ import { Input } from "../../index";
8
+ import BlurInput from "../../BlurInput";
9
+ import Preview from "../common/Preview";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ export default function LinearColorInput(_ref) {
13
+ var value = _ref.value,
14
+ onChange = _ref.onChange,
15
+ onTrigger = _ref.onTrigger;
16
+ var handleAlphaChange = function handleAlphaChange(val) {
17
+ onChange(_objectSpread(_objectSpread({}, value), {}, {
18
+ opacity: val
19
+ }));
20
+ };
21
+ return /*#__PURE__*/_jsxs("div", {
22
+ className: "pure-color-picker",
23
+ children: [/*#__PURE__*/_jsx("div", {
24
+ className: "pure-color-picker-preview",
25
+ onClick: onTrigger,
26
+ children: /*#__PURE__*/_jsx(Preview, {
27
+ type: "linear",
28
+ shape: "square",
29
+ color: value,
30
+ size: 12
31
+ })
32
+ }), /*#__PURE__*/_jsx(Input, {
33
+ size: "small",
34
+ prefix: "#",
35
+ value: '线性渐变',
36
+ disabled: true
37
+ }), /*#__PURE__*/_jsx(BlurInput, {
38
+ size: "small",
39
+ suffix: "%",
40
+ className: 'pure-color-picker-alpha',
41
+ value: (value.opacity * 100).toFixed(0),
42
+ validate: function validate(val) {
43
+ return +val >= 0 && +val <= 100;
44
+ },
45
+ onChange: function onChange(val) {
46
+ return handleAlphaChange(+val / 100);
47
+ }
48
+ })]
49
+ });
50
+ }
@@ -0,0 +1,7 @@
1
+ import { ColorValueMap } from '../interface';
2
+ interface LinearColorPanelProps {
3
+ value: ColorValueMap['linear'];
4
+ onChange: (value: ColorValueMap['linear']) => void;
5
+ }
6
+ export default function LinearColorPanel({ value, onChange, }: LinearColorPanelProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,77 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
11
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
15
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
16
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
+ import { useState } from 'react';
18
+ import Panel from "../Panel";
19
+ import History from "../History";
20
+ import LinearPointsBar from "./LinearPointsBar";
21
+ import useHistory from "./useHistory";
22
+ import { jsx as _jsx } from "react/jsx-runtime";
23
+ import { Fragment as _Fragment } from "react/jsx-runtime";
24
+ import { jsxs as _jsxs } from "react/jsx-runtime";
25
+ export default function LinearColorPanel(_ref) {
26
+ var _value$stops$currentI;
27
+ var value = _ref.value,
28
+ onChange = _ref.onChange;
29
+ var _useState = useState(0),
30
+ _useState2 = _slicedToArray(_useState, 2),
31
+ currentIndex = _useState2[0],
32
+ setCurrentIndex = _useState2[1];
33
+ var _useState3 = useState(0),
34
+ _useState4 = _slicedToArray(_useState3, 2),
35
+ updateKey = _useState4[0],
36
+ setUpdateKey = _useState4[1];
37
+ useHistory({
38
+ value: value
39
+ });
40
+ var handleChange = function handleChange(color) {
41
+ var newStops = _toConsumableArray(value.stops);
42
+ newStops[currentIndex].color = color;
43
+ onChange(_objectSpread(_objectSpread({}, value), {}, {
44
+ stops: newStops
45
+ }));
46
+ };
47
+ var handleIndexSelect = function handleIndexSelect(index) {
48
+ setCurrentIndex(index);
49
+ setUpdateKey(function (prev) {
50
+ return prev + 1;
51
+ });
52
+ };
53
+ var handleSelect = function handleSelect(val) {
54
+ if (typeof val === 'string') {
55
+ handleChange(val);
56
+ } else {
57
+ onChange(val);
58
+ }
59
+ setUpdateKey(function (prev) {
60
+ return prev + 1;
61
+ });
62
+ };
63
+ return /*#__PURE__*/_jsxs(_Fragment, {
64
+ children: [/*#__PURE__*/_jsx(LinearPointsBar, {
65
+ active: currentIndex,
66
+ value: value,
67
+ onSelect: handleIndexSelect,
68
+ onChange: onChange
69
+ }), /*#__PURE__*/_jsx(Panel, {
70
+ color: (_value$stops$currentI = value.stops[currentIndex]) === null || _value$stops$currentI === void 0 ? void 0 : _value$stops$currentI.color,
71
+ onChange: handleChange
72
+ }, updateKey), /*#__PURE__*/_jsx(History, {
73
+ type: "linear",
74
+ onSelect: handleSelect
75
+ })]
76
+ });
77
+ }
@@ -0,0 +1,9 @@
1
+ import { ColorValueMap } from '../interface';
2
+ interface LinearPointsBarProps {
3
+ active: number;
4
+ value: ColorValueMap['linear'];
5
+ onSelect: (current: number) => void;
6
+ onChange: (value: ColorValueMap['linear']) => void;
7
+ }
8
+ export default function LinearPointsBar({ active, value, onSelect, onChange, }: LinearPointsBarProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,140 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
11
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
12
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13
+ import { SwapOutlined } from '@easyv/react-icons';
14
+ import classNames from 'classnames';
15
+ import { getLinearGradientStyle, getMiddleColor } from "../utils";
16
+ import { useKeyPress } from 'ahooks';
17
+ import { useControlBlock } from "../hooks/useControlBlock";
18
+ import { useEffect, useRef } from 'react';
19
+ import { jsx as _jsx } from "react/jsx-runtime";
20
+ import { jsxs as _jsxs } from "react/jsx-runtime";
21
+ export default function LinearPointsBar(_ref) {
22
+ var active = _ref.active,
23
+ value = _ref.value,
24
+ onSelect = _ref.onSelect,
25
+ _onChange = _ref.onChange;
26
+ var currentIndexRef = useRef(active);
27
+ var valueRef = useRef(value);
28
+ useEffect(function () {
29
+ currentIndexRef.current = active;
30
+ }, [active]);
31
+ useEffect(function () {
32
+ valueRef.current = value;
33
+ }, [value]);
34
+ var handleDelete = function handleDelete() {
35
+ if (value.stops.length <= 2) return;
36
+ var newStops = _toConsumableArray(value.stops);
37
+ newStops.splice(active, 1);
38
+ _onChange(_objectSpread(_objectSpread({}, value), {}, {
39
+ stops: newStops
40
+ }));
41
+ handleSelect(Math.max(active - 1, 0));
42
+ };
43
+ var handleSelect = function handleSelect(newIndex) {
44
+ currentIndexRef.current = newIndex;
45
+ onSelect(newIndex);
46
+ };
47
+ useKeyPress('Backspace', function (e) {
48
+ e.stopImmediatePropagation();
49
+
50
+ // 过滤掉表单的删除
51
+ if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) {
52
+ return;
53
+ }
54
+ handleDelete();
55
+ });
56
+ var sortedStops = value.stops.concat().sort(function (a, b) {
57
+ return a.offset - b.offset;
58
+ });
59
+ var _useControlBlock = useControlBlock({
60
+ value: [-Infinity, 0],
61
+ onChange: function onChange(val, e) {
62
+ if (e.type === 'mousedown') {
63
+ if (e.target !== blockRef.current) {
64
+ var _e$target, _e$target$dataset;
65
+ handleSelect(Number((_e$target = e.target) === null || _e$target === void 0 ? void 0 : (_e$target$dataset = _e$target.dataset) === null || _e$target$dataset === void 0 ? void 0 : _e$target$dataset.index));
66
+ } else {
67
+ var newStop = {
68
+ offset: val[0] * 100,
69
+ color: getMiddleColor(value.stops, val[0] * 100)
70
+ };
71
+ var newValue = _objectSpread(_objectSpread({}, value), {}, {
72
+ stops: [].concat(_toConsumableArray(value.stops), [newStop])
73
+ });
74
+ valueRef.current = newValue;
75
+ _onChange(newValue);
76
+ handleSelect(value.stops.length);
77
+ }
78
+ } else {
79
+ _onChange(_objectSpread(_objectSpread({}, value), {}, {
80
+ stops: valueRef.current.stops.map(function (d, i) {
81
+ return _objectSpread(_objectSpread({}, d), {}, {
82
+ offset: i === currentIndexRef.current ? val[0] * 100 : d.offset
83
+ });
84
+ })
85
+ }));
86
+ }
87
+ }
88
+ }),
89
+ blockRef = _useControlBlock.blockRef,
90
+ onMouseDown = _useControlBlock.onMouseDown;
91
+ var handleRevert = function handleRevert() {
92
+ var newStops = value.stops.map(function (d) {
93
+ return _objectSpread(_objectSpread({}, d), {}, {
94
+ offset: 100 - d.offset
95
+ });
96
+ });
97
+ _onChange(_objectSpread(_objectSpread({}, value), {}, {
98
+ stops: newStops
99
+ }));
100
+ };
101
+ return /*#__PURE__*/_jsxs("div", {
102
+ className: "colors-picker-linear-points-bar-wrapper",
103
+ children: [/*#__PURE__*/_jsxs("div", {
104
+ className: "colors-picker-linear-points-bar",
105
+ children: [/*#__PURE__*/_jsx("div", {
106
+ className: "colors-picker-points-bar-prev-half",
107
+ style: {
108
+ backgroundColor: sortedStops[0].color
109
+ }
110
+ }), /*#__PURE__*/_jsx("div", {
111
+ className: "colors-picker-points-bar-next-half",
112
+ style: {
113
+ backgroundColor: sortedStops[sortedStops.length - 1].color
114
+ }
115
+ }), /*#__PURE__*/_jsx("div", {}), /*#__PURE__*/_jsx("div", {
116
+ ref: blockRef,
117
+ className: "colors-picker-linear-points-bar-color",
118
+ style: getLinearGradientStyle(_objectSpread(_objectSpread({}, value), {}, {
119
+ angle: 90
120
+ })),
121
+ onMouseDown: onMouseDown,
122
+ children: value === null || value === void 0 ? void 0 : value.stops.map(function (d, i) {
123
+ return /*#__PURE__*/_jsx("div", {
124
+ className: classNames('colors-picker-linear-point', {
125
+ active: active === i
126
+ }),
127
+ style: {
128
+ left: "".concat(d.offset, "%")
129
+ },
130
+ "data-index": i
131
+ }, "".concat(d.color, "_").concat(i));
132
+ })
133
+ })]
134
+ }), /*#__PURE__*/_jsx("div", {
135
+ className: "colors-picker-linear-points-switch",
136
+ onClick: handleRevert,
137
+ children: /*#__PURE__*/_jsx(SwapOutlined, {})
138
+ })]
139
+ });
140
+ }
@@ -0,0 +1,2 @@
1
+ export { default as LinearColorInput } from './LinearColorInput';
2
+ export { default as LinearColorPanel } from './LinearColorPanel';
@@ -0,0 +1,2 @@
1
+ export { default as LinearColorInput } from "./LinearColorInput";
2
+ export { default as LinearColorPanel } from "./LinearColorPanel";
@@ -0,0 +1,4 @@
1
+ import { ColorValueMap } from '../interface';
2
+ export default function useHistory({ value, }: {
3
+ value: ColorValueMap['linear'];
4
+ }): null;