Skip to content

Commit

Permalink
feat(fluent-editor): export default toolbar (#2350)
Browse files Browse the repository at this point in the history
  • Loading branch information
kagol committed Oct 23, 2024
1 parent 80bcc5d commit e5057cf
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 25 deletions.
52 changes: 27 additions & 25 deletions packages/renderless/src/fluent-editor/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,33 +57,35 @@ const betterTable = {
}
}

const toolbar = () => {
const underline = ['bold', 'italic', 'underline', 'strike']
const list = [{ list: 'ordered' }, { list: 'bullet' }]
const script = [{ script: 'sub' }, { script: 'super' }]
const underline = ['bold', 'italic', 'underline', 'strike']
const list = [{ list: 'ordered' }, { list: 'bullet' }]
const script = [{ script: 'sub' }, { script: 'super' }]

export const defaultToolbar = [
['undo', 'redo', 'clean'],
[
{ font: fontFamilyConfig },
{ size: fontSizeConfig },
{ lineheight: lineHeightConfig },
{ header: [1, 2, 3, 4, 5, 6, false] }
],
underline,
['blockquote', 'code-block'],
[{ header: 1 }, { header: 2 }],
list,
script,
[{ indent: '-1' }, { indent: '+1' }],
[{ direction: 'rtl' }],
[{ color: [] }, { background: [] }],
[{ align: [] }],
['link', 'image'],
['better-table'],
['fullscreen']
]

const toolbar = () => {
return {
container: [
['undo', 'redo', 'clean'],
[
{ font: fontFamilyConfig },
{ size: fontSizeConfig },
{ lineheight: lineHeightConfig },
{ header: [1, 2, 3, 4, 5, 6, false] }
],
underline,
['blockquote', 'code-block'],
[{ header: 1 }, { header: 2 }],
list,
script,
[{ indent: '-1' }, { indent: '+1' }],
[{ direction: 'rtl' }],
[{ color: [] }, { background: [] }],
[{ align: [] }],
['link', 'image'],
['better-table'],
['fullscreen']
]
container: defaultToolbar
}
}

Expand Down
2 changes: 2 additions & 0 deletions packages/vue/src/fluent-editor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export const fluentEditorProps = {
}
}

export { defaultToolbar } from '@opentiny/vue-renderless/fluent-editor/options'

export default defineComponent({
name: $prefix + 'FluentEditor',
props: fluentEditorProps,
Expand Down

0 comments on commit e5057cf

Please sign in to comment.