Commit ab53f5b3 by Рамис

upload video/*

cursor pointer to video upload block
parent 1df6a829
import React, { Fragment, useEffect, useState, useRef } from 'react' import React, { Fragment, useEffect, useState, useRef } from 'react'
import './index.scss' import './index.scss'
// import "katex/dist/katex.min.css"
// import EditorModal from "./components/EditorModal" // import EditorModal from "./components/EditorModal"
// import Uploader from "./components/Uploader" // import Uploader from "./components/Uploader"
...@@ -25,6 +24,7 @@ import Uploader from "./components/Uploader" ...@@ -25,6 +24,7 @@ import Uploader from "./components/Uploader"
import Video from './extensions/Video' import Video from './extensions/Video'
import Iframe from './extensions/Iframe' import Iframe from './extensions/Iframe'
import CustomLink from './extensions/CustomLink' import CustomLink from './extensions/CustomLink'
//import Formula from './extensions/Formula'
const initialBubbleItems = ['bold', 'italic', 'underline', 'strike', '|', 'colorText', 'highlight']; const initialBubbleItems = ['bold', 'italic', 'underline', 'strike', '|', 'colorText', 'highlight'];
...@@ -270,7 +270,15 @@ const QEditor = ({ value, onChange = ()=>{}, style, uploadOptions }) => { ...@@ -270,7 +270,15 @@ const QEditor = ({ value, onChange = ()=>{}, style, uploadOptions }) => {
title: 'Цвет фона', title: 'Цвет фона',
onClick: () => setColorsSelected('highlight') onClick: () => setColorsSelected('highlight')
}, },
// katex: {
// title: 'Вставить формулу',
// onClick: () => {
//
// console.log(katex.renderToString(String.raw`c = \pm\sqrt{a^2 + b^2}`));
//
// // editor.chain().focus().insertContent()
// }
// }
} }
const editor = useEditor({ const editor = useEditor({
...@@ -402,7 +410,7 @@ const QEditor = ({ value, onChange = ()=>{}, style, uploadOptions }) => { ...@@ -402,7 +410,7 @@ const QEditor = ({ value, onChange = ()=>{}, style, uploadOptions }) => {
) )
case 'video': case 'video':
return ( return (
<Fragment>{ getUploader({ accept: 'video/x-msvideo, video/quicktime, video/x-matroska, video/mp4, video/x-ms-wmv' }) }</Fragment> <Fragment>{ getUploader({ accept: 'video/*' }) }</Fragment>
) )
case 'image': case 'image':
return ( return (
......
...@@ -75,7 +75,7 @@ body{ ...@@ -75,7 +75,7 @@ body{
} }
span{ span{
font-size: 13px; font-size: 1em;
white-space: nowrap; white-space: nowrap;
} }
...@@ -87,6 +87,33 @@ body{ ...@@ -87,6 +87,33 @@ body{
opacity: 0.6; opacity: 0.6;
cursor: default; cursor: default;
} }
&[data-type="h2"]{
span{
font-size: 1.5em;
}
}
&[data-type="h3"]{
span{
font-size: 1.17em;
}
}
&[data-type="h2"], &[data-type="h3"], &[data-type="h4"]{
font-weight: 500;
padding: 8px;
.qicon{
display: none;
}
}
&[data-type="paragraph"]{
padding: 8px;
.qicon{
display: none;
}
}
} }
} }
...@@ -101,6 +128,7 @@ body{ ...@@ -101,6 +128,7 @@ body{
position: absolute; position: absolute;
top: 50%; top: 50%;
right: 0; right: 0;
margin-top: -2px;
} }
&.show{ &.show{
...@@ -343,6 +371,11 @@ body{ ...@@ -343,6 +371,11 @@ body{
box-shadow: 0 0 0 1px #F5F7FA; box-shadow: 0 0 0 1px #F5F7FA;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
cursor: pointer;
&:hover{
border-color: #adb0b6;
}
} }
&-placeholder{ &-placeholder{
display: inline-block; display: inline-block;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment