@luminati-io/uikit 3.0.7 → 3.0.8-beta.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -22048,45 +22048,47 @@ __webpack_require__.r(__webpack_exports__);
|
|
22048
22048
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
22049
22049
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
22050
22050
|
/* harmony export */ });
|
22051
|
-
/* harmony import */ var
|
22052
|
-
/* harmony import */ var
|
22053
|
-
/* harmony import */ var
|
22054
|
-
/* harmony import */ var
|
22055
|
-
/* harmony import */ var
|
22056
|
-
/* harmony import */ var
|
22057
|
-
/* harmony import */ var
|
22058
|
-
/* harmony import */ var
|
22059
|
-
/* harmony import */ var
|
22060
|
-
/* harmony import */ var
|
22061
|
-
/* harmony import */ var
|
22062
|
-
/* harmony import */ var
|
22063
|
-
/* harmony import */ var
|
22064
|
-
/* harmony import */ var
|
22065
|
-
/* harmony import */ var
|
22066
|
-
/* harmony import */ var
|
22067
|
-
/* harmony import */ var
|
22068
|
-
/* harmony import */ var
|
22069
|
-
/* harmony import */ var
|
22070
|
-
/* harmony import */ var
|
22071
|
-
/* harmony import */ var
|
22072
|
-
/* harmony import */ var
|
22073
|
-
/* harmony import */ var
|
22074
|
-
/* harmony import */ var
|
22075
|
-
/* harmony import */ var
|
22076
|
-
/* harmony import */ var
|
22077
|
-
/* harmony import */ var
|
22078
|
-
/* harmony import */ var
|
22079
|
-
/* harmony import */ var
|
22080
|
-
/* harmony import */ var
|
22081
|
-
/* harmony import */ var
|
22082
|
-
/* harmony import */ var
|
22083
|
-
/* harmony import */ var
|
22084
|
-
/* harmony import */ var
|
22085
|
-
/* harmony import */ var
|
22086
|
-
/* harmony import */ var
|
22051
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
22052
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
22053
|
+
/* harmony import */ var prismjs_components_prism_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prismjs/components/prism-core */ "./node_modules/prismjs/components/prism-core.js");
|
22054
|
+
/* harmony import */ var prismjs_components_prism_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_core__WEBPACK_IMPORTED_MODULE_1__);
|
22055
|
+
/* harmony import */ var prismjs_components_prism_clike__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prismjs/components/prism-clike */ "./node_modules/prismjs/components/prism-clike.js");
|
22056
|
+
/* harmony import */ var prismjs_components_prism_clike__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_clike__WEBPACK_IMPORTED_MODULE_2__);
|
22057
|
+
/* harmony import */ var prismjs_components_prism_markup__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prismjs/components/prism-markup */ "./node_modules/prismjs/components/prism-markup.js");
|
22058
|
+
/* harmony import */ var prismjs_components_prism_markup__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_markup__WEBPACK_IMPORTED_MODULE_3__);
|
22059
|
+
/* harmony import */ var prismjs_components_prism_javascript__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prismjs/components/prism-javascript */ "./node_modules/prismjs/components/prism-javascript.js");
|
22060
|
+
/* harmony import */ var prismjs_components_prism_javascript__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_javascript__WEBPACK_IMPORTED_MODULE_4__);
|
22061
|
+
/* harmony import */ var prismjs_components_prism_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prismjs/components/prism-css */ "./node_modules/prismjs/components/prism-css.js");
|
22062
|
+
/* harmony import */ var prismjs_components_prism_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_css__WEBPACK_IMPORTED_MODULE_5__);
|
22063
|
+
/* harmony import */ var prismjs_components_prism_bash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prismjs/components/prism-bash */ "./node_modules/prismjs/components/prism-bash.js");
|
22064
|
+
/* harmony import */ var prismjs_components_prism_bash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_bash__WEBPACK_IMPORTED_MODULE_6__);
|
22065
|
+
/* harmony import */ var prismjs_components_prism_java__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prismjs/components/prism-java */ "./node_modules/prismjs/components/prism-java.js");
|
22066
|
+
/* harmony import */ var prismjs_components_prism_java__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_java__WEBPACK_IMPORTED_MODULE_7__);
|
22067
|
+
/* harmony import */ var prismjs_components_prism_csharp__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prismjs/components/prism-csharp */ "./node_modules/prismjs/components/prism-csharp.js");
|
22068
|
+
/* harmony import */ var prismjs_components_prism_csharp__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_csharp__WEBPACK_IMPORTED_MODULE_8__);
|
22069
|
+
/* harmony import */ var prismjs_components_prism_basic__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! prismjs/components/prism-basic */ "./node_modules/prismjs/components/prism-basic.js");
|
22070
|
+
/* harmony import */ var prismjs_components_prism_basic__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_basic__WEBPACK_IMPORTED_MODULE_9__);
|
22071
|
+
/* harmony import */ var prismjs_components_prism_vbnet__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! prismjs/components/prism-vbnet */ "./node_modules/prismjs/components/prism-vbnet.js");
|
22072
|
+
/* harmony import */ var prismjs_components_prism_vbnet__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_vbnet__WEBPACK_IMPORTED_MODULE_10__);
|
22073
|
+
/* harmony import */ var prismjs_components_prism_markup_templating__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! prismjs/components/prism-markup-templating */ "./node_modules/prismjs/components/prism-markup-templating.js");
|
22074
|
+
/* harmony import */ var prismjs_components_prism_markup_templating__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_markup_templating__WEBPACK_IMPORTED_MODULE_11__);
|
22075
|
+
/* harmony import */ var prismjs_components_prism_php__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! prismjs/components/prism-php */ "./node_modules/prismjs/components/prism-php.js");
|
22076
|
+
/* harmony import */ var prismjs_components_prism_php__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_php__WEBPACK_IMPORTED_MODULE_12__);
|
22077
|
+
/* harmony import */ var prismjs_components_prism_ruby__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! prismjs/components/prism-ruby */ "./node_modules/prismjs/components/prism-ruby.js");
|
22078
|
+
/* harmony import */ var prismjs_components_prism_ruby__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_ruby__WEBPACK_IMPORTED_MODULE_13__);
|
22079
|
+
/* harmony import */ var prismjs_components_prism_perl__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! prismjs/components/prism-perl */ "./node_modules/prismjs/components/prism-perl.js");
|
22080
|
+
/* harmony import */ var prismjs_components_prism_perl__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_perl__WEBPACK_IMPORTED_MODULE_14__);
|
22081
|
+
/* harmony import */ var prismjs_components_prism_python__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! prismjs/components/prism-python */ "./node_modules/prismjs/components/prism-python.js");
|
22082
|
+
/* harmony import */ var prismjs_components_prism_python__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_python__WEBPACK_IMPORTED_MODULE_15__);
|
22083
|
+
/* harmony import */ var prismjs_components_prism_json__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! prismjs/components/prism-json */ "./node_modules/prismjs/components/prism-json.js");
|
22084
|
+
/* harmony import */ var prismjs_components_prism_json__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_json__WEBPACK_IMPORTED_MODULE_16__);
|
22085
|
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! prop-types */ "prop-types");
|
22086
|
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_17__);
|
22087
22087
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! styled-components */ "styled-components");
|
22088
22088
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_18__);
|
22089
22089
|
/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
|
22090
|
+
/* harmony import */ var prismjs_plugins_line_numbers_prism_line_numbers__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! prismjs/plugins/line-numbers/prism-line-numbers */ "./node_modules/prismjs/plugins/line-numbers/prism-line-numbers.js");
|
22091
|
+
/* harmony import */ var prismjs_plugins_line_numbers_prism_line_numbers__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(prismjs_plugins_line_numbers_prism_line_numbers__WEBPACK_IMPORTED_MODULE_20__);
|
22090
22092
|
// LICENSE_CODE ZON
|
22091
22093
|
|
22092
22094
|
|
@@ -22111,27 +22113,46 @@ __webpack_require__.r(__webpack_exports__);
|
|
22111
22113
|
|
22112
22114
|
|
22113
22115
|
|
22114
|
-
|
22116
|
+
|
22117
|
+
var Code = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
|
22115
22118
|
var text = props.text,
|
22116
|
-
lang = props.lang
|
22117
|
-
|
22118
|
-
|
22119
|
-
|
22120
|
-
|
22119
|
+
lang = props.lang,
|
22120
|
+
themeProp = props.theme,
|
22121
|
+
lineNumbers = props.lineNumbers;
|
22122
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
22123
|
+
prismjs_components_prism_core__WEBPACK_IMPORTED_MODULE_1___default().highlightAll();
|
22124
|
+
}, [text, lang, lineNumbers]);
|
22125
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CodeWrapper, {
|
22126
|
+
ref: ref,
|
22127
|
+
$theme: themeProp,
|
22128
|
+
className: "".concat(lineNumbers ? '' : 'no-', "line-numbers")
|
22129
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("code", {
|
22121
22130
|
className: "language-".concat(lang, " content")
|
22122
22131
|
}, text));
|
22123
|
-
};
|
22132
|
+
});
|
22124
22133
|
Code.displayName = 'Code';
|
22134
|
+
Code.defaultProps = {
|
22135
|
+
theme: 'white'
|
22136
|
+
};
|
22125
22137
|
Code.propTypes = {
|
22126
|
-
text: (
|
22127
|
-
|
22128
|
-
|
22138
|
+
text: (prop_types__WEBPACK_IMPORTED_MODULE_17___default().string),
|
22139
|
+
lang: prop_types__WEBPACK_IMPORTED_MODULE_17___default().oneOf(['plain', 'plaintext', 'text', 'txt', 'DFS', 'clike', 'markup', 'html', 'mathml', 'svg', 'xml', 'ssml', 'atom', 'rss', 'javascript', 'js', 'css', 'bash', 'sh', 'shell', 'java', 'csharp', 'cs', 'dotnet', 'basic', 'vbnet', 'markup-templating', 'php', 'ruby', 'rb', 'perl', 'python', 'py', 'json', 'webmanifest']),
|
22140
|
+
theme: prop_types__WEBPACK_IMPORTED_MODULE_17___default().oneOf(['black', 'white']),
|
22141
|
+
lineNumbers: (prop_types__WEBPACK_IMPORTED_MODULE_17___default().bool)
|
22129
22142
|
};
|
22130
22143
|
var CodeWrapper = styled_components__WEBPACK_IMPORTED_MODULE_18___default().pre.withConfig({
|
22131
22144
|
displayName: "CodeWrapper",
|
22132
22145
|
componentId: "sc-1kleg7y-0"
|
22133
|
-
})(["&&&{
|
22134
|
-
|
22146
|
+
})(["&&&{font-family:", ";margin:0;border:none;background-color:transparent;width:100%;white-space:pre-wrap !important;font-size:", ";line-height:", ";tab-size:4;text-align:left;word-spacing:normal;word-break:break-word;word-wrap:normal;hyphens:none;max-height:none !important;code.content{all:inherit;margin:0;padding:0;border:none;background-color:transparent;text-shadow:none;}&.line-numbers{position:relative;padding-left:3.8rem;counter-reset:linenumber;& > code{position:relative;white-space:inherit;}.line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8rem;width:3rem;letter-spacing:-1px;border-right:1px solid ", ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;& > span{display:block;counter-increment:linenumber;&:before{content:counter(linenumber);color:", ";display:block;padding-right:0.8rem;text-align:right;}}}}", "}"], _theme__WEBPACK_IMPORTED_MODULE_19__["default"].font_family.mono, _theme__WEBPACK_IMPORTED_MODULE_19__["default"].font_size.sm, _theme__WEBPACK_IMPORTED_MODULE_19__["default"].line_height.loose, function (props) {
|
22147
|
+
return props.$theme == 'white' ? '#5F6364' : '#999';
|
22148
|
+
}, function (props) {
|
22149
|
+
return props.$theme == 'white' ? '#5F6364' : '#999';
|
22150
|
+
}, function (props) {
|
22151
|
+
if (props.$theme == 'white') {
|
22152
|
+
return (0,styled_components__WEBPACK_IMPORTED_MODULE_18__.css)(["code.content{color:#c92c2c;}.token.comment,.token.block-comment,.token.prolog,.token.doctype,.token.cdata{color:#7D8B99;}.token.punctuation{color:#5F6364;}.token.property,.token.tag,.token.boolean,.token.number,.token.function-name,.token.constant,.token.symbol,.token.deleted{color:#c92c2c;}.token.selector,.token.attr-name,.token.string,.token.char,.token.function,.token.builtin,.token.inserted{color:#2f9c0a;}.token.operator,.token.entity,.token.url,.token.variable{color:#a67f59;background:rgba(255,255,255,0.5);}.token.atrule,.token.attr-value,.token.keyword,.token.class-name{color:#1990b8;}.token.regex,.token.important{color:#e90;}.language-css .token.string,.style .token.string{color:#a67f59;background:rgba(255,255,255,0.5);}.token.important{font-weight:normal;}.token.bold{font-weight:bold;}.token.italic{font-style:italic;}.token.entity{cursor:help;}.token.namespace{opacity:.7;}"]);
|
22153
|
+
}
|
22154
|
+
return (0,styled_components__WEBPACK_IMPORTED_MODULE_18__.css)(["code.content{color:", ";}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:slategray;}.token.punctuation{color:#999;}.token.namespace{opacity:.7;}.token.property,.token.tag,.token.boolean,.token.constant,.token.symbol,.token.deleted{color:#f8c555;}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#7ec699;}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#67cdcc;}.token.atrule,.token.attr-value,.token.keyword{color:#cc99cd;}.token.function,.token.number,.token.class-name{color:#f08d49;}.token.regex,.token.important,.token.variable{color:#e90;}.token.important,.token.bold{font-weight:bold;}.token.italic{font-style:italic;}.token.entity{cursor:help;}"], _theme__WEBPACK_IMPORTED_MODULE_19__["default"].color.gray_8);
|
22155
|
+
});
|
22135
22156
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Code);
|
22136
22157
|
|
22137
22158
|
/***/ }),
|
@@ -22154,8 +22175,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
22154
22175
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "prop-types");
|
22155
22176
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
|
22156
22177
|
/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
|
22157
|
-
/* harmony import */ var
|
22158
|
-
/* harmony import */ var
|
22178
|
+
/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../layout */ "./src/layout/index.js");
|
22179
|
+
/* harmony import */ var _code_snippet__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./code_snippet */ "./src/code/code_snippet.js");
|
22159
22180
|
// LICENSE_CODE ZON
|
22160
22181
|
|
22161
22182
|
|
@@ -22170,37 +22191,54 @@ var CodeBlock = function CodeBlock(props) {
|
|
22170
22191
|
var header = props.header,
|
22171
22192
|
code = props.code,
|
22172
22193
|
lang = props.lang,
|
22173
|
-
max_height = props.max_height
|
22194
|
+
max_height = props.max_height,
|
22195
|
+
themeProp = props.theme,
|
22196
|
+
lineNumbers = props.lineNumbers,
|
22197
|
+
copyButton = props.copyButton;
|
22174
22198
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CodeBlockWrapper, {
|
22175
22199
|
"data-testid": "code_block"
|
22176
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CodeBlockHeader,
|
22200
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CodeBlockHeader, {
|
22201
|
+
$theme: themeProp
|
22202
|
+
}, header), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_code_snippet__WEBPACK_IMPORTED_MODULE_5__["default"], {
|
22177
22203
|
max_height: max_height,
|
22178
22204
|
lang: lang,
|
22179
|
-
code: code
|
22205
|
+
code: code,
|
22206
|
+
theme: themeProp,
|
22207
|
+
lineNumbers: lineNumbers,
|
22208
|
+
copyButton: copyButton
|
22180
22209
|
}));
|
22181
22210
|
};
|
22182
22211
|
CodeBlock.displayName = 'CodeBlock';
|
22183
22212
|
CodeBlock.defaultProps = {
|
22184
|
-
max_height: '500px'
|
22213
|
+
max_height: '500px',
|
22214
|
+
theme: 'black'
|
22185
22215
|
};
|
22186
22216
|
CodeBlock.propTypes = {
|
22187
22217
|
header: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),
|
22188
22218
|
code: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
|
22189
22219
|
lang: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
|
22190
|
-
max_height: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)
|
22220
|
+
max_height: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
|
22221
|
+
theme: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(['black', 'white']),
|
22222
|
+
lineNumbers: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
|
22223
|
+
copyButton: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool)
|
22191
22224
|
};
|
22192
22225
|
var CodeBlockWrapper = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div.withConfig({
|
22193
22226
|
displayName: "CodeBlockWrapper",
|
22194
22227
|
componentId: "sc-dgi5hi-0"
|
22195
22228
|
})(["border-radius:4px;overflow:hidden;font-family:", ";font-size:", ";"], _theme__WEBPACK_IMPORTED_MODULE_3__["default"].font_family.sans, _theme__WEBPACK_IMPORTED_MODULE_3__["default"].font_size.md);
|
22196
|
-
var CodeBlockHeader = styled_components__WEBPACK_IMPORTED_MODULE_1___default()(
|
22229
|
+
var CodeBlockHeader = styled_components__WEBPACK_IMPORTED_MODULE_1___default()(_layout__WEBPACK_IMPORTED_MODULE_4__.Flex).attrs({
|
22197
22230
|
align_items: 'center',
|
22198
22231
|
justify_content: 'space-between',
|
22199
22232
|
padding: '0.9em 1em'
|
22200
22233
|
}).withConfig({
|
22201
22234
|
displayName: "CodeBlockHeader",
|
22202
22235
|
componentId: "sc-dgi5hi-1"
|
22203
|
-
})(["
|
22236
|
+
})(["", ""], function (props) {
|
22237
|
+
if (props.$theme == 'white') {
|
22238
|
+
return (0,styled_components__WEBPACK_IMPORTED_MODULE_1__.css)(["background-color:", ";color:", ";border-bottom:1px solid ", ";"], _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_2, _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_9, _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_5);
|
22239
|
+
}
|
22240
|
+
return (0,styled_components__WEBPACK_IMPORTED_MODULE_1__.css)(["background-color:", ";color:", ";"], _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_11_50, _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_9);
|
22241
|
+
});
|
22204
22242
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CodeBlock);
|
22205
22243
|
|
22206
22244
|
/***/ }),
|
@@ -22225,6 +22263,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
22225
22263
|
/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
|
22226
22264
|
/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../layout */ "./src/layout/index.js");
|
22227
22265
|
/* harmony import */ var _code__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./code */ "./src/code/code.js");
|
22266
|
+
/* harmony import */ var _copy_button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./copy_button */ "./src/code/copy_button.js");
|
22267
|
+
/* harmony import */ var _skeleton__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./skeleton */ "./src/code/skeleton.js");
|
22228
22268
|
// LICENSE_CODE ZON
|
22229
22269
|
|
22230
22270
|
|
@@ -22235,25 +22275,49 @@ __webpack_require__.r(__webpack_exports__);
|
|
22235
22275
|
|
22236
22276
|
|
22237
22277
|
|
22238
|
-
|
22278
|
+
|
22279
|
+
|
22280
|
+
var CodeSnippet = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
|
22239
22281
|
var code = props.code,
|
22240
22282
|
lang = props.lang,
|
22241
22283
|
max_height = props.max_height,
|
22242
|
-
className = props.className
|
22284
|
+
className = props.className,
|
22285
|
+
themeProp = props.theme,
|
22286
|
+
lineNumbers = props.lineNumbers,
|
22287
|
+
copyButton = props.copyButton,
|
22288
|
+
loading = props.loading;
|
22289
|
+
var codeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
22243
22290
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CodeBlockBody, {
|
22244
22291
|
ref: ref,
|
22245
22292
|
className: className,
|
22246
|
-
max_height: max_height
|
22247
|
-
|
22293
|
+
max_height: max_height,
|
22294
|
+
$theme: themeProp
|
22295
|
+
}, !loading && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_code__WEBPACK_IMPORTED_MODULE_5__["default"], {
|
22296
|
+
ref: codeRef,
|
22248
22297
|
lang: lang,
|
22249
|
-
text: code
|
22298
|
+
text: code,
|
22299
|
+
theme: themeProp,
|
22300
|
+
lineNumbers: lineNumbers
|
22301
|
+
}), !!copyButton && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_copy_button__WEBPACK_IMPORTED_MODULE_6__["default"], {
|
22302
|
+
code: code,
|
22303
|
+
theme: themeProp,
|
22304
|
+
codeRef: codeRef
|
22305
|
+
})), !!loading && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_skeleton__WEBPACK_IMPORTED_MODULE_7__["default"], {
|
22306
|
+
theme: themeProp
|
22250
22307
|
}));
|
22251
22308
|
});
|
22252
22309
|
CodeSnippet.displayName = 'CodeSnippet';
|
22310
|
+
CodeSnippet.defaultProps = {
|
22311
|
+
theme: 'black'
|
22312
|
+
};
|
22253
22313
|
CodeSnippet.propTypes = {
|
22254
22314
|
code: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
|
22255
22315
|
lang: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
|
22256
|
-
max_height: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)
|
22316
|
+
max_height: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
|
22317
|
+
theme: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(['black', 'white']),
|
22318
|
+
lineNumbers: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
|
22319
|
+
copyButton: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
|
22320
|
+
loading: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool)
|
22257
22321
|
};
|
22258
22322
|
var CodeBlockBody = styled_components__WEBPACK_IMPORTED_MODULE_1___default()(_layout__WEBPACK_IMPORTED_MODULE_4__.Flex).attrs({
|
22259
22323
|
align_items: 'flex-start',
|
@@ -22264,15 +22328,161 @@ var CodeBlockBody = styled_components__WEBPACK_IMPORTED_MODULE_1___default()(_la
|
|
22264
22328
|
}).withConfig({
|
22265
22329
|
displayName: "CodeBlockBody",
|
22266
22330
|
componentId: "sc-13u859f-0"
|
22267
|
-
})(["background-color:", ";overflow-y:auto;::-webkit-scrollbar{height:10px;width:10px;}::-webkit-scrollbar-thumb{background-color:", ";border-radius:10px;border:0 solid transparent;background-clip:content-box;}::-webkit-scrollbar-track-piece{background:", ";}position:relative;", ""],
|
22268
|
-
|
22269
|
-
|
22270
|
-
|
22331
|
+
})(["background-color:", ";overflow-y:auto;::-webkit-scrollbar{height:10px;width:10px;}::-webkit-scrollbar-thumb{background-color:", ";border-radius:10px;border:0 solid transparent;background-clip:content-box;}::-webkit-scrollbar-track-piece{background:", ";}position:relative;", ""], function (props) {
|
22332
|
+
return _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color[props.$theme == 'white' ? 'gray_2' : 'gray_12'];
|
22333
|
+
}, _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_11, function (props) {
|
22334
|
+
return _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color[props.$theme == 'white' ? 'gray_8' : 'gray_11_50'];
|
22335
|
+
}, '' /* ${CodeBlockCopyBtn} {
|
22336
|
+
position: sticky;
|
22337
|
+
top: 0;
|
22338
|
+
} */);
|
22271
22339
|
|
22272
22340
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CodeSnippet);
|
22273
22341
|
|
22274
22342
|
/***/ }),
|
22275
22343
|
|
22344
|
+
/***/ "./src/code/copy_button.js":
|
22345
|
+
/*!*********************************!*\
|
22346
|
+
!*** ./src/code/copy_button.js ***!
|
22347
|
+
\*********************************/
|
22348
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
22349
|
+
|
22350
|
+
"use strict";
|
22351
|
+
__webpack_require__.r(__webpack_exports__);
|
22352
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
22353
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
22354
|
+
/* harmony export */ });
|
22355
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
22356
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
22357
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! styled-components */ "styled-components");
|
22358
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_1__);
|
22359
|
+
/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @icons */ "./assets/icons/index.js");
|
22360
|
+
/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
|
22361
|
+
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../tooltip */ "./src/tooltip.js");
|
22362
|
+
// LICENSE_CODE ZON
|
22363
|
+
|
22364
|
+
|
22365
|
+
/*jslint react:true*/
|
22366
|
+
var _tooltips;
|
22367
|
+
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); }
|
22368
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
22369
|
+
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."); }
|
22370
|
+
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); }
|
22371
|
+
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; }
|
22372
|
+
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; } }
|
22373
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
22374
|
+
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; }
|
22375
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
22376
|
+
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); }
|
22377
|
+
|
22378
|
+
|
22379
|
+
|
22380
|
+
|
22381
|
+
|
22382
|
+
var STATE = {
|
22383
|
+
READY: 'READY',
|
22384
|
+
SUCCESS: 'SUCCESS',
|
22385
|
+
ERROR: 'ERROR'
|
22386
|
+
};
|
22387
|
+
var tooltips = (_tooltips = {}, _defineProperty(_tooltips, STATE.READY, 'Copy'), _defineProperty(_tooltips, STATE.SUCCESS, 'Copied'), _defineProperty(_tooltips, STATE.ERROR, 'Press Ctrl+C to copy'), _tooltips);
|
22388
|
+
var icon = _icons__WEBPACK_IMPORTED_MODULE_2__["default"].Copy;
|
22389
|
+
var CopyButton = function CopyButton(props) {
|
22390
|
+
var code = props.code,
|
22391
|
+
themeProp = props.theme,
|
22392
|
+
codeRef = props.codeRef;
|
22393
|
+
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(STATE.READY),
|
22394
|
+
_useState2 = _slicedToArray(_useState, 2),
|
22395
|
+
state = _useState2[0],
|
22396
|
+
setState = _useState2[1];
|
22397
|
+
var resetText = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
22398
|
+
setTimeout(function () {
|
22399
|
+
return setState(STATE.READY);
|
22400
|
+
}, 1500);
|
22401
|
+
}, []);
|
22402
|
+
var handleClick = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
22403
|
+
copyTextToClipboard({
|
22404
|
+
getText: function getText() {
|
22405
|
+
return code;
|
22406
|
+
},
|
22407
|
+
success: function success() {
|
22408
|
+
setState(STATE.SUCCESS);
|
22409
|
+
resetText();
|
22410
|
+
},
|
22411
|
+
error: function error() {
|
22412
|
+
setState(STATE.ERROR);
|
22413
|
+
setTimeout(function () {
|
22414
|
+
return selectElementText(codeRef.current);
|
22415
|
+
}, 1);
|
22416
|
+
resetText();
|
22417
|
+
}
|
22418
|
+
});
|
22419
|
+
}, [code]);
|
22420
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tooltip__WEBPACK_IMPORTED_MODULE_4__["default"], {
|
22421
|
+
tooltip: tooltips[state],
|
22422
|
+
placement: "right",
|
22423
|
+
noWrap: true
|
22424
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(StyledButton, {
|
22425
|
+
type: "button",
|
22426
|
+
onClick: handleClick,
|
22427
|
+
$theme: themeProp
|
22428
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
|
22429
|
+
viewBox: icon.viewBox
|
22430
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("use", {
|
22431
|
+
href: "#".concat(icon.id)
|
22432
|
+
}))));
|
22433
|
+
};
|
22434
|
+
var StyledButton = styled_components__WEBPACK_IMPORTED_MODULE_1___default().button.withConfig({
|
22435
|
+
displayName: "StyledButton",
|
22436
|
+
componentId: "sc-kvxvoe-0"
|
22437
|
+
})(["position:absolute;right:16px;display:flex;padding:8px;align-items:flex-start;border:0 none;border-radius:32px;background:", ";svg{width:16px;height:16px;color:", ";}&:hover svg{color:", ";}&:active svg{color:", ";}"], function (props) {
|
22438
|
+
return _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color[props.$theme == 'white' ? 'gray_5' : 'gray_11_50'];
|
22439
|
+
}, function (props) {
|
22440
|
+
return _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color[props.$theme == 'white' ? 'gray_9' : 'gray_8'];
|
22441
|
+
}, function (props) {
|
22442
|
+
return _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color[props.$theme == 'white' ? 'gray_11_25' : 'gray_1'];
|
22443
|
+
}, function (props) {
|
22444
|
+
return _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color[props.$theme == 'white' ? 'gray_11_25' : 'gray_1'];
|
22445
|
+
});
|
22446
|
+
function copyTextToClipboard(copyInfo) {
|
22447
|
+
if (navigator.clipboard) {
|
22448
|
+
navigator.clipboard.writeText(copyInfo.getText()).then(copyInfo.success, function () {
|
22449
|
+
// try the fallback in case `writeText` didn't work
|
22450
|
+
fallbackCopyTextToClipboard(copyInfo);
|
22451
|
+
});
|
22452
|
+
} else fallbackCopyTextToClipboard(copyInfo);
|
22453
|
+
}
|
22454
|
+
function fallbackCopyTextToClipboard(copyInfo) {
|
22455
|
+
// https://stackoverflow.com/a/30810322/7595472
|
22456
|
+
var textArea = document.createElement('textarea');
|
22457
|
+
textArea.value = copyInfo.getText();
|
22458
|
+
|
22459
|
+
// Avoid scrolling to bottom
|
22460
|
+
textArea.style.top = '0';
|
22461
|
+
textArea.style.left = '0';
|
22462
|
+
textArea.style.position = 'fixed';
|
22463
|
+
document.body.appendChild(textArea);
|
22464
|
+
textArea.focus();
|
22465
|
+
textArea.select();
|
22466
|
+
try {
|
22467
|
+
var successful = document.execCommand('copy');
|
22468
|
+
setTimeout(function () {
|
22469
|
+
if (successful) copyInfo.success();else copyInfo.error();
|
22470
|
+
}, 1);
|
22471
|
+
} catch (e) {
|
22472
|
+
setTimeout(function () {
|
22473
|
+
copyInfo.error(e);
|
22474
|
+
}, 1);
|
22475
|
+
}
|
22476
|
+
document.body.removeChild(textArea);
|
22477
|
+
}
|
22478
|
+
function selectElementText(element) {
|
22479
|
+
// https://stackoverflow.com/a/20079910/7595472
|
22480
|
+
window.getSelection().selectAllChildren(element);
|
22481
|
+
}
|
22482
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CopyButton);
|
22483
|
+
|
22484
|
+
/***/ }),
|
22485
|
+
|
22276
22486
|
/***/ "./src/code/index.js":
|
22277
22487
|
/*!***************************!*\
|
22278
22488
|
!*** ./src/code/index.js ***!
|
@@ -22298,6 +22508,78 @@ __webpack_require__.r(__webpack_exports__);
|
|
22298
22508
|
|
22299
22509
|
|
22300
22510
|
|
22511
|
+
/***/ }),
|
22512
|
+
|
22513
|
+
/***/ "./src/code/skeleton.js":
|
22514
|
+
/*!******************************!*\
|
22515
|
+
!*** ./src/code/skeleton.js ***!
|
22516
|
+
\******************************/
|
22517
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
22518
|
+
|
22519
|
+
"use strict";
|
22520
|
+
__webpack_require__.r(__webpack_exports__);
|
22521
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
22522
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
22523
|
+
/* harmony export */ });
|
22524
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
22525
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
22526
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! styled-components */ "styled-components");
|
22527
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_1__);
|
22528
|
+
// LICENSE_CODE ZON
|
22529
|
+
|
22530
|
+
|
22531
|
+
/*jslint react:true*/
|
22532
|
+
|
22533
|
+
|
22534
|
+
var Skeleton = function Skeleton(props) {
|
22535
|
+
var themeProp = props.theme;
|
22536
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(StyledSkeleton, {
|
22537
|
+
$theme: themeProp
|
22538
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SkeletonBox, {
|
22539
|
+
$theme: themeProp,
|
22540
|
+
$width: "53px"
|
22541
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SkeletonBox, {
|
22542
|
+
$theme: themeProp,
|
22543
|
+
$width: "223px"
|
22544
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SkeletonBox, {
|
22545
|
+
$theme: themeProp,
|
22546
|
+
$width: "93px"
|
22547
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SkeletonBox, {
|
22548
|
+
$theme: themeProp,
|
22549
|
+
$width: "93px"
|
22550
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SkeletonBox, {
|
22551
|
+
$theme: themeProp,
|
22552
|
+
$width: "157px"
|
22553
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SkeletonBox, {
|
22554
|
+
$theme: themeProp,
|
22555
|
+
$width: "53px"
|
22556
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SkeletonBox, {
|
22557
|
+
$theme: themeProp,
|
22558
|
+
$width: "90px"
|
22559
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SkeletonBox, {
|
22560
|
+
$theme: themeProp,
|
22561
|
+
$width: "187px"
|
22562
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SkeletonBox, {
|
22563
|
+
$theme: themeProp,
|
22564
|
+
$width: "188px"
|
22565
|
+
}));
|
22566
|
+
};
|
22567
|
+
var StyledSkeleton = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div.withConfig({
|
22568
|
+
displayName: "StyledSkeleton",
|
22569
|
+
componentId: "sc-1v7xkdy-0"
|
22570
|
+
})(["flex:1;display:flex;flex-wrap:wrap;column-gap:16px;row-gap:12px;}"]);
|
22571
|
+
var SkeletonBox = styled_components__WEBPACK_IMPORTED_MODULE_1___default().span.withConfig({
|
22572
|
+
displayName: "SkeletonBox",
|
22573
|
+
componentId: "sc-1v7xkdy-1"
|
22574
|
+
})(["display:inline-block;height:10px;width:", ";max-width:100%;background:", ";position:relative;overflow:hidden;&::after{position:absolute;top:0;right:0;bottom:0;left:0;transform:translateX(-100%);border-radius:2px;background:", ";animation:shimmer 5s infinite;content:'';}@keyframes shimmer{100%{transform:translateX(100%);}}"], function (props) {
|
22575
|
+
return props.$width;
|
22576
|
+
}, function (props) {
|
22577
|
+
return props.$theme == 'white' ? '#B4B9BD' : '#333335';
|
22578
|
+
}, function (props) {
|
22579
|
+
return props.$theme == 'white' ? 'linear-gradient(90deg, #B4B9BD 3.16%, #B5BCC6 50.83%, #889096 99.97%,' + ' #B4B9BD 99.97%)' : 'linear-gradient(90deg, #333335 3.16%, #525252 57.39%, #333335 99.97%)';
|
22580
|
+
});
|
22581
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Skeleton);
|
22582
|
+
|
22301
22583
|
/***/ }),
|
22302
22584
|
|
22303
22585
|
/***/ "./src/combo_button/combo_button.js":
|
@@ -25831,45 +26113,107 @@ __webpack_require__.r(__webpack_exports__);
|
|
25831
26113
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
25832
26114
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
25833
26115
|
/* harmony export */ });
|
25834
|
-
/* harmony import */ var
|
25835
|
-
/* harmony import */ var
|
25836
|
-
/* harmony import */ var
|
26116
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
26117
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
26118
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! styled-components */ "styled-components");
|
26119
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_1__);
|
26120
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "./src/utils.js");
|
25837
26121
|
// LICENSE_CODE ZON
|
25838
26122
|
|
25839
26123
|
|
25840
26124
|
/*jslint react:true*/
|
26125
|
+
var _excluded = ["height", "max_height", "min_height", "width", "max_width", "min_width", "padding", "padding_top", "padding_right", "padding_bottom", "padding_left", "margin", "margin_top", "margin_right", "margin_bottom", "margin_left", "flex", "flex_grow", "flex_shrink", "flex_basis", "justify_self", "align_self", "order", "box_shadow"];
|
26126
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
26127
|
+
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; }
|
26128
|
+
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; }
|
25841
26129
|
|
25842
26130
|
|
25843
|
-
|
25844
|
-
|
26131
|
+
|
26132
|
+
var Box = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().forwardRef(function (props, ref) {
|
26133
|
+
var height = props.height,
|
26134
|
+
max_height = props.max_height,
|
26135
|
+
min_height = props.min_height,
|
26136
|
+
width = props.width,
|
26137
|
+
max_width = props.max_width,
|
26138
|
+
min_width = props.min_width,
|
26139
|
+
padding = props.padding,
|
26140
|
+
padding_top = props.padding_top,
|
26141
|
+
padding_right = props.padding_right,
|
26142
|
+
padding_bottom = props.padding_bottom,
|
26143
|
+
padding_left = props.padding_left,
|
26144
|
+
margin = props.margin,
|
26145
|
+
margin_top = props.margin_top,
|
26146
|
+
margin_right = props.margin_right,
|
26147
|
+
margin_bottom = props.margin_bottom,
|
26148
|
+
margin_left = props.margin_left,
|
26149
|
+
flex = props.flex,
|
26150
|
+
flex_grow = props.flex_grow,
|
26151
|
+
flex_shrink = props.flex_shrink,
|
26152
|
+
flex_basis = props.flex_basis,
|
26153
|
+
justify_self = props.justify_self,
|
26154
|
+
align_self = props.align_self,
|
26155
|
+
order = props.order,
|
26156
|
+
box_shadow = props.box_shadow,
|
26157
|
+
rest = _objectWithoutProperties(props, _excluded);
|
26158
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(StyledBox, _extends({
|
26159
|
+
ref: ref,
|
26160
|
+
$height: height,
|
26161
|
+
$maxHeight: max_height,
|
26162
|
+
$minHeight: min_height,
|
26163
|
+
$width: width,
|
26164
|
+
$maxWidth: max_width,
|
26165
|
+
$minWidth: min_width,
|
26166
|
+
$padding: padding,
|
26167
|
+
$padding_top: padding_top,
|
26168
|
+
$padding_right: padding_right,
|
26169
|
+
$padding_bottom: padding_bottom,
|
26170
|
+
$padding_left: padding_left,
|
26171
|
+
$margin: margin,
|
26172
|
+
$margin_top: margin_top,
|
26173
|
+
$margin_right: margin_right,
|
26174
|
+
$margin_bottom: margin_bottom,
|
26175
|
+
$margin_left: margin_left,
|
26176
|
+
$flex: flex,
|
26177
|
+
$flexGrow: flex_grow,
|
26178
|
+
$flexShrink: flex_shrink,
|
26179
|
+
$flexBasis: flex_basis,
|
26180
|
+
$justifySelf: justify_self,
|
26181
|
+
$alignSelf: align_self,
|
26182
|
+
$order: order,
|
26183
|
+
$box_shadow: box_shadow
|
26184
|
+
}, rest));
|
26185
|
+
});
|
26186
|
+
Box.displayName = 'Box';
|
26187
|
+
var StyledBox = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div.withConfig({
|
26188
|
+
displayName: "StyledBox",
|
25845
26189
|
componentId: "sc-pxszp5-0"
|
25846
26190
|
})(["height:", ";max-height:", ";min-height:", ";width:", ";max-width:", ";min-width:", ";padding:", ";padding-top:", ";padding-right:", ";padding-bottom:", ";padding-left:", ";margin:", ";margin-top:", ";margin-right:", ";margin-bottom:", ";margin-left:", ";flex:", ";flex-grow:", ";flex-shrink:", ";flex-basis:", ";justify-self:", ";align-self:", ";order:", ";box-shadow:", ";"], function (props) {
|
25847
|
-
return props
|
26191
|
+
return props.$height;
|
25848
26192
|
}, function (props) {
|
25849
|
-
return props
|
26193
|
+
return props.$maxHeight;
|
25850
26194
|
}, function (props) {
|
25851
|
-
return props
|
26195
|
+
return props.$minHeight;
|
25852
26196
|
}, function (props) {
|
25853
|
-
return props
|
26197
|
+
return props.$width;
|
25854
26198
|
}, function (props) {
|
25855
|
-
return props
|
26199
|
+
return props.$maxWidth;
|
25856
26200
|
}, function (props) {
|
25857
|
-
return props
|
25858
|
-
}, (0,
|
25859
|
-
return props
|
26201
|
+
return props.$minWidth;
|
26202
|
+
}, (0,_utils__WEBPACK_IMPORTED_MODULE_2__.fromTheme)('padding'), (0,_utils__WEBPACK_IMPORTED_MODULE_2__.fromTheme)('padding_top'), (0,_utils__WEBPACK_IMPORTED_MODULE_2__.fromTheme)('padding_right'), (0,_utils__WEBPACK_IMPORTED_MODULE_2__.fromTheme)('padding_bottom'), (0,_utils__WEBPACK_IMPORTED_MODULE_2__.fromTheme)('padding_left'), (0,_utils__WEBPACK_IMPORTED_MODULE_2__.fromTheme)('margin'), (0,_utils__WEBPACK_IMPORTED_MODULE_2__.fromTheme)('margin_top'), (0,_utils__WEBPACK_IMPORTED_MODULE_2__.fromTheme)('margin_right'), (0,_utils__WEBPACK_IMPORTED_MODULE_2__.fromTheme)('margin_bottom'), (0,_utils__WEBPACK_IMPORTED_MODULE_2__.fromTheme)('margin_left'), function (props) {
|
26203
|
+
return props.$flex;
|
25860
26204
|
}, function (props) {
|
25861
|
-
return props
|
26205
|
+
return props.$flexGrow;
|
25862
26206
|
}, function (props) {
|
25863
|
-
return props
|
26207
|
+
return props.$flexShrink;
|
25864
26208
|
}, function (props) {
|
25865
|
-
return props
|
26209
|
+
return props.$flexBasis;
|
25866
26210
|
}, function (props) {
|
25867
|
-
return props
|
26211
|
+
return props.$justifySelf;
|
25868
26212
|
}, function (props) {
|
25869
|
-
return props
|
26213
|
+
return props.$alignSelf;
|
25870
26214
|
}, function (props) {
|
25871
|
-
return props
|
25872
|
-
}, (0,
|
26215
|
+
return props.$order;
|
26216
|
+
}, (0,_utils__WEBPACK_IMPORTED_MODULE_2__.fromTheme)('box_shadow'));
|
25873
26217
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Box);
|
25874
26218
|
|
25875
26219
|
/***/ }),
|
@@ -25896,34 +26240,41 @@ __webpack_require__.r(__webpack_exports__);
|
|
25896
26240
|
|
25897
26241
|
|
25898
26242
|
/*jslint react:true*/
|
26243
|
+
var _excluded = ["inline", "align_items", "align_content", "justify_items", "justify_content", "flex_wrap", "flex_direction", "gap", "row_gap", "column_gap"];
|
26244
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
26245
|
+
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; }
|
26246
|
+
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; }
|
25899
26247
|
|
25900
26248
|
|
25901
26249
|
|
25902
26250
|
|
25903
|
-
var Flex =
|
25904
|
-
|
25905
|
-
|
25906
|
-
|
25907
|
-
|
25908
|
-
|
25909
|
-
|
25910
|
-
|
25911
|
-
|
25912
|
-
|
25913
|
-
|
25914
|
-
|
25915
|
-
return
|
25916
|
-
|
25917
|
-
|
25918
|
-
|
25919
|
-
|
25920
|
-
|
25921
|
-
|
25922
|
-
|
25923
|
-
|
25924
|
-
|
25925
|
-
|
26251
|
+
var Flex = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().forwardRef(function (props, ref) {
|
26252
|
+
var inline = props.inline,
|
26253
|
+
align_items = props.align_items,
|
26254
|
+
align_content = props.align_content,
|
26255
|
+
justify_items = props.justify_items,
|
26256
|
+
justify_content = props.justify_content,
|
26257
|
+
flex_wrap = props.flex_wrap,
|
26258
|
+
flex_direction = props.flex_direction,
|
26259
|
+
gap = props.gap,
|
26260
|
+
row_gap = props.row_gap,
|
26261
|
+
column_gap = props.column_gap,
|
26262
|
+
rest = _objectWithoutProperties(props, _excluded);
|
26263
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(StyledFlex, _extends({
|
26264
|
+
ref: ref,
|
26265
|
+
$inline: inline,
|
26266
|
+
$alignItems: align_items,
|
26267
|
+
$alignContent: align_content,
|
26268
|
+
$justifyItems: justify_items,
|
26269
|
+
$justifyContent: justify_content,
|
26270
|
+
$flexWrap: flex_wrap,
|
26271
|
+
$flexDirection: flex_direction,
|
26272
|
+
$gap: gap,
|
26273
|
+
$rowGap: row_gap,
|
26274
|
+
$columnGap: column_gap
|
26275
|
+
}, rest));
|
25926
26276
|
});
|
26277
|
+
Flex.displayName = 'Flex';
|
25927
26278
|
Flex.defaultProps = {
|
25928
26279
|
flex_direction: 'row'
|
25929
26280
|
};
|
@@ -25939,6 +26290,30 @@ Flex.propTypes = {
|
|
25939
26290
|
row_gap: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
|
25940
26291
|
column_gap: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)
|
25941
26292
|
};
|
26293
|
+
var StyledFlex = styled_components__WEBPACK_IMPORTED_MODULE_1___default()(_box__WEBPACK_IMPORTED_MODULE_3__["default"]).withConfig({
|
26294
|
+
displayName: "StyledFlex",
|
26295
|
+
componentId: "sc-2aqm31-0"
|
26296
|
+
})(["display:", ";align-items:", ";align-content:", ";justify-items:", ";justify-content:", ";flex-wrap:", ";flex-direction:", ";gap:", ";row-gap:", ";column-gap:", ";"], function (props) {
|
26297
|
+
return props.$inline ? 'inline-flex' : 'flex';
|
26298
|
+
}, function (props) {
|
26299
|
+
return props.$alignItems;
|
26300
|
+
}, function (props) {
|
26301
|
+
return props.$alignContent;
|
26302
|
+
}, function (props) {
|
26303
|
+
return props.$justifyItems;
|
26304
|
+
}, function (props) {
|
26305
|
+
return props.$justifyContent;
|
26306
|
+
}, function (props) {
|
26307
|
+
return props.$flexWrap;
|
26308
|
+
}, function (props) {
|
26309
|
+
return props.$flexDirection;
|
26310
|
+
}, function (props) {
|
26311
|
+
return props.$gap;
|
26312
|
+
}, function (props) {
|
26313
|
+
return props.$rowGap;
|
26314
|
+
}, function (props) {
|
26315
|
+
return props.$columnGap;
|
26316
|
+
});
|
25942
26317
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Flex);
|
25943
26318
|
|
25944
26319
|
/***/ }),
|
@@ -27196,7 +27571,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
27196
27571
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
27197
27572
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! styled-components */ "styled-components");
|
27198
27573
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_2__);
|
27199
|
-
/* harmony import */ var
|
27574
|
+
/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
|
27575
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils */ "./src/utils.js");
|
27200
27576
|
// LICENSE_CODE ZON
|
27201
27577
|
|
27202
27578
|
|
@@ -27209,6 +27585,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
27209
27585
|
|
27210
27586
|
|
27211
27587
|
|
27588
|
+
|
27212
27589
|
var Group = function Group(props) {
|
27213
27590
|
var children = props.children,
|
27214
27591
|
className = props.className,
|
@@ -27247,7 +27624,7 @@ var Group = function Group(props) {
|
|
27247
27624
|
$variant: variant,
|
27248
27625
|
"aria-orientation": variant == 'vertical' ? 'vertical' : 'horizontal',
|
27249
27626
|
onKeyDown: handleKeyDown
|
27250
|
-
}, (0,
|
27627
|
+
}, (0,_utils__WEBPACK_IMPORTED_MODULE_4__.getCommonProps)(rest)), react__WEBPACK_IMPORTED_MODULE_1__.Children.map(children, function (child) {
|
27251
27628
|
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(child, {
|
27252
27629
|
variant: variant
|
27253
27630
|
});
|
@@ -27262,15 +27639,18 @@ Group.propTypes = {
|
|
27262
27639
|
var GroupContainer = styled_components__WEBPACK_IMPORTED_MODULE_2___default().div.withConfig({
|
27263
27640
|
displayName: "GroupContainer",
|
27264
27641
|
componentId: "sc-x363t3-0"
|
27265
|
-
})(["display:flex;justify-content:
|
27642
|
+
})(["display:flex;justify-content:flex-start;align-items:center;box-sizing:border-box;width:fit-content;", ""], function (props) {
|
27643
|
+
if (props.$variant == 'underline') {
|
27644
|
+
return (0,styled_components__WEBPACK_IMPORTED_MODULE_2__.css)(["flex-direction:row;"]);
|
27645
|
+
}
|
27266
27646
|
if (props.$variant == 'contain') {
|
27267
|
-
return (0,styled_components__WEBPACK_IMPORTED_MODULE_2__.css)(["flex-direction:row;
|
27647
|
+
return (0,styled_components__WEBPACK_IMPORTED_MODULE_2__.css)(["flex-direction:row;padding:2px;gap:2px;border-radius:4px;background:", ";"], _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_3);
|
27268
27648
|
}
|
27269
27649
|
if (props.$variant == 'vertical') {
|
27270
|
-
return (0,styled_components__WEBPACK_IMPORTED_MODULE_2__.css)(["flex-direction:column;
|
27650
|
+
return (0,styled_components__WEBPACK_IMPORTED_MODULE_2__.css)(["flex-direction:column;"]);
|
27271
27651
|
}
|
27272
27652
|
// main
|
27273
|
-
return (0,styled_components__WEBPACK_IMPORTED_MODULE_2__.css)(["flex-direction:row;
|
27653
|
+
return (0,styled_components__WEBPACK_IMPORTED_MODULE_2__.css)(["flex-direction:row;gap:24px;"]);
|
27274
27654
|
});
|
27275
27655
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Group);
|
27276
27656
|
|
@@ -51851,6 +52231,268 @@ Prism.languages.vbnet = Prism.languages.extend('basic', {
|
|
51851
52231
|
});
|
51852
52232
|
|
51853
52233
|
|
52234
|
+
/***/ }),
|
52235
|
+
|
52236
|
+
/***/ "./node_modules/prismjs/plugins/line-numbers/prism-line-numbers.js":
|
52237
|
+
/*!*************************************************************************!*\
|
52238
|
+
!*** ./node_modules/prismjs/plugins/line-numbers/prism-line-numbers.js ***!
|
52239
|
+
\*************************************************************************/
|
52240
|
+
/***/ (() => {
|
52241
|
+
|
52242
|
+
(function () {
|
52243
|
+
|
52244
|
+
if (typeof Prism === 'undefined' || typeof document === 'undefined') {
|
52245
|
+
return;
|
52246
|
+
}
|
52247
|
+
|
52248
|
+
/**
|
52249
|
+
* Plugin name which is used as a class name for <pre> which is activating the plugin
|
52250
|
+
*
|
52251
|
+
* @type {string}
|
52252
|
+
*/
|
52253
|
+
var PLUGIN_NAME = 'line-numbers';
|
52254
|
+
|
52255
|
+
/**
|
52256
|
+
* Regular expression used for determining line breaks
|
52257
|
+
*
|
52258
|
+
* @type {RegExp}
|
52259
|
+
*/
|
52260
|
+
var NEW_LINE_EXP = /\n(?!$)/g;
|
52261
|
+
|
52262
|
+
|
52263
|
+
/**
|
52264
|
+
* Global exports
|
52265
|
+
*/
|
52266
|
+
var config = Prism.plugins.lineNumbers = {
|
52267
|
+
/**
|
52268
|
+
* Get node for provided line number
|
52269
|
+
*
|
52270
|
+
* @param {Element} element pre element
|
52271
|
+
* @param {number} number line number
|
52272
|
+
* @returns {Element|undefined}
|
52273
|
+
*/
|
52274
|
+
getLine: function (element, number) {
|
52275
|
+
if (element.tagName !== 'PRE' || !element.classList.contains(PLUGIN_NAME)) {
|
52276
|
+
return;
|
52277
|
+
}
|
52278
|
+
|
52279
|
+
var lineNumberRows = element.querySelector('.line-numbers-rows');
|
52280
|
+
if (!lineNumberRows) {
|
52281
|
+
return;
|
52282
|
+
}
|
52283
|
+
var lineNumberStart = parseInt(element.getAttribute('data-start'), 10) || 1;
|
52284
|
+
var lineNumberEnd = lineNumberStart + (lineNumberRows.children.length - 1);
|
52285
|
+
|
52286
|
+
if (number < lineNumberStart) {
|
52287
|
+
number = lineNumberStart;
|
52288
|
+
}
|
52289
|
+
if (number > lineNumberEnd) {
|
52290
|
+
number = lineNumberEnd;
|
52291
|
+
}
|
52292
|
+
|
52293
|
+
var lineIndex = number - lineNumberStart;
|
52294
|
+
|
52295
|
+
return lineNumberRows.children[lineIndex];
|
52296
|
+
},
|
52297
|
+
|
52298
|
+
/**
|
52299
|
+
* Resizes the line numbers of the given element.
|
52300
|
+
*
|
52301
|
+
* This function will not add line numbers. It will only resize existing ones.
|
52302
|
+
*
|
52303
|
+
* @param {HTMLElement} element A `<pre>` element with line numbers.
|
52304
|
+
* @returns {void}
|
52305
|
+
*/
|
52306
|
+
resize: function (element) {
|
52307
|
+
resizeElements([element]);
|
52308
|
+
},
|
52309
|
+
|
52310
|
+
/**
|
52311
|
+
* Whether the plugin can assume that the units font sizes and margins are not depended on the size of
|
52312
|
+
* the current viewport.
|
52313
|
+
*
|
52314
|
+
* Setting this to `true` will allow the plugin to do certain optimizations for better performance.
|
52315
|
+
*
|
52316
|
+
* Set this to `false` if you use any of the following CSS units: `vh`, `vw`, `vmin`, `vmax`.
|
52317
|
+
*
|
52318
|
+
* @type {boolean}
|
52319
|
+
*/
|
52320
|
+
assumeViewportIndependence: true
|
52321
|
+
};
|
52322
|
+
|
52323
|
+
/**
|
52324
|
+
* Resizes the given elements.
|
52325
|
+
*
|
52326
|
+
* @param {HTMLElement[]} elements
|
52327
|
+
*/
|
52328
|
+
function resizeElements(elements) {
|
52329
|
+
elements = elements.filter(function (e) {
|
52330
|
+
var codeStyles = getStyles(e);
|
52331
|
+
var whiteSpace = codeStyles['white-space'];
|
52332
|
+
return whiteSpace === 'pre-wrap' || whiteSpace === 'pre-line';
|
52333
|
+
});
|
52334
|
+
|
52335
|
+
if (elements.length == 0) {
|
52336
|
+
return;
|
52337
|
+
}
|
52338
|
+
|
52339
|
+
var infos = elements.map(function (element) {
|
52340
|
+
var codeElement = element.querySelector('code');
|
52341
|
+
var lineNumbersWrapper = element.querySelector('.line-numbers-rows');
|
52342
|
+
if (!codeElement || !lineNumbersWrapper) {
|
52343
|
+
return undefined;
|
52344
|
+
}
|
52345
|
+
|
52346
|
+
/** @type {HTMLElement} */
|
52347
|
+
var lineNumberSizer = element.querySelector('.line-numbers-sizer');
|
52348
|
+
var codeLines = codeElement.textContent.split(NEW_LINE_EXP);
|
52349
|
+
|
52350
|
+
if (!lineNumberSizer) {
|
52351
|
+
lineNumberSizer = document.createElement('span');
|
52352
|
+
lineNumberSizer.className = 'line-numbers-sizer';
|
52353
|
+
|
52354
|
+
codeElement.appendChild(lineNumberSizer);
|
52355
|
+
}
|
52356
|
+
|
52357
|
+
lineNumberSizer.innerHTML = '0';
|
52358
|
+
lineNumberSizer.style.display = 'block';
|
52359
|
+
|
52360
|
+
var oneLinerHeight = lineNumberSizer.getBoundingClientRect().height;
|
52361
|
+
lineNumberSizer.innerHTML = '';
|
52362
|
+
|
52363
|
+
return {
|
52364
|
+
element: element,
|
52365
|
+
lines: codeLines,
|
52366
|
+
lineHeights: [],
|
52367
|
+
oneLinerHeight: oneLinerHeight,
|
52368
|
+
sizer: lineNumberSizer,
|
52369
|
+
};
|
52370
|
+
}).filter(Boolean);
|
52371
|
+
|
52372
|
+
infos.forEach(function (info) {
|
52373
|
+
var lineNumberSizer = info.sizer;
|
52374
|
+
var lines = info.lines;
|
52375
|
+
var lineHeights = info.lineHeights;
|
52376
|
+
var oneLinerHeight = info.oneLinerHeight;
|
52377
|
+
|
52378
|
+
lineHeights[lines.length - 1] = undefined;
|
52379
|
+
lines.forEach(function (line, index) {
|
52380
|
+
if (line && line.length > 1) {
|
52381
|
+
var e = lineNumberSizer.appendChild(document.createElement('span'));
|
52382
|
+
e.style.display = 'block';
|
52383
|
+
e.textContent = line;
|
52384
|
+
} else {
|
52385
|
+
lineHeights[index] = oneLinerHeight;
|
52386
|
+
}
|
52387
|
+
});
|
52388
|
+
});
|
52389
|
+
|
52390
|
+
infos.forEach(function (info) {
|
52391
|
+
var lineNumberSizer = info.sizer;
|
52392
|
+
var lineHeights = info.lineHeights;
|
52393
|
+
|
52394
|
+
var childIndex = 0;
|
52395
|
+
for (var i = 0; i < lineHeights.length; i++) {
|
52396
|
+
if (lineHeights[i] === undefined) {
|
52397
|
+
lineHeights[i] = lineNumberSizer.children[childIndex++].getBoundingClientRect().height;
|
52398
|
+
}
|
52399
|
+
}
|
52400
|
+
});
|
52401
|
+
|
52402
|
+
infos.forEach(function (info) {
|
52403
|
+
var lineNumberSizer = info.sizer;
|
52404
|
+
var wrapper = info.element.querySelector('.line-numbers-rows');
|
52405
|
+
|
52406
|
+
lineNumberSizer.style.display = 'none';
|
52407
|
+
lineNumberSizer.innerHTML = '';
|
52408
|
+
|
52409
|
+
info.lineHeights.forEach(function (height, lineNumber) {
|
52410
|
+
wrapper.children[lineNumber].style.height = height + 'px';
|
52411
|
+
});
|
52412
|
+
});
|
52413
|
+
}
|
52414
|
+
|
52415
|
+
/**
|
52416
|
+
* Returns style declarations for the element
|
52417
|
+
*
|
52418
|
+
* @param {Element} element
|
52419
|
+
*/
|
52420
|
+
function getStyles(element) {
|
52421
|
+
if (!element) {
|
52422
|
+
return null;
|
52423
|
+
}
|
52424
|
+
|
52425
|
+
return window.getComputedStyle ? getComputedStyle(element) : (element.currentStyle || null);
|
52426
|
+
}
|
52427
|
+
|
52428
|
+
var lastWidth = undefined;
|
52429
|
+
window.addEventListener('resize', function () {
|
52430
|
+
if (config.assumeViewportIndependence && lastWidth === window.innerWidth) {
|
52431
|
+
return;
|
52432
|
+
}
|
52433
|
+
lastWidth = window.innerWidth;
|
52434
|
+
|
52435
|
+
resizeElements(Array.prototype.slice.call(document.querySelectorAll('pre.' + PLUGIN_NAME)));
|
52436
|
+
});
|
52437
|
+
|
52438
|
+
Prism.hooks.add('complete', function (env) {
|
52439
|
+
if (!env.code) {
|
52440
|
+
return;
|
52441
|
+
}
|
52442
|
+
|
52443
|
+
var code = /** @type {Element} */ (env.element);
|
52444
|
+
var pre = /** @type {HTMLElement} */ (code.parentNode);
|
52445
|
+
|
52446
|
+
// works only for <code> wrapped inside <pre> (not inline)
|
52447
|
+
if (!pre || !/pre/i.test(pre.nodeName)) {
|
52448
|
+
return;
|
52449
|
+
}
|
52450
|
+
|
52451
|
+
// Abort if line numbers already exists
|
52452
|
+
if (code.querySelector('.line-numbers-rows')) {
|
52453
|
+
return;
|
52454
|
+
}
|
52455
|
+
|
52456
|
+
// only add line numbers if <code> or one of its ancestors has the `line-numbers` class
|
52457
|
+
if (!Prism.util.isActive(code, PLUGIN_NAME)) {
|
52458
|
+
return;
|
52459
|
+
}
|
52460
|
+
|
52461
|
+
// Remove the class 'line-numbers' from the <code>
|
52462
|
+
code.classList.remove(PLUGIN_NAME);
|
52463
|
+
// Add the class 'line-numbers' to the <pre>
|
52464
|
+
pre.classList.add(PLUGIN_NAME);
|
52465
|
+
|
52466
|
+
var match = env.code.match(NEW_LINE_EXP);
|
52467
|
+
var linesNum = match ? match.length + 1 : 1;
|
52468
|
+
var lineNumbersWrapper;
|
52469
|
+
|
52470
|
+
var lines = new Array(linesNum + 1).join('<span></span>');
|
52471
|
+
|
52472
|
+
lineNumbersWrapper = document.createElement('span');
|
52473
|
+
lineNumbersWrapper.setAttribute('aria-hidden', 'true');
|
52474
|
+
lineNumbersWrapper.className = 'line-numbers-rows';
|
52475
|
+
lineNumbersWrapper.innerHTML = lines;
|
52476
|
+
|
52477
|
+
if (pre.hasAttribute('data-start')) {
|
52478
|
+
pre.style.counterReset = 'linenumber ' + (parseInt(pre.getAttribute('data-start'), 10) - 1);
|
52479
|
+
}
|
52480
|
+
|
52481
|
+
env.element.appendChild(lineNumbersWrapper);
|
52482
|
+
|
52483
|
+
resizeElements([pre]);
|
52484
|
+
|
52485
|
+
Prism.hooks.run('line-numbers', env);
|
52486
|
+
});
|
52487
|
+
|
52488
|
+
Prism.hooks.add('line-numbers', function (env) {
|
52489
|
+
env.plugins = env.plugins || {};
|
52490
|
+
env.plugins.lineNumbers = true;
|
52491
|
+
});
|
52492
|
+
|
52493
|
+
}());
|
52494
|
+
|
52495
|
+
|
51854
52496
|
/***/ }),
|
51855
52497
|
|
51856
52498
|
/***/ "./node_modules/react-day-picker/dist/index.esm.js":
|