mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
chore(deps): bump react-colorful from 5.6.1 to 5.7.0 (#12386)
* chore(deps): bump react-colorful from 5.6.1 to 5.7.0 Bumps [react-colorful](https://github.com/omgovich/react-colorful) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/omgovich/react-colorful/releases) - [Changelog](https://github.com/omgovich/react-colorful/blob/master/CHANGELOG.md) - [Commits](https://github.com/omgovich/react-colorful/commits/5.7.0) --- updated-dependencies: - dependency-name: react-colorful dependency-version: 5.7.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Use new prop --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tom Moor <tom@getoutline.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import copy from "copy-to-clipboard";
|
||||
import { debounce } from "es-toolkit/compat";
|
||||
import { CheckmarkIcon, CopyIcon } from "outline-icons";
|
||||
import { useMemo, useState, useEffect, useRef, useCallback } from "react";
|
||||
import { useState, useRef, useCallback } from "react";
|
||||
import {
|
||||
HexColorInput,
|
||||
HexAlphaColorPicker,
|
||||
@@ -41,23 +40,6 @@ function ColorPicker({ activeColor, onSelect, alpha }: Props) {
|
||||
[onSelect]
|
||||
);
|
||||
|
||||
const debouncedApplyColor = useMemo(
|
||||
() => debounce(applyColor, 250),
|
||||
[applyColor]
|
||||
);
|
||||
|
||||
useEffect(
|
||||
() => () => {
|
||||
debouncedApplyColor.cancel();
|
||||
},
|
||||
[debouncedApplyColor]
|
||||
);
|
||||
|
||||
const handleColorChangePicker = (newColor: string) => {
|
||||
setColor(newColor);
|
||||
debouncedApplyColor(newColor);
|
||||
};
|
||||
|
||||
const handleColorChangeInput = (newColor: string) => {
|
||||
setColor(newColor);
|
||||
applyColor(newColor);
|
||||
@@ -75,12 +57,14 @@ function ColorPicker({ activeColor, onSelect, alpha }: Props) {
|
||||
{alpha ? (
|
||||
<StyledHexAlphaColorPicker
|
||||
color={color}
|
||||
onChange={handleColorChangePicker}
|
||||
onChange={setColor}
|
||||
onChangeEnd={applyColor}
|
||||
/>
|
||||
) : (
|
||||
<StyledHexNonAlphaColorPicker
|
||||
color={color}
|
||||
onChange={handleColorChangePicker}
|
||||
onChange={setColor}
|
||||
onChangeEnd={applyColor}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user