@snack-uikit/code-editor 0.7.1 → 0.7.2
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
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 0.7.2 (2025-05-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **PDS-2227:** remove tooltip from code copy button ([adee4e2](https://github.com/cloud-ru-tech/snack-uikit/commit/adee4e273a99c484456481530636cc49894c13bc))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 0.7.1 (2025-05-28)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -22,8 +22,6 @@ const react_1 = require("react");
|
|
|
22
22
|
const ft_copy_to_clipboard_1 = require("@cloud-ru/ft-copy-to-clipboard");
|
|
23
23
|
const button_1 = require("@snack-uikit/button");
|
|
24
24
|
const icons_1 = require("@snack-uikit/icons");
|
|
25
|
-
const locale_1 = require("@snack-uikit/locale");
|
|
26
|
-
const tooltip_1 = require("@snack-uikit/tooltip");
|
|
27
25
|
const utils_1 = require("@snack-uikit/utils");
|
|
28
26
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
29
27
|
function CopyButton(_a) {
|
|
@@ -34,9 +32,6 @@ function CopyButton(_a) {
|
|
|
34
32
|
onClick
|
|
35
33
|
} = _a,
|
|
36
34
|
rest = __rest(_a, ["valueToCopy", "size", "className", "onClick"]);
|
|
37
|
-
const {
|
|
38
|
-
t
|
|
39
|
-
} = (0, locale_1.useLocale)();
|
|
40
35
|
const [isChecked, setIsCheckedOpen] = (0, react_1.useState)(false);
|
|
41
36
|
const timerId = (0, react_1.useRef)();
|
|
42
37
|
const openChecked = () => setIsCheckedOpen(true);
|
|
@@ -53,17 +48,14 @@ function CopyButton(_a) {
|
|
|
53
48
|
closeChecked();
|
|
54
49
|
clearTimeout(timerId.current);
|
|
55
50
|
}, []);
|
|
56
|
-
return (0, jsx_runtime_1.jsx)(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
size: size
|
|
67
|
-
}))
|
|
68
|
-
});
|
|
51
|
+
return (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, Object.assign({}, (0, utils_1.extractSupportProps)(rest), {
|
|
52
|
+
onClick: handleClick,
|
|
53
|
+
className: className,
|
|
54
|
+
"data-test-id": 'button-copy-value',
|
|
55
|
+
type: 'button',
|
|
56
|
+
icon: isChecked ? (0, jsx_runtime_1.jsx)(icons_1.CheckSVG, {
|
|
57
|
+
className: styles_module_scss_1.default.checkIcon
|
|
58
|
+
}) : (0, jsx_runtime_1.jsx)(icons_1.CopySVG, {}),
|
|
59
|
+
size: size
|
|
60
|
+
}));
|
|
69
61
|
}
|
|
@@ -14,13 +14,10 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
14
14
|
import { copyToClipboard } from '@cloud-ru/ft-copy-to-clipboard';
|
|
15
15
|
import { ButtonFunction } from '@snack-uikit/button';
|
|
16
16
|
import { CheckSVG, CopySVG } from '@snack-uikit/icons';
|
|
17
|
-
import { useLocale } from '@snack-uikit/locale';
|
|
18
|
-
import { Tooltip } from '@snack-uikit/tooltip';
|
|
19
17
|
import { extractSupportProps } from '@snack-uikit/utils';
|
|
20
18
|
import styles from './styles.module.css';
|
|
21
19
|
export function CopyButton(_a) {
|
|
22
20
|
var { valueToCopy, size = 's', className, onClick } = _a, rest = __rest(_a, ["valueToCopy", "size", "className", "onClick"]);
|
|
23
|
-
const { t } = useLocale();
|
|
24
21
|
const [isChecked, setIsCheckedOpen] = useState(false);
|
|
25
22
|
const timerId = useRef();
|
|
26
23
|
const openChecked = () => setIsCheckedOpen(true);
|
|
@@ -37,5 +34,5 @@ export function CopyButton(_a) {
|
|
|
37
34
|
closeChecked();
|
|
38
35
|
clearTimeout(timerId.current);
|
|
39
36
|
}, []);
|
|
40
|
-
return (_jsx(
|
|
37
|
+
return (_jsx(ButtonFunction, Object.assign({}, extractSupportProps(rest), { onClick: handleClick, className: className, "data-test-id": 'button-copy-value', type: 'button', icon: isChecked ? _jsx(CheckSVG, { className: styles.checkIcon }) : _jsx(CopySVG, {}), size: size })));
|
|
41
38
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.7.
|
|
7
|
+
"version": "0.7.2",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -41,18 +41,14 @@
|
|
|
41
41
|
"@snack-uikit/button": "0.19.11",
|
|
42
42
|
"@snack-uikit/icons": "0.26.3",
|
|
43
43
|
"@snack-uikit/loaders": "0.9.5",
|
|
44
|
-
"@snack-uikit/tooltip": "0.17.2",
|
|
45
44
|
"@snack-uikit/typography": "0.8.7",
|
|
46
45
|
"@snack-uikit/utils": "3.8.2",
|
|
47
46
|
"chroma-js": "3.1.2",
|
|
48
47
|
"classnames": "2.5.1",
|
|
49
48
|
"monaco-yaml": "5.2.3"
|
|
50
49
|
},
|
|
51
|
-
"peerDependencies": {
|
|
52
|
-
"@snack-uikit/locale": "*"
|
|
53
|
-
},
|
|
54
50
|
"devDependencies": {
|
|
55
51
|
"@types/chroma-js": "2.4.4"
|
|
56
52
|
},
|
|
57
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "988d11cb5e0902f5dbe0add54fa0d09e6285219c"
|
|
58
54
|
}
|
|
@@ -3,8 +3,6 @@ import { MouseEventHandler, useEffect, useRef, useState } from 'react';
|
|
|
3
3
|
import { copyToClipboard } from '@cloud-ru/ft-copy-to-clipboard';
|
|
4
4
|
import { ButtonFunction, ButtonFunctionProps } from '@snack-uikit/button';
|
|
5
5
|
import { CheckSVG, CopySVG } from '@snack-uikit/icons';
|
|
6
|
-
import { useLocale } from '@snack-uikit/locale';
|
|
7
|
-
import { Tooltip } from '@snack-uikit/tooltip';
|
|
8
6
|
import { extractSupportProps, WithSupportProps } from '@snack-uikit/utils';
|
|
9
7
|
|
|
10
8
|
import styles from './styles.module.scss';
|
|
@@ -17,7 +15,6 @@ export type CopyButtonProps = WithSupportProps<{
|
|
|
17
15
|
}>;
|
|
18
16
|
|
|
19
17
|
export function CopyButton({ valueToCopy, size = 's', className, onClick, ...rest }: CopyButtonProps) {
|
|
20
|
-
const { t } = useLocale();
|
|
21
18
|
const [isChecked, setIsCheckedOpen] = useState(false);
|
|
22
19
|
const timerId = useRef<NodeJS.Timeout>();
|
|
23
20
|
const openChecked = () => setIsCheckedOpen(true);
|
|
@@ -41,16 +38,14 @@ export function CopyButton({ valueToCopy, size = 's', className, onClick, ...res
|
|
|
41
38
|
);
|
|
42
39
|
|
|
43
40
|
return (
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/>
|
|
54
|
-
</Tooltip>
|
|
41
|
+
<ButtonFunction
|
|
42
|
+
{...extractSupportProps(rest)}
|
|
43
|
+
onClick={handleClick}
|
|
44
|
+
className={className}
|
|
45
|
+
data-test-id='button-copy-value'
|
|
46
|
+
type='button'
|
|
47
|
+
icon={isChecked ? <CheckSVG className={styles.checkIcon} /> : <CopySVG />}
|
|
48
|
+
size={size}
|
|
49
|
+
/>
|
|
55
50
|
);
|
|
56
51
|
}
|