Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFerdinand Thiessen <rpm@fthiessen.de>2022-07-01 10:47:52 +0300
committerJonas <jonas@freesources.org>2022-10-05 12:33:10 +0300
commit9cf2534ae39b8cfbb01d7d1a6e7918cdf159e5b2 (patch)
tree485e9575e822aae8f54b629978417ef1059a6ef5 /src/extensions/RichText.js
parent879eaec610f310b3bc4e695f662eb88fe56563eb (diff)
Feature: Show word count in RichText
Show word count as last element of the overflow menu, which now will be always shown. The word count is updated when the menu is openend as the tiptap word count is not reactive. Modified ActionList: Added a named slot for adding elements that should always shown as the last elements. Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
Diffstat (limited to 'src/extensions/RichText.js')
-rw-r--r--src/extensions/RichText.js32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/extensions/RichText.js b/src/extensions/RichText.js
index 9d65be624..14fd3ba07 100644
--- a/src/extensions/RichText.js
+++ b/src/extensions/RichText.js
@@ -1,9 +1,9 @@
-/*
+/**
* @copyright Copyright (c) 2022 Max <max@nextcloud.com>
*
* @author Max <max@nextcloud.com>
*
- * @license GNU AGPL version 3 or any later version
+ * @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -18,32 +18,33 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
-*/
+ */
import { Extension } from '@tiptap/core'
/* eslint-disable import/no-named-as-default */
-import Document from '@tiptap/extension-document'
-import TipTapParagraph from '@tiptap/extension-paragraph'
-import Text from '@tiptap/extension-text'
import Blockquote from '@tiptap/extension-blockquote'
-import OrderedList from '@tiptap/extension-ordered-list'
-import ListItem from '@tiptap/extension-list-item'
+import BulletList from './../nodes/BulletList.js'
+import Callout from './../nodes/Callouts.js'
+import CharacterCount from '@tiptap/extension-character-count'
import Code from '@tiptap/extension-code'
import CodeBlock from '@tiptap/extension-code-block'
-import HorizontalRule from '@tiptap/extension-horizontal-rule'
+import Document from '@tiptap/extension-document'
import Dropcursor from '@tiptap/extension-dropcursor'
import FrontMatter from './../nodes/FrontMatter.js'
import HardBreak from './HardBreak.js'
+import Heading from '../nodes/Heading/index.js'
+import HorizontalRule from '@tiptap/extension-horizontal-rule'
+import Image from './../nodes/Image.js'
import KeepSyntax from './KeepSyntax.js'
+import ListItem from '@tiptap/extension-list-item'
+import Mention from './../extensions/Mention.js'
+import OrderedList from '@tiptap/extension-ordered-list'
import Table from './../nodes/Table.js'
-import Image from './../nodes/Image.js'
-import Heading from '../nodes/Heading/index.js'
-import BulletList from './../nodes/BulletList.js'
-import TaskList from './../nodes/TaskList.js'
import TaskItem from './../nodes/TaskItem.js'
-import Callout from './../nodes/Callouts.js'
-import Mention from './../extensions/Mention.js'
+import TaskList from './../nodes/TaskList.js'
+import Text from '@tiptap/extension-text'
+import TipTapParagraph from '@tiptap/extension-paragraph'
/* eslint-enable import/no-named-as-default */
import { Strong, Italic, Strike, Link, Underline } from './../marks/index.js'
@@ -75,6 +76,7 @@ export default Extension.create({
Italic,
Strike,
Blockquote,
+ CharacterCount,
Code,
CodeBlock,
BulletList,