Skip to content

Commit

Permalink
refactor: remove better-table (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
kagol authored Feb 25, 2025
1 parent a4be786 commit 24dfb10
Show file tree
Hide file tree
Showing 49 changed files with 31 additions and 5,842 deletions.
3 changes: 1 addition & 2 deletions packages/docs/fluent-editor/.vitepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function sidebar() {
{ text: '图片上传', link: '/docs/demo/image-upload' },
{ text: '文件上传', link: '/docs/demo/file-upload' },
{ text: '代码块高亮', link: '/docs/demo/code-block-highlight' },
{ text: '表格', link: '/docs/demo/table' },
{ text: '表格', link: '/docs/demo/table-up' },
{ text: '@提醒', link: '/docs/demo/mention' },
{ text: '插入表情', link: '/docs/demo/emoji' },
{ text: '格式刷', link: '/docs/demo/format-painter' },
Expand Down Expand Up @@ -41,7 +41,6 @@ export function sidebar() {
items: [
{ text: '工具栏提示', link: '/docs/modules/toolbar-tip' },
{ text: '标题列表', link: '/docs/modules/header-list' },
{ text: '表格up', link: '/docs/modules/table-up' },
],
},
]
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/fluent-editor/demos/custom-toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const TOOLBAR_CONFIG = [
[{ indent: '-1' }, { indent: '+1' }],
[{ direction: 'rtl' }],
['link', 'blockquote', 'code', 'code-block'],
['image', 'file', 'better-table'],
['image', 'file'],
['emoji', 'video', 'formula', 'screenshot', 'fullscreen'],
]
Expand Down
35 changes: 1 addition & 34 deletions packages/docs/fluent-editor/demos/get-content-delta.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const TOOLBAR_CONFIG = [
[{ indent: '-1' }, { indent: '+1' }],
[{ direction: 'rtl' }],
['link', 'blockquote', 'code', 'code-block'],
['image', 'file', 'better-table'],
['image', 'file'],
['emoji', 'video', 'formula', 'screenshot'],
]
Expand Down Expand Up @@ -75,39 +75,6 @@ onMounted(() => {
})
},
},
'better-table': {
operationMenu: {
color: {
text: '主题色',
colors: [
'#ffffff',
'#f2f2f2',
'#dddddd',
'#a6a6a6',
'#666666',
'#000000',
'#c00000',
'#ff0000',
'#ffc8d3',
'#ffc000',
'#ffff00',
'#fff4cb',
'#92d050',
'#00b050',
'#dff3d2',
'#00b0f0',
'#0070c0',
'#d4f1f5',
'#002060',
'#7030a0',
'#7b69ee',
'#1476ff',
'#ec66ab',
'#42b883',
],
},
},
},
},
})
Expand Down
35 changes: 1 addition & 34 deletions packages/docs/fluent-editor/demos/get-content-html.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const TOOLBAR_CONFIG = [
[{ indent: '-1' }, { indent: '+1' }],
[{ direction: 'rtl' }],
['link', 'blockquote', 'code', 'code-block'],
['image', 'file', 'better-table'],
['image', 'file'],
['emoji', 'video', 'formula', 'screenshot'],
]
Expand Down Expand Up @@ -75,39 +75,6 @@ onMounted(() => {
})
},
},
'better-table': {
operationMenu: {
color: {
text: '主题色',
colors: [
'#ffffff',
'#f2f2f2',
'#dddddd',
'#a6a6a6',
'#666666',
'#000000',
'#c00000',
'#ff0000',
'#ffc8d3',
'#ffc000',
'#ffff00',
'#fff4cb',
'#92d050',
'#00b050',
'#dff3d2',
'#00b0f0',
'#0070c0',
'#d4f1f5',
'#002060',
'#7030a0',
'#7b69ee',
'#1476ff',
'#ec66ab',
'#42b883',
],
},
},
},
},
})
Expand Down
3 changes: 1 addition & 2 deletions packages/docs/fluent-editor/demos/header-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ onMounted(() => {
modules: {
'toolbar': {
container: [
[{ header: [false, 1, 2, 3, 4, 5, 6] }, 'header-list', 'better-table'],
[{ header: [false, 1, 2, 3, 4, 5, 6] }, 'header-list'],
],
handlers: {
'header-list': HeaderList.toolbarHandle,
Expand All @@ -29,7 +29,6 @@ onMounted(() => {
'header-list': {
container: headerListRef.value,
},
'better-table': {},
},
})
Expand Down
8 changes: 0 additions & 8 deletions packages/docs/fluent-editor/demos/i18n-custom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,10 @@ onMounted(() => {
['bold', 'italic', 'strike', 'underline'],
['link', 'image'],
[{ color: [] }, { background: [] }],
['better-table'],
],
'counter': true,
'better-table': true,
'i18n': {
lang: 'zh-CN',
langText: {
'copy-cells': '复制单元格',
'copy-table': '复制表格',
'cut-cells': '剪切单元格',
'empty-cells': '清空单元格',
},
},
},
Expand Down
2 changes: 0 additions & 2 deletions packages/docs/fluent-editor/demos/i18n.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ onMounted(() => {
['bold', 'italic', 'strike', 'underline'],
['link', 'image'],
[{ color: [] }, { background: [] }],
['better-table'],
],
'counter': true,
'better-table': true,
'i18n': {
lang: lang.value,
},
Expand Down
13 changes: 0 additions & 13 deletions packages/docs/fluent-editor/demos/table-text-options.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const TOOLBAR_CONFIG = [
['bold', 'italic', 'underline', 'link'],
[{ list: 'ordered' }, { list: 'bullet' }],
['clean'],
['better-table'],
]
const editorRef = ref()
Expand All @@ -25,18 +24,6 @@ onMounted(() => {
},
modules: {
'toolbar': TOOLBAR_CONFIG,
'better-table': {
operationMenu: {
items: {
copyCells: {
text: '复制单元格',
},
},
color: {
text: '主题色2',
},
},
},
},
})
})
Expand Down
2 changes: 0 additions & 2 deletions packages/docs/fluent-editor/demos/table-up-menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ onMounted(() => {
theme: 'snow',
modules: {
'toolbar': TOOLBAR_CONFIG,
'better-table': false,
'table-up': {
customSelect: defaultCustomSelect,
selection: TableSelection,
Expand All @@ -48,7 +47,6 @@ onMounted(() => {
theme: 'snow',
modules: {
'toolbar': TOOLBAR_CONFIG,
'better-table': false,
'table-up': {
customSelect: defaultCustomSelect,
selection: TableSelection,
Expand Down
3 changes: 0 additions & 3 deletions packages/docs/fluent-editor/demos/table-up-resize.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ onMounted(() => {
theme: 'snow',
modules: {
'toolbar': TOOLBAR_CONFIG,
'better-table': false,
'table-up': {
customSelect: defaultCustomSelect,
resize: TableResizeBox,
Expand All @@ -47,7 +46,6 @@ onMounted(() => {
theme: 'snow',
modules: {
'toolbar': TOOLBAR_CONFIG,
'better-table': false,
'table-up': {
customSelect: defaultCustomSelect,
resize: TableResizeLine,
Expand All @@ -60,7 +58,6 @@ onMounted(() => {
theme: 'snow',
modules: {
'toolbar': TOOLBAR_CONFIG,
'better-table': false,
'table-up': {
customSelect: defaultCustomSelect,
resizeScale: TableResizeScale,
Expand Down
1 change: 0 additions & 1 deletion packages/docs/fluent-editor/demos/table-up-shortcut.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ onMounted(() => {
theme: 'snow',
modules: {
'toolbar': TOOLBAR_CONFIG,
'better-table': false,
'table-up': {
customSelect: defaultCustomSelect,
},
Expand Down
63 changes: 0 additions & 63 deletions packages/docs/fluent-editor/demos/table.vue

This file was deleted.

2 changes: 1 addition & 1 deletion packages/docs/fluent-editor/demos/toolbar-tip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const TOOLBAR_CONFIG = [
[{ indent: '-1' }, { indent: '+1' }],
[{ direction: 'rtl' }],
['link', 'blockquote', 'code', 'code-block'],
['image', 'file', 'better-table'],
['image', 'file'],
['emoji', 'video', 'formula', 'screenshot', 'fullscreen'],
]
Expand Down
3 changes: 0 additions & 3 deletions packages/docs/fluent-editor/docs/api/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ import type { QuillOptions } from 'quill'

export interface FluentEditorOptions extends QuillOptions {
modules?: QuillModules & {
// 表格模块
'better-table'?: boolean | BetterTableOptions

// 字符统计模块
'counter': boolean | CounterOption

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/fluent-editor/docs/demo/custom-toolbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- `redo` 重做
- `file` 文件上传,需要启用 `file` 模块
- `emoji` 插入表情,需要启用 `emoji-toolbar` 模块
- `better-table` 表格,需要启用 `better-table` 模块
- `table-up` 表格,需要启用 `table-up` 模块
- `format-painter` 格式刷
- `screenshot` 截屏

Expand Down
1 change: 0 additions & 1 deletion packages/docs/fluent-editor/docs/demo/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Welcome to commit PR for more language support.
```ts
options = {
langText: {
// better-table module
'copy-cells': 'Copy',
'copy-table': 'Copy Table',
'cut-cells': 'Cut',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# TableUp

具体相关参数请查看[文档](https://github.com/zzxming/quill-table-up?tab=readme-ov-file#usage)

## 安装

```bash
npm install quill-table-up
```

### 单元格操作菜单

:::demo src=demos/table-up-menu.vue
:::

### 单元格大小调整

:::demo src=demos/table-up-resize.vue
:::

### 快捷菜单配置

:::demo src=demos/table-up-shortcut.vue
:::
# 表格

TinyEditor 的表格功能依赖 `quill-table-up`,使用前请先安装 `quill-table-up`

```bash
npm install quill-table-up
```

具体相关参数请查看[文档](https://github.com/zzxming/quill-table-up?tab=readme-ov-file#usage)

## 单元格操作菜单

:::demo src=demos/table-up-menu.vue
:::

## 单元格大小调整

:::demo src=demos/table-up-resize.vue
:::

## 快捷菜单配置

:::demo src=demos/table-up-shortcut.vue
:::
Loading

0 comments on commit 24dfb10

Please sign in to comment.