@chayns-components/code-highlighter 5.0.0-beta.312
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/LICENSE +21 -0
- package/README.md +45 -0
- package/lib/components/CodeHighlighter.d.ts +27 -0
- package/lib/components/CodeHighlighter.js +69 -0
- package/lib/components/CodeHighlighter.js.map +1 -0
- package/lib/components/CodeHighlighter.styles.d.ts +16 -0
- package/lib/components/CodeHighlighter.styles.js +84 -0
- package/lib/components/CodeHighlighter.styles.js.map +1 -0
- package/lib/components/copy-to-clipboard/CopyToClipboard.d.ts +8 -0
- package/lib/components/copy-to-clipboard/CopyToClipboard.js +37 -0
- package/lib/components/copy-to-clipboard/CopyToClipboard.js.map +1 -0
- package/lib/components/copy-to-clipboard/CopyToClipboard.styles.d.ts +274 -0
- package/lib/components/copy-to-clipboard/CopyToClipboard.styles.js +10 -0
- package/lib/components/copy-to-clipboard/CopyToClipboard.styles.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +14 -0
- package/lib/index.js.map +1 -0
- package/lib/types/codeHighlighter.d.ts +10 -0
- package/lib/types/codeHighlighter.js +12 -0
- package/lib/types/codeHighlighter.js.map +1 -0
- package/package.json +70 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Tobit Laboratories AG
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>
|
|
3
|
+
<img src="https://raw.githubusercontent.com/TobitSoftware/chayns-components/master/assets/logo.png" width="600px" alt="chayns-components" />
|
|
4
|
+
</h1>
|
|
5
|
+
<p>A set of beautiful React components for developing your own applications with chayns.</p>
|
|
6
|
+
<div>
|
|
7
|
+
<img src="https://img.shields.io/npm/dm/@chayns-components/typewriter.svg?style=for-the-badge" alt="" />
|
|
8
|
+
<img src="https://img.shields.io/npm/v/@chayns-components/typewriter?style=for-the-badge" alt="" />
|
|
9
|
+
<img src="https://img.shields.io/github/license/TobitSoftware/chayns-components?style=for-the-badge" alt="" />
|
|
10
|
+
<img src="https://img.shields.io/github/contributors/TobitSoftware/chayns-components?style=for-the-badge" alt="" />
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
First you need to install the code highlighter part of the chayns-components.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# NPM
|
|
22
|
+
npm install @chayns-components/code-highlighter
|
|
23
|
+
|
|
24
|
+
# Yarn
|
|
25
|
+
yarn add @chayns-components/code-highlighter
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
> **Information:** Since the components have now been implemented with the styled-components
|
|
29
|
+
> library, the styles are delivered directly with the components. There is no need to load an extra
|
|
30
|
+
> stylesheet anymore.
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
You can use the components in your project as in the following example.
|
|
35
|
+
|
|
36
|
+
```typescript jsx
|
|
37
|
+
import { CodeHighlighter } from '@chayns-components/typewriter';
|
|
38
|
+
|
|
39
|
+
<CodeHighlighter>
|
|
40
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
|
|
41
|
+
ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo
|
|
42
|
+
dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est. Lorem ipsum dolor
|
|
43
|
+
sit amet.
|
|
44
|
+
</CodeHighlighter>;
|
|
45
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CodeHighlighterLanguage, CodeHighlighterTheme, HighlightedLines } from '../types/codeHighlighter';
|
|
3
|
+
export type CodeHighlighterProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The code that should be displayed.
|
|
6
|
+
*/
|
|
7
|
+
code: string;
|
|
8
|
+
/**
|
|
9
|
+
* The lines of code that should be highlighted.
|
|
10
|
+
* Following lines can be highlighted: added, removed and just marked.
|
|
11
|
+
*/
|
|
12
|
+
highlightedLines?: HighlightedLines;
|
|
13
|
+
/**
|
|
14
|
+
* The language of the displayed code.
|
|
15
|
+
*/
|
|
16
|
+
language: CodeHighlighterLanguage;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the line numbers should be displayed.
|
|
19
|
+
*/
|
|
20
|
+
shouldShowLineNumbers?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The theme of the code block. Decide between dark and light.
|
|
23
|
+
*/
|
|
24
|
+
theme?: CodeHighlighterTheme;
|
|
25
|
+
};
|
|
26
|
+
declare const CodeHighlighter: FC<CodeHighlighterProps>;
|
|
27
|
+
export default CodeHighlighter;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactSyntaxHighlighter = require("react-syntax-highlighter");
|
|
9
|
+
var _prism = require("react-syntax-highlighter/dist/esm/styles/prism");
|
|
10
|
+
var _codeHighlighter = require("../types/codeHighlighter");
|
|
11
|
+
var _CodeHighlighter = require("./CodeHighlighter.styles");
|
|
12
|
+
var _CopyToClipboard = _interopRequireDefault(require("./copy-to-clipboard/CopyToClipboard"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
const CodeHighlighter = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
theme = _codeHighlighter.CodeHighlighterTheme.Dark,
|
|
19
|
+
code,
|
|
20
|
+
language,
|
|
21
|
+
highlightedLines,
|
|
22
|
+
shouldShowLineNumbers = false
|
|
23
|
+
} = _ref;
|
|
24
|
+
const lineWrapper = (0, _react.useCallback)(lineNumber => {
|
|
25
|
+
let style = {
|
|
26
|
+
backgroundColor: 'none',
|
|
27
|
+
display: 'block',
|
|
28
|
+
borderRadius: '2px'
|
|
29
|
+
};
|
|
30
|
+
if (highlightedLines?.added && highlightedLines.added.includes(lineNumber)) {
|
|
31
|
+
style = {
|
|
32
|
+
...style,
|
|
33
|
+
backgroundColor: '#2EF29930'
|
|
34
|
+
};
|
|
35
|
+
} else if (highlightedLines?.removed && highlightedLines.removed.includes(lineNumber)) {
|
|
36
|
+
style = {
|
|
37
|
+
...style,
|
|
38
|
+
backgroundColor: '#F22E5B30'
|
|
39
|
+
};
|
|
40
|
+
} else if (highlightedLines?.marked && highlightedLines.marked.includes(lineNumber)) {
|
|
41
|
+
style = {
|
|
42
|
+
...style,
|
|
43
|
+
backgroundColor: '#cccccc40'
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
style
|
|
48
|
+
};
|
|
49
|
+
}, [highlightedLines]);
|
|
50
|
+
return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_CodeHighlighter.StyledCodeHighlighter, {
|
|
51
|
+
codeTheme: theme
|
|
52
|
+
}, /*#__PURE__*/_react.default.createElement(_CodeHighlighter.StyledCodeHighlighterHeader, {
|
|
53
|
+
codeTheme: theme
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement(_CodeHighlighter.StyledCodeHighlighterFileName, {
|
|
55
|
+
codeTheme: theme
|
|
56
|
+
}, language), /*#__PURE__*/_react.default.createElement(_CopyToClipboard.default, {
|
|
57
|
+
text: code,
|
|
58
|
+
theme: theme
|
|
59
|
+
})), /*#__PURE__*/_react.default.createElement(_reactSyntaxHighlighter.PrismAsyncLight, {
|
|
60
|
+
language: language,
|
|
61
|
+
showLineNumbers: shouldShowLineNumbers,
|
|
62
|
+
style: theme === _codeHighlighter.CodeHighlighterTheme.Dark ? _prism.oneDark : _prism.oneLight,
|
|
63
|
+
wrapLines: true,
|
|
64
|
+
lineProps: lineWrapper
|
|
65
|
+
}, code)), [theme, language, code, shouldShowLineNumbers, lineWrapper]);
|
|
66
|
+
};
|
|
67
|
+
CodeHighlighter.displayName = 'CodeHighlighter';
|
|
68
|
+
var _default = exports.default = CodeHighlighter;
|
|
69
|
+
//# sourceMappingURL=CodeHighlighter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeHighlighter.js","names":["_react","_interopRequireWildcard","require","_reactSyntaxHighlighter","_prism","_codeHighlighter","_CodeHighlighter","_CopyToClipboard","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","CodeHighlighter","_ref","theme","CodeHighlighterTheme","Dark","code","language","highlightedLines","shouldShowLineNumbers","lineWrapper","useCallback","lineNumber","style","backgroundColor","display","borderRadius","added","includes","removed","marked","useMemo","createElement","StyledCodeHighlighter","codeTheme","StyledCodeHighlighterHeader","StyledCodeHighlighterFileName","text","PrismAsyncLight","showLineNumbers","oneDark","oneLight","wrapLines","lineProps","displayName","_default","exports"],"sources":["../../src/components/CodeHighlighter.tsx"],"sourcesContent":["import React, { FC, useCallback, useMemo } from 'react';\nimport { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter';\nimport { oneDark, oneLight } from 'react-syntax-highlighter/dist/esm/styles/prism';\nimport {\n CodeHighlighterLanguage,\n CodeHighlighterTheme,\n HighlightedLines,\n} from '../types/codeHighlighter';\nimport {\n StyledCodeHighlighter,\n StyledCodeHighlighterFileName,\n StyledCodeHighlighterHeader,\n} from './CodeHighlighter.styles';\nimport CopyToClipboard from './copy-to-clipboard/CopyToClipboard';\n\nexport type CodeHighlighterProps = {\n /**\n * The code that should be displayed.\n */\n code: string;\n /**\n * The lines of code that should be highlighted.\n * Following lines can be highlighted: added, removed and just marked.\n */\n highlightedLines?: HighlightedLines;\n /**\n * The language of the displayed code.\n */\n language: CodeHighlighterLanguage;\n /**\n * Whether the line numbers should be displayed.\n */\n shouldShowLineNumbers?: boolean;\n /**\n * The theme of the code block. Decide between dark and light.\n */\n theme?: CodeHighlighterTheme;\n};\n\nconst CodeHighlighter: FC<CodeHighlighterProps> = ({\n theme = CodeHighlighterTheme.Dark,\n code,\n language,\n highlightedLines,\n shouldShowLineNumbers = false,\n}) => {\n const lineWrapper = useCallback(\n (lineNumber: number) => {\n let style = {\n backgroundColor: 'none',\n display: 'block',\n borderRadius: '2px',\n };\n\n if (highlightedLines?.added && highlightedLines.added.includes(lineNumber)) {\n style = { ...style, backgroundColor: '#2EF29930' };\n } else if (highlightedLines?.removed && highlightedLines.removed.includes(lineNumber)) {\n style = { ...style, backgroundColor: '#F22E5B30' };\n } else if (highlightedLines?.marked && highlightedLines.marked.includes(lineNumber)) {\n style = { ...style, backgroundColor: '#cccccc40' };\n }\n\n return { style };\n },\n [highlightedLines],\n );\n\n return useMemo(\n () => (\n <StyledCodeHighlighter codeTheme={theme}>\n <StyledCodeHighlighterHeader codeTheme={theme}>\n <StyledCodeHighlighterFileName codeTheme={theme}>\n {language}\n </StyledCodeHighlighterFileName>\n <CopyToClipboard text={code} theme={theme} />\n </StyledCodeHighlighterHeader>\n <SyntaxHighlighter\n language={language}\n showLineNumbers={shouldShowLineNumbers}\n style={theme === CodeHighlighterTheme.Dark ? oneDark : oneLight}\n wrapLines\n lineProps={lineWrapper}\n >\n {code}\n </SyntaxHighlighter>\n </StyledCodeHighlighter>\n ),\n [theme, language, code, shouldShowLineNumbers, lineWrapper],\n );\n};\n\nCodeHighlighter.displayName = 'CodeHighlighter';\n\nexport default CodeHighlighter;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WithTheme } from '@chayns-components/core';
|
|
3
|
+
import { CodeHighlighterTheme } from '../types/codeHighlighter';
|
|
4
|
+
type StyledCodeHighlighterProps = WithTheme<{
|
|
5
|
+
codeTheme: CodeHighlighterTheme;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const StyledCodeHighlighter: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledCodeHighlighterProps>>;
|
|
8
|
+
type StyledCodeHighlighterHeaderProps = WithTheme<{
|
|
9
|
+
codeTheme: CodeHighlighterTheme;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const StyledCodeHighlighterHeader: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledCodeHighlighterHeaderProps>>;
|
|
12
|
+
type StyledCodeHighlighterFileNameProps = WithTheme<{
|
|
13
|
+
codeTheme: CodeHighlighterTheme;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const StyledCodeHighlighterFileName: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, StyledCodeHighlighterFileNameProps>>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledCodeHighlighterHeader = exports.StyledCodeHighlighterFileName = exports.StyledCodeHighlighter = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _codeHighlighter = require("../types/codeHighlighter");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const StyledCodeHighlighter = exports.StyledCodeHighlighter = _styledComponents.default.div`
|
|
11
|
+
background-color: ${_ref => {
|
|
12
|
+
let {
|
|
13
|
+
codeTheme
|
|
14
|
+
} = _ref;
|
|
15
|
+
return codeTheme === _codeHighlighter.CodeHighlighterTheme.Dark ? '#282c34' : '#fafafa';
|
|
16
|
+
}};
|
|
17
|
+
border-radius: 8px;
|
|
18
|
+
padding-bottom: 6px;
|
|
19
|
+
|
|
20
|
+
pre {
|
|
21
|
+
margin: 0 !important;
|
|
22
|
+
|
|
23
|
+
// Styles for custom scrollbar
|
|
24
|
+
&::-webkit-scrollbar {
|
|
25
|
+
height: 5px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&::-webkit-scrollbar-track {
|
|
29
|
+
background-color: transparent;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&::-webkit-scrollbar-button {
|
|
33
|
+
background-color: transparent;
|
|
34
|
+
height: 2px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&::-webkit-scrollbar-thumb {
|
|
38
|
+
|
|
39
|
+
background-color: rgba(${_ref2 => {
|
|
40
|
+
let {
|
|
41
|
+
codeTheme
|
|
42
|
+
} = _ref2;
|
|
43
|
+
return codeTheme === _codeHighlighter.CodeHighlighterTheme.Dark ? '229, 229, 229' : '153, 153, 153';
|
|
44
|
+
}},
|
|
45
|
+
1);
|
|
46
|
+
border-radius: 20px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Scrollbar styles for Firefox. The above styles are not supported in Firefox, these styles are
|
|
50
|
+
// only supported in Firefox:
|
|
51
|
+
* {
|
|
52
|
+
scrollbar-color: rgba(${_ref3 => {
|
|
53
|
+
let {
|
|
54
|
+
codeTheme
|
|
55
|
+
} = _ref3;
|
|
56
|
+
return codeTheme === _codeHighlighter.CodeHighlighterTheme.Dark ? '229, 229, 229' : '153, 153, 153';
|
|
57
|
+
}},
|
|
58
|
+
1);)transparent;
|
|
59
|
+
scrollbar-width: thin;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
const StyledCodeHighlighterHeader = exports.StyledCodeHighlighterHeader = _styledComponents.default.div`
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
border-bottom: 1px solid
|
|
68
|
+
${_ref4 => {
|
|
69
|
+
let {
|
|
70
|
+
codeTheme
|
|
71
|
+
} = _ref4;
|
|
72
|
+
return codeTheme === _codeHighlighter.CodeHighlighterTheme.Dark ? '#e5e5e5' : '#999999';
|
|
73
|
+
}};
|
|
74
|
+
padding: 4px 12px;
|
|
75
|
+
`;
|
|
76
|
+
const StyledCodeHighlighterFileName = exports.StyledCodeHighlighterFileName = _styledComponents.default.span`
|
|
77
|
+
color: ${_ref5 => {
|
|
78
|
+
let {
|
|
79
|
+
codeTheme
|
|
80
|
+
} = _ref5;
|
|
81
|
+
return codeTheme === _codeHighlighter.CodeHighlighterTheme.Dark ? '#e5e5e5' : '#999999';
|
|
82
|
+
}};
|
|
83
|
+
`;
|
|
84
|
+
//# sourceMappingURL=CodeHighlighter.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeHighlighter.styles.js","names":["_styledComponents","_interopRequireDefault","require","_codeHighlighter","obj","__esModule","default","StyledCodeHighlighter","exports","styled","div","_ref","codeTheme","CodeHighlighterTheme","Dark","_ref2","_ref3","StyledCodeHighlighterHeader","_ref4","StyledCodeHighlighterFileName","span","_ref5"],"sources":["../../src/components/CodeHighlighter.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport styled from 'styled-components';\nimport { CodeHighlighterTheme } from '../types/codeHighlighter';\n\ntype StyledCodeHighlighterProps = WithTheme<{\n codeTheme: CodeHighlighterTheme;\n}>;\n\nexport const StyledCodeHighlighter = styled.div<StyledCodeHighlighterProps>`\n background-color: ${({ codeTheme }) =>\n codeTheme === CodeHighlighterTheme.Dark ? '#282c34' : '#fafafa'};\n border-radius: 8px;\n padding-bottom: 6px;\n\n pre {\n margin: 0 !important;\n\n // Styles for custom scrollbar\n &::-webkit-scrollbar {\n height: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-button {\n background-color: transparent;\n height: 2px;\n }\n\n &::-webkit-scrollbar-thumb {\n\n background-color: rgba(${({ codeTheme }) =>\n codeTheme === CodeHighlighterTheme.Dark ? '229, 229, 229' : '153, 153, 153'},\n 1);\n border-radius: 20px;\n }\n\n // Scrollbar styles for Firefox. The above styles are not supported in Firefox, these styles are\n // only supported in Firefox:\n * {\n scrollbar-color: rgba(${({ codeTheme }) =>\n codeTheme === CodeHighlighterTheme.Dark ? '229, 229, 229' : '153, 153, 153'},\n 1);)transparent;\n scrollbar-width: thin;\n }\n }\n`;\n\ntype StyledCodeHighlighterHeaderProps = WithTheme<{\n codeTheme: CodeHighlighterTheme;\n}>;\n\nexport const StyledCodeHighlighterHeader = styled.div<StyledCodeHighlighterHeaderProps>`\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-bottom: 1px solid\n ${({ codeTheme }) => (codeTheme === CodeHighlighterTheme.Dark ? '#e5e5e5' : '#999999')};\n padding: 4px 12px;\n`;\n\ntype StyledCodeHighlighterFileNameProps = WithTheme<{\n codeTheme: CodeHighlighterTheme;\n}>;\n\nexport const StyledCodeHighlighterFileName = styled.span<StyledCodeHighlighterFileNameProps>`\n color: ${({ codeTheme }) => (codeTheme === CodeHighlighterTheme.Dark ? '#e5e5e5' : '#999999')};\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAAgE,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAMzD,MAAMG,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAGE,yBAAM,CAACC,GAAgC;AAC5E,sBAAsBC,IAAA;EAAA,IAAC;IAAEC;EAAU,CAAC,GAAAD,IAAA;EAAA,OAC9BC,SAAS,KAAKC,qCAAoB,CAACC,IAAI,GAAG,SAAS,GAAG,SAAS;AAAA,CAAC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+BC,KAAA;EAAA,IAAC;IAAEH;EAAU,CAAC,GAAAG,KAAA;EAAA,OACnCH,SAAS,KAAKC,qCAAoB,CAACC,IAAI,GAAG,eAAe,GAAG,eAAe;AAAA,CAAC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8BE,KAAA;EAAA,IAAC;IAAEJ;EAAU,CAAC,GAAAI,KAAA;EAAA,OAClCJ,SAAS,KAAKC,qCAAoB,CAACC,IAAI,GAAG,eAAe,GAAG,eAAe;AAAA,CAAC;AACtF;AACA;AACA;AACA;AACA,CAAC;AAMM,MAAMG,2BAA2B,GAAAT,OAAA,CAAAS,2BAAA,GAAGR,yBAAM,CAACC,GAAsC;AACxF;AACA;AACA;AACA;AACA,UAAUQ,KAAA;EAAA,IAAC;IAAEN;EAAU,CAAC,GAAAM,KAAA;EAAA,OAAMN,SAAS,KAAKC,qCAAoB,CAACC,IAAI,GAAG,SAAS,GAAG,SAAS;AAAA,CAAE;AAC/F;AACA,CAAC;AAMM,MAAMK,6BAA6B,GAAAX,OAAA,CAAAW,6BAAA,GAAGV,yBAAM,CAACW,IAAyC;AAC7F,aAAaC,KAAA;EAAA,IAAC;IAAET;EAAU,CAAC,GAAAS,KAAA;EAAA,OAAMT,SAAS,KAAKC,qCAAoB,CAACC,IAAI,GAAG,SAAS,GAAG,SAAS;AAAA,CAAE;AAClG,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CodeHighlighterTheme } from '../../types/codeHighlighter';
|
|
3
|
+
export type CopyToClipboardProps = {
|
|
4
|
+
text: string;
|
|
5
|
+
theme: CodeHighlighterTheme;
|
|
6
|
+
};
|
|
7
|
+
declare const CopyToClipboard: FC<CopyToClipboardProps>;
|
|
8
|
+
export default CopyToClipboard;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _core = require("@chayns-components/core");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _codeHighlighter = require("../../types/codeHighlighter");
|
|
10
|
+
var _CopyToClipboard = require("./CopyToClipboard.styles");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
const CopyToClipboard = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
text,
|
|
15
|
+
theme
|
|
16
|
+
} = _ref;
|
|
17
|
+
const handleClick = () => {
|
|
18
|
+
void navigator.clipboard.writeText(text);
|
|
19
|
+
};
|
|
20
|
+
const popupContent = /*#__PURE__*/_react.default.createElement("span", {
|
|
21
|
+
style: {
|
|
22
|
+
display: 'block',
|
|
23
|
+
padding: '5px'
|
|
24
|
+
}
|
|
25
|
+
}, /*#__PURE__*/_react.default.createElement("p", null, "Kopiert!"));
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_core.Popup, {
|
|
27
|
+
content: popupContent
|
|
28
|
+
}, /*#__PURE__*/_react.default.createElement(_CopyToClipboard.StyledCopyToClipboard, {
|
|
29
|
+
onClick: handleClick
|
|
30
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Icon, {
|
|
31
|
+
icons: ['fa-light fa-clipboard'],
|
|
32
|
+
color: theme === _codeHighlighter.CodeHighlighterTheme.Dark ? '#e5e5e5' : '#999999'
|
|
33
|
+
})));
|
|
34
|
+
};
|
|
35
|
+
CopyToClipboard.displayName = 'CopyToClipboard';
|
|
36
|
+
var _default = exports.default = CopyToClipboard;
|
|
37
|
+
//# sourceMappingURL=CopyToClipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyToClipboard.js","names":["_core","require","_react","_interopRequireDefault","_codeHighlighter","_CopyToClipboard","obj","__esModule","default","CopyToClipboard","_ref","text","theme","handleClick","navigator","clipboard","writeText","popupContent","createElement","style","display","padding","Popup","content","StyledCopyToClipboard","onClick","Icon","icons","color","CodeHighlighterTheme","Dark","displayName","_default","exports"],"sources":["../../../src/components/copy-to-clipboard/CopyToClipboard.tsx"],"sourcesContent":["import { Icon, Popup } from '@chayns-components/core';\nimport React, { FC } from 'react';\nimport { CodeHighlighterTheme } from '../../types/codeHighlighter';\nimport { StyledCopyToClipboard } from './CopyToClipboard.styles';\n\nexport type CopyToClipboardProps = {\n text: string;\n theme: CodeHighlighterTheme;\n};\n\nconst CopyToClipboard: FC<CopyToClipboardProps> = ({ text, theme }) => {\n const handleClick = () => {\n void navigator.clipboard.writeText(text);\n };\n\n const popupContent = (\n <span style={{ display: 'block', padding: '5px' }}>\n {/* <h1 style={{ margin: 0 }}>Popup</h1> */}\n <p>Kopiert!</p>\n </span>\n );\n\n return (\n <Popup content={popupContent}>\n <StyledCopyToClipboard onClick={handleClick}>\n <Icon\n icons={['fa-light fa-clipboard']}\n color={theme === CodeHighlighterTheme.Dark ? '#e5e5e5' : '#999999'}\n />\n </StyledCopyToClipboard>\n </Popup>\n );\n};\n\nCopyToClipboard.displayName = 'CopyToClipboard';\n\nexport default CopyToClipboard;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AAAiE,SAAAE,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAOjE,MAAMG,eAAyC,GAAGC,IAAA,IAAqB;EAAA,IAApB;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAAF,IAAA;EAC9D,MAAMG,WAAW,GAAGA,CAAA,KAAM;IACtB,KAAKC,SAAS,CAACC,SAAS,CAACC,SAAS,CAACL,IAAI,CAAC;EAC5C,CAAC;EAED,MAAMM,YAAY,gBACdf,MAAA,CAAAM,OAAA,CAAAU,aAAA;IAAMC,KAAK,EAAE;MAAEC,OAAO,EAAE,OAAO;MAAEC,OAAO,EAAE;IAAM;EAAE,gBAE9CnB,MAAA,CAAAM,OAAA,CAAAU,aAAA,YAAG,UAAW,CACZ,CACT;EAED,oBACIhB,MAAA,CAAAM,OAAA,CAAAU,aAAA,CAAClB,KAAA,CAAAsB,KAAK;IAACC,OAAO,EAAEN;EAAa,gBACzBf,MAAA,CAAAM,OAAA,CAAAU,aAAA,CAACb,gBAAA,CAAAmB,qBAAqB;IAACC,OAAO,EAAEZ;EAAY,gBACxCX,MAAA,CAAAM,OAAA,CAAAU,aAAA,CAAClB,KAAA,CAAA0B,IAAI;IACDC,KAAK,EAAE,CAAC,uBAAuB,CAAE;IACjCC,KAAK,EAAEhB,KAAK,KAAKiB,qCAAoB,CAACC,IAAI,GAAG,SAAS,GAAG;EAAU,CACtE,CACkB,CACpB,CAAC;AAEhB,CAAC;AAEDrB,eAAe,CAACsB,WAAW,GAAG,iBAAiB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAzB,OAAA,GAEjCC,eAAe"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
export declare const StyledCopyToClipboard: import("styled-components").IStyledComponent<"web", {
|
|
4
|
+
ref?: import("react").LegacyRef<HTMLDivElement> | undefined;
|
|
5
|
+
key?: import("react").Key | null | undefined;
|
|
6
|
+
defaultChecked?: boolean | undefined;
|
|
7
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
8
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
9
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
10
|
+
accessKey?: string | undefined;
|
|
11
|
+
autoFocus?: boolean | undefined;
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
|
|
14
|
+
contextMenu?: string | undefined;
|
|
15
|
+
dir?: string | undefined;
|
|
16
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
17
|
+
hidden?: boolean | undefined;
|
|
18
|
+
id?: string | undefined;
|
|
19
|
+
lang?: string | undefined;
|
|
20
|
+
nonce?: string | undefined;
|
|
21
|
+
placeholder?: string | undefined;
|
|
22
|
+
slot?: string | undefined;
|
|
23
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
24
|
+
style?: import("react").CSSProperties | undefined;
|
|
25
|
+
tabIndex?: number | undefined;
|
|
26
|
+
title?: string | undefined;
|
|
27
|
+
translate?: "yes" | "no" | undefined;
|
|
28
|
+
radioGroup?: string | undefined;
|
|
29
|
+
role?: import("react").AriaRole | undefined;
|
|
30
|
+
about?: string | undefined;
|
|
31
|
+
content?: string | undefined;
|
|
32
|
+
datatype?: string | undefined;
|
|
33
|
+
inlist?: any;
|
|
34
|
+
prefix?: string | undefined;
|
|
35
|
+
property?: string | undefined;
|
|
36
|
+
rel?: string | undefined;
|
|
37
|
+
resource?: string | undefined;
|
|
38
|
+
rev?: string | undefined;
|
|
39
|
+
typeof?: string | undefined;
|
|
40
|
+
vocab?: string | undefined;
|
|
41
|
+
autoCapitalize?: string | undefined;
|
|
42
|
+
autoCorrect?: string | undefined;
|
|
43
|
+
autoSave?: string | undefined;
|
|
44
|
+
color?: string | undefined;
|
|
45
|
+
itemProp?: string | undefined;
|
|
46
|
+
itemScope?: boolean | undefined;
|
|
47
|
+
itemType?: string | undefined;
|
|
48
|
+
itemID?: string | undefined;
|
|
49
|
+
itemRef?: string | undefined;
|
|
50
|
+
results?: number | undefined;
|
|
51
|
+
security?: string | undefined;
|
|
52
|
+
unselectable?: "on" | "off" | undefined;
|
|
53
|
+
inputMode?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
54
|
+
is?: string | undefined;
|
|
55
|
+
"aria-activedescendant"?: string | undefined;
|
|
56
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
57
|
+
"aria-autocomplete"?: "inline" | "none" | "list" | "both" | undefined;
|
|
58
|
+
"aria-braillelabel"?: string | undefined;
|
|
59
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
60
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
61
|
+
"aria-checked"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
62
|
+
"aria-colcount"?: number | undefined;
|
|
63
|
+
"aria-colindex"?: number | undefined;
|
|
64
|
+
"aria-colindextext"?: string | undefined;
|
|
65
|
+
"aria-colspan"?: number | undefined;
|
|
66
|
+
"aria-controls"?: string | undefined;
|
|
67
|
+
"aria-current"?: boolean | "time" | "step" | "true" | "false" | "page" | "location" | "date" | undefined;
|
|
68
|
+
"aria-describedby"?: string | undefined;
|
|
69
|
+
"aria-description"?: string | undefined;
|
|
70
|
+
"aria-details"?: string | undefined;
|
|
71
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
72
|
+
"aria-dropeffect"?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
73
|
+
"aria-errormessage"?: string | undefined;
|
|
74
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
75
|
+
"aria-flowto"?: string | undefined;
|
|
76
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
77
|
+
"aria-haspopup"?: boolean | "dialog" | "menu" | "grid" | "true" | "false" | "listbox" | "tree" | undefined;
|
|
78
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
79
|
+
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
80
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
81
|
+
"aria-label"?: string | undefined;
|
|
82
|
+
"aria-labelledby"?: string | undefined;
|
|
83
|
+
"aria-level"?: number | undefined;
|
|
84
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
85
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
86
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
87
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
88
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
89
|
+
"aria-owns"?: string | undefined;
|
|
90
|
+
"aria-placeholder"?: string | undefined;
|
|
91
|
+
"aria-posinset"?: number | undefined;
|
|
92
|
+
"aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
93
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
94
|
+
"aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
95
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
96
|
+
"aria-roledescription"?: string | undefined;
|
|
97
|
+
"aria-rowcount"?: number | undefined;
|
|
98
|
+
"aria-rowindex"?: number | undefined;
|
|
99
|
+
"aria-rowindextext"?: string | undefined;
|
|
100
|
+
"aria-rowspan"?: number | undefined;
|
|
101
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
102
|
+
"aria-setsize"?: number | undefined;
|
|
103
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
104
|
+
"aria-valuemax"?: number | undefined;
|
|
105
|
+
"aria-valuemin"?: number | undefined;
|
|
106
|
+
"aria-valuenow"?: number | undefined;
|
|
107
|
+
"aria-valuetext"?: string | undefined;
|
|
108
|
+
children?: import("react").ReactNode;
|
|
109
|
+
dangerouslySetInnerHTML?: {
|
|
110
|
+
__html: string | TrustedHTML;
|
|
111
|
+
} | undefined;
|
|
112
|
+
onCopy?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
113
|
+
onCopyCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
114
|
+
onCut?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
115
|
+
onCutCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
116
|
+
onPaste?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
117
|
+
onPasteCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
118
|
+
onCompositionEnd?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
119
|
+
onCompositionEndCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
120
|
+
onCompositionStart?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
121
|
+
onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
122
|
+
onCompositionUpdate?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
123
|
+
onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
124
|
+
onFocus?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
125
|
+
onFocusCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
126
|
+
onBlur?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
127
|
+
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
128
|
+
onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
129
|
+
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
130
|
+
onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
131
|
+
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
132
|
+
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
133
|
+
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
134
|
+
onReset?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
135
|
+
onResetCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
136
|
+
onSubmit?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
137
|
+
onSubmitCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
138
|
+
onInvalid?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
139
|
+
onInvalidCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
140
|
+
onLoad?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
141
|
+
onLoadCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
142
|
+
onError?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
143
|
+
onErrorCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
144
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
145
|
+
onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
146
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
147
|
+
onKeyPressCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
148
|
+
onKeyUp?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
149
|
+
onKeyUpCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
150
|
+
onAbort?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
151
|
+
onAbortCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
152
|
+
onCanPlay?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
153
|
+
onCanPlayCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
154
|
+
onCanPlayThrough?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
155
|
+
onCanPlayThroughCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
156
|
+
onDurationChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
157
|
+
onDurationChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
158
|
+
onEmptied?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
159
|
+
onEmptiedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
160
|
+
onEncrypted?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
161
|
+
onEncryptedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
162
|
+
onEnded?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
163
|
+
onEndedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
164
|
+
onLoadedData?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
165
|
+
onLoadedDataCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
166
|
+
onLoadedMetadata?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
167
|
+
onLoadedMetadataCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
168
|
+
onLoadStart?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
169
|
+
onLoadStartCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
170
|
+
onPause?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
171
|
+
onPauseCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
172
|
+
onPlay?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
173
|
+
onPlayCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
174
|
+
onPlaying?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
175
|
+
onPlayingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
176
|
+
onProgress?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
177
|
+
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
178
|
+
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
179
|
+
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
180
|
+
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
181
|
+
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
182
|
+
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
183
|
+
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
184
|
+
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
185
|
+
onSeekingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
186
|
+
onStalled?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
187
|
+
onStalledCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
188
|
+
onSuspend?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
189
|
+
onSuspendCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
190
|
+
onTimeUpdate?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
191
|
+
onTimeUpdateCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
192
|
+
onVolumeChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
193
|
+
onVolumeChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
194
|
+
onWaiting?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
195
|
+
onWaitingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
196
|
+
onAuxClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
197
|
+
onAuxClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
198
|
+
onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
199
|
+
onClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
200
|
+
onContextMenu?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
201
|
+
onContextMenuCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
202
|
+
onDoubleClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
203
|
+
onDoubleClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
204
|
+
onDrag?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
205
|
+
onDragCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
206
|
+
onDragEnd?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
207
|
+
onDragEndCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
208
|
+
onDragEnter?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
209
|
+
onDragEnterCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
210
|
+
onDragExit?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
211
|
+
onDragExitCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
212
|
+
onDragLeave?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
213
|
+
onDragLeaveCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
214
|
+
onDragOver?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
215
|
+
onDragOverCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
216
|
+
onDragStart?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
217
|
+
onDragStartCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
218
|
+
onDrop?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
219
|
+
onDropCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
220
|
+
onMouseDown?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
221
|
+
onMouseDownCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
222
|
+
onMouseEnter?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
223
|
+
onMouseLeave?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
224
|
+
onMouseMove?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
225
|
+
onMouseMoveCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
226
|
+
onMouseOut?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
227
|
+
onMouseOutCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
228
|
+
onMouseOver?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
229
|
+
onMouseOverCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
230
|
+
onMouseUp?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
231
|
+
onMouseUpCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
232
|
+
onSelect?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
233
|
+
onSelectCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
234
|
+
onTouchCancel?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
235
|
+
onTouchCancelCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
236
|
+
onTouchEnd?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
237
|
+
onTouchEndCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
238
|
+
onTouchMove?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
239
|
+
onTouchMoveCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
240
|
+
onTouchStart?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
241
|
+
onTouchStartCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
242
|
+
onPointerDown?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
243
|
+
onPointerDownCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
244
|
+
onPointerMove?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
245
|
+
onPointerMoveCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
246
|
+
onPointerUp?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
247
|
+
onPointerUpCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
248
|
+
onPointerCancel?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
249
|
+
onPointerCancelCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
250
|
+
onPointerEnter?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
251
|
+
onPointerEnterCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
252
|
+
onPointerLeave?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
253
|
+
onPointerLeaveCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
254
|
+
onPointerOver?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
255
|
+
onPointerOverCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
256
|
+
onPointerOut?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
257
|
+
onPointerOutCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
258
|
+
onGotPointerCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
259
|
+
onGotPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
260
|
+
onLostPointerCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
261
|
+
onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
262
|
+
onScroll?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
263
|
+
onScrollCapture?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
264
|
+
onWheel?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
265
|
+
onWheelCapture?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
266
|
+
onAnimationStart?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
267
|
+
onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
268
|
+
onAnimationEnd?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
269
|
+
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
270
|
+
onAnimationIteration?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
271
|
+
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
272
|
+
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
273
|
+
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
274
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledCopyToClipboard = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const StyledCopyToClipboard = exports.StyledCopyToClipboard = _styledComponents.default.div``;
|
|
10
|
+
//# sourceMappingURL=CopyToClipboard.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyToClipboard.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledCopyToClipboard","exports","styled","div"],"sources":["../../../src/components/copy-to-clipboard/CopyToClipboard.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledCopyToClipboard = styled.div``;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhC,MAAMG,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAGE,yBAAM,CAACC,GAAI,EAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CodeHighlighter } from './components/CodeHighlighter';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "CodeHighlighter", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _CodeHighlighter.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _CodeHighlighter = _interopRequireDefault(require("./components/CodeHighlighter"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_CodeHighlighter","_interopRequireDefault","require","obj","__esModule","default"],"sources":["../src/index.ts"],"sourcesContent":["export { default as CodeHighlighter } from './components/CodeHighlighter';\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0E,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum CodeHighlighterTheme {
|
|
2
|
+
Light = "light",
|
|
3
|
+
Dark = "dark"
|
|
4
|
+
}
|
|
5
|
+
export interface HighlightedLines {
|
|
6
|
+
added?: number[];
|
|
7
|
+
removed?: number[];
|
|
8
|
+
marked?: number[];
|
|
9
|
+
}
|
|
10
|
+
export type CodeHighlighterLanguage = 'abap' | 'abnf' | 'actionscript' | 'ada' | 'agda' | 'al' | 'antlr4' | 'apacheconf' | 'apex' | 'apl' | 'applescript' | 'aql' | 'arduino' | 'arff' | 'asciidoc' | 'asm6502' | 'asmatmel' | 'aspnet' | 'autohotkey' | 'autoit' | 'avisynth' | 'avroIdl' | 'bash' | 'basic' | 'batch' | 'bbcode' | 'bicep' | 'birb' | 'bison' | 'bnf' | 'brainfuck' | 'brightscript' | 'bro' | 'bsl' | 'c' | 'cfscript' | 'chaiscript' | 'cil' | 'clike' | 'clojure' | 'cmake' | 'cobol' | 'coffeescript' | 'concurnas' | 'coq' | 'cpp' | 'crystal' | 'csharp' | 'cshtml' | 'csp' | 'cssExtras' | 'css' | 'csv' | 'cypher' | 'd' | 'dart' | 'dataweave' | 'dax' | 'dhall' | 'diff' | 'django' | 'dnsZoneFile' | 'docker' | 'dot' | 'ebnf' | 'editorconfig' | 'eiffel' | 'ejs' | 'elixir' | 'elm' | 'erb' | 'erlang' | 'etlua' | 'excelFormula' | 'factor' | 'falselang' | 'firestoreSecurityRules' | 'flow' | 'fortran' | 'fsharp' | 'ftl' | 'gap' | 'gcode' | 'gdscript' | 'gedcom' | 'gherkin' | 'git' | 'glsl' | 'gml' | 'gn' | 'goModule' | 'go' | 'graphql' | 'groovy' | 'haml' | 'handlebars' | 'haskell' | 'haxe' | 'hcl' | 'hlsl' | 'hoon' | 'hpkp' | 'hsts' | 'http' | 'ichigojam' | 'icon' | 'icuMessageFormat' | 'idris' | 'iecst' | 'ignore' | 'inform7' | 'ini' | 'io' | 'j' | 'java' | 'javadoc' | 'javadoclike' | 'javascript' | 'javastacktrace' | 'jexl' | 'jolie' | 'jq' | 'jsExtras' | 'jsTemplates' | 'jsdoc' | 'json' | 'json5' | 'jsonp' | 'jsstacktrace' | 'jsx' | 'julia' | 'keepalived' | 'keyman' | 'kotlin' | 'kumir' | 'kusto' | 'latex' | 'latte' | 'less' | 'lilypond' | 'liquid' | 'lisp' | 'livescript' | 'llvm' | 'log' | 'lolcode' | 'lua' | 'magma' | 'makefile' | 'markdown' | 'markupTemplating' | 'markup' | 'matlab' | 'maxscript' | 'mel' | 'mermaid' | 'mizar' | 'mongodb' | 'monkey' | 'moonscript' | 'n1ql' | 'n4js' | 'nand2tetrisHdl' | 'naniscript' | 'nasm' | 'neon' | 'nevod' | 'nginx' | 'nim' | 'nix' | 'nsis' | 'objectivec' | 'ocaml' | 'opencl' | 'openqasm' | 'oz' | 'parigp' | 'parser' | 'pascal' | 'pascaligo' | 'pcaxis' | 'peoplecode' | 'perl' | 'phpExtras' | 'php' | 'phpdoc' | 'plsql' | 'powerquery' | 'powershell' | 'processing' | 'prolog' | 'promql' | 'properties' | 'protobuf' | 'psl' | 'pug' | 'puppet' | 'pure' | 'purebasic' | 'purescript' | 'python' | 'q' | 'qml' | 'qore' | 'qsharp' | 'r' | 'racket' | 'reason' | 'regex' | 'rego' | 'renpy' | 'rest' | 'rip' | 'roboconf' | 'robotframework' | 'ruby' | 'rust' | 'sas' | 'sass' | 'scala' | 'scheme' | 'scss' | 'shellSession' | 'smali' | 'smalltalk' | 'smarty' | 'sml' | 'solidity' | 'solutionFile' | 'soy' | 'sparql' | 'splunkSpl' | 'sqf' | 'sql' | 'squirrel' | 'stan' | 'stylus' | 'swift' | 'systemd' | 't4Cs' | 't4Templating' | 't4Vb' | 'tap' | 'tcl' | 'textile' | 'toml' | 'tremor' | 'tsx' | 'tt2' | 'turtle' | 'twig' | 'typescript' | 'typoscript' | 'unrealscript' | 'uorazor' | 'uri' | 'v' | 'vala' | 'vbnet' | 'velocity' | 'verilog' | 'vhdl' | 'vim' | 'visualBasic' | 'warpscript' | 'wasm' | 'webIdl' | 'wiki' | 'wolfram' | 'wren' | 'xeora' | 'xmlDoc' | 'xojo' | 'xquery' | 'yaml' | 'yang' | 'zig';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CodeHighlighterTheme = void 0;
|
|
7
|
+
let CodeHighlighterTheme = exports.CodeHighlighterTheme = /*#__PURE__*/function (CodeHighlighterTheme) {
|
|
8
|
+
CodeHighlighterTheme["Light"] = "light";
|
|
9
|
+
CodeHighlighterTheme["Dark"] = "dark";
|
|
10
|
+
return CodeHighlighterTheme;
|
|
11
|
+
}({});
|
|
12
|
+
//# sourceMappingURL=codeHighlighter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeHighlighter.js","names":["CodeHighlighterTheme","exports"],"sources":["../../src/types/codeHighlighter.ts"],"sourcesContent":["export enum CodeHighlighterTheme {\n Light = 'light',\n Dark = 'dark',\n}\n\nexport interface HighlightedLines {\n added?: number[];\n removed?: number[];\n marked?: number[];\n}\n\nexport type CodeHighlighterLanguage =\n | 'abap'\n | 'abnf'\n | 'actionscript'\n | 'ada'\n | 'agda'\n | 'al'\n | 'antlr4'\n | 'apacheconf'\n | 'apex'\n | 'apl'\n | 'applescript'\n | 'aql'\n | 'arduino'\n | 'arff'\n | 'asciidoc'\n | 'asm6502'\n | 'asmatmel'\n | 'aspnet'\n | 'autohotkey'\n | 'autoit'\n | 'avisynth'\n | 'avroIdl'\n | 'bash'\n | 'basic'\n | 'batch'\n | 'bbcode'\n | 'bicep'\n | 'birb'\n | 'bison'\n | 'bnf'\n | 'brainfuck'\n | 'brightscript'\n | 'bro'\n | 'bsl'\n | 'c'\n | 'cfscript'\n | 'chaiscript'\n | 'cil'\n | 'clike'\n | 'clojure'\n | 'cmake'\n | 'cobol'\n | 'coffeescript'\n | 'concurnas'\n | 'coq'\n | 'cpp'\n | 'crystal'\n | 'csharp'\n | 'cshtml'\n | 'csp'\n | 'cssExtras'\n | 'css'\n | 'csv'\n | 'cypher'\n | 'd'\n | 'dart'\n | 'dataweave'\n | 'dax'\n | 'dhall'\n | 'diff'\n | 'django'\n | 'dnsZoneFile'\n | 'docker'\n | 'dot'\n | 'ebnf'\n | 'editorconfig'\n | 'eiffel'\n | 'ejs'\n | 'elixir'\n | 'elm'\n | 'erb'\n | 'erlang'\n | 'etlua'\n | 'excelFormula'\n | 'factor'\n | 'falselang'\n | 'firestoreSecurityRules'\n | 'flow'\n | 'fortran'\n | 'fsharp'\n | 'ftl'\n | 'gap'\n | 'gcode'\n | 'gdscript'\n | 'gedcom'\n | 'gherkin'\n | 'git'\n | 'glsl'\n | 'gml'\n | 'gn'\n | 'goModule'\n | 'go'\n | 'graphql'\n | 'groovy'\n | 'haml'\n | 'handlebars'\n | 'haskell'\n | 'haxe'\n | 'hcl'\n | 'hlsl'\n | 'hoon'\n | 'hpkp'\n | 'hsts'\n | 'http'\n | 'ichigojam'\n | 'icon'\n | 'icuMessageFormat'\n | 'idris'\n | 'iecst'\n | 'ignore'\n | 'inform7'\n | 'ini'\n | 'io'\n | 'j'\n | 'java'\n | 'javadoc'\n | 'javadoclike'\n | 'javascript'\n | 'javastacktrace'\n | 'jexl'\n | 'jolie'\n | 'jq'\n | 'jsExtras'\n | 'jsTemplates'\n | 'jsdoc'\n | 'json'\n | 'json5'\n | 'jsonp'\n | 'jsstacktrace'\n | 'jsx'\n | 'julia'\n | 'keepalived'\n | 'keyman'\n | 'kotlin'\n | 'kumir'\n | 'kusto'\n | 'latex'\n | 'latte'\n | 'less'\n | 'lilypond'\n | 'liquid'\n | 'lisp'\n | 'livescript'\n | 'llvm'\n | 'log'\n | 'lolcode'\n | 'lua'\n | 'magma'\n | 'makefile'\n | 'markdown'\n | 'markupTemplating'\n | 'markup'\n | 'matlab'\n | 'maxscript'\n | 'mel'\n | 'mermaid'\n | 'mizar'\n | 'mongodb'\n | 'monkey'\n | 'moonscript'\n | 'n1ql'\n | 'n4js'\n | 'nand2tetrisHdl'\n | 'naniscript'\n | 'nasm'\n | 'neon'\n | 'nevod'\n | 'nginx'\n | 'nim'\n | 'nix'\n | 'nsis'\n | 'objectivec'\n | 'ocaml'\n | 'opencl'\n | 'openqasm'\n | 'oz'\n | 'parigp'\n | 'parser'\n | 'pascal'\n | 'pascaligo'\n | 'pcaxis'\n | 'peoplecode'\n | 'perl'\n | 'phpExtras'\n | 'php'\n | 'phpdoc'\n | 'plsql'\n | 'powerquery'\n | 'powershell'\n | 'processing'\n | 'prolog'\n | 'promql'\n | 'properties'\n | 'protobuf'\n | 'psl'\n | 'pug'\n | 'puppet'\n | 'pure'\n | 'purebasic'\n | 'purescript'\n | 'python'\n | 'q'\n | 'qml'\n | 'qore'\n | 'qsharp'\n | 'r'\n | 'racket'\n | 'reason'\n | 'regex'\n | 'rego'\n | 'renpy'\n | 'rest'\n | 'rip'\n | 'roboconf'\n | 'robotframework'\n | 'ruby'\n | 'rust'\n | 'sas'\n | 'sass'\n | 'scala'\n | 'scheme'\n | 'scss'\n | 'shellSession'\n | 'smali'\n | 'smalltalk'\n | 'smarty'\n | 'sml'\n | 'solidity'\n | 'solutionFile'\n | 'soy'\n | 'sparql'\n | 'splunkSpl'\n | 'sqf'\n | 'sql'\n | 'squirrel'\n | 'stan'\n | 'stylus'\n | 'swift'\n | 'systemd'\n | 't4Cs'\n | 't4Templating'\n | 't4Vb'\n | 'tap'\n | 'tcl'\n | 'textile'\n | 'toml'\n | 'tremor'\n | 'tsx'\n | 'tt2'\n | 'turtle'\n | 'twig'\n | 'typescript'\n | 'typoscript'\n | 'unrealscript'\n | 'uorazor'\n | 'uri'\n | 'v'\n | 'vala'\n | 'vbnet'\n | 'velocity'\n | 'verilog'\n | 'vhdl'\n | 'vim'\n | 'visualBasic'\n | 'warpscript'\n | 'wasm'\n | 'webIdl'\n | 'wiki'\n | 'wolfram'\n | 'wren'\n | 'xeora'\n | 'xmlDoc'\n | 'xojo'\n | 'xquery'\n | 'yaml'\n | 'yang'\n | 'zig';\n"],"mappings":";;;;;;IAAYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chayns-components/code-highlighter",
|
|
3
|
+
"version": "5.0.0-beta.312",
|
|
4
|
+
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"chayns",
|
|
7
|
+
"react",
|
|
8
|
+
"components"
|
|
9
|
+
],
|
|
10
|
+
"author": "Tobit.Software",
|
|
11
|
+
"homepage": "https://github.com/TobitSoftware/chayns-components/tree/main/packages/typewriter#readme",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"main": "lib/index.js",
|
|
14
|
+
"types": "lib/index.d.ts",
|
|
15
|
+
"directories": {
|
|
16
|
+
"lib": "lib",
|
|
17
|
+
"test": "__tests__"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"lib"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/TobitSoftware/chayns-components.git"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "npm run build:js && npm run build:types",
|
|
28
|
+
"build:js": "babel src --out-dir lib --extensions=.ts,.tsx --source-maps --ignore=src/stories",
|
|
29
|
+
"build:types": "tsc",
|
|
30
|
+
"prepublishOnly": "npm run build"
|
|
31
|
+
},
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/TobitSoftware/chayns-components/issues"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@babel/cli": "^7.23.4",
|
|
37
|
+
"@babel/core": "^7.23.3",
|
|
38
|
+
"@babel/preset-env": "^7.23.3",
|
|
39
|
+
"@babel/preset-react": "^7.23.3",
|
|
40
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
41
|
+
"@types/react": "^18.2.38",
|
|
42
|
+
"@types/react-dom": "^18.2.17",
|
|
43
|
+
"@types/styled-components": "^5.1.32",
|
|
44
|
+
"@types/uuid": "^9.0.7",
|
|
45
|
+
"babel-loader": "^9.1.3",
|
|
46
|
+
"lerna": "^7.4.2",
|
|
47
|
+
"react": "^18.2.0",
|
|
48
|
+
"react-dom": "^18.2.0",
|
|
49
|
+
"styled-components": "^6.1.1",
|
|
50
|
+
"typescript": "^5.3.2"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@chayns-components/core": "^5.0.0-beta.310",
|
|
54
|
+
"@chayns/colors": "^2.0.0",
|
|
55
|
+
"@types/react-syntax-highlighter": "^15.5.10",
|
|
56
|
+
"clsx": "^2.0.0",
|
|
57
|
+
"framer-motion": "^10.16.5",
|
|
58
|
+
"react-syntax-highlighter": "^15.5.0",
|
|
59
|
+
"uuid": "^9.0.1"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"react": ">=16.14.0",
|
|
63
|
+
"react-dom": ">=16.14.0",
|
|
64
|
+
"styled-components": "^5.3.11"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public"
|
|
68
|
+
},
|
|
69
|
+
"gitHead": "fe5328cc7779447d66ed467132cbc416be005442"
|
|
70
|
+
}
|