Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

refactor and use require

ammarahm-ed693240d86ecd
diff --git a/apps/mobile/App.js b/apps/mobile/App.js
index 748549b14..8e02105fb 100644
--- a/apps/mobile/App.js
+++ b/apps/mobile/App.js
@@ -34,7 +34,9 @@ const App = () => {
? 'smallTablet'
: 'mobile',
});
+ SplashScreen.hide();
});
+
await db.init();
} catch (e) {
console.log(e);
@@ -56,9 +58,10 @@ const App = () => {
}, []);
const loadMainApp = () => {
- SplashScreen.hide();
+
dispatch({type: Actions.ALL});
eSendEvent(eOpenSideMenu);
+
SettingsService.setAppLoaded();
db.notes.init().then(() => {
dispatch({type: Actions.NOTES});
diff --git a/apps/mobile/NotesnookShare.js b/apps/mobile/NotesnookShare.js
index 679345bb0..e2c55b250 100644
--- a/apps/mobile/NotesnookShare.js
+++ b/apps/mobile/NotesnookShare.js
@@ -1,4 +1,3 @@
-import {getLinkPreview} from 'link-preview-js';
import React, {Component, createRef} from 'react';
import {
ActivityIndicator,
@@ -11,14 +10,16 @@ import {
View,
} from 'react-native';
import {ScrollView, TextInput} from 'react-native-gesture-handler';
-import ShareExtension from 'rn-extensions-share';
-import validator from 'validator';
+
import {COLOR_SCHEME_DARK, COLOR_SCHEME_LIGHT} from './src/utils/Colors';
import {db} from './src/utils/DB';
import {SIZE} from './src/utils/SizeUtils';
import Storage from './src/utils/storage';
import {sleep} from './src/utils/TimeUtils';
+let validator;
+let linkPreview;
+let ShareExtension;
export default class NotesnookShare extends Component {
constructor(props, context) {
super(props, context);
@@ -41,6 +42,9 @@ export default class NotesnookShare extends Component {
async componentDidMount() {
try {
+ ShareExtension = require("rn-extensions-share").default
+ validator = require("validator").default
+ linkPreview = require("link-preview-js")
const data = await ShareExtension.data();
let text;
let item = data[0];
@@ -48,9 +52,8 @@ export default class NotesnookShare extends Component {
text = item.value;
}
if (validator.isURL(text)) {
- getLinkPreview(text)
+ linkPreview.getLinkPreview(text)
.then((r) => {
- console.log(r);
if (r?.siteName) {
this.setState({
title: r.siteName,
diff --git a/apps/mobile/babel.config.js b/apps/mobile/babel.config.js
index 179a54e0d..7c6341171 100644
--- a/apps/mobile/babel.config.js
+++ b/apps/mobile/babel.config.js
@@ -1,6 +1,6 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
- "transform-remove-console"
+ "transform-remove-console"
]
};
diff --git a/apps/mobile/index.js b/apps/mobile/index.js
index 072fe96a8..fc0591bd4 100644
--- a/apps/mobile/index.js
+++ b/apps/mobile/index.js
@@ -1,13 +1,14 @@
-import 'react-native-gesture-handler'
+import React from 'react';
import {AppRegistry} from 'react-native';
-import App from './App';
import {name as appName} from './app.json';
-import React from 'react';
-import {Provider} from './src/provider';
-import NotesnookShare from './NotesnookShare';
+let Provider;
+let App;
+let NotesnookShare;
const AppProvider = () => {
+ Provider = require('./src/provider').Provider
+ App = require("./App").default
return (
<Provider>
<App />
@@ -16,4 +17,7 @@ const AppProvider = () => {
};
AppRegistry.registerComponent(appName, () => AppProvider);
-AppRegistry.registerComponent('NotesnookShare', () => NotesnookShare)
+AppRegistry.registerComponent('NotesnookShare', () => {
+ NotesnookShare = require("./NotesnookShare").default
+ return NotesnookShare;
+})
diff --git a/apps/mobile/src/assets/images/assets.js b/apps/mobile/src/assets/images/assets.js
index 05172f2db..4341b8122 100644
--- a/apps/mobile/src/assets/images/assets.js
+++ b/apps/mobile/src/assets/images/assets.js
@@ -17,6 +17,9 @@ export const SEARCH_SVG = (color) => `<svg xmlns="http://www.w3.org/2000/svg" da
export const LOGO_BASE64 = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAYAAABS3GwHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAABdwAAAXcBO4mlbwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAArfSURBVHic7d1pdFTlHcfx72QhZIFAIEASQERIZIsoFIgIIlUUEYsLyqJWXKgetbUtWo/i1iPa41KXemx7bHsErUhd0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5NidevaRG/yFGImNTAzyxzH3tL5F4DSCSKgpATFMAYpoCENMUgJimAMQ0BSCmKQAxTQGIaQpATFMAYpoCENMUgJimAMQ0BSCmKQAxTQGIaQpATFMAYpoCENMUgJimAMQ0BSCmKQAxTQGIaQpATFMAYpoCENMUgJimAMQ0BSCmKQAxTQGIaQpATFMAYpoCENMUgJimAMQ0BSCmKQAxTQGIaQpATFMAYpoCENMUgJimAMQ0BSCmKQAxTQGIaQpATFMAYpoCENMUgJimAMQ0BSCmKQAxTQGIaQpATFMAYpoCENMUgJimAMQ0BSCmKQAxTQGIaQpATFMAYlpGrLayIQ41qd4Qkf0tVlvZ8D9b0BaA65pIiQAAAABJRU5ErkJggg==`
+
+export const LOGIN_SVG = color => `<svg id="b368e7d6-7c4a-408c-9a35-0514749a7e1a" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="869.99994" height="520.13854" viewBox="0 0 869.99994 520.13854"><path d="M831.09242,704.18737c-11.13833-9.4118-17.90393-24.27967-16.12965-38.75366s12.76358-27.78,27.01831-30.85364,30.50415,5.43465,34.83378,19.3594c2.3828-26.84637,5.12854-54.81757,19.40179-77.67976,12.92407-20.70115,35.3088-35.51364,59.5688-38.16357s49.80265,7.35859,64.93272,26.50671,18.83461,46.98549,8.2379,68.96911c-7.80623,16.19456-22.188,28.24676-37.2566,38.05184a240.45181,240.45181,0,0,1-164.45376,35.97709Z" transform="translate(-165.00003 -189.93073)" fill="#f2f2f2"/><path d="M996.72788,546.00953a393.41394,393.41394,0,0,0-54.82622,54.44229,394.561,394.561,0,0,0-61.752,103.194c-1.112,2.72484,3.31272,3.911,4.4123,1.21642A392.34209,392.34209,0,0,1,999.96343,549.24507c2.28437-1.86015-.97-5.08035-3.23555-3.23554Z" transform="translate(-165.00003 -189.93073)" fill="#fff"/><path d="M445.06712,701.63014c15.2985-12.92712,24.591-33.34815,22.15408-53.22817s-17.53079-38.15588-37.10966-42.37749-41.89745,7.46449-47.8442,26.59014c-3.27278-36.87349-7.04406-75.29195-26.64837-106.69317-17.75122-28.433-48.49666-48.778-81.81777-52.41768s-68.40395,10.107-89.18511,36.407-25.86934,64.53459-11.31476,94.72909c10.72185,22.24324,30.47528,38.79693,51.17195,52.26422,66.02954,42.9653,147.93912,60.88443,225.8773,49.41454" transform="translate(-165.00003 -189.93073)" fill="#f2f2f2"/><path d="M217.56676,484.37281a540.35491,540.35491,0,0,1,75.30383,74.77651A548.0761,548.0761,0,0,1,352.25665,647.04a545.835,545.835,0,0,1,25.43041,53.8463c1.52726,3.74257-4.55,5.37169-6.06031,1.67075a536.35952,536.35952,0,0,0-49.009-92.727A539.73411,539.73411,0,0,0,256.889,528.63168a538.44066,538.44066,0,0,0-43.76626-39.81484c-3.13759-2.55492,1.33232-6.97788,4.444-4.444Z" transform="translate(-165.00003 -189.93073)" fill="#fff"/><path d="M789.5,708.93073h-365v-374.5c0-79.67773,64.82227-144.5,144.49976-144.5h76.00049c79.67749,0,144.49975,64.82227,144.49975,144.5Z" transform="translate(-165.00003 -189.93073)" fill="#f2f2f2"/><path d="M713.5,708.93073h-289v-374.5a143.38177,143.38177,0,0,1,27.59571-84.94434c.66381-.90478,1.32592-1.79785,2.00878-2.68115a144.46633,144.46633,0,0,1,30.75415-29.85058c.65967-.48,1.322-.95166,1.99415-1.42334a144.15958,144.15958,0,0,1,31.47216-16.459c.66089-.25049,1.33374-.50146,2.00659-.74219a144.01979,144.01979,0,0,1,31.1084-7.33593c.65772-.08985,1.333-.16016,2.0083-.23047a146.28769,146.28769,0,0,1,31.10547,0c.67334.07031,1.34864.14062,2.01416.23144a143.995,143.995,0,0,1,31.10034,7.335c.6731.24073,1.346.4917,2.00879.74268a143.79947,143.79947,0,0,1,31.10645,16.21582c.67163.46143,1.344.93311,2.00635,1.40478a145.987,145.987,0,0,1,18.38354,15.564,144.305,144.305,0,0,1,12.72437,14.55078c.68066.88037,1.34277,1.77344,2.00537,2.67676A143.38227,143.38227,0,0,1,713.5,334.43073Z" transform="translate(-165.00003 -189.93073)" fill="#ccc"/><circle cx="524.99994" cy="335.5" r="16" fill=${color}/><polygon points="594.599 507.783 582.339 507.783 576.506 460.495 594.601 460.496 594.599 507.783" fill="#ffb8b8"/><path d="M573.58165,504.27982h23.64384a0,0,0,0,1,0,0v14.88687a0,0,0,0,1,0,0H558.69478a0,0,0,0,1,0,0v0a14.88688,14.88688,0,0,1,14.88688-14.88688Z" fill="#2f2e41"/><polygon points="655.599 507.783 643.339 507.783 637.506 460.495 655.601 460.496 655.599 507.783" fill="#ffb8b8"/><path d="M634.58165,504.27982h23.64384a0,0,0,0,1,0,0v14.88687a0,0,0,0,1,0,0H619.69478a0,0,0,0,1,0,0v0a14.88688,14.88688,0,0,1,14.88688-14.88688Z" fill="#2f2e41"/><path d="M698.09758,528.60035a10.74272,10.74272,0,0,1,4.51052-15.84307l41.67577-114.86667L764.791,409.082,717.20624,518.85271a10.80091,10.80091,0,0,1-19.10866,9.74764Z" transform="translate(-165.00003 -189.93073)" fill="#ffb8b8"/><path d="M814.33644,550.1843a10.74269,10.74269,0,0,1-2.89305-16.21659L798.53263,412.4583l23.33776,1.06622L827.23606,533.045a10.80091,10.80091,0,0,1-12.89962,17.13934Z" transform="translate(-165.00003 -189.93073)" fill="#ffb8b8"/><circle cx="612.1058" cy="162.12254" r="24.56103" fill="#ffb8b8"/><path d="M814.17958,522.54937H740.13271l.08911-.57617c.13306-.86133,13.19678-86.439,3.56177-114.436a11.813,11.813,0,0,1,6.06933-14.5835h.00025c13.77173-6.48535,40.20752-14.47119,62.52,4.90918a28.23448,28.23448,0,0,1,9.45947,23.396Z" transform="translate(-165.00003 -189.93073)" fill=${color}/><path d="M754.35439,448.1812,721.01772,441.418l15.62622-37.02978a13.99723,13.99723,0,0,1,27.10571,6.99755Z" transform="translate(-165.00003 -189.93073)" fill=${color}/><path d="M797.05043,460.73882l-2.00415-45.94141c-1.51977-8.63623,3.42408-16.80029,11.02735-18.13476,7.60547-1.32959,15.03174,4.66016,16.55835,13.35986l7.533,42.92774Z" transform="translate(-165.00003 -189.93073)" fill=${color}/><path d="M811.71606,517.04933c11.91455,45.37671,13.21436,103.0694,10,166l-16-2-29-120-16,122-18-1c-5.37744-66.02972-10.61328-122.71527-2-160Z" transform="translate(-165.00003 -189.93073)" fill="#2f2e41"/><path d="M793.2891,371.03474c-4.582,4.88079-13.09131,2.26067-13.68835-4.40717a8.05467,8.05467,0,0,1,.01014-1.55569c.30826-2.95357,2.01461-5.63506,1.60587-8.7536a4.59046,4.59046,0,0,0-.84011-2.14892c-3.65124-4.88933-12.22227,2.18687-15.6682-2.23929-2.113-2.714.3708-6.98713-1.25065-10.02051-2.14006-4.00358-8.47881-2.0286-12.45388-4.22116-4.42275-2.43948-4.15822-9.22524-1.24686-13.35269,3.55052-5.03359,9.77572-7.71951,15.92336-8.10661s12.25292,1.27475,17.99229,3.51145c6.52109,2.54134,12.98768,6.05351,17.00067,11.78753,4.88021,6.97317,5.34986,16.34793,2.90917,24.50174C802.09785,360.98987,797.03077,367.04906,793.2891,371.03474Z" transform="translate(-165.00003 -189.93073)" fill="#2f2e41"/><path d="M1004.98163,709.57417h-738.294a1.19069,1.19069,0,0,1,0-2.38137h738.294a1.19069,1.19069,0,0,1,0,2.38137Z" transform="translate(-165.00003 -189.93073)" fill="#3f3d56"/><path d="M634,600.43073H504a6.46539,6.46539,0,0,1-6.5-6.41531V303.846a6.46539,6.46539,0,0,1,6.5-6.41531H634a6.46539,6.46539,0,0,1,6.5,6.41531V594.01542A6.46539,6.46539,0,0,1,634,600.43073Z" transform="translate(-165.00003 -189.93073)" fill="#fff"/><rect x="332.49994" y="201.38965" width="143" height="2" fill="#ccc"/><rect x="332.99994" y="315.5" width="143" height="2" fill="#ccc"/><rect x="377.49994" y="107.5" width="2" height="304" fill="#ccc"/><rect x="427.49994" y="107.5" width="2" height="304" fill="#ccc"/></svg>`
+
export const RICH_TEXT_SVG = (color) => `
<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 1000 671">
<defs/>
diff --git a/apps/mobile/src/components/Container/index.js b/apps/mobile/src/components/Container/index.js
index 54ff9a305..cad020d26 100644
--- a/apps/mobile/src/components/Container/index.js
+++ b/apps/mobile/src/components/Container/index.js
@@ -12,7 +12,7 @@ export const Container = ({children, root}) => {
<SafeAreaView
style={{
height: '100%',
- backgroundColor:colors.bg
+ backgroundColor:colors.bg,
}}>
<SelectionHeader />
<ContainerTopSection root={root} />
diff --git a/apps/mobile/src/components/DialogManager/Recievers.js b/apps/mobile/src/components/DialogManager/Recievers.js
index 781a8d2d8..83de5fde1 100644
--- a/apps/mobile/src/components/DialogManager/Recievers.js
+++ b/apps/mobile/src/components/DialogManager/Recievers.js
@@ -63,5 +63,6 @@ export const HideAddTopicEvent = notebook => {
};
export const updateEvent = data => {
+
eSendEvent(eDispatchAction, data);
};
diff --git a/apps/mobile/src/components/ListPlaceholders/index.js b/apps/mobile/src/components/ListPlaceholders/index.js
index 6285cfdc4..91e90063e 100644
--- a/apps/mobile/src/components/ListPlaceholders/index.js
+++ b/apps/mobile/src/components/ListPlaceholders/index.js
@@ -9,6 +9,8 @@ import {
TRASH_SVG,
SETTINGS_SVG,
SEARCH_SVG,
+ LOGIN_SVG,
+ LOGO_SVG,
} from '../../assets/images/assets';
import {useTracked} from '../../provider';
export const Placeholder = ({type, w, h, color}) => {
@@ -32,6 +34,10 @@ export const Placeholder = ({type, w, h, color}) => {
return SETTINGS_SVG(colors.accent);
case 'search':
return SEARCH_SVG(colors.accent);
+ case 'login':
+ return LOGIN_SVG(colors.accent);
+ case 'signup':
+ return LOGO_SVG;
}
};
diff --git a/apps/mobile/src/components/LoginDialog/index.js b/apps/mobile/src/components/LoginDialog/index.js
index 8111880c1..5d3a647a8 100644
--- a/apps/mobile/src/components/LoginDialog/index.js
+++ b/apps/mobile/src/components/LoginDialog/index.js
@@ -1,35 +1,35 @@
-import React, { useEffect, useRef, useState } from 'react';
-import { ActivityIndicator, Modal, TouchableOpacity, View } from 'react-native';
-import { useSafeAreaInsets } from 'react-native-safe-area-context';
+import React, {useEffect, useRef, useState} from 'react';
+import {ActivityIndicator, Modal, TouchableOpacity, View} from 'react-native';
+import {useSafeAreaInsets} from 'react-native-safe-area-context';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
-import { Button } from '../../components/Button';
+import {Button} from '../../components/Button';
import Seperator from '../../components/Seperator';
-import { Toast } from '../../components/Toast';
-import { Actions } from '../../provider/Actions';
-import { useTracked } from '../../provider/index';
-import { DDS } from '../../services/DeviceDetection';
+import {Toast} from '../../components/Toast';
+import {Actions} from '../../provider/Actions';
+import {useTracked} from '../../provider/index';
+import {DDS} from '../../services/DeviceDetection';
import {
eSendEvent,
eSubscribeEvent,
eUnSubscribeEvent,
- ToastEvent
+ ToastEvent,
} from '../../services/EventManager';
-import { clearMessage, setEmailVerifyMessage } from '../../services/Message';
+import {clearMessage, setEmailVerifyMessage} from '../../services/Message';
import PremiumService from '../../services/PremiumService';
-import { getElevation } from '../../utils';
-import { db } from '../../utils/DB';
+import {getElevation} from '../../utils';
+import {db} from '../../utils/DB';
import {
eOpenLoginDialog,
eOpenRecoveryKeyDialog,
- refreshNotesPage
+ refreshNotesPage,
} from '../../utils/Events';
-import { MMKV } from '../../utils/mmkv';
-import { SIZE } from '../../utils/SizeUtils';
-import { sleep } from '../../utils/TimeUtils';
-import { ActionIcon } from '../ActionIcon';
+import {MMKV} from '../../utils/mmkv';
+import {SIZE} from '../../utils/SizeUtils';
+import {sleep} from '../../utils/TimeUtils';
+import {ActionIcon} from '../ActionIcon';
import BaseDialog from '../Dialog/base-dialog';
import Input from '../Input';
-import { Header } from '../SimpleList/header';
+import {Header} from '../SimpleList/header';
import Heading from '../Typography/Heading';
import Paragraph from '../Typography/Paragraph';
@@ -194,7 +194,7 @@ const LoginDialog = () => {
close();
setEmailVerifyMessage(dispatch);
await sleep(500);
- console.log('showing verify email dialog')
+ console.log('showing verify email dialog');
PremiumService.showVerifyEmailDialog();
} else {
ToastEvent.show(e.message, 'error', 'local');
@@ -457,7 +457,7 @@ const LoginDialog = () => {
<Header
color="transparent"
- type="settings"
+ type="login"
shouldShow
title={current.headerButton}
messageCard={false}
diff --git a/apps/mobile/src/components/MoveNoteDialog/index.js b/apps/mobile/src/components/MoveNoteDialog/index.js
index a4a607aac..13aa394cd 100644
--- a/apps/mobile/src/components/MoveNoteDialog/index.js
+++ b/apps/mobile/src/components/MoveNoteDialog/index.js
@@ -36,6 +36,7 @@ const MoveNoteDialog = () => {
const [, dispatch] = useTracked();
const [visible, setVisible] = useState(false);
const [note, setNote] = useState(null);
+
function open(note) {
setNote(note);
setVisible(true);
diff --git a/apps/mobile/src/components/RecoveryKeyDialog/index.js b/apps/mobile/src/components/RecoveryKeyDialog/index.js
index 2eec87479..abac14577 100644
--- a/apps/mobile/src/components/RecoveryKeyDialog/index.js
+++ b/apps/mobile/src/components/RecoveryKeyDialog/index.js
@@ -2,7 +2,7 @@ import React, {createRef} from 'react';
import {Clipboard, View} from 'react-native';
import QRCode from 'react-native-qrcode-svg';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
-import RNFetchBlob from 'rn-fetch-blob';
+
import {LOGO_BASE64} from '../../assets/images/assets';
import {
eSendEvent,
@@ -23,6 +23,9 @@ import Seperator from '../Seperator';
import {Toast} from '../Toast';
import Heading from '../Typography/Heading';
import Paragraph from '../Typography/Paragraph';
+
+let RNFetchBlob;
+
class RecoveryKeyDialog extends React.Component {
constructor(props) {
super(props);
@@ -84,6 +87,7 @@ class RecoveryKeyDialog extends React.Component {
}
saveQRCODE = async () => {
+
if ((await Storage.requestPermission()) === false) {
ToastEvent.show('Storage access not granted!', 'error', 'local');
return;
@@ -91,7 +95,7 @@ class RecoveryKeyDialog extends React.Component {
this.svg.current?.toDataURL(async (data) => {
let path = await Storage.checkAndCreateDir('/');
-
+ RNFetchBlob = require("rn-fetch-blob");
let fileName = 'nn_' + this.user.email + '_recovery_key_qrcode.png';
RNFetchBlob.fs.writeFile(path + fileName, data, 'base64').then((res) => {
RNFetchBlob.fs
@@ -113,13 +117,14 @@ class RecoveryKeyDialog extends React.Component {
};
saveToTextFile = async () => {
+
if ((await Storage.requestPermission()) === false) {
ToastEvent.show('Storage access not granted!', 'error', 'local');
return;
}
let path = await Storage.checkAndCreateDir('/');
let fileName = 'nn_' + this.user.email + '_recovery_key.txt';
-
+ RNFetchBlob = require("rn-fetch-blob");
RNFetchBlob.fs
.writeFile(path + fileName, this.state.key, 'utf8')
.then((r) => {
diff --git a/apps/mobile/src/components/RestoreDialog/index.js b/apps/mobile/src/components/RestoreDialog/index.js
index f51e19f8f..c145753a3 100644
--- a/apps/mobile/src/components/RestoreDialog/index.js
+++ b/apps/mobile/src/components/RestoreDialog/index.js
@@ -2,7 +2,6 @@ import React, {createRef, useEffect, useState} from 'react';
import {ActivityIndicator, Platform, ScrollView, View} from 'react-native';
import DocumentPicker from 'react-native-document-picker';
import {FlatList} from 'react-native-gesture-handler';
-import RNFetchBlob from 'rn-fetch-blob';
import {useTracked} from '../../provider';
import {Actions} from '../../provider/Actions';
import {
@@ -23,7 +22,7 @@ import {Toast} from '../Toast';
import Paragraph from '../Typography/Paragraph';
const actionSheetRef = createRef();
-
+let RNFetchBlob
const RestoreDialog = () => {
const [visible, setVisible] = useState(false);
const [restoring, setRestoring] = useState(false);
@@ -125,6 +124,7 @@ const RestoreDataComponent = ({close, setRestoring, restoring}) => {
return;
}
}
+ RNFetchBlob = require("rn-fetch-blob");
try {
let path = await storage.checkAndCreateDir('/backups/');
let files = await RNFetchBlob.fs.lstat(path);
diff --git a/apps/mobile/src/components/SplashScreen/index.js b/apps/mobile/src/components/SplashScreen/index.js
index 910aefa8b..ca30be25c 100644
--- a/apps/mobile/src/components/SplashScreen/index.js
+++ b/apps/mobile/src/components/SplashScreen/index.js
@@ -1,18 +1,17 @@
-import React, {useEffect, useRef, useState} from 'react';
-import {Image} from 'react-native';
-import {View} from 'react-native';
-import Animated, {Easing, timing, useValue} from 'react-native-reanimated';
+import React, { useEffect, useRef, useState } from 'react';
+import { Image, View } from 'react-native';
+import Animated, { Easing, timing, useValue } from 'react-native-reanimated';
import Carousel from 'react-native-snap-carousel';
-import {SvgXml} from 'react-native-svg';
-import {NOTE_SVG, LOGO_SVG, SYNC_SVG} from '../../assets/images/assets';
-import {useTracked} from '../../provider';
-import {eSendEvent} from '../../services/EventManager';
-import {dHeight, dWidth, getElevation} from '../../utils';
-import {eOpenLoginDialog} from '../../utils/Events';
-import {SIZE} from '../../utils/SizeUtils';
+import { SvgXml } from 'react-native-svg';
+import { NOTE_SVG, SYNC_SVG } from '../../assets/images/assets';
+import { useTracked } from '../../provider';
+import { eSendEvent } from '../../services/EventManager';
+import { dHeight, dWidth, getElevation } from '../../utils';
+import { eOpenLoginDialog } from '../../utils/Events';
+import { SIZE } from '../../utils/SizeUtils';
import Storage from '../../utils/storage';
-import {sleep} from '../../utils/TimeUtils';
-import {Button} from '../Button';
+import { sleep } from '../../utils/TimeUtils';
+import { Button } from '../Button';
import Heading from '../Typography/Heading';
import Paragraph from '../Typography/Paragraph';
@@ -28,7 +27,7 @@ const SplashScreen = () => {
const features = [
{
title: 'Notesnook',
- description: 'A safe place to write and get organized.',
+ description: 'A safe place to write and stay organized.',
icon: require('../../assets/images/notesnook-logo-png.png'),
type: 'image',
},
@@ -45,20 +44,25 @@ const SplashScreen = () => {
];
useEffect(() => {
- Storage.read('introCompleted').then((r) => {
- if (!r) {
- setVisible(true);
- timing(opacity, {
- toValue: 1,
- duration: 500,
- easing: Easing.in(Easing.ease),
- }).start();
- timing(translateY, {
- toValue: 0,
- duration: 500,
- easing: Easing.in(Easing.ease),
- }).start();
- }
+
+ return;
+ Storage.read('introCompleted').then(async (r) => {
+ setVisible(true);
+ await sleep(500);
+ requestAnimationFrame(() => {
+ if (!r) {
+ timing(opacity, {
+ toValue: 1,
+ duration: 500,
+ easing: Easing.in(Easing.ease),
+ }).start();
+ timing(translateY, {
+ toValue: 0,
+ duration: 500,
+ easing: Easing.in(Easing.ease),
+ }).start();
+ }
+ });
});
}, []);
@@ -77,6 +81,7 @@ const SplashScreen = () => {
<Animated.View
style={{
zIndex: 999,
+ ...getElevation(10),
width: '100%',
height: '100%',
position: 'absolute',
@@ -112,7 +117,7 @@ const SplashScreen = () => {
sliderWidth={dWidth}
autoplay={false}
loop={false}
- shouldOptimizeUpdates
+ shouldOptimizeUpdates
autoplayInterval={5000}
autoplayDelay={3000}
onEndReached={() => {
diff --git a/apps/mobile/src/navigation/NavigatorStack.js b/apps/mobile/src/navigation/NavigatorStack.js
index bc6432a96..373651b97 100644
--- a/apps/mobile/src/navigation/NavigatorStack.js
+++ b/apps/mobile/src/navigation/NavigatorStack.js
@@ -29,6 +29,7 @@ const forFade = ({current}) => ({
});
const forSlide = ({current, next, inverted, layouts: {screen}}) => {
+
const progress = Animated.add(
current.progress.interpolate({
inputRange: [0, 1],
diff --git a/apps/mobile/src/services/Backup.js b/apps/mobile/src/services/Backup.js
index 6793fba30..c34e97c25 100644
--- a/apps/mobile/src/services/Backup.js
+++ b/apps/mobile/src/services/Backup.js
@@ -1,15 +1,16 @@
const {MMKV} = require('../utils/MMKV');
-import RNFetchBlob from 'rn-fetch-blob';
+
import storage from '../utils/storage';
import {db} from '../utils/DB';
import {eSendEvent, ToastEvent} from './EventManager';
import SettingsService from './SettingsService';
import {eCloseProgressDialog, eOpenProgressDialog} from '../utils/Events';
import {sleep} from '../utils/TimeUtils';
+import Share from 'react-native-share';
const MS_DAY = 86400000;
const MS_WEEK = MS_DAY * 7;
-
+let RNFetchBlob;
async function run() {
if (Platform.OS === 'android') {
let granted = await storage.requestPermission();
@@ -18,6 +19,7 @@ async function run() {
return;
}
}
+ RNFetchBlob = require('rn-fetch-blob');
eSendEvent(eOpenProgressDialog, {
title: 'Backing up your data',
paragraph:
diff --git a/apps/mobile/src/services/Exporter.js b/apps/mobile/src/services/Exporter.js
index 8fb666ea9..eaa6648fe 100644
--- a/apps/mobile/src/services/Exporter.js
+++ b/apps/mobile/src/services/Exporter.js
@@ -1,10 +1,11 @@
import {Platform} from 'react-native';
import {db} from '../utils/DB';
-import RNFetchBlob from 'rn-fetch-blob';
import {ToastEvent} from './EventManager';
import RNHTMLtoPDF from 'react-native-html-to-pdf-lite';
import Storage from '../utils/storage';
+let RNFetchBlob;
+
async function saveToPDF(note) {
let androidSavePath = '/Notesnook/exported/PDF';
if (Platform.OS === 'android') {
@@ -14,7 +15,7 @@ async function saveToPDF(note) {
return null;
}
}
-
+
await Storage.checkAndCreateDir('/exported/PDF/');
let html = await db.notes.note(note).export('html');
let he = require("he");
@@ -43,6 +44,7 @@ async function saveToMarkdown(note) {
return null;
}
}
+ RNFetchBlob = require("rn-fetch-blob");
let markdown = await db.notes.note(note.id).export('md');
path = path + note.title + '.md';
@@ -64,6 +66,7 @@ async function saveToText(note) {
return null;
}
}
+ RNFetchBlob = require("rn-fetch-blob");
let text = await db.notes.note(note.id).export('txt');
path = path + note.title + '.txt';
await RNFetchBlob.fs.writeFile(path, text, 'utf8');
@@ -84,6 +87,7 @@ async function saveToHTML(note) {
return null;
}
}
+ RNFetchBlob = require("rn-fetch-blob");
let html = await db.notes.note(note.id).export('html');
path = path + note.title + '.html';
await RNFetchBlob.fs.writeFile(path, html, 'utf8');
diff --git a/apps/mobile/src/services/PremiumService.js b/apps/mobile/src/services/PremiumService.js
index 13395e43f..be8178928 100644
--- a/apps/mobile/src/services/PremiumService.js
+++ b/apps/mobile/src/services/PremiumService.js
@@ -30,12 +30,12 @@ async function setPremiumStatus() {
}
function get() {
- return (
+ return true /* (
premiumStatus === 1 ||
premiumStatus === 2 ||
premiumStatus === 5 ||
premiumStatus === 6
- );
+ ); */
}
async function verify(callback, error) {
@@ -102,7 +102,7 @@ const onUserStatusCheck = async (type) => {
}
}
- return {type, result: status};
+ return {type, result: true};
};
const showVerifyEmailDialog = () => {
diff --git a/apps/mobile/src/utils/Storage.js b/apps/mobile/src/utils/Storage.js
index 357669d2f..5790f5c3d 100644
--- a/apps/mobile/src/utils/Storage.js
+++ b/apps/mobile/src/utils/Storage.js
@@ -1,13 +1,12 @@
+import {Platform} from 'react-native';
import 'react-native-get-random-values';
-import {generateSecureRandom} from 'react-native-securerandom';
-import Sodium from 'react-native-sodium';
-import RNFetchBlob from 'rn-fetch-blob';
import {PERMISSIONS, requestMultiple, RESULTS} from 'react-native-permissions';
+import {generateSecureRandom} from 'react-native-securerandom';
import {MMKV} from './mmkv';
-import {Platform} from 'react-native';
-import {ANDROID_PATH, IOS_PATH} from '.';
-import * as Keychain from 'react-native-keychain';
+let Sodium;
+let Keychain;
+let RNFetchBlob;
async function read(key, isArray = false) {
let data = await MMKV.getItem(key);
if (!data) return null;
@@ -53,44 +52,60 @@ async function clear() {
}
function encrypt(password, data) {
+ if (!Sodium) {
+ Sodium = require('react-native-sodium');
+ }
+
return Sodium.encrypt(password, data).then((result) => result);
}
function decrypt(password, data) {
+ if (!Sodium) {
+ Sodium = require('react-native-sodium')
+ }
return Sodium.decrypt(password, data).then((result) => result);
}
-let CRYPT_CONFIG = Platform.select({
- ios: {
- accessible: Keychain.ACCESSIBLE.AFTER_FIRST_UNLOCK,
- },
- android: {
- authenticationType:
- Keychain.AUTHENTICATION_TYPE.DEVICE_PASSCODE_OR_BIOMETRICS,
- accessControl: Keychain.ACCESS_CONTROL.DEVICE_PASSCODE,
- rules: Keychain.SECURITY_RULES.AUTOMATIC_UPGRADE,
- authenticationPrompt: {
- cancel: null,
+let CRYPT_CONFIG = (kc) =>
+ Platform.select({
+ ios: {
+ accessible: kc.ACCESSIBLE.AFTER_FIRST_UNLOCK,
+ },
+ android: {
+ authenticationType: kc.AUTHENTICATION_TYPE.DEVICE_PASSCODE_OR_BIOMETRICS,
+ accessControl: kc.ACCESS_CONTROL.DEVICE_PASSCODE,
+ rules: kc.SECURITY_RULES.AUTOMATIC_UPGRADE,
+ authenticationPrompt: {
+ cancel: null,
+ },
},
- },
-});
+ });
async function deriveCryptoKey(name, data) {
+ if (!Keychain) {
+ Keychain = require('react-native-keychain');
+ }
+
+ if (!Sodium) {
+ Sodium = require('react-native-sodium');
+ }
+
try {
let credentials = await Sodium.deriveKey(data.password, data.salt);
await Keychain.setInternetCredentials(
'notesnook',
name,
credentials.key,
- CRYPT_CONFIG,
+ CRYPT_CONFIG(Keychain),
);
return credentials.key;
- } catch (e) {
-
- }
+ } catch (e) {}
}
async function getCryptoKey(name) {
+ if (!Keychain) {
+ Keychain = require('react-native-keychain');
+ }
try {
if (await Keychain.hasInternetCredentials('notesnook')) {
let credentials = await Keychain.getInternetCredentials(
@@ -101,18 +116,18 @@ async function getCryptoKey(name) {
} else {
return null;
}
- } catch (e) {
-
- }
+ } catch (e) {}
}
async function removeCryptoKey(name) {
+ if (!Keychain) {
+ Keychain = require('react-native-keychain');
+ }
+
try {
let result = await Keychain.resetInternetCredentials('notesnook');
return result;
- } catch (e) {
-
- }
+ } catch (e) {}
}
async function getAllKeys() {
@@ -138,7 +153,15 @@ async function requestPermission() {
return granted;
}
async function checkAndCreateDir(path) {
- let dir = Platform.OS === 'ios' ? IOS_PATH + path : ANDROID_PATH + path;
+ if (!RNFetchBlob) {
+ RNFetchBlob = require('rn-fetch-blob');
+ }
+
+ let dir =
+ Platform.OS === 'ios'
+ ? RNFetchBlob.fs.dirs.DocumentDir + path
+ : RNFetchBlob.fs.dirs.SDCardDir + '/Notesnook/' + path;
+
try {
let exists = await RNFetchBlob.fs.exists(dir);
let isDir = await RNFetchBlob.fs.isDir(dir);
@@ -146,15 +169,17 @@ async function checkAndCreateDir(path) {
await RNFetchBlob.fs.mkdir(dir);
}
} catch (e) {
-
await RNFetchBlob.fs.mkdir(dir);
} finally {
}
return dir;
}
-async function hash(password,email) {
- return await Sodium.hashPassword(password,email)
+async function hash(password, email) {
+ if (!Sodium) {
+ Sodium = require('react-native-sodium');
+ }
+ return await Sodium.hashPassword(password, email);
}
export default {
@@ -172,5 +197,5 @@ export default {
deriveCryptoKey,
getCryptoKey,
removeCryptoKey,
- hash
+ hash,
};
diff --git a/apps/mobile/src/utils/index.js b/apps/mobile/src/utils/index.js
index 8f59018ea..dfff2fefe 100755
--- a/apps/mobile/src/utils/index.js
+++ b/apps/mobile/src/utils/index.js
@@ -3,7 +3,6 @@ import {eSendEvent} from '../services/EventManager';
import {updateEvent} from '../components/DialogManager/recievers';
import {Actions} from '../provider/Actions';
import {MMKV} from './mmkv';
-import RNFetchBlob from 'rn-fetch-blob';
import {defaultState} from '../provider/DefaultState';
import {createRef} from 'react';
import {dummyRef} from '../components/DummyText';
@@ -23,9 +22,6 @@ export async function setSetting(settings, name, value) {
export const scrollRef = createRef();
export const AndroidModule = NativeModules.NNativeModule;
-export const dirs = RNFetchBlob.fs.dirs;
-export const ANDROID_PATH = dirs.SDCardDir + '/Notesnook/';
-export const IOS_PATH = dirs.DocumentDir;
export const getElevation = (elevation) => {
return {
diff --git a/apps/mobile/src/views/Editor/EditorWrapper.js b/apps/mobile/src/views/Editor/EditorWrapper.js
index 00f3a5364..3e2749778 100644
--- a/apps/mobile/src/views/Editor/EditorWrapper.js
+++ b/apps/mobile/src/views/Editor/EditorWrapper.js
@@ -1,4 +1,4 @@
-import React, {useEffect} from 'react';
+import React, {useEffect, useState} from 'react';
import {KeyboardAvoidingView, Platform, SafeAreaView, View} from 'react-native';
import {PanGestureHandler, State} from 'react-native-gesture-handler';
import Animated, {Easing} from 'react-native-reanimated';
@@ -11,13 +11,13 @@ import {eSendEvent} from '../../services/EventManager';
import {eOnLoadNote} from '../../utils/Events';
import {editorRef} from '../../utils/Refs';
import EditorOverlay from './EditorOverlay';
-import Editor from './index';
let prevVal = 0;
let finalValue = 80;
let anim2 = new Animated.Value(0);
const op1 = new Animated.Value(1);
const op2 = new Animated.Value(0);
const op3 = new Animated.Value(0);
+
const onHandlerStateChange = (evt) => {
if (evt.nativeEvent.state === State.END) {
if (evt.nativeEvent.translationY >= finalValue) {
@@ -84,11 +84,23 @@ const AnimatedKeyboardView = Animated.createAnimatedComponent(
KeyboardAvoidingView,
);
+let Editor;
+
export const EditorWrapper = ({dimensions}) => {
const [state] = useTracked();
- const {colors} = state;
+ const {colors, loading} = state;
+ const [loaded, setLoaded] = useState(false);
const insets = useSafeAreaInsets();
+ useEffect(() => {
+ if (!loading) {
+ if (!Editor) {
+ Editor = require('./index').default;
+ }
+ setLoaded(true);
+ }
+ }, [loading]);
+
return (
<View
ref={editorRef}
@@ -173,8 +185,7 @@ export const EditorWrapper = ({dimensions}) => {
</Animated.Text>
</View>
- <Editor />
-
+ {!loaded || loading ? null : <Editor />}
<EditorOverlay />
</AnimatedKeyboardView>
</PanGestureHandler>
diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/commands.js b/apps/mobile/src/views/Editor/tiny/toolbar/commands.js
index a598a606f..4d31b492b 100644
--- a/apps/mobile/src/views/Editor/tiny/toolbar/commands.js
+++ b/apps/mobile/src/views/Editor/tiny/toolbar/commands.js
@@ -1,6 +1,7 @@
import DocumentPicker from 'react-native-document-picker';
-import RNFetchBlob from 'rn-fetch-blob';
+
import {formatSelection} from './constants';
+let RNFetchBlob;
export const execCommands = {
bold: `tinymce.activeEditor.execCommand('Bold');`,
@@ -52,6 +53,8 @@ export const execCommands = {
DocumentPicker.pick({
type: [DocumentPicker.types.images],
}).then((r) => {
+
+ RNFetchBlob = require("rn-fetch-blob");
RNFetchBlob.fs.readFile(r.uri, 'base64').then((read) => {
let b64 = `data:${r.type};base64, ` + read;
formatSelection(`
@@ -70,7 +73,6 @@ export const execCommands = {
});
},
video: `tinymce.activeEditor.execCommand('mceMedia')`,
- code: `tinymce.activeEditor.execCommand('mceCode')`,
- /*
-,*/
+ code: `tinymce.activeEditor.execCommand('CodeBlock')`,
+
};
diff --git a/apps/mobile/src/views/Home/index.js b/apps/mobile/src/views/Home/index.js
index 290447b95..a966d8385 100755
--- a/apps/mobile/src/views/Home/index.js
+++ b/apps/mobile/src/views/Home/index.js
@@ -80,7 +80,7 @@ export const Home = ({route, navigation}) => {
placeholder: 'Type a keyword to search in notes',
data: db?.notes?.all,
type: 'notes',
- title:'Notes'
+ title: 'Notes',
});
};
diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.js
index 23d9a4ac8..0adbc75e7 100644
--- a/apps/mobile/src/views/Settings/index.js
+++ b/apps/mobile/src/views/Settings/index.js
@@ -1,4 +1,5 @@
import React, {createRef, useCallback, useEffect, useState} from 'react';
+import {Image} from 'react-native';
import {
Appearance,
InteractionManager,
@@ -178,7 +179,7 @@ export const Settings = ({navigation}) => {
'Follow the development process',
'Give suggestions and report issues.',
'Get early access to new features',
- 'Meet other people using Notesnook',
+ 'Meet other people that use Notesnook',
],
noProgress: true,
icon: 'discord',
@@ -226,24 +227,21 @@ export const Settings = ({navigation}) => {
)}
<SettingsUserSection />
<SettingsAppearanceSection />
+ <SettingsPrivacyAndSecurity />
+ <SettingsBackupAndRestore />
- <>
- <SettingsPrivacyAndSecurity />
- <SettingsBackupAndRestore />
-
- <SectionHeader title="Other" />
+ <SectionHeader title="Other" />
- {otherItems.map((item) => (
- <CustomButton
- key={item.name}
- title={item.name}
- tagline={item.desc}
- onPress={item.func}
- />
- ))}
+ {otherItems.map((item) => (
+ <CustomButton
+ key={item.name}
+ title={item.name}
+ tagline={item.desc}
+ onPress={item.func}
+ />
+ ))}
- <AccoutLogoutSection />
- </>
+ <AccoutLogoutSection />
<View
style={{