diff --git a/apps/mobile/android/releasenotes/whatsnew-en-US b/apps/mobile/android/releasenotes/whatsnew-en-US index 4172b4156..991ab94c4 100644 --- a/apps/mobile/android/releasenotes/whatsnew-en-US +++ b/apps/mobile/android/releasenotes/whatsnew-en-US @@ -1,7 +1,9 @@ -- Added issue reporting from within the app. Click on "Report an issue" in settings. -- Fixed undo manager not updated on cut. -- Fixed note is not saved when content is directly pasted -- Fixed editor is empty sometimes when note is opened -- Other minor performance improvements +- Add new header for notebook screen & topic +- Ensure that products are loaded before showing pricing +- Show notebook & topic on note items +- Fixed sorting on items in groups +- Fixed editor losing focus in checklists +- Fixed cursor jump to end of paragraph on removing new line +- Minor bug fixes and performance improvements. Thank you for using Notesnook! \ No newline at end of file diff --git a/apps/mobile/html/Web.bundle/site/constants.js b/apps/mobile/html/Web.bundle/site/constants.js index 1e41732cf..c292f6511 100755 --- a/apps/mobile/html/Web.bundle/site/constants.js +++ b/apps/mobile/html/Web.bundle/site/constants.js @@ -224,8 +224,16 @@ function setTheme() { .tox .tox-toolbar__primary { background: none !important; border-bottom: 1px solid ${pageTheme.colors.nav} !important; - }`; + } + + ::selection { + color: white !important; + background: ${pageTheme.colors.accent} !important; + } + + + `; let node2 = ` .mce-content-body table[data-mce-selected], { @@ -254,6 +262,24 @@ function setTheme() { opacity:0.5; } +.mce-content-body a { + color: ${pageTheme.colors.accent} !important; +} + +.mce-content-body [data-mce-selected="inline-boundary"] { + background-color: ${pageTheme.colors.shade} !important; +} + +::selection { + color: white !important; + background: ${pageTheme.colors.accent} !important; +} + + +.mce-content-body a[data-mce-selected] { + box-shadow: none !important; +} + span.attachment { overflow: hidden; position: relative; diff --git a/apps/mobile/html/Web.bundle/site/index.css b/apps/mobile/html/Web.bundle/site/index.css index e3be60f8f..a63a1ea07 100644 --- a/apps/mobile/html/Web.bundle/site/index.css +++ b/apps/mobile/html/Web.bundle/site/index.css @@ -4,70 +4,75 @@ body { font-family:"Open Sans"; } -#formBox textarea { - font-family: "Open Sans"; - font-weight: 600 !important; - background-color: transparent; - border: none; - width: 100%; - outline: none; - resize: none; - font-size: 32px; - } - - #formBox { - margin-block-end: 0px; - position: relative; - } - - #titlebar { - background-color: transparent; - padding-left: 0px; - padding-right: 12px; - min-height: 45px; - display: flex; - flex-direction: column; - justify-content: flex-end; - } - #formBox > div, - #formBox > textarea { - word-wrap: break-word; /* make sure the div and the textarea wrap words in the same way */ - box-sizing: border-box; - width: 100%; - } - - #formBox > textarea { - overflow: hidden; - position: absolute; - height: 100%; +.app-main { + overflow: visible; +} - padding-top: 4px; - padding-bottom: 5px; - } - - #textCopy { - font-family: "Open Sans"; - font-weight: 600 !important; - font-size: 32px; - padding-top: 4px; - padding-bottom: 5px; - padding-right: 0.5em; - padding-left: 0.5em; - } - - #formBox > div { - min-height: 45px; - } - - .info-bar { - font-family: "Open Sans"; - color: gray; - font-size: 11px; - height: 15px; - display: flex; - padding-left: 14px !important; - justify-content: space-between; - } +#formBox input { + font-family: 'Open Sans'; + font-weight: 600 !important; + background-color: transparent; + border: none; + width: 100%; + outline: none; + resize: none; + font-size: 25px; + height: 45x; + padding-top:0px; + padding-bottom:0px; +} + +#formBox { + margin-block-end: 0px; + position: relative; +} + +#titlebar { + background-color: transparent; + padding-left: 0px; + padding-right: 12px; + display: flex; + flex-direction: column; + justify-content: flex-end; +} +#formBox > div, +#formBox > input { + word-wrap: break-word; /* make sure the div and the textarea wrap words in the same way */ + box-sizing: border-box; + width: 100%; +} + +#titlebar input:focus { + outline: none; +} + +.info-bar { + font-family: 'Open Sans'; + color: gray; + font-size: 11.5px; + height: 13px; + display: flex; + padding-left: 14px !important; + justify-content: space-between; + margin-top: 0px; +} + +.info-bar a { + text-decoration: none; + color: gray; +} + +#infowords, +#infodate, +#infosaved { + font-family: 'Open Sans'; + margin-right: 5px; + margin-left: 0px; + border-radius: 5px; + margin-top: 0; + height: 16px; + padding-top: 2.5px; +} .info-bar a { text-decoration: none; diff --git a/apps/mobile/html/Web.bundle/site/init.js b/apps/mobile/html/Web.bundle/site/init.js index a81e7c7a6..7b3f184e9 100755 --- a/apps/mobile/html/Web.bundle/site/init.js +++ b/apps/mobile/html/Web.bundle/site/init.js @@ -136,6 +136,7 @@ function init_tiny(size) { 'media imagetools table paste wordcount autoresize directionality blockescape contenthandler' ], toolbar: false, + keep_styles:false, paste_data_images: true, statusbar: false, textpattern_patterns: markdownPatterns, @@ -263,6 +264,104 @@ function init_tiny(size) { console.error(e); } }, + init_instance_callback: function (_editor) { + editor = _editor; + setTheme(); + + editor.on('SelectionChange', function (e) { + selectchange(); + }); + + editor.on('ClearUndos', onUndoChange); + editor.on('Undo', onUndoChange); + editor.on('Redo', onUndoChange); + editor.on('TypingUndos', onUndoChange); + editor.on('BeforeAddUndo', onUndoChange); + editor.on('AddUndo', onUndoChange); + editor.on('cut', function () { + onChange({type: 'cut'}); + onUndoChange(); + }); + editor.on('copy', onUndoChange); + editor.on('paste', function () { + onChange({type: 'paste'}); + }); + + editor.on('focus', function () { + reactNativeEventHandler('focus', 'editor'); + }); + + editor.on('SetContent', function (event) { + if (globalThis.isClearingNoteData) { + globalThis.isClearingNoteData = false; + return; + } + setTimeout(function () { + editor.undoManager.transact(function () {}); + }, 1000); + if (!event.paste) { + reactNativeEventHandler('noteLoaded', true); + } + }); + + editor.on('NewBlock', function (e) { + console.log('New Block'); + const {newBlock} = e; + let target; + if (newBlock) { + target = newBlock.previousElementSibling; + } + if (target && target.classList.contains(COLLAPSED_KEY)) { + target.classList.remove(COLLAPSED_KEY); + collapseElement(target); + } + }); + + editor.on('touchstart mousedown', function (e) { + const {target} = e; + if ( + e.offsetX < 6 && + collapsibleTags[target.tagName] && + target.parentElement && + target.parentElement.tagName === 'BODY' + ) { + e.preventDefault(); + e.stopImmediatePropagation(); + e.stopPropagation(); + editor.undoManager.transact(function () { + if (target.classList.contains(COLLAPSED_KEY)) { + target.classList.remove(COLLAPSED_KEY); + } else { + target.classList.add(COLLAPSED_KEY); + } + collapseElement(target); + editor.getHTML().then(function (html) { + reactNativeEventHandler('tiny', html); + }); + }); + } + }); + + editor.on('tap', function (e) { + if ( + e.target.classList.contains('mce-content-body') && + !e.target.innerText.length > 0 + ) { + e.preventDefault(); + } + }); + editor.on('ScrollIntoView', function (e) { + e.preventDefault(); + e.elm.scrollIntoView({ + behavior: 'smooth', + block: 'nearest' + }); + }); + editor.on('input', onChange); + editor.on('keyup', onChange); + editor.on('NodeChange', onChange); + editor.on('compositionend', onChange); + }, setup: function (_editor) { editor = _editor; editor.ui.registry.addButton('deleteimage', { diff --git a/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj b/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj index 40dce2b16..0304faa66 100644 --- a/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj +++ b/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj @@ -1118,7 +1118,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1670; + CURRENT_PROJECT_VERSION = 1680; DEVELOPMENT_TEAM = 53CWBG3QUC; ENABLE_BITCODE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1191,7 +1191,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.6.70; + MARKETING_VERSION = 1.6.80; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1219,7 +1219,7 @@ CODE_SIGN_ENTITLEMENTS = Notesnook/Notesnook.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1670; + CURRENT_PROJECT_VERSION = 1680; DEVELOPMENT_TEAM = 53CWBG3QUC; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; HEADER_SEARCH_PATHS = ( @@ -1291,7 +1291,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.6.70; + MARKETING_VERSION = 1.6.80; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "$(inherited)", @@ -1449,7 +1449,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1670; + CURRENT_PROJECT_VERSION = 1680; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 53CWBG3QUC; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -1460,7 +1460,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.6.70; + MARKETING_VERSION = 1.6.80; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.notewidget; @@ -1490,7 +1490,7 @@ CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1670; + CURRENT_PROJECT_VERSION = 1680; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 53CWBG3QUC; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -1501,7 +1501,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.6.70; + MARKETING_VERSION = 1.6.80; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.notewidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1530,7 +1530,7 @@ CODE_SIGN_ENTITLEMENTS = "Make Note/Make Note.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1670; + CURRENT_PROJECT_VERSION = 1680; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 53CWBG3QUC; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -1603,7 +1603,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.6.70; + MARKETING_VERSION = 1.6.80; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.share; @@ -1633,7 +1633,7 @@ CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1670; + CURRENT_PROJECT_VERSION = 1680; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 53CWBG3QUC; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -1706,7 +1706,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.6.70; + MARKETING_VERSION = 1.6.80; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.share; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/apps/mobile/release_notes.txt b/apps/mobile/release_notes.txt index 4172b4156..991ab94c4 100644 --- a/apps/mobile/release_notes.txt +++ b/apps/mobile/release_notes.txt @@ -1,7 +1,9 @@ -- Added issue reporting from within the app. Click on "Report an issue" in settings. -- Fixed undo manager not updated on cut. -- Fixed note is not saved when content is directly pasted -- Fixed editor is empty sometimes when note is opened -- Other minor performance improvements +- Add new header for notebook screen & topic +- Ensure that products are loaded before showing pricing +- Show notebook & topic on note items +- Fixed sorting on items in groups +- Fixed editor losing focus in checklists +- Fixed cursor jump to end of paragraph on removing new line +- Minor bug fixes and performance improvements. Thank you for using Notesnook! \ No newline at end of file diff --git a/apps/mobile/src/components/Github/issue.js b/apps/mobile/src/components/Github/issue.js index 3763d3456..dca7c5c14 100644 --- a/apps/mobile/src/components/Github/issue.js +++ b/apps/mobile/src/components/Github/issue.js @@ -1,17 +1,19 @@ -import React, {useRef, useState} from 'react'; -import {Linking, Platform, Text, TextInput, View} from 'react-native'; -import deviceInfoModule from 'react-native-device-info'; -import {useTracked} from '../../provider'; -import {eSendEvent, ToastEvent} from '../../services/EventManager'; -import {APP_VERSION} from '../../utils'; -import {db} from '../../utils/database'; -import {eCloseProgressDialog} from '../../utils/Events'; -import {openLinkInBrowser} from '../../utils/functions'; -import {SIZE} from '../../utils/SizeUtils'; -import {sleep} from '../../utils/TimeUtils'; -import {Button} from '../Button'; +import Clipboard from '@react-native-clipboard/clipboard'; +import React, { useRef, useState } from 'react'; +import { Linking, Platform, Text, TextInput, View } from 'react-native'; +import { useTracked } from '../../provider'; +import { useUserStore } from '../../provider/stores'; +import { eSendEvent, ToastEvent } from '../../services/EventManager'; +import PremiumService from '../../services/PremiumService'; +import { APP_VERSION } from '../../utils'; +import { db } from '../../utils/database'; +import { eCloseProgressDialog } from '../../utils/Events'; +import { openLinkInBrowser } from '../../utils/functions'; +import { SIZE } from '../../utils/SizeUtils'; +import { sleep } from '../../utils/TimeUtils'; +import { Button } from '../Button'; import DialogHeader from '../Dialog/dialog-header'; -import {presentDialog} from '../Dialog/functions'; +import { presentDialog } from '../Dialog/functions'; import Seperator from '../Seperator'; import Paragraph from '../Typography/Paragraph'; @@ -20,6 +22,7 @@ export const Issue = () => { const colors = state.colors; const body = useRef(null); const title = useRef(null); + const user = useUserStore(state => state.user); const [loading, setLoading] = useState(false); const onPress = async () => { @@ -30,15 +33,21 @@ export const Issue = () => { try { setLoading(true); - let issue_url = await db.debug.report( - title.current, - body.current + + let issue_url = await db.debug.report({ + title: title.current, + body: + body.current + `\n_______________ **Device information:** App version: ${APP_VERSION} Platform: ${Platform.OS} -Model: ${Platform.constants.Brand}-${Platform.constants.Model}-${Platform.constants.Version}` - ); +Model: ${Platform.constants.Brand}-${Platform.constants.Model}-${ + Platform.constants.Version + } +Pro: ${PremiumService.get()} +Logged in: ${user ? 'yes' : 'no'}`, + userId: user?.id + }); setLoading(false); eSendEvent(eCloseProgressDialog); await sleep(300); @@ -55,10 +64,21 @@ Model: ${Platform.constants.Brand}-${Platform.constants.Model}-${Platform.consta onPress={() => { Linking.openURL(issue_url); }}> - {issue_url} - + {issue_url}. + {' '} + Please note that we will respond to your issue on the given link. We + recommend that you save it. ), + positiveText: 'Copy link', + positivePress: () => { + Clipboard.setString(issue_url); + ToastEvent.show({ + heading: 'Issue url copied!', + type: 'success', + context: 'global' + }); + }, negativeText: 'Close' }); } catch (e) { @@ -141,7 +161,7 @@ For example: marginTop: 10, textAlign: 'center' }}> - The information above will be is publically available on{' '} + The information above will be publically available at{' '} { Linking.openURL('https://github.com/streetwriters/notesnook'); @@ -152,8 +172,8 @@ For example: }}> github.com/streetwriters/notesnook. {' '} - If you want to ask something general or need some assistance, we would - suggest that you{' '} + If you want to ask something in general or need some assistance, we + would suggest that you{' '} { flexDirection: 'row', alignItems: 'center', zIndex: 10, - elevation: 10 + elevation: 10, + marginBottom:2.5 }}> - {!isTrash && item.notebooks - ? item.notebooks?.slice(0, 1)?.map(_item => { - let notebook = db.notebooks.notebook(_item.id); - notebook = notebook?.data; - - return notebook ? ( -