19 | Welcome to Next.js! 20 |
21 | 22 |
23 | Get started by editing pages/index.js
24 |
├── .husky
└── pre-commit
├── example
├── next
│ ├── README.md
│ ├── .eslintrc.json
│ ├── public
│ │ └── favicon.ico
│ ├── next.config.js
│ ├── src
│ │ ├── pages
│ │ │ ├── _app.jsx
│ │ │ └── index.jsx
│ │ └── styles
│ │ │ ├── globals.css
│ │ │ └── Home.module.css
│ ├── .gitignore
│ └── package.json
└── web-component
│ ├── tsconfig.json
│ ├── src
│ ├── App.tsx
│ ├── MdEditorElement
│ │ ├── index.css
│ │ ├── index.tsx
│ │ ├── MdEditorElement.tsx
│ │ ├── data.md
│ │ └── iconfont.css
│ ├── main.tsx
│ └── vite-env.d.ts
│ ├── index.html
│ ├── vite.config.ts
│ ├── tsconfig.node.json
│ ├── tsconfig.app.json
│ ├── eslint.config.js
│ └── package.json
├── packages
├── MdEditor
│ ├── static
│ │ ├── env.ts
│ │ ├── index.ts
│ │ └── event-name.ts
│ ├── index.ts
│ ├── utils
│ │ ├── cache.ts
│ │ ├── md-it.ts
│ │ ├── event-bus.ts
│ │ └── index.ts
│ ├── components
│ │ ├── Divider
│ │ │ ├── index.tsx
│ │ │ └── index.less
│ │ ├── Dropdown
│ │ │ └── index.less
│ │ ├── Checkbox
│ │ │ ├── index.less
│ │ │ └── index.tsx
│ │ ├── CustomScrollbar
│ │ │ └── index.less
│ │ ├── Icon
│ │ │ ├── Github.tsx
│ │ │ ├── index.tsx
│ │ │ ├── Str.ts
│ │ │ └── Icon.tsx
│ │ └── Modal
│ │ │ └── index.less
│ ├── layouts
│ │ ├── Content
│ │ │ ├── hooks
│ │ │ │ ├── type.d.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── useToolbarEffect.ts
│ │ │ │ ├── useRemount.ts
│ │ │ │ ├── useAttach.ts
│ │ │ │ ├── useZoom.ts
│ │ │ │ ├── useFollowCatalog.ts
│ │ │ │ ├── useKatex.ts
│ │ │ │ ├── useHighlight.ts
│ │ │ │ ├── useTaskState.ts
│ │ │ │ ├── useAutoScroll.ts
│ │ │ │ ├── useCopyCode.ts
│ │ │ │ └── usePasteUpload.ts
│ │ │ ├── type.ts
│ │ │ ├── markdownIt
│ │ │ │ ├── echarts
│ │ │ │ │ └── index.ts
│ │ │ │ ├── mermaid
│ │ │ │ │ └── index.ts
│ │ │ │ ├── heading
│ │ │ │ │ └── index.ts
│ │ │ │ └── xss
│ │ │ │ │ └── index.ts
│ │ │ ├── props.ts
│ │ │ ├── index.less
│ │ │ ├── ContentPreview.tsx
│ │ │ ├── UpdateOnDemand.tsx
│ │ │ └── codemirror
│ │ │ │ ├── floatingToolbar.tsx
│ │ │ │ └── autocompletion.ts
│ │ ├── Modals
│ │ │ ├── index.tsx
│ │ │ └── index.less
│ │ ├── FloatingToolbar
│ │ │ ├── index.less
│ │ │ └── index.tsx
│ │ ├── Footer
│ │ │ ├── index.less
│ │ │ ├── MarkdownTotal.tsx
│ │ │ ├── ScrollAuto.tsx
│ │ │ └── index.tsx
│ │ └── Toolbar
│ │ │ ├── tools
│ │ │ ├── Github.tsx
│ │ │ ├── Save.tsx
│ │ │ ├── Sub.tsx
│ │ │ ├── Sup.tsx
│ │ │ ├── Bold.tsx
│ │ │ ├── Code.tsx
│ │ │ ├── Link.tsx
│ │ │ ├── Task.tsx
│ │ │ ├── Next.tsx
│ │ │ ├── Revoke.tsx
│ │ │ ├── Image.tsx
│ │ │ ├── Quote.tsx
│ │ │ ├── Italic.tsx
│ │ │ ├── CodeRow.tsx
│ │ │ ├── Prettier.tsx
│ │ │ ├── Preview.tsx
│ │ │ ├── Underline.tsx
│ │ │ ├── OrderedList.tsx
│ │ │ ├── StrikeThrough.tsx
│ │ │ ├── UnorderedList.tsx
│ │ │ ├── PreviewOnly.tsx
│ │ │ ├── HtmlPreview.tsx
│ │ │ ├── PageFullscreen.tsx
│ │ │ ├── Fullscreen.tsx
│ │ │ ├── Catalog.tsx
│ │ │ ├── Table.tsx
│ │ │ ├── Katex.tsx
│ │ │ └── Title.tsx
│ │ │ ├── index.tsx
│ │ │ ├── index.less
│ │ │ └── TableShape.tsx
│ ├── styles
│ │ ├── vars.less
│ │ ├── style.less
│ │ ├── preview.less
│ │ └── codeMirror.less
│ └── context.ts
├── config.ts
├── preview.ts
├── util.ts
├── MdCatalog
│ ├── context.ts
│ ├── index.less
│ └── CatalogLink.tsx
├── index.ts
├── MdPreview
│ └── hooks
│ │ └── useExpose.ts
├── NormalFooterToolbar
│ └── index.tsx
├── NormalToolbar
│ └── index.tsx
├── DropdownToolbar
│ └── index.tsx
└── ModalToolbar
│ └── index.tsx
├── dev
├── Preview
│ ├── index.less
│ ├── Normal
│ │ └── index.tsx
│ └── image
│ │ └── TargetBlankExtension.js
├── env.d.ts
├── vars.less
├── SecEditor.tsx
├── Header
│ ├── index.less
│ └── index.tsx
├── App.tsx
├── PreviewOnly
│ └── index.tsx
└── style.less
├── .prettierrc
├── tsconfig.node.json
├── .github
├── ISSUE_TEMPLATE
│ ├── feature_request_cn.yaml
│ ├── feature_request.yaml
│ ├── bug_report_cn.yaml
│ └── bug_report.yaml
└── workflows
│ ├── latest.yml
│ ├── beta.yml
│ └── close-inactive-issues.yml
├── .gitignore
├── index.html
├── tsconfig.build.json
├── tsconfig.json
├── SECURITY.md
├── LICENSE
├── scripts
├── dev.ts
├── plugins
│ └── nodeService.ts
├── build.type.ts
└── build.ts
├── eslint.config.mjs
├── README-CN.md
├── README.md
└── package.json
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | npm run lint-staged
--------------------------------------------------------------------------------
/example/next/README.md:
--------------------------------------------------------------------------------
1 | Example of `nextjs`.
2 |
--------------------------------------------------------------------------------
/example/next/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "next/core-web-vitals"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/MdEditor/static/env.ts:
--------------------------------------------------------------------------------
1 | export const isServer = typeof window === 'undefined';
2 |
--------------------------------------------------------------------------------
/example/next/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imzbf/md-editor-rt/HEAD/example/next/public/favicon.ico
--------------------------------------------------------------------------------
/packages/MdEditor/index.ts:
--------------------------------------------------------------------------------
1 | import Editor from './Editor';
2 |
3 | export default Editor;
4 |
5 | export * from './type';
6 |
--------------------------------------------------------------------------------
/example/web-component/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "files": [],
3 | "references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }]
4 | }
5 |
--------------------------------------------------------------------------------
/dev/Preview/index.less:
--------------------------------------------------------------------------------
1 | @import '../vars';
2 |
3 | .project-preview {
4 | padding: 2rem;
5 |
6 | .tips-text {
7 | color: #777;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/example/web-component/src/App.tsx:
--------------------------------------------------------------------------------
1 | import './MdEditorElement';
2 |
3 | const App = () => {
4 | return
23 | Get started by editing pages/index.js
24 |
${mermaidHtml}
`; 31 | } 32 | 33 | return `17 | 20 | 23 | 26 | 29 |
30 |31 | 37 | 43 | 49 | 55 | 61 | 67 |
68 |69 | {[ 70 | 'a11y', 71 | 'atom', 72 | 'github', 73 | 'gradient', 74 | 'kimbie', 75 | 'paraiso', 76 | 'qtcreator', 77 | 'stackoverflow' 78 | ].map((item) => { 79 | return ( 80 | 87 | ); 88 | })} 89 |
90 |