mirror of
https://github.com/standardnotes/mobile.git
synced 2026-05-19 03:54:30 -04:00
SFJS 0.3.60
This commit is contained in:
@@ -102,8 +102,8 @@ android {
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
|
||||
versionCode 3000060
|
||||
versionName "3.0.6"
|
||||
versionCode 3000080
|
||||
versionName "3.0.8"
|
||||
|
||||
multiDexEnabled true
|
||||
|
||||
|
||||
@@ -35,4 +35,3 @@ project(':react-native-fingerprint-scanner').projectDir = new File(rootProject.p
|
||||
|
||||
include ':react-native-flag-secure-android'
|
||||
project(':react-native-flag-secure-android').projectDir = new File(rootProject.projectDir, '../vendor/react-native-flag-secure-android/android')
|
||||
|
||||
|
||||
@@ -259,6 +259,13 @@
|
||||
remoteGlobalIDString = 358F4ED71D1E81A9004DF814;
|
||||
remoteInfo = RCTBlob;
|
||||
};
|
||||
B81C74CF22904ACA001CFD6C /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = FF655164AD874250A8F6E20E /* RNCAsyncStorage.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 134814201AA4EA6300B7C361;
|
||||
remoteInfo = RNCAsyncStorage;
|
||||
};
|
||||
CD1766771F795AE500165C83 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = CD17664C1F795AE500165C83 /* SNTextView.xcodeproj */;
|
||||
@@ -420,13 +427,6 @@
|
||||
remoteGlobalIDString = 5DBEB1501B18CEA900B34395;
|
||||
remoteInfo = RNVectorIcons;
|
||||
};
|
||||
CDBA9120228CE3AC009F7AC7 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = FF655164AD874250A8F6E20E /* RNCAsyncStorage.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 134814201AA4EA6300B7C361;
|
||||
remoteInfo = RNCAsyncStorage;
|
||||
};
|
||||
CDE0D5F821D4012300E093B5 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 19A39FBB53A3465B81022E02 /* RNGestureHandler.xcodeproj */;
|
||||
@@ -842,6 +842,14 @@
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B81C74CC22904ACA001CFD6C /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B81C74D022904ACA001CFD6C /* libRNCAsyncStorage.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CD17664D1F795AE500165C83 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -924,14 +932,6 @@
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CDBA911D228CE3AC009F7AC7 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CDBA9121228CE3AC009F7AC7 /* libRNCAsyncStorage.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CDD38E0A1F6DCEBB00740780 /* Recovered References */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -1098,6 +1098,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
@@ -1170,7 +1171,7 @@
|
||||
ProjectRef = CDB58A0A1F6C5174009EF868 /* ReactNativeFingerprintScanner.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = CDBA911D228CE3AC009F7AC7 /* Products */;
|
||||
ProductGroup = B81C74CC22904ACA001CFD6C /* Products */;
|
||||
ProjectRef = FF655164AD874250A8F6E20E /* RNCAsyncStorage.xcodeproj */;
|
||||
},
|
||||
{
|
||||
@@ -1403,6 +1404,13 @@
|
||||
remoteRef = ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
B81C74D022904ACA001CFD6C /* libRNCAsyncStorage.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libRNCAsyncStorage.a;
|
||||
remoteRef = B81C74CF22904ACA001CFD6C /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
CD1766781F795AE500165C83 /* libSNTextView.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
@@ -1564,13 +1572,6 @@
|
||||
remoteRef = CDB58A671F6C5294009EF868 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
CDBA9121228CE3AC009F7AC7 /* libRNCAsyncStorage.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libRNCAsyncStorage.a;
|
||||
remoteRef = CDBA9120228CE3AC009F7AC7 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
CDE0D5F921D4012300E093B5 /* libRNGestureHandler.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>3.0.6</string>
|
||||
<string>3.0.8</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
7694
package-lock.json
generated
7694
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "StandardNotes",
|
||||
"version": "3.0.6",
|
||||
"versionIOS": "3.0.6",
|
||||
"versionAndroid": "3.0.6",
|
||||
"version": "3.0.8",
|
||||
"versionIOS": "3.0.8",
|
||||
"versionAndroid": "3.0.8",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@@ -30,8 +30,8 @@
|
||||
"react-navigation": "^3.0.9",
|
||||
"react-navigation-header-buttons": "^2.1.1",
|
||||
"regenerator": "^0.13.3",
|
||||
"snjs": "0.2.0",
|
||||
"standard-file-js": "0.3.58"
|
||||
"snjs": "0.2.3",
|
||||
"standard-file-js": "0.3.60"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-jest": "^23.6.0",
|
||||
|
||||
@@ -47,7 +47,6 @@ export default class ApplicationState {
|
||||
this.observers = [];
|
||||
this.eventSubscribers = [];
|
||||
this.locked = true;
|
||||
this.previousEvents = [];
|
||||
this._isAndroid = Platform.OS === "android";
|
||||
|
||||
this.setTabletModeEnabled(this.isTabletDevice);
|
||||
@@ -163,8 +162,6 @@ export default class ApplicationState {
|
||||
var isLosingFocus = nextAppState == 'inactive';
|
||||
|
||||
if(isEnteringBackground) {
|
||||
// Set most recent state before notifying observers, in case they need to query this value.
|
||||
this.mostRecentState = ApplicationState.Backgrounding;
|
||||
this.notifyOfState(ApplicationState.Backgrounding);
|
||||
|
||||
if(this.shouldLockApplication()) {
|
||||
@@ -174,17 +171,14 @@ export default class ApplicationState {
|
||||
|
||||
if(isResumingFromBackground || isResuming) {
|
||||
if(isResumingFromBackground) {
|
||||
this.mostRecentState = ApplicationState.ResumingFromBackground;
|
||||
this.notifyOfState(ApplicationState.ResumingFromBackground);
|
||||
}
|
||||
|
||||
// Notify of GainingFocus even if resuming from background
|
||||
this.mostRecentState = ApplicationState.GainingFocus;
|
||||
this.notifyOfState(ApplicationState.GainingFocus);
|
||||
}
|
||||
|
||||
if(isLosingFocus) {
|
||||
this.mostRecentState = ApplicationState.LosingFocus;
|
||||
this.notifyOfState(ApplicationState.LosingFocus);
|
||||
|
||||
// If a privileges authentication session is in progress, we don't want to lock the application
|
||||
@@ -201,9 +195,9 @@ export default class ApplicationState {
|
||||
If we are backgrounding or losing focus, I assume we no longer care about previous events that occurred.
|
||||
(This was added in relation to the issue where pressing the Android back button would reconstruct App and cause all events to be re-forwarded)
|
||||
*/
|
||||
if(isEnteringBackground || isLosingFocus) {
|
||||
this.clearPreviousState();
|
||||
}
|
||||
// if(isEnteringBackground || isLosingFocus) {
|
||||
// this.clearPreviousState();
|
||||
// }
|
||||
}
|
||||
|
||||
// Visibility change events are like active, inactive, background,
|
||||
@@ -237,16 +231,17 @@ export default class ApplicationState {
|
||||
|
||||
didLaunch() {
|
||||
this.notifyOfState(ApplicationState.Launching);
|
||||
this.mostRecentState = ApplicationState.Launching;
|
||||
}
|
||||
|
||||
notifyOfState(state) {
|
||||
if(this.ignoreStateChanges) {return;}
|
||||
|
||||
// Set most recent state before notifying observers, in case they need to query this value.
|
||||
this.mostRecentState = state;
|
||||
|
||||
for(var observer of this.observers) {
|
||||
observer.callback(state);
|
||||
}
|
||||
|
||||
this.previousEvents.push(state);
|
||||
}
|
||||
|
||||
/* End State */
|
||||
@@ -272,16 +267,16 @@ export default class ApplicationState {
|
||||
var observer = {key: Math.random, callback: callback};
|
||||
this.observers.push(observer);
|
||||
|
||||
for(var prevState of this.previousEvents) {
|
||||
callback(prevState);
|
||||
if(this.mostRecentState) {
|
||||
callback(this.mostRecentState);
|
||||
}
|
||||
|
||||
return observer;
|
||||
}
|
||||
|
||||
clearPreviousState() {
|
||||
this.previousEvents = [];
|
||||
}
|
||||
// clearPreviousState() {
|
||||
// this.previousEvents = [];
|
||||
// }
|
||||
|
||||
removeStateObserver(observer) {
|
||||
_.pull(this.observers, observer);
|
||||
|
||||
@@ -89,7 +89,10 @@ export default class Authenticate extends Abstract {
|
||||
|
||||
componentWillFocus() {
|
||||
super.componentWillFocus();
|
||||
this.begin();
|
||||
|
||||
if(ApplicationState.get().getMostRecentState() !== ApplicationState.LosingFocus) {
|
||||
this.begin();
|
||||
}
|
||||
}
|
||||
|
||||
cancel() {
|
||||
@@ -194,21 +197,37 @@ export default class Authenticate extends Abstract {
|
||||
}
|
||||
|
||||
onSuccess() {
|
||||
// Wait for componentWillBlur to call onSuccess callback.
|
||||
// Wait for componentWillBlur/componentDidlBlur to call onSuccess callback.
|
||||
// This way, if the callback has another route change, the dismissal
|
||||
// of this one won't affect it.
|
||||
this.successful = true;
|
||||
this.needsSuccessCallback = true;
|
||||
this.dismiss();
|
||||
}
|
||||
|
||||
componentWillBlur() {
|
||||
super.componentWillBlur();
|
||||
if(this.successful) {
|
||||
this.getProp("onSuccess")(this._sessionLength);
|
||||
this.successful = false;
|
||||
if(this.needsSuccessCallback) {
|
||||
this.triggerSuccessCallback();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
On Android, when pressing physical back then re-opening app and authenticating and closing modal,
|
||||
componentWillBlur is not called for some reason. componentDidBlur is called however, albiet ~2 seconds later.
|
||||
Note however that this only seems to happen on the emulator, and not on physical device.
|
||||
*/
|
||||
componentDidBlur() {
|
||||
super.componentDidBlur();
|
||||
if(this.needsSuccessCallback) {
|
||||
this.triggerSuccessCallback();
|
||||
}
|
||||
}
|
||||
|
||||
triggerSuccessCallback() {
|
||||
this.getProp("onSuccess")(this._sessionLength);
|
||||
this.needsSuccessCallback = false;
|
||||
}
|
||||
|
||||
inputTextChanged(text, source) {
|
||||
source.setAuthenticationValue(text);
|
||||
this.forceUpdate();
|
||||
|
||||
@@ -35,9 +35,10 @@ export default class ComponentView extends Component {
|
||||
let url = ComponentManager.get().urlForComponent(this.editor);
|
||||
console.log("Loading editor", url);
|
||||
|
||||
if(!url) {
|
||||
if(this.editor.offlineOnly) {
|
||||
Alert.alert('Offline Only', `You've marked ${this.editor.name} as 'offline only', which means it can only be accessed via the desktop app. To use this editor on mobile, please use the web or desktop app and check 'Use hosted when local is unavailable' in the editor's extension settings. Otherwise, please change to another editor to edit this note.`, [{text: 'OK'}])
|
||||
} else if(!url) {
|
||||
Alert.alert('Re-install Extension', `This extension is not installed correctly. Please use the web or desktop application to reinstall ${this.editor.name}, then try again.`, [{text: 'OK'}])
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,6 +142,15 @@ export default class ComponentView extends Component {
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultInjectedJavaScript = () => {
|
||||
return `(function() {
|
||||
window.parent.postMessage = function(data) {
|
||||
window.parent.ReactNativeWebView.postMessage(data);
|
||||
};
|
||||
return true;
|
||||
})()`
|
||||
}
|
||||
|
||||
render() {
|
||||
var editor = this.editor;
|
||||
var url = ComponentManager.get().urlForComponent(editor);
|
||||
@@ -153,31 +163,25 @@ export default class ComponentView extends Component {
|
||||
<Text style={this.styles.lockedText}>Extended expired. Editors are in a read-only state. To edit immediately, please switch to the Plain Editor.</Text>
|
||||
</View>
|
||||
}
|
||||
<WebView
|
||||
style={StyleKit.styles.flexContainer, {backgroundColor: "transparent"}}
|
||||
source={{uri: url}}
|
||||
key={this.editor.uuid}
|
||||
ref={(webView) => this.webView = webView}
|
||||
/* onLoad and onLoadEnd seem to be the same exact thing, except that when an error occurs, onLoadEnd is called twice, whereas onLoad is called once (what we want) */
|
||||
onLoad={this.onFrameLoad}
|
||||
onLoadStart={this.onLoadStart}
|
||||
onError={this.onLoadError}
|
||||
onMessage={this.onMessage}
|
||||
useWebKit={true}
|
||||
hideKeyboardAccessoryView={true}
|
||||
onShouldStartLoadWithRequest={this.onShouldStartLoadWithRequest}
|
||||
cacheEnabled={true}
|
||||
scalesPageToFit={true /* Android only, not available with WKWebView */}
|
||||
injectedJavaScript = {
|
||||
`(function() {
|
||||
window.parent.postMessage = function(data) {
|
||||
window.parent.ReactNativeWebView.postMessage(data);
|
||||
};
|
||||
|
||||
return true;
|
||||
})()`
|
||||
}
|
||||
/>
|
||||
{url &&
|
||||
<WebView
|
||||
style={StyleKit.styles.flexContainer, {backgroundColor: "transparent"}}
|
||||
source={{uri: url}}
|
||||
key={this.editor.uuid}
|
||||
ref={(webView) => this.webView = webView}
|
||||
/* onLoad and onLoadEnd seem to be the same exact thing, except that when an error occurs, onLoadEnd is called twice, whereas onLoad is called once (what we want) */
|
||||
onLoad={this.onFrameLoad}
|
||||
onLoadStart={this.onLoadStart}
|
||||
onError={this.onLoadError}
|
||||
onMessage={this.onMessage}
|
||||
useWebKit={true}
|
||||
hideKeyboardAccessoryView={true}
|
||||
onShouldStartLoadWithRequest={this.onShouldStartLoadWithRequest}
|
||||
cacheEnabled={true}
|
||||
scalesPageToFit={true /* Android only, not available with WKWebView */}
|
||||
injectedJavaScript={this.defaultInjectedJavaScript()}
|
||||
/>
|
||||
}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,10 @@ export default class Compose extends Abstract {
|
||||
registerObservers() {
|
||||
this.syncObserver = Sync.get().addEventHandler((event, data) => {
|
||||
|
||||
if(event == "sync:completed") {
|
||||
if(event == "sync:error") {
|
||||
this.showSavedStatus(false);
|
||||
}
|
||||
else if(event == "sync:completed") {
|
||||
let isInRetrieved = data.retrievedItems && data.retrievedItems.map((i) => i.uuid).includes(this.note.uuid);
|
||||
let isInSaved = data.savedItems && data.savedItems.map((i) => i.uuid).includes(this.note.uuid);
|
||||
if(this.note.deleted || this.note.content.trashed) {
|
||||
@@ -106,19 +109,18 @@ export default class Compose extends Abstract {
|
||||
// unnecessary renders. (on constructor it was undefined, and here, it was null, causing a re-render to occur on android, causing textview to reset cursor)
|
||||
this.setState(newState);
|
||||
}
|
||||
|
||||
if((isInSaved && !this.note.dirty) || this.saveError) {
|
||||
this.showSavedStatus(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.componentHandler = ComponentManager.get().registerHandler({identifier: "composer", areas: ["editor-editor"],
|
||||
actionHandler: (component, action, data) => {
|
||||
if(action === "save-items" || action === "save-success" || action == "save-error") {
|
||||
if(action === "save-items") {
|
||||
if(data.items.map((item) => {return item.uuid}).includes(this.note.uuid)) {
|
||||
if(action == "save-items") {
|
||||
if(this.componentSaveTimeout) clearTimeout(this.componentSaveTimeout);
|
||||
this.componentSaveTimeout = setTimeout(this.showSavingStatus.bind(this), 10);
|
||||
} else {
|
||||
this.showSavedStatus(action == "save-success");
|
||||
}
|
||||
this.showSavingStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -434,9 +436,8 @@ export default class Compose extends Abstract {
|
||||
note.dummy = false;
|
||||
ModelManager.get().addItem(note);
|
||||
}
|
||||
this.sync(note, (success) => {
|
||||
this.showSavedStatus(success);
|
||||
});
|
||||
|
||||
this.sync(note);
|
||||
}
|
||||
|
||||
reloadEditor = () => {
|
||||
|
||||
Reference in New Issue
Block a user