diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index f64b62ab6..ca9561255 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -292,7 +292,13 @@ "textPageBreakBefore": "Page Break Before", "textPageNumbering": "Page Numbering", "textParagraph": "Paragraph", - "textParagraphStyles": "Paragraph Styles", + "textCreateTextStyle": "Create new text style", + "textDone": "Done", + "textTitle": "Title", + "textEnterTitleNewStyle": "Enter title of a new style", + "textNextParagraphStyle": "Next paragraph style", + "textSameCreatedNewStyle": "Same as created new style", + "textParagraphStyle": "Paragraph Style", "textPictureFromLibrary": "Picture from Library", "textPictureFromURL": "Picture from URL", "textPt": "pt", diff --git a/apps/documenteditor/mobile/src/view/edit/Edit.jsx b/apps/documenteditor/mobile/src/view/edit/Edit.jsx index 8cce09c6d..c568acec3 100644 --- a/apps/documenteditor/mobile/src/view/edit/Edit.jsx +++ b/apps/documenteditor/mobile/src/view/edit/Edit.jsx @@ -16,7 +16,7 @@ import EditHeaderController from "../../controller/edit/EditHeader"; import EditTableContentsController from "../../controller/edit/EditTableContents"; import {PageTextFonts, PageTextAddFormatting, PageTextBulletsAndNumbers, PageTextLineSpacing, PageTextFontColor, PageTextCustomFontColor, PageTextHighlightColor} from "./EditText"; -import {ParagraphAdvSettings, PageParagraphBackColor, PageParagraphCustomColor} from "./EditParagraph"; +import {ParagraphAdvSettings, PageParagraphBackColor, PageParagraphCustomColor, PageParagraphStyle, PageCreateTextStyle, PageChangeNextParagraphStyle} from "./EditParagraph"; import {PageShapeStyleNoFill, PageShapeStyle, PageShapeCustomFillColor, PageShapeBorderColor, PageShapeCustomBorderColor, PageWrap, PageReorder, PageReplace} from "./EditShape"; import {PageImageReorder, PageImageReplace, PageImageWrap, PageLinkSettings} from "./EditImage"; import {PageTableOptions, PageTableWrap, PageTableStyle, PageTableStyleOptions, PageTableCustomFillColor, PageTableBorderColor, PageTableCustomBorderColor} from "./EditTable"; @@ -66,6 +66,18 @@ const routes = [ path: '/edit-paragraph-custom-color/', component: PageParagraphCustomColor, }, + { + path: '/edit-paragraph-style/', + component: PageParagraphStyle + }, + { + path: '/create-text-style/', + component: PageCreateTextStyle + }, + { + path: '/change-next-paragraph-style/', + component: PageChangeNextParagraphStyle + }, //Edit shape { path: '/edit-shape-style/', diff --git a/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx b/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx index e3662f2bd..ce5fb3e0f 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx @@ -1,6 +1,6 @@ import React, {Fragment, useState} from 'react'; import {observer, inject} from "mobx-react"; -import {f7, List, ListItem, Icon, Button, Page, Navbar, NavRight, Segmented, BlockTitle, Toggle, Link} from 'framework7-react'; +import {f7, List, ListItem, Icon, Button, Page, Navbar, NavRight, Segmented, BlockTitle, Toggle, Link, NavLeft, NavTitle, ListInput} from 'framework7-react'; import { useTranslation } from 'react-i18next'; import {Device} from '../../../../../common/mobile/utils/device'; import { ThemeColorPalette, CustomColorPicker } from '../../../../../common/mobile/lib/component/ThemeColorPalette.jsx'; @@ -191,6 +191,7 @@ const EditParagraph = props => { const storeParagraphSettings = props.storeParagraphSettings; const paragraphStyles = storeParagraphSettings.paragraphStyles; const curStyleName = storeParagraphSettings.styleName; + const curStyle = paragraphStyles.find(style => style.name === curStyleName); const thumbSize = storeParagraphSettings.styleThumbSize; const paragraph = props.storeFocusObjects.paragraphObject; @@ -200,6 +201,14 @@ const EditParagraph = props => { return ( + {t('Edit.textParagraphStyle')} + + +
+
+
{ onKeepNext: props.onKeepNext }}> - {_t.textParagraphStyles} +
+ ) +}; + +const EditParagraphStyle = props => { + const { t } = useTranslation(); + const _t = t('Edit', {returnObjects: true}); + const storeParagraphSettings = props.storeParagraphSettings; + const paragraphStyles = storeParagraphSettings.paragraphStyles; + const curStyleName = storeParagraphSettings.styleName; + const thumbSize = storeParagraphSettings.styleThumbSize; + const activeStyle = Device.android ? 'link no-active-state' : 'no-active-state'; + + return ( + + + {Device.phone && + + + + + + } + + + + {paragraphStyles.map((style, index) => ( { }} >
))}
- +
) -}; +} + +const CreateTextStyle = () => { + const { t } = useTranslation(); + const _t = t('Edit', {returnObjects: true}); + const [titleNewStyle, setTitle] = useState(''); + const [nextParagraphStyle, setParagraph] = useState('Same'); + + return ( + + + {t('Edit.textCreateTextStyle')} + + { + if(titleNewStyle.trim()) { + // console.log(titleNewStyle); + } + }}>{t('Edit.textDone')} + + + + { + setTitle(event.target.value) + }} + > + + {t('Edit.textNextParagraphStyle')} + + + + + ) +} + +const ChangeNextParagraphStyle = props => { + const { t } = useTranslation(); + const _t = t('Edit', {returnObjects: true}); + const nextParagraphStyle = props.nextParagraphStyle; + const storeParagraphSettings = props.storeParagraphSettings; + const paragraphStyles = storeParagraphSettings.paragraphStyles; + // const curStyleName = storeParagraphSettings.styleName; + const thumbSize = storeParagraphSettings.styleThumbSize; + const activeStyle = Device.android ? 'link no-active-state' : 'no-active-state'; + const [newParagraph, setParagraph] = useState(nextParagraphStyle); + + return ( + + + + { + if(nextParagraphStyle !== 'Same') { + setParagraph('Same'); + props.setParagraph('Same'); + } + }} title={t('Edit.textSameCreatedNewStyle')}> + {paragraphStyles.map((style, index) => ( + { + if(nextParagraphStyle !== style.name) { + setParagraph(style.name); + props.setParagraph(style.name); + } + }} + > +
+
+ ))} +
+
+ ) + +} const EditParagraphContainer = inject("storeParagraphSettings", "storeFocusObjects")(observer(EditParagraph)); const ParagraphAdvSettings = inject("storeParagraphSettings", "storeFocusObjects")(observer(PageAdvancedSettings)); const PageParagraphBackColor = inject("storeParagraphSettings", "storePalette")(observer(PageBackgroundColor)); const PageParagraphCustomColor = inject("storeParagraphSettings", "storePalette")(observer(PageCustomBackColor)); +const PageParagraphStyle = inject("storeParagraphSettings")(observer(EditParagraphStyle)); +const PageCreateTextStyle = inject("storeParagraphSettings")(observer(CreateTextStyle)); +const PageChangeNextParagraphStyle = inject("storeParagraphSettings")(observer(ChangeNextParagraphStyle)); -export {EditParagraphContainer as EditParagraph, +export { + EditParagraphContainer as EditParagraph, ParagraphAdvSettings, PageParagraphBackColor, - PageParagraphCustomColor}; \ No newline at end of file + PageParagraphCustomColor, + PageParagraphStyle, + PageCreateTextStyle, + PageChangeNextParagraphStyle +}; \ No newline at end of file