Skip to content

Commit

Permalink
fix: update @opentiny/fluent-editor version and export defaultToolbar (
Browse files Browse the repository at this point in the history
…#2360)

* feat(fluent-editor): export default toolbar (#2350)

* fix(fleunt-editor): fix font name display wrong when config custom font toolbar
  • Loading branch information
kagol authored Oct 23, 2024
1 parent 80bcc5d commit 7934850
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 27 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
4 changes: 2 additions & 2 deletions packages/vue/src/fluent-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/vue-fluent-editor",
"version": "3.18.0",
"version": "3.18.3",
"description": "",
"license": "MIT",
"sideEffects": false,
Expand All @@ -11,7 +11,7 @@
"//postversion": "pnpm build"
},
"dependencies": {
"@opentiny/fluent-editor": "~3.17.0",
"@opentiny/fluent-editor": "~3.20.0",
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-icon": "workspace:~",
"@opentiny/vue-image-viewer": "workspace:~",
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 7934850

Please sign in to comment.