@patternfly/react-code-editor 5.0.0-alpha.8 → 5.0.0-alpha.9
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 +4 -0
- package/dist/esm/components/CodeEditor/CodeEditorControl.d.ts +1 -11
- package/dist/esm/components/CodeEditor/CodeEditorControl.d.ts.map +1 -1
- package/dist/esm/components/CodeEditor/CodeEditorControl.js +2 -25
- package/dist/esm/components/CodeEditor/CodeEditorControl.js.map +1 -1
- package/dist/js/components/CodeEditor/CodeEditorControl.d.ts +1 -11
- package/dist/js/components/CodeEditor/CodeEditorControl.d.ts.map +1 -1
- package/dist/js/components/CodeEditor/CodeEditorControl.js +2 -25
- package/dist/js/components/CodeEditor/CodeEditorControl.js.map +1 -1
- package/package.json +3 -3
- package/src/components/CodeEditor/CodeEditorControl.tsx +2 -76
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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
|
+
# [5.0.0-alpha.9](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.0.0-alpha.8...@patternfly/react-code-editor@5.0.0-alpha.9) (2023-02-09)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/react-code-editor
|
|
9
|
+
|
|
6
10
|
# [5.0.0-alpha.8](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.0.0-alpha.7...@patternfly/react-code-editor@5.0.0-alpha.8) (2023-02-08)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @patternfly/react-code-editor
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ButtonProps
|
|
2
|
+
import { ButtonProps } from '@patternfly/react-core';
|
|
3
3
|
/** Allows customizing the code editor controls by passing this sub-component into the
|
|
4
4
|
* code editor's customControl property.
|
|
5
5
|
*/
|
|
@@ -8,18 +8,8 @@ export interface CodeEditorControlProps extends Omit<ButtonProps, 'onClick'> {
|
|
|
8
8
|
'aria-label'?: string;
|
|
9
9
|
/** Additional classes added to the code editor control. */
|
|
10
10
|
className?: string;
|
|
11
|
-
/** @deprecated Delay in ms before the tooltip appears. */
|
|
12
|
-
entryDelay?: number;
|
|
13
|
-
/** @deprecated Delay in ms before the tooltip disappears. */
|
|
14
|
-
exitDelay?: number;
|
|
15
11
|
/** Icon rendered inside the code editor control. */
|
|
16
12
|
icon: React.ReactNode;
|
|
17
|
-
/** @deprecated Maximum width of the tooltip (default 150px). */
|
|
18
|
-
maxWidth?: string;
|
|
19
|
-
/** @deprecated Copy button popover position. */
|
|
20
|
-
position?: PopoverPosition | 'auto' | 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end';
|
|
21
|
-
/** @deprecated Text to display in the tooltip*/
|
|
22
|
-
toolTipText?: React.ReactNode;
|
|
23
13
|
/** Event handler for the click of the button */
|
|
24
14
|
onClick: (code: string, event?: any) => void;
|
|
25
15
|
/** Flag indicating that the button is visible above the code editor. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditorControl.d.ts","sourceRoot":"","sources":["../../../../src/components/CodeEditor/CodeEditorControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAU,WAAW,
|
|
1
|
+
{"version":3,"file":"CodeEditorControl.d.ts","sourceRoot":"","sources":["../../../../src/components/CodeEditor/CodeEditorControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAU,WAAW,EAAW,MAAM,wBAAwB,CAAC;AAGtE;;GAEG;AAEH,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IAC1E,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,gDAAgD;IAChD,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7C,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kEAAkE;IAClE,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,CAAC,sBAAsB,CAsB7E,CAAC"}
|
|
@@ -3,35 +3,12 @@ import * as React from 'react';
|
|
|
3
3
|
import { Button, Tooltip } from '@patternfly/react-core';
|
|
4
4
|
import { CodeEditorContext } from './CodeEditorUtils';
|
|
5
5
|
export const CodeEditorControl = (_a) => {
|
|
6
|
-
var { icon, className, 'aria-label': ariaLabel,
|
|
6
|
+
var { icon, className, 'aria-label': ariaLabel, onClick = () => { }, isVisible = true, tooltipProps = {} } = _a, props = __rest(_a, ["icon", "className", 'aria-label', "onClick", "isVisible", "tooltipProps"]);
|
|
7
7
|
const context = React.useContext(CodeEditorContext);
|
|
8
|
-
if (entryDelay !== undefined) {
|
|
9
|
-
// eslint-disable-next-line no-console
|
|
10
|
-
console.warn('CodeEditorControl: entryDelay prop has been deprecated. ' +
|
|
11
|
-
'Pass the entryDelay via the tooltipProps prop instead.');
|
|
12
|
-
}
|
|
13
|
-
if (exitDelay !== undefined) {
|
|
14
|
-
// eslint-disable-next-line no-console
|
|
15
|
-
console.warn('CodeEditorControl: exitDelay prop has been deprecated. ' +
|
|
16
|
-
'Pass the exitDelay via the tooltipProps prop instead.');
|
|
17
|
-
}
|
|
18
|
-
if (maxWidth !== undefined) {
|
|
19
|
-
// eslint-disable-next-line no-console
|
|
20
|
-
console.warn('CodeEditorControl: maxWidth prop has been deprecated. ' + 'Pass the maxWidth via the tooltipProps prop instead.');
|
|
21
|
-
}
|
|
22
|
-
if (position !== undefined) {
|
|
23
|
-
// eslint-disable-next-line no-console
|
|
24
|
-
console.warn('CodeEditorControl: position prop has been deprecated. ' + 'Pass the position via the tooltipProps prop instead.');
|
|
25
|
-
}
|
|
26
|
-
if (toolTipText !== undefined) {
|
|
27
|
-
// eslint-disable-next-line no-console
|
|
28
|
-
console.warn('CodeEditorControl: toolTipText prop has been deprecated. ' +
|
|
29
|
-
'Pass the toolTipText by setting the content field in tooltipProps prop instead.');
|
|
30
|
-
}
|
|
31
8
|
const onCustomClick = (event) => {
|
|
32
9
|
onClick(context.code, event);
|
|
33
10
|
};
|
|
34
|
-
return isVisible ? (React.createElement(Tooltip, Object.assign({
|
|
11
|
+
return isVisible ? (React.createElement(Tooltip, Object.assign({}, tooltipProps),
|
|
35
12
|
React.createElement(Button, Object.assign({ className: className, onClick: onCustomClick, variant: "control", "aria-label": ariaLabel }, props), icon))) : null;
|
|
36
13
|
};
|
|
37
14
|
CodeEditorControl.displayName = 'CodeEditorControl';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditorControl.js","sourceRoot":"","sources":["../../../../src/components/CodeEditor/CodeEditorControl.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CodeEditorControl.js","sourceRoot":"","sources":["../../../../src/components/CodeEditor/CodeEditorControl.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAe,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAqBtD,MAAM,CAAC,MAAM,iBAAiB,GAAoD,CAAC,EAQ1D,EAAE,EAAE;QARsD,EACjF,IAAI,EACJ,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,EAClB,SAAS,GAAG,IAAI,EAChB,YAAY,GAAG,EAAE,OAEM,EADpB,KAAK,cAPyE,2EAQlF,CADS;IAER,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAEpD,MAAM,aAAa,GAAG,CAAC,KAAsD,EAAE,EAAE;QAC/E,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,OAAO,SAAS,CAAC,CAAC,CAAC,CACjB,oBAAC,OAAO,oBAAK,YAAY;QACvB,oBAAC,MAAM,kBAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAC,SAAS,gBAAa,SAAS,IAAM,KAAK,GACrG,IAAI,CACE,CACD,CACX,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC;AAEF,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ButtonProps
|
|
2
|
+
import { ButtonProps } from '@patternfly/react-core';
|
|
3
3
|
/** Allows customizing the code editor controls by passing this sub-component into the
|
|
4
4
|
* code editor's customControl property.
|
|
5
5
|
*/
|
|
@@ -8,18 +8,8 @@ export interface CodeEditorControlProps extends Omit<ButtonProps, 'onClick'> {
|
|
|
8
8
|
'aria-label'?: string;
|
|
9
9
|
/** Additional classes added to the code editor control. */
|
|
10
10
|
className?: string;
|
|
11
|
-
/** @deprecated Delay in ms before the tooltip appears. */
|
|
12
|
-
entryDelay?: number;
|
|
13
|
-
/** @deprecated Delay in ms before the tooltip disappears. */
|
|
14
|
-
exitDelay?: number;
|
|
15
11
|
/** Icon rendered inside the code editor control. */
|
|
16
12
|
icon: React.ReactNode;
|
|
17
|
-
/** @deprecated Maximum width of the tooltip (default 150px). */
|
|
18
|
-
maxWidth?: string;
|
|
19
|
-
/** @deprecated Copy button popover position. */
|
|
20
|
-
position?: PopoverPosition | 'auto' | 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end';
|
|
21
|
-
/** @deprecated Text to display in the tooltip*/
|
|
22
|
-
toolTipText?: React.ReactNode;
|
|
23
13
|
/** Event handler for the click of the button */
|
|
24
14
|
onClick: (code: string, event?: any) => void;
|
|
25
15
|
/** Flag indicating that the button is visible above the code editor. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditorControl.d.ts","sourceRoot":"","sources":["../../../../src/components/CodeEditor/CodeEditorControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAU,WAAW,
|
|
1
|
+
{"version":3,"file":"CodeEditorControl.d.ts","sourceRoot":"","sources":["../../../../src/components/CodeEditor/CodeEditorControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAU,WAAW,EAAW,MAAM,wBAAwB,CAAC;AAGtE;;GAEG;AAEH,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IAC1E,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,gDAAgD;IAChD,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7C,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kEAAkE;IAClE,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,CAAC,sBAAsB,CAsB7E,CAAC"}
|
|
@@ -6,35 +6,12 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const react_core_1 = require("@patternfly/react-core");
|
|
7
7
|
const CodeEditorUtils_1 = require("./CodeEditorUtils");
|
|
8
8
|
const CodeEditorControl = (_a) => {
|
|
9
|
-
var { icon, className, 'aria-label': ariaLabel,
|
|
9
|
+
var { icon, className, 'aria-label': ariaLabel, onClick = () => { }, isVisible = true, tooltipProps = {} } = _a, props = tslib_1.__rest(_a, ["icon", "className", 'aria-label', "onClick", "isVisible", "tooltipProps"]);
|
|
10
10
|
const context = React.useContext(CodeEditorUtils_1.CodeEditorContext);
|
|
11
|
-
if (entryDelay !== undefined) {
|
|
12
|
-
// eslint-disable-next-line no-console
|
|
13
|
-
console.warn('CodeEditorControl: entryDelay prop has been deprecated. ' +
|
|
14
|
-
'Pass the entryDelay via the tooltipProps prop instead.');
|
|
15
|
-
}
|
|
16
|
-
if (exitDelay !== undefined) {
|
|
17
|
-
// eslint-disable-next-line no-console
|
|
18
|
-
console.warn('CodeEditorControl: exitDelay prop has been deprecated. ' +
|
|
19
|
-
'Pass the exitDelay via the tooltipProps prop instead.');
|
|
20
|
-
}
|
|
21
|
-
if (maxWidth !== undefined) {
|
|
22
|
-
// eslint-disable-next-line no-console
|
|
23
|
-
console.warn('CodeEditorControl: maxWidth prop has been deprecated. ' + 'Pass the maxWidth via the tooltipProps prop instead.');
|
|
24
|
-
}
|
|
25
|
-
if (position !== undefined) {
|
|
26
|
-
// eslint-disable-next-line no-console
|
|
27
|
-
console.warn('CodeEditorControl: position prop has been deprecated. ' + 'Pass the position via the tooltipProps prop instead.');
|
|
28
|
-
}
|
|
29
|
-
if (toolTipText !== undefined) {
|
|
30
|
-
// eslint-disable-next-line no-console
|
|
31
|
-
console.warn('CodeEditorControl: toolTipText prop has been deprecated. ' +
|
|
32
|
-
'Pass the toolTipText by setting the content field in tooltipProps prop instead.');
|
|
33
|
-
}
|
|
34
11
|
const onCustomClick = (event) => {
|
|
35
12
|
onClick(context.code, event);
|
|
36
13
|
};
|
|
37
|
-
return isVisible ? (React.createElement(react_core_1.Tooltip, Object.assign({
|
|
14
|
+
return isVisible ? (React.createElement(react_core_1.Tooltip, Object.assign({}, tooltipProps),
|
|
38
15
|
React.createElement(react_core_1.Button, Object.assign({ className: className, onClick: onCustomClick, variant: "control", "aria-label": ariaLabel }, props), icon))) : null;
|
|
39
16
|
};
|
|
40
17
|
exports.CodeEditorControl = CodeEditorControl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditorControl.js","sourceRoot":"","sources":["../../../../src/components/CodeEditor/CodeEditorControl.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"CodeEditorControl.js","sourceRoot":"","sources":["../../../../src/components/CodeEditor/CodeEditorControl.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,uDAAsE;AACtE,uDAAsD;AAqB/C,MAAM,iBAAiB,GAAoD,CAAC,EAQ1D,EAAE,EAAE;QARsD,EACjF,IAAI,EACJ,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,EAClB,SAAS,GAAG,IAAI,EAChB,YAAY,GAAG,EAAE,OAEM,EADpB,KAAK,sBAPyE,2EAQlF,CADS;IAER,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,mCAAiB,CAAC,CAAC;IAEpD,MAAM,aAAa,GAAG,CAAC,KAAsD,EAAE,EAAE;QAC/E,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,OAAO,SAAS,CAAC,CAAC,CAAC,CACjB,oBAAC,oBAAO,oBAAK,YAAY;QACvB,oBAAC,mBAAM,kBAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAC,SAAS,gBAAa,SAAS,IAAM,KAAK,GACrG,IAAI,CACE,CACD,CACX,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC;AAtBW,QAAA,iBAAiB,qBAsB5B;AAEF,yBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-code-editor",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.9",
|
|
4
4
|
"description": "This package provides a PatternFly wrapper for the Monaco code editor\n",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"clean": "rimraf dist"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@patternfly/react-core": "^5.0.0-alpha.
|
|
33
|
+
"@patternfly/react-core": "^5.0.0-alpha.9",
|
|
34
34
|
"@patternfly/react-icons": "^5.0.0-alpha.2",
|
|
35
35
|
"@patternfly/react-styles": "^5.0.0-alpha.2",
|
|
36
36
|
"react-dropzone": "14.2.3",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"rimraf": "^2.6.2",
|
|
46
46
|
"typescript": "^4.7.4"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "81e9bbe05401ce5c3a1acf80765ed713ec5402a0"
|
|
49
49
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Button, ButtonProps,
|
|
2
|
+
import { Button, ButtonProps, Tooltip } from '@patternfly/react-core';
|
|
3
3
|
import { CodeEditorContext } from './CodeEditorUtils';
|
|
4
4
|
|
|
5
5
|
/** Allows customizing the code editor controls by passing this sub-component into the
|
|
@@ -11,32 +11,8 @@ export interface CodeEditorControlProps extends Omit<ButtonProps, 'onClick'> {
|
|
|
11
11
|
'aria-label'?: string;
|
|
12
12
|
/** Additional classes added to the code editor control. */
|
|
13
13
|
className?: string;
|
|
14
|
-
/** @deprecated Delay in ms before the tooltip appears. */
|
|
15
|
-
entryDelay?: number;
|
|
16
|
-
/** @deprecated Delay in ms before the tooltip disappears. */
|
|
17
|
-
exitDelay?: number;
|
|
18
14
|
/** Icon rendered inside the code editor control. */
|
|
19
15
|
icon: React.ReactNode;
|
|
20
|
-
/** @deprecated Maximum width of the tooltip (default 150px). */
|
|
21
|
-
maxWidth?: string;
|
|
22
|
-
/** @deprecated Copy button popover position. */
|
|
23
|
-
position?:
|
|
24
|
-
| PopoverPosition
|
|
25
|
-
| 'auto'
|
|
26
|
-
| 'top'
|
|
27
|
-
| 'bottom'
|
|
28
|
-
| 'left'
|
|
29
|
-
| 'right'
|
|
30
|
-
| 'top-start'
|
|
31
|
-
| 'top-end'
|
|
32
|
-
| 'bottom-start'
|
|
33
|
-
| 'bottom-end'
|
|
34
|
-
| 'left-start'
|
|
35
|
-
| 'left-end'
|
|
36
|
-
| 'right-start'
|
|
37
|
-
| 'right-end';
|
|
38
|
-
/** @deprecated Text to display in the tooltip*/
|
|
39
|
-
toolTipText?: React.ReactNode;
|
|
40
16
|
/** Event handler for the click of the button */
|
|
41
17
|
onClick: (code: string, event?: any) => void;
|
|
42
18
|
/** Flag indicating that the button is visible above the code editor. */
|
|
@@ -49,11 +25,6 @@ export const CodeEditorControl: React.FunctionComponent<CodeEditorControlProps>
|
|
|
49
25
|
icon,
|
|
50
26
|
className,
|
|
51
27
|
'aria-label': ariaLabel,
|
|
52
|
-
toolTipText,
|
|
53
|
-
exitDelay,
|
|
54
|
-
entryDelay,
|
|
55
|
-
maxWidth,
|
|
56
|
-
position,
|
|
57
28
|
onClick = () => {},
|
|
58
29
|
isVisible = true,
|
|
59
30
|
tooltipProps = {},
|
|
@@ -61,57 +32,12 @@ export const CodeEditorControl: React.FunctionComponent<CodeEditorControlProps>
|
|
|
61
32
|
}: CodeEditorControlProps) => {
|
|
62
33
|
const context = React.useContext(CodeEditorContext);
|
|
63
34
|
|
|
64
|
-
if (entryDelay !== undefined) {
|
|
65
|
-
// eslint-disable-next-line no-console
|
|
66
|
-
console.warn(
|
|
67
|
-
'CodeEditorControl: entryDelay prop has been deprecated. ' +
|
|
68
|
-
'Pass the entryDelay via the tooltipProps prop instead.'
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (exitDelay !== undefined) {
|
|
73
|
-
// eslint-disable-next-line no-console
|
|
74
|
-
console.warn(
|
|
75
|
-
'CodeEditorControl: exitDelay prop has been deprecated. ' +
|
|
76
|
-
'Pass the exitDelay via the tooltipProps prop instead.'
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (maxWidth !== undefined) {
|
|
81
|
-
// eslint-disable-next-line no-console
|
|
82
|
-
console.warn(
|
|
83
|
-
'CodeEditorControl: maxWidth prop has been deprecated. ' + 'Pass the maxWidth via the tooltipProps prop instead.'
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (position !== undefined) {
|
|
88
|
-
// eslint-disable-next-line no-console
|
|
89
|
-
console.warn(
|
|
90
|
-
'CodeEditorControl: position prop has been deprecated. ' + 'Pass the position via the tooltipProps prop instead.'
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (toolTipText !== undefined) {
|
|
95
|
-
// eslint-disable-next-line no-console
|
|
96
|
-
console.warn(
|
|
97
|
-
'CodeEditorControl: toolTipText prop has been deprecated. ' +
|
|
98
|
-
'Pass the toolTipText by setting the content field in tooltipProps prop instead.'
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
35
|
const onCustomClick = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
|
|
103
36
|
onClick(context.code, event);
|
|
104
37
|
};
|
|
105
38
|
|
|
106
39
|
return isVisible ? (
|
|
107
|
-
<Tooltip
|
|
108
|
-
exitDelay={exitDelay}
|
|
109
|
-
entryDelay={entryDelay}
|
|
110
|
-
maxWidth={maxWidth}
|
|
111
|
-
position={position}
|
|
112
|
-
content={<div>{toolTipText}</div>}
|
|
113
|
-
{...tooltipProps}
|
|
114
|
-
>
|
|
40
|
+
<Tooltip {...tooltipProps}>
|
|
115
41
|
<Button className={className} onClick={onCustomClick} variant="control" aria-label={ariaLabel} {...props}>
|
|
116
42
|
{icon}
|
|
117
43
|
</Button>
|