Skip to content

Commit

Permalink
feat: add support for one-click copy code (#53)
Browse files Browse the repository at this point in the history
* feat: add support for one-click copy code

* fix: update icons

* feat: add copyCodeButtonAs
  • Loading branch information
simonguo committed Jan 26, 2024
1 parent ff9d83f commit f379146
Show file tree
Hide file tree
Showing 17 changed files with 2,263 additions and 2,061 deletions.
3 changes: 3 additions & 0 deletions docs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const App = () => {
editable
theme="dark"
dependencies={{ Button }}
editor={{
buttonClassName: 'rs-btn rs-btn-sm rs-btn-icon'
}}
afterCompile={(code: string) => {
return code.replace(/import\ [\*\w\,\{\}\ ]+\ from\ ?[\."'@/\w-]+;/gi, '');
}}
Expand Down
9 changes: 3 additions & 6 deletions docs/styles/index.less
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
@import '~rsuite/styles/index.less';
@import '~codemirror/lib/codemirror.css';
@import '~codemirror/theme/base16-light.css';
@import '~codemirror/theme/base16-dark.css';
@import '~highlight.js/styles/base16/tomorrow.css';

@import '../../src/less/styles.less';
@import '../../src/less/index.less';
@import './markdown.less';

@enable-css-reset: false;

:root {
--font-family-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono',
monospace;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"homepage": "https://github.com/simonguo/react-code-view#readme",
"dependencies": {
"@babel/runtime": "^7.18.6",
"@rsuite/icons": "^1.0.2",
"@types/codemirror": "5.60.5",
"classnames": "^2.2.5",
"codemirror": "5.65.6",
"copy-to-clipboard": "^3.3.3",
"highlight.js": "^11.5.1",
"html-loader": "^3.1.2",
"marked": "^4.0.17",
Expand Down Expand Up @@ -103,7 +103,7 @@
"prettier": "^2.4.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rsuite": "^5.15.2",
"rsuite": "^5.51.0",
"typescript": "^4.6.4",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
Expand Down
Loading

0 comments on commit f379146

Please sign in to comment.