mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-02-10 18:05:32 +08:00
chore: commit for review
This commit is contained in:
83
apps/common/mobile/lib/controller/Draw.jsx
Normal file
83
apps/common/mobile/lib/controller/Draw.jsx
Normal file
@ -0,0 +1,83 @@
|
||||
import React, {useEffect, useState} from 'react'
|
||||
import {DrawView} from "../view/Draw";
|
||||
import {f7} from 'framework7-react';
|
||||
|
||||
export const DrawController = ({isDrawing, setDrawing}) => {
|
||||
useEffect(() => {
|
||||
Common.Notifications.on('draw:start', () => {
|
||||
setDrawing(true);
|
||||
setCurrentToolProxy('pen');
|
||||
})
|
||||
|
||||
Common.Notifications.on('draw:stop', () => {
|
||||
setDrawing(false);
|
||||
setCurrentToolProxy(null);
|
||||
})
|
||||
|
||||
return () => {
|
||||
Common.Notifications.off('draw:start');
|
||||
Common.Notifications.off('draw:stop');
|
||||
}
|
||||
}, []);
|
||||
|
||||
const [currentTool, setCurrentTool] = useState(null)
|
||||
const [settings, setSettings] = useState({color: 'ff0000', lineSize: 2, opacity: 100});
|
||||
// const penSettings = {
|
||||
// highlighter: {color: 'FFFC54', opacity: 50, size: [2, 4, 6, 8, 10], idx: 1}
|
||||
// }
|
||||
|
||||
const setCurrentToolProxy = val => {
|
||||
setCurrentTool(val);
|
||||
const api = Common.EditorApi.get();
|
||||
switch (val) {
|
||||
case 'pen': {
|
||||
const stroke = new Asc.asc_CStroke();
|
||||
stroke.put_type(Asc.c_oAscStrokeType.STROKE_COLOR);
|
||||
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(settings.color)); // options.color
|
||||
stroke.asc_putPrstDash(Asc.c_oDashType.solid);
|
||||
stroke.put_width(settings.lineSize); // options.size.arr[options.size.idx]
|
||||
stroke.put_transparent(settings.opacity * 2.55);
|
||||
api.asc_StartDrawInk(stroke, 0);
|
||||
break;
|
||||
}
|
||||
case 'highlighter': { /* same as PEN (idx: 1) */
|
||||
const stroke = new Asc.asc_CStroke();
|
||||
stroke.put_type(Asc.c_oAscStrokeType.STROKE_COLOR);
|
||||
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(settings.color));
|
||||
stroke.asc_putPrstDash(Asc.c_oDashType.solid);
|
||||
stroke.put_width(settings.lineSize);
|
||||
stroke.put_transparent(50 * 2.55);
|
||||
api.asc_StartDrawInk(stroke, 0);
|
||||
break
|
||||
}
|
||||
// 2 once buttons
|
||||
// case 'colorPicker': { break }
|
||||
case 'eraser': {
|
||||
api.asc_StartInkEraser();
|
||||
break
|
||||
}
|
||||
case 'eraseEntireScreen': {
|
||||
// method?
|
||||
break
|
||||
}
|
||||
case 'scroll':
|
||||
// scroll method?
|
||||
case null: {
|
||||
api.asc_StopInkDrawer();
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function showSettings() {
|
||||
f7.sheet.open('.draw__sheet')
|
||||
}
|
||||
|
||||
return isDrawing ? <DrawView
|
||||
currentTool={currentTool}
|
||||
setTool={setCurrentToolProxy}
|
||||
settings={settings}
|
||||
setSettings={setSettings}
|
||||
showSettings={showSettings}
|
||||
/> : null
|
||||
}
|
||||
49
apps/common/mobile/lib/view/Draw.jsx
Normal file
49
apps/common/mobile/lib/view/Draw.jsx
Normal file
@ -0,0 +1,49 @@
|
||||
import React from "react";
|
||||
import {Button, Range, Sheet} from 'framework7-react';
|
||||
import SvgIcon from '../../../../common/mobile//lib/component/SvgIcon'
|
||||
import IconDrawPen from '../../../../common/mobile/resources/icons/draw-pen.svg'
|
||||
import IconDrawHighlighter from '../../../../common/mobile/resources/icons/draw-highlighter.svg'
|
||||
import IconClearAll from '../../../../common/mobile/resources/icons/clear-all.svg'
|
||||
import IconClearObject from '../../../../common/mobile/resources/icons/clear-object.svg'
|
||||
import IconScroll from '../../../../common/mobile/resources/icons/scroll.svg'
|
||||
|
||||
export const DrawView = ({currentTool, setTool, showSettings, settings}) => {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Sheet className="draw__sheet">
|
||||
<div className='draw__sheet-item'>
|
||||
Line size
|
||||
</div>
|
||||
<div className='draw__sheet-item'>
|
||||
<Range min={0} max={100} step={1} value={10}/>
|
||||
</div>
|
||||
</Sheet>
|
||||
<div className="draw__buttons">
|
||||
<Button type='button' fill={currentTool === 'pen'} onClick={() => setTool('pen')}>
|
||||
<SvgIcon symbolId={IconDrawPen.id} className='icon icon-svg'/>
|
||||
</Button>
|
||||
<Button type='button' fill={currentTool === 'highlighter'} onClick={() => setTool('highlighter')}>
|
||||
<SvgIcon symbolId={IconDrawHighlighter.id} className='icon icon-svg'/>
|
||||
</Button>
|
||||
<Button type='button' onClick={showSettings}>
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="50%" cy="50%" r="11" fill={`#${settings.color}`}/>
|
||||
</svg>
|
||||
</Button>
|
||||
<div className='draw__divider'/>
|
||||
<Button type='button' disabled={false} fill={currentTool === 'eraser'}
|
||||
onClick={() => setTool('eraser')}>
|
||||
<SvgIcon symbolId={IconClearObject.id} className='icon icon-svg'/>
|
||||
</Button>
|
||||
<Button type='button' disabled={false} onClick={() => setTool('eraseEntireScreen')}>
|
||||
<SvgIcon symbolId={IconClearAll.id} className='icon icon-svg'/>
|
||||
</Button>
|
||||
<div className='draw__divider'/>
|
||||
<Button type='button' fill={currentTool === 'scroll'} onClick={() => setTool('scroll')}>
|
||||
<SvgIcon symbolId={IconScroll.id} className='icon icon-svg'/>
|
||||
</Button>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
4
apps/common/mobile/resources/icons/clear-all.svg
Normal file
4
apps/common/mobile/resources/icons/clear-all.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 2H20V4.45714L21 5.42857V2V1H20H4H3V2V22V23H4H20H21V22V15.1429L20 16.1143V22H4V2Z" fill="currentColor"/>
|
||||
<path d="M18 19H14.4286M14.4286 19L19.1429 14.2857M14.4286 19H13.0036H8.375L6.39203 16.9856C5.62147 16.2028 5.62642 14.945 6.40312 14.1683L12.7143 7.85714M19.1429 14.2857L21.5858 11.8428C22.3668 11.0617 22.3668 9.79541 21.5858 9.01436L17.9856 5.41421C17.2046 4.63316 15.9383 4.63317 15.1572 5.41421L12.7143 7.85714M19.1429 14.2857L12.7143 7.85714" stroke="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 631 B |
3
apps/common/mobile/resources/icons/clear-object.svg
Normal file
3
apps/common/mobile/resources/icons/clear-object.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M21.1429 22H12.5714M12.5714 22H5.14286L1.58533 18.8378C0.725257 18.0732 0.686148 16.7424 1.49985 15.9287L10.2857 7.14286M12.5714 22L18.8571 15.7143M18.8571 15.7143L22.5858 11.9856C23.3668 11.2046 23.3668 9.93826 22.5858 9.15722L16.8428 3.41421C16.0617 2.63316 14.7954 2.63316 14.0144 3.41421L10.2857 7.14286M18.8571 15.7143L10.2857 7.14286" stroke="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 477 B |
7
apps/common/mobile/resources/icons/draw-highlighter.svg
Normal file
7
apps/common/mobile/resources/icons/draw-highlighter.svg
Normal file
@ -0,0 +1,7 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7 14H6V21.5V21.75C6 22 6 22 6.25 22H6.5H7H6.75C7 22 7 22 7 21.75V14Z" fill="currentColor"/>
|
||||
<path d="M18 14H17V21.5V21.75C17 22 17 22 17.25 22H17.5H17.75C18 22 18 22 18 21.75V14Z" fill="currentColor"/>
|
||||
<path d="M15 7.99998H9H8.75C8.5 7.99998 8.4674 8.10429 8.4348 8.20861L7 13H8L9.2 8.99998H14.75L16 13H17L15.755 8.99998L15.5703 8.20861C15.5469 8.13358 15.45 7.99998 15.25 7.99998H15Z" fill="currentColor"/>
|
||||
<path d="M7.19 13H16.745H17.245L17.6 12.9995C17.855 12.9995 18 13.1495 18 13.3995V14H16.995H6.94H6V13.3995C6 13.1495 6.15 13 6.4 13H6.69H7.19Z" fill="currentColor"/>
|
||||
<path d="M9 7.99998H15V2.39189C14.9975 2.21731 14.9628 2.10444 14.9 2.0466C14.8238 1.97646 14.7062 1.98727 14.5544 2.06713L9.64754 4.85429C9.64168 4.85802 9.63591 4.86187 9.63023 4.86584C9.57927 4.90147 9.53532 4.94691 9.5 4.99947C9.45228 5.07048 9.42033 5.15451 9.40822 5.24492L9 7.99998Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1000 B |
6
apps/common/mobile/resources/icons/draw-pen.svg
Normal file
6
apps/common/mobile/resources/icons/draw-pen.svg
Normal file
@ -0,0 +1,6 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.82 5.80825H9.18H8.75C8.5 5.80825 8.4674 5.91382 8.4348 6.01938L6 13.9041H7H17H18L15.8171 6.82024L15.5703 6.01938C15.5469 5.94345 15.45 5.80825 15.25 5.80825H14.82ZM9.18 6.82024L7.5 12.8921H16.5L14.82 6.82024H9.18Z" fill="currentColor"/>
|
||||
<path d="M7 13.9041H6V21.494V21.747C6 22 6 22 6.25 22H6.5H7H6.75C7 22 7 22 7 21.747V13.9041Z" fill="currentColor"/>
|
||||
<path d="M18 13.9041H17V21.494V21.747C17 22 17 22 17.25 22H17.5H17.75C18 22 18 22 18 21.747V13.9041Z" fill="currentColor"/>
|
||||
<path d="M9.18 5.80825H14.82L13.5 3.32813C12.5 1.56585 11.5 1.54875 10.5 3.32813L9.18 5.80825Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 751 B |
3
apps/common/mobile/resources/icons/draw.svg
Normal file
3
apps/common/mobile/resources/icons/draw.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.737 5.62105L22.0002 4.35789C22.0002 4.35789 21.8318 3.34737 21.2423 2.75789C20.6528 2.08421 19.6423 2 19.6423 2L18.3791 3.26316L20.737 5.62105ZM19.7263 5.62108L8.61053 16.6527L7.34737 15.3895L18.4632 4.35792L17.8737 3.76845L6.42105 15.2211L6 18L8.77895 17.579L14.5053 11.8527L20.2316 6.12634L19.7263 5.62108ZM13.4801 7.10498C13.7534 6.68633 13.7532 6.68617 13.7529 6.686L13.7523 6.68561L13.7508 6.68462L13.7466 6.68189L13.7332 6.67345C13.7222 6.66654 13.707 6.6571 13.6876 6.64542C13.6488 6.62206 13.5934 6.58971 13.5223 6.55067C13.3801 6.47261 13.1745 6.36757 12.9125 6.25401C12.3888 6.02712 11.636 5.76465 10.7096 5.61688C8.84758 5.3199 6.30186 5.49026 3.53986 7.30505C0.618665 9.22443 0.000158966 12.2988 0.854419 15.2145C1.7018 18.1067 3.99969 20.8956 6.99949 22.4443L7.45822 21.5557C4.6876 20.1254 2.5803 17.5485 1.81408 14.9333C1.05473 12.3416 1.61422 9.76684 4.08899 8.14078C6.61649 6.48008 8.9036 6.34147 10.5521 6.6044C11.3808 6.73658 12.0526 6.97128 12.5148 7.17157C12.7457 7.2716 12.9234 7.36266 13.0411 7.4273C13.1 7.4596 13.1438 7.48526 13.1717 7.50206C13.1856 7.51046 13.1956 7.51664 13.2015 7.52033L13.2071 7.52389C13.2069 7.52377 13.2067 7.52363 13.4801 7.10498ZM19.1353 20.4311C20.7445 18.6887 20.7121 16.4688 20.147 14.5823C19.5829 12.6991 18.4598 11.0314 17.6862 10.2326L16.9678 10.9283C17.6368 11.619 18.6736 13.1485 19.189 14.8693C19.7035 16.5868 19.6702 18.3779 18.4006 19.7527C17.0172 21.2507 14.7032 21.3649 12.5461 20.8504C11.4861 20.5975 10.5138 20.2025 9.79385 19.7968C9.43322 19.5936 9.14757 19.3943 8.94872 19.2175C8.84948 19.1293 8.77888 19.0529 8.73234 18.9909C8.68391 18.9264 8.67427 18.8944 8.67428 18.8944L7.70686 19.1476C7.78962 19.4639 8.03374 19.7421 8.28433 19.9649C8.55196 20.2028 8.90143 20.4418 9.30292 20.668C10.1072 21.1213 11.1671 21.5495 12.3141 21.8231C14.5712 22.3615 17.3707 22.3418 19.1353 20.4311Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
4
apps/common/mobile/resources/icons/scroll.svg
Normal file
4
apps/common/mobile/resources/icons/scroll.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.3131 22.5C10.2175 22.5087 8.01189 20.812 6.84764 17.5345L5.15461 12.7863C5.04986 12.5004 5.00123 12.1658 5.00026 11.9178C4.98411 10.9611 5.71509 10.406 6.54563 10.4022C7.14956 10.4048 7.6768 10.7657 7.97915 11.4901L8.7828 13.4574C8.8051 13.5051 8.82797 13.5234 8.86564 13.5272C8.91504 13.5255 8.93599 13.4935 8.93407 13.4433L8.87828 5.30155C8.87059 4.20929 9.5785 3.49716 10.5628 3.50001C11.5298 3.49655 12.2595 4.19874 12.2672 5.291L12.2914 8.50878C12.5222 8.4346 12.7729 8.38746 12.9964 8.38985C13.7776 8.38785 14.3525 8.83546 14.5653 9.53711C14.843 9.44044 15.114 9.39084 15.39 9.38267C16.1422 9.37998 16.6886 9.79739 16.8878 10.4544C18.531 10.4701 19.4744 11.6762 19.4848 13.8193L19.4998 15.7263C19.5286 20.0452 16.978 22.4813 13.3131 22.5ZM13.3413 21.5001C16.5067 21.4871 18.5706 19.4379 18.5375 15.6325L18.5327 13.9471C18.5206 12.3382 17.992 11.4519 17.054 11.456L17.055 12.5954C17.0635 12.9055 16.8451 13.0833 16.6012 13.0833C16.3542 13.0922 16.1341 12.9128 16.1287 12.5939L16.1232 11.2449C16.1112 10.6661 15.8014 10.3252 15.2845 10.3247C15.0783 10.3286 14.8449 10.382 14.6518 10.4601L14.6691 12.2491C14.6689 12.5561 14.4505 12.7339 14.2153 12.7371C13.9596 12.7428 13.7395 12.5634 13.7428 12.2477L13.7209 10.2489C13.7176 9.6733 13.4108 9.32359 12.8823 9.32867C12.6877 9.32697 12.4513 9.38921 12.2582 9.46724L12.2745 11.8997C12.278 12.1684 12.0936 12.3883 11.8207 12.3877C11.5564 12.3902 11.3486 12.1757 11.3452 11.907L11.3013 5.23546C11.2932 4.75712 11.0149 4.4376 10.5765 4.43598C10.135 4.44315 9.8353 4.76951 9.83472 5.2447L9.90648 14.6501C9.91321 15.0487 9.65545 15.3111 9.30409 15.3116C9.01078 15.3135 8.75494 15.1804 8.58272 14.7808L7.3437 11.9118C7.19128 11.5392 6.96312 11.3272 6.64078 11.3283C6.2283 11.3362 5.94652 11.6393 5.95382 12.0085C5.95037 12.1855 5.98266 12.3161 6.03782 12.465L7.73085 17.2132C8.79341 20.196 10.7626 21.5093 13.3413 21.5001Z" fill="currentColor"/>
|
||||
<path d="M4.64523 7.22755C4.49571 7.08397 4.25857 7.08587 4.11189 7.23231C3.96521 7.37874 3.96236 7.61551 4.10617 7.7648L5.23002 8.8878C5.30145 8.96006 5.39764 9 5.49861 9C5.59956 9 5.69671 8.96006 5.76815 8.88875L6.89295 7.7667C7.03676 7.61836 7.03485 7.3816 6.88818 7.23516C6.74151 7.08777 6.50437 7.08587 6.35484 7.22945L5.88054 7.70204V3.29677L6.35484 3.76936C6.50436 3.91199 6.7415 3.91104 6.88818 3.76365C7.03485 3.61722 7.03676 3.38045 6.89295 3.23211C5.19098 1.59468 5.81006 1.58329 4.10514 3.23401C3.96133 3.3833 3.96514 3.62006 4.11181 3.7665C4.25848 3.91294 4.49563 3.91484 4.64516 3.77126L5.11946 3.29772V7.70202L4.64523 7.22755Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
@ -30,6 +30,7 @@
|
||||
"textEmptyImgUrl": "You need to specify image URL.",
|
||||
"textEvenPage": "Even Page",
|
||||
"textFootnote": "Footnote",
|
||||
"textDrawing": "Drawing",
|
||||
"textFormat": "Format",
|
||||
"textImage": "Image",
|
||||
"textImageURL": "Image URL",
|
||||
|
||||
@ -179,4 +179,46 @@
|
||||
resize: none;
|
||||
}
|
||||
}
|
||||
|
||||
.draw__sheet-item {
|
||||
padding-inline: 16px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
#drawbar.navbar {
|
||||
top: unset;
|
||||
bottom: 0;
|
||||
height: calc(44px + var(--f7-safe-area-bottom));
|
||||
|
||||
.navbar-inner {
|
||||
background-color: #fff; /* move to app.less vars */
|
||||
border-top: 1px solid rgba(0, 0, 0, .1); /* move to app.less vars */
|
||||
}
|
||||
|
||||
.draw__buttons {
|
||||
padding-inline: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
|
||||
button {
|
||||
display: flex;
|
||||
padding: 0;
|
||||
width: 36px;
|
||||
min-width: 36px;
|
||||
border-radius: 7px;
|
||||
&.button-fill {
|
||||
color: var(--brand-word);
|
||||
background-color: #E5F0FF; /* move to app.less vars */
|
||||
}
|
||||
}
|
||||
|
||||
.draw__divider {
|
||||
width: 1px;
|
||||
height: 24px;
|
||||
background-color: rgba(0, 0, 0, .1); /* move to app.less vars */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -17,6 +17,7 @@ import Snackbar from '../components/Snackbar/Snackbar';
|
||||
import { Themes } from '../../../../common/mobile/lib/controller/Themes';
|
||||
import EditView from '../view/edit/Edit';
|
||||
import VersionHistoryController from '../../../../common/mobile/lib/controller/VersionHistory';
|
||||
import {DrawController} from "../../../../common/mobile/lib/controller/Draw";
|
||||
|
||||
export const MainContext = createContext();
|
||||
|
||||
@ -33,7 +34,8 @@ const MainPage = inject('storeDocumentInfo', 'users', 'storeAppOptions', 'storeV
|
||||
editLinkSettingsVisible: false,
|
||||
snackbarVisible: false,
|
||||
fabVisible: true,
|
||||
isOpenModal: false
|
||||
isOpenModal: false,
|
||||
isDrawing: false
|
||||
});
|
||||
const appOptions = props.storeAppOptions;
|
||||
const storeThemes = props.storeThemes;
|
||||
@ -45,15 +47,9 @@ const MainPage = inject('storeDocumentInfo', 'users', 'storeAppOptions', 'storeV
|
||||
const docExt = dataDoc?.fileType || '';
|
||||
const isAvailableExt = docExt && docExt !== 'djvu' && docExt !== 'pdf' && docExt !== 'xps';
|
||||
const storeToolbarSettings = props.storeToolbarSettings;
|
||||
const isDisconnected = props.users.isDisconnected;
|
||||
const isViewer = appOptions.isViewer;
|
||||
const isEdit = appOptions.isEdit;
|
||||
const isMobileView = appOptions.isMobileView;
|
||||
const disabledControls = storeToolbarSettings.disabledControls;
|
||||
const disabledSettings = storeToolbarSettings.disabledSettings;
|
||||
const isProtected = appOptions.isProtected;
|
||||
const typeProtection = appOptions.typeProtection;
|
||||
const isFabShow = isViewer && !disabledSettings && !disabledControls && !isDisconnected && isAvailableExt && isEdit && (!isProtected || typeProtection === Asc.c_oAscEDocProtect.TrackedChanges);
|
||||
const isFabShow = appOptions.isViewer && !storeToolbarSettings.disabledSettings && !storeToolbarSettings.disabledControls &&
|
||||
!props.users.isDisconnected && isAvailableExt && appOptions.isEdit &&
|
||||
(!appOptions.isProtected || appOptions.typeProtection === Asc.c_oAscEDocProtect.TrackedChanges);
|
||||
const config = appOptions.config;
|
||||
const { customization = {} } = config;
|
||||
const isShowPlaceholder = !appOptions.isDocReady && (!customization || !(customization.loaderName || customization.loaderLogo));
|
||||
@ -254,6 +250,10 @@ const MainPage = inject('storeDocumentInfo', 'users', 'storeAppOptions', 'storeV
|
||||
api.asc_addRestriction(Asc.c_oAscRestrictionType.None);
|
||||
};
|
||||
|
||||
const setDrawing = value => {
|
||||
setState(prevState =>( { ...prevState, isDrawing: value }))
|
||||
}
|
||||
|
||||
return (
|
||||
<Themes fileType={docExt}>
|
||||
<MainContext.Provider value={{
|
||||
@ -261,7 +261,7 @@ const MainPage = inject('storeDocumentInfo', 'users', 'storeAppOptions', 'storeV
|
||||
closeOptions: handleOptionsViewClosed,
|
||||
showPanels: state.addShowOptions,
|
||||
isBranding,
|
||||
isViewer,
|
||||
isViewer: appOptions.isViewer,
|
||||
}}>
|
||||
<Page name="home" className={`editor${!isHideLogo ? ' page-with-logo' : ''}`}>
|
||||
<Navbar id='editor-navbar' className={`main-navbar${!isHideLogo ? ' navbar-with-logo' : ''}`}>
|
||||
@ -288,6 +288,9 @@ const MainPage = inject('storeDocumentInfo', 'users', 'storeAppOptions', 'storeV
|
||||
}
|
||||
</Navbar>
|
||||
<View id="editor_sdk"></View>
|
||||
<Navbar id='drawbar' style={{ display: !state.isDrawing && 'none' }}>
|
||||
<DrawController isDrawing={state.isDrawing} setDrawing={setDrawing}/>
|
||||
</Navbar>
|
||||
{isShowPlaceholder ?
|
||||
<div className="doc-placeholder-container">
|
||||
<div className="doc-placeholder">
|
||||
@ -317,7 +320,7 @@ const MainPage = inject('storeDocumentInfo', 'users', 'storeAppOptions', 'storeV
|
||||
<Snackbar
|
||||
isShowSnackbar={state.snackbarVisible}
|
||||
closeCallback={() => handleOptionsViewClosed('snackbar')}
|
||||
message={isMobileView ? t("Toolbar.textSwitchedMobileView") : t("Toolbar.textSwitchedStandardView")}
|
||||
message={appOptions.isMobileView ? t("Toolbar.textSwitchedMobileView") : t("Toolbar.textSwitchedStandardView")}
|
||||
/>
|
||||
<SearchSettings useSuspense={false} />
|
||||
{!state.editOptionsVisible ? null : <EditView />}
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
import React, {useState} from 'react';
|
||||
import React, {useState, useEffect} from 'react';
|
||||
import {observer, inject} from "mobx-react";
|
||||
import {List, ListItem, Page, Navbar, Icon, ListButton, ListInput, BlockTitle, Segmented, Button} from 'framework7-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {Device} from "../../../../../common/mobile/utils/device";
|
||||
import SvgIcon from '../../../../../common/mobile//lib/component/SvgIcon'
|
||||
import IconDraw from '../../../../../common/mobile/resources/icons/draw.svg'
|
||||
|
||||
const PageNumber = props => {
|
||||
const { t } = useTranslation();
|
||||
@ -154,32 +156,17 @@ const AddOther = props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('Add', {returnObjects: true});
|
||||
const storeFocusObjects = props.storeFocusObjects;
|
||||
const storeLinkSettings = props.storeLinkSettings;
|
||||
const canAddLink = storeLinkSettings.canAddLink;
|
||||
|
||||
let isShape = storeFocusObjects.settings.indexOf('shape') > -1,
|
||||
const isShape = storeFocusObjects.settings.indexOf('shape') > -1,
|
||||
isText = storeFocusObjects.settings.indexOf('text') > -1,
|
||||
isChart = storeFocusObjects.settings.indexOf('chart') > -1,
|
||||
isHyperLink = storeFocusObjects.settings.indexOf('hyperlink') > -1,
|
||||
isHeader = storeFocusObjects.settings.indexOf('header') > -1;
|
||||
|
||||
let disabledAddLink = false,
|
||||
disabledAddBreak = false,
|
||||
disabledAddFootnote = false,
|
||||
disabledAddPageNumber = false,
|
||||
inFootnote = props.inFootnote,
|
||||
inControl = props.inControl,
|
||||
paragraphLocked = props.paragraphLocked,
|
||||
controlPlain = props.controlPlain,
|
||||
richDelLock = props.richDelLock,
|
||||
richEditLock = props.richEditLock,
|
||||
plainDelLock = props.plainDelLock,
|
||||
plainEditLock = props.plainEditLock;
|
||||
|
||||
disabledAddBreak = paragraphLocked || inFootnote || inControl || richEditLock || plainEditLock || richDelLock || plainDelLock;
|
||||
disabledAddFootnote = paragraphLocked || controlPlain || richEditLock || plainEditLock;
|
||||
disabledAddLink = paragraphLocked || !canAddLink;
|
||||
disabledAddPageNumber = controlPlain;
|
||||
const disabledAddBreak = props.paragraphLocked || props.inFootnote || props.inControl || props.richEditLock || props.plainEditLock || props.richDelLock || props.plainDelLock;
|
||||
const disabledAddFootnote = props.paragraphLocked || props.controlPlain || props.richEditLock || props.plainEditLock;
|
||||
const disabledAddLink = props.paragraphLocked || !props.storeLinkSettings.canAddLink;
|
||||
const disabledAddPageNumber = props.controlPlain;
|
||||
|
||||
return (
|
||||
<List>
|
||||
@ -229,14 +216,22 @@ const AddOther = props => {
|
||||
<Icon slot="media" icon="icon-footnote"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
<ListItem key='drawing' title={_t.textDrawing} onClick={() => {
|
||||
props.closeModal();
|
||||
Common.Notifications.trigger('draw:start');
|
||||
}}>
|
||||
<SvgIcon slot='media' symbolId={IconDraw.id} className='icon icon-svg'/>
|
||||
</ListItem>
|
||||
</List>
|
||||
)
|
||||
};
|
||||
|
||||
const AddOtherContainer = inject("storeComments","storeFocusObjects", "storeLinkSettings")(observer(AddOther));
|
||||
|
||||
export {AddOtherContainer as AddOther,
|
||||
PageNumber as PageAddNumber,
|
||||
PageBreak as PageAddBreak,
|
||||
PageSectionBreak as PageAddSectionBreak,
|
||||
PageFootnote as PageAddFootnote};
|
||||
export {
|
||||
AddOtherContainer as AddOther,
|
||||
PageNumber as PageAddNumber,
|
||||
PageBreak as PageAddBreak,
|
||||
PageSectionBreak as PageAddSectionBreak,
|
||||
PageFootnote as PageAddFootnote,
|
||||
};
|
||||
5326
vendor/framework7-react/npm-shrinkwrap.json
generated
vendored
5326
vendor/framework7-react/npm-shrinkwrap.json
generated
vendored
File diff suppressed because it is too large
Load Diff
1
vendor/framework7-react/package.json
vendored
1
vendor/framework7-react/package.json
vendored
@ -78,6 +78,7 @@
|
||||
"postcss-loader": "^7.3.4",
|
||||
"postcss-preset-env": "^9.4.0",
|
||||
"style-loader": "^3.3.3",
|
||||
"svg-sprite-loader": "^6.0.11",
|
||||
"terser-webpack-plugin": "^5.3.10",
|
||||
"url-loader": "^4.1.1",
|
||||
"webpack": "^5.90.1",
|
||||
|
||||
Reference in New Issue
Block a user