-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove third part internal dependencies (#178)
- Loading branch information
Showing
19 changed files
with
292 additions
and
531 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 12 additions & 5 deletions
17
packages/docs/fluent-editor/demos/header-list-container.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<script setup lang="ts"> | ||
import QuillToolbarTip from 'quill-toolbar-tip' | ||
import { onBeforeUnmount, onMounted, ref } from 'vue' | ||
import 'quill-toolbar-tip/dist/index.css' | ||
// 代码块高亮 | ||
import hljs from 'highlight.js' | ||
import 'highlight.js/styles/atom-one-dark.css' | ||
// 插入公式 | ||
import katex from 'katex' | ||
import 'katex/dist/katex.min.css' | ||
// 截屏 | ||
import Html2Canvas from 'html2canvas' | ||
window.hljs = hljs | ||
window.katex = katex | ||
window.Html2Canvas = Html2Canvas | ||
let editor | ||
const editorRef = ref<HTMLElement>() | ||
const TOOLBAR_CONFIG = [ | ||
['undo', 'redo', 'clean', 'format-painter'], | ||
[ | ||
{ header: [1, 2, 3, 4, 5, 6, false] }, | ||
{ font: ['songti', 'yahei', 'kaiti', 'heiti', 'lishu', 'mono', 'arial', 'arialblack', 'comic', 'impact', 'times'] }, | ||
{ size: ['12px', '14px', '16px', '18px', '20px', '24px', '32px', '36px', '48px', '72px'] }, | ||
{ lineheight: ['1', '1.2', '1.5', '1.75', '2', '3', '4', '5'] }, | ||
], | ||
['bold', 'italic', 'strike', 'underline', 'divider'], | ||
[{ color: [] }, { background: [] }], | ||
[{ align: '' }, { align: 'center' }, { align: 'right' }, { align: 'justify' }], | ||
[{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }], | ||
[{ script: 'sub' }, { script: 'super' }], | ||
[{ indent: '-1' }, { indent: '+1' }], | ||
[{ direction: 'rtl' }], | ||
['link', 'blockquote', 'code', 'code-block'], | ||
['image', 'file', 'better-table'], | ||
['emoji', 'video', 'formula', 'screenshot', 'fullscreen'], | ||
] | ||
onMounted(() => { | ||
// ssr compat, reference: https://vitepress.dev/guide/ssr-compat#importing-in-mounted-hook | ||
import('@opentiny/fluent-editor').then(({ default: FluentEditor, generateToolbarTip }) => { | ||
FluentEditor.register({ 'modules/toolbar-tip': generateToolbarTip(QuillToolbarTip) }, true) | ||
editor = new FluentEditor(editorRef.value, { | ||
theme: 'snow', | ||
modules: { | ||
'toolbar': TOOLBAR_CONFIG, | ||
'file': true, | ||
'emoji-toolbar': true, | ||
'syntax': true, | ||
'toolbar-tip': true, | ||
}, | ||
}) | ||
}) | ||
}) | ||
onBeforeUnmount(() => { | ||
editor.getModule('toolbar-tip').destroyAllTips() | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div ref="editorRef" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 工具栏提示文字 | ||
|
||
## 安装 | ||
|
||
此功能为外部插件,使用前请安装[`quill-toolbar-tip`](https://www.npmjs.com/package/quill-toolbar-tip)插件,完整文档请查看[插件文档](https://github.com/opentiny/quill-toolbar-tip#quilltoolbartip)。 | ||
|
||
```bash | ||
npm install quill-header-list | ||
``` | ||
|
||
## 基础使用 | ||
|
||
内部提供函数`generateToolbarTip`用于适配`i18n`模块,如若禁用`i18n`模块,则需要手动传递参数。 | ||
|
||
> 注意注册模块名称请保持为`toolbar-tip` | ||
:::demo src=demos/toolbar-tip.vue | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import FluentEditor from './fluent-editor' | ||
import { FluentEditor } from './fluent-editor' | ||
|
||
export * from './config' | ||
|
||
export * from './toolbar/toolbar-tip' | ||
export default FluentEditor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.