You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-08-24 20:19:10 +02:00
Compare commits
11 Commits
server-v3.
...
mobile_pro
Author | SHA1 | Date | |
---|---|---|---|
|
dc99187a4d | ||
|
536c139589 | ||
|
8965c2fbb0 | ||
|
42b219525c | ||
|
a376b679dd | ||
|
0d6d2bd1af | ||
|
0ae783035a | ||
|
f1b4557b2f | ||
|
aacf568797 | ||
|
5cd9f93a85 | ||
|
676f4a23d8 |
@@ -981,6 +981,12 @@ packages/app-mobile/components/NoteEditor/SelectionFormatting.js.map
|
||||
packages/app-mobile/components/NoteEditor/types.d.ts
|
||||
packages/app-mobile/components/NoteEditor/types.js
|
||||
packages/app-mobile/components/NoteEditor/types.js.map
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileEditor.d.ts
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileEditor.js
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileEditor.js.map
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileSwitcher.d.ts
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileSwitcher.js
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileSwitcher.js.map
|
||||
packages/app-mobile/components/ScreenHeader.d.ts
|
||||
packages/app-mobile/components/ScreenHeader.js
|
||||
packages/app-mobile/components/ScreenHeader.js.map
|
||||
@@ -990,6 +996,9 @@ packages/app-mobile/components/SelectDateTimeDialog.js.map
|
||||
packages/app-mobile/components/SideMenu.d.ts
|
||||
packages/app-mobile/components/SideMenu.js
|
||||
packages/app-mobile/components/SideMenu.js.map
|
||||
packages/app-mobile/components/TextInput.d.ts
|
||||
packages/app-mobile/components/TextInput.js
|
||||
packages/app-mobile/components/TextInput.js.map
|
||||
packages/app-mobile/components/biometrics/BiometricPopup.d.ts
|
||||
packages/app-mobile/components/biometrics/BiometricPopup.js
|
||||
packages/app-mobile/components/biometrics/BiometricPopup.js.map
|
||||
@@ -1053,6 +1062,9 @@ packages/app-mobile/utils/TlsUtils.js.map
|
||||
packages/app-mobile/utils/checkPermissions.d.ts
|
||||
packages/app-mobile/utils/checkPermissions.js
|
||||
packages/app-mobile/utils/checkPermissions.js.map
|
||||
packages/app-mobile/utils/createRootStyle.d.ts
|
||||
packages/app-mobile/utils/createRootStyle.js
|
||||
packages/app-mobile/utils/createRootStyle.js.map
|
||||
packages/app-mobile/utils/debounce.d.ts
|
||||
packages/app-mobile/utils/debounce.js
|
||||
packages/app-mobile/utils/debounce.js.map
|
||||
|
16
.gitignore
vendored
16
.gitignore
vendored
@@ -969,6 +969,12 @@ packages/app-mobile/components/NoteEditor/SelectionFormatting.js.map
|
||||
packages/app-mobile/components/NoteEditor/types.d.ts
|
||||
packages/app-mobile/components/NoteEditor/types.js
|
||||
packages/app-mobile/components/NoteEditor/types.js.map
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileEditor.d.ts
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileEditor.js
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileEditor.js.map
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileSwitcher.d.ts
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileSwitcher.js
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileSwitcher.js.map
|
||||
packages/app-mobile/components/ScreenHeader.d.ts
|
||||
packages/app-mobile/components/ScreenHeader.js
|
||||
packages/app-mobile/components/ScreenHeader.js.map
|
||||
@@ -978,6 +984,9 @@ packages/app-mobile/components/SelectDateTimeDialog.js.map
|
||||
packages/app-mobile/components/SideMenu.d.ts
|
||||
packages/app-mobile/components/SideMenu.js
|
||||
packages/app-mobile/components/SideMenu.js.map
|
||||
packages/app-mobile/components/TextInput.d.ts
|
||||
packages/app-mobile/components/TextInput.js
|
||||
packages/app-mobile/components/TextInput.js.map
|
||||
packages/app-mobile/components/biometrics/BiometricPopup.d.ts
|
||||
packages/app-mobile/components/biometrics/BiometricPopup.js
|
||||
packages/app-mobile/components/biometrics/BiometricPopup.js.map
|
||||
@@ -1041,6 +1050,9 @@ packages/app-mobile/utils/TlsUtils.js.map
|
||||
packages/app-mobile/utils/checkPermissions.d.ts
|
||||
packages/app-mobile/utils/checkPermissions.js
|
||||
packages/app-mobile/utils/checkPermissions.js.map
|
||||
packages/app-mobile/utils/createRootStyle.d.ts
|
||||
packages/app-mobile/utils/createRootStyle.js
|
||||
packages/app-mobile/utils/createRootStyle.js.map
|
||||
packages/app-mobile/utils/debounce.d.ts
|
||||
packages/app-mobile/utils/debounce.js
|
||||
packages/app-mobile/utils/debounce.js.map
|
||||
@@ -2368,6 +2380,4 @@ packages/tools/website/utils/types.d.ts
|
||||
packages/tools/website/utils/types.js
|
||||
packages/tools/website/utils/types.js.map
|
||||
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
|
||||
packages/app-mobile/components/get-responsive-value.test.js
|
||||
packages/app-mobile/components/get-responsive-value.test.js
|
||||
packages/app-mobile/components/get-responsive-value.test.js
|
||||
|
||||
|
@@ -0,0 +1,29 @@
|
||||
const React = require('react');
|
||||
import { useMemo } from 'react';
|
||||
const { View, StyleSheet } = require('react-native');
|
||||
import createRootStyle from '../../utils/createRootStyle';
|
||||
import ScreenHeader from '../ScreenHeader';
|
||||
import { _ } from '@joplin/lib/locale';
|
||||
|
||||
interface Props {
|
||||
themeId: number;
|
||||
}
|
||||
|
||||
const useStyle = (themeId: number) => {
|
||||
return useMemo(() => {
|
||||
return StyleSheet.create({
|
||||
...createRootStyle(themeId),
|
||||
});
|
||||
}, [themeId]);
|
||||
};
|
||||
|
||||
export default (props: Props) => {
|
||||
const style = useStyle(props.themeId);
|
||||
|
||||
return (
|
||||
<View style={style.root}>
|
||||
<ScreenHeader title={_('Edit profile')} showSaveButton={true} showSideMenuButton={false} showSearchButton={false} />
|
||||
|
||||
</View>
|
||||
);
|
||||
};
|
@@ -0,0 +1,40 @@
|
||||
const React = require('react');
|
||||
import { useMemo } from 'react';
|
||||
const { View, Text, StyleSheet } = require('react-native');
|
||||
import createRootStyle from '../../utils/createRootStyle';
|
||||
import ScreenHeader from '../ScreenHeader';
|
||||
import { _ } from '@joplin/lib/locale';
|
||||
const { ActionButton } = require('../action-button');
|
||||
// const ReactNativeActionButton = require('react-native-action-button').default;
|
||||
|
||||
interface Props {
|
||||
themeId: number;
|
||||
}
|
||||
|
||||
const useStyle = (themeId: number) => {
|
||||
return useMemo(() => {
|
||||
return StyleSheet.create({
|
||||
...createRootStyle(themeId),
|
||||
});
|
||||
}, [themeId]);
|
||||
};
|
||||
|
||||
export default (props: Props) => {
|
||||
const style = useStyle(props.themeId);
|
||||
|
||||
return (
|
||||
<View style={style.root}>
|
||||
<ScreenHeader title={_('Edit notebook')} showSaveButton={false} showSideMenuButton={false} showSearchButton={false} />
|
||||
<View><Text>TEST</Text></View>
|
||||
<ActionButton mainButtonPress={() => { console.info('AAAAAAAAAAAAAAAAAAAAAAA'); }} mainButton={
|
||||
{
|
||||
onPress: () => {
|
||||
|
||||
},
|
||||
color: '#9b59b6',
|
||||
icon: 'md-add',
|
||||
}
|
||||
}></ActionButton>
|
||||
</View>
|
||||
);
|
||||
};
|
37
packages/app-mobile/components/TextInput.tsx
Normal file
37
packages/app-mobile/components/TextInput.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
const React = require('react');
|
||||
import { useMemo } from 'react';
|
||||
import { themeStyle } from '@joplin/lib/theme';
|
||||
import { TextInput, TextInputProps, StyleSheet } from 'react-native';
|
||||
|
||||
interface Props extends TextInputProps {
|
||||
themeId: number;
|
||||
}
|
||||
|
||||
export default (props: Props) => {
|
||||
const theme = themeStyle(props.themeId);
|
||||
const finalProps = { ...props };
|
||||
|
||||
if (!('placeholderTextColor' in finalProps)) finalProps.placeholderTextColor = theme.colorFaded;
|
||||
if (!('underlineColorAndroid' in finalProps)) finalProps.underlineColorAndroid = theme.dividerColor;
|
||||
if (!('selectionColor' in finalProps)) finalProps.selectionColor = theme.textSelectionColor;
|
||||
if (!('keyboardAppearance' in finalProps)) finalProps.keyboardAppearance = theme.keyboardAppearance;
|
||||
if (!('style' in finalProps)) finalProps.style = {};
|
||||
|
||||
const defaultStyle = useMemo(() => {
|
||||
const theme = themeStyle(finalProps.themeId);
|
||||
|
||||
return StyleSheet.create({
|
||||
textInput: {
|
||||
color: theme.color,
|
||||
paddingLeft: 14,
|
||||
paddingRight: 14,
|
||||
paddingTop: 12,
|
||||
paddingBottom: 12,
|
||||
},
|
||||
});
|
||||
}, [finalProps.themeId]);
|
||||
|
||||
finalProps.style = [defaultStyle.textInput, finalProps.style];
|
||||
|
||||
return <TextInput {...finalProps} />;
|
||||
};
|
@@ -150,8 +150,11 @@ class ActionButtonComponent extends React.Component {
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
const mainButtonPress = this.props.mainButtonPress ? this.props.mainButtonPress : () => {};
|
||||
const degrees = buttonComps.length ? 135 : 0;
|
||||
|
||||
return (
|
||||
<ReactNativeActionButton textStyle={styles.itemText} renderIcon={this.renderIcon} buttonColor="rgba(231,76,60,1)" onPress={function() {}}>
|
||||
<ReactNativeActionButton textStyle={styles.itemText} renderIcon={this.renderIcon} buttonColor="rgba(231,76,60,1)" onPress={mainButtonPress} degrees={degrees}>
|
||||
{buttonComps}
|
||||
</ReactNativeActionButton>
|
||||
);
|
||||
|
@@ -1,14 +1,14 @@
|
||||
const React = require('react');
|
||||
|
||||
const { View, TextInput, StyleSheet } = require('react-native');
|
||||
const { View } = require('react-native');
|
||||
const { connect } = require('react-redux');
|
||||
const Folder = require('@joplin/lib/models/Folder').default;
|
||||
const BaseModel = require('@joplin/lib/BaseModel').default;
|
||||
const { ScreenHeader } = require('../ScreenHeader');
|
||||
const { BaseScreenComponent } = require('../base-screen.js');
|
||||
const { dialogs } = require('../../utils/dialogs.js');
|
||||
const { themeStyle } = require('../global-style.js');
|
||||
const { _ } = require('@joplin/lib/locale');
|
||||
const TextInput = require('../TextInput').default;
|
||||
|
||||
class FolderScreenComponent extends BaseScreenComponent {
|
||||
static navigationOptions() {
|
||||
@@ -21,25 +21,6 @@ class FolderScreenComponent extends BaseScreenComponent {
|
||||
folder: Folder.new(),
|
||||
lastSavedFolder: null,
|
||||
};
|
||||
this.styles_ = {};
|
||||
}
|
||||
|
||||
styles() {
|
||||
const theme = themeStyle(this.props.themeId);
|
||||
|
||||
if (this.styles_[this.props.themeId]) return this.styles_[this.props.themeId];
|
||||
this.styles_ = {};
|
||||
|
||||
const styles = {
|
||||
textInput: {
|
||||
color: theme.color,
|
||||
paddingLeft: theme.marginLeft,
|
||||
marginTop: theme.marginTop,
|
||||
},
|
||||
};
|
||||
|
||||
this.styles_[this.props.themeId] = StyleSheet.create(styles);
|
||||
return this.styles_[this.props.themeId];
|
||||
}
|
||||
|
||||
UNSAFE_componentWillMount() {
|
||||
@@ -103,12 +84,17 @@ class FolderScreenComponent extends BaseScreenComponent {
|
||||
|
||||
render() {
|
||||
const saveButtonDisabled = !this.isModified();
|
||||
const theme = themeStyle(this.props.themeId);
|
||||
|
||||
return (
|
||||
<View style={this.rootStyle(this.props.themeId).root}>
|
||||
<ScreenHeader title={_('Edit notebook')} showSaveButton={true} saveButtonDisabled={saveButtonDisabled} onSaveButtonPress={() => this.saveFolderButton_press()} showSideMenuButton={false} showSearchButton={false} />
|
||||
<TextInput placeholder={_('Enter notebook title')} placeholderTextColor={theme.colorFaded} underlineColorAndroid={theme.dividerColor} selectionColor={theme.textSelectionColor} keyboardAppearance={theme.keyboardAppearance} style={this.styles().textInput} autoFocus={true} value={this.state.folder.title} onChangeText={text => this.title_changeText(text)} />
|
||||
<TextInput
|
||||
themeId={this.props.themeId}
|
||||
placeholder={_('Enter notebook title')}
|
||||
autoFocus={true}
|
||||
value={this.state.folder.title}
|
||||
onChangeText={text => this.title_changeText(text)}
|
||||
/>
|
||||
<dialogs.DialogBox
|
||||
ref={dialogbox => {
|
||||
this.dialogbox = dialogbox;
|
||||
|
@@ -337,7 +337,7 @@ PODS:
|
||||
- React
|
||||
- RNSecureRandom (1.0.1):
|
||||
- React
|
||||
- RNShare (8.0.1):
|
||||
- RNShare (8.1.0):
|
||||
- React-Core
|
||||
- RNVectorIcons (9.2.0):
|
||||
- React-Core
|
||||
@@ -530,10 +530,10 @@ SPEC CHECKSUMS:
|
||||
FBLazyVector: 2b47ff52037bd9ae07cc9b051c9975797814b736
|
||||
FBReactNativeSpec: 0e0d384ef17a33b385f13f0c7f97702c7cd17858
|
||||
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
|
||||
glog: 85ecdd10ee8d8ec362ef519a6a45ff9aa27b2e85
|
||||
glog: 476ee3e89abb49e07f822b48323c51c57124b572
|
||||
JoplinCommonShareExtension: a8b60b02704d85a7305627912c0240e94af78db7
|
||||
JoplinRNShareExtension: 485f3e6dad83b7b77f1572eabc249f869ee55c02
|
||||
RCT-Folly: 803a9cfd78114b2ec0f140cfa6fa2a6bafb2d685
|
||||
RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8
|
||||
RCTRequired: 0f06b6068f530932d10e1a01a5352fad4eaacb74
|
||||
RCTTypeSafety: b0ee81f10ef1b7d977605a2b266823dabd565e65
|
||||
React: 3becd12bd51ea8a43bdde7e09d0f40fba7820e03
|
||||
@@ -580,7 +580,7 @@ SPEC CHECKSUMS:
|
||||
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
|
||||
RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93
|
||||
RNSecureRandom: 07efbdf2cd99efe13497433668e54acd7df49fef
|
||||
RNShare: d93e00e906e6174657f6370b480437e4702bc86e
|
||||
RNShare: 48b3113cd089a2be8ff0515c3ae7a46a4db8a76b
|
||||
RNVectorIcons: fcc2f6cb32f5735b586e66d14103a74ce6ad61f8
|
||||
Yoga: c4d61225a466f250c35c1ee78d2d0b3d41fe661c
|
||||
|
||||
|
@@ -27,6 +27,7 @@ import { setLocale, closestSupportedLocale, defaultLocale } from '@joplin/lib/lo
|
||||
import SyncTargetJoplinServer from '@joplin/lib/SyncTargetJoplinServer';
|
||||
import SyncTargetJoplinCloud from '@joplin/lib/SyncTargetJoplinCloud';
|
||||
import SyncTargetOneDrive from '@joplin/lib/SyncTargetOneDrive';
|
||||
import initProfile from '@joplin/lib/services/profileConfig/initProfile';
|
||||
const VersionInfo = require('react-native-version-info').default;
|
||||
const { Keyboard, NativeModules, BackHandler, Animated, View, StatusBar, Linking, Platform, Dimensions } = require('react-native');
|
||||
const RNAppState = require('react-native').AppState;
|
||||
@@ -109,7 +110,10 @@ import { setRSA } from '@joplin/lib/services/e2ee/ppk';
|
||||
import RSA from './services/e2ee/RSA.react-native';
|
||||
import { runIntegrationTests } from '@joplin/lib/services/e2ee/ppkTestUtils';
|
||||
import { AppState } from './utils/types';
|
||||
import ProfileSwitcher from './components/ProfileSwitcher/ProfileSwitcher';
|
||||
import sensorInfo from './components/biometrics/sensorInfo';
|
||||
import { getCurrentProfile } from '@joplin/lib/services/profileConfig';
|
||||
import { Profile } from '@joplin/lib/services/profileConfig/types';
|
||||
|
||||
let storeDispatch = function(_action: any) {};
|
||||
|
||||
@@ -404,14 +408,55 @@ function decryptionWorker_resourceMetadataButNotBlobDecrypted() {
|
||||
ResourceFetcher.instance().scheduleAutoAddResources();
|
||||
}
|
||||
|
||||
const getResourceDir = (profile: Profile, isSubProfile: boolean) => {
|
||||
const documentDir = RNFetchBlob.fs.dirs.DocumentDir;
|
||||
|
||||
if (!isSubProfile) return documentDir;
|
||||
return `${documentDir}/resources-${profile.id}`;
|
||||
};
|
||||
|
||||
const getDatabaseName = (profile: Profile, isSubProfile: boolean) => {
|
||||
if (!isSubProfile) return 'joplin.sqlite';
|
||||
return `joplin-${profile.id}.sqlite`;
|
||||
};
|
||||
|
||||
async function initialize(dispatch: Function) {
|
||||
shimInit();
|
||||
|
||||
const documentDir = RNFetchBlob.fs.dirs.DocumentDir;
|
||||
|
||||
// const profilesConfigPath = documentDir + '/profiles.json';
|
||||
const profileInfo = await initProfile(documentDir);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// // profileInfo.profileConfig.currentProfileId = '8kterg2e';
|
||||
// profileInfo.profileConfig.currentProfileId = 'default';
|
||||
// await saveProfileConfig(profilesConfigPath, profileInfo.profileConfig);
|
||||
// profileInfo = await initProfile(documentDir);
|
||||
|
||||
|
||||
|
||||
|
||||
const { profileConfig, isSubProfile } = profileInfo;
|
||||
const currentProfile = getCurrentProfile(profileConfig);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// @ts-ignore
|
||||
Setting.setConstant('env', __DEV__ ? 'dev' : 'prod');
|
||||
Setting.setConstant('appId', 'net.cozic.joplin-mobile');
|
||||
Setting.setConstant('appType', 'mobile');
|
||||
Setting.setConstant('resourceDir', RNFetchBlob.fs.dirs.DocumentDir);
|
||||
const resourceDir = getResourceDir(currentProfile, isSubProfile);
|
||||
Setting.setConstant('resourceDir', resourceDir);
|
||||
|
||||
await shim.fsDriver().mkdir(resourceDir);
|
||||
|
||||
const logDatabase = new Database(new DatabaseDriverReactNative());
|
||||
await logDatabase.open({ name: 'log.sqlite' });
|
||||
@@ -479,9 +524,9 @@ async function initialize(dispatch: Function) {
|
||||
|
||||
try {
|
||||
if (Setting.value('env') === 'prod') {
|
||||
await db.open({ name: 'joplin.sqlite' });
|
||||
await db.open({ name: getDatabaseName(currentProfile, isSubProfile) });
|
||||
} else {
|
||||
await db.open({ name: 'joplin-101.sqlite' });
|
||||
await db.open({ name: getDatabaseName(currentProfile, isSubProfile) });
|
||||
|
||||
// await db.clearForTesting();
|
||||
}
|
||||
@@ -769,6 +814,13 @@ class AppComponent extends React.Component {
|
||||
type: 'APP_STATE_SET',
|
||||
state: 'ready',
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
this.props.dispatch({
|
||||
type: 'NAV_GO',
|
||||
routeName: 'ProfileSwitcher',
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
Linking.addEventListener('url', this.handleOpenURL_);
|
||||
@@ -902,6 +954,7 @@ class AppComponent extends React.Component {
|
||||
DropboxLogin: { screen: DropboxLoginScreen },
|
||||
EncryptionConfig: { screen: EncryptionConfigScreen },
|
||||
UpgradeSyncTarget: { screen: UpgradeSyncTargetScreen },
|
||||
ProfileSwitcher: { screen: ProfileSwitcher },
|
||||
Log: { screen: LogScreen },
|
||||
Status: { screen: StatusScreen },
|
||||
Search: { screen: SearchScreen },
|
||||
|
11
packages/app-mobile/utils/createRootStyle.ts
Normal file
11
packages/app-mobile/utils/createRootStyle.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
const { themeStyle } = require('../components/global-style');
|
||||
|
||||
export default (themeId: number) => {
|
||||
const theme = themeStyle(themeId);
|
||||
return {
|
||||
root: {
|
||||
flex: 1,
|
||||
backgroundColor: theme.backgroundColor,
|
||||
},
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user