@luminati-io/uikit 3.0.8 → 3.0.9
Sign up to get free protection for your applications and to get access to all the features.
@@ -22194,14 +22194,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
22194
22194
|
|
22195
22195
|
|
22196
22196
|
var CodeBlock = function CodeBlock(props) {
|
22197
|
-
var
|
22197
|
+
var className = props.className,
|
22198
|
+
header = props.header,
|
22198
22199
|
code = props.code,
|
22199
22200
|
lang = props.lang,
|
22200
22201
|
max_height = props.max_height,
|
22201
22202
|
themeProp = props.theme,
|
22202
22203
|
lineNumbers = props.lineNumbers,
|
22203
|
-
copyButton = props.copyButton
|
22204
|
+
copyButton = props.copyButton,
|
22205
|
+
onCopy = props.onCopy;
|
22204
22206
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CodeBlockWrapper, {
|
22207
|
+
className: className,
|
22205
22208
|
"data-testid": "code_block"
|
22206
22209
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CodeBlockHeader, {
|
22207
22210
|
$theme: themeProp
|
@@ -22211,7 +22214,8 @@ var CodeBlock = function CodeBlock(props) {
|
|
22211
22214
|
code: code,
|
22212
22215
|
theme: themeProp,
|
22213
22216
|
lineNumbers: lineNumbers,
|
22214
|
-
copyButton: copyButton
|
22217
|
+
copyButton: copyButton,
|
22218
|
+
onCopy: onCopy
|
22215
22219
|
}));
|
22216
22220
|
};
|
22217
22221
|
CodeBlock.displayName = 'CodeBlock';
|
@@ -22291,7 +22295,8 @@ var CodeSnippet = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)
|
|
22291
22295
|
themeProp = props.theme,
|
22292
22296
|
lineNumbers = props.lineNumbers,
|
22293
22297
|
copyButton = props.copyButton,
|
22294
|
-
loading = props.loading
|
22298
|
+
loading = props.loading,
|
22299
|
+
onCopy = props.onCopy;
|
22295
22300
|
var codeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
22296
22301
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CodeBlockBody, {
|
22297
22302
|
ref: ref,
|
@@ -22307,7 +22312,8 @@ var CodeSnippet = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)
|
|
22307
22312
|
}), !!copyButton && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_copy_button__WEBPACK_IMPORTED_MODULE_6__["default"], {
|
22308
22313
|
code: code,
|
22309
22314
|
theme: themeProp,
|
22310
|
-
codeRef: codeRef
|
22315
|
+
codeRef: codeRef,
|
22316
|
+
onCopy: onCopy
|
22311
22317
|
})), !!loading && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_skeleton__WEBPACK_IMPORTED_MODULE_7__["default"], {
|
22312
22318
|
theme: themeProp
|
22313
22319
|
}));
|
@@ -22395,7 +22401,8 @@ var icon = _icons__WEBPACK_IMPORTED_MODULE_2__["default"].Copy;
|
|
22395
22401
|
var CopyButton = function CopyButton(props) {
|
22396
22402
|
var code = props.code,
|
22397
22403
|
themeProp = props.theme,
|
22398
|
-
codeRef = props.codeRef
|
22404
|
+
codeRef = props.codeRef,
|
22405
|
+
onCopy = props.onCopy;
|
22399
22406
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(STATE.READY),
|
22400
22407
|
_useState2 = _slicedToArray(_useState, 2),
|
22401
22408
|
state = _useState2[0],
|
@@ -22413,6 +22420,7 @@ var CopyButton = function CopyButton(props) {
|
|
22413
22420
|
success: function success() {
|
22414
22421
|
setState(STATE.SUCCESS);
|
22415
22422
|
resetText();
|
22423
|
+
onCopy === null || onCopy === void 0 ? void 0 : onCopy();
|
22416
22424
|
},
|
22417
22425
|
error: function error() {
|
22418
22426
|
setState(STATE.ERROR);
|