Skip to content

Commit

Permalink
some fixes related to reported issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwalmishra09 committed Feb 16, 2024
1 parent 093fbb9 commit 92db361
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
11 changes: 5 additions & 6 deletions src/components/tiptap.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { Editor, StarterKit, Placeholder, OrderedList, BulletList, ListItem, Underline, Link } from '../tiptap-exports'
import { Editor, StarterKit, Placeholder, Underline, Link } from '../tiptap-exports'

import {
toolbarButtons,
Expand Down Expand Up @@ -63,16 +63,15 @@ export default class TiptapEditor extends React.Component {
Placeholder.configure({
placeholder: this.props.placeholder,
}),
BulletList,
OrderedList,
ListItem,
Dropcap
],
content: this.props.content,
autofocus: !this.props.content,
onUpdate: ({ editor }) => {
this.props.onContentChanged(editor.getHTML());
},
onSelectionUpdate: this.onSelect,
onBlur: this.onBlur,
editorProps: {
handleKeyDown: (view, e) => {
return this.captureReturn(e)
Expand Down Expand Up @@ -235,9 +234,9 @@ export default class TiptapEditor extends React.Component {
handleLinkShortcut(e) {
if (e.which === 75 && (e.ctrlKey || e.metaKey)) {
e.preventDefault();
const selection = this.tiptap.editor.selection;
const selection = this.tiptap.state.selection;
if (selection && !selection.empty) {
this.handleCommand('link', 'toogleLink');
this.handleCommand('link', 'toggleLink');
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ var initBlock = [{
type: "text",
data: `<p>The Indian singles shuttlers were handed a tough road for the upcoming Badminton World Championships in the draws announced by BWF on Thursday.</p><p>PV Sindhu, who will be the only Indian woman singles shuttler in action, in the global event has been seeded a lowly 16th out of the total 48 players for the competition.</p><p>Though the former world champion has received a bye for the first round, she will have to face off against former World Champion Nozomi Okuhara in her opening match. Should Sindhu beat Okuhara, she will have to face world No 7 Ratchanok Intanon of Thailand.</p><p>If the Indian wins the contest, then she will have to face-off against world number 1 and top seed An Se Young in the pre-quarter-finals.</p><p>In the men’s singles section, ninth-seeded HS Prannoy is slated to face seventh seed Loh Kean Yew in the pre-quarter-finals if he wins his first two matches in the 64-player competition. If the 31-year-old advances further, he might have to go up against the reigning world champion Viktor Axelsen in the quarter-finals.</p><p>Lakshya Sen, seeded 11th, is drawn to face world No 3 Kunlavut Vitidsran in the pre-quarter-finals and China’s Lu Shi Feng or Lu Guang Zu in the quarter-finals.<br></p><p>The unseeded Kidambi Srikanth, on the other hand, will have to go past Japan’s Kenta Nishimoto in the very first round. He also has the second seeded Anthony Ginting (pre-quarters) and fifth seeded Jonatan Christie (quarter-finals) in his side of the draw. </p><h3><strong>Byes for Satwik-Chirag, Treesa-Gayatri</strong></h3><p>Meanwhile in the doubles section, the second seeded men’s doubles pair of Satwiksairaj Rankireddy and Chirag Shetty have been handed a bye in the first round. They will open their campaign against the winner of the clash between Australia’s Kenneth Choo/Ming Lim and Ireland’s Joshua Magee and Paul Reynolds.<br></p><p>Similarly, the pair of Treesa Jolly and Gayatri Gopichand will start their campaign directly in the second round against either Chang Ching Hui/Yang Ching Tun or Kati-Kreet Marran/Helina Ruutel.</p><p>The All England Open semi-finalists will, however, run into the top seed Chen Qing Chen and Jia Yi Fan of China in the very next round.</p><p>The other women’s doubles pair of Ashwini Bhat and Shikha Gautam will have to face Netherland’s Debora Jille and Cheryl Seinen in the opening round.</p><p>In the mixed doubles section, Rohan Kapoor and Sikki Reddy will have to the Scottish pair of beat Adam Hall and Julie MacPherson, while Venkat Prasad and Juhi Dewangan will have to overcome the challenge posed by the pair of Jones Ralfy Jansen and Linda Efler.</p>`,
key: Kattappa.uuid()
}, {
type: "text",
data: '',
key: Kattappa.uuid()
}];

const { Blocks, Editor } = Kattappa;
Expand Down
3 changes: 0 additions & 3 deletions src/tiptap-exports.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
export { Editor } from '@tiptap/core'
export { default as StarterKit } from '@tiptap/starter-kit'
export { default as Placeholder } from '@tiptap/extension-placeholder'
export { default as OrderedList } from '@tiptap/extension-ordered-list'
export { default as BulletList } from '@tiptap/extension-bullet-list'
export { default as ListItem } from '@tiptap/extension-list-item'
export { default as Underline } from '@tiptap/extension-underline'
export { default as Link } from '@tiptap/extension-link'
export { Extension, Mark } from '@tiptap/core'
Expand Down
2 changes: 1 addition & 1 deletion vite.tiptap-exports.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ export default defineConfig({
output: {
dir: path.resolve(path.dirname(''), 'lib'),
},
},
}
},
});

0 comments on commit 92db361

Please sign in to comment.